PageSourceSearch

https://www.portage.es/wp-content/themes/bootframe-core/assets/js/jquery.waypoints.min.js

js portage.es collected 2026-10-08 22:51:08 UTC 11,653 bytes, 253 lines download raw bytes

vendor: 11,653 bytes, lines 1-253
1/*!
2 Waypoints - 3.0.0
3 Copyright © 2011-2014 Caleb Troughton
4 Licensed under the MIT license.
5 https://github.com/imakewebthings/waypoints/blog/master/licenses.txt
6 */
7!function () {
8    "use strict";
9    function t(o) {
10        if (!o)throw new Error("No options passed to Waypoint constructor");
11        if (!o.element)throw new Error("No element option passed to Waypoint constructor");
12        if (!o.handler)throw new Error("No handler option passed to Waypoint constructor");
13        this.key = "waypoint-" + e, this.options = t.Adapter.extend({}, t.defaults, o), this.element = this.options.element, this.adapter = new t.Adapter(this.element), this.callback = o.handler, this.axis = this.options.horizontal ? "horizontal" : "vertical", this.enabled = this.options.enabled, this.triggerPoint = null, this.group = t.Group.findOrCreate({
14            name: this.options.group,
15            axis: this.axis
16        }), this.context = t.Context.findOrCreateByElement(this.options.context), t.offsetAliases[this.options.offset] && (this.options.offset = t.offsetAliases[this.options.offset]), this.group.add(this), this.context.add(this), i[this.key] = this, e += 1
17    }
18
19    var e = 0, i = {};
20    t.prototype.queueTrigger = function (t) {
21        this.group.queueTrigger(this, t)
22    }, t.prototype.trigger = function (t) {
23        this.enabled && this.callback && this.callback.apply(this, t)
24    }, t.prototype.destroy = function () {
25        this.context.remove(this), this.group.remove(this), delete i[this.key]
26    }, t.prototype.disable = function () {
27        return this.enabled = !1, this
28    }, t.prototype.enable = function () {
29        return this.context.refresh(), this.enabled = !0, this
30    }, t.prototype.next = function () {
31        return this.group.next(this)
32    }, t.prototype.previous = function () {
33        return this.group.previous(this)
34    }, t.destroyAll = function () {
35        var t = [];
36        for (var e in i)t.push(i[e]);
37        for (var o = 0, r = t.length; r > o; o++)t[o].destroy()
38    }, t.refreshAll = function () {
39        t.Context.refreshAll()
40    }, t.viewportHeight = function () {
41        return window.innerHeight || document.documentElement.clientHeight
42    }, t.viewportWidth = function () {
43        return document.documentElement.clientWidth
44    }, t.adapters = [], t.defaults = {
45        context: window,
46        continuous: !0,
47        enabled: !0,
48        group: "default",
49        horizontal: !1,
50        offset: 0
51    }, t.offsetAliases = {
52        "bottom-in-view": function () {
53            return this.context.innerHeight() - this.adapter.outerHeight()
54        }, "right-in-view": function () {
55            return this.context.innerWidth() - this.adapter.outerWidth()
56        }
57    }, window.Waypoint = t
58}(), function () {
59    "use strict";
60    function t(t) {
61        window.setTimeout(t, 1e3 / 60)
62    }
63
64    function e(t) {
65        this.element = t, this.Adapter = r.Adapter, this.adapter = new this.Adapter(t), this.key = "waypoint-context-" + i, this.didScroll = !1, this.didResize = !1, this.oldScroll = {
66            x: this.adapter.scrollLeft(),
67            y: this.adapter.scrollTop()
68        }, this.waypoints = {
69            vertical: {},
70            horizontal: {}
71        }, t.waypointContextKey = this.key, o[t.waypointContextKey] = this, i += 1, this.createThrottledScrollHandler(), this.createThrottledResizeHandler()
72    }
73
74    var i = 0, o = {}, r = window.Waypoint, n = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || t, s = window.onload;
75    e.prototype.add = function (t) {
76        var e = t.options.horizontal ? "horizontal" : "vertical";
77        this.waypoints[e][t.key] = t, this.refresh()
78    }, e.prototype.checkEmpty = function () {
79        var t = this.Adapter.isEmptyObject(this.waypoints.horizontal), e = this.Adapter.isEmptyObject(this.waypoints.vertical);
80        t && e && (this.adapter.off(".waypoints"), delete o[this.key])
81    }, e.prototype.createThrottledResizeHandler = function () {
82        function t() {
83            e.handleResize(), e.didResize = !1
84        }
85
86        var e = this;
87        this.adapter.on("resize.waypoints", function () {
88            e.didResize || (e.didResize = !0, n(t))
89        })
90    }, e.prototype.createThrottledScrollHandler = function () {
91        function t() {
92            e.handleScroll(), e.didScroll = !1
93        }
94
95        var e = this;
96        this.adapter.on("scroll.waypoints", function () {
97            (!e.didScroll || r.isTouch) && (e.didScroll = !0, n(t))
98        })
99    }, e.prototype.handleResize = function () {
100        r.Context.refreshAll()
101    }, e.prototype.handleScroll = function () {
102        var t = {}, e = {
103            horizontal: {
104                newScroll: this.adapter.scrollLeft(),
105                oldScroll: this.oldScroll.x,
106                forward: "right",
107                backward: "left"
108            },
109            vertical: {
110                newScroll: this.adapter.scrollTop(),
111                oldScroll: this.oldScroll.y,
112                forward: "down",
113                backward: "up"
114            }
115        };
116        for (var i in e) {
117            var o = e[i], r = o.newScroll > o.oldScroll, n = r ? o.forward : o.backward;
118            for (var s in this.waypoints[i]) {
119                var a = this.waypoints[i][s], l = o.oldScroll < a.triggerPoint, h = o.newScroll >= a.triggerPoint, p = l && h, u = !l && !h;
120                (p || u) && (a.queueTrigger(n), t[a.group.id] = a.group)
121            }
122        }
123        for (var c in t)t[c].flushTriggers();
124        this.oldScroll = {x: e.horizontal.newScroll, y: e.vertical.newScroll}
125    }, e.prototype.innerHeight = function () {
126        return this.element === this.element.window ? r.viewportHeight() : this.adapter.innerHeight()
127    }, e.prototype.remove = function (t) {
128        delete this.waypoints[t.axis][t.key], this.checkEmpty()
129    }, e.prototype.innerWidth = function () {
130        return this.element === this.element.window ? r.viewportWidth() : this.adapter.innerWidth()
131    }, e.prototype.destroy = function () {
132        var t = [];
133        for (var e in this.waypoints)for (var i in this.waypoints[e])t.push(this.waypoints[e][i]);
134        for (var o = 0, r = t.length; r > o; o++)t[o].destroy()
135    }, e.prototype.refresh = function () {
136        var t, e = this.element === this.element.window, i = this.adapter.offset(), o = {};
137        this.handleScroll(), t = {
138            horizontal: {
139                contextOffset: e ? 0 : i.left,
140                contextScroll: e ? 0 : this.oldScroll.x,
141                contextDimension: this.innerWidth(),
142                oldScroll: this.oldScroll.x,
143                forward: "right",
144                backward: "left",
145                offsetProp: "left"
146            },
147            vertical: {
148                contextOffset: e ? 0 : i.top,
149                contextScroll: e ? 0 : this.oldScroll.y,
150                contextDimension: this.innerHeight(),
151                oldScroll: this.oldScroll.y,
152                forward: "down",
153                backward: "up",
154                offsetProp: "top"
155            }
156        };
157        for (var r in t) {
158            var n = t[r];
159            for (var s in this.waypoints[r]) {
160                var a, l, h, p, u, c = this.waypoints[r][s], d = c.options.offset, f = c.triggerPoint, w = 0, y = null == f;
161                c.element !== c.element.window && (w = c.adapter.offset()[n.offsetProp]), "function" == typeof d ? d = d.apply(c) : "string" == typeof d && (d = parseFloat(d), c.options.offset.indexOf("%") > -1 && (d = Math.ceil(n.contextDimension * d / 100))), a = n.contextScroll - n.contextOffset, c.triggerPoint = w + a - d, l = f < n.oldScroll, h = c.triggerPoint >= n.oldScroll, p = l && h, u = !l && !h, !y && p ? (c.queueTrigger(n.backward), o[c.group.id] = c.group) : !y && u ? (c.queueTrigger(n.forward), o[c.group.id] = c.group) : y && n.oldScroll >= c.triggerPoint && (c.queueTrigger(n.forward), o[c.group.id] = c.group)
162            }
163        }
164        for (var g in o)o[g].flushTriggers();
165        return this
166    }, e.findOrCreateByElement = function (t) {
167        return e.findByElement(t) || new e(t)
168    }, e.refreshAll = function () {
169        for (var t in o)o[t].refresh()
170    }, e.findByElement = function (t) {
171        return o[t.waypointContextKey]
172    }, window.onload = function () {
173        s && s(), e.refreshAll()
174    }, r.Context = e
175}(), function () {
176    "use strict";
177    function t(t, e) {
178        return t.triggerPoint - e.triggerPoint
179    }
180
181    function e(t, e) {
182        return e.triggerPoint - t.triggerPoint
183    }
184
185    function i(t) {
186        this.name = t.name, this.axis = t.axis, this.id = this.name + "-" + this.axis, this.waypoints = [], this.clearTriggerQueues(), o[this.axis][this.name] = this
187    }
188
189    var o = {vertical: {}, horizontal: {}}, r = window.Waypoint;
190    i.prototype.add = function (t) {
191        this.waypoints.push(t)
192    }, i.prototype.clearTriggerQueues = function () {
193        this.triggerQueues = {up: [], down: [], left: [], right: []}
194    }, i.prototype.flushTriggers = function () {
195        for (var i in this.triggerQueues) {
196            var o = this.triggerQueues[i], r = "up" === i || "left" === i;
197            o.sort(r ? e : t);
198            for (var n = 0, s = o.length; s > n; n += 1) {
199                var a = o[n];
200                (a.options.continuous || n === o.length - 1) && a.trigger([i])
201            }
202        }
203        this.clearTriggerQueues()
204    }, i.prototype.next = function (e) {
205        this.waypoints.sort(t);
206        var i = r.Adapter.inArray(e, this.waypoints), o = i === this.waypoints.length - 1;
207        return o ? null : this.waypoints[i + 1]
208    }, i.prototype.previous = function (e) {
209        this.waypoints.sort(t);
210        var i = r.Adapter.inArray(e, this.waypoints);
211        return i ? this.waypoints[i - 1] : null
212    }, i.prototype.queueTrigger = function (t, e) {
213        this.triggerQueues[e].push(t)
214    }, i.prototype.remove = function (t) {
215        var e = r.Adapter.inArray(t, this.waypoints);
216        e > -1 && this.waypoints.splice(e, 1)
217    }, i.prototype.first = function () {
218        return this.waypoints[0]
219    }, i.prototype.last = function () {
220        return this.waypoints[this.waypoints.length - 1]
221    }, i.findOrCreate = function (t) {
222        return o[t.axis][t.name] || new i(t)
223    }, r.Group = i
224}(), function () {
225    "use strict";
226    function t(t) {
227        this.$element = e(t)
228    }
229
230    var e = window.jQuery, i = window.Waypoint;
231    e.each(["innerHeight", "innerWidth", "off", "offset", "on", "outerHeight", "outerWidth", "scrollLeft", "scrollTop"], function (e, i) {
232        t.prototype[i] = function () {
233            var t = Array.prototype.slice.call(arguments);
234            return this.$element[i].apply(this.$element, t)
235        }
236    }), e.each(["extend", "inArray", "isEmptyObject"], function (i, o) {
237        t[o] = e[o]
238    }), i.adapters.push({name: "jquery", Adapter: t}), i.Adapter = t
239}(), function () {
240    "use strict";
241    function t(t) {
242        return function () {
243            var i = [], o = arguments[0];
244            return t.isFunction(arguments[0]) && (o = t.extend({}, arguments[1]), o.handler = arguments[0]), this.each(function () {
245                var r = t.extend({}, o, {element: this});
246                "string" == typeof r.context && (r.context = t(this).closest(r.context)[0]), i.push(new e(r))
247            }), i
248        }
249    }
250
251    var e = window.Waypoint;
252    window.jQuery && (window.jQuery.fn.waypoint = t(window.jQuery)), window.Zepto && (window.Zepto.fn.waypoint = t(window.Zepto))
253}();

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.