vendor: 15,988 bytes, lines 1-405
1/** 2 * Generated by CoffeeScript 1.6.2 3 * jQuery Waypoints - v2.0.3 4 * Copyright (c) 2011-2013 Caleb Troughton 5 * Dual licensed under the MIT license and GPL license. 6 * https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt 7 * 8 **/ 9(function() { 10 var t = [].indexOf || function(t) { 11 for (var e = 0, n = this.length; e < n; e++) { 12 if (e in this && this[e] === t) 13 return e 14 } 15 return-1 16 }, e = [].slice; 17 (function(t, e) { 18 if (typeof define === "function" && define.amd) { 19 return define("waypoints", ["jquery"], function(n) { 20 return e(n, t) 21 }) 22 } else { 23 return e(t.jQuery, t) 24 } 25 })(this, function(n, r) { 26 var i, o, l, s, f, u, a, c, h, d, p, y, v, w, g, m; 27 i = n(r); 28 c = t.call(r, "ontouchstart") >= 0; 29 s = {horizontal: {}, vertical: {}}; 30 f = 1; 31 a = {}; 32 u = "waypoints-context-id"; 33 p = "resize.waypoints"; 34 y = "scroll.waypoints"; 35 v = 1; 36 w = "waypoints-waypoint-ids"; 37 g = "waypoint"; 38 m = "waypoints"; 39 o = function() { 40 function t(t) { 41 var e = this; 42 this.$element = t; 43 this.element = t[0]; 44 this.didResize = false; 45 this.didScroll = false; 46 this.id = "context" + f++; 47 this.oldScroll = {x: t.scrollLeft(), y: t.scrollTop()}; 48 this.waypoints = {horizontal: {}, vertical: {}}; 49 t.data(u, this.id); 50 a[this.id] = this; 51 t.bind(y, function() { 52 var t; 53 if (!(e.didScroll || c)) { 54 e.didScroll = true; 55 t = function() { 56 e.doScroll(); 57 return e.didScroll = false 58 }; 59 return r.setTimeout(t, n[m].settings.scrollThrottle) 60 } 61 }); 62 t.bind(p, function() { 63 var t; 64 if (!e.didResize) { 65 e.didResize = true; 66 t = function() { 67 n[m]("refresh"); 68 return e.didResize = false 69 }; 70 return r.setTimeout(t, n[m].settings.resizeThrottle) 71 } 72 }) 73 } 74 t.prototype.doScroll = function() { 75 var t, e = this; 76 t = {horizontal: {newScroll: this.$element.scrollLeft(), oldScroll: this.oldScroll.x, forward: "right", backward: "left"}, vertical: {newScroll: this.$element.scrollTop(), oldScroll: this.oldScroll.y, forward: "down", backward: "up"}}; 77 if (c && (!t.vertical.oldScroll || !t.vertical.newScroll)) { 78 n[m]("refresh") 79 } 80 n.each(t, function(t, r) { 81 var i, o, l; 82 l = []; 83 o = r.newScroll > r.oldScroll; 84 i = o ? r.forward : r.backward; 85 n.each(e.waypoints[t], function(t, e) { 86 var n, i; 87 if (r.oldScroll < (n = e.offset) && n <= r.newScroll) { 88 return l.push(e) 89 } else if (r.newScroll < (i = e.offset) && i <= r.oldScroll) { 90 return l.push(e) 91 } 92 }); 93 l.sort(function(t, e) { 94 return t.offset - e.offset 95 }); 96 if (!o) { 97 l.reverse() 98 } 99 return n.each(l, function(t, e) { 100 if (e.options.continuous || t === l.length - 1) { 101 return e.trigger([i]) 102 } 103 }) 104 }); 105 return this.oldScroll = {x: t.horizontal.newScroll, y: t.vertical.newScroll} 106 }; 107 t.prototype.refresh = function() { 108 var t, e, r, i = this; 109 r = n.isWindow(this.element); 110 e = this.$element.offset(); 111 this.doScroll(); 112 t = {horizontal: {contextOffset: r ? 0 : e.left, contextScroll: r ? 0 : this.oldScroll.x, contextDimension: this.$element.width(), oldScroll: this.oldScroll.x, forward: "right", backward: "left", offsetProp: "left"}, vertical: {contextOffset: r ? 0 : e.top, contextScroll: r ? 0 : this.oldScroll.y, contextDimension: r ? n[m]("viewportHeight") : this.$element.height(), oldScroll: this.oldScroll.y, forward: "down", backward: "up", offsetProp: "top"}}; 113 return n.each(t, function(t, e) { 114 return n.each(i.waypoints[t], function(t, r) { 115 var i, o, l, s, f; 116 i = r.options.offset; 117 l = r.offset; 118 o = n.isWindow(r.element) ? 0 : r.$element.offset()[e.offsetProp]; 119 if (n.isFunction(i)) { 120 i = i.apply(r.element) 121 } else if (typeof i === "string") { 122 i = parseFloat(i); 123 if (r.options.offset.indexOf("%") > -1) { 124 i = Math.ceil(e.contextDimension * i / 100) 125 } 126 } 127 r.offset = o - e.contextOffset + e.contextScroll - i; 128 if (r.options.onlyOnScroll && l != null || !r.enabled) { 129 return 130 } 131 if (l !== null && l < (s = e.oldScroll) && s <= r.offset) { 132 return r.trigger([e.backward]) 133 } else if (l !== null && l > (f = e.oldScroll) && f >= r.offset) { 134 return r.trigger([e.forward]) 135 } else if (l === null && e.oldScroll >= r.offset) { 136 return r.trigger([e.forward]) 137 } 138 }) 139 }) 140 }; 141 t.prototype.checkEmpty = function() { 142 if (n.isEmptyObject(this.waypoints.horizontal) && n.isEmptyObject(this.waypoints.vertical)) { 143 this.$element.unbind([p, y].join(" ")); 144 return delete a[this.id] 145 } 146 }; 147 return t 148 }(); 149 l = function() { 150 function t(t, e, r) { 151 var i, o; 152 r = n.extend({}, n.fn[g].defaults, r); 153 if (r.offset === "bottom-in-view") { 154 r.offset = function() { 155 var t; 156 t = n[m]("viewportHeight"); 157 if (!n.isWindow(e.element)) { 158 t = e.$element.height() 159 } 160 return t - n(this).outerHeight() 161 } 162 } 163 this.$element = t; 164 this.element = t[0]; 165 this.axis = r.horizontal ? "horizontal" : "vertical"; 166 this.callback = r.handler; 167 this.context = e; 168 this.enabled = r.enabled; 169 this.id = "waypoints" + v++; 170 this.offset = null; 171 this.options = r; 172 e.waypoints[this.axis][this.id] = this; 173 s[this.axis][this.id] = this; 174 i = (o = t.data(w)) != null ? o : []; 175 i.push(this.id); 176 t.data(w, i) 177 } 178 t.prototype.trigger = function(t) { 179 if (!this.enabled) { 180 return 181 } 182 if (this.callback != null) { 183 this.callback.apply(this.element, t) 184 } 185 if (this.options.triggerOnce) { 186 return this.destroy() 187 } 188 }; 189 t.prototype.disable = function() { 190 return this.enabled = false 191 }; 192 t.prototype.enable = function() { 193 this.context.refresh(); 194 return this.enabled = true 195 }; 196 t.prototype.destroy = function() { 197 delete s[this.axis][this.id]; 198 delete this.context.waypoints[this.axis][this.id]; 199 return this.context.checkEmpty() 200 }; 201 t.getWaypointsByElement = function(t) { 202 var e, r; 203 r = n(t).data(w); 204 if (!r) { 205 return[] 206 } 207 e = n.extend({}, s.horizontal, s.vertical); 208 return n.map(r, function(t) { 209 return e[t] 210 }) 211 }; 212 return t 213 }(); 214 d = {init: function(t, e) { 215 var r; 216 if (e == null) { 217 e = {} 218 } 219 if ((r = e.handler) == null) { 220 e.handler = t 221 } 222 this.each(function() { 223 var t, r, i, s; 224 t = n(this); 225 i = (s = e.context) != null ? s : n.fn[g].defaults.context; 226 if (!n.isWindow(i)) { 227 i = t.closest(i) 228 } 229 i = n(i); 230 r = a[i.data(u)]; 231 if (!r) { 232 r = new o(i) 233 } 234 return new l(t, r, e) 235 }); 236 n[m]("refresh"); 237 return this 238 }, disable: function() { 239 return d._invoke(this, "disable") 240 }, enable: function() { 241 return d._invoke(this, "enable") 242 }, destroy: function() { 243 return d._invoke(this, "destroy") 244 }, prev: function(t, e) { 245 return d._traverse.call(this, t, e, function(t, e, n) { 246 if (e > 0) { 247 return t.push(n[e - 1]) 248 } 249 }) 250 }, next: function(t, e) { 251 return d._traverse.call(this, t, e, function(t, e, n) { 252 if (e < n.length - 1) { 253 return t.push(n[e + 1]) 254 } 255 }) 256 }, _traverse: function(t, e, i) { 257 var o, l; 258 if (t == null) { 259 t = "vertical" 260 } 261 if (e == null) { 262 e = r 263 } 264 l = h.aggregate(e); 265 o = []; 266 this.each(function() { 267 var e; 268 e = n.inArray(this, l[t]); 269 return i(o, e, l[t]) 270 }); 271 return this.pushStack(o) 272 }, _invoke: function(t, e) { 273 t.each(function() { 274 var t; 275 t = l.getWaypointsByElement(this); 276 return n.each(t, function(t, n) { 277 n[e](); 278 return true 279 }) 280 }); 281 return this 282 }}; 283 n.fn[g] = function() { 284 var t, r; 285 r = arguments[0], t = 2 <= arguments.length ? e.call(arguments, 1) : []; 286 if (d[r]) { 287 return d[r].apply(this, t) 288 } else if (n.isFunction(r)) { 289 return d.init.apply(this, arguments) 290 } else if (n.isPlainObject(r)) { 291 return d.init.apply(this, [null, r]) 292 } else if (!r) { 293 return n.error("jQuery Waypoints needs a callback function or handler option.") 294 } else { 295 return n.error("The " + r + " method does not exist in jQuery Waypoints.") 296 } 297 }; 298 n.fn[g].defaults = {context: r, continuous: true, enabled: true, horizontal: false, offset: 0, triggerOnce: false}; 299 h = {refresh: function() { 300 return n.each(a, function(t, e) { 301 return e.refresh() 302 }) 303 }, viewportHeight: function() { 304 var t; 305 return(t = r.innerHeight) != null ? t : i.height() 306 }, aggregate: function(t) { 307 var e, r, i; 308 e = s; 309 if (t) { 310 e = (i = a[n(t).data(u)]) != null ? i.waypoints : void 0 311 } 312 if (!e) { 313 return[] 314 } 315 r = {horizontal: [], vertical: []}; 316 n.each(r, function(t, i) { 317 n.each(e[t], function(t, e) { 318 return i.push(e) 319 }); 320 i.sort(function(t, e) { 321 return t.offset - e.offset 322 }); 323 r[t] = n.map(i, function(t) { 324 return t.element 325 }); 326 return r[t] = n.unique(r[t]) 327 }); 328 return r 329 }, above: function(t) { 330 if (t == null) { 331 t = r 332 } 333 return h._filter(t, "vertical", function(t, e) { 334 return e.offset <= t.oldScroll.y 335 }) 336 }, below: function(t) { 337 if (t == null) { 338 t = r 339 } 340 return h._filter(t, "vertical", function(t, e) { 341 return e.offset > t.oldScroll.y 342 }) 343 }, left: function(t) { 344 if (t == null) { 345 t = r 346 } 347 return h._filter(t, "horizontal", function(t, e) { 348 return e.offset <= t.oldScroll.x 349 }) 350 }, right: function(t) { 351 if (t == null) { 352 t = r 353 } 354 return h._filter(t, "horizontal", function(t, e) { 355 return e.offset > t.oldScroll.x 356 }) 357 }, enable: function() { 358 return h._invoke("enable") 359 }, disable: function() { 360 return h._invoke("disable") 361 }, destroy: function() { 362 return h._invoke("destroy") 363 }, extendFn: function(t, e) { 364 return d[t] = e 365 }, _invoke: function(t) { 366 var e; 367 e = n.extend({}, s.vertical, s.horizontal); 368 return n.each(e, function(e, n) { 369 n[t](); 370 return true 371 }) 372 }, _filter: function(t, e, r) { 373 var i, o; 374 i = a[n(t).data(u)]; 375 if (!i) { 376 return[] 377 } 378 o = []; 379 n.each(i.waypoints[e], function(t, e) { 380 if (r(i, e)) { 381 return o.push(e) 382 } 383 }); 384 o.sort(function(t, e) { 385 return t.offset - e.offset 386 }); 387 return n.map(o, function(t) { 388 return t.element 389 }) 390 }}; 391 n[m] = function() { 392 var t, n; 393 n = arguments[0], t = 2 <= arguments.length ? e.call(arguments, 1) : []; 394 if (h[n]) { 395 return h[n].apply(null, t) 396 } else { 397 return h.aggregate.call(null, n) 398 } 399 }; 400 n[m].settings = {resizeThrottle: 100, scrollThrottle: 30}; 401 return i.load(function() { 402 return n[m]("refresh") 403 }) 404 }) 405}).call(this);
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.