修訂 | c82c1359474c13245a9af91cd7b8bb9de111ce48 (tree) |
---|---|
時間 | 2020-02-08 15:30:12 |
作者 | 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
* comment, pcomment, article plugin
break-all for URL and long words
* word-break: break-all;
* overflow-wrap: break-word;
* word-wrap: break-word; (for Compatibility)
Fix too thin MenuBar for PC layout
Responsive edit_form age select for Smartphone
word-break in header
Responsive images
Set max-width of div#body
Set "word-break: break-all;" to note area
Fit textarea width to window
tracker, bugtrack plugin
@@ -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:15em; | |
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,35 @@ 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; | |
399 | +} | |
400 | + | |
401 | +@media (max-width:767px) { | |
402 | + div#contents { | |
403 | + flex-flow:column wrap; | |
404 | + } | |
405 | + div#menubar { | |
406 | + width:auto; | |
407 | + max-width:none; | |
408 | + font-size:100%; | |
409 | + order:2; | |
410 | + } | |
411 | + div#body { | |
412 | + order:1; | |
413 | + } | |
414 | + div#body img { | |
415 | + max-width:95%; | |
416 | + height:auto; | |
417 | + } | |
383 | 418 | } |
419 | + | |
384 | 420 | div#note { |
385 | 421 | clear:both; |
386 | 422 | padding:0; |
387 | 423 | margin:0; |
424 | + word-break:break-all; | |
388 | 425 | } |
389 | 426 | div#attach { |
390 | 427 | clear:both; |
@@ -591,6 +628,35 @@ span.new5 { | ||
591 | 628 | font-size:xx-small; |
592 | 629 | } |
593 | 630 | |
631 | +/* comment.inc.php */ | |
632 | +._p_comment_name { | |
633 | + width:9em; | |
634 | +} | |
635 | +._p_comment_msg { | |
636 | + width:38em; | |
637 | + max-width:90%; | |
638 | +} | |
639 | + | |
640 | +/* article.inc.php */ | |
641 | +._p_article_name { | |
642 | + width:15em; | |
643 | +} | |
644 | +._p_article_subject { | |
645 | + width:35em; | |
646 | +} | |
647 | +._p_article_msg { | |
648 | + width:38em; | |
649 | + height:5em; | |
650 | +} | |
651 | +@media (max-width:767px) { | |
652 | + ._p_article_subject { | |
653 | + width:82%; | |
654 | + } | |
655 | + ._p_article_msg { | |
656 | + width:90%; | |
657 | + } | |
658 | +} | |
659 | + | |
594 | 660 | /* popular.inc.php */ |
595 | 661 | span.counter { |
596 | 662 | font-size:70%; |
@@ -646,6 +712,49 @@ tr.bugtrack_state_cancel td { | ||
646 | 712 | tr.bugtrack_state_undef td { |
647 | 713 | background-color:#ff3333; |
648 | 714 | } |
715 | +._p_bugtrack_form_summary { | |
716 | + width:35em; | |
717 | +} | |
718 | +._p_bugtrack_form_body { | |
719 | + width:35em; | |
720 | +} | |
721 | +@media (max-width:767px) { | |
722 | + ._p_bugtrack_form th,._p_bugtrack_form td { | |
723 | + display:block; | |
724 | + text-align:left !important; | |
725 | + margin-left:2%; | |
726 | + margin-right:2%; | |
727 | + } | |
728 | +} | |
729 | + | |
730 | +/* tracker.inc.php */ | |
731 | +._p_tracker_form th { | |
732 | + min-width:5em; | |
733 | +} | |
734 | +@media (max-width:767px) { | |
735 | + ._p_tracker_form th,._p_tracker_form td { | |
736 | + display:block; | |
737 | + text-align:left !important; | |
738 | + width:auto !important; | |
739 | + margin-left:1%; | |
740 | + margin-right:1%; | |
741 | + } | |
742 | + ._p_tracker_form td input[type=text] { | |
743 | + box-sizing:border-box; | |
744 | + max-width:100%; | |
745 | + width:99.5%; | |
746 | + } | |
747 | + ._p_tracker_form td textarea { | |
748 | + width:99.5%; | |
749 | + } | |
750 | + ._p_bugtrack_form_summary { | |
751 | + width:95%; | |
752 | + } | |
753 | + ._p_bugtrack_form_body { | |
754 | + width:95%; | |
755 | + height:6em; | |
756 | + } | |
757 | +} | |
649 | 758 | |
650 | 759 | /* search2.inc.php */ |
651 | 760 | .search-result-page-summary { |
@@ -664,7 +773,6 @@ tr.bugtrack_state_undef td { | ||
664 | 773 | img#logo, |
665 | 774 | div#navigator, |
666 | 775 | div#menubar, |
667 | - td.menubar, | |
668 | 776 | div#related, |
669 | 777 | div#attach, |
670 | 778 | 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> |