summaryrefslogtreecommitdiffstats
path: root/pages/scores.php
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2013-02-17 16:43:25 -0800
committerPatrick Davison <snapwilliam@gmail.com>2013-02-17 16:43:25 -0800
commitd51b87d9a31f5914fe8509e6ac47eace1872d0ba (patch)
tree5221e63d08af6e7b6ec3cd278d691ea65cab259c /pages/scores.php
parente12ea632b28d9a0cba7c002fe37edc42bf291777 (diff)
downloadpathery-d51b87d9a31f5914fe8509e6ac47eace1872d0ba.tar.xz
Active maps now have a different color in the scoreboard.
Diffstat (limited to 'pages/scores.php')
-rw-r--r--pages/scores.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/pages/scores.php b/pages/scores.php
index cf33b49..f995e62 100644
--- a/pages/scores.php
+++ b/pages/scores.php
@@ -200,10 +200,6 @@ var Tile = {"Wall" : "w",
"SinglePath" : "o"};
function mapThumbnailHTML(map, targetWidth) {
- var r = '';
- r += "<div class='mapThumbnail' onclick='displayMapScores("+map.ID+")'>";
- r += map.name;
-
if (!targetWidth) targetWidth = 100;
var scale = map.width / targetWidth;
@@ -215,6 +211,18 @@ function mapThumbnailHTML(map, targetWidth) {
var mapgrid = '';
+ var mapClass = '';
+ var toolTip = 'Inactive map';
+ var mapDate = new Date(map.dateExpires + " PST");
+ if (mapDate.getTime() > serverTime.getTime()) {
+ mapClass = ' current';
+ toolTip = 'Active map';
+ }
+
+ var r = '';
+ r += "<div class='mapThumbnail"+mapClass+"' title='"+toolTip+"'; onclick='displayMapScores("+map.ID+")'>";
+ r += map.name;
+
mapgrid += '<div class="map" style="width:'+width+'px; height:'+height+'px">';
for (var y in map.tiles) {
for (var x in map.tiles[y]) {