home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 May / PCWorld_2008-05_cd.bin / komunikace / maxthon / mx_2.0.9.1640.exe / template / ConfigWizard / maxConfigWizard.js < prev   
Text File  |  2008-01-28  |  2KB  |  87 lines

  1. var maxConfigWizard={};
  2. maxConfigWizard.activePage=0;
  3. $langDefaultSection="ConfigWizard";
  4. maxConfigWizard.init=function(){
  5. document.title=$lang("title");
  6. maxConfig.setActiveFile("$main",true);
  7. maxConfigWizard.showPage(0);
  8. };
  9. maxConfigWizard.close=function(){
  10. external.max_closeTab(max_security_id);
  11. };
  12. maxConfigWizard.showPage=function(_1){
  13. if(_1<0||_1>(maxConfigWizard.pages.length-1)){
  14. return;
  15. }
  16. var _2=maxConfig.ui.buildItems(maxConfigWizard.pages[_1].items);
  17. _2+="<br/><br/>";
  18. var _3=$id("contentWrapper");
  19. _3.innerHTML=_2;
  20. var _4=$id("btnPrevious");
  21. if(_1==0){
  22. _4.style.color="#A89B80";
  23. }else{
  24. _4.style.color="";
  25. }
  26. var _5=$id("btnNext");
  27. if(_1==(maxConfigWizard.pages.length-1)){
  28. _5.style.color="#A89B80";
  29. }else{
  30. _5.style.color="";
  31. }
  32. var _5=$id("btnNext");
  33. var _6=$id("btnFinish");
  34. maxConfigWizard.activePage=_1;
  35. try{
  36. maxConfigWizard.pages[_1].init();
  37. }
  38. catch(e){
  39. if(!((e.number&65535)==438)){
  40. alert("maxConfigWizard.pages["+_1+"].init()\n"+(e.number&65535)+" : "+e.message);
  41. throw (e);
  42. }
  43. }
  44. };
  45. maxConfigWizard.nextPage=function(){
  46. maxConfigWizard.showPage(maxConfigWizard.activePage+1);
  47. };
  48. maxConfigWizard.previousPage=function(){
  49. maxConfigWizard.showPage(maxConfigWizard.activePage-1);
  50. };
  51. maxConfigWizard.setSkin=function(_7){
  52. if(_7){
  53. external.max_invoke("ChangeStyle","custom");
  54. }else{
  55. external.max_invoke("ChangeStyle","system");
  56. }
  57. };
  58. maxConfigWizard.setLayout=function(id){
  59. try{
  60. external.max_invoke("BackupLayout");
  61. external.max_invoke("ChangeLayout",id);
  62. if(!confirm($lang("keep_layout"))){
  63. external.max_invoke("RestoreLayout");
  64. window.event.returnValue=false;
  65. }
  66. }
  67. catch(e){
  68. alert(e.description);
  69. }
  70. };
  71. maxConfigWizard.setAdhunter=function(_9){
  72. maxConfig.ini.setValue("AdHunter","PopupBlocker","0");
  73. maxConfig.ini.setValue("AdHunter","ContentBlocker","0");
  74. maxConfig.ini.setValue("AdHunter","UseTextFilter","0");
  75. if(_9>2){
  76. maxConfig.ini.setValue("AdHunter","UseTextFilter","1");
  77. }
  78. if(_9>1){
  79. maxConfig.ini.setValue("AdHunter","ContentBlocker","1");
  80. }
  81. if(_9>0){
  82. maxConfig.ini.setValue("AdHunter","PopupBlocker","1");
  83. }
  84. maxConfig.save();
  85. };
  86.  
  87.