summaryrefslogtreecommitdiffstats
path: root/src/navtree_js.h
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2012-05-19 12:11:23 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2012-05-19 12:11:23 (GMT)
commit55e5055cfbb6f8e013a894c0ec8b10771231e3ba (patch)
tree58d7a64919b99cc76fdc7120ae5d0407f3163a67 /src/navtree_js.h
parent44ca9512aaeb19f7fbd07afda88ec4cfe53ce831 (diff)
downloadDoxygen-55e5055cfbb6f8e013a894c0ec8b10771231e3ba.zip
Doxygen-55e5055cfbb6f8e013a894c0ec8b10771231e3ba.tar.gz
Doxygen-55e5055cfbb6f8e013a894c0ec8b10771231e3ba.tar.bz2
Release-1.8.1
Diffstat (limited to 'src/navtree_js.h')
-rw-r--r--src/navtree_js.h54
1 files changed, 43 insertions, 11 deletions
diff --git a/src/navtree_js.h b/src/navtree_js.h
index 8c513d2..9f9e996 100644
--- a/src/navtree_js.h
+++ b/src/navtree_js.h
@@ -1,5 +1,5 @@
-"\n"
"var navTreeIndex;\n"
+"var navTreeSubIndices = new Array();\n"
"\n"
"function getData(varName)\n"
"{\n"
@@ -13,6 +13,14 @@
" return uri.substring(uri.lastIndexOf('/')+1);\n"
"}\n"
"\n"
+"function stripPath2(uri)\n"
+"{\n"
+" var i = uri.lastIndexOf('/');\n"
+" var s = uri.substring(i+1);\n"
+" var m = uri.substring(0,i+1).match(/\\/d\\w\\/d\\w\\w\\/$/);\n"
+" return m ? uri.substring(i-6) : s;\n"
+"}\n"
+"\n"
"function getScript(scriptName,func,show)\n"
"{\n"
" var head = document.getElementsByTagName(\"head\")[0]; \n"
@@ -297,7 +305,8 @@
" showNode(o,node,index); // retry with child node expanded\n"
" },true);\n"
" } else {\n"
-" if (o.toroot==\"index.html\" /*|| n.childrenData*/) {\n"
+" var rootBase = o.toroot.replace(/\\..+$/, '');\n"
+" if (rootBase==\"index\" || rootBase==\"pages\") {\n"
" expandNode(o, n, true, true);\n"
" }\n"
" selectAndHighlight(n);\n"
@@ -320,24 +329,47 @@
" }\n"
"}\n"
"\n"
-"function gotoNode(o,root,hash)\n"
+"function gotoNode(o,subIndex,root,hash)\n"
"{\n"
-" var nti = navTreeIndex[root+hash];\n"
-" o.breadcrumbs = nti ? nti : navTreeIndex[root];\n"
-" if (o.breadcrumbs==null) o.breadcrumbs = navTreeIndex[\"index.html\"];\n"
-" o.breadcrumbs.unshift(0);\n"
-" showNode(o, o.node, 0);\n"
+" var nti = navTreeSubIndices[subIndex][root+hash];\n"
+" o.breadcrumbs = nti ? nti : navTreeSubIndices[subIndex][root];\n"
+" if (o.breadcrumbs)\n"
+" {\n"
+" o.breadcrumbs.unshift(0); // add 0 for root node\n"
+" showNode(o, o.node, 0);\n"
+" }\n"
+"}\n"
+"\n"
+"function gotoSubIndex(o,root,hash,relpath)\n"
+"{\n"
+" if (hash.match(/^#l\\d+$/)) \n"
+" {\n"
+" hash=''; // strip line number anchors\n"
+" }\n"
+" var url=root+hash;\n"
+" var i=-1;\n"
+" while (navTreeIndex[i+1]<=url) i++;\n"
+" if (navTreeSubIndices[i]) {\n"
+" gotoNode(o,i,root,hash)\n"
+" } else {\n"
+" getScript(relpath+'navtreeindex'+i,function(){\n"
+" navTreeSubIndices[i] = eval('NAVTREEINDEX'+i);\n"
+" if (navTreeSubIndices[i]) {\n"
+" gotoNode(o,i,root,hash);\n"
+" }\n"
+" },true);\n"
+" }\n"
"}\n"
"\n"
"function navTo(o,root,hash,relpath)\n"
"{\n"
" if (navTreeIndex){\n"
-" gotoNode(o,root,hash);\n"
+" gotoSubIndex(o,root,hash,relpath);\n"
" } else {\n"
" getScript(relpath+\"navtreeindex\",function(){\n"
" navTreeIndex = eval('NAVTREEINDEX');\n"
" if (navTreeIndex){\n"
-" gotoNode(o,root,hash);\n"
+" gotoSubIndex(o,root,hash,relpath);\n"
" }\n"
" },true);\n"
" } \n"
@@ -377,7 +409,7 @@
" $('.item').removeClass('selected');\n"
" $('.item').removeAttr('id');\n"
" }\n"
-" var link=stripPath($(location).attr('pathname'));\n"
+" var link=stripPath2($(location).attr('pathname'));\n"
" navTo(o,link,$(location).attr('hash'),relpath);\n"
" }\n"
" })\n"