PageSourceSearch

https://www.popukraine.com/wp-content/themes/zound/assets/js/waypoint.js?ver=1.6.2

js popukraine.com collected 2026-10-03 02:40:11 UTC 16,860 bytes, 444 lines download raw bytes

vendor: 16,860 bytes, lines 1-444
1// Generated by CoffeeScript 1.6.2
2/*!
3jQuery Waypoints - v2.0.5
4Copyright (c) 2011-2014 Caleb Troughton
5Licensed under the MIT license.
6https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt
7*/
8(function () {
9    var t =
10            [].indexOf ||
11            function (t) {
12                for (var e = 0, n = this.length; e < n; e++) {
13                    if (e in this && this[e] === t) return e;
14                }
15                return -1;
16            },
17        e = [].slice;
18    (function (t, e) {
19        if (typeof define === "function" && define.amd) {
20            return define("waypoints", ["jquery"], function (n) {
21                return e(n, t);
22            });
23        } else {
24            return e(t.jQuery, t);
25        }
26    })(window, function (n, r) {
27        var i, o, l, s, f, u, c, a, h, d, p, y, v, w, g, m;
28        i = n(r);
29        a = t.call(r, "ontouchstart") >= 0;
30        s = { horizontal: {}, vertical: {} };
31        f = 1;
32        c = {};
33        u = "waypoints-context-id";
34        p = "resize.waypoints";
35        y = "scroll.waypoints";
36        v = 1;
37        w = "waypoints-waypoint-ids";
38        g = "waypoint";
39        m = "waypoints";
40        o = (function () {
41            function t(t) {
42                var e = this;
43                this.$element = t;
44                this.element = t[0];
45                this.didResize = false;
46                this.didScroll = false;
47                this.id = "context" + f++;
48                this.oldScroll = { x: t.scrollLeft(), y: t.scrollTop() };
49                this.waypoints = { horizontal: {}, vertical: {} };
50                this.element[u] = this.id;
51                c[this.id] = this;
52                t.bind(y, function () {
53                    var t;
54                    if (!(e.didScroll || a)) {
55                        e.didScroll = true;
56                        t = function () {
57                            e.doScroll();
58                            return (e.didScroll = false);
59                        };
60                        return r.setTimeout(t, n[m].settings.scrollThrottle);
61                    }
62                });
63                t.bind(p, function () {
64                    var t;
65                    if (!e.didResize) {
66                        e.didResize = true;
67                        t = function () {
68                            n[m]("refresh");
69                            return (e.didResize = false);
70                        };
71                        return r.setTimeout(t, n[m].settings.resizeThrottle);
72                    }
73                });
74            }
75            t.prototype.doScroll = function () {
76                var t,
77                    e = this;
78                t = {
79                    horizontal: { newScroll: this.$element.scrollLeft(), oldScroll: this.oldScroll.x, forward: "right", backward: "left" },
80                    vertical: { newScroll: this.$element.scrollTop(), oldScroll: this.oldScroll.y, forward: "down", backward: "up" },
81                };
82                if (a && (!t.vertical.oldScroll || !t.vertical.newScroll)) {
83                    n[m]("refresh");
84                }
85                n.each(t, function (t, r) {
86                    var i, o, l;
87                    l = [];
88                    o = r.newScroll > r.oldScroll;
89                    i = o ? r.forward : r.backward;
90                    n.each(e.waypoints[t], function (t, e) {
91                        var n, i;
92                        if (r.oldScroll < (n = e.offset) && n <= r.newScroll) {
93                            return l.push(e);
94                        } else if (r.newScroll < (i = e.offset) && i <= r.oldScroll) {
95                            return l.push(e);
96                        }
97                    });
98                    l.sort(function (t, e) {
99                        return t.offset - e.offset;
100                    });
101                    if (!o) {
102                        l.reverse();
103                    }
104                    return n.each(l, function (t, e) {
105                        if (e.options.continuous || t === l.length - 1) {
106                            return e.trigger([i]);
107                        }
108                    });
109                });
110                return (this.oldScroll = { x: t.horizontal.newScroll, y: t.vertical.newScroll });
111            };
112            t.prototype.refresh = function () {
113                var t,
114                    e,
115                    r,
116                    i = this;
117                r = n.isWindow(this.element);
118                e = this.$element.offset();
119                this.doScroll();
120                t = {
121                    horizontal: { contextOffset: r ? 0 : e.left, contextScroll: r ? 0 : this.oldScroll.x, contextDimension: this.$element.width(), oldScroll: this.oldScroll.x, forward: "right", backward: "left", offsetProp: "left" },
122                    vertical: {
123                        contextOffset: r ? 0 : e.top,
124                        contextScroll: r ? 0 : this.oldScroll.y,
125                        contextDimension: r ? n[m]("viewportHeight") : this.$element.height(),
126                        oldScroll: this.oldScroll.y,
127                        forward: "down",
128                        backward: "up",
129                        offsetProp: "top",
130                    },
131                };
132                return n.each(t, function (t, e) {
133                    return n.each(i.waypoints[t], function (t, r) {
134                        var i, o, l, s, f;
135                        i = r.options.offset;
136                        l = r.offset;
137                        o = n.isWindow(r.element) ? 0 : r.$element.offset()[e.offsetProp];
138                        if (n.isFunction(i)) {
139                            i = i.apply(r.element);
140                        } else if (typeof i === "string") {
141                            i = parseFloat(i);
142                            if (r.options.offset.indexOf("%") > -1) {
143                                i = Math.ceil((e.contextDimension * i) / 100);
144                            }
145                        }
146                        r.offset = o - e.contextOffset + e.contextScroll - i;
147                        if ((r.options.onlyOnScroll && l != null) || !r.enabled) {
148                            return;
149                        }
150                        if (l !== null && l < (s = e.oldScroll) && s <= r.offset) {
151                            return r.trigger([e.backward]);
152                        } else if (l !== null && l > (f = e.oldScroll) && f >= r.offset) {
153                            return r.trigger([e.forward]);
154                        } else if (l === null && e.oldScroll >= r.offset) {
155                            return r.trigger([e.forward]);
156                        }
157                    });
158                });
159            };
160            t.prototype.checkEmpty = function () {
161                if (n.isEmptyObject(this.waypoints.horizontal) && n.isEmptyObject(this.waypoints.vertical)) {
162                    this.$element.unbind([p, y].join(" "));
163                    return delete c[this.id];
164                }
165            };
166            return t;
167        })();
168        l = (function () {
169            function t(t, e, r) {
170                var i, o;
171                if (r.offset === "bottom-in-view") {
172                    r.offset = function () {
173                        var t;
174                        t = n[m]("viewportHeight");
175                        if (!n.isWindow(e.element)) {
176                            t = e.$element.height();
177                        }
178                        return t - n(this).outerHeight();
179                    };
180                }
181                this.$element = t;
182                this.element = t[0];
183                this.axis = r.horizontal ? "horizontal" : "vertical";
184                this.callback = r.handler;
185                this.context = e;
186                this.enabled = r.enabled;
187                this.id = "waypoints" + v++;
188                this.offset = null;
189                this.options = r;
190                e.waypoints[this.axis][this.id] = this;
191                s[this.axis][this.id] = this;
192                i = (o = this.element[w]) != null ? o : [];
193                i.push(this.id);
194                this.element[w] = i;
195            }
196            t.prototype.trigger = function (t) {
197                if (!this.enabled) {
198                    return;
199                }
200                if (this.callback != null) {
201                    this.callback.apply(this.element, t);
202                }
203                if (this.options.triggerOnce) {
204                    return this.destroy();
205                }
206            };
207            t.prototype.disable = function () {
208                return (this.enabled = false);
209            };
210            t.prototype.enable = function () {
211                this.context.refresh();
212                return (this.enabled = true);
213            };
214            t.prototype.destroy = function () {
215                delete s[this.axis][this.id];
216                delete this.context.waypoints[this.axis][this.id];
217                return this.context.checkEmpty();
218            };
219            t.getWaypointsByElement = function (t) {
220                var e, r;
221                r = t[w];
222                if (!r) {
223                    return [];
224                }
225                e = n.extend({}, s.horizontal, s.vertical);
226                return n.map(r, function (t) {
227                    return e[t];
228                });
229            };
230            return t;
231        })();
232        d = {
233            init: function (t, e) {
234                var r;
235                e = n.extend({}, n.fn[g].defaults, e);
236                if ((r = e.handler) == null) {
237                    e.handler = t;
238                }
239                this.each(function () {
240                    var t, r, i, s;
241                    t = n(this);
242                    i = (s = e.context) != null ? s : n.fn[g].defaults.context;
243                    if (!n.isWindow(i)) {
244                        i = t.closest(i);
245                    }
246                    i = n(i);
247                    r = c[i[0][u]];
248                    if (!r) {
249                        r = new o(i);
250                    }
251                    return new l(t, r, e);
252                });
253                n[m]("refresh");
254                return this;
255            },
256            disable: function () {
257                return d._invoke.call(this, "disable");
258            },
259            enable: function () {
260                return d._invoke.call(this, "enable");
261            },
262            destroy: function () {
263                return d._invoke.call(this, "destroy");
264            },
265            prev: function (t, e) {
266                return d._traverse.call(this, t, e, function (t, e, n) {
267                    if (e > 0) {
268                        return t.push(n[e - 1]);
269                    }
270                });
271            },
272            next: function (t, e) {
273                return d._traverse.call(this, t, e, function (t, e, n) {
274                    if (e < n.length - 1) {
275                        return t.push(n[e + 1]);
276                    }
277                });
278            },
279            _traverse: function (t, e, i) {
280                var o, l;
281                if (t == null) {
282                    t = "vertical";
283                }
284                if (e == null) {
285                    e = r;
286                }
287                l = h.aggregate(e);
288                o = [];
289                this.each(function () {
290                    var e;
291                    e = n.inArray(this, l[t]);
292                    return i(o, e, l[t]);
293                });
294                return this.pushStack(o);
295            },
296            _invoke: function (t) {
297                this.each(function () {
298                    var e;
299                    e = l.getWaypointsByElement(this);
300                    return n.each(e, function (e, n) {
301                        n[t]();
302                        return true;
303                    });
304                });
305                return this;
306            },
307        };
308        n.fn[g] = function () {
309            var t, r;
310            (r = arguments[0]), (t = 2 <= arguments.length ? e.call(arguments, 1) : []);
311            if (d[r]) {
312                return d[r].apply(this, t);
313            } else if (n.isFunction(r)) {
314                return d.init.apply(this, arguments);
315            } else if (n.isPlainObject(r)) {
316                return d.init.apply(this, [null, r]);
317            } else if (!r) {
318                return n.error("jQuery Waypoints needs a callback function or handler option.");
319            } else {
320                return n.error("The " + r + " method does not exist in jQuery Waypoints.");
321            }
322        };
323        n.fn[g].defaults = { context: r, continuous: true, enabled: true, horizontal: false, offset: 0, triggerOnce: false };
324        h = {
325            refresh: function () {
326                return n.each(c, function (t, e) {
327                    return e.refresh();
328                });
329            },
330            viewportHeight: function () {
331                var t;
332                return (t = r.innerHeight) != null ? t : i.height();
333            },
334            aggregate: function (t) {
335                var e, r, i;
336                e = s;
337                if (t) {
338                    e = (i = c[n(t)[0][u]]) != null ? i.waypoints : void 0;
339                }
340                if (!e) {
341                    return [];
342                }
343                r = { horizontal: [], vertical: [] };
344                n.each(r, function (t, i) {
345                    n.each(e[t], function (t, e) {
346                        return i.push(e);
347                    });
348                    i.sort(function (t, e) {
349                        return t.offset - e.offset;
350                    });
351                    r[t] = n.map(i, function (t) {
352                        return t.element;
353                    });
354                    return (r[t] = n.unique(r[t]));
355                });
356                return r;
357            },
358            above: function (t) {
359                if (t == null) {
360                    t = r;
361                }
362                return h._filter(t, "vertical", function (t, e) {
363                    return e.offset <= t.oldScroll.y;
364                });
365            },
366            below: function (t) {
367                if (t == null) {
368                    t = r;
369                }
370                return h._filter(t, "vertical", function (t, e) {
371                    return e.offset > t.oldScroll.y;
372                });
373            },
374            left: function (t) {
375                if (t == null) {
376                    t = r;
377                }
378                return h._filter(t, "horizontal", function (t, e) {
379                    return e.offset <= t.oldScroll.x;
380                });
381            },
382            right: function (t) {
383                if (t == null) {
384                    t = r;
385                }
386                return h._filter(t, "horizontal", function (t, e) {
387                    return e.offset > t.oldScroll.x;
388                });
389            },
390            enable: function () {
391                return h._invoke("enable");
392            },
393            disable: function () {
394                return h._invoke("disable");
395            },
396            destroy: function () {
397                return h._invoke("destroy");
398            },
399            extendFn: function (t, e) {
400                return (d[t] = e);
401            },
402            _invoke: function (t) {
403                var e;
404                e = n.extend({}, s.vertical, s.horizontal);
405                return n.each(e, function (e, n) {
406                    n[t]();
407                    return true;
408                });
409            },
410            _filter: function (t, e, r) {
411                var i, o;
412                i = c[n(t)[0][u]];
413                if (!i) {
414                    return [];
415                }
416                o = [];
417                n.each(i.waypoints[e], function (t, e) {
418                    if (r(i, e)) {
419                        return o.push(e);
420                    }
421                });
422                o.sort(function (t, e) {
423                    return t.offset - e.offset;
424                });
425                return n.map(o, function (t) {
426                    return t.element;
427                });
428            },
429        };
430        n[m] = function () {
431            var t, n;
432            (n = arguments[0]), (t = 2 <= arguments.length ? e.call(arguments, 1) : []);
433            if (h[n]) {
434                return h[n].apply(null, t);
435            } else {
436                return h.aggregate.call(null, n);
437            }
438        };
439        n[m].settings = { resizeThrottle: 100, scrollThrottle: 30 };
440        return i.on("load.waypoints", function () {
441            return n[m]("refresh");
442        });
443    });
444}.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.