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