Created
September 9, 2011 15:59
-
-
Save robcee/1206588 to your computer and use it in GitHub Desktop.
Tilt reprettified
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| var f = void 0, | |
| k = null; | |
| function aa() { | |
| return function() {} | |
| } | |
| function ca(a) { | |
| return function(b) { | |
| this[a] = b | |
| } | |
| } | |
| function N(a) { | |
| return function() { | |
| return this[a] | |
| } | |
| } | |
| var R, | |
| TiltChrome = TiltChrome || {}; | |
| TiltChrome.BrowserOverlay = { | |
| href: k, | |
| canvas: k, | |
| n: k, | |
| D: k, | |
| I: k, | |
| initialize: function() { | |
| this.d(!0); | |
| if (this.href === window.content.location.href) this.href = k; | |
| else { | |
| this.href = window.content.location.href; | |
| this.D = { | |
| C: document.getElementById("tilt-sourceeditor"), | |
| title: document.getElementById("tilt-sourceeditor-title"), | |
| Pa: document.getElementById("tilt-sourceeditor-iframe") | |
| }; | |
| this.I = { | |
| C: document.getElementById("tilt-colorpicker"), | |
| Pa: document.getElementById("tilt-colorpicker-iframe") | |
| }; | |
| this.D.refresh = this.D.Pa.contentWindow.refreshCodeEditor; | |
| this.I.refresh = this.I.Pa.contentWindow.refreshColorPicker; | |
| gBrowser.selectedBrowser.markupDocumentViewer.fullZoom = 1; | |
| var a = window.content.innerWidth, | |
| b = window.content.innerHeight; | |
| S.G.ob = document.getElementById("tilt-iframe").contentDocument; | |
| S.G.Ka = gBrowser.selectedBrowser.parentNode; | |
| this.canvas = S.G.Ra(a, b, !0); | |
| this.n = new TiltChrome.Ob(this.canvas, new TiltChrome.zd.Oe, new TiltChrome.c.Ne) | |
| } | |
| }, | |
| d: function(a, b) { | |
| S.G.ob = k; | |
| S.G.Ka = k; | |
| if (this.canvas !== k) this.canvas.parentNode.removeChild(this.canvas), | |
| this.canvas = | |
| k; | |
| var c = function() { | |
| if (this.n !== k) this.n.d(), | |
| this.n = k; | |
| if (this.D !== k) this.D.C.hidePopup(), | |
| this.D.C = k, | |
| this.D.title = k, | |
| this.D = this.D.Pa = k; | |
| if (this.I !== k) this.I.C.hidePopup(), | |
| this.I.C = k, | |
| this.I = this.I.Pa = k; | |
| S.q.log(); | |
| S.q.reset(); | |
| a && window.setTimeout(function() { | |
| this.Xb() | |
| }.bind(this), 100) | |
| }.bind(this); | |
| b ? window.setTimeout(function() { | |
| c() | |
| }, | |
| 100) : c() | |
| }, | |
| Xb: function() { | |
| window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils).garbageCollect() | |
| } | |
| }; | |
| var S = S || {}; | |
| S.xd = function(a, b, c) { | |
| S.q.u("Tilt.Arcball", this); | |
| this.eb = [0, 0]; | |
| this.Ib = [0, 0]; | |
| this.Hb = [0, 0]; | |
| this.ld = [0, 0]; | |
| this.Ea = -1; | |
| this.Fa = 0; | |
| this.He = 1; | |
| this.Ge = -3E3; | |
| this.Fe = 500; | |
| this.fc = []; | |
| this.rd = Y(); | |
| this.ye = Y(); | |
| this.Ae = Y(); | |
| this.gc = ea([0, 0, 0, 1]); | |
| this.ad = ea([0, 0, 0, 1]); | |
| this.cc = ea([0, 0, 0, 1]); | |
| this.jd = Y(); | |
| this.bd = Y(); | |
| this.$c = Y(); | |
| this.Bb = [0, 0]; | |
| this.Cb = [0, 0]; | |
| this.ve = ea([0, 0, 0, 1]); | |
| this.we = Y(); | |
| this.pa(a, b, c) | |
| }; | |
| S.xd.prototype = { | |
| loop: function(a) { | |
| var a = S.h.M((a || 25) * 0.01, 0.01, 0.99), | |
| b, | |
| c, | |
| d = this.nd, | |
| g = this.o, | |
| h = this.k, | |
| i = this.eb, | |
| j = this.Ib, | |
| l = this.Hb; | |
| c = this.ld; | |
| var n = this.Ea, | |
| p = this.Fa, | |
| s = this.fc, | |
| x = this.rd, | |
| z = this.ye, | |
| y = this.Ae, | |
| F = this.gc, | |
| t = this.ad, | |
| q = this.cc, | |
| w = this.jd, | |
| r = this.bd, | |
| u = this.$c, | |
| A = this.Bb, | |
| D = this.Cb, | |
| m = this.ve, | |
| E = this.we; | |
| c[0] += (l[0] - c[0]) * a; | |
| c[1] += (l[1] - c[1]) * a; | |
| b = c[0]; | |
| c = c[1]; | |
| if (n === 3 || b === j[0] && c === j[1]) this.od = !1; | |
| n === 1 || this.od ? (this.od = !0, this.ge(b, c, g, h, d, z), ka(x, z, y), ma(y) > 0 ? (t[0] = y[0], t[1] = y[1], t[2] = y[2], t[3] = | |
| -oa(x, z)) : (t[0] = 0, t[1] = 0, t[2] = 0, t[3] = 1), pa(F, t, q)) : qa(q, F); | |
| n === 3 ? (r[0] = l[0] - i[0], r[1] = l[1] - i[1], u[0] = w[0] + r[0], u[1] = w[1] + r[1]) : (w[0] = u[0], w[1] = u[1]); | |
| r[2] = (p - u[2]) * 0.1; | |
| u[2] += r[2]; | |
| s[65] && (A[0] -= a * 0.2); | |
| s[68] && (A[0] += a * 0.2); | |
| s[87] && (A[1] += a * 0.2); | |
| s[83] && (A[1] -= a * 0.2); | |
| s[37] && (D[0] += a * 50); | |
| s[39] && (D[0] -= a * 50); | |
| s[38] && (D[1] += a * 50); | |
| s[40] && (D[1] -= a * 50); | |
| m[0] += (A[0] - m[0]) * a; | |
| m[1] += (A[1] - m[1]) * a; | |
| E[0] += (D[0] - E[0]) * a; | |
| E[1] += (D[1] - E[1]) * a; | |
| S.h.Kf(m[0], m[1], 0, t); | |
| r[0] = E[0]; | |
| r[1] = E[1]; | |
| r[2] = 0; | |
| return { | |
| rotation: pa(t, q), | |
| ea: ra(r, | |
| u) | |
| } | |
| }, | |
| Gc: function(a, b, c) { | |
| this.Za(); | |
| this.eb[0] = a; | |
| this.eb[1] = b; | |
| this.Ea = c; | |
| this.jc(); | |
| this.ge(a, b, this.o, this.k, this.nd, this.rd); | |
| qa(this.cc, this.gc) | |
| }, | |
| Kc: function(a, b) { | |
| this.Ib[0] = a; | |
| this.Ib[1] = b; | |
| this.Ea = -1 | |
| }, | |
| Hc: function(a, b) { | |
| this.Ea !== -1 && (this.Hb[0] = a, this.Hb[1] = b) | |
| }, | |
| Ic: function() { | |
| this.Ea = -1 | |
| }, | |
| Jc: function(a) { | |
| var b = this.He, | |
| c = this.Ge, | |
| d = this.Fe; | |
| this.Za(); | |
| this.Fa = S.h.M(this.Fa - a * b, c, d) | |
| }, | |
| Cc: function(a) { | |
| this.Za(); | |
| this.fc[a] = !0 | |
| }, | |
| Dc: function(a) { | |
| this.fc[a] = !1 | |
| }, | |
| ge: function(a, b, c, d, g, h) { | |
| a = (a - c * 0.5) / g; | |
| b = (b - d * 0.5) / g; | |
| c = | |
| 0; | |
| c = a * a + b * b; | |
| c > 1 ? (c = 1 / Math.sqrt(c), h[0] = a * c, h[1] = b * c, h[2] = 0) : (h[0] = a, h[1] = b, h[2] = Math.sqrt(1 - c)) | |
| }, | |
| pa: function(a, b, c) { | |
| this.o = a; | |
| this.k = b; | |
| this.nd = "undefined" !== typeof c ? c: b; | |
| this.jc() | |
| }, | |
| translate: function(a, b) { | |
| this.Cb[0] += a; | |
| this.Cb[1] += b | |
| }, | |
| rotate: function(a, b) { | |
| this.Bb[0] += a; | |
| this.Bb[1] += b | |
| }, | |
| zoom: function(a) { | |
| this.Fa += a | |
| }, | |
| stop: function() { | |
| this.Za(); | |
| this.jc(); | |
| this.Ea = -1 | |
| }, | |
| reset: function(a) { | |
| var b = this.Fa, | |
| c = this.gc, | |
| d = this.ad, | |
| g = this.cc, | |
| h = this.jd, | |
| i = this.bd, | |
| j = this.$c, | |
| l = this.Bb, | |
| n = this.Cb; | |
| this.Ie(function() { | |
| c[0] *= -1; | |
| c[1] *= | |
| -1; | |
| c[2] *= -1; | |
| sa(c, c, 1 - a); | |
| sa(d, c, 1 - a); | |
| sa(g, c, 1 - a); | |
| va(h, a); | |
| va(i, a); | |
| va(j, a); | |
| l[0] *= a; | |
| l[1] *= a; | |
| n[0] *= a; | |
| n[1] *= a; | |
| this.Fa *= a; | |
| ma(c) < 1.0E-4 && ma(d) < 1.0E-4 && ma(g) < 1.0E-4 && ma(h) < 0.01 && ma(i) < 0.01 && ma(j) < 0.01 && ma([l[0], l[1], b]) < 0.01 && ma([n[0], n[1], b]) < 0.01 && this.Za() | |
| }.bind(this), 1E3 / 60) | |
| }, | |
| Ie: function(a, b) { | |
| if ("undefined" === typeof this.Eb) this.Eb = window.setInterval(a, b) | |
| }, | |
| Za: function() { | |
| "undefined" !== typeof this.Eb && (window.clearInterval(this.Eb), delete this.Eb) | |
| }, | |
| jc: function() { | |
| var a = this.Hb, | |
| b = this.Ib, | |
| c = this.ld, | |
| d = this.eb[0], | |
| g = this.eb[1]; | |
| a[0] = d; | |
| a[1] = g; | |
| b[0] = d; | |
| b[1] = g; | |
| c[0] = d; | |
| c[1] = g | |
| }, | |
| d: function() { | |
| this.stop(); | |
| S.w(this) | |
| } | |
| }; | |
| S = S || {}; | |
| S.U = function(a, b, c) { | |
| S.q.u("Tilt.VertexBuffer", this); | |
| this.Q = this.j = k; | |
| this.aa = this.Vb = 0; | |
| "undefined" !== typeof a && this.Ac(a, b, c) | |
| }; | |
| S.U.prototype = { | |
| Ac: function(a, b, c) { | |
| var d = S.B; | |
| "undefined" === typeof c && (c = a.length / b); | |
| this.Q = new Float32Array(a); | |
| this.j = d.createBuffer(); | |
| d.bindBuffer(d.ARRAY_BUFFER, this.j); | |
| d.bufferData(d.ARRAY_BUFFER, this.Q, d.STATIC_DRAW); | |
| this.Vb = b; | |
| this.aa = c | |
| }, | |
| d: function() { | |
| try { | |
| S.B.deleteBuffer(this.j) | |
| } catch(a) {} | |
| S.w(this) | |
| } | |
| }; | |
| S.jb = function(a, b) { | |
| S.q.u("Tilt.IndexBuffer", this); | |
| this.Q = this.j = k; | |
| this.aa = this.Vb = 0; | |
| "undefined" !== typeof a && this.Ac(a, b) | |
| }; | |
| S.jb.prototype = { | |
| Ac: function(a, b) { | |
| var c = S.B; | |
| if ("undefined" === typeof b) b = a.length; | |
| this.Q = new Uint16Array(a); | |
| this.j = c.createBuffer(); | |
| c.bindBuffer(c.ELEMENT_ARRAY_BUFFER, this.j); | |
| c.bufferData(c.ELEMENT_ARRAY_BUFFER, this.Q, c.STATIC_DRAW); | |
| this.Vb = 1; | |
| this.aa = b | |
| }, | |
| d: function() { | |
| try { | |
| S.B.deleteBuffer(this.j) | |
| } catch(a) {} | |
| S.w(this) | |
| } | |
| }; | |
| S = S || {}; | |
| S.B = k; | |
| S.V = k; | |
| S.Ab = -1; | |
| S.Fb = -1; | |
| S.cb = {}; | |
| S.sc = function() { | |
| S.w(S.B); | |
| S.w(S.V); | |
| S.w(S.Ab); | |
| S.w(S.Fb); | |
| S.w(S.cb); | |
| S.B = k; | |
| S.V = k; | |
| S.Ab = -1; | |
| S.Fb = -1; | |
| S.cb = {}; | |
| S.Cd.$a = 0; | |
| S.pc.$a = 0 | |
| }; | |
| S = S || {}; | |
| S.w = function(a) { | |
| for (var b in a) try { | |
| "function" === typeof a[b].d && a[b].d() | |
| } catch(c) {} finally { | |
| try { | |
| a[b] = k | |
| } catch(d) {} | |
| delete a[b] | |
| } | |
| }; | |
| S = S || {}; | |
| S.q = { | |
| enabled: !1, | |
| wa: [], | |
| u: function(a, b, c, d, g, h) { | |
| if (this.enabled) { | |
| var i, | |
| j, | |
| l; | |
| if (c) { | |
| if ("undefined" === typeof d && (d = this.Se.bind(this)), "undefined" === typeof g && (g = this.Qe.bind(this)), "undefined" === typeof h && (h = this.bf.bind(this)), i = b[c], "function" === typeof i) j = this.wa.length, | |
| this.wa[j] = { | |
| name: (a + "." || "") + c, | |
| nb: 0, | |
| lb: 0, | |
| ya: 0, | |
| Ya: 0 | |
| }, | |
| b[c] = function() { | |
| try { | |
| return d(j), | |
| h(b, i, arguments) | |
| } finally { | |
| g(j) | |
| } | |
| } | |
| } else for (l in b)"function" === typeof b[l] && this.u(a, b, l, d, g, h) | |
| } | |
| }, | |
| Se: function(a) { | |
| if ("undefined" !== typeof this.wa[a]) this.wa[a].currentTime = | |
| (new Date).getTime() | |
| }, | |
| Qe: function(a) { | |
| a = this.wa[a]; | |
| if ("undefined" !== typeof a) { | |
| var b = (new Date).getTime() - a.currentTime; | |
| a.nb++; | |
| a.ya = Math.max(a.ya, b); | |
| a.lb = (a.ya + b) * 0.5; | |
| a.Ya += b | |
| } | |
| }, | |
| bf: function(a, b, c) { | |
| return c.length === 0 ? b.call(a) : b.apply(a, c) | |
| }, | |
| log: function() { | |
| var a = this.wa.slice(0), | |
| b, | |
| c, | |
| d, | |
| g; | |
| a.sort(function(a, b) { | |
| return a.Ya < b.Ya ? 1: -1 | |
| }); | |
| for (b = 0; b < a.length; b++) { | |
| d = a[b]; | |
| for (c = b + 1; c < a.length; c++) if (g = a[c], d.name === g.name) d.nb += g.nb, | |
| d.ya = Math.max(d.ya, g.ya), | |
| d.lb = (d.lb + g.lb) * 0.5, | |
| d.Ya += g.Ya, | |
| a.splice(c, 1), | |
| c--; | |
| d.nb !== | |
| 0 && S.ma.log("function " + d.name + "\ncalls " + d.nb + "\naverage " + d.lb + "ms\nlongest " + d.ya + "ms\ntotal " + d.Ya + "ms") | |
| } | |
| }, | |
| reset: function() { | |
| this.wa = [] | |
| } | |
| }; | |
| S = S || {}; | |
| S.Nb = function(a, b) { | |
| S.q.u("Tilt.Program", this); | |
| this.j = k; | |
| this.bb = -1; | |
| this.ib = this.sa = k; | |
| this.Db = {}; | |
| this.ud = {}; | |
| arguments.length === 2 && this.rf(a, b) | |
| }; | |
| S.Nb.prototype = { | |
| rf: function(a, b) { | |
| this.j = S.Cd.create(a, b); | |
| this.bb = this.j.id; | |
| this.sa = this.j.attributes; | |
| this.ib = this.j.Ca; | |
| this.j.id = k; | |
| this.j.attributes = k; | |
| this.j.Ca = k; | |
| delete this.j.id; | |
| delete this.j.attributes; | |
| delete this.j.Ca | |
| }, | |
| Xc: function() { | |
| var a = this.bb, | |
| b; | |
| if (S.Ab !== a && (S.Ab = a, a = S.B, a.useProgram(this.j), this.Ve(), S.Fb < this.sa.length)) for (b in S.Fb = this.sa.length, this.sa) this.sa.hasOwnProperty(b) && b !== "length" && a.enableVertexAttribArray(this.sa[b]) | |
| }, | |
| Ja: function(a, b) { | |
| var c = S.B, | |
| d = this.sa[a], | |
| g = b.Vb; | |
| c.bindBuffer(c.ARRAY_BUFFER, | |
| b.j); | |
| c.vertexAttribPointer(d, g, c.FLOAT, !1, 0, 0) | |
| }, | |
| Ia: function(a, b) { | |
| var c = this.Db, | |
| d = (b[0] + b[1] + b[2]) * (b[4] + b[5] + b[6]) * (b[8] + b[9] + b[10]) * (b[12] + b[13] + b[14]); | |
| c[a] !== d && (c[a] = d, S.B.uniformMatrix4fv(this.ib[a], !1, b)) | |
| }, | |
| rc: function(a, b) { | |
| var c = this.Db, | |
| d = b[3] * 255 << 24 | b[0] * 255 << 16 | b[1] * 255 << 8 | b[2] * 255; | |
| c[a] !== d && (c[a] = d, S.B.uniform4fv(this.ib[a], b)) | |
| }, | |
| Te: function(a, b) { | |
| var c = this.Db; | |
| c[a] !== b && (c[a] = b, S.B.uniform1f(this.ib[a], b)) | |
| }, | |
| bindTexture: function(a, b) { | |
| var c = this.ud, | |
| d = b.bb; | |
| if (c[a] !== d) c[a] = d, | |
| c = S.B, | |
| c.bindTexture(c.TEXTURE_2D, | |
| b.j), | |
| c.uniform1i(this.ib[a], 0) | |
| }, | |
| Ve: function() { | |
| this.ud = {} | |
| }, | |
| sc: function() { | |
| this.Db = {} | |
| }, | |
| d: function() { | |
| try { | |
| S.B.deleteShader(this.j) | |
| } catch(a) {} | |
| S.w(this) | |
| } | |
| }; | |
| S = S || {}; | |
| S.Cd = { | |
| create: function(a, b) { | |
| var c = this.compile(a, "x-shader/x-vertex"), | |
| d = this.compile(b, "x-shader/x-fragment"); | |
| return this.link(c, d) | |
| }, | |
| compile: function(a, b) { | |
| var c = S.B, | |
| d; | |
| if ("string" !== typeof a || a.length < 1) return S.ma.error(S.fa.get("compileShader.source.error")), | |
| k; | |
| if (b === "x-shader/x-vertex") d = c.createShader(c.VERTEX_SHADER); | |
| else if (b === "x-shader/x-fragment") d = c.createShader(c.FRAGMENT_SHADER); | |
| else return S.ma.error(S.fa.uc("compileShader.type.error"), [a]), | |
| k; | |
| c.shaderSource(d, a); | |
| c.compileShader(d); | |
| d.src = | |
| a; | |
| return ! c.getShaderParameter(d, c.COMPILE_STATUS) ? (c = c.getShaderInfoLog(d), S.ma.error(S.fa.uc("compileShader.compile.error"), [c]), k) : d | |
| }, | |
| link: function(a, b) { | |
| var c = S.B, | |
| d; | |
| d = c.createProgram(); | |
| c.attachShader(d, a); | |
| c.attachShader(d, b); | |
| c.linkProgram(d); | |
| if (!c.getProgramParameter(d, c.LINK_STATUS)) return d = c.getProgramInfoLog(d), | |
| S.ma.error(S.fa.uc("linkProgram.error", [d])), | |
| k; | |
| d.id = this.$a++; | |
| c = [a.src, b.src].join(" ").replace(/#.*|[(){};,]/g, " ").split(" "); | |
| return this.$f(d, c) | |
| }, | |
| Yf: function(a, b) { | |
| return S.B.getAttribLocation(a, | |
| b) | |
| }, | |
| ag: function(a, b) { | |
| return S.B.getUniformLocation(a, b) | |
| }, | |
| Zf: function(a, b) { | |
| if ("string" === typeof b) { | |
| if (b.length < 1) return k; | |
| var c; | |
| return (c = this.Yf(a, b)) >= 0 ? c: this.ag(a, b) | |
| } | |
| return k | |
| }, | |
| $f: function(a, b) { | |
| var c, | |
| d, | |
| g, | |
| h; | |
| a.attributes = {}; | |
| a.attributes.length = 0; | |
| a.Ca = {}; | |
| a.Ca.length = 0; | |
| for (c = 0, d = b.length; c < d; c++) g = b[c], | |
| h = this.Zf(a, g), | |
| "number" === typeof h && "undefined" === typeof a.attributes[g] && (a.attributes[g] = h, a.attributes.length++), | |
| "object" === typeof h && h instanceof WebGLUniformLocation && "undefined" === typeof a.Ca[g] && | |
| (a.Ca[g] = h, a.Ca.length++); | |
| return a | |
| }, | |
| $a: 0 | |
| }; | |
| S = S || {}; | |
| S.Ha = function(a, b) { | |
| S.q.u("Tilt.Texture", this); | |
| b = b || {}; | |
| this.j = k; | |
| this.height = this.width = this.bb = -1; | |
| this.loaded = !1; | |
| this.onload = b.onload; | |
| "object" === typeof a ? this.Qd(a, b) : "string" === typeof a ? this.sf(a, b) : S.ma.error(S.fa.get("initTexture.source.error")) | |
| }; | |
| S.Ha.prototype = { | |
| Qd: function(a, b) { | |
| this.j = S.pc.create(a, b); | |
| this.bb = this.j.id; | |
| this.width = this.j.width; | |
| this.height = this.j.height; | |
| this.loaded = !0; | |
| if ("function" === typeof this.onload) this.onload(); | |
| this.j.id = k; | |
| this.j.width = k; | |
| this.onload = this.j.height = k; | |
| delete this.j.id; | |
| delete this.j.width; | |
| delete this.j.height; | |
| delete this.onload | |
| }, | |
| sf: function(a, b) { | |
| var c = new Image; | |
| c.src = a; | |
| c.onload = function() { | |
| this.Qd(c, b); | |
| b = c = k | |
| }.bind(this) | |
| }, | |
| ig: function(a, b, c) { | |
| this.width === a.width && this.height === a.height && b && c && (c = b = 0); | |
| var d = S.B; | |
| d.bindTexture(d.TEXTURE_2D, this.j); | |
| d.texSubImage2D(d.TEXTURE_2D, 0, b, c, d.RGBA, d.UNSIGNED_BYTE, a) | |
| }, | |
| d: function() { | |
| try { | |
| S.B.deleteTexture(this.j) | |
| } catch(a) {} | |
| S.w(this) | |
| } | |
| }; | |
| S = S || {}; | |
| S.pc = { | |
| create: function(a, b) { | |
| b = b || {}; | |
| if ("undefined" !== typeof S.cb[a.src]) return S.cb[a.src]; | |
| var c = S.B, | |
| d = S.pc.Of(a, b), | |
| g = c.getParameter(c.TEXTURE_BINDING_2D), | |
| h = a.width, | |
| i = a.height, | |
| j = c.createTexture(); | |
| c.bindTexture(c.TEXTURE_2D, j); | |
| c.texImage2D(c.TEXTURE_2D, 0, c.RGBA, c.RGBA, c.UNSIGNED_BYTE, d); | |
| j.width = h; | |
| j.height = i; | |
| j.id = this.$a++; | |
| this.Wf(b); | |
| c.bindTexture(c.TEXTURE_2D, g); | |
| "undefined" !== typeof a.src && (S.cb[a.src] = j); | |
| return j | |
| }, | |
| Wf: function(a) { | |
| var b = S.B, | |
| c = b.TEXTURE_MIN_FILTER, | |
| d = b.TEXTURE_MAG_FILTER, | |
| g = b.TEXTURE_WRAP_S, | |
| h = b.TEXTURE_WRAP_T, | |
| a = a || {}; | |
| a.Xa && b.bindTexture(b.TEXTURE_2D, a.Xa.Og); | |
| "nearest" === a.Xd ? b.texParameteri(b.TEXTURE_2D, c, b.NEAREST) : "linear" === a.Xd && a.Yd ? b.texParameteri(b.TEXTURE_2D, c, b.LINEAR_MIPMAP_LINEAR) : b.texParameteri(b.TEXTURE_2D, c, b.LINEAR); | |
| "nearest" === a.Ud ? b.texParameteri(b.TEXTURE_2D, d, b.NEAREST) : "linear" === a.Ud && a.Yd ? b.texParameteri(b.TEXTURE_2D, d, b.LINEAR_MIPMAP_LINEAR) : b.texParameteri(b.TEXTURE_2D, d, b.LINEAR); | |
| "repeat" === a.Zg ? b.texParameteri(b.TEXTURE_2D, g, b.REPEAT) : b.texParameteri(b.TEXTURE_2D, | |
| g, b.CLAMP_TO_EDGE); | |
| "repeat" === a.$g ? b.texParameteri(b.TEXTURE_2D, h, b.REPEAT) : b.texParameteri(b.TEXTURE_2D, h, b.CLAMP_TO_EDGE); | |
| a.Yd && b.generateMipmap(b.TEXTURE_2D) | |
| }, | |
| Of: function(a, b) { | |
| var b = b || {}, | |
| c = (a.src || "").indexOf("chrome://"), | |
| d = S.h.Rd(a.width), | |
| g = S.h.Rd(a.height); | |
| if (b.Ff || d && g && c === -1) try { | |
| return a | |
| } finally { | |
| b = a = k | |
| } | |
| c = S.G.Ra(S.h.$d(a.width), S.h.$d(a.height)); | |
| d = c.getContext("2d"); | |
| if (b.fill) d.fillStyle = b.fill, | |
| d.fillRect(0, 0, c.width, c.height); | |
| d.drawImage(a, 0, 0, a.width, a.height, 0, 0, c.width, c.height); | |
| if (b.stroke) d.strokeStyle = | |
| b.stroke, | |
| d.lineWidth = b.Aa, | |
| d.strokeRect(0, 0, c.width, c.height); | |
| return c | |
| }, | |
| Vg: function(a) { | |
| S.B.pixelStorei(S.B.UNPACK_FLIP_Y_WEBGL, a) | |
| }, | |
| $a: 0 | |
| }; | |
| function wa(a) { | |
| var b = { | |
| indent_size: 2, | |
| indent_char: " ", | |
| max_char: 78, | |
| brace_style: "collapse" | |
| }, | |
| c, | |
| d, | |
| g, | |
| b = b || {}; | |
| c = b.tb || 2; | |
| d = b.Od || " "; | |
| g = b.Pb || "collapse"; | |
| b = new | |
| function() { | |
| this.J = 0; | |
| this.Wg = ""; | |
| this.La = "CONTENT"; | |
| this.A = { | |
| parent: "parent1", | |
| Kg: 1, | |
| Jg: "" | |
| }; | |
| this.Ba = this.Td = this.vf = this.ac = this.da = ""; | |
| this.T = { | |
| bc: "\n\r\t ".split(""), | |
| cg: "br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed".split(","), | |
| cf: "head,body,/html".split(","), | |
| Qa: function(a, b) { | |
| for (var c = 0; c < b.length; c++) if (a === b[c]) return ! 0; | |
| return ! 1 | |
| } | |
| }; | |
| this.hf = function() { | |
| for (var a = "", b = [], c = !1; this.input.charAt(this.J) !== "<";) { | |
| if (this.J >= this.input.length) return b.length ? b.join("") : ["", "TK_EOF"]; | |
| a = this.input.charAt(this.J); | |
| this.J++; | |
| this.N++; | |
| if (this.T.Qa(a, this.T.bc)) b.length && (c = !0), | |
| this.N--; | |
| else { | |
| if (c) { | |
| if (this.N >= this.Vd) { | |
| b.push("\n"); | |
| for (c = 0; c < this.ha; c++) b.push(this.Tb); | |
| this.N = 0 | |
| } else b.push(" "), | |
| this.N++; | |
| c = !1 | |
| } | |
| b.push(a) | |
| } | |
| } | |
| return b.length ? b.join("") : "" | |
| }; | |
| this.jf = function() { | |
| var a = "", | |
| b = [], | |
| a = /<\/script>/igm; | |
| a.lastIndex = this.J; | |
| for (var c = (a = | |
| a.exec(this.input)) ? a.index: this.input.length; this.J < c;) { | |
| if (this.J >= this.input.length) return b.length ? b.join("") : ["", "TK_EOF"]; | |
| a = this.input.charAt(this.J); | |
| this.J++; | |
| b.push(a) | |
| } | |
| return b.length ? b.join("") : "" | |
| }; | |
| this.Rc = function(a) { | |
| this.A[a + "count"] ? this.A[a + "count"]++:this.A[a + "count"] = 1; | |
| this.A[a + this.A[a + "count"]] = this.ha; | |
| this.A[a + this.A[a + "count"] + "parent"] = this.A.parent; | |
| this.A.parent = a + this.A[a + "count"] | |
| }; | |
| this.Pf = function(a) { | |
| if (this.A[a + "count"]) { | |
| for (var b = this.A.parent; b;) { | |
| if (a + this.A[a + "count"] === b) break; | |
| b = this.A[b + "parent"] | |
| } | |
| if (b) this.ha = this.A[a + this.A[a + "count"]], | |
| this.A.parent = this.A[b + "parent"]; | |
| delete this.A[a + this.A[a + "count"] + "parent"]; | |
| delete this.A[a + this.A[a + "count"]]; | |
| this.A[a + "count"] == 1 ? delete this.A[a + "count"] : this.A[a + "count"]-- | |
| } | |
| }; | |
| this.kf = function() { | |
| var a = "", | |
| b = [], | |
| c = !1; | |
| do { | |
| if (this.J >= this.input.length) return b.length ? b.join("") : ["", "TK_EOF"]; | |
| a = this.input.charAt(this.J); | |
| this.J++; | |
| this.N++; | |
| if (this.T.Qa(a, this.T.bc)) c = !0, | |
| this.N--; | |
| else { | |
| if (a === "'" || a === '"') if (!b[1] || b[1] !== "!") a += this.rb(a), | |
| c = | |
| !0; | |
| a === "=" && (c = !1); | |
| if (b.length && b[b.length - 1] !== "=" && a !== ">" && c) this.N >= this.Vd ? (this.Va(!1, b), this.N = 0) : (b.push(" "), this.N++), | |
| c = !1; | |
| b.push(a) | |
| } | |
| } | |
| while (a !== ">"); | |
| a = b.join(""); | |
| c = a.substring(1, a.indexOf(" ") != -1 ? a.indexOf(" ") : a.indexOf(">")).toLowerCase(); | |
| a.charAt(a.length - 2) === "/" || this.T.Qa(c, this.T.cg) ? this.da = "SINGLE": c === "script" ? (this.Rc(c), this.da = "SCRIPT") : c === "style" ? (this.Rc(c), this.da = "STYLE") : c === "a" ? (a = this.rb("</a>", a), b.push(a), this.da = "SINGLE") : c.charAt(0) === "!" ? c.indexOf("[if") != -1 ? (a.indexOf("!IE") != | |
| -1 && (a = this.rb("--\>", a), b.push(a)), this.da = "START") : c.indexOf("[endif") != -1 ? (this.da = "END", this.hg()) : (a = c.indexOf("[cdata[") != -1 ? this.rb("]]\>", a) : this.rb("--\>", a), b.push(a), this.da = "SINGLE") : (c.charAt(0) === "/" ? (this.Pf(c.substring(1)), this.da = "END") : (this.Rc(c), this.da = "START"), this.T.Qa(c, this.T.cf) && this.Va(!0, this.za)); | |
| return b.join("") | |
| }; | |
| this.rb = function(a, b) { | |
| if (b && b.indexOf(a) != -1) return ""; | |
| var c = "", | |
| d = "", | |
| g = !0; | |
| do { | |
| if (this.J >= this.input.length) break; | |
| c = this.input.charAt(this.J); | |
| this.J++; | |
| if (this.T.Qa(c, | |
| this.T.bc)) { | |
| if (!g) { | |
| this.N--; | |
| continue | |
| } | |
| if (c === "\n" || c === "\r") { | |
| d += "\n"; | |
| for (c = 0; c < this.ha; c++) d += this.Tb; | |
| g = !1; | |
| this.N = 0; | |
| continue | |
| } | |
| } | |
| d += c; | |
| this.N++; | |
| g = !0 | |
| } | |
| while (d.indexOf(a) == -1); | |
| return d | |
| }; | |
| this.lf = function() { | |
| var a; | |
| if (this.Td === "TK_TAG_SCRIPT") { | |
| a = this.jf(); | |
| if (typeof a !== "string") return a; | |
| a = xa(a, { | |
| indent_size: this.tb, | |
| indent_char: this.Pd, | |
| indent_level: this.ha, | |
| brace_style: this.Pb | |
| }); | |
| return [a.replace(/^[\t ]+/, ""), "TK_CONTENT"] | |
| } | |
| if (this.La === "CONTENT") return a = this.hf(), | |
| typeof a !== "string" ? a: [a, "TK_CONTENT"]; | |
| if (this.La === | |
| "TAG") return a = this.kf(), | |
| typeof a !== "string" ? a: [a, "TK_TAG_" + this.da] | |
| }; | |
| this.If = function(a, b, c, d) { | |
| this.input = a || ""; | |
| this.za = []; | |
| this.Pd = b; | |
| this.Tb = ""; | |
| this.tb = c; | |
| this.Pb = d; | |
| this.ha = 0; | |
| this.Vd = 80; | |
| for (a = this.N = 0; a < this.tb; a++) this.Tb += this.Pd; | |
| this.Va = function(a, b) { | |
| this.N = 0; | |
| if (b && b.length) { | |
| if (!a) for (; this.T.Qa(b[b.length - 1], this.T.bc);) b.pop(); | |
| b.push("\n"); | |
| for (var c = 0; c < this.ha; c++) b.push(this.Tb) | |
| } | |
| }; | |
| this.Yb = function(a) { | |
| this.za.push(a) | |
| }; | |
| this.pf = function() { | |
| this.ha++ | |
| }; | |
| this.hg = function() { | |
| this.ha > 0 && this.ha-- | |
| } | |
| }; | |
| return this | |
| }; | |
| for (b.If(a, d, c, g);;) { | |
| a = b.lf(); | |
| b.Ba = a[0]; | |
| b.ac = a[1]; | |
| if (b.ac === "TK_EOF") break; | |
| switch (b.ac) { | |
| case "TK_TAG_START": | |
| case "TK_TAG_SCRIPT": | |
| case "TK_TAG_STYLE": | |
| b.Va(!1, b.za); | |
| b.Yb(b.Ba); | |
| b.pf(); | |
| b.La = "CONTENT"; | |
| break; | |
| case "TK_TAG_END": | |
| b.Va(!0, b.za); | |
| b.Yb(b.Ba); | |
| b.La = "CONTENT"; | |
| break; | |
| case "TK_TAG_SINGLE": | |
| b.Va(!1, b.za); | |
| b.Yb(b.Ba); | |
| b.La = "CONTENT"; | |
| break; | |
| case "TK_CONTENT": | |
| b.Ba !== "" && (b.Va(!1, b.za), b.Yb(b.Ba)), | |
| b.La = "TAG" | |
| } | |
| b.Td = b.ac; | |
| b.vf = b.Ba | |
| } | |
| return b.za.join("") | |
| } | |
| function xa(a, b) { | |
| function c(a) { | |
| for (a = typeof a === "undefined" ? !1: a; q.length && (q[q.length - 1] === " " || q[q.length - 1] === G || q[q.length - 1] === ba || a && (q[q.length - 1] === "\n" || q[q.length - 1] === "\r"));) q.pop() | |
| } | |
| function d(a) { | |
| return a.replace(/^\s\s*|\s\s*$/, "") | |
| } | |
| function g() { | |
| var a = O; | |
| O = !1; | |
| h(); | |
| O = a | |
| } | |
| function h(a) { | |
| m.Rb = !1; | |
| if (!O || !p(m.mode)) if (a = typeof a === "undefined" ? !0: a, m.Oa = !1, c(), q.length) { | |
| if (q[q.length - 1] !== "\n" || !a) Q = !0, | |
| q.push("\n"); | |
| ba && q.push(ba); | |
| for (a = 0; a < m.ia; a += 1) q.push(G); | |
| m.Y && m.qa && (da === " " ? q.push(" ") : | |
| q.push(G)) | |
| } | |
| } | |
| function i() { | |
| if (m.Rb) m.Rb = !1; | |
| else { | |
| var a = " "; | |
| q.length && (a = q[q.length - 1]); | |
| a !== " " && a !== "\n" && a !== G && q.push(" ") | |
| } | |
| } | |
| function j() { | |
| Q = !1; | |
| m.Rb = !1; | |
| q.push(w) | |
| } | |
| function l() { | |
| q.length && q[q.length - 1] === G && q.pop() | |
| } | |
| function n(a) { | |
| m && E.push(m); | |
| m = { | |
| Hf: m ? m.mode: "BLOCK", | |
| mode: a, | |
| Y: !1, | |
| ra: !1, | |
| qa: !1, | |
| zc: !1, | |
| Oa: !1, | |
| yc: !1, | |
| Rb: !1, | |
| Ub: -1, | |
| ia: m ? m.ia + (m.Y && m.qa ? 1: 0) : 0, | |
| Wc: 0 | |
| } | |
| } | |
| function p(a) { | |
| return a === "[EXPRESSION]" || a === "[INDENTED-EXPRESSION]" | |
| } | |
| function s(a) { | |
| return a === "[EXPRESSION]" || a === "[INDENTED-EXPRESSION]" || a === "(EXPRESSION)" | |
| } | |
| function x() { | |
| X = m.mode === "DO_BLOCK"; | |
| E.length > 0 && (m = E.pop()) | |
| } | |
| function z(a) { | |
| for (var b = 0; b < a.length; b++) if (d(a[b])[0] != "*") return ! 1; | |
| return ! 0 | |
| } | |
| function y(a, b) { | |
| for (var c = 0; c < b.length; c += 1) if (b[c] === a) return ! 0; | |
| return ! 1 | |
| } | |
| function F() { | |
| T = 0; | |
| if (o >= H) return ["", "TK_EOF"]; | |
| W = !1; | |
| var a = t.charAt(o); | |
| o += 1; | |
| if (O && p(m.mode)) { | |
| for (var b = 0; y(a, I);) { | |
| a === "\n" ? (c(), q.push("\n"), Q = !0, b = 0) : a === "\t" ? b += 4: a !== "\r" && (b += 1); | |
| if (o >= H) return ["", "TK_EOF"]; | |
| a = t.charAt(o); | |
| o += 1 | |
| } | |
| if (m.Ub === -1) m.Ub = b; | |
| if (Q) { | |
| var g; | |
| for (g = 0; g < m.ia + 1; g += 1) q.push(G); | |
| if (m.Ub !== -1) for (g = 0; g < b - m.Ub; g++) q.push(" ") | |
| } | |
| } else { | |
| for (; y(a, I);) { | |
| a === "\n" && (T += ja ? T <= ja ? 1: 0: 1); | |
| if (o >= H) return ["", "TK_EOF"]; | |
| a = t.charAt(o); | |
| o += 1 | |
| } | |
| if (fa && T > 1) for (g = 0; g < T; g += 1) h(g === 0), | |
| Q = !0; | |
| W = T > 0 | |
| } | |
| if (y(a, K)) { | |
| if (o < H) for (; y(t.charAt(o), K);) if (a += t.charAt(o), o += 1, o === H) break; | |
| if (o !== H && a.match(/^[0-9]+[Ee]$/) && (t.charAt(o) === "-" || t.charAt(o) === "+")) return b = t.charAt(o), | |
| o += 1, | |
| g = F(), | |
| a += b + g[0], | |
| [a, "TK_WORD"]; | |
| if (a === "in") return [a, "TK_OPERATOR"]; | |
| W && r !== "TK_OPERATOR" && r !== "TK_EQUALS" && !m.Oa && (fa || u !== "var") && h(); | |
| return [a, | |
| "TK_WORD"] | |
| } | |
| if (a === "(" || a === "[") return [a, "TK_START_EXPR"]; | |
| if (a === ")" || a === "]") return [a, "TK_END_EXPR"]; | |
| if (a === "{") return [a, "TK_START_BLOCK"]; | |
| if (a === "}") return [a, "TK_END_BLOCK"]; | |
| if (a === ";") return [a, "TK_SEMICOLON"]; | |
| if (a === "/") { | |
| b = ""; | |
| g = !0; | |
| if (t.charAt(o) === "*") { | |
| o += 1; | |
| if (o < H) for (; ! (t.charAt(o) === "*" && t.charAt(o + 1) && t.charAt(o + 1) === "/") && o < H;) { | |
| a = t.charAt(o); | |
| b += a; | |
| if (a === "\r" || a === "\n") g = !1; | |
| o += 1; | |
| if (o >= H) break | |
| } | |
| o += 2; | |
| return g ? ["/*" + b + "*/", "TK_INLINE_COMMENT"] : ["/*" + b + "*/", "TK_BLOCK_COMMENT"] | |
| } | |
| if (t.charAt(o) === "/") { | |
| for (b = | |
| a; t.charAt(o) !== "\r" && t.charAt(o) !== "\n";) if (b += t.charAt(o), o += 1, o >= H) break; | |
| o += 1; | |
| W && h(); | |
| return [b, "TK_COMMENT"] | |
| } | |
| } | |
| if (a === "'" || a === '"' || a === "/" && (r === "TK_WORD" && y(u, ["return", "do"]) || r === "TK_COMMENT" || r === "TK_START_EXPR" || r === "TK_START_BLOCK" || r === "TK_END_BLOCK" || r === "TK_OPERATOR" || r === "TK_EQUALS" || r === "TK_EOF" || r === "TK_SEMICOLON")) { | |
| b = a; | |
| g = !1; | |
| var i = a; | |
| if (o < H) if (b === "/") for (a = !1; g || a || t.charAt(o) !== b;) { | |
| if (i += t.charAt(o), g ? g = !1: (g = t.charAt(o) === "\\", t.charAt(o) === "[" ? a = !0: t.charAt(o) === "]" && (a = !1)), o += 1, | |
| o >= H) return [i, "TK_STRING"] | |
| } else for (; g || t.charAt(o) !== b;) if (i += t.charAt(o), g = g ? !1: t.charAt(o) === "\\", o += 1, o >= H) return [i, "TK_STRING"]; | |
| o += 1; | |
| i += b; | |
| if (b === "/") for (; o < H && y(t.charAt(o), K);) i += t.charAt(o), | |
| o += 1; | |
| return [i, "TK_STRING"] | |
| } | |
| if (a === "#") { | |
| if (q.length === 0 && t.charAt(o) === "!") { | |
| for (i = a; o < H && a != "\n";) a = t.charAt(o), | |
| i += a, | |
| o += 1; | |
| q.push(d(i) + "\n"); | |
| h(); | |
| return F() | |
| } | |
| b = "#"; | |
| if (o < H && y(t.charAt(o), L)) { | |
| do a = t.charAt(o), | |
| b += a, | |
| o += 1; | |
| while (o < H && a !== "#" && a !== "="); | |
| a !== "#" && (t.charAt(o) === "[" && t.charAt(o + 1) === "]" ? (b += "[]", o += 2) : | |
| t.charAt(o) === "{" && t.charAt(o + 1) === "}" && (b += "{}", o += 2)); | |
| return [b, "TK_WORD"] | |
| } | |
| } | |
| if (a === "<" && t.substring(o - 1, o + 3) === "<\!--") return o += 3, | |
| m.zc = !0, | |
| ["<\!--", "TK_COMMENT"]; | |
| if (a === "-" && m.zc && t.substring(o - 1, o + 2) === "--\>") return m.zc = !1, | |
| o += 2, | |
| W && h(), | |
| ["--\>", "TK_COMMENT"]; | |
| if (y(a, M)) { | |
| for (; o < H && y(a + t.charAt(o), M);) if (a += t.charAt(o), o += 1, o >= H) break; | |
| return a === "=" ? [a, "TK_EQUALS"] : [a, "TK_OPERATOR"] | |
| } | |
| return [a, "TK_UNKNOWN"] | |
| } | |
| var t, | |
| q, | |
| w, | |
| r, | |
| u, | |
| A, | |
| D, | |
| m, | |
| E, | |
| G, | |
| I, | |
| K, | |
| M, | |
| o, | |
| J, | |
| L, | |
| B, | |
| C, | |
| X, | |
| W, | |
| Q, | |
| T, | |
| ba = "", | |
| b = b ? b: {}, | |
| U; | |
| if (b.dg !== f && b.Bc === f) b.Bc = b.dg; | |
| b.Ue !== f && (U = b.Ue ? "expand": "collapse"); | |
| U = b.Pb ? b.Pb: U ? U: "collapse"; | |
| D = b.tb ? b.tb: 2; | |
| var da = b.Od ? b.Od: " ", | |
| fa = typeof b.Gf === "undefined" ? !0: b.Gf, | |
| ja = typeof b.wf === "undefined" ? !1: b.wf, | |
| Z = b.Bc === "undefined" ? !1: b.Bc, | |
| O = typeof b.uf === "undefined" ? !1: b.uf; | |
| Q = !1; | |
| var H = a.length; | |
| for (G = ""; D > 0;) G += da, | |
| D -= 1; | |
| for (; a && (a[0] === " " || a[0] === "\t");) ba += a[0], | |
| a = a.substring(1); | |
| t = a; | |
| D = ""; | |
| r = "TK_START_EXPR"; | |
| A = u = ""; | |
| q = []; | |
| X = !1; | |
| I = "\n\r\t ".split(""); | |
| K = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$".split(""); | |
| L = "0123456789".split(""); | |
| M = "+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! !! , : ? ^ ^= |= ::".split(" "); | |
| J = "continue,try,throw,return,var,if,switch,case,default,for,while,break,function".split(","); | |
| E = []; | |
| n("BLOCK"); | |
| for (o = 0;;) { | |
| C = F(); | |
| w = C[0]; | |
| C = C[1]; | |
| if (C === "TK_EOF") break; | |
| switch (C) { | |
| case "TK_START_EXPR": | |
| if (w === "[") { | |
| if (r === "TK_WORD" || u === ")") { | |
| y(u, J) && i(); | |
| n("(EXPRESSION)"); | |
| j(); | |
| break | |
| } | |
| if (m.mode === "[EXPRESSION]" || m.mode === "[INDENTED-EXPRESSION]") if (A === "]" && u === ",") { | |
| if (m.mode === "[EXPRESSION]") m.mode = | |
| "[INDENTED-EXPRESSION]", | |
| O || (m.ia += 1); | |
| n("[EXPRESSION]"); | |
| O || h() | |
| } else if (u === "[") { | |
| if (m.mode === "[EXPRESSION]") m.mode = "[INDENTED-EXPRESSION]", | |
| O || (m.ia += 1); | |
| n("[EXPRESSION]"); | |
| O || h() | |
| } else n("[EXPRESSION]"); | |
| else n("[EXPRESSION]") | |
| } else n("(EXPRESSION)"); | |
| u === ";" || r === "TK_START_BLOCK" ? h() : r === "TK_END_EXPR" || r === "TK_START_EXPR" || r === "TK_END_BLOCK" || u === "." || (r !== "TK_WORD" && r !== "TK_OPERATOR" ? i() : D === "function" || D === "typeof" ? Z && i() : (y(u, J) || u === "catch") && i()); | |
| j(); | |
| break; | |
| case "TK_END_EXPR": | |
| if (w === "]") if (O) { | |
| if (u === | |
| "}") { | |
| l(); | |
| j(); | |
| x(); | |
| break | |
| } | |
| } else if (m.mode === "[INDENTED-EXPRESSION]" && u === "]") { | |
| x(); | |
| h(); | |
| j(); | |
| break | |
| } | |
| x(); | |
| j(); | |
| break; | |
| case "TK_START_BLOCK": | |
| D === "do" ? n("DO_BLOCK") : n("BLOCK"); | |
| U == "expand" ? (r !== "TK_OPERATOR" && (u === "return" || u === "=" ? i() : h(!0)), j(), m.ia += 1) : (r !== "TK_OPERATOR" && r !== "TK_START_EXPR" ? r === "TK_START_BLOCK" ? h() : i() : p(m.Hf) && u === "," && (A === "}" ? i() : h()), m.ia += 1, j()); | |
| break; | |
| case "TK_END_BLOCK": | |
| x(); | |
| U == "expand" ? u !== "{" && h() : r === "TK_START_BLOCK" ? Q ? l() : c() : p(m.mode) && O ? (O = !1, h(), O = !0) : h(); | |
| j(); | |
| break; | |
| case "TK_WORD": | |
| if (X) { | |
| i(); | |
| j(); | |
| i(); | |
| X = !1; | |
| break | |
| } | |
| if (w === "function") { | |
| if (m.Y) m.qa = !0; | |
| if ((Q || u === ";") && u !== "{") { | |
| T = Q ? T: 0; | |
| fa || (T = 1); | |
| for (B = 0; B < 2 - T; B++) h(!1) | |
| } | |
| } | |
| if (w === "case" || w === "default") { | |
| u === ":" ? l() : (m.ia--, h(), m.ia++); | |
| j(); | |
| m.yc = !0; | |
| break | |
| } | |
| B = "NONE"; | |
| r === "TK_END_BLOCK" ? y(w.toLowerCase(), ["else", "catch", "finally"]) ? U == "expand" || U == "end-expand" ? B = "NEWLINE": (B = "SPACE", i()) : B = "NEWLINE": r === "TK_SEMICOLON" && (m.mode === "BLOCK" || m.mode === "DO_BLOCK") ? B = "NEWLINE": r === "TK_SEMICOLON" && s(m.mode) ? B = "SPACE": r === "TK_STRING" ? B = "NEWLINE": r === "TK_WORD" ? (u === | |
| "else" && c(!0), B = "SPACE") : r === "TK_START_BLOCK" ? B = "NEWLINE": r === "TK_END_EXPR" && (i(), B = "NEWLINE"); | |
| y(w, J) && u !== ")" && (B = u == "else" ? "SPACE": "NEWLINE"); | |
| if (m.Oa && r === "TK_END_EXPR") m.Oa = !1; | |
| if (y(w.toLowerCase(), ["else", "catch", "finally"])) r !== "TK_END_BLOCK" || U == "expand" || U == "end-expand" ? h() : (c(!0), i()); | |
| else if (B === "NEWLINE") { | |
| if (! ((r === "TK_START_EXPR" || u === "=" || u === ",") && w === "function")) if (w === "function" && u == "new") i(); | |
| else if (u === "return" || u === "throw") i(); | |
| else if (r !== "TK_END_EXPR") { | |
| if ((r !== "TK_START_EXPR" || w !== | |
| "var") && u !== ":") w === "if" && D === "else" && u !== "{" ? i() : (m.Y = !1, m.qa = !1, h()) | |
| } else if (y(w, J) && u != ")") m.Y = !1, | |
| m.qa = !1, | |
| h() | |
| } else p(m.mode) && u === "," && A === "}" ? h() : B === "SPACE" && i(); | |
| j(); | |
| D = w; | |
| if (w === "var") m.Y = !0, | |
| m.qa = !1, | |
| m.ra = !1; | |
| if (w === "if") m.Oa = !0; | |
| if (w === "else") m.Oa = !1; | |
| break; | |
| case "TK_SEMICOLON": | |
| j(); | |
| m.Y = !1; | |
| m.qa = !1; | |
| if (m.mode == "OBJECT") m.mode = "BLOCK"; | |
| break; | |
| case "TK_STRING": | |
| r === "TK_START_BLOCK" || r === "TK_END_BLOCK" || r === "TK_SEMICOLON" ? h() : r === "TK_WORD" && i(); | |
| j(); | |
| break; | |
| case "TK_EQUALS": | |
| if (m.Y) m.ra = !0; | |
| i(); | |
| j(); | |
| i(); | |
| break; | |
| case "TK_OPERATOR": | |
| B = | |
| A = !0; | |
| if (m.Y && w === "," && s(m.mode)) m.ra = !1; | |
| if (m.Y && w === ",") if (m.ra) { | |
| j(); | |
| m.qa = !0; | |
| m.ra = !1; | |
| h(); | |
| break | |
| } else m.ra = !1; | |
| if (u === "return" || u === "throw") { | |
| i(); | |
| j(); | |
| break | |
| } | |
| if (w === ":" && m.yc) { | |
| j(); | |
| h(); | |
| m.yc = !1; | |
| break | |
| } | |
| if (w === "::") { | |
| j(); | |
| break | |
| } | |
| if (w === ",") { | |
| m.Y ? m.ra ? (j(), h(), m.ra = !1) : (j(), i()) : r === "TK_END_BLOCK" && m.mode !== "(EXPRESSION)" ? (j(), m.mode === "OBJECT" && u === "}" ? h() : i()) : m.mode === "OBJECT" ? (j(), h()) : (j(), i()); | |
| break | |
| } else y(w, ["--", "++", "!"]) || y(w, ["-", "+"]) && (y(r, ["TK_START_BLOCK", "TK_START_EXPR", "TK_EQUALS", "TK_OPERATOR"]) || | |
| y(u, J)) ? (B = A = !1, u === ";" && s(m.mode) && (A = !0), r === "TK_WORD" && y(u, J) && (A = !0), m.mode === "BLOCK" && (u === "{" || u === ";") && h()) : w === "." ? A = !1: w === ":" ? m.Wc == 0 ? (m.mode = "OBJECT", A = !1) : m.Wc -= 1: w === "?" && (m.Wc += 1); | |
| A && i(); | |
| j(); | |
| B && i(); | |
| break; | |
| case "TK_BLOCK_COMMENT": | |
| A = w.split(/\x0a|\x0d\x0a/); | |
| if (z(A.slice(1))) { | |
| h(); | |
| q.push(A[0]); | |
| for (B = 1; B < A.length; B++) h(), | |
| q.push(" "), | |
| q.push(d(A[B])) | |
| } else { | |
| A.length > 1 ? (h(), c()) : i(); | |
| for (B = 0; B < A.length; B++) q.push(A[B]), | |
| q.push("\n") | |
| } | |
| h(); | |
| break; | |
| case "TK_INLINE_COMMENT": | |
| i(); | |
| j(); | |
| s(m.mode) ? i() : g(); | |
| break; | |
| case "TK_COMMENT": | |
| W ? h() : i(); | |
| j(); | |
| g(); | |
| break; | |
| case "TK_UNKNOWN": | |
| (u === "return" || u === "throw") && i(), | |
| j() | |
| } | |
| A = u; | |
| r = C; | |
| u = w | |
| } | |
| return ba + q.join("").replace(/[\n ]+$/, "") | |
| } | |
| if (typeof exports !== "undefined") exports.Ag = xa; | |
| var ya; | |
| ya = typeof Float32Array != "undefined" ? Float32Array: typeof WebGLFloatArray != "undefined" ? WebGLFloatArray: Array; | |
| function Y(a) { | |
| var b = new ya(3); | |
| a && (b[0] = a[0], b[1] = a[1], b[2] = a[2]); | |
| return b | |
| } | |
| function ra(a, b, c) { | |
| if (!c || a == c) return a[0] += b[0], | |
| a[1] += b[1], | |
| a[2] += b[2], | |
| a; | |
| c[0] = a[0] + b[0]; | |
| c[1] = a[1] + b[1]; | |
| c[2] = a[2] + b[2]; | |
| return c | |
| } | |
| function za(a, b, c) { | |
| if (!c || a == c) return a[0] -= b[0], | |
| a[1] -= b[1], | |
| a[2] -= b[2], | |
| a; | |
| c[0] = a[0] - b[0]; | |
| c[1] = a[1] - b[1]; | |
| c[2] = a[2] - b[2]; | |
| return c | |
| } | |
| function va(a, b) { | |
| a[0] *= b; | |
| a[1] *= b; | |
| a[2] *= b; | |
| return a | |
| } | |
| function ka(a, b, c) { | |
| c || (c = a); | |
| var d = a[0], | |
| g = a[1], | |
| a = a[2], | |
| h = b[0], | |
| i = b[1], | |
| b = b[2]; | |
| c[0] = g * b - a * i; | |
| c[1] = a * h - d * b; | |
| c[2] = d * i - g * h | |
| } | |
| function ma(a) { | |
| var b = a[0], | |
| c = a[1], | |
| a = a[2]; | |
| return Math.sqrt(b * b + c * c + a * a) | |
| } | |
| function oa(a, b) { | |
| return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] | |
| } | |
| function $(a) { | |
| var b = new ya(16); | |
| a && (b[0] = a[0], b[1] = a[1], b[2] = a[2], b[3] = a[3], b[4] = a[4], b[5] = a[5], b[6] = a[6], b[7] = a[7], b[8] = a[8], b[9] = a[9], b[10] = a[10], b[11] = a[11], b[12] = a[12], b[13] = a[13], b[14] = a[14], b[15] = a[15]); | |
| return b | |
| } | |
| function Aa(a) { | |
| a[0] = 1; | |
| a[1] = 0; | |
| a[2] = 0; | |
| a[3] = 0; | |
| a[4] = 0; | |
| a[5] = 1; | |
| a[6] = 0; | |
| a[7] = 0; | |
| a[8] = 0; | |
| a[9] = 0; | |
| a[10] = 1; | |
| a[11] = 0; | |
| a[12] = 0; | |
| a[13] = 0; | |
| a[14] = 0; | |
| a[15] = 1; | |
| return a | |
| } | |
| function Ba(a, b, c) { | |
| c || (c = a); | |
| var d = a[0], | |
| g = a[1], | |
| h = a[2], | |
| i = a[3], | |
| j = a[4], | |
| l = a[5], | |
| n = a[6], | |
| p = a[7], | |
| s = a[8], | |
| x = a[9], | |
| z = a[10], | |
| y = a[11], | |
| F = a[12], | |
| t = a[13], | |
| q = a[14], | |
| a = a[15], | |
| w = b[0], | |
| r = b[1], | |
| u = b[2], | |
| A = b[3], | |
| D = b[4], | |
| m = b[5], | |
| E = b[6], | |
| G = b[7], | |
| I = b[8], | |
| K = b[9], | |
| M = b[10], | |
| o = b[11], | |
| J = b[12], | |
| L = b[13], | |
| B = b[14], | |
| b = b[15]; | |
| c[0] = w * d + r * j + u * s + A * F; | |
| c[1] = w * g + r * l + u * x + A * t; | |
| c[2] = w * h + r * n + u * z + A * q; | |
| c[3] = w * i + r * p + u * y + A * a; | |
| c[4] = D * d + m * j + E * s + G * F; | |
| c[5] = D * g + m * l + E * x + G * t; | |
| c[6] = D * h + m * n + E * z + G * q; | |
| c[7] = D * i + m * p + E * y + G * a; | |
| c[8] = I * d + K * j + M * s + o * F; | |
| c[9] = I * g + K * l + M * x + o * t; | |
| c[10] = I * h + K * n + M * z + o * q; | |
| c[11] = | |
| I * i + K * p + M * y + o * a; | |
| c[12] = J * d + L * j + B * s + b * F; | |
| c[13] = J * g + L * l + B * x + b * t; | |
| c[14] = J * h + L * n + B * z + b * q; | |
| c[15] = J * i + L * p + B * y + b * a | |
| } | |
| function Ca(a, b, c) { | |
| c || (c = b); | |
| var d = b[0], | |
| g = b[1], | |
| h = b[2], | |
| b = b[3]; | |
| c[0] = a[0] * d + a[4] * g + a[8] * h + a[12] * b; | |
| c[1] = a[1] * d + a[5] * g + a[9] * h + a[13] * b; | |
| c[2] = a[2] * d + a[6] * g + a[10] * h + a[14] * b; | |
| c[3] = a[3] * d + a[7] * g + a[11] * h + a[15] * b; | |
| return c | |
| } | |
| function Ea(a, b) { | |
| var c = b[0], | |
| d = b[1], | |
| g = b[2]; | |
| a[12] = a[0] * c + a[4] * d + a[8] * g + a[12]; | |
| a[13] = a[1] * c + a[5] * d + a[9] * g + a[13]; | |
| a[14] = a[2] * c + a[6] * d + a[10] * g + a[14]; | |
| a[15] = a[3] * c + a[7] * d + a[11] * g + a[15] | |
| } | |
| function ea(a) { | |
| var b = new ya(4); | |
| a && (b[0] = a[0], b[1] = a[1], b[2] = a[2], b[3] = a[3]); | |
| return b | |
| } | |
| function qa(a, b) { | |
| b[0] = a[0]; | |
| b[1] = a[1]; | |
| b[2] = a[2]; | |
| b[3] = a[3] | |
| } | |
| function pa(a, b, c) { | |
| c || (c = a); | |
| var d = a[0], | |
| g = a[1], | |
| h = a[2], | |
| a = a[3], | |
| i = b[0], | |
| j = b[1], | |
| l = b[2], | |
| b = b[3]; | |
| c[0] = d * b + a * i + g * l - h * j; | |
| c[1] = g * b + a * j + h * i - d * l; | |
| c[2] = h * b + a * l + d * j - g * i; | |
| c[3] = a * b - d * i - g * j - h * l; | |
| return c | |
| } | |
| function Fa(a) { | |
| var b; | |
| b || (b = $()); | |
| var c = a[0], | |
| d = a[1], | |
| g = a[2], | |
| h = a[3], | |
| i = c + c, | |
| j = d + d, | |
| l = g + g, | |
| a = c * i, | |
| n = c * j; | |
| c *= l; | |
| var p = d * j; | |
| d *= l; | |
| g *= l; | |
| i *= h; | |
| j *= h; | |
| h *= l; | |
| b[0] = 1 - (p + g); | |
| b[1] = n - h; | |
| b[2] = c + j; | |
| b[3] = 0; | |
| b[4] = n + h; | |
| b[5] = 1 - (a + g); | |
| b[6] = d - i; | |
| b[7] = 0; | |
| b[8] = c - j; | |
| b[9] = d + i; | |
| b[10] = 1 - (a + p); | |
| b[11] = 0; | |
| b[12] = 0; | |
| b[13] = 0; | |
| b[14] = 0; | |
| b[15] = 1; | |
| return b | |
| } | |
| function sa(a, b, c) { | |
| var d; | |
| d || (d = a); | |
| var g = a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; | |
| if (Math.abs(g) >= 1) d != a && (d[0] = a[0], d[1] = a[1], d[2] = a[2], d[3] = a[3]); | |
| else { | |
| var h = Math.acos(g), | |
| i = Math.sqrt(1 - g * g); | |
| Math.abs(i) < 0.0010 ? (d[0] = a[0] * 0.5 + b[0] * 0.5, d[1] = a[1] * 0.5 + b[1] * 0.5, d[2] = a[2] * 0.5 + b[2] * 0.5, d[3] = a[3] * 0.5 + b[3] * 0.5) : (g = Math.sin((1 - c) * h) / i, c = Math.sin(c * h) / i, d[0] = a[0] * g + b[0] * c, d[1] = a[1] * g + b[1] * c, d[2] = a[2] * g + b[2] * c, d[3] = a[3] * g + b[3] * c) | |
| } | |
| } | |
| S = S || {}; | |
| S.Ad = function(a, b, c) { | |
| S.q.u("Tilt.Cube", this); | |
| a = a || 1; | |
| b = b || 1; | |
| c = c || 1; | |
| this.P = new S.U([ - 0.5 * a, -0.5 * b, 0.5 * c, 0.5 * a, -0.5 * b, 0.5 * c, 0.5 * a, 0.5 * b, 0.5 * c, -0.5 * a, 0.5 * b, 0.5 * c, -0.5 * a, 0.5 * b, 0.5 * c, 0.5 * a, 0.5 * b, 0.5 * c, 0.5 * a, 0.5 * b, -0.5 * c, -0.5 * a, 0.5 * b, -0.5 * c, 0.5 * a, -0.5 * b, -0.5 * c, -0.5 * a, -0.5 * b, -0.5 * c, -0.5 * a, 0.5 * b, -0.5 * c, 0.5 * a, 0.5 * b, -0.5 * c, -0.5 * a, -0.5 * b, -0.5 * c, 0.5 * a, -0.5 * b, -0.5 * c, 0.5 * a, -0.5 * b, 0.5 * c, -0.5 * a, -0.5 * b, 0.5 * c, 0.5 * a, -0.5 * b, 0.5 * c, 0.5 * a, -0.5 * b, -0.5 * c, 0.5 * a, 0.5 * b, -0.5 * c, 0.5 * a, 0.5 * b, 0.5 * c, -0.5 * a, -0.5 * b, -0.5 * c, -0.5 * a, -0.5 * | |
| b, 0.5 * c, -0.5 * a, 0.5 * b, 0.5 * c, -0.5 * a, 0.5 * b, -0.5 * c], 3); | |
| this.Wa = new S.U([0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1], 2); | |
| this.ja = new S.jb([0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23]) | |
| }; | |
| S.Ad.prototype = { | |
| d: function() { | |
| S.w(this) | |
| } | |
| }; | |
| S = S || {}; | |
| S.Bd = function(a, b, c) { | |
| S.q.u("Tilt.CubeWireframe", this); | |
| a = a || 1; | |
| b = b || 1; | |
| c = c || 1; | |
| this.P = new S.U([ - 0.5 * a, -0.5 * b, 0.5 * c, 0.5 * a, -0.5 * b, 0.5 * c, 0.5 * a, 0.5 * b, 0.5 * c, -0.5 * a, 0.5 * b, 0.5 * c, 0.5 * a, -0.5 * b, -0.5 * c, -0.5 * a, -0.5 * b, -0.5 * c, -0.5 * a, 0.5 * b, -0.5 * c, 0.5 * a, 0.5 * b, -0.5 * c], 3); | |
| this.ja = new S.jb([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 5, 1, 4, 2, 7, 3, 6]) | |
| }; | |
| S.Bd.prototype = { | |
| d: function() { | |
| S.w(this) | |
| } | |
| }; | |
| S = S || {}; | |
| S.Dd = function() { | |
| S.q.u("Tilt.Rectangle", this); | |
| this.P = new S.U([0, 0, 1, 0, 0, 1, 1, 1], 2); | |
| this.Wa = new S.U([0, 0, 1, 0, 0, 1, 1, 1], 2) | |
| }; | |
| S.Dd.prototype = { | |
| d: function() { | |
| S.w(this) | |
| } | |
| }; | |
| S = S || {}; | |
| S.Ed = function() { | |
| S.q.u("Tilt.RectangleWireframe", this); | |
| this.P = new S.U([0, 0, 1, 0, 1, 1, 0, 1], 2) | |
| }; | |
| S.Ed.prototype = { | |
| d: function() { | |
| S.w(this) | |
| } | |
| }; | |
| S = S || {}; | |
| S.Mb = function(a) { | |
| S.q.u("Tilt.Mesh", this); | |
| for (var b in a) this[b] !== "draw" && (this[b] = a[b]); | |
| if ("string" === typeof this.color) this.color = S.h.xa(this.color); | |
| else if ("undefined" === typeof this.color) this.color = [1, 1, 1, 1]; | |
| if ("undefined" === typeof this.Qb) this.Qb = S.V.TRIANGLES; | |
| if ("function" === typeof a.F) this.F = a.F | |
| }; | |
| S.Mb.prototype = { | |
| F: function() { | |
| var a = S.V, | |
| b = this.P, | |
| c = this.Wa, | |
| d = this.ja, | |
| g = this.color, | |
| h = this.Xa, | |
| i = this.Qb; | |
| h ? a.qe(b, c, g, h) : a.yb(b, g); | |
| d ? a.Ld(i, d) : a.Ma(i, b.aa) | |
| }, | |
| d: function() { | |
| S.w(this) | |
| } | |
| }; | |
| S = S || {}; | |
| S.Mb.prototype.save = function(a, b) { | |
| var c = [], | |
| d = [], | |
| g = this.P.Q, | |
| h = this.Wa.Q, | |
| i = this.ja.Q, | |
| j, | |
| l; | |
| c.push("mtllib " + b + ".mtl", "usemtl webpage"); | |
| d.push("newmtl webpage", "illum 2", "Ka 1.000 1.000 1.000", "Kd 1.000 1.000 1.000", "Ks 0.000 0.000 0.000", "map_Ka " + b + ".png", "map_Kd " + b + ".png", "map_Ks " + b + ".png"); | |
| for (j = 0, l = g.length; j < l; j += 3) c.push("v " + g[j] / 100 + " " + g[j + 1] / -100 + " " + g[j + 2] / 100); | |
| for (j = 0, l = h.length; j < l; j += 2) c.push("vt " + h[j] + " " + (1 - h[j + 1])); | |
| for (j = 0, l = i.length; j < l; j += 3) c.push("f " + (i[j] + 1) + "/" + (i[j] + 1) + " " + | |
| (i[j + 1] + 1) + "/" + (i[j + 1] + 1) + " " + (i[j + 2] + 1) + "/" + (i[j + 2] + 1)); | |
| g = S.va.separator; | |
| S.va.save(c.join("\n"), a + g + b + ".obj"); | |
| S.va.save(d.join("\n"), a + g + b + ".mtl") | |
| }; | |
| S = S || {}; | |
| S.oc = function(a, b) { | |
| S.q.u("Tilt.Renderer", this); | |
| b = b || {}; | |
| this.canvas = a; | |
| this.t = this.Jd(a); | |
| S.sc(); | |
| S.B = this.t; | |
| S.V = this; | |
| if ("undefined" !== typeof this.t && this.t !== k) { | |
| if (this.TRIANGLES = this.t.TRIANGLES, this.TRIANGLE_STRIP = this.t.TRIANGLE_STRIP, this.TRIANGLE_FAN = this.t.TRIANGLE_FAN, this.LINES = this.t.LINES, this.LINE_STRIP = this.t.LINE_STRIP, this.LINE_LOOP = this.t.LINE_LOOP, this.POINTS = this.t.POINTS, this.COLOR_BUFFER_BIT = this.t.COLOR_BUFFER_BIT, this.DEPTH_BUFFER_BIT = this.t.DEPTH_BUFFER_BIT, this.STENCIL_BUFFER_BIT = | |
| this.t.STENCIL_BUFFER_BIT, this.t.clearColor(0, 0, 0, 1), this.t.clearDepth(1), this.t.clearStencil(0), "function" === typeof b.onsuccess) b.onsuccess() | |
| } else if (S.ma.log(S.fa.get("initWebGL.error")), "function" === typeof b.Ta) { | |
| b.Ta(); | |
| return | |
| } | |
| this.width = a.width; | |
| this.height = a.height; | |
| this.Mc = []; | |
| this.H = Aa($()); | |
| this.ba = Aa($()); | |
| this.se = [0, 0, 0, 0]; | |
| this.wd = [1, 1, 1, 1]; | |
| this.ec = [1, 1, 1, 1]; | |
| this.Kb = [0, 0, 0, 1]; | |
| this.sd = 1; | |
| this.We = new S.Nb(S.Z.yd.zb, S.Z.yd.qb); | |
| this.gg = new S.Nb(S.Z.Ha.zb, S.Z.Ha.qb); | |
| this.ic = new S.Dd; | |
| this.De = new S.Ed; | |
| this.og = new S.Ad; | |
| this.pg = new S.Bd; | |
| this.hc = 0; | |
| this.dc = k; | |
| this.pb = this.df = this.Md = this.elapsedTime = 0; | |
| this.origin(); | |
| this.Oc(); | |
| this.Kd() | |
| }; | |
| S.oc.prototype = { | |
| clear: function(a, b, c, d) { | |
| var g = this.se, | |
| h = this.t; | |
| if (g[0] !== a || g[1] !== b || g[2] !== c || g[3] !== d) g[0] = a, | |
| g[1] = b, | |
| g[2] = c, | |
| g[3] = d, | |
| h.clearColor(a, b, c, d), | |
| a *= 255, | |
| b *= 255, | |
| c *= 255, | |
| d *= 255, | |
| this.canvas.setAttribute("style", ["background: rgba(", a, ", ", b, ", ", c, ", ", d, "); width: 100%; height: 100%;"].join("")); | |
| h.clear(h.COLOR_BUFFER_BIT | h.DEPTH_BUFFER_BIT) | |
| }, | |
| background: function(a) { | |
| a = "string" === typeof a ? S.h.xa(a) : "undefined" === typeof a ? [0, 0, 0, 1] : "number" === typeof a ? [a / 255, a / 255, a / 255, 1] : [a[0] / 255, a[1] / 255, a[2] / | |
| 255, a[3] / 255]; | |
| this.clear(a[0], a[1], a[2], a[3]) | |
| }, | |
| Oc: function() { | |
| var a = this.width, | |
| b = this.height, | |
| c = a / 2, | |
| d = b / 2, | |
| g = d / Math.tan(S.h.Lf(45) / 2), | |
| h = g / 10, | |
| i = h * Math.tan(45 * Math.PI / 360), | |
| a = i * (a / b), | |
| b = -a, | |
| j = -i * -1; | |
| i *= -1; | |
| var l = g * 10, | |
| n = this.ba; | |
| n || (n = $()); | |
| var p = a - b, | |
| s = i - j, | |
| x = l - h; | |
| n[0] = h * 2 / p; | |
| n[1] = 0; | |
| n[2] = 0; | |
| n[3] = 0; | |
| n[4] = 0; | |
| n[5] = h * 2 / s; | |
| n[6] = 0; | |
| n[7] = 0; | |
| n[8] = (a + b) / p; | |
| n[9] = (i + j) / s; | |
| n[10] = -(l + h) / x; | |
| n[11] = -1; | |
| n[12] = 0; | |
| n[13] = 0; | |
| n[14] = -(l * h * 2) / x; | |
| n[15] = 0; | |
| Ea(this.ba, [ - c, -d, -g]); | |
| Aa(this.H); | |
| this.oa(!0) | |
| }, | |
| Af: function() { | |
| var a = this.width, | |
| b = this.height, | |
| c = this.ba; | |
| c || (c = $()); | |
| var d = a - 0, | |
| g = 0 - b; | |
| c[0] = 2 / d; | |
| c[1] = 0; | |
| c[2] = 0; | |
| c[3] = 0; | |
| c[4] = 0; | |
| c[5] = 2 / g; | |
| c[6] = 0; | |
| c[7] = 0; | |
| c[8] = 0; | |
| c[9] = 0; | |
| c[10] = -1.0E-6; | |
| c[11] = 0; | |
| c[12] = -(0 + a) / d; | |
| c[13] = -(0 + b) / g; | |
| c[14] = 0; | |
| c[15] = 1; | |
| Ea(this.ba, [0, 0, -999999]); | |
| Aa(this.H); | |
| this.oa(!1) | |
| }, | |
| Qc: function() { | |
| this.Mc.push($(this.H)) | |
| }, | |
| Pc: function() { | |
| if (this.Mc.length > 0) this.H = this.Mc.pop() | |
| }, | |
| origin: function() { | |
| Aa(this.H) | |
| }, | |
| transform: function(a) { | |
| Ba(this.H, a) | |
| }, | |
| translate: function(a, b, c) { | |
| Ea(this.H, [a, b, c || 0]) | |
| }, | |
| rotate: function(a, b, c, d) { | |
| var g = this.H, | |
| d = [b, c, d], | |
| h, | |
| b = d[0], | |
| c = d[1], | |
| d = d[2], | |
| i = | |
| Math.sqrt(b * b + c * c + d * d); | |
| if (i) { | |
| i != 1 && (i = 1 / i, b *= i, c *= i, d *= i); | |
| var j = Math.sin(a), | |
| l = Math.cos(a), | |
| n = 1 - l, | |
| a = g[0], | |
| i = g[1], | |
| p = g[2], | |
| s = g[3], | |
| x = g[4], | |
| z = g[5], | |
| y = g[6], | |
| F = g[7], | |
| t = g[8], | |
| q = g[9], | |
| w = g[10], | |
| r = g[11], | |
| u = b * b * n + l, | |
| A = c * b * n + d * j, | |
| D = d * b * n - c * j, | |
| m = b * c * n - d * j, | |
| E = c * c * n + l, | |
| G = d * c * n + b * j, | |
| I = b * d * n + c * j, | |
| b = c * d * n - b * j, | |
| c = d * d * n + l; | |
| h ? g != h && (h[12] = g[12], h[13] = g[13], h[14] = g[14], h[15] = g[15]) : h = g; | |
| h[0] = a * u + x * A + t * D; | |
| h[1] = i * u + z * A + q * D; | |
| h[2] = p * u + y * A + w * D; | |
| h[3] = s * u + F * A + r * D; | |
| h[4] = a * m + x * E + t * G; | |
| h[5] = i * m + z * E + q * G; | |
| h[6] = p * m + y * E + w * G; | |
| h[7] = s * m + F * E + r * G; | |
| h[8] = a * I + x * b + t * c; | |
| h[9] = | |
| i * I + z * b + q * c; | |
| h[10] = p * I + y * b + w * c; | |
| h[11] = s * I + F * b + r * c | |
| } | |
| }, | |
| scale: function(a, b, c) { | |
| var d = this.H, | |
| c = [a, b, c || 0], | |
| a = c[0], | |
| b = c[1], | |
| c = c[2]; | |
| d[0] *= a; | |
| d[1] *= a; | |
| d[2] *= a; | |
| d[3] *= a; | |
| d[4] *= b; | |
| d[5] *= b; | |
| d[6] *= b; | |
| d[7] *= b; | |
| d[8] *= c; | |
| d[9] *= c; | |
| d[10] *= c; | |
| d[11] *= c | |
| }, | |
| ka: function(a) { | |
| this.wd = S.h.xa(a) | |
| }, | |
| fill: function(a) { | |
| this.ec = S.h.xa(a) | |
| }, | |
| stroke: function(a) { | |
| this.Kb = S.h.xa(a) | |
| }, | |
| yf: function() { | |
| var a = this.Kb; | |
| a[0] = 0; | |
| a[1] = 0; | |
| a[2] = 0; | |
| a[3] = 0 | |
| }, | |
| Aa: function(a) { | |
| if (this.sd !== a) this.sd = a, | |
| this.t.lineWidth(a) | |
| }, | |
| Hd: function(a) { | |
| var b = this.t; | |
| "alpha" === a ? (b.enable(b.BLEND), | |
| b.blendFunc(b.SRC_ALPHA, b.ONE_MINUS_SRC_ALPHA)) : "add" === a || "additive" === a ? (b.enable(b.BLEND), b.blendFunc(b.SRC_ALPHA, b.ONE)) : b.disable(b.BLEND) | |
| }, | |
| oa: function(a) { | |
| var b = this.t; | |
| a ? b.enable(b.DEPTH_TEST) : b.disable(b.DEPTH_TEST) | |
| }, | |
| eg: function(a) { | |
| var b = this.t; | |
| a ? b.enable(b.STENCIL_TEST) : b.disable(b.STENCIL_TEST) | |
| }, | |
| Kd: function() { | |
| this.ka("#fff"); | |
| this.fill("#fff"); | |
| this.stroke("#000"); | |
| this.Aa(1); | |
| this.oa(!0); | |
| this.eg(!1); | |
| this.Hd("alpha") | |
| }, | |
| yb: function(a, b) { | |
| var c = this.We; | |
| c.Xc(); | |
| c.Ja("vertexPosition", a); | |
| c.Ia("mvMatrix", | |
| this.H); | |
| c.Ia("projMatrix", this.ba); | |
| c.rc("color", b) | |
| }, | |
| qe: function(a, b, c, d) { | |
| var g = this.gg; | |
| g.Xc(); | |
| g.Ja("vertexPosition", a); | |
| g.Ja("vertexTexCoord", b); | |
| g.Ia("mvMatrix", this.H); | |
| g.Ia("projMatrix", this.ba); | |
| g.rc("color", c); | |
| g.bindTexture("sampler", d) | |
| }, | |
| Jf: function(a, b, c, d) { | |
| var g = this.ec, | |
| h = this.Kb, | |
| a = new S.U([a[0], a[1], a[2] || 0, b[0], b[1], b[2] || 0, c[0], c[1], c[2] || 0, d[0], d[1], d[2] || 0], 3); | |
| g[3] && (this.yb(a, g), this.Ma(this.TRIANGLE_FAN, a.aa)); | |
| h[3] && (this.yb(a, h), this.Ma(this.LINE_LOOP, a.aa)); | |
| a.d() | |
| }, | |
| rect: function(a, b, c, | |
| d) { | |
| var g = this.ec, | |
| h = this.Kb, | |
| i = this.ic.P, | |
| j = this.De.P; | |
| "center" === this.ic.Ng && (a -= c / 2, b -= d / 2); | |
| this.Qc(); | |
| this.translate(a, b, 0); | |
| this.scale(c, d, 1); | |
| g[3] && (this.yb(i, g), this.Ma(this.TRIANGLE_STRIP, i.aa)); | |
| h[3] && (this.yb(j, h), this.Ma(this.LINE_LOOP, j.aa)); | |
| this.Pc() | |
| }, | |
| Nd: function(a, b, c, d, g, h) { | |
| if (a.loaded) { | |
| var i = this.ic, | |
| j = this.wd, | |
| l = i.P, | |
| h = h || i.Wa; | |
| if ("undefined" === typeof d || "undefined" === typeof g) d = a.width, | |
| g = a.height; | |
| "center" === i.yg && (b -= d * 0.5, c -= g * 0.5); | |
| j[3] && (this.Qc(), this.translate(b, c, 0), this.scale(d, g, 1), this.qe(l, | |
| h, j, a), this.Ma(this.TRIANGLE_STRIP, l.aa), this.Pc()) | |
| } | |
| }, | |
| Ma: function(a, b) { | |
| this.t.drawArrays(a, 0, b) | |
| }, | |
| Ld: function(a, b) { | |
| var c = this.t; | |
| c.bindBuffer(c.ELEMENT_ARRAY_BUFFER, b.j); | |
| c.drawElements(a, b.aa, c.UNSIGNED_SHORT, 0) | |
| }, | |
| Jd: function(a, b) { | |
| var c = ["experimental-webgl", "webgl", "webkit-3d", "moz-webgl"], | |
| d, | |
| g, | |
| h; | |
| for (g = 0, h = c.length; g < h; g++) { | |
| try { | |
| d = a.getContext(c[g], b) | |
| } catch(i) {} | |
| if (d) break | |
| } | |
| return d | |
| }, | |
| loop: function(a, b) { | |
| window.Nf(a); | |
| this.Oc(); | |
| this.Md++; | |
| if (b) { | |
| this.dc = (new Date).getTime(); | |
| if (this.hc !== 0) this.pb = this.dc - this.hc, | |
| this.df = 1E3 / this.pb; | |
| this.hc = this.dc; | |
| this.elapsedTime += this.pb | |
| } | |
| }, | |
| d: function() { | |
| S.sc(); | |
| S.w(this) | |
| } | |
| }; | |
| window.Nf = window.Pg || window.Yg || window.Eg || window.Gg || window.Fg || | |
| function(a) { | |
| window.setTimeout(a, 1E3 / 60) | |
| }; | |
| S = S || {}; | |
| S.Z = {}; | |
| S.Z.yd = { | |
| zb: "attribute vec3 vertexPosition;\nuniform mat4 mvMatrix;\nuniform mat4 projMatrix;\nvoid main(void) {\n gl_Position = projMatrix * mvMatrix * vec4(vertexPosition, 1.0);\n}", | |
| qb: "#ifdef GL_ES\nprecision lowp float;\n#endif\nuniform vec4 color;\nvoid main(void) {\n gl_FragColor = color;\n}" | |
| }; | |
| S.Z.Ha = { | |
| zb: "attribute vec3 vertexPosition;\nattribute vec2 vertexTexCoord;\nuniform mat4 mvMatrix;\nuniform mat4 projMatrix;\nvarying vec2 texCoord;\nvoid main(void) {\n gl_Position = projMatrix * mvMatrix * vec4(vertexPosition, 1.0);\n texCoord = vertexTexCoord;\n}", | |
| qb: "#ifdef GL_ES\nprecision lowp float;\n#endif\nuniform vec4 color;\nuniform sampler2D sampler;\nvarying vec2 texCoord;\nvoid main(void) {\n vec4 texture = texture2D(sampler, texCoord);\n gl_FragColor = color * texture;\n}" | |
| }; | |
| S = S || {}; | |
| S.na = function(a) { | |
| S.q.u("Tilt.Container", this); | |
| a = a || {}; | |
| this.i = a.i || !1; | |
| this.disabled = a.disabled || !1; | |
| this.standby = a.standby || !1; | |
| this.re = a.background || k; | |
| this.m = a.x || 0; | |
| this.l = a.y || 0; | |
| this.o = a.width || 0; | |
| this.k = a.height || 0; | |
| this.ta = a.Hg || [0, 0]; | |
| a.elements instanceof Array && a.elements.forEach(function(a) { | |
| this.push(a) | |
| }.bind(this)); | |
| S.c.push(this) | |
| }; | |
| S.na.prototype = []; | |
| R = S.na.prototype; | |
| R.K = function(a, b) { | |
| this.m = a; | |
| this.l = b | |
| }; | |
| R.X = function(a, b) { | |
| this.o = a; | |
| this.k = b | |
| }; | |
| R.ca = ca("m"); | |
| R.Uc = ca("o"); | |
| R.Tc = ca("k"); | |
| R.W = N("m"); | |
| R.s = N("l"); | |
| R.Na = N("o"); | |
| R.vc = N("k"); | |
| R.update = function(a, b) { | |
| var c, | |
| d, | |
| g; | |
| for (d = 0, g = this.length; d < g; d++) c = this[d], | |
| "function" === typeof c.update && !c.i && !c.disabled && c.update(a, b) | |
| }; | |
| R.F = function(a, b) { | |
| var b = b || S.V, | |
| c; | |
| c = this.re; | |
| var d = this.m, | |
| g = this.l, | |
| h = this.o, | |
| i = this.k, | |
| j = this.ta, | |
| l = d + j[0], | |
| j = g + j[1], | |
| n, | |
| p, | |
| s, | |
| x, | |
| z, | |
| y, | |
| F, | |
| t, | |
| q, | |
| w; | |
| c !== k && (b.fill(c), b.yf(), b.rect(d, g, h || b.width, i || b.height)); | |
| b.Qc(); | |
| b.translate(l, j, 0); | |
| for (q = 0, w = this.length; q < w; q++) if (c = this[q], c.tc = !1, c.Be = d, c.Ce = g, c.sg = h, c.rg = i, !c.i) if (h === 0 || i === 0) c.F(a, b), | |
| c.tc = !0; | |
| else if (n = c.r || [1, 1, 1, 1], p = n[0] + l, s = n[1] + j, x = n[2], z = n[3], n = p, y = s, p += x, s += z, x = d, z = g, F = d + h, t = g + i, n > x && p < F && y > z && s < t) c.F(a, b), | |
| c.tc = !0; | |
| b.Pc() | |
| }; | |
| R.clear = function() { | |
| for (var a = 0, b = this.length; a < b; a++) this[a].d(), | |
| this[a] = k; | |
| this.splice(0, this.length) | |
| }; | |
| R.d = function() { | |
| S.c.splice(S.c.indexOf(this), 1); | |
| S.w(this) | |
| }; | |
| S = S || {}; | |
| S.Fd = function(a) { | |
| S.q.u("Tilt.ScrollContainer", this); | |
| S.c.push(this); | |
| this.view = new S.na(a); | |
| this.view.standby = !0; | |
| this.scrollbars = new S.na; | |
| this.top = a.je[0] || 0; | |
| this.bottom = a.je[1] || Number.MAX_VALUE; | |
| this.view.ta[1] = this.top; | |
| var b = new S.f(a.top, { | |
| x: this.view.m - 25, | |
| y: this.view.l - 5, | |
| width: 32, | |
| height: 30, | |
| fill: a.top ? k: "#f00a", | |
| padding: a.top ? a.top.e: [0, 0, 0, 0], | |
| onmousedown: function() { | |
| window.clearInterval(this.hb); | |
| window.clearInterval(this.gb); | |
| window.clearInterval(this.fb); | |
| var a = S.c, | |
| b = this.view, | |
| c = b.ta; | |
| this.gb = window.setInterval(function() { | |
| c[1] = | |
| S.h.M(c[1] + 5, this.top, -this.bottom + b.k); | |
| a.v(); | |
| a.R || (c = b = a = k, window.clearInterval(this.gb)) | |
| }.bind(this), 1E3 / 60) | |
| }.bind(this) | |
| }), | |
| c = new S.f(a.bottom, { | |
| x: this.view.m - 25, | |
| y: this.view.l + this.view.k - 25, | |
| width: 32, | |
| height: 30, | |
| fill: a.bottom ? k: "#0f0a", | |
| padding: a.bottom ? a.bottom.e: [0, 0, 0, 0], | |
| onmousedown: function() { | |
| window.clearInterval(this.hb); | |
| window.clearInterval(this.gb); | |
| window.clearInterval(this.fb); | |
| var a = S.c, | |
| b = this.view, | |
| c = b.ta; | |
| this.fb = window.setInterval(function() { | |
| c[1] = S.h.M(c[1] - 5, this.top, -this.bottom + b.k); | |
| a.v(); | |
| a.R || (c = b = a = k, window.clearInterval(this.fb)) | |
| }.bind(this), 1E3 / 60) | |
| }.bind(this) | |
| }), | |
| a = new S.f(a.reset, { | |
| x: this.view.m - 25, | |
| y: this.view.l + this.view.k - 50, | |
| width: 32, | |
| height: 30, | |
| fill: a.reset ? k: "#0f0b", | |
| padding: a.reset ? a.reset.e: [0, 0, 0, 0], | |
| onmousedown: function() { | |
| window.clearInterval(this.hb); | |
| window.clearInterval(this.gb); | |
| window.clearInterval(this.fb); | |
| var a = S.c, | |
| b = this.view, | |
| c = b.ta; | |
| this.hb = window.setInterval(function() { | |
| c[1] -= (c[1] - this.top) / 10; | |
| a.v(); | |
| Math.abs(c[1] - this.top) < 0.1 && (c = b = a = k, window.clearInterval(this.hb)) | |
| }.bind(this), | |
| 1E3 / 60) | |
| }.bind(this) | |
| }); | |
| this.view.onmousescroll = function(a) { | |
| window.clearInterval(this.hb); | |
| window.clearInterval(this.gb); | |
| window.clearInterval(this.fb); | |
| var b = S.c, | |
| c = this.view, | |
| i = c.ta; | |
| i[1] = S.h.M(i[1] - a / 2, this.top, -this.bottom + c.k); | |
| b.v() | |
| }.bind(this); | |
| this.scrollbars.push(b, c, a); | |
| a = c = b = k | |
| }; | |
| S.Fd.prototype = { | |
| update: function() { | |
| this.scrollbars.i = this.view.i; | |
| this.scrollbars.disabled = this.view.disabled | |
| }, | |
| F: aa(), | |
| d: function() { | |
| S.c.splice(S.c.indexOf(this), 1); | |
| S.w(this) | |
| } | |
| }; | |
| S = S || {}; | |
| S.f = function(a, b) { | |
| S.q.u("Tilt.Button", this); | |
| b = b || {}; | |
| this.i = b.i || !1; | |
| this.disabled = b.disabled || !1; | |
| this.onmousedown = b.onmousedown || f; | |
| this.onmouseup = b.onmouseup || f; | |
| this.onclick = b.onclick || f; | |
| this.b = a || { | |
| m: -1, | |
| l: -1, | |
| o: -1, | |
| k: -1 | |
| }; | |
| this.b.m = b.x || this.b.m; | |
| this.b.l = b.y || this.b.l; | |
| this.b.o = b.width || this.b.o; | |
| this.b.k = b.height || this.b.k; | |
| this.b.disabled = !0; | |
| this.e = b.padding || [0, 0, 0, 0]; | |
| this.Gb = b.fill || k; | |
| this.lc = b.stroke || k; | |
| this.r = [this.b.m + this.e[0], this.b.l + this.e[1], this.b.o - this.e[0] - this.e[2], this.b.k - this.e[1] - this.e[3]] | |
| }; | |
| S.f.prototype = { | |
| K: function(a, b) { | |
| "function" === typeof this.b.K ? this.b.K(a, b) : (this.b.m = a, this.b.l = b); | |
| this.r[0] = a + this.e[0]; | |
| this.r[1] = b + this.e[1] | |
| }, | |
| X: function(a, b) { | |
| "function" === typeof this.b.X ? this.b.X(a, b) : (this.b.o = a, this.b.k = b); | |
| this.r[2] = a - this.e[0] - this.e[2]; | |
| this.r[3] = b - this.e[1] - this.e[3] | |
| }, | |
| ca: function(a) { | |
| this.K(a, this.b.l) | |
| }, | |
| Uc: function(a) { | |
| this.X(a, this.b.k) | |
| }, | |
| Tc: function(a) { | |
| this.X(this.b.o, a) | |
| }, | |
| ne: function(a) { | |
| var b = this.b.m, | |
| c = this.b.l, | |
| d = this.b.o, | |
| g = this.b.k, | |
| h = this.b.e; | |
| this.b = a; | |
| this.b.e = h; | |
| this.b.K(b, | |
| c); | |
| this.b.X(d, g); | |
| this.b.disabled = !0 | |
| }, | |
| $b: ca("Gb"), | |
| W: function() { | |
| return this.b.m | |
| }, | |
| s: function() { | |
| return this.b.l | |
| }, | |
| Na: function() { | |
| return this.b.o | |
| }, | |
| vc: function() { | |
| return this.b.k | |
| }, | |
| F: function(a, b) { | |
| b = b || S.V; | |
| "undefined" !== typeof this.b.mc && this.b.F(b); | |
| var c, | |
| d, | |
| g = this.Gb, | |
| h = this.lc; | |
| if (g || h) c = this.r, | |
| d = this.e, | |
| b.fill(g || "#fff0"), | |
| b.stroke(h || "#0000"), | |
| b.rect(c[0] - d[0], c[1] - d[1], c[2] + d[0] + d[2], c[3] + d[1] + d[3]); | |
| S.c.Ze && (b.fill("#fff2"), b.stroke("#00f"), b.rect(this.b.m, this.b.l, this.b.o, this.b.k), this.disabled || (b.fill("#0f04"), | |
| b.rect(this.r[0], this.r[1], this.r[2], this.r[3]))) | |
| }, | |
| d: function() { | |
| S.w(this) | |
| } | |
| }; | |
| S = S || {}; | |
| S.Ga = function(a, b) { | |
| S.q.u("Tilt.Slider", this); | |
| b = b || {}; | |
| this.i = b.i || !1; | |
| this.disabled = b.disabled || !1; | |
| this.onmousedown = b.onmousedown || f; | |
| this.onmouseup = b.onmouseup || f; | |
| this.onclick = b.onclick || f; | |
| this.b = new S.z(a.mc, a.Jb, { | |
| padding: a.e, | |
| ka: a.vd | |
| }); | |
| this.b.m = b.x || this.b.m; | |
| this.b.l = b.y || this.b.l; | |
| this.b.o = b.width || this.b.o; | |
| this.b.k = b.height || this.b.k; | |
| this.m = this.b.m; | |
| this.l = this.b.l; | |
| this.kc = b.size || 100; | |
| this.cd = b.direction || 0; | |
| this.r = [this.b.m + this.b.e[0], this.b.l + this.b.e[1], this.b.o - this.b.e[2], this.b.k - this.b.e[3]]; | |
| this.O(b.value || 0) | |
| }; | |
| S.Ga.prototype = { | |
| K: function(a, b) { | |
| this.m = a; | |
| this.l = b; | |
| this.r[0] = a + this.b.e[0]; | |
| this.r[1] = b + this.b.e[1]; | |
| this.O(this.S) | |
| }, | |
| ca: function(a) { | |
| this.K(a, this.l); | |
| this.O(this.S) | |
| }, | |
| X: function(a) { | |
| this.kc = a; | |
| this.O(this.S) | |
| }, | |
| O: function(a) { | |
| var b = this.b, | |
| c = this.m, | |
| d = this.l, | |
| g = this.kc, | |
| h = this.cd; | |
| this.S = S.h.M(a + 0.0010, 0, 100); | |
| h === 0 ? (a = S.h.map(this.S, 0, 100, c, c + g), b.K(a, d), this.r[0] = a + b.e[0]) : (a = S.h.map(this.S, 0, 100, d, d + g), b.K(c, a), this.r[1] = a + b.e[1]) | |
| }, | |
| W: N("m"), | |
| s: N("l"), | |
| update: function() { | |
| var a, | |
| b, | |
| c, | |
| d, | |
| g, | |
| h, | |
| i; | |
| if (this.R) this.qd = !0; | |
| else if (!S.c.R) this.qd = | |
| !1; | |
| if (this.qd) a = this.b, | |
| b = this.Be, | |
| c = this.Ce, | |
| d = this.m, | |
| g = this.l, | |
| h = this.kc, | |
| i = this.cd, | |
| i === 0 ? (d += b, h = d + h, i = S.h.M(S.c.Lc - a.o * 0.5, d, h), b = i - b, a.K(b, g), this.S = S.h.map(i, d, h, 0, 100), this.r[0] = b + a.e[0]) : (g += c, i = S.h.M(S.c.qg - a.k * 0.5, g, g + h), b = i - c, a.K(d, b), this.S = S.h.map(b, g, g + h, 0, 100), this.r[1] = b + a.e[1]) | |
| }, | |
| F: function(a, b) { | |
| b = b || S.V; | |
| this.b.F(b) | |
| }, | |
| d: function() { | |
| S.w(this) | |
| } | |
| }; | |
| S = S || {}; | |
| S.z = function(a, b, c) { | |
| S.q.u("Tilt.Sprite", this); | |
| c = c || {}; | |
| this.i = c.i || !1; | |
| this.disabled = c.disabled || !1; | |
| this.onmousedown = c.onmousedown || f; | |
| this.onmouseup = c.onmouseup || f; | |
| this.onclick = c.onclick || f; | |
| this.mc = a; | |
| this.Jb = b || [0, 0, a.width, a.height]; | |
| this.m = c.x || 0; | |
| this.l = c.y || 0; | |
| this.o = c.width || this.Jb[2]; | |
| this.k = c.height || this.Jb[3]; | |
| this.e = c.padding || [0, 0, 0, 0]; | |
| this.vd = c.ka || k; | |
| this.xe = c.oa || !1; | |
| this.r = [this.m + this.e[0], this.l + this.e[1], this.o - this.e[0] - this.e[2], this.k - this.e[0] - this.e[3]]; | |
| this.Lb = k | |
| }; | |
| S.z.prototype = { | |
| K: function(a, b) { | |
| this.m = a; | |
| this.l = b; | |
| this.r[0] = a + this.e[0]; | |
| this.r[1] = b + this.e[1] | |
| }, | |
| X: function(a, b) { | |
| this.o = a; | |
| this.k = b; | |
| this.r[2] = a - this.e[0] - this.e[2]; | |
| this.r[3] = b - this.e[1] - this.e[3] | |
| }, | |
| ca: function(a) { | |
| this.K(a, this.l) | |
| }, | |
| Uc: function(a) { | |
| this.X(a, this.k) | |
| }, | |
| Tc: function(a) { | |
| this.X(this.o, a) | |
| }, | |
| W: N("m"), | |
| s: N("l"), | |
| Na: N("o"), | |
| vc: N("k"), | |
| F: function(a, b) { | |
| var b = b || S.V, | |
| c = this.Jb, | |
| d = this.mc, | |
| g = this.m, | |
| h = this.l, | |
| i = this.o, | |
| j = this.k, | |
| l = this.xe, | |
| n = this.vd; | |
| if (this.Lb === k && d.loaded) this.Lb = new S.U([c[0] / d.width, c[1] / d.height, | |
| (c[0] + c[2]) / d.width, c[1] / d.height, c[0] / d.width, (c[1] + c[3]) / d.height, (c[0] + c[2]) / d.width, (c[1] + c[3]) / d.height], 2); | |
| n !== k && b.ka(n); | |
| l ? (b.oa(!0), b.Nd(d, g, h, i, j, this.Lb), b.oa(!1)) : b.Nd(d, g, h, i, j, this.Lb); | |
| n !== k && b.ka("#fff"); | |
| S.c.Ze && (b.fill("#fff2"), b.stroke("#f00"), b.rect(this.m, this.l, this.o, this.k), this.disabled || (b.fill("#0f04"), b.rect(this.r[0], this.r[1], this.r[2], this.r[3]))) | |
| }, | |
| d: function() { | |
| S.w(this) | |
| } | |
| }; | |
| S = S || {}; | |
| S.c = []; | |
| S.c.Lc = 0; | |
| S.c.Zd = 0; | |
| S.c.R = !1; | |
| S.c.$ = !1; | |
| S.c.xf = 0; | |
| S.c.Sd = []; | |
| S.c.v = aa(); | |
| S.c.F = function(a) { | |
| var b = S.V, | |
| c, | |
| d, | |
| g; | |
| b.Kd(); | |
| b.Af(); | |
| for (c = 0, d = this.length; c < d; c++) g = this[c], | |
| g.i || (g.disabled || g.update(a, b), g.F(a, b)) | |
| }; | |
| S.c.Ef = function(a) { | |
| if (! (a.Fc || this.indexOf(a) === -1)) { | |
| for (var b = 0, c = this.length; b < c; b++) this[b].md = this[b].disabled, | |
| this[b].disabled = !0; | |
| a.Fc = !0; | |
| a.i = !1; | |
| a.disabled = !1; | |
| this.v() | |
| } | |
| }; | |
| S.c.$e = function(a) { | |
| if (a.Fc && this.indexOf(a) !== -1) { | |
| for (var b = 0, c = this.length; b < c; b++) this[b].disabled = this[b].md, | |
| delete this[b].md; | |
| a.Fc = !1; | |
| a.i = !0; | |
| a.disabled = !0; | |
| this.v() | |
| } | |
| }; | |
| S.c.Gc = function(a, b, c) { | |
| this.R = !0; | |
| this.$ = !1; | |
| this.ab("onmousedown", a, b, c) | |
| }; | |
| S.c.Kc = function(a, b, c) { | |
| this.$ = this.R = !1; | |
| this.ab("onmouseup", a, b, c) | |
| }; | |
| S.c.click = function(a, b) { | |
| this.ab("onclick", a, b) | |
| }; | |
| S.c.af = function(a, b) { | |
| this.ab("ondoubleclick", a, b) | |
| }; | |
| S.c.Hc = function(a, b) { | |
| this.Lc = a; | |
| this.Zd = b | |
| }; | |
| S.c.Jc = function(a) { | |
| this.$ = !1; | |
| this.xf = a; | |
| this.ab("onmousescroll", a) | |
| }; | |
| S.c.$ = aa(); | |
| S.c.Ic = aa(); | |
| S.c.Cc = function(a) { | |
| this.Sd[a] = !0; | |
| this.hd("onkeydown", a) | |
| }; | |
| S.c.Dc = function(a) { | |
| this.Sd[a] = !1; | |
| this.hd("onkeyup", a) | |
| }; | |
| S.c.ab = function(a, b, c, d) { | |
| var g, | |
| h, | |
| i, | |
| j, | |
| l, | |
| n, | |
| p, | |
| s, | |
| x, | |
| z, | |
| y, | |
| F, | |
| t = this.Lc, | |
| q = this.Zd; | |
| for (g = 0, i = this.length; g < i; g++) if (l = this[g], !l.i && !l.disabled) { | |
| p = l.m || 0; | |
| h = l.l || 0; | |
| j = l.o || 0; | |
| s = l.k || 0; | |
| if (l.standby && t > p && t < p + j && q > h && q < h + s) this.$ = !0, | |
| n = l[a], | |
| "function" === typeof n && n(b, c, d); | |
| j = l.ta || [0, 0]; | |
| p += j[0]; | |
| s = h + j[1] + 2; | |
| for (h = 0, j = l.length; h < j; h++) if (n = l[h], !n.i && !n.disabled && n.tc) { | |
| x = n.r || [ - 1, -1, -1, -1]; | |
| z = x[0] + p; | |
| y = x[1] + s; | |
| F = x[2]; | |
| x = x[3]; | |
| if ("onmouseup" === a) n.R = !1; | |
| if (t > z && t < z + F && q > y && q < y + x) { | |
| if ("onmousedown" === a) n.R = !0; | |
| this.$ = !0; | |
| n = n[a]; | |
| "function" === typeof n && n(b, c, d) | |
| } | |
| } | |
| } | |
| }; | |
| S.c.hd = function(a, b) { | |
| var c, | |
| d, | |
| g, | |
| h, | |
| i, | |
| j; | |
| for (c = 0, g = this.length; c < g; c++) if (i = this[c], !i.i && !i.disabled) { | |
| i.standby && (j = i[a], "function" === typeof j && j(b)); | |
| for (d = 0, h = i.length; d < h; d++) j = i[d], | |
| !j.i && !j.disabled && (j = j[a], "function" === typeof j && j(b)) | |
| } | |
| }; | |
| S.q.u("Tilt.UI", S.c); | |
| S = S || {}; | |
| S.ma = { | |
| alert: function(a, b) { | |
| var c; | |
| "undefined" === typeof b && (b = "undefined"); | |
| try { | |
| c = Cc["@mozilla.org/embedcomp/prompt-service;1"].getService(Ci.nsIPromptService), | |
| c.alert(k, a, b) | |
| } catch(d) { | |
| window.alert(b) | |
| } | |
| }, | |
| log: function(a) { | |
| var b; | |
| "undefined" === typeof a && (a = "undefined"); | |
| try { | |
| b = Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService), | |
| b.logStringMessage(a) | |
| } catch(c) { | |
| window.alert(a) | |
| } | |
| }, | |
| error: function(a, b, c, d, g, h, i) { | |
| var j, | |
| l; | |
| "undefined" === typeof a && (a = "undefined"); | |
| try { | |
| j = Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService), | |
| l = Cc["@mozilla.org/scripterror;1"].createInstance(Ci.nsIScriptError), | |
| l.init(a, b, c, d, g, h, i), | |
| j.logMessage(l) | |
| } catch(n) { | |
| window.alert(a) | |
| } | |
| } | |
| }; | |
| S.fa = { | |
| Id: "tilt-string-bundle", | |
| get: function(a) { | |
| if ("undefined" === typeof a) return "undefined"; | |
| var b = document.getElementById(this.Id); | |
| return b ? b.getString(a) : a | |
| }, | |
| uc: function(a, b) { | |
| if ("undefined" === typeof a) return "undefined"; | |
| if ("undefined" === typeof b) return a; | |
| var c = document.getElementById(this.Id); | |
| return c ? c.vg(a, b) : [a, b].join(" ") | |
| } | |
| }; | |
| S = S || {}; | |
| S.G = { | |
| ob: f, | |
| Ka: f, | |
| Ra: function(a, b, c, d) { | |
| if ("undefined" === typeof this.ob) this.ob = document; | |
| if ("undefined" === typeof this.Ka) this.Ka = document.body; | |
| var g = this.ob, | |
| h = this.Ka; | |
| if ("undefined" === typeof g || g === k || "undefined" === typeof h || h === k) return k; | |
| g = g.createElement("canvas"); | |
| g.setAttribute("style", "width: 100%; height: 100%;"); | |
| g.width = a; | |
| g.height = b; | |
| g.id = d; | |
| c && this.append(g, h); | |
| return g | |
| }, | |
| zg: function() { | |
| var a = this.Ra(window.innerWidth, window.innerHeight, !0); | |
| this.Ka.setAttribute("style", "background: #000; margin: 0px; padding: 0px; overflow: hidden;"); | |
| return a | |
| }, | |
| append: function(a, b) { | |
| b.appendChild(a) | |
| }, | |
| remove: function(a) { | |
| a.parentNode.removeChild(a) | |
| }, | |
| oe: function(a, b, c, d) { | |
| var g = this.top = this.left = this.xb = 0, | |
| h = 0, | |
| i = function(b, d) { | |
| var n, | |
| p, | |
| s, | |
| x; | |
| for (n = 0, p = b.childNodes.length; n < p; n++) s = b.childNodes[n], | |
| d > g && (g = d), | |
| h++, | |
| this.xb++, | |
| a(s, d, h, this.xb, this.left, this.top), | |
| i(s, d + 1), | |
| c && s.localName === "iframe" && (x = S.G.wc(s), this.left += x.x, this.top += x.y, i(s.contentDocument, d + 1), this.left -= x.x, this.top -= x.y) | |
| }.bind(this); | |
| try { | |
| "function" === typeof a && i(d || window.content.document, | |
| 0), | |
| "function" === typeof b && b(g, h) | |
| } finally { | |
| d = k | |
| } | |
| }, | |
| ff: function(a) { | |
| var b, | |
| c = { | |
| width: a.innerWidth + a.scrollMaxX, | |
| height: a.innerHeight + a.scrollMaxY | |
| }; | |
| this.oe(function(a) { | |
| b = this.wc(a); | |
| c.width = Math.max(c.width, b.x || 0 + b.width || 0); | |
| c.height = Math.max(c.height, b.y || 0 + b.height || 0) | |
| }.bind(this), k, a.document); | |
| return c | |
| }, | |
| wc: function(a) { | |
| if (a.nodeType !== 1) return { | |
| x: 0, | |
| y: 0, | |
| width: 0, | |
| height: 0 | |
| }; | |
| var b, | |
| c, | |
| d, | |
| g; | |
| try { | |
| if (a.localName === "head" || a.localName === "body") throw new Exception; | |
| d = a.getBoundingClientRect(); | |
| b = window.content.pageXOffset; | |
| c = window.content.pageYOffset; | |
| return { | |
| x: d.left + b, | |
| y: d.top + c, | |
| width: d.width, | |
| height: d.height | |
| } | |
| } catch(h) { | |
| c = b = 0; | |
| d = a.clientWidth; | |
| g = a.clientHeight; | |
| if (a.offsetParent) { | |
| do b += a.offsetLeft, | |
| c += a.offsetTop; | |
| while (a = a.offsetParent) | |
| } else { | |
| if (a.x) b = a.x; | |
| if (a.y) c = a.y | |
| } | |
| return { | |
| x: b, | |
| y: c, | |
| width: d, | |
| height: g | |
| } | |
| } finally {} | |
| }, | |
| wg: function(a) { | |
| var b; | |
| a.nodeType === 1 ? b = "ELEMENT_NODE": a.nodeType === 2 ? b = "ATTRIBUTE_NODE": a.nodeType === 3 ? b = "TEXT_NODE": a.nodeType === 4 ? b = "CDATA_SECTION_NODE": a.nodeType === 5 ? b = "ENTITY_REFERENCE_NODE": a.nodeType === 6 ? b = "ENTITY_NODE": | |
| a.nodeType === 7 ? b = "PROCESSING_INSTRUCTION_NODE": a.nodeType === 8 ? b = "COMMENT_NODE": a.nodeType === 9 ? b = "DOCUMENT_NODE": a.nodeType === 10 ? b = "DOCUMENT_TYPE_NODE": a.nodeType === 11 ? b = "DOCUMENT_FRAGMENT_NODE": a.nodeType === 12 && (b = "NOTATION_NODE"); | |
| return b | |
| }, | |
| ef: function(a) { | |
| var b = [], | |
| c, | |
| d; | |
| for (c = 0, d = a.length; c < d; c++) b.push(a[c].name + ' = "' + a[c].value + '"'); | |
| return b.join("\n") + "\n" | |
| }, | |
| gf: function(a) { | |
| var b = [], | |
| c, | |
| d, | |
| g; | |
| for (g = 0; g < a.length; g++) c = a[g], | |
| d = a.getPropertyValue(c), | |
| c = c + ": " + d + ";", | |
| 'background-attachment: scroll;\nbackground-clip: border-box;\nbackground-color: transparent;\nbackground-image: none;\nbackground-origin: padding-box;\nbackground-position: 0% 0%;\nbackground-repeat: repeat;\nbackground-size: auto auto;\nborder-bottom-color: rgb(0, 0, 0);\nborder-bottom-left-radius: 0px;\nborder-bottom-right-radius: 0px;\nborder-bottom-style: none;\nborder-bottom-width: 0px;\nborder-collapse: separate;\nborder-left-color: rgb(0, 0, 0);\nborder-left-style: none;\nborder-left-width: 0px;\nborder-right-color: rgb(0, 0, 0);\nborder-right-style: none;\nborder-right-width: 0px;\nborder-spacing: 0px 0px;\nborder-top-color: rgb(0, 0, 0);\nborder-top-left-radius: 0px;\nborder-top-right-radius: 0px;\nborder-top-style: none;\nborder-top-width: 0px;\nbottom: auto;\nbox-shadow: none;\ncaption-side: top;\nclear: none;\nclip: auto;\ncolor: rgb(0, 0, 0);\ncontent: none;\ncounter-increment: none;\ncounter-reset: none;\ncursor: auto;\ndirection: ltr;\ndisplay: block;\nempty-cells: -moz-show-background;\nfloat: none;\nfont-family: serif;\nfont-size: 16px;\nfont-size-adjust: none;\nfont-stretch: normal;\nfont-style: normal;\nfont-variant: normal;\nfont-weight: 400;\nheight: 0px;\nime-mode: auto;\nleft: auto;\nletter-spacing: normal;\nline-height: 19.2px;\nlist-style-image: none;\nlist-style-position: outside;\nlist-style-type: disc;\nmargin-bottom: 8px;\nmargin-left: 8px;\nmargin-right: 8px;\nmargin-top: 8px;\nmarker-offset: auto;\nmax-height: none;\nmax-width: none;\nmin-height: 0px;\nmin-width: 0px;\nopacity: 1;\noutline-color: rgb(0, 0, 0);\noutline-offset: 0px;\noutline-style: none;\noutline-width: 0px;\noverflow: visible;\noverflow-x: visible;\noverflow-y: visible;\npadding-bottom: 0px;\npadding-left: 0px;\npadding-right: 0px;\npadding-top: 0px;\npage-break-after: auto;\npage-break-before: auto;\npointer-events: auto;\nposition: static;\nquotes: "\u201c" "\u201d" "\u2018" "\u2019";\nresize: none;\nright: auto;\ntable-layout: auto;\ntext-align: start;\ntext-decoration: none;\ntext-indent: 0px;\ntext-overflow: clip;\ntext-shadow: none;\ntext-transform: none;\ntop: auto;\nunicode-bidi: embed;\nvertical-align: baseline;\nvisibility: visible;\nwhite-space: normal;\nwidth: 1157px;\nword-spacing: 0px;\nword-wrap: normal;\nz-index: auto;\n-moz-animation-delay: 0s;\n-moz-animation-direction: normal;\n-moz-animation-duration: 0s;\n-moz-animation-fill-mode: none;\n-moz-animation-iteration-count: 1;\n-moz-animation-name: none;\n-moz-animation-play-state: running;\n-moz-animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);\n-moz-appearance: none;\n-moz-background-inline-policy: continuous;\n-moz-binding: none;\n-moz-border-bottom-colors: none;\n-moz-border-image: none;\n-moz-border-left-colors: none;\n-moz-border-right-colors: none;\n-moz-border-top-colors: none;\n-moz-box-align: stretch;\n-moz-box-direction: normal;\n-moz-box-flex: 0;\n-moz-box-ordinal-group: 1;\n-moz-box-orient: horizontal;\n-moz-box-pack: start;\n-moz-box-sizing: content-box;\n-moz-column-count: auto;\n-moz-column-gap: 16px;\n-moz-column-rule-color: rgb(0, 0, 0);\n-moz-column-rule-style: none;\n-moz-column-rule-width: 0px;\n-moz-column-width: auto;\n-moz-float-edge: content-box;\n-moz-font-feature-settings: normal;\n-moz-font-language-override: normal;\n-moz-force-broken-image-icon: 0;\n-moz-hyphens: manual;\n-moz-image-region: auto;\n-moz-orient: horizontal;\n-moz-outline-radius-bottomleft: 0px;\n-moz-outline-radius-bottomright: 0px;\n-moz-outline-radius-topleft: 0px;\n-moz-outline-radius-topright: 0px;\n-moz-stack-sizing: stretch-to-fit;\n-moz-tab-size: 8;\n-moz-text-blink: none;\n-moz-text-decoration-color: rgb(0, 0, 0);\n-moz-text-decoration-line: none;\n-moz-text-decoration-style: solid;\n-moz-transform: none;\n-moz-transform-origin: 50% 50%;\n-moz-transition-delay: 0s;\n-moz-transition-duration: 0s;\n-moz-transition-property: all;\n-moz-transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);\n-moz-user-focus: none;\n-moz-user-input: auto;\n-moz-user-modify: read-only;\n-moz-user-select: auto;\n-moz-window-shadow: default;\nclip-path: none;\nclip-rule: nonzero;\ncolor-interpolation: srgb;\ncolor-interpolation-filters: linearrgb;\ndominant-baseline: auto;\nfill: rgb(0, 0, 0);\nfill-opacity: 1;\nfill-rule: nonzero;\nfilter: none;\nflood-color: rgb(0, 0, 0);\nflood-opacity: 1;\nimage-rendering: auto;\nlighting-color: rgb(255, 255, 255);\nmarker-end: none;\nmarker-mid: none;\nmarker-start: none;\nmask: none;\nshape-rendering: auto;\nstop-color: rgb(0, 0, 0);\nstop-opacity: 1;\nstroke: none;\nstroke-dasharray: none;\nstroke-dashoffset: 0px;\nstroke-linecap: butt;\nstroke-linejoin: miter;\nstroke-miterlimit: 4;\nstroke-opacity: 1;\nstroke-width: 1px;\ntext-anchor: start;\ntext-rendering: auto;'.indexOf(c) === | |
| -1 && b.push(c); | |
| return b.join("\n") + "\n" | |
| } | |
| }; | |
| S.q.u("Tilt.Document", S.G); | |
| S = S || {}; | |
| S.va = { | |
| bg: function(a, b) { | |
| var c; | |
| c = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker); | |
| c.init(window, a, b === "folder" ? Ci.nsIFilePicker.modeGetFolder: Ci.nsIFilePicker.Dg); | |
| return c.show() == Ci.nsIFilePicker.returnOK ? c.file: k | |
| }, | |
| save: function(a, b) { | |
| var c, | |
| d; | |
| Cu.import("resource://gre/modules/FileUtils.jsm"); | |
| Cu.import("resource://gre/modules/NetUtil.jsm"); | |
| c = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); | |
| c.initWithPath(b); | |
| c = FileUtils.openSafeFileOutputStream(c); | |
| d = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter); | |
| d.charset = "UTF-8"; | |
| d = d.convertToInputStream(a); | |
| NetUtil.asyncCopy(d, c, | |
| function(a) { | |
| Components.isSuccessCode(a) | |
| }) | |
| }, | |
| Rf: function(a, b) { | |
| var c, | |
| d, | |
| g; | |
| Cu.import("resource://gre/modules/FileUtils.jsm"); | |
| Cu.import("resource://gre/modules/NetUtil.jsm"); | |
| c = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); | |
| c.initWithPath(b); | |
| d = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService); | |
| g = d.newURI(a.toDataURL("image/png", ""), "UTF8", k); | |
| d.newFileURI(c); | |
| d = Cc["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"].createInstance(Ci.nsIWebBrowserPersist); | |
| d.persistFlags = Ci.nsIWebBrowserPersist.PERSIST_FLAGS_REPLACE_EXISTING_FILES; | |
| d.persistFlags |= Ci.nsIWebBrowserPersist.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION; | |
| d.saveURI(g, k, k, k, k, c) | |
| }, | |
| separator: navigator.appVersion.indexOf("Win") !== -1 ? "\\": "/" | |
| }; | |
| S.q.u("Tilt.File", S.va); | |
| S = S || {}; | |
| S.h = { | |
| Lf: function(a) { | |
| return a * 0.0174532925 | |
| }, | |
| tg: function(a) { | |
| return a * 57.2957795 | |
| }, | |
| map: function(a, b, c, d, g) { | |
| return d + (g - d) * ((a - b) / (c - b)) | |
| }, | |
| Rd: function(a) { | |
| return (a & a - 1) === 0 | |
| }, | |
| $d: function(a) { | |
| var b; --a; | |
| for (b = 1; b < 32; b <<= 1) a |= a >> b; | |
| return a + 1 | |
| }, | |
| M: function(a, b, c) { | |
| if (b > c) var d = b, | |
| b = c, | |
| c = d; | |
| return Math.max(b, Math.min(c, a)) | |
| }, | |
| Mg: function(a, b, c) { | |
| b *= 0.5; | |
| var d = Math.sin(b), | |
| b = Math.cos(b), | |
| g = a[0] * d, | |
| h = a[1] * d, | |
| a = a[2] * d; | |
| return "undefined" === typeof c ? [g, h, a, b] : (c[0] = g, c[1] = h, c[2] = a, c[3] = b, c) | |
| }, | |
| Kf: function(a, b, c, d) { | |
| var g; | |
| b *= 0.5; | |
| a *= 0.5; | |
| c *= 0.5; | |
| var h = Math.sin, | |
| i = Math.cos; | |
| g = h(b); | |
| var j = h(a), | |
| h = h(c), | |
| l = i(b), | |
| n = i(a), | |
| i = i(c), | |
| b = g * n * i - l * j * h, | |
| a = l * j * i + g * n * h, | |
| c = l * n * h - g * j * i; | |
| g = l * n * i + g * j * h; | |
| return "undefined" === typeof d ? [b, a, c, g] : (d[0] = b, d[1] = a, d[2] = c, d[3] = g, d) | |
| }, | |
| Lg: function(a, b, c, d, g) { | |
| var h, | |
| i = ea(); | |
| d ? Ba(d, c, h = $()) : h = c; | |
| a[3] = 1; | |
| Ca(h, a, i); | |
| d ? (g[0] = i[0] / i[3], g[1] = i[1] / i[3], g[0] *= b[2] * 0.5, g[1] *= -b[3] * 0.5, g[0] += b[2] * 0.5, g[1] += b[3] * 0.5, g[2] = 0) : (g[0] = i[0], g[1] = i[1], g[2] = i[2]); | |
| return g | |
| }, | |
| pe: function(a, b, c, d, g) { | |
| var h = $(), | |
| g = g || ea(); | |
| Ba(d, c, h); | |
| var i; | |
| i || (i = h); | |
| var c = h[0], | |
| d = h[1], | |
| j = h[2], | |
| l = h[3], | |
| n = h[4], | |
| p = h[5], | |
| s = h[6], | |
| x = h[7], | |
| z = h[8], | |
| y = h[9], | |
| F = h[10], | |
| t = h[11], | |
| q = h[12], | |
| w = h[13], | |
| r = h[14], | |
| u = h[15], | |
| A = c * p - d * n, | |
| D = c * s - j * n, | |
| m = c * x - l * n, | |
| E = d * s - j * p, | |
| G = d * x - l * p, | |
| I = j * x - l * s, | |
| K = z * w - y * q, | |
| M = z * r - F * q, | |
| o = z * u - t * q, | |
| J = y * r - F * w, | |
| L = y * u - t * w, | |
| B = F * u - t * r, | |
| C = 1 / (A * B - D * L + m * J + E * o - G * M + I * K); | |
| i[0] = (p * B - s * L + x * J) * C; | |
| i[1] = ( - d * B + j * L - l * J) * C; | |
| i[2] = (w * I - r * G + u * E) * C; | |
| i[3] = ( - y * I + F * G - t * E) * C; | |
| i[4] = ( - n * B + s * o - x * M) * C; | |
| i[5] = (c * B - j * o + l * M) * C; | |
| i[6] = ( - q * I + r * m - u * D) * C; | |
| i[7] = (z * I - F * m + t * D) * C; | |
| i[8] = (n * L - p * o + x * K) * C; | |
| i[9] = ( - c * L + d * o - l * K) * C; | |
| i[10] = (q * G - w * m + u * A) * C; | |
| i[11] = | |
| ( - z * G + y * m - t * A) * C; | |
| i[12] = ( - n * J + p * M - s * K) * C; | |
| i[13] = (c * J - d * M + j * K) * C; | |
| i[14] = ( - q * E + w * D - r * A) * C; | |
| i[15] = (z * E - y * D + F * A) * C; | |
| g[0] = +((a[0] - b[0]) / b[2] * 2 - 1); | |
| g[1] = -((a[1] - b[1]) / b[3] * 2 - 1); | |
| g[2] = 2 * a[2] - 1; | |
| g[3] = 1; | |
| Ca(h, g); | |
| g[3] = 1 / g[3]; | |
| g[0] *= g[3]; | |
| g[1] *= g[3]; | |
| g[2] *= g[3]; | |
| return g | |
| }, | |
| Xe: function(a, b, c, d, g) { | |
| this.pe(a, c, d, g, a); | |
| this.pe(b, c, d, g, b); | |
| var g = za(b, a), | |
| h; | |
| h || (h = g); | |
| var c = g[0], | |
| d = g[1], | |
| g = g[2], | |
| i = Math.sqrt(c * c + d * d + g * g); | |
| i ? i == 1 ? (h[0] = c, h[1] = d, h[2] = g) : (i = 1 / i, h[0] = c * i, h[1] = d * i, h[2] = g * i) : (h[0] = 0, h[1] = 0, h[2] = 0); | |
| return { | |
| position: a, | |
| Bg: b, | |
| direction: h | |
| } | |
| }, | |
| tf: function(a, b, c, d, g) { | |
| var h = Y(), | |
| i = Y(), | |
| j = Y(), | |
| l = Y(), | |
| n = Y(), | |
| p = d.position, | |
| d = d.direction; | |
| "undefined" === typeof g && (g = Y()); | |
| za(b, a, h); | |
| za(c, a, i); | |
| ka(h, i, j); | |
| if (j[0] === 0 && j[1] === 0 && j[2] === 0) return - 1; | |
| za(p, a, n); | |
| b = -oa(j, n); | |
| j = +oa(j, d); | |
| if (Math.abs(j) < 1.0E-4) return b === 0 ? 2: 0; | |
| j = b / j; | |
| if (j < 0) return 0; | |
| ra(p, va(d, j), g); | |
| p = oa(h, h); | |
| d = oa(h, i); | |
| j = oa(i, i); | |
| za(g, a, l); | |
| a = oa(l, h); | |
| i = oa(l, i); | |
| l = d * d - p * j; | |
| g = (d * i - j * a) / l; | |
| if (g < 0 || g > 1) return 0; | |
| i = (d * a - p * i) / l; | |
| return i < 0 || g + i > 1 ? 0: 1 | |
| }, | |
| xc: function(a, b, c) { | |
| if (! (c < 0) && !(c > 1)) if (c < 0.166666667) return a + | |
| (b - a) * 6 * c; | |
| else if (c < 0.5) return b; | |
| else if (c < 0.666666667) return a + (b - a) * (2 / 3 - c) * 6; | |
| return a | |
| }, | |
| Rg: function(a, b, c) { | |
| a *= 0.00392156863; | |
| b *= 0.00392156863; | |
| c *= 0.00392156863; | |
| var d = Math.max(a, b, c), | |
| g = Math.min(a, b, c), | |
| h, | |
| i, | |
| j = (d + g) * 0.5; | |
| d === g ? i = g = 0: (h = d - g, g = j > 0.5 ? h / (2 - d - g) : h / (d + g), d === a ? i = (b - c) / h + (b < c ? 6: 0) : d === b ? i = (c - a) / h + 2: d === c && (i = (a - b) / h + 4), i /= 6); | |
| return [i, g, j] | |
| }, | |
| xg: function(a, b, c) { | |
| var d, | |
| g; | |
| b === 0 ? c = b = a = c: (d = c < 0.5 ? c * (1 + b) : c + b - c * b, g = 2 * c - d, c = this.xc(g, d, a + 0.333333333), b = this.xc(g, d, a), a = this.xc(g, d, a - 0.333333333)); | |
| return [c * | |
| 255, b * 255, a * 255] | |
| }, | |
| Qf: function(a, b, c) { | |
| a *= 0.00392156863; | |
| b *= 0.00392156863; | |
| c *= 0.00392156863; | |
| var d = Math.max(a, b, c), | |
| g = Math.min(a, b, c), | |
| h, | |
| i; | |
| h = d - g; | |
| d === g ? i = 0: (d === a ? i = (b - c) / h + (b < c ? 6: 0) : d === b ? i = (c - a) / h + 2: d === c && (i = (a - b) / h + 4), i /= 6); | |
| return [i, d === 0 ? 0: h / d, d] | |
| }, | |
| nf: function(a, b, c) { | |
| var d, | |
| g, | |
| h, | |
| i = Math.floor(a * 6), | |
| j = a * 6 - i, | |
| a = c * (1 - b), | |
| l = c * (1 - j * b), | |
| b = c * (1 - (1 - j) * b); | |
| i %= 6; | |
| i === 0 ? (d = c, g = b, h = a) : i === 1 ? (d = l, g = c, h = a) : i === 2 ? (d = a, g = c, h = b) : i === 3 ? (d = a, g = l, h = c) : i === 4 ? (d = b, g = a, h = c) : i === 5 && (d = c, g = a, h = l); | |
| return [d * 255, g * 255, h * 255] | |
| }, | |
| xa: function(a) { | |
| var a = | |
| a.charAt(0) === "#" ? a.substring(1) : a, | |
| b, | |
| c, | |
| d, | |
| g; | |
| if ("undefined" !== typeof this[a]) return this[a]; | |
| else b = window.parseInt(a, 16); | |
| return a.length === 3 ? this[a] = [((b & 3840) >> 8) * 0.062745098, ((b & 240) >> 4) * 0.062745098, (b & 15) * 0.062745098, 1] : a.length === 4 ? this[a] = [((b & 61440) >> 12) * 0.062745098, ((b & 3840) >> 8) * 0.062745098, ((b & 240) >> 4) * 0.062745098, (b & 15) * 0.062745098] : a.length === 6 ? this[a] = [((b & 16711680) >> 16) * 0.00392156863, ((b & 65280) >> 8) * 0.00392156863, (b & 255) * 0.00392156863, 1] : a.length === 5 ? this[a] = [((b & 983040) >> 12) / 255, ((b & 61440) >> | |
| 8) / 255, ((b & 3840) >> 4) / 255, (b & 240) / 255] : a.length === 8 ? (b = parseInt(a.substring(0, 2), 16) * 0.00392156863, c = parseInt(a.substring(2, 4), 16) * 0.00392156863, d = parseInt(a.substring(4, 6), 16) * 0.00392156863, g = parseInt(a.substring(6, 8), 16) * 0.00392156863, this[a] = [b, c, d, g]) : a.match("^rgba") == "rgba" ? (b = a.substring(5, a.length - 1).split(","), b[0] *= 0.00392156863, b[1] *= 0.00392156863, b[2] *= 0.00392156863, b[3] *= 0.00392156863, this[a] = b) : a.match("^rgb") == "rgb" ? (b = a.substring(4, a.length - 1).split(","), b[0] *= 0.00392156863, b[1] *= 0.00392156863, | |
| b[2] *= 0.00392156863, b[3] = 1, this[a] = b) : this[a] = [0, 0, 0, 1] | |
| } | |
| }; | |
| S.q.u("Tilt.Math", S.h); | |
| S = S || {}; | |
| S.nc = { | |
| gd: k, | |
| next: function() { | |
| return this.gd() | |
| }, | |
| ke: function() { | |
| var a = 0, | |
| b = 0, | |
| c = 0, | |
| d = 1, | |
| g, | |
| h; | |
| if (arguments.length === 0) return this.ke( + new Date); | |
| else { | |
| a = this.Sa(" "); | |
| b = this.Sa(" "); | |
| c = this.Sa(" "); | |
| for (g = 0; g < arguments.length; g++) a -= this.Sa(arguments[g]), | |
| a < 0 && (a += 1), | |
| b -= this.Sa(arguments[g]), | |
| b < 0 && (b += 1), | |
| c -= this.Sa(arguments[g]), | |
| c < 0 && (c += 1); | |
| h = function() { | |
| var g = 2091639 * a + d * 2.3283064365386963E-10; | |
| a = b; | |
| b = c; | |
| return c = g - (d = g | 0) | |
| }; | |
| h.Xg = function() { | |
| return h() * 4294967296 | |
| }; | |
| h.ug = function() { | |
| return h() + (h() * 2097152 | 0) * 1.1102230246251565E-16 | |
| }; | |
| return this.gd = h | |
| } | |
| }, | |
| Sa: function(a) { | |
| var b, | |
| c, | |
| d = 4022871197, | |
| a = a.toString(); | |
| for (b = 0; b < a.length; b++) d += a.charCodeAt(b), | |
| c = 0.02519603282416938 * d, | |
| d = c >>> 0, | |
| c -= d, | |
| c *= d, | |
| d = c >>> 0, | |
| c -= d, | |
| d += c * 4294967296; | |
| return (d >>> 0) * 2.3283064365386963E-10 | |
| } | |
| }; | |
| S.nc.ke(0); | |
| S = S || {}; | |
| S.Gd = { | |
| trim: function(a) { | |
| return a.replace(/^\s+|\s+$/g, "") | |
| }, | |
| Cg: function(a) { | |
| return a.replace(/^\s+/, "") | |
| }, | |
| Sg: function(a) { | |
| return a.replace(/\s+$/, "") | |
| } | |
| }; | |
| S.q.u("Tilt.String", S.Gd); | |
| S = S || {}; | |
| S.qc = { | |
| qf: function(a) { | |
| var b, | |
| c, | |
| d, | |
| g; | |
| b = S.G.Ra(); | |
| c = S.G.Ra(); | |
| b = S.oc.prototype.Jd(b); | |
| d = b.getParameter(b.MAX_TEXTURE_SIZE); | |
| g = S.G.ff(a); | |
| b = S.h.M(g.width, 0, d); | |
| g = S.h.M(g.height, 0, d); | |
| c.width = b; | |
| c.height = g; | |
| d = c.getContext("2d"); | |
| d.fillStyle = "#fff"; | |
| d.fillRect(0, 0, c.width, c.height); | |
| d.drawWindow(a, 0, 0, b, g, "#fff"); | |
| return c | |
| }, | |
| he: function(a, b, c, d) { | |
| var g = c.left, | |
| h = c.top, | |
| i = c.width, | |
| j = c.height; | |
| if (d) return c = b.getContext("2d"), | |
| c.translate(g, h), | |
| c.drawWindow(a, g, h, i, j, "#fff"), | |
| c.translate( - g, -h), | |
| b; | |
| else if (this.la) return this.la.width = | |
| i, | |
| this.la.height = j, | |
| c = this.la.getContext("2d"), | |
| c.drawWindow(a, g, h, i, j, "#fff"), | |
| this.la; | |
| else if ("undefined" === typeof this.la) return this.la = S.G.Ra(), | |
| this.he(a, b, c); | |
| else this.la = k, | |
| delete this.la; | |
| return k | |
| } | |
| }; | |
| S.q.u("Tilt.WebGL", S.qc); | |
| S = S || {}; | |
| S.Pe = { | |
| Mf: function(a, b, c) { | |
| var d = new XMLHttpRequest; | |
| d.open("GET", a, !0); | |
| d.send(k); | |
| d.onreadystatechange = function() { | |
| d.readyState === 4 && "function" === typeof b && b(d, c) | |
| } | |
| }, | |
| Qg: function(a, b, c) { | |
| function d(d, i) { | |
| g[i] = d; | |
| h++; | |
| h === a.length && "function" === typeof b && b(g, c) | |
| } | |
| var g = [], | |
| h = 0, | |
| i, | |
| j; | |
| for (i = 0, j = a.length; i < j; i++) this.Mf(a[i], d, i) | |
| } | |
| }; | |
| S.q.u("Tilt.Xhr", S.Pe); | |
| TiltChrome = TiltChrome || {}; | |
| TiltChrome.ua = {}; | |
| TiltChrome.ua.c = { | |
| Da: { | |
| ub: { | |
| sb: { | |
| value: 50 | |
| }, | |
| vb: { | |
| value: 0 | |
| }, | |
| mb: { | |
| value: 100 | |
| }, | |
| kb: { | |
| value: 80 | |
| }, | |
| wb: { | |
| value: 100 | |
| }, | |
| Wb: { | |
| outline: [0, 0, 0, 0.25] | |
| } | |
| }, | |
| zf: { | |
| sb: { | |
| value: 50 | |
| }, | |
| vb: { | |
| value: 0 | |
| }, | |
| mb: { | |
| value: 100 | |
| }, | |
| kb: { | |
| value: 80 | |
| }, | |
| wb: { | |
| value: 100 | |
| }, | |
| Wb: { | |
| outline: [0, 0, 0, 0.25] | |
| } | |
| }, | |
| ng: { | |
| sb: { | |
| value: 57.5 | |
| }, | |
| vb: { | |
| value: 50 | |
| }, | |
| mb: { | |
| value: 100 | |
| }, | |
| kb: { | |
| value: 7.5 | |
| }, | |
| wb: { | |
| value: 100 | |
| }, | |
| Wb: { | |
| outline: [1, 1, 1, 0.7] | |
| } | |
| } | |
| }, | |
| g: { | |
| fg: { | |
| stroke: "#fff3" | |
| }, | |
| html: { | |
| fill: "#FFF" | |
| }, | |
| "head/body": { | |
| fill: "#E667AF" | |
| }, | |
| title: { | |
| fill: "#CD0074" | |
| }, | |
| script: { | |
| fill: "#A64B00" | |
| }, | |
| style: { | |
| fill: "#FF9640" | |
| }, | |
| div: { | |
| fill: "#5DC8CD" | |
| }, | |
| span: { | |
| fill: "#67E46F" | |
| }, | |
| table: { | |
| fill: "#FF0700" | |
| }, | |
| tr: { | |
| fill: "#FF4540" | |
| }, | |
| td: { | |
| fill: "#FF7673" | |
| }, | |
| ul: { | |
| fill: "#4671D5" | |
| }, | |
| li: { | |
| fill: "#6C8CD5" | |
| }, | |
| p: { | |
| fill: "#888" | |
| }, | |
| a: { | |
| fill: "#123EAB" | |
| }, | |
| img: { | |
| fill: "#FFB473" | |
| }, | |
| iframe: { | |
| fill: "#85004B" | |
| }, | |
| other: { | |
| fill: "#444" | |
| } | |
| } | |
| }; | |
| TiltChrome = TiltChrome || {}; | |
| TiltChrome.zd = {}; | |
| TiltChrome.zd.Oe = function() { | |
| function a(a) { | |
| a = a.keyCode || a.which; | |
| if (a === 27)"open" === TiltChrome.BrowserOverlay.D.C.state ? TiltChrome.BrowserOverlay.D.C.hidePopup() : (TiltChrome.BrowserOverlay.d(!0, !0), TiltChrome.BrowserOverlay.href = k); | |
| j.Dc(a); | |
| l.Dc(a) | |
| } | |
| function b(a) { | |
| a = a.keyCode || a.which; | |
| "open" !== TiltChrome.BrowserOverlay.D.C.state && window.content.document.activeElement instanceof HTMLBodyElement && (j.Cc(a), l.Cc(a)) | |
| } | |
| function c(a) { | |
| a.preventDefault(); | |
| a.stopPropagation(); | |
| j.Jc(a.detail); | |
| j.$ || l.Jc(a.detail) | |
| } | |
| function d(a) { | |
| a.preventDefault(); | |
| a.stopPropagation(); | |
| j.Ic(); | |
| l.Ic() | |
| } | |
| function g(a) { | |
| a.preventDefault(); | |
| a.stopPropagation(); | |
| var b = a.clientX - a.target.offsetLeft, | |
| a = a.clientY - a.target.offsetTop; | |
| j.Hc(b, a); | |
| l.Hc(b, a) | |
| } | |
| function h(a) { | |
| a.preventDefault(); | |
| a.stopPropagation(); | |
| var b = a.which, | |
| c = a.clientX - a.target.offsetLeft, | |
| a = a.clientY - a.target.offsetTop; | |
| j.Kc(c, a, b); | |
| l.Kc(c, a, b) | |
| } | |
| function i(a) { | |
| a.preventDefault(); | |
| a.stopPropagation(); | |
| n = a.clientX - a.target.offsetLeft; | |
| p = a.clientY - a.target.offsetTop; | |
| j.Gc(n, p, a.which); | |
| j.$ ? l.stop() : l.Gc(n, p, a.which) | |
| } | |
| var j = S.c, | |
| l = k, | |
| n = 0, | |
| p = 0; | |
| this.init = function(j) { | |
| l = new S.xd(j.width, j.height); | |
| this.stop = l.stop.bind(l); | |
| this.translate = l.translate.bind(l); | |
| this.rotate = l.rotate.bind(l); | |
| this.zoom = l.zoom.bind(l); | |
| this.reset = l.reset.bind(l); | |
| this.pa = l.pa.bind(l); | |
| j.addEventListener("mousedown", i, !1); | |
| j.addEventListener("mouseup", h, !1); | |
| j.addEventListener("click", s, !1); | |
| j.addEventListener("dblclick", x, !1); | |
| j.addEventListener("mousemove", g, !1); | |
| j.addEventListener("mouseout", d, !1); | |
| j.addEventListener("MozMousePixelScroll", c, !1); | |
| window.addEventListener("keydown", | |
| b, !1); | |
| window.addEventListener("keyup", a, !1) | |
| }; | |
| this.update = function(a) { | |
| var b = this.n, | |
| a = l.loop(a); | |
| b.Vf(a.rotation); | |
| b.Xf(a.ea) | |
| }; | |
| var s = function(a) { | |
| a.preventDefault(); | |
| a.stopPropagation(); | |
| var b = a.which, | |
| c = a.clientX - a.target.offsetLeft, | |
| a = a.clientY - a.target.offsetTop; | |
| Math.abs(n - c) < 2 && Math.abs(p - a) < 2 && (j.click(c, a, b), j.$ || this.n.Cf(c, a)) | |
| }.bind(this), | |
| x = function(a) { | |
| a.preventDefault(); | |
| a.stopPropagation(); | |
| var b = a.clientX - a.target.offsetLeft, | |
| a = a.clientY - a.target.offsetTop; | |
| Math.abs(n - b) < 2 && Math.abs(p - a) < 2 && (j.af(b, | |
| a), j.$ || this.n.Bf(b, a)) | |
| }.bind(this); | |
| this.d = function(z) { | |
| j = this.n = k; | |
| i !== k && (z.removeEventListener("mousedown", i, !1), i = k); | |
| h !== k && (z.removeEventListener("mouseup", h, !1), h = k); | |
| s !== k && (z.removeEventListener("click", s, !1), s = k); | |
| x !== k && (z.removeEventListener("dblclick", x, !1), x = k); | |
| g !== k && (z.removeEventListener("mousemove", g, !1), g = k); | |
| d !== k && (z.removeEventListener("mouseout", d, !1), d = k); | |
| c !== k && (z.removeEventListener("MozMousePixelScroll", c, !1), c = k); | |
| b !== k && (window.removeEventListener("keydown", b, !1), b = k); | |
| a !== k && | |
| (window.removeEventListener("keyup", a, !1), a = k); | |
| l !== k && (l.d(), l = k); | |
| p = n = k; | |
| S.w(this) | |
| }; | |
| S.q.u("TiltChrome.Controller.MouseAndKeyboard", this) | |
| }; | |
| TiltChrome = TiltChrome || {}; | |
| TiltChrome.c = {}; | |
| TiltChrome.c.Ne = function() { | |
| var a = S.c, | |
| b = TiltChrome.ua.c, | |
| c = k, | |
| d = k, | |
| g = k, | |
| h = k, | |
| i = k, | |
| j = k, | |
| l = k, | |
| n = k, | |
| p = k, | |
| s = k, | |
| x = k, | |
| z = k, | |
| y = k, | |
| F = k, | |
| t = k, | |
| q = k, | |
| w = k, | |
| r = k, | |
| u = k, | |
| A = k, | |
| D = k, | |
| m = k, | |
| E = k, | |
| G = k, | |
| I = k, | |
| K = k, | |
| M = k, | |
| o = k, | |
| J = k, | |
| L = k, | |
| B = k, | |
| C = k, | |
| X = k, | |
| W = k, | |
| Q = k, | |
| T = k, | |
| ba = k, | |
| U = k, | |
| da = k, | |
| fa = k, | |
| ja = k, | |
| Z = k, | |
| O = k, | |
| H = k, | |
| v = k, | |
| ha = k, | |
| ia = k, | |
| na = k, | |
| ta = k, | |
| ua = k; | |
| this.init = function(V) { | |
| j = new S.Ha("chrome://tilt/skin/tilt-ui.png", { | |
| Xd: "nearest", | |
| Ud: "nearest", | |
| onload: function() { | |
| this.n.v() | |
| }.bind(this) | |
| }); | |
| c = new S.na; | |
| d = new S.na; | |
| l = new S.z(j, [0, 768, 256, 256], { | |
| width: V.width, | |
| height: V.height, | |
| oa: !0, | |
| disabled: !0 | |
| }); | |
| K = new S.f(new S.z(j, [935, 120, 42, 38]), { | |
| x: V.width - 50, | |
| y: -5, | |
| padding: [0, 0, 0, 5], | |
| onclick: function() { | |
| TiltChrome.BrowserOverlay.d(!0, !0); | |
| TiltChrome.BrowserOverlay.href = k | |
| } | |
| }); | |
| M = new S.f(new S.z(j, [935, 80, 46, 38]), { | |
| x: V.width - 150, | |
| y: -5, | |
| padding: [0, 0, 0, 5], | |
| onclick: function() { | |
| var b = V.width * 0.5 + 197, | |
| c = V.height * 0.5 - 218; | |
| ta.K(V.width * 0.5 - 305, V.height * 0.5 - 305); | |
| ua.K(b, c); | |
| a.Ef(g) | |
| }.bind(this) | |
| }); | |
| o = new S.f(new S.z(j, [935, 40, 61, 38]), { | |
| x: V.width - 215, | |
| y: -5, | |
| padding: [0, 0, 0, 5], | |
| onclick: function() { | |
| var a = S.fa.get("folderPicker.string"), | |
| b = | |
| S.fa.get("webpageFilename.string"); | |
| if (a = S.va.bg(a, "folder")) a.reveal(), | |
| this.n.Df(a.path, b) | |
| }.bind(this) | |
| }); | |
| J = new S.f(new S.z(j, [935, 0, 66, 38]), { | |
| x: V.width - 285, | |
| y: -5, | |
| padding: [0, 0, 0, 5], | |
| i: !0, | |
| onclick: function() { | |
| window.open("chrome://tilt/content/TiltChromeOptions.xul", "Options", "chrome, modal, centerscreen, width=410, height=325") | |
| }.bind(this) | |
| }); | |
| B = new S.f(new S.z(j, [935, 200, 48, 38]), { | |
| x: V.width - 337, | |
| y: -5, | |
| padding: [0, 0, 0, 5], | |
| i: !0, | |
| onclick: function() { | |
| this.n.le() | |
| }.bind(this) | |
| }); | |
| C = new S.f(new S.z(j, [935, 160, 36, 38]), { | |
| x: V.width - | |
| 377, | |
| y: -5, | |
| padding: [0, 0, 0, 5], | |
| i: !0, | |
| onclick: function() { | |
| this.n.Sf() | |
| }.bind(this) | |
| }); | |
| L = new S.f(new S.z(j, [935, 240, 84, 38]), { | |
| x: V.width - 465, | |
| y: -5, | |
| padding: [0, 0, 0, 5], | |
| i: !0, | |
| onclick: function() { | |
| this.n.Zb() | |
| }.bind(this) | |
| }); | |
| X = new S.f(new S.z(j, [0, 147, 42, 42]), { | |
| x: 0, | |
| y: -5, | |
| padding: [6, 6, 6, 6], | |
| onclick: function() { | |
| window.clearInterval(this.L); | |
| this.Zc = 0; | |
| this.L = window.setInterval(function() { | |
| this.Zc++; | |
| this.ga.translate(i.view.i ? -5: 5, 0); | |
| this.Zc >= 20 && window.clearInterval(this.L) | |
| }.bind(this), 1E3 / 60); | |
| d.i ^= 1; | |
| i.view.i ^= 1; | |
| if (!g.i) g.i = !0; | |
| if (!h.i) h.i = !0 | |
| }.bind(this) | |
| }); | |
| W = new S.z(j, [0, 0, 145, 145], { | |
| x: 0, | |
| y: 0 | |
| }); | |
| Q = new S.f(k, { | |
| x: 50, | |
| y: 4, | |
| width: 45, | |
| height: 30, | |
| onmousedown: function() { | |
| window.clearInterval(this.L); | |
| this.L = window.setInterval(function() { | |
| this.ga.translate(0, -5); | |
| a.R || window.clearInterval(this.L) | |
| }.bind(this), 1E3 / 60) | |
| }.bind(this) | |
| }); | |
| T = new S.f(k, { | |
| x: 50, | |
| y: 110, | |
| width: 45, | |
| height: 30, | |
| onmousedown: function() { | |
| window.clearInterval(this.L); | |
| this.L = window.setInterval(function() { | |
| this.ga.translate(0, 5); | |
| a.R || window.clearInterval(this.L) | |
| }.bind(this), 1E3 / 60) | |
| }.bind(this) | |
| }); | |
| ba = new S.f(k, { | |
| x: 4, | |
| y: 50, | |
| width: 30, | |
| height: 45, | |
| onmousedown: function() { | |
| window.clearInterval(this.L); | |
| this.L = window.setInterval(function() { | |
| this.ga.translate( - 5, 0); | |
| a.R || window.clearInterval(this.L) | |
| }.bind(this), 1E3 / 60) | |
| }.bind(this) | |
| }); | |
| U = new S.f(k, { | |
| x: 110, | |
| y: 50, | |
| width: 30, | |
| height: 45, | |
| onmousedown: function() { | |
| window.clearInterval(this.L); | |
| this.L = window.setInterval(function() { | |
| this.ga.translate(5, 0); | |
| a.R || window.clearInterval(this.L) | |
| }.bind(this), 1E3 / 60) | |
| }.bind(this) | |
| }); | |
| da = new S.f(new S.z(j, [0, 190, 42, 42]), { | |
| x: 50, | |
| y: 135, | |
| padding: [6, | |
| 6, 6, 6], | |
| onclick: function() { | |
| this.ga.reset(0.95) | |
| }.bind(this) | |
| }); | |
| fa = new S.f(new S.z(j, [0, 234, 42, 42]), { | |
| x: 90, | |
| y: da.s(), | |
| padding: [6, 6, 6, 6], | |
| onclick: function() { | |
| this.ga.zoom(200) | |
| }.bind(this) | |
| }); | |
| ja = new S.f(new S.z(j, [0, 278, 42, 42]), { | |
| x: 10, | |
| y: da.s(), | |
| padding: [6, 6, 6, 6], | |
| onclick: function() { | |
| this.ga.zoom( - 200) | |
| }.bind(this) | |
| }); | |
| n = new S.z(j, [1, 365, 88, 353], { | |
| x: 0, | |
| y: 292, | |
| disabled: !0 | |
| }); | |
| i = new S.Fd({ | |
| x: 85, | |
| y: 300, | |
| width: 130, | |
| height: V.height - 310, | |
| background: "#0001", | |
| je: [0, Math.MAX_VALUE], | |
| top: new S.z(j, [506, 69, 33, 30], { | |
| padding: [2, 2, 2, 4] | |
| }), | |
| bottom: new S.z(j, | |
| [506, 102, 33, 30], { | |
| padding: [2, 2, 2, 4] | |
| }), | |
| reset: new S.z(j, [506, 134, 33, 30], { | |
| padding: [2, 4, 2, 2] | |
| }) | |
| }); | |
| p = new S.f(k, { | |
| x: 5, | |
| y: 301, | |
| width: 14, | |
| height: 14, | |
| fill: b.g.html.fill, | |
| onclick: function() { | |
| P(b.g.html, p) | |
| } | |
| }); | |
| s = new S.f(k, { | |
| x: 5, | |
| y: p.s() + 20, | |
| width: 14, | |
| height: 14, | |
| fill: b.g["head/body"].fill, | |
| onclick: function() { | |
| P(b.g["head/body"], s) | |
| } | |
| }); | |
| x = new S.f(k, { | |
| x: 5, | |
| y: s.s() + 20, | |
| width: 14, | |
| height: 14, | |
| fill: b.g.title.fill, | |
| onclick: function() { | |
| P(b.g.title, x) | |
| } | |
| }); | |
| z = new S.f(k, { | |
| x: 5, | |
| y: x.s() + 20, | |
| width: 14, | |
| height: 14, | |
| fill: b.g.style.fill, | |
| onclick: function() { | |
| P(b.g.style, | |
| z) | |
| } | |
| }); | |
| y = new S.f(k, { | |
| x: 5, | |
| y: z.s() + 20, | |
| width: 14, | |
| height: 14, | |
| fill: b.g.script.fill, | |
| onclick: function() { | |
| P(b.g.script, y) | |
| } | |
| }); | |
| F = new S.f(k, { | |
| x: 5, | |
| y: y.s() + 20, | |
| width: 14, | |
| height: 14, | |
| fill: b.g.div.fill, | |
| onclick: function() { | |
| P(b.g.div, F) | |
| } | |
| }); | |
| t = new S.f(k, { | |
| x: 5, | |
| y: F.s() + 20, | |
| width: 14, | |
| height: 14, | |
| fill: b.g.span.fill, | |
| onclick: function() { | |
| P(b.g.span, t) | |
| } | |
| }); | |
| q = new S.f(k, { | |
| x: 5, | |
| y: t.s() + 20, | |
| width: 14, | |
| height: 14, | |
| fill: b.g.table.fill, | |
| onclick: function() { | |
| P(b.g.table, q) | |
| } | |
| }); | |
| w = new S.f(k, { | |
| x: 5, | |
| y: q.s() + 20, | |
| width: 14, | |
| height: 14, | |
| fill: b.g.tr.fill, | |
| onclick: function() { | |
| P(b.g.tr, | |
| w) | |
| } | |
| }); | |
| r = new S.f(k, { | |
| x: 5, | |
| y: w.s() + 20, | |
| width: 14, | |
| height: 14, | |
| fill: b.g.td.fill, | |
| onclick: function() { | |
| P(b.g.td, r) | |
| } | |
| }); | |
| u = new S.f(k, { | |
| x: 5, | |
| y: r.s() + 20, | |
| width: 14, | |
| height: 14, | |
| fill: b.g.ul.fill, | |
| onclick: function() { | |
| P(b.g.ul, u) | |
| } | |
| }); | |
| A = new S.f(k, { | |
| x: 5, | |
| y: u.s() + 20, | |
| width: 14, | |
| height: 14, | |
| fill: b.g.li.fill, | |
| onclick: function() { | |
| P(b.g.li, A) | |
| } | |
| }); | |
| D = new S.f(k, { | |
| x: 5, | |
| y: A.s() + 20, | |
| width: 14, | |
| height: 14, | |
| fill: b.g.p.fill, | |
| onclick: function() { | |
| P(b.g.p, D) | |
| } | |
| }); | |
| m = new S.f(k, { | |
| x: 5, | |
| y: D.s() + 20, | |
| width: 14, | |
| height: 14, | |
| fill: b.g.a.fill, | |
| onclick: function() { | |
| P(b.g.a, m) | |
| } | |
| }); | |
| E = new S.f(k, | |
| { | |
| x: 5, | |
| y: m.s() + 20, | |
| width: 14, | |
| height: 14, | |
| fill: b.g.img.fill, | |
| onclick: function() { | |
| P(b.g.img, E) | |
| } | |
| }); | |
| G = new S.f(k, { | |
| x: 5, | |
| y: E.s() + 20, | |
| width: 14, | |
| height: 14, | |
| fill: b.g.iframe.fill, | |
| onclick: function() { | |
| P(b.g.iframe, G) | |
| } | |
| }); | |
| I = new S.f(k, { | |
| x: 5, | |
| y: G.s() + 20, | |
| width: 14, | |
| height: 14, | |
| fill: b.g.other.fill, | |
| onclick: function() { | |
| P(b.g.other, I) | |
| } | |
| }); | |
| var P = function(a, b) { | |
| this.ue = a; | |
| this.te = b; | |
| var c = S.h.xa(a.fill), | |
| c = S.h.Qf(c[0] * 255, c[1] * 255, c[2] * 255); | |
| TiltChrome.BrowserOverlay.I.refresh(c[0] * 360, c[1] * 100, c[2] * 100); | |
| TiltChrome.BrowserOverlay.I.C.openPopup(k, | |
| k, 200 + b.W(), 80 + b.s()) | |
| }.bind(this), | |
| Ga = new S.z(j, [438, 67, 66, 66]), | |
| Da = new S.z(j, [438, 0, 66, 66]); | |
| Z = new S.f(Da, { | |
| x: 39, | |
| y: 170, | |
| padding: [12, 10, 12, 12], | |
| onclick: function() { | |
| if (Z.type !== 1) { | |
| Z.type = 1; | |
| Z.ne(Ga); | |
| var a = b.Da.ng | |
| } else Z.type = 0, | |
| Z.ne(Da), | |
| a = b.Da.zf; | |
| H.O(a.sb.value); | |
| v.O(a.vb.value); | |
| ha.O(a.mb.value); | |
| ia.O(a.kb.value); | |
| na.O(a.wb.value); | |
| la(); | |
| this.n.me(a.Wb.outline) | |
| }.bind(this) | |
| }); | |
| O = new S.f(new S.z(j, [505, 0, 66, 66]), { | |
| x: 39, | |
| y: 230, | |
| padding: [12, 10, 14, 16], | |
| onclick: function() { | |
| h.i ^= 1; | |
| this.n.v() | |
| }.bind(this) | |
| }); | |
| var ga = new S.z(j, [574, | |
| 131, 29, 29], { | |
| padding: [8, 8, 8, 8] | |
| }); | |
| H = new S.Ga(ga, { | |
| x: 64, | |
| y: 12, | |
| size: 120, | |
| value: b.Da.ub.sb.value, | |
| onmousedown: function() { | |
| la() | |
| } | |
| }); | |
| v = new S.Ga(ga, { | |
| x: H.W(), | |
| y: H.s() + 19, | |
| size: 120, | |
| value: b.Da.ub.vb.value, | |
| onmousedown: function() { | |
| la() | |
| } | |
| }); | |
| ha = new S.Ga(ga, { | |
| x: H.W(), | |
| y: v.s() + 18, | |
| size: 120, | |
| value: b.Da.ub.mb.value, | |
| onmousedown: function() { | |
| la() | |
| } | |
| }); | |
| ia = new S.Ga(ga, { | |
| x: H.W(), | |
| y: ha.s() + 18, | |
| size: 120, | |
| value: b.Da.ub.kb.value, | |
| onmousedown: function() { | |
| la() | |
| } | |
| }); | |
| na = new S.Ga(ga, { | |
| x: H.W(), | |
| y: ia.s() + 18, | |
| size: 120, | |
| value: b.Da.ub.wb.value, | |
| onmousedown: function() { | |
| la() | |
| } | |
| }); | |
| var la = function() { | |
| window.clearInterval(this.pd); | |
| this.pd = window.setInterval(function() { | |
| var b = S.h.nf(H.S * 0.01, v.S * 0.01, ha.S * 0.01), | |
| c = na.S * 0.01; | |
| b[0] /= 255; | |
| b[1] /= 255; | |
| b[2] /= 255; | |
| b[3] = ia.S * 0.01; | |
| this.n.Tf(b); | |
| this.n.Uf(c); | |
| a.R || window.clearInterval(this.pd) | |
| }.bind(this), 1E3 / 60) | |
| }.bind(this), | |
| ga = new S.z(j, [572, 1, 231, 126], { | |
| disabled: !0 | |
| }); | |
| h = new S.na({ | |
| x: 77, | |
| y: 239, | |
| i: !0, | |
| elements: [ga, H, v, ha, ia, na] | |
| }); | |
| ta = new S.z(j, [210, 180, 610, 510], { | |
| disabled: !0 | |
| }); | |
| ua = new S.f(k, { | |
| width: 30, | |
| height: 30, | |
| onclick: function() { | |
| a.$e(g) | |
| }.bind(this) | |
| }); | |
| g = | |
| new S.na({ | |
| i: !0, | |
| background: "#0107", | |
| elements: [ta, ua] | |
| }); | |
| c.push(l, K, X); | |
| d.push(M, o, J, B, C, L, da, fa, ja, W, Q, T, ba, U, Z, O, n, p, s, x, z, y, F, t, q, w, r, u, A, D, m, E, G, I) | |
| }; | |
| this.F = function() { | |
| a.F() | |
| }; | |
| this.ce = function() { | |
| B.i = !1; | |
| C.i = !1; | |
| L.i = !1 | |
| }; | |
| this.be = function() { | |
| B.i = !0; | |
| C.i = !0; | |
| L.i = !0 | |
| }; | |
| this.Ig = aa(); | |
| this.de = function() { | |
| var a = TiltChrome.BrowserOverlay.I.Pa.contentDocument.colorPicked; | |
| this.ue.fill = a; | |
| this.te.$b(a); | |
| this.Ec(); | |
| this.n.ee() | |
| }; | |
| this.Wd = function(a, c, d, g) { | |
| if (i.kd) i.kd = !1, | |
| i.view.clear(), | |
| this.Vc = 0; | |
| if ("undefined" === typeof this.Vc) this.Vc = | |
| 0; | |
| if (! ("undefined" === typeof a.localName || a.localName === k)) { | |
| var d = this.Vc++, | |
| h = 3 + c * 6, | |
| c = 3 + d * 10, | |
| j, | |
| l, | |
| C, | |
| m; | |
| C = S.h.M(a.localName.length, 4, 10); | |
| var d = S.h.M(a.id.length, 4, 10), | |
| n = S.h.M(a.className.length, 4, 10), | |
| o = h + C * 10 + 3, | |
| p = o + d * 2 + 3, | |
| h = new S.f(k, { | |
| x: h, | |
| y: c, | |
| width: C * 10, | |
| height: 7, | |
| padding: [ - 1, -1, -1, -1], | |
| stroke: b.g.fg.stroke | |
| }); | |
| C = h.W() + h.Na(); | |
| m = h.s() + h.vc() * 2; | |
| a.id && (j = new S.f(k, { | |
| x: o, | |
| y: c, | |
| width: d * 2, | |
| height: 7, | |
| padding: [ - 1, -1, -1, -1], | |
| stroke: h.lc | |
| }), C = Math.max(C, j.W() + j.Na())); | |
| a.className && (l = new S.f(k, { | |
| x: p, | |
| y: c, | |
| width: n * 2, | |
| height: 7, | |
| padding: [ - 1, | |
| -1, -1, -1], | |
| stroke: h.lc | |
| }), C = Math.max(C, l.W() + l.Na())); | |
| C > i.view.Na() && i.view.Uc(C); | |
| i.bottom = m; | |
| if (h) i.view.push(h), | |
| h.localName = a.localName, | |
| h.onclick = function() { | |
| a.localName === "img" || a.localName === "input" || a.localName === "button" || a.localName === "meta" || a.localName === "link" || a.localName === "style" || a.localName === "script" || a.localName === "noscript" ? this.n.Zb() : this.n.le(); | |
| this.n.Ua(g) | |
| }.bind(this); | |
| if (j) i.view.push(j), | |
| j.$b(h.Gb), | |
| j.localName = a.localName, | |
| j.onclick = function() { | |
| this.n.Zb(); | |
| this.n.Ua(g) | |
| }.bind(this); | |
| if (l) i.view.push(l), | |
| l.$b(h.Gb), | |
| l.localName = a.localName, | |
| l.onclick = function() { | |
| this.n.Zb(); | |
| this.n.Ua(g) | |
| }.bind(this) | |
| } | |
| }; | |
| this.Ec = function() { | |
| i.view.forEach(function(a) { | |
| a.$b((b.g[a.localName !== "head" && a.localName !== "body" ? a.localName: "head/body"] || b.g.other).fill) | |
| }); | |
| i.kd = !0 | |
| }; | |
| this.pa = function(a, b) { | |
| l.X(a, b); | |
| i.view.Tc(b - 310); | |
| K.ca(a - 50); | |
| M.ca(a - 150); | |
| o.ca(a - 215); | |
| J.ca(a - 285); | |
| B.ca(a - 337); | |
| C.ca(a - 377); | |
| L.ca(a - 465) | |
| }; | |
| this.d = function() { | |
| b = a = this.ga = this.n = k; | |
| c !== k && (c.d(), c = k); | |
| d !== k && (d.d(), d = k); | |
| g !== k && (g.d(), g = k); | |
| h !== k && | |
| (h.d(), h = k); | |
| i !== k && (i.d(), i = k); | |
| j !== k && (j.d(), j = k); | |
| l !== k && (l.d(), l = k); | |
| ua = ta = na = ia = ha = v = H = O = Z = ja = fa = da = U = ba = T = Q = W = X = C = B = L = J = o = M = K = I = G = E = m = D = r = w = q = t = F = y = z = x = s = p = n = k; | |
| S.w(this) | |
| }; | |
| S.q.u("TiltChrome.UI", this) | |
| }; | |
| TiltChrome = TiltChrome || {}; | |
| TiltChrome.Ob = function(a, b, c) { | |
| var d = new S.oc(a, { | |
| Ta: function() { | |
| TiltChrome.BrowserOverlay.d(!0, !0); | |
| TiltChrome.BrowserOverlay.href = k; | |
| S.ma.alert("Firefox", S.fa.get("initWebGL.error")); | |
| gBrowser.selectedTab = gBrowser.addTab("http://get.webgl.org/troubleshooting/") | |
| } | |
| }), | |
| g = k, | |
| h = k, | |
| i = 15, | |
| j = k, | |
| l = k, | |
| n = k, | |
| p = { | |
| index: -1, | |
| fill: "#fff", | |
| stroke: "000", | |
| Aa: 3, | |
| jg: Y(), | |
| kg: Y(), | |
| lg: Y(), | |
| mg: Y() | |
| }, | |
| s = { | |
| ea: Y(), | |
| rotation: ea() | |
| }, | |
| x = !0, | |
| z = !0, | |
| y = !0, | |
| F = function() { | |
| if (d && d.t) n = new S.Nb(TiltChrome.Z.Ob.zb, TiltChrome.Z.Ob.qb), | |
| q(), | |
| w(), | |
| A(), | |
| s.ea = [0, 0, 0], | |
| s.rotation = | |
| [0, 0, 0, 1], | |
| window.setTimeout(function() { | |
| I(); | |
| K() | |
| }.bind(this), 100) | |
| }.bind(this), | |
| t = function() { | |
| if (d && d.t) { | |
| d.loop(t); | |
| z && (z = !1, r()); | |
| y && (y = !1, u()); | |
| if (x) { | |
| x = !1; | |
| d.clear(0, 0, 0, 1); | |
| d.translate(d.width * 0.5 + 100, d.height * 0.5 - 50, -i * 30); | |
| d.translate(s.ea[0], s.ea[1], s.ea[2]); | |
| d.transform(Fa(s.rotation)); | |
| d.Hd("alpha"); | |
| d.Aa(2); | |
| j.F(); | |
| l.F(); | |
| if (p.index !== -1) { | |
| var a = j.H; | |
| d.Oc(); | |
| d.oa(!1); | |
| d.fill(p.fill); | |
| d.stroke(p.stroke); | |
| d.Aa(p.Aa); | |
| d.Jf(Ca(a, p.Je, p.jg), Ca(a, p.Ke, p.kg), Ca(a, p.Le, p.lg), Ca(a, p.Me, p.mg)) | |
| } | |
| c && "function" === typeof c.F && | |
| c.F(d.pb) | |
| } | |
| b && "function" === typeof b.update && b.update(d.pb); (d.Md + 1) % 1E3 === 0 && TiltChrome.BrowserOverlay.Xb() | |
| } | |
| }.bind(this), | |
| q = function() { | |
| if ("undefined" !== typeof b) b.n = this, | |
| "function" === typeof b.init && b.init(a) | |
| }.bind(this), | |
| w = function() { | |
| if ("undefined" !== typeof c) c.n = this, | |
| c.ga = b, | |
| S.c.v = this.v, | |
| "function" === typeof c.init && c.init(a) | |
| }.bind(this), | |
| r = function() { | |
| var a = this.Ee; | |
| if ("undefined" === typeof a || a === k) { | |
| if (g = S.qc.qf(window.content), h !== k && h.d(), h = new S.Ha(g, { | |
| fill: "white", | |
| stroke: "#aaa", | |
| Aa: 8, | |
| Ff: !0 | |
| }), j !== k) j.Xa = | |
| h | |
| } else if ("object" === typeof a) { | |
| var b = S.qc.he(window.content, g, a); | |
| b && h.ig(b, a.left, a.top) | |
| } | |
| }.bind(this), | |
| u = function() { | |
| if (d && d.t) { | |
| var a = S.nc.next.bind(S.nc), | |
| b = [], | |
| g = [], | |
| m = [], | |
| o = [], | |
| p = [], | |
| t = []; | |
| if (j !== k) j.Xa = k, | |
| j.d(); | |
| l !== k && l.d(); | |
| S.G.oe(function(j, l, n, s, q, r) { | |
| c && "function" === typeof c.Wd && c.Wd(j, l, 0, s); | |
| var n = j.localName, | |
| v = { | |
| innerHTML: j.innerHTML, | |
| attributes: j.attributes, | |
| localName: n, | |
| className: j.className, | |
| id: j.id, | |
| xb: s, | |
| style: "", | |
| index: -1 | |
| }; | |
| try { | |
| v.style = window.getComputedStyle(j) | |
| } catch(u) {} | |
| n === "head" || n === "title" || n === | |
| "meta" || n === "link" || n === "style" || n === "script" || n === "noscript" || n === "option" ? t.push(v) : (n = S.G.wc(j), j = n.width, s = n.height, j > 4 && s > 4 ? (v.index = p.length, p.push(v), v = b.length / 3, l = l * i + a() * 0.1, q = n.x - d.width / 2 + q + a() * 0.1, r = n.y - d.height / 2 + r + a() * 0.1, b.unshift(q, r, l, q + j, r, l, q + j, r + s, l, q, r + s, l, q, r + s, l - i, q + j, r + s, l - i, q + j, r + s, l, q, r + s, l, q, r, l, q + j, r, l, q + j, r, l - i, q, r, l - i), g.unshift((q + d.width * 0.5) / h.width, (r + d.height * 0.5) / h.height, (q + d.width * 0.5 + j) / h.width, (r + d.height * 0.5) / h.height, (q + d.width * 0.5 + j) / h.width, (r + d.height * | |
| 0.5 + s) / h.height, (q + d.width * 0.5) / h.width, (r + d.height * 0.5 + s) / h.height, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1), m.unshift(v + 0, v + 1, v + 2, v + 0, v + 2, v + 3, v + 4, v + 5, v + 6, v + 4, v + 6, v + 7, v + 8, v + 9, v + 10, v + 8, v + 10, v + 11, v + 10, v + 9, v + 6, v + 10, v + 6, v + 5, v + 8, v + 11, v + 4, v + 8, v + 4, v + 7), o.unshift(v + 0, v + 1, v + 1, v + 2, v + 2, v + 3, v + 3, v + 0, v + 4, v + 5, v + 5, v + 6, v + 6, v + 7, v + 7, v + 4, v + 8, v + 9, v + 9, v + 10, v + 10, v + 11, v + 11, v + 8, v + 10, v + 9, v + 9, v + 6, v + 6, v + 5, v + 5, v + 10)) : t.push(v)) | |
| }.bind(this), | |
| function() { | |
| c && "undefined" !== c.Ec && c.Ec() | |
| }.bind(this), !0); | |
| j = new S.Mb({ | |
| P: new S.U(b, | |
| 3), | |
| Wa: new S.U(g, 2), | |
| ja: new S.jb(m), | |
| ka: [1, 1, 1, 0.85], | |
| alpha: 1, | |
| Xa: h, | |
| Yc: p, | |
| mf: t, | |
| F: function() { | |
| var a = S.V, | |
| b = this.P, | |
| c = this.Wa, | |
| d = this.color, | |
| g = this.ja, | |
| h = this.ka, | |
| j = this.alpha, | |
| i = this.Xa, | |
| l = this.Qb, | |
| m = n; | |
| m.Xc(); | |
| m.Ja("vertexPosition", b); | |
| m.Ja("vertexTexCoord", c); | |
| m.Ja("vertexColor", d); | |
| m.Ia("mvMatrix", a.H); | |
| m.Ia("projMatrix", a.ba); | |
| m.rc("tint", h); | |
| m.Te("alpha", j); | |
| m.bindTexture("sampler", i); | |
| a.Ld(l, g); | |
| this.H = $(a.H); | |
| this.ba = $(a.ba) | |
| } | |
| }); | |
| l = new S.Mb({ | |
| P: j.P, | |
| ja: new S.jb(o), | |
| color: "#0004", | |
| Qb: d.LINES | |
| }); | |
| this.ee() | |
| } | |
| }.bind(this), | |
| A = function() { | |
| var a = | |
| gBrowser.tabContainer, | |
| b = gBrowser.contentWindow, | |
| c = TiltChrome.BrowserOverlay.D.C, | |
| d = TiltChrome.BrowserOverlay.I.C; | |
| window.addEventListener("MozAfterPaint", D, !1); | |
| a.addEventListener("TabClose", m, !1); | |
| a.addEventListener("TabAttrModified", m, !1); | |
| b.addEventListener("blur", E, !1); | |
| b.addEventListener("focus", G, !1); | |
| b.addEventListener("resize", I, !1); | |
| gBrowser.addEventListener("mouseover", K, !1); | |
| gBrowser.addEventListener("load", M, !0); | |
| c.addEventListener("popupshown", o, !1); | |
| c.addEventListener("popuphidden", J, !1); | |
| d.addEventListener("popupshown", | |
| L, !1); | |
| d.addEventListener("popuphidden", B, !1) | |
| }.bind(this), | |
| D = function(b) { | |
| if (!this.fd && !this.ed && !this.dd) { | |
| var b = b.boundingClientRect, | |
| c = a.offsetLeft, | |
| d = window.content.innerWidth, | |
| g = window.content.innerHeight, | |
| h = b.left, | |
| j = b.top, | |
| i = b.width, | |
| l = b.height; | |
| j > a.offsetTop && h > c && i > 4 && l > 4 ? this.Sc(b) : h <= 0 && j <= 0 && (h >= -d || j >= -g) && (i >= d || l >= g) && window.setTimeout(function() { | |
| try { ! y && !z && (this.Sc(k), this.ie()) | |
| } catch(a) {} | |
| }.bind(this), 10) | |
| } | |
| }.bind(this), | |
| m = function() { | |
| if (TiltChrome.BrowserOverlay.href !== window.content.location.href) TiltChrome.BrowserOverlay.href = | |
| k, | |
| TiltChrome.BrowserOverlay.d(!0, !0) | |
| }.bind(this), | |
| E = function() { | |
| this.dd = !0; | |
| window.setTimeout(function() { | |
| this.dd = !1 | |
| }.bind(this), 100) | |
| }.bind(this), | |
| G = function() { | |
| this.ed = !0; | |
| window.setTimeout(function() { | |
| this.ed = !1 | |
| }.bind(this), 100) | |
| }.bind(this), | |
| I = function() { | |
| this.fd = !0; | |
| this.v(); | |
| d.width = window.content.innerWidth; | |
| d.height = window.content.innerHeight; | |
| b && "function" === typeof b.pa && b.pa(d.width, d.height); | |
| c && "function" === typeof c.pa && c.pa(d.width, d.height); | |
| "open" === TiltChrome.BrowserOverlay.D.C.state && TiltChrome.BrowserOverlay.D.C.hidePopup(); | |
| "open" === TiltChrome.BrowserOverlay.I.C.state && TiltChrome.BrowserOverlay.I.C.hidePopup() | |
| }.bind(this), | |
| K = function() { | |
| window.setTimeout(function() { | |
| this.fd = !1 | |
| }.bind(this), 100); | |
| this.v(); | |
| d.width = window.content.innerWidth; | |
| d.height = window.content.innerHeight; | |
| if (a.width !== d.width || a.height !== d.height) a.width = d.width, | |
| a.height = d.height, | |
| d.t.viewport(0, 0, a.width, a.height), | |
| t() | |
| }.bind(this), | |
| M = function() { | |
| "undefined" === typeof this.ze ? this.ze = !0: window.setTimeout(function() { | |
| try { ! y && !z && (this.Sc(k), this.ie()) | |
| } catch(a) {} | |
| }.bind(this), | |
| 1E3) | |
| }.bind(this), | |
| o = function() { | |
| "function" === typeof c.ce && c.ce(); | |
| this.v() | |
| }.bind(this), | |
| J = function() { | |
| "function" === typeof c.be && c.be(); | |
| p.index = -1; | |
| TiltChrome.BrowserOverlay.Xb(); | |
| this.v() | |
| }.bind(this), | |
| L = function() { | |
| this.v() | |
| }.bind(this), | |
| B = function() { | |
| "function" === typeof c.de && c.de(); | |
| p.index = -1; | |
| TiltChrome.BrowserOverlay.Xb(); | |
| this.v() | |
| }.bind(this); | |
| this.v = function() { | |
| x = !0 | |
| }; | |
| this.Sc = function(a) { | |
| this.Ee = a; | |
| z = x = !0 | |
| }; | |
| this.ie = function() { | |
| y = x = !0 | |
| }; | |
| this.Df = function(a, b) { | |
| S.va.Rf(g, a + S.va.separator + b + ".png"); | |
| j.save(a, b) | |
| }; | |
| this.ee = | |
| function() { | |
| this.v(); | |
| for (var a = TiltChrome.ua.c.g, b = S.h.M.bind(S.h), c = S.h.xa.bind(S.h), d = Math.floor, g = j.Yc, h = [], i = 0, l = j.ja.Q.length; i < l; i += 30) { | |
| var m = g[d(i / 30)], | |
| m = c((a[m.localName !== "head" && m.localName !== "body" ? m.localName: "head/body"] || a.other).fill), | |
| n = [b(m[0] * 0.6, 0, 1), b(m[1] * 0.6, 0, 1), b(m[2] * 0.6, 0, 1)], | |
| o = [b(m[0] * 1, 0, 1), b(m[1] * 1, 0, 1), b(m[2] * 1, 0, 1)], | |
| m = n[0], | |
| p = n[1], | |
| n = n[2], | |
| q = o[0], | |
| r = o[1], | |
| o = o[2]; | |
| h.unshift(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, m, p, n, m, p, n, q, r, o, q, r, o, q, r, o, q, r, o, m, p, n, m, p, n) | |
| } | |
| j.color = new S.U(h, 3) | |
| }; | |
| this.Cf = | |
| function(a, b) { | |
| this.fe(a, b, { | |
| Nc: function(a) { | |
| "open" === TiltChrome.BrowserOverlay.D.C.state && TiltChrome.BrowserOverlay.D.C.hidePopup(); | |
| var b = a[0].ae, | |
| a = b.index, | |
| b = b.localName !== "head" && b.localName !== "body" ? b.localName: "head/body", | |
| c = TiltChrome.ua.c.g[b] || TiltChrome.ua.c.g.other; | |
| if (b !== "html") { | |
| p.index = a; | |
| p.fill = c.fill + "55"; | |
| p.stroke = c.fill + "AA"; | |
| var a = p.index * 30, | |
| b = j.P.Q, | |
| c = j.ja.Q, | |
| d = [b[c[a + 1] * 3], b[c[a + 1] * 3 + 1], b[c[a + 1] * 3 + 2], 1], | |
| g = [b[c[a + 2] * 3], b[c[a + 2] * 3 + 1], b[c[a + 2] * 3 + 2], 1], | |
| h = [b[c[a + 5] * 3], b[c[a + 5] * 3 + 1], b[c[a + 5] * 3 + | |
| 2], 1]; | |
| p.Je = [b[c[a] * 3], b[c[a] * 3 + 1], b[c[a] * 3 + 2], 1]; | |
| p.Ke = d; | |
| p.Le = g; | |
| p.Me = h | |
| } | |
| }.bind(this), | |
| Ta: function() { | |
| "open" === TiltChrome.BrowserOverlay.D.C.state && TiltChrome.BrowserOverlay.D.C.hidePopup(); | |
| p.index = -1 | |
| } | |
| }) | |
| }; | |
| this.Bf = function(a, b) { | |
| this.fe(a, b, { | |
| Nc: function(a) { | |
| this.Ua(a[0].ae) | |
| }.bind(this), | |
| Ta: function() { | |
| "open" === TiltChrome.BrowserOverlay.D.C.state && TiltChrome.BrowserOverlay.D.C.hidePopup() | |
| } | |
| }) | |
| }; | |
| this.fe = function(a, b, c) { | |
| for (var c = c || {}, | |
| a = S.h.Xe([a, b, 0], [a, b, 1], [0, 0, d.width, d.height], j.H, j.ba), b = [], g = Y(), h = j.ja.Q, | |
| i = j.P.Q, l = 0, m = h.length, n, o, p; l < m; l += 3) n = [i[h[l] * 3], i[h[l] * 3 + 1], i[h[l] * 3 + 2]], | |
| o = [i[h[l + 1] * 3], i[h[l + 1] * 3 + 1], i[h[l + 1] * 3 + 2]], | |
| p = [i[h[l + 2] * 3], i[h[l + 2] * 3 + 1], i[h[l + 2] * 3 + 2]], | |
| S.h.tf(n, o, p, a, g) > 0 && b.push({ | |
| ae: j.Yc[Math.floor(l / 30)], | |
| location: Y(g) | |
| }); | |
| b.length > 0 ? (b.sort(function(a, b) { | |
| return a.location[2] < b.location[2] ? 1: -1 | |
| }), "function" === typeof c.Nc && c.Nc(b)) : "function" === typeof c.Ta && c.Ta(); | |
| this.v() | |
| }; | |
| this.Ua = function(a) { | |
| if ("number" === typeof a) { | |
| for (var b = j.Yc, c = j.mf, d = 0, g = b.length; d < g; d++) { | |
| var h = b[d]; | |
| if (a === h.xb) { | |
| this.Ua(h); | |
| return | |
| } | |
| } | |
| b = 0; | |
| for (d = c.length; b < d; b++) if (g = c[b], a === g.xb) { | |
| this.Ua(g); | |
| break | |
| } | |
| } else if ("object" === typeof a) { | |
| var c = TiltChrome.BrowserOverlay.D.C, | |
| b = S.Gd.trim(wa(a.innerHTML).replace(/</g, "<").replace(/>/g, ">")) + "\n", | |
| d = S.G.gf(a.style), | |
| g = S.G.ef(a.attributes), | |
| h = document.getElementById("tilt-sourceeditor-iframe"), | |
| i = h.contentDocument.getElementById("code"); | |
| document.getElementById("tilt-sourceeditor-title").value = "<" + a.localName + (a.className ? ' class="' + a.className + '"': "") + (a.id ? ' id="' + a.id + '"': "") + ">"; | |
| c.openPopup(k, | |
| "overlap", window.innerWidth - h.width - 21, window.innerHeight - h.height - 77, !1, !1); | |
| i.of = b; | |
| i.Ye = d; | |
| i.Re = g; | |
| a.localName === "img" || a.localName === "input" || a.localName === "button" || i.Sb === "attr" ? (i.innerHTML = g, h.contentWindow.refreshCodeEditor("css")) : i.Sb === "css" ? (i.innerHTML = d, h.contentWindow.refreshCodeEditor("css")) : (i.innerHTML = b, h.contentWindow.refreshCodeEditor("html")); | |
| c = a.index; | |
| a = a.localName !== "head" && a.localName !== "body" ? a.localName: "head/body"; | |
| b = TiltChrome.ua.c.g[a] || TiltChrome.ua.c.g.other; | |
| if (a !== "html") p.index = | |
| c, | |
| p.fill = b.fill + "55", | |
| p.stroke = b.fill + "AA", | |
| this.v() | |
| } | |
| }; | |
| this.le = function() { | |
| var a = document.getElementById("tilt-sourceeditor-iframe"), | |
| b = a.contentDocument.getElementById("code"); | |
| b.innerHTML = b.of; | |
| b.Sb = "html"; | |
| a.contentWindow.refreshCodeEditor("html") | |
| }; | |
| this.Sf = function() { | |
| var a = document.getElementById("tilt-sourceeditor-iframe"), | |
| b = a.contentDocument.getElementById("code"); | |
| b.innerHTML = b.Ye; | |
| b.Sb = "css"; | |
| a.contentWindow.refreshCodeEditor("css") | |
| }; | |
| this.Zb = function() { | |
| var a = document.getElementById("tilt-sourceeditor-iframe"), | |
| b = a.contentDocument.getElementById("code"); | |
| b.innerHTML = b.Re; | |
| b.Sb = "attr"; | |
| a.contentWindow.refreshCodeEditor("css") | |
| }; | |
| this.Xf = function(a) { | |
| var b = a[1], | |
| c = a[2]; | |
| if (s.ea[0] != a[0] || s.ea[1] != b || s.ea[2] != c) b = s.ea, | |
| b[0] = a[0], | |
| b[1] = a[1], | |
| b[2] = a[2], | |
| this.v() | |
| }; | |
| this.Vf = function(a) { | |
| var b = a[1], | |
| c = a[2], | |
| d = a[3]; | |
| if (s.rotation[0] != a[0] || s.rotation[1] != b || s.rotation[2] != c || s.rotation[3] != d) qa(a, s.rotation), | |
| this.v() | |
| }; | |
| this.me = function(a) { | |
| l.color = a; | |
| this.v() | |
| }; | |
| this.Ug = function(a) { | |
| l.color[3] = a; | |
| this.v() | |
| }; | |
| this.Tf = function(a) { | |
| j.ka = a; | |
| this.v() | |
| }; | |
| this.Tg = function(a) { | |
| j.ka[3] = a; | |
| this.v() | |
| }; | |
| this.Uf = function(a) { | |
| j.alpha = a; | |
| this.v() | |
| }; | |
| this.d = function() { | |
| var C = gBrowser.tabContainer, | |
| X = gBrowser.contentWindow, | |
| W = TiltChrome.BrowserOverlay.D.C, | |
| Q = TiltChrome.BrowserOverlay.I.C; | |
| D !== k && (window.removeEventListener("MozAfterPaint", D, !1), D = k); | |
| m !== k && (C.removeEventListener("TabClose", m, !1), C.removeEventListener("TabAttrModified", m, !1), m = k); | |
| E !== k && (X.removeEventListener("blur", E, !1), E = k); | |
| G !== k && (X.removeEventListener("focus", G, !1), G = k); | |
| I !== k && (X.removeEventListener("resize", | |
| I, !1), I = k); | |
| K !== k && (gBrowser.removeEventListener("mouseover", K, !1), K = k); | |
| M !== k && (gBrowser.removeEventListener("load", M, !0), M = k); | |
| o !== k && (W.removeEventListener("popupshown", o, !1), o = k); | |
| J !== k && (W.removeEventListener("popuphidden", J, !1), J = k); | |
| L !== k && (Q.removeEventListener("popupshown", L, !1), L = k); | |
| B !== k && (Q.removeEventListener("popuphidden", B, !1), B = k); | |
| b && "function" === typeof b.d && (b.d(a), b = k); | |
| c && "function" === typeof c.d && (c.d(a), c = k); | |
| h !== k && (h.d(), h = k); | |
| j !== k && (j.d(), j = k); | |
| l !== k && (l.d(), l = k); | |
| n !== k && (n.d(), n = k); | |
| p !== k && (S.w(p), p = k); | |
| s !== k && (S.w(s), s = k); | |
| d !== k && (d.d(), d = k); | |
| A = u = r = w = q = t = F = y = z = x = s = p = n = l = j = i = h = g = c = b = a = k; | |
| S.w(this) | |
| }; | |
| S.q.u("TiltChrome.Visualization", this); | |
| F.call(this); | |
| t.call(this) | |
| }; | |
| TiltChrome = TiltChrome || {}; | |
| TiltChrome.Z = {}; | |
| TiltChrome.Z.Ob = { | |
| zb: "attribute vec3 vertexPosition;\nattribute vec2 vertexTexCoord;\nattribute vec3 vertexColor;\nuniform mat4 mvMatrix;\nuniform mat4 projMatrix;\nvarying vec2 texCoord;\nvarying vec3 color;\nvoid main(void) {\n gl_Position = projMatrix * mvMatrix * vec4(vertexPosition, 1.0);\n texCoord = vertexTexCoord;\n color = vertexColor;\n}", | |
| qb: "#ifdef GL_ES\nprecision lowp float;\n#endif\nuniform vec4 tint;\nuniform float alpha;\nuniform sampler2D sampler;\nvarying vec2 texCoord;\nvarying vec3 color;\nvoid main(void) {\n if (texCoord.s < 0.0) {\n gl_FragColor = vec4(color.r, color.g, color.b, tint.a);\n }\n else {\n vec4 texture = texture2D(sampler, texCoord);\n gl_FragColor = tint * texture * alpha + tint * (1.0 - alpha);\n }\n}" | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment