http://www.essonnetourisme.com/wp-content/themes/cdt91/config-temp…/countdown/countdown.js?ver=6.9.9
1// ------------------------------------------------------------------------------------------- 2// 3// AVIA Countdown 4// 5// ------------------------------------------------------------------------------------------- 6(function($) 7{ 8 "use strict"; 9 10 var _units = ['weeks','days','hours','minutes','seconds'], 11 _second = 1000, 12 _minute = _second * 60, 13 _hour = _minute * 60, 14 _day = _hour * 24, 15 _week = _day * 7, 16 ticker = function(_self) 17 { 18 var _time = {}, 19 _now = new Date(), 20 _timestamp = _self.end - _now; 21 22 if(_timestamp <= 0) 23 { 24 clearInterval(_self.countdown); 25 return; 26 } 27 28 _self.time.weeks = Math.floor( _timestamp / _week); 29 _self.time.days = Math.floor((_timestamp % _week) / _day); 30 _self.time.hours = Math.floor((_timestamp % _day) / _hour); 31 _self.time.minutes = Math.floor((_timestamp % _hour) / _minute); 32 _self.time.seconds = Math.floor((_timestamp % _minute) / _second); 33 34 switch(_self.data.maximum) 35 { 36 case 1: _self.time.seconds = Math.floor(_timestamp / _second); break; 37 case 2: _self.time.minutes = Math.floor(_timestamp / _minute); break; 38 case 3: _self.time.hours = Math.floor(_timestamp / _hour); break; 39 case 4: _self.time.days = Math.floor(_timestamp / _day); break; 40 } 41 42 for (var i in _self.time) 43 { 44 if(typeof _self.update[i] == "object") 45 { 46 if(_self.firstrun || _self.oldtime[i] != _self.time[i]) 47 { 48 var labelkey = ( _self.time[i] === 1 ) ? "single" : "multi"; 49 50 _self.update[i].time_container.text(_self.time[i]); 51 _self.update[i].label_container.text(_self.update[i][labelkey]); 52 } 53 } 54 } 55 56 //show ticker 57 if(_self.firstrun) _self.container.addClass('av-countdown-active'); 58 59 _self.oldtime = $.extend( {}, _self.time ); 60 _self.firstrun = false; 61 }; 62
63 64 $.fn.aviaCountdown = function( options ) 65 { 66 if(!this.length) return; 67 68 return this.each(function() 69 { 70 var _self = {}; 71 _self.update = {}; 72 _self.time = {}; 73 _self.oldtime = {}; 74 _self.firstrun = true; 75 76 _self.container = $(this); 77 _self.data = _self.container.data(); 78 _self.end = new Date(_self.data.year, _self.data.month, _self.data.day, _self.data.hour, _self.data.minute ); 79 80 for (var i in _units) 81 { 82 _self.update[_units[i]] = { 83 time_container: _self.container.find('.av-countdown-' + _units[i] + ' .av-countdown-time'), 84 label_container: _self.container.find('.av-countdown-' + _units[i] + ' .av-countdown-time-label') 85 }; 86 87 if(_self.update[_units[i]].label_container.length) 88 { 89 _self.update[_units[i]].single = _self.update[_units[i]].label_container.data('label'); 90 _self.update[_units[i]].multi = _self.update[_units[i]].label_container.data('label-multi'); 91 } 92 } 93 94 ticker(_self); 95 _self.countdown = setInterval(function(){ ticker(_self); }, 1000); 96 97 98 }); 99 }; 100 101 102 103}(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.