From acb25a8e90673626f1d8bbe69f8fe6b69b932925 Mon Sep 17 00:00:00 2001 From: umorigu Date: Tue, 27 Mar 2018 01:28:08 +0900 Subject: [PATCH] BugTrack/2431 Topicpath title by JavaScript pukiwiki.ini.php ``` $topicpath_title = 1; // (1: Enabled(default), 0: Disabled) ``` --- lib/html.php | 16 ++++++++++++-- plugin/topicpath.inc.php | 57 ++++++++++++++++++++++++++++-------------------- pukiwiki.ini.php | 6 +++++ skin/main.js | 34 ++++++++++++++++++++++++++++- skin/pukiwiki.css | 2 +- 5 files changed, 87 insertions(+), 28 deletions(-) diff --git a/lib/html.php b/lib/html.php index db58c49..4ebe0b0 100644 --- a/lib/html.php +++ b/lib/html.php @@ -186,7 +186,7 @@ function catbody($title, $page, $body) } } // Embed Scripting data - $html_scripting_data = get_html_scripting_data(); + $html_scripting_data = get_html_scripting_data($_page); // Compat: 'HTML convert time' without time about MenuBar and skin $taketime = elapsedtime(); @@ -217,10 +217,11 @@ function _decorate_Nth_word($matches) /** * Get data used by JavaScript modules */ -function get_html_scripting_data() +function get_html_scripting_data($page) { global $ticket_link_sites, $plugin; global $external_link_cushion_page, $external_link_cushion; + global $topicpath_title; if (!isset($ticket_link_sites) || !is_array($ticket_link_sites)) { return ''; } @@ -272,12 +273,23 @@ EOS; EOS; } + // Topicpath title + $topicpath_data = ''; + if ($topicpath_title && exist_plugin('topicpath')) { + $parents = plugin_topicpath_parent_links($page); + $h_topicpath = htmlsc(json_encode($parents, + JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)); + $topicpath_data = << +EOS; + } $data = <<