summaryrefslogtreecommitdiffstats
path: root/pages/scores.php
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2013-02-18 00:01:58 -0800
committerPatrick Davison <snapwilliam@gmail.com>2013-02-18 00:01:58 -0800
commit05b682c22f2dadf483b8a2842b4065acc34872af (patch)
tree0de82671aba61f80a21b8d491404e84f765061a1 /pages/scores.php
parent0c2b5f0ac59d6a0b6a317bae4adadb50c5dd899d (diff)
downloadpathery-05b682c22f2dadf483b8a2842b4065acc34872af.tar.xz
Active/Inactive maps shown in scoreboard.
Diffstat (limited to 'pages/scores.php')
-rw-r--r--pages/scores.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/pages/scores.php b/pages/scores.php
index f995e62..933873c 100644
--- a/pages/scores.php
+++ b/pages/scores.php
@@ -99,7 +99,7 @@ var pointerDate;
function getMapIDs(request) {
switch (request) {
case "next":
- if (pointerTime.getTime() + (24*60*60*1000) > serverTime.getTime()) {
+ if (pointerTime.getTime() > serverTime.getTime()) {
alert("Tomorrow hasn't happened yet. Alerts are bad. - TMP!");
return;
}
@@ -170,14 +170,17 @@ function addMapToNav(mapID) {
$("#mapNavigation").append($newdiv1);
+ //var URLString = 'map/'+mapID+'.js';
+ var URLString = 'map/'+mapID;
+
$.ajax({
type: "GET",
- url: 'map/'+mapID,
+ url: URLString,
cache: true,
data: '',
fail: function() { alert("error"); },
complete: function(data) {
- $("#thumb_"+mapID).html(mapThumbnailHTML(decryptJSON(data.responseText), 100)).show('slow');
+ $("#thumb_"+mapID).html(mapThumbnailHTML(decryptJSON(data.responseText), 120)).show();
}
});
mapsInNav.push(mapID);
@@ -200,7 +203,7 @@ var Tile = {"Wall" : "w",
"SinglePath" : "o"};
function mapThumbnailHTML(map, targetWidth) {
- if (!targetWidth) targetWidth = 100;
+ if (!targetWidth) targetWidth = 120;
var scale = map.width / targetWidth;
var width = parseInt(map.width / scale);
@@ -208,15 +211,17 @@ function mapThumbnailHTML(map, targetWidth) {
var tileWidth = parseInt(width / map.width);
width = tileWidth * map.width;
+ height = tileWidth * map.height;
var mapgrid = '';
var mapClass = '';
var toolTip = 'Inactive map';
- var mapDate = new Date(map.dateExpires + " PST");
+ var mapDate = new Date(map.dateExpires*1000);
+ console.log("Dates: ", map.ID, mapDate, serverTime);
if (mapDate.getTime() > serverTime.getTime()) {
mapClass = ' current';
- toolTip = 'Active map';
+ toolTip = 'This map can still be played.';
}
var r = '';