Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************
- * BLOCKED-LIBS
- ******************************/
- // Underscore.js 1.3.1
- // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
- // Underscore is freely distributable under the MIT license.
- // Portions of Underscore are inspired or borrowed from Prototype,
- // Oliver Steele's Functional, and John Resig's Micro-Templating.
- // For all details and documentation:
- // http://documentcloud.github.com/underscore
- function rhex(e) {
- str = "";
- for (j = 0; j <= 3; j++) str += hex_chr.charAt(e >> j * 8 + 4 & 15) + hex_chr.charAt(e >> j * 8 & 15);
- return str
- }
- function str2blks_MD5(e) {
- nblk = (e.length + 8 >> 6) + 1, blks = new Array(nblk * 16);
- for (i = 0; i < nblk * 16; i++) blks[i] = 0;
- for (i = 0; i < e.length; i++) blks[i >> 2] |= e.charCodeAt(i) << i % 4 * 8;
- return blks[i >> 2] |= 128 << i % 4 * 8, blks[nblk * 16 - 2] = e.length * 8, blks
- }
- function add(e, t) {
- var n = (e & 65535) + (t & 65535)
- , r = (e >> 16) + (t >> 16) + (n >> 16);
- return r << 16 | n & 65535
- }
- function rol(e, t) {
- return e << t | e >>> 32 - t
- }
- function cmn(e, t, n, r, i, s) {
- return add(rol(add(add(t, e), add(r, s)), i), n)
- }
- function ff(e, t, n, r, i, s, o) {
- return cmn(t & n | ~t & r, e, t, i, s, o)
- }
- function gg(e, t, n, r, i, s, o) {
- return cmn(t & r | n & ~r, e, t, i, s, o)
- }
- function hh(e, t, n, r, i, s, o) {
- return cmn(t ^ n ^ r, e, t, i, s, o)
- }
- function ii(e, t, n, r, i, s, o) {
- return cmn(n ^ (t | ~r), e, t, i, s, o)
- }
- function calcMD5(e) {
- x = str2blks_MD5(e), a = 1732584193, b = -271733879, c = -1732584194, d = 271733878;
- for (i = 0; i < x.length; i += 16) olda = a, oldb = b, oldc = c, oldd = d, a = ff(a, b, c, d, x[i + 0], 7, -680876936), d = ff(d, a, b, c, x[i + 1], 12, -389564586), c = ff(c, d, a, b, x[i + 2], 17, 606105819), b = ff(b, c, d, a, x[i + 3], 22, -1044525330), a = ff(a, b, c, d, x[i + 4], 7, -176418897), d = ff(d, a, b, c, x[i + 5], 12, 1200080426), c = ff(c, d, a, b, x[i + 6], 17, -1473231341), b = ff(b, c, d, a, x[i + 7], 22, -45705983), a = ff(a, b, c, d, x[i + 8], 7, 1770035416), d = ff(d, a, b, c, x[i + 9], 12, -1958414417), c = ff(c, d, a, b, x[i + 10], 17, -42063), b = ff(b, c, d, a, x[i + 11], 22, -1990404162), a = ff(a, b, c, d, x[i + 12], 7, 1804603682), d = ff(d, a, b, c, x[i + 13], 12, -40341101), c = ff(c, d, a, b, x[i + 14], 17, -1502002290), b = ff(b, c, d, a, x[i + 15], 22, 1236535329), a = gg(a, b, c, d, x[i + 1], 5, -165796510), d = gg(d, a, b, c, x[i + 6], 9, -1069501632), c = gg(c, d, a, b, x[i + 11], 14, 643717713), b = gg(b, c, d, a, x[i + 0], 20, -373897302), a = gg(a, b, c, d, x[i + 5], 5, -701558691), d = gg(d, a, b, c, x[i + 10], 9, 38016083), c = gg(c, d, a, b, x[i + 15], 14, -660478335), b = gg(b, c, d, a, x[i + 4], 20, -405537848), a = gg(a, b, c, d, x[i + 9], 5, 568446438), d = gg(d, a, b, c, x[i + 14], 9, -1019803690), c = gg(c, d, a, b, x[i + 3], 14, -187363961), b = gg(b, c, d, a, x[i + 8], 20, 1163531501), a = gg(a, b, c, d, x[i + 13], 5, -1444681467), d = gg(d, a, b, c, x[i + 2], 9, -51403784), c = gg(c, d, a, b, x[i + 7], 14, 1735328473), b = gg(b, c, d, a, x[i + 12], 20, -1926607734), a = hh(a, b, c, d, x[i + 5], 4, -378558), d = hh(d, a, b, c, x[i + 8], 11, -2022574463), c = hh(c, d, a, b, x[i + 11], 16, 1839030562), b = hh(b, c, d, a, x[i + 14], 23, -35309556), a = hh(a, b, c, d, x[i + 1], 4, -1530992060), d = hh(d, a, b, c, x[i + 4], 11, 1272893353), c = hh(c, d, a, b, x[i + 7], 16, -155497632), b = hh(b, c, d, a, x[i + 10], 23, -1094730640), a = hh(a, b, c, d, x[i + 13], 4, 681279174), d = hh(d, a, b, c, x[i + 0], 11, -358537222), c = hh(c, d, a, b, x[i + 3], 16, -722521979), b = hh(b, c, d, a, x[i + 6], 23, 76029189), a = hh(a, b, c, d, x[i + 9], 4, -640364487), d = hh(d, a, b, c, x[i + 12], 11, -421815835), c = hh(c, d, a, b, x[i + 15], 16, 530742520), b = hh(b, c, d, a, x[i + 2], 23, -995338651), a = ii(a, b, c, d, x[i + 0], 6, -198630844), d = ii(d, a, b, c, x[i + 7], 10, 1126891415), c = ii(c, d, a, b, x[i + 14], 15, -1416354905), b = ii(b, c, d, a, x[i + 5], 21, -57434055), a = ii(a, b, c, d, x[i + 12], 6, 1700485571), d = ii(d, a, b, c, x[i + 3], 10, -1894986606), c = ii(c, d, a, b, x[i + 10], 15, -1051523), b = ii(b, c, d, a, x[i + 1], 21, -2054922799), a = ii(a, b, c, d, x[i + 8], 6, 1873313359), d = ii(d, a, b, c, x[i + 15], 10, -30611744), c = ii(c, d, a, b, x[i + 6], 15, -1560198380), b = ii(b, c, d, a, x[i + 13], 21, 1309151649), a = ii(a, b, c, d, x[i + 4], 6, -145523070), d = ii(d, a, b, c, x[i + 11], 10, -1120210379), c = ii(c, d, a, b, x[i + 2], 15, 718787259), b = ii(b, c, d, a, x[i + 9], 21, -343485551), a = add(a, olda), b = add(b, oldb), c = add(c, oldc), d = add(d, oldd);
- return rhex(a) + rhex(b) + rhex(c) + rhex(d)
- }(function() {
- function e(t, n, r) {
- if (t === n) return t !== 0 || 1 / t == 1 / n;
- if (t == null || n == null) return t === n;
- t._chain && (t = t._wrapped), n._chain && (n = n._wrapped);
- if (t.isEqual && E.isFunction(t.isEqual)) return t.isEqual(n);
- if (n.isEqual && E.isFunction(n.isEqual)) return n.isEqual(t);
- var i = a.call(t);
- if (i != a.call(n)) return !1;
- switch (i) {
- case "[object String]":
- return t == String(n);
- case "[object Number]":
- return t != +t ? n != +n : t == 0 ? 1 / t == 1 / n : t == +n;
- case "[object Date]":
- case "[object Boolean]":
- return +t == +n;
- case "[object RegExp]":
- return t.source == n.source && t.global == n.global && t.multiline == n.multiline && t.ignoreCase == n.ignoreCase
- }
- if (typeof t != "object" || typeof n != "object") return !1;
- for (var s = r.length; s--;)
- if (r[s] == t) return !0;
- r.push(t);
- var s = 0
- , o = !0;
- if (i == "[object Array]") {
- if (s = t.length, o = s == n.length)
- for (; s--;)
- if (!(o = s in t == s in n && e(t[s], n[s], r))) break
- } else {
- if ("constructor" in t != "constructor" in n || t.constructor != n.constructor) return !1;
- for (var u in t)
- if (E.has(t, u) && (s++, !(o = E.has(n, u) && e(t[u], n[u], r)))) break;
- if (o) {
- for (u in n)
- if (E.has(n, u) && !(s--)) break;
- o = !s
- }
- }
- return r.pop(), o
- }
- var t = this
- , n = t._
- , r = {}
- , i = Array.prototype
- , s = Object.prototype
- , o = i.slice
- , u = i.unshift
- , a = s.toString
- , f = s.hasOwnProperty
- , l = i.forEach
- , c = i.map
- , h = i.reduce
- , p = i.reduceRight
- , d = i.filter
- , v = i.every
- , m = i.some
- , g = i.indexOf
- , y = i.lastIndexOf
- , s = Array.isArray
- , b = Object.keys
- , w = Function.prototype.bind
- , E = function(e) {
- return new L(e)
- };
- typeof exports != "undefined" ? (typeof module != "undefined" && module.exports && (exports = module.exports = E), exports._ = E) : t._ = E, E.VERSION = "1.3.1";
- var S = E.each = E.forEach = function(e, t, n) {
- if (e != null)
- if (l && e.forEach === l) e.forEach(t, n);
- else if (e.length === +e.length) {
- for (var i = 0, s = e.length; i < s; i++)
- if (i in e && t.call(n, e[i], i, e) === r) break
- } else
- for (i in e)
- if (E.has(e, i) && t.call(n, e[i], i, e) === r) break
- };
- E.map = E.collect = function(e, t, n) {
- var r = [];
- return e == null ? r : c && e.map === c ? e.map(t, n) : (S(e, function(e, i, s) {
- r[r.length] = t.call(n, e, i, s)
- }), e.length === +e.length && (r.length = e.length), r)
- }, E.reduce = E.foldl = E.inject = function(e, t, n, r) {
- var i = arguments.length > 2;
- e == null && (e = []);
- if (h && e.reduce === h) return r && (t = E.bind(t, r)), i ? e.reduce(t, n) : e.reduce(t);
- S(e, function(e, s, o) {
- i ? n = t.call(r, n, e, s, o) : (n = e, i = !0)
- });
- if (!i) throw new TypeError("Reduce of empty array with no initial value");
- return n
- }, E.reduceRight = E.foldr = function(e, t, n, r) {
- var i = arguments.length > 2;
- e == null && (e = []);
- if (p && e.reduceRight === p) return r && (t = E.bind(t, r)), i ? e.reduceRight(t, n) : e.reduceRight(t);
- var s = E.toArray(e)
- .reverse();
- return r && !i && (t = E.bind(t, r)), i ? E.reduce(s, t, n, r) : E.reduce(s, t)
- }, E.find = E.detect = function(e, t, n) {
- var r;
- return x(e, function(e, i, s) {
- if (t.call(n, e, i, s)) return r = e, !0
- }), r
- }, E.filter = E.select = function(e, t, n) {
- var r = [];
- return e == null ? r : d && e.filter === d ? e.filter(t, n) : (S(e, function(e, i, s) {
- t.call(n, e, i, s) && (r[r.length] = e)
- }), r)
- }, E.reject = function(e, t, n) {
- var r = [];
- return e == null ? r : (S(e, function(e, i, s) {
- t.call(n, e, i, s) || (r[r.length] = e)
- }), r)
- }, E.every = E.all = function(e, t, n) {
- var i = !0;
- return e == null ? i : v && e.every === v ? e.every(t, n) : (S(e, function(e, s, o) {
- if (!(i = i && t.call(n, e, s, o))) return r
- }), i)
- };
- var x = E.some = E.any = function(e, t, n) {
- t || (t = E.identity);
- var i = !1;
- return e == null ? i : m && e.some === m ? e.some(t, n) : (S(e, function(e, s, o) {
- if (i || (i = t.call(n, e, s, o))) return r
- }), !!i)
- };
- E.include = E.contains = function(e, t) {
- var n = !1;
- return e == null ? n : g && e.indexOf === g ? e.indexOf(t) != -1 : n = x(e, function(e) {
- return e === t
- })
- }, E.invoke = function(e, t) {
- var n = o.call(arguments, 2);
- return E.map(e, function(e) {
- return (E.isFunction(t) ? t || e : e[t])
- .apply(e, n)
- })
- }, E.pluck = function(e, t) {
- return E.map(e, function(e) {
- return e[t]
- })
- }, E.max = function(e, t, n) {
- if (!t && E.isArray(e)) return Math.max.apply(Math, e);
- if (!t && E.isEmpty(e)) return -Infinity;
- var r = {
- computed: -Infinity
- };
- return S(e, function(e, i, s) {
- i = t ? t.call(n, e, i, s) : e, i >= r.computed && (r = {
- value: e
- , computed: i
- })
- }), r.value
- }, E.min = function(e, t, n) {
- if (!t && E.isArray(e)) return Math.min.apply(Math, e);
- if (!t && E.isEmpty(e)) return Infinity;
- var r = {
- computed: Infinity
- };
- return S(e, function(e, i, s) {
- i = t ? t.call(n, e, i, s) : e, i < r.computed && (r = {
- value: e
- , computed: i
- })
- }), r.value
- }, E.shuffle = function(e) {
- var t = []
- , n;
- return S(e, function(e, r) {
- r == 0 ? t[0] = e : (n = Math.floor(Math.random() * (r + 1)), t[r] = t[n], t[n] = e)
- }), t
- }, E.sortBy = function(e, t, n) {
- return E.pluck(E.map(e, function(e, r, i) {
- return {
- value: e
- , criteria: t.call(n, e, r, i)
- }
- })
- .sort(function(e, t) {
- var n = e.criteria
- , r = t.criteria;
- return n < r ? -1 : n > r ? 1 : 0
- }), "value")
- }, E.groupBy = function(e, t) {
- var n = {}
- , r = E.isFunction(t) ? t : function(e) {
- return e[t]
- };
- return S(e, function(e, t) {
- var i = r(e, t);
- (n[i] || (n[i] = []))
- .push(e)
- }), n
- }, E.sortedIndex = function(e, t, n) {
- n || (n = E.identity);
- for (var r = 0, i = e.length; r < i;) {
- var s = r + i >> 1;
- n(e[s]) < n(t) ? r = s + 1 : i = s
- }
- return r
- }, E.toArray = function(e) {
- return e ? e.toArray ? e.toArray() : E.isArray(e) ? o.call(e) : E.isArguments(e) ? o.call(e) : E.values(e) : []
- }, E.size = function(e) {
- return E.toArray(e)
- .length
- }, E.first = E.head = function(e, t, n) {
- return t != null && !n ? o.call(e, 0, t) : e[0]
- }, E.initial = function(e, t, n) {
- return o.call(e, 0, e.length - (t == null || n ? 1 : t))
- }, E.last = function(e, t, n) {
- return t != null && !n ? o.call(e, Math.max(e.length - t, 0)) : e[e.length - 1]
- }, E.rest = E.tail = function(e, t, n) {
- return o.call(e, t == null || n ? 1 : t)
- }, E.compact = function(e) {
- return E.filter(e, function(e) {
- return !!e
- })
- }, E.flatten = function(e, t) {
- return E.reduce(e, function(e, n) {
- return E.isArray(n) ? e.concat(t ? n : E.flatten(n)) : (e[e.length] = n, e)
- }, [])
- }, E.without = function(e) {
- return E.difference(e, o.call(arguments, 1))
- }, E.uniq = E.unique = function(e, t, n) {
- var n = n ? E.map(e, n) : e
- , r = [];
- return E.reduce(n, function(n, i, s) {
- if (0 == s || (t === !0 ? E.last(n) != i : !E.include(n, i))) n[n.length] = i, r[r.length] = e[s];
- return n
- }, []), r
- }, E.union = function() {
- return E.uniq(E.flatten(arguments, !0))
- }, E.intersection = E.intersect = function(e) {
- var t = o.call(arguments, 1);
- return E.filter(E.uniq(e), function(e) {
- return E.every(t, function(t) {
- return E.indexOf(t, e) >= 0
- })
- })
- }, E.difference = function(e) {
- var t = E.flatten(o.call(arguments, 1));
- return E.filter(e, function(e) {
- return !E.include(t, e)
- })
- }, E.zip = function() {
- for (var e = o.call(arguments), t = E.max(E.pluck(e, "length")), n = Array(t), r = 0; r < t; r++) n[r] = E.pluck(e, "" + r);
- return n
- }, E.indexOf = function(e, t, n) {
- if (e == null) return -1;
- var r;
- if (n) return n = E.sortedIndex(e, t), e[n] === t ? n : -1;
- if (g && e.indexOf === g) return e.indexOf(t);
- for (n = 0, r = e.length; n < r; n++)
- if (n in e && e[n] === t) return n;
- return -1
- }, E.lastIndexOf = function(e, t) {
- if (e == null) return -1;
- if (y && e.lastIndexOf === y) return e.lastIndexOf(t);
- for (var n = e.length; n--;)
- if (n in e && e[n] === t) return n;
- return -1
- }, E.range = function(e, t, n) {
- arguments.length <= 1 && (t = e || 0, e = 0);
- for (var n = arguments[2] || 1, r = Math.max(Math.ceil((t - e) / n), 0), i = 0, s = Array(r); i < r;) s[i++] = e, e += n;
- return s
- };
- var T = function() {};
- E.bind = function(e, t) {
- var n, r;
- if (e.bind === w && w) return w.apply(e, o.call(arguments, 1));
- if (!E.isFunction(e)) throw new TypeError;
- return r = o.call(arguments, 2), n = function() {
- if (this instanceof n) {
- T.prototype = e.prototype;
- var i = new T
- , s = e.apply(i, r.concat(o.call(arguments)));
- return Object(s) === s ? s : i
- }
- return e.apply(t, r.concat(o.call(arguments)))
- }
- }, E.bindAll = function(e) {
- var t = o.call(arguments, 1);
- return t.length == 0 && (t = E.functions(e)), S(t, function(t) {
- e[t] = E.bind(e[t], e)
- }), e
- }, E.memoize = function(e, t) {
- var n = {};
- return t || (t = E.identity)
- , function() {
- var r = t.apply(this, arguments);
- return E.has(n, r) ? n[r] : n[r] = e.apply(this, arguments)
- }
- }, E.delay = function(e, t) {
- var n = o.call(arguments, 2);
- return setTimeout(function() {
- return e.apply(e, n)
- }, t)
- }, E.defer = function(e) {
- return E.delay.apply(E, [e, 1].concat(o.call(arguments, 1)))
- }, E.throttle = function(e, t) {
- var n, r, i, s, o, u = E.debounce(function() {
- o = s = !1
- }, t);
- return function() {
- n = this, r = arguments;
- var a;
- i || (i = setTimeout(function() {
- i = null, o && e.apply(n, r), u()
- }, t)), s ? o = !0 : e.apply(n, r), u(), s = !0
- }
- }, E.debounce = function(e, t) {
- var n;
- return function() {
- var r = this
- , i = arguments;
- clearTimeout(n), n = setTimeout(function() {
- n = null, e.apply(r, i)
- }, t)
- }
- }, E.once = function(e) {
- var t = !1
- , n;
- return function() {
- return t ? n : (t = !0, n = e.apply(this, arguments))
- }
- }, E.wrap = function(e, t) {
- return function() {
- var n = [e].concat(o.call(arguments, 0));
- return t.apply(this, n)
- }
- }, E.compose = function() {
- var e = arguments;
- return function() {
- for (var t = arguments, n = e.length - 1; n >= 0; n--) t = [e[n].apply(this, t)];
- return t[0]
- }
- }, E.after = function(e, t) {
- return e <= 0 ? t() : function() {
- if (--e < 1) return t.apply(this, arguments)
- }
- }, E.keys = b || function(e) {
- if (e !== Object(e)) throw new TypeError("Invalid object");
- var t = []
- , n;
- for (n in e) E.has(e, n) && (t[t.length] = n);
- return t
- }, E.values = function(e) {
- return E.map(e, E.identity)
- }, E.functions = E.methods = function(e) {
- var t = []
- , n;
- for (n in e) E.isFunction(e[n]) && t.push(n);
- return t.sort()
- }, E.extend = function(e) {
- return S(o.call(arguments, 1), function(t) {
- for (var n in t) e[n] = t[n]
- }), e
- }, E.defaults = function(e) {
- return S(o.call(arguments, 1), function(t) {
- for (var n in t) e[n] == null && (e[n] = t[n])
- }), e
- }, E.clone = function(e) {
- return E.isObject(e) ? E.isArray(e) ? e.slice() : E.extend({}, e) : e
- }, E.tap = function(e, t) {
- return t(e), e
- }, E.isEqual = function(t, n) {
- return e(t, n, [])
- }, E.isEmpty = function(e) {
- if (E.isArray(e) || E.isString(e)) return e.length === 0;
- for (var t in e)
- if (E.has(e, t)) return !1;
- return !0
- }, E.isElement = function(e) {
- return !!e && e.nodeType == 1
- }, E.isArray = s || function(e) {
- return a.call(e) == "[object Array]"
- }, E.isObject = function(e) {
- return e === Object(e)
- }, E.isArguments = function(e) {
- return a.call(e) == "[object Arguments]"
- }, E.isArguments(arguments) || (E.isArguments = function(e) {
- return !!e && !!E.has(e, "callee")
- }), E.isFunction = function(e) {
- return a.call(e) == "[object Function]"
- }, E.isString = function(e) {
- return a.call(e) == "[object String]"
- }, E.isNumber = function(e) {
- return a.call(e) == "[object Number]"
- }, E.isNaN = function(e) {
- return e !== e
- }, E.isBoolean = function(e) {
- return e === !0 || e === !1 || a.call(e) == "[object Boolean]"
- }, E.isDate = function(e) {
- return a.call(e) == "[object Date]"
- }, E.isRegExp = function(e) {
- return a.call(e) == "[object RegExp]"
- }, E.isNull = function(e) {
- return e === null
- }, E.isUndefined = function(e) {
- return e === void 0
- }, E.has = function(e, t) {
- return f.call(e, t)
- }, E.noConflict = function() {
- return t._ = n, this
- }, E.identity = function(e) {
- return e
- }, E.times = function(e, t, n) {
- for (var r = 0; r < e; r++) t.call(n, r)
- }, E.escape = function(e) {
- return ("" + e)
- .replace(/&/g, "&")
- .replace(/</g, "<")
- .replace(/>/g, ">")
- .replace(/"/g, """)
- .replace(/'/g, "'")
- .replace(/\//g, "/")
- }, E.mixin = function(e) {
- S(E.functions(e), function(t) {
- O(t, E[t] = e[t])
- })
- };
- var N = 0;
- E.uniqueId = function(e) {
- var t = N++;
- return e ? e + t : t
- }, E.templateSettings = {
- evaluate: /<%([\s\S]+?)%>/g
- , interpolate: /<%=([\s\S]+?)%>/g
- , escape: /<%-([\s\S]+?)%>/g
- };
- var C = /.^/
- , k = function(e) {
- return e.replace(/\\\\/g, "\\")
- .replace(/\\'/g, "'")
- };
- E.template = function(e, t) {
- var n = E.templateSettings
- , n = "var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('" + e.replace(/\\/g, "\\\\")
- .replace(/'/g, "\\'")
- .replace(n.escape || C, function(e, t) {
- return "',_.escape(" + k(t) + "),'"
- })
- .replace(n.interpolate || C, function(e, t) {
- return "'," + k(t) + ",'"
- })
- .replace(n.evaluate || C, function(e, t) {
- return "');" + k(t)
- .replace(/[\r\n\t]/g, " ") + ";__p.push('"
- })
- .replace(/\r/g, "\\r")
- .replace(/\n/g, "\\n")
- .replace(/\t/g, "\\t") + "');}return __p.join('');"
- , r = new Function("obj", "_", n);
- return t ? r(t, E) : function(e) {
- return r.call(this, e, E)
- }
- }, E.chain = function(e) {
- return E(e)
- .chain()
- };
- var L = function(e) {
- this._wrapped = e
- };
- E.prototype = L.prototype;
- var A = function(e, t) {
- return t ? E(e)
- .chain() : e
- }
- , O = function(e, t) {
- L.prototype[e] = function() {
- var e = o.call(arguments);
- return u.call(e, this._wrapped), A(t.apply(E, e), this._chain)
- }
- };
- E.mixin(E), S("pop,push,reverse,shift,sort,splice,unshift".split(","), function(e) {
- var t = i[e];
- L.prototype[e] = function() {
- var n = this._wrapped;
- t.apply(n, arguments);
- var r = n.length;
- return (e == "shift" || e == "splice") && r === 0 && delete n[0], A(n, this._chain)
- }
- }), S(["concat", "join", "slice"], function(e) {
- var t = i[e];
- L.prototype[e] = function() {
- return A(t.apply(this._wrapped, arguments), this._chain)
- }
- }), L.prototype.chain = function() {
- return this._chain = !0, this
- }, L.prototype.value = function() {
- return this._wrapped
- }
- })
- .call(this)
- , function(e) {
- "use strict";
- var t = String.prototype.trim
- , n = String.prototype.trimRight
- , r = String.prototype.trimLeft
- , i = function(e) {
- return e * 1 || 0
- }
- , s = function(e, t, n) {
- e = "" + e, t = ~~t;
- for (var r = []; t > 0; r[--t] = e);
- return r.join(n == null ? "" : n)
- }
- , o = function(e) {
- return Array.prototype.slice.call(e)
- }
- , u = function(e) {
- return e != null ? "[" + f.escapeRegExp("" + e) + "]" : "\\s"
- }
- , a = function() {
- function e(e) {
- return Object.prototype.toString.call(e)
- .slice(8, -1)
- .toLowerCase()
- }
- var t = s
- , n = function() {
- return n.cache.hasOwnProperty(arguments[0]) || (n.cache[arguments[0]] = n.parse(arguments[0])), n.format.call(null, n.cache[arguments[0]], arguments)
- };
- return n.format = function(n, r) {
- var i = 1
- , s = n.length
- , o = ""
- , u, f = []
- , l, c, h, p, d, v;
- for (l = 0; l < s; l++) {
- o = e(n[l]);
- if (o === "string") f.push(n[l]);
- else if (o === "array") {
- h = n[l];
- if (h[2]) {
- u = r[i];
- for (c = 0; c < h[2].length; c++) {
- if (!u.hasOwnProperty(h[2][c])) throw new Error(a('[_.sprintf] property "%s" does not exist', h[2][c]));
- u = u[h[2][c]]
- }
- } else h[1] ? u = r[h[1]] : u = r[i++];
- if (/[^s]/.test(h[8]) && e(u) != "number") throw new Error(a("[_.sprintf] expecting number but found %s", e(u)));
- switch (h[8]) {
- case "b":
- u = u.toString(2);
- break;
- case "c":
- u = String.fromCharCode(u);
- break;
- case "d":
- u = parseInt(u, 10);
- break;
- case "e":
- u = h[7] ? u.toExponential(h[7]) : u.toExponential();
- break;
- case "f":
- u = h[7] ? parseFloat(u)
- .toFixed(h[7]) : parseFloat(u);
- break;
- case "o":
- u = u.toString(8);
- break;
- case "s":
- u = (u = String(u)) && h[7] ? u.substring(0, h[7]) : u;
- break;
- case "u":
- u = Math.abs(u);
- break;
- case "x":
- u = u.toString(16);
- break;
- case "X":
- u = u.toString(16)
- .toUpperCase()
- }
- u = /[def]/.test(h[8]) && h[3] && u >= 0 ? "+" + u : u, d = h[4] ? h[4] == "0" ? "0" : h[4].charAt(1) : " ", v = h[6] - String(u)
- .length, p = h[6] ? t(d, v) : "", f.push(h[5] ? u + p : p + u)
- }
- }
- return f.join("")
- }, n.cache = {}, n.parse = function(e) {
- var t = e
- , n = []
- , r = []
- , i = 0;
- while (t) {
- if ((n = /^[^\x25]+/.exec(t)) !== null) r.push(n[0]);
- else if ((n = /^\x25{2}/.exec(t)) !== null) r.push("%");
- else {
- if ((n = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(t)) === null) throw new Error("[_.sprintf] huh?");
- if (n[2]) {
- i |= 1;
- var s = []
- , o = n[2]
- , u = [];
- if ((u = /^([a-z_][a-z_\d]*)/i.exec(o)) === null) throw new Error("[_.sprintf] huh?");
- s.push(u[1]);
- while ((o = o.substring(u[0].length)) !== "")
- if ((u = /^\.([a-z_][a-z_\d]*)/i.exec(o)) !== null) s.push(u[1]);
- else {
- if ((u = /^\[(\d+)\]/.exec(o)) === null) throw new Error("[_.sprintf] huh?");
- s.push(u[1])
- }
- n[2] = s
- } else i |= 2;
- if (i === 3) throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");
- r.push(n)
- }
- t = t.substring(n[0].length)
- }
- return r
- }, n
- }()
- , f = {
- VERSION: "2.0.0"
- , isBlank: function(e) {
- return /^\s*$/.test(e)
- }
- , stripTags: function(e) {
- return ("" + e)
- .replace(/<\/?[^>]+>/ig, "")
- }
- , capitalize: function(e) {
- return e = "" + e, e.charAt(0)
- .toUpperCase() + e.substring(1)
- .toLowerCase()
- }
- , chop: function(e, t) {
- e += "", t = ~~t || e.length;
- var n = [];
- for (var r = 0; r < e.length;) n.push(e.slice(r, r + t)), r += t;
- return n
- }
- , clean: function(e) {
- return f.strip(("" + e)
- .replace(/\s+/g, " "))
- }
- , count: function(e, t) {
- e = "" + e, t = "" + t;
- var n = 0
- , r;
- for (var i = 0; i < e.length;) r = e.indexOf(t, i), r >= 0 && n++, i = i + (r >= 0 ? r : 0) + t.length;
- return n
- }
- , chars: function(e) {
- return ("" + e)
- .split("")
- }
- , escapeHTML: function(e) {
- return ("" + e)
- .replace(/&/g, "&")
- .replace(/</g, "<")
- .replace(/>/g, ">")
- .replace(/"/g, """)
- .replace(/'/g, "'")
- }
- , unescapeHTML: function(e) {
- return ("" + e)
- .replace(/</g, "<")
- .replace(/>/g, ">")
- .replace(/"/g, '"')
- .replace(/'/g, "'")
- .replace(/&/g, "&")
- }
- , escapeRegExp: function(e) {
- return e.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1")
- }
- , insert: function(e, t, n) {
- var r = ("" + e)
- .split("");
- return r.splice(~~t, 0, "" + n), r.join("")
- }
- , include: function(e, t) {
- return ("" + e)
- .indexOf(t) !== -1
- }
- , join: function(e) {
- var t = o(arguments);
- return t.join(t.shift())
- }
- , lines: function(e) {
- return ("" + e)
- .split("\n")
- }
- , reverse: function(e) {
- return Array.prototype.reverse.apply(String(e)
- .split(""))
- .join("")
- }
- , splice: function(e, t, n, r) {
- var i = ("" + e)
- .split("");
- return i.splice(~~t, ~~n, r), i.join("")
- }
- , startsWith: function(e, t) {
- return e = "" + e, t = "" + t, e.length >= t.length && e.substring(0, t.length) === t
- }
- , endsWith: function(e, t) {
- return e = "" + e, t = "" + t, e.length >= t.length && e.substring(e.length - t.length) === t
- }
- , succ: function(e) {
- e = "" + e;
- var t = e.split("");
- return t.splice(e.length - 1, 1, String.fromCharCode(e.charCodeAt(e.length - 1) + 1)), t.join("")
- }
- , titleize: function(e) {
- return ("" + e)
- .replace(/\b./g, function(e) {
- return e.toUpperCase()
- })
- }
- , camelize: function(e) {
- return f.trim(e)
- .replace(/(\-|_|\s)+(.)?/g, function(e, t, n) {
- return n ? n.toUpperCase() : ""
- })
- }
- , underscored: function(e) {
- return f.trim(e)
- .replace(/([a-z\d])([A-Z]+)/g, "$1_$2")
- .replace(/[-\s]+/g, "_")
- .toLowerCase()
- }
- , dasherize: function(e) {
- return f.trim(e)
- .replace(/[_\s]+/g, "-")
- .replace(/([A-Z])/g, "-$1")
- .replace(/-+/g, "-")
- .toLowerCase()
- }
- , humanize: function(e) {
- return f.capitalize(this.underscored(e)
- .replace(/_id$/, "")
- .replace(/_/g, " "))
- }
- , trim: function(e, n) {
- return e = "" + e, !n && t ? t.call(e) : (n = u(n), e.replace(new RegExp("^" + n + "+|" + n + "+$", "g"), ""))
- }
- , ltrim: function(e, t) {
- return !t && r ? r.call(e) : (t = u(t), ("" + e)
- .replace(new RegExp("^" + t + "+", "g"), ""))
- }
- , rtrim: function(e, t) {
- return !t && n ? n.call(e) : (t = u(t), ("" + e)
- .replace(new RegExp(t + "+$", "g"), ""))
- }
- , truncate: function(e, t, n) {
- return e = "" + e, n = n || "...", t = ~~t, e.length > t ? e.slice(0, t) + n : e
- }
- , prune: function(e, t, n) {
- e = "" + e, t = ~~t, n = n != null ? "" + n : "...";
- var r, i, s = e.replace(/\W/g, function(e) {
- return e.toUpperCase() !== e.toLowerCase() ? "A" : " "
- });
- return i = s[t], r = s.slice(0, t), i && i.match(/\S/) && (r = r.replace(/\s\S+$/, "")), r = f.rtrim(r), (r + n)
- .length > e.length ? e : e.substring(0, r.length) + n
- }
- , words: function(e, t) {
- return ("" + e)
- .split(t || " ")
- }
- , pad: function(e, t, n, r) {
- e = "" + e;
- var i = ""
- , o = 0;
- t = ~~t, n ? n.length > 1 && (n = n.charAt(0)) : n = " ";
- switch (r) {
- case "right":
- o = t - e.length, i = s(n, o), e += i;
- break;
- case "both":
- o = t - e.length, i = {
- left: s(n, Math.ceil(o / 2))
- , right: s(n, Math.floor(o / 2))
- }, e = i.left + e + i.right;
- break;
- default:
- o = t - e.length, i = s(n, o), e = i + e
- }
- return e
- }
- , lpad: function(e, t, n) {
- return f.pad(e, t, n)
- }
- , rpad: function(e, t, n) {
- return f.pad(e, t, n, "right")
- }
- , lrpad: function(e, t, n) {
- return f.pad(e, t, n, "both")
- }
- , sprintf: a
- , vsprintf: function(e, t) {
- return t.unshift(e), a.apply(null, t)
- }
- , toNumber: function(e, t) {
- var n = i(i(e)
- .toFixed(~~t));
- return n === 0 && "" + e != "0" ? Number.NaN : n
- }
- , strRight: function(e, t) {
- e = "" + e, t = t != null ? "" + t : t;
- var n = t ? e.indexOf(t) : -1;
- return n != -1 ? e.slice(n + t.length, e.length) : e
- }
- , strRightBack: function(e, t) {
- e = "" + e, t = t != null ? "" + t : t;
- var n = t ? e.lastIndexOf(t) : -1;
- return n != -1 ? e.slice(n + t.length, e.length) : e
- }
- , strLeft: function(e, t) {
- e = "" + e, t = t != null ? "" + t : t;
- var n = t ? e.indexOf(t) : -1;
- return n != -1 ? e.slice(0, n) : e
- }
- , strLeftBack: function(e, t) {
- e = "" + e, t = t != null ? "" + t : t;
- var n = e.lastIndexOf(t);
- return n != -1 ? e.slice(0, n) : e
- }
- , toSentence: function(e, t, n) {
- t || (t = ", "), n || (n = " and ");
- var r = e.length
- , i = "";
- for (var s = 0; s < r; s++) i += e[s], s === r - 2 ? i += n : s < r - 1 && (i += t);
- return i
- }
- , slugify: function(e) {
- var t = "àáäâèéëêìíïîòóöôùúüûñç·/_:;"
- , n = "aaaaeeeeiiiioooouuuunc"
- , r = new RegExp(u(t), "g");
- return e = ("" + e)
- .toLowerCase(), e = e.replace(r, function(e) {
- return n[t.indexOf(e)] || "-"
- }), f.trim(e.replace(/[^\w\s-]/g, "")
- .replace(/[-\s]+/g, "-"), "-")
- }
- , exports: function() {
- var e = {};
- for (var t in this) {
- if (!this.hasOwnProperty(t) || t == "include" || t == "contains" || t == "reverse") continue;
- e[t] = this[t]
- }
- return e
- }
- , repeat: s
- };
- f.strip = f.trim, f.lstrip = f.ltrim, f.rstrip = f.rtrim, f.center = f.lrpad, f.rjust = f.lpad, f.ljust = f.rpad, f.contains = f.include, typeof exports != "undefined" ? (typeof module != "undefined" && module.exports && (module.exports = f), exports._s = f) : typeof define == "function" && define.amd ? define("underscore.string", function() {
- return f
- }) : typeof e._ != "undefined" ? (e._.string = f, e._.str = e._.string) : e._ = {
- string: f
- , str: f
- }
- }(this || window)
- , function() {
- var e = this
- , t = e.Backbone
- , n = Array.prototype.slice
- , r = Array.prototype.splice
- , i;
- i = "undefined" != typeof exports ? exports : e.Backbone = {}, i.VERSION = "0.9.2";
- var s = e._;
- !s && "undefined" != typeof require && (s = require("underscore"));
- var o = e.jQuery || e.Zepto || e.ender;
- i.setDomLibrary = function(e) {
- o = e
- }, i.noConflict = function() {
- return e.Backbone = t, this
- }, i.emulateHTTP = !1, i.emulateJSON = !1;
- var u = /\s+/
- , a = i.Events = {
- on: function(e, t, n) {
- var r, i, s, o, a;
- if (!t) return this;
- e = e.split(u);
- for (r = this._callbacks || (this._callbacks = {}); i = e.shift();) s = (a = r[i]) ? a.tail : {}, s.next = o = {}, s.context = n, s.callback = t, r[i] = {
- tail: o
- , next: a ? a.next : s
- };
- return this
- }
- , off: function(e, t, n) {
- var r, i, o, a, f, l;
- if (i = this._callbacks) {
- if (!e && !t && !n) return delete this._callbacks, this;
- for (e = e ? e.split(u) : s.keys(i); r = e.shift();)
- if (o = i[r], delete i[r], o && (t || n))
- for (a = o.tail;
- (o = o.next) !== a;)(f = o.callback, l = o.context, t && f !== t || n && l !== n) && this.on(r, f, l);
- return this
- }
- }
- , trigger: function(e) {
- var t, r, i, s, o, a;
- if (!(i = this._callbacks)) return this;
- o = i.all, e = e.split(u);
- for (a = n.call(arguments, 1); t = e.shift();) {
- if (r = i[t])
- for (s = r.tail;
- (r = r.next) !== s;) r.callback.apply(r.context || this, a);
- if (r = o) {
- s = r.tail;
- for (t = [t].concat(a);
- (r = r.next) !== s;) r.callback.apply(r.context || this, t)
- }
- }
- return this
- }
- };
- a.bind = a.on, a.unbind = a.off;
- var f = i.Model = function(e, t) {
- var n;
- e || (e = {}), t && t.parse && (e = this.parse(e));
- if (n = T(this, "defaults")) e = s.extend({}, n, e);
- t && t.collection && (this.collection = t.collection), this.attributes = {}, this._escapedAttributes = {}, this.cid = s.uniqueId("c"), this.changed = {}, this._silent = {}, this._pending = {}, this.set(e, {
- silent: !0
- }), this.changed = {}, this._silent = {}, this._pending = {}, this._previousAttributes = s.clone(this.attributes), this.initialize.apply(this, arguments)
- };
- s.extend(f.prototype, a, {
- changed: null
- , _silent: null
- , _pending: null
- , idAttribute: "id"
- , initialize: function() {}
- , toJSON: function() {
- return s.clone(this.attributes)
- }
- , get: function(e) {
- return this.attributes[e]
- }
- , escape: function(e) {
- var t;
- return (t = this._escapedAttributes[e]) ? t : (t = this.get(e), this._escapedAttributes[e] = s.escape(null == t ? "" : "" + t))
- }
- , has: function(e) {
- return null != this.get(e)
- }
- , set: function(e, t, n) {
- var r, i;
- s.isObject(e) || null == e ? (r = e, n = t) : (r = {}, r[e] = t), n || (n = {});
- if (!r) return this;
- r instanceof f && (r = r.attributes);
- if (n.unset)
- for (i in r) r[i] = void 0;
- if (!this._validate(r, n)) return !1;
- this.idAttribute in r && (this.id = r[this.idAttribute]);
- var t = n.changes = {}
- , o = this.attributes
- , u = this._escapedAttributes
- , a = this._previousAttributes || {};
- for (i in r) {
- e = r[i];
- if (!s.isEqual(o[i], e) || n.unset && s.has(o, i)) delete u[i], (n.silent ? this._silent : t)[i] = !0;
- n.unset ? delete o[i] : o[i] = e, !s.isEqual(a[i], e) || s.has(o, i) != s.has(a, i) ? (this.changed[i] = e, n.silent || (this._pending[i] = !0)) : (delete this.changed[i], delete this._pending[i])
- }
- return n.silent || this.change(n), this
- }
- , unset: function(e, t) {
- return (t || (t = {}))
- .unset = !0, this.set(e, null, t)
- }
- , clear: function(e) {
- return (e || (e = {}))
- .unset = !0, this.set(s.clone(this.attributes), e)
- }
- , fetch: function(e) {
- var e = e ? s.clone(e) : {}
- , t = this
- , n = e.success;
- return e.success = function(r, i, s) {
- if (!t.set(t.parse(r, s), e)) return !1;
- n && n(t, r)
- }, e.error = i.wrapError(e.error, t, e), (this.sync || i.sync)
- .call(this, "read", this, e)
- }
- , save: function(e, t, n) {
- var r, o;
- s.isObject(e) || null == e ? (r = e, n = t) : (r = {}, r[e] = t), n = n ? s.clone(n) : {};
- if (n.wait) {
- if (!this._validate(r, n)) return !1;
- o = s.clone(this.attributes)
- }
- e = s.extend({}, n, {
- silent: !0
- });
- if (r && !this.set(r, n.wait ? e : n)) return !1;
- var u = this
- , a = n.success;
- return n.success = function(e, t, i) {
- t = u.parse(e, i), n.wait && (delete n.wait, t = s.extend(r || {}, t));
- if (!u.set(t, n)) return !1;
- a ? a(u, e) : u.trigger("sync", u, e, n)
- }, n.error = i.wrapError(n.error, u, n), t = this.isNew() ? "create" : "update", t = (this.sync || i.sync)
- .call(this, t, this, n), n.wait && this.set(o, e), t
- }
- , destroy: function(e) {
- var e = e ? s.clone(e) : {}
- , t = this
- , n = e.success
- , r = function() {
- t.trigger("destroy", t, t.collection, e)
- };
- if (this.isNew()) return r(), !1;
- e.success = function(i) {
- e.wait && r(), n ? n(t, i) : t.trigger("sync", t, i, e)
- }, e.error = i.wrapError(e.error, t, e);
- var o = (this.sync || i.sync)
- .call(this, "delete", this, e);
- return e.wait || r(), o
- }
- , url: function() {
- var e = T(this, "urlRoot") || T(this.collection, "url") || N();
- return this.isNew() ? e : e + ("/" == e.charAt(e.length - 1) ? "" : "/") + encodeURIComponent(this.id)
- }
- , parse: function(e) {
- return e
- }
- , clone: function() {
- return new this.constructor(this.attributes)
- }
- , isNew: function() {
- return null == this.id
- }
- , change: function(e) {
- e || (e = {});
- var t = this._changing;
- this._changing = !0;
- for (var n in this._silent) this._pending[n] = !0;
- var r = s.extend({}, e.changes, this._silent);
- this._silent = {};
- for (n in r) this.trigger("change:" + n, this, this.get(n), e);
- if (t) return this;
- for (; !s.isEmpty(this._pending);) {
- this._pending = {}, this.trigger("change", this, e);
- for (n in this.changed) !this._pending[n] && !this._silent[n] && delete this.changed[n];
- this._previousAttributes = s.clone(this.attributes)
- }
- return this._changing = !1, this
- }
- , hasChanged: function(e) {
- return arguments.length ? s.has(this.changed, e) : !s.isEmpty(this.changed)
- }
- , changedAttributes: function(e) {
- if (!e) return this.hasChanged() ? s.clone(this.changed) : !1;
- var t, n = !1
- , r = this._previousAttributes
- , i;
- for (i in e) s.isEqual(r[i], t = e[i]) || ((n || (n = {}))[i] = t);
- return n
- }
- , previous: function(e) {
- return !arguments.length || !this._previousAttributes ? null : this._previousAttributes[e]
- }
- , previousAttributes: function() {
- return s.clone(this._previousAttributes)
- }
- , isValid: function() {
- return !this.validate(this.attributes)
- }
- , _validate: function(e, t) {
- if (t.silent || !this.validate) return !0;
- var e = s.extend({}, this.attributes, e)
- , n = this.validate(e, t);
- return n ? (t && t.error ? t.error(this, n, t) : this.trigger("error", this, n, t), !1) : !0
- }
- });
- var l = i.Collection = function(e, t) {
- t || (t = {}), t.model && (this.model = t.model), t.comparator && (this.comparator = t.comparator), this._reset(), this.initialize.apply(this, arguments), e && this.reset(e, {
- silent: !0
- , parse: t.parse
- })
- };
- s.extend(l.prototype, a, {
- model: f
- , initialize: function() {}
- , toJSON: function(e) {
- return this.map(function(t) {
- return t.toJSON(e)
- })
- }
- , add: function(e, t) {
- var n, i, o, u, a, f = {}
- , l = {}
- , c = [];
- t || (t = {}), e = s.isArray(e) ? e.slice() : [e], n = 0;
- for (i = e.length; n < i; n++) {
- if (!(o = e[n] = this._prepareModel(e[n], t))) throw Error("Can't add an invalid model to a collection");
- u = o.cid, a = o.id, f[u] || this._byCid[u] || null != a && (l[a] || this._byId[a]) ? c.push(n) : f[u] = l[a] = o
- }
- for (n = c.length; n--;) e.splice(c[n], 1);
- n = 0;
- for (i = e.length; n < i; n++)(o = e[n])
- .on("all", this._onModelEvent, this), this._byCid[o.cid] = o, null != o.id && (this._byId[o.id] = o);
- this.length += i, r.apply(this.models, [null != t.at ? t.at : this.models.length, 0].concat(e)), this.comparator && this.sort({
- silent: !0
- });
- if (t.silent) return this;
- n = 0;
- for (i = this.models.length; n < i; n++) f[(o = this.models[n])
- .cid] && (t.index = n, o.trigger("add", o, this, t));
- return this
- }
- , remove: function(e, t) {
- var n, r, i, o;
- t || (t = {}), e = s.isArray(e) ? e.slice() : [e], n = 0;
- for (r = e.length; n < r; n++)
- if (o = this.getByCid(e[n]) || this.get(e[n])) delete this._byId[o.id], delete this._byCid[o.cid], i = this.indexOf(o), this.models.splice(i, 1), this.length--, t.silent || (t.index = i, o.trigger("remove", o, this, t)), this._removeReference(o);
- return this
- }
- , push: function(e, t) {
- return e = this._prepareModel(e, t), this.add(e, t), e
- }
- , pop: function(e) {
- var t = this.at(this.length - 1);
- return this.remove(t, e), t
- }
- , unshift: function(e, t) {
- return e = this._prepareModel(e, t), this.add(e, s.extend({
- at: 0
- }, t)), e
- }
- , shift: function(e) {
- var t = this.at(0);
- return this.remove(t, e), t
- }
- , get: function(e) {
- return null == e ? void 0 : this._byId[null != e.id ? e.id : e]
- }
- , getByCid: function(e) {
- return e && this._byCid[e.cid || e]
- }
- , at: function(e) {
- return this.models[e]
- }
- , where: function(e) {
- return s.isEmpty(e) ? [] : this.filter(function(t) {
- for (var n in e)
- if (e[n] !== t.get(n)) return !1;
- return !0
- })
- }
- , sort: function(e) {
- e || (e = {});
- if (!this.comparator) throw Error("Cannot sort a set without a comparator");
- var t = s.bind(this.comparator, this);
- return 1 == this.comparator.length ? this.models = this.sortBy(t) : this.models.sort(t), e.silent || this.trigger("reset", this, e), this
- }
- , pluck: function(e) {
- return s.map(this.models, function(t) {
- return t.get(e)
- })
- }
- , reset: function(e, t) {
- e || (e = []), t || (t = {});
- for (var n = 0, r = this.models.length; n < r; n++) this._removeReference(this.models[n]);
- return this._reset(), this.add(e, s.extend({
- silent: !0
- }, t)), t.silent || this.trigger("reset", this, t), this
- }
- , fetch: function(e) {
- e = e ? s.clone(e) : {}, void 0 === e.parse && (e.parse = !0);
- var t = this
- , n = e.success;
- return e.success = function(r, i, s) {
- t[e.add ? "add" : "reset"](t.parse(r, s), e), n && n(t, r)
- }, e.error = i.wrapError(e.error, t, e), (this.sync || i.sync)
- .call(this, "read", this, e)
- }
- , create: function(e, t) {
- var n = this
- , t = t ? s.clone(t) : {}
- , e = this._prepareModel(e, t);
- if (!e) return !1;
- t.wait || n.add(e, t);
- var r = t.success;
- return t.success = function(i, s) {
- t.wait && n.add(i, t), r ? r(i, s) : i.trigger("sync", e, s, t)
- }, e.save(null, t), e
- }
- , parse: function(e) {
- return e
- }
- , chain: function() {
- return s(this.models)
- .chain()
- }
- , _reset: function() {
- this.length = 0, this.models = [], this._byId = {}, this._byCid = {}
- }
- , _prepareModel: function(e, t) {
- return t || (t = {}), e instanceof f ? e.collection || (e.collection = this) : (t.collection = this, e = new this.model(e, t), e._validate(e.attributes, t) || (e = !1)), e
- }
- , _removeReference: function(e) {
- this == e.collection && delete e.collection, e.off("all", this._onModelEvent, this)
- }
- , _onModelEvent: function(e, t, n, r) {
- ("add" == e || "remove" == e) && n != this || ("destroy" == e && this.remove(t, r), t && e === "change:" + t.idAttribute && (delete this._byId[t.previous(t.idAttribute)], this._byId[t.id] = t), this.trigger.apply(this, arguments))
- }
- }), s.each("forEach,each,map,reduce,reduceRight,find,detect,filter,select,reject,every,all,some,any,include,contains,invoke,max,min,sortBy,sortedIndex,toArray,size,first,initial,rest,last,without,indexOf,shuffle,lastIndexOf,isEmpty,groupBy".split(","), function(e) {
- l.prototype[e] = function() {
- return s[e].apply(s, [this.models].concat(s.toArray(arguments)))
- }
- });
- var c = i.Router = function(e) {
- e || (e = {}), e.routes && (this.routes = e.routes), this._bindRoutes(), this.initialize.apply(this, arguments)
- }
- , h = /:\w+/g
- , p = /\*\w+/g
- , d = /[-[\]{}()+?.,\\^$|#\s]/g;
- s.extend(c.prototype, a, {
- initialize: function() {}
- , route: function(e, t, n) {
- return i.history || (i.history = new v), s.isRegExp(e) || (e = this._routeToRegExp(e)), n || (n = this[t]), i.history.route(e, s.bind(function(r) {
- r = this._extractParameters(e, r), n && n.apply(this, r), this.trigger.apply(this, ["route:" + t].concat(r)), i.history.trigger("route", this, t, r)
- }, this)), this
- }
- , navigate: function(e, t) {
- i.history.navigate(e, t)
- }
- , _bindRoutes: function() {
- if (this.routes) {
- var e = []
- , t;
- for (t in this.routes) e.unshift([t, this.routes[t]]);
- t = 0;
- for (var n = e.length; t < n; t++) this.route(e[t][0], e[t][1], this[e[t][1]])
- }
- }
- , _routeToRegExp: function(e) {
- return e = e.replace(d, "\\$&")
- .replace(h, "([^/]+)")
- .replace(p, "(.*?)"), RegExp("^" + e + "$")
- }
- , _extractParameters: function(e, t) {
- return e.exec(t)
- .slice(1)
- }
- });
- var v = i.History = function() {
- this.handlers = [], s.bindAll(this, "checkUrl")
- }
- , m = /^[#\/]/
- , g = /msie [\w.]+/;
- v.started = !1, s.extend(v.prototype, a, {
- interval: 50
- , getHash: function(e) {
- return (e = (e ? e.location : window.location)
- .href.match(/#(.*)$/)) ? e[1] : ""
- }
- , getFragment: function(e, t) {
- if (null == e)
- if (this._hasPushState || t) {
- var e = window.location.pathname
- , n = window.location.search;
- n && (e += n)
- } else e = this.getHash();
- return e.indexOf(this.options.root) || (e = e.substr(this.options.root.length)), e.replace(m, "")
- }
- , start: function(e) {
- if (v.started) throw Error("Backbone.history has already been started");
- v.started = !0, this.options = s.extend({}, {
- root: "/"
- }, this.options, e), this._wantsHashChange = !1 !== this.options.hashChange, this._wantsPushState = !!this.options.pushState, this._hasPushState = !(!this.options.pushState || !window.history || !window.history.pushState);
- var e = this.getFragment()
- , t = document.documentMode;
- if (t = g.exec(navigator.userAgent.toLowerCase()) && (!t || 7 >= t)) this.iframe = o('<iframe src="javascript:0" tabindex="-1" />')
- .hide()
- .appendTo("body")[0].contentWindow, this.navigate(e);
- this._hasPushState ? o(window)
- .bind("popstate", this.checkUrl) : this._wantsHashChange && "onhashchange" in window && !t ? o(window)
- .bind("hashchange", this.checkUrl) : this._wantsHashChange && (this._checkUrlInterval = setInterval(this.checkUrl, this.interval)), this.fragment = e, e = window.location, t = e.pathname == this.options.root;
- if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !t) return this.fragment = this.getFragment(null, !0), window.location.replace(this.options.root + "#" + this.fragment), !0;
- this._wantsPushState && this._hasPushState && t && e.hash && (this.fragment = this.getHash()
- .replace(m, ""), window.history.replaceState({}, document.title, e.protocol + "//" + e.host + this.options.root + this.fragment));
- if (!this.options.silent) return this.loadUrl()
- }
- , stop: function() {
- o(window)
- .unbind("popstate", this.checkUrl)
- .unbind("hashchange", this.checkUrl), clearInterval(this._checkUrlInterval), v.started = !1
- }
- , route: function(e, t) {
- this.handlers.unshift({
- route: e
- , callback: t
- })
- }
- , checkUrl: function() {
- var e = this.getFragment();
- e == this.fragment && this.iframe && (e = this.getFragment(this.getHash(this.iframe)));
- if (e == this.fragment) return !1;
- this.iframe && this.navigate(e), this.loadUrl() || this.loadUrl(this.getHash())
- }
- , loadUrl: function(e) {
- var t = this.fragment = this.getFragment(e);
- return s.any(this.handlers, function(e) {
- if (e.route.test(t)) return e.callback(t), !0
- })
- }
- , navigate: function(e, t) {
- if (!v.started) return !1;
- if (!t || !0 === t) t = {
- trigger: t
- };
- var n = (e || "")
- .replace(m, "");
- this.fragment != n && (this._hasPushState ? (0 != n.indexOf(this.options.root) && (n = this.options.root + n), this.fragment = n, window.history[t.replace ? "replaceState" : "pushState"]({}, document.title, n)) : this._wantsHashChange ? (this.fragment = n, this._updateHash(window.location, n, t.replace), this.iframe && n != this.getFragment(this.getHash(this.iframe)) && (t.replace || this.iframe.document.open()
- .close(), this._updateHash(this.iframe.location, n, t.replace))) : window.location.assign(this.options.root + e), t.trigger && this.loadUrl(e))
- }
- , _updateHash: function(e, t, n) {
- n ? e.replace(e.toString()
- .replace(/(javascript:|#).*$/, "") + "#" + t) : e.hash = t
- }
- });
- var y = i.View = function(e) {
- this.cid = s.uniqueId("view"), this._configure(e || {}), this._ensureElement(), this.initialize.apply(this, arguments), this.delegateEvents()
- }
- , b = /^(\S+)\s*(.*)$/
- , w = "model,collection,el,id,attributes,className,tagName".split(",");
- s.extend(y.prototype, a, {
- tagName: "div"
- , $: function(e) {
- return this.$el.find(e)
- }
- , initialize: function() {}
- , render: function() {
- return this
- }
- , remove: function() {
- return this.$el.remove(), this
- }
- , make: function(e, t, n) {
- return e = document.createElement(e), t && o(e)
- .attr(t), n && o(e)
- .html(n), e
- }
- , setElement: function(e, t) {
- return this.$el && this.undelegateEvents(), this.$el = e instanceof o ? e : o(e), this.el = this.$el[0], !1 !== t && this.delegateEvents(), this
- }
- , delegateEvents: function(e) {
- if (e || (e = T(this, "events"))) {
- this.undelegateEvents();
- for (var t in e) {
- var n = e[t];
- s.isFunction(n) || (n = this[e[t]]);
- if (!n) throw Error('Method "' + e[t] + '" does not exist');
- var r = t.match(b)
- , i = r[1]
- , r = r[2]
- , n = s.bind(n, this)
- , i = i + (".delegateEvents" + this.cid);
- "" === r ? this.$el.bind(i, n) : this.$el.delegate(r, i, n)
- }
- }
- }
- , undelegateEvents: function() {
- this.$el.unbind(".delegateEvents" + this.cid)
- }
- , _configure: function(e) {
- this.options && (e = s.extend({}, this.options, e));
- for (var t = 0, n = w.length; t < n; t++) {
- var r = w[t];
- e[r] && (this[r] = e[r])
- }
- this.options = e
- }
- , _ensureElement: function() {
- if (this.el) this.setElement(this.el, !1);
- else {
- var e = T(this, "attributes") || {};
- this.id && (e.id = this.id), this.className && (e["class"] = this.className), this.setElement(this.make(this.tagName, e), !1)
- }
- }
- }), f.extend = l.extend = c.extend = y.extend = function(e, t) {
- var n = x(this, e, t);
- return n.extend = this.extend, n
- };
- var E = {
- create: "POST"
- , update: "PUT"
- , "delete": "DELETE"
- , read: "GET"
- };
- i.sync = function(e, t, n) {
- var r = E[e];
- n || (n = {});
- var u = {
- type: r
- , dataType: "json"
- };
- return n.url || (u.url = T(t, "url") || N()), !n.data && t && ("create" == e || "update" == e) && (u.contentType = "application/json", u.data = JSON.stringify(t.toJSON())), i.emulateJSON && (u.contentType = "application/x-www-form-urlencoded", u.data = u.data ? {
- model: u.data
- } : {}), i.emulateHTTP && ("PUT" === r || "DELETE" === r) && (i.emulateJSON && (u.data._method = r), u.type = "POST", u.beforeSend = function(e) {
- e.setRequestHeader("X-HTTP-Method-Override", r)
- }), "GET" !== u.type && !i.emulateJSON && (u.processData = !1), o.ajax(s.extend(u, n))
- }, i.wrapError = function(e, t, n) {
- return function(r, i) {
- i = r === t ? i : r, e ? e(t, i, n) : t.trigger("error", t, i, n)
- }
- };
- var S = function() {}
- , x = function(e, t, n) {
- var r;
- return r = t && t.hasOwnProperty("constructor") ? t.constructor : function() {
- e.apply(this, arguments)
- }, s.extend(r, e), S.prototype = e.prototype, r.prototype = new S, t && s.extend(r.prototype, t), n && s.extend(r, n), r.prototype.constructor = r, r.__super__ = e.prototype, r
- }
- , T = function(e, t) {
- return !e || !e[t] ? null : s.isFunction(e[t]) ? e[t]() : e[t]
- }
- , N = function() {
- throw Error('A "url" property or function must be specified')
- }
- }.call(this)
- , function() {
- "use strict";
- function t(e) {
- for (var t in e) e.hasOwnProperty(t) && (this[t] = e[t])
- }
- var e = this
- , n = new t;
- e.locache = n, t.prototype.VERSION = "0.2.0", t.prototype.supportsLocalStorage = function() {
- try {
- var e = "___locache___";
- return window.localStorage.setItem(e, e), window.localStorage.getItem(e), window.localStorage.removeItem(e), !0
- } catch (t) {
- return !1
- }
- }(), t.prototype.supportsSessionStorage = function() {
- try {
- var e = "___locache___";
- return window.sessionStorage.setItem(e, e), window.sessionStorage.getItem(e), window.sessionStorage.removeItem(e), !0
- } catch (t) {
- return !1
- }
- }(), t.prototype.supportsNativeJSON = !!window.JSON, t.prototype.cachePrefix = "___locache___", t.prototype.expirePrefix = "___locacheExpire___", t.prototype.backends = {
- local: {
- set: function(e, t) {
- return window.localStorage.setItem(e, t)
- }
- , get: function(e, t) {
- return window.localStorage.getItem(e)
- }
- , remove: function(e) {
- return window.localStorage.removeItem(e)
- }
- , length: function(e) {
- return window.localStorage.length
- }
- , key: function(e) {
- if (e < 0 || e >= this.length()) return;
- return window.localStorage.key(e)
- }
- , enabled: function() {
- return n.supportsLocalStorage
- }
- }
- , session: {
- set: function(e, t) {
- return window.sessionStorage.setItem(e, t)
- }
- , get: function(e, t) {
- return window.sessionStorage.getItem(e)
- }
- , remove: function(e) {
- return window.sessionStorage.removeItem(e)
- }
- , length: function(e) {
- return window.sessionStorage.length
- }
- , key: function(e) {
- if (e < 0 || e >= this.length()) return;
- return window.sessionStorage.key(e)
- }
- , enabled: function() {
- return n.supportsSessionStorage
- }
- }
- }, t.prototype.storage = n.backends.local;
- var r = function() {
- return (new Date)
- .getTime()
- };
- t.prototype.key = function(e) {
- return this.cachePrefix + e
- }, t.prototype.expirekey = function(e) {
- return this.expirePrefix + e
- }, t.prototype.hasExpired = function(e) {
- var t = this.expirekey(e)
- , n = parseInt(this.storage.get(t), 10);
- return n && n < r() ? !0 : !1
- }, t.prototype.set = function(e, t, n) {
- if (!this.storage.enabled() || !e) return;
- var i = this.expirekey(e)
- , s = this.key(e);
- if (n) {
- var o = n * 1e3;
- this.storage.set(i, r() + o)
- }
- t = JSON.stringify(t), this.storage.set(s, t)
- }, t.prototype.get = function(e) {
- if (!this.storage.enabled() || !e) return null;
- if (this.hasExpired(e)) return this.remove(this.key(e)), null;
- var t = this.key(e)
- , n = this.storage.get(t);
- if (n) try {
- return JSON.parse(n)
- } catch (r) {
- return null
- }
- return n
- }, t.prototype.remove = function(e) {
- if (!this.storage.enabled()) return;
- var t = this.expirekey(e)
- , n = this.key(e);
- this.storage.remove(t), this.storage.remove(n)
- }, t.prototype.incr = function(e) {
- if (!this.storage.enabled()) return;
- var t = parseInt(this.get(e), 10);
- return t || (t = 0), t++, this.set(e, t), t
- }, t.prototype.decr = function(e) {
- if (!this.storage.enabled()) return;
- var t = parseInt(this.get(e), 10);
- return t || (t = 0), t--, this.set(e, t), t
- }, t.prototype.setMany = function(e, t) {
- if (!this.storage.enabled()) return;
- for (var n in e) e.hasOwnProperty(n) && this.set(n, e[n], t)
- }, t.prototype.getMany = function(e) {
- var t = {};
- for (var n = 0; n < e.length; n++) this.storage.enabled() ? t[e[n]] = this.get(e[n]) : t[e[n]] = null;
- return t
- }, t.prototype.getManyValues = function(e) {
- var t = [];
- for (var n = 0; n < e.length; n++) this.storage.enabled() ? t.push(this.get(e[n])) : t.push(null);
- return t
- }, t.prototype.removeMany = function(e) {
- if (!this.storage.enabled()) return;
- for (var t = 0; t < e.length; t++) this.remove(e[t])
- }, t.prototype.flush = function() {
- if (!this.storage.enabled()) return;
- var e = this.storage.length()
- , t = this.cachePrefix;
- for (var n = 0; n < e; n++) {
- var r = this.storage.key(n);
- r && r.indexOf(t) === 0 && this.storage.remove(r)
- }
- }, t.prototype.length = function() {
- if (!this.storage.enabled()) return 0;
- var e = 0
- , t = this.storage.length()
- , n = this.cachePrefix;
- for (var r = 0; r < t; r++) this.storage.key(r)
- .indexOf(n) === 0 && e++;
- return e
- }, t.prototype.cleanup = function() {
- if (!this.storage.enabled()) return;
- var e = this.storage.length()
- , t = this.cachePrefix;
- for (var n = 0; n < e; n++) {
- var r = this.storage.key(n);
- if (r && r.indexOf(t) === 0) {
- var i = r.substring(t.length, r.length);
- this.hasExpired(i) && this.remove(i)
- }
- }
- }, t.prototype.createCache = function(e) {
- return new t(e)
- }, n.session = new t({
- storage: n.backends.session
- })
- }.call(this);
- var JSON;
- JSON || (JSON = {})
- , function() {
- function f(e) {
- return e < 10 ? "0" + e : e
- }
- function quote(e) {
- return escapable.lastIndex = 0, escapable.test(e) ? '"' + e.replace(escapable, function(e) {
- var t = meta[e];
- return typeof t == "string" ? t : "\\u" + ("0000" + e.charCodeAt(0)
- .toString(16))
- .slice(-4)
- }) + '"' : '"' + e + '"'
- }
- function str(e, t) {
- var n, r, i, s, o = gap
- , u, a = t[e];
- a && typeof a == "object" && typeof a.toJSON == "function" && (a = a.toJSON(e)), typeof rep == "function" && (a = rep.call(t, e, a));
- switch (typeof a) {
- case "string":
- return quote(a);
- case "number":
- return isFinite(a) ? String(a) : "null";
- case "boolean":
- case "null":
- return String(a);
- case "object":
- if (!a) return "null";
- gap += indent, u = [];
- if (Object.prototype.toString.apply(a) === "[object Array]") {
- s = a.length;
- for (n = 0; n < s; n += 1) u[n] = str(n, a) || "null";
- return i = u.length === 0 ? "[]" : gap ? "[\n" + gap + u.join(",\n" + gap) + "\n" + o + "]" : "[" + u.join(",") + "]", gap = o, i
- }
- if (rep && typeof rep == "object") {
- s = rep.length;
- for (n = 0; n < s; n += 1) typeof rep[n] == "string" && (r = rep[n], i = str(r, a), i && u.push(quote(r) + (gap ? ": " : ":") + i))
- } else
- for (r in a) Object.prototype.hasOwnProperty.call(a, r) && (i = str(r, a), i && u.push(quote(r) + (gap ? ": " : ":") + i));
- return i = u.length === 0 ? "{}" : gap ? "{\n" + gap + u.join(",\n" + gap) + "\n" + o + "}" : "{" + u.join(",") + "}", gap = o, i
- }
- }
- "use strict", typeof Date.prototype.toJSON != "function" && (Date.prototype.toJSON = function(e) {
- return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
- }, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function(e) {
- return this.valueOf()
- });
- var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g
- , escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g
- , gap, indent, meta = {
- "\b": "\\b"
- , " ": "\\t"
- , "\n": "\\n"
- , "\f": "\\f"
- , "\r": "\\r"
- , '"': '\\"'
- , "\\": "\\\\"
- }
- , rep;
- typeof JSON.stringify != "function" && (JSON.stringify = function(e, t, n) {
- var r;
- gap = "", indent = "";
- if (typeof n == "number")
- for (r = 0; r < n; r += 1) indent += " ";
- else typeof n == "string" && (indent = n);
- rep = t;
- if (!t || typeof t == "function" || typeof t == "object" && typeof t.length == "number") return str("", {
- "": e
- });
- throw new Error("JSON.stringify")
- }), typeof JSON.parse != "function" && (JSON.parse = function(text, reviver) {
- function walk(e, t) {
- var n, r, i = e[t];
- if (i && typeof i == "object")
- for (n in i) Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n), r !== undefined ? i[n] = r : delete i[n]);
- return reviver.call(e, t, i)
- }
- var j;
- text = String(text), cx.lastIndex = 0, cx.test(text) && (text = text.replace(cx, function(e) {
- return "\\u" + ("0000" + e.charCodeAt(0)
- .toString(16))
- .slice(-4)
- }));
- if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
- .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
- .replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return j = eval("(" + text + ")"), typeof reviver == "function" ? walk({
- "": j
- }, "") : j;
- throw new SyntaxError("JSON.parse")
- })
- }(), jQuery.base64 = function(e) {
- function t(e, t) {
- var n = o.indexOf(e.charAt(t));
- if (n === -1) throw "Cannot decode base64";
- return n
- }
- function n(e) {
- var n = 0
- , r, i, o = e.length
- , u = [];
- e = String(e);
- if (o === 0) return e;
- if (o % 4 !== 0) throw "Cannot decode base64";
- e.charAt(o - 1) === s && (n = 1, e.charAt(o - 2) === s && (n = 2), o -= 4);
- for (r = 0; r < o; r += 4) i = t(e, r) << 18 | t(e, r + 1) << 12 | t(e, r + 2) << 6 | t(e, r + 3), u.push(String.fromCharCode(i >> 16, i >> 8 & 255, i & 255));
- switch (n) {
- case 1:
- i = t(e, r) << 18 | t(e, r + 1) << 12 | t(e, r + 2) << 6, u.push(String.fromCharCode(i >> 16, i >> 8 & 255));
- break;
- case 2:
- i = t(e, r) << 18 | t(e, r + 1) << 12, u.push(String.fromCharCode(i >> 16))
- }
- return u.join("")
- }
- function r(e, t) {
- var n = e.charCodeAt(t);
- if (n > 255) throw "INVALID_CHARACTER_ERR: DOM Exception 5";
- return n
- }
- function i(e) {
- if (arguments.length !== 1) throw "SyntaxError: exactly one argument required";
- e = String(e);
- var t, n, i = []
- , u = e.length - e.length % 3;
- if (e.length === 0) return e;
- for (t = 0; t < u; t += 3) n = r(e, t) << 16 | r(e, t + 1) << 8 | r(e, t + 2), i.push(o.charAt(n >> 18)), i.push(o.charAt(n >> 12 & 63)), i.push(o.charAt(n >> 6 & 63)), i.push(o.charAt(n & 63));
- switch (e.length - u) {
- case 1:
- n = r(e, t) << 16, i.push(o.charAt(n >> 18) + o.charAt(n >> 12 & 63) + s + s);
- break;
- case 2:
- n = r(e, t) << 16 | r(e, t + 1) << 8, i.push(o.charAt(n >> 18) + o.charAt(n >> 12 & 63) + o.charAt(n >> 6 & 63) + s)
- }
- return i.join("")
- }
- var s = "="
- , o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
- , u = "1.0";
- return {
- decode: n
- , encode: i
- , VERSION: u
- }
- }(jQuery), jQuery.easing.jswing = jQuery.easing.swing, jQuery.extend(jQuery.easing, {
- def: "easeOutQuad"
- , swing: function(e, t, n, r, i) {
- return jQuery.easing[jQuery.easing.def](e, t, n, r, i)
- }
- , easeInQuad: function(e, t, n, r, i) {
- return r * (t /= i) * t + n
- }
- , easeOutQuad: function(e, t, n, r, i) {
- return -r * (t /= i) * (t - 2) + n
- }
- , easeInOutQuad: function(e, t, n, r, i) {
- return (t /= i / 2) < 1 ? r / 2 * t * t + n : -r / 2 * (--t * (t - 2) - 1) + n
- }
- , easeInCubic: function(e, t, n, r, i) {
- return r * (t /= i) * t * t + n
- }
- , easeOutCubic: function(e, t, n, r, i) {
- return r * ((t = t / i - 1) * t * t + 1) + n
- }
- , easeInOutCubic: function(e, t, n, r, i) {
- return (t /= i / 2) < 1 ? r / 2 * t * t * t + n : r / 2 * ((t -= 2) * t * t + 2) + n
- }
- , easeInQuart: function(e, t, n, r, i) {
- return r * (t /= i) * t * t * t + n
- }
- , easeOutQuart: function(e, t, n, r, i) {
- return -r * ((t = t / i - 1) * t * t * t - 1) + n
- }
- , easeInOutQuart: function(e, t, n, r, i) {
- return (t /= i / 2) < 1 ? r / 2 * t * t * t * t + n : -r / 2 * ((t -= 2) * t * t * t - 2) + n
- }
- , easeInQuint: function(e, t, n, r, i) {
- return r * (t /= i) * t * t * t * t + n
- }
- , easeOutQuint: function(e, t, n, r, i) {
- return r * ((t = t / i - 1) * t * t * t * t + 1) + n
- }
- , easeInOutQuint: function(e, t, n, r, i) {
- return (t /= i / 2) < 1 ? r / 2 * t * t * t * t * t + n : r / 2 * ((t -= 2) * t * t * t * t + 2) + n
- }
- , easeInSine: function(e, t, n, r, i) {
- return -r * Math.cos(t / i * (Math.PI / 2)) + r + n
- }
- , easeOutSine: function(e, t, n, r, i) {
- return r * Math.sin(t / i * (Math.PI / 2)) + n
- }
- , easeInOutSine: function(e, t, n, r, i) {
- return -r / 2 * (Math.cos(Math.PI * t / i) - 1) + n
- }
- , easeInExpo: function(e, t, n, r, i) {
- return t == 0 ? n : r * Math.pow(2, 10 * (t / i - 1)) + n
- }
- , easeOutExpo: function(e, t, n, r, i) {
- return t == i ? n + r : r * (-Math.pow(2, -10 * t / i) + 1) + n
- }
- , easeInOutExpo: function(e, t, n, r, i) {
- return t == 0 ? n : t == i ? n + r : (t /= i / 2) < 1 ? r / 2 * Math.pow(2, 10 * (t - 1)) + n : r / 2 * (-Math.pow(2, -10 * --t) + 2) + n
- }
- , easeInCirc: function(e, t, n, r, i) {
- return -r * (Math.sqrt(1 - (t /= i) * t) - 1) + n
- }
- , easeOutCirc: function(e, t, n, r, i) {
- return r * Math.sqrt(1 - (t = t / i - 1) * t) + n
- }
- , easeInOutCirc: function(e, t, n, r, i) {
- return (t /= i / 2) < 1 ? -r / 2 * (Math.sqrt(1 - t * t) - 1) + n : r / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + n
- }
- , easeInElastic: function(e, t, n, r, i) {
- var s = 1.70158
- , o = 0
- , u = r;
- if (t == 0) return n;
- if ((t /= i) == 1) return n + r;
- o || (o = i * .3);
- if (u < Math.abs(r)) {
- u = r;
- var s = o / 4
- } else var s = o / (2 * Math.PI) * Math.asin(r / u);
- return -(u * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * i - s) * 2 * Math.PI / o)) + n
- }
- , easeOutElastic: function(e, t, n, r, i) {
- var s = 1.70158
- , o = 0
- , u = r;
- if (t == 0) return n;
- if ((t /= i) == 1) return n + r;
- o || (o = i * .3);
- if (u < Math.abs(r)) {
- u = r;
- var s = o / 4
- } else var s = o / (2 * Math.PI) * Math.asin(r / u);
- return u * Math.pow(2, -10 * t) * Math.sin((t * i - s) * 2 * Math.PI / o) + r + n
- }
- , easeInOutElastic: function(e, t, n, r, i) {
- var s = 1.70158
- , o = 0
- , u = r;
- if (t == 0) return n;
- if ((t /= i / 2) == 2) return n + r;
- o || (o = i * .3 * 1.5);
- if (u < Math.abs(r)) {
- u = r;
- var s = o / 4
- } else var s = o / (2 * Math.PI) * Math.asin(r / u);
- return t < 1 ? -0.5 * u * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * i - s) * 2 * Math.PI / o) + n : u * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * i - s) * 2 * Math.PI / o) * .5 + r + n
- }
- , easeInBack: function(e, t, n, r, i, s) {
- return s == undefined && (s = 1.70158), r * (t /= i) * t * ((s + 1) * t - s) + n
- }
- , easeOutBack: function(e, t, n, r, i, s) {
- return s == undefined && (s = 1.70158), r * ((t = t / i - 1) * t * ((s + 1) * t + s) + 1) + n
- }
- , easeInOutBack: function(e, t, n, r, i, s) {
- return s == undefined && (s = 1.70158), (t /= i / 2) < 1 ? r / 2 * t * t * (((s *= 1.525) + 1) * t - s) + n : r / 2 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + n
- }
- , easeInBounce: function(e, t, n, r, i) {
- return r - jQuery.easing.easeOutBounce(e, i - t, 0, r, i) + n
- }
- , easeOutBounce: function(e, t, n, r, i) {
- return (t /= i) < 1 / 2.75 ? r * 7.5625 * t * t + n : t < 2 / 2.75 ? r * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + n : t < 2.5 / 2.75 ? r * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + n : r * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + n
- }
- , easeInOutBounce: function(e, t, n, r, i) {
- return t < i / 2 ? jQuery.easing.easeInBounce(e, t * 2, 0, r, i) * .5 + n : jQuery.easing.easeOutBounce(e, t * 2 - i, 0, r, i) * .5 + r * .5 + n
- }
- })
- , function(e) {
- e.fn.touchwipe = function(t) {
- var n = {
- min_move_x: 20
- , min_move_y: 20
- , wipeLeft: function() {}
- , wipeRight: function() {}
- , wipeUp: function() {}
- , wipeDown: function() {}
- , preventDefaultEvents: !0
- };
- return t && e.extend(n, t), this.each(function() {
- function i() {
- this.removeEventListener("touchmove", s), e = null, r = !1
- }
- function s(s) {
- n.preventDefaultEvents && s.preventDefault();
- if (r) {
- var o = s.touches[0].pageX
- , u = s.touches[0].pageY
- , a = e - o
- , f = t - u;
- Math.abs(a) >= n.min_move_x ? (i(), a > 0 ? n.wipeLeft() : n.wipeRight()) : Math.abs(f) >= n.min_move_y && (i(), f > 0 ? n.wipeDown() : n.wipeUp())
- }
- }
- function o(n) {
- n.touches.length == 1 && (e = n.touches[0].pageX, t = n.touches[0].pageY, r = !0, this.addEventListener("touchmove", s, !1))
- }
- var e, t, r = !1;
- "ontouchstart" in document.documentElement && this.addEventListener("touchstart", o, !1)
- }), this
- }
- }(jQuery)
- , function(e) {
- function t() {
- var t = e("script:first")
- , n = t.css("color")
- , r = !1;
- if (/^rgba/.test(n)) r = !0;
- else try {
- r = n != t.css("color", "rgba(0, 0, 0, 0.5)")
- .css("color"), t.css("color", n)
- } catch (i) {}
- return r
- }
- function n(t, n, r) {
- var i = "rgb" + (e.support.rgba ? "a" : "") + "(" + parseInt(t[0] + r * (n[0] - t[0]), 10) + "," + parseInt(t[1] + r * (n[1] - t[1]), 10) + "," + parseInt(t[2] + r * (n[2] - t[2]), 10);
- return e.support.rgba && (i += "," + (t && n ? parseFloat(t[3] + r * (n[3] - t[3])) : 1)), i += ")", i
- }
- function r(e) {
- var t, n;
- if (t = /#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(e)) n = [parseInt(t[1], 16), parseInt(t[2], 16), parseInt(t[3], 16), 1];
- else if (t = /#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(e)) n = [parseInt(t[1], 16) * 17, parseInt(t[2], 16) * 17, parseInt(t[3], 16) * 17, 1];
- else if (t = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e)) n = [parseInt(t[1]), parseInt(t[2]), parseInt(t[3]), 1];
- else if (t = /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(e)) n = [parseInt(t[1], 10), parseInt(t[2], 10), parseInt(t[3], 10), parseFloat(t[4])];
- return n
- }
- e.extend(!0, e, {
- support: {
- rgba: t()
- }
- });
- var i = ["color", "backgroundColor", "borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor", "outlineColor"];
- e.each(i, function(t, i) {
- e.Tween.propHooks[i] = {
- get: function(t) {
- return e(t.elem)
- .css(i)
- }
- , set: function(t) {
- var s = t.elem.style
- , o = r(e(t.elem)
- .css(i))
- , u = r(t.end);
- t.run = function(e) {
- s[i] = n(o, u, e)
- }
- }
- }
- }), e.Tween.propHooks.borderColor = {
- set: function(t) {
- var s = t.elem.style
- , o = []
- , u = i.slice(2, 6);
- e.each(u, function(n, i) {
- o[i] = r(e(t.elem)
- .css(i))
- });
- var a = r(t.end);
- t.run = function(t) {
- e.each(u, function(e, r) {
- s[r] = n(o[r], a, t)
- })
- }
- }
- }
- }(jQuery)
- , function(e) {
- typeof String.prototype.trim == "undefined" && (String.prototype.trim = function() {
- return e.trim(this)
- }), e.fn.dataOrTitle = function() {
- return this.data("title") || this.attr("title") || ""
- }, e.getWrappedObject = function(t, n) {
- if (typeof t == "object") {
- var r = t.__self;
- return r && typeof r == "object" && r.constructor === e ? r : (t.__self = e(t), typeof n == "object" && (t.__self = _.extend(t.__self, n)), t.__self)
- }
- return null
- }, e.fn.switchClass = function(e, t) {
- return this.hasClass(e) ? this.removeClass(e)
- .addClass(t) : this.removeClass(t)
- .addClass(e)
- }, e.fn.wrapEach = function(t, n, r) {
- var i = this
- , s = i.children(n)
- , r = e(r);
- for (var o, u, a = 0, f = s.length; a < f; a++) o = s.eq(a), a % t === 0 ? (u = r.clone(), o.before(u)
- .appendTo(u)) : o.appendTo(u)
- }
- }.call(window, jQuery)
- , function(e) {
- function t() {
- return url = location.href, hashtag = url.indexOf("#prettyPhoto") !== -1 ? decodeURI(url.substring(url.indexOf("#prettyPhoto") + 1, url.length)) : !1, hashtag
- }
- function n() {
- if (typeof theRel == "undefined") return;
- location.hash = theRel + "/" + rel_index + "/"
- }
- function r() {
- location.href.indexOf("#prettyPhoto") !== -1 && (location.hash = "prettyPhoto")
- }
- function i(e, t) {
- e = e.replace(/[\[]/, "\\[")
- .replace(/[\]]/, "\\]");
- var n = "[\\?&]" + e + "=([^&#]*)"
- , r = new RegExp(n)
- , i = r.exec(t);
- return i == null ? "" : i[1]
- }
- e.prettyPhoto = {
- version: "3.1.4"
- }, e.fn.prettyPhoto = function(s) {
- function g() {
- e(".pp_loaderIcon")
- .hide(), projectedTop = scroll_pos.scrollTop + (d / 2 - a.containerHeight / 2), projectedTop < 0 && (projectedTop = 0), $ppt.fadeTo(settings.animation_speed, 1), $pp_pic_holder.find(".pp_content")
- .animate({
- height: a.contentHeight
- , width: a.contentWidth
- }, settings.animation_speed), $pp_pic_holder.animate({
- top: projectedTop
- , left: v / 2 - a.containerWidth / 2 < 0 ? 0 : v / 2 - a.containerWidth / 2
- , width: a.containerWidth
- }, settings.animation_speed, function() {
- $pp_pic_holder.find(".pp_hoverContainer,#fullResImage")
- .height(a.height)
- .width(a.width), $pp_pic_holder.find(".pp_fade")
- .fadeIn(settings.animation_speed), isSet && S(pp_images[set_position]) == "image" ? $pp_pic_holder.find(".pp_hoverContainer")
- .show() : $pp_pic_holder.find(".pp_hoverContainer")
- .hide(), settings.allow_expand && (a.resized ? e("a.pp_expand,a.pp_contract")
- .show() : e("a.pp_expand")
- .hide()), settings.autoplay_slideshow && !m && !f && e.prettyPhoto.startSlideshow(), settings.changepicturecallback(), f = !0
- }), C(), s.ajaxcallback()
- }
- function y(t) {
- $pp_pic_holder.find("#pp_full_res object,#pp_full_res embed")
- .css("visibility", "hidden"), $pp_pic_holder.find(".pp_fade")
- .fadeOut(settings.animation_speed, function() {
- e(".pp_loaderIcon")
- .show(), t()
- })
- }
- function b(t) {
- t > 1 ? e(".pp_nav")
- .show() : e(".pp_nav")
- .hide()
- }
- function w(e, t) {
- resized = !1, E(e, t), imageWidth = e, imageHeight = t;
- if ((p > v || h > d) && doresize && settings.allow_resize && !u) {
- resized = !0, fitting = !1;
- while (!fitting) p > v ? (imageWidth = v - 200, imageHeight = t / e * imageWidth) : h > d ? (imageHeight = d - 200, imageWidth = e / t * imageHeight) : fitting = !0, h = imageHeight, p = imageWidth;
- E(imageWidth, imageHeight), (p > v || h > d) && w(p, h)
- }
- return {
- width: Math.floor(imageWidth)
- , height: Math.floor(imageHeight)
- , containerHeight: Math.floor(h)
- , containerWidth: Math.floor(p) + settings.horizontal_padding * 2
- , contentHeight: Math.floor(l)
- , contentWidth: Math.floor(c)
- , resized: resized
- }
- }
- function E(t, n) {
- t = parseFloat(t), n = parseFloat(n), $pp_details = $pp_pic_holder.find(".pp_details"), $pp_details.width(t), detailsHeight = parseFloat($pp_details.css("marginTop")) + parseFloat($pp_details.css("marginBottom")), $pp_details = $pp_details.clone()
- .addClass(settings.theme)
- .width(t)
- .appendTo(e("body"))
- .css({
- position: "absolute"
- , top: -1e4
- }), detailsHeight += $pp_details.height(), detailsHeight = detailsHeight <= 34 ? 36 : detailsHeight, e.browser.msie && e.browser.version == 7 && (detailsHeight += 8), $pp_details.remove(), $pp_title = $pp_pic_holder.find(".ppt"), $pp_title.width(t), titleHeight = parseFloat($pp_title.css("marginTop")) + parseFloat($pp_title.css("marginBottom")), $pp_title = $pp_title.clone()
- .appendTo(e("body"))
- .css({
- position: "absolute"
- , top: -1e4
- }), titleHeight += $pp_title.height(), $pp_title.remove(), l = n + detailsHeight, c = t, h = l + titleHeight + $pp_pic_holder.find(".pp_top")
- .height() + $pp_pic_holder.find(".pp_bottom")
- .height(), p = t
- }
- function S(e) {
- return e.match(/youtube\.com\/watch/i) || e.match(/youtu\.be/i) ? "youtube" : e.match(/vimeo\.com/i) ? "vimeo" : e.match(/\b.mov\b/i) ? "quicktime" : e.match(/\b.swf\b/i) ? "flash" : e.match(/\biframe=true\b/i) ? "iframe" : e.match(/\bajax=true\b/i) ? "ajax" : e.match(/\bcustom=true\b/i) ? "custom" : e.substr(0, 1) == "#" ? "inline" : "image"
- }
- function x() {
- if (doresize && typeof $pp_pic_holder != "undefined") {
- scroll_pos = T(), contentHeight = $pp_pic_holder.height(), contentwidth = $pp_pic_holder.width(), projectedTop = d / 2 + scroll_pos.scrollTop - contentHeight / 2, projectedTop < 0 && (projectedTop = 0);
- if (contentHeight > d) return;
- $pp_pic_holder.css({
- top: projectedTop
- , left: v / 2 + scroll_pos.scrollLeft - contentwidth / 2
- })
- }
- }
- function T() {
- if (self.pageYOffset) return {
- scrollTop: self.pageYOffset
- , scrollLeft: self.pageXOffset
- };
- if (document.documentElement && document.documentElement.scrollTop) return {
- scrollTop: document.documentElement.scrollTop
- , scrollLeft: document.documentElement.scrollLeft
- };
- if (document.body) return {
- scrollTop: document.body.scrollTop
- , scrollLeft: document.body.scrollLeft
- }
- }
- function N() {
- d = e(window)
- .height(), v = e(window)
- .width(), typeof $pp_overlay != "undefined" && $pp_overlay.height(e(document)
- .height())
- .width(v)
- }
- function C() {
- isSet && settings.overlay_gallery && S(pp_images[set_position]) == "image" && settings.ie6_fallback && (!e.browser.msie || parseInt(e.browser.version) != 6) ? (itemWidth = 57, navWidth = settings.theme == "facebook" || settings.theme == "pp_default" ? 50 : 30, itemsPerPage = Math.floor((a.containerWidth - 100 - navWidth) / itemWidth), itemsPerPage = itemsPerPage < pp_images.length ? itemsPerPage : pp_images.length, totalPage = Math.ceil(pp_images.length / itemsPerPage) - 1, totalPage == 0 ? (navWidth = 0, $pp_gallery.find(".pp_arrow_next,.pp_arrow_previous")
- .hide()) : $pp_gallery.find(".pp_arrow_next,.pp_arrow_previous")
- .show(), galleryWidth = itemsPerPage * itemWidth, fullGalleryWidth = pp_images.length * itemWidth, $pp_gallery.css("margin-left", -(galleryWidth / 2 + navWidth / 2))
- .find("div:first")
- .width(galleryWidth + 5)
- .find("ul")
- .width(fullGalleryWidth)
- .find("li.selected")
- .removeClass("selected"), goToPage = Math.floor(set_position / itemsPerPage) < totalPage ? Math.floor(set_position / itemsPerPage) : totalPage, e.prettyPhoto.changeGalleryPage(goToPage), $pp_gallery_li.filter(":eq(" + set_position + ")")
- .addClass("selected")) : $pp_pic_holder.find(".pp_content")
- .unbind("mouseenter mouseleave")
- }
- function k(t) {
- settings.social_tools && (facebook_like_link = settings.social_tools.replace("{location_href}", encodeURIComponent(location.href))), settings.markup = settings.markup.replace("{pp_social}", ""), e("body")
- .append(settings.markup), $pp_pic_holder = e(".pp_pic_holder"), $ppt = e(".ppt"), $pp_overlay = e("div.pp_overlay");
- if (isSet && settings.overlay_gallery) {
- currentGalleryPage = 0, toInject = "";
- for (var n = 0; n < pp_images.length; n++) pp_images[n].match(/\b(jpg|jpeg|png|gif)\b/gi) ? (classname = "", img_src = pp_images[n]) : (classname = "default", img_src = ""), toInject += "<li class='" + classname + "'><a href='#'><img src='" + img_src + "' width='50' alt='' /></a></li>";
- toInject = settings.gallery_markup.replace(/{gallery}/g, toInject), $pp_pic_holder.find("#pp_full_res")
- .after(toInject), $pp_gallery = e(".pp_pic_holder .pp_gallery"), $pp_gallery_li = $pp_gallery.find("li"), $pp_gallery.find(".pp_arrow_next")
- .click(function() {
- return e.prettyPhoto.changeGalleryPage("next"), e.prettyPhoto.stopSlideshow(), !1
- }), $pp_gallery.find(".pp_arrow_previous")
- .click(function() {
- return e.prettyPhoto.changeGalleryPage("previous"), e.prettyPhoto.stopSlideshow(), !1
- }), $pp_pic_holder.find(".pp_content")
- .hover(function() {
- $pp_pic_holder.find(".pp_gallery:not(.disabled)")
- .fadeIn()
- }, function() {
- $pp_pic_holder.find(".pp_gallery:not(.disabled)")
- .fadeOut()
- }), itemWidth = 57, $pp_gallery_li.each(function(t) {
- e(this)
- .find("a")
- .click(function() {
- return e.prettyPhoto.changePage(t), e.prettyPhoto.stopSlideshow(), !1
- })
- })
- }
- settings.slideshow && ($pp_pic_holder.find(".pp_nav")
- .prepend('<a href="#" class="pp_play">Play</a>'), $pp_pic_holder.find(".pp_nav .pp_play")
- .click(function() {
- return e.prettyPhoto.startSlideshow(), !1
- })), $pp_pic_holder.attr("class", "pp_pic_holder " + settings.theme), $pp_overlay.css({
- opacity: 0
- , height: e(document)
- .height()
- , width: e(window)
- .width()
- })
- .bind("click", function() {
- settings.modal || e.prettyPhoto.close()
- }), e("a.pp_close")
- .bind("click", function() {
- return e.prettyPhoto.close(), !1
- }), settings.allow_expand && e("a.pp_expand")
- .bind("click", function(t) {
- return e(this)
- .hasClass("pp_expand") ? (e(this)
- .removeClass("pp_expand")
- .addClass("pp_contract"), doresize = !1) : (e(this)
- .removeClass("pp_contract")
- .addClass("pp_expand"), doresize = !0), y(function() {
- e.prettyPhoto.open()
- }), !1
- }), $pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous")
- .bind("click", function() {
- return e.prettyPhoto.changePage("previous"), e.prettyPhoto.stopSlideshow(), !1
- }), $pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next")
- .bind("click", function() {
- return e.prettyPhoto.changePage("next"), e.prettyPhoto.stopSlideshow(), !1
- }), x()
- }
- s = jQuery.extend({
- hook: "rel"
- , animation_speed: "fast"
- , ajaxcallback: function() {}
- , slideshow: 5e3
- , autoplay_slideshow: !1
- , opacity: .8
- , show_title: !0
- , allow_resize: !0
- , allow_expand: !0
- , default_width: 500
- , default_height: 344
- , counter_separator_label: "/"
- , theme: "pp_default"
- , horizontal_padding: 20
- , hideflash: !1
- , wmode: "opaque"
- , autoplay: !0
- , modal: !1
- , deeplinking: !0
- , overlay_gallery: !0
- , overlay_gallery_max: 30
- , keyboard_shortcuts: !0
- , changepicturecallback: function() {}
- , callback: function() {}
- , ie6_fallback: !0
- , markup: '<div class="pp_pic_holder"> <div class="ppt"> </div> <div class="pp_top"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> <div class="pp_content_container"> <div class="pp_left"> <div class="pp_right"> <div class="pp_content"> <div class="pp_loaderIcon"></div> <div class="pp_fade"> <a href="#" class="pp_expand" title="Expand the image">Expand</a> <div class="pp_hoverContainer"> <a class="pp_next" href="#">next</a> <a class="pp_previous" href="#">previous</a> </div> <div id="pp_full_res"></div> <div class="pp_details"> <div class="pp_nav"> <a href="#" class="pp_arrow_previous">Previous</a> <p class="currentTextHolder">0/0</p> <a href="#" class="pp_arrow_next">Next</a> </div> <p class="pp_description"></p> <div class="pp_social">{pp_social}</div> <a class="pp_close" href="#">Close</a> </div> </div> </div> </div> </div> </div> <div class="pp_bottom"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> </div> <div class="pp_overlay"></div>'
- , gallery_markup: '<div class="pp_gallery"> <a href="#" class="pp_arrow_previous">Previous</a> <div> <ul> {gallery} </ul> </div> <a href="#" class="pp_arrow_next">Next</a> </div>'
- , image_markup: '<img id="fullResImage" src="{path}" />'
- , flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>'
- , quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>'
- , iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>'
- , inline_markup: '<div class="pp_inline">{content}</div>'
- , custom_markup: ""
- , social_tools: '<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&layout=button_count&show_faces=true&width=500&action=like&font&colorscheme=light&height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>'
- }, s);
- var o = this
- , u = !1
- , a, f, l, c, h, p, d = e(window)
- .height()
- , v = e(window)
- .width()
- , m;
- return doresize = !0, scroll_pos = T(), e(window)
- .unbind("resize.prettyphoto")
- .bind("resize.prettyphoto", function() {
- x(), N()
- }), s.keyboard_shortcuts && e(document)
- .unbind("keydown.prettyphoto")
- .bind("keydown.prettyphoto", function(t) {
- if (typeof $pp_pic_holder != "undefined" && $pp_pic_holder.is(":visible")) switch (t.keyCode) {
- case 37:
- e.prettyPhoto.changePage("previous"), t.preventDefault();
- break;
- case 39:
- e.prettyPhoto.changePage("next"), t.preventDefault();
- break;
- case 27:
- settings.modal || e.prettyPhoto.close(), t.preventDefault()
- }
- }), e.prettyPhoto.initialize = function() {
- return settings = s, settings.theme == "pp_default" && (settings.horizontal_padding = 16), settings.ie6_fallback && e.browser.msie && parseInt(e.browser.version) == 6 && (settings.theme = "light_square"), theRel = e(this)
- .attr(settings.hook), galleryRegExp = /\[(?:.*)\]/, isSet = galleryRegExp.exec(theRel) ? !0 : !1, pp_images = isSet ? jQuery.map(o, function(t, n) {
- if (e(t)
- .attr(settings.hook)
- .indexOf(theRel) != -1) return e(t)
- .attr("href")
- }) : e.makeArray(e(this)
- .attr("href")), pp_titles = isSet ? jQuery.map(o, function(t, n) {
- if (e(t)
- .attr(settings.hook)
- .indexOf(theRel) != -1) return e(t)
- .find("img")
- .attr("alt") ? e(t)
- .find("img")
- .attr("alt") : ""
- }) : e.makeArray(e(this)
- .find("img")
- .attr("alt")), pp_descriptions = isSet ? jQuery.map(o, function(t, n) {
- if (e(t)
- .attr(settings.hook)
- .indexOf(theRel) != -1) return e(t)
- .dataOrTitle("title") ? e(t)
- .dataOrTitle("title") : ""
- }) : e.makeArray(e(this)
- .dataOrTitle("title")), pp_images.length > settings.overlay_gallery_max && (settings.overlay_gallery = !1), set_position = jQuery.inArray(e(this)
- .attr("href"), pp_images), rel_index = isSet ? set_position : e("a[" + settings.hook + "^='" + theRel + "']")
- .index(e(this)), k(this), settings.allow_resize && e(window)
- .bind("scroll.prettyphoto", function() {
- x()
- }), e.prettyPhoto.open(), !1
- }, e.prettyPhoto.open = function(t) {
- return typeof settings == "undefined" && (settings = s, e.browser.msie && e.browser.version == 6 && (settings.theme = "light_square"), pp_images = e.makeArray(arguments[0]), pp_titles = arguments[1] ? e.makeArray(arguments[1]) : e.makeArray(""), pp_descriptions = arguments[2] ? e.makeArray(arguments[2]) : e.makeArray(""), isSet = pp_images.length > 1 ? !0 : !1, set_position = arguments[3] ? arguments[3] : 0, k(t.target)), e.browser.msie && e.browser.version == 6 && e("select")
- .css("visibility", "hidden"), settings.hideflash && e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]")
- .css("visibility", "hidden"), b(e(pp_images)
- .size()), e(".pp_loaderIcon")
- .show(), settings.deeplinking && n(), settings.social_tools && (facebook_like_link = settings.social_tools.replace("{location_href}", encodeURIComponent(location.href)), $pp_pic_holder.find(".pp_social")
- .html(facebook_like_link)), $ppt.is(":hidden") && $ppt.css("opacity", 0)
- .show(), $pp_overlay.show()
- .fadeTo(settings.animation_speed, settings.opacity), $pp_pic_holder.find(".currentTextHolder")
- .text(set_position + 1 + settings.counter_separator_label + e(pp_images)
- .size()), typeof pp_descriptions[set_position] != "undefined" && pp_descriptions[set_position] != "" ? $pp_pic_holder.find(".pp_description")
- .show()
- .html(unescape(pp_descriptions[set_position])) : $pp_pic_holder.find(".pp_description")
- .hide(), movie_width = parseFloat(i("width", pp_images[set_position])) ? i("width", pp_images[set_position]) : settings.default_width.toString(), movie_height = parseFloat(i("height", pp_images[set_position])) ? i("height", pp_images[set_position]) : settings.default_height.toString(), u = !1, movie_height.indexOf("%") != -1 && (movie_height = parseFloat(e(window)
- .height() * parseFloat(movie_height) / 100 - 150), u = !0), movie_width.indexOf("%") != -1 && (movie_width = parseFloat(e(window)
- .width() * parseFloat(movie_width) / 100 - 150), u = !0), $pp_pic_holder.fadeIn(function() {
- settings.show_title && pp_titles[set_position] != "" && typeof pp_titles[set_position] != "undefined" ? $ppt.html(unescape(pp_titles[set_position])) : $ppt.html(" "), imgPreloader = "", skipInjection = !1;
- switch (S(pp_images[set_position])) {
- case "image":
- imgPreloader = new Image, nextImage = new Image, isSet && set_position < e(pp_images)
- .size() - 1 && (nextImage.src = pp_images[set_position + 1]), prevImage = new Image, isSet && pp_images[set_position - 1] && (prevImage.src = pp_images[set_position - 1]), $pp_pic_holder.find("#pp_full_res")[0].innerHTML = settings.image_markup.replace(/{path}/g, pp_images[set_position]), imgPreloader.onload = function() {
- a = w(imgPreloader.width, imgPreloader.height), g()
- }, imgPreloader.onerror = function() {
- alert("Image cannot be loaded. Make sure the path is correct and image exist."), e.prettyPhoto.close()
- }, imgPreloader.src = pp_images[set_position];
- break;
- case "youtube":
- a = w(movie_width, movie_height), movie_id = i("v", pp_images[set_position]), movie_id == "" && (movie_id = pp_images[set_position].split("youtu.be/"), movie_id = movie_id[1], movie_id.indexOf("?") > 0 && (movie_id = movie_id.substr(0, movie_id.indexOf("?"))), movie_id.indexOf("&") > 0 && (movie_id = movie_id.substr(0, movie_id.indexOf("&")))), movie = "http://www.youtube.com/embed/" + movie_id, i("rel", pp_images[set_position]) ? movie += "?rel=" + i("rel", pp_images[set_position]) : movie += "?rel=1", settings.autoplay && (movie += "&autoplay=1"), toInject = settings.iframe_markup.replace(/{width}/g, a.width)
- .replace(/{height}/g, a.height)
- .replace(/{wmode}/g, settings.wmode)
- .replace(/{path}/g, movie);
- break;
- case "vimeo":
- a = w(movie_width, movie_height), movie_id = pp_images[set_position];
- var t = /http:\/\/(www\.)?vimeo.com\/(\d+)/
- , n = movie_id.match(t);
- movie = "http://player.vimeo.com/video/" + n[2] + "?title=0&byline=0&portrait=0", settings.autoplay && (movie += "&autoplay=1;"), vimeo_width = a.width + "/embed/?moog_width=" + a.width, toInject = settings.iframe_markup.replace(/{width}/g, vimeo_width)
- .replace(/{height}/g, a.height)
- .replace(/{path}/g, movie);
- break;
- case "quicktime":
- a = w(movie_width, movie_height), a.height += 15, a.contentHeight += 15, a.containerHeight += 15, toInject = settings.quicktime_markup.replace(/{width}/g, a.width)
- .replace(/{height}/g, a.height)
- .replace(/{wmode}/g, settings.wmode)
- .replace(/{path}/g, pp_images[set_position])
- .replace(/{autoplay}/g, settings.autoplay);
- break;
- case "flash":
- a = w(movie_width, movie_height), flash_vars = pp_images[set_position], flash_vars = flash_vars.substring(pp_images[set_position].indexOf("flashvars") + 10, pp_images[set_position].length), filename = pp_images[set_position], filename = filename.substring(0, filename.indexOf("?")), toInject = settings.flash_markup.replace(/{width}/g, a.width)
- .replace(/{height}/g, a.height)
- .replace(/{wmode}/g, settings.wmode)
- .replace(/{path}/g, filename + "?" + flash_vars);
- break;
- case "iframe":
- a = w(movie_width, movie_height), frame_url = pp_images[set_position], frame_url = frame_url.substr(0, frame_url.indexOf("iframe") - 1), toInject = settings.iframe_markup.replace(/{width}/g, a.width)
- .replace(/{height}/g, a.height)
- .replace(/{path}/g, frame_url);
- break;
- case "ajax":
- doresize = !1, a = w(movie_width, movie_height), doresize = !0, skipInjection = !0, e.get(pp_images[set_position], function(e) {
- toInject = settings.inline_markup.replace(/{content}/g, e), $pp_pic_holder.find("#pp_full_res")[0].innerHTML = toInject, g()
- });
- break;
- case "custom":
- a = w(movie_width, movie_height), toInject = settings.custom_markup;
- break;
- case "inline":
- myClone = e(pp_images[set_position])
- .clone()
- .append('<br clear="all" />')
- .css({
- width: settings.default_width
- })
- .wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>')
- .appendTo(e("body"))
- .show(), doresize = !1, a = w(e(myClone)
- .width(), e(myClone)
- .height()), doresize = !0, e(myClone)
- .remove(), toInject = settings.inline_markup.replace(/{content}/g, e(pp_images[set_position])
- .html())
- }!imgPreloader && !skipInjection && ($pp_pic_holder.find("#pp_full_res")[0].innerHTML = toInject, g())
- }), !1
- }, e.prettyPhoto.changePage = function(t) {
- currentGalleryPage = 0, t == "previous" ? (set_position--, set_position < 0 && (set_position = e(pp_images)
- .size() - 1)) : t == "next" ? (set_position++, set_position > e(pp_images)
- .size() - 1 && (set_position = 0)) : set_position = t, rel_index = set_position, doresize || (doresize = !0), settings.allow_expand && e(".pp_contract")
- .removeClass("pp_contract")
- .addClass("pp_expand"), y(function() {
- e.prettyPhoto.open()
- })
- }, e.prettyPhoto.changeGalleryPage = function(e) {
- e == "next" ? (currentGalleryPage++, currentGalleryPage > totalPage && (currentGalleryPage = 0)) : e == "previous" ? (currentGalleryPage--, currentGalleryPage < 0 && (currentGalleryPage = totalPage)) : currentGalleryPage = e, slide_speed = e == "next" || e == "previous" ? settings.animation_speed : 0, slide_to = currentGalleryPage * itemsPerPage * itemWidth, $pp_gallery.find("ul")
- .animate({
- left: -slide_to
- }, slide_speed)
- }, e.prettyPhoto.startSlideshow = function() {
- typeof m == "undefined" ? ($pp_pic_holder.find(".pp_play")
- .unbind("click")
- .removeClass("pp_play")
- .addClass("pp_pause")
- .click(function() {
- return e.prettyPhoto.stopSlideshow(), !1
- }), m = setInterval(e.prettyPhoto.startSlideshow, settings.slideshow)) : e.prettyPhoto.changePage("next")
- }, e.prettyPhoto.stopSlideshow = function() {
- $pp_pic_holder.find(".pp_pause")
- .unbind("click")
- .removeClass("pp_pause")
- .addClass("pp_play")
- .click(function() {
- return e.prettyPhoto.startSlideshow(), !1
- }), clearInterval(m), m = undefined
- }, e.prettyPhoto.close = function() {
- if ($pp_overlay.is(":animated")) return;
- e.prettyPhoto.stopSlideshow(), $pp_pic_holder.stop()
- .find("object,embed")
- .css("visibility", "hidden"), e("div.pp_pic_holder,div.ppt,.pp_fade")
- .fadeOut(settings.animation_speed, function() {
- e(this)
- .remove()
- }), $pp_overlay.fadeOut(settings.animation_speed, function() {
- e.browser.msie && e.browser.version == 6 && e("select")
- .css("visibility", "visible"), settings.hideflash && e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]")
- .css("visibility", "visible"), e(this)
- .remove(), e(window)
- .unbind("scroll.prettyphoto"), r(), settings.callback(), doresize = !0, f = !1, delete settings
- })
- }, !pp_alreadyInitialized && t() && (pp_alreadyInitialized = !0, hashIndex = t(), hashRel = hashIndex, hashIndex = hashIndex.substring(hashIndex.indexOf("/") + 1, hashIndex.length - 1), hashRel = hashRel.substring(0, hashRel.indexOf("/")), setTimeout(function() {
- e("a[" + s.hook + "^='" + hashRel + "']:eq(" + hashIndex + ")")
- .trigger("click")
- }, 50)), this.unbind("click.prettyphoto")
- .bind("click.prettyphoto", e.prettyPhoto.initialize)
- }
- }(jQuery);
- var pp_alreadyInitialized = !1
- , hex_chr = "0123456789abcdef";
- (function(e) {
- e.extend(e.fn, {
- validate: function(t) {
- if (this.length) {
- var n = e.data(this[0], "validator");
- return n ? n : (this.attr("novalidate", "novalidate"), n = new e.validator(t, this[0]), e.data(this[0], "validator", n), n.settings.onsubmit && (t = this.find("input, button"), t.filter(".cancel")
- .click(function() {
- n.cancelSubmit = !0
- }), n.settings.submitHandler && t.filter(":submit")
- .click(function() {
- n.submitButton = this
- }), this.submit(function(t) {
- function r() {
- if (n.settings.submitHandler) {
- if (n.submitButton) var t = e("<input type='hidden'/>")
- .attr("name", n.submitButton.name)
- .val(n.submitButton.value)
- .appendTo(n.currentForm);
- return n.settings.submitHandler.call(n, n.currentForm), n.submitButton && t.remove(), !1
- }
- return !0
- }
- return n.settings.debug && t.preventDefault(), n.cancelSubmit ? (n.cancelSubmit = !1, r()) : n.form() ? n.pendingRequest ? (n.formSubmitted = !0, !1) : r() : (n.focusInvalid(), !1)
- })), n)
- }
- t && t.debug && window.console && console.warn("nothing selected, can't validate, returning nothing")
- }
- , valid: function() {
- if (e(this[0])
- .is("form")) return this.validate()
- .form();
- var t = !0
- , n = e(this[0].form)
- .validate();
- return this.each(function() {
- t &= n.element(this)
- }), t
- }
- , removeAttrs: function(t) {
- var n = {}
- , r = this;
- return e.each(t.split(/\s/), function(e, t) {
- n[t] = r.attr(t), r.removeAttr(t)
- }), n
- }
- , rules: function(t, n) {
- var r = this[0];
- if (t) {
- var i = e.data(r.form, "validator")
- .settings
- , s = i.rules
- , o = e.validator.staticRules(r);
- switch (t) {
- case "add":
- e.extend(o, e.validator.normalizeRule(n)), s[r.name] = o, n.messages && (i.messages[r.name] = e.extend(i.messages[r.name], n.messages));
- break;
- case "remove":
- if (!n) return delete s[r.name], o;
- var u = {};
- return e.each(n.split(/\s/), function(e, t) {
- u[t] = o[t], delete o[t]
- }), u
- }
- }
- return r = e.validator.normalizeRules(e.extend({}, e.validator.metadataRules(r), e.validator.classRules(r), e.validator.attributeRules(r), e.validator.staticRules(r)), r), r.required && (i = r.required, delete r.required, r = e.extend({
- required: i
- }, r)), r
- }
- }), e.extend(e.expr[":"], {
- blank: function(t) {
- return !e.trim("" + t.value)
- }
- , filled: function(t) {
- return !!e.trim("" + t.value)
- }
- , unchecked: function(e) {
- return !e.checked
- }
- }), e.validator = function(t, n) {
- this.settings = e.extend(!0, {}, e.validator.defaults, t), this.currentForm = n, this.init()
- }, e.validator.format = function(t, n) {
- return arguments.length == 1 ? function() {
- var n = e.makeArray(arguments);
- return n.unshift(t), e.validator.format.apply(this, n)
- } : (arguments.length > 2 && n.constructor != Array && (n = e.makeArray(arguments)
- .slice(1)), n.constructor != Array && (n = [n]), e.each(n, function(e, n) {
- t = t.replace(RegExp("\\{" + e + "\\}", "g"), n)
- }), t)
- }, e.extend(e.validator, {
- defaults: {
- messages: {}
- , groups: {}
- , rules: {}
- , errorClass: "error"
- , validClass: "valid"
- , errorElement: "label"
- , focusInvalid: !0
- , errorContainer: e([])
- , errorLabelContainer: e([])
- , onsubmit: !0
- , ignore: ":hidden"
- , ignoreTitle: !1
- , onfocusin: function(e) {
- this.lastActive = e, this.settings.focusCleanup && !this.blockFocusCleanup && (this.settings.unhighlight && this.settings.unhighlight.call(this, e, this.settings.errorClass, this.settings.validClass), this.addWrapper(this.errorsFor(e))
- .hide())
- }
- , onfocusout: function(e) {
- !this.checkable(e) && (e.name in this.submitted || !this.optional(e)) && this.element(e)
- }
- , onkeyup: function(e) {
- (e.name in this.submitted || e == this.lastElement) && this.element(e)
- }
- , onclick: function(e) {
- e.name in this.submitted ? this.element(e) : e.parentNode.name in this.submitted && this.element(e.parentNode)
- }
- , highlight: function(t, n, r) {
- t.type === "radio" ? this.findByName(t.name)
- .addClass(n)
- .removeClass(r) : e(t)
- .addClass(n)
- .removeClass(r)
- }
- , unhighlight: function(t, n, r) {
- t.type === "radio" ? this.findByName(t.name)
- .removeClass(n)
- .addClass(r) : e(t)
- .removeClass(n)
- .addClass(r)
- }
- }
- , setDefaults: function(t) {
- e.extend(e.validator.defaults, t)
- }
- , messages: {
- required: "This field is required."
- , remote: "Please fix this field."
- , email: "Please enter a valid email address."
- , url: "Please enter a valid URL."
- , date: "Please enter a valid date."
- , dateISO: "Please enter a valid date (ISO)."
- , number: "Please enter a valid number."
- , digits: "Please enter only digits."
- , creditcard: "Please enter a valid credit card number."
- , equalTo: "Please enter the same value again."
- , accept: "Please enter a value with a valid extension."
- , maxlength: e.validator.format("Please enter no more than {0} characters.")
- , minlength: e.validator.format("Please enter at least {0} characters.")
- , rangelength: e.validator.format("Please enter a value between {0} and {1} characters long.")
- , range: e.validator.format("Please enter a value between {0} and {1}.")
- , max: e.validator.format("Please enter a value less than or equal to {0}.")
- , min: e.validator.format("Please enter a value greater than or equal to {0}.")
- }
- , autoCreateRanges: !1
- , prototype: {
- init: function() {
- function t(t) {
- var n = e.data(this[0].form, "validator")
- , r = "on" + t.type.replace(/^validate/, "");
- n.settings[r] && n.settings[r].call(n, this[0], t)
- }
- this.labelContainer = e(this.settings.errorLabelContainer), this.errorContext = this.labelContainer.length && this.labelContainer || e(this.currentForm), this.containers = e(this.settings.errorContainer)
- .add(this.settings.errorLabelContainer), this.submitted = {}, this.valueCache = {}, this.pendingRequest = 0, this.pending = {}, this.invalid = {}, this.reset();
- var n = this.groups = {};
- e.each(this.settings.groups, function(t, r) {
- e.each(r.split(/\s/), function(e, r) {
- n[r] = t
- })
- });
- var r = this.settings.rules;
- e.each(r, function(t, n) {
- r[t] = e.validator.normalizeRule(n)
- }), e(this.currentForm)
- .validateDelegate("[type='text'], [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ", "focusin focusout keyup", t)
- .validateDelegate("[type='radio'], [type='checkbox'], select, option", "click", t), this.settings.invalidHandler && e(this.currentForm)
- .bind("invalid-form.validate", this.settings.invalidHandler)
- }
- , form: function() {
- return this.checkForm(), e.extend(this.submitted, this.errorMap), this.invalid = e.extend({}, this.errorMap), this.valid() || e(this.currentForm)
- .triggerHandler("invalid-form", [this]), this.showErrors(), this.valid()
- }
- , checkForm: function() {
- this.prepareForm();
- for (var e = 0, t = this.currentElements = this.elements(); t[e]; e++) this.check(t[e]);
- return this.valid()
- }
- , element: function(t) {
- this.lastElement = t = this.validationTargetFor(this.clean(t)), this.prepareElement(t), this.currentElements = e(t);
- var n = this.check(t);
- return n ? delete this.invalid[t.name] : this.invalid[t.name] = !0, this.numberOfInvalids() || (this.toHide = this.toHide.add(this.containers)), this.showErrors(), n
- }
- , showErrors: function(t) {
- if (t) {
- e.extend(this.errorMap, t), this.errorList = [];
- for (var n in t) this.errorList.push({
- message: t[n]
- , element: this.findByName(n)[0]
- });
- this.successList = e.grep(this.successList, function(e) {
- return !(e.name in t)
- })
- }
- this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors()
- }
- , resetForm: function() {
- e.fn.resetForm && e(this.currentForm)
- .resetForm(), this.submitted = {}, this.lastElement = null, this.prepareForm(), this.hideErrors(), this.elements()
- .removeClass(this.settings.errorClass)
- }
- , numberOfInvalids: function() {
- return this.objectLength(this.invalid)
- }
- , objectLength: function(e) {
- var t = 0
- , n;
- for (n in e) t++;
- return t
- }
- , hideErrors: function() {
- this.addWrapper(this.toHide)
- .hide()
- }
- , valid: function() {
- return this.size() == 0
- }
- , size: function() {
- return this.errorList.length
- }
- , focusInvalid: function() {
- if (this.settings.focusInvalid) try {
- e(this.findLastActive() || this.errorList.length && this.errorList[0].element || [])
- .filter(":visible")
- .focus()
- .trigger("focusin")
- } catch (t) {}
- }
- , findLastActive: function() {
- var t = this.lastActive;
- return t && e.grep(this.errorList, function(e) {
- return e.element.name == t.name
- })
- .length == 1 && t
- }
- , elements: function() {
- var t = this
- , n = {};
- return e(this.currentForm)
- .find("input, select, textarea")
- .not(":submit, :reset, :image, [disabled]")
- .not(this.settings.ignore)
- .filter(function() {
- return !this.name && t.settings.debug && window.console && console.error("%o has no name assigned", this), this.name in n || !t.objectLength(e(this)
- .rules()) ? !1 : n[this.name] = !0
- })
- }
- , clean: function(t) {
- return e(t)[0]
- }
- , errors: function() {
- return e(this.settings.errorElement + "." + this.settings.errorClass, this.errorContext)
- }
- , reset: function() {
- this.successList = [], this.errorList = [], this.errorMap = {}, this.toShow = e([]), this.toHide = e([]), this.currentElements = e([])
- }
- , prepareForm: function() {
- this.reset(), this.toHide = this.errors()
- .add(this.containers)
- }
- , prepareElement: function(e) {
- this.reset(), this.toHide = this.errorsFor(e)
- }
- , check: function(t) {
- t = this.validationTargetFor(this.clean(t));
- var n = e(t)
- .rules()
- , r = !1
- , i;
- for (i in n) {
- var s = {
- method: i
- , parameters: n[i]
- };
- try {
- var o = e.validator.methods[i].call(this, t.value.replace(/\r/g, ""), t, s.parameters);
- if (o == "dependency-mismatch") r = !0;
- else {
- r = !1;
- if (o == "pending") {
- this.toHide = this.toHide.not(this.errorsFor(t));
- return
- }
- if (!o) return this.formatAndAdd(t, s), !1
- }
- } catch (u) {
- throw this.settings.debug && window.console && console.log("exception occured when checking element " + t.id + ", check the '" + s.method + "' method", u), u
- }
- }
- if (!r) return this.objectLength(n) && this.successList.push(t), !0
- }
- , customMetaMessage: function(t, n) {
- if (e.metadata) {
- var r = this.settings.meta ? e(t)
- .metadata()[this.settings.meta] : e(t)
- .metadata();
- return r && r.messages && r.messages[n]
- }
- }
- , customMessage: function(e, t) {
- var n = this.settings.messages[e];
- return n && (n.constructor == String ? n : n[t])
- }
- , findDefined: function() {
- for (var e = 0; e < arguments.length; e++)
- if (arguments[e] !== undefined) return arguments[e]
- }
- , defaultMessage: function(t, n) {
- return this.findDefined(this.customMessage(t.name, n), this.customMetaMessage(t, n), !this.settings.ignoreTitle && t.title || undefined, e.validator.messages[n], "<strong>Warning: No message defined for " + t.name + "</strong>")
- }
- , formatAndAdd: function(e, t) {
- var n = this.defaultMessage(e, t.method)
- , r = /\$?\{(\d+)\}/g;
- typeof n == "function" ? n = n.call(this, t.parameters, e) : r.test(n) && (n = jQuery.format(n.replace(r, "{$1}"), t.parameters)), this.errorList.push({
- message: n
- , element: e
- }), this.errorMap[e.name] = n, this.submitted[e.name] = n
- }
- , addWrapper: function(e) {
- return this.settings.wrapper && (e = e.add(e.parent(this.settings.wrapper))), e
- }
- , defaultShowErrors: function() {
- for (var e = 0; this.errorList[e]; e++) {
- var t = this.errorList[e];
- this.settings.highlight && this.settings.highlight.call(this, t.element, this.settings.errorClass, this.settings.validClass), this.showLabel(t.element, t.message)
- }
- this.errorList.length && (this.toShow = this.toShow.add(this.containers));
- if (this.settings.success)
- for (e = 0; this.successList[e]; e++) this.showLabel(this.successList[e]);
- if (this.settings.unhighlight) {
- e = 0;
- for (t = this.validElements(); t[e]; e++) this.settings.unhighlight.call(this, t[e], this.settings.errorClass, this.settings.validClass)
- }
- this.toHide = this.toHide.not(this.toShow), this.hideErrors(), this.addWrapper(this.toShow)
- .show()
- }
- , validElements: function() {
- return this.currentElements.not(this.invalidElements())
- }
- , invalidElements: function() {
- return e(this.errorList)
- .map(function() {
- return this.element
- })
- }
- , showLabel: function(t, n) {
- var r = this.errorsFor(t);
- r.length ? (r.removeClass(this.settings.validClass)
- .addClass(this.settings.errorClass), r.attr("generated") && r.html(n)) : (r = e("<" + this.settings.errorElement + "/>")
- .attr({
- "for": this.idOrName(t)
- , generated: !0
- })
- .addClass(this.settings.errorClass)
- .html(n || ""), this.settings.wrapper && (r = r.hide()
- .show()
- .wrap("<" + this.settings.wrapper + "/>")
- .parent()), this.labelContainer.append(r)
- .length || (this.settings.errorPlacement ? this.settings.errorPlacement(r, e(t)) : r.insertAfter(t))), !n && this.settings.success && (r.text(""), typeof this.settings.success == "string" ? r.addClass(this.settings.success) : this.settings.success(r)), this.toShow = this.toShow.add(r)
- }
- , errorsFor: function(t) {
- var n = this.idOrName(t);
- return this.errors()
- .filter(function() {
- return e(this)
- .attr("for") == n
- })
- }
- , idOrName: function(e) {
- return this.groups[e.name] || (this.checkable(e) ? e.name : e.id || e.name)
- }
- , validationTargetFor: function(e) {
- return this.checkable(e) && (e = this.findByName(e.name)
- .not(this.settings.ignore)[0]), e
- }
- , checkable: function(e) {
- return /radio|checkbox/i.test(e.type)
- }
- , findByName: function(t) {
- var n = this.currentForm;
- return e(document.getElementsByName(t))
- .map(function(e, r) {
- return r.form == n && r.name == t && r || null
- })
- }
- , getLength: function(t, n) {
- switch (n.nodeName.toLowerCase()) {
- case "select":
- return e("option:selected", n)
- .length;
- case "input":
- if (this.checkable(n)) return this.findByName(n.name)
- .filter(":checked")
- .length
- }
- return t.length
- }
- , depend: function(e, t) {
- return this.dependTypes[typeof e] ? this.dependTypes[typeof e](e, t) : !0
- }
- , dependTypes: {
- "boolean": function(e) {
- return e
- }
- , string: function(t, n) {
- return !!e(t, n.form)
- .length
- }
- , "function": function(e, t) {
- return e(t)
- }
- }
- , optional: function(t) {
- return !e.validator.methods.required.call(this, e.trim(t.value), t) && "dependency-mismatch"
- }
- , startRequest: function(e) {
- this.pending[e.name] || (this.pendingRequest++, this.pending[e.name] = !0)
- }
- , stopRequest: function(t, n) {
- this.pendingRequest--, this.pendingRequest < 0 && (this.pendingRequest = 0), delete this.pending[t.name], n && this.pendingRequest == 0 && this.formSubmitted && this.form() ? (e(this.currentForm)
- .submit(), this.formSubmitted = !1) : !n && this.pendingRequest == 0 && this.formSubmitted && (e(this.currentForm)
- .triggerHandler("invalid-form", [this]), this.formSubmitted = !1)
- }
- , previousValue: function(t) {
- return e.data(t, "previousValue") || e.data(t, "previousValue", {
- old: null
- , valid: !0
- , message: this.defaultMessage(t, "remote")
- })
- }
- }
- , classRuleSettings: {
- required: {
- required: !0
- }
- , email: {
- email: !0
- }
- , url: {
- url: !0
- }
- , date: {
- date: !0
- }
- , dateISO: {
- dateISO: !0
- }
- , dateDE: {
- dateDE: !0
- }
- , number: {
- number: !0
- }
- , numberDE: {
- numberDE: !0
- }
- , digits: {
- digits: !0
- }
- , creditcard: {
- creditcard: !0
- }
- }
- , addClassRules: function(t, n) {
- t.constructor == String ? this.classRuleSettings[t] = n : e.extend(this.classRuleSettings, t)
- }
- , classRules: function(t) {
- var n = {};
- return (t = e(t)
- .attr("class")) && e.each(t.split(" "), function() {
- this in e.validator.classRuleSettings && e.extend(n, e.validator.classRuleSettings[this])
- }), n
- }
- , attributeRules: function(t) {
- var n = {};
- t = e(t);
- for (var r in e.validator.methods) {
- var i;
- (i = r === "required" && typeof e.fn.prop == "function" ? t.prop(r) : t.attr(r)) ? n[r] = i: t[0].getAttribute("type") === r && (n[r] = !0)
- }
- return n.maxlength && /-1|2147483647|524288/.test(n.maxlength) && delete n.maxlength, n
- }
- , metadataRules: function(t) {
- if (!e.metadata) return {};
- var n = e.data(t.form, "validator")
- .settings.meta;
- return n ? e(t)
- .metadata()[n] : e(t)
- .metadata()
- }
- , staticRules: function(t) {
- var n = {}
- , r = e.data(t.form, "validator");
- return r.settings.rules && (n = e.validator.normalizeRule(r.settings.rules[t.name]) || {}), n
- }
- , normalizeRules: function(t, n) {
- return e.each(t, function(r, i) {
- if (i === !1) delete t[r];
- else if (i.param || i.depends) {
- var s = !0;
- switch (typeof i.depends) {
- case "string":
- s = !!e(i.depends, n.form)
- .length;
- break;
- case "function":
- s = i.depends.call(n, n)
- }
- s ? t[r] = i.param !== undefined ? i.param : !0 : delete t[r]
- }
- }), e.each(t, function(r, i) {
- t[r] = e.isFunction(i) ? i(n) : i
- }), e.each(["minlength", "maxlength", "min", "max"], function() {
- t[this] && (t[this] = Number(t[this]))
- }), e.each(["rangelength", "range"], function() {
- t[this] && (t[this] = [Number(t[this][0]), Number(t[this][1])])
- }), e.validator.autoCreateRanges && (t.min && t.max && (t.range = [t.min, t.max], delete t.min, delete t.max), t.minlength && t.maxlength && (t.rangelength = [t.minlength, t.maxlength], delete t.minlength, delete t.maxlength)), t.messages && delete t.messages, t
- }
- , normalizeRule: function(t) {
- if (typeof t == "string") {
- var n = {};
- e.each(t.split(/\s/), function() {
- n[this] = !0
- }), t = n
- }
- return t
- }
- , addMethod: function(t, n, r) {
- e.validator.methods[t] = n, e.validator.messages[t] = r != undefined ? r : e.validator.messages[t], n.length < 3 && e.validator.addClassRules(t, e.validator.normalizeRule(t))
- }
- , methods: {
- required: function(t, n, r) {
- if (!this.depend(r, n)) return "dependency-mismatch";
- switch (n.nodeName.toLowerCase()) {
- case "select":
- return (t = e(n)
- .val()) && t.length > 0;
- case "input":
- if (this.checkable(n)) return this.getLength(t, n) > 0;
- default:
- return e.trim(t)
- .length > 0
- }
- }
- , remote: function(t, n, r) {
- if (this.optional(n)) return "dependency-mismatch";
- var i = this.previousValue(n);
- this.settings.messages[n.name] || (this.settings.messages[n.name] = {}), i.originalMessage = this.settings.messages[n.name].remote, this.settings.messages[n.name].remote = i.message, r = typeof r == "string" && {
- url: r
- } || r;
- if (this.pending[n.name]) return "pending";
- if (i.old === t) return i.valid;
- i.old = t;
- var s = this;
- this.startRequest(n);
- var o = {};
- return o[n.name] = t, e.ajax(e.extend(!0, {
- url: r
- , mode: "abort"
- , port: "validate" + n.name
- , dataType: "json"
- , data: o
- , success: function(r) {
- s.settings.messages[n.name].remote = i.originalMessage;
- var o = r === !0;
- if (o) {
- var u = s.formSubmitted;
- s.prepareElement(n), s.formSubmitted = u, s.successList.push(n), s.showErrors()
- } else u = {}, r = r || s.defaultMessage(n, "remote"), u[n.name] = i.message = e.isFunction(r) ? r(t) : r, s.showErrors(u);
- i.valid = o, s.stopRequest(n, o)
- }
- }, r)), "pending"
- }
- , minlength: function(t, n, r) {
- return this.optional(n) || this.getLength(e.trim(t), n) >= r
- }
- , maxlength: function(t, n, r) {
- return this.optional(n) || this.getLength(e.trim(t), n) <= r
- }
- , rangelength: function(t, n, r) {
- return t = this.getLength(e.trim(t), n), this.optional(n) || t >= r[0] && t <= r[1]
- }
- , min: function(e, t, n) {
- return this.optional(t) || e >= n
- }
- , max: function(e, t, n) {
- return this.optional(t) || e <= n
- }
- , range: function(e, t, n) {
- return this.optional(t) || e >= n[0] && e <= n[1]
- }
- , email: function(e, t) {
- return this.optional(t) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(e)
- }
- , url: function(e, t) {
- return this.optional(t) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e)
- }
- , date: function(e, t) {
- return this.optional(t) || !/Invalid|NaN/.test(new Date(e))
- }
- , dateISO: function(e, t) {
- return this.optional(t) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(e)
- }
- , number: function(e, t) {
- return this.optional(t) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(e)
- }
- , digits: function(e, t) {
- return this.optional(t) || /^\d+$/.test(e)
- }
- , creditcard: function(e, t) {
- if (this.optional(t)) return "dependency-mismatch";
- if (/[^0-9 -]+/.test(e)) return !1;
- var n = 0
- , r = 0
- , i = !1;
- e = e.replace(/\D/g, "");
- for (var s = e.length - 1; s >= 0; s--) r = e.charAt(s), r = parseInt(r, 10), i && (r *= 2) > 9 && (r -= 9), n += r, i = !i;
- return n % 10 == 0
- }
- , accept: function(e, t, n) {
- return n = typeof n == "string" ? n.replace(/,/g, "|") : "png|jpe?g|gif", this.optional(t) || e.match(RegExp(".(" + n + ")$", "i"))
- }
- , equalTo: function(t, n, r) {
- return r = e(r)
- .unbind(".validate-equalTo")
- .bind("blur.validate-equalTo", function() {
- e(n)
- .valid()
- }), t == r.val()
- }
- }
- }), e.format = e.validator.format
- })(jQuery)
- , function(e) {
- var t = {};
- if (e.ajaxPrefilter) e.ajaxPrefilter(function(e, n, r) {
- n = e.port, e.mode == "abort" && (t[n] && t[n].abort(), t[n] = r)
- });
- else {
- var n = e.ajax;
- e.ajax = function(r) {
- var i = ("port" in r ? r : e.ajaxSettings)
- .port;
- return ("mode" in r ? r : e.ajaxSettings)
- .mode == "abort" ? (t[i] && t[i].abort(), t[i] = n.apply(this, arguments)) : n.apply(this, arguments)
- }
- }
- }(jQuery)
- , function(e) {
- !jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener && e.each({
- focus: "focusin"
- , blur: "focusout"
- }, function(t, n) {
- function r(t) {
- return t = e.event.fix(t), t.type = n, e.event.handle.call(this, t)
- }
- e.event.special[n] = {
- setup: function() {
- this.addEventListener(t, r, !0)
- }
- , teardown: function() {
- this.removeEventListener(t, r, !0)
- }
- , handler: function(t) {
- return arguments[0] = e.event.fix(t), arguments[0].type = n, e.event.handle.apply(this, arguments)
- }
- }
- }), e.extend(e.fn, {
- validateDelegate: function(t, n, r) {
- return this.bind(n, function(n) {
- var i = e(n.target);
- if (i.is(t)) return r.apply(i, arguments)
- })
- }
- })
- }(jQuery)
- , function(e, t) {
- function s(e) {
- return Core.vars.html.hasClass(e)
- }
- var n = /#debug$/.test(t.location + "") && console && console.log instanceof Function;
- Backbone.Events.emit = Backbone.Events.trigger;
- var r = _.extend({}, Backbone.Events)
- , i = {};
- t.Core = {
- vars: {
- window: e(t)
- }
- , colors: {}
- , classes: {}
- , on: function(e, t, n) {
- return r.on(e, t, n)
- }
- , once: function(e, t, n) {
- var i = function() {
- t.apply(this, arguments), r.off(e, i)
- };
- return r.on(e, i, n)
- }
- , emit: function() {
- return r.emit.apply(r, arguments)
- }
- , debug: function() {
- n && console.log(this.util.format.apply(null, arguments))
- }
- , setVar: function(e, t) {
- this.vars[e] = t
- }
- , getVar: function(e) {
- return this.vars[e]
- }
- , eventEmitter: function() {
- return _.extend({}, Backbone.Events)
- }
- , mobile: {
- isIphone: function() {
- return s("iphone")
- }
- , isIpad: function() {
- return s("ipad")
- }
- , isAndroid: function() {
- return s("android")
- }
- }
- , initialize: function() {
- this.emit(":ready"), this.emit("ready"), this.emit("ready:")
- }
- }
- }(jQuery, window)
- , function(e, t) {
- function i(t) {
- var n = 0
- , r = t.length;
- this.data = t, this.reset = function() {
- n = 0
- }, this.get = function(i) {
- return n = (n + i) % r, n < 0 && (n = (r + n) % r), t.eq === e.fn.eq ? t.eq(n) : t[n]
- }
- }
- var n = {
- commaSplit: /(\s+)?,(\s+)?/g
- , dash: /(-)+/g
- , booleanVal: /^(true|false)$/i
- , numberVal: /^[0-9]+$/
- , nullVal: /^null$/i
- }
- , r;
- t.util = {
- format: _.string.sprintf
- , camelize: function(e) {
- return (r || (r = _.string.camelize))
- .call(null, "-" + e)
- }
- , typecast: function(e) {
- return typeof e == "string" ? (e = e.trim(), n.booleanVal.test(e) ? e.toLowerCase() == "true" : n.numberVal.test(e) ? parseInt(e, 10) : n.nullVal.test(e) ? null : e == "undefined" ? undefined : e) : e
- }
- , getConfig: function(r, i) {
- var s = {}
- , o = (typeof r == "string" ? e(r) : r)
- .data(i || "config");
- if (o) {
- o = o.split(n.commaSplit);
- for (var u, a = 0, f = o.length; a < f; a++) u = o[a], u && (u = u.trim()) && (u = u.split(":")) && (s[u[0]] = t.util.typecast(u[1]));
- return s
- }
- return s
- }
- , createCycle: function(e) {
- return new i(e)
- }
- , vendorPrefix: function(t) {
- var n = "";
- return e.browser.webkit ? n = "-webkit-" : e.browser.mozilla ? n = "-moz-" : e.browser.msie ? n = "-ms-" : e.browser.opera && (n = "-o-"), n + t
- }
- }
- }(jQuery, window.Core)
- , function(e, t) {
- function r(e) {
- return e ? (e = e.split(","), new google.maps.LatLng(parseFloat(e[0]), parseFloat(e[1]))) : null
- }
- t.on("ready", function() {
- var n = 1;
- e(".google-map")
- .each(function(r, i) {
- var s = e.getWrappedObject(
- i);
- s.addClass("google-map-" + n), s.data("index", n);
- var o = s.find("span.map-data")
- .html()
- .trim();
- o = o.slice(0, o.lastIndexOf("}") + 1);
- var u = JSON.parse(o)
- , a = s.find(".infobox-content");
- a.length > 0 && (u.contentString = a.html()), n++, t.maps.create(s, u)
- })
- });
- var n;
- t.maps = {
- create: function(i, s) {
- var o = t.mobile.isIphone();
- n = n || t.vars.body || e("body"), s = _.extend({
- latLong: "48.858391,2.294083"
- , mapType: "ROADMAP"
- , zoom: 16
- , contentTitle: ""
- , contentTitleLink: ""
- , contentTooltip: ""
- , contentString: ""
- , contentWidth: 250
- , allowFullScreen: !0
- , extraOptions: {}
- }, s || {});
- var u = r(s.latLong)
- , a = _.extend({
- zoom: s.zoom
- , scrollwheel: !1
- , center: u
- , mapTypeId: google.maps.MapTypeId[s.mapType]
- }, s.extraOptions)
- , f = new google.maps.Map(i.get(0), a);
- if (s.contentTitle && s.contentString) {
- var l = s.contentTitleLink ? t.util.format('<h3><a class="title" href="%s">%s</a></h3>\n%s', s.contentTitleLink, s.contentTitle, s.contentString) : t.util.format("<h3>%s</h3>\n%s", s.contentTitle, s.contentString)
- , c = new google.maps.InfoWindow({
- maxWidth: s.contentWidth
- , content: l
- })
- , h = new google.maps.Marker({
- title: s.contentTooltip || s.contentTitle
- , position: u
- , map: f
- });
- google.maps.event.addListener(h, "click", function() {
- c.open(f, h)
- })
- }
- var p = t.eventEmitter();
- t.ui.resizeEvent.call(p, i, "resize"), p.on("resize", function(e) {
- google.maps.event.trigger(f, "resize"), f.setCenter(u)
- });
- if (s.allowFullScreen && !o) {
- var d = e('<span class="fw-button">Full Screen</span>');
- d.data("parent", i);
- var v = {
- top: 60
- , right: 5
- };
- d.css(v)
- .css({
- display: "block"
- , padding: "0 8px"
- , position: "absolute"
- , height: "20px"
- , lineHeight: "20px"
- , background: "white"
- , border: "solid 1px #707a84"
- , boxShadow: "0 2px 4px rgba(0,0,0,0.39)"
- , zIndex: 999999999
- , fontFamily: "Arial, sans-serif"
- , textRendering: "none"
- , fontSize: "12px"
- , userSelect: "none"
- , webkitUserSelect: "none"
- , mozUserSelect: "none"
- });
- var m = f.getStreetView();
- google.maps.event.addListener(m, "visible_changed", function() {
- m.getVisible() ? d.css({
- top: 2
- , right: 34
- }) : d.css(v)
- }), t.vars.modernBrowser ? d.hover(function(n) {
- var r = e.getWrappedObject(this);
- switch (n.type) {
- case "mouseenter":
- r.css({
- cursor: "pointer"
- , background: t.util.vendorPrefix("linear-gradient(top, white, #e6e6e6)")
- , color: "black"
- });
- break;
- case "mouseleave":
- r.css({
- cursor: "default"
- , background: "white"
- , color: "#323232"
- })
- }
- }) : d.hover(function(t) {
- var n = e.getWrappedObject(this);
- switch (t.type) {
- case "mouseenter":
- n.css({
- cursor: "pointer"
- });
- break;
- case "mouseleave":
- n.css({
- cursor: "default"
- })
- }
- }), d.click(function(t) {
- var r = e.getWrappedObject(this)
- , s = r.data("parent")
- , o = s.data("index");
- i.hasClass("full-screen") ? (r.html("Full Screen"), i.removeClass("full-screen"), n.unbind("keyup", g), e("section.google-map.full-width")
- .not(".google-map" + o)
- .show()) : (r.html("Normal"), i.addClass("full-screen"), i.css("width: 100% !important;"), n.keyup(g), e("section.google-map.full-width")
- .not(".google-map-" + o)
- .hide()), p.emit("resize")
- });
- var g = function(e) {
- e.keyCode === 27 && d.click()
- };
- i.append(d)
- }
- return i.data("map", f), i
- }
- }
- }(jQuery, window.Core)
- , function(e, t) {
- function n() {
- o(), r(), s()
- }
- function r() {
- var n = e(".refineslide");
- if (n.length > 0) {
- t.getVar("body")
- .css({
- "-webkit-backface-visibility": "hidden"
- });
- var r = document.root + "/core/js/jquery.refineslide.min.js";
- head.js(r)
- .ready(function() {
- n.each(function(n, r) {
- var i = e.getWrappedObject(r)
- , s, o = 0
- , u = t.util.getConfig(i.find("ul.rs-slider"), "options");
- u.fallback3d = "sliceV", u.keyNav = !1, u.onInit = function() {
- var n = this.slider
- , r = [];
- for (var s = 0; s < n.totalSlides; s++) r.push('<li data-index="' + s + '"></li>');
- r = e('<ul class="controls hfloat">' + r.join("\n") + "</ul><!-- .controls -->");
- for (s = 0; s < n.totalSlides; s++) {
- var u = r.clone();
- u.find("> li:eq(" + s + ")")
- .addClass("active"), a.find(".slider-meta:eq(" + s + ")")
- .append(u)
- }
- a.find(".slider-meta ul.controls li")
- .click(function() {
- var t = e.getWrappedObject(this)
- , r = t.data("index")
- , i = r > o;
- n.transition(r, i), o = r
- });
- var f = t.getVar("body")
- , l = function(e) {
- e.keyCode == 37 ? n.prev() : e.keyCode == 39 && n.next()
- };
- i.hover(function(e) {
- switch (e.type) {
- case "mouseenter":
- f.bind("keyup", l);
- break;
- case "mouseleave":
- f.unbind("keyup", l)
- }
- }), i.touchwipe({
- wipeLeft: function() {
- n.next()
- }
- , wipeRight: function() {
- n.prev()
- }
- , min_move_x: 50
- , preventDefaultEvents: !1
- })
- }, u.onChange = function() {
- var e = this.slider
- , t = e.$currentSlide
- , n = t.__meta || (t.__meta = t.find(".slider-meta"));
- o = parseInt(t.attr("class")
- .split("-")[2]), (s = n)
- .fadeOut(e.settings.transitionDuration)
- }, u.afterChange = function() {
- s.show()
- }, u.controls = "arrows", u.keyNav = !1;
- var a = i.find("> ul.rs-slider");
- a.refineSlide(u)
- })
- })
- }
- }
- function i(e) {
- return _.extend({
- effect: "fade"
- , slices: 8
- , boxCols: 8
- , boxRows: 4
- , animSpeed: 500
- , pauseTime: 3e3
- , startSlide: 0
- , directionNav: !0
- , directionNavHide: !0
- , controlNav: !0
- , controlNavThumbs: !1
- , pauseOnHover: !0
- , manualAdvance: !0
- }, e || {})
- }
- function s() {
- var n = t.getVar("body")
- .find(".slider .images")
- , r = []
- , s = [];
- n.each(function(t, n) {
- var i = e.getWrappedObject(n);
- i.find("img")
- .length > 1 && r.push(t)
- });
- if (r.length > 0) {
- var o = document.root + "/core/js/jquery.nivo-slider.min.js";
- head.js(o)
- .ready(function() {
- n.each(function(n, s) {
- if (r.indexOf(n) >= 0) {
- var o = e.getWrappedObject(s)
- , u = o.find("> img.slide")
- , a = o.siblings(".slider-meta")
- , f = a.find("ul.controls")
- , l = t.util.getConfig(o, "nivo-options")
- , c = i(l);
- c.beforeChange = function() {
- var e = E.currentSlide + 1;
- e < 0 ? e = b - 1 : e == b && (e = 0);
- var t = g[e];
- t.description ? S.removeClass("no-desc") : S.addClass("no-desc"), x.text(t.title), T.text(t.description), x.attr("href", t.url), T.attr("href", t.url), w.eq(e)
- .addClass("active")
- .siblings(".active")
- .removeClass("active")
- }, o.nivoSlider(c), o.find(".nivo-slice, .nivo-main-image")
- .live("hover", function(t) {
- var n = g[E.currentSlide]
- , r = e.getWrappedObject(this);
- if (r.data("done") || !n.url) return;
- r.is(".nivo-slice") ? r.find("> img")
- .wrap('<a href="' + n.url + '"></a>') : r.wrap('<a href="' + n.url + '"></a>'), r.data("done", !0)
- });
- var h = t.getVar("body")
- , p = o.find("a.nivo-nextNav")
- , d = o.find("a.nivo-prevNav");
- if (p.length > 0 && d.length > 0) {
- o.touchwipe({
- wipeLeft: function() {
- p.trigger("click")
- }
- , wipeRight: function() {
- d.trigger("click")
- }
- , min_move_x: 50
- , preventDefaultEvents: !1
- });
- var v = function(e) {
- e.keyCode == 37 ? d.trigger("click") : e.keyCode == 39 && p.trigger("click")
- };
- o.parent()
- .hover(function(e) {
- switch (e.type) {
- case "mouseenter":
- h.bind("keyup", v);
- break;
- case "mouseleave":
- h.unbind("keyup", v)
- }
- })
- }
- var m = o.siblings(".nivo-controlNav")
- .find("a.nivo-control")
- , g = [];
- o.find("img")
- .each(function(t, n) {
- var r = e.getWrappedObject(n);
- g.push({
- url: r.data("permalink")
- , title: r.data("title")
- , description: r.data("description")
- })
- });
- for (var y, b = m.length, n = 0; n < b; n++) y = n === 0 ? ' class="active"' : "", f.append("<li" + y + ' data-index="' + n + '"></li>');
- var w = f.find("> li")
- , E = o.data("nivo:vars")
- , S = a.find("> .info")
- , x = S.find("> h3 > a")
- , T = S.find("> small > a");
- f.find("li")
- .click(function() {
- E.running || m.eq(e.getWrappedObject(this)
- .data("index"))
- .trigger("click")
- }), a.fadeIn(1500)
- }
- })
- })
- }
- }
- function o() {
- var n = []
- , r = []
- , i = e(".unique-slider")
- .each(function(i, s) {
- var o = s.__self = e(s)
- , u = o.data("slider-manager");
- n.indexOf(u) === -1 && (n.push(u), r.push(document.root + t.util.format("/core/js/core.slider.%s.js", u)))
- });
- if (r.length === 0) return;
- head.js(r)
- .ready(function() {
- i.each(function(e, n) {
- var r = n.__self
- , i = r.data("slider-manager")
- , s = t.util.camelize(i + "-slider")
- , o = t.classes[s];
- new o(r)
- })
- })
- }
- function u() {
- var n = e("#header");
- t.setVar("html", e("html")), t.setVar("body", e("body")), t.setVar("topbar", e("#topbar")), t.setVar("header", n), t.setVar("footer", e("footer[role=contentinfo]")), t.setVar("social", n.find("ul.social-icons")), t.setVar("navigation", n.find("ul.navigation")), t.setVar("oldBrowser", t.vars.html.hasClass("ie8")), t.setVar("modernBrowser", !t.vars.oldBrowser)
- }
- function a() {
- c(), h(), p(), d(), v(), m(), g(), y(), b()
- }
- function f() {
- var n = t.getVar("body");
- n.find("section.block > .mobile-behavior")
- .each(function(t, n) {
- var r = e.getWrappedObject(this);
- if (r.find("article.one-third.column")
- .length > 0) {
- r.removeClass(".mobile-behavior")
- .removeAttr("data-mobile-behavior");
- return
- }
- var i = r.data("mobile-behavior");
- switch (i) {
- case "mobile-dual":
- r.parents("section.block.container")
- .attr("data-mobile-dual", "true");
- break;
- case "mobile-landscape-dual":
- r.parents("section.block.container")
- .addClass("mobile-landscape-dual")
- }
- })
- }
- function l() {
- var n = t.ui.selectNav(t.vars.navigation, {
- id: "mobile-nav"
- });
- t.vars.header.find("#mobile-nav")
- .replaceWith(n);
- var r = '<form id="search-box" class="clearfix" action="%s" method="get">\n<p class="clearfix hfloat">\n<input type="text" name="s" placeholder="%s" value="" autocomplete="off" />\n<input class="hoverable" type="submit" value="" />\n<span class="close hoverable"></span>\n</p>\n</form><!-- search-form -->';
- e("#header")
- .append(t.util.format(r, document.wp_home, document.i18n.enterSearchCriteria));
- var i = '<hr class="section-sep" />';
- e("section.block + section.block")
- .before(i), e("section.sep-after")
- .after(i), e(".container[data-mobile-dual=true]")
- .each(function(t, n) {
- var r = e.getWrappedObject(n)
- .removeAttr("data-mobile-dual")
- , i = r.find("> div[data-mobile-behavior=mobile-dual]");
- i.addClass("mobile-dual"), i.wrapEach(2, ".columns, .column", '<div class="mobile-dual-container"></div>'), i.removeAttr("data-mobile-behavior")
- }), e(".container.mobile-landscape-dual")
- .each(function(t, n) {
- var r = e.getWrappedObject(n)
- , i = r.find("> div[data-mobile-behavior=mobile-landscape-dual]");
- i.wrapEach(2, ".columns, .column", '<div class="mobile-dual-container"></div>')
- })
- }
- function c() {
- var n = t.vars.header.find("ul.navigation")
- , r = t.vars.html.hasClass("ipad");
- n.find("ul")
- .each(function(t, n) {
- var r = e.getWrappedObject(n);
- r.before()
- .parent()
- .addClass("submenu")
- });
- var i;
- n.find("> li > ul")
- .addClass("first-ul"), n.find("li")
- .hover(function(t) {
- var n = e.getWrappedObject(this)
- , s = n.find("ul:first");
- n.__show || (n.__show = function() {
- s.fadeIn(300, "easeOutQuad")
- });
- switch (t.type) {
- case "mouseenter":
- s.hasClass("first-ul") ? i = setTimeout(n.__show, r ? 0 : 150) : n.__show();
- break;
- case "mouseleave":
- clearTimeout(i), s.hide()
- }
- })
- }
- function h() {
- e("form input.placeholder")
- .each(function(t, n) {
- var r = e.getWrappedObject(n);
- r.data("text", r.val())
- })
- .focus(function() {
- var t = e.getWrappedObject(this);
- t.val()
- .trim() === t.data("text") && t.val("")
- })
- .blur(function() {
- var t = e.getWrappedObject(this);
- t.val()
- .trim()
- .length === 0 && t.val(t.data("text"))
- })
- }
- function p() {
- var e = t.vars.body
- , n = t.vars.header
- , r = n.find("ul.navigation")
- , i = n.find("ul.social-icons")
- , s = n.find("#search-box")
- , o = s.find("input")
- , u = s.find("input:text")
- , a = s.find("span.close")
- , f = n.find("div.logo")
- , l = r.find("li.search");
- f.addClass("hover");
- var c = t.vars.oldBrowser ? 0 : 410
- , h = !1
- , p = n.hasClass("logo-center")
- , d = n.hasClass("logo-left") || p
- , v = "easeInOutQuad"
- , m = function(e) {
- e.keyCode === 27 && a.click()
- }
- , g = d ? {
- left: 0
- } : {
- right: 0
- }
- , y = d ? {
- left: 30
- } : {
- right: 30
- }
- , b, w, E;
- l.click(function(t) {
- if (h) return;
- h = !0, p && f.removeClass("hover"), b = s.css("top"), w = i.css("top"), E || (E = function() {
- s.stop();
- if (p) {
- var t = (n.width() - r.width()) * .5;
- s.css({
- right: t
- })
- }
- s.animate({
- top: "50%"
- }, c * .3, v, function() {
- o.stop()
- .animate(g, c * .3, v, function() {
- h = !1, e.keyup(m)
- })
- })
- }), p ? (f.stop()
- .animate({
- opacity: .2
- }, c, v), i.stop()
- .animate({
- top: "-50px"
- }, c * .8, v), r.stop()
- .animate({
- top: -1 * n.height()
- }, c * .6, v, E)) : (i.stop()
- .animate({
- top: "-100%"
- }, c * .8, v), r.stop()
- .animate({
- bottom: "100%"
- }, c * .6, v, E))
- });
- var S = function() {
- h = !1
- };
- a.click(function() {
- if (h) return;
- h = !0;
- var t = !0;
- e.unbind("keyup", m), o.stop()
- .animate(y, c * .3, v, function() {
- t && (s.stop()
- .animate({
- top: "-100%"
- }, c * .5, v, function() {
- i.stop()
- .animate({
- top: w
- }, c * .8, v), p ? (r.stop()
- .animate({
- top: 0
- }, c * .6, v, S), f.stop()
- .animate({
- opacity: 1
- }, c * .6, v), f.addClass("hover")) : r.stop()
- .animate({
- bottom: 0
- }, c * .6, v, S)
- }), t = !1)
- })
- })
- }
- function d() {
- e(".blocked-latest-posts")
- .each(function(n, r) {
- var i = !1
- , s = t.eventEmitter()
- , o = e.getWrappedObject(r)
- , u = o
- , a = o.find("> .scroller")
- , f = a.children();
- f.each(function(t, n) {
- e(n)
- .attr("data-index", t)
- });
- if (f.length === 0) return;
- u.append('<div class="controls clearfix">\n <span class="next hoverable"></span>\n <span class="prev hoverable"></span>\n</div><!-- .controls -->');
- var l = a.find("a.frame:first")
- , c = o.find(".controls")
- , h = c.find("span.next")
- , p = c.find("span.prev");
- c.addClass(o.data("controls"));
- var d = t.util.createCycle(f);
- s.on("layout:resize", function(e) {
- d.reset(), a.css("marginLeft", 0)
- }), t.ui.resizeEvent.call(s, u, "layout:resize", !0);
- var v, m, g, y = function() {
- i = !1
- };
- h.add(p)
- .click(function() {
- if (i) return;
- i = !0, v = e.getWrappedObject(this)
- .hasClass("next") ? 1 : -1, m = d.get(v)
- .data("index"), g = -1 * m * (l.width() + 20), a.stop()
- .animate({
- marginLeft: g
- }, 400, "easeInOutQuart", y)
- }), u.touchwipe({
- wipeLeft: function() {
- h.click()
- }
- , wipeRight: function() {
- p.click()
- }
- , min_move_x: 50
- , preventDefaultEvents: !1
- });
- var b = t.getVar("body")
- , w = function(e) {
- e.keyCode == 37 ? p.trigger("click") : e.keyCode == 39 && h.trigger("click")
- };
- u.hover(function(e) {
- switch (e.type) {
- case "mouseenter":
- b.keyup(w);
- break;
- case "mouseleave":
- b.unbind("keyup", w)
- }
- })
- })
- }
- function v() {
- var n = t.vars.oldBrowser
- , r = t.colors.brandColor
- , i = 240;
- e("article a.frame, li a.frame")
- .live("hover", function(s) {
- var o = e.getWrappedObject(this)
- , u = o.__overlay || (o.__overlay = o.append('<span class="overlay"></span>')
- .find("> span.overlay"))
- , a = o.__format || (o.__format = o.find("span.format"))
- , f = o.__borderColor || (o.__borderColor = o.css("border-bottom-color"));
- switch (s.type) {
- case "mouseenter":
- a.stop()
- .animate({
- bottom: 0
- , right: 0
- }, i, "easeOutQuad"), n ? (u.css("opacity", 1)
- .show(), o.css("borderBottomColor", r)) : (u.stop()
- .animate({
- opacity: 1
- }, 200), o.stop()
- .animate({
- borderBottomColor: t.colors.brandColor
- }, 200));
- break;
- case "mouseleave":
- a.stop()
- .animate({
- bottom: -26
- , right: -26
- }, i, "easeInOutQuad"), n ? (u.hide(), o.css("borderBottomColor", f)) : (u.stop()
- .animate({
- opacity: 0
- }, 300), o.stop()
- .animate({
- borderBottomColor: f
- }, 300))
- }
- }), e(".latest-posts-component")
- .each(function(t, n) {
- var r = e(this);
- r.parents("footer")
- .length === 0 && r.addClass("hover-enabled")
- })
- }
- function m() {
- var n = 600
- , r = "easeInOutSine"
- , i = t.vars.body
- , s = e.browser.opera || e.browser.msie ? e("html") : e("html, body");
- t.vars.footer.find("> .copyright a.back-to-top")
- .click(function() {
- return s.stop()
- .animate({
- scrollTop: 0
- }, n, r), !1
- })
- }
- function g() {
- var t = 300
- , n = "easeOutQuad"
- , r = !1
- , i = function() {
- r = !1
- };
- e("ul.accordion-boxes")
- .each(function(s, o) {
- var u = e.getWrappedObject(o)
- , a = u.find("> li.unit.active")
- .length === 0;
- u.find("> li.unit")
- .each(function(t, n) {
- var r = e.getWrappedObject(n);
- t === 0 && a && r.addClass("active");
- var i = r.find("> .content");
- r.data("content", i), r.hasClass("active") || i.hide()
- }), u.find("> li.unit > h3.title")
- .click(function() {
- if (r) return;
- var s = e.getWrappedObject(this);
- s.__unit = s.__unit || (s.__unit = s.parent()), s.__unit.hasClass("active") || (r = !0, u.find("> li.unit.active")
- .removeClass("active")
- .data("content")
- .slideToggle(t, n), s.__unit.addClass("active")
- .data("content")
- .slideToggle(t, n, i))
- })
- }), e(".toggle-box")
- .each(function(s, o) {
- var u = e.getWrappedObject(o)
- , a = u.find("> .content")
- , f = u.find("> h3.title");
- f.data("content", a), u.hasClass("active") || a.hide(), f.click(function() {
- if (r) return;
- r = !0, u.hasClass("active") ? u.removeClass("active") : u.addClass("active"), a.slideToggle(t, n, i)
- })
- })
- }
- function y() {
- var n = 200
- , r = t.vars.window;
- e(".ibox.collapse")
- .append('<span class="close">×</span>')
- .find("> span.close")
- .click(function() {
- var t = this.__parent || (this.__parent = e(this)
- .parent());
- t.stop()
- .animate({
- opacity: 0
- }, n, function() {
- t.slideToggle(n, function() {
- t.remove(), r.trigger("resize")
- })
- })
- })
- }
- function b() {
- e("ul.tabs")
- .each(function(n, r) {
- var i = ""
- , s = e.getWrappedObject(r)
- .addClass("enabled")
- , o = s.children(".tab");
- o.each(function(n, r) {
- var s = e.getWrappedObject(r)
- , o = s.find("> h3.title")
- , u = s.hasClass("active");
- i += t.util.format('<span class="tab-title %s">%s</span>', u ? " active" : "", o.html()), o.remove()
- }), s.prepend(t.util.format('<li class="tabs-head clearfix">%s</li>', i)), s.find("> li.tabs-head span.tab-title")
- .each(function(t, n) {
- e.getWrappedObject(n)
- .data("index", t)
- })
- .click(function() {
- var t = e.getWrappedObject(this);
- if (t.hasClass("active")) return;
- t.addClass("active")
- .siblings("span.tab-title")
- .removeClass("active");
- var n = t.data("index");
- o.eq(n)
- .addClass("active")
- .siblings(".tab")
- .removeClass("active")
- })
- })
- }
- t.once(":ready", function() {
- u(), f(), l(), n()
- }), t.once("ready", function() {
- a()
- }), t.ui = {
- resizeEvent: function(e, n, r) {
- var i, s = e.width()
- , o = this.trigger === Backbone.Events.trigger ? this : t;
- t.vars.window.resize(function() {
- i = e.width(), s !== i && (s = i, o.emit(n, s))
- }), r && o.emit(n, s, e)
- }
- , selectNav: function(n, r) {
- var i = /android/i.test(window.navigator.userAgent + "")
- , s, o = e("<select></select>")
- , u = n.find("> li")
- , a = [];
- if (t.vars.modernBrowser && !i) s = n.html()
- .replace(/(alt|title|class|id)(\s+)?\=(\s+)?(\'|\")(.*?)(\'|\")/g, "")
- .replace(/href/g, "value")
- .replace(/<(\/)?ul>/g, "<$1optgroup>")
- .replace(/<li(\s)?>(\s+)?<a|<a/g, "<option")
- .replace(/(<\/a\>)?<\/li>/g, "</option>")
- .replace(/<\/a>/g, "")
- .replace(/[ ]+/g, " ");
- else {
- var f, l = n.find("a");
- l.each(function(n) {
- f = e(l[n]), s += t.util.format('<option value="%s">%s</option>', f.attr("href"), f.html())
- })
- }
- o.html(s)
- .change(function() {
- window.location = e(this)
- .attr("value")
- });
- var c = n.find("li.current-menu-item > a, li.current_page_item > a")
- .attr("href")
- , h = o.find("optgroup");
- return n.find("ul")
- .each(function(t, n) {
- var r = e(n)
- .prev();
- h.eq(t)
- .attr("label", " ↳ " + r.text() + " ⌄")
- }), o.find("option")
- .each(function() {
- var t = e(this);
- if (t.attr("value") == c) return t.attr("selected", "true"), !1
- }), r && o.attr(r), o
- }
- }
- }(jQuery, window.Core)
- , function(e, t) {
- function o() {
- i = t.vars.body, s = t.vars.footer, n = t.vars.window, r = t.vars.html
- }
- function u() {
- e("form input:text[placeholder]")
- .each(function(t, n) {
- var r = this.__self = e(this)
- , i = r.hasClass("required") ? " *" : "";
- r.val(r.attr("placeholder") + i)
- })
- .focus(function() {
- var t = this.__self;
- e.trim(t.val()) == t.attr("placeholder") && t.val("")
- })
- .blur(function() {
- var t = this.__self;
- e.trim(t.val()) == "" && t.val(t.attr("placeholder"))
- })
- }
- function a() {
- var e, n, r = window.navigator.userAgent + "";
- r && (e = t.vars.html, /iphone/i.test(r) ? n = "iphone" : /ipad/i.test(r) ? n = "ipad" : /android/i.test(r) && (n = "android"), e.addClass(n))
- }
- function f() {
- if (!document.DISABLE_AUTO_LIGHTBOX) {
- var t = document.LIGHTBOX_MINIMUM_DIMENSION || 100
- , n = /\.(jpg|jpeg|gif|png|tiff|bmp)$/i;
- e("article.post .content a > img")
- .each(function(r, i) {
- var s = e(i)
- , o = s.parent()
- , u = e.trim(o.attr("href"));
- if (n.test(u)) {
- var a = s.width() || s.attr("width") || 0
- , f = s.height() || s.attr("height") || 0;
- (a >= t || f >= t) && s.parent()
- .attr("rel", "lightbox")
- }
- }), e("article.post")
- .each(function(t, n) {
- var r = e.getWrappedObject(n)
- , i = "lightbox[gallery-" + Math.floor(Math.random() * 1e4) + "]";
- r.find("> a.frame[rel^=lightbox]")
- .attr("rel", i), r.find("> .content a[rel^=lightbox]")
- .each(function(t, n) {
- n = e.getWrappedObject(n), n.attr("rel") === "lightbox" && n.attr("rel", i)
- })
- })
- }
- e("a[rel^=lightbox]")
- .prettyPhoto({
- social_tools: null
- , theme: "light_rounded"
- , opacity: 0
- , slideshow: 4e3
- , deeplinking: !1
- , overlay_gallery: !1
- })
- }
- function c() {
- e(".flickr-gallery")
- .each(function(t, n) {
- var r = e(n)
- , i = r.data("query")
- , s = r.data("cache-timeout")
- , o = calcMD5(i)
- , u = locache.get(o);
- u ? r.replaceWith(u) : e.getJSON(i, function(e) {
- var t = [];
- for (var n, i, u = e.length, a = 0; a < u; a++) n = e[a], t.push('<li><a class="frame" href="' + n.url + '"><img width="200" height="200" alt="" src="' + n.image + '" /></a></li>');
- t.unshift('<ul class="resp-gallery three-cols hover-effect clearfix">'), t.push("</ul>"), t = '<div class="ovh">\n' + t.join("\n") + "</div><!-- .ovh -->", locache.set(o, t, s * 60), r.replaceWith(t)
- })
- })
- }
- function h() {
- e("#twitter-feed .tweet")
- .each(function(n, r) {
- var i = e(r)
- , s = i.parent()
- , o = i.data("username")
- , u = i.data("count")
- , a = i.data("interval") || 5e3;
- if (o && u) {
- var f = function(n) {
- var r = e('<span class="nav prev hoverable" data-incr="-1"></span>')
- , o = e('<span class="nav next hoverable" data-incr="1"></span>');
- s.before(r), s.after(o);
- var u, f, l = !1
- , c = !1;
- r.add(o)
- .click(function() {
- if (l) return;
- l = !0;
- var t = e.getWrappedObject(this);
- clearInterval(u), f(t.data("incr"))
- }), s.touchwipe({
- wipeLeft: function() {
- o.trigger("click")
- }
- , wipeRight: function() {
- r.trigger("click")
- }
- , min_move_x: 50
- , preventDefaultEvents: !1
- });
- var h = t.getVar("body")
- , p = function(e) {
- e.keyCode == 37 ? r.trigger("click") : e.keyCode == 39 && o.trigger("click")
- };
- s.add(r)
- .add(o)
- .hover(function(e) {
- switch (e.type) {
- case "mouseenter":
- clearInterval(u), h.keyup(p);
- break;
- case "mouseleave":
- u = setInterval(f, a), h.unbind("keyup", p)
- }
- });
- var d = t.util.createCycle(n)
- , v = i.find("p");
- v.css({
- opacity: 0
- })
- .html(d.get(1)
- .text)
- .animate({
- opacity: 1
- }, 400);
- if (n.length === 1) return;
- u = setInterval(f = function(e) {
- v.animate({
- opacity: 0
- }, 400, function() {
- v.html(d.get(e || 1)
- .text)
- .animate({
- opacity: 1
- }, 300), l = !1
- })
- }, a)
- }
- , l = locache.get(o + "_twitter_cache");
- l ? f(l) : v(o, u, "twitter-feed", function(e) {
- f(e)
- })
- }
- })
- }
- function v(n, r, i, s) {
- try {
- var o = t.util.format("%s/%s/%d", i, n, r)
- , u = locache.get(o);
- if (u) s(u);
- else {
- var a = t.util.format("%s/framework/twitter-api.php?username=%s&count=%d", document.root, n, r);
- e.getJSON(a, function(e) {
- for (var r = e.length, i = 0; i < r; i++) e[i] = {
- text: e[i].text.replace(p.link, d.link)
- .replace(p.mention, d.mention)
- .replace(p.hash, d.hash)
- , timestamp: e[i].created_at
- , link: t.util.format("https://twitter.com/%s/status/%s", n, e[i].id_str)
- };
- locache.set(o, e, document.TWEET_CACHE_EXPIRE || 300), s(e)
- })
- }
- } catch (f) {
- typeof window.console == "object" && (console.log("Unable to retrieve tweets. Error below"), console.log(f))
- }
- }
- function m() {
- var t = e(".blocked-form")
- , n = /^ERR: /;
- if (t.length > 0) {
- var r = document.site_url + "/wp-includes/js/jquery/jquery.form.js";
- head.js(r)
- .ready(function() {
- t.each(function(t, r) {
- var i = e(r)
- , s = i.find(".required")
- .each(function(t, n) {
- var r = e(n)
- , i = r.data("validation")
- , s = r.attr("placeholder");
- r.attr("placeholder", s + " *"), r.removeAttr("data-validation"), i && r.addClass(i)
- })
- , o = {
- errorPlacement: function() {}
- , highlight: function(t) {
- e.getWrappedObject(t)
- .addClass("invalid")
- }
- , unhighlight: function(t) {
- var n = e.getWrappedObject(t);
- e.getWrappedObject(t)
- .removeClass("invalid")
- }
- };
- i.hasClass("no-ajax") || (o.submitHandler = function() {
- i.hasClass("no-ajax") ? i.submit() : i.data("sent-message") ? alert(i.find(".ibox")
- .html()) : i.ajaxSubmit({
- success: function(e) {
- i.find(".ibox")
- .remove(), n.test(e) ? (e = e.replace(n, ""), i.find("input:submit")
- .before('<div class="ibox warning">' + e + "</div>")) : (i.find("input:submit")
- .before('<div class="ibox success">' + e + "</div>"), i.data("sent-message", !0))
- }
- })
- }), i.validate(o)
- })
- })
- }
- }
- function g() {
- var t = e(".multimedia.media-type-audio");
- if (t.length) {
- var n = document.root + "/core/js/mejs/mediaelement-and-player.min.js";
- head.js(n)
- .ready(function() {
- var n = {
- audioWidth: "100%"
- };
- t.find("> audio")
- .each(function(t, r) {
- var i = e(r)
- , s = i.parent()
- .prev()
- .css("marginBottom", 0);
- i.mediaelementplayer(n)
- }), t.addClass("loaded")
- })
- }
- }
- function y() {
- var t = /\.(jpg|jpeg|png|gif|tiff|tga|pic|ico)$/i;
- e("a.frame.lightbox")
- .each(function(n, r) {
- var i = e.getWrappedObject(r)
- , s = i.data("img")
- , o = i.data("gallery")
- , u = i.siblings("h3:first");
- if (s) {
- s = s.replace(/(\?|&|&)a=[a-z]{1,2}$/, "");
- var a = t.test(e.trim(s)) ? "image" : "video";
- i.removeClass("lightbox")
- .attr("href", s), i.append('<span class="format ' + a + '"></span>'), o ? i.attr("rel", "lightbox[gallery-" + o + "]") : i.attr("rel", "lightbox")
- }
- })
- }
- function b() {
- var t = e("body > footer[role=contentinfo] .widget-column")
- , n = t.length;
- if (n % 2 == 0) {
- var r = t.parent()
- .addClass("mobile-landscape-dual");
- switch (n) {
- case 4:
- var i = e('<div class="mobile-dual-container"></div>')
- , s = i.clone();
- i.appendTo(r), s.appendTo(r), t.eq(0)
- .appendTo(i), t.eq(1)
- .appendTo(i), t.eq(2)
- .appendTo(s), t.eq(3)
- .appendTo(s);
- break;
- case 2:
- var i = e('<div class="mobile-dual-container"></div>');
- i.appendTo(r), t.eq(0)
- .appendTo(i), t.eq(1)
- .appendTo(i)
- }
- }
- }
- function w() {
- e(".blog-posts.singular article.post ul.tags-list")
- .each(function(t, n) {
- var r = e.getWrappedObject(n);
- r.siblings()
- .length === 0 && r.css("max-width", "none")
- }), e("p.slogan.cta")
- .each(function(t, n) {
- var r = e(n)
- , i = r.find("a");
- if (i.length === 1) {
- var s = i.width() + parseInt(i.css("paddingRight"), 10) * 2
- , o = i.height() + parseInt(i.css("paddingTop"), 10) * 2
- , u = parseInt(r.css("paddingRight"), 10);
- i.detach()
- .css({
- position: "absolute"
- , top: "50%"
- , marginTop: -(o / 2)
- , right: u
- });
- var a = e("<span>" + r.html() + "</span>");
- r.css("paddingRight", u + s + 10), r.html(a)
- .append(i)
- }
- })
- }
- t.once(":ready", function() {
- a(), b(), m(), g(), y(), t.colors = t.util.getConfig("body", "branding")
- }), t.once("ready", function() {
- o(), f(), c(), h(), w()
- }), t.once("ready:", function() {
- e.browser.msie && u()
- });
- var n, r, i, s, l = /_s\.jpg$/
- , p = {
- link: /((https?|s?ftp|ssh)\:\/\/[^"\s<>]*[^.,;'">\:\s<>\)\]\!])/ig
- , mention: /@([a-z0-9_]+)/ig
- , hash: /#([a-z0-9_]+)/ig
- }
- , d = {
- link: '<a class="ext-link" target="_blank" href="$&">$&</a> '
- , mention: '<a class="user" target="_blank" href="http://twitter.com/$1">@$1</a>'
- , hash: '<a class="hashtag" target="_blank" href="http://twitter.com/search/$1">#$1</a>'
- }
- }(jQuery, window.Core);
Add Comment
Please, Sign In to add comment