Project

General

Profile

« Previous | Next » 

Revision f9cc072d

Added by Stephen Beaver almost 10 years ago

Nix hte spinning clock

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>
31 30

  
32 31
	<script>
33 32
		// Un-hide the "Top of page" icons if the page is larger than the window
src/usr/local/www/jquery/jquery.pietimer.min.js
1
/*
2
 Copyright (c) 2012, Northfield X Ltd
3
All rights reserved.
4

  
5
Modified BSD License
6

  
7
Redistribution and use in source and binary forms, with or without
8
modification, are permitted provided that the following conditions are met:
9
 Redistributions of source code must retain the above copyright
10
      notice, this list of conditions and the following disclaimer.
11
 Redistributions in binary form must reproduce the above copyright
12
      notice, this list of conditions and the following disclaimer in the
13
      documentation and/or other materials provided with the distribution.
14
 Neither the name of the <organization> nor the
15
      names of its contributors may be used to endorse or promote products
16
      derived from this software without specific prior written permission.
17

  
18
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
22
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
*/
29
(function(d){var k={seconds:10,color:"rgba(255, 255, 255, 0.8)",height:null,width:null},e=3*Math.PI/2,g=Math.PI/180,f=function(b,a,c){null===a.width&&(a.width=b.width());null===a.height&&(a.height=b.height());this.settings=a;this.jquery_object=b;this.interval_id=null;this.current_value=360;this.initial_time=new Date;this.accrued_time=0;this.callback=c;this.is_paused=!0;this.is_reversed="undefined"!=typeof a.is_reversed?a.is_reversed:!1;this.jquery_object.html('<canvas class="pie_timer" width="'+a.width+
30
'" height="'+a.height+'"></canvas>');this.canvas=this.jquery_object.children(".pie_timer")[0]};f.prototype={start:function(){this.is_paused&&(this.initial_time=new Date-this.accrued_time,0>=this.current_value&&(this.current_value=360),this.interval_id=setInterval(d.proxy(this.run_timer,this),40),this.is_paused=!1)},pause:function(){this.is_paused||(this.accrued_time=new Date-this.initial_time,clearInterval(this.interval_id),this.is_paused=!0)},run_timer:function(){if(this.canvas.getContext)if(this.elapsed_time=
31
(new Date-this.initial_time)/1E3,this.current_value=360*Math.max(0,this.settings.seconds-this.elapsed_time)/this.settings.seconds,0>=this.current_value)clearInterval(this.interval_id),this.canvas.width=this.settings.width,d.isFunction(this.callback)&&this.callback.call(),this.is_paused=!0;else{this.canvas.width=this.settings.width;var b=this.canvas.getContext("2d"),a=[this.canvas.width,this.canvas.height],c=Math.min(a[0],a[1])/2,a=[a[0]/2,a[1]/2],h=this.is_reversed;b.beginPath();b.moveTo(a[0],a[1]);
32
b.arc(a[0],a[1],c,h?e-(360-this.current_value)*g:e-this.current_value*g,e,h);b.closePath();b.fillStyle=this.settings.color;b.fill()}}};var l=function(b,a){var c=d.extend({},k,b);return this.each(function(){var b=d(this),e=new f(b,c,a);b.data("pie_timer",e)})},m=function(b){b in f.prototype||d.error("Method "+b+" does not exist on jQuery.pietimer");var a=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=d(this).data("pie_timer");if(!c)return!0;c[b].apply(c,a)})};d.fn.pietimer=
33
function(b){return"object"===typeof b||!b?l.apply(this,arguments):m.apply(this,arguments)}})(jQuery);
src/usr/local/www/pkg_mgr_install.php
385 385
	<input type="hidden" name="mode" value="<?=$_POST['mode']?>" />
386 386
	<input type="hidden" name="completed" value="true" />
387 387

  
388
	<div id="clock" style="text-align: center;"></div>
389 388
	<div id="countdown" style="text-align: center;"></div>
390 389

  
391 390
	<div class="progress" style="display: none;">
......
597 596
}
598 597

  
599 598
function startCountdown(time) {
600
	$('#clock').html('<img src="/321.gif" />');
601

  
602 599
	setInterval(function(){
603 600
		if(time > 0) {
604 601
			$('#countdown').html('<h4>Rebooting.<br />Page will reload in ' + time + ' seconds.</h4>');
src/usr/local/www/reboot.php
85 85
	}
86 86

  
87 87
?>
88
<div id="clock" style="text-align: center;"></div>
88

  
89 89
<div id="countdown" style="text-align: center;"></div>
90 90

  
91 91
<script>
92 92
//<![CDATA[
93 93
events.push(function(){
94 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 95
	function startCountdown(time) {
106 96
			setInterval(function(){
107 97
				$('#countdown').html('<h4>Rebooting<br />Page will reload in ' +time+ ' seconds.</h4>');
......
110 100
	}
111 101

  
112 102
	// startCountdown(60);
113
	$('#clock').pietimer('start');
114 103
	startCountdown(90);
115 104
});
116 105
//]]>

Also available in: Unified diff