summaryrefslogtreecommitdiffstats
path: root/js/mapspecs.js
diff options
context:
space:
mode:
authorBlueRaja <BlueRaja.admin@gmail.com>2012-08-25 05:43:26 -0500
committerBlueRaja <BlueRaja.admin@gmail.com>2012-08-25 05:43:26 -0500
commit8e639fd6cccecb3f23f727ef1f00f7e9851ea04e (patch)
tree26260fbe93294728d294a5f14fc72bd908013dbd /js/mapspecs.js
parent73d12dd8c33eb6ebeee4143707cb59f701936945 (diff)
downloadpathery-8e639fd6cccecb3f23f727ef1f00f7e9851ea04e.tar.xz
Fixing various javascript warnings, as well as renaming all //!! comments to //TODO
Diffstat (limited to 'js/mapspecs.js')
-rw-r--r--js/mapspecs.js17
1 files changed, 9 insertions, 8 deletions
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<ARRcookies.length;i++)
return unescape(y);
}
}
+ return "";
}