2014-02-16 23:06:28 +01:00
|
|
|
$(function () {
|
|
|
|
$('.aj-nav').click(function (e) {
|
|
|
|
e.preventDefault();
|
|
|
|
$(this).parent().siblings().find('ul').slideUp();
|
|
|
|
$(this).next().slideToggle();
|
|
|
|
});
|
2013-06-12 00:28:29 +02:00
|
|
|
|
2014-02-16 23:06:28 +01:00
|
|
|
$('table').addClass('table');
|
|
|
|
$('#menu-spinner-button').click(function () {
|
|
|
|
$('#sub-nav-collapse').slideToggle();
|
|
|
|
});
|
2013-07-31 00:46:27 +02:00
|
|
|
|
2014-02-16 23:06:28 +01:00
|
|
|
$(window).resize(function () {
|
|
|
|
// Remove transition inline style on large screens
|
|
|
|
if ($(window).width() >= 768)
|
|
|
|
$('#sub-nav-collapse').removeAttr('style');
|
|
|
|
});
|
2014-02-13 13:21:27 +01:00
|
|
|
});
|
|
|
|
|
2014-02-13 14:40:54 +01:00
|
|
|
//Fix GitHub Ribbon overlapping Scrollbar
|
2014-02-19 05:21:19 +01:00
|
|
|
var t = $('#github-ribbon');
|
2014-07-12 12:31:57 +02:00
|
|
|
var a = $('article');
|
|
|
|
if (t[0] && a[0] && a[0].scrollHeight > $('.right-column').height()) t[0].style.right = '16px';
|
2014-02-13 14:40:54 +01:00
|
|
|
|
2014-11-20 09:55:11 +01:00
|
|
|
function setCodeBlockStyle(x) {
|
|
|
|
switch (x) {
|
|
|
|
default:
|
|
|
|
case 0:
|
|
|
|
toggleCodeBlockBtn.innerHTML = "Show Code Blocks Inline";
|
|
|
|
codeBlockView.addClass('float-view');
|
|
|
|
codeBlocks.removeClass('hidden');
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
toggleCodeBlockBtn.innerHTML = "Hide Code Blocks";
|
|
|
|
codeBlockView.removeClass('float-view');
|
|
|
|
codeBlocks.removeClass('hidden');
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
toggleCodeBlockBtn.innerHTML = "Show Code Blocks";
|
|
|
|
codeBlockView.removeClass('float-view');
|
|
|
|
codeBlocks.addClass('hidden');
|
|
|
|
break;
|
2014-02-13 13:21:27 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-20 09:55:11 +01:00
|
|
|
function toggleCodeBlocks() {
|
|
|
|
codeBlockState = (codeBlockState + 1) % 3;
|
|
|
|
localStorage.setItem("codeBlockState", codeBlockState);
|
|
|
|
setCodeBlockStyle(codeBlockState);
|
2014-07-12 12:31:57 +02:00
|
|
|
}
|
2014-11-20 09:55:11 +01:00
|
|
|
|
|
|
|
//Initialize CodeBlock Visibility Settings
|
|
|
|
$(function () {
|
|
|
|
toggleCodeBlockBtn = $('#toggleCodeBlockBtn')[0];
|
|
|
|
codeBlockView = $('.right-column');
|
|
|
|
codeBlocks = $('.content-page article > pre');
|
|
|
|
codeBlockState = localStorage.getItem("codeBlockState");
|
|
|
|
if (!codeBlockState) {
|
|
|
|
codeBlockState = 0;
|
|
|
|
localStorage.setItem("codeBlockState", codeBlockState);
|
|
|
|
} else codeBlockState = parseInt(codeBlockState);
|
|
|
|
if (!codeBlockView.size()) return;
|
|
|
|
if (!codeBlocks.size()) {
|
|
|
|
codeBlockState = 2;
|
|
|
|
toggleCodeBlockBtn.classList.add('hidden');
|
|
|
|
}
|
|
|
|
setCodeBlockStyle(codeBlockState);
|
|
|
|
});
|