]> git.mxchange.org Git - mailer.git/blob - templates/de/html/js/js_surfbar_stopped.tpl
Mailer project rwritten:
[mailer.git] / templates / de / html / js / js_surfbar_stopped.tpl
1 /**
2  * JavaScript for ext-surfbar - Stopped
3  * --------------------------------------------------------------------
4  * $Revision::                                                        $
5  * $Date::                                                            $
6  * $Tag:: 0.2.1-FINAL                                                 $
7  * $Author::                                                          $
8  * --------------------------------------------------------------------
9  * Copyright (c) 2003 - 2009 by Roland Haeder
10  * Copyright (c) 2009 - 2012 by Mailer Developer Team
11  * For more information visit: http://mxchange.org
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
26  * MA  02110-1301  USA
27  */
28
29 var interval  = null;
30 var countDown = '{?surfbar_restart_time?}';
31 var timer     = document.getElementById('surfbar_counter');
32 var buttonDiv = document.getElementById('surfbar_button');
33
34 function restart () {
35         this.location.reload();
36 }
37
38 function showButton () {
39         buttonDiv.innerHTML = '{%form,formTarget_blank,formMethodGet=surfbar.php%}<input type=\'hidden\' name=\'frame\' value=\'top\' /><input type=\'submit\' id=\'form_submit\' value=\'Surfbar erneut starten\' />{%form_close%}';
40 }
41
42 function counter () {
43         if (countDown == 0) {
44                 if ({%get=autostart%} === true) {
45                         restart();
46                 } else {
47                         showButton();
48                 }
49                 window.clearInterval(interval);
50         } else {
51                 countDown--;
52                 timer.innerHTML = countDown;
53         }
54 }
55
56 function init () {
57         interval = window.setInterval('counter()', 1000);
58         timer.innerHTML = '{?surfbar_restart_time?}';
59 }
60
61 window.setTimeout('init()', 500);