summaryrefslogtreecommitdiffstats
path: root/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
parent73d12dd8c33eb6ebeee4143707cb59f701936945 (diff)
downloadpathery-8e639fd6cccecb3f23f727ef1f00f7e9851ea04e.tar.xz
Fixing various javascript warnings, as well as renaming all //!! comments to //TODO
Diffstat (limited to 'js')
-rw-r--r--js/globe.js20
-rw-r--r--js/mapspecs.js17
-rw-r--r--js/scores.js2
3 files changed, 20 insertions, 19 deletions
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 = '<div class="wrapper" id="oid_wrapper" >
-<h2>Sign in</h2>
- <div id="oid_box">
- <h2 style="color:#333;">Do you have an account here?</h2>
- <a href="#"><img id="oid_btn" src="images/btns/signin_Google.png" alt="Sign in with Google" /></a>
- <a href="#"><img id="oid_btn" src="images/btns/signin_Yahoo.png" alt="Sign in with Yahoo" /></a>
- <a href="http://openid.net/get-an-openid/what-is-openid/" style="position:absolute;color:#333;left:10px;bottom:10px;">Learn more about OpenID</a>
- </div>
-</div>';
+var signinDiv = '<div class="wrapper" id="oid_wrapper" >' +
+'<h2>Sign in</h2>' +
+' <div id="oid_box">' +
+' <h2 style="color:#333;">Do you have an account here?</h2>' +
+' <a href="#"><img id="oid_btn" src="images/btns/signin_Google.png" alt="Sign in with Google" /></a>' +
+' <a href="#"><img id="oid_btn" src="images/btns/signin_Yahoo.png" alt="Sign in with Yahoo" /></a>' +
+' <a href="http://openid.net/get-an-openid/what-is-openid/" style="position:absolute;color:#333;left:10px;bottom:10px;">Learn more about OpenID</a>' +
+' </div>' +
+'</div>';
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 "";
}
diff --git a/js/scores.js b/js/scores.js
index 5acc36c..a75d77a 100644
--- a/js/scores.js
+++ b/js/scores.js
@@ -133,7 +133,7 @@ function scoresFormatPage(JO) {
p = p+ "<tr style='"+styleClass+" background-color: "+u.background+"; color:"+u.displayColor+";' title='Scored "+scoredLocalTime.format("h:MM:ss TT")+"'>";
p = p+ "<td style='text-align:left;'>";
- // !! 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+ "<img title='Current Champion' src='../images/MedalGoldCAR.png' style='width:32px;height:32px;vertical-align:middle'>";
} else if (u.medal == 'silver') {