diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2013-02-17 03:06:24 -0800 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2013-02-17 03:06:24 -0800 |
commit | e6ecd5ae507731050d7281f2a2a192849f41912b (patch) | |
tree | 07956b8f2725935dd5fd6078a1c2f95d64bf5b40 /js/mapspecs.js | |
parent | aecf8ced62fd1e8594239566d62f5cc71e8fd27c (diff) | |
download | pathery-e6ecd5ae507731050d7281f2a2a192849f41912b.tar.xz |
Now using Jquery everywhere.
Moved displayMap to mapSpecs.
Using displayMap @ Home.
Cleaned up scores page.
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
|