navtree.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. var NAVTREE =
  2. [
  3. [ "CMSIS-Pack", "index.html", [
  4. [ "Software Pack Use Cases", "index.html#SWPackVariants", null ],
  5. [ "Revision History of CMSIS-Pack", "pack_revisionHistory.html", null ],
  6. [ "Overview", "cp_Packs.html", [
  7. [ "Software Components", "cp_Packs.html#cp_Components", [
  8. [ "Technical Details", "cp_Packs.html#cp_CompDetails", null ],
  9. [ "Software Component Files", "cp_Packs.html#cp_CompFiles", null ],
  10. [ "File naming", "cp_Packs.html#cp_CompFileNaming", null ]
  11. ] ],
  12. [ "References to other software components", "cp_Packs.html#cp_Cond", null ],
  13. [ "Requirements", "cp_Packs.html#cp_Requirements", null ],
  14. [ "Central API definition", "cp_Packs.html#cp_APIDef", null ],
  15. [ "Inventory header file: RTE_Components.h", "cp_Packs.html#cp_RTECompH", null ],
  16. [ "Combining software components", "cp_Packs.html#cp_Combine", null ],
  17. [ "Steps to Create a Pack", "cp_Packs.html#cp_PackSteps", null ],
  18. [ "Pack Tutorial", "cp_Packs.html#PackTutorials", null ],
  19. [ "Pack Conventions", "cp_Packs.html#PackFilenames", [
  20. [ "Pack File Name", "cp_Packs.html#pack_filename", null ],
  21. [ "Software Component Cclasses", "cp_Packs.html#pack_Cclass", null ]
  22. ] ]
  23. ] ],
  24. [ "Pack with Software Components", "cp_SWComponents.html", [
  25. [ "Create PDSC File", "cp_SWComponents.html#cp_CreatePDSC", null ],
  26. [ "Generate a Pack", "cp_SWComponents.html#cp_GeneratePack", null ],
  27. [ "Software Components", "cp_SWComponents.html#cp_Components", null ],
  28. [ "Conditions", "cp_SWComponents.html#cp_Conditions", null ],
  29. [ "Variants", "cp_SWComponents.html#cp_Variants", null ],
  30. [ "RTE_Components.h", "cp_SWComponents.html#cp_RTEComponents_h", null ],
  31. [ "Bundles", "cp_SWComponents.html#cp_Bundles", null ],
  32. [ "Instances", "cp_SWComponents.html#cp_Instances", null ],
  33. [ "API Interface", "cp_SWComponents.html#cp_API", null ],
  34. [ "User Code Templates", "cp_SWComponents.html#cp_CodeTemplates", null ],
  35. [ "Example Projects", "cp_SWComponents.html#cp_Examples", null ]
  36. ] ],
  37. [ "Pack with Device Support", "createPack_DFP.html", [
  38. [ "Basic Device Family Pack", "createPack_DFP.html#cp_BasicDFP", null ],
  39. [ "System and Startup Files", "createPack_DFP.html#cp_System_Startp", null ],
  40. [ "System View Description File", "createPack_DFP.html#cp_SVD", null ],
  41. [ "Flash Programming Algorithms", "createPack_DFP.html#cp_FlashProgrammingAlgorithm", null ],
  42. [ "Debug Descriptions", "createPack_DFP.html#cp_debugdescription", null ],
  43. [ "Device Properties", "createPack_DFP.html#cp_DeviceProperties", [
  44. [ "Device Specific Software Components", "createPack_DFP.html#cp_DeviceSWComp", null ]
  45. ] ]
  46. ] ],
  47. [ "Pack with Board Support", "createPackBoard.html", [
  48. [ "Specify a Development Board", "createPackBoard.html#cp_SpecDevBoard", null ],
  49. [ "Create a BSP Bundle", "createPackBoard.html#cp_BundleExample", null ]
  50. ] ],
  51. [ "Pack Example", "pack_Example.html", null ],
  52. [ "Utilities for Creating Packs", "createPackUtil.html", "createPackUtil" ],
  53. [ "Publish a Pack", "createPackPublish.html", [
  54. [ "Prerequisites", "createPackPublish.html#cp_prerequisites", null ],
  55. [ "Local Installation", "createPackPublish.html#cp_LocalInstallation", null ],
  56. [ "Web Download", "createPackPublish.html#cp_WebDownload", null ],
  57. [ "Publish with Pack Index Service", "createPackPublish.html#cp_KeilComPack", null ],
  58. [ "Rehost pack to different URL", "createPackPublish.html#cp_PackRehosting", null ],
  59. [ "Web Infra-structure", "createPackPublish.html#cp_HowWebDownloadWorks", null ]
  60. ] ],
  61. [ "Pack Description (*.pdsc) Format", "packFormat.html", "packFormat" ],
  62. [ "Configuration Wizard Annotations", "configWizard.html", [
  63. [ "Annotation Rules", "configWizard.html#configWizard_annotations", null ],
  64. [ "Code Example", "configWizard.html#configWizard_codeExample", null ],
  65. [ "Tool-specific display", "configWizard.html#configWizard_display", null ]
  66. ] ],
  67. [ "Flash Programming", "flashAlgorithm.html", "flashAlgorithm" ],
  68. [ "Debug Setup with CMSIS-Pack", "coresight_setup.html", "coresight_setup" ],
  69. [ "System Description File (*.SDF) Format", "sdf_pg.html", [
  70. [ "SDF top level structure", "sdf_pg.html#sdf_structure", null ],
  71. [ "/system_description", "sdf_pg.html#sdf_element_system_description", null ],
  72. [ "/system_description/debug_and_trace_config", "sdf_pg.html#sdf_element_debug_and_trace_config", null ],
  73. [ "/system_description/debug_and_trace_config/debug", "sdf_pg.html#sdf_element_debug", null ],
  74. [ "/system_description/.../config_item", "sdf_pg.html#sdf_element_config_item", null ],
  75. [ "/system_description/debug_and_trace_config/trace", "sdf_pg.html#sdf_element_trace", null ],
  76. [ "/system_description/debug_and_trace_config/trace/trace_capture", "sdf_pg.html#sdf_element_trace_capture", null ],
  77. [ "/system_description/platform", "sdf_pg.html#sdf_element_platform", null ],
  78. [ "/system_description/platform/scanchain", "sdf_pg.html#sdf_element_scanchain", null ],
  79. [ "/system_description/platform/scanchain/dap", "sdf_pg.html#sdf_element_dap", null ],
  80. [ "/system_description/platform/scanchain/device", "sdf_pg.html#sdf_element_device", null ],
  81. [ "/system_description/platform/scanchain/../../config_items", "sdf_pg.html#sdf_element_config_items", null ],
  82. [ "/system_description/platform/scanchain/../../device_info_items", "sdf_pg.html#sdf_element_device_info_items", null ],
  83. [ "/system_description/platform/scanchain/../../device_info_items/device_info_item", "sdf_pg.html#sdf_element_device_info_item", null ],
  84. [ "/system_description/platform/topology", "sdf_pg.html#sdf_element_topology", null ],
  85. [ "/system_description/platform/topology/topology_link", "sdf_pg.html#sdf_element_topology_link", null ],
  86. [ "/system_description/platform/clusters", "sdf_pg.html#sdf_element_clusters", null ],
  87. [ "/system_description/platform/clusters/cluster", "sdf_pg.html#sdf_element_cluster", null ]
  88. ] ],
  89. [ "Pack Index Files", "packIndexFile.html", [
  90. [ "Package Index File (pidx)", "packIndexFile.html#pidxFile", null ],
  91. [ "Vendor Index File (vidx)", "packIndexFile.html#vidxFile", null ],
  92. [ "CMSIS-Pack Index Schema File", "packIndexFile.html#packIndexSchema", null ]
  93. ] ]
  94. ] ]
  95. ];
  96. var NAVTREEINDEX =
  97. [
  98. "algorithmFunc.html",
  99. "sdf_pg.html#sdf_element_system_description"
  100. ];
  101. var SYNCONMSG = 'click to disable panel synchronisation';
  102. var SYNCOFFMSG = 'click to enable panel synchronisation';
  103. var SYNCONMSG = 'click to disable panel synchronisation';
  104. var SYNCOFFMSG = 'click to enable panel synchronisation';
  105. var navTreeSubIndices = new Array();
  106. function getData(varName)
  107. {
  108. var i = varName.lastIndexOf('/');
  109. var n = i>=0 ? varName.substring(i+1) : varName;
  110. return eval(n.replace(/\-/g,'_'));
  111. }
  112. function stripPath(uri)
  113. {
  114. return uri.substring(uri.lastIndexOf('/')+1);
  115. }
  116. function stripPath2(uri)
  117. {
  118. var i = uri.lastIndexOf('/');
  119. var s = uri.substring(i+1);
  120. var m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/);
  121. return m ? uri.substring(i-6) : s;
  122. }
  123. function localStorageSupported()
  124. {
  125. try {
  126. return 'localStorage' in window && window['localStorage'] !== null && window.localStorage.getItem;
  127. }
  128. catch(e) {
  129. return false;
  130. }
  131. }
  132. function storeLink(link)
  133. {
  134. if (!$("#nav-sync").hasClass('sync') && localStorageSupported()) {
  135. window.localStorage.setItem('navpath',link);
  136. }
  137. }
  138. function deleteLink()
  139. {
  140. if (localStorageSupported()) {
  141. window.localStorage.setItem('navpath','');
  142. }
  143. }
  144. function cachedLink()
  145. {
  146. if (localStorageSupported()) {
  147. return window.localStorage.getItem('navpath');
  148. } else {
  149. return '';
  150. }
  151. }
  152. function getScript(scriptName,func,show)
  153. {
  154. var head = document.getElementsByTagName("head")[0];
  155. var script = document.createElement('script');
  156. script.id = scriptName;
  157. script.type = 'text/javascript';
  158. script.onload = func;
  159. script.src = scriptName+'.js';
  160. if ($.browser.msie && $.browser.version<=8) {
  161. // script.onload does not work with older versions of IE
  162. script.onreadystatechange = function() {
  163. if (script.readyState=='complete' || script.readyState=='loaded') {
  164. func(); if (show) showRoot();
  165. }
  166. }
  167. }
  168. head.appendChild(script);
  169. }
  170. function createIndent(o,domNode,node,level)
  171. {
  172. var level=-1;
  173. var n = node;
  174. while (n.parentNode) { level++; n=n.parentNode; }
  175. if (node.childrenData) {
  176. var imgNode = document.createElement("img");
  177. imgNode.style.paddingLeft=(16*level).toString()+'px';
  178. imgNode.width = 16;
  179. imgNode.height = 22;
  180. imgNode.border = 0;
  181. node.plus_img = imgNode;
  182. node.expandToggle = document.createElement("a");
  183. node.expandToggle.href = "javascript:void(0)";
  184. node.expandToggle.onclick = function() {
  185. if (node.expanded) {
  186. $(node.getChildrenUL()).slideUp("fast");
  187. node.plus_img.src = node.relpath+"ftv2pnode.png";
  188. node.expanded = false;
  189. } else {
  190. expandNode(o, node, false, false);
  191. }
  192. }
  193. node.expandToggle.appendChild(imgNode);
  194. domNode.appendChild(node.expandToggle);
  195. imgNode.src = node.relpath+"ftv2pnode.png";
  196. } else {
  197. var span = document.createElement("span");
  198. span.style.display = 'inline-block';
  199. span.style.width = 16*(level+1)+'px';
  200. span.style.height = '22px';
  201. span.innerHTML = '&#160;';
  202. domNode.appendChild(span);
  203. }
  204. }
  205. var animationInProgress = false;
  206. function gotoAnchor(anchor,aname,updateLocation)
  207. {
  208. var pos, docContent = $('#doc-content');
  209. if (anchor.parent().attr('class')=='memItemLeft' ||
  210. anchor.parent().attr('class')=='fieldtype' ||
  211. anchor.parent().is(':header'))
  212. {
  213. pos = anchor.parent().position().top;
  214. } else if (anchor.position()) {
  215. pos = anchor.position().top;
  216. }
  217. if (pos) {
  218. var dist = Math.abs(Math.min(
  219. pos-docContent.offset().top,
  220. docContent[0].scrollHeight-
  221. docContent.height()-docContent.scrollTop()));
  222. animationInProgress=true;
  223. docContent.animate({
  224. scrollTop: pos + docContent.scrollTop() - docContent.offset().top
  225. },Math.max(50,Math.min(500,dist)),function(){
  226. if (updateLocation) window.location.href=aname;
  227. animationInProgress=false;
  228. });
  229. }
  230. }
  231. function newNode(o, po, text, link, childrenData, lastNode)
  232. {
  233. var node = new Object();
  234. node.children = Array();
  235. node.childrenData = childrenData;
  236. node.depth = po.depth + 1;
  237. node.relpath = po.relpath;
  238. node.isLast = lastNode;
  239. node.li = document.createElement("li");
  240. po.getChildrenUL().appendChild(node.li);
  241. node.parentNode = po;
  242. node.itemDiv = document.createElement("div");
  243. node.itemDiv.className = "item";
  244. node.labelSpan = document.createElement("span");
  245. node.labelSpan.className = "label";
  246. createIndent(o,node.itemDiv,node,0);
  247. node.itemDiv.appendChild(node.labelSpan);
  248. node.li.appendChild(node.itemDiv);
  249. var a = document.createElement("a");
  250. node.labelSpan.appendChild(a);
  251. node.label = document.createTextNode(text);
  252. node.expanded = false;
  253. a.appendChild(node.label);
  254. if (link) {
  255. var url;
  256. if (link.substring(0,1)=='^') {
  257. url = link.substring(1);
  258. link = url;
  259. } else {
  260. url = node.relpath+link;
  261. }
  262. a.className = stripPath(link.replace('#',':'));
  263. if (link.indexOf('#')!=-1) {
  264. var aname = '#'+link.split('#')[1];
  265. var srcPage = stripPath($(location).attr('pathname'));
  266. var targetPage = stripPath(link.split('#')[0]);
  267. a.href = srcPage!=targetPage ? url : "javascript:void(0)";
  268. a.onclick = function(){
  269. storeLink(link);
  270. if (!$(a).parent().parent().hasClass('selected'))
  271. {
  272. $('.item').removeClass('selected');
  273. $('.item').removeAttr('id');
  274. $(a).parent().parent().addClass('selected');
  275. $(a).parent().parent().attr('id','selected');
  276. }
  277. var anchor = $(aname);
  278. gotoAnchor(anchor,aname,true);
  279. };
  280. } else {
  281. a.href = url;
  282. a.onclick = function() { storeLink(link); }
  283. }
  284. } else {
  285. if (childrenData != null)
  286. {
  287. a.className = "nolink";
  288. a.href = "javascript:void(0)";
  289. a.onclick = node.expandToggle.onclick;
  290. }
  291. }
  292. node.childrenUL = null;
  293. node.getChildrenUL = function() {
  294. if (!node.childrenUL) {
  295. node.childrenUL = document.createElement("ul");
  296. node.childrenUL.className = "children_ul";
  297. node.childrenUL.style.display = "none";
  298. node.li.appendChild(node.childrenUL);
  299. }
  300. return node.childrenUL;
  301. };
  302. return node;
  303. }
  304. function showRoot()
  305. {
  306. var headerHeight = $("#top").height();
  307. var footerHeight = $("#nav-path").height();
  308. var windowHeight = $(window).height() - headerHeight - footerHeight;
  309. (function (){ // retry until we can scroll to the selected item
  310. try {
  311. var navtree=$('#nav-tree');
  312. navtree.scrollTo('#selected',0,{offset:-windowHeight/2});
  313. } catch (err) {
  314. setTimeout(arguments.callee, 0);
  315. }
  316. })();
  317. }
  318. function expandNode(o, node, imm, showRoot)
  319. {
  320. if (node.childrenData && !node.expanded) {
  321. if (typeof(node.childrenData)==='string') {
  322. var varName = node.childrenData;
  323. getScript(node.relpath+varName,function(){
  324. node.childrenData = getData(varName);
  325. expandNode(o, node, imm, showRoot);
  326. }, showRoot);
  327. } else {
  328. if (!node.childrenVisited) {
  329. getNode(o, node);
  330. } if (imm || ($.browser.msie && $.browser.version>8)) {
  331. // somehow slideDown jumps to the start of tree for IE9 :-(
  332. $(node.getChildrenUL()).show();
  333. } else {
  334. $(node.getChildrenUL()).slideDown("fast");
  335. }
  336. if (node.isLast) {
  337. node.plus_img.src = node.relpath+"ftv2mlastnode.png";
  338. } else {
  339. node.plus_img.src = node.relpath+"ftv2mnode.png";
  340. }
  341. node.expanded = true;
  342. }
  343. }
  344. }
  345. function glowEffect(n,duration)
  346. {
  347. n.addClass('glow').delay(duration).queue(function(next){
  348. $(this).removeClass('glow');next();
  349. });
  350. }
  351. function highlightAnchor()
  352. {
  353. var aname = $(location).attr('hash');
  354. var anchor = $(aname);
  355. if (anchor.parent().attr('class')=='memItemLeft'){
  356. var rows = $('.memberdecls tr[class$="'+
  357. window.location.hash.substring(1)+'"]');
  358. glowEffect(rows.children(),300); // member without details
  359. } else if (anchor.parents().slice(2).prop('tagName')=='TR') {
  360. glowEffect(anchor.parents('div.memitem'),1000); // enum value
  361. } else if (anchor.parent().attr('class')=='fieldtype'){
  362. glowEffect(anchor.parent().parent(),1000); // struct field
  363. } else if (anchor.parent().is(":header")) {
  364. glowEffect(anchor.parent(),1000); // section header
  365. } else {
  366. glowEffect(anchor.next(),1000); // normal member
  367. }
  368. gotoAnchor(anchor,aname,false);
  369. }
  370. function selectAndHighlight(hash,n)
  371. {
  372. var a;
  373. if (hash) {
  374. var link=stripPath($(location).attr('pathname'))+':'+hash.substring(1);
  375. a=$('.item a[class$="'+link+'"]');
  376. }
  377. if (a && a.length) {
  378. a.parent().parent().addClass('selected');
  379. a.parent().parent().attr('id','selected');
  380. highlightAnchor();
  381. } else if (n) {
  382. $(n.itemDiv).addClass('selected');
  383. $(n.itemDiv).attr('id','selected');
  384. }
  385. if ($('#nav-tree-contents .item:first').hasClass('selected')) {
  386. $('#nav-sync').css('top','30px');
  387. } else {
  388. $('#nav-sync').css('top','5px');
  389. }
  390. showRoot();
  391. }
  392. function showNode(o, node, index, hash)
  393. {
  394. if (node && node.childrenData) {
  395. if (typeof(node.childrenData)==='string') {
  396. var varName = node.childrenData;
  397. getScript(node.relpath+varName,function(){
  398. node.childrenData = getData(varName);
  399. showNode(o,node,index,hash);
  400. },true);
  401. } else {
  402. if (!node.childrenVisited) {
  403. getNode(o, node);
  404. }
  405. $(node.getChildrenUL()).css({'display':'block'});
  406. if (node.isLast) {
  407. node.plus_img.src = node.relpath+"ftv2mlastnode.png";
  408. } else {
  409. node.plus_img.src = node.relpath+"ftv2mnode.png";
  410. }
  411. node.expanded = true;
  412. var n = node.children[o.breadcrumbs[index]];
  413. if (index+1<o.breadcrumbs.length) {
  414. showNode(o,n,index+1,hash);
  415. } else {
  416. if (typeof(n.childrenData)==='string') {
  417. var varName = n.childrenData;
  418. getScript(n.relpath+varName,function(){
  419. n.childrenData = getData(varName);
  420. node.expanded=false;
  421. showNode(o,node,index,hash); // retry with child node expanded
  422. },true);
  423. } else {
  424. var rootBase = stripPath(o.toroot.replace(/\..+$/, ''));
  425. if (rootBase=="index" || rootBase=="pages" || rootBase=="search") {
  426. expandNode(o, n, true, true);
  427. }
  428. selectAndHighlight(hash,n);
  429. }
  430. }
  431. }
  432. } else {
  433. selectAndHighlight(hash);
  434. }
  435. }
  436. function removeToInsertLater(element) {
  437. var parentNode = element.parentNode;
  438. var nextSibling = element.nextSibling;
  439. parentNode.removeChild(element);
  440. return function() {
  441. if (nextSibling) {
  442. parentNode.insertBefore(element, nextSibling);
  443. } else {
  444. parentNode.appendChild(element);
  445. }
  446. };
  447. }
  448. function getNode(o, po)
  449. {
  450. var insertFunction = removeToInsertLater(po.li);
  451. po.childrenVisited = true;
  452. var l = po.childrenData.length-1;
  453. for (var i in po.childrenData) {
  454. var nodeData = po.childrenData[i];
  455. po.children[i] = newNode(o, po, nodeData[0], nodeData[1], nodeData[2],
  456. i==l);
  457. }
  458. insertFunction();
  459. }
  460. function gotoNode(o,subIndex,root,hash,relpath)
  461. {
  462. var nti = navTreeSubIndices[subIndex][root+hash];
  463. o.breadcrumbs = $.extend(true, [], nti ? nti : navTreeSubIndices[subIndex][root]);
  464. if (!o.breadcrumbs && root!=NAVTREE[0][1]) { // fallback: show index
  465. navTo(o,NAVTREE[0][1],"",relpath);
  466. $('.item').removeClass('selected');
  467. $('.item').removeAttr('id');
  468. }
  469. if (o.breadcrumbs) {
  470. o.breadcrumbs.unshift(0); // add 0 for root node
  471. showNode(o, o.node, 0, hash);
  472. }
  473. }
  474. function navTo(o,root,hash,relpath)
  475. {
  476. var link = cachedLink();
  477. if (link) {
  478. var parts = link.split('#');
  479. root = parts[0];
  480. if (parts.length>1) hash = '#'+parts[1];
  481. else hash='';
  482. }
  483. if (hash.match(/^#l\d+$/)) {
  484. var anchor=$('a[name='+hash.substring(1)+']');
  485. glowEffect(anchor.parent(),1000); // line number
  486. hash=''; // strip line number anchors
  487. //root=root.replace(/_source\./,'.'); // source link to doc link
  488. }
  489. var url=root+hash;
  490. var i=-1;
  491. while (NAVTREEINDEX[i+1]<=url) i++;
  492. if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index
  493. if (navTreeSubIndices[i]) {
  494. gotoNode(o,i,root,hash,relpath)
  495. } else {
  496. getScript(relpath+'navtreeindex'+i,function(){
  497. navTreeSubIndices[i] = eval('NAVTREEINDEX'+i);
  498. if (navTreeSubIndices[i]) {
  499. gotoNode(o,i,root,hash,relpath);
  500. }
  501. },true);
  502. }
  503. }
  504. function showSyncOff(n,relpath)
  505. {
  506. n.html('<img src="'+relpath+'sync_off.png" title="'+SYNCOFFMSG+'"/>');
  507. }
  508. function showSyncOn(n,relpath)
  509. {
  510. n.html('<img src="'+relpath+'sync_on.png" title="'+SYNCONMSG+'"/>');
  511. }
  512. function toggleSyncButton(relpath)
  513. {
  514. var navSync = $('#nav-sync');
  515. if (navSync.hasClass('sync')) {
  516. navSync.removeClass('sync');
  517. showSyncOff(navSync,relpath);
  518. storeLink(stripPath2($(location).attr('pathname'))+$(location).attr('hash'));
  519. } else {
  520. navSync.addClass('sync');
  521. showSyncOn(navSync,relpath);
  522. deleteLink();
  523. }
  524. }
  525. function initNavTree(toroot,relpath)
  526. {
  527. var o = new Object();
  528. o.toroot = toroot;
  529. o.node = new Object();
  530. o.node.li = document.getElementById("nav-tree-contents");
  531. o.node.childrenData = NAVTREE;
  532. o.node.children = new Array();
  533. o.node.childrenUL = document.createElement("ul");
  534. o.node.getChildrenUL = function() { return o.node.childrenUL; };
  535. o.node.li.appendChild(o.node.childrenUL);
  536. o.node.depth = 0;
  537. o.node.relpath = relpath;
  538. o.node.expanded = false;
  539. o.node.isLast = true;
  540. o.node.plus_img = document.createElement("img");
  541. o.node.plus_img.src = relpath+"ftv2pnode.png";
  542. o.node.plus_img.width = 16;
  543. o.node.plus_img.height = 22;
  544. if (localStorageSupported()) {
  545. var navSync = $('#nav-sync');
  546. if (cachedLink()) {
  547. showSyncOff(navSync,relpath);
  548. navSync.removeClass('sync');
  549. } else {
  550. showSyncOn(navSync,relpath);
  551. }
  552. navSync.click(function(){ toggleSyncButton(relpath); });
  553. }
  554. $(window).load(function(){
  555. navTo(o,toroot,window.location.hash,relpath);
  556. showRoot();
  557. });
  558. $(window).bind('hashchange', function(){
  559. if (window.location.hash && window.location.hash.length>1){
  560. var a;
  561. if ($(location).attr('hash')){
  562. var clslink=stripPath($(location).attr('pathname'))+':'+
  563. $(location).attr('hash').substring(1);
  564. a=$('.item a[class$="'+clslink+'"]');
  565. }
  566. if (a==null || !$(a).parent().parent().hasClass('selected')){
  567. $('.item').removeClass('selected');
  568. $('.item').removeAttr('id');
  569. }
  570. var link=stripPath2($(location).attr('pathname'));
  571. navTo(o,link,$(location).attr('hash'),relpath);
  572. } else if (!animationInProgress) {
  573. $('#doc-content').scrollTop(0);
  574. $('.item').removeClass('selected');
  575. $('.item').removeAttr('id');
  576. navTo(o,toroot,window.location.hash,relpath);
  577. }
  578. })
  579. }