PageSourceSearch

https://iabtechlab.com/wp-content/themes/modality/js/wow.js?ver=7.1.2

js iabtechlab.com collected 2026-09-24 06:45:47 UTC 15,242 bytes, 509 lines download raw bytes

vendor: 15,242 bytes, lines 1-509
1(function() {
2  var MutationObserver, Util, WeakMap, getComputedStyle, getComputedStyleRX,
3    bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
4    indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
5
6  Util = (function() {
7    function Util() {}
8
9    Util.prototype.extend = function(custom, defaults) {
10      var key, value;
11      for (key in defaults) {
12        value = defaults[key];
13        if (custom[key] == null) {
14          custom[key] = value;
15        }
16      }
17      return custom;
18    };
19
20    Util.prototype.isMobile = function(agent) {
21      return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(agent);
22    };
23
24    Util.prototype.createEvent = function(event, bubble, cancel, detail) {
25      var customEvent;
26      if (bubble == null) {
27        bubble = false;
28      }
29      if (cancel == null) {
30        cancel = false;
31      }
32      if (detail == null) {
33        detail = null;
34      }
35      if (document.createEvent != null) {
36        customEvent = document.createEvent('CustomEvent');
37        customEvent.initCustomEvent(event, bubble, cancel, detail);
38      } else if (document.createEventObject != null) {
39        customEvent = document.createEventObject();
40        customEvent.eventType = event;
41      } else {
42        customEvent.eventName = event;
43      }
44      return customEvent;
45    };
46
47    Util.prototype.emitEvent = function(elem, event) {
48      if (elem.dispatchEvent != null) {
49        return elem.dispatchEvent(event);
50      } else if (event in (elem != null)) {
51        return elem[event]();
52      } else if (("on" + event) in (elem != null)) {
53        return elem["on" + event]();
54      }
55    };
56
57    Util.prototype.addEvent = function(elem, event, fn) {
58      if (elem.addEventListener != null) {
59        return elem.addEventListener(event, fn, false);
60      } else if (elem.attachEvent != null) {
61        return elem.attachEvent("on" + event, fn);
62      } else {
63        return elem[event] = fn;
64      }
65    };
66
67    Util.prototype.removeEvent = function(elem, event, fn) {
68      if (elem.removeEventListener != null) {
69        return elem.removeEventListener(event, fn, false);
70      } else if (elem.detachEvent != null) {
71        return elem.detachEvent("on" + event, fn);
72      } else {
73        return delete elem[event];
74      }
75    };
76
77    Util.prototype.innerHeight = function() {
78      if ('innerHeight' in window) {
79        return window.innerHeight;
80      } else {
81        return document.documentElement.clientHeight;
82      }
83    };
84
85    return Util;
86
87  })();
88
89  WeakMap = this.WeakMap || this.MozWeakMap || (WeakMap = (function() {
90    function WeakMap() {
91      this.keys = [];
92      this.values = [];
93    }
94
95    WeakMap.prototype.get = function(key) {
96      var i, item, j, len, ref;
97      ref = this.keys;
98      for (i = j = 0, len = ref.length; j < len; i = ++j) {
99        item = ref[i];
100        if (item === key) {
101          return this.values[i];
102        }
103      }
104    };
105
106    WeakMap.prototype.set = function(key, value) {
107      var i, item, j, len, ref;
108      ref = this.keys;
109      for (i = j = 0, len = ref.length; j < len; i = ++j) {
110        item = ref[i];
111        if (item === key) {
112          this.values[i] = value;
113          return;
114        }
115      }
116      this.keys.push(key);
117      return this.values.push(value);
118    };
119
120    return WeakMap;
121
122  })());
123
124  MutationObserver = this.MutationObserver || this.WebkitMutationObserver || this.MozMutationObserver || (MutationObserver = (function() {
125    function MutationObserver() {
126      if (typeof console !== "undefined" && console !== null) {
127        console.warn('MutationObserver is not supported by your browser.');
128      }
129      if (typeof console !== "undefined" && console !== null) {
130        console.warn('WOW.js cannot detect dom mutations, please call .sync() after loading new content.');
131      }
132    }
133
134    MutationObserver.notSupported = true;
135
136    MutationObserver.prototype.observe = function() {};
137
138    return MutationObserver;
139
140  })());
141
142  getComputedStyle = this.getComputedStyle || function(el, pseudo) {
143    this.getPropertyValue = function(prop) {
144      var ref;
145      if (prop === 'float') {
146        prop = 'styleFloat';
147      }
148      if (getComputedStyleRX.test(prop)) {
149        prop.replace(getComputedStyleRX, function(_, _char) {
150          return _char.toUpperCase();
151        });
152      }
153      return ((ref = el.currentStyle) != null ? ref[prop] : void 0) || null;
154    };
155    return this;
156  };
157
158  getComputedStyleRX = /(\-([a-z]){1})/g;
159
160  this.WOW = (function() {
161    WOW.prototype.defaults = {
162      boxClass: 'wow',
163      animateClass: 'animated',
164      offset: 0,
165      mobile: true,
166      live: true,
167      callback: null
168    };
169
170    function WOW(options) {
171      if (options == null) {
172        options = {};
173      }
174      this.scrollCallback = bind(this.scrollCallback, this);
175      this.scrollHandler = bind(this.scrollHandler, this);
176      this.resetAnimation = bind(this.resetAnimation, this);
177      this.start = bind(this.start, this);
178      this.scrolled = true;
179      this.config = this.util().extend(options, this.defaults);
180      this.animationNameCache = new WeakMap();
181      this.wowEvent = this.util().createEvent(this.config.boxClass);
182    }
183
184    WOW.prototype.init = function() {
185      var ref;
186      this.element = window.document.documentElement;
187      if ((ref = document.readyState) === "interactive" || ref === "complete") {
188        this.start();
189      } else {
190        this.util().addEvent(document, 'DOMContentLoaded', this.start);
191      }
192      return this.finished = [];
193    };
194
195    WOW.prototype.start = function() {
196      var box, j, len, ref;
197      this.stopped = false;
198      this.boxes = (function() {
199        var j, len, ref, results;
200        ref = this.element.querySelectorAll("." + this.config.boxClass);
201        results = [];
202        for (j = 0, len = ref.length; j < len; j++) {
203          box = ref[j];
204          results.push(box);
205        }
206        return results;
207      }).call(this);
208      this.all = (function() {
209        var j, len, ref, results;
210        ref = this.boxes;
211        results = [];
212        for (j = 0, len = ref.length; j < len; j++) {
213          box = ref[j];
214          results.push(box);
215        }
216        return results;
217      }).call(this);
218      if (this.boxes.length) {
219        if (this.disabled()) {
220          this.resetStyle();
221        } else {
222          ref = this.boxes;
223          for (j = 0, len = ref.length; j < len; j++) {
224            box = ref[j];
225            this.applyStyle(box, true);
226          }
227        }
228      }
229      if (!this.disabled()) {
230        this.util().addEvent(window, 'scroll', this.scrollHandler);
231        this.util().addEvent(window, 'resize', this.scrollHandler);
232        this.interval = setInterval(this.scrollCallback, 50);
233      }
234      if (this.config.live) {
235        return new MutationObserver((function(_this) {
236          return function(records) {
237            var k, len1, node, record, results;
238            results = [];
239            for (k = 0, len1 = records.length; k < len1; k++) {
240              record = records[k];
241              results.push((function() {
242                var l, len2, ref1, results1;
243                ref1 = record.addedNodes || [];
244                results1 = [];
245                for (l = 0, len2 = ref1.length; l < len2; l++) {
246                  node = ref1[l];
247                  results1.push(this.doSync(node));
248                }
249                return results1;
250              }).call(_this));
251            }
252            return results;
253          };
254        })(this)).observe(document.body, {
255          childList: true,
256          subtree: true
257        });
258      }
259    };
260
261    WOW.prototype.stop = function() {
262      this.stopped = true;
263      this.util().removeEvent(window, 'scroll', this.scrollHandler);
264      this.util().removeEvent(window, 'resize', this.scrollHandler);
265      if (this.interval != null) {
266        return clearInterval(this.interval);
267      }
268    };
269
270    WOW.prototype.sync = function(element) {
271      if (MutationObserver.notSupported) {
272        return this.doSync(this.element);
273      }
274    };
275
276    WOW.prototype.doSync = function(element) {
277      var box, j, len, ref, results;
278      if (element == null) {
279        element = this.element;
280      }
281      if (element.nodeType !== 1) {
282        return;
283      }
284      element = element.parentNode || element;
285      ref = element.querySelectorAll("." + this.config.boxClass);
286      results = [];
287      for (j = 0, len = ref.length; j < len; j++) {
288        box = ref[j];
289        if (indexOf.call(this.all, box) < 0) {
290          this.boxes.push(box);
291          this.all.push(box);
292          if (this.stopped || this.disabled()) {
293            this.resetStyle();
294          } else {
295            this.applyStyle(box, true);
296          }
297          results.push(this.scrolled = true);
298        } else {
299          results.push(void 0);
300        }
301      }
302      return results;
303    };
304
305    WOW.prototype.show = function(box) {
306      this.applyStyle(box);
307      box.className = box.className + " " + this.config.animateClass;
308      if (this.config.callback != null) {
309        this.config.callback(box);
310      }
311      this.util().emitEvent(box, this.wowEvent);
312      this.util().addEvent(box, 'animationend', this.resetAnimation);
313      this.util().addEvent(box, 'oanimationend', this.resetAnimation);
314      this.util().addEvent(box, 'webkitAnimationEnd', this.resetAnimation);
315      this.util().addEvent(box, 'MSAnimationEnd', this.resetAnimation);
316      return box;
317    };
318
319    WOW.prototype.applyStyle = function(box, hidden) {
320      var delay, duration, iteration;
321      duration = box.getAttribute('data-wow-duration');
322      delay = box.getAttribute('data-wow-delay');
323      iteration = box.getAttribute('data-wow-iteration');
324      return this.animate((function(_this) {
325        return function() {
326          return _this.customStyle(box, hidden, duration, delay, iteration);
327        };
328      })(this));
329    };
330
331    WOW.prototype.animate = (function() {
332      if ('requestAnimationFrame' in window) {
333        return function(callback) {
334          return window.requestAnimationFrame(callback);
335        };
336      } else {
337        return function(callback) {
338          return callback();
339        };
340      }
341    })();
342
343    WOW.prototype.resetStyle = function() {
344      var box, j, len, ref, results;
345      ref = this.boxes;
346      results = [];
347      for (j = 0, len = ref.length; j < len; j++) {
348        box = ref[j];
349        results.push(box.style.visibility = 'visible');
350      }
351      return results;
352    };
353
354    WOW.prototype.resetAnimation = function(event) {
355      var target;
356      if (event.type.toLowerCase().indexOf('animationend') >= 0) {
357        target = event.target || event.srcElement;
358        return target.className = target.className.replace(this.config.animateClass, '').trim();
359      }
360    };
361
362    WOW.prototype.customStyle = function(box, hidden, duration, delay, iteration) {
363      if (hidden) {
364        this.cacheAnimationName(box);
365      }
366      box.style.visibility = hidden ? 'hidden' : 'visible';
367      if (duration) {
368        this.vendorSet(box.style, {
369          animationDuration: duration
370        });
371      }
372      if (delay) {
373        this.vendorSet(box.style, {
374          animationDelay: delay
375        });
376      }
377      if (iteration) {
378        this.vendorSet(box.style, {
379          animationIterationCount: iteration
380        });
381      }
382      this.vendorSet(box.style, {
383        animationName: hidden ? 'none' : this.cachedAnimationName(box)
384      });
385      return box;
386    };
387
388    WOW.prototype.vendors = ["moz", "webkit"];
389
390    WOW.prototype.vendorSet = function(elem, properties) {
391      var name, results, value, vendor;
392      results = [];
393      for (name in properties) {
394        value = properties[name];
395        elem["" + name] = value;
396        results.push((function() {
397          var j, len, ref, results1;
398          ref = this.vendors;
399          results1 = [];
400          for (j = 0, len = ref.length; j < len; j++) {
401            vendor = ref[j];
402            results1.push(elem["" + vendor + (name.charAt(0).toUpperCase()) + (name.substr(1))] = value);
403          }
404          return results1;
405        }).call(this));
406      }
407      return results;
408    };
409
410    WOW.prototype.vendorCSS = function(elem, property) {
411      var j, len, ref, result, style, vendor;
412      style = getComputedStyle(elem);
413      result = style.getPropertyCSSValue(property);
414      ref = this.vendors;
415      for (j = 0, len = ref.length; j < len; j++) {
416        vendor = ref[j];
417        result = result || style.getPropertyCSSValue("-" + vendor + "-" + property);
418      }
419      return result;
420    };
421
422    WOW.prototype.animationName = function(box) {
423      var animationName;
424      try {
425        animationName = this.vendorCSS(box, 'animation-name').cssText;
426      } catch (_error) {
427        animationName = getComputedStyle(box).getPropertyValue('animation-name');
428      }
429      if (animationName === 'none') {
430        return '';
431      } else {
432        return animationName;
433      }
434    };
435
436    WOW.prototype.cacheAnimationName = function(box) {
437      return this.animationNameCache.set(box, this.animationName(box));
438    };
439
440    WOW.prototype.cachedAnimationName = function(box) {
441      return this.animationNameCache.get(box);
442    };
443
444    WOW.prototype.scrollHandler = function() {
445      return this.scrolled = true;
446    };
447
448    WOW.prototype.scrollCallback = function() {
449      var box;
450      if (this.scrolled) {
451        this.scrolled = false;
452        this.boxes = (function() {
453          var j, len, ref, results;
454          ref = this.boxes;
455          results = [];
456          for (j = 0, len = ref.length; j < len; j++) {
457            box = ref[j];
458            if (!(box)) {
459              continue;
460            }
461            if (this.isVisible(box)) {
462              this.show(box);
463              continue;
464            }
465            results.push(box);
466          }
467          return results;
468        }).call(this);
469        if (!(this.boxes.length || this.config.live)) {
470          return this.stop();
471        }
472      }
473    };
474
475    WOW.prototype.offsetTop = function(element) {
476      var top;
477      while (element.offsetTop === void 0) {
478        element = element.parentNode;
479      }
480      top = element.offsetTop;
481      while (element = element.offsetParent) {
482        top += element.offsetTop;
483      }
484      return top;
485    };
486
487    WOW.prototype.isVisible = function(box) {
488      var bottom, offset, top, viewBottom, viewTop;
489      offset = box.getAttribute('data-wow-offset') || this.config.offset;
490      viewTop = window.pageYOffset;
491      viewBottom = viewTop + Math.min(this.element.clientHeight, this.util().innerHeight()) - offset;
492      top = this.offsetTop(box);
493      bottom = top + box.clientHeight;
494      return top <= viewBottom && bottom >= viewTop;
495    };
496
497    WOW.prototype.util = function() {
498      return this._util != null ? this._util : this._util = new Util();
499    };
500
501    WOW.prototype.disabled = function() {
502      return !this.config.mobile && this.util().isMobile(navigator.userAgent);
503    };
504
505    return WOW;
506
507  })();
508
509}).call(this);

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.