• R/O
  • HTTP
  • SSH
  • HTTPS

pukiwiki: Commit


Commit MetaInfo

Revision2baa4a8a74b9207d646fbb6d5b9c6e787dc2d830 (tree)
Time2016-10-23 22:03:49
Authorumorigu <umorigu@gmai...>
Commiterumorigu

Log Message

Merge branch 'bugtrack2367_static_css'

Import a CSS improvement proposed by bee on BugTrack/2367.

Change Summary

Incremental Difference

--- a/skin/pukiwiki.css.php
+++ b/skin/pukiwiki.css.php
@@ -1,35 +1,14 @@
1-<?php
2-// PukiWiki - Yet another WikiWikiWeb clone.
3-// $Id: pukiwiki.css.php,v 1.12 2005/10/12 13:06:27 henoheno Exp $
4-// Copyright (C)
5-// 2002-2005 PukiWiki Developers Team
6-// 2001-2002 Originally written by yu-ji
7-// License: GPL v2 or (at your option) any later version
8-//
9-// Default CSS
10-
11-// Send header
12-header('Content-Type: text/css');
13-$matches = array();
14-if(ini_get('zlib.output_compression') && preg_match('/\b(gzip|deflate)\b/i', $_SERVER['HTTP_ACCEPT_ENCODING'], $matches)) {
15- header('Content-Encoding: ' . $matches[1]);
16- header('Vary: Accept-Encoding');
17-}
18-
19-// Default charset
20-$charset = isset($_GET['charset']) ? $_GET['charset'] : '';
21-switch ($charset) {
22- case 'Shift_JIS': break; /* this @charset is for Mozilla's bug */
23- default: $charset ='iso-8859-1';
24-}
25-
26-// Media
27-$media = isset($_GET['media']) ? $_GET['media'] : '';
28-if ($media != 'print') $media = 'screen';
29-
30-// Output CSS ----
31-?>
32-@charset "<?php echo $charset ?>";
1+@charset "UTF-8";
2+
3+/*!
4+ * PukiWiki - Yet another WikiWikiWeb clone.
5+ * Copyright (C)
6+ * 2002-2016 PukiWiki Development Team
7+ * 2001-2002 Originally written by yu-ji
8+ * License: GPL v2 or (at your option) any later version
9+ *
10+ * Default CSS
11+ */
3312
3413 pre, dl, ol, p, blockquote { line-height:130%; }
3514
@@ -45,13 +24,9 @@ body,td {
4524 }
4625
4726 a:link {
48-<?php if ($media == 'print') { ?>
49- text-decoration: underline;
50-<?php } else { ?>
5127 color:#215dc6;
5228 background-color:inherit;
5329 text-decoration:none;
54-<?php } ?>
5530 }
5631
5732 a:active {
@@ -61,13 +36,9 @@ a:active {
6136 }
6237
6338 a:visited {
64-<?php if ($media == 'print') { ?>
65- text-decoration: underline;
66-<?php } else { ?>
6739 color:#a63d21;
6840 background-color:inherit;
6941 text-decoration:none;
70-<?php } ?>
7142 }
7243
7344 a:hover {
@@ -335,35 +306,23 @@ div#header {
335306 }
336307
337308 div#navigator {
338-<?php if ($media == 'print') { ?>
339- display:none;
340-<?php } else { ?>
341309 clear:both;
342310 padding:4px 0px 0px 0px;
343311 margin:0px;
344-<?php } ?>
345312 }
346313
347314 td.menubar {
348-<?php if ($media == 'print') { ?>
349- display:none;
350-<?php } else { ?>
351315 width:9em;
352316 vertical-align:top;
353-<?php } ?>
354317 }
355318
356319 div#menubar {
357-<?php if ($media == 'print') { ?>
358- display:none;
359-<?php } else { ?>
360320 width:9em;
361321 padding:0px;
362322 margin:4px;
363323 word-break:break-all;
364324 font-size:90%;
365325 overflow:hidden;
366-<?php } ?>
367326 }
368327
369328 div#menubar ul {
@@ -387,24 +346,16 @@ div#note {
387346 }
388347
389348 div#attach {
390-<?php if ($media == 'print') { ?>
391- display:none;
392-<?php } else { ?>
393349 clear:both;
394350 padding:0px;
395351 margin:0px;
396-<?php } ?>
397352 }
398353
399354 div#toolbar {
400-<?php if ($media == 'print') { ?>
401- display:none;
402-<?php } else { ?>
403355 clear:both;
404356 padding:0px;
405357 margin:0px;
406358 text-align:right;
407-<?php } ?>
408359 }
409360
410361 div#lastmodified {
@@ -414,13 +365,9 @@ div#lastmodified {
414365 }
415366
416367 div#related {
417-<?php if ($media == 'print') { ?>
418- display:none;
419-<?php } else { ?>
420368 font-size:80%;
421369 padding:0px;
422370 margin:16px 0px 0px 0px;
423-<?php } ?>
424371 }
425372
426373 div#footer {
@@ -440,12 +387,8 @@ div#preview {
440387 }
441388
442389 img#logo {
443-<?php if ($media == 'print') { ?>
444- display:none;
445-<?php } else { ?>
446390 float:left;
447391 margin-right:20px;
448-<?php } ?>
449392 }
450393
451394 /* aname.inc.php */
@@ -608,7 +551,6 @@ span.new5 {
608551 /* popular.inc.php */
609552 span.counter { font-size:70%; }
610553 ul.popular_list {
611-<?php
612554 /*
613555 padding:0px;
614556 border:0px;
@@ -616,12 +558,10 @@ ul.popular_list {
616558 word-wrap:break-word;
617559 word-break:break-all;
618560 */
619-?>
620561 }
621562
622563 /* recent.inc.php,showrss.inc.php */
623564 ul.recent_list {
624-<?php
625565 /*
626566 padding:0px;
627567 border:0px;
@@ -629,7 +569,6 @@ ul.recent_list {
629569 word-wrap:break-word;
630570 word-break:break-all;
631571 */
632-?>
633572 }
634573
635574 /* ref.inc.php */
@@ -651,3 +590,19 @@ td.vote_td2 {
651590 color:inherit;
652591 background-color:#EEF5FF;
653592 }
593+
594+@media print {
595+ a:link,
596+ a:visited {
597+ text-decoration: underline;
598+ }
599+ img#logo,
600+ div#navigator,
601+ div#menubar,
602+ td.menubar,
603+ div#related,
604+ div#attach,
605+ div#toolbar {
606+ display: none;
607+ }
608+}
--- a/skin/pukiwiki.skin.php
+++ b/skin/pukiwiki.skin.php
@@ -44,12 +44,6 @@ $link = & $_LINK;
4444 $image = & $_IMAGE['skin'];
4545 $rw = ! PKWK_READONLY;
4646
47-// Decide charset for CSS
48-$css_charset = 'iso-8859-1';
49-switch(UI_LANG){
50- case 'ja': $css_charset = 'Shift_JIS'; break;
51-}
52-
5347 // MenuBar
5448 $menu = arg_check('read') && exist_plugin_convert('menu') ? do_plugin_convert('menu') : FALSE;
5549
@@ -79,8 +73,7 @@ if (isset($pkwk_dtd)) {
7973 <title><?php echo $title ?> - <?php echo $page_title ?></title>
8074
8175 <link rel="SHORTCUT ICON" href="<?php echo $image['favicon'] ?>" />
82- <link rel="stylesheet" type="text/css" media="screen" href="<?php echo SKIN_DIR ?>pukiwiki.css.php?charset=<?php echo $css_charset ?>" charset="<?php echo $css_charset ?>" />
83- <link rel="stylesheet" type="text/css" media="print" href="<?php echo SKIN_DIR ?>pukiwiki.css.php?charset=<?php echo $css_charset ?>&amp;media=print" charset="<?php echo $css_charset ?>" />
76+ <link rel="stylesheet" type="text/css" href="<?php echo SKIN_DIR ?>pukiwiki.css.php" />
8477 <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $link['rss'] ?>" /><?php // RSS auto-discovery ?>
8578
8679 <?php echo $head_tag ?>
--- a/skin/tdiary.css.php
+++ b/skin/tdiary.css.php
@@ -1,31 +1,13 @@
11 <?php
22 // PukiWiki - Yet another WikiWikiWeb clone.
3-// $Id: tdiary.css.php,v 1.6 2005/05/01 02:43:27 henoheno Exp $
43 // Copyright (C)
5-// 2002-2005 PukiWiki Developers Team
4+// 2002-2016 PukiWiki Development Team
65 // 2001-2002 Originally written by yu-ji
76 // License: GPL v2 or (at your option) any later version
87 //
98 // tDiary-css-wrapper
109
11-// Send header
1210 header('Content-Type: text/css');
13-$matches = array();
14-if(ini_get('zlib.output_compression') && preg_match('/\b(gzip|deflate)\b/i', $_SERVER['HTTP_ACCEPT_ENCODING'], $matches)) {
15- header('Content-Encoding: ' . $matches[1]);
16- header('Vary: Accept-Encoding');
17-}
18-
19-// Default charset
20-$charset = isset($_GET['charset']) ? $_GET['charset'] : '';
21-switch ($charset) {
22- case 'Shift_JIS': break; /* this @charset is for Mozilla's bug */
23- default: $charset ='iso-8859-1';
24-}
25-
26-// Media
27-$media = isset($_GET['media']) ? $_GET['media'] : '';
28-if ($media != 'print') $media = 'screen';
2911
3012 // Color theme
3113 $color_theme = isset($_GET['color']) ? $_GET['color'] : '';
@@ -95,7 +77,17 @@ default:
9577
9678 // Output CSS ----
9779 ?>
98-@charset "<?php echo $charset ?>";
80+@charset "UTF-8";
81+
82+/*!
83+ * PukiWiki - Yet another WikiWikiWeb clone.
84+ * Copyright (C)
85+ * 2002-2016 PukiWiki Development Team
86+ * 2001-2002 Originally written by yu-ji
87+ * License: GPL v2 or (at your option) any later version
88+ *
89+ * tDiary-css-wrapper
90+ */
9991
10092 /* ------------------------------------------ */
10193 /* PukiWiki abstruction CSS for tDiary themes */
@@ -285,35 +277,23 @@ div#header {
285277 }
286278
287279 div#navigator {
288-<?php if ($media == 'print') { ?>
289- display:none;
290-<?php } else { ?>
291280 clear:both;
292281 padding:4px 0px 0px 0px;
293282 margin:0px;
294-<?php } ?>
295283 }
296284
297285 td.menubar {
298-<?php if ($media == 'print') { ?>
299- display:none;
300-<?php } else { ?>
301286 width:9em;
302287 vertical-align:top;
303-<?php } ?>
304288 }
305289
306290 div#menubar {
307-<?php if ($media == 'print') { ?>
308- display:none;
309-<?php } else { ?>
310291 width:9em;
311292 padding:0px;
312293 margin:4px;
313294 word-break:break-all;
314295 font-size:90%;
315296 overflow:hidden;
316-<?php } ?>
317297 }
318298
319299 div#menubar ul {
@@ -335,24 +315,16 @@ div#note {
335315 }
336316
337317 div#attach {
338-<?php if ($media == 'print') { ?>
339- display:none;
340-<?php } else { ?>
341318 clear:both;
342319 padding:0px;
343320 margin:0px;
344-<?php } ?>
345321 }
346322
347323 div#toolbar {
348-<?php if ($media == 'print') { ?>
349- display:none;
350-<?php } else { ?>
351324 clear:both;
352325 padding:0px;
353326 margin:0px;
354327 text-align:right;
355-<?php } ?>
356328 }
357329
358330 div#lastmodified {
@@ -363,13 +335,9 @@ div#lastmodified {
363335
364336 /* for tDiary theme */
365337 div#related {
366-<?php if ($media == 'print') { ?>
367- display:none;
368-<?php } else { ?>
369338 font-size:80%;
370339 padding:0px;
371340 margin:0px 0px 0px 0px;
372-<?php } ?>
373341 }
374342
375343 div#footer {
@@ -389,12 +357,8 @@ div#preview {
389357 }
390358
391359 img#logo {
392-<?php if ($media == 'print') { ?>
393- display:none;
394-<?php } else { ?>
395360 float:left;
396361 margin-right:20px;
397-<?php } ?>
398362 }
399363
400364 /* aname.inc.php */
@@ -578,3 +542,15 @@ td.vote_td2 {
578542 color:inherit;
579543 background-color:#<?php echo $color['td.vote_td2'] ?>;
580544 }
545+
546+@media print {
547+ img#logo,
548+ div#navigator,
549+ div#menubar,
550+ td.menubar,
551+ div#related,
552+ div#attach,
553+ div#toolbar {
554+ display: none;
555+ }
556+}
--- a/skin/tdiary.skin.php
+++ b/skin/tdiary.skin.php
@@ -547,12 +547,6 @@ $link = & $_LINK;
547547 $image = & $_IMAGE['skin'];
548548 $rw = ! PKWK_READONLY;
549549
550-// Decide charset for CSS
551-$css_charset = 'iso-8859-1';
552-switch(UI_LANG){
553- case 'ja': $css_charset = 'Shift_JIS'; break;
554-}
555-
556550 // ------------------------------------------------------------
557551 // Output
558552
@@ -581,8 +575,7 @@ if (isset($pkwk_dtd)) {
581575 <link rel="SHORTCUT ICON" href="<?php echo $image['favicon'] ?>" />
582576 <link rel="stylesheet" type="text/css" media="all" href="<?php echo SKIN_DIR ?>theme/base.css" />
583577 <link rel="stylesheet" type="text/css" media="all" href="<?php echo SKIN_DIR ?>theme/<?php echo $theme ?>/<?php echo $theme ?>.css" />
584- <link rel="stylesheet" type="text/css" media="screen" href="<?php echo SKIN_DIR ?>tdiary.css.php?charset=<?php echo $css_charset ?>&amp;color=<?php echo $css_theme ?>" charset="<?php echo $css_charset ?>" />
585- <link rel="stylesheet" type="text/css" media="print" href="<?php echo SKIN_DIR ?>tdiary.css.php?charset=<?php echo $css_charset ?>&amp;color=<?php echo $css_theme ?>&amp;media=print" charset="<?php echo $css_charset ?>" />
578+ <link rel="stylesheet" type="text/css" href="<?php echo SKIN_DIR ?>tdiary.css.php?color=<?php echo $css_theme ?>" />
586579 <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $link['rss'] ?>" /><?php // RSS auto-discovery ?>
587580
588581 <?php echo $head_tag ?>
Show on old repository browser