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