2010-04-11 09:25:26 +02:00
|
|
|
(function($) {
|
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
|
|
/** -----------------------------------------------
|
|
|
|
* TABLE OF CONTENTS
|
|
|
|
*
|
|
|
|
* Transform a #table-of-contents div to a nested list
|
|
|
|
*/
|
|
|
|
if($("#table-of-contents").length > 0) {
|
|
|
|
var toc = '<div class="box"><ul id="toc"><h4>In this document:</h4>';
|
2010-09-05 05:17:42 +02:00
|
|
|
|
|
|
|
// Remove existing anchor redirection in the url
|
|
|
|
var pageURL = window.location.href.replace(/#[a-zA-Z0-9\-\_]*/g, '');
|
|
|
|
|
|
|
|
$('#left-column h1[id], #left-column h2[id], #left-column h3[id], #left-column h4[id]').each(function(i) {
|
2010-04-11 09:25:26 +02:00
|
|
|
var current = $(this);
|
2010-09-05 05:17:42 +02:00
|
|
|
toc += '<li class="' + current.attr("tagName").toLowerCase() + '"><a id="link' + i + '" href="'+ pageURL +'#' + $(this).attr('id') + '" title="' + current.html() + '">' + current.html() + '</a></li>';
|
2010-04-11 09:25:26 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
toc += '</ul></div>';
|
2010-03-04 05:39:02 +01:00
|
|
|
|
2010-04-11 09:25:26 +02:00
|
|
|
$('#table-of-contents').prepend(toc);
|
|
|
|
}
|
2010-06-24 16:22:41 +02:00
|
|
|
|
2010-09-05 02:27:17 +02:00
|
|
|
/** ---------------------------------------------
|
|
|
|
* HEADING ANCHOR LINKS
|
|
|
|
*
|
|
|
|
* Automatically adds anchor links to headings that have IDs
|
|
|
|
*/
|
2010-10-28 23:27:30 +02:00
|
|
|
var url = window.location.href;
|
|
|
|
|
2010-09-05 05:17:42 +02:00
|
|
|
$("#left-column h1[id], #left-column h2[id], #left-column h3[id], #left-column h4[id], #left-column h5[id], #left-column h6[id]").each(function() {
|
2010-10-28 23:27:30 +02:00
|
|
|
var link = '<a class="heading-anchor-link" title="Link to this section" href="'+ url + '#' + $(this).attr('id') + '">¶</a>';
|
2010-09-05 02:27:17 +02:00
|
|
|
$(this).append(' ' + link);
|
|
|
|
});
|
|
|
|
|
|
|
|
$("h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]").mouseenter(function() {
|
|
|
|
$(this).addClass('hover');
|
|
|
|
});
|
|
|
|
|
|
|
|
$("h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]").mouseleave(function() {
|
|
|
|
$(this).removeClass('hover');
|
|
|
|
});
|
|
|
|
|
2010-06-24 16:22:41 +02:00
|
|
|
/** ---------------------------------------------
|
|
|
|
* LANGAUGE SELECTER
|
|
|
|
*
|
|
|
|
* Hide the change button and do it onclick
|
|
|
|
*/
|
|
|
|
$("#Form_LanguageForm .Actions").hide();
|
|
|
|
|
|
|
|
$("#Form_LanguageForm select").change(function() {
|
|
|
|
$("#Form_LanguageForm").submit();
|
|
|
|
});
|
2010-04-11 09:25:26 +02:00
|
|
|
});
|
|
|
|
})(jQuery);
|