PageSourceSearch

https://www.sellwell-hk.com/js/wow.js

js sellwell-hk.com collected 2026-10-09 00:52:52 UTC 16,632 bytes, 409 lines download raw bytes

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