summaryrefslogtreecommitdiff
path: root/distribution/osx/gtk-bundle/toc.js
blob: 476723672e6429e42618d3fa79735bbb98cc8529 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!-- Start of script to import html into div, toggle TOC button

	// If in HelpViewer activate the TOC display button.
	if ('HelpViewer' in window && 'showTOCButton' in window.HelpViewer) {
		function toggle() {
			var e = document.getElementById('toc');
   		 	if (e.style.display == 'block' || e.style.display=='')
   		 		{
   		    	 e.style.display = 'none';
  		  		}
  		  	else 
   		 		{
  		    	  e.style.display = 'block';
  			  	}  		  	
       	}
       	
		function showTOCButton(state) {
			window.HelpViewer.showTOCButton(state, toggle, toggle);
			window.HelpViewer.setTOCButton(state);
		}
    	window.setTimeout(showTOCButton(true), 1000);
		
	}
    window.onload=function() {
    	function include(a,b){
    		var c="/^(?:file):/"
    		var d=new XMLHttpRequest; 
    		var e=0;
    		try {
    		d.open('GET',b,!0);
    		d.onreadystatechange=function(){			
    			if (4==d.readyState) a.innerHTML=d.responseText;
    			var acc = document.getElementsByClassName("accordion");
				var i;

				for (i = 0; i < acc.length; i++) {
				  acc[i].onclick = function() {
				      var panels = document.getElementsByClassName("accordion");
  					  this.classList.toggle("active");
 				      var panel = this.parentElement.nextElementSibling;			      
 				      if (panel.tagName == "DIV") {
  					 	 if (panel.style.maxHeight){
      						panel.style.maxHeight = null;
    					  } else {
      						panel.style.maxHeight = panel.scrollHeight + "px";
    					  }
    				  } 
                  }
			   }
    		}
 		  	d.send();		   	
 		   	} catch(f){};
 		}
    	
    	var c=document.getElementsByTagName('DIV');
    	var i;
    	for(i = 0; i < c.length; i++) {
				if (c[i].hasAttribute && c[i].hasAttribute('data-include')) {
					include(c[i],c[i].getAttribute('data-include'));
    			};
    	}

	}



// End -->