UNPKG

capto

Version:
1,840 lines (1,299 loc) 4.28 MB
/* This file is part of Ext JS 5.0.0.970 Copyright (c) 2011-2014 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. Version: 5.0.0.970 Build date: 2014-06-01 15:45:20 (660862da42511e0f769c1d37b9fd8e156edd73eb) */ var Ext = Ext || window['Ext'] || {}; Ext.Boot = Ext.Boot || (function (emptyFn) { var doc = document, _config = { disableCaching: (/[?&](?:cache|disableCacheBuster)\b/i.test(location.search) || /(^|[ ;])ext-cache=1/.test(doc.cookie)) ? false : true, disableCachingParam: '_dc', loadDelay: false, preserveScripts: true, charset: undefined }, _currentRequest, _suspendedQueue = [], _items = { }, cssRe = /\.css(?:\?|$)/i, pathTailRe = /\/[^\/]*$/, resolverEl = doc.createElement('a'), isBrowser = typeof window !== 'undefined', _environment = { browser: isBrowser, node: !isBrowser && (typeof require === 'function'), phantom: (typeof phantom !== 'undefined' && phantom.fs) }, _listeners = [], _entries = 0, _syncMode = 0; var Boot = { loading: 0, loaded: 0, env: _environment, config: _config, scripts: _items, currentFile: null, canonicalUrl: function (url) { resolverEl.href = url; var ret = resolverEl.href, dc = _config.disableCachingParam, pos = dc ? ret.indexOf(dc + '=') : -1, c, end; if (pos > 0 && ((c = ret.charAt(pos - 1)) === '?' || c === '&')) { end = ret.indexOf('&', pos); end = (end < 0) ? '' : ret.substring(end); if (end && c === '?') { ++pos; end = end.substring(1); } ret = ret.substring(0, pos - 1) + end; } return ret; }, init: function () { var scriptEls = doc.getElementsByTagName('script'), len = scriptEls.length, re = /\/ext(\-[a-z\-]+)?\.js$/, entry, script, src, state, baseUrl, key, n; for(n = 0; n < len; n++) { src = (script = scriptEls[n]).src; if (!src) { continue; } state = script.readyState || null; if (!baseUrl) { if (re.test(src)) { Boot.hasAsync = ("async" in script) || !('readyState' in script); baseUrl = src; } } if (!_items[key = Boot.canonicalUrl(src)]) { _items[key] = entry = { key: key, url: src, done: state === null || state === 'loaded' || state === 'complete', el: script, prop: 'src' }; if (!entry.done) { Boot.watch(entry); } } } if (!baseUrl) { script = scriptEls[scriptEls.length - 1]; baseUrl = script.src; Boot.hasAsync = ("async" in script) || !('readyState' in script); } Boot.baseUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/') + 1); }, create: function (url, key) { var css = url && cssRe.test(url), el = doc.createElement(css ? 'link' : 'script'), prop; if (css) { el.rel = 'stylesheet'; prop = 'href'; } else { el.type = 'text/javascript'; if (!url) { return el; } prop = 'src'; if(Boot.hasAsync) { el.async = false; } } key = key || url; return _items[key] = { key: key, url: url, css: css, done: false, el: el, prop: prop, loaded: false, evaluated: false }; }, getConfig: function(name) { return name ? _config[name] : _config; }, setConfig: function (name, value) { if (typeof name === 'string') { _config[name] = value; } else { for (var s in name) { Boot.setConfig(s, name[s]); } } return Boot; }, getHead: function () { return Boot.docHead || (Boot.docHead = doc.head || doc.getElementsByTagName('head')[0]); }, inject: function (content, url, asset) { var head = Boot.getHead(), base, el, css = false, key = Boot.canonicalUrl(url), entry; if (cssRe.test(url)) { css = true; el = doc.createElement('style'); el.type = 'text/css'; el.textContent = content; if (asset) { if ('id' in asset) { el.id = asset.id; } if ('disabled' in asset) { el.disabled = asset.disabled; } } base = doc.createElement('base'); base.href = key.replace(pathTailRe, '/'); head.appendChild(base); head.appendChild(el); head.removeChild(base); } else { if (url) { content += "\n//@ sourceURL=" + key; } Ext.globalEval(content); } entry = _items[key] || (_items[key] = { key: key, css: css, url: url, el: el }); entry.done = true; return entry; }, load: function (request) { if (request.sync || _syncMode) { return this.loadSync(request); } if (!request.url) { request = { url: request }; } if (_currentRequest) { _suspendedQueue.push(request); } else { Boot.expandLoadOrder(request); var url = request.url, urls = url.charAt ? [ url ] : url, length = urls.length, i; request.urls = urls; request.loaded = 0; request.loading = length; request.charset = request.charset || _config.charset; request.buster = (('cache' in request) ? !request.cache : _config.disableCaching) && (_config.disableCachingParam + '=' + (+new Date())); _currentRequest = request; request.sequential = false; for (i = 0; i < length; ++i) { Boot.loadUrl(urls[i], request); } } return this; }, loadUrl: function(url, request) { var entry, buster = request.buster, charset = request.charset, head = Boot.getHead(), el, key; if (request.prependBaseUrl) { url = Boot.baseUrl + url; } if (request.sequential) { Boot.currentFile = url; } else { Boot.currentFile = null; } key = Boot.canonicalUrl(url); if (!(entry = _items[key])) { _entries++; entry = Boot.create(url, key); el = entry.el; if (!entry.css && charset) { el.charset = charset; } entry.requests = [request]; Boot.watch(entry); if (buster) { url += (url.indexOf('?') === -1 ? '?' : '&') + buster; } if(!Boot.hasAsync && !entry.css) { entry.loaded = false; entry.evaluated = false; var onLoadWas, newOnLoad = function() { entry.loaded = true; var rurls = request.urls, rlen = rurls.length, r, e, k; for(r = 0; r < rlen; r++) { k = Boot.canonicalUrl(rurls[r]); e = _items[k]; if(e) { if(!e.loaded) { return; } else if(!e.evaluated) { head.appendChild(e.el); e.evaluated = true; e.onLoadWas.apply(e.el, arguments); } } } }; if (!('readyState' in el)) { onLoadWas = el.onload; el.onload = newOnLoad; } else { onLoadWas = el.onreadystatechange; el.onreadystatechange = function() { if (this.readyState === 'loaded' || this.readyState === 'complete') { newOnLoad.apply(this, arguments); } }; } entry.onLoadWas = onLoadWas; el[entry.prop] = url; } else { el[entry.prop] = url; head.appendChild(el); } } else if (entry.done) { Boot.notify(entry, request); } else if (entry.requests) { entry.requests.push(request); } else { entry.requests = [ request ]; } }, loadSequential: function(request) { if(!request.url) { request = { url: request } } request.sequential = true; Boot.load(request); }, loadSequentialBasePrefix: function(request) { if(!request.url) { request = { url: request }; } request.prependBaseUrl = true; Boot.loadSequential(request); }, fetchSync: function(url) { var exception, xhr, status, content; exception = false; xhr = new XMLHttpRequest(); try { xhr.open('GET', url, false); xhr.send(null); } catch (e) { exception = true; } status = (xhr.status === 1223) ? 204 : (xhr.status === 0 && ((self.location || {}).protocol === 'file:' || (self.location || {}).protocol === 'ionp:')) ? 200 : xhr.status; content = xhr.responseText; xhr = null; return { content: content, exception: exception, status: status }; }, loadSync: function (request) { _syncMode++; var request = Boot.expandLoadOrder(request.url ? request : {url: request}), url = request.url, urls = url.charAt ? [ url ] : url, length = urls.length, buster = _config.disableCaching && ('?' + _config.disableCachingParam + '=' + (+new Date())), content, entry, i, key, status, exception; request.loading = length; request.urls = urls; request.loaded = 0; _entries++; for (i = 0; i < length; ++i) { url = urls[i]; if (request.prependBaseUrl) { url = Boot.baseUrl + url; } Boot.currentFile = url; key = Boot.canonicalUrl(url); if (!(entry = _items[key])) { _entries++; _items[key] = entry = { key: key, url: url, done: false, requests: [request], el: null }; } else { if (entry.done) { Boot.notify(entry, request); continue; } if (entry.el) { entry.preserve = false; Boot.cleanup(entry); } if (entry.requests) { entry.requests.push(request); } else { entry.requests = [request]; } } entry.sync = true; if (buster) { url += buster; } ++Boot.loading; content = Boot.fetchSync(url); entry.done = true; exception = content.exception; status = content.status; content = content.content || ''; if ((exception || status === 0) && !_environment.phantom) { entry.error = ("Failed loading synchronously via XHR: '" + url + "'. It's likely that the file is either being loaded from a " + "different domain or from the local file system where cross " + "origin requests are not allowed for security reasons. Try " + "asynchronous loading instead.") || true; } else if ((status >= 200 && status < 300) || status === 304 || _environment.phantom || (status === 0 && content.length > 0) ) { Boot.inject(content, url); } else { entry.error = ("Failed loading synchronously via XHR: '" + url + "'. Please verify that the file exists. XHR status code: " + status) || true; } Boot.notifyAll(entry); } _syncMode--; _entries--; Boot.fireListeners(); Boot.currentFile = null; return this; }, loadSyncBasePrefix: function(request) { if(!request.url) { request = { url: request }; } request.prependBaseUrl = true; Boot.loadSync(request); }, notify: function (entry, request) { if (request.preserve) { entry.preserve = true; } ++request.loaded; if (!request.loading) { throw new Error('Unexpected script load notification ' + entry.url); } if (entry.error) { (request.errors || (request.errors = [])).push(entry); } if (! --request.loading) { _currentRequest = null; var errors = request.errors, fn = request[errors ? 'failure' : 'success'], delay = ('delay' in request) ? request.delay : (errors ? 1 : _config.chainDelay), scope = request.scope || request; if (_suspendedQueue.length) { Boot.load(_suspendedQueue.shift()); } if (fn) { if (delay === 0 || delay > 0) { setTimeout(function() { fn.call(scope, request); }, delay); } else { fn.call(scope, request); } } } else if (!_syncMode && request.sequential && (request.loaded < request.urls.length)) { Boot.loadUrl(request.urls[request.loaded], request); } }, notifyAll: function (entry) { var requests = entry.requests, length = requests && requests.length, i; entry.done = true; entry.requests = null; --Boot.loading; ++Boot.loaded; for (i = 0; i < length; ++i) { Boot.notify(entry, requests[i]); } if (!length) { entry.preserve = true; } Boot.cleanup(entry); _entries--; Boot.fireListeners(); }, watch: function (entry) { var el = entry.el, requests = entry.requests, listener = requests && requests[0], onLoadFn = function () { if (!entry.done) { Boot.notifyAll(entry); } }; el.onerror = function () { entry.error = true; Boot.notifyAll(entry); }; entry.preserve = (listener && ('preserve' in listener)) ? listener.preserve : _config.preserveScripts; if (!('readyState' in el)) { el.onload = onLoadFn; } else { el.onreadystatechange = function() { if (this.readyState === 'loaded' || this.readyState === 'complete') { onLoadFn(); } }; } ++Boot.loading; }, cleanup: function (entry) { var el = entry.el, prop; if(!el) { return; } if (!entry.preserve) { entry.el = null; el.parentNode.removeChild(el); for (prop in el) { try { if (prop !== entry.prop) { el[prop] = null; } delete el[prop]; } catch (cleanEx) { } } } el.onload = el.onerror = el.onreadystatechange = emptyFn; }, fireListeners: function() { var listener; while(!_entries && (listener = _listeners.shift())) { listener(); } }, onBootReady: function(listener) { if (!_entries) { listener(); } else { _listeners.push(listener); } }, createLoadOrderMap: function(loadOrder) { var len = loadOrder.length, loadOrderMap = {}, i, element; for(i = 0; i < len; i++) { element = loadOrder[i]; loadOrderMap[element.path] = element; } return loadOrderMap; }, getLoadIndexes: function(index, indexMap, loadOrder, includeUses, skipLoaded) { var item = loadOrder[index], len, i, reqs, key, entry, stop, added, idx, ridx; if(indexMap[index]) { return indexMap; } indexMap[index] = true; stop = false; while(!stop) { added = false; for(idx in indexMap) { if(indexMap.hasOwnProperty(idx)) { item = loadOrder[idx]; if(!item) { continue; } key = Boot.canonicalUrl(item.path); entry = _items[key]; if(!skipLoaded || !entry || !entry.done) { reqs = item.requires; if(includeUses && item.uses) { reqs = reqs.concat(item.uses); } for(len = reqs.length, i = 0; i < len; i++) { ridx = reqs[i]; if(!indexMap[ridx]) { indexMap[ridx] = true; added = true; } } } } } if(!added) { stop = true; } } return indexMap; }, getPathsFromIndexes: function(indexMap, loadOrder) { var indexes = [], paths = [], index, len, i; for(index in indexMap) { if(indexMap.hasOwnProperty(index) && indexMap[index]) { indexes.push(index); } } indexes.sort(function(a, b){ return a-b; }); for (len = indexes.length, i = 0; i < len; i++) { paths.push(loadOrder[indexes[i]].path); } return paths; }, expandUrl: function(url, loadOrder, loadOrderMap, indexMap, includeUses, skipLoaded) { if(typeof url == 'string') { url = [url]; } if(loadOrder) { loadOrderMap = loadOrderMap || Boot.createLoadOrderMap(loadOrder); indexMap = indexMap || {}; var len = url.length, unmapped = [], i, item; for(i = 0; i < len; i++) { item = loadOrderMap[url[i]]; if(item) { Boot.getLoadIndexes(item.idx, indexMap, loadOrder, includeUses, skipLoaded); } else { unmapped.push(url[i]); } } return Boot.getPathsFromIndexes(indexMap, loadOrder).concat(unmapped); } return url; }, expandUrls: function(urls, loadOrder, loadOrderMap, includeUses) { if(typeof urls == "string") { urls = [urls]; } var expanded = [], len = urls.length, i; for(i = 0; i < len; i++) { expanded = expanded.concat( Boot.expandUrl(urls[i], loadOrder, loadOrderMap, {}, includeUses, true)); } if(expanded.length == 0) { expanded = urls; } return expanded; }, expandLoadOrder: function(request) { var urls = request.url, loadOrder = request.loadOrder, loadOrderMap = request.loadOrderMap, expanded; if(!request.expanded) { expanded = Boot.expandUrls(urls, loadOrder, loadOrderMap); request.expanded = true; } else { expanded = urls; } request.url = expanded; if(urls.length != expanded.length) { request.sequential = true; } return request; } }; Ext.disableCacheBuster = function (disable, path) { var date = new Date(); date.setTime(date.getTime() + (disable ? 10*365 : -1) * 24*60*60*1000); date = date.toGMTString(); doc.cookie = 'ext-cache=1; expires=' + date + '; path='+(path || '/'); }; Boot.init(); return Boot; }(function() {})); Ext.globalEval = this.execScript ? function(code) { execScript(code); } : function($$code) { (function(){ var Ext = this.Ext; eval($$code); }()); }; if (!Function.prototype.bind) { (function () { var slice = Array.prototype.slice, bind = function (me) { var args = slice.call(arguments, 1), method = this; if (args.length) { return function () { var t = arguments; return method.apply(me, t.length ? args.concat(slice.call(t)) : args); }; } args = null; return function () { return method.apply(me, arguments); }; }; Function.prototype.bind = bind; bind.$extjs = true; }()); } var Ext = Ext || {}; Ext._startTime = Date.now ? Date.now() : (+ new Date()); (function() { var global = this, objectPrototype = Object.prototype, toString = objectPrototype.toString, enumerables = [ 'valueOf', 'toLocaleString', 'toString', 'constructor'], emptyFn = function () {}, privateFn = function () {}, identityFn = function(o) { return o; }, callOverrideParent = function () { var method = callOverrideParent.caller.caller; return method.$owner.prototype[method.$name].apply(this, arguments); }, manifest = Ext.manifest || {}, i, iterableRe = /\[object\s*(?:Array|Arguments|\w*Collection|\w*List|HTML\s+document\.all\s+class)\]/, MSDateRe = /^\\?\/Date\(([-+])?(\d+)(?:[+-]\d{4})?\)\\?\/$/; Ext.global = global; emptyFn.$nullFn = identityFn.$nullFn = emptyFn.$emptyFn = identityFn.$identityFn = privateFn.$nullFn = true; privateFn.$privacy = 'framework'; Ext['suspendLayouts'] = Ext['resumeLayouts'] = emptyFn; for (i in { toString: 1 }) { enumerables = null; } 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-' }, Ext.buildSettings || {}); Ext.apply(Ext, { idSeed: 0, idPrefix: 'ext-', isSecure: /^https/i.test(window.location.protocol), enableGarbageCollector: false, enableListenerCollection: true, name: Ext.sandboxName || 'Ext', privateFn: privateFn, emptyFn: emptyFn, identityFn: identityFn, frameStartTime: +new Date(), manifest: manifest, debugConfig: Ext.debugConfig || manifest.debug || { hooks: { '*': true } }, validIdRe: /^[a-z_][a-z0-9\-_]*$/i, makeIdSelector: function(id) { if (!Ext.validIdRe.test(id)) { Ext.Error.raise('Invalid id selector: "' + id + '"'); } return '#' + id; }, id: function(o, prefix) { if (o && o.id) { return o.id; } var id = (prefix || Ext.idPrefix) + (++Ext.idSeed); if (o) { o.id = id; } return id; }, returnId: function(o) { return o.getId(); }, returnTrue: function() { return true; }, emptyString: new String(), baseCSSPrefix: Ext.buildSettings.baseCSSPrefix, $eventNameMap: {}, applyIf: function(object, config) { var property; if (object) { for (property in config) { if (object[property] === undefined) { object[property] = config[property]; } } } return object; }, now: (global.performance && global.performance.now) ? function() { return performance.now(); } : (Date.now || (Date.now = function() { return +new Date(); })), destroy: function() { var ln = arguments.length, i, arg; for (i = 0; i < ln; i++) { arg = arguments[i]; if (arg) { if (Ext.isArray(arg)) { this.destroy.apply(this, arg); } else if (Ext.isFunction(arg.destroy)) { arg.destroy(); } } } return null; }, destroyMembers: function (object) { for (var ref, name, i = 1, a = arguments, len = a.length; i < len; i++) { ref = object[name = a[i]]; if (ref != null) { object[name] = Ext.destroy(ref); } } }, 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') { if (owner.$className) { value.displayName = owner.$className + '#' + name; } value.$name = name; value.$owner = owner; value.$previous = target.hasOwnProperty(name) ? target[name] : callOverrideParent; } target[name] = value; } } } else { Ext.apply(target, overrides); } } return target; }, valueFrom: function(value, defaultValue, allowBlank){ return Ext.isEmpty(value, allowBlank) ? defaultValue : value; }, isEmpty: function(value, allowEmptyString) { return (value == null) || (!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]'; }, isMSDate: function(value) { if (!Ext.isString(value)) { return false; } return MSDateRe.test(value); }, 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 !!value && toString.call(value) === '[object Function]'; } : function(value) { return !!value && 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) { if (!value || typeof value.length !== 'number' || typeof value === 'string' || Ext.isFunction(value)) { return false; } if (!value.propertyIsEnumerable) { return !!value.item; } if (value.hasOwnProperty('length') && !value.propertyIsEnumerable('length')) { return true; } return iterableRe.test(toString.call(value)); }, isDebugEnabled: function (className, defaultEnabled) { var debugConfig = Ext.debugConfig.hooks; if (debugConfig.hasOwnProperty(className)) { return debugConfig[className]; } var enabled = debugConfig['*'], prefixLength = 0; if (defaultEnabled !== undefined) { enabled = defaultEnabled; } if (!className) { return enabled; } for (var prefix in debugConfig) { var value = debugConfig[prefix]; if (className.charAt(prefix.length) === '.') { if (className.substring(0, prefix.length) === prefix) { if (prefixLength < prefix.length) { prefixLength = prefix.length; enabled = value; } } } } return enabled; } || emptyFn, clone: function(item) { if (item === null || item === undefined) { return item; } if (item.nodeType && item.cloneNode) { return item.cloneNode(true); } var type = toString.call(item), i, j, k, clone, key; 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]; if (item.hasOwnProperty(k)) { clone[k] = item[k]; } } } } return clone || item; }, getUniqueGlobalNamespace: function() { var uniqueGlobalNamespace = this.uniqueGlobalNamespace, i; if (uniqueGlobalNamespace === undefined) { i = 0; do { uniqueGlobalNamespace = 'ExtBox' + (++i); } while (global[uniqueGlobalNamespace] !== undefined); 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 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: { log: function(message, priority) { if (message && global.console) { if (!priority || !(priority in global.console)) { priority = 'log'; } message = '[' + priority.toUpperCase() + '] ' + message; global.console[priority](message); } }, verbose: function(message) { this.log(message, 'verbose'); }, info: function(message) { this.log(message, 'info'); }, warn: function(message) { this.log(message, 'warn'); }, error: function(message) { throw new Error(message); }, deprecate: function(message) { this.log(message, 'warn'); } } || { verbose: emptyFn, log: emptyFn, info: emptyFn, warn: emptyFn, error: function(message) { throw new Error(message); }, deprecate: emptyFn }, getElementById: function(id) { return document.getElementById(id); }, splitAndUnescape: (function() { var cache = {}; return function(origin, delimiter) { if (!origin) { return []; } else if (!delimiter) { return [origin]; } var replaceRe = cache[delimiter] || (cache[delimiter] = new RegExp('\\\\' + delimiter, 'g')), result = [], parts, part; parts = origin.split(delimiter); while ((part = parts.shift()) !== undefined) { while (part.charAt(part.length - 1) === '\\' && parts.length > 0) { part = part + delimiter + parts.shift(); } part = part.replace(replaceRe, delimiter); result.push(part); } return result; } })() }); Ext.returnTrue.$nullFn = Ext.returnId.$nullFn = true; }()); (function() { function toString() { var me = this, cls = me.sourceClass, method = me.sourceMethod, msg = me.msg; if (method) { if (msg) { method += '(): '; method += msg; } else { method += '()'; } } if (cls) { method = method ? (cls + '.' + method) : cls; } return method || msg || ''; } Ext.Error = function(config) { if (Ext.isString(config)) { config = { msg: config }; } var error = new Error(); Ext.apply(error, config); error.message = error.message || error.msg; error.toString = toString; return error; }; Ext.apply(Ext.Error, { ignore: false, raise: function(err) { err = err || {}; if (Ext.isString(err)) { err = { msg: err }; } var me = this, method = me.raise.caller, msg, name; if (method) { if (!err.sourceMethod && (name = method.$name)) { err.sourceMethod = name; } if (!err.sourceClass && (name = method.$owner) && (name = name.$className)) { err.sourceClass = name; } } if (me.handle(err) !== true) { msg = toString.call(err); Ext.log({ msg: msg, level: 'error', dump: err, stack: true }); throw new Ext.Error(err); } }, handle: function () { return this.ignore; } }); })(); Ext.deprecated = function (suggestion) { if (!suggestion) { suggestion = ''; } function fail () { Ext.Error.raise('The method "' + fail.$owner.$className + '.' + fail.$name + '" has been removed. ' + suggestion); } return fail; return Ext.emptyFn; }; (function () { if (typeof window === 'undefined') { return; } var win = Ext.global, last = 0, notify = function() { var cnt = Ext.log && Ext.log.counters, n = cnt && (cnt.error + cnt.warn + cnt.info + cnt.log), msg; if (n && last !== n) { msg = []; if (cnt.error) { msg.push('Errors: ' + cnt.error); } if (cnt.warn) { msg.push('Warnings: ' + cnt.warn); } if (cnt.info) { msg.push('Info: ' + cnt.info); } if (cnt.log) { msg.push('Log: ' + cnt.log); } win.status = '*** ' + msg.join(' -- '); last = n; } }; win.setInterval(notify, 1000); }()); Ext.Array = new (function() { var arrayPrototype = Array.prototype, slice = arrayPrototype.slice, supportsSplice = (function () { var array = [], lengthBefore, j = 20; if (!array.splice) { return false; } while (j--) { array.push("A"); } array.splice(15, 0, "F", "F", "F", "F", "F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F"); lengthBefore = array.length; array.splice(13, 0, "XXX"); if (lengthBefore + 1 !== array.length) { return false; } return true; }()), supportsIndexOf = 'indexOf' in arrayPrototype, supportsSliceOnNodeList = true; function stableSort(array, userComparator) { var len = array.length, indices = new Array(len), result = new Array(len), i; for (i = 0; i < len; i++) { indices[i] = i; } indices.sort(function(index1, index2) { return userComparator(array[index1], array[index2]) || (index1 - index2); }); for (i = 0; i < len; i++) { result[i] = array[indices[i]]; } for (i = 0; i < len; i++) { array[i] = result[i]; } return array; } try { if (typeof document !== 'undefined') { slice.call(document.getElementsByTagName('body')); } } catch (e) { supportsSliceOnNodeList = false; } var fixArrayIndex = function (array, index) { return (index < 0) ? Math.max(0, array.length + index) : Math.min(array.length, index); }, replaceSim = function (array, index, removeCount, insert) { var add = insert ? insert.length : 0, length = array.length, pos = fixArrayIndex(array, index); if (pos === length) { if (add) { array.push.apply(array, insert); } } else { var remove = Math.min(removeCount, length - pos), tailOldPos = pos + remove, tailNewPos = tailOldPos + add - remove, tailCount = length - tailOldPos, lengthAfterRemove = length - remove, i; if (tailNewPos < tailOldPos) { for (i = 0; i < tailCount; ++i) { array[tailNewPos+i] = array[tailOldPos+i]; } } else if (tailNewPos > tailOldPos) { for (i = tailCount; i--; ) { array[tailNewPos+i] = array[tailOldPos+i]; } } if (add && pos === lengthAfterRemove) { array.length = lengthAfterRemove; array.push.apply(array, insert); } else { array.length = lengthAfterRemove + add; for (i = 0; i < add; ++i) { array[pos+i] = insert[i