]> git.saurik.com Git - wxWidgets.git/blob - docs/doxygen/wxwidgets.js
interface revisions
[wxWidgets.git] / docs / doxygen / wxwidgets.js
1 // from w3schools
2 function getCookie(c_name)
3 {
4 if (document.cookie.length>0)
5 {
6 c_start=document.cookie.indexOf(c_name + "=");
7 if (c_start!=-1)
8 {
9 c_start=c_start + c_name.length+1;
10 c_end=document.cookie.indexOf(";",c_start);
11 if (c_end==-1) c_end=document.cookie.length;
12 return unescape(document.cookie.substring(c_start,c_end));
13 }
14 }
15 return "";
16 }
17 // from w3schools
18 function setCookie(c_name,value,expiredays)
19 {
20 var exdate=new Date();
21 exdate.setDate(exdate.getDate()+expiredays);
22 document.cookie=c_name+ '=' +escape(value)+
23 ((expiredays==null) ? '' : ';expires='+exdate.toGMTString());
24 }
25
26 // Reimplementation of changeDisplayState
27 function mychangeDisplayState( e )
28 {
29 var num=this.id.replace(/[^[0-9]/g,'');
30 var button=this.firstChild;
31 var sectionDiv=document.getElementById('dynsection'+num);
32 if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
33 sectionDiv.style.display='block';
34 button.src='open.gif';
35 }else{
36 sectionDiv.style.display='none';
37 button.src='closed.gif';
38 }
39
40 setCookie( 'sectionDiv.style.display', sectionDiv.style.display );
41
42 }
43
44 window.onload = function myinitDynSections()
45 {
46 var divs=document.getElementsByTagName('div');
47 var sectionCounter=1;
48 for(var i=0;i<divs.length-1;i++){
49 if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
50 var header=divs[i];
51 var section=divs[i+1];
52 var button=header.firstChild;
53 if (button!='IMG'){
54 divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
55 button=document.createElement('img');
56 divs[i].insertBefore(button,divs[i].firstChild);
57 }
58 header.style.cursor='pointer';
59 header.onclick=mychangeDisplayState;
60 header.id='dynheader'+sectionCounter;
61 button.src='closed.gif';
62 section.id='dynsection'+sectionCounter;
63
64 var display = getCookie( 'sectionDiv.style.display' );
65 if ( display == '' ){
66 section.style.display='block'; // default
67 }else{
68 section.style.display=display;
69 }
70 setCookie( 'sectionDiv.style.display', section.style.display );
71
72 section.style.marginLeft='14px';
73 sectionCounter++;
74 }
75 }
76 }