PageSourceSearch

http://politicallycorret.co.il/wp-content/cache/speedycache/politi…/assets/0f8ecd80321cdfe9-waypoints.js

js politicallycorret.co.il collected 2026-10-02 06:55:59 UTC 12,972 bytes, 484 lines download raw bytes

1(function(){
2'use strict'
3var keyCounter=0
4var allWaypoints={}
5function Waypoint(options){
6if(!options){
7throw new Error('No options passed to Waypoint constructor')
8}
9if(!options.element){
10throw new Error('No element option passed to Waypoint constructor')
11}
12if(!options.handler){
13throw new Error('No handler option passed to Waypoint constructor')
14}
15this.key='waypoint-' + keyCounter
16this.options=Waypoint.Adapter.extend({}, Waypoint.defaults, options)
17this.element=this.options.element
18this.adapter=new Waypoint.Adapter(this.element)
19this.callback=options.handler
20this.axis=this.options.horizontal ? 'horizontal':'vertical'
21this.enabled=this.options.enabled
22this.triggerPoint=null
23this.group=Waypoint.Group.findOrCreate({
24name: this.options.group,
25axis: this.axis
26})
27this.context=Waypoint.Context.findOrCreateByElement(this.options.context)
28if(Waypoint.offsetAliases[this.options.offset]){
29this.options.offset=Waypoint.offsetAliases[this.options.offset]
30}
31this.group.add(this)
32this.context.add(this)
33allWaypoints[this.key]=this
34keyCounter +=1
35}
36Waypoint.prototype.queueTrigger=function(direction){
37this.group.queueTrigger(this, direction)
38}
39Waypoint.prototype.trigger=function(args){
40if(!this.enabled){
41return
42}
43if(this.callback){
44this.callback.apply(this, args)
45}}
46Waypoint.prototype.destroy=function(){
47this.context.remove(this)
48this.group.remove(this)
49delete allWaypoints[this.key]
50}
51Waypoint.prototype.disable=function(){
52this.enabled=false
53return this
54}
55Waypoint.prototype.enable=function(){
56this.context.refresh()
57this.enabled=true
58return this
59}
60Waypoint.prototype.next=function(){
61return this.group.next(this)
62}
63Waypoint.prototype.previous=function(){
64return this.group.previous(this)
65}
66Waypoint.invokeAll=function(method){
67var allWaypointsArray=[]
68for (var waypointKey in allWaypoints){
69allWaypointsArray.push(allWaypoints[waypointKey])
70}
71for (var i=0, end=allWaypointsArray.length; i < end; i++){
72allWaypointsArray[i][method]()
73}}
74Waypoint.destroyAll=function(){
75Waypoint.invokeAll('destroy')
76}
77Waypoint.disableAll=function(){
78Waypoint.invokeAll('disable')
79}
80Waypoint.enableAll=function(){
81Waypoint.Context.refreshAll()
82for (var waypointKey in allWaypoints){
83allWaypoints[waypointKey].enabled=true
84}
85return this
86}
87Waypoint.refreshAll=function(){
88Waypoint.Context.refreshAll()
89}
90Waypoint.viewportHeight=function(){
91return window.innerHeight||document.documentElement.clientHeight
92}
93Waypoint.viewportWidth=function(){
94return document.documentElement.clientWidth
95}
96Waypoint.adapters=[]
97Waypoint.defaults={
98context: window,
99continuous: true,
100enabled: true,
101group: 'default',
102horizontal: false,
103offset: 0
104}
105Waypoint.offsetAliases={
106'bottom-in-view': function(){
107return this.context.innerHeight() - this.adapter.outerHeight()
108},
109'right-in-view': function(){
110return this.context.innerWidth() - this.adapter.outerWidth()
111}}
112window.Waypoint=Waypoint
113}())
114;(function(){
115'use strict'
116function requestAnimationFrameShim(callback){
117window.setTimeout(callback, 1000 / 60)
118}
119var keyCounter=0
120var contexts={}
121var Waypoint=window.Waypoint
122var oldWindowLoad=window.onload
123function Context(element){
124this.element=element
125this.Adapter=Waypoint.Adapter
126this.adapter=new this.Adapter(element)
127this.key='waypoint-context-' + keyCounter
128this.didScroll=false
129this.didResize=false
130this.oldScroll={
131x: this.adapter.scrollLeft(),
132y: this.adapter.scrollTop()
133}
134this.waypoints={
135vertical: {},
136horizontal: {}}
137element.waypointContextKey=this.key
138contexts[element.waypointContextKey]=this
139keyCounter +=1
140if(!Waypoint.windowContext){
141Waypoint.windowContext=true
142Waypoint.windowContext=new Context(window)
143}
144this.createThrottledScrollHandler()
145this.createThrottledResizeHandler()
146}
147Context.prototype.add=function(waypoint){
148var axis=waypoint.options.horizontal ? 'horizontal':'vertical'
149this.waypoints[axis][waypoint.key]=waypoint
150this.refresh()
151}
152Context.prototype.checkEmpty=function(){
153var horizontalEmpty=this.Adapter.isEmptyObject(this.waypoints.horizontal)
154var verticalEmpty=this.Adapter.isEmptyObject(this.waypoints.vertical)
155var isWindow=this.element==this.element.window
156if(horizontalEmpty&&verticalEmpty&&!isWindow){
157this.adapter.off('.waypoints')
158delete contexts[this.key]
159}}
160Context.prototype.createThrottledResizeHandler=function(){
161var self=this
162function resizeHandler(){
163self.handleResize()
164self.didResize=false
165}
166this.adapter.on('resize.waypoints', function(){
167if(!self.didResize){
168self.didResize=true
169Waypoint.requestAnimationFrame(resizeHandler)
170}})
171}
172Context.prototype.createThrottledScrollHandler=function(){
173var self=this
174function scrollHandler(){
175self.handleScroll()
176self.didScroll=false
177}
178this.adapter.on('scroll.waypoints', function(){
179if(!self.didScroll||Waypoint.isTouch){
180self.didScroll=true
181Waypoint.requestAnimationFrame(scrollHandler)
182}})
183}
184Context.prototype.handleResize=function(){
185Waypoint.Context.refreshAll()
186}
187Context.prototype.handleScroll=function(){
188var triggeredGroups={}
189var axes={
190horizontal: {
191newScroll: this.adapter.scrollLeft(),
192oldScroll: this.oldScroll.x,
193forward: 'right',
194backward: 'left'
195},
196vertical: {
197newScroll: this.adapter.scrollTop(),
198oldScroll: this.oldScroll.y,
199forward: 'down',
200backward: 'up'
201}}
202for (var axisKey in axes){
203var axis=axes[axisKey]
204var isForward=axis.newScroll > axis.oldScroll
205var direction=isForward ? axis.forward:axis.backward
206for (var waypointKey in this.waypoints[axisKey]){
207var waypoint=this.waypoints[axisKey][waypointKey]
208if(waypoint.triggerPoint===null){
209continue
210}
211var wasBeforeTriggerPoint=axis.oldScroll < waypoint.triggerPoint
212var nowAfterTriggerPoint=axis.newScroll >=waypoint.triggerPoint
213var crossedForward=wasBeforeTriggerPoint&&nowAfterTriggerPoint
214var crossedBackward = !wasBeforeTriggerPoint&&!nowAfterTriggerPoint
215if(crossedForward||crossedBackward){
216waypoint.queueTrigger(direction)
217triggeredGroups[waypoint.group.id]=waypoint.group
218}}
219}
220for (var groupKey in triggeredGroups){
221triggeredGroups[groupKey].flushTriggers()
222}
223this.oldScroll={
224x: axes.horizontal.newScroll,
225y: axes.vertical.newScroll
226}}
227Context.prototype.innerHeight=function(){
228if(this.element==this.element.window){
229return Waypoint.viewportHeight()
230}
231return this.adapter.innerHeight()
232}
233Context.prototype.remove=function(waypoint){
234delete this.waypoints[waypoint.axis][waypoint.key]
235this.checkEmpty()
236}
237Context.prototype.innerWidth=function(){
238if(this.element==this.element.window){
239return Waypoint.viewportWidth()
240}
241return this.adapter.innerWidth()
242}
243Context.prototype.destroy=function(){
244var allWaypoints=[]
245for (var axis in this.waypoints){
246for (var waypointKey in this.waypoints[axis]){
247allWaypoints.push(this.waypoints[axis][waypointKey])
248}}
249for (var i=0, end=allWaypoints.length; i < end; i++){
250allWaypoints[i].destroy()
251}}
252Context.prototype.refresh=function(){
253var isWindow=this.element==this.element.window
254var contextOffset=isWindow ? undefined:this.adapter.offset()
255var triggeredGroups={}
256var axes
257this.handleScroll()
258axes={
259horizontal: {
260contextOffset: isWindow ? 0:contextOffset.left,
261contextScroll: isWindow ? 0:this.oldScroll.x,
262contextDimension: this.innerWidth(),
263oldScroll: this.oldScroll.x,
264forward: 'right',
265backward: 'left',
266offsetProp: 'left'
267},
268vertical: {
269contextOffset: isWindow ? 0:contextOffset.top,
270contextScroll: isWindow ? 0:this.oldScroll.y,
271contextDimension: this.innerHeight(),
272oldScroll: this.oldScroll.y,
273forward: 'down',
274backward: 'up',
275offsetProp: 'top'
276}}
277for (var axisKey in axes){
278var axis=axes[axisKey]
279for (var waypointKey in this.waypoints[axisKey]){
280var waypoint=this.waypoints[axisKey][waypointKey]
281var adjustment=waypoint.options.offset
282var oldTriggerPoint=waypoint.triggerPoint
283var elementOffset=0
284var freshWaypoint=oldTriggerPoint==null
285var contextModifier, wasBeforeScroll, nowAfterScroll
286var triggeredBackward, triggeredForward
287if(waypoint.element!==waypoint.element.window){
288elementOffset=waypoint.adapter.offset()[axis.offsetProp]
289}
290if(typeof adjustment==='function'){
291adjustment=adjustment.apply(waypoint)
292}
293else if(typeof adjustment==='string'){
294adjustment=parseFloat(adjustment)
295if(waypoint.options.offset.indexOf('%') > - 1){
296adjustment=Math.ceil(axis.contextDimension * adjustment / 100)
297}}
298contextModifier=axis.contextScroll - axis.contextOffset
299waypoint.triggerPoint=Math.floor(elementOffset + contextModifier - adjustment)
300wasBeforeScroll=oldTriggerPoint < axis.oldScroll
301nowAfterScroll=waypoint.triggerPoint >=axis.oldScroll
302triggeredBackward=wasBeforeScroll&&nowAfterScroll
303triggeredForward = !wasBeforeScroll&&!nowAfterScroll
304if(!freshWaypoint&&triggeredBackward){
305waypoint.queueTrigger(axis.backward)
306triggeredGroups[waypoint.group.id]=waypoint.group
307}
308else if(!freshWaypoint&&triggeredForward){
309waypoint.queueTrigger(axis.forward)
310triggeredGroups[waypoint.group.id]=waypoint.group
311}
312else if(freshWaypoint&&axis.oldScroll >=waypoint.triggerPoint){
313waypoint.queueTrigger(axis.forward)
314triggeredGroups[waypoint.group.id]=waypoint.group
315}}
316}
317Waypoint.requestAnimationFrame(function(){
318for (var groupKey in triggeredGroups){
319triggeredGroups[groupKey].flushTriggers()
320}})
321return this
322}
323Context.findOrCreateByElement=function(element){
324return Context.findByElement(element)||new Context(element)
325}
326Context.refreshAll=function(){
327for (var contextId in contexts){
328contexts[contextId].refresh()
329}}
330Context.findByElement=function(element){
331return contexts[element.waypointContextKey]
332}
333window.onload=function(){
334if(oldWindowLoad){
335oldWindowLoad()
336}
337Context.refreshAll()
338}
339Waypoint.requestAnimationFrame=function(callback){
340var requestFn=window.requestAnimationFrame ||
341window.mozRequestAnimationFrame ||
342window.webkitRequestAnimationFrame ||
343requestAnimationFrameShim
344requestFn.call(window, callback)
345}
346Waypoint.Context=Context
347}())
348;(function(){
349'use strict'
350function byTriggerPoint(a, b){
351return a.triggerPoint - b.triggerPoint
352}
353function byReverseTriggerPoint(a, b){
354return b.triggerPoint - a.triggerPoint
355}
356var groups={
357vertical: {},
358horizontal: {}}
359var Waypoint=window.Waypoint
360function Group(options){
361this.name=options.name
362this.axis=options.axis
363this.id=this.name + '-' + this.axis
364this.waypoints=[]
365this.clearTriggerQueues()
366groups[this.axis][this.name]=this
367}
368Group.prototype.add=function(waypoint){
369this.waypoints.push(waypoint)
370}
371Group.prototype.clearTriggerQueues=function(){
372this.triggerQueues={
373up: [],
374down: [],
375left: [],
376right: []
377}}
378Group.prototype.flushTriggers=function(){
379for (var direction in this.triggerQueues){
380var waypoints=this.triggerQueues[direction]
381var reverse=direction==='up'||direction==='left'
382waypoints.sort(reverse ? byReverseTriggerPoint:byTriggerPoint)
383for (var i=0, end=waypoints.length; i < end; i +=1){
384var waypoint=waypoints[i]
385if(waypoint.options.continuous||i===waypoints.length - 1){
386waypoint.trigger([direction])
387}}
388}
389this.clearTriggerQueues()
390}
391Group.prototype.next=function(waypoint){
392this.waypoints.sort(byTriggerPoint)
393var index=Waypoint.Adapter.inArray(waypoint, this.waypoints)
394var isLast=index===this.waypoints.length - 1
395return isLast ? null:this.waypoints[index + 1]
396}
397Group.prototype.previous=function(waypoint){
398this.waypoints.sort(byTriggerPoint)
399var index=Waypoint.Adapter.inArray(waypoint, this.waypoints)
400return index ? this.waypoints[index - 1]:null
401}
402Group.prototype.queueTrigger=function(waypoint, direction){
403this.triggerQueues[direction].push(waypoint)
404}
405Group.prototype.remove=function(waypoint){
406var index=Waypoint.Adapter.inArray(waypoint, this.waypoints)
407if(index > -1){
408this.waypoints.splice(index, 1)
409}}
410Group.prototype.first=function(){
411return this.waypoints[0]
412}
413Group.prototype.last=function(){
414return this.waypoints[this.waypoints.length - 1]
415}
416Group.findOrCreate=function(options){
417return groups[options.axis][options.name]||new Group(options)
418}
419Waypoint.Group=Group
420}())
421;(function(){
422'use strict'
423var $=window.jQuery
424var Waypoint=window.Waypoint
425function JQueryAdapter(element){
426this.$element=$(element)
427}
428$.each([
429'innerHeight',
430'innerWidth',
431'off',
432'offset',
433'on',
434'outerHeight',
435'outerWidth',
436'scrollLeft',
437'scrollTop'
438], function(i, method){
439JQueryAdapter.prototype[method]=function(){
440var args=Array.prototype.slice.call(arguments)
441return this.$element[method].apply(this.$element, args)
442}})
443$.each([
444'extend',
445'inArray',
446'isEmptyObject'
447], function(i, method){
448JQueryAdapter[method]=$[method]
449})
450Waypoint.adapters.push({
451name: 'jquery',
452Adapter: JQueryAdapter
453})
454Waypoint.Adapter=JQueryAdapter
455}())
456;(function(){
457'use strict'
458var Waypoint=window.Waypoint
459function createExtension(framework){
460return function(){
461var waypoints=[]
462var overrides=arguments[0]
463if(framework.isFunction(arguments[0])){
464overrides=framework.extend({}, arguments[1])
465overrides.handler=arguments[0]
466}
467this.each(function(){
468var options=framework.extend({}, overrides, {
469element: this
470})
471if(typeof options.context==='string'){
472options.context=framework(this).closest(options.context)[0]
473}
474waypoints.push(new Waypoint(options))
475})
476return waypoints
477}}
478if(window.jQuery){
479window.jQuery.fn.elementorWaypoint=createExtension(window.jQuery)
480}
481if(window.Zepto){
482window.Zepto.fn.elementorWaypoint=createExtension(window.Zepto)
483}}())
484;

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.