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