From d8fda216643ce650977683f566037cf4a24a3f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Wed, 18 Jul 2018 10:33:42 -0700 Subject: macos-v0.9.0 --- macos/0.9.0/js/jazzy.js | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 macos/0.9.0/js/jazzy.js (limited to 'macos/0.9.0/js/jazzy.js') diff --git a/macos/0.9.0/js/jazzy.js b/macos/0.9.0/js/jazzy.js new file mode 100755 index 0000000000..e07f181acc --- /dev/null +++ b/macos/0.9.0/js/jazzy.js @@ -0,0 +1,47 @@ +window.jazzy = {'docset': false} +if (typeof window.dash != 'undefined') { + document.documentElement.className += ' dash' + window.jazzy.docset = true +} +if (navigator.userAgent.match(/xcode/i)) { + document.documentElement.className += ' xcode' + window.jazzy.docset = true +} + +// On doc load, toggle the URL hash discussion if present +$(document).ready(function() { + if (!window.jazzy.docset) { + var linkToHash = $('a[href="' + window.location.hash +'"]'); + linkToHash.trigger("click"); + } +}); + +// On token click, toggle its discussion and animate token.marginLeft +$(".token").click(function(event) { + if (window.jazzy.docset) { + return; + } + var link = $(this); + var linkIcon = link.find('.token-icon'); + var animationDuration = 300; + var tokenOffset = "0px"; + var original = link.css('marginLeft') == tokenOffset; + linkIcon.toggleClass('token-icon-minus'); + link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); + $content = link.parent().parent().next(); + $content.slideToggle(animationDuration); + + // Keeps the document from jumping to the hash. + var href = $(this).attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); +}); + +// Dumb down quotes within code blocks that delimit strings instead of quotations. +$("code q").replaceWith(function () { + return ["\"", $(this).contents(), "\""]; +}); -- cgit v1.2.1