From abf2f39753d91baf132a0d93512803096b1299fa Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Thu, 28 Feb 2013 14:42:25 -0800 Subject: Link to a specific solution in scores, and other tweaks. --- pages/scores.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'pages') diff --git a/pages/scores.php b/pages/scores.php index 9443673..70acbaa 100644 --- a/pages/scores.php +++ b/pages/scores.php @@ -49,6 +49,12 @@ function start() { if (typeof(hashParts[1]) !== 'undefined') { pointerMapID = hashParts[1]; } + if (typeof(hashParts[2]) !== 'undefined' && hashParts[2]-0 > 0) { + pointerPage = hashParts[2]; + } else pointerPage = 1; + if (typeof(hashParts[3]) !== 'undefined') { + pointerUserID = hashParts[3]; + } //+1 because i'm gonna use prev. pointerTime = new Date(dateSplit[0],dateSplit[1]-1,dateSplit[2]-0+1); } @@ -84,9 +90,10 @@ function displayMapScores(mapID) { $('#scoreDisplay').empty(); newDiv.prependTo('#scoreDisplay'); } - scoresShowPage(1, mapID); $("#mapDisplay").fadeOut('fast'); displayMap(mapID, "mapDisplay", 682); + scoresShowPage(pointerPage, mapID); + //console.log(pointerPage, mapID); } @@ -95,9 +102,21 @@ function updateHash() { tmp = tmp.split("#"); var anchorTag = tmp[0]+'#'+pointerDate; anchorTag += "_"+pointerMapID; + if (pointerPage) anchorTag += "_"+pointerPage; + else anchorTag += "_"; + if (pointerUserID) anchorTag += "_"+pointerUserID; + else anchorTag += "_"; document.location=anchorTag; } +var pointerPage = 1, pointerUserID +function saveScoreLocation(page, userID) { + pointerPage = page; + pointerUserID = userID; + updateHash(); + console.log("SaveScoreLoc"); +} + var pointerDate; function getMapIDs(request) { switch (request) { -- cgit v1.2.3