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