wxwidgets.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*****************************************************************************
  2. ** Name: wxwidgets.js
  3. ** Purpose: The wxWidgets documentation javascript
  4. ** Author: Doxygen team
  5. ** Licence: wxWindows licence
  6. *****************************************************************************/
  7. // from w3schools
  8. function getCookie(c_name)
  9. {
  10. if (document.cookie.length>0)
  11. {
  12. c_start=document.cookie.indexOf(c_name + "=");
  13. if (c_start!=-1)
  14. {
  15. c_start=c_start + c_name.length+1;
  16. c_end=document.cookie.indexOf(";",c_start);
  17. if (c_end==-1) c_end=document.cookie.length;
  18. return unescape(document.cookie.substring(c_start,c_end));
  19. }
  20. }
  21. return "";
  22. }
  23. // from w3schools
  24. function setCookie(c_name,value,expiredays)
  25. {
  26. var exdate=new Date();
  27. exdate.setDate(exdate.getDate()+expiredays);
  28. document.cookie=c_name+ '=' +escape(value)+
  29. ((expiredays==null) ? '' : ';expires='+exdate.toGMTString());
  30. }
  31. $(function() {
  32. var display = getCookie('sectionDiv.style.display');
  33. if ( display == '' || display == 'block' ) {
  34. $('div.dynheader').each(function() { toggleVisibility(this); });
  35. setCookie('sectionDiv.style.display', 'block');
  36. }
  37. $('div.dynheader').click(function() {
  38. var display = $('#' + $(this).attr('id') + '-content').css('display');
  39. setCookie('sectionDiv.style.display', display);
  40. });
  41. });