vendor: 18,900 bytes, lines 1-519
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 if(box.getAttribute('data-wow-duration')){ 325 varduration = box.getAttribute('data-wow-duration'); 326 } 327 else{ 328 varduration = "1s"; 329 } 330 var delay, duration, iteration; 331 duration = varduration; 332 delay = box.getAttribute('data-wow-delay'); 333 iteration = box.getAttribute('data-wow-iteration'); 334 return this.animate((function(_this) { 335 return function() { 336 return _this.customStyle(box, hidden, duration, delay, iteration); 337 }; 338 })(this)); 339 }; 340 341 WOW.prototype.animate = (function() { 342 if ('requestAnimationFrame' in window) { 343 return function(callback) { 344 return window.requestAnimationFrame(callback); 345 }; 346 } else { 347 return function(callback) { 348 return callback(); 349 }; 350 } 351 })(); 352 353 WOW.prototype.resetStyle = function() { 354 var box, j, len, ref, results; 355 ref = this.boxes; 356 results = []; 357 for (j = 0, len = ref.length; j < len; j++) { 358 box = ref[j]; 359 results.push(box.style.visibility = 'visible'); 360 } 361 return results; 362 }; 363 364 WOW.prototype.resetAnimation = function(event) { 365 var target; 366 if (event.type.toLowerCase().indexOf('animationend') >= 0) { 367 target = event.target || event.srcElement; 368 return target.className = target.className.replace(this.config.animateClass, '').trim(); 369 } 370 }; 371 372 WOW.prototype.customStyle = function(box, hidden, duration, delay, iteration) { 373 if (hidden) { 374 this.cacheAnimationName(box); 375 } 376 box.style.visibility = hidden ? 'hidden' : 'visible'; 377 if (duration) { 378 this.vendorSet(box.style, { 379 animationDuration: duration 380 }); 381 } 382 if (delay) { 383 this.vendorSet(box.style, { 384 animationDelay: delay 385 }); 386 } 387 if (iteration) { 388 this.vendorSet(box.style, { 389 animationIterationCount: iteration 390 }); 391 } 392 this.vendorSet(box.style, { 393 animationName: hidden ? 'none' : this.cachedAnimationName(box) 394 }); 395 return box; 396 }; 397 398 WOW.prototype.vendors = ["moz", "webkit"]; 399 400 WOW.prototype.vendorSet = function(elem, properties) { 401 var name, results, value, vendor; 402 results = []; 403 for (name in properties) { 404 value = properties[name]; 405 elem["" + name] = value; 406 results.push((function() { 407 var j, len, ref, results1; 408 ref = this.vendors; 409 results1 = []; 410 for (j = 0, len = ref.length; j < len; j++) { 411 vendor = ref[j]; 412 results1.push(elem["" + vendor + (name.charAt(0).toUpperCase()) + (name.substr(1))] = value); 413 } 414 return results1; 415 }).call(this)); 416 } 417 return results; 418 }; 419 420 WOW.prototype.vendorCSS = function(elem, property) { 421 var j, len, ref, result, style, vendor; 422 style = getComputedStyle(elem); 423 result = style.getPropertyCSSValue(property); 424 ref = this.vendors; 425 for (j = 0, len = ref.length; j < len; j++) { 426 vendor = ref[j]; 427 result = result || style.getPropertyCSSValue("-" + vendor + "-" + property); 428 } 429 return result; 430 }; 431 432 WOW.prototype.animationName = function(box) { 433 var animationName; 434 try { 435 animationName = this.vendorCSS(box, 'animation-name').cssText; 436 } catch (_error) { 437 animationName = getComputedStyle(box).getPropertyValue('animation-name'); 438 } 439 if (animationName === 'none') { 440 return ''; 441 } else { 442 return animationName; 443 } 444 }; 445 446 WOW.prototype.cacheAnimationName = function(box) { 447 return this.animationNameCache.set(box, this.animationName(box)); 448 }; 449 450 WOW.prototype.cachedAnimationName = function(box) { 451 return this.animationNameCache.get(box); 452 }; 453 454 WOW.prototype.scrollHandler = function() { 455 return this.scrolled = true; 456 }; 457 458 WOW.prototype.scrollCallback = function() { 459 var box; 460 if (this.scrolled) { 461 this.scrolled = false; 462 this.boxes = (function() { 463 var j, len, ref, results; 464 ref = this.boxes; 465 results = []; 466 for (j = 0, len = ref.length; j < len; j++) { 467 box = ref[j]; 468 if (!(box)) { 469 continue; 470 } 471 if (this.isVisible(box)) { 472 this.show(box); 473 continue; 474 } 475 results.push(box); 476 } 477 return results; 478 }).call(this); 479 if (!(this.boxes.length || this.config.live)) { 480 return this.stop(); 481 } 482 } 483 }; 484 485 WOW.prototype.offsetTop = function(element) { 486 var top; 487 while (element.offsetTop === void 0) { 488 element = element.parentNode; 489 } 490 top = element.offsetTop; 491 while (element = element.offsetParent) { 492 top += element.offsetTop; 493 } 494 return top; 495 }; 496 497 WOW.prototype.isVisible = function(box) { 498 var bottom, offset, top, viewBottom, viewTop; 499 offset = box.getAttribute('data-wow-offset') || this.config.offset; 500 viewTop = (this.config.scrollContainer && this.config.scrollContainer.scrollTop) || window.pageYOffset; 501 viewBottom = viewTop + Math.min(this.element.clientHeight, this.util().innerHeight()) - offset; 502 top = this.offsetTop(box); 503 bottom = top + box.clientHeight; 504 return top <= viewBottom && bottom >= viewTop; 505 }; 506 507 WOW.prototype.util = function() { 508 return this._util != null ? this._util : this._util = new Util(); 509 }; 510 511 WOW.prototype.disabled = function() { 512 return !this.config.mobile && this.util().isMobile(navigator.userAgent); 513 }; 514 515 return WOW; 516 517 })(); 518 519}).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.