PageSourceSearch

https://rentlux.it/wp-content/themes/homeo/js/countdown.js?ver=20150315

js rentlux.it collected 2026-10-05 03:39:53 UTC 2,973 bytes, 77 lines download raw bytes

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