1/*! 2 * Copyright (c) 2011-2013 Felix Gnass 3 * Licensed under the MIT license 4 */ 5(function (t, e) { 6 "object" == typeof exports ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : t.Spinner = e() 7})(this, function () { 8 "use strict"; 9 function t(t, e) { 10 var i, n = document.createElement(t || "div"); 11 for (i in e)n[i] = e[i]; 12 return n 13 } 14 15 function e(t) { 16 for (var e = 1, i = arguments.length; i > e; e++)t.appendChild(arguments[e]); 17 return t 18 } 19 20 function i(t, e, i, n) { 21 var o = ["opacity", e, ~~(100 * t), i, n].join("-"), r = .01 + 100 * (i / n), a = Math.max(1 - (1 - t) / e * (100 - r), t), s = u.substring(0, u.indexOf("Animation")).toLowerCase(), l = s && "-" + s + "-" || ""; 22 return f[o] || (c.insertRule("@" + l + "keyframes " + o + "{" + "0%{opacity:" + a + "}" + r + "%{opacity:" + t + "}" + (r + .01) + "%{opacity:1}" + (r + e) % 100 + "%{opacity:" + t + "}" + "100%{opacity:" + a + "}" + "}", c.cssRules.length), f[o] = 1), o 23 } 24 25 function n(t, e) { 26 var i, n, o = t.style; 27 if (void 0 !== o[e])return e; 28 for (e = e.charAt(0).toUpperCase() + e.slice(1), n = 0; d.length > n; n++)if (i = d[n] + e, void 0 !== o[i])return i 29 } 30 31 function o(t, e) { 32 for (var i in e)t.style[n(t, i) || i] = e[i]; 33 return t 34 } 35 36 function r(t) { 37 for (var e = 1; arguments.length > e; e++) { 38 var i = arguments[e]; 39 for (var n in i)void 0 === t[n] && (t[n] = i[n]) 40 } 41 return t 42 } 43 44 function a(t) { 45 for (var e = {x: t.offsetLeft, y: t.offsetTop}; t = t.offsetParent;)e.x += t.offsetLeft, e.y += t.offsetTop; 46 return e 47 } 48 49 function s(t) { 50 return this === void 0 ? new s(t) : (this.opts = r(t || {}, s.defaults, p), void 0) 51 } 52 53 function l() { 54 function i(e, i) { 55 return t("<" + e + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', i) 56 } 57 58 c.addRule(".spin-vml", "behavior:url(#default#VML)"), s.prototype.lines = function (t, n) { 59 function r() { 60 return o(i("group", {coordsize: u + " " + u, coordorigin: -l + " " + -l}), {width: u, height: u}) 61 } 62 63 function a(t, a, s) { 64 e(f, e(o(r(), { 65 rotation: 360 / n.lines * t + "deg", 66 left: ~~a 67 }), e(o(i("roundrect", {arcsize: n.corners}), { 68 width: l, 69 height: n.width, 70 left: n.radius, 71 top: -n.width >> 1, 72 filter: s 73 }), i("fill", {color: n.color, opacity: n.opacity}), i("stroke", {opacity: 0})))) 74 } 75 76 var s, l = n.length + n.width, u = 2 * l, d = 2 * -(n.width + n.length) + "px", f = o(r(), { 77 position: "absolute", 78 top: d, 79 left: d 80 }); 81 if (n.shadow)for (s = 1; n.lines >= s; s++)a(s, -2, "progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)"); 82 for (s = 1; n.lines >= s; s++)a(s); 83 return e(t, f) 84 }, s.prototype.opacity = function (t, e, i, n) { 85 var o = t.firstChild; 86 n = n.shadow && n.lines || 0, o && o.childNodes.length > e + n && (o = o.childNodes[e + n], o = o && o.firstChild, o = o && o.firstChild, o && (o.opacity = i)) 87 } 88 } 89 90 var u, d = ["webkit", "Moz", "ms", "O"], f = {}, c = function () { 91 var i = t("style", {type: "text/css"}); 92 return e(document.getElementsByTagName("head")[0], i), i.sheet || i.styleSheet 93 }(), p = { 94 lines: 12, 95 length: 7, 96 width: 5, 97 radius: 10, 98 rotate: 0, 99 corners: 1, 100 color: "#000", 101 direction: 1, 102 speed: 1, 103 trail: 100, 104 opacity: .25, 105 fps: 20, 106 zIndex: 2e9, 107 className: "spinner", 108 top: "auto", 109 left: "auto", 110 position: "relative" 111 }; 112 s.defaults = {}, r(s.prototype, { 113 spin: function (e) { 114 this.stop(); 115 var i, n, r = this, s = r.opts, l = r.el = o(t(0, {className: s.className}), { 116 position: s.position, 117 width: 0, 118 zIndex: s.zIndex 119 }), d = s.radius + s.length + s.width; 120 if (e && (e.insertBefore(l, e.firstChild || null), n = a(e), i = a(l), o(l, { 121 left: ("auto" == s.left ? n.x - i.x + (e.offsetWidth >>
121 1) : parseInt(s.left, 10) + d) + "px", 122 top: ("auto" == s.top ? n.y - i.y + (e.offsetHeight >> 1) : parseInt(s.top, 10) + d) + "px" 123 })), l.setAttribute("role", "progressbar"), r.lines(l, r.opts), !u) { 124 var f, c = 0, p = (s.lines - 1) * (1 - s.direction) / 2, h = s.fps, m = h / s.speed, g = (1 - s.opacity) / (m * s.trail / 100), v = m / s.lines; 125 (function y() { 126 c++; 127 for (var t = 0; s.lines > t; t++)f = Math.max(1 - (c + (s.lines - t) * v) % m * g, s.opacity), r.opacity(l, t * s.direction + p, f, s); 128 r.timeout = r.el && setTimeout(y, ~~(1e3 / h)) 129 })() 130 } 131 return r 132 }, stop: function () { 133 var t = this.el; 134 return t && (clearTimeout(this.timeout), t.parentNode && t.parentNode.removeChild(t), this.el = void 0), this 135 }, lines: function (n, r) { 136 function a(e, i) { 137 return o(t(), { 138 position: "absolute", 139 width: r.length + r.width + "px", 140 height: r.width + "px", 141 background: e, 142 boxShadow: i, 143 transformOrigin: "left", 144 transform: "rotate(" + ~~(360 / r.lines * l + r.rotate) + "deg) translate(" + r.radius + "px" + ",0)", 145 borderRadius: (r.corners * r.width >> 1) + "px" 146 }) 147 } 148 149 for (var s, l = 0, d = (r.lines - 1) * (1 - r.direction) / 2; r.lines > l; l++)s = o(t(), { 150 position: "absolute", 151 top: 1 + ~(r.width / 2) + "px", 152 transform: r.hwaccel ? "translate3d(0,0,0)" : "", 153 opacity: r.opacity, 154 animation: u && i(r.opacity, r.trail, d + l * r.direction, r.lines) + " " + 1 / r.speed + "s linear infinite" 155 }), r.shadow && e(s, o(a("#000", "0 0 4px #000"), {top: "2px"})), e(n, e(s, a(r.color, "0 0 1px rgba(0,0,0,.1)"))); 156 return n 157 }, opacity: function (t, e, i) { 158 t.childNodes.length > e && (t.childNodes[e].style.opacity = i) 159 } 160 }); 161 var h = o(t("group"), {behavior: "url(#default#VML)"}); 162 return !n(h, "transform") && h.adj ? l() : u = n(h, "animation"), s 163});
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.