| // navtree functions created by doxygen have been overloaded in this file and |
| // should be loaded after the navtree.js file is loaded in header.html |
| // The changes below are borrowed primarily from the Eigen documentation page |
| // (https://github.com/bravegag/eigen-magma/blob/master/doc/eigen_navtree_hacks.js) |
| |
| // Overloaded to save the root node into global_navtree_object |
| var global_navtree_object; |
| function initNavTree(toroot,relpath) |
| { |
| var o = new Object(); |
| global_navtree_object = o; // <- we added this line |
| o.toroot = toroot; |
| o.node = new Object(); |
| o.node.li = document.getElementById("nav-tree-contents"); |
| o.node.childrenData = NAVTREE; |
| o.node.children = new Array(); |
| o.node.childrenUL = document.createElement("ul"); |
| o.node.getChildrenUL = function() { return o.node.childrenUL; }; |
| o.node.li.appendChild(o.node.childrenUL); |
| o.node.depth = 0; |
| o.node.relpath = relpath; |
| o.node.expanded = false; |
| o.node.isLast = true; |
| o.node.plus_img = document.createElement("img"); |
| o.node.plus_img.src = relpath+"ftv2pnode.png"; |
| o.node.plus_img.width = 16; |
| o.node.plus_img.height = 22; |
| |
| if (localStorageSupported()) { |
| var navSync = $('#nav-sync'); |
| if (cachedLink()) { |
| showSyncOff(navSync,relpath); |
| navSync.removeClass('sync'); |
| } else { |
| showSyncOn(navSync,relpath); |
| } |
| navSync.click(function(){ toggleSyncButton(relpath); }); |
| } |
| |
| navTo(o,toroot,window.location.hash,relpath); |
| |
| $(window).bind('hashchange', function(){ |
| if (window.location.hash && window.location.hash.length>1){ |
| var a; |
| if ($(location).attr('hash')){ |
| var clslink=stripPath($(location).attr('pathname'))+':'+ |
| $(location).attr('hash').substring(1); |
| a=$('.item a[class$="'+clslink+'"]'); |
| } |
| if (a==null || !$(a).parent().parent().hasClass('selected')){ |
| $('.item').removeClass('selected'); |
| $('.item').removeAttr('id'); |
| } |
| var link=stripPath2($(location).attr('pathname')); |
| navTo(o,link,$(location).attr('hash'),relpath); |
| } else if (!animationInProgress) { |
| $('#doc-content').scrollTop(0); |
| $('.item').removeClass('selected'); |
| $('.item').removeAttr('id'); |
| navTo(o,toroot,window.location.hash,relpath); |
| } |
| }) |
| |
| $(window).load(showRoot); |
| } |
| |
| // Overloaded to automatically expand the selected node |
| function selectAndHighlight(hash,n) |
| { |
| var a; |
| if (hash) { |
| var link=stripPath($(location).attr('pathname'))+':'+hash.substring(1); |
| a=$('.item a[class$="'+link+'"]'); |
| } |
| if (a && a.length) { |
| a.parent().parent().addClass('selected'); |
| a.parent().parent().attr('id','selected'); |
| highlightAnchor(); |
| } else if (n) { |
| $(n.itemDiv).addClass('selected'); |
| $(n.itemDiv).attr('id','selected'); |
| } |
| if ($('#nav-tree-contents .item:first').hasClass('selected')) { |
| $('#nav-sync').css('top','30px'); |
| } else { |
| $('#nav-sync').css('top','5px'); |
| } |
| expandNode(global_navtree_object, n, true, true); // <- we added this line |
| showRoot(); |
| } |
| |
| // Modified to remove the root node |
| function createIndent(o,domNode,node,level) |
| { |
| var level=-2; // <- this line was updated from -1 to -2 |
| var n = node; |
| while (n.parentNode) { level++; n=n.parentNode; } |
| if (node.childrenData) { |
| var imgNode = document.createElement("img"); |
| imgNode.style.paddingLeft=(16*level).toString()+'px'; |
| imgNode.width = 16; |
| imgNode.height = 22; |
| imgNode.border = 0; |
| node.plus_img = imgNode; |
| node.expandToggle = document.createElement("a"); |
| node.expandToggle.href = "javascript:void(0)"; |
| node.expandToggle.onclick = function() { |
| if (node.expanded) { |
| $(node.getChildrenUL()).slideUp("fast"); |
| node.plus_img.src = node.relpath+"arrowright.png"; |
| node.expanded = false; |
| } else { |
| expandNode(o, node, false, false); |
| } |
| } |
| node.expandToggle.appendChild(imgNode); |
| domNode.appendChild(node.expandToggle); |
| imgNode.src = node.relpath+"arrowright.png"; |
| } else { |
| var span = document.createElement("span"); |
| span.style.display = 'inline-block'; |
| span.style.width = 16*(level+1)+'px'; |
| span.style.height = '22px'; |
| span.innerHTML = ' '; |
| domNode.appendChild(span); |
| } |
| } |
| |
| $(document).ready(function() { |
| |
| (function (){ // wait until the first "selected" element has been created |
| try { |
| |
| // this line will triger an exception if there is no #selected element, i.e., before the tree structure is complete. |
| document.getElementById("selected").className = "item selected"; |
| |
| // ok, the default tree has been created, we can keep going... |
| // we want to expand the function list by default |
| expandNode(global_navtree_object, global_navtree_object.node.children[0].children[0], true, true); |
| |
| // Hide the "modules" node |
| $(document.getElementsByClassName('modules.html')[0]).parent().parent().css({display:"none"}); |
| |
| } catch (err) { |
| setTimeout(arguments.callee, 10); |
| } |
| })(); |
| }); |