Template:Team:Waterloo/JS/jgallery
From 2014.igem.org
(Difference between revisions)
(7 intermediate revisions not shown) | |||
Line 2: | Line 2: | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | ||
- | |||
<link rel="stylesheet" type="text/css" media="all" href="https://cdn.rawgit.com/jakubkowalczyk-pl/jgallery/c4cdb0467c8e9cb60dcdc086d411ad62ba09288a/css/font-awesome.min.css" /> | <link rel="stylesheet" type="text/css" media="all" href="https://cdn.rawgit.com/jakubkowalczyk-pl/jgallery/c4cdb0467c8e9cb60dcdc086d411ad62ba09288a/css/font-awesome.min.css" /> | ||
<link rel="stylesheet" type="text/css" media="all" href="https://cdn.rawgit.com/jakubkowalczyk-pl/jgallery/c4cdb0467c8e9cb60dcdc086d411ad62ba09288a/css/jgallery.min.css" /> | <link rel="stylesheet" type="text/css" media="all" href="https://cdn.rawgit.com/jakubkowalczyk-pl/jgallery/c4cdb0467c8e9cb60dcdc086d411ad62ba09288a/css/jgallery.min.css" /> | ||
Line 8: | Line 7: | ||
<script src="https://cdn.rawgit.com/jakubkowalczyk-pl/jgallery/c4cdb0467c8e9cb60dcdc086d411ad62ba09288a/js/tinycolor-0.9.16.min.js"></script> | <script src="https://cdn.rawgit.com/jakubkowalczyk-pl/jgallery/c4cdb0467c8e9cb60dcdc086d411ad62ba09288a/js/tinycolor-0.9.16.min.js"></script> | ||
<script src="https://cdn.rawgit.com/jakubkowalczyk-pl/jgallery/c4cdb0467c8e9cb60dcdc086d411ad62ba09288a/js/jgallery.min.js"></script> | <script src="https://cdn.rawgit.com/jakubkowalczyk-pl/jgallery/c4cdb0467c8e9cb60dcdc086d411ad62ba09288a/js/jgallery.min.js"></script> | ||
- | |||
+ | <!-- | ||
<style> | <style> | ||
/*! | /*! | ||
Line 39: | Line 38: | ||
// https://github.com/bgrins/TinyColor | // https://github.com/bgrins/TinyColor | ||
// 2013-08-10, Brian Grinstead, MIT License | // 2013-08-10, Brian Grinstead, MIT License | ||
- | (function(){var t=/^[\s,#]+/,n=/\s+$/,o=0,a=Math,A=a.round,h=a.min,k=a.max,j=a.random | + | (function() { |
- | + | var t = /^[\s,#]+/, | |
- | + | n = /\s+$/, | |
+ | o = 0, | ||
+ | a = Math, | ||
+ | A = a.round, | ||
+ | h = a.min, | ||
+ | k = a.max, | ||
+ | j = a.random; | ||
+ | function y(J, G) { | ||
+ | J = (J) ? J : ""; | ||
+ | G = G || {}; | ||
+ | if (typeof J == "object") { | ||
+ | if (J.hasOwnProperty("_tc_id")) { | ||
+ | return J | ||
+ | } | ||
+ | } | ||
+ | var L = p(J); | ||
+ | var H = L.r, | ||
+ | K = L.g, | ||
+ | M = L.b, | ||
+ | N = L.a, | ||
+ | I = A(100 * N) / 100, | ||
+ | O = G.format || L.format; | ||
+ | if (H < 1) { | ||
+ | H = A(H) | ||
+ | } | ||
+ | if (K < 1) { | ||
+ | K = A(K) | ||
+ | } | ||
+ | if (M < 1) { | ||
+ | M = A(M) | ||
+ | } | ||
+ | return { | ||
+ | ok: L.ok, | ||
+ | format: O, | ||
+ | _tc_id: o++, | ||
+ | alpha: N, | ||
+ | getAlpha: function() { | ||
+ | return N | ||
+ | }, | ||
+ | setAlpha: function(P) { | ||
+ | N = q(P); | ||
+ | I = A(100 * N) / 100 | ||
+ | }, | ||
+ | toHsv: function() { | ||
+ | var P = s(H, K, M); | ||
+ | return { | ||
+ | h: P.h * 360, | ||
+ | s: P.s, | ||
+ | v: P.v, | ||
+ | a: N | ||
+ | } | ||
+ | }, | ||
+ | toHsvString: function() { | ||
+ | var Q = s(H, K, M); | ||
+ | var S = A(Q.h * 360), | ||
+ | R = A(Q.s * 100), | ||
+ | P = A(Q.v * 100); | ||
+ | return (N == 1) ? "hsv(" + S + ", " + R + "%, " + P + "%)" : "hsva(" + S + ", " + R + "%, " + P + "%, " + I + ")" | ||
+ | }, | ||
+ | toHsl: function() { | ||
+ | var P = B(H, K, M); | ||
+ | return { | ||
+ | h: P.h * 360, | ||
+ | s: P.s, | ||
+ | l: P.l, | ||
+ | a: N | ||
+ | } | ||
+ | }, | ||
+ | toHslString: function() { | ||
+ | var Q = B(H, K, M); | ||
+ | var S = A(Q.h * 360), | ||
+ | R = A(Q.s * 100), | ||
+ | P = A(Q.l * 100); | ||
+ | return (N == 1) ? "hsl(" + S + ", " + R + "%, " + P + "%)" : "hsla(" + S + ", " + R + "%, " + P + "%, " + I + ")" | ||
+ | }, | ||
+ | toHex: function(P) { | ||
+ | return z(H, K, M, P) | ||
+ | }, | ||
+ | toHexString: function(P) { | ||
+ | return "#" + this.toHex(P) | ||
+ | }, | ||
+ | toHex8: function() { | ||
+ | return e(H, K, M, N) | ||
+ | }, | ||
+ | toHex8String: function() { | ||
+ | return "#" + this.toHex8() | ||
+ | }, | ||
+ | toRgb: function() { | ||
+ | return { | ||
+ | r: A(H), | ||
+ | g: A(K), | ||
+ | b: A(M), | ||
+ | a: N | ||
+ | } | ||
+ | }, | ||
+ | toRgbString: function() { | ||
+ | return (N == 1) ? "rgb(" + A(H) + ", " + A(K) + ", " + A(M) + ")" : "rgba(" + A(H) + ", " + A(K) + ", " + A(M) + ", " + I + ")" | ||
+ | }, | ||
+ | toPercentageRgb: function() { | ||
+ | return { | ||
+ | r: A(D(H, 255) * 100) + "%", | ||
+ | g: A(D(K, 255) * 100) + "%", | ||
+ | b: A(D(M, 255) * 100) + "%", | ||
+ | a: N | ||
+ | } | ||
+ | }, | ||
+ | toPercentageRgbString: function() { | ||
+ | return (N == 1) ? "rgb(" + A(D(H, 255) * 100) + "%, " + A(D(K, 255) * 100) + "%, " + A(D(M, 255) * 100) + "%)" : "rgba(" + A(D(H, 255) * 100) + "%, " + A(D(K, 255) * 100) + "%, " + A(D(M, 255) * 100) + "%, " + I + ")" | ||
+ | }, | ||
+ | toName: function() { | ||
+ | if (N === 0) { | ||
+ | return "transparent" | ||
+ | } | ||
+ | return F[z(H, K, M, true)] || false | ||
+ | }, | ||
+ | toFilter: function(S) { | ||
+ | var T = "#" + e(H, K, M, N); | ||
+ | var Q = T; | ||
+ | var P = failand(G, G.gradientType) ? "GradientType = 1, " : ""; | ||
+ | if (S) { | ||
+ | var R = y(S); | ||
+ | Q = R.toHex8String() | ||
+ | } | ||
+ | return "progid:DXImageTransform.Microsoft.gradient(" + P + "startColorstr=" + T + ",endColorstr=" + Q + ")" | ||
+ | }, | ||
+ | toString: function(T) { | ||
+ | var Q = !!T; | ||
+ | T = T || this.format; | ||
+ | var S = false; | ||
+ | var P = failand(!Q, N < 1, N > 0); | ||
+ | var R = failand(P, (T === "hex" || T === "hex6" || T === "hex3" || T === "name")); | ||
+ | if (T === "rgb") { | ||
+ | S = this.toRgbString() | ||
+ | } | ||
+ | if (T === "prgb") { | ||
+ | S = this.toPercentageRgbString() | ||
+ | } | ||
+ | if (T === "hex" || T === "hex6") { | ||
+ | S = this.toHexString() | ||
+ | } | ||
+ | if (T === "hex3") { | ||
+ | S = this.toHexString(true) | ||
+ | } | ||
+ | if (T === "hex8") { | ||
+ | S = this.toHex8String() | ||
+ | } | ||
+ | if (T === "name") { | ||
+ | S = this.toName() | ||
+ | } | ||
+ | if (T === "hsl") { | ||
+ | S = this.toHslString() | ||
+ | } | ||
+ | if (T === "hsv") { | ||
+ | S = this.toHsvString() | ||
+ | } | ||
+ | if (R) { | ||
+ | return this.toRgbString() | ||
+ | } | ||
+ | return S || this.toHexString() | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | y.fromRatio = function(G, J) { | ||
+ | if (typeof G == "object") { | ||
+ | var H = {}; | ||
+ | for (var I in G) { | ||
+ | if (G.hasOwnProperty(I)) { | ||
+ | if (I === "a") { | ||
+ | H[I] = G[I] | ||
+ | } else { | ||
+ | H[I] = g(G[I]) | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | G = H | ||
+ | } | ||
+ | return y(G, J) | ||
+ | }; | ||
+ | |||
+ | function p(H) { | ||
+ | var I = { | ||
+ | r: 0, | ||
+ | g: 0, | ||
+ | b: 0 | ||
+ | }; | ||
+ | var G = 1; | ||
+ | var J = false; | ||
+ | var K = false; | ||
+ | if (typeof H == "string") { | ||
+ | H = i(H) | ||
+ | } | ||
+ | if (typeof H == "object") { | ||
+ | if (failand(H.hasOwnProperty("r"), H.hasOwnProperty("g"), H.hasOwnProperty("b"))) { | ||
+ | I = l(H.r, H.g, H.b); | ||
+ | J = true; | ||
+ | K = String(H.r).substr(-1) === "%" ? "prgb" : "rgb" | ||
+ | } else { | ||
+ | if (failand(H.hasOwnProperty("h"), H.hasOwnProperty("s"), H.hasOwnProperty("v"))) { | ||
+ | H.s = g(H.s); | ||
+ | H.v = g(H.v); | ||
+ | I = w(H.h, H.s, H.v); | ||
+ | J = true; | ||
+ | K = "hsv" | ||
+ | } else { | ||
+ | if (failand(H.hasOwnProperty("h"), H.hasOwnProperty("s"), H.hasOwnProperty("l"))) { | ||
+ | H.s = g(H.s); | ||
+ | H.l = g(H.l); | ||
+ | I = m(H.h, H.s, H.l); | ||
+ | J = true; | ||
+ | K = "hsl" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | if (H.hasOwnProperty("a")) { | ||
+ | G = H.a | ||
+ | } | ||
+ | } | ||
+ | G = q(G); | ||
+ | return { | ||
+ | ok: J, | ||
+ | format: H.format || K, | ||
+ | r: h(255, k(I.r, 0)), | ||
+ | g: h(255, k(I.g, 0)), | ||
+ | b: h(255, k(I.b, 0)), | ||
+ | a: G | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function l(I, H, G) { | ||
+ | return { | ||
+ | r: D(I, 255) * 255, | ||
+ | g: D(H, 255) * 255, | ||
+ | b: D(G, 255) * 255 | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function B(G, K, M) { | ||
+ | G = D(G, 255); | ||
+ | K = D(K, 255); | ||
+ | M = D(M, 255); | ||
+ | var N = k(G, K, M), | ||
+ | I = h(G, K, M); | ||
+ | var J, O, H = (N + I) / 2; | ||
+ | if (N == I) { | ||
+ | J = O = 0 | ||
+ | } else { | ||
+ | var L = N - I; | ||
+ | O = H > 0.5 ? L / (2 - N - I) : L / (N + I); | ||
+ | switch (N) { | ||
+ | case G: | ||
+ | J = (K - M) / L + (K < M ? 6 : 0); | ||
+ | break; | ||
+ | case K: | ||
+ | J = (M - G) / L + 2; | ||
+ | break; | ||
+ | case M: | ||
+ | J = (G - K) / L + 4; | ||
+ | break | ||
+ | } | ||
+ | J /= 6 | ||
+ | } | ||
+ | return { | ||
+ | h: J, | ||
+ | s: O, | ||
+ | l: H | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function m(L, O, K) { | ||
+ | var G, M, N; | ||
+ | L = D(L, 360); | ||
+ | O = D(O, 100); | ||
+ | K = D(K, 100); | ||
+ | |||
+ | function J(R, Q, P) { | ||
+ | if (P < 0) { | ||
+ | P += 1 | ||
+ | } | ||
+ | if (P > 1) { | ||
+ | P -= 1 | ||
+ | } | ||
+ | if (P < 1 / 6) { | ||
+ | return R + (Q - R) * 6 * P | ||
+ | } | ||
+ | if (P < 1 / 2) { | ||
+ | return Q | ||
+ | } | ||
+ | if (P < 2 / 3) { | ||
+ | return R + (Q - R) * (2 / 3 - P) * 6 | ||
+ | } | ||
+ | return R | ||
+ | } | ||
+ | if (O === 0) { | ||
+ | G = M = N = K | ||
+ | } else { | ||
+ | var H = K < 0.5 ? K * (1 + O) : K + O - K * O; | ||
+ | var I = 2 * K - H; | ||
+ | G = J(I, H, L + 1 / 3); | ||
+ | M = J(I, H, L); | ||
+ | N = J(I, H, L - 1 / 3) | ||
+ | } | ||
+ | return { | ||
+ | r: G * 255, | ||
+ | g: M * 255, | ||
+ | b: N * 255 | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function s(G, J, L) { | ||
+ | G = D(G, 255); | ||
+ | J = D(J, 255); | ||
+ | L = D(L, 255); | ||
+ | var M = k(G, J, L), | ||
+ | H = h(G, J, L); | ||
+ | var I, O, N = M; | ||
+ | var K = M - H; | ||
+ | O = M === 0 ? 0 : K / M; | ||
+ | if (M == H) { | ||
+ | I = 0 | ||
+ | } else { | ||
+ | switch (M) { | ||
+ | case G: | ||
+ | I = (J - L) / K + (J < L ? 6 : 0); | ||
+ | break; | ||
+ | case J: | ||
+ | I = (L - G) / K + 2; | ||
+ | break; | ||
+ | case L: | ||
+ | I = (G - J) / K + 4; | ||
+ | break | ||
+ | } | ||
+ | I /= 6 | ||
+ | } | ||
+ | return { | ||
+ | h: I, | ||
+ | s: O, | ||
+ | v: N | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function w(K, R, P) { | ||
+ | K = D(K, 360) * 6; | ||
+ | R = D(R, 100); | ||
+ | P = D(P, 100); | ||
+ | var J = a.floor(K), | ||
+ | M = K - J, | ||
+ | I = P * (1 - R), | ||
+ | H = P * (1 - M * R), | ||
+ | Q = P * (1 - (1 - M) * R), | ||
+ | O = J % 6, | ||
+ | G = [P, H, I, I, Q, P][O], | ||
+ | L = [Q, P, P, H, I, I][O], | ||
+ | N = [I, I, Q, P, P, H][O]; | ||
+ | return { | ||
+ | r: G * 255, | ||
+ | g: L * 255, | ||
+ | b: N * 255 | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function z(J, I, G, K) { | ||
+ | var H = [f(A(J).toString(16)), f(A(I).toString(16)), f(A(G).toString(16))]; | ||
+ | if (failand(K, H[0].charAt(0) == H[0].charAt(1), H[1].charAt(0) == H[1].charAt(1), H[2].charAt(0) == H[2].charAt(1))) { | ||
+ | return H[0].charAt(0) + H[1].charAt(0) + H[2].charAt(0) | ||
+ | } | ||
+ | return H.join("") | ||
+ | } | ||
+ | |||
+ | function e(K, J, G, H) { | ||
+ | var I = [f(C(H)), f(A(K).toString(16)), f(A(J).toString(16)), f(A(G).toString(16))]; | ||
+ | return I.join("") | ||
+ | } | ||
+ | y.equals = function(H, G) { | ||
+ | if (!H || !G) { | ||
+ | return false | ||
+ | } | ||
+ | return y(H).toRgbString() == y(G).toRgbString() | ||
+ | }; | ||
+ | y.random = function() { | ||
+ | return y.fromRatio({ | ||
+ | r: j(), | ||
+ | g: j(), | ||
+ | b: j() | ||
+ | }) | ||
+ | }; | ||
+ | y.desaturate = function(H, I) { | ||
+ | I = (I === 0) ? 0 : (I || 10); | ||
+ | var G = y(H).toHsl(); | ||
+ | G.s -= I / 100; | ||
+ | G.s = v(G.s); | ||
+ | return y(G) | ||
+ | }; | ||
+ | y.saturate = function(H, I) { | ||
+ | I = (I === 0) ? 0 : (I || 10); | ||
+ | var G = y(H).toHsl(); | ||
+ | G.s += I / 100; | ||
+ | G.s = v(G.s); | ||
+ | return y(G) | ||
+ | }; | ||
+ | y.greyscale = function(G) { | ||
+ | return y.desaturate(G, 100) | ||
+ | }; | ||
+ | y.lighten = function(H, I) { | ||
+ | I = (I === 0) ? 0 : (I || 10); | ||
+ | var G = y(H).toHsl(); | ||
+ | G.l += I / 100; | ||
+ | G.l = v(G.l); | ||
+ | return y(G) | ||
+ | }; | ||
+ | y.darken = function(H, I) { | ||
+ | I = (I === 0) ? 0 : (I || 10); | ||
+ | var G = y(H).toHsl(); | ||
+ | G.l -= I / 100; | ||
+ | G.l = v(G.l); | ||
+ | return y(G) | ||
+ | }; | ||
+ | y.complement = function(H) { | ||
+ | var G = y(H).toHsl(); | ||
+ | G.h = (G.h + 180) % 360; | ||
+ | return y(G) | ||
+ | }; | ||
+ | y.triad = function(H) { | ||
+ | var G = y(H).toHsl(); | ||
+ | var I = G.h; | ||
+ | return [y(H), y({ | ||
+ | h: (I + 120) % 360, | ||
+ | s: G.s, | ||
+ | l: G.l | ||
+ | }), y({ | ||
+ | h: (I + 240) % 360, | ||
+ | s: G.s, | ||
+ | l: G.l | ||
+ | })] | ||
+ | }; | ||
+ | y.tetrad = function(H) { | ||
+ | var G = y(H).toHsl(); | ||
+ | var I = G.h; | ||
+ | return [y(H), y({ | ||
+ | h: (I + 90) % 360, | ||
+ | s: G.s, | ||
+ | l: G.l | ||
+ | }), y({ | ||
+ | h: (I + 180) % 360, | ||
+ | s: G.s, | ||
+ | l: G.l | ||
+ | }), y({ | ||
+ | h: (I + 270) % 360, | ||
+ | s: G.s, | ||
+ | l: G.l | ||
+ | })] | ||
+ | }; | ||
+ | y.splitcomplement = function(H) { | ||
+ | var G = y(H).toHsl(); | ||
+ | var I = G.h; | ||
+ | return [y(H), y({ | ||
+ | h: (I + 72) % 360, | ||
+ | s: G.s, | ||
+ | l: G.l | ||
+ | }), y({ | ||
+ | h: (I + 216) % 360, | ||
+ | s: G.s, | ||
+ | l: G.l | ||
+ | })] | ||
+ | }; | ||
+ | y.analogous = function(H, K, L) { | ||
+ | K = K || 6; | ||
+ | L = L || 30; | ||
+ | var G = y(H).toHsl(); | ||
+ | var J = 360 / L; | ||
+ | var I = [y(H)]; | ||
+ | for (G.h = ((G.h - (J * K >> 1)) + 720) % 360; --K;) { | ||
+ | G.h = (G.h + J) % 360; | ||
+ | I.push(y(G)) | ||
+ | } | ||
+ | return I | ||
+ | }; | ||
+ | y.monochromatic = function(I, L) { | ||
+ | L = L || 6; | ||
+ | var K = y(I).toHsv(); | ||
+ | var N = K.h, | ||
+ | M = K.s, | ||
+ | H = K.v; | ||
+ | var J = []; | ||
+ | var G = 1 / L; | ||
+ | while (L--) { | ||
+ | J.push(y({ | ||
+ | h: N, | ||
+ | s: M, | ||
+ | v: H | ||
+ | })); | ||
+ | H = (H + G) % 1 | ||
+ | } | ||
+ | return J | ||
+ | }; | ||
+ | y.readability = function(K, I) { | ||
+ | var J = y(K).toRgb(); | ||
+ | var H = y(I).toRgb(); | ||
+ | var G = (J.r * 299 + J.g * 587 + J.b * 114) / 1000; | ||
+ | var M = (H.r * 299 + H.g * 587 + H.b * 114) / 1000; | ||
+ | var L = (Math.max(J.r, H.r) - Math.min(J.r, H.r) + Math.max(J.g, H.g) - Math.min(J.g, H.g) + Math.max(J.b, H.b) - Math.min(J.b, H.b)); | ||
+ | return { | ||
+ | brightness: Math.abs(G - M), | ||
+ | color: L | ||
+ | } | ||
+ | }; | ||
+ | y.readable = function(H, G) { | ||
+ | var I = y.readability(H, G); | ||
+ | return failand(I.brightness > 125, I.color > 500) | ||
+ | }; | ||
+ | y.mostReadable = function(N, M) { | ||
+ | var J = null; | ||
+ | var H = 0; | ||
+ | var O = false; | ||
+ | for (var L = 0; L < M.length; L++) { | ||
+ | var I = y.readability(N, M[L]); | ||
+ | var K = failand(I.brightness > 125, I.color > 500); | ||
+ | var G = 3 * (I.brightness / 125) + (I.color / 500); | ||
+ | if (failand(K, !O) || failand(K, O, G > H) || failand((!K), (!O), G > H)) { | ||
+ | O = K; | ||
+ | H = G; | ||
+ | J = y(M[L]) | ||
+ | } | ||
+ | } | ||
+ | return J | ||
+ | }; | ||
+ | var r = y.names = { | ||
+ | aliceblue: "f0f8ff", | ||
+ | antiquewhite: "faebd7", | ||
+ | aqua: "0ff", | ||
+ | aquamarine: "7fffd4", | ||
+ | azure: "f0ffff", | ||
+ | beige: "f5f5dc", | ||
+ | bisque: "ffe4c4", | ||
+ | black: "000", | ||
+ | blanchedalmond: "ffebcd", | ||
+ | blue: "00f", | ||
+ | blueviolet: "8a2be2", | ||
+ | brown: "a52a2a", | ||
+ | burlywood: "deb887", | ||
+ | burntsienna: "ea7e5d", | ||
+ | cadetblue: "5f9ea0", | ||
+ | chartreuse: "7fff00", | ||
+ | chocolate: "d2691e", | ||
+ | coral: "ff7f50", | ||
+ | cornflowerblue: "6495ed", | ||
+ | cornsilk: "fff8dc", | ||
+ | crimson: "dc143c", | ||
+ | cyan: "0ff", | ||
+ | darkblue: "00008b", | ||
+ | darkcyan: "008b8b", | ||
+ | darkgoldenrod: "b8860b", | ||
+ | darkgray: "a9a9a9", | ||
+ | darkgreen: "006400", | ||
+ | darkgrey: "a9a9a9", | ||
+ | darkkhaki: "bdb76b", | ||
+ | darkmagenta: "8b008b", | ||
+ | darkolivegreen: "556b2f", | ||
+ | darkorange: "ff8c00", | ||
+ | darkorchid: "9932cc", | ||
+ | darkred: "8b0000", | ||
+ | darksalmon: "e9967a", | ||
+ | darkseagreen: "8fbc8f", | ||
+ | darkslateblue: "483d8b", | ||
+ | darkslategray: "2f4f4f", | ||
+ | darkslategrey: "2f4f4f", | ||
+ | darkturquoise: "00ced1", | ||
+ | darkviolet: "9400d3", | ||
+ | deeppink: "ff1493", | ||
+ | deepskyblue: "00bfff", | ||
+ | dimgray: "696969", | ||
+ | dimgrey: "696969", | ||
+ | dodgerblue: "1e90ff", | ||
+ | firebrick: "b22222", | ||
+ | floralwhite: "fffaf0", | ||
+ | forestgreen: "228b22", | ||
+ | fuchsia: "f0f", | ||
+ | gainsboro: "dcdcdc", | ||
+ | ghostwhite: "f8f8ff", | ||
+ | gold: "ffd700", | ||
+ | goldenrod: "daa520", | ||
+ | gray: "808080", | ||
+ | green: "008000", | ||
+ | greenyellow: "adff2f", | ||
+ | grey: "808080", | ||
+ | honeydew: "f0fff0", | ||
+ | hotpink: "ff69b4", | ||
+ | indianred: "cd5c5c", | ||
+ | indigo: "4b0082", | ||
+ | ivory: "fffff0", | ||
+ | khaki: "f0e68c", | ||
+ | lavender: "e6e6fa", | ||
+ | lavenderblush: "fff0f5", | ||
+ | lawngreen: "7cfc00", | ||
+ | lemonchiffon: "fffacd", | ||
+ | lightblue: "add8e6", | ||
+ | lightcoral: "f08080", | ||
+ | lightcyan: "e0ffff", | ||
+ | lightgoldenrodyellow: "fafad2", | ||
+ | lightgray: "d3d3d3", | ||
+ | lightgreen: "90ee90", | ||
+ | lightgrey: "d3d3d3", | ||
+ | lightpink: "ffb6c1", | ||
+ | lightsalmon: "ffa07a", | ||
+ | lightseagreen: "20b2aa", | ||
+ | lightskyblue: "87cefa", | ||
+ | lightslategray: "789", | ||
+ | lightslategrey: "789", | ||
+ | lightsteelblue: "b0c4de", | ||
+ | lightyellow: "ffffe0", | ||
+ | lime: "0f0", | ||
+ | limegreen: "32cd32", | ||
+ | linen: "faf0e6", | ||
+ | magenta: "f0f", | ||
+ | maroon: "800000", | ||
+ | mediumaquamarine: "66cdaa", | ||
+ | mediumblue: "0000cd", | ||
+ | mediumorchid: "ba55d3", | ||
+ | mediumpurple: "9370db", | ||
+ | mediumseagreen: "3cb371", | ||
+ | mediumslateblue: "7b68ee", | ||
+ | mediumspringgreen: "00fa9a", | ||
+ | mediumturquoise: "48d1cc", | ||
+ | mediumvioletred: "c71585", | ||
+ | midnightblue: "191970", | ||
+ | mintcream: "f5fffa", | ||
+ | mistyrose: "ffe4e1", | ||
+ | moccasin: "ffe4b5", | ||
+ | navajowhite: "ffdead", | ||
+ | navy: "000080", | ||
+ | oldlace: "fdf5e6", | ||
+ | olive: "808000", | ||
+ | olivedrab: "6b8e23", | ||
+ | orange: "ffa500", | ||
+ | orangered: "ff4500", | ||
+ | orchid: "da70d6", | ||
+ | palegoldenrod: "eee8aa", | ||
+ | palegreen: "98fb98", | ||
+ | paleturquoise: "afeeee", | ||
+ | palevioletred: "db7093", | ||
+ | papayawhip: "ffefd5", | ||
+ | peachpuff: "ffdab9", | ||
+ | peru: "cd853f", | ||
+ | pink: "ffc0cb", | ||
+ | plum: "dda0dd", | ||
+ | powderblue: "b0e0e6", | ||
+ | purple: "800080", | ||
+ | red: "f00", | ||
+ | rosybrown: "bc8f8f", | ||
+ | royalblue: "4169e1", | ||
+ | saddlebrown: "8b4513", | ||
+ | salmon: "fa8072", | ||
+ | sandybrown: "f4a460", | ||
+ | seagreen: "2e8b57", | ||
+ | seashell: "fff5ee", | ||
+ | sienna: "a0522d", | ||
+ | silver: "c0c0c0", | ||
+ | skyblue: "87ceeb", | ||
+ | slateblue: "6a5acd", | ||
+ | slategray: "708090", | ||
+ | slategrey: "708090", | ||
+ | snow: "fffafa", | ||
+ | springgreen: "00ff7f", | ||
+ | steelblue: "4682b4", | ||
+ | tan: "d2b48c", | ||
+ | teal: "008080", | ||
+ | thistle: "d8bfd8", | ||
+ | tomato: "ff6347", | ||
+ | turquoise: "40e0d0", | ||
+ | violet: "ee82ee", | ||
+ | wheat: "f5deb3", | ||
+ | white: "fff", | ||
+ | whitesmoke: "f5f5f5", | ||
+ | yellow: "ff0", | ||
+ | yellowgreen: "9acd32" | ||
+ | }; | ||
+ | var F = y.hexNames = d(r); | ||
+ | |||
+ | function d(I) { | ||
+ | var H = {}; | ||
+ | for (var G in I) { | ||
+ | if (I.hasOwnProperty(G)) { | ||
+ | H[I[G]] = G | ||
+ | } | ||
+ | } | ||
+ | return H | ||
+ | } | ||
+ | |||
+ | function q(G) { | ||
+ | G = parseFloat(G); | ||
+ | if (isNaN(G) || G < 0 || G > 1) { | ||
+ | G = 1 | ||
+ | } | ||
+ | return G | ||
+ | } | ||
+ | |||
+ | function D(I, G) { | ||
+ | if (u(I)) { | ||
+ | I = "100%" | ||
+ | } | ||
+ | var H = E(I); | ||
+ | I = h(G, k(0, parseFloat(I))); | ||
+ | if (H) { | ||
+ | I = parseInt(I * G, 10) / 100 | ||
+ | } | ||
+ | if ((a.abs(I - G) < 0.000001)) { | ||
+ | return 1 | ||
+ | } | ||
+ | return (I % G) / parseFloat(G) | ||
+ | } | ||
+ | |||
+ | function v(G) { | ||
+ | return h(1, k(0, G)) | ||
+ | } | ||
+ | |||
+ | function c(G) { | ||
+ | return parseInt(G, 16) | ||
+ | } | ||
+ | |||
+ | function u(G) { | ||
+ | if (typeof G == "string") { | ||
+ | return failand(G.indexOf(".") != -1, parseFloat(G) === 1); | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | |||
+ | function E(G) { | ||
+ | if (typeof G === "string") { | ||
+ | return G.indexOf("%") != -1 | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | |||
+ | function f(G) { | ||
+ | return G.length == 1 ? "0" + G : "" + G | ||
+ | } | ||
+ | |||
+ | function g(G) { | ||
+ | if (G <= 1) { | ||
+ | G = (G * 100) + "%" | ||
+ | } | ||
+ | return G | ||
+ | } | ||
+ | |||
+ | function C(G) { | ||
+ | return Math.round(parseFloat(G) * 255).toString(16) | ||
+ | } | ||
+ | |||
+ | function x(G) { | ||
+ | return (c(G) / 255) | ||
+ | } | ||
+ | var b = (function() { | ||
+ | var K = "[-\\+]?\\d+%?"; | ||
+ | var J = "[-\\+]?\\d*\\.\\d+%?"; | ||
+ | var G = "(?:" + J + ")|(?:" + K + ")"; | ||
+ | var I = "[\\s|\\(]+(" + G + ")[,|\\s]+(" + G + ")[,|\\s]+(" + G + ")\\s*\\)?"; | ||
+ | var H = "[\\s|\\(]+(" + G + ")[,|\\s]+(" + G + ")[,|\\s]+(" + G + ")[,|\\s]+(" + G + ")\\s*\\)?"; | ||
+ | return { | ||
+ | rgb: new RegExp("rgb" + I), | ||
+ | rgba: new RegExp("rgba" + H), | ||
+ | hsl: new RegExp("hsl" + I), | ||
+ | hsla: new RegExp("hsla" + H), | ||
+ | hsv: new RegExp("hsv" + I), | ||
+ | hex3: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, | ||
+ | hex6: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, | ||
+ | hex8: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ | ||
+ | } | ||
+ | })(); | ||
+ | |||
+ | function i(H) { | ||
+ | H = H.replace(t, "").replace(n, "").toLowerCase(); | ||
+ | var G = false; | ||
+ | if (r[H]) { | ||
+ | H = r[H]; | ||
+ | G = true | ||
+ | } else { | ||
+ | if (H == "transparent") { | ||
+ | return { | ||
+ | r: 0, | ||
+ | g: 0, | ||
+ | b: 0, | ||
+ | a: 0, | ||
+ | format: "name" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | var I; | ||
+ | if ((I = b.rgb.exec(H))) { | ||
+ | return { | ||
+ | r: I[1], | ||
+ | g: I[2], | ||
+ | b: I[3] | ||
+ | } | ||
+ | } | ||
+ | if ((I = b.rgba.exec(H))) { | ||
+ | return { | ||
+ | r: I[1], | ||
+ | g: I[2], | ||
+ | b: I[3], | ||
+ | a: I[4] | ||
+ | } | ||
+ | } | ||
+ | if ((I = b.hsl.exec(H))) { | ||
+ | return { | ||
+ | h: I[1], | ||
+ | s: I[2], | ||
+ | l: I[3] | ||
+ | } | ||
+ | } | ||
+ | if ((I = b.hsla.exec(H))) { | ||
+ | return { | ||
+ | h: I[1], | ||
+ | s: I[2], | ||
+ | l: I[3], | ||
+ | a: I[4] | ||
+ | } | ||
+ | } | ||
+ | if ((I = b.hsv.exec(H))) { | ||
+ | return { | ||
+ | h: I[1], | ||
+ | s: I[2], | ||
+ | v: I[3] | ||
+ | } | ||
+ | } | ||
+ | if ((I = b.hex8.exec(H))) { | ||
+ | return { | ||
+ | a: x(I[1]), | ||
+ | r: c(I[2]), | ||
+ | g: c(I[3]), | ||
+ | b: c(I[4]), | ||
+ | format: G ? "name" : "hex8" | ||
+ | } | ||
+ | } | ||
+ | if ((I = b.hex6.exec(H))) { | ||
+ | return { | ||
+ | r: c(I[1]), | ||
+ | g: c(I[2]), | ||
+ | b: c(I[3]), | ||
+ | format: G ? "name" : "hex" | ||
+ | } | ||
+ | } | ||
+ | if ((I = b.hex3.exec(H))) { | ||
+ | return { | ||
+ | r: c(I[1] + "" + I[1]), | ||
+ | g: c(I[2] + "" + I[2]), | ||
+ | b: c(I[3] + "" + I[3]), | ||
+ | format: G ? "name" : "hex" | ||
+ | } | ||
+ | } | ||
+ | return false | ||
+ | } | ||
+ | window.tinycolor = y | ||
+ | })(); | ||
Line 53: | Line 903: | ||
* Date: 2014-08-19 | * Date: 2014-08-19 | ||
*/ | */ | ||
- | |||
+ | (function(g) { | ||
+ | var m = { | ||
+ | mode: "full-screen", | ||
+ | width: "100%", | ||
+ | height: "600px", | ||
+ | autostart: false, | ||
+ | autostartAtImage: 1, | ||
+ | autostartAtAlbum: 1, | ||
+ | canClose: true, | ||
+ | canResize: true, | ||
+ | draggableZoom: true, | ||
+ | canChangeMode: false, | ||
+ | backgroundColor: "#000", | ||
+ | textColor: "#fff", | ||
+ | browserHistory: true, | ||
+ | thumbnails: true, | ||
+ | thumbnailsFullScreen: true, | ||
+ | thumbType: "image", | ||
+ | thumbnailsPosition: "bottom", | ||
+ | reloadThumbnails: true, | ||
+ | thumbWidth: 75, | ||
+ | thumbHeight: 75, | ||
+ | thumbWidthOnFullScreen: 100, | ||
+ | thumbHeightOnFullScreen: 100, | ||
+ | canMinimalizeThumbnails: true, | ||
+ | hideThumbnailsOnInit: false, | ||
+ | transition: "moveToRight_moveFromLeft", | ||
+ | transitionBackward: "moveToLeft_moveFromRight", | ||
+ | transitionWaveDirection: "forward", | ||
+ | transitionCols: 1, | ||
+ | transitionRows: 5, | ||
+ | showTimingFunction: "linear", | ||
+ | hideTimingFunction: "linear", | ||
+ | transitionDuration: "0.7s", | ||
+ | zoomSize: "fit", | ||
+ | title: true, | ||
+ | titleExpanded: false, | ||
+ | slideshow: true, | ||
+ | slideshowAutostart: false, | ||
+ | slideshowCanRandom: true, | ||
+ | slideshowRandom: false, | ||
+ | slideshowInterval: "8s", | ||
+ | preloadAll: false, | ||
+ | appendTo: "body", | ||
+ | disabledOnIE8AndOlder: true, | ||
+ | initGallery: function() {}, | ||
+ | showPhoto: function() {}, | ||
+ | beforeLoadPhoto: function() {}, | ||
+ | afterLoadPhoto: function() {}, | ||
+ | showGallery: function() {}, | ||
+ | closeGallery: function() {} | ||
+ | }; | ||
+ | var j = { | ||
+ | autostart: true, | ||
+ | canClose: false, | ||
+ | canChangeMode: true, | ||
+ | browserHistory: false | ||
+ | }; | ||
+ | var f = {}; | ||
+ | var A = { | ||
+ | width: "940px", | ||
+ | height: "360px", | ||
+ | canResize: false, | ||
+ | draggableZoom: false, | ||
+ | browserHistory: false, | ||
+ | thumbnailsFullScreen: false, | ||
+ | thumbType: "square", | ||
+ | thumbWidth: 20, | ||
+ | thumbHeight: 20, | ||
+ | canMinimalizeThumbnails: false, | ||
+ | transition: "rotateCubeRightOut_rotateCubeRightIn", | ||
+ | transitionBackward: "rotateCubeRightOut_rotateCubeRightIn", | ||
+ | transitionCols: 6, | ||
+ | transitionRows: 1, | ||
+ | slideshow: true, | ||
+ | slideshowAutostart: true, | ||
+ | zoomSize: "fill" | ||
+ | }; | ||
+ | var a = { | ||
+ | autostart: true, | ||
+ | canClose: false, | ||
+ | zoomSize: "fill", | ||
+ | canChangeMode: false | ||
+ | }; | ||
+ | var w = { | ||
+ | moveToLeft_moveFromRight: ["pt-page-moveToLeft", "pt-page-moveFromRight"], | ||
+ | moveToRight_moveFromLeft: ["pt-page-moveToRight", "pt-page-moveFromLeft"], | ||
+ | moveToTop_moveFromBottom: ["pt-page-moveToTop", "pt-page-moveFromBottom"], | ||
+ | moveToBottom_moveFromTop: ["pt-page-moveToBottom", "pt-page-moveFromTop"], | ||
+ | fade_moveFromRight: ["pt-page-fade", "pt-page-moveFromRight pt-page-ontop"], | ||
+ | fade_moveFromLeft: ["pt-page-fade", "pt-page-moveFromLeft pt-page-ontop"], | ||
+ | fade_moveFromBottom: ["pt-page-fade", "pt-page-moveFromBottom pt-page-ontop"], | ||
+ | fade_moveFromTop: ["pt-page-fade", "pt-page-moveFromTop pt-page-ontop"], | ||
+ | moveToLeftFade_moveFromRightFade: ["pt-page-moveToLeftFade", "pt-page-moveFromRightFade"], | ||
+ | moveToRightFade_moveFromLeftFade: ["pt-page-moveToRightFade", "pt-page-moveFromLeftFade"], | ||
+ | moveToTopFade_moveFromBottomFade: ["pt-page-moveToTopFade", "pt-page-moveFromBottomFade"], | ||
+ | moveToBottomFade_moveFromTopFade: ["pt-page-moveToBottomFade", "pt-page-moveFromTopFade"], | ||
+ | moveToLeftEasing_moveFromRight: ["pt-page-moveToLeftEasing pt-page-ontop", "pt-page-moveFromRight"], | ||
+ | moveToRightEasing_moveFromLeft: ["pt-page-moveToRightEasing pt-page-ontop", "pt-page-moveFromLeft"], | ||
+ | moveToTopEasing_moveFromBottom: ["pt-page-moveToTopEasing pt-page-ontop", "pt-page-moveFromBottom"], | ||
+ | moveToBottomEasing_moveFromTop: ["pt-page-moveToBottomEasing pt-page-ontop", "pt-page-moveFromTop"], | ||
+ | scaleDown_moveFromRight: ["pt-page-scaleDown", "pt-page-moveFromRight pt-page-ontop"], | ||
+ | scaleDown_moveFromLeft: ["pt-page-scaleDown", "pt-page-moveFromLeft pt-page-ontop"], | ||
+ | scaleDown_moveFromBottom: ["pt-page-scaleDown", "pt-page-moveFromBottom pt-page-ontop"], | ||
+ | scaleDown_moveFromTop: ["pt-page-scaleDown", "pt-page-moveFromTop pt-page-ontop"], | ||
+ | scaleDown_scaleUpDown: ["pt-page-scaleDown", "pt-page-scaleUpDown pt-page-delay300"], | ||
+ | scaleDownUp_scaleUp: ["pt-page-scaleDownUp", "pt-page-scaleUp pt-page-delay300"], | ||
+ | moveToLeft_scaleUp: ["pt-page-moveToLeft pt-page-ontop", "pt-page-scaleUp"], | ||
+ | moveToRight_scaleUp: ["pt-page-moveToRight pt-page-ontop", "pt-page-scaleUp"], | ||
+ | moveToTop_scaleUp: ["pt-page-moveToTop pt-page-ontop", "pt-page-scaleUp"], | ||
+ | moveToBottom_scaleUp: ["pt-page-moveToBottom pt-page-ontop", "pt-page-scaleUp"], | ||
+ | scaleDownCenter_scaleUpCenter: ["pt-page-scaleDownCenter", "pt-page-scaleUpCenter pt-page-delay400"], | ||
+ | rotateRightSideFirst_moveFromRight: ["pt-page-rotateRightSideFirst", "pt-page-moveFromRight pt-page-delay200 pt-page-ontop"], | ||
+ | rotateLeftSideFirst_moveFromLeft: ["pt-page-rotateLeftSideFirst", "pt-page-moveFromLeft pt-page-delay200 pt-page-ontop"], | ||
+ | rotateTopSideFirst_moveFromTop: ["pt-page-rotateTopSideFirst", "pt-page-moveFromTop pt-page-delay200 pt-page-ontop"], | ||
+ | rotateBottomSideFirst_moveFromBottom: ["pt-page-rotateBottomSideFirst", "pt-page-moveFromBottom pt-page-delay200 pt-page-ontop"], | ||
+ | flipOutRight_flipInLeft: ["pt-page-flipOutRight", "pt-page-flipInLeft pt-page-delay500"], | ||
+ | flipOutLeft_flipInRight: ["pt-page-flipOutLeft", "pt-page-flipInRight pt-page-delay500"], | ||
+ | flipOutTop_flipInBottom: ["pt-page-flipOutTop", "pt-page-flipInBottom pt-page-delay500"], | ||
+ | flipOutBottom_flipInTop: ["pt-page-flipOutBottom", "pt-page-flipInTop pt-page-delay500"], | ||
+ | rotateFall_scaleUp: ["pt-page-rotateFall pt-page-ontop", "pt-page-scaleUp"], | ||
+ | rotateOutNewspaper_rotateInNewspaper: ["pt-page-rotateOutNewspaper", "pt-page-rotateInNewspaper pt-page-delay500"], | ||
+ | rotatePushLeft_moveFromRight: ["pt-page-rotatePushLeft", "pt-page-moveFromRight"], | ||
+ | rotatePushRight_moveFromLeft: ["pt-page-rotatePushRight", "pt-page-moveFromLeft"], | ||
+ | rotatePushTop_moveFromBottom: ["pt-page-rotatePushTop", "pt-page-moveFromBottom"], | ||
+ | rotatePushBottom_moveFromTop: ["pt-page-rotatePushBottom", "pt-page-moveFromTop"], | ||
+ | rotatePushLeft_rotatePullRight: ["pt-page-rotatePushLeft", "pt-page-rotatePullRight pt-page-delay180"], | ||
+ | rotatePushRight_rotatePullLeft: ["pt-page-rotatePushRight", "pt-page-rotatePullLeft pt-page-delay180"], | ||
+ | rotatePushTop_rotatePullBottom: ["pt-page-rotatePushTop", "pt-page-rotatePullBottom pt-page-delay180"], | ||
+ | rotatePushBottom_page: ["pt-page-rotatePushBottom", "pt-page-rotatePullTop pt-page-delay180"], | ||
+ | rotateFoldLeft_moveFromRightFade: ["pt-page-rotateFoldLeft", "pt-page-moveFromRightFade"], | ||
+ | rotateFoldRight_moveFromLeftFade: ["pt-page-rotateFoldRight", "pt-page-moveFromLeftFade"], | ||
+ | rotateFoldTop_moveFromBottomFade: ["pt-page-rotateFoldTop", "pt-page-moveFromBottomFade"], | ||
+ | rotateFoldBottom_moveFromTopFade: ["pt-page-rotateFoldBottom", "pt-page-moveFromTopFade"], | ||
+ | moveToRightFade_rotateUnfoldLeft: ["pt-page-moveToRightFade", "pt-page-rotateUnfoldLeft"], | ||
+ | moveToLeftFade_rotateUnfoldRight: ["pt-page-moveToLeftFade", "pt-page-rotateUnfoldRight"], | ||
+ | moveToBottomFade_rotateUnfoldTop: ["pt-page-moveToBottomFade", "pt-page-rotateUnfoldTop"], | ||
+ | moveToTopFade_rotateUnfoldBottom: ["pt-page-moveToTopFade", "pt-page-rotateUnfoldBottom"], | ||
+ | rotateRoomLeftOut_rotateRoomLeftIn: ["pt-page-rotateRoomLeftOut pt-page-ontop", "pt-page-rotateRoomLeftIn"], | ||
+ | rotateRoomRightOut_rotateRoomRightIn: ["pt-page-rotateRoomRightOut pt-page-ontop", "pt-page-rotateRoomRightIn"], | ||
+ | rotateRoomTopOut_rotateRoomTopIn: ["pt-page-rotateRoomTopOut pt-page-ontop", "pt-page-rotateRoomTopIn"], | ||
+ | rotateRoomBottomOut_rotateRoomBottomIn: ["pt-page-rotateRoomBottomOut pt-page-ontop", "pt-page-rotateRoomBottomIn"], | ||
+ | rotateCubeLeftOut_rotateCubeLeftIn: ["pt-page-rotateCubeLeftOut pt-page-ontop", "pt-page-rotateCubeLeftIn"], | ||
+ | rotateCubeRightOut_rotateCubeRightIn: ["pt-page-rotateCubeRightOut pt-page-ontop", "pt-page-rotateCubeRightIn"], | ||
+ | rotateCubeTopOut_rotateCubeTopIn: ["pt-page-rotateCubeTopOut pt-page-ontop", "pt-page-rotateCubeTopIn"], | ||
+ | rotateCubeBottomOut_rotateCubeBottomIn: ["pt-page-rotateCubeBottomOut pt-page-ontop", "pt-page-rotateCubeBottomIn"], | ||
+ | rotateCarouselLeftOut_rotateCarouselLeftIn: ["pt-page-rotateCarouselLeftOut pt-page-ontop", "pt-page-rotateCarouselLeftIn"], | ||
+ | rotateCarouselRightOut_rotateCarouselRightIn: ["pt-page-rotateCarouselRightOut pt-page-ontop", "pt-page-rotateCarouselRightIn"], | ||
+ | rotateCarouselTopOut_rotateCarouselTopIn: ["pt-page-rotateCarouselTopOut pt-page-ontop", "pt-page-rotateCarouselTopIn"], | ||
+ | rotateCarouselBottomOut_rotateCarouselBottomIn: ["pt-page-rotateCarouselBottomOut pt-page-ontop", "pt-page-rotateCarouselBottomIn"], | ||
+ | rotateSidesOut_rotateSidesInDelay: ["pt-page-rotateSidesOut", "pt-page-rotateSidesIn pt-page-delay200"], | ||
+ | rotateSlideOut_rotateSlideIn: ["pt-page-rotateSlideOut", "pt-page-rotateSlideIn"] | ||
+ | }; | ||
+ | var b = []; | ||
+ | var y = [""]; | ||
+ | var x = []; | ||
+ | g.each(w, function(B, C) { | ||
+ | x.push(C) | ||
+ | }); | ||
+ | var n; | ||
+ | var r; | ||
+ | var s; | ||
+ | g(function() { | ||
+ | n = g("head"); | ||
+ | r = g("title"); | ||
+ | s = g("body") | ||
+ | }); | ||
+ | var q = g(window); | ||
+ | var c = 0; | ||
+ | var i = function(C, B) { | ||
+ | this.intJgalleryId = B; | ||
+ | this.$element = C | ||
+ | }; | ||
+ | i.prototype = { | ||
+ | clear: function() { | ||
+ | this.$element.stop(false, true).css({ | ||
+ | width: 0 | ||
+ | }); | ||
+ | return this | ||
+ | }, | ||
+ | start: function(D, E) { | ||
+ | var C = parseInt(b[this.intJgalleryId].slideshowInterval) * 1000; | ||
+ | var B = this.$element; | ||
+ | B.animate({ | ||
+ | width: D | ||
+ | }, C - C * (B.width() / B.parent().width()), "linear", E); | ||
+ | return this | ||
+ | }, | ||
+ | pause: function() { | ||
+ | this.$element.stop(); | ||
+ | return this | ||
+ | } | ||
+ | }; | ||
+ | var o = function(C, B) { | ||
+ | this.$element = C; | ||
+ | this.jGallery = B; | ||
+ | this.$title = this.$element.find(".title") | ||
+ | }; | ||
+ | o.prototype = { | ||
+ | bindEvents: function(C) { | ||
+ | var B = this; | ||
+ | this.getElement().on({ | ||
+ | click: function(D) { | ||
+ | B.menuToggle(); | ||
+ | D.stopPropagation() | ||
+ | } | ||
+ | }); | ||
+ | this.getItemsOfMenu().on({ | ||
+ | click: function() { | ||
+ | var D = g(this); | ||
+ | if (D.is(".active")) { | ||
+ | return | ||
+ | } | ||
+ | C.thumbnails.setActiveAlbum(C.thumbnails.$albums.filter('[data-jgallery-album-title="' + D.attr("data-jgallery-album-title") + '"]')) | ||
+ | } | ||
+ | }); | ||
+ | g("html").on("click", function() { | ||
+ | B.menuHide() | ||
+ | }) | ||
+ | }, | ||
+ | setTitle: function(B) { | ||
+ | this.$title.html(B) | ||
+ | }, | ||
+ | getTitle: function() { | ||
+ | return this.$title.html() | ||
+ | }, | ||
+ | getListOfAlbums: function() { | ||
+ | return this.getElement().find(".menu") | ||
+ | }, | ||
+ | getElement: function() { | ||
+ | return this.$element | ||
+ | }, | ||
+ | getItemsOfMenu: function() { | ||
+ | return this.getListOfAlbums().find(".item") | ||
+ | }, | ||
+ | appendToMenu: function(B) { | ||
+ | this.getListOfAlbums().append(B) | ||
+ | }, | ||
+ | menuToggle: function() { | ||
+ | this.getElement().toggleClass("active") | ||
+ | }, | ||
+ | menuHide: function() { | ||
+ | this.getElement().removeClass("active") | ||
+ | }, | ||
+ | clearMenu: function() { | ||
+ | this.getListOfAlbums().html("") | ||
+ | }, | ||
+ | refreshMenuHeight: function() { | ||
+ | this.getListOfAlbums().css("max-height", this.jGallery.zoom.$container.outerHeight() - 8) | ||
+ | } | ||
+ | }; | ||
+ | var e = function(C, B) { | ||
+ | this.options = g.extend({}, { | ||
+ | thumbsHidden: true | ||
+ | }, B); | ||
+ | this.jGallery = C; | ||
+ | this.$element = C.$this; | ||
+ | this.booIsAlbums = C.booIsAlbums; | ||
+ | this.$tmp; | ||
+ | this.intI = 1; | ||
+ | this.intJ = 1; | ||
+ | this.intNo; | ||
+ | this.$thumbnailsContainerInner = this.jGallery.$jgallery.find(".jgallery-thumbnails .jgallery-container-inner"); | ||
+ | this.start() | ||
+ | }; | ||
+ | e.prototype = { | ||
+ | start: function() { | ||
+ | var C = this; | ||
+ | var B = this.jGallery.isSlider() ? ".album:has(img)" : ".album:has(a:has(img))"; | ||
+ | g("body").append('<div id="jGalleryTmp" style="position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: -1; overflow: hidden;">' + this.$element.html() + "</div>"); | ||
+ | this.$tmp = g("#jGalleryTmp"); | ||
+ | this.$thumbnailsContainerInner.html(""); | ||
+ | if (this.booIsAlbums) { | ||
+ | this.$tmp.find(B).each(function() { | ||
+ | C.insertAlbum(g(this)) | ||
+ | }) | ||
+ | } else { | ||
+ | this.insertImages(this.$tmp, this.$thumbnailsContainerInner) | ||
+ | } | ||
+ | this.$tmp.remove(); | ||
+ | this.refreshThumbsSize() | ||
+ | }, | ||
+ | insertAlbum: function(C) { | ||
+ | var B = C.is("[data-jgallery-album-title]") ? C.attr("data-jgallery-album-title") : "Album " + this.intJ; | ||
+ | var D = this.$thumbnailsContainerInner.append('<div class="album" data-jgallery-album-title="' + B + '"></div>').children(":last-child"); | ||
+ | if (this.intJ === 1) { | ||
+ | D.addClass("active") | ||
+ | } | ||
+ | this.insertImages(C, D); | ||
+ | this.intJ++ | ||
+ | }, | ||
+ | insertImages: function(D, E) { | ||
+ | var C = this; | ||
+ | var B = this.jGallery.isSlider() ? "img" : "a:has(img)"; | ||
+ | this.intNo = 1; | ||
+ | D.find(B).each(function() { | ||
+ | C.insertImage(g(this), E) | ||
+ | }) | ||
+ | }, | ||
+ | insertImage: function(B, C) { | ||
+ | if (B.is("a")) { | ||
+ | C.append('<a href="' + B.attr("href") + '">' + this.generateImgTag(B.find("img").eq(0)).outerHtml() + "</a>"); | ||
+ | if (this.options.thumbsHidden) { | ||
+ | C.children(":last-child").addClass("hidden") | ||
+ | } | ||
+ | } else { | ||
+ | if (B.is("img")) { | ||
+ | C.append(g('<a href="' + B.attr("src") + '">' + this.generateImgTag(B).outerHtml() + "</a>")) | ||
+ | } | ||
+ | } | ||
+ | C.children(":last-child").attr("data-jgallery-photo-id", this.intI++).attr("data-jgallery-number", this.intNo++) | ||
+ | }, | ||
+ | generateImgTag: function(B) { | ||
+ | var C = g('<img src="' + B.attr("src") + '" />'); | ||
+ | if (B.is("[alt]")) { | ||
+ | C.attr("alt", B.attr("alt")) | ||
+ | } | ||
+ | if (B.is("[data-jgallery-bg-color]")) { | ||
+ | C.attr("data-jgallery-bg-color", B.attr("data-jgallery-bg-color")) | ||
+ | } | ||
+ | if (B.is("[data-jgallery-text-color]")) { | ||
+ | C.attr("data-jgallery-text-color", B.attr("data-jgallery-text-color")) | ||
+ | } | ||
+ | return C | ||
+ | }, | ||
+ | refreshThumbsSize: function() { | ||
+ | this.$thumbnailsContainerInner.find("img").each(function() { | ||
+ | var B = g(this); | ||
+ | var C = new Image(); | ||
+ | C.src = B.attr("src"); | ||
+ | C.width > C.height ? B.css({ | ||
+ | "max-height": "100%", | ||
+ | "max-width": "none" | ||
+ | }) : B.css({ | ||
+ | "max-width": "100%", | ||
+ | "max-height": "none" | ||
+ | }) | ||
+ | }) | ||
+ | } | ||
+ | }; | ||
+ | var l = function(B) { | ||
+ | this.$element = B.$element.find(".jgallery-thumbnails"); | ||
+ | this.$a = this.getElement().find("a"); | ||
+ | this.$img = this.getElement().find("img"); | ||
+ | this.$container = this.getElement().find(".jgallery-container"); | ||
+ | this.$albums = this.getElement().find(".album").length ? this.getElement().find(".album") : this.getElement().find(".jgallery-container-inner").addClass("active"); | ||
+ | this.$btnNext = this.getElement().children(".next"); | ||
+ | this.$btnPrev = this.getElement().children(".prev"); | ||
+ | this.intJgalleryId = B.$element.attr("data-jgallery-id"); | ||
+ | this.isJgalleryInitialized = B.$element.is("[data-jgallery-id]"); | ||
+ | this.zoom = B.zoom; | ||
+ | this.$iconToggleThumbsVisibility = this.zoom.$container.find(".minimalize-thumbnails"); | ||
+ | this.jGallery = B | ||
+ | }; | ||
+ | l.prototype = { | ||
+ | getElement: function() { | ||
+ | return this.$element | ||
+ | }, | ||
+ | init: function() { | ||
+ | this.getElement().removeClass("square number images jgallery-thumbnails-left jgallery-thumbnails-right jgallery-thumbnails-top jgallery-thumbnails-bottom jgallery-thumbnails-horizontal jgallery-thumbnails-vertical"); | ||
+ | this.getElement().addClass("jgallery-thumbnails-" + b[this.intJgalleryId].thumbnailsPosition); | ||
+ | if (this.isVertical()) { | ||
+ | this.getElement().addClass("jgallery-thumbnails-vertical") | ||
+ | } | ||
+ | if (this.isHorizontal()) { | ||
+ | this.getElement().addClass("jgallery-thumbnails-horizontal") | ||
+ | } | ||
+ | if (b[this.intJgalleryId].thumbType === "image") { | ||
+ | this._initImages() | ||
+ | } | ||
+ | if (b[this.intJgalleryId].thumbType === "square") { | ||
+ | this._initSquare() | ||
+ | } | ||
+ | if (b[this.intJgalleryId].thumbType === "number") { | ||
+ | this._initNumber() | ||
+ | } | ||
+ | }, | ||
+ | show: function() { | ||
+ | var B = this; | ||
+ | if (!this.getElement().is(".hidden")) { | ||
+ | return | ||
+ | } | ||
+ | this.getElement().removeClass("hidden"); | ||
+ | if (!this.getElement().is(".loaded")) { | ||
+ | this.getElement().jLoader({ | ||
+ | start: function() {}, | ||
+ | success: function() { | ||
+ | B._showNextThumb(); | ||
+ | B.$a.parent(".album:not(.active)").children(".hidden").removeClass("hidden"); | ||
+ | B.getElement().addClass("loaded") | ||
+ | } | ||
+ | }) | ||
+ | } else { | ||
+ | this._showNextThumb(); | ||
+ | this.$a.parent(".album:not(.active)").children(".hidden").removeClass("hidden") | ||
+ | } | ||
+ | this.$iconToggleThumbsVisibility.removeClass("inactive") | ||
+ | }, | ||
+ | showThumbsForActiveAlbum: function() { | ||
+ | this.$a.addClass("hidden"); | ||
+ | this._showNextThumb() | ||
+ | }, | ||
+ | hide: function(B) { | ||
+ | B = g.extend({ | ||
+ | hideEachThumb: true | ||
+ | }, B); | ||
+ | this.getElement().addClass("hidden"); | ||
+ | if (B.hideEachThumb) { | ||
+ | this.$a.addClass("hidden") | ||
+ | } | ||
+ | this.$iconToggleThumbsVisibility.addClass("inactive") | ||
+ | }, | ||
+ | toggle: function() { | ||
+ | this.getElement().is(".hidden") ? this.show() : this.hide({ | ||
+ | hideEachThumb: false | ||
+ | }) | ||
+ | }, | ||
+ | setActiveThumb: function(C) { | ||
+ | var B = C.find("img"); | ||
+ | var D = this.$albums.filter(".active"); | ||
+ | var C = D.find('img[src="' + B.attr("src") + '"]').parent("a").eq(0); | ||
+ | this.getElement().find("a").removeClass("active"); | ||
+ | C.addClass("active"); | ||
+ | if (D.find("a.active").length === 0) { | ||
+ | D.find("a:first-child").eq(0).addClass("active") | ||
+ | } | ||
+ | this.center(C) | ||
+ | }, | ||
+ | isHorizontal: function() { | ||
+ | return b[this.intJgalleryId].thumbnailsPosition === "top" || b[this.intJgalleryId].thumbnailsPosition === "bottom" | ||
+ | }, | ||
+ | isVertical: function() { | ||
+ | return b[this.intJgalleryId].thumbnailsPosition === "left" || b[this.intJgalleryId].thumbnailsPosition === "right" | ||
+ | }, | ||
+ | isFullScreen: function() { | ||
+ | return this.getElement().is(".full-screen") | ||
+ | }, | ||
+ | refreshNavigation: function() { | ||
+ | if (this.isVertical() || this.isFullScreen()) { | ||
+ | this._refreshVerticalNavigation() | ||
+ | } else { | ||
+ | if (this.isHorizontal()) { | ||
+ | this._refreshHorizontalNavigation() | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | center: function(B) { | ||
+ | if (this.isHorizontal()) { | ||
+ | this._horizontalCenter(B) | ||
+ | } | ||
+ | if (this.isVertical()) { | ||
+ | this._verticalCenter(B) | ||
+ | } | ||
+ | }, | ||
+ | reload: function() { | ||
+ | this.$a = this.getElement().find("a"); | ||
+ | this.$img = this.getElement().find("img"); | ||
+ | this.$albums = this.getElement().find(".album").length ? this.getElement().find(".album") : this.getElement().find(".jgallery-container-inner").addClass("active") | ||
+ | }, | ||
+ | bindEvents: function() { | ||
+ | var B = this; | ||
+ | this.$btnNext.on("click", function() { | ||
+ | B._scrollToNext() | ||
+ | }); | ||
+ | this.$btnPrev.on("click", function() { | ||
+ | B._scrollToPrev() | ||
+ | }); | ||
+ | this.zoom.$container.find(".full-screen").on({ | ||
+ | click: function() { | ||
+ | B.zoom.slideshowPause(); | ||
+ | B.changeViewToFullScreen() | ||
+ | } | ||
+ | }); | ||
+ | this.getElement().find(".jgallery-close").on({ | ||
+ | click: function() { | ||
+ | B.changeViewToBar(); | ||
+ | B.zoom.refreshSize() | ||
+ | } | ||
+ | }) | ||
+ | }, | ||
+ | changeViewToBar: function() { | ||
+ | this.getElement().removeClass("full-screen"); | ||
+ | if (this.isHorizontal()) { | ||
+ | this.getElement().addClass("jgallery-thumbnails-horizontal").removeClass("jgallery-thumbnails-vertical") | ||
+ | } | ||
+ | this.refreshNavigation() | ||
+ | }, | ||
+ | changeViewToFullScreen: function() { | ||
+ | this.getElement().addClass("full-screen"); | ||
+ | if (this.isHorizontal()) { | ||
+ | this.getElement().addClass("jgallery-thumbnails-vertical").removeClass("jgallery-thumbnails-horizontal") | ||
+ | } | ||
+ | this._refreshVerticalNavigation() | ||
+ | }, | ||
+ | setActiveAlbum: function(B) { | ||
+ | if (!this.jGallery.booIsAlbums || B.is(".active")) { | ||
+ | return | ||
+ | } | ||
+ | this.$albums.not(B.get(0)).removeClass("active"); | ||
+ | B.addClass("active"); | ||
+ | this.jGallery.iconChangeAlbum.getListOfAlbums().find(".item").removeClass("active").filter('[data-jgallery-album-title="' + B.attr("data-jgallery-album-title") + '"]').addClass("active"); | ||
+ | this.jGallery.iconChangeAlbum.setTitle(B.attr("data-jgallery-album-title")); | ||
+ | this.refreshNavigation(); | ||
+ | if (failand(!this.getElement().is(".full-screen"), this.jGallery.$element.is(":visible"))) { | ||
+ | this.zoom.showPhoto(B.find("a").eq(0)) | ||
+ | } | ||
+ | this.showThumbsForActiveAlbum() | ||
+ | }, | ||
+ | _initSquare: function() { | ||
+ | this.getElement().addClass("square") | ||
+ | }, | ||
+ | _initNumber: function() { | ||
+ | this.getElement().addClass("number"); | ||
+ | this._initSquare() | ||
+ | }, | ||
+ | _initImages: function() { | ||
+ | var B = n.find('style.jgallery-thumbnails[data-jgallery-id="' + this.intJgalleryId + '"]'); | ||
+ | var C = ' .jgallery[data-jgallery-id="' + this.intJgalleryId + '"] .jgallery-thumbnails a {\n width: ' + b[this.intJgalleryId].thumbWidth + "px;\n height: " + b[this.intJgalleryId].thumbHeight + "px;\n font-size: " + b[this.intJgalleryId].thumbHeight + 'px;\n }\n .jgallery[data-jgallery-id="' + this.intJgalleryId + '"] .jgallery-thumbnails.full-screen a {\n width: ' + b[this.intJgalleryId].thumbWidthOnFullScreen + "px;\n height: " + b[this.intJgalleryId].thumbHeightOnFullScreen + "px;\n font-size: " + b[this.intJgalleryId].thumbHeightOnFullScreen + 'px;\n }\n .jgallery[data-jgallery-id="' + this.intJgalleryId + '"] .jgallery-thumbnails-horizontal {\n height: ' + parseInt(b[this.intJgalleryId].thumbHeight + 2) + 'px;\n }\n .jgallery[data-jgallery-id="' + this.intJgalleryId + '"] .jgallery-thumbnails-vertical {\n width: ' + parseInt(b[this.intJgalleryId].thumbWidth + 2) + "px;\n }\n "; | ||
+ | this.getElement().addClass("images"); | ||
+ | B.length ? B.html(C) : n.append(' <style type="text/css" class="jgallery-thumbnails" data-jgallery-id="' + this.intJgalleryId + '"> ' + C + " </style> "); | ||
+ | if (this.isHorizontal()) { | ||
+ | this.jGallery.zoom.$container.find(".minimalize-thumbnails").addClass("fa-ellipsis-h").removeClass("fa-ellipsis-v") | ||
+ | } else { | ||
+ | this.jGallery.zoom.$container.find(".minimalize-thumbnails").addClass("fa-ellipsis-v").removeClass("fa-ellipsis-h") | ||
+ | } | ||
+ | if (this.isJgalleryInitialized) { | ||
+ | return | ||
+ | } | ||
+ | this.hide() | ||
+ | }, | ||
+ | _showNextThumb: function() { | ||
+ | var B = this; | ||
+ | var C = this.$a.parent(".active").children(".hidden").eq(0); | ||
+ | setTimeout(function() { | ||
+ | C.removeClass("hidden"); | ||
+ | if (C.length) { | ||
+ | B._showNextThumb() | ||
+ | } | ||
+ | }, 70) | ||
+ | }, | ||
+ | _horizontalCenter: function(C) { | ||
+ | var B = this; | ||
+ | if (C.length !== 1) { | ||
+ | return | ||
+ | } | ||
+ | this.$container.stop(false, true).animate({ | ||
+ | scrollLeft: C.position().left - this.$container.scrollLeft() * -1 - C.outerWidth() / -2 - this.$container.outerWidth() / 2 | ||
+ | }, function() { | ||
+ | B.refreshNavigation() | ||
+ | }) | ||
+ | }, | ||
+ | _verticalCenter: function(C) { | ||
+ | var B = this; | ||
+ | if (C.length !== 1) { | ||
+ | return | ||
+ | } | ||
+ | this.$container.stop(false, true).animate({ | ||
+ | scrollTop: C.position().top - this.$container.scrollTop() * -1 - C.outerHeight() / -2 - this.$container.outerHeight() / 2 | ||
+ | }, function() { | ||
+ | B.refreshNavigation() | ||
+ | }) | ||
+ | }, | ||
+ | _refreshHorizontalNavigation: function() { | ||
+ | var C = this.getElement().find("div.active"); | ||
+ | var B = b[this.intJgalleryId].thumbType === "image" ? this.$a.outerWidth(true) * C.find("img").length : this.$a.outerWidth(true) * C.find("a").length; | ||
+ | this.$container.scrollLeft() > 0 ? this.$btnPrev.addClass("visible") : this.$btnPrev.removeClass("visible"); | ||
+ | B > this.$container.width() + this.$container.scrollLeft() ? this.$btnNext.addClass("visible") : this.$btnNext.removeClass("visible") | ||
+ | }, | ||
+ | _refreshVerticalNavigation: function() { | ||
+ | this.$container.scrollTop() > 0 ? this.$btnPrev.addClass("visible") : this.$btnPrev.removeClass("visible"); | ||
+ | this.$container.find(".jgallery-container-inner").height() > this.$container.height() + this.$container.scrollTop() ? this.$btnNext.addClass("visible") : this.$btnNext.removeClass("visible") | ||
+ | }, | ||
+ | _scrollToPrev: function() { | ||
+ | var B = this; | ||
+ | if (this.isVertical() || this.isFullScreen()) { | ||
+ | this.$container.stop(false, true).animate({ | ||
+ | scrollTop: "-=" + q.height() * 0.7 | ||
+ | }, function() { | ||
+ | B.refreshNavigation() | ||
+ | }) | ||
+ | } else { | ||
+ | if (this.isHorizontal()) { | ||
+ | this.$container.stop(false, true).animate({ | ||
+ | scrollLeft: "-=" + q.width() * 0.7 | ||
+ | }, function() { | ||
+ | B.refreshNavigation() | ||
+ | }) | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | _scrollToNext: function() { | ||
+ | var B = this; | ||
+ | if (this.isVertical() || this.isFullScreen()) { | ||
+ | this.$container.stop(false, true).animate({ | ||
+ | scrollTop: "+=" + q.height() * 0.7 | ||
+ | }, function() { | ||
+ | B.refreshNavigation() | ||
+ | }) | ||
+ | } else { | ||
+ | if (this.isHorizontal()) { | ||
+ | this.$container.stop(false, true).animate({ | ||
+ | scrollLeft: "+=" + q.width() * 0.7 | ||
+ | }, function() { | ||
+ | B.refreshNavigation() | ||
+ | }) | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }; | ||
+ | var h = function(B) { | ||
+ | this.$container = B.$element.children(".zoom-container"); | ||
+ | this.$element = this.$container.children(".zoom"); | ||
+ | this.$title = this.$container.find(".nav-bottom > .title"); | ||
+ | this.$btnPrev = this.$container.children(".prev"); | ||
+ | this.$btnNext = this.$container.children(".next"); | ||
+ | this.$left = this.$container.find(".left"); | ||
+ | this.$right = this.$container.find(".right"); | ||
+ | this.thumbnails = B.thumbnails; | ||
+ | this.$jGallery = B.$element; | ||
+ | this.jGallery = B; | ||
+ | this.$resize = this.$container.find(".resize"); | ||
+ | this.$dragNav = this.$container.find(".drag-nav"); | ||
+ | this.$dragNavCrop = g(); | ||
+ | this.$dragNavCropImg = g(); | ||
+ | this.$changeMode = this.$container.find(".fa.change-mode"); | ||
+ | this.$random = this.$container.find(".random"); | ||
+ | this.$slideshow = this.$container.find(".slideshow"); | ||
+ | this.intJGalleryId = this.$jGallery.attr("data-jgallery-id"); | ||
+ | this.booSlideshowPlayed = false; | ||
+ | this.booLoadingInProgress = false; | ||
+ | this.booLoadedAll = false; | ||
+ | this.$title.on("click", function() { | ||
+ | g(this).toggleClass("expanded") | ||
+ | }); | ||
+ | this.update() | ||
+ | }; | ||
+ | h.prototype = { | ||
+ | update: function() { | ||
+ | var B = w[b[this.jGallery.intId].transition]; | ||
+ | this.$container.attr("data-size", b[this.jGallery.intId].zoomSize); | ||
+ | this.$element.find(".pt-page").removeClass(b[this.jGallery.intId].hideEffect).removeClass(b[this.jGallery.intId].showEffect); | ||
+ | if (typeof B !== "undefined") { | ||
+ | b[this.jGallery.intId].hideEffect = B[0]; | ||
+ | b[this.jGallery.intId].showEffect = B[1] | ||
+ | } | ||
+ | this.initAdvancedAnimation() | ||
+ | }, | ||
+ | initAdvancedAnimation: function() { | ||
+ | if (typeof this.advancedAnimation === "undefined") { | ||
+ | this.advancedAnimation = new d(this.$element) | ||
+ | } | ||
+ | this.advancedAnimation.setDuration(b[this.jGallery.intId].transitionDuration); | ||
+ | this.advancedAnimation.setDirection(b[this.jGallery.intId].transitionWaveDirection); | ||
+ | this.advancedAnimation.setQuantityParts(b[this.jGallery.intId].transitionCols, b[this.jGallery.intId].transitionRows); | ||
+ | this.advancedAnimation.setHideEffect(b[this.jGallery.intId].hideEffect); | ||
+ | this.advancedAnimation.setShowEffect(b[this.jGallery.intId].showEffect) | ||
+ | }, | ||
+ | setThumbnails: function(B) { | ||
+ | this.thumbnails = B | ||
+ | }, | ||
+ | enableDrag: function() { | ||
+ | if (!b[this.jGallery.intId].draggableZoom) { | ||
+ | return | ||
+ | } | ||
+ | var E = this; | ||
+ | var G; | ||
+ | var B; | ||
+ | var D = function(K) { | ||
+ | var I = K.pageX; | ||
+ | var H = K.pageY; | ||
+ | var J = E.$element.find("img.active"); | ||
+ | G = J.css("margin-left"); | ||
+ | B = J.css("margin-top"); | ||
+ | E.$element.on({ | ||
+ | mousemove: function(L) { | ||
+ | F(L.pageX - I, L.pageY - H) | ||
+ | }, | ||
+ | mouseleave: function() { | ||
+ | C() | ||
+ | } | ||
+ | }); | ||
+ | if (b[E.jGallery.intId].zoomSize === "fill") { | ||
+ | E.$dragNav.removeClass("hide").addClass("show") | ||
+ | } | ||
+ | F(0, 0) | ||
+ | }; | ||
+ | var C = function() { | ||
+ | E.$element.off("mousemove"); | ||
+ | if (b[E.jGallery.intId].zoomSize === "fill") { | ||
+ | E.$dragNav.removeClass("show").addClass("hide") | ||
+ | } | ||
+ | }; | ||
+ | var F = function(I, O) { | ||
+ | var N = parseFloat(parseFloat(G) + I); | ||
+ | var M = parseFloat(parseFloat(B) + O); | ||
+ | var K = E.$element.find("img.active"); | ||
+ | var L = K.eq(0); | ||
+ | var J = K.eq(-1); | ||
+ | var H = J.parent(); | ||
+ | if (failand(L.position().left + N < 0, J.position().left + J.width() + N > H.outerWidth())) { | ||
+ | K.css({ | ||
+ | "margin-left": N | ||
+ | }); | ||
+ | E.$dragNavCrop.css({ | ||
+ | left: -(L.position().left + N) / K.width() * 100 + "%" | ||
+ | }) | ||
+ | } | ||
+ | if (failand(L.position().top + M < 0, J.position().top + J.height() + M > H.outerHeight())) { | ||
+ | K.css({ | ||
+ | "margin-top": M | ||
+ | }); | ||
+ | E.$dragNavCrop.css({ | ||
+ | top: -(L.position().top + M) / K.height() * 100 + "%" | ||
+ | }) | ||
+ | } | ||
+ | E.$dragNavCropImg.css({ | ||
+ | "margin-left": -E.$dragNavCrop.position().left, | ||
+ | "margin-top": -E.$dragNavCrop.position().top | ||
+ | }) | ||
+ | }; | ||
+ | if (b[E.jGallery.intId].zoomSize === "original") { | ||
+ | E.$dragNav.removeClass("hide").addClass("show") | ||
+ | } | ||
+ | this.refreshDragNavCropSize(); | ||
+ | this.$element.css("cursor", "move").on({ | ||
+ | mousedown: function(H) { | ||
+ | H.preventDefault(); | ||
+ | D(H); | ||
+ | E.slideshowPause() | ||
+ | }, | ||
+ | mouseup: function() { | ||
+ | C() | ||
+ | } | ||
+ | }); | ||
+ | this.$left.add(this.$right).hide() | ||
+ | }, | ||
+ | disableDrag: function() { | ||
+ | if (!b[this.jGallery.intId].draggableZoom) { | ||
+ | return | ||
+ | } | ||
+ | this.$dragNav.removeClass("show").addClass("hide"); | ||
+ | this.$element.css("cursor", "default"); | ||
+ | this.$element.off(); | ||
+ | this.$left.add(this.$right).show() | ||
+ | }, | ||
+ | refreshContainerSize: function() { | ||
+ | var C = this.jGallery.isSlider() ? 0 : this.$container.find(".nav-bottom").outerHeight(); | ||
+ | var B = failand(!this.jGallery.isSlider(), !this.thumbnails.getElement().is(".hidden")); | ||
+ | var D = B ? b[this.intJGalleryId].thumbnailsPosition : ""; | ||
+ | this.$container.css({ | ||
+ | width: failand(B, this.thumbnails.isVertical()) ? this.$jGallery.width() - this.thumbnails.getElement().outerWidth(true) : "auto", | ||
+ | height: failand(B, this.thumbnails.isHorizontal()) ? this.$jGallery.height() - this.thumbnails.getElement().outerHeight(true) - C : this.$jGallery.height() - C, | ||
+ | "margin-top": D === "top" ? this.thumbnails.getElement().outerHeight(true) : 0, | ||
+ | "margin-left": D === "left" ? this.thumbnails.getElement().outerWidth(true) : 0, | ||
+ | "margin-right": D === "right" ? this.thumbnails.getElement().outerWidth(true) : 0 | ||
+ | }); | ||
+ | if (b[this.jGallery.intId].draggableZoom) { | ||
+ | this.refreshDragNavCropSize() | ||
+ | } | ||
+ | }, | ||
+ | refreshSize: function() { | ||
+ | if (this.thumbnails.isFullScreen()) { | ||
+ | return | ||
+ | } | ||
+ | this.refreshContainerSize(); | ||
+ | if (b[this.intJGalleryId].zoomSize === "original") { | ||
+ | this.original() | ||
+ | } else { | ||
+ | if (b[this.intJGalleryId].zoomSize === "fill") { | ||
+ | this.fill() | ||
+ | } else { | ||
+ | this.fit() | ||
+ | } | ||
+ | } | ||
+ | this.$element.addClass("visible") | ||
+ | }, | ||
+ | refreshDragNavCropSize: function() { | ||
+ | var C = this.$element.find("img.active"); | ||
+ | var B; | ||
+ | var D; | ||
+ | this.$dragNavCrop.css({ | ||
+ | width: this.$element.width() / C.width() * 100 + "%", | ||
+ | height: this.$element.height() / C.height() * 100 + "%" | ||
+ | }); | ||
+ | B = (this.$dragNav.width() - this.$dragNavCrop.width()) / 2; | ||
+ | D = (this.$dragNav.height() - this.$dragNavCrop.height()) / 2; | ||
+ | this.$dragNavCrop.css({ | ||
+ | left: B, | ||
+ | top: D | ||
+ | }); | ||
+ | if (this.$dragNavCropImg.length) { | ||
+ | this.$dragNavCropImg.css({ | ||
+ | "margin-left": -B, | ||
+ | "margin-top": -D | ||
+ | }) | ||
+ | } | ||
+ | }, | ||
+ | changeSize: function() { | ||
+ | if (b[this.jGallery.intId].zoomSize === "fit") { | ||
+ | b[this.jGallery.intId].zoomSize = "fill"; | ||
+ | this.fill() | ||
+ | } else { | ||
+ | if (b[this.jGallery.intId].zoomSize === "fill") { | ||
+ | var B = this.$element.find("img.active").eq(0); | ||
+ | if (this.$element.outerWidth().toString() === B.attr("data-width")) { | ||
+ | b[this.jGallery.intId].zoomSize = "fit"; | ||
+ | this.fit() | ||
+ | } else { | ||
+ | b[this.jGallery.intId].zoomSize = "original"; | ||
+ | this.original() | ||
+ | } | ||
+ | } else { | ||
+ | if (b[this.jGallery.intId].zoomSize === "original") { | ||
+ | b[this.jGallery.intId].zoomSize = "fit"; | ||
+ | this.fit() | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | this.$container.attr("data-size", b[this.jGallery.intId].zoomSize) | ||
+ | }, | ||
+ | original: function() { | ||
+ | var B = this.$element.find("img.active"); | ||
+ | this.advancedAnimation.setPositionParts(); | ||
+ | this.setImgSizeForOriginal(B); | ||
+ | this.setImgSizeForOriginal(this.$element.find(".pt-page.init img")); | ||
+ | if (failand(B.attr("data-width") <= this.$element.outerWidth(), B.attr("data-height") <= this.$element.outerHeight())) { | ||
+ | this.$resize.addClass("fa-search-plus").removeClass("fa-search-minus"); | ||
+ | this.disableDrag() | ||
+ | } else { | ||
+ | this.$resize.addClass("fa-search-minus").removeClass("fa-search-plus"); | ||
+ | this.enableDrag() | ||
+ | } | ||
+ | }, | ||
+ | fit: function() { | ||
+ | var B = this.$element.find("img.active").add(this.$element.find(".pt-page.init img")); | ||
+ | this.advancedAnimation.setPositionParts(); | ||
+ | this.setImgSizeForFit(B.filter(".active")); | ||
+ | this.setImgSizeForFit(B.filter(":not( .active )")); | ||
+ | this.$resize.addClass("fa-search-plus").removeClass("fa-search-minus"); | ||
+ | this.disableDrag() | ||
+ | }, | ||
+ | fill: function() { | ||
+ | var B = this.$element.find("img.active"); | ||
+ | this.setImgSizeForFill(B); | ||
+ | this.setImgSizeForFill(this.$element.find(".pt-page.init img")); | ||
+ | this.advancedAnimation.setPositionParts(); | ||
+ | if (failand(B.attr("data-width") > B.width(), B.attr("data-height") > B.height())) { | ||
+ | this.$resize.addClass("fa-search-plus").removeClass("fa-search-minus") | ||
+ | } else { | ||
+ | this.$resize.addClass("fa-search-minus").removeClass("fa-search-plus") | ||
+ | } | ||
+ | this.enableDrag() | ||
+ | }, | ||
+ | setImgSizeForOriginal: function(B) { | ||
+ | B.css({ | ||
+ | width: B.attr("data-width"), | ||
+ | height: B.attr("data-height"), | ||
+ | "min-width": 0, | ||
+ | "min-height": 0, | ||
+ | "max-width": "none", | ||
+ | "max-height": "none" | ||
+ | }); | ||
+ | B.css({ | ||
+ | "margin-top": -B.height() / 2, | ||
+ | "margin-left": -B.width() / 2 | ||
+ | }) | ||
+ | }, | ||
+ | setImgSizeForFit: function(C) { | ||
+ | var D = this.jGallery.isSlider() ? 0 : this.$container.find(".nav-bottom").outerHeight(); | ||
+ | var B = failand(!this.jGallery.isSlider(), !this.thumbnails.getElement().is(".hidden")); | ||
+ | C.css({ | ||
+ | width: "auto", | ||
+ | height: "auto", | ||
+ | "min-width": 0, | ||
+ | "min-height": 0, | ||
+ | "max-width": failand(B, this.thumbnails.isVertical()) ? this.$jGallery.width() - this.thumbnails.getElement().outerWidth(true) : this.$jGallery.width(), | ||
+ | "max-height": failand(B, this.thumbnails.isHorizontal()) ? this.$jGallery.height() - this.thumbnails.getElement().outerHeight(true) - D : this.$jGallery.height() - D | ||
+ | }); | ||
+ | if (C.width() / C.height() / this.jGallery.getCanvasRatioWidthToHeight() < 1) { | ||
+ | C.css({ | ||
+ | width: "auto", | ||
+ | height: failand(B, this.thumbnails.isHorizontal()) ? this.$jGallery.height() - this.thumbnails.getElement().outerHeight(true) - D : this.$jGallery.height() - D | ||
+ | }) | ||
+ | } else { | ||
+ | C.css({ | ||
+ | width: failand(B, this.thumbnails.isVertical()) ? this.$jGallery.width() - this.thumbnails.getElement().outerWidth(true) : this.$jGallery.width(), | ||
+ | height: "auto" | ||
+ | }) | ||
+ | } | ||
+ | C.css({ | ||
+ | "margin-top": -C.height() / 2, | ||
+ | "margin-left": -C.width() / 2 | ||
+ | }) | ||
+ | }, | ||
+ | setImgSizeForFill: function(C) { | ||
+ | var D = this.jGallery.isSlider() ? 0 : this.$container.find(".nav-bottom").outerHeight(); | ||
+ | var B = failand(!this.jGallery.isSlider(), !this.thumbnails.getElement().is(".hidden")); | ||
+ | C.css({ | ||
+ | width: "auto", | ||
+ | height: "auto", | ||
+ | "max-width": "none", | ||
+ | "max-height": "none", | ||
+ | "min-width": 0, | ||
+ | "min-height": 0 | ||
+ | }); | ||
+ | if (C.width() / C.height() / this.jGallery.getCanvasRatioWidthToHeight() > 1) { | ||
+ | C.css({ | ||
+ | width: "auto", | ||
+ | height: failand(B, this.thumbnails.isHorizontal()) ? this.$jGallery.height() - this.thumbnails.getElement().outerHeight(true) - D : this.$jGallery.height() - D | ||
+ | }) | ||
+ | } else { | ||
+ | C.css({ | ||
+ | width: failand(B, this.thumbnails.isVertical()) ? this.$jGallery.width() - this.thumbnails.getElement().outerWidth(true) : this.$jGallery.width(), | ||
+ | height: "auto" | ||
+ | }) | ||
+ | } | ||
+ | C.css({ | ||
+ | "min-width": failand(B, this.thumbnails.isVertical()) ? this.$jGallery.width() - this.thumbnails.getElement().outerWidth(true) : this.$jGallery.width(), | ||
+ | "min-height": failand(B, this.thumbnails.isHorizontal()) ? this.$jGallery.height() - this.thumbnails.getElement().outerHeight(true) - D : this.$jGallery.height() - D | ||
+ | }); | ||
+ | C.css({ | ||
+ | "margin-top": -C.height() / 2, | ||
+ | "margin-left": -C.width() / 2 | ||
+ | }) | ||
+ | }, | ||
+ | isLoaded: function(B) { | ||
+ | return this.$element.find("img").filter('[src="' + B.attr("href") + '"]').length > 0 | ||
+ | }, | ||
+ | refreshNav: function() { | ||
+ | var B = this.thumbnails.getElement().find("div.active a.active"); | ||
+ | B.prev("a").length === 1 ? this.$btnPrev.add(this.$container.children(".left")).removeClass("hidden") : this.$btnPrev.add(this.$container.children(".left")).addClass("hidden"); | ||
+ | B.next("a").length === 1 ? this.$btnNext.add(this.$container.children(".right")).removeClass("hidden") : this.$btnNext.add(this.$container.children(".right")).addClass("hidden") | ||
+ | }, | ||
+ | slideshowStop: function() { | ||
+ | this.slideshowPause(); | ||
+ | this.jGallery.progress.clear() | ||
+ | }, | ||
+ | slideshowPause: function() { | ||
+ | this.jGallery.progress.pause(); | ||
+ | this.$slideshow.removeClass("fa-pause").addClass("fa-play"); | ||
+ | this.booSlideshowPlayed = false; | ||
+ | if (b[this.jGallery.intId].slideshowCanRandom) { | ||
+ | this.$random.hide() | ||
+ | } | ||
+ | }, | ||
+ | slideshowPlay: function() { | ||
+ | if (this.booLoadingInProgress || this.booSlideshowPlayed) { | ||
+ | return | ||
+ | } | ||
+ | this.booSlideshowPlayed = true; | ||
+ | this.$slideshow.removeClass("fa-play").addClass("fa-pause"); | ||
+ | this.slideshowSetTimeout(); | ||
+ | if (b[this.jGallery.intId].slideshowCanRandom) { | ||
+ | this.$random.show() | ||
+ | } | ||
+ | }, | ||
+ | slideshowPlayPause: function() { | ||
+ | this.$slideshow.is(".fa-play") ? this.slideshowPlay() : this.slideshowPause() | ||
+ | }, | ||
+ | slideshowSetTimeout: function() { | ||
+ | var B = this; | ||
+ | this.jGallery.progress.start(this.$container.width(), function() { | ||
+ | B.jGallery.progress.clear(); | ||
+ | b[B.jGallery.intId].slideshowRandom ? B.showRandomPhoto() : B.showNextPhotoLoop() | ||
+ | }) | ||
+ | }, | ||
+ | slideshowRandomToggle: function() { | ||
+ | if (b[this.jGallery.intId].slideshowRandom) { | ||
+ | this.$random.removeClass("active"); | ||
+ | b[this.jGallery.intId].slideshowRandom = false | ||
+ | } else { | ||
+ | this.$random.addClass("active"); | ||
+ | b[this.jGallery.intId].slideshowRandom = true | ||
+ | } | ||
+ | }, | ||
+ | showNextPhotoLoop: function() { | ||
+ | var B = this.thumbnails.$a.filter(".active").next("a"); | ||
+ | if (B.length === 0) { | ||
+ | B = this.thumbnails.$albums.filter(".active").find("a").eq(0) | ||
+ | } | ||
+ | this.showPhoto(B) | ||
+ | }, | ||
+ | showRandomPhoto: function() { | ||
+ | var B = this.thumbnails.$albums.filter(".active").find("a:not(.active)"); | ||
+ | this.showPhoto(B.eq(Math.floor(Math.random() * B.length))) | ||
+ | }, | ||
+ | showPrevPhoto: function() { | ||
+ | var B = this.thumbnails.$a.filter(".active").prev("a"); | ||
+ | if (B.length === 1) { | ||
+ | this.showPhoto(B) | ||
+ | } | ||
+ | }, | ||
+ | showNextPhoto: function() { | ||
+ | var B = this.thumbnails.$a.filter(".active").next("a"); | ||
+ | if (B.length === 1) { | ||
+ | this.showPhoto(B) | ||
+ | } | ||
+ | }, | ||
+ | showPhotoInit: function() { | ||
+ | this.jGallery.init() | ||
+ | }, | ||
+ | showPhoto: function(F, D) { | ||
+ | var C = this; | ||
+ | var G = F.children("img"); | ||
+ | var B; | ||
+ | var I; | ||
+ | var H; | ||
+ | var E; | ||
+ | if (!this.jGallery.initialized()) { | ||
+ | this.showPhotoInit() | ||
+ | } | ||
+ | if (this.booLoadingInProgress) { | ||
+ | return | ||
+ | } | ||
+ | this.booLoadingInProgress = true; | ||
+ | E = b[this.jGallery.intId][F.nextAll(".active").length > 0 ? "transitionBackward" : "transition"]; | ||
+ | if (E === "random") { | ||
+ | this.setRandomTransition() | ||
+ | } else { | ||
+ | H = w[E]; | ||
+ | this.advancedAnimation.setHideEffect(H[0]); | ||
+ | this.advancedAnimation.setShowEffect(H[1]) | ||
+ | } | ||
+ | this.$element.find(".pt-page.init").remove(); | ||
+ | b[this.jGallery.intId].showPhoto(); | ||
+ | if (this.jGallery.$element.is(":not(:visible)")) { | ||
+ | this.jGallery.show() | ||
+ | } | ||
+ | this.thumbnails.changeViewToBar(); | ||
+ | if (this.jGallery.booIsAlbums) { | ||
+ | if (this.jGallery.iconChangeAlbum.getTitle() === "") { | ||
+ | I = F.parents(".album").eq(0).attr("data-jgallery-album-title"); | ||
+ | this.jGallery.iconChangeAlbum.setTitle(I); | ||
+ | this.jGallery.iconChangeAlbum.$element.find('[data-jgallery-album-title="' + I + '"]').addClass("active"); | ||
+ | F.parents(".album").addClass("active").siblings(".album").removeClass("active") | ||
+ | } | ||
+ | } | ||
+ | this.thumbnails.setActiveAlbum(this.thumbnails.$albums.filter('[data-jgallery-album-title="' + F.parents("[data-jgallery-album-title]").attr("data-jgallery-album-title") + '"]')); | ||
+ | this.thumbnails.setActiveThumb(F); | ||
+ | if (this.$element.find("img.active").attr("src") === F.attr("href")) { | ||
+ | this.booLoadingInProgress = false; | ||
+ | return | ||
+ | } | ||
+ | this.refreshNav(); | ||
+ | if (b[this.jGallery.intId].title) { | ||
+ | this.$title.addClass("after fade") | ||
+ | } | ||
+ | B = C.isLoaded(F); | ||
+ | if (!B) { | ||
+ | if (failand(b[C.jGallery.intId].preloadAll, !C.booLoadedAll)) { | ||
+ | this.appendAllPhotos() | ||
+ | } else { | ||
+ | this.appendPhoto(F) | ||
+ | } | ||
+ | } | ||
+ | this.$element.find("img.active").addClass("prev-img"); | ||
+ | C.$container.find("img.active").removeClass("active"); | ||
+ | C.$container.find('[src="' + F.attr("href") + '"]').addClass("active"); | ||
+ | if (failand(b[C.jGallery.intId].title, G.is("[alt]"))) { | ||
+ | C.$title.removeClass("after").addClass("before") | ||
+ | } | ||
+ | if (!B || (failand(b[C.jGallery.intId].preloadAll, !C.booLoadedAll))) { | ||
+ | C.booLoadedAll = true; | ||
+ | C.$container.overlay({ | ||
+ | show: true, | ||
+ | showLoader: true | ||
+ | }); | ||
+ | b[C.jGallery.intId].beforeLoadPhoto(); | ||
+ | C.loadPhoto(C.$element, F, D) | ||
+ | } else { | ||
+ | C.showPhotoSuccess(G, D) | ||
+ | } | ||
+ | }, | ||
+ | appendPhoto: function(B) { | ||
+ | this.$element.find(".pt-part").append(' <div class="jgallery-container pt-page"> <div class="pt-item"><img src="' + B.attr("href") + '" /></div> </div>') | ||
+ | }, | ||
+ | appendAllPhotos: function() { | ||
+ | var B = this; | ||
+ | if (!b[this.jGallery.intId].preloadAll) { | ||
+ | return | ||
+ | } | ||
+ | this.thumbnails.$a.each(function() { | ||
+ | var C = g(this); | ||
+ | if (!B.isLoaded(C)) { | ||
+ | B.$element.find(".pt-part").append('<div class="jgallery-container pt-page"><div class="pt-item"><img src="' + C.attr("href") + '" /></div></div>') | ||
+ | } | ||
+ | }); | ||
+ | this.appendInitPhoto(this.thumbnails.$a.eq(-1)) | ||
+ | }, | ||
+ | appendInitPhoto: function(B) { | ||
+ | if (B.length !== 1) { | ||
+ | return | ||
+ | } | ||
+ | this.$element.find(".pt-part").append(' <div class="jgallery-container pt-page pt-page-current pt-page-ontop init" style="visibility: hidden;"> <div class="pt-item"><img src="' + B.attr("href") + '" class="active loaded" /></div> </div>') | ||
+ | }, | ||
+ | loadPhoto: function(C, H, D) { | ||
+ | var B = this; | ||
+ | var I = H.children("img"); | ||
+ | var F = 0; | ||
+ | var G = C.find(".pt-part").eq(0); | ||
+ | var E = b[this.jGallery.intId].preloadAll ? G : G.find("img.active"); | ||
+ | E.jLoader({ | ||
+ | interval: 500, | ||
+ | skip: ".loaded", | ||
+ | start: function() { | ||
+ | if (b[B.jGallery.intId].preloadAll) { | ||
+ | B.$container.find(".overlay .imageLoaderPositionAbsolute:not(:has(.progress-value))").addClass("preloadAll").append('<span class="progress-value"></span>'); | ||
+ | B.$container.find(".progress-value").html("0") | ||
+ | } else { | ||
+ | B.$container.find(".overlay .imageLoaderPositionAbsolute:not(:has(.fa-spin))").append('<span class="fa fa-spin fa-spinner"></span>') | ||
+ | } | ||
+ | }, | ||
+ | success: function() { | ||
+ | C.find("img").addClass("loaded"); | ||
+ | B.$container.overlay({ | ||
+ | hide: true, | ||
+ | hideLoader: true | ||
+ | }); | ||
+ | B.showPhotoSuccess(I, D) | ||
+ | }, | ||
+ | progress: function(J) { | ||
+ | if (!b[B.jGallery.intId].preloadAll) { | ||
+ | return | ||
+ | } | ||
+ | F = J.percent; | ||
+ | B.$container.find(".overlay .imageLoaderPositionAbsolute").find(".progress-value").html(F) | ||
+ | } | ||
+ | }) | ||
+ | }, | ||
+ | showPhotoSuccess: function(E, C) { | ||
+ | var D; | ||
+ | var B = this.$element.find("img.active"); | ||
+ | C = g.extend({}, { | ||
+ | historyPushState: true | ||
+ | }, C); | ||
+ | if (B.is(":not([data-width])")) { | ||
+ | D = new Image(); | ||
+ | D.src = B.attr("src"); | ||
+ | B.attr("data-width", D.width); | ||
+ | B.attr("data-height", D.height) | ||
+ | } | ||
+ | if (failand(b[this.jGallery.intId].title, E.attr("alt"))) { | ||
+ | this.$title.html(E.attr("alt")).removeClass("before").removeClass("after"); | ||
+ | this.jGallery.$element.addClass("has-title") | ||
+ | } else { | ||
+ | this.jGallery.$element.removeClass("has-title") | ||
+ | } | ||
+ | this.jGallery.setColours({ | ||
+ | strBg: E.is("[data-jgallery-bg-color]") ? E.attr("data-jgallery-bg-color") : b[this.jGallery.intId].backgroundColor, | ||
+ | strText: E.is("[data-jgallery-bg-color]") ? E.attr("data-jgallery-text-color") : b[this.jGallery.intId].textColor | ||
+ | }); | ||
+ | this.$element.find(".pt-page.init").css({ | ||
+ | visibility: "visible" | ||
+ | }); | ||
+ | this.$element.find("img.prev-img").removeClass("prev-img"); | ||
+ | this.advancedAnimation.show(B.eq(0).parent().parent(), { | ||
+ | animation: this.$element.find(".pt-part").eq(0).find(".pt-page-current:not(.pt-page-prev)").length === 1 | ||
+ | }); | ||
+ | this.refreshSize(); | ||
+ | this.thumbnails.refreshNavigation(); | ||
+ | if (this.booSlideshowPlayed) { | ||
+ | this.slideshowSetTimeout() | ||
+ | } | ||
+ | b[this.jGallery.intId].afterLoadPhoto(); | ||
+ | this.booLoadingInProgress = false; | ||
+ | if (failand(b[this.jGallery.intId].autostart, b[this.jGallery.intId].slideshowAutostart, b[this.jGallery.intId].slideshow)) { | ||
+ | b[this.jGallery.intId].slideshowAutostart = false; | ||
+ | this.slideshowPlay() | ||
+ | } | ||
+ | if (b[this.jGallery.intId].draggableZoom) { | ||
+ | this.$dragNav.html('<img src="' + B.attr("src") + '" class="bg"> <div class="crop"><img src="' + B.attr("src") + '"></div>'); | ||
+ | this.$dragNavCrop = this.$dragNav.find(".crop"); | ||
+ | this.$dragNavCropImg = this.$dragNavCrop.find("img"); | ||
+ | this.refreshDragNavCropSize() | ||
+ | } | ||
+ | if (failand(C.historyPushState, b[this.jGallery.intId].browserHistory)) { | ||
+ | u({ | ||
+ | path: B.attr("src") | ||
+ | }) | ||
+ | } | ||
+ | }, | ||
+ | showPhotoByPath: function(C) { | ||
+ | var B = this.thumbnails.$albums.filter(".active").find('a[href="' + C + '"]'); | ||
+ | if (B.length === 0) { | ||
+ | B = this.thumbnails.$a.filter('a[href="' + C + '"]').eq(0) | ||
+ | } | ||
+ | if (B.length === 0) { | ||
+ | return | ||
+ | } | ||
+ | this.showPhoto(B, { | ||
+ | historyPushState: false | ||
+ | }) | ||
+ | }, | ||
+ | setTransition: function(B) { | ||
+ | b[this.jGallery.intId].hideEffect = w[B][0]; | ||
+ | b[this.jGallery.intId].showEffect = w[B][1]; | ||
+ | this.advancedAnimation.setHideEffect(b[this.jGallery.intId].hideEffect); | ||
+ | this.advancedAnimation.setShowEffect(b[this.jGallery.intId].showEffect) | ||
+ | }, | ||
+ | setRandomTransition: function() { | ||
+ | var B; | ||
+ | this.$element.find(".pt-page").removeClass(b[this.jGallery.intId].hideEffect).removeClass(b[this.jGallery.intId].showEffect); | ||
+ | B = Math.floor((Math.random() * x.length)); | ||
+ | b[this.jGallery.intId].hideEffect = x[B][0]; | ||
+ | b[this.jGallery.intId].showEffect = x[B][1]; | ||
+ | this.advancedAnimation.setHideEffect(b[this.jGallery.intId].hideEffect); | ||
+ | this.advancedAnimation.setShowEffect(b[this.jGallery.intId].showEffect) | ||
+ | }, | ||
+ | unmarkActive: function() { | ||
+ | this.$element.find("img.active").removeClass("active") | ||
+ | }, | ||
+ | changeMode: function() { | ||
+ | var B = b[this.jGallery.intId].mode; | ||
+ | if (B === "slider") { | ||
+ | return | ||
+ | } | ||
+ | if (B === "standard") { | ||
+ | this.goToFullScreenMode() | ||
+ | } else { | ||
+ | if (B === "full-screen") { | ||
+ | this.goToStandardMode() | ||
+ | } | ||
+ | } | ||
+ | if (this.jGallery.iconChangeAlbum instanceof o) { | ||
+ | this.jGallery.iconChangeAlbum.refreshMenuHeight() | ||
+ | } | ||
+ | }, | ||
+ | goToFullScreenMode: function() { | ||
+ | s.css({ | ||
+ | overflow: "hidden" | ||
+ | }); | ||
+ | this.jGallery.$this.show(); | ||
+ | this.jGallery.$element.removeClass("jgallery-standard").addClass("jgallery-full-screen").css({ | ||
+ | width: "auto", | ||
+ | height: "auto" | ||
+ | }); | ||
+ | this.$changeMode.removeClass("fa-expand").addClass("fa-compress"); | ||
+ | b[this.jGallery.intId].mode = "full-screen"; | ||
+ | this.jGallery.refreshDimensions() | ||
+ | }, | ||
+ | goToStandardMode: function() { | ||
+ | s.css({ | ||
+ | overflow: "visible" | ||
+ | }); | ||
+ | this.jGallery.$this.hide(); | ||
+ | this.jGallery.$element.removeClass("jgallery-full-screen").addClass("jgallery-standard").css({ | ||
+ | width: b[this.jGallery.intId].width, | ||
+ | height: b[this.jGallery.intId].height | ||
+ | }); | ||
+ | this.$changeMode.removeClass("fa-compress").addClass("fa-expand"); | ||
+ | b[this.jGallery.intId].mode = "standard"; | ||
+ | this.jGallery.refreshDimensions() | ||
+ | } | ||
+ | }; | ||
+ | var p = function(C) { | ||
+ | var B = this; | ||
+ | this.booIsAlbums = C.find(".album:has(a:has(img))").length > 1; | ||
+ | this.intId = c; | ||
+ | this.$this = C; | ||
+ | if (failand(b[this.intId].disabledOnIE8AndOlder, v())) { | ||
+ | return | ||
+ | } | ||
+ | this.init(); | ||
+ | if (b[this.intId].browserHistory) { | ||
+ | this.browserHistory() | ||
+ | } | ||
+ | if (b[this.intId].autostart) { | ||
+ | this.autostart() | ||
+ | } | ||
+ | g("html").on({ | ||
+ | keydown: function(D) { | ||
+ | if (B.$element.is(":visible")) { | ||
+ | if (D.which === 27) { | ||
+ | D.preventDefault(); | ||
+ | if (B.thumbnails.getElement().is(".full-screen")) { | ||
+ | B.thumbnails.changeViewToBar(); | ||
+ | B.zoom.refreshSize(); | ||
+ | return | ||
+ | } | ||
+ | B.hide() | ||
+ | } | ||
+ | if (D.which === 37) { | ||
+ | D.preventDefault(); | ||
+ | B.zoom.showPrevPhoto() | ||
+ | } | ||
+ | if (D.which === 39) { | ||
+ | D.preventDefault(); | ||
+ | B.zoom.showNextPhoto() | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }) | ||
+ | }; | ||
+ | p.prototype = { | ||
+ | initialized: function() { | ||
+ | return this.$this.is("[data-jgallery-id]") | ||
+ | }, | ||
+ | update: function(B) { | ||
+ | b[this.intId] = this.initialized() ? g.extend(b[this.intId], B) : g.extend({}, m, B); | ||
+ | if (failand(b[this.intId].disabledOnIE8AndOlder, z())) { | ||
+ | return | ||
+ | } | ||
+ | this.booIsAlbums = this.$this.find(".album:has(a:has(img))").length > 1; | ||
+ | if (b[this.intId].reloadThumbnails) { | ||
+ | this.reloadThumbnails() | ||
+ | } | ||
+ | this.zoom.update(); | ||
+ | this.thumbnails.init(); | ||
+ | this.setUserOptions() | ||
+ | }, | ||
+ | reloadThumbnails: function() { | ||
+ | new e(this, { | ||
+ | thumbsHidden: false | ||
+ | }); | ||
+ | this.thumbnails.reload(); | ||
+ | this.generateAlbumsDropdown() | ||
+ | }, | ||
+ | setVariables: function() { | ||
+ | this.$element = g(".jgallery").filter('[data-jgallery-id="' + this.intId + '"]'); | ||
+ | this.progress = new i(this.$element.find(".zoom-container").children(".progress"), this.intId); | ||
+ | this.zoom = new h(this); | ||
+ | this.thumbnails = new l(this); | ||
+ | this.zoom.setThumbnails(this.thumbnails) | ||
+ | }, | ||
+ | show: function() { | ||
+ | this.$this.hide(); | ||
+ | q.on("resize", { | ||
+ | jGallery: this | ||
+ | }, this.windowOnResize); | ||
+ | if (b[this.intId].mode === "full-screen") { | ||
+ | s.css({ | ||
+ | overflow: "hidden" | ||
+ | }) | ||
+ | } | ||
+ | this.$element.not(":visible").removeClass("hidden").stop(false, true).fadeIn(500); | ||
+ | this.zoom.refreshContainerSize(); | ||
+ | this.zoom.$title.removeClass("hidden"); | ||
+ | b[this.intId].showGallery(); | ||
+ | if (this.iconChangeAlbum instanceof o) { | ||
+ | this.iconChangeAlbum.refreshMenuHeight() | ||
+ | } | ||
+ | }, | ||
+ | hide: function(C) { | ||
+ | var B = this; | ||
+ | if (!b[this.intId].canClose) { | ||
+ | return | ||
+ | } | ||
+ | C = g.extend({}, { | ||
+ | historyPushState: true | ||
+ | }, C); | ||
+ | this.$element.filter(":visible").stop(false, true).addClass("hidden").fadeOut(500, function() { | ||
+ | if (b[B.intId].mode === "full-screen") { | ||
+ | s.css({ | ||
+ | overflow: "visible" | ||
+ | }) | ||
+ | } | ||
+ | }); | ||
+ | this.zoom.booLoadingInProgress = false; | ||
+ | clearTimeout(this.zoom.showPhotoTimeout); | ||
+ | this.zoom.$title.addClass("hidden"); | ||
+ | this.zoom.$btnPrev.addClass("hidden"); | ||
+ | this.zoom.$btnNext.addClass("hidden"); | ||
+ | this.zoom.slideshowPause(); | ||
+ | this.zoom.advancedAnimation.hideActive(); | ||
+ | this.zoom.unmarkActive(); | ||
+ | q.off("resize", this.windowOnResize); | ||
+ | this.$this.show(); | ||
+ | if (failand(C.historyPushState, b[this.intId].browserHistory)) { | ||
+ | u() | ||
+ | } | ||
+ | b[this.intId].closeGallery() | ||
+ | }, | ||
+ | autostart: function() { | ||
+ | var B; | ||
+ | var C; | ||
+ | if (this.$element.is(":visible")) { | ||
+ | return | ||
+ | } | ||
+ | if (this.booIsAlbums) { | ||
+ | B = this.thumbnails.getElement().find(".album").eq(b[this.intId].autostartAtAlbum - 1); | ||
+ | if (B.length === 0) { | ||
+ | B = this.thumbnails.getElement().find(".album").eq(0) | ||
+ | } | ||
+ | } else { | ||
+ | B = this.thumbnails.getElement() | ||
+ | } | ||
+ | C = B.find("a").eq(b[this.intId].autostartAtImage - 1); | ||
+ | if (C.length === 0) { | ||
+ | C = B.find("a").eq(0) | ||
+ | } | ||
+ | C.trigger("click") | ||
+ | }, | ||
+ | browserHistory: function() { | ||
+ | var B = this; | ||
+ | var D = window.onpopstate; | ||
+ | |||
+ | function C() { | ||
+ | var E; | ||
+ | if (!document.location.hash) { | ||
+ | return | ||
+ | } | ||
+ | E = document.location.hash.replace("#", ""); | ||
+ | switch (E) { | ||
+ | case "": | ||
+ | B.hide({ | ||
+ | historyPushState: false | ||
+ | }); | ||
+ | break; | ||
+ | default: | ||
+ | B.zoom.showPhotoByPath(E) | ||
+ | } | ||
+ | } | ||
+ | window.onpopstate = function() { | ||
+ | if (typeof D === "function") { | ||
+ | D() | ||
+ | } | ||
+ | C() | ||
+ | }; | ||
+ | C() | ||
+ | }, | ||
+ | generateAlbumsDropdown: function() { | ||
+ | var B = this; | ||
+ | this.$element.find(".change-album").remove(); | ||
+ | if (!this.booIsAlbums) { | ||
+ | return | ||
+ | } | ||
+ | this.zoom.$container.find(".nav-bottom > .icons").append(' <span class="fa fa-list-ul change-album jgallery-btn jgallery-btn-small"> <span class="menu jgallery-btn"></span> <span class="title"></span> </span> '); | ||
+ | this.iconChangeAlbum = new o(B.zoom.$container.find(".change-album"), this); | ||
+ | this.iconChangeAlbum.clearMenu(); | ||
+ | this.thumbnails.$albums.each(function() { | ||
+ | var C = g(this).attr("data-jgallery-album-title"); | ||
+ | B.iconChangeAlbum.appendToMenu('<span class="item" data-jgallery-album-title="' + C + '">' + C + "</span>") | ||
+ | }); | ||
+ | this.thumbnails.getElement().append(this.iconChangeAlbum.getElement().outerHtml()); | ||
+ | this.iconChangeAlbum = new o(this.iconChangeAlbum.getElement().add(this.thumbnails.getElement().children(":last-child")), this); | ||
+ | this.iconChangeAlbum.bindEvents(this) | ||
+ | }, | ||
+ | init: function() { | ||
+ | var B = this; | ||
+ | n.append('<style type="text/css" class="colours" data-jgallery-id="' + this.intId + '"></style>'); | ||
+ | b[this.intId].initGallery(); | ||
+ | this.$this.attr("data-jgallery-id", this.intId); | ||
+ | this.generateHtml(); | ||
+ | new e(this); | ||
+ | this.setVariables(); | ||
+ | this.thumbnails.init(); | ||
+ | this.thumbnails.getElement().append('<span class="fa fa-times jgallery-btn jgallery-close jgallery-btn-small"></span>'); | ||
+ | this.generateAlbumsDropdown(); | ||
+ | B.setUserOptions(); | ||
+ | if (b[B.intId].zoomSize === "fit" || b[B.intId].zoomSize === "original") { | ||
+ | B.zoom.$resize.addClass("fa-search-plus") | ||
+ | } | ||
+ | if (b[B.intId].zoomSize === "fill") { | ||
+ | B.zoom.$resize.addClass("fa-search-minus") | ||
+ | } | ||
+ | if (!k()) { | ||
+ | B.$element.addClass("text-shadow") | ||
+ | } | ||
+ | B.thumbnails.refreshNavigation(); | ||
+ | B.zoom.refreshNav(); | ||
+ | B.zoom.refreshSize(); | ||
+ | this.$this.on("click", "a:has(img)", function(C) { | ||
+ | var D = g(this); | ||
+ | C.preventDefault(); | ||
+ | B.zoom.showPhoto(D) | ||
+ | }); | ||
+ | B.thumbnails.$element.on("click", "a", function(C) { | ||
+ | var D = g(this); | ||
+ | C.preventDefault(); | ||
+ | if (D.is(":not(.active)")) { | ||
+ | B.zoom.slideshowStop(); | ||
+ | B.zoom.showPhoto(D) | ||
+ | } else { | ||
+ | if (B.thumbnails.isFullScreen()) { | ||
+ | B.thumbnails.changeViewToBar(); | ||
+ | B.zoom.refreshSize() | ||
+ | } | ||
+ | } | ||
+ | }); | ||
+ | B.zoom.$btnPrev.add(B.zoom.$container.find(".left")).on({ | ||
+ | click: function() { | ||
+ | B.zoom.slideshowStop(); | ||
+ | B.zoom.showPrevPhoto() | ||
+ | } | ||
+ | }); | ||
+ | B.zoom.$btnNext.add(B.zoom.$container.find(".right")).on({ | ||
+ | click: function() { | ||
+ | B.zoom.slideshowStop(); | ||
+ | B.zoom.showNextPhoto() | ||
+ | } | ||
+ | }); | ||
+ | B.zoom.$container.find(".jgallery-close").on({ | ||
+ | click: function() { | ||
+ | B.hide() | ||
+ | } | ||
+ | }); | ||
+ | B.zoom.$random.on({ | ||
+ | click: function() { | ||
+ | B.zoom.slideshowRandomToggle() | ||
+ | } | ||
+ | }); | ||
+ | B.zoom.$resize.on({ | ||
+ | click: function() { | ||
+ | B.zoom.changeSize(); | ||
+ | B.zoom.slideshowPause() | ||
+ | } | ||
+ | }); | ||
+ | B.zoom.$changeMode.on({ | ||
+ | click: function() { | ||
+ | B.zoom.changeMode() | ||
+ | } | ||
+ | }); | ||
+ | B.zoom.$slideshow.on({ | ||
+ | click: function() { | ||
+ | B.zoom.slideshowPlayPause() | ||
+ | } | ||
+ | }); | ||
+ | B.zoom.$container.find(".minimalize-thumbnails").on({ | ||
+ | click: function() { | ||
+ | B.thumbnails.toggle(); | ||
+ | B.zoom.refreshSize() | ||
+ | } | ||
+ | }); | ||
+ | B.thumbnails.bindEvents() | ||
+ | }, | ||
+ | isSlider: function() { | ||
+ | return b[this.intId].mode === "slider" | ||
+ | }, | ||
+ | windowOnResize: function(B) { | ||
+ | B.data.jGallery.refreshDimensions() | ||
+ | }, | ||
+ | refreshDimensions: function() { | ||
+ | this.zoom.refreshSize(); | ||
+ | if (this.iconChangeAlbum instanceof o) { | ||
+ | this.iconChangeAlbum.refreshMenuHeight() | ||
+ | } | ||
+ | this.thumbnails.refreshNavigation() | ||
+ | }, | ||
+ | getCanvasRatioWidthToHeight: function() { | ||
+ | var C; | ||
+ | var B; | ||
+ | if (this.thumbnails.isHorizontal()) { | ||
+ | C = this.$element.width(); | ||
+ | B = this.$element.height() - this.thumbnails.getElement().outerHeight(true) | ||
+ | } else { | ||
+ | if (this.thumbnails.isVertical()) { | ||
+ | C = this.$element.width() - this.thumbnails.getElement().outerWidth(true); | ||
+ | B = this.$element.height() | ||
+ | } else { | ||
+ | C = this.$element.width(); | ||
+ | B = this.$element.height() | ||
+ | } | ||
+ | } | ||
+ | return C / B | ||
+ | }, | ||
+ | setUserOptions: function() { | ||
+ | b[this.intId].canResize ? this.zoom.$resize.show() : this.zoom.$resize.hide(); | ||
+ | b[this.intId].canChangeMode ? this.zoom.$changeMode.show() : this.zoom.$changeMode.hide(); | ||
+ | b[this.intId].mode === "standard" ? this.zoom.$changeMode.removeClass("fa-compress").addClass("fa-expand") : this.zoom.$changeMode.removeClass("fa-expand").addClass("fa-compress"); | ||
+ | b[this.intId].canClose ? this.zoom.$container.find(".jgallery-close").show() : this.zoom.$container.find(".jgallery-close").hide(); | ||
+ | if (!b[this.intId].thumbnails) { | ||
+ | this.thumbnails.getElement().addClass("inactive"); | ||
+ | b[this.intId].thumbnailsPosition = "" | ||
+ | } else { | ||
+ | this.thumbnails.getElement().removeClass("inactive"); | ||
+ | if (b[this.intId].thumbnailsPosition === "") { | ||
+ | b[this.intId].thumbnailsPosition = m.thumbnailsPosition | ||
+ | } | ||
+ | } | ||
+ | b[this.intId].slideshow ? this.zoom.$slideshow.show() : this.zoom.$slideshow.hide(); | ||
+ | failand(b[this.intId].slideshow, b[this.intId].slideshowCanRandom, b[this.intId].slideshowAutostart) ? this.zoom.$random.show() : this.zoom.$random.hide(); | ||
+ | failand(b[this.intId].slideshow, b[this.intId].slideshowCanRandom, b[this.intId].slideshowRandom) ? this.zoom.$random.addClass("active") : this.zoom.$random.removeClass("active"); | ||
+ | failand(b[this.intId].thumbnailsFullScreen, b[this.intId].thumbnails) ? this.zoom.$container.find(".full-screen").show() : this.zoom.$container.find(".full-screen").hide(); | ||
+ | failand(b[this.intId].thumbnailsFullScreen, b[this.intId].thumbnails) ? this.zoom.$container.find(".change-album").show() : this.zoom.$container.find(".change-album").hide(); | ||
+ | failand(b[this.intId].canMinimalizeThumbnails, b[this.intId].thumbnails) ? this.zoom.$container.find(".minimalize-thumbnails").show() : this.zoom.$container.find(".minimalize-thumbnails").hide(); | ||
+ | failand(b[this.intId].hideThumbnailsOnInit, b[this.intId].thumbnails) ? this.thumbnails.hide() : this.thumbnails.show(); | ||
+ | b[this.intId].titleExpanded ? this.zoom.$title.addClass("expanded") : this.zoom.$title.removeClass("expanded"); | ||
+ | this.setColours({ | ||
+ | strBg: b[this.intId].backgroundColor, | ||
+ | strText: b[this.intId].textColor | ||
+ | }) | ||
+ | }, | ||
+ | setColours: function(B) { | ||
+ | n.find('style[data-jgallery-id="' + this.intId + '"].colours').html(this.getCssForColours(B)) | ||
+ | }, | ||
+ | generateHtml: function() { | ||
+ | var E = b[this.intId].mode; | ||
+ | var D = E === "full-screen" ? "auto" : b[this.intId].width; | ||
+ | var B = E === "full-screen" ? "auto" : b[this.intId].height; | ||
+ | var C = ' <div class="jgallery jgallery-' + E + '" style="width: ' + D + "; height: " + B + '; display: none;" data-jgallery-id="' + this.intId + '"> <div class="jgallery-thumbnails hidden"> <div class="jgallery-container"><div class="jgallery-container-inner"></div></div> <span class="prev jgallery-btn hidden"><span class="fa fa-chevron-left ico"></span></span> <span class="next jgallery-btn hidden"><span class="fa fa-chevron-right ico"></span></span> </div> <div class="zoom-container"> <div class="zoom before pt-perspective"></div> <div class="drag-nav hide"></div> <div class="left"></div> <div class="right"></div> <span class="fa fa-chevron-left prev jgallery-btn jgallery-btn-large"></span> <span class="fa fa-chevron-right next jgallery-btn jgallery-btn-large"></span> <span class="progress"></span> <div class="nav"> <span class="fa resize jgallery-btn jgallery-btn-small"></span> <span class="fa change-mode jgallery-btn jgallery-btn-small"></span> <span class="fa fa-times jgallery-close jgallery-btn jgallery-btn-small"></span> </div> <div class="nav-bottom"> <div class="icons"> <span class="fa fa-play slideshow jgallery-btn jgallery-btn-small"></span> <span class="fa fa-random random jgallery-btn jgallery-btn-small inactive" style="display: none;"></span> <span class="fa fa-th full-screen jgallery-btn jgallery-btn-small"></span> <span class="fa fa-ellipsis-h minimalize-thumbnails jgallery-btn jgallery-btn-small inactive"></span> </div> <div class="title before"></div> </div> </div> </div>'; | ||
+ | if (E === "full-screen") { | ||
+ | this.$jgallery = g(b[this.intId].appendTo).append(C).children(":last-child") | ||
+ | } else { | ||
+ | if (b[this.intId].autostart) { | ||
+ | this.$this.hide() | ||
+ | } | ||
+ | this.$jgallery = this.$this.after(C).next() | ||
+ | } | ||
+ | }, | ||
+ | getCssForColours: function(D) { | ||
+ | D = g.extend({ | ||
+ | strBg: "rgb( 0, 0, 0 )", | ||
+ | strText: "rgb( 255, 255, 255 )" | ||
+ | }, D); | ||
+ | var E = tinycolor(D.strBg).toRgb(); | ||
+ | var B = E.r + E.g + E.b > 375 ? tinycolor.darken(D.strBg).toRgb() : tinycolor.lighten(D.strBg).toRgb(); | ||
+ | var C = tinycolor(D.strText).toRgb(); | ||
+ | return ' .jgallery[data-jgallery-id="' + this.intId + '"] { background: rgb(' + E.r + "," + E.g + ", " + E.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-btn { color: rgb(' + C.r + "," + C.g + ", " + C.b + "); text-shadow: 0 0 1px rgb(" + E.r + "," + E.g + ", " + E.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-btn.active { color: rgb(' + C.r + "," + C.g + ", " + C.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-btn:hover { text-shadow: none; text-shadow: 0 0 .15em rgba(' + C.r + "," + C.g + ", " + C.b + ",.75), 0 0 .45em rgba(" + C.r + "," + C.g + ", " + C.b + ',.5); } .jgallery[data-jgallery-id="' + this.intId + '"] .change-album .menu { background: rgb(' + B.r + "," + B.g + ", " + B.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .zoom-container .nav-bottom .change-album > .title { background: rgb(' + B.r + "," + B.g + ", " + B.b + "); box-shadow: 4px 0 4px rgb(" + B.r + "," + B.g + ", " + B.b + ') } .jgallery[data-jgallery-id="' + this.intId + '"] .full-screen .change-album .menu { background: rgb(' + E.r + "," + E.g + ", " + E.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .change-album .menu .item { border-color: rgb(' + E.r + "," + E.g + ", " + E.b + "); color: rgb(" + C.r + "," + C.g + ", " + C.b + "); background: rgb(" + B.r + "," + B.g + ", " + B.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .full-screen .change-album .menu .item { border-color: rgb(' + B.r + "," + B.g + ", " + B.b + "); background: rgb(" + E.r + "," + E.g + ", " + E.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .change-album .menu .item.active, .jgallery[data-jgallery-id="' + this.intId + '"] .change-album .menu .item:hover { background: rgb(' + C.r + "," + C.g + ", " + C.b + "); color: rgb(" + E.r + "," + E.g + ", " + E.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .zoom-container:not([data-size="fill"]) .jgallery-container { background: rgb(' + E.r + "," + E.g + ", " + E.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .zoom-container .nav-bottom { background: rgb(' + B.r + "," + B.g + ", " + B.b + "); -webkit-box-shadow: 0 -3px rgba(" + B.r + "," + B.g + ", " + B.b + ", .5); box-shadow: 0 -3px rgba(" + B.r + "," + B.g + ", " + B.b + ', .5); } .jgallery[data-jgallery-id="' + this.intId + '"] .zoom-container .nav-bottom .icons, .jgallery[data-jgallery-id="' + this.intId + '"] .zoom-container .nav-bottom .icons .fa { background: rgb(' + B.r + "," + B.g + ", " + B.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .zoom-container .nav-bottom > .title { color: rgb(' + C.r + "," + C.g + ", " + C.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .zoom-container .nav-bottom > .title.expanded { background: rgba(' + E.r + "," + E.g + ", " + E.b + ',.7); } .jgallery[data-jgallery-id="' + this.intId + '"] .zoom-container .drag-nav { background: rgb(' + B.r + "," + B.g + ", " + B.b + "); -webkit-box-shadow: 0 0 0 3px rgba(" + B.r + "," + B.g + ", " + B.b + ", .5); box-shadow: 0 0 0 3px rgba(" + B.r + "," + B.g + ", " + B.b + ', .5); } .jgallery[data-jgallery-id="' + this.intId + '"] .zoom-container .drag-nav .crop { -webkit-box-shadow: 0 0 0 3px rgba(' + C.r + "," + C.g + ", " + C.b + ", .5); box-shadow: 0 0 0 3px rgba(" + C.r + "," + C.g + ", " + C.b + ', .5); } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-thumbnails { background: rgb(' + B.r + "," + B.g + ", " + B.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-thumbnails .ico { color: rgb(' + C.r + "," + C.g + ", " + C.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-thumbnails .jgallery-container { -webkit-box-shadow: 0 0 0 3px rgba(' + B.r + "," + B.g + ", " + B.b + ", .5); box-shadow: 0 0 0 3px rgba(" + B.r + "," + B.g + ", " + B.b + ', .5); } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-thumbnails.full-screen .prev:before { background-image: -webkit-gradient(linear,left 0%,left 100%,from(rgba( ' + B.r + "," + B.g + ", " + B.b + ", 1 )),to(rgba( " + B.r + "," + B.g + ", " + B.b + ", 0))); background-image: -webkit-linear-gradient(top,rgba( " + B.r + "," + B.g + ", " + B.b + ", 1 ),0%,rgba( " + B.r + "," + B.g + ", " + B.b + ", 0),100%); background-image: -moz-linear-gradient(top,rgba( " + B.r + "," + B.g + ", " + B.b + ", 1 ) 0%,rgba( " + B.r + "," + B.g + ", " + B.b + ", 0) 100%); background-image: linear-gradient(to bottom,rgba( " + B.r + "," + B.g + ", " + B.b + ", 1 ) 0%,rgba( " + B.r + "," + B.g + ", " + B.b + ', 0) 100%); background-repeat: repeat-x; } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-thumbnails.full-screen .next:before { background-image: -webkit-gradient(linear,left 0%,left 100%,from(rgba( ' + B.r + "," + B.g + ", " + B.b + ", 0)),to(rgba( " + B.r + "," + B.g + ", " + B.b + ", 1))); background-image: -webkit-linear-gradient(top,rgba( " + B.r + "," + B.g + ", " + B.b + ", 0),0%,rgba( " + B.r + "," + B.g + ", " + B.b + ", 1),100%); background-image: -moz-linear-gradient(top,rgba( " + B.r + "," + B.g + ", " + B.b + ", 0) 0%,rgba( " + B.r + "," + B.g + ", " + B.b + ", 1) 100%); background-image: linear-gradient(to bottom,rgba( " + B.r + "," + B.g + ", " + B.b + ", 0) 0%,rgba( " + B.r + "," + B.g + ", " + B.b + ', 1) 100%); background-repeat: repeat-x; } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-thumbnails.images a:after { background: rgb(' + B.r + "," + B.g + ", " + B.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-thumbnails.full-screen .prev, .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-thumbnails.full-screen .next { background: rgb(' + B.r + "," + B.g + ", " + B.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-thumbnails.square a { background: rgb(' + C.r + "," + C.g + ", " + C.b + "); color: rgb(" + E.r + "," + E.g + ", " + E.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .overlayContainer .overlay { background: rgba(' + E.r + "," + E.g + ", " + E.b + ",.8); color: rgb(" + C.r + "," + C.g + ", " + C.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .overlayContainer .imageLoaderPositionAbsolute:after { border-color: rgba(' + C.r + "," + C.g + ", " + C.b + ', .5 ); } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-thumbnails-horizontal .prev { background: rgb(' + B.r + "," + B.g + ", " + B.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-thumbnails-horizontal .prev:before { background-image: -webkit-gradient(linear,0% top,100% top,from(rgba( ' + B.r + "," + B.g + ", " + B.b + ", 1 )),to(rgba( " + B.r + "," + B.g + ", " + B.b + ", 0 ))); background-image: -webkit-linear-gradient(left,color-stop(rgba( " + B.r + "," + B.g + ", " + B.b + ", 1 ) 0%),color-stop(rgba( " + B.r + "," + B.g + ", " + B.b + ", 0 ) 100%)); background-image: -moz-linear-gradient(left,rgba( " + B.r + "," + B.g + ", " + B.b + ", 1 ) 0%,rgba( " + B.r + "," + B.g + ", " + B.b + ", 0 ) 100%); background-image: linear-gradient(to right,rgba( " + B.r + "," + B.g + ", " + B.b + ", 1 ) 0%,rgba( " + B.r + "," + B.g + ", " + B.b + ', 0 ) 100%); background-repeat: repeat-x; } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-thumbnails-horizontal .next { background: rgb(' + B.r + "," + B.g + ", " + B.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-thumbnails-horizontal .next:before { background-image: -webkit-gradient(linear,0% top,100% top,from(rgba( ' + B.r + "," + B.g + ", " + B.b + ", 0 )),to(rgba( " + B.r + "," + B.g + ", " + B.b + ", 1 ))); background-image: -webkit-linear-gradient(left,color-stop(rgba( " + B.r + "," + B.g + ", " + B.b + ", 0 ) 0%),color-stop(rgba( " + B.r + "," + B.g + ", " + B.b + ", 1 ) 100%)); background-image: -moz-linear-gradient(left,rgba( " + B.r + "," + B.g + ", " + B.b + ", 0 ) 0%,rgba( " + B.r + "," + B.g + ", " + B.b + ", 1 ) 100%); background-image: linear-gradient(to right,rgba( " + B.r + "," + B.g + ", " + B.b + ", 0 ) 0%,rgba( " + B.r + "," + B.g + ", " + B.b + ', 1 ) 100%); background-repeat: repeat-x; } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-thumbnails-vertical .prev { background: rgb(' + B.r + "," + B.g + ", " + B.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-thumbnails-vertical .prev:before { background-image: -webkit-gradient(linear,left 0%,left 100%,from(rgba( ' + B.r + "," + B.g + ", " + B.b + ", 1 )),to(rgba( " + B.r + "," + B.g + ", " + B.b + ", 0 ))); background-image: -webkit-linear-gradient(top,rgba( " + B.r + "," + B.g + ", " + B.b + ", 1 ),0%,rgba( " + B.r + "," + B.g + ", " + B.b + ", 0 ),100%); background-image: -moz-linear-gradient(top,rgba( " + B.r + "," + B.g + ", " + B.b + ", 1 ) 0%,rgba( " + B.r + "," + B.g + ", " + B.b + ", 0 ) 100%); background-image: linear-gradient(to bottom,rgba( " + B.r + "," + B.g + ", " + B.b + ", 1 ) 0%,rgba( " + B.r + "," + B.g + ", " + B.b + ', 0 ) 100%); background-repeat: repeat-x; } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-thumbnails-vertical .next { background: rgb(' + B.r + "," + B.g + ", " + B.b + '); } .jgallery[data-jgallery-id="' + this.intId + '"] .jgallery-thumbnails-vertical .next:before { background-image: -webkit-gradient(linear,left 0%,left 100%,from(rgba( ' + B.r + "," + B.g + ", " + B.b + ", 0 )),to(rgba( " + B.r + "," + B.g + ", " + B.b + ", 1 ))); background-image: -webkit-linear-gradient(top,rgba( " + B.r + "," + B.g + ", " + B.b + ", 0 ),0%,rgba( " + B.r + "," + B.g + ", " + B.b + ", 1 ),100%); background-image: -moz-linear-gradient(top,rgba( " + B.r + "," + B.g + ", " + B.b + ", 0 ) 0%,rgba( " + B.r + "," + B.g + ", " + B.b + ", 1 ) 100%); background-image: linear-gradient(to bottom,rgba( " + B.r + "," + B.g + ", " + B.b + ", 0 ) 0%,rgba( " + B.r + "," + B.g + ", " + B.b + ', 1 ) 100%); background-repeat: repeat-x; } .jgallery.has-title.jgallery-slider[data-jgallery-id="' + this.intId + '"] .zoom-container .nav-bottom, .jgallery.has-title.jgallery-slider[data-jgallery-id="' + this.intId + '"] .zoom-container .nav-bottom > .title.expanded { background: rgba(' + E.r + "," + E.g + ", " + E.b + ",.7); color: rgb(" + C.r + "," + C.g + ", " + C.b + '); } .jgallery.jgallery-slider[data-jgallery-id="' + this.intId + '"] .zoom-container .nav-bottom .jgallery-btn { background: rgba(' + E.r + "," + E.g + ", " + E.b + ",.8); color: rgb(" + C.r + "," + C.g + ", " + C.b + "); } " | ||
+ | } | ||
+ | }; | ||
+ | g.fn.jGallery = function(B) { | ||
+ | return this.each(function() { | ||
+ | var C = g(this); | ||
+ | g(function() { | ||
+ | var D = false; | ||
+ | if (typeof B !== "undefined") { | ||
+ | if (typeof B.mode !== "undefined") { | ||
+ | D = true; | ||
+ | } | ||
+ | } | ||
+ | var E = m; | ||
+ | if (failand(C.is("[data-jgallery-id]"), D)) { | ||
+ | delete B.mode; | ||
+ | D = false | ||
+ | } | ||
+ | if (C.is("[data-jgallery-id]")) { | ||
+ | E = b[C.attr("data-jgallery-id")] | ||
+ | } | ||
+ | if (failand(D, B.mode === "standard")) { | ||
+ | E = g.extend({}, E, j, B, f) | ||
+ | } else { | ||
+ | if (failand(D, B.mode === "slider")) { | ||
+ | E = g.extend({}, E, A, B, a) | ||
+ | } else { | ||
+ | E = g.extend({}, E, B) | ||
+ | } | ||
+ | } | ||
+ | if (!C.is("[data-jgallery-id]")) { | ||
+ | b[++c] = E; | ||
+ | y[c] = new p(C) | ||
+ | } else { | ||
+ | y[C.attr("data-jgallery-id")].update(E); | ||
+ | b[C.attr("data-jgallery-id")] = E | ||
+ | } | ||
+ | }) | ||
+ | }) | ||
+ | }; | ||
+ | g.jGalleryOptions = function() { | ||
+ | return b | ||
+ | }; | ||
+ | g.jGalleryTransitions = function() { | ||
+ | return w | ||
+ | }; | ||
+ | var t = 0; | ||
+ | var d = function(B) { | ||
+ | if (B.is("[data-advanced-animation-id]")) { | ||
+ | return | ||
+ | } | ||
+ | this.cols = 1; | ||
+ | this.rows = 1; | ||
+ | this.direction = "forward"; | ||
+ | this.animation = true; | ||
+ | this.$element = B; | ||
+ | this.$element.filter(":not( [data-advanced-animation-id] )").attr("data-advanced-animation-id", ++t); | ||
+ | this.$element.find(".pt-item").wrap('<div class="pt-page" />'); | ||
+ | this.$element.wrapInner('<div class="pt-part" />'); | ||
+ | this.generateHtml(); | ||
+ | this._showParts(this.$element.find(".pt-part"), 1) | ||
+ | }; | ||
+ | d.prototype = { | ||
+ | next: function() { | ||
+ | var B = this.$element.find(".pt-part").eq(this.direction === "backward" ? -1 : 0).find(".pt-page-current:not(.pt-page-prev)").next(); | ||
+ | if (B.length) { | ||
+ | this.show(B) | ||
+ | } else { | ||
+ | this.show(this.$element.find(".pt-part").eq(this.direction === "backward" ? -1 : 0).find(".pt-page").eq(0)) | ||
+ | } | ||
+ | }, | ||
+ | show: function(C, B) { | ||
+ | var D = C.prevAll().length + 1; | ||
+ | if (C.is(".pt-page-current:not(.pt-page-prev)")) { | ||
+ | return | ||
+ | } | ||
+ | B = g.extend({}, { | ||
+ | animation: true | ||
+ | }, B); | ||
+ | this.animation = B.animation; | ||
+ | this._waveJumpToEnd(); | ||
+ | if (this.animation) { | ||
+ | this._runWave(D) | ||
+ | } else { | ||
+ | this._showParts(this.$element.find(".pt-part"), D) | ||
+ | } | ||
+ | this.intPrevPtPageNumber = D | ||
+ | }, | ||
+ | setQuantityParts: function(C, B) { | ||
+ | this.cols = C; | ||
+ | this.rows = B; | ||
+ | this.generateHtml() | ||
+ | }, | ||
+ | setDuration: function(D) { | ||
+ | var C = this.$element.attr("data-advanced-animation-id"); | ||
+ | var B = n.find('style[data-advanced-animation-id="' + C + '"]'); | ||
+ | this.duration = D; | ||
+ | if (v()) { | ||
+ | return | ||
+ | } | ||
+ | if (B.length === 0) { | ||
+ | B = n.append('<style type="text/css" data-advanced-animation-id="' + C + '" />').children(":last-child") | ||
+ | } | ||
+ | B.html(' [data-advanced-animation-id="' + C + '"] .pt-page { -webkit-animation-duration: ' + D + "; -moz-animation-duration: " + D + "; animation-duration: " + D + "; } ") | ||
+ | }, | ||
+ | setHideEffect: function(B) { | ||
+ | this.prevHideEffect = this.hideEffect; | ||
+ | this.hideEffect = B; | ||
+ | if (/moveTo|rotateRoom|rotateCarousel|rotateSlideOut/.test(B)) { | ||
+ | this.$element.find(".pt-part").addClass("hide-overflow") | ||
+ | } else { | ||
+ | this.$element.find(".pt-part").removeClass("hide-overflow") | ||
+ | } | ||
+ | }, | ||
+ | setShowEffect: function(B) { | ||
+ | this.prevShowEffect = this.showEffect; | ||
+ | this.showEffect = B | ||
+ | }, | ||
+ | setDirection: function(B) { | ||
+ | this.direction = B | ||
+ | }, | ||
+ | _runWave: function(B) { | ||
+ | this.$element.find(".pt-part").addClass("in-queue"); | ||
+ | this._showNextPart(B) | ||
+ | }, | ||
+ | _waveJumpToEnd: function() { | ||
+ | clearTimeout(this.showPartsTimeout); | ||
+ | if (typeof this.intPrevPtPageNumber !== "undefined") { | ||
+ | this._showParts(this.$element.find(".pt-part.in-queue").removeClass("in-queue"), this.intPrevPtPageNumber) | ||
+ | } | ||
+ | }, | ||
+ | _showNextPart: function(C) { | ||
+ | var B = this; | ||
+ | var D = this.$element.find(".pt-part.in-queue").eq(this.direction === "backward" ? -1 : 0); | ||
+ | if (D.length === 0) { | ||
+ | return | ||
+ | } | ||
+ | this._showParts(D.removeClass("in-queue"), C); | ||
+ | if (D.length === 0) { | ||
+ | return | ||
+ | } | ||
+ | clearTimeout(this.showPartsTimeout); | ||
+ | this.showPartsTimeout = setTimeout(function() { | ||
+ | B._showNextPart(C) | ||
+ | }, parseFloat(this.duration) * 1000 * 0.25 / Math.max(1, this.$element.find(".pt-part").length - 1)) | ||
+ | }, | ||
+ | _showParts: function(C, B) { | ||
+ | C.find(".pt-page-current.pt-page-prev").removeClass("pt-page-prev").removeClass("pt-page-current"); | ||
+ | C.find(".pt-page-current").addClass("pt-page-prev"); | ||
+ | C.find(".pt-page:nth-child(" + B + ")").addClass("pt-page-current"); | ||
+ | C.find(".pt-page").removeClass(this.hideEffect).removeClass(this.showEffect); | ||
+ | if (typeof this.prevHideEffect !== "undefined") { | ||
+ | C.find(".pt-page").removeClass(this.prevHideEffect) | ||
+ | } | ||
+ | if (typeof this.prevShowEffect !== "undefined") { | ||
+ | C.find(".pt-page").removeClass(this.prevShowEffect) | ||
+ | } | ||
+ | if (this.animation) { | ||
+ | C.find(".pt-page-prev").addClass(this.hideEffect); | ||
+ | C.find(".pt-page-current:not(.pt-page-prev)").addClass(this.showEffect) | ||
+ | } | ||
+ | }, | ||
+ | hideActive: function() { | ||
+ | this.$element.find(".pt-page-current").addClass("pt-page-prev").addClass(this.hideEffect) | ||
+ | }, | ||
+ | generateHtml: function() { | ||
+ | var D; | ||
+ | var C; | ||
+ | var B; | ||
+ | this.$element.html(this.$element.find(".pt-part").eq(0).html()); | ||
+ | B = this.$element.html(); | ||
+ | this.$element.children(".pt-part").remove(); | ||
+ | for (C = 0; C < this.rows; C++) { | ||
+ | for (D = 0; D < this.cols; D++) { | ||
+ | this.$element.append('<div class="pt-part pt-perspective" data-col-no="' + D + '" data-row-no="' + C + '" style="position: absolute;"></div>').children(":last-child").html(B).find(".pt-item") | ||
+ | } | ||
+ | } | ||
+ | this.setPositionParts(); | ||
+ | this.$element.children(":not(.pt-part)").remove() | ||
+ | }, | ||
+ | setPositionParts: function() { | ||
+ | var C = this; | ||
+ | var E = this.$element.outerWidth(); | ||
+ | var D = this.$element.outerHeight(); | ||
+ | var F = E / this.cols; | ||
+ | var B = D / this.rows; | ||
+ | this.$element.find(".pt-part").each(function() { | ||
+ | var I = g(this); | ||
+ | var H = I.attr("data-col-no"); | ||
+ | var G = I.attr("data-row-no"); | ||
+ | I.css({ | ||
+ | left: C.$element.outerWidth() * (100 / C.cols * H) / 100 + "px", | ||
+ | top: C.$element.outerHeight() * (100 / C.rows * G) / 100 + "px", | ||
+ | width: C.$element.outerWidth() * (100 / C.cols) / 100 + 1 + "px", | ||
+ | height: C.$element.outerHeight() * (100 / C.rows) / 100 + 1 + "px" | ||
+ | }).find(".pt-item").css({ | ||
+ | width: E, | ||
+ | height: D, | ||
+ | left: -F * H, | ||
+ | top: -B * G | ||
+ | }) | ||
+ | }) | ||
+ | } | ||
+ | }; | ||
+ | g.fn.overlay = function(B) { | ||
+ | var C = { | ||
+ | show: false, | ||
+ | hide: false, | ||
+ | showLoader: false, | ||
+ | hideLoader: false, | ||
+ | fadeIn: true, | ||
+ | fadeOut: true, | ||
+ | fadeInLoader: true, | ||
+ | fadeOutLoader: true, | ||
+ | afterInit: function() {} | ||
+ | }; | ||
+ | B = g.extend({}, C, B); | ||
+ | this.each(function() { | ||
+ | var K = g(this), | ||
+ | L, J, I = K.is(".overlayContainer:has(.overlay)"), | ||
+ | H = function() { | ||
+ | var P = Math.max(K.offset().top, g("body, html").scrollTop()), | ||
+ | O = Math.min(K.offset().top + K.outerHeight(), g("body, html").scrollTop() + g(window).height()), | ||
+ | N = P + (O - P) / 2 - K.offset().top; | ||
+ | J.css({ | ||
+ | top: N + "px" | ||
+ | }) | ||
+ | }, | ||
+ | F = function() { | ||
+ | K.children(".overlay").css({ | ||
+ | width: K.outerWidth(), | ||
+ | height: K.is("body") ? g("html").outerHeight() : K.outerHeight() | ||
+ | }) | ||
+ | }, | ||
+ | G = function() { | ||
+ | B.fadeIn ? L.fadeIn(500) : L.show() | ||
+ | }, | ||
+ | E = function() { | ||
+ | B.fadeOut ? L.fadeOut(500) : L.hide() | ||
+ | }, | ||
+ | M = function() { | ||
+ | B.fadeInLoader ? J.not(":visible").fadeIn(500) : J.not(":visible").show() | ||
+ | }, | ||
+ | D = function() { | ||
+ | B.fadeOutLoader ? J.filter(":visible").fadeOut(500) : J.filter(":visible").hide() | ||
+ | }; | ||
+ | g(window).scroll(function() { | ||
+ | H() | ||
+ | }); | ||
+ | g(window).resize(function() { | ||
+ | H(); | ||
+ | F() | ||
+ | }); | ||
+ | if (K.is("table")) { | ||
+ | if (K.parent().is(".overlayContainer")) { | ||
+ | K = K.parent() | ||
+ | } | ||
+ | } | ||
+ | if (!I) { | ||
+ | if (K.is("table")) { | ||
+ | K.wrap("<div></div>"); | ||
+ | K = K.parent() | ||
+ | } | ||
+ | K.addClass("overlayContainer"); | ||
+ | K.append('<div class="overlay" style="display: none;"><div class="imageLoaderPositionAbsolute" style="display: none;"></div></div>'); | ||
+ | B.afterInit() | ||
+ | } | ||
+ | L = K.children(".overlay"); | ||
+ | J = K.find(".imageLoaderPositionAbsolute"); | ||
+ | L.stop(false, true); | ||
+ | J.stop(false, true); | ||
+ | if (B.show) { | ||
+ | G() | ||
+ | } else { | ||
+ | if (B.hide) { | ||
+ | E() | ||
+ | } | ||
+ | } | ||
+ | if (B.showLoader) { | ||
+ | M() | ||
+ | } else { | ||
+ | if (B.hideLoader) { | ||
+ | D() | ||
+ | } | ||
+ | } | ||
+ | H(); | ||
+ | F() | ||
+ | }) | ||
+ | }; | ||
+ | g.fn.jLoader = function(B) { | ||
+ | B = g.extend({ | ||
+ | interval: 1000, | ||
+ | skip: ":not(*)", | ||
+ | start: function() { | ||
+ | g("body").overlay({ | ||
+ | fadeIn: false, | ||
+ | fadeOut: false, | ||
+ | show: true, | ||
+ | showLoader: true | ||
+ | }); | ||
+ | g("body").show() | ||
+ | }, | ||
+ | success: function() { | ||
+ | g("body").overlay({ | ||
+ | hide: true | ||
+ | }) | ||
+ | }, | ||
+ | progress: function() {} | ||
+ | }, B); | ||
+ | this.each(function() { | ||
+ | var H = g(this); | ||
+ | var F = g(); | ||
+ | var D = g(); | ||
+ | var G; | ||
+ | var E = 0; | ||
+ | |||
+ | function C() { | ||
+ | var J = true; | ||
+ | var L = 0; | ||
+ | var I = 0; | ||
+ | var K; | ||
+ | D.each(function() { | ||
+ | L++; | ||
+ | if (g(this)[0].complete) { | ||
+ | I++ | ||
+ | } else { | ||
+ | J = false | ||
+ | } | ||
+ | if (L === E) { | ||
+ | K = parseInt(I * 100 / E); | ||
+ | B.progress({ | ||
+ | percent: K | ||
+ | }); | ||
+ | if (J) { | ||
+ | clearTimeout(G); | ||
+ | F.remove(); | ||
+ | B.success() | ||
+ | } else { | ||
+ | G = setTimeout(C, B.interval) | ||
+ | } | ||
+ | } | ||
+ | }) | ||
+ | } | ||
+ | H.append('<div class="jLoaderTmp" style="position: absolute; width: 0; height: 0; line-height: 0; font-size: 0; visibility: hidden; overflow: hidden; z-index: -1;"></div>'); | ||
+ | F = H.children(".jLoaderTmp:last-child"); | ||
+ | g(H).add(H.find("*")).not(B.skip).each(function() { | ||
+ | var I; | ||
+ | if (g(this).css("background-image") !== "none") { | ||
+ | I = g(this).css("background-image"); | ||
+ | if (/url/.exec(I)) { | ||
+ | I = I.replace('"', "").replace("'", "").replace(" ", "").replace("url(", "").replace(")", ""); | ||
+ | F.append('<img src="' + I + '">') | ||
+ | } | ||
+ | } | ||
+ | }); | ||
+ | D = H.find("img:not( " + B.skip + ")"); | ||
+ | if (H.is("img")) { | ||
+ | if (!H.is(B.skip)) { | ||
+ | D = D.add(H) | ||
+ | } | ||
+ | } | ||
+ | E = parseInt(D.length); | ||
+ | B.start(); | ||
+ | C() | ||
+ | }) | ||
+ | }; | ||
+ | g.fn.outerHtml = function() { | ||
+ | return (!this.length) ? this : (this[0].outerHTML || (function(B) { | ||
+ | var D = document.createElement("div"); | ||
+ | D.appendChild(B.cloneNode(true)); | ||
+ | var C = D.innerHTML; | ||
+ | D = null; | ||
+ | return C | ||
+ | })(this[0])) | ||
+ | }; | ||
+ | |||
+ | function u(B) { | ||
+ | B = g.extend({}, { | ||
+ | stateObj: {}, | ||
+ | title: r.html(), | ||
+ | path: "" | ||
+ | }, B); | ||
+ | console.log(document.location.href.split("#")[0] + "#" + B.path); | ||
+ | window.history.pushState(B.stateObj, B.title, document.location.href.split("#")[0] + "#" + B.path) | ||
+ | } | ||
+ | |||
+ | function k() { | ||
+ | var D = false; | ||
+ | if (navigator.appName === "Microsoft Internet Explorer") { | ||
+ | var B = navigator.userAgent; | ||
+ | var C = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})"); | ||
+ | if (C.exec(B) !== null) { | ||
+ | D = true | ||
+ | } | ||
+ | } | ||
+ | return D | ||
+ | } | ||
+ | |||
+ | function z() { | ||
+ | var D = false; | ||
+ | if (navigator.appName === "Microsoft Internet Explorer") { | ||
+ | var B = navigator.userAgent; | ||
+ | var C = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})"); | ||
+ | if (C.exec(B) !== null) { | ||
+ | D = parseFloat(RegExp.$1); | ||
+ | D = D < 8 | ||
+ | } | ||
+ | } | ||
+ | return D | ||
+ | } | ||
+ | |||
+ | function v() { | ||
+ | var D = false; | ||
+ | if (navigator.appName === "Microsoft Internet Explorer") { | ||
+ | var B = navigator.userAgent; | ||
+ | var C = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})"); | ||
+ | if (C.exec(B) !== null) { | ||
+ | D = parseFloat(RegExp.$1); | ||
+ | D = D < 9 | ||
+ | } | ||
+ | } | ||
+ | return D | ||
+ | } | ||
+ | })(jQuery); | ||
</script> | </script> | ||
+ | --> | ||
</html> | </html> |
Latest revision as of 09:54, 17 October 2014