vendor: 4,448 bytes, lines 1-31
1/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la) 2 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 3 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 4 * 5 * Version: 1.3.3 6 * 7 */ 8(function (e) { 9 e.fn.extend({ 10 slimScroll: function (g) { 11 var a = e.extend({ width: "auto", height: "250px", size: "7px", color: "#464646", position: "right", distance: "1px", start: "top", opacity: 1, alwaysVisible: !1, disableFadeOut: !1, railVisible: !1, railColor: "#333", railOpacity: .2, railDraggable: !0, railClass: "slimScrollRail", barClass: "slimScrollBar", wrapperClass: "slimScrollDiv", allowPageScroll: !1, wheelStep: 20, touchScrollStep: 200, borderRadius: "7px", railBorderRadius: "7px" }, g); this.each(function () { 12 function u(d) { 13 if (r) { 14 d = d || window.event; 15 var c = 0; d.wheelDelta && (c = -d.wheelDelta / 120); d.detail && (c = d.detail / 3); e(d.target || d.srcTarget || d.srcElement).closest("." + a.wrapperClass).is(b.parent()) && m(c, !0); d.preventDefault && !k && d.preventDefault(); k || (d.returnValue = !1) 16 } 17 } function m(d, e, g) { 18 k = !1; var f = d, h = b.outerHeight() - c.outerHeight(); e && (f = parseInt(c.css("top")) + d * parseInt(a.wheelStep) / 100 * c.outerHeight(), f = Math.min(Math.max(f, 0), h), f = 0 < d ? Math.ceil(f) : Math.floor(f), c.css({ top: f + "px" })); l = parseInt(c.css("top")) / (b.outerHeight() - c.outerHeight()); 19 f = l * (b[0].scrollHeight - b.outerHeight()); g && (f = d, d = f / b[0].scrollHeight * b.outerHeight(), d = Math.min(Math.max(d, 0), h), c.css({ top: d + "px" })); b.scrollTop(f); b.trigger("slimscrolling", ~~f); v(); p() 20 } function C() { window.addEventListener ? (this.addEventListener("DOMMouseScroll", u, !1), this.addEventListener("mousewheel", u, !1)) : document.attachEvent("onmousewheel", u) } function w() { s = Math.max(b.outerHeight() / b[0].scrollHeight * b.outerHeight(), 30); c.css({ height: s + "px" }); var a = s == b.outerHeight() ? "none" : "block"; c.css({ display: a }) } 21 function v() { w(); clearTimeout(A); l == ~~l ? (k = a.allowPageScroll, B != l && b.trigger("slimscroll", 0 == ~~l ? "top" : "bottom")) : k = !1; B = l; s >= b.outerHeight() ? k = !0 : (c.stop(!0, !0).fadeIn("fast"), a.railVisible && h.stop(!0, !0).fadeIn("fast")) } function p() { a.alwaysVisible || (A = setTimeout(function () { a.disableFadeOut && r || x || y || (c.fadeOut("slow"), h.fadeOut("slow")) }, 1E3)) } var r, x, y, A, z, s, l, B, k = !1, b = e(this); if (b.parent().hasClass(a.wrapperClass)) { 22 var n = b.scrollTop(), c = b.parent().find("." + a.barClass), h = b.parent().find("." + a.railClass); 23 w(); if (e.isPlainObject(g)) { if ("height" in g && "auto" == g.height) { b.parent().css("height", "auto"); b.css("height", "auto"); var q = b.parent().parent().height(); b.parent().css("height", q); b.css("height", q) } if ("scrollTo" in g) n = parseInt(a.scrollTo); else if ("scrollBy" in g) n += parseInt(a.scrollBy); else if ("destroy" in g) { c.remove(); h.remove(); b.unwrap(); return } m(n, !1, !0) } 24 } else if (!(e.isPlainObject(g) && "destroy" in g)) { 25 a.height = "auto" == a.height ? b.parent().height() : a.height; n = e("<div></div>").addClass(a.wrapperClass).css({ 26 position: "relative", 27 overflow: "hidden", width: a.width, height: a.height 28 }); b.css({ overflow: "hidden", width: a.width, height: a.height }); var h = e("<div></div>").addClass(a.railClass).css({ width: a.size, height: "100%", position: "absolute", top: 0, display: a.alwaysVisible && a.railVisible ? "block" : "none", "border-radius": a.railBorderRadius, background: a.railColor, opacity: a.railOpacity, zIndex: 90 }), c = e("<div></div>").addClass(a.barClass).css({ 29 background: a.color, width: a.size, position: "absolute", top: 0, opacity: a.opacity, display: a.alwaysVisible ? 30 "block" : "none", "border-radius": a.borderRadius, BorderRadius: a.borderRadius, MozBorderRadius: a.borderRadius, WebkitBorderRadius: a.borderRadius, zIndex: 99 31 }), q = "right" == a.position ? { right: a.distance } : { left: a.distance };
31 h.css(q); c.css(q); b.wrap(n); b.parent().append(c); b.parent().append(h); a.railDraggable && c.bind("mousedown", function (a) { 32 var b = e(document); y = !0; t = parseFloat(c.css("top")); pageY = a.pageY; b.bind("mousemove.slimscroll", function (a) { currTop = t + a.pageY - pageY; c.css("top", currTop); m(0, c.position().top, !1) }); 33 b.bind("mouseup.slimscroll", function (a) { y = !1; p(); b.unbind(".slimscroll") }); return !1 34 }).bind("selectstart.slimscroll", function (a) { a.stopPropagation(); a.preventDefault(); return !1 }); h.hover(function () { v() }, function () { p() }); c.hover(function () { x = !0 }, function () { x = !1 }); b.hover(function () { r = !0; v(); p() }, function () { r = !1; p() }); b.bind("touchstart", function (a, b) { a.originalEvent.touches.length && (z = a.originalEvent.touches[0].pageY) }); b.bind("touchmove", function (b) { 35 k || b.originalEvent.preventDefault(); b.originalEvent.touches.length && 36 (m((z - b.originalEvent.touches[0].pageY) / a.touchScrollStep, !0), z = b.originalEvent.touches[0].pageY) 37 }); w(); "bottom" === a.start ? (c.css({ top: b.outerHeight() - c.outerHeight() }), m(0, !0)) : "top" !== a.start && (m(e(a.start).position().top, null, !0), a.alwaysVisible || c.hide()); C() 38 } 39 }); return this 40 } 41 }); e.fn.extend({ slimscroll: e.fn.slimScroll }) 42})(jQuery); 43 44/* 45* Pixor - Copyright (c) Federico Schiocchet - Pixor (www.pixor.it) - Framework Y (www.framework-y.com) 46*/ 47 48(function ($) { 49 50 $.fn.initSlimScroll = function () { 51 if (!$(this).hasClass("scroll-mobile-disabled") || device_screen_size != "device-xs") { 52 var optionsString = $(this).attr("data-options"); 53 var optionsArr; 54 var options = { 55 height: 0, 56 size: '4px' 57 } 58 if (!isEmpty(optionsString)) { 59 optionsArr = optionsString.split(","); 60 options = getOptionsString(optionsString, options); 61 }
62 if (device_screen_size == "device-xs") options['alwaysVisible'] = true; 63 64 var wh = $(window).height(); 65 var vh = getHeightFullscreen(this, wh); 66 var lh = $(this).attr("data-height-remove"); 67 if (isEmpty(lh)) lh = 0; 68 vh += ""; 69 70 if ((vh.indexOf("#") != -1) || (vh.indexOf(".") != -1)) vh = "" + ($(this).closest(vh).height() - lh); 71 72 options['height'] = vh + "px"; 73 $(this).slimScroll(options); 74 75 if ($.isFunction($.fn.googleMap)) { 76 $(this).find(".google-map").each(function (index) { 77 $(this).googleMap(); 78 }); 79 } 80 if (!options['alwaysVisible']) $(".slimScrollBar").hide(); 81 } 82 } 83 function getHeightFullscreen(t, wh) { 84 var vh = $(t).attr("data-height"); 85 var lh = $(t).attr("data-height-remove"); 86 if (isEmpty(vh) || vh == "auto") { 87 var h = wh - $(t)[0].getBoundingClientRect().top - $("footer").outerHeight(), ch = $(t).outerHeight(); 88 if (!isEmpty(lh)) h = wh - lh; 89 vh = (ch < h) ? ch + 30 : h - 30; 90 } 91 if (vh == "fullscreen") { 92 var h = wh; 93 if (!isEmpty(lh) && ((wh - lh) > 150)) h = wh - lh; 94 else h = wh - 100; 95 vh = h; 96 } 97 return vh; 98 } 99 $(document).ready(function () { 100 $(".scroll-content").each(function () { 101 $(this).initSlimScroll(); 102 if (device_screen_size == "device-xs") $(".slimScrollBar").css("height", "50px"); 103 }); 104 $(".scroll-content").bind("mousewheel DOMMouseScroll", function (n) { n.preventDefault() }); 105 }); 106}(jQuery)); 107 108
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.