1/* jQuery CountTo */ 2(function ($) { 3 "use strict"; 4 5 $(document).ready(function () { 6 bp_element_counter_box.init(); 7 }); 8 9 var bp_element_counter_box = { 10 init: function () { 11 var waypoint = void 0 !== $.fn.waypoint; 12 13 bp_element_counter_box.counter(); 14 15 var counter = $('.bp-element-counter-box .counter-box .number_counter'); 16 17 counter.waypoint(function () { 18 var $this = $(this); 19 if (!$this.hasClass('animated')) { 20 var number = $this.data('number'), 21 unit = $this.data('unit'), 22 separator = $this.data('separator') ? $this.data('separator') : ''; 23 $this.countTo({ 24 from: 0, 25 to: number, 26 refreshInterval: 40, 27 speed: 1000, 28 formatter: function (value, options) { 29 value = value.toFixed(); 30 31 return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, separator) + unit; 32 } 33 }); 34 35 $this.addClass('animated'); 36 } 37 }, { 38 offset: $(window).height() 39 }); 40 }, 41 42 counter: function () { 43 var a = $; 44 a.fn.countTo = function (g) { 45 g = g || {}; 46 return a(this).each(function () { 47 function e(a) { 48 a = b.formatter.call(h, a, b); 49 f.html(a); 50 } 51 52 var b = a.extend({}, a.fn.countTo.defaults, { 53 from: a(this).data("from"), 54 to: a(this).data("to"), 55 speed: a(this).data("speed"), 56 refreshInterval: a(this).data("refresh-interval"), 57 decimals: a(this).data("decimals") 58 }, g), j = Math.ceil(b.speed / b.refreshInterval), l = (b.to - b.from) / j, h = this, f = a(this), 59 k = 0, c = b.from, d = f.data("countTo") || {}; 60 f.data("countTo", d); 61 d.interval && clearInterval(d.interval); 62 d.interval = 63 setInterval(function () { 64 c += l; 65 k++; 66 e(c); 67 "function" === typeof b.onUpdate && b.onUpdate.call(h, c); 68 k >= j && (f.removeData("countTo"), clearInterval(d.interval), c = b.to, "function" === typeof b.onComplete && b.onComplete.call(h, c)); 69 }, b.refreshInterval); 70 e(c); 71 }); 72 }; 73 a.fn.countTo.defaults = { 74 from: 0, to: 0, speed: 1E3, refreshInterval: 100, decimals: 0, formatter: function (a, e) { 75 a = a.toFixed(e.decimals); 76 return a; 77 }, onUpdate: null, onComplete: null 78 }; 79 }, 80 } 81})(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.