diff --git a/xtrn/doorscan/doorscan.js b/xtrn/doorscan/doorscan.js index d72452fc81ee762481899e322cf1502a19f071fa..33916c6f983c9570c8c48e60d17cc4e05cf965c5 100644 --- a/xtrn/doorscan/doorscan.js +++ b/xtrn/doorscan/doorscan.js @@ -153,30 +153,30 @@ function Display_LORD(filename) case 'r': ch=txt.charAt(++i); switch(ch) { - case '0': - console.attributes=BG_BLACK; - break; - case '1': - console.attributes=BG_BLUE; - break; - case '2': - console.attributes=BG_GREEN; - break; - case '3': - console.attributes=BG_CYAN; - break; - case '4': - console.attributes=BG_RED; - break; - case '5': - console.attributes=BG_MAGENTA; - break; - case '6': - console.attributes=BG_BROWN; - break; - case '7': - console.attributes=BG_LIGHTGRAY; - break; + case '0': + console.attributes=BG_BLACK; + break; + case '1': + console.attributes=BG_BLUE; + break; + case '2': + console.attributes=BG_GREEN; + break; + case '3': + console.attributes=BG_CYAN; + break; + case '4': + console.attributes=BG_RED; + break; + case '5': + console.attributes=BG_MAGENTA; + break; + case '6': + console.attributes=BG_BROWN; + break; + case '7': + console.attributes=BG_LIGHTGRAY; + break; } break; case 'c': @@ -554,7 +554,7 @@ function UserConfig_configure_sec(dcfg, sec) r=ascii('N'); } console.uselect(index.length,"External News Scores Run Count" - ,format("%-40s %c %c %c",xtrn_area.prog[door].name,n,s,r)); + ,format("%-40s %c %c %c",xtrn_area.prog[door].name,n,s,r)); } if(!index.length) return; @@ -582,8 +582,8 @@ function UserConfig_configure_sec(dcfg, sec) else this.door[index[xprog-1]].skipRunCount=!console.yesno("Show run counts"); if(this.door[index[xprog-1]].skipRunCount - && this.door[index[xprog-1]].skipScore - && this.door[index[xprog-1]].skipNews) + && this.door[index[xprog-1]].skipScore + && this.door[index[xprog-1]].skipNews) delete this.door[index[xprog-1]]; } } @@ -794,7 +794,7 @@ function sysop_get_newstype(dflt) if(i < 1 || i > index.length) return(dflt); return(index[i-1]); - + } function sysop_get_scorestype(dflt) @@ -905,7 +905,7 @@ function sysop_config_skip(dcfg) for(sec in xtrn_area.sec) { index.push(sec); console.uselect(index.length, "External Program Section", - format("%-40s %s",xtrn_area.sec[sec].name + format("%-40s %s",xtrn_area.sec[sec].name ,(dcfg.skipSection[sec] != undefined && dcfg.skipSection[sec])?"Skip":"Include")); } if(index.length==0) @@ -970,7 +970,7 @@ function runXtrn(xtrn) ucfg.save(); if(!(dcfg.door[xtrn]!=undefined && dcfg.door[xtrn].skip != undefined && dcfg.door[xtrn].skip) - || !(dcfg.skipSection[xtrn_area.prog[xtrn].sec_code]!=undefined && dcfg.skipSection[xtrn_area.prog[xtrn].sec_code])) { + || !(dcfg.skipSection[xtrn_area.prog[xtrn].sec_code]!=undefined && dcfg.skipSection[xtrn_area.prog[xtrn].sec_code])) { bbs.log_str("DOORSCAN - "+xtrn+" starting @ "+now.toString()+"\r\n"); } @@ -980,7 +980,7 @@ function runXtrn(xtrn) dcfg=new DoorConfig(true); if(!(dcfg.door[xtrn]!=undefined && dcfg.door[xtrn].skip != undefined && dcfg.door[xtrn].skip) - && !(dcfg.skipSection[xtrn_area.prog[xtrn].sec_code]!=undefined && dcfg.skipSection[xtrn_area.prog[xtrn].sec_code])) { + && !(dcfg.skipSection[xtrn_area.prog[xtrn].sec_code]!=undefined && dcfg.skipSection[xtrn_area.prog[xtrn].sec_code])) { bbs.log_str("DOORSCAN - "+xtrn+" ending @ "+now.toString()+"\r\n"); } @@ -998,7 +998,7 @@ function runXtrn(xtrn) function runPre(xtrn) { - if(xtrn_area.prog[xtrn]==undefined) + if(xtrn_area.prog[xtrn]===undefined) throw("Unknown external: "+xtrn); if(!xtrn_area.prog[xtrn].can_run) throw("User "+user.name+" is not allowed to run "+xtrn); @@ -1011,19 +1011,19 @@ function runPre(xtrn) dcfg.save(); var ucfg=new UserConfig(user.number, true); - if(ucfg.door[xtrn] == undefined) { - if(ucfg.global == undefined || (!ucfg.global.noAutoScan)) { + if(ucfg.door[xtrn] === undefined) { + if(ucfg.global === undefined || (!ucfg.global.noAutoScan)) { ucfg.addxtrn(xtrn); } } - if(ucfg.door[xtrn] != undefined) + if(ucfg.door[xtrn] !== undefined) ucfg.door[xtrn].lastRan=now; ucfg.save(); - if(!(dcfg.door[xtrn]!=undefined && dcfg.door[xtrn].skip != undefined && dcfg.door[xtrn].skip) - || !(dcfg.skipSection[xtrn_area.prog[xtrn].sec_code]!=undefined && dcfg.skipSection[xtrn_area.prog[xtrn].sec_code])) { + if(!(dcfg.door[xtrn]!==undefined && dcfg.door[xtrn].skip !== undefined && dcfg.door[xtrn].skip) + || !(dcfg.skipSection[xtrn_area.prog[xtrn].sec_code]!==undefined && dcfg.skipSection[xtrn_area.prog[xtrn].sec_code])) { bbs.log_str("DOORSCAN - "+xtrn+" starting @ "+now.toString()+"\r\n"); } } @@ -1033,8 +1033,8 @@ function runPost(xtrn) now=new Date(); dcfg=new DoorConfig(true); - if(!(dcfg.door[xtrn]!=undefined && dcfg.door[xtrn].skip != undefined && dcfg.door[xtrn].skip) - && !(dcfg.skipSection[xtrn_area.prog[xtrn].sec_code]!=undefined && dcfg.skipSection[xtrn_area.prog[xtrn].sec_code])) { + if(!(dcfg.door[xtrn]!==undefined && dcfg.door[xtrn].skip !== undefined && dcfg.door[xtrn].skip) + && !(dcfg.skipSection[xtrn_area.prog[xtrn].sec_code]!==undefined && dcfg.skipSection[xtrn_area.prog[xtrn].sec_code])) { bbs.log_str("DOORSCAN - "+xtrn+" ending @ "+now.toString()+"\r\n"); } @@ -1042,7 +1042,7 @@ function runPost(xtrn) dcfg.save(); ucfg=new UserConfig(user.number, true); - if(ucfg.door[xtrn] != undefined) { + if(ucfg.door[xtrn] !== undefined) { ucfg.door[xtrn].lastExit=now; ucfg.door[xtrn].lastRunCount=dcfg.door[xtrn].runCount; } @@ -1072,7 +1072,7 @@ function doScan() continue; if(dcfg.door[door].installed > ucfg.global.lastScan) { /* This door is NEW! */ - + /* If the user can't run it, don't display it. */ if(!xtrn_area.prog[door].can_run) continue; @@ -1131,7 +1131,7 @@ function doScan() * If the news file has not been updated, don't bother * Some doors only update the news during maintenance */ - + if(new Date(file_date(dcfg.door[door].news)*1000) >= scantime) { /* Assume ANSI */ if(dcfg.door[door].newsType==undefined) @@ -1152,7 +1152,7 @@ function doScan() * If the Scores file has not been updated, don't bother * Some doors only update the Scores during maintenance */ - + if(new Date(file_date(dcfg.door[door].score)*1000) >= scantime) { /* Assume ANSI */ if(dcfg.door[door].scoreType==undefined) @@ -1209,14 +1209,14 @@ for(i in argv) { doScan(); break; case 'pre': - runPre(argv[i+1].toLowerCase()); + runPre(argv[++i].toLowerCase()); break; case 'post': - runPost(argv[i+1].toLowerCase()); - break; + runPost(argv[++i].toLowerCase()); + break; case 'run': // deprecated - runXtrn(argv[i+1].toLowerCase()); + runXtrn(argv[++i].toLowerCase()); break; case 'config': new UserConfig(user.number).configure(); @@ -1227,7 +1227,7 @@ for(i in argv) { case 'rank': // TODO: Door popularity rankings break; - default: - break; + default: + break; } }