diff options
Diffstat (limited to 'doc/code/js/main.js')
-rwxr-xr-x | doc/code/js/main.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/code/js/main.js b/doc/code/js/main.js new file mode 100755 index 00000000000..859772b91d9 --- /dev/null +++ b/doc/code/js/main.js @@ -0,0 +1,24 @@ +function toggleSource(id) +{ + var src = $('#' + id).toggle(); + var isVisible = src.is(':visible'); + $('#l_' + id).html(isVisible ? 'hide' : 'show'); + if (!src.data('syntax-higlighted')) { + src.data('syntax-higlighted', 1); + hljs.highlightBlock(src[0]); + } +} + +window.highlight = function(url) { + var hash = url.match(/#([^#]+)$/) + if(hash) { + $('a[name=' + hash[1] + ']').parent().effect('highlight', {}, 'slow') + } +} + +$(function() { + highlight('#' + location.hash); + $('.description pre').each(function() { + hljs.highlightBlock(this); + }); +}); |