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/globe.js | 20 ++++++++++---------- js/mapspecs.js | 17 +++++++++-------- js/scores.js | 2 +- 3 files changed, 20 insertions(+), 19 deletions(-) (limited to 'js') diff --git a/js/globe.js b/js/globe.js index 7fcd6a7..2c6f088 100644 --- a/js/globe.js +++ b/js/globe.js @@ -1,5 +1,5 @@ -// !! Remember to preload images +// TODO: Remember to preload images function showSignin() { @@ -15,15 +15,15 @@ function showSignin() { } -var signinDiv = '
-

Sign in

-
-

Do you have an account here?

- Sign in with Google - Sign in with Yahoo - Learn more about OpenID -
-
'; +var signinDiv = '
' + +'

Sign in

' + +'
' + +'

Do you have an account here?

' + +' Sign in with Google' + +' Sign in with Yahoo' + +' Learn more about OpenID' + +'
' + +'
'; 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"; p = p+ ""; - // !! Don't forget to make sure these images are cached; + // TODO: Don't forget to make sure these images are cached; if (u.medal == 'gold') { p = p+ ""; } else if (u.medal == 'silver') { -- cgit v1.2.3