ggclient
Version:
A simple API for gg.pl
1,609 lines (1,608 loc) • 1.31 MB
JavaScript
if (!("console" in window)) {
var c = (window.console = {});
c.log = function() {};
c.warn = function() {};
c.error = function() {};
c.debug = function() {};
c.info = function() {};
}
if (!window.console.debug) {
window.console.debug = window.console.log;
/*!
Ext JS - JavaScript Library
Copyright (c) 2006-2011, Sencha Inc.
All rights reserved.
licensing@sencha.com
*/
}
(function() {
var g = this,
a = Object.prototype,
h = Object.prototype.toString,
b = true,
e = { toString: 1 },
d;
if (typeof Ext === "undefined") {
g.Ext = {};
}
Ext.global = g;
for (d in e) {
b = null;
}
if (b) {
b = [
"hasOwnProperty",
"valueOf",
"isPrototypeOf",
"propertyIsEnumerable",
"toLocaleString",
"toString",
"constructor"
];
}
Ext.enumerables = b;
Ext.apply = function(p, n, r) {
if (r) {
Ext.apply(p, r);
}
if (p && n && typeof n === "object") {
var q, m, l;
for (q in n) {
p[q] = n[q];
}
if (b) {
for (m = b.length; m--; ) {
l = b[m];
if (n.hasOwnProperty(l)) {
p[l] = n[l];
}
}
}
}
return p;
};
Ext.buildSettings = Ext.apply(
{ baseCSSPrefix: "x-", scopeResetCSS: false },
Ext.buildSettings || {}
);
Ext.apply(Ext, {
emptyFn: function() {},
baseCSSPrefix: Ext.buildSettings.baseCSSPrefix,
applyIf: function(j, i) {
var k;
if (j) {
for (k in i) {
if (j[k] === undefined) {
j[k] = i[k];
}
}
}
return j;
},
iterate: function(i, k, j) {
if (Ext.isEmpty(i)) {
return;
}
if (j === undefined) {
j = i;
}
if (Ext.isIterable(i)) {
Ext.Array.each.call(Ext.Array, i, k, j);
} else {
Ext.Object.each.call(Ext.Object, i, k, j);
}
}
});
Ext.apply(Ext, {
extend: (function() {
var i = a.constructor,
j = function(l) {
for (var k in l) {
if (!l.hasOwnProperty(k)) {
continue;
}
this[k] = l[k];
}
};
return function(k, q, n) {
if (Ext.isObject(q)) {
n = q;
q = k;
k =
n.constructor !== i
? n.constructor
: function() {
q.apply(this, arguments);
};
}
if (!q) {
Ext.Error.raise({
sourceClass: "Ext",
sourceMethod: "extend",
msg:
"Attempting to extend from a class which has not been loaded on the page."
});
}
var m = function() {},
l,
p = q.prototype;
m.prototype = p;
l = k.prototype = new m();
l.constructor = k;
k.superclass = p;
if (p.constructor === i) {
p.constructor = q;
}
k.override = function(r) {
Ext.override(k, r);
};
l.override = j;
l.proto = l;
k.override(n);
k.extend = function(r) {
return Ext.extend(k, r);
};
return k;
};
})(),
override: function(i, j) {
if (i.prototype.$className) {
return i.override(j);
} else {
Ext.apply(i.prototype, j);
}
}
});
Ext.apply(Ext, {
valueFrom: function(k, i, j) {
return Ext.isEmpty(k, j) ? i : k;
},
typeOf: function(j) {
if (j === null) {
return "null";
}
var i = typeof j;
if (
i === "undefined" ||
i === "string" ||
i === "number" ||
i === "boolean"
) {
return i;
}
var k = h.call(j);
switch (k) {
case "[object Array]":
return "array";
case "[object Date]":
return "date";
case "[object Boolean]":
return "boolean";
case "[object Number]":
return "number";
case "[object RegExp]":
return "regexp";
}
if (i === "function") {
return "function";
}
if (i === "object") {
if (j.nodeType !== undefined) {
if (j.nodeType === 3) {
return /\S/.test(j.nodeValue)
? "textnode"
: "whitespace";
} else {
return "element";
}
}
return "object";
}
Ext.Error.raise({
sourceClass: "Ext",
sourceMethod: "typeOf",
msg:
'Failed to determine the type of the specified value "' +
j +
'". This is most likely a bug.'
});
},
isEmpty: function(i, j) {
return (
i === null ||
i === undefined ||
(!j ? i === "" : false) ||
(Ext.isArray(i) && i.length === 0)
);
},
isArray:
"isArray" in Array
? Array.isArray
: function(i) {
return h.call(i) === "[object Array]";
},
isDate: function(i) {
return h.call(i) === "[object Date]";
},
isObject:
h.call(null) === "[object Object]"
? function(i) {
return (
i !== null &&
i !== undefined &&
h.call(i) === "[object Object]" &&
i.nodeType === undefined
);
}
: function(i) {
return h.call(i) === "[object Object]";
},
isPrimitive: function(j) {
var i = typeof j;
return i === "string" || i === "number" || i === "boolean";
},
isFunction:
typeof document !== "undefined" &&
typeof document.getElementsByTagName("body") === "function"
? function(i) {
return h.call(i) === "[object Function]";
}
: function(i) {
return typeof i === "function";
},
isNumber: function(i) {
return typeof i === "number" && isFinite(i);
},
isNumeric: function(i) {
return !isNaN(parseFloat(i)) && isFinite(i);
},
isString: function(i) {
return typeof i === "string";
},
isBoolean: function(i) {
return typeof i === "boolean";
},
isElement: function(i) {
return i ? i.nodeType !== undefined : false;
},
isTextNode: function(i) {
return i ? i.nodeName === "#text" : false;
},
isDefined: function(i) {
return typeof i !== "undefined";
},
isIterable: function(i) {
return i && typeof i !== "string" ? i.length !== undefined : false;
}
});
Ext.apply(Ext, {
clone: function(r) {
if (r === null || r === undefined) {
return r;
}
if (r.nodeType && r.cloneNode) {
return r.cloneNode(true);
}
var q = h.call(r);
if (q === "[object Date]") {
return new Date(r.getTime());
}
var p, m, l, s, n;
if (q === "[object Array]") {
p = r.length;
s = [];
while (p--) {
s[p] = Ext.clone(r[p]);
}
} else {
if (q === "[object Object]" && r.constructor === Object) {
s = {};
for (n in r) {
s[n] = Ext.clone(r[n]);
}
if (b) {
for (m = b.length; m--; ) {
l = b[m];
s[l] = r[l];
}
}
}
}
return s || r;
},
getUniqueGlobalNamespace: function() {
var k = this.uniqueGlobalNamespace;
if (k === undefined) {
var j = 0;
do {
k = "ExtSandbox" + ++j;
} while (Ext.global[k] !== undefined);
Ext.global[k] = Ext;
this.uniqueGlobalNamespace = k;
}
return k;
},
functionFactory: function() {
var i = Array.prototype.slice.call(arguments);
if (i.length > 0) {
i[i.length - 1] =
"var Ext=window." +
this.getUniqueGlobalNamespace() +
";" +
i[i.length - 1];
}
return Function.prototype.constructor.apply(Function.prototype, i);
}
});
Ext.type = Ext.typeOf;
})();
(function() {
var a = "4.0.0",
b;
Ext.Version = b = Ext.extend(Object, {
constructor: function(d) {
var g, e;
if (d instanceof b) {
return d;
}
this.version = this.shortVersion = String(d)
.toLowerCase()
.replace(/_/g, ".")
.replace(/[\-+]/g, "");
e = this.version.search(/([^\d\.])/);
if (e !== -1) {
this.release = this.version.substr(e, d.length);
this.shortVersion = this.version.substr(0, e);
}
this.shortVersion = this.shortVersion.replace(/[^\d]/g, "");
g = this.version.split(".");
this.major = parseInt(g.shift() || 0, 10);
this.minor = parseInt(g.shift() || 0, 10);
this.patch = parseInt(g.shift() || 0, 10);
this.build = parseInt(g.shift() || 0, 10);
return this;
},
toString: function() {
return this.version;
},
valueOf: function() {
return this.version;
},
getMajor: function() {
return this.major || 0;
},
getMinor: function() {
return this.minor || 0;
},
getPatch: function() {
return this.patch || 0;
},
getBuild: function() {
return this.build || 0;
},
getRelease: function() {
return this.release || "";
},
isGreaterThan: function(d) {
return b.compare(this.version, d) === 1;
},
isLessThan: function(d) {
return b.compare(this.version, d) === -1;
},
equals: function(d) {
return b.compare(this.version, d) === 0;
},
match: function(d) {
d = String(d);
return this.version.substr(0, d.length) === d;
},
toArray: function() {
return [
this.getMajor(),
this.getMinor(),
this.getPatch(),
this.getBuild(),
this.getRelease()
];
},
getShortVersion: function() {
return this.shortVersion;
}
});
Ext.apply(b, {
releaseValueMap: {
dev: -6,
alpha: -5,
a: -5,
beta: -4,
b: -4,
rc: -3,
"#": -2,
p: -1,
pl: -1
},
getComponentValue: function(d) {
return !d
? 0
: isNaN(d)
? this.releaseValueMap[d] || d
: parseInt(d, 10);
},
compare: function(j, h) {
var e, g, d;
j = new b(j).toArray();
h = new b(h).toArray();
for (d = 0; d < Math.max(j.length, h.length); d++) {
e = this.getComponentValue(j[d]);
g = this.getComponentValue(h[d]);
if (e < g) {
return -1;
} else {
if (e > g) {
return 1;
}
}
}
return 0;
}
});
Ext.apply(Ext, {
versions: {},
lastRegisteredVersion: null,
setVersion: function(e, d) {
Ext.versions[e] = new b(d);
Ext.lastRegisteredVersion = Ext.versions[e];
return this;
},
getVersion: function(d) {
if (d === undefined) {
return Ext.lastRegisteredVersion;
}
return Ext.versions[d];
},
deprecate: function(d, g, h, e) {
if (b.compare(Ext.getVersion(d), g) < 1) {
h.call(e);
}
}
});
Ext.setVersion("core", a);
})();
Ext.String = {
trimRegex: /^[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+|[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+$/g,
escapeRe: /('|\\)/g,
formatRe: /\{(\d+)\}/g,
escapeRegexRe: /([-.*+?^${}()|[\]\/\\])/g,
htmlEncode: (function() {
var e = { "&": "&", ">": ">", "<": "<", '"': """ },
b = [],
d,
a;
for (d in e) {
b.push(d);
}
a = new RegExp("(" + b.join("|") + ")", "g");
return function(g) {
return !g
? g
: String(g).replace(a, function(i, h) {
return e[h];
});
};
})(),
htmlDecode: (function() {
var e = { "&": "&", ">": ">", "<": "<", """: '"' },
b = [],
d,
a;
for (d in e) {
b.push(d);
}
a = new RegExp("(" + b.join("|") + "|&#[0-9]{1,5};)", "g");
return function(g) {
return !g
? g
: String(g).replace(a, function(i, h) {
if (h in e) {
return e[h];
} else {
return String.fromCharCode(parseInt(h.substr(2), 10));
}
});
};
})(),
urlAppend: function(b, a) {
if (!Ext.isEmpty(a)) {
return b + (b.indexOf("?") === -1 ? "?" : "&") + a;
}
return b;
},
trim: function(a) {
return a.replace(Ext.String.trimRegex, "");
},
capitalize: function(a) {
return a.charAt(0).toUpperCase() + a.substr(1);
},
ellipsis: function(d, a, e) {
if (d && d.length > a) {
if (e) {
var g = d.substr(0, a - 2),
b = Math.max(
g.lastIndexOf(" "),
g.lastIndexOf("."),
g.lastIndexOf("!"),
g.lastIndexOf("?")
);
if (b !== -1 && b >= a - 15) {
return g.substr(0, b) + "...";
}
}
return d.substr(0, a - 3) + "...";
}
return d;
},
escapeRegex: function(a) {
return a.replace(Ext.String.escapeRegexRe, "\\$1");
},
escape: function(a) {
return a.replace(Ext.String.escapeRe, "\\$1");
},
toggle: function(b, d, a) {
return b === d ? a : d;
},
leftPad: function(b, d, e) {
var a = String(b);
e = e || " ";
while (a.length < d) {
a = e + a;
}
return a;
},
format: function(b) {
var a = Ext.Array.toArray(arguments, 1);
return b.replace(Ext.String.formatRe, function(d, e) {
return a[e];
});
}
};
(function() {
var a = (0.9).toFixed() !== "1";
Ext.Number = {
constrain: function(e, d, b) {
e = parseFloat(e);
if (!isNaN(d)) {
e = Math.max(e, d);
}
if (!isNaN(b)) {
e = Math.min(e, b);
}
return e;
},
toFixed: function(e, b) {
if (a) {
b = b || 0;
var d = Math.pow(10, b);
return (Math.round(e * d) / d).toFixed(b);
}
return e.toFixed(b);
},
from: function(d, b) {
if (isFinite(d)) {
d = parseFloat(d);
}
return !isNaN(d) ? d : b;
}
};
})();
Ext.num = function() {
return Ext.Number.from.apply(this, arguments);
};
(function() {
var h = Array.prototype,
m = h.slice,
k = "forEach" in h,
j = "map" in h,
n = "indexOf" in h,
a = "every" in h,
g = "some" in h,
d = "filter" in h,
p = (function() {
var e = [1, 2, 3, 4, 5].sort(function() {
return 0;
});
return (
e[0] === 1 &&
e[1] === 2 &&
e[2] === 3 &&
e[3] === 4 &&
e[4] === 5
);
})(),
b = true,
l;
try {
if (typeof document !== "undefined") {
m.call(document.getElementsByTagName("body"));
}
} catch (i) {
b = false;
}
l = Ext.Array = {
each: function(u, s, r, e) {
u = l.from(u);
var q,
t = u.length;
if (e !== true) {
for (q = 0; q < t; q++) {
if (s.call(r || u[q], u[q], q, u) === false) {
return q;
}
}
} else {
for (q = t - 1; q > -1; q--) {
if (s.call(r || u[q], u[q], q, u) === false) {
return q;
}
}
}
return true;
},
forEach: function(t, r, q) {
if (k) {
return t.forEach(r, q);
}
var e = 0,
s = t.length;
for (; e < s; e++) {
r.call(q, t[e], e, t);
}
},
indexOf: function(t, r, s) {
if (n) {
return t.indexOf(r, s);
}
var e,
q = t.length;
for (e = s < 0 ? Math.max(0, q + s) : s || 0; e < q; e++) {
if (t[e] === r) {
return e;
}
}
return -1;
},
contains: function(s, r) {
if (n) {
return s.indexOf(r) !== -1;
}
var e, q;
for (e = 0, q = s.length; e < q; e++) {
if (s[e] === r) {
return true;
}
}
return false;
},
toArray: function(r, t, e) {
if (!r || !r.length) {
return [];
}
if (typeof r === "string") {
r = r.split("");
}
if (b) {
return m.call(r, t || 0, e || r.length);
}
var s = [],
q;
t = t || 0;
e = e ? (e < 0 ? r.length + e : e) : r.length;
for (q = t; q < e; q++) {
s.push(r[q]);
}
return s;
},
pluck: function(u, e) {
var q = [],
r,
t,
s;
for (r = 0, t = u.length; r < t; r++) {
s = u[r];
q.push(s[e]);
}
return q;
},
map: function(u, t, s) {
if (j) {
return u.map(t, s);
}
var r = [],
q = 0,
e = u.length;
for (; q < e; q++) {
r[q] = t.call(s, u[q], q, u);
}
return r;
},
every: function(t, r, q) {
if (!r) {
Ext.Error.raise(
"Ext.Array.every must have a callback function passed as second argument."
);
}
if (a) {
return t.every(r, q);
}
var e = 0,
s = t.length;
for (; e < s; ++e) {
if (!r.call(q, t[e], e, t)) {
return false;
}
}
return true;
},
some: function(t, r, q) {
if (!r) {
Ext.Error.raise(
"Ext.Array.some must have a callback function passed as second argument."
);
}
if (g) {
return t.some(r, q);
}
var e = 0,
s = t.length;
for (; e < s; ++e) {
if (r.call(q, t[e], e, t)) {
return true;
}
}
return false;
},
clean: function(t) {
var q = [],
e = 0,
s = t.length,
r;
for (; e < s; e++) {
r = t[e];
if (!Ext.isEmpty(r)) {
q.push(r);
}
}
return q;
},
unique: function(t) {
var s = [],
e = 0,
r = t.length,
q;
for (; e < r; e++) {
q = t[e];
if (l.indexOf(s, q) === -1) {
s.push(q);
}
}
return s;
},
filter: function(u, s, r) {
if (d) {
return u.filter(s, r);
}
var q = [],
e = 0,
t = u.length;
for (; e < t; e++) {
if (s.call(r, u[e], e, u)) {
q.push(u[e]);
}
}
return q;
},
from: function(q, e) {
if (q === undefined || q === null) {
return [];
}
if (Ext.isArray(q)) {
return e ? m.call(q) : q;
}
if (q && q.length !== undefined && typeof q !== "string") {
return Ext.toArray(q);
}
return [q];
},
remove: function(r, q) {
var e = l.indexOf(r, q);
if (e !== -1) {
r.splice(e, 1);
}
return r;
},
include: function(q, e) {
if (!l.contains(q, e)) {
q.push(e);
}
},
clone: function(e) {
return m.call(e);
},
merge: function() {
var e = m.call(arguments),
s = [],
q,
r;
for (q = 0, r = e.length; q < r; q++) {
s = s.concat(e[q]);
}
return l.unique(s);
},
intersect: function() {
var r = [],
e = m.call(arguments),
v,
t,
s,
z,
A,
D,
C,
B,
q,
u;
if (!e.length) {
return r;
}
for (v = D = 0, B = e.length; v < B, (A = e[v]); v++) {
if (!z || A.length < z.length) {
z = A;
D = v;
}
}
z = Ext.Array.unique(z);
e.splice(D, 1);
for (v = 0, B = z.length; v < B, (D = z[v]); v++) {
var w = 0;
for (t = 0, q = e.length; t < q, (A = e[t]); t++) {
for (s = 0, u = A.length; s < u, (C = A[s]); s++) {
if (D === C) {
w++;
break;
}
}
}
if (w === q) {
r.push(D);
}
}
return r;
},
difference: function(q, e) {
var v = m.call(q),
t = v.length,
s,
r,
u;
for (s = 0, u = e.length; s < u; s++) {
for (r = 0; r < t; r++) {
if (v[r] === e[s]) {
v.splice(r, 1);
r--;
t--;
}
}
}
return v;
},
sort: function(w, v) {
if (p) {
if (v) {
return w.sort(v);
} else {
return w.sort();
}
}
var t = w.length,
s = 0,
u,
e,
r,
q;
for (; s < t; s++) {
r = s;
for (e = s + 1; e < t; e++) {
if (v) {
u = v(w[e], w[r]);
if (u < 0) {
r = e;
}
} else {
if (w[e] < w[r]) {
r = e;
}
}
}
if (r !== s) {
q = w[s];
w[s] = w[r];
w[r] = q;
}
}
return w;
},
flatten: function(r) {
var q = [];
function e(s) {
var u, w, t;
for (u = 0, w = s.length; u < w; u++) {
t = s[u];
if (Ext.isArray(t)) {
e(t);
} else {
q.push(t);
}
}
return q;
}
return e(r);
},
min: function(u, t) {
var q = u[0],
e,
s,
r;
for (e = 0, s = u.length; e < s; e++) {
r = u[e];
if (t) {
if (t(q, r) === 1) {
q = r;
}
} else {
if (r < q) {
q = r;
}
}
}
return q;
},
max: function(u, t) {
var e = u[0],
q,
s,
r;
for (q = 0, s = u.length; q < s; q++) {
r = u[q];
if (t) {
if (t(e, r) === -1) {
e = r;
}
} else {
if (r > e) {
e = r;
}
}
}
return e;
},
mean: function(e) {
return e.length > 0 ? l.sum(e) / e.length : undefined;
},
sum: function(t) {
var q = 0,
e,
s,
r;
for (e = 0, s = t.length; e < s; e++) {
r = t[e];
q += r;
}
return q;
}
};
Ext.each = Ext.Array.each;
Ext.Array.union = Ext.Array.merge;
Ext.min = Ext.Array.min;
Ext.max = Ext.Array.max;
Ext.sum = Ext.Array.sum;
Ext.mean = Ext.Array.mean;
Ext.flatten = Ext.Array.flatten;
Ext.clean = Ext.Array.clean;
Ext.unique = Ext.Array.unique;
Ext.pluck = Ext.Array.pluck;
Ext.toArray = function() {
return l.toArray.apply(l, arguments);
};
})();
Ext.Function = {
flexSetter: function(a) {
return function(e, d) {
var g, h;
if (e === null) {
return this;
}
if (typeof e !== "string") {
for (g in e) {
if (e.hasOwnProperty(g)) {
a.call(this, g, e[g]);
}
}
if (Ext.enumerables) {
for (h = Ext.enumerables.length; h--; ) {
g = Ext.enumerables[h];
if (e.hasOwnProperty(g)) {
a.call(this, g, e[g]);
}
}
}
} else {
a.call(this, e, d);
}
return this;
};
},
bind: function(g, e, b, a) {
var h = g,
d;
return function() {
var i = b || arguments;
if (a === true) {
i = Array.prototype.slice.call(arguments, 0);
i = i.concat(b);
} else {
if (Ext.isNumber(a)) {
i = Array.prototype.slice.call(arguments, 0);
d = [a, 0].concat(b);
Array.prototype.splice.apply(i, d);
}
}
return h.apply(e || window, i);
};
},
pass: function(d, a, b) {
if (a) {
a = Ext.Array.from(a);
}
return function() {
return d.apply(b, a.concat(Ext.Array.toArray(arguments)));
};
},
alias: function(b, a) {
return function() {
return b[a].apply(b, arguments);
};
},
createInterceptor: function(e, d, b, a) {
var g = e;
if (!Ext.isFunction(d)) {
return e;
} else {
return function() {
var i = this,
h = arguments;
d.target = i;
d.method = e;
return d.apply(b || i || window, h) !== false
? e.apply(i || window, h)
: a || null;
};
}
},
createDelayed: function(g, d, e, b, a) {
if (e || b) {
g = Ext.Function.bind(g, e, b, a);
}
return function() {
var h = this;
setTimeout(function() {
g.apply(h, arguments);
}, d);
};
},
defer: function(e, d, g, b, a) {
e = Ext.Function.bind(e, g, b, a);
if (d > 0) {
return setTimeout(e, d);
}
e();
return 0;
},
createSequence: function(d, b, a) {
if (!Ext.isFunction(b)) {
return d;
} else {
return function() {
var e = d.apply(this || window, arguments);
b.apply(a || this || window, arguments);
return e;
};
}
},
createBuffered: function(e, a, d, b) {
return (function() {
var g;
return function() {
var h = this;
if (g) {
clearInterval(g);
g = null;
}
g = setTimeout(function() {
e.apply(d || h, b || arguments);
}, a);
};
})();
},
createThrottled: function(g, b, e) {
var h,
a,
d,
j,
i = function() {
g.apply(e || this, d);
h = new Date().getTime();
};
return function() {
a = new Date().getTime() - h;
d = arguments;
clearTimeout(j);
if (!h || a >= b) {
i();
} else {
j = setTimeout(i, b - a);
}
};
}
};
Ext.defer = Ext.Function.alias(Ext.Function, "defer");
Ext.pass = Ext.Function.alias(Ext.Function, "pass");
Ext.bind = Ext.Function.alias(Ext.Function, "bind");
(function() {
var a = (Ext.Object = {
toQueryObjects: function(e, k, d) {
var b = a.toQueryObjects,
j = [],
g,
h;
if (Ext.isArray(k)) {
for (g = 0, h = k.length; g < h; g++) {
if (d) {
j = j.concat(b(e + "[" + g + "]", k[g], true));
} else {
j.push({ name: e, value: k[g] });
}
}
} else {
if (Ext.isObject(k)) {
for (g in k) {
if (k.hasOwnProperty(g)) {
if (d) {
j = j.concat(b(e + "[" + g + "]", k[g], true));
} else {
j.push({ name: e, value: k[g] });
}
}
}
} else {
j.push({ name: e, value: k });
}
}
return j;
},
toQueryString: function(g, d) {
var h = [],
e = [],
l,
k,
m,
b,
n;
for (l in g) {
if (g.hasOwnProperty(l)) {
h = h.concat(a.toQueryObjects(l, g[l], d));
}
}
for (k = 0, m = h.length; k < m; k++) {
b = h[k];
n = b.value;
if (Ext.isEmpty(n)) {
n = "";
} else {
if (Ext.isDate(n)) {
n = Ext.Date.toString(n);
}
}
e.push(
encodeURIComponent(b.name) +
"=" +
encodeURIComponent(String(n))
);
}
return e.join("&");
},
fromQueryString: function(d, s) {
var m = d.replace(/^\?/, "").split("&"),
v = {},
t,
k,
x,
n,
r,
g,
p,
q,
b,
h,
u,
l,
w,
e;
for (r = 0, g = m.length; r < g; r++) {
p = m[r];
if (p.length > 0) {
k = p.split("=");
x = decodeURIComponent(k[0]);
n = k[1] !== undefined ? decodeURIComponent(k[1]) : "";
if (!s) {
if (v.hasOwnProperty(x)) {
if (!Ext.isArray(v[x])) {
v[x] = [v[x]];
}
v[x].push(n);
} else {
v[x] = n;
}
} else {
h = x.match(/(\[):?([^\]]*)\]/g);
u = x.match(/^([^\[]+)/);
if (!u) {
Ext.Error.raise({
sourceClass: "Ext.Object",
sourceMethod: "fromQueryString",
queryString: d,
recursive: s,
msg:
'Malformed query string given, failed parsing name from "' +
p +
'"'
});
}
x = u[0];
l = [];
if (h === null) {
v[x] = n;
continue;
}
for (q = 0, b = h.length; q < b; q++) {
w = h[q];
w =
w.length === 2
? ""
: w.substring(1, w.length - 1);
l.push(w);
}
l.unshift(x);
t = v;
for (q = 0, b = l.length; q < b; q++) {
w = l[q];
if (q === b - 1) {
if (Ext.isArray(t) && w === "") {
t.push(n);
} else {
t[w] = n;
}
} else {
if (
t[w] === undefined ||
typeof t[w] === "string"
) {
e = l[q + 1];
t[w] =
Ext.isNumeric(e) || e === "" ? [] : {};
}
t = t[w];
}
}
}
}
}
return v;
},
each: function(b, e, d) {
for (var g in b) {
if (b.hasOwnProperty(g)) {
if (e.call(d || b, g, b[g], b) === false) {
return;
}
}
}
},
merge: function(k, e, j) {
if (typeof e === "string") {
if (j && j.constructor === Object) {
if (k[e] && k[e].constructor === Object) {
a.merge(k[e], j);
} else {
k[e] = Ext.clone(j);
}
} else {
k[e] = j;
}
return k;
}
var d = 1,
g = arguments.length,
b,
h;
for (; d < g; d++) {
b = arguments[d];
for (h in b) {
if (b.hasOwnProperty(h)) {
a.merge(k, h, b[h]);
}
}
}
return k;
},
getKey: function(b, e) {
for (var d in b) {
if (b.hasOwnProperty(d) && b[d] === e) {
return d;
}
}
return null;
},
getValues: function(d) {
var b = [],
e;
for (e in d) {
if (d.hasOwnProperty(e)) {
b.push(d[e]);
}
}
return b;
},
getKeys:
"keys" in Object.prototype
? Object.keys
: function(b) {
var d = [],
e;
for (e in b) {
if (b.hasOwnProperty(e)) {
d.push(e);
}
}
return d;
},
getSize: function(b) {
var d = 0,
e;
for (e in b) {
if (b.hasOwnProperty(e)) {
d++;
}
}
return d;
}
});
Ext.merge = Ext.Object.merge;
Ext.urlEncode = function() {
var b = Ext.Array.from(arguments),
d = "";
if (typeof b[1] === "string") {
d = b[1] + "&";
b[1] = false;
}
return d + Ext.Object.toQueryString.apply(Ext.Object, b);
};
Ext.urlDecode = function() {
return Ext.Object.fromQueryString.apply(Ext.Object, arguments);
};
})();
(function() {
function b(e) {
var d = Array.prototype.slice.call(arguments, 1);
return e.replace(/\{(\d+)\}/g, function(g, h) {
return d[h];
});
}
Ext.Date = {
now:
Date.now ||
function() {
return +new Date();
},
toString: function(d) {
var e = Ext.String.leftPad;
return (
d.getFullYear() +
"-" +
e(d.getMonth() + 1, 2, "0") +
"-" +
e(d.getDate(), 2, "0") +
"T" +
e(d.getHours(), 2, "0") +
":" +
e(d.getMinutes(), 2, "0") +
":" +
e(d.getSeconds(), 2, "0")
);
},
getElapsed: function(e, d) {
return Math.abs(e - (d || new Date()));
},
useStrict: false,
formatCodeToRegex: function(e, d) {
var g = a.parseCodes[e];
if (g) {
g = typeof g == "function" ? g() : g;
a.parseCodes[e] = g;
}
return g
? Ext.applyIf({ c: g.c ? b(g.c, d || "{0}") : g.c }, g)
: { g: 0, c: null, s: Ext.String.escapeRegex(e) };
},
parseFunctions: {
MS: function(e, d) {
var g = new RegExp(
"\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/"
);
var h = (e || "").match(g);
return h ? new Date(((h[1] || "") + h[2]) * 1) : null;
}
},
parseRegexes: [],
formatFunctions: {
MS: function() {
return "\\/Date(" + this.getTime() + ")\\/";
}
},
y2kYear: 50,
MILLI: "ms",
SECOND: "s",
MINUTE: "mi",
HOUR: "h",
DAY: "d",
MONTH: "mo",
YEAR: "y",
defaults: {},
dayNames: [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
monthNames: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
monthNumbers: {
Jan: 0,
Feb: 1,
Mar: 2,
Apr: 3,
May: 4,
Jun: 5,
Jul: 6,
Aug: 7,
Sep: 8,
Oct: 9,
Nov: 10,
Dec: 11
},
defaultFormat: "m/d/Y",
getShortMonthName: function(d) {
return a.monthNames[d].substring(0, 3);
},
getShortDayName: function(d) {
return a.dayNames[d].substring(0, 3);
},
getMonthNumber: function(d) {
return a.monthNumbers[
d.substring(0, 1).toUpperCase() +
d.substring(1, 3).toLowerCase()
];
},
formatContainsHourInfo: (function() {
var e = /(\\.)/g,
d = /([gGhHisucUOPZ]|MS)/;
return function(g) {
return d.test(g.replace(e, ""));
};
})(),
formatContainsDateInfo: (function() {
var e = /(\\.)/g,
d = /([djzmnYycU]|MS)/;
return function(g) {
return d.test(g.replace(e, ""));
};
})(),
formatCodes: {
d: "Ext.String.leftPad(this.getDate(), 2, '0')",
D: "Ext.Date.getShortDayName(this.getDay())",
j: "this.getDate()",
l: "Ext.Date.dayNames[this.getDay()]",
N: "(this.getDay() ? this.getDay() : 7)",
S: "Ext.Date.getSuffix(this)",
w: "this.getDay()",
z: "Ext.Date.getDayOfYear(this)",
W: "Ext.String.leftPad(Ext.Date.getWeekOfYear(this), 2, '0')",
F: "Ext.Date.monthNames[this.getMonth()]",
m: "Ext.String.leftPad(this.getMonth() + 1, 2, '0')",
M: "Ext.Date.getShortMonthName(this.getMonth())",
n: "(this.getMonth() + 1)",
t: "Ext.Date.getDaysInMonth(this)",
L: "(Ext.Date.isLeapYear(this) ? 1 : 0)",
o:
"(this.getFullYear() + (Ext.Date.getWeekOfYear(this) == 1 && this.getMonth() > 0 ? +1 : (Ext.Date.getWeekOfYear(this) >= 52 && this.getMonth() < 11 ? -1 : 0)))",
Y: "Ext.String.leftPad(this.getFullYear(), 4, '0')",
y: "('' + this.getFullYear()).substring(2, 4)",
a: "(this.getHours() < 12 ? 'am' : 'pm')",
A: "(this.getHours() < 12 ? 'AM' : 'PM')",
g: "((this.getHours() % 12) ? this.getHours() % 12 : 12)",
G: "this.getHours()",
h:
"Ext.String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",
H: "Ext.String.leftPad(this.getHours(), 2, '0')",
i: "Ext.String.leftPad(this.getMinutes(), 2, '0')",
s: "Ext.String.leftPad(this.getSeconds(), 2, '0')",
u: "Ext.String.leftPad(this.getMilliseconds(), 3, '0')",
O: "Ext.Date.getGMTOffset(this)",
P: "Ext.Date.getGMTOffset(this, true)",
T: "Ext.Date.getTimezone(this)",
Z: "(this.getTimezoneOffset() * -60)",
c: function() {
for (
var k = "Y-m-dTH:i:sP", h = [], g = 0, d = k.length;
g < d;
++g
) {
var j = k.charAt(g);
h.push(j == "T" ? "'T'" : a.getFormatCode(j));
}
return h.join(" + ");
},
U: "Math.round(this.getTime() / 1000)"
},
isValid: function(q, e, p, l, j, k, g) {
l = l || 0;
j = j || 0;
k = k || 0;
g = g || 0;
var n = a.add(
new Date(q < 100 ? 100 : q, e - 1, p, l, j, k, g),
a.YEAR,
q < 100 ? q - 100 : 0
);
return (
q == n.getFullYear() &&
e == n.getMonth() + 1 &&
p == n.getDate() &&
l == n.getHours() &&
j == n.getMinutes() &&
k == n.getSeconds() &&
g == n.getMilliseconds()
);
},
parse: function(e, h, d) {
var g = a.parseFunctions;
if (g[h] == null) {
a.createParser(h);
}
return g[h](e, Ext.isDefined(d) ? d : a.useStrict);
},
parseDate: function(e, g, d) {
return a.parse(e, g, d);