vendor: 16,060 bytes, lines 1-513
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 scrollContainer: null 169 }; 170 171 function WOW(options) { 172 if (options == null) { 173 options = {}; 174 } 175 this.scrollCallback = bind(this.scrollCallback, this); 176 this.scrollHandler = bind(this.scrollHandler, this); 177 this.resetAnimation = bind(this.resetAnimation, this); 178 this.start = bind(this.start, this); 179 this.scrolled = true; 180 this.config = this.util().extend(options, this.defaults); 181 if (options.scrollContainer != null) { 182 this.config.scrollContainer = document.querySelector(options.scrollContainer); 183 } 184 this.animationNameCache = new WeakMap(); 185 this.wowEvent = this.util().createEvent(this.config.boxClass); 186 } 187 188 WOW.prototype.init = function() { 189 var ref; 190 this.element = window.document.documentElement; 191 if ((ref = document.readyState) === "interactive" || ref === "complete") { 192 this.start(); 193 } else { 194 this.util().addEvent(document, 'DOMContentLoaded', this.start); 195 } 196 return this.finished = []; 197 }; 198 199 WOW.prototype.start = function() { 200 var box, j, len, ref; 201 this.stopped = false; 202 this.boxes = (function() { 203 var j, len, ref, results; 204 ref = this.element.querySelectorAll("." + this.config.boxClass); 205 results = []; 206 for (j = 0, len = ref.length; j < len; j++) { 207 box = ref[j]; 208 results.push(box); 209 } 210 return results; 211 }).call(this); 212 this.all = (function() { 213 var j, len, ref, results; 214 ref = this.boxes; 215 results = []; 216 for (j = 0, len = ref.length; j < len; j++) { 217 box = ref[j]; 218 results.push(box); 219 } 220 return results; 221 }).call(this); 222 if (this.boxes.length) { 223 if (this.disabled()) { 224 this.resetStyle(); 225 } else { 226 ref = this.boxes; 227 for (j = 0, len = ref.length; j < len; j++) { 228 box = ref[j]; 229 this.applyStyle(box, true); 230 } 231 } 232 } 233 if (!this.disabled()) { 234 this.util().addEvent(this.config.scrollContainer || window, 'scroll', this.scrollHandler); 235 this.util().addEvent(window, 'resize', this.scrollHandler); 236 this.interval = setInterval(this.scrollCallback, 50); 237 } 238 if (this.config.live) { 239 return new MutationObserver((function(_this) { 240 return function(records) { 241 var k, len1, node, record, results; 242 results = []; 243 for (k = 0, len1 = records.length; k < len1; k++) { 244 record = records[k]; 245 results.push((function() { 246 var l, len2, ref1, results1; 247 ref1 = record.addedNodes || []; 248 results1 = []; 249 for (l = 0, len2 = ref1.length; l < len2; l++) { 250 node = ref1[l]; 251 results1.push(this.doSync(node)); 252 } 253 return results1; 254 }).call(_this)); 255 } 256 return results; 257 }; 258 })(this)).observe(document.body, { 259 childList: true, 260 subtree: true 261 }); 262 } 263 }; 264 265 WOW.prototype.stop = function() { 266 this.stopped = true; 267 this.util().removeEvent(this.config.scrollContainer || window, 'scroll', this.scrollHandler); 268 this.util().removeEvent(window, 'resize', this.scrollHandler); 269 if (this.interval != null) { 270 return clearInterval(this.interval); 271 } 272 }; 273 274 WOW.prototype.sync = function(element) { 275 if (MutationObserver.notSupported) { 276 return this.doSync(this.element); 277 } 278 }; 279 280 WOW.prototype.doSync = function(element) { 281 var box, j, len, ref, results; 282 if (element == null) { 283 element = this.element; 284 } 285 if (element.nodeType !== 1) { 286 return; 287 } 288 element = element.parentNode || element; 289 ref = element.querySelectorAll("." + this.config.boxClass); 290 results = []; 291 for (j = 0, len = ref.length; j < len; j++) { 292 box = ref[j]; 293 if (indexOf.call(this.all, box) < 0) { 294 this.boxes.push(box); 295 this.all.push(box); 296 if (this.stopped || this.disabled()) { 297 this.resetStyle(); 298 } else { 299 this.applyStyle(box, true); 300 } 301 results.push(this.scrolled = true); 302 } else { 303 results.push(void 0); 304 } 305 } 306 return results; 307 }; 308 309 WOW.prototype.show = function(box) { 310 this.applyStyle(box); 311 box.className = box.className + " " + this.config.animateClass; 312 if (this.config.callback != null) { 313 this.config.callback(box); 314 } 315 this.util().emitEvent(box, this.wowEvent); 316 this.util().addEvent(box, 'animationend', this.resetAnimation); 317 this.util().addEvent(box, 'oanimationend', this.resetAnimation); 318 this.util().addEvent(box, 'webkitAnimationEnd', this.resetAnimation); 319 this.util().addEvent(box, 'MSAnimationEnd', this.resetAnimation); 320 return box; 321 }; 322 323 WOW.prototype.applyStyle = function(box, hidden) { 324 var delay, duration, iteration; 325 duration = box.getAttribute('data-wow-duration'); 326 delay = box.getAttribute('data-wow-delay'); 327 iteration = box.getAttribute('data-wow-iteration'); 328 return this.animate((function(_this) { 329 return function() { 330 return _this.customStyle(box, hidden, duration, delay, iteration); 331 }; 332 })(this)); 333 }; 334 335 WOW.prototype.animate = (function() { 336 if ('requestAnimationFrame' in window) { 337 return function(callback) { 338 return window.requestAnimationFrame(callback); 339 }; 340 } else { 341 return function(callback) { 342 return callback(); 343 }; 344 } 345 })(); 346 347 WOW.prototype.resetStyle = function() { 348 var box, j, len, ref, results; 349 ref = this.boxes; 350 results = []; 351 for (j = 0, len = ref.length; j < len; j++) { 352 box = ref[j]; 353 results.push(box.style.visibility = 'visible'); 354 } 355 return results; 356 }; 357 358 WOW.prototype.resetAnimation = function(event) { 359 var target; 360 if (event.type.toLowerCase().indexOf('animationend') >= 0) { 361 target = event.target || event.srcElement; 362 return target.className = target.className.replace(this.config.animateClass, '').trim(); 363 } 364 }; 365 366 WOW.prototype.customStyle = function(box, hidden, duration, delay, iteration) { 367 if (hidden) { 368 this.cacheAnimationName(box); 369 } 370 box.style.visibility = hidden ? 'hidden' : 'visible'; 371 if (duration) { 372 this.vendorSet(box.style, { 373 animationDuration: duration 374 }); 375 } 376 if (delay) { 377 this.vendorSet(box.style, { 378 animationDelay: delay 379 }); 380 } 381 if (iteration) { 382 this.vendorSet(box.style, { 383 animationIterationCount: iteration 384 }); 385 } 386 this.vendorSet(box.style, { 387 animationName: hidden ? 'none' : this.cachedAnimationName(box) 388 }); 389 return box; 390 }; 391 392 WOW.prototype.vendors = ["moz", "webkit"]; 393 394 WOW.prototype.vendorSet = function(elem, properties) { 395 var name, results, value, vendor; 396 results = []; 397 for (name in properties) { 398 value = properties[name]; 399 elem["" + name] = value; 400 results.push((function() { 401 var j, len, ref, results1; 402 ref = this.vendors; 403 results1 = []; 404 for (j = 0, len = ref.length; j < len; j++) { 405 vendor = ref[j]; 406 results1.push(elem["" + vendor + (name.charAt(0).toUpperCase()) + (name.substr(1))] = value); 407 } 408 return results1; 409 }).call(this)); 410 } 411 return results; 412 }; 413 414 WOW.prototype.vendorCSS = function(elem, property) { 415 var j, len, ref, result, style, vendor; 416 style = getComputedStyle(elem); 417 result = style.getPropertyCSSValue(property); 418 ref = this.vendors; 419 for (j = 0, len = ref.length; j < len; j++) { 420 vendor = ref[j]; 421 result = result || style.getPropertyCSSValue("-" + vendor + "-" + property); 422 } 423 return result; 424 }; 425 426 WOW.prototype.animationName = function(box) { 427 var animationName; 428 try { 429 animationName = this.vendorCSS(box, 'animation-name').cssText; 430 } catch (_error) { 431 animationName = getComputedStyle(box).getPropertyValue('animation-name'); 432 } 433 if (animationName === 'none') { 434 return ''; 435 } else { 436 return animationName; 437 } 438 }; 439 440 WOW.prototype.cacheAnimationName = function(box) { 441 return this.animationNameCache.set(box, this.animationName(box)); 442 }; 443 444 WOW.prototype.cachedAnimationName = function(box) { 445 return this.animationNameCache.get(box); 446 }; 447 448 WOW.prototype.scrollHandler = function() { 449 return this.scrolled = true; 450 }; 451 452 WOW.prototype.scrollCallback = function() { 453 var box; 454 if (this.scrolled) { 455 this.scrolled = false; 456 this.boxes = (function() { 457 var j, len, ref, results; 458 ref = this.boxes; 459 results = []; 460 for (j = 0, len = ref.length; j < len; j++) { 461 box = ref[j]; 462 if (!(box)) { 463 continue; 464 } 465 if (this.isVisible(box)) { 466 this.show(box); 467 continue; 468 } 469 results.push(box); 470 } 471 return results; 472 }).call(this); 473 if (!(this.boxes.length || this.config.live)) { 474 return this.stop(); 475 } 476 } 477 }; 478 479 WOW.prototype.offsetTop = function(element) { 480 var top; 481 while (element.offsetTop === void 0) { 482 element = element.parentNode; 483 } 484 top = element.offsetTop; 485 while (element = element.offsetParent) { 486 top += element.offsetTop; 487 } 488 return top; 489 }; 490 491 WOW.prototype.isVisible = function(box) { 492 var bottom, offset, top, viewBottom, viewTop; 493 offset = box.getAttribute('data-wow-offset') || this.config.offset; 494 viewTop = (this.config.scrollContainer && this.config.scrollContainer.scrollTop) || window.pageYOffset; 495 viewBottom = viewTop + Math.min(this.element.clientHeight, this.util().innerHeight()) - offset; 496 top = this.offsetTop(box); 497 bottom = top + box.clientHeight; 498 return top <= viewBottom && bottom >= viewTop; 499 }; 500 501 WOW.prototype.util = function() { 502 return this._util != null ? this._util : this._util = new Util(); 503 }; 504 505 WOW.prototype.disabled = function() { 506 return !this.config.mobile && this.util().isMobile(navigator.userAgent); 507 }; 508 509 return WOW; 510 511 })(); 512 513}).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.