-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,91 @@ | ||
"use strict"; | ||
'use strict'; | ||
$().ready(function() {}); | ||
var sidebarIsVisible = !1, | ||
toggleSidebar = function(e) { | ||
var a = !(0 < arguments.length && void 0 !== e) || e; | ||
$("#sidebarNav").toggleClass("sticky", a), | ||
$("#stickyNavbarOverlay").toggleClass("active", a), | ||
$("#hamburger").toggleClass("is-active"), | ||
(sidebarIsVisible = a); | ||
}; | ||
toggleSidebar = function(e) { | ||
var a = !(0 < arguments.length && void 0 !== e) || e; | ||
$('#sidebarNav').toggleClass('sticky', a), | ||
$('#stickyNavbarOverlay').toggleClass('active', a), | ||
$('#hamburger').toggleClass('is-active'), | ||
(sidebarIsVisible = a); | ||
}; | ||
$().ready(function() { | ||
$("#hamburger").click(function() { | ||
toggleSidebar(!sidebarIsVisible); | ||
}), | ||
$("#stickyNavbarOverlay").click(function() { | ||
sidebarIsVisible && toggleSidebar(!1); | ||
}); | ||
$('#hamburger').click(function() { | ||
toggleSidebar(!sidebarIsVisible); | ||
}), | ||
$('#stickyNavbarOverlay').click(function() { | ||
sidebarIsVisible && toggleSidebar(!1); | ||
}); | ||
}); | ||
var OFFSET = 150; | ||
$().ready(function() { | ||
var o = $("#side-nav"), | ||
c = []; | ||
if ( | ||
($(".vertical-section").length || o.hide(), | ||
$(".vertical-section").each(function(e, a) { | ||
var i = $(a), | ||
t = i.find("> h1").text(); | ||
if (t) { | ||
o.append($("<h3/>").text(t)); | ||
var s = $("<ul></ul>"); | ||
i.find(".members h4.name").each(function(e, a) { | ||
var i = $(a), | ||
t = i | ||
.find(".code-name") | ||
.clone() | ||
.children() | ||
.remove() | ||
.end() | ||
.text(), | ||
n = i.find("a").attr("href"), | ||
r = $('<a href="'.concat(n, '" />')).text(t); | ||
s.append($("<li></li>").append(r)), | ||
c.push({ link: r, offset: i.offset().top }); | ||
}), | ||
o.append(s); | ||
} else | ||
i.find(".members h4.name").each(function(e, a) { | ||
var i = $(a), | ||
t = i | ||
.find(".code-name") | ||
.clone() | ||
.children() | ||
.remove() | ||
.end() | ||
.text(), | ||
n = i.find("a").attr("href"), | ||
r = $('<a href="'.concat(n, '" />')).text(t); | ||
o.append(r), c.push({ link: r, offset: i.offset().top }); | ||
}); | ||
}), | ||
!$.trim(o.text())) | ||
) | ||
return o.hide(); | ||
function e() { | ||
for (var e = n.scrollTop(), a = !1, i = c.length - 1; 0 <= i; i--) { | ||
var t = c[i]; | ||
t.link.removeClass("is-active"), | ||
e + OFFSET >= t.offset | ||
? a | ||
? t.link.addClass("is-past") | ||
: (t.link.addClass("is-active"), (a = !0)) | ||
: t.link.removeClass("is-past"); | ||
} | ||
} | ||
var n = $("#main-content-wrapper"); | ||
n.on("scroll", e), | ||
e(), | ||
c.forEach(function(e) { | ||
e.link.click(function() { | ||
n.animate({ scrollTop: e.offset - OFFSET + 1 }, 500); | ||
}); | ||
}); | ||
var o = $('#side-nav'), | ||
c = []; | ||
if ( | ||
($('.vertical-section').length || o.hide(), | ||
$('.vertical-section').each(function(e, a) { | ||
var i = $(a), | ||
t = i.find('> h1').text(); | ||
if (t) { | ||
o.append($('<h3/>').text(t)); | ||
var s = $('<ul></ul>'); | ||
i.find('.members h4.name').each(function(e, a) { | ||
var i = $(a), | ||
t = i | ||
.find('.code-name') | ||
.clone() | ||
.children() | ||
.remove() | ||
.end() | ||
.text(), | ||
n = i.find('a').attr('href'), | ||
r = $('<a href="'.concat(n, '" />')).text(t); | ||
s.append($('<li></li>').append(r)), | ||
c.push({ link: r, offset: i.offset().top }); | ||
}), | ||
o.append(s); | ||
} else | ||
i.find('.members h4.name').each(function(e, a) { | ||
var i = $(a), | ||
t = i | ||
.find('.code-name') | ||
.clone() | ||
.children() | ||
.remove() | ||
.end() | ||
.text(), | ||
n = i.find('a').attr('href'), | ||
r = $('<a href="'.concat(n, '" />')).text(t); | ||
o.append(r), c.push({ link: r, offset: i.offset().top }); | ||
}); | ||
}), | ||
!$.trim(o.text())) | ||
) | ||
return o.hide(); | ||
function e() { | ||
for (var e = n.scrollTop(), a = !1, i = c.length - 1; 0 <= i; i--) { | ||
var t = c[i]; | ||
t.link.removeClass('is-active'), | ||
e + OFFSET >= t.offset | ||
? a | ||
? t.link.addClass('is-past') | ||
: (t.link.addClass('is-active'), (a = !0)) | ||
: t.link.removeClass('is-past'); | ||
} | ||
} | ||
var n = $('#main-content-wrapper'); | ||
n.on('scroll', e), | ||
e(), | ||
c.forEach(function(e) { | ||
e.link.click(function() { | ||
n.animate({ scrollTop: e.offset - OFFSET + 1 }, 500); | ||
}); | ||
}); | ||
}), | ||
$().ready(function() { | ||
$("#sidebarNav a").each(function(e, a) { | ||
var i = $(a).attr("href"); | ||
window.location.pathname.match("/" + i) && | ||
($(a).addClass("active"), | ||
$("#sidebarNav").scrollTop($(a).offset().top - 150)); | ||
}); | ||
}); | ||
$().ready(function() { | ||
$('#sidebarNav a').each(function(e, a) { | ||
var i = $(a).attr('href'); | ||
window.location.pathname.match('/' + i) && | ||
($(a).addClass('active'), | ||
$('#sidebarNav').scrollTop($(a).offset().top - 150)); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
/*global document */ | ||
|
||
(function() { | ||
var source = document.getElementsByClassName("prettyprint source linenums"); | ||
var i = 0; | ||
var lineNumber = 0; | ||
var lineId; | ||
var lines; | ||
var totalLines; | ||
var anchorHash; | ||
var source = document.getElementsByClassName('prettyprint source linenums'); | ||
var i = 0; | ||
var lineNumber = 0; | ||
var lineId; | ||
var lines; | ||
var totalLines; | ||
var anchorHash; | ||
|
||
if (source && source[0]) { | ||
anchorHash = document.location.hash.substring(1); | ||
lines = source[0].getElementsByTagName("li"); | ||
totalLines = lines.length; | ||
if (source && source[0]) { | ||
anchorHash = document.location.hash.substring(1); | ||
lines = source[0].getElementsByTagName('li'); | ||
totalLines = lines.length; | ||
|
||
for (; i < totalLines; i++) { | ||
lineNumber++; | ||
lineId = "line" + lineNumber; | ||
lines[i].id = lineId; | ||
if (lineId === anchorHash) { | ||
lines[i].className += " selected"; | ||
} | ||
} | ||
} | ||
for (; i < totalLines; i++) { | ||
lineNumber++; | ||
lineId = 'line' + lineNumber; | ||
lines[i].id = lineId; | ||
if (lineId === anchorHash) { | ||
lines[i].className += ' selected'; | ||
} | ||
} | ||
} | ||
})(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,49 @@ | ||
(function() { | ||
const input = document.querySelector("#search"); | ||
const targets = [...document.querySelectorAll("#sidebarNav li")]; | ||
input.addEventListener("keyup", () => { | ||
// loop over each targets and hide the not corresponding ones | ||
targets.forEach(target => { | ||
if (!target.innerText.toLowerCase().includes(input.value.toLowerCase())) { | ||
target.style.display = "none"; | ||
const input = document.querySelector('#search'); | ||
const targets = [...document.querySelectorAll('#sidebarNav li')]; | ||
input.addEventListener('keyup', () => { | ||
// loop over each targets and hide the not corresponding ones | ||
targets.forEach(target => { | ||
if ( | ||
!target.innerText | ||
.toLowerCase() | ||
.includes(input.value.toLowerCase()) | ||
) { | ||
target.style.display = 'none'; | ||
|
||
/** | ||
* Detects an empty list | ||
* Remove the list and the list's title if the list is not displayed | ||
*/ | ||
const list = [...target.parentNode.childNodes].filter( | ||
elem => elem.style.display !== "none" | ||
); | ||
/** | ||
* Detects an empty list | ||
* Remove the list and the list's title if the list is not displayed | ||
*/ | ||
const list = [...target.parentNode.childNodes].filter( | ||
elem => elem.style.display !== 'none' | ||
); | ||
|
||
if (!list.length) { | ||
target.parentNode.style.display = "none"; | ||
target.parentNode.previousSibling.style.display = "none"; | ||
} | ||
if (!list.length) { | ||
target.parentNode.style.display = 'none'; | ||
target.parentNode.previousSibling.style.display = 'none'; | ||
} | ||
|
||
/** | ||
* Detects empty category | ||
* Remove the entire category if no item is displayed | ||
*/ | ||
const category = [...target.parentNode.parentNode.childNodes].filter( | ||
elem => elem.tagName !== "H2" && elem.style.display !== "none" | ||
); | ||
/** | ||
* Detects empty category | ||
* Remove the entire category if no item is displayed | ||
*/ | ||
const category = [ | ||
...target.parentNode.parentNode.childNodes, | ||
].filter( | ||
elem => | ||
elem.tagName !== 'H2' && elem.style.display !== 'none' | ||
); | ||
|
||
if (!category.length) { | ||
target.parentNode.parentNode.style.display = "none"; | ||
} | ||
} else { | ||
target.parentNode.style.display = "block"; | ||
target.parentNode.previousSibling.style.display = "block"; | ||
target.parentNode.parentNode.style.display = "block"; | ||
target.style.display = "block"; | ||
} | ||
}); | ||
}); | ||
if (!category.length) { | ||
target.parentNode.parentNode.style.display = 'none'; | ||
} | ||
} else { | ||
target.parentNode.style.display = 'block'; | ||
target.parentNode.previousSibling.style.display = 'block'; | ||
target.parentNode.parentNode.style.display = 'block'; | ||
target.style.display = 'block'; | ||
} | ||
}); | ||
}); | ||
})(); |