1(function($){ 2 $.fn.apusCountDown = function( options ) { 3 return this.each(function() { 4 new $.apusCountDown( this, options ); 5 }); 6 } 7 $.apusCountDown = function( obj, options ) { 8 this.options = $.extend({ 9 autoStart : true, 10 LeadingZero:true, 11 DisplayFormat:"<div>%%D%% Days</div><div>%%H%% Hours</div><div>%%M%% Minutes</div><div>%%S%% Seconds</div>", 12 FinishMessage:"Expired", 13 CountActive:true, 14 TargetDate:null 15 }, options || {} ); 16 if ( this.options.TargetDate == null || this.options.TargetDate == '' ){ 17 return ; 18 } 19 this.timer = null; 20 this.element = obj; 21 this.CountStepper = -1; 22 this.CountStepper = Math.ceil(this.CountStepper); 23 this.SetTimeOutPeriod = (Math.abs(this.CountStepper)-1)*1000 + 990; 24 var dthen = new Date(this.options.TargetDate); 25 var dnow = new Date(); 26 if ( this.CountStepper > 0 ) { 27 ddiff = new Date(dnow-dthen); 28 } else { 29 ddiff = new Date(dthen-dnow); 30 } 31 gsecs = Math.floor(ddiff.valueOf()/1000); 32 this.CountBack(gsecs, this); 33 }; 34 $.apusCountDown.fn = $.apusCountDown.prototype; 35 $.apusCountDown.fn.extend = $.apusCountDown.extend = $.extend; 36 $.apusCountDown.fn.extend({ 37 calculateDate:function( secs, num1, num2 ){ 38 var s = ((Math.floor(secs/num1))%num2).toString(); 39 if ( this.options.LeadingZero && s.length < 2) { 40 s = "0" + s; 41 } 42 return "<span>" + s + "</span>"; 43 }, 44 CountBack:function( secs, self ){ 45 if (secs < 0) { 46 self.element.innerHTML = '<div class="lof-labelexpired"> '+self.options.FinishMessage+"</div>"; 47 return; 48 } 49 clearInterval(self.timer); 50 DisplayStr = self.options.DisplayFormat.replace(/%%D%%/g, self.calculateDate( secs,86400,100000) ); 51 DisplayStr = DisplayStr.replace(/%%H%%/g, self.calculateDate(secs,3600,24)); 52 DisplayStr = DisplayStr.replace(/%%M%%/g, self.calculateDate(secs,60,60)); 53 DisplayStr = DisplayStr.replace(/%%S%%/g, self.calculateDate(secs,1,60)); 54 self.element.innerHTML = DisplayStr; 55 if (self.options.CountActive) { 56 self.timer = null; 57 self.timer = setTimeout( function(){ 58 self.CountBack((secs+self.CountStepper),self); 59 },( self.SetTimeOutPeriod ) ); 60 } 61 } 62 }); 63 64 $(document).ready(function(){ 65 $('[data-time="timmer"]').each(function(index, el) { 66 var $this = $(this); 67 var $date = $this.data('date').split("-"); 68 $this.apusCountDown({ 69 TargetDate:$date[0]+"/"+$date[1]+"/"+$date[2]+" "+$date[3]+":"+$date[4]+":"+$date[5], 70 DisplayFormat:"<div class=\"times\"><div class=\"day\">%%D%% Days </div><div class=\"hours\">%%H%% Hours </div><div class=\"minutes\">%%M%% Mins </div><div class=\"seconds\">%%S%% Sec </div></div>", 71 FinishMessage: "" 72 }); 73 }); 74 }); 75 76})(jQuery)
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.