summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/mapspecs.js27
-rw-r--r--js/scores.js3
2 files changed, 25 insertions, 5 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
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 = "<table class='score'>";
- console.log("jo object", JO);
+ //console.log("jo object", JO);
var navi = '';
if (JO.pageCount > 1) {
navi = "<tr><th colspan='3' style='text-align:center;'>"+formatPageNavi(JO, "scoresShowPage", JO.mapid)+"</th></tr>";