2011-01-07 21:33:18 +00:00
|
|
|
$(document).ready(function() {
|
2011-02-28 23:21:05 +00:00
|
|
|
$(":header", "#wiki-content").map(function(index) {
|
2012-04-28 22:24:09 +00:00
|
|
|
var $header = $(this);
|
|
|
|
var $toc = $('#wiki-toc-content');
|
|
|
|
$header.attr('id', 'wikititle_' + index);
|
|
|
|
$('<a />').attr('href', '#' + $header.attr('id'))
|
|
|
|
.text($header.text())
|
|
|
|
.addClass("wiki-" + $header[0].tagName.toLowerCase())
|
|
|
|
.appendTo($toc);
|
2011-02-28 23:21:05 +00:00
|
|
|
});
|
2011-03-03 22:41:56 +00:00
|
|
|
if ($('#wiki-toc-content *').size() < 2)
|
2011-02-28 23:21:05 +00:00
|
|
|
$('#wiki-toc').hide();
|
2011-01-07 21:33:18 +00:00
|
|
|
});
|
|
|
|
|