初始版本
This commit is contained in:
82
statics/saas/scm/app2_release/js/common/addedServiceData.js
Executable file
82
statics/saas/scm/app2_release/js/common/addedServiceData.js
Executable file
@@ -0,0 +1,82 @@
|
||||
var addedService = [
|
||||
//{
|
||||
// name: '数据恢复',
|
||||
// nameEn: 'aqfhgj',
|
||||
// desc: '数据恢复',
|
||||
// price: 1500,
|
||||
// unit:'/帐套',
|
||||
// btnValue:'申请',
|
||||
// imgSrc: '../images/value-added-icon.png',
|
||||
// imgSrcSmall: '../images/value-added-icon-48.png',
|
||||
// imgOutStyle:'background-position:0 0;',
|
||||
// imgOutStyleSmall:'background-position:0 0;',
|
||||
// buyLink: '',
|
||||
// detailsLink: '',
|
||||
// productId: 21,
|
||||
// info: null //产品信息,包括计算后的价格、到期时间等等
|
||||
//},
|
||||
{
|
||||
name: '套打设计',
|
||||
nameEn: 'tdsj',
|
||||
desc: '套打设计',
|
||||
price: 200,
|
||||
unit:'/张',
|
||||
btnValue:'申请',
|
||||
linkType:'',
|
||||
imgSrc: '../images/value-added-icon.png',
|
||||
imgSrcSmall: '../images/value-added-icon-48.png',
|
||||
imgOutStyle:'background-position:-64px 0;',
|
||||
imgOutStyleSmall:'background-position:-48px 0;',
|
||||
buyLink: 'http://www.istheme.com/i/253',
|
||||
detailsLink: 'http://www.istheme.com/i/253',
|
||||
productId: 101807,
|
||||
info: null //产品信息,包括计算后的价格、到期时间等等
|
||||
},{
|
||||
name: '产品培训',
|
||||
nameEn: 'cppx',
|
||||
desc: '产品培训',
|
||||
price: 500,
|
||||
unit:'/次起',
|
||||
btnValue:'申请',
|
||||
linkType:'',
|
||||
imgSrc: '../images/value-added-icon.png',
|
||||
imgSrcSmall: '../images/value-added-icon-48.png',
|
||||
imgOutStyle:'background-position:-192px 0;',
|
||||
imgOutStyleSmall:'background-position:-144px 0;',
|
||||
buyLink: 'http://www.istheme.com/i/253',
|
||||
detailsLink: 'http://www.istheme.com/i/253',
|
||||
productId: 101807,
|
||||
info: null //产品信息,包括计算后的价格、到期时间等等
|
||||
},{
|
||||
name: '专属顾问服务',
|
||||
nameEn: 'zsgwfw',
|
||||
desc: '专属顾问服务',
|
||||
price: 200,
|
||||
unit:'/月起',
|
||||
btnValue:'申请',
|
||||
linkType:'',
|
||||
imgSrc: '../images/value-added-icon.png',
|
||||
imgSrcSmall: '../images/value-added-icon-48.png',
|
||||
imgOutStyle:'background-position:-256px 0;',
|
||||
buyLink: 'http://www.istheme.com/i/253',
|
||||
detailsLink: 'http://www.istheme.com/i/253',
|
||||
productId: 101807,
|
||||
info: null //产品信息,包括计算后的价格、到期时间等等
|
||||
}
|
||||
//,{
|
||||
// name: '初始化服务',
|
||||
// nameEn: 'cshfw',
|
||||
// desc: '初始化服务',
|
||||
// price: 500,
|
||||
// unit:'元/账套起',
|
||||
// btnValue:'免费',
|
||||
// linkType:'setting-advancedSetting-right',
|
||||
// imgSrc: '../images/value-added-icon.png',
|
||||
// imgSrcSmall: '../images/value-added-icon-48.png',
|
||||
// imgOutStyle:'background-position:-320px 0;',
|
||||
// buyLink: '',
|
||||
// detailsLink: '',
|
||||
// productId: 101807,
|
||||
// info: null //产品信息,包括计算后的价格、到期时间等等
|
||||
//}
|
||||
];
|
||||
3898
statics/saas/scm/app2_release/js/common/common.js
Executable file
3898
statics/saas/scm/app2_release/js/common/common.js
Executable file
File diff suppressed because it is too large
Load Diff
7
statics/saas/scm/app2_release/js/common/grid.js
Executable file
7
statics/saas/scm/app2_release/js/common/grid.js
Executable file
File diff suppressed because one or more lines are too long
9791
statics/saas/scm/app2_release/js/common/libs/jquery/jquery-1.10.2.min.js
vendored
Executable file
9791
statics/saas/scm/app2_release/js/common/libs/jquery/jquery-1.10.2.min.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
335
statics/saas/scm/app2_release/js/common/libs/json2.js
Executable file
335
statics/saas/scm/app2_release/js/common/libs/json2.js
Executable file
@@ -0,0 +1,335 @@
|
||||
!
|
||||
function() {
|
||||
function f(a, c) {
|
||||
function u(a) {
|
||||
if (u[a] !== r) return u[a];
|
||||
var b;
|
||||
if ("bug-string-char-index" == a) b = "a" != "a" [0];
|
||||
else if ("json" == a) b = u("json-stringify") && u("json-parse");
|
||||
else {
|
||||
var d, f = '{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';
|
||||
if ("json-stringify" == a) {
|
||||
var h = c.stringify,
|
||||
j = "function" == typeof h && s;
|
||||
if (j) {
|
||||
(d = function() {
|
||||
return 1
|
||||
}).toJSON = d;
|
||||
try {
|
||||
j = "0" === h(0) && "0" === h(new e) && '""' == h(new g) && h(o) === r && h(r) === r && h() === r && "1" === h(d) && "[1]" == h([d]) && "[null]" == h([r]) && "null" == h(null) && "[null,null,null]" == h([r, o, null]) && h({
|
||||
a: [d, !0, !1, null, "\0\b\n\f\r "]
|
||||
}) == f && "1" === h(null, d) && "[\n 1,\n 2\n]" == h([1, 2], null, 1) && '"-271821-04-20T00:00:00.000Z"' == h(new i(-864e13)) && '"+275760-09-13T00:00:00.000Z"' == h(new i(864e13)) && '"-000001-01-01T00:00:00.000Z"' == h(new i(-621987552e5)) && '"1969-12-31T23:59:59.999Z"' == h(new i(-1))
|
||||
} catch (k) {
|
||||
j = !1
|
||||
}
|
||||
}
|
||||
b = j
|
||||
}
|
||||
if ("json-parse" == a) {
|
||||
var l = c.parse;
|
||||
if ("function" == typeof l) try {
|
||||
if (0 === l("0") && !l(!1)) {
|
||||
d = l(f);
|
||||
var m = 5 == d.a.length && 1 === d.a[0];
|
||||
if (m) {
|
||||
try {
|
||||
m = !l('" "')
|
||||
} catch (k) {}
|
||||
if (m) try {
|
||||
m = 1 !== l("01")
|
||||
} catch (k) {}
|
||||
if (m) try {
|
||||
m = 1 !== l("1.")
|
||||
} catch (k) {}
|
||||
}
|
||||
}
|
||||
} catch (k) {
|
||||
m = !1
|
||||
}
|
||||
b = m
|
||||
}
|
||||
}
|
||||
return u[a] = !! b
|
||||
}
|
||||
a || (a = d.Object()), c || (c = d.Object());
|
||||
var p, q, r, e = a.Number || d.Number,
|
||||
g = a.String || d.String,
|
||||
h = a.Object || d.Object,
|
||||
i = a.Date || d.Date,
|
||||
j = a.SyntaxError || d.SyntaxError,
|
||||
k = a.TypeError || d.TypeError,
|
||||
l = a.Math || d.Math,
|
||||
n = (a.JSON || d.JSON, h.prototype),
|
||||
o = n.toString,
|
||||
s = new i(-0xc782b5b800cec);
|
||||
try {
|
||||
s = -109252 == s.getUTCFullYear() && 0 === s.getUTCMonth() && 1 === s.getUTCDate() && 10 == s.getUTCHours() && 37 == s.getUTCMinutes() && 6 == s.getUTCSeconds() && 708 == s.getUTCMilliseconds()
|
||||
} catch (t) {}
|
||||
if (!u("json")) {
|
||||
var v = "[object Function]",
|
||||
w = "[object Date]",
|
||||
x = "[object Number]",
|
||||
y = "[object String]",
|
||||
z = "[object Array]",
|
||||
A = "[object Boolean]",
|
||||
B = u("bug-string-char-index");
|
||||
if (!s) var C = l.floor,
|
||||
D = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],
|
||||
E = function(a, b) {
|
||||
return D[b] + 365 * (a - 1970) + C((a - 1969 + (b = +(b > 1))) / 4) - C((a - 1901 + b) / 100) + C((a - 1601 + b) / 400)
|
||||
};
|
||||
if ((p = n.hasOwnProperty) || (p = function(a) {
|
||||
var c, b = {};
|
||||
return (b.__proto__ = null, b.__proto__ = {
|
||||
toString: 1
|
||||
}, b).toString != o ? p = function(a) {
|
||||
var b = this.__proto__,
|
||||
c = (this.__proto__ = null, a in this);
|
||||
return this.__proto__ = b, c
|
||||
} : (c = b.constructor, p = function(a) {
|
||||
var b = (this.constructor || c).prototype;
|
||||
return a in this && !(a in b && this[a] === b[a])
|
||||
}), b = null, p.call(this, a)
|
||||
}), q = function(a, c) {
|
||||
var e, f, g, d = 0;
|
||||
(e = function() {
|
||||
this.valueOf = 0
|
||||
}).prototype.valueOf = 0, f = new e;
|
||||
for (g in f) p.call(f, g) && d++;
|
||||
return e = f = null, d ? q = 2 == d ?
|
||||
function(a, b) {
|
||||
var e, c = {},
|
||||
d = o.call(a) == v;
|
||||
for (e in a) d && "prototype" == e || p.call(c, e) || !(c[e] = 1) || !p.call(a, e) || b(e)
|
||||
} : function(a, b) {
|
||||
var d, e, c = o.call(a) == v;
|
||||
for (d in a) c && "prototype" == d || !p.call(a, d) || (e = "constructor" === d) || b(d);
|
||||
(e || p.call(a, d = "constructor")) && b(d)
|
||||
} : (f = ["valueOf", "toString", "toLocaleString", "propertyIsEnumerable", "isPrototypeOf", "hasOwnProperty", "constructor"], q = function(a, c) {
|
||||
var e, g, d = o.call(a) == v,
|
||||
h = !d && "function" != typeof a.constructor && b[typeof a.hasOwnProperty] && a.hasOwnProperty || p;
|
||||
for (e in a) d && "prototype" == e || !h.call(a, e) || c(e);
|
||||
for (g = f.length; e = f[--g]; h.call(a, e) && c(e));
|
||||
}), q(a, c)
|
||||
}, !u("json-stringify")) {
|
||||
var F = {
|
||||
92: "\\\\",
|
||||
34: '\\"',
|
||||
8: "\\b",
|
||||
12: "\\f",
|
||||
10: "\\n",
|
||||
13: "\\r",
|
||||
9: "\\t"
|
||||
},
|
||||
G = "000000",
|
||||
H = function(a, b) {
|
||||
return (G + (b || 0)).slice(-a)
|
||||
},
|
||||
I = "\\u00",
|
||||
J = function(a) {
|
||||
for (var b = '"', c = 0, d = a.length, e = !B || d > 10, f = e && (B ? a.split("") : a); d > c; c++) {
|
||||
var g = a.charCodeAt(c);
|
||||
switch (g) {
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 12:
|
||||
case 13:
|
||||
case 34:
|
||||
case 92:
|
||||
b += F[g];
|
||||
break;
|
||||
default:
|
||||
if (32 > g) {
|
||||
b += I + H(2, g.toString(16));
|
||||
break
|
||||
}
|
||||
b += e ? f[c] : a.charAt(c)
|
||||
}
|
||||
}
|
||||
return b + '"'
|
||||
},
|
||||
K = function(a, b, c, d, e, f, g) {
|
||||
var h, i, j, l, m, n, s, t, u, v, B, D, F, G, I, L;
|
||||
try {
|
||||
h = b[a]
|
||||
} catch (M) {}
|
||||
if ("object" == typeof h && h) if (i = o.call(h), i != w || p.call(h, "toJSON"))"function" == typeof h.toJSON && (i != x && i != y && i != z || p.call(h, "toJSON")) && (h = h.toJSON(a));
|
||||
else if (h > -1 / 0 && 1 / 0 > h) {
|
||||
if (E) {
|
||||
for (m = C(h / 864e5), j = C(m / 365.2425) + 1970 - 1; E(j + 1, 0) <= m; j++);
|
||||
for (l = C((m - E(j, 0)) / 30.42); E(j, l + 1) <= m; l++);
|
||||
m = 1 + m - E(j, l), n = (h % 864e5 + 864e5) % 864e5, s = C(n / 36e5) % 24, t = C(n / 6e4) % 60, u = C(n / 1e3) % 60, v = n % 1e3
|
||||
} else j = h.getUTCFullYear(), l = h.getUTCMonth(), m = h.getUTCDate(), s = h.getUTCHours(), t = h.getUTCMinutes(), u = h.getUTCSeconds(), v = h.getUTCMilliseconds();
|
||||
h = (0 >= j || j >= 1e4 ? (0 > j ? "-" : "+") + H(6, 0 > j ? -j : j) : H(4, j)) + "-" + H(2, l + 1) + "-" + H(2, m) + "T" + H(2, s) + ":" + H(2, t) + ":" + H(2, u) + "." + H(3, v) + "Z"
|
||||
} else h = null;
|
||||
if (c && (h = c.call(b, a, h)), null === h) return "null";
|
||||
if (i = o.call(h), i == A) return "" + h;
|
||||
if (i == x) return h > -1 / 0 && 1 / 0 > h ? "" + h : "null";
|
||||
if (i == y) return J("" + h);
|
||||
if ("object" == typeof h) {
|
||||
for (G = g.length; G--;) if (g[G] === h) throw k();
|
||||
if (g.push(h), B = [], I = f, f += e, i == z) {
|
||||
for (F = 0, G = h.length; G > F; F++) D = K(F, h, c, d, e, f, g), B.push(D === r ? "null" : D);
|
||||
L = B.length ? e ? "[\n" + f + B.join(",\n" + f) + "\n" + I + "]" : "[" + B.join(",") + "]" : "[]"
|
||||
} else q(d || h, function(a) {
|
||||
var b = K(a, h, c, d, e, f, g);
|
||||
b !== r && B.push(J(a) + ":" + (e ? " " : "") + b)
|
||||
}), L = B.length ? e ? "{\n" + f + B.join(",\n" + f) + "\n" + I + "}" : "{" + B.join(",") + "}" : "{}";
|
||||
return g.pop(), L
|
||||
}
|
||||
};
|
||||
c.stringify = function(a, c, d) {
|
||||
var e, f, g, h;
|
||||
if (b[typeof c] && c) if ((h = o.call(c)) == v) f = c;
|
||||
else if (h == z) {
|
||||
g = {};
|
||||
for (var k, i = 0, j = c.length; j > i; k = c[i++], h = o.call(k), (h == y || h == x) && (g[k] = 1));
|
||||
}
|
||||
if (d) if ((h = o.call(d)) == x) {
|
||||
if ((d -= d % 1) > 0) for (e = "", d > 10 && (d = 10); e.length < d; e += " ");
|
||||
} else h == y && (e = d.length <= 10 ? d : d.slice(0, 10));
|
||||
return K("", (k = {}, k[""] = a, k), f, g, e, "", [])
|
||||
}
|
||||
}
|
||||
if (!u("json-parse")) {
|
||||
var N, O, L = g.fromCharCode,
|
||||
M = {
|
||||
92: "\\",
|
||||
34: '"',
|
||||
47: "/",
|
||||
98: "\b",
|
||||
116: " ",
|
||||
110: "\n",
|
||||
102: "\f",
|
||||
114: "\r"
|
||||
},
|
||||
P = function() {
|
||||
throw N = O = null, j()
|
||||
},
|
||||
Q = function() {
|
||||
for (var c, d, e, f, g, a = O, b = a.length; b > N;) switch (g = a.charCodeAt(N)) {
|
||||
case 9:
|
||||
case 10:
|
||||
case 13:
|
||||
case 32:
|
||||
N++;
|
||||
break;
|
||||
case 123:
|
||||
case 125:
|
||||
case 91:
|
||||
case 93:
|
||||
case 58:
|
||||
case 44:
|
||||
return c = B ? a.charAt(N) : a[N], N++, c;
|
||||
case 34:
|
||||
for (c = "@", N++; b > N;) if (g = a.charCodeAt(N), 32 > g) P();
|
||||
else if (92 == g) switch (g = a.charCodeAt(++N)) {
|
||||
case 92:
|
||||
case 34:
|
||||
case 47:
|
||||
case 98:
|
||||
case 116:
|
||||
case 110:
|
||||
case 102:
|
||||
case 114:
|
||||
c += M[g], N++;
|
||||
break;
|
||||
case 117:
|
||||
for (d = ++N, e = N + 4; e > N; N++) g = a.charCodeAt(N), g >= 48 && 57 >= g || g >= 97 && 102 >= g || g >= 65 && 70 >= g || P();
|
||||
c += L("0x" + a.slice(d, N));
|
||||
break;
|
||||
default:
|
||||
P()
|
||||
} else {
|
||||
if (34 == g) break;
|
||||
for (g = a.charCodeAt(N), d = N; g >= 32 && 92 != g && 34 != g;) g = a.charCodeAt(++N);
|
||||
c += a.slice(d, N)
|
||||
}
|
||||
if (34 == a.charCodeAt(N)) return N++, c;
|
||||
P();
|
||||
default:
|
||||
if (d = N, 45 == g && (f = !0, g = a.charCodeAt(++N)), g >= 48 && 57 >= g) {
|
||||
for (48 == g && (g = a.charCodeAt(N + 1), g >= 48 && 57 >= g) && P(), f = !1; b > N && (g = a.charCodeAt(N), g >= 48 && 57 >= g); N++);
|
||||
if (46 == a.charCodeAt(N)) {
|
||||
for (e = ++N; b > e && (g = a.charCodeAt(e), g >= 48 && 57 >= g); e++);
|
||||
e == N && P(), N = e
|
||||
}
|
||||
if (g = a.charCodeAt(N), 101 == g || 69 == g) {
|
||||
for (g = a.charCodeAt(++N), (43 == g || 45 == g) && N++, e = N; b > e && (g = a.charCodeAt(e), g >= 48 && 57 >= g); e++);
|
||||
e == N && P(), N = e
|
||||
}
|
||||
var h = a.slice(d, N),
|
||||
i = +h;
|
||||
return h !== i + "" ? "@" + h : i
|
||||
}
|
||||
if (f && P(), "true" == a.slice(N, N + 4)) return N += 4, !0;
|
||||
if ("false" == a.slice(N, N + 5)) return N += 5, !1;
|
||||
if ("null" == a.slice(N, N + 4)) return N += 4, null;
|
||||
P()
|
||||
}
|
||||
return "$"
|
||||
},
|
||||
R = function(a) {
|
||||
var b, c;
|
||||
if ("$" == a && P(), "string" == typeof a) {
|
||||
if ("@" == (B ? a.charAt(0) : a[0])) return a.slice(1);
|
||||
if ("[" == a) {
|
||||
for (b = []; a = Q(), "]" != a; c || (c = !0)) c && ("," == a ? (a = Q(), "]" == a && P()) : P()), "," == a && P(), b.push(R(a));
|
||||
return b
|
||||
}
|
||||
if ("{" == a) {
|
||||
for (b = {}; a = Q(), "}" != a; c || (c = !0)) c && ("," == a ? (a = Q(), "}" == a && P()) : P()), ("," == a || "string" != typeof a || "@" != (B ? a.charAt(0) : a[0]) || ":" != Q()) && P(), b[a.slice(1)] = R(Q());
|
||||
return b
|
||||
}
|
||||
P()
|
||||
}
|
||||
return a
|
||||
},
|
||||
S = function(a, b, c) {
|
||||
var d = T(a, b, c);
|
||||
d === r ? delete a[b] : a[b] = d
|
||||
},
|
||||
T = function(a, b, c) {
|
||||
var e, d = a[b];
|
||||
if ("object" == typeof d && d) if (o.call(d) == z) for (e = d.length; e--;) S(d, e, c);
|
||||
else q(d, function(a) {
|
||||
S(d, a, c)
|
||||
});
|
||||
return c.call(a, b, d)
|
||||
};
|
||||
c.parse = function(a, b) {
|
||||
var c, d;
|
||||
return N = 0, O = "" + a, c = R(Q()), "$" != Q() && P(), N = O = null, b && o.call(b) == v ? T((d = {}, d[""] = c, d), "", b) : c
|
||||
}
|
||||
}
|
||||
}
|
||||
return c.runInContext = f, c
|
||||
}
|
||||
var a = "function" == typeof define && define.amd,
|
||||
b = {
|
||||
"function": !0,
|
||||
object: !0
|
||||
},
|
||||
c = b[typeof exports] && exports && !exports.nodeType && exports,
|
||||
d = b[typeof window] && window || this,
|
||||
e = c && b[typeof module] && module && !module.nodeType && "object" == typeof global && global;
|
||||
if (!e || e.global !== e && e.window !== e && e.self !== e || (d = e), c && !a) f(d, c);
|
||||
else {
|
||||
var g = d.JSON,
|
||||
h = d.JSON3,
|
||||
i = !1,
|
||||
j = f(d, d.JSON3 = {
|
||||
noConflict: function() {
|
||||
return i || (i = !0, d.JSON = g, d.JSON3 = h, g = h = null), j
|
||||
}
|
||||
});
|
||||
d.JSON = {
|
||||
parse: j.parse,
|
||||
stringify: j.stringify
|
||||
}
|
||||
}
|
||||
a && define(function() {
|
||||
return j
|
||||
})
|
||||
}.call(this);
|
||||
1
statics/saas/scm/app2_release/js/common/libs/json3.min.js
vendored
Executable file
1
statics/saas/scm/app2_release/js/common/libs/json3.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
4
statics/saas/scm/app2_release/js/common/plugins.js
Executable file
4
statics/saas/scm/app2_release/js/common/plugins.js
Executable file
File diff suppressed because one or more lines are too long
1442
statics/saas/scm/app2_release/js/common/plugins/fileupload/js/jquery.fileupload.js
vendored
Executable file
1442
statics/saas/scm/app2_release/js/common/plugins/fileupload/js/jquery.fileupload.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,225 @@
|
||||
/*
|
||||
* jQuery Iframe Transport Plugin 1.8.2
|
||||
* https://github.com/blueimp/jQuery-File-Upload
|
||||
*
|
||||
* Copyright 2011, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* http://www.opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define, window, document */
|
||||
|
||||
(function (factory) {
|
||||
'use strict';
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// Register as an anonymous AMD module:
|
||||
define(['jquery'], factory);
|
||||
} else {
|
||||
// Browser globals:
|
||||
factory(window.jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
'use strict';
|
||||
|
||||
// Helper variable to create unique names for the transport iframes:
|
||||
var counter = 0;
|
||||
|
||||
// The iframe transport accepts four additional options:
|
||||
// options.fileInput: a jQuery collection of file input fields
|
||||
// options.paramName: the parameter name for the file form data,
|
||||
// overrides the name property of the file input field(s),
|
||||
// can be a string or an array of strings.
|
||||
// options.formData: an array of objects with name and value properties,
|
||||
// equivalent to the return data of .serializeArray(), e.g.:
|
||||
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
|
||||
// options.initialIframeSrc: the URL of the initial iframe src,
|
||||
// by default set to "javascript:false;"
|
||||
$.ajaxTransport('iframe', function (options) {
|
||||
if (options.async) {
|
||||
// javascript:false as initial iframe src
|
||||
// prevents warning popups on HTTPS in IE6:
|
||||
/*jshint scripturl: true */
|
||||
var initialIframeSrc = options.initialIframeSrc || 'javascript:false;',
|
||||
/*jshint scripturl: false */
|
||||
form,
|
||||
iframe,
|
||||
addParamChar;
|
||||
return {
|
||||
send: function (_, completeCallback) {
|
||||
form = $('<form style="display:none;"></form>');
|
||||
form.attr('accept-charset', options.formAcceptCharset);
|
||||
addParamChar = /\?/.test(options.url) ? '&' : '?';
|
||||
// XDomainRequest only supports GET and POST:
|
||||
if (options.type === 'DELETE') {
|
||||
options.url = options.url + addParamChar + '_method=DELETE';
|
||||
options.type = 'POST';
|
||||
} else if (options.type === 'PUT') {
|
||||
options.url = options.url + addParamChar + '_method=PUT';
|
||||
options.type = 'POST';
|
||||
} else if (options.type === 'PATCH') {
|
||||
options.url = options.url + addParamChar + '_method=PATCH';
|
||||
options.type = 'POST';
|
||||
}
|
||||
// IE versions below IE8 cannot set the name property of
|
||||
// elements that have already been added to the DOM,
|
||||
// so we set the name along with the iframe HTML markup:
|
||||
counter += 1;
|
||||
iframe = $(
|
||||
'<iframe src="' + initialIframeSrc +
|
||||
'" name="iframe-transport-' + counter + '"></iframe>'
|
||||
).bind('load', function () {
|
||||
var fileInputClones,
|
||||
paramNames = $.isArray(options.paramName) ?
|
||||
options.paramName : [options.paramName];
|
||||
iframe
|
||||
.unbind('load')
|
||||
.bind('load', function () {
|
||||
var response;
|
||||
// Wrap in a try/catch block to catch exceptions thrown
|
||||
// when trying to access cross-domain iframe contents:
|
||||
try {
|
||||
response = iframe.contents();
|
||||
// Google Chrome and Firefox do not throw an
|
||||
// exception when calling iframe.contents() on
|
||||
// cross-domain requests, so we unify the response:
|
||||
if (!response.length || !response[0].firstChild) {
|
||||
throw new Error();
|
||||
}
|
||||
} catch (e) {
|
||||
try {
|
||||
response = $(iframe[0].document);
|
||||
// Google Chrome and Firefox do not throw an
|
||||
// exception when calling iframe.contents() on
|
||||
// cross-domain requests, so we unify the response:
|
||||
if (!response.length || !response[0].firstChild) {
|
||||
throw new Error();
|
||||
}
|
||||
}catch(x){
|
||||
throw new Error(x);
|
||||
response = undefined;
|
||||
}
|
||||
}
|
||||
// The complete callback returns the
|
||||
// iframe content document as response object:
|
||||
completeCallback(
|
||||
200,
|
||||
'success',
|
||||
{'iframe': response}
|
||||
);
|
||||
// Fix for IE endless progress bar activity bug
|
||||
// (happens on form submits to iframe targets):
|
||||
$('<iframe src="' + initialIframeSrc + '"></iframe>')
|
||||
.appendTo(form);
|
||||
window.setTimeout(function () {
|
||||
// Removing the form in a setTimeout call
|
||||
// allows Chrome's developer tools to display
|
||||
// the response result
|
||||
form.remove();
|
||||
}, 0);
|
||||
});
|
||||
form
|
||||
.prop('target', iframe.prop('name'))
|
||||
.prop('action', options.url)
|
||||
.prop('method', options.type);
|
||||
if (options.formData) {
|
||||
$.each(options.formData, function (index, field) {
|
||||
$('<input type="hidden"/>')
|
||||
.prop('name', field.name)
|
||||
.val(field.value)
|
||||
.appendTo(form);
|
||||
});
|
||||
}
|
||||
if (options.fileInput && options.fileInput.length &&
|
||||
options.type === 'POST') {
|
||||
fileInputClones = options.fileInput.clone();
|
||||
// Insert a clone for each file input field:
|
||||
options.fileInput.after(function (index) {
|
||||
return fileInputClones[index];
|
||||
});
|
||||
if (options.paramName) {
|
||||
options.fileInput.each(function (index) {
|
||||
$(this).prop(
|
||||
'name',
|
||||
paramNames[index] || options.paramName
|
||||
);
|
||||
});
|
||||
}
|
||||
// Appending the file input fields to the hidden form
|
||||
// removes them from their original location:
|
||||
form
|
||||
.append(options.fileInput)
|
||||
.prop('enctype', 'multipart/form-data')
|
||||
// enctype must be set as encoding for IE:
|
||||
.prop('encoding', 'multipart/form-data');
|
||||
// Remove the HTML5 form attribute from the input(s):
|
||||
options.fileInput.removeAttr('form');
|
||||
}
|
||||
form.submit();
|
||||
// Insert the file input fields at their original location
|
||||
// by replacing the clones with the originals:
|
||||
if (fileInputClones && fileInputClones.length) {
|
||||
options.fileInput.each(function (index, input) {
|
||||
var clone = $(fileInputClones[index]);
|
||||
// Restore the original name and form properties:
|
||||
$(input)
|
||||
.prop('name', clone.prop('name'))
|
||||
.attr('form', clone.attr('form'));
|
||||
clone.replaceWith(input);
|
||||
});
|
||||
}
|
||||
});
|
||||
form.append(iframe).appendTo(document.body);
|
||||
},
|
||||
abort: function () {
|
||||
if (iframe) {
|
||||
// javascript:false as iframe src aborts the request
|
||||
// and prevents warning popups on HTTPS in IE6.
|
||||
// concat is used to avoid the "Script URL" JSLint error:
|
||||
iframe
|
||||
.unbind('load')
|
||||
.prop('src', initialIframeSrc);
|
||||
}
|
||||
if (form) {
|
||||
form.remove();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// The iframe transport returns the iframe content document as response.
|
||||
// The following adds converters from iframe to text, json, html, xml
|
||||
// and script.
|
||||
// Please note that the Content-Type for JSON responses has to be text/plain
|
||||
// or text/html, if the browser doesn't include application/json in the
|
||||
// Accept header, else IE will show a download dialog.
|
||||
// The Content-Type for XML responses on the other hand has to be always
|
||||
// application/xml or text/xml, so IE properly parses the XML response.
|
||||
// See also
|
||||
// https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation
|
||||
$.ajaxSetup({
|
||||
converters: {
|
||||
'iframe text': function (iframe) {
|
||||
return iframe && $(iframe[0].body).text();
|
||||
},
|
||||
'iframe json': function (iframe) {
|
||||
return iframe && $.parseJSON($(iframe[0].body).text());
|
||||
},
|
||||
'iframe html': function (iframe) {
|
||||
return iframe && $(iframe[0].body).html();
|
||||
},
|
||||
'iframe xml': function (iframe) {
|
||||
var xmlDoc = iframe && iframe[0];
|
||||
return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc :
|
||||
$.parseXML((xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) ||
|
||||
$(xmlDoc.body).html());
|
||||
},
|
||||
'iframe script': function (iframe) {
|
||||
return iframe && $.globalEval($(iframe[0].body).text());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}));
|
||||
530
statics/saas/scm/app2_release/js/common/plugins/fileupload/js/vendor/jquery.ui.widget.js
vendored
Executable file
530
statics/saas/scm/app2_release/js/common/plugins/fileupload/js/vendor/jquery.ui.widget.js
vendored
Executable file
@@ -0,0 +1,530 @@
|
||||
/*!
|
||||
* jQuery UI Widget 1.10.4+amd
|
||||
* https://github.com/blueimp/jQuery-File-Upload
|
||||
*
|
||||
* Copyright 2014 jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://api.jqueryui.com/jQuery.widget/
|
||||
*/
|
||||
|
||||
(function (factory) {
|
||||
if (typeof define === "function" && define.amd) {
|
||||
// Register as an anonymous AMD module:
|
||||
define(["jquery"], factory);
|
||||
} else {
|
||||
// Browser globals:
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function( $, undefined ) {
|
||||
|
||||
var uuid = 0,
|
||||
slice = Array.prototype.slice,
|
||||
_cleanData = $.cleanData;
|
||||
$.cleanData = function( elems ) {
|
||||
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
|
||||
try {
|
||||
$( elem ).triggerHandler( "remove" );
|
||||
// http://bugs.jquery.com/ticket/8235
|
||||
} catch( e ) {}
|
||||
}
|
||||
_cleanData( elems );
|
||||
};
|
||||
|
||||
$.widget = function( name, base, prototype ) {
|
||||
var fullName, existingConstructor, constructor, basePrototype,
|
||||
// proxiedPrototype allows the provided prototype to remain unmodified
|
||||
// so that it can be used as a mixin for multiple widgets (#8876)
|
||||
proxiedPrototype = {},
|
||||
namespace = name.split( "." )[ 0 ];
|
||||
|
||||
name = name.split( "." )[ 1 ];
|
||||
fullName = namespace + "-" + name;
|
||||
|
||||
if ( !prototype ) {
|
||||
prototype = base;
|
||||
base = $.Widget;
|
||||
}
|
||||
|
||||
// create selector for plugin
|
||||
$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
|
||||
return !!$.data( elem, fullName );
|
||||
};
|
||||
|
||||
$[ namespace ] = $[ namespace ] || {};
|
||||
existingConstructor = $[ namespace ][ name ];
|
||||
constructor = $[ namespace ][ name ] = function( options, element ) {
|
||||
// allow instantiation without "new" keyword
|
||||
if ( !this._createWidget ) {
|
||||
return new constructor( options, element );
|
||||
}
|
||||
|
||||
// allow instantiation without initializing for simple inheritance
|
||||
// must use "new" keyword (the code above always passes args)
|
||||
if ( arguments.length ) {
|
||||
this._createWidget( options, element );
|
||||
}
|
||||
};
|
||||
// extend with the existing constructor to carry over any static properties
|
||||
$.extend( constructor, existingConstructor, {
|
||||
version: prototype.version,
|
||||
// copy the object used to create the prototype in case we need to
|
||||
// redefine the widget later
|
||||
_proto: $.extend( {}, prototype ),
|
||||
// track widgets that inherit from this widget in case this widget is
|
||||
// redefined after a widget inherits from it
|
||||
_childConstructors: []
|
||||
});
|
||||
|
||||
basePrototype = new base();
|
||||
// we need to make the options hash a property directly on the new instance
|
||||
// otherwise we'll modify the options hash on the prototype that we're
|
||||
// inheriting from
|
||||
basePrototype.options = $.widget.extend( {}, basePrototype.options );
|
||||
$.each( prototype, function( prop, value ) {
|
||||
if ( !$.isFunction( value ) ) {
|
||||
proxiedPrototype[ prop ] = value;
|
||||
return;
|
||||
}
|
||||
proxiedPrototype[ prop ] = (function() {
|
||||
var _super = function() {
|
||||
return base.prototype[ prop ].apply( this, arguments );
|
||||
},
|
||||
_superApply = function( args ) {
|
||||
return base.prototype[ prop ].apply( this, args );
|
||||
};
|
||||
return function() {
|
||||
var __super = this._super,
|
||||
__superApply = this._superApply,
|
||||
returnValue;
|
||||
|
||||
this._super = _super;
|
||||
this._superApply = _superApply;
|
||||
|
||||
returnValue = value.apply( this, arguments );
|
||||
|
||||
this._super = __super;
|
||||
this._superApply = __superApply;
|
||||
|
||||
return returnValue;
|
||||
};
|
||||
})();
|
||||
});
|
||||
constructor.prototype = $.widget.extend( basePrototype, {
|
||||
// TODO: remove support for widgetEventPrefix
|
||||
// always use the name + a colon as the prefix, e.g., draggable:start
|
||||
// don't prefix for widgets that aren't DOM-based
|
||||
widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
|
||||
}, proxiedPrototype, {
|
||||
constructor: constructor,
|
||||
namespace: namespace,
|
||||
widgetName: name,
|
||||
widgetFullName: fullName
|
||||
});
|
||||
|
||||
// If this widget is being redefined then we need to find all widgets that
|
||||
// are inheriting from it and redefine all of them so that they inherit from
|
||||
// the new version of this widget. We're essentially trying to replace one
|
||||
// level in the prototype chain.
|
||||
if ( existingConstructor ) {
|
||||
$.each( existingConstructor._childConstructors, function( i, child ) {
|
||||
var childPrototype = child.prototype;
|
||||
|
||||
// redefine the child widget using the same prototype that was
|
||||
// originally used, but inherit from the new version of the base
|
||||
$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
|
||||
});
|
||||
// remove the list of existing child constructors from the old constructor
|
||||
// so the old child constructors can be garbage collected
|
||||
delete existingConstructor._childConstructors;
|
||||
} else {
|
||||
base._childConstructors.push( constructor );
|
||||
}
|
||||
|
||||
$.widget.bridge( name, constructor );
|
||||
};
|
||||
|
||||
$.widget.extend = function( target ) {
|
||||
var input = slice.call( arguments, 1 ),
|
||||
inputIndex = 0,
|
||||
inputLength = input.length,
|
||||
key,
|
||||
value;
|
||||
for ( ; inputIndex < inputLength; inputIndex++ ) {
|
||||
for ( key in input[ inputIndex ] ) {
|
||||
value = input[ inputIndex ][ key ];
|
||||
if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
|
||||
// Clone objects
|
||||
if ( $.isPlainObject( value ) ) {
|
||||
target[ key ] = $.isPlainObject( target[ key ] ) ?
|
||||
$.widget.extend( {}, target[ key ], value ) :
|
||||
// Don't extend strings, arrays, etc. with objects
|
||||
$.widget.extend( {}, value );
|
||||
// Copy everything else by reference
|
||||
} else {
|
||||
target[ key ] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return target;
|
||||
};
|
||||
|
||||
$.widget.bridge = function( name, object ) {
|
||||
var fullName = object.prototype.widgetFullName || name;
|
||||
$.fn[ name ] = function( options ) {
|
||||
var isMethodCall = typeof options === "string",
|
||||
args = slice.call( arguments, 1 ),
|
||||
returnValue = this;
|
||||
|
||||
// allow multiple hashes to be passed on init
|
||||
options = !isMethodCall && args.length ?
|
||||
$.widget.extend.apply( null, [ options ].concat(args) ) :
|
||||
options;
|
||||
|
||||
if ( isMethodCall ) {
|
||||
this.each(function() {
|
||||
var methodValue,
|
||||
instance = $.data( this, fullName );
|
||||
if ( !instance ) {
|
||||
return $.error( "cannot call methods on " + name + " prior to initialization; " +
|
||||
"attempted to call method '" + options + "'" );
|
||||
}
|
||||
if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
|
||||
return $.error( "no such method '" + options + "' for " + name + " widget instance" );
|
||||
}
|
||||
methodValue = instance[ options ].apply( instance, args );
|
||||
if ( methodValue !== instance && methodValue !== undefined ) {
|
||||
returnValue = methodValue && methodValue.jquery ?
|
||||
returnValue.pushStack( methodValue.get() ) :
|
||||
methodValue;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.each(function() {
|
||||
var instance = $.data( this, fullName );
|
||||
if ( instance ) {
|
||||
instance.option( options || {} )._init();
|
||||
} else {
|
||||
$.data( this, fullName, new object( options, this ) );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
};
|
||||
};
|
||||
|
||||
$.Widget = function( /* options, element */ ) {};
|
||||
$.Widget._childConstructors = [];
|
||||
|
||||
$.Widget.prototype = {
|
||||
widgetName: "widget",
|
||||
widgetEventPrefix: "",
|
||||
defaultElement: "<div>",
|
||||
options: {
|
||||
disabled: false,
|
||||
|
||||
// callbacks
|
||||
create: null
|
||||
},
|
||||
_createWidget: function( options, element ) {
|
||||
element = $( element || this.defaultElement || this )[ 0 ];
|
||||
this.element = $( element );
|
||||
this.uuid = uuid++;
|
||||
this.eventNamespace = "." + this.widgetName + this.uuid;
|
||||
this.options = $.widget.extend( {},
|
||||
this.options,
|
||||
this._getCreateOptions(),
|
||||
options );
|
||||
|
||||
this.bindings = $();
|
||||
this.hoverable = $();
|
||||
this.focusable = $();
|
||||
|
||||
if ( element !== this ) {
|
||||
$.data( element, this.widgetFullName, this );
|
||||
this._on( true, this.element, {
|
||||
remove: function( event ) {
|
||||
if ( event.target === element ) {
|
||||
this.destroy();
|
||||
}
|
||||
}
|
||||
});
|
||||
this.document = $( element.style ?
|
||||
// element within the document
|
||||
element.ownerDocument :
|
||||
// element is window or document
|
||||
element.document || element );
|
||||
this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
|
||||
}
|
||||
|
||||
this._create();
|
||||
this._trigger( "create", null, this._getCreateEventData() );
|
||||
this._init();
|
||||
},
|
||||
_getCreateOptions: $.noop,
|
||||
_getCreateEventData: $.noop,
|
||||
_create: $.noop,
|
||||
_init: $.noop,
|
||||
|
||||
destroy: function() {
|
||||
this._destroy();
|
||||
// we can probably remove the unbind calls in 2.0
|
||||
// all event bindings should go through this._on()
|
||||
this.element
|
||||
.unbind( this.eventNamespace )
|
||||
// 1.9 BC for #7810
|
||||
// TODO remove dual storage
|
||||
.removeData( this.widgetName )
|
||||
.removeData( this.widgetFullName )
|
||||
// support: jquery <1.6.3
|
||||
// http://bugs.jquery.com/ticket/9413
|
||||
.removeData( $.camelCase( this.widgetFullName ) );
|
||||
this.widget()
|
||||
.unbind( this.eventNamespace )
|
||||
.removeAttr( "aria-disabled" )
|
||||
.removeClass(
|
||||
this.widgetFullName + "-disabled " +
|
||||
"ui-state-disabled" );
|
||||
|
||||
// clean up events and states
|
||||
this.bindings.unbind( this.eventNamespace );
|
||||
this.hoverable.removeClass( "ui-state-hover" );
|
||||
this.focusable.removeClass( "ui-state-focus" );
|
||||
},
|
||||
_destroy: $.noop,
|
||||
|
||||
widget: function() {
|
||||
return this.element;
|
||||
},
|
||||
|
||||
option: function( key, value ) {
|
||||
var options = key,
|
||||
parts,
|
||||
curOption,
|
||||
i;
|
||||
|
||||
if ( arguments.length === 0 ) {
|
||||
// don't return a reference to the internal hash
|
||||
return $.widget.extend( {}, this.options );
|
||||
}
|
||||
|
||||
if ( typeof key === "string" ) {
|
||||
// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
|
||||
options = {};
|
||||
parts = key.split( "." );
|
||||
key = parts.shift();
|
||||
if ( parts.length ) {
|
||||
curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
|
||||
for ( i = 0; i < parts.length - 1; i++ ) {
|
||||
curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
|
||||
curOption = curOption[ parts[ i ] ];
|
||||
}
|
||||
key = parts.pop();
|
||||
if ( arguments.length === 1 ) {
|
||||
return curOption[ key ] === undefined ? null : curOption[ key ];
|
||||
}
|
||||
curOption[ key ] = value;
|
||||
} else {
|
||||
if ( arguments.length === 1 ) {
|
||||
return this.options[ key ] === undefined ? null : this.options[ key ];
|
||||
}
|
||||
options[ key ] = value;
|
||||
}
|
||||
}
|
||||
|
||||
this._setOptions( options );
|
||||
|
||||
return this;
|
||||
},
|
||||
_setOptions: function( options ) {
|
||||
var key;
|
||||
|
||||
for ( key in options ) {
|
||||
this._setOption( key, options[ key ] );
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
_setOption: function( key, value ) {
|
||||
this.options[ key ] = value;
|
||||
|
||||
if ( key === "disabled" ) {
|
||||
this.widget()
|
||||
.toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value )
|
||||
.attr( "aria-disabled", value );
|
||||
this.hoverable.removeClass( "ui-state-hover" );
|
||||
this.focusable.removeClass( "ui-state-focus" );
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
enable: function() {
|
||||
return this._setOption( "disabled", false );
|
||||
},
|
||||
disable: function() {
|
||||
return this._setOption( "disabled", true );
|
||||
},
|
||||
|
||||
_on: function( suppressDisabledCheck, element, handlers ) {
|
||||
var delegateElement,
|
||||
instance = this;
|
||||
|
||||
// no suppressDisabledCheck flag, shuffle arguments
|
||||
if ( typeof suppressDisabledCheck !== "boolean" ) {
|
||||
handlers = element;
|
||||
element = suppressDisabledCheck;
|
||||
suppressDisabledCheck = false;
|
||||
}
|
||||
|
||||
// no element argument, shuffle and use this.element
|
||||
if ( !handlers ) {
|
||||
handlers = element;
|
||||
element = this.element;
|
||||
delegateElement = this.widget();
|
||||
} else {
|
||||
// accept selectors, DOM elements
|
||||
element = delegateElement = $( element );
|
||||
this.bindings = this.bindings.add( element );
|
||||
}
|
||||
|
||||
$.each( handlers, function( event, handler ) {
|
||||
function handlerProxy() {
|
||||
// allow widgets to customize the disabled handling
|
||||
// - disabled as an array instead of boolean
|
||||
// - disabled class as method for disabling individual parts
|
||||
if ( !suppressDisabledCheck &&
|
||||
( instance.options.disabled === true ||
|
||||
$( this ).hasClass( "ui-state-disabled" ) ) ) {
|
||||
return;
|
||||
}
|
||||
return ( typeof handler === "string" ? instance[ handler ] : handler )
|
||||
.apply( instance, arguments );
|
||||
}
|
||||
|
||||
// copy the guid so direct unbinding works
|
||||
if ( typeof handler !== "string" ) {
|
||||
handlerProxy.guid = handler.guid =
|
||||
handler.guid || handlerProxy.guid || $.guid++;
|
||||
}
|
||||
|
||||
var match = event.match( /^(\w+)\s*(.*)$/ ),
|
||||
eventName = match[1] + instance.eventNamespace,
|
||||
selector = match[2];
|
||||
if ( selector ) {
|
||||
delegateElement.delegate( selector, eventName, handlerProxy );
|
||||
} else {
|
||||
element.bind( eventName, handlerProxy );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
_off: function( element, eventName ) {
|
||||
eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
|
||||
element.unbind( eventName ).undelegate( eventName );
|
||||
},
|
||||
|
||||
_delay: function( handler, delay ) {
|
||||
function handlerProxy() {
|
||||
return ( typeof handler === "string" ? instance[ handler ] : handler )
|
||||
.apply( instance, arguments );
|
||||
}
|
||||
var instance = this;
|
||||
return setTimeout( handlerProxy, delay || 0 );
|
||||
},
|
||||
|
||||
_hoverable: function( element ) {
|
||||
this.hoverable = this.hoverable.add( element );
|
||||
this._on( element, {
|
||||
mouseenter: function( event ) {
|
||||
$( event.currentTarget ).addClass( "ui-state-hover" );
|
||||
},
|
||||
mouseleave: function( event ) {
|
||||
$( event.currentTarget ).removeClass( "ui-state-hover" );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
_focusable: function( element ) {
|
||||
this.focusable = this.focusable.add( element );
|
||||
this._on( element, {
|
||||
focusin: function( event ) {
|
||||
$( event.currentTarget ).addClass( "ui-state-focus" );
|
||||
},
|
||||
focusout: function( event ) {
|
||||
$( event.currentTarget ).removeClass( "ui-state-focus" );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
_trigger: function( type, event, data ) {
|
||||
var prop, orig,
|
||||
callback = this.options[ type ];
|
||||
|
||||
data = data || {};
|
||||
event = $.Event( event );
|
||||
event.type = ( type === this.widgetEventPrefix ?
|
||||
type :
|
||||
this.widgetEventPrefix + type ).toLowerCase();
|
||||
// the original event may come from any element
|
||||
// so we need to reset the target on the new event
|
||||
event.target = this.element[ 0 ];
|
||||
|
||||
// copy original event properties over to the new event
|
||||
orig = event.originalEvent;
|
||||
if ( orig ) {
|
||||
for ( prop in orig ) {
|
||||
if ( !( prop in event ) ) {
|
||||
event[ prop ] = orig[ prop ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.element.trigger( event, data );
|
||||
return !( $.isFunction( callback ) &&
|
||||
callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
|
||||
event.isDefaultPrevented() );
|
||||
}
|
||||
};
|
||||
|
||||
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
|
||||
$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
|
||||
if ( typeof options === "string" ) {
|
||||
options = { effect: options };
|
||||
}
|
||||
var hasOptions,
|
||||
effectName = !options ?
|
||||
method :
|
||||
options === true || typeof options === "number" ?
|
||||
defaultEffect :
|
||||
options.effect || defaultEffect;
|
||||
options = options || {};
|
||||
if ( typeof options === "number" ) {
|
||||
options = { duration: options };
|
||||
}
|
||||
hasOptions = !$.isEmptyObject( options );
|
||||
options.complete = callback;
|
||||
if ( options.delay ) {
|
||||
element.delay( options.delay );
|
||||
}
|
||||
if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
|
||||
element[ method ]( options );
|
||||
} else if ( effectName !== method && element[ effectName ] ) {
|
||||
element[ effectName ]( options.duration, options.easing, callback );
|
||||
} else {
|
||||
element.queue(function( next ) {
|
||||
$( this )[ method ]();
|
||||
if ( callback ) {
|
||||
callback.call( element[ 0 ] );
|
||||
}
|
||||
next();
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
}));
|
||||
1741
statics/saas/scm/app2_release/js/common/plugins/jquery.dialog.js
Executable file
1741
statics/saas/scm/app2_release/js/common/plugins/jquery.dialog.js
Executable file
File diff suppressed because it is too large
Load Diff
512
statics/saas/scm/app2_release/js/common/plugins/jquery.spinbox.js
Executable file
512
statics/saas/scm/app2_release/js/common/plugins/jquery.spinbox.js
Executable file
@@ -0,0 +1,512 @@
|
||||
(function($){
|
||||
$.fn.numberField = function(opts){
|
||||
return $(this).each(function(){
|
||||
if(this.tagName.toLowerCase() != 'input'){return ;}
|
||||
|
||||
if( typeof(opts) == 'string' ){
|
||||
var instance = $(this).data('_numberField');
|
||||
if( !instance ){return ;}
|
||||
var args = Array.prototype.slice.call( arguments, 1 );
|
||||
if( typeof(instance[opts]) === 'function' ){
|
||||
instance[opts].apply(instance, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
var instance = $(this).data('_numberField');
|
||||
if( instance ){return ;}
|
||||
instance = new $.NumberField($(this),opts);
|
||||
$(this).data('_numberField', instance);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$.NumberField = function(obj, opts){
|
||||
this.input = obj;
|
||||
this.opts = $.extend(true, {}, $.NumberField.defaults, opts);
|
||||
this._init();
|
||||
}
|
||||
|
||||
$.fn.getNumberField = function(){
|
||||
return $.NumberField.getNumberField(this);
|
||||
}
|
||||
|
||||
|
||||
$.NumberField.getNumberField = function(obj){
|
||||
obj = $(obj)
|
||||
if(obj.length == 0) {
|
||||
return ;
|
||||
} else if (obj.length == 1){
|
||||
return obj.data('_numberField');
|
||||
} else if ( obj.length > 1) {
|
||||
var array = [];
|
||||
obj.each(function(idx){
|
||||
array.push(this.data('_numberField'));
|
||||
})
|
||||
return array;
|
||||
}
|
||||
}
|
||||
|
||||
$.NumberField.prototype = {
|
||||
|
||||
constructor: $.NumberField,
|
||||
|
||||
|
||||
_init: function(){
|
||||
var opts = this.opts, min = parseFloat(opts.min), max = parseFloat(opts.max),
|
||||
step = parseFloat(opts.step), precision = parseInt(opts.precision);
|
||||
this.min = !isNaN(min) ? min : Number.NEGATIVE_INFINITY;
|
||||
this.max = !isNaN(max) ? max : Number.MAX_VALUE;
|
||||
this.step = !isNaN(step) ? step : 1;
|
||||
this.precision = isNaN(precision) || !opts.decimal || precision < 0 ? 0 : precision;
|
||||
this.allowedReg = this._getAllowedReg();
|
||||
this.input.css('ime-mode', 'disabled');
|
||||
|
||||
this._initVal();
|
||||
this._initDisabled();
|
||||
this._bindEvent();
|
||||
},
|
||||
|
||||
|
||||
_getAllowedReg: function(){
|
||||
var opts = this.opts, allowed = '0123456789', reg;
|
||||
if(opts.decimal){
|
||||
allowed += '.';
|
||||
}
|
||||
if(this.min < 0){
|
||||
allowed += '-';
|
||||
}
|
||||
allowed = allowed.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
||||
reg = new RegExp('[' + allowed + ']');
|
||||
return reg;
|
||||
},
|
||||
|
||||
|
||||
_initVal: function(){
|
||||
var val = this._getProcessedVal(this.opts.value);
|
||||
if(val === false){
|
||||
val = this._getProcessedVal(this.input.val());
|
||||
if(val === false){
|
||||
val = '';
|
||||
}
|
||||
}
|
||||
this._val = this.originVal = val;
|
||||
this.input.val(val);
|
||||
},
|
||||
|
||||
|
||||
_initDisabled: function(){
|
||||
var opts = this.opts;
|
||||
this._disabled = opts.disabled === true ? true : opts.disabled === false ? false : !!this.input.attr('disabled');
|
||||
this.originDisabled = this._disabled;
|
||||
this._handleDisabled(this._disabled);
|
||||
},
|
||||
|
||||
|
||||
_bindEvent: function(){
|
||||
var self = this, opts = self.opts;
|
||||
var KEYS = {
|
||||
'up': 38,
|
||||
'down': 40
|
||||
}
|
||||
|
||||
//var mouseWheel = $.browser.mozilla ? 'DOMMouseScroll' : 'mousewheel';
|
||||
var mouseWheel = 'mousewheel';
|
||||
|
||||
this.input.on('keydown', function(e){
|
||||
var which = e.which;
|
||||
if( which == KEYS.up || which == KEYS.down ){
|
||||
if( !opts.keyEnable ){ return ;}
|
||||
var operator = which == KEYS.up ? 'plus' : 'minus';
|
||||
self._handleAdjusting(operator);
|
||||
e.preventDefault();
|
||||
}
|
||||
})
|
||||
.on('keypress', function(e){
|
||||
var charCode = typeof e.charCode != 'undefined' ? e.charCode : e.keyCode;
|
||||
var keyChar = $.trim(String.fromCharCode(charCode));
|
||||
if(charCode != 0 && !self.allowedReg.test(keyChar)){
|
||||
e.preventDefault();
|
||||
}
|
||||
})
|
||||
.on('keyup', function(e){
|
||||
self._clearAutoRepeat();
|
||||
})
|
||||
.on('focus', function(e){
|
||||
self.focus = true;
|
||||
//self.wrap.addClass(opts.activeCls);
|
||||
})
|
||||
.on('blur', function(e){
|
||||
self.focus = false;
|
||||
//self.wrap.removeClass(opts.activeCls);
|
||||
var val = $.trim(self.input.val());
|
||||
//alert('blur')
|
||||
//self._clearAutoRepeat();
|
||||
if(val === self._val){return ;}
|
||||
if(!self.setValue(val)){
|
||||
self.input.val(self._val);
|
||||
}
|
||||
})
|
||||
.on(mouseWheel,function(e){
|
||||
e.preventDefault();
|
||||
if (!self.focus || !opts.wheelEnable) {return ;}
|
||||
e = e.originalEvent;
|
||||
var delta = e.wheelDelta ? (e.wheelDelta / 120) : (- e.detail / 3);
|
||||
var operator = delta == 1 ? 'plus' : 'minus';
|
||||
var val = self.input.val();
|
||||
if(val !== self._val && !self.setValue(val)){
|
||||
self.input.val(this._val);
|
||||
}
|
||||
self._adjustVal(operator);
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
*对原始值进行处理
|
||||
*@return {false || string || number} 原始值为空返回'',为NaN返回false,为number返回处理好的数字
|
||||
*/
|
||||
_getProcessedVal: function(val){
|
||||
if(typeof val == 'string' && $.trim(val) === '') {return '';}
|
||||
val = parseFloat(val);
|
||||
if(isNaN(val)){return false;}
|
||||
val = val > this.max ? this.max : val < this.min ? this.min : val;
|
||||
val = val.toFixed(this.precision);
|
||||
if (!this.opts.forceDecimal) {
|
||||
val = parseFloat(val);
|
||||
}
|
||||
return val;
|
||||
},
|
||||
|
||||
|
||||
enable: function(){
|
||||
this._handleDisabled(false);
|
||||
},
|
||||
|
||||
|
||||
disable: function(){
|
||||
this._handleDisabled(true);
|
||||
},
|
||||
|
||||
|
||||
_handleDisabled: function(disabled){
|
||||
var opts = this.opts;
|
||||
disabled === true ? this.input.addClass(opts.inputDisabledCls) : this.input.removeClass(opts.inputDisabledCls);
|
||||
this._disabled = disabled;
|
||||
this.input.attr('disabled', disabled);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
*有微调发生时,对微调进行处理
|
||||
*/
|
||||
_handleAdjusting: function(operator){
|
||||
var val = this.input.val();
|
||||
if(val !== this._val && !this.setValue(val)){
|
||||
this.input.val(this._val);
|
||||
}
|
||||
|
||||
//已经到达最大值,最小值时
|
||||
if( (this._val === this.max && operator == 'plus') || (this._val === this.min && operator == 'minus') ){
|
||||
return ;
|
||||
}
|
||||
|
||||
if(this.opts.autoRepeat){
|
||||
this._clearAutoRepeat();
|
||||
this._setAutoRepeat(operator);
|
||||
}
|
||||
this._adjustVal(operator);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
*微调值
|
||||
*/
|
||||
_adjustVal: function(operator){
|
||||
//已经到达最大值,最小值时
|
||||
if( (this._val === this.max && operator == 'plus') || (this._val === this.min && operator == 'minus') ){
|
||||
this._clearAutoRepeat();
|
||||
return ;
|
||||
}
|
||||
var baseVal = this._val !== '' ? this._val : this.min < 0 && this.min > Number.NEGATIVE_INFINITY ? this.min : 0;
|
||||
var val = operator == 'plus' ? baseVal + this.step : baseVal - this.step;
|
||||
this.setValue(val);
|
||||
},
|
||||
|
||||
|
||||
_setAutoRepeat: function(operator){
|
||||
var opts = this.opts, self = this;
|
||||
self.autoTimer = window.setTimeout(function(){
|
||||
self.autoRepeater = window.setInterval(function(){
|
||||
self._adjustVal(operator);
|
||||
}, opts.interval);
|
||||
},opts.delay);
|
||||
},
|
||||
|
||||
|
||||
_clearAutoRepeat: function(){
|
||||
if(this.autoTimer){
|
||||
window.clearTimeout(this.autoTimer);
|
||||
}
|
||||
if(this.autoRepeater){
|
||||
window.clearTimeout(this.autoRepeater);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
setValue: function(val){
|
||||
var opts = this.opts;
|
||||
if(this._disabled){return ;}
|
||||
val = this._getProcessedVal(val);
|
||||
if(val === false){return ;}
|
||||
this.input.val(val);
|
||||
this._val = val;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$.NumberField.defaults = {
|
||||
value: undefined,
|
||||
max: undefined,
|
||||
min: undefined,
|
||||
step: 1,
|
||||
decimal: false,
|
||||
precision: 2,
|
||||
disabled: undefined,
|
||||
keyEnable: false,
|
||||
wheelEnable: false,
|
||||
autoRepeat: true,
|
||||
delay: 400,
|
||||
interval: 80,
|
||||
|
||||
inputCls: 'ui-input',
|
||||
inputDisabledCls: 'ui-input-disabled'
|
||||
|
||||
}
|
||||
|
||||
|
||||
})(jQuery);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*Spinbox插件 扩展自 NumberField
|
||||
*带微调按钮的数字输入框
|
||||
*/
|
||||
(function($){
|
||||
$.fn.spinbox = function(opts){
|
||||
return $(this).each(function(){
|
||||
if( typeof(opts) == 'string' ){
|
||||
var instance = $(this).data('_spinbox');
|
||||
if( !instance ){return ;}
|
||||
var args = Array.prototype.slice.call( arguments, 1 );
|
||||
if( typeof(instance[opts]) === 'function' ){
|
||||
instance[opts].apply(instance, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
var instance = $(this).data('_spinbox');
|
||||
if( instance ){return ;}
|
||||
instance = new $.Spinbox($(this),opts);
|
||||
$(this).data('_spinbox', instance);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$.fn.getSpinbox = function(){
|
||||
return $.Spinbox.getSpinbox(this);
|
||||
}
|
||||
|
||||
|
||||
$.Spinbox = function(obj, opts){
|
||||
this.obj = obj;
|
||||
this.opts = $.extend(true, {}, $.Spinbox.defaults, opts);
|
||||
this._init();
|
||||
}
|
||||
|
||||
$.Spinbox.getSpinbox = function(obj){
|
||||
obj = $(obj)
|
||||
if(obj.length == 0) {
|
||||
return ;
|
||||
} else if (obj.length == 1){
|
||||
return obj.data('_spinbox');
|
||||
} else if ( obj.length > 1) {
|
||||
var array = [];
|
||||
obj.each(function(idx){
|
||||
array.push(this.data('_spinbox'));
|
||||
})
|
||||
return array;
|
||||
}
|
||||
}
|
||||
|
||||
$.Spinbox.prototype = {
|
||||
|
||||
constructor: $.Spinbox,
|
||||
|
||||
|
||||
_init: function(){
|
||||
this._createStruture();
|
||||
this._initDisabled();
|
||||
this._bindEvent();
|
||||
},
|
||||
|
||||
|
||||
|
||||
_createStruture: function(){
|
||||
var opts = this.opts, nextSibling, w = parseInt(opts.width), inputW;
|
||||
if( this.obj[0].tagName.toLowerCase() == 'input' ) {
|
||||
this.input = this.obj;
|
||||
this.obj = this.obj.parent();
|
||||
nextSibling = this.input.next().length == 0 ? null : this.input.next();
|
||||
} else {
|
||||
this.input = $('<input type="text" />');
|
||||
}
|
||||
this.input.attr('autocomplete', 'off').addClass(opts.inputCls).numberField(opts);
|
||||
this.numberField = this.input.data('_numberField');
|
||||
this.downBtn = $('<a />').addClass(opts.downBtnCls);
|
||||
this.upBtn = $('<a />').addClass(opts.upBtnCls);
|
||||
this.btnWrap = $('<span />').addClass(opts.btnWrapCls).append(this.upBtn,this.downBtn);
|
||||
this.btns = this.btnWrap.children();
|
||||
this.wrap = $('<span />').addClass(opts.wrapCls).append(this.input, this.btnWrap);
|
||||
if(nextSibling){
|
||||
this.wrap.insertBefore(nextSibling);
|
||||
} else {
|
||||
this.wrap.appendTo(this.obj);
|
||||
}
|
||||
|
||||
if(w){
|
||||
this.wrap.width(w);
|
||||
inputW = w - this.btnWrap.outerWidth() - (this.input.outerWidth() - this.input.width());
|
||||
this.input.width(inputW);
|
||||
}
|
||||
},
|
||||
|
||||
_initDisabled: function(){
|
||||
var opts = this.opts;
|
||||
this._disabled = opts.disabled === true ? true : opts.disabled === false ? false : undefined;
|
||||
if(this._disabled === undefined){
|
||||
this._disabled = !!this.input.attr('disabled');
|
||||
}
|
||||
this.defaultDisabled = this._disabled;
|
||||
if(this._disabled === true){
|
||||
this.disable();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
_bindEvent: function(){
|
||||
var self = this, opts = this.opts;
|
||||
|
||||
this.wrap.on('mouseover', function(e){
|
||||
if(self._disabled){return ;}
|
||||
self.wrap.addClass(opts.hoverCls);
|
||||
}).on('mouseleave', function(e){
|
||||
if(self._disabled){return ;}
|
||||
self.wrap.removeClass(opts.hoverCls);
|
||||
});
|
||||
|
||||
this.btnWrap.on('mouseover', function(e){
|
||||
if(self._disabled){return ;}
|
||||
$(this).addClass(opts.btnWrapHoverCls);
|
||||
}).on('mouseleave', function(e){
|
||||
if(self._disabled){return ;}
|
||||
$(this).removeClass(opts.btnWrapHoverCls);
|
||||
});
|
||||
|
||||
|
||||
//IE下需处理dblClick事件,IE9以下dblClick只执行一次click事件
|
||||
//var clickEvent = $.browser.msie && parseInt($.browser.version) < 9 ? 'mousedown dblclick' : 'mousedown';
|
||||
var clickEvent = 'mousedown';
|
||||
this.btns.on(clickEvent, function(e){
|
||||
if(self._disabled){ return ;}
|
||||
var operator = $(this)[0] == self.upBtn[0] ? 'plus' : 'minus';
|
||||
self.input.focus();
|
||||
if(e.type == 'mousedown'){
|
||||
self.numberField._handleAdjusting(operator);
|
||||
} else if(e.type == 'dblclick'){
|
||||
self.numberField._adjustVal(operator);
|
||||
}
|
||||
e.preventDefault();
|
||||
}).on('mouseup mouseleave', function(e){
|
||||
self.numberField._clearAutoRepeat();
|
||||
});
|
||||
|
||||
|
||||
this.input.on('focus',function(e){
|
||||
self.wrap.addClass(opts.activeCls);
|
||||
}).on('blur', function(){
|
||||
self.wrap.removeClass(opts.activeCls);
|
||||
});
|
||||
|
||||
$(document).on('mousedown', function(e){
|
||||
var target = e.target || e.srcElement;
|
||||
if( $(target).closest(self.wrap).length == 0){
|
||||
self.wrap.removeClass(opts.activeCls);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
enable: function(){
|
||||
this._handleDisabled(false);
|
||||
},
|
||||
|
||||
disable: function(disabled){
|
||||
disabled = typeof disabled == 'undefined' ? true : !!disabled;
|
||||
this._handleDisabled(disabled);
|
||||
},
|
||||
|
||||
_handleDisabled: function(disabled){
|
||||
var opts = this.opts;
|
||||
disabled === true ? this.wrap.addClass(opts.disabledCls) : this.wrap.removeClass(opts.disabledCls);
|
||||
this._disabled = disabled;
|
||||
this.numberField._handleDisabled(disabled);
|
||||
},
|
||||
|
||||
getDisabled: function(){
|
||||
return this._disabled;
|
||||
},
|
||||
|
||||
getValue: function(){
|
||||
this.numberField.getValue();
|
||||
},
|
||||
|
||||
setValue: function(val){
|
||||
return this.numberField.setValue(val);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$.Spinbox.defaults = $.extend(true, $.NumberField.defaults, {
|
||||
/*min: undefined,
|
||||
max: undefined,
|
||||
step: 1, //每次增加的值
|
||||
value: undefined,
|
||||
width: undefined, //spinbox总宽
|
||||
disabled: undefined,
|
||||
keyEnable: true,
|
||||
wheelEnable: true,
|
||||
autoRepeat: true,
|
||||
delay: 400,
|
||||
interval: 50,*/
|
||||
width: undefined,
|
||||
|
||||
wrapCls: 'ui-spinbox-wrap',
|
||||
activeCls: 'ui-spinbox-active',
|
||||
disabledCls: 'ui-spinbox-disabled',
|
||||
hoverCls: 'ui-spinbox-hover',
|
||||
inputCls: 'input-txt',
|
||||
btnWrapCls: 'btn-wrap',
|
||||
btnWrapHoverCls: 'btn-wrap-hover',
|
||||
btnCls: 'btn',
|
||||
downBtnCls: 'btn-down',
|
||||
upBtnCls: 'btn-up'
|
||||
|
||||
})
|
||||
|
||||
})(jQuery);
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
1
statics/saas/scm/app2_release/js/common/tabs.js
Executable file
1
statics/saas/scm/app2_release/js/common/tabs.js
Executable file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user