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