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