From 1c65a1a164008e993fba099723fc3039c2332a9c Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Wed, 20 Feb 2013 02:05:02 -0800 Subject: Restyled and fixed some bugs in the scoreboard. --- js/mapspecs.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/mapspecs.js b/js/mapspecs.js index 6bf7185..2a5bd1d 100644 --- a/js/mapspecs.js +++ b/js/mapspecs.js @@ -307,6 +307,7 @@ function request_path_done() { } function decryptJSON(text) { + if (typeof(text) == 'undefined') return false; var JO; if (typeof(JSON) == 'undefined') { JO = !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/"(\\.|[^"\\])*"/g, ''))) && eval('(' + text + ')'); @@ -772,6 +773,8 @@ function showTempSolution(mapid, tempSolution, moves, tempWallColor, tempWallEmb //console.log('showTempSolution', mapid, solution, moves, tempWallColor, tempWallEmblem); var savedSolution = ''; + if (typeof tempSolution == 'undefined') tempSolution = ''; + if (typeof solution[mapid] !== 'undefined') { savedSolution = solution[mapid]; } @@ -817,7 +820,6 @@ function displayMap(mapid, divID, goalSize, solution, moves, challengeMap) { restoreSolution(mapid); } }); - console.log("dispMapExt"); } //Map as object. If target width is NULL or False, default width is used. @@ -829,7 +831,7 @@ function mapAsHTML(map, targetWidth, demo) { //console.log("MapObj", map); mapdata[map.ID] = map; - //595 + if ((map.width * 35) <= targetWidth) targetWidth = (map.width * 35); if (!targetWidth) targetWidth = (map.width * 35); var scale = map.width / targetWidth; //alert(scale); -- cgit v1.2.3