var categorytree = null; var path = []; function GotoPath(p) { path = p.split(">"); var x = escape(p); if(window.location.hash != x) window.location.hash = x; updateTree(); } function updateTree() { var el = document.getElementById("browser"); var res = ""; var lev = 0; var tree = {entries:[],subcats:categorytree}; var p; var done = 0; var sel; var colors = { "Classes": "#7ab", "Reference": "#7b9", "Overviews": "#ca6", "Guides": "#b87", "Tutorials": "#b77", }; link = ""; while(1) { res += "
"; p=path[lev++]; var l = []; for(var k in tree.subcats) l.push(k); l = l.sort(); sel = ""; for(var i=0;i"+k+""; res += " ("+tree.subcats[k].count+")"; if(k==p) res += ""; res += "
"; } for(var i=0;i"+v.title+"
"+v.summary+"
"; } res += ""; if(!p) break; tree = tree.subcats[p]; link += p+">"; res += ""; res += "
"+sel+"
"; if(!tree) { res += "
► Category not found: "+p+"
"; break; } } el.innerHTML = res; } function countTree(t) { var x = 0; for(var k in t.subcats) x += countTree(t.subcats[k]); x += t.entries.length; return t.count = x; } function buildCategoryTree() { var cats = {}; for(var k in docmap) { var v = docmap[k]; if(v.installed=="extension" && !check_extensions.checked) continue; if(filter.value != "all" && v.path.split("/")[0].toLowerCase() != filter.value) continue; var c2 = v.categories.match(/[^, ]+[^,]*[^, ]+/g) || ["Uncategorized"]; for(var i=0;i"); for(var i=0;ib) return +1; else return 0; }); } categorytree = tree; document.getElementById("total_count").innerHTML = countTree({subcats:tree,entries:[],count:0}) + " documents"; } var check_extensions; var filter; window.onload = function() { // restoreMenu(); helpRoot="."; fixTOC(); var onChange = function() { buildCategoryTree(); updateTree(); }; check_extensions = document.getElementById("check_extensions"); check_extensions.onchange = onChange; filter = document.getElementById("menu_filter"); filter.onchange = onChange; buildCategoryTree(); GotoPath(unescape(window.location.hash.slice(1))); } window.onhashchange = function() { GotoPath(unescape(window.location.hash.slice(1))); }