1(function($) { 2 $.fn.countTo = function(options) { 3 // merge the default plugin settings with the custom options 4 options = $.extend({}, $.fn.countTo.defaults, options || {}); 5 6 // how many times to update the value, and how much to increment the value on each update 7 var loops = Math.ceil(options.speed / options.refreshInterval), 8 increment = (options.to - options.from) / loops; 9 10 return $(this).each(function() { 11 var _this = this, 12 loopCount = 0, 13 value = options.from, 14 interval = setInterval(updateTimer, options.refreshInterval); 15 16 function updateTimer() { 17 value += increment; 18 loopCount++; 19 if (options.comma) { 20 val = value.toFixed(options.decimals).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); 21 $(_this).html(val); 22 } else { 23 $(_this).html(value.toFixed(options.decimals)); 24 } 25 26 if (typeof(options.onUpdate) == 'function') { 27 options.onUpdate.call(_this, value); 28 } 29 30 if (loopCount >= loops) { 31 clearInterval(interval); 32 value = options.to; 33 34 if (options.field != undefined && options.field === 'experience') { 35 value = options.to + '+'; 36 $(_this).html(value); 37 }; 38 39 if (typeof(options.onComplete) == 'function') { 40 options.onComplete.call(_this, value); 41 } 42 } 43 } 44 }); 45 }; 46 47 $.fn.countTo.defaults = { 48 from: 0, // the number the element should start at 49 to: 100, // the number the element should end at 50 speed: 1000, // how long it should take to count between the target numbers 51 refreshInterval: 100, // how often the element should be updated 52 decimals: 0, // the number of decimal places to show 53 comma: false, // Format the number with commas 54 onUpdate: null, // callback method for every time the element is updated, 55 onComplete: null, // callback method for when the element finishes updating 56 }; 57})(jQuery); 58 59jQuery(function($) { 60 $('.stat-timer-year-founded').countTo({ 61 from: 0, 62 to: 2019, 63 speed: 1000, 64 refreshInterval: 50, 65 onComplete: function(value) { 66 console.debug(this); 67 } 68 }); 69 $('.stat-timer-experience').countTo({ 70 from: 0, 71 to: 100, 72 speed: 1000, 73 field: 'experience', 74 refreshInterval: 50, 75 onComplete: function(value) { 76 console.debug(this); 77 } 78 }); 79 $('.stat-timer-active-clients').countTo({ 80 from: 0, 81 to: 250, 82 speed: 1000, 83 refreshInterval: 50, 84 onComplete: function(value) { 85 console.debug(this); 86 } 87 }); 88 $('.stat-timer-messages-collected').countTo({ 89 from: 0, 90 to: 691386, 91 speed: 1000, 92 refreshInterval: 50, 93 comma: true, 94 onComplete: function(value) { 95 console.debug(this); 96 } 97 }); 98 $('.stat-timer-spammers-identified').countTo({ 99 from: 0, 100 to: 40, 101 speed: 1000, 102 refreshInterval: 50, 103 onComplete: function(value) { 104 console.debug(this); 105 } 106 }); 107 $('.stat-timer-actions-taken').countTo({ 108 from: 50, 109 to: 2500, 110 speed: 1000, 111 refreshInterval: 50, 112 onComplete: function(value) { 113 console.debug(this); 114 } 115 }); 116 $('.stat-timer-millions').countTo({ 117 from: 0, 118 to: 36, 119 speed: 1000, 120 refreshInterval: 50, 121 onComplete: function(value) { 122 console.debug(this); 123 } 124 }); 125 });
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.