リビジョン | 68b31a025c76799907579ba1f9557783b5a9e7d7 (tree) |
---|---|
日時 | 2020-02-04 05:43:04 |
作者 | umorigu <umorigu@gmai...> |
コミッター | 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
* 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 |
@@ -170,10 +170,13 @@ function plugin_article_convert() | ||
170 | 170 | <input type="hidden" name="digest" value="$s_digest" /> |
171 | 171 | <input type="hidden" name="refer" value="$s_page" /> |
172 | 172 | <label for="_p_article_name_$article_no">$_btn_name</label> |
173 | - <input type="text" name="name" id="_p_article_name_$article_no" size="$name_cols" /><br /> | |
173 | + <input type="text" name="name" id="_p_article_name_$article_no" | |
174 | + size="$name_cols" class="_p_article_name" /><br /> | |
174 | 175 | <label for="_p_article_subject_$article_no">$_btn_subject</label> |
175 | - <input type="text" name="subject" id="_p_article_subject_$article_no" size="$subject_cols" /><br /> | |
176 | - <textarea name="msg" rows="$article_rows" cols="$article_cols">\n</textarea><br /> | |
176 | + <input type="text" name="subject" id="_p_article_subject_$article_no" | |
177 | + size="$subject_cols" class="_p_article_subject" /><br /> | |
178 | + <textarea name="msg" rows="$article_rows" cols="$article_cols" | |
179 | + class="_p_article_msg">\n</textarea><br /> | |
177 | 180 | <input type="submit" name="article" value="$_btn_article" /> |
178 | 181 | </div> |
179 | 182 | </form> |
@@ -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> |
@@ -144,11 +144,13 @@ function plugin_bugtrack_print_form($base, $category) | ||
144 | 144 | </tr> |
145 | 145 | <tr> |
146 | 146 | <th><label for="_p_bugtrack_summary_$id">$s_summary</label></th> |
147 | - <td><input id="_p_bugtrack_summary_$id" name="summary" size="60" type="text" /></td> | |
147 | + <td><input id="_p_bugtrack_summary_$id" name="summary" size="60" | |
148 | + class="_p_bugtrack_form_summary" type="text" /></td> | |
148 | 149 | </tr> |
149 | 150 | <tr> |
150 | 151 | <th><label for="_p_bugtrack_body_$id">$s_body</label></th> |
151 | - <td><textarea id="_p_bugtrack_body_$id" name="body" cols="60" rows="6"></textarea></td> | |
152 | + <td><textarea id="_p_bugtrack_body_$id" name="body" cols="60" rows="6" | |
153 | + class="_p_bugtrack_form_body"></textarea></td> | |
152 | 154 | </tr> |
153 | 155 | <tr> |
154 | 156 | <td colspan="2" align="center"> |
@@ -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 | // |
@@ -109,7 +109,7 @@ function plugin_comment_convert() | ||
109 | 109 | $_btn_name . '</label>' . |
110 | 110 | '<input type="text" name="name" id="_p_comment_name_' . |
111 | 111 | $comment_no . '" size="' . PLUGIN_COMMENT_SIZE_NAME . |
112 | - '" />' . "\n"; | |
112 | + '" class="_p_comment_name" />' . "\n"; | |
113 | 113 | } |
114 | 114 | $nodate = in_array('nodate', $options) ? '1' : '0'; |
115 | 115 | $above = in_array('above', $options) ? '1' : |
@@ -128,7 +128,8 @@ function plugin_comment_convert() | ||
128 | 128 | <input type="hidden" name="above" value="$above" /> |
129 | 129 | <input type="hidden" name="digest" value="$digest" /> |
130 | 130 | $nametags |
131 | - <input type="text" name="msg" id="_p_comment_comment_{$comment_no}" size="$comment_cols" /> | |
131 | + <input type="text" name="msg" id="_p_comment_comment_{$comment_no}" | |
132 | + class="_p_comment_msg" size="$comment_cols" /> | |
132 | 133 | <input type="submit" name="comment" value="$_btn_comment" /> |
133 | 134 | </div> |
134 | 135 | </form> |
@@ -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 |
@@ -121,12 +121,15 @@ function plugin_pcomment_convert() | ||
121 | 121 | $name = ''; |
122 | 122 | } else { |
123 | 123 | $title = $_pcmt_messages['btn_name']; |
124 | - $name = '<input type="text" name="name" size="' . PLUGIN_PCOMMENT_SIZE_NAME . '" />'; | |
124 | + $name = '<input type="text" name="name" size="' . | |
125 | + PLUGIN_PCOMMENT_SIZE_NAME . | |
126 | + '" class="_p_comment_name" />'; | |
125 | 127 | } |
126 | 128 | |
127 | 129 | $radio = $params['reply'] ? |
128 | 130 | '<input type="radio" name="reply" value="0" tabindex="0" checked="checked" />' : ''; |
129 | - $comment = '<input type="text" name="msg" size="' . PLUGIN_PCOMMENT_SIZE_MSG . '" />'; | |
131 | + $comment = '<input type="text" name="msg" size="' . | |
132 | + PLUGIN_PCOMMENT_SIZE_MSG . '" class="_p_comment_msg" />'; | |
130 | 133 | |
131 | 134 | $s_page = htmlsc($page); |
132 | 135 | $s_refer = htmlsc($vars_page); |
@@ -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,27 @@ span.new5 { | ||
591 | 609 | font-size:xx-small; |
592 | 610 | } |
593 | 611 | |
612 | +/* comment.inc.php */ | |
613 | +._p_comment_name { | |
614 | + width:9em; | |
615 | +} | |
616 | +._p_comment_msg { | |
617 | + width:38em; | |
618 | + max-width:90%; | |
619 | +} | |
620 | + | |
621 | +/* article.inc.php */ | |
622 | +._p_article_name { | |
623 | + width:15em; | |
624 | +} | |
625 | +._p_article_subject { | |
626 | + width:35em; | |
627 | +} | |
628 | +._p_article_msg { | |
629 | + width:38em; | |
630 | + height:5em; | |
631 | +} | |
632 | + | |
594 | 633 | /* popular.inc.php */ |
595 | 634 | span.counter { |
596 | 635 | font-size:70%; |
@@ -646,6 +685,17 @@ tr.bugtrack_state_cancel td { | ||
646 | 685 | tr.bugtrack_state_undef td { |
647 | 686 | background-color:#ff3333; |
648 | 687 | } |
688 | +._p_bugtrack_form_summary { | |
689 | + width:35em; | |
690 | +} | |
691 | +._p_bugtrack_form_body { | |
692 | + width:35em; | |
693 | +} | |
694 | + | |
695 | +/* tracker.inc.php */ | |
696 | +._p_tracker_form th { | |
697 | + min-width:5em; | |
698 | +} | |
649 | 699 | |
650 | 700 | /* search2.inc.php */ |
651 | 701 | .search-result-page-summary { |
@@ -656,6 +706,59 @@ tr.bugtrack_state_undef td { | ||
656 | 706 | white-space:nowrap; |
657 | 707 | } |
658 | 708 | |
709 | +/* Mobile-friendly Responsive layout */ | |
710 | +@media (max-width:767px) { | |
711 | + div#contents { | |
712 | + flex-flow:column wrap; | |
713 | + } | |
714 | + div#menubar { | |
715 | + width:auto; | |
716 | + max-width:none; | |
717 | + font-size:100%; | |
718 | + order:2; | |
719 | + } | |
720 | + div#body { | |
721 | + order:1; | |
722 | + } | |
723 | + div#body img { | |
724 | + max-width:95%; | |
725 | + height:auto; | |
726 | + } | |
727 | + | |
728 | + ._p_article_subject { | |
729 | + width:82%; | |
730 | + } | |
731 | + ._p_article_msg { | |
732 | + box-sizing:border-box; | |
733 | + width:99.5%; | |
734 | + } | |
735 | + | |
736 | + ._p_tracker_form th,._p_tracker_form td { | |
737 | + display:block; | |
738 | + text-align:left !important; | |
739 | + width:auto !important; | |
740 | + margin:0; | |
741 | + } | |
742 | + ._p_tracker_form td input[type=text] { | |
743 | + box-sizing:border-box; | |
744 | + width:99.5%; | |
745 | + } | |
746 | + ._p_tracker_form td textarea { | |
747 | + box-sizing:border-box; | |
748 | + width:99.5%; | |
749 | + } | |
750 | + | |
751 | + ._p_bugtrack_form th,._p_bugtrack_form td { | |
752 | + display:block; | |
753 | + text-align:left !important; | |
754 | + margin:0; | |
755 | + } | |
756 | + ._p_bugtrack_form_summary,._p_bugtrack_form_body { | |
757 | + box-sizing:border-box; | |
758 | + width:99.5%; | |
759 | + } | |
760 | +} | |
761 | + | |
659 | 762 | @media print { |
660 | 763 | a:link, |
661 | 764 | a:visited { |
@@ -664,7 +767,6 @@ tr.bugtrack_state_undef td { | ||
664 | 767 | img#logo, |
665 | 768 | div#navigator, |
666 | 769 | div#menubar, |
667 | - td.menubar, | |
668 | 770 | div#related, |
669 | 771 | div#attach, |
670 | 772 | 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> |