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