home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 February / PCWorld_2008-02_cd.bin / komunikace / maxthon / mx_2.0.7.1245.exe / template / ConfigWizard / maxConfigWizard.js < prev   
Text File  |  2007-12-20  |  2KB  |  84 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.showPage=function(_1){
  10. if(_1<0||_1>(maxConfigWizard.pages.length-1)){
  11. return;
  12. }
  13. var _2=maxConfig.ui.buildItems(maxConfigWizard.pages[_1].items);
  14. _2+="<br/><br/>";
  15. var _3=$id("contentWrapper");
  16. _3.innerHTML=_2;
  17. var _4=$id("btnPrevious");
  18. if(_1==0){
  19. _4.style.color="#A89B80";
  20. }else{
  21. _4.style.color="";
  22. }
  23. var _5=$id("btnNext");
  24. if(_1==(maxConfigWizard.pages.length-1)){
  25. _5.style.color="#A89B80";
  26. }else{
  27. _5.style.color="";
  28. }
  29. var _5=$id("btnNext");
  30. var _6=$id("btnFinish");
  31. maxConfigWizard.activePage=_1;
  32. try{
  33. maxConfigWizard.pages[_1].init();
  34. }
  35. catch(e){
  36. if(!((e.number&65535)==438)){
  37. alert("maxConfigWizard.pages["+_1+"].init()\n"+(e.number&65535)+" : "+e.message);
  38. throw (e);
  39. }
  40. }
  41. };
  42. maxConfigWizard.nextPage=function(){
  43. maxConfigWizard.showPage(maxConfigWizard.activePage+1);
  44. };
  45. maxConfigWizard.previousPage=function(){
  46. maxConfigWizard.showPage(maxConfigWizard.activePage-1);
  47. };
  48. maxConfigWizard.setSkin=function(_7){
  49. if(_7){
  50. external.max_invoke("ChangeStyle","custom");
  51. }else{
  52. external.max_invoke("ChangeStyle","system");
  53. }
  54. };
  55. maxConfigWizard.setLayout=function(id){
  56. try{
  57. external.max_invoke("BackupLayout");
  58. external.max_invoke("ChangeLayout",id);
  59. if(!confirm($lang("keep_layout"))){
  60. external.max_invoke("RestoreLayout");
  61. window.event.returnValue=false;
  62. }
  63. }
  64. catch(e){
  65. alert(e.description);
  66. }
  67. };
  68. maxConfigWizard.setAdhunter=function(_9){
  69. maxConfig.ini.setValue("AdHunter","PopupBlocker","0");
  70. maxConfig.ini.setValue("AdHunter","ContentBlocker","0");
  71. maxConfig.ini.setValue("AdHunter","UseTextFilter","0");
  72. if(_9>2){
  73. maxConfig.ini.setValue("AdHunter","UseTextFilter","1");
  74. }
  75. if(_9>1){
  76. maxConfig.ini.setValue("AdHunter","ContentBlocker","1");
  77. }
  78. if(_9>0){
  79. maxConfig.ini.setValue("AdHunter","PopupBlocker","1");
  80. }
  81. maxConfig.save();
  82. };
  83.  
  84.