blogger
Révision | b5c7a243be981a711086556af8c1befc7b50320d (tree) |
---|---|
l'heure | 2020-02-04 05:43:04 |
Auteur | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack/2387 Responsive layout for Smartphone
Use flexbox layout with modern web browsers that support CSS3.
Add viewport meta for device width.
* PC (over 768px): horizontal block layout
* Smartphone (under 768px): vertical stack layout
Other details:
* break-all for URL and long words
* Plugin support with media query
* Suitable word wrap properties
* Fix too thin MenuBar for PC layout
* word-break in header
* Responsive edit_form and select for Smartphone
* Responsive images (max-width: 100%)
* Set max-width of div#body
* Fit textarea width to window
@@ -2,7 +2,7 @@ | ||
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | 3 | // article.inc.php |
4 | 4 | // Copyright |
5 | -// 2002-2017 PukiWiki Development Team | |
5 | +// 2002-2020 PukiWiki Development Team | |
6 | 6 | // 2002 Originally written by OKAWARA,Satoshi <kawara@dml.co.jp> |
7 | 7 | // http://www.dml.co.jp/~kawara/pukiwiki/pukiwiki.php |
8 | 8 | // License: GPL v2 or (at your option) any later version |
@@ -163,7 +163,7 @@ function plugin_article_convert() | ||
163 | 163 | $article_rows = PLUGIN_ARTICLE_ROWS; |
164 | 164 | $article_cols = PLUGIN_ARTICLE_COLS; |
165 | 165 | $string = <<<EOD |
166 | -<form action="$script" method="post"> | |
166 | +<form action="$script" method="post" class="_p_article_form"> | |
167 | 167 | <div> |
168 | 168 | <input type="hidden" name="article_no" value="$article_no" /> |
169 | 169 | <input type="hidden" name="plugin" value="article" /> |
@@ -2,7 +2,7 @@ | ||
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | 3 | // bugtrack.inc.php |
4 | 4 | // Copyright |
5 | -// 2002-2017 PukiWiki Development Team | |
5 | +// 2002-2020 PukiWiki Development Team | |
6 | 6 | // 2002 Y.MASUI GPL2 http://masui.net/pukiwiki/ masui@masui.net |
7 | 7 | // |
8 | 8 | // BugTrack plugin |
@@ -114,7 +114,7 @@ function plugin_bugtrack_print_form($base, $category) | ||
114 | 114 | $s_body = htmlsc($_plugin_bugtrack['body']); |
115 | 115 | $s_submit = htmlsc($_plugin_bugtrack['submit']); |
116 | 116 | $body = <<<EOD |
117 | -<form action="$script" method="post"> | |
117 | +<form action="$script" method="post" class="_p_bugtrack_form"> | |
118 | 118 | <table border="0"> |
119 | 119 | <tr> |
120 | 120 | <th><label for="_p_bugtrack_name_$id">$s_name</label></th> |
@@ -2,7 +2,7 @@ | ||
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | 3 | // comment.inc.php |
4 | 4 | // Copyright |
5 | -// 2002-2017 PukiWiki Development Team | |
5 | +// 2002-2020 PukiWiki Development Team | |
6 | 6 | // 2001-2002 Originally written by yu-ji |
7 | 7 | // License: GPL v2 or (at your option) any later version |
8 | 8 | // |
@@ -119,7 +119,7 @@ function plugin_comment_convert() | ||
119 | 119 | $s_page = htmlsc($page); |
120 | 120 | $string = <<<EOD |
121 | 121 | <br /> |
122 | -<form action="$script" method="post"> | |
122 | +<form action="$script" method="post" class="_p_comment_form"> | |
123 | 123 | <div> |
124 | 124 | <input type="hidden" name="plugin" value="comment" /> |
125 | 125 | <input type="hidden" name="refer" value="$s_page" /> |
@@ -1,7 +1,7 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | 3 | // pcomment.inc.php |
4 | -// Copyright 2002-2017 PukiWiki Development Team | |
4 | +// Copyright 2002-2020 PukiWiki Development Team | |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
7 | 7 | // pcomment plugin - Show/Insert comments into specified (another) page |
@@ -133,7 +133,8 @@ function plugin_pcomment_convert() | ||
133 | 133 | $s_nodate = htmlsc($params['nodate']); |
134 | 134 | $s_count = htmlsc($count); |
135 | 135 | |
136 | - $form_start = '<form action="' . get_base_uri() . '" method="post">' . "\n"; | |
136 | + $form_start = '<form action="' . get_base_uri() . | |
137 | + '" method="post" class="_p_pcomment_form">' . "\n"; | |
137 | 138 | $form = <<<EOD |
138 | 139 | <div> |
139 | 140 | <input type="hidden" name="digest" value="$digest" /> |
@@ -1,7 +1,7 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | 3 | // tracker.inc.php |
4 | -// Copyright 2003-2018 PukiWiki Development Team | |
4 | +// Copyright 2003-2020 PukiWiki Development Team | |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
7 | 7 | // Issue tracker plugin (See Also bugtrack plugin) |
@@ -76,7 +76,8 @@ function plugin_tracker_convert() | ||
76 | 76 | $retval = str_replace("[$name]",$replace,$retval); |
77 | 77 | } |
78 | 78 | return <<<EOD |
79 | -<form enctype="multipart/form-data" action="$script" method="post"> | |
79 | +<form enctype="multipart/form-data" action="$script" method="post" | |
80 | + class="_p_tracker_form"> | |
80 | 81 | <div> |
81 | 82 | $retval |
82 | 83 | $hiddens |
@@ -24,6 +24,10 @@ body,td { | ||
24 | 24 | font-size:90%; |
25 | 25 | font-family:verdana, arial, helvetica, Sans-Serif; |
26 | 26 | } |
27 | +textarea { | |
28 | + box-sizing:border-box; | |
29 | + max-width:99.5%; | |
30 | +} | |
27 | 31 | |
28 | 32 | a:link { |
29 | 33 | color:#215dc6; |
@@ -340,11 +344,15 @@ strong.word9 { | ||
340 | 344 | .edit_form { |
341 | 345 | clear:both; |
342 | 346 | } |
347 | +.edit_form textarea,.edit_form select { | |
348 | + width:95%; | |
349 | +} | |
343 | 350 | |
344 | 351 | /* pukiwiki.skin.php */ |
345 | 352 | div#header { |
346 | 353 | padding:0; |
347 | 354 | margin:0; |
355 | + word-break:break-all; | |
348 | 356 | } |
349 | 357 | |
350 | 358 | div#navigator { |
@@ -353,18 +361,23 @@ div#navigator { | ||
353 | 361 | margin:0; |
354 | 362 | } |
355 | 363 | |
356 | -td.menubar { | |
357 | - width:9em; | |
358 | - vertical-align:top; | |
364 | +div#contents { | |
365 | + display:flex; | |
366 | + flex-flow:row nowrap; | |
367 | + word-break:break-all; | |
368 | + overflow-wrap:break-word; | |
369 | + word-wrap:break-word; | |
359 | 370 | } |
360 | 371 | |
361 | 372 | div#menubar { |
362 | - width:9em; | |
373 | + min-width:9em; | |
374 | + max-width:9em; | |
363 | 375 | padding:0; |
364 | 376 | margin:4px; |
365 | - word-break:break-all; | |
366 | 377 | font-size:90%; |
367 | 378 | overflow:hidden; |
379 | + order:1; | |
380 | + flex-grow:0; | |
368 | 381 | } |
369 | 382 | div#menubar ul { |
370 | 383 | margin:0 0 0 .5em; |
@@ -380,11 +393,16 @@ div#menubar h4 { | ||
380 | 393 | div#body { |
381 | 394 | padding:0; |
382 | 395 | margin:0 0 0 .5em; |
396 | + max-width:98%; | |
397 | + order:2; | |
398 | + flex-grow:1; | |
383 | 399 | } |
400 | + | |
384 | 401 | div#note { |
385 | 402 | clear:both; |
386 | 403 | padding:0; |
387 | 404 | margin:0; |
405 | + word-break:break-all; | |
388 | 406 | } |
389 | 407 | div#attach { |
390 | 408 | clear:both; |
@@ -591,6 +609,21 @@ span.new5 { | ||
591 | 609 | font-size:xx-small; |
592 | 610 | } |
593 | 611 | |
612 | +/* comment.inc.php */ | |
613 | +._p_comment_form input[name="msg"] { | |
614 | + max-width:90%; | |
615 | +} | |
616 | + | |
617 | +/* pcomment.inc.php */ | |
618 | +._p_pcomment_form input[name="msg"] { | |
619 | + max-width:90%; | |
620 | +} | |
621 | + | |
622 | +/* article.inc.php */ | |
623 | +._p_article_form input[name="subject"] { | |
624 | + max-width:82%; | |
625 | +} | |
626 | + | |
594 | 627 | /* popular.inc.php */ |
595 | 628 | span.counter { |
596 | 629 | font-size:70%; |
@@ -646,6 +679,17 @@ tr.bugtrack_state_cancel td { | ||
646 | 679 | tr.bugtrack_state_undef td { |
647 | 680 | background-color:#ff3333; |
648 | 681 | } |
682 | +._p_bugtrack_form input[name="summary"], | |
683 | +._p_bugtrack_form textarea { | |
684 | + box-sizing:border-box; | |
685 | + width:35em; | |
686 | + max-width:99.5%; | |
687 | +} | |
688 | + | |
689 | +/* tracker.inc.php */ | |
690 | +._p_tracker_form th { | |
691 | + min-width:5em; | |
692 | +} | |
649 | 693 | |
650 | 694 | /* search2.inc.php */ |
651 | 695 | .search-result-page-summary { |
@@ -656,6 +700,49 @@ tr.bugtrack_state_undef td { | ||
656 | 700 | white-space:nowrap; |
657 | 701 | } |
658 | 702 | |
703 | +/* Mobile-friendly Responsive layout */ | |
704 | +@media (max-width:767px) { | |
705 | + div#contents { | |
706 | + flex-flow:column wrap; | |
707 | + } | |
708 | + div#menubar { | |
709 | + width:auto; | |
710 | + max-width:none; | |
711 | + font-size:100%; | |
712 | + order:2; | |
713 | + } | |
714 | + div#body { | |
715 | + order:1; | |
716 | + } | |
717 | + div#body img { | |
718 | + max-width:95%; | |
719 | + height:auto; | |
720 | + } | |
721 | + | |
722 | + ._p_tracker_form th,._p_tracker_form td { | |
723 | + display:block; | |
724 | + text-align:left !important; | |
725 | + width:auto !important; | |
726 | + margin:0; | |
727 | + } | |
728 | + ._p_tracker_form td input[type=text], | |
729 | + ._p_tracker_form td textarea { | |
730 | + box-sizing:border-box; | |
731 | + width:99.5%; | |
732 | + } | |
733 | + | |
734 | + ._p_bugtrack_form th,._p_bugtrack_form td { | |
735 | + display:block; | |
736 | + text-align:left !important; | |
737 | + margin:0; | |
738 | + } | |
739 | + ._p_bugtrack_form input[name="summary"], | |
740 | + ._p_bugtrack_form textarea { | |
741 | + box-sizing:border-box; | |
742 | + width:99.5%; | |
743 | + } | |
744 | +} | |
745 | + | |
659 | 746 | @media print { |
660 | 747 | a:link, |
661 | 748 | a:visited { |
@@ -664,7 +751,6 @@ tr.bugtrack_state_undef td { | ||
664 | 751 | img#logo, |
665 | 752 | div#navigator, |
666 | 753 | div#menubar, |
667 | - td.menubar, | |
668 | 754 | div#related, |
669 | 755 | div#attach, |
670 | 756 | div#toolbar { |
@@ -2,7 +2,7 @@ | ||
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | 3 | // pukiwiki.skin.php |
4 | 4 | // Copyright |
5 | -// 2002-2017 PukiWiki Development Team | |
5 | +// 2002-2020 PukiWiki Development Team | |
6 | 6 | // 2001-2002 Originally written by yu-ji |
7 | 7 | // License: GPL v2 or (at your option) any later version |
8 | 8 | // |
@@ -61,6 +61,7 @@ header('Content-Type: text/html; charset=' . CONTENT_CHARSET); | ||
61 | 61 | <html lang="<?php echo LANG ?>"> |
62 | 62 | <head> |
63 | 63 | <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CONTENT_CHARSET ?>" /> |
64 | + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
64 | 65 | <?php if ($nofollow || ! $is_read) { ?> <meta name="robots" content="NOINDEX,NOFOLLOW" /><?php } ?> |
65 | 66 | <?php if ($html_meta_referrer_policy) { ?> <meta name="referrer" content="<?php echo htmlsc(html_meta_referrer_policy) ?>" /><?php } ?> |
66 | 67 |
@@ -153,20 +154,12 @@ function _navigator($key, $value = '', $javascript = ''){ | ||
153 | 154 | |
154 | 155 | <?php echo $hr ?> |
155 | 156 | |
157 | +<div id="contents"> | |
158 | + <div id="body"><?php echo $body ?></div> | |
156 | 159 | <?php if ($menu !== FALSE) { ?> |
157 | -<table border="0" style="width:100%"> | |
158 | - <tr> | |
159 | - <td class="menubar"> | |
160 | - <div id="menubar"><?php echo $menu ?></div> | |
161 | - </td> | |
162 | - <td valign="top"> | |
163 | - <div id="body"><?php echo $body ?></div> | |
164 | - </td> | |
165 | - </tr> | |
166 | -</table> | |
167 | -<?php } else { ?> | |
168 | -<div id="body"><?php echo $body ?></div> | |
160 | + <div id="menubar"><?php echo $menu ?></div> | |
169 | 161 | <?php } ?> |
162 | +</div> | |
170 | 163 | |
171 | 164 | <?php if ($notes != '') { ?> |
172 | 165 | <div id="note"><?php echo $notes ?></div> |