Add table of contents on wiki pages
This commit is contained in:
@@ -746,6 +746,32 @@ ol > li {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#wiki-toc {
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
#wiki-toc-content {
|
||||
border: 1px solid #999999;
|
||||
border-width: 1px 0;
|
||||
padding: 10px 0;
|
||||
padding-bottom: 25px;
|
||||
background-color: #ffffff;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#wiki-toc-content a {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#wiki-toc-content a.wiki-h2 {
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
#wiki-toc-content a.wiki-h3 {
|
||||
margin-left: 2em;
|
||||
}
|
||||
|
||||
/**
|
||||
* main menu
|
||||
*/
|
||||
|
7
www/media/idf/js/wiki-toc.js
Normal file
7
www/media/idf/js/wiki-toc.js
Normal file
@@ -0,0 +1,7 @@
|
||||
$(document).ready(function() {
|
||||
$(":header", "#wiki-content").map(function (index) {
|
||||
this.id = "wikititle_" + index;
|
||||
$("<a href='#" + this.id + "'>" + this.innerText + "</a>").addClass("wiki-" + this.tagName.toLowerCase()).appendTo('#wiki-toc-content');
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user