diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php index 67e5552d9..42c7ac3b8 100644 --- a/html/includes/print-menubar.php +++ b/html/includes/print-menubar.php @@ -452,12 +452,19 @@ if ($_SESSION['userlevel'] >= '10')
  • API Settings
  • API Documentation
  • + '); } ?> + + +
  • Logout Logout
  • '); } diff --git a/html/index.php b/html/index.php index db8b9807e..180919825 100755 --- a/html/index.php +++ b/html/index.php @@ -142,9 +142,6 @@ if (isset($config['page_title'])) { $config['page_title_prefix'] = $config['page -' . "\n"); } -?> @@ -340,6 +337,64 @@ if (is_array($sql_debug) && is_array($php_debug)) { } ?> - + + $(document).ready(function() { + + $("#countdown_timer_status").html(" Pause"); + var Countdown = { + sec: '. $config['page_refresh'] .', + + Start: function() { + var cur = this; + this.interval = setInterval(function() { + $("#countdown_timer_status").html(" Pause"); + cur.sec -= 1; + display_time = cur.sec; + if (display_time == 0) { + location.reload(); + } + if (display_time % 1 === 0 && display_time <= 300) { + $("#countdown_timer").html(" Refresh in " + display_time); + } + }, 1000); + }, + + Pause: function() { + clearInterval(this.interval); + $("#countdown_timer_status").html(" Resume"); + delete this.interval; + }, + + Resume: function() { + if (!this.interval) this.Start(); + } + }; + + Countdown.Start(); + + $("#countdown_timer_status").click("", function(event) { + event.preventDefault(); + if (Countdown.interval) { + Countdown.Pause(); + } else { + Countdown.Resume(); + } + }); + + $("#countdown_timer").click("", function(event) { + event.preventDefault(); + }); + + }); + '); + +} + +?> +