mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 11:05:56 +02:00
13 lines
507 B
JavaScript
13 lines
507 B
JavaScript
$(document).ready(function() {
|
|
var toc = '<div class="box"><ul id="toc">';
|
|
toc += '<h4>In this document:</h4>';
|
|
$('#LeftColumn h1, #LeftColumn h2, #LeftColumn h3, #LeftColumn h4').each(function(i) {
|
|
var current = $(this);
|
|
current.attr('id', 'title' + i);
|
|
toc += '<li class="' + current.attr("tagName").toLowerCase() + '"><a id="link' + i + '" href="#title' + i + '" title="' + current.html() + '">' + current.html() + '</a></li>';
|
|
});
|
|
toc += '</ul></div>';
|
|
|
|
$('#RightColumn').prepend(toc);
|
|
});
|