autodoc.git/
modref/
site.js
Branch:
Tag:
Non-build tags
All tags
No tags
2016-04-29
2016-04-29 15:06:02 by Henrik Grubbström (Grubba) <grubba@grubba.org>
899268014ef217ecd6f777e54b429b01662548ab (
68
lines) (+
50
/-
18
)
[
Show
|
Annotate
]
Branch:
master
Documentation
[__builtin.Nettle.Sign]
: Improved JOSE doc.
5:
var PikeDoc = null; if (!window.console) {
-
window.console =
{log
:function(){},error:function()
{}}
;
+
window.console =
{ log
:
function(){},
error:
function()
{} }
;
} /*
23:
navbar, innerNavbar, // Content wrapper, HTMLElement content,
+
// The page footer
+
footer,
// The height of the navbar navbarHeight, // The height of the window
66:
maybeHideNavbox(); navbar = document.getElementsByClassName('navbar')[0]; content = document.getElementsByClassName('content')[0];
-
footerHeight
= document.getElementsByTagName('footer')[0].offsetHeight;
+
footer
= document.getElementsByTagName('footer')[0]
;
+
footerHeight = footer
.offsetHeight;
windowHeight = window.outerHeight; headerHeight = document.getElementsByTagName('header')[0].offsetHeight; navbarHeight = windowHeight - content.offsetTop - footerHeight;
110:
} // ... or else set to sticky. iAmSticky = true;
-
content.style.minHeight = (windowHeight - headerHeight
-
-
footerHeight + 5
) + 'px';
+
content.style.minHeight = (windowHeight - headerHeight) + 'px';
navbar.classList.add('sticky'); } // If scrollY is less than the sticky position ...
204:
// During a session each generated menu is cached locally in a sessionStorage // (if available). This one handles that. var cacheFactory = (function() {
-
var cache = window.sessionStorage;
+
// Don't use cache if the page isn't served through a server.
+
// The cache seems buggy as hell when the pages are view directly from
+
// the file system.
+
var cache =
document.location.hostname &&
window.sessionStorage;
var m, isChecked = false; function init() {
212:
return true; }
+
if (!cache) {
+
return false;
+
}
+
if (isChecked && !m) { return false; }
-
if (cache) {
+
m = cache.getItem(PikeDoc.current.link); isChecked = true;
-
+
if (m) { m = JSON.parse(m);
-
return
validateDate(m.time);
+
var
ok
=
validateDate(m.time);
+
if (!ok) {
+
isChecked = false;
+
cache.removeItem(PikeDoc.current.link);
}
-
return
false
;
+
return
ok
;
}
-
-
isChecked = true;
-
+
return false;
-
+
} function validateDate(time) { var t = PikeDoc.PUBDATE;
-
+
// window.console.log('PUBDATE: ', t);
if (!t) {
-
t
= new Date();
-
t
.setTime(
t
.
getTime
() - (3600*1000)*
48
);
+
t.setTime(
Date
.
now
() - (3600*1000)*
24
);
return t < new Date(time); }
252:
function store() { if (cache) { var obj = {
-
time:
new
Date
()
.
getTime
(),
+
time: Date.
now
(),
value: innerNavbar.innerHTML };
261:
} function setMenu() {
-
if (m) {
+
if (m
&& validateDate(m.time
)
)
{
innerNavbar.innerHTML = m.value; } }
446:
var jsMap = {}; var scriptQueue = 0;
+
function loadScript(link, namespace, inherits) {
-
+
// window.console.log('load: ', link);
if (cacheFactory.hasCache()) { return; }
531:
/* Render the left navigation bar. */ function navbar() { var s = createElem('div', { class: 'sidebar' });
+
// If the cache already has set the menu, then clear it. The cache is
+
// almost certainly run before this method.
+
var old = innerNavbar.querySelectorAll('.sidebar');
+
var i, tmp;
+
if (old.length) {
+
// window.console.log('Clear cached menu and regenerate', old);
+
for (i = 0; i < old.length; i++) {
+
tmp = old[i];
+
tmp.parentNode.removeChild(tmp);
+
}
+
}
+
innerNavbar.appendChild(s); lowNavbar(s, 'Modules', types.module, '');
579:
s.parentNode.insertBefore(el, s);
+
var el2 = createElem('script', {
+
src: '/assets/js/local/disqus.min.js',
+
async: true
+
});
+
+
s.parentNode.insertBefore(el2, s);
+
var f = createElem('link', {
-
href: '/assets/img/favicon.png
?v=2
',
+
href: '/assets/img/favicon.png',
rel: 'shortcut icon' });