PageSourceSearch

https://welcometotwinpeaks.com/wp-content/plugins/ak-framework/assets/lib/jquery.waypoints.js?ver=2.9.7

js welcometotwinpeaks.com collected 2026-10-02 03:10:33 UTC 12,159 bytes, 426 lines download raw bytes

1/*!
2Waypoints - 4.0.1
3Copyright © 2011-2016 Caleb Troughton
4Licensed under the MIT license.
5https://github.com/imakewebthings/waypoints/blob/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)
12			throw new Error("No element option passed to Waypoint constructor");
13		if (!o.handler)
14			throw new Error("No handler option passed to Waypoint constructor");
15		(this.key = "waypoint-" + e),
16			(this.options = t.Adapter.extend({}, t.defaults, o)),
17			(this.element = this.options.element),
18			(this.adapter = new t.Adapter(this.element)),
19			(this.callback = o.handler),
20			(this.axis = this.options.horizontal ? "horizontal" : "vertical"),
21			(this.enabled = this.options.enabled),
22			(this.triggerPoint = null),
23			(this.group = t.Group.findOrCreate({
24				name: this.options.group,
25				axis: this.axis
26			})),
27			(this.context = t.Context.findOrCreateByElement(this.options.context)),
28			t.offsetAliases[this.options.offset] &&
29				(this.options.offset = t.offsetAliases[this.options.offset]),
30			this.group.add(this),
31			this.context.add(this),
32			(i[this.key] = this),
33			(e += 1);
34	}
35	var e = 0,
36		i = {};
37	(t.prototype.queueTrigger = function(t) {
38		this.group.queueTrigger(this, t);
39	}),
40		(t.prototype.trigger = function(t) {
41			this.enabled && this.callback && this.callback.apply(this, t);
42		}),
43		(t.prototype.destroy = function() {
44			this.context.remove(this), this.group.remove(this), delete i[this.key];
45		}),
46		(t.prototype.disable = function() {
47			return (this.enabled = !1), this;
48		}),
49		(t.prototype.enable = function() {
50			return this.context.refresh(), (this.enabled = !0), this;
51		}),
52		(t.prototype.next = function() {
53			return this.group.next(this);
54		}),
55		(t.prototype.previous = function() {
56			return this.group.previous(this);
57		}),
58		(t.invokeAll = function(t) {
59			var e = [];
60			for (var o in i) e.push(i[o]);
61			for (var n = 0, r = e.length; r > n; n++) e[n][t]();
62		}),
63		(t.destroyAll = function() {
64			t.invokeAll("destroy");
65		}),
66		(t.disableAll = function() {
67			t.invokeAll("disable");
68		}),
69		(t.enableAll = function() {
70			t.Context.refreshAll();
71			for (var e in i) i[e].enabled = !0;
72			return this;
73		}),
74		(t.refreshAll = function() {
75			t.Context.refreshAll();
76		}),
77		(t.viewportHeight = function() {
78			return window.innerHeight || document.documentElement.clientHeight;
79		}),
80		(t.viewportWidth = function() {
81			return document.documentElement.clientWidth;
82		}),
83		(t.adapters = []),
84		(t.defaults = {
85			context: window,
86			continuous: !0,
87			enabled: !0,
88			group: "default",
89			horizontal: !1,
90			offset: 0
91		}),
92		(t.offsetAliases = {
93			"bottom-in-view": function() {
94				return this.context.innerHeight() - this.adapter.outerHeight();
95			},
96			"right-in-view": function() {
97				return this.context.innerWidth() - this.adapter.outerWidth();
98			}
99		}),
100		(window.Waypoint = t);
101})(),
102	(function() {
103		"use strict";
104		function t(t) {
105			window.setTimeout(t, 1e3 / 60);
106		}
107		function e(t) {
108			(this.element = t),
109				(this.Adapter = n.Adapter),
110				(this.adapter = new this.Adapter(t)),
111				(this.key = "waypoint-context-" + i),
112				(this.didScroll = !1),
113				(this.didResize = !1),
114				(this.oldScroll = {
115					x: this.adapter.scrollLeft(),
116					y: this.adapter.scrollTop()
117				}),
118				(this.waypoints = { vertical: {}, horizontal: {} }),
119				(t.waypointContextKey = this.key),
120				(o[t.waypointContextKey] = this),
121				(i += 1),
122				n.windowContext ||
123					((n.windowContext = !0), (n.windowContext = new e(window))),
124				this.createThrottledScrollHandler(),
125				this.createThrottledResizeHandler();
126		}
127		var i = 0,
128			o = {},
129			n = window.Waypoint,
130			r = window.onload;
131		(e.prototype.add = function(t) {
132			var e = t.options.horizontal ? "horizontal" : "vertical";
133			(this.waypoints[e][t.key] = t), this.refresh();
134		}),
135			(e.prototype.checkEmpty = function() {
136				var t = this.Adapter.isEmptyObject(this.waypoints.horizontal),
137					e = this.Adapter.isEmptyObject(this.waypoints.vertical),
138					i = this.element == this.element.window;
139				t && e && !i && (this.adapter.off(".waypoints"), delete o[this.key]);
140			}),
141			(e.prototype.createThrottledResizeHandler = function() {
142				function t() {
143					e.handleResize(), (e.didResize = !1);
144				}
145				var e = this;
146				this.adapter.on("resize.waypoints", function() {
147					e.didResize || ((e.didResize = !0), n.requestAnimationFrame(t));
148				});
149			}),
150			(e.prototype.createThrottledScrollHandler = function() {
151				function t() {
152					e.handleScroll(), (e.didScroll = !1);
153				}
154				var e = this;
155				this.adapter.on("scroll.waypoints", function() {
156					(!e.didScroll || n.isTouch) &&
157						((e.didScroll = !0), n.requestAnimationFrame(t));
158				});
159			}),
160			(e.prototype.handleResize = function() {
161				n.Context.refreshAll();
162			}),
163			(e.prototype.handleScroll = function() {
164				var t = {},
165					e = {
166						horizontal: {
167							newScroll: this.adapter.scrollLeft(),
168							oldScroll: this.oldScroll.x,
169							forward: "right",
170							backward: "left"
171						},
172						vertical: {
173							newScroll: this.adapter.scrollTop(),
174							oldScroll: this.oldScroll.y,
175							forward: "down",
176							backward: "up"
177						}
178					};
179				for (var i in e) {
180					var o = e[i],
181						n = o.newScroll > o.oldScroll,
182						r = n ? o.forward : o.backward;
183					for (var s in this.waypoints[i]) {
184						var a = this.waypoints[i][s];
185						if (null !== a.triggerPoint) {
186							var l = o.oldScroll < a.triggerPoint,
187								h = o.newScroll >= a.triggerPoint,
188								p = l && h,
189								u = !l && !h;
190							(p || u) && (a.queueTrigger(r), (t[a.group.id] = a.group));
191						}
192					}
193				}
194				for (var c in t) t[c].flushTriggers();
195				this.oldScroll = { x: e.horizontal.newScroll, y: e.vertical.newScroll };
196			}),
197			(e.prototype.innerHeight = function() {
198				return this.element == this.element.window
199					? n.viewportHeight()
200					: this.adapter.innerHeight();
201			}),
202			(e.prototype.remove = function(t) {
203				delete this.waypoints[t.axis][t.key], this.checkEmpty();
204			}),
205			(e.prototype.innerWidth = function() {
206				return this.element == this.element.window
207					? n.viewportWidth()
208					: this.adapter.innerWidth();
209			}),
210			(e.prototype.destroy = function() {
211				var t = [];
212				for (var e in this.waypoints)
213					for (var i in this.waypoints[e]) t.push(this.waypoints[e][i]);
214				for (var o = 0, n = t.length; n > o; o++) t[o].destroy();
215			}),
216			(e.prototype.refresh = function() {
217				var t,
218					e = this.element == this.element.window,
219					i = e ? void 0 : this.adapter.offset(),
220					o = {};
221				this.handleScroll(),
222					(t = {
223						horizontal: {
224							contextOffset: e ? 0 : i.left,
225							contextScroll: e ? 0 : this.oldScroll.x,
226							contextDimension: this.innerWidth(),
227							oldScroll: this.oldScroll.x,
228							forward: "right",
229							backward: "left",
230							offsetProp: "left"
231						},
232						vertical: {
233							contextOffset: e ? 0 : i.top,
234							contextScroll: e ? 0 : this.oldScroll.y,
235							contextDimension: this.innerHeight(),
236							oldScroll: this.oldScroll.y,
237							forward: "down",
238							backward: "up",
239							offsetProp: "top"
240						}
241					});
242				for (var r in t) {
243					var s = t[r];
244					for (var a in this.waypoints[r]) {
245						var l,
246							h,
247							p,
248							u,
249							c,
250							d = this.waypoints[r][a],
251							f = d.options.offset,
252							w = d.triggerPoint,
253							y = 0,
254							g = null == w;
255						d.element !== d.element.window &&
256							(y = d.adapter.offset()[s.offsetProp]),
257							"function" == typeof f
258								? (f = f.apply(d))
259								: "string" == typeof f &&
260								  ((f = parseFloat(f)),
261								  d.options.offset.indexOf("%") > -1 &&
262										(f = Math.ceil((s.contextDimension * f) / 100))),
263							(l = s.contextScroll - s.contextOffset),
264							(d.triggerPoint = Math.floor(y + l - f)),
265							(h = w < s.oldScroll),
266							(p = d.triggerPoint >= s.oldScroll),
267							(u = h && p),
268							(c = !h && !p),
269							!g && u
270								? (d.queueTrigger(s.backward), (o[d.group.id] = d.group))
271								: !g && c
272								? (d.queueTrigger(s.forward), (o[d.group.id] = d.group))
273								: g &&
274								  s.oldScroll >= d.triggerPoint &&
275								  (d.queueTrigger(s.forward), (o[d.group.id] = d.group));
276					}
277				}
278				return (
279					n.requestAnimationFrame(function() {
280						for (var t in o) o[t].flushTriggers();
281					}),
282					this
283				);
284			}),
285			(e.findOrCreateByElement = function(t) {
286				return e.findByElement(t) || new e(t);
287			}),
288			(e.refreshAll = function() {
289				for (var t in o) o[t].refresh();
290			}),
291			(e.findByElement = function(t) {
292				return o[t.waypointContextKey];
293			}),
294			(window.onload = function() {
295				r && r(), e.refreshAll();
296			}),
297			(n.requestAnimationFrame = function(e) {
298				var i =
299					window.requestAnimationFrame ||
300					window.mozRequestAnimationFrame ||
301					window.webkitRequestAnimationFrame ||
302					t;
303				i.call(window, e);
304			}),
305			(n.Context = e);
306	})(),
307	(function() {
308		"use strict";
309		function t(t, e) {
310			return t.triggerPoint - e.triggerPoint;
311		}
312		function e(t, e) {
313			return e.triggerPoint - t.triggerPoint;
314		}
315		function i(t) {
316			(this.name = t.name),
317				(this.axis = t.axis),
318				(this.id = this.name + "-" + this.axis),
319				(this.waypoints = []),
320				this.clearTriggerQueues(),
321				(o[this.axis][this.name] = this);
322		}
323		var o = { vertical: {}, horizontal: {} },
324			n = window.Waypoint;
325		(i.prototype.add = function(t) {
326			this.waypoints.push(t);
327		}),
328			(i.prototype.clearTriggerQueues = function() {
329				this.triggerQueues = { up: [], down: [], left: [], right: [] };
330			}),
331			(i.prototype.flushTriggers = function() {
332				for (var i in this.triggerQueues) {
333					var o = this.triggerQueues[i],
334						n = "up" === i || "left" === i;
335					o.sort(n ? e : t);
336					for (var r = 0, s = o.length; s > r; r += 1) {
337						var a = o[r];
338						(a.options.continuous || r === o.length - 1) && a.trigger([i]);
339					}
340				}
341				this.clearTriggerQueues();
342			}),
343			(i.prototype.next = function(e) {
344				this.waypoints.sort(t);
345				var i = n.Adapter.inArray(e, this.waypoints),
346					o = i === this.waypoints.length - 1;
347				return o ? null : this.waypoints[i + 1];
348			}),
349			(i.prototype.previous = function(e) {
350				this.waypoints.sort(t);
351				var i = n.Adapter.inArray(e, this.waypoints);
352				return i ? this.waypoints[i - 1] : null;
353			}),
354			(i.prototype.queueTrigger = function(t, e) {
355				this.triggerQueues[e].push(t);
356			}),
357			(i.prototype.remove = function(t) {
358				var e = n.Adapter.inArray(t, this.waypoints);
359				e > -1 && this.waypoints.splice(e, 1);
360			}),
361			(i.prototype.first = function() {
362				return this.waypoints[0];
363			}),
364			(i.prototype.last = function() {
365				return this.waypoints[this.waypoints.length - 1];
366			}),
367			(i.findOrCreate = function(t) {
368				return o[t.axis][t.name] || new i(t);
369			}),
370			(n.Group = i);
371	})(),
372	(function() {
373		"use strict";
374		function t(t) {
375			this.$element = e(t);
376		}
377		var e = window.jQuery,
378			i = window.Waypoint;
379		e.each(
380			[
381				"innerHeight",
382				"innerWidth",
383				"off",
384				"offset",
385				"on",
386				"outerHeight",
387				"outerWidth",
388				"scrollLeft",
389				"scrollTop"
390			],
391			function(e, i) {
392				t.prototype[i] = function() {
393					var t = Array.prototype.slice.call(arguments);
394					return this.$element[i].apply(this.$element, t);
395				};
396			}
397		),
398			e.each(["extend", "inArray", "isEmptyObject"], function(i, o) {
399				t[o] = e[o];
400			}),
401			i.adapters.push({ name: "jquery", Adapter: t }),
402			(i.Adapter = t);
403	})(),
404	(function() {
405		"use strict";
406		function t(t) {
407			return function() {
408				var i = [],
409					o = arguments[0];
410				return (
411					t.isFunction(arguments[0]) &&
412						((o = t.extend({}, arguments[1])), (o.handler = arguments[0])),
413					this.each(function() {
414						var n = t.extend({}, o, { element: this });
415						"string" == typeof n.context &&
416							(n.context = t(this).closest(n.context)[0]),
417							i.push(new e(n));
418					}),
419					i
420				);
421			};
422		}
423		var e = window.Waypoint;
424		window.jQuery && (window.jQuery.fn.waypoint = t(window.jQuery)),
425			window.Zepto && (window.Zepto.fn.waypoint = t(window.Zepto));
426	})();

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.