Skip to content

Instantly share code, notes, and snippets.

@dangoor
Last active December 19, 2015 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dangoor/5976111 to your computer and use it in GitHub Desktop.
Save dangoor/5976111 to your computer and use it in GitHub Desktop.
Two Ext files that cause issues with Tern.
/*
This file is part of Ext JS 4.1
Copyright (c) 2011-2012 Sencha Inc
Contact: http://www.sencha.com/contact
Commercial Usage
Licensees holding valid commercial licenses may use this file in accordance with the Commercial
Software License Agreement provided with the Software or, alternatively, in accordance with the
terms contained in a written agreement between you and Sencha.
If you are unsure which license is appropriate for your use, please contact the sales department
at http://www.sencha.com/contact.
Build date: 2012-04-20 14:10:47 (19f55ab932145a3443b228045fa80950dfeaf9cc)
*/
var Ext = Ext || {};
Ext._startTime = new Date().getTime();
(function() {
var global = this,
objectPrototype = Object.prototype,
toString = objectPrototype.toString,
enumerables = true,
enumerablesTest = { toString: 1 },
emptyFn = function () {},
callOverrideParent = function () {
var method = callOverrideParent.caller.caller;
return method.$owner.prototype[method.$name].apply(this, arguments);
},
i;
Ext.global = global;
for (i in enumerablesTest) {
enumerables = null;
}
if (enumerables) {
enumerables = ['hasOwnProperty', 'valueOf', 'isPrototypeOf', 'propertyIsEnumerable',
'toLocaleString', 'toString', 'constructor'];
}
Ext.enumerables = enumerables;
Ext.apply = function(object, config, defaults) {
if (defaults) {
Ext.apply(object, defaults);
}
if (object && config && typeof config === 'object') {
var i, j, k;
for (i in config) {
object[i] = config[i];
}
if (enumerables) {
for (j = enumerables.length; j--;) {
k = enumerables[j];
if (config.hasOwnProperty(k)) {
object[k] = config[k];
}
}
}
}
return object;
};
Ext.buildSettings = Ext.apply({
baseCSSPrefix: 'x-',
scopeResetCSS: false
}, Ext.buildSettings || {});
Ext.apply(Ext, {
name: Ext.sandboxName || 'Ext',
emptyFn: emptyFn,
emptyString: new String(),
baseCSSPrefix: Ext.buildSettings.baseCSSPrefix,
applyIf: function(object, config) {
var property;
if (object) {
for (property in config) {
if (object[property] === undefined) {
object[property] = config[property];
}
}
}
return object;
},
iterate: function(object, fn, scope) {
if (Ext.isEmpty(object)) {
return;
}
if (scope === undefined) {
scope = object;
}
if (Ext.isIterable(object)) {
Ext.Array.each.call(Ext.Array, object, fn, scope);
}
else {
Ext.Object.each.call(Ext.Object, object, fn, scope);
}
}
});
Ext.apply(Ext, {
extend: (function() {
var objectConstructor = objectPrototype.constructor,
inlineOverrides = function(o) {
for (var m in o) {
if (!o.hasOwnProperty(m)) {
continue;
}
this[m] = o[m];
}
};
return function(subclass, superclass, overrides) {
if (Ext.isObject(superclass)) {
overrides = superclass;
superclass = subclass;
subclass = overrides.constructor !== objectConstructor ? overrides.constructor : function() {
superclass.apply(this, arguments);
};
}
var F = function() {},
subclassProto, superclassProto = superclass.prototype;
F.prototype = superclassProto;
subclassProto = subclass.prototype = new F();
subclassProto.constructor = subclass;
subclass.superclass = superclassProto;
if (superclassProto.constructor === objectConstructor) {
superclassProto.constructor = superclass;
}
subclass.override = function(overrides) {
Ext.override(subclass, overrides);
};
subclassProto.override = inlineOverrides;
subclassProto.proto = subclassProto;
subclass.override(overrides);
subclass.extend = function(o) {
return Ext.extend(subclass, o);
};
return subclass;
};
}()),
override: function (target, overrides) {
if (target.$isClass) {
target.override(overrides);
} else if (typeof target == 'function') {
Ext.apply(target.prototype, overrides);
} else {
var owner = target.self,
name, value;
if (owner && owner.$isClass) {
for (name in overrides) {
if (overrides.hasOwnProperty(name)) {
value = overrides[name];
if (typeof value == 'function') {
value.$name = name;
value.$owner = owner;
value.$previous = target.hasOwnProperty(name)
? target[name]
: callOverrideParent;
}
target[name] = value;
}
}
} else {
Ext.apply(target, overrides);
}
}
return target;
}
});
Ext.apply(Ext, {
valueFrom: function(value, defaultValue, allowBlank){
return Ext.isEmpty(value, allowBlank) ? defaultValue : value;
},
typeOf: function(value) {
var type,
typeToString;
if (value === null) {
return 'null';
}
type = typeof value;
if (type === 'undefined' || type === 'string' || type === 'number' || type === 'boolean') {
return type;
}
typeToString = toString.call(value);
switch(typeToString) {
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 (type === 'function') {
return 'function';
}
if (type === 'object') {
if (value.nodeType !== undefined) {
if (value.nodeType === 3) {
return (/\S/).test(value.nodeValue) ? 'textnode' : 'whitespace';
}
else {
return 'element';
}
}
return 'object';
}
},
isEmpty: function(value, allowEmptyString) {
return (value === null) || (value === undefined) || (!allowEmptyString ? value === '' : false) || (Ext.isArray(value) && value.length === 0);
},
isArray: ('isArray' in Array) ? Array.isArray : function(value) {
return toString.call(value) === '[object Array]';
},
isDate: function(value) {
return toString.call(value) === '[object Date]';
},
isObject: (toString.call(null) === '[object Object]') ?
function(value) {
return value !== null && value !== undefined && toString.call(value) === '[object Object]' && value.ownerDocument === undefined;
} :
function(value) {
return toString.call(value) === '[object Object]';
},
isSimpleObject: function(value) {
return value instanceof Object && value.constructor === Object;
},
isPrimitive: function(value) {
var type = typeof value;
return type === 'string' || type === 'number' || type === 'boolean';
},
isFunction:
(typeof document !== 'undefined' && typeof document.getElementsByTagName('body') === 'function') ? function(value) {
return toString.call(value) === '[object Function]';
} : function(value) {
return typeof value === 'function';
},
isNumber: function(value) {
return typeof value === 'number' && isFinite(value);
},
isNumeric: function(value) {
return !isNaN(parseFloat(value)) && isFinite(value);
},
isString: function(value) {
return typeof value === 'string';
},
isBoolean: function(value) {
return typeof value === 'boolean';
},
isElement: function(value) {
return value ? value.nodeType === 1 : false;
},
isTextNode: function(value) {
return value ? value.nodeName === "#text" : false;
},
isDefined: function(value) {
return typeof value !== 'undefined';
},
isIterable: function(value) {
var type = typeof value,
checkLength = false;
if (value && type != 'string') {
if (type == 'function') {
if (Ext.isSafari) {
checkLength = value instanceof NodeList || value instanceof HTMLCollection;
}
} else {
checkLength = true;
}
}
return checkLength ? value.length !== undefined : false;
}
});
Ext.apply(Ext, {
clone: function(item) {
var type,
i,
j,
k,
clone,
key;
if (item === null || item === undefined) {
return item;
}
if (item.nodeType && item.cloneNode) {
return item.cloneNode(true);
}
type = toString.call(item);
if (type === '[object Date]') {
return new Date(item.getTime());
}
if (type === '[object Array]') {
i = item.length;
clone = [];
while (i--) {
clone[i] = Ext.clone(item[i]);
}
}
else if (type === '[object Object]' && item.constructor === Object) {
clone = {};
for (key in item) {
clone[key] = Ext.clone(item[key]);
}
if (enumerables) {
for (j = enumerables.length; j--;) {
k = enumerables[j];
clone[k] = item[k];
}
}
}
return clone || item;
},
getUniqueGlobalNamespace: function() {
var uniqueGlobalNamespace = this.uniqueGlobalNamespace,
i;
if (uniqueGlobalNamespace === undefined) {
i = 0;
do {
uniqueGlobalNamespace = 'ExtBox' + (++i);
} while (Ext.global[uniqueGlobalNamespace] !== undefined);
Ext.global[uniqueGlobalNamespace] = Ext;
this.uniqueGlobalNamespace = uniqueGlobalNamespace;
}
return uniqueGlobalNamespace;
},
functionFactoryCache: {},
cacheableFunctionFactory: function() {
var me = this,
args = Array.prototype.slice.call(arguments),
cache = me.functionFactoryCache,
idx, fn, ln;
if (Ext.isSandboxed) {
ln = args.length;
if (ln > 0) {
ln--;
args[ln] = 'var Ext=window.' + Ext.name + ';' + args[ln];
}
}
idx = args.join('');
fn = cache[idx];
if (!fn) {
fn = Function.prototype.constructor.apply(Function.prototype, args);
cache[idx] = fn;
}
return fn;
},
functionFactory: function() {
var me = this,
args = Array.prototype.slice.call(arguments),
ln;
if (Ext.isSandboxed) {
ln = args.length;
if (ln > 0) {
ln--;
args[ln] = 'var Ext=window.' + Ext.name + ';' + args[ln];
}
}
return Function.prototype.constructor.apply(Function.prototype, args);
},
Logger: {
verbose: emptyFn,
log: emptyFn,
info: emptyFn,
warn: emptyFn,
error: function(message) {
throw new Error(message);
},
deprecate: emptyFn
}
});
Ext.type = Ext.typeOf;
}());
Ext.globalEval = Ext.global.execScript
? function(code) {
execScript(code);
}
: function($$code) {
(function(){
eval($$code);
}());
};
(function() {
var version = '4.1.0', Version;
Ext.Version = Version = Ext.extend(Object, {
constructor: function(version) {
var parts, releaseStartIndex;
if (version instanceof Version) {
return version;
}
this.version = this.shortVersion = String(version).toLowerCase().replace(/_/g, '.').replace(/[\-+]/g, '');
releaseStartIndex = this.version.search(/([^\d\.])/);
if (releaseStartIndex !== -1) {
this.release = this.version.substr(releaseStartIndex, version.length);
this.shortVersion = this.version.substr(0, releaseStartIndex);
}
this.shortVersion = this.shortVersion.replace(/[^\d]/g, '');
parts = this.version.split('.');
this.major = parseInt(parts.shift() || 0, 10);
this.minor = parseInt(parts.shift() || 0, 10);
this.patch = parseInt(parts.shift() || 0, 10);
this.build = parseInt(parts.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(target) {
return Version.compare(this.version, target) === 1;
},
isGreaterThanOrEqual: function(target) {
return Version.compare(this.version, target) >= 0;
},
isLessThan: function(target) {
return Version.compare(this.version, target) === -1;
},
isLessThanOrEqual: function(target) {
return Version.compare(this.version, target) <= 0;
},
equals: function(target) {
return Version.compare(this.version, target) === 0;
},
match: function(target) {
target = String(target);
return this.version.substr(0, target.length) === target;
},
toArray: function() {
return [this.getMajor(), this.getMinor(), this.getPatch(), this.getBuild(), this.getRelease()];
},
getShortVersion: function() {
return this.shortVersion;
},
gt: function() {
return this.isGreaterThan.apply(this, arguments);
},
lt: function() {
return this.isLessThan.apply(this, arguments);
},
gtEq: function() {
return this.isGreaterThanOrEqual.apply(this, arguments);
},
ltEq: function() {
return this.isLessThanOrEqual.apply(this, arguments);
}
});
Ext.apply(Version, {
releaseValueMap: {
'dev': -6,
'alpha': -5,
'a': -5,
'beta': -4,
'b': -4,
'rc': -3,
'#': -2,
'p': -1,
'pl': -1
},
getComponentValue: function(value) {
return !value ? 0 : (isNaN(value) ? this.releaseValueMap[value] || value : parseInt(value, 10));
},
compare: function(current, target) {
var currentValue, targetValue, i;
current = new Version(current).toArray();
target = new Version(target).toArray();
for (i = 0; i < Math.max(current.length, target.length); i++) {
currentValue = this.getComponentValue(current[i]);
targetValue = this.getComponentValue(target[i]);
if (currentValue < targetValue) {
return -1;
} else if (currentValue > targetValue) {
return 1;
}
}
return 0;
}
});
Ext.apply(Ext, {
versions: {},
lastRegisteredVersion: null,
setVersion: function(packageName, version) {
Ext.versions[packageName] = new Version(version);
Ext.lastRegisteredVersion = Ext.versions[packageName];
return this;
},
getVersion: function(packageName) {
if (packageName === undefined) {
return Ext.lastRegisteredVersion;
}
return Ext.versions[packageName];
},
deprecate: function(packageName, since, closure, scope) {
if (Version.compare(Ext.getVersion(packageName), since) < 1) {
closure.call(scope);
}
}
});
Ext.setVersion('core', version);
}());
/*
This file is part of Ext JS 4.2
Copyright (c) 2011-2013 Sencha Inc
Contact: http://www.sencha.com/contact
GNU General Public License Usage
This file may be used under the terms of the GNU General Public License version 3.0 as
published by the Free Software Foundation and appearing in the file LICENSE included in the
packaging of this file.
Please review the following information to ensure the GNU General Public License version 3.0
requirements will be met: http://www.gnu.org/copyleft/gpl.html.
If you are unsure which license is appropriate for your use, please contact the sales department
at http://www.sencha.com/contact.
Build date: 2013-05-16 14:36:50 (f9be68accb407158ba2b1be2c226a6ce1f649314)
*/
var Ext = Ext || {};
if (!Ext.Direct) {
Ext.Direct = {}
}
if (!Ext.Toolbar) {
Ext.Toolbar = {}
}
if (!Ext.app) {
Ext.app = {}
}
if (!Ext.app.domain) {
Ext.app.domain = {}
}
if (!Ext.button) {
Ext.button = {}
}
if (!Ext.chart) {
Ext.chart = {}
}
if (!Ext.chart.axis) {
Ext.chart.axis = {}
}
if (!Ext.chart.series) {
Ext.chart.series = {}
}
if (!Ext.chart.theme) {
Ext.chart.theme = {}
}
if (!Ext.container) {
Ext.container = {}
}
if (!Ext.core) {
Ext.core = {}
}
if (!Ext.data) {
Ext.data = {}
}
if (!Ext.data.association) {
Ext.data.association = {}
}
if (!Ext.data.flash) {
Ext.data.flash = {}
}
if (!Ext.data.proxy) {
Ext.data.proxy = {}
}
if (!Ext.data.reader) {
Ext.data.reader = {}
}
if (!Ext.data.writer) {
Ext.data.writer = {}
}
if (!Ext.dd) {
Ext.dd = {}
}
if (!Ext.direct) {
Ext.direct = {}
}
if (!Ext.dom) {
Ext.dom = {}
}
if (!Ext.draw) {
Ext.draw = {}
}
if (!Ext.draw.engine) {
Ext.draw.engine = {}
}
if (!Ext.flash) {
Ext.flash = {}
}
if (!Ext.form) {
Ext.form = {}
}
if (!Ext.form.Action) {
Ext.form.Action = {}
}
if (!Ext.form.action) {
Ext.form.action = {}
}
if (!Ext.form.field) {
Ext.form.field = {}
}
if (!Ext.fx) {
Ext.fx = {}
}
if (!Ext.fx.target) {
Ext.fx.target = {}
}
if (!Ext.grid) {
Ext.grid = {}
}
if (!Ext.grid.column) {
Ext.grid.column = {}
}
if (!Ext.grid.feature) {
Ext.grid.feature = {}
}
if (!Ext.grid.header) {
Ext.grid.header = {}
}
if (!Ext.grid.locking) {
Ext.grid.locking = {}
}
if (!Ext.grid.plugin) {
Ext.grid.plugin = {}
}
if (!Ext.grid.property) {
Ext.grid.property = {}
}
if (!Ext.layout) {
Ext.layout = {}
}
if (!Ext.layout.boxOverflow) {
Ext.layout.boxOverflow = {}
}
if (!Ext.layout.component) {
Ext.layout.component = {}
}
if (!Ext.layout.component.field) {
Ext.layout.component.field = {}
}
if (!Ext.layout.container) {
Ext.layout.container = {}
}
if (!Ext.layout.container.border) {
Ext.layout.container.border = {}
}
if (!Ext.layout.container.boxOverflow) {
Ext.layout.container.boxOverflow = {}
}
if (!Ext.list) {
Ext.list = {}
}
if (!Ext.menu) {
Ext.menu = {}
}
if (!Ext.panel) {
Ext.panel = {}
}
if (!Ext.perf) {
Ext.perf = {}
}
if (!Ext.picker) {
Ext.picker = {}
}
if (!Ext.resizer) {
Ext.resizer = {}
}
if (!Ext.rtl) {
Ext.rtl = {}
}
if (!Ext.rtl.button) {
Ext.rtl.button = {}
}
if (!Ext.rtl.dd) {
Ext.rtl.dd = {}
}
if (!Ext.rtl.dom) {
Ext.rtl.dom = {}
}
if (!Ext.rtl.form) {
Ext.rtl.form = {}
}
if (!Ext.rtl.form.field) {
Ext.rtl.form.field = {}
}
if (!Ext.rtl.grid) {
Ext.rtl.grid = {}
}
if (!Ext.rtl.grid.column) {
Ext.rtl.grid.column = {}
}
if (!Ext.rtl.grid.plugin) {
Ext.rtl.grid.plugin = {}
}
if (!Ext.rtl.layout) {
Ext.rtl.layout = {}
}
if (!Ext.rtl.layout.component) {
Ext.rtl.layout.component = {}
}
if (!Ext.rtl.layout.component.field) {
Ext.rtl.layout.component.field = {}
}
if (!Ext.rtl.layout.container) {
Ext.rtl.layout.container = {}
}
if (!Ext.rtl.layout.container.boxOverflow) {
Ext.rtl.layout.container.boxOverflow = {}
}
if (!Ext.rtl.panel) {
Ext.rtl.panel = {}
}
if (!Ext.rtl.resizer) {
Ext.rtl.resizer = {}
}
if (!Ext.rtl.selection) {
Ext.rtl.selection = {}
}
if (!Ext.rtl.slider) {
Ext.rtl.slider = {}
}
if (!Ext.rtl.tab) {
Ext.rtl.tab = {}
}
if (!Ext.rtl.tip) {
Ext.rtl.tip = {}
}
if (!Ext.rtl.tree) {
Ext.rtl.tree = {}
}
if (!Ext.rtl.util) {
Ext.rtl.util = {}
}
if (!Ext.rtl.view) {
Ext.rtl.view = {}
}
if (!Ext.selection) {
Ext.selection = {}
}
if (!Ext.slider) {
Ext.slider = {}
}
if (!Ext.state) {
Ext.state = {}
}
if (!Ext.tab) {
Ext.tab = {}
}
if (!Ext.tip) {
Ext.tip = {}
}
if (!Ext.toolbar) {
Ext.toolbar = {}
}
if (!Ext.tree) {
Ext.tree = {}
}
if (!Ext.tree.plugin) {
Ext.tree.plugin = {}
}
if (!Ext.util) {
Ext.util = {}
}
if (!Ext.ux) {
Ext.ux = {}
}
if (!Ext.ux.form) {
Ext.ux.form = {}
}
if (!Ext.view) {
Ext.view = {}
}
if (!Ext.window) {
Ext.window = {}
}
var Ext = Ext || {};
Ext._startTime = new Date().getTime();
(function() {
var a = this,
d = Object.prototype,
b = d.toString,
l = true,
m = {
toString: 1
}, g = function() {}, k = function() {
var i = k.caller.caller;
return i.$owner.prototype[i.$name].apply(this, arguments)
}, e, j = /\S/,
h, c = /\[object\s*(?:Array|Arguments|\w*Collection|\w*List|HTML\s+document\.all\s+class)\]/;
Function.prototype.$extIsFunction = true;
Ext.global = a;
for (e in m) {
l = null
}
if (l) {
l = ["hasOwnProperty", "valueOf", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "constructor"]
}
Ext.enumerables = l;
Ext.apply = function(q, p, s) {
if (s) {
Ext.apply(q, s)
}
if (q && p && typeof p === "object") {
var r, o, n;
for (r in p) {
q[r] = p[r]
}
if (l) {
for (o = l.length; o--;) {
n = l[o];
if (p.hasOwnProperty(n)) {
q[n] = p[n]
}
}
}
}
return q
};
Ext.buildSettings = Ext.apply({
baseCSSPrefix: "x-"
}, Ext.buildSettings || {});
Ext.apply(Ext, {
name: Ext.sandboxName || "Ext",
emptyFn: g,
identityFn: function(i) {
return i
},
emptyString: new String(),
baseCSSPrefix: Ext.buildSettings.baseCSSPrefix,
applyIf: function(n, i) {
var o;
if (n) {
for (o in i) {
if (n[o] === undefined) {
n[o] = i[o]
}
}
}
return n
},
iterate: function(i, o, n) {
if (Ext.isEmpty(i)) {
return
}
if (n === undefined) {
n = i
}
if (Ext.isIterable(i)) {
Ext.Array.each.call(Ext.Array, i, o, n)
} else {
Ext.Object.each.call(Ext.Object, i, o, n)
}
}
});
Ext.apply(Ext, {
extend: (function() {
var i = d.constructor,
n = function(q) {
for (var p in q) {
if (!q.hasOwnProperty(p)) {
continue
}
this[p] = q[p]
}
};
return function(o, t, r) {
if (Ext.isObject(t)) {
r = t;
t = o;
o = r.constructor !== i ? r.constructor : function() {
t.apply(this, arguments)
}
}
var q = function() {}, p, s = t.prototype;
q.prototype = s;
p = o.prototype = new q();
p.constructor = o;
o.superclass = s;
if (s.constructor === i) {
s.constructor = t
}
o.override = function(u) {
Ext.override(o, u)
};
p.override = n;
p.proto = p;
o.override(r);
o.extend = function(u) {
return Ext.extend(o, u)
};
return o
}
}()),
override: function(p, q) {
if (p.$isClass) {
p.override(q)
} else {
if (typeof p == "function") {
Ext.apply(p.prototype, q)
} else {
var i = p.self,
n, o;
if (i && i.$isClass) {
for (n in q) {
if (q.hasOwnProperty(n)) {
o = q[n];
if (typeof o == "function") {
o.$name = n;
o.$owner = i;
o.$previous = p.hasOwnProperty(n) ? p[n] : k
}
p[n] = o
}
}
} else {
Ext.apply(p, q)
}
}
}
return p
}
});
Ext.apply(Ext, {
valueFrom: function(o, i, n) {
return Ext.isEmpty(o, n) ? i : o
},
typeOf: function(n) {
var i, o;
if (n === null) {
return "null"
}
i = typeof n;
if (i === "undefined" || i === "string" || i === "number" || i === "boolean") {
return i
}
o = b.call(n);
switch (o) {
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 (n.nodeType !== undefined) {
if (n.nodeType === 3) {
return (j).test(n.nodeValue) ? "textnode" : "whitespace"
} else {
return "element"
}
}
return "object"
}
},
coerce: function(q, p) {
var o = Ext.typeOf(q),
n = Ext.typeOf(p),
i = typeof q === "string";
if (o !== n) {
switch (n) {
case "string":
return String(q);
case "number":
return Number(q);
case "boolean":
return i && (!q || q === "false") ? false : Boolean(q);
case "null":
return i && (!q || q === "null") ? null : q;
case "undefined":
return i && (!q || q === "undefined") ? undefined : q;
case "date":
return i && isNaN(q) ? Ext.Date.parse(q, Ext.Date.defaultFormat) : Date(Number(q))
}
}
return q
},
isEmpty: function(i, n) {
return (i === null) || (i === undefined) || (!n ? i === "" : false) || (Ext.isArray(i) && i.length === 0)
},
isArray: ("isArray" in Array) ? Array.isArray : function(i) {
return b.call(i) === "[object Array]"
},
isDate: function(i) {
return b.call(i) === "[object Date]"
},
isObject: (b.call(null) === "[object Object]") ? function(i) {
return i !== null && i !== undefined && b.call(i) === "[object Object]" && i.ownerDocument === undefined
} : function(i) {
return b.call(i) === "[object Object]"
},
isSimpleObject: function(i) {
return i instanceof Object && i.constructor === Object
},
isPrimitive: function(n) {
var i = typeof n;
return i === "string" || i === "number" || i === "boolean"
},
isFunction: function(i) {
return !!(i && i.$extIsFunction)
},
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 === 1 : false
},
isTextNode: function(i) {
return i ? i.nodeName === "#text" : false
},
isDefined: function(i) {
return typeof i !== "undefined"
},
isIterable: function(i) {
if (!i || typeof i.length !== "number" || typeof i === "string" || i.$extIsFunction) {
return false
}
if (!i.propertyIsEnumerable) {
return !!i.item
}
if (i.hasOwnProperty("length") && !i.propertyIsEnumerable("length")) {
return true
}
return c.test(b.call(i))
}
});
Ext.apply(Ext, {
clone: function(s) {
var r, q, o, n, t, p;
if (s === null || s === undefined) {
return s
}
if (s.nodeType && s.cloneNode) {
return s.cloneNode(true)
}
r = b.call(s);
if (r === "[object Date]") {
return new Date(s.getTime())
}
if (r === "[object Array]") {
q = s.length;
t = [];
while (q--) {
t[q] = Ext.clone(s[q])
}
} else {
if (r === "[object Object]" && s.constructor === Object) {
t = {};
for (p in s) {
t[p] = Ext.clone(s[p])
}
if (l) {
for (o = l.length; o--;) {
n = l[o];
if (s.hasOwnProperty(n)) {
t[n] = s[n]
}
}
}
}
}
return t || s
},
getUniqueGlobalNamespace: function() {
var o = this.uniqueGlobalNamespace,
n;
if (o === undefined) {
n = 0;
do {
o = "ExtBox" + (++n)
} while (Ext.global[o] !== undefined);
Ext.global[o] = Ext;
this.uniqueGlobalNamespace = o
}
return o
},
functionFactoryCache: {},
cacheableFunctionFactory: function() {
var r = this,
o = Array.prototype.slice.call(arguments),
n = r.functionFactoryCache,
i, p, q;
if (Ext.isSandboxed) {
q = o.length;
if (q > 0) {
q--;
o[q] = "var Ext=window." + Ext.name + ";" + o[q]
}
}
i = o.join("");
p = n[i];
if (!p) {
p = Function.prototype.constructor.apply(Function.prototype, o);
n[i] = p
}
return p
},
functionFactory: function() {
var o = this,
i = Array.prototype.slice.call(arguments),
n;
if (Ext.isSandboxed) {
n = i.length;
if (n > 0) {
n--;
i[n] = "var Ext=window." + Ext.name + ";" + i[n]
}
}
return Function.prototype.constructor.apply(Function.prototype, i)
},
Logger: {
verbose: g,
log: g,
info: g,
warn: g,
error: function(i) {
throw new Error(i)
},
deprecate: g
}
});
Ext.type = Ext.typeOf;
h = Ext.app;
if (!h) {
h = Ext.app = {}
}
Ext.apply(h, {
namespaces: {},
collectNamespaces: function(o) {
var i = Ext.app.namespaces,
n;
for (n in o) {
if (o.hasOwnProperty(n)) {
i[n] = true
}
}
},
addNamespaces: function(p) {
var q = Ext.app.namespaces,
o, n;
if (!Ext.isArray(p)) {
p = [p]
}
for (o = 0, n = p.length; o < n; o++) {
q[p[o]] = true
}
},
clearNamespaces: function() {
Ext.app.namespaces = {}
},
getNamespace: function(n) {
var p = Ext.app.namespaces,
i = "",
o;
for (o in p) {
if (p.hasOwnProperty(o) && o.length > i.length && (o + "." === n.substring(0, o.length + 1))) {
i = o
}
}
return i === "" ? undefined : i
}
})
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment