blob: a46d553dcfe4f5858ff33b08a73323d4399b7139 [file] [log] [blame]
miloyip28df04d2014-08-08 13:48:11 +00001var NAVTREE =
2[
3 [ "RapidJSON", "index.html", [
4 [ "Features", "md_doc_features.html", null ],
5 [ "Tutorial", "md_doc_tutorial.html", [
6 [ "Value & Document", "md_doc_tutorial.html#ValueDocument", null ],
7 [ "Query Value", "md_doc_tutorial.html#QueryValue", [
8 [ "Query Array", "md_doc_tutorial.html#QueryArray", null ],
9 [ "Query Object", "md_doc_tutorial.html#QueryObject", null ],
10 [ "Querying Number", "md_doc_tutorial.html#QueryNumber", null ],
11 [ "Query String", "md_doc_tutorial.html#QueryString", null ]
12 ] ],
13 [ "Create/Modify Values", "md_doc_tutorial.html#CreateModifyValues", [
14 [ "Change Value Type", "md_doc_tutorial.html#ChangeValueType", null ],
15 [ "Move Semantics", "md_doc_tutorial.html#MoveSemantics", [
16 [ "Move semantics and temporary values", "md_doc_tutorial.html#TemporaryValues", null ]
17 ] ],
18 [ "Create String", "md_doc_tutorial.html#CreateString", null ],
19 [ "Modify Array", "md_doc_tutorial.html#ModifyArray", null ],
20 [ "Modify Object", "md_doc_tutorial.html#ModifyObject", null ],
21 [ "Deep Copy Value", "md_doc_tutorial.html#DeepCopyValue", null ],
22 [ "Swap Values", "md_doc_tutorial.html#SwapValues", null ]
23 ] ],
24 [ "What's next", "md_doc_tutorial.html#WhatsNext", null ]
25 ] ],
miloyip252e3b82015-05-04 08:59:38 +000026 [ "Pointer", "md_doc_pointer.html", [
27 [ "JSON Pointer", "md_doc_pointer.html#JsonPointer", null ],
28 [ "Basic Usage", "md_doc_pointer.html#BasicUsage", null ],
29 [ "Helper Functions", "md_doc_pointer.html#HelperFunctions", null ],
30 [ "Resolving Pointer", "md_doc_pointer.html#ResolvingPointer", null ],
31 [ "Error Handling", "md_doc_pointer.html#ErrorHandling", null ],
32 [ "URI Fragment Representation", "md_doc_pointer.html#URIFragment", null ],
33 [ "User-Supplied Tokens", "md_doc_pointer.html#UserSuppliedTokens", null ]
34 ] ],
miloyip28df04d2014-08-08 13:48:11 +000035 [ "Stream", "md_doc_stream.html", [
36 [ "Memory Streams", "md_doc_stream.html#MemoryStreams", [
37 [ "StringStream (Input)", "md_doc_stream.html#StringStream", null ],
38 [ "StringBuffer (Output)", "md_doc_stream.html#StringBuffer", null ]
39 ] ],
40 [ "File Streams", "md_doc_stream.html#FileStreams", [
41 [ "FileReadStream (Input)", "md_doc_stream.html#FileReadStream", null ],
42 [ "FileWriteStream (Output)", "md_doc_stream.html#FileWriteStream", null ]
43 ] ],
miloyipbd3e7122016-02-08 17:26:06 +000044 [ "iostream Wrapper", "md_doc_stream.html#iostreamWrapper", [
45 [ "IStreamWrapper", "md_doc_stream.html#IStreamWrapper", null ],
46 [ "OStreamWrapper", "md_doc_stream.html#OStreamWrapper", null ]
47 ] ],
miloyip28df04d2014-08-08 13:48:11 +000048 [ "Encoded Streams", "md_doc_stream.html#EncodedStreams", [
49 [ "EncodedInputStream", "md_doc_stream.html#EncodedInputStream", null ],
50 [ "EncodedOutputStream", "md_doc_stream.html#EncodedOutputStream", null ],
51 [ "AutoUTFInputStream", "md_doc_stream.html#AutoUTFInputStream", null ],
52 [ "AutoUTFOutputStream", "md_doc_stream.html#AutoUTFOutputStream", null ]
53 ] ],
54 [ "Custom Stream", "md_doc_stream.html#CustomStream", [
55 [ "Example: istream wrapper", "md_doc_stream.html#ExampleIStreamWrapper", null ],
56 [ "Example: ostream wrapper", "md_doc_stream.html#ExampleOStreamWrapper", null ]
57 ] ],
58 [ "Summary", "md_doc_stream.html#Summary", null ]
59 ] ],
60 [ "Encoding", "md_doc_encoding.html", [
61 [ "Unicode", "md_doc_encoding.html#Unicode", [
62 [ "Unicode Transformation Format", "md_doc_encoding.html#UTF", null ],
63 [ "Character Type", "md_doc_encoding.html#CharacterType", null ],
64 [ "AutoUTF", "md_doc_encoding.html#AutoUTF", null ],
65 [ "ASCII", "md_doc_encoding.html#ASCII", null ]
66 ] ],
67 [ "Validation & Transcoding", "md_doc_encoding.html#ValidationTranscoding", [
68 [ "Transcoder", "md_doc_encoding.html#Transcoder", null ]
69 ] ]
70 ] ],
71 [ "DOM", "md_doc_dom.html", [
72 [ "Template", "md_doc_dom.html#Template", [
73 [ "Encoding", "md_doc_dom.html#Encoding", null ],
74 [ "Allocator", "md_doc_dom.html#Allocator", null ]
75 ] ],
76 [ "Parsing", "md_doc_dom.html#Parsing", [
77 [ "Parse Error", "md_doc_dom.html#ParseError", null ],
78 [ "In Situ Parsing", "md_doc_dom.html#InSituParsing", null ],
79 [ "Transcoding and Validation", "md_doc_dom.html#TranscodingAndValidation", null ]
80 ] ],
81 [ "Techniques", "md_doc_dom.html#Techniques", [
82 [ "User Buffer", "md_doc_dom.html#UserBuffer", null ]
83 ] ]
84 ] ],
85 [ "SAX", "md_doc_sax.html", [
86 [ "Reader", "md_doc_sax.html#Reader", [
87 [ "Handler", "md_doc_sax.html#Handler", null ],
88 [ "GenericReader", "md_doc_sax.html#GenericReader", null ]
89 ] ],
90 [ "Writer", "md_doc_sax.html#Writer", [
91 [ "PrettyWriter", "md_doc_sax.html#PrettyWriter", null ],
92 [ "Completeness and Reset", "md_doc_sax.html#CompletenessReset", null ],
93 [ "Parsing JSON to Custom Data Structure", "md_doc_sax.html#CustomDataStructure", null ],
94 [ "Filtering of JSON", "md_doc_sax.html#Filtering", null ]
95 ] ]
96 ] ],
miloyip32261812016-02-02 05:30:41 +000097 [ "Schema", "md_doc_schema.html", null ],
miloyip28df04d2014-08-08 13:48:11 +000098 [ "Performance", "md_doc_performance.html", null ],
99 [ "Internals", "md_doc_internals.html", [
miloyipaa96ef22015-04-03 02:09:27 +0000100 [ "Architecture", "md_doc_internals.html#Architecture", null ],
miloyip28df04d2014-08-08 13:48:11 +0000101 [ "Value", "md_doc_internals.html#Value", [
102 [ "Data Layout", "md_doc_internals.html#DataLayout", null ],
103 [ "Flags", "md_doc_internals.html#Flags", null ],
miloyipaa96ef22015-04-03 02:09:27 +0000104 [ "Short-String Optimization", "md_doc_internals.html#ShortString", null ],
miloyip28df04d2014-08-08 13:48:11 +0000105 [ "MemoryPoolAllocator", "md_doc_internals.html#MemoryPoolAllocator", null ]
106 ] ],
107 [ "Parsing Optimization", "md_doc_internals.html#ParsingOptimization", [
miloyipaa96ef22015-04-03 02:09:27 +0000108 [ "Skip Whitespaces with SIMD", "md_doc_internals.html#SkipwhitespaceWithSIMD", null ],
109 [ "Local Stream Copy", "md_doc_internals.html#LocalStreamCopy", null ],
110 [ "Parsing to Double", "md_doc_internals.html#ParsingDouble", null ]
111 ] ],
miloyipea82b0a2015-04-03 03:19:11 +0000112 [ "Generation Optimization", "md_doc_internals.html#GenerationOptimization", [
miloyipaa96ef22015-04-03 02:09:27 +0000113 [ "Integer-to-String conversion", "md_doc_internals.html#itoa", null ],
114 [ "Double-to-String conversion", "md_doc_internals.html#dtoa", null ]
miloyip28df04d2014-08-08 13:48:11 +0000115 ] ],
116 [ "Parser", "md_doc_internals.html#Parser", [
117 [ "Iterative Parser", "md_doc_internals.html#IterativeParser", [
118 [ "Grammar", "md_doc_internals.html#IterativeParserGrammar", null ],
119 [ "Parsing Table", "md_doc_internals.html#IterativeParserParsingTable", null ],
120 [ "Implementation", "md_doc_internals.html#IterativeParserImplementation", null ]
121 ] ]
122 ] ]
123 ] ],
124 [ "FAQ", "md_doc_faq.html", null ],
miloyip22ee6ef2014-08-20 01:22:05 +0000125 [ "Modules", "modules.html", "modules" ],
miloyip28df04d2014-08-08 13:48:11 +0000126 [ "Namespace Members", "namespacemembers.html", [
127 [ "All", "namespacemembers.html", null ],
128 [ "Functions", "namespacemembers_func.html", null ],
129 [ "Typedefs", "namespacemembers_type.html", null ],
130 [ "Enumerations", "namespacemembers_enum.html", null ],
131 [ "Enumerator", "namespacemembers_eval.html", null ]
132 ] ],
133 [ "Classes", null, [
134 [ "Class List", "annotated.html", "annotated" ],
135 [ "Class Hierarchy", "hierarchy.html", "hierarchy" ],
136 [ "Class Members", "functions.html", [
miloyip252e3b82015-05-04 08:59:38 +0000137 [ "All", "functions.html", "functions_dup" ],
miloyip32261812016-02-02 05:30:41 +0000138 [ "Functions", "functions_func.html", "functions_func" ],
miloyip28df04d2014-08-08 13:48:11 +0000139 [ "Variables", "functions_vars.html", null ],
140 [ "Typedefs", "functions_type.html", null ],
141 [ "Related Functions", "functions_rela.html", null ]
142 ] ]
143 ] ],
144 [ "Files", null, [
145 [ "File List", "files.html", "files" ],
146 [ "File Members", "globals.html", [
147 [ "All", "globals.html", null ],
148 [ "Macros", "globals_defs.html", null ]
149 ] ]
150 ] ]
151 ] ]
152];
153
154var NAVTREEINDEX =
155[
156"allocators_8h_source.html",
miloyipbd3e7122016-02-08 17:26:06 +0000157"classrapidjson_1_1_generic_schema_validator.html#a98a80c23569edb89af722c124a136b49",
158"classrapidjson_1_1_writer.html#ac30667a135e9ef11ada903fa18d39940",
159"md_doc_stream.html#ExampleOStreamWrapper"
miloyip28df04d2014-08-08 13:48:11 +0000160];
161
162var SYNCONMSG = 'click to disable panel synchronisation';
163var SYNCOFFMSG = 'click to enable panel synchronisation';
164var navTreeSubIndices = new Array();
165
166function getData(varName)
167{
168 var i = varName.lastIndexOf('/');
169 var n = i>=0 ? varName.substring(i+1) : varName;
170 return eval(n.replace(/\-/g,'_'));
171}
172
173function stripPath(uri)
174{
175 return uri.substring(uri.lastIndexOf('/')+1);
176}
177
178function stripPath2(uri)
179{
180 var i = uri.lastIndexOf('/');
181 var s = uri.substring(i+1);
182 var m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/);
183 return m ? uri.substring(i-6) : s;
184}
185
186function hashValue()
187{
188 return $(location).attr('hash').substring(1).replace(/[^\w\-]/g,'');
189}
190
191function hashUrl()
192{
193 return '#'+hashValue();
194}
195
196function pathName()
197{
198 return $(location).attr('pathname').replace(/[^-A-Za-z0-9+&@#/%?=~_|!:,.;\(\)]/g, '');
199}
200
201function localStorageSupported()
202{
203 try {
204 return 'localStorage' in window && window['localStorage'] !== null && window.localStorage.getItem;
205 }
206 catch(e) {
207 return false;
208 }
209}
210
211
212function storeLink(link)
213{
214 if (!$("#nav-sync").hasClass('sync') && localStorageSupported()) {
215 window.localStorage.setItem('navpath',link);
216 }
217}
218
219function deleteLink()
220{
221 if (localStorageSupported()) {
222 window.localStorage.setItem('navpath','');
223 }
224}
225
226function cachedLink()
227{
228 if (localStorageSupported()) {
229 return window.localStorage.getItem('navpath');
230 } else {
231 return '';
232 }
233}
234
235function getScript(scriptName,func,show)
236{
237 var head = document.getElementsByTagName("head")[0];
238 var script = document.createElement('script');
239 script.id = scriptName;
240 script.type = 'text/javascript';
241 script.onload = func;
242 script.src = scriptName+'.js';
243 if ($.browser.msie && $.browser.version<=8) {
244 // script.onload does not work with older versions of IE
245 script.onreadystatechange = function() {
246 if (script.readyState=='complete' || script.readyState=='loaded') {
247 func(); if (show) showRoot();
248 }
249 }
250 }
251 head.appendChild(script);
252}
253
254function createIndent(o,domNode,node,level)
255{
256 var level=-1;
257 var n = node;
258 while (n.parentNode) { level++; n=n.parentNode; }
259 if (node.childrenData) {
260 var imgNode = document.createElement("img");
261 imgNode.style.paddingLeft=(16*level).toString()+'px';
262 imgNode.width = 16;
263 imgNode.height = 22;
264 imgNode.border = 0;
265 node.plus_img = imgNode;
266 node.expandToggle = document.createElement("a");
267 node.expandToggle.href = "javascript:void(0)";
268 node.expandToggle.onclick = function() {
269 if (node.expanded) {
270 $(node.getChildrenUL()).slideUp("fast");
271 node.plus_img.src = node.relpath+"ftv2pnode.png";
272 node.expanded = false;
273 } else {
274 expandNode(o, node, false, false);
275 }
276 }
277 node.expandToggle.appendChild(imgNode);
278 domNode.appendChild(node.expandToggle);
279 imgNode.src = node.relpath+"ftv2pnode.png";
280 } else {
281 var span = document.createElement("span");
282 span.style.display = 'inline-block';
283 span.style.width = 16*(level+1)+'px';
284 span.style.height = '22px';
285 span.innerHTML = '&#160;';
286 domNode.appendChild(span);
287 }
288}
289
290var animationInProgress = false;
291
292function gotoAnchor(anchor,aname,updateLocation)
293{
294 var pos, docContent = $('#doc-content');
295 var ancParent = $(anchor.parent());
296 if (ancParent.hasClass('memItemLeft') ||
297 ancParent.hasClass('fieldname') ||
298 ancParent.hasClass('fieldtype') ||
299 ancParent.is(':header'))
300 {
301 pos = ancParent.position().top;
302 } else if (anchor.position()) {
303 pos = anchor.position().top;
304 }
305 if (pos) {
306 var dist = Math.abs(Math.min(
307 pos-docContent.offset().top,
308 docContent[0].scrollHeight-
309 docContent.height()-docContent.scrollTop()));
310 animationInProgress=true;
311 docContent.animate({
312 scrollTop: pos + docContent.scrollTop() - docContent.offset().top
313 },Math.max(50,Math.min(500,dist)),function(){
314 if (updateLocation) window.location.href=aname;
315 animationInProgress=false;
316 });
317 }
318}
319
320function newNode(o, po, text, link, childrenData, lastNode)
321{
322 var node = new Object();
323 node.children = Array();
324 node.childrenData = childrenData;
325 node.depth = po.depth + 1;
326 node.relpath = po.relpath;
327 node.isLast = lastNode;
328
329 node.li = document.createElement("li");
330 po.getChildrenUL().appendChild(node.li);
331 node.parentNode = po;
332
333 node.itemDiv = document.createElement("div");
334 node.itemDiv.className = "item";
335
336 node.labelSpan = document.createElement("span");
337 node.labelSpan.className = "label";
338
339 createIndent(o,node.itemDiv,node,0);
340 node.itemDiv.appendChild(node.labelSpan);
341 node.li.appendChild(node.itemDiv);
342
343 var a = document.createElement("a");
344 node.labelSpan.appendChild(a);
345 node.label = document.createTextNode(text);
346 node.expanded = false;
347 a.appendChild(node.label);
348 if (link) {
349 var url;
350 if (link.substring(0,1)=='^') {
351 url = link.substring(1);
352 link = url;
353 } else {
354 url = node.relpath+link;
355 }
356 a.className = stripPath(link.replace('#',':'));
357 if (link.indexOf('#')!=-1) {
358 var aname = '#'+link.split('#')[1];
359 var srcPage = stripPath(pathName());
360 var targetPage = stripPath(link.split('#')[0]);
361 a.href = srcPage!=targetPage ? url : "javascript:void(0)";
362 a.onclick = function(){
363 storeLink(link);
364 if (!$(a).parent().parent().hasClass('selected'))
365 {
366 $('.item').removeClass('selected');
367 $('.item').removeAttr('id');
368 $(a).parent().parent().addClass('selected');
369 $(a).parent().parent().attr('id','selected');
370 }
371 var anchor = $(aname);
372 gotoAnchor(anchor,aname,true);
373 };
374 } else {
375 a.href = url;
376 a.onclick = function() { storeLink(link); }
377 }
378 } else {
379 if (childrenData != null)
380 {
381 a.className = "nolink";
382 a.href = "javascript:void(0)";
383 a.onclick = node.expandToggle.onclick;
384 }
385 }
386
387 node.childrenUL = null;
388 node.getChildrenUL = function() {
389 if (!node.childrenUL) {
390 node.childrenUL = document.createElement("ul");
391 node.childrenUL.className = "children_ul";
392 node.childrenUL.style.display = "none";
393 node.li.appendChild(node.childrenUL);
394 }
395 return node.childrenUL;
396 };
397
398 return node;
399}
400
401function showRoot()
402{
403 var headerHeight = $("#top").height();
404 var footerHeight = $("#nav-path").height();
405 var windowHeight = $(window).height() - headerHeight - footerHeight;
406 (function (){ // retry until we can scroll to the selected item
407 try {
408 var navtree=$('#nav-tree');
409 navtree.scrollTo('#selected',0,{offset:-windowHeight/2});
410 } catch (err) {
411 setTimeout(arguments.callee, 0);
412 }
413 })();
414}
415
416function expandNode(o, node, imm, showRoot)
417{
418 if (node.childrenData && !node.expanded) {
419 if (typeof(node.childrenData)==='string') {
420 var varName = node.childrenData;
421 getScript(node.relpath+varName,function(){
422 node.childrenData = getData(varName);
423 expandNode(o, node, imm, showRoot);
424 }, showRoot);
425 } else {
426 if (!node.childrenVisited) {
427 getNode(o, node);
428 } if (imm || ($.browser.msie && $.browser.version>8)) {
429 // somehow slideDown jumps to the start of tree for IE9 :-(
430 $(node.getChildrenUL()).show();
431 } else {
432 $(node.getChildrenUL()).slideDown("fast");
433 }
434 if (node.isLast) {
435 node.plus_img.src = node.relpath+"ftv2mlastnode.png";
436 } else {
437 node.plus_img.src = node.relpath+"ftv2mnode.png";
438 }
439 node.expanded = true;
440 }
441 }
442}
443
444function glowEffect(n,duration)
445{
446 n.addClass('glow').delay(duration).queue(function(next){
447 $(this).removeClass('glow');next();
448 });
449}
450
451function highlightAnchor()
452{
453 var aname = hashUrl();
454 var anchor = $(aname);
455 if (anchor.parent().attr('class')=='memItemLeft'){
456 var rows = $('.memberdecls tr[class$="'+hashValue()+'"]');
457 glowEffect(rows.children(),300); // member without details
458 } else if (anchor.parent().attr('class')=='fieldname'){
459 glowEffect(anchor.parent().parent(),1000); // enum value
460 } else if (anchor.parent().attr('class')=='fieldtype'){
461 glowEffect(anchor.parent().parent(),1000); // struct field
462 } else if (anchor.parent().is(":header")) {
463 glowEffect(anchor.parent(),1000); // section header
464 } else {
465 glowEffect(anchor.next(),1000); // normal member
466 }
467 gotoAnchor(anchor,aname,false);
468}
469
470function selectAndHighlight(hash,n)
471{
472 var a;
473 if (hash) {
474 var link=stripPath(pathName())+':'+hash.substring(1);
475 a=$('.item a[class$="'+link+'"]');
476 }
477 if (a && a.length) {
478 a.parent().parent().addClass('selected');
479 a.parent().parent().attr('id','selected');
480 highlightAnchor();
481 } else if (n) {
482 $(n.itemDiv).addClass('selected');
483 $(n.itemDiv).attr('id','selected');
484 }
485 if ($('#nav-tree-contents .item:first').hasClass('selected')) {
486 $('#nav-sync').css('top','30px');
487 } else {
488 $('#nav-sync').css('top','5px');
489 }
490 showRoot();
491}
492
493function showNode(o, node, index, hash)
494{
495 if (node && node.childrenData) {
496 if (typeof(node.childrenData)==='string') {
497 var varName = node.childrenData;
498 getScript(node.relpath+varName,function(){
499 node.childrenData = getData(varName);
500 showNode(o,node,index,hash);
501 },true);
502 } else {
503 if (!node.childrenVisited) {
504 getNode(o, node);
505 }
506 $(node.getChildrenUL()).css({'display':'block'});
507 if (node.isLast) {
508 node.plus_img.src = node.relpath+"ftv2mlastnode.png";
509 } else {
510 node.plus_img.src = node.relpath+"ftv2mnode.png";
511 }
512 node.expanded = true;
513 var n = node.children[o.breadcrumbs[index]];
514 if (index+1<o.breadcrumbs.length) {
515 showNode(o,n,index+1,hash);
516 } else {
517 if (typeof(n.childrenData)==='string') {
518 var varName = n.childrenData;
519 getScript(n.relpath+varName,function(){
520 n.childrenData = getData(varName);
521 node.expanded=false;
522 showNode(o,node,index,hash); // retry with child node expanded
523 },true);
524 } else {
525 var rootBase = stripPath(o.toroot.replace(/\..+$/, ''));
526 if (rootBase=="index" || rootBase=="pages" || rootBase=="search") {
527 expandNode(o, n, true, true);
528 }
529 selectAndHighlight(hash,n);
530 }
531 }
532 }
533 } else {
534 selectAndHighlight(hash);
535 }
536}
537
538function removeToInsertLater(element) {
539 var parentNode = element.parentNode;
540 var nextSibling = element.nextSibling;
541 parentNode.removeChild(element);
542 return function() {
543 if (nextSibling) {
544 parentNode.insertBefore(element, nextSibling);
545 } else {
546 parentNode.appendChild(element);
547 }
548 };
549}
550
551function getNode(o, po)
552{
553 var insertFunction = removeToInsertLater(po.li);
554 po.childrenVisited = true;
555 var l = po.childrenData.length-1;
556 for (var i in po.childrenData) {
557 var nodeData = po.childrenData[i];
558 po.children[i] = newNode(o, po, nodeData[0], nodeData[1], nodeData[2],
559 i==l);
560 }
561 insertFunction();
562}
563
564function gotoNode(o,subIndex,root,hash,relpath)
565{
566 var nti = navTreeSubIndices[subIndex][root+hash];
567 o.breadcrumbs = $.extend(true, [], nti ? nti : navTreeSubIndices[subIndex][root]);
568 if (!o.breadcrumbs && root!=NAVTREE[0][1]) { // fallback: show index
569 navTo(o,NAVTREE[0][1],"",relpath);
570 $('.item').removeClass('selected');
571 $('.item').removeAttr('id');
572 }
573 if (o.breadcrumbs) {
574 o.breadcrumbs.unshift(0); // add 0 for root node
575 showNode(o, o.node, 0, hash);
576 }
577}
578
579function navTo(o,root,hash,relpath)
580{
581 var link = cachedLink();
582 if (link) {
583 var parts = link.split('#');
584 root = parts[0];
585 if (parts.length>1) hash = '#'+parts[1].replace(/[^\w\-]/g,'');
586 else hash='';
587 }
588 if (hash.match(/^#l\d+$/)) {
589 var anchor=$('a[name='+hash.substring(1)+']');
590 glowEffect(anchor.parent(),1000); // line number
591 hash=''; // strip line number anchors
592 }
593 var url=root+hash;
594 var i=-1;
595 while (NAVTREEINDEX[i+1]<=url) i++;
596 if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index
597 if (navTreeSubIndices[i]) {
598 gotoNode(o,i,root,hash,relpath)
599 } else {
600 getScript(relpath+'navtreeindex'+i,function(){
601 navTreeSubIndices[i] = eval('NAVTREEINDEX'+i);
602 if (navTreeSubIndices[i]) {
603 gotoNode(o,i,root,hash,relpath);
604 }
605 },true);
606 }
607}
608
609function showSyncOff(n,relpath)
610{
611 n.html('<img src="'+relpath+'sync_off.png" title="'+SYNCOFFMSG+'"/>');
612}
613
614function showSyncOn(n,relpath)
615{
616 n.html('<img src="'+relpath+'sync_on.png" title="'+SYNCONMSG+'"/>');
617}
618
619function toggleSyncButton(relpath)
620{
621 var navSync = $('#nav-sync');
622 if (navSync.hasClass('sync')) {
623 navSync.removeClass('sync');
624 showSyncOff(navSync,relpath);
625 storeLink(stripPath2(pathName())+hashUrl());
626 } else {
627 navSync.addClass('sync');
628 showSyncOn(navSync,relpath);
629 deleteLink();
630 }
631}
632
633function initNavTree(toroot,relpath)
634{
635 var o = new Object();
636 o.toroot = toroot;
637 o.node = new Object();
638 o.node.li = document.getElementById("nav-tree-contents");
639 o.node.childrenData = NAVTREE;
640 o.node.children = new Array();
641 o.node.childrenUL = document.createElement("ul");
642 o.node.getChildrenUL = function() { return o.node.childrenUL; };
643 o.node.li.appendChild(o.node.childrenUL);
644 o.node.depth = 0;
645 o.node.relpath = relpath;
646 o.node.expanded = false;
647 o.node.isLast = true;
648 o.node.plus_img = document.createElement("img");
649 o.node.plus_img.src = relpath+"ftv2pnode.png";
650 o.node.plus_img.width = 16;
651 o.node.plus_img.height = 22;
652
653 if (localStorageSupported()) {
654 var navSync = $('#nav-sync');
655 if (cachedLink()) {
656 showSyncOff(navSync,relpath);
657 navSync.removeClass('sync');
658 } else {
659 showSyncOn(navSync,relpath);
660 }
661 navSync.click(function(){ toggleSyncButton(relpath); });
662 }
663
664 $(window).load(function(){
665 navTo(o,toroot,hashUrl(),relpath);
666 showRoot();
667 });
668
669 $(window).bind('hashchange', function(){
670 if (window.location.hash && window.location.hash.length>1){
671 var a;
672 if ($(location).attr('hash')){
673 var clslink=stripPath(pathName())+':'+hashValue();
674 a=$('.item a[class$="'+clslink.replace(/</g,'\\3c ')+'"]');
675 }
676 if (a==null || !$(a).parent().parent().hasClass('selected')){
677 $('.item').removeClass('selected');
678 $('.item').removeAttr('id');
679 }
680 var link=stripPath2(pathName());
681 navTo(o,link,hashUrl(),relpath);
682 } else if (!animationInProgress) {
683 $('#doc-content').scrollTop(0);
684 $('.item').removeClass('selected');
685 $('.item').removeAttr('id');
686 navTo(o,toroot,hashUrl(),relpath);
687 }
688 })
689}
690