リビジョン | 6506c6df874a3e661581eaf78497a652382fff42 (tree) |
---|---|
日時 | 2016-10-23 21:38:42 |
作者 | Akito Hachiya <s.beec1e@gmai...> |
コミッター | umorigu |
Remove media selector, use media query
@@ -16,10 +16,6 @@ if(ini_get('zlib.output_compression') && preg_match('/\b(gzip|deflate)\b/i', $_S | ||
16 | 16 | header('Vary: Accept-Encoding'); |
17 | 17 | } |
18 | 18 | |
19 | -// Media | |
20 | -$media = isset($_GET['media']) ? $_GET['media'] : ''; | |
21 | -if ($media != 'print') $media = 'screen'; | |
22 | - | |
23 | 19 | // Output CSS ---- |
24 | 20 | ?> |
25 | 21 | @charset "UTF-8"; |
@@ -38,13 +34,9 @@ body,td { | ||
38 | 34 | } |
39 | 35 | |
40 | 36 | a:link { |
41 | -<?php if ($media == 'print') { ?> | |
42 | - text-decoration: underline; | |
43 | -<?php } else { ?> | |
44 | 37 | color:#215dc6; |
45 | 38 | background-color:inherit; |
46 | 39 | text-decoration:none; |
47 | -<?php } ?> | |
48 | 40 | } |
49 | 41 | |
50 | 42 | a:active { |
@@ -54,13 +46,9 @@ a:active { | ||
54 | 46 | } |
55 | 47 | |
56 | 48 | a:visited { |
57 | -<?php if ($media == 'print') { ?> | |
58 | - text-decoration: underline; | |
59 | -<?php } else { ?> | |
60 | 49 | color:#a63d21; |
61 | 50 | background-color:inherit; |
62 | 51 | text-decoration:none; |
63 | -<?php } ?> | |
64 | 52 | } |
65 | 53 | |
66 | 54 | a:hover { |
@@ -328,35 +316,23 @@ div#header { | ||
328 | 316 | } |
329 | 317 | |
330 | 318 | div#navigator { |
331 | -<?php if ($media == 'print') { ?> | |
332 | - display:none; | |
333 | -<?php } else { ?> | |
334 | 319 | clear:both; |
335 | 320 | padding:4px 0px 0px 0px; |
336 | 321 | margin:0px; |
337 | -<?php } ?> | |
338 | 322 | } |
339 | 323 | |
340 | 324 | td.menubar { |
341 | -<?php if ($media == 'print') { ?> | |
342 | - display:none; | |
343 | -<?php } else { ?> | |
344 | 325 | width:9em; |
345 | 326 | vertical-align:top; |
346 | -<?php } ?> | |
347 | 327 | } |
348 | 328 | |
349 | 329 | div#menubar { |
350 | -<?php if ($media == 'print') { ?> | |
351 | - display:none; | |
352 | -<?php } else { ?> | |
353 | 330 | width:9em; |
354 | 331 | padding:0px; |
355 | 332 | margin:4px; |
356 | 333 | word-break:break-all; |
357 | 334 | font-size:90%; |
358 | 335 | overflow:hidden; |
359 | -<?php } ?> | |
360 | 336 | } |
361 | 337 | |
362 | 338 | div#menubar ul { |
@@ -380,24 +356,16 @@ div#note { | ||
380 | 356 | } |
381 | 357 | |
382 | 358 | div#attach { |
383 | -<?php if ($media == 'print') { ?> | |
384 | - display:none; | |
385 | -<?php } else { ?> | |
386 | 359 | clear:both; |
387 | 360 | padding:0px; |
388 | 361 | margin:0px; |
389 | -<?php } ?> | |
390 | 362 | } |
391 | 363 | |
392 | 364 | div#toolbar { |
393 | -<?php if ($media == 'print') { ?> | |
394 | - display:none; | |
395 | -<?php } else { ?> | |
396 | 365 | clear:both; |
397 | 366 | padding:0px; |
398 | 367 | margin:0px; |
399 | 368 | text-align:right; |
400 | -<?php } ?> | |
401 | 369 | } |
402 | 370 | |
403 | 371 | div#lastmodified { |
@@ -407,13 +375,9 @@ div#lastmodified { | ||
407 | 375 | } |
408 | 376 | |
409 | 377 | div#related { |
410 | -<?php if ($media == 'print') { ?> | |
411 | - display:none; | |
412 | -<?php } else { ?> | |
413 | 378 | font-size:80%; |
414 | 379 | padding:0px; |
415 | 380 | margin:16px 0px 0px 0px; |
416 | -<?php } ?> | |
417 | 381 | } |
418 | 382 | |
419 | 383 | div#footer { |
@@ -433,12 +397,8 @@ div#preview { | ||
433 | 397 | } |
434 | 398 | |
435 | 399 | img#logo { |
436 | -<?php if ($media == 'print') { ?> | |
437 | - display:none; | |
438 | -<?php } else { ?> | |
439 | 400 | float:left; |
440 | 401 | margin-right:20px; |
441 | -<?php } ?> | |
442 | 402 | } |
443 | 403 | |
444 | 404 | /* aname.inc.php */ |
@@ -601,7 +561,6 @@ span.new5 { | ||
601 | 561 | /* popular.inc.php */ |
602 | 562 | span.counter { font-size:70%; } |
603 | 563 | ul.popular_list { |
604 | -<?php | |
605 | 564 | /* |
606 | 565 | padding:0px; |
607 | 566 | border:0px; |
@@ -609,12 +568,10 @@ ul.popular_list { | ||
609 | 568 | word-wrap:break-word; |
610 | 569 | word-break:break-all; |
611 | 570 | */ |
612 | -?> | |
613 | 571 | } |
614 | 572 | |
615 | 573 | /* recent.inc.php,showrss.inc.php */ |
616 | 574 | ul.recent_list { |
617 | -<?php | |
618 | 575 | /* |
619 | 576 | padding:0px; |
620 | 577 | border:0px; |
@@ -622,7 +579,6 @@ ul.recent_list { | ||
622 | 579 | word-wrap:break-word; |
623 | 580 | word-break:break-all; |
624 | 581 | */ |
625 | -?> | |
626 | 582 | } |
627 | 583 | |
628 | 584 | /* ref.inc.php */ |
@@ -644,3 +600,19 @@ td.vote_td2 { | ||
644 | 600 | color:inherit; |
645 | 601 | background-color:#EEF5FF; |
646 | 602 | } |
603 | + | |
604 | +@media print { | |
605 | + a:link, | |
606 | + a:visited { | |
607 | + text-decoration: underline; | |
608 | + } | |
609 | + img#logo, | |
610 | + div#navigator, | |
611 | + div#menubar, | |
612 | + td.menubar, | |
613 | + div#related, | |
614 | + div#attach, | |
615 | + div#toolbar { | |
616 | + display: none; | |
617 | + } | |
618 | +} |
@@ -73,8 +73,7 @@ if (isset($pkwk_dtd)) { | ||
73 | 73 | <title><?php echo $title ?> - <?php echo $page_title ?></title> |
74 | 74 | |
75 | 75 | <link rel="SHORTCUT ICON" href="<?php echo $image['favicon'] ?>" /> |
76 | - <link rel="stylesheet" type="text/css" media="screen" href="<?php echo SKIN_DIR ?>pukiwiki.css.php" /> | |
77 | - <link rel="stylesheet" type="text/css" media="print" href="<?php echo SKIN_DIR ?>pukiwiki.css.php?media=print" /> | |
76 | + <link rel="stylesheet" type="text/css" href="<?php echo SKIN_DIR ?>pukiwiki.css.php" /> | |
78 | 77 | <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $link['rss'] ?>" /><?php // RSS auto-discovery ?> |
79 | 78 | |
80 | 79 | <?php echo $head_tag ?> |
@@ -16,10 +16,6 @@ if(ini_get('zlib.output_compression') && preg_match('/\b(gzip|deflate)\b/i', $_S | ||
16 | 16 | header('Vary: Accept-Encoding'); |
17 | 17 | } |
18 | 18 | |
19 | -// Media | |
20 | -$media = isset($_GET['media']) ? $_GET['media'] : ''; | |
21 | -if ($media != 'print') $media = 'screen'; | |
22 | - | |
23 | 19 | // Color theme |
24 | 20 | $color_theme = isset($_GET['color']) ? $_GET['color'] : ''; |
25 | 21 |
@@ -278,35 +274,23 @@ div#header { | ||
278 | 274 | } |
279 | 275 | |
280 | 276 | div#navigator { |
281 | -<?php if ($media == 'print') { ?> | |
282 | - display:none; | |
283 | -<?php } else { ?> | |
284 | 277 | clear:both; |
285 | 278 | padding:4px 0px 0px 0px; |
286 | 279 | margin:0px; |
287 | -<?php } ?> | |
288 | 280 | } |
289 | 281 | |
290 | 282 | td.menubar { |
291 | -<?php if ($media == 'print') { ?> | |
292 | - display:none; | |
293 | -<?php } else { ?> | |
294 | 283 | width:9em; |
295 | 284 | vertical-align:top; |
296 | -<?php } ?> | |
297 | 285 | } |
298 | 286 | |
299 | 287 | div#menubar { |
300 | -<?php if ($media == 'print') { ?> | |
301 | - display:none; | |
302 | -<?php } else { ?> | |
303 | 288 | width:9em; |
304 | 289 | padding:0px; |
305 | 290 | margin:4px; |
306 | 291 | word-break:break-all; |
307 | 292 | font-size:90%; |
308 | 293 | overflow:hidden; |
309 | -<?php } ?> | |
310 | 294 | } |
311 | 295 | |
312 | 296 | div#menubar ul { |
@@ -328,24 +312,16 @@ div#note { | ||
328 | 312 | } |
329 | 313 | |
330 | 314 | div#attach { |
331 | -<?php if ($media == 'print') { ?> | |
332 | - display:none; | |
333 | -<?php } else { ?> | |
334 | 315 | clear:both; |
335 | 316 | padding:0px; |
336 | 317 | margin:0px; |
337 | -<?php } ?> | |
338 | 318 | } |
339 | 319 | |
340 | 320 | div#toolbar { |
341 | -<?php if ($media == 'print') { ?> | |
342 | - display:none; | |
343 | -<?php } else { ?> | |
344 | 321 | clear:both; |
345 | 322 | padding:0px; |
346 | 323 | margin:0px; |
347 | 324 | text-align:right; |
348 | -<?php } ?> | |
349 | 325 | } |
350 | 326 | |
351 | 327 | div#lastmodified { |
@@ -356,13 +332,9 @@ div#lastmodified { | ||
356 | 332 | |
357 | 333 | /* for tDiary theme */ |
358 | 334 | div#related { |
359 | -<?php if ($media == 'print') { ?> | |
360 | - display:none; | |
361 | -<?php } else { ?> | |
362 | 335 | font-size:80%; |
363 | 336 | padding:0px; |
364 | 337 | margin:0px 0px 0px 0px; |
365 | -<?php } ?> | |
366 | 338 | } |
367 | 339 | |
368 | 340 | div#footer { |
@@ -382,12 +354,8 @@ div#preview { | ||
382 | 354 | } |
383 | 355 | |
384 | 356 | img#logo { |
385 | -<?php if ($media == 'print') { ?> | |
386 | - display:none; | |
387 | -<?php } else { ?> | |
388 | 357 | float:left; |
389 | 358 | margin-right:20px; |
390 | -<?php } ?> | |
391 | 359 | } |
392 | 360 | |
393 | 361 | /* aname.inc.php */ |
@@ -571,3 +539,15 @@ td.vote_td2 { | ||
571 | 539 | color:inherit; |
572 | 540 | background-color:#<?php echo $color['td.vote_td2'] ?>; |
573 | 541 | } |
542 | + | |
543 | +@media print { | |
544 | + img#logo, | |
545 | + div#navigator, | |
546 | + div#menubar, | |
547 | + td.menubar, | |
548 | + div#related, | |
549 | + div#attach, | |
550 | + div#toolbar { | |
551 | + display: none; | |
552 | + } | |
553 | +} |
@@ -575,8 +575,7 @@ if (isset($pkwk_dtd)) { | ||
575 | 575 | <link rel="SHORTCUT ICON" href="<?php echo $image['favicon'] ?>" /> |
576 | 576 | <link rel="stylesheet" type="text/css" media="all" href="<?php echo SKIN_DIR ?>theme/base.css" /> |
577 | 577 | <link rel="stylesheet" type="text/css" media="all" href="<?php echo SKIN_DIR ?>theme/<?php echo $theme ?>/<?php echo $theme ?>.css" /> |
578 | - <link rel="stylesheet" type="text/css" media="screen" href="<?php echo SKIN_DIR ?>tdiary.css.php?color=<?php echo $css_theme ?>" /> | |
579 | - <link rel="stylesheet" type="text/css" media="print" href="<?php echo SKIN_DIR ?>tdiary.css.php?color=<?php echo $css_theme ?>&media=print" /> | |
578 | + <link rel="stylesheet" type="text/css" href="<?php echo SKIN_DIR ?>tdiary.css.php?color=<?php echo $css_theme ?>" /> | |
580 | 579 | <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $link['rss'] ?>" /><?php // RSS auto-discovery ?> |
581 | 580 | |
582 | 581 | <?php echo $head_tag ?> |