Use the jquery.toc.js library to auto-generate a table of contents for the loaded page under the side nav menu
This commit is contained in:
parent
678239424a
commit
5bcb373c00
@ -472,4 +472,4 @@ href="[baseurl]/removeaccount">[baseurl]/removeaccount
|
|||||||
the account you are currently logged into will be removed. <br><br>This is
|
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
|
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
|
clones on other hubs this only removes by default the channels instances which
|
||||||
exists on this hub.
|
exists on this hub.
|
||||||
|
57
doc/toc.html
57
doc/toc.html
@ -93,29 +93,38 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="page-toc-container" style="margin-top:1.0em;">
|
||||||
|
<h3>Contents</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// $(document).ready(function() {
|
|
||||||
// Determine the content section from the URL and expand the appropriate menu section
|
// Determine the content section from the URL and expand the appropriate menu section
|
||||||
var url = document.createElement('a');
|
var url = document.createElement('a');
|
||||||
url.href = window.location;
|
url.href = window.location;
|
||||||
switch (url.pathname.split('/')[2]) {
|
switch (url.pathname.split('/')[2]) {
|
||||||
case 'tutorials':
|
case 'tutorials':
|
||||||
$('#tutorials').addClass('in');
|
$('#tutorials').addClass('in');
|
||||||
break;
|
break;
|
||||||
case 'about':
|
case 'about':
|
||||||
$('#about').addClass('in');
|
$('#about').addClass('in');
|
||||||
break;
|
break;
|
||||||
case 'admin':
|
case 'admin':
|
||||||
$('#administrators').addClass('in');
|
$('#administrators').addClass('in');
|
||||||
break;
|
break;
|
||||||
case 'member':
|
case 'member':
|
||||||
$('#members').addClass('in');
|
$('#members').addClass('in');
|
||||||
break;
|
break;
|
||||||
case 'developer':
|
case 'developer':
|
||||||
$('#developers').addClass('in');
|
$('#developers').addClass('in');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
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>
|
</script>
|
@ -2,7 +2,7 @@
|
|||||||
<div class="section-title-wrapper">
|
<div class="section-title-wrapper">
|
||||||
<h2>{{$title}}</h2>
|
<h2>{{$title}}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="section-content-wrapper">
|
<div class="section-content-wrapper" id="doco-content">
|
||||||
{{$content}}
|
{{$content}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user