diff options
Diffstat (limited to 'js/mapspecs.js')
-rw-r--r-- | js/mapspecs.js | 27 |
1 files changed, 24 insertions, 3 deletions
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
|