1(function($) { 2 "use strict"; 3 4 $(document).on('ready', function() { 5 window.loopcounter = function(idWarp) { 6 if (typeof idWarp != 'undefined') { 7 var date = $('.' + idWarp).data('date'); 8 9 10 11 var start = new Date(date), 12 end = new Date(), 13 diff = new Date(start - end), 14 time = diff / 1000 / 60 / 60 / 24; 15 16 var day = parseInt(time); 17 var hour = parseInt(24 - (diff / 1000 / 60 / 60) % 24); 18 var min = parseInt(60 - (diff / 1000 / 60) % 60); 19 var sec = parseInt(60 - (diff / 1000) % 60); 20 21 counterDate(idWarp, day, hour, min, sec); 22 23 var interval = setInterval(function() { 24 if (sec == 0 && min != 0) { 25 min--; 26 sec = 60; 27 } 28 if (min == 0 && sec == 0 && hour != 0) { 29 hour--; 30 min = 59; 31 sec = 60; 32 } 33 if (min == 0 && sec == 0 && hour == 0 && day != 0) { 34 day--; 35 hour = 23; 36 min = 59; 37 sec = 60; 38 } 39 if (min == 0 && sec == 0 && hour == 0 && day == 0) { 40 clearInterval(interval); 41 } else { 42 sec--; 43 } 44 counterDate(idWarp, day, hour, min, sec); 45 }, 1000); 46 47 function counterDate(id, day, hour, min, sec) { 48 if (time < 0) { 49 day = hour = min = sec = 0; 50 } 51 $('.' + id + ' .counter-days').html(counterDoubleDigit(day)); 52 $('.' + id + ' .counter-hours').html(counterDoubleDigit(hour)); 53 $('.' + id + ' .counter-minutes').html(counterDoubleDigit(min)); 54 $('.' + id + ' .counter-seconds').html(counterDoubleDigit(sec)); 55 } 56 57 function counterDoubleDigit(arg) { 58 if (arg.toString().length <= 1) { 59 arg = ('0' + arg).slice(-2); 60 } 61 return arg; 62 } 63 } 64 } 65 //loopcounter( 'counter-id' ); 66 }); 67})(jQuery); // End 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.