• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

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

blogger


Commit MetaInfo

Révisionb5c7a243be981a711086556af8c1befc7b50320d (tree)
l'heure2020-02-04 05:43:04
Auteurumorigu <umorigu@gmai...>
Commiterumorigu

Message de Log

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

  • comment, pcomment and article plugin
  • tracker and bugtrack plugin

* Suitable word wrap properties

  • word-break: break-all;
  • overflow-wrap: break-word;
  • word-wrap: break-word; (for Compatibility)

* 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

Change Summary

Modification

--- 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
@@ -163,7 +163,7 @@ function plugin_article_convert()
163163 $article_rows = PLUGIN_ARTICLE_ROWS;
164164 $article_cols = PLUGIN_ARTICLE_COLS;
165165 $string = <<<EOD
166-<form action="$script" method="post">
166+<form action="$script" method="post" class="_p_article_form">
167167 <div>
168168 <input type="hidden" name="article_no" value="$article_no" />
169169 <input type="hidden" name="plugin" value="article" />
--- 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>
--- 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 //
@@ -119,7 +119,7 @@ function plugin_comment_convert()
119119 $s_page = htmlsc($page);
120120 $string = <<<EOD
121121 <br />
122-<form action="$script" method="post">
122+<form action="$script" method="post" class="_p_comment_form">
123123 <div>
124124 <input type="hidden" name="plugin" value="comment" />
125125 <input type="hidden" name="refer" value="$s_page" />
--- 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
@@ -133,7 +133,8 @@ function plugin_pcomment_convert()
133133 $s_nodate = htmlsc($params['nodate']);
134134 $s_count = htmlsc($count);
135135
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";
137138 $form = <<<EOD
138139 <div>
139140 <input type="hidden" name="digest" value="$digest" />
--- 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:9em;
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,16 @@ 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;
383399 }
400+
384401 div#note {
385402 clear:both;
386403 padding:0;
387404 margin:0;
405+ word-break:break-all;
388406 }
389407 div#attach {
390408 clear:both;
@@ -591,6 +609,21 @@ span.new5 {
591609 font-size:xx-small;
592610 }
593611
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+
594627 /* popular.inc.php */
595628 span.counter {
596629 font-size:70%;
@@ -646,6 +679,17 @@ tr.bugtrack_state_cancel td {
646679 tr.bugtrack_state_undef td {
647680 background-color:#ff3333;
648681 }
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+}
649693
650694 /* search2.inc.php */
651695 .search-result-page-summary {
@@ -656,6 +700,49 @@ tr.bugtrack_state_undef td {
656700 white-space:nowrap;
657701 }
658702
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+
659746 @media print {
660747 a:link,
661748 a:visited {
@@ -664,7 +751,6 @@ tr.bugtrack_state_undef td {
664751 img#logo,
665752 div#navigator,
666753 div#menubar,
667- td.menubar,
668754 div#related,
669755 div#attach,
670756 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>