+++ /dev/null
-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-\r
-Ext = {version: '2.2.1'};\r
-\r
-// for old browsers\r
-window["undefined"] = window["undefined"];\r
-\r
-/**\r
- * @class Ext\r
- * Ext core utilities and functions.\r
- * @singleton\r
- */\r
-\r
-/**\r
- * Copies all the properties of config to obj.\r
- * @param {Object} obj The receiver of the properties\r
- * @param {Object} config The source of the properties\r
- * @param {Object} defaults A different object that will also be applied for default values\r
- * @return {Object} returns obj\r
- * @member Ext apply\r
- */\r
-Ext.apply = function(o, c, defaults){\r
- if(defaults){\r
- // no "this" reference for friendly out of scope calls\r
- Ext.apply(o, defaults);\r
- }\r
- if(o && c && typeof c == 'object'){\r
- for(var p in c){\r
- o[p] = c[p];\r
- }\r
- }\r
- return o;\r
-};\r
-\r
-(function(){\r
- var idSeed = 0;\r
- var ua = navigator.userAgent.toLowerCase();\r
-\r
- var isStrict = document.compatMode == "CSS1Compat",\r
- isOpera = ua.indexOf("opera") > -1,\r
- isChrome = ua.indexOf("chrome") > -1,\r
- isSafari = !isChrome && (/webkit|khtml/).test(ua),\r
- isSafari3 = isSafari && ua.indexOf('webkit/5') != -1,\r
- isIE = !isOpera && ua.indexOf("msie") > -1,\r
- isIE7 = !isOpera && ua.indexOf("msie 7") > -1,\r
- isIE8 = !isOpera && ua.indexOf("msie 8") > -1,\r
- isGecko = !isSafari && !isChrome && ua.indexOf("gecko") > -1,\r
- isGecko3 = isGecko && ua.indexOf("rv:1.9") > -1,\r
- isBorderBox = isIE && !isStrict,\r
- isWindows = (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1),\r
- isMac = (ua.indexOf("macintosh") != -1 || ua.indexOf("mac os x") != -1),\r
- isAir = (ua.indexOf("adobeair") != -1),\r
- isLinux = (ua.indexOf("linux") != -1),\r
- isSecure = window.location.href.toLowerCase().indexOf("https") === 0;\r
-\r
- // remove css image flicker\r
- if(isIE && !isIE7){\r
- try{\r
- document.execCommand("BackgroundImageCache", false, true);\r
- }catch(e){}\r
- }\r
-\r
- Ext.apply(Ext, {\r
- /**\r
- * True if the browser is in strict (standards-compliant) mode, as opposed to quirks mode\r
- * @type Boolean\r
- */\r
- isStrict : isStrict,\r
- /**\r
- * True if the page is running over SSL\r
- * @type Boolean\r
- */\r
- isSecure : isSecure,\r
- /**\r
- * True when the document is fully initialized and ready for action\r
- * @type Boolean\r
- */\r
- isReady : false,\r
-\r
- /**\r
- * True to automatically uncache orphaned Ext.Elements periodically (defaults to true)\r
- * @type Boolean\r
- */\r
- enableGarbageCollector : true,\r
-\r
- /**\r
- * True to automatically purge event listeners after uncaching an element (defaults to false).\r
- * Note: this only happens if enableGarbageCollector is true.\r
- * @type Boolean\r
- */\r
- enableListenerCollection:false,\r
-\r
-\r
- /**\r
- * URL to a blank file used by Ext when in secure mode for iframe src and onReady src to prevent\r
- * the IE insecure content warning (defaults to javascript:false).\r
- * @type String\r
- */\r
- SSL_SECURE_URL : "javascript:false",\r
-\r
- /**\r
- * URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images. (Defaults to\r
- * "http://extjs.com/s.gif" and you should change this to a URL on your server).\r
- * @type String\r
- */\r
- BLANK_IMAGE_URL : "http:/"+"/extjs.com/s.gif",\r
-\r
- /**\r
- * A reusable empty function\r
- * @property\r
- * @type Function\r
- */\r
- emptyFn : function(){},\r
-\r
- /**\r
- * Copies all the properties of config to obj if they don't already exist.\r
- * @param {Object} obj The receiver of the properties\r
- * @param {Object} config The source of the properties\r
- * @return {Object} returns obj\r
- */\r
- applyIf : function(o, c){\r
- if(o && c){\r
- for(var p in c){\r
- if(typeof o[p] == "undefined"){ o[p] = c[p]; }\r
- }\r
- }\r
- return o;\r
- },\r
-\r
- /**\r
- * Applies event listeners to elements by selectors when the document is ready.\r
- * The event name is specified with an @ suffix.\r
-<pre><code>\r
-Ext.addBehaviors({\r
- // add a listener for click on all anchors in element with id foo\r
- '#foo a@click' : function(e, t){\r
- // do something\r
- },\r
-\r
- // add the same listener to multiple selectors (separated by comma BEFORE the @)\r
- '#foo a, #bar span.some-class@mouseover' : function(){\r
- // do something\r
- }\r
-});\r
-</code></pre>\r
- * @param {Object} obj The list of behaviors to apply\r
- */\r
- addBehaviors : function(o){\r
- if(!Ext.isReady){\r
- Ext.onReady(function(){\r
- Ext.addBehaviors(o);\r
- });\r
- return;\r
- }\r
- var cache = {}; // simple cache for applying multiple behaviors to same selector does query multiple times\r
- for(var b in o){\r
- var parts = b.split('@');\r
- if(parts[1]){ // for Object prototype breakers\r
- var s = parts[0];\r
- if(!cache[s]){\r
- cache[s] = Ext.select(s);\r
- }\r
- cache[s].on(parts[1], o[b]);\r
- }\r
- }\r
- cache = null;\r
- },\r
-\r
- /**\r
- * Generates unique ids. If the element already has an id, it is unchanged\r
- * @param {Mixed} el (optional) The element to generate an id for\r
- * @param {String} prefix (optional) Id prefix (defaults "ext-gen")\r
- * @return {String} The generated Id.\r
- */\r
- id : function(el, prefix){\r
- prefix = prefix || "ext-gen";\r
- el = Ext.getDom(el);\r
- var id = prefix + (++idSeed);\r
- return el ? (el.id ? el.id : (el.id = id)) : id;\r
- },\r
-\r
- /**\r
- * Extends one class with another class and optionally overrides members with the passed literal. This class\r
- * also adds the function "override()" to the class that can be used to override\r
- * members on an instance.\r
- * * <p>\r
- * This function also supports a 2-argument call in which the subclass's constructor is\r
- * not passed as an argument. In this form, the parameters are as follows:</p><p>\r
- * <div class="mdetail-params"><ul>\r
- * <li><code>superclass</code>\r
- * <div class="sub-desc">The class being extended</div></li>\r
- * <li><code>overrides</code>\r
- * <div class="sub-desc">A literal with members which are copied into the subclass's\r
- * prototype, and are therefore shared among all instances of the new class.<p>\r
- * This may contain a special member named <tt><b>constructor</b></tt>. This is used\r
- * to define the constructor of the new class, and is returned. If this property is\r
- * <i>not</i> specified, a constructor is generated and returned which just calls the\r
- * superclass's constructor passing on its parameters.</p></div></li>\r
- * </ul></div></p><p>\r
- * For example, to create a subclass of the Ext GridPanel:\r
- * <pre><code>\r
- MyGridPanel = Ext.extend(Ext.grid.GridPanel, {\r
- constructor: function(config) {\r
- // Your preprocessing here\r
- MyGridPanel.superclass.constructor.apply(this, arguments);\r
- // Your postprocessing here\r
- },\r
-\r
- yourMethod: function() {\r
- // etc.\r
- }\r
- });\r
-</code></pre>\r
- * </p>\r
- * @param {Function} subclass The class inheriting the functionality\r
- * @param {Function} superclass The class being extended\r
- * @param {Object} overrides (optional) A literal with members which are copied into the subclass's\r
- * prototype, and are therefore shared between all instances of the new class.\r
- * @return {Function} The subclass constructor.\r
- * @method extend\r
- */\r
- extend : function(){\r
- // inline overrides\r
- var io = function(o){\r
- for(var m in o){\r
- this[m] = o[m];\r
- }\r
- };\r
- var oc = Object.prototype.constructor;\r
-\r
- return function(sb, sp, overrides){\r
- if(typeof sp == 'object'){\r
- overrides = sp;\r
- sp = sb;\r
- sb = overrides.constructor != oc ? overrides.constructor : function(){sp.apply(this, arguments);};\r
- }\r
- var F = function(){}, sbp, spp = sp.prototype;\r
- F.prototype = spp;\r
- sbp = sb.prototype = new F();\r
- sbp.constructor=sb;\r
- sb.superclass=spp;\r
- if(spp.constructor == oc){\r
- spp.constructor=sp;\r
- }\r
- sb.override = function(o){\r
- Ext.override(sb, o);\r
- };\r
- sbp.override = io;\r
- Ext.override(sb, overrides);\r
- sb.extend = function(o){Ext.extend(sb, o);};\r
- return sb;\r
- };\r
- }(),\r
-\r
- /**\r
- * Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name.\r
- * Usage:<pre><code>\r
-Ext.override(MyClass, {\r
- newMethod1: function(){\r
- // etc.\r
- },\r
- newMethod2: function(foo){\r
- // etc.\r
- }\r
-});\r
- </code></pre>\r
- * @param {Object} origclass The class to override\r
- * @param {Object} overrides The list of functions to add to origClass. This should be specified as an object literal\r
- * containing one or more methods.\r
- * @method override\r
- */\r
- override : function(origclass, overrides){\r
- if(overrides){\r
- var p = origclass.prototype;\r
- for(var method in overrides){\r
- p[method] = overrides[method];\r
- }\r
- if(Ext.isIE && overrides.toString != origclass.toString){\r
- p.toString = overrides.toString;\r
- }\r
- }\r
- },\r
-\r
- /**\r
- * Creates namespaces to be used for scoping variables and classes so that they are not global. Usage:\r
- * <pre><code>\r
-Ext.namespace('Company', 'Company.data');\r
-Company.Widget = function() { ... }\r
-Company.data.CustomStore = function(config) { ... }\r
-</code></pre>\r
- * @param {String} namespace1\r
- * @param {String} namespace2\r
- * @param {String} etc\r
- * @method namespace\r
- */\r
- namespace : function(){\r
- var a=arguments, o=null, i, j, d, rt;\r
- for (i=0; i<a.length; ++i) {\r
- d=a[i].split(".");\r
- rt = d[0];\r
- eval('if (typeof ' + rt + ' == "undefined"){' + rt + ' = {};} o = ' + rt + ';');\r
- for (j=1; j<d.length; ++j) {\r
- o[d[j]]=o[d[j]] || {};\r
- o=o[d[j]];\r
- }\r
- }\r
- },\r
-\r
- /**\r
- * Takes an object and converts it to an encoded URL. e.g. Ext.urlEncode({foo: 1, bar: 2}); would return "foo=1&bar=2". Optionally, property values can be arrays, instead of keys and the resulting string that's returned will contain a name/value pair for each array value.\r
- * @param {Object} o\r
- * @return {String}\r
- */\r
- urlEncode : function(o){\r
- if(!o){\r
- return "";\r
- }\r
- var buf = [];\r
- for(var key in o){\r
- var ov = o[key], k = encodeURIComponent(key);\r
- var type = typeof ov;\r
- if(type == 'undefined'){\r
- buf.push(k, "=&");\r
- }else if(type != "function" && type != "object"){\r
- buf.push(k, "=", encodeURIComponent(ov), "&");\r
- }else if(Ext.isDate(ov)){\r
- var s = Ext.encode(ov).replace(/"/g, '');\r
- buf.push(k, "=", s, "&");\r
- }else if(Ext.isArray(ov)){\r
- if (ov.length) {\r
- for(var i = 0, len = ov.length; i < len; i++) {\r
- buf.push(k, "=", encodeURIComponent(ov[i] === undefined ? '' : ov[i]), "&");\r
- }\r
- } else {\r
- buf.push(k, "=&");\r
- }\r
- }\r
- }\r
- buf.pop();\r
- return buf.join("");\r
- },\r
-\r
- /**\r
- * Takes an encoded URL and and converts it to an object. e.g. Ext.urlDecode("foo=1&bar=2"); would return {foo: "1", bar: "2"}\r
- * or Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); would return {foo: "1", bar: ["2", "3", "4"]}.\r
- * @param {String} string\r
- * @param {Boolean} overwrite (optional) Items of the same name will overwrite previous values instead of creating an an array (Defaults to false).\r
- * @return {Object} A literal with members\r
- */\r
- urlDecode : function(string, overwrite){\r
- if(!string || !string.length){\r
- return {};\r
- }\r
- var obj = {};\r
- var pairs = string.split('&');\r
- var pair, name, value;\r
- for(var i = 0, len = pairs.length; i < len; i++){\r
- pair = pairs[i].split('=');\r
- name = decodeURIComponent(pair[0]);\r
- value = decodeURIComponent(pair[1]);\r
- if(overwrite !== true){\r
- if(typeof obj[name] == "undefined"){\r
- obj[name] = value;\r
- }else if(typeof obj[name] == "string"){\r
- obj[name] = [obj[name]];\r
- obj[name].push(value);\r
- }else{\r
- obj[name].push(value);\r
- }\r
- }else{\r
- obj[name] = value;\r
- }\r
- }\r
- return obj;\r
- },\r
-\r
- /**\r
- * Iterates an array calling the passed function with each item, stopping if your function returns false. If the\r
- * passed array is not really an array, your function is called once with it.\r
- * The supplied function is called with (Object item, Number index, Array allItems).\r
- * @param {Array/NodeList/Mixed} array\r
- * @param {Function} fn\r
- * @param {Object} scope\r
- */\r
- each : function(array, fn, scope){\r
- if(typeof array.length == "undefined" || typeof array == "string"){\r
- array = [array];\r
- }\r
- for(var i = 0, len = array.length; i < len; i++){\r
- if(fn.call(scope || array[i], array[i], i, array) === false){ return i; };\r
- }\r
- },\r
-\r
- // deprecated\r
- combine : function(){\r
- var as = arguments, l = as.length, r = [];\r
- for(var i = 0; i < l; i++){\r
- var a = as[i];\r
- if(Ext.isArray(a)){\r
- r = r.concat(a);\r
- }else if(a.length !== undefined && !a.substr){\r
- r = r.concat(Array.prototype.slice.call(a, 0));\r
- }else{\r
- r.push(a);\r
- }\r
- }\r
- return r;\r
- },\r
-\r
- /**\r
- * Escapes the passed string for use in a regular expression\r
- * @param {String} str\r
- * @return {String}\r
- */\r
- escapeRe : function(s) {\r
- return s.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1");\r
- },\r
-\r
- // internal\r
- callback : function(cb, scope, args, delay){\r
- if(typeof cb == "function"){\r
- if(delay){\r
- cb.defer(delay, scope, args || []);\r
- }else{\r
- cb.apply(scope, args || []);\r
- }\r
- }\r
- },\r
-\r
- /**\r
- * Return the dom node for the passed string (id), dom node, or Ext.Element\r
- * @param {Mixed} el\r
- * @return HTMLElement\r
- */\r
- getDom : function(el){\r
- if(!el || !document){\r
- return null;\r
- }\r
- return el.dom ? el.dom : (typeof el == 'string' ? document.getElementById(el) : el);\r
- },\r
-\r
- /**\r
- * Returns the current HTML document object as an {@link Ext.Element}.\r
- * @return Ext.Element The document\r
- */\r
- getDoc : function(){\r
- return Ext.get(document);\r
- },\r
-\r
- /**\r
- * Returns the current document body as an {@link Ext.Element}.\r
- * @return Ext.Element The document body\r
- */\r
- getBody : function(){\r
- return Ext.get(document.body || document.documentElement);\r
- },\r
-\r
- /**\r
- * Shorthand for {@link Ext.ComponentMgr#get}\r
- * @param {String} id\r
- * @return Ext.Component\r
- */\r
- getCmp : function(id){\r
- return Ext.ComponentMgr.get(id);\r
- },\r
-\r
- /**\r
- * Utility method for validating that a value is numeric, returning the specified default value if it is not.\r
- * @param {Mixed} value Should be a number, but any type will be handled appropriately\r
- * @param {Number} defaultValue The value to return if the original value is non-numeric\r
- * @return {Number} Value, if numeric, else defaultValue\r
- */\r
- num : function(v, defaultValue){\r
- if(typeof v != 'number' || isNaN(v)){\r
- return defaultValue;\r
- }\r
- return v;\r
- },\r
-\r
- /**\r
- * Attempts to destroy any objects passed to it by removing all event listeners, removing them from the\r
- * DOM (if applicable) and calling their destroy functions (if available). This method is primarily\r
- * intended for arguments of type {@link Ext.Element} and {@link Ext.Component}, but any subclass of\r
- * {@link Ext.util.Observable} can be passed in. Any number of elements and/or components can be\r
- * passed into this function in a single call as separate arguments.\r
- * @param {Mixed} arg1 An {@link Ext.Element} or {@link Ext.Component} to destroy\r
- * @param {Mixed} arg2 (optional)\r
- * @param {Mixed} etc... (optional)\r
- */\r
- destroy : function(){\r
- for(var i = 0, a = arguments, len = a.length; i < len; i++) {\r
- var as = a[i];\r
- if(as){\r
- if(typeof as.destroy == 'function'){\r
- as.destroy();\r
- }\r
- else if(as.dom){\r
- as.removeAllListeners();\r
- as.remove();\r
- }\r
- }\r
- }\r
- },\r
-\r
- /**\r
- * Removes a DOM node from the document. The body node will be ignored if passed in.\r
- * @param {HTMLElement} node The node to remove\r
- */\r
- removeNode : isIE ? function(){\r
- var d;\r
- return function(n){\r
- if(n && n.tagName != 'BODY'){\r
- d = d || document.createElement('div');\r
- d.appendChild(n);\r
- d.innerHTML = '';\r
- }\r
- }\r
- }() : function(n){\r
- if(n && n.parentNode && n.tagName != 'BODY'){\r
- n.parentNode.removeChild(n);\r
- }\r
- },\r
-\r
- // inpired by a similar function in mootools library\r
- /**\r
- * Returns the type of object that is passed in. If the object passed in is null or undefined it\r
- * return false otherwise it returns one of the following values:<ul>\r
- * <li><b>string</b>: If the object passed is a string</li>\r
- * <li><b>number</b>: If the object passed is a number</li>\r
- * <li><b>boolean</b>: If the object passed is a boolean value</li>\r
- * <li><b>date</b>: If the object passed is a Date object</li>\r
- * <li><b>function</b>: If the object passed is a function reference</li>\r
- * <li><b>object</b>: If the object passed is an object</li>\r
- * <li><b>array</b>: If the object passed is an array</li>\r
- * <li><b>regexp</b>: If the object passed is a regular expression</li>\r
- * <li><b>element</b>: If the object passed is a DOM Element</li>\r
- * <li><b>nodelist</b>: If the object passed is a DOM NodeList</li>\r
- * <li><b>textnode</b>: If the object passed is a DOM text node and contains something other than whitespace</li>\r
- * <li><b>whitespace</b>: If the object passed is a DOM text node and contains only whitespace</li>\r
- * @param {Mixed} object\r
- * @return {String}\r
- */\r
- type : function(o){\r
- if(o === undefined || o === null){\r
- return false;\r
- }\r
- if(o.htmlElement){\r
- return 'element';\r
- }\r
- var t = typeof o;\r
- if(t == 'object' && o.nodeName) {\r
- switch(o.nodeType) {\r
- case 1: return 'element';\r
- case 3: return (/\S/).test(o.nodeValue) ? 'textnode' : 'whitespace';\r
- }\r
- }\r
- if(t == 'object' || t == 'function') {\r
- switch(o.constructor) {\r
- case Array: return 'array';\r
- case RegExp: return 'regexp';\r
- case Date: return 'date';\r
- }\r
- if(typeof o.length == 'number' && typeof o.item == 'function') {\r
- return 'nodelist';\r
- }\r
- }\r
- return t;\r
- },\r
-\r
- /**\r
- * Returns true if the passed value is null, undefined or an empty string.\r
- * @param {Mixed} value The value to test\r
- * @param {Boolean} allowBlank (optional) true to allow empty strings (defaults to false)\r
- * @return {Boolean}\r
- */\r
- isEmpty : function(v, allowBlank){\r
- return v === null || v === undefined || (!allowBlank ? v === '' : false);\r
- },\r
-\r
- /**\r
- * Utility method for validating that a value is non-empty (i.e. i) not null, ii) not undefined, and iii) not an empty string), \r
- * returning the specified default value if it is.\r
- * @param {Mixed} value The value to test\r
- * @param {Mixed} defaultValue The value to return if the original value is empty\r
- * @param {Boolean} allowBlank (optional) true to allow empty strings (defaults to false)\r
- * @return {Mixed} value, if non-empty, else defaultValue\r
- */\r
- value : function(v, defaultValue, allowBlank){\r
- return Ext.isEmpty(v, allowBlank) ? defaultValue : v;\r
- },\r
-\r
- /**\r
- * Returns true if the passed object is a JavaScript array, otherwise false.\r
- * @param {Object} The object to test\r
- * @return {Boolean}\r
- */\r
- isArray : function(v){\r
- return v && typeof v.length == 'number' && typeof v.splice == 'function';\r
- },\r
-\r
- /**\r
- * Returns true if the passed object is a JavaScript date object, otherwise false.\r
- * @param {Object} The object to test\r
- * @return {Boolean}\r
- */\r
- isDate : function(v){\r
- return v && typeof v.getFullYear == 'function';\r
- },\r
-\r
- /**\r
- * True if the detected browser is Opera.\r
- * @type Boolean\r
- */\r
- isOpera : isOpera,\r
- /**\r
- * True if the detected browser is Chrome.\r
- * @type Boolean\r
- */\r
- isChrome : isChrome,\r
- /**\r
- * True if the detected browser is Safari.\r
- * @type Boolean\r
- */\r
- isSafari : isSafari,\r
- /**\r
- * True if the detected browser is Safari 3.x.\r
- * @type Boolean\r
- */\r
- isSafari3 : isSafari3,\r
- /**\r
- * True if the detected browser is Safari 2.x.\r
- * @type Boolean\r
- */\r
- isSafari2 : isSafari && !isSafari3,\r
- /**\r
- * True if the detected browser is Internet Explorer.\r
- * @type Boolean\r
- */\r
- isIE : isIE,\r
- /**\r
- * True if the detected browser is Internet Explorer 6.x.\r
- * @type Boolean\r
- */\r
- isIE6 : isIE && !isIE7 && !isIE8,\r
- /**\r
- * True if the detected browser is Internet Explorer 7.x.\r
- * @type Boolean\r
- */\r
- isIE7 : isIE7,\r
- /**\r
- * True if the detected browser is Internet Explorer 8.x.\r
- * @type Boolean\r
- */\r
- isIE8 : isIE8,\r
- /**\r
- * True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox).\r
- * @type Boolean\r
- */\r
- isGecko : isGecko,\r
- /**\r
- * True if the detected browser uses a pre-Gecko 1.9 layout engine (e.g. Firefox 2.x).\r
- * @type Boolean\r
- */\r
- isGecko2 : isGecko && !isGecko3,\r
- /**\r
- * True if the detected browser uses a Gecko 1.9+ layout engine (e.g. Firefox 3.x).\r
- * @type Boolean\r
- */\r
- isGecko3 : isGecko3,\r
- /**\r
- * True if the detected browser is Internet Explorer running in non-strict mode.\r
- * @type Boolean\r
- */\r
- isBorderBox : isBorderBox,\r
- /**\r
- * True if the detected platform is Linux.\r
- * @type Boolean\r
- */\r
- isLinux : isLinux,\r
- /**\r
- * True if the detected platform is Windows.\r
- * @type Boolean\r
- */\r
- isWindows : isWindows,\r
- /**\r
- * True if the detected platform is Mac OS.\r
- * @type Boolean\r
- */\r
- isMac : isMac,\r
- /**\r
- * True if the detected platform is Adobe Air.\r
- * @type Boolean\r
- */\r
- isAir : isAir,\r
-\r
- /**\r
- * By default, Ext intelligently decides whether floating elements should be shimmed. If you are using flash,\r
- * you may want to set this to true.\r
- * @type Boolean\r
- */\r
- useShims : ((isIE && !isIE7) || (isMac && isGecko && !isGecko3))\r
- });\r
-\r
- // in intellij using keyword "namespace" causes parsing errors\r
- Ext.ns = Ext.namespace;\r
-})();\r
-\r
-Ext.ns("Ext", "Ext.util", "Ext.grid", "Ext.dd", "Ext.tree", "Ext.data",\r
- "Ext.form", "Ext.menu", "Ext.state", "Ext.lib", "Ext.layout", "Ext.app", "Ext.ux");\r
-\r
-\r
-/**\r
- * @class Function\r
- * These functions are available on every Function object (any JavaScript function).\r
- */\r
-Ext.apply(Function.prototype, {\r
- /**\r
- * Creates a callback that passes arguments[0], arguments[1], arguments[2], ...\r
- * Call directly on any function. Example: <code>myFunction.createCallback(arg1, arg2)</code>\r
- * Will create a function that is bound to those 2 args. <b>If a specific scope is required in the\r
- * callback, use {@link #createDelegate} instead.</b> The function returned by createCallback always\r
- * executes in the window scope.\r
- * <p>This method is required when you want to pass arguments to a callback function. If no arguments\r
- * are needed, you can simply pass a reference to the function as a callback (e.g., callback: myFn).\r
- * However, if you tried to pass a function with arguments (e.g., callback: myFn(arg1, arg2)) the function\r
- * would simply execute immediately when the code is parsed. Example usage:\r
- * <pre><code>\r
-var sayHi = function(name){\r
- alert('Hi, ' + name);\r
-}\r
-\r
-// clicking the button alerts "Hi, Fred"\r
-new Ext.Button({\r
- text: 'Say Hi',\r
- renderTo: Ext.getBody(),\r
- handler: sayHi.createCallback('Fred')\r
-});\r
-</code></pre>\r
- * @return {Function} The new function\r
- */\r
- createCallback : function(/*args...*/){\r
- // make args available, in function below\r
- var args = arguments;\r
- var method = this;\r
- return function() {\r
- return method.apply(window, args);\r
- };\r
- },\r
-\r
- /**\r
- * Creates a delegate (callback) that sets the scope to obj.\r
- * Call directly on any function. Example: <code>this.myFunction.createDelegate(this, [arg1, arg2])</code>\r
- * Will create a function that is automatically scoped to obj so that the <tt>this</tt> variable inside the\r
- * callback points to obj. Example usage:\r
- * <pre><code>\r
-var sayHi = function(name){\r
- // Note this use of "this.text" here. This function expects to\r
- // execute within a scope that contains a text property. In this\r
- // example, the "this" variable is pointing to the btn object that\r
- // was passed in createDelegate below.\r
- alert('Hi, ' + name + '. You clicked the "' + this.text + '" button.');\r
-}\r
-\r
-var btn = new Ext.Button({\r
- text: 'Say Hi',\r
- renderTo: Ext.getBody()\r
-});\r
-\r
-// This callback will execute in the scope of the\r
-// button instance. Clicking the button alerts\r
-// "Hi, Fred. You clicked the "Say Hi" button."\r
-btn.on('click', sayHi.createDelegate(btn, ['Fred']));\r
-</code></pre>\r
- * @param {Object} obj (optional) The object for which the scope is set\r
- * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller)\r
- * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding,\r
- * if a number the args are inserted at the specified position\r
- * @return {Function} The new function\r
- */\r
- createDelegate : function(obj, args, appendArgs){\r
- var method = this;\r
- return function() {\r
- var callArgs = args || arguments;\r
- if(appendArgs === true){\r
- callArgs = Array.prototype.slice.call(arguments, 0);\r
- callArgs = callArgs.concat(args);\r
- }else if(typeof appendArgs == "number"){\r
- callArgs = Array.prototype.slice.call(arguments, 0); // copy arguments first\r
- var applyArgs = [appendArgs, 0].concat(args); // create method call params\r
- Array.prototype.splice.apply(callArgs, applyArgs); // splice them in\r
- }\r
- return method.apply(obj || window, callArgs);\r
- };\r
- },\r
-\r
- /**\r
- * Calls this function after the number of millseconds specified, optionally in a specific scope. Example usage:\r
- * <pre><code>\r
-var sayHi = function(name){\r
- alert('Hi, ' + name);\r
-}\r
-\r
-// executes immediately:\r
-sayHi('Fred');\r
-\r
-// executes after 2 seconds:\r
-sayHi.defer(2000, this, ['Fred']);\r
-\r
-// this syntax is sometimes useful for deferring\r
-// execution of an anonymous function:\r
-(function(){\r
- alert('Anonymous');\r
-}).defer(100);\r
-</code></pre>\r
- * @param {Number} millis The number of milliseconds for the setTimeout call (if 0 the function is executed immediately)\r
- * @param {Object} obj (optional) The object for which the scope is set\r
- * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller)\r
- * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding,\r
- * if a number the args are inserted at the specified position\r
- * @return {Number} The timeout id that can be used with clearTimeout\r
- */\r
- defer : function(millis, obj, args, appendArgs){\r
- var fn = this.createDelegate(obj, args, appendArgs);\r
- if(millis){\r
- return setTimeout(fn, millis);\r
- }\r
- fn();\r
- return 0;\r
- },\r
-\r
- /**\r
- * Create a combined function call sequence of the original function + the passed function.\r
- * The resulting function returns the results of the original function.\r
- * The passed fcn is called with the parameters of the original function. Example usage:\r
- * <pre><code>\r
-var sayHi = function(name){\r
- alert('Hi, ' + name);\r
-}\r
-\r
-sayHi('Fred'); // alerts "Hi, Fred"\r
-\r
-var sayGoodbye = sayHi.createSequence(function(name){\r
- alert('Bye, ' + name);\r
-});\r
-\r
-sayGoodbye('Fred'); // both alerts show\r
-</code></pre>\r
- * @param {Function} fcn The function to sequence\r
- * @param {Object} scope (optional) The scope of the passed fcn (Defaults to scope of original function or window)\r
- * @return {Function} The new function\r
- */\r
- createSequence : function(fcn, scope){\r
- if(typeof fcn != "function"){\r
- return this;\r
- }\r
- var method = this;\r
- return function() {\r
- var retval = method.apply(this || window, arguments);\r
- fcn.apply(scope || this || window, arguments);\r
- return retval;\r
- };\r
- },\r
-\r
- /**\r
- * Creates an interceptor function. The passed fcn is called before the original one. If it returns false,\r
- * the original one is not called. The resulting function returns the results of the original function.\r
- * The passed fcn is called with the parameters of the original function. Example usage:\r
- * <pre><code>\r
-var sayHi = function(name){\r
- alert('Hi, ' + name);\r
-}\r
-\r
-sayHi('Fred'); // alerts "Hi, Fred"\r
-\r
-// create a new function that validates input without\r
-// directly modifying the original function:\r
-var sayHiToFriend = sayHi.createInterceptor(function(name){\r
- return name == 'Brian';\r
-});\r
-\r
-sayHiToFriend('Fred'); // no alert\r
-sayHiToFriend('Brian'); // alerts "Hi, Brian"\r
-</code></pre>\r
- * @param {Function} fcn The function to call before the original\r
- * @param {Object} scope (optional) The scope of the passed fcn (Defaults to scope of original function or window)\r
- * @return {Function} The new function\r
- */\r
- createInterceptor : function(fcn, scope){\r
- if(typeof fcn != "function"){\r
- return this;\r
- }\r
- var method = this;\r
- return function() {\r
- fcn.target = this;\r
- fcn.method = method;\r
- if(fcn.apply(scope || this || window, arguments) === false){\r
- return;\r
- }\r
- return method.apply(this || window, arguments);\r
- };\r
- }\r
-});\r
-\r
-/**\r
- * @class String\r
- * These functions are available as static methods on the JavaScript String object.\r
- */\r
-Ext.applyIf(String, {\r
-\r
- /**\r
- * Escapes the passed string for ' and \\r
- * @param {String} string The string to escape\r
- * @return {String} The escaped string\r
- * @static\r
- */\r
- escape : function(string) {\r
- return string.replace(/('|\\)/g, "\\$1");\r
- },\r
-\r
- /**\r
- * Pads the left side of a string with a specified character. This is especially useful\r
- * for normalizing number and date strings. Example usage:\r
- * <pre><code>\r
-var s = String.leftPad('123', 5, '0');\r
-// s now contains the string: '00123'\r
-</code></pre>\r
- * @param {String} string The original string\r
- * @param {Number} size The total length of the output string\r
- * @param {String} char (optional) The character with which to pad the original string (defaults to empty string " ")\r
- * @return {String} The padded string\r
- * @static\r
- */\r
- leftPad : function (val, size, ch) {\r
- var result = new String(val);\r
- if(!ch) {\r
- ch = " ";\r
- }\r
- while (result.length < size) {\r
- result = ch + result;\r
- }\r
- return result.toString();\r
- },\r
-\r
- /**\r
- * Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens. Each\r
- * token must be unique, and must increment in the format {0}, {1}, etc. Example usage:\r
- * <pre><code>\r
-var cls = 'my-class', text = 'Some text';\r
-var s = String.format('<div class="{0}">{1}</div>', cls, text);\r
-// s now contains the string: '<div class="my-class">Some text</div>'\r
-</code></pre>\r
- * @param {String} string The tokenized string to be formatted\r
- * @param {String} value1 The value to replace token {0}\r
- * @param {String} value2 Etc...\r
- * @return {String} The formatted string\r
- * @static\r
- */\r
- format : function(format){\r
- var args = Array.prototype.slice.call(arguments, 1);\r
- return format.replace(/\{(\d+)\}/g, function(m, i){\r
- return args[i];\r
- });\r
- }\r
-});\r
-\r
-/**\r
- * Utility function that allows you to easily switch a string between two alternating values. The passed value\r
- * is compared to the current string, and if they are equal, the other value that was passed in is returned. If\r
- * they are already different, the first value passed in is returned. Note that this method returns the new value\r
- * but does not change the current string.\r
- * <pre><code>\r
-// alternate sort directions\r
-sort = sort.toggle('ASC', 'DESC');\r
-\r
-// instead of conditional logic:\r
-sort = (sort == 'ASC' ? 'DESC' : 'ASC');\r
-</code></pre>\r
- * @param {String} value The value to compare to the current string\r
- * @param {String} other The new value to use if the string already equals the first value passed in\r
- * @return {String} The new value\r
- */\r
-String.prototype.toggle = function(value, other){\r
- return this == value ? other : value;\r
-};\r
-\r
-/**\r
- * Trims whitespace from either end of a string, leaving spaces within the string intact. Example:\r
- * <pre><code>\r
-var s = ' foo bar ';\r
-alert('-' + s + '-'); //alerts "- foo bar -"\r
-alert('-' + s.trim() + '-'); //alerts "-foo bar-"\r
-</code></pre>\r
- * @return {String} The trimmed string\r
- */\r
-String.prototype.trim = function(){\r
- var re = /^\s+|\s+$/g;\r
- return function(){ return this.replace(re, ""); };\r
-}();\r
-/**\r
- * @class Number\r
- */\r
-Ext.applyIf(Number.prototype, {\r
- /**\r
- * Checks whether or not the current number is within a desired range. If the number is already within the\r
- * range it is returned, otherwise the min or max value is returned depending on which side of the range is\r
- * exceeded. Note that this method returns the constrained value but does not change the current number.\r
- * @param {Number} min The minimum number in the range\r
- * @param {Number} max The maximum number in the range\r
- * @return {Number} The constrained value if outside the range, otherwise the current value\r
- */\r
- constrain : function(min, max){\r
- return Math.min(Math.max(this, min), max);\r
- }\r
-});\r
-/**\r
- * @class Array\r
- */\r
-Ext.applyIf(Array.prototype, {\r
- /**\r
- * Checks whether or not the specified object exists in the array.\r
- * @param {Object} o The object to check for\r
- * @return {Number} The index of o in the array (or -1 if it is not found)\r
- */\r
- indexOf : function(o){\r
- for (var i = 0, len = this.length; i < len; i++){\r
- if(this[i] == o) return i;\r
- }\r
- return -1;\r
- },\r
-\r
- /**\r
- * Removes the specified object from the array. If the object is not found nothing happens.\r
- * @param {Object} o The object to remove\r
- * @return {Array} this array\r
- */\r
- remove : function(o){\r
- var index = this.indexOf(o);\r
- if(index != -1){\r
- this.splice(index, 1);\r
- }\r
- return this;\r
- }\r
-});\r
-\r
-/**\r
- Returns the number of milliseconds between this date and date\r
- @param {Date} date (optional) Defaults to now\r
- @return {Number} The diff in milliseconds\r
- @member Date getElapsed\r
- */\r
-Date.prototype.getElapsed = function(date) {\r
- return Math.abs((date || new Date()).getTime()-this.getTime());\r
-};\r