PageSourceSearch

https://kostum66.ru/design/kostum66_1/js/countdown.js

js kostum66.ru collected 2026-09-28 13:59:51 UTC 1,496 bytes, 44 lines download raw bytes

1function CountdownTimer(elm,tl,mes){
2 this.initialize.apply(this,arguments);
3}
4CountdownTimer.prototype={
5 initialize:function(elm,tl,mes) {
6  this.elem = document.getElementById(elm);
7  this.tl = tl;
8  this.mes = mes;
9 },countDown:function(){
10  var timer='';
11  var today=new Date();
12  var day=Math.floor((this.tl-today)/(24*60*60*1000));
13  if (day < 10) day = '0'+day;
14  else if (day > 99) day = 99;
15  var hour=Math.floor(((this.tl-today)%(24*60*60*1000))/(60*60*1000));
16  if (hour < 10) hour = '0'+hour;
17  var min=Math.floor(((this.tl-today)%(24*60*60*1000))/(60*1000))%60;
18  if (min < 10) min = '0'+min;
19  var sec=Math.floor(((this.tl-today)%(24*60*60*1000))/1000)%60%60;
20  if (sec < 10) sec = '0'+sec;
21  var me=this;
22
23  if( ( this.tl - today ) > 0 ){
24   timer += '<span class="countdown days">' + day + '</span><span class="countdown hours">' + hour + '</span><span class="countdown mins">' + this.addZero(min) + '</span><span class="countdown secs">' + this.addZero(sec) + '</span>';
25   $('.slidetime').html(timer);
26   tid = setTimeout( function(){me.countDown();},10 );
27  }else{
28   if (this.elem != null) this.elem.innerHTML = this.mes;
29   return;
30  }
31 },addZero:function(num){ return ('0'+num).slice(-2); }
32}
33
34function CDT(){
35	$('.slidetime').each(function( index ) {
36	    var end = $(this).attr('data');
37	    var tl = new Date();
38	    tl.setTime(Date.parse(end));
39
40	    // You can add time's up message here
41	    var timer = new CountdownTimer('CDT',tl,'');
42	    timer.countDown();
43	});
44}

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.