$plugin_prop = <<<EOS
<input type="hidden" class="plugin-name" value="$h_plugin" />
EOS;
-
+ // Page name
+ $h_page_name = htmlsc($page);
+ $page_name_data = <<<EOS
+<input type="hidden" class="page-name" value="$h_page_name" />
+EOS;
// AutoTicketLink
$filtered_ticket_link_sites = array();
foreach ($ticket_link_sites as $s) {
<div id="pukiwiki-site-properties" style="display:none;">
$site_props
$plugin_prop
+$page_name_data
$ticketlink_data
$external_link_cushion_data
$topicpath_data
});
}
function makeTopicpathTitle() {
- var topicpathE = document.querySelector('#pukiwiki-site-properties .topicpath-links');
+ if (!document.createDocumentFragment || !window.JSON) return;
+ var sitePropE = document.querySelector('#pukiwiki-site-properties');
+ if (!sitePropE) return;
+ var pageNameE = sitePropE.querySelector('.page-name');
+ if (!pageNameE || !pageNameE.value) return;
+ var pageName = pageNameE.value;
+ var topicpathE = sitePropE.querySelector('.topicpath-links');
if (!topicpathE || !topicpathE.value) return;
var topicpathLinks = JSON.parse(topicpathE.value);
if (!topicpathLinks) return;
if (!aList || aList.length > 1) return;
var a = titleH1.querySelector('a');
if (!a) return;
+ if (a.textContent !== pageName) return;
var fragment = document.createDocumentFragment();
for (var i = 0, n = topicpathLinks.length; i < n; i++) {
var path = topicpathLinks[i];