autodoc.git
/
modref
/
site.js
version
»
Context lines:
10
20
40
80
file
none
3
autodoc.git/modref/site.js:1:
/* jshint undef: true, unused: true */
-
/* globals window,document */
+
/* globals window,
document
,
requestAnimationFrame
*/
/* exported PikeDoc */ var PikeDoc = null; if (!window.console) { window.console = { log: function(){}, error: function(){} }; } /* Encapsulate so we don't clutter the global scope
autodoc.git/modref/site.js:265:
time: Date.now(), value: innerNavbar.innerHTML }; cache.setItem(PikeDoc.current.link||'root', JSON.stringify(obj)); } } function setMenu() { if (m && validateDate(m.time)) {
+
//window.console.log('Set menu');
innerNavbar.innerHTML = m.value;
-
+
requestAnimationFrame(function() {
+
innerNavbar.querySelector('.sidebar').classList.remove('init');
+
});
} } return { hasCache: init, store: store, setMenu: setMenu }; }());
autodoc.git/modref/site.js:422:
*/ function registerSymbol(name, isInline) { // Only the parent namespace/module/class is loaded inline, and we don't // care about that one. Also, when on the TOP page the navigation is // written to the page, so we don't care for that either. if (isInline || !name) { return new Symbol(name); } var s = new Symbol(name); symbols.push(s);
-
//
console.log(' + Register symbol: ', name);
+
//
window.
console.log(' + Register symbol: ', name);
symbolsMap[name] = s; return s; } function endInherit(which) { endInherits.push(which); } function addInherit(which) { inheritList = inheritList.concat(which); } var types = {}; function finish() { // window.console.log('finish(', endInherits.length, ')');
autodoc.git/modref/site.js:451:
isAllLoaded = true; maybeRenderNavbar(); } } var jsMap = {}; var scriptQueue = 0; function loadScript(link, namespace, inherits) {
-
//
window.console.log('load: ', link);
+
//window.console.log('load: ', link);
if (cacheFactory.hasCache()) { return; } link = helpers.adjustLink(link); // Already loaded if (jsMap[link]) {
-
+
//window.console.log('Already loaded: ', link);
return; } // window.console.log('+++ Load:', link); jsMap[link] = true; if (inherits) { addInherit(inherits); }
autodoc.git/modref/site.js:503:
isDomReady = true; onDOMReadyQueue.forEach(function(f) { if (typeof f === 'function') { f(); } }); maybeRenderNavbar(); } function lowNavbar(container, heading, nodes, suffix) {
-
if (!nodes || !nodes.length)
+
if (!nodes || !nodes.length)
{
return;
-
+
}
var curlnk = PikeDoc.current.link; var adjlnk = helpers.adjustLink; var c = container; var div = createElem('div', { style: 'margin-left:0.5em' }); nodes.forEach(function(n) { var name, tnode, tmp; name = n.name + suffix; tnode = document.createTextNode(name);
autodoc.git/modref/site.js:526:
if (!n.inherited) { tnode = createElem('b', name); } if (n.link !== curlnk) { tmp = createElem('a', { href: adjlnk(n.link) }); tmp.appendChild(tnode); tnode = tmp; }
+
if (n.modifiers) {
+
n.modifiers.forEach(function(mod) {
+
if (n.name !== 'create') {
+
tnode.classList.add('mod-' + mod);
+
}
+
});
+
}
+
div.appendChild(tnode); }); c.appendChild(createElem('b', { class: 'heading' }, heading)); c.appendChild(div); } /* Render the left navigation bar. */ function navbar() {
-
var s = createElem('div', { class: 'sidebar' });
+
var s = createElem('div', { class: 'sidebar
init
' });
// 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); }
autodoc.git/modref/site.js:564:
lowNavbar(s, 'Methods', types.method, '()'); lowNavbar(s, 'Operators', types.operator, '()'); lowNavbar(s, 'Members', types.member, '()'); lowNavbar(s, 'Namespaces', types.namespace, '::'); lowNavbar(s, 'Appendices', types.appendix, ''); cacheFactory.store(); } function maybeRenderNavbar() {
-
//
window.console.log('maybeRenderNavbar(', isAllLoaded, isDomReady, scriptQueue, ')');
+
//window.console.log('maybeRenderNavbar(', isAllLoaded, isDomReady, scriptQueue, ')');
if (isAllLoaded && isDomReady && scriptQueue === 0) { navbar();
-
+
requestAnimationFrame(function() {
+
innerNavbar.querySelector('.sidebar').classList.remove('init');
+
});
} } (function() { // If the refdoc lives in pike.lysator.liu.se we add some custom Google // searchability. if (document.location.hostname === 'pike.lysator.liu.se' || document.location.hostname === 'pike.local') // for dev purposes { onDOMReadyQueue.push(function() {