1/*! nanoScrollerJS - v0.8.7 - (c) 2015 James Florentino; Licensed MIT */ 2 3!(function (a) { 4 return "function" == typeof define && define.amd 5 ? define(["jquery"], function (b) { 6 return a(b, window, document); 7 }) 8 : "object" == typeof exports 9 ? (module.exports = a(require("jquery"), window, document)) 10 : a(jQuery, window, document); 11})(function (a, b, c) { 12 "use strict"; 13 var d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H; 14 (z = { 15 paneClass: "nano-pane", 16 sliderClass: "nano-slider", 17 contentClass: "nano-content", 18 enabledClass: "has-scrollbar", 19 flashedClass: "flashed", 20 activeClass: "active", 21 iOSNativeScrolling: !1, 22 preventPageScrolling: !1, 23 disableResize: !1, 24 alwaysVisible: !1, 25 flashDelay: 1500, 26 sliderMinHeight: 20, 27 sliderMaxHeight: null, 28 documentContext: null, 29 windowContext: null, 30 }), 31 (u = "scrollbar"), 32 (t = "scroll"), 33 (l = "mousedown"), 34 (m = "mouseenter"), 35 (n = "mousemove"), 36 (p = "mousewheel"), 37 (o = "mouseup"), 38 (s = "resize"), 39 (h = "drag"), 40 (i = "enter"), 41 (w = "up"), 42 (r = "panedown"), 43 (f = "DOMMouseScroll"), 44 (g = "down"), 45 (x = "wheel"), 46 (j = "keydown"), 47 (k = "keyup"), 48 (v = "touchmove"), 49 (d = 50 "Microsoft Internet Explorer" === b.navigator.appName && 51 /msie 7./i.test(b.navigator.appVersion) && 52 b.ActiveXObject), 53 (e = null), 54 (D = b.requestAnimationFrame), 55 (y = b.cancelAnimationFrame), 56 (F = c.createElement("div").style), 57 (H = (function () { 58 var a, b, c, d, e, f; 59 for (d = ["t", "webkitT", "MozT", "msT", "OT"], a = e = 0, f = d.length; f > e; a = ++e) 60 if (((c = d[a]), (b = d[a] + "ransform"), b in F)) 61 return d[a].substr(0, d[a].length - 1); 62 return !1; 63 })()), 64 (G = function (a) { 65 return H === !1 ? !1 : "" === H ? a : H + a.charAt(0).toUpperCase() + a.substr(1); 66 }), 67 (E = G("transform")), 68 (B = E !== !1), 69 (A = function () { 70 var a, b, d; 71 return ( 72 (a = c.createElement("div")), 73 (b = a.style), 74 (b.position = "absolute"), 75 (b.width = "100px"), 76 (b.height = "100px"), 77 (b.overflow = t), 78 (b.top = "-9999px"), 79 c.body.appendChild(a), 80 (d = a.offsetWidth - a.clientWidth), 81 c.body.removeChild(a), 82 d 83 ); 84 }), 85 (C = function () { 86 var a, c, d; 87 return ( 88 (c = b.navigator.userAgent), 89 (a = /(?=.+Mac OS X)(?=.+Firefox)/.test(c)) 90 ? ((d = /Firefox\/\d{2}\./.exec(c)), 91 d && (d = d[0].replace(/\D+/g, "")), 92 a && +d > 23) 93 : !1 94 ); 95 }), 96 (q = (function () { 97 function j(d, f) { 98 (this.el = d), 99 (this.options = f), 100 e || (e = A()), 101 (this.$el = a(this.el)), 102 (this.doc = a(this.options.documentContext || c)), 103 (this.win = a(this.options.windowContext || b)), 104 (this.body = this.doc.find("body")), 105 (this.$content = this.$el.children("." + this.options.contentClass)), 106 this.$content.attr("tabindex", this.options.tabIndex || 0), 107 (this.content = this.$content[0]), 108 (this.previousPosition = 0), 109 this.options.iOSNativeScrolling && null != this.el.style.WebkitOverflowScrolling 110 ? this.nativeScrolling() 111 : this.generate(), 112 this.createEvents(), 113 this.addEvents(), 114 this.reset(); 115 } 116 return ( 117 (j.prototype.preventScrolling = function (a, b) { 118 if (this.isActive) 119 if (a.type === f) 120 ((b === g && a.originalEvent.detail > 0) || 121 (b === w && a.originalEvent.detail < 0)) && 122 a.preventDefault(); 123 else if (a.type === p) { 124 if (!a.originalEvent || !a.originalEvent.wheelDelta) return; 125 ((b === g && a.originalEvent.wheelDelta < 0) || 126 (b === w && a.originalEvent.wheelDelta > 0)) && 127 a.preventDefault(); 128 } 129 }), 130 (j.prototype.nativeScrolling = function () { 131 this.$content.css({ WebkitOverflowScrolling: "touch" }), 132 (this.iOSNativeScrolling = !0), 133 (this.isActive = !0); 134 }), 135 (j.prototype.updateScrollValues = function () { 136 var a, b; 137 (a = this.content), 138 (this.maxScrollTop = a.scrollHeight - a.clientHeight), 139 (this.prevScrollTop = this.contentScrollTop || 0), 140 (this.contentScrollTop = a.scrollTop), 141 (b = 142 this.contentScrollTop > this.previousPosition 143 ? "down" 144 : this.contentScrollTop < this.previousPosition 145 ? "up" 146 : "same"), 147 (this.previousPosition = this.contentScrollTop), 148 "same" !== b && 149 this.$el.trigger("update", { 150 position: this.contentScrollTop, 151 maximum: this.maxScrollTop, 152 direction: b, 153 }), 154 this.iOSNativeScrolling || 155 ((this.maxSliderTop = this.paneHeight - this.sliderHeight), 156 (this.sliderTop = 157 0 === this.maxScrollTop 158 ? 0 159 : (this.contentScrollTop * this.maxSliderTop) / 160 this.maxScrollTop)); 161 }), 162 (j.prototype.setOnScrollStyles = function () { 163 var a; 164 B 165 ? ((a = {}), (a[E] = "translate(0, " + this.sliderTop + "px)")) 166 : (a = { top: this.sliderTop }), 167 D 168 ? (y && this.scrollRAF && y(this.scrollRAF), 169 (this.scrollRAF = D( 170 (function (b) { 171 return function () { 172 return (b.scrollRAF = null), b.slider.css(a); 173 }; 174 })(this) 175 ))) 176 : this.slider.css(a); 177 }), 178 (j.prototype.createEvents = function () { 179 this.events = { 180 down: (function (a) { 181 return function (b) { 182 return ( 183 (a.isBeingDragged = !0), 184 (a.offsetY = b.pageY - a.slider.offset().top), 185 a.slider.is(b.target) || (a.offsetY = 0), 186 a.pane.addClass(a.options.activeClass), 187 a.doc.bind(n, a.events[h]).bind(o, a.events[w]), 188 a.body.bind(m, a.events[i]), 189 !1 190 ); 191 }; 192 })(this), 193 drag: (function (a) { 194 return function (b) { 195 return ( 196 (a.sliderY = 197 b.pageY - 198 a.$el.offset().top - 199 a.paneTop - 200 (a.offsetY || 0.5 * a.sliderHeight)), 201 a.scroll(), 202 a.contentScrollTop >= a.maxScrollTop && 203 a.prevScrollTop !== a.maxScrollTop 204 ? a.$el.trigger("scrollend") 205 : 0 === a.contentScrollTop && 206 0 !== a.prevScrollTop && 207 a.$el.trigger("scrolltop"), 208 !1 209 ); 210 }; 211 })(this), 212 up: (function (a) { 213 return function (b) { 214 return ( 215 (a.isBeingDragged = !1), 216 a.pane.removeClass(a.options.activeClass), 217 a.doc.unbind(n, a.events[h]).unbind(o, a.events[w]), 218 a.body.unbind(m, a.events[i]), 219 !1 220 ); 221 }; 222 })(this), 223 resize: (function (a) { 224 return function (b) { 225 a.reset(); 226 }; 227 })(this), 228 panedown: (function (a) { 229 return function (b) { 230 return ( 231 (a.sliderY = 232 (b.offsetY || b.originalEvent.layerY) - 233 0.5 * a.sliderHeight), 234 a.scroll(), 235 a.events.down(b), 236 !1 237 ); 238 }; 239 })(this), 240 scroll: (function (a) { 241 return function (b) { 242 a.updateScrollValues(), 243 a.isBeingDragged || 244 (a.iOSNativeScrolling || 245 ((a.sliderY = a.sliderTop), a.setOnScrollStyles()), 246 null != b && 247 (a.contentScrollTop >= a.maxScrollTop 248 ? (a.options.preventPageScrolling && 249 a.preventScrolling(b, g), 250 a.prevScrollTop !== a.maxScrollTop && 251 a.$el.trigger("scrollend")) 252 : 0 === a.contentScrollTop && 253 (a.options.preventPageScrolling && 254 a.preventScrolling(b, w), 255 0 !== a.prevScrollTop && 256 a.$el.trigger("scrolltop")))); 257 }; 258 })(this), 259 wheel: (function (a) { 260 return function (b) { 261 var c; 262 if (null != b) 263 return ( 264 (c = 265 b.delta || 266 b.wheelDelta || 267 (b.originalEvent && b.originalEvent.wheelDelta) || 268 -b.detail || 269 (b.originalEvent && -b.originalEvent.detail)), 270 c && (a.sliderY += -c / 3), 271 a.scroll(), 272 !1 273 ); 274 }; 275 })(this), 276 enter: (function (a) { 277 return function (b) { 278 var c; 279 if (a.isBeingDragged) 280 return 1 !== (b.buttons || b.which) 281 ? (c = a.events)[w].apply(c, arguments) 282 : void 0; 283 }; 284 })(this), 285 }; 286 }), 287 (j.prototype.addEvents = function () { 288 var a; 289 this.removeEvents(), 290 (a = this.events), 291 this.options.disableResize || this.win.bind(s, a[s]), 292 this.iOSNativeScrolling || 293 (this.slider.bind(l, a[g]), 294 this.pane.bind(l, a[r]).bind("" + p + " " + f, a[x])), 295 this.$content.bind("" + t + " " + p + " " + f + " " + v, a[t]); 296 }), 297 (j.prototype.removeEvents = function () { 298 var a; 299 (a = this.events), 300 this.win.unbind(s, a[s]), 301 this.iOSNativeScrolling || (this.slider.unbind(), this.pane.unbind()), 302 this.$content.unbind("" + t + " " + p + " " + f + " " + v, a[t]); 303 }), 304 (j.prototype.generate = function () { 305 var a, c, d, f, g, h, i; 306 return ( 307 (f = this.options), 308 (h = f.paneClass), 309 (i = f.sliderClass), 310 (a = f.contentClass), 311 (g = this.$el.children("." + h)).length || 312 g.children("." + i).length || 313 this.$el.append( 314 '<div class="' + h + '"><div class="' + i + '" /></div>' 315 ), 316 (this.pane = this.$el.children("." + h)), 317 (this.slider = this.pane.find("." + i)), 318 0 === e && C() 319 ? ((d = b 320 .getComputedStyle(this.content, null) 321 .getPropertyValue("padding-right") 322 .replace(/[^0-9.]+/g, "")), 323 (c = { right: -14, paddingRight: +d + 14 })) 324 : e && ((c = { right: -e }), this.$el.addClass(f.enabledClass)), 325 null != c && this.$content.css(c), 326 this 327 ); 328 }), 329 (j.prototype.restore = function () { 330 (this.stopped = !1), 331 this.iOSNativeScrolling || this.pane.show(), 332 this.addEvents(); 333 }), 334 (j.prototype.reset = function () { 335 var a, b, c, f, g, h, i, j, k, l, m, n; 336 return this.iOSNativeScrolling 337 ? void (this.contentHeight = this.content.scrollHeight) 338 : (this.$el.find("." + this.options.paneClass).length || 339 this.generate().stop(),
340 this.stopped && this.restore(), 341 (a = this.content), 342 (f = a.style), 343 (g = f.overflowY), 344 d && this.$content.css({ height: this.$content.height() }), 345 (b = a.scrollHeight + e), 346 (l = parseInt(this.$el.css("max-height"), 10)), 347 l > 0 && 348 (this.$el.height(""), 349 this.$el.height(a.scrollHeight > l ? l : a.scrollHeight)), 350 (i = this.pane.outerHeight(!1)), 351 (k = parseInt(this.pane.css("top"), 10)), 352 (h = parseInt(this.pane.css("bottom"), 10)), 353 (j = i + k + h), 354 (n = Math.round((j / b) * i)), 355 n < this.options.sliderMinHeight 356 ? (n = this.options.sliderMinHeight) 357 : null != this.options.sliderMaxHeight && 358 n > this.options.sliderMaxHeight && 359 (n = this.options.sliderMaxHeight), 360 g === t && f.overflowX !== t && (n += e), 361 (this.maxSliderTop = j - n), 362 (this.contentHeight = b), 363 (this.paneHeight = i), 364 (this.paneOuterHeight = j), 365 (this.sliderHeight = n), 366 (this.paneTop = k), 367 this.slider.height(n), 368 this.events.scroll(), 369 this.pane.show(), 370 (this.isActive = !0), 371 a.scrollHeight === a.clientHeight || 372 (this.pane.outerHeight(!0) >= a.scrollHeight && g !== t) 373 ? (this.pane.hide(), (this.isActive = !1)) 374 : this.el.clientHeight === a.scrollHeight && g === t 375 ? this.slider.hide() 376 : this.slider.show(), 377 this.pane.css({ 378 opacity: this.options.alwaysVisible ? 1 : "", 379 visibility: this.options.alwaysVisible ? "visible" : "", 380 }), 381 (c = this.$content.css("position")), 382 ("static" === c || "relative" === c) && 383 ((m = parseInt(this.$content.css("right"), 10)), 384 m && this.$content.css({ right: "", marginRight: m })), 385 this); 386 }), 387 (j.prototype.scroll = function () { 388 return this.isActive 389 ? ((this.sliderY = Math.max(0, this.sliderY)), 390 (this.sliderY = Math.min(this.maxSliderTop, this.sliderY)), 391 this.$content.scrollTop( 392 (this.maxScrollTop * this.sliderY) / this.maxSliderTop 393 ), 394 this.iOSNativeScrolling || 395 (this.updateScrollValues(), this.setOnScrollStyles()), 396 this) 397 : void 0; 398 }), 399 (j.prototype.scrollBottom = function (a) { 400 return this.isActive 401 ? (this.$content 402 .scrollTop(this.contentHeight - this.$content.height() - a) 403 .trigger(p), 404 this.stop().restore(), 405 this) 406 : void 0; 407 }), 408 (j.prototype.scrollTop = function (a) { 409 return this.isActive 410 ? (this.$content.scrollTop(+a).trigger(p), this.stop().restore(), this) 411 : void 0; 412 }), 413 (j.prototype.scrollTo = function (a) { 414 return this.isActive 415 ? (this.scrollTop(this.$el.find(a).get(0).offsetTop), this) 416 : void 0; 417 }), 418 (j.prototype.stop = function () { 419 return ( 420 y && this.scrollRAF && (y(this.scrollRAF), (this.scrollRAF = null)), 421 (this.stopped = !0), 422 this.removeEvents(), 423 this.iOSNativeScrolling || this.pane.hide(), 424 this 425 ); 426 }), 427 (j.prototype.destroy = function () { 428 return ( 429 this.stopped || this.stop(), 430 !this.iOSNativeScrolling && this.pane.length && this.pane.remove(), 431 d && this.$content.height(""), 432 this.$content.removeAttr("tabindex"), 433 this.$el.hasClass(this.options.enabledClass) && 434 (this.$el.removeClass(this.options.enabledClass), 435 this.$content.css({ right: "" })), 436 this 437 ); 438 }), 439 (j.prototype.flash = function () { 440 return !this.iOSNativeScrolling && this.isActive 441 ? (this.reset(), 442 this.pane.addClass(this.options.flashedClass), 443 setTimeout( 444 (function (a) { 445 return function () { 446 a.pane.removeClass(a.options.flashedClass); 447 }; 448 })(this), 449 this.options.flashDelay 450 ), 451 this) 452 : void 0; 453 }), 454 j 455 ); 456 })()), 457 (a.fn.nanoScroller = function (b) { 458 return this.each(function () { 459 var c, d; 460 if ( 461 ((d = this.nanoscroller) || 462 ((c = a.extend({}, z, b)), (this.nanoscroller = d = new q(this, c))), 463 b && "object" == typeof b) 464 ) { 465 if ((a.extend(d.options, b), null != b.scrollBottom)) 466 return d.scrollBottom(b.scrollBottom); 467 if (null != b.scrollTop) return d.scrollTop(b.scrollTop); 468 if (b.scrollTo) return d.scrollTo(b.scrollTo); 469 if ("bottom" === b.scroll) return d.scrollBottom(0); 470 if ("top" === b.scroll) return d.scrollTop(0); 471 if (b.scroll && b.scroll instanceof a) return d.scrollTo(b.scroll); 472 if (b.stop) return d.stop(); 473 if (b.destroy) return d.destroy(); 474 if (b.flash) return d.flash(); 475 } 476 return d.reset(); 477 }); 478 }), 479 (a.fn.nanoScroller.Constructor = q); 480});
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.