//v1.8.3 2019/03/19 11:20
|
|
! function(e, t, i) {
|
"undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ?
|
define(i) : t.Fingerprint = i()
|
}(0, this, function() {
|
"use strict";
|
var e = function(e) {
|
var t, i;
|
t = Array.prototype.forEach, i = Array.prototype.map, this.each = function(e, i, n) {
|
if (null !== e)
|
if (t && e.forEach === t) e.forEach(i, n);
|
else if (e.length === +e.length) {
|
for (var o = 0, r = e.length; o < r; o++)
|
if (i.call(n, e[o], o, e) === {}) return
|
} else
|
for (var a in e)
|
if (e.hasOwnProperty(a) && i.call(n, e[a], a, e) === {}) return
|
}, this.map = function(e, t, n) {
|
var o = [];
|
return null == e ? o : i && e.map === i ? e.map(t, n) : (this.each(e, function(e, i, r) {
|
o[o.length] = t.call(n, e, i, r)
|
}), o)
|
}, "object" == typeof e ? (this.hasher = e.hasher, this.screen_resolution = e.screen_resolution, this.screen_orientation =
|
e.screen_orientation, this.canvas = e.canvas, this.ie_activex = e.ie_activex) : "function" == typeof e && (this.hasher =
|
e)
|
};
|
return e.prototype = {
|
get: function() {
|
var e = [];
|
if (e.push(navigator.userAgent), e.push(navigator.language), e.push(screen.colorDepth), this.screen_resolution) {
|
var t = this.getScreenResolution();
|
void 0 !== t && e.push(t.join("x"))
|
}
|
return e.push((new Date).getTimezoneOffset()), e.push(this.hasSessionStorage()), e.push(this.hasLocalStorage()),
|
e.push(this.hasIndexDb()), document.body ? e.push(typeof document.body.addBehavior) : e.push("undefined"), e.push(
|
typeof window.openDatabase), e.push(navigator.cpuClass), e.push(navigator.platform), e.push(navigator.doNotTrack),
|
e.push(this.getPluginsString()), this.canvas && this.isCanvasSupported() && e.push(this.getCanvasFingerprint()),
|
this.hasher ? this.hasher(e.join("###"), 31) : this.murmurhash3_32_gc(e.join("###"), 31)
|
},
|
murmurhash3_32_gc: function(e, t) {
|
var i, n, o, r, a, s, c, d;
|
for (i = 3 & e.length, n = e.length - i, o = t, a = 3432918353, s = 461845907, d = 0; d < n;) c = 255 & e.charCodeAt(
|
d) | (255 & e.charCodeAt(++d)) << 8 | (255 & e.charCodeAt(++d)) << 16 | (255 & e.charCodeAt(++d)) << 24, ++d, o =
|
27492 + (65535 & (r = 5 * (65535 & (o = (o ^= c = (65535 & (c = (c = (65535 & c) * a + (((c >>> 16) * a & 65535) <<
|
16) & 4294967295) << 15 | c >>> 17)) * s + (((c >>> 16) * s & 65535) << 16) & 4294967295) << 13 | o >>> 19)) +
|
((5 * (o >>> 16) & 65535) << 16) & 4294967295)) + ((58964 + (r >>> 16) & 65535) << 16);
|
switch (c = 0, i) {
|
case 3:
|
c ^= (255 & e.charCodeAt(d + 2)) << 16;
|
case 2:
|
c ^= (255 & e.charCodeAt(d + 1)) << 8;
|
case 1:
|
o ^= c = (65535 & (c = (c = (65535 & (c ^= 255 & e.charCodeAt(d))) * a + (((c >>> 16) * a & 65535) << 16) &
|
4294967295) << 15 | c >>> 17)) * s + (((c >>> 16) * s & 65535) << 16) & 4294967295
|
}
|
return o ^= e.length, o = 2246822507 * (65535 & (o ^= o >>> 16)) + ((2246822507 * (o >>> 16) & 65535) << 16) &
|
4294967295, o = 3266489909 * (65535 & (o ^= o >>> 13)) + ((3266489909 * (o >>> 16) & 65535) << 16) & 4294967295,
|
(o ^= o >>> 16) >>> 0
|
},
|
hasLocalStorage: function() {
|
try {
|
return !!window.localStorage
|
} catch (e) {
|
return !0
|
}
|
},
|
hasSessionStorage: function() {
|
try {
|
return !!window.sessionStorage
|
} catch (e) {
|
return !0
|
}
|
},
|
hasIndexDb: function() {
|
try {
|
return !!window.indexedDB
|
} catch (e) {
|
return !0
|
}
|
},
|
isCanvasSupported: function() {
|
var e = document.createElement("canvas");
|
return !(!e.getContext || !e.getContext("2d"))
|
},
|
isIE: function() {
|
return "Microsoft Internet Explorer" === navigator.appName || !("Netscape" !== navigator.appName || !/Trident/.test(
|
navigator.userAgent))
|
},
|
getPluginsString: function() {
|
return this.isIE() && this.ie_activex ? this.getIEPluginsString() : this.getRegularPluginsString()
|
},
|
getRegularPluginsString: function() {
|
return this.map(navigator.plugins, function(e) {
|
var t = this.map(e, function(e) {
|
return [e.type, e.suffixes].join("~")
|
}).join(",");
|
return [e.name, e.description, t].join("::")
|
}, this).join(";")
|
},
|
getIEPluginsString: function() {
|
return window.ActiveXObject ? this.map(["ShockwaveFlash.ShockwaveFlash", "AcroPDF.PDF", "PDF.PdfCtrl",
|
"QuickTime.QuickTime", "rmocx.RealPlayer G2 Control", "rmocx.RealPlayer G2 Control.1",
|
"RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)", "RealVideo.RealVideo(tm) ActiveX Control (32-bit)",
|
"RealPlayer", "SWCtl.SWCtl", "WMPlayer.OCX", "AgControl.AgControl", "Skype.Detection"
|
], function(e) {
|
try {
|
return new ActiveXObject(e), e
|
} catch (e) {
|
return null
|
}
|
}).join(";") : ""
|
},
|
getScreenResolution: function() {
|
return this.screen_orientation ? screen.height > screen.width ? [screen.height, screen.width] : [screen.width,
|
screen.height
|
] : [screen.height, screen.width]
|
},
|
getCanvasFingerprint: function() {
|
var e = document.createElement("canvas"),
|
t = e.getContext("2d"),
|
i = "http://valve.github.io";
|
return t.textBaseline = "top", t.font = "14px 'Arial'", t.textBaseline = "alphabetic", t.fillStyle = "#f60", t.fillRect(
|
125, 1, 62, 20), t.fillStyle = "#069", t.fillText(i, 2, 15), t.fillStyle = "rgba(102, 204, 0, 0.7)", t.fillText(
|
i, 4, 17), e.toDataURL()
|
}
|
}, e
|
}),
|
function(e) {
|
if ("object" == typeof exports) module.exports = e();
|
else if ("function" == typeof define && define.amd) define(e);
|
else {
|
var t;
|
try {
|
t = window
|
} catch (e) {
|
t = self
|
}
|
t.SparkMD5 = e()
|
}
|
}(function(e) {
|
"use strict";
|
var t = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
|
|
function i(e, t) {
|
var i = e[0],
|
n = e[1],
|
o = e[2],
|
r = e[3];
|
n = ((n += ((o = ((o += ((r = ((r += ((i = ((i += (n & o | ~n & r) + t[0] - 680876936 | 0) << 7 | i >>> 25) + n | 0) &
|
n | ~i & o) + t[1] - 389564586 | 0) << 12 | r >>> 20) + i | 0) & i | ~r & n) + t[2] + 606105819 | 0) << 17 |
|
o >>> 15) + r | 0) & r | ~o & i) + t[3] - 1044525330 | 0) << 22 | n >>> 10) + o | 0, n = ((n += ((o = ((o += ((r =
|
((r += ((i = ((i += (n & o | ~n & r) + t[4] - 176418897 | 0) << 7 | i >>> 25) + n | 0) & n | ~i & o) + t[5] +
|
1200080426 | 0) << 12 | r >>> 20) + i | 0) & i | ~r & n) + t[6] - 1473231341 | 0) << 17 | o >>> 15) + r | 0) &
|
r | ~o & i) + t[7] - 45705983 | 0) << 22 | n >>> 10) + o | 0, n = ((n += ((o = ((o += ((r = ((r += ((i = ((i += (n &
|
o | ~n & r) + t[8] + 1770035416 | 0) << 7 | i >>> 25) + n | 0) & n | ~i & o) + t[9] - 1958414417 | 0) <<
|
12 | r >>> 20) + i | 0) & i | ~r & n) + t[10] - 42063 | 0) << 17 | o >>> 15) + r | 0) & r | ~o & i) + t[11] -
|
1990404162 | 0) << 22 | n >>> 10) + o | 0, n = ((n += ((o = ((o += ((r = ((r += ((i = ((i += (n & o | ~n & r) + t[
|
12] + 1804603682 | 0) << 7 | i >>> 25) + n | 0) & n | ~i & o) + t[13] - 40341101 | 0) << 12 | r >>> 20) +
|
i | 0) & i | ~r & n) + t[14] - 1502002290 | 0) << 17 | o >>> 15) + r | 0) & r | ~o & i) + t[15] + 1236535329 | 0) <<
|
22 | n >>> 10) + o | 0, n = ((n += ((o = ((o += ((r = ((r += ((i = ((i += (n & r | o & ~r) + t[1] - 165796510 | 0) <<
|
5 | i >>> 27) + n | 0) & o | n & ~o) + t[6] - 1069501632 | 0) << 9 | r >>> 23) + i | 0) & n | i & ~n) + t[11] +
|
643717713 | 0) << 14 | o >>> 18) + r | 0) & i | r & ~i) + t[0] - 373897302 | 0) << 20 | n >>> 12) + o | 0, n = ((n +=
|
((o = ((o += ((r = ((r += ((i = ((i += (n & r | o & ~r) + t[5] - 701558691 | 0) << 5 | i >>> 27) + n | 0) & o | n &
|
~o) + t[10] + 38016083 | 0) << 9 | r >>> 23) + i | 0) & n | i & ~n) + t[15] - 660478335 | 0) << 14 | o >>> 18) +
|
r | 0) & i | r & ~i) + t[4] - 405537848 | 0) << 20 | n >>> 12) + o | 0, n = ((n += ((o = ((o += ((r = ((r += ((i =
|
((i += (n & r | o & ~r) + t[9] + 568446438 | 0) << 5 | i >>> 27) + n | 0) & o | n & ~o) + t[14] -
|
1019803690 | 0) << 9 | r >>> 23) + i | 0) & n | i & ~n) + t[3] - 187363961 | 0) << 14 | o >>> 18) + r | 0) & i |
|
r & ~i) + t[8] + 1163531501 | 0) << 20 | n >>> 12) + o | 0, n = ((n += ((o = ((o += ((r = ((r += ((i = ((i += (n &
|
r | o & ~r) + t[13] - 1444681467 | 0) << 5 | i >>> 27) + n | 0) & o | n & ~o) + t[2] - 51403784 | 0) << 9 |
|
r >>> 23) + i | 0) & n | i & ~n) + t[7] + 1735328473 | 0) << 14 | o >>> 18) + r | 0) & i | r & ~i) + t[12] -
|
1926607734 | 0) << 20 | n >>> 12) + o | 0, n = ((n += ((o = ((o += ((r = ((r += ((i = ((i += (n ^ o ^ r) + t[5] -
|
378558 | 0) << 4 | i >>> 28) + n | 0) ^ n ^ o) + t[8] - 2022574463 | 0) << 11 | r >>> 21) + i | 0) ^ i ^ n) +
|
t[11] + 1839030562 | 0) << 16 | o >>> 16) + r | 0) ^ r ^ i) + t[14] - 35309556 | 0) << 23 | n >>> 9) + o | 0, n =
|
((n += ((o = ((o += ((r = ((r += ((i = ((i += (n ^ o ^ r) + t[1] - 1530992060 | 0) << 4 | i >>> 28) + n | 0) ^ n ^
|
o) + t[4] + 1272893353 | 0) << 11 | r >>> 21) + i | 0) ^ i ^ n) + t[7] - 155497632 | 0) << 16 | o >>> 16) + r |
|
0) ^ r ^ i) + t[10] - 1094730640 | 0) << 23 | n >>> 9) + o | 0, n = ((n += ((o = ((o += ((r = ((r += ((i = ((i +=
|
(n ^ o ^ r) + t[13] + 681279174 | 0) << 4 | i >>> 28) + n | 0) ^ n ^ o) + t[0] - 358537222 | 0) << 11 | r >>>
|
21) + i | 0) ^ i ^ n) + t[3] - 722521979 | 0) << 16 | o >>> 16) + r | 0) ^ r ^ i) + t[6] + 76029189 | 0) << 23 |
|
n >>> 9) + o | 0, n = ((n += ((o = ((o += ((r = ((r += ((i = ((i += (n ^ o ^ r) + t[9] - 640364487 | 0) << 4 | i >>>
|
28) + n | 0) ^ n ^ o) + t[12] - 421815835 | 0) << 11 | r >>> 21) + i | 0) ^ i ^ n) + t[15] + 530742520 | 0) <<
|
16 | o >>> 16) + r | 0) ^ r ^ i) + t[2] - 995338651 | 0) << 23 | n >>> 9) + o | 0, n = ((n += ((r = ((r += (n ^ ((
|
i = ((i += (o ^ (n | ~r)) + t[0] - 198630844 | 0) << 6 | i >>> 26) + n | 0) | ~o)) + t[7] + 1126891415 | 0) <<
|
10 | r >>> 22) + i | 0) ^ ((o = ((o += (i ^ (r | ~n)) + t[14] - 1416354905 | 0) << 15 | o >>> 17) + r | 0) | ~i)) +
|
t[5] - 57434055 | 0) << 21 | n >>> 11) + o | 0, n = ((n += ((r = ((r += (n ^ ((i = ((i += (o ^ (n | ~r)) + t[12] +
|
1700485571 | 0) << 6 | i >>> 26) + n | 0) | ~o)) + t[3] - 1894986606 | 0) << 10 | r >>> 22) + i | 0) ^ ((o = ((
|
o += (i ^ (r | ~n)) + t[10] - 1051523 | 0) << 15 | o >>> 17) + r | 0) | ~i)) + t[1] - 2054922799 | 0) << 21 | n >>>
|
11) + o | 0, n = ((n += ((r = ((r += (n ^ ((i = ((i += (o ^ (n | ~r)) + t[8] + 1873313359 | 0) << 6 | i >>> 26) +
|
n | 0) | ~o)) + t[15] - 30611744 | 0) << 10 | r >>> 22) + i | 0) ^ ((o = ((o += (i ^ (r | ~n)) + t[6] -
|
1560198380 | 0) << 15 | o >>> 17) + r | 0) | ~i)) + t[13] + 1309151649 | 0) << 21 | n >>> 11) + o | 0, n = ((n +=
|
((r = ((r += (n ^ ((i = ((i += (o ^ (n | ~r)) + t[4] - 145523070 | 0) << 6 | i >>> 26) + n | 0) | ~o)) + t[11] -
|
1120210379 | 0) << 10 | r >>> 22) + i | 0) ^ ((o = ((o += (i ^ (r | ~n)) + t[2] + 718787259 | 0) << 15 | o >>>
|
17) + r | 0) | ~i)) + t[9] - 343485551 | 0) << 21 | n >>> 11) + o | 0, e[0] = i + e[0] | 0, e[1] = n + e[1] | 0,
|
e[2] = o + e[2] | 0, e[3] = r + e[3] | 0
|
}
|
|
function n(e) {
|
var t, i = [];
|
for (t = 0; t < 64; t += 4) i[t >> 2] = e.charCodeAt(t) + (e.charCodeAt(t + 1) << 8) + (e.charCodeAt(t + 2) << 16) +
|
(e.charCodeAt(t + 3) << 24);
|
return i
|
}
|
|
function o(e) {
|
var t, i = [];
|
for (t = 0; t < 64; t += 4) i[t >> 2] = e[t] + (e[t + 1] << 8) + (e[t + 2] << 16) + (e[t + 3] << 24);
|
return i
|
}
|
|
function r(e) {
|
var t, o, r, a, s, c, d = e.length,
|
l = [1732584193, -271733879, -1732584194, 271733878];
|
for (t = 64; t <= d; t += 64) i(l, n(e.substring(t - 64, t)));
|
for (o = (e = e.substring(t - 64)).length, r = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], t = 0; t < o; t +=
|
1) r[t >> 2] |= e.charCodeAt(t) << (t % 4 << 3);
|
if (r[t >> 2] |= 128 << (t % 4 << 3), t > 55)
|
for (i(l, r), t = 0; t < 16; t += 1) r[t] = 0;
|
return a = (a = 8 * d).toString(16).match(/(.*?)(.{0,8})$/), s = parseInt(a[2], 16), c = parseInt(a[1], 16) || 0, r[
|
14] = s, r[15] = c, i(l, r), l
|
}
|
|
function a(e) {
|
var i, n = "";
|
for (i = 0; i < 4; i += 1) n += t[e >> 8 * i + 4 & 15] + t[e >> 8 * i & 15];
|
return n
|
}
|
|
function s(e) {
|
var t;
|
for (t = 0; t < e.length; t += 1) e[t] = a(e[t]);
|
return e.join("")
|
}
|
|
function c(e) {
|
return /[\u0080-\uFFFF]/.test(e) && (e = unescape(encodeURIComponent(e))), e
|
}
|
|
function d(e) {
|
var t, i = [],
|
n = e.length;
|
for (t = 0; t < n - 1; t += 2) i.push(parseInt(e.substr(t, 2), 16));
|
return String.fromCharCode.apply(String, i)
|
}
|
|
function l() {
|
this.reset()
|
}
|
return "5d41402abc4b2a76b9719d911017c592" !== s(r("hello")) && function(e, t) {
|
var i = (65535 & e) + (65535 & t);
|
return (e >> 16) + (t >> 16) + (i >> 16) << 16 | 65535 & i
|
}, "undefined" == typeof ArrayBuffer || ArrayBuffer.prototype.slice || function() {
|
function t(e, t) {
|
return (e = 0 | e || 0) < 0 ? Math.max(e + t, 0) : Math.min(e, t)
|
}
|
ArrayBuffer.prototype.slice = function(i, n) {
|
var o, r, a, s, c = this.byteLength,
|
d = t(i, c),
|
l = c;
|
return n !== e && (l = t(n, c)), d > l ? new ArrayBuffer(0) : (o = l - d, r = new ArrayBuffer(o), a = new Uint8Array(
|
r), s = new Uint8Array(this, d, o), a.set(s), r)
|
}
|
}(), l.prototype.append = function(e) {
|
return this.appendBinary(c(e)), this
|
}, l.prototype.appendBinary = function(e) {
|
this._buff += e, this._length += e.length;
|
var t, o = this._buff.length;
|
for (t = 64; t <= o; t += 64) i(this._hash, n(this._buff.substring(t - 64, t)));
|
return this._buff = this._buff.substring(t - 64), this
|
}, l.prototype.end = function(e) {
|
var t, i, n = this._buff,
|
o = n.length,
|
r = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
for (t = 0; t < o; t += 1) r[t >> 2] |= n.charCodeAt(t) << (t % 4 << 3);
|
return this._finish(r, o), i = s(this._hash), e && (i = d(i)), this.reset(), i
|
}, l.prototype.reset = function() {
|
return this._buff = "", this._length = 0, this._hash = [1732584193, -271733879, -1732584194, 271733878], this
|
}, l.prototype.getState = function() {
|
return {
|
buff: this._buff,
|
length: this._length,
|
hash: this._hash
|
}
|
}, l.prototype.setState = function(e) {
|
return this._buff = e.buff, this._length = e.length, this._hash = e.hash, this
|
}, l.prototype.destroy = function() {
|
delete this._hash, delete this._buff, delete this._length
|
}, l.prototype._finish = function(e, t) {
|
var n, o, r, a = t;
|
if (e[a >> 2] |= 128 << (a % 4 << 3), a > 55)
|
for (i(this._hash, e), a = 0; a < 16; a += 1) e[a] = 0;
|
n = (n = 8 * this._length).toString(16).match(/(.*?)(.{0,8})$/), o = parseInt(n[2], 16), r = parseInt(n[1], 16) ||
|
0, e[14] = o, e[15] = r, i(this._hash, e)
|
}, l.hash = function(e, t) {
|
return l.hashBinary(c(e), t)
|
}, l.hashBinary = function(e, t) {
|
var i = s(r(e));
|
return t ? d(i) : i
|
}, l.ArrayBuffer = function() {
|
this.reset()
|
}, l.ArrayBuffer.prototype.append = function(e) {
|
var t, n, r, a, s, c = (n = this._buff.buffer, r = e, a = !0, (s = new Uint8Array(n.byteLength + r.byteLength)).set(
|
new Uint8Array(n)), s.set(new Uint8Array(r), n.byteLength), a ? s : s.buffer),
|
d = c.length;
|
for (this._length += e.byteLength, t = 64; t <= d; t += 64) i(this._hash, o(c.subarray(t - 64, t)));
|
return this._buff = t - 64 < d ? new Uint8Array(c.buffer.slice(t - 64)) : new Uint8Array(0), this
|
}, l.ArrayBuffer.prototype.end = function(e) {
|
var t, i, n = this._buff,
|
o = n.length,
|
r = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
for (t = 0; t < o; t += 1) r[t >> 2] |= n[t] << (t % 4 << 3);
|
return this._finish(r, o), i = s(this._hash), e && (i = d(i)), this.reset(), i
|
}, l.ArrayBuffer.prototype.reset = function() {
|
return this._buff = new Uint8Array(0), this._length = 0, this._hash = [1732584193, -271733879, -1732584194,
|
271733878
|
], this
|
}, l.ArrayBuffer.prototype.getState = function() {
|
var e, t = l.prototype.getState.call(this);
|
return t.buff = (e = t.buff, String.fromCharCode.apply(null, new Uint8Array(e))), t
|
}, l.ArrayBuffer.prototype.setState = function(e) {
|
return e.buff = function(e, t) {
|
var i, n = e.length,
|
o = new ArrayBuffer(n),
|
r = new Uint8Array(o);
|
for (i = 0; i < n; i += 1) r[i] = e.charCodeAt(i);
|
return t ? r : o
|
}(e.buff, !0), l.prototype.setState.call(this, e)
|
}, l.ArrayBuffer.prototype.destroy = l.prototype.destroy, l.ArrayBuffer.prototype._finish = l.prototype._finish, l.ArrayBuffer
|
.hash = function(e, t) {
|
var n = s(function(e) {
|
var t, n, r, a, s, c, d = e.length,
|
l = [1732584193, -271733879, -1732584194, 271733878];
|
for (t = 64; t <= d; t += 64) i(l, o(e.subarray(t - 64, t)));
|
for (n = (e = t - 64 < d ? e.subarray(t - 64) : new Uint8Array(0)).length, r = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0
|
], t = 0; t < n; t += 1) r[t >> 2] |= e[t] << (t % 4 << 3);
|
if (r[t >> 2] |= 128 << (t % 4 << 3), t > 55)
|
for (i(l, r), t = 0; t < 16; t += 1) r[t] = 0;
|
return a = (a = 8 * d).toString(16).match(/(.*?)(.{0,8})$/), s = parseInt(a[2], 16), c = parseInt(a[1], 16) || 0,
|
r[14] = s, r[15] = c, i(l, r), l
|
}(new Uint8Array(e)));
|
return t ? d(n) : n
|
}, l
|
});
|
var doui = {
|
winW: 0,
|
winH: 0,
|
winWrem: 0,
|
winHrem: 0,
|
windowReady: function(e) {
|
if (document.addEventListener) try {
|
document.addEventListener("DOMContentLoaded", function() {
|
document.removeEventListener("DOMContentLoaded", arguments.callee, !1), e && e()
|
}, !1)
|
} catch (e) {
|
doui.showToast({
|
content: "doui.windowReady():失败"
|
})
|
} else if (document.attachEvent) try {
|
document.attachEvent("onreadystatechange", function() {
|
"complete" == document.readyState && (document.detachEvent("onreadystatechange", arguments.callee), e && e())
|
})
|
} catch (e) {
|
doui.showToast({
|
content: "doui.windowReady():失败"
|
})
|
}
|
},
|
metaAdd: function() {
|
var e = document.getElementsByTagName("head")[0],
|
t = e.childNodes[0],
|
i = document.createElement("meta");
|
i.name = "format-detection", i.content = "telephone=no", e.insertBefore(i, t)
|
},
|
importOver: !0,
|
importLoad: function(e) {
|
if (void 0 === e && (e = new Object), void 0 === e.importArray && (e.importArray = new Array), void 0 === e.success &&
|
(e.success = function() {}), void 0 === e.fail && (e.fail = function() {}), e.importArray.length <= 0) doui.importOver = !
|
0, e.success();
|
else {
|
doui.importOver = !1;
|
var t = document.getElementsByTagName("head")[0],
|
i = new RegExp(".css$"),
|
n = new RegExp(".js$"),
|
o = 0,
|
r = 0;
|
|
function a() {
|
o >= e.importArray.length && (doui.importOver = !0, r >= e.importArray.length ? e.success() : e.fail())
|
}
|
for (var s = 0; s < e.importArray.length; s++)
|
if (i.test(e.importArray[s])) {
|
var c = document.createElement("link");
|
c.type = "text/css", c.rel = "stylesheet", c.href = e.importArray[s], t.appendChild(c), c.onerror = function() {
|
o++, alert("引入失败:" + c.href), a(), c.onerror = null
|
}, c.onload = c.onreadystatechange = function() {
|
o++, r++, a()
|
}
|
} else if (n.test(e.importArray[s])) {
|
(d = document.createElement("script")).type = "text/javascript", d.src = e.importArray[s], t.appendChild(d), d.onerror =
|
function() {
|
o++, alert("引入失败:" + d.src), a(), d.onerror = null
|
}, d.onload = d.onreadystatechange = function() {
|
o++, r++, a()
|
}
|
} else {
|
var d;
|
(d = document.createElement("script")).src = e.importArray[s], t.appendChild(d), d.onerror = function() {
|
o++, alert("引入失败:" + d.src), a(), d.onerror = null
|
}, d.onload = d.onreadystatechange = function() {
|
o++, r++, a()
|
}
|
}
|
}
|
},
|
douiCss: null,
|
sizeReady: !1,
|
sizeSet: function() {
|
if (null == doui.douiCss) {
|
for (var e = null, t = document.styleSheets, i = new RegExp("doui"), n = 0; n < t.length; n++)
|
if (i.test(t[n].href)) {
|
e = t[n];
|
break
|
} if (null == e || void 0 === e.cssRules || e.cssRules.length <= 0) return doui.sizeReady = !1, null != doui.threadReady &&
|
clearInterval(doui.threadReady), alert("doui.css读取失败,请本地引入"), !1;
|
doui.douiCss = e
|
}
|
try {
|
var o = window.innerWidth,
|
r = window.innerHeight;
|
doui.winW = o, doui.winH = r
|
} catch (e) {
|
return doui.sizeReady = !1, alert("屏幕可用大小获取失败"), !1
|
}
|
var a = parseFloat(750 * doui.winH / doui.winW),
|
s = 100 * parseFloat(doui.winW / 750);
|
doui.winWrem = 7.5, doui.winHrem = a / 100;
|
n = 0;
|
for (var c = doui.douiCss.cssRules; n < c.length; n++)
|
if ("html" == c[n].selectorText) c[n].style.fontSize = s + "px", c[n].style.width = doui.winW + "px", c[n].style.height =
|
doui.winH + "px";
|
else if ("body" == c[n].selectorText) c[n].style.width = doui.winW + "px", c[n].style.minHeight = doui.winH + "px";
|
else if (".winSizeBox" == c[n].selectorText) c[n].style.width = doui.winW + "px", c[n].style.height = doui.winH +
|
"px";
|
else if (".heightenBox" == c[n].selectorText) c[n].style.width = doui.winW + "px", c[n].style.minHeight = doui.winH +
|
"px";
|
else if (".layer-transparent" == c[n].selectorText) c[n].style.width = doui.winW + "px", c[n].style.height = doui.winH +
|
"px";
|
else if (".layer-dark" == c[n].selectorText) c[n].style.width = doui.winW + "px", c[n].style.height = doui.winH +
|
"px";
|
else if (".layer-light" == c[n].selectorText) c[n].style.width = doui.winW + "px", c[n].style.height = doui.winH +
|
"px";
|
else if (".main" == c[n].selectorText) {
|
c[n].style.minHeight = doui.winH + "px";
|
break
|
}
|
doui.sizeReady = !0
|
},
|
threadReady: null,
|
onReady: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.success && (e.success = function() {}), void 0 === e.fail && (e.fail =
|
function() {});
|
var t = (new Date).getTime();
|
null != doui.threadReady && clearInterval(doui.threadReady), doui.threadReady = setInterval(function() {
|
var i = (new Date).getTime();
|
console.log("interval: doui的onReady监控"), i - t >= 3e5 ? (clearInterval(doui.threadReady), alert("doui初始化超时"), e.fail()) :
|
1 == doui.importOver && 1 == doui.sizeReady && (clearInterval(doui.threadReady), e.success())
|
}, 300)
|
},
|
systemInfo: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.success && (e.success = function() {}), void 0 === e.fail && (e.fail =
|
function() {});
|
var t = {
|
fingerprint: "",
|
city: "",
|
IPv4: "",
|
IPv6: "",
|
platform: "PC",
|
version: "0",
|
browserName: "",
|
browserVersion: "0",
|
inWX: !1,
|
cookieEnabled: !0,
|
windowWidth: 0,
|
windowHeight: 0,
|
windowWidthRem: 0,
|
windowHeightRem: 0,
|
msg: []
|
};
|
try {
|
var i = (new Fingerprint).get();
|
t.fingerprint = i
|
} catch (e) {
|
t.msg.push("生成唯一标识失败")
|
}
|
var n = navigator.userAgent,
|
o = navigator.userAgent.toLowerCase();
|
if (n.indexOf("Android") > -1 || n.indexOf("Linux") > -1) t.platform = "Android";
|
else if (n.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) t.platform = "IOS";
|
else
|
for (var r = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"], a = 0; a < r.length; a++)
|
if (n.indexOf(r[a]) > 0) {
|
t.platform = "PC";
|
break
|
} try {
|
"Android" == t.platform ? t.version = o.match(/android ([\d.]+)/)[1] : "IOS" == t.platform ? t.version = o.match(
|
/version\/([\d.]+)/)[1] : "PC" == t.platform && (t.version = navigator.platform)
|
} catch (e) {
|
t.msg.push("获取平台version版本失败")
|
}
|
n.indexOf("OPR") > -1 || n.indexOf("Opera") > -1 ? t.browserName = "Opera" : n.indexOf("Firefox") > -1 ? t.browserName =
|
"FireFox" : n.indexOf("Chrome") > -1 ? t.browserName = "Chrome" : n.indexOf("Safari") > -1 ? t.browserName =
|
"Safari" : (o.indexOf("msie") > -1 || n.indexOf("rv") > -1) && (t.browserName = "IE");
|
try {
|
"Opera" == t.browserName ? t.browserVersion = o.match(/opera.([\d.]+)/)[1] : "FireFox" == t.browserName ? t.browserVersion =
|
o.match(/firefox\/([\d.]+)/)[1] : "Chrome" == t.browserName ? t.browserVersion = o.match(/chrome\/([\d.]+)/)[1] :
|
"Safari" == t.browserName ? t.browserVersion = o.match(/safari\/([\d.]+)/)[1] : "IE" == t.browserName && (t.browserVersion =
|
o.match(/msie ([\d.]+)/)[1])
|
} catch (e) {
|
t.msg.push("获取本浏览器版本号失败")
|
}
|
"micromessenger" == o.match(/MicroMessenger/i) ? t.inWX = !0 : t.inWX = !1, t.cookieEnabled = navigator.cookieEnabled,
|
t.windowWidth = doui.winW, t.windowHeight = doui.winH, t.windowWidthRem = doui.winWrem, t.windowHeightRem = doui.winHrem;
|
try {
|
! function(e) {
|
var t = {},
|
i = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection,
|
n = !!window.webkitRTCPeerConnection;
|
if (!i) {
|
var o = document.createElement("iframe");
|
o.style.display = "none", o.sandbox = "allow-same-origin", o.addEventListener("DOMNodeInserted", function(e) {
|
e.stopPropagation()
|
}, !1), o.addEventListener("DOMNodeInsertedIntoDocument", function(e) {
|
e.stopPropagation()
|
}, !1), document.body.appendChild(o);
|
var r = o.contentWindow;
|
i = r.RTCPeerConnection || r.mozRTCPeerConnection || r.webkitRTCPeerConnection, n = !!r.webkitRTCPeerConnection
|
}
|
var a = void 0;
|
n && (a = {
|
iceServers: [{
|
urls: "stun:stun.services.mozilla.com"
|
}]
|
});
|
var s = new i(a, {
|
optional: [{
|
RtpDataChannels: !0
|
}]
|
});
|
|
function c(i) {
|
var n = /([0-9]{1,3}(\.[0-9]{1,3}){3})/.exec(i)[1];
|
void 0 === t[n] && e(n), t[n] = !0
|
}
|
s.onicecandidate = function(e) {
|
e.candidate && c(e.candidate.candidate)
|
}, s.createDataChannel(""), s.createOffer(function(e) {
|
s.setLocalDescription(e, function() {}, function() {})
|
}, function() {}), setTimeout(function() {
|
s.localDescription.sdp.split("\n").forEach(function(e) {
|
0 === e.indexOf("a=candidate:") && c(e)
|
})
|
}, 1e3)
|
}(function(i) {
|
i.match(/^(192\.168\.|169\.254\.|10\.|172\.(1[6-9]|2\d|3[01]))/) && (t.IPv4 = i);
|
try {
|
var n = document.createElement("script");
|
n.type = "text/javascript", n.src = "http://pv.sohu.com/cityjson?ie=utf-8", document.getElementsByTagName(
|
"head")[0].appendChild(n), n.onload = function(i) {
|
t.city = returnCitySN.cname, t.IPv6 = returnCitySN.cip, n.parentNode.removeChild(n), t.msg.length > 0 && e.fail(
|
t.msg), e.success(t)
|
}
|
} catch (i) {
|
t.msg.push("获取外网IP地址失败"), t.msg.length > 0 && e.fail(t.msg), e.success(t)
|
}
|
})
|
} catch (e) {
|
t.msg.push("获取内网IP地址失败")
|
}
|
},
|
urlParam: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.success && (e.success = function() {}), void 0 === e.fail && (e.fail =
|
function() {});
|
var t = window.location.search,
|
i = new Object,
|
n = !1;
|
if (-1 != t.indexOf("?")) {
|
var o = t.slice(t.indexOf("?") + 1).split("&");
|
o.length > 0 && (n = !0);
|
for (var r = 0; r < o.length; r++) {
|
var a = o[r].indexOf("="),
|
s = o[r].substring(0, a),
|
c = decodeURIComponent(o[r].slice(a + 1));
|
i[s] = c
|
}
|
}
|
1 == n ? e.success(i) : (i.msg = "未传递任何值", e.fail(i))
|
},
|
domBy: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.el && (e.el = ""), void 0 === e.success && (e.success = function() {}),
|
void 0 === e.fail && (e.fail = function() {});
|
var t = new Array;
|
if (-1 != e.el.indexOf("#")) {
|
var i = e.el.slice(e.el.indexOf("#") + 1);
|
(o = document.getElementById(i)) && t.push(o)
|
} else if (-1 != e.el.indexOf(".")) {
|
i = e.el.slice(e.el.indexOf(".") + 1);
|
if ((o = document.getElementsByClassName(i)) && o.length > 0)
|
for (var n = 0; n < o.length; n++) t.push(o[n])
|
} else {
|
var o;
|
if ((o = document.getElementsByTagName(e.el)) && o.length > 0)
|
for (n = 0; n < o.length; n++) t.push(o[n])
|
}
|
t.length > 0 ? e.success(t) : (console.log("未找到dom元素:'" + e.el + "'"), e.fail())
|
},
|
domShow: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.el && (e.el = ""), void 0 === e.type ? e.type = 1 : e.type =
|
parseInt(e.type), void 0 === e.animat && (e.animat = !0), void 0 === e.success && (e.success = function() {}),
|
void 0 === e.fail && (e.fail = function() {});
|
var t = [{
|
className: "animt_opacity_0_1",
|
time: 300
|
}, {
|
className: "animt_scale_o5_1",
|
time: 300
|
}, {
|
className: "animt_translateY_70_0",
|
time: 300
|
}],
|
i = e.type - 1;
|
doui.domBy({
|
el: e.el,
|
success: function(n) {
|
for (var o = 0, r = n; o < r.length; o++) {
|
var a = r[o];
|
if ("true" == a.getAttribute("do-animt-work")) console.log("doui.domShow():'" + e.el + "'的dom正在动画工作"), e.fail();
|
else {
|
var s = a.getAttribute("class").split(" "),
|
c = !1,
|
d = !1;
|
if (s.indexOf("displayNone") >= 0 && (c = !0), s.indexOf(t[i].className) >= 0 && (d = !0), 0 == c) console.log(
|
"doui.domShow():'" + e.el + "'的dom已经显示"), e.success();
|
else if (0 == e.animat) {
|
for (var l = 0; l < s.length; l++) "displayNone" == s[l] && (s.splice(l, 1), l--);
|
a.setAttribute("class", s.join(" ")), e.success()
|
} else if (1 == e.animat) {
|
0 == d && s.push(t[i].className), a.setAttribute("class", s.join(" "));
|
for (l = 0; l < s.length; l++) "displayNone" == s[l] && (s.splice(l, 1), l--);
|
a.setAttribute("class", s.join(" ")), a.setAttribute("do-animt-work", "true"), setTimeout(function() {
|
if (a) {
|
for (var n = a.getAttribute("class").split(" "), o = 0; o < n.length; o++) n[o] == t[i].className && (n
|
.splice(o, 1), o--);
|
a.setAttribute("class", n.join(" ")), a.removeAttribute("do-animt-work"), e.success()
|
}
|
}, t[i].time)
|
}
|
}
|
}
|
}
|
})
|
},
|
domHide: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.el && (e.el = ""), void 0 === e.type ? e.type = 1 : e.type =
|
parseInt(e.type), void 0 === e.animat && (e.animat = !0), void 0 === e.success && (e.success = function() {}),
|
void 0 === e.fail && (e.fail = function() {});
|
var t = [{
|
className: "animt_opacity_1_0",
|
time: 300
|
}, {
|
className: "animt_scale_1_o5",
|
time: 300
|
}, {
|
className: "animt_translateY_0_70",
|
time: 300
|
}],
|
i = e.type - 1;
|
doui.domBy({
|
el: e.el,
|
success: function(n) {
|
for (var o = 0, r = n; o < r.length; o++) {
|
var a = r[o];
|
if ("true" == a.getAttribute("do-animt-work")) console.log("doui.domHide():'" + e.el + "'的dom正在动画工作"), e.fail();
|
else {
|
var s = a.getAttribute("class").split(" "),
|
c = !1,
|
d = !1;
|
s.indexOf("displayNone") >= 0 && (c = !0), s.indexOf(t[i].className) >= 0 && (d = !0), 1 == c ? (console.log(
|
"doui.domHide():'" + e.el + "'的dom已经隐藏"), e.success()) : 0 == e.animat ? (s.push("displayNone"), a.setAttribute(
|
"class", s.join(" ")), e.success()) : 1 == e.animat && (a.setAttribute("do-animt-work", "true"), 0 == d &&
|
s.push(t[i].className), a.setAttribute("class", s.join(" ")), setTimeout(function() {
|
if (a) {
|
var n = a.getAttribute("class").split(" "),
|
o = !1;
|
n.indexOf("displayNone") >= 0 && (o = !0);
|
for (var r = 0; r < n.length; r++) n[r] == t[i].className && (n.splice(r, 1), r--);
|
0 == o && n.push("displayNone"), a.setAttribute("class", n.join(" ")), a.removeAttribute(
|
"do-animt-work"), e.success()
|
}
|
}, t[i].time))
|
}
|
}
|
}
|
})
|
},
|
threadToast: null,
|
showToast: function(e) {
|
if (void 0 === e && (e = new Object), "object" != typeof e) {
|
var t = e;
|
(e = new Object).content = t
|
}
|
void 0 === e.content && (e.content = "亲,我很迷茫啊……"), void 0 === e.duration ? e.duration = 2e3 : e.duration = parseInt(
|
e.duration), void 0 === e.mask && (e.mask = !1), void 0 === e.success && (e.success = function() {}), void 0 ===
|
e.fail && (e.fail = function() {});
|
var i = document.getElementById("zdo_toast_mask");
|
i && i.parentNode.removeChild(i);
|
var n = document.getElementById("zdo_toast");
|
n && n.parentNode.removeChild(n), null != doui.threadToast && clearTimeout(doui.threadToast);
|
var o = "0.26rem",
|
r = "3.7rem",
|
a = "1.5rem",
|
s = "1.9rem",
|
c = "0.33rem";
|
doui.winW >= doui.winH && doui.winW > 768 && (o = "15px", r = doui.winHrem / 4 + "rem", a = doui.winHrem / 6 +
|
"rem", s = (doui.winWrem - doui.winHrem / 4) / 2 + "rem", c = doui.winHrem / 40 + "rem");
|
(u = document.createElement("div")).innerHTML = '<div id="zdo_toast_mask" class="layer-transparent"></div>';
|
var d = u.childNodes[0],
|
l = "zdo_toast";
|
doui.strRandom({
|
length: 6,
|
success: function(e) {
|
l += e
|
}
|
});
|
var u, f = "";
|
f += '<div id="zdo_toast" class="' + l + ' fboxRow Xcenter Ycenter displayNone" style="width:' + r +
|
"; height:auto; bottom:" + a + "; left:" + s + ';">', f +=
|
'<div class="font-white font-ell2" style="max-width:80%; font-size:' + o + "; margin-top:" + c +
|
"; margin-bottom:" + c + '; line-height:1.5; text-align:center;">' + e.content + "</div>", f += "</div>", (u =
|
document.createElement("div")).innerHTML = f;
|
var h = u.childNodes[0],
|
m = document.getElementsByTagName("body")[0];
|
1 == e.mask && m.appendChild(d), m.appendChild(h), doui.domShow({
|
el: "." + l,
|
type: 3,
|
fail: function() {
|
e.fail()
|
},
|
success: function() {
|
doui.threadToast = setTimeout(function() {
|
doui.domHide({
|
el: "." + l,
|
type: 3,
|
success: function() {
|
doui.domBy({
|
el: "." + l,
|
success: function(e) {
|
for (var t = 0, i = e; t < i.length; t++) {
|
var n = i[t];
|
n.parentNode.removeChild(n)
|
}
|
}
|
})
|
}
|
})
|
}, e.duration), e.success()
|
}
|
})
|
},
|
showLoading: function(e) {
|
if (void 0 === e && (e = new Object), "object" != typeof e) {
|
var t = e;
|
(e = new Object).content = t
|
}
|
void 0 === e.content && (e.content = ""), void 0 === e.type ? e.type = 1 : e.type = parseInt(e.type), void 0 === e.mask &&
|
(e.mask = !1), void 0 === e.success && (e.success = function() {}), void 0 === e.fail && (e.fail = function() {});
|
var i = document.getElementById("zdo_loading_mask");
|
i && i.parentNode.removeChild(i);
|
var n = "0.26rem",
|
o = "1.8rem",
|
r = "1.2rem",
|
a = "0.07rem",
|
s = (doui.winHrem - 1.2) / 2 + "rem",
|
c = "2.85rem";
|
doui.winW >= doui.winH && doui.winW > 768 && (n = "15px", o = doui.winHrem / 8 + "rem", r = doui.winHrem / 9 +
|
"rem", a = "6px", s = (doui.winHrem - doui.winHrem / 9) / 2 + "rem", c = (doui.winWrem - doui.winHrem / 8) / 2 +
|
"rem");
|
(d = document.createElement("div")).innerHTML = '<div id="zdo_loading_mask" class="layer-transparent"></div>';
|
var d, l = d.childNodes[0],
|
u = "";
|
1 == e.type && (u += '<div id="zdo_loading" class="fboxCol Xstart Ycenter" style="width:' + o +
|
"; height:auto; top:" + s + "; left:" + c + ';">', u += '<div class="zdo_loading_arcOut" style="width:' + r +
|
"; height:" + r + ';">', u += '<div class="zdo_loading_arcBg" style="width:' + r + "; height:" + r +
|
"; border-width:" + a + ';"></div>', u +=
|
'<div class="zdo_loading_arcAnimt animt_rotate_0_360_infinite" style="width:' + r + "; height:" + r +
|
"; border-width:" + a + ';"></div>', u += "</div>", u +=
|
'<div id="zdo_loadcont" class="font-white font-ell2" style="width:' + o + "; font-size:" + n +
|
'; margin-top:10px; line-height:1.5; text-align:center; text-shadow:0 0 5px black;">' + e.content + "</div>", u +=
|
"</div>"), (d = document.createElement("div")).innerHTML = u;
|
var f = d.childNodes[0],
|
h = document.getElementsByTagName("body")[0];
|
1 == e.mask && h.appendChild(l), document.getElementById("zdo_loading") ? (document.getElementById("zdo_loadcont").innerHTML =
|
e.content, e.success()) : (h.appendChild(f), e.success())
|
},
|
hideLoading: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.success && (e.success = function() {}), void 0 === e.fail && (e.fail =
|
function() {});
|
var t = document.getElementById("zdo_loading");
|
t ? (t.parentNode.removeChild(t), e.success()) : (console.log("doui.hideLoading():当前没有loading框dom"), e.fail())
|
},
|
showModal: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.title && (e.title = ""), void 0 === e.content && (e.content =
|
"亲,我很迷茫啊……"), void 0 === e.showCancel && (e.showCancel = !0), void 0 === e.cancelText && (e.cancelText = "取消"),
|
void 0 === e.cancelColor && (e.cancelColor = "#585858"), void 0 === e.confirmText && (e.confirmText = "确定"), void 0 ===
|
e.confirmColor && (e.confirmColor = "#2DB42A"), void 0 === e.success && (e.success = function() {}), void 0 === e.fail &&
|
(e.fail = function() {});
|
var t = document.getElementById("zdo_modal_mask");
|
t && t.parentNode.removeChild(t);
|
var i = "4.3rem",
|
n = "0.4rem",
|
o = "0.30rem",
|
r = "0.26rem",
|
a = "0.8rem",
|
s = "0.27rem";
|
doui.winW >= doui.winH && doui.winW > 768 && (i = doui.winHrem / 3 + "rem", n = doui.winHrem / 30 + "rem", o =
|
"19px", r = "16px", a = doui.winHrem / 17 + "rem", s = "18px");
|
var c = "";
|
c += '<div id="zdo_modal_mask" class="layer-dark fboxRow Xcenter Ycenter displayNone">', c +=
|
'<div id="zdo_modal" class="fboxCol Xcenter Ycenter displayNone" style="width:' + i + "; height:auto; max-height:" +
|
doui.winH + 'px;">', e.title.length > 0 && (c +=
|
'<div class="font-black font-weight" style="max-width:80%; font-size:' + o + "; margin-top:" + n +
|
'; line-height:1.5; text-align:center;">' + e.title + "</div>"), c +=
|
'<div class="font-black" style="max-width:80%; font-size:' + r + "; margin-top:" + n + "; margin-bottom:" + n +
|
'; line-height:1.5; text-align:center;">' + e.content + "</div>", c +=
|
'<div class="fboxRow" style="width:100%; height:' + a + '; border-top:1px solid #CCC">', 1 == e.showCancel && (c +=
|
'<div class="flex1 fboxRow Xcenter Ycenter click-color zdo_modaldan1">', c +=
|
'<div class="cursor-default" style="font-size:' + s + "; color:" + e.cancelColor + ';">' + e.cancelText +
|
"</div>", c += "</div>", c += '<div style="width:1px; height:100%; background-color:#CCC;"></div>'), c +=
|
'<div class="flex1 fboxRow Xcenter Ycenter click-color zdo_modaldan2">', c +=
|
'<div class="cursor-default" style="font-size:' + s + "; color:" + e.confirmColor + ';">' + e.confirmText +
|
"</div>", c += "</div>", c += "</div>", c += "</div>", c += "</div>";
|
var d = document.createElement("div");
|
d.innerHTML = c;
|
var l = d.childNodes[0];
|
document.getElementsByTagName("body")[0].appendChild(l), doui.domShow({
|
el: "#zdo_modal_mask",
|
type: 1
|
}), doui.domShow({
|
el: "#zdo_modal",
|
type: 2,
|
success: function() {
|
var t = document.getElementsByClassName("zdo_modaldan1")[0];
|
t && (t.onclick = function() {
|
doui.domHide({
|
el: "#zdo_modal_mask",
|
type: 1
|
}), doui.domHide({
|
el: "#zdo_modal",
|
type: 2,
|
success: function() {
|
var t = document.getElementById("zdo_modal_mask");
|
t && t.parentNode.removeChild(t), e.success({
|
cancel: !0,
|
confirm: !1
|
})
|
}
|
})
|
});
|
var i = document.getElementsByClassName("zdo_modaldan2")[0];
|
i && (i.onclick = function() {
|
doui.domHide({
|
el: "#zdo_modal_mask",
|
type: 1
|
}), doui.domHide({
|
el: "#zdo_modal",
|
type: 2,
|
success: function() {
|
var t = document.getElementById("zdo_modal_mask");
|
t && t.parentNode.removeChild(t), e.success({
|
cancel: !1,
|
confirm: !0
|
})
|
}
|
})
|
})
|
}
|
})
|
},
|
showMore: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.el && (e.el = ".loading-more"), void 0 === e.content && (e.content =
|
""), void 0 === e.type ? e.type = 1 : e.type = parseInt(e.type), void 0 === e.greenChannel && (e.greenChannel = !
|
1), void 0 === e.success && (e.success = function() {}), void 0 === e.fail && (e.fail = function() {});
|
var t = "0.26rem",
|
i = "0.2rem";
|
doui.winW >= doui.winH && doui.winW > 768 && (t = "15px", i = "10px");
|
var n = "";
|
1 == e.type ? (n += '<div class="fboxRow Xcenter Ycenter">', n +=
|
'<div style="width:24px; height:24px; position:relative;">', n +=
|
'<div class="zdo_loadingMore_xian animt_opacity_o2_1_o2_infinite"></div>', n +=
|
'<div class="zdo_loadingMore_xian animt_opacity_o2_1_o2_infinite"></div>', n +=
|
'<div class="zdo_loadingMore_xian animt_opacity_o2_1_o2_infinite"></div>', n +=
|
'<div class="zdo_loadingMore_xian animt_opacity_o2_1_o2_infinite"></div>', n +=
|
'<div class="zdo_loadingMore_xian animt_opacity_o2_1_o2_infinite"></div>', n +=
|
'<div class="zdo_loadingMore_xian animt_opacity_o2_1_o2_infinite"></div>', n +=
|
'<div class="zdo_loadingMore_xian animt_opacity_o2_1_o2_infinite"></div>', n +=
|
'<div class="zdo_loadingMore_xian animt_opacity_o2_1_o2_infinite"></div>', n += "</div>", e.content.length > 0 &&
|
(n += '<div class="font-gray" style="margin-left:' + i + "; font-size:" + t + ';">' + e.content + "</div>"), n +=
|
"</div>") : 2 == e.type && (n += '<div class="fboxRow Xcenter Ystart">', n +=
|
'<div class="zdo_loadingMore_dian animt_opacity_o2_1_o2_infinite" style="-webkit-animation-delay:0s; animation-delay:0s;"></div>',
|
n +=
|
'<div class="zdo_loadingMore_dian animt_opacity_o2_1_o2_infinite" style="-webkit-animation-delay:0.1s; animation-delay:0.1s;"></div>',
|
n +=
|
'<div class="zdo_loadingMore_dian animt_opacity_o2_1_o2_infinite" style="-webkit-animation-delay:0.2s; animation-delay:0.2s;"></div>',
|
n +=
|
'<div class="zdo_loadingMore_dian animt_opacity_o2_1_o2_infinite" style="-webkit-animation-delay:0.3s; animation-delay:0.3s;"></div>',
|
n +=
|
'<div class="zdo_loadingMore_dian animt_opacity_o2_1_o2_infinite" style="-webkit-animation-delay:0.4s; animation-delay:0.4s;"></div>',
|
n += "</div>"), doui.domBy({
|
el: e.el,
|
fail: function() {
|
doui.showToast({
|
content: "未放入'.loading-more'组件"
|
}), e.fail()
|
},
|
success: function(t) {
|
for (var i = 0, o = t; i < o.length; i++) {
|
var r = o[i];
|
1 == e.greenChannel || r.childNodes.length <= 0 ? (r.innerHTML = n, e.success()) : e.fail(
|
"'.loading-more'组件正在工作")
|
}
|
}
|
})
|
},
|
hideMore: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.el && (e.el = ".loading-more"), void 0 === e.content && (e.content =
|
""), void 0 === e.success && (e.success = function() {}), void 0 === e.fail && (e.fail = function() {});
|
var t = "0.26rem";
|
doui.winW >= doui.winH && doui.winW > 768 && (t = "15px");
|
var i = '<div class="fboxRow Xcenter Ystart font-ell1 font-gray" style="font-size:' + t + ';">' + e.content +
|
"</div>";
|
doui.domBy({
|
el: e.el,
|
fail: function() {
|
doui.showToast({
|
content: "未放入'.loading-more'组件"
|
}), e.fail()
|
},
|
success: function(t) {
|
for (var n = 0, o = t; n < o.length; n++) {
|
var r = o[n];
|
r.innerHTML = "", e.content.length > 0 && (r.innerHTML = i), e.success()
|
}
|
}
|
})
|
},
|
scrolling: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.el && (e.el = ""), void 0 === e.reachRight && (e.reachRight =
|
function() {}), void 0 === e.reachBottom && (e.reachBottom = function() {}), void 0 === e.success && (e.success =
|
function() {}), void 0 === e.fail && (e.fail = function() {}), "html" == e.el || "body" == e.el || "window" == e.el ?
|
document.body.onscroll = document.documentElement.onscroll = function() {
|
var t = {
|
scrollHeight: document.documentElement.scrollHeight || document.body.scrollHeight,
|
viewHeight: document.documentElement.clientHeight || document.body.clientHeight,
|
scrollTop: document.documentElement.scrollTop || document.body.scrollTop,
|
scrollWidth: document.documentElement.scrollWidth || document.body.scrollWidth,
|
viewWidth: document.documentElement.clientWidth || document.body.clientWidth,
|
scrollLeft: document.documentElement.scrollLeft || document.body.scrollLeft
|
};
|
t.scrollLeft > 0 && t.viewWidth + t.scrollLeft >= t.scrollWidth && e.reachRight(t), t.scrollTop > 0 && t.viewHeight +
|
t.scrollTop >= t.scrollHeight && e.reachBottom(t), e.success(t)
|
} : doui.domBy({
|
el: e.el,
|
success: function(t) {
|
for (var i = 0, n = t; i < n.length; i++) {
|
var o = n[i];
|
o.onscroll = function() {
|
var t = {
|
scrollHeight: o.scrollHeight,
|
viewHeight: o.clientHeight,
|
scrollTop: o.scrollTop,
|
scrollWidth: o.scrollWidth,
|
viewWidth: o.clientWidth,
|
scrollLeft: o.scrollLeft
|
};
|
t.scrollLeft > 0 && t.viewWidth + t.scrollLeft >= t.scrollWidth && e.reachRight(t), t.scrollTop > 0 && t.viewHeight +
|
t.scrollTop >= t.scrollHeight && e.reachBottom(t), e.success(t)
|
}
|
}
|
}
|
})
|
},
|
scrollTo: function(e) {
|
if (void 0 === e && (e = new Object), void 0 === e.el && (e.el = ""), void 0 === e.type ? e.type = "top" : e.type =
|
e.type.toLowerCase(), void 0 === e.location ? e.location = 0 : e.location = parseInt(e.location), void 0 === e.animat &&
|
(e.animat = !0), void 0 === e.success && (e.success = function() {}), void 0 === e.fail && (e.fail = function() {}),
|
"html" == e.el || "body" == e.el || "window" == e.el) {
|
if ("top" == e.type)
|
if (1 == e.animat) {
|
var t = null;
|
cancelAnimationFrame(t), t = requestAnimationFrame(function i() {
|
var n = document.documentElement.scrollTop || document.body.scrollTop,
|
o = Math.ceil(n / 5);
|
n > 2e3 ? (scrollTo(0, 2e3), t = requestAnimationFrame(i)) : n > e.location ? (scrollTo(0, n - o), t =
|
requestAnimationFrame(i)) : (scrollTo(0, e.location), cancelAnimationFrame(t), e.success())
|
})
|
} else scrollTo(0, e.location), e.success();
|
else if ("left" == e.type)
|
if (1 == e.animat) {
|
t = null;
|
cancelAnimationFrame(t), t = requestAnimationFrame(function i() {
|
var n = document.documentElement.scrollLeft || document.body.scrollLeft,
|
o = Math.ceil(n / 5);
|
n > 2e3 ? (scrollTo(2e3, 0), t = requestAnimationFrame(i)) : n > e.location ? (scrollTo(n - o, 0), t =
|
requestAnimationFrame(i)) : (scrollTo(e.location, 0), cancelAnimationFrame(t), e.success())
|
})
|
} else scrollTo(e.location, 0), e.success()
|
} else "top" == e.type ? doui.domBy({
|
el: e.el,
|
success: function(t) {
|
for (var i = 0, n = t; i < n.length; i++) {
|
var o = n[i];
|
if (1 == e.animat) {
|
var r = null;
|
cancelAnimationFrame(r), r = requestAnimationFrame(function t() {
|
var i = o.scrollTop,
|
n = Math.ceil(i / 5);
|
i > 2e3 ? (o.scrollTop = 2e3, r = requestAnimationFrame(t)) : i > e.location ? (o.scrollTop = i - n, r =
|
requestAnimationFrame(t)) : (o.scrollTop = e.location, cancelAnimationFrame(r), e.success())
|
})
|
} else o.scrollTop = e.location, e.success()
|
}
|
}
|
}) : "left" == e.type && doui.domBy({
|
el: e.el,
|
success: function(t) {
|
for (var i = 0, n = t; i < n.length; i++) {
|
var o = n[i];
|
if (1 == e.animat) {
|
var r = null;
|
cancelAnimationFrame(r), r = requestAnimationFrame(function t() {
|
var i = o.scrollLeft,
|
n = Math.ceil(i / 5);
|
i > 2e3 ? (o.scrollLeft = 2e3, r = requestAnimationFrame(t)) : i > e.location ? (o.scrollLeft = i - n, r =
|
requestAnimationFrame(t)) : (o.scrollLeft = e.location, cancelAnimationFrame(r), e.success())
|
})
|
} else o.scrollLeft = e.location, e.success()
|
}
|
}
|
})
|
},
|
cookieSet: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.key && (e.key = ""), void 0 === e.data && (e.data = ""), void 0 ===
|
e.hour ? e.hour = 3 : e.hour = parseFloat(e.hour), void 0 === e.path && (e.path = "/"), void 0 === e.success && (e
|
.success = function() {}), void 0 === e.fail && (e.fail = function() {});
|
try {
|
var t = new Date;
|
t.setTime(t.getTime() + Math.ceil(36e5 * e.hour));
|
var i = "expires=" + t.toGMTString(),
|
n = "";
|
"object" == typeof e.data ? n = JSON.stringify(e.data) : "string" == typeof e.data ? n = e.data : doui.showToast({
|
content: "doui.cookieSet():要保存的数据格式错误"
|
}), document.cookie = e.key + "=" + n + "; " + i + "; path=" + e.path, e.success()
|
} catch (t) {
|
e.fail()
|
}
|
},
|
cookieGet: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.key && (e.key = ""), void 0 === e.success && (e.success = function() {}),
|
void 0 === e.fail && (e.fail = function() {});
|
var t = document.cookie.split(";");
|
if (t && t.length > 0) {
|
for (var i = {}, n = 0; n < t.length; n++) {
|
var o = t[n].trim(),
|
r = o.indexOf("="),
|
a = o.substring(0, r),
|
s = o.slice(r + 1);
|
if (doui.strToJson({
|
str: s,
|
success: function(e) {
|
s = e
|
}
|
}), i[a] = s, a == e.key) break
|
}
|
if (e.key.length <= 0) e.success(i);
|
else if (i[e.key]) e.success(i[e.key]);
|
else {
|
var c = {
|
data: null,
|
msg: "没有该数据"
|
};
|
e.fail(c)
|
}
|
} else {
|
c = {
|
data: null,
|
msg: "没有cookie数据"
|
};
|
e.fail(c)
|
}
|
},
|
cookieDel: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.key && (e.key = ""), void 0 === e.success && (e.success = function() {}),
|
void 0 === e.fail && (e.fail = function() {});
|
try {
|
document.cookie = e.key + "= ; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/", e.success()
|
} catch (t) {
|
e.fail({
|
data: null,
|
msg: "执行错误"
|
})
|
}
|
},
|
localStorageSet: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.key && (e.key = ""), void 0 === e.data && (e.data = ""), void 0 ===
|
e.success && (e.success = function() {}), void 0 === e.fail && (e.fail = function() {});
|
try {
|
var t = "";
|
"object" == typeof e.data ? t = JSON.stringify(e.data) : "string" == typeof e.data ? t = e.data : doui.showToast({
|
content: "doui.cookieSet():要保存的数据格式错误"
|
}), localStorage.setItem(e.key, t), e.success()
|
} catch (t) {
|
e.fail()
|
}
|
},
|
localStorageGet: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.key && (e.key = ""), void 0 === e.success && (e.success = function() {}),
|
void 0 === e.fail && (e.fail = function() {});
|
try {
|
var t = localStorage.getItem(e.key);
|
if (t) doui.strToJson({
|
str: t,
|
success: function(t) {
|
e.success(t)
|
},
|
fail: function() {
|
e.success(t)
|
}
|
});
|
else {
|
var i = {
|
data: null,
|
msg: "未查询到该数据"
|
};
|
e.fail(i)
|
}
|
} catch (t) {
|
i = {
|
data: null,
|
msg: "执行错误"
|
};
|
e.fail(i)
|
}
|
},
|
localStorageDel: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.key && (e.key = ""), void 0 === e.success && (e.success = function() {}),
|
void 0 === e.fail && (e.fail = function() {});
|
try {
|
localStorage.removeItem(e.key), e.success()
|
} catch (t) {
|
e.fail({
|
data: null,
|
msg: "执行错误"
|
})
|
}
|
},
|
sessionStorageSet: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.key && (e.key = ""), void 0 === e.data && (e.data = ""), void 0 ===
|
e.success && (e.success = function() {}), void 0 === e.fail && (e.fail = function() {});
|
try {
|
var t = "";
|
"object" == typeof e.data ? t = JSON.stringify(e.data) : "string" == typeof e.data ? t = e.data : doui.showToast({
|
content: "doui.cookieSet():要保存的数据格式错误"
|
}), sessionStorage.setItem(e.key, t), e.success()
|
} catch (t) {
|
e.fail()
|
}
|
},
|
sessionStorageGet: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.key && (e.key = ""), void 0 === e.success && (e.success = function() {}),
|
void 0 === e.fail && (e.fail = function() {});
|
try {
|
var t = sessionStorage.getItem(e.key);
|
if (t) doui.strToJson({
|
str: t,
|
success: function(t) {
|
e.success(t)
|
},
|
fail: function() {
|
e.success(t)
|
}
|
});
|
else {
|
var i = {
|
data: null,
|
msg: "未查询到该数据"
|
};
|
e.fail(i)
|
}
|
} catch (t) {
|
i = {
|
data: null,
|
msg: "执行错误"
|
};
|
e.fail(i)
|
}
|
},
|
sessionStorageDel: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.key && (e.key = ""), void 0 === e.success && (e.success = function() {}),
|
void 0 === e.fail && (e.fail = function() {});
|
try {
|
sessionStorage.removeItem(e.key), e.success()
|
} catch (t) {
|
e.fail({
|
data: null,
|
msg: "执行错误"
|
})
|
}
|
},
|
pageToUrl: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.url && (e.url = ""), void 0 === e.type ? e.type = "href" : e.type =
|
e.type.toLowerCase(), void 0 === e.data && (e.data = null), void 0 === e.success && (e.success = function() {}),
|
void 0 === e.fail && (e.fail = function() {});
|
var t = "";
|
if (e.data) {
|
for (var i in t = "?", e.data) "object" == typeof e.data[i] && (e.data[i] = JSON.stringify(e.data[i])), t += i +
|
"=" + encodeURIComponent(e.data[i]) + "&";
|
t = t.substring(0, t.length - 1)
|
}
|
"href" == e.type ? window.location.href = e.url + t : "replace" == e.type ? window.location.replace(e.url + t) :
|
"open" == e.type && window.open(e.url + t)
|
},
|
timestampToDate: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.timestamp ? e.timestamp = "" : e.timestamp = parseInt(e.timestamp),
|
void 0 === e.symbol && (e.symbol = "/"), void 0 === e.success && (e.success = function() {}), void 0 === e.fail &&
|
(e.fail = function() {});
|
try {
|
var t = parseFloat(e.timestamp),
|
i = new Date(t),
|
n = i.getFullYear(),
|
o = i.getMonth() + 1;
|
o < 10 && (o = "0" + o);
|
var r = i.getDate();
|
r < 10 && (r = "0" + r);
|
var a = i.getHours();
|
a < 10 && (a = "0" + a);
|
var s = i.getMinutes();
|
s < 10 && (s = "0" + s);
|
var c = i.getSeconds(),
|
d = n + e.symbol + o + e.symbol + r + " " + a + ":" + s + ":" + c;
|
e.success(d)
|
} catch (t) {
|
console.log("doui.timestampToDate():'" + e.timestamp + "'转换失败")
|
}
|
},
|
numRandom: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.min ? e.min = 0 : e.min = parseInt(e.min), void 0 === e.max ? e.max =
|
9 : e.max = parseInt(e.max), void 0 === e.decimals ? e.decimals = 0 : e.decimals = parseInt(e.decimals), void 0 ===
|
e.success && (e.success = function() {}), void 0 === e.fail && (e.fail = function() {});
|
var t = 0,
|
i = 0;
|
e.min < e.max ? (t = e.min, i = e.max) : (t = e.max, i = e.min);
|
var n = "1";
|
if (e.decimals > 0) {
|
for (var o = 0; o < e.decimals; o++) t += "0", i += "0", n += "0";
|
t = parseInt(t), i = parseInt(i)
|
}
|
var r = Math.floor(Math.random() * (i - t + 1) + t);
|
e.decimals > 0 && (r /= n = parseInt(n)), e.success(r)
|
},
|
strRandom: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.case ? e.case = "" : e.case = e.case.toLowerCase(), void 0 === e.length ?
|
e.length = 8 : e.length = parseInt(e.length), void 0 === e.success && (e.success = function() {}), void 0 === e.fail &&
|
(e.fail = function() {});
|
for (var t = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", i = "", n = 0; n < e.length; n++) {
|
var o = Math.round(Math.random() * (t.length - 1));
|
i += t.charAt(o)
|
}
|
"capital" == e.case ? i = i.toUpperCase() : "small" == e.case && (i = i.toLowerCase()), e.success(i)
|
},
|
strToJson: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.str && (e.str = ""), void 0 === e.success && (e.success = function() {}),
|
void 0 === e.fail && (e.fail = function() {});
|
try {
|
var t = JSON.parse(e.str);
|
"object" == typeof t ? e.success(t) : e.fail(e.str)
|
} catch (t) {
|
e.fail(e.str)
|
}
|
},
|
jsonToHtml: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.str && (e.str = ""), void 0 === e.blankSpace ? e.blankSpace = 4 : e.blankSpace =
|
parseInt(e.blankSpace), void 0 === e.success && (e.success = function() {}), void 0 === e.fail && (e.fail =
|
function() {});
|
try {
|
var t = "";
|
"string" == typeof e.str ? (t = JSON.parse(e.str), t = JSON.stringify(t, null, e.blankSpace)) : t = JSON.stringify(
|
e.str, null, e.blankSpace);
|
var i = t.replace(/\n/g, "<br>").replace(/\s/g, " ");
|
e.success(i)
|
} catch (i) {
|
t = "不是Json格式数据";
|
e.fail(t)
|
}
|
},
|
Base64: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.type && (e.type = "en"), void 0 === e.str && (e.str = ""), void 0 ===
|
e.success && (e.success = function() {}), void 0 === e.fail && (e.fail = function() {});
|
var t = {
|
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
encode: function(e) {
|
var i, n, o, r, a, s, c, d = "",
|
l = 0;
|
for (e = t._utf8_encode(e); l < e.length;) r = (i = e.charCodeAt(l++)) >> 2, a = (3 & i) << 4 | (n = e.charCodeAt(
|
l++)) >> 4, s = (15 & n) << 2 | (o = e.charCodeAt(l++)) >> 6, c = 63 & o, isNaN(n) ? s = c = 64 : isNaN(o) &&
|
(c = 64), d = d + this._keyStr.charAt(r) + this._keyStr.charAt(a) + this._keyStr.charAt(s) + this._keyStr.charAt(
|
c);
|
return d
|
},
|
decode: function(e) {
|
var i, n, o, r, a, s, c = "",
|
d = 0;
|
for (e = e.replace(/[^A-Za-z0-9+/=]/g, ""); d < e.length;) i = this._keyStr.indexOf(e.charAt(d++)) << 2 | (r =
|
this._keyStr.indexOf(e.charAt(d++))) >> 4, n = (15 & r) << 4 | (a = this._keyStr.indexOf(e.charAt(d++))) >> 2,
|
o = (3 & a) << 6 | (s = this._keyStr.indexOf(e.charAt(d++))), c += String.fromCharCode(i), 64 != a && (c +=
|
String.fromCharCode(n)), 64 != s && (c += String.fromCharCode(o));
|
return t._utf8_decode(c)
|
},
|
_utf8_encode: function(e) {
|
e = e.replace(/rn/g, "n");
|
for (var t = "", i = 0; i < e.length; i++) {
|
var n = e.charCodeAt(i);
|
n < 128 ? t += String.fromCharCode(n) : n > 127 && n < 2048 ? (t += String.fromCharCode(n >> 6 | 192), t +=
|
String.fromCharCode(63 & n | 128)) : (t += String.fromCharCode(n >> 12 | 224), t += String.fromCharCode(n >>
|
6 & 63 | 128), t += String.fromCharCode(63 & n | 128))
|
}
|
return t
|
},
|
_utf8_decode: function(e) {
|
for (var t, i, n = "", o = 0, r = 0; o < e.length;)(t = e.charCodeAt(o)) < 128 ? (n += String.fromCharCode(t),
|
o++) : t > 191 && t < 224 ? (i = e.charCodeAt(o + 1), n += String.fromCharCode((31 & t) << 6 | 63 & i), o +=
|
2) : (i = e.charCodeAt(o + 1), r = e.charCodeAt(o + 2), n += String.fromCharCode((15 & t) << 12 | (63 & i) <<
|
6 | 63 & r), o += 3);
|
return n
|
}
|
};
|
if ("en" == e.type) {
|
var i = t.encode(e.str);
|
e.success(i)
|
} else if ("de" == e.type) {
|
i = t.decode(e.str);
|
e.success(i)
|
}
|
},
|
Aes: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.type && (e.type = "en"), void 0 === e.str && (e.str = ""), void 0 ===
|
e.key && (e.key = "warningiscaution"), void 0 === e.iv && (e.iv = ""), void 0 === e.success && (e.success =
|
function() {}), void 0 === e.fail && (e.fail = function() {});
|
var t, i, n, o, r, a, s, c, d, l, u, f, h = h || (t = Math, i = Object.create || function() {
|
function e() {}
|
return function(t) {
|
var i;
|
return e.prototype = t, i = new e, e.prototype = null, i
|
}
|
}(), o = (n = {}).lib = {}, r = o.Base = {
|
extend: function(e) {
|
var t = i(this);
|
return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function() {
|
t.$super.init.apply(this, arguments)
|
}), t.init.prototype = t, t.$super = this, t
|
},
|
create: function() {
|
var e = this.extend();
|
return e.init.apply(e, arguments), e
|
},
|
init: function() {},
|
mixIn: function(e) {
|
for (var t in e) e.hasOwnProperty(t) && (this[t] = e[t]);
|
e.hasOwnProperty("toString") && (this.toString = e.toString)
|
},
|
clone: function() {
|
return this.init.prototype.extend(this)
|
}
|
}, a = o.WordArray = r.extend({
|
init: function(e, t) {
|
e = this.words = e || [], this.sigBytes = null != t ? t : 4 * e.length
|
},
|
toString: function(e) {
|
return (e || c).stringify(this)
|
},
|
concat: function(e) {
|
var t = this.words,
|
i = e.words,
|
n = this.sigBytes,
|
o = e.sigBytes;
|
if (this.clamp(), n % 4)
|
for (var r = 0; r < o; r++) {
|
var a = i[r >>> 2] >>> 24 - r % 4 * 8 & 255;
|
t[n + r >>> 2] |= a << 24 - (n + r) % 4 * 8
|
} else
|
for (r = 0; r < o; r += 4) t[n + r >>> 2] = i[r >>> 2];
|
return this.sigBytes += o, this
|
},
|
clamp: function() {
|
var e = this.words,
|
i = this.sigBytes;
|
e[i >>> 2] &= 4294967295 << 32 - i % 4 * 8, e.length = t.ceil(i / 4)
|
},
|
clone: function() {
|
var e = r.clone.call(this);
|
return e.words = this.words.slice(0), e
|
},
|
random: function(e) {
|
for (var i, n = [], o = function(e) {
|
e = e;
|
var i = 987654321,
|
n = 4294967295;
|
return function() {
|
var o = ((i = 36969 * (65535 & i) + (i >> 16) & n) << 16) + (e = 18e3 * (65535 & e) + (e >> 16) & n) & n;
|
return o /= 4294967296, (o += .5) * (t.random() > .5 ? 1 : -1)
|
}
|
}, r = 0; r < e; r += 4) {
|
var s = o(4294967296 * (i || t.random()));
|
i = 987654071 * s(), n.push(4294967296 * s() | 0)
|
}
|
return new a.init(n, e)
|
}
|
}), s = n.enc = {}, c = s.Hex = {
|
stringify: function(e) {
|
for (var t = e.words, i = e.sigBytes, n = [], o = 0; o < i; o++) {
|
var r = t[o >>> 2] >>> 24 - o % 4 * 8 & 255;
|
n.push((r >>> 4).toString(16)), n.push((15 & r).toString(16))
|
}
|
return n.join("")
|
},
|
parse: function(e) {
|
for (var t = e.length, i = [], n = 0; n < t; n += 2) i[n >>> 3] |= parseInt(e.substr(n, 2), 16) << 24 - n % 8 *
|
4;
|
return new a.init(i, t / 2)
|
}
|
}, d = s.Latin1 = {
|
stringify: function(e) {
|
for (var t = e.words, i = e.sigBytes, n = [], o = 0; o < i; o++) {
|
var r = t[o >>> 2] >>> 24 - o % 4 * 8 & 255;
|
n.push(String.fromCharCode(r))
|
}
|
return n.join("")
|
},
|
parse: function(e) {
|
for (var t = e.length, i = [], n = 0; n < t; n++) i[n >>> 2] |= (255 & e.charCodeAt(n)) << 24 - n % 4 * 8;
|
return new a.init(i, t)
|
}
|
}, l = s.Utf8 = {
|
stringify: function(e) {
|
try {
|
return decodeURIComponent(escape(d.stringify(e)))
|
} catch (e) {
|
throw new Error("Malformed UTF-8 data")
|
}
|
},
|
parse: function(e) {
|
return d.parse(unescape(encodeURIComponent(e)))
|
}
|
}, u = o.BufferedBlockAlgorithm = r.extend({
|
reset: function() {
|
this._data = new a.init, this._nDataBytes = 0
|
},
|
_append: function(e) {
|
"string" == typeof e && (e = l.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes
|
},
|
_process: function(e) {
|
var i = this._data,
|
n = i.words,
|
o = i.sigBytes,
|
r = this.blockSize,
|
s = o / (4 * r),
|
c = (s = e ? t.ceil(s) : t.max((0 | s) - this._minBufferSize, 0)) * r,
|
d = t.min(4 * c, o);
|
if (c) {
|
for (var l = 0; l < c; l += r) this._doProcessBlock(n, l);
|
var u = n.splice(0, c);
|
i.sigBytes -= d
|
}
|
return new a.init(u, d)
|
},
|
clone: function() {
|
var e = r.clone.call(this);
|
return e._data = this._data.clone(), e
|
},
|
_minBufferSize: 0
|
}), o.Hasher = u.extend({
|
cfg: r.extend(),
|
init: function(e) {
|
this.cfg = this.cfg.extend(e), this.reset()
|
},
|
reset: function() {
|
u.reset.call(this), this._doReset()
|
},
|
update: function(e) {
|
return this._append(e), this._process(), this
|
},
|
finalize: function(e) {
|
return e && this._append(e), this._doFinalize()
|
},
|
blockSize: 16,
|
_createHelper: function(e) {
|
return function(t, i) {
|
return new e.init(i).finalize(t)
|
}
|
},
|
_createHmacHelper: function(e) {
|
return function(t, i) {
|
return new f.HMAC.init(e, i).finalize(t)
|
}
|
}
|
}), f = n.algo = {}, n);
|
! function() {
|
var e = h,
|
t = e.lib,
|
i = t.Base,
|
n = t.WordArray,
|
o = e.algo,
|
r = o.MD5,
|
a = o.EvpKDF = i.extend({
|
cfg: i.extend({
|
keySize: 4,
|
hasher: r,
|
iterations: 1
|
}),
|
init: function(e) {
|
this.cfg = this.cfg.extend(e)
|
},
|
compute: function(e, t) {
|
for (var i = this.cfg, o = i.hasher.create(), r = n.create(), a = r.words, s = i.keySize, c = i.iterations; a
|
.length < s;) {
|
d && o.update(d);
|
var d = o.update(e).finalize(t);
|
o.reset();
|
for (var l = 1; l < c; l++) d = o.finalize(d), o.reset();
|
r.concat(d)
|
}
|
return r.sigBytes = 4 * s, r
|
}
|
});
|
e.EvpKDF = function(e, t, i) {
|
return a.create(i).compute(e, t)
|
}
|
}(),
|
function() {
|
var e = h,
|
t = e.lib.WordArray;
|
e.enc.Base64 = {
|
stringify: function(e) {
|
var t = e.words,
|
i = e.sigBytes,
|
n = this._map;
|
e.clamp();
|
for (var o = [], r = 0; r < i; r += 3)
|
for (var a = (t[r >>> 2] >>> 24 - r % 4 * 8 & 255) << 16 | (t[r + 1 >>> 2] >>> 24 - (r + 1) % 4 * 8 & 255) <<
|
8 | t[r + 2 >>> 2] >>> 24 - (r + 2) % 4 * 8 & 255, s = 0; s < 4 && r + .75 * s < i; s++) o.push(n.charAt(a >>>
|
6 * (3 - s) & 63));
|
var c = n.charAt(64);
|
if (c)
|
for (; o.length % 4;) o.push(c);
|
return o.join("")
|
},
|
parse: function(e) {
|
var i = e.length,
|
n = this._map,
|
o = this._reverseMap;
|
if (!o) {
|
o = this._reverseMap = [];
|
for (var r = 0; r < n.length; r++) o[n.charCodeAt(r)] = r
|
}
|
var a = n.charAt(64);
|
if (a) {
|
var s = e.indexOf(a); - 1 !== s && (i = s)
|
}
|
return function(e, i, n) {
|
for (var o = [], r = 0, a = 0; a < i; a++)
|
if (a % 4) {
|
var s = n[e.charCodeAt(a - 1)] << a % 4 * 2,
|
c = n[e.charCodeAt(a)] >>> 6 - a % 4 * 2;
|
o[r >>> 2] |= (s | c) << 24 - r % 4 * 8, r++
|
} return t.create(o, r)
|
}(e, i, o)
|
},
|
_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
|
}
|
}(), h.lib.Cipher || function(e) {
|
var t = h,
|
i = t.lib,
|
n = i.Base,
|
o = i.WordArray,
|
r = i.BufferedBlockAlgorithm,
|
a = t.enc,
|
s = (a.Utf8, a.Base64),
|
c = t.algo.EvpKDF,
|
d = i.Cipher = r.extend({
|
cfg: n.extend(),
|
createEncryptor: function(e, t) {
|
return this.create(this._ENC_XFORM_MODE, e, t)
|
},
|
createDecryptor: function(e, t) {
|
return this.create(this._DEC_XFORM_MODE, e, t)
|
},
|
init: function(e, t, i) {
|
this.cfg = this.cfg.extend(i), this._xformMode = e, this._key = t, this.reset()
|
},
|
reset: function() {
|
r.reset.call(this), this._doReset()
|
},
|
process: function(e) {
|
return this._append(e), this._process()
|
},
|
finalize: function(e) {
|
return e && this._append(e), this._doFinalize()
|
},
|
keySize: 4,
|
ivSize: 4,
|
_ENC_XFORM_MODE: 1,
|
_DEC_XFORM_MODE: 2,
|
_createHelper: function() {
|
function e(e) {
|
return "string" == typeof e ? w : y
|
}
|
return function(t) {
|
return {
|
encrypt: function(i, n, o) {
|
return e(n).encrypt(t, i, n, o)
|
},
|
decrypt: function(i, n, o) {
|
return e(n).decrypt(t, i, n, o)
|
}
|
}
|
}
|
}()
|
}),
|
l = (i.StreamCipher = d.extend({
|
_doFinalize: function() {
|
return this._process(!0)
|
},
|
blockSize: 1
|
}), t.mode = {}),
|
u = i.BlockCipherMode = n.extend({
|
createEncryptor: function(e, t) {
|
return this.Encryptor.create(e, t)
|
},
|
createDecryptor: function(e, t) {
|
return this.Decryptor.create(e, t)
|
},
|
init: function(e, t) {
|
this._cipher = e, this._iv = t
|
}
|
}),
|
f = l.CBC = function() {
|
var t = u.extend();
|
|
function i(t, i, n) {
|
var o = this._iv;
|
if (o) {
|
var r = o;
|
this._iv = e
|
} else r = this._prevBlock;
|
for (var a = 0; a < n; a++) t[i + a] ^= r[a]
|
}
|
return t.Encryptor = t.extend({
|
processBlock: function(e, t) {
|
var n = this._cipher,
|
o = n.blockSize;
|
i.call(this, e, t, o), n.encryptBlock(e, t), this._prevBlock = e.slice(t, t + o)
|
}
|
}), t.Decryptor = t.extend({
|
processBlock: function(e, t) {
|
var n = this._cipher,
|
o = n.blockSize,
|
r = e.slice(t, t + o);
|
n.decryptBlock(e, t), i.call(this, e, t, o), this._prevBlock = r
|
}
|
}), t
|
}(),
|
m = (t.pad = {}).Pkcs7 = {
|
pad: function(e, t) {
|
for (var i = 4 * t, n = i - e.sigBytes % i, r = n << 24 | n << 16 | n << 8 | n, a = [], s = 0; s < n; s += 4)
|
a.push(r);
|
var c = o.create(a, n);
|
e.concat(c)
|
},
|
unpad: function(e) {
|
var t = 255 & e.words[e.sigBytes - 1 >>> 2];
|
e.sigBytes -= t
|
}
|
},
|
p = (i.BlockCipher = d.extend({
|
cfg: d.cfg.extend({
|
mode: f,
|
padding: m
|
}),
|
reset: function() {
|
d.reset.call(this);
|
var e = this.cfg,
|
t = e.iv,
|
i = e.mode;
|
if (this._xformMode == this._ENC_XFORM_MODE) var n = i.createEncryptor;
|
else n = i.createDecryptor, this._minBufferSize = 1;
|
this._mode && this._mode.__creator == n ? this._mode.init(this, t && t.words) : (this._mode = n.call(i,
|
this, t && t.words), this._mode.__creator = n)
|
},
|
_doProcessBlock: function(e, t) {
|
this._mode.processBlock(e, t)
|
},
|
_doFinalize: function() {
|
var e = this.cfg.padding;
|
if (this._xformMode == this._ENC_XFORM_MODE) {
|
e.pad(this._data, this.blockSize);
|
var t = this._process(!0)
|
} else t = this._process(!0), e.unpad(t);
|
return t
|
},
|
blockSize: 4
|
}), i.CipherParams = n.extend({
|
init: function(e) {
|
this.mixIn(e)
|
},
|
toString: function(e) {
|
return (e || this.formatter).stringify(this)
|
}
|
})),
|
v = (t.format = {}).OpenSSL = {
|
stringify: function(e) {
|
var t = e.ciphertext,
|
i = e.salt;
|
if (i) var n = o.create([1398893684, 1701076831]).concat(i).concat(t);
|
else n = t;
|
return n.toString(s)
|
},
|
parse: function(e) {
|
var t = s.parse(e),
|
i = t.words;
|
if (1398893684 == i[0] && 1701076831 == i[1]) {
|
var n = o.create(i.slice(2, 4));
|
i.splice(0, 4), t.sigBytes -= 16
|
}
|
return p.create({
|
ciphertext: t,
|
salt: n
|
})
|
}
|
},
|
y = i.SerializableCipher = n.extend({
|
cfg: n.extend({
|
format: v
|
}),
|
encrypt: function(e, t, i, n) {
|
n = this.cfg.extend(n);
|
var o = e.createEncryptor(i, n),
|
r = o.finalize(t),
|
a = o.cfg;
|
return p.create({
|
ciphertext: r,
|
key: i,
|
iv: a.iv,
|
algorithm: e,
|
mode: a.mode,
|
padding: a.padding,
|
blockSize: e.blockSize,
|
formatter: n.format
|
})
|
},
|
decrypt: function(e, t, i, n) {
|
return n = this.cfg.extend(n), t = this._parse(t, n.format), e.createDecryptor(i, n).finalize(t.ciphertext)
|
},
|
_parse: function(e, t) {
|
return "string" == typeof e ? t.parse(e, this) : e
|
}
|
}),
|
g = (t.kdf = {}).OpenSSL = {
|
execute: function(e, t, i, n) {
|
n || (n = o.random(8));
|
var r = c.create({
|
keySize: t + i
|
}).compute(e, n),
|
a = o.create(r.words.slice(t), 4 * i);
|
return r.sigBytes = 4 * t, p.create({
|
key: r,
|
iv: a,
|
salt: n
|
})
|
}
|
},
|
w = i.PasswordBasedCipher = y.extend({
|
cfg: y.cfg.extend({
|
kdf: g
|
}),
|
encrypt: function(e, t, i, n) {
|
var o = (n = this.cfg.extend(n)).kdf.execute(i, e.keySize, e.ivSize);
|
n.iv = o.iv;
|
var r = y.encrypt.call(this, e, t, o.key, n);
|
return r.mixIn(o), r
|
},
|
decrypt: function(e, t, i, n) {
|
n = this.cfg.extend(n), t = this._parse(t, n.format);
|
var o = n.kdf.execute(i, e.keySize, e.ivSize, t.salt);
|
return n.iv = o.iv, y.decrypt.call(this, e, t, o.key, n)
|
}
|
})
|
}(),
|
function() {
|
var e = h,
|
t = e.lib.Base,
|
i = e.enc.Utf8;
|
e.algo.HMAC = t.extend({
|
init: function(e, t) {
|
e = this._hasher = new e.init, "string" == typeof t && (t = i.parse(t));
|
var n = e.blockSize,
|
o = 4 * n;
|
t.sigBytes > o && (t = e.finalize(t)), t.clamp();
|
for (var r = this._oKey = t.clone(), a = this._iKey = t.clone(), s = r.words, c = a.words, d = 0; d < n; d++)
|
s[d] ^= 1549556828, c[d] ^= 909522486;
|
r.sigBytes = a.sigBytes = o, this.reset()
|
},
|
reset: function() {
|
var e = this._hasher;
|
e.reset(), e.update(this._iKey)
|
},
|
update: function(e) {
|
return this._hasher.update(e), this
|
},
|
finalize: function(e) {
|
var t = this._hasher,
|
i = t.finalize(e);
|
return t.reset(), t.finalize(this._oKey.clone().concat(i))
|
}
|
})
|
}(), h.mode.ECB = function() {
|
var e = h.lib.BlockCipherMode.extend();
|
return e.Encryptor = e.extend({
|
processBlock: function(e, t) {
|
this._cipher.encryptBlock(e, t)
|
}
|
}), e.Decryptor = e.extend({
|
processBlock: function(e, t) {
|
this._cipher.decryptBlock(e, t)
|
}
|
}), e
|
}(), h.pad.Iso10126 = {
|
pad: function(e, t) {
|
var i = 4 * t,
|
n = i - e.sigBytes % i;
|
e.concat(h.lib.WordArray.random(n - 1)).concat(h.lib.WordArray.create([n << 24], 1))
|
},
|
unpad: function(e) {
|
var t = 255 & e.words[e.sigBytes - 1 >>> 2];
|
e.sigBytes -= t
|
}
|
},
|
function() {
|
var e = h,
|
t = e.lib.BlockCipher,
|
i = e.algo,
|
n = [],
|
o = [],
|
r = [],
|
a = [],
|
s = [],
|
c = [],
|
d = [],
|
l = [],
|
u = [],
|
f = [];
|
! function() {
|
for (var e = [], t = 0; t < 256; t++) e[t] = t < 128 ? t << 1 : t << 1 ^ 283;
|
var i = 0,
|
h = 0;
|
for (t = 0; t < 256; t++) {
|
var m = h ^ h << 1 ^ h << 2 ^ h << 3 ^ h << 4;
|
m = m >>> 8 ^ 255 & m ^ 99, n[i] = m, o[m] = i;
|
var p = e[i],
|
v = e[p],
|
y = e[v],
|
g = 257 * e[m] ^ 16843008 * m;
|
r[i] = g << 24 | g >>> 8, a[i] = g << 16 | g >>> 16, s[i] = g << 8 | g >>> 24, c[i] = g, g = 16843009 * y ^
|
65537 * v ^ 257 * p ^ 16843008 * i, d[m] = g << 24 | g >>> 8, l[m] = g << 16 | g >>> 16, u[m] = g << 8 | g >>>
|
24, f[m] = g, i ? (i = p ^ e[e[e[y ^ p]]], h ^= e[e[h]]) : i = h = 1
|
}
|
}();
|
var m = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54],
|
p = i.AES = t.extend({
|
_doReset: function() {
|
if (!this._nRounds || this._keyPriorReset !== this._key) {
|
for (var e = this._keyPriorReset = this._key, t = e.words, i = e.sigBytes / 4, o = 4 * ((this._nRounds = i +
|
6) + 1), r = this._keySchedule = [], a = 0; a < o; a++)
|
if (a < i) r[a] = t[a];
|
else {
|
var s = r[a - 1];
|
a % i ? i > 6 && a % i == 4 && (s = n[s >>> 24] << 24 | n[s >>> 16 & 255] << 16 | n[s >>> 8 & 255] << 8 |
|
n[255 & s]) : (s = n[(s = s << 8 | s >>> 24) >>> 24] << 24 | n[s >>> 16 & 255] << 16 | n[s >>> 8 & 255] <<
|
8 | n[255 & s], s ^= m[a / i | 0] << 24), r[a] = r[a - i] ^ s
|
} for (var c = this._invKeySchedule = [], h = 0; h < o; h++) a = o - h, s = h % 4 ? r[a] : r[a - 4], c[h] =
|
h < 4 || a <= 4 ? s : d[n[s >>> 24]] ^ l[n[s >>> 16 & 255]] ^ u[n[s >>> 8 & 255]] ^ f[n[255 & s]]
|
}
|
},
|
encryptBlock: function(e, t) {
|
this._doCryptBlock(e, t, this._keySchedule, r, a, s, c, n)
|
},
|
decryptBlock: function(e, t) {
|
var i = e[t + 1];
|
e[t + 1] = e[t + 3], e[t + 3] = i, this._doCryptBlock(e, t, this._invKeySchedule, d, l, u, f, o), i = e[t +
|
1], e[t + 1] = e[t + 3], e[t + 3] = i
|
},
|
_doCryptBlock: function(e, t, i, n, o, r, a, s) {
|
for (var c = this._nRounds, d = e[t] ^ i[0], l = e[t + 1] ^ i[1], u = e[t + 2] ^ i[2], f = e[t + 3] ^ i[3],
|
h = 4, m = 1; m < c; m++) {
|
var p = n[d >>> 24] ^ o[l >>> 16 & 255] ^ r[u >>> 8 & 255] ^ a[255 & f] ^ i[h++],
|
v = n[l >>> 24] ^ o[u >>> 16 & 255] ^ r[f >>> 8 & 255] ^ a[255 & d] ^ i[h++],
|
y = n[u >>> 24] ^ o[f >>> 16 & 255] ^ r[d >>> 8 & 255] ^ a[255 & l] ^ i[h++],
|
g = n[f >>> 24] ^ o[d >>> 16 & 255] ^ r[l >>> 8 & 255] ^ a[255 & u] ^ i[h++];
|
d = p, l = v, u = y, f = g
|
}
|
p = (s[d >>> 24] << 24 | s[l >>> 16 & 255] << 16 | s[u >>> 8 & 255] << 8 | s[255 & f]) ^ i[h++], v = (s[l >>>
|
24] << 24 | s[u >>> 16 & 255] << 16 | s[f >>> 8 & 255] << 8 | s[255 & d]) ^ i[h++], y = (s[u >>> 24] << 24 |
|
s[f >>> 16 & 255] << 16 | s[d >>> 8 & 255] << 8 | s[255 & l]) ^ i[h++], g = (s[f >>> 24] << 24 | s[d >>>
|
16 & 255] << 16 | s[l >>> 8 & 255] << 8 | s[255 & u]) ^ i[h++], e[t] = p, e[t + 1] = v, e[t + 2] = y, e[t +
|
3] = g
|
},
|
keySize: 8
|
});
|
e.AES = t._createHelper(p)
|
}(),
|
function() {
|
var e = h,
|
t = e.lib.WordArray,
|
i = e.enc;
|
|
function n(e) {
|
return e << 8 & 4278255360 | e >>> 8 & 16711935
|
}
|
i.Utf16 = i.Utf16BE = {
|
stringify: function(e) {
|
for (var t = e.words, i = e.sigBytes, n = [], o = 0; o < i; o += 2) {
|
var r = t[o >>> 2] >>> 16 - o % 4 * 8 & 65535;
|
n.push(String.fromCharCode(r))
|
}
|
return n.join("")
|
},
|
parse: function(e) {
|
for (var i = e.length, n = [], o = 0; o < i; o++) n[o >>> 1] |= e.charCodeAt(o) << 16 - o % 2 * 16;
|
return t.create(n, 2 * i)
|
}
|
}, i.Utf16LE = {
|
stringify: function(e) {
|
for (var t = e.words, i = e.sigBytes, o = [], r = 0; r < i; r += 2) {
|
var a = n(t[r >>> 2] >>> 16 - r % 4 * 8 & 65535);
|
o.push(String.fromCharCode(a))
|
}
|
return o.join("")
|
},
|
parse: function(e) {
|
for (var i = e.length, o = [], r = 0; r < i; r++) o[r >>> 1] |= n(e.charCodeAt(r) << 16 - r % 2 * 16);
|
return t.create(o, 2 * i)
|
}
|
}
|
}();
|
var m = h.enc.Utf8.parse(e.key),
|
p = {
|
mode: h.mode.ECB,
|
padding: h.pad.Pkcs7
|
};
|
if (e.iv.length > 0 && (p = {
|
iv: h.enc.Utf8.parse(e.iv),
|
mode: h.mode.CBC,
|
padding: h.pad.Pkcs7
|
}), "en" == e.type) {
|
var v = h.enc.Utf8.parse(e.str),
|
y = h.AES.encrypt(v, m, p).toString();
|
e.success(y)
|
} else if ("de" == e.type) {
|
var g = h.AES.decrypt(e.str, m, p);
|
y = h.enc.Utf8.stringify(g).toString();
|
e.success(y)
|
}
|
},
|
MD5: function(e) {
|
if (void 0 === e && (e = new Object), void 0 === e.str && (e.str = ""), void 0 === e.file && (e.file = null), void 0 ===
|
e.case ? e.case = "capital" : e.case = e.case.toLowerCase(), void 0 === e.success && (e.success = function() {}),
|
void 0 === e.fail && (e.fail = function() {}), e.str.length > 0) try {
|
var t = SparkMD5.hash(e.str);
|
"capital" == e.case ? t = t.toUpperCase() : "small" == e.case && (t = t.toLowerCase()), e.success(t)
|
} catch (i) {
|
t = {
|
data: null,
|
msg: "待加密数据有误"
|
};
|
e.fail(t)
|
} else if (null != e.file) {
|
var i = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice,
|
n = e.file,
|
o = 2097152,
|
r = Math.ceil(n.size / o),
|
a = 0,
|
s = new SparkMD5.ArrayBuffer,
|
c = new FileReader;
|
|
function d() {
|
var e = a * o,
|
t = e + o >= n.size ? n.size : e + o;
|
c.readAsArrayBuffer(i.call(n, e, t))
|
}
|
c.onerror = function(t) {
|
var i = {
|
data: t,
|
msg: "文件读取错误"
|
};
|
e.fail(i)
|
}, c.onload = function(t) {
|
if (s.append(t.target.result), ++a < r) d();
|
else {
|
var i = s.end();
|
"capital" == e.case ? i = i.toUpperCase() : "small" == e.case && (i = i.toLowerCase()), e.success(i)
|
}
|
}, d()
|
}
|
},
|
AjaxList: [],
|
AjaxRepeat: function(e, t) {
|
var i = {
|
url: "",
|
over: !1
|
};
|
i.url = t;
|
var n = !1;
|
if ("add" == e) {
|
for (var o = null, r = 0; r < doui.AjaxList.length; r++)
|
if (i.url == doui.AjaxList[r].url) {
|
o = r;
|
break
|
} null == o ? (doui.AjaxList.push(i), n = !0) : 1 == doui.AjaxList[o].over ? (doui.AjaxList[o].over = !1, n = !0) :
|
n = !1
|
} else if ("over" == e)
|
for (r = 0; r < doui.AjaxList.length; r++)
|
if (t == doui.AjaxList[r].url) {
|
doui.AjaxList[r].over = !0, n = !0;
|
break
|
} return n
|
},
|
signData: function(e) {
|
void 0 === e && (e = new Object), void 0 === e.data && (e.data = new Object), void 0 === e.salt && (e.salt =
|
"thisWarning"), void 0 === e.success && (e.success = function() {}), void 0 === e.fail && (e.fail = function() {}),
|
e.data.timestamp = (new Date).getTime();
|
var t = new Array;
|
for (var i in e.data) {
|
var n = e.data[i];
|
"object" == typeof n && (n = JSON.stringify(n)), t.push(n)
|
}
|
t.sort();
|
var o = t.join("###") + "###" + e.salt;
|
doui.MD5({
|
str: o,
|
success: function(t) {
|
e.data.sign = t, e.success(e.data)
|
},
|
fail: function(t) {
|
e.fail(t)
|
}
|
})
|
},
|
request: function(e) {
|
if (void 0 === e && (e = new Object), void 0 === e.async && (e.async = !0), void 0 === e.type ? e.type = "JSONP" :
|
e.type = e.type.toUpperCase(), void 0 === e.url && (e.url = ""), void 0 === e.data && (e.data = new Object), void 0 ===
|
e.signCreat && (e.signCreat = !0), void 0 === e.timeout ? e.timeout = 18e4 : e.timeout = parseInt(e.timeout), void 0 ===
|
e.requestHeader && (e.requestHeader = new Object), void 0 === e.withCredentials && (e.withCredentials = !0), void 0 ===
|
e.greenChannel && (e.greenChannel = !1), void 0 === e.success && (e.success = function() {}), void 0 === e.fail &&
|
(e.fail = function() {}), 1 == e.greenChannel || doui.AjaxRepeat("add", e.url))
|
if (1 == e.signCreat && doui.signData({
|
data: e.data,
|
success: function(t) {
|
e.data = t
|
}
|
}), "JSONP" == e.type) {
|
var t = "douiJsonp_";
|
doui.strRandom({
|
length: 8,
|
success: function(i) {
|
t += i, e.data.callback = t
|
}
|
});
|
var i = e.url + "?";
|
for (var n in e.data) "object" == typeof e.data[n] && (e.data[n] = JSON.stringify(e.data[n])), i += n + "=" +
|
encodeURIComponent(e.data[n]) + "&";
|
i = i.substring(0, i.length - 1);
|
var o = document.createElement("script");
|
o.type = "text/javascript", o.src = i, document.getElementsByTagName("head")[0].appendChild(o);
|
var r = setTimeout(function() {
|
o && o.parentNode.removeChild(o), doui.AjaxRepeat("over", e.url);
|
e.fail({
|
code: 400,
|
data: {},
|
msg: "请求超时"
|
})
|
}, e.timeout);
|
o.onerror = function() {
|
o && o.parentNode.removeChild(o), null != r && clearTimeout(r), doui.AjaxRepeat("over", e.url);
|
e.fail({
|
code: 404,
|
data: {},
|
msg: "无法链接,请检查网络"
|
})
|
}, window[t] = function(t) {
|
var i = t;
|
if (o && o.parentNode.removeChild(o), null != r && clearTimeout(r), doui.AjaxRepeat("over", e.url), "object" ==
|
typeof i) {
|
var n = i;
|
if (n.code == 10001)
|
doui.loginOpen()
|
else
|
e.success(n)
|
} else if ("string" == typeof i) doui.strToJson({
|
str: i,
|
success: function(t) {
|
var i = t;
|
if (i.code == 10001)
|
doui.loginOpen()
|
else
|
e.success(i)
|
},
|
fail: function() {
|
var t = {
|
code: 200,
|
data: i,
|
msg: "返回数据不是json格式"
|
};
|
e.fail(t)
|
}
|
});
|
else {
|
n = {
|
code: 200,
|
data: i,
|
msg: "返回数据格式识别异常"
|
};
|
e.fail(n)
|
}
|
}
|
} else {
|
var a = null;
|
a = window.XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP");
|
r = setTimeout(function() {
|
a.abort(), doui.AjaxRepeat("over", e.url);
|
e.fail({
|
code: 400,
|
data: {},
|
msg: "请求超时"
|
})
|
}, e.timeout);
|
var s = "";
|
if ("GET" == e.type) {
|
i = e.url + "?";
|
for (var n in e.data) "object" == typeof e.data[n] && (e.data[n] = JSON.stringify(e.data[n])), i += n + "=" +
|
encodeURIComponent(e.data[n]) + "&";
|
s = i = i.substring(0, i.length - 1)
|
} else "POST" == e.type && (s = e.url);
|
for (var c in a.open(e.type, s, e.async), "POST" == e.type && a.setRequestHeader("Content-type",
|
"application/json"), e.requestHeader) a.setRequestHeader(c, e.requestHeader[c]);
|
a.withCredentials = e.withCredentials, a.onreadystatechange = function() {
|
if (4 == a.readyState && 200 == a.status) {
|
null != r && clearTimeout(r), doui.AjaxRepeat("over", e.url);
|
var t = "";
|
a.responseText ? t = a.responseText : a.responseXML && (t = a.responseXML), doui.strToJson({
|
str: t,
|
success: function(t) {
|
var i = t;
|
e.success(i)
|
},
|
fail: function() {
|
var i = {
|
code: 200,
|
data: t,
|
msg: "返回数据不是json格式"
|
};
|
e.fail(i)
|
}
|
})
|
} else if (4 == a.readyState) {
|
null != r && clearTimeout(r), doui.AjaxRepeat("over", e.url);
|
var i = {
|
code: 404,
|
data: a.responseText,
|
msg: "无法链接,请检查网络"
|
};
|
e.fail(i)
|
}
|
}, "GET" == e.type ? a.send() : "POST" == e.type && a.send(JSON.stringify(e.data))
|
}
|
},
|
upload: function(e) {
|
if (void 0 === e && (e = new Object), void 0 === e.async && (e.async = !0), void 0 === e.url && (e.url = ""), void 0 ===
|
e.data && (e.data = new Object), void 0 === e.maxSize ? e.maxSize = 100 : e.maxSize = parseInt(e.maxSize), void 0 ===
|
e.withCredentials && (e.withCredentials = !0), void 0 === e.greenChannel && (e.greenChannel = !1), void 0 === e.progress &&
|
(e.progress = function() {}), void 0 === e.success && (e.success = function() {}), void 0 === e.fail && (e.fail =
|
function() {}), 1 == e.greenChannel || doui.AjaxRepeat("add", e.url)) {
|
var t = new FormData;
|
for (var i in e.data) t.append(i, e.data[i]);
|
var n = null;
|
n = window.XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP");
|
var o = {
|
total: 0,
|
loaded: 0,
|
percentage: 0
|
};
|
n.upload.onprogress = function(t) {
|
t.lengthComputable && (o.total = t.total, o.loaded = t.loaded, o.percentage = Math.round(1e3 * parseFloat(t.loaded /
|
t.total)) / 10, e.progress(o))
|
}, n.open("POST", e.url, e.async), n.withCredentials = e.withCredentials, n.onreadystatechange = function() {
|
if (4 == n.readyState && 200 == n.status) {
|
doui.AjaxRepeat("over", e.url);
|
var t = "";
|
n.responseText ? t = n.responseText : n.responseXML && (t = n.responseXML), doui.strToJson({
|
str: t,
|
success: function(t) {
|
var i = t;
|
if (i.code == 10001)
|
doui.loginOpen()
|
else
|
e.success(i)
|
},
|
fail: function() {
|
var i = {
|
code: 200,
|
data: t,
|
msg: "返回数据不是json格式"
|
};
|
e.fail(i)
|
}
|
})
|
} else if (4 == n.readyState) {
|
doui.AjaxRepeat("over", e.url);
|
var i = {
|
code: 404,
|
data: n.responseText,
|
msg: "无法链接,请检查网络"
|
};
|
e.fail(i)
|
}
|
}, n.send(t)
|
} else {
|
e.fail({
|
code: 400,
|
data: {},
|
msg: "上一次上传工作还未完成"
|
})
|
}
|
},
|
loginOpen: function() {
|
var topLocation=window.top.location;
|
var top=parent;
|
while(top.location!=topLocation)
|
top=top.parent;
|
top.login();
|
}
|
};
|
doui.metaAdd(), doui.windowReady(function() {
|
for (var e = document.body.childNodes, t = 0; t < e.length; t++)
|
if ("div" == e[t].localName) {
|
e[t].setAttribute("ontouchstart", "");
|
break
|
} doui.sizeSet()
|
}), window.onresize = function() {
|
doui.sizeSet()
|
};
|