vendor: 13,495 bytes, lines 1-328
1/*! sidr - v2.2.1 - 2016-02-17 2 * http://www.berriart.com/sidr/ 3 * Copyright (c) 2013-2016 Alberto Varela; Licensed MIT */ 4! function() { 5 "use strict"; 6 7 function a(a, b, c) { 8 var d = new o(b); 9 switch (a) { 10 case "open": 11 d.open(c); 12 break; 13 case "close": 14 d.close(c); 15 break; 16 case "toggle": 17 d.toggle(c); 18 break; 19 default: 20 p.error("Method " + a + " does not exist on jQuery.sidr") 21 } 22 } 23 24 function b(a) { 25 return "status" === a ? h : s[a] ? s[a].apply(this, Array.prototype.slice.call(arguments, 1)) : "function" != typeof a && "string" != typeof a && a ? void q.error("Method " + a + " does not exist on jQuery.sidr") : s.toggle.apply(this, arguments) 26 } 27 28 function c(a, b) { 29 if ("function" == typeof b.source) { 30 var c = b.source(name); 31 a.html(c) 32 } else if ("string" == typeof b.source && i.isUrl(b.source)) u.get(b.source, function(b) { 33 a.html(b) 34 }); 35 else if ("string" == typeof b.source) { 36 var d = "", 37 e = b.source.split(","); 38 if (u.each(e, function(a, b) { 39 d += '<div class="sidr-inner">' + u(b).html() + "</div>" 40 }), b.renaming) { 41 var f = u("<div />").html(d); 42 f.find("*").each(function(a, b) { 43 var c = u(b); 44 i.addPrefixes(c) 45 }), d = f.html() 46 } 47 a.html(d) 48 } else null !== b.source && u.error("Invalid Sidr Source"); 49 return a 50 } 51 52 function d(a) { 53 var d = i.transitions, 54 e = u.extend({ 55 name: "sidr", 56 speed: 200, 57 side: "left", 58 source: null, 59 renaming: !0, 60 body: "body", 61 displace: !0, 62 timing: "ease", 63 method: "toggle", 64 bind: "touchstart click", 65 onOpen: function() {}, 66 onClose: function() {}, 67 onOpenEnd: function() {}, 68 onCloseEnd: function() {} 69 }, a), 70 f = e.name, 71 g = u("#" + f); 72 return 0 === g.length && (g = u("<div />").attr("id", f).appendTo(u("body"))), d.supported && g.css(d.property, e.side + " " + e.speed / 1e3 + "s " + e.timing), g.addClass("sidr").addClass(e.side).data({ 73 speed: e.speed, 74 side: e.side, 75 body: e.body, 76 displace: e.displace, 77 timing: e.timing, 78 method: e.method, 79 onOpen: e.onOpen, 80 onClose: e.onClose, 81 onOpenEnd: e.onOpenEnd, 82 onCloseEnd: e.onCloseEnd 83 }), g = c(g, e), this.each(function() { 84 var a = u(this), 85 c = a.data("sidr"), 86 d = !1; 87 c || (h.moving = !1, h.opened = !1, a.data("sidr", f), a.bind(e.bind, function(a) { 88 a.preventDefault(), d || (d = !0, b(e.method, f), setTimeout(function() { 89 d = !1 90 }, 100)) 91 })) 92 }) 93 } 94 var e = {}; 95 e.classCallCheck = function(a, b) { 96 if (!(a instanceof b)) throw new TypeError("Cannot call a class as a function") 97 }, e.createClass = function() { 98 function a(a, b) { 99 for (var c = 0; c < b.length; c++) { 100 var d = b[c]; 101 d.enumerable = d.enumerable || !1, d.configurable = !0, "value" in d && (d.writable = !0), Object.defineProperty(a, d.key, d) 102 } 103 } 104 return function(b, c, d) { 105 return c && a(b.prototype, c), d && a(b, d), b 106 } 107 }(); 108 var f, g, h = { 109 moving: !1, 110 opened: !1 111 }, 112 i = { 113 isUrl: function(a) { 114 var b = new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$", "i"); 115 return b.test(a) ? !0 : !1 116 }, 117 addPrefixes: function(a) { 118 this.addPrefix(a, "id"), this.addPrefix(a, "class"), a.removeAttr("style") 119 }, 120 addPrefix: function(a, b) { 121 var c = a.attr(b); 122 "string" == typeof c && "" !== c && "sidr-inner" !== c && a.attr(b, c.replace(/([A-Za-z0-9_.\-]+)/g, "sidr-" + b + "-$1")) 123 }, 124 transitions: function() { 125 var a = document.body || document.documentElement, 126 b = a.style, 127 c = !1, 128 d = "transition"; 129 return d in b ? c = !0 : ! function() { 130 var a = ["moz", "webkit", "o", "ms"], 131 e = void 0, 132 f = void 0; 133 d = d.charAt(0).toUpperCase() + d.substr(1), c = function() { 134 for (f = 0; f < a.length; f++) 135 if (e = a[f], e + d in b) return !0; 136 return !1 137 }(), d = c ? "-" + e.toLowerCase() + "-" + d.toLowerCase() : null 138 }(), { 139 supported: c, 140 property: d 141 } 142 }() 143 }, 144 j = jQuery, 145 k = "sidr-animating", 146 l = "open", 147 m = "close", 148 n = "webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend", 149 o = function() { 150 function a(b) { 151 e.classCallCheck(this, a), this.name = b, this.item = j("#" + b), this.openClass = "sidr" === b ? "sidr-open" : "sidr-open " + b + "-open", this.menuWidth = this.item.outerWidth(!0), this.speed = this.item.data("speed"), this.side = this.item.data("side"), this.displace = this.item.data("displace"), this.timing = this.item.data("timing"), this.method = this.item.data("method"), this.onOpenCallback = this.item.data("onOpen"), this.onCloseCallback = this.item.data("onClose"), this.onOpenEndCallback = this.item.data("onOpenEnd"), this.onCloseEndCallback = this.item.data("onCloseEnd"), this.body = j(this.item.data("body")) 152 } 153 return e.createClass(a, [{ 154 key: "getAnimation", 155 value: function(a, b) { 156 var c = {}, 157 d = this.side; 158 return "open" === a && "body" === b ? c[d] = this.menuWidth + "px" : "close" === a && "menu" === b ? c[d] = "-" + this.menuWidth + "px" : c[d] = 0, c 159 } 160 }, { 161 key: "prepareBody", 162 value: function(a) { 163 var b = "open" === a ? "hidden" : ""; 164 if (this.body.is("body")) { 165 var c = j("html"), 166 d = c.scrollTop(); 167 c.css("overflow-x", b).scrollTop(d) 168 } 169 } 170 }, { 171 key: "openBody", 172 value: function() { 173 if (this.displace) { 174 var a = i.transitions, 175 b = this.body; 176 if (a.supported) b.css(a.property, this.side + " " + this.speed / 1e3 + "s " + this.timing).css(this.side, 0).css({ 177 width: b.width(), 178 position: "absolute" 179 }), b.css(this.side, this.menuWidth + "px"); 180 else { 181 var c = this.getAnimation(l, "body"); 182 b.css({ 183 width: b.width(), 184 position: "absolute" 185 }).animate(c, { 186 queue: !1, 187 duration: this.speed 188 }) 189 } 190 } 191 } 192 }, { 193 key: "onCloseBody", 194 value: function() { 195 var a = i.transitions, 196 b = { 197 width: "", 198 position: "", 199 right: "", 200 left: "" 201 }; 202 a.supported && (b[a.property] = ""), this.body.css(b).unbind(n) 203 } 204 }, { 205 key: "closeBody", 206 value: function() { 207 var a = this; 208 if (this.displace) 209 if (i.transitions.supported) this.body.css(this.side, 0).one(n, function() { 210 a.onCloseBody() 211 }); 212 else { 213 var b = this.getAnimation(m, "body"); 214 this.body.animate(b, { 215 queue: !1, 216 duration: this.speed, 217 complete: function() { 218 a.onCloseBody() 219 } 220 }) 221 } 222 } 223 }, { 224 key: "moveBody", 225 value: function(a) { 226 a === l ? this.openBody() : this.closeBody() 227 } 228 }, { 229 key: "onOpenMenu", 230 value: function(a) { 231 var b = this.name; 232 h.moving = !1, h.opened = b, this.item.unbind(n), this.body.removeClass(k).addClass(this.openClass), this.onOpenEndCallback(), "function" == typeof a && a(b) 233 } 234 }, { 235 key: "openMenu", 236 value: function(a) { 237 var b = this, 238 c = this.item; 239 if (i.transitions.supported) c.css(this.side, 0).one(n, function() { 240 b.onOpenMenu(a) 241 }); 242 else { 243 var d = this.getAnimation(l, "menu"); 244 c.css("display", "block").animate(d, { 245 queue: !1, 246 duration: this.speed, 247 complete: function() { 248 b.onOpenMenu(a) 249 } 250 }) 251 } 252 } 253 }, { 254 key: "onCloseMenu", 255 value: function(a) { 256 this.item.css({ 257 left: "", 258 right: "" 259 }).unbind(n), j("html").css("overflow-x", ""), h.moving = !1, h.opened = !1, this.body.removeClass(k).removeClass(this.openClass), this.onCloseEndCallback(), "function" == typeof a && a(name) 260 } 261 }, { 262 key: "closeMenu", 263 value: function(a) { 264 var b = this, 265 c = this.item; 266 if (i.transitions.supported) c.css(this.side, "").one(n, function() { 267 b.onCloseMenu(a) 268 }); 269 else { 270 var d = this.getAnimation(m, "menu"); 271 c.animate(d, { 272 queue: !1, 273 duration: this.speed, 274 complete: function() { 275 b.onCloseMenu() 276 } 277 }) 278 } 279 } 280 }, { 281 key: "moveMenu", 282 value: function(a, b) { 283 this.body.addClass(k), a === l ? this.openMenu(b) : this.closeMenu(b) 284 } 285 }, { 286 key: "move", 287 value: function(a, b) { 288 h.moving = !0, this.prepareBody(a), this.moveBody(a), this.moveMenu(a, b) 289 } 290 }, { 291 key: "open", 292 value: function(b) { 293 var c = this; 294 if (h.opened !== this.name && !h.moving) { 295 if (h.opened !== !1) { 296 var d = new a(h.opened); 297 return void d.close(function() { 298 c.open(b) 299 }) 300 } 301 this.move("open", b), this.onOpenCallback() 302 } 303 } 304 }, { 305 key: "close", 306 value: function(a) { 307 h.opened !== this.name || h.moving || (this.move("close", a), this.onCloseCallback()) 308 } 309 }, { 310 key: "toggle", 311 value: function(a) { 312 h.opened === this.name ? this.close(a) : this.open(a) 313 } 314 }]), a 315 }(), 316 p = jQuery, 317 q = jQuery, 318 r = ["open", "close", "toggle"], 319 s = {}, 320 t = function(b) { 321 return function(c, d) { 322 "function" == typeof c ? (d = c, c = "sidr") : c || (c = "sidr"), a(b, c, d) 323 } 324 }; 325 for (f = 0; f < r.length; f++) g = r[f], s[g] = t(g); 326 var u = jQuery; 327 jQuery.sidr = b, jQuery.fn.sidr = d 328}();
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.