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