home *** CD-ROM | disk | FTP | other *** search
- var maxResumeSession={};
- maxResumeSession.pageList=[];
- maxResumeSession.autoClose=false;
- $langDefaultSection="ResumeSession";
- maxResumeSession.init=function(){
- document.title=$lang("title");
- maxResumeSession.loadAutoClose();
- maxResumeSession.loadPageList();
- maxResumeSession.buildPageList();
- };
- maxResumeSession.loadAutoClose=function(){
- maxConfig.setActiveFile("$main");
- var _1=maxConfig.ini.getValue("Settings","ResumeAutoClose");
- _1=(_1!="1")?false:true;
- maxResumeSession.autoClose=_1;
- var _2=$id("auto_close");
- if(!_2){
- return;
- }
- _2.checked=_1;
- };
- maxResumeSession.toggleAutoClose=function(){
- var _3=$id("auto_close");
- if(_3.checked){
- maxResumeSession.autoClose=true;
- }else{
- maxResumeSession.autoClose=false;
- }
- maxConfig.setActiveFile("$main");
- maxConfig.ini.setValue("Settings","ResumeAutoClose",maxResumeSession.autoClose?"1":"0");
- maxConfig.save();
- };
- maxResumeSession.loadPageList=function(){
- maxConfig.setActiveFile("$dynamic");
- var _4=maxConfig.ini.getArray("LastURL",false);
- maxConfig.ini.deleteSection("LastURL");
- for(var i=0;i<_4.length;i++){
- var _6={};
- _6.id="pageItem"+i;
- _6.title=_4[i][1];
- _6.url=_4[i][0];
- _6.enabled=true;
- _4[i]=_6;
- }
- maxResumeSession.pageList=_4;
- };
- maxResumeSession.buildPageList=function(){
- var _7=$id("pageList");
- if(!_7){
- alert("maxResumeSession.buildList : can not get obj 'pageList'");
- }
- var _8="";
- for(var i=0;i<maxResumeSession.pageList.length;i++){
- var _a=maxResumeSession.pageList[i];
- _8+="<div class=\"pageList-item\">"+"<img src=\"../_shared/images/btn_check_checked.png\" id=\"check_"+_a.id+"\" class=\"checkButton\" onclick=\"maxResumeSession.togglePageItem('"+_a.id+"');\" />"+" "+"<a id=\""+_a.id+"\" href=\"javascript:maxResumeSession.openPageLink('"+_a.id+"');\" title=\""+_a.url.$encodeHTML()+"\">"+_a.title.$cut(100).$encodeHTML()+"</a>"+"</div>";
- }
- _7.innerHTML=_8;
- };
- maxResumeSession.getPageItem=function(id){
- for(var i=0;i<maxResumeSession.pageList.length;i++){
- if(maxResumeSession.pageList[i].id==id){
- return maxResumeSession.pageList[i];
- }
- }
- return null;
- };
- maxResumeSession.togglePageItem=function(id){
- var _e=maxResumeSession.getPageItem(id);
- if(_e==null){
- alert("maxResumeSession.togglePageItem : invalid id "+id);
- return;
- }
- _e.enabled=!_e.enabled;
- maxResumeSession.updatePageItemCheck(_e);
- };
- maxResumeSession.updatePageItemCheck=function(_f){
- var _10=$id("check_"+_f.id);
- if(!_10){
- alert("maxResumeSession.updatePageItemCheck : invalid id "+id);
- return;
- }
- if(_f.enabled){
- _10.src="../_shared/images/btn_check_checked.png";
- }else{
- _10.src="../_shared/images/btn_check.png";
- }
- };
- maxResumeSession.selectPages=function(_11){
- for(var i=0;i<maxResumeSession.pageList.length;i++){
- var _13=maxResumeSession.pageList[i];
- if(_11==1){
- _13.enabled=true;
- }else{
- if(_11==0){
- _13.enabled=false;
- }else{
- _13.enabled=!_13.enabled;
- }
- }
- maxResumeSession.updatePageItemCheck(_13);
- }
- };
- maxResumeSession.openPage=function(_14){
- try{
- external.max_newTab(max_security_id,_14.url);
- }
- catch(e){
- window.open(_14.url);
- }
- maxResumeSession.updatePageItemStatus(_14);
- };
- maxResumeSession.updatePageItemStatus=function(_15){
- var _16=$id(_15.id);
- if(!_16){
- alert("maxResumeSession.updatePageItemStatus : invalid id "+_15.id);
- return;
- }
- _16.className="openedPageLink";
- };
- maxResumeSession.openPageLink=function(id){
- var _18=maxResumeSession.getPageItem(id);
- if(_18==null){
- alert("maxResumeSession.togglePageItem : invalid id "+id);
- return;
- }
- _18.enabled=false;
- maxResumeSession.updatePageItemCheck(_18);
- maxResumeSession.openPage(_18);
- };
- maxResumeSession.openPages=function(){
- for(var i=maxResumeSession.pageList.length-1;i>-1;i--){
- if(maxResumeSession.pageList[i].enabled){
- maxResumeSession.openPage(maxResumeSession.pageList[i]);
- }
- }
- if(maxResumeSession.autoClose){
- window.close();
- }
- };
-
-