From 8e639fd6cccecb3f23f727ef1f00f7e9851ea04e Mon Sep 17 00:00:00 2001 From: BlueRaja Date: Sat, 25 Aug 2012 05:43:26 -0500 Subject: Fixing various javascript warnings, as well as renaming all //!! comments to //TODO --- js/mapspecs.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'js/mapspecs.js') diff --git a/js/mapspecs.js b/js/mapspecs.js index cbb642c..ded7bfc 100644 --- a/js/mapspecs.js +++ b/js/mapspecs.js @@ -136,9 +136,7 @@ function grid_click(obj) { else obj.style.backgroundColor = playerWallColor; - if (typeof playerWallEmblem === 'undefined') - ''; - else + if (typeof playerWallEmblem !== 'undefined') obj.style.backgroundImage="url(images/marks/"+playerWallEmblem+")"; //Add Wall @@ -206,11 +204,12 @@ function requestSol(mapID) { } function requestSolDone() { + var JO; if (typeof(JSON) == 'undefined') { text = ajax.response; - var JO = !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/"(\\.|[^"\\])*"/g, ''))) && eval('(' + text + ')'); + JO = !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/"(\\.|[^"\\])*"/g, ''))) && eval('(' + text + ')'); } else { - var JO = JSON.parse(ajax.response); + JO = JSON.parse(ajax.response); } if (JO.solution == 'undefined') return; @@ -288,7 +287,7 @@ function request_path_done() { mapdata[mapid].restoreTiles = new Array(); mapdata[mapid].pathColor = new Object; - for(var i in JO.path) { + for(i in JO.path) { mapdata[mapid].moveCount[i] = 0; mapdata[mapid].pathColor[i] = '#ffffff'; animatePath(JO.path[i].path, mapid, JO.path[i].start, i); @@ -297,11 +296,12 @@ function request_path_done() { } function decryptJSON(text) { + var JO; if (typeof(JSON) == 'undefined') { - var JO = !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/"(\\.|[^"\\])*"/g, ''))) && eval('(' + text + ')'); + JO = !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/"(\\.|[^"\\])*"/g, ''))) && eval('(' + text + ')'); //mapdata[mapid] = eval(document.getElementById(mapid+',mapdata').innerHTML); } else { - var JO = JSON.parse(ajax.response); + JO = JSON.parse(ajax.response); } return JO; } @@ -792,6 +792,7 @@ for (i=0;i