• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂c82c1359474c13245a9af91cd7b8bb9de111ce48 (tree)
時間2020-02-08 15:30:12
作者umorigu <umorigu@gmai...>
Commiterumorigu

Log Message

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

Change Summary

差異

--- a/plugin/article.inc.php
+++ b/plugin/article.inc.php
@@ -2,7 +2,7 @@
22 // PukiWiki - Yet another WikiWikiWeb clone
33 // article.inc.php
44 // Copyright
5-// 2002-2017 PukiWiki Development Team
5+// 2002-2020 PukiWiki Development Team
66 // 2002 Originally written by OKAWARA,Satoshi <kawara@dml.co.jp>
77 // http://www.dml.co.jp/~kawara/pukiwiki/pukiwiki.php
88 // License: GPL v2 or (at your option) any later version
@@ -170,10 +170,13 @@ function plugin_article_convert()
170170 <input type="hidden" name="digest" value="$s_digest" />
171171 <input type="hidden" name="refer" value="$s_page" />
172172 <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 />
174175 <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 />
177180 <input type="submit" name="article" value="$_btn_article" />
178181 </div>
179182 </form>
--- a/plugin/bugtrack.inc.php
+++ b/plugin/bugtrack.inc.php
@@ -2,7 +2,7 @@
22 // PukiWiki - Yet another WikiWikiWeb clone.
33 // bugtrack.inc.php
44 // Copyright
5-// 2002-2017 PukiWiki Development Team
5+// 2002-2020 PukiWiki Development Team
66 // 2002 Y.MASUI GPL2 http://masui.net/pukiwiki/ masui@masui.net
77 //
88 // BugTrack plugin
@@ -114,7 +114,7 @@ function plugin_bugtrack_print_form($base, $category)
114114 $s_body = htmlsc($_plugin_bugtrack['body']);
115115 $s_submit = htmlsc($_plugin_bugtrack['submit']);
116116 $body = <<<EOD
117-<form action="$script" method="post">
117+<form action="$script" method="post" class="_p_bugtrack_form">
118118 <table border="0">
119119 <tr>
120120 <th><label for="_p_bugtrack_name_$id">$s_name</label></th>
@@ -144,11 +144,13 @@ function plugin_bugtrack_print_form($base, $category)
144144 </tr>
145145 <tr>
146146 <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>
148149 </tr>
149150 <tr>
150151 <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>
152154 </tr>
153155 <tr>
154156 <td colspan="2" align="center">
--- a/plugin/comment.inc.php
+++ b/plugin/comment.inc.php
@@ -2,7 +2,7 @@
22 // PukiWiki - Yet another WikiWikiWeb clone
33 // comment.inc.php
44 // Copyright
5-// 2002-2017 PukiWiki Development Team
5+// 2002-2020 PukiWiki Development Team
66 // 2001-2002 Originally written by yu-ji
77 // License: GPL v2 or (at your option) any later version
88 //
@@ -109,7 +109,7 @@ function plugin_comment_convert()
109109 $_btn_name . '</label>' .
110110 '<input type="text" name="name" id="_p_comment_name_' .
111111 $comment_no . '" size="' . PLUGIN_COMMENT_SIZE_NAME .
112- '" />' . "\n";
112+ '" class="_p_comment_name" />' . "\n";
113113 }
114114 $nodate = in_array('nodate', $options) ? '1' : '0';
115115 $above = in_array('above', $options) ? '1' :
@@ -128,7 +128,8 @@ function plugin_comment_convert()
128128 <input type="hidden" name="above" value="$above" />
129129 <input type="hidden" name="digest" value="$digest" />
130130 $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" />
132133 <input type="submit" name="comment" value="$_btn_comment" />
133134 </div>
134135 </form>
--- a/plugin/pcomment.inc.php
+++ b/plugin/pcomment.inc.php
@@ -1,7 +1,7 @@
11 <?php
22 // PukiWiki - Yet another WikiWikiWeb clone
33 // pcomment.inc.php
4-// Copyright 2002-2017 PukiWiki Development Team
4+// Copyright 2002-2020 PukiWiki Development Team
55 // License: GPL v2 or (at your option) any later version
66 //
77 // pcomment plugin - Show/Insert comments into specified (another) page
@@ -121,12 +121,15 @@ function plugin_pcomment_convert()
121121 $name = '';
122122 } else {
123123 $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" />';
125127 }
126128
127129 $radio = $params['reply'] ?
128130 '<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" />';
130133
131134 $s_page = htmlsc($page);
132135 $s_refer = htmlsc($vars_page);
--- a/plugin/tracker.inc.php
+++ b/plugin/tracker.inc.php
@@ -1,7 +1,7 @@
11 <?php
22 // PukiWiki - Yet another WikiWikiWeb clone
33 // tracker.inc.php
4-// Copyright 2003-2018 PukiWiki Development Team
4+// Copyright 2003-2020 PukiWiki Development Team
55 // License: GPL v2 or (at your option) any later version
66 //
77 // Issue tracker plugin (See Also bugtrack plugin)
@@ -76,7 +76,8 @@ function plugin_tracker_convert()
7676 $retval = str_replace("[$name]",$replace,$retval);
7777 }
7878 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">
8081 <div>
8182 $retval
8283 $hiddens
--- a/skin/pukiwiki.css
+++ b/skin/pukiwiki.css
@@ -24,6 +24,10 @@ body,td {
2424 font-size:90%;
2525 font-family:verdana, arial, helvetica, Sans-Serif;
2626 }
27+textarea {
28+ box-sizing:border-box;
29+ max-width:99.5%;
30+}
2731
2832 a:link {
2933 color:#215dc6;
@@ -340,11 +344,15 @@ strong.word9 {
340344 .edit_form {
341345 clear:both;
342346 }
347+.edit_form textarea,.edit_form select {
348+ width:95%;
349+}
343350
344351 /* pukiwiki.skin.php */
345352 div#header {
346353 padding:0;
347354 margin:0;
355+ word-break:break-all;
348356 }
349357
350358 div#navigator {
@@ -353,18 +361,23 @@ div#navigator {
353361 margin:0;
354362 }
355363
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;
359370 }
360371
361372 div#menubar {
362- width:9em;
373+ min-width:9em;
374+ max-width:15em;
363375 padding:0;
364376 margin:4px;
365- word-break:break-all;
366377 font-size:90%;
367378 overflow:hidden;
379+ order:1;
380+ flex-grow:0;
368381 }
369382 div#menubar ul {
370383 margin:0 0 0 .5em;
@@ -380,11 +393,35 @@ div#menubar h4 {
380393 div#body {
381394 padding:0;
382395 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+ }
383418 }
419+
384420 div#note {
385421 clear:both;
386422 padding:0;
387423 margin:0;
424+ word-break:break-all;
388425 }
389426 div#attach {
390427 clear:both;
@@ -591,6 +628,35 @@ span.new5 {
591628 font-size:xx-small;
592629 }
593630
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+
594660 /* popular.inc.php */
595661 span.counter {
596662 font-size:70%;
@@ -646,6 +712,49 @@ tr.bugtrack_state_cancel td {
646712 tr.bugtrack_state_undef td {
647713 background-color:#ff3333;
648714 }
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+}
649758
650759 /* search2.inc.php */
651760 .search-result-page-summary {
@@ -664,7 +773,6 @@ tr.bugtrack_state_undef td {
664773 img#logo,
665774 div#navigator,
666775 div#menubar,
667- td.menubar,
668776 div#related,
669777 div#attach,
670778 div#toolbar {
--- a/skin/pukiwiki.skin.php
+++ b/skin/pukiwiki.skin.php
@@ -2,7 +2,7 @@
22 // PukiWiki - Yet another WikiWikiWeb clone.
33 // pukiwiki.skin.php
44 // Copyright
5-// 2002-2017 PukiWiki Development Team
5+// 2002-2020 PukiWiki Development Team
66 // 2001-2002 Originally written by yu-ji
77 // License: GPL v2 or (at your option) any later version
88 //
@@ -61,6 +61,7 @@ header('Content-Type: text/html; charset=' . CONTENT_CHARSET);
6161 <html lang="<?php echo LANG ?>">
6262 <head>
6363 <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" />
6465 <?php if ($nofollow || ! $is_read) { ?> <meta name="robots" content="NOINDEX,NOFOLLOW" /><?php } ?>
6566 <?php if ($html_meta_referrer_policy) { ?> <meta name="referrer" content="<?php echo htmlsc(html_meta_referrer_policy) ?>" /><?php } ?>
6667
@@ -153,20 +154,12 @@ function _navigator($key, $value = '', $javascript = ''){
153154
154155 <?php echo $hr ?>
155156
157+<div id="contents">
158+ <div id="body"><?php echo $body ?></div>
156159 <?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>
169161 <?php } ?>
162+</div>
170163
171164 <?php if ($notes != '') { ?>
172165 <div id="note"><?php echo $notes ?></div>