Revision | b963e2bc596ef07c998810211f741c270da4febb (tree) |
---|---|
Zeit | 2017-08-27 06:44:36 |
Autor | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack/2426 topicpath plugin - Use CSS layout for slashes
@@ -1,14 +1,14 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | -// $Id: topicpath.inc.php,v 1.9 2011/01/25 15:01:01 henoheno Exp $ | |
4 | -// Copyright (C) | |
5 | -// 2004-2005 PukiWiki Developers Team | |
3 | +// topicpath.inc.php | |
4 | +// Copyright | |
5 | +// 2004-2017 PukiWiki Development Team | |
6 | 6 | // 2003 reimy (Some bug fix) |
7 | 7 | // 2003 t.m (Migrate to 1.3) |
8 | 8 | // 2003 Nibun-no-ni (Originally written for PukiWiki 1.4.x) |
9 | -// License: GPL (any version) | |
9 | +// License: GPL v2 or (at your option) any later version | |
10 | 10 | // |
11 | -// 'topicpath' plugin for PukiWiki, available under GPL | |
11 | +// 'topicpath' plugin for PukiWiki | |
12 | 12 | |
13 | 13 | // Show a link to $defaultpage or not |
14 | 14 | define('PLUGIN_TOPICPATH_TOP_DISPLAY', 1); |
@@ -17,7 +17,7 @@ define('PLUGIN_TOPICPATH_TOP_DISPLAY', 1); | ||
17 | 17 | define('PLUGIN_TOPICPATH_TOP_LABEL', 'Top'); |
18 | 18 | |
19 | 19 | // Separetor / of / topic / path |
20 | -define('PLUGIN_TOPICPATH_TOP_SEPARATOR', ' / '); | |
20 | +define('PLUGIN_TOPICPATH_TOP_SEPARATOR', '<span class="topicpath-slash">/</span>'); | |
21 | 21 | |
22 | 22 | // Show the page itself or not |
23 | 23 | define('PLUGIN_TOPICPATH_THIS_PAGE_DISPLAY', 1); |
@@ -32,8 +32,9 @@ function plugin_topicpath_convert() | ||
32 | 32 | |
33 | 33 | function plugin_topicpath_inline() |
34 | 34 | { |
35 | - global $script, $vars, $defaultpage; | |
35 | + global $vars, $defaultpage; | |
36 | 36 | |
37 | + $script = get_script_uri(); | |
37 | 38 | $page = isset($vars['page']) ? $vars['page'] : ''; |
38 | 39 | if ($page == '' || $page == $defaultpage) return ''; |
39 | 40 |
@@ -64,10 +65,11 @@ function plugin_topicpath_inline() | ||
64 | 65 | $element . '</a>'; |
65 | 66 | } |
66 | 67 | } |
67 | - | |
68 | - if (PLUGIN_TOPICPATH_TOP_DISPLAY) | |
69 | - $topic_path[] = make_pagelink($defaultpage, PLUGIN_TOPICPATH_TOP_LABEL); | |
70 | - | |
71 | - return join(PLUGIN_TOPICPATH_TOP_SEPARATOR, array_reverse($topic_path)); | |
68 | + $s = join(PLUGIN_TOPICPATH_TOP_SEPARATOR, array_reverse($topic_path)); | |
69 | + if (PLUGIN_TOPICPATH_TOP_DISPLAY) { | |
70 | + $s = '<span class="topicpath-top">' . | |
71 | + make_pagelink($defaultpage, PLUGIN_TOPICPATH_TOP_LABEL) . | |
72 | + PLUGIN_TOPICPATH_TOP_SEPARATOR . '</span>' . $s; | |
73 | + } | |
74 | + return $s; | |
72 | 75 | } |
73 | - |
@@ -610,6 +610,14 @@ td.vote_td2 { | ||
610 | 610 | background-color:#EEF5FF; |
611 | 611 | } |
612 | 612 | |
613 | +/* topicpath.inc.php */ | |
614 | +span.topicpath-slash { | |
615 | + margin: 0 0.4em; | |
616 | +} | |
617 | +span.topicpath-top { | |
618 | + user-select: none; | |
619 | +} | |
620 | + | |
613 | 621 | @media print { |
614 | 622 | a:link, |
615 | 623 | a:visited { |