aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Manning <andrew@reticu.li>2016-11-27 21:25:38 -0700
committerAndrew Manning <andrew@reticu.li>2016-11-27 21:25:38 -0700
commit5bcb373c00a500cd8120df41bc0788172fe7e347 (patch)
tree4cd46a52279696ad83b3d4a0b1fe88e93ee3a556
parent678239424a8c62fdd6cabc47d12ae0ea1fac9d6a (diff)
downloadvolse-hubzilla-5bcb373c00a500cd8120df41bc0788172fe7e347.tar.gz
volse-hubzilla-5bcb373c00a500cd8120df41bc0788172fe7e347.tar.bz2
volse-hubzilla-5bcb373c00a500cd8120df41bc0788172fe7e347.zip
Use the jquery.toc.js library to auto-generate a table of contents for the loaded page under the side nav menu
-rw-r--r--doc/member/member_guide.html2
-rw-r--r--doc/toc.html57
-rw-r--r--view/tpl/help.tpl2
3 files changed, 35 insertions, 26 deletions
diff --git a/doc/member/member_guide.html b/doc/member/member_guide.html
index 9d9e98937..97c5c9be2 100644
--- a/doc/member/member_guide.html
+++ b/doc/member/member_guide.html
@@ -472,4 +472,4 @@ href="[baseurl]/removeaccount">[baseurl]/removeaccount
the account you are currently logged into will be removed. <br><br>This is
irreversible.<br><br>All your channels will be deleted. If you have identity
clones on other hubs this only removes by default the channels instances which
-exists on this hub. \ No newline at end of file
+exists on this hub.
diff --git a/doc/toc.html b/doc/toc.html
index 67e5a0a0a..da67ff88b 100644
--- a/doc/toc.html
+++ b/doc/toc.html
@@ -93,29 +93,38 @@
</div>
</div>
+<div id="page-toc-container" style="margin-top:1.0em;">
+ <h3>Contents</h3>
+</div>
+
<script>
-// $(document).ready(function() {
- // Determine the content section from the URL and expand the appropriate menu section
- var url = document.createElement('a');
- url.href = window.location;
- switch (url.pathname.split('/')[2]) {
- case 'tutorials':
- $('#tutorials').addClass('in');
- break;
- case 'about':
- $('#about').addClass('in');
- break;
- case 'admin':
- $('#administrators').addClass('in');
- break;
- case 'member':
- $('#members').addClass('in');
- break;
- case 'developer':
- $('#developers').addClass('in');
- break;
- default:
- break;
- }
-// }
+
+ // Determine the content section from the URL and expand the appropriate menu section
+ var url = document.createElement('a');
+ url.href = window.location;
+ switch (url.pathname.split('/')[2]) {
+ case 'tutorials':
+ $('#tutorials').addClass('in');
+ break;
+ case 'about':
+ $('#about').addClass('in');
+ break;
+ case 'admin':
+ $('#administrators').addClass('in');
+ break;
+ case 'member':
+ $('#members').addClass('in');
+ break;
+ case 'developer':
+ $('#developers').addClass('in');
+ break;
+ default:
+ break;
+ }
+ $(document).ready(function () {
+ var tocUl = $('#page-toc-container').append('<ul>').find('ul');
+ tocUl.removeClass();
+ tocUl.toc({content: "#doco-content", headings: "h1,h2,h3,h4"});
+ });
+
</script> \ No newline at end of file
diff --git a/view/tpl/help.tpl b/view/tpl/help.tpl
index 22180bda6..484fd67c9 100644
--- a/view/tpl/help.tpl
+++ b/view/tpl/help.tpl
@@ -2,7 +2,7 @@
<div class="section-title-wrapper">
<h2>{{$title}}</h2>
</div>
- <div class="section-content-wrapper">
+ <div class="section-content-wrapper" id="doco-content">
{{$content}}
</div>
</div>