From e6ecd5ae507731050d7281f2a2a192849f41912b Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Sun, 17 Feb 2013 03:06:24 -0800 Subject: Now using Jquery everywhere. Moved displayMap to mapSpecs. Using displayMap @ Home. Cleaned up scores page. --- js/mapspecs.js | 27 ++++++++++++++++++++++++--- js/scores.js | 3 +-- 2 files changed, 25 insertions(+), 5 deletions(-) (limited to 'js') diff --git a/js/mapspecs.js b/js/mapspecs.js index 3aa123f..6bf7185 100644 --- a/js/mapspecs.js +++ b/js/mapspecs.js @@ -799,13 +799,34 @@ function restoreSolution(mapid) { showTempSolution(mapid, mapdata[mapid].savedSolution, 0, false, false); } +function displayMap(mapid, divID, goalSize, solution, moves, challengeMap) { + + var stringURL = 'map/'+mapid+".js"; + if (challengeMap == true) stringURL = 'challenge/'+mapid+".js"; + $.ajax({ + type: "GET", + url: 'map/'+mapid+".js", + dataType: 'json', + cache: true, + data: '', + //TODO: Better fail option? + fail: (function() { console.log("FAIL Map Download"); }), + complete: function(data) { + $("#"+divID).html(mapAsHTML(decryptJSON(data.responseText), goalSize)).fadeIn('slow'); + mapdata[mapid].savedSolution = solution; + restoreSolution(mapid); + } + }); + console.log("dispMapExt"); +} + //Map as object. If target width is NULL or False, default width is used. function mapAsHTML(map, targetWidth, demo) { - console.log("loading MapHTML for ", map); + //console.log("loading MapHTML for ", map); map.mapid = map.ID; - console.log("MapID:", map.mapid); - console.log("MapObj", map); + //console.log("MapID:", map.mapid); + //console.log("MapObj", map); mapdata[map.ID] = map; //595 diff --git a/js/scores.js b/js/scores.js index 7c97a2d..161f1ae 100644 --- a/js/scores.js +++ b/js/scores.js @@ -108,10 +108,9 @@ function scoresPreparePage (mapid, page) { var scoresShowNavSideBtns = false; function scoresFormatPage(JO) { - // console.log("Formating page"); var p = ""; - console.log("jo object", JO); + //console.log("jo object", JO); var navi = ''; if (JO.pageCount > 1) { navi = ""; -- cgit v1.2.3
"+formatPageNavi(JO, "scoresShowPage", JO.mapid)+"