summaryrefslogtreecommitdiff
path: root/doc/js/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'doc/js/main.js')
-rwxr-xr-xdoc/js/main.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/js/main.js b/doc/js/main.js
new file mode 100755
index 0000000..859772b
--- /dev/null
+++ b/doc/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);
+ });
+});