Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/util/doxygen/src/navtree_js.h

Source at commit 1322 created 9 years 5 months ago.
By meklort, Add doxygen to utils folder
1"function createIndent(o,domNode,node,level)\n"
2"{\n"
3" if (node.parentNode && node.parentNode.parentNode)\n"
4" {\n"
5" createIndent(o,domNode,node.parentNode,level+1);\n"
6" }\n"
7" var imgNode = document.createElement(\"img\");\n"
8" if (level==0 && node.childrenData)\n"
9" {\n"
10" node.plus_img = imgNode;\n"
11" node.expandToggle = document.createElement(\"a\");\n"
12" node.expandToggle.href = \"javascript:void(0)\";\n"
13" node.expandToggle.onclick = function() \n"
14" {\n"
15" if (node.expanded) \n"
16" {\n"
17" $(node.getChildrenUL()).slideUp(\"fast\");\n"
18" if (node.isLast)\n"
19" {\n"
20" node.plus_img.src = node.relpath+\"ftv2plastnode.png\";\n"
21" }\n"
22" else\n"
23" {\n"
24" node.plus_img.src = node.relpath+\"ftv2pnode.png\";\n"
25" }\n"
26" node.expanded = false;\n"
27" } \n"
28" else \n"
29" {\n"
30" expandNode(o, node, false);\n"
31" }\n"
32" }\n"
33" node.expandToggle.appendChild(imgNode);\n"
34" domNode.appendChild(node.expandToggle);\n"
35" }\n"
36" else\n"
37" {\n"
38" domNode.appendChild(imgNode);\n"
39" }\n"
40" if (level==0)\n"
41" {\n"
42" if (node.isLast)\n"
43" {\n"
44" if (node.childrenData)\n"
45" {\n"
46" imgNode.src = node.relpath+\"ftv2plastnode.png\";\n"
47" }\n"
48" else\n"
49" {\n"
50" imgNode.src = node.relpath+\"ftv2lastnode.png\";\n"
51" domNode.appendChild(imgNode);\n"
52" }\n"
53" }\n"
54" else\n"
55" {\n"
56" if (node.childrenData)\n"
57" {\n"
58" imgNode.src = node.relpath+\"ftv2pnode.png\";\n"
59" }\n"
60" else\n"
61" {\n"
62" imgNode.src = node.relpath+\"ftv2node.png\";\n"
63" domNode.appendChild(imgNode);\n"
64" }\n"
65" }\n"
66" }\n"
67" else\n"
68" {\n"
69" if (node.isLast)\n"
70" {\n"
71" imgNode.src = node.relpath+\"ftv2blank.png\";\n"
72" }\n"
73" else\n"
74" {\n"
75" imgNode.src = node.relpath+\"ftv2vertline.png\";\n"
76" }\n"
77" }\n"
78" imgNode.border = \"0\";\n"
79"}\n"
80"\n"
81"function newNode(o, po, text, link, childrenData, lastNode)\n"
82"{\n"
83" var node = new Object();\n"
84" node.children = Array();\n"
85" node.childrenData = childrenData;\n"
86" node.depth = po.depth + 1;\n"
87" node.relpath = po.relpath;\n"
88" node.isLast = lastNode;\n"
89"\n"
90" node.li = document.createElement(\"li\");\n"
91" po.getChildrenUL().appendChild(node.li);\n"
92" node.parentNode = po;\n"
93"\n"
94" node.itemDiv = document.createElement(\"div\");\n"
95" node.itemDiv.className = \"item\";\n"
96"\n"
97" node.labelSpan = document.createElement(\"span\");\n"
98" node.labelSpan.className = \"label\";\n"
99"\n"
100" createIndent(o,node.itemDiv,node,0);\n"
101" node.itemDiv.appendChild(node.labelSpan);\n"
102" node.li.appendChild(node.itemDiv);\n"
103"\n"
104" var a = document.createElement(\"a\");\n"
105" node.labelSpan.appendChild(a);\n"
106" node.label = document.createTextNode(text);\n"
107" a.appendChild(node.label);\n"
108" if (link) \n"
109" {\n"
110" a.href = node.relpath+link;\n"
111" } \n"
112" else \n"
113" {\n"
114" if (childrenData != null) \n"
115" {\n"
116" a.className = \"nolink\";\n"
117" a.href = \"javascript:void(0)\";\n"
118" a.onclick = node.expandToggle.onclick;\n"
119" node.expanded = false;\n"
120" }\n"
121" }\n"
122"\n"
123" node.childrenUL = null;\n"
124" node.getChildrenUL = function() \n"
125" {\n"
126" if (!node.childrenUL) \n"
127" {\n"
128" node.childrenUL = document.createElement(\"ul\");\n"
129" node.childrenUL.className = \"children_ul\";\n"
130" node.childrenUL.style.display = \"none\";\n"
131" node.li.appendChild(node.childrenUL);\n"
132" }\n"
133" return node.childrenUL;\n"
134" };\n"
135"\n"
136" return node;\n"
137"}\n"
138"\n"
139"function showRoot()\n"
140"{\n"
141" var headerHeight = $(\"#top\").height();\n"
142" var footerHeight = $(\"#nav-path\").height();\n"
143" var windowHeight = $(window).height() - headerHeight - footerHeight;\n"
144" navtree.scrollTo('#selected',0,{offset:-windowHeight/2});\n"
145"}\n"
146"\n"
147"function expandNode(o, node, imm)\n"
148"{\n"
149" if (node.childrenData && !node.expanded) \n"
150" {\n"
151" if (!node.childrenVisited) \n"
152" {\n"
153" getNode(o, node);\n"
154" }\n"
155" if (imm)\n"
156" {\n"
157" $(node.getChildrenUL()).show();\n"
158" } \n"
159" else \n"
160" {\n"
161" $(node.getChildrenUL()).slideDown(\"fast\",showRoot);\n"
162" }\n"
163" if (node.isLast)\n"
164" {\n"
165" node.plus_img.src = node.relpath+\"ftv2mlastnode.png\";\n"
166" }\n"
167" else\n"
168" {\n"
169" node.plus_img.src = node.relpath+\"ftv2mnode.png\";\n"
170" }\n"
171" node.expanded = true;\n"
172" }\n"
173"}\n"
174"\n"
175"function getNode(o, po)\n"
176"{\n"
177" po.childrenVisited = true;\n"
178" var l = po.childrenData.length-1;\n"
179" for (var i in po.childrenData) \n"
180" {\n"
181" var nodeData = po.childrenData[i];\n"
182" po.children[i] = newNode(o, po, nodeData[0], nodeData[1], nodeData[2],\n"
183" i==l);\n"
184" }\n"
185"}\n"
186"\n"
187"function findNavTreePage(url, data)\n"
188"{\n"
189" var nodes = data;\n"
190" var result = null;\n"
191" for (var i in nodes) \n"
192" {\n"
193" var d = nodes[i];\n"
194" if (d[1] == url) \n"
195" {\n"
196" return new Array(i);\n"
197" }\n"
198" else if (d[2] != null) // array of children\n"
199" {\n"
200" result = findNavTreePage(url, d[2]);\n"
201" if (result != null) \n"
202" {\n"
203" return (new Array(i).concat(result));\n"
204" }\n"
205" }\n"
206" }\n"
207" return null;\n"
208"}\n"
209"\n"
210"function initNavTree(toroot,relpath)\n"
211"{\n"
212" var o = new Object();\n"
213" o.toroot = toroot;\n"
214" o.node = new Object();\n"
215" o.node.li = document.getElementById(\"nav-tree-contents\");\n"
216" o.node.childrenData = NAVTREE;\n"
217" o.node.children = new Array();\n"
218" o.node.childrenUL = document.createElement(\"ul\");\n"
219" o.node.getChildrenUL = function() { return o.node.childrenUL; };\n"
220" o.node.li.appendChild(o.node.childrenUL);\n"
221" o.node.depth = 0;\n"
222" o.node.relpath = relpath;\n"
223"\n"
224" getNode(o, o.node);\n"
225"\n"
226" o.breadcrumbs = findNavTreePage(toroot, NAVTREE);\n"
227" if (o.breadcrumbs == null)\n"
228" {\n"
229" o.breadcrumbs = findNavTreePage(\"index.html\",NAVTREE);\n"
230" }\n"
231" if (o.breadcrumbs != null && o.breadcrumbs.length>0)\n"
232" {\n"
233" var p = o.node;\n"
234" for (var i in o.breadcrumbs) \n"
235" {\n"
236" var j = o.breadcrumbs[i];\n"
237" p = p.children[j];\n"
238" expandNode(o,p,true);\n"
239" }\n"
240" p.itemDiv.className = p.itemDiv.className + \" selected\";\n"
241" p.itemDiv.id = \"selected\";\n"
242" $(window).load(showRoot);\n"
243" }\n"
244"}\n"
245"\n"
246

Archive Download this file

Revision: 1322