vendor: 9,680 bytes, lines 1-193
1/* 2 * Remodal - v1.1.1 3 * Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking. 4 * http://vodkabears.github.io/remodal/ 5 * 6 * Made by Ilya Makarov 7 * Under MIT License 8 */ 9! function (a, b) { 10 "function" == typeof define && define.amd ? define(["jquery"], function (c) { 11 return b(a, c) 12 }) : "object" == typeof exports ? b(a, require("jquery")) : b(a, a.jQuery || a.Zepto) 13}(this, function (a, b) { 14 "use strict"; 15 16 function c(a) { 17 if (w && "none" === a.css("animation-name") && "none" === a.css("-webkit-animation-name") && "none" === a.css("-moz-animation-name") && "none" === a.css("-o-animation-name") && "none" === a.css("-ms-animation-name")) return 0; 18 var b, c, d, e, f = a.css("animation-duration") || a.css("-webkit-animation-duration") || a.css("-moz-animation-duration") || a.css("-o-animation-duration") || a.css("-ms-animation-duration") || "0s", 19 g = a.css("animation-delay") || a.css("-webkit-animation-delay") || a.css("-moz-animation-delay") || a.css("-o-animation-delay") || a.css("-ms-animation-delay") || "0s", 20 h = a.css("animation-iteration-count") || a.css("-webkit-animation-iteration-count") || a.css("-moz-animation-iteration-count") || a.css("-o-animation-iteration-count") || a.css("-ms-animation-iteration-count") || "1"; 21 for (f = f.split(", "), g = g.split(", "), h = h.split(", "), e = 0, c = f.length, b = Number.NEGATIVE_INFINITY; e < c; e++) d = parseFloat(f[e]) * parseInt(h[e], 10) + parseFloat(g[e]), d > b && (b = d); 22 return b 23 } 24 25 function d() { 26 if (b(document).height() <= b(window).height()) return 0; 27 var a, c, d = document.createElement("div"), 28 e = document.createElement("div"); 29 return d.style.visibility = "hidden", d.style.width = "100px", document.body.appendChild(d), a = d.offsetWidth, d.style.overflow = "scroll", e.style.width = "100%", d.appendChild(e), c = e.offsetWidth, d.parentNode.removeChild(d), a - c 30 } 31 32 function e() { 33 if (!x) { 34 var a, c, e = b("html"), 35 f = k("is-locked"); 36 e.hasClass(f) || (c = b(document.body), a = parseInt(c.css("padding-right"), 10) + d(), c.css("padding-right", a + "px"), e.addClass(f)) 37 } 38 } 39 40 function f() { 41 if (!x) { 42 var a, c, e = b("html"), 43 f = k("is-locked"); 44 e.hasClass(f) && (c = b(document.body), a = parseInt(c.css("padding-right"), 10) - d(), c.css("padding-right", a + "px"), e.removeClass(f)) 45 } 46 } 47 48 function g(a, b, c, d) { 49 var e = k("is", b), 50 f = [k("is", u.CLOSING), k("is", u.OPENING), k("is", u.CLOSED), k("is", u.OPENED)].join(" "); 51 a.$bg.removeClass(f).addClass(e), a.$overlay.removeClass(f).addClass(e), a.$wrapper.removeClass(f).addClass(e), a.$modal.removeClass(f).addClass(e), a.state = b, !c && a.$modal.trigger({ 52 type: b, 53 reason: d 54 }, [{ 55 reason: d 56 }]) 57 } 58 59 function h(a, d, e) { 60 var f = 0, 61 g = function (a) { 62 a.target === this && f++ 63 }, 64 h = function (a) { 65 a.target === this && 0 === --f && (b.each(["$bg", "$overlay", "$wrapper", "$modal"], function (a, b) { 66 e[b].off(r + " " + s) 67 }), d()) 68 }; 69 b.each(["$bg", "$overlay", "$wrapper", "$modal"], function (a, b) { 70 e[b].on(r, g).on(s, h) 71 }), a(), 0 === c(e.$bg) && 0 === c(e.$overlay) && 0 === c(e.$wrapper) && 0 === c(e.$modal) && (b.each(["$bg", "$overlay", "$wrapper", "$modal"], function (a, b) { 72 e[b].off(r + " " + s) 73 }), d()) 74 } 75 76 function i(a) { 77 a.state !== u.CLOSED && (b.each(["$bg", "$overlay", "$wrapper", "$modal"], function (b, c) { 78 a[c].off(r + " " + s) 79 }), a.$bg.removeClass(a.settings.modifier), a.$overlay.removeClass(a.settings.modifier).hide(), a.$wrapper.hide(), f(), g(a, u.CLOSED, !0)) 80 } 81 82 function j(a) { 83 var b, c, d, e, f = {}; 84 for (a = a.replace(/\s*:\s*/g, ":").replace(/\s*,\s*/g, ","), b = a.split(","), e = 0, c = b.length; e < c; e++) b[e] = b[e].split(":"), d = b[e][1], ("string" == typeof d || d instanceof String) && (d = "true" === d || "false" !== d && d), ("string" == typeof d || d instanceof String) && (d = isNaN(d) ? d : +d), f[b[e][0]] = d; 85 return f 86 } 87 88 function k() { 89 for (var a = q, b = 0; b < arguments.length; ++b) a += "-" + arguments[b]; 90 return a 91 } 92 93 function l() { 94 var a, c, d = location.hash.replace("#", ""); 95 if (d) { 96 try { 97 c = b('[data-remodal-id="' + d + '"]') 98 } catch (e) {} 99 c && c.length && (a = b[p].lookup[c.data(p)], a && a.settings.hashTracking && a.open()) 100 } else n && n.state === u.OPENED && n.settings.hashTracking && n.close() 101 } 102 103 function m(a, c) { 104 var d = b(document.body), 105 e = d, 106 f = this; 107 f.settings = b.extend({}, t, c), f.index = b[p].lookup.push(f) - 1, f.state = u.CLOSED, f.$overlay = b("." + k("overlay")), null !== f.settings.appendTo && f.settings.appendTo.length && (e = b(f.settings.appendTo)), f.$overlay.length || (f.$overlay = b("<div>").addClass(k("overlay") + " " + k("is", u.CLOSED)).hide(), e.append(f.$overlay)), f.$bg = b("." + k("bg")).addClass(k("is", u.CLOSED)), f.$modal = a.addClass(q + " " + k("is-initialized") + " " + f.settings.modifier + " " + k("is", u.CLOSED)).attr("tabindex", "-1"), f.$wrapper = b("<div>").addClass(k("wrapper") + " " + f.settings.modifier + " " + k("is", u.CLOSED)).hide().append(f.$modal), e.append(f.$wrapper), f.$wrapper.on("click." + q, '[data-remodal-action="close"]', function (a) { 108 a.preventDefault(), f.close() 109 }), f.$wrapper.on("click." + q, '[data-remodal-action="cancel"]', function (a) { 110 a.preventDefault(), f.$modal.trigger(v.CANCELLATION), f.settings.closeOnCancel && f.close(v.CANCELLATION) 111 }), f.$wrapper.on("click." + q, '[data-remodal-action="confirm"]', function (a) { 112 a.preventDefault(), f.$modal.trigger(v.CONFIRMATION), f.settings.closeOnConfirm && f.close(v.CONFIRMATION) 113 }), f.$wrapper.on("click." + q, function (a) { 114 var c = b(a.target); 115 c.hasClass(k("wrapper")) && f.settings.closeOnOutsideClick && f.close() 116 }) 117 } 118 var n, o, p = "remodal", 119 q = a.REMODAL_GLOBALS && a.REMODAL_GLOBALS.NAMESPACE || p, 120 r = b.map(["animationstart", "webkitAnimationStart", "MSAnimationStart", "oAnimationStart"], function (a) { 121 return a + "." + q 122 }).join(" "), 123 s = b.map(["animationend", "webkitAnimationEnd", "MSAnimationEnd", "oAnimationEnd"], function (a) { 124 return a + "." + q 125 }).join(" "), 126 t = b.extend({ 127 hashTracking: !0, 128 closeOnConfirm: !0, 129 closeOnCancel: !0, 130 closeOnEscape: !0, 131 closeOnOutsideClick: !0, 132 modifier: "", 133 appendTo: null 134 }, a.REMODAL_GLOBALS && a.REMODAL_GLOBALS.DEFAULTS), 135 u = { 136 CLOSING: "closing", 137 CLOSED: "closed", 138 OPENING: "opening", 139 OPENED: "opened" 140 }, 141 v = { 142 CONFIRMATION: "confirmation", 143 CANCELLATION: "cancellation" 144 }, 145 w = function () { 146 var a = document.createElement("div").style; 147 return void 0 !== a.animationName || void 0 !== a.WebkitAnimationName || void 0 !== a.MozAnimationName || void 0 !== a.msAnimationName || void 0 !== a.OAnimationName 148 }(), 149 x = /iPad|iPhone|iPod/.test(navigator.platform); 150 m.prototype.open = function () { 151 var a, c = this; 152 c.state !== u.OPENING && c.state !== u.CLOSING && (a = c.$modal.attr("data-remodal-id"), a && c.settings.hashTracking && (o = b(window).scrollTop(), location.hash = a), n && n !== c && i(n), n = c, e(), c.$bg.addClass(c.settings.modifier), c.$overlay.addClass(c.settings.modifier).show(), c.$wrapper.show().scrollTop(0), c.$modal.focus(), h(function () { 153 g(c, u.OPENING) 154 }, function () { 155 g(c, u.OPENED) 156 }, c)) 157 }, m.prototype.close = function (a) { 158 var c = this; 159 c.state !== u.OPENING && c.state !== u.CLOSING && c.state !== u.CLOSED && (c.settings.hashTracking && c.$modal.attr("data-remodal-id") === location.hash.substr(1) && (location.hash = "", b(window).scrollTop(o)), h(function () { 160 g(c, u.CLOSING, !1, a) 161 }, function () { 162 c.$bg.removeClass(c.settings.modifier), c.$overlay.removeClass(c.settings.modifier).hide(), c.$wrapper.hide(), f(), g(c, u.CLOSED, !1, a) 163 }, c)) 164 }, m.prototype.getState = function () { 165 return this.state 166 }, m.prototype.destroy = function () { 167 var a, c = b[p].lookup; 168 i(this), this.$wrapper.remove(), delete c[this.index], a = b.grep(c, function (a) { 169 return !!a 170 }).length, 0 === a && (this.$overlay.remove(), this.$bg.removeClass(k("is", u.CLOSING) + " " + k("is", u.OPENING) + " " + k("is", u.CLOSED) + " " + k("is", u.OPENED))) 171 }, b[p] = { 172 lookup: [] 173 }, b.fn[p] = function (a) { 174 var c, d; 175 return this.each(function (e, f) { 176 d = b(f), null == d.data(p) ? (c = new m(d, a), d.data(p, c.index), c.settings.hashTracking && d.attr("data-remodal-id") === location.hash.substr(1) && c.open()) : c = b[p].lookup[d.data(p)] 177 }), c 178 }, b(document).ready(function () { 179 b(document).on("click", "[data-remodal-target]", function (a) { 180 a.preventDefault(); 181 var c = a.currentTarget, 182 d = c.getAttribute("data-remodal-target"), 183 e = b('[data-remodal-id="' + d + '"]'); 184 b[p].lookup[e.data(p)].open() 185 }), b(document).find("." + q).each(function (a, c) { 186 var d = b(c), 187 e = d.data("remodal-options"); 188 e ? ("string" == typeof e || e instanceof String) && (e = j(e)) : e = {}, d[p](e) 189 }), b(document).on("keydown." + q, function (a) { 190 n && n.settings.closeOnEscape && n.state === u.OPENED && 27 === a.keyCode && n.close() 191 }), b(window).on("hashchange." + q, l) 192 }) 193});
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.