footer.tpl
760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!-- Bootstrap Core JavaScript -->
<script src="static/bootstrap/js/bootstrap.min.js"></script>
<!-- Update time JavaScript -->
<script src="static/js/main.js"></script>
<script src="static/js/updatetime.js"></script>
<script src="static/js/new_fields.js"></script>
<script>
var ToC =
"<nav role='navigation' class='table-of-contents'>" +
"<b><?php echo $page_title; ?></b>" +
"<ul>";
var newLine, el, title, link;
$("article h3").each(function() {
el = $(this);
title = el.text();
link = "#" + el.attr("id");
newLine =
"<li>" +
"<a href='" + link + "'>" +
title +
"</a>" +
"</li>";
ToC += newLine;
});
ToC +=
"</ul>" +
"</nav>";
$(".all-chapters").prepend(ToC);
</script>
</body>
</html>