From 639ed9361e24dfb2eb20bbb2bb0fee812e2f91e2 Mon Sep 17 00:00:00 2001
From: Eduardo Mozart de Oliveira
<2974895+eduardomozart@users.noreply.github.com>
Date: Tue, 30 Jan 2024 09:32:48 -0300
Subject: [PATCH 1/2] Improve compatibility with Read the Dokus template
Add data-wiki-id attribute that is used by DokuWiki "Read the Dokus" template to navigate between pages.
---
scripts/indexmenu.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/indexmenu.js b/scripts/indexmenu.js
index d9b8d61..0f71a46 100644
--- a/scripts/indexmenu.js
+++ b/scripts/indexmenu.js
@@ -316,10 +316,11 @@ dTree.prototype.node = function (node, nodeId) {
(node.hns) ? str += node.hns : str += node.dokuid;
str += '"' + ' title="' + node.name + '"' + jsfnc;
str += ' onclick="javascript: ' + this.treeName + '.s(' + nodeId + ');"';
+ str += ' data-wiki-id="' + node.dokuid + '"';
str += '>' + node.name + '';
}
else if (node.pid !== this.root.id) {
- str += '' + node.name + '';
+ str += '' + node.name + '';
} else {
str += node.name;
}
From 77b87015930333030d19889ab97fcfa5615fe1c0 Mon Sep 17 00:00:00 2001
From: Eduardo Mozart de Oliveira
<2974895+eduardomozart@users.noreply.github.com>
Date: Tue, 30 Jan 2024 09:39:05 -0300
Subject: [PATCH 2/2] Fix TOC on IndexMenu by adding data-wiki-id attr
See https://github.com/my17560/dokuwiki-template-readthedokus/issues/73
---
syntax/indexmenu.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/syntax/indexmenu.php b/syntax/indexmenu.php
index b27c2bc..d91322d 100644
--- a/syntax/indexmenu.php
+++ b/syntax/indexmenu.php
@@ -851,7 +851,7 @@ public function formatIndexmenuItem($item)
if ($markCurrentPage) {
$ret .= '';
}
- $ret .= ''
+ $ret .= ''
. $item['title']
. '';
if ($markCurrentPage) {