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