|
/* |
|
* justfont Font Loader |
|
* v5.0.6 justfont (www.justfont.com) |
|
* Copyright 2013-2014 (c) |
|
* justfont Development Team (just@justfont.com) and Benjamin Peng (j100002ben@gmail.com) |
|
* Licensed under the Affero General Public License. |
|
* |
|
* justfont dom Ready |
|
* Modified from jQuery |
|
* Copyright 2013 jQuery Foundation and other contributors |
|
* http://jquery.com/ |
|
* |
|
* justfont Promise Object Modified from promisejs |
|
* Copyright 2012-2013 (c) Pierre Duquesne <stackp@online.fr> |
|
* Licensed under the New BSD License. |
|
* |
|
* Sizzle CSS Selector Engine v1.9.3 (http://sizzlejs.com/) |
|
* Copyright 2013 jQuery Foundation, Inc. and other contributors |
|
* Released under the MIT license |
|
* |
|
*/ |
|
(function (global, document, da) { |
|
var JFCore = global._jf, |
|
location = global.location; |
|
if (JFCore.constructor !== Object) { |
|
var Promise = function () { |
|
return { |
|
resolved: false, |
|
resolved_arguments: null, |
|
queue: [], |
|
done: function (b) { |
|
this.resolved |
|
? b.apply(this, this.resolved_arguments) |
|
: this.queue.push(b); |
|
}, |
|
resolve: function () { |
|
this.resolved = !0; |
|
this.resolved_arguments = arguments; |
|
for (var b = 0; b < this.queue.length; ++b) |
|
this.queue[b].apply(this, this.resolved_arguments); |
|
}, |
|
}; |
|
}, |
|
userAgent = global.navigator.userAgent, |
|
X = /MSIE/g.test(userAgent), |
|
sa = false, |
|
ta = /Android/g.test(userAgent), |
|
Y = X ? parseInt(userAgent.split(';')[1].split(' ')[2], 10) : '', |
|
ba = X && 9 > Y, |
|
N, |
|
supportFontFormat = ba ? 'eot' : ta ? 'ttf' : 'woff', |
|
fontLoadData = { |
|
addScript: JFCore.addScript, |
|
p: '', |
|
t: supportFontFormat, |
|
origin: |
|
location.origin || |
|
location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : ''), |
|
}; |
|
delete JFCore.addScript; |
|
|
|
|
|
|
|
(function (root, doc, f) { |
|
var h = 1, |
|
run = false, |
|
promise, |
|
v = function (b) { |
|
if (true === b ? !--h : !run) { |
|
if (!doc.body) return setTimeout(v); |
|
run = true; |
|
(true !== b && 0 < --h) || promise.resolve(); |
|
} |
|
}, |
|
E = function () { |
|
if (!promise) |
|
if (((promise = Promise()), 'complete' === doc.readyState)) setTimeout(v); |
|
else if (doc.addEventListener) |
|
doc.addEventListener('DOMContentLoaded', onLoad, !1), |
|
root.addEventListener('load', onLoad, !1); |
|
else { |
|
doc.attachEvent('onreadystatechange', onLoad); |
|
root.attachEvent('onload', onLoad); |
|
var f = false; |
|
try { |
|
f = null == root.frameElement && doc.documentElement; |
|
} catch (m) {} |
|
f && |
|
f.doScroll && |
|
(function Ha() { |
|
if (!run) { |
|
try { |
|
f.doScroll('left'); |
|
} catch (J) { |
|
return setTimeout(Ha, 50); |
|
} |
|
Ea(); |
|
v(); |
|
} |
|
})(); |
|
} |
|
return promise; |
|
}, |
|
onLoad = function (b) { |
|
if ( |
|
doc.addEventListener || |
|
'load' === b.type || |
|
'complete' === doc.readyState |
|
) |
|
Ea(), v(); |
|
}, |
|
Ea = function () { |
|
doc.addEventListener |
|
? (doc.removeEventListener('DOMContentLoaded', onLoad, false), |
|
root.removeEventListener('load', onLoad, false)) |
|
: (doc.detachEvent('onreadystatechange', onLoad), |
|
root.detachEvent('onload', onLoad)); |
|
}; |
|
fontLoadData.DomReady = function (b, e) { |
|
E().done(b); |
|
}; |
|
})(this, this.document); |
|
|
|
|
|
//# region Promise reqeust module? |
|
(function (b) { |
|
var e = function (b, f) { |
|
var k = new p(); |
|
0 === b.length |
|
? k.done.apply(k, f) |
|
: b[0].apply(null, f).then(function () { |
|
b.splice(0, 1); |
|
e(b, arguments).then(function () { |
|
k.done.apply(k, arguments); |
|
}); |
|
}); |
|
return k; |
|
}, |
|
f = function (b) { |
|
var e = ''; |
|
if ('string' === typeof b) e = b; |
|
else { |
|
var f = encodeURIComponent, |
|
h; |
|
for (h in b) |
|
b.hasOwnProperty(h) && (e += '&' + f(h) + '=' + f(b[h])); |
|
e = e ? e.substr(1) : ''; |
|
} |
|
return e; |
|
}, |
|
request = function (e, h, k, u) { |
|
var v = new p(); |
|
k = k || {}; |
|
k = 'string' == typeof k ? k : f(k); |
|
'GET' === e && k && ((h += '?' + k), (k = null)); |
|
try { |
|
var m = |
|
b.XDomainRequest && X && 10 > Y |
|
? new XDomainRequest() |
|
: b.XMLHttpRequest |
|
? new XMLHttpRequest() |
|
: null; |
|
if (!m) return v.done(Promise.ENOXHR, ''), v; |
|
} catch (n) { |
|
return v.done(Promise.ENOXHR, ''), v; |
|
} |
|
m.open(e, h); |
|
var E = Promise.ajaxTimeout, |
|
J; |
|
b.XDomainRequest && X && 10 > Y |
|
? (E && (m.timeout = E), |
|
(m.ontimeout = function () { |
|
v.done(Promise.ETIMEOUT, ''); |
|
m.ontimeout = m.onerror = m.onload = m.onprogress = null; |
|
}), |
|
(m.onerror = function () { |
|
v.done(Promise.EONERROR, m.responseText); |
|
m.ontimeout = m.onerror = m.onload = m.onprogress = null; |
|
}), |
|
(m.onload = function () { |
|
v.done(null, m.responseText); |
|
m.ontimeout = m.onerror = m.onload = m.onprogress = null; |
|
}), |
|
(m.onprogress = function () {})) |
|
: b.XMLHttpRequest && |
|
(m.setRequestHeader( |
|
'Content-type', |
|
'application/x-www-form-urlencoded' |
|
), |
|
E && |
|
(J = setTimeout(function () { |
|
m.abort(); |
|
v.done(Promise.ETIMEOUT, ''); |
|
}, E)), |
|
(m.onreadystatechange = function () { |
|
4 === m.readyState && |
|
(E && clearTimeout(J), |
|
(m.onreadystatechange = null), |
|
!m.status || |
|
((200 >= m.status || 300 <= m.status) && 304 !== m.status) |
|
? v.done(null, m.responseText) |
|
: v.done(Promise.EONERROR, m.responseText)); |
|
})); |
|
m.send(k); |
|
return v; |
|
}, |
|
p = function () { |
|
this._callbacks = []; |
|
}; |
|
p.prototype = { |
|
constructor: p, |
|
then: function (b, e) { |
|
if (this._isdone) var f = b.apply(e, this.result); |
|
else |
|
(f = new p()), |
|
this._callbacks.push(function () { |
|
var h = b.apply(e, arguments); |
|
h && 'function' === typeof h.then && h.then(f.done, f); |
|
}); |
|
return f; |
|
}, |
|
done: function () { |
|
this.result = arguments; |
|
this._isdone = !0; |
|
for (var b = 0; b < this._callbacks.length; b++) |
|
this._callbacks[b].apply(null, arguments); |
|
this._callbacks = []; |
|
}, |
|
}; |
|
var Promise = { |
|
Promise: p, |
|
join: function (b) { |
|
function e(b) { |
|
return function () { |
|
y += 1; |
|
m[b] = Array.prototype.slice.call(arguments); |
|
y === h && f.done(m); |
|
}; |
|
} |
|
for (var f = new p(), h = b.length, y = 0, m = [], v = 0; v < h; v++) |
|
b[v].then(e(v)); |
|
return f; |
|
}, |
|
chain: e, |
|
encode: f, |
|
get: function (b, e, f) { |
|
return request('GET', b, e, f); |
|
}, |
|
post: function (b, e, f) { |
|
return request('POST', b, e, f); |
|
}, |
|
ENOXHR: 1, |
|
ETIMEOUT: 2, |
|
EONERROR: 3, |
|
ajaxTimeout: 0, |
|
}; |
|
fontLoadData.promise = Promise; |
|
})(global); |
|
//# endregion |
|
|
|
|
|
|
|
|
|
//# region Some DOM library |
|
(function (b, e) { |
|
function f(a, c, d, r) { |
|
var b, l, q, e; |
|
(c ? c.ownerDocument || c : Q) !== C && ca(c); |
|
c = c || C; |
|
d = d || []; |
|
if (!a || 'string' !== typeof a) return d; |
|
if (1 !== (e = c.nodeType) && 9 !== e) return []; |
|
if (P && !r) { |
|
if ((b = Ca.exec(a))) |
|
if ((q = b[1])) |
|
if (9 === e) |
|
if ((l = c.getElementById(q)) && l.parentNode) { |
|
if (l.id === q) return d.push(l), d; |
|
} else return d; |
|
else { |
|
if ( |
|
c.ownerDocument && |
|
(l = c.ownerDocument.getElementById(q)) && |
|
K(c, l) && |
|
l.id === q |
|
) |
|
return d.push(l), d; |
|
} |
|
else { |
|
if (b[2]) return T.apply(d, c.getElementsByTagName(a)), d; |
|
if ( |
|
(q = b[3]) && |
|
A.getElementsByClassName && |
|
c.getElementsByClassName |
|
) |
|
return T.apply(d, c.getElementsByClassName(q)), d; |
|
} |
|
if (A.qsa && (!L || !L.test(a))) { |
|
l = b = D; |
|
q = c; |
|
var f = 9 === e && a; |
|
if (1 === e && 'object' !== c.nodeName.toLowerCase()) { |
|
e = n(a); |
|
(b = c.getAttribute('id')) |
|
? (l = b.replace(Ia, '\\$&')) |
|
: c.setAttribute('id', l); |
|
l = "[id='" + l + "'] "; |
|
for (q = e.length; q--; ) e[q] = l + w(e[q]); |
|
q = (ua.test(a) && c.parentNode) || c; |
|
f = e.join(','); |
|
} |
|
if (f) |
|
try { |
|
return T.apply(d, q.querySelectorAll(f)), d; |
|
} catch (Ma) { |
|
} finally { |
|
b || c.removeAttribute('id'); |
|
} |
|
} |
|
} |
|
var g; |
|
a: { |
|
a = a.replace(ma, '$1'); |
|
l = n(a); |
|
if (!r && 1 === l.length) { |
|
b = l[0] = l[0].slice(0); |
|
if ( |
|
2 < b.length && |
|
'ID' === (g = b[0]).type && |
|
A.getById && |
|
9 === c.nodeType && |
|
P && |
|
x.relative[b[1].type] |
|
) { |
|
c = (x.find.ID(g.matches[0].replace(U, V), c) || [])[0]; |
|
if (!c) { |
|
g = d; |
|
break a; |
|
} |
|
a = a.slice(b.shift().value.length); |
|
} |
|
for (e = na.needsContext.test(a) ? 0 : b.length; e--; ) { |
|
g = b[e]; |
|
if (x.relative[(q = g.type)]) break; |
|
if ((q = x.find[q])) |
|
if ( |
|
(r = q( |
|
g.matches[0].replace(U, V), |
|
(ua.test(b[0].type) && c.parentNode) || c |
|
)) |
|
) { |
|
b.splice(e, 1); |
|
a = r.length && w(b); |
|
if (!a) { |
|
T.apply(d, r); |
|
g = d; |
|
break a; |
|
} |
|
break; |
|
} |
|
} |
|
} |
|
Fa(a, l)(r, c, !P, d, ua.test(a)); |
|
g = d; |
|
} |
|
return g; |
|
} |
|
|
|
function h() { |
|
function a(d, b) { |
|
c.push((d += ' ')) > x.cacheLength && delete a[c.shift()]; |
|
return (a[d] = b); |
|
} |
|
var c = []; |
|
return a; |
|
} |
|
function p(a) { |
|
a[D] = !0; |
|
return a; |
|
} |
|
function y(a) { |
|
var c = C.createElement('div'); |
|
try { |
|
return !!a(c); |
|
} catch (d) { |
|
return !1; |
|
} finally { |
|
c.parentNode && c.parentNode.removeChild(c); |
|
} |
|
} |
|
function v(a, c, d) { |
|
a = a.split('|'); |
|
var b, |
|
z = a.length; |
|
for (d = d ? null : c; z--; ) |
|
((b = x.attrHandle[a[z]]) && b !== c) || (x.attrHandle[a[z]] = d); |
|
} |
|
function E(a, c) { |
|
var d = a.getAttributeNode(c); |
|
return d && d.specified |
|
? d.value |
|
: !0 === a[c] |
|
? c.toLowerCase() |
|
: null; |
|
} |
|
function k(a, c) { |
|
return a.getAttribute(c, 'type' === c.toLowerCase() ? 1 : 2); |
|
} |
|
function H(a) { |
|
if ('input' === a.nodeName.toLowerCase()) return a.defaultValue; |
|
} |
|
function I(a, c) { |
|
var d = c && a, |
|
b = |
|
d && |
|
1 === a.nodeType && |
|
1 === c.nodeType && |
|
(~c.sourceIndex || -2147483648) - (~a.sourceIndex || -2147483648); |
|
if (b) return b; |
|
if (d) for (; (d = d.nextSibling); ) if (d === c) return -1; |
|
return a ? 1 : -1; |
|
} |
|
function m(a) { |
|
return function (c) { |
|
return 'input' === c.nodeName.toLowerCase() && c.type === a; |
|
}; |
|
} |
|
function N(a) { |
|
return function (c) { |
|
var d = c.nodeName.toLowerCase(); |
|
return ('input' === d || 'button' === d) && c.type === a; |
|
}; |
|
} |
|
function J(a) { |
|
return p(function (c) { |
|
c = +c; |
|
return p(function (d, b) { |
|
for (var r, e = a([], d.length, c), q = e.length; q--; ) |
|
d[(r = e[q])] && (d[r] = !(b[r] = d[r])); |
|
}); |
|
}); |
|
} |
|
function n(a, c) { |
|
var d, b, e, l, q; |
|
if ((l = S[a + ' '])) return c ? 0 : l.slice(0); |
|
l = a; |
|
var n = []; |
|
for (q = x.preFilter; l; ) { |
|
if (!g || (d = ra.exec(l))) |
|
d && (l = l.slice(d[0].length) || l), n.push((b = [])); |
|
var g = !1; |
|
if ((d = sa.exec(l))) |
|
(g = d.shift()), |
|
b.push({ value: g, type: d[0].replace(ma, ' ') }), |
|
(l = l.slice(g.length)); |
|
for (e in x.filter) |
|
!(d = na[e].exec(l)) || |
|
(q[e] && !(d = q[e](d))) || |
|
((g = d.shift()), |
|
b.push({ value: g, type: e, matches: d }), |
|
(l = l.slice(g.length))); |
|
if (!g) break; |
|
} |
|
return c ? l.length : l ? f.error(a) : S(a, n).slice(0); |
|
} |
|
function w(a) { |
|
for (var c = 0, d = a.length, b = ''; c < d; c++) b += a[c].value; |
|
return b; |
|
} |
|
function G(a, c, d) { |
|
var b = c.dir, |
|
e = d && 'parentNode' === b, |
|
l = X++; |
|
return c.first |
|
? function (d, c, r) { |
|
for (; (d = d[b]); ) if (1 === d.nodeType || e) return a(d, c, r); |
|
} |
|
: function (d, c, r) { |
|
var n, |
|
g, |
|
z = R + ' ' + l; |
|
if (r) |
|
for (; (d = d[b]); ) { |
|
if ((1 === d.nodeType || e) && a(d, c, r)) return !0; |
|
} |
|
else |
|
for (; (d = d[b]); ) |
|
if (1 === d.nodeType || e) { |
|
var f = d[D] || (d[D] = {}); |
|
if ((g = f[b]) && g[0] === z) { |
|
if (!0 === (n = g[1]) || n === oa) return !0 === n; |
|
} else if ( |
|
((g = f[b] = [z]), (g[1] = a(d, c, r) || oa), !0 === g[1]) |
|
) |
|
return !0; |
|
} |
|
}; |
|
} |
|
function g(a) { |
|
return 1 < a.length |
|
? function (c, d, b) { |
|
for (var r = a.length; r--; ) if (!a[r](c, d, b)) return !1; |
|
return !0; |
|
} |
|
: a[0]; |
|
} |
|
function pa(a, c, d, b, e) { |
|
for (var r, g = [], n = 0, f = a.length, z = null != c; n < f; n++) |
|
if ((r = a[n])) if (!d || d(r, b, e)) g.push(r), z && c.push(n); |
|
return g; |
|
} |
|
function va(a, c, d, b, e, n) { |
|
b && !b[D] && (b = va(b)); |
|
e && !e[D] && (e = va(e, n)); |
|
return p(function (r, n, g, l) { |
|
var z, |
|
q = [], |
|
h = [], |
|
G = n.length, |
|
m; |
|
if (!(m = r)) { |
|
m = c || '*'; |
|
for ( |
|
var w = g.nodeType ? [g] : g, t = [], x = 0, p = w.length; |
|
x < p; |
|
x++ |
|
) |
|
f(m, w[x], t); |
|
m = t; |
|
} |
|
m = !a || (!r && c) ? m : pa(m, q, a, g, l); |
|
w = d ? (e || (r ? a : G || b) ? [] : n) : m; |
|
d && d(m, w, g, l); |
|
if (b) { |
|
var k = pa(w, h); |
|
b(k, [], g, l); |
|
for (g = k.length; g--; ) if ((z = k[g])) w[h[g]] = !(m[h[g]] = z); |
|
} |
|
if (r) { |
|
if (e || a) { |
|
if (e) { |
|
k = []; |
|
for (g = w.length; g--; ) (z = w[g]) && k.push((m[g] = z)); |
|
e(null, (w = []), k, l); |
|
} |
|
for (g = w.length; g--; ) |
|
(z = w[g]) && |
|
-1 < (k = e ? Z.call(r, z) : q[g]) && |
|
(r[k] = !(n[k] = z)); |
|
} |
|
} else (w = pa(w === n ? w.splice(G, w.length) : w)), e ? e(null, n, w, l) : T.apply(n, w); |
|
}); |
|
} |
|
function wa(a) { |
|
var c, |
|
d, |
|
b = a.length, |
|
e = x.relative[a[0].type]; |
|
var n = e || x.relative[' ']; |
|
for ( |
|
var f = e ? 1 : 0, |
|
h = G( |
|
function (a) { |
|
return a === c; |
|
}, |
|
n, |
|
!0 |
|
), |
|
m = G( |
|
function (a) { |
|
return -1 < Z.call(c, a); |
|
}, |
|
n, |
|
!0 |
|
), |
|
k = [ |
|
function (a, d, b) { |
|
return ( |
|
(!e && (b || d !== F)) || |
|
((c = d).nodeType ? h(a, d, b) : m(a, d, b)) |
|
); |
|
}, |
|
]; |
|
f < b; |
|
f++ |
|
) |
|
if ((n = x.relative[a[f].type])) k = [G(g(k), n)]; |
|
else { |
|
n = x.filter[a[f].type].apply(null, a[f].matches); |
|
if (n[D]) { |
|
for (d = ++f; d < b && !x.relative[a[d].type]; d++); |
|
return va( |
|
1 < f && g(k), |
|
1 < f && |
|
w( |
|
a |
|
.slice(0, f - 1) |
|
.concat({ value: ' ' === a[f - 2].type ? '*' : '' }) |
|
).replace(ma, '$1'), |
|
n, |
|
f < d && wa(a.slice(f, d)), |
|
d < b && wa((a = a.slice(d))), |
|
d < b && w(a) |
|
); |
|
} |
|
k.push(n); |
|
} |
|
return g(k); |
|
} |
|
function Ja(a, c) { |
|
var d = 0, |
|
b = 0 < c.length, |
|
e = 0 < a.length, |
|
g = function (g, r, n, l, z) { |
|
var h, |
|
m, |
|
w = [], |
|
G = 0, |
|
q = '0', |
|
k = g && [], |
|
t = null != z, |
|
p = F, |
|
y = g || (e && x.find.TAG('*', (z && r.parentNode) || r)), |
|
v = (R += null == p ? 1 : Math.random() || 0.1); |
|
t && ((F = r !== C && r), (oa = d)); |
|
for (; null != (z = y[q]); q++) { |
|
if (e && z) { |
|
for (h = 0; (m = a[h++]); ) |
|
if (m(z, r, n)) { |
|
l.push(z); |
|
break; |
|
} |
|
t && ((R = v), (oa = ++d)); |
|
} |
|
b && ((z = !m && z) && G--, g && k.push(z)); |
|
} |
|
G += q; |
|
if (b && q !== G) { |
|
for (h = 0; (m = c[h++]); ) m(k, w, r, n); |
|
if (g) { |
|
if (0 < G) for (; q--; ) k[q] || w[q] || (w[q] = ia.call(l)); |
|
w = pa(w); |
|
} |
|
T.apply(l, w); |
|
t && !g && 0 < w.length && 1 < G + c.length && f.uniqueSort(l); |
|
} |
|
t && ((R = v), (F = p)); |
|
return k; |
|
}; |
|
return b ? p(g) : g; |
|
} |
|
function Ga() {} |
|
var t, |
|
oa, |
|
F, |
|
aa, |
|
C, |
|
O, |
|
P, |
|
L, |
|
B, |
|
M, |
|
K, |
|
D = 'sizzle' + -new Date(), |
|
Q = b.document, |
|
R = 0, |
|
X = 0, |
|
Y = h(), |
|
S = h(), |
|
ba = h(), |
|
fa = !1, |
|
qa = function () { |
|
return 0; |
|
}, |
|
ha = typeof e, |
|
ea = {}.hasOwnProperty, |
|
W = [], |
|
ia = W.pop, |
|
la = W.push, |
|
T = W.push, |
|
da = W.slice, |
|
Z = |
|
W.indexOf || |
|
function (a) { |
|
for (var c = 0, d = this.length; c < d; c++) |
|
if (this[c] === a) return c; |
|
return -1; |
|
}, |
|
ja = '(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+'.replace('w', 'w#'), |
|
ka = |
|
'\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)[\\x20\\t\\r\\n\\f]*(?:([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:([\'"])((?:\\\\.|[^\\\\])*?)\\3|(' + |
|
ja + |
|
')|)|)[\\x20\\t\\r\\n\\f]*\\]', |
|
xa = |
|
':((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)(?:\\((([\'"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|' + |
|
ka.replace(3, 8) + |
|
')*)|.*)\\)|)', |
|
ma = RegExp( |
|
'^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$', |
|
'g' |
|
), |
|
ra = /^[\x20\t\r\n\f]*,[\x20\t\r\n\f]*/, |
|
sa = /^[\x20\t\r\n\f]*([>+~]|[\x20\t\r\n\f])[\x20\t\r\n\f]*/, |
|
ua = /[\x20\t\r\n\f]*[+~]/, |
|
ta = RegExp( |
|
'=[\\x20\\t\\r\\n\\f]*([^\\]\'"]*)[\\x20\\t\\r\\n\\f]*\\]', |
|
'g' |
|
), |
|
Aa = new RegExp(xa), |
|
Ba = new RegExp('^' + ja + '$'), |
|
na = { |
|
ID: /^#((?:\\.|[\w-]|[^\x00-\xa0])+)/, |
|
CLASS: /^\.((?:\\.|[\w-]|[^\x00-\xa0])+)/, |
|
TAG: new RegExp( |
|
'^(' + '(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+'.replace('w', 'w*') + ')' |
|
), |
|
ATTR: new RegExp('^' + ka), |
|
PSEUDO: new RegExp('^' + xa), |
|
CHILD: /^:(only|first|last|nth|nth-last)-(child|of-type)(?:\([\x20\t\r\n\f]*(even|odd|(([+-]|)(\d*)n|)[\x20\t\r\n\f]*(?:([+-]|)[\x20\t\r\n\f]*(\d+)|))[\x20\t\r\n\f]*\)|)/i, |
|
bool: /^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i, |
|
needsContext: /^[\x20\t\r\n\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\([\x20\t\r\n\f]*((?:-\d)?\d*)[\x20\t\r\n\f]*\)|)(?=[^-]|$)/i, |
|
}, |
|
ya = /^[^{]+\{\s*\[native \w/, |
|
Ca = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, |
|
Da = /^(?:input|select|textarea|button)$/i, |
|
Ka = /^h\d$/i, |
|
Ia = /'|\\/g, |
|
U = RegExp( |
|
'\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)', |
|
'ig' |
|
), |
|
V = function (a, c, d) { |
|
a = '0x' + c - 65536; |
|
return a !== a || d |
|
? c |
|
: 0 > a |
|
? String.fromCharCode(a + 65536) |
|
: String.fromCharCode((a >> 10) | 55296, (a & 1023) | 56320); |
|
}; |
|
try { |
|
T.apply((W = da.call(Q.childNodes)), Q.childNodes), |
|
W[Q.childNodes.length].nodeType; |
|
} catch (a) { |
|
T = { |
|
apply: W.length |
|
? function (a, d) { |
|
la.apply(a, da.call(d)); |
|
} |
|
: function (a, d) { |
|
for (var c = a.length, b = 0; (a[c++] = d[b++]); ); |
|
a.length = c - 1; |
|
}, |
|
}; |
|
} |
|
var La = (f.isXML = function (a) { |
|
return (a = a && (a.ownerDocument || a).documentElement) |
|
? 'HTML' !== a.nodeName |
|
: !1; |
|
}); |
|
var A = (f.support = {}); |
|
var ca = (f.setDocument = function (a) { |
|
var c = a ? a.ownerDocument || a : Q; |
|
a = c.parentWindow; |
|
if (c === C || 9 !== c.nodeType || !c.documentElement) return C; |
|
C = c; |
|
O = c.documentElement; |
|
P = !La(c); |
|
a && |
|
a.attachEvent && |
|
a !== a.top && |
|
a.attachEvent('onbeforeunload', function () { |
|
ca(); |
|
}); |
|
A.attributes = y(function (a) { |
|
a.innerHTML = "<a href='#'></a>"; |
|
v( |
|
'type|href|height|width', |
|
k, |
|
'#' === a.firstChild.getAttribute('href') |
|
); |
|
v( |
|
'checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped', |
|
E, |
|
null == a.getAttribute('disabled') |
|
); |
|
a.className = 'i'; |
|
return !a.getAttribute('className'); |
|
}); |
|
A.input = y(function (a) { |
|
a.innerHTML = '<input>'; |
|
a.firstChild.setAttribute('value', ''); |
|
return '' === a.firstChild.getAttribute('value'); |
|
}); |
|
v('value', H, A.attributes && A.input); |
|
A.getElementsByTagName = y(function (a) { |
|
a.appendChild(c.createComment('')); |
|
return !a.getElementsByTagName('*').length; |
|
}); |
|
A.getElementsByClassName = y(function (a) { |
|
a.innerHTML = "<div class='a'></div><div class='a i'></div>"; |
|
a.firstChild.className = 'i'; |
|
return 2 === a.getElementsByClassName('i').length; |
|
}); |
|
A.getById = y(function (a) { |
|
O.appendChild(a).id = D; |
|
return !c.getElementsByName || !c.getElementsByName(D).length; |
|
}); |
|
A.getById |
|
? ((x.find.ID = function (a, c) { |
|
if (typeof c.getElementById !== ha && P) { |
|
var d = c.getElementById(a); |
|
return d && d.parentNode ? [d] : []; |
|
} |
|
}), |
|
(x.filter.ID = function (a) { |
|
var d = a.replace(U, V); |
|
return function (a) { |
|
return a.getAttribute('id') === d; |
|
}; |
|
})) |
|
: (delete x.find.ID, |
|
(x.filter.ID = function (a) { |
|
var d = a.replace(U, V); |
|
return function (a) { |
|
return ( |
|
(a = |
|
typeof a.getAttributeNode !== ha && |
|
a.getAttributeNode('id')) && a.value === d |
|
); |
|
}; |
|
})); |
|
x.find.TAG = A.getElementsByTagName |
|
? function (a, c) { |
|
if (typeof c.getElementsByTagName !== ha) |
|
return c.getElementsByTagName(a); |
|
} |
|
: function (a, c) { |
|
var d, |
|
b = [], |
|
e = 0, |
|
g = c.getElementsByTagName(a); |
|
if ('*' === a) { |
|
for (; (d = g[e++]); ) 1 === d.nodeType && b.push(d); |
|
return b; |
|
} |
|
return g; |
|
}; |
|
x.find.CLASS = |
|
A.getElementsByClassName && |
|
function (a, c) { |
|
if (typeof c.getElementsByClassName !== ha && P) |
|
return c.getElementsByClassName(a); |
|
}; |
|
B = []; |
|
L = []; |
|
if ((A.qsa = ya.test(c.querySelectorAll + ''))) |
|
y(function (a) { |
|
a.innerHTML = "<select><option selected=''></option></select>"; |
|
a.querySelectorAll('[selected]').length || |
|
L.push( |
|
'\\[[\\x20\\t\\r\\n\\f]*(?:value|checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)' |
|
); |
|
a.querySelectorAll(':checked').length || L.push(':checked'); |
|
}), |
|
y(function (a) { |
|
var d = c.createElement('input'); |
|
d.setAttribute('type', 'hidden'); |
|
a.appendChild(d).setAttribute('t', ''); |
|
a.querySelectorAll("[t^='']").length && |
|
L.push('[*^$]=[\\x20\\t\\r\\n\\f]*(?:\'\'|"")'); |
|
a.querySelectorAll(':enabled').length || |
|
L.push(':enabled', ':disabled'); |
|
a.querySelectorAll('*,:x'); |
|
L.push(',.*:'); |
|
}); |
|
(A.matchesSelector = ya.test( |
|
(M = |
|
O.webkitMatchesSelector || |
|
O.mozMatchesSelector || |
|
O.oMatchesSelector || |
|
O.msMatchesSelector) + '' |
|
)) && |
|
y(function (a) { |
|
A.disconnectedMatch = M.call(a, 'div'); |
|
M.call(a, "[s!='']:x"); |
|
B.push('!=', xa); |
|
}); |
|
L = L.length && new RegExp(L.join('|')); |
|
B = B.length && new RegExp(B.join('|')); |
|
K = |
|
ya.test(O.contains + '') || O.compareDocumentPosition |
|
? function (a, c) { |
|
var d = 9 === a.nodeType ? a.documentElement : a, |
|
b = c && c.parentNode; |
|
return ( |
|
a === b || |
|
!!( |
|
b && |
|
1 === b.nodeType && |
|
(d.contains |
|
? d.contains(b) |
|
: a.compareDocumentPosition && |
|
a.compareDocumentPosition(b) & 16) |
|
) |
|
); |
|
} |
|
: function (a, c) { |
|
if (c) for (; (c = c.parentNode); ) if (c === a) return !0; |
|
return !1; |
|
}; |
|
A.sortDetached = y(function (a) { |
|
return a.compareDocumentPosition(c.createElement('div')) & 1; |
|
}); |
|
qa = O.compareDocumentPosition |
|
? function (a, b) { |
|
if (a === b) return (fa = !0), 0; |
|
var d = |
|
b.compareDocumentPosition && |
|
a.compareDocumentPosition && |
|
a.compareDocumentPosition(b); |
|
return d |
|
? d & 1 || |
|
(!A.sortDetached && b.compareDocumentPosition(a) === d) |
|
? a === c || K(Q, a) |
|
? -1 |
|
: b === c || K(Q, b) |
|
? 1 |
|
: aa |
|
? Z.call(aa, a) - Z.call(aa, b) |
|
: 0 |
|
: d & 4 |
|
? -1 |
|
: 1 |
|
: a.compareDocumentPosition |
|
? -1 |
|
: 1; |
|
} |
|
: function (a, b) { |
|
var d = 0; |
|
var e = a.parentNode; |
|
var g = b.parentNode, |
|
n = [a], |
|
f = [b]; |
|
if (a === b) return (fa = !0), 0; |
|
if (!e || !g) |
|
return a === c |
|
? -1 |
|
: b === c |
|
? 1 |
|
: e |
|
? -1 |
|
: g |
|
? 1 |
|
: aa |
|
? Z.call(aa, a) - Z.call(aa, b) |
|
: 0; |
|
if (e === g) return I(a, b); |
|
for (e = a; (e = e.parentNode); ) n.unshift(e); |
|
for (e = b; (e = e.parentNode); ) f.unshift(e); |
|
for (; n[d] === f[d]; ) d++; |
|
return d ? I(n[d], f[d]) : n[d] === Q ? -1 : f[d] === Q ? 1 : 0; |
|
}; |
|
return c; |
|
}); |
|
f.matches = function (a, c) { |
|
return f(a, null, null, c); |
|
}; |
|
f.matchesSelector = function (a, c) { |
|
(a.ownerDocument || a) !== C && ca(a); |
|
c = c.replace(ta, "='$1']"); |
|
if (!(!A.matchesSelector || !P || (B && B.test(c)) || (L && L.test(c)))) |
|
try { |
|
var d = M.call(a, c); |
|
if ( |
|
d || |
|
A.disconnectedMatch || |
|
(a.document && 11 !== a.document.nodeType) |
|
) |
|
return d; |
|
} catch (r) {} |
|
return 0 < f(c, C, null, [a]).length; |
|
}; |
|
f.contains = function (a, c) { |
|
(a.ownerDocument || a) !== C && ca(a); |
|
return K(a, c); |
|
}; |
|
f.attr = function (a, c) { |
|
(a.ownerDocument || a) !== C && ca(a); |
|
var d = x.attrHandle[c.toLowerCase()]; |
|
d = d && ea.call(x.attrHandle, c.toLowerCase()) ? d(a, c, !P) : e; |
|
return d === e |
|
? A.attributes || !P |
|
? a.getAttribute(c) |
|
: (d = a.getAttributeNode(c)) && d.specified |
|
? d.value |
|
: null |
|
: d; |
|
}; |
|
f.error = function (a) { |
|
throw Error('Syntax error, unrecognized expression: ' + a); |
|
}; |
|
f.uniqueSort = function (a) { |
|
var c, |
|
d = [], |
|
b = 0, |
|
e = 0; |
|
fa = !A.detectDuplicates; |
|
aa = !A.sortStable && a.slice(0); |
|
a.sort(qa); |
|
if (fa) { |
|
for (; (c = a[e++]); ) c === a[e] && (b = d.push(e)); |
|
for (; b--; ) a.splice(d[b], 1); |
|
} |
|
return a; |
|
}; |
|
var za = (f.getText = function (a) { |
|
var c = '', |
|
d = 0; |
|
var b = a.nodeType; |
|
if (!b) for (; (b = a[d]); d++) c += za(b); |
|
else if (1 === b || 9 === b || 11 === b) { |
|
if ('string' === typeof a.textContent) return a.textContent; |
|
for (a = a.firstChild; a; a = a.nextSibling) c += za(a); |
|
} else if (3 === b || 4 === b) return a.nodeValue; |
|
return c; |
|
}); |
|
var x = (f.selectors = { |
|
cacheLength: 50, |
|
createPseudo: p, |
|
match: na, |
|
attrHandle: {}, |
|
find: {}, |
|
relative: { |
|
'>': { dir: 'parentNode', first: !0 }, |
|
' ': { dir: 'parentNode' }, |
|
'+': { dir: 'previousSibling', first: !0 }, |
|
'~': { dir: 'previousSibling' }, |
|
}, |
|
preFilter: { |
|
ATTR: function (a) { |
|
a[1] = a[1].replace(U, V); |
|
a[3] = (a[4] || a[5] || '').replace(U, V); |
|
'~=' === a[2] && (a[3] = ' ' + a[3] + ' '); |
|
return a.slice(0, 4); |
|
}, |
|
CHILD: function (a) { |
|
a[1] = a[1].toLowerCase(); |
|
'nth' === a[1].slice(0, 3) |
|
? (a[3] || f.error(a[0]), |
|
(a[4] = +(a[4] |
|
? a[5] + (a[6] || 1) |
|
: 2 * ('even' === a[3] || 'odd' === a[3]))), |
|
(a[5] = +(a[7] + a[8] || 'odd' === a[3]))) |
|
: a[3] && f.error(a[0]); |
|
return a; |
|
}, |
|
PSEUDO: function (a) { |
|
var c, |
|
d = !a[5] && a[2]; |
|
if (na.CHILD.test(a[0])) return null; |
|
a[3] && a[4] !== e |
|
? (a[2] = a[4]) |
|
: d && |
|
Aa.test(d) && |
|
(c = n(d, !0)) && |
|
(c = d.indexOf(')', d.length - c) - d.length) && |
|
((a[0] = a[0].slice(0, c)), (a[2] = d.slice(0, c))); |
|
return a.slice(0, 3); |
|
}, |
|
}, |
|
filter: { |
|
TAG: function (a) { |
|
var c = a.replace(U, V).toLowerCase(); |
|
return '*' === a |
|
? function () { |
|
return !0; |
|
} |
|
: function (a) { |
|
return a.nodeName && a.nodeName.toLowerCase() === c; |
|
}; |
|
}, |
|
CLASS: function (a) { |
|
var c = Y[a + ' ']; |
|
return ( |
|
c || |
|
((c = new RegExp( |
|
'(^|[\\x20\\t\\r\\n\\f])' + a + '([\\x20\\t\\r\\n\\f]|$)' |
|
)), |
|
Y(a, function (a) { |
|
return c.test( |
|
('string' === typeof a.className && a.className) || |
|
(typeof a.getAttribute !== ha && a.getAttribute('class')) || |
|
'' |
|
); |
|
})) |
|
); |
|
}, |
|
ATTR: function (a, c, d) { |
|
return function (b) { |
|
b = f.attr(b, a); |
|
if (null == b) return '!=' === c; |
|
if (!c) return !0; |
|
b += ''; |
|
return '=' === c |
|
? b === d |
|
: '!=' === c |
|
? b !== d |
|
: '^=' === c |
|
? d && 0 === b.indexOf(d) |
|
: '*=' === c |
|
? d && -1 < b.indexOf(d) |
|
: '$=' === c |
|
? d && b.slice(-d.length) === d |
|
: '~=' === c |
|
? -1 < (' ' + b + ' ').indexOf(d) |
|
: '|=' === c |
|
? b === d || b.slice(0, d.length + 1) === d + '-' |
|
: !1; |
|
}; |
|
}, |
|
CHILD: function (a, c, b, e, g) { |
|
var d = 'nth' !== a.slice(0, 3), |
|
n = 'last' !== a.slice(-4), |
|
f = 'of-type' === c; |
|
return 1 === e && 0 === g |
|
? function (a) { |
|
return !!a.parentNode; |
|
} |
|
: function (c, b, h) { |
|
var l; |
|
b = d !== n ? 'nextSibling' : 'previousSibling'; |
|
var w = c.parentNode, |
|
m = f && c.nodeName.toLowerCase(); |
|
h = !h && !f; |
|
if (w) { |
|
if (d) { |
|
for (; b; ) { |
|
for (l = c; (l = l[b]); ) |
|
if ( |
|
f |
|
? l.nodeName.toLowerCase() === m |
|
: 1 === l.nodeType |
|
) |
|
return !1; |
|
var G = (b = 'only' === a && !G && 'nextSibling'); |
|
} |
|
return !0; |
|
} |
|
G = [n ? w.firstChild : w.lastChild]; |
|
if (n && h) { |
|
h = w[D] || (w[D] = {}); |
|
var k = h[a] || []; |
|
var r = k[0] === R && k[1]; |
|
var q = k[0] === R && k[2]; |
|
for ( |
|
l = r && w.childNodes[r]; |
|
(l = (++r && l && l[b]) || (q = r = 0) || G.pop()); |
|
|
|
) |
|
if (1 === l.nodeType && ++q && l === c) { |
|
h[a] = [R, r, q]; |
|
break; |
|
} |
|
} else if ( |
|
h && |
|
(k = (c[D] || (c[D] = {}))[a]) && |
|
k[0] === R |
|
) |
|
q = k[1]; |
|
else |
|
for ( |
|
; |
|
(l = (++r && l && l[b]) || (q = r = 0) || G.pop()) && |
|
((f |
|
? l.nodeName.toLowerCase() !== m |
|
: 1 !== l.nodeType) || |
|
!++q || |
|
(h && ((l[D] || (l[D] = {}))[a] = [R, q]), l !== c)); |
|
|
|
); |
|
q -= g; |
|
return q === e || (0 === q % e && 0 <= q / e); |
|
} |
|
}; |
|
}, |
|
PSEUDO: function (a, c) { |
|
var b = |
|
x.pseudos[a] || |
|
x.setFilters[a.toLowerCase()] || |
|
f.error('unsupported pseudo: ' + a); |
|
if (b[D]) return b(c); |
|
if (1 < b.length) { |
|
var e = [a, a, '', c]; |
|
return x.setFilters.hasOwnProperty(a.toLowerCase()) |
|
? p(function (a, d) { |
|
for (var e, g = b(a, c), n = g.length; n--; ) |
|
(e = Z.call(a, g[n])), (a[e] = !(d[e] = g[n])); |
|
}) |
|
: function (a) { |
|
return b(a, 0, e); |
|
}; |
|
} |
|
return b; |
|
}, |
|
}, |
|
pseudos: { |
|
not: p(function (a) { |
|
var b = [], |
|
d = [], |
|
e = Fa(a.replace(ma, '$1')); |
|
return e[D] |
|
? p(function (a, b, c, d) { |
|
d = e(a, null, d, []); |
|
for (var g = a.length; g--; ) |
|
if ((c = d[g])) a[g] = !(b[g] = c); |
|
}) |
|
: function (a, c, g) { |
|
b[0] = a; |
|
e(b, null, g, d); |
|
return !d.pop(); |
|
}; |
|
}), |
|
has: p(function (a) { |
|
return function (b) { |
|
return 0 < f(a, b).length; |
|
}; |
|
}), |
|
contains: p(function (a) { |
|
return function (b) { |
|
return -1 < (b.textContent || b.innerText || za(b)).indexOf(a); |
|
}; |
|
}), |
|
lang: p(function (a) { |
|
Ba.test(a || '') || f.error('unsupported lang: ' + a); |
|
a = a.replace(U, V).toLowerCase(); |
|
return function (b) { |
|
var c; |
|
do |
|
if ( |
|
(c = P |
|
? b.lang |
|
: b.getAttribute('xml:lang') || b.getAttribute('lang')) |
|
) |
|
return ( |
|
(c = c.toLowerCase()), c === a || 0 === c.indexOf(a + '-') |
|
); |
|
while ((b = b.parentNode) && 1 === b.nodeType); |
|
return !1; |
|
}; |
|
}), |
|
target: function (a) { |
|
var c = b.location && b.location.hash; |
|
return c && c.slice(1) === a.id; |
|
}, |
|
root: function (a) { |
|
return a === O; |
|
}, |
|
focus: function (a) { |
|
return ( |
|
a === C.activeElement && |
|
(!C.hasFocus || C.hasFocus()) && |
|
!!(a.type || a.href || ~a.tabIndex) |
|
); |
|
}, |
|
enabled: function (a) { |
|
return !1 === a.disabled; |
|
}, |
|
disabled: function (a) { |
|
return !0 === a.disabled; |
|
}, |
|
checked: function (a) { |
|
var b = a.nodeName.toLowerCase(); |
|
return ( |
|
('input' === b && !!a.checked) || ('option' === b && !!a.selected) |
|
); |
|
}, |
|
selected: function (a) { |
|
a.parentNode && a.parentNode.selectedIndex; |
|
return !0 === a.selected; |
|
}, |
|
empty: function (a) { |
|
for (a = a.firstChild; a; a = a.nextSibling) |
|
if ('@' < a.nodeName || 3 === a.nodeType || 4 === a.nodeType) |
|
return !1; |
|
return !0; |
|
}, |
|
parent: function (a) { |
|
return !x.pseudos.empty(a); |
|
}, |
|
header: function (a) { |
|
return Ka.test(a.nodeName); |
|
}, |
|
input: function (a) { |
|
return Da.test(a.nodeName); |
|
}, |
|
button: function (a) { |
|
var b = a.nodeName.toLowerCase(); |
|
return ('input' === b && 'button' === a.type) || 'button' === b; |
|
}, |
|
text: function (a) { |
|
var b; |
|
return ( |
|
'input' === a.nodeName.toLowerCase() && |
|
'text' === a.type && |
|
(null == (b = a.getAttribute('type')) || |
|
b.toLowerCase() === a.type) |
|
); |
|
}, |
|
first: J(function () { |
|
return [0]; |
|
}), |
|
last: J(function (a, b) { |
|
return [b - 1]; |
|
}), |
|
eq: J(function (a, b, d) { |
|
return [0 > d ? d + b : d]; |
|
}), |
|
even: J(function (a, b) { |
|
for (var c = 0; c < b; c += 2) a.push(c); |
|
return a; |
|
}), |
|
odd: J(function (a, b) { |
|
for (var c = 1; c < b; c += 2) a.push(c); |
|
return a; |
|
}), |
|
lt: J(function (a, b, d) { |
|
for (b = 0 > d ? d + b : d; 0 <= --b; ) a.push(b); |
|
return a; |
|
}), |
|
gt: J(function (a, b, d) { |
|
for (d = 0 > d ? d + b : d; ++d < b; ) a.push(d); |
|
return a; |
|
}), |
|
}, |
|
}); |
|
//# endregion |
|
|
|
|
|
|
|
for (t in { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) |
|
x.pseudos[t] = m(t); |
|
for (t in { submit: !0, reset: !0 }) x.pseudos[t] = N(t); |
|
var Fa = (f.compile = function (a, b) { |
|
var c, |
|
e = [], |
|
g = [], |
|
f = ba[a + ' ']; |
|
if (!f) { |
|
b || (b = n(a)); |
|
for (c = b.length; c--; ) |
|
(f = wa(b[c])), f[D] ? e.push(f) : g.push(f); |
|
f = ba(a, Ja(g, e)); |
|
} |
|
return f; |
|
}); |
|
x.pseudos.nth = x.pseudos.eq; |
|
Ga.prototype = x.filters = x.pseudos; |
|
x.setFilters = new Ga(); |
|
A.sortStable = D.split('').sort(qa).join('') === D; |
|
ca(); |
|
[0, 0].sort(qa); |
|
A.detectDuplicates = fa; |
|
fontLoadData.find = f; |
|
fontLoadData.getText = f.getText; |
|
fontLoadData.initAction = !0; |
|
})(global); |
|
|
|
var Font = function (fontName, fontAlias, fontSelectors, fontEnglish, fontWeight) { |
|
this.fontName = fontName; |
|
this.fontAlias = fontAlias || []; |
|
this.fontSelectors = fontSelectors || []; |
|
this.fontEnglish = fontEnglish || []; |
|
this.fontWeight = fontWeight; |
|
this.fontUrl = []; |
|
this.flag = {}; |
|
this.chars = []; |
|
this.string = ''; |
|
}; |
|
Font.prototype = { |
|
constructor: Font, |
|
toString: function () { |
|
return null !== this.string |
|
? this.string |
|
: (this.string = this.chars.join('')); |
|
}, |
|
flush: function () { |
|
this.fontUrl = []; |
|
this.flag = {}; |
|
this.chars = []; |
|
this.fontEnglish = []; |
|
this.string = ''; |
|
}, |
|
fontAliasRegex: function () { |
|
var b = this.fontAlias.join('|'); |
|
return b ? new RegExp(b, '') : null; |
|
}, |
|
getFontSelectors: function () { |
|
return this.fontSelectors; |
|
}, |
|
getFontAlias: function () { |
|
return this.fontAlias; |
|
}, |
|
getFontEnglish: function () { |
|
return this.fontEnglish; |
|
}, |
|
getFontWeight: function () { |
|
return this.fontWeight ? this.fontWeight : null; |
|
}, |
|
getFontUrl: function (b) { |
|
var fontUrls = [], |
|
f = this.fontUrl.length; |
|
b = !0 !== b && null !== b ? !1 : b; |
|
for (var h = 0; h < f; h += 1) |
|
(null !== b && this.fontUrl[h].loaded !== b) || |
|
fontUrls.push({ |
|
name: this.fontName, |
|
index: h, |
|
url: this.fontUrl[h].url, |
|
loaded: this.fontUrl[h].loaded, |
|
}); |
|
return fontUrls; |
|
}, |
|
setFontUrlLoaded: function (b) { |
|
b in this.fontUrl && this.fontUrl[b] && (this.fontUrl[b].loaded = !0); |
|
}, |
|
updateAliasFont: function () { |
|
var b = document.getElementsByTagName('*'), |
|
e = b.length, |
|
f = this.fontAliasRegex(), |
|
h; |
|
if (f) |
|
for (var p = 0; p < e; p += 1) |
|
(h = getFontFamily(b[p])) && f.test(h) && this.uniqueChars(fontLoadData.getText(b[p])); |
|
}, |
|
updateSelectorsFont: function () { |
|
var selectorsString = this.fontSelectors.join(', '); |
|
(selectorsString = selectorsString ? fontLoadData.find(selectorsString, document) : []) && this.uniqueChars(fontLoadData.getText(selectorsString)); |
|
}, |
|
addSelectors: function (selectors) { |
|
if (0 <= selectors.indexOf(',')) { |
|
selectors = selectors.split(','); |
|
var selectorLength = selectors.length; |
|
for (var f = 0; f < selectorLength; f += 1) this.fontSelectors.push(trim(selectors[f])); |
|
} else this.fontSelectors.push(trim(selectors)); |
|
}, |
|
addAlias: function (b) { |
|
this.fontAlias && this.fontAlias.pop(); |
|
this.fontAlias.push(b); |
|
}, |
|
addEnglish: function (b) { |
|
this.fontEnglish.push('"' + b + '"'); |
|
}, |
|
addWeight: function (b) { |
|
this.fontWeight = b; |
|
}, |
|
addFontUrl: function (b) { |
|
this.fontUrl.push({ url: b, loaded: !1 }); |
|
}, |
|
uniqueChars: function (chars) { |
|
var e = ''; |
|
var match = chars.match(aToZRegex); |
|
for (var h in match) match.hasOwnProperty(h) && (e += match[h].toUpperCase()); |
|
chars = (chars + e).replace(unicodeChar, ''); |
|
chars = chars.replace(spaceRegex, '').split(''); |
|
match = chars.length; |
|
e = !1; |
|
for (h = 0; h < match; h += 1) |
|
chars[h] in this.flag || |
|
((e = !0), (this.flag[chars[h]] = !0), this.chars.push(chars[h])); |
|
e && (this.string = null); |
|
}, |
|
}; |
|
var bodyHasCurrentStyle = true, |
|
spaceRegex = /^[\s]+|[\s]+| |\u3000+/gi, |
|
unicodeChar = /[\uD800-\uDBFF][\uDC00-\uDFFF]+/gi, |
|
emptyOrSpaceRegex = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, |
|
aToZRegex = /[A-Za-z]+/gi, |
|
trimFn = ''.trim, |
|
trim = |
|
trimFn && !trimFn.call('\ufeff\u00a0') |
|
? function (b) { |
|
return null == b ? '' : trimFn.call(b); |
|
} |
|
: function (b) { |
|
return null == b ? '' : (b + '').replace(emptyOrSpaceRegex, ''); |
|
}, |
|
getFontFamily = function (b) { |
|
return b |
|
? (b = bodyHasCurrentStyle ? b.currentStyle : global.getComputedStyle(b, null)) |
|
? b.fontFamily || '' |
|
: '' |
|
: ''; |
|
}; |
|
|
|
global._jf = JFCore = (function (b) { |
|
var fontStore = {}, |
|
events = { |
|
Preload: Promise(), |
|
Reload: Promise(), |
|
DomReady: Promise(), |
|
SettingsLoaded: Promise(), |
|
Actived: Promise(), |
|
Inactived: Promise(), |
|
}, |
|
h = { |
|
p: function (b) { |
|
fontLoadData.p = b; |
|
}, |
|
initAction: function (action) { |
|
fontLoadData.initAction = action; |
|
}, |
|
_setFont: function (name, attribute, selectors) { |
|
fontStore[name] = fontStore[name] || new Font(name); |
|
switch (attribute) { |
|
case 'css': |
|
fontStore[name].addSelectors(selectors); |
|
break; |
|
case 'alias': |
|
fontStore[name].addAlias(selectors); |
|
break; |
|
case 'english': |
|
fontStore[name].addEnglish(selectors); |
|
break; |
|
case 'weight': |
|
fontStore[name].addWeight(selectors); |
|
} |
|
}, |
|
_event: function (eventName, callback) { |
|
eventName && events[eventName] && events[eventName].done(callback); |
|
}, |
|
}, |
|
|
|
processHTMLTextToFontCharacters = function () { |
|
var allTags = document.getElementsByTagName('*'), |
|
tagsLength = allTags.length, |
|
h, |
|
fontAliasRegex, |
|
allNonInputTags = /^(?:input|textarea)$/i, |
|
fontRegexStore = {}; |
|
bodyHasCurrentStyle = !!document.body.currentStyle; |
|
for (var fontName in fontStore) { |
|
fontStore.hasOwnProperty(fontName) && |
|
(fontAliasRegex = fontStore[fontName].fontAliasRegex()) && |
|
(fontRegexStore[fontName] = fontAliasRegex); |
|
|
|
} |
|
for (var i = 0; i < tagsLength; i += 1) |
|
if (1 == allTags[i].nodeType && (h = getFontFamily(allTags[i]))) |
|
for (fontName in fontRegexStore) |
|
fontRegexStore.hasOwnProperty(fontName) && |
|
fontRegexStore[fontName].test(h) && |
|
(allNonInputTags.test(allTags[i].nodeName) |
|
? fontStore[fontName].uniqueChars(allTags[i].value) |
|
: fontStore[fontName].uniqueChars(fontLoadData.getText(allTags[i]))); |
|
}, |
|
|
|
updateAllSelectorsFontInFontStore = function () { |
|
for (var fontName in fontStore) { |
|
fontStore.hasOwnProperty(fontName) && fontStore[fontName].updateSelectorsFont(); |
|
} |
|
}, |
|
|
|
getFontUrlsByLoadingState = function (loaded) { |
|
var allFontUrls = [], |
|
n; |
|
for (n in fontStore) |
|
if (fontStore.hasOwnProperty(n)) { |
|
var fontUrls = fontStore[n].getFontUrl(loaded); |
|
for (var h in fontUrls) allFontUrls.push(fontUrls[h]); |
|
} |
|
return allFontUrls; |
|
}, |
|
|
|
resolveEvent = function (eventName) { |
|
eventName && events[eventName] && events[eventName].resolve(); |
|
}, |
|
|
|
fetchFontData = function () { |
|
var payload = [], |
|
f = '', |
|
h = 0, |
|
g; |
|
for (g in fontStore) |
|
fontStore.hasOwnProperty(g) && |
|
(fontString = fontStore[g].toString()) && |
|
((h += fontString.length), |
|
(f += '&' + fontLoadData.promise.encode({ fn: g, fs: fontString }))); |
|
|
|
if ('' == f) return global.jfgetData({ err: { code: 1109 } }); |
|
|
|
payload.o = fontLoadData.origin; |
|
payload.p = fontLoadData.p; |
|
payload.t = fontLoadData.t; |
|
|
|
!(X && 10 > Y) && 300 < h |
|
? ((fontLoadData.promise.ajaxTimeout = 1e4), |
|
fontLoadData.promise |
|
.post( |
|
'//go.justfont.com/jfont/api?' + fontLoadData.promise.encode(payload), |
|
f.substr(1) |
|
) |
|
.then(function (b, e) { |
|
if (b || J(e)) return resolveEvent('Inactived'), !1; |
|
global.jfgetData(global.JSON.parse(e)); |
|
return !0; |
|
})) |
|
: ((payload.callback = 'jfgetData'), |
|
fontLoadData.addScript( |
|
'//go.justfont.com/jfont/api?' + fontLoadData.promise.encode(payload) + f, |
|
null, |
|
!0, |
|
1e4, |
|
null, |
|
function () { |
|
resolveEvent('Inactived'); |
|
} |
|
)); |
|
}, |
|
|
|
K = function (b, e) { |
|
var f = fontLoadData.promise.get(b); |
|
f.then(function (b, f) { |
|
if (b) return !1; |
|
e(); |
|
return !0; |
|
}); |
|
return f; |
|
}, |
|
|
|
M = function (b) { |
|
if ('true' == b.enable) { |
|
var e = { |
|
position: 'fixed', |
|
zIndex: '2000000000', |
|
right: '0px', |
|
bottom: '0px', |
|
cursor: 'pointer', |
|
borderWidth: '0px', |
|
borderStyle: 'initial', |
|
borderColor: 'initial', |
|
borderImage: 'initial', |
|
content: 'none', |
|
display: 'inline', |
|
float: 'none', |
|
height: '32px', |
|
left: 'auto', |
|
margin: '0px', |
|
maxHeight: '32px', |
|
maxWidth: '83px', |
|
minHeight: '32px', |
|
minWidth: '83px', |
|
orphans: '2', |
|
outlineStyle: 'none', |
|
outlineWidth: 'initial', |
|
outlineColor: 'initial', |
|
overflowX: 'visible', |
|
overflowY: 'visible', |
|
padding: '0px', |
|
pageBreakAfter: 'auto', |
|
pageBreakBefore: 'auto', |
|
pageBreakInside: 'auto', |
|
tableLayout: 'auto', |
|
textIndent: '0px', |
|
top: 'auto', |
|
unicodeBidi: 'normal', |
|
verticalAlign: 'baseline', |
|
visibility: 'visible', |
|
widows: '2', |
|
width: '83px', |
|
}; |
|
var f = document.createElement('img'); |
|
f.width = 83; |
|
f.height = 32; |
|
f.src = b.pic; |
|
f.title = 'Information about the fonts used on this site'; |
|
f.alt = 'Fonts by justfont'; |
|
f.id = 'justfont-badge'; |
|
for (var g in e) |
|
e.hasOwnProperty(g) && f.style[g] !== da && (f.style[g] = e[g]); |
|
f.onclick = function () { |
|
global.open(b.link, 'Continue_to_Application'); |
|
return !1; |
|
}; |
|
document.body.appendChild(f); |
|
} |
|
}, |
|
m = function () { |
|
for (var b = getFontUrlsByLoadingState(!1), e = b.length, f = [], g = 0; g < e; g += 1) |
|
'object' == typeof b[g] && f.push(S(b[g])); |
|
fontLoadData.promise.join(f).then(function (b) { |
|
for (var e = !0, g = b.length, f = 0; f < g; f += 1) |
|
b[f] || (e = !1); |
|
e ? resolveEvent('Actived') : resolveEvent('Inactived'); |
|
}); |
|
}, |
|
S = function (b) { |
|
return K(b.url, function () { |
|
fontStore[b.name] && fontStore[b.name].setFontUrlLoaded(b.index); |
|
}); |
|
}, |
|
J = function (b) { |
|
var e = {}.hasOwnProperty; |
|
if (null == b) return !0; |
|
if (b.length && 0 < b.length) return !1; |
|
if (0 === b.length) return !0; |
|
for (var f in b) if (e.call(b, f)) return !1; |
|
return !0; |
|
}; |
|
(function (b) { |
|
var e = b.length, |
|
f, |
|
g; |
|
if (b.constructor === Array) |
|
for (var n = 0; n < e; n++) |
|
n in b && |
|
(f = b[n]) && |
|
f.constructor === Array && |
|
(g = f.splice(0, 1)) && |
|
g[0] && |
|
((g = g[0]), |
|
h[g] |
|
? h[g].apply(null, f) |
|
: 0 == g.indexOf('_event') && |
|
(f.splice(0, 0, g.substr(6)), h._event.apply(null, f))); |
|
})(b); |
|
resolveEvent('Preload'); |
|
|
|
global.jfgetData = function (data) { |
|
var f = !0; |
|
resolveEvent('SettingsLoaded'); |
|
for (var h in data) |
|
if (data.hasOwnProperty(h)) { |
|
var g = data[h]; |
|
switch (h) { |
|
case 'b': |
|
M(g); |
|
break; |
|
case 'fn': |
|
if ('object' != typeof g) f = !1; |
|
else { |
|
var n = data.fu; |
|
if (n.length != g.length) f = !1; |
|
else { |
|
var k = g; |
|
var p = n; |
|
g = []; |
|
n = []; |
|
for ( |
|
var y = 'justfont-styleSheet' + new Date().getTime(), |
|
v = 0; |
|
v < k.length; |
|
v++ |
|
) { |
|
var t = k[v]; |
|
var u = fontStore[t]; |
|
var F = p[v]; |
|
1 == sa && |
|
(F = p[v] |
|
.replace('//cdn-go.justfont.com', '//go.justfont.com') |
|
.replace('//go.justfont.com', '//go.justfont.com')); |
|
u.addFontUrl(F); |
|
var B = |
|
'eot' == supportFontFormat |
|
? 'url(' + F + ')' |
|
: 'ttf' == supportFontFormat |
|
? 'url(' + F + ') format("truetype")' |
|
: 'url(' + F + ') format("woff")'; |
|
F = u.getFontAlias(); |
|
J(F) && (F = [t]); |
|
for (t = 0; t < F.length; t += 1) |
|
u.getFontWeight() |
|
? g.push([ |
|
'@font-face', |
|
'{ font-family: "' + |
|
F[t] + |
|
'";font-weight: ' + |
|
u.getFontWeight() + |
|
';src: ' + |
|
B + |
|
';}', |
|
]) |
|
: g.push([ |
|
'@font-face', |
|
'{ font-family: "' + F[t] + '";src: ' + B + ';}', |
|
]); |
|
var C = u.getFontSelectors() || []; |
|
B = []; |
|
for (t = 0; t < C.length; t += 1) |
|
B.push('.jf-active ' + C[t]); |
|
C = u.getFontEnglish() || []; |
|
for (t = 0; t < F.length; t += 1) |
|
C.push('"' + F[t] + '"'), |
|
g.push([ |
|
B.join(', '), |
|
' { font-family: ' + |
|
C.join(', ') + |
|
'; font-weight: ' + |
|
u.getFontWeight() + |
|
';}', |
|
]), |
|
C.pop(); |
|
} |
|
ba || |
|
N || |
|
((N = document.createElement('style')), |
|
(N.title = y), |
|
document.getElementsByTagName('head')[0].appendChild(N), |
|
global.createPopup || N.appendChild(document.createTextNode(''))); |
|
k = g.length; |
|
u = ba || null === N.sheet; |
|
for (t = 0; t < k; t += 1) |
|
if (!u) |
|
if (N.sheet.insertRule) |
|
try { |
|
N.sheet.insertRule( |
|
g[t][0] + g[t][1], |
|
N.sheet.cssRules.length |
|
); |
|
} catch (O) {} |
|
else |
|
try { |
|
N.sheet.addRule(g[t][0], g[t][1]); |
|
} catch (O) {} |
|
if (u) { |
|
k = document.createDocumentFragment(); |
|
g = k.appendChild(document.createElement('div')); |
|
g.innerHTML = |
|
"X<div><style type='text/css'></style></div>"; |
|
g = g.lastChild; |
|
u = n; |
|
p = g.childNodes; |
|
y = p.length; |
|
v = u.length; |
|
t = 0; |
|
if ('number' === typeof y) |
|
for (; t < y; t++) u[v++] = p[t]; |
|
else for (; p[t] !== da; ) u[v++] = p[t++]; |
|
for (u.length = v; g.firstChild; ) |
|
g.removeChild(g.firstChild); |
|
(g = k.lastChild) && k.removeChild(g); |
|
k.appendChild(n[0]); |
|
document.getElementsByTagName('head')[0].appendChild(k); |
|
} |
|
m(); |
|
} |
|
} |
|
break; |
|
case 'err': |
|
f = !1; |
|
} |
|
} |
|
f || resolveEvent('Inactived'); |
|
}; |
|
|
|
fontLoadData.DomReady(function () { |
|
fontLoadData.initAction && (resolveEvent('DomReady'), processHTMLTextToFontCharacters(), updateAllSelectorsFontInFontStore(), fetchFontData()); |
|
}); |
|
|
|
return { |
|
push: function (b) { |
|
(method = Array.prototype.splice.call(b, 0, 1)) && |
|
method[0] && |
|
((method = method[0]), |
|
method.indexOf && |
|
0 == method.indexOf('_event') && |
|
(Array.prototype.splice.call(b, 0, 0, method.substr(6)), |
|
h._event.apply(null, b)), |
|
method.indexOf && |
|
0 == method.indexOf('_setFont') && |
|
h._setFont.apply(null, b)); |
|
}, |
|
flush: function () { |
|
resolveEvent('Reload'); |
|
for (var b in fontStore) fontStore.hasOwnProperty(b) && fontStore[b].flush(); |
|
processHTMLTextToFontCharacters(); |
|
updateAllSelectorsFontInFontStore(); |
|
fetchFontData(); |
|
}, |
|
}; |
|
})(JFCore); |
|
} |
|
})(this, this.document); |