PageSourceSearch

https://puntadeleste.org/wp-content/cache/min/1/wp-content/plugins…/jquery.waypoints.js?ver=1739889989

js puntadeleste.org collected 2026-10-03 00:03:23 UTC 12,611 bytes, 206 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(){'use strict'
8var keyCounter=0
9var allWaypoints={}
10function Waypoint(options){if(!options){throw new Error('No options passed to Waypoint constructor')}
11if(!options.element){throw new Error('No element option passed to Waypoint constructor')}
12if(!options.handler){throw new Error('No handler option passed to Waypoint constructor')}
13this.key='waypoint-'+keyCounter
14this.options=Waypoint.Adapter.extend({},Waypoint.defaults,options)
15this.element=this.options.element
16this.adapter=new Waypoint.Adapter(this.element)
17this.callback=options.handler
18this.axis=this.options.horizontal?'horizontal':'vertical'
19this.enabled=this.options.enabled
20this.triggerPoint=null
21this.group=Waypoint.Group.findOrCreate({name:this.options.group,axis:this.axis})
22this.context=Waypoint.Context.findOrCreateByElement(this.options.context)
23if(Waypoint.offsetAliases[this.options.offset]){this.options.offset=Waypoint.offsetAliases[this.options.offset]}
24this.group.add(this)
25this.context.add(this)
26allWaypoints[this.key]=this
27keyCounter+=1}
28Waypoint.prototype.queueTrigger=function(direction){this.group.queueTrigger(this,direction)}
29Waypoint.prototype.trigger=function(args){if(!this.enabled){return}
30if(this.callback){this.callback.apply(this,args)}}
31Waypoint.prototype.destroy=function(){this.context.remove(this)
32this.group.remove(this)
33delete allWaypoints[this.key]}
34Waypoint.prototype.disable=function(){this.enabled=!1
35return this}
36Waypoint.prototype.enable=function(){this.context.refresh()
37this.enabled=!0
38return this}
39Waypoint.prototype.next=function(){return this.group.next(this)}
40Waypoint.prototype.previous=function(){return this.group.previous(this)}
41Waypoint.invokeAll=function(method){var allWaypointsArray=[]
42for(var waypointKey in allWaypoints){allWaypointsArray.push(allWaypoints[waypointKey])}
43for(var i=0,end=allWaypointsArray.length;i<end;i++){allWaypointsArray[i][method]()}}
44Waypoint.destroyAll=function(){Waypoint.invokeAll('destroy')}
45Waypoint.disableAll=function(){Waypoint.invokeAll('disable')}
46Waypoint.enableAll=function(){Waypoint.Context.refreshAll()
47for(var waypointKey in allWaypoints){allWaypoints[waypointKey].enabled=!0}
48return this}
49Waypoint.refreshAll=function(){Waypoint.Context.refreshAll()}
50Waypoint.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight}
51Waypoint.viewportWidth=function(){return document.documentElement.clientWidth}
52Waypoint.adapters=[]
53Waypoint.defaults={context:window,continuous:!0,enabled:!0,group:'default',horizontal:!1,offset:0}
54Waypoint.offsetAliases={'bottom-in-view':function(){return this.context.innerHeight()-this.adapter.outerHeight()},'right-in-view':function(){return this.context.innerWidth()-this.adapter.outerWidth()}}
55window.Waypoint=Waypoint}());(function(){'use strict'
56function requestAnimationFrameShim(callback){window.setTimeout(callback,1000/60)}
57var keyCounter=0
58var contexts={}
59var Waypoint=window.Waypoint
60var oldWindowLoad=window.onload
61function Context(element){this.element=element
62this.Adapter=Waypoint.Adapter
63this.adapter=new this.Adapter(element)
64this.key='waypoint-context-'+keyCounter
65this.didScroll=!1
66this.didResize=!1
67this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()}
68this.waypoints={vertical:{},horizontal:{}}
69element.waypointContextKey=this.key
70contexts[element.waypointContextKey]=this
71keyCounter+=1
72if(!Waypoint.windowContext){Waypoint.windowContext=!0
73Waypoint.windowContext=new Context(window)}
74this.createThrottledScrollHandler()
75this.createThrottledResizeHandler()}
76Context.prototype.add=function(waypoint){var axis=waypoint.options.horizontal?'horizontal':'vertical'
77this.waypoints[axis][waypoint.key]=waypoint
78this.refresh()}
79Context.prototype.checkEmpty=function(){var horizontalEmpty=this.Adapter.isEmptyObject(this.waypoints.horizontal)
80var verticalEmpty=this.Adapter.isEmptyObject(this.waypoints.vertical)
81var isWindow=this.element==this.element.window
82if(horizontalEmpty&&verticalEmpty&&!isWindow){this.adapter.off('.waypoints')
83delete contexts[this.key]}}
84Context.prototype.createThrottledResizeHandler=function(){var self=this
85function resizeHandler(){self.handleResize()
86self.didResize=!1}
87this.adapter.on('resize.waypoints',function(){if(!self.didResize){self.didResize=!0
88Waypoint.requestAnimationFrame(resizeHandler)}})}
89Context.prototype.createThrottledScrollHandler=function(){var self=this
90function scrollHandler(){self.handleScroll()
91self.didScroll=!1}
92this.adapter.on('scroll.waypoints',function(){if(!self.didScroll||Waypoint.isTouch){self.didScroll=!0
93Waypoint.requestAnimationFrame(scrollHandler)}})}
94Context.prototype.handleResize=function(){Waypoint.Context.refreshAll()}
95Context.prototype.handleScroll=function(){var triggeredGroups={}
96var axes={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:'right',backward:'left'},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:'down',backward:'up'}}
97for(var axisKey in axes){var axis=axes[axisKey]
98var isForward=axis.newScroll>axis.oldScroll
99var direction=isForward?axis.forward:axis.backward
100for(var waypointKey in this.waypoints[axisKey]){var waypoint=this.waypoints[axisKey][waypointKey]
101if(waypoint.triggerPoint===null){continue}
102var wasBeforeTriggerPoint=axis.oldScroll<waypoint.triggerPoint
103var nowAfterTriggerPoint=axis.newScroll>=waypoint.triggerPoint
104var crossedForward=wasBeforeTriggerPoint&&nowAfterTriggerPoint
105var crossedBackward=!wasBeforeTriggerPoint&&!nowAfterTriggerPoint
106if(crossedForward||crossedBackward){waypoint.queueTrigger(direction)
107triggeredGroups[waypoint.group.id]=waypoint.group}}}
108for(var groupKey in triggeredGroups){triggeredGroups[groupKey].flushTriggers()}
109this.oldScroll={x:axes.horizontal.newScroll,y:axes.vertical.newScroll}}
110Context.prototype.innerHeight=function(){if(this.element==this.element.window){return Waypoint.viewportHeight()}
111return this.adapter.innerHeight()}
112Context.prototype.remove=function(waypoint){delete this.waypoints[waypoint.axis][waypoint.key]
113this.checkEmpty()}
114Context.prototype.innerWidth=function(){if(this.element==this.element.window){return Waypoint.viewportWidth()}
115return this.adapter.innerWidth()}
116Context.prototype.destroy=function(){var allWaypoints=[]
117for(var axis in this.waypoints){for(var waypointKey in this.waypoints[axis]){allWaypoints.push(this.waypoints[axis][waypointKey])}}
118for(var i=0,end=allWaypoints.length;i<end;i++){allWaypoints[i].destroy()}}
119Context.prototype.refresh=function(){var isWindow=this.element==this.element.window
120var contextOffset=isWindow?undefined:this.adapter.offset()
121var triggeredGroups={}
122var axes
123this.handleScroll()
124axes={horizontal:{contextOffset:isWindow?0:contextOffset.left,contextScroll:isWindow?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:'right',backward:'left',offsetProp:'left'},vertical:{contextOffset:isWindow?0:contextOffset.top,contextScroll:isWindow?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:'down',backward:'up',offsetProp:'top'}}
125for(var axisKey in axes){var axis=axes[axisKey]
126for(var waypointKey in this.waypoints[axisKey]){var waypoint=this.waypoints[axisKey][waypointKey]
127var adjustment=waypoint.options.offset
128var oldTriggerPoint=waypoint.triggerPoint
129var elementOffset=0
130var freshWaypoint=oldTriggerPoint==null
131var contextModifier,wasBeforeScroll,nowAfterScroll
132var triggeredBackward,triggeredForward
133if(waypoint.element!==waypoint.element.window){elementOffset=waypoint.adapter.offset()[axis.offsetProp]}
134if(typeof adjustment==='function'){adjustment=adjustment.apply(waypoint)}else if(typeof adjustment==='string'){adjustment=parseFloat(adjustment)
135if(waypoint.options.offset.indexOf('%')>-1){adjustment=Math.ceil(axis.contextDimension*adjustment/100)}}
136contextModifier=axis.contextScroll-axis.contextOffset
137waypoint.triggerPoint=Math.floor(elementOffset+contextModifier-adjustment)
138wasBeforeScroll=oldTriggerPoint<axis.oldScroll
139nowAfterScroll=waypoint.triggerPoint>=axis.oldScroll
140triggeredBackward=wasBeforeScroll&&nowAfterScroll
141triggeredForward=!wasBeforeScroll&&!nowAfterScroll
142if(!freshWaypoint&&triggeredBackward){waypoint.queueTrigger(axis.backward)
143triggeredGroups[waypoint.group.id]=waypoint.group}else if(!freshWaypoint&&triggeredForward){waypoint.queueTrigger(axis.forward)
144triggeredGroups[waypoint.group.id]=waypoint.group}else if(freshWaypoint&&axis.oldScroll>=waypoint.triggerPoint){waypoint.queueTrigger(axis.forward)
145triggeredGroups[waypoint.group.id]=waypoint.group}}}
146Waypoint.requestAnimationFrame(function(){for(var groupKey in triggeredGroups){triggeredGroups[groupKey].flushTriggers()}})
147return this}
148Context.findOrCreateByElement=function(element){return Context.findByElement(element)||new Context(element)}
149Context.refreshAll=function(){for(var contextId in contexts){contexts[contextId].refresh()}}
150Context.findByElement=function(element){return contexts[element.waypointContextKey]}
151window.onload=function(){if(oldWindowLoad){oldWindowLoad()}
152Context.refreshAll()}
153Waypoint.requestAnimationFrame=function(callback){var requestFn=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||requestAnimationFrameShim
154requestFn.call(window,callback)}
155Waypoint.Context=Context}());(function(){'use strict'
156function byTriggerPoint(a,b){return a.triggerPoint-b.triggerPoint}
157function byReverseTriggerPoint(a,b){return b.triggerPoint-a.triggerPoint}
158var groups={vertical:{},horizontal:{}}
159var Waypoint=window.Waypoint
160function Group(options){this.name=options.name
161this.axis=options.axis
162this.id=this.name+'-'+this.axis
163this.waypoints=[]
164this.clearTriggerQueues()
165groups[this.axis][this.name]=this}
166Group.prototype.add=function(waypoint){this.waypoints.push(waypoint)}
167Group.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],r
167ight:[]}}
168Group.prototype.flushTriggers=function(){for(var direction in this.triggerQueues){var waypoints=this.triggerQueues[direction]
169var reverse=direction==='up'||direction==='left'
170waypoints.sort(reverse?byReverseTriggerPoint:byTriggerPoint)
171for(var i=0,end=waypoints.length;i<end;i+=1){var waypoint=waypoints[i]
172if(waypoint.options.continuous||i===waypoints.length-1){waypoint.trigger([direction])}}}
173this.clearTriggerQueues()}
174Group.prototype.next=function(waypoint){this.waypoints.sort(byTriggerPoint)
175var index=Waypoint.Adapter.inArray(waypoint,this.waypoints)
176var isLast=index===this.waypoints.length-1
177return isLast?null:this.waypoints[index+1]}
178Group.prototype.previous=function(waypoint){this.waypoints.sort(byTriggerPoint)
179var index=Waypoint.Adapter.inArray(waypoint,this.waypoints)
180return index?this.waypoints[index-1]:null}
181Group.prototype.queueTrigger=function(waypoint,direction){this.triggerQueues[direction].push(waypoint)}
182Group.prototype.remove=function(waypoint){var index=Waypoint.Adapter.inArray(waypoint,this.waypoints)
183if(index>-1){this.waypoints.splice(index,1)}}
184Group.prototype.first=function(){return this.waypoints[0]}
185Group.prototype.last=function(){return this.waypoints[this.waypoints.length-1]}
186Group.findOrCreate=function(options){return groups[options.axis][options.name]||new Group(options)}
187Waypoint.Group=Group}());(function(){'use strict'
188var $=window.jQuery
189var Waypoint=window.Waypoint
190function JQueryAdapter(element){this.$element=$(element)}
191$.each(['innerHeight','innerWidth','off','offset','on','outerHeight','outerWidth','scrollLeft','scrollTop'],function(i,method){JQueryAdapter.prototype[method]=function(){var args=Array.prototype.slice.call(arguments)
192return this.$element[method].apply(this.$element,args)}})
193$.each(['extend','inArray','isEmptyObject'],function(i,method){JQueryAdapter[method]=$[method]})
194Waypoint.adapters.push({name:'jquery',Adapter:JQueryAdapter})
195Waypoint.Adapter=JQueryAdapter}());(function(){'use strict'
196var Waypoint=window.Waypoint
197function createExtension(framework){return function(){var waypoints=[]
198var overrides=arguments[0]
199if(framework.isFunction(arguments[0])){overrides=framework.extend({},arguments[1])
200overrides.handler=arguments[0]}
201this.each(function(){var options=framework.extend({},overrides,{element:this})
202if(typeof options.context==='string'){options.context=framework(this).closest(options.context)[0]}
203waypoints.push(new Waypoint(options))})
204return waypoints}}
205if(window.jQuery){window.jQuery.fn.waypoint=createExtension(window.jQuery)}
206if(window.Zepto){window.Zepto.fn.waypoint=createExtension(window.Zepto)}}())

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.