diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2012-07-04 18:43:19 -0700 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2012-07-04 18:43:19 -0700 |
commit | 5d3a318a8cd456fbb8cd303ef0e00f4bf05ba355 (patch) | |
tree | 6612d9b097dddf74947afaa1d3767cfdc0e3fcff /pages/home.php | |
parent | 8cca6464769d0b04940eda519594ecbd4804c878 (diff) | |
download | pathery-5d3a318a8cd456fbb8cd303ef0e00f4bf05ba355.tar.xz |
Confirm refresh page on countdown to 0
Diffstat (limited to 'pages/home.php')
-rw-r--r-- | pages/home.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pages/home.php b/pages/home.php index 9311b62..e9b65be 100644 --- a/pages/home.php +++ b/pages/home.php @@ -217,6 +217,8 @@ $timerem = strtotime("tomorrow") - strtotime("now"); //We're counting down to "tomorrow"
tomorrow.setTime(tomorrow.getTime() + <? echo $timerem; ?> * 1000);
+ var userConfirm = true;
+
function countdown() {
var now = new Date();
now.setTime(now.getTime());
@@ -224,6 +226,7 @@ $timerem = strtotime("tomorrow") - strtotime("now"); var timerem = tomorrow.getTime() - now.getTime();
timerem = timerem / 1000;
+ var totalSeconds = timerem;
if (timerem < 1)
window.clearInterval(countdownInt);
var hours = addZero(timerem/3600);
@@ -235,6 +238,12 @@ $timerem = strtotime("tomorrow") - strtotime("now"); var seconds = addZero(timerem);
var stamp = hours + ":" + minutes + ":" + seconds;
document.getElementById("countdown").innerHTML = stamp;
+ if (totalSeconds <= 1 && userConfirm == true) {
+ userConfirm = confirm("It's Tomorrow Today! Go to new maps?")
+ if (userConfirm) {
+ location.reload(true);
+ }
+ }
}
function addZero(num) {
|