Project

General

Profile

« Previous | Next » 

Revision 89932a3d

Added by Stephen Beaver over 9 years ago

Experimental countdown timer

View differences:

src/usr/local/www/foot.inc
27 27
	<script src="/jquery/pfSense.js"></script>
28 28
	<script src="/jquery/pfSenseHelpers.js"></script>
29 29
	<script src="sortable/sortable.min.js"></script>
30
	<script src="/jquery/jquery.pietimer.min.js"></script>
30 31

  
31 32
	<script>
32 33
		// Un-hide the "Top of page" icons if the page is larger than the window
src/usr/local/www/reboot.php
76 76

  
77 77
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
78 78
	if(DEBUG) {
79
	   print("Not actually rebooting (DEBUG is set true)");
79
	   print_info_box("Not actually rebooting (DEBUG is set true)", success);
80 80
	}
81 81
	else {
82
		print('<pre>');
82
		print('<div><pre>');
83 83
		system_reboot();
84
		print('</pre>');
84
		print('</pre></div>');
85 85
	}
86 86

  
87 87
?>
......
91 91
<script>
92 92
//<![CDATA[
93 93
events.push(function(){
94
		startCountdown(60);
94

  
95
	$('#clock').pietimer({
96
	    seconds: 90,
97
	    color: '#404040',
98
	    height: 75,
99
	    width: 75
100
	},
101
	function(){
102
	  window.location="/index.php";
103
	});
104

  
105
	function startCountdown(time) {
106
			setInterval(function(){
107
				$('#countdown').html('<h4>Rebooting<br />Page will reload in ' +time+ ' seconds.</h4>');
108
				time-- != 0 || (window.location="/index.php");
109
			},1000);
110
	}
111

  
112
	// startCountdown(60);
113
	$('#clock').pietimer('start');
114
	startCountdown(90);
95 115
});
96 116
//]]>
97 117
</script>
......
116 136
<?php
117 137

  
118 138
}
119
?>
120
<script>
121
//<![CDATA[
122 139

  
123
	function startCountdown(time) {
124
		$('#clock').html('<img src="/321.gif" />');
125
			setInterval(function(){
126
				$('#countdown').html('<h4>Rebooting<br />Page will reload in ' +time+ ' seconds.</h4>');
140
include("foot.inc");
127 141

  
128
				time-- != 0 || (window.location="/index.php");
129
			},1000);
130
	}
131 142

  
132
//]]>
133
</script>
134
<?php
135
include("foot.inc");

Also available in: Unified diff