From: Sean Kellogg Date: Sun, 20 Jun 2010 21:26:46 +0000 (-0700) Subject: Upgrade to ExtJS 3.2.1 - Released 04/27/2010 X-Git-Tag: 3.2.1 X-Git-Url: http://git.ithinksw.org/extjs.git/commitdiff_plain/c8256059947f3aa8f5b0a9a2acf55e2142bb4742 Upgrade to ExtJS 3.2.1 - Released 04/27/2010 --- diff --git a/adapter/ext/ext-base-debug-w-comments.js b/adapter/ext/ext-base-debug-w-comments.js new file mode 100644 index 00000000..fade0079 --- /dev/null +++ b/adapter/ext/ext-base-debug-w-comments.js @@ -0,0 +1,3637 @@ +/*! + * Ext JS Library 3.2.1 + * Copyright(c) 2006-2010 Ext JS, Inc. + * licensing@extjs.com + * http://www.extjs.com/license + */ +// for old browsers +window.undefined = window.undefined; + +/** + * @class Ext + * Ext core utilities and functions. + * @singleton + */ + +Ext = { + /** + * The version of the framework + * @type String + */ + version : '3.2.1', + versionDetail : { + major: 3, + minor: 2, + patch: 1 + } +}; + +/** + * Copies all the properties of config to obj. + * @param {Object} obj The receiver of the properties + * @param {Object} config The source of the properties + * @param {Object} defaults A different object that will also be applied for default values + * @return {Object} returns obj + * @member Ext apply + */ +Ext.apply = function(o, c, defaults){ + // no "this" reference for friendly out of scope calls + if(defaults){ + Ext.apply(o, defaults); + } + if(o && c && typeof c == 'object'){ + for(var p in c){ + o[p] = c[p]; + } + } + return o; +}; + +(function(){ + var idSeed = 0, + toString = Object.prototype.toString, + ua = navigator.userAgent.toLowerCase(), + check = function(r){ + return r.test(ua); + }, + DOC = document, + isStrict = DOC.compatMode == "CSS1Compat", + isOpera = check(/opera/), + isChrome = check(/\bchrome\b/), + isWebKit = check(/webkit/), + isSafari = !isChrome && check(/safari/), + isSafari2 = isSafari && check(/applewebkit\/4/), // unique to Safari 2 + isSafari3 = isSafari && check(/version\/3/), + isSafari4 = isSafari && check(/version\/4/), + isIE = !isOpera && check(/msie/), + isIE7 = isIE && check(/msie 7/), + isIE8 = isIE && check(/msie 8/), + isIE6 = isIE && !isIE7 && !isIE8, + isGecko = !isWebKit && check(/gecko/), + isGecko2 = isGecko && check(/rv:1\.8/), + isGecko3 = isGecko && check(/rv:1\.9/), + isBorderBox = isIE && !isStrict, + isWindows = check(/windows|win32/), + isMac = check(/macintosh|mac os x/), + isAir = check(/adobeair/), + isLinux = check(/linux/), + isSecure = /^https/i.test(window.location.protocol); + + // remove css image flicker + if(isIE6){ + try{ + DOC.execCommand("BackgroundImageCache", false, true); + }catch(e){} + } + + Ext.apply(Ext, { + /** + * URL to a blank file used by Ext when in secure mode for iframe src and onReady src to prevent + * the IE insecure content warning ('about:blank', except for IE in secure mode, which is 'javascript:""'). + * @type String + */ + SSL_SECURE_URL : isSecure && isIE ? 'javascript:""' : 'about:blank', + /** + * True if the browser is in strict (standards-compliant) mode, as opposed to quirks mode + * @type Boolean + */ + isStrict : isStrict, + /** + * True if the page is running over SSL + * @type Boolean + */ + isSecure : isSecure, + /** + * True when the document is fully initialized and ready for action + * @type Boolean + */ + isReady : false, + + /** + * True if the {@link Ext.Fx} Class is available + * @type Boolean + * @property enableFx + */ + + /** + * True to automatically uncache orphaned Ext.Elements periodically (defaults to true) + * @type Boolean + */ + enableGarbageCollector : true, + + /** + * True to automatically purge event listeners during garbageCollection (defaults to false). + * @type Boolean + */ + enableListenerCollection : false, + + /** + * EXPERIMENTAL - True to cascade listener removal to child elements when an element is removed. + * Currently not optimized for performance. + * @type Boolean + */ + enableNestedListenerRemoval : false, + + /** + * Indicates whether to use native browser parsing for JSON methods. + * This option is ignored if the browser does not support native JSON methods. + * Note: Native JSON methods will not work with objects that have functions. + * Also, property names must be quoted, otherwise the data will not parse. (Defaults to false) + * @type Boolean + */ + USE_NATIVE_JSON : false, + + /** + * Copies all the properties of config to obj if they don't already exist. + * @param {Object} obj The receiver of the properties + * @param {Object} config The source of the properties + * @return {Object} returns obj + */ + applyIf : function(o, c){ + if(o){ + for(var p in c){ + if(!Ext.isDefined(o[p])){ + o[p] = c[p]; + } + } + } + return o; + }, + + /** + * Generates unique ids. If the element already has an id, it is unchanged + * @param {Mixed} el (optional) The element to generate an id for + * @param {String} prefix (optional) Id prefix (defaults "ext-gen") + * @return {String} The generated Id. + */ + id : function(el, prefix){ + el = Ext.getDom(el, true) || {}; + if (!el.id) { + el.id = (prefix || "ext-gen") + (++idSeed); + } + return el.id; + }, + + /** + *

Extends one class to create a subclass and optionally overrides members with the passed literal. This method + * also adds the function "override()" to the subclass that can be used to override members of the class.

+ * For example, to create a subclass of Ext GridPanel: + *

+MyGridPanel = Ext.extend(Ext.grid.GridPanel, {
+    constructor: function(config) {
+
+//      Create configuration for this Grid.
+        var store = new Ext.data.Store({...});
+        var colModel = new Ext.grid.ColumnModel({...});
+
+//      Create a new config object containing our computed properties
+//      *plus* whatever was in the config parameter.
+        config = Ext.apply({
+            store: store,
+            colModel: colModel
+        }, config);
+
+        MyGridPanel.superclass.constructor.call(this, config);
+
+//      Your postprocessing here
+    },
+
+    yourMethod: function() {
+        // etc.
+    }
+});
+
+ * + *

This function also supports a 3-argument call in which the subclass's constructor is + * passed as an argument. In this form, the parameters are as follows:

+ *
+ * + * @param {Function} superclass The constructor of class being extended. + * @param {Object} overrides

A literal with members which are copied into the subclass's + * prototype, and are therefore shared between all instances of the new class.

+ *

This may contain a special member named constructor. This is used + * to define the constructor of the new class, and is returned. If this property is + * not specified, a constructor is generated and returned which just calls the + * superclass's constructor passing on its parameters.

+ *

It is essential that you call the superclass constructor in any provided constructor. See example code.

+ * @return {Function} The subclass constructor from the overrides parameter, or a generated one if not provided. + */ + extend : function(){ + // inline overrides + var io = function(o){ + for(var m in o){ + this[m] = o[m]; + } + }; + var oc = Object.prototype.constructor; + + return function(sb, sp, overrides){ + if(typeof sp == 'object'){ + overrides = sp; + sp = sb; + sb = overrides.constructor != oc ? overrides.constructor : function(){sp.apply(this, arguments);}; + } + var F = function(){}, + sbp, + spp = sp.prototype; + + F.prototype = spp; + sbp = sb.prototype = new F(); + sbp.constructor=sb; + sb.superclass=spp; + if(spp.constructor == oc){ + spp.constructor=sp; + } + sb.override = function(o){ + Ext.override(sb, o); + }; + sbp.superclass = sbp.supr = (function(){ + return spp; + }); + sbp.override = io; + Ext.override(sb, overrides); + sb.extend = function(o){return Ext.extend(sb, o);}; + return sb; + }; + }(), + + /** + * Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name. + * Usage:

+Ext.override(MyClass, {
+    newMethod1: function(){
+        // etc.
+    },
+    newMethod2: function(foo){
+        // etc.
+    }
+});
+
+ * @param {Object} origclass The class to override + * @param {Object} overrides The list of functions to add to origClass. This should be specified as an object literal + * containing one or more methods. + * @method override + */ + override : function(origclass, overrides){ + if(overrides){ + var p = origclass.prototype; + Ext.apply(p, overrides); + if(Ext.isIE && overrides.hasOwnProperty('toString')){ + p.toString = overrides.toString; + } + } + }, + + /** + * Creates namespaces to be used for scoping variables and classes so that they are not global. + * Specifying the last node of a namespace implicitly creates all other nodes. Usage: + *

+Ext.namespace('Company', 'Company.data');
+Ext.namespace('Company.data'); // equivalent and preferable to above syntax
+Company.Widget = function() { ... }
+Company.data.CustomStore = function(config) { ... }
+
+ * @param {String} namespace1 + * @param {String} namespace2 + * @param {String} etc + * @return {Object} The namespace object. (If multiple arguments are passed, this will be the last namespace created) + * @method namespace + */ + namespace : function(){ + var o, d; + Ext.each(arguments, function(v) { + d = v.split("."); + o = window[d[0]] = window[d[0]] || {}; + Ext.each(d.slice(1), function(v2){ + o = o[v2] = o[v2] || {}; + }); + }); + return o; + }, + + /** + * 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. + * @param {Object} o + * @param {String} pre (optional) A prefix to add to the url encoded string + * @return {String} + */ + urlEncode : function(o, pre){ + var empty, + buf = [], + e = encodeURIComponent; + + Ext.iterate(o, function(key, item){ + empty = Ext.isEmpty(item); + Ext.each(empty ? key : item, function(val){ + buf.push('&', e(key), '=', (!Ext.isEmpty(val) && (val != key || !empty)) ? (Ext.isDate(val) ? Ext.encode(val).replace(/"/g, '') : e(val)) : ''); + }); + }); + if(!pre){ + buf.shift(); + pre = ''; + } + return pre + buf.join(''); + }, + + /** + * Takes an encoded URL and and converts it to an object. Example:

+Ext.urlDecode("foo=1&bar=2"); // returns {foo: "1", bar: "2"}
+Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {foo: "1", bar: ["2", "3", "4"]}
+
+ * @param {String} string + * @param {Boolean} overwrite (optional) Items of the same name will overwrite previous values instead of creating an an array (Defaults to false). + * @return {Object} A literal with members + */ + urlDecode : function(string, overwrite){ + if(Ext.isEmpty(string)){ + return {}; + } + var obj = {}, + pairs = string.split('&'), + d = decodeURIComponent, + name, + value; + Ext.each(pairs, function(pair) { + pair = pair.split('='); + name = d(pair[0]); + value = d(pair[1]); + obj[name] = overwrite || !obj[name] ? value : + [].concat(obj[name]).concat(value); + }); + return obj; + }, + + /** + * Appends content to the query string of a URL, handling logic for whether to place + * a question mark or ampersand. + * @param {String} url The URL to append to. + * @param {String} s The content to append to the URL. + * @return (String) The resulting URL + */ + urlAppend : function(url, s){ + if(!Ext.isEmpty(s)){ + return url + (url.indexOf('?') === -1 ? '?' : '&') + s; + } + return url; + }, + + /** + * Converts any iterable (numeric indices and a length property) into a true array + * Don't use this on strings. IE doesn't support "abc"[0] which this implementation depends on. + * For strings, use this instead: "abc".match(/./g) => [a,b,c]; + * @param {Iterable} the iterable object to be turned into a true Array. + * @return (Array) array + */ + toArray : function(){ + return isIE ? + function(a, i, j, res){ + res = []; + for(var x = 0, len = a.length; x < len; x++) { + res.push(a[x]); + } + return res.slice(i || 0, j || res.length); + } : + function(a, i, j){ + return Array.prototype.slice.call(a, i || 0, j || a.length); + } + }(), + + isIterable : function(v){ + //check for array or arguments + if(Ext.isArray(v) || v.callee){ + return true; + } + //check for node list type + if(/NodeList|HTMLCollection/.test(toString.call(v))){ + return true; + } + //NodeList has an item and length property + //IXMLDOMNodeList has nextNode method, needs to be checked first. + return ((typeof v.nextNode != 'undefined' || v.item) && Ext.isNumber(v.length)); + }, + + /** + * Iterates an array calling the supplied function. + * @param {Array/NodeList/Mixed} array The array to be iterated. If this + * argument is not really an array, the supplied function is called once. + * @param {Function} fn The function to be called with each item. If the + * supplied function returns false, iteration stops and this method returns + * the current index. This function is called with + * the following arguments: + *
+ * @param {Object} scope The scope (this reference) in which the specified function is executed. + * Defaults to the item at the current index + * within the passed array. + * @return See description for the fn parameter. + */ + each : function(array, fn, scope){ + if(Ext.isEmpty(array, true)){ + return; + } + if(!Ext.isIterable(array) || Ext.isPrimitive(array)){ + array = [array]; + } + for(var i = 0, len = array.length; i < len; i++){ + if(fn.call(scope || array[i], array[i], i, array) === false){ + return i; + }; + } + }, + + /** + * Iterates either the elements in an array, or each of the properties in an object. + * Note: If you are only iterating arrays, it is better to call {@link #each}. + * @param {Object/Array} object The object or array to be iterated + * @param {Function} fn The function to be called for each iteration. + * The iteration will stop if the supplied function returns false, or + * all array elements / object properties have been covered. The signature + * varies depending on the type of object being interated: + *
+ * @param {Object} scope The scope (this reference) in which the specified function is executed. Defaults to + * the object being iterated. + */ + iterate : function(obj, fn, scope){ + if(Ext.isEmpty(obj)){ + return; + } + if(Ext.isIterable(obj)){ + Ext.each(obj, fn, scope); + return; + }else if(typeof obj == 'object'){ + for(var prop in obj){ + if(obj.hasOwnProperty(prop)){ + if(fn.call(scope || obj, prop, obj[prop], obj) === false){ + return; + }; + } + } + } + }, + + /** + * Return the dom node for the passed String (id), dom node, or Ext.Element. + * Optional 'strict' flag is needed for IE since it can return 'name' and + * 'id' elements by using getElementById. + * Here are some examples: + *

+// gets dom node based on id
+var elDom = Ext.getDom('elId');
+// gets dom node based on the dom node
+var elDom1 = Ext.getDom(elDom);
+
+// If we don't know if we are working with an
+// Ext.Element or a dom node use Ext.getDom
+function(el){
+    var dom = Ext.getDom(el);
+    // do something with the dom node
+}
+         * 
+ * Note: the dom node to be found actually needs to exist (be rendered, etc) + * when this method is called to be successful. + * @param {Mixed} el + * @return HTMLElement + */ + getDom : function(el, strict){ + if(!el || !DOC){ + return null; + } + if (el.dom){ + return el.dom; + } else { + if (typeof el == 'string') { + var e = DOC.getElementById(el); + // IE returns elements with the 'name' and 'id' attribute. + // we do a strict check to return the element with only the id attribute + if (e && isIE && strict) { + if (el == e.getAttribute('id')) { + return e; + } else { + return null; + } + } + return e; + } else { + return el; + } + } + }, + + /** + * Returns the current document body as an {@link Ext.Element}. + * @return Ext.Element The document body + */ + getBody : function(){ + return Ext.get(DOC.body || DOC.documentElement); + }, + + /** + * Removes a DOM node from the document. + */ + /** + *

Removes this element from the document, removes all DOM event listeners, and deletes the cache reference. + * All DOM event listeners are removed from this element. If {@link Ext#enableNestedListenerRemoval} is + * true, then DOM event listeners are also removed from all child nodes. The body node + * will be ignored if passed in.

+ * @param {HTMLElement} node The node to remove + */ + removeNode : isIE && !isIE8 ? function(){ + var d; + return function(n){ + if(n && n.tagName != 'BODY'){ + (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n); + d = d || DOC.createElement('div'); + d.appendChild(n); + d.innerHTML = ''; + delete Ext.elCache[n.id]; + } + } + }() : function(n){ + if(n && n.parentNode && n.tagName != 'BODY'){ + (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n); + n.parentNode.removeChild(n); + delete Ext.elCache[n.id]; + } + }, + + /** + *

Returns true if the passed value is empty.

+ *

The value is deemed to be empty if it is

+ * @param {Mixed} value The value to test + * @param {Boolean} allowBlank (optional) true to allow empty strings (defaults to false) + * @return {Boolean} + */ + isEmpty : function(v, allowBlank){ + return v === null || v === undefined || ((Ext.isArray(v) && !v.length)) || (!allowBlank ? v === '' : false); + }, + + /** + * Returns true if the passed value is a JavaScript array, otherwise false. + * @param {Mixed} value The value to test + * @return {Boolean} + */ + isArray : function(v){ + return toString.apply(v) === '[object Array]'; + }, + + /** + * Returns true if the passed object is a JavaScript date object, otherwise false. + * @param {Object} object The object to test + * @return {Boolean} + */ + isDate : function(v){ + return toString.apply(v) === '[object Date]'; + }, + + /** + * Returns true if the passed value is a JavaScript Object, otherwise false. + * @param {Mixed} value The value to test + * @return {Boolean} + */ + isObject : function(v){ + return !!v && Object.prototype.toString.call(v) === '[object Object]'; + }, + + /** + * Returns true if the passed value is a JavaScript 'primitive', a string, number or boolean. + * @param {Mixed} value The value to test + * @return {Boolean} + */ + isPrimitive : function(v){ + return Ext.isString(v) || Ext.isNumber(v) || Ext.isBoolean(v); + }, + + /** + * Returns true if the passed value is a JavaScript Function, otherwise false. + * @param {Mixed} value The value to test + * @return {Boolean} + */ + isFunction : function(v){ + return toString.apply(v) === '[object Function]'; + }, + + /** + * Returns true if the passed value is a number. Returns false for non-finite numbers. + * @param {Mixed} value The value to test + * @return {Boolean} + */ + isNumber : function(v){ + return typeof v === 'number' && isFinite(v); + }, + + /** + * Returns true if the passed value is a string. + * @param {Mixed} value The value to test + * @return {Boolean} + */ + isString : function(v){ + return typeof v === 'string'; + }, + + /** + * Returns true if the passed value is a boolean. + * @param {Mixed} value The value to test + * @return {Boolean} + */ + isBoolean : function(v){ + return typeof v === 'boolean'; + }, + + /** + * Returns true if the passed value is an HTMLElement + * @param {Mixed} value The value to test + * @return {Boolean} + */ + isElement : function(v) { + return v ? !!v.tagName : false; + }, + + /** + * Returns true if the passed value is not undefined. + * @param {Mixed} value The value to test + * @return {Boolean} + */ + isDefined : function(v){ + return typeof v !== 'undefined'; + }, + + /** + * True if the detected browser is Opera. + * @type Boolean + */ + isOpera : isOpera, + /** + * True if the detected browser uses WebKit. + * @type Boolean + */ + isWebKit : isWebKit, + /** + * True if the detected browser is Chrome. + * @type Boolean + */ + isChrome : isChrome, + /** + * True if the detected browser is Safari. + * @type Boolean + */ + isSafari : isSafari, + /** + * True if the detected browser is Safari 3.x. + * @type Boolean + */ + isSafari3 : isSafari3, + /** + * True if the detected browser is Safari 4.x. + * @type Boolean + */ + isSafari4 : isSafari4, + /** + * True if the detected browser is Safari 2.x. + * @type Boolean + */ + isSafari2 : isSafari2, + /** + * True if the detected browser is Internet Explorer. + * @type Boolean + */ + isIE : isIE, + /** + * True if the detected browser is Internet Explorer 6.x. + * @type Boolean + */ + isIE6 : isIE6, + /** + * True if the detected browser is Internet Explorer 7.x. + * @type Boolean + */ + isIE7 : isIE7, + /** + * True if the detected browser is Internet Explorer 8.x. + * @type Boolean + */ + isIE8 : isIE8, + /** + * True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox). + * @type Boolean + */ + isGecko : isGecko, + /** + * True if the detected browser uses a pre-Gecko 1.9 layout engine (e.g. Firefox 2.x). + * @type Boolean + */ + isGecko2 : isGecko2, + /** + * True if the detected browser uses a Gecko 1.9+ layout engine (e.g. Firefox 3.x). + * @type Boolean + */ + isGecko3 : isGecko3, + /** + * True if the detected browser is Internet Explorer running in non-strict mode. + * @type Boolean + */ + isBorderBox : isBorderBox, + /** + * True if the detected platform is Linux. + * @type Boolean + */ + isLinux : isLinux, + /** + * True if the detected platform is Windows. + * @type Boolean + */ + isWindows : isWindows, + /** + * True if the detected platform is Mac OS. + * @type Boolean + */ + isMac : isMac, + /** + * True if the detected platform is Adobe Air. + * @type Boolean + */ + isAir : isAir + }); + + /** + * Creates namespaces to be used for scoping variables and classes so that they are not global. + * Specifying the last node of a namespace implicitly creates all other nodes. Usage: + *

+Ext.namespace('Company', 'Company.data');
+Ext.namespace('Company.data'); // equivalent and preferable to above syntax
+Company.Widget = function() { ... }
+Company.data.CustomStore = function(config) { ... }
+
+ * @param {String} namespace1 + * @param {String} namespace2 + * @param {String} etc + * @return {Object} The namespace object. (If multiple arguments are passed, this will be the last namespace created) + * @method ns + */ + Ext.ns = Ext.namespace; +})(); + +Ext.ns("Ext.util", "Ext.lib", "Ext.data"); + +Ext.elCache = {}; + +/** + * @class Function + * These functions are available on every Function object (any JavaScript function). + */ +Ext.apply(Function.prototype, { + /** + * Creates an interceptor function. The passed function is called before the original one. If it returns false, + * the original one is not called. The resulting function returns the results of the original function. + * The passed function is called with the parameters of the original function. Example usage: + *

+var sayHi = function(name){
+    alert('Hi, ' + name);
+}
+
+sayHi('Fred'); // alerts "Hi, Fred"
+
+// create a new function that validates input without
+// directly modifying the original function:
+var sayHiToFriend = sayHi.createInterceptor(function(name){
+    return name == 'Brian';
+});
+
+sayHiToFriend('Fred');  // no alert
+sayHiToFriend('Brian'); // alerts "Hi, Brian"
+
+ * @param {Function} fcn The function to call before the original + * @param {Object} scope (optional) The scope (this reference) in which the passed function is executed. + * If omitted, defaults to the scope in which the original function is called or the browser window. + * @return {Function} The new function + */ + createInterceptor : function(fcn, scope){ + var method = this; + return !Ext.isFunction(fcn) ? + this : + function() { + var me = this, + args = arguments; + fcn.target = me; + fcn.method = method; + return (fcn.apply(scope || me || window, args) !== false) ? + method.apply(me || window, args) : + null; + }; + }, + + /** + * Creates a callback that passes arguments[0], arguments[1], arguments[2], ... + * Call directly on any function. Example: myFunction.createCallback(arg1, arg2) + * Will create a function that is bound to those 2 args. If a specific scope is required in the + * callback, use {@link #createDelegate} instead. The function returned by createCallback always + * executes in the window scope. + *

This method is required when you want to pass arguments to a callback function. If no arguments + * are needed, you can simply pass a reference to the function as a callback (e.g., callback: myFn). + * However, if you tried to pass a function with arguments (e.g., callback: myFn(arg1, arg2)) the function + * would simply execute immediately when the code is parsed. Example usage: + *


+var sayHi = function(name){
+    alert('Hi, ' + name);
+}
+
+// clicking the button alerts "Hi, Fred"
+new Ext.Button({
+    text: 'Say Hi',
+    renderTo: Ext.getBody(),
+    handler: sayHi.createCallback('Fred')
+});
+
+ * @return {Function} The new function + */ + createCallback : function(/*args...*/){ + // make args available, in function below + var args = arguments, + method = this; + return function() { + return method.apply(window, args); + }; + }, + + /** + * Creates a delegate (callback) that sets the scope to obj. + * Call directly on any function. Example: this.myFunction.createDelegate(this, [arg1, arg2]) + * Will create a function that is automatically scoped to obj so that the this variable inside the + * callback points to obj. Example usage: + *

+var sayHi = function(name){
+    // Note this use of "this.text" here.  This function expects to
+    // execute within a scope that contains a text property.  In this
+    // example, the "this" variable is pointing to the btn object that
+    // was passed in createDelegate below.
+    alert('Hi, ' + name + '. You clicked the "' + this.text + '" button.');
+}
+
+var btn = new Ext.Button({
+    text: 'Say Hi',
+    renderTo: Ext.getBody()
+});
+
+// This callback will execute in the scope of the
+// button instance. Clicking the button alerts
+// "Hi, Fred. You clicked the "Say Hi" button."
+btn.on('click', sayHi.createDelegate(btn, ['Fred']));
+
+ * @param {Object} scope (optional) The scope (this reference) in which the function is executed. + * If omitted, defaults to the browser window. + * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller) + * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding, + * if a number the args are inserted at the specified position + * @return {Function} The new function + */ + createDelegate : function(obj, args, appendArgs){ + var method = this; + return function() { + var callArgs = args || arguments; + if (appendArgs === true){ + callArgs = Array.prototype.slice.call(arguments, 0); + callArgs = callArgs.concat(args); + }else if (Ext.isNumber(appendArgs)){ + callArgs = Array.prototype.slice.call(arguments, 0); // copy arguments first + var applyArgs = [appendArgs, 0].concat(args); // create method call params + Array.prototype.splice.apply(callArgs, applyArgs); // splice them in + } + return method.apply(obj || window, callArgs); + }; + }, + + /** + * Calls this function after the number of millseconds specified, optionally in a specific scope. Example usage: + *

+var sayHi = function(name){
+    alert('Hi, ' + name);
+}
+
+// executes immediately:
+sayHi('Fred');
+
+// executes after 2 seconds:
+sayHi.defer(2000, this, ['Fred']);
+
+// this syntax is sometimes useful for deferring
+// execution of an anonymous function:
+(function(){
+    alert('Anonymous');
+}).defer(100);
+
+ * @param {Number} millis The number of milliseconds for the setTimeout call (if less than or equal to 0 the function is executed immediately) + * @param {Object} scope (optional) The scope (this reference) in which the function is executed. + * If omitted, defaults to the browser window. + * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller) + * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding, + * if a number the args are inserted at the specified position + * @return {Number} The timeout id that can be used with clearTimeout + */ + defer : function(millis, obj, args, appendArgs){ + var fn = this.createDelegate(obj, args, appendArgs); + if(millis > 0){ + return setTimeout(fn, millis); + } + fn(); + return 0; + } +}); + +/** + * @class String + * These functions are available on every String object. + */ +Ext.applyIf(String, { + /** + * Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens. Each + * token must be unique, and must increment in the format {0}, {1}, etc. Example usage: + *

+var cls = 'my-class', text = 'Some text';
+var s = String.format('<div class="{0}">{1}</div>', cls, text);
+// s now contains the string: '<div class="my-class">Some text</div>'
+     * 
+ * @param {String} string The tokenized string to be formatted + * @param {String} value1 The value to replace token {0} + * @param {String} value2 Etc... + * @return {String} The formatted string + * @static + */ + format : function(format){ + var args = Ext.toArray(arguments, 1); + return format.replace(/\{(\d+)\}/g, function(m, i){ + return args[i]; + }); + } +}); + +/** + * @class Array + */ +Ext.applyIf(Array.prototype, { + /** + * Checks whether or not the specified object exists in the array. + * @param {Object} o The object to check for + * @param {Number} from (Optional) The index at which to begin the search + * @return {Number} The index of o in the array (or -1 if it is not found) + */ + indexOf : function(o, from){ + var len = this.length; + from = from || 0; + from += (from < 0) ? len : 0; + for (; from < len; ++from){ + if(this[from] === o){ + return from; + } + } + return -1; + }, + + /** + * Removes the specified object from the array. If the object is not found nothing happens. + * @param {Object} o The object to remove + * @return {Array} this array + */ + remove : function(o){ + var index = this.indexOf(o); + if(index != -1){ + this.splice(index, 1); + } + return this; + } +}); +/** + * @class Ext + */ + +Ext.ns("Ext.grid", "Ext.list", "Ext.dd", "Ext.tree", "Ext.form", "Ext.menu", + "Ext.state", "Ext.layout", "Ext.app", "Ext.ux", "Ext.chart", "Ext.direct"); + /** + * Namespace alloted for extensions to the framework. + * @property ux + * @type Object + */ + +Ext.apply(Ext, function(){ + var E = Ext, + idSeed = 0, + scrollWidth = null; + + return { + /** + * A reusable empty function + * @property + * @type Function + */ + emptyFn : function(){}, + + /** + * URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images. + * In older versions of IE, this defaults to "http://extjs.com/s.gif" and you should change this to a URL on your server. + * For other browsers it uses an inline data URL. + * @type String + */ + BLANK_IMAGE_URL : Ext.isIE6 || Ext.isIE7 || Ext.isAir ? + 'http:/' + '/www.extjs.com/s.gif' : + 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', + + extendX : function(supr, fn){ + return Ext.extend(supr, fn(supr.prototype)); + }, + + /** + * Returns the current HTML document object as an {@link Ext.Element}. + * @return Ext.Element The document + */ + getDoc : function(){ + return Ext.get(document); + }, + + /** + * Utility method for validating that a value is numeric, returning the specified default value if it is not. + * @param {Mixed} value Should be a number, but any type will be handled appropriately + * @param {Number} defaultValue The value to return if the original value is non-numeric + * @return {Number} Value, if numeric, else defaultValue + */ + num : function(v, defaultValue){ + v = Number(Ext.isEmpty(v) || Ext.isArray(v) || typeof v == 'boolean' || (typeof v == 'string' && v.trim().length == 0) ? NaN : v); + return isNaN(v) ? defaultValue : v; + }, + + /** + *

Utility method for returning a default value if the passed value is empty.

+ *

The value is deemed to be empty if it is

+ * @param {Mixed} value The value to test + * @param {Mixed} defaultValue The value to return if the original value is empty + * @param {Boolean} allowBlank (optional) true to allow zero length strings to qualify as non-empty (defaults to false) + * @return {Mixed} value, if non-empty, else defaultValue + */ + value : function(v, defaultValue, allowBlank){ + return Ext.isEmpty(v, allowBlank) ? defaultValue : v; + }, + + /** + * Escapes the passed string for use in a regular expression + * @param {String} str + * @return {String} + */ + escapeRe : function(s) { + return s.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1"); + }, + + sequence : function(o, name, fn, scope){ + o[name] = o[name].createSequence(fn, scope); + }, + + /** + * Applies event listeners to elements by selectors when the document is ready. + * The event name is specified with an @ suffix. + *

+Ext.addBehaviors({
+    // add a listener for click on all anchors in element with id foo
+    '#foo a@click' : function(e, t){
+        // do something
+    },
+
+    // add the same listener to multiple selectors (separated by comma BEFORE the @)
+    '#foo a, #bar span.some-class@mouseover' : function(){
+        // do something
+    }
+});
+         * 
+ * @param {Object} obj The list of behaviors to apply + */ + addBehaviors : function(o){ + if(!Ext.isReady){ + Ext.onReady(function(){ + Ext.addBehaviors(o); + }); + } else { + var cache = {}, // simple cache for applying multiple behaviors to same selector does query multiple times + parts, + b, + s; + for (b in o) { + if ((parts = b.split('@'))[1]) { // for Object prototype breakers + s = parts[0]; + if(!cache[s]){ + cache[s] = Ext.select(s); + } + cache[s].on(parts[1], o[b]); + } + } + cache = null; + } + }, + + /** + * Utility method for getting the width of the browser scrollbar. This can differ depending on + * operating system settings, such as the theme or font size. + * @param {Boolean} force (optional) true to force a recalculation of the value. + * @return {Number} The width of the scrollbar. + */ + getScrollBarWidth: function(force){ + if(!Ext.isReady){ + return 0; + } + + if(force === true || scrollWidth === null){ + // Append our div, do our calculation and then remove it + var div = Ext.getBody().createChild('
'), + child = div.child('div', true); + var w1 = child.offsetWidth; + div.setStyle('overflow', (Ext.isWebKit || Ext.isGecko) ? 'auto' : 'scroll'); + var w2 = child.offsetWidth; + div.remove(); + // Need to add 2 to ensure we leave enough space + scrollWidth = w1 - w2 + 2; + } + return scrollWidth; + }, + + + // deprecated + combine : function(){ + var as = arguments, l = as.length, r = []; + for(var i = 0; i < l; i++){ + var a = as[i]; + if(Ext.isArray(a)){ + r = r.concat(a); + }else if(a.length !== undefined && !a.substr){ + r = r.concat(Array.prototype.slice.call(a, 0)); + }else{ + r.push(a); + } + } + return r; + }, + + /** + * Copies a set of named properties fom the source object to the destination object. + *

example:


+ImageComponent = Ext.extend(Ext.BoxComponent, {
+    initComponent: function() {
+        this.autoEl = { tag: 'img' };
+        MyComponent.superclass.initComponent.apply(this, arguments);
+        this.initialBox = Ext.copyTo({}, this.initialConfig, 'x,y,width,height');
+    }
+});
+         * 
+ * @param {Object} dest The destination object. + * @param {Object} source The source object. + * @param {Array/String} names Either an Array of property names, or a comma-delimited list + * of property names to copy. + * @return {Object} The modified object. + */ + copyTo : function(dest, source, names){ + if(typeof names == 'string'){ + names = names.split(/[,;\s]/); + } + Ext.each(names, function(name){ + if(source.hasOwnProperty(name)){ + dest[name] = source[name]; + } + }, this); + return dest; + }, + + /** + * Attempts to destroy any objects passed to it by removing all event listeners, removing them from the + * DOM (if applicable) and calling their destroy functions (if available). This method is primarily + * intended for arguments of type {@link Ext.Element} and {@link Ext.Component}, but any subclass of + * {@link Ext.util.Observable} can be passed in. Any number of elements and/or components can be + * passed into this function in a single call as separate arguments. + * @param {Mixed} arg1 An {@link Ext.Element}, {@link Ext.Component}, or an Array of either of these to destroy + * @param {Mixed} arg2 (optional) + * @param {Mixed} etc... (optional) + */ + destroy : function(){ + Ext.each(arguments, function(arg){ + if(arg){ + if(Ext.isArray(arg)){ + this.destroy.apply(this, arg); + }else if(typeof arg.destroy == 'function'){ + arg.destroy(); + }else if(arg.dom){ + arg.remove(); + } + } + }, this); + }, + + /** + * Attempts to destroy and then remove a set of named properties of the passed object. + * @param {Object} o The object (most likely a Component) who's properties you wish to destroy. + * @param {Mixed} arg1 The name of the property to destroy and remove from the object. + * @param {Mixed} etc... More property names to destroy and remove. + */ + destroyMembers : function(o, arg1, arg2, etc){ + for(var i = 1, a = arguments, len = a.length; i < len; i++) { + Ext.destroy(o[a[i]]); + delete o[a[i]]; + } + }, + + /** + * Creates a copy of the passed Array with falsy values removed. + * @param {Array/NodeList} arr The Array from which to remove falsy values. + * @return {Array} The new, compressed Array. + */ + clean : function(arr){ + var ret = []; + Ext.each(arr, function(v){ + if(!!v){ + ret.push(v); + } + }); + return ret; + }, + + /** + * Creates a copy of the passed Array, filtered to contain only unique values. + * @param {Array} arr The Array to filter + * @return {Array} The new Array containing unique values. + */ + unique : function(arr){ + var ret = [], + collect = {}; + + Ext.each(arr, function(v) { + if(!collect[v]){ + ret.push(v); + } + collect[v] = true; + }); + return ret; + }, + + /** + * Recursively flattens into 1-d Array. Injects Arrays inline. + * @param {Array} arr The array to flatten + * @return {Array} The new, flattened array. + */ + flatten : function(arr){ + var worker = []; + function rFlatten(a) { + Ext.each(a, function(v) { + if(Ext.isArray(v)){ + rFlatten(v); + }else{ + worker.push(v); + } + }); + return worker; + } + return rFlatten(arr); + }, + + /** + * Returns the minimum value in the Array. + * @param {Array|NodeList} arr The Array from which to select the minimum value. + * @param {Function} comp (optional) a function to perform the comparision which determines minimization. + * If omitted the "<" operator will be used. Note: gt = 1; eq = 0; lt = -1 + * @return {Object} The minimum value in the Array. + */ + min : function(arr, comp){ + var ret = arr[0]; + comp = comp || function(a,b){ return a < b ? -1 : 1; }; + Ext.each(arr, function(v) { + ret = comp(ret, v) == -1 ? ret : v; + }); + return ret; + }, + + /** + * Returns the maximum value in the Array + * @param {Array|NodeList} arr The Array from which to select the maximum value. + * @param {Function} comp (optional) a function to perform the comparision which determines maximization. + * If omitted the ">" operator will be used. Note: gt = 1; eq = 0; lt = -1 + * @return {Object} The maximum value in the Array. + */ + max : function(arr, comp){ + var ret = arr[0]; + comp = comp || function(a,b){ return a > b ? 1 : -1; }; + Ext.each(arr, function(v) { + ret = comp(ret, v) == 1 ? ret : v; + }); + return ret; + }, + + /** + * Calculates the mean of the Array + * @param {Array} arr The Array to calculate the mean value of. + * @return {Number} The mean. + */ + mean : function(arr){ + return arr.length > 0 ? Ext.sum(arr) / arr.length : undefined; + }, + + /** + * Calculates the sum of the Array + * @param {Array} arr The Array to calculate the sum value of. + * @return {Number} The sum. + */ + sum : function(arr){ + var ret = 0; + Ext.each(arr, function(v) { + ret += v; + }); + return ret; + }, + + /** + * Partitions the set into two sets: a true set and a false set. + * Example: + * Example2: + *

+// Example 1:
+Ext.partition([true, false, true, true, false]); // [[true, true, true], [false, false]]
+
+// Example 2:
+Ext.partition(
+    Ext.query("p"),
+    function(val){
+        return val.className == "class1"
+    }
+);
+// true are those paragraph elements with a className of "class1",
+// false set are those that do not have that className.
+         * 
+ * @param {Array|NodeList} arr The array to partition + * @param {Function} truth (optional) a function to determine truth. If this is omitted the element + * itself must be able to be evaluated for its truthfulness. + * @return {Array} [true,false] + */ + partition : function(arr, truth){ + var ret = [[],[]]; + Ext.each(arr, function(v, i, a) { + ret[ (truth && truth(v, i, a)) || (!truth && v) ? 0 : 1].push(v); + }); + return ret; + }, + + /** + * Invokes a method on each item in an Array. + *

+// Example:
+Ext.invoke(Ext.query("p"), "getAttribute", "id");
+// [el1.getAttribute("id"), el2.getAttribute("id"), ..., elN.getAttribute("id")]
+         * 
+ * @param {Array|NodeList} arr The Array of items to invoke the method on. + * @param {String} methodName The method name to invoke. + * @param {...*} args Arguments to send into the method invocation. + * @return {Array} The results of invoking the method on each item in the array. + */ + invoke : function(arr, methodName){ + var ret = [], + args = Array.prototype.slice.call(arguments, 2); + Ext.each(arr, function(v,i) { + if (v && typeof v[methodName] == 'function') { + ret.push(v[methodName].apply(v, args)); + } else { + ret.push(undefined); + } + }); + return ret; + }, + + /** + * Plucks the value of a property from each item in the Array + *

+// Example:
+Ext.pluck(Ext.query("p"), "className"); // [el1.className, el2.className, ..., elN.className]
+         * 
+ * @param {Array|NodeList} arr The Array of items to pluck the value from. + * @param {String} prop The property name to pluck from each element. + * @return {Array} The value from each item in the Array. + */ + pluck : function(arr, prop){ + var ret = []; + Ext.each(arr, function(v) { + ret.push( v[prop] ); + }); + return ret; + }, + + /** + *

Zips N sets together.

+ *

+// Example 1:
+Ext.zip([1,2,3],[4,5,6]); // [[1,4],[2,5],[3,6]]
+// Example 2:
+Ext.zip(
+    [ "+", "-", "+"],
+    [  12,  10,  22],
+    [  43,  15,  96],
+    function(a, b, c){
+        return "$" + a + "" + b + "." + c
+    }
+); // ["$+12.43", "$-10.15", "$+22.96"]
+         * 
+ * @param {Arrays|NodeLists} arr This argument may be repeated. Array(s) to contribute values. + * @param {Function} zipper (optional) The last item in the argument list. This will drive how the items are zipped together. + * @return {Array} The zipped set. + */ + zip : function(){ + var parts = Ext.partition(arguments, function( val ){ return typeof val != 'function'; }), + arrs = parts[0], + fn = parts[1][0], + len = Ext.max(Ext.pluck(arrs, "length")), + ret = []; + + for (var i = 0; i < len; i++) { + ret[i] = []; + if(fn){ + ret[i] = fn.apply(fn, Ext.pluck(arrs, i)); + }else{ + for (var j = 0, aLen = arrs.length; j < aLen; j++){ + ret[i].push( arrs[j][i] ); + } + } + } + return ret; + }, + + /** + * This is shorthand reference to {@link Ext.ComponentMgr#get}. + * Looks up an existing {@link Ext.Component Component} by {@link Ext.Component#id id} + * @param {String} id The component {@link Ext.Component#id id} + * @return Ext.Component The Component, undefined if not found, or null if a + * Class was found. + */ + getCmp : function(id){ + return Ext.ComponentMgr.get(id); + }, + + /** + * By default, Ext intelligently decides whether floating elements should be shimmed. If you are using flash, + * you may want to set this to true. + * @type Boolean + */ + useShims: E.isIE6 || (E.isMac && E.isGecko2), + + // inpired by a similar function in mootools library + /** + * Returns the type of object that is passed in. If the object passed in is null or undefined it + * return false otherwise it returns one of the following values:
    + *
  • string: If the object passed is a string
  • + *
  • number: If the object passed is a number
  • + *
  • boolean: If the object passed is a boolean value
  • + *
  • date: If the object passed is a Date object
  • + *
  • function: If the object passed is a function reference
  • + *
  • object: If the object passed is an object
  • + *
  • array: If the object passed is an array
  • + *
  • regexp: If the object passed is a regular expression
  • + *
  • element: If the object passed is a DOM Element
  • + *
  • nodelist: If the object passed is a DOM NodeList
  • + *
  • textnode: If the object passed is a DOM text node and contains something other than whitespace
  • + *
  • whitespace: If the object passed is a DOM text node and contains only whitespace
  • + *
+ * @param {Mixed} object + * @return {String} + */ + type : function(o){ + if(o === undefined || o === null){ + return false; + } + if(o.htmlElement){ + return 'element'; + } + var t = typeof o; + if(t == 'object' && o.nodeName) { + switch(o.nodeType) { + case 1: return 'element'; + case 3: return (/\S/).test(o.nodeValue) ? 'textnode' : 'whitespace'; + } + } + if(t == 'object' || t == 'function') { + switch(o.constructor) { + case Array: return 'array'; + case RegExp: return 'regexp'; + case Date: return 'date'; + } + if(typeof o.length == 'number' && typeof o.item == 'function') { + return 'nodelist'; + } + } + return t; + }, + + intercept : function(o, name, fn, scope){ + o[name] = o[name].createInterceptor(fn, scope); + }, + + // internal + callback : function(cb, scope, args, delay){ + if(typeof cb == 'function'){ + if(delay){ + cb.defer(delay, scope, args || []); + }else{ + cb.apply(scope, args || []); + } + } + } + }; +}()); + +/** + * @class Function + * These functions are available on every Function object (any JavaScript function). + */ +Ext.apply(Function.prototype, { + /** + * Create a combined function call sequence of the original function + the passed function. + * The resulting function returns the results of the original function. + * The passed fcn is called with the parameters of the original function. Example usage: + *

+var sayHi = function(name){
+    alert('Hi, ' + name);
+}
+
+sayHi('Fred'); // alerts "Hi, Fred"
+
+var sayGoodbye = sayHi.createSequence(function(name){
+    alert('Bye, ' + name);
+});
+
+sayGoodbye('Fred'); // both alerts show
+
+ * @param {Function} fcn The function to sequence + * @param {Object} scope (optional) The scope (this reference) in which the passed function is executed. + * If omitted, defaults to the scope in which the original function is called or the browser window. + * @return {Function} The new function + */ + createSequence : function(fcn, scope){ + var method = this; + return (typeof fcn != 'function') ? + this : + function(){ + var retval = method.apply(this || window, arguments); + fcn.apply(scope || this || window, arguments); + return retval; + }; + } +}); + + +/** + * @class String + * These functions are available as static methods on the JavaScript String object. + */ +Ext.applyIf(String, { + + /** + * Escapes the passed string for ' and \ + * @param {String} string The string to escape + * @return {String} The escaped string + * @static + */ + escape : function(string) { + return string.replace(/('|\\)/g, "\\$1"); + }, + + /** + * Pads the left side of a string with a specified character. This is especially useful + * for normalizing number and date strings. Example usage: + *

+var s = String.leftPad('123', 5, '0');
+// s now contains the string: '00123'
+     * 
+ * @param {String} string The original string + * @param {Number} size The total length of the output string + * @param {String} char (optional) The character with which to pad the original string (defaults to empty string " ") + * @return {String} The padded string + * @static + */ + leftPad : function (val, size, ch) { + var result = String(val); + if(!ch) { + ch = " "; + } + while (result.length < size) { + result = ch + result; + } + return result; + } +}); + +/** + * Utility function that allows you to easily switch a string between two alternating values. The passed value + * is compared to the current string, and if they are equal, the other value that was passed in is returned. If + * they are already different, the first value passed in is returned. Note that this method returns the new value + * but does not change the current string. + *

+// alternate sort directions
+sort = sort.toggle('ASC', 'DESC');
+
+// instead of conditional logic:
+sort = (sort == 'ASC' ? 'DESC' : 'ASC');
+
+ * @param {String} value The value to compare to the current string + * @param {String} other The new value to use if the string already equals the first value passed in + * @return {String} The new value + */ +String.prototype.toggle = function(value, other){ + return this == value ? other : value; +}; + +/** + * Trims whitespace from either end of a string, leaving spaces within the string intact. Example: + *

+var s = '  foo bar  ';
+alert('-' + s + '-');         //alerts "- foo bar -"
+alert('-' + s.trim() + '-');  //alerts "-foo bar-"
+
+ * @return {String} The trimmed string + */ +String.prototype.trim = function(){ + var re = /^\s+|\s+$/g; + return function(){ return this.replace(re, ""); }; +}(); + +// here to prevent dependency on Date.js +/** + Returns the number of milliseconds between this date and date + @param {Date} date (optional) Defaults to now + @return {Number} The diff in milliseconds + @member Date getElapsed + */ +Date.prototype.getElapsed = function(date) { + return Math.abs((date || new Date()).getTime()-this.getTime()); +}; + + +/** + * @class Number + */ +Ext.applyIf(Number.prototype, { + /** + * Checks whether or not the current number is within a desired range. If the number is already within the + * range it is returned, otherwise the min or max value is returned depending on which side of the range is + * exceeded. Note that this method returns the constrained value but does not change the current number. + * @param {Number} min The minimum number in the range + * @param {Number} max The maximum number in the range + * @return {Number} The constrained value if outside the range, otherwise the current value + */ + constrain : function(min, max){ + return Math.min(Math.max(this, min), max); + } +}); +/** + * @class Ext.util.TaskRunner + * Provides the ability to execute one or more arbitrary tasks in a multithreaded + * manner. Generally, you can use the singleton {@link Ext.TaskMgr} instead, but + * if needed, you can create separate instances of TaskRunner. Any number of + * separate tasks can be started at any time and will run independently of each + * other. Example usage: + *

+// Start a simple clock task that updates a div once per second
+var updateClock = function(){
+    Ext.fly('clock').update(new Date().format('g:i:s A'));
+} 
+var task = {
+    run: updateClock,
+    interval: 1000 //1 second
+}
+var runner = new Ext.util.TaskRunner();
+runner.start(task);
+
+// equivalent using TaskMgr
+Ext.TaskMgr.start({
+    run: updateClock,
+    interval: 1000
+});
+
+ * 
+ *

See the {@link #start} method for details about how to configure a task object.

+ * Also see {@link Ext.util.DelayedTask}. + * + * @constructor + * @param {Number} interval (optional) The minimum precision in milliseconds supported by this TaskRunner instance + * (defaults to 10) + */ +Ext.util.TaskRunner = function(interval){ + interval = interval || 10; + var tasks = [], + removeQueue = [], + id = 0, + running = false, + + // private + stopThread = function(){ + running = false; + clearInterval(id); + id = 0; + }, + + // private + startThread = function(){ + if(!running){ + running = true; + id = setInterval(runTasks, interval); + } + }, + + // private + removeTask = function(t){ + removeQueue.push(t); + if(t.onStop){ + t.onStop.apply(t.scope || t); + } + }, + + // private + runTasks = function(){ + var rqLen = removeQueue.length, + now = new Date().getTime(); + + if(rqLen > 0){ + for(var i = 0; i < rqLen; i++){ + tasks.remove(removeQueue[i]); + } + removeQueue = []; + if(tasks.length < 1){ + stopThread(); + return; + } + } + for(var i = 0, t, itime, rt, len = tasks.length; i < len; ++i){ + t = tasks[i]; + itime = now - t.taskRunTime; + if(t.interval <= itime){ + rt = t.run.apply(t.scope || t, t.args || [++t.taskRunCount]); + t.taskRunTime = now; + if(rt === false || t.taskRunCount === t.repeat){ + removeTask(t); + return; + } + } + if(t.duration && t.duration <= (now - t.taskStartTime)){ + removeTask(t); + } + } + }; + + /** + * Starts a new task. + * @method start + * @param {Object} task

A config object that supports the following properties:

    + *
  • run : Function

    The function to execute each time the task is invoked. The + * function will be called at each interval and passed the args argument if specified, and the + * current invocation count if not.

    + *

    If a particular scope (this reference) is required, be sure to specify it using the scope argument.

    + *

    Return false from this function to terminate the task.

  • + *
  • interval : Number
    The frequency in milliseconds with which the task + * should be invoked.
  • + *
  • args : Array
    (optional) An array of arguments to be passed to the function + * specified by run. If not specified, the current invocation count is passed.
  • + *
  • scope : Object
    (optional) The scope (this reference) in which to execute the + * run function. Defaults to the task config object.
  • + *
  • duration : Number
    (optional) The length of time in milliseconds to invoke + * the task before stopping automatically (defaults to indefinite).
  • + *
  • repeat : Number
    (optional) The number of times to invoke the task before + * stopping automatically (defaults to indefinite).
  • + *

+ *

Before each invocation, Ext injects the property taskRunCount into the task object so + * that calculations based on the repeat count can be performed.

+ * @return {Object} The task + */ + this.start = function(task){ + tasks.push(task); + task.taskStartTime = new Date().getTime(); + task.taskRunTime = 0; + task.taskRunCount = 0; + startThread(); + return task; + }; + + /** + * Stops an existing running task. + * @method stop + * @param {Object} task The task to stop + * @return {Object} The task + */ + this.stop = function(task){ + removeTask(task); + return task; + }; + + /** + * Stops all tasks that are currently running. + * @method stopAll + */ + this.stopAll = function(){ + stopThread(); + for(var i = 0, len = tasks.length; i < len; i++){ + if(tasks[i].onStop){ + tasks[i].onStop(); + } + } + tasks = []; + removeQueue = []; + }; +}; + +/** + * @class Ext.TaskMgr + * @extends Ext.util.TaskRunner + * A static {@link Ext.util.TaskRunner} instance that can be used to start and stop arbitrary tasks. See + * {@link Ext.util.TaskRunner} for supported methods and task config properties. + *

+// Start a simple clock task that updates a div once per second
+var task = {
+    run: function(){
+        Ext.fly('clock').update(new Date().format('g:i:s A'));
+    },
+    interval: 1000 //1 second
+}
+Ext.TaskMgr.start(task);
+
+ *

See the {@link #start} method for details about how to configure a task object.

+ * @singleton + */ +Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ + var libFlyweight; + + function fly(el) { + if (!libFlyweight) { + libFlyweight = new Ext.Element.Flyweight(); + } + libFlyweight.dom = el; + return libFlyweight; + } + + (function(){ + var doc = document, + isCSS1 = doc.compatMode == "CSS1Compat", + MAX = Math.max, + ROUND = Math.round, + PARSEINT = parseInt; + + Ext.lib.Dom = { + isAncestor : function(p, c) { + var ret = false; + + p = Ext.getDom(p); + c = Ext.getDom(c); + if (p && c) { + if (p.contains) { + return p.contains(c); + } else if (p.compareDocumentPosition) { + return !!(p.compareDocumentPosition(c) & 16); + } else { + while (c = c.parentNode) { + ret = c == p || ret; + } + } + } + return ret; + }, + + getViewWidth : function(full) { + return full ? this.getDocumentWidth() : this.getViewportWidth(); + }, + + getViewHeight : function(full) { + return full ? this.getDocumentHeight() : this.getViewportHeight(); + }, + + getDocumentHeight: function() { + return MAX(!isCSS1 ? doc.body.scrollHeight : doc.documentElement.scrollHeight, this.getViewportHeight()); + }, + + getDocumentWidth: function() { + return MAX(!isCSS1 ? doc.body.scrollWidth : doc.documentElement.scrollWidth, this.getViewportWidth()); + }, + + getViewportHeight: function(){ + return Ext.isIE ? + (Ext.isStrict ? doc.documentElement.clientHeight : doc.body.clientHeight) : + self.innerHeight; + }, + + getViewportWidth : function() { + return !Ext.isStrict && !Ext.isOpera ? doc.body.clientWidth : + Ext.isIE ? doc.documentElement.clientWidth : self.innerWidth; + }, + + getY : function(el) { + return this.getXY(el)[1]; + }, + + getX : function(el) { + return this.getXY(el)[0]; + }, + + getXY : function(el) { + var p, + pe, + b, + bt, + bl, + dbd, + x = 0, + y = 0, + scroll, + hasAbsolute, + bd = (doc.body || doc.documentElement), + ret = [0,0]; + + el = Ext.getDom(el); + + if(el != bd){ + if (el.getBoundingClientRect) { + b = el.getBoundingClientRect(); + scroll = fly(document).getScroll(); + ret = [ROUND(b.left + scroll.left), ROUND(b.top + scroll.top)]; + } else { + p = el; + hasAbsolute = fly(el).isStyle("position", "absolute"); + + while (p) { + pe = fly(p); + x += p.offsetLeft; + y += p.offsetTop; + + hasAbsolute = hasAbsolute || pe.isStyle("position", "absolute"); + + if (Ext.isGecko) { + y += bt = PARSEINT(pe.getStyle("borderTopWidth"), 10) || 0; + x += bl = PARSEINT(pe.getStyle("borderLeftWidth"), 10) || 0; + + if (p != el && !pe.isStyle('overflow','visible')) { + x += bl; + y += bt; + } + } + p = p.offsetParent; + } + + if (Ext.isSafari && hasAbsolute) { + x -= bd.offsetLeft; + y -= bd.offsetTop; + } + + if (Ext.isGecko && !hasAbsolute) { + dbd = fly(bd); + x += PARSEINT(dbd.getStyle("borderLeftWidth"), 10) || 0; + y += PARSEINT(dbd.getStyle("borderTopWidth"), 10) || 0; + } + + p = el.parentNode; + while (p && p != bd) { + if (!Ext.isOpera || (p.tagName != 'TR' && !fly(p).isStyle("display", "inline"))) { + x -= p.scrollLeft; + y -= p.scrollTop; + } + p = p.parentNode; + } + ret = [x,y]; + } + } + return ret + }, + + setXY : function(el, xy) { + (el = Ext.fly(el, '_setXY')).position(); + + var pts = el.translatePoints(xy), + style = el.dom.style, + pos; + + for (pos in pts) { + if(!isNaN(pts[pos])) style[pos] = pts[pos] + "px" + } + }, + + setX : function(el, x) { + this.setXY(el, [x, false]); + }, + + setY : function(el, y) { + this.setXY(el, [false, y]); + } + }; +})();Ext.lib.Dom.getRegion = function(el) { + return Ext.lib.Region.getRegion(el); +};Ext.lib.Event = function() { + var loadComplete = false, + unloadListeners = {}, + retryCount = 0, + onAvailStack = [], + _interval, + locked = false, + win = window, + doc = document, + + // constants + POLL_RETRYS = 200, + POLL_INTERVAL = 20, + EL = 0, + TYPE = 0, + FN = 1, + WFN = 2, + OBJ = 2, + ADJ_SCOPE = 3, + SCROLLLEFT = 'scrollLeft', + SCROLLTOP = 'scrollTop', + UNLOAD = 'unload', + MOUSEOVER = 'mouseover', + MOUSEOUT = 'mouseout', + // private + doAdd = function() { + var ret; + if (win.addEventListener) { + ret = function(el, eventName, fn, capture) { + if (eventName == 'mouseenter') { + fn = fn.createInterceptor(checkRelatedTarget); + el.addEventListener(MOUSEOVER, fn, (capture)); + } else if (eventName == 'mouseleave') { + fn = fn.createInterceptor(checkRelatedTarget); + el.addEventListener(MOUSEOUT, fn, (capture)); + } else { + el.addEventListener(eventName, fn, (capture)); + } + return fn; + }; + } else if (win.attachEvent) { + ret = function(el, eventName, fn, capture) { + el.attachEvent("on" + eventName, fn); + return fn; + }; + } else { + ret = function(){}; + } + return ret; + }(), + // private + doRemove = function(){ + var ret; + if (win.removeEventListener) { + ret = function (el, eventName, fn, capture) { + if (eventName == 'mouseenter') { + eventName = MOUSEOVER; + } else if (eventName == 'mouseleave') { + eventName = MOUSEOUT; + } + el.removeEventListener(eventName, fn, (capture)); + }; + } else if (win.detachEvent) { + ret = function (el, eventName, fn) { + el.detachEvent("on" + eventName, fn); + }; + } else { + ret = function(){}; + } + return ret; + }(); + + function checkRelatedTarget(e) { + return !elContains(e.currentTarget, pub.getRelatedTarget(e)); + } + + function elContains(parent, child) { + if(parent && parent.firstChild){ + while(child) { + if(child === parent) { + return true; + } + child = child.parentNode; + if(child && (child.nodeType != 1)) { + child = null; + } + } + } + return false; + } + + // private + function _tryPreloadAttach() { + var ret = false, + notAvail = [], + element, i, v, override, + tryAgain = !loadComplete || (retryCount > 0); + + if(!locked){ + locked = true; + + for(i = 0; i < onAvailStack.length; ++i){ + v = onAvailStack[i]; + if(v && (element = doc.getElementById(v.id))){ + if(!v.checkReady || loadComplete || element.nextSibling || (doc && doc.body)) { + override = v.override; + element = override ? (override === true ? v.obj : override) : element; + v.fn.call(element, v.obj); + onAvailStack.remove(v); + --i; + }else{ + notAvail.push(v); + } + } + } + + retryCount = (notAvail.length === 0) ? 0 : retryCount - 1; + + if (tryAgain) { + startInterval(); + } else { + clearInterval(_interval); + _interval = null; + } + ret = !(locked = false); + } + return ret; + } + + // private + function startInterval() { + if(!_interval){ + var callback = function() { + _tryPreloadAttach(); + }; + _interval = setInterval(callback, POLL_INTERVAL); + } + } + + // private + function getScroll() { + var dd = doc.documentElement, + db = doc.body; + if(dd && (dd[SCROLLTOP] || dd[SCROLLLEFT])){ + return [dd[SCROLLLEFT], dd[SCROLLTOP]]; + }else if(db){ + return [db[SCROLLLEFT], db[SCROLLTOP]]; + }else{ + return [0, 0]; + } + } + + // private + function getPageCoord (ev, xy) { + ev = ev.browserEvent || ev; + var coord = ev['page' + xy]; + if (!coord && coord !== 0) { + coord = ev['client' + xy] || 0; + + if (Ext.isIE) { + coord += getScroll()[xy == "X" ? 0 : 1]; + } + } + + return coord; + } + + var pub = { + extAdapter: true, + onAvailable : function(p_id, p_fn, p_obj, p_override) { + onAvailStack.push({ + id: p_id, + fn: p_fn, + obj: p_obj, + override: p_override, + checkReady: false }); + + retryCount = POLL_RETRYS; + startInterval(); + }, + + // This function should ALWAYS be called from Ext.EventManager + addListener: function(el, eventName, fn) { + el = Ext.getDom(el); + if (el && fn) { + if (eventName == UNLOAD) { + if (unloadListeners[el.id] === undefined) { + unloadListeners[el.id] = []; + } + unloadListeners[el.id].push([eventName, fn]); + return fn; + } + return doAdd(el, eventName, fn, false); + } + return false; + }, + + // This function should ALWAYS be called from Ext.EventManager + removeListener: function(el, eventName, fn) { + el = Ext.getDom(el); + var i, len, li, lis; + if (el && fn) { + if(eventName == UNLOAD){ + if((lis = unloadListeners[el.id]) !== undefined){ + for(i = 0, len = lis.length; i < len; i++){ + if((li = lis[i]) && li[TYPE] == eventName && li[FN] == fn){ + unloadListeners[el.id].splice(i, 1); + } + } + } + return; + } + doRemove(el, eventName, fn, false); + } + }, + + getTarget : function(ev) { + ev = ev.browserEvent || ev; + return this.resolveTextNode(ev.target || ev.srcElement); + }, + + resolveTextNode : Ext.isGecko ? function(node){ + if(!node){ + return; + } + // work around firefox bug, https://bugzilla.mozilla.org/show_bug.cgi?id=101197 + var s = HTMLElement.prototype.toString.call(node); + if(s == '[xpconnect wrapped native prototype]' || s == '[object XULElement]'){ + return; + } + return node.nodeType == 3 ? node.parentNode : node; + } : function(node){ + return node && node.nodeType == 3 ? node.parentNode : node; + }, + + getRelatedTarget : function(ev) { + ev = ev.browserEvent || ev; + return this.resolveTextNode(ev.relatedTarget || + (ev.type == MOUSEOUT ? ev.toElement : + ev.type == MOUSEOVER ? ev.fromElement : null)); + }, + + getPageX : function(ev) { + return getPageCoord(ev, "X"); + }, + + getPageY : function(ev) { + return getPageCoord(ev, "Y"); + }, + + + getXY : function(ev) { + return [this.getPageX(ev), this.getPageY(ev)]; + }, + + stopEvent : function(ev) { + this.stopPropagation(ev); + this.preventDefault(ev); + }, + + stopPropagation : function(ev) { + ev = ev.browserEvent || ev; + if (ev.stopPropagation) { + ev.stopPropagation(); + } else { + ev.cancelBubble = true; + } + }, + + preventDefault : function(ev) { + ev = ev.browserEvent || ev; + if (ev.preventDefault) { + ev.preventDefault(); + } else { + ev.returnValue = false; + } + }, + + getEvent : function(e) { + e = e || win.event; + if (!e) { + var c = this.getEvent.caller; + while (c) { + e = c.arguments[0]; + if (e && Event == e.constructor) { + break; + } + c = c.caller; + } + } + return e; + }, + + getCharCode : function(ev) { + ev = ev.browserEvent || ev; + return ev.charCode || ev.keyCode || 0; + }, + + //clearCache: function() {}, + // deprecated, call from EventManager + getListeners : function(el, eventName) { + Ext.EventManager.getListeners(el, eventName); + }, + + // deprecated, call from EventManager + purgeElement : function(el, recurse, eventName) { + Ext.EventManager.purgeElement(el, recurse, eventName); + }, + + _load : function(e) { + loadComplete = true; + var EU = Ext.lib.Event; + if (Ext.isIE && e !== true) { + // IE8 complains that _load is null or not an object + // so lets remove self via arguments.callee + doRemove(win, "load", arguments.callee); + } + }, + + _unload : function(e) { + var EU = Ext.lib.Event, + i, j, l, v, ul, id, len, index, scope; + + + for (id in unloadListeners) { + ul = unloadListeners[id]; + for (i = 0, len = ul.length; i < len; i++) { + v = ul[i]; + if (v) { + try{ + scope = v[ADJ_SCOPE] ? (v[ADJ_SCOPE] === true ? v[OBJ] : v[ADJ_SCOPE]) : win; + v[FN].call(scope, EU.getEvent(e), v[OBJ]); + }catch(ex){} + } + } + }; + + Ext.EventManager._unload(); + + doRemove(win, UNLOAD, EU._unload); + } + }; + + // Initialize stuff. + pub.on = pub.addListener; + pub.un = pub.removeListener; + if (doc && doc.body) { + pub._load(true); + } else { + doAdd(win, "load", pub._load); + } + doAdd(win, UNLOAD, pub._unload); + _tryPreloadAttach(); + + return pub; +}(); +/* +* Portions of this file are based on pieces of Yahoo User Interface Library +* Copyright (c) 2007, Yahoo! Inc. All rights reserved. +* YUI licensed under the BSD License: +* http://developer.yahoo.net/yui/license.txt +*/ +Ext.lib.Ajax = function() { + var activeX = ['MSXML2.XMLHTTP.3.0', + 'MSXML2.XMLHTTP', + 'Microsoft.XMLHTTP'], + CONTENTTYPE = 'Content-Type'; + + // private + function setHeader(o) { + var conn = o.conn, + prop; + + function setTheHeaders(conn, headers){ + for (prop in headers) { + if (headers.hasOwnProperty(prop)) { + conn.setRequestHeader(prop, headers[prop]); + } + } + } + + if (pub.defaultHeaders) { + setTheHeaders(conn, pub.defaultHeaders); + } + + if (pub.headers) { + setTheHeaders(conn, pub.headers); + delete pub.headers; + } + } + + // private + function createExceptionObject(tId, callbackArg, isAbort, isTimeout) { + return { + tId : tId, + status : isAbort ? -1 : 0, + statusText : isAbort ? 'transaction aborted' : 'communication failure', + isAbort: isAbort, + isTimeout: isTimeout, + argument : callbackArg + }; + } + + // private + function initHeader(label, value) { + (pub.headers = pub.headers || {})[label] = value; + } + + // private + function createResponseObject(o, callbackArg) { + var headerObj = {}, + headerStr, + conn = o.conn, + t, + s, + // see: https://prototype.lighthouseapp.com/projects/8886/tickets/129-ie-mangles-http-response-status-code-204-to-1223 + isBrokenStatus = conn.status == 1223; + + try { + headerStr = o.conn.getAllResponseHeaders(); + Ext.each(headerStr.replace(/\r\n/g, '\n').split('\n'), function(v){ + t = v.indexOf(':'); + if(t >= 0){ + s = v.substr(0, t).toLowerCase(); + if(v.charAt(t + 1) == ' '){ + ++t; + } + headerObj[s] = v.substr(t + 1); + } + }); + } catch(e) {} + + return { + tId : o.tId, + // Normalize the status and statusText when IE returns 1223, see the above link. + status : isBrokenStatus ? 204 : conn.status, + statusText : isBrokenStatus ? 'No Content' : conn.statusText, + getResponseHeader : function(header){return headerObj[header.toLowerCase()];}, + getAllResponseHeaders : function(){return headerStr}, + responseText : conn.responseText, + responseXML : conn.responseXML, + argument : callbackArg + }; + } + + // private + function releaseObject(o) { + if (o.tId) { + pub.conn[o.tId] = null; + } + o.conn = null; + o = null; + } + + // private + function handleTransactionResponse(o, callback, isAbort, isTimeout) { + if (!callback) { + releaseObject(o); + return; + } + + var httpStatus, responseObject; + + try { + if (o.conn.status !== undefined && o.conn.status != 0) { + httpStatus = o.conn.status; + } + else { + httpStatus = 13030; + } + } + catch(e) { + httpStatus = 13030; + } + + if ((httpStatus >= 200 && httpStatus < 300) || (Ext.isIE && httpStatus == 1223)) { + responseObject = createResponseObject(o, callback.argument); + if (callback.success) { + if (!callback.scope) { + callback.success(responseObject); + } + else { + callback.success.apply(callback.scope, [responseObject]); + } + } + } + else { + switch (httpStatus) { + case 12002: + case 12029: + case 12030: + case 12031: + case 12152: + case 13030: + responseObject = createExceptionObject(o.tId, callback.argument, (isAbort ? isAbort : false), isTimeout); + if (callback.failure) { + if (!callback.scope) { + callback.failure(responseObject); + } + else { + callback.failure.apply(callback.scope, [responseObject]); + } + } + break; + default: + responseObject = createResponseObject(o, callback.argument); + if (callback.failure) { + if (!callback.scope) { + callback.failure(responseObject); + } + else { + callback.failure.apply(callback.scope, [responseObject]); + } + } + } + } + + releaseObject(o); + responseObject = null; + } + + // private + function handleReadyState(o, callback){ + callback = callback || {}; + var conn = o.conn, + tId = o.tId, + poll = pub.poll, + cbTimeout = callback.timeout || null; + + if (cbTimeout) { + pub.conn[tId] = conn; + pub.timeout[tId] = setTimeout(function() { + pub.abort(o, callback, true); + }, cbTimeout); + } + + poll[tId] = setInterval( + function() { + if (conn && conn.readyState == 4) { + clearInterval(poll[tId]); + poll[tId] = null; + + if (cbTimeout) { + clearTimeout(pub.timeout[tId]); + pub.timeout[tId] = null; + } + + handleTransactionResponse(o, callback); + } + }, + pub.pollInterval); + } + + // private + function asyncRequest(method, uri, callback, postData) { + var o = getConnectionObject() || null; + + if (o) { + o.conn.open(method, uri, true); + + if (pub.useDefaultXhrHeader) { + initHeader('X-Requested-With', pub.defaultXhrHeader); + } + + if(postData && pub.useDefaultHeader && (!pub.headers || !pub.headers[CONTENTTYPE])){ + initHeader(CONTENTTYPE, pub.defaultPostHeader); + } + + if (pub.defaultHeaders || pub.headers) { + setHeader(o); + } + + handleReadyState(o, callback); + o.conn.send(postData || null); + } + return o; + } + + // private + function getConnectionObject() { + var o; + + try { + if (o = createXhrObject(pub.transactionId)) { + pub.transactionId++; + } + } catch(e) { + } finally { + return o; + } + } + + // private + function createXhrObject(transactionId) { + var http; + + try { + http = new XMLHttpRequest(); + } catch(e) { + for (var i = 0; i < activeX.length; ++i) { + try { + http = new ActiveXObject(activeX[i]); + break; + } catch(e) {} + } + } finally { + return {conn : http, tId : transactionId}; + } + } + + var pub = { + request : function(method, uri, cb, data, options) { + if(options){ + var me = this, + xmlData = options.xmlData, + jsonData = options.jsonData, + hs; + + Ext.applyIf(me, options); + + if(xmlData || jsonData){ + hs = me.headers; + if(!hs || !hs[CONTENTTYPE]){ + initHeader(CONTENTTYPE, xmlData ? 'text/xml' : 'application/json'); + } + data = xmlData || (!Ext.isPrimitive(jsonData) ? Ext.encode(jsonData) : jsonData); + } + } + return asyncRequest(method || options.method || "POST", uri, cb, data); + }, + + serializeForm : function(form) { + var fElements = form.elements || (document.forms[form] || Ext.getDom(form)).elements, + hasSubmit = false, + encoder = encodeURIComponent, + element, + options, + name, + val, + data = '', + type; + + Ext.each(fElements, function(element) { + name = element.name; + type = element.type; + + if (!element.disabled && name){ + if(/select-(one|multiple)/i.test(type)) { + Ext.each(element.options, function(opt) { + if (opt.selected) { + data += String.format("{0}={1}&", encoder(name), encoder((opt.hasAttribute ? opt.hasAttribute('value') : opt.getAttribute('value') !== null) ? opt.value : opt.text)); + } + }); + } else if(!/file|undefined|reset|button/i.test(type)) { + if(!(/radio|checkbox/i.test(type) && !element.checked) && !(type == 'submit' && hasSubmit)){ + + data += encoder(name) + '=' + encoder(element.value) + '&'; + hasSubmit = /submit/i.test(type); + } + } + } + }); + return data.substr(0, data.length - 1); + }, + + useDefaultHeader : true, + defaultPostHeader : 'application/x-www-form-urlencoded; charset=UTF-8', + useDefaultXhrHeader : true, + defaultXhrHeader : 'XMLHttpRequest', + poll : {}, + timeout : {}, + conn: {}, + pollInterval : 50, + transactionId : 0, + +// This is never called - Is it worth exposing this? +// setProgId : function(id) { +// activeX.unshift(id); +// }, + +// This is never called - Is it worth exposing this? +// setDefaultPostHeader : function(b) { +// this.useDefaultHeader = b; +// }, + +// This is never called - Is it worth exposing this? +// setDefaultXhrHeader : function(b) { +// this.useDefaultXhrHeader = b; +// }, + +// This is never called - Is it worth exposing this? +// setPollingInterval : function(i) { +// if (typeof i == 'number' && isFinite(i)) { +// this.pollInterval = i; +// } +// }, + +// This is never called - Is it worth exposing this? +// resetDefaultHeaders : function() { +// this.defaultHeaders = null; +// }, + + abort : function(o, callback, isTimeout) { + var me = this, + tId = o.tId, + isAbort = false; + + if (me.isCallInProgress(o)) { + o.conn.abort(); + clearInterval(me.poll[tId]); + me.poll[tId] = null; + clearTimeout(pub.timeout[tId]); + me.timeout[tId] = null; + + handleTransactionResponse(o, callback, (isAbort = true), isTimeout); + } + return isAbort; + }, + + isCallInProgress : function(o) { + // if there is a connection and readyState is not 0 or 4 + return o.conn && !{0:true,4:true}[o.conn.readyState]; + } + }; + return pub; +}(); Ext.lib.Region = function(t, r, b, l) { + var me = this; + me.top = t; + me[1] = t; + me.right = r; + me.bottom = b; + me.left = l; + me[0] = l; + }; + + Ext.lib.Region.prototype = { + contains : function(region) { + var me = this; + return ( region.left >= me.left && + region.right <= me.right && + region.top >= me.top && + region.bottom <= me.bottom ); + + }, + + getArea : function() { + var me = this; + return ( (me.bottom - me.top) * (me.right - me.left) ); + }, + + intersect : function(region) { + var me = this, + t = Math.max(me.top, region.top), + r = Math.min(me.right, region.right), + b = Math.min(me.bottom, region.bottom), + l = Math.max(me.left, region.left); + + if (b >= t && r >= l) { + return new Ext.lib.Region(t, r, b, l); + } + }, + + union : function(region) { + var me = this, + t = Math.min(me.top, region.top), + r = Math.max(me.right, region.right), + b = Math.max(me.bottom, region.bottom), + l = Math.min(me.left, region.left); + + return new Ext.lib.Region(t, r, b, l); + }, + + constrainTo : function(r) { + var me = this; + me.top = me.top.constrain(r.top, r.bottom); + me.bottom = me.bottom.constrain(r.top, r.bottom); + me.left = me.left.constrain(r.left, r.right); + me.right = me.right.constrain(r.left, r.right); + return me; + }, + + adjust : function(t, l, b, r) { + var me = this; + me.top += t; + me.left += l; + me.right += r; + me.bottom += b; + return me; + } + }; + + Ext.lib.Region.getRegion = function(el) { + var p = Ext.lib.Dom.getXY(el), + t = p[1], + r = p[0] + el.offsetWidth, + b = p[1] + el.offsetHeight, + l = p[0]; + + return new Ext.lib.Region(t, r, b, l); + }; Ext.lib.Point = function(x, y) { + if (Ext.isArray(x)) { + y = x[1]; + x = x[0]; + } + var me = this; + me.x = me.right = me.left = me[0] = x; + me.y = me.top = me.bottom = me[1] = y; + }; + + Ext.lib.Point.prototype = new Ext.lib.Region(); +(function(){ + var EXTLIB = Ext.lib, + noNegatives = /width|height|opacity|padding/i, + offsetAttribute = /^((width|height)|(top|left))$/, + defaultUnit = /width|height|top$|bottom$|left$|right$/i, + offsetUnit = /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i, + isset = function(v){ + return typeof v !== 'undefined'; + }, + now = function(){ + return new Date(); + }; + + EXTLIB.Anim = { + motion : function(el, args, duration, easing, cb, scope) { + return this.run(el, args, duration, easing, cb, scope, Ext.lib.Motion); + }, + + run : function(el, args, duration, easing, cb, scope, type) { + type = type || Ext.lib.AnimBase; + if (typeof easing == "string") { + easing = Ext.lib.Easing[easing]; + } + var anim = new type(el, args, duration, easing); + anim.animateX(function() { + if(Ext.isFunction(cb)){ + cb.call(scope); + } + }); + return anim; + } + }; + + EXTLIB.AnimBase = function(el, attributes, duration, method) { + if (el) { + this.init(el, attributes, duration, method); + } + }; + + EXTLIB.AnimBase.prototype = { + doMethod: function(attr, start, end) { + var me = this; + return me.method(me.curFrame, start, end - start, me.totalFrames); + }, + + + setAttr: function(attr, val, unit) { + if (noNegatives.test(attr) && val < 0) { + val = 0; + } + Ext.fly(this.el, '_anim').setStyle(attr, val + unit); + }, + + + getAttr: function(attr) { + var el = Ext.fly(this.el), + val = el.getStyle(attr), + a = offsetAttribute.exec(attr) || []; + + if (val !== 'auto' && !offsetUnit.test(val)) { + return parseFloat(val); + } + + return (!!(a[2]) || (el.getStyle('position') == 'absolute' && !!(a[3]))) ? el.dom['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)] : 0; + }, + + + getDefaultUnit: function(attr) { + return defaultUnit.test(attr) ? 'px' : ''; + }, + + animateX : function(callback, scope) { + var me = this, + f = function() { + me.onComplete.removeListener(f); + if (Ext.isFunction(callback)) { + callback.call(scope || me, me); + } + }; + me.onComplete.addListener(f, me); + me.animate(); + }, + + + setRunAttr: function(attr) { + var me = this, + a = this.attributes[attr], + to = a.to, + by = a.by, + from = a.from, + unit = a.unit, + ra = (this.runAttrs[attr] = {}), + end; + + if (!isset(to) && !isset(by)){ + return false; + } + + var start = isset(from) ? from : me.getAttr(attr); + if (isset(to)) { + end = to; + }else if(isset(by)) { + if (Ext.isArray(start)){ + end = []; + for(var i=0,len=start.length; i 0 && isFinite(tweak)){ + if(tween.curFrame + tweak >= frames){ + tweak = frames - (frame + 1); + } + tween.curFrame += tweak; + } + }; + }; + + EXTLIB.Bezier = new function() { + + this.getPosition = function(points, t) { + var n = points.length, + tmp = [], + c = 1 - t, + i, + j; + + for (i = 0; i < n; ++i) { + tmp[i] = [points[i][0], points[i][1]]; + } + + for (j = 1; j < n; ++j) { + for (i = 0; i < n - j; ++i) { + tmp[i][0] = c * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0]; + tmp[i][1] = c * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; + } + } + + return [ tmp[0][0], tmp[0][1] ]; + + }; + }; + + + EXTLIB.Easing = { + easeNone: function (t, b, c, d) { + return c * t / d + b; + }, + + + easeIn: function (t, b, c, d) { + return c * (t /= d) * t + b; + }, + + + easeOut: function (t, b, c, d) { + return -c * (t /= d) * (t - 2) + b; + } + }; + + (function() { + EXTLIB.Motion = function(el, attributes, duration, method) { + if (el) { + EXTLIB.Motion.superclass.constructor.call(this, el, attributes, duration, method); + } + }; + + Ext.extend(EXTLIB.Motion, Ext.lib.AnimBase); + + var superclass = EXTLIB.Motion.superclass, + proto = EXTLIB.Motion.prototype, + pointsRe = /^points$/i; + + Ext.apply(EXTLIB.Motion.prototype, { + setAttr: function(attr, val, unit){ + var me = this, + setAttr = superclass.setAttr; + + if (pointsRe.test(attr)) { + unit = unit || 'px'; + setAttr.call(me, 'left', val[0], unit); + setAttr.call(me, 'top', val[1], unit); + } else { + setAttr.call(me, attr, val, unit); + } + }, + + getAttr: function(attr){ + var me = this, + getAttr = superclass.getAttr; + + return pointsRe.test(attr) ? [getAttr.call(me, 'left'), getAttr.call(me, 'top')] : getAttr.call(me, attr); + }, + + doMethod: function(attr, start, end){ + var me = this; + + return pointsRe.test(attr) + ? EXTLIB.Bezier.getPosition(me.runAttrs[attr], me.method(me.curFrame, 0, 100, me.totalFrames) / 100) + : superclass.doMethod.call(me, attr, start, end); + }, + + setRunAttr: function(attr){ + if(pointsRe.test(attr)){ + + var me = this, + el = this.el, + points = this.attributes.points, + control = points.control || [], + from = points.from, + to = points.to, + by = points.by, + DOM = EXTLIB.Dom, + start, + i, + end, + len, + ra; + + + if(control.length > 0 && !Ext.isArray(control[0])){ + control = [control]; + }else{ + /* + var tmp = []; + for (i = 0,len = control.length; i < len; ++i) { + tmp[i] = control[i]; + } + control = tmp; + */ + } + + Ext.fly(el, '_anim').position(); + DOM.setXY(el, isset(from) ? from : DOM.getXY(el)); + start = me.getAttr('points'); + + + if(isset(to)){ + end = translateValues.call(me, to, start); + for (i = 0,len = control.length; i < len; ++i) { + control[i] = translateValues.call(me, control[i], start); + } + } else if (isset(by)) { + end = [start[0] + by[0], start[1] + by[1]]; + + for (i = 0,len = control.length; i < len; ++i) { + control[i] = [ start[0] + control[i][0], start[1] + control[i][1] ]; + } + } + + ra = this.runAttrs[attr] = [start]; + if (control.length > 0) { + ra = ra.concat(control); + } + + ra[ra.length] = end; + }else{ + superclass.setRunAttr.call(this, attr); + } + } + }); + + var translateValues = function(val, start) { + var pageXY = EXTLIB.Dom.getXY(this.el); + return [val[0] - pageXY[0] + start[0], val[1] - pageXY[1] + start[1]]; + }; + })(); +})();// Easing functions +(function(){ + // shortcuts to aid compression + var abs = Math.abs, + pi = Math.PI, + asin = Math.asin, + pow = Math.pow, + sin = Math.sin, + EXTLIB = Ext.lib; + + Ext.apply(EXTLIB.Easing, { + + easeBoth: function (t, b, c, d) { + return ((t /= d / 2) < 1) ? c / 2 * t * t + b : -c / 2 * ((--t) * (t - 2) - 1) + b; + }, + + easeInStrong: function (t, b, c, d) { + return c * (t /= d) * t * t * t + b; + }, + + easeOutStrong: function (t, b, c, d) { + return -c * ((t = t / d - 1) * t * t * t - 1) + b; + }, + + easeBothStrong: function (t, b, c, d) { + return ((t /= d / 2) < 1) ? c / 2 * t * t * t * t + b : -c / 2 * ((t -= 2) * t * t * t - 2) + b; + }, + + elasticIn: function (t, b, c, d, a, p) { + if (t == 0 || (t /= d) == 1) { + return t == 0 ? b : b + c; + } + p = p || (d * .3); + + var s; + if (a >= abs(c)) { + s = p / (2 * pi) * asin(c / a); + } else { + a = c; + s = p / 4; + } + + return -(a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b; + + }, + + elasticOut: function (t, b, c, d, a, p) { + if (t == 0 || (t /= d) == 1) { + return t == 0 ? b : b + c; + } + p = p || (d * .3); + + var s; + if (a >= abs(c)) { + s = p / (2 * pi) * asin(c / a); + } else { + a = c; + s = p / 4; + } + + return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p) + c + b; + }, + + elasticBoth: function (t, b, c, d, a, p) { + if (t == 0 || (t /= d / 2) == 2) { + return t == 0 ? b : b + c; + } + + p = p || (d * (.3 * 1.5)); + + var s; + if (a >= abs(c)) { + s = p / (2 * pi) * asin(c / a); + } else { + a = c; + s = p / 4; + } + + return t < 1 ? + -.5 * (a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b : + a * pow(2, -10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p) * .5 + c + b; + }, + + backIn: function (t, b, c, d, s) { + s = s || 1.70158; + return c * (t /= d) * t * ((s + 1) * t - s) + b; + }, + + + backOut: function (t, b, c, d, s) { + if (!s) { + s = 1.70158; + } + return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; + }, + + + backBoth: function (t, b, c, d, s) { + s = s || 1.70158; + + return ((t /= d / 2 ) < 1) ? + c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b : + c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b; + }, + + + bounceIn: function (t, b, c, d) { + return c - EXTLIB.Easing.bounceOut(d - t, 0, c, d) + b; + }, + + + bounceOut: function (t, b, c, d) { + if ((t /= d) < (1 / 2.75)) { + return c * (7.5625 * t * t) + b; + } else if (t < (2 / 2.75)) { + return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b; + } else if (t < (2.5 / 2.75)) { + return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b; + } + return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b; + }, + + + bounceBoth: function (t, b, c, d) { + return (t < d / 2) ? + EXTLIB.Easing.bounceIn(t * 2, 0, c, d) * .5 + b : + EXTLIB.Easing.bounceOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b; + } + }); +})(); + +(function() { + var EXTLIB = Ext.lib; + // Color Animation + EXTLIB.Anim.color = function(el, args, duration, easing, cb, scope) { + return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.ColorAnim); + } + + EXTLIB.ColorAnim = function(el, attributes, duration, method) { + EXTLIB.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method); + }; + + Ext.extend(EXTLIB.ColorAnim, EXTLIB.AnimBase); + + var superclass = EXTLIB.ColorAnim.superclass, + colorRE = /color$/i, + transparentRE = /^transparent|rgba\(0, 0, 0, 0\)$/, + rgbRE = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i, + hexRE= /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i, + hex3RE = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i, + isset = function(v){ + return typeof v !== 'undefined'; + }; + + // private + function parseColor(s) { + var pi = parseInt, + base, + out = null, + c; + + if (s.length == 3) { + return s; + } + + Ext.each([hexRE, rgbRE, hex3RE], function(re, idx){ + base = (idx % 2 == 0) ? 16 : 10; + c = re.exec(s); + if(c && c.length == 4){ + out = [pi(c[1], base), pi(c[2], base), pi(c[3], base)]; + return false; + } + }); + return out; + } + + Ext.apply(EXTLIB.ColorAnim.prototype, { + getAttr : function(attr) { + var me = this, + el = me.el, + val; + if(colorRE.test(attr)){ + while(el && transparentRE.test(val = Ext.fly(el).getStyle(attr))){ + el = el.parentNode; + val = "fff"; + } + }else{ + val = superclass.getAttr.call(me, attr); + } + return val; + }, + + doMethod : function(attr, start, end) { + var me = this, + val, + floor = Math.floor, + i, + len, + v; + + if(colorRE.test(attr)){ + val = []; + end = end || []; + + for(i = 0, len = start.length; i < len; i++) { + v = start[i]; + val[i] = superclass.doMethod.call(me, attr, v, end[i]); + } + val = 'rgb(' + floor(val[0]) + ',' + floor(val[1]) + ',' + floor(val[2]) + ')'; + }else{ + val = superclass.doMethod.call(me, attr, start, end); + } + return val; + }, + + setRunAttr : function(attr) { + var me = this, + a = me.attributes[attr], + to = a.to, + by = a.by, + ra; + + superclass.setRunAttr.call(me, attr); + ra = me.runAttrs[attr]; + if(colorRE.test(attr)){ + var start = parseColor(ra.start), + end = parseColor(ra.end); + + if(!isset(to) && isset(by)){ + end = parseColor(by); + for(var i=0,len=start.length; i'about:blank', except for IE in secure mode, which is 'javascript:""'). - * @type String - */ + SSL_SECURE_URL : isSecure && isIE ? 'javascript:""' : 'about:blank', - /** - * True if the browser is in strict (standards-compliant) mode, as opposed to quirks mode - * @type Boolean - */ + isStrict : isStrict, - /** - * True if the page is running over SSL - * @type Boolean - */ + isSecure : isSecure, - /** - * True when the document is fully initialized and ready for action - * @type Boolean - */ + isReady : false, - /** - * True if the {@link Ext.Fx} Class is available - * @type Boolean - * @property enableFx - */ + - /** - * True to automatically uncache orphaned Ext.Elements periodically (defaults to true) - * @type Boolean - */ + enableGarbageCollector : true, - /** - * True to automatically purge event listeners during garbageCollection (defaults to false). - * @type Boolean - */ + enableListenerCollection : false, - /** - * EXPERIMENTAL - True to cascade listener removal to child elements when an element is removed. - * Currently not optimized for performance. - * @type Boolean - */ + enableNestedListenerRemoval : false, - /** - * Indicates whether to use native browser parsing for JSON methods. - * This option is ignored if the browser does not support native JSON methods. - * Note: Native JSON methods will not work with objects that have functions. - * Also, property names must be quoted, otherwise the data will not parse. (Defaults to false) - * @type Boolean - */ + USE_NATIVE_JSON : false, - /** - * Copies all the properties of config to obj if they don't already exist. - * @param {Object} obj The receiver of the properties - * @param {Object} config The source of the properties - * @return {Object} returns obj - */ + applyIf : function(o, c){ if(o){ for(var p in c){ @@ -154,12 +101,7 @@ Ext.apply = function(o, c, defaults){ return o; }, - /** - * Generates unique ids. If the element already has an id, it is unchanged - * @param {Mixed} el (optional) The element to generate an id for - * @param {String} prefix (optional) Id prefix (defaults "ext-gen") - * @return {String} The generated Id. - */ + id : function(el, prefix){ el = Ext.getDom(el, true) || {}; if (!el.id) { @@ -168,57 +110,9 @@ Ext.apply = function(o, c, defaults){ return el.id; }, - /** - *

Extends one class to create a subclass and optionally overrides members with the passed literal. This method - * also adds the function "override()" to the subclass that can be used to override members of the class.

- * For example, to create a subclass of Ext GridPanel: - *

-MyGridPanel = Ext.extend(Ext.grid.GridPanel, {
-    constructor: function(config) {
-
-//      Create configuration for this Grid.
-        var store = new Ext.data.Store({...});
-        var colModel = new Ext.grid.ColumnModel({...});
-
-//      Create a new config object containing our computed properties
-//      *plus* whatever was in the config parameter.
-        config = Ext.apply({
-            store: store,
-            colModel: colModel
-        }, config);
-
-        MyGridPanel.superclass.constructor.call(this, config);
-
-//      Your postprocessing here
-    },
-
-    yourMethod: function() {
-        // etc.
-    }
-});
-
- * - *

This function also supports a 3-argument call in which the subclass's constructor is - * passed as an argument. In this form, the parameters are as follows:

- *
    - *
  • subclass : Function
    The subclass constructor.
  • - *
  • superclass : Function
    The constructor of class being extended
  • - *
  • overrides : Object
    A literal with members which are copied into the subclass's - * prototype, and are therefore shared among all instances of the new class.
  • - *
- * - * @param {Function} superclass The constructor of class being extended. - * @param {Object} overrides

A literal with members which are copied into the subclass's - * prototype, and are therefore shared between all instances of the new class.

- *

This may contain a special member named constructor. This is used - * to define the constructor of the new class, and is returned. If this property is - * not specified, a constructor is generated and returned which just calls the - * superclass's constructor passing on its parameters.

- *

It is essential that you call the superclass constructor in any provided constructor. See example code.

- * @return {Function} The subclass constructor from the overrides parameter, or a generated one if not provided. - */ + extend : function(){ - // inline overrides + var io = function(o){ for(var m in o){ this[m] = o[m]; @@ -227,7 +121,7 @@ MyGridPanel = Ext.extend(Ext.grid.GridPanel, { var oc = Object.prototype.constructor; return function(sb, sp, overrides){ - if(Ext.isObject(sp)){ + if(typeof sp == 'object'){ overrides = sp; sp = sb; sb = overrides.constructor != oc ? overrides.constructor : function(){sp.apply(this, arguments);}; @@ -256,23 +150,7 @@ MyGridPanel = Ext.extend(Ext.grid.GridPanel, { }; }(), - /** - * Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name. - * Usage:

-Ext.override(MyClass, {
-    newMethod1: function(){
-        // etc.
-    },
-    newMethod2: function(foo){
-        // etc.
-    }
-});
-
- * @param {Object} origclass The class to override - * @param {Object} overrides The list of functions to add to origClass. This should be specified as an object literal - * containing one or more methods. - * @method override - */ + override : function(origclass, overrides){ if(overrides){ var p = origclass.prototype; @@ -283,21 +161,7 @@ Ext.override(MyClass, { } }, - /** - * Creates namespaces to be used for scoping variables and classes so that they are not global. - * Specifying the last node of a namespace implicitly creates all other nodes. Usage: - *

-Ext.namespace('Company', 'Company.data');
-Ext.namespace('Company.data'); // equivalent and preferable to above syntax
-Company.Widget = function() { ... }
-Company.data.CustomStore = function(config) { ... }
-
- * @param {String} namespace1 - * @param {String} namespace2 - * @param {String} etc - * @return {Object} The namespace object. (If multiple arguments are passed, this will be the last namespace created) - * @method namespace - */ + namespace : function(){ var o, d; Ext.each(arguments, function(v) { @@ -310,12 +174,7 @@ Company.data.CustomStore = function(config) { ... } return o; }, - /** - * 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. - * @param {Object} o - * @param {String} pre (optional) A prefix to add to the url encoded string - * @return {String} - */ + urlEncode : function(o, pre){ var empty, buf = [], @@ -334,15 +193,7 @@ Company.data.CustomStore = function(config) { ... } return pre + buf.join(''); }, - /** - * Takes an encoded URL and and converts it to an object. Example:

-Ext.urlDecode("foo=1&bar=2"); // returns {foo: "1", bar: "2"}
-Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {foo: "1", bar: ["2", "3", "4"]}
-
- * @param {String} string - * @param {Boolean} overwrite (optional) Items of the same name will overwrite previous values instead of creating an an array (Defaults to false). - * @return {Object} A literal with members - */ + urlDecode : function(string, overwrite){ if(Ext.isEmpty(string)){ return {}; @@ -362,13 +213,7 @@ Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {foo: "1", bar: ["2" return obj; }, - /** - * Appends content to the query string of a URL, handling logic for whether to place - * a question mark or ampersand. - * @param {String} url The URL to append to. - * @param {String} s The content to append to the URL. - * @return (String) The resulting URL - */ + urlAppend : function(url, s){ if(!Ext.isEmpty(s)){ return url + (url.indexOf('?') === -1 ? '?' : '&') + s; @@ -376,13 +221,7 @@ Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {foo: "1", bar: ["2" return url; }, - /** - * Converts any iterable (numeric indices and a length property) into a true array - * Don't use this on strings. IE doesn't support "abc"[0] which this implementation depends on. - * For strings, use this instead: "abc".match(/./g) => [a,b,c]; - * @param {Iterable} the iterable object to be turned into a true Array. - * @return (Array) array - */ + toArray : function(){ return isIE ? function(a, i, j, res){ @@ -398,42 +237,20 @@ Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {foo: "1", bar: ["2" }(), isIterable : function(v){ - //check for array or arguments + if(Ext.isArray(v) || v.callee){ return true; } - //check for node list type + if(/NodeList|HTMLCollection/.test(toString.call(v))){ return true; } - //NodeList has an item and length property - //IXMLDOMNodeList has nextNode method, needs to be checked first. + + return ((typeof v.nextNode != 'undefined' || v.item) && Ext.isNumber(v.length)); }, - /** - * Iterates an array calling the supplied function. - * @param {Array/NodeList/Mixed} array The array to be iterated. If this - * argument is not really an array, the supplied function is called once. - * @param {Function} fn The function to be called with each item. If the - * supplied function returns false, iteration stops and this method returns - * the current index. This function is called with - * the following arguments: - *
    - *
  • item : Mixed - *
    The item at the current index - * in the passed array
  • - *
  • index : Number - *
    The current index within the array
  • - *
  • allItems : Array - *
    The array passed as the first - * argument to Ext.each.
  • - *
- * @param {Object} scope The scope (this reference) in which the specified function is executed. - * Defaults to the item at the current index - * within the passed array. - * @return See description for the fn parameter. - */ + each : function(array, fn, scope){ if(Ext.isEmpty(array, true)){ return; @@ -448,26 +265,7 @@ Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {foo: "1", bar: ["2" } }, - /** - * Iterates either the elements in an array, or each of the properties in an object. - * Note: If you are only iterating arrays, it is better to call {@link #each}. - * @param {Object/Array} object The object or array to be iterated - * @param {Function} fn The function to be called for each iteration. - * The iteration will stop if the supplied function returns false, or - * all array elements / object properties have been covered. The signature - * varies depending on the type of object being interated: - *
    - *
  • Arrays : (Object item, Number index, Array allItems) - *
    - * When iterating an array, the supplied function is called with each item.
  • - *
  • Objects : (String key, Object value, Object) - *
    - * When iterating an object, the supplied function is called with each key-value pair in - * the object, and the iterated object
  • - *
- * @param {Object} scope The scope (this reference) in which the specified function is executed. Defaults to - * the object being iterated. - */ + iterate : function(obj, fn, scope){ if(Ext.isEmpty(obj)){ return; @@ -475,7 +273,7 @@ Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {foo: "1", bar: ["2" if(Ext.isIterable(obj)){ Ext.each(obj, fn, scope); return; - }else if(Ext.isObject(obj)){ + }else if(typeof obj == 'object'){ for(var prop in obj){ if(obj.hasOwnProperty(prop)){ if(fn.call(scope || obj, prop, obj[prop], obj) === false){ @@ -486,29 +284,7 @@ Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {foo: "1", bar: ["2" } }, - /** - * Return the dom node for the passed String (id), dom node, or Ext.Element. - * Optional 'strict' flag is needed for IE since it can return 'name' and - * 'id' elements by using getElementById. - * Here are some examples: - *

-// gets dom node based on id
-var elDom = Ext.getDom('elId');
-// gets dom node based on the dom node
-var elDom1 = Ext.getDom(elDom);
-
-// If we don't know if we are working with an
-// Ext.Element or a dom node use Ext.getDom
-function(el){
-    var dom = Ext.getDom(el);
-    // do something with the dom node
-}
-         * 
- * Note: the dom node to be found actually needs to exist (be rendered, etc) - * when this method is called to be successful. - * @param {Mixed} el - * @return HTMLElement - */ + getDom : function(el, strict){ if(!el || !DOC){ return null; @@ -516,10 +292,10 @@ function(el){ if (el.dom){ return el.dom; } else { - if (Ext.isString(el)) { + if (typeof el == 'string') { var e = DOC.getElementById(el); - // IE returns elements with the 'name' and 'id' attribute. - // we do a strict check to return the element with only the id attribute + + if (e && isIE && strict) { if (el == e.getAttribute('id')) { return e; @@ -534,24 +310,13 @@ function(el){ } }, - /** - * Returns the current document body as an {@link Ext.Element}. - * @return Ext.Element The document body - */ + getBody : function(){ return Ext.get(DOC.body || DOC.documentElement); }, - /** - * Removes a DOM node from the document. - */ - /** - *

Removes this element from the document, removes all DOM event listeners, and deletes the cache reference. - * All DOM event listeners are removed from this element. If {@link Ext#enableNestedListenerRemoval} is - * true, then DOM event listeners are also removed from all child nodes. The body node - * will be ignored if passed in.

- * @param {HTMLElement} node The node to remove - */ + + removeNode : isIE && !isIE8 ? function(){ var d; return function(n){ @@ -571,224 +336,102 @@ function(el){ } }, - /** - *

Returns true if the passed value is empty.

- *

The value is deemed to be empty if it is

    - *
  • null
  • - *
  • undefined
  • - *
  • an empty array
  • - *
  • a zero length string (Unless the allowBlank parameter is true)
  • - *
- * @param {Mixed} value The value to test - * @param {Boolean} allowBlank (optional) true to allow empty strings (defaults to false) - * @return {Boolean} - */ + isEmpty : function(v, allowBlank){ return v === null || v === undefined || ((Ext.isArray(v) && !v.length)) || (!allowBlank ? v === '' : false); }, - /** - * Returns true if the passed value is a JavaScript array, otherwise false. - * @param {Mixed} value The value to test - * @return {Boolean} - */ + isArray : function(v){ return toString.apply(v) === '[object Array]'; }, - /** - * Returns true if the passed object is a JavaScript date object, otherwise false. - * @param {Object} object The object to test - * @return {Boolean} - */ + isDate : function(v){ return toString.apply(v) === '[object Date]'; }, - /** - * Returns true if the passed value is a JavaScript Object, otherwise false. - * @param {Mixed} value The value to test - * @return {Boolean} - */ + isObject : function(v){ return !!v && Object.prototype.toString.call(v) === '[object Object]'; }, - /** - * Returns true if the passed value is a JavaScript 'primitive', a string, number or boolean. - * @param {Mixed} value The value to test - * @return {Boolean} - */ + isPrimitive : function(v){ return Ext.isString(v) || Ext.isNumber(v) || Ext.isBoolean(v); }, - /** - * Returns true if the passed value is a JavaScript Function, otherwise false. - * @param {Mixed} value The value to test - * @return {Boolean} - */ + isFunction : function(v){ return toString.apply(v) === '[object Function]'; }, - /** - * Returns true if the passed value is a number. Returns false for non-finite numbers. - * @param {Mixed} value The value to test - * @return {Boolean} - */ + isNumber : function(v){ return typeof v === 'number' && isFinite(v); }, - /** - * Returns true if the passed value is a string. - * @param {Mixed} value The value to test - * @return {Boolean} - */ + isString : function(v){ return typeof v === 'string'; }, - /** - * Returns true if the passed value is a boolean. - * @param {Mixed} value The value to test - * @return {Boolean} - */ + isBoolean : function(v){ return typeof v === 'boolean'; }, - /** - * Returns true if the passed value is an HTMLElement - * @param {Mixed} value The value to test - * @return {Boolean} - */ + isElement : function(v) { return v ? !!v.tagName : false; }, - /** - * Returns true if the passed value is not undefined. - * @param {Mixed} value The value to test - * @return {Boolean} - */ + isDefined : function(v){ return typeof v !== 'undefined'; }, - /** - * True if the detected browser is Opera. - * @type Boolean - */ + isOpera : isOpera, - /** - * True if the detected browser uses WebKit. - * @type Boolean - */ + isWebKit : isWebKit, - /** - * True if the detected browser is Chrome. - * @type Boolean - */ + isChrome : isChrome, - /** - * True if the detected browser is Safari. - * @type Boolean - */ + isSafari : isSafari, - /** - * True if the detected browser is Safari 3.x. - * @type Boolean - */ + isSafari3 : isSafari3, - /** - * True if the detected browser is Safari 4.x. - * @type Boolean - */ + isSafari4 : isSafari4, - /** - * True if the detected browser is Safari 2.x. - * @type Boolean - */ + isSafari2 : isSafari2, - /** - * True if the detected browser is Internet Explorer. - * @type Boolean - */ + isIE : isIE, - /** - * True if the detected browser is Internet Explorer 6.x. - * @type Boolean - */ + isIE6 : isIE6, - /** - * True if the detected browser is Internet Explorer 7.x. - * @type Boolean - */ + isIE7 : isIE7, - /** - * True if the detected browser is Internet Explorer 8.x. - * @type Boolean - */ + isIE8 : isIE8, - /** - * True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox). - * @type Boolean - */ + isGecko : isGecko, - /** - * True if the detected browser uses a pre-Gecko 1.9 layout engine (e.g. Firefox 2.x). - * @type Boolean - */ + isGecko2 : isGecko2, - /** - * True if the detected browser uses a Gecko 1.9+ layout engine (e.g. Firefox 3.x). - * @type Boolean - */ + isGecko3 : isGecko3, - /** - * True if the detected browser is Internet Explorer running in non-strict mode. - * @type Boolean - */ + isBorderBox : isBorderBox, - /** - * True if the detected platform is Linux. - * @type Boolean - */ + isLinux : isLinux, - /** - * True if the detected platform is Windows. - * @type Boolean - */ + isWindows : isWindows, - /** - * True if the detected platform is Mac OS. - * @type Boolean - */ + isMac : isMac, - /** - * True if the detected platform is Adobe Air. - * @type Boolean - */ + isAir : isAir }); - /** - * Creates namespaces to be used for scoping variables and classes so that they are not global. - * Specifying the last node of a namespace implicitly creates all other nodes. Usage: - *

-Ext.namespace('Company', 'Company.data');
-Ext.namespace('Company.data'); // equivalent and preferable to above syntax
-Company.Widget = function() { ... }
-Company.data.CustomStore = function(config) { ... }
-
- * @param {String} namespace1 - * @param {String} namespace2 - * @param {String} etc - * @return {Object} The namespace object. (If multiple arguments are passed, this will be the last namespace created) - * @method ns - */ + Ext.ns = Ext.namespace; })(); @@ -796,36 +439,9 @@ Ext.ns("Ext.util", "Ext.lib", "Ext.data"); Ext.elCache = {}; -/** - * @class Function - * These functions are available on every Function object (any JavaScript function). - */ -Ext.apply(Function.prototype, { - /** - * Creates an interceptor function. The passed function is called before the original one. If it returns false, - * the original one is not called. The resulting function returns the results of the original function. - * The passed function is called with the parameters of the original function. Example usage: - *

-var sayHi = function(name){
-    alert('Hi, ' + name);
-}
-
-sayHi('Fred'); // alerts "Hi, Fred"
-
-// create a new function that validates input without
-// directly modifying the original function:
-var sayHiToFriend = sayHi.createInterceptor(function(name){
-    return name == 'Brian';
-});
 
-sayHiToFriend('Fred');  // no alert
-sayHiToFriend('Brian'); // alerts "Hi, Brian"
-
- * @param {Function} fcn The function to call before the original - * @param {Object} scope (optional) The scope (this reference) in which the passed function is executed. - * If omitted, defaults to the scope in which the original function is called or the browser window. - * @return {Function} The new function - */ +Ext.apply(Function.prototype, { + createInterceptor : function(fcn, scope){ var method = this; return !Ext.isFunction(fcn) ? @@ -841,32 +457,9 @@ sayHiToFriend('Brian'); // alerts "Hi, Brian" }; }, - /** - * Creates a callback that passes arguments[0], arguments[1], arguments[2], ... - * Call directly on any function. Example: myFunction.createCallback(arg1, arg2) - * Will create a function that is bound to those 2 args. If a specific scope is required in the - * callback, use {@link #createDelegate} instead. The function returned by createCallback always - * executes in the window scope. - *

This method is required when you want to pass arguments to a callback function. If no arguments - * are needed, you can simply pass a reference to the function as a callback (e.g., callback: myFn). - * However, if you tried to pass a function with arguments (e.g., callback: myFn(arg1, arg2)) the function - * would simply execute immediately when the code is parsed. Example usage: - *


-var sayHi = function(name){
-    alert('Hi, ' + name);
-}
-
-// clicking the button alerts "Hi, Fred"
-new Ext.Button({
-    text: 'Say Hi',
-    renderTo: Ext.getBody(),
-    handler: sayHi.createCallback('Fred')
-});
-
- * @return {Function} The new function - */ - createCallback : function(/*args...*/){ - // make args available, in function below + + createCallback : function(){ + var args = arguments, method = this; return function() { @@ -874,37 +467,7 @@ new Ext.Button({ }; }, - /** - * Creates a delegate (callback) that sets the scope to obj. - * Call directly on any function. Example: this.myFunction.createDelegate(this, [arg1, arg2]) - * Will create a function that is automatically scoped to obj so that the this variable inside the - * callback points to obj. Example usage: - *

-var sayHi = function(name){
-    // Note this use of "this.text" here.  This function expects to
-    // execute within a scope that contains a text property.  In this
-    // example, the "this" variable is pointing to the btn object that
-    // was passed in createDelegate below.
-    alert('Hi, ' + name + '. You clicked the "' + this.text + '" button.');
-}
-
-var btn = new Ext.Button({
-    text: 'Say Hi',
-    renderTo: Ext.getBody()
-});
-
-// This callback will execute in the scope of the
-// button instance. Clicking the button alerts
-// "Hi, Fred. You clicked the "Say Hi" button."
-btn.on('click', sayHi.createDelegate(btn, ['Fred']));
-
- * @param {Object} scope (optional) The scope (this reference) in which the function is executed. - * If omitted, defaults to the browser window. - * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller) - * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding, - * if a number the args are inserted at the specified position - * @return {Function} The new function - */ + createDelegate : function(obj, args, appendArgs){ var method = this; return function() { @@ -913,41 +476,15 @@ btn.on('click', sayHi.createDelegate(btn, ['Fred'])); callArgs = Array.prototype.slice.call(arguments, 0); callArgs = callArgs.concat(args); }else if (Ext.isNumber(appendArgs)){ - callArgs = Array.prototype.slice.call(arguments, 0); // copy arguments first - var applyArgs = [appendArgs, 0].concat(args); // create method call params - Array.prototype.splice.apply(callArgs, applyArgs); // splice them in + callArgs = Array.prototype.slice.call(arguments, 0); + var applyArgs = [appendArgs, 0].concat(args); + Array.prototype.splice.apply(callArgs, applyArgs); } return method.apply(obj || window, callArgs); }; }, - /** - * Calls this function after the number of millseconds specified, optionally in a specific scope. Example usage: - *

-var sayHi = function(name){
-    alert('Hi, ' + name);
-}
-
-// executes immediately:
-sayHi('Fred');
-
-// executes after 2 seconds:
-sayHi.defer(2000, this, ['Fred']);
-
-// this syntax is sometimes useful for deferring
-// execution of an anonymous function:
-(function(){
-    alert('Anonymous');
-}).defer(100);
-
- * @param {Number} millis The number of milliseconds for the setTimeout call (if less than or equal to 0 the function is executed immediately) - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. - * If omitted, defaults to the browser window. - * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller) - * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding, - * if a number the args are inserted at the specified position - * @return {Number} The timeout id that can be used with clearTimeout - */ + defer : function(millis, obj, args, appendArgs){ var fn = this.createDelegate(obj, args, appendArgs); if(millis > 0){ @@ -958,25 +495,9 @@ sayHi.defer(2000, this, ['Fred']); } }); -/** - * @class String - * These functions are available on every String object. - */ + Ext.applyIf(String, { - /** - * Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens. Each - * token must be unique, and must increment in the format {0}, {1}, etc. Example usage: - *

-var cls = 'my-class', text = 'Some text';
-var s = String.format('<div class="{0}">{1}</div>', cls, text);
-// s now contains the string: '<div class="my-class">Some text</div>'
-     * 
- * @param {String} string The tokenized string to be formatted - * @param {String} value1 The value to replace token {0} - * @param {String} value2 Etc... - * @return {String} The formatted string - * @static - */ + format : function(format){ var args = Ext.toArray(arguments, 1); return format.replace(/\{(\d+)\}/g, function(m, i){ @@ -985,16 +506,9 @@ var s = String.format('<div class="{0}">{1}</div>', cls, text); } }); -/** - * @class Array - */ + Ext.applyIf(Array.prototype, { - /** - * Checks whether or not the specified object exists in the array. - * @param {Object} o The object to check for - * @param {Number} from (Optional) The index at which to begin the search - * @return {Number} The index of o in the array (or -1 if it is not found) - */ + indexOf : function(o, from){ var len = this.length; from = from || 0; @@ -1007,11 +521,7 @@ Ext.applyIf(Array.prototype, { return -1; }, - /** - * Removes the specified object from the array. If the object is not found nothing happens. - * @param {Object} o The object to remove - * @return {Array} this array - */ + remove : function(o){ var index = this.indexOf(o); if(index != -1){ @@ -1020,86 +530,47 @@ Ext.applyIf(Array.prototype, { return this; } }); -/** - * @class Ext - */ + Ext.ns("Ext.grid", "Ext.list", "Ext.dd", "Ext.tree", "Ext.form", "Ext.menu", "Ext.state", "Ext.layout", "Ext.app", "Ext.ux", "Ext.chart", "Ext.direct"); - /** - * Namespace alloted for extensions to the framework. - * @property ux - * @type Object - */ + Ext.apply(Ext, function(){ - var E = Ext, + var E = Ext, idSeed = 0, scrollWidth = null; return { - /** - * A reusable empty function - * @property - * @type Function - */ + emptyFn : function(){}, - /** - * URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images. - * In older versions of IE, this defaults to "http://extjs.com/s.gif" and you should change this to a URL on your server. - * For other browsers it uses an inline data URL. - * @type String - */ + BLANK_IMAGE_URL : Ext.isIE6 || Ext.isIE7 || Ext.isAir ? - 'http:/' + '/extjs.com/s.gif' : + 'http:/' + '/www.extjs.com/s.gif' : 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', extendX : function(supr, fn){ return Ext.extend(supr, fn(supr.prototype)); }, - /** - * Returns the current HTML document object as an {@link Ext.Element}. - * @return Ext.Element The document - */ + getDoc : function(){ return Ext.get(document); }, - /** - * Utility method for validating that a value is numeric, returning the specified default value if it is not. - * @param {Mixed} value Should be a number, but any type will be handled appropriately - * @param {Number} defaultValue The value to return if the original value is non-numeric - * @return {Number} Value, if numeric, else defaultValue - */ + num : function(v, defaultValue){ - v = Number(Ext.isEmpty(v) || Ext.isArray(v) || Ext.isBoolean(v) || (Ext.isString(v) && v.trim().length == 0) ? NaN : v); + v = Number(Ext.isEmpty(v) || Ext.isArray(v) || typeof v == 'boolean' || (typeof v == 'string' && v.trim().length == 0) ? NaN : v); return isNaN(v) ? defaultValue : v; }, - /** - *

Utility method for returning a default value if the passed value is empty.

- *

The value is deemed to be empty if it is

    - *
  • null
  • - *
  • undefined
  • - *
  • an empty array
  • - *
  • a zero length string (Unless the allowBlank parameter is true)
  • - *
- * @param {Mixed} value The value to test - * @param {Mixed} defaultValue The value to return if the original value is empty - * @param {Boolean} allowBlank (optional) true to allow zero length strings to qualify as non-empty (defaults to false) - * @return {Mixed} value, if non-empty, else defaultValue - */ + value : function(v, defaultValue, allowBlank){ return Ext.isEmpty(v, allowBlank) ? defaultValue : v; }, - /** - * Escapes the passed string for use in a regular expression - * @param {String} str - * @return {String} - */ + escapeRe : function(s) { return s.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1"); }, @@ -1108,36 +579,19 @@ Ext.apply(Ext, function(){ o[name] = o[name].createSequence(fn, scope); }, - /** - * Applies event listeners to elements by selectors when the document is ready. - * The event name is specified with an @ suffix. - *

-Ext.addBehaviors({
-    // add a listener for click on all anchors in element with id foo
-    '#foo a@click' : function(e, t){
-        // do something
-    },
-    
-    // add the same listener to multiple selectors (separated by comma BEFORE the @)
-    '#foo a, #bar span.some-class@mouseover' : function(){
-        // do something
-    }
-});
-         * 
- * @param {Object} obj The list of behaviors to apply - */ + addBehaviors : function(o){ if(!Ext.isReady){ Ext.onReady(function(){ Ext.addBehaviors(o); }); } else { - var cache = {}, // simple cache for applying multiple behaviors to same selector does query multiple times + var cache = {}, parts, b, s; for (b in o) { - if ((parts = b.split('@'))[1]) { // for Object prototype breakers + if ((parts = b.split('@'))[1]) { s = parts[0]; if(!cache[s]){ cache[s] = Ext.select(s); @@ -1148,34 +602,29 @@ Ext.addBehaviors({ cache = null; } }, + - /** - * Utility method for getting the width of the browser scrollbar. This can differ depending on - * operating system settings, such as the theme or font size. - * @param {Boolean} force (optional) true to force a recalculation of the value. - * @return {Number} The width of the scrollbar. - */ getScrollBarWidth: function(force){ if(!Ext.isReady){ return 0; } - + if(force === true || scrollWidth === null){ - // Append our div, do our calculation and then remove it + var div = Ext.getBody().createChild('
'), child = div.child('div', true); var w1 = child.offsetWidth; div.setStyle('overflow', (Ext.isWebKit || Ext.isGecko) ? 'auto' : 'scroll'); var w2 = child.offsetWidth; div.remove(); - // Need to add 2 to ensure we leave enough space + scrollWidth = w1 - w2 + 2; } return scrollWidth; }, - // deprecated + combine : function(){ var as = arguments, l = as.length, r = []; for(var i = 0; i < l; i++){ @@ -1191,25 +640,9 @@ Ext.addBehaviors({ return r; }, - /** - * Copies a set of named properties fom the source object to the destination object. - *

example:


-ImageComponent = Ext.extend(Ext.BoxComponent, {
-    initComponent: function() {
-        this.autoEl = { tag: 'img' };
-        MyComponent.superclass.initComponent.apply(this, arguments);
-        this.initialBox = Ext.copyTo({}, this.initialConfig, 'x,y,width,height');
-    }
-});
-         * 
- * @param {Object} dest The destination object. - * @param {Object} source The source object. - * @param {Array/String} names Either an Array of property names, or a comma-delimited list - * of property names to copy. - * @return {Object} The modified object. - */ + copyTo : function(dest, source, names){ - if(Ext.isString(names)){ + if(typeof names == 'string'){ names = names.split(/[,;\s]/); } Ext.each(names, function(name){ @@ -1220,36 +653,22 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { return dest; }, - /** - * Attempts to destroy any objects passed to it by removing all event listeners, removing them from the - * DOM (if applicable) and calling their destroy functions (if available). This method is primarily - * intended for arguments of type {@link Ext.Element} and {@link Ext.Component}, but any subclass of - * {@link Ext.util.Observable} can be passed in. Any number of elements and/or components can be - * passed into this function in a single call as separate arguments. - * @param {Mixed} arg1 An {@link Ext.Element}, {@link Ext.Component}, or an Array of either of these to destroy - * @param {Mixed} arg2 (optional) - * @param {Mixed} etc... (optional) - */ + destroy : function(){ Ext.each(arguments, function(arg){ if(arg){ if(Ext.isArray(arg)){ this.destroy.apply(this, arg); - }else if(Ext.isFunction(arg.destroy)){ + }else if(typeof arg.destroy == 'function'){ arg.destroy(); }else if(arg.dom){ arg.remove(); - } + } } }, this); }, - /** - * Attempts to destroy and then remove a set of named properties of the passed object. - * @param {Object} o The object (most likely a Component) who's properties you wish to destroy. - * @param {Mixed} arg1 The name of the property to destroy and remove from the object. - * @param {Mixed} etc... More property names to destroy and remove. - */ + destroyMembers : function(o, arg1, arg2, etc){ for(var i = 1, a = arguments, len = a.length; i < len; i++) { Ext.destroy(o[a[i]]); @@ -1257,11 +676,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { } }, - /** - * Creates a copy of the passed Array with falsy values removed. - * @param {Array/NodeList} arr The Array from which to remove falsy values. - * @return {Array} The new, compressed Array. - */ + clean : function(arr){ var ret = []; Ext.each(arr, function(v){ @@ -1272,11 +687,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { return ret; }, - /** - * Creates a copy of the passed Array, filtered to contain only unique values. - * @param {Array} arr The Array to filter - * @return {Array} The new Array containing unique values. - */ + unique : function(arr){ var ret = [], collect = {}; @@ -1290,11 +701,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { return ret; }, - /** - * Recursively flattens into 1-d Array. Injects Arrays inline. - * @param {Array} arr The array to flatten - * @return {Array} The new, flattened array. - */ + flatten : function(arr){ var worker = []; function rFlatten(a) { @@ -1310,13 +717,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { return rFlatten(arr); }, - /** - * Returns the minimum value in the Array. - * @param {Array|NodeList} arr The Array from which to select the minimum value. - * @param {Function} comp (optional) a function to perform the comparision which determines minimization. - * If omitted the "<" operator will be used. Note: gt = 1; eq = 0; lt = -1 - * @return {Object} The minimum value in the Array. - */ + min : function(arr, comp){ var ret = arr[0]; comp = comp || function(a,b){ return a < b ? -1 : 1; }; @@ -1326,13 +727,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { return ret; }, - /** - * Returns the maximum value in the Array - * @param {Array|NodeList} arr The Array from which to select the maximum value. - * @param {Function} comp (optional) a function to perform the comparision which determines maximization. - * If omitted the ">" operator will be used. Note: gt = 1; eq = 0; lt = -1 - * @return {Object} The maximum value in the Array. - */ + max : function(arr, comp){ var ret = arr[0]; comp = comp || function(a,b){ return a > b ? 1 : -1; }; @@ -1342,20 +737,12 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { return ret; }, - /** - * Calculates the mean of the Array - * @param {Array} arr The Array to calculate the mean value of. - * @return {Number} The mean. - */ + mean : function(arr){ return arr.length > 0 ? Ext.sum(arr) / arr.length : undefined; }, - /** - * Calculates the sum of the Array - * @param {Array} arr The Array to calculate the sum value of. - * @return {Number} The sum. - */ + sum : function(arr){ var ret = 0; Ext.each(arr, function(v) { @@ -1364,29 +751,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { return ret; }, - /** - * Partitions the set into two sets: a true set and a false set. - * Example: - * Example2: - *

-// Example 1:
-Ext.partition([true, false, true, true, false]); // [[true, true, true], [false, false]]
-
-// Example 2:
-Ext.partition(
-    Ext.query("p"),
-    function(val){
-        return val.className == "class1"
-    }
-);
-// true are those paragraph elements with a className of "class1",
-// false set are those that do not have that className.
-         * 
- * @param {Array|NodeList} arr The array to partition - * @param {Function} truth (optional) a function to determine truth. If this is omitted the element - * itself must be able to be evaluated for its truthfulness. - * @return {Array} [true,false] - */ + partition : function(arr, truth){ var ret = [[],[]]; Ext.each(arr, function(v, i, a) { @@ -1395,23 +760,12 @@ Ext.partition( return ret; }, - /** - * Invokes a method on each item in an Array. - *

-// Example:
-Ext.invoke(Ext.query("p"), "getAttribute", "id");
-// [el1.getAttribute("id"), el2.getAttribute("id"), ..., elN.getAttribute("id")]
-         * 
- * @param {Array|NodeList} arr The Array of items to invoke the method on. - * @param {String} methodName The method name to invoke. - * @param {...*} args Arguments to send into the method invocation. - * @return {Array} The results of invoking the method on each item in the array. - */ + invoke : function(arr, methodName){ var ret = [], args = Array.prototype.slice.call(arguments, 2); Ext.each(arr, function(v,i) { - if (v && Ext.isFunction(v[methodName])) { + if (v && typeof v[methodName] == 'function') { ret.push(v[methodName].apply(v, args)); } else { ret.push(undefined); @@ -1420,16 +774,7 @@ Ext.invoke(Ext.query("p"), "getAttribute", "id"); return ret; }, - /** - * Plucks the value of a property from each item in the Array - *

-// Example:
-Ext.pluck(Ext.query("p"), "className"); // [el1.className, el2.className, ..., elN.className]
-         * 
- * @param {Array|NodeList} arr The Array of items to pluck the value from. - * @param {String} prop The property name to pluck from each element. - * @return {Array} The value from each item in the Array. - */ + pluck : function(arr, prop){ var ret = []; Ext.each(arr, function(v) { @@ -1438,27 +783,9 @@ Ext.pluck(Ext.query("p"), "className"); // [el1.className, el2.className, ..., e return ret; }, - /** - *

Zips N sets together.

- *

-// Example 1:
-Ext.zip([1,2,3],[4,5,6]); // [[1,4],[2,5],[3,6]]
-// Example 2:
-Ext.zip(
-    [ "+", "-", "+"],
-    [  12,  10,  22],
-    [  43,  15,  96],
-    function(a, b, c){
-        return "$" + a + "" + b + "." + c
-    }
-); // ["$+12.43", "$-10.15", "$+22.96"]
-         * 
- * @param {Arrays|NodeLists} arr This argument may be repeated. Array(s) to contribute values. - * @param {Function} zipper (optional) The last item in the argument list. This will drive how the items are zipped together. - * @return {Array} The zipped set. - */ + zip : function(){ - var parts = Ext.partition(arguments, function( val ){ return !Ext.isFunction(val); }), + var parts = Ext.partition(arguments, function( val ){ return typeof val != 'function'; }), arrs = parts[0], fn = parts[1][0], len = Ext.max(Ext.pluck(arrs, "length")), @@ -1477,44 +804,16 @@ Ext.zip( return ret; }, - /** - * This is shorthand reference to {@link Ext.ComponentMgr#get}. - * Looks up an existing {@link Ext.Component Component} by {@link Ext.Component#id id} - * @param {String} id The component {@link Ext.Component#id id} - * @return Ext.Component The Component, undefined if not found, or null if a - * Class was found. - */ + getCmp : function(id){ return Ext.ComponentMgr.get(id); }, - /** - * By default, Ext intelligently decides whether floating elements should be shimmed. If you are using flash, - * you may want to set this to true. - * @type Boolean - */ + useShims: E.isIE6 || (E.isMac && E.isGecko2), - // inpired by a similar function in mootools library - /** - * Returns the type of object that is passed in. If the object passed in is null or undefined it - * return false otherwise it returns one of the following values:
    - *
  • string: If the object passed is a string
  • - *
  • number: If the object passed is a number
  • - *
  • boolean: If the object passed is a boolean value
  • - *
  • date: If the object passed is a Date object
  • - *
  • function: If the object passed is a function reference
  • - *
  • object: If the object passed is an object
  • - *
  • array: If the object passed is an array
  • - *
  • regexp: If the object passed is a regular expression
  • - *
  • element: If the object passed is a DOM Element
  • - *
  • nodelist: If the object passed is a DOM NodeList
  • - *
  • textnode: If the object passed is a DOM text node and contains something other than whitespace
  • - *
  • whitespace: If the object passed is a DOM text node and contains only whitespace
  • - *
- * @param {Mixed} object - * @return {String} - */ + + type : function(o){ if(o === undefined || o === null){ return false; @@ -1535,7 +834,7 @@ Ext.zip( case RegExp: return 'regexp'; case Date: return 'date'; } - if(Ext.isNumber(o.length) && Ext.isFunction(o.item)) { + if(typeof o.length == 'number' && typeof o.item == 'function') { return 'nodelist'; } } @@ -1546,9 +845,9 @@ Ext.zip( o[name] = o[name].createInterceptor(fn, scope); }, - // internal + callback : function(cb, scope, args, delay){ - if(Ext.isFunction(cb)){ + if(typeof cb == 'function'){ if(delay){ cb.defer(delay, scope, args || []); }else{ @@ -1559,36 +858,12 @@ Ext.zip( }; }()); -/** - * @class Function - * These functions are available on every Function object (any JavaScript function). - */ -Ext.apply(Function.prototype, { - /** - * Create a combined function call sequence of the original function + the passed function. - * The resulting function returns the results of the original function. - * The passed fcn is called with the parameters of the original function. Example usage: - *

-var sayHi = function(name){
-    alert('Hi, ' + name);
-}
-
-sayHi('Fred'); // alerts "Hi, Fred"
-
-var sayGoodbye = sayHi.createSequence(function(name){
-    alert('Bye, ' + name);
-});
 
-sayGoodbye('Fred'); // both alerts show
-
- * @param {Function} fcn The function to sequence - * @param {Object} scope (optional) The scope (this reference) in which the passed function is executed. - * If omitted, defaults to the scope in which the original function is called or the browser window. - * @return {Function} The new function - */ +Ext.apply(Function.prototype, { + createSequence : function(fcn, scope){ var method = this; - return !Ext.isFunction(fcn) ? + return (typeof fcn != 'function') ? this : function(){ var retval = method.apply(this || window, arguments); @@ -1599,35 +874,15 @@ sayGoodbye('Fred'); // both alerts show }); -/** - * @class String - * These functions are available as static methods on the JavaScript String object. - */ + Ext.applyIf(String, { - /** - * Escapes the passed string for ' and \ - * @param {String} string The string to escape - * @return {String} The escaped string - * @static - */ + escape : function(string) { return string.replace(/('|\\)/g, "\\$1"); }, - /** - * Pads the left side of a string with a specified character. This is especially useful - * for normalizing number and date strings. Example usage: - *

-var s = String.leftPad('123', 5, '0');
-// s now contains the string: '00123'
-     * 
- * @param {String} string The original string - * @param {Number} size The total length of the output string - * @param {String} char (optional) The character with which to pad the original string (defaults to empty string " ") - * @return {String} The padded string - * @static - */ + leftPad : function (val, size, ch) { var result = String(val); if(!ch) { @@ -1640,101 +895,32 @@ var s = String.leftPad('123', 5, '0'); } }); -/** - * Utility function that allows you to easily switch a string between two alternating values. The passed value - * is compared to the current string, and if they are equal, the other value that was passed in is returned. If - * they are already different, the first value passed in is returned. Note that this method returns the new value - * but does not change the current string. - *

-// alternate sort directions
-sort = sort.toggle('ASC', 'DESC');
-
-// instead of conditional logic:
-sort = (sort == 'ASC' ? 'DESC' : 'ASC');
-
- * @param {String} value The value to compare to the current string - * @param {String} other The new value to use if the string already equals the first value passed in - * @return {String} The new value - */ + String.prototype.toggle = function(value, other){ return this == value ? other : value; }; -/** - * Trims whitespace from either end of a string, leaving spaces within the string intact. Example: - *

-var s = '  foo bar  ';
-alert('-' + s + '-');         //alerts "- foo bar -"
-alert('-' + s.trim() + '-');  //alerts "-foo bar-"
-
- * @return {String} The trimmed string - */ + String.prototype.trim = function(){ var re = /^\s+|\s+$/g; return function(){ return this.replace(re, ""); }; }(); -// here to prevent dependency on Date.js -/** - Returns the number of milliseconds between this date and date - @param {Date} date (optional) Defaults to now - @return {Number} The diff in milliseconds - @member Date getElapsed - */ + + Date.prototype.getElapsed = function(date) { return Math.abs((date || new Date()).getTime()-this.getTime()); }; -/** - * @class Number - */ + Ext.applyIf(Number.prototype, { - /** - * Checks whether or not the current number is within a desired range. If the number is already within the - * range it is returned, otherwise the min or max value is returned depending on which side of the range is - * exceeded. Note that this method returns the constrained value but does not change the current number. - * @param {Number} min The minimum number in the range - * @param {Number} max The maximum number in the range - * @return {Number} The constrained value if outside the range, otherwise the current value - */ + constrain : function(min, max){ return Math.min(Math.max(this, min), max); } }); -/** - * @class Ext.util.TaskRunner - * Provides the ability to execute one or more arbitrary tasks in a multithreaded - * manner. Generally, you can use the singleton {@link Ext.TaskMgr} instead, but - * if needed, you can create separate instances of TaskRunner. Any number of - * separate tasks can be started at any time and will run independently of each - * other. Example usage: - *

-// Start a simple clock task that updates a div once per second
-var updateClock = function(){
-    Ext.fly('clock').update(new Date().format('g:i:s A'));
-} 
-var task = {
-    run: updateClock,
-    interval: 1000 //1 second
-}
-var runner = new Ext.util.TaskRunner();
-runner.start(task);
-
-// equivalent using TaskMgr
-Ext.TaskMgr.start({
-    run: updateClock,
-    interval: 1000
-});
 
- * 
- *

See the {@link #start} method for details about how to configure a task object.

- * Also see {@link Ext.util.DelayedTask}. - * - * @constructor - * @param {Number} interval (optional) The minimum precision in milliseconds supported by this TaskRunner instance - * (defaults to 10) - */ Ext.util.TaskRunner = function(interval){ interval = interval || 10; var tasks = [], @@ -1742,14 +928,14 @@ Ext.util.TaskRunner = function(interval){ id = 0, running = false, - // private + stopThread = function(){ running = false; clearInterval(id); id = 0; }, - // private + startThread = function(){ if(!running){ running = true; @@ -1757,7 +943,7 @@ Ext.util.TaskRunner = function(interval){ } }, - // private + removeTask = function(t){ removeQueue.push(t); if(t.onStop){ @@ -1765,7 +951,7 @@ Ext.util.TaskRunner = function(interval){ } }, - // private + runTasks = function(){ var rqLen = removeQueue.length, now = new Date().getTime(); @@ -1797,30 +983,7 @@ Ext.util.TaskRunner = function(interval){ } }; - /** - * Starts a new task. - * @method start - * @param {Object} task

A config object that supports the following properties:

    - *
  • run : Function

    The function to execute each time the task is invoked. The - * function will be called at each interval and passed the args argument if specified, and the - * current invocation count if not.

    - *

    If a particular scope (this reference) is required, be sure to specify it using the scope argument.

    - *

    Return false from this function to terminate the task.

  • - *
  • interval : Number
    The frequency in milliseconds with which the task - * should be invoked.
  • - *
  • args : Array
    (optional) An array of arguments to be passed to the function - * specified by run. If not specified, the current invocation count is passed.
  • - *
  • scope : Object
    (optional) The scope (this reference) in which to execute the - * run function. Defaults to the task config object.
  • - *
  • duration : Number
    (optional) The length of time in milliseconds to invoke - * the task before stopping automatically (defaults to indefinite).
  • - *
  • repeat : Number
    (optional) The number of times to invoke the task before - * stopping automatically (defaults to indefinite).
  • - *

- *

Before each invocation, Ext injects the property taskRunCount into the task object so - * that calculations based on the repeat count can be performed.

- * @return {Object} The task - */ + this.start = function(task){ tasks.push(task); task.taskStartTime = new Date().getTime(); @@ -1830,21 +993,13 @@ Ext.util.TaskRunner = function(interval){ return task; }; - /** - * Stops an existing running task. - * @method stop - * @param {Object} task The task to stop - * @return {Object} The task - */ + this.stop = function(task){ removeTask(task); return task; }; - /** - * Stops all tasks that are currently running. - * @method stopAll - */ + this.stopAll = function(){ stopThread(); for(var i = 0, len = tasks.length; i < len; i++){ @@ -1857,24 +1012,7 @@ Ext.util.TaskRunner = function(interval){ }; }; -/** - * @class Ext.TaskMgr - * @extends Ext.util.TaskRunner - * A static {@link Ext.util.TaskRunner} instance that can be used to start and stop arbitrary tasks. See - * {@link Ext.util.TaskRunner} for supported methods and task config properties. - *

-// Start a simple clock task that updates a div once per second
-var task = {
-    run: function(){
-        Ext.fly('clock').update(new Date().format('g:i:s A'));
-    },
-    interval: 1000 //1 second
-}
-Ext.TaskMgr.start(task);
-
- *

See the {@link #start} method for details about how to configure a task object.

- * @singleton - */ + Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ var libFlyweight; @@ -2049,7 +1187,7 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ win = window, doc = document, - // constants + POLL_RETRYS = 200, POLL_INTERVAL = 20, EL = 0, @@ -2063,7 +1201,7 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ UNLOAD = 'unload', MOUSEOVER = 'mouseover', MOUSEOUT = 'mouseout', - // private + doAdd = function() { var ret; if (win.addEventListener) { @@ -2089,7 +1227,7 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ } return ret; }(), - // private + doRemove = function(){ var ret; if (win.removeEventListener) { @@ -2130,24 +1268,26 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ return false; } - // private + function _tryPreloadAttach() { var ret = false, notAvail = [], - element, i, len, v, + element, i, v, override, tryAgain = !loadComplete || (retryCount > 0); - if (!locked) { + if(!locked){ locked = true; - - for (i = 0, len = onAvailStack.length; i < len; i++) { + + for(i = 0; i < onAvailStack.length; ++i){ v = onAvailStack[i]; if(v && (element = doc.getElementById(v.id))){ if(!v.checkReady || loadComplete || element.nextSibling || (doc && doc.body)) { - element = v.override ? (v.override === true ? v.obj : v.override) : element; + override = v.override; + element = override ? (override === true ? v.obj : override) : element; v.fn.call(element, v.obj); onAvailStack.remove(v); - } else { + --i; + }else{ notAvail.push(v); } } @@ -2161,13 +1301,12 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ clearInterval(_interval); _interval = null; } - ret = !(locked = false); } return ret; } - // private + function startInterval() { if(!_interval){ var callback = function() { @@ -2177,7 +1316,7 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ } } - // private + function getScroll() { var dd = doc.documentElement, db = doc.body; @@ -2190,7 +1329,7 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ } } - // private + function getPageCoord (ev, xy) { ev = ev.browserEvent || ev; var coord = ev['page' + xy]; @@ -2219,7 +1358,7 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ startInterval(); }, - // This function should ALWAYS be called from Ext.EventManager + addListener: function(el, eventName, fn) { el = Ext.getDom(el); if (el && fn) { @@ -2235,7 +1374,7 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ return false; }, - // This function should ALWAYS be called from Ext.EventManager + removeListener: function(el, eventName, fn) { el = Ext.getDom(el); var i, len, li, lis; @@ -2263,7 +1402,7 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ if(!node){ return; } - // work around firefox bug, https://bugzilla.mozilla.org/show_bug.cgi?id=101197 + var s = HTMLElement.prototype.toString.call(node); if(s == '[xpconnect wrapped native prototype]' || s == '[object XULElement]'){ return; @@ -2336,13 +1475,13 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ return ev.charCode || ev.keyCode || 0; }, - //clearCache: function() {}, - // deprecated, call from EventManager + + getListeners : function(el, eventName) { Ext.EventManager.getListeners(el, eventName); }, - // deprecated, call from EventManager + purgeElement : function(el, recurse, eventName) { Ext.EventManager.purgeElement(el, recurse, eventName); }, @@ -2351,8 +1490,8 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ loadComplete = true; var EU = Ext.lib.Event; if (Ext.isIE && e !== true) { - // IE8 complains that _load is null or not an object - // so lets remove self via arguments.callee + + doRemove(win, "load", arguments.callee); } }, @@ -2381,7 +1520,7 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ } }; - // Initialize stuff. + pub.on = pub.addListener; pub.un = pub.removeListener; if (doc && doc.body) { @@ -2394,19 +1533,14 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){ return pub; }(); -/* -* Portions of this file are based on pieces of Yahoo User Interface Library -* Copyright (c) 2007, Yahoo! Inc. All rights reserved. -* YUI licensed under the BSD License: -* http://developer.yahoo.net/yui/license.txt -*/ + Ext.lib.Ajax = function() { var activeX = ['MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP'], CONTENTTYPE = 'Content-Type'; - // private + function setHeader(o) { var conn = o.conn, prop; @@ -2429,7 +1563,7 @@ Ext.lib.Ajax = function() { } } - // private + function createExceptionObject(tId, callbackArg, isAbort, isTimeout) { return { tId : tId, @@ -2441,19 +1575,19 @@ Ext.lib.Ajax = function() { }; } - // private + function initHeader(label, value) { (pub.headers = pub.headers || {})[label] = value; } - // private + function createResponseObject(o, callbackArg) { var headerObj = {}, headerStr, conn = o.conn, t, s, - // see: https://prototype.lighthouseapp.com/projects/8886/tickets/129-ie-mangles-http-response-status-code-204-to-1223 + isBrokenStatus = conn.status == 1223; try { @@ -2472,7 +1606,7 @@ Ext.lib.Ajax = function() { return { tId : o.tId, - // Normalize the status and statusText when IE returns 1223, see the above link. + status : isBrokenStatus ? 204 : conn.status, statusText : isBrokenStatus ? 'No Content' : conn.statusText, getResponseHeader : function(header){return headerObj[header.toLowerCase()];}, @@ -2483,7 +1617,7 @@ Ext.lib.Ajax = function() { }; } - // private + function releaseObject(o) { if (o.tId) { pub.conn[o.tId] = null; @@ -2492,7 +1626,7 @@ Ext.lib.Ajax = function() { o = null; } - // private + function handleTransactionResponse(o, callback, isAbort, isTimeout) { if (!callback) { releaseObject(o); @@ -2559,7 +1693,7 @@ Ext.lib.Ajax = function() { responseObject = null; } - // private + function handleReadyState(o, callback){ callback = callback || {}; var conn = o.conn, @@ -2591,7 +1725,7 @@ Ext.lib.Ajax = function() { pub.pollInterval); } - // private + function asyncRequest(method, uri, callback, postData) { var o = getConnectionObject() || null; @@ -2616,7 +1750,7 @@ Ext.lib.Ajax = function() { return o; } - // private + function getConnectionObject() { var o; @@ -2630,7 +1764,7 @@ Ext.lib.Ajax = function() { } } - // private + function createXhrObject(transactionId) { var http; @@ -2713,32 +1847,32 @@ Ext.lib.Ajax = function() { pollInterval : 50, transactionId : 0, -// This is never called - Is it worth exposing this? -// setProgId : function(id) { -// activeX.unshift(id); -// }, - -// This is never called - Is it worth exposing this? -// setDefaultPostHeader : function(b) { -// this.useDefaultHeader = b; -// }, - -// This is never called - Is it worth exposing this? -// setDefaultXhrHeader : function(b) { -// this.useDefaultXhrHeader = b; -// }, - -// This is never called - Is it worth exposing this? -// setPollingInterval : function(i) { -// if (typeof i == 'number' && isFinite(i)) { -// this.pollInterval = i; -// } -// }, - -// This is never called - Is it worth exposing this? -// resetDefaultHeaders : function() { -// this.defaultHeaders = null; -// }, + + + + + + + + + + + + + + + + + + + + + + + + + + abort : function(o, callback, isTimeout) { var me = this, @@ -2758,7 +1892,7 @@ Ext.lib.Ajax = function() { }, isCallInProgress : function(o) { - // if there is a connection and readyState is not 0 or 4 + return o.conn && !{0:true,4:true}[o.conn.readyState]; } }; @@ -3273,13 +2407,7 @@ Ext.lib.Ajax = function() { if(control.length > 0 && !Ext.isArray(control[0])){ control = [control]; }else{ - /* - var tmp = []; - for (i = 0,len = control.length; i < len; ++i) { - tmp[i] = control[i]; - } - control = tmp; - */ + } Ext.fly(el, '_anim').position(); @@ -3317,9 +2445,9 @@ Ext.lib.Ajax = function() { return [val[0] - pageXY[0] + start[0], val[1] - pageXY[1] + start[1]]; }; })(); -})();// Easing functions +})(); (function(){ - // shortcuts to aid compression + var abs = Math.abs, pi = Math.PI, asin = Math.asin, @@ -3450,7 +2578,7 @@ Ext.lib.Ajax = function() { (function() { var EXTLIB = Ext.lib; - // Color Animation + EXTLIB.Anim.color = function(el, args, duration, easing, cb, scope) { return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.ColorAnim); } @@ -3471,7 +2599,7 @@ Ext.lib.Ajax = function() { return typeof v !== 'undefined'; }; - // private + function parseColor(s) { var pi = parseInt, base, @@ -3560,7 +2688,7 @@ Ext.lib.Ajax = function() { (function() { - // Scroll Animation + var EXTLIB = Ext.lib; EXTLIB.Anim.scroll = function(el, args, duration, easing, cb, scope) { return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.Scroll); @@ -3629,4 +2757,4 @@ Ext.lib.Ajax = function() { } window.attachEvent("onunload", fnCleanUp); } -})(); \ No newline at end of file +})(); diff --git a/adapter/ext/ext-base.js b/adapter/ext/ext-base.js index 3e034bcb..5573086e 100644 --- a/adapter/ext/ext-base.js +++ b/adapter/ext/ext-base.js @@ -1,7 +1,7 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ -window.undefined=window.undefined;Ext={version:"3.2.0"};Ext.apply=function(d,e,b){if(b){Ext.apply(d,b)}if(d&&e&&typeof e=="object"){for(var a in e){d[a]=e[a]}}return d};(function(){var g=0,s=Object.prototype.toString,t=navigator.userAgent.toLowerCase(),y=function(e){return e.test(t)},i=document,l=i.compatMode=="CSS1Compat",A=y(/opera/),h=y(/\bchrome\b/),u=y(/webkit/),x=!h&&y(/safari/),f=x&&y(/applewebkit\/4/),b=x&&y(/version\/3/),B=x&&y(/version\/4/),r=!A&&y(/msie/),p=r&&y(/msie 7/),o=r&&y(/msie 8/),q=r&&!p&&!o,n=!u&&y(/gecko/),d=n&&y(/rv:1\.8/),a=n&&y(/rv:1\.9/),v=r&&!l,z=y(/windows|win32/),k=y(/macintosh|mac os x/),j=y(/adobeair/),m=y(/linux/),c=/^https/i.test(window.location.protocol);if(q){try{i.execCommand("BackgroundImageCache",false,true)}catch(w){}}Ext.apply(Ext,{SSL_SECURE_URL:c&&r?'javascript:""':"about:blank",isStrict:l,isSecure:c,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,enableNestedListenerRemoval:false,USE_NATIVE_JSON:false,applyIf:function(C,D){if(C){for(var e in D){if(!Ext.isDefined(C[e])){C[e]=D[e]}}}return C},id:function(e,C){e=Ext.getDom(e,true)||{};if(!e.id){e.id=(C||"ext-gen")+(++g)}return e.id},extend:function(){var C=function(E){for(var D in E){this[D]=E[D]}};var e=Object.prototype.constructor;return function(J,G,I){if(Ext.isObject(G)){I=G;G=J;J=I.constructor!=e?I.constructor:function(){G.apply(this,arguments)}}var E=function(){},H,D=G.prototype;E.prototype=D;H=J.prototype=new E();H.constructor=J;J.superclass=D;if(D.constructor==e){D.constructor=G}J.override=function(F){Ext.override(J,F)};H.superclass=H.supr=(function(){return D});H.override=C;Ext.override(J,I);J.extend=function(F){return Ext.extend(J,F)};return J}}(),override:function(e,D){if(D){var C=e.prototype;Ext.apply(C,D);if(Ext.isIE&&D.hasOwnProperty("toString")){C.toString=D.toString}}},namespace:function(){var C,e;Ext.each(arguments,function(D){e=D.split(".");C=window[e[0]]=window[e[0]]||{};Ext.each(e.slice(1),function(E){C=C[E]=C[E]||{}})});return C},urlEncode:function(G,F){var D,C=[],E=encodeURIComponent;Ext.iterate(G,function(e,H){D=Ext.isEmpty(H);Ext.each(D?e:H,function(I){C.push("&",E(e),"=",(!Ext.isEmpty(I)&&(I!=e||!D))?(Ext.isDate(I)?Ext.encode(I).replace(/"/g,""):E(I)):"")})});if(!F){C.shift();F=""}return F+C.join("")},urlDecode:function(D,C){if(Ext.isEmpty(D)){return{}}var G={},F=D.split("&"),H=decodeURIComponent,e,E;Ext.each(F,function(I){I=I.split("=");e=H(I[0]);E=H(I[1]);G[e]=C||!G[e]?E:[].concat(G[e]).concat(E)});return G},urlAppend:function(e,C){if(!Ext.isEmpty(C)){return e+(e.indexOf("?")===-1?"?":"&")+C}return e},toArray:function(){return r?function(D,G,E,F){F=[];for(var C=0,e=D.length;C0){return setTimeout(d,c)}d();return 0}});Ext.applyIf(String,{format:function(b){var a=Ext.toArray(arguments,1);return b.replace(/\{(\d+)\}/g,function(c,d){return a[d]})}});Ext.applyIf(Array.prototype,{indexOf:function(b,c){var a=this.length;c=c||0;c+=(c<0)?a:0;for(;c
'),g=h.child("div",true);var e=g.offsetWidth;h.setStyle("overflow",(Ext.isWebKit||Ext.isGecko)?"auto":"scroll");var d=g.offsetWidth;h.remove();b=e-d+2}return b},combine:function(){var f=arguments,e=f.length,h=[];for(var g=0;gg?1:-1};Ext.each(d,function(g){f=e(f,g)==1?f:g});return f},mean:function(d){return d.length>0?Ext.sum(d)/d.length:undefined},sum:function(d){var e=0;Ext.each(d,function(f){e+=f});return e},partition:function(d,e){var f=[[],[]];Ext.each(d,function(h,j,g){f[(e&&e(h,j,g))||(!e&&h)?0:1].push(h)});return f},invoke:function(d,e){var g=[],f=Array.prototype.slice.call(arguments,2);Ext.each(d,function(h,j){if(h&&Ext.isFunction(h[e])){g.push(h[e].apply(h,f))}else{g.push(undefined)}});return g},pluck:function(d,f){var e=[];Ext.each(d,function(g){e.push(g[f])});return e},zip:function(){var m=Ext.partition(arguments,function(i){return !Ext.isFunction(i)}),h=m[0],l=m[1][0],d=Ext.max(Ext.pluck(h,"length")),g=[];for(var k=0;k0){for(var p=0;p0);if(!C){C=true;for(K=0,H=p.length;K=0){z=s.substr(0,y).toLowerCase();if(s.charAt(y+1)==" "){++y}A[z]=s.substr(y+1)}})}catch(x){}return{tId:q.tId,status:r?204:u.status,statusText:r?"No Content":u.statusText,getResponseHeader:function(s){return A[s.toLowerCase()]},getAllResponseHeaders:function(){return v},responseText:u.responseText,responseXML:u.responseXML,argument:w}}function n(q){if(q.tId){k.conn[q.tId]=null}q.conn=null;q=null}function f(v,w,r,q){if(!w){n(v);return}var t,s;try{if(v.conn.status!==undefined&&v.conn.status!=0){t=v.conn.status}else{t=13030}}catch(u){t=13030}if((t>=200&&t<300)||(Ext.isIE&&t==1223)){s=o(v,w.argument);if(w.success){if(!w.scope){w.success(s)}else{w.success.apply(w.scope,[s])}}}else{switch(t){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:s=e(v.tId,w.argument,(r?r:false),q);if(w.failure){if(!w.scope){w.failure(s)}else{w.failure.apply(w.scope,[s])}}break;default:s=o(v,w.argument);if(w.failure){if(!w.scope){w.failure(s)}else{w.failure.apply(w.scope,[s])}}}}n(v);s=null}function m(s,v){v=v||{};var q=s.conn,u=s.tId,r=k.poll,t=v.timeout||null;if(t){k.conn[u]=q;k.timeout[u]=setTimeout(function(){k.abort(s,v,true)},t)}r[u]=setInterval(function(){if(q&&q.readyState==4){clearInterval(r[u]);r[u]=null;if(t){clearTimeout(k.timeout[u]);k.timeout[u]=null}f(s,v)}},k.pollInterval)}function i(u,r,t,q){var s=l()||null;if(s){s.conn.open(u,r,true);if(k.useDefaultXhrHeader){j("X-Requested-With",k.defaultXhrHeader)}if(q&&k.useDefaultHeader&&(!k.headers||!k.headers[d])){j(d,k.defaultPostHeader)}if(k.defaultHeaders||k.headers){h(s)}m(s,t);s.conn.send(q||null)}return s}function l(){var r;try{if(r=p(k.transactionId)){k.transactionId++}}catch(q){}finally{return r}}function p(t){var q;try{q=new XMLHttpRequest()}catch(s){for(var r=0;r=d.left&&e.right<=d.right&&e.top>=d.top&&e.bottom<=d.bottom)},getArea:function(){var d=this;return((d.bottom-d.top)*(d.right-d.left))},intersect:function(i){var h=this,f=Math.max(h.top,i.top),g=Math.min(h.right,i.right),d=Math.min(h.bottom,i.bottom),e=Math.max(h.left,i.left);if(d>=f&&g>=e){return new Ext.lib.Region(f,g,d,e)}},union:function(i){var h=this,f=Math.min(h.top,i.top),g=Math.max(h.right,i.right),d=Math.max(h.bottom,i.bottom),e=Math.min(h.left,i.left);return new Ext.lib.Region(f,g,d,e)},constrainTo:function(e){var d=this;d.top=d.top.constrain(e.top,e.bottom);d.bottom=d.bottom.constrain(e.top,e.bottom);d.left=d.left.constrain(e.left,e.right);d.right=d.right.constrain(e.left,e.right);return d},adjust:function(f,e,d,h){var g=this;g.top+=f;g.left+=e;g.right+=h;g.bottom+=d;return g}};Ext.lib.Region.getRegion=function(g){var i=Ext.lib.Dom.getXY(g),f=i[1],h=i[0]+g.offsetWidth,d=i[1]+g.offsetHeight,e=i[0];return new Ext.lib.Region(f,h,d,e)};Ext.lib.Point=function(d,f){if(Ext.isArray(d)){f=d[1];d=d[0]}var e=this;e.x=e.right=e.left=e[0]=d;e.y=e.top=e.bottom=e[1]=f};Ext.lib.Point.prototype=new Ext.lib.Region();(function(){var g=Ext.lib,i=/width|height|opacity|padding/i,f=/^((width|height)|(top|left))$/,d=/width|height|top$|bottom$|left$|right$/i,h=/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i,j=function(k){return typeof k!=="undefined"},e=function(){return new Date()};g.Anim={motion:function(n,l,o,p,k,m){return this.run(n,l,o,p,k,m,Ext.lib.Motion)},run:function(o,l,q,r,k,n,m){m=m||Ext.lib.AnimBase;if(typeof r=="string"){r=Ext.lib.Easing[r]}var p=new m(o,l,q,r);p.animateX(function(){if(Ext.isFunction(k)){k.call(n)}});return p}};g.AnimBase=function(l,k,m,n){if(l){this.init(l,k,m,n)}};g.AnimBase.prototype={doMethod:function(k,n,l){var m=this;return m.method(m.curFrame,n,l-n,m.totalFrames)},setAttr:function(k,m,l){if(i.test(k)&&m<0){m=0}Ext.fly(this.el,"_anim").setStyle(k,m+l)},getAttr:function(k){var m=Ext.fly(this.el),n=m.getStyle(k),l=f.exec(k)||[];if(n!=="auto"&&!h.test(n)){return parseFloat(n)}return(!!(l[2])||(m.getStyle("position")=="absolute"&&!!(l[3])))?m.dom["offset"+l[0].charAt(0).toUpperCase()+l[0].substr(1)]:0},getDefaultUnit:function(k){return d.test(k)?"px":""},animateX:function(n,k){var l=this,m=function(){l.onComplete.removeListener(m);if(Ext.isFunction(n)){n.call(k||l,l)}};l.onComplete.addListener(m,l);l.animate()},setRunAttr:function(p){var r=this,s=this.attributes[p],t=s.to,q=s.by,u=s.from,v=s.unit,l=(this.runAttrs[p]={}),m;if(!j(t)&&!j(q)){return false}var k=j(u)?u:r.getAttr(p);if(j(t)){m=t}else{if(j(q)){if(Ext.isArray(k)){m=[];for(var n=0,o=k.length;n0&&isFinite(w)){if(r.curFrame+w>=v){w=v-(u+1)}r.curFrame+=w}}};g.Bezier=new function(){this.getPosition=function(p,o){var r=p.length,m=[],q=1-o,l,k;for(l=0;l0&&!Ext.isArray(t[0])){t=[t]}else{}Ext.fly(q,"_anim").position();B.setXY(q,j(y)?y:B.getXY(q));p=x.getAttr("points");if(j(z)){r=k.call(x,z,p);for(s=0,u=t.length;s0){o=o.concat(t)}o[o.length]=r}else{n.setRunAttr.call(this,v)}}});var k=function(o,q){var p=g.Dom.getXY(this.el);return[o[0]-p[0]+q[0],o[1]-p[1]+q[1]]}})()})();(function(){var d=Math.abs,i=Math.PI,h=Math.asin,g=Math.pow,e=Math.sin,f=Ext.lib;Ext.apply(f.Easing,{easeBoth:function(k,j,m,l){return((k/=l/2)<1)?m/2*k*k+j:-m/2*((--k)*(k-2)-1)+j},easeInStrong:function(k,j,m,l){return m*(k/=l)*k*k*k+j},easeOutStrong:function(k,j,m,l){return -m*((k=k/l-1)*k*k*k-1)+j},easeBothStrong:function(k,j,m,l){return((k/=l/2)<1)?m/2*k*k*k*k+j:-m/2*((k-=2)*k*k*k-2)+j},elasticIn:function(l,j,q,o,k,n){if(l==0||(l/=o)==1){return l==0?j:j+q}n=n||(o*0.3);var m;if(k>=d(q)){m=n/(2*i)*h(q/k)}else{k=q;m=n/4}return -(k*g(2,10*(l-=1))*e((l*o-m)*(2*i)/n))+j},elasticOut:function(l,j,q,o,k,n){if(l==0||(l/=o)==1){return l==0?j:j+q}n=n||(o*0.3);var m;if(k>=d(q)){m=n/(2*i)*h(q/k)}else{k=q;m=n/4}return k*g(2,-10*l)*e((l*o-m)*(2*i)/n)+q+j},elasticBoth:function(l,j,q,o,k,n){if(l==0||(l/=o/2)==2){return l==0?j:j+q}n=n||(o*(0.3*1.5));var m;if(k>=d(q)){m=n/(2*i)*h(q/k)}else{k=q;m=n/4}return l<1?-0.5*(k*g(2,10*(l-=1))*e((l*o-m)*(2*i)/n))+j:k*g(2,-10*(l-=1))*e((l*o-m)*(2*i)/n)*0.5+q+j},backIn:function(k,j,n,m,l){l=l||1.70158;return n*(k/=m)*k*((l+1)*k-l)+j},backOut:function(k,j,n,m,l){if(!l){l=1.70158}return n*((k=k/m-1)*k*((l+1)*k+l)+1)+j},backBoth:function(k,j,n,m,l){l=l||1.70158;return((k/=m/2)<1)?n/2*(k*k*(((l*=(1.525))+1)*k-l))+j:n/2*((k-=2)*k*(((l*=(1.525))+1)*k+l)+2)+j},bounceIn:function(k,j,m,l){return m-f.Easing.bounceOut(l-k,0,m,l)+j},bounceOut:function(k,j,m,l){if((k/=l)<(1/2.75)){return m*(7.5625*k*k)+j}else{if(k<(2/2.75)){return m*(7.5625*(k-=(1.5/2.75))*k+0.75)+j}else{if(k<(2.5/2.75)){return m*(7.5625*(k-=(2.25/2.75))*k+0.9375)+j}}}return m*(7.5625*(k-=(2.625/2.75))*k+0.984375)+j},bounceBoth:function(k,j,m,l){return(k0){return setTimeout(d,c)}d();return 0}});Ext.applyIf(String,{format:function(b){var a=Ext.toArray(arguments,1);return b.replace(/\{(\d+)\}/g,function(c,d){return a[d]})}});Ext.applyIf(Array.prototype,{indexOf:function(b,c){var a=this.length;c=c||0;c+=(c<0)?a:0;for(;c
'),g=h.child("div",true);var e=g.offsetWidth;h.setStyle("overflow",(Ext.isWebKit||Ext.isGecko)?"auto":"scroll");var d=g.offsetWidth;h.remove();b=e-d+2}return b},combine:function(){var f=arguments,e=f.length,h=[];for(var g=0;gg?1:-1};Ext.each(d,function(g){f=e(f,g)==1?f:g});return f},mean:function(d){return d.length>0?Ext.sum(d)/d.length:undefined},sum:function(d){var e=0;Ext.each(d,function(f){e+=f});return e},partition:function(d,e){var f=[[],[]];Ext.each(d,function(h,j,g){f[(e&&e(h,j,g))||(!e&&h)?0:1].push(h)});return f},invoke:function(d,e){var g=[],f=Array.prototype.slice.call(arguments,2);Ext.each(d,function(h,j){if(h&&typeof h[e]=="function"){g.push(h[e].apply(h,f))}else{g.push(undefined)}});return g},pluck:function(d,f){var e=[];Ext.each(d,function(g){e.push(g[f])});return e},zip:function(){var m=Ext.partition(arguments,function(i){return typeof i!="function"}),h=m[0],l=m[1][0],d=Ext.max(Ext.pluck(h,"length")),g=[];for(var k=0;k0){for(var p=0;p0);if(!C){C=true;for(K=0;K=0){z=s.substr(0,y).toLowerCase();if(s.charAt(y+1)==" "){++y}A[z]=s.substr(y+1)}})}catch(x){}return{tId:q.tId,status:r?204:u.status,statusText:r?"No Content":u.statusText,getResponseHeader:function(s){return A[s.toLowerCase()]},getAllResponseHeaders:function(){return v},responseText:u.responseText,responseXML:u.responseXML,argument:w}}function n(q){if(q.tId){k.conn[q.tId]=null}q.conn=null;q=null}function f(v,w,r,q){if(!w){n(v);return}var t,s;try{if(v.conn.status!==undefined&&v.conn.status!=0){t=v.conn.status}else{t=13030}}catch(u){t=13030}if((t>=200&&t<300)||(Ext.isIE&&t==1223)){s=o(v,w.argument);if(w.success){if(!w.scope){w.success(s)}else{w.success.apply(w.scope,[s])}}}else{switch(t){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:s=e(v.tId,w.argument,(r?r:false),q);if(w.failure){if(!w.scope){w.failure(s)}else{w.failure.apply(w.scope,[s])}}break;default:s=o(v,w.argument);if(w.failure){if(!w.scope){w.failure(s)}else{w.failure.apply(w.scope,[s])}}}}n(v);s=null}function m(s,v){v=v||{};var q=s.conn,u=s.tId,r=k.poll,t=v.timeout||null;if(t){k.conn[u]=q;k.timeout[u]=setTimeout(function(){k.abort(s,v,true)},t)}r[u]=setInterval(function(){if(q&&q.readyState==4){clearInterval(r[u]);r[u]=null;if(t){clearTimeout(k.timeout[u]);k.timeout[u]=null}f(s,v)}},k.pollInterval)}function i(u,r,t,q){var s=l()||null;if(s){s.conn.open(u,r,true);if(k.useDefaultXhrHeader){j("X-Requested-With",k.defaultXhrHeader)}if(q&&k.useDefaultHeader&&(!k.headers||!k.headers[d])){j(d,k.defaultPostHeader)}if(k.defaultHeaders||k.headers){h(s)}m(s,t);s.conn.send(q||null)}return s}function l(){var r;try{if(r=p(k.transactionId)){k.transactionId++}}catch(q){}finally{return r}}function p(t){var q;try{q=new XMLHttpRequest()}catch(s){for(var r=0;r=d.left&&e.right<=d.right&&e.top>=d.top&&e.bottom<=d.bottom)},getArea:function(){var d=this;return((d.bottom-d.top)*(d.right-d.left))},intersect:function(i){var h=this,f=Math.max(h.top,i.top),g=Math.min(h.right,i.right),d=Math.min(h.bottom,i.bottom),e=Math.max(h.left,i.left);if(d>=f&&g>=e){return new Ext.lib.Region(f,g,d,e)}},union:function(i){var h=this,f=Math.min(h.top,i.top),g=Math.max(h.right,i.right),d=Math.max(h.bottom,i.bottom),e=Math.min(h.left,i.left);return new Ext.lib.Region(f,g,d,e)},constrainTo:function(e){var d=this;d.top=d.top.constrain(e.top,e.bottom);d.bottom=d.bottom.constrain(e.top,e.bottom);d.left=d.left.constrain(e.left,e.right);d.right=d.right.constrain(e.left,e.right);return d},adjust:function(f,e,d,h){var g=this;g.top+=f;g.left+=e;g.right+=h;g.bottom+=d;return g}};Ext.lib.Region.getRegion=function(g){var i=Ext.lib.Dom.getXY(g),f=i[1],h=i[0]+g.offsetWidth,d=i[1]+g.offsetHeight,e=i[0];return new Ext.lib.Region(f,h,d,e)};Ext.lib.Point=function(d,f){if(Ext.isArray(d)){f=d[1];d=d[0]}var e=this;e.x=e.right=e.left=e[0]=d;e.y=e.top=e.bottom=e[1]=f};Ext.lib.Point.prototype=new Ext.lib.Region();(function(){var g=Ext.lib,i=/width|height|opacity|padding/i,f=/^((width|height)|(top|left))$/,d=/width|height|top$|bottom$|left$|right$/i,h=/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i,j=function(k){return typeof k!=="undefined"},e=function(){return new Date()};g.Anim={motion:function(n,l,o,p,k,m){return this.run(n,l,o,p,k,m,Ext.lib.Motion)},run:function(o,l,q,r,k,n,m){m=m||Ext.lib.AnimBase;if(typeof r=="string"){r=Ext.lib.Easing[r]}var p=new m(o,l,q,r);p.animateX(function(){if(Ext.isFunction(k)){k.call(n)}});return p}};g.AnimBase=function(l,k,m,n){if(l){this.init(l,k,m,n)}};g.AnimBase.prototype={doMethod:function(k,n,l){var m=this;return m.method(m.curFrame,n,l-n,m.totalFrames)},setAttr:function(k,m,l){if(i.test(k)&&m<0){m=0}Ext.fly(this.el,"_anim").setStyle(k,m+l)},getAttr:function(k){var m=Ext.fly(this.el),n=m.getStyle(k),l=f.exec(k)||[];if(n!=="auto"&&!h.test(n)){return parseFloat(n)}return(!!(l[2])||(m.getStyle("position")=="absolute"&&!!(l[3])))?m.dom["offset"+l[0].charAt(0).toUpperCase()+l[0].substr(1)]:0},getDefaultUnit:function(k){return d.test(k)?"px":""},animateX:function(n,k){var l=this,m=function(){l.onComplete.removeListener(m);if(Ext.isFunction(n)){n.call(k||l,l)}};l.onComplete.addListener(m,l);l.animate()},setRunAttr:function(p){var r=this,s=this.attributes[p],t=s.to,q=s.by,u=s.from,v=s.unit,l=(this.runAttrs[p]={}),m;if(!j(t)&&!j(q)){return false}var k=j(u)?u:r.getAttr(p);if(j(t)){m=t}else{if(j(q)){if(Ext.isArray(k)){m=[];for(var n=0,o=k.length;n0&&isFinite(w)){if(r.curFrame+w>=v){w=v-(u+1)}r.curFrame+=w}}};g.Bezier=new function(){this.getPosition=function(p,o){var r=p.length,m=[],q=1-o,l,k;for(l=0;l0&&!Ext.isArray(t[0])){t=[t]}else{}Ext.fly(q,"_anim").position();B.setXY(q,j(y)?y:B.getXY(q));p=x.getAttr("points");if(j(z)){r=k.call(x,z,p);for(s=0,u=t.length;s0){o=o.concat(t)}o[o.length]=r}else{n.setRunAttr.call(this,v)}}});var k=function(o,q){var p=g.Dom.getXY(this.el);return[o[0]-p[0]+q[0],o[1]-p[1]+q[1]]}})()})();(function(){var d=Math.abs,i=Math.PI,h=Math.asin,g=Math.pow,e=Math.sin,f=Ext.lib;Ext.apply(f.Easing,{easeBoth:function(k,j,m,l){return((k/=l/2)<1)?m/2*k*k+j:-m/2*((--k)*(k-2)-1)+j},easeInStrong:function(k,j,m,l){return m*(k/=l)*k*k*k+j},easeOutStrong:function(k,j,m,l){return -m*((k=k/l-1)*k*k*k-1)+j},easeBothStrong:function(k,j,m,l){return((k/=l/2)<1)?m/2*k*k*k*k+j:-m/2*((k-=2)*k*k*k-2)+j},elasticIn:function(l,j,q,o,k,n){if(l==0||(l/=o)==1){return l==0?j:j+q}n=n||(o*0.3);var m;if(k>=d(q)){m=n/(2*i)*h(q/k)}else{k=q;m=n/4}return -(k*g(2,10*(l-=1))*e((l*o-m)*(2*i)/n))+j},elasticOut:function(l,j,q,o,k,n){if(l==0||(l/=o)==1){return l==0?j:j+q}n=n||(o*0.3);var m;if(k>=d(q)){m=n/(2*i)*h(q/k)}else{k=q;m=n/4}return k*g(2,-10*l)*e((l*o-m)*(2*i)/n)+q+j},elasticBoth:function(l,j,q,o,k,n){if(l==0||(l/=o/2)==2){return l==0?j:j+q}n=n||(o*(0.3*1.5));var m;if(k>=d(q)){m=n/(2*i)*h(q/k)}else{k=q;m=n/4}return l<1?-0.5*(k*g(2,10*(l-=1))*e((l*o-m)*(2*i)/n))+j:k*g(2,-10*(l-=1))*e((l*o-m)*(2*i)/n)*0.5+q+j},backIn:function(k,j,n,m,l){l=l||1.70158;return n*(k/=m)*k*((l+1)*k-l)+j},backOut:function(k,j,n,m,l){if(!l){l=1.70158}return n*((k=k/m-1)*k*((l+1)*k+l)+1)+j},backBoth:function(k,j,n,m,l){l=l||1.70158;return((k/=m/2)<1)?n/2*(k*k*(((l*=(1.525))+1)*k-l))+j:n/2*((k-=2)*k*(((l*=(1.525))+1)*k+l)+2)+j},bounceIn:function(k,j,m,l){return m-f.Easing.bounceOut(l-k,0,m,l)+j},bounceOut:function(k,j,m,l){if((k/=l)<(1/2.75)){return m*(7.5625*k*k)+j}else{if(k<(2/2.75)){return m*(7.5625*(k-=(1.5/2.75))*k+0.75)+j}else{if(k<(2.5/2.75)){return m*(7.5625*(k-=(2.25/2.75))*k+0.9375)+j}}}return m*(7.5625*(k-=(2.625/2.75))*k+0.984375)+j},bounceBoth:function(k,j,m,l){return(k + * * @param {Object} obj The list of behaviors to apply */ addBehaviors : function(o){ @@ -1148,7 +1152,7 @@ Ext.addBehaviors({ cache = null; } }, - + /** * Utility method for getting the width of the browser scrollbar. This can differ depending on * operating system settings, such as the theme or font size. @@ -1159,7 +1163,7 @@ Ext.addBehaviors({ if(!Ext.isReady){ return 0; } - + if(force === true || scrollWidth === null){ // Append our div, do our calculation and then remove it var div = Ext.getBody().createChild('
'), @@ -1201,7 +1205,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { this.initialBox = Ext.copyTo({}, this.initialConfig, 'x,y,width,height'); } }); - * + * * @param {Object} dest The destination object. * @param {Object} source The source object. * @param {Array/String} names Either an Array of property names, or a comma-delimited list @@ -1209,7 +1213,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { * @return {Object} The modified object. */ copyTo : function(dest, source, names){ - if(Ext.isString(names)){ + if(typeof names == 'string'){ names = names.split(/[,;\s]/); } Ext.each(names, function(name){ @@ -1235,11 +1239,11 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { if(arg){ if(Ext.isArray(arg)){ this.destroy.apply(this, arg); - }else if(Ext.isFunction(arg.destroy)){ + }else if(typeof arg.destroy == 'function'){ arg.destroy(); }else if(arg.dom){ arg.remove(); - } + } } }, this); }, @@ -1366,8 +1370,8 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { /** * Partitions the set into two sets: a true set and a false set. - * Example: - * Example2: + * Example: + * Example2: *

 // Example 1:
 Ext.partition([true, false, true, true, false]); // [[true, true, true], [false, false]]
@@ -1411,7 +1415,7 @@ Ext.invoke(Ext.query("p"), "getAttribute", "id");
             var ret = [],
                 args = Array.prototype.slice.call(arguments, 2);
             Ext.each(arr, function(v,i) {
-                if (v && Ext.isFunction(v[methodName])) {
+                if (v && typeof v[methodName] == 'function') {
                     ret.push(v[methodName].apply(v, args));
                 } else {
                     ret.push(undefined);
@@ -1458,7 +1462,7 @@ Ext.zip(
          * @return {Array} The zipped set.
          */
         zip : function(){
-            var parts = Ext.partition(arguments, function( val ){ return !Ext.isFunction(val); }),
+            var parts = Ext.partition(arguments, function( val ){ return typeof val != 'function'; }),
                 arrs = parts[0],
                 fn = parts[1][0],
                 len = Ext.max(Ext.pluck(arrs, "length")),
@@ -1535,7 +1539,7 @@ Ext.zip(
                     case RegExp: return 'regexp';
                     case Date: return 'date';
                 }
-                if(Ext.isNumber(o.length) && Ext.isFunction(o.item)) {
+                if(typeof o.length == 'number' && typeof o.item == 'function') {
                     return 'nodelist';
                 }
             }
@@ -1548,7 +1552,7 @@ Ext.zip(
 
         // internal
         callback : function(cb, scope, args, delay){
-            if(Ext.isFunction(cb)){
+            if(typeof cb == 'function'){
                 if(delay){
                     cb.defer(delay, scope, args || []);
                 }else{
@@ -1588,7 +1592,7 @@ sayGoodbye('Fred'); // both alerts show
      */
     createSequence : function(fcn, scope){
         var method = this;
-        return !Ext.isFunction(fcn) ?
+        return (typeof fcn != 'function') ?
                 this :
                 function(){
                     var retval = method.apply(this || window, arguments);
diff --git a/adapter/jquery/ext-jquery-adapter.js b/adapter/jquery/ext-jquery-adapter.js
index f6d1eba3..2fc0726d 100644
--- a/adapter/jquery/ext-jquery-adapter.js
+++ b/adapter/jquery/ext-jquery-adapter.js
@@ -1,7 +1,7 @@
 /*
- * Ext JS Library 3.2.0
+ * Ext JS Library 3.2.1
  * Copyright(c) 2006-2010 Ext JS, Inc.
  * licensing@extjs.com
  * http://www.extjs.com/license
  */
-window.undefined=window.undefined;Ext={version:"3.2.0"};Ext.apply=function(d,e,b){if(b){Ext.apply(d,b)}if(d&&e&&typeof e=="object"){for(var a in e){d[a]=e[a]}}return d};(function(){var g=0,s=Object.prototype.toString,t=navigator.userAgent.toLowerCase(),y=function(e){return e.test(t)},i=document,l=i.compatMode=="CSS1Compat",A=y(/opera/),h=y(/\bchrome\b/),u=y(/webkit/),x=!h&&y(/safari/),f=x&&y(/applewebkit\/4/),b=x&&y(/version\/3/),B=x&&y(/version\/4/),r=!A&&y(/msie/),p=r&&y(/msie 7/),o=r&&y(/msie 8/),q=r&&!p&&!o,n=!u&&y(/gecko/),d=n&&y(/rv:1\.8/),a=n&&y(/rv:1\.9/),v=r&&!l,z=y(/windows|win32/),k=y(/macintosh|mac os x/),j=y(/adobeair/),m=y(/linux/),c=/^https/i.test(window.location.protocol);if(q){try{i.execCommand("BackgroundImageCache",false,true)}catch(w){}}Ext.apply(Ext,{SSL_SECURE_URL:c&&r?'javascript:""':"about:blank",isStrict:l,isSecure:c,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,enableNestedListenerRemoval:false,USE_NATIVE_JSON:false,applyIf:function(C,D){if(C){for(var e in D){if(!Ext.isDefined(C[e])){C[e]=D[e]}}}return C},id:function(e,C){e=Ext.getDom(e,true)||{};if(!e.id){e.id=(C||"ext-gen")+(++g)}return e.id},extend:function(){var C=function(E){for(var D in E){this[D]=E[D]}};var e=Object.prototype.constructor;return function(J,G,I){if(Ext.isObject(G)){I=G;G=J;J=I.constructor!=e?I.constructor:function(){G.apply(this,arguments)}}var E=function(){},H,D=G.prototype;E.prototype=D;H=J.prototype=new E();H.constructor=J;J.superclass=D;if(D.constructor==e){D.constructor=G}J.override=function(F){Ext.override(J,F)};H.superclass=H.supr=(function(){return D});H.override=C;Ext.override(J,I);J.extend=function(F){return Ext.extend(J,F)};return J}}(),override:function(e,D){if(D){var C=e.prototype;Ext.apply(C,D);if(Ext.isIE&&D.hasOwnProperty("toString")){C.toString=D.toString}}},namespace:function(){var C,e;Ext.each(arguments,function(D){e=D.split(".");C=window[e[0]]=window[e[0]]||{};Ext.each(e.slice(1),function(E){C=C[E]=C[E]||{}})});return C},urlEncode:function(G,F){var D,C=[],E=encodeURIComponent;Ext.iterate(G,function(e,H){D=Ext.isEmpty(H);Ext.each(D?e:H,function(I){C.push("&",E(e),"=",(!Ext.isEmpty(I)&&(I!=e||!D))?(Ext.isDate(I)?Ext.encode(I).replace(/"/g,""):E(I)):"")})});if(!F){C.shift();F=""}return F+C.join("")},urlDecode:function(D,C){if(Ext.isEmpty(D)){return{}}var G={},F=D.split("&"),H=decodeURIComponent,e,E;Ext.each(F,function(I){I=I.split("=");e=H(I[0]);E=H(I[1]);G[e]=C||!G[e]?E:[].concat(G[e]).concat(E)});return G},urlAppend:function(e,C){if(!Ext.isEmpty(C)){return e+(e.indexOf("?")===-1?"?":"&")+C}return e},toArray:function(){return r?function(D,G,E,F){F=[];for(var C=0,e=D.length;C0){return setTimeout(d,c)}d();return 0}});Ext.applyIf(String,{format:function(b){var a=Ext.toArray(arguments,1);return b.replace(/\{(\d+)\}/g,function(c,d){return a[d]})}});Ext.applyIf(Array.prototype,{indexOf:function(b,c){var a=this.length;c=c||0;c+=(c<0)?a:0;for(;c
'),g=h.child("div",true);var e=g.offsetWidth;h.setStyle("overflow",(Ext.isWebKit||Ext.isGecko)?"auto":"scroll");var d=g.offsetWidth;h.remove();b=e-d+2}return b},combine:function(){var f=arguments,e=f.length,h=[];for(var g=0;gg?1:-1};Ext.each(d,function(g){f=e(f,g)==1?f:g});return f},mean:function(d){return d.length>0?Ext.sum(d)/d.length:undefined},sum:function(d){var e=0;Ext.each(d,function(f){e+=f});return e},partition:function(d,e){var f=[[],[]];Ext.each(d,function(h,j,g){f[(e&&e(h,j,g))||(!e&&h)?0:1].push(h)});return f},invoke:function(d,e){var g=[],f=Array.prototype.slice.call(arguments,2);Ext.each(d,function(h,j){if(h&&Ext.isFunction(h[e])){g.push(h[e].apply(h,f))}else{g.push(undefined)}});return g},pluck:function(d,f){var e=[];Ext.each(d,function(g){e.push(g[f])});return e},zip:function(){var m=Ext.partition(arguments,function(i){return !Ext.isFunction(i)}),h=m[0],l=m[1][0],d=Ext.max(Ext.pluck(h,"length")),g=[];for(var k=0;k0){for(var p=0;p10000){clearInterval(h)}var f=document.getElementById(j);if(f){clearInterval(h);e.call(d||window,f)}};var h=setInterval(g,50)},resolveTextNode:Ext.isGecko?function(e){if(!e){return}var d=HTMLElement.prototype.toString.call(e);if(d=="[xpconnect wrapped native prototype]"||d=="[object XULElement]"){return}return e.nodeType==3?e.parentNode:e}:function(d){return d&&d.nodeType==3?d.parentNode:d},getRelatedTarget:function(e){e=e.browserEvent||e;var d=e.relatedTarget;if(!d){if(e.type=="mouseout"){d=e.toElement}else{if(e.type=="mouseover"){d=e.fromElement}}}return this.resolveTextNode(d)}};Ext.lib.Ajax=function(){var d=function(f){return function(h,g){if((g=="error"||g=="timeout")&&f.failure){f.failure.call(f.scope||window,e(f,h))}else{if(f.success){f.success.call(f.scope||window,e(f,h))}}}};var e=function(f,l){var h={},j,g,i;try{j=l.getAllResponseHeaders();Ext.each(j.replace(/\r\n/g,"\n").split("\n"),function(m){g=m.indexOf(":");if(g>=0){i=m.substr(0,g).toLowerCase();if(m.charAt(g+1)==" "){++g}h[i]=m.substr(g+1)}})}catch(k){}return{responseText:l.responseText,responseXML:l.responseXML,argument:f.argument,status:l.status,statusText:l.statusText,getResponseHeader:function(m){return h[m.toLowerCase()]},getAllResponseHeaders:function(){return j}}};return{request:function(l,i,f,j,g){var k={type:l,url:i,data:j,timeout:f.timeout,complete:d(f)};if(g){var h=g.headers;if(g.xmlData){k.data=g.xmlData;k.processData=false;k.type=(l?l:(g.method?g.method:"POST"));if(!h||!h["Content-Type"]){k.contentType="text/xml"}}else{if(g.jsonData){k.data=typeof g.jsonData=="object"?Ext.encode(g.jsonData):g.jsonData;k.processData=false;k.type=(l?l:(g.method?g.method:"POST"));if(!h||!h["Content-Type"]){k.contentType="application/json"}}}if(h){k.beforeSend=function(n){for(var m in h){if(h.hasOwnProperty(m)){n.setRequestHeader(m,h[m])}}}}}jQuery.ajax(k)},formRequest:function(j,i,g,k,f,h){jQuery.ajax({type:Ext.getDom(j).method||"POST",url:i,data:jQuery(j).serialize()+(k?"&"+k:""),timeout:g.timeout,complete:d(g)})},isCallInProgress:function(f){return false},abort:function(f){return false},serializeForm:function(f){return jQuery(f.dom||f).serialize()}}}();Ext.lib.Anim=function(){var d=function(e,f){var g=true;return{stop:function(h){},isAnimated:function(){return g},proxyCallback:function(){g=false;Ext.callback(e,f)}}};return{scroll:function(h,f,j,k,e,g){var i=d(e,g);h=Ext.getDom(h);if(typeof f.scroll.to[0]=="number"){h.scrollLeft=f.scroll.to[0]}if(typeof f.scroll.to[1]=="number"){h.scrollTop=f.scroll.to[1]}i.proxyCallback();return i},motion:function(h,f,i,j,e,g){return this.run(h,f,i,j,e,g)},color:function(h,f,j,k,e,g){var i=d(e,g);i.proxyCallback();return i},run:function(g,q,j,p,h,s,r){var l=d(h,s),m=Ext.fly(g,"_animrun");var f={};for(var i in q){switch(i){case"points":var n,u;m.position();if(n=q.points.by){var t=m.getXY();u=m.translatePoints([t[0]+n[0],t[1]+n[1]])}else{u=m.translatePoints(q.points.to)}f.left=u.left;f.top=u.top;if(!parseInt(m.getStyle("left"),10)){m.setLeft(0)}if(!parseInt(m.getStyle("top"),10)){m.setTop(0)}if(q.points.from){m.setXY(q.points.from)}break;case"width":f.width=q.width.to;if(q.width.from){m.setWidth(q.width.from)}break;case"height":f.height=q.height.to;if(q.height.from){m.setHeight(q.height.from)}break;case"opacity":f.opacity=q.opacity.to;if(q.opacity.from){m.setOpacity(q.opacity.from)}break;case"left":f.left=q.left.to;if(q.left.from){m.setLeft(q.left.from)}break;case"top":f.top=q.top.to;if(q.top.from){m.setTop(q.top.from)}break;case"callback":case"scope":case"xy":break;default:f[i]=q[i].to;if(q[i].from){m.setStyle(i,q[i].from)}break}}jQuery(g).animate(f,j*1000,undefined,l.proxyCallback);return l}}}();Ext.lib.Region=function(f,g,d,e){this.top=f;this[1]=f;this.right=g;this.bottom=d;this.left=e;this[0]=e};Ext.lib.Region.prototype={contains:function(d){return(d.left>=this.left&&d.right<=this.right&&d.top>=this.top&&d.bottom<=this.bottom)},getArea:function(){return((this.bottom-this.top)*(this.right-this.left))},intersect:function(h){var f=Math.max(this.top,h.top);var g=Math.min(this.right,h.right);var d=Math.min(this.bottom,h.bottom);var e=Math.max(this.left,h.left);if(d>=f&&g>=e){return new Ext.lib.Region(f,g,d,e)}else{return null}},union:function(h){var f=Math.min(this.top,h.top);var g=Math.max(this.right,h.right);var d=Math.max(this.bottom,h.bottom);var e=Math.min(this.left,h.left);return new Ext.lib.Region(f,g,d,e)},constrainTo:function(d){this.top=this.top.constrain(d.top,d.bottom);this.bottom=this.bottom.constrain(d.top,d.bottom);this.left=this.left.constrain(d.left,d.right);this.right=this.right.constrain(d.left,d.right);return this},adjust:function(f,e,d,g){this.top+=f;this.left+=e;this.right+=g;this.bottom+=d;return this}};Ext.lib.Region.getRegion=function(g){var i=Ext.lib.Dom.getXY(g);var f=i[1];var h=i[0]+g.offsetWidth;var d=i[1]+g.offsetHeight;var e=i[0];return new Ext.lib.Region(f,h,d,e)};Ext.lib.Point=function(d,e){if(Ext.isArray(d)){e=d[1];d=d[0]}this.x=this.right=this.left=this[0]=d;this.y=this.top=this.bottom=this[1]=e};Ext.lib.Point.prototype=new Ext.lib.Region();if(Ext.isIE){function a(){var d=Function.prototype;delete d.createSequence;delete d.defer;delete d.createDelegate;delete d.createCallback;delete d.createInterceptor;window.detachEvent("onunload",a)}window.attachEvent("onunload",a)}})(); \ No newline at end of file +window.undefined=window.undefined;Ext={version:"3.2.1",versionDetail:{major:3,minor:2,patch:1}};Ext.apply=function(d,e,b){if(b){Ext.apply(d,b)}if(d&&e&&typeof e=="object"){for(var a in e){d[a]=e[a]}}return d};(function(){var g=0,s=Object.prototype.toString,t=navigator.userAgent.toLowerCase(),y=function(e){return e.test(t)},i=document,l=i.compatMode=="CSS1Compat",A=y(/opera/),h=y(/\bchrome\b/),u=y(/webkit/),x=!h&&y(/safari/),f=x&&y(/applewebkit\/4/),b=x&&y(/version\/3/),B=x&&y(/version\/4/),r=!A&&y(/msie/),p=r&&y(/msie 7/),o=r&&y(/msie 8/),q=r&&!p&&!o,n=!u&&y(/gecko/),d=n&&y(/rv:1\.8/),a=n&&y(/rv:1\.9/),v=r&&!l,z=y(/windows|win32/),k=y(/macintosh|mac os x/),j=y(/adobeair/),m=y(/linux/),c=/^https/i.test(window.location.protocol);if(q){try{i.execCommand("BackgroundImageCache",false,true)}catch(w){}}Ext.apply(Ext,{SSL_SECURE_URL:c&&r?'javascript:""':"about:blank",isStrict:l,isSecure:c,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,enableNestedListenerRemoval:false,USE_NATIVE_JSON:false,applyIf:function(C,D){if(C){for(var e in D){if(!Ext.isDefined(C[e])){C[e]=D[e]}}}return C},id:function(e,C){e=Ext.getDom(e,true)||{};if(!e.id){e.id=(C||"ext-gen")+(++g)}return e.id},extend:function(){var C=function(E){for(var D in E){this[D]=E[D]}};var e=Object.prototype.constructor;return function(J,G,I){if(typeof G=="object"){I=G;G=J;J=I.constructor!=e?I.constructor:function(){G.apply(this,arguments)}}var E=function(){},H,D=G.prototype;E.prototype=D;H=J.prototype=new E();H.constructor=J;J.superclass=D;if(D.constructor==e){D.constructor=G}J.override=function(F){Ext.override(J,F)};H.superclass=H.supr=(function(){return D});H.override=C;Ext.override(J,I);J.extend=function(F){return Ext.extend(J,F)};return J}}(),override:function(e,D){if(D){var C=e.prototype;Ext.apply(C,D);if(Ext.isIE&&D.hasOwnProperty("toString")){C.toString=D.toString}}},namespace:function(){var C,e;Ext.each(arguments,function(D){e=D.split(".");C=window[e[0]]=window[e[0]]||{};Ext.each(e.slice(1),function(E){C=C[E]=C[E]||{}})});return C},urlEncode:function(G,F){var D,C=[],E=encodeURIComponent;Ext.iterate(G,function(e,H){D=Ext.isEmpty(H);Ext.each(D?e:H,function(I){C.push("&",E(e),"=",(!Ext.isEmpty(I)&&(I!=e||!D))?(Ext.isDate(I)?Ext.encode(I).replace(/"/g,""):E(I)):"")})});if(!F){C.shift();F=""}return F+C.join("")},urlDecode:function(D,C){if(Ext.isEmpty(D)){return{}}var G={},F=D.split("&"),H=decodeURIComponent,e,E;Ext.each(F,function(I){I=I.split("=");e=H(I[0]);E=H(I[1]);G[e]=C||!G[e]?E:[].concat(G[e]).concat(E)});return G},urlAppend:function(e,C){if(!Ext.isEmpty(C)){return e+(e.indexOf("?")===-1?"?":"&")+C}return e},toArray:function(){return r?function(D,G,E,F){F=[];for(var C=0,e=D.length;C0){return setTimeout(d,c)}d();return 0}});Ext.applyIf(String,{format:function(b){var a=Ext.toArray(arguments,1);return b.replace(/\{(\d+)\}/g,function(c,d){return a[d]})}});Ext.applyIf(Array.prototype,{indexOf:function(b,c){var a=this.length;c=c||0;c+=(c<0)?a:0;for(;c
'),g=h.child("div",true);var e=g.offsetWidth;h.setStyle("overflow",(Ext.isWebKit||Ext.isGecko)?"auto":"scroll");var d=g.offsetWidth;h.remove();b=e-d+2}return b},combine:function(){var f=arguments,e=f.length,h=[];for(var g=0;gg?1:-1};Ext.each(d,function(g){f=e(f,g)==1?f:g});return f},mean:function(d){return d.length>0?Ext.sum(d)/d.length:undefined},sum:function(d){var e=0;Ext.each(d,function(f){e+=f});return e},partition:function(d,e){var f=[[],[]];Ext.each(d,function(h,j,g){f[(e&&e(h,j,g))||(!e&&h)?0:1].push(h)});return f},invoke:function(d,e){var g=[],f=Array.prototype.slice.call(arguments,2);Ext.each(d,function(h,j){if(h&&typeof h[e]=="function"){g.push(h[e].apply(h,f))}else{g.push(undefined)}});return g},pluck:function(d,f){var e=[];Ext.each(d,function(g){e.push(g[f])});return e},zip:function(){var m=Ext.partition(arguments,function(i){return typeof i!="function"}),h=m[0],l=m[1][0],d=Ext.max(Ext.pluck(h,"length")),g=[];for(var k=0;k0){for(var p=0;p10000){clearInterval(h)}var f=document.getElementById(j);if(f){clearInterval(h);e.call(d||window,f)}};var h=setInterval(g,50)},resolveTextNode:Ext.isGecko?function(e){if(!e){return}var d=HTMLElement.prototype.toString.call(e);if(d=="[xpconnect wrapped native prototype]"||d=="[object XULElement]"){return}return e.nodeType==3?e.parentNode:e}:function(d){return d&&d.nodeType==3?d.parentNode:d},getRelatedTarget:function(e){e=e.browserEvent||e;var d=e.relatedTarget;if(!d){if(e.type=="mouseout"){d=e.toElement}else{if(e.type=="mouseover"){d=e.fromElement}}}return this.resolveTextNode(d)}};Ext.lib.Ajax=function(){var d=function(f){return function(h,g){if((g=="error"||g=="timeout")&&f.failure){f.failure.call(f.scope||window,e(f,h))}else{if(f.success){f.success.call(f.scope||window,e(f,h))}}}};var e=function(f,l){var h={},j,g,i;try{j=l.getAllResponseHeaders();Ext.each(j.replace(/\r\n/g,"\n").split("\n"),function(m){g=m.indexOf(":");if(g>=0){i=m.substr(0,g).toLowerCase();if(m.charAt(g+1)==" "){++g}h[i]=m.substr(g+1)}})}catch(k){}return{responseText:l.responseText,responseXML:l.responseXML,argument:f.argument,status:l.status,statusText:l.statusText,getResponseHeader:function(m){return h[m.toLowerCase()]},getAllResponseHeaders:function(){return j}}};return{request:function(l,i,f,j,g){var k={type:l,url:i,data:j,timeout:f.timeout,complete:d(f)};if(g){var h=g.headers;if(g.xmlData){k.data=g.xmlData;k.processData=false;k.type=(l?l:(g.method?g.method:"POST"));if(!h||!h["Content-Type"]){k.contentType="text/xml"}}else{if(g.jsonData){k.data=typeof g.jsonData=="object"?Ext.encode(g.jsonData):g.jsonData;k.processData=false;k.type=(l?l:(g.method?g.method:"POST"));if(!h||!h["Content-Type"]){k.contentType="application/json"}}}if(h){k.beforeSend=function(n){for(var m in h){if(h.hasOwnProperty(m)){n.setRequestHeader(m,h[m])}}}}}jQuery.ajax(k)},formRequest:function(j,i,g,k,f,h){jQuery.ajax({type:Ext.getDom(j).method||"POST",url:i,data:jQuery(j).serialize()+(k?"&"+k:""),timeout:g.timeout,complete:d(g)})},isCallInProgress:function(f){return false},abort:function(f){return false},serializeForm:function(f){return jQuery(f.dom||f).serialize()}}}();Ext.lib.Anim=function(){var d=function(e,f){var g=true;return{stop:function(h){},isAnimated:function(){return g},proxyCallback:function(){g=false;Ext.callback(e,f)}}};return{scroll:function(h,f,j,k,e,g){var i=d(e,g);h=Ext.getDom(h);if(typeof f.scroll.to[0]=="number"){h.scrollLeft=f.scroll.to[0]}if(typeof f.scroll.to[1]=="number"){h.scrollTop=f.scroll.to[1]}i.proxyCallback();return i},motion:function(h,f,i,j,e,g){return this.run(h,f,i,j,e,g)},color:function(h,f,j,k,e,g){var i=d(e,g);i.proxyCallback();return i},run:function(g,q,j,p,h,s,r){var l=d(h,s),m=Ext.fly(g,"_animrun");var f={};for(var i in q){switch(i){case"points":var n,u;m.position();if(n=q.points.by){var t=m.getXY();u=m.translatePoints([t[0]+n[0],t[1]+n[1]])}else{u=m.translatePoints(q.points.to)}f.left=u.left;f.top=u.top;if(!parseInt(m.getStyle("left"),10)){m.setLeft(0)}if(!parseInt(m.getStyle("top"),10)){m.setTop(0)}if(q.points.from){m.setXY(q.points.from)}break;case"width":f.width=q.width.to;if(q.width.from){m.setWidth(q.width.from)}break;case"height":f.height=q.height.to;if(q.height.from){m.setHeight(q.height.from)}break;case"opacity":f.opacity=q.opacity.to;if(q.opacity.from){m.setOpacity(q.opacity.from)}break;case"left":f.left=q.left.to;if(q.left.from){m.setLeft(q.left.from)}break;case"top":f.top=q.top.to;if(q.top.from){m.setTop(q.top.from)}break;case"callback":case"scope":case"xy":break;default:f[i]=q[i].to;if(q[i].from){m.setStyle(i,q[i].from)}break}}jQuery(g).animate(f,j*1000,undefined,l.proxyCallback);return l}}}();Ext.lib.Region=function(f,g,d,e){this.top=f;this[1]=f;this.right=g;this.bottom=d;this.left=e;this[0]=e};Ext.lib.Region.prototype={contains:function(d){return(d.left>=this.left&&d.right<=this.right&&d.top>=this.top&&d.bottom<=this.bottom)},getArea:function(){return((this.bottom-this.top)*(this.right-this.left))},intersect:function(h){var f=Math.max(this.top,h.top);var g=Math.min(this.right,h.right);var d=Math.min(this.bottom,h.bottom);var e=Math.max(this.left,h.left);if(d>=f&&g>=e){return new Ext.lib.Region(f,g,d,e)}else{return null}},union:function(h){var f=Math.min(this.top,h.top);var g=Math.max(this.right,h.right);var d=Math.max(this.bottom,h.bottom);var e=Math.min(this.left,h.left);return new Ext.lib.Region(f,g,d,e)},constrainTo:function(d){this.top=this.top.constrain(d.top,d.bottom);this.bottom=this.bottom.constrain(d.top,d.bottom);this.left=this.left.constrain(d.left,d.right);this.right=this.right.constrain(d.left,d.right);return this},adjust:function(f,e,d,g){this.top+=f;this.left+=e;this.right+=g;this.bottom+=d;return this}};Ext.lib.Region.getRegion=function(g){var i=Ext.lib.Dom.getXY(g);var f=i[1];var h=i[0]+g.offsetWidth;var d=i[1]+g.offsetHeight;var e=i[0];return new Ext.lib.Region(f,h,d,e)};Ext.lib.Point=function(d,e){if(Ext.isArray(d)){e=d[1];d=d[0]}this.x=this.right=this.left=this[0]=d;this.y=this.top=this.bottom=this[1]=e};Ext.lib.Point.prototype=new Ext.lib.Region();if(Ext.isIE){function a(){var d=Function.prototype;delete d.createSequence;delete d.defer;delete d.createDelegate;delete d.createCallback;delete d.createInterceptor;window.detachEvent("onunload",a)}window.attachEvent("onunload",a)}})(); \ No newline at end of file diff --git a/adapter/prototype/ext-prototype-adapter-debug.js b/adapter/prototype/ext-prototype-adapter-debug.js index aa1a11a9..f16253b3 100644 --- a/adapter/prototype/ext-prototype-adapter-debug.js +++ b/adapter/prototype/ext-prototype-adapter-debug.js @@ -1,10 +1,9 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ - // for old browsers window.undefined = window.undefined; @@ -19,7 +18,12 @@ Ext = { * The version of the framework * @type String */ - version : '3.2.0' + version : '3.2.1', + versionDetail : { + major: 3, + minor: 2, + patch: 1 + } }; /** @@ -227,7 +231,7 @@ MyGridPanel = Ext.extend(Ext.grid.GridPanel, { var oc = Object.prototype.constructor; return function(sb, sp, overrides){ - if(Ext.isObject(sp)){ + if(typeof sp == 'object'){ overrides = sp; sp = sb; sb = overrides.constructor != oc ? overrides.constructor : function(){sp.apply(this, arguments);}; @@ -475,7 +479,7 @@ Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {foo: "1", bar: ["2" if(Ext.isIterable(obj)){ Ext.each(obj, fn, scope); return; - }else if(Ext.isObject(obj)){ + }else if(typeof obj == 'object'){ for(var prop in obj){ if(obj.hasOwnProperty(prop)){ if(fn.call(scope || obj, prop, obj[prop], obj) === false){ @@ -516,7 +520,7 @@ function(el){ if (el.dom){ return el.dom; } else { - if (Ext.isString(el)) { + if (typeof el == 'string') { var e = DOC.getElementById(el); // IE returns elements with the 'name' and 'id' attribute. // we do a strict check to return the element with only the id attribute @@ -1033,7 +1037,7 @@ Ext.ns("Ext.grid", "Ext.list", "Ext.dd", "Ext.tree", "Ext.form", "Ext.menu", */ Ext.apply(Ext, function(){ - var E = Ext, + var E = Ext, idSeed = 0, scrollWidth = null; @@ -1046,13 +1050,13 @@ Ext.apply(Ext, function(){ emptyFn : function(){}, /** - * URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images. + * URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images. * In older versions of IE, this defaults to "http://extjs.com/s.gif" and you should change this to a URL on your server. * For other browsers it uses an inline data URL. * @type String */ BLANK_IMAGE_URL : Ext.isIE6 || Ext.isIE7 || Ext.isAir ? - 'http:/' + '/extjs.com/s.gif' : + 'http:/' + '/www.extjs.com/s.gif' : 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', extendX : function(supr, fn){ @@ -1074,7 +1078,7 @@ Ext.apply(Ext, function(){ * @return {Number} Value, if numeric, else defaultValue */ num : function(v, defaultValue){ - v = Number(Ext.isEmpty(v) || Ext.isArray(v) || Ext.isBoolean(v) || (Ext.isString(v) && v.trim().length == 0) ? NaN : v); + v = Number(Ext.isEmpty(v) || Ext.isArray(v) || typeof v == 'boolean' || (typeof v == 'string' && v.trim().length == 0) ? NaN : v); return isNaN(v) ? defaultValue : v; }, @@ -1117,13 +1121,13 @@ Ext.addBehaviors({ '#foo a@click' : function(e, t){ // do something }, - + // add the same listener to multiple selectors (separated by comma BEFORE the @) '#foo a, #bar span.some-class@mouseover' : function(){ // do something } }); - *
+ * * @param {Object} obj The list of behaviors to apply */ addBehaviors : function(o){ @@ -1148,7 +1152,7 @@ Ext.addBehaviors({ cache = null; } }, - + /** * Utility method for getting the width of the browser scrollbar. This can differ depending on * operating system settings, such as the theme or font size. @@ -1159,7 +1163,7 @@ Ext.addBehaviors({ if(!Ext.isReady){ return 0; } - + if(force === true || scrollWidth === null){ // Append our div, do our calculation and then remove it var div = Ext.getBody().createChild('
'), @@ -1201,7 +1205,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { this.initialBox = Ext.copyTo({}, this.initialConfig, 'x,y,width,height'); } }); - * + * * @param {Object} dest The destination object. * @param {Object} source The source object. * @param {Array/String} names Either an Array of property names, or a comma-delimited list @@ -1209,7 +1213,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { * @return {Object} The modified object. */ copyTo : function(dest, source, names){ - if(Ext.isString(names)){ + if(typeof names == 'string'){ names = names.split(/[,;\s]/); } Ext.each(names, function(name){ @@ -1235,11 +1239,11 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { if(arg){ if(Ext.isArray(arg)){ this.destroy.apply(this, arg); - }else if(Ext.isFunction(arg.destroy)){ + }else if(typeof arg.destroy == 'function'){ arg.destroy(); }else if(arg.dom){ arg.remove(); - } + } } }, this); }, @@ -1366,8 +1370,8 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { /** * Partitions the set into two sets: a true set and a false set. - * Example: - * Example2: + * Example: + * Example2: *

 // Example 1:
 Ext.partition([true, false, true, true, false]); // [[true, true, true], [false, false]]
@@ -1411,7 +1415,7 @@ Ext.invoke(Ext.query("p"), "getAttribute", "id");
             var ret = [],
                 args = Array.prototype.slice.call(arguments, 2);
             Ext.each(arr, function(v,i) {
-                if (v && Ext.isFunction(v[methodName])) {
+                if (v && typeof v[methodName] == 'function') {
                     ret.push(v[methodName].apply(v, args));
                 } else {
                     ret.push(undefined);
@@ -1458,7 +1462,7 @@ Ext.zip(
          * @return {Array} The zipped set.
          */
         zip : function(){
-            var parts = Ext.partition(arguments, function( val ){ return !Ext.isFunction(val); }),
+            var parts = Ext.partition(arguments, function( val ){ return typeof val != 'function'; }),
                 arrs = parts[0],
                 fn = parts[1][0],
                 len = Ext.max(Ext.pluck(arrs, "length")),
@@ -1535,7 +1539,7 @@ Ext.zip(
                     case RegExp: return 'regexp';
                     case Date: return 'date';
                 }
-                if(Ext.isNumber(o.length) && Ext.isFunction(o.item)) {
+                if(typeof o.length == 'number' && typeof o.item == 'function') {
                     return 'nodelist';
                 }
             }
@@ -1548,7 +1552,7 @@ Ext.zip(
 
         // internal
         callback : function(cb, scope, args, delay){
-            if(Ext.isFunction(cb)){
+            if(typeof cb == 'function'){
                 if(delay){
                     cb.defer(delay, scope, args || []);
                 }else{
@@ -1588,7 +1592,7 @@ sayGoodbye('Fred'); // both alerts show
      */
     createSequence : function(fcn, scope){
         var method = this;
-        return !Ext.isFunction(fcn) ?
+        return (typeof fcn != 'function') ?
                 this :
                 function(){
                     var retval = method.apply(this || window, arguments);
diff --git a/adapter/prototype/ext-prototype-adapter.js b/adapter/prototype/ext-prototype-adapter.js
index 2377ffe3..923d1e2d 100644
--- a/adapter/prototype/ext-prototype-adapter.js
+++ b/adapter/prototype/ext-prototype-adapter.js
@@ -1,7 +1,7 @@
 /*
- * Ext JS Library 3.2.0
+ * Ext JS Library 3.2.1
  * Copyright(c) 2006-2010 Ext JS, Inc.
  * licensing@extjs.com
  * http://www.extjs.com/license
  */
-window.undefined=window.undefined;Ext={version:"3.2.0"};Ext.apply=function(d,e,b){if(b){Ext.apply(d,b)}if(d&&e&&typeof e=="object"){for(var a in e){d[a]=e[a]}}return d};(function(){var g=0,s=Object.prototype.toString,t=navigator.userAgent.toLowerCase(),y=function(e){return e.test(t)},i=document,l=i.compatMode=="CSS1Compat",A=y(/opera/),h=y(/\bchrome\b/),u=y(/webkit/),x=!h&&y(/safari/),f=x&&y(/applewebkit\/4/),b=x&&y(/version\/3/),B=x&&y(/version\/4/),r=!A&&y(/msie/),p=r&&y(/msie 7/),o=r&&y(/msie 8/),q=r&&!p&&!o,n=!u&&y(/gecko/),d=n&&y(/rv:1\.8/),a=n&&y(/rv:1\.9/),v=r&&!l,z=y(/windows|win32/),k=y(/macintosh|mac os x/),j=y(/adobeair/),m=y(/linux/),c=/^https/i.test(window.location.protocol);if(q){try{i.execCommand("BackgroundImageCache",false,true)}catch(w){}}Ext.apply(Ext,{SSL_SECURE_URL:c&&r?'javascript:""':"about:blank",isStrict:l,isSecure:c,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,enableNestedListenerRemoval:false,USE_NATIVE_JSON:false,applyIf:function(C,D){if(C){for(var e in D){if(!Ext.isDefined(C[e])){C[e]=D[e]}}}return C},id:function(e,C){e=Ext.getDom(e,true)||{};if(!e.id){e.id=(C||"ext-gen")+(++g)}return e.id},extend:function(){var C=function(E){for(var D in E){this[D]=E[D]}};var e=Object.prototype.constructor;return function(J,G,I){if(Ext.isObject(G)){I=G;G=J;J=I.constructor!=e?I.constructor:function(){G.apply(this,arguments)}}var E=function(){},H,D=G.prototype;E.prototype=D;H=J.prototype=new E();H.constructor=J;J.superclass=D;if(D.constructor==e){D.constructor=G}J.override=function(F){Ext.override(J,F)};H.superclass=H.supr=(function(){return D});H.override=C;Ext.override(J,I);J.extend=function(F){return Ext.extend(J,F)};return J}}(),override:function(e,D){if(D){var C=e.prototype;Ext.apply(C,D);if(Ext.isIE&&D.hasOwnProperty("toString")){C.toString=D.toString}}},namespace:function(){var C,e;Ext.each(arguments,function(D){e=D.split(".");C=window[e[0]]=window[e[0]]||{};Ext.each(e.slice(1),function(E){C=C[E]=C[E]||{}})});return C},urlEncode:function(G,F){var D,C=[],E=encodeURIComponent;Ext.iterate(G,function(e,H){D=Ext.isEmpty(H);Ext.each(D?e:H,function(I){C.push("&",E(e),"=",(!Ext.isEmpty(I)&&(I!=e||!D))?(Ext.isDate(I)?Ext.encode(I).replace(/"/g,""):E(I)):"")})});if(!F){C.shift();F=""}return F+C.join("")},urlDecode:function(D,C){if(Ext.isEmpty(D)){return{}}var G={},F=D.split("&"),H=decodeURIComponent,e,E;Ext.each(F,function(I){I=I.split("=");e=H(I[0]);E=H(I[1]);G[e]=C||!G[e]?E:[].concat(G[e]).concat(E)});return G},urlAppend:function(e,C){if(!Ext.isEmpty(C)){return e+(e.indexOf("?")===-1?"?":"&")+C}return e},toArray:function(){return r?function(D,G,E,F){F=[];for(var C=0,e=D.length;C0){return setTimeout(d,c)}d();return 0}});Ext.applyIf(String,{format:function(b){var a=Ext.toArray(arguments,1);return b.replace(/\{(\d+)\}/g,function(c,d){return a[d]})}});Ext.applyIf(Array.prototype,{indexOf:function(b,c){var a=this.length;c=c||0;c+=(c<0)?a:0;for(;c
'),g=h.child("div",true);var e=g.offsetWidth;h.setStyle("overflow",(Ext.isWebKit||Ext.isGecko)?"auto":"scroll");var d=g.offsetWidth;h.remove();b=e-d+2}return b},combine:function(){var f=arguments,e=f.length,h=[];for(var g=0;gg?1:-1};Ext.each(d,function(g){f=e(f,g)==1?f:g});return f},mean:function(d){return d.length>0?Ext.sum(d)/d.length:undefined},sum:function(d){var e=0;Ext.each(d,function(f){e+=f});return e},partition:function(d,e){var f=[[],[]];Ext.each(d,function(h,j,g){f[(e&&e(h,j,g))||(!e&&h)?0:1].push(h)});return f},invoke:function(d,e){var g=[],f=Array.prototype.slice.call(arguments,2);Ext.each(d,function(h,j){if(h&&Ext.isFunction(h[e])){g.push(h[e].apply(h,f))}else{g.push(undefined)}});return g},pluck:function(d,f){var e=[];Ext.each(d,function(g){e.push(g[f])});return e},zip:function(){var m=Ext.partition(arguments,function(i){return !Ext.isFunction(i)}),h=m[0],l=m[1][0],d=Ext.max(Ext.pluck(h,"length")),g=[];for(var k=0;k0){for(var p=0;p=2)||(parseInt(a[1])>=7)||(parseInt(a[2])>=1),g={},d=function(i,j){if(i&&i.firstChild){while(j){if(j===i){return true}j=j.parentNode;if(j&&(j.nodeType!=1)){j=null}}}return false},b=function(i){return !d(i.currentTarget,Ext.lib.Event.getRelatedTarget(i))};Ext.lib.Dom={getViewWidth:function(i){return i?this.getDocumentWidth():this.getViewportWidth()},getViewHeight:function(i){return i?this.getDocumentHeight():this.getViewportHeight()},getDocumentHeight:function(){var i=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;return Math.max(i,this.getViewportHeight())},getDocumentWidth:function(){var i=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return Math.max(i,this.getViewportWidth())},getViewportHeight:function(){var i=self.innerHeight;var j=document.compatMode;if((j||Ext.isIE)&&!Ext.isOpera){i=(j=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight}return i},getViewportWidth:function(){var i=self.innerWidth;var j=document.compatMode;if(j||Ext.isIE){i=(j=="CSS1Compat")?document.documentElement.clientWidth:document.body.clientWidth}return i},isAncestor:function(j,k){var i=false;j=Ext.getDom(j);k=Ext.getDom(k);if(j&&k){if(j.contains){return j.contains(k)}else{if(j.compareDocumentPosition){return !!(j.compareDocumentPosition(k)&16)}else{while(k=k.parentNode){i=k==j||i}}}}return i},getRegion:function(i){return Ext.lib.Region.getRegion(i)},getY:function(i){return this.getXY(i)[1]},getX:function(i){return this.getXY(i)[0]},getXY:function(k){var j,o,r,s,n=(document.body||document.documentElement);k=Ext.getDom(k);if(k==n){return[0,0]}if(k.getBoundingClientRect){r=k.getBoundingClientRect();s=f(document).getScroll();return[Math.round(r.left+s.left),Math.round(r.top+s.top)]}var t=0,q=0;j=k;var i=f(k).getStyle("position")=="absolute";while(j){t+=j.offsetLeft;q+=j.offsetTop;if(!i&&f(j).getStyle("position")=="absolute"){i=true}if(Ext.isGecko){o=f(j);var u=parseInt(o.getStyle("borderTopWidth"),10)||0;var l=parseInt(o.getStyle("borderLeftWidth"),10)||0;t+=l;q+=u;if(j!=k&&o.getStyle("overflow")!="visible"){t+=l;q+=u}}j=j.offsetParent}if(Ext.isSafari&&i){t-=n.offsetLeft;q-=n.offsetTop}if(Ext.isGecko&&!i){var m=f(n);t+=parseInt(m.getStyle("borderLeftWidth"),10)||0;q+=parseInt(m.getStyle("borderTopWidth"),10)||0}j=k.parentNode;while(j&&j!=n){if(!Ext.isOpera||(j.tagName!="TR"&&f(j).getStyle("display")!="inline")){t-=j.scrollLeft;q-=j.scrollTop}j=j.parentNode}return[t,q]},setXY:function(i,j){i=Ext.fly(i,"_setXY");i.position();var k=i.translatePoints(j);if(j[0]!==false){i.dom.style.left=k.left+"px"}if(j[1]!==false){i.dom.style.top=k.top+"px"}},setX:function(j,i){this.setXY(j,[i,false])},setY:function(i,j){this.setXY(i,[false,j])}};Ext.lib.Event={getPageX:function(i){return Event.pointerX(i.browserEvent||i)},getPageY:function(i){return Event.pointerY(i.browserEvent||i)},getXY:function(i){i=i.browserEvent||i;return[Event.pointerX(i),Event.pointerY(i)]},getTarget:function(i){return Event.element(i.browserEvent||i)},resolveTextNode:Ext.isGecko?function(j){if(!j){return}var i=HTMLElement.prototype.toString.call(j);if(i=="[xpconnect wrapped native prototype]"||i=="[object XULElement]"){return}return j.nodeType==3?j.parentNode:j}:function(i){return i&&i.nodeType==3?i.parentNode:i},getRelatedTarget:function(j){j=j.browserEvent||j;var i=j.relatedTarget;if(!i){if(j.type=="mouseout"){i=j.toElement}else{if(j.type=="mouseover"){i=j.fromElement}}}return this.resolveTextNode(i)},on:function(k,i,j){if((i=="mouseenter"||i=="mouseleave")&&!h){var l=g[k.id]||(g[k.id]={});l[i]=j;j=j.createInterceptor(b);i=(i=="mouseenter")?"mouseover":"mouseout"}Event.observe(k,i,j,false)},un:function(k,i,j){if((i=="mouseenter"||i=="mouseleave")&&!h){var m=g[k.id],l=m&&m[i];if(l){j=l.fn;delete m[i];i=(i=="mouseenter")?"mouseover":"mouseout"}}Event.stopObserving(k,i,j,false)},purgeElement:function(i){},preventDefault:function(i){i=i.browserEvent||i;if(i.preventDefault){i.preventDefault()}else{i.returnValue=false}},stopPropagation:function(i){i=i.browserEvent||i;if(i.stopPropagation){i.stopPropagation()}else{i.cancelBubble=true}},stopEvent:function(i){Event.stop(i.browserEvent||i)},onAvailable:function(n,j,i){var m=new Date(),l;var k=function(){if(m.getElapsed()>10000){clearInterval(l)}var o=document.getElementById(n);if(o){clearInterval(l);j.call(i||window,o)}};l=setInterval(k,50)}};Ext.lib.Ajax=function(){var k=function(l){return l.success?function(m){l.success.call(l.scope||window,i(l,m))}:Ext.emptyFn};var j=function(l){return l.failure?function(m){l.failure.call(l.scope||window,i(l,m))}:Ext.emptyFn};var i=function(l,r){var n={},p,m,o;try{p=r.getAllResponseHeaders();Ext.each(p.replace(/\r\n/g,"\n").split("\n"),function(s){m=s.indexOf(":");if(m>=0){o=s.substr(0,m).toLowerCase();if(s.charAt(m+1)==" "){++m}n[o]=s.substr(m+1)}})}catch(q){}return{responseText:r.responseText,responseXML:r.responseXML,argument:l.argument,status:r.status,statusText:r.statusText,getResponseHeader:function(s){return n[s.toLowerCase()]},getAllResponseHeaders:function(){return p}}};return{request:function(s,p,l,q,m){var r={method:s,parameters:q||"",timeout:l.timeout,onSuccess:k(l),onFailure:j(l)};if(m){var n=m.headers;if(n){r.requestHeaders=n}if(m.xmlData){s=(s?s:(m.method?m.method:"POST"));if(!n||!n["Content-Type"]){r.contentType="text/xml"}r.postBody=m.xmlData;delete r.parameters}if(m.jsonData){s=(s?s:(m.method?m.method:"POST"));if(!n||!n["Content-Type"]){r.contentType="application/json"}r.postBody=typeof m.jsonData=="object"?Ext.encode(m.jsonData):m.jsonData;delete r.parameters}}new Ajax.Request(p,r)},formRequest:function(p,o,m,q,l,n){new Ajax.Request(o,{method:Ext.getDom(p).method||"POST",parameters:Form.serialize(p)+(q?"&"+q:""),timeout:m.timeout,onSuccess:k(m),onFailure:j(m)})},isCallInProgress:function(l){return false},abort:function(l){return false},serializeForm:function(l){return Form.serialize(l.dom||l)}}}();Ext.lib.Anim=function(){var i={easeOut:function(k){return 1-Math.pow(1-k,2)},easeIn:function(k){return 1-Math.pow(1-k,2)}};var j=function(k,l){return{stop:function(m){this.effect.cancel()},isAnimated:function(){return this.effect.state=="running"},proxyCallback:function(){Ext.callback(k,l)}}};return{scroll:function(n,l,p,q,k,m){var o=j(k,m);n=Ext.getDom(n);if(typeof l.scroll.to[0]=="number"){n.scrollLeft=l.scroll.to[0]}if(typeof l.scroll.to[1]=="number"){n.scrollTop=l.scroll.to[1]}o.proxyCallback();return o},motion:function(n,l,o,p,k,m){return this.run(n,l,o,p,k,m)},color:function(n,l,o,p,k,m){return this.run(n,l,o,p,k,m)},run:function(m,v,r,u,n,x,w){var l={};for(var q in v){switch(q){case"points":var t,z,s=Ext.fly(m,"_animrun");s.position();if(t=v.points.by){var y=s.getXY();z=s.translatePoints([y[0]+t[0],y[1]+t[1]])}else{z=s.translatePoints(v.points.to)}l.left=z.left+"px";l.top=z.top+"px";break;case"width":l.width=v.width.to+"px";break;case"height":l.height=v.height.to+"px";break;case"opacity":l.opacity=String(v.opacity.to);break;default:l[q]=String(v[q].to);break}}var p=j(n,x);p.effect=new Effect.Morph(Ext.id(m),{duration:r,afterFinish:p.proxyCallback,transition:i[u]||Effect.Transitions.linear,style:l});return p}}}();function f(i){if(!e){e=new Ext.Element.Flyweight()}e.dom=i;return e}Ext.lib.Region=function(k,m,i,j){this.top=k;this[1]=k;this.right=m;this.bottom=i;this.left=j;this[0]=j};Ext.lib.Region.prototype={contains:function(i){return(i.left>=this.left&&i.right<=this.right&&i.top>=this.top&&i.bottom<=this.bottom)},getArea:function(){return((this.bottom-this.top)*(this.right-this.left))},intersect:function(n){var k=Math.max(this.top,n.top);var m=Math.min(this.right,n.right);var i=Math.min(this.bottom,n.bottom);var j=Math.max(this.left,n.left);if(i>=k&&m>=j){return new Ext.lib.Region(k,m,i,j)}else{return null}},union:function(n){var k=Math.min(this.top,n.top);var m=Math.max(this.right,n.right);var i=Math.max(this.bottom,n.bottom);var j=Math.min(this.left,n.left);return new Ext.lib.Region(k,m,i,j)},constrainTo:function(i){this.top=this.top.constrain(i.top,i.bottom);this.bottom=this.bottom.constrain(i.top,i.bottom);this.left=this.left.constrain(i.left,i.right);this.right=this.right.constrain(i.left,i.right);return this},adjust:function(k,j,i,m){this.top+=k;this.left+=j;this.right+=m;this.bottom+=i;return this}};Ext.lib.Region.getRegion=function(m){var o=Ext.lib.Dom.getXY(m);var k=o[1];var n=o[0]+m.offsetWidth;var i=o[1]+m.offsetHeight;var j=o[0];return new Ext.lib.Region(k,n,i,j)};Ext.lib.Point=function(i,j){if(Ext.isArray(i)){j=i[1];i=i[0]}this.x=this.right=this.left=this[0]=i;this.y=this.top=this.bottom=this[1]=j};Ext.lib.Point.prototype=new Ext.lib.Region();if(Ext.isIE){function c(){var i=Function.prototype;delete i.createSequence;delete i.defer;delete i.createDelegate;delete i.createCallback;delete i.createInterceptor;window.detachEvent("onunload",c)}window.attachEvent("onunload",c)}})(); \ No newline at end of file +window.undefined=window.undefined;Ext={version:"3.2.1",versionDetail:{major:3,minor:2,patch:1}};Ext.apply=function(d,e,b){if(b){Ext.apply(d,b)}if(d&&e&&typeof e=="object"){for(var a in e){d[a]=e[a]}}return d};(function(){var g=0,s=Object.prototype.toString,t=navigator.userAgent.toLowerCase(),y=function(e){return e.test(t)},i=document,l=i.compatMode=="CSS1Compat",A=y(/opera/),h=y(/\bchrome\b/),u=y(/webkit/),x=!h&&y(/safari/),f=x&&y(/applewebkit\/4/),b=x&&y(/version\/3/),B=x&&y(/version\/4/),r=!A&&y(/msie/),p=r&&y(/msie 7/),o=r&&y(/msie 8/),q=r&&!p&&!o,n=!u&&y(/gecko/),d=n&&y(/rv:1\.8/),a=n&&y(/rv:1\.9/),v=r&&!l,z=y(/windows|win32/),k=y(/macintosh|mac os x/),j=y(/adobeair/),m=y(/linux/),c=/^https/i.test(window.location.protocol);if(q){try{i.execCommand("BackgroundImageCache",false,true)}catch(w){}}Ext.apply(Ext,{SSL_SECURE_URL:c&&r?'javascript:""':"about:blank",isStrict:l,isSecure:c,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,enableNestedListenerRemoval:false,USE_NATIVE_JSON:false,applyIf:function(C,D){if(C){for(var e in D){if(!Ext.isDefined(C[e])){C[e]=D[e]}}}return C},id:function(e,C){e=Ext.getDom(e,true)||{};if(!e.id){e.id=(C||"ext-gen")+(++g)}return e.id},extend:function(){var C=function(E){for(var D in E){this[D]=E[D]}};var e=Object.prototype.constructor;return function(J,G,I){if(typeof G=="object"){I=G;G=J;J=I.constructor!=e?I.constructor:function(){G.apply(this,arguments)}}var E=function(){},H,D=G.prototype;E.prototype=D;H=J.prototype=new E();H.constructor=J;J.superclass=D;if(D.constructor==e){D.constructor=G}J.override=function(F){Ext.override(J,F)};H.superclass=H.supr=(function(){return D});H.override=C;Ext.override(J,I);J.extend=function(F){return Ext.extend(J,F)};return J}}(),override:function(e,D){if(D){var C=e.prototype;Ext.apply(C,D);if(Ext.isIE&&D.hasOwnProperty("toString")){C.toString=D.toString}}},namespace:function(){var C,e;Ext.each(arguments,function(D){e=D.split(".");C=window[e[0]]=window[e[0]]||{};Ext.each(e.slice(1),function(E){C=C[E]=C[E]||{}})});return C},urlEncode:function(G,F){var D,C=[],E=encodeURIComponent;Ext.iterate(G,function(e,H){D=Ext.isEmpty(H);Ext.each(D?e:H,function(I){C.push("&",E(e),"=",(!Ext.isEmpty(I)&&(I!=e||!D))?(Ext.isDate(I)?Ext.encode(I).replace(/"/g,""):E(I)):"")})});if(!F){C.shift();F=""}return F+C.join("")},urlDecode:function(D,C){if(Ext.isEmpty(D)){return{}}var G={},F=D.split("&"),H=decodeURIComponent,e,E;Ext.each(F,function(I){I=I.split("=");e=H(I[0]);E=H(I[1]);G[e]=C||!G[e]?E:[].concat(G[e]).concat(E)});return G},urlAppend:function(e,C){if(!Ext.isEmpty(C)){return e+(e.indexOf("?")===-1?"?":"&")+C}return e},toArray:function(){return r?function(D,G,E,F){F=[];for(var C=0,e=D.length;C0){return setTimeout(d,c)}d();return 0}});Ext.applyIf(String,{format:function(b){var a=Ext.toArray(arguments,1);return b.replace(/\{(\d+)\}/g,function(c,d){return a[d]})}});Ext.applyIf(Array.prototype,{indexOf:function(b,c){var a=this.length;c=c||0;c+=(c<0)?a:0;for(;c
'),g=h.child("div",true);var e=g.offsetWidth;h.setStyle("overflow",(Ext.isWebKit||Ext.isGecko)?"auto":"scroll");var d=g.offsetWidth;h.remove();b=e-d+2}return b},combine:function(){var f=arguments,e=f.length,h=[];for(var g=0;gg?1:-1};Ext.each(d,function(g){f=e(f,g)==1?f:g});return f},mean:function(d){return d.length>0?Ext.sum(d)/d.length:undefined},sum:function(d){var e=0;Ext.each(d,function(f){e+=f});return e},partition:function(d,e){var f=[[],[]];Ext.each(d,function(h,j,g){f[(e&&e(h,j,g))||(!e&&h)?0:1].push(h)});return f},invoke:function(d,e){var g=[],f=Array.prototype.slice.call(arguments,2);Ext.each(d,function(h,j){if(h&&typeof h[e]=="function"){g.push(h[e].apply(h,f))}else{g.push(undefined)}});return g},pluck:function(d,f){var e=[];Ext.each(d,function(g){e.push(g[f])});return e},zip:function(){var m=Ext.partition(arguments,function(i){return typeof i!="function"}),h=m[0],l=m[1][0],d=Ext.max(Ext.pluck(h,"length")),g=[];for(var k=0;k0){for(var p=0;p=2)||(parseInt(a[1])>=7)||(parseInt(a[2])>=1),g={},d=function(i,j){if(i&&i.firstChild){while(j){if(j===i){return true}j=j.parentNode;if(j&&(j.nodeType!=1)){j=null}}}return false},b=function(i){return !d(i.currentTarget,Ext.lib.Event.getRelatedTarget(i))};Ext.lib.Dom={getViewWidth:function(i){return i?this.getDocumentWidth():this.getViewportWidth()},getViewHeight:function(i){return i?this.getDocumentHeight():this.getViewportHeight()},getDocumentHeight:function(){var i=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;return Math.max(i,this.getViewportHeight())},getDocumentWidth:function(){var i=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return Math.max(i,this.getViewportWidth())},getViewportHeight:function(){var i=self.innerHeight;var j=document.compatMode;if((j||Ext.isIE)&&!Ext.isOpera){i=(j=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight}return i},getViewportWidth:function(){var i=self.innerWidth;var j=document.compatMode;if(j||Ext.isIE){i=(j=="CSS1Compat")?document.documentElement.clientWidth:document.body.clientWidth}return i},isAncestor:function(j,k){var i=false;j=Ext.getDom(j);k=Ext.getDom(k);if(j&&k){if(j.contains){return j.contains(k)}else{if(j.compareDocumentPosition){return !!(j.compareDocumentPosition(k)&16)}else{while(k=k.parentNode){i=k==j||i}}}}return i},getRegion:function(i){return Ext.lib.Region.getRegion(i)},getY:function(i){return this.getXY(i)[1]},getX:function(i){return this.getXY(i)[0]},getXY:function(k){var j,o,r,s,n=(document.body||document.documentElement);k=Ext.getDom(k);if(k==n){return[0,0]}if(k.getBoundingClientRect){r=k.getBoundingClientRect();s=f(document).getScroll();return[Math.round(r.left+s.left),Math.round(r.top+s.top)]}var t=0,q=0;j=k;var i=f(k).getStyle("position")=="absolute";while(j){t+=j.offsetLeft;q+=j.offsetTop;if(!i&&f(j).getStyle("position")=="absolute"){i=true}if(Ext.isGecko){o=f(j);var u=parseInt(o.getStyle("borderTopWidth"),10)||0;var l=parseInt(o.getStyle("borderLeftWidth"),10)||0;t+=l;q+=u;if(j!=k&&o.getStyle("overflow")!="visible"){t+=l;q+=u}}j=j.offsetParent}if(Ext.isSafari&&i){t-=n.offsetLeft;q-=n.offsetTop}if(Ext.isGecko&&!i){var m=f(n);t+=parseInt(m.getStyle("borderLeftWidth"),10)||0;q+=parseInt(m.getStyle("borderTopWidth"),10)||0}j=k.parentNode;while(j&&j!=n){if(!Ext.isOpera||(j.tagName!="TR"&&f(j).getStyle("display")!="inline")){t-=j.scrollLeft;q-=j.scrollTop}j=j.parentNode}return[t,q]},setXY:function(i,j){i=Ext.fly(i,"_setXY");i.position();var k=i.translatePoints(j);if(j[0]!==false){i.dom.style.left=k.left+"px"}if(j[1]!==false){i.dom.style.top=k.top+"px"}},setX:function(j,i){this.setXY(j,[i,false])},setY:function(i,j){this.setXY(i,[false,j])}};Ext.lib.Event={getPageX:function(i){return Event.pointerX(i.browserEvent||i)},getPageY:function(i){return Event.pointerY(i.browserEvent||i)},getXY:function(i){i=i.browserEvent||i;return[Event.pointerX(i),Event.pointerY(i)]},getTarget:function(i){return Event.element(i.browserEvent||i)},resolveTextNode:Ext.isGecko?function(j){if(!j){return}var i=HTMLElement.prototype.toString.call(j);if(i=="[xpconnect wrapped native prototype]"||i=="[object XULElement]"){return}return j.nodeType==3?j.parentNode:j}:function(i){return i&&i.nodeType==3?i.parentNode:i},getRelatedTarget:function(j){j=j.browserEvent||j;var i=j.relatedTarget;if(!i){if(j.type=="mouseout"){i=j.toElement}else{if(j.type=="mouseover"){i=j.fromElement}}}return this.resolveTextNode(i)},on:function(k,i,j){if((i=="mouseenter"||i=="mouseleave")&&!h){var l=g[k.id]||(g[k.id]={});l[i]=j;j=j.createInterceptor(b);i=(i=="mouseenter")?"mouseover":"mouseout"}Event.observe(k,i,j,false)},un:function(k,i,j){if((i=="mouseenter"||i=="mouseleave")&&!h){var m=g[k.id],l=m&&m[i];if(l){j=l.fn;delete m[i];i=(i=="mouseenter")?"mouseover":"mouseout"}}Event.stopObserving(k,i,j,false)},purgeElement:function(i){},preventDefault:function(i){i=i.browserEvent||i;if(i.preventDefault){i.preventDefault()}else{i.returnValue=false}},stopPropagation:function(i){i=i.browserEvent||i;if(i.stopPropagation){i.stopPropagation()}else{i.cancelBubble=true}},stopEvent:function(i){Event.stop(i.browserEvent||i)},onAvailable:function(n,j,i){var m=new Date(),l;var k=function(){if(m.getElapsed()>10000){clearInterval(l)}var o=document.getElementById(n);if(o){clearInterval(l);j.call(i||window,o)}};l=setInterval(k,50)}};Ext.lib.Ajax=function(){var k=function(l){return l.success?function(m){l.success.call(l.scope||window,i(l,m))}:Ext.emptyFn};var j=function(l){return l.failure?function(m){l.failure.call(l.scope||window,i(l,m))}:Ext.emptyFn};var i=function(l,r){var n={},p,m,o;try{p=r.getAllResponseHeaders();Ext.each(p.replace(/\r\n/g,"\n").split("\n"),function(s){m=s.indexOf(":");if(m>=0){o=s.substr(0,m).toLowerCase();if(s.charAt(m+1)==" "){++m}n[o]=s.substr(m+1)}})}catch(q){}return{responseText:r.responseText,responseXML:r.responseXML,argument:l.argument,status:r.status,statusText:r.statusText,getResponseHeader:function(s){return n[s.toLowerCase()]},getAllResponseHeaders:function(){return p}}};return{request:function(s,p,l,q,m){var r={method:s,parameters:q||"",timeout:l.timeout,onSuccess:k(l),onFailure:j(l)};if(m){var n=m.headers;if(n){r.requestHeaders=n}if(m.xmlData){s=(s?s:(m.method?m.method:"POST"));if(!n||!n["Content-Type"]){r.contentType="text/xml"}r.postBody=m.xmlData;delete r.parameters}if(m.jsonData){s=(s?s:(m.method?m.method:"POST"));if(!n||!n["Content-Type"]){r.contentType="application/json"}r.postBody=typeof m.jsonData=="object"?Ext.encode(m.jsonData):m.jsonData;delete r.parameters}}new Ajax.Request(p,r)},formRequest:function(p,o,m,q,l,n){new Ajax.Request(o,{method:Ext.getDom(p).method||"POST",parameters:Form.serialize(p)+(q?"&"+q:""),timeout:m.timeout,onSuccess:k(m),onFailure:j(m)})},isCallInProgress:function(l){return false},abort:function(l){return false},serializeForm:function(l){return Form.serialize(l.dom||l)}}}();Ext.lib.Anim=function(){var i={easeOut:function(k){return 1-Math.pow(1-k,2)},easeIn:function(k){return 1-Math.pow(1-k,2)}};var j=function(k,l){return{stop:function(m){this.effect.cancel()},isAnimated:function(){return this.effect.state=="running"},proxyCallback:function(){Ext.callback(k,l)}}};return{scroll:function(n,l,p,q,k,m){var o=j(k,m);n=Ext.getDom(n);if(typeof l.scroll.to[0]=="number"){n.scrollLeft=l.scroll.to[0]}if(typeof l.scroll.to[1]=="number"){n.scrollTop=l.scroll.to[1]}o.proxyCallback();return o},motion:function(n,l,o,p,k,m){return this.run(n,l,o,p,k,m)},color:function(n,l,o,p,k,m){return this.run(n,l,o,p,k,m)},run:function(m,v,r,u,n,x,w){var l={};for(var q in v){switch(q){case"points":var t,z,s=Ext.fly(m,"_animrun");s.position();if(t=v.points.by){var y=s.getXY();z=s.translatePoints([y[0]+t[0],y[1]+t[1]])}else{z=s.translatePoints(v.points.to)}l.left=z.left+"px";l.top=z.top+"px";break;case"width":l.width=v.width.to+"px";break;case"height":l.height=v.height.to+"px";break;case"opacity":l.opacity=String(v.opacity.to);break;default:l[q]=String(v[q].to);break}}var p=j(n,x);p.effect=new Effect.Morph(Ext.id(m),{duration:r,afterFinish:p.proxyCallback,transition:i[u]||Effect.Transitions.linear,style:l});return p}}}();function f(i){if(!e){e=new Ext.Element.Flyweight()}e.dom=i;return e}Ext.lib.Region=function(k,m,i,j){this.top=k;this[1]=k;this.right=m;this.bottom=i;this.left=j;this[0]=j};Ext.lib.Region.prototype={contains:function(i){return(i.left>=this.left&&i.right<=this.right&&i.top>=this.top&&i.bottom<=this.bottom)},getArea:function(){return((this.bottom-this.top)*(this.right-this.left))},intersect:function(n){var k=Math.max(this.top,n.top);var m=Math.min(this.right,n.right);var i=Math.min(this.bottom,n.bottom);var j=Math.max(this.left,n.left);if(i>=k&&m>=j){return new Ext.lib.Region(k,m,i,j)}else{return null}},union:function(n){var k=Math.min(this.top,n.top);var m=Math.max(this.right,n.right);var i=Math.max(this.bottom,n.bottom);var j=Math.min(this.left,n.left);return new Ext.lib.Region(k,m,i,j)},constrainTo:function(i){this.top=this.top.constrain(i.top,i.bottom);this.bottom=this.bottom.constrain(i.top,i.bottom);this.left=this.left.constrain(i.left,i.right);this.right=this.right.constrain(i.left,i.right);return this},adjust:function(k,j,i,m){this.top+=k;this.left+=j;this.right+=m;this.bottom+=i;return this}};Ext.lib.Region.getRegion=function(m){var o=Ext.lib.Dom.getXY(m);var k=o[1];var n=o[0]+m.offsetWidth;var i=o[1]+m.offsetHeight;var j=o[0];return new Ext.lib.Region(k,n,i,j)};Ext.lib.Point=function(i,j){if(Ext.isArray(i)){j=i[1];i=i[0]}this.x=this.right=this.left=this[0]=i;this.y=this.top=this.bottom=this[1]=j};Ext.lib.Point.prototype=new Ext.lib.Region();if(Ext.isIE){function c(){var i=Function.prototype;delete i.createSequence;delete i.defer;delete i.createDelegate;delete i.createCallback;delete i.createInterceptor;window.detachEvent("onunload",c)}window.attachEvent("onunload",c)}})(); \ No newline at end of file diff --git a/adapter/yui/ext-yui-adapter-debug.js b/adapter/yui/ext-yui-adapter-debug.js index d764503a..918a2726 100644 --- a/adapter/yui/ext-yui-adapter-debug.js +++ b/adapter/yui/ext-yui-adapter-debug.js @@ -1,10 +1,9 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ - // for old browsers window.undefined = window.undefined; @@ -19,7 +18,12 @@ Ext = { * The version of the framework * @type String */ - version : '3.2.0' + version : '3.2.1', + versionDetail : { + major: 3, + minor: 2, + patch: 1 + } }; /** @@ -227,7 +231,7 @@ MyGridPanel = Ext.extend(Ext.grid.GridPanel, { var oc = Object.prototype.constructor; return function(sb, sp, overrides){ - if(Ext.isObject(sp)){ + if(typeof sp == 'object'){ overrides = sp; sp = sb; sb = overrides.constructor != oc ? overrides.constructor : function(){sp.apply(this, arguments);}; @@ -475,7 +479,7 @@ Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {foo: "1", bar: ["2" if(Ext.isIterable(obj)){ Ext.each(obj, fn, scope); return; - }else if(Ext.isObject(obj)){ + }else if(typeof obj == 'object'){ for(var prop in obj){ if(obj.hasOwnProperty(prop)){ if(fn.call(scope || obj, prop, obj[prop], obj) === false){ @@ -516,7 +520,7 @@ function(el){ if (el.dom){ return el.dom; } else { - if (Ext.isString(el)) { + if (typeof el == 'string') { var e = DOC.getElementById(el); // IE returns elements with the 'name' and 'id' attribute. // we do a strict check to return the element with only the id attribute @@ -1033,7 +1037,7 @@ Ext.ns("Ext.grid", "Ext.list", "Ext.dd", "Ext.tree", "Ext.form", "Ext.menu", */ Ext.apply(Ext, function(){ - var E = Ext, + var E = Ext, idSeed = 0, scrollWidth = null; @@ -1046,13 +1050,13 @@ Ext.apply(Ext, function(){ emptyFn : function(){}, /** - * URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images. + * URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images. * In older versions of IE, this defaults to "http://extjs.com/s.gif" and you should change this to a URL on your server. * For other browsers it uses an inline data URL. * @type String */ BLANK_IMAGE_URL : Ext.isIE6 || Ext.isIE7 || Ext.isAir ? - 'http:/' + '/extjs.com/s.gif' : + 'http:/' + '/www.extjs.com/s.gif' : 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', extendX : function(supr, fn){ @@ -1074,7 +1078,7 @@ Ext.apply(Ext, function(){ * @return {Number} Value, if numeric, else defaultValue */ num : function(v, defaultValue){ - v = Number(Ext.isEmpty(v) || Ext.isArray(v) || Ext.isBoolean(v) || (Ext.isString(v) && v.trim().length == 0) ? NaN : v); + v = Number(Ext.isEmpty(v) || Ext.isArray(v) || typeof v == 'boolean' || (typeof v == 'string' && v.trim().length == 0) ? NaN : v); return isNaN(v) ? defaultValue : v; }, @@ -1117,13 +1121,13 @@ Ext.addBehaviors({ '#foo a@click' : function(e, t){ // do something }, - + // add the same listener to multiple selectors (separated by comma BEFORE the @) '#foo a, #bar span.some-class@mouseover' : function(){ // do something } }); - *
+ * * @param {Object} obj The list of behaviors to apply */ addBehaviors : function(o){ @@ -1148,7 +1152,7 @@ Ext.addBehaviors({ cache = null; } }, - + /** * Utility method for getting the width of the browser scrollbar. This can differ depending on * operating system settings, such as the theme or font size. @@ -1159,7 +1163,7 @@ Ext.addBehaviors({ if(!Ext.isReady){ return 0; } - + if(force === true || scrollWidth === null){ // Append our div, do our calculation and then remove it var div = Ext.getBody().createChild('
'), @@ -1201,7 +1205,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { this.initialBox = Ext.copyTo({}, this.initialConfig, 'x,y,width,height'); } }); - * + * * @param {Object} dest The destination object. * @param {Object} source The source object. * @param {Array/String} names Either an Array of property names, or a comma-delimited list @@ -1209,7 +1213,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { * @return {Object} The modified object. */ copyTo : function(dest, source, names){ - if(Ext.isString(names)){ + if(typeof names == 'string'){ names = names.split(/[,;\s]/); } Ext.each(names, function(name){ @@ -1235,11 +1239,11 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { if(arg){ if(Ext.isArray(arg)){ this.destroy.apply(this, arg); - }else if(Ext.isFunction(arg.destroy)){ + }else if(typeof arg.destroy == 'function'){ arg.destroy(); }else if(arg.dom){ arg.remove(); - } + } } }, this); }, @@ -1366,8 +1370,8 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { /** * Partitions the set into two sets: a true set and a false set. - * Example: - * Example2: + * Example: + * Example2: *

 // Example 1:
 Ext.partition([true, false, true, true, false]); // [[true, true, true], [false, false]]
@@ -1411,7 +1415,7 @@ Ext.invoke(Ext.query("p"), "getAttribute", "id");
             var ret = [],
                 args = Array.prototype.slice.call(arguments, 2);
             Ext.each(arr, function(v,i) {
-                if (v && Ext.isFunction(v[methodName])) {
+                if (v && typeof v[methodName] == 'function') {
                     ret.push(v[methodName].apply(v, args));
                 } else {
                     ret.push(undefined);
@@ -1458,7 +1462,7 @@ Ext.zip(
          * @return {Array} The zipped set.
          */
         zip : function(){
-            var parts = Ext.partition(arguments, function( val ){ return !Ext.isFunction(val); }),
+            var parts = Ext.partition(arguments, function( val ){ return typeof val != 'function'; }),
                 arrs = parts[0],
                 fn = parts[1][0],
                 len = Ext.max(Ext.pluck(arrs, "length")),
@@ -1535,7 +1539,7 @@ Ext.zip(
                     case RegExp: return 'regexp';
                     case Date: return 'date';
                 }
-                if(Ext.isNumber(o.length) && Ext.isFunction(o.item)) {
+                if(typeof o.length == 'number' && typeof o.item == 'function') {
                     return 'nodelist';
                 }
             }
@@ -1548,7 +1552,7 @@ Ext.zip(
 
         // internal
         callback : function(cb, scope, args, delay){
-            if(Ext.isFunction(cb)){
+            if(typeof cb == 'function'){
                 if(delay){
                     cb.defer(delay, scope, args || []);
                 }else{
@@ -1588,7 +1592,7 @@ sayGoodbye('Fred'); // both alerts show
      */
     createSequence : function(fcn, scope){
         var method = this;
-        return !Ext.isFunction(fcn) ?
+        return (typeof fcn != 'function') ?
                 this :
                 function(){
                     var retval = method.apply(this || window, arguments);
diff --git a/adapter/yui/ext-yui-adapter.js b/adapter/yui/ext-yui-adapter.js
index 144212cb..84852fc0 100644
--- a/adapter/yui/ext-yui-adapter.js
+++ b/adapter/yui/ext-yui-adapter.js
@@ -1,7 +1,7 @@
 /*
- * Ext JS Library 3.2.0
+ * Ext JS Library 3.2.1
  * Copyright(c) 2006-2010 Ext JS, Inc.
  * licensing@extjs.com
  * http://www.extjs.com/license
  */
-window.undefined=window.undefined;Ext={version:"3.2.0"};Ext.apply=function(d,e,b){if(b){Ext.apply(d,b)}if(d&&e&&typeof e=="object"){for(var a in e){d[a]=e[a]}}return d};(function(){var g=0,s=Object.prototype.toString,t=navigator.userAgent.toLowerCase(),y=function(e){return e.test(t)},i=document,l=i.compatMode=="CSS1Compat",A=y(/opera/),h=y(/\bchrome\b/),u=y(/webkit/),x=!h&&y(/safari/),f=x&&y(/applewebkit\/4/),b=x&&y(/version\/3/),B=x&&y(/version\/4/),r=!A&&y(/msie/),p=r&&y(/msie 7/),o=r&&y(/msie 8/),q=r&&!p&&!o,n=!u&&y(/gecko/),d=n&&y(/rv:1\.8/),a=n&&y(/rv:1\.9/),v=r&&!l,z=y(/windows|win32/),k=y(/macintosh|mac os x/),j=y(/adobeair/),m=y(/linux/),c=/^https/i.test(window.location.protocol);if(q){try{i.execCommand("BackgroundImageCache",false,true)}catch(w){}}Ext.apply(Ext,{SSL_SECURE_URL:c&&r?'javascript:""':"about:blank",isStrict:l,isSecure:c,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,enableNestedListenerRemoval:false,USE_NATIVE_JSON:false,applyIf:function(C,D){if(C){for(var e in D){if(!Ext.isDefined(C[e])){C[e]=D[e]}}}return C},id:function(e,C){e=Ext.getDom(e,true)||{};if(!e.id){e.id=(C||"ext-gen")+(++g)}return e.id},extend:function(){var C=function(E){for(var D in E){this[D]=E[D]}};var e=Object.prototype.constructor;return function(J,G,I){if(Ext.isObject(G)){I=G;G=J;J=I.constructor!=e?I.constructor:function(){G.apply(this,arguments)}}var E=function(){},H,D=G.prototype;E.prototype=D;H=J.prototype=new E();H.constructor=J;J.superclass=D;if(D.constructor==e){D.constructor=G}J.override=function(F){Ext.override(J,F)};H.superclass=H.supr=(function(){return D});H.override=C;Ext.override(J,I);J.extend=function(F){return Ext.extend(J,F)};return J}}(),override:function(e,D){if(D){var C=e.prototype;Ext.apply(C,D);if(Ext.isIE&&D.hasOwnProperty("toString")){C.toString=D.toString}}},namespace:function(){var C,e;Ext.each(arguments,function(D){e=D.split(".");C=window[e[0]]=window[e[0]]||{};Ext.each(e.slice(1),function(E){C=C[E]=C[E]||{}})});return C},urlEncode:function(G,F){var D,C=[],E=encodeURIComponent;Ext.iterate(G,function(e,H){D=Ext.isEmpty(H);Ext.each(D?e:H,function(I){C.push("&",E(e),"=",(!Ext.isEmpty(I)&&(I!=e||!D))?(Ext.isDate(I)?Ext.encode(I).replace(/"/g,""):E(I)):"")})});if(!F){C.shift();F=""}return F+C.join("")},urlDecode:function(D,C){if(Ext.isEmpty(D)){return{}}var G={},F=D.split("&"),H=decodeURIComponent,e,E;Ext.each(F,function(I){I=I.split("=");e=H(I[0]);E=H(I[1]);G[e]=C||!G[e]?E:[].concat(G[e]).concat(E)});return G},urlAppend:function(e,C){if(!Ext.isEmpty(C)){return e+(e.indexOf("?")===-1?"?":"&")+C}return e},toArray:function(){return r?function(D,G,E,F){F=[];for(var C=0,e=D.length;C0){return setTimeout(d,c)}d();return 0}});Ext.applyIf(String,{format:function(b){var a=Ext.toArray(arguments,1);return b.replace(/\{(\d+)\}/g,function(c,d){return a[d]})}});Ext.applyIf(Array.prototype,{indexOf:function(b,c){var a=this.length;c=c||0;c+=(c<0)?a:0;for(;c
'),g=h.child("div",true);var e=g.offsetWidth;h.setStyle("overflow",(Ext.isWebKit||Ext.isGecko)?"auto":"scroll");var d=g.offsetWidth;h.remove();b=e-d+2}return b},combine:function(){var f=arguments,e=f.length,h=[];for(var g=0;gg?1:-1};Ext.each(d,function(g){f=e(f,g)==1?f:g});return f},mean:function(d){return d.length>0?Ext.sum(d)/d.length:undefined},sum:function(d){var e=0;Ext.each(d,function(f){e+=f});return e},partition:function(d,e){var f=[[],[]];Ext.each(d,function(h,j,g){f[(e&&e(h,j,g))||(!e&&h)?0:1].push(h)});return f},invoke:function(d,e){var g=[],f=Array.prototype.slice.call(arguments,2);Ext.each(d,function(h,j){if(h&&Ext.isFunction(h[e])){g.push(h[e].apply(h,f))}else{g.push(undefined)}});return g},pluck:function(d,f){var e=[];Ext.each(d,function(g){e.push(g[f])});return e},zip:function(){var m=Ext.partition(arguments,function(i){return !Ext.isFunction(i)}),h=m[0],l=m[1][0],d=Ext.max(Ext.pluck(h,"length")),g=[];for(var k=0;k0){for(var p=0;p=3,l={},e=function(n,o){if(n&&n.firstChild){while(o){if(o===n){return true}o=o.parentNode;if(o&&(o.nodeType!=1)){o=null}}}return false},i=function(n){return !e(n.currentTarget,Ext.lib.Event.getRelatedTarget(n))};Ext.lib.Dom={getViewWidth:function(n){return n?b.getDocumentWidth():b.getViewportWidth()},getViewHeight:function(n){return n?b.getDocumentHeight():b.getViewportHeight()},isAncestor:function(n,o){return b.isAncestor(n,o)},getRegion:function(n){return b.getRegion(n)},getY:function(n){return this.getXY(n)[1]},getX:function(n){return this.getXY(n)[0]},getXY:function(q){var o,u,w,z,t=(document.body||document.documentElement);q=Ext.getDom(q);if(q==t){return[0,0]}if(q.getBoundingClientRect){w=q.getBoundingClientRect();z=g(document).getScroll();return[Math.round(w.left+z.left),Math.round(w.top+z.top)]}var A=0,v=0;o=q;var n=g(q).getStyle("position")=="absolute";while(o){A+=o.offsetLeft;v+=o.offsetTop;if(!n&&g(o).getStyle("position")=="absolute"){n=true}if(Ext.isGecko){u=g(o);var B=parseInt(u.getStyle("borderTopWidth"),10)||0;var r=parseInt(u.getStyle("borderLeftWidth"),10)||0;A+=r;v+=B;if(o!=q&&u.getStyle("overflow")!="visible"){A+=r;v+=B}}o=o.offsetParent}if(Ext.isSafari&&n){A-=t.offsetLeft;v-=t.offsetTop}if(Ext.isGecko&&!n){var s=g(t);A+=parseInt(s.getStyle("borderLeftWidth"),10)||0;v+=parseInt(s.getStyle("borderTopWidth"),10)||0}o=q.parentNode;while(o&&o!=t){if(!Ext.isOpera||(o.tagName!="TR"&&g(o).getStyle("display")!="inline")){A-=o.scrollLeft;v-=o.scrollTop}o=o.parentNode}return[A,v]},setXY:function(n,o){n=Ext.fly(n,"_setXY");n.position();var p=n.translatePoints(o);if(o[0]!==false){n.dom.style.left=p.left+"px"}if(o[1]!==false){n.dom.style.top=p.top+"px"}},setX:function(o,n){this.setXY(o,[n,false])},setY:function(n,o){this.setXY(n,[false,o])}};Ext.lib.Event={getPageX:function(n){return m.getPageX(n.browserEvent||n)},getPageY:function(n){return m.getPageY(n.browserEvent||n)},getXY:function(n){return m.getXY(n.browserEvent||n)},getTarget:function(n){return m.getTarget(n.browserEvent||n)},getRelatedTarget:function(n){return m.getRelatedTarget(n.browserEvent||n)},on:function(r,n,q,p,o){if((n=="mouseenter"||n=="mouseleave")&&!a){var s=l[r.id]||(l[r.id]={});s[n]=q;q=q.createInterceptor(i);n=(n=="mouseenter")?"mouseover":"mouseout"}m.on(r,n,q,p,o)},un:function(p,n,o){if((n=="mouseenter"||n=="mouseleave")&&!a){var r=l[p.id],q=r&&r[n];if(q){o=q.fn;delete r[n];n=(n=="mouseenter")?"mouseover":"mouseout"}}m.removeListener(p,n,o)},purgeElement:function(n){m.purgeElement(n)},preventDefault:function(n){m.preventDefault(n.browserEvent||n)},stopPropagation:function(n){m.stopPropagation(n.browserEvent||n)},stopEvent:function(n){m.stopEvent(n.browserEvent||n)},onAvailable:function(q,p,o,n){return m.onAvailable(q,p,o,n)}};Ext.lib.Ajax={request:function(t,r,n,s,o){if(o){var p=o.headers;if(p){for(var q in p){if(p.hasOwnProperty(q)){f.initHeader(q,p[q],false)}}}if(o.xmlData){if(!p||!p["Content-Type"]){f.initHeader("Content-Type","text/xml",false)}t=(t?t:(o.method?o.method:"POST"));s=o.xmlData}else{if(o.jsonData){if(!p||!p["Content-Type"]){f.initHeader("Content-Type","application/json",false)}t=(t?t:(o.method?o.method:"POST"));s=typeof o.jsonData=="object"?Ext.encode(o.jsonData):o.jsonData}}}return f.asyncRequest(t,r,n,s)},formRequest:function(r,q,o,s,n,p){f.setForm(r,n,p);return f.asyncRequest(Ext.getDom(r).method||"POST",q,o,s)},isCallInProgress:function(n){return f.isCallInProgress(n)},abort:function(n){return f.abort(n)},serializeForm:function(n){var o=f.setForm(n.dom||n);f.resetFormState();return o}};Ext.lib.Region=YAHOO.util.Region;Ext.lib.Point=YAHOO.util.Point;Ext.lib.Anim={scroll:function(q,o,r,s,n,p){this.run(q,o,r,s,n,p,YAHOO.util.Scroll)},motion:function(q,o,r,s,n,p){this.run(q,o,r,s,n,p,YAHOO.util.Motion)},color:function(q,o,r,s,n,p){this.run(q,o,r,s,n,p,YAHOO.util.ColorAnim)},run:function(r,o,t,u,n,q,p){p=p||YAHOO.util.Anim;if(typeof u=="string"){u=YAHOO.util.Easing[u]}var s=new p(r,o,t,u);s.animateX(function(){Ext.callback(n,q)});return s}};function g(n){if(!j){j=new Ext.Element.Flyweight()}j.dom=n;return j}if(Ext.isIE){function d(){var n=Function.prototype;delete n.createSequence;delete n.defer;delete n.createDelegate;delete n.createCallback;delete n.createInterceptor;window.detachEvent("onunload",d)}window.attachEvent("onunload",d)}if(YAHOO.util.Anim){YAHOO.util.Anim.prototype.animateX=function(p,n){var o=function(){this.onComplete.unsubscribe(o);if(typeof p=="function"){p.call(n||this,this)}};this.onComplete.subscribe(o,this,true);this.animate()}}if(YAHOO.util.DragDrop&&Ext.dd.DragDrop){YAHOO.util.DragDrop.defaultPadding=Ext.dd.DragDrop.defaultPadding;YAHOO.util.DragDrop.constrainTo=Ext.dd.DragDrop.constrainTo}YAHOO.util.Dom.getXY=function(n){var o=function(p){return Ext.lib.Dom.getXY(p)};return YAHOO.util.Dom.batch(n,o,YAHOO.util.Dom,true)};if(YAHOO.util.AnimMgr){YAHOO.util.AnimMgr.fps=1000}YAHOO.util.Region.prototype.adjust=function(p,o,n,q){this.top+=p;this.left+=o;this.right+=q;this.bottom+=n;return this};YAHOO.util.Region.prototype.constrainTo=function(n){this.top=this.top.constrain(n.top,n.bottom);this.bottom=this.bottom.constrain(n.top,n.bottom);this.left=this.left.constrain(n.left,n.right);this.right=this.right.constrain(n.left,n.right);return this}})(); \ No newline at end of file +window.undefined=window.undefined;Ext={version:"3.2.1",versionDetail:{major:3,minor:2,patch:1}};Ext.apply=function(d,e,b){if(b){Ext.apply(d,b)}if(d&&e&&typeof e=="object"){for(var a in e){d[a]=e[a]}}return d};(function(){var g=0,s=Object.prototype.toString,t=navigator.userAgent.toLowerCase(),y=function(e){return e.test(t)},i=document,l=i.compatMode=="CSS1Compat",A=y(/opera/),h=y(/\bchrome\b/),u=y(/webkit/),x=!h&&y(/safari/),f=x&&y(/applewebkit\/4/),b=x&&y(/version\/3/),B=x&&y(/version\/4/),r=!A&&y(/msie/),p=r&&y(/msie 7/),o=r&&y(/msie 8/),q=r&&!p&&!o,n=!u&&y(/gecko/),d=n&&y(/rv:1\.8/),a=n&&y(/rv:1\.9/),v=r&&!l,z=y(/windows|win32/),k=y(/macintosh|mac os x/),j=y(/adobeair/),m=y(/linux/),c=/^https/i.test(window.location.protocol);if(q){try{i.execCommand("BackgroundImageCache",false,true)}catch(w){}}Ext.apply(Ext,{SSL_SECURE_URL:c&&r?'javascript:""':"about:blank",isStrict:l,isSecure:c,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,enableNestedListenerRemoval:false,USE_NATIVE_JSON:false,applyIf:function(C,D){if(C){for(var e in D){if(!Ext.isDefined(C[e])){C[e]=D[e]}}}return C},id:function(e,C){e=Ext.getDom(e,true)||{};if(!e.id){e.id=(C||"ext-gen")+(++g)}return e.id},extend:function(){var C=function(E){for(var D in E){this[D]=E[D]}};var e=Object.prototype.constructor;return function(J,G,I){if(typeof G=="object"){I=G;G=J;J=I.constructor!=e?I.constructor:function(){G.apply(this,arguments)}}var E=function(){},H,D=G.prototype;E.prototype=D;H=J.prototype=new E();H.constructor=J;J.superclass=D;if(D.constructor==e){D.constructor=G}J.override=function(F){Ext.override(J,F)};H.superclass=H.supr=(function(){return D});H.override=C;Ext.override(J,I);J.extend=function(F){return Ext.extend(J,F)};return J}}(),override:function(e,D){if(D){var C=e.prototype;Ext.apply(C,D);if(Ext.isIE&&D.hasOwnProperty("toString")){C.toString=D.toString}}},namespace:function(){var C,e;Ext.each(arguments,function(D){e=D.split(".");C=window[e[0]]=window[e[0]]||{};Ext.each(e.slice(1),function(E){C=C[E]=C[E]||{}})});return C},urlEncode:function(G,F){var D,C=[],E=encodeURIComponent;Ext.iterate(G,function(e,H){D=Ext.isEmpty(H);Ext.each(D?e:H,function(I){C.push("&",E(e),"=",(!Ext.isEmpty(I)&&(I!=e||!D))?(Ext.isDate(I)?Ext.encode(I).replace(/"/g,""):E(I)):"")})});if(!F){C.shift();F=""}return F+C.join("")},urlDecode:function(D,C){if(Ext.isEmpty(D)){return{}}var G={},F=D.split("&"),H=decodeURIComponent,e,E;Ext.each(F,function(I){I=I.split("=");e=H(I[0]);E=H(I[1]);G[e]=C||!G[e]?E:[].concat(G[e]).concat(E)});return G},urlAppend:function(e,C){if(!Ext.isEmpty(C)){return e+(e.indexOf("?")===-1?"?":"&")+C}return e},toArray:function(){return r?function(D,G,E,F){F=[];for(var C=0,e=D.length;C0){return setTimeout(d,c)}d();return 0}});Ext.applyIf(String,{format:function(b){var a=Ext.toArray(arguments,1);return b.replace(/\{(\d+)\}/g,function(c,d){return a[d]})}});Ext.applyIf(Array.prototype,{indexOf:function(b,c){var a=this.length;c=c||0;c+=(c<0)?a:0;for(;c
'),g=h.child("div",true);var e=g.offsetWidth;h.setStyle("overflow",(Ext.isWebKit||Ext.isGecko)?"auto":"scroll");var d=g.offsetWidth;h.remove();b=e-d+2}return b},combine:function(){var f=arguments,e=f.length,h=[];for(var g=0;gg?1:-1};Ext.each(d,function(g){f=e(f,g)==1?f:g});return f},mean:function(d){return d.length>0?Ext.sum(d)/d.length:undefined},sum:function(d){var e=0;Ext.each(d,function(f){e+=f});return e},partition:function(d,e){var f=[[],[]];Ext.each(d,function(h,j,g){f[(e&&e(h,j,g))||(!e&&h)?0:1].push(h)});return f},invoke:function(d,e){var g=[],f=Array.prototype.slice.call(arguments,2);Ext.each(d,function(h,j){if(h&&typeof h[e]=="function"){g.push(h[e].apply(h,f))}else{g.push(undefined)}});return g},pluck:function(d,f){var e=[];Ext.each(d,function(g){e.push(g[f])});return e},zip:function(){var m=Ext.partition(arguments,function(i){return typeof i!="function"}),h=m[0],l=m[1][0],d=Ext.max(Ext.pluck(h,"length")),g=[];for(var k=0;k0){for(var p=0;p=3,l={},e=function(n,o){if(n&&n.firstChild){while(o){if(o===n){return true}o=o.parentNode;if(o&&(o.nodeType!=1)){o=null}}}return false},i=function(n){return !e(n.currentTarget,Ext.lib.Event.getRelatedTarget(n))};Ext.lib.Dom={getViewWidth:function(n){return n?b.getDocumentWidth():b.getViewportWidth()},getViewHeight:function(n){return n?b.getDocumentHeight():b.getViewportHeight()},isAncestor:function(n,o){return b.isAncestor(n,o)},getRegion:function(n){return b.getRegion(n)},getY:function(n){return this.getXY(n)[1]},getX:function(n){return this.getXY(n)[0]},getXY:function(q){var o,u,w,z,t=(document.body||document.documentElement);q=Ext.getDom(q);if(q==t){return[0,0]}if(q.getBoundingClientRect){w=q.getBoundingClientRect();z=g(document).getScroll();return[Math.round(w.left+z.left),Math.round(w.top+z.top)]}var A=0,v=0;o=q;var n=g(q).getStyle("position")=="absolute";while(o){A+=o.offsetLeft;v+=o.offsetTop;if(!n&&g(o).getStyle("position")=="absolute"){n=true}if(Ext.isGecko){u=g(o);var B=parseInt(u.getStyle("borderTopWidth"),10)||0;var r=parseInt(u.getStyle("borderLeftWidth"),10)||0;A+=r;v+=B;if(o!=q&&u.getStyle("overflow")!="visible"){A+=r;v+=B}}o=o.offsetParent}if(Ext.isSafari&&n){A-=t.offsetLeft;v-=t.offsetTop}if(Ext.isGecko&&!n){var s=g(t);A+=parseInt(s.getStyle("borderLeftWidth"),10)||0;v+=parseInt(s.getStyle("borderTopWidth"),10)||0}o=q.parentNode;while(o&&o!=t){if(!Ext.isOpera||(o.tagName!="TR"&&g(o).getStyle("display")!="inline")){A-=o.scrollLeft;v-=o.scrollTop}o=o.parentNode}return[A,v]},setXY:function(n,o){n=Ext.fly(n,"_setXY");n.position();var p=n.translatePoints(o);if(o[0]!==false){n.dom.style.left=p.left+"px"}if(o[1]!==false){n.dom.style.top=p.top+"px"}},setX:function(o,n){this.setXY(o,[n,false])},setY:function(n,o){this.setXY(n,[false,o])}};Ext.lib.Event={getPageX:function(n){return m.getPageX(n.browserEvent||n)},getPageY:function(n){return m.getPageY(n.browserEvent||n)},getXY:function(n){return m.getXY(n.browserEvent||n)},getTarget:function(n){return m.getTarget(n.browserEvent||n)},getRelatedTarget:function(n){return m.getRelatedTarget(n.browserEvent||n)},on:function(r,n,q,p,o){if((n=="mouseenter"||n=="mouseleave")&&!a){var s=l[r.id]||(l[r.id]={});s[n]=q;q=q.createInterceptor(i);n=(n=="mouseenter")?"mouseover":"mouseout"}m.on(r,n,q,p,o)},un:function(p,n,o){if((n=="mouseenter"||n=="mouseleave")&&!a){var r=l[p.id],q=r&&r[n];if(q){o=q.fn;delete r[n];n=(n=="mouseenter")?"mouseover":"mouseout"}}m.removeListener(p,n,o)},purgeElement:function(n){m.purgeElement(n)},preventDefault:function(n){m.preventDefault(n.browserEvent||n)},stopPropagation:function(n){m.stopPropagation(n.browserEvent||n)},stopEvent:function(n){m.stopEvent(n.browserEvent||n)},onAvailable:function(q,p,o,n){return m.onAvailable(q,p,o,n)}};Ext.lib.Ajax={request:function(t,r,n,s,o){if(o){var p=o.headers;if(p){for(var q in p){if(p.hasOwnProperty(q)){f.initHeader(q,p[q],false)}}}if(o.xmlData){if(!p||!p["Content-Type"]){f.initHeader("Content-Type","text/xml",false)}t=(t?t:(o.method?o.method:"POST"));s=o.xmlData}else{if(o.jsonData){if(!p||!p["Content-Type"]){f.initHeader("Content-Type","application/json",false)}t=(t?t:(o.method?o.method:"POST"));s=typeof o.jsonData=="object"?Ext.encode(o.jsonData):o.jsonData}}}return f.asyncRequest(t,r,n,s)},formRequest:function(r,q,o,s,n,p){f.setForm(r,n,p);return f.asyncRequest(Ext.getDom(r).method||"POST",q,o,s)},isCallInProgress:function(n){return f.isCallInProgress(n)},abort:function(n){return f.abort(n)},serializeForm:function(n){var o=f.setForm(n.dom||n);f.resetFormState();return o}};Ext.lib.Region=YAHOO.util.Region;Ext.lib.Point=YAHOO.util.Point;Ext.lib.Anim={scroll:function(q,o,r,s,n,p){this.run(q,o,r,s,n,p,YAHOO.util.Scroll)},motion:function(q,o,r,s,n,p){this.run(q,o,r,s,n,p,YAHOO.util.Motion)},color:function(q,o,r,s,n,p){this.run(q,o,r,s,n,p,YAHOO.util.ColorAnim)},run:function(r,o,t,u,n,q,p){p=p||YAHOO.util.Anim;if(typeof u=="string"){u=YAHOO.util.Easing[u]}var s=new p(r,o,t,u);s.animateX(function(){Ext.callback(n,q)});return s}};function g(n){if(!j){j=new Ext.Element.Flyweight()}j.dom=n;return j}if(Ext.isIE){function d(){var n=Function.prototype;delete n.createSequence;delete n.defer;delete n.createDelegate;delete n.createCallback;delete n.createInterceptor;window.detachEvent("onunload",d)}window.attachEvent("onunload",d)}if(YAHOO.util.Anim){YAHOO.util.Anim.prototype.animateX=function(p,n){var o=function(){this.onComplete.unsubscribe(o);if(typeof p=="function"){p.call(n||this,this)}};this.onComplete.subscribe(o,this,true);this.animate()}}if(YAHOO.util.DragDrop&&Ext.dd.DragDrop){YAHOO.util.DragDrop.defaultPadding=Ext.dd.DragDrop.defaultPadding;YAHOO.util.DragDrop.constrainTo=Ext.dd.DragDrop.constrainTo}YAHOO.util.Dom.getXY=function(n){var o=function(p){return Ext.lib.Dom.getXY(p)};return YAHOO.util.Dom.batch(n,o,YAHOO.util.Dom,true)};if(YAHOO.util.AnimMgr){YAHOO.util.AnimMgr.fps=1000}YAHOO.util.Region.prototype.adjust=function(p,o,n,q){this.top+=p;this.left+=o;this.right+=q;this.bottom+=n;return this};YAHOO.util.Region.prototype.constrainTo=function(n){this.top=this.top.constrain(n.top,n.bottom);this.bottom=this.bottom.constrain(n.top,n.bottom);this.left=this.left.constrain(n.left,n.right);this.right=this.right.constrain(n.left,n.right);return this}})(); \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 978ddeee..c752f16e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,7 +1,7 @@ - ExtJS 3.2.0 API Documentation + ExtJS 3.2.1 API Documentation @@ -26,7 +26,7 @@
diff --git a/docs/output/Ext.Button.html b/docs/output/Ext.Button.html index 8db98132..43bbf10c 100644 --- a/docs/output/Ext.Button.html +++ b/docs/output/Ext.Button.html @@ -62,37 +62,11 @@ result in elements needing to be synchronized with the new height. Example:

< necessary, false...
true to use overflow:'auto' on the components layout element and show scroll bars automatically when necessary, false to clip any overflowing content (defaults to false).
BoxComponent autoShow : Boolean
True if the component should check for hidden classes (e.g. 'x-hidden' or 'x-hide-display') and remove them on render...
True if the component should check for hidden classes (e.g. 'x-hidden' or 'x-hide-display') and remove -them on render (defaults to false).
Component autoWidth : Boolean
True to use width:'auto', false to use fixed width (or allow it to be managed by its parent -Container's layout manage...

True to use width:'auto', false to use fixed width (or allow it to be managed by its parent -Container's layout manager. Defaults to false.

-

Note: Although many components inherit this config option, not all will -function as expected with a width of 'auto'. Setting autoWidth:true means that the -browser will manage width based on the element's contents, and that Ext will not manage it at all.

-

If the browser is managing the width, be aware that resizes performed by the browser in response -to changes within the structure of the Component cannot be detected. Therefore changes to the width might -result in elements needing to be synchronized with the new width. For example, where the target element is:

<div id='grid-container' style='margin-left:25%;width:50%'></div>
-A Panel rendered into that target element must listen for browser window resize in order to relay its -child items when the browser changes its width:
var myPanel = new Ext.Panel({
-    renderTo: 'grid-container',
-    monitorResize: true, // relay on browser resize
-    title: 'Panel',
-    height: 400,
-    autoWidth: true,
-    layout: 'hbox',
-    layoutConfig: {
-        align: 'stretch'
-    },
-    defaults: {
-        flex: 1
-    },
-    items: [{
-        title: 'Box 1',
-    }, {
-        title: 'Box 2'
-    }, {
-        title: 'Box 3'
-    }],
-});
BoxComponent boxMaxHeight : Number
The maximum value in pixels which this BoxComponent will set its height to. +them on render (defaults to false).
Component autoWidth : Boolean
By default, if a width is not specified the button will attempt to stretch horizontally to fit its content. +If the bu...
By default, if a width is not specified the button will attempt to stretch horizontally to fit its content. +If the button is being managed by a width sizing layout (hbox, fit, anchor), set this to false to prevent +the button from doing this automatic sizing. +Defaults to undefined.
Button boxMaxHeight : Number
The maximum value in pixels which this BoxComponent will set its height to. Warning: This will override any size mana...

The maximum value in pixels which this BoxComponent will set its height to.

Warning: This will override any size management applied by layout managers.

BoxComponent boxMaxWidth : Number
The maximum value in pixels which this BoxComponent will set its width to. Warning: This will override any size manag...

The maximum value in pixels which this BoxComponent will set its width to.

diff --git a/docs/output/Ext.ButtonGroup.html b/docs/output/Ext.ButtonGroup.html index 78f1d103..77c83fa5 100644 --- a/docs/output/Ext.ButtonGroup.html +++ b/docs/output/Ext.ButtonGroup.html @@ -941,9 +941,7 @@ Note: see the Note for el al...
The Panel's header

Note: see the Note for el also.

Panel hidden : Boolean
True if this component is hidden. Read-only.
Component initialConfig : Object
This Component's initial configuration specification. Read-only.
Component items : MixedCollection
The collection of components in this container as a Ext.util.MixedCollection
Container ownerCt : Ext.Container
This Component's owner Container (defaults to undefined, and is set automatically when this Component is added to a C...
This Component's owner Container (defaults to undefined, and is set automatically when this Component is added to a Container). Read-only. -

Note: to access items within the Container see itemId.

Component private : Object
We can only lay out if there is a view area in which to layout. -display:none on the layout target, *or any of its par...
We can only lay out if there is a view area in which to layout. -display:none on the layout target, *or any of its parent elements* will mean it has no view area.
Container refOwner : Ext.Container
The ancestor Container into which the ref reference was inserted if this Component +

Note: to access items within the Container see itemId.

Component refOwner : Ext.Container
The ancestor Container into which the ref reference was inserted if this Component is a child of a Container, and has...
The ancestor Container into which the ref reference was inserted if this Component is a child of a Container, and has been configured with a ref.
Component rendered : Boolean
True if this component has been rendered. Read-only.
Component

Public Methods

MethodDefined By
 hidden : Boolean
True if this component is hidden. Read-only.
Component
 initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
 items : MixedCollection
The collection of components in this container as a Ext.util.MixedCollection
Container
 rendered : Boolean
True if this component has been rendered. Read-only.
Component

Public Methods

MethodDefined By
 rendered : Boolean
True if this component has been rendered. Read-only.
Component

Public Methods

MethodDefined By
 hidden : Boolean
True if this component is hidden. Read-only.
Component
 initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
 items : MixedCollection
The collection of components in this container as a Ext.util.MixedCollection
Container
 rendered : Boolean
True if this component has been rendered. Read-only.
Component

Public Methods

MethodDefined By
 hidden : Boolean
True if this component is hidden. Read-only.
Component
 initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
 items : MixedCollection
The collection of components in this container as a Ext.util.MixedCollection
Container
 rendered : Boolean
True if this component has been rendered. Read-only.
Component
 hidden : Boolean
True if this component is hidden. Read-only.
Component
 initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
 items : MixedCollection
The collection of components in this container as a Ext.util.MixedCollection
Container
 rendered : Boolean
True if this component has been rendered. Read-only.
Component

Public Methods

MethodDefined By
 hidden : Boolean
True if this component is hidden. Read-only.
Component
 initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
 items : MixedCollection
The collection of components in this container as a Ext.util.MixedCollection
Container
 rendered : Boolean
True if this component has been rendered. Read-only.
Component

Public Methods

MethodDefined By
 hidden : Boolean
True if this component is hidden. Read-only.
Component
 initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
 items : MixedCollection
The collection of components in this container as a Ext.util.MixedCollection
Container
 rendered : Boolean
True if this component has been rendered. Read-only.
Component
 hidden : Boolean
True if this component is hidden. Read-only.
Component
 initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
 items : MixedCollection
The collection of components in this container as a Ext.util.MixedCollection
Container
 rendered : Boolean
True if this component has been rendered. Read-only.
Component

Public Methods

MethodDefined By
 hidden : Boolean
True if this component is hidden. Read-only.
Component
 initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
 items : MixedCollection
The collection of components in this container as a Ext.util.MixedCollection
Container
 rendered : Boolean
True if this component has been rendered. Read-only.
Component

Public Methods

< Defaults to Ext.emptyFn.
MethodDefined By
 rendered : Boolean
True if this component has been rendered. Read-only.
Component

Public Methods

MethodDefined By
 hidden : Boolean
True if this component is hidden. Read-only.
Component
 initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
 hidden : Boolean
True if this component is hidden. Read-only.
Component
 initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
 keyNav : Ext.KeyNav +<p>A {@link Ext.KeyNav KeyNav} object which handles navigation keys for this ComboBox. This performs actions +based on keystrokes typed when the input field is focused.</p> +<p><b>After the ComboBox has been rendered</b>, you may override existing navigation key functionality, +or add your own based upon key names as specified in the {@link Ext.KeyNav KeyNav} class.</p> +<p>The function is executed in the scope (<code>this</code> reference of the ComboBox. Example:</p><pre><code> +myCombo.keyNav.esc = function(e) { // Override ESC handling function + this.collapse(); // Standard behaviour of Ext's ComboBox. + this.setValue(this.startValue); // We reset to starting value on ESC +}; +myCombo.keyNav.tab = function() { // Override TAB handling function + this.onViewClick(false); // Select the currently highlighted row +}; +</code></pre>
ComboBox
 hidden : Boolean
True if this component is hidden. Read-only.
Component
 initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
 items : MixedCollection
The collection of components in this container as a Ext.util.MixedCollection
Container
 rendered : Boolean
True if this component has been rendered. Read-only.
Component

Public Methods

MethodDefined By
 hidden : Boolean
True if this component is hidden. Read-only.
Component
 initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
 items : MixedCollection
The collection of components in this container as a Ext.util.MixedCollection
Container
 rendered : Boolean
True if this component has been rendered. Read-only.
Component

Public Methods

MethodDefined By
 hidden : Boolean
True if this component is hidden. Read-only.
Component
 initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
 hidden : Boolean
True if this component is hidden. Read-only.
Component
 initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
 keyNav : Ext.KeyNav +<p>A {@link Ext.KeyNav KeyNav} object which handles navigation keys for this ComboBox. This performs actions +based on keystrokes typed when the input field is focused.</p> +<p><b>After the ComboBox has been rendered</b>, you may override existing navigation key functionality, +or add your own based upon key names as specified in the {@link Ext.KeyNav KeyNav} class.</p> +<p>The function is executed in the scope (<code>this</code> reference of the ComboBox. Example:</p><pre><code> +myCombo.keyNav.esc = function(e) { // Override ESC handling function + this.collapse(); // Standard behaviour of Ext's ComboBox. + this.setValue(this.startValue); // We reset to starting value on ESC +}; +myCombo.keyNav.tab = function() { // Override TAB handling function + this.onViewClick(false); // Select the currently highlighted row +}; +</code></pre>
ComboBox
 alphanumMask : RegExp
The keystroke filter mask to be applied on alphanumeric input. Defaults to: /[a-z0-9_]/i
VTypes
 hidden : Boolean
True if this component is hidden. Read-only.
Component
 initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
 rendered : Boolean
True if this component has been rendered. Read-only.
Component

Public Methods

MethodDefined By
 hidden : Boolean
True if this component is hidden. Read-only.
Component
 initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
 rendered : Boolean
True if this component has been rendered. Read-only.
Component

Public Methods

MethodDefined By
 hidden : Boolean
True if this component is hidden. Read-only.
Component
 initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
 rendered : Boolean
True if this component has been rendered. Read-only.
Component

Public Methods

' + ); + } + + for(var k in ts){ + var t = ts[k]; + if(t && Ext.isFunction(t.compile) && !t.compiled){ + t.disableFormats = true; + t.compile(); + } + } + + this.templates = ts; + this.colRe = new RegExp('x-grid3-td-([^\\s]+)', ''); + }, + + // private + fly : function(el){ + if(!this._flyweight){ + this._flyweight = new Ext.Element.Flyweight(document.body); + } + this._flyweight.dom = el; + return this._flyweight; + }, + + // private + getEditorParent : function(){ + return this.scroller.dom; + }, + + // private + initElements : function(){ + var E = Ext.Element; + + var el = this.grid.getGridEl().dom.firstChild; + var cs = el.childNodes; + + this.el = new E(el); + + this.mainWrap = new E(cs[0]); + this.mainHd = new E(this.mainWrap.dom.firstChild); + + if(this.grid.hideHeaders){ + this.mainHd.setDisplayed(false); + } + + this.innerHd = this.mainHd.dom.firstChild; + this.scroller = new E(this.mainWrap.dom.childNodes[1]); + if(this.forceFit){ + this.scroller.setStyle('overflow-x', 'hidden'); + } + /** + * Read-only. The GridView's body Element which encapsulates all rows in the Grid. + * This {@link Ext.Element Element} is only available after the GridPanel has been rendered. + * @type Ext.Element + * @property mainBody + */ + this.mainBody = new E(this.scroller.dom.firstChild); + + this.focusEl = new E(this.scroller.dom.childNodes[1]); + this.focusEl.swallowEvent('click', true); + + this.resizeMarker = new E(cs[1]); + this.resizeProxy = new E(cs[2]); + }, + + // private + getRows : function(){ + return this.hasRows() ? this.mainBody.dom.childNodes : []; + }, + + // finder methods, used with delegation + + // private + findCell : function(el){ + if(!el){ + return false; + } + return this.fly(el).findParent(this.cellSelector, this.cellSelectorDepth); + }, + + /** + *

Return the index of the grid column which contains the passed HTMLElement.

+ * See also {@link #findRowIndex} + * @param {HTMLElement} el The target element + * @return {Number} The column index, or false if the target element is not within a row of this GridView. + */ + findCellIndex : function(el, requiredCls){ + var cell = this.findCell(el); + if(cell && (!requiredCls || this.fly(cell).hasClass(requiredCls))){ + return this.getCellIndex(cell); + } + return false; + }, + + // private + getCellIndex : function(el){ + if(el){ + var m = el.className.match(this.colRe); + if(m && m[1]){ + return this.cm.getIndexById(m[1]); + } + } + return false; + }, + + // private + findHeaderCell : function(el){ + var cell = this.findCell(el); + return cell && this.fly(cell).hasClass(this.hdCls) ? cell : null; + }, + + // private + findHeaderIndex : function(el){ + return this.findCellIndex(el, this.hdCls); + }, + + /** + * Return the HtmlElement representing the grid row which contains the passed element. + * @param {HTMLElement} el The target HTMLElement + * @return {HTMLElement} The row element, or null if the target element is not within a row of this GridView. + */ + findRow : function(el){ + if(!el){ + return false; + } + return this.fly(el).findParent(this.rowSelector, this.rowSelectorDepth); + }, + + /** + *

Return the index of the grid row which contains the passed HTMLElement.

+ * See also {@link #findCellIndex} + * @param {HTMLElement} el The target HTMLElement + * @return {Number} The row index, or false if the target element is not within a row of this GridView. + */ + findRowIndex : function(el){ + var r = this.findRow(el); + return r ? r.rowIndex : false; + }, + + /** + * Return the HtmlElement representing the grid row body which contains the passed element. + * @param {HTMLElement} el The target HTMLElement + * @return {HTMLElement} The row body element, or null if the target element is not within a row body of this GridView. + */ + findRowBody : function(el){ + if(!el){ + return false; + } + return this.fly(el).findParent(this.rowBodySelector, this.rowBodySelectorDepth); + }, + + // getter methods for fetching elements dynamically in the grid + + /** + * Return the <div> HtmlElement which represents a Grid row for the specified index. + * @param {Number} index The row index + * @return {HtmlElement} The div element. + */ + getRow : function(row){ + return this.getRows()[row]; + }, + + /** + * Returns the grid's <td> HtmlElement at the specified coordinates. + * @param {Number} row The row index in which to find the cell. + * @param {Number} col The column index of the cell. + * @return {HtmlElement} The td at the specified coordinates. + */ + getCell : function(row, col){ + return this.getRow(row).getElementsByTagName('td')[col]; + }, + + /** + * Return the <td> HtmlElement which represents the Grid's header cell for the specified column index. + * @param {Number} index The column index + * @return {HtmlElement} The td element. + */ + getHeaderCell : function(index){ + return this.mainHd.dom.getElementsByTagName('td')[index]; + }, + + // manipulating elements + + // private - use getRowClass to apply custom row classes + addRowClass : function(row, cls){ + var r = this.getRow(row); + if(r){ + this.fly(r).addClass(cls); + } + }, + + // private + removeRowClass : function(row, cls){ + var r = this.getRow(row); + if(r){ + this.fly(r).removeClass(cls); + } + }, + + // private + removeRow : function(row){ + Ext.removeNode(this.getRow(row)); + this.syncFocusEl(row); + }, + + // private + removeRows : function(firstRow, lastRow){ + var bd = this.mainBody.dom; + for(var rowIndex = firstRow; rowIndex <= lastRow; rowIndex++){ + Ext.removeNode(bd.childNodes[firstRow]); + } + this.syncFocusEl(firstRow); + }, + + // scrolling stuff + + // private + getScrollState : function(){ + var sb = this.scroller.dom; + return {left: sb.scrollLeft, top: sb.scrollTop}; + }, + + // private + restoreScroll : function(state){ + var sb = this.scroller.dom; + sb.scrollLeft = state.left; + sb.scrollTop = state.top; + }, + + /** + * Scrolls the grid to the top + */ + scrollToTop : function(){ + this.scroller.dom.scrollTop = 0; + this.scroller.dom.scrollLeft = 0; + }, + + // private + syncScroll : function(){ + this.syncHeaderScroll(); + var mb = this.scroller.dom; + this.grid.fireEvent('bodyscroll', mb.scrollLeft, mb.scrollTop); + }, + + // private + syncHeaderScroll : function(){ + var mb = this.scroller.dom; + this.innerHd.scrollLeft = mb.scrollLeft; + this.innerHd.scrollLeft = mb.scrollLeft; // second time for IE (1/2 time first fails, other browsers ignore) + }, + + // private + updateSortIcon : function(col, dir){ + var sc = this.sortClasses; + var hds = this.mainHd.select('td').removeClass(sc); + hds.item(col).addClass(sc[dir == 'DESC' ? 1 : 0]); + }, + + // private + updateAllColumnWidths : function(){ + var tw = this.getTotalWidth(), + clen = this.cm.getColumnCount(), + ws = [], + len, + i; + + for(i = 0; i < clen; i++){ + ws[i] = this.getColumnWidth(i); + } + + this.innerHd.firstChild.style.width = this.getOffsetWidth(); + this.innerHd.firstChild.firstChild.style.width = tw; + this.mainBody.dom.style.width = tw; + + for(i = 0; i < clen; i++){ + var hd = this.getHeaderCell(i); + hd.style.width = ws[i]; + } + + var ns = this.getRows(), row, trow; + for(i = 0, len = ns.length; i < len; i++){ + row = ns[i]; + row.style.width = tw; + if(row.firstChild){ + row.firstChild.style.width = tw; + trow = row.firstChild.rows[0]; + for (var j = 0; j < clen; j++) { + trow.childNodes[j].style.width = ws[j]; + } + } + } + + this.onAllColumnWidthsUpdated(ws, tw); + }, + + // private + updateColumnWidth : function(col, width){ + var w = this.getColumnWidth(col); + var tw = this.getTotalWidth(); + this.innerHd.firstChild.style.width = this.getOffsetWidth(); + this.innerHd.firstChild.firstChild.style.width = tw; + this.mainBody.dom.style.width = tw; + var hd = this.getHeaderCell(col); + hd.style.width = w; + + var ns = this.getRows(), row; + for(var i = 0, len = ns.length; i < len; i++){ + row = ns[i]; + row.style.width = tw; + if(row.firstChild){ + row.firstChild.style.width = tw; + row.firstChild.rows[0].childNodes[col].style.width = w; + } + } + + this.onColumnWidthUpdated(col, w, tw); + }, + + // private + updateColumnHidden : function(col, hidden){ + var tw = this.getTotalWidth(); + this.innerHd.firstChild.style.width = this.getOffsetWidth(); + this.innerHd.firstChild.firstChild.style.width = tw; + this.mainBody.dom.style.width = tw; + var display = hidden ? 'none' : ''; + + var hd = this.getHeaderCell(col); + hd.style.display = display; + + var ns = this.getRows(), row; + for(var i = 0, len = ns.length; i < len; i++){ + row = ns[i]; + row.style.width = tw; + if(row.firstChild){ + row.firstChild.style.width = tw; + row.firstChild.rows[0].childNodes[col].style.display = display; + } + } + + this.onColumnHiddenUpdated(col, hidden, tw); + delete this.lastViewWidth; // force recalc + this.layout(); + }, + + /** + * @private + * Renders all of the rows to a string buffer and returns the string. This is called internally + * by renderRows and performs the actual string building for the rows - it does not inject HTML into the DOM. + * @param {Array} columns The column data acquired from getColumnData. + * @param {Array} records The array of records to render + * @param {Ext.data.Store} store The store to render the rows from + * @param {Number} startRow The index of the first row being rendered. Sometimes we only render a subset of + * the rows so this is used to maintain logic for striping etc + * @param {Number} colCount The total number of columns in the column model + * @param {Boolean} stripe True to stripe the rows + * @return {String} A string containing the HTML for the rendered rows + */ + doRender : function(columns, records, store, startRow, colCount, stripe) { + var templates = this.templates, + cellTemplate = templates.cell, + rowTemplate = templates.row, + last = colCount - 1; + + var tstyle = 'width:' + this.getTotalWidth() + ';'; + + // buffers + var rowBuffer = [], + colBuffer = [], + rowParams = {tstyle: tstyle}, + meta = {}, + column, + record; + + //build up each row's HTML + for (var j = 0, len = records.length; j < len; j++) { + record = records[j]; + colBuffer = []; + + var rowIndex = j + startRow; + + //build up each column's HTML + for (var i = 0; i < colCount; i++) { + column = columns[i]; + + meta.id = column.id; + meta.css = i === 0 ? 'x-grid3-cell-first ' : (i == last ? 'x-grid3-cell-last ' : ''); + meta.attr = meta.cellAttr = ''; + meta.style = column.style; + meta.value = column.renderer.call(column.scope, record.data[column.name], meta, record, rowIndex, i, store); + + if (Ext.isEmpty(meta.value)) { + meta.value = ' '; + } + + if (this.markDirty && record.dirty && Ext.isDefined(record.modified[column.name])) { + meta.css += ' x-grid3-dirty-cell'; + } + + colBuffer[colBuffer.length] = cellTemplate.apply(meta); + } + + //set up row striping and row dirtiness CSS classes + var alt = []; + + if (stripe && ((rowIndex + 1) % 2 === 0)) { + alt[0] = 'x-grid3-row-alt'; + } + + if (record.dirty) { + alt[1] = ' x-grid3-dirty-row'; + } + + rowParams.cols = colCount; + + if (this.getRowClass) { + alt[2] = this.getRowClass(record, rowIndex, rowParams, store); + } + + rowParams.alt = alt.join(' '); + rowParams.cells = colBuffer.join(''); + + rowBuffer[rowBuffer.length] = rowTemplate.apply(rowParams); + } + + return rowBuffer.join(''); + }, + + // private + processRows : function(startRow, skipStripe) { + if (!this.ds || this.ds.getCount() < 1) { + return; + } + + var rows = this.getRows(), + len = rows.length, + i, r; + + skipStripe = skipStripe || !this.grid.stripeRows; + startRow = startRow || 0; + + for (i = 0; i= this.ds.getCount()){ + return null; + } + col = (col !== undefined ? col : 0); + + var rowEl = this.getRow(row), + cm = this.cm, + colCount = cm.getColumnCount(), + cellEl; + if(!(hscroll === false && col === 0)){ + while(col < colCount && cm.isHidden(col)){ + col++; + } + cellEl = this.getCell(row, col); + } + + return {row: rowEl, cell: cellEl}; + }, + + getResolvedXY : function(resolved){ + if(!resolved){ + return null; + } + var s = this.scroller.dom, c = resolved.cell, r = resolved.row; + return c ? Ext.fly(c).getXY() : [this.el.getX(), Ext.fly(r).getY()]; + }, + + syncFocusEl : function(row, col, hscroll){ + var xy = row; + if(!Ext.isArray(xy)){ + row = Math.min(row, Math.max(0, this.getRows().length-1)); + if (isNaN(row)) { + return; + } + xy = this.getResolvedXY(this.resolveCell(row, col, hscroll)); + } + this.focusEl.setXY(xy||this.scroller.getXY()); + }, + + ensureVisible : function(row, col, hscroll){ + var resolved = this.resolveCell(row, col, hscroll); + if(!resolved || !resolved.row){ + return; + } + + var rowEl = resolved.row, + cellEl = resolved.cell, + c = this.scroller.dom, + ctop = 0, + p = rowEl, + stop = this.el.dom; + + while(p && p != stop){ + ctop += p.offsetTop; + p = p.offsetParent; + } + + ctop -= this.mainHd.dom.offsetHeight; + stop = parseInt(c.scrollTop, 10); + + var cbot = ctop + rowEl.offsetHeight, + ch = c.clientHeight, + sbot = stop + ch; + + + if(ctop < stop){ + c.scrollTop = ctop; + }else if(cbot > sbot){ + c.scrollTop = cbot-ch; + } + + if(hscroll !== false){ + var cleft = parseInt(cellEl.offsetLeft, 10); + var cright = cleft + cellEl.offsetWidth; + + var sleft = parseInt(c.scrollLeft, 10); + var sright = sleft + c.clientWidth; + if(cleft < sleft){ + c.scrollLeft = cleft; + }else if(cright > sright){ + c.scrollLeft = cright-c.clientWidth; + } + } + return this.getResolvedXY(resolved); + }, + + // private + insertRows : function(dm, firstRow, lastRow, isUpdate) { + var last = dm.getCount() - 1; + if( !isUpdate && firstRow === 0 && lastRow >= last) { + this.fireEvent('beforerowsinserted', this, firstRow, lastRow); + this.refresh(); + this.fireEvent('rowsinserted', this, firstRow, lastRow); + } else { + if (!isUpdate) { + this.fireEvent('beforerowsinserted', this, firstRow, lastRow); + } + var html = this.renderRows(firstRow, lastRow), + before = this.getRow(firstRow); + if (before) { + if(firstRow === 0){ + Ext.fly(this.getRow(0)).removeClass(this.firstRowCls); + } + Ext.DomHelper.insertHtml('beforeBegin', before, html); + } else { + var r = this.getRow(last - 1); + if(r){ + Ext.fly(r).removeClass(this.lastRowCls); + } + Ext.DomHelper.insertHtml('beforeEnd', this.mainBody.dom, html); + } + if (!isUpdate) { + this.fireEvent('rowsinserted', this, firstRow, lastRow); + this.processRows(firstRow); + } else if (firstRow === 0 || firstRow >= last) { + //ensure first/last row is kept after an update. + Ext.fly(this.getRow(firstRow)).addClass(firstRow === 0 ? this.firstRowCls : this.lastRowCls); + } + } + this.syncFocusEl(firstRow); + }, + + // private + deleteRows : function(dm, firstRow, lastRow){ + if(dm.getRowCount()<1){ + this.refresh(); + }else{ + this.fireEvent('beforerowsdeleted', this, firstRow, lastRow); + + this.removeRows(firstRow, lastRow); + + this.processRows(firstRow); + this.fireEvent('rowsdeleted', this, firstRow, lastRow); + } + }, + + // private + getColumnStyle : function(col, isHeader){ + var style = !isHeader ? (this.cm.config[col].css || '') : ''; + style += 'width:'+this.getColumnWidth(col)+';'; + if(this.cm.isHidden(col)){ + style += 'display:none;'; + } + var align = this.cm.config[col].align; + if(align){ + style += 'text-align:'+align+';'; + } + return style; + }, + + // private + getColumnWidth : function(col){ + var w = this.cm.getColumnWidth(col); + if(Ext.isNumber(w)){ + return (Ext.isBorderBox || (Ext.isWebKit && !Ext.isSafari2) ? w : (w - this.borderWidth > 0 ? w - this.borderWidth : 0)) + 'px'; + } + return w; + }, + + // private + getTotalWidth : function(){ + return this.cm.getTotalWidth()+'px'; + }, + + // private + fitColumns : function(preventRefresh, onlyExpand, omitColumn){ + var cm = this.cm, i; + var tw = cm.getTotalWidth(false); + var aw = this.grid.getGridEl().getWidth(true)-this.getScrollOffset(); + + if(aw < 20){ // not initialized, so don't screw up the default widths + return; + } + var extra = aw - tw; + + if(extra === 0){ + return false; + } + + var vc = cm.getColumnCount(true); + var ac = vc-(Ext.isNumber(omitColumn) ? 1 : 0); + if(ac === 0){ + ac = 1; + omitColumn = undefined; + } + var colCount = cm.getColumnCount(); + var cols = []; + var extraCol = 0; + var width = 0; + var w; + for (i = 0; i < colCount; i++){ + if(!cm.isHidden(i) && !cm.isFixed(i) && i !== omitColumn){ + w = cm.getColumnWidth(i); + cols.push(i); + extraCol = i; + cols.push(w); + width += w; + } + } + var frac = (aw - cm.getTotalWidth())/width; + while (cols.length){ + w = cols.pop(); + i = cols.pop(); + cm.setColumnWidth(i, Math.max(this.grid.minColumnWidth, Math.floor(w + w*frac)), true); + } + + if((tw = cm.getTotalWidth(false)) > aw){ + var adjustCol = ac != vc ? omitColumn : extraCol; + cm.setColumnWidth(adjustCol, Math.max(1, + cm.getColumnWidth(adjustCol)- (tw-aw)), true); + } + + if(preventRefresh !== true){ + this.updateAllColumnWidths(); + } + + + return true; + }, + + // private + autoExpand : function(preventUpdate){ + var g = this.grid, cm = this.cm; + if(!this.userResized && g.autoExpandColumn){ + var tw = cm.getTotalWidth(false); + var aw = this.grid.getGridEl().getWidth(true)-this.getScrollOffset(); + if(tw != aw){ + var ci = cm.getIndexById(g.autoExpandColumn); + var currentWidth = cm.getColumnWidth(ci); + var cw = Math.min(Math.max(((aw-tw)+currentWidth), g.autoExpandMin), g.autoExpandMax); + if(cw != currentWidth){ + cm.setColumnWidth(ci, cw, true); + if(preventUpdate !== true){ + this.updateColumnWidth(ci, cw); + } + } + } + } + }, + + /** + * @private + * Returns an array of column configurations - one for each column + * @return {Array} Array of column config objects. This includes the column name, renderer, id style and renderer + */ + getColumnData : function(){ + // build a map for all the columns + var cs = [], + cm = this.cm, + colCount = cm.getColumnCount(); + + for (var i = 0; i < colCount; i++) { + var name = cm.getDataIndex(i); + + cs[i] = { + name : (!Ext.isDefined(name) ? this.ds.fields.get(i).name : name), + renderer: cm.getRenderer(i), + scope : cm.getRendererScope(i), + id : cm.getColumnId(i), + style : this.getColumnStyle(i) + }; + } + + return cs; + }, + + // private + renderRows : function(startRow, endRow){ + // pull in all the crap needed to render rows + var g = this.grid, cm = g.colModel, ds = g.store, stripe = g.stripeRows; + var colCount = cm.getColumnCount(); + + if(ds.getCount() < 1){ + return ''; + } + + var cs = this.getColumnData(); + + startRow = startRow || 0; + endRow = !Ext.isDefined(endRow) ? ds.getCount()-1 : endRow; + + // records to render + var rs = ds.getRange(startRow, endRow); + + return this.doRender(cs, rs, ds, startRow, colCount, stripe); + }, + + // private + renderBody : function(){ + var markup = this.renderRows() || ' '; + return this.templates.body.apply({rows: markup}); + }, + + // private + refreshRow : function(record){ + var ds = this.ds, index; + if(Ext.isNumber(record)){ + index = record; + record = ds.getAt(index); + if(!record){ + return; + } + }else{ + index = ds.indexOf(record); + if(index < 0){ + return; + } + } + this.insertRows(ds, index, index, true); + this.getRow(index).rowIndex = index; + this.onRemove(ds, record, index+1, true); + this.fireEvent('rowupdated', this, index, record); + }, + + /** + * Refreshs the grid UI + * @param {Boolean} headersToo (optional) True to also refresh the headers + */ + refresh : function(headersToo){ + this.fireEvent('beforerefresh', this); + this.grid.stopEditing(true); + + var result = this.renderBody(); + this.mainBody.update(result).setWidth(this.getTotalWidth()); + if(headersToo === true){ + this.updateHeaders(); + this.updateHeaderSortState(); + } + this.processRows(0, true); + this.layout(); + this.applyEmptyText(); + this.fireEvent('refresh', this); + }, + + /** + * @private + * Displays the configured emptyText if there are currently no rows to display + */ + applyEmptyText : function(){ + if(this.emptyText && !this.hasRows()){ + this.mainBody.update('
' + this.emptyText + '
'); + } + }, + + /** + * @private + * Adds sorting classes to the column headers based on the bound store's sortInfo. Fires the 'sortchange' event + * if the sorting has changed since this function was last run. + */ + updateHeaderSortState : function(){ + var state = this.ds.getSortState(); + if (!state) { + return; + } + + if (!this.sortState || (this.sortState.field != state.field || this.sortState.direction != state.direction)) { + this.grid.fireEvent('sortchange', this.grid, state); + } + + this.sortState = state; + + var sortColumn = this.cm.findColumnIndex(state.field); + if (sortColumn != -1){ + var sortDir = state.direction; + this.updateSortIcon(sortColumn, sortDir); + } + }, + + /** + * @private + * Removes any sorting indicator classes from the column headers + */ + clearHeaderSortState : function(){ + if (!this.sortState) { + return; + } + this.grid.fireEvent('sortchange', this.grid, null); + this.mainHd.select('td').removeClass(this.sortClasses); + delete this.sortState; + }, + + // private + destroy : function(){ + if (this.scrollToTopTask && this.scrollToTopTask.cancel){ + this.scrollToTopTask.cancel(); + } + if(this.colMenu){ + Ext.menu.MenuMgr.unregister(this.colMenu); + this.colMenu.destroy(); + delete this.colMenu; + } + if(this.hmenu){ + Ext.menu.MenuMgr.unregister(this.hmenu); + this.hmenu.destroy(); + delete this.hmenu; + } + + this.initData(null, null); + this.purgeListeners(); + Ext.fly(this.innerHd).un("click", this.handleHdDown, this); + + if(this.grid.enableColumnMove){ + Ext.destroy( + this.columnDrag.el, + this.columnDrag.proxy.ghost, + this.columnDrag.proxy.el, + this.columnDrop.el, + this.columnDrop.proxyTop, + this.columnDrop.proxyBottom, + this.columnDrag.dragData.ddel, + this.columnDrag.dragData.header + ); + if (this.columnDrag.proxy.anim) { + Ext.destroy(this.columnDrag.proxy.anim); + } + delete this.columnDrag.proxy.ghost; + delete this.columnDrag.dragData.ddel; + delete this.columnDrag.dragData.header; + this.columnDrag.destroy(); + delete Ext.dd.DDM.locationCache[this.columnDrag.id]; + delete this.columnDrag._domRef; + + delete this.columnDrop.proxyTop; + delete this.columnDrop.proxyBottom; + this.columnDrop.destroy(); + delete Ext.dd.DDM.locationCache["gridHeader" + this.grid.getGridEl().id]; + delete this.columnDrop._domRef; + delete Ext.dd.DDM.ids[this.columnDrop.ddGroup]; + } + + if (this.splitZone){ // enableColumnResize + this.splitZone.destroy(); + delete this.splitZone._domRef; + delete Ext.dd.DDM.ids["gridSplitters" + this.grid.getGridEl().id]; + } + + Ext.fly(this.innerHd).removeAllListeners(); + Ext.removeNode(this.innerHd); + delete this.innerHd; + + Ext.destroy( + this.el, + this.mainWrap, + this.mainHd, + this.scroller, + this.mainBody, + this.focusEl, + this.resizeMarker, + this.resizeProxy, + this.activeHdBtn, + this.dragZone, + this.splitZone, + this._flyweight + ); + + delete this.grid.container; + + if(this.dragZone){ + this.dragZone.destroy(); + } + + Ext.dd.DDM.currentTarget = null; + delete Ext.dd.DDM.locationCache[this.grid.getGridEl().id]; + + Ext.EventManager.removeResizeListener(this.onWindowResize, this); + }, + + // private + onDenyColumnHide : function(){ + + }, + + // private + render : function(){ + if(this.autoFill){ + var ct = this.grid.ownerCt; + if (ct && ct.getLayout()){ + ct.on('afterlayout', function(){ + this.fitColumns(true, true); + this.updateHeaders(); + }, this, {single: true}); + }else{ + this.fitColumns(true, true); + } + }else if(this.forceFit){ + this.fitColumns(true, false); + }else if(this.grid.autoExpandColumn){ + this.autoExpand(true); + } + + this.renderUI(); + }, + + /* --------------------------------- Model Events and Handlers --------------------------------*/ + // private + initData : function(ds, cm){ + if(this.ds){ + this.ds.un('load', this.onLoad, this); + this.ds.un('datachanged', this.onDataChange, this); + this.ds.un('add', this.onAdd, this); + this.ds.un('remove', this.onRemove, this); + this.ds.un('update', this.onUpdate, this); + this.ds.un('clear', this.onClear, this); + if(this.ds !== ds && this.ds.autoDestroy){ + this.ds.destroy(); + } + } + if(ds){ + ds.on({ + scope: this, + load: this.onLoad, + datachanged: this.onDataChange, + add: this.onAdd, + remove: this.onRemove, + update: this.onUpdate, + clear: this.onClear + }); + } + this.ds = ds; + + if(this.cm){ + this.cm.un('configchange', this.onColConfigChange, this); + this.cm.un('widthchange', this.onColWidthChange, this); + this.cm.un('headerchange', this.onHeaderChange, this); + this.cm.un('hiddenchange', this.onHiddenChange, this); + this.cm.un('columnmoved', this.onColumnMove, this); + } + if(cm){ + delete this.lastViewWidth; + cm.on({ + scope: this, + configchange: this.onColConfigChange, + widthchange: this.onColWidthChange, + headerchange: this.onHeaderChange, + hiddenchange: this.onHiddenChange, + columnmoved: this.onColumnMove + }); + } + this.cm = cm; + }, + + // private + onDataChange : function(){ + this.refresh(); + this.updateHeaderSortState(); + this.syncFocusEl(0); + }, + + // private + onClear : function(){ + this.refresh(); + this.syncFocusEl(0); + }, + + // private + onUpdate : function(ds, record){ + this.refreshRow(record); + }, + + // private + onAdd : function(ds, records, index){ + this.insertRows(ds, index, index + (records.length-1)); + }, + + // private + onRemove : function(ds, record, index, isUpdate){ + if(isUpdate !== true){ + this.fireEvent('beforerowremoved', this, index, record); + } + this.removeRow(index); + if(isUpdate !== true){ + this.processRows(index); + this.applyEmptyText(); + this.fireEvent('rowremoved', this, index, record); + } + }, + + // private + onLoad : function(){ + if (Ext.isGecko){ + if (!this.scrollToTopTask) { + this.scrollToTopTask = new Ext.util.DelayedTask(this.scrollToTop, this); + } + this.scrollToTopTask.delay(1); + }else{ + this.scrollToTop(); + } + }, + + // private + onColWidthChange : function(cm, col, width){ + this.updateColumnWidth(col, width); + }, + + // private + onHeaderChange : function(cm, col, text){ + this.updateHeaders(); + }, + + // private + onHiddenChange : function(cm, col, hidden){ + this.updateColumnHidden(col, hidden); + }, + + // private + onColumnMove : function(cm, oldIndex, newIndex){ + this.indexMap = null; + var s = this.getScrollState(); + this.refresh(true); + this.restoreScroll(s); + this.afterMove(newIndex); + this.grid.fireEvent('columnmove', oldIndex, newIndex); + }, + + // private + onColConfigChange : function(){ + delete this.lastViewWidth; + this.indexMap = null; + this.refresh(true); + }, + + /* -------------------- UI Events and Handlers ------------------------------ */ + // private + initUI : function(grid){ + grid.on('headerclick', this.onHeaderClick, this); + }, + + // private + initEvents : function(){ + }, + + // private + onHeaderClick : function(g, index){ + if(this.headersDisabled || !this.cm.isSortable(index)){ + return; + } + g.stopEditing(true); + g.store.sort(this.cm.getDataIndex(index)); + }, + + // private + onRowOver : function(e, t){ + var row; + if((row = this.findRowIndex(t)) !== false){ + this.addRowClass(row, 'x-grid3-row-over'); + } + }, + + // private + onRowOut : function(e, t){ + var row; + if((row = this.findRowIndex(t)) !== false && !e.within(this.getRow(row), true)){ + this.removeRowClass(row, 'x-grid3-row-over'); + } + }, + + // private + handleWheel : function(e){ + e.stopPropagation(); + }, + + // private + onRowSelect : function(row){ + this.addRowClass(row, this.selectedRowClass); + }, + + // private + onRowDeselect : function(row){ + this.removeRowClass(row, this.selectedRowClass); + }, + + // private + onCellSelect : function(row, col){ + var cell = this.getCell(row, col); + if(cell){ + this.fly(cell).addClass('x-grid3-cell-selected'); + } + }, + + // private + onCellDeselect : function(row, col){ + var cell = this.getCell(row, col); + if(cell){ + this.fly(cell).removeClass('x-grid3-cell-selected'); + } + }, + + // private + onColumnSplitterMoved : function(i, w){ + this.userResized = true; + var cm = this.grid.colModel; + cm.setColumnWidth(i, w, true); + + if(this.forceFit){ + this.fitColumns(true, false, i); + this.updateAllColumnWidths(); + }else{ + this.updateColumnWidth(i, w); + this.syncHeaderScroll(); + } + + this.grid.fireEvent('columnresize', i, w); + }, + + // private + handleHdMenuClick : function(item){ + var index = this.hdCtxIndex, + cm = this.cm, + ds = this.ds, + id = item.getItemId(); + switch(id){ + case 'asc': + ds.sort(cm.getDataIndex(index), 'ASC'); + break; + case 'desc': + ds.sort(cm.getDataIndex(index), 'DESC'); + break; + default: + index = cm.getIndexById(id.substr(4)); + if(index != -1){ + if(item.checked && cm.getColumnsBy(this.isHideableColumn, this).length <= 1){ + this.onDenyColumnHide(); + return false; + } + cm.setHidden(index, item.checked); + } + } + return true; + }, + + // private + isHideableColumn : function(c){ + return !c.hidden; + }, + + // private + beforeColMenuShow : function(){ + var cm = this.cm, colCount = cm.getColumnCount(); + this.colMenu.removeAll(); + for(var i = 0; i < colCount; i++){ + if(cm.config[i].hideable !== false){ + this.colMenu.add(new Ext.menu.CheckItem({ + itemId: 'col-'+cm.getColumnId(i), + text: cm.getColumnHeader(i), + checked: !cm.isHidden(i), + hideOnClick:false, + disabled: cm.config[i].hideable === false + })); + } + } + }, + + // private + handleHdDown : function(e, t){ + if(Ext.fly(t).hasClass('x-grid3-hd-btn')){ + e.stopEvent(); + var hd = this.findHeaderCell(t); + Ext.fly(hd).addClass('x-grid3-hd-menu-open'); + var index = this.getCellIndex(hd); + this.hdCtxIndex = index; + var ms = this.hmenu.items, cm = this.cm; + ms.get('asc').setDisabled(!cm.isSortable(index)); + ms.get('desc').setDisabled(!cm.isSortable(index)); + this.hmenu.on('hide', function(){ + Ext.fly(hd).removeClass('x-grid3-hd-menu-open'); + }, this, {single:true}); + this.hmenu.show(t, 'tl-bl?'); + } + }, + + // private + handleHdOver : function(e, t){ + var hd = this.findHeaderCell(t); + if(hd && !this.headersDisabled){ + this.activeHdRef = t; + this.activeHdIndex = this.getCellIndex(hd); + var fly = this.fly(hd); + this.activeHdRegion = fly.getRegion(); + if(!this.cm.isMenuDisabled(this.activeHdIndex)){ + fly.addClass('x-grid3-hd-over'); + this.activeHdBtn = fly.child('.x-grid3-hd-btn'); + if(this.activeHdBtn){ + this.activeHdBtn.dom.style.height = (hd.firstChild.offsetHeight-1)+'px'; + } + } + } + }, + + // private + handleHdMove : function(e, t){ + var hd = this.findHeaderCell(this.activeHdRef); + if(hd && !this.headersDisabled){ + var hw = this.splitHandleWidth || 5, + r = this.activeHdRegion, + x = e.getPageX(), + ss = hd.style, + cur = ''; + if(this.grid.enableColumnResize !== false){ + if(x - r.left <= hw && this.cm.isResizable(this.activeHdIndex-1)){ + cur = Ext.isAir ? 'move' : Ext.isWebKit ? 'e-resize' : 'col-resize'; // col-resize not always supported + }else if(r.right - x <= (!this.activeHdBtn ? hw : 2) && this.cm.isResizable(this.activeHdIndex)){ + cur = Ext.isAir ? 'move' : Ext.isWebKit ? 'w-resize' : 'col-resize'; + } + } + ss.cursor = cur; + } + }, + + // private + handleHdOut : function(e, t){ + var hd = this.findHeaderCell(t); + if(hd && (!Ext.isIE || !e.within(hd, true))){ + this.activeHdRef = null; + this.fly(hd).removeClass('x-grid3-hd-over'); + hd.style.cursor = ''; + } + }, + + // private + hasRows : function(){ + var fc = this.mainBody.dom.firstChild; + return fc && fc.nodeType == 1 && fc.className != 'x-grid-empty'; + }, + + // back compat + bind : function(d, c){ + this.initData(d, c); + } +}); + + +// private +// This is a support class used internally by the Grid components +Ext.grid.GridView.SplitDragZone = Ext.extend(Ext.dd.DDProxy, { + + constructor: function(grid, hd){ + this.grid = grid; + this.view = grid.getView(); + this.marker = this.view.resizeMarker; + this.proxy = this.view.resizeProxy; + Ext.grid.GridView.SplitDragZone.superclass.constructor.call(this, hd, + 'gridSplitters' + this.grid.getGridEl().id, { + dragElId : Ext.id(this.proxy.dom), resizeFrame:false + }); + this.scroll = false; + this.hw = this.view.splitHandleWidth || 5; + }, + + b4StartDrag : function(x, y){ + this.dragHeadersDisabled = this.view.headersDisabled; + this.view.headersDisabled = true; + var h = this.view.mainWrap.getHeight(); + this.marker.setHeight(h); + this.marker.show(); + this.marker.alignTo(this.view.getHeaderCell(this.cellIndex), 'tl-tl', [-2, 0]); + this.proxy.setHeight(h); + var w = this.cm.getColumnWidth(this.cellIndex), + minw = Math.max(w-this.grid.minColumnWidth, 0); + this.resetConstraints(); + this.setXConstraint(minw, 1000); + this.setYConstraint(0, 0); + this.minX = x - minw; + this.maxX = x + 1000; + this.startPos = x; + Ext.dd.DDProxy.prototype.b4StartDrag.call(this, x, y); + }, + + allowHeaderDrag : function(e){ + return true; + }, + + handleMouseDown : function(e){ + var t = this.view.findHeaderCell(e.getTarget()); + if(t && this.allowHeaderDrag(e)){ + var xy = this.view.fly(t).getXY(), + x = xy[0], + y = xy[1], + exy = e.getXY(), ex = exy[0], + w = t.offsetWidth, adjust = false; + + if((ex - x) <= this.hw){ + adjust = -1; + }else if((x+w) - ex <= this.hw){ + adjust = 0; + } + if(adjust !== false){ + this.cm = this.grid.colModel; + var ci = this.view.getCellIndex(t); + if(adjust == -1){ + if (ci + adjust < 0) { + return; + } + while(this.cm.isHidden(ci+adjust)){ + --adjust; + if(ci+adjust < 0){ + return; + } + } + } + this.cellIndex = ci+adjust; + this.split = t.dom; + if(this.cm.isResizable(this.cellIndex) && !this.cm.isFixed(this.cellIndex)){ + Ext.grid.GridView.SplitDragZone.superclass.handleMouseDown.apply(this, arguments); + } + }else if(this.view.columnDrag){ + this.view.columnDrag.callHandleMouseDown(e); + } + } + }, + + endDrag : function(e){ + this.marker.hide(); + var v = this.view, + endX = Math.max(this.minX, e.getPageX()), + diff = endX - this.startPos, + disabled = this.dragHeadersDisabled; + + v.onColumnSplitterMoved(this.cellIndex, this.cm.getColumnWidth(this.cellIndex)+diff); + setTimeout(function(){ + v.headersDisabled = disabled; + }, 50); + }, + + autoOffset : function(){ + this.setDelta(0,0); + } +}); +// private +// This is a support class used internally by the Grid components +Ext.grid.HeaderDragZone = Ext.extend(Ext.dd.DragZone, { + maxDragWidth: 120, + + constructor : function(grid, hd, hd2){ + this.grid = grid; + this.view = grid.getView(); + this.ddGroup = "gridHeader" + this.grid.getGridEl().id; + Ext.grid.HeaderDragZone.superclass.constructor.call(this, hd); + if(hd2){ + this.setHandleElId(Ext.id(hd)); + this.setOuterHandleElId(Ext.id(hd2)); + } + this.scroll = false; + }, + + getDragData : function(e){ + var t = Ext.lib.Event.getTarget(e), + h = this.view.findHeaderCell(t); + if(h){ + return {ddel: h.firstChild, header:h}; + } + return false; + }, + + onInitDrag : function(e){ + // keep the value here so we can restore it; + this.dragHeadersDisabled = this.view.headersDisabled; + this.view.headersDisabled = true; + var clone = this.dragData.ddel.cloneNode(true); + clone.id = Ext.id(); + clone.style.width = Math.min(this.dragData.header.offsetWidth,this.maxDragWidth) + "px"; + this.proxy.update(clone); + return true; + }, + + afterValidDrop : function(){ + this.completeDrop(); + }, + + afterInvalidDrop : function(){ + this.completeDrop(); + }, + + completeDrop: function(){ + var v = this.view, + disabled = this.dragHeadersDisabled; + setTimeout(function(){ + v.headersDisabled = disabled; + }, 50); + } +}); + +// private +// This is a support class used internally by the Grid components +Ext.grid.HeaderDropZone = Ext.extend(Ext.dd.DropZone, { + proxyOffsets : [-4, -9], + fly: Ext.Element.fly, + + constructor : function(grid, hd, hd2){ + this.grid = grid; + this.view = grid.getView(); + // split the proxies so they don't interfere with mouse events + this.proxyTop = Ext.DomHelper.append(document.body, { + cls:"col-move-top", html:" " + }, true); + this.proxyBottom = Ext.DomHelper.append(document.body, { + cls:"col-move-bottom", html:" " + }, true); + this.proxyTop.hide = this.proxyBottom.hide = function(){ + this.setLeftTop(-100,-100); + this.setStyle("visibility", "hidden"); + }; + this.ddGroup = "gridHeader" + this.grid.getGridEl().id; + // temporarily disabled + //Ext.dd.ScrollManager.register(this.view.scroller.dom); + Ext.grid.HeaderDropZone.superclass.constructor.call(this, grid.getGridEl().dom); + }, + + getTargetFromEvent : function(e){ + var t = Ext.lib.Event.getTarget(e), + cindex = this.view.findCellIndex(t); + if(cindex !== false){ + return this.view.getHeaderCell(cindex); + } + }, + + nextVisible : function(h){ + var v = this.view, cm = this.grid.colModel; + h = h.nextSibling; + while(h){ + if(!cm.isHidden(v.getCellIndex(h))){ + return h; + } + h = h.nextSibling; + } + return null; + }, + + prevVisible : function(h){ + var v = this.view, cm = this.grid.colModel; + h = h.prevSibling; + while(h){ + if(!cm.isHidden(v.getCellIndex(h))){ + return h; + } + h = h.prevSibling; + } + return null; + }, + + positionIndicator : function(h, n, e){ + var x = Ext.lib.Event.getPageX(e), + r = Ext.lib.Dom.getRegion(n.firstChild), + px, + pt, + py = r.top + this.proxyOffsets[1]; + if((r.right - x) <= (r.right-r.left)/2){ + px = r.right+this.view.borderWidth; + pt = "after"; + }else{ + px = r.left; + pt = "before"; + } + + if(this.grid.colModel.isFixed(this.view.getCellIndex(n))){ + return false; + } + + px += this.proxyOffsets[0]; + this.proxyTop.setLeftTop(px, py); + this.proxyTop.show(); + if(!this.bottomOffset){ + this.bottomOffset = this.view.mainHd.getHeight(); + } + this.proxyBottom.setLeftTop(px, py+this.proxyTop.dom.offsetHeight+this.bottomOffset); + this.proxyBottom.show(); + return pt; + }, + + onNodeEnter : function(n, dd, e, data){ + if(data.header != n){ + this.positionIndicator(data.header, n, e); + } + }, + + onNodeOver : function(n, dd, e, data){ + var result = false; + if(data.header != n){ + result = this.positionIndicator(data.header, n, e); + } + if(!result){ + this.proxyTop.hide(); + this.proxyBottom.hide(); + } + return result ? this.dropAllowed : this.dropNotAllowed; + }, + + onNodeOut : function(n, dd, e, data){ + this.proxyTop.hide(); + this.proxyBottom.hide(); + }, + + onNodeDrop : function(n, dd, e, data){ + var h = data.header; + if(h != n){ + var cm = this.grid.colModel, + x = Ext.lib.Event.getPageX(e), + r = Ext.lib.Dom.getRegion(n.firstChild), + pt = (r.right - x) <= ((r.right-r.left)/2) ? "after" : "before", + oldIndex = this.view.getCellIndex(h), + newIndex = this.view.getCellIndex(n); + if(pt == "after"){ + newIndex++; + } + if(oldIndex < newIndex){ + newIndex--; + } + cm.moveColumn(oldIndex, newIndex); + return true; + } + return false; + } +}); + +Ext.grid.GridView.ColumnDragZone = Ext.extend(Ext.grid.HeaderDragZone, { + + constructor : function(grid, hd){ + Ext.grid.GridView.ColumnDragZone.superclass.constructor.call(this, grid, hd, null); + this.proxy.el.addClass('x-grid3-col-dd'); + }, + + handleMouseDown : function(e){ + }, + + callHandleMouseDown : function(e){ + Ext.grid.GridView.ColumnDragZone.superclass.handleMouseDown.call(this, e); + } +});// private +// This is a support class used internally by the Grid components +Ext.grid.SplitDragZone = Ext.extend(Ext.dd.DDProxy, { + fly: Ext.Element.fly, + + constructor : function(grid, hd, hd2){ + this.grid = grid; + this.view = grid.getView(); + this.proxy = this.view.resizeProxy; + Ext.grid.SplitDragZone.superclass.constructor.call(this, hd, + "gridSplitters" + this.grid.getGridEl().id, { + dragElId : Ext.id(this.proxy.dom), resizeFrame:false + }); + this.setHandleElId(Ext.id(hd)); + this.setOuterHandleElId(Ext.id(hd2)); + this.scroll = false; + }, + + b4StartDrag : function(x, y){ + this.view.headersDisabled = true; + this.proxy.setHeight(this.view.mainWrap.getHeight()); + var w = this.cm.getColumnWidth(this.cellIndex); + var minw = Math.max(w-this.grid.minColumnWidth, 0); + this.resetConstraints(); + this.setXConstraint(minw, 1000); + this.setYConstraint(0, 0); + this.minX = x - minw; + this.maxX = x + 1000; + this.startPos = x; + Ext.dd.DDProxy.prototype.b4StartDrag.call(this, x, y); + }, + + + handleMouseDown : function(e){ + var ev = Ext.EventObject.setEvent(e); + var t = this.fly(ev.getTarget()); + if(t.hasClass("x-grid-split")){ + this.cellIndex = this.view.getCellIndex(t.dom); + this.split = t.dom; + this.cm = this.grid.colModel; + if(this.cm.isResizable(this.cellIndex) && !this.cm.isFixed(this.cellIndex)){ + Ext.grid.SplitDragZone.superclass.handleMouseDown.apply(this, arguments); + } + } + }, + + endDrag : function(e){ + this.view.headersDisabled = false; + var endX = Math.max(this.minX, Ext.lib.Event.getPageX(e)); + var diff = endX - this.startPos; + this.view.onColumnSplitterMoved(this.cellIndex, this.cm.getColumnWidth(this.cellIndex)+diff); + }, + + autoOffset : function(){ + this.setDelta(0,0); + } +});/** + * @class Ext.grid.GridDragZone + * @extends Ext.dd.DragZone + *

A customized implementation of a {@link Ext.dd.DragZone DragZone} which provides default implementations of two of the + * template methods of DragZone to enable dragging of the selected rows of a GridPanel.

+ *

A cooperating {@link Ext.dd.DropZone DropZone} must be created who's template method implementations of + * {@link Ext.dd.DropZone#onNodeEnter onNodeEnter}, {@link Ext.dd.DropZone#onNodeOver onNodeOver}, + * {@link Ext.dd.DropZone#onNodeOut onNodeOut} and {@link Ext.dd.DropZone#onNodeDrop onNodeDrop}

are able + * to process the {@link #getDragData data} which is provided. + */ +Ext.grid.GridDragZone = function(grid, config){ + this.view = grid.getView(); + Ext.grid.GridDragZone.superclass.constructor.call(this, this.view.mainBody.dom, config); + this.scroll = false; + this.grid = grid; + this.ddel = document.createElement('div'); + this.ddel.className = 'x-grid-dd-wrap'; +}; + +Ext.extend(Ext.grid.GridDragZone, Ext.dd.DragZone, { + ddGroup : "GridDD", + + /** + *

The provided implementation of the getDragData method which collects the data to be dragged from the GridPanel on mousedown.

+ *

This data is available for processing in the {@link Ext.dd.DropZone#onNodeEnter onNodeEnter}, {@link Ext.dd.DropZone#onNodeOver onNodeOver}, + * {@link Ext.dd.DropZone#onNodeOut onNodeOut} and {@link Ext.dd.DropZone#onNodeDrop onNodeDrop} methods of a cooperating {@link Ext.dd.DropZone DropZone}.

+ *

The data object contains the following properties:

    + *
  • grid : Ext.Grid.GridPanel
    The GridPanel from which the data is being dragged.
  • + *
  • ddel : htmlElement
    An htmlElement which provides the "picture" of the data being dragged.
  • + *
  • rowIndex : Number
    The index of the row which receieved the mousedown gesture which triggered the drag.
  • + *
  • selections : Array
    An Array of the selected Records which are being dragged from the GridPanel.
  • + *

+ */ + getDragData : function(e){ + var t = Ext.lib.Event.getTarget(e); + var rowIndex = this.view.findRowIndex(t); + if(rowIndex !== false){ + var sm = this.grid.selModel; + if(!sm.isSelected(rowIndex) || e.hasModifier()){ + sm.handleMouseDown(this.grid, rowIndex, e); + } + return {grid: this.grid, ddel: this.ddel, rowIndex: rowIndex, selections:sm.getSelections()}; + } + return false; + }, + + /** + *

The provided implementation of the onInitDrag method. Sets the innerHTML of the drag proxy which provides the "picture" + * of the data being dragged.

+ *

The innerHTML data is found by calling the owning GridPanel's {@link Ext.grid.GridPanel#getDragDropText getDragDropText}.

+ */ + onInitDrag : function(e){ + var data = this.dragData; + this.ddel.innerHTML = this.grid.getDragDropText(); + this.proxy.update(this.ddel); + // fire start drag? + }, + + /** + * An empty immplementation. Implement this to provide behaviour after a repair of an invalid drop. An implementation might highlight + * the selected rows to show that they have not been dragged. + */ + afterRepair : function(){ + this.dragging = false; + }, + + /** + *

An empty implementation. Implement this to provide coordinates for the drag proxy to slide back to after an invalid drop.

+ *

Called before a repair of an invalid drop to get the XY to animate to.

+ * @param {EventObject} e The mouse up event + * @return {Array} The xy location (e.g. [100, 200]) + */ + getRepairXY : function(e, data){ + return false; + }, + + onEndDrag : function(data, e){ + // fire end drag? + }, + + onValidDrop : function(dd, e, id){ + // fire drag drop? + this.hideProxy(); + }, + + beforeInvalidDrop : function(e, id){ + + } +}); +/** + * @class Ext.grid.ColumnModel + * @extends Ext.util.Observable + *

After the data has been read into the client side cache ({@link Ext.data.Store Store}), + * the ColumnModel is used to configure how and what parts of that data will be displayed in the + * vertical slices (columns) of the grid. The Ext.grid.ColumnModel Class is the default implementation + * of a ColumnModel used by implentations of {@link Ext.grid.GridPanel GridPanel}.

+ *

Data is mapped into the store's records and then indexed into the ColumnModel using the + * {@link Ext.grid.Column#dataIndex dataIndex}:

+ *

+{data source} == mapping ==> {data store} == {@link Ext.grid.Column#dataIndex dataIndex} ==> {ColumnModel}
+ * 
+ *

Each {@link Ext.grid.Column Column} in the grid's ColumnModel is configured with a + * {@link Ext.grid.Column#dataIndex dataIndex} to specify how the data within + * each record in the store is indexed into the ColumnModel.

+ *

There are two ways to initialize the ColumnModel class:

+ *

Initialization Method 1: an Array

+

+ var colModel = new Ext.grid.ColumnModel([
+    { header: "Ticker", width: 60, sortable: true},
+    { header: "Company Name", width: 150, sortable: true, id: 'company'},
+    { header: "Market Cap.", width: 100, sortable: true},
+    { header: "$ Sales", width: 100, sortable: true, renderer: money},
+    { header: "Employees", width: 100, sortable: true, resizable: false}
+ ]);
+ 
+ *

The ColumnModel may be initialized with an Array of {@link Ext.grid.Column} column configuration + * objects to define the initial layout / display of the columns in the Grid. The order of each + * {@link Ext.grid.Column} column configuration object within the specified Array defines the initial + * order of the column display. A Column's display may be initially hidden using the + * {@link Ext.grid.Column#hidden hidden} config property (and then shown using the column + * header menu). Fields that are not included in the ColumnModel will not be displayable at all.

+ *

How each column in the grid correlates (maps) to the {@link Ext.data.Record} field in the + * {@link Ext.data.Store Store} the column draws its data from is configured through the + * {@link Ext.grid.Column#dataIndex dataIndex}. If the + * {@link Ext.grid.Column#dataIndex dataIndex} is not explicitly defined (as shown in the + * example above) it will use the column configuration's index in the Array as the index.

+ *

See {@link Ext.grid.Column} for additional configuration options for each column.

+ *

Initialization Method 2: an Object

+ *

In order to use configuration options from Ext.grid.ColumnModel, an Object may be used to + * initialize the ColumnModel. The column configuration Array will be specified in the {@link #columns} + * config property. The {@link #defaults} config property can be used to apply defaults + * for all columns, e.g.:


+ var colModel = new Ext.grid.ColumnModel({
+    columns: [
+        { header: "Ticker", width: 60, menuDisabled: false},
+        { header: "Company Name", width: 150, id: 'company'},
+        { header: "Market Cap."},
+        { header: "$ Sales", renderer: money},
+        { header: "Employees", resizable: false}
+    ],
+    defaults: {
+        sortable: true,
+        menuDisabled: true,
+        width: 100
+    },
+    listeners: {
+        {@link #hiddenchange}: function(cm, colIndex, hidden) {
+            saveConfig(colIndex, hidden);
+        }
+    }
+});
+ 
+ *

In both examples above, the ability to apply a CSS class to all cells in a column (including the + * header) is demonstrated through the use of the {@link Ext.grid.Column#id id} config + * option. This column could be styled by including the following css:


+ //add this css *after* the core css is loaded
+.x-grid3-td-company {
+    color: red; // entire column will have red font
+}
+// modify the header row only, adding an icon to the column header
+.x-grid3-hd-company {
+    background: transparent
+        url(../../resources/images/icons/silk/building.png)
+        no-repeat 3px 3px ! important;
+        padding-left:20px;
+}
+ 
+ * Note that the "Company Name" column could be specified as the + * {@link Ext.grid.GridPanel}.{@link Ext.grid.GridPanel#autoExpandColumn autoExpandColumn}. + * @constructor + * @param {Mixed} config Specify either an Array of {@link Ext.grid.Column} configuration objects or specify + * a configuration Object (see introductory section discussion utilizing Initialization Method 2 above). + */ +Ext.grid.ColumnModel = Ext.extend(Ext.util.Observable, { + /** + * @cfg {Number} defaultWidth (optional) The width of columns which have no {@link #width} + * specified (defaults to 100). This property shall preferably be configured through the + * {@link #defaults} config property. + */ + defaultWidth: 100, + /** + * @cfg {Boolean} defaultSortable (optional) Default sortable of columns which have no + * sortable specified (defaults to false). This property shall preferably be configured + * through the {@link #defaults} config property. + */ + defaultSortable: false, + /** + * @cfg {Array} columns An Array of object literals. The config options defined by + * {@link Ext.grid.Column} are the options which may appear in the object literal for each + * individual column definition. + */ + /** + * @cfg {Object} defaults Object literal which will be used to apply {@link Ext.grid.Column} + * configuration options to all {@link #columns}. Configuration options specified with + * individual {@link Ext.grid.Column column} configs will supersede these {@link #defaults}. + */ + + constructor : function(config){ + /** + * An Array of {@link Ext.grid.Column Column definition} objects representing the configuration + * of this ColumnModel. See {@link Ext.grid.Column} for the configuration properties that may + * be specified. + * @property config + * @type Array + */ + if(config.columns){ + Ext.apply(this, config); + this.setConfig(config.columns, true); + }else{ + this.setConfig(config, true); + } + this.addEvents( + /** + * @event widthchange + * Fires when the width of a column is programmaticially changed using + * {@link #setColumnWidth}. + * Note internal resizing suppresses the event from firing. See also + * {@link Ext.grid.GridPanel}.{@link #columnresize}. + * @param {ColumnModel} this + * @param {Number} columnIndex The column index + * @param {Number} newWidth The new width + */ + "widthchange", + /** + * @event headerchange + * Fires when the text of a header changes. + * @param {ColumnModel} this + * @param {Number} columnIndex The column index + * @param {String} newText The new header text + */ + "headerchange", + /** + * @event hiddenchange + * Fires when a column is hidden or "unhidden". + * @param {ColumnModel} this + * @param {Number} columnIndex The column index + * @param {Boolean} hidden true if hidden, false otherwise + */ + "hiddenchange", + /** + * @event columnmoved + * Fires when a column is moved. + * @param {ColumnModel} this + * @param {Number} oldIndex + * @param {Number} newIndex + */ + "columnmoved", + /** + * @event configchange + * Fires when the configuration is changed + * @param {ColumnModel} this + */ + "configchange" + ); + Ext.grid.ColumnModel.superclass.constructor.call(this); + }, + + /** + * Returns the id of the column at the specified index. + * @param {Number} index The column index + * @return {String} the id + */ + getColumnId : function(index){ + return this.config[index].id; + }, + + getColumnAt : function(index){ + return this.config[index]; + }, + + /** + *

Reconfigures this column model according to the passed Array of column definition objects. + * For a description of the individual properties of a column definition object, see the + * Config Options.

+ *

Causes the {@link #configchange} event to be fired. A {@link Ext.grid.GridPanel GridPanel} + * using this ColumnModel will listen for this event and refresh its UI automatically.

+ * @param {Array} config Array of Column definition objects. + * @param {Boolean} initial Specify true to bypass cleanup which deletes the totalWidth + * and destroys existing editors. + */ + setConfig : function(config, initial){ + var i, c, len; + if(!initial){ // cleanup + delete this.totalWidth; + for(i = 0, len = this.config.length; i < len; i++){ + c = this.config[i]; + if(c.setEditor){ + //check here, in case we have a special column like a CheckboxSelectionModel + c.setEditor(null); + } + } + } + + // backward compatibility + this.defaults = Ext.apply({ + width: this.defaultWidth, + sortable: this.defaultSortable + }, this.defaults); + + this.config = config; + this.lookup = {}; + + for(i = 0, len = config.length; i < len; i++){ + c = Ext.applyIf(config[i], this.defaults); + // if no id, create one using column's ordinal position + if(Ext.isEmpty(c.id)){ + c.id = i; + } + if(!c.isColumn){ + var Cls = Ext.grid.Column.types[c.xtype || 'gridcolumn']; + c = new Cls(c); + config[i] = c; + } + this.lookup[c.id] = c; + } + if(!initial){ + this.fireEvent('configchange', this); + } + }, + + /** + * Returns the column for a specified id. + * @param {String} id The column id + * @return {Object} the column + */ + getColumnById : function(id){ + return this.lookup[id]; + }, + + /** + * Returns the index for a specified column id. + * @param {String} id The column id + * @return {Number} the index, or -1 if not found + */ + getIndexById : function(id){ + for(var i = 0, len = this.config.length; i < len; i++){ + if(this.config[i].id == id){ + return i; + } + } + return -1; + }, + + /** + * Moves a column from one position to another. + * @param {Number} oldIndex The index of the column to move. + * @param {Number} newIndex The position at which to reinsert the coolumn. + */ + moveColumn : function(oldIndex, newIndex){ + var c = this.config[oldIndex]; + this.config.splice(oldIndex, 1); + this.config.splice(newIndex, 0, c); + this.dataMap = null; + this.fireEvent("columnmoved", this, oldIndex, newIndex); + }, + + /** + * Returns the number of columns. + * @param {Boolean} visibleOnly Optional. Pass as true to only include visible columns. + * @return {Number} + */ + getColumnCount : function(visibleOnly){ + if(visibleOnly === true){ + var c = 0; + for(var i = 0, len = this.config.length; i < len; i++){ + if(!this.isHidden(i)){ + c++; + } + } + return c; + } + return this.config.length; + }, + + /** + * Returns the column configs that return true by the passed function that is called + * with (columnConfig, index) +

+// returns an array of column config objects for all hidden columns
+var columns = grid.getColumnModel().getColumnsBy(function(c){
+  return c.hidden;
+});
+
+ * @param {Function} fn A function which, when passed a {@link Ext.grid.Column Column} object, must + * return true if the column is to be included in the returned Array. + * @param {Object} scope (optional) The scope (this reference) in which the function + * is executed. Defaults to this ColumnModel. + * @return {Array} result + */ + getColumnsBy : function(fn, scope){ + var r = []; + for(var i = 0, len = this.config.length; i < len; i++){ + var c = this.config[i]; + if(fn.call(scope||this, c, i) === true){ + r[r.length] = c; + } + } + return r; + }, + + /** + * Returns true if the specified column is sortable. + * @param {Number} col The column index + * @return {Boolean} + */ + isSortable : function(col){ + return !!this.config[col].sortable; + }, + + /** + * Returns true if the specified column menu is disabled. + * @param {Number} col The column index + * @return {Boolean} + */ + isMenuDisabled : function(col){ + return !!this.config[col].menuDisabled; + }, + + /** + * Returns the rendering (formatting) function defined for the column. + * @param {Number} col The column index. + * @return {Function} The function used to render the cell. See {@link #setRenderer}. + */ + getRenderer : function(col){ + if(!this.config[col].renderer){ + return Ext.grid.ColumnModel.defaultRenderer; + } + return this.config[col].renderer; + }, + + getRendererScope : function(col){ + return this.config[col].scope; + }, + + /** + * Sets the rendering (formatting) function for a column. See {@link Ext.util.Format} for some + * default formatting functions. + * @param {Number} col The column index + * @param {Function} fn The function to use to process the cell's raw data + * to return HTML markup for the grid view. The render function is called with + * the following parameters:
    + *
  • value : Object

    The data value for the cell.

  • + *
  • metadata : Object

    An object in which you may set the following attributes:

      + *
    • css : String

      A CSS class name to add to the cell's TD element.

    • + *
    • attr : String

      An HTML attribute definition string to apply to the data container element within the table cell + * (e.g. 'style="color:red;"').

  • + *
  • record : Ext.data.record

    The {@link Ext.data.Record} from which the data was extracted.

  • + *
  • rowIndex : Number

    Row index

  • + *
  • colIndex : Number

    Column index

  • + *
  • store : Ext.data.Store

    The {@link Ext.data.Store} object from which the Record was extracted.

+ */ + setRenderer : function(col, fn){ + this.config[col].renderer = fn; + }, + + /** + * Returns the width for the specified column. + * @param {Number} col The column index + * @return {Number} + */ + getColumnWidth : function(col){ + return this.config[col].width; + }, + + /** + * Sets the width for a column. + * @param {Number} col The column index + * @param {Number} width The new width + * @param {Boolean} suppressEvent True to suppress firing the {@link #widthchange} + * event. Defaults to false. + */ + setColumnWidth : function(col, width, suppressEvent){ + this.config[col].width = width; + this.totalWidth = null; + if(!suppressEvent){ + this.fireEvent("widthchange", this, col, width); + } + }, + + /** + * Returns the total width of all columns. + * @param {Boolean} includeHidden True to include hidden column widths + * @return {Number} + */ + getTotalWidth : function(includeHidden){ + if(!this.totalWidth){ + this.totalWidth = 0; + for(var i = 0, len = this.config.length; i < len; i++){ + if(includeHidden || !this.isHidden(i)){ + this.totalWidth += this.getColumnWidth(i); + } + } + } + return this.totalWidth; + }, + + /** + * Returns the header for the specified column. + * @param {Number} col The column index + * @return {String} + */ + getColumnHeader : function(col){ + return this.config[col].header; + }, + + /** + * Sets the header for a column. + * @param {Number} col The column index + * @param {String} header The new header + */ + setColumnHeader : function(col, header){ + this.config[col].header = header; + this.fireEvent("headerchange", this, col, header); + }, + + /** + * Returns the tooltip for the specified column. + * @param {Number} col The column index + * @return {String} + */ + getColumnTooltip : function(col){ + return this.config[col].tooltip; + }, + /** + * Sets the tooltip for a column. + * @param {Number} col The column index + * @param {String} tooltip The new tooltip + */ + setColumnTooltip : function(col, tooltip){ + this.config[col].tooltip = tooltip; + }, + + /** + * Returns the dataIndex for the specified column. +

+// Get field name for the column
+var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
+
+ * @param {Number} col The column index + * @return {String} The column's dataIndex + */ + getDataIndex : function(col){ + return this.config[col].dataIndex; + }, + + /** + * Sets the dataIndex for a column. + * @param {Number} col The column index + * @param {String} dataIndex The new dataIndex + */ + setDataIndex : function(col, dataIndex){ + this.config[col].dataIndex = dataIndex; + }, + + /** + * Finds the index of the first matching column for the given dataIndex. + * @param {String} col The dataIndex to find + * @return {Number} The column index, or -1 if no match was found + */ + findColumnIndex : function(dataIndex){ + var c = this.config; + for(var i = 0, len = c.length; i < len; i++){ + if(c[i].dataIndex == dataIndex){ + return i; + } + } + return -1; + }, + + /** + * Returns true if the cell is editable. +

+var store = new Ext.data.Store({...});
+var colModel = new Ext.grid.ColumnModel({
+  columns: [...],
+  isCellEditable: function(col, row) {
+    var record = store.getAt(row);
+    if (record.get('readonly')) { // replace with your condition
+      return false;
+    }
+    return Ext.grid.ColumnModel.prototype.isCellEditable.call(this, col, row);
+  }
+});
+var grid = new Ext.grid.GridPanel({
+  store: store,
+  colModel: colModel,
+  ...
+});
+
+ * @param {Number} colIndex The column index + * @param {Number} rowIndex The row index + * @return {Boolean} + */ + isCellEditable : function(colIndex, rowIndex){ + var c = this.config[colIndex], + ed = c.editable; + + //force boolean + return !!(ed || (!Ext.isDefined(ed) && c.editor)); + }, + + /** + * Returns the editor defined for the cell/column. + * @param {Number} colIndex The column index + * @param {Number} rowIndex The row index + * @return {Ext.Editor} The {@link Ext.Editor Editor} that was created to wrap + * the {@link Ext.form.Field Field} used to edit the cell. + */ + getCellEditor : function(colIndex, rowIndex){ + return this.config[colIndex].getCellEditor(rowIndex); + }, + + /** + * Sets if a column is editable. + * @param {Number} col The column index + * @param {Boolean} editable True if the column is editable + */ + setEditable : function(col, editable){ + this.config[col].editable = editable; + }, + + /** + * Returns true if the column is {@link Ext.grid.Column#hidden hidden}, + * false otherwise. + * @param {Number} colIndex The column index + * @return {Boolean} + */ + isHidden : function(colIndex){ + return !!this.config[colIndex].hidden; // ensure returns boolean + }, + + /** + * Returns true if the column is {@link Ext.grid.Column#fixed fixed}, + * false otherwise. + * @param {Number} colIndex The column index + * @return {Boolean} + */ + isFixed : function(colIndex){ + return !!this.config[colIndex].fixed; + }, + + /** + * Returns true if the column can be resized + * @return {Boolean} + */ + isResizable : function(colIndex){ + return colIndex >= 0 && this.config[colIndex].resizable !== false && this.config[colIndex].fixed !== true; + }, + /** + * Sets if a column is hidden. +

+myGrid.getColumnModel().setHidden(0, true); // hide column 0 (0 = the first column).
+
+ * @param {Number} colIndex The column index + * @param {Boolean} hidden True if the column is hidden + */ + setHidden : function(colIndex, hidden){ + var c = this.config[colIndex]; + if(c.hidden !== hidden){ + c.hidden = hidden; + this.totalWidth = null; + this.fireEvent("hiddenchange", this, colIndex, hidden); + } + }, + + /** + * Sets the editor for a column and destroys the prior editor. + * @param {Number} col The column index + * @param {Object} editor The editor object + */ + setEditor : function(col, editor){ + this.config[col].setEditor(editor); + }, + + /** + * Destroys this column model by purging any event listeners, and removing any editors. + */ + destroy : function(){ + var c; + for(var i = 0, len = this.config.length; i < len; i++){ + c = this.config[i]; + if(c.setEditor){ + c.setEditor(null); + } + } + this.purgeListeners(); + } +}); + +// private +Ext.grid.ColumnModel.defaultRenderer = function(value){ + if(typeof value == "string" && value.length < 1){ + return " "; + } + return value; +};/** + * @class Ext.grid.AbstractSelectionModel + * @extends Ext.util.Observable + * Abstract base class for grid SelectionModels. It provides the interface that should be + * implemented by descendant classes. This class should not be directly instantiated. + * @constructor + */ +Ext.grid.AbstractSelectionModel = Ext.extend(Ext.util.Observable, { + /** + * The GridPanel for which this SelectionModel is handling selection. Read-only. + * @type Object + * @property grid + */ + + constructor : function(){ + this.locked = false; + Ext.grid.AbstractSelectionModel.superclass.constructor.call(this); + }, + + /** @ignore Called by the grid automatically. Do not call directly. */ + init : function(grid){ + this.grid = grid; + if(this.lockOnInit){ + delete this.lockOnInit; + this.locked = false; + this.lock(); + } + this.initEvents(); + }, + + /** + * Locks the selections. + */ + lock : function(){ + if(!this.locked){ + this.locked = true; + // If the grid has been set, then the view is already initialized. + var g = this.grid; + if(g){ + g.getView().on({ + scope: this, + beforerefresh: this.sortUnLock, + refresh: this.sortLock + }); + }else{ + this.lockOnInit = true; + } + } + }, + + // set the lock states before and after a view refresh + sortLock : function() { + this.locked = true; + }, + + // set the lock states before and after a view refresh + sortUnLock : function() { + this.locked = false; + }, + + /** + * Unlocks the selections. + */ + unlock : function(){ + if(this.locked){ + this.locked = false; + var g = this.grid, + gv; + + // If the grid has been set, then the view is already initialized. + if(g){ + gv = g.getView(); + gv.un('beforerefresh', this.sortUnLock, this); + gv.un('refresh', this.sortLock, this); + }else{ + delete this.lockOnInit; + } + } + }, + + /** + * Returns true if the selections are locked. + * @return {Boolean} + */ + isLocked : function(){ + return this.locked; + }, + + destroy: function(){ + this.unlock(); + this.purgeListeners(); + } +});/** + * @class Ext.grid.RowSelectionModel + * @extends Ext.grid.AbstractSelectionModel + * The default SelectionModel used by {@link Ext.grid.GridPanel}. + * It supports multiple selections and keyboard selection/navigation. The objects stored + * as selections and returned by {@link #getSelected}, and {@link #getSelections} are + * the {@link Ext.data.Record Record}s which provide the data for the selected rows. + * @constructor + * @param {Object} config + */ +Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { + /** + * @cfg {Boolean} singleSelect + * true to allow selection of only one row at a time (defaults to false + * allowing multiple selections) + */ + singleSelect : false, + + constructor : function(config){ + Ext.apply(this, config); + this.selections = new Ext.util.MixedCollection(false, function(o){ + return o.id; + }); + + this.last = false; + this.lastActive = false; + + this.addEvents( + /** + * @event selectionchange + * Fires when the selection changes + * @param {SelectionModel} this + */ + 'selectionchange', + /** + * @event beforerowselect + * Fires before a row is selected, return false to cancel the selection. + * @param {SelectionModel} this + * @param {Number} rowIndex The index to be selected + * @param {Boolean} keepExisting False if other selections will be cleared + * @param {Record} record The record to be selected + */ + 'beforerowselect', + /** + * @event rowselect + * Fires when a row is selected. + * @param {SelectionModel} this + * @param {Number} rowIndex The selected index + * @param {Ext.data.Record} r The selected record + */ + 'rowselect', + /** + * @event rowdeselect + * Fires when a row is deselected. To prevent deselection + * {@link Ext.grid.AbstractSelectionModel#lock lock the selections}. + * @param {SelectionModel} this + * @param {Number} rowIndex + * @param {Record} record + */ + 'rowdeselect' + ); + Ext.grid.RowSelectionModel.superclass.constructor.call(this); + }, + + /** + * @cfg {Boolean} moveEditorOnEnter + * false to turn off moving the editor to the next row down when the enter key is pressed + * or the next row up when shift + enter keys are pressed. + */ + // private + initEvents : function(){ + + if(!this.grid.enableDragDrop && !this.grid.enableDrag){ + this.grid.on('rowmousedown', this.handleMouseDown, this); + } + + this.rowNav = new Ext.KeyNav(this.grid.getGridEl(), { + 'up' : function(e){ + if(!e.shiftKey || this.singleSelect){ + this.selectPrevious(false); + }else if(this.last !== false && this.lastActive !== false){ + var last = this.last; + this.selectRange(this.last, this.lastActive-1); + this.grid.getView().focusRow(this.lastActive); + if(last !== false){ + this.last = last; + } + }else{ + this.selectFirstRow(); + } + }, + 'down' : function(e){ + if(!e.shiftKey || this.singleSelect){ + this.selectNext(false); + }else if(this.last !== false && this.lastActive !== false){ + var last = this.last; + this.selectRange(this.last, this.lastActive+1); + this.grid.getView().focusRow(this.lastActive); + if(last !== false){ + this.last = last; + } + }else{ + this.selectFirstRow(); + } + }, + scope: this + }); + + this.grid.getView().on({ + scope: this, + refresh: this.onRefresh, + rowupdated: this.onRowUpdated, + rowremoved: this.onRemove + }); + }, + + // private + onRefresh : function(){ + var ds = this.grid.store, index; + var s = this.getSelections(); + this.clearSelections(true); + for(var i = 0, len = s.length; i < len; i++){ + var r = s[i]; + if((index = ds.indexOfId(r.id)) != -1){ + this.selectRow(index, true); + } + } + if(s.length != this.selections.getCount()){ + this.fireEvent('selectionchange', this); + } + }, + + // private + onRemove : function(v, index, r){ + if(this.selections.remove(r) !== false){ + this.fireEvent('selectionchange', this); + } + }, + + // private + onRowUpdated : function(v, index, r){ + if(this.isSelected(r)){ + v.onRowSelect(index); + } + }, + + /** + * Select records. + * @param {Array} records The records to select + * @param {Boolean} keepExisting (optional) true to keep existing selections + */ + selectRecords : function(records, keepExisting){ + if(!keepExisting){ + this.clearSelections(); + } + var ds = this.grid.store; + for(var i = 0, len = records.length; i < len; i++){ + this.selectRow(ds.indexOf(records[i]), true); + } + }, + + /** + * Gets the number of selected rows. + * @return {Number} + */ + getCount : function(){ + return this.selections.length; + }, + + /** + * Selects the first row in the grid. + */ + selectFirstRow : function(){ + this.selectRow(0); + }, + + /** + * Select the last row. + * @param {Boolean} keepExisting (optional) true to keep existing selections + */ + selectLastRow : function(keepExisting){ + this.selectRow(this.grid.store.getCount() - 1, keepExisting); + }, + + /** + * Selects the row immediately following the last selected row. + * @param {Boolean} keepExisting (optional) true to keep existing selections + * @return {Boolean} true if there is a next row, else false + */ + selectNext : function(keepExisting){ + if(this.hasNext()){ + this.selectRow(this.last+1, keepExisting); + this.grid.getView().focusRow(this.last); + return true; + } + return false; + }, + + /** + * Selects the row that precedes the last selected row. + * @param {Boolean} keepExisting (optional) true to keep existing selections + * @return {Boolean} true if there is a previous row, else false + */ + selectPrevious : function(keepExisting){ + if(this.hasPrevious()){ + this.selectRow(this.last-1, keepExisting); + this.grid.getView().focusRow(this.last); + return true; + } + return false; + }, + + /** + * Returns true if there is a next record to select + * @return {Boolean} + */ + hasNext : function(){ + return this.last !== false && (this.last+1) < this.grid.store.getCount(); + }, + + /** + * Returns true if there is a previous record to select + * @return {Boolean} + */ + hasPrevious : function(){ + return !!this.last; + }, + + + /** + * Returns the selected records + * @return {Array} Array of selected records + */ + getSelections : function(){ + return [].concat(this.selections.items); + }, + + /** + * Returns the first selected record. + * @return {Record} + */ + getSelected : function(){ + return this.selections.itemAt(0); + }, + + /** + * Calls the passed function with each selection. If the function returns + * false, iteration is stopped and this function returns + * false. Otherwise it returns true. + * @param {Function} fn The function to call upon each iteration. It is passed the selected {@link Ext.data.Record Record}. + * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to this RowSelectionModel. + * @return {Boolean} true if all selections were iterated + */ + each : function(fn, scope){ + var s = this.getSelections(); + for(var i = 0, len = s.length; i < len; i++){ + if(fn.call(scope || this, s[i], i) === false){ + return false; + } + } + return true; + }, + + /** + * Clears all selections if the selection model + * {@link Ext.grid.AbstractSelectionModel#isLocked is not locked}. + * @param {Boolean} fast (optional) true to bypass the + * conditional checks and events described in {@link #deselectRow}. + */ + clearSelections : function(fast){ + if(this.isLocked()){ + return; + } + if(fast !== true){ + var ds = this.grid.store; + var s = this.selections; + s.each(function(r){ + this.deselectRow(ds.indexOfId(r.id)); + }, this); + s.clear(); + }else{ + this.selections.clear(); + } + this.last = false; + }, + + + /** + * Selects all rows if the selection model + * {@link Ext.grid.AbstractSelectionModel#isLocked is not locked}. + */ + selectAll : function(){ + if(this.isLocked()){ + return; + } + this.selections.clear(); + for(var i = 0, len = this.grid.store.getCount(); i < len; i++){ + this.selectRow(i, true); + } + }, + + /** + * Returns true if there is a selection. + * @return {Boolean} + */ + hasSelection : function(){ + return this.selections.length > 0; + }, + + /** + * Returns true if the specified row is selected. + * @param {Number/Record} index The record or index of the record to check + * @return {Boolean} + */ + isSelected : function(index){ + var r = Ext.isNumber(index) ? this.grid.store.getAt(index) : index; + return (r && this.selections.key(r.id) ? true : false); + }, + + /** + * Returns true if the specified record id is selected. + * @param {String} id The id of record to check + * @return {Boolean} + */ + isIdSelected : function(id){ + return (this.selections.key(id) ? true : false); + }, + + // private + handleMouseDown : function(g, rowIndex, e){ + if(e.button !== 0 || this.isLocked()){ + return; + } + var view = this.grid.getView(); + if(e.shiftKey && !this.singleSelect && this.last !== false){ + var last = this.last; + this.selectRange(last, rowIndex, e.ctrlKey); + this.last = last; // reset the last + view.focusRow(rowIndex); + }else{ + var isSelected = this.isSelected(rowIndex); + if(e.ctrlKey && isSelected){ + this.deselectRow(rowIndex); + }else if(!isSelected || this.getCount() > 1){ + this.selectRow(rowIndex, e.ctrlKey || e.shiftKey); + view.focusRow(rowIndex); + } + } + }, + + /** + * Selects multiple rows. + * @param {Array} rows Array of the indexes of the row to select + * @param {Boolean} keepExisting (optional) true to keep + * existing selections (defaults to false) + */ + selectRows : function(rows, keepExisting){ + if(!keepExisting){ + this.clearSelections(); + } + for(var i = 0, len = rows.length; i < len; i++){ + this.selectRow(rows[i], true); + } + }, + + /** + * Selects a range of rows if the selection model + * {@link Ext.grid.AbstractSelectionModel#isLocked is not locked}. + * All rows in between startRow and endRow are also selected. + * @param {Number} startRow The index of the first row in the range + * @param {Number} endRow The index of the last row in the range + * @param {Boolean} keepExisting (optional) True to retain existing selections + */ + selectRange : function(startRow, endRow, keepExisting){ + var i; + if(this.isLocked()){ + return; + } + if(!keepExisting){ + this.clearSelections(); + } + if(startRow <= endRow){ + for(i = startRow; i <= endRow; i++){ + this.selectRow(i, true); + } + }else{ + for(i = startRow; i >= endRow; i--){ + this.selectRow(i, true); + } + } + }, + + /** + * Deselects a range of rows if the selection model + * {@link Ext.grid.AbstractSelectionModel#isLocked is not locked}. + * All rows in between startRow and endRow are also deselected. + * @param {Number} startRow The index of the first row in the range + * @param {Number} endRow The index of the last row in the range + */ + deselectRange : function(startRow, endRow, preventViewNotify){ + if(this.isLocked()){ + return; + } + for(var i = startRow; i <= endRow; i++){ + this.deselectRow(i, preventViewNotify); + } + }, + + /** + * Selects a row. Before selecting a row, checks if the selection model + * {@link Ext.grid.AbstractSelectionModel#isLocked is locked} and fires the + * {@link #beforerowselect} event. If these checks are satisfied the row + * will be selected and followed up by firing the {@link #rowselect} and + * {@link #selectionchange} events. + * @param {Number} row The index of the row to select + * @param {Boolean} keepExisting (optional) true to keep existing selections + * @param {Boolean} preventViewNotify (optional) Specify true to + * prevent notifying the view (disables updating the selected appearance) + */ + selectRow : function(index, keepExisting, preventViewNotify){ + if(this.isLocked() || (index < 0 || index >= this.grid.store.getCount()) || (keepExisting && this.isSelected(index))){ + return; + } + var r = this.grid.store.getAt(index); + if(r && this.fireEvent('beforerowselect', this, index, keepExisting, r) !== false){ + if(!keepExisting || this.singleSelect){ + this.clearSelections(); + } + this.selections.add(r); + this.last = this.lastActive = index; + if(!preventViewNotify){ + this.grid.getView().onRowSelect(index); + } + this.fireEvent('rowselect', this, index, r); + this.fireEvent('selectionchange', this); + } + }, + + /** + * Deselects a row. Before deselecting a row, checks if the selection model + * {@link Ext.grid.AbstractSelectionModel#isLocked is locked}. + * If this check is satisfied the row will be deselected and followed up by + * firing the {@link #rowdeselect} and {@link #selectionchange} events. + * @param {Number} row The index of the row to deselect + * @param {Boolean} preventViewNotify (optional) Specify true to + * prevent notifying the view (disables updating the selected appearance) + */ + deselectRow : function(index, preventViewNotify){ + if(this.isLocked()){ + return; + } + if(this.last == index){ + this.last = false; + } + if(this.lastActive == index){ + this.lastActive = false; + } + var r = this.grid.store.getAt(index); + if(r){ + this.selections.remove(r); + if(!preventViewNotify){ + this.grid.getView().onRowDeselect(index); + } + this.fireEvent('rowdeselect', this, index, r); + this.fireEvent('selectionchange', this); + } + }, + + // private + restoreLast : function(){ + if(this._last){ + this.last = this._last; + } + }, + + // private + acceptsNav : function(row, col, cm){ + return !cm.isHidden(col) && cm.isCellEditable(col, row); + }, + + // private + onEditorKey : function(field, e){ + var k = e.getKey(), + newCell, + g = this.grid, + last = g.lastEdit, + ed = g.activeEditor, + ae, last, r, c; + var shift = e.shiftKey; + if(k == e.TAB){ + e.stopEvent(); + ed.completeEdit(); + if(shift){ + newCell = g.walkCells(ed.row, ed.col-1, -1, this.acceptsNav, this); + }else{ + newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this); + } + }else if(k == e.ENTER){ + if(this.moveEditorOnEnter !== false){ + if(shift){ + newCell = g.walkCells(last.row - 1, last.col, -1, this.acceptsNav, this); + }else{ + newCell = g.walkCells(last.row + 1, last.col, 1, this.acceptsNav, this); + } + } + } + if(newCell){ + r = newCell[0]; + c = newCell[1]; + + if(last.row != r){ + this.selectRow(r); // *** highlight newly-selected cell and update selection + } + + if(g.isEditor && g.editing){ // *** handle tabbing while editorgrid is in edit mode + ae = g.activeEditor; + if(ae && ae.field.triggerBlur){ + // *** if activeEditor is a TriggerField, explicitly call its triggerBlur() method + ae.field.triggerBlur(); + } + } + g.startEditing(r, c); + } + }, + + destroy : function(){ + if(this.rowNav){ + this.rowNav.disable(); + this.rowNav = null; + } + Ext.grid.RowSelectionModel.superclass.destroy.call(this); + } +});/** + * @class Ext.grid.Column + *

This class encapsulates column configuration data to be used in the initialization of a + * {@link Ext.grid.ColumnModel ColumnModel}.

+ *

While subclasses are provided to render data in different ways, this class renders a passed + * data field unchanged and is usually used for textual columns.

+ */ +Ext.grid.Column = Ext.extend(Object, { + /** + * @cfg {Boolean} editable Optional. Defaults to true, enabling the configured + * {@link #editor}. Set to false to initially disable editing on this column. + * The initial configuration may be dynamically altered using + * {@link Ext.grid.ColumnModel}.{@link Ext.grid.ColumnModel#setEditable setEditable()}. + */ + /** + * @cfg {String} id Optional. A name which identifies this column (defaults to the column's initial + * ordinal position.) The id is used to create a CSS class name which is applied to all + * table cells (including headers) in that column (in this context the id does not need to be + * unique). The class name takes the form of
x-grid3-td-id
+ * Header cells will also receive this class name, but will also have the class
x-grid3-hd
+ * So, to target header cells, use CSS selectors such as:
.x-grid3-hd-row .x-grid3-td-id
+ * The {@link Ext.grid.GridPanel#autoExpandColumn} grid config option references the column via this + * unique identifier. + */ + /** + * @cfg {String} header Optional. The header text to be used as innerHTML + * (html tags are accepted) to display in the Grid view. Note: to + * have a clickable header with no text displayed use ' '. + */ + /** + * @cfg {Boolean} groupable Optional. If the grid is being rendered by an {@link Ext.grid.GroupingView}, this option + * may be used to disable the header menu item to group by the column selected. Defaults to true, + * which enables the header menu group option. Set to false to disable (but still show) the + * group option in the header menu for the column. See also {@link #groupName}. + */ + /** + * @cfg {String} groupName Optional. If the grid is being rendered by an {@link Ext.grid.GroupingView}, this option + * may be used to specify the text with which to prefix the group field value in the group header line. + * See also {@link #groupRenderer} and + * {@link Ext.grid.GroupingView}.{@link Ext.grid.GroupingView#showGroupName showGroupName}. + */ + /** + * @cfg {Function} groupRenderer

Optional. If the grid is being rendered by an {@link Ext.grid.GroupingView}, this option + * may be used to specify the function used to format the grouping field value for display in the group + * {@link #groupName header}. If a groupRenderer is not specified, the configured + * {@link #renderer} will be called; if a {@link #renderer} is also not specified + * the new value of the group field will be used.

+ *

The called function (either the groupRenderer or {@link #renderer}) will be + * passed the following parameters: + *

    + *
  • v : Object

    The new value of the group field.

  • + *
  • unused : undefined

    Unused parameter.

  • + *
  • r : Ext.data.Record

    The Record providing the data + * for the row which caused group change.

  • + *
  • rowIndex : Number

    The row index of the Record which caused group change.

  • + *
  • colIndex : Number

    The column index of the group field.

  • + *
  • ds : Ext.data.Store

    The Store which is providing the data Model.

  • + *

+ *

The function should return a string value.

+ */ + /** + * @cfg {String} emptyGroupText Optional. If the grid is being rendered by an {@link Ext.grid.GroupingView}, this option + * may be used to specify the text to display when there is an empty group value. Defaults to the + * {@link Ext.grid.GroupingView}.{@link Ext.grid.GroupingView#emptyGroupText emptyGroupText}. + */ + /** + * @cfg {String} dataIndex

Required. The name of the field in the + * grid's {@link Ext.data.Store}'s {@link Ext.data.Record} definition from + * which to draw the column's value.

+ */ + /** + * @cfg {Number} width + * Optional. The initial width in pixels of the column. + * The width of each column can also be affected if any of the following are configured: + *
    + *
  • {@link Ext.grid.GridPanel}.{@link Ext.grid.GridPanel#autoExpandColumn autoExpandColumn}
  • + *
  • {@link Ext.grid.GridView}.{@link Ext.grid.GridView#forceFit forceFit} + *
    + *

    By specifying forceFit:true, {@link #fixed non-fixed width} columns will be + * re-proportioned (based on the relative initial widths) to fill the width of the grid so + * that no horizontal scrollbar is shown.

    + *
  • + *
  • {@link Ext.grid.GridView}.{@link Ext.grid.GridView#autoFill autoFill}
  • + *
  • {@link Ext.grid.GridPanel}.{@link Ext.grid.GridPanel#minColumnWidth minColumnWidth}
  • + *

    Note: when the width of each column is determined, a space on the right side + * is reserved for the vertical scrollbar. The + * {@link Ext.grid.GridView}.{@link Ext.grid.GridView#scrollOffset scrollOffset} + * can be modified to reduce or eliminate the reserved offset.

    + */ + /** + * @cfg {Boolean} sortable Optional. true if sorting is to be allowed on this column. + * Defaults to the value of the {@link Ext.grid.ColumnModel#defaultSortable} property. + * Whether local/remote sorting is used is specified in {@link Ext.data.Store#remoteSort}. + */ + /** + * @cfg {Boolean} fixed Optional. true if the column width cannot be changed. Defaults to false. + */ + /** + * @cfg {Boolean} resizable Optional. false to disable column resizing. Defaults to true. + */ + /** + * @cfg {Boolean} menuDisabled Optional. true to disable the column menu. Defaults to false. + */ + /** + * @cfg {Boolean} hidden + * Optional. true to initially hide this column. Defaults to false. + * A hidden column {@link Ext.grid.GridPanel#enableColumnHide may be shown via the header row menu}. + * If a column is never to be shown, simply do not include this column in the Column Model at all. + */ + /** + * @cfg {String} tooltip Optional. A text string to use as the column header's tooltip. If Quicktips + * are enabled, this value will be used as the text of the quick tip, otherwise it will be set as the + * header's HTML title attribute. Defaults to ''. + */ + /** + * @cfg {Mixed} renderer + *

    For an alternative to specifying a renderer see {@link #xtype}

    + *

    Optional. A renderer is an 'interceptor' method which can be used transform data (value, + * appearance, etc.) before it is rendered). This may be specified in either of three ways: + *

      + *
    • A renderer function used to return HTML markup for a cell given the cell's data value.
    • + *
    • A string which references a property name of the {@link Ext.util.Format} class which + * provides a renderer function.
    • + *
    • An object specifying both the renderer function, and its execution scope (this + * reference) e.g.:
      
      +{
      +    fn: this.gridRenderer,
      +    scope: this
      +}
      +
    + * If not specified, the default renderer uses the raw data value.

    + *

    For information about the renderer function (passed parameters, etc.), see + * {@link Ext.grid.ColumnModel#setRenderer}. An example of specifying renderer function inline:

    
    +var companyColumn = {
    +   header: 'Company Name',
    +   dataIndex: 'company',
    +   renderer: function(value, metaData, record, rowIndex, colIndex, store) {
    +      // provide the logic depending on business rules
    +      // name of your own choosing to manipulate the cell depending upon
    +      // the data in the underlying Record object.
    +      if (value == 'whatever') {
    +          //metaData.css : String : A CSS class name to add to the TD element of the cell.
    +          //metaData.attr : String : An html attribute definition string to apply to
    +          //                         the data container element within the table
    +          //                         cell (e.g. 'style="color:red;"').
    +          metaData.css = 'name-of-css-class-you-will-define';
    +      }
    +      return value;
    +   }
    +}
    +     * 
    + * See also {@link #scope}. + */ + /** + * @cfg {String} xtype Optional. A String which references a predefined {@link Ext.grid.Column} subclass + * type which is preconfigured with an appropriate {@link #renderer} to be easily + * configured into a ColumnModel. The predefined {@link Ext.grid.Column} subclass types are: + *
      + *
    • gridcolumn : {@link Ext.grid.Column} (Default)

    • + *
    • booleancolumn : {@link Ext.grid.BooleanColumn}

    • + *
    • numbercolumn : {@link Ext.grid.NumberColumn}

    • + *
    • datecolumn : {@link Ext.grid.DateColumn}

    • + *
    • templatecolumn : {@link Ext.grid.TemplateColumn}

    • + *
    + *

    Configuration properties for the specified xtype may be specified with + * the Column configuration properties, for example:

    + *
    
    +var grid = new Ext.grid.GridPanel({
    +    ...
    +    columns: [{
    +        header: 'Last Updated',
    +        dataIndex: 'lastChange',
    +        width: 85,
    +        sortable: true,
    +        //renderer: Ext.util.Format.dateRenderer('m/d/Y'),
    +        xtype: 'datecolumn', // use xtype instead of renderer
    +        format: 'M/d/Y' // configuration property for {@link Ext.grid.DateColumn}
    +    }, {
    +        ...
    +    }]
    +});
    +     * 
    + */ + /** + * @cfg {Object} scope Optional. The scope (this reference) in which to execute the + * renderer. Defaults to the Column configuration object. + */ + /** + * @cfg {String} align Optional. Set the CSS text-align property of the column. Defaults to undefined. + */ + /** + * @cfg {String} css Optional. An inline style definition string which is applied to all table cells in the column + * (excluding headers). Defaults to undefined. + */ + /** + * @cfg {Boolean} hideable Optional. Specify as false to prevent the user from hiding this column + * (defaults to true). To disallow column hiding globally for all columns in the grid, use + * {@link Ext.grid.GridPanel#enableColumnHide} instead. + */ + /** + * @cfg {Ext.form.Field} editor Optional. The {@link Ext.form.Field} to use when editing values in this column + * if editing is supported by the grid. See {@link #editable} also. + */ + + /** + * @private + * @cfg {Boolean} isColumn + * Used by ColumnModel setConfig method to avoid reprocessing a Column + * if isColumn is not set ColumnModel will recreate a new Ext.grid.Column + * Defaults to true. + */ + isColumn : true, + + constructor : function(config){ + Ext.apply(this, config); + + if(Ext.isString(this.renderer)){ + this.renderer = Ext.util.Format[this.renderer]; + }else if(Ext.isObject(this.renderer)){ + this.scope = this.renderer.scope; + this.renderer = this.renderer.fn; + } + if(!this.scope){ + this.scope = this; + } + + var ed = this.editor; + delete this.editor; + this.setEditor(ed); + }, + + /** + * Optional. A function which returns displayable data when passed the following parameters: + *
      + *
    • value : Object

      The data value for the cell.

    • + *
    • metadata : Object

      An object in which you may set the following attributes:

        + *
      • css : String

        A CSS class name to add to the cell's TD element.

      • + *
      • attr : String

        An HTML attribute definition string to apply to the data container + * element within the table cell (e.g. 'style="color:red;"').

    • + *
    • record : Ext.data.record

      The {@link Ext.data.Record} from which the data was + * extracted.

    • + *
    • rowIndex : Number

      Row index

    • + *
    • colIndex : Number

      Column index

    • + *
    • store : Ext.data.Store

      The {@link Ext.data.Store} object from which the Record + * was extracted.

    • + *
    + * @property renderer + * @type Function + */ + renderer : function(value){ + if(Ext.isString(value) && value.length < 1){ + return ' '; + } + return value; + }, + + // private + getEditor: function(rowIndex){ + return this.editable !== false ? this.editor : null; + }, + + /** + * Sets a new editor for this column. + * @param {Ext.Editor/Ext.form.Field} editor The editor to set + */ + setEditor : function(editor){ + var ed = this.editor; + if(ed){ + if(ed.gridEditor){ + ed.gridEditor.destroy(); + delete ed.gridEditor; + }else{ + ed.destroy(); + } + } + this.editor = null; + if(editor){ + //not an instance, create it + if(!editor.isXType){ + editor = Ext.create(editor, 'textfield'); + } + this.editor = editor; + } + }, + + /** + * Returns the {@link Ext.Editor editor} defined for this column that was created to wrap the {@link Ext.form.Field Field} + * used to edit the cell. + * @param {Number} rowIndex The row index + * @return {Ext.Editor} + */ + getCellEditor: function(rowIndex){ + var ed = this.getEditor(rowIndex); + if(ed){ + if(!ed.startEdit){ + if(!ed.gridEditor){ + ed.gridEditor = new Ext.grid.GridEditor(ed); + } + ed = ed.gridEditor; + } + } + return ed; + } +}); + +/** + * @class Ext.grid.BooleanColumn + * @extends Ext.grid.Column + *

    A Column definition class which renders boolean data fields. See the {@link Ext.grid.Column#xtype xtype} + * config option of {@link Ext.grid.Column} for more details.

    + */ +Ext.grid.BooleanColumn = Ext.extend(Ext.grid.Column, { + /** + * @cfg {String} trueText + * The string returned by the renderer when the column value is not falsey (defaults to 'true'). + */ + trueText: 'true', + /** + * @cfg {String} falseText + * The string returned by the renderer when the column value is falsey (but not undefined) (defaults to + * 'false'). + */ + falseText: 'false', + /** + * @cfg {String} undefinedText + * The string returned by the renderer when the column value is undefined (defaults to ' '). + */ + undefinedText: ' ', + + constructor: function(cfg){ + Ext.grid.BooleanColumn.superclass.constructor.call(this, cfg); + var t = this.trueText, f = this.falseText, u = this.undefinedText; + this.renderer = function(v){ + if(v === undefined){ + return u; + } + if(!v || v === 'false'){ + return f; + } + return t; + }; + } +}); + +/** + * @class Ext.grid.NumberColumn + * @extends Ext.grid.Column + *

    A Column definition class which renders a numeric data field according to a {@link #format} string. See the + * {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column} for more details.

    + */ +Ext.grid.NumberColumn = Ext.extend(Ext.grid.Column, { + /** + * @cfg {String} format + * A formatting string as used by {@link Ext.util.Format#number} to format a numeric value for this Column + * (defaults to '0,000.00'). + */ + format : '0,000.00', + constructor: function(cfg){ + Ext.grid.NumberColumn.superclass.constructor.call(this, cfg); + this.renderer = Ext.util.Format.numberRenderer(this.format); + } +}); + +/** + * @class Ext.grid.DateColumn + * @extends Ext.grid.Column + *

    A Column definition class which renders a passed date according to the default locale, or a configured + * {@link #format}. See the {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column} + * for more details.

    + */ +Ext.grid.DateColumn = Ext.extend(Ext.grid.Column, { + /** + * @cfg {String} format + * A formatting string as used by {@link Date#format} to format a Date for this Column + * (defaults to 'm/d/Y'). + */ + format : 'm/d/Y', + constructor: function(cfg){ + Ext.grid.DateColumn.superclass.constructor.call(this, cfg); + this.renderer = Ext.util.Format.dateRenderer(this.format); + } +}); + +/** + * @class Ext.grid.TemplateColumn + * @extends Ext.grid.Column + *

    A Column definition class which renders a value by processing a {@link Ext.data.Record Record}'s + * {@link Ext.data.Record#data data} using a {@link #tpl configured} {@link Ext.XTemplate XTemplate}. + * See the {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column} for more + * details.

    + */ +Ext.grid.TemplateColumn = Ext.extend(Ext.grid.Column, { + /** + * @cfg {String/XTemplate} tpl + * An {@link Ext.XTemplate XTemplate}, or an XTemplate definition string to use to process a + * {@link Ext.data.Record Record}'s {@link Ext.data.Record#data data} to produce a column's rendered value. + */ + constructor: function(cfg){ + Ext.grid.TemplateColumn.superclass.constructor.call(this, cfg); + var tpl = (!Ext.isPrimitive(this.tpl) && this.tpl.compile) ? this.tpl : new Ext.XTemplate(this.tpl); + this.renderer = function(value, p, r){ + return tpl.apply(r.data); + }; + this.tpl = tpl; + } +}); + +/* + * @property types + * @type Object + * @member Ext.grid.Column + * @static + *

    An object containing predefined Column classes keyed by a mnemonic code which may be referenced + * by the {@link Ext.grid.ColumnModel#xtype xtype} config option of ColumnModel.

    + *

    This contains the following properties

      + *
    • gridcolumn : {@link Ext.grid.Column Column constructor}
    • + *
    • booleancolumn : {@link Ext.grid.BooleanColumn BooleanColumn constructor}
    • + *
    • numbercolumn : {@link Ext.grid.NumberColumn NumberColumn constructor}
    • + *
    • datecolumn : {@link Ext.grid.DateColumn DateColumn constructor}
    • + *
    • templatecolumn : {@link Ext.grid.TemplateColumn TemplateColumn constructor}
    • + *
    + */ +Ext.grid.Column.types = { + gridcolumn : Ext.grid.Column, + booleancolumn: Ext.grid.BooleanColumn, + numbercolumn: Ext.grid.NumberColumn, + datecolumn: Ext.grid.DateColumn, + templatecolumn: Ext.grid.TemplateColumn +};/** + * @class Ext.grid.RowNumberer + * This is a utility class that can be passed into a {@link Ext.grid.ColumnModel} as a column config that provides + * an automatic row numbering column. + *
    Usage:
    +
    
    + // This is a typical column config with the first column providing row numbers
    + var colModel = new Ext.grid.ColumnModel([
    +    new Ext.grid.RowNumberer(),
    +    {header: "Name", width: 80, sortable: true},
    +    {header: "Code", width: 50, sortable: true},
    +    {header: "Description", width: 200, sortable: true}
    + ]);
    + 
    + * @constructor + * @param {Object} config The configuration options + */ +Ext.grid.RowNumberer = Ext.extend(Object, { + /** + * @cfg {String} header Any valid text or HTML fragment to display in the header cell for the row + * number column (defaults to ''). + */ + header: "", + /** + * @cfg {Number} width The default width in pixels of the row number column (defaults to 23). + */ + width: 23, + /** + * @cfg {Boolean} sortable True if the row number column is sortable (defaults to false). + * @hide + */ + sortable: false, + + constructor : function(config){ + Ext.apply(this, config); + if(this.rowspan){ + this.renderer = this.renderer.createDelegate(this); + } + }, + + // private + fixed:true, + hideable: false, + menuDisabled:true, + dataIndex: '', + id: 'numberer', + rowspan: undefined, + + // private + renderer : function(v, p, record, rowIndex){ + if(this.rowspan){ + p.cellAttr = 'rowspan="'+this.rowspan+'"'; + } + return rowIndex+1; + } +});/** + * @class Ext.grid.CheckboxSelectionModel + * @extends Ext.grid.RowSelectionModel + * A custom selection model that renders a column of checkboxes that can be toggled to select or deselect rows. + * @constructor + * @param {Object} config The configuration options + */ +Ext.grid.CheckboxSelectionModel = Ext.extend(Ext.grid.RowSelectionModel, { + + /** + * @cfg {Boolean} checkOnly true if rows can only be selected by clicking on the + * checkbox column (defaults to false). + */ + /** + * @cfg {String} header Any valid text or HTML fragment to display in the header cell for the + * checkbox column. Defaults to:
    
    +     * '<div class="x-grid3-hd-checker">&#160;</div>'
    +     * 
    + * The default CSS class of 'x-grid3-hd-checker' displays a checkbox in the header + * and provides support for automatic check all/none behavior on header click. This string + * can be replaced by any valid HTML fragment, including a simple text string (e.g., + * 'Select Rows'), but the automatic check all/none behavior will only work if the + * 'x-grid3-hd-checker' class is supplied. + */ + header : '
     
    ', + /** + * @cfg {Number} width The default width in pixels of the checkbox column (defaults to 20). + */ + width : 20, + /** + * @cfg {Boolean} sortable true if the checkbox column is sortable (defaults to + * false). + */ + sortable : false, + + // private + menuDisabled : true, + fixed : true, + hideable: false, + dataIndex : '', + id : 'checker', + + constructor : function(){ + Ext.grid.CheckboxSelectionModel.superclass.constructor.apply(this, arguments); + + if(this.checkOnly){ + this.handleMouseDown = Ext.emptyFn; + } + }, + + // private + initEvents : function(){ + Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this); + this.grid.on('render', function(){ + var view = this.grid.getView(); + view.mainBody.on('mousedown', this.onMouseDown, this); + Ext.fly(view.innerHd).on('mousedown', this.onHdMouseDown, this); + + }, this); + }, + + // If handleMouseDown was called from another event (enableDragDrop), set a flag so + // onMouseDown does not process it a second time + handleMouseDown : function() { + Ext.grid.CheckboxSelectionModel.superclass.handleMouseDown.apply(this, arguments); + this.mouseHandled = true; + }, + + // private + onMouseDown : function(e, t){ + if(e.button === 0 && t.className == 'x-grid3-row-checker'){ // Only fire if left-click + e.stopEvent(); + var row = e.getTarget('.x-grid3-row'); + + // mouseHandled flag check for a duplicate selection (handleMouseDown) call + if(!this.mouseHandled && row){ + var index = row.rowIndex; + if(this.isSelected(index)){ + this.deselectRow(index); + }else{ + this.selectRow(index, true); + this.grid.getView().focusRow(index); + } + } + } + this.mouseHandled = false; + }, + + // private + onHdMouseDown : function(e, t){ + if(t.className == 'x-grid3-hd-checker'){ + e.stopEvent(); + var hd = Ext.fly(t.parentNode); + var isChecked = hd.hasClass('x-grid3-hd-checker-on'); + if(isChecked){ + hd.removeClass('x-grid3-hd-checker-on'); + this.clearSelections(); + }else{ + hd.addClass('x-grid3-hd-checker-on'); + this.selectAll(); + } + } + }, + + // private + renderer : function(v, p, record){ + return '
     
    '; + } +});/** + * @class Ext.grid.CellSelectionModel + * @extends Ext.grid.AbstractSelectionModel + * This class provides the basic implementation for single cell selection in a grid. + * The object stored as the selection contains the following properties: + *
      + *
    • cell : see {@link #getSelectedCell} + *
    • record : Ext.data.record The {@link Ext.data.Record Record} + * which provides the data for the row containing the selection
    • + *
    + * @constructor + * @param {Object} config The object containing the configuration of this model. + */ +Ext.grid.CellSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { + + constructor : function(config){ + Ext.apply(this, config); + + this.selection = null; + + this.addEvents( + /** + * @event beforecellselect + * Fires before a cell is selected, return false to cancel the selection. + * @param {SelectionModel} this + * @param {Number} rowIndex The selected row index + * @param {Number} colIndex The selected cell index + */ + "beforecellselect", + /** + * @event cellselect + * Fires when a cell is selected. + * @param {SelectionModel} this + * @param {Number} rowIndex The selected row index + * @param {Number} colIndex The selected cell index + */ + "cellselect", + /** + * @event selectionchange + * Fires when the active selection changes. + * @param {SelectionModel} this + * @param {Object} selection null for no selection or an object with two properties + *
      + *
    • cell : see {@link #getSelectedCell} + *
    • record : Ext.data.record

      The {@link Ext.data.Record Record} + * which provides the data for the row containing the selection

    • + *
    + */ + "selectionchange" + ); + + Ext.grid.CellSelectionModel.superclass.constructor.call(this); + }, + + /** @ignore */ + initEvents : function(){ + this.grid.on('cellmousedown', this.handleMouseDown, this); + this.grid.on(Ext.EventManager.useKeydown ? 'keydown' : 'keypress', this.handleKeyDown, this); + this.grid.getView().on({ + scope: this, + refresh: this.onViewChange, + rowupdated: this.onRowUpdated, + beforerowremoved: this.clearSelections, + beforerowsinserted: this.clearSelections + }); + if(this.grid.isEditor){ + this.grid.on('beforeedit', this.beforeEdit, this); + } + }, + + //private + beforeEdit : function(e){ + this.select(e.row, e.column, false, true, e.record); + }, + + //private + onRowUpdated : function(v, index, r){ + if(this.selection && this.selection.record == r){ + v.onCellSelect(index, this.selection.cell[1]); + } + }, + + //private + onViewChange : function(){ + this.clearSelections(true); + }, + + /** + * Returns an array containing the row and column indexes of the currently selected cell + * (e.g., [0, 0]), or null if none selected. The array has elements: + *
      + *
    • rowIndex : Number

      The index of the selected row

    • + *
    • cellIndex : Number

      The index of the selected cell. + * Due to possible column reordering, the cellIndex should not be used as an + * index into the Record's data. Instead, use the cellIndex to determine the name + * of the selected cell and use the field name to retrieve the data value from the record:

      
      +// get name
      +var fieldName = grid.getColumnModel().getDataIndex(cellIndex);
      +// get data value based on name
      +var data = record.get(fieldName);
      +     * 

    • + *
    + * @return {Array} An array containing the row and column indexes of the selected cell, or null if none selected. + */ + getSelectedCell : function(){ + return this.selection ? this.selection.cell : null; + }, + + /** + * If anything is selected, clears all selections and fires the selectionchange event. + * @param {Boolean} preventNotify true to prevent the gridview from + * being notified about the change. + */ + clearSelections : function(preventNotify){ + var s = this.selection; + if(s){ + if(preventNotify !== true){ + this.grid.view.onCellDeselect(s.cell[0], s.cell[1]); + } + this.selection = null; + this.fireEvent("selectionchange", this, null); + } + }, + + /** + * Returns true if there is a selection. + * @return {Boolean} + */ + hasSelection : function(){ + return this.selection ? true : false; + }, + + /** @ignore */ + handleMouseDown : function(g, row, cell, e){ + if(e.button !== 0 || this.isLocked()){ + return; + } + this.select(row, cell); + }, + + /** + * Selects a cell. Before selecting a cell, fires the + * {@link #beforecellselect} event. If this check is satisfied the cell + * will be selected and followed up by firing the {@link #cellselect} and + * {@link #selectionchange} events. + * @param {Number} rowIndex The index of the row to select + * @param {Number} colIndex The index of the column to select + * @param {Boolean} preventViewNotify (optional) Specify true to + * prevent notifying the view (disables updating the selected appearance) + * @param {Boolean} preventFocus (optional) Whether to prevent the cell at + * the specified rowIndex / colIndex from being focused. + * @param {Ext.data.Record} r (optional) The record to select + */ + select : function(rowIndex, colIndex, preventViewNotify, preventFocus, /*internal*/ r){ + if(this.fireEvent("beforecellselect", this, rowIndex, colIndex) !== false){ + this.clearSelections(); + r = r || this.grid.store.getAt(rowIndex); + this.selection = { + record : r, + cell : [rowIndex, colIndex] + }; + if(!preventViewNotify){ + var v = this.grid.getView(); + v.onCellSelect(rowIndex, colIndex); + if(preventFocus !== true){ + v.focusCell(rowIndex, colIndex); + } + } + this.fireEvent("cellselect", this, rowIndex, colIndex); + this.fireEvent("selectionchange", this, this.selection); + } + }, + + //private + isSelectable : function(rowIndex, colIndex, cm){ + return !cm.isHidden(colIndex); + }, + + // private + onEditorKey: function(field, e){ + if(e.getKey() == e.TAB){ + this.handleKeyDown(e); + } + }, + + /** @ignore */ + handleKeyDown : function(e){ + if(!e.isNavKeyPress()){ + return; + } + + var k = e.getKey(), + g = this.grid, + s = this.selection, + sm = this, + walk = function(row, col, step){ + return g.walkCells( + row, + col, + step, + g.isEditor && g.editing ? sm.acceptsNav : sm.isSelectable, // *** handle tabbing while editorgrid is in edit mode + sm + ); + }, + cell, newCell, r, c, ae; + + switch(k){ + case e.ESC: + case e.PAGE_UP: + case e.PAGE_DOWN: + // do nothing + break; + default: + // *** call e.stopEvent() only for non ESC, PAGE UP/DOWN KEYS + e.stopEvent(); + break; + } + + if(!s){ + cell = walk(0, 0, 1); // *** use private walk() function defined above + if(cell){ + this.select(cell[0], cell[1]); + } + return; + } + + cell = s.cell; // currently selected cell + r = cell[0]; // current row + c = cell[1]; // current column + + switch(k){ + case e.TAB: + if(e.shiftKey){ + newCell = walk(r, c - 1, -1); + }else{ + newCell = walk(r, c + 1, 1); + } + break; + case e.DOWN: + newCell = walk(r + 1, c, 1); + break; + case e.UP: + newCell = walk(r - 1, c, -1); + break; + case e.RIGHT: + newCell = walk(r, c + 1, 1); + break; + case e.LEFT: + newCell = walk(r, c - 1, -1); + break; + case e.ENTER: + if (g.isEditor && !g.editing) { + g.startEditing(r, c); + return; + } + break; + } + + if(newCell){ + // *** reassign r & c variables to newly-selected cell's row and column + r = newCell[0]; + c = newCell[1]; + + this.select(r, c); // *** highlight newly-selected cell and update selection + + if(g.isEditor && g.editing){ // *** handle tabbing while editorgrid is in edit mode + ae = g.activeEditor; + if(ae && ae.field.triggerBlur){ + // *** if activeEditor is a TriggerField, explicitly call its triggerBlur() method + ae.field.triggerBlur(); + } + g.startEditing(r, c); + } + } + }, + + acceptsNav : function(row, col, cm){ + return !cm.isHidden(col) && cm.isCellEditable(col, row); + } +});/** + * @class Ext.grid.EditorGridPanel + * @extends Ext.grid.GridPanel + *

    This class extends the {@link Ext.grid.GridPanel GridPanel Class} to provide cell editing + * on selected {@link Ext.grid.Column columns}. The editable columns are specified by providing + * an {@link Ext.grid.ColumnModel#editor editor} in the {@link Ext.grid.Column column configuration}.

    + *

    Editability of columns may be controlled programatically by inserting an implementation + * of {@link Ext.grid.ColumnModel#isCellEditable isCellEditable} into the + * {@link Ext.grid.ColumnModel ColumnModel}.

    + *

    Editing is performed on the value of the field specified by the column's + * {@link Ext.grid.ColumnModel#dataIndex dataIndex} in the backing {@link Ext.data.Store Store} + * (so if you are using a {@link Ext.grid.ColumnModel#setRenderer renderer} in order to display + * transformed data, this must be accounted for).

    + *

    If a value-to-description mapping is used to render a column, then a {@link Ext.form.Field#ComboBox ComboBox} + * which uses the same {@link Ext.form.Field#valueField value}-to-{@link Ext.form.Field#displayFieldField description} + * mapping would be an appropriate editor.

    + * If there is a more complex mismatch between the visible data in the grid, and the editable data in + * the {@link Edt.data.Store Store}, then code to transform the data both before and after editing can be + * injected using the {@link #beforeedit} and {@link #afteredit} events. + * @constructor + * @param {Object} config The config object + * @xtype editorgrid + */ +Ext.grid.EditorGridPanel = Ext.extend(Ext.grid.GridPanel, { + /** + * @cfg {Number} clicksToEdit + *

    The number of clicks on a cell required to display the cell's editor (defaults to 2).

    + *

    Setting this option to 'auto' means that mousedown on the selected cell starts + * editing that cell.

    + */ + clicksToEdit: 2, + + /** + * @cfg {Boolean} forceValidation + * True to force validation even if the value is unmodified (defaults to false) + */ + forceValidation: false, + + // private + isEditor : true, + // private + detectEdit: false, + + /** + * @cfg {Boolean} autoEncode + * True to automatically HTML encode and decode values pre and post edit (defaults to false) + */ + autoEncode : false, + + /** + * @cfg {Boolean} trackMouseOver @hide + */ + // private + trackMouseOver: false, // causes very odd FF errors + + // private + initComponent : function(){ + Ext.grid.EditorGridPanel.superclass.initComponent.call(this); + + if(!this.selModel){ + /** + * @cfg {Object} selModel Any subclass of AbstractSelectionModel that will provide the selection model for + * the grid (defaults to {@link Ext.grid.CellSelectionModel} if not specified). + */ + this.selModel = new Ext.grid.CellSelectionModel(); + } + + this.activeEditor = null; + + this.addEvents( + /** + * @event beforeedit + * Fires before cell editing is triggered. The edit event object has the following properties
    + *
      + *
    • grid - This grid
    • + *
    • record - The record being edited
    • + *
    • field - The field name being edited
    • + *
    • value - The value for the field being edited.
    • + *
    • row - The grid row index
    • + *
    • column - The grid column index
    • + *
    • cancel - Set this to true to cancel the edit or return false from your handler.
    • + *
    + * @param {Object} e An edit event (see above for description) + */ + "beforeedit", + /** + * @event afteredit + * Fires after a cell is edited. The edit event object has the following properties
    + *
      + *
    • grid - This grid
    • + *
    • record - The record being edited
    • + *
    • field - The field name being edited
    • + *
    • value - The value being set
    • + *
    • originalValue - The original value for the field, before the edit.
    • + *
    • row - The grid row index
    • + *
    • column - The grid column index
    • + *
    + * + *
    
    +grid.on('afteredit', afterEdit, this );
    +
    +function afterEdit(e) {
    +    // execute an XHR to send/commit data to the server, in callback do (if successful):
    +    e.record.commit();
    +};
    +             * 
    + * @param {Object} e An edit event (see above for description) + */ + "afteredit", + /** + * @event validateedit + * Fires after a cell is edited, but before the value is set in the record. Return false + * to cancel the change. The edit event object has the following properties
    + *
      + *
    • grid - This grid
    • + *
    • record - The record being edited
    • + *
    • field - The field name being edited
    • + *
    • value - The value being set
    • + *
    • originalValue - The original value for the field, before the edit.
    • + *
    • row - The grid row index
    • + *
    • column - The grid column index
    • + *
    • cancel - Set this to true to cancel the edit or return false from your handler.
    • + *
    + * Usage example showing how to remove the red triangle (dirty record indicator) from some + * records (not all). By observing the grid's validateedit event, it can be cancelled if + * the edit occurs on a targeted row (for example) and then setting the field's new value + * in the Record directly: + *
    
    +grid.on('validateedit', function(e) {
    +  var myTargetRow = 6;
    +
    +  if (e.row == myTargetRow) {
    +    e.cancel = true;
    +    e.record.data[e.field] = e.value;
    +  }
    +});
    +             * 
    + * @param {Object} e An edit event (see above for description) + */ + "validateedit" + ); + }, + + // private + initEvents : function(){ + Ext.grid.EditorGridPanel.superclass.initEvents.call(this); + + this.getGridEl().on('mousewheel', this.stopEditing.createDelegate(this, [true]), this); + this.on('columnresize', this.stopEditing, this, [true]); + + if(this.clicksToEdit == 1){ + this.on("cellclick", this.onCellDblClick, this); + }else { + var view = this.getView(); + if(this.clicksToEdit == 'auto' && view.mainBody){ + view.mainBody.on('mousedown', this.onAutoEditClick, this); + } + this.on('celldblclick', this.onCellDblClick, this); + } + }, + + onResize : function(){ + Ext.grid.EditorGridPanel.superclass.onResize.apply(this, arguments); + var ae = this.activeEditor; + if(this.editing && ae){ + ae.realign(true); + } + }, + + // private + onCellDblClick : function(g, row, col){ + this.startEditing(row, col); + }, + + // private + onAutoEditClick : function(e, t){ + if(e.button !== 0){ + return; + } + var row = this.view.findRowIndex(t), + col = this.view.findCellIndex(t); + if(row !== false && col !== false){ + this.stopEditing(); + if(this.selModel.getSelectedCell){ // cell sm + var sc = this.selModel.getSelectedCell(); + if(sc && sc[0] === row && sc[1] === col){ + this.startEditing(row, col); + } + }else{ + if(this.selModel.isSelected(row)){ + this.startEditing(row, col); + } + } + } + }, + + // private + onEditComplete : function(ed, value, startValue){ + this.editing = false; + this.lastActiveEditor = this.activeEditor; + this.activeEditor = null; + + var r = ed.record, + field = this.colModel.getDataIndex(ed.col); + value = this.postEditValue(value, startValue, r, field); + if(this.forceValidation === true || String(value) !== String(startValue)){ + var e = { + grid: this, + record: r, + field: field, + originalValue: startValue, + value: value, + row: ed.row, + column: ed.col, + cancel:false + }; + if(this.fireEvent("validateedit", e) !== false && !e.cancel && String(value) !== String(startValue)){ + r.set(field, e.value); + delete e.cancel; + this.fireEvent("afteredit", e); + } + } + this.view.focusCell(ed.row, ed.col); + }, + + /** + * Starts editing the specified for the specified row/column + * @param {Number} rowIndex + * @param {Number} colIndex + */ + startEditing : function(row, col){ + this.stopEditing(); + if(this.colModel.isCellEditable(col, row)){ + this.view.ensureVisible(row, col, true); + var r = this.store.getAt(row), + field = this.colModel.getDataIndex(col), + e = { + grid: this, + record: r, + field: field, + value: r.data[field], + row: row, + column: col, + cancel:false + }; + if(this.fireEvent("beforeedit", e) !== false && !e.cancel){ + this.editing = true; + var ed = this.colModel.getCellEditor(col, row); + if(!ed){ + return; + } + if(!ed.rendered){ + ed.parentEl = this.view.getEditorParent(ed); + ed.on({ + scope: this, + render: { + fn: function(c){ + c.field.focus(false, true); + }, + single: true, + scope: this + }, + specialkey: function(field, e){ + this.getSelectionModel().onEditorKey(field, e); + }, + complete: this.onEditComplete, + canceledit: this.stopEditing.createDelegate(this, [true]) + }); + } + Ext.apply(ed, { + row : row, + col : col, + record : r + }); + this.lastEdit = { + row: row, + col: col + }; + this.activeEditor = ed; + // Set the selectSameEditor flag if we are reusing the same editor again and + // need to prevent the editor from firing onBlur on itself. + ed.selectSameEditor = (this.activeEditor == this.lastActiveEditor); + var v = this.preEditValue(r, field); + ed.startEdit(this.view.getCell(row, col).firstChild, Ext.isDefined(v) ? v : ''); + + // Clear the selectSameEditor flag + (function(){ + delete ed.selectSameEditor; + }).defer(50); + } + } + }, + + // private + preEditValue : function(r, field){ + var value = r.data[field]; + return this.autoEncode && Ext.isString(value) ? Ext.util.Format.htmlDecode(value) : value; + }, + + // private + postEditValue : function(value, originalValue, r, field){ + return this.autoEncode && Ext.isString(value) ? Ext.util.Format.htmlEncode(value) : value; + }, + + /** + * Stops any active editing + * @param {Boolean} cancel (optional) True to cancel any changes + */ + stopEditing : function(cancel){ + if(this.editing){ + // Store the lastActiveEditor to check if it is changing + var ae = this.lastActiveEditor = this.activeEditor; + if(ae){ + ae[cancel === true ? 'cancelEdit' : 'completeEdit'](); + this.view.focusCell(ae.row, ae.col); + } + this.activeEditor = null; + } + this.editing = false; + } +}); +Ext.reg('editorgrid', Ext.grid.EditorGridPanel);// private +// This is a support class used internally by the Grid components +Ext.grid.GridEditor = function(field, config){ + Ext.grid.GridEditor.superclass.constructor.call(this, field, config); + field.monitorTab = false; +}; + +Ext.extend(Ext.grid.GridEditor, Ext.Editor, { + alignment: "tl-tl", + autoSize: "width", + hideEl : false, + cls: "x-small-editor x-grid-editor", + shim:false, + shadow:false +});/** + * @class Ext.grid.PropertyRecord + * A specific {@link Ext.data.Record} type that represents a name/value pair and is made to work with the + * {@link Ext.grid.PropertyGrid}. Typically, PropertyRecords do not need to be created directly as they can be + * created implicitly by simply using the appropriate data configs either via the {@link Ext.grid.PropertyGrid#source} + * config property or by calling {@link Ext.grid.PropertyGrid#setSource}. However, if the need arises, these records + * can also be created explicitly as shwon below. Example usage: + *
    
    +var rec = new Ext.grid.PropertyRecord({
    +    name: 'Birthday',
    +    value: new Date(Date.parse('05/26/1972'))
    +});
    +// Add record to an already populated grid
    +grid.store.addSorted(rec);
    +
    + * @constructor + * @param {Object} config A data object in the format: {name: [name], value: [value]}. The specified value's type + * will be read automatically by the grid to determine the type of editor to use when displaying it. + */ +Ext.grid.PropertyRecord = Ext.data.Record.create([ + {name:'name',type:'string'}, 'value' +]); + +/** + * @class Ext.grid.PropertyStore + * @extends Ext.util.Observable + * A custom wrapper for the {@link Ext.grid.PropertyGrid}'s {@link Ext.data.Store}. This class handles the mapping + * between the custom data source objects supported by the grid and the {@link Ext.grid.PropertyRecord} format + * required for compatibility with the underlying store. Generally this class should not need to be used directly -- + * the grid's data should be accessed from the underlying store via the {@link #store} property. + * @constructor + * @param {Ext.grid.Grid} grid The grid this store will be bound to + * @param {Object} source The source data config object + */ +Ext.grid.PropertyStore = Ext.extend(Ext.util.Observable, { + + constructor : function(grid, source){ + this.grid = grid; + this.store = new Ext.data.Store({ + recordType : Ext.grid.PropertyRecord + }); + this.store.on('update', this.onUpdate, this); + if(source){ + this.setSource(source); + } + Ext.grid.PropertyStore.superclass.constructor.call(this); + }, + + // protected - should only be called by the grid. Use grid.setSource instead. + setSource : function(o){ + this.source = o; + this.store.removeAll(); + var data = []; + for(var k in o){ + if(this.isEditableValue(o[k])){ + data.push(new Ext.grid.PropertyRecord({name: k, value: o[k]}, k)); + } + } + this.store.loadRecords({records: data}, {}, true); + }, + + // private + onUpdate : function(ds, record, type){ + if(type == Ext.data.Record.EDIT){ + var v = record.data.value; + var oldValue = record.modified.value; + if(this.grid.fireEvent('beforepropertychange', this.source, record.id, v, oldValue) !== false){ + this.source[record.id] = v; + record.commit(); + this.grid.fireEvent('propertychange', this.source, record.id, v, oldValue); + }else{ + record.reject(); + } + } + }, + + // private + getProperty : function(row){ + return this.store.getAt(row); + }, + + // private + isEditableValue: function(val){ + return Ext.isPrimitive(val) || Ext.isDate(val); + }, + + // private + setValue : function(prop, value, create){ + var r = this.getRec(prop); + if(r){ + r.set('value', value); + this.source[prop] = value; + }else if(create){ + // only create if specified. + this.source[prop] = value; + r = new Ext.grid.PropertyRecord({name: prop, value: value}, prop); + this.store.add(r); + + } + }, + + // private + remove : function(prop){ + var r = this.getRec(prop); + if(r){ + this.store.remove(r); + delete this.source[prop]; + } + }, + + // private + getRec : function(prop){ + return this.store.getById(prop); + }, + + // protected - should only be called by the grid. Use grid.getSource instead. + getSource : function(){ + return this.source; + } +}); + +/** + * @class Ext.grid.PropertyColumnModel + * @extends Ext.grid.ColumnModel + * A custom column model for the {@link Ext.grid.PropertyGrid}. Generally it should not need to be used directly. + * @constructor + * @param {Ext.grid.Grid} grid The grid this store will be bound to + * @param {Object} source The source data config object + */ +Ext.grid.PropertyColumnModel = Ext.extend(Ext.grid.ColumnModel, { + // private - strings used for locale support + nameText : 'Name', + valueText : 'Value', + dateFormat : 'm/j/Y', + trueText: 'true', + falseText: 'false', + + constructor : function(grid, store){ + var g = Ext.grid, + f = Ext.form; + + this.grid = grid; + g.PropertyColumnModel.superclass.constructor.call(this, [ + {header: this.nameText, width:50, sortable: true, dataIndex:'name', id: 'name', menuDisabled:true}, + {header: this.valueText, width:50, resizable:false, dataIndex: 'value', id: 'value', menuDisabled:true} + ]); + this.store = store; + + var bfield = new f.Field({ + autoCreate: {tag: 'select', children: [ + {tag: 'option', value: 'true', html: this.trueText}, + {tag: 'option', value: 'false', html: this.falseText} + ]}, + getValue : function(){ + return this.el.dom.value == 'true'; + } + }); + this.editors = { + 'date' : new g.GridEditor(new f.DateField({selectOnFocus:true})), + 'string' : new g.GridEditor(new f.TextField({selectOnFocus:true})), + 'number' : new g.GridEditor(new f.NumberField({selectOnFocus:true, style:'text-align:left;'})), + 'boolean' : new g.GridEditor(bfield, { + autoSize: 'both' + }) + }; + this.renderCellDelegate = this.renderCell.createDelegate(this); + this.renderPropDelegate = this.renderProp.createDelegate(this); + }, + + // private + renderDate : function(dateVal){ + return dateVal.dateFormat(this.dateFormat); + }, + + // private + renderBool : function(bVal){ + return this[bVal ? 'trueText' : 'falseText']; + }, + + // private + isCellEditable : function(colIndex, rowIndex){ + return colIndex == 1; + }, + + // private + getRenderer : function(col){ + return col == 1 ? + this.renderCellDelegate : this.renderPropDelegate; + }, + + // private + renderProp : function(v){ + return this.getPropertyName(v); + }, + + // private + renderCell : function(val, meta, rec){ + var renderer = this.grid.customRenderers[rec.get('name')]; + if(renderer){ + return renderer.apply(this, arguments); + } + var rv = val; + if(Ext.isDate(val)){ + rv = this.renderDate(val); + }else if(typeof val == 'boolean'){ + rv = this.renderBool(val); + } + return Ext.util.Format.htmlEncode(rv); + }, + + // private + getPropertyName : function(name){ + var pn = this.grid.propertyNames; + return pn && pn[name] ? pn[name] : name; + }, + + // private + getCellEditor : function(colIndex, rowIndex){ + var p = this.store.getProperty(rowIndex), + n = p.data.name, + val = p.data.value; + if(this.grid.customEditors[n]){ + return this.grid.customEditors[n]; + } + if(Ext.isDate(val)){ + return this.editors.date; + }else if(typeof val == 'number'){ + return this.editors.number; + }else if(typeof val == 'boolean'){ + return this.editors['boolean']; + }else{ + return this.editors.string; + } + }, + + // inherit docs + destroy : function(){ + Ext.grid.PropertyColumnModel.superclass.destroy.call(this); + for(var ed in this.editors){ + Ext.destroy(this.editors[ed]); + } + } +}); + +/** + * @class Ext.grid.PropertyGrid + * @extends Ext.grid.EditorGridPanel + * A specialized grid implementation intended to mimic the traditional property grid as typically seen in + * development IDEs. Each row in the grid represents a property of some object, and the data is stored + * as a set of name/value pairs in {@link Ext.grid.PropertyRecord}s. Example usage: + *
    
    +var grid = new Ext.grid.PropertyGrid({
    +    title: 'Properties Grid',
    +    autoHeight: true,
    +    width: 300,
    +    renderTo: 'grid-ct',
    +    source: {
    +        "(name)": "My Object",
    +        "Created": new Date(Date.parse('10/15/2006')),
    +        "Available": false,
    +        "Version": .01,
    +        "Description": "A test object"
    +    }
    +});
    +
    + * @constructor + * @param {Object} config The grid config object + */ +Ext.grid.PropertyGrid = Ext.extend(Ext.grid.EditorGridPanel, { + /** + * @cfg {Object} propertyNames An object containing property name/display name pairs. + * If specified, the display name will be shown in the name column instead of the property name. + */ + /** + * @cfg {Object} source A data object to use as the data source of the grid (see {@link #setSource} for details). + */ + /** + * @cfg {Object} customEditors An object containing name/value pairs of custom editor type definitions that allow + * the grid to support additional types of editable fields. By default, the grid supports strongly-typed editing + * of strings, dates, numbers and booleans using built-in form editors, but any custom type can be supported and + * associated with a custom input control by specifying a custom editor. The name of the editor + * type should correspond with the name of the property that will use the editor. Example usage: + *
    
    +var grid = new Ext.grid.PropertyGrid({
    +    ...
    +    customEditors: {
    +        'Start Time': new Ext.grid.GridEditor(new Ext.form.TimeField({selectOnFocus:true}))
    +    },
    +    source: {
    +        'Start Time': '10:00 AM'
    +    }
    +});
    +
    + */ + /** + * @cfg {Object} source A data object to use as the data source of the grid (see {@link #setSource} for details). + */ + /** + * @cfg {Object} customRenderers An object containing name/value pairs of custom renderer type definitions that allow + * the grid to support custom rendering of fields. By default, the grid supports strongly-typed rendering + * of strings, dates, numbers and booleans using built-in form editors, but any custom type can be supported and + * associated with the type of the value. The name of the renderer type should correspond with the name of the property + * that it will render. Example usage: + *
    
    +var grid = new Ext.grid.PropertyGrid({
    +    ...
    +    customRenderers: {
    +        Available: function(v){
    +            if(v){
    +                return 'Yes';
    +            }else{
    +                return 'No';
    +            }
    +        }
    +    },
    +    source: {
    +        Available: true
    +    }
    +});
    +
    + */ + + // private config overrides + enableColumnMove:false, + stripeRows:false, + trackMouseOver: false, + clicksToEdit:1, + enableHdMenu : false, + viewConfig : { + forceFit:true + }, + + // private + initComponent : function(){ + this.customRenderers = this.customRenderers || {}; + this.customEditors = this.customEditors || {}; + this.lastEditRow = null; + var store = new Ext.grid.PropertyStore(this); + this.propStore = store; + var cm = new Ext.grid.PropertyColumnModel(this, store); + store.store.sort('name', 'ASC'); + this.addEvents( + /** + * @event beforepropertychange + * Fires before a property value changes. Handlers can return false to cancel the property change + * (this will internally call {@link Ext.data.Record#reject} on the property's record). + * @param {Object} source The source data object for the grid (corresponds to the same object passed in + * as the {@link #source} config property). + * @param {String} recordId The record's id in the data store + * @param {Mixed} value The current edited property value + * @param {Mixed} oldValue The original property value prior to editing + */ + 'beforepropertychange', + /** + * @event propertychange + * Fires after a property value has changed. + * @param {Object} source The source data object for the grid (corresponds to the same object passed in + * as the {@link #source} config property). + * @param {String} recordId The record's id in the data store + * @param {Mixed} value The current edited property value + * @param {Mixed} oldValue The original property value prior to editing + */ + 'propertychange' + ); + this.cm = cm; + this.ds = store.store; + Ext.grid.PropertyGrid.superclass.initComponent.call(this); + + this.mon(this.selModel, 'beforecellselect', function(sm, rowIndex, colIndex){ + if(colIndex === 0){ + this.startEditing.defer(200, this, [rowIndex, 1]); + return false; + } + }, this); + }, + + // private + onRender : function(){ + Ext.grid.PropertyGrid.superclass.onRender.apply(this, arguments); + + this.getGridEl().addClass('x-props-grid'); + }, + + // private + afterRender: function(){ + Ext.grid.PropertyGrid.superclass.afterRender.apply(this, arguments); + if(this.source){ + this.setSource(this.source); + } + }, + + /** + * Sets the source data object containing the property data. The data object can contain one or more name/value + * pairs representing all of the properties of an object to display in the grid, and this data will automatically + * be loaded into the grid's {@link #store}. The values should be supplied in the proper data type if needed, + * otherwise string type will be assumed. If the grid already contains data, this method will replace any + * existing data. See also the {@link #source} config value. Example usage: + *
    
    +grid.setSource({
    +    "(name)": "My Object",
    +    "Created": new Date(Date.parse('10/15/2006')),  // date type
    +    "Available": false,  // boolean type
    +    "Version": .01,      // decimal type
    +    "Description": "A test object"
    +});
    +
    + * @param {Object} source The data object + */ + setSource : function(source){ + this.propStore.setSource(source); + }, + + /** + * Gets the source data object containing the property data. See {@link #setSource} for details regarding the + * format of the data object. + * @return {Object} The data object + */ + getSource : function(){ + return this.propStore.getSource(); + }, + + /** + * Sets the value of a property. + * @param {String} prop The name of the property to set + * @param {Mixed} value The value to test + * @param {Boolean} create (Optional) True to create the property if it doesn't already exist. Defaults to false. + */ + setProperty : function(prop, value, create){ + this.propStore.setValue(prop, value, create); + }, + + /** + * Removes a property from the grid. + * @param {String} prop The name of the property to remove + */ + removeProperty : function(prop){ + this.propStore.remove(prop); + } + + /** + * @cfg store + * @hide + */ + /** + * @cfg colModel + * @hide + */ + /** + * @cfg cm + * @hide + */ + /** + * @cfg columns + * @hide + */ +}); +Ext.reg("propertygrid", Ext.grid.PropertyGrid); +/** + * @class Ext.grid.GroupingView + * @extends Ext.grid.GridView + * Adds the ability for single level grouping to the grid. A {@link Ext.data.GroupingStore GroupingStore} + * must be used to enable grouping. Some grouping characteristics may also be configured at the + * {@link Ext.grid.Column Column level}
      + *
    • {@link Ext.grid.Column#emptyGroupText emptyGroupText}
    • + *
    • {@link Ext.grid.Column#groupable groupable}
    • + *
    • {@link Ext.grid.Column#groupName groupName}
    • + *
    • {@link Ext.grid.Column#groupRender groupRender}
    • + *
    + *

    Sample usage:

    + *
    
    +var grid = new Ext.grid.GridPanel({
    +    // A groupingStore is required for a GroupingView
    +    store: new {@link Ext.data.GroupingStore}({
    +        autoDestroy: true,
    +        reader: reader,
    +        data: xg.dummyData,
    +        sortInfo: {field: 'company', direction: 'ASC'},
    +        {@link Ext.data.GroupingStore#groupOnSort groupOnSort}: true,
    +        {@link Ext.data.GroupingStore#remoteGroup remoteGroup}: true,
    +        {@link Ext.data.GroupingStore#groupField groupField}: 'industry'
    +    }),
    +    colModel: new {@link Ext.grid.ColumnModel}({
    +        columns:[
    +            {id:'company',header: 'Company', width: 60, dataIndex: 'company'},
    +            // {@link Ext.grid.Column#groupable groupable}, {@link Ext.grid.Column#groupName groupName}, {@link Ext.grid.Column#groupRender groupRender} are also configurable at column level
    +            {header: 'Price', renderer: Ext.util.Format.usMoney, dataIndex: 'price', {@link Ext.grid.Column#groupable groupable}: false},
    +            {header: 'Change', dataIndex: 'change', renderer: Ext.util.Format.usMoney},
    +            {header: 'Industry', dataIndex: 'industry'},
    +            {header: 'Last Updated', renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
    +        ],
    +        defaults: {
    +            sortable: true,
    +            menuDisabled: false,
    +            width: 20
    +        }
    +    }),
    +
    +    view: new Ext.grid.GroupingView({
    +        {@link Ext.grid.GridView#forceFit forceFit}: true,
    +        // custom grouping text template to display the number of items per group
    +        {@link #groupTextTpl}: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
    +    }),
    +
    +    frame:true,
    +    width: 700,
    +    height: 450,
    +    collapsible: true,
    +    animCollapse: false,
    +    title: 'Grouping Example',
    +    iconCls: 'icon-grid',
    +    renderTo: document.body
    +});
    + * 
    + * @constructor + * @param {Object} config + */ +Ext.grid.GroupingView = Ext.extend(Ext.grid.GridView, { + + /** + * @cfg {String} groupByText Text displayed in the grid header menu for grouping by a column + * (defaults to 'Group By This Field'). + */ + groupByText : 'Group By This Field', + /** + * @cfg {String} showGroupsText Text displayed in the grid header for enabling/disabling grouping + * (defaults to 'Show in Groups'). + */ + showGroupsText : 'Show in Groups', + /** + * @cfg {Boolean} hideGroupedColumn true to hide the column that is currently grouped (defaults to false) + */ + hideGroupedColumn : false, + /** + * @cfg {Boolean} showGroupName If true will display a prefix plus a ': ' before the group field value + * in the group header line. The prefix will consist of the {@link Ext.grid.Column#groupName groupName} + * (or the configured {@link Ext.grid.Column#header header} if not provided) configured in the + * {@link Ext.grid.Column} for each set of grouped rows (defaults to true). + */ + showGroupName : true, + /** + * @cfg {Boolean} startCollapsed true to start all groups collapsed (defaults to false) + */ + startCollapsed : false, + /** + * @cfg {Boolean} enableGrouping false to disable grouping functionality (defaults to true) + */ + enableGrouping : true, + /** + * @cfg {Boolean} enableGroupingMenu true to enable the grouping control in the column menu (defaults to true) + */ + enableGroupingMenu : true, + /** + * @cfg {Boolean} enableNoGroups true to allow the user to turn off grouping (defaults to true) + */ + enableNoGroups : true, + /** + * @cfg {String} emptyGroupText The text to display when there is an empty group value (defaults to '(None)'). + * May also be specified per column, see {@link Ext.grid.Column}.{@link Ext.grid.Column#emptyGroupText emptyGroupText}. + */ + emptyGroupText : '(None)', + /** + * @cfg {Boolean} ignoreAdd true to skip refreshing the view when new rows are added (defaults to false) + */ + ignoreAdd : false, + /** + * @cfg {String} groupTextTpl The template used to render the group header (defaults to '{text}'). + * This is used to format an object which contains the following properties: + *
      + *
    • group : String

      The rendered value of the group field. + * By default this is the unchanged value of the group field. If a {@link Ext.grid.Column#groupRenderer groupRenderer} + * is specified, it is the result of a call to that function.

    • + *
    • gvalue : Object

      The raw value of the group field.

    • + *
    • text : String

      The configured header (as described in {@link #showGroupName}) + * if {@link #showGroupName} is true) plus the rendered group field value.

    • + *
    • groupId : String

      A unique, generated ID which is applied to the + * View Element which contains the group.

    • + *
    • startRow : Number

      The row index of the Record which caused group change.

    • + *
    • rs : Array

      Contains a single element: The Record providing the data + * for the row which caused group change.

    • + *
    • cls : String

      The generated class name string to apply to the group header Element.

    • + *
    • style : String

      The inline style rules to apply to the group header Element.

    • + *

    + * See {@link Ext.XTemplate} for information on how to format data using a template. Possible usage:
    
    +var grid = new Ext.grid.GridPanel({
    +    ...
    +    view: new Ext.grid.GroupingView({
    +        groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
    +    }),
    +});
    +     * 
    + */ + groupTextTpl : '{text}', + + /** + * @cfg {String} groupMode Indicates how to construct the group identifier. 'value' constructs the id using + * raw value, 'display' constructs the id using the rendered value. Defaults to 'value'. + */ + groupMode: 'value', + + /** + * @cfg {Function} groupRenderer This property must be configured in the {@link Ext.grid.Column} for + * each column. + */ + + // private + initTemplates : function(){ + Ext.grid.GroupingView.superclass.initTemplates.call(this); + this.state = {}; + + var sm = this.grid.getSelectionModel(); + sm.on(sm.selectRow ? 'beforerowselect' : 'beforecellselect', + this.onBeforeRowSelect, this); + + if(!this.startGroup){ + this.startGroup = new Ext.XTemplate( + '
    ', + '
    ', this.groupTextTpl ,'
    ', + '
    ' + ); + } + this.startGroup.compile(); + + if (!this.endGroup) { + this.endGroup = '
    '; + } + }, + + // private + findGroup : function(el){ + return Ext.fly(el).up('.x-grid-group', this.mainBody.dom); + }, + + // private + getGroups : function(){ + return this.hasRows() ? this.mainBody.dom.childNodes : []; + }, + + // private + onAdd : function(ds, records, index) { + if (this.canGroup() && !this.ignoreAdd) { + var ss = this.getScrollState(); + this.fireEvent('beforerowsinserted', ds, index, index + (records.length-1)); + this.refresh(); + this.restoreScroll(ss); + this.fireEvent('rowsinserted', ds, index, index + (records.length-1)); + } else if (!this.canGroup()) { + Ext.grid.GroupingView.superclass.onAdd.apply(this, arguments); + } + }, + + // private + onRemove : function(ds, record, index, isUpdate){ + Ext.grid.GroupingView.superclass.onRemove.apply(this, arguments); + var g = document.getElementById(record._groupId); + if(g && g.childNodes[1].childNodes.length < 1){ + Ext.removeNode(g); + } + this.applyEmptyText(); + }, + + // private + refreshRow : function(record){ + if(this.ds.getCount()==1){ + this.refresh(); + }else{ + this.isUpdating = true; + Ext.grid.GroupingView.superclass.refreshRow.apply(this, arguments); + this.isUpdating = false; + } + }, + + // private + beforeMenuShow : function(){ + var item, items = this.hmenu.items, disabled = this.cm.config[this.hdCtxIndex].groupable === false; + if((item = items.get('groupBy'))){ + item.setDisabled(disabled); + } + if((item = items.get('showGroups'))){ + item.setDisabled(disabled); + item.setChecked(this.enableGrouping, true); + } + }, + + // private + renderUI : function(){ + Ext.grid.GroupingView.superclass.renderUI.call(this); + this.mainBody.on('mousedown', this.interceptMouse, this); + + if(this.enableGroupingMenu && this.hmenu){ + this.hmenu.add('-',{ + itemId:'groupBy', + text: this.groupByText, + handler: this.onGroupByClick, + scope: this, + iconCls:'x-group-by-icon' + }); + if(this.enableNoGroups){ + this.hmenu.add({ + itemId:'showGroups', + text: this.showGroupsText, + checked: true, + checkHandler: this.onShowGroupsClick, + scope: this + }); + } + this.hmenu.on('beforeshow', this.beforeMenuShow, this); + } + }, + + processEvent: function(name, e){ + Ext.grid.GroupingView.superclass.processEvent.call(this, name, e); + var hd = e.getTarget('.x-grid-group-hd', this.mainBody); + if(hd){ + // group value is at the end of the string + var field = this.getGroupField(), + prefix = this.getPrefix(field), + groupValue = hd.id.substring(prefix.length); + + // remove trailing '-hd' + groupValue = groupValue.substr(0, groupValue.length - 3); + if(groupValue){ + this.grid.fireEvent('group' + name, this.grid, field, groupValue, e); + } + } + + }, + + // private + onGroupByClick : function(){ + this.enableGrouping = true; + this.grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex)); + this.grid.fireEvent('groupchange', this, this.grid.store.getGroupState()); + this.beforeMenuShow(); // Make sure the checkboxes get properly set when changing groups + this.refresh(); + }, + + // private + onShowGroupsClick : function(mi, checked){ + this.enableGrouping = checked; + if(checked){ + this.onGroupByClick(); + }else{ + this.grid.store.clearGrouping(); + this.grid.fireEvent('groupchange', this, null); + } + }, + + /** + * Toggle the group that contains the specific row. + * @param {Number} rowIndex The row inside the group + * @param {Boolean} expanded (optional) + */ + toggleRowIndex : function(rowIndex, expanded){ + if(!this.canGroup()){ + return; + } + var row = this.getRow(rowIndex); + if(row){ + this.toggleGroup(this.findGroup(row), expanded); + } + }, + + /** + * Toggles the specified group if no value is passed, otherwise sets the expanded state of the group to the value passed. + * @param {String} groupId The groupId assigned to the group (see getGroupId) + * @param {Boolean} expanded (optional) + */ + toggleGroup : function(group, expanded){ + var gel = Ext.get(group); + expanded = Ext.isDefined(expanded) ? expanded : gel.hasClass('x-grid-group-collapsed'); + if(this.state[gel.id] !== expanded){ + this.grid.stopEditing(true); + this.state[gel.id] = expanded; + gel[expanded ? 'removeClass' : 'addClass']('x-grid-group-collapsed'); + } + }, + + /** + * Toggles all groups if no value is passed, otherwise sets the expanded state of all groups to the value passed. + * @param {Boolean} expanded (optional) + */ + toggleAllGroups : function(expanded){ + var groups = this.getGroups(); + for(var i = 0, len = groups.length; i < len; i++){ + this.toggleGroup(groups[i], expanded); + } + }, + + /** + * Expands all grouped rows. + */ + expandAllGroups : function(){ + this.toggleAllGroups(true); + }, + + /** + * Collapses all grouped rows. + */ + collapseAllGroups : function(){ + this.toggleAllGroups(false); + }, + + // private + interceptMouse : function(e){ + var hd = e.getTarget('.x-grid-group-hd', this.mainBody); + if(hd){ + e.stopEvent(); + this.toggleGroup(hd.parentNode); + } + }, + + // private + getGroup : function(v, r, groupRenderer, rowIndex, colIndex, ds){ + var g = groupRenderer ? groupRenderer(v, {}, r, rowIndex, colIndex, ds) : String(v); + if(g === '' || g === ' '){ + g = this.cm.config[colIndex].emptyGroupText || this.emptyGroupText; + } + return g; + }, + + // private + getGroupField : function(){ + return this.grid.store.getGroupState(); + }, + + // private + afterRender : function(){ + if(!this.ds || !this.cm){ + return; + } + Ext.grid.GroupingView.superclass.afterRender.call(this); + if(this.grid.deferRowRender){ + this.updateGroupWidths(); + } + }, + + // private + renderRows : function(){ + var groupField = this.getGroupField(); + var eg = !!groupField; + // if they turned off grouping and the last grouped field is hidden + if(this.hideGroupedColumn) { + var colIndex = this.cm.findColumnIndex(groupField), + hasLastGroupField = Ext.isDefined(this.lastGroupField); + if(!eg && hasLastGroupField){ + this.mainBody.update(''); + this.cm.setHidden(this.cm.findColumnIndex(this.lastGroupField), false); + delete this.lastGroupField; + }else if (eg && !hasLastGroupField){ + this.lastGroupField = groupField; + this.cm.setHidden(colIndex, true); + }else if (eg && hasLastGroupField && groupField !== this.lastGroupField) { + this.mainBody.update(''); + var oldIndex = this.cm.findColumnIndex(this.lastGroupField); + this.cm.setHidden(oldIndex, false); + this.lastGroupField = groupField; + this.cm.setHidden(colIndex, true); + } + } + return Ext.grid.GroupingView.superclass.renderRows.apply( + this, arguments); + }, + + // private + doRender : function(cs, rs, ds, startRow, colCount, stripe){ + if(rs.length < 1){ + return ''; + } + + if(!this.canGroup() || this.isUpdating){ + return Ext.grid.GroupingView.superclass.doRender.apply(this, arguments); + } + + var groupField = this.getGroupField(), + colIndex = this.cm.findColumnIndex(groupField), + g, + gstyle = 'width:' + this.getTotalWidth() + ';', + cfg = this.cm.config[colIndex], + groupRenderer = cfg.groupRenderer || cfg.renderer, + prefix = this.showGroupName ? (cfg.groupName || cfg.header)+': ' : '', + groups = [], + curGroup, i, len, gid; + + for(i = 0, len = rs.length; i < len; i++){ + var rowIndex = startRow + i, + r = rs[i], + gvalue = r.data[groupField]; + + g = this.getGroup(gvalue, r, groupRenderer, rowIndex, colIndex, ds); + if(!curGroup || curGroup.group != g){ + gid = this.constructId(gvalue, groupField, colIndex); + // if state is defined use it, however state is in terms of expanded + // so negate it, otherwise use the default. + this.state[gid] = !(Ext.isDefined(this.state[gid]) ? !this.state[gid] : this.startCollapsed); + curGroup = { + group: g, + gvalue: gvalue, + text: prefix + g, + groupId: gid, + startRow: rowIndex, + rs: [r], + cls: this.state[gid] ? '' : 'x-grid-group-collapsed', + style: gstyle + }; + groups.push(curGroup); + }else{ + curGroup.rs.push(r); + } + r._groupId = gid; + } + + var buf = []; + for(i = 0, len = groups.length; i < len; i++){ + g = groups[i]; + this.doGroupStart(buf, g, cs, ds, colCount); + buf[buf.length] = Ext.grid.GroupingView.superclass.doRender.call( + this, cs, g.rs, ds, g.startRow, colCount, stripe); + + this.doGroupEnd(buf, g, cs, ds, colCount); + } + return buf.join(''); + }, + + /** + * Dynamically tries to determine the groupId of a specific value + * @param {String} value + * @return {String} The group id + */ + getGroupId : function(value){ + var field = this.getGroupField(); + return this.constructId(value, field, this.cm.findColumnIndex(field)); + }, + + // private + constructId : function(value, field, idx){ + var cfg = this.cm.config[idx], + groupRenderer = cfg.groupRenderer || cfg.renderer, + val = (this.groupMode == 'value') ? value : this.getGroup(value, {data:{}}, groupRenderer, 0, idx, this.ds); + + return this.getPrefix(field) + Ext.util.Format.htmlEncode(val); + }, + + // private + canGroup : function(){ + return this.enableGrouping && !!this.getGroupField(); + }, + + // private + getPrefix: function(field){ + return this.grid.getGridEl().id + '-gp-' + field + '-'; + }, + + // private + doGroupStart : function(buf, g, cs, ds, colCount){ + buf[buf.length] = this.startGroup.apply(g); + }, + + // private + doGroupEnd : function(buf, g, cs, ds, colCount){ + buf[buf.length] = this.endGroup; + }, + + // private + getRows : function(){ + if(!this.canGroup()){ + return Ext.grid.GroupingView.superclass.getRows.call(this); + } + var r = [], + gs = this.getGroups(), + g, + i = 0, + len = gs.length, + j, + jlen; + for(; i < len; ++i){ + g = gs[i].childNodes[1]; + if(g){ + g = g.childNodes; + for(j = 0, jlen = g.length; j < jlen; ++j){ + r[r.length] = g[j]; + } + } + } + return r; + }, + + // private + updateGroupWidths : function(){ + if(!this.canGroup() || !this.hasRows()){ + return; + } + var tw = Math.max(this.cm.getTotalWidth(), this.el.dom.offsetWidth-this.getScrollOffset()) +'px'; + var gs = this.getGroups(); + for(var i = 0, len = gs.length; i < len; i++){ + gs[i].firstChild.style.width = tw; + } + }, + + // private + onColumnWidthUpdated : function(col, w, tw){ + Ext.grid.GroupingView.superclass.onColumnWidthUpdated.call(this, col, w, tw); + this.updateGroupWidths(); + }, + + // private + onAllColumnWidthsUpdated : function(ws, tw){ + Ext.grid.GroupingView.superclass.onAllColumnWidthsUpdated.call(this, ws, tw); + this.updateGroupWidths(); + }, + + // private + onColumnHiddenUpdated : function(col, hidden, tw){ + Ext.grid.GroupingView.superclass.onColumnHiddenUpdated.call(this, col, hidden, tw); + this.updateGroupWidths(); + }, + + // private + onLayout : function(){ + this.updateGroupWidths(); + }, + + // private + onBeforeRowSelect : function(sm, rowIndex){ + this.toggleRowIndex(rowIndex, true); + } +}); +// private +Ext.grid.GroupingView.GROUP_ID = 1000; \ No newline at end of file diff --git a/ext-all-debug.js b/ext-all-debug.js index 533aa430..3befa7e7 100644 --- a/ext-all-debug.js +++ b/ext-all-debug.js @@ -1,143 +1,15 @@ -/*! - * Ext JS Library 3.2.0 - * Copyright(c) 2006-2010 Ext JS, Inc. - * licensing@extjs.com - * http://www.extjs.com/license - */ -/** - * @class Ext.DomHelper - *

    The DomHelper class provides a layer of abstraction from DOM and transparently supports creating - * elements via DOM or using HTML fragments. It also has the ability to create HTML fragment templates - * from your DOM building code.

    - * - *

    DomHelper element specification object

    - *

    A specification object is used when creating elements. Attributes of this object - * are assumed to be element attributes, except for 4 special attributes: - *

      - *
    • tag :
      The tag name of the element
    • - *
    • children : or cn
      An array of the - * same kind of element definition objects to be created and appended. These can be nested - * as deep as you want.
    • - *
    • cls :
      The class attribute of the element. - * This will end up being either the "class" attribute on a HTML fragment or className - * for a DOM node, depending on whether DomHelper is using fragments or DOM.
    • - *
    • html :
      The innerHTML for the element
    • - *

    - * - *

    Insertion methods

    - *

    Commonly used insertion methods: - *

      - *
    • {@link #append} :
    • - *
    • {@link #insertBefore} :
    • - *
    • {@link #insertAfter} :
    • - *
    • {@link #overwrite} :
    • - *
    • {@link #createTemplate} :
    • - *
    • {@link #insertHtml} :
    • - *

    - * - *

    Example

    - *

    This is an example, where an unordered list with 3 children items is appended to an existing - * element with id 'my-div':
    -

    
    -var dh = Ext.DomHelper; // create shorthand alias
    -// specification object
    -var spec = {
    -    id: 'my-ul',
    -    tag: 'ul',
    -    cls: 'my-list',
    -    // append children after creating
    -    children: [     // may also specify 'cn' instead of 'children'
    -        {tag: 'li', id: 'item0', html: 'List Item 0'},
    -        {tag: 'li', id: 'item1', html: 'List Item 1'},
    -        {tag: 'li', id: 'item2', html: 'List Item 2'}
    -    ]
    -};
    -var list = dh.append(
    -    'my-div', // the context element 'my-div' can either be the id or the actual node
    -    spec      // the specification object
    -);
    - 

    - *

    Element creation specification parameters in this class may also be passed as an Array of - * specification objects. This can be used to insert multiple sibling nodes into an existing - * container very efficiently. For example, to add more list items to the example above:

    
    -dh.append('my-ul', [
    -    {tag: 'li', id: 'item3', html: 'List Item 3'},
    -    {tag: 'li', id: 'item4', html: 'List Item 4'}
    -]);
    - * 

    - * - *

    Templating

    - *

    The real power is in the built-in templating. Instead of creating or appending any elements, - * {@link #createTemplate} returns a Template object which can be used over and over to - * insert new elements. Revisiting the example above, we could utilize templating this time: - *

    
    -// create the node
    -var list = dh.append('my-div', {tag: 'ul', cls: 'my-list'});
    -// get template
    -var tpl = dh.createTemplate({tag: 'li', id: 'item{0}', html: 'List Item {0}'});
    -
    -for(var i = 0; i < 5, i++){
    -    tpl.append(list, [i]); // use template to append to the actual node
    -}
    - * 

    - *

    An example using a template:

    
    -var html = '{2}';
    -
    -var tpl = new Ext.DomHelper.createTemplate(html);
    -tpl.append('blog-roll', ['link1', 'http://www.jackslocum.com/', "Jack's Site"]);
    -tpl.append('blog-roll', ['link2', 'http://www.dustindiaz.com/', "Dustin's Site"]);
    - * 

    - * - *

    The same example using named parameters:

    
    -var html = '{text}';
    -
    -var tpl = new Ext.DomHelper.createTemplate(html);
    -tpl.append('blog-roll', {
    -    id: 'link1',
    -    url: 'http://www.jackslocum.com/',
    -    text: "Jack's Site"
    -});
    -tpl.append('blog-roll', {
    -    id: 'link2',
    -    url: 'http://www.dustindiaz.com/',
    -    text: "Dustin's Site"
    -});
    - * 

    - * - *

    Compiling Templates

    - *

    Templates are applied using regular expressions. The performance is great, but if - * you are adding a bunch of DOM elements using the same template, you can increase - * performance even further by {@link Ext.Template#compile "compiling"} the template. - * The way "{@link Ext.Template#compile compile()}" works is the template is parsed and - * broken up at the different variable points and a dynamic function is created and eval'ed. - * The generated function performs string concatenation of these parts and the passed - * variables instead of using regular expressions. - *

    
    -var html = '{text}';
    -
    -var tpl = new Ext.DomHelper.createTemplate(html);
    -tpl.compile();
    -
    -//... use template like normal
    - * 

    - * - *

    Performance Boost

    - *

    DomHelper will transparently create HTML fragments when it can. Using HTML fragments instead - * of DOM can significantly boost performance.

    - *

    Element creation specification parameters may also be strings. If {@link #useDom} is false, - * then the string is used as innerHTML. If {@link #useDom} is true, a string specification - * results in the creation of a text node. Usage:

    - *
    
    -Ext.DomHelper.useDom = true; // force it to use DOM; reduces performance
    - * 
    - * @singleton - */ + + Ext.DomHelper = function(){ var tempTableEl = null, emptyTags = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i, tableRe = /^table|tbody|tr|td$/i, + confRe = /tag|children|cn|html$/i, + tableElRe = /td|tr|tbody/i, + cssRe = /([a-z0-9-]+)\s*:\s*([^;\s]+(?:\s*[^;\s]+)*);?/gi, + endRe = /end/i, pub, - // kill repeat to save bytes + afterbegin = 'afterbegin', afterend = 'afterend', beforebegin = 'beforebegin', @@ -149,13 +21,13 @@ Ext.DomHelper = function(){ trs = tbs + '
', tre = ''+tbe; - // private + function doInsert(el, o, returnElement, pos, sibling, append){ var newNode = pub.insertHtml(pos, Ext.getDom(el), createHtml(o)); return returnElement ? Ext.get(newNode, true) : newNode; } - // build as innerHTML where available + function createHtml(o){ var b = '', attr, @@ -164,7 +36,7 @@ Ext.DomHelper = function(){ keyVal, cn; - if(Ext.isString(o)){ + if(typeof o == "string"){ b = o; } else if (Ext.isArray(o)) { for (var i=0; i < o.length; i++) { @@ -174,20 +46,21 @@ Ext.DomHelper = function(){ }; } else { b += '<' + (o.tag = o.tag || 'div'); - Ext.iterate(o, function(attr, val){ - if(!/tag|children|cn|html$/i.test(attr)){ - if (Ext.isObject(val)) { + for (attr in o) { + val = o[attr]; + if(!confRe.test(attr)){ + if (typeof val == "object") { b += ' ' + attr + '="'; - Ext.iterate(val, function(key, keyVal){ - b += key + ':' + keyVal + ';'; - }); + for (key in val) { + b += key + ':' + val[key] + ';'; + }; b += '"'; }else{ b += ' ' + ({cls : 'class', htmlFor : 'for'}[attr] || attr) + '="' + val + '"'; } } - }); - // Now either just close the tag or try to add children and close the tag. + }; + if (emptyTags.test(o.tag)) { b += '/>'; } else { @@ -211,7 +84,7 @@ Ext.DomHelper = function(){ while(++i < depth){ el = el.firstChild; } -// If the result is multiple siblings, then encapsulate them into one fragment. + if(ns = el.nextSibling){ var df = document.createDocumentFragment(); while(el){ @@ -224,10 +97,7 @@ Ext.DomHelper = function(){ return el; } - /** - * @ignore - * Nasty code for IE's broken table implementation - */ + function insertIntoTable(tag, where, el, html) { var node, before; @@ -235,7 +105,7 @@ Ext.DomHelper = function(){ tempTableEl = tempTableEl || document.createElement('div'); if(tag == 'td' && (where == afterbegin || where == beforeend) || - !/td|tr|tbody/i.test(tag) && (where == beforebegin || where == afterend)) { + !tableElRe.test(tag) && (where == beforebegin || where == afterend)) { return; } before = where == beforebegin ? el : @@ -260,49 +130,34 @@ Ext.DomHelper = function(){ pub = { - /** - * Returns the markup for the passed Element(s) config. - * @param {Object} o The DOM object spec (and children) - * @return {String} - */ + markup : function(o){ return createHtml(o); }, + - /** - * Applies a style specification to an element. - * @param {String/HTMLElement} el The element to apply styles to - * @param {String/Object/Function} styles A style specification string e.g. 'width:100px', or object in the form {width:'100px'}, or - * a function which returns such a specification. - */ applyStyles : function(el, styles){ if(styles){ var i = 0, len, - style; + style, + matches; el = Ext.fly(el); - if(Ext.isFunction(styles)){ + if(typeof styles == "function"){ styles = styles.call(); } - if(Ext.isString(styles)){ - styles = styles.trim().split(/\s*(?::|;)\s*/); - for(len = styles.length; i < len;){ - el.setStyle(styles[i++], styles[i++]); + if(typeof styles == "string"){ + while((matches = cssRe.exec(styles))){ + el.setStyle(matches[1], matches[2]); } - }else if (Ext.isObject(styles)){ + }else if (typeof styles == "object"){ el.setStyle(styles); } } }, - /** - * Inserts an HTML fragment into the DOM. - * @param {String} where Where to insert the html in relation to el - beforeBegin, afterBegin, beforeEnd, afterEnd. - * @param {HTMLElement} el The context element - * @param {String} html The HTML fragment - * @return {HTMLElement} The new node - */ + insertHtml : function(where, el, html){ var hash = {}, hashVal, @@ -313,7 +168,7 @@ Ext.DomHelper = function(){ rs; where = where.toLowerCase(); - // add these here because they are used in both branches of the condition. + hash[beforebegin] = ['BeforeBegin', 'previousSibling']; hash[afterend] = ['AfterEnd', 'nextSibling']; @@ -321,7 +176,7 @@ Ext.DomHelper = function(){ if(tableRe.test(el.tagName) && (rs = insertIntoTable(el.tagName.toLowerCase(), where, el, html))){ return rs; } - // add these two to the hash. + hash[afterbegin] = ['AfterBegin', 'firstChild']; hash[beforeend] = ['BeforeEnd', 'lastChild']; if ((hashVal = hash[where])) { @@ -330,7 +185,7 @@ Ext.DomHelper = function(){ } } else { range = el.ownerDocument.createRange(); - setStart = 'setStart' + (/end/i.test(where) ? 'After' : 'Before'); + setStart = 'setStart' + (endRe.test(where) ? 'After' : 'Before'); if (hash[where]) { range[setStart](el); frag = range.createContextualFragment(html); @@ -355,57 +210,27 @@ Ext.DomHelper = function(){ throw 'Illegal insertion point -> "' + where + '"'; }, - /** - * Creates new DOM element(s) and inserts them before el. - * @param {Mixed} el The context element - * @param {Object/String} o The DOM object spec (and children) or raw HTML blob - * @param {Boolean} returnElement (optional) true to return a Ext.Element - * @return {HTMLElement/Ext.Element} The new node - */ + insertBefore : function(el, o, returnElement){ return doInsert(el, o, returnElement, beforebegin); }, - /** - * Creates new DOM element(s) and inserts them after el. - * @param {Mixed} el The context element - * @param {Object} o The DOM object spec (and children) - * @param {Boolean} returnElement (optional) true to return a Ext.Element - * @return {HTMLElement/Ext.Element} The new node - */ + insertAfter : function(el, o, returnElement){ return doInsert(el, o, returnElement, afterend, 'nextSibling'); }, - /** - * Creates new DOM element(s) and inserts them as the first child of el. - * @param {Mixed} el The context element - * @param {Object/String} o The DOM object spec (and children) or raw HTML blob - * @param {Boolean} returnElement (optional) true to return a Ext.Element - * @return {HTMLElement/Ext.Element} The new node - */ + insertFirst : function(el, o, returnElement){ return doInsert(el, o, returnElement, afterbegin, 'firstChild'); }, - /** - * Creates new DOM element(s) and appends them to el. - * @param {Mixed} el The context element - * @param {Object/String} o The DOM object spec (and children) or raw HTML blob - * @param {Boolean} returnElement (optional) true to return a Ext.Element - * @return {HTMLElement/Ext.Element} The new node - */ + append : function(el, o, returnElement){ return doInsert(el, o, returnElement, beforeend, '', true); }, - /** - * Creates new DOM element(s) and overwrites the contents of el with them. - * @param {Mixed} el The context element - * @param {Object/String} o The DOM object spec (and children) or raw HTML blob - * @param {Boolean} returnElement (optional) true to return a Ext.Element - * @return {HTMLElement/Ext.Element} The new node - */ + overwrite : function(el, o, returnElement){ el = Ext.getDom(el); el.innerHTML = createHtml(o); @@ -415,27 +240,27 @@ Ext.DomHelper = function(){ createHtml : createHtml }; return pub; -}();/** - * @class Ext.DomHelper - */ +}(); + Ext.apply(Ext.DomHelper, function(){ - var pub, - afterbegin = 'afterbegin', - afterend = 'afterend', - beforebegin = 'beforebegin', - beforeend = 'beforeend'; + var pub, + afterbegin = 'afterbegin', + afterend = 'afterend', + beforebegin = 'beforebegin', + beforeend = 'beforeend', + confRe = /tag|children|cn|html$/i; - // private + function doInsert(el, o, returnElement, pos, sibling, append){ el = Ext.getDom(el); var newNode; if (pub.useDom) { newNode = createDom(o, null); if (append) { - el.appendChild(newNode); + el.appendChild(newNode); } else { - (sibling == 'firstChild' ? el : el.parentNode).insertBefore(newNode, el[sibling] || el); + (sibling == 'firstChild' ? el : el.parentNode).insertBefore(newNode, el[sibling] || el); } } else { newNode = Ext.DomHelper.insertHtml(pos, el, Ext.DomHelper.createHtml(o)); @@ -443,39 +268,40 @@ function(){ return returnElement ? Ext.get(newNode, true) : newNode; } - // build as dom - /** @ignore */ + + function createDom(o, parentNode){ var el, - doc = document, - useSet, - attr, - val, - cn; - - if (Ext.isArray(o)) { // Allow Arrays of siblings to be inserted - el = doc.createDocumentFragment(); // in one shot using a DocumentFragment - Ext.each(o, function(v) { - createDom(v, el); - }); - } else if (Ext.isString(o)) { // Allow a string as a child spec. + doc = document, + useSet, + attr, + val, + cn; + + if (Ext.isArray(o)) { + el = doc.createDocumentFragment(); + for (var i = 0, l = o.length; i < l; i++) { + createDom(o[i], el); + } + } else if (typeof o == 'string') { el = doc.createTextNode(o); } else { el = doc.createElement( o.tag || 'div' ); - useSet = !!el.setAttribute; // In IE some elements don't have setAttribute - Ext.iterate(o, function(attr, val){ - if(!/tag|children|cn|html|style/.test(attr)){ - if(attr == 'cls'){ - el.className = val; - }else{ + useSet = !!el.setAttribute; + for (var attr in o) { + if(!confRe.test(attr)){ + val = o[attr]; + if(attr == 'cls'){ + el.className = val; + }else{ if(useSet){ el.setAttribute(attr, val); }else{ el[attr] = val; } - } + } } - }); + } Ext.DomHelper.applyStyles(el, o.style); if ((cn = o.children || o.cn)) { @@ -490,268 +316,125 @@ function(){ return el; } - pub = { - /** - * Creates a new Ext.Template from the DOM object spec. - * @param {Object} o The DOM object spec (and children) - * @return {Ext.Template} The new template - */ - createTemplate : function(o){ - var html = Ext.DomHelper.createHtml(o); - return new Ext.Template(html); - }, + pub = { + + createTemplate : function(o){ + var html = Ext.DomHelper.createHtml(o); + return new Ext.Template(html); + }, - /** True to force the use of DOM instead of html fragments @type Boolean */ - useDom : false, - - /** - * Creates new DOM element(s) and inserts them before el. - * @param {Mixed} el The context element - * @param {Object/String} o The DOM object spec (and children) or raw HTML blob - * @param {Boolean} returnElement (optional) true to return a Ext.Element - * @return {HTMLElement/Ext.Element} The new node - * @hide (repeat) - */ - insertBefore : function(el, o, returnElement){ - return doInsert(el, o, returnElement, beforebegin); - }, + + useDom : false, - /** - * Creates new DOM element(s) and inserts them after el. - * @param {Mixed} el The context element - * @param {Object} o The DOM object spec (and children) - * @param {Boolean} returnElement (optional) true to return a Ext.Element - * @return {HTMLElement/Ext.Element} The new node - * @hide (repeat) - */ - insertAfter : function(el, o, returnElement){ - return doInsert(el, o, returnElement, afterend, 'nextSibling'); - }, + + insertBefore : function(el, o, returnElement){ + return doInsert(el, o, returnElement, beforebegin); + }, - /** - * Creates new DOM element(s) and inserts them as the first child of el. - * @param {Mixed} el The context element - * @param {Object/String} o The DOM object spec (and children) or raw HTML blob - * @param {Boolean} returnElement (optional) true to return a Ext.Element - * @return {HTMLElement/Ext.Element} The new node - * @hide (repeat) - */ - insertFirst : function(el, o, returnElement){ - return doInsert(el, o, returnElement, afterbegin, 'firstChild'); - }, + + insertAfter : function(el, o, returnElement){ + return doInsert(el, o, returnElement, afterend, 'nextSibling'); + }, + + + insertFirst : function(el, o, returnElement){ + return doInsert(el, o, returnElement, afterbegin, 'firstChild'); + }, - /** - * Creates new DOM element(s) and appends them to el. - * @param {Mixed} el The context element - * @param {Object/String} o The DOM object spec (and children) or raw HTML blob - * @param {Boolean} returnElement (optional) true to return a Ext.Element - * @return {HTMLElement/Ext.Element} The new node - * @hide (repeat) - */ - append: function(el, o, returnElement){ + + append: function(el, o, returnElement){ return doInsert(el, o, returnElement, beforeend, '', true); }, - /** - * Creates new DOM element(s) without inserting them to the document. - * @param {Object/String} o The DOM object spec (and children) or raw HTML blob - * @return {HTMLElement} The new uninserted node - */ + createDom: createDom - }; - return pub; -}());/** - * @class Ext.Template - *

Represents an HTML fragment template. Templates may be {@link #compile precompiled} - * for greater performance.

- *

For example usage {@link #Template see the constructor}.

- * - * @constructor - * An instance of this class may be created by passing to the constructor either - * a single argument, or multiple arguments: - *
    - *
  • single argument : String/Array - *
    - * The single argument may be either a String or an Array:
      - *
    • String :
    • 
      -var t = new Ext.Template("<div>Hello {0}.</div>");
      -t.{@link #append}('some-element', ['foo']);
      - * 
      - *
    • Array :
    • - * An Array will be combined with join(''). -
      
      -var t = new Ext.Template([
      -    '<div name="{id}">',
      -        '<span class="{cls}">{name:trim} {value:ellipsis(10)}</span>',
      -    '</div>',
      -]);
      -t.{@link #compile}();
      -t.{@link #append}('some-element', {id: 'myid', cls: 'myclass', name: 'foo', value: 'bar'});
      -
      - *
  • - *
  • multiple arguments : String, Object, Array, ... - *
    - * Multiple arguments will be combined with join(''). - *
    
    -var t = new Ext.Template(
    -    '<div name="{id}">',
    -        '<span class="{cls}">{name} {value}</span>',
    -    '</div>',
    -    // a configuration object:
    -    {
    -        compiled: true,      // {@link #compile} immediately
    -        disableFormats: true // See Notes below.
    -    } 
    -);
    - * 
    - *

    Notes:

    - *
      - *
    • Formatting and disableFormats are not applicable for Ext Core.
    • - *
    • For a list of available format functions, see {@link Ext.util.Format}.
    • - *
    • disableFormats reduces {@link #apply} time - * when no formatting is required.
    • - *
    - *
  • - *
- * @param {Mixed} config - */ + }; + return pub; +}()); + Ext.Template = function(html){ var me = this, - a = arguments, - buf = []; + a = arguments, + buf = [], + v; if (Ext.isArray(html)) { html = html.join(""); } else if (a.length > 1) { - Ext.each(a, function(v) { - if (Ext.isObject(v)) { + for(var i = 0, len = a.length; i < len; i++){ + v = a[i]; + if(typeof v == 'object'){ Ext.apply(me, v); } else { buf.push(v); } - }); + }; html = buf.join(''); } - /**@private*/ + me.html = html; - /** - * @cfg {Boolean} compiled Specify true to compile the template - * immediately (see {@link #compile}). - * Defaults to false. - */ + if (me.compiled) { me.compile(); } }; Ext.Template.prototype = { - /** - * @cfg {RegExp} re The regular expression used to match template variables. - * Defaults to:

-     * re : /\{([\w-]+)\}/g                                     // for Ext Core
-     * re : /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g      // for Ext JS
-     * 
- */ + re : /\{([\w-]+)\}/g, - /** - * See {@link #re}. - * @type RegExp - * @property re - */ + - /** - * Returns an HTML fragment of this template with the specified values applied. - * @param {Object/Array} values - * The template values. Can be an array if the params are numeric (i.e. {0}) - * or an object (i.e. {foo: 'bar'}). - * @return {String} The HTML fragment - */ + applyTemplate : function(values){ - var me = this; + var me = this; return me.compiled ? - me.compiled(values) : - me.html.replace(me.re, function(m, name){ - return values[name] !== undefined ? values[name] : ""; - }); - }, + me.compiled(values) : + me.html.replace(me.re, function(m, name){ + return values[name] !== undefined ? values[name] : ""; + }); + }, - /** - * Sets the HTML used as the template and optionally compiles it. - * @param {String} html - * @param {Boolean} compile (optional) True to compile the template (defaults to undefined) - * @return {Ext.Template} this - */ + set : function(html, compile){ - var me = this; + var me = this; me.html = html; me.compiled = null; return compile ? me.compile() : me; }, - /** - * Compiles the template into an internal function, eliminating the RegEx overhead. - * @return {Ext.Template} this - */ + compile : function(){ var me = this, - sep = Ext.isGecko ? "+" : ","; + sep = Ext.isGecko ? "+" : ","; - function fn(m, name){ - name = "values['" + name + "']"; - return "'"+ sep + '(' + name + " == undefined ? '' : " + name + ')' + sep + "'"; + function fn(m, name){ + name = "values['" + name + "']"; + return "'"+ sep + '(' + name + " == undefined ? '' : " + name + ')' + sep + "'"; } - + eval("this.compiled = function(values){ return " + (Ext.isGecko ? "'" : "['") + me.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn) + (Ext.isGecko ? "';};" : "'].join('');};")); return me; }, - /** - * Applies the supplied values to the template and inserts the new node(s) as the first child of el. - * @param {Mixed} el The context element - * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'}) - * @param {Boolean} returnElement (optional) true to return a Ext.Element (defaults to undefined) - * @return {HTMLElement/Ext.Element} The new node or Element - */ + insertFirst: function(el, values, returnElement){ return this.doInsert('afterBegin', el, values, returnElement); }, - /** - * Applies the supplied values to the template and inserts the new node(s) before el. - * @param {Mixed} el The context element - * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'}) - * @param {Boolean} returnElement (optional) true to return a Ext.Element (defaults to undefined) - * @return {HTMLElement/Ext.Element} The new node or Element - */ + insertBefore: function(el, values, returnElement){ return this.doInsert('beforeBegin', el, values, returnElement); }, - /** - * Applies the supplied values to the template and inserts the new node(s) after el. - * @param {Mixed} el The context element - * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'}) - * @param {Boolean} returnElement (optional) true to return a Ext.Element (defaults to undefined) - * @return {HTMLElement/Ext.Element} The new node or Element - */ + insertAfter : function(el, values, returnElement){ return this.doInsert('afterEnd', el, values, returnElement); }, - /** - * Applies the supplied values to the template and appends - * the new node(s) to the specified el. - *

For example usage {@link #Template see the constructor}.

- * @param {Mixed} el The context element - * @param {Object/Array} values - * The template values. Can be an array if the params are numeric (i.e. {0}) - * or an object (i.e. {foo: 'bar'}). - * @param {Boolean} returnElement (optional) true to return an Ext.Element (defaults to undefined) - * @return {HTMLElement/Ext.Element} The new node or Element - */ + append : function(el, values, returnElement){ return this.doInsert('beforeEnd', el, values, returnElement); }, @@ -762,77 +445,33 @@ Ext.Template.prototype = { return returnEl ? Ext.get(newNode, true) : newNode; }, - /** - * Applies the supplied values to the template and overwrites the content of el with the new node(s). - * @param {Mixed} el The context element - * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'}) - * @param {Boolean} returnElement (optional) true to return a Ext.Element (defaults to undefined) - * @return {HTMLElement/Ext.Element} The new node or Element - */ + overwrite : function(el, values, returnElement){ el = Ext.getDom(el); el.innerHTML = this.applyTemplate(values); return returnElement ? Ext.get(el.firstChild, true) : el.firstChild; } }; -/** - * Alias for {@link #applyTemplate} - * Returns an HTML fragment of this template with the specified values applied. - * @param {Object/Array} values - * The template values. Can be an array if the params are numeric (i.e. {0}) - * or an object (i.e. {foo: 'bar'}). - * @return {String} The HTML fragment - * @member Ext.Template - * @method apply - */ + Ext.Template.prototype.apply = Ext.Template.prototype.applyTemplate; -/** - * Creates a template from the passed element's value (display:none textarea, preferred) or innerHTML. - * @param {String/HTMLElement} el A DOM element or its id - * @param {Object} config A configuration object - * @return {Ext.Template} The created template - * @static - */ + Ext.Template.from = function(el, config){ el = Ext.getDom(el); return new Ext.Template(el.value || el.innerHTML, config || ''); -};/** - * @class Ext.Template - */ +}; + Ext.apply(Ext.Template.prototype, { - /** - * @cfg {Boolean} disableFormats Specify true to disable format - * functions in the template. If the template does not contain - * {@link Ext.util.Format format functions}, setting disableFormats - * to true will reduce {@link #apply} time. Defaults to false. - *

-var t = new Ext.Template(
-    '<div name="{id}">',
-        '<span class="{cls}">{name} {value}</span>',
-    '</div>',
-    {
-        compiled: true,      // {@link #compile} immediately
-        disableFormats: true // reduce {@link #apply} time since no formatting
-    }    
-);
-     * 
- * For a list of available format functions, see {@link Ext.util.Format}. - */ - disableFormats : false, - /** - * See {@link #disableFormats}. - * @type Boolean - * @property disableFormats - */ + + disableFormats : false, + - /** - * The regular expression used to match template variables - * @type RegExp - * @property - * @hide repeat doc - */ + re : /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g, + argsRe : /^\s*['"](.*)["']\s*$/, + compileARe : /\\/g, + compileBRe : /(\r\n|\n)/g, + compileCRe : /'/g, /** * Returns an HTML fragment of this template with the specified values applied. @@ -841,11 +480,11 @@ var t = new Ext.Template( * @hide repeat doc */ applyTemplate : function(values){ - var me = this, - useF = me.disableFormats !== true, - fm = Ext.util.Format, - tpl = me; - + var me = this, + useF = me.disableFormats !== true, + fm = Ext.util.Format, + tpl = me; + if(me.compiled){ return me.compiled(values); } @@ -858,7 +497,7 @@ var t = new Ext.Template( // quoted values are required for strings in compiled templates, // but for non compiled we need to strip them // quoted reversed for jsmin - var re = /^\s*['"](.*)["']\s*$/; + var re = me.argsRe; args = args.split(','); for(var i = 0, len = args.length; i < len; i++){ args[i] = args[i].replace(re, "$1"); @@ -875,7 +514,7 @@ var t = new Ext.Template( } return me.html.replace(me.re, fn); }, - + /** * Compiles the template into an internal function, eliminating the RegEx overhead. * @return {Ext.Template} this @@ -883,11 +522,11 @@ var t = new Ext.Template( */ compile : function(){ var me = this, - fm = Ext.util.Format, - useF = me.disableFormats !== true, - sep = Ext.isGecko ? "+" : ",", - body; - + fm = Ext.util.Format, + useF = me.disableFormats !== true, + sep = Ext.isGecko ? "+" : ",", + body; + function fn(m, name, format, args){ if(format && useF){ args = args ? ',' + args : ""; @@ -902,28 +541,29 @@ var t = new Ext.Template( } return "'"+ sep + format + "values['" + name + "']" + args + ")"+sep+"'"; } - + // branched to use + in gecko and [].join() in others if(Ext.isGecko){ body = "this.compiled = function(values){ return '" + - me.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn) + + me.html.replace(me.compileARe, '\\\\').replace(me.compileBRe, '\\n').replace(me.compileCRe, "\\'").replace(me.re, fn) + "';};"; }else{ body = ["this.compiled = function(values){ return ['"]; - body.push(me.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn)); + body.push(me.html.replace(me.compileARe, '\\\\').replace(me.compileBRe, '\\n').replace(me.compileCRe, "\\'").replace(me.re, fn)); body.push("'].join('');};"); body = body.join(''); } eval(body); return me; }, - + // private function used to call members call : function(fnName, value, allValues){ return this[fnName](value, allValues); } }); -Ext.Template.prototype.apply = Ext.Template.prototype.applyTemplate; /* +Ext.Template.prototype.apply = Ext.Template.prototype.applyTemplate; +/* * This is code is also distributed under MIT license for use * with jQuery and prototype JavaScript libraries. */ @@ -976,7 +616,7 @@ All selectors, attribute filters and pseudos below can be combined infinitely in
  • E:has(S) an E element that has a descendent that matches simple selector S
  • E:next(S) an E element whose next sibling matches simple selector S
  • E:prev(S) an E element whose previous sibling matches simple selector S
  • -
  • E:any(S1|S2|S2) an E element which matches any of the simple selectors S1, S2 or S3//\\
  • +
  • E:any(S1|S2|S2) an E element which matches any of the simple selectors S1, S2 or S3

    CSS Value Selectors:

      @@ -1000,18 +640,18 @@ Ext.DomQuery = function(){ tagTokenRe = /^(#)?([\w-\*]+)/, nthRe = /(\d*)n\+?(\d*)/, nthRe2 = /\D/, - // This is for IE MSXML which does not support expandos. - // IE runs the same speed using setAttribute, however FF slows way down - // and Safari completely fails so they need to continue to use expandos. + + + isIE = window.ActiveXObject ? true : false, key = 30803; - // this eval is stop the compressor from - // renaming the variable to something shorter + + eval("var batch = 30803;"); - // Retrieve the child node from a particular - // parent at the specified index. + + function child(parent, index){ var i = 0, n = parent.firstChild; @@ -1026,31 +666,31 @@ Ext.DomQuery = function(){ return null; } - // retrieve the next element node + function next(n){ while((n = n.nextSibling) && n.nodeType != 1); return n; } - // retrieve the previous element node + function prev(n){ while((n = n.previousSibling) && n.nodeType != 1); return n; } - // Mark each child node with a nodeIndex skipping and - // removing empty text nodes. + + function children(parent){ var n = parent.firstChild, nodeIndex = -1, nextNode; while(n){ nextNode = n.nextSibling; - // clean worthless empty nodes. + if(n.nodeType == 3 && !nonSpace.test(n.nodeValue)){ parent.removeChild(n); }else{ - // add an expando nodeIndex + n.nodeIndex = ++nodeIndex; } n = nextNode; @@ -1059,8 +699,8 @@ Ext.DomQuery = function(){ } - // nodeSet - array of nodes - // cls - CSS Class + + function byClassName(nodeSet, cls){ if(!cls){ return nodeSet; @@ -1075,7 +715,7 @@ Ext.DomQuery = function(){ }; function attrValue(n, attr){ - // if its an array, use the first node. + if(!n.tagName && typeof n.length != "undefined"){ n = n[0]; } @@ -1094,22 +734,22 @@ Ext.DomQuery = function(){ }; - // ns - nodes - // mode - false, /, >, +, ~ - // tagName - defaults to "*" + + + function getNodes(ns, mode, tagName){ var result = [], ri = -1, cs; if(!ns){ return result; } tagName = tagName || "*"; - // convert to array + if(typeof ns.getElementsByTagName != "undefined"){ ns = [ns]; } - // no mode specified, grab all elements by tagName - // at any depth + + if(!mode){ for(var i = 0, ni; ni = ns[i]; i++){ cs = ni.getElementsByTagName(tagName); @@ -1117,8 +757,8 @@ Ext.DomQuery = function(){ result[++ri] = ci; } } - // Direct Child mode (/ or >) - // E > F or E/F all direct children elements of E that have the tag + + } else if(mode == "/" || mode == ">"){ var utag = tagName.toUpperCase(); for(var i = 0, ni, cn; ni = ns[i]; i++){ @@ -1129,8 +769,8 @@ Ext.DomQuery = function(){ } } } - // Immediately Preceding mode (+) - // E + F all elements with the tag F that are immediately preceded by an element with the tag E + + }else if(mode == "+"){ var utag = tagName.toUpperCase(); for(var i = 0, n; n = ns[i]; i++){ @@ -1139,8 +779,8 @@ Ext.DomQuery = function(){ result[++ri] = n; } } - // Sibling mode (~) - // E ~ F all elements with the tag F that are preceded by a sibling element with the tag E + + }else if(mode == "~"){ var utag = tagName.toUpperCase(); for(var i = 0, n; n = ns[i]; i++){ @@ -1198,8 +838,8 @@ Ext.DomQuery = function(){ return result; } - // operators are =, !=, ^=, $=, *=, %=, |= and ~= - // custom can be "{" + + function byAttribute(cs, attr, value, op, custom){ var result = [], ri = -1, @@ -1208,13 +848,13 @@ Ext.DomQuery = function(){ a, innerHTML; for(var i = 0, ci; ci = cs[i]; i++){ - // skip non-element nodes. + if(ci.nodeType != 1){ continue; } innerHTML = ci.innerHTML; - // we only need to change the property names if we're dealing with html nodes, not XML + if(innerHTML !== null && innerHTML !== undefined){ if(useGetStyle){ a = Ext.DomQuery.getStyle(ci, attr); @@ -1223,8 +863,8 @@ Ext.DomQuery = function(){ } else if (attr == "for"){ a = ci.htmlFor; } else if (attr == "href"){ - // getAttribute href bug - // http://www.glennjones.net/Post/809/getAttributehrefbug.htm + + a = ci.getAttribute("href", 2); } else{ a = ci.getAttribute(attr); @@ -1345,24 +985,18 @@ Ext.DomQuery = function(){ getStyle : function(el, name){ return Ext.fly(el).getStyle(name); }, - /** - * Compiles a selector/xpath query into a reusable function. The returned function - * takes one parameter "root" (optional), which is the context node from where the query should start. - * @param {String} selector The selector/xpath query - * @param {String} type (optional) Either "select" (the default) or "simple" for a simple selector match - * @return {Function} - */ + compile : function(path, type){ type = type || "select"; - // setup fn preamble + var fn = ["var f = function(root){\n var mode; ++batch; var n = root || document;\n"], mode, lastPath, matchers = Ext.DomQuery.matchers, matchersLn = matchers.length, modeMatch, - // accept leading mode switch + lmode = path.match(modeRe); if(lmode && lmode[1]){ @@ -1370,7 +1004,7 @@ Ext.DomQuery = function(){ path = path.replace(lmode[1], ""); } - // strip leading slashes + while(path.substr(0, 1)=="/"){ path = path.substr(1); } @@ -1380,7 +1014,7 @@ Ext.DomQuery = function(){ var tokenMatch = path.match(tagTokenRe); if(type == "select"){ if(tokenMatch){ - // ID Selector + if(tokenMatch[1] == "#"){ fn[fn.length] = 'n = quickId(n, mode, root, "'+tokenMatch[2]+'");'; }else{ @@ -1390,7 +1024,7 @@ Ext.DomQuery = function(){ }else if(path.substr(0, 1) != '@'){ fn[fn.length] = 'n = getNodes(n, mode, "*");'; } - // type of "simple" + }else{ if(tokenMatch){ if(tokenMatch[1] == "#"){ @@ -1415,7 +1049,7 @@ Ext.DomQuery = function(){ break; } } - // prevent infinite loop on bad selector + if(!matched){ throw 'Error parsing selector, parsing failed at "' + path + '"'; } @@ -1425,23 +1059,17 @@ Ext.DomQuery = function(){ path = path.replace(modeMatch[1], ""); } } - // close fn out + fn[fn.length] = "return nodup(n);\n}"; - // eval fn and return it + eval(fn.join("")); return f; }, - /** - * Selects a group of elements. - * @param {String} selector The selector/xpath query (can be a comma separated list of selectors) - * @param {Node/String} root (optional) The start of the query (defaults to document). - * @return {Array} An Array of DOM elements which match the selector. If there are - * no matches, and empty Array is returned. - */ + jsSelect: function(path, root, type){ - // set root to doc if not specified. + root = root || document; if(typeof root == "string"){ @@ -1450,10 +1078,10 @@ Ext.DomQuery = function(){ var paths = path.split(","), results = []; - // loop over each selector + for(var i = 0, len = paths.length; i < len; i++){ var subPath = paths[i].replace(trimRe, ""); - // compile and place in cache + if(!cache[subPath]){ cache[subPath] = Ext.DomQuery.compile(subPath); if(!cache[subPath]){ @@ -1466,8 +1094,8 @@ Ext.DomQuery = function(){ } } - // if there were multiple selectors, make sure dups - // are eliminated + + if(paths.length > 1){ return nodup(results); } @@ -1491,23 +1119,12 @@ Ext.DomQuery = function(){ return Ext.DomQuery.jsSelect.call(this, path, root, type); }, - /** - * Selects a single element. - * @param {String} selector The selector/xpath query - * @param {Node} root (optional) The start of the query (defaults to document). - * @return {Element} The DOM element which matched the selector. - */ + selectNode : function(path, root){ return Ext.DomQuery.select(path, root)[0]; }, - /** - * Selects the value of a node, optionally replacing null with the defaultValue. - * @param {String} selector The selector/xpath query - * @param {Node} root (optional) The start of the query (defaults to document). - * @param {String} defaultValue - * @return {String} - */ + selectValue : function(path, root, defaultValue){ path = path.replace(trimRe, ""); if(!valueCache[path]){ @@ -1516,34 +1133,23 @@ Ext.DomQuery = function(){ var n = valueCache[path](root), v; n = n[0] ? n[0] : n; - // overcome a limitation of maximum textnode size - // Rumored to potentially crash IE6 but has not been confirmed. - // http://reference.sitepoint.com/javascript/Node/normalize - // https://developer.mozilla.org/En/DOM/Node.normalize + + + + if (typeof n.normalize == 'function') n.normalize(); v = (n && n.firstChild ? n.firstChild.nodeValue : null); return ((v === null||v === undefined||v==='') ? defaultValue : v); }, - /** - * Selects the value of a node, parsing integers and floats. Returns the defaultValue, or 0 if none is specified. - * @param {String} selector The selector/xpath query - * @param {Node} root (optional) The start of the query (defaults to document). - * @param {Number} defaultValue - * @return {Number} - */ + selectNumber : function(path, root, defaultValue){ var v = Ext.DomQuery.selectValue(path, root, defaultValue || 0); return parseFloat(v); }, - /** - * Returns true if the passed element(s) match the passed simple selector (e.g. div.some-class or span:first-child) - * @param {String/HTMLElement/Array} el An element id, element or array of elements - * @param {String} selector The simple selector to test - * @return {Boolean} - */ + is : function(el, ss){ if(typeof el == "string"){ el = document.getElementById(el); @@ -1553,15 +1159,7 @@ Ext.DomQuery = function(){ return isArray ? (result.length == el.length) : (result.length > 0); }, - /** - * Filters an array of elements to only include matches of a simple selector (e.g. div.some-class or span:first-child) - * @param {Array} el An array of elements to filter - * @param {String} selector The simple selector to test - * @param {Boolean} nonMatches If true, it returns the elements that DON'T match - * the selector instead of the ones that match - * @return {Array} An Array of DOM elements which match the selector. If there are - * no matches, and empty Array is returned. - */ + filter : function(els, ss, nonMatches){ ss = ss.replace(trimRe, ""); if(!simpleCache[ss]){ @@ -1571,11 +1169,7 @@ Ext.DomQuery = function(){ return nonMatches ? quickDiff(result, els) : result; }, - /** - * Collection of matching regular expressions and code snippets. - * Each capture group within () will be replace the {} in the select - * statement as specified by their index. - */ + matchers : [{ re: /^\.([\w-]+)/, select: 'n = byClassName(n, " {1} ");' @@ -1594,10 +1188,7 @@ Ext.DomQuery = function(){ } ], - /** - * Collection of operator comparison functions. The default operators are =, !=, ^=, $=, *=, %=, |= and ~=. - * New operators can be added as long as the match the format c= where c is any character other than space, > <. - */ + operators : { "=" : function(a, v){ return a == v; @@ -1625,31 +1216,7 @@ Ext.DomQuery = function(){ } }, - /** - *

      Object hash of "pseudo class" filter functions which are used when filtering selections. Each function is passed - * two parameters:

        - *
      • c : Array
        An Array of DOM elements to filter.
      • - *
      • v : String
        The argument (if any) supplied in the selector.
      • - *
      - *

      A filter function returns an Array of DOM elements which conform to the pseudo class.

      - *

      In addition to the provided pseudo classes listed above such as first-child and nth-child, - * developers may add additional, custom psuedo class filters to select elements according to application-specific requirements.

      - *

      For example, to filter <a> elements to only return links to external resources:

      - *
      -Ext.DomQuery.pseudos.external = function(c, v){
      -    var r = [], ri = -1;
      -    for(var i = 0, ci; ci = c[i]; i++){
      -//      Include in result set only if it's a link to an external resource
      -        if(ci.hostname != location.hostname){
      -            r[++ri] = ci;
      -        }
      -    }
      -    return r;
      -};
      - * Then external links could be gathered with the following statement:
      -var externalLinks = Ext.select("a:external");
      -
      - */ + pseudos : { "first-child" : function(c){ var r = [], ri = -1, n; @@ -1834,44 +1401,9 @@ var externalLinks = Ext.select("a:external"); }; }(); -/** - * Selects an array of DOM nodes by CSS/XPath selector. Shorthand of {@link Ext.DomQuery#select} - * @param {String} path The selector/xpath query - * @param {Node} root (optional) The start of the query (defaults to document). - * @return {Array} - * @member Ext - * @method query - */ + Ext.query = Ext.DomQuery.select; -/** - * @class Ext.util.DelayedTask - *

      The DelayedTask class provides a convenient way to "buffer" the execution of a method, - * performing setTimeout where a new timeout cancels the old timeout. When called, the - * task will wait the specified time period before executing. If durng that time period, - * the task is called again, the original call will be cancelled. This continues so that - * the function is only called a single time for each iteration.

      - *

      This method is especially useful for things like detecting whether a user has finished - * typing in a text field. An example would be performing validation on a keypress. You can - * use this class to buffer the keypress events for a certain number of milliseconds, and - * perform only if they stop for that amount of time. Usage:

      
      -var task = new Ext.util.DelayedTask(function(){
      -    alert(Ext.getDom('myInputField').value.length);
      -});
      -// Wait 500ms before calling our function. If the user presses another key 
      -// during that 500ms, it will be cancelled and we'll wait another 500ms.
      -Ext.get('myInputField').on('keypress', function(){
      -    task.{@link #delay}(500); 
      -});
      - * 
      - *

      Note that we are using a DelayedTask here to illustrate a point. The configuration - * option buffer for {@link Ext.util.Observable#addListener addListener/on} will - * also setup a delayed task for you to buffer events.

      - * @constructor The parameters to this constructor serve as defaults and are not required. - * @param {Function} fn (optional) The default function to call. - * @param {Object} scope The default scope (The this reference) in which the - * function is called. If not specified, this will refer to the browser window. - * @param {Array} args (optional) The default Array of arguments. - */ + Ext.util.DelayedTask = function(fn, scope, args){ var me = this, id, @@ -1881,14 +1413,7 @@ Ext.util.DelayedTask = function(fn, scope, args){ fn.apply(scope, args || []); }; - /** - * Cancels any pending timeout and queues a new one - * @param {Number} delay The milliseconds to delay - * @param {Function} newFn (optional) Overrides function passed to constructor - * @param {Object} newScope (optional) Overrides scope passed to constructor. Remember that if no scope - * is specified, this will refer to the browser window. - * @param {Array} newArgs (optional) Overrides args passed to constructor - */ + me.delay = function(delay, newFn, newScope, newArgs){ me.cancel(); fn = newFn || fn; @@ -1897,9 +1422,7 @@ Ext.util.DelayedTask = function(fn, scope, args){ id = setInterval(call, delay); }; - /** - * Cancel the last queued timeout - */ + me.cancel = function(){ if(id){ clearInterval(id); @@ -1909,107 +1432,12 @@ Ext.util.DelayedTask = function(fn, scope, args){ };(function(){ var EXTUTIL = Ext.util, - TOARRAY = Ext.toArray, EACH = Ext.each, - ISOBJECT = Ext.isObject, TRUE = true, FALSE = false; -/** - * @class Ext.util.Observable - * Base class that provides a common interface for publishing events. Subclasses are expected to - * to have a property "events" with all the events defined, and, optionally, a property "listeners" - * with configured listeners defined.
      - * For example: - *
      
      -Employee = Ext.extend(Ext.util.Observable, {
      -    constructor: function(config){
      -        this.name = config.name;
      -        this.addEvents({
      -            "fired" : true,
      -            "quit" : true
      -        });
      -
      -        // Copy configured listeners into *this* object so that the base class's
      -        // constructor will add them.
      -        this.listeners = config.listeners;
       
      -        // Call our superclass constructor to complete construction process.
      -        Employee.superclass.constructor.call(this, config)
      -    }
      -});
      -
      - * This could then be used like this:
      
      -var newEmployee = new Employee({
      -    name: employeeName,
      -    listeners: {
      -        quit: function() {
      -            // By default, "this" will be the object that fired the event.
      -            alert(this.name + " has quit!");
      -        }
      -    }
      -});
      -
      - */ EXTUTIL.Observable = function(){ - /** - * @cfg {Object} listeners (optional)

      A config object containing one or more event handlers to be added to this - * object during initialization. This should be a valid listeners config object as specified in the - * {@link #addListener} example for attaching multiple handlers at once.

      - *

      DOM events from ExtJs {@link Ext.Component Components}

      - *

      While some ExtJs Component classes export selected DOM events (e.g. "click", "mouseover" etc), this - * is usually only done when extra value can be added. For example the {@link Ext.DataView DataView}'s - * {@link Ext.DataView#click click} event passing the node clicked on. To access DOM - * events directly from a Component's HTMLElement, listeners must be added to the {@link Ext.Component#getEl Element} after the Component - * has been rendered. A plugin can simplify this step:

      
      -// Plugin is configured with a listeners config object.
      -// The Component is appended to the argument list of all handler functions.
      -Ext.DomObserver = Ext.extend(Object, {
      -    constructor: function(config) {
      -        this.listeners = config.listeners ? config.listeners : config;
      -    },
      -
      -    // Component passes itself into plugin's init method
      -    init: function(c) {
      -        var p, l = this.listeners;
      -        for (p in l) {
      -            if (Ext.isFunction(l[p])) {
      -                l[p] = this.createHandler(l[p], c);
      -            } else {
      -                l[p].fn = this.createHandler(l[p].fn, c);
      -            }
      -        }
      -
      -        // Add the listeners to the Element immediately following the render call
      -        c.render = c.render.{@link Function#createSequence createSequence}(function() {
      -            var e = c.getEl();
      -            if (e) {
      -                e.on(l);
      -            }
      -        });
      -    },
      -
      -    createHandler: function(fn, c) {
      -        return function(e) {
      -            fn.call(this, e, c);
      -        };
      -    }
      -});
      -
      -var combo = new Ext.form.ComboBox({
      -
      -    // Collapse combo when its element is clicked on
      -    plugins: [ new Ext.DomObserver({
      -        click: function(evt, comp) {
      -            comp.collapse();
      -        }
      -    })],
      -    store: myStore,
      -    typeAhead: true,
      -    mode: 'local',
      -    triggerAction: 'all'
      -});
      -     * 

      - */ + var me = this, e = me.events; if(me.listeners){ me.on(me.listeners); @@ -2019,23 +1447,17 @@ var combo = new Ext.form.ComboBox({ }; EXTUTIL.Observable.prototype = { - // private + filterOptRe : /^(?:scope|delay|buffer|single)$/, - /** - *

      Fires the specified event with the passed parameters (minus the event name).

      - *

      An event may be set to bubble up an Observable parent hierarchy (See {@link Ext.Component#getBubbleTarget}) - * by calling {@link #enableBubble}.

      - * @param {String} eventName The name of the event to fire. - * @param {Object...} args Variable number of parameters are passed to handlers. - * @return {Boolean} returns false if any of the handlers return false otherwise it returns true. - */ + fireEvent : function(){ - var a = TOARRAY(arguments), + var a = Array.prototype.slice.call(arguments, 0), ename = a[0].toLowerCase(), me = this, ret = TRUE, ce = me.events[ename], + cc, q, c; if (me.eventsSuspended === TRUE) { @@ -2043,20 +1465,21 @@ EXTUTIL.Observable.prototype = { q.push(a); } } - else if(ISOBJECT(ce) && ce.bubble){ - if(ce.fire.apply(ce, a.slice(1)) === FALSE) { - return FALSE; - } - c = me.getBubbleTarget && me.getBubbleTarget(); - if(c && c.enableBubble) { - if(!c.events[ename] || !Ext.isObject(c.events[ename]) || !c.events[ename].bubble) { - c.enableBubble(ename); + else if(typeof ce == 'object') { + if (ce.bubble){ + if(ce.fire.apply(ce, a.slice(1)) === FALSE) { + return FALSE; + } + c = me.getBubbleTarget && me.getBubbleTarget(); + if(c && c.enableBubble) { + cc = c.events[ename]; + if(!cc || typeof cc != 'object' || !cc.bubble) { + c.enableBubble(ename); + } + return c.fireEvent.apply(c, a); } - return c.fireEvent.apply(c, a); } - } - else { - if (ISOBJECT(ce)) { + else { a.shift(); ret = ce.fire.apply(ce, a); } @@ -2064,72 +1487,14 @@ EXTUTIL.Observable.prototype = { return ret; }, - /** - * Appends an event handler to this object. - * @param {String} eventName The name of the event to listen for. - * @param {Function} handler The method the event invokes. - * @param {Object} scope (optional) The scope (this reference) in which the handler function is executed. - * If omitted, defaults to the object which fired the event. - * @param {Object} options (optional) An object containing handler configuration. - * properties. This may contain any of the following properties:
        - *
      • scope : Object
        The scope (this reference) in which the handler function is executed. - * If omitted, defaults to the object which fired the event.
      • - *
      • delay : Number
        The number of milliseconds to delay the invocation of the handler after the event fires.
      • - *
      • single : Boolean
        True to add a handler to handle just the next firing of the event, and then remove itself.
      • - *
      • buffer : Number
        Causes the handler to be scheduled to run in an {@link Ext.util.DelayedTask} delayed - * by the specified number of milliseconds. If the event fires again within that time, the original - * handler is not invoked, but the new handler is scheduled in its place.
      • - *
      • target : Observable
        Only call the handler if the event was fired on the target Observable, not - * if the event was bubbled up from a child Observable.
      • - *

      - *

      - * Combining Options
      - * Using the options argument, it is possible to combine different types of listeners:
      - *
      - * A delayed, one-time listener. - *

      
      -myDataView.on('click', this.onClick, this, {
      -single: true,
      -delay: 100
      -});
      - *

      - * Attaching multiple handlers in 1 call
      - * The method also allows for a single argument to be passed which is a config object containing properties - * which specify multiple handlers. - *

      - *

      
      -myGridPanel.on({
      -'click' : {
      -    fn: this.onClick,
      -    scope: this,
      -    delay: 100
      -},
      -'mouseover' : {
      -    fn: this.onMouseOver,
      -    scope: this
      -},
      -'mouseout' : {
      -    fn: this.onMouseOut,
      -    scope: this
      -}
      -});
      - *

      - * Or a shorthand syntax:
      - *

      
      -myGridPanel.on({
      -'click' : this.onClick,
      -'mouseover' : this.onMouseOver,
      -'mouseout' : this.onMouseOut,
      - scope: this
      -});
      - */ + addListener : function(eventName, fn, scope, o){ var me = this, e, oe, isF, ce; - if (ISOBJECT(eventName)) { + if (typeof eventName == 'object') { o = eventName; for (e in o){ oe = o[e]; @@ -2140,54 +1505,39 @@ myGridPanel.on({ } else { eventName = eventName.toLowerCase(); ce = me.events[eventName] || TRUE; - if (Ext.isBoolean(ce)) { + if (typeof ce == 'boolean') { me.events[eventName] = ce = new EXTUTIL.Event(me, eventName); } - ce.addListener(fn, scope, ISOBJECT(o) ? o : {}); + ce.addListener(fn, scope, typeof o == 'object' ? o : {}); } }, - /** - * Removes an event handler. - * @param {String} eventName The type of event the handler was associated with. - * @param {Function} handler The handler to remove. This must be a reference to the function passed into the {@link #addListener} call. - * @param {Object} scope (optional) The scope originally specified for the handler. - */ + removeListener : function(eventName, fn, scope){ var ce = this.events[eventName.toLowerCase()]; - if (ISOBJECT(ce)) { + if (typeof ce == 'object') { ce.removeListener(fn, scope); } }, - /** - * Removes all listeners for this object - */ + purgeListeners : function(){ var events = this.events, evt, key; for(key in events){ evt = events[key]; - if(ISOBJECT(evt)){ + if(typeof evt == 'object'){ evt.clearListeners(); } } }, - /** - * Adds the specified events to the list of events which this Observable may fire. - * @param {Object|String} o Either an object with event names as properties with a value of true - * or the first event name string if multiple event names are being passed as separate parameters. - * @param {string} Optional. Event name if multiple event names are being passed as separate parameters. - * Usage:
      
      -this.addEvents('storeloaded', 'storecleared');
      -
      - */ + addEvents : function(o){ var me = this; me.events = me.events || {}; - if (Ext.isString(o)) { + if (typeof o == 'string') { var a = arguments, i = a.length; while(i--) { @@ -2198,21 +1548,13 @@ this.addEvents('storeloaded', 'storecleared'); } }, - /** - * Checks to see if this object has any listeners for a specified event - * @param {String} eventName The name of the event to check for - * @return {Boolean} True if the event is being listened for, else false - */ + hasListener : function(eventName){ var e = this.events[eventName.toLowerCase()]; - return ISOBJECT(e) && e.listeners.length > 0; + return typeof e == 'object' && e.listeners.length > 0; }, - /** - * Suspend the firing of all events. (see {@link #resumeEvents}) - * @param {Boolean} queueSuspended Pass as true to queue up suspended events to be fired - * after the {@link #resumeEvents} call instead of discarding all suspended events; - */ + suspendEvents : function(queueSuspended){ this.eventsSuspended = TRUE; if(queueSuspended && !this.eventQueue){ @@ -2220,11 +1562,7 @@ this.addEvents('storeloaded', 'storecleared'); } }, - /** - * Resume firing events. (see {@link #suspendEvents}) - * If events were suspended using the queueSuspended parameter, then all - * events fired during event suspension will be sent to any listeners now. - */ + resumeEvents : function(){ var me = this, queued = me.eventQueue || []; @@ -2237,30 +1575,12 @@ this.addEvents('storeloaded', 'storecleared'); }; var OBSERVABLE = EXTUTIL.Observable.prototype; -/** - * Appends an event handler to this object (shorthand for {@link #addListener}.) - * @param {String} eventName The type of event to listen for - * @param {Function} handler The method the event invokes - * @param {Object} scope (optional) The scope (this reference) in which the handler function is executed. - * If omitted, defaults to the object which fired the event. - * @param {Object} options (optional) An object containing handler configuration. - * @method - */ + OBSERVABLE.on = OBSERVABLE.addListener; -/** - * Removes an event handler (shorthand for {@link #removeListener}.) - * @param {String} eventName The type of event the handler was associated with. - * @param {Function} handler The handler to remove. This must be a reference to the function passed into the {@link #addListener} call. - * @param {Object} scope (optional) The scope originally specified for the handler. - * @method - */ + OBSERVABLE.un = OBSERVABLE.removeListener; -/** - * Removes all added captures from the Observable. - * @param {Observable} o The Observable to release - * @static - */ + EXTUTIL.Observable.releaseCapture = function(o){ o.fireEvent = OBSERVABLE.fireEvent; }; @@ -2268,7 +1588,7 @@ EXTUTIL.Observable.releaseCapture = function(o){ function createTargeted(h, o, scope){ return function(){ if(o.target == arguments[0]){ - h.apply(scope, TOARRAY(arguments)); + h.apply(scope, Array.prototype.slice.call(arguments, 0)); } }; }; @@ -2276,7 +1596,7 @@ function createTargeted(h, o, scope){ function createBuffered(h, o, l, scope){ l.task = new EXTUTIL.DelayedTask(); return function(){ - l.task.delay(o.buffer, h, scope, TOARRAY(arguments)); + l.task.delay(o.buffer, h, scope, Array.prototype.slice.call(arguments, 0)); }; }; @@ -2294,7 +1614,7 @@ function createDelayed(h, o, l, scope){ l.tasks = []; } l.tasks.push(task); - task.delay(o.delay || 10, h, scope, TOARRAY(arguments)); + task.delay(o.delay || 10, h, scope, Array.prototype.slice.call(arguments, 0)); }; }; @@ -2311,7 +1631,7 @@ EXTUTIL.Event.prototype = { scope = scope || me.obj; if(!me.isListening(fn, scope)){ l = me.createListener(fn, scope, options); - if(me.firing){ // if we are currently firing this event, don't disturb the listener loop + if(me.firing){ me.listeners = me.listeners.slice(0); } me.listeners.push(l); @@ -2345,7 +1665,7 @@ EXTUTIL.Event.prototype = { var list = this.listeners, i = list.length, l; - + scope = scope || this.obj; while(i--){ l = list[i]; @@ -2390,7 +1710,7 @@ EXTUTIL.Event.prototype = { return ret; }, - // Iterate to stop any buffered/delayed events + clearListeners : function(){ var me = this, l = me.listeners, @@ -2402,7 +1722,6 @@ EXTUTIL.Event.prototype = { fire : function(){ var me = this, - args = TOARRAY(arguments), listeners = me.listeners, len = listeners.length, i = 0, @@ -2410,6 +1729,7 @@ EXTUTIL.Event.prototype = { if(len > 0){ me.firing = TRUE; + var args = Array.prototype.slice.call(arguments, 0); for (; i < len; i++) { l = listeners[i]; if(l && l.fireFn.apply(l.scope || me.obj || window, args) === FALSE) { @@ -2420,14 +1740,14 @@ EXTUTIL.Event.prototype = { me.firing = FALSE; return TRUE; } + }; -})();/** - * @class Ext.util.Observable - */ +})(); + Ext.apply(Ext.util.Observable.prototype, function(){ - // this is considered experimental (along with beforeMethod, afterMethod, removeMethodListener?) - // allows for easier interceptor and sequences, including cancelling and overwriting the return value of the call - // private + + + function getMethodEvent(method){ var e = (this.methodEvents = this.methodEvents || {})[method], returnValue, v, cancel, obj = this; @@ -2440,9 +1760,13 @@ Ext.apply(Ext.util.Observable.prototype, function(){ e.after = []; var makeCall = function(fn, scope, args){ - if (!Ext.isEmpty(v = fn.apply(scope || obj, args))) { - if (Ext.isObject(v)) { - returnValue = !Ext.isEmpty(v.returnValue) ? v.returnValue : v; + if((v = fn.apply(scope || obj, args)) !== undefined){ + if (typeof v == 'object') { + if(v.returnValue !== undefined){ + returnValue = v.returnValue; + }else{ + returnValue = v; + } cancel = !!v.cancel; } else @@ -2456,26 +1780,30 @@ Ext.apply(Ext.util.Observable.prototype, function(){ }; this[method] = function(){ - var args = Ext.toArray(arguments); + var args = Array.prototype.slice.call(arguments, 0), + b; returnValue = v = undefined; cancel = false; - Ext.each(e.before, function(b){ + for(var i = 0, len = e.before.length; i < len; i++){ + b = e.before[i]; makeCall(b.fn, b.scope, args); if (cancel) { return returnValue; } - }); + } - if (!Ext.isEmpty(v = e.originalFn.apply(obj, args))) { + if((v = e.originalFn.apply(obj, args)) !== undefined){ returnValue = v; } - Ext.each(e.after, function(a){ - makeCall(a.fn, a.scope, args); + + for(var i = 0, len = e.after.length; i < len; i++){ + b = e.after[i]; + makeCall(b.fn, b.scope, args); if (cancel) { return returnValue; } - }); + } return returnValue; }; } @@ -2483,9 +1811,9 @@ Ext.apply(Ext.util.Observable.prototype, function(){ } return { - // these are considered experimental - // allows for easier interceptor and sequences, including cancelling and overwriting the return value of the call - // adds an 'interceptor' called before the original method + + + beforeMethod : function(method, fn, scope){ getMethodEvent.call(this, method).before.push({ fn: fn, @@ -2493,7 +1821,7 @@ Ext.apply(Ext.util.Observable.prototype, function(){ }); }, - // adds a 'sequence' called after the original method + afterMethod : function(method, fn, scope){ getMethodEvent.call(this, method).after.push({ fn: fn, @@ -2502,144 +1830,77 @@ Ext.apply(Ext.util.Observable.prototype, function(){ }, removeMethodListener: function(method, fn, scope){ - var e = getMethodEvent.call(this, method), found = false; - Ext.each(e.before, function(b, i, arr){ - if (b.fn == fn && b.scope == scope) { - arr.splice(i, 1); - found = true; - return false; + var e = this.getMethodEvent(method); + for(var i = 0, len = e.before.length; i < len; i++){ + if(e.before[i].fn == fn && e.before[i].scope == scope){ + e.before.splice(i, 1); + return; + } + } + for(var i = 0, len = e.after.length; i < len; i++){ + if(e.after[i].fn == fn && e.after[i].scope == scope){ + e.after.splice(i, 1); + return; } - }); - if (!found) { - Ext.each(e.after, function(a, i, arr){ - if (a.fn == fn && a.scope == scope) { - arr.splice(i, 1); - return false; - } - }); } }, - /** - * Relays selected events from the specified Observable as if the events were fired by this. - * @param {Object} o The Observable whose events this object is to relay. - * @param {Array} events Array of event names to relay. - */ + relayEvents : function(o, events){ var me = this; function createHandler(ename){ return function(){ - return me.fireEvent.apply(me, [ename].concat(Ext.toArray(arguments))); + return me.fireEvent.apply(me, [ename].concat(Array.prototype.slice.call(arguments, 0))); }; } - Ext.each(events, function(ename){ + for(var i = 0, len = events.length; i < len; i++){ + var ename = events[i]; me.events[ename] = me.events[ename] || true; o.on(ename, createHandler(ename), me); - }); + } }, - /** - *

      Enables events fired by this Observable to bubble up an owner hierarchy by calling - * this.getBubbleTarget() if present. There is no implementation in the Observable base class.

      - *

      This is commonly used by Ext.Components to bubble events to owner Containers. See {@link Ext.Component.getBubbleTarget}. The default - * implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to - * access the required target more quickly.

      - *

      Example:

      
      -Ext.override(Ext.form.Field, {
      -    //  Add functionality to Field's initComponent to enable the change event to bubble
      -    initComponent : Ext.form.Field.prototype.initComponent.createSequence(function() {
      -        this.enableBubble('change');
      -    }),
      -
      -    //  We know that we want Field's events to bubble directly to the FormPanel.
      -    getBubbleTarget : function() {
      -        if (!this.formPanel) {
      -            this.formPanel = this.findParentByType('form');
      -        }
      -        return this.formPanel;
      -    }
      -});
      -
      -var myForm = new Ext.formPanel({
      -    title: 'User Details',
      -    items: [{
      -        ...
      -    }],
      -    listeners: {
      -        change: function() {
      -            // Title goes red if form has been modified.
      -            myForm.header.setStyle('color', 'red');
      -        }
      -    }
      -});
      -
      - * @param {String/Array} events The event name to bubble, or an Array of event names. - */ + enableBubble : function(events){ var me = this; if(!Ext.isEmpty(events)){ - events = Ext.isArray(events) ? events : Ext.toArray(arguments); - Ext.each(events, function(ename){ + events = Ext.isArray(events) ? events : Array.prototype.slice.call(arguments, 0); + for(var i = 0, len = events.length; i < len; i++){ + var ename = events[i]; ename = ename.toLowerCase(); var ce = me.events[ename] || true; - if (Ext.isBoolean(ce)) { + if (typeof ce == 'boolean') { ce = new Ext.util.Event(me, ename); me.events[ename] = ce; } ce.bubble = true; - }); + } } } }; }()); -/** - * Starts capture on the specified Observable. All events will be passed - * to the supplied function with the event name + standard signature of the event - * before the event is fired. If the supplied function returns false, - * the event will not fire. - * @param {Observable} o The Observable to capture events from. - * @param {Function} fn The function to call when an event is fired. - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to the Observable firing the event. - * @static - */ + Ext.util.Observable.capture = function(o, fn, scope){ o.fireEvent = o.fireEvent.createInterceptor(fn, scope); }; -/** - * Sets observability on the passed class constructor.

      - *

      This makes any event fired on any instance of the passed class also fire a single event through - * the class allowing for central handling of events on many instances at once.

      - *

      Usage:

      
      -Ext.util.Observable.observeClass(Ext.data.Connection);
      -Ext.data.Connection.on('beforerequest', function(con, options) {
      -    console.log('Ajax request made to ' + options.url);
      -});
      - * @param {Function} c The class constructor to make observable. - * @param {Object} listeners An object containing a series of listeners to add. See {@link #addListener}. - * @static - */ + Ext.util.Observable.observeClass = function(c, listeners){ if(c){ if(!c.fireEvent){ Ext.apply(c, new Ext.util.Observable()); Ext.util.Observable.capture(c.prototype, c.fireEvent, c); } - if(Ext.isObject(listeners)){ + if(typeof listeners == 'object'){ c.on(listeners); } return c; } -};/** - * @class Ext.EventManager - * Registers event handlers that want to receive a normalized EventObject instead of the standard browser event and provides - * several useful events directly. - * See {@link Ext.EventObject} for more details on normalized event objects. - * @singleton - */ +}; + Ext.EventManager = function(){ var docReadyEvent, @@ -2653,10 +1914,7 @@ Ext.EventManager = function(){ DOMCONTENTLOADED = "DOMContentLoaded", COMPLETE = 'complete', propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/, - /* - * This cache is used to hold special js objects, the document and window, that don't have an id. We need to keep - * a reference to them so we can look them up at a later point. - */ + specialElCache = []; function getId(el){ @@ -2668,7 +1926,7 @@ Ext.EventManager = function(){ o; if(el){ if(el.getElementById || el.navigator){ - // look up the id + for(; i < len; ++i){ o = specialElCache[i]; if(o.el === el){ @@ -2677,7 +1935,7 @@ Ext.EventManager = function(){ } } if(!id){ - // for browsers that support it, ensure that give the el the same id + id = Ext.id(el); specialElCache.push({ id: id, @@ -2698,7 +1956,7 @@ Ext.EventManager = function(){ return id; }; - /// There is some jquery work around stuff here that isn't needed in Ext Core. + function addListener(el, ename, fn, task, wrap, scope){ el = Ext.getDom(el); var id = getId(el), @@ -2708,18 +1966,13 @@ Ext.EventManager = function(){ wfn = E.on(el, ename, wrap); es[ename] = es[ename] || []; - /* 0 = Original Function, - 1 = Event Manager Wrapped Function, - 2 = Scope, - 3 = Adapter Wrapped Function, - 4 = Buffered Task - */ + es[ename].push([fn, wrap, scope, wfn, task]); - // this is a workaround for jQuery and should somehow be removed from Ext Core in the future - // without breaking ExtJS. + + - // workaround for jQuery + if(el.addEventListener && ename == "mousewheel"){ var args = ["DOMMouseScroll", wrap, false]; el.addEventListener.apply(el, args); @@ -2728,17 +1981,14 @@ Ext.EventManager = function(){ }); } - // fix stopped mousedowns on the document + if(el == DOC && ename == "mousedown"){ Ext.EventManager.stoppedMouseDownEvent.addListener(wrap); } }; function doScrollChk(){ - /* Notes: - 'doScroll' will NOT work in a IFRAME/FRAMESET. - The method succeeds but, a DOM query done immediately after -- FAILS. - */ + if(window != top){ return false; } @@ -2752,10 +2002,7 @@ Ext.EventManager = function(){ fireDocReady(); return true; } - /** - * @return {Boolean} True if the document is in a 'complete' state (or was determined to - * be true by other means). If false, the state is evaluated again until canceled. - */ + function checkReadyState(e){ if(Ext.isIE && doScrollChk()){ @@ -2787,7 +2034,7 @@ Ext.EventManager = function(){ function fireDocReady(e){ if(!docReadyState){ - docReadyState = true; //only attempt listener removal once + docReadyState = true; if(docReadyProcId){ clearTimeout(docReadyProcId); @@ -2795,7 +2042,7 @@ Ext.EventManager = function(){ if(DETECT_NATIVE) { DOC.removeEventListener(DOMCONTENTLOADED, fireDocReady, false); } - if(Ext.isIE && checkReadyState.bindIE){ //was this was actually set ?? + if(Ext.isIE && checkReadyState.bindIE){ DOC.detachEvent('onreadystatechange', checkReadyState); } E.un(WINDOW, "load", arguments.callee); @@ -2813,32 +2060,27 @@ Ext.EventManager = function(){ if (DETECT_NATIVE) { DOC.addEventListener(DOMCONTENTLOADED, fireDocReady, false); } - /* - * Handle additional (exceptional) detection strategies here - */ + if (Ext.isIE){ - //Use readystatechange as a backup AND primary detection mechanism for a FRAME/IFRAME - //See if page is already loaded + + if(!checkReadyState()){ checkReadyState.bindIE = true; DOC.attachEvent('onreadystatechange', checkReadyState); } }else if(Ext.isOpera ){ - /* Notes: - Opera needs special treatment needed here because CSS rules are NOT QUITE - available after DOMContentLoaded is raised. - */ + - //See if page is already loaded and all styleSheets are in place + (DOC.readyState == COMPLETE && checkStyleSheets()) || DOC.addEventListener(DOMCONTENTLOADED, OperaDOMContentLoaded, false); }else if (Ext.isWebKit){ - //Fallback for older Webkits without DOMCONTENTLOADED support + checkReadyState(); } - // no matter what, make sure it fires on load + E.on(WINDOW, "load", fireDocReady); }; @@ -2853,7 +2095,7 @@ Ext.EventManager = function(){ function createBuffered(h, o, task){ return function(e){ - // create new event object impl so new events don't wipe out properties + task.delay(o.buffer, h, null, [new Ext.EventObjectImpl(e)]); }; }; @@ -2877,7 +2119,7 @@ Ext.EventManager = function(){ }; function listen(element, ename, opt, fn, scope){ - var o = !Ext.isObject(opt) ? {} : opt, + var o = (!opt || typeof opt == "boolean") ? {} : opt, el = Ext.getDom(element), task; fn = fn || o.fn; @@ -2887,8 +2129,8 @@ Ext.EventManager = function(){ throw "Error listening for \"" + ename + '\". Element "' + element + '" doesn\'t exist.'; } function h(e){ - // prevent errors while unload occurring - if(!Ext){// !window[xname]){ ==> can't we do this? + + if(!Ext){ return; } e = Ext.EventObject.setEvent(e); @@ -2934,47 +2176,18 @@ Ext.EventManager = function(){ }; var pub = { - /** - * Appends an event handler to an element. The shorthand version {@link #on} is equivalent. Typically you will - * use {@link Ext.Element#addListener} directly on an Element in favor of calling this version. - * @param {String/HTMLElement} el The html element or id to assign the event handler to. - * @param {String} eventName The name of the event to listen for. - * @param {Function} handler The handler function the event invokes. This function is passed - * the following parameters:
        - *
      • evt : EventObject
        The {@link Ext.EventObject EventObject} describing the event.
      • - *
      • t : Element
        The {@link Ext.Element Element} which was the target of the event. - * Note that this may be filtered by using the delegate option.
      • - *
      • o : Object
        The options object from the addListener call.
      • - *
      - * @param {Object} scope (optional) The scope (this reference) in which the handler function is executed. Defaults to the Element. - * @param {Object} options (optional) An object containing handler configuration properties. - * This may contain any of the following properties:
        - *
      • scope : Object
        The scope (this reference) in which the handler function is executed. Defaults to the Element.
      • - *
      • delegate : String
        A simple selector to filter the target or look for a descendant of the target
      • - *
      • stopEvent : Boolean
        True to stop the event. That is stop propagation, and prevent the default action.
      • - *
      • preventDefault : Boolean
        True to prevent the default action
      • - *
      • stopPropagation : Boolean
        True to prevent event propagation
      • - *
      • normalized : Boolean
        False to pass a browser event to the handler function instead of an Ext.EventObject
      • - *
      • delay : Number
        The number of milliseconds to delay the invocation of the handler after te event fires.
      • - *
      • single : Boolean
        True to add a handler to handle just the next firing of the event, and then remove itself.
      • - *
      • buffer : Number
        Causes the handler to be scheduled to run in an {@link Ext.util.DelayedTask} delayed - * by the specified number of milliseconds. If the event fires again within that time, the original - * handler is not invoked, but the new handler is scheduled in its place.
      • - *
      • target : Element
        Only call the handler if the event was fired on the target Element, not if the event was bubbled up from a child node.
      • - *

      - *

      See {@link Ext.Element#addListener} for examples of how to use these options.

      - */ + addListener : function(element, eventName, fn, scope, options){ - if(Ext.isObject(eventName)){ + if(typeof eventName == 'object'){ var o = eventName, e, val; for(e in o){ val = o[e]; if(!propRe.test(e)){ if(Ext.isFunction(val)){ - // shared options + listen(element, e, o, val, o.scope); }else{ - // individual options + listen(element, e, val); } } @@ -2984,15 +2197,7 @@ Ext.EventManager = function(){ } }, - /** - * Removes an event handler from an element. The shorthand version {@link #un} is equivalent. Typically - * you will use {@link Ext.Element#removeListener} directly on an Element in favor of calling this version. - * @param {String/HTMLElement} el The id or html element from which to remove the listener. - * @param {String} eventName The name of the event. - * @param {Function} fn The handler function to remove. This must be a reference to the function passed into the {@link #addListener} call. - * @param {Object} scope If a scope (this reference) was specified when the listener was added, - * then this must refer to the same object. - */ + removeListener : function(el, eventName, fn, scope){ el = Ext.getDom(el); var id = getId(el), @@ -3001,12 +2206,7 @@ Ext.EventManager = function(){ for (i = 0, len = f.length; i < len; i++) { - /* 0 = Original Function, - 1 = Event Manager Wrapped Function, - 2 = Scope, - 3 = Adapter Wrapped Function, - 4 = Buffered Task - */ + if (Ext.isArray(fnc = f[i]) && fnc[0] == fn && (!scope || fnc[2] == scope)) { if(fnc[4]) { fnc[4].cancel(); @@ -3021,12 +2221,12 @@ Ext.EventManager = function(){ wrap = fnc[1]; E.un(el, eventName, E.extAdapter ? fnc[3] : wrap); - // jQuery workaround that should be removed from Ext Core + if(wrap && el.addEventListener && eventName == "mousewheel"){ el.removeEventListener("DOMMouseScroll", wrap, false); } - // fix stopped mousedowns on the document + if(wrap && el == DOC && eventName == "mousedown"){ Ext.EventManager.stoppedMouseDownEvent.removeListener(wrap); } @@ -3044,11 +2244,7 @@ Ext.EventManager = function(){ } }, - /** - * Removes all event handers from an element. Typically you will use {@link Ext.Element#removeAllListeners} - * directly on an Element in favor of calling this version. - * @param {String/HTMLElement} el The id or html element from which to remove all event handlers. - */ + removeAll : function(el){ el = Ext.getDom(el); var id = getId(el), @@ -3059,12 +2255,7 @@ Ext.EventManager = function(){ for(ename in es){ if(es.hasOwnProperty(ename)){ f = es[ename]; - /* 0 = Original Function, - 1 = Event Manager Wrapped Function, - 2 = Scope, - 3 = Adapter Wrapped Function, - 4 = Buffered Task - */ + for (i = 0, len = f.length; i < len; i++) { fn = f[i]; if(fn[4]) { @@ -3079,12 +2270,12 @@ Ext.EventManager = function(){ wrap = fn[1]; E.un(el, ename, E.extAdapter ? fn[3] : wrap); - // jQuery workaround that should be removed from Ext Core + if(el.addEventListener && wrap && ename == "mousewheel"){ el.removeEventListener("DOMMouseScroll", wrap, false); } - // fix stopped mousedowns on the document + if(wrap && el == DOC && ename == "mousedown"){ Ext.EventManager.stoppedMouseDownEvent.removeListener(wrap); } @@ -3140,12 +2331,12 @@ Ext.EventManager = function(){ delete Ext.elCache; delete Ext.Element._flyweights; - // Abort any outstanding Ajax requests + var c, conn, tid, ajax = Ext.lib.Ajax; - (Ext.isObject(ajax.conn)) ? conn = ajax.conn : conn = {}; + (typeof ajax.conn == 'object') ? conn = ajax.conn : conn = {}; for (tid in conn) { c = conn[tid]; if (c) { @@ -3153,16 +2344,9 @@ Ext.EventManager = function(){ } } }, - /** - * Adds a listener to be notified when the document is ready (before onload and before images are loaded). Can be - * accessed shorthanded as Ext.onReady(). - * @param {Function} fn The method the event invokes. - * @param {Object} scope (optional) The scope (this reference) in which the handler function executes. Defaults to the browser window. - * @param {boolean} options (optional) Options object as passed to {@link Ext.Element#addListener}. It is recommended that the options - * {single: true} be used so that the handler is removed on first invocation. - */ + onDocumentReady : function(fn, scope, options){ - if(Ext.isReady){ // if it already fired or document.body is present + if(Ext.isReady){ docReadyEvent || (docReadyEvent = new Ext.util.Event()); docReadyEvent.addListener(fn, scope, options); docReadyEvent.fire(); @@ -3177,56 +2361,26 @@ Ext.EventManager = function(){ } }, - /** - * Forces a document ready state transition for the framework. Used when Ext is loaded - * into a DOM structure AFTER initial page load (Google API or other dynamic load scenario. - * Any pending 'onDocumentReady' handlers will be fired (if not already handled). - */ + fireDocReady : fireDocReady }; - /** - * Appends an event handler to an element. Shorthand for {@link #addListener}. - * @param {String/HTMLElement} el The html element or id to assign the event handler to - * @param {String} eventName The name of the event to listen for. - * @param {Function} handler The handler function the event invokes. - * @param {Object} scope (optional) (this reference) in which the handler function executes. Defaults to the Element. - * @param {Object} options (optional) An object containing standard {@link #addListener} options - * @member Ext.EventManager - * @method on - */ + pub.on = pub.addListener; - /** - * Removes an event handler from an element. Shorthand for {@link #removeListener}. - * @param {String/HTMLElement} el The id or html element from which to remove the listener. - * @param {String} eventName The name of the event. - * @param {Function} fn The handler function to remove. This must be a reference to the function passed into the {@link #on} call. - * @param {Object} scope If a scope (this reference) was specified when the listener was added, - * then this must refer to the same object. - * @member Ext.EventManager - * @method un - */ + pub.un = pub.removeListener; pub.stoppedMouseDownEvent = new Ext.util.Event(); return pub; }(); -/** - * Adds a listener to be notified when the document is ready (before onload and before images are loaded). Shorthand of {@link Ext.EventManager#onDocumentReady}. - * @param {Function} fn The method the event invokes. - * @param {Object} scope (optional) The scope (this reference) in which the handler function executes. Defaults to the browser window. - * @param {boolean} options (optional) Options object as passed to {@link Ext.Element#addListener}. It is recommended that the options - * {single: true} be used so that the handler is removed on first invocation. - * @member Ext - * @method onReady - */ + Ext.onReady = Ext.EventManager.onDocumentReady; -//Initialize doc classes + (function(){ var initExtCss = function(){ - // find the body element + var bd = document.body || document.getElementsByTagName('body')[0]; if(!bd){ return false; } var cls = [' ', @@ -3248,7 +2402,7 @@ Ext.onReady = Ext.EventManager.onDocumentReady; cls.push("ext-linux"); } - if(Ext.isStrict || Ext.isBorderBox){ // add to the parent to allow for selectors like ".ext-strict .ext-ie" + if(Ext.isStrict || Ext.isBorderBox){ var p = bd.parentNode; if(p){ p.className += Ext.isStrict ? ' ext-strict' : ' ext-border-box'; @@ -3264,46 +2418,23 @@ Ext.onReady = Ext.EventManager.onDocumentReady; })(); -/** - * @class Ext.EventObject - * Just as {@link Ext.Element} wraps around a native DOM node, Ext.EventObject - * wraps the browser's native event-object normalizing cross-browser differences, - * such as which mouse button is clicked, keys pressed, mechanisms to stop - * event-propagation along with a method to prevent default actions from taking place. - *

      For example:

      - *
      
      -function handleClick(e, t){ // e is not a standard event object, it is a Ext.EventObject
      -    e.preventDefault();
      -    var target = e.getTarget(); // same as t (the target HTMLElement)
      -    ...
      -}
      -var myDiv = {@link Ext#get Ext.get}("myDiv");  // get reference to an {@link Ext.Element}
      -myDiv.on(         // 'on' is shorthand for addListener
      -    "click",      // perform an action on click of myDiv
      -    handleClick   // reference to the action handler
      -);
      -// other methods to do the same:
      -Ext.EventManager.on("myDiv", 'click', handleClick);
      -Ext.EventManager.addListener("myDiv", 'click', handleClick);
      - 
      - * @singleton - */ + Ext.EventObject = function(){ var E = Ext.lib.Event, - // safari keypress events for special keys return bad keycodes + safariKeys = { - 3 : 13, // enter - 63234 : 37, // left - 63235 : 39, // right - 63232 : 38, // up - 63233 : 40, // down - 63276 : 33, // page up - 63277 : 34, // page down - 63272 : 46, // delete - 63273 : 36, // home - 63275 : 35 // end + 3 : 13, + 63234 : 37, + 63235 : 39, + 63232 : 38, + 63233 : 40, + 63276 : 33, + 63277 : 34, + 63272 : 46, + 63273 : 36, + 63275 : 35 }, - // normalize button clicks + btnMap = Ext.isIE ? {1:0,4:1,2:2} : (Ext.isWebKit ? {1:0,2:1,3:2} : {0:0,1:1,2:2}); @@ -3314,30 +2445,30 @@ Ext.EventObject = function(){ }; Ext.EventObjectImpl.prototype = { - /** @private */ + setEvent : function(e){ var me = this; - if(e == me || (e && e.browserEvent)){ // already wrapped + if(e == me || (e && e.browserEvent)){ return e; } me.browserEvent = e; if(e){ - // normalize buttons + me.button = e.button ? btnMap[e.button] : (e.which ? e.which - 1 : -1); if(e.type == 'click' && me.button == -1){ me.button = 0; } me.type = e.type; me.shiftKey = e.shiftKey; - // mac metaKey behaves like ctrlKey + me.ctrlKey = e.ctrlKey || e.metaKey || false; me.altKey = e.altKey; - // in getKey these will be normalized for the mac + me.keyCode = e.keyCode; me.charCode = e.charCode; - // cache the target for the delayed and or buffered events + me.target = E.getTarget(e); - // same for XY + me.xy = E.getXY(e); }else{ me.button = -1; @@ -3352,9 +2483,7 @@ Ext.EventObject = function(){ return me; }, - /** - * Stop the event (preventDefault and stopPropagation) - */ + stopEvent : function(){ var me = this; if(me.browserEvent){ @@ -3365,18 +2494,14 @@ Ext.EventObject = function(){ } }, - /** - * Prevents the browsers default handling of the event. - */ + preventDefault : function(){ if(this.browserEvent){ E.preventDefault(this.browserEvent); } }, - /** - * Cancels bubbling of the event. - */ + stopPropagation : function(){ var me = this; if(me.browserEvent){ @@ -3387,108 +2512,59 @@ Ext.EventObject = function(){ } }, - /** - * Gets the character code for the event. - * @return {Number} - */ + getCharCode : function(){ return this.charCode || this.keyCode; }, - /** - * Returns a normalized keyCode for the event. - * @return {Number} The key code - */ + getKey : function(){ return this.normalizeKey(this.keyCode || this.charCode) }, - // private + normalizeKey: function(k){ return Ext.isSafari ? (safariKeys[k] || k) : k; }, - /** - * Gets the x coordinate of the event. - * @return {Number} - */ + getPageX : function(){ return this.xy[0]; }, - /** - * Gets the y coordinate of the event. - * @return {Number} - */ + getPageY : function(){ return this.xy[1]; }, - /** - * Gets the page coordinates of the event. - * @return {Array} The xy values like [x, y] - */ + getXY : function(){ return this.xy; }, - /** - * Gets the target for the event. - * @param {String} selector (optional) A simple selector to filter the target or look for an ancestor of the target - * @param {Number/Mixed} maxDepth (optional) The max depth to - search as a number or element (defaults to 10 || document.body) - * @param {Boolean} returnEl (optional) True to return a Ext.Element object instead of DOM node - * @return {HTMLelement} - */ + getTarget : function(selector, maxDepth, returnEl){ return selector ? Ext.fly(this.target).findParent(selector, maxDepth, returnEl) : (returnEl ? Ext.get(this.target) : this.target); }, - /** - * Gets the related target. - * @return {HTMLElement} - */ + getRelatedTarget : function(){ return this.browserEvent ? E.getRelatedTarget(this.browserEvent) : null; }, - /** - * Normalizes mouse wheel delta across browsers - * @return {Number} The delta - */ + getWheelDelta : function(){ var e = this.browserEvent; var delta = 0; - if(e.wheelDelta){ /* IE/Opera. */ + if(e.wheelDelta){ delta = e.wheelDelta/120; - }else if(e.detail){ /* Mozilla case. */ + }else if(e.detail){ delta = -e.detail/3; } return delta; }, - /** - * Returns true if the target of this event is a child of el. Unless the allowEl parameter is set, it will return false if if the target is el. - * Example usage:
      
      -        // Handle click on any child of an element
      -        Ext.getBody().on('click', function(e){
      -            if(e.within('some-el')){
      -                alert('Clicked on a child of some-el!');
      -            }
      -        });
      -
      -        // Handle click directly on an element, ignoring clicks on child nodes
      -        Ext.getBody().on('click', function(e,t){
      -            if((t.id == 'some-el') && !e.within(t, true)){
      -                alert('Clicked directly on some-el!');
      -            }
      -        });
      -        
      - * @param {Mixed} el The id, DOM element or Ext.Element to check - * @param {Boolean} related (optional) true to test if the related target is within el instead of the target - * @param {Boolean} allowEl {optional} true to also check if the passed element is the target or related target - * @return {Boolean} - */ + within : function(el, related, allowEl){ if(el){ var t = this[related ? "getRelatedTarget" : "getTarget"](); @@ -3500,9 +2576,7 @@ Ext.EventObject = function(){ return new Ext.EventObjectImpl(); }(); -/** -* @class Ext.EventManager -*/ + Ext.apply(Ext.EventManager, function(){ var resizeEvent, resizeTask, @@ -3512,32 +2586,26 @@ Ext.apply(Ext.EventManager, function(){ propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/, curWidth = 0, curHeight = 0, - // note 1: IE fires ONLY the keydown event on specialkey autorepeat - // note 2: Safari < 3.1, Gecko (Mac/Linux) & Opera fire only the keypress event on specialkey autorepeat - // (research done by @Jan Wolter at http://unixpapa.com/js/key.html) + + + useKeydown = Ext.isWebKit ? Ext.num(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1]) >= 525 : !((Ext.isGecko && !Ext.isWindows) || Ext.isOpera); return { - // private + doResizeEvent: function(){ var h = D.getViewHeight(), w = D.getViewWidth(); - //whacky problem in IE where the resize event will fire even though the w/h are the same. + if(curHeight != h || curWidth != w){ resizeEvent.fire(curWidth = w, curHeight = h); } }, - /** - * Adds a listener to be notified when the browser window is resized and provides resize event buffering (100 milliseconds), - * passes new viewport width and height to handlers. - * @param {Function} fn The handler function the window resize event invokes. - * @param {Object} scope The scope (this reference) in which the handler function executes. Defaults to the browser window. - * @param {boolean} options Options object as passed to {@link Ext.Element#addListener} - */ + onWindowResize : function(fn, scope, options){ if(!resizeEvent){ resizeEvent = new Ext.util.Event(); @@ -3547,19 +2615,14 @@ Ext.apply(Ext.EventManager, function(){ resizeEvent.addListener(fn, scope, options); }, - // exposed only to allow manual firing + fireWindowResize : function(){ if(resizeEvent){ resizeTask.delay(100); } }, - /** - * Adds a listener to be notified when the user changes the active text size. Handler gets called with 2 params, the old size and the new size. - * @param {Function} fn The function the event invokes. - * @param {Object} scope The scope (this reference) in which the handler function executes. Defaults to the browser window. - * @param {boolean} options Options object as passed to {@link Ext.Element#addListener} - */ + onTextResize : function(fn, scope, options){ if(!textEvent){ textEvent = new Ext.util.Event(); @@ -3577,36 +2640,28 @@ Ext.apply(Ext.EventManager, function(){ textEvent.addListener(fn, scope, options); }, - /** - * Removes the passed window resize listener. - * @param {Function} fn The method the event invokes - * @param {Object} scope The scope of handler - */ + removeResizeListener : function(fn, scope){ if(resizeEvent){ resizeEvent.removeListener(fn, scope); } }, - // private + fireResize : function(){ if(resizeEvent){ resizeEvent.fire(D.getViewWidth(), D.getViewHeight()); } }, - /** - * The frequency, in milliseconds, to check for text resize events (defaults to 50) - */ + textResizeInterval : 50, - /** - * Url used for onDocumentReady with using SSL (defaults to Ext.SSL_SECURE_URL) - */ + ieDeferSrc : false, - // protected for use inside the framework - // detects whether we should use keydown or keypress based on the browser. + + useKeydown: useKeydown }; }()); @@ -3615,189 +2670,189 @@ Ext.EventManager.on = Ext.EventManager.addListener; Ext.apply(Ext.EventObjectImpl.prototype, { - /** Key constant @type Number */ + BACKSPACE: 8, - /** Key constant @type Number */ + TAB: 9, - /** Key constant @type Number */ + NUM_CENTER: 12, - /** Key constant @type Number */ + ENTER: 13, - /** Key constant @type Number */ + RETURN: 13, - /** Key constant @type Number */ + SHIFT: 16, - /** Key constant @type Number */ + CTRL: 17, - CONTROL : 17, // legacy - /** Key constant @type Number */ + CONTROL : 17, + ALT: 18, - /** Key constant @type Number */ + PAUSE: 19, - /** Key constant @type Number */ + CAPS_LOCK: 20, - /** Key constant @type Number */ + ESC: 27, - /** Key constant @type Number */ + SPACE: 32, - /** Key constant @type Number */ + PAGE_UP: 33, - PAGEUP : 33, // legacy - /** Key constant @type Number */ + PAGEUP : 33, + PAGE_DOWN: 34, - PAGEDOWN : 34, // legacy - /** Key constant @type Number */ + PAGEDOWN : 34, + END: 35, - /** Key constant @type Number */ + HOME: 36, - /** Key constant @type Number */ + LEFT: 37, - /** Key constant @type Number */ + UP: 38, - /** Key constant @type Number */ + RIGHT: 39, - /** Key constant @type Number */ + DOWN: 40, - /** Key constant @type Number */ + PRINT_SCREEN: 44, - /** Key constant @type Number */ + INSERT: 45, - /** Key constant @type Number */ + DELETE: 46, - /** Key constant @type Number */ + ZERO: 48, - /** Key constant @type Number */ + ONE: 49, - /** Key constant @type Number */ + TWO: 50, - /** Key constant @type Number */ + THREE: 51, - /** Key constant @type Number */ + FOUR: 52, - /** Key constant @type Number */ + FIVE: 53, - /** Key constant @type Number */ + SIX: 54, - /** Key constant @type Number */ + SEVEN: 55, - /** Key constant @type Number */ + EIGHT: 56, - /** Key constant @type Number */ + NINE: 57, - /** Key constant @type Number */ + A: 65, - /** Key constant @type Number */ + B: 66, - /** Key constant @type Number */ + C: 67, - /** Key constant @type Number */ + D: 68, - /** Key constant @type Number */ + E: 69, - /** Key constant @type Number */ + F: 70, - /** Key constant @type Number */ + G: 71, - /** Key constant @type Number */ + H: 72, - /** Key constant @type Number */ + I: 73, - /** Key constant @type Number */ + J: 74, - /** Key constant @type Number */ + K: 75, - /** Key constant @type Number */ + L: 76, - /** Key constant @type Number */ + M: 77, - /** Key constant @type Number */ + N: 78, - /** Key constant @type Number */ + O: 79, - /** Key constant @type Number */ + P: 80, - /** Key constant @type Number */ + Q: 81, - /** Key constant @type Number */ + R: 82, - /** Key constant @type Number */ + S: 83, - /** Key constant @type Number */ + T: 84, - /** Key constant @type Number */ + U: 85, - /** Key constant @type Number */ + V: 86, - /** Key constant @type Number */ + W: 87, - /** Key constant @type Number */ + X: 88, - /** Key constant @type Number */ + Y: 89, - /** Key constant @type Number */ + Z: 90, - /** Key constant @type Number */ + CONTEXT_MENU: 93, - /** Key constant @type Number */ + NUM_ZERO: 96, - /** Key constant @type Number */ + NUM_ONE: 97, - /** Key constant @type Number */ + NUM_TWO: 98, - /** Key constant @type Number */ + NUM_THREE: 99, - /** Key constant @type Number */ + NUM_FOUR: 100, - /** Key constant @type Number */ + NUM_FIVE: 101, - /** Key constant @type Number */ + NUM_SIX: 102, - /** Key constant @type Number */ + NUM_SEVEN: 103, - /** Key constant @type Number */ + NUM_EIGHT: 104, - /** Key constant @type Number */ + NUM_NINE: 105, - /** Key constant @type Number */ + NUM_MULTIPLY: 106, - /** Key constant @type Number */ + NUM_PLUS: 107, - /** Key constant @type Number */ + NUM_MINUS: 109, - /** Key constant @type Number */ + NUM_PERIOD: 110, - /** Key constant @type Number */ + NUM_DIVISION: 111, - /** Key constant @type Number */ + F1: 112, - /** Key constant @type Number */ + F2: 113, - /** Key constant @type Number */ + F3: 114, - /** Key constant @type Number */ + F4: 115, - /** Key constant @type Number */ + F5: 116, - /** Key constant @type Number */ + F6: 117, - /** Key constant @type Number */ + F7: 118, - /** Key constant @type Number */ + F8: 119, - /** Key constant @type Number */ + F9: 120, - /** Key constant @type Number */ + F10: 121, - /** Key constant @type Number */ + F11: 122, - /** Key constant @type Number */ + F12: 123, - /** @private */ + isNavKeyPress : function(){ var me = this, k = this.normalizeKey(me.keyCode); - return (k >= 33 && k <= 40) || // Page Up/Down, End, Home, Left, Up, Right, Down + return (k >= 33 && k <= 40) || k == me.RETURN || k == me.TAB || k == me.ESC; @@ -3807,91 +2862,20 @@ Ext.apply(Ext.EventObjectImpl.prototype, { var k = this.normalizeKey(this.keyCode); return (this.type == 'keypress' && this.ctrlKey) || this.isNavKeyPress() || - (k == this.BACKSPACE) || // Backspace - (k >= 16 && k <= 20) || // Shift, Ctrl, Alt, Pause, Caps Lock - (k >= 44 && k <= 46); // Print Screen, Insert, Delete + (k == this.BACKSPACE) || + (k >= 16 && k <= 20) || + (k >= 44 && k <= 46); }, getPoint : function(){ return new Ext.lib.Point(this.xy[0], this.xy[1]); }, - /** - * Returns true if the control, meta, shift or alt key was pressed during this event. - * @return {Boolean} - */ + hasModifier : function(){ return ((this.ctrlKey || this.altKey) || this.shiftKey); } -});/** - * @class Ext.Element - *

      Encapsulates a DOM element, adding simple DOM manipulation facilities, normalizing for browser differences.

      - *

      All instances of this class inherit the methods of {@link Ext.Fx} making visual effects easily available to all DOM elements.

      - *

      Note that the events documented in this class are not Ext events, they encapsulate browser events. To - * access the underlying browser event, see {@link Ext.EventObject#browserEvent}. Some older - * browsers may not support the full range of events. Which events are supported is beyond the control of ExtJs.

      - * Usage:
      -
      
      -// by id
      -var el = Ext.get("my-div");
      -
      -// by DOM element reference
      -var el = Ext.get(myDivElement);
      -
      - * Animations
      - *

      When an element is manipulated, by default there is no animation.

      - *
      
      -var el = Ext.get("my-div");
      -
      -// no animation
      -el.setWidth(100);
      - * 
      - *

      Many of the functions for manipulating an element have an optional "animate" parameter. This - * parameter can be specified as boolean (true) for default animation effects.

      - *
      
      -// default animation
      -el.setWidth(100, true);
      - * 
      - * - *

      To configure the effects, an object literal with animation options to use as the Element animation - * configuration object can also be specified. Note that the supported Element animation configuration - * options are a subset of the {@link Ext.Fx} animation options specific to Fx effects. The supported - * Element animation configuration options are:

      -
      -Option    Default   Description
      ---------- --------  ---------------------------------------------
      -{@link Ext.Fx#duration duration}  .35       The duration of the animation in seconds
      -{@link Ext.Fx#easing easing}    easeOut   The easing method
      -{@link Ext.Fx#callback callback}  none      A function to execute when the anim completes
      -{@link Ext.Fx#scope scope}     this      The scope (this) of the callback function
      -
      - * - *
      
      -// Element animation options object
      -var opt = {
      -    {@link Ext.Fx#duration duration}: 1,
      -    {@link Ext.Fx#easing easing}: 'elasticIn',
      -    {@link Ext.Fx#callback callback}: this.foo,
      -    {@link Ext.Fx#scope scope}: this
      -};
      -// animation with some options set
      -el.setWidth(100, opt);
      - * 
      - *

      The Element animation object being used for the animation will be set on the options - * object as "anim", which allows you to stop or manipulate the animation. Here is an example:

      - *
      
      -// using the "anim" property to get the Anim object
      -if(opt.anim.isAnimated()){
      -    opt.anim.stop();
      -}
      - * 
      - *

      Also see the {@link #animate} method for another animation technique.

      - *

      Composite (Collections of) Elements

      - *

      For working with collections of Elements, see {@link Ext.CompositeElement}

      - * @constructor Create a new Element directly. - * @param {String/HTMLElement} element - * @param {Boolean} forceNew (optional) By default the constructor checks to see if there is already an instance of this element in the cache and if there is it returns the same instance. This will skip that check (useful for extending this class). - */ +}); (function(){ var DOC = document; @@ -3904,20 +2888,14 @@ Ext.Element = function(element, forceNew){ id = dom.id; - if(!forceNew && id && Ext.elCache[id]){ // element object already exists + if(!forceNew && id && Ext.elCache[id]){ return Ext.elCache[id].el; } - /** - * The DOM element - * @type HTMLElement - */ + this.dom = dom; - /** - * The DOM element ID - * @type String - */ + this.id = id || Ext.id(dom); }; @@ -3929,12 +2907,7 @@ var D = Ext.lib.Dom, EC = Ext.elCache; El.prototype = { - /** - * Sets the passed attributes as attributes of this element (a style attribute can be a string, object or function) - * @param {Object} o The object with the attributes - * @param {Boolean} useSet (optional) false to override the default setAttribute to use expandos. - * @return {Ext.Element} this - */ + set : function(o, useSet){ var el = this.dom, attr, @@ -3958,285 +2931,64 @@ El.prototype = { return this; }, -// Mouse events - /** - * @event click - * Fires when a mouse click is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event contextmenu - * Fires when a right click is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event dblclick - * Fires when a mouse double click is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event mousedown - * Fires when a mousedown is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event mouseup - * Fires when a mouseup is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event mouseover - * Fires when a mouseover is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event mousemove - * Fires when a mousemove is detected with the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event mouseout - * Fires when a mouseout is detected with the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event mouseenter - * Fires when the mouse enters the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event mouseleave - * Fires when the mouse leaves the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ -// Keyboard events - /** - * @event keypress - * Fires when a keypress is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event keydown - * Fires when a keydown is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event keyup - * Fires when a keyup is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ + + + + + + + + + + -// HTML frame/object events - /** - * @event load - * Fires when the user agent finishes loading all content within the element. Only supported by window, frames, objects and images. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event unload - * Fires when the user agent removes all content from a window or frame. For elements, it fires when the target element or any of its content has been removed. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event abort - * Fires when an object/image is stopped from loading before completely loaded. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event error - * Fires when an object/image/frame cannot be loaded properly. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event resize - * Fires when a document view is resized. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event scroll - * Fires when a document view is scrolled. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ + + + -// Form events - /** - * @event select - * Fires when a user selects some text in a text field, including input and textarea. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event change - * Fires when a control loses the input focus and its value has been modified since gaining focus. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event submit - * Fires when a form is submitted. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event reset - * Fires when a form is reset. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event focus - * Fires when an element receives focus either via the pointing device or by tab navigation. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event blur - * Fires when an element loses focus either via the pointing device or by tabbing navigation. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ -// User Interface events - /** - * @event DOMFocusIn - * Where supported. Similar to HTML focus event, but can be applied to any focusable element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event DOMFocusOut - * Where supported. Similar to HTML blur event, but can be applied to any focusable element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event DOMActivate - * Where supported. Fires when an element is activated, for instance, through a mouse click or a keypress. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ -// DOM Mutation events - /** - * @event DOMSubtreeModified - * Where supported. Fires when the subtree is modified. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event DOMNodeInserted - * Where supported. Fires when a node has been added as a child of another node. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event DOMNodeRemoved - * Where supported. Fires when a descendant node of the element is removed. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event DOMNodeRemovedFromDocument - * Where supported. Fires when a node is being removed from a document. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event DOMNodeInsertedIntoDocument - * Where supported. Fires when a node is being inserted into a document. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event DOMAttrModified - * Where supported. Fires when an attribute has been modified. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event DOMCharacterDataModified - * Where supported. Fires when the character data has been modified. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ + + + + + + - /** - * The default unit to append to CSS values where a unit isn't provided (defaults to px). - * @type String - */ + + + + + + + + + + + + + + + + + + + + + + + defaultUnit : "px", - /** - * Returns true if this element matches the passed simple selector (e.g. div.some-class or span:first-child) - * @param {String} selector The simple selector to test - * @return {Boolean} True if this element matches the selector, else false - */ + is : function(simpleSelector){ return Ext.DomQuery.is(this.dom, simpleSelector); }, - /** - * Tries to focus the element. Any exceptions are caught and ignored. - * @param {Number} defer (optional) Milliseconds to defer the focus - * @return {Ext.Element} this - */ - focus : function(defer, /* private */ dom) { + + focus : function(defer, dom) { var me = this, dom = dom || me.dom; try{ @@ -4249,10 +3001,7 @@ El.prototype = { return me; }, - /** - * Tries to blur the element. Any exceptions are caught and ignored. - * @return {Ext.Element} this - */ + blur : function() { try{ this.dom.blur(); @@ -4260,167 +3009,36 @@ El.prototype = { return this; }, - /** - * Returns the value of the "value" attribute - * @param {Boolean} asNumber true to parse the value as a number - * @return {String/Number} - */ + getValue : function(asNumber){ var val = this.dom.value; return asNumber ? parseInt(val, 10) : val; }, - /** - * Appends an event handler to this element. The shorthand version {@link #on} is equivalent. - * @param {String} eventName The name of event to handle. - * @param {Function} fn The handler function the event invokes. This function is passed - * the following parameters:
        - *
      • evt : EventObject
        The {@link Ext.EventObject EventObject} describing the event.
      • - *
      • el : HtmlElement
        The DOM element which was the target of the event. - * Note that this may be filtered by using the delegate option.
      • - *
      • o : Object
        The options object from the addListener call.
      • - *
      - * @param {Object} scope (optional) The scope (this reference) in which the handler function is executed. - * If omitted, defaults to this Element.. - * @param {Object} options (optional) An object containing handler configuration properties. - * This may contain any of the following properties:
        - *
      • scope Object :
        The scope (this reference) in which the handler function is executed. - * If omitted, defaults to this Element.
      • - *
      • delegate String:
        A simple selector to filter the target or look for a descendant of the target. See below for additional details.
      • - *
      • stopEvent Boolean:
        True to stop the event. That is stop propagation, and prevent the default action.
      • - *
      • preventDefault Boolean:
        True to prevent the default action
      • - *
      • stopPropagation Boolean:
        True to prevent event propagation
      • - *
      • normalized Boolean:
        False to pass a browser event to the handler function instead of an Ext.EventObject
      • - *
      • target Ext.Element:
        Only call the handler if the event was fired on the target Element, not if the event was bubbled up from a child node.
      • - *
      • delay Number:
        The number of milliseconds to delay the invocation of the handler after the event fires.
      • - *
      • single Boolean:
        True to add a handler to handle just the next firing of the event, and then remove itself.
      • - *
      • buffer Number:
        Causes the handler to be scheduled to run in an {@link Ext.util.DelayedTask} delayed - * by the specified number of milliseconds. If the event fires again within that time, the original - * handler is not invoked, but the new handler is scheduled in its place.
      • - *

      - *

      - * Combining Options
      - * In the following examples, the shorthand form {@link #on} is used rather than the more verbose - * addListener. The two are equivalent. Using the options argument, it is possible to combine different - * types of listeners:
      - *
      - * A delayed, one-time listener that auto stops the event and adds a custom argument (forumId) to the - * options object. The options object is available as the third parameter in the handler function.

      - * Code:
      
      -el.on('click', this.onClick, this, {
      -    single: true,
      -    delay: 100,
      -    stopEvent : true,
      -    forumId: 4
      -});

      - *

      - * Attaching multiple handlers in 1 call
      - * The method also allows for a single argument to be passed which is a config object containing properties - * which specify multiple handlers.

      - *

      - * Code:

      
      -el.on({
      -    'click' : {
      -        fn: this.onClick,
      -        scope: this,
      -        delay: 100
      -    },
      -    'mouseover' : {
      -        fn: this.onMouseOver,
      -        scope: this
      -    },
      -    'mouseout' : {
      -        fn: this.onMouseOut,
      -        scope: this
      -    }
      -});
      - *

      - * Or a shorthand syntax:
      - * Code:

      -el.on({ - 'click' : this.onClick, - 'mouseover' : this.onMouseOver, - 'mouseout' : this.onMouseOut, - scope: this -}); - *

      - *

      delegate

      - *

      This is a configuration option that you can pass along when registering a handler for - * an event to assist with event delegation. Event delegation is a technique that is used to - * reduce memory consumption and prevent exposure to memory-leaks. By registering an event - * for a container element as opposed to each element within a container. By setting this - * configuration option to a simple selector, the target element will be filtered to look for - * a descendant of the target. - * For example:

      
      -// using this markup:
      -<div id='elId'>
      -    <p id='p1'>paragraph one</p>
      -    <p id='p2' class='clickable'>paragraph two</p>
      -    <p id='p3'>paragraph three</p>
      -</div>
      -// utilize event delegation to registering just one handler on the container element:
      -el = Ext.get('elId');
      -el.on(
      -    'click',
      -    function(e,t) {
      -        // handle click
      -        console.info(t.id); // 'p2'
      -    },
      -    this,
      -    {
      -        // filter the target element to be a descendant with the class 'clickable'
      -        delegate: '.clickable'
      -    }
      -);
      -     * 

      - * @return {Ext.Element} this - */ + addListener : function(eventName, fn, scope, options){ Ext.EventManager.on(this.dom, eventName, fn, scope || this, options); return this; }, - /** - * Removes an event handler from this element. The shorthand version {@link #un} is equivalent. - * Note: if a scope was explicitly specified when {@link #addListener adding} the - * listener, the same scope must be specified here. - * Example: - *
      
      -el.removeListener('click', this.handlerFn);
      -// or
      -el.un('click', this.handlerFn);
      -
      - * @param {String} eventName The name of the event from which to remove the handler. - * @param {Function} fn The handler function to remove. This must be a reference to the function passed into the {@link #addListener} call. - * @param {Object} scope If a scope (this reference) was specified when the listener was added, - * then this must refer to the same object. - * @return {Ext.Element} this - */ + removeListener : function(eventName, fn, scope){ Ext.EventManager.removeListener(this.dom, eventName, fn, scope || this); return this; }, - /** - * Removes all previous added listeners from this element - * @return {Ext.Element} this - */ + removeAllListeners : function(){ Ext.EventManager.removeAll(this.dom); return this; }, - /** - * Recursively removes all previous added listeners from this element and its children - * @return {Ext.Element} this - */ + purgeAllListeners : function() { Ext.EventManager.purgeElement(this, true); return this; }, - /** - * @private Test if size has a unit, otherwise appends the default - */ + addUnits : function(size){ if(size === "" || size == "auto" || size === undefined){ size = size || ''; @@ -4430,14 +3048,7 @@ el.un('click', this.handlerFn); return size; }, - /** - *

      Updates the innerHTML of this Element - * from a specified URL. Note that this is subject to the Same Origin Policy

      - *

      Updating innerHTML of an element will not execute embedded <script> elements. This is a browser restriction.

      - * @param {Mixed} options. Either a sring containing the URL from which to load the HTML, or an {@link Ext.Ajax#request} options object specifying - * exactly how to request the HTML. - * @return {Ext.Element} this - */ + load : function(url, params, cb){ Ext.Ajax.request(Ext.apply({ params: params, @@ -4449,17 +3060,12 @@ el.un('click', this.handlerFn); return this; }, - /** - * Tests various css rules/browsers to determine if this element uses a border box - * @return {Boolean} - */ + isBorderBox : function(){ return noBoxAdjust[(this.dom.tagName || "").toLowerCase()] || Ext.isBorderBox; }, - /** - *

      Removes this element's dom reference. Note that event and cache removal is handled at {@link Ext#removeNode}

      - */ + remove : function(){ var me = this, dom = me.dom; @@ -4470,14 +3076,7 @@ el.un('click', this.handlerFn); } }, - /** - * Sets up event handlers to call the passed functions when the mouse is moved into and out of the Element. - * @param {Function} overFn The function to call when the mouse enters the Element. - * @param {Function} outFn The function to call when the mouse leaves the Element. - * @param {Object} scope (optional) The scope (this reference) in which the functions are executed. Defaults to the Element's DOM element. - * @param {Object} options (optional) Options for the listener. See {@link Ext.util.Observable#addListener the options parameter}. - * @return {Ext.Element} this - */ + hover : function(overFn, outFn, scope, options){ var me = this; me.on('mouseenter', overFn, scope || me.dom, options); @@ -4485,32 +3084,17 @@ el.un('click', this.handlerFn); return me; }, - /** - * Returns true if this element is an ancestor of the passed element - * @param {HTMLElement/String} el The element to check - * @return {Boolean} True if this element is an ancestor of el, else false - */ + contains : function(el){ return !el ? false : Ext.lib.Dom.isAncestor(this.dom, el.dom ? el.dom : el); }, - /** - * Returns the value of a namespaced attribute from the element's underlying DOM node. - * @param {String} namespace The namespace in which to look for the attribute - * @param {String} name The attribute name - * @return {String} The attribute value - * @deprecated - */ + getAttributeNS : function(ns, name){ return this.getAttribute(name, ns); }, - /** - * Returns the value of an attribute from the element's underlying DOM node. - * @param {String} name The attribute name - * @param {String} namespace (optional) The namespace in which to look for the attribute - * @return {String} The attribute value - */ + getAttribute : Ext.isIE ? function(name, ns){ var d = this.dom, type = typeof d[ns + ":" + name]; @@ -4524,11 +3108,7 @@ el.un('click', this.handlerFn); return d.getAttributeNS(ns, name) || d.getAttribute(ns + ":" + name) || d.getAttribute(name) || d[name]; }, - /** - * Update the innerHTML of this element - * @param {String} html The new HTML - * @return {Ext.Element} this - */ + update : function(html) { if (this.dom) { this.dom.innerHTML = html; @@ -4543,61 +3123,28 @@ El.addMethods = function(o){ Ext.apply(ep, o); }; -/** - * Appends an event handler (shorthand for {@link #addListener}). - * @param {String} eventName The name of event to handle. - * @param {Function} fn The handler function the event invokes. - * @param {Object} scope (optional) The scope (this reference) in which the handler function is executed. - * @param {Object} options (optional) An object containing standard {@link #addListener} options - * @member Ext.Element - * @method on - */ + ep.on = ep.addListener; -/** - * Removes an event handler from this element (see {@link #removeListener} for additional notes). - * @param {String} eventName The name of the event from which to remove the handler. - * @param {Function} fn The handler function to remove. This must be a reference to the function passed into the {@link #addListener} call. - * @param {Object} scope If a scope (this reference) was specified when the listener was added, - * then this must refer to the same object. - * @return {Ext.Element} this - * @member Ext.Element - * @method un - */ + ep.un = ep.removeListener; -/** - * true to automatically adjust width and height settings for box-model issues (default to true) - */ + ep.autoBoxAdjust = true; -// private + var unitPattern = /\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i, docEl; -/** - * @private - */ -/** - * Retrieves Ext.Element objects. - *

      This method does not retrieve {@link Ext.Component Component}s. This method - * retrieves Ext.Element objects which encapsulate DOM elements. To retrieve a Component by - * its ID, use {@link Ext.ComponentMgr#get}.

      - *

      Uses simple caching to consistently return the same object. Automatically fixes if an - * object was recreated with the same id via AJAX or DOM.

      - * @param {Mixed} el The id of the node, a DOM Node or an existing Element. - * @return {Element} The Element object (or null if no matching element was found) - * @static - * @member Ext.Element - * @method get - */ + + El.get = function(el){ var ex, elm, id; if(!el){ return null; } - if (typeof el == "string") { // element id + if (typeof el == "string") { if (!(elm = DOC.getElementById(el))) { return null; } @@ -4608,7 +3155,7 @@ El.get = function(el){ ex = El.addToCache(new El(elm)); } return ex; - } else if (el.tagName) { // dom element + } else if (el.tagName) { if(!(id = el.id)){ id = Ext.id(el); } @@ -4621,10 +3168,10 @@ El.get = function(el){ return ex; } else if (el instanceof El) { if(el != docEl){ - // refresh dom element in case no longer valid, - // catch case where it hasn't been appended + + - // If an el instance is passed, don't pass to getElementById without some kind of id + if (Ext.isIE && (el.id == undefined || el.id == '')) { el.dom = el.dom; } else { @@ -4637,7 +3184,7 @@ El.get = function(el){ } else if(Ext.isArray(el)) { return El.select(el); } else if(el == DOC) { - // create a bogus element object representing the document object + if(!docEl){ var f = function(){}; f.prototype = El.prototype; @@ -4659,7 +3206,7 @@ El.addToCache = function(el, id){ return el; }; -// private method for getting and setting element data + El.data = function(el, key, value){ el = El.get(el); if (!el) { @@ -4673,9 +3220,9 @@ El.data = function(el, key, value){ } }; -// private -// Garbage collection - uncache elements/purge listeners on orphaned elements -// so we don't hold a reference and cause the browser to retain them + + + function garbageCollect(){ if(!Ext.enableGarbageCollector){ clearInterval(El.collectorThreadId); @@ -4692,23 +3239,23 @@ function garbageCollect(){ } el = o.el; d = el.dom; - // ------------------------------------------------------- - // Determining what is garbage: - // ------------------------------------------------------- - // !d - // dom node is null, definitely garbage - // ------------------------------------------------------- - // !d.parentNode - // no parentNode == direct orphan, definitely garbage - // ------------------------------------------------------- - // !d.offsetParent && !document.getElementById(eid) - // display none elements have no offsetParent so we will - // also try to look it up by it's id. However, check - // offsetParent first so we don't do unneeded lookups. - // This enables collection of elements that are not orphans - // directly, but somewhere up the line they have an orphan - // parent. - // ------------------------------------------------------- + + + + + + + + + + + + + + + + + if(!d || !d.parentNode || (!d.offsetParent && !DOC.getElementById(eid))){ if(Ext.enableListenerCollection){ Ext.EventManager.removeAll(d); @@ -4716,7 +3263,7 @@ function garbageCollect(){ delete EC[eid]; } } - // Cleanup IE Object leaks + if (Ext.isIE) { var t = {}; for (eid in EC) { @@ -4731,7 +3278,7 @@ El.collectorThreadId = setInterval(garbageCollect, 30000); var flyFn = function(){}; flyFn.prototype = El.prototype; -// dom is optional + El.Flyweight = function(dom){ this.dom = dom; }; @@ -4740,19 +3287,7 @@ El.Flyweight.prototype = new flyFn(); El.Flyweight.prototype.isFlyweight = true; El._flyweights = {}; -/** - *

      Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to this element - - * the dom node can be overwritten by other code. Shorthand of {@link Ext.Element#fly}

      - *

      Use this to make one-time references to DOM elements which are not going to be accessed again either by - * application code, or by Ext's classes. If accessing an element which will be processed regularly, then {@link Ext#get} - * will be more appropriate to take advantage of the caching provided by the Ext.Element class.

      - * @param {String/HTMLElement} el The dom node or id - * @param {String} named (optional) Allows for creation of named reusable flyweights to prevent conflicts - * (e.g. internally Ext uses "_global") - * @return {Element} The shared Element object (or null if no matching element was found) - * @member Ext.Element - * @method fly - */ + El.fly = function(el, named){ var ret = null; named = named || '_global'; @@ -4764,37 +3299,13 @@ El.fly = function(el, named){ return ret; }; -/** - * Retrieves Ext.Element objects. - *

      This method does not retrieve {@link Ext.Component Component}s. This method - * retrieves Ext.Element objects which encapsulate DOM elements. To retrieve a Component by - * its ID, use {@link Ext.ComponentMgr#get}.

      - *

      Uses simple caching to consistently return the same object. Automatically fixes if an - * object was recreated with the same id via AJAX or DOM.

      - * Shorthand of {@link Ext.Element#get} - * @param {Mixed} el The id of the node, a DOM Node or an existing Element. - * @return {Element} The Element object (or null if no matching element was found) - * @member Ext - * @method get - */ + Ext.get = El.get; -/** - *

      Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to this element - - * the dom node can be overwritten by other code. Shorthand of {@link Ext.Element#fly}

      - *

      Use this to make one-time references to DOM elements which are not going to be accessed again either by - * application code, or by Ext's classes. If accessing an element which will be processed regularly, then {@link Ext#get} - * will be more appropriate to take advantage of the caching provided by the Ext.Element class.

      - * @param {String/HTMLElement} el The dom node or id - * @param {String} named (optional) Allows for creation of named reusable flyweights to prevent conflicts - * (e.g. internally Ext uses "_global") - * @return {Element} The shared Element object (or null if no matching element was found) - * @member Ext - * @method fly - */ + Ext.fly = El.fly; -// speedy lookup for elements never to box adjust + var noBoxAdjust = Ext.isStrict ? { select:1 } : { @@ -4805,16 +3316,9 @@ if(Ext.isIE || Ext.isGecko){ } })(); -/** - * @class Ext.Element - */ + Ext.Element.addMethods({ - /** - * Stops the specified event(s) from bubbling and optionally prevents the default action - * @param {String/Array} eventName an event / array of events to stop from bubbling - * @param {Boolean} preventDefault (optional) true to prevent the default action too - * @return {Ext.Element} this - */ + swallowEvent : function(eventName, preventDefault){ var me = this; function fn(e){ @@ -4833,26 +3337,14 @@ Ext.Element.addMethods({ return me; }, - /** - * Create an event handler on this element such that when the event fires and is handled by this element, - * it will be relayed to another object (i.e., fired again as if it originated from that object instead). - * @param {String} eventName The type of event to relay - * @param {Object} object Any object that extends {@link Ext.util.Observable} that will provide the context - * for firing the relayed event - */ + relayEvent : function(eventName, observable){ this.on(eventName, function(e){ observable.fireEvent(eventName, e); }); }, - /** - * Removes worthless text nodes - * @param {Boolean} forceReclean (optional) By default the element - * keeps track if it has been cleaned already so - * you can call this over and over. However, if you update the element and - * need to force a reclean, you can pass true. - */ + clean : function(forceReclean){ var me = this, dom = me.dom, @@ -4876,32 +3368,19 @@ Ext.Element.addMethods({ return me; }, - /** - * Direct access to the Updater {@link Ext.Updater#update} method. The method takes the same object - * parameter as {@link Ext.Updater#update} - * @return {Ext.Element} this - */ + load : function(){ var um = this.getUpdater(); um.update.apply(um, arguments); return this; }, - /** - * Gets this element's {@link Ext.Updater Updater} - * @return {Ext.Updater} The Updater - */ + getUpdater : function(){ return this.updateManager || (this.updateManager = new Ext.Updater(this)); }, - /** - * Update the innerHTML of this element, optionally searching for and processing scripts - * @param {String} html The new HTML - * @param {Boolean} loadScripts (optional) True to look for and process scripts (defaults to false) - * @param {Function} callback (optional) For async script loading you can be notified when the update completes - * @return {Ext.Element} this - */ + update : function(html, loadScripts, callback){ if (!this.dom) { return this; @@ -4910,7 +3389,7 @@ Ext.Element.addMethods({ if(loadScripts !== true){ this.dom.innerHTML = html; - if(Ext.isFunction(callback)){ + if(typeof callback == 'function'){ callback(); } return this; @@ -4955,7 +3434,7 @@ Ext.Element.addMethods({ } el = DOC.getElementById(id); if(el){Ext.removeNode(el);} - if(Ext.isFunction(callback)){ + if(typeof callback == 'function'){ callback(); } }); @@ -4963,28 +3442,22 @@ Ext.Element.addMethods({ return this; }, - // inherit docs, overridden so we can add removeAnchor + removeAllListeners : function(){ this.removeAnchor(); Ext.EventManager.removeAll(this.dom); return this; }, - /** - * Creates a proxy element of this element - * @param {String/Object} config The class name of the proxy element or a DomHelper config object - * @param {String/HTMLElement} renderTo (optional) The element or element id to render the proxy to (defaults to document.body) - * @param {Boolean} matchBox (optional) True to align and size the proxy to this element now (defaults to false) - * @return {Ext.Element} The new proxy element - */ + createProxy : function(config, renderTo, matchBox){ - config = Ext.isObject(config) ? config : {tag : "div", cls: config}; + config = (typeof config == 'object') ? config : {tag : "div", cls: config}; var me = this, proxy = renderTo ? Ext.DomHelper.append(renderTo, config, true) : Ext.DomHelper.insertBefore(me.dom, config, true); - if(matchBox && me.setBox && me.getBox){ // check to make sure Element.position.js is loaded + if(matchBox && me.setBox && me.getBox){ proxy.setBox(me.getBox()); } return proxy; @@ -4992,23 +3465,12 @@ Ext.Element.addMethods({ }); Ext.Element.prototype.getUpdateManager = Ext.Element.prototype.getUpdater; -/** - * @class Ext.Element - */ + Ext.Element.addMethods({ - /** - * Gets the x,y coordinates specified by the anchor position on the element. - * @param {String} anchor (optional) The specified anchor position (defaults to "c"). See {@link #alignTo} - * for details on supported anchor positions. - * @param {Boolean} local (optional) True to get the local (element top/left-relative) anchor position instead - * of page coordinates - * @param {Object} size (optional) An object containing the size to use for calculating anchor position - * {width: (target width), height: (target height)} (defaults to the element's current size) - * @return {Array} [x, y] An array containing the element's x and y coordinates - */ + getAnchorXY : function(anchor, local, s){ - //Passing a different size is useful for pre-calculating anchors, - //especially for anchored animations that change the el size. + + anchor = (anchor || "tl").toLowerCase(); s = s || {}; @@ -5038,17 +3500,7 @@ Ext.Element.addMethods({ return [xy[0] + extraX, xy[1] + extraY]; }, - /** - * Anchors an element to another element and realigns it when the window is resized. - * @param {Mixed} element The element to align to. - * @param {String} position The position to align to. - * @param {Array} offsets (optional) Offset the positioning by [x, y] - * @param {Boolean/Object} animate (optional) True for the default animation or a standard Element animation config object - * @param {Boolean/Number} monitorScroll (optional) True to monitor body scroll and reposition. If this parameter - * is a number, it is used as the buffer delay (defaults to 50ms). - * @param {Function} callback The function to call after the animation finishes - * @return {Ext.Element} this - */ + anchorTo : function(el, alignment, offsets, animate, monitorScroll, callback){ var me = this, dom = me.dom, @@ -5059,7 +3511,7 @@ Ext.Element.addMethods({ }, anchor = this.getAnchor(); - // previous listener anchor, remove it + this.removeAnchor(); Ext.apply(anchor, { fn: action, @@ -5072,14 +3524,11 @@ Ext.Element.addMethods({ Ext.EventManager.on(window, 'scroll', action, null, {buffer: !isNaN(monitorScroll) ? monitorScroll : 50}); } - action.call(me); // align immediately + action.call(me); return me; }, - /** - * Remove any anchor to this element. See {@link #anchorTo}. - * @return {Ext.Element} this - */ + removeAnchor : function(){ var me = this, anchor = this.getAnchor(); @@ -5094,7 +3543,7 @@ Ext.Element.addMethods({ return me; }, - // private + getAnchor : function(){ var data = Ext.Element.data, dom = this.dom; @@ -5109,14 +3558,7 @@ Ext.Element.addMethods({ return anchor; }, - /** - * Gets the x,y coordinates to align this element with another element. See {@link #alignTo} for more info on the - * supported position values. - * @param {Mixed} element The element to align to. - * @param {String} position (optional, defaults to "tl-bl?") The position to align to. - * @param {Array} offsets (optional) Offset the positioning by [x, y] - * @return {Array} [x, y] - */ + getAlignToXY : function(el, p, o){ el = Ext.get(el); @@ -5133,12 +3575,12 @@ Ext.Element.addMethods({ a2, x, y, - //constrain the aligned el to viewport if necessary + w, h, r, - dw = Ext.lib.Dom.getViewWidth() -10, // 10px of margin for ie - dh = Ext.lib.Dom.getViewHeight()-10, // 10px of margin for ie + dw = Ext.lib.Dom.getViewWidth() -10, + dh = Ext.lib.Dom.getViewHeight()-10, p1y, p1x, p2y, @@ -5150,7 +3592,7 @@ Ext.Element.addMethods({ docBody = doc.body, scrollX = (docElement.scrollLeft || docBody.scrollLeft || 0)+5, scrollY = (docElement.scrollTop || docBody.scrollTop || 0)+5, - c = false, //constrain to viewport + c = false, p1 = "", p2 = "", m = p.match(/^([a-z]+)-([a-z]+)(\?)?$/); @@ -5163,8 +3605,8 @@ Ext.Element.addMethods({ p2 = m[2]; c = !!m[3]; - //Subtract the aligned el's internal xy from the target's offset xy - //plus custom offset to get the aligned el's new offset xy + + a1 = me.getAnchorXY(p1, true); a2 = el.getAnchorXY(p2, false); @@ -5175,9 +3617,9 @@ Ext.Element.addMethods({ w = me.getWidth(); h = me.getHeight(); r = el.getRegion(); - //If we are at a viewport boundary and the aligned el is anchored on a target border that is - //perpendicular to the vp border, allow the aligned el to slide on that border, - //otherwise swap the aligned el to the opposite border of the target. + + + p1y = p1.charAt(0); p1x = p1.charAt(p1.length-1); p2y = p2.charAt(0); @@ -5202,69 +3644,19 @@ Ext.Element.addMethods({ return [x,y]; }, - /** - * Aligns this element with another element relative to the specified anchor points. If the other element is the - * document it aligns it to the viewport. - * The position parameter is optional, and can be specified in any one of the following formats: - *
        - *
      • Blank: Defaults to aligning the element's top-left corner to the target's bottom-left corner ("tl-bl").
      • - *
      • One anchor (deprecated): The passed anchor position is used as the target element's anchor point. - * The element being aligned will position its top-left corner (tl) to that point. This method has been - * deprecated in favor of the newer two anchor syntax below.
      • - *
      • Two anchors: If two values from the table below are passed separated by a dash, the first value is used as the - * element's anchor point, and the second value is used as the target's anchor point.
      • - *
      - * In addition to the anchor points, the position parameter also supports the "?" character. If "?" is passed at the end of - * the position string, the element will attempt to align as specified, but the position will be adjusted to constrain to - * the viewport if necessary. Note that the element being aligned might be swapped to align to a different position than - * that specified in order to enforce the viewport constraints. - * Following are all of the supported anchor positions: -
      -Value  Description
      ------  -----------------------------
      -tl     The top left corner (default)
      -t      The center of the top edge
      -tr     The top right corner
      -l      The center of the left edge
      -c      In the center of the element
      -r      The center of the right edge
      -bl     The bottom left corner
      -b      The center of the bottom edge
      -br     The bottom right corner
      -
      -Example Usage: -
      
      -// align el to other-el using the default positioning ("tl-bl", non-constrained)
      -el.alignTo("other-el");
      -
      -// align the top left corner of el with the top right corner of other-el (constrained to viewport)
      -el.alignTo("other-el", "tr?");
      -
      -// align the bottom right corner of el with the center left edge of other-el
      -el.alignTo("other-el", "br-l?");
      -
      -// align the center of el with the bottom left corner of other-el and
      -// adjust the x position by -6 pixels (and the y position by 0)
      -el.alignTo("other-el", "c-bl", [-6, 0]);
      -
      - * @param {Mixed} element The element to align to. - * @param {String} position (optional, defaults to "tl-bl?") The position to align to. - * @param {Array} offsets (optional) Offset the positioning by [x, y] - * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object - * @return {Ext.Element} this - */ + alignTo : function(element, position, offsets, animate){ var me = this; return me.setXY(me.getAlignToXY(element, position, offsets), me.preanim && !!animate ? me.preanim(arguments, 3) : false); }, - // private ==> used outside of core + adjustForConstraints : function(xy, parent, offsets){ return this.getConstrainToXY(parent || document, false, offsets, xy) || xy; }, - // private ==> used outside of core + getConstrainToXY : function(el, local, offsets, proposedXY){ var os = {top:0, left:0, bottom:0, right: 0}; @@ -5301,10 +3693,10 @@ el.alignTo("other-el", "c-bl", [-6, 0]); var x = xy[0], y = xy[1]; var w = this.dom.offsetWidth, h = this.dom.offsetHeight; - // only move it if it needs it + var moved = false; - // first validate right/bottom + if((x + w) > vr){ x = vr - w; moved = true; @@ -5313,7 +3705,7 @@ el.alignTo("other-el", "c-bl", [-6, 0]); y = vb - h; moved = true; } - // then make sure top/left isn't negative + if(x < vx){ x = vx; moved = true; @@ -5328,78 +3720,70 @@ el.alignTo("other-el", "c-bl", [-6, 0]); -// el = Ext.get(el); -// offsets = Ext.applyIf(offsets || {}, {top : 0, left : 0, bottom : 0, right : 0}); - -// var me = this, -// doc = document, -// s = el.getScroll(), -// vxy = el.getXY(), -// vx = offsets.left + s.left, -// vy = offsets.top + s.top, -// vw = -offsets.right, -// vh = -offsets.bottom, -// vr, -// vb, -// xy = proposedXY || (!local ? me.getXY() : [me.getLeft(true), me.getTop(true)]), -// x = xy[0], -// y = xy[1], -// w = me.dom.offsetWidth, h = me.dom.offsetHeight, -// moved = false; // only move it if it needs it -// -// -// if(el.dom == doc.body || el.dom == doc){ -// vw += Ext.lib.Dom.getViewWidth(); -// vh += Ext.lib.Dom.getViewHeight(); -// }else{ -// vw += el.dom.clientWidth; -// vh += el.dom.clientHeight; -// if(!local){ -// vx += vxy[0]; -// vy += vxy[1]; -// } -// } - -// // first validate right/bottom -// if(x + w > vx + vw){ -// x = vx + vw - w; -// moved = true; -// } -// if(y + h > vy + vh){ -// y = vy + vh - h; -// moved = true; -// } -// // then make sure top/left isn't negative -// if(x < vx){ -// x = vx; -// moved = true; -// } -// if(y < vy){ -// y = vy; -// moved = true; -// } -// return moved ? [x, y] : false; -// }, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - /** - * Calculates the x, y to center this element on the screen - * @return {Array} The x, y values [x, y] - */ getCenterXY : function(){ return this.getAlignToXY(document, 'c-c'); }, - /** - * Centers the Element in either the viewport, or another Element. - * @param {Mixed} centerIn (optional) The element in which to center the element. - */ + center : function(centerIn){ return this.alignTo(centerIn || document, 'c-c'); } }); -/** - * @class Ext.Element - */ + Ext.Element.addMethods(function(){ var PARENTNODE = 'parentNode', NEXTSIBLING = 'nextSibling', @@ -5408,13 +3792,7 @@ Ext.Element.addMethods(function(){ GET = Ext.get; return { - /** - * Looks at this node and then at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:first-child) - * @param {String} selector The simple selector to test - * @param {Number/Mixed} maxDepth (optional) The max depth to search as a number or element (defaults to 50 || document.body) - * @param {Boolean} returnEl (optional) True to return a Ext.Element object instead of DOM node - * @return {HTMLElement} The matching DOM node (or null if no match was found) - */ + findParent : function(simpleSelector, maxDepth, returnEl){ var p = this.dom, b = document.body, @@ -5438,118 +3816,61 @@ Ext.Element.addMethods(function(){ return null; }, - /** - * Looks at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:first-child) - * @param {String} selector The simple selector to test - * @param {Number/Mixed} maxDepth (optional) The max depth to - search as a number or element (defaults to 10 || document.body) - * @param {Boolean} returnEl (optional) True to return a Ext.Element object instead of DOM node - * @return {HTMLElement} The matching DOM node (or null if no match was found) - */ + findParentNode : function(simpleSelector, maxDepth, returnEl){ var p = Ext.fly(this.dom.parentNode, '_internal'); return p ? p.findParent(simpleSelector, maxDepth, returnEl) : null; }, - /** - * Walks up the dom looking for a parent node that matches the passed simple selector (e.g. div.some-class or span:first-child). - * This is a shortcut for findParentNode() that always returns an Ext.Element. - * @param {String} selector The simple selector to test - * @param {Number/Mixed} maxDepth (optional) The max depth to - search as a number or element (defaults to 10 || document.body) - * @return {Ext.Element} The matching DOM node (or null if no match was found) - */ + up : function(simpleSelector, maxDepth){ return this.findParentNode(simpleSelector, maxDepth, true); }, - /** - * Creates a {@link Ext.CompositeElement} for child nodes based on the passed CSS selector (the selector should not contain an id). - * @param {String} selector The CSS selector - * @return {CompositeElement/CompositeElementLite} The composite element - */ + select : function(selector){ return Ext.Element.select(selector, this.dom); }, - /** - * Selects child nodes based on the passed CSS selector (the selector should not contain an id). - * @param {String} selector The CSS selector - * @return {Array} An array of the matched nodes - */ + query : function(selector){ return DQ.select(selector, this.dom); }, - /** - * Selects a single child at any depth below this element based on the passed CSS selector (the selector should not contain an id). - * @param {String} selector The CSS selector - * @param {Boolean} returnDom (optional) True to return the DOM node instead of Ext.Element (defaults to false) - * @return {HTMLElement/Ext.Element} The child Ext.Element (or DOM node if returnDom = true) - */ + child : function(selector, returnDom){ var n = DQ.selectNode(selector, this.dom); return returnDom ? n : GET(n); }, - /** - * Selects a single *direct* child based on the passed CSS selector (the selector should not contain an id). - * @param {String} selector The CSS selector - * @param {Boolean} returnDom (optional) True to return the DOM node instead of Ext.Element (defaults to false) - * @return {HTMLElement/Ext.Element} The child Ext.Element (or DOM node if returnDom = true) - */ + down : function(selector, returnDom){ var n = DQ.selectNode(" > " + selector, this.dom); return returnDom ? n : GET(n); }, - /** - * Gets the parent node for this element, optionally chaining up trying to match a selector - * @param {String} selector (optional) Find a parent node that matches the passed simple selector - * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element - * @return {Ext.Element/HTMLElement} The parent node or null - */ + parent : function(selector, returnDom){ return this.matchNode(PARENTNODE, PARENTNODE, selector, returnDom); }, - /** - * Gets the next sibling, skipping text nodes - * @param {String} selector (optional) Find the next sibling that matches the passed simple selector - * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element - * @return {Ext.Element/HTMLElement} The next sibling or null - */ + next : function(selector, returnDom){ return this.matchNode(NEXTSIBLING, NEXTSIBLING, selector, returnDom); }, - /** - * Gets the previous sibling, skipping text nodes - * @param {String} selector (optional) Find the previous sibling that matches the passed simple selector - * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element - * @return {Ext.Element/HTMLElement} The previous sibling or null - */ + prev : function(selector, returnDom){ return this.matchNode(PREVIOUSSIBLING, PREVIOUSSIBLING, selector, returnDom); }, - /** - * Gets the first child, skipping text nodes - * @param {String} selector (optional) Find the next sibling that matches the passed simple selector - * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element - * @return {Ext.Element/HTMLElement} The first child or null - */ + first : function(selector, returnDom){ return this.matchNode(NEXTSIBLING, 'firstChild', selector, returnDom); }, - /** - * Gets the last child, skipping text nodes - * @param {String} selector (optional) Find the previous sibling that matches the passed simple selector - * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element - * @return {Ext.Element/HTMLElement} The last child or null - */ + last : function(selector, returnDom){ return this.matchNode(PREVIOUSSIBLING, 'lastChild', selector, returnDom); }, @@ -5565,22 +3886,13 @@ Ext.Element.addMethods(function(){ return null; } } -}());/** - * @class Ext.Element - */ +}()); Ext.Element.addMethods({ - /** - * Creates a {@link Ext.CompositeElement} for child nodes based on the passed CSS selector (the selector should not contain an id). - * @param {String} selector The CSS selector - * @param {Boolean} unique (optional) True to create a unique Ext.Element for each child (defaults to false, which creates a single shared flyweight object) - * @return {CompositeElement/CompositeElementLite} The composite element - */ + select : function(selector, unique){ return Ext.Element.select(selector, unique, this.dom); } -});/** - * @class Ext.Element - */ +}); Ext.Element.addMethods( function() { var GETDOM = Ext.getDom, @@ -5588,66 +3900,42 @@ function() { DH = Ext.DomHelper; return { - /** - * Appends the passed element(s) to this element - * @param {String/HTMLElement/Array/Element/CompositeElement} el - * @return {Ext.Element} this - */ + appendChild: function(el){ return GET(el).appendTo(this); }, - /** - * Appends this element to the passed element - * @param {Mixed} el The new parent element - * @return {Ext.Element} this - */ + appendTo: function(el){ GETDOM(el).appendChild(this.dom); return this; }, - /** - * Inserts this element before the passed element in the DOM - * @param {Mixed} el The element before which this element will be inserted - * @return {Ext.Element} this - */ + insertBefore: function(el){ (el = GETDOM(el)).parentNode.insertBefore(this.dom, el); return this; }, - /** - * Inserts this element after the passed element in the DOM - * @param {Mixed} el The element to insert after - * @return {Ext.Element} this - */ + insertAfter: function(el){ (el = GETDOM(el)).parentNode.insertBefore(this.dom, el.nextSibling); return this; }, - /** - * Inserts (or creates) an element (or DomHelper config) as the first child of this element - * @param {Mixed/Object} el The id or element to insert or a DomHelper config to create and insert - * @return {Ext.Element} The new child - */ + insertFirst: function(el, returnDom){ el = el || {}; - if(el.nodeType || el.dom || typeof el == 'string'){ // element + if(el.nodeType || el.dom || typeof el == 'string'){ el = GETDOM(el); this.dom.insertBefore(el, this.dom.firstChild); return !returnDom ? GET(el) : el; - }else{ // dh config + }else{ return this.createChild(el, this.dom.firstChild, returnDom); } }, - /** - * Replaces the passed element with this element - * @param {Mixed} el The element to replace - * @return {Ext.Element} this - */ + replace: function(el){ el = GET(el); this.insertBefore(el); @@ -5655,11 +3943,7 @@ function() { return this; }, - /** - * Replaces this element with the passed element - * @param {Mixed/Object} el The new element or a DomHelper config of an element to create - * @return {Ext.Element} this - */ + replaceWith: function(el){ var me = this; @@ -5677,14 +3961,7 @@ function() { return me; }, - /** - * Creates the passed DomHelper config and appends it to this element or optionally inserts it before the passed child element. - * @param {Object} config DomHelper element config object. If no tag is specified (e.g., {tag:'input'}) then a div will be - * automatically generated with the specified attributes. - * @param {HTMLElement} insertBefore (optional) a child element of this element - * @param {Boolean} returnDom (optional) true to return the dom node instead of creating an Element - * @return {Ext.Element} The new child element - */ + createChild: function(config, insertBefore, returnDom){ config = config || {tag:'div'}; return insertBefore ? @@ -5692,46 +3969,27 @@ function() { DH[!this.dom.firstChild ? 'overwrite' : 'append'](this.dom, config, returnDom !== true); }, - /** - * Creates and wraps this element with another element - * @param {Object} config (optional) DomHelper element config object for the wrapper element or null for an empty div - * @param {Boolean} returnDom (optional) True to return the raw DOM element instead of Ext.Element - * @return {HTMLElement/Element} The newly created wrapper element - */ + wrap: function(config, returnDom){ var newEl = DH.insertBefore(this.dom, config || {tag: "div"}, !returnDom); newEl.dom ? newEl.dom.appendChild(this.dom) : newEl.appendChild(this.dom); return newEl; }, - /** - * Inserts an html fragment into this element - * @param {String} where Where to insert the html in relation to this element - beforeBegin, afterBegin, beforeEnd, afterEnd. - * @param {String} html The HTML fragment - * @param {Boolean} returnEl (optional) True to return an Ext.Element (defaults to false) - * @return {HTMLElement/Ext.Element} The inserted node (or nearest related if more than 1 inserted) - */ + insertHtml : function(where, html, returnEl){ var el = DH.insertHtml(where, this.dom, html); return returnEl ? Ext.get(el) : el; } } -}());/** - * @class Ext.Element - */ +}()); Ext.apply(Ext.Element.prototype, function() { var GETDOM = Ext.getDom, GET = Ext.get, DH = Ext.DomHelper; return { - /** - * Inserts (or creates) the passed element (or DomHelper config) as a sibling of this element - * @param {Mixed/Object/Array} el The id, element to insert or a DomHelper config to create and insert *or* an array of any of those. - * @param {String} where (optional) 'before' or 'after' defaults to before - * @param {Boolean} returnDom (optional) True to return the raw DOM element instead of Ext.Element - * @return {Ext.Element} The inserted Element. If an array is passed, the last inserted element is returned. - */ + insertSibling: function(el, where, returnDom){ var me = this, rt, @@ -5766,11 +4024,9 @@ Ext.apply(Ext.Element.prototype, function() { return rt; } }; -}());/** - * @class Ext.Element - */ +}()); Ext.Element.addMethods(function(){ - // local style camelizing for speed + var propCache = {}, camelRe = /(-[a-z])/gi, classReCache = {}, @@ -5778,6 +4034,8 @@ Ext.Element.addMethods(function(){ propFloat = Ext.isIE ? 'styleFloat' : 'cssFloat', opacityRe = /alpha\(opacity=(.*)\)/i, trimRe = /^\s+|\s+$/g, + spacesRe = /\s+/, + wordsRe = /\w/g, EL = Ext.Element, PADDING = "padding", MARGIN = "margin", @@ -5794,14 +4052,14 @@ Ext.Element.addMethods(function(){ OVERFLOWX = 'overflow-x', OVERFLOWY = 'overflow-y', ORIGINALCLIP = 'originalClip', - // special markup used throughout Ext when box wrapping elements + borders = {l: BORDER + LEFT + WIDTH, r: BORDER + RIGHT + WIDTH, t: BORDER + TOP + WIDTH, b: BORDER + BOTTOM + WIDTH}, paddings = {l: PADDING + LEFT, r: PADDING + RIGHT, t: PADDING + TOP, b: PADDING + BOTTOM}, margins = {l: MARGIN + LEFT, r: MARGIN + RIGHT, t: MARGIN + TOP, b: MARGIN + BOTTOM}, data = Ext.Element.data; - // private + function camelFn(m, a) { return a.charAt(1).toUpperCase(); } @@ -5811,20 +4069,20 @@ Ext.Element.addMethods(function(){ } return { - // private ==> used by Fx + adjustWidth : function(width) { var me = this; - var isNum = Ext.isNumber(width); + var isNum = (typeof width == "number"); if(isNum && me.autoBoxAdjust && !me.isBorderBox()){ width -= (me.getBorderWidth("lr") + me.getPadding("lr")); } return (isNum && width < 0) ? 0 : width; }, - // private ==> used by Fx + adjustHeight : function(height) { var me = this; - var isNum = Ext.isNumber(height); + var isNum = (typeof height == "number"); if(isNum && me.autoBoxAdjust && !me.isBorderBox()){ height -= (me.getBorderWidth("tb") + me.getPadding("tb")); } @@ -5832,85 +4090,88 @@ Ext.Element.addMethods(function(){ }, - /** - * Adds one or more CSS classes to the element. Duplicate classes are automatically filtered out. - * @param {String/Array} className The CSS class to add, or an array of classes - * @return {Ext.Element} this - */ + addClass : function(className){ - var me = this, i, len, v; - className = Ext.isArray(className) ? className : [className]; - for (i=0, len = className.length; i < len; i++) { - v = className[i]; - if (v) { - me.dom.className += (!me.hasClass(v) && v ? " " + v : ""); - }; - }; + var me = this, + i, + len, + v, + cls = []; + + if (!Ext.isArray(className)) { + if (typeof className == 'string' && !this.hasClass(className)) { + me.dom.className += " " + className; + } + } + else { + for (i = 0, len = className.length; i < len; i++) { + v = className[i]; + if (typeof v == 'string' && (' ' + me.dom.className + ' ').indexOf(' ' + v + ' ') == -1) { + cls.push(v); + } + } + if (cls.length) { + me.dom.className += " " + cls.join(" "); + } + } return me; }, - /** - * Adds one or more CSS classes to this element and removes the same class(es) from all siblings. - * @param {String/Array} className The CSS class to add, or an array of classes - * @return {Ext.Element} this - */ + + removeClass : function(className){ + var me = this, + i, + idx, + len, + cls, + elClasses; + if (!Ext.isArray(className)){ + className = [className]; + } + if (me.dom && me.dom.className) { + elClasses = me.dom.className.replace(trimRe, '').split(spacesRe); + for (i = 0, len = className.length; i < len; i++) { + cls = className[i]; + if (typeof cls == 'string') { + cls = cls.replace(trimRe, ''); + idx = elClasses.indexOf(cls); + if (idx != -1) { + elClasses.splice(idx, 1); + } + } + } + me.dom.className = elClasses.join(" "); + } + return me; + }, + + radioClass : function(className){ - var cn = this.dom.parentNode.childNodes, v; + var cn = this.dom.parentNode.childNodes, + v, + i, + len; className = Ext.isArray(className) ? className : [className]; - for (var i=0, len = cn.length; i < len; i++) { + for (i = 0, len = cn.length; i < len; i++) { v = cn[i]; - if(v && v.nodeType == 1) { + if (v && v.nodeType == 1) { Ext.fly(v, '_internal').removeClass(className); } }; return this.addClass(className); }, - /** - * Removes one or more CSS classes from the element. - * @param {String/Array} className The CSS class to remove, or an array of classes - * @return {Ext.Element} this - */ - removeClass : function(className){ - var me = this, v; - className = Ext.isArray(className) ? className : [className]; - if (me.dom && me.dom.className) { - for (var i=0, len=className.length; i < len; i++) { - v = className[i]; - if(v) { - me.dom.className = me.dom.className.replace( - classReCache[v] = classReCache[v] || new RegExp('(?:^|\\s+)' + v + '(?:\\s+|$)', "g"), " " - ); - } - }; - } - return me; - }, - - /** - * Toggles the specified CSS class on this element (removes it if it already exists, otherwise adds it). - * @param {String} className The CSS class to toggle - * @return {Ext.Element} this - */ + toggleClass : function(className){ return this.hasClass(className) ? this.removeClass(className) : this.addClass(className); }, - /** - * Checks if the specified CSS class exists on this element's DOM node. - * @param {String} className The CSS class to check for - * @return {Boolean} True if the class exists, else false - */ + hasClass : function(className){ return className && (' '+this.dom.className+' ').indexOf(' '+className+' ') != -1; }, - /** - * Replaces a CSS class on the element with another. If the old name does not exist, the new name will simply be added. - * @param {String} oldClassName The CSS class to replace - * @param {String} newClassName The replacement CSS class - * @return {Ext.Element} this - */ + replaceClass : function(oldClassName, newClassName){ return this.removeClass(oldClassName).addClass(newClassName); }, @@ -5919,11 +4180,7 @@ Ext.Element.addMethods(function(){ return this.getStyle(style) == val; }, - /** - * Normalizes currentStyle and computedStyle. - * @param {String} property The style property whose value is returned. - * @return {String} The current value of the style property for this element. - */ + getStyle : function(){ return view && view.getComputedStyle ? function(prop){ @@ -5934,12 +4191,12 @@ Ext.Element.addMethods(function(){ display, wk = Ext.isWebKit, display; - + if(el == document){ return null; } prop = chkCache(prop); - // Fix bug caused by this: https://bugs.webkit.org/show_bug.cgi?id=13343 + if(wk && /marginRight/.test(prop)){ display = this.getStyle('display'); el.style.display = 'inline-block'; @@ -5947,7 +4204,7 @@ Ext.Element.addMethods(function(){ out = (v = el.style[prop]) ? v : (cs = view.getComputedStyle(el, "")) ? cs[prop] : null; - // Webkit returns rgb values for transparent. + if(wk){ if(out == 'rgba(0, 0, 0, 0)'){ out = 'transparent'; @@ -5979,17 +4236,10 @@ Ext.Element.addMethods(function(){ }; }(), - /** - * Return the CSS color for the specified CSS attribute. rgb, 3 digit (like #fff) and valid values - * are convert to standard 6 digit hex color. - * @param {String} attr The css attribute - * @param {String} defaultValue The default value to use when a valid color isn't found - * @param {String} prefix (optional) defaults to #. Use an empty string when working with - * color anims. - */ + getColor : function(attr, defaultValue, prefix){ var v = this.getStyle(attr), - color = Ext.isDefined(prefix) ? prefix : '#', + color = (typeof prefix != 'undefined') ? prefix : '#', h; if(!v || /transparent|inherit/.test(v)){ @@ -6007,17 +4257,12 @@ Ext.Element.addMethods(function(){ return(color.length > 5 ? color.toLowerCase() : defaultValue); }, - /** - * Wrapper for setting style properties, also takes single object parameter of multiple styles. - * @param {String/Object} property The style property to be set, or an object of multiple styles. - * @param {String} value (optional) The value to apply to the given property, or null if an object was passed. - * @return {Ext.Element} this - */ + setStyle : function(prop, value){ var tmp, style, camel; - if (!Ext.isObject(prop)) { + if (typeof prop != 'object') { tmp = {}; tmp[prop] = value; prop = tmp; @@ -6031,13 +4276,7 @@ Ext.Element.addMethods(function(){ return this; }, - /** - * Set the opacity of the element - * @param {Float} opacity The new opacity. 0 = transparent, .5 = 50% visibile, 1 = fully visible, etc - * @param {Boolean/Object} animate (optional) a standard Element animation config object or true for - * the default animation ({duration: .35, easing: 'easeIn'}) - * @return {Ext.Element} this - */ + setOpacity : function(opacity, animate){ var me = this, s = me.dom.style; @@ -6058,10 +4297,7 @@ Ext.Element.addMethods(function(){ return me; }, - /** - * Clears any opacity settings from this element. Required in some cases for IE. - * @return {Ext.Element} this - */ + clearOpacity : function(){ var style = this.dom.style; if(Ext.isIE){ @@ -6074,11 +4310,7 @@ Ext.Element.addMethods(function(){ return this; }, - /** - * Returns the offset height of the element - * @param {Boolean} contentHeight (optional) true to get the height minus borders and padding - * @return {Number} The element's height - */ + getHeight : function(contentHeight){ var me = this, dom = me.dom, @@ -6089,11 +4321,7 @@ Ext.Element.addMethods(function(){ return h < 0 ? 0 : h; }, - /** - * Returns the offset width of the element - * @param {Boolean} contentWidth (optional) true to get the width minus borders and padding - * @return {Number} The element's width - */ + getWidth : function(contentWidth){ var me = this, dom = me.dom, @@ -6103,15 +4331,7 @@ Ext.Element.addMethods(function(){ return w < 0 ? 0 : w; }, - /** - * Set the width of this Element. - * @param {Mixed} width The new width. This may be one of:
        - *
      • A Number specifying the new width in this Element's {@link #defaultUnit}s (by default, pixels).
      • - *
      • A String used to set the CSS width style. Animation may not be used. - *
      - * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object - * @return {Ext.Element} this - */ + setWidth : function(width, animate){ var me = this; width = me.adjustWidth(width); @@ -6121,26 +4341,7 @@ Ext.Element.addMethods(function(){ return me; }, - /** - * Set the height of this Element. - *
      
      -// change the height to 200px and animate with default configuration
      -Ext.fly('elementId').setHeight(200, true);
      -
      -// change the height to 150px and animate with a custom configuration
      -Ext.fly('elId').setHeight(150, {
      -    duration : .5, // animation will have a duration of .5 seconds
      -    // will change the content to "finished"
      -    callback: function(){ this.{@link #update}("finished"); }
      -});
      -         * 
      - * @param {Mixed} height The new height. This may be one of:
        - *
      • A Number specifying the new height in this Element's {@link #defaultUnit}s (by default, pixels.)
      • - *
      • A String used to set the CSS height style. Animation may not be used.
      • - *
      - * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object - * @return {Ext.Element} this - */ + setHeight : function(height, animate){ var me = this; height = me.adjustHeight(height); @@ -6150,30 +4351,17 @@ Ext.fly('elId').setHeight(150, { return me; }, - /** - * Gets the width of the border(s) for the specified side(s) - * @param {String} side Can be t, l, r, b or any combination of those to add multiple values. For example, - * passing 'lr' would get the border left width + the border right width. - * @return {Number} The width of the sides passed added together - */ + getBorderWidth : function(side){ return this.addStyles(side, borders); }, - /** - * Gets the width of the padding(s) for the specified side(s) - * @param {String} side Can be t, l, r, b or any combination of those to add multiple values. For example, - * passing 'lr' would get the padding left + the padding right. - * @return {Number} The padding of the sides passed added together - */ + getPadding : function(side){ return this.addStyles(side, paddings); }, - /** - * Store the current overflow setting and clip overflow on the element - use {@link #unclip} to remove - * @return {Ext.Element} this - */ + clip : function(){ var me = this, dom = me.dom; @@ -6192,10 +4380,7 @@ Ext.fly('elId').setHeight(150, { return me; }, - /** - * Return clipping (overflow) to original clipping before {@link #clip} was called - * @return {Ext.Element} this - */ + unclip : function(){ var me = this, dom = me.dom; @@ -6216,55 +4401,44 @@ Ext.fly('elId').setHeight(150, { return me; }, - // private + addStyles : function(sides, styles){ - var val = 0, - m = sides.match(/\w/g), - s; - for (var i=0, len=m.length; i used by ext full + setOverflow : function(v){ var dom = this.dom; - if(v=='auto' && Ext.isMac && Ext.isGecko2){ // work around stupid FF 2.0/Mac scroll bar bug + if(v=='auto' && Ext.isMac && Ext.isGecko2){ dom.style.overflow = 'hidden'; (function(){dom.style.overflow = 'auto';}).defer(1); }else{ @@ -6285,58 +4459,18 @@ Ext.Element.addMethods(function(){ } }, - /** - *

      Wraps the specified element with a special 9 element markup/CSS block that renders by default as - * a gray container with a gradient background, rounded corners and a 4-way shadow.

      - *

      This special markup is used throughout Ext when box wrapping elements ({@link Ext.Button}, - * {@link Ext.Panel} when {@link Ext.Panel#frame frame=true}, {@link Ext.Window}). The markup - * is of this form:

      - *
      
      -    Ext.Element.boxMarkup =
      -    '<div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div>
      -     <div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div>
      -     <div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>';
      -        * 
      - *

      Example usage:

      - *
      
      -    // Basic box wrap
      -    Ext.get("foo").boxWrap();
      -
      -    // You can also add a custom class and use CSS inheritance rules to customize the box look.
      -    // 'x-box-blue' is a built-in alternative -- look at the related CSS definitions as an example
      -    // for how to create a custom box wrap style.
      -    Ext.get("foo").boxWrap().addClass("x-box-blue");
      -        * 
      - * @param {String} class (optional) A base CSS class to apply to the containing wrapper element - * (defaults to 'x-box'). Note that there are a number of CSS rules that are dependent on - * this name to make the overall effect work, so if you supply an alternate base class, make sure you - * also supply all of the necessary rules. - * @return {Ext.Element} The outermost wrapping element of the created box structure. - */ + boxWrap : function(cls){ cls = cls || 'x-box'; - var el = Ext.get(this.insertHtml("beforeBegin", "
      " + String.format(Ext.Element.boxMarkup, cls) + "
      ")); //String.format('
      '+Ext.Element.boxMarkup+'
      ', cls))); + var el = Ext.get(this.insertHtml("beforeBegin", "
      " + String.format(Ext.Element.boxMarkup, cls) + "
      ")); Ext.DomQuery.selectNode('.' + cls + '-mc', el.dom).appendChild(this.dom); return el; }, - /** - * Set the size of this Element. If animation is true, both width and height will be animated concurrently. - * @param {Mixed} width The new width. This may be one of:
        - *
      • A Number specifying the new width in this Element's {@link #defaultUnit}s (by default, pixels).
      • - *
      • A String used to set the CSS width style. Animation may not be used. - *
      • A size object in the format {width: widthValue, height: heightValue}.
      • - *
      - * @param {Mixed} height The new height. This may be one of:
        - *
      • A Number specifying the new height in this Element's {@link #defaultUnit}s (by default, pixels).
      • - *
      • A String used to set the CSS height style. Animation may not be used.
      • - *
      - * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object - * @return {Ext.Element} this - */ + setSize : function(width, height, animate){ var me = this; - if(Ext.isObject(width)){ // in case of object from getSize() + if(typeof width == 'object'){ height = width.height; width = width.width; } @@ -6351,12 +4485,7 @@ Ext.Element.addMethods(function(){ return me; }, - /** - * Returns either the offsetHeight or the height of this element based on CSS height adjusted by padding or borders - * when needed to simulate offsetHeight when offsets aren't available. This may not work on display:none elements - * if a height has not been set using CSS. - * @return {Number} - */ + getComputedHeight : function(){ var me = this, h = Math.max(me.dom.offsetHeight, me.dom.clientHeight); @@ -6369,12 +4498,7 @@ Ext.Element.addMethods(function(){ return h; }, - /** - * Returns either the offsetWidth or the width of this element based on CSS width adjusted by padding or borders - * when needed to simulate offsetWidth when offsets aren't available. This may not work on display:none elements - * if a width has not been set using CSS. - * @return {Number} - */ + getComputedWidth : function(){ var w = Math.max(this.dom.offsetWidth, this.dom.clientWidth); if(!w){ @@ -6386,21 +4510,12 @@ Ext.Element.addMethods(function(){ return w; }, - /** - * Returns the sum width of the padding and borders for the passed "sides". See getBorderWidth() - for more information about the sides. - * @param {String} sides - * @return {Number} - */ + getFrameWidth : function(sides, onlyContentBox){ return onlyContentBox && this.isBorderBox() ? 0 : (this.getPadding(sides) + this.getBorderWidth(sides)); }, - /** - * Sets up event handlers to add and remove a css class when the mouse is over this element - * @param {String} className - * @return {Ext.Element} this - */ + addClassOnOver : function(className){ this.hover( function(){ @@ -6413,11 +4528,7 @@ Ext.Element.addMethods(function(){ return this; }, - /** - * Sets up event handlers to add and remove a css class when this element has the focus - * @param {String} className - * @return {Ext.Element} this - */ + addClassOnFocus : function(className){ this.on("focus", function(){ Ext.fly(this, INTERNAL).addClass(className); @@ -6428,11 +4539,7 @@ Ext.Element.addMethods(function(){ return this; }, - /** - * Sets up event handlers to add and remove a css class when the mouse is down and then up on this element (a click effect) - * @param {String} className - * @return {Ext.Element} this - */ + addClassOnClick : function(className){ var dom = this.dom; this.on("mousedown", function(){ @@ -6447,32 +4554,14 @@ Ext.Element.addMethods(function(){ return this; }, - /** - *

      Returns the dimensions of the element available to lay content out in.

      - *

      If the element (or any ancestor element) has CSS style display : none, the dimensions will be zero.

      - * example:
      
      -        var vpSize = Ext.getBody().getViewSize();
      -
      -        // all Windows created afterwards will have a default value of 90% height and 95% width
      -        Ext.Window.override({
      -            width: vpSize.width * 0.9,
      -            height: vpSize.height * 0.95
      -        });
      -        // To handle window resizing you would have to hook onto onWindowResize.
      -        * 
      - * - * getViewSize utilizes clientHeight/clientWidth which excludes sizing of scrollbars. - * To obtain the size including scrollbars, use getStyleSize - * - * Sizing of the document body is handled at the adapter level which handles special cases for IE and strict modes, etc. - */ + getViewSize : function(){ var doc = document, d = this.dom, isDoc = (d == doc || d == doc.body); - // If the body, use Ext.lib.Dom + if (isDoc) { var extdom = Ext.lib.Dom; return { @@ -6480,7 +4569,7 @@ Ext.Element.addMethods(function(){ height : extdom.getViewHeight() }; - // Else use clientHeight/clientWidth + } else { return { width : d.clientWidth, @@ -6489,14 +4578,7 @@ Ext.Element.addMethods(function(){ } }, - /** - *

      Returns the dimensions of the element available to lay content out in.

      - * - * getStyleSize utilizes prefers style sizing if present, otherwise it chooses the larger of offsetHeight/clientHeight and offsetWidth/clientWidth. - * To obtain the size excluding scrollbars, use getViewSize - * - * Sizing of the document body is handled at the adapter level which handles special cases for IE and strict modes, etc. - */ + getStyleSize : function(){ var me = this, @@ -6506,7 +4588,7 @@ Ext.Element.addMethods(function(){ isDoc = (d == doc || d == doc.body), s = d.style; - // If the body, use Ext.lib.Dom + if (isDoc) { var extdom = Ext.lib.Dom; return { @@ -6514,37 +4596,30 @@ Ext.Element.addMethods(function(){ height : extdom.getViewHeight() } } - // Use Styles if they are set + if(s.width && s.width != 'auto'){ w = parseFloat(s.width); if(me.isBorderBox()){ w -= me.getFrameWidth('lr'); } } - // Use Styles if they are set + if(s.height && s.height != 'auto'){ h = parseFloat(s.height); if(me.isBorderBox()){ h -= me.getFrameWidth('tb'); } } - // Use getWidth/getHeight if style not set. + return {width: w || me.getWidth(true), height: h || me.getHeight(true)}; }, - /** - * Returns the size of the element. - * @param {Boolean} contentSize (optional) true to get the width/size minus borders and padding - * @return {Object} An object containing the element's size {width: (element width), height: (element height)} - */ + getSize : function(contentSize){ return {width: this.getWidth(contentSize), height: this.getHeight(contentSize)}; }, - /** - * Forces the browser to repaint this element - * @return {Ext.Element} this - */ + repaint : function(){ var dom = this.dom; this.addClass("x-repaint"); @@ -6554,10 +4629,7 @@ Ext.Element.addMethods(function(){ return this; }, - /** - * Disables text selection for this element (normalized across browsers) - * @return {Ext.Element} this - */ + unselectable : function(){ this.dom.unselectable = "on"; return this.swallowEvent("selectstart", true). @@ -6565,12 +4637,7 @@ Ext.Element.addMethods(function(){ addClass("x-unselectable"); }, - /** - * Returns an object with properties top, left, right and bottom representing the margins of this element unless sides is passed, - * then it returns the calculated width of the sides (see getPadding) - * @param {String} sides (optional) Any combination of l, r, t, b to get the sum of those sides - * @return {Object/Number} - */ + getMargins : function(side){ var me = this, key, @@ -6588,9 +4655,7 @@ Ext.Element.addMethods(function(){ } }; }()); -/** - * @class Ext.Element - */ + (function(){ var D = Ext.lib.Dom, LEFT = "left", @@ -6604,108 +4669,63 @@ var D = Ext.lib.Dom, ZINDEX = "z-index"; Ext.Element.addMethods({ - /** - * Gets the current X position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). - * @return {Number} The X position of the element - */ + getX : function(){ return D.getX(this.dom); }, - /** - * Gets the current Y position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). - * @return {Number} The Y position of the element - */ + getY : function(){ return D.getY(this.dom); }, - /** - * Gets the current position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). - * @return {Array} The XY position of the element - */ + getXY : function(){ return D.getXY(this.dom); }, - /** - * Returns the offsets of this element from the passed element. Both element must be part of the DOM tree and not have display:none to have page coordinates. - * @param {Mixed} element The element to get the offsets from. - * @return {Array} The XY page offsets (e.g. [100, -200]) - */ + getOffsetsTo : function(el){ var o = this.getXY(), e = Ext.fly(el, '_internal').getXY(); return [o[0]-e[0],o[1]-e[1]]; }, - /** - * Sets the X position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). - * @param {Number} The X position of the element - * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object - * @return {Ext.Element} this - */ + setX : function(x, animate){ return this.setXY([x, this.getY()], this.animTest(arguments, animate, 1)); }, - /** - * Sets the Y position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). - * @param {Number} The Y position of the element - * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object - * @return {Ext.Element} this - */ + setY : function(y, animate){ return this.setXY([this.getX(), y], this.animTest(arguments, animate, 1)); }, - /** - * Sets the element's left position directly using CSS style (instead of {@link #setX}). - * @param {String} left The left CSS property value - * @return {Ext.Element} this - */ + setLeft : function(left){ this.setStyle(LEFT, this.addUnits(left)); return this; }, - /** - * Sets the element's top position directly using CSS style (instead of {@link #setY}). - * @param {String} top The top CSS property value - * @return {Ext.Element} this - */ + setTop : function(top){ this.setStyle(TOP, this.addUnits(top)); return this; }, - /** - * Sets the element's CSS right style. - * @param {String} right The right CSS property value - * @return {Ext.Element} this - */ + setRight : function(right){ this.setStyle(RIGHT, this.addUnits(right)); return this; }, - /** - * Sets the element's CSS bottom style. - * @param {String} bottom The bottom CSS property value - * @return {Ext.Element} this - */ + setBottom : function(bottom){ this.setStyle(BOTTOM, this.addUnits(bottom)); return this; }, - /** - * Sets the position of the element in page coordinates, regardless of how the element is positioned. - * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). - * @param {Array} pos Contains X & Y [x, y] values for new position (coordinates are page-based) - * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object - * @return {Ext.Element} this - */ + setXY : function(pos, animate){ var me = this; if(!animate || !me.anim){ @@ -6716,76 +4736,39 @@ Ext.Element.addMethods({ return me; }, - /** - * Sets the position of the element in page coordinates, regardless of how the element is positioned. - * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). - * @param {Number} x X value for new position (coordinates are page-based) - * @param {Number} y Y value for new position (coordinates are page-based) - * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object - * @return {Ext.Element} this - */ + setLocation : function(x, y, animate){ return this.setXY([x, y], this.animTest(arguments, animate, 2)); }, - /** - * Sets the position of the element in page coordinates, regardless of how the element is positioned. - * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). - * @param {Number} x X value for new position (coordinates are page-based) - * @param {Number} y Y value for new position (coordinates are page-based) - * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object - * @return {Ext.Element} this - */ + moveTo : function(x, y, animate){ return this.setXY([x, y], this.animTest(arguments, animate, 2)); }, - /** - * Gets the left X coordinate - * @param {Boolean} local True to get the local css position instead of page coordinate - * @return {Number} - */ + getLeft : function(local){ return !local ? this.getX() : parseInt(this.getStyle(LEFT), 10) || 0; }, - /** - * Gets the right X coordinate of the element (element X position + element width) - * @param {Boolean} local True to get the local css position instead of page coordinate - * @return {Number} - */ + getRight : function(local){ var me = this; return !local ? me.getX() + me.getWidth() : (me.getLeft(true) + me.getWidth()) || 0; }, - /** - * Gets the top Y coordinate - * @param {Boolean} local True to get the local css position instead of page coordinate - * @return {Number} - */ + getTop : function(local) { return !local ? this.getY() : parseInt(this.getStyle(TOP), 10) || 0; }, - /** - * Gets the bottom Y coordinate of the element (element Y position + element height) - * @param {Boolean} local True to get the local css position instead of page coordinate - * @return {Number} - */ + getBottom : function(local){ var me = this; return !local ? me.getY() + me.getHeight() : (me.getTop(true) + me.getHeight()) || 0; }, - /** - * Initializes positioning on this element. If a desired position is not passed, it will make the - * the element positioned relative IF it is not already positioned. - * @param {String} pos (optional) Positioning to use "relative", "absolute" or "fixed" - * @param {Number} zIndex (optional) The zIndex to apply - * @param {Number} x (optional) Set the page X position - * @param {Number} y (optional) Set the page Y position - */ + position : function(pos, zIndex, x, y){ var me = this; @@ -6800,11 +4783,7 @@ Ext.Element.addMethods({ if(x || y) me.setXY([x || false, y || false]); }, - /** - * Clear positioning back to the default when the document was loaded - * @param {String} value (optional) The value to use for the left,right,top,bottom, defaults to '' (empty string). You could use 'auto'. - * @return {Ext.Element} this - */ + clearPositioning : function(value){ value = value || ''; this.setStyle({ @@ -6818,11 +4797,7 @@ Ext.Element.addMethods({ return this; }, - /** - * Gets an object with all CSS positioning properties. Useful along with setPostioning to get - * snapshot before performing an update and then restoring the element. - * @return {Object} - */ + getPositioning : function(){ var l = this.getStyle(LEFT); var t = this.getStyle(TOP); @@ -6836,11 +4811,7 @@ Ext.Element.addMethods({ }; }, - /** - * Set positioning with an object returned by getPositioning(). - * @param {Object} posCfg - * @return {Ext.Element} this - */ + setPositioning : function(pc){ var me = this, style = me.dom.style; @@ -6857,12 +4828,7 @@ Ext.Element.addMethods({ return me; }, - /** - * Translates the passed page coordinates into left/top css values for this element - * @param {Number/Array} x The page x or an array containing [x, y] - * @param {Number} y (optional) The page y, required if x is not an array - * @return {Object} An object with left and top properties. e.g. {left: (value), top: (value)} - */ + translatePoints : function(x, y){ y = isNaN(x[1]) ? y : x[1]; x = isNaN(x[0]) ? x : x[0]; @@ -6882,17 +4848,9 @@ Ext.Element.addMethods({ return !!animate && this.preanim ? this.preanim(args, i) : false; } }); -})();/** - * @class Ext.Element - */ +})(); Ext.Element.addMethods({ - /** - * Sets the element's box. Use getBox() on another element to get a box obj. If animate is true then width, height, x and y will be animated concurrently. - * @param {Object} box The box to fill {x, y, width, height} - * @param {Boolean} adjust (optional) Whether to adjust for box-model issues automatically - * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object - * @return {Ext.Element} this - */ + setBox : function(box, adjust, animate){ var me = this, w = box.width, @@ -6905,24 +4863,7 @@ Ext.Element.addMethods({ return me; }, - /** - * Return an object defining the area of this Element which can be passed to {@link #setBox} to - * set another Element's size/location to match this element. - * @param {Boolean} contentBox (optional) If true a box for the content of the element is returned. - * @param {Boolean} local (optional) If true the element's left and top are returned instead of page x/y. - * @return {Object} box An object in the format

      
      -{
      -    x: <Element's X position>,
      -    y: <Element's Y position>,
      -    width: <Element's width>,
      -    height: <Element's height>,
      -    bottom: <Element's lower bound>,
      -    right: <Element's rightmost bound>
      -}
      -
      - * The returned object may also be addressed as an Array where index 0 contains the X position - * and index 1 contains the Y position. So the result may also be used for {@link #setXY} - */ + getBox : function(contentBox, local) { var me = this, xy, @@ -6956,13 +4897,7 @@ Ext.Element.addMethods({ return bx; }, - /** - * Move this element relative to its current position. - * @param {String} direction Possible values are: "l" (or "left"), "r" (or "right"), "t" (or "top", or "up"), "b" (or "bottom", or "down"). - * @param {Number} distance How far to move the element in pixels - * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object - * @return {Ext.Element} this - */ + move : function(direction, distance, animate){ var me = this, xy = me.getXY(), @@ -6989,12 +4924,7 @@ Ext.Element.addMethods({ me.moveTo(hash[direction][0], hash[direction][1], me.animTest.call(me, arguments, animate, 2)); }, - /** - * Quick set left and top adding default units - * @param {String} left The left CSS property value - * @param {String} top The top CSS property value - * @return {Ext.Element} this - */ + setLeftTop : function(left, top){ var me = this, style = me.dom.style; @@ -7003,30 +4933,12 @@ Ext.Element.addMethods({ return me; }, - /** - * Returns the region of the given element. - * The element must be part of the DOM tree to have a region (display:none or elements not appended return false). - * @return {Region} A Ext.lib.Region containing "top, left, bottom, right" member data. - */ + getRegion : function(){ return Ext.lib.Dom.getRegion(this.dom); }, - /** - * Sets the element's position and size in one shot. If animation is true then width, height, x and y will be animated concurrently. - * @param {Number} x X value for new position (coordinates are page-based) - * @param {Number} y Y value for new position (coordinates are page-based) - * @param {Mixed} width The new width. This may be one of:
        - *
      • A Number specifying the new width in this Element's {@link #defaultUnit}s (by default, pixels)
      • - *
      • A String used to set the CSS width style. Animation may not be used. - *
      - * @param {Mixed} height The new height. This may be one of:
        - *
      • A Number specifying the new height in this Element's {@link #defaultUnit}s (by default, pixels)
      • - *
      • A String used to set the CSS height style. Animation may not be used.
      • - *
      - * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object - * @return {Ext.Element} this - */ + setBounds : function(x, y, width, height, animate){ var me = this; if (!animate || !me.anim) { @@ -7042,43 +4954,25 @@ Ext.Element.addMethods({ return me; }, - /** - * Sets the element's position and size the specified region. If animation is true then width, height, x and y will be animated concurrently. - * @param {Ext.lib.Region} region The region to fill - * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object - * @return {Ext.Element} this - */ + setRegion : function(region, animate) { return this.setBounds(region.left, region.top, region.right-region.left, region.bottom-region.top, this.animTest.call(this, arguments, animate, 1)); } -});/** - * @class Ext.Element - */ +}); Ext.Element.addMethods({ - /** - * Returns true if this element is scrollable. - * @return {Boolean} - */ + isScrollable : function(){ var dom = this.dom; return dom.scrollHeight > dom.clientHeight || dom.scrollWidth > dom.clientWidth; }, - /** - * Scrolls this element the specified scroll point. It does NOT do bounds checking so if you scroll to a weird value it will try to do it. For auto bounds checking, use scroll(). - * @param {String} side Either "left" for scrollLeft values or "top" for scrollTop values. - * @param {Number} value The new scroll value. - * @return {Element} this - */ + scrollTo : function(side, value){ this.dom["scroll" + (/top/i.test(side) ? "Top" : "Left")] = value; return this; }, - /** - * Returns the current scroll position of the element. - * @return {Object} An object containing the scroll position in the format {left: (scrollLeft), top: (scrollTop)} - */ + getScroll : function(){ var d = this.dom, doc = document, @@ -7102,40 +4996,26 @@ Ext.Element.addMethods({ } return ret; } -});/** - * @class Ext.Element - */ +}); Ext.Element.addMethods({ - /** - * Scrolls this element the specified scroll point. It does NOT do bounds checking so if you scroll to a weird value it will try to do it. For auto bounds checking, use scroll(). - * @param {String} side Either "left" for scrollLeft values or "top" for scrollTop values. - * @param {Number} value The new scroll value - * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object - * @return {Element} this - */ + scrollTo : function(side, value, animate){ - var top = /top/i.test(side), //check if we're scrolling top or left + var top = /top/i.test(side), me = this, dom = me.dom, prop; if (!animate || !me.anim) { - prop = 'scroll' + (top ? 'Top' : 'Left'), // just setting the value, so grab the direction + prop = 'scroll' + (top ? 'Top' : 'Left'), dom[prop] = value; }else{ - prop = 'scroll' + (top ? 'Left' : 'Top'), // if scrolling top, we need to grab scrollLeft, if left, scrollTop + prop = 'scroll' + (top ? 'Left' : 'Top'), me.anim({scroll: {to: top ? [dom[prop], value] : [value, dom[prop]]}}, me.preanim(arguments, 2), 'scroll'); } return me; }, - /** - * Scrolls this element into view within the passed container. - * @param {Mixed} container (optional) The container element to scroll (defaults to document.body). Should be a - * string (id), dom node, or Ext.Element. - * @param {Boolean} hscroll (optional) False to disable horizontal scroll (defaults to true) - * @return {Ext.Element} this - */ + scrollIntoView : function(container, hscroll){ var c = Ext.getDom(container) || Ext.getBody().dom, el = this.dom, @@ -7155,7 +5035,7 @@ Ext.Element.addMethods({ } else if (b > cb){ c.scrollTop = b-ch; } - c.scrollTop = c.scrollTop; // corrects IE, other browsers will ignore + c.scrollTop = c.scrollTop; if(hscroll !== false){ if(el.offsetWidth > c.clientWidth || l < cl){ @@ -7168,20 +5048,12 @@ Ext.Element.addMethods({ return this; }, - // private + scrollChildIntoView : function(child, hscroll){ Ext.fly(child, '_scrollChildIntoView').scrollIntoView(this, hscroll); }, - /** - * Scrolls this element the specified direction. Does bounds checking to make sure the scroll is - * within this element's scrollable range. - * @param {String} direction Possible values are: "l" (or "left"), "r" (or "right"), "t" (or "top", or "up"), "b" (or "bottom", or "down"). - * @param {Number} distance How far to scroll the element in pixels - * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object - * @return {Boolean} Returns true if a scroll was triggered or false if the element - * was scrolled as far as it could go. - */ + scroll : function(direction, distance, animate){ if(!this.isScrollable()){ return; @@ -7207,20 +5079,10 @@ Ext.Element.addMethods({ } return scrolled; } -});/** - * @class Ext.Element - */ -/** - * Visibility mode constant for use with {@link #setVisibilityMode}. Use visibility to hide element - * @static - * @type Number - */ +}); + Ext.Element.VISIBILITY = 1; -/** - * Visibility mode constant for use with {@link #setVisibilityMode}. Use display to hide element - * @static - * @type Number - */ + Ext.Element.DISPLAY = 2; Ext.Element.addMethods(function(){ @@ -7249,154 +5111,23 @@ Ext.Element.addMethods(function(){ }; return { - /** - * The element's default display mode (defaults to "") - * @type String - */ + originalDisplay : "", visibilityMode : 1, - /** - * Sets the element's visibility mode. When setVisible() is called it - * will use this to determine whether to set the visibility or the display property. - * @param {Number} visMode Ext.Element.VISIBILITY or Ext.Element.DISPLAY - * @return {Ext.Element} this - */ + setVisibilityMode : function(visMode){ data(this.dom, VISMODE, visMode); return this; }, - /** - * Perform custom animation on this element. - *
        - *
      • Animation Properties
      • - * - *

        The Animation Control Object enables gradual transitions for any member of an - * element's style object that takes a numeric value including but not limited to - * these properties:

          - *
        • bottom, top, left, right
        • - *
        • height, width
        • - *
        • margin, padding
        • - *
        • borderWidth
        • - *
        • opacity
        • - *
        • fontSize
        • - *
        • lineHeight
        • - *
        - * - * - *
      • Animation Property Attributes
      • - * - *

        Each Animation Property is a config object with optional properties:

        - *
          - *
        • by* : relative change - start at current value, change by this value
        • - *
        • from : ignore current value, start from this value
        • - *
        • to* : start at current value, go to this value
        • - *
        • unit : any allowable unit specification
        • - *

          * do not specify both to and by for an animation property

          - *
        - * - *
      • Animation Types
      • - * - *

        The supported animation types:

          - *
        • 'run' : Default - *
          
          -var el = Ext.get('complexEl');
          -el.animate(
          -    // animation control object
          -    {
          -        borderWidth: {to: 3, from: 0},
          -        opacity: {to: .3, from: 1},
          -        height: {to: 50, from: el.getHeight()},
          -        width: {to: 300, from: el.getWidth()},
          -        top  : {by: - 100, unit: 'px'},
          -    },
          -    0.35,      // animation duration
          -    null,      // callback
          -    'easeOut', // easing method
          -    'run'      // animation type ('run','color','motion','scroll')
          -);
          -         * 
          - *
        • - *
        • 'color' - *

          Animates transition of background, text, or border colors.

          - *
          
          -el.animate(
          -    // animation control object
          -    {
          -        color: { to: '#06e' },
          -        backgroundColor: { to: '#e06' }
          -    },
          -    0.35,      // animation duration
          -    null,      // callback
          -    'easeOut', // easing method
          -    'color'    // animation type ('run','color','motion','scroll')
          -);
          -         * 
          - *
        • - * - *
        • 'motion' - *

          Animates the motion of an element to/from specific points using optional bezier - * way points during transit.

          - *
          
          -el.animate(
          -    // animation control object
          -    {
          -        borderWidth: {to: 3, from: 0},
          -        opacity: {to: .3, from: 1},
          -        height: {to: 50, from: el.getHeight()},
          -        width: {to: 300, from: el.getWidth()},
          -        top  : {by: - 100, unit: 'px'},
          -        points: {
          -            to: [50, 100],  // go to this point
          -            control: [      // optional bezier way points
          -                [ 600, 800],
          -                [-100, 200]
          -            ]
          -        }
          -    },
          -    3000,      // animation duration (milliseconds!)
          -    null,      // callback
          -    'easeOut', // easing method
          -    'motion'   // animation type ('run','color','motion','scroll')
          -);
          -         * 
          - *
        • - *
        • 'scroll' - *

          Animate horizontal or vertical scrolling of an overflowing page element.

          - *
          
          -el.animate(
          -    // animation control object
          -    {
          -        scroll: {to: [400, 300]}
          -    },
          -    0.35,      // animation duration
          -    null,      // callback
          -    'easeOut', // easing method
          -    'scroll'   // animation type ('run','color','motion','scroll')
          -);
          -         * 
          - *
        • - *
        - * - *
      - * - * @param {Object} args The animation control args - * @param {Float} duration (optional) How long the animation lasts in seconds (defaults to .35) - * @param {Function} onComplete (optional) Function to call when animation completes - * @param {String} easing (optional) {@link Ext.Fx#easing} method to use (defaults to 'easeOut') - * @param {String} animType (optional) 'run' is the default. Can also be 'color', - * 'motion', or 'scroll' - * @return {Ext.Element} this - */ + animate : function(args, duration, onComplete, easing, animType){ this.anim(args, {duration: duration, callback: onComplete, easing: easing}, animType); return this; }, - /* - * @private Internal animation call - */ + anim : function(args, opt, animType, defaultDur, defaultEase, cb){ animType = animType || 'run'; opt = opt || {}; @@ -7416,32 +5147,23 @@ el.animate( return anim; }, - // private legacy anim prep + preanim : function(a, i){ - return !a[i] ? false : (Ext.isObject(a[i]) ? a[i]: {duration: a[i+1], callback: a[i+2], easing: a[i+3]}); + return !a[i] ? false : (typeof a[i] == 'object' ? a[i]: {duration: a[i+1], callback: a[i+2], easing: a[i+3]}); }, - /** - * Checks whether the element is currently visible using both visibility and display properties. - * @return {Boolean} True if the element is currently visible, else false - */ + isVisible : function() { return !this.isStyle(VISIBILITY, HIDDEN) && !this.isStyle(DISPLAY, NONE); }, - /** - * Sets the visibility of the element (see details). If the visibilityMode is set to Element.DISPLAY, it will use - * the display property to hide the element, otherwise it uses visibility. The default is to hide and show using the visibility property. - * @param {Boolean} visible Whether the element is visible - * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object - * @return {Ext.Element} this - */ + setVisible : function(visible, animate){ var me = this, isDisplay, isVisible, isOffsets, dom = me.dom; - // hideMode string override - if (Ext.isString(animate)){ + + if (typeof animate == 'string'){ isDisplay = animate == DISPLAY; isVisible = animate == VISIBILITY; isOffsets = animate == OFFSETS; @@ -7471,7 +5193,7 @@ el.animate( dom.style.visibility = visible ? "visible" : HIDDEN; } }else{ - // closure for composites + if (visible){ me.setOpacity(.01); me.setVisible(true); @@ -7491,22 +5213,14 @@ el.animate( return me; }, - /** - * Toggles the element's visibility or display, depending on visibility mode. - * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object - * @return {Ext.Element} this - */ + toggle : function(animate){ var me = this; me.setVisible(!me.isVisible(), me.preanim(arguments, 0)); return me; }, - /** - * Sets the CSS display property. Uses originalDisplay if the specified value is a boolean true. - * @param {Mixed} value Boolean value to display the element using its default display, or a string to set the display directly. - * @return {Ext.Element} this - */ + setDisplayed : function(value) { if(typeof value == "boolean"){ value = value ? getDisplay(this.dom) : NONE; @@ -7515,26 +5229,22 @@ el.animate( return this; }, - // private + fixDisplay : function(){ var me = this; if(me.isStyle(DISPLAY, NONE)){ me.setStyle(VISIBILITY, HIDDEN); - me.setStyle(DISPLAY, getDisplay(this.dom)); // first try reverting to default - if(me.isStyle(DISPLAY, NONE)){ // if that fails, default to block + me.setStyle(DISPLAY, getDisplay(this.dom)); + if(me.isStyle(DISPLAY, NONE)){ me.setStyle(DISPLAY, "block"); } } }, - /** - * Hide this element - Uses display mode to determine whether to use "display" or "visibility". See {@link #setVisible}. - * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object - * @return {Ext.Element} this - */ + hide : function(animate){ - // hideMode override - if (Ext.isString(animate)){ + + if (typeof animate == 'string'){ this.setVisible(false, animate); return this; } @@ -7542,14 +5252,10 @@ el.animate( return this; }, - /** - * Show this element - Uses display mode to determine whether to use "display" or "visibility". See {@link #setVisible}. - * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object - * @return {Ext.Element} this - */ + show : function(animate){ - // hideMode override - if (Ext.isString(animate)){ + + if (typeof animate == 'string'){ this.setVisible(true, animate); return this; } @@ -7557,9 +5263,8 @@ el.animate( return this; } }; -}());/** - * @class Ext.Element - */ +}()); + Ext.Element.addMethods( function(){ var VISIBILITY = "visibility", @@ -7571,11 +5276,7 @@ function(){ data = Ext.Element.data; return { - /** - * Checks whether the element is currently visible using both visibility and display properties. - * @param {Boolean} deep (optional) True to walk the dom and see if parent elements are hidden (defaults to false) - * @return {Boolean} True if the element is currently visible, else false - */ + isVisible : function(deep) { var vis = !this.isStyle(VISIBILITY,HIDDEN) && !this.isStyle(DISPLAY,NONE), p = this.dom.parentNode; @@ -7591,19 +5292,12 @@ function(){ return true; }, - /** - * Returns true if display is not "none" - * @return {Boolean} - */ + isDisplayed : function() { return !this.isStyle(DISPLAY, NONE); }, - /** - * Convenience method for setVisibilityMode(Element.DISPLAY) - * @param {String} display (optional) What to set display to when visible - * @return {Ext.Element} this - */ + enableDisplayMode : function(display){ this.setVisibilityMode(Ext.Element.DISPLAY); if(!Ext.isEmpty(display)){ @@ -7612,13 +5306,7 @@ function(){ return this; }, - /** - * Puts a mask over this element to disable user interaction. Requires core.css. - * This method can only be applied to elements which accept child nodes. - * @param {String} msg (optional) A message to display in the mask - * @param {String} msgCls (optional) A css class to apply to the msg element - * @return {Element} The mask element - */ + mask : function(msg, msgCls){ var me = this, dom = me.dom, @@ -7650,15 +5338,13 @@ function(){ mm.setDisplayed(true); mm.center(me); } - if(Ext.isIE && !(Ext.isIE7 && Ext.isStrict) && me.getStyle('height') == 'auto'){ // ie will not expand full height automatically + if(Ext.isIE && !(Ext.isIE7 && Ext.isStrict) && me.getStyle('height') == 'auto'){ mask.setSize(undefined, me.getHeight()); } return mask; }, - /** - * Removes a previously applied mask. - */ + unmask : function(){ var me = this, dom = me.dom, @@ -7675,20 +5361,13 @@ function(){ me.removeClass([XMASKED, XMASKEDRELATIVE]); }, - /** - * Returns true if this element is masked - * @return {Boolean} - */ + isMasked : function(){ var m = data(this.dom, 'mask'); return m && m.isVisible(); }, - /** - * Creates an iframe shim for this element to keep selects and other windowed objects from - * showing through. - * @return {Ext.Element} The new shim element - */ + createShim : function(){ var el = document.createElement('iframe'), shim; @@ -7700,21 +5379,12 @@ function(){ return shim; } }; -}());/** - * @class Ext.Element - */ +}()); Ext.Element.addMethods({ - /** - * Convenience method for constructing a KeyMap - * @param {Number/Array/Object/String} key Either a string with the keys to listen for, the numeric key code, array of key codes or an object with the following options: - * {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)} - * @param {Function} fn The function to call - * @param {Object} scope (optional) The scope (this reference) in which the specified function is executed. Defaults to this Element. - * @return {Ext.KeyMap} The KeyMap created - */ + addKeyListener : function(key, fn, scope){ var config; - if(!Ext.isObject(key) || Ext.isArray(key)){ + if(typeof key != 'object' || Ext.isArray(key)){ config = { key: key, fn: fn, @@ -7733,16 +5403,13 @@ Ext.Element.addMethods({ return new Ext.KeyMap(this, config); }, - /** - * Creates a KeyMap for this element - * @param {Object} config The KeyMap config. See {@link Ext.KeyMap} for more details - * @return {Ext.KeyMap} The KeyMap created - */ + addKeyMap : function(config){ return new Ext.KeyMap(this, config); } -});(function(){ - // contants +}); +(function(){ + var NULL = null, UNDEFINED = undefined, TRUE = true, @@ -7763,9 +5430,7 @@ Ext.Element.addMethods({ MOTION = "motion", POSITION = "position", EASEOUT = "easeOut", - /* - * Use a light flyweight here since we are using so many callbacks and are always assured a DOM element - */ + flyEl = new Ext.Element.Flyweight(), queues = {}, getObject = function(o){ @@ -7776,9 +5441,7 @@ Ext.Element.addMethods({ flyEl.id = Ext.id(dom); return flyEl; }, - /* - * Queueing now stored outside of the element due to closure issues - */ + getQueue = function(id){ if(!queues[id]){ queues[id] = []; @@ -7789,117 +5452,19 @@ Ext.Element.addMethods({ queues[id] = value; }; -//Notifies Element that fx methods are available + Ext.enableFx = TRUE; -/** - * @class Ext.Fx - *

      A class to provide basic animation and visual effects support. Note: This class is automatically applied - * to the {@link Ext.Element} interface when included, so all effects calls should be performed via {@link Ext.Element}. - * Conversely, since the effects are not actually defined in {@link Ext.Element}, Ext.Fx must be - * {@link Ext#enableFx included} in order for the Element effects to work.


      - * - *

      Method Chaining

      - *

      It is important to note that although the Fx methods and many non-Fx Element methods support "method chaining" in that - * they return the Element object itself as the method return value, it is not always possible to mix the two in a single - * method chain. The Fx methods use an internal effects queue so that each effect can be properly timed and sequenced. - * Non-Fx methods, on the other hand, have no such internal queueing and will always execute immediately. For this reason, - * while it may be possible to mix certain Fx and non-Fx method calls in a single chain, it may not always provide the - * expected results and should be done with care. Also see {@link #callback}.


      - * - *

      Anchor Options for Motion Effects

      - *

      Motion effects support 8-way anchoring, meaning that you can choose one of 8 different anchor points on the Element - * that will serve as either the start or end point of the animation. Following are all of the supported anchor positions:

      -
      -Value  Description
      ------  -----------------------------
      -tl     The top left corner
      -t      The center of the top edge
      -tr     The top right corner
      -l      The center of the left edge
      -r      The center of the right edge
      -bl     The bottom left corner
      -b      The center of the bottom edge
      -br     The bottom right corner
      -
      - * Note: some Fx methods accept specific custom config parameters. The options shown in the Config Options - * section below are common options that can be passed to any Fx method unless otherwise noted. - * - * @cfg {Function} callback A function called when the effect is finished. Note that effects are queued internally by the - * Fx class, so a callback is not required to specify another effect -- effects can simply be chained together - * and called in sequence (see note for Method Chaining above), for example:
      
      - * el.slideIn().highlight();
      - * 
      - * The callback is intended for any additional code that should run once a particular effect has completed. The Element - * being operated upon is passed as the first parameter. - * - * @cfg {Object} scope The scope (this reference) in which the {@link #callback} function is executed. Defaults to the browser window. - * - * @cfg {String} easing A valid Ext.lib.Easing value for the effect:

        - *
      • backBoth
      • - *
      • backIn
      • - *
      • backOut
      • - *
      • bounceBoth
      • - *
      • bounceIn
      • - *
      • bounceOut
      • - *
      • easeBoth
      • - *
      • easeBothStrong
      • - *
      • easeIn
      • - *
      • easeInStrong
      • - *
      • easeNone
      • - *
      • easeOut
      • - *
      • easeOutStrong
      • - *
      • elasticBoth
      • - *
      • elasticIn
      • - *
      • elasticOut
      • - *
      - * - * @cfg {String} afterCls A css class to apply after the effect - * @cfg {Number} duration The length of time (in seconds) that the effect should last - * - * @cfg {Number} endOpacity Only applicable for {@link #fadeIn} or {@link #fadeOut}, a number between - * 0 and 1 inclusive to configure the ending opacity value. - * - * @cfg {Boolean} remove Whether the Element should be removed from the DOM and destroyed after the effect finishes - * @cfg {Boolean} useDisplay Whether to use the display CSS property instead of visibility when hiding Elements (only applies to - * effects that end with the element being visually hidden, ignored otherwise) - * @cfg {String/Object/Function} afterStyle A style specification string, e.g. "width:100px", or an object - * in the form {width:"100px"}, or a function which returns such a specification that will be applied to the - * Element after the effect finishes. - * @cfg {Boolean} block Whether the effect should block other effects from queueing while it runs - * @cfg {Boolean} concurrent Whether to allow subsequently-queued effects to run at the same time as the current effect, or to ensure that they run in sequence - * @cfg {Boolean} stopFx Whether preceding effects should be stopped and removed before running current effect (only applies to non blocking effects) - */ + Ext.Fx = { - // private - calls the function taking arguments from the argHash based on the key. Returns the return value of the function. - // this is useful for replacing switch statements (for example). + + switchStatements : function(key, fn, argHash){ return fn.apply(this, argHash[key]); }, - /** - * Slides the element into view. An anchor point can be optionally passed to set the point of - * origin for the slide effect. This function automatically handles wrapping the element with - * a fixed-size container if needed. See the Fx class overview for valid anchor point options. - * Usage: - *
      
      -// default: slide the element in from the top
      -el.slideIn();
      -
      -// custom: slide the element in from the right with a 2-second duration
      -el.slideIn('r', { duration: 2 });
      -
      -// common config options shown with default values
      -el.slideIn('t', {
      -    easing: 'easeOut',
      -    duration: .5
      -});
      -
      - * @param {String} anchor (optional) One of the valid Fx anchor positions (defaults to top: 't') - * @param {Object} options (optional) Object literal with any of the Fx config options - * @return {Ext.Element} The Element - */ + slideIn : function(anchor, o){ o = getObject(o); var me = this, @@ -7920,25 +5485,25 @@ el.slideIn('t', { me.queueFx(o, function(){ xy = fly(dom).getXY(); - // fix display to visibility + fly(dom).fixDisplay(); - // restore values after effect + r = fly(dom).getFxRestore(); b = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: dom.offsetWidth, height: dom.offsetHeight}; b.right = b.x + b.width; b.bottom = b.y + b.height; - // fixed size for slide + fly(dom).setWidth(b.width).setHeight(b.height); - // wrap if needed + wrap = fly(dom).fxWrap(r.pos, o, HIDDEN); st.visibility = VISIBLE; st.position = ABSOLUTE; - // clear out temp styles after slide and unwrap + function after(){ fly(dom).fxUnwrap(wrap, r.pos, o); st.width = r.width; @@ -7946,7 +5511,7 @@ el.slideIn('t', { fly(dom).afterFx(o); } - // time to calculate the positions + pt = {to: [b.x, b.y]}; bw = {to: b.width}; bh = {to: b.height}; @@ -7994,32 +5559,7 @@ el.slideIn('t', { return me; }, - /** - * Slides the element out of view. An anchor point can be optionally passed to set the end point - * for the slide effect. When the effect is completed, the element will be hidden (visibility = - * 'hidden') but block elements will still take up space in the document. The element must be removed - * from the DOM using the 'remove' config option if desired. This function automatically handles - * wrapping the element with a fixed-size container if needed. See the Fx class overview for valid anchor point options. - * Usage: - *
      
      -// default: slide the element out to the top
      -el.slideOut();
      -
      -// custom: slide the element out to the right with a 2-second duration
      -el.slideOut('r', { duration: 2 });
      -
      -// common config options shown with default values
      -el.slideOut('t', {
      -    easing: 'easeOut',
      -    duration: .5,
      -    remove: false,
      -    useDisplay: false
      -});
      -
      - * @param {String} anchor (optional) One of the valid Fx anchor positions (defaults to top: 't') - * @param {Object} options (optional) Object literal with any of the Fx config options - * @return {Ext.Element} The Element - */ + slideOut : function(anchor, o){ o = getObject(o); var me = this, @@ -8036,16 +5576,16 @@ el.slideOut('t', { me.queueFx(o, function(){ - // restore values after effect + r = fly(dom).getFxRestore(); b = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: dom.offsetWidth, height: dom.offsetHeight}; b.right = b.x + b.width; b.bottom = b.y + b.height; - // fixed size for slide + fly(dom).setWidth(b.width).setHeight(b.height); - // wrap if needed + wrap = fly(dom).fxWrap(r.pos, o, VISIBLE); st.visibility = VISIBLE; @@ -8096,26 +5636,7 @@ el.slideOut('t', { return me; }, - /** - * Fades the element out while slowly expanding it in all directions. When the effect is completed, the - * element will be hidden (visibility = 'hidden') but block elements will still take up space in the document. - * The element must be removed from the DOM using the 'remove' config option if desired. - * Usage: - *
      
      -// default
      -el.puff();
      -
      -// common config options shown with default values
      -el.puff({
      -    easing: 'easeOut',
      -    duration: .5,
      -    remove: false,
      -    useDisplay: false
      -});
      -
      - * @param {Object} options (optional) Object literal with any of the Fx config options - * @return {Ext.Element} The Element - */ + puff : function(o){ o = getObject(o); var me = this, @@ -8131,7 +5652,7 @@ el.puff({ fly(dom).clearOpacity(); fly(dom).show(); - // restore values after effect + r = fly(dom).getFxRestore(); function after(){ @@ -8160,26 +5681,7 @@ el.puff({ return me; }, - /** - * Blinks the element as if it was clicked and then collapses on its center (similar to switching off a television). - * When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still - * take up space in the document. The element must be removed from the DOM using the 'remove' config option if desired. - * Usage: - *
      
      -// default
      -el.switchOff();
      -
      -// all config options shown with default values
      -el.switchOff({
      -    easing: 'easeIn',
      -    duration: .3,
      -    remove: false,
      -    useDisplay: false
      -});
      -
      - * @param {Object} options (optional) Object literal with any of the Fx config options - * @return {Ext.Element} The Element - */ + switchOff : function(o){ o = getObject(o); var me = this, @@ -8191,7 +5693,7 @@ el.switchOff({ fly(dom).clearOpacity(); fly(dom).clip(); - // restore values after effect + r = fly(dom).getFxRestore(); function after(){ @@ -8226,30 +5728,7 @@ el.switchOff({ return me; }, - /** - * Highlights the Element by setting a color (applies to the background-color by default, but can be - * changed using the "attr" config option) and then fading back to the original color. If no original - * color is available, you should provide the "endColor" config option which will be cleared after the animation. - * Usage: -
      
      -// default: highlight background to yellow
      -el.highlight();
      -
      -// custom: highlight foreground text to blue for 2 seconds
      -el.highlight("0000ff", { attr: 'color', duration: 2 });
      -
      -// common config options shown with default values
      -el.highlight("ffff9c", {
      -    attr: "background-color", //can be any valid CSS property (attribute) that supports a color value
      -    endColor: (current color) or "ffffff",
      -    easing: 'easeIn',
      -    duration: 1
      -});
      -
      - * @param {String} color (optional) The highlight color. Should be a 6 char hex color without the leading # (defaults to yellow: 'ffff9c') - * @param {Object} options (optional) Object literal with any of the Fx config options - * @return {Ext.Element} The Element - */ + highlight : function(color, o){ o = getObject(o); var me = this, @@ -8278,27 +5757,7 @@ el.highlight("ffff9c", { return me; }, - /** - * Shows a ripple of exploding, attenuating borders to draw attention to an Element. - * Usage: -
      
      -// default: a single light blue ripple
      -el.frame();
      -
      -// custom: 3 red ripples lasting 3 seconds total
      -el.frame("ff0000", 3, { duration: 3 });
      -
      -// common config options shown with default values
      -el.frame("C3DAF9", 1, {
      -    duration: 1 //duration of each individual ripple.
      -    // Note: Easing is not configurable and will be ignored if included
      -});
      -
      - * @param {String} color (optional) The color of the border. Should be a 6 char hex color without the leading # (defaults to light blue: 'C3DAF9'). - * @param {Number} count (optional) The number of ripples to display (defaults to 1) - * @param {Object} options (optional) Object literal with any of the Fx config options - * @return {Ext.Element} The Element - */ + frame : function(color, count, o){ o = getObject(o); var me = this, @@ -8320,7 +5779,7 @@ el.frame("C3DAF9", 1, { proxy = fly(document.body || document.documentElement).createChild({ style:{ position : ABSOLUTE, - 'z-index': 35000, // yee haw + 'z-index': 35000, border : '0px solid ' + color } }); @@ -8364,16 +5823,7 @@ el.frame("C3DAF9", 1, { return me; }, - /** - * Creates a pause before any subsequent queued effects begin. If there are - * no effects queued after the pause it will have no effect. - * Usage: -
      
      -el.pause(1);
      -
      - * @param {Number} seconds The length of time to pause (in seconds) - * @return {Ext.Element} The Element - */ + pause : function(seconds){ var dom = this.dom, t; @@ -8393,27 +5843,7 @@ el.pause(1); return this; }, - /** - * Fade an element in (from transparent to opaque). The ending opacity can be specified - * using the {@link #endOpacity} config option. - * Usage: -
      
      -// default: fade in from opacity 0 to 100%
      -el.fadeIn();
      -
      -// custom: fade in from opacity 0 to 75% over 2 seconds
      -el.fadeIn({ endOpacity: .75, duration: 2});
      -
      -// common config options shown with default values
      -el.fadeIn({
      -    endOpacity: 1, //can be any value between 0 and 1 (e.g. .5)
      -    easing: 'easeOut',
      -    duration: .5
      -});
      -
      - * @param {Object} options (optional) Object literal with any of the Fx config options - * @return {Ext.Element} The Element - */ + fadeIn : function(o){ o = getObject(o); var me = this, @@ -8435,30 +5865,7 @@ el.fadeIn({ return me; }, - /** - * Fade an element out (from opaque to transparent). The ending opacity can be specified - * using the {@link #endOpacity} config option. Note that IE may require - * {@link #useDisplay}:true in order to redisplay correctly. - * Usage: -
      
      -// default: fade out from the element's current opacity to 0
      -el.fadeOut();
      -
      -// custom: fade out from the element's current opacity to 25% over 2 seconds
      -el.fadeOut({ endOpacity: .25, duration: 2});
      -
      -// common config options shown with default values
      -el.fadeOut({
      -    endOpacity: 0, //can be any value between 0 and 1 (e.g. .5)
      -    easing: 'easeOut',
      -    duration: .5,
      -    remove: false,
      -    useDisplay: false
      -});
      -
      - * @param {Object} options (optional) Object literal with any of the Fx config options - * @return {Ext.Element} The Element - */ + fadeOut : function(o){ o = getObject(o); var me = this, @@ -8487,29 +5894,7 @@ el.fadeOut({ return me; }, - /** - * Animates the transition of an element's dimensions from a starting height/width - * to an ending height/width. This method is a convenience implementation of {@link shift}. - * Usage: -
      
      -// change height and width to 100x100 pixels
      -el.scale(100, 100);
      -
      -// common config options shown with default values.  The height and width will default to
      -// the element's existing values if passed as null.
      -el.scale(
      -    [element's width],
      -    [element's height], {
      -        easing: 'easeOut',
      -        duration: .35
      -    }
      -);
      -
      - * @param {Number} width The new width (pass undefined to keep the original width) - * @param {Number} height The new height (pass undefined to keep the original height) - * @param {Object} options (optional) Object literal with any of the Fx config options - * @return {Ext.Element} The Element - */ + scale : function(w, h, o){ this.shift(Ext.apply({}, o, { width: w, @@ -8518,30 +5903,7 @@ el.scale( return this; }, - /** - * Animates the transition of any combination of an element's dimensions, xy position and/or opacity. - * Any of these properties not specified in the config object will not be changed. This effect - * requires that at least one new dimension, position or opacity setting must be passed in on - * the config object in order for the function to have any effect. - * Usage: -
      
      -// slide the element horizontally to x position 200 while changing the height and opacity
      -el.shift({ x: 200, height: 50, opacity: .8 });
      -
      -// common config options shown with default values.
      -el.shift({
      -    width: [element's width],
      -    height: [element's height],
      -    x: [element's x position],
      -    y: [element's y position],
      -    opacity: [element's opacity],
      -    easing: 'easeOut',
      -    duration: .35
      -});
      -
      - * @param {Object} options Object literal with any of the Fx config options - * @return {Ext.Element} The Element - */ + shift : function(o){ o = getObject(o); var dom = this.dom, @@ -8575,29 +5937,7 @@ el.shift({ return this; }, - /** - * Slides the element while fading it out of view. An anchor point can be optionally passed to set the - * ending point of the effect. - * Usage: - *
      
      -// default: slide the element downward while fading out
      -el.ghost();
      -
      -// custom: slide the element out to the right with a 2-second duration
      -el.ghost('r', { duration: 2 });
      -
      -// common config options shown with default values
      -el.ghost('b', {
      -    easing: 'easeOut',
      -    duration: .5,
      -    remove: false,
      -    useDisplay: false
      -});
      -
      - * @param {String} anchor (optional) One of the valid Fx anchor positions (defaults to bottom: 'b') - * @param {Object} options (optional) Object literal with any of the Fx config options - * @return {Ext.Element} The Element - */ + ghost : function(anchor, o){ o = getObject(o); var me = this, @@ -8612,7 +5952,7 @@ el.ghost('b', { anchor = anchor || "b"; me.queueFx(o, function(){ - // restore values after effect + r = fly(dom).getFxRestore(); w = fly(dom).getWidth(); h = fly(dom).getHeight(); @@ -8646,11 +5986,7 @@ el.ghost('b', { return me; }, - /** - * Ensures that all effects queued after syncFx is called on the element are - * run concurrently. This is the opposite of {@link #sequenceFx}. - * @return {Ext.Element} The Element - */ + syncFx : function(){ var me = this; me.fxDefaults = Ext.apply(me.fxDefaults || {}, { @@ -8661,11 +5997,7 @@ el.ghost('b', { return me; }, - /** - * Ensures that all effects queued after sequenceFx is called on the element are - * run in sequence. This is the opposite of {@link #syncFx}. - * @return {Ext.Element} The Element - */ + sequenceFx : function(){ var me = this; me.fxDefaults = Ext.apply(me.fxDefaults || {}, { @@ -8676,7 +6008,7 @@ el.ghost('b', { return me; }, - /* @private */ + nextFx : function(){ var ef = getQueue(this.dom.id)[0]; if(ef){ @@ -8684,19 +6016,12 @@ el.ghost('b', { } }, - /** - * Returns true if the element has any effects actively running or queued, else returns false. - * @return {Boolean} True if element has active effects, else false - */ + hasActiveFx : function(){ return getQueue(this.dom.id)[0]; }, - /** - * Stops any running effects and clears the element's internal effects queue if it contains - * any additional effects that haven't started yet. - * @return {Ext.Element} The Element - */ + stopFx : function(finish){ var me = this, id = me.dom.id; @@ -8704,7 +6029,7 @@ el.ghost('b', { var cur = getQueue(id)[0]; if(cur && cur.anim){ if(cur.anim.isAnimated){ - setQueue(id, [cur]); //clear + setQueue(id, [cur]); cur.anim.stop(finish !== undefined ? finish : TRUE); }else{ setQueue(id, []); @@ -8714,7 +6039,7 @@ el.ghost('b', { return me; }, - /* @private */ + beforeFx : function(o){ if(this.hasActiveFx() && !o.concurrent){ if(o.stopFx){ @@ -8726,19 +6051,13 @@ el.ghost('b', { return TRUE; }, - /** - * Returns true if the element is currently blocking so that no other effect can be queued - * until this effect is finished, else returns false if blocking is not set. This is commonly - * used to ensure that an effect initiated by a user action runs to completion prior to the - * same effect being restarted (e.g., firing only one effect even if the user clicks several times). - * @return {Boolean} True if blocking, else false - */ + hasFxBlock : function(){ var q = getQueue(this.dom.id); return q && q[0] && q[0].block; }, - /* @private */ + queueFx : function(o, fn){ var me = fly(this.dom); if(!me.hasFxBlock()){ @@ -8757,7 +6076,7 @@ el.ghost('b', { return me; }, - /* @private */ + fxWrap : function(pos, o, vis){ var dom = this.dom, wrap, @@ -8783,7 +6102,7 @@ el.ghost('b', { return wrap; }, - /* @private */ + fxUnwrap : function(wrap, pos, o){ var dom = this.dom; fly(dom).clearPositioning(); @@ -8795,13 +6114,13 @@ el.ghost('b', { } }, - /* @private */ + getFxRestore : function(){ var st = this.dom.style; return {pos: this.getPositioning(), width: st.width, height : st.height}; }, - /* @private */ + afterFx : function(o){ var dom = this.dom, id = dom.id; @@ -8823,7 +6142,7 @@ el.ghost('b', { } }, - /* @private */ + fxanim : function(args, opt, animType, defaultDur, defaultEase, cb){ animType = animType || 'run'; opt = opt || {}; @@ -8840,119 +6159,70 @@ el.ghost('b', { } }; -// backwards compat + Ext.Fx.resize = Ext.Fx.scale; -//When included, Ext.Fx is automatically applied to Element so that all basic -//effects are available directly via the Element API + + Ext.Element.addMethods(Ext.Fx); })(); -/** - * @class Ext.CompositeElementLite - *

      This class encapsulates a collection of DOM elements, providing methods to filter - * members, or to perform collective actions upon the whole set.

      - *

      Although they are not listed, this class supports all of the methods of {@link Ext.Element} and - * {@link Ext.Fx}. The methods from these classes will be performed on all the elements in this collection.

      - * Example:
      
      -var els = Ext.select("#some-el div.some-class");
      -// or select directly from an existing element
      -var el = Ext.get('some-el');
      -el.select('div.some-class');
      -
      -els.setWidth(100); // all elements become 100 width
      -els.hide(true); // all elements fade out and hide
      -// or
      -els.setWidth(100).hide(true);
      -
      - */
      +
       Ext.CompositeElementLite = function(els, root){
      -    /**
      -     * 

      The Array of DOM elements which this CompositeElement encapsulates. Read-only.

      - *

      This will not usually be accessed in developers' code, but developers wishing - * to augment the capabilities of the CompositeElementLite class may use it when adding - * methods to the class.

      - *

      For example to add the nextAll method to the class to add all - * following siblings of selected elements, the code would be

      -Ext.override(Ext.CompositeElementLite, {
      -    nextAll: function() {
      -        var els = this.elements, i, l = els.length, n, r = [], ri = -1;
      -
      -//      Loop through all elements in this Composite, accumulating
      -//      an Array of all siblings.
      -        for (i = 0; i < l; i++) {
      -            for (n = els[i].nextSibling; n; n = n.nextSibling) {
      -                r[++ri] = n;
      -            }
      -        }
      -
      -//      Add all found siblings to this Composite
      -        return this.add(r);
      -    }
      -});
      - * @type Array - * @property elements - */ + this.elements = []; this.add(els, root); this.el = new Ext.Element.Flyweight(); }; Ext.CompositeElementLite.prototype = { - isComposite: true, + isComposite: true, + - // private getElement : function(el){ - // Set the shared flyweight dom property to the current element + var e = this.el; e.dom = el; e.id = el.id; return e; }, + - // private transformElement : function(el){ return Ext.getDom(el); }, + - /** - * Returns the number of elements in this Composite. - * @return Number - */ getCount : function(){ return this.elements.length; - }, - /** - * Adds elements to this Composite object. - * @param {Mixed} els Either an Array of DOM elements to add, or another Composite object who's elements should be added. - * @return {CompositeElement} This Composite object. - */ + }, + add : function(els, root){ var me = this, elements = me.elements; if(!els){ return this; } - if(Ext.isString(els)){ + if(typeof els == "string"){ els = Ext.Element.selectorFunction(els, root); }else if(els.isComposite){ els = els.elements; }else if(!Ext.isIterable(els)){ els = [els]; } - + for(var i = 0, len = els.length; i < len; ++i){ elements.push(me.transformElement(els[i])); } return me; }, - + invoke : function(fn, args){ var me = this, els = me.elements, - len = els.length, - e, + len = els.length, + e, i; - + for(i = 0; i < len; i++) { e = els[i]; if(e){ @@ -8961,11 +6231,7 @@ Ext.CompositeElementLite.prototype = { } return me; }, - /** - * Returns a flyweight Element of the dom element object at the specified index - * @param {Number} index - * @return {Ext.Element} - */ + item : function(index){ var me = this, el = me.elements[index], @@ -8977,12 +6243,12 @@ Ext.CompositeElementLite.prototype = { return out; }, - // fixes scope with flyweight + addListener : function(eventName, handler, scope, opt){ var els = this.elements, len = els.length, i, e; - + for(i = 0; iCalls the passed function for each element in this composite.

      - * @param {Function} fn The function to call. The function is passed the following parameters:
        - *
      • el : Element
        The current Element in the iteration. - * This is the flyweight (shared) Ext.Element instance, so if you require a - * a reference to the dom node, use el.dom.
      • - *
      • c : Composite
        This Composite object.
      • - *
      • idx : Number
        The zero-based index in the iteration.
      • - *
      - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. (defaults to the Element) - * @return {CompositeElement} this - */ - each : function(fn, scope){ + + each : function(fn, scope){ var me = this, els = me.elements, len = els.length, i, e; - + for(i = 0; i - *
    • el : Ext.Element
      The current DOM element.
    • - *
    • index : Number
      The current index within the collection.
    • - *
    - * @return {CompositeElement} this - */ filter : function(selector){ var els = [], me = this, @@ -9050,8 +6293,8 @@ Ext.CompositeElementLite.prototype = { : function(el){ return el.is(selector); }; - - + + me.each(function(el, self, i){ if(fn(el, i) !== false){ els[els.length] = me.transformElement(el); @@ -9060,24 +6303,13 @@ Ext.CompositeElementLite.prototype = { me.elements = els; return me; }, + - /** - * Find the index of the passed element within the composite collection. - * @param el {Mixed} The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection. - * @return Number The index of the passed Ext.Element in the composite collection, or -1 if not found. - */ indexOf : function(el){ return this.elements.indexOf(this.transformElement(el)); }, + - /** - * Replaces the specified element with the passed element. - * @param {Mixed} el The id of an element, the Element itself, the index of the element in this composite - * to replace. - * @param {Mixed} replacement The id of an element or the Element itself. - * @param {Boolean} domReplace (Optional) True to remove and replace the element in the document too. - * @return {CompositeElement} this - */ replaceElement : function(el, replacement, domReplace){ var index = !isNaN(el) ? el : this.indexOf(el), d; @@ -9092,10 +6324,8 @@ Ext.CompositeElementLite.prototype = { } return this; }, + - /** - * Removes all elements. - */ clear : function(){ this.elements = []; } @@ -9107,33 +6337,24 @@ Ext.CompositeElementLite.prototype.on = Ext.CompositeElementLite.prototype.addLi var fnName, ElProto = Ext.Element.prototype, CelProto = Ext.CompositeElementLite.prototype; - + for(fnName in ElProto){ if(Ext.isFunction(ElProto[fnName])){ - (function(fnName){ + (function(fnName){ CelProto[fnName] = CelProto[fnName] || function(){ return this.invoke(fnName, arguments); }; }).call(CelProto, fnName); - + } } })(); if(Ext.DomQuery){ Ext.Element.selectorFunction = Ext.DomQuery.select; -} +} + -/** - * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods - * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or - * {@link Ext.CompositeElementLite CompositeElementLite} object. - * @param {String/Array} selector The CSS selector or an array of elements - * @param {HTMLElement/String} root (optional) The root element of the query or id of the root - * @return {CompositeElementLite/CompositeElement} - * @member Ext.Element - * @method select - */ Ext.Element.select = function(selector, root){ var els; if(typeof selector == "string"){ @@ -9145,166 +6366,86 @@ Ext.Element.select = function(selector, root){ } return new Ext.CompositeElementLite(els); }; -/** - * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods - * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or - * {@link Ext.CompositeElementLite CompositeElementLite} object. - * @param {String/Array} selector The CSS selector or an array of elements - * @param {HTMLElement/String} root (optional) The root element of the query or id of the root - * @return {CompositeElementLite/CompositeElement} - * @member Ext - * @method select - */ -Ext.select = Ext.Element.select;/** - * @class Ext.CompositeElementLite - */ -Ext.apply(Ext.CompositeElementLite.prototype, { - addElements : function(els, root){ + +Ext.select = Ext.Element.select; + +Ext.apply(Ext.CompositeElementLite.prototype, { + addElements : function(els, root){ if(!els){ return this; } if(typeof els == "string"){ els = Ext.Element.selectorFunction(els, root); } - var yels = this.elements; - Ext.each(els, function(e) { - yels.push(Ext.get(e)); + var yels = this.elements; + Ext.each(els, function(e) { + yels.push(Ext.get(e)); }); return this; }, + - /** - * Returns the first Element - * @return {Ext.Element} - */ first : function(){ return this.item(0); - }, + }, + - /** - * Returns the last Element - * @return {Ext.Element} - */ last : function(){ return this.item(this.getCount()-1); }, + - /** - * Returns true if this composite contains the passed element - * @param el {Mixed} The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection. - * @return Boolean - */ contains : function(el){ return this.indexOf(el) != -1; }, + - /** - * Removes the specified element(s). - * @param {Mixed} el The id of an element, the Element itself, the index of the element in this composite - * or an array of any of those. - * @param {Boolean} removeDom (optional) True to also remove the element from the document - * @return {CompositeElement} this - */ removeElement : function(keys, removeDom){ var me = this, - els = this.elements, - el; - Ext.each(keys, function(val){ - if ((el = (els[val] || els[val = me.indexOf(val)]))) { - if(removeDom){ + els = this.elements, + el; + Ext.each(keys, function(val){ + if ((el = (els[val] || els[val = me.indexOf(val)]))) { + if(removeDom){ if(el.dom){ el.remove(); }else{ Ext.removeNode(el); } } - els.splice(val, 1); - } - }); + els.splice(val, 1); + } + }); return this; - } + } }); -/** - * @class Ext.CompositeElement - * @extends Ext.CompositeElementLite - *

    This class encapsulates a collection of DOM elements, providing methods to filter - * members, or to perform collective actions upon the whole set.

    - *

    Although they are not listed, this class supports all of the methods of {@link Ext.Element} and - * {@link Ext.Fx}. The methods from these classes will be performed on all the elements in this collection.

    - *

    All methods return this and can be chained.

    - * Usage: -
    
    -var els = Ext.select("#some-el div.some-class", true);
    -// or select directly from an existing element
    -var el = Ext.get('some-el');
    -el.select('div.some-class', true);
    -
    -els.setWidth(100); // all elements become 100 width
    -els.hide(true); // all elements fade out and hide
    -// or
    -els.setWidth(100).hide(true);
    -
    - */ -Ext.CompositeElement = function(els, root){ - this.elements = []; - this.add(els, root); -}; -Ext.extend(Ext.CompositeElement, Ext.CompositeElementLite, { +Ext.CompositeElement = Ext.extend(Ext.CompositeElementLite, { + + constructor : function(els, root){ + this.elements = []; + this.add(els, root); + }, + - // private getElement : function(el){ - // In this case just return it, since we already have a reference to it + return el; }, - // private + transformElement : function(el){ return Ext.get(el); } - /** - * Adds elements to this composite. - * @param {String/Array} els A string CSS selector, an array of elements or an element - * @return {CompositeElement} this - */ + - /** - * Returns the Element object at the specified index - * @param {Number} index - * @return {Ext.Element} - */ + - /** - * Iterates each element in this composite - * calling the supplied function using {@link Ext#each}. - * @param {Function} fn The function to be called with each - * element. If the supplied function returns false, - * iteration stops. This function is called with the following arguments: - *
      - *
    • element : Ext.Element
      The element at the current index - * in the composite
    • - *
    • composite : Object
      This composite.
    • - *
    • index : Number
      The current index within the composite
    • - *
    - * @param {Object} scope (optional) The scope ( reference) in which the specified function is executed. - * Defaults to the element at the current index - * within the composite. - * @return {CompositeElement} this - */ + }); -/** - * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods - * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or - * {@link Ext.CompositeElementLite CompositeElementLite} object. - * @param {String/Array} selector The CSS selector or an array of elements - * @param {Boolean} unique (optional) true to create a unique Ext.Element for each element (defaults to a shared flyweight object) - * @param {HTMLElement/String} root (optional) The root element of the query or id of the root - * @return {CompositeElementLite/CompositeElement} - * @member Ext.Element - * @method select - */ + Ext.Element.select = function(selector, unique, root){ var els; if(typeof selector == "string"){ @@ -9318,17 +6459,7 @@ Ext.Element.select = function(selector, unique, root){ return (unique === true) ? new Ext.CompositeElement(els) : new Ext.CompositeElementLite(els); }; -/** - * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods - * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or - * {@link Ext.CompositeElementLite CompositeElementLite} object. - * @param {String/Array} selector The CSS selector or an array of elements - * @param {Boolean} unique (optional) true to create a unique Ext.Element for each element (defaults to a shared flyweight object) - * @param {HTMLElement/String} root (optional) The root element of the query or id of the root - * @return {CompositeElementLite/CompositeElement} - * @member Ext.Element - * @method select - */ + Ext.select = Ext.Element.select;(function(){ var BEFOREREQUEST = "beforerequest", REQUESTCOMPLETE = "requestcomplete", @@ -9339,213 +6470,37 @@ Ext.select = Ext.Element.select;(function(){ GET = 'GET', WINDOW = window; - /** - * @class Ext.data.Connection - * @extends Ext.util.Observable - *

    The class encapsulates a connection to the page's originating domain, allowing requests to be made - * either to a configured URL, or to a URL specified at request time.

    - *

    Requests made by this class are asynchronous, and will return immediately. No data from - * the server will be available to the statement immediately following the {@link #request} call. - * To process returned data, use a - * success callback - * in the request options object, - * or an {@link #requestcomplete event listener}.

    - *

    File Uploads

    File uploads are not performed using normal "Ajax" techniques, that - * is they are not performed using XMLHttpRequests. Instead the form is submitted in the standard - * manner with the DOM <form> element temporarily modified to have its - * target set to refer - * to a dynamically generated, hidden <iframe> which is inserted into the document - * but removed after the return data has been gathered.

    - *

    The server response is parsed by the browser to create the document for the IFRAME. If the - * server is using JSON to send the return object, then the - * Content-Type header - * must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.

    - *

    Characters which are significant to an HTML parser must be sent as HTML entities, so encode - * "<" as "&lt;", "&" as "&amp;" etc.

    - *

    The response text is retrieved from the document, and a fake XMLHttpRequest object - * is created containing a responseText property in order to conform to the - * requirements of event handlers and callbacks.

    - *

    Be aware that file upload packets are sent with the content type multipart/form - * and some server technologies (notably JEE) may require some custom processing in order to - * retrieve parameter names and parameter values from the packet content.

    - * @constructor - * @param {Object} config a configuration object. - */ + Ext.data.Connection = function(config){ Ext.apply(this, config); this.addEvents( - /** - * @event beforerequest - * Fires before a network request is made to retrieve a data object. - * @param {Connection} conn This Connection object. - * @param {Object} options The options config object passed to the {@link #request} method. - */ + BEFOREREQUEST, - /** - * @event requestcomplete - * Fires if the request was successfully completed. - * @param {Connection} conn This Connection object. - * @param {Object} response The XHR object containing the response data. - * See The XMLHttpRequest Object - * for details. - * @param {Object} options The options config object passed to the {@link #request} method. - */ + REQUESTCOMPLETE, - /** - * @event requestexception - * Fires if an error HTTP status was returned from the server. - * See HTTP Status Code Definitions - * for details of HTTP status codes. - * @param {Connection} conn This Connection object. - * @param {Object} response The XHR object containing the response data. - * See The XMLHttpRequest Object - * for details. - * @param {Object} options The options config object passed to the {@link #request} method. - */ + REQUESTEXCEPTION ); Ext.data.Connection.superclass.constructor.call(this); }; Ext.extend(Ext.data.Connection, Ext.util.Observable, { - /** - * @cfg {String} url (Optional)

    The default URL to be used for requests to the server. Defaults to undefined.

    - *

    The url config may be a function which returns the URL to use for the Ajax request. The scope - * (this reference) of the function is the scope option passed to the {@link #request} method.

    - */ - /** - * @cfg {Object} extraParams (Optional) An object containing properties which are used as - * extra parameters to each request made by this object. (defaults to undefined) - */ - /** - * @cfg {Object} defaultHeaders (Optional) An object containing request headers which are added - * to each request made by this object. (defaults to undefined) - */ - /** - * @cfg {String} method (Optional) The default HTTP method to be used for requests. - * (defaults to undefined; if not set, but {@link #request} params are present, POST will be used; - * otherwise, GET will be used.) - */ - /** - * @cfg {Number} timeout (Optional) The timeout in milliseconds to be used for requests. (defaults to 30000) - */ + + + + + timeout : 30000, - /** - * @cfg {Boolean} autoAbort (Optional) Whether this request should abort any pending requests. (defaults to false) - * @type Boolean - */ + autoAbort:false, - /** - * @cfg {Boolean} disableCaching (Optional) True to add a unique cache-buster param to GET requests. (defaults to true) - * @type Boolean - */ + disableCaching: true, - /** - * @cfg {String} disableCachingParam (Optional) Change the parameter which is sent went disabling caching - * through a cache buster. Defaults to '_dc' - * @type String - */ + disableCachingParam: '_dc', - /** - *

    Sends an HTTP request to a remote server.

    - *

    Important: Ajax server requests are asynchronous, and this call will - * return before the response has been received. Process any returned data - * in a callback function.

    - *
    
    -Ext.Ajax.request({
    -   url: 'ajax_demo/sample.json',
    -   success: function(response, opts) {
    -      var obj = Ext.decode(response.responseText);
    -      console.dir(obj);
    -   },
    -   failure: function(response, opts) {
    -      console.log('server-side failure with status code ' + response.status);
    -   }
    -});
    -         * 
    - *

    To execute a callback function in the correct scope, use the scope option.

    - * @param {Object} options An object which may contain the following properties:
      - *
    • url : String/Function (Optional)
      The URL to - * which to send the request, or a function to call which returns a URL string. The scope of the - * function is specified by the scope option. Defaults to the configured - * {@link #url}.
    • - *
    • params : Object/String/Function (Optional)
      - * An object containing properties which are used as parameters to the - * request, a url encoded string or a function to call to get either. The scope of the function - * is specified by the scope option.
    • - *
    • method : String (Optional)
      The HTTP method to use - * for the request. Defaults to the configured method, or if no method was configured, - * "GET" if no parameters are being sent, and "POST" if parameters are being sent. Note that - * the method name is case-sensitive and should be all caps.
    • - *
    • callback : Function (Optional)
      The - * function to be called upon receipt of the HTTP response. The callback is - * called regardless of success or failure and is passed the following - * parameters:
        - *
      • options : Object
        The parameter to the request call.
      • - *
      • success : Boolean
        True if the request succeeded.
      • - *
      • response : Object
        The XMLHttpRequest object containing the response data. - * See http://www.w3.org/TR/XMLHttpRequest/ for details about - * accessing elements of the response.
      • - *
    • - *
    • success : Function (Optional)
      The function - * to be called upon success of the request. The callback is passed the following - * parameters:
        - *
      • response : Object
        The XMLHttpRequest object containing the response data.
      • - *
      • options : Object
        The parameter to the request call.
      • - *
    • - *
    • failure : Function (Optional)
      The function - * to be called upon failure of the request. The callback is passed the - * following parameters:
        - *
      • response : Object
        The XMLHttpRequest object containing the response data.
      • - *
      • options : Object
        The parameter to the request call.
      • - *
    • - *
    • scope : Object (Optional)
      The scope in - * which to execute the callbacks: The "this" object for the callback function. If the url, or params options were - * specified as functions from which to draw values, then this also serves as the scope for those function calls. - * Defaults to the browser window.
    • - *
    • timeout : Number (Optional)
      The timeout in milliseconds to be used for this request. Defaults to 30 seconds.
    • - *
    • form : Element/HTMLElement/String (Optional)
      The <form> - * Element or the id of the <form> to pull parameters from.
    • - *
    • isUpload : Boolean (Optional)
      Only meaningful when used - * with the form option. - *

      True if the form object is a file upload (will be set automatically if the form was - * configured with enctype "multipart/form-data").

      - *

      File uploads are not performed using normal "Ajax" techniques, that is they are not - * performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the - * DOM <form> element temporarily modified to have its - * target set to refer - * to a dynamically generated, hidden <iframe> which is inserted into the document - * but removed after the return data has been gathered.

      - *

      The server response is parsed by the browser to create the document for the IFRAME. If the - * server is using JSON to send the return object, then the - * Content-Type header - * must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.

      - *

      The response text is retrieved from the document, and a fake XMLHttpRequest object - * is created containing a responseText property in order to conform to the - * requirements of event handlers and callbacks.

      - *

      Be aware that file upload packets are sent with the content type multipart/form - * and some server technologies (notably JEE) may require some custom processing in order to - * retrieve parameter names and parameter values from the packet content.

      - *
    • - *
    • headers : Object (Optional)
      Request - * headers to set for the request.
    • - *
    • xmlData : Object (Optional)
      XML document - * to use for the post. Note: This will be used instead of params for the post - * data. Any params will be appended to the URL.
    • - *
    • jsonData : Object/String (Optional)
      JSON - * data to use as the post. Note: This will be used instead of params for the post - * data. Any params will be appended to the URL.
    • - *
    • disableCaching : Boolean (Optional)
      True - * to add a unique cache-buster param to GET requests.
    • - *

    - *

    The options object may also contain any other property which might be needed to perform - * postprocessing in a callback because it is passed to callback functions.

    - * @return {Number} transactionId The id of the server transaction. This may be used - * to cancel the request. - */ + request : function(o){ var me = this; if(me.fireEvent(BEFOREREQUEST, me, o)){ @@ -9616,26 +6571,19 @@ Ext.Ajax.request({ } }, - /** - * Determine whether this object has a request outstanding. - * @param {Number} transactionId (Optional) defaults to the last transaction - * @return {Boolean} True if there is an outstanding request. - */ + isLoading : function(transId){ return transId ? Ext.lib.Ajax.isCallInProgress(transId) : !! this.transId; }, - /** - * Aborts any outstanding request. - * @param {Number} transactionId (Optional) defaults to the last transaction - */ + abort : function(transId){ if(transId || this.isLoading()){ Ext.lib.Ajax.abort(transId || this.transId); } }, - // private + handleResponse : function(response){ this.transId = false; var options = response.argument.options; @@ -9649,7 +6597,7 @@ Ext.Ajax.request({ } }, - // private + handleFailure : function(response, e){ this.transId = false; var options = response.argument.options; @@ -9663,7 +6611,7 @@ Ext.Ajax.request({ } }, - // private + doFormUpload : function(o, ps, url){ var id = Ext.id(), doc = document, @@ -9680,21 +6628,17 @@ Ext.Ajax.request({ action: form.action }; + Ext.fly(frame).set({ id: id, name: id, - cls: 'x-hidden' - - }); + cls: 'x-hidden', + src: Ext.SSL_SECURE_URL + }); doc.body.appendChild(frame); - //Reset the Frame to neutral domain - Ext.fly(frame).set({ - src : Ext.SSL_SECURE_URL - }); - - // This is required so that IE doesn't pop the response up in a new window. + if(Ext.isIE){ document.frames[id].name = id; } @@ -9708,7 +6652,7 @@ Ext.Ajax.request({ action: url || buf.action }); - // add dynamic params + Ext.iterate(Ext.urlDecode(ps, false), function(k, v){ hd = doc.createElement('input'); Ext.fly(hd).set({ @@ -9722,7 +6666,7 @@ Ext.Ajax.request({ function cb(){ var me = this, - // bogus response object + r = {responseText : '', responseXML : null, argument : o.argument}, @@ -9733,13 +6677,13 @@ Ext.Ajax.request({ doc = frame.contentWindow.document || frame.contentDocument || WINDOW.frames[id].document; if(doc){ if(doc.body){ - if(/textarea/i.test((firstChild = doc.body.firstChild || {}).tagName)){ // json response wrapped in textarea + if(/textarea/i.test((firstChild = doc.body.firstChild || {}).tagName)){ r.responseText = firstChild.value; }else{ r.responseText = doc.body.innerHTML; } } - //in IE the document may still have a body even if returns XML. + r.responseXML = doc.XMLDocument || doc; } } @@ -9774,188 +6718,45 @@ Ext.Ajax.request({ }); })(); -/** - * @class Ext.Ajax - * @extends Ext.data.Connection - *

    The global Ajax request class that provides a simple way to make Ajax requests - * with maximum flexibility.

    - *

    Since Ext.Ajax is a singleton, you can set common properties/events for it once - * and override them at the request function level only if necessary.

    - *

    Common Properties you may want to set are:

      - *
    • {@link #method}

    • - *
    • {@link #extraParams}

    • - *
    • {@link #url}

    • - *
    - *
    
    -// Default headers to pass in every request
    -Ext.Ajax.defaultHeaders = {
    -    'Powered-By': 'Ext'
    -};
    - * 
    - *

    - *

    Common Events you may want to set are:

      - *
    • {@link Ext.data.Connection#beforerequest beforerequest}

    • - *
    • {@link Ext.data.Connection#requestcomplete requestcomplete}

    • - *
    • {@link Ext.data.Connection#requestexception requestexception}

    • - *
    - *
    
    -// Example: show a spinner during all Ajax requests
    -Ext.Ajax.on('beforerequest', this.showSpinner, this);
    -Ext.Ajax.on('requestcomplete', this.hideSpinner, this);
    -Ext.Ajax.on('requestexception', this.hideSpinner, this);
    - * 
    - *

    - *

    An example request:

    - *
    
    -// Basic request
    -Ext.Ajax.{@link Ext.data.Connection#request request}({
    -   url: 'foo.php',
    -   success: someFn,
    -   failure: otherFn,
    -   headers: {
    -       'my-header': 'foo'
    -   },
    -   params: { foo: 'bar' }
    -});
     
    -// Simple ajax form submission
    -Ext.Ajax.{@link Ext.data.Connection#request request}({
    -    form: 'some-form',
    -    params: 'foo=bar'
    -});
    - * 
    - *

    - * @singleton - */ Ext.Ajax = new Ext.data.Connection({ - /** - * @cfg {String} url @hide - */ - /** - * @cfg {Object} extraParams @hide - */ - /** - * @cfg {Object} defaultHeaders @hide - */ - /** - * @cfg {String} method (Optional) @hide - */ - /** - * @cfg {Number} timeout (Optional) @hide - */ - /** - * @cfg {Boolean} autoAbort (Optional) @hide - */ + + + + + + - /** - * @cfg {Boolean} disableCaching (Optional) @hide - */ + - /** - * @property disableCaching - * True to add a unique cache-buster param to GET requests. (defaults to true) - * @type Boolean - */ - /** - * @property url - * The default URL to be used for requests to the server. (defaults to undefined) - * If the server receives all requests through one URL, setting this once is easier than - * entering it on every request. - * @type String - */ - /** - * @property extraParams - * An object containing properties which are used as extra parameters to each request made - * by this object (defaults to undefined). Session information and other data that you need - * to pass with each request are commonly put here. - * @type Object - */ - /** - * @property defaultHeaders - * An object containing request headers which are added to each request made by this object - * (defaults to undefined). - * @type Object - */ - /** - * @property method - * The default HTTP method to be used for requests. Note that this is case-sensitive and - * should be all caps (defaults to undefined; if not set but params are present will use - * "POST", otherwise will use "GET".) - * @type String - */ - /** - * @property timeout - * The timeout in milliseconds to be used for requests. (defaults to 30000) - * @type Number - */ + + + + + + - /** - * @property autoAbort - * Whether a new request should abort any pending requests. (defaults to false) - * @type Boolean - */ + autoAbort : false, - /** - * Serialize the passed form into a url encoded string - * @param {String/HTMLElement} form - * @return {String} - */ + serializeForm : function(form){ return Ext.lib.Ajax.serializeForm(form); } }); -/** - * @class Ext.Updater - * @extends Ext.util.Observable - * Provides AJAX-style update capabilities for Element objects. Updater can be used to {@link #update} - * an {@link Ext.Element} once, or you can use {@link #startAutoRefresh} to set up an auto-updating - * {@link Ext.Element Element} on a specific interval.

    - * Usage:
    - *
    
    - * var el = Ext.get("foo"); // Get Ext.Element object
    - * var mgr = el.getUpdater();
    - * mgr.update({
    -        url: "http://myserver.com/index.php",
    -        params: {
    -            param1: "foo",
    -            param2: "bar"
    -        }
    - * });
    - * ...
    - * mgr.formUpdate("myFormId", "http://myserver.com/index.php");
    - * 
    - * // or directly (returns the same Updater instance) - * var mgr = new Ext.Updater("myElementId"); - * mgr.startAutoRefresh(60, "http://myserver.com/index.php"); - * mgr.on("update", myFcnNeedsToKnow); - *
    - * // short handed call directly from the element object - * Ext.get("foo").load({ - url: "bar.php", - scripts: true, - params: "param1=foo&param2=bar", - text: "Loading Foo..." - * }); - *
    - * @constructor - * Create new Updater directly. - * @param {Mixed} el The element to update - * @param {Boolean} forceNew (optional) By default the constructor checks to see if the passed element already - * has an Updater and if it does it returns the same instance. This will skip that check (useful for extending this class). - */ + Ext.UpdateManager = Ext.Updater = Ext.extend(Ext.util.Observable, function() { var BEFOREUPDATE = "beforeupdate", UPDATE = "update", FAILURE = "failure"; - // private + function processSuccess(response){ var me = this; me.transaction = null; if (response.argument.form && response.argument.reset) { - try { // put in try/catch since some older FF releases had problems with this + try { response.argument.form.reset(); } catch(e){} } @@ -9968,7 +6769,7 @@ function() { } } - // private + function updateComplete(response, type, success){ this.fireEvent(type || UPDATE, this.el, response); if(Ext.isFunction(response.argument.callback)){ @@ -9976,7 +6777,7 @@ function() { } } - // private + function processFailure(response){ updateComplete.call(this, response, FAILURE, !!(this.transaction = null)); } @@ -9988,207 +6789,76 @@ function() { if(!forceNew && el.updateManager){ return el.updateManager; } - /** - * The Element object - * @type Ext.Element - */ + me.el = el; - /** - * Cached url to use for refreshes. Overwritten every time update() is called unless "discardUrl" param is set to true. - * @type String - */ + me.defaultUrl = null; me.addEvents( - /** - * @event beforeupdate - * Fired before an update is made, return false from your handler and the update is cancelled. - * @param {Ext.Element} el - * @param {String/Object/Function} url - * @param {String/Object} params - */ + BEFOREUPDATE, - /** - * @event update - * Fired after successful update is made. - * @param {Ext.Element} el - * @param {Object} oResponseObject The response Object - */ + UPDATE, - /** - * @event failure - * Fired on update failure. - * @param {Ext.Element} el - * @param {Object} oResponseObject The response Object - */ + FAILURE ); Ext.apply(me, Ext.Updater.defaults); - /** - * Blank page URL to use with SSL file uploads (defaults to {@link Ext.Updater.defaults#sslBlankUrl}). - * @property sslBlankUrl - * @type String - */ - /** - * Whether to append unique parameter on get request to disable caching (defaults to {@link Ext.Updater.defaults#disableCaching}). - * @property disableCaching - * @type Boolean - */ - /** - * Text for loading indicator (defaults to {@link Ext.Updater.defaults#indicatorText}). - * @property indicatorText - * @type String - */ - /** - * Whether to show indicatorText when loading (defaults to {@link Ext.Updater.defaults#showLoadIndicator}). - * @property showLoadIndicator - * @type String - */ - /** - * Timeout for requests or form posts in seconds (defaults to {@link Ext.Updater.defaults#timeout}). - * @property timeout - * @type Number - */ - /** - * True to process scripts in the output (defaults to {@link Ext.Updater.defaults#loadScripts}). - * @property loadScripts - * @type Boolean - */ - - /** - * Transaction object of the current executing transaction, or null if there is no active transaction. - */ + + + + + + + + me.transaction = null; - /** - * Delegate for refresh() prebound to "this", use myUpdater.refreshDelegate.createCallback(arg1, arg2) to bind arguments - * @type Function - */ + me.refreshDelegate = me.refresh.createDelegate(me); - /** - * Delegate for update() prebound to "this", use myUpdater.updateDelegate.createCallback(arg1, arg2) to bind arguments - * @type Function - */ + me.updateDelegate = me.update.createDelegate(me); - /** - * Delegate for formUpdate() prebound to "this", use myUpdater.formUpdateDelegate.createCallback(arg1, arg2) to bind arguments - * @type Function - */ + me.formUpdateDelegate = (me.formUpdate || function(){}).createDelegate(me); - /** - * The renderer for this Updater (defaults to {@link Ext.Updater.BasicRenderer}). - */ + me.renderer = me.renderer || me.getDefaultRenderer(); Ext.Updater.superclass.constructor.call(me); }, - /** - * Sets the content renderer for this Updater. See {@link Ext.Updater.BasicRenderer#render} for more details. - * @param {Object} renderer The object implementing the render() method - */ + setRenderer : function(renderer){ this.renderer = renderer; }, - /** - * Returns the current content renderer for this Updater. See {@link Ext.Updater.BasicRenderer#render} for more details. - * @return {Object} - */ + getRenderer : function(){ return this.renderer; }, - /** - * This is an overrideable method which returns a reference to a default - * renderer class if none is specified when creating the Ext.Updater. - * Defaults to {@link Ext.Updater.BasicRenderer} - */ + getDefaultRenderer: function() { return new Ext.Updater.BasicRenderer(); }, - /** - * Sets the default URL used for updates. - * @param {String/Function} defaultUrl The url or a function to call to get the url - */ + setDefaultUrl : function(defaultUrl){ this.defaultUrl = defaultUrl; }, - /** - * Get the Element this Updater is bound to - * @return {Ext.Element} The element - */ + getEl : function(){ return this.el; }, - /** - * Performs an asynchronous request, updating this element with the response. - * If params are specified it uses POST, otherwise it uses GET.

    - * Note: Due to the asynchronous nature of remote server requests, the Element - * will not have been fully updated when the function returns. To post-process the returned - * data, use the callback option, or an update event handler. - * @param {Object} options A config object containing any of the following options:
      - *
    • url : String/Function

      The URL to request or a function which - * returns the URL (defaults to the value of {@link Ext.Ajax#url} if not specified).

    • - *
    • method : String

      The HTTP method to - * use. Defaults to POST if the params argument is present, otherwise GET.

    • - *
    • params : String/Object/Function

      The - * parameters to pass to the server (defaults to none). These may be specified as a url-encoded - * string, or as an object containing properties which represent parameters, - * or as a function, which returns such an object.

    • - *
    • scripts : Boolean

      If true - * any <script> tags embedded in the response text will be extracted - * and executed (defaults to {@link Ext.Updater.defaults#loadScripts}). If this option is specified, - * the callback will be called after the execution of the scripts.

    • - *
    • callback : Function

      A function to - * be called when the response from the server arrives. The following - * parameters are passed:

        - *
      • el : Ext.Element

        The Element being updated.

      • - *
      • success : Boolean

        True for success, false for failure.

      • - *
      • response : XMLHttpRequest

        The XMLHttpRequest which processed the update.

      • - *
      • options : Object

        The config object passed to the update call.

      - *

    • - *
    • scope : Object

      The scope in which - * to execute the callback (The callback's this reference.) If the - * params argument is a function, this scope is used for that function also.

    • - *
    • discardUrl : Boolean

      By default, the URL of this request becomes - * the default URL for this Updater object, and will be subsequently used in {@link #refresh} - * calls. To bypass this behavior, pass discardUrl:true (defaults to false).

    • - *
    • timeout : Number

      The number of seconds to wait for a response before - * timing out (defaults to {@link Ext.Updater.defaults#timeout}).

    • - *
    • text : String

      The text to use as the innerHTML of the - * {@link Ext.Updater.defaults#indicatorText} div (defaults to 'Loading...'). To replace the entire div, not - * just the text, override {@link Ext.Updater.defaults#indicatorText} directly.

    • - *
    • nocache : Boolean

      Only needed for GET - * requests, this option causes an extra, auto-generated parameter to be appended to the request - * to defeat caching (defaults to {@link Ext.Updater.defaults#disableCaching}).

    - *

    - * For example: -

    
    -    um.update({
    -        url: "your-url.php",
    -        params: {param1: "foo", param2: "bar"}, // or a URL encoded string
    -        callback: yourFunction,
    -        scope: yourObject, //(optional scope)
    -        discardUrl: true,
    -        nocache: true,
    -        text: "Loading...",
    -        timeout: 60,
    -        scripts: false // Save time by avoiding RegExp execution.
    -    });
    -    
    - */ + update : function(url, params, callback, discardUrl){ var me = this, cfg, callerScope; if(me.fireEvent(BEFOREUPDATE, me.el, url, params) !== false){ - if(Ext.isObject(url)){ // must be config object + if(Ext.isObject(url)){ cfg = url; url = cfg.url; params = params || cfg.params; @@ -10232,28 +6902,7 @@ function() { } }, - /** - *

    Performs an asynchronous form post, updating this element with the response. If the form has the attribute - * enctype="multipart/form-data", it assumes it's a file upload. - * Uses this.sslBlankUrl for SSL file uploads to prevent IE security warning.

    - *

    File uploads are not performed using normal "Ajax" techniques, that is they are not - * performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the - * DOM <form> element temporarily modified to have its - * target set to refer - * to a dynamically generated, hidden <iframe> which is inserted into the document - * but removed after the return data has been gathered.

    - *

    Be aware that file upload packets, sent with the content type multipart/form-data - * and some server technologies (notably JEE) may require some custom processing in order to - * retrieve parameter names and parameter values from the packet content.

    - * @param {String/HTMLElement} form The form Id or form element - * @param {String} url (optional) The url to pass the form to. If omitted the action attribute on the form will be used. - * @param {Boolean} reset (optional) Whether to try to reset the form after the update - * @param {Function} callback (optional) Callback when transaction is complete. The following - * parameters are passed:
      - *
    • el : Ext.Element

      The Element being updated.

    • - *
    • success : Boolean

      True for success, false for failure.

    • - *
    • response : XMLHttpRequest

      The XMLHttpRequest which processed the update.

    - */ + formUpdate : function(form, url, reset, callback){ var me = this; if(me.fireEvent(BEFOREUPDATE, me.el, form, url) !== false){ @@ -10279,18 +6928,7 @@ function() { } }, - /** - * Set this element to auto refresh. Can be canceled by calling {@link #stopAutoRefresh}. - * @param {Number} interval How often to update (in seconds). - * @param {String/Object/Function} url (optional) The url for this request, a config object in the same format - * supported by {@link #load}, or a function to call to get the url (defaults to the last used url). Note that while - * the url used in a load call can be reused by this method, other load config options will not be reused and must be - * sepcified as part of a config object passed as this paramter if needed. - * @param {String/Object} params (optional) The parameters to pass as either a url encoded string - * "¶m1=1¶m2=2" or as an object {param1: 1, param2: 2} - * @param {Function} callback (optional) Callback when transaction is complete - called with signature (oElement, bSuccess) - * @param {Boolean} refreshNow (optional) Whether to execute the refresh now, or wait the interval - */ + startAutoRefresh : function(interval, url, params, callback, refreshNow){ var me = this; if(refreshNow){ @@ -10302,9 +6940,7 @@ function() { me.autoRefreshProcId = setInterval(me.update.createDelegate(me, [url || me.defaultUrl, params, callback, true]), interval * 1000); }, - /** - * Stop auto refresh on this element. - */ + stopAutoRefresh : function(){ if(this.autoRefreshProcId){ clearInterval(this.autoRefreshProcId); @@ -10312,44 +6948,31 @@ function() { } }, - /** - * Returns true if the Updater is currently set to auto refresh its content (see {@link #startAutoRefresh}), otherwise false. - */ + isAutoRefreshing : function(){ return !!this.autoRefreshProcId; }, - /** - * Display the element's "loading" state. By default, the element is updated with {@link #indicatorText}. This - * method may be overridden to perform a custom action while this Updater is actively updating its contents. - */ + showLoading : function(){ if(this.showLoadIndicator){ this.el.dom.innerHTML = this.indicatorText; } }, - /** - * Aborts the currently executing transaction, if any. - */ + abort : function(){ if(this.transaction){ Ext.Ajax.abort(this.transaction); } }, - /** - * Returns true if an update is in progress, otherwise false. - * @return {Boolean} - */ + isUpdating : function(){ return this.transaction ? Ext.Ajax.isLoading(this.transaction) : false; }, - /** - * Refresh the element with the last used url or defaultUrl. If there is no url, it returns immediately - * @param {Function} callback (optional) Callback when transaction is complete - called with signature (oElement, bSuccess) - */ + refresh : function(callback){ if(this.defaultUrl){ this.update(this.defaultUrl, null, callback, true); @@ -10358,212 +6981,51 @@ function() { } }()); -/** - * @class Ext.Updater.defaults - * The defaults collection enables customizing the default properties of Updater - */ + Ext.Updater.defaults = { - /** - * Timeout for requests or form posts in seconds (defaults to 30 seconds). - * @type Number - */ + timeout : 30, - /** - * True to append a unique parameter to GET requests to disable caching (defaults to false). - * @type Boolean - */ + disableCaching : false, - /** - * Whether or not to show {@link #indicatorText} during loading (defaults to true). - * @type Boolean - */ + showLoadIndicator : true, - /** - * Text for loading indicator (defaults to '<div class="loading-indicator">Loading...</div>'). - * @type String - */ + indicatorText : '
    Loading...
    ', - /** - * True to process scripts by default (defaults to false). - * @type Boolean - */ + loadScripts : false, - /** - * Blank page URL to use with SSL file uploads (defaults to {@link Ext#SSL_SECURE_URL} if set, or "javascript:false"). - * @type String - */ + sslBlankUrl : Ext.SSL_SECURE_URL }; -/** - * Static convenience method. This method is deprecated in favor of el.load({url:'foo.php', ...}). - * Usage: - *
    Ext.Updater.updateElement("my-div", "stuff.php");
    - * @param {Mixed} el The element to update - * @param {String} url The url - * @param {String/Object} params (optional) Url encoded param string or an object of name/value pairs - * @param {Object} options (optional) A config object with any of the Updater properties you want to set - for - * example: {disableCaching:true, indicatorText: "Loading data..."} - * @static - * @deprecated - * @member Ext.Updater - */ + Ext.Updater.updateElement = function(el, url, params, options){ var um = Ext.get(el).getUpdater(); Ext.apply(um, options); um.update(url, params, options ? options.callback : null); }; -/** - * @class Ext.Updater.BasicRenderer - *

    This class is a base class implementing a simple render method which updates an element using results from an Ajax request.

    - *

    The BasicRenderer updates the element's innerHTML with the responseText. To perform a custom render (i.e. XML or JSON processing), - * create an object with a conforming {@link #render} method and pass it to setRenderer on the Updater.

    - */ + Ext.Updater.BasicRenderer = function(){}; Ext.Updater.BasicRenderer.prototype = { - /** - * This method is called when an Ajax response is received, and an Element needs updating. - * @param {Ext.Element} el The element being rendered - * @param {Object} xhr The XMLHttpRequest object - * @param {Updater} updateManager The calling update manager - * @param {Function} callback A callback that will need to be called if loadScripts is true on the Updater - */ + render : function(el, response, updateManager, callback){ el.update(response.responseText, updateManager.loadScripts, callback); } -};/** - * @class Date - * - * The date parsing and formatting syntax contains a subset of - * PHP's date() function, and the formats that are - * supported will provide results equivalent to their PHP versions. - * - * The following is a list of all currently supported formats: - *
    -Format  Description                                                               Example returned values
    -------  -----------------------------------------------------------------------   -----------------------
    -  d     Day of the month, 2 digits with leading zeros                             01 to 31
    -  D     A short textual representation of the day of the week                     Mon to Sun
    -  j     Day of the month without leading zeros                                    1 to 31
    -  l     A full textual representation of the day of the week                      Sunday to Saturday
    -  N     ISO-8601 numeric representation of the day of the week                    1 (for Monday) through 7 (for Sunday)
    -  S     English ordinal suffix for the day of the month, 2 characters             st, nd, rd or th. Works well with j
    -  w     Numeric representation of the day of the week                             0 (for Sunday) to 6 (for Saturday)
    -  z     The day of the year (starting from 0)                                     0 to 364 (365 in leap years)
    -  W     ISO-8601 week number of year, weeks starting on Monday                    01 to 53
    -  F     A full textual representation of a month, such as January or March        January to December
    -  m     Numeric representation of a month, with leading zeros                     01 to 12
    -  M     A short textual representation of a month                                 Jan to Dec
    -  n     Numeric representation of a month, without leading zeros                  1 to 12
    -  t     Number of days in the given month                                         28 to 31
    -  L     Whether it's a leap year                                                  1 if it is a leap year, 0 otherwise.
    -  o     ISO-8601 year number (identical to (Y), but if the ISO week number (W)    Examples: 1998 or 2004
    -        belongs to the previous or next year, that year is used instead)
    -  Y     A full numeric representation of a year, 4 digits                         Examples: 1999 or 2003
    -  y     A two digit representation of a year                                      Examples: 99 or 03
    -  a     Lowercase Ante meridiem and Post meridiem                                 am or pm
    -  A     Uppercase Ante meridiem and Post meridiem                                 AM or PM
    -  g     12-hour format of an hour without leading zeros                           1 to 12
    -  G     24-hour format of an hour without leading zeros                           0 to 23
    -  h     12-hour format of an hour with leading zeros                              01 to 12
    -  H     24-hour format of an hour with leading zeros                              00 to 23
    -  i     Minutes, with leading zeros                                               00 to 59
    -  s     Seconds, with leading zeros                                               00 to 59
    -  u     Decimal fraction of a second                                              Examples:
    -        (minimum 1 digit, arbitrary number of digits allowed)                     001 (i.e. 0.001s) or
    -                                                                                  100 (i.e. 0.100s) or
    -                                                                                  999 (i.e. 0.999s) or
    -                                                                                  999876543210 (i.e. 0.999876543210s)
    -  O     Difference to Greenwich time (GMT) in hours and minutes                   Example: +1030
    -  P     Difference to Greenwich time (GMT) with colon between hours and minutes   Example: -08:00
    -  T     Timezone abbreviation of the machine running the code                     Examples: EST, MDT, PDT ...
    -  Z     Timezone offset in seconds (negative if west of UTC, positive if east)    -43200 to 50400
    -  c     ISO 8601 date
    -        Notes:                                                                    Examples:
    -        1) If unspecified, the month / day defaults to the current month / day,   1991 or
    -           the time defaults to midnight, while the timezone defaults to the      1992-10 or
    -           browser's timezone. If a time is specified, it must include both hours 1993-09-20 or
    -           and minutes. The "T" delimiter, seconds, milliseconds and timezone     1994-08-19T16:20+01:00 or
    -           are optional.                                                          1995-07-18T17:21:28-02:00 or
    -        2) The decimal fraction of a second, if specified, must contain at        1996-06-17T18:22:29.98765+03:00 or
    -           least 1 digit (there is no limit to the maximum number                 1997-05-16T19:23:30,12345-0400 or
    -           of digits allowed), and may be delimited by either a '.' or a ','      1998-04-15T20:24:31.2468Z or
    -        Refer to the examples on the right for the various levels of              1999-03-14T20:24:32Z or
    -        date-time granularity which are supported, or see                         2000-02-13T21:25:33
    -        http://www.w3.org/TR/NOTE-datetime for more info.                         2001-01-12 22:26:34
    -  U     Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)                1193432466 or -2138434463
    -  M$    Microsoft AJAX serialized dates                                           \/Date(1238606590509)\/ (i.e. UTC milliseconds since epoch) or
    -                                                                                  \/Date(1238606590509+0800)\/
    -
    - * - * Example usage (note that you must escape format specifiers with '\\' to render them as character literals): - *
    
    -// Sample date:
    -// 'Wed Jan 10 2007 15:05:01 GMT-0600 (Central Standard Time)'
    -
    -var dt = new Date('1/10/2007 03:05:01 PM GMT-0600');
    -document.write(dt.format('Y-m-d'));                           // 2007-01-10
    -document.write(dt.format('F j, Y, g:i a'));                   // January 10, 2007, 3:05 pm
    -document.write(dt.format('l, \\t\\he jS \\of F Y h:i:s A'));  // Wednesday, the 10th of January 2007 03:05:01 PM
    -
    - * - * Here are some standard date/time patterns that you might find helpful. They - * are not part of the source of Date.js, but to use them you can simply copy this - * block of code into any script that is included after Date.js and they will also become - * globally available on the Date object. Feel free to add or remove patterns as needed in your code. - *
    
    -Date.patterns = {
    -    ISO8601Long:"Y-m-d H:i:s",
    -    ISO8601Short:"Y-m-d",
    -    ShortDate: "n/j/Y",
    -    LongDate: "l, F d, Y",
    -    FullDateTime: "l, F d, Y g:i:s A",
    -    MonthDay: "F d",
    -    ShortTime: "g:i A",
    -    LongTime: "g:i:s A",
    -    SortableDateTime: "Y-m-d\\TH:i:s",
    -    UniversalSortableDateTime: "Y-m-d H:i:sO",
    -    YearMonth: "F, Y"
     };
    -
    - * - * Example usage: - *
    
    -var dt = new Date();
    -document.write(dt.format(Date.patterns.ShortDate));
    -
    - *

    Developer-written, custom formats may be used by supplying both a formatting and a parsing function - * which perform to specialized requirements. The functions are stored in {@link #parseFunctions} and {@link #formatFunctions}.

    - */ -/* - * Most of the date-formatting functions below are the excellent work of Baron Schwartz. - * (see http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/) - * They generate precompiled functions from format patterns instead of parsing and - * processing each pattern every time a date is formatted. These functions are available - * on every Date object. - */ + (function() { -/** - * Global flag which determines if strict date parsing should be used. - * Strict date parsing will not roll-over invalid dates, which is the - * default behaviour of javascript Date objects. - * (see {@link #parseDate} for more information) - * Defaults to false. - * @static - * @type Boolean -*/ + Date.useStrict = false; -// create private copy of Ext's String.format() method -// - to remove unnecessary dependency -// - to resolve namespace conflict with M$-Ajax's implementation + + + function xf(format) { var args = Array.prototype.slice.call(arguments, 1); return format.replace(/\{(\d+)\}/g, function(m, i) { @@ -10572,14 +7034,14 @@ function xf(format) { } -// private + Date.formatCodeToRegex = function(character, currentGroup) { - // Note: currentGroup - position in regex result array (see notes for Date.parseCodes below) + var p = Date.parseCodes[character]; if (p) { p = typeof p == 'function'? p() : p; - Date.parseCodes[character] = p; // reassign function result to prevent repeated execution + Date.parseCodes[character] = p; } return p ? Ext.applyIf({ @@ -10587,40 +7049,19 @@ Date.formatCodeToRegex = function(character, currentGroup) { }, p) : { g:0, c:null, - s:Ext.escapeRe(character) // treat unrecognised characters as literals + s:Ext.escapeRe(character) } }; -// private shorthand for Date.formatCodeToRegex since we'll be using it fairly often + var $f = Date.formatCodeToRegex; Ext.apply(Date, { - /** - *

    An object hash in which each property is a date parsing function. The property name is the - * format string which that function parses.

    - *

    This object is automatically populated with date parsing functions as - * date formats are requested for Ext standard formatting strings.

    - *

    Custom parsing functions may be inserted into this object, keyed by a name which from then on - * may be used as a format string to {@link #parseDate}.

    - *

    Example:

    
    -Date.parseFunctions['x-date-format'] = myDateParser;
    -
    - *

    A parsing function should return a Date object, and is passed the following parameters:

      - *
    • date : String
      The date string to parse.
    • - *
    • strict : Boolean
      True to validate date strings while parsing - * (i.e. prevent javascript Date "rollover") (The default must be false). - * Invalid date strings should return null when parsed.
    • - *

    - *

    To enable Dates to also be formatted according to that format, a corresponding - * formatting function must be placed into the {@link #formatFunctions} property. - * @property parseFunctions - * @static - * @type Object - */ + parseFunctions: { "M$": function(input, strict) { - // note: the timezone offset is ignored since the M$ Ajax server sends - // a UTC milliseconds-since-Unix-epoch value (negative values are allowed) + + var re = new RegExp('\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/'); var r = (input || '').match(re); return r? new Date(((r[1] || '') + r[2]) * 1) : null; @@ -10628,126 +7069,41 @@ Date.parseFunctions['x-date-format'] = myDateParser; }, parseRegexes: [], - /** - *

    An object hash in which each property is a date formatting function. The property name is the - * format string which corresponds to the produced formatted date string.

    - *

    This object is automatically populated with date formatting functions as - * date formats are requested for Ext standard formatting strings.

    - *

    Custom formatting functions may be inserted into this object, keyed by a name which from then on - * may be used as a format string to {@link #format}. Example:

    
    -Date.formatFunctions['x-date-format'] = myDateFormatter;
    -
    - *

    A formatting function should return a string representation of the passed Date object, and is passed the following parameters:

      - *
    • date : Date
      The Date to format.
    • - *

    - *

    To enable date strings to also be parsed according to that format, a corresponding - * parsing function must be placed into the {@link #parseFunctions} property. - * @property formatFunctions - * @static - * @type Object - */ + formatFunctions: { "M$": function() { - // UTC milliseconds since Unix epoch (M$-AJAX serialized date format (MRSF)) + return '\\/Date(' + this.getTime() + ')\\/'; } }, y2kYear : 50, - /** - * Date interval constant - * @static - * @type String - */ + MILLI : "ms", - /** - * Date interval constant - * @static - * @type String - */ + SECOND : "s", - /** - * Date interval constant - * @static - * @type String - */ + MINUTE : "mi", - /** Date interval constant - * @static - * @type String - */ + HOUR : "h", - /** - * Date interval constant - * @static - * @type String - */ + DAY : "d", - /** - * Date interval constant - * @static - * @type String - */ + MONTH : "mo", - /** - * Date interval constant - * @static - * @type String - */ + YEAR : "y", - /** - *

    An object hash containing default date values used during date parsing.

    - *

    The following properties are available:

      - *
    • y : Number
      The default year value. (defaults to undefined)
    • - *
    • m : Number
      The default 1-based month value. (defaults to undefined)
    • - *
    • d : Number
      The default day value. (defaults to undefined)
    • - *
    • h : Number
      The default hour value. (defaults to undefined)
    • - *
    • i : Number
      The default minute value. (defaults to undefined)
    • - *
    • s : Number
      The default second value. (defaults to undefined)
    • - *
    • ms : Number
      The default millisecond value. (defaults to undefined)
    • - *

    - *

    Override these properties to customize the default date values used by the {@link #parseDate} method.

    - *

    Note: In countries which experience Daylight Saving Time (i.e. DST), the h, i, s - * and ms properties may coincide with the exact time in which DST takes effect. - * It is the responsiblity of the developer to account for this.

    - * Example Usage: - *
    
    -// set default day value to the first day of the month
    -Date.defaults.d = 1;
    -
    -// parse a February date string containing only year and month values.
    -// setting the default day value to 1 prevents weird date rollover issues
    -// when attempting to parse the following date string on, for example, March 31st 2009.
    -Date.parseDate('2009-02', 'Y-m'); // returns a Date object representing February 1st 2009
    -
    - * @property defaults - * @static - * @type Object - */ + defaults: {}, - /** - * An array of textual day names. - * Override these values for international dates. - * Example: - *
    
    -Date.dayNames = [
    -    'SundayInYourLang',
    -    'MondayInYourLang',
    -    ...
    -];
    -
    - * @type Array - * @static - */ + dayNames : [ "Sunday", "Monday", @@ -10758,20 +7114,7 @@ Date.dayNames = [ "Saturday" ], - /** - * An array of textual month names. - * Override these values for international dates. - * Example: - *
    
    -Date.monthNames = [
    -    'JanInYourLang',
    -    'FebInYourLang',
    -    ...
    -];
    -
    - * @type Array - * @static - */ + monthNames : [ "January", "February", @@ -10787,20 +7130,7 @@ Date.monthNames = [ "December" ], - /** - * An object hash of zero-based javascript month numbers (with short month names as keys. note: keys are case-sensitive). - * Override these values for international dates. - * Example: - *
    
    -Date.monthNumbers = {
    -    'ShortJanNameInYourLang':0,
    -    'ShortFebNameInYourLang':1,
    -    ...
    -};
    -
    - * @type Object - * @static - */ + monthNumbers : { Jan:0, Feb:1, @@ -10816,58 +7146,26 @@ Date.monthNumbers = { Dec:11 }, - /** - * Get the short month name for the given month number. - * Override this function for international dates. - * @param {Number} month A zero-based javascript month number. - * @return {String} The short month name. - * @static - */ + getShortMonthName : function(month) { return Date.monthNames[month].substring(0, 3); }, - /** - * Get the short day name for the given day number. - * Override this function for international dates. - * @param {Number} day A zero-based javascript day number. - * @return {String} The short day name. - * @static - */ + getShortDayName : function(day) { return Date.dayNames[day].substring(0, 3); }, - /** - * Get the zero-based javascript month number for the given short/full month name. - * Override this function for international dates. - * @param {String} name The short/full month name. - * @return {Number} The zero-based javascript month number. - * @static - */ + getMonthNumber : function(name) { - // handle camel casing for english month names (since the keys for the Date.monthNumbers hash are case sensitive) + return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; }, - /** - * The base format-code to formatting-function hashmap used by the {@link #format} method. - * Formatting functions are strings (or functions which return strings) which - * will return the appropriate value when evaluated in the context of the Date object - * from which the {@link #format} method is called. - * Add to / override these mappings for custom date formatting. - * Note: Date.format() treats characters as literals if an appropriate mapping cannot be found. - * Example: - *
    
    -Date.formatCodes.x = "String.leftPad(this.getDate(), 2, '0')";
    -(new Date()).format("X"); // returns the current day of the month
    -
    - * @type Object - * @static - */ + formatCodes : { d: "String.leftPad(this.getDate(), 2, '0')", - D: "Date.getShortDayName(this.getDay())", // get localised short day name + D: "Date.getShortDayName(this.getDay())", j: "this.getDate()", l: "Date.dayNames[this.getDay()]", N: "(this.getDay() ? this.getDay() : 7)", @@ -10877,7 +7175,7 @@ Date.formatCodes.x = "String.leftPad(this.getDate(), 2, '0')"; W: "String.leftPad(this.getWeekOfYear(), 2, '0')", F: "Date.monthNames[this.getMonth()]", m: "String.leftPad(this.getMonth() + 1, 2, '0')", - M: "Date.getShortMonthName(this.getMonth())", // get localised short month name + M: "Date.getShortMonthName(this.getMonth())", n: "(this.getMonth() + 1)", t: "this.getDaysInMonth()", L: "(this.isLeapYear() ? 1 : 0)", @@ -10898,45 +7196,21 @@ Date.formatCodes.x = "String.leftPad(this.getDate(), 2, '0')"; T: "this.getTimezone()", Z: "(this.getTimezoneOffset() * -60)", - c: function() { // ISO-8601 -- GMT format + c: function() { for (var c = "Y-m-dTH:i:sP", code = [], i = 0, l = c.length; i < l; ++i) { var e = c.charAt(i); - code.push(e == "T" ? "'T'" : Date.getFormatCode(e)); // treat T as a character literal + code.push(e == "T" ? "'T'" : Date.getFormatCode(e)); } return code.join(" + "); }, - /* - c: function() { // ISO-8601 -- UTC format - return [ - "this.getUTCFullYear()", "'-'", - "String.leftPad(this.getUTCMonth() + 1, 2, '0')", "'-'", - "String.leftPad(this.getUTCDate(), 2, '0')", - "'T'", - "String.leftPad(this.getUTCHours(), 2, '0')", "':'", - "String.leftPad(this.getUTCMinutes(), 2, '0')", "':'", - "String.leftPad(this.getUTCSeconds(), 2, '0')", - "'Z'" - ].join(" + "); - }, - */ + U: "Math.round(this.getTime() / 1000)" }, - /** - * Checks if the passed Date parameters will cause a javascript Date "rollover". - * @param {Number} year 4-digit year - * @param {Number} month 1-based month-of-year - * @param {Number} day Day of month - * @param {Number} hour (optional) Hour - * @param {Number} minute (optional) Minute - * @param {Number} second (optional) Second - * @param {Number} millisecond (optional) Millisecond - * @return {Boolean} true if the passed parameters do not cause a Date "rollover", false otherwise. - * @static - */ + isValid : function(y, m, d, h, i, s, ms) { - // setup defaults + h = h || 0; i = i || 0; s = s || 0; @@ -10953,37 +7227,7 @@ Date.formatCodes.x = "String.leftPad(this.getDate(), 2, '0')"; ms == dt.getMilliseconds(); }, - /** - * Parses the passed string using the specified date format. - * Note that this function expects normal calendar dates, meaning that months are 1-based (i.e. 1 = January). - * The {@link #defaults} hash will be used for any date value (i.e. year, month, day, hour, minute, second or millisecond) - * which cannot be found in the passed string. If a corresponding default date value has not been specified in the {@link #defaults} hash, - * the current date's year, month, day or DST-adjusted zero-hour time value will be used instead. - * Keep in mind that the input date string must precisely match the specified format string - * in order for the parse operation to be successful (failed parse operations return a null value). - *

    Example:

    
    -//dt = Fri May 25 2007 (current date)
    -var dt = new Date();
    -
    -//dt = Thu May 25 2006 (today's month/day in 2006)
    -dt = Date.parseDate("2006", "Y");
    -
    -//dt = Sun Jan 15 2006 (all date parts specified)
    -dt = Date.parseDate("2006-01-15", "Y-m-d");
    -
    -//dt = Sun Jan 15 2006 15:20:01
    -dt = Date.parseDate("2006-01-15 3:20:01 PM", "Y-m-d g:i:s A");
    -
    -// attempt to parse Sun Feb 29 2006 03:20:01 in strict mode
    -dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null
    -
    - * @param {String} input The raw date string. - * @param {String} format The expected date string format. - * @param {Boolean} strict (optional) True to validate date strings while parsing (i.e. prevents javascript Date "rollover") - (defaults to false). Invalid date strings will return null when parsed. - * @return {Date} The parsed Date. - * @static - */ + parseDate : function(input, format, strict) { var p = Date.parseFunctions; if (p[format] == null) { @@ -10992,20 +7236,20 @@ dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null return p[format](input, Ext.isDefined(strict) ? strict : Date.useStrict); }, - // private + getFormatCode : function(character) { var f = Date.formatCodes[character]; if (f) { f = typeof f == 'function'? f() : f; - Date.formatCodes[character] = f; // reassign function result to prevent repeated execution + Date.formatCodes[character] = f; } - // note: unknown characters are treated as literals + return f || ("'" + String.escape(character) + "'"); }, - // private + createFormat : function(format) { var code = [], special = false, @@ -11025,60 +7269,60 @@ dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null Date.formatFunctions[format] = new Function("return " + code.join('+')); }, - // private + createParser : function() { var code = [ "var dt, y, m, d, h, i, s, ms, o, z, zz, u, v,", "def = Date.defaults,", - "results = String(input).match(Date.parseRegexes[{0}]);", // either null, or an array of matched strings + "results = String(input).match(Date.parseRegexes[{0}]);", "if(results){", "{1}", - "if(u != null){", // i.e. unix time is defined - "v = new Date(u * 1000);", // give top priority to UNIX time + "if(u != null){", + "v = new Date(u * 1000);", "}else{", - // create Date object representing midnight of the current day; - // this will provide us with our date defaults - // (note: clearTime() handles Daylight Saving Time automatically) + + + "dt = (new Date()).clearTime();", - // date calculations (note: these calculations create a dependency on Ext.num()) + "y = Ext.num(y, Ext.num(def.y, dt.getFullYear()));", "m = Ext.num(m, Ext.num(def.m - 1, dt.getMonth()));", "d = Ext.num(d, Ext.num(def.d, dt.getDate()));", - // time calculations (note: these calculations create a dependency on Ext.num()) + "h = Ext.num(h, Ext.num(def.h, dt.getHours()));", "i = Ext.num(i, Ext.num(def.i, dt.getMinutes()));", "s = Ext.num(s, Ext.num(def.s, dt.getSeconds()));", "ms = Ext.num(ms, Ext.num(def.ms, dt.getMilliseconds()));", "if(z >= 0 && y >= 0){", - // both the year and zero-based day of year are defined and >= 0. - // these 2 values alone provide sufficient info to create a full date object + + - // create Date object representing January 1st for the given year + "v = new Date(y, 0, 1, h, i, s, ms);", - // then add day of year, checking for Date "rollover" if necessary + "v = !strict? v : (strict === true && (z <= 364 || (v.isLeapYear() && z <= 365))? v.add(Date.DAY, z) : null);", - "}else if(strict === true && !Date.isValid(y, m + 1, d, h, i, s, ms)){", // check for Date "rollover" - "v = null;", // invalid date, so return null + "}else if(strict === true && !Date.isValid(y, m + 1, d, h, i, s, ms)){", + "v = null;", "}else{", - // plain old Date object + "v = new Date(y, m, d, h, i, s, ms);", "}", "}", "}", "if(v){", - // favour UTC offset over GMT offset + "if(zz != null){", - // reset to UTC, then add offset + "v = v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - zz);", "}else if(o){", - // reset to GMT, then add offset + "v = v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));", "}", "}", @@ -11116,26 +7360,21 @@ dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null } }(), - // private + parseCodes : { - /* - * Notes: - * g = {Number} calculation group (0 or 1. only group 1 contributes to date calculations.) - * c = {String} calculation method (required for group 1. null for group 0. {0} = currentGroup - position in regex result array) - * s = {String} regex pattern. all matches are stored in results[], and are accessible by the calculation mapped to 'c' - */ + d: { g:1, c:"d = parseInt(results[{0}], 10);\n", - s:"(\\d{2})" // day of month with leading zeroes (01 - 31) + s:"(\\d{2})" }, j: { g:1, c:"d = parseInt(results[{0}], 10);\n", - s:"(\\d{1,2})" // day of month without leading zeroes (1 - 31) + s:"(\\d{1,2})" }, D: function() { - for (var a = [], i = 0; i < 7; a.push(Date.getShortDayName(i)), ++i); // get localised short day names + for (var a = [], i = 0; i < 7; a.push(Date.getShortDayName(i)), ++i); return { g:0, c:null, @@ -11152,7 +7391,7 @@ dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null N: { g:0, c:null, - s:"[1-7]" // ISO-8601 day number (1 (monday) - 7 (sunday)) + s:"[1-7]" }, S: { g:0, @@ -11162,27 +7401,27 @@ dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null w: { g:0, c:null, - s:"[0-6]" // javascript day number (0 (sunday) - 6 (saturday)) + s:"[0-6]" }, z: { g:1, c:"z = parseInt(results[{0}], 10);\n", - s:"(\\d{1,3})" // day of the year (0 - 364 (365 in leap years)) + s:"(\\d{1,3})" }, W: { g:0, c:null, - s:"(?:\\d{2})" // ISO-8601 week number (with leading zero) + s:"(?:\\d{2})" }, F: function() { return { g:1, - c:"m = parseInt(Date.getMonthNumber(results[{0}]), 10);\n", // get localised month number + c:"m = parseInt(Date.getMonthNumber(results[{0}]), 10);\n", s:"(" + Date.monthNames.join("|") + ")" } }, M: function() { - for (var a = [], i = 0; i < 12; a.push(Date.getShortMonthName(i)), ++i); // get localised short month names + for (var a = [], i = 0; i < 12; a.push(Date.getShortMonthName(i)), ++i); return Ext.applyIf({ s:"(" + a.join("|") + ")" }, $f("F")); @@ -11190,17 +7429,17 @@ dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null m: { g:1, c:"m = parseInt(results[{0}], 10) - 1;\n", - s:"(\\d{2})" // month number with leading zeros (01 - 12) + s:"(\\d{2})" }, n: { g:1, c:"m = parseInt(results[{0}], 10) - 1;\n", - s:"(\\d{1,2})" // month number without leading zeros (1 - 12) + s:"(\\d{1,2})" }, t: { g:0, c:null, - s:"(?:\\d{2})" // no. of days in the month (28 - 31) + s:"(?:\\d{2})" }, L: { g:0, @@ -11213,12 +7452,12 @@ dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null Y: { g:1, c:"y = parseInt(results[{0}], 10);\n", - s:"(\\d{4})" // 4-digit year + s:"(\\d{4})" }, y: { g:1, c:"var ty = parseInt(results[{0}], 10);\n" - + "y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n", // 2-digit year + + "y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n", s:"(\\d{1,2})" }, a: { @@ -11241,7 +7480,7 @@ dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null G: { g:1, c:"h = parseInt(results[{0}], 10);\n", - s:"(\\d{1,2})" // 24-hr format of an hour without leading zeroes (0 - 23) + s:"(\\d{1,2})" }, h: function() { return $f("H"); @@ -11249,74 +7488,74 @@ dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null H: { g:1, c:"h = parseInt(results[{0}], 10);\n", - s:"(\\d{2})" // 24-hr format of an hour with leading zeroes (00 - 23) + s:"(\\d{2})" }, i: { g:1, c:"i = parseInt(results[{0}], 10);\n", - s:"(\\d{2})" // minutes with leading zeros (00 - 59) + s:"(\\d{2})" }, s: { g:1, c:"s = parseInt(results[{0}], 10);\n", - s:"(\\d{2})" // seconds with leading zeros (00 - 59) + s:"(\\d{2})" }, u: { g:1, c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n", - s:"(\\d+)" // decimal fraction of a second (minimum = 1 digit, maximum = unlimited) + s:"(\\d+)" }, O: { g:1, c:[ "o = results[{0}];", - "var sn = o.substring(0,1),", // get + / - sign - "hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),", // get hours (performs minutes-to-hour conversion also, just in case) - "mn = o.substring(3,5) % 60;", // get minutes - "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n" // -12hrs <= GMT offset <= 14hrs + "var sn = o.substring(0,1),", + "hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),", + "mn = o.substring(3,5) % 60;", + "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n" ].join("\n"), - s: "([+\-]\\d{4})" // GMT offset in hrs and mins + s: "([+\-]\\d{4})" }, P: { g:1, c:[ "o = results[{0}];", - "var sn = o.substring(0,1),", // get + / - sign - "hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),", // get hours (performs minutes-to-hour conversion also, just in case) - "mn = o.substring(4,6) % 60;", // get minutes - "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n" // -12hrs <= GMT offset <= 14hrs + "var sn = o.substring(0,1),", + "hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),", + "mn = o.substring(4,6) % 60;", + "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n" ].join("\n"), - s: "([+\-]\\d{2}:\\d{2})" // GMT offset in hrs and mins (with colon separator) + s: "([+\-]\\d{2}:\\d{2})" }, T: { g:0, c:null, - s:"[A-Z]{1,4}" // timezone abbrev. may be between 1 - 4 chars + s:"[A-Z]{1,4}" }, Z: { g:1, - c:"zz = results[{0}] * 1;\n" // -43200 <= UTC offset <= 50400 + c:"zz = results[{0}] * 1;\n" + "zz = (-43200 <= zz && zz <= 50400)? zz : null;\n", - s:"([+\-]?\\d{1,5})" // leading '+' sign is optional for UTC offset + s:"([+\-]?\\d{1,5})" }, c: function() { var calc = [], arr = [ - $f("Y", 1), // year - $f("m", 2), // month - $f("d", 3), // day - $f("h", 4), // hour - $f("i", 5), // minute - $f("s", 6), // second - {c:"ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"}, // decimal fraction of a second (minimum = 1 digit, maximum = unlimited) - {c:[ // allow either "Z" (i.e. UTC) or "-0530" or "+08:00" (i.e. UTC offset) timezone delimiters. assumes local timezone if no timezone is specified - "if(results[8]) {", // timezone specified + $f("Y", 1), + $f("m", 2), + $f("d", 3), + $f("h", 4), + $f("i", 5), + $f("s", 6), + {c:"ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"}, + {c:[ + "if(results[8]) {", "if(results[8] == 'Z'){", - "zz = 0;", // UTC + "zz = 0;", "}else if (results[8].indexOf(':') > -1){", - $f("P", 8).c, // timezone offset with colon separator + $f("P", 8).c, "}else{", - $f("O", 8).c, // timezone offset without colon separator + $f("O", 8).c, "}", "}" ].join('\n')} @@ -11330,15 +7569,15 @@ dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null g:1, c:calc.join(""), s:[ - arr[0].s, // year (required) - "(?:", "-", arr[1].s, // month (optional) - "(?:", "-", arr[2].s, // day (optional) + arr[0].s, + "(?:", "-", arr[1].s, + "(?:", "-", arr[2].s, "(?:", - "(?:T| )?", // time delimiter -- either a "T" or a single blank space - arr[3].s, ":", arr[4].s, // hour AND minute, delimited by a single colon (optional). MUST be preceded by either a "T" or a single blank space - "(?::", arr[5].s, ")?", // seconds (optional) - "(?:(?:\\.|,)(\\d+))?", // decimal fraction of a second (e.g. ",12345" or ".98765") (optional) - "(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?", // "Z" (UTC) or "-0530" (UTC offset without colon delimiter) or "+08:00" (UTC offset with colon delimiter) (optional) + "(?:T| )?", + arr[3].s, ":", arr[4].s, + "(?::", arr[5].s, ")?", + "(?:(?:\\.|,)(\\d+))?", + "(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?", ")?", ")?", ")?" @@ -11348,7 +7587,7 @@ dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null U: { g:1, c:"u = parseInt(results[{0}], 10);\n", - s:"(-?\\d+)" // leading minus sign indicates seconds before UNIX epoch + s:"(-?\\d+)" } } }); @@ -11356,7 +7595,7 @@ dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null }()); Ext.apply(Date.prototype, { - // private + dateFormat : function(format) { if (Date.formatFunctions[format] == null) { Date.createFormat(format); @@ -11364,38 +7603,24 @@ Ext.apply(Date.prototype, { return Date.formatFunctions[format].call(this); }, - /** - * Get the timezone abbreviation of the current date (equivalent to the format specifier 'T'). - * - * Note: The date string returned by the javascript Date object's toString() method varies - * between browsers (e.g. FF vs IE) and system region settings (e.g. IE in Asia vs IE in America). - * For a given date string e.g. "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)", - * getTimezone() first tries to get the timezone abbreviation from between a pair of parentheses - * (which may or may not be present), failing which it proceeds to get the timezone abbreviation - * from the GMT offset portion of the date string. - * @return {String} The abbreviated timezone name (e.g. 'CST', 'PDT', 'EDT', 'MPST' ...). - */ + getTimezone : function() { - // the following list shows the differences between date strings from different browsers on a WinXP SP2 machine from an Asian locale: - // - // Opera : "Thu, 25 Oct 2007 22:53:45 GMT+0800" -- shortest (weirdest) date string of the lot - // Safari : "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)" -- value in parentheses always gives the correct timezone (same as FF) - // FF : "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)" -- value in parentheses always gives the correct timezone - // IE : "Thu Oct 25 22:54:35 UTC+0800 2007" -- (Asian system setting) look for 3-4 letter timezone abbrev - // IE : "Thu Oct 25 17:06:37 PDT 2007" -- (American system setting) look for 3-4 letter timezone abbrev - // - // this crazy regex attempts to guess the correct timezone abbreviation despite these differences. - // step 1: (?:\((.*)\) -- find timezone in parentheses - // step 2: ([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?) -- if nothing was found in step 1, find timezone from timezone offset portion of date string - // step 3: remove all non uppercase characters found in step 1 and 2 + + + + + + + + + + + + return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/, "$1$2").replace(/[^A-Z]/g, ""); }, - /** - * Get the offset from GMT of the current date (equivalent to the format specifier 'O'). - * @param {Boolean} colon (optional) true to separate the hours and minutes with a colon (defaults to false). - * @return {String} The 4-character offset string prefixed with + or - (e.g. '-0600'). - */ + getGMTOffset : function(colon) { return (this.getTimezoneOffset() > 0 ? "-" : "+") + String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset()) / 60), 2, "0") @@ -11403,10 +7628,7 @@ Ext.apply(Date.prototype, { + String.leftPad(Math.abs(this.getTimezoneOffset() % 60), 2, "0"); }, - /** - * Get the numeric day number of the year, adjusted for leap year. - * @return {Number} 0 to 364 (365 in leap years). - */ + getDayOfYear: function() { var num = 0, d = this.clone(), @@ -11419,100 +7641,61 @@ Ext.apply(Date.prototype, { return num + this.getDate() - 1; }, - /** - * Get the numeric ISO-8601 week number of the year. - * (equivalent to the format specifier 'W', but without a leading zero). - * @return {Number} 1 to 53 - */ + getWeekOfYear : function() { - // adapted from http://www.merlyn.demon.co.uk/weekcalc.htm - var ms1d = 864e5, // milliseconds in a day - ms7d = 7 * ms1d; // milliseconds in a week + + var ms1d = 864e5, + ms7d = 7 * ms1d; - return function() { // return a closure so constants get calculated only once - var DC3 = Date.UTC(this.getFullYear(), this.getMonth(), this.getDate() + 3) / ms1d, // an Absolute Day Number - AWN = Math.floor(DC3 / 7), // an Absolute Week Number + return function() { + var DC3 = Date.UTC(this.getFullYear(), this.getMonth(), this.getDate() + 3) / ms1d, + AWN = Math.floor(DC3 / 7), Wyr = new Date(AWN * ms7d).getUTCFullYear(); return AWN - Math.floor(Date.UTC(Wyr, 0, 7) / ms7d) + 1; } }(), - /** - * Checks if the current date falls within a leap year. - * @return {Boolean} True if the current date falls within a leap year, false otherwise. - */ + isLeapYear : function() { var year = this.getFullYear(); return !!((year & 3) == 0 && (year % 100 || (year % 400 == 0 && year))); }, - /** - * Get the first day of the current month, adjusted for leap year. The returned value - * is the numeric day index within the week (0-6) which can be used in conjunction with - * the {@link #monthNames} array to retrieve the textual day name. - * Example: - *
    
    -var dt = new Date('1/10/2007');
    -document.write(Date.dayNames[dt.getFirstDayOfMonth()]); //output: 'Monday'
    -
    - * @return {Number} The day number (0-6). - */ + getFirstDayOfMonth : function() { var day = (this.getDay() - (this.getDate() - 1)) % 7; return (day < 0) ? (day + 7) : day; }, - /** - * Get the last day of the current month, adjusted for leap year. The returned value - * is the numeric day index within the week (0-6) which can be used in conjunction with - * the {@link #monthNames} array to retrieve the textual day name. - * Example: - *
    
    -var dt = new Date('1/10/2007');
    -document.write(Date.dayNames[dt.getLastDayOfMonth()]); //output: 'Wednesday'
    -
    - * @return {Number} The day number (0-6). - */ + getLastDayOfMonth : function() { return this.getLastDateOfMonth().getDay(); }, - /** - * Get the date of the first day of the month in which this date resides. - * @return {Date} - */ + getFirstDateOfMonth : function() { return new Date(this.getFullYear(), this.getMonth(), 1); }, - /** - * Get the date of the last day of the month in which this date resides. - * @return {Date} - */ + getLastDateOfMonth : function() { return new Date(this.getFullYear(), this.getMonth(), this.getDaysInMonth()); }, - /** - * Get the number of days in the current month, adjusted for leap year. - * @return {Number} The number of days in the month. - */ + getDaysInMonth: function() { var daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - return function() { // return a closure for efficiency + return function() { var m = this.getMonth(); return m == 1 && this.isLeapYear() ? 29 : daysInMonth[m]; } }(), - /** - * Get the English ordinal suffix of the current day (equivalent to the format specifier 'S'). - * @return {String} 'st, 'nd', 'rd' or 'th'. - */ + getSuffix : function() { switch (this.getDate()) { case 1: @@ -11530,68 +7713,38 @@ document.write(Date.dayNames[dt.getLastDayOfMonth()]); //output: 'Wednesday' } }, - /** - * Creates and returns a new Date instance with the exact same date value as the called instance. - * Dates are copied and passed by reference, so if a copied date variable is modified later, the original - * variable will also be changed. When the intention is to create a new variable that will not - * modify the original instance, you should create a clone. - * - * Example of correctly cloning a date: - *
    
    -//wrong way:
    -var orig = new Date('10/1/2006');
    -var copy = orig;
    -copy.setDate(5);
    -document.write(orig);  //returns 'Thu Oct 05 2006'!
    -
    -//correct way:
    -var orig = new Date('10/1/2006');
    -var copy = orig.clone();
    -copy.setDate(5);
    -document.write(orig);  //returns 'Thu Oct 01 2006'
    -
    - * @return {Date} The new Date instance. - */ + clone : function() { return new Date(this.getTime()); }, - /** - * Checks if the current date is affected by Daylight Saving Time (DST). - * @return {Boolean} True if the current date is affected by DST. - */ + isDST : function() { - // adapted from http://extjs.com/forum/showthread.php?p=247172#post247172 - // courtesy of @geoffrey.mcgill + + return new Date(this.getFullYear(), 0, 1).getTimezoneOffset() != this.getTimezoneOffset(); }, - /** - * Attempts to clear all time information from this Date by setting the time to midnight of the same day, - * automatically adjusting for Daylight Saving Time (DST) where applicable. - * (note: DST timezone information for the browser's host operating system is assumed to be up-to-date) - * @param {Boolean} clone true to create a clone of this date, clear the time and return it (defaults to false). - * @return {Date} this or the clone. - */ + clearTime : function(clone) { if (clone) { return this.clone().clearTime(); } - // get current date before clearing time + var d = this.getDate(); - // clear time + this.setHours(0); this.setMinutes(0); this.setSeconds(0); this.setMilliseconds(0); - if (this.getDate() != d) { // account for DST (i.e. day of month changed when setting hour = 0) - // note: DST adjustments are assumed to occur in multiples of 1 hour (this is almost always the case) - // refer to http://www.timeanddate.com/time/aboutdst.html for the (rare) exceptions to this rule + if (this.getDate() != d) { + + - // increment hour until cloned date == current date + for (var hr = 1, c = this.add(Date.HOUR, hr); c.getDate() != d; hr++, c = this.add(Date.HOUR, hr)); this.setDate(d); @@ -11601,30 +7754,7 @@ document.write(orig); //returns 'Thu Oct 01 2006' return this; }, - /** - * Provides a convenient method for performing basic date arithmetic. This method - * does not modify the Date instance being called - it creates and returns - * a new Date instance containing the resulting date value. - * - * Examples: - *
    
    -// Basic usage:
    -var dt = new Date('10/29/2006').add(Date.DAY, 5);
    -document.write(dt); //returns 'Fri Nov 03 2006 00:00:00'
    -
    -// Negative values will be subtracted:
    -var dt2 = new Date('10/1/2006').add(Date.DAY, -5);
    -document.write(dt2); //returns 'Tue Sep 26 2006 00:00:00'
    -
    -// You can even chain several calls together in one line:
    -var dt3 = new Date('10/1/2006').add(Date.DAY, 5).add(Date.HOUR, 8).add(Date.MINUTE, -30);
    -document.write(dt3); //returns 'Fri Oct 06 2006 07:30:00'
    -
    - * - * @param {String} interval A valid date interval enum value. - * @param {Number} value The amount to add to the current date. - * @return {Date} The new Date instance. - */ + add : function(interval, value) { var d = this.clone(); if (!interval || value === 0) return d; @@ -11660,12 +7790,7 @@ document.write(dt3); //returns 'Fri Oct 06 2006 07:30:00' return d; }, - /** - * Checks if this date falls on or between the given start and end dates. - * @param {Date} start Start date - * @param {Date} end End date - * @return {Boolean} true if this date falls on or between the given start and end dates. - */ + between : function(start, end) { var t = this.getTime(); return start.getTime() <= t && t <= end.getTime(); @@ -11673,23 +7798,18 @@ document.write(dt3); //returns 'Fri Oct 06 2006 07:30:00' }); -/** - * Formats a date given the supplied format string. - * @param {String} format The format string. - * @return {String} The formatted date. - * @method format - */ + Date.prototype.format = Date.prototype.dateFormat; -// private + if (Ext.isSafari && (navigator.userAgent.match(/WebKit\/(\d+)/)[1] || NaN) < 420) { Ext.apply(Date.prototype, { _xMonth : Date.prototype.setMonth, _xDate : Date.prototype.setDate, - // Bug in Safari 1.3, 2.0 (WebKit build < 420) - // Date.setMonth does not work consistently if iMonth is not 0-11 + + setMonth : function(num) { if (num <= -1) { var n = Math.ceil(-num), @@ -11704,12 +7824,12 @@ if (Ext.isSafari && (navigator.userAgent.match(/WebKit\/(\d+)/)[1] || NaN) < 420 } }, - // Bug in setDate() method (resolved in WebKit build 419.3, so to be safe we target Webkit builds < 420) - // The parameter for Date.setDate() is converted to a signed byte integer in Safari - // http://brianary.blogspot.com/2006/03/safari-date-bug.html + + + setDate : function(d) { - // use setTime() to workaround setDate() bug - // subtract current day of month in milliseconds, then add desired day of month in milliseconds + + return this.setTime(this.getTime() - (this.getDate() - d) * 864e5); } }); @@ -11717,80 +7837,21 @@ if (Ext.isSafari && (navigator.userAgent.match(/WebKit\/(\d+)/)[1] || NaN) < 420 -/* Some basic Date tests... (requires Firebug) - -Date.parseDate('', 'c'); // call Date.parseDate() once to force computation of regex string so we can console.log() it -console.log('Insane Regex for "c" format: %o', Date.parseCodes.c.s); // view the insane regex for the "c" format specifier -// standard tests -console.group('Standard Date.parseDate() Tests'); - console.log('Date.parseDate("2009-01-05T11:38:56", "c") = %o', Date.parseDate("2009-01-05T11:38:56", "c")); // assumes browser's timezone setting - console.log('Date.parseDate("2009-02-04T12:37:55.001000", "c") = %o', Date.parseDate("2009-02-04T12:37:55.001000", "c")); // assumes browser's timezone setting - console.log('Date.parseDate("2009-03-03T13:36:54,101000Z", "c") = %o', Date.parseDate("2009-03-03T13:36:54,101000Z", "c")); // UTC - console.log('Date.parseDate("2009-04-02T14:35:53.901000-0530", "c") = %o', Date.parseDate("2009-04-02T14:35:53.901000-0530", "c")); // GMT-0530 - console.log('Date.parseDate("2009-05-01T15:34:52,9876000+08:00", "c") = %o', Date.parseDate("2009-05-01T15:34:52,987600+08:00", "c")); // GMT+08:00 -console.groupEnd(); -// ISO-8601 format as specified in http://www.w3.org/TR/NOTE-datetime -// -- accepts ALL 6 levels of date-time granularity -console.group('ISO-8601 Granularity Test (see http://www.w3.org/TR/NOTE-datetime)'); - console.log('Date.parseDate("1997", "c") = %o', Date.parseDate("1997", "c")); // YYYY (e.g. 1997) - console.log('Date.parseDate("1997-07", "c") = %o', Date.parseDate("1997-07", "c")); // YYYY-MM (e.g. 1997-07) - console.log('Date.parseDate("1997-07-16", "c") = %o', Date.parseDate("1997-07-16", "c")); // YYYY-MM-DD (e.g. 1997-07-16) - console.log('Date.parseDate("1997-07-16T19:20+01:00", "c") = %o', Date.parseDate("1997-07-16T19:20+01:00", "c")); // YYYY-MM-DDThh:mmTZD (e.g. 1997-07-16T19:20+01:00) - console.log('Date.parseDate("1997-07-16T19:20:30+01:00", "c") = %o', Date.parseDate("1997-07-16T19:20:30+01:00", "c")); // YYYY-MM-DDThh:mm:ssTZD (e.g. 1997-07-16T19:20:30+01:00) - console.log('Date.parseDate("1997-07-16T19:20:30.45+01:00", "c") = %o', Date.parseDate("1997-07-16T19:20:30.45+01:00", "c")); // YYYY-MM-DDThh:mm:ss.sTZD (e.g. 1997-07-16T19:20:30.45+01:00) - console.log('Date.parseDate("1997-07-16 19:20:30.45+01:00", "c") = %o', Date.parseDate("1997-07-16 19:20:30.45+01:00", "c")); // YYYY-MM-DD hh:mm:ss.sTZD (e.g. 1997-07-16T19:20:30.45+01:00) - console.log('Date.parseDate("1997-13-16T19:20:30.45+01:00", "c", true)= %o', Date.parseDate("1997-13-16T19:20:30.45+01:00", "c", true)); // strict date parsing with invalid month value -console.groupEnd(); - -//*/ -/** - * @class Ext.util.MixedCollection - * @extends Ext.util.Observable - * A Collection class that maintains both numeric indexes and keys and exposes events. - * @constructor - * @param {Boolean} allowFunctions Specify true if the {@link #addAll} - * function should add function references to the collection. Defaults to - * false. - * @param {Function} keyFn A function that can accept an item of the type(s) stored in this MixedCollection - * and return the key value for that item. This is used when available to look up the key on items that - * were passed without an explicit key parameter to a MixedCollection method. Passing this parameter is - * equivalent to providing an implementation for the {@link #getKey} method. - */ Ext.util.MixedCollection = function(allowFunctions, keyFn){ this.items = []; this.map = {}; this.keys = []; this.length = 0; this.addEvents( - /** - * @event clear - * Fires when the collection is cleared. - */ + 'clear', - /** - * @event add - * Fires when an item is added to the collection. - * @param {Number} index The index at which the item was added. - * @param {Object} o The item added. - * @param {String} key The key associated with the added item. - */ + 'add', - /** - * @event replace - * Fires when an item is replaced in the collection. - * @param {String} key he key associated with the new added. - * @param {Object} old The item being replaced. - * @param {Object} new The new item. - */ + 'replace', - /** - * @event remove - * Fires when an item is removed from the collection. - * @param {Object} o The item being removed. - * @param {String} key (optional) The key associated with the removed item. - */ + 'remove', 'sort' ); @@ -11803,23 +7864,10 @@ Ext.util.MixedCollection = function(allowFunctions, keyFn){ Ext.extend(Ext.util.MixedCollection, Ext.util.Observable, { - /** - * @cfg {Boolean} allowFunctions Specify true if the {@link #addAll} - * function should add function references to the collection. Defaults to - * false. - */ + allowFunctions : false, - /** - * Adds an item to the collection. Fires the {@link #add} event when complete. - * @param {String} key

    The key to associate with the item, or the new item.

    - *

    If a {@link #getKey} implementation was specified for this MixedCollection, - * or if the key of the stored items is in a property called id, - * the MixedCollection will be able to derive the key for the new item. - * In this case just pass the new item in this parameter.

    - * @param {Object} o The item to add. - * @return {Object} The item added. - */ + add : function(key, o){ if(arguments.length == 1){ o = arguments[0]; @@ -11839,49 +7887,12 @@ Ext.extend(Ext.util.MixedCollection, Ext.util.Observable, { return o; }, - /** - * MixedCollection has a generic way to fetch keys if you implement getKey. The default implementation - * simply returns item.id but you can provide your own implementation - * to return a different value as in the following examples:
    
    -// normal way
    -var mc = new Ext.util.MixedCollection();
    -mc.add(someEl.dom.id, someEl);
    -mc.add(otherEl.dom.id, otherEl);
    -//and so on
    -
    -// using getKey
    -var mc = new Ext.util.MixedCollection();
    -mc.getKey = function(el){
    -   return el.dom.id;
    -};
    -mc.add(someEl);
    -mc.add(otherEl);
    -
    -// or via the constructor
    -var mc = new Ext.util.MixedCollection(false, function(el){
    -   return el.dom.id;
    -});
    -mc.add(someEl);
    -mc.add(otherEl);
    -     * 
    - * @param {Object} item The item for which to find the key. - * @return {Object} The key for the passed item. - */ + getKey : function(o){ return o.id; }, - /** - * Replaces an item in the collection. Fires the {@link #replace} event when complete. - * @param {String} key

    The key associated with the item to replace, or the replacement item.

    - *

    If you supplied a {@link #getKey} implementation for this MixedCollection, or if the key - * of your stored items is in a property called id, then the MixedCollection - * will be able to derive the key of the replacement item. If you want to replace an item - * with one having the same key value, then just pass the replacement item in this parameter.

    - * @param o {Object} o (optional) If the first parameter passed was a key, the item to associate - * with that key. - * @return {Object} The new item. - */ + replace : function(key, o){ if(arguments.length == 1){ o = arguments[0]; @@ -11898,13 +7909,7 @@ mc.add(otherEl); return o; }, - /** - * Adds all elements of an Array or an Object to the collection. - * @param {Object/Array} objs An Object containing properties which will be added - * to the collection, or an Array of values, each of which are added to the collection. - * Functions references will be added to the collection if {@link #allowFunctions} - * has been set to true. - */ + addAll : function(objs){ if(arguments.length > 1 || Ext.isArray(objs)){ var args = arguments.length > 1 ? arguments : objs; @@ -11920,19 +7925,9 @@ mc.add(otherEl); } }, - /** - * Executes the specified function once for every item in the collection, passing the following arguments: - *
      - *
    • item : Mixed

      The collection item

    • - *
    • index : Number

      The item's index

    • - *
    • length : Number

      The total number of items in the collection

    • - *
    - * The function should return a boolean value. Returning false from the function will stop the iteration. - * @param {Function} fn The function to execute for each item. - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to the current item in the iteration. - */ + each : function(fn, scope){ - var items = [].concat(this.items); // each safe for removal + var items = [].concat(this.items); for(var i = 0, len = items.length; i < len; i++){ if(fn.call(scope || items[i], items[i], i, len) === false){ break; @@ -11940,25 +7935,14 @@ mc.add(otherEl); } }, - /** - * Executes the specified function once for every key in the collection, passing each - * key, and its associated item as the first two parameters. - * @param {Function} fn The function to execute for each item. - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to the browser window. - */ + eachKey : function(fn, scope){ for(var i = 0, len = this.keys.length; i < len; i++){ fn.call(scope || window, this.keys[i], this.items[i], i, len); } }, - /** - * Returns the first item in the collection which elicits a true return value from the - * passed selection function. - * @param {Function} fn The selection function to execute for each item. - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to the browser window. - * @return {Object} The first item in the collection which returned true from the selection function. - */ + find : function(fn, scope){ for(var i = 0, len = this.items.length; i < len; i++){ if(fn.call(scope || window, this.items[i], this.keys[i])){ @@ -11968,13 +7952,7 @@ mc.add(otherEl); return null; }, - /** - * Inserts an item at the specified index in the collection. Fires the {@link #add} event when complete. - * @param {Number} index The index to insert the item at. - * @param {String} key The key to associate with the new item, or the item itself. - * @param {Object} o (optional) If the second parameter was a key, the new item. - * @return {Object} The item inserted. - */ + insert : function(index, key, o){ if(arguments.length == 2){ o = arguments[1]; @@ -11998,20 +7976,12 @@ mc.add(otherEl); return o; }, - /** - * Remove an item from the collection. - * @param {Object} o The item to remove. - * @return {Object} The item removed or false if no item was removed. - */ + remove : function(o){ return this.removeAt(this.indexOf(o)); }, - /** - * Remove an item from a specified index in the collection. Fires the {@link #remove} event when complete. - * @param {Number} index The index within the collection of the item to remove. - * @return {Object} The item removed or false if no item was removed. - */ + removeAt : function(index){ if(index < this.length && index >= 0){ this.length--; @@ -12028,94 +7998,54 @@ mc.add(otherEl); return false; }, - /** - * Removed an item associated with the passed key fom the collection. - * @param {String} key The key of the item to remove. - * @return {Object} The item removed or false if no item was removed. - */ + removeKey : function(key){ return this.removeAt(this.indexOfKey(key)); }, - /** - * Returns the number of items in the collection. - * @return {Number} the number of items in the collection. - */ + getCount : function(){ return this.length; }, - /** - * Returns index within the collection of the passed Object. - * @param {Object} o The item to find the index of. - * @return {Number} index of the item. Returns -1 if not found. - */ + indexOf : function(o){ return this.items.indexOf(o); }, - /** - * Returns index within the collection of the passed key. - * @param {String} key The key to find the index of. - * @return {Number} index of the key. - */ + indexOfKey : function(key){ return this.keys.indexOf(key); }, - /** - * Returns the item associated with the passed key OR index. - * Key has priority over index. This is the equivalent - * of calling {@link #key} first, then if nothing matched calling {@link #itemAt}. - * @param {String/Number} key The key or index of the item. - * @return {Object} If the item is found, returns the item. If the item was not found, returns undefined. - * If an item was found, but is a Class, returns null. - */ + item : function(key){ var mk = this.map[key], item = mk !== undefined ? mk : (typeof key == 'number') ? this.items[key] : undefined; - return !Ext.isFunction(item) || this.allowFunctions ? item : null; // for prototype! + return typeof item != 'function' || this.allowFunctions ? item : null; }, - /** - * Returns the item at the specified index. - * @param {Number} index The index of the item. - * @return {Object} The item at the specified index. - */ + itemAt : function(index){ return this.items[index]; }, - /** - * Returns the item associated with the passed key. - * @param {String/Number} key The key of the item. - * @return {Object} The item associated with the passed key. - */ + key : function(key){ return this.map[key]; }, - /** - * Returns true if the collection contains the passed Object as an item. - * @param {Object} o The Object to look for in the collection. - * @return {Boolean} True if the collection contains the Object as an item. - */ + contains : function(o){ return this.indexOf(o) != -1; }, - /** - * Returns true if the collection contains the passed Object as a key. - * @param {String} key The key to look for in the collection. - * @return {Boolean} True if the collection contains the Object as a key. - */ + containsKey : function(key){ return typeof this.map[key] != 'undefined'; }, - /** - * Removes all items from the collection. Fires the {@link #clear} event when complete. - */ + clear : function(){ this.length = 0; this.items = []; @@ -12124,56 +8054,41 @@ mc.add(otherEl); this.fireEvent('clear'); }, - /** - * Returns the first item in the collection. - * @return {Object} the first item in the collection.. - */ + first : function(){ return this.items[0]; }, - /** - * Returns the last item in the collection. - * @return {Object} the last item in the collection.. - */ + last : function(){ return this.items[this.length-1]; }, - /** - * @private - * Performs the actual sorting based on a direction and a sorting function. Internally, - * this creates a temporary array of all items in the MixedCollection, sorts it and then writes - * the sorted array data back into this.items and this.keys - * @param {String} property Property to sort by ('key', 'value', or 'index') - * @param {String} dir (optional) Direction to sort 'ASC' or 'DESC'. Defaults to 'ASC'. - * @param {Function} fn (optional) Comparison function that defines the sort order. - * Defaults to sorting by numeric value. - */ + _sort : function(property, dir, fn){ var i, len, dsc = String(dir).toUpperCase() == 'DESC' ? -1 : 1, + - //this is a temporary array used to apply the sorting function c = [], keys = this.keys, items = this.items; + - //default to a simple sorter function if one is not provided fn = fn || function(a, b) { return a - b; }; + - //copy all the items into a temporary array, which we will sort for(i = 0, len = items.length; i < len; i++){ c[c.length] = { - key : keys[i], - value: items[i], + key : keys[i], + value: items[i], index: i }; } + - //sort the temporary array c.sort(function(a, b){ var v = fn(a[property], b[property]) * dsc; if(v === 0){ @@ -12181,70 +8096,56 @@ mc.add(otherEl); } return v; }); + - //copy the temporary array back into the main this.items and this.keys objects for(i = 0, len = c.length; i < len; i++){ items[i] = c[i].value; keys[i] = c[i].key; } - + this.fireEvent('sort', this); }, - /** - * Sorts this collection by item value with the passed comparison function. - * @param {String} direction (optional) 'ASC' or 'DESC'. Defaults to 'ASC'. - * @param {Function} fn (optional) Comparison function that defines the sort order. - * Defaults to sorting by numeric value. - */ + sort : function(dir, fn){ this._sort('value', dir, fn); }, + - /** - * Reorders each of the items based on a mapping from old index to new index. Internally this - * just translates into a sort. The 'sort' event is fired whenever reordering has occured. - * @param {Object} mapping Mapping from old item index to new item index - */ reorder: function(mapping) { this.suspendEvents(); - + var items = this.items, index = 0, length = items.length, order = [], remaining = []; + - //object of {oldPosition: newPosition} reversed to {newPosition: oldPosition} for (oldIndex in mapping) { order[mapping[oldIndex]] = items[oldIndex]; - } - + } + for (index = 0; index < length; index++) { if (mapping[index] == undefined) { remaining.push(items[index]); } } - + for (index = 0; index < length; index++) { if (order[index] == undefined) { order[index] = remaining.shift(); } } - + this.clear(); this.addAll(order); - + this.resumeEvents(); this.fireEvent('sort', this); }, - /** - * Sorts this collection by keys. - * @param {String} direction (optional) 'ASC' or 'DESC'. Defaults to 'ASC'. - * @param {Function} fn (optional) Comparison function that defines the sort order. - * Defaults to sorting by case insensitive string. - */ + keySort : function(dir, fn){ this._sort('key', dir, fn || function(a, b){ var v1 = String(a).toUpperCase(), v2 = String(b).toUpperCase(); @@ -12252,12 +8153,7 @@ mc.add(otherEl); }); }, - /** - * Returns a range of items in this collection - * @param {Number} startIndex (optional) The starting index. Defaults to 0. - * @param {Number} endIndex (optional) The ending index. Defaults to the last item. - * @return {Array} An array of items - */ + getRange : function(start, end){ var items = this.items; if(items.length < 1){ @@ -12278,16 +8174,7 @@ mc.add(otherEl); return r; }, - /** - * Filter the objects in this collection by a specific property. - * Returns a new collection that has been filtered. - * @param {String} property A property on your objects - * @param {String/RegExp} value Either string that the property values - * should start with or a RegExp to test against the property - * @param {Boolean} anyMatch (optional) True to match any part of the string, not just the beginning - * @param {Boolean} caseSensitive (optional) True for case sensitive comparison (defaults to False). - * @return {MixedCollection} The new filtered collection - */ + filter : function(property, value, anyMatch, caseSensitive){ if(Ext.isEmpty(value, false)){ return this.clone(); @@ -12298,14 +8185,7 @@ mc.add(otherEl); }); }, - /** - * Filter by a function. Returns a new collection that has been filtered. - * The passed function will be called with each object in the collection. - * If the function returns true, the value is included otherwise it is filtered. - * @param {Function} fn The function to be called, it will receive the args o (the object), k (the key) - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to this MixedCollection. - * @return {MixedCollection} The new filtered collection - */ + filterBy : function(fn, scope){ var r = new Ext.util.MixedCollection(); r.getKey = this.getKey; @@ -12318,16 +8198,7 @@ mc.add(otherEl); return r; }, - /** - * Finds the index of the first matching object in this collection by a specific property/value. - * @param {String} property The name of a property on your objects. - * @param {String/RegExp} value A string that the property values - * should start with or a RegExp to test against the property. - * @param {Number} start (optional) The index to start searching at (defaults to 0). - * @param {Boolean} anyMatch (optional) True to match any part of the string, not just the beginning. - * @param {Boolean} caseSensitive (optional) True for case sensitive comparison. - * @return {Number} The matched index or -1 - */ + findIndex : function(property, value, start, anyMatch, caseSensitive){ if(Ext.isEmpty(value, false)){ return -1; @@ -12338,14 +8209,7 @@ mc.add(otherEl); }, null, start); }, - /** - * Find the index of the first matching object in this collection by a function. - * If the function returns true it is considered a match. - * @param {Function} fn The function to be called, it will receive the args o (the object), k (the key). - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to this MixedCollection. - * @param {Number} start (optional) The index to start searching at (defaults to 0). - * @return {Number} The matched index or -1 - */ + findIndexBy : function(fn, scope, start){ var k = this.keys, it = this.items; for(var i = (start||0), len = it.length; i < len; i++){ @@ -12356,20 +8220,12 @@ mc.add(otherEl); return -1; }, - /** - * Returns a regular expression based on the given value and matching options. This is used internally for finding and filtering, - * and by Ext.data.Store#filter - * @private - * @param {String} value The value to create the regex for. This is escaped using Ext.escapeRe - * @param {Boolean} anyMatch True to allow any match - no regex start/end line anchors will be added. Defaults to false - * @param {Boolean} caseSensitive True to make the regex case sensitive (adds 'i' switch to regex). Defaults to false. - * @param {Boolean} exactMatch True to force exact match (^ and $ characters added to the regex). Defaults to false. Ignored if anyMatch is true. - */ + createValueMatcher : function(value, anyMatch, caseSensitive, exactMatch) { - if (!value.exec) { // not a regex + if (!value.exec) { var er = Ext.escapeRe; value = String(value); - + if (anyMatch === true) { value = er(value); } else { @@ -12383,10 +8239,7 @@ mc.add(otherEl); return value; }, - /** - * Creates a shallow copy of this collection - * @return {MixedCollection} - */ + clone : function(){ var r = new Ext.util.MixedCollection(); var k = this.keys, it = this.items; @@ -12397,23 +8250,9 @@ mc.add(otherEl); return r; } }); -/** - * This method calls {@link #item item()}. - * Returns the item associated with the passed key OR index. Key has priority - * over index. This is the equivalent of calling {@link #key} first, then if - * nothing matched calling {@link #itemAt}. - * @param {String/Number} key The key or index of the item. - * @return {Object} If the item is found, returns the item. If the item was - * not found, returns undefined. If an item was found, but is a Class, - * returns null. - */ -Ext.util.MixedCollection.prototype.get = Ext.util.MixedCollection.prototype.item;/** - * @class Ext.util.JSON - * Modified version of Douglas Crockford"s json.js that doesn"t - * mess with the Object prototype - * http://www.json.org/js.html - * @singleton - */ + +Ext.util.MixedCollection.prototype.get = Ext.util.MixedCollection.prototype.item; + Ext.util.JSON = new (function(){ var useHasOwn = !!{}.hasOwnProperty, isNative = function() { @@ -12443,14 +8282,14 @@ Ext.util.JSON = new (function(){ }else if(Ext.isString(o)){ return encodeString(o); }else if(typeof o == "number"){ - //don't use isNumber here, since finite checks happen inside isNumber + return isFinite(o) ? String(o) : "null"; }else if(Ext.isBoolean(o)){ return String(o); }else { var a = ["{"], b, i, v; for (i in o) { - // don't encode DOM objects + if(!o.getElementsByTagName){ if(!useHasOwn || o.hasOwnProperty(i)) { v = o[i]; @@ -12519,18 +8358,7 @@ Ext.util.JSON = new (function(){ return a.join(""); }; - /** - *

    Encodes a Date. This returns the actual string which is inserted into the JSON string as the literal expression. - * The returned value includes enclosing double quotation marks.

    - *

    The default return format is "yyyy-mm-ddThh:mm:ss".

    - *

    To override this:

    
    -Ext.util.JSON.encodeDate = function(d) {
    -    return d.format('"Y-m-d"');
    -};
    -
    - * @param {Date} d The Date to encode - * @return {String} The string literal to use in a JSON string. - */ + this.encodeDate = function(o){ return '"' + o.getFullYear() + "-" + pad(o.getMonth() + 1) + "-" + @@ -12540,16 +8368,12 @@ Ext.util.JSON.encodeDate = function(d) { pad(o.getSeconds()) + '"'; }; - /** - * Encodes an Object, Array or other value - * @param {Mixed} o The variable to encode - * @return {String} The JSON string - */ + this.encode = function() { var ec; return function(o) { if (!ec) { - // setup encoding function on first access + ec = isNative() ? JSON.stringify : doEncode; } return ec(o); @@ -12557,16 +8381,12 @@ Ext.util.JSON.encodeDate = function(d) { }(); - /** - * Decodes (parses) a JSON string to an object. If the JSON is invalid, this function throws a SyntaxError unless the safe option is set. - * @param {String} json The JSON string - * @return {Object} The resulting object - */ + this.decode = function() { var dc; return function(json) { if (!dc) { - // setup decoding function on first access + dc = isNative() ? JSON.parse : doDecode; } return dc(json); @@ -12574,28 +8394,11 @@ Ext.util.JSON.encodeDate = function(d) { }(); })(); -/** - * Shorthand for {@link Ext.util.JSON#encode} - * @param {Mixed} o The variable to encode - * @return {String} The JSON string - * @member Ext - * @method encode - */ + Ext.encode = Ext.util.JSON.encode; -/** - * Shorthand for {@link Ext.util.JSON#decode} - * @param {String} json The JSON string - * @param {Boolean} safe (optional) Whether to return null or throw an exception if the JSON is invalid. - * @return {Object} The resulting object - * @member Ext - * @method decode - */ + Ext.decode = Ext.util.JSON.decode; -/** - * @class Ext.util.Format - * Reusable data formatting functions - * @singleton - */ + Ext.util.Format = function(){ var trimRe = /^\s+|\s+$/g, stripTagsRE = /<\/?[^>]+>/gi, @@ -12603,13 +8406,7 @@ Ext.util.Format = function(){ nl2brRe = /\r?\n/g; return { - /** - * Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length - * @param {String} value The string to truncate - * @param {Number} length The maximum length to allow before truncating - * @param {Boolean} word True to try to find a common work break - * @return {String} The converted text - */ + ellipsis : function(value, len, word){ if(value && value.length > len){ if(word){ @@ -12627,91 +8424,52 @@ Ext.util.Format = function(){ return value; }, - /** - * Checks a reference and converts it to empty string if it is undefined - * @param {Mixed} value Reference to check - * @return {Mixed} Empty string if converted, otherwise the original value - */ + undef : function(value){ return value !== undefined ? value : ""; }, - /** - * Checks a reference and converts it to the default value if it's empty - * @param {Mixed} value Reference to check - * @param {String} defaultValue The value to insert of it's undefined (defaults to "") - * @return {String} - */ + defaultValue : function(value, defaultValue){ return value !== undefined && value !== '' ? value : defaultValue; }, - /** - * Convert certain characters (&, <, >, and ') to their HTML character equivalents for literal display in web pages. - * @param {String} value The string to encode - * @return {String} The encoded text - */ + htmlEncode : function(value){ return !value ? value : String(value).replace(/&/g, "&").replace(/>/g, ">").replace(/, and ') from their HTML character equivalents. - * @param {String} value The string to decode - * @return {String} The decoded text - */ + htmlDecode : function(value){ return !value ? value : String(value).replace(/>/g, ">").replace(/</g, "<").replace(/"/g, '"').replace(/&/g, "&"); }, - /** - * Trims any whitespace from either side of a string - * @param {String} value The text to trim - * @return {String} The trimmed text - */ + trim : function(value){ return String(value).replace(trimRe, ""); }, - /** - * Returns a substring from within an original string - * @param {String} value The original text - * @param {Number} start The start index of the substring - * @param {Number} length The length of the substring - * @return {String} The substring - */ + substr : function(value, start, length){ return String(value).substr(start, length); }, - /** - * Converts a string to all lower case letters - * @param {String} value The text to convert - * @return {String} The converted text - */ + lowercase : function(value){ return String(value).toLowerCase(); }, - /** - * Converts a string to all upper case letters - * @param {String} value The text to convert - * @return {String} The converted text - */ + uppercase : function(value){ return String(value).toUpperCase(); }, - /** - * Converts the first character only of a string to upper case - * @param {String} value The text to convert - * @return {String} The converted text - */ + capitalize : function(value){ return !value ? value : value.charAt(0).toUpperCase() + value.substr(1).toLowerCase(); }, - // private + call : function(value, fn){ if(arguments.length > 2){ var args = Array.prototype.slice.call(arguments, 2); @@ -12722,11 +8480,7 @@ Ext.util.Format = function(){ } }, - /** - * Format a number as US currency - * @param {Number/String} value The numeric value to format - * @return {String} The formatted currency string - */ + usMoney : function(v){ v = (Math.round((v-0)*100))/100; v = (v == Math.floor(v)) ? v + ".00" : ((v*10 == Math.floor(v*10)) ? v + "0" : v); @@ -12745,12 +8499,7 @@ Ext.util.Format = function(){ return "$" + v; }, - /** - * Parse a value into a formatted date using the specified format pattern. - * @param {String/Date} value The value to format (Strings must conform to the format expected by the javascript Date object's parse() method) - * @param {String} format (optional) Any valid date format string (defaults to 'm/d/Y') - * @return {String} The formatted date string - */ + date : function(v, format){ if(!v){ return ""; @@ -12761,40 +8510,24 @@ Ext.util.Format = function(){ return v.dateFormat(format || "m/d/Y"); }, - /** - * Returns a date rendering function that can be reused to apply a date format multiple times efficiently - * @param {String} format Any valid date format string - * @return {Function} The date formatting function - */ + dateRenderer : function(format){ return function(v){ return Ext.util.Format.date(v, format); }; }, - /** - * Strips all HTML tags - * @param {Mixed} value The text from which to strip tags - * @return {String} The stripped text - */ + stripTags : function(v){ return !v ? v : String(v).replace(stripTagsRE, ""); }, - /** - * Strips all script tags - * @param {Mixed} value The text from which to strip script tags - * @return {String} The stripped text - */ + stripScripts : function(v){ return !v ? v : String(v).replace(stripScriptsRe, ""); }, - /** - * Simple format for a file size (xxx bytes, xxx KB, xxx MB) - * @param {Number/String} size The numeric value to format - * @return {String} The formatted file size - */ + fileSize : function(size){ if(size < 1024) { return size + " bytes"; @@ -12805,12 +8538,7 @@ Ext.util.Format = function(){ } }, - /** - * It does simple math for use in a template, for example:
    
    -         * var tpl = new Ext.Template('{value} * 10 = {value:math("* 10")}');
    -         * 
    - * @return {Function} A function that operates on the passed value. - */ + math : function(){ var fns = {}; return function(v, a){ @@ -12821,12 +8549,7 @@ Ext.util.Format = function(){ } }(), - /** - * Rounds the passed number to the required decimal precision. - * @param {Number/String} value The numeric value to round. - * @param {Number} precision The number of decimal places to which to round the first parameter's value. - * @return {Number} The rounded value. - */ + round : function(value, precision) { var result = Number(value); if (typeof precision == 'number') { @@ -12836,23 +8559,7 @@ Ext.util.Format = function(){ return result; }, - /** - * Formats the number according to the format string. - *
    examples (123456.789): - *
    - * 0 - (123456) show only digits, no precision
    - * 0.00 - (123456.78) show only digits, 2 precision
    - * 0.0000 - (123456.7890) show only digits, 4 precision
    - * 0,000 - (123,456) show comma and digits, no precision
    - * 0,000.00 - (123,456.78) show comma and digits, 2 precision
    - * 0,0.00 - (123,456.78) shortcut method, show comma and digits, 2 precision
    - * To reverse the grouping (,) and decimal (.) for international numbers, add /i to the end. - * For example: 0.000,00/i - *
    - * @param {Number} v The number to format. - * @param {String} format The way you would like to format this text. - * @return {String} The formatted number. - */ + number: function(v, format) { if(!format){ return v; @@ -12912,339 +8619,54 @@ Ext.util.Format = function(){ return (neg ? '-' : '') + format.replace(/[\d,?\.?]+/, fnum); }, - /** - * Returns a number rendering function that can be reused to apply a number format multiple times efficiently - * @param {String} format Any valid number format string for {@link #number} - * @return {Function} The number formatting function - */ + numberRenderer : function(format){ return function(v){ return Ext.util.Format.number(v, format); }; }, - /** - * Selectively do a plural form of a word based on a numeric value. For example, in a template, - * {commentCount:plural("Comment")} would result in "1 Comment" if commentCount was 1 or would be "x Comments" - * if the value is 0 or greater than 1. - * @param {Number} value The value to compare against - * @param {String} singular The singular form of the word - * @param {String} plural (optional) The plural form of the word (defaults to the singular with an "s") - */ + plural : function(v, s, p){ return v +' ' + (v == 1 ? s : (p ? p : s+'s')); }, - /** - * Converts newline characters to the HTML tag <br/> - * @param {String} The string value to format. - * @return {String} The string with embedded <br/> tags in place of newlines. - */ + nl2br : function(v){ return Ext.isEmpty(v) ? '' : v.replace(nl2brRe, '
    '); } } }(); -/** - * @class Ext.XTemplate - * @extends Ext.Template - *

    A template class that supports advanced functionality like:

      - *
    • Autofilling arrays using templates and sub-templates
    • - *
    • Conditional processing with basic comparison operators
    • - *
    • Basic math function support
    • - *
    • Execute arbitrary inline code with special built-in template variables
    • - *
    • Custom member functions
    • - *
    • Many special tags and built-in operators that aren't defined as part of - * the API, but are supported in the templates that can be created
    • - *

    - *

    XTemplate provides the templating mechanism built into:

      - *
    • {@link Ext.DataView}
    • - *
    • {@link Ext.ListView}
    • - *
    • {@link Ext.form.ComboBox}
    • - *
    • {@link Ext.grid.TemplateColumn}
    • - *
    • {@link Ext.grid.GroupingView}
    • - *
    • {@link Ext.menu.Item}
    • - *
    • {@link Ext.layout.MenuLayout}
    • - *
    • {@link Ext.ColorPalette}
    • - *

    - * - *

    For example usage {@link #XTemplate see the constructor}.

    - * - * @constructor - * The {@link Ext.Template#Template Ext.Template constructor} describes - * the acceptable parameters to pass to the constructor. The following - * examples demonstrate all of the supported features.

    - * - *
      - * - *
    • Sample Data - *
      - *

      This is the data object used for reference in each code example:

      - *
      
      -var data = {
      -    name: 'Jack Slocum',
      -    title: 'Lead Developer',
      -    company: 'Ext JS, LLC',
      -    email: 'jack@extjs.com',
      -    address: '4 Red Bulls Drive',
      -    city: 'Cleveland',
      -    state: 'Ohio',
      -    zip: '44102',
      -    drinks: ['Red Bull', 'Coffee', 'Water'],
      -    kids: [{
      -        name: 'Sara Grace',
      -        age:3
      -    },{
      -        name: 'Zachary',
      -        age:2
      -    },{
      -        name: 'John James',
      -        age:0
      -    }]
      -};
      - * 
      - *
      - *
    • - * - * - *
    • Auto filling of arrays - *
      - *

      The tpl tag and the for operator are used - * to process the provided data object: - *

        - *
      • If the value specified in for is an array, it will auto-fill, - * repeating the template block inside the tpl tag for each item in the - * array.
      • - *
      • If for="." is specified, the data object provided is examined.
      • - *
      • While processing an array, the special variable {#} - * will provide the current array index + 1 (starts at 1, not 0).
      • - *
      - *

      - *
      
      -<tpl for=".">...</tpl>       // loop through array at root node
      -<tpl for="foo">...</tpl>     // loop through array at foo node
      -<tpl for="foo.bar">...</tpl> // loop through array at foo.bar node
      - * 
      - * Using the sample data above: - *
      
      -var tpl = new Ext.XTemplate(
      -    '<p>Kids: ',
      -    '<tpl for=".">',       // process the data.kids node
      -        '<p>{#}. {name}</p>',  // use current array index to autonumber
      -    '</tpl></p>'
      -);
      -tpl.overwrite(panel.body, data.kids); // pass the kids property of the data object
      - * 
      - *

      An example illustrating how the for property can be leveraged - * to access specified members of the provided data object to populate the template:

      - *
      
      -var tpl = new Ext.XTemplate(
      -    '<p>Name: {name}</p>',
      -    '<p>Title: {title}</p>',
      -    '<p>Company: {company}</p>',
      -    '<p>Kids: ',
      -    '<tpl for="kids">',     // interrogate the kids property within the data
      -        '<p>{name}</p>',
      -    '</tpl></p>'
      -);
      -tpl.overwrite(panel.body, data);  // pass the root node of the data object
      - * 
      - *

      Flat arrays that contain values (and not objects) can be auto-rendered - * using the special {.} variable inside a loop. This variable - * will represent the value of the array at the current index:

      - *
      
      -var tpl = new Ext.XTemplate(
      -    '<p>{name}\'s favorite beverages:</p>',
      -    '<tpl for="drinks">',
      -       '<div> - {.}</div>',
      -    '</tpl>'
      -);
      -tpl.overwrite(panel.body, data);
      - * 
      - *

      When processing a sub-template, for example while looping through a child array, - * you can access the parent object's members via the parent object:

      - *
      
      -var tpl = new Ext.XTemplate(
      -    '<p>Name: {name}</p>',
      -    '<p>Kids: ',
      -    '<tpl for="kids">',
      -        '<tpl if="age > 1">',
      -            '<p>{name}</p>',
      -            '<p>Dad: {parent.name}</p>',
      -        '</tpl>',
      -    '</tpl></p>'
      -);
      -tpl.overwrite(panel.body, data);
      - * 
      - *
      - *
    • - * - * - *
    • Conditional processing with basic comparison operators - *
      - *

      The tpl tag and the if operator are used - * to provide conditional checks for deciding whether or not to render specific - * parts of the template. Notes:

        - *
      • Double quotes must be encoded if used within the conditional
      • - *
      • There is no else operator — if needed, two opposite - * if statements should be used.
      • - *
      - *
      
      -<tpl if="age > 1 && age < 10">Child</tpl>
      -<tpl if="age >= 10 && age < 18">Teenager</tpl>
      -<tpl if="this.isGirl(name)">...</tpl>
      -<tpl if="id==\'download\'">...</tpl>
      -<tpl if="needsIcon"><img src="{icon}" class="{iconCls}"/></tpl>
      -// no good:
      -<tpl if="name == "Jack"">Hello</tpl>
      -// encode " if it is part of the condition, e.g.
      -<tpl if="name == &quot;Jack&quot;">Hello</tpl>
      - * 
      - * Using the sample data above: - *
      
      -var tpl = new Ext.XTemplate(
      -    '<p>Name: {name}</p>',
      -    '<p>Kids: ',
      -    '<tpl for="kids">',
      -        '<tpl if="age > 1">',
      -            '<p>{name}</p>',
      -        '</tpl>',
      -    '</tpl></p>'
      -);
      -tpl.overwrite(panel.body, data);
      - * 
      - *
      - *
    • - * - * - *
    • Basic math support - *
      - *

      The following basic math operators may be applied directly on numeric - * data values:

      - * + - * /
      - * 
      - * For example: - *
      
      -var tpl = new Ext.XTemplate(
      -    '<p>Name: {name}</p>',
      -    '<p>Kids: ',
      -    '<tpl for="kids">',
      -        '<tpl if="age &gt; 1">',  // <-- Note that the > is encoded
      -            '<p>{#}: {name}</p>',  // <-- Auto-number each item
      -            '<p>In 5 Years: {age+5}</p>',  // <-- Basic math
      -            '<p>Dad: {parent.name}</p>',
      -        '</tpl>',
      -    '</tpl></p>'
      -);
      -tpl.overwrite(panel.body, data);
      -
      - *
      - *
    • - * - * - *
    • Execute arbitrary inline code with special built-in template variables - *
      - *

      Anything between {[ ... ]} is considered code to be executed - * in the scope of the template. There are some special variables available in that code: - *

        - *
      • values: The values in the current scope. If you are using - * scope changing sub-templates, you can change what values is.
      • - *
      • parent: The scope (values) of the ancestor template.
      • - *
      • xindex: If you are in a looping template, the index of the - * loop you are in (1-based).
      • - *
      • xcount: If you are in a looping template, the total length - * of the array you are looping.
      • - *
      • fm: An alias for Ext.util.Format.
      • - *
      - * This example demonstrates basic row striping using an inline code block and the - * xindex variable:

      - *
      
      -var tpl = new Ext.XTemplate(
      -    '<p>Name: {name}</p>',
      -    '<p>Company: {[values.company.toUpperCase() + ", " + values.title]}</p>',
      -    '<p>Kids: ',
      -    '<tpl for="kids">',
      -       '<div class="{[xindex % 2 === 0 ? "even" : "odd"]}">',
      -        '{name}',
      -        '</div>',
      -    '</tpl></p>'
      -);
      -tpl.overwrite(panel.body, data);
      - * 
      - *
      - *
    • - * - *
    • Template member functions - *
      - *

      One or more member functions can be specified in a configuration - * object passed into the XTemplate constructor for more complex processing:

      - *
      
      -var tpl = new Ext.XTemplate(
      -    '<p>Name: {name}</p>',
      -    '<p>Kids: ',
      -    '<tpl for="kids">',
      -        '<tpl if="this.isGirl(name)">',
      -            '<p>Girl: {name} - {age}</p>',
      -        '</tpl>',
      -        // use opposite if statement to simulate 'else' processing:
      -        '<tpl if="this.isGirl(name) == false">',
      -            '<p>Boy: {name} - {age}</p>',
      -        '</tpl>',
      -        '<tpl if="this.isBaby(age)">',
      -            '<p>{name} is a baby!</p>',
      -        '</tpl>',
      -    '</tpl></p>',
      -    {
      -        // XTemplate configuration:
      -        compiled: true,
      -        disableFormats: true,
      -        // member functions:
      -        isGirl: function(name){
      -            return name == 'Sara Grace';
      -        },
      -        isBaby: function(age){
      -            return age < 1;
      -        }
      -    }
      -);
      -tpl.overwrite(panel.body, data);
      - * 
      - *
      - *
    • - * - *
    - * - * @param {Mixed} config - */ + Ext.XTemplate = function(){ Ext.XTemplate.superclass.constructor.apply(this, arguments); var me = this, - s = me.html, - re = /]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/, - nameRe = /^]*?for="(.*?)"/, - ifRe = /^]*?if="(.*?)"/, - execRe = /^]*?exec="(.*?)"/, - m, - id = 0, - tpls = [], - VALUES = 'values', - PARENT = 'parent', - XINDEX = 'xindex', - XCOUNT = 'xcount', - RETURN = 'return ', - WITHVALUES = 'with(values){ '; + s = me.html, + re = /]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/, + nameRe = /^]*?for="(.*?)"/, + ifRe = /^]*?if="(.*?)"/, + execRe = /^]*?exec="(.*?)"/, + m, + id = 0, + tpls = [], + VALUES = 'values', + PARENT = 'parent', + XINDEX = 'xindex', + XCOUNT = 'xcount', + RETURN = 'return ', + WITHVALUES = 'with(values){ '; s = ['', s, ''].join(''); while((m = s.match(re))){ - var m2 = m[0].match(nameRe), - m3 = m[0].match(ifRe), - m4 = m[0].match(execRe), - exp = null, - fn = null, - exec = null, - name = m2 && m2[1] ? m2[1] : ''; + var m2 = m[0].match(nameRe), + m3 = m[0].match(ifRe), + m4 = m[0].match(execRe), + exp = null, + fn = null, + exec = null, + name = m2 && m2[1] ? m2[1] : ''; if (m3) { exp = m3 && m3[1] ? m3[1] : null; @@ -13275,25 +8697,25 @@ Ext.XTemplate = function(){ s = s.replace(m[0], '{xtpl'+ id + '}'); ++id; } - Ext.each(tpls, function(t) { - me.compileTpl(t); - }); + for(var i = tpls.length-1; i >= 0; --i){ + me.compileTpl(tpls[i]); + } me.master = tpls[tpls.length-1]; me.tpls = tpls; }; Ext.extend(Ext.XTemplate, Ext.Template, { - // private + re : /\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g, - // private + codeRe : /\{\[((?:\\\]|.|\n)*?)\]\}/g, - // private + applySubTemplate : function(id, values, parent, xindex, xcount){ var me = this, - len, - t = me.tpls[id], - vs, - buf = []; + len, + t = me.tpls[id], + vs, + buf = []; if ((t.test && !t.test.call(me, values, parent, xindex, xcount)) || (t.exec && t.exec.call(me, values, parent, xindex, xcount))) { return ''; @@ -13302,18 +8724,18 @@ Ext.extend(Ext.XTemplate, Ext.Template, { len = vs.length; parent = t.target ? values : parent; if(t.target && Ext.isArray(vs)){ - Ext.each(vs, function(v, i) { - buf[buf.length] = t.compiled.call(me, v, parent, i+1, len); - }); + for(var i = 0, len = vs.length; i < len; i++){ + buf[buf.length] = t.compiled.call(me, vs[i], parent, i+1, len); + } return buf.join(''); } return t.compiled.call(me, vs, parent, xindex, xcount); }, - // private + compileTpl : function(tpl){ var fm = Ext.util.Format, - useF = this.disableFormats !== true, + useF = this.disableFormats !== true, sep = Ext.isGecko ? "+" : ",", body; @@ -13349,11 +8771,11 @@ Ext.extend(Ext.XTemplate, Ext.Template, { } function codeFn(m, code){ - // Single quotes get escaped when the template is compiled, however we want to undo this when running code. + return "'" + sep + '(' + code.replace(/\\'/g, "'") + ')' + sep + "'"; } - // branched to use + in gecko and [].join() in others + if(Ext.isGecko){ body = "tpl.compiled = function(values, parent, xindex, xcount){ return '" + tpl.body.replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn).replace(this.codeRe, codeFn) + @@ -13368,59 +8790,28 @@ Ext.extend(Ext.XTemplate, Ext.Template, { return this; }, - /** - * Returns an HTML fragment of this template with the specified values applied. - * @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'}) - * @return {String} The HTML fragment - */ + applyTemplate : function(values){ return this.master.compiled.call(this, values, {}, 1, 1); }, - /** - * Compile the template to a function for optimized performance. Recommended if the template will be used frequently. - * @return {Function} The compiled function - */ + compile : function(){return this;} - /** - * @property re - * @hide - */ - /** - * @property disableFormats - * @hide - */ - /** - * @method set - * @hide - */ + + + }); -/** - * Alias for {@link #applyTemplate} - * Returns an HTML fragment of this template with the specified values applied. - * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'}) - * @return {String} The HTML fragment - * @member Ext.XTemplate - * @method apply - */ + Ext.XTemplate.prototype.apply = Ext.XTemplate.prototype.applyTemplate; -/** - * Creates a template from the passed element's value (display:none textarea, preferred) or innerHTML. - * @param {String/HTMLElement} el A DOM element or its id - * @return {Ext.Template} The created template - * @static - */ + Ext.XTemplate.from = function(el){ el = Ext.getDom(el); return new Ext.XTemplate(el.value || el.innerHTML); -};/** - * @class Ext.util.CSS - * Utility class for manipulating CSS rules - * @singleton - */ +}; + Ext.util.CSS = function(){ var rules = null; var doc = document; @@ -13429,13 +8820,7 @@ Ext.util.CSS = function(){ var camelFn = function(m, a){ return a.charAt(1).toUpperCase(); }; return { - /** - * Creates a stylesheet from a text blob of rules. - * These rules will be wrapped in a STYLE tag and appended to the HEAD of the document. - * @param {String} cssText The text containing the css rules - * @param {String} id An id to add to the stylesheet for later removal - * @return {StyleSheet} - */ + createStyleSheet : function(cssText, id){ var ss; var head = doc.getElementsByTagName("head")[0]; @@ -13461,10 +8846,7 @@ Ext.util.CSS = function(){ return ss; }, - /** - * Removes a style or link tag by id - * @param {String} id The id of the tag - */ + removeStyleSheet : function(id){ var existing = doc.getElementById(id); if(existing){ @@ -13472,11 +8854,7 @@ Ext.util.CSS = function(){ } }, - /** - * Dynamically swaps an existing stylesheet reference for a new one - * @param {String} id The id of an existing link tag to remove - * @param {String} url The href of the new stylesheet to include - */ + swapStyleSheet : function(id, url){ this.removeStyleSheet(id); var ss = doc.createElement("link"); @@ -13487,20 +8865,17 @@ Ext.util.CSS = function(){ doc.getElementsByTagName("head")[0].appendChild(ss); }, - /** - * Refresh the rule cache if you have dynamically added stylesheets - * @return {Object} An object (hash) of rules indexed by selector - */ + refreshCache : function(){ return this.getRules(true); }, - // private + cacheStyleSheet : function(ss){ if(!rules){ rules = {}; } - try{// try catch for cross domain access issue + try{ var ssRules = ss.cssRules || ss.rules; for(var j = ssRules.length-1; j >= 0; --j){ rules[ssRules[j].selectorText.toLowerCase()] = ssRules[j]; @@ -13508,11 +8883,7 @@ Ext.util.CSS = function(){ }catch(e){} }, - /** - * Gets all css rules for the document - * @param {Boolean} refreshCache true to refresh the internal cache - * @return {Object} An object (hash) of rules indexed by selector - */ + getRules : function(refreshCache){ if(rules === null || refreshCache){ rules = {}; @@ -13526,12 +8897,7 @@ Ext.util.CSS = function(){ return rules; }, - /** - * Gets an an individual CSS rule by selector(s) - * @param {String/Array} selector The CSS selector or an array of selectors to try. The first selector that is found is returned. - * @param {Boolean} refreshCache true to refresh the internal cache if you have recently updated any rules or added styles dynamically - * @return {CSSRule} The CSS rule or null if one is not found - */ + getRule : function(selector, refreshCache){ var rs = this.getRules(refreshCache); if(!Ext.isArray(selector)){ @@ -13546,13 +8912,7 @@ Ext.util.CSS = function(){ }, - /** - * Updates a rule property - * @param {String/Array} selector If it's an array it tries each selector until it finds one. Stops immediately once one is found. - * @param {String} property The css property - * @param {String} value The new value for the property - * @return {Boolean} true If a rule was found and updated - */ + updateRule : function(selector, property, value){ if(!Ext.isArray(selector)){ var rule = this.getRule(selector); @@ -13570,35 +8930,7 @@ Ext.util.CSS = function(){ return false; } }; -}();/** - @class Ext.util.ClickRepeater - @extends Ext.util.Observable - - A wrapper class which can be applied to any element. Fires a "click" event while the - mouse is pressed. The interval between firings may be specified in the config but - defaults to 20 milliseconds. - - Optionally, a CSS class may be applied to the element during the time it is pressed. - - @cfg {Mixed} el The element to act as a button. - @cfg {Number} delay The initial delay before the repeating event begins firing. - Similar to an autorepeat key delay. - @cfg {Number} interval The interval between firings of the "click" event. Default 20 ms. - @cfg {String} pressClass A CSS class name to be applied to the element while pressed. - @cfg {Boolean} accelerate True if autorepeating should start slowly and accelerate. - "interval" and "delay" are ignored. - @cfg {Boolean} preventDefault True to prevent the default click event - @cfg {Boolean} stopDefault True to stop the default click event - - @history - 2007-02-02 jvs Original code contributed by Nige "Animal" White - 2007-02-02 jvs Renamed to ClickRepeater - 2007-02-03 jvs Modifications for FF Mac and Safari - - @constructor - @param {Mixed} el The element to listen on - @param {Object} config - */ +}(); Ext.util.ClickRepeater = function(el, config) { this.el = Ext.get(el); @@ -13607,23 +8939,11 @@ Ext.util.ClickRepeater = function(el, config) Ext.apply(this, config); this.addEvents( - /** - * @event mousedown - * Fires when the mouse button is depressed. - * @param {Ext.util.ClickRepeater} this - */ + "mousedown", - /** - * @event click - * Fires on a specified interval during the time the element is pressed. - * @param {Ext.util.ClickRepeater} this - */ + "click", - /** - * @event mouseup - * Fires when the mouse key is released. - * @param {Ext.util.ClickRepeater} this - */ + "mouseup" ); @@ -13632,7 +8952,7 @@ Ext.util.ClickRepeater = function(el, config) this.enable(); } - // allow inline handler + if(this.handler){ this.on("click", this.handler, this.scope || this); } @@ -13647,9 +8967,7 @@ Ext.extend(Ext.util.ClickRepeater, Ext.util.Observable, { stopDefault : false, timer : 0, - /** - * Enables the repeater and allows events to fire. - */ + enable: function(){ if(this.disabled){ this.el.on('mousedown', this.handleMouseDown, this); @@ -13663,10 +8981,8 @@ Ext.extend(Ext.util.ClickRepeater, Ext.util.Observable, { this.disabled = false; }, - /** - * Disables the repeater and stops events from firing. - */ - disable: function(/* private */ force){ + + disable: function( force){ if(force || !this.disabled){ clearTimeout(this.timer); if(this.pressClass){ @@ -13678,10 +8994,7 @@ Ext.extend(Ext.util.ClickRepeater, Ext.util.Observable, { this.disabled = true; }, - /** - * Convenience function for setting disabled/enabled by boolean. - * @param {Boolean} disabled - */ + setDisabled: function(disabled){ this[disabled ? 'disable' : 'enable'](); }, @@ -13695,7 +9008,7 @@ Ext.extend(Ext.util.ClickRepeater, Ext.util.Observable, { } }, - // private + destroy : function() { this.disable(true); Ext.destroy(this.el); @@ -13710,7 +9023,7 @@ Ext.extend(Ext.util.ClickRepeater, Ext.util.Observable, { this.fireEvent("click", this); }, - // private + handleMouseDown : function(){ clearTimeout(this.timer); this.el.blur(); @@ -13725,14 +9038,14 @@ Ext.extend(Ext.util.ClickRepeater, Ext.util.Observable, { this.fireEvent("mousedown", this); this.fireEvent("click", this); - // Do not honor delay or interval if acceleration wanted. + if (this.accelerate) { this.delay = 400; } this.timer = this.click.defer(this.delay || this.interval, this); }, - // private + click : function(){ this.fireEvent("click", this); this.timer = this.click.defer(this.accelerate ? @@ -13747,7 +9060,7 @@ Ext.extend(Ext.util.ClickRepeater, Ext.util.Observable, { return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; }, - // private + handleMouseOut : function(){ clearTimeout(this.timer); if(this.pressClass){ @@ -13756,7 +9069,7 @@ Ext.extend(Ext.util.ClickRepeater, Ext.util.Observable, { this.el.on("mouseover", this.handleMouseReturn, this); }, - // private + handleMouseReturn : function(){ this.el.un("mouseover", this.handleMouseReturn, this); if(this.pressClass){ @@ -13765,7 +9078,7 @@ Ext.extend(Ext.util.ClickRepeater, Ext.util.Observable, { this.click(); }, - // private + handleMouseUp : function(){ clearTimeout(this.timer); this.el.un("mouseover", this.handleMouseReturn, this); @@ -13774,31 +9087,7 @@ Ext.extend(Ext.util.ClickRepeater, Ext.util.Observable, { this.el.removeClass(this.pressClass); this.fireEvent("mouseup", this); } -});/** - * @class Ext.KeyNav - *

    Provides a convenient wrapper for normalized keyboard navigation. KeyNav allows you to bind - * navigation keys to function calls that will get called when the keys are pressed, providing an easy - * way to implement custom navigation schemes for any UI component.

    - *

    The following are all of the possible keys that can be implemented: enter, left, right, up, down, tab, esc, - * pageUp, pageDown, del, home, end. Usage:

    -
    
    -var nav = new Ext.KeyNav("my-element", {
    -    "left" : function(e){
    -        this.moveLeft(e.ctrlKey);
    -    },
    -    "right" : function(e){
    -        this.moveRight(e.ctrlKey);
    -    },
    -    "enter" : function(e){
    -        this.save();
    -    },
    -    scope : this
     });
    -
    - * @constructor - * @param {Mixed} el The element to bind to - * @param {Object} config The config - */ Ext.KeyNav = function(el, config){ this.el = Ext.get(el); Ext.apply(this, config); @@ -13809,27 +9098,14 @@ Ext.KeyNav = function(el, config){ }; Ext.KeyNav.prototype = { - /** - * @cfg {Boolean} disabled - * True to disable this KeyNav instance (defaults to false) - */ + disabled : false, - /** - * @cfg {String} defaultEventAction - * The method to call on the {@link Ext.EventObject} after this KeyNav intercepts a key. Valid values are - * {@link Ext.EventObject#stopEvent}, {@link Ext.EventObject#preventDefault} and - * {@link Ext.EventObject#stopPropagation} (defaults to 'stopEvent') - */ + defaultEventAction: "stopEvent", - /** - * @cfg {Boolean} forceKeyDown - * Handle the keydown event instead of keypress (defaults to false). KeyNav automatically does this for IE since - * IE does not propagate special keys on keypress, but setting this to true will force other browsers to also - * handle keydown instead of keypress. - */ + forceKeyDown : false, - // private + relay : function(e){ var k = e.getKey(); var h = this.keyToHandler[k]; @@ -13840,12 +9116,12 @@ Ext.KeyNav.prototype = { } }, - // private + doRelay : function(e, h, hname){ return h.call(this.scope || this, e); }, - // possible handlers + enter : false, left : false, right : false, @@ -13859,7 +9135,7 @@ Ext.KeyNav.prototype = { home : false, end : false, - // quick lookup hash + keyToHandler : { 37 : "left", 39 : "right", @@ -13879,26 +9155,22 @@ Ext.KeyNav.prototype = { var k = e.getKey(); if (k >= 37 && k <= 40) { - // *** bugfix - safari 2.x fires 2 keyup events on cursor keys - // *** (note: this bugfix sacrifices the "keyup" event originating from keyNav elements in Safari 2) + + e.stopEvent(); } }, - /** - * Destroy this KeyNav (this is the same as calling disable). - */ + destroy: function(){ this.disable(); }, - /** - * Enable this KeyNav - */ + enable: function() { if (this.disabled) { if (Ext.isSafari2) { - // call stopKeyUp() on "keyup" event + this.el.on('keyup', this.stopKeyUp, this); } @@ -13907,13 +9179,11 @@ Ext.KeyNav.prototype = { } }, - /** - * Disable this KeyNav - */ + disable: function() { if (!this.disabled) { if (Ext.isSafari2) { - // remove "keyup" event handler + this.el.un('keyup', this.stopKeyUp, this); } @@ -13922,65 +9192,17 @@ Ext.KeyNav.prototype = { } }, - /** - * Convenience function for setting disabled/enabled by boolean. - * @param {Boolean} disabled - */ + setDisabled : function(disabled){ this[disabled ? "disable" : "enable"](); }, - // private + isKeydown: function(){ return this.forceKeyDown || Ext.EventManager.useKeydown; } }; -/** - * @class Ext.KeyMap - * Handles mapping keys to actions for an element. One key map can be used for multiple actions. - * The constructor accepts the same config object as defined by {@link #addBinding}. - * If you bind a callback function to a KeyMap, anytime the KeyMap handles an expected key - * combination it will call the function with this signature (if the match is a multi-key - * combination the callback will still be called only once): (String key, Ext.EventObject e) - * A KeyMap can also handle a string representation of keys.
    - * Usage: -
    
    -// map one key by key code
    -var map = new Ext.KeyMap("my-element", {
    -    key: 13, // or Ext.EventObject.ENTER
    -    fn: myHandler,
    -    scope: myObject
    -});
     
    -// map multiple keys to one action by string
    -var map = new Ext.KeyMap("my-element", {
    -    key: "a\r\n\t",
    -    fn: myHandler,
    -    scope: myObject
    -});
    -
    -// map multiple keys to multiple actions by strings and array of codes
    -var map = new Ext.KeyMap("my-element", [
    -    {
    -        key: [10,13],
    -        fn: function(){ alert("Return was pressed"); }
    -    }, {
    -        key: "abc",
    -        fn: function(){ alert('a, b or c was pressed'); }
    -    }, {
    -        key: "\t",
    -        ctrl:true,
    -        shift:true,
    -        fn: function(){ alert('Control + shift + tab was pressed.'); }
    -    }
    -]);
    -
    - * Note: A KeyMap starts enabled - * @constructor - * @param {Mixed} el The element to bind to - * @param {Object} config The config (see {@link #addBinding}) - * @param {String} eventName (optional) The event to bind to (defaults to "keydown") - */ Ext.KeyMap = function(el, config, eventName){ this.el = Ext.get(el); this.eventName = eventName || "keydown"; @@ -13992,47 +9214,10 @@ Ext.KeyMap = function(el, config, eventName){ }; Ext.KeyMap.prototype = { - /** - * True to stop the event from bubbling and prevent the default browser action if the - * key was handled by the KeyMap (defaults to false) - * @type Boolean - */ + stopEvent : false, - /** - * Add a new binding to this KeyMap. The following config object properties are supported: - *
    -Property    Type             Description
    -----------  ---------------  ----------------------------------------------------------------------
    -key         String/Array     A single keycode or an array of keycodes to handle
    -shift       Boolean          True to handle key only when shift is pressed, False to handle the key only when shift is not pressed (defaults to undefined)
    -ctrl        Boolean          True to handle key only when ctrl is pressed, False to handle the key only when ctrl is not pressed (defaults to undefined)
    -alt         Boolean          True to handle key only when alt is pressed, False to handle the key only when alt is not pressed (defaults to undefined)
    -handler     Function         The function to call when KeyMap finds the expected key combination
    -fn          Function         Alias of handler (for backwards-compatibility)
    -scope       Object           The scope of the callback function
    -stopEvent   Boolean          True to stop the event from bubbling and prevent the default browser action if the key was handled by the KeyMap (defaults to false)
    -
    - * - * Usage: - *
    
    -// Create a KeyMap
    -var map = new Ext.KeyMap(document, {
    -    key: Ext.EventObject.ENTER,
    -    fn: handleKey,
    -    scope: this
    -});
    -
    -//Add a new binding to the existing KeyMap later
    -map.addBinding({
    -    key: 'abc',
    -    shift: true,
    -    fn: handleKey,
    -    scope: this
    -});
    -
    - * @param {Object/Array} config A single KeyMap config or an array of configs - */ + addBinding : function(config){ if(Ext.isArray(config)){ Ext.each(config, function(c){ @@ -14084,7 +9269,7 @@ map.addBinding({ this.bindings.push(handler); }, - // private + checkModifiers: function(config, e){ var val, key, keys = ['shift', 'ctrl', 'alt']; for (var i = 0, len = keys.length; i < len; ++i){ @@ -14097,14 +9282,7 @@ map.addBinding({ return true; }, - /** - * Shorthand for adding a single key listener - * @param {Number/Array/Object} key Either the numeric key code, array of key codes or an object with the - * following options: - * {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)} - * @param {Function} fn The function to call - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to the browser window. - */ + on : function(key, fn, scope){ var keyCode, shift, ctrl, alt; if(typeof key == "object" && !Ext.isArray(key)){ @@ -14125,9 +9303,9 @@ map.addBinding({ }); }, - // private + handleKeyDown : function(e){ - if(this.enabled){ //just in case + if(this.enabled){ var b = this.bindings; for(var i = 0, len = b.length; i < len; i++){ b[i].call(this, e); @@ -14135,17 +9313,12 @@ map.addBinding({ } }, - /** - * Returns true if this KeyMap is enabled - * @return {Boolean} - */ + isEnabled : function(){ return this.enabled; }, - /** - * Enables this KeyMap - */ + enable: function(){ if(!this.enabled){ this.el.on(this.eventName, this.handleKeyDown, this); @@ -14153,9 +9326,7 @@ map.addBinding({ } }, - /** - * Disable this KeyMap - */ + disable: function(){ if(this.enabled){ this.el.removeListener(this.eventName, this.handleKeyDown, this); @@ -14163,32 +9334,15 @@ map.addBinding({ } }, - /** - * Convenience function for setting disabled/enabled by boolean. - * @param {Boolean} disabled - */ + setDisabled : function(disabled){ this[disabled ? "disable" : "enable"](); } -};/** - * @class Ext.util.TextMetrics - * Provides precise pixel measurements for blocks of text so that you can determine exactly how high and - * wide, in pixels, a given block of text will be. Note that when measuring text, it should be plain text and - * should not contain any HTML, otherwise it may not be measured correctly. - * @singleton - */ +}; Ext.util.TextMetrics = function(){ var shared; return { - /** - * Measures the size of the specified text - * @param {String/HTMLElement} el The element, dom node or id from which to copy existing CSS styles - * that can affect the size of the rendered text - * @param {String} text The text to measure - * @param {Number} fixedWidth (optional) If the text will be multiline, you have to set a fixed width - * in order to accurately measure the text height - * @return {Object} An object containing the text's size {width: (width), height: (height)} - */ + measure : function(el, text, fixedWidth){ if(!shared){ shared = Ext.util.TextMetrics.Instance(el, fixedWidth); @@ -14198,14 +9352,7 @@ Ext.util.TextMetrics = function(){ return shared.getSize(text); }, - /** - * Return a unique TextMetrics instance that can be bound directly to an element and reused. This reduces - * the overhead of multiple calls to initialize the style properties on each measurement. - * @param {String/HTMLElement} el The element, dom node or id that the instance will be bound to - * @param {Number} fixedWidth (optional) If the text will be multiline, you have to set a fixed width - * in order to accurately measure the text height - * @return {Ext.util.TextMetrics.Instance} instance The new instance - */ + createInstance : function(el, fixedWidth){ return Ext.util.TextMetrics.Instance(el, fixedWidth); } @@ -14224,12 +9371,7 @@ Ext.util.TextMetrics.Instance = function(bindTo, fixedWidth){ } var instance = { - /** - *

    Only available on the instance returned from {@link #createInstance}, not on the singleton.

    - * Returns the size of the specified text based on the internal element's style and width properties - * @param {String} text The text to measure - * @return {Object} An object containing the text's size {width: (width), height: (height)} - */ + getSize : function(text){ ml.update(text); var s = ml.getSize(); @@ -14237,46 +9379,25 @@ Ext.util.TextMetrics.Instance = function(bindTo, fixedWidth){ return s; }, - /** - *

    Only available on the instance returned from {@link #createInstance}, not on the singleton.

    - * Binds this TextMetrics instance to an element from which to copy existing CSS styles - * that can affect the size of the rendered text - * @param {String/HTMLElement} el The element, dom node or id - */ + bind : function(el){ ml.setStyle( Ext.fly(el).getStyles('font-size','font-style', 'font-weight', 'font-family','line-height', 'text-transform', 'letter-spacing') ); }, - /** - *

    Only available on the instance returned from {@link #createInstance}, not on the singleton.

    - * Sets a fixed width on the internal measurement element. If the text will be multiline, you have - * to set a fixed width in order to accurately measure the text height. - * @param {Number} width The width to set on the element - */ + setFixedWidth : function(width){ ml.setWidth(width); }, - /** - *

    Only available on the instance returned from {@link #createInstance}, not on the singleton.

    - * Returns the measured width of the specified text - * @param {String} text The text to measure - * @return {Number} width The width in pixels - */ + getWidth : function(text){ ml.dom.style.width = 'auto'; return this.getSize(text).width; }, - /** - *

    Only available on the instance returned from {@link #createInstance}, not on the singleton.

    - * Returns the measured height of the specified text. For multiline text, be sure to call - * {@link #setFixedWidth} if necessary. - * @param {String} text The text to measure - * @return {Number} height The height in pixels - */ + getHeight : function(text){ return this.getSize(text).height; } @@ -14288,46 +9409,14 @@ Ext.util.TextMetrics.Instance = function(bindTo, fixedWidth){ }; Ext.Element.addMethods({ - /** - * Returns the width in pixels of the passed text, or the width of the text in this Element. - * @param {String} text The text to measure. Defaults to the innerHTML of the element. - * @param {Number} min (Optional) The minumum value to return. - * @param {Number} max (Optional) The maximum value to return. - * @return {Number} The text width in pixels. - * @member Ext.Element getTextWidth - */ + getTextWidth : function(text, min, max){ return (Ext.util.TextMetrics.measure(this.dom, Ext.value(text, this.dom.innerHTML, true)).width).constrain(min || 0, max || 1000000); } }); -/** - * @class Ext.util.Cookies - * Utility class for managing and interacting with cookies. - * @singleton - */ + Ext.util.Cookies = { - /** - * Create a cookie with the specified name and value. Additional settings - * for the cookie may be optionally specified (for example: expiration, - * access restriction, SSL). - * @param {String} name The name of the cookie to set. - * @param {Mixed} value The value to set for the cookie. - * @param {Object} expires (Optional) Specify an expiration date the - * cookie is to persist until. Note that the specified Date object will - * be converted to Greenwich Mean Time (GMT). - * @param {String} path (Optional) Setting a path on the cookie restricts - * access to pages that match that path. Defaults to all pages ('/'). - * @param {String} domain (Optional) Setting a domain restricts access to - * pages on a given domain (typically used to allow cookie access across - * subdomains). For example, "extjs.com" will create a cookie that can be - * accessed from any subdomain of extjs.com, including www.extjs.com, - * support.extjs.com, etc. - * @param {Boolean} secure (Optional) Specify true to indicate that the cookie - * should only be accessible via SSL on a page using the HTTPS protocol. - * Defaults to false. Note that this will only work if the page - * calling this code uses the HTTPS protocol, otherwise the cookie will be - * created with default options. - */ + set : function(name, value){ var argv = arguments; var argc = arguments.length; @@ -14338,18 +9427,7 @@ Ext.util.Cookies = { document.cookie = name + "=" + escape(value) + ((expires === null) ? "" : ("; expires=" + expires.toGMTString())) + ((path === null) ? "" : ("; path=" + path)) + ((domain === null) ? "" : ("; domain=" + domain)) + ((secure === true) ? "; secure" : ""); }, - /** - * Retrieves cookies that are accessible by the current page. If a cookie - * does not exist, get() returns null. The following - * example retrieves the cookie called "valid" and stores the String value - * in the variable validStatus. - *
    
    -     * var validStatus = Ext.util.Cookies.get("valid");
    -     * 
    - * @param {String} name The name of the cookie to get - * @return {Mixed} Returns the cookie value for the specified name; - * null if the cookie name does not exist. - */ + get : function(name){ var arg = name + "="; var alen = arg.length; @@ -14369,19 +9447,13 @@ Ext.util.Cookies = { return null; }, - /** - * Removes a cookie with the provided name from the browser - * if found by setting its expiration date to sometime in the past. - * @param {String} name The name of the cookie to remove - */ + clear : function(name){ if(Ext.util.Cookies.get(name)){ document.cookie = name + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } }, - /** - * @private - */ + getCookieVal : function(offset){ var endstr = document.cookie.indexOf(";", offset); if(endstr == -1){ @@ -14389,135 +9461,59 @@ Ext.util.Cookies = { } return unescape(document.cookie.substring(offset, endstr)); } -};/** - * Framework-wide error-handler. Developers can override this method to provide - * custom exception-handling. Framework errors will often extend from the base - * Ext.Error class. - * @param {Object/Error} e The thrown exception object. - */ +}; Ext.handleError = function(e) { throw e; }; -/** - * @class Ext.Error - * @extends Error - *

    A base error class. Future implementations are intended to provide more - * robust error handling throughout the framework (in the debug build only) - * to check for common errors and problems. The messages issued by this class - * will aid error checking. Error checks will be automatically removed in the - * production build so that performance is not negatively impacted.

    - *

    Some sample messages currently implemented:

    -"DataProxy attempted to execute an API-action but found an undefined
    -url / function. Please review your Proxy url/api-configuration."
    - * 
    -"Could not locate your "root" property in your server response.
    -Please review your JsonReader config to ensure the config-property
    -"root" matches the property your server-response.  See the JsonReader
    -docs for additional assistance."
    - * 
    - *

    An example of the code used for generating error messages:

    
    -try {
    -    generateError({
    -        foo: 'bar'
    -    });
    -}
    -catch (e) {
    -    console.error(e);
    -}
    -function generateError(data) {
    -    throw new Ext.Error('foo-error', data);
    -}
    - * 
    - * @param {String} message - */ + Ext.Error = function(message) { - // Try to read the message from Ext.Error.lang + this.message = (this.lang[message]) ? this.lang[message] : message; }; Ext.Error.prototype = new Error(); Ext.apply(Ext.Error.prototype, { - // protected. Extensions place their error-strings here. + lang: {}, name: 'Ext.Error', - /** - * getName - * @return {String} - */ + getName : function() { return this.name; }, - /** - * getMessage - * @return {String} - */ + getMessage : function() { return this.message; }, - /** - * toJson - * @return {String} - */ + toJson : function() { return Ext.encode(this); } }); -/** - * @class Ext.ComponentMgr - *

    Provides a registry of all Components (instances of {@link Ext.Component} or any subclass - * thereof) on a page so that they can be easily accessed by {@link Ext.Component component} - * {@link Ext.Component#id id} (see {@link #get}, or the convenience method {@link Ext#getCmp Ext.getCmp}).

    - *

    This object also provides a registry of available Component classes - * indexed by a mnemonic code known as the Component's {@link Ext.Component#xtype xtype}. - * The {@link Ext.Component#xtype xtype} provides a way to avoid instantiating child Components - * when creating a full, nested config object for a complete Ext page.

    - *

    A child Component may be specified simply as a config object - * as long as the correct {@link Ext.Component#xtype xtype} is specified so that if and when the Component - * needs rendering, the correct type can be looked up for lazy instantiation.

    - *

    For a list of all available {@link Ext.Component#xtype xtypes}, see {@link Ext.Component}.

    - * @singleton - */ + Ext.ComponentMgr = function(){ var all = new Ext.util.MixedCollection(); var types = {}; var ptypes = {}; return { - /** - * Registers a component. - * @param {Ext.Component} c The component - */ + register : function(c){ all.add(c); }, - /** - * Unregisters a component. - * @param {Ext.Component} c The component - */ + unregister : function(c){ all.remove(c); }, - /** - * Returns a component by {@link Ext.Component#id id}. - * For additional details see {@link Ext.util.MixedCollection#get}. - * @param {String} id The component {@link Ext.Component#id id} - * @return Ext.Component The Component, undefined if not found, or null if a - * Class was found. - */ + get : function(id){ return all.get(id); }, - /** - * Registers a function that will be called when a Component with the specified id is added to ComponentMgr. This will happen on instantiation. - * @param {String} id The component {@link Ext.Component#id id} - * @param {Function} fn The callback function - * @param {Object} scope The scope (this reference) in which the callback is executed. Defaults to the Component. - */ + onAvailable : function(id, fn, scope){ all.on("add", function(index, o){ if(o.id == id){ @@ -14527,92 +9523,43 @@ Ext.ComponentMgr = function(){ }); }, - /** - * The MixedCollection used internally for the component cache. An example usage may be subscribing to - * events on the MixedCollection to monitor addition or removal. Read-only. - * @type {MixedCollection} - */ + all : all, - /** - * The xtypes that have been registered with the component manager. - * @type {Object} - */ + types : types, - /** - * The ptypes that have been registered with the component manager. - * @type {Object} - */ + ptypes: ptypes, - /** - * Checks if a Component type is registered. - * @param {Ext.Component} xtype The mnemonic string by which the Component class may be looked up - * @return {Boolean} Whether the type is registered. - */ + isRegistered : function(xtype){ return types[xtype] !== undefined; }, - /** - * Checks if a Plugin type is registered. - * @param {Ext.Component} ptype The mnemonic string by which the Plugin class may be looked up - * @return {Boolean} Whether the type is registered. - */ + isPluginRegistered : function(ptype){ return ptypes[ptype] !== undefined; }, - /** - *

    Registers a new Component constructor, keyed by a new - * {@link Ext.Component#xtype}.

    - *

    Use this method (or its alias {@link Ext#reg Ext.reg}) to register new - * subclasses of {@link Ext.Component} so that lazy instantiation may be used when specifying - * child Components. - * see {@link Ext.Container#items}

    - * @param {String} xtype The mnemonic string by which the Component class may be looked up. - * @param {Constructor} cls The new Component class. - */ + registerType : function(xtype, cls){ types[xtype] = cls; cls.xtype = xtype; }, - /** - * Creates a new Component from the specified config object using the - * config object's {@link Ext.component#xtype xtype} to determine the class to instantiate. - * @param {Object} config A configuration object for the Component you wish to create. - * @param {Constructor} defaultType The constructor to provide the default Component type if - * the config object does not contain a xtype. (Optional if the config contains a xtype). - * @return {Ext.Component} The newly instantiated Component. - */ + create : function(config, defaultType){ return config.render ? config : new types[config.xtype || defaultType](config); }, - /** - *

    Registers a new Plugin constructor, keyed by a new - * {@link Ext.Component#ptype}.

    - *

    Use this method (or its alias {@link Ext#preg Ext.preg}) to register new - * plugins for {@link Ext.Component}s so that lazy instantiation may be used when specifying - * Plugins.

    - * @param {String} ptype The mnemonic string by which the Plugin class may be looked up. - * @param {Constructor} cls The new Plugin class. - */ + registerPlugin : function(ptype, cls){ ptypes[ptype] = cls; cls.ptype = ptype; }, - /** - * Creates a new Plugin from the specified config object using the - * config object's {@link Ext.component#ptype ptype} to determine the class to instantiate. - * @param {Object} config A configuration object for the Plugin you wish to create. - * @param {Constructor} defaultType The constructor to provide the default Plugin type if - * the config object does not contain a ptype. (Optional if the config contains a ptype). - * @return {Ext.Component} The newly instantiated Plugin. - */ + createPlugin : function(config, defaultType){ var PluginCls = ptypes[config.ptype || defaultType]; if (PluginCls.init) { @@ -14624,299 +9571,61 @@ Ext.ComponentMgr = function(){ }; }(); -/** - * Shorthand for {@link Ext.ComponentMgr#registerType} - * @param {String} xtype The {@link Ext.component#xtype mnemonic string} by which the Component class - * may be looked up. - * @param {Constructor} cls The new Component class. - * @member Ext - * @method reg - */ -Ext.reg = Ext.ComponentMgr.registerType; // this will be called a lot internally, shorthand to keep the bytes down -/** - * Shorthand for {@link Ext.ComponentMgr#registerPlugin} - * @param {String} ptype The {@link Ext.component#ptype mnemonic string} by which the Plugin class - * may be looked up. - * @param {Constructor} cls The new Plugin class. - * @member Ext - * @method preg - */ + +Ext.reg = Ext.ComponentMgr.registerType; + Ext.preg = Ext.ComponentMgr.registerPlugin; -/** - * Shorthand for {@link Ext.ComponentMgr#create} - * Creates a new Component from the specified config object using the - * config object's {@link Ext.component#xtype xtype} to determine the class to instantiate. - * @param {Object} config A configuration object for the Component you wish to create. - * @param {Constructor} defaultType The constructor to provide the default Component type if - * the config object does not contain a xtype. (Optional if the config contains a xtype). - * @return {Ext.Component} The newly instantiated Component. - * @member Ext - * @method create - */ -Ext.create = Ext.ComponentMgr.create;/** - * @class Ext.Component - * @extends Ext.util.Observable - *

    Base class for all Ext components. All subclasses of Component may participate in the automated - * Ext component lifecycle of creation, rendering and destruction which is provided by the {@link Ext.Container Container} class. - * Components may be added to a Container through the {@link Ext.Container#items items} config option at the time the Container is created, - * or they may be added dynamically via the {@link Ext.Container#add add} method.

    - *

    The Component base class has built-in support for basic hide/show and enable/disable behavior.

    - *

    All Components are registered with the {@link Ext.ComponentMgr} on construction so that they can be referenced at any time via - * {@link Ext#getCmp}, passing the {@link #id}.

    - *

    All user-developed visual widgets that are required to participate in automated lifecycle and size management should subclass Component (or - * {@link Ext.BoxComponent} if managed box model handling is required, ie height and width management).

    - *

    See the Creating new UI controls tutorial for details on how - * and to either extend or augment ExtJs base classes to create custom Components.

    - *

    Every component has a specific xtype, which is its Ext-specific type name, along with methods for checking the - * xtype like {@link #getXType} and {@link #isXType}. This is the list of all valid xtypes:

    - *
    -xtype            Class
    --------------    ------------------
    -box              {@link Ext.BoxComponent}
    -button           {@link Ext.Button}
    -buttongroup      {@link Ext.ButtonGroup}
    -colorpalette     {@link Ext.ColorPalette}
    -component        {@link Ext.Component}
    -container        {@link Ext.Container}
    -cycle            {@link Ext.CycleButton}
    -dataview         {@link Ext.DataView}
    -datepicker       {@link Ext.DatePicker}
    -editor           {@link Ext.Editor}
    -editorgrid       {@link Ext.grid.EditorGridPanel}
    -flash            {@link Ext.FlashComponent}
    -grid             {@link Ext.grid.GridPanel}
    -listview         {@link Ext.ListView}
    -panel            {@link Ext.Panel}
    -progress         {@link Ext.ProgressBar}
    -propertygrid     {@link Ext.grid.PropertyGrid}
    -slider           {@link Ext.Slider}
    -spacer           {@link Ext.Spacer}
    -splitbutton      {@link Ext.SplitButton}
    -tabpanel         {@link Ext.TabPanel}
    -treepanel        {@link Ext.tree.TreePanel}
    -viewport         {@link Ext.ViewPort}
    -window           {@link Ext.Window}
    -
    -Toolbar components
    ----------------------------------------
    -paging           {@link Ext.PagingToolbar}
    -toolbar          {@link Ext.Toolbar}
    -tbbutton         {@link Ext.Toolbar.Button}        (deprecated; use button)
    -tbfill           {@link Ext.Toolbar.Fill}
    -tbitem           {@link Ext.Toolbar.Item}
    -tbseparator      {@link Ext.Toolbar.Separator}
    -tbspacer         {@link Ext.Toolbar.Spacer}
    -tbsplit          {@link Ext.Toolbar.SplitButton}   (deprecated; use splitbutton)
    -tbtext           {@link Ext.Toolbar.TextItem}
    -
    -Menu components
    ----------------------------------------
    -menu             {@link Ext.menu.Menu}
    -colormenu        {@link Ext.menu.ColorMenu}
    -datemenu         {@link Ext.menu.DateMenu}
    -menubaseitem     {@link Ext.menu.BaseItem}
    -menucheckitem    {@link Ext.menu.CheckItem}
    -menuitem         {@link Ext.menu.Item}
    -menuseparator    {@link Ext.menu.Separator}
    -menutextitem     {@link Ext.menu.TextItem}
    -
    -Form components
    ----------------------------------------
    -form             {@link Ext.form.FormPanel}
    -checkbox         {@link Ext.form.Checkbox}
    -checkboxgroup    {@link Ext.form.CheckboxGroup}
    -combo            {@link Ext.form.ComboBox}
    -datefield        {@link Ext.form.DateField}
    -displayfield     {@link Ext.form.DisplayField}
    -field            {@link Ext.form.Field}
    -fieldset         {@link Ext.form.FieldSet}
    -hidden           {@link Ext.form.Hidden}
    -htmleditor       {@link Ext.form.HtmlEditor}
    -label            {@link Ext.form.Label}
    -numberfield      {@link Ext.form.NumberField}
    -radio            {@link Ext.form.Radio}
    -radiogroup       {@link Ext.form.RadioGroup}
    -textarea         {@link Ext.form.TextArea}
    -textfield        {@link Ext.form.TextField}
    -timefield        {@link Ext.form.TimeField}
    -trigger          {@link Ext.form.TriggerField}
    -
    -Chart components
    ----------------------------------------
    -chart            {@link Ext.chart.Chart}
    -barchart         {@link Ext.chart.BarChart}
    -cartesianchart   {@link Ext.chart.CartesianChart}
    -columnchart      {@link Ext.chart.ColumnChart}
    -linechart        {@link Ext.chart.LineChart}
    -piechart         {@link Ext.chart.PieChart}
    -
    -Store xtypes
    ----------------------------------------
    -arraystore       {@link Ext.data.ArrayStore}
    -directstore      {@link Ext.data.DirectStore}
    -groupingstore    {@link Ext.data.GroupingStore}
    -jsonstore        {@link Ext.data.JsonStore}
    -simplestore      {@link Ext.data.SimpleStore}      (deprecated; use arraystore)
    -store            {@link Ext.data.Store}
    -xmlstore         {@link Ext.data.XmlStore}
    -
    - * @constructor - * @param {Ext.Element/String/Object} config The configuration options may be specified as either: - *
      - *
    • an element : - *

      it is set as the internal element and its id used as the component id

    • - *
    • a string : - *

      it is assumed to be the id of an existing element and is used as the component id

    • - *
    • anything else : - *

      it is assumed to be a standard config object and is applied to the component

    • - *
    - */ + +Ext.create = Ext.ComponentMgr.create; Ext.Component = function(config){ config = config || {}; if(config.initialConfig){ - if(config.isAction){ // actions + if(config.isAction){ this.baseAction = config; } - config = config.initialConfig; // component cloning / action set up - }else if(config.tagName || config.dom || Ext.isString(config)){ // element object + config = config.initialConfig; + }else if(config.tagName || config.dom || Ext.isString(config)){ config = {applyTo: config, id: config.id || config}; } - /** - * This Component's initial configuration specification. Read-only. - * @type Object - * @property initialConfig - */ + this.initialConfig = config; Ext.apply(this, config); this.addEvents( - /** - * @event added - * Fires when a component is added to an Ext.Container - * @param {Ext.Component} this - * @param {Ext.Container} ownerCt Container which holds the component - * @param {number} index Position at which the component was added - */ + 'added', - /** - * @event disable - * Fires after the component is disabled. - * @param {Ext.Component} this - */ + 'disable', - /** - * @event enable - * Fires after the component is enabled. - * @param {Ext.Component} this - */ + 'enable', - /** - * @event beforeshow - * Fires before the component is shown by calling the {@link #show} method. - * Return false from an event handler to stop the show. - * @param {Ext.Component} this - */ + 'beforeshow', - /** - * @event show - * Fires after the component is shown when calling the {@link #show} method. - * @param {Ext.Component} this - */ + 'show', - /** - * @event beforehide - * Fires before the component is hidden by calling the {@link #hide} method. - * Return false from an event handler to stop the hide. - * @param {Ext.Component} this - */ + 'beforehide', - /** - * @event hide - * Fires after the component is hidden. - * Fires after the component is hidden when calling the {@link #hide} method. - * @param {Ext.Component} this - */ + 'hide', - /** - * @event removed - * Fires when a component is removed from an Ext.Container - * @param {Ext.Component} this - * @param {Ext.Container} ownerCt Container which holds the component - */ + 'removed', - /** - * @event beforerender - * Fires before the component is {@link #rendered}. Return false from an - * event handler to stop the {@link #render}. - * @param {Ext.Component} this - */ + 'beforerender', - /** - * @event render - * Fires after the component markup is {@link #rendered}. - * @param {Ext.Component} this - */ + 'render', - /** - * @event afterrender - *

    Fires after the component rendering is finished.

    - *

    The afterrender event is fired after this Component has been {@link #rendered}, been postprocesed - * by any afterRender method defined for the Component, and, if {@link #stateful}, after state - * has been restored.

    - * @param {Ext.Component} this - */ + 'afterrender', - /** - * @event beforedestroy - * Fires before the component is {@link #destroy}ed. Return false from an event handler to stop the {@link #destroy}. - * @param {Ext.Component} this - */ + 'beforedestroy', - /** - * @event destroy - * Fires after the component is {@link #destroy}ed. - * @param {Ext.Component} this - */ + 'destroy', - /** - * @event beforestaterestore - * Fires before the state of the component is restored. Return false from an event handler to stop the restore. - * @param {Ext.Component} this - * @param {Object} state The hash of state values returned from the StateProvider. If this - * event is not vetoed, then the state object is passed to applyState. By default, - * that simply copies property values into this Component. The method maybe overriden to - * provide custom state restoration. - */ + 'beforestaterestore', - /** - * @event staterestore - * Fires after the state of the component is restored. - * @param {Ext.Component} this - * @param {Object} state The hash of state values returned from the StateProvider. This is passed - * to applyState. By default, that simply copies property values into this - * Component. The method maybe overriden to provide custom state restoration. - */ + 'staterestore', - /** - * @event beforestatesave - * Fires before the state of the component is saved to the configured state provider. Return false to stop the save. - * @param {Ext.Component} this - * @param {Object} state The hash of state values. This is determined by calling - * getState() on the Component. This method must be provided by the - * developer to return whetever representation of state is required, by default, Ext.Component - * has a null implementation. - */ + 'beforestatesave', - /** - * @event statesave - * Fires after the state of the component is saved to the configured state provider. - * @param {Ext.Component} this - * @param {Object} state The hash of state values. This is determined by calling - * getState() on the Component. This method must be provided by the - * developer to return whetever representation of state is required, by default, Ext.Component - * has a null implementation. - */ + 'statesave' ); this.getId(); @@ -14952,556 +9661,77 @@ Ext.Component = function(config){ } }; -// private + Ext.Component.AUTO_ID = 1000; Ext.extend(Ext.Component, Ext.util.Observable, { - // Configs below are used for all Components when rendered by FormLayout. - /** - * @cfg {String} fieldLabel

    The label text to display next to this Component (defaults to '').

    - *

    Note: this config is only used when this Component is rendered by a Container which - * has been configured to use the {@link Ext.layout.FormLayout FormLayout} layout manager (e.g. - * {@link Ext.form.FormPanel} or specifying layout:'form').


    - *

    Also see {@link #hideLabel} and - * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}.

    - * Example use:
    
    -new Ext.FormPanel({
    -    height: 100,
    -    renderTo: Ext.getBody(),
    -    items: [{
    -        xtype: 'textfield',
    -        fieldLabel: 'Name'
    -    }]
    -});
    -
    - */ - /** - * @cfg {String} labelStyle

    A CSS style specification string to apply directly to this field's - * label. Defaults to the container's labelStyle value if set (e.g., - * {@link Ext.layout.FormLayout#labelStyle} , or '').

    - *

    Note: see the note for {@link #clearCls}.


    - *

    Also see {@link #hideLabel} and - * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}.

    - * Example use:
    
    -new Ext.FormPanel({
    -    height: 100,
    -    renderTo: Ext.getBody(),
    -    items: [{
    -        xtype: 'textfield',
    -        fieldLabel: 'Name',
    -        labelStyle: 'font-weight:bold;'
    -    }]
    -});
    -
    - */ - /** - * @cfg {String} labelSeparator

    The separator to display after the text of each - * {@link #fieldLabel}. This property may be configured at various levels. - * The order of precedence is: - *

      - *
    • field / component level
    • - *
    • container level
    • - *
    • {@link Ext.layout.FormLayout#labelSeparator layout level} (defaults to colon ':')
    • - *
    - * To display no separator for this field's label specify empty string ''.

    - *

    Note: see the note for {@link #clearCls}.


    - *

    Also see {@link #hideLabel} and - * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}.

    - * Example use:
    
    -new Ext.FormPanel({
    -    height: 100,
    -    renderTo: Ext.getBody(),
    -    layoutConfig: {
    -        labelSeparator: '~'   // layout config has lowest priority (defaults to ':')
    -    },
    -    {@link Ext.layout.FormLayout#labelSeparator labelSeparator}: '>>',     // config at container level
    -    items: [{
    -        xtype: 'textfield',
    -        fieldLabel: 'Field 1',
    -        labelSeparator: '...' // field/component level config supersedes others
    -    },{
    -        xtype: 'textfield',
    -        fieldLabel: 'Field 2' // labelSeparator will be '='
    -    }]
    -});
    -
    - */ - /** - * @cfg {Boolean} hideLabel

    true to completely hide the label element - * ({@link #fieldLabel label} and {@link #labelSeparator separator}). Defaults to false. - * By default, even if you do not specify a {@link #fieldLabel} the space will still be - * reserved so that the field will line up with other fields that do have labels. - * Setting this to true will cause the field to not reserve that space.

    - *

    Note: see the note for {@link #clearCls}.


    - * Example use:
    
    -new Ext.FormPanel({
    -    height: 100,
    -    renderTo: Ext.getBody(),
    -    items: [{
    -        xtype: 'textfield'
    -        hideLabel: true
    -    }]
    -});
    -
    - */ - /** - * @cfg {String} clearCls

    The CSS class used to to apply to the special clearing div rendered - * directly after each form field wrapper to provide field clearing (defaults to - * 'x-form-clear-left').

    - *

    Note: this config is only used when this Component is rendered by a Container - * which has been configured to use the {@link Ext.layout.FormLayout FormLayout} layout - * manager (e.g. {@link Ext.form.FormPanel} or specifying layout:'form') and either a - * {@link #fieldLabel} is specified or isFormField=true is specified.


    - *

    See {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl} also.

    - */ - /** - * @cfg {String} itemCls - *

    Note: this config is only used when this Component is rendered by a Container which - * has been configured to use the {@link Ext.layout.FormLayout FormLayout} layout manager (e.g. - * {@link Ext.form.FormPanel} or specifying layout:'form').


    - *

    An additional CSS class to apply to the div wrapping the form item - * element of this field. If supplied, itemCls at the field level will override - * the default itemCls supplied at the container level. The value specified for - * itemCls will be added to the default class ('x-form-item').

    - *

    Since it is applied to the item wrapper (see - * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}), it allows - * you to write standard CSS rules that can apply to the field, the label (if specified), or - * any other element within the markup for the field.

    - *

    Note: see the note for {@link #fieldLabel}.


    - * Example use:
    
    -// Apply a style to the field's label:
    -<style>
    -    .required .x-form-item-label {font-weight:bold;color:red;}
    -</style>
    -
    -new Ext.FormPanel({
    -    height: 100,
    -    renderTo: Ext.getBody(),
    -    items: [{
    -        xtype: 'textfield',
    -        fieldLabel: 'Name',
    -        itemCls: 'required' //this label will be styled
    -    },{
    -        xtype: 'textfield',
    -        fieldLabel: 'Favorite Color'
    -    }]
    -});
    -
    - */ + + + + + + + - /** - * @cfg {String} id - *

    The unique id of this component (defaults to an {@link #getId auto-assigned id}). - * You should assign an id if you need to be able to access the component later and you do - * not have an object reference available (e.g., using {@link Ext}.{@link Ext#getCmp getCmp}).

    - *

    Note that this id will also be used as the element id for the containing HTML element - * that is rendered to the page for this component. This allows you to write id-based CSS - * rules to style the specific instance of this component uniquely, and also to select - * sub-elements using this component's id as the parent.

    - *

    Note: to avoid complications imposed by a unique id also see - * {@link #itemId} and {@link #ref}.

    - *

    Note: to access the container of an item see {@link #ownerCt}.

    - */ - /** - * @cfg {String} itemId - *

    An itemId can be used as an alternative way to get a reference to a component - * when no object reference is available. Instead of using an {@link #id} with - * {@link Ext}.{@link Ext#getCmp getCmp}, use itemId with - * {@link Ext.Container}.{@link Ext.Container#getComponent getComponent} which will retrieve - * itemId's or {@link #id}'s. Since itemId's are an index to the - * container's internal MixedCollection, the itemId is scoped locally to the container -- - * avoiding potential conflicts with {@link Ext.ComponentMgr} which requires a unique - * {@link #id}.

    - *
    
    -var c = new Ext.Panel({ //
    -    {@link Ext.BoxComponent#height height}: 300,
    -    {@link #renderTo}: document.body,
    -    {@link Ext.Container#layout layout}: 'auto',
    -    {@link Ext.Container#items items}: [
    -        {
    -            itemId: 'p1',
    -            {@link Ext.Panel#title title}: 'Panel 1',
    -            {@link Ext.BoxComponent#height height}: 150
    -        },
    -        {
    -            itemId: 'p2',
    -            {@link Ext.Panel#title title}: 'Panel 2',
    -            {@link Ext.BoxComponent#height height}: 150
    -        }
    -    ]
    -})
    -p1 = c.{@link Ext.Container#getComponent getComponent}('p1'); // not the same as {@link Ext#getCmp Ext.getCmp()}
    -p2 = p1.{@link #ownerCt}.{@link Ext.Container#getComponent getComponent}('p2'); // reference via a sibling
    -     * 
    - *

    Also see {@link #id} and {@link #ref}.

    - *

    Note: to access the container of an item see {@link #ownerCt}.

    - */ - /** - * @cfg {String} xtype - * The registered xtype to create. This config option is not used when passing - * a config object into a constructor. This config option is used only when - * lazy instantiation is being used, and a child item of a Container is being - * specified not as a fully instantiated Component, but as a Component config - * object. The xtype will be looked up at render time up to determine what - * type of child Component to create.

    - * The predefined xtypes are listed {@link Ext.Component here}. - *

    - * If you subclass Components to create your own Components, you may register - * them using {@link Ext.ComponentMgr#registerType} in order to be able to - * take advantage of lazy instantiation and rendering. - */ - /** - * @cfg {String} ptype - * The registered ptype to create. This config option is not used when passing - * a config object into a constructor. This config option is used only when - * lazy instantiation is being used, and a Plugin is being - * specified not as a fully instantiated Component, but as a Component config - * object. The ptype will be looked up at render time up to determine what - * type of Plugin to create.

    - * If you create your own Plugins, you may register them using - * {@link Ext.ComponentMgr#registerPlugin} in order to be able to - * take advantage of lazy instantiation and rendering. - */ - /** - * @cfg {String} cls - * An optional extra CSS class that will be added to this component's Element (defaults to ''). This can be - * useful for adding customized styles to the component or any of its children using standard CSS rules. - */ - /** - * @cfg {String} overCls - * An optional extra CSS class that will be added to this component's Element when the mouse moves - * over the Element, and removed when the mouse moves out. (defaults to ''). This can be - * useful for adding customized 'active' or 'hover' styles to the component or any of its children using standard CSS rules. - */ - /** - * @cfg {String} style - * A custom style specification to be applied to this component's Element. Should be a valid argument to - * {@link Ext.Element#applyStyles}. - *
    
    -new Ext.Panel({
    -    title: 'Some Title',
    -    renderTo: Ext.getBody(),
    -    width: 400, height: 300,
    -    layout: 'form',
    -    items: [{
    -        xtype: 'textarea',
    -        style: {
    -            width: '95%',
    -            marginBottom: '10px'
    -        }
    -    },
    -        new Ext.Button({
    -            text: 'Send',
    -            minWidth: '100',
    -            style: {
    -                marginBottom: '10px'
    -            }
    -        })
    -    ]
    -});
    -     * 
    - */ - /** - * @cfg {String} ctCls - *

    An optional extra CSS class that will be added to this component's container. This can be useful for - * adding customized styles to the container or any of its children using standard CSS rules. See - * {@link Ext.layout.ContainerLayout}.{@link Ext.layout.ContainerLayout#extraCls extraCls} also.

    - *

    Note: ctCls defaults to '' except for the following class - * which assigns a value by default: - *

      - *
    • {@link Ext.layout.Box Box Layout} : 'x-box-layout-ct'
    • - *
    - * To configure the above Class with an extra CSS class append to the default. For example, - * for BoxLayout (Hbox and Vbox):
    
    -     * ctCls: 'x-box-layout-ct custom-class'
    -     * 
    - *

    - */ - /** - * @cfg {Boolean} disabled - * Render this component disabled (default is false). - */ + + + + + + + + + disabled : false, - /** - * @cfg {Boolean} hidden - * Render this component hidden (default is false). If true, the - * {@link #hide} method will be called internally. - */ + hidden : false, - /** - * @cfg {Object/Array} plugins - * An object or array of objects that will provide custom functionality for this component. The only - * requirement for a valid plugin is that it contain an init method that accepts a reference of type Ext.Component. - * When a component is created, if any plugins are available, the component will call the init method on each - * plugin, passing a reference to itself. Each plugin can then call methods or respond to events on the - * component as needed to provide its functionality. - */ - /** - * @cfg {Mixed} applyTo - *

    Specify the id of the element, a DOM element or an existing Element corresponding to a DIV - * that is already present in the document that specifies some structural markup for this - * component.

      - *
    • Description :
        - *
        When applyTo is used, constituent parts of the component can also be specified - * by id or CSS class name within the main element, and the component being created may attempt - * to create its subcomponents from that markup if applicable.
        - *
    • - *
    • Notes :
        - *
        When using this config, a call to render() is not required.
        - *
        If applyTo is specified, any value passed for {@link #renderTo} will be ignored and the target - * element's parent node will automatically be used as the component's container.
        - *
    • - *
    - */ - /** - * @cfg {Mixed} renderTo - *

    Specify the id of the element, a DOM element or an existing Element that this component - * will be rendered into.

      - *
    • Notes :
        - *
        Do not use this option if the Component is to be a child item of - * a {@link Ext.Container Container}. It is the responsibility of the - * {@link Ext.Container Container}'s {@link Ext.Container#layout layout manager} - * to render and manage its child items.
        - *
        When using this config, a call to render() is not required.
        - *
    • - *
    - *

    See {@link #render} also.

    - */ - /** - * @cfg {Boolean} stateful - *

    A flag which causes the Component to attempt to restore the state of - * internal properties from a saved state on startup. The component must have - * either a {@link #stateId} or {@link #id} assigned - * for state to be managed. Auto-generated ids are not guaranteed to be stable - * across page loads and cannot be relied upon to save and restore the same - * state for a component.

    - *

    For state saving to work, the state manager's provider must have been - * set to an implementation of {@link Ext.state.Provider} which overrides the - * {@link Ext.state.Provider#set set} and {@link Ext.state.Provider#get get} - * methods to save and recall name/value pairs. A built-in implementation, - * {@link Ext.state.CookieProvider} is available.

    - *

    To set the state provider for the current page:

    - *
    
    -Ext.state.Manager.setProvider(new Ext.state.CookieProvider({
    -    expires: new Date(new Date().getTime()+(1000*60*60*24*7)), //7 days from now
    -}));
    -     * 
    - *

    A stateful Component attempts to save state when one of the events - * listed in the {@link #stateEvents} configuration fires.

    - *

    To save state, a stateful Component first serializes its state by - * calling getState. By default, this function does - * nothing. The developer must provide an implementation which returns an - * object hash which represents the Component's restorable state.

    - *

    The value yielded by getState is passed to {@link Ext.state.Manager#set} - * which uses the configured {@link Ext.state.Provider} to save the object - * keyed by the Component's {@link stateId}, or, if that is not - * specified, its {@link #id}.

    - *

    During construction, a stateful Component attempts to restore - * its state by calling {@link Ext.state.Manager#get} passing the - * {@link #stateId}, or, if that is not specified, the - * {@link #id}.

    - *

    The resulting object is passed to applyState. - * The default implementation of applyState simply copies - * properties into the object, but a developer may override this to support - * more behaviour.

    - *

    You can perform extra processing on state save and restore by attaching - * handlers to the {@link #beforestaterestore}, {@link #staterestore}, - * {@link #beforestatesave} and {@link #statesave} events.

    - */ - /** - * @cfg {String} stateId - * The unique id for this component to use for state management purposes - * (defaults to the component id if one was set, otherwise null if the - * component is using a generated id). - *

    See {@link #stateful} for an explanation of saving and - * restoring Component state.

    - */ - /** - * @cfg {Array} stateEvents - *

    An array of events that, when fired, should trigger this component to - * save its state (defaults to none). stateEvents may be any type - * of event supported by this component, including browser or custom events - * (e.g., ['click', 'customerchange']).

    - *

    See {@link #stateful} for an explanation of saving and - * restoring Component state.

    - */ - /** - * @cfg {Mixed} autoEl - *

    A tag name or {@link Ext.DomHelper DomHelper} spec used to create the {@link #getEl Element} which will - * encapsulate this Component.

    - *

    You do not normally need to specify this. For the base classes {@link Ext.Component}, {@link Ext.BoxComponent}, - * and {@link Ext.Container}, this defaults to 'div'. The more complex Ext classes use a more complex - * DOM structure created by their own onRender methods.

    - *

    This is intended to allow the developer to create application-specific utility Components encapsulated by - * different DOM elements. Example usage:

    
    -{
    -    xtype: 'box',
    -    autoEl: {
    -        tag: 'img',
    -        src: 'http://www.example.com/example.jpg'
    -    }
    -}, {
    -    xtype: 'box',
    -    autoEl: {
    -        tag: 'blockquote',
    -        html: 'autoEl is cool!'
    -    }
    -}, {
    -    xtype: 'container',
    -    autoEl: 'ul',
    -    cls: 'ux-unordered-list',
    -    items: {
    -        xtype: 'box',
    -        autoEl: 'li',
    -        html: 'First list item'
    -    }
    -}
    -
    - */ + + + + + + + autoEl : 'div', - /** - * @cfg {String} disabledClass - * CSS class added to the component when it is disabled (defaults to 'x-item-disabled'). - */ + disabledClass : 'x-item-disabled', - /** - * @cfg {Boolean} allowDomMove - * Whether the component can move the Dom node when rendering (defaults to true). - */ + allowDomMove : true, - /** - * @cfg {Boolean} autoShow - * True if the component should check for hidden classes (e.g. 'x-hidden' or 'x-hide-display') and remove - * them on render (defaults to false). - */ + autoShow : false, - /** - * @cfg {String} hideMode - *

    How this component should be hidden. Supported values are 'visibility' - * (css visibility), 'offsets' (negative offset position) and 'display' - * (css display).

    - *

    Note: the default of 'display' is generally preferred - * since items are automatically laid out when they are first shown (no sizing - * is done while hidden).

    - */ + hideMode : 'display', - /** - * @cfg {Boolean} hideParent - * True to hide and show the component's container when hide/show is called on the component, false to hide - * and show the component itself (defaults to false). For example, this can be used as a shortcut for a hide - * button on a window by setting hide:true on the button when adding it to its parent container. - */ + hideParent : false, - /** - *

    The {@link Ext.Element} which encapsulates this Component. Read-only.

    - *

    This will usually be a <DIV> element created by the class's onRender method, but - * that may be overridden using the {@link #autoEl} config.

    - *

    Note: this element will not be available until this Component has been rendered.


    - *

    To add listeners for DOM events to this Component (as opposed to listeners - * for this Component's own Observable events), see the {@link Ext.util.Observable#listeners listeners} - * config for a suggestion, or use a render listener directly:

    
    -new Ext.Panel({
    -    title: 'The Clickable Panel',
    -    listeners: {
    -        render: function(p) {
    -            // Append the Panel to the click handler's argument list.
    -            p.getEl().on('click', handlePanelClick.createDelegate(null, [p], true));
    -        },
    -        single: true  // Remove the listener after first invocation
    -    }
    -});
    -
    - *

    See also {@link #getEl getEl}

    - * @type Ext.Element - * @property el - */ - /** - * This Component's owner {@link Ext.Container Container} (defaults to undefined, and is set automatically when - * this Component is added to a Container). Read-only. - *

    Note: to access items within the Container see {@link #itemId}.

    - * @type Ext.Container - * @property ownerCt - */ - /** - * True if this component is hidden. Read-only. - * @type Boolean - * @property hidden - */ - /** - * True if this component is disabled. Read-only. - * @type Boolean - * @property disabled - */ - /** - * True if this component has been rendered. Read-only. - * @type Boolean - * @property rendered - */ + + + + + rendered : false, - /** - * @cfg {String} contentEl - *

    Optional. Specify an existing HTML element, or the id of an existing HTML element to use as the content - * for this component.

    - *
      - *
    • Description : - *
      This config option is used to take an existing HTML element and place it in the layout element - * of a new component (it simply moves the specified DOM element after the Component is rendered to use as the content.
    • - *
    • Notes : - *
      The specified HTML element is appended to the layout element of the component after any configured - * {@link #html HTML} has been inserted, and so the document will not contain this element at the time the {@link #render} event is fired.
      - *
      The specified HTML element used will not participate in any {@link Ext.Container#layout layout} - * scheme that the Component may use. It is just HTML. Layouts operate on child {@link Ext.Container#items items}.
      - *
      Add either the x-hidden or the x-hide-display CSS class to - * prevent a brief flicker of the content before it is rendered to the panel.
    • - *
    - */ - /** - * @cfg {String/Object} html - * An HTML fragment, or a {@link Ext.DomHelper DomHelper} specification to use as the layout element - * content (defaults to ''). The HTML content is added after the component is rendered, - * so the document will not contain this HTML at the time the {@link #render} event is fired. - * This content is inserted into the body before any configured {@link #contentEl} is appended. - */ + + - /** - * @cfg {Mixed} tpl - * An {@link Ext.Template}, {@link Ext.XTemplate} - * or an array of strings to form an Ext.XTemplate. - * Used in conjunction with the {@link #data} and - * {@link #tplWriteMode} configurations. - */ + - /** - * @cfg {String} tplWriteMode The Ext.(X)Template method to use when - * updating the content area of the Component. Defaults to 'overwrite' - * (see {@link Ext.XTemplate#overwrite}). - */ + tplWriteMode : 'overwrite', - /** - * @cfg {Mixed} data - * The initial set of data to apply to the {@link #tpl} to - * update the content area of the Component. - */ - /** - * @cfg {Array} bubbleEvents - *

    An array of events that, when fired, should be bubbled to any parent container. - * See {@link Ext.util.Observable#enableBubble}. - * Defaults to []. - */ + + bubbleEvents: [], - // private + ctype : 'Ext.Component', - // private + actionMode : 'el', - // private + getActionEl : function(){ return this[this.actionMode]; }, @@ -15518,45 +9748,9 @@ new Ext.Panel({ return p; }, - /* // protected - * Function to be implemented by Component subclasses to be part of standard component initialization flow (it is empty by default). - *

    
    -// Traditional constructor:
    -Ext.Foo = function(config){
    -    // call superclass constructor:
    -    Ext.Foo.superclass.constructor.call(this, config);
    -
    -    this.addEvents({
    -        // add events
    -    });
    -};
    -Ext.extend(Ext.Foo, Ext.Bar, {
    -   // class body
    -}
    -
    -// initComponent replaces the constructor:
    -Ext.Foo = Ext.extend(Ext.Bar, {
    -    initComponent : function(){
    -        // call superclass initComponent
    -        Ext.Container.superclass.initComponent.call(this);
    -
    -        this.addEvents({
    -            // add events
    -        });
    -    }
    -}
    -
    - */ + initComponent : function(){ - /* - * this is double processing, however it allows people to be able to do - * Ext.apply(this, { - * listeners: { - * //here - * } - * }); - * MyClass.superclass.initComponent.call(this); - */ + if(this.listeners){ this.on(this.listeners); delete this.listeners; @@ -15564,32 +9758,7 @@ Ext.Foo = Ext.extend(Ext.Bar, { this.enableBubble(this.bubbleEvents); }, - /** - *

    Render this Component into the passed HTML element.

    - *

    If you are using a {@link Ext.Container Container} object to house this Component, then - * do not use the render method.

    - *

    A Container's child Components are rendered by that Container's - * {@link Ext.Container#layout layout} manager when the Container is first rendered.

    - *

    Certain layout managers allow dynamic addition of child components. Those that do - * include {@link Ext.layout.CardLayout}, {@link Ext.layout.AnchorLayout}, - * {@link Ext.layout.FormLayout}, {@link Ext.layout.TableLayout}.

    - *

    If the Container is already rendered when a new child Component is added, you may need to call - * the Container's {@link Ext.Container#doLayout doLayout} to refresh the view which causes any - * unrendered child Components to be rendered. This is required so that you can add multiple - * child components if needed while only refreshing the layout once.

    - *

    When creating complex UIs, it is important to remember that sizing and positioning - * of child items is the responsibility of the Container's {@link Ext.Container#layout layout} manager. - * If you expect child items to be sized in response to user interactions, you must - * configure the Container with a layout manager which creates and manages the type of layout you - * have in mind.

    - *

    Omitting the Container's {@link Ext.Container#layout layout} config means that a basic - * layout manager is used which does nothing but render child components sequentially into the - * Container. No sizing or positioning will be performed in this situation.

    - * @param {Element/HTMLElement/String} container (optional) The element this Component should be - * rendered into. If it is being created from existing markup, this should be omitted. - * @param {String/Number} position (optional) The element ID or DOM node index within the container before - * which this component will be inserted (defaults to appending to the end of the container) - */ + render : function(container, position){ if(!this.rendered && this.fireEvent('beforerender', this) !== false){ if(!container && this.el){ @@ -15627,8 +9796,8 @@ Ext.Foo = Ext.extend(Ext.Bar, { this.fireEvent('render', this); - // Populate content of the component with html, contentEl or - // a tpl. + + var contentTarget = this.getContentTarget(); if (this.html){ contentTarget.update(Ext.DomHelper.markup(this.html)); @@ -15652,11 +9821,11 @@ Ext.Foo = Ext.extend(Ext.Bar, { if(this.hidden){ - // call this so we don't fire initial hide events. + this.doHide(); } if(this.disabled){ - // pass silent so the event doesn't fire the first time. + this.disable(true); } @@ -15669,18 +9838,7 @@ Ext.Foo = Ext.extend(Ext.Bar, { }, - /** - * Update the content area of a component. - * @param {Mixed} htmlOrData - * If this component has been configured with a template via the tpl config - * then it will use this argument as data to populate the template. - * If this component was not configured with a template, the components - * content area will be updated via Ext.Element update - * @param {Boolean} loadScripts - * (optional) Only legitimate when using the html configuration. Defaults to false - * @param {Function} callback - * (optional) Only legitimate when using the html configuration. Callback to execute when scripts have finished loading - */ + update: function(htmlOrData, loadScripts, cb) { var contentTarget = this.getContentTarget(); if (this.tpl && typeof htmlOrData !== "string") { @@ -15692,66 +9850,23 @@ Ext.Foo = Ext.extend(Ext.Bar, { }, - /** - * @private - * Method to manage awareness of when components are added to their - * respective Container, firing an added event. - * References are established at add time rather than at render time. - * @param {Ext.Container} container Container which holds the component - * @param {number} pos Position at which the component was added - */ + onAdded : function(container, pos) { this.ownerCt = container; this.initRef(); this.fireEvent('added', this, container, pos); }, - /** - * @private - * Method to manage awareness of when components are removed from their - * respective Container, firing an removed event. References are properly - * cleaned up after removing a component from its owning container. - */ + onRemoved : function() { this.removeRef(); this.fireEvent('removed', this, this.ownerCt); delete this.ownerCt; }, - /** - * @private - * Method to establish a reference to a component. - */ + initRef : function() { - /** - * @cfg {String} ref - *

    A path specification, relative to the Component's {@link #ownerCt} - * specifying into which ancestor Container to place a named reference to this Component.

    - *

    The ancestor axis can be traversed by using '/' characters in the path. - * For example, to put a reference to a Toolbar Button into the Panel which owns the Toolbar:

    
    -var myGrid = new Ext.grid.EditorGridPanel({
    -    title: 'My EditorGridPanel',
    -    store: myStore,
    -    colModel: myColModel,
    -    tbar: [{
    -        text: 'Save',
    -        handler: saveChanges,
    -        disabled: true,
    -        ref: '../saveButton'
    -    }],
    -    listeners: {
    -        afteredit: function() {
    -//          The button reference is in the GridPanel
    -            myGrid.saveButton.enable();
    -        }
    -    }
    -});
    -
    - *

    In the code above, if the ref had been 'saveButton' - * the reference would have been placed into the Toolbar. Each '/' in the ref - * moves up one level from the Component's {@link #ownerCt}.

    - *

    Also see the {@link #added} and {@link #removed} events.

    - */ + if(this.ref && !this.refOwner){ var levels = this.ref.split('/'), last = levels.length, @@ -15764,12 +9879,7 @@ var myGrid = new Ext.grid.EditorGridPanel({ } if(t){ t[this.refName = levels[--i]] = this; - /** - * @type Ext.Container - * @property refOwner - * The ancestor Container into which the {@link #ref} reference was inserted if this Component - * is a child of a Container, and has been configured with a ref. - */ + this.refOwner = t; } } @@ -15782,7 +9892,7 @@ var myGrid = new Ext.grid.EditorGridPanel({ } }, - // private + initState : function(){ if(Ext.state.Manager){ var id = this.getStateId(); @@ -15798,12 +9908,12 @@ var myGrid = new Ext.grid.EditorGridPanel({ } }, - // private + getStateId : function(){ return this.stateId || ((/^(ext-comp-|ext-gen)/).test(String(this.id)) ? null : this.id); }, - // private + initStateEvents : function(){ if(this.stateEvents){ for(var i = 0, e; e = this.stateEvents[i]; i++){ @@ -15812,19 +9922,19 @@ var myGrid = new Ext.grid.EditorGridPanel({ } }, - // private + applyState : function(state){ if(state){ Ext.apply(this, state); } }, - // private + getState : function(){ return null; }, - // private + saveState : function(){ if(Ext.state.Manager && this.stateful !== false){ var id = this.getStateId(); @@ -15838,21 +9948,14 @@ var myGrid = new Ext.grid.EditorGridPanel({ } }, - /** - * Apply this component to existing markup that is valid. With this function, no call to render() is required. - * @param {String/HTMLElement} el - */ + applyToMarkup : function(el){ this.allowDomMove = false; this.el = Ext.get(el); this.render(this.el.dom.parentNode); }, - /** - * Adds a CSS class to the component's underlying element. - * @param {string} cls The CSS class name to add - * @return {Ext.Component} this - */ + addClass : function(cls){ if(this.el){ this.el.addClass(cls); @@ -15862,11 +9965,7 @@ var myGrid = new Ext.grid.EditorGridPanel({ return this; }, - /** - * Removes a CSS class from the component's underlying element. - * @param {string} cls The CSS class name to remove - * @return {Ext.Component} this - */ + removeClass : function(cls){ if(this.el){ this.el.removeClass(cls); @@ -15876,8 +9975,8 @@ var myGrid = new Ext.grid.EditorGridPanel({ return this; }, - // private - // default function is not really useful + + onRender : function(ct, position){ if(!this.el && this.autoEl){ if(Ext.isString(this.autoEl)){ @@ -15903,7 +10002,7 @@ var myGrid = new Ext.grid.EditorGridPanel({ } }, - // private + getAutoCreate : function(){ var cfg = Ext.isObject(this.autoCreate) ? this.autoCreate : Ext.apply({}, this.defaultAutoCreate); @@ -15913,16 +10012,10 @@ var myGrid = new Ext.grid.EditorGridPanel({ return cfg; }, - // private + afterRender : Ext.emptyFn, - /** - * Destroys this component by purging any event listeners, removing the component's element from the DOM, - * removing the component from its {@link Ext.Container} (if applicable) and unregistering it from - * {@link Ext.ComponentMgr}. Destruction is generally handled automatically by the framework and this method - * should usually not need to be called directly. - * - */ + destroy : function(){ if(!this.isDestroyed){ if(this.fireEvent('beforedestroy', this) !== false){ @@ -15937,7 +10030,7 @@ var myGrid = new Ext.grid.EditorGridPanel({ this.container.remove(); } } - // Stop any buffered tasks + if(this.focusTask && this.focusTask.cancel){ this.focusTask.cancel(); } @@ -15958,69 +10051,33 @@ var myGrid = new Ext.grid.EditorGridPanel({ } }, - // private + beforeDestroy : Ext.emptyFn, - // private + onDestroy : Ext.emptyFn, - /** - *

    Returns the {@link Ext.Element} which encapsulates this Component.

    - *

    This will usually be a <DIV> element created by the class's onRender method, but - * that may be overridden using the {@link #autoEl} config.

    - *

    Note: this element will not be available until this Component has been rendered.


    - *

    To add listeners for DOM events to this Component (as opposed to listeners - * for this Component's own Observable events), see the {@link #listeners} config for a suggestion, - * or use a render listener directly:

    
    -new Ext.Panel({
    -    title: 'The Clickable Panel',
    -    listeners: {
    -        render: function(p) {
    -            // Append the Panel to the click handler's argument list.
    -            p.getEl().on('click', handlePanelClick.createDelegate(null, [p], true));
    -        },
    -        single: true  // Remove the listener after first invocation
    -    }
    -});
    -
    - * @return {Ext.Element} The Element which encapsulates this Component. - */ + getEl : function(){ return this.el; }, - // private + getContentTarget : function(){ return this.el; }, - /** - * Returns the id of this component or automatically generates and - * returns an id if an id is not defined yet:
    
    -     * 'ext-comp-' + (++Ext.Component.AUTO_ID)
    -     * 
    - * @return {String} id - */ + getId : function(){ return this.id || (this.id = 'ext-comp-' + (++Ext.Component.AUTO_ID)); }, - /** - * Returns the {@link #itemId} of this component. If an - * {@link #itemId} was not assigned through configuration the - * id is returned using {@link #getId}. - * @return {String} - */ + getItemId : function(){ return this.itemId || this.getId(); }, - /** - * Try to focus this component. - * @param {Boolean} selectText (optional) If applicable, true to also select the text in this component - * @param {Boolean/Number} delay (optional) Delay the focus this number of milliseconds (true for 10 milliseconds) - * @return {Ext.Component} this - */ + focus : function(selectText, delay){ if(delay){ this.focusTask = new Ext.util.DelayedTask(this.focus, this, [selectText, false]); @@ -16036,7 +10093,7 @@ new Ext.Panel({ return this; }, - // private + blur : function(){ if(this.rendered){ this.el.blur(); @@ -16044,11 +10101,8 @@ new Ext.Panel({ return this; }, - /** - * Disable this component and fire the 'disable' event. - * @return {Ext.Component} this - */ - disable : function(/* private */ silent){ + + disable : function( silent){ if(this.rendered){ this.onDisable(); } @@ -16059,16 +10113,13 @@ new Ext.Panel({ return this; }, - // private + onDisable : function(){ this.getActionEl().addClass(this.disabledClass); this.el.dom.disabled = true; }, - /** - * Enable this component and fire the 'enable' event. - * @return {Ext.Component} this - */ + enable : function(){ if(this.rendered){ this.onEnable(); @@ -16078,27 +10129,18 @@ new Ext.Panel({ return this; }, - // private + onEnable : function(){ this.getActionEl().removeClass(this.disabledClass); this.el.dom.disabled = false; }, - /** - * Convenience function for setting disabled/enabled by boolean. - * @param {Boolean} disabled - * @return {Ext.Component} this - */ + setDisabled : function(disabled){ return this[disabled ? 'disable' : 'enable'](); }, - /** - * Show this component. Listen to the '{@link #beforeshow}' event and return - * false to cancel showing the component. Fires the '{@link #show}' - * event after showing the component. - * @return {Ext.Component} this - */ + show : function(){ if(this.fireEvent('beforeshow', this) !== false){ this.hidden = false; @@ -16113,18 +10155,12 @@ new Ext.Panel({ return this; }, - // private + onShow : function(){ this.getVisibilityEl().removeClass('x-hide-' + this.hideMode); }, - /** - * Hide this component. Listen to the '{@link #beforehide}' event and return - * false to cancel hiding the component. Fires the '{@link #hide}' - * event after hiding the component. Note this method is called internally if - * the component is configured to be {@link #hidden}. - * @return {Ext.Component} this - */ + hide : function(){ if(this.fireEvent('beforehide', this) !== false){ this.doHide(); @@ -16133,7 +10169,7 @@ new Ext.Panel({ return this; }, - // private + doHide: function(){ this.hidden = true; if(this.rendered){ @@ -16141,101 +10177,53 @@ new Ext.Panel({ } }, - // private + onHide : function(){ this.getVisibilityEl().addClass('x-hide-' + this.hideMode); }, - // private + getVisibilityEl : function(){ return this.hideParent ? this.container : this.getActionEl(); }, - /** - * Convenience function to hide or show this component by boolean. - * @param {Boolean} visible True to show, false to hide - * @return {Ext.Component} this - */ + setVisible : function(visible){ return this[visible ? 'show' : 'hide'](); }, - /** - * Returns true if this component is visible. - * @return {Boolean} True if this component is visible, false otherwise. - */ + isVisible : function(){ return this.rendered && this.getVisibilityEl().isVisible(); }, - /** - * Clone the current component using the original config values passed into this instance by default. - * @param {Object} overrides A new config containing any properties to override in the cloned version. - * An id property can be passed on this object, otherwise one will be generated to avoid duplicates. - * @return {Ext.Component} clone The cloned copy of this component - */ + cloneConfig : function(overrides){ overrides = overrides || {}; var id = overrides.id || Ext.id(); var cfg = Ext.applyIf(overrides, this.initialConfig); - cfg.id = id; // prevent dup id + cfg.id = id; return new this.constructor(cfg); }, - /** - * Gets the xtype for this component as registered with {@link Ext.ComponentMgr}. For a list of all - * available xtypes, see the {@link Ext.Component} header. Example usage: - *
    
    -var t = new Ext.form.TextField();
    -alert(t.getXType());  // alerts 'textfield'
    -
    - * @return {String} The xtype - */ + getXType : function(){ return this.constructor.xtype; }, - /** - *

    Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended - * from the xtype (default) or whether it is directly of the xtype specified (shallow = true).

    - *

    If using your own subclasses, be aware that a Component must register its own xtype - * to participate in determination of inherited xtypes.

    - *

    For a list of all available xtypes, see the {@link Ext.Component} header.

    - *

    Example usage:

    - *
    
    -var t = new Ext.form.TextField();
    -var isText = t.isXType('textfield');        // true
    -var isBoxSubclass = t.isXType('box');       // true, descended from BoxComponent
    -var isBoxInstance = t.isXType('box', true); // false, not a direct BoxComponent instance
    -
    - * @param {String} xtype The xtype to check for this Component - * @param {Boolean} shallow (optional) False to check whether this Component is descended from the xtype (this is - * the default), or true to check whether this Component is directly of the specified xtype. - * @return {Boolean} True if this component descends from the specified xtype, false otherwise. - */ + isXType : function(xtype, shallow){ - //assume a string by default + if (Ext.isFunction(xtype)){ - xtype = xtype.xtype; //handle being passed the class, e.g. Ext.Component + xtype = xtype.xtype; }else if (Ext.isObject(xtype)){ - xtype = xtype.constructor.xtype; //handle being passed an instance + xtype = xtype.constructor.xtype; } return !shallow ? ('/' + this.getXTypes() + '/').indexOf('/' + xtype + '/') != -1 : this.constructor.xtype == xtype; }, - /** - *

    Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all - * available xtypes, see the {@link Ext.Component} header.

    - *

    If using your own subclasses, be aware that a Component must register its own xtype - * to participate in determination of inherited xtypes.

    - *

    Example usage:

    - *
    
    -var t = new Ext.form.TextField();
    -alert(t.getXTypes());  // alerts 'component/box/field/textfield'
    -
    - * @return {String} The xtype hierarchy string - */ + getXTypes : function(){ var tc = this.constructor; if(!tc.xtypes){ @@ -16250,22 +10238,13 @@ alert(t.getXTypes()); // alerts 'component/box/field/textfield' return tc.xtypes; }, - /** - * Find a container above this component at any level by a custom function. If the passed function returns - * true, the container will be returned. - * @param {Function} fn The custom function to call with the arguments (container, this component). - * @return {Ext.Container} The first Container for which the custom function returns true - */ + findParentBy : function(fn) { for (var p = this.ownerCt; (p != null) && !fn(p, this); p = p.ownerCt); return p || null; }, - /** - * Find a container above this component at any level by xtype or class - * @param {String/Class} xtype The xtype string for a component, or the class of the component directly - * @return {Ext.Container} The first Container which matches the given xtype or class - */ + findParentByType : function(xtype) { return Ext.isFunction(xtype) ? this.findParentBy(function(p){ @@ -16276,12 +10255,12 @@ alert(t.getXTypes()); // alerts 'component/box/field/textfield' }); }, - // protected + getPositionEl : function(){ return this.positionEl || this.el; }, - // private + purgeListeners : function(){ Ext.Component.superclass.purgeListeners.call(this); if(this.mons){ @@ -16289,7 +10268,7 @@ alert(t.getXTypes()); // alerts 'component/box/field/textfield' } }, - // private + clearMons : function(){ Ext.each(this.mons, function(m){ m.item.un(m.ename, m.fn, m.scope); @@ -16297,7 +10276,7 @@ alert(t.getXTypes()); // alerts 'component/box/field/textfield' this.mons = []; }, - // private + createMons: function(){ if(!this.mons){ this.mons = []; @@ -16305,26 +10284,7 @@ alert(t.getXTypes()); // alerts 'component/box/field/textfield' } }, - /** - *

    Adds listeners to any Observable object (or Elements) which are automatically removed when this Component - * is destroyed. Usage:

    -myGridPanel.mon(myGridPanel.getSelectionModel(), 'selectionchange', handleSelectionChange, null, {buffer: 50});
    -
    - *

    or:

    -myGridPanel.mon(myGridPanel.getSelectionModel(), {
    -    selectionchange: handleSelectionChange,
    -    buffer: 50
    -});
    -
    - * @param {Observable|Element} item The item to which to add a listener/listeners. - * @param {Object|String} ename The event name, or an object containing event name properties. - * @param {Function} fn Optional. If the ename parameter was an event name, this - * is the handler function. - * @param {Object} scope Optional. If the ename parameter was an event name, this - * is the scope (this reference) in which the handler function is executed. - * @param {Object} opt Optional. If the ename parameter was an event name, this - * is the {@link Ext.util.Observable#addListener addListener} options. - */ + mon : function(item, ename, fn, scope, opt){ this.createMons(); if(Ext.isObject(ename)){ @@ -16336,13 +10296,13 @@ myGridPanel.mon(myGridPanel.getSelectionModel(), { continue; } if(Ext.isFunction(o[e])){ - // shared options + this.mons.push({ item: item, ename: e, fn: o[e], scope: o.scope }); item.on(e, o[e], o.scope, o); }else{ - // individual options + this.mons.push({ item: item, ename: e, fn: o[e], scope: o.scope }); @@ -16358,15 +10318,7 @@ myGridPanel.mon(myGridPanel.getSelectionModel(), { item.on(ename, fn, scope, opt); }, - /** - * Removes listeners that were added by the {@link #mon} method. - * @param {Observable|Element} item The item from which to remove a listener/listeners. - * @param {Object|String} ename The event name, or an object containing event name properties. - * @param {Function} fn Optional. If the ename parameter was an event name, this - * is the handler function. - * @param {Object} scope Optional. If the ename parameter was an event name, this - * is the scope (this reference) in which the handler function is executed. - */ + mun : function(item, ename, fn, scope){ var found, mon; this.createMons(); @@ -16382,10 +10334,7 @@ myGridPanel.mon(myGridPanel.getSelectionModel(), { return found; }, - /** - * Returns the next component in the owning container - * @return Ext.Component - */ + nextSibling : function(){ if(this.ownerCt){ var index = this.ownerCt.items.indexOf(this); @@ -16396,10 +10345,7 @@ myGridPanel.mon(myGridPanel.getSelectionModel(), { return null; }, - /** - * Returns the previous component in the owning container - * @return Ext.Component - */ + previousSibling : function(){ if(this.ownerCt){ var index = this.ownerCt.items.indexOf(this); @@ -16410,104 +10356,21 @@ myGridPanel.mon(myGridPanel.getSelectionModel(), { return null; }, - /** - * Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy. - * @return {Ext.Container} the Container which owns this Component. - */ + getBubbleTarget : function(){ return this.ownerCt; } }); -Ext.reg('component', Ext.Component);/** - * @class Ext.Action - *

    An Action is a piece of reusable functionality that can be abstracted out of any particular component so that it - * can be usefully shared among multiple components. Actions let you share handlers, configuration options and UI - * updates across any components that support the Action interface (primarily {@link Ext.Toolbar}, {@link Ext.Button} - * and {@link Ext.menu.Menu} components).

    - *

    Aside from supporting the config object interface, any component that needs to use Actions must also support - * the following method list, as these will be called as needed by the Action class: setText(string), setIconCls(string), - * setDisabled(boolean), setVisible(boolean) and setHandler(function).

    - * Example usage:
    - *
    
    -// Define the shared action.  Each component below will have the same
    -// display text and icon, and will display the same message on click.
    -var action = new Ext.Action({
    -    {@link #text}: 'Do something',
    -    {@link #handler}: function(){
    -        Ext.Msg.alert('Click', 'You did something.');
    -    },
    -    {@link #iconCls}: 'do-something',
    -    {@link #itemId}: 'myAction'
    -});
    -
    -var panel = new Ext.Panel({
    -    title: 'Actions',
    -    width: 500,
    -    height: 300,
    -    tbar: [
    -        // Add the action directly to a toolbar as a menu button
    -        action,
    -        {
    -            text: 'Action Menu',
    -            // Add the action to a menu as a text item
    -            menu: [action]
    -        }
    -    ],
    -    items: [
    -        // Add the action to the panel body as a standard button
    -        new Ext.Button(action)
    -    ],
    -    renderTo: Ext.getBody()
    -});
    -
    -// Change the text for all components using the action
    -action.setText('Something else');
    -
    -// Reference an action through a container using the itemId
    -var btn = panel.getComponent('myAction');
    -var aRef = btn.baseAction;
    -aRef.setText('New text');
    -
    - * @constructor - * @param {Object} config The configuration options - */ +Ext.reg('component', Ext.Component); Ext.Action = Ext.extend(Object, { - /** - * @cfg {String} text The text to set for all components using this action (defaults to ''). - */ - /** - * @cfg {String} iconCls - * The CSS class selector that specifies a background image to be used as the header icon for - * all components using this action (defaults to ''). - *

    An example of specifying a custom icon class would be something like: - *

    
    -// specify the property in the config for the class:
    -     ...
    -     iconCls: 'do-something'
    -
    -// css class that specifies background image to be used as the icon image:
    -.do-something { background-image: url(../images/my-icon.gif) 0 6px no-repeat !important; }
    -
    - */ - /** - * @cfg {Boolean} disabled True to disable all components using this action, false to enable them (defaults to false). - */ - /** - * @cfg {Boolean} hidden True to hide all components using this action, false to show them (defaults to false). - */ - /** - * @cfg {Function} handler The function that will be invoked by each component tied to this action - * when the component's primary event is triggered (defaults to undefined). - */ - /** - * @cfg {String} itemId - * See {@link Ext.Component}.{@link Ext.Component#itemId itemId}. - */ - /** - * @cfg {Object} scope The scope (this reference) in which the - * {@link #handler} is executed. Defaults to this Button. - */ + + + + + + + constructor : function(config){ this.initialConfig = config; @@ -16515,127 +10378,86 @@ Ext.Action = Ext.extend(Object, { this.items = []; }, - // private + isAction : true, - /** - * Sets the text to be displayed by all components using this action. - * @param {String} text The text to display - */ + setText : function(text){ this.initialConfig.text = text; this.callEach('setText', [text]); }, - /** - * Gets the text currently displayed by all components using this action. - */ + getText : function(){ return this.initialConfig.text; }, - /** - * Sets the icon CSS class for all components using this action. The class should supply - * a background image that will be used as the icon image. - * @param {String} cls The CSS class supplying the icon image - */ + setIconClass : function(cls){ this.initialConfig.iconCls = cls; this.callEach('setIconClass', [cls]); }, - /** - * Gets the icon CSS class currently used by all components using this action. - */ + getIconClass : function(){ return this.initialConfig.iconCls; }, - /** - * Sets the disabled state of all components using this action. Shortcut method - * for {@link #enable} and {@link #disable}. - * @param {Boolean} disabled True to disable the component, false to enable it - */ + setDisabled : function(v){ this.initialConfig.disabled = v; this.callEach('setDisabled', [v]); }, - /** - * Enables all components using this action. - */ + enable : function(){ this.setDisabled(false); }, - /** - * Disables all components using this action. - */ + disable : function(){ this.setDisabled(true); }, - /** - * Returns true if the components using this action are currently disabled, else returns false. - */ + isDisabled : function(){ return this.initialConfig.disabled; }, - /** - * Sets the hidden state of all components using this action. Shortcut method - * for {@link #hide} and {@link #show}. - * @param {Boolean} hidden True to hide the component, false to show it - */ + setHidden : function(v){ this.initialConfig.hidden = v; this.callEach('setVisible', [!v]); }, - /** - * Shows all components using this action. - */ + show : function(){ this.setHidden(false); }, - /** - * Hides all components using this action. - */ + hide : function(){ this.setHidden(true); }, - /** - * Returns true if the components using this action are currently hidden, else returns false. - */ + isHidden : function(){ return this.initialConfig.hidden; }, - /** - * Sets the function that will be called by each Component using this action when its primary event is triggered. - * @param {Function} fn The function that will be invoked by the action's components. The function - * will be called with no arguments. - * @param {Object} scope The scope (this reference) in which the function is executed. Defaults to the Component firing the event. - */ + setHandler : function(fn, scope){ this.initialConfig.handler = fn; this.initialConfig.scope = scope; this.callEach('setHandler', [fn, scope]); }, - /** - * Executes the specified function once for each Component currently tied to this action. The function passed - * in should accept a single argument that will be an object that supports the basic Action config/method interface. - * @param {Function} fn The function to execute for each component - * @param {Object} scope The scope (this reference) in which the function is executed. Defaults to the Component. - */ + each : function(fn, scope){ Ext.each(this.items, fn, scope); }, - // private + callEach : function(fnName, args){ var cs = this.items; for(var i = 0, len = cs.length; i < len; i++){ @@ -16643,49 +10465,23 @@ Ext.Action = Ext.extend(Object, { } }, - // private + addComponent : function(comp){ this.items.push(comp); comp.on('destroy', this.removeComponent, this); }, - // private + removeComponent : function(comp){ this.items.remove(comp); }, - /** - * Executes this action manually using the handler function specified in the original config object - * or the handler function set with {@link #setHandler}. Any arguments passed to this - * function will be passed on to the handler function. - * @param {Mixed} arg1 (optional) Variable number of arguments passed to the handler function - * @param {Mixed} arg2 (optional) - * @param {Mixed} etc... (optional) - */ + execute : function(){ this.initialConfig.handler.apply(this.initialConfig.scope || window, arguments); } }); -/** - * @class Ext.Layer - * @extends Ext.Element - * An extended {@link Ext.Element} object that supports a shadow and shim, constrain to viewport and - * automatic maintaining of shadow/shim positions. - * @cfg {Boolean} shim False to disable the iframe shim in browsers which need one (defaults to true) - * @cfg {String/Boolean} shadow True to automatically create an {@link Ext.Shadow}, or a string indicating the - * shadow's display {@link Ext.Shadow#mode}. False to disable the shadow. (defaults to false) - * @cfg {Object} dh DomHelper object config to create element with (defaults to {tag: 'div', cls: 'x-layer'}). - * @cfg {Boolean} constrain False to disable constrain to viewport (defaults to true) - * @cfg {String} cls CSS class to add to the element - * @cfg {Number} zindex Starting z-index (defaults to 11000) - * @cfg {Number} shadowOffset Number of pixels to offset the shadow (defaults to 4) - * @cfg {Boolean} useDisplay - * Defaults to use css offsets to hide the Layer. Specify true - * to use css style 'display:none;' to hide the Layer. - * @constructor - * @param {Object} config An object with config options. - * @param {String/HTMLElement} existingEl (optional) Uses an existing DOM element. If the element is not found it creates it. - */ + (function(){ Ext.Layer = function(config, existingEl){ config = config || {}; @@ -16726,7 +10522,7 @@ Ext.Layer = function(config, existingEl){ var supr = Ext.Element.prototype; -// shims are shared among layer to keep from having 100 iframes + var shims = []; Ext.extend(Ext.Layer, Ext.Element, { @@ -16786,9 +10582,9 @@ Ext.extend(Ext.Layer, Ext.Element, { } }, - // private - // this code can execute repeatedly in milliseconds (i.e. during a drag) so - // code size was sacrificed for effeciency (e.g. no getBox/setBox, no XY calls) + + + sync : function(doShow){ var shadow = this.shadow; if(!this.updating && this.isVisible() && (shadow || this.useShim)){ @@ -16808,7 +10604,7 @@ Ext.extend(Ext.Layer, Ext.Element, { if(doShow){ shim.show(); } - // fit the shim behind the shadow, so it is shimmed too + var shadowAdj = shadow.el.getXY(), shimStyle = shim.dom.style, shadowSize = shadow.el.getSize(); shimStyle.left = (shadowAdj[0])+'px'; @@ -16826,7 +10622,7 @@ Ext.extend(Ext.Layer, Ext.Element, { } }, - // private + destroy : function(){ this.hideShim(); if(this.shadow){ @@ -16841,18 +10637,18 @@ Ext.extend(Ext.Layer, Ext.Element, { this.destroy(); }, - // private + beginUpdate : function(){ this.updating = true; }, - // private + endUpdate : function(){ this.updating = false; this.sync(true); }, - // private + hideUnders : function(negOffset){ if(this.shadow){ this.shadow.hide(); @@ -16860,7 +10656,7 @@ Ext.extend(Ext.Layer, Ext.Element, { this.hideShim(); }, - // private + constrainXY : function(){ if(this.constrain){ var vw = Ext.lib.Dom.getViewWidth(), @@ -16871,9 +10667,9 @@ Ext.extend(Ext.Layer, Ext.Element, { var x = xy[0], y = xy[1]; var so = this.shadowOffset; var w = this.dom.offsetWidth+so, h = this.dom.offsetHeight+so; - // only move it if it needs it + var moved = false; - // first validate right/bottom + if((x + w) > vw+s.left){ x = vw - w - so; moved = true; @@ -16882,7 +10678,7 @@ Ext.extend(Ext.Layer, Ext.Element, { y = vh - h - so; moved = true; } - // then make sure top/left isn't negative + if(x < s.left){ x = s.left; moved = true; @@ -16911,9 +10707,9 @@ Ext.extend(Ext.Layer, Ext.Element, { return this.visible; }, - // private + showAction : function(){ - this.visible = true; // track visibility to prevent getStyle calls + this.visible = true; if(this.useDisplay === true){ this.setDisplayed(''); }else if(this.lastXY){ @@ -16923,7 +10719,7 @@ Ext.extend(Ext.Layer, Ext.Element, { } }, - // private + hideAction : function(){ this.visible = false; if(this.useDisplay === true){ @@ -16933,7 +10729,7 @@ Ext.extend(Ext.Layer, Ext.Element, { } }, - // overridden Element method + setVisible : function(v, a, d, c, e){ if(v){ this.showAction(); @@ -16979,26 +10775,26 @@ Ext.extend(Ext.Layer, Ext.Element, { this.lastLT = [left, top]; }, - // private + beforeFx : function(){ this.beforeAction(); return Ext.Layer.superclass.beforeFx.apply(this, arguments); }, - // private + afterFx : function(){ Ext.Layer.superclass.afterFx.apply(this, arguments); this.sync(this.isVisible()); }, - // private + beforeAction : function(){ if(!this.updating && this.shadow){ this.shadow.hide(); } }, - // overridden Element method + setLeft : function(left){ this.storeLeftTop(left, this.getTop(true)); supr.setLeft.apply(this, arguments); @@ -17032,7 +10828,7 @@ Ext.extend(Ext.Layer, Ext.Element, { return this; }, - // private + createCB : function(c){ var el = this; return function(){ @@ -17044,19 +10840,19 @@ Ext.extend(Ext.Layer, Ext.Element, { }; }, - // overridden Element method + setX : function(x, a, d, c, e){ this.setXY([x, this.getY()], a, d, c, e); return this; }, - // overridden Element method + setY : function(y, a, d, c, e){ this.setXY([this.getX(), y], a, d, c, e); return this; }, - // overridden Element method + setSize : function(w, h, a, d, c, e){ this.beforeAction(); var cb = this.createCB(c); @@ -17067,7 +10863,7 @@ Ext.extend(Ext.Layer, Ext.Element, { return this; }, - // overridden Element method + setWidth : function(w, a, d, c, e){ this.beforeAction(); var cb = this.createCB(c); @@ -17078,7 +10874,7 @@ Ext.extend(Ext.Layer, Ext.Element, { return this; }, - // overridden Element method + setHeight : function(h, a, d, c, e){ this.beforeAction(); var cb = this.createCB(c); @@ -17089,7 +10885,7 @@ Ext.extend(Ext.Layer, Ext.Element, { return this; }, - // overridden Element method + setBounds : function(x, y, w, h, a, d, c, e){ this.beforeAction(); var cb = this.createCB(c); @@ -17104,13 +10900,7 @@ Ext.extend(Ext.Layer, Ext.Element, { return this; }, - /** - * Sets the z-index of this layer and adjusts any shadow and shim z-indexes. The layer z-index is automatically - * incremented by two more than the value passed in so that it always shows above any shadow or shim (the shadow - * element, if any, will be assigned z-index + 1, and the shim element, if any, will be assigned the unmodified z-index). - * @param {Number} zindex The new z-index to set - * @return {this} The Layer - */ + setZIndex : function(zindex){ this.zindex = zindex; this.setStyle('z-index', zindex + 2); @@ -17124,15 +10914,7 @@ Ext.extend(Ext.Layer, Ext.Element, { } }); })(); -/** - * @class Ext.Shadow - * Simple class that can provide a shadow effect for any element. Note that the element MUST be absolutely positioned, - * and the shadow does not provide any shimming. This should be used only in simple cases -- for more advanced - * functionality that can also provide the same shadow effect, see the {@link Ext.Layer} class. - * @constructor - * Create a new Shadow - * @param {Object} config The config object - */ + Ext.Shadow = function(config){ Ext.apply(this, config); if(typeof this.mode != "string"){ @@ -17140,7 +10922,7 @@ Ext.Shadow = function(config){ } var o = this.offset, a = {h: 0}; var rad = Math.floor(this.offset/2); - switch(this.mode.toLowerCase()){ // all this hideous nonsense calculates the various offsets for shadows + switch(this.mode.toLowerCase()){ case "drop": a.w = 0; a.l = a.t = o; @@ -17186,27 +10968,14 @@ Ext.Shadow = function(config){ }; Ext.Shadow.prototype = { - /** - * @cfg {String} mode - * The shadow display mode. Supports the following options:
      - *
    • sides : Shadow displays on both sides and bottom only
    • - *
    • frame : Shadow displays equally on all four sides
    • - *
    • drop : Traditional bottom-right drop shadow
    • - *
    - */ - /** - * @cfg {String} offset - * The number of pixels to offset the shadow from the element (defaults to 4) - */ + + offset: 4, - // private + defaultMode: "drop", - /** - * Displays the shadow under the target element - * @param {Mixed} targetEl The id or element under which the shadow should display - */ + show : function(target){ target = Ext.get(target); if(!this.el){ @@ -17228,21 +10997,12 @@ Ext.Shadow.prototype = { this.el.dom.style.display = "block"; }, - /** - * Returns true if the shadow is visible, else false - */ + isVisible : function(){ return this.el ? true : false; }, - /** - * Direct alignment when values are already available. Show must be called at least once before - * calling this method to ensure it is initialized. - * @param {Number} left The target element left position - * @param {Number} top The target element top position - * @param {Number} width The target element width - * @param {Number} height The target element height - */ + realign : function(l, t, w, h){ if(!this.el){ return; @@ -17266,9 +11026,7 @@ Ext.Shadow.prototype = { } }, - /** - * Hides this shadow - */ + hide : function(){ if(this.el){ this.el.dom.style.display = "none"; @@ -17277,10 +11035,7 @@ Ext.Shadow.prototype = { } }, - /** - * Adjust the z-index of this shadow - * @param {Number} zindex The new z-index - */ + setZIndex : function(z){ this.zIndex = z; if(this.el){ @@ -17289,7 +11044,7 @@ Ext.Shadow.prototype = { } }; -// Private utility class that manages the internal Shadow cache + Ext.Shadow.Pool = function(){ var p = []; var markup = Ext.isIE ? @@ -17309,280 +11064,55 @@ Ext.Shadow.Pool = function(){ p.push(sh); } }; -}();/** - * @class Ext.BoxComponent - * @extends Ext.Component - *

    Base class for any {@link Ext.Component Component} that is to be sized as a box, using width and height.

    - *

    BoxComponent provides automatic box model adjustments for sizing and positioning and will work correctly - * within the Component rendering model.

    - *

    A BoxComponent may be created as a custom Component which encapsulates any HTML element, either a pre-existing - * element, or one that is created to your specifications at render time. Usually, to participate in layouts, - * a Component will need to be a BoxComponent in order to have its width and height managed.

    - *

    To use a pre-existing element as a BoxComponent, configure it so that you preset the el property to the - * element to reference:

    
    -var pageHeader = new Ext.BoxComponent({
    -    el: 'my-header-div'
    -});
    - * This may then be {@link Ext.Container#add added} to a {@link Ext.Container Container} as a child item.

    - *

    To create a BoxComponent based around a HTML element to be created at render time, use the - * {@link Ext.Component#autoEl autoEl} config option which takes the form of a - * {@link Ext.DomHelper DomHelper} specification:

    
    -var myImage = new Ext.BoxComponent({
    -    autoEl: {
    -        tag: 'img',
    -        src: '/images/my-image.jpg'
    -    }
    -});

    - * @constructor - * @param {Ext.Element/String/Object} config The configuration options. - * @xtype box - */ +}(); Ext.BoxComponent = Ext.extend(Ext.Component, { - // Configs below are used for all Components when rendered by BoxLayout. - /** - * @cfg {Number} flex - *

    Note: this config is only used when this Component is rendered - * by a Container which has been configured to use a {@link Ext.layout.BoxLayout BoxLayout}. - * Each child Component with a flex property will be flexed either vertically (by a VBoxLayout) - * or horizontally (by an HBoxLayout) according to the item's relative flex value - * compared to the sum of all Components with flex value specified. Any child items that have - * either a flex = 0 or flex = undefined will not be 'flexed' (the initial size will not be changed). - */ - // Configs below are used for all Components when rendered by AnchorLayout. - /** - * @cfg {String} anchor

    Note: this config is only used when this Component is rendered - * by a Container which has been configured to use an {@link Ext.layout.AnchorLayout AnchorLayout} (or subclass thereof). - * based layout manager, for example:

      - *
    • {@link Ext.form.FormPanel}
    • - *
    • specifying layout: 'anchor' // or 'form', or 'absolute'
    • - *

    - *

    See {@link Ext.layout.AnchorLayout}.{@link Ext.layout.AnchorLayout#anchor anchor} also.

    - */ - // tabTip config is used when a BoxComponent is a child of a TabPanel - /** - * @cfg {String} tabTip - *

    Note: this config is only used when this BoxComponent is a child item of a TabPanel.

    - * A string to be used as innerHTML (html tags are accepted) to show in a tooltip when mousing over - * the associated tab selector element. {@link Ext.QuickTips}.init() - * must be called in order for the tips to render. - */ - // Configs below are used for all Components when rendered by BorderLayout. - /** - * @cfg {String} region

    Note: this config is only used when this BoxComponent is rendered - * by a Container which has been configured to use the {@link Ext.layout.BorderLayout BorderLayout} - * layout manager (e.g. specifying layout:'border').


    - *

    See {@link Ext.layout.BorderLayout} also.

    - */ - // margins config is used when a BoxComponent is rendered by BorderLayout or BoxLayout. - /** - * @cfg {Object} margins

    Note: this config is only used when this BoxComponent is rendered - * by a Container which has been configured to use the {@link Ext.layout.BorderLayout BorderLayout} - * or one of the two {@link Ext.layout.BoxLayout BoxLayout} subclasses.

    - *

    An object containing margins to apply to this BoxComponent in the - * format:

    
    -{
    -    top: (top margin),
    -    right: (right margin),
    -    bottom: (bottom margin),
    -    left: (left margin)
    -}
    - *

    May also be a string containing space-separated, numeric margin values. The order of the - * sides associated with each value matches the way CSS processes margin values:

    - *

      - *
    • If there is only one value, it applies to all sides.
    • - *
    • If there are two values, the top and bottom borders are set to the first value and the - * right and left are set to the second.
    • - *
    • If there are three values, the top is set to the first value, the left and right are set - * to the second, and the bottom is set to the third.
    • - *
    • If there are four values, they apply to the top, right, bottom, and left, respectively.
    • - *

    - *

    Defaults to:

    
    -     * {top:0, right:0, bottom:0, left:0}
    -     * 
    - */ - /** - * @cfg {Number} x - * The local x (left) coordinate for this component if contained within a positioning container. - */ - /** - * @cfg {Number} y - * The local y (top) coordinate for this component if contained within a positioning container. - */ - /** - * @cfg {Number} pageX - * The page level x coordinate for this component if contained within a positioning container. - */ - /** - * @cfg {Number} pageY - * The page level y coordinate for this component if contained within a positioning container. - */ - /** - * @cfg {Number} height - * The height of this component in pixels (defaults to auto). - * Note to express this dimension as a percentage or offset see {@link Ext.Component#anchor}. - */ - /** - * @cfg {Number} width - * The width of this component in pixels (defaults to auto). - * Note to express this dimension as a percentage or offset see {@link Ext.Component#anchor}. - */ - /** - * @cfg {Number} boxMinHeight - *

    The minimum value in pixels which this BoxComponent will set its height to.

    - *

    Warning: This will override any size management applied by layout managers.

    - */ - /** - * @cfg {Number} boxMinWidth - *

    The minimum value in pixels which this BoxComponent will set its width to.

    - *

    Warning: This will override any size management applied by layout managers.

    - */ - /** - * @cfg {Number} boxMaxHeight - *

    The maximum value in pixels which this BoxComponent will set its height to.

    - *

    Warning: This will override any size management applied by layout managers.

    - */ - /** - * @cfg {Number} boxMaxWidth - *

    The maximum value in pixels which this BoxComponent will set its width to.

    - *

    Warning: This will override any size management applied by layout managers.

    - */ - /** - * @cfg {Boolean} autoHeight - *

    True to use height:'auto', false to use fixed height (or allow it to be managed by its parent - * Container's {@link Ext.Container#layout layout manager}. Defaults to false.

    - *

    Note: Although many components inherit this config option, not all will - * function as expected with a height of 'auto'. Setting autoHeight:true means that the - * browser will manage height based on the element's contents, and that Ext will not manage it at all.

    - *

    If the browser is managing the height, be aware that resizes performed by the browser in response - * to changes within the structure of the Component cannot be detected. Therefore changes to the height might - * result in elements needing to be synchronized with the new height. Example:

    
    -var w = new Ext.Window({
    -    title: 'Window',
    -    width: 600,
    -    autoHeight: true,
    -    items: {
    -        title: 'Collapse Me',
    -        height: 400,
    -        collapsible: true,
    -        border: false,
    -        listeners: {
    -            beforecollapse: function() {
    -                w.el.shadow.hide();
    -            },
    -            beforeexpand: function() {
    -                w.el.shadow.hide();
    -            },
    -            collapse: function() {
    -                w.syncShadow();
    -            },
    -            expand: function() {
    -                w.syncShadow();
    -            }
    -        }
    -    }
    -}).show();
    -
    - */ - /** - * @cfg {Boolean} autoWidth - *

    True to use width:'auto', false to use fixed width (or allow it to be managed by its parent - * Container's {@link Ext.Container#layout layout manager}. Defaults to false.

    - *

    Note: Although many components inherit this config option, not all will - * function as expected with a width of 'auto'. Setting autoWidth:true means that the - * browser will manage width based on the element's contents, and that Ext will not manage it at all.

    - *

    If the browser is managing the width, be aware that resizes performed by the browser in response - * to changes within the structure of the Component cannot be detected. Therefore changes to the width might - * result in elements needing to be synchronized with the new width. For example, where the target element is:

    
    -<div id='grid-container' style='margin-left:25%;width:50%'></div>
    -
    - * A Panel rendered into that target element must listen for browser window resize in order to relay its - * child items when the browser changes its width:
    
    -var myPanel = new Ext.Panel({
    -    renderTo: 'grid-container',
    -    monitorResize: true, // relay on browser resize
    -    title: 'Panel',
    -    height: 400,
    -    autoWidth: true,
    -    layout: 'hbox',
    -    layoutConfig: {
    -        align: 'stretch'
    -    },
    -    defaults: {
    -        flex: 1
    -    },
    -    items: [{
    -        title: 'Box 1',
    -    }, {
    -        title: 'Box 2'
    -    }, {
    -        title: 'Box 3'
    -    }],
    -});
    -
    - */ - /** - * @cfg {Boolean} autoScroll - * true to use overflow:'auto' on the components layout element and show scroll bars automatically when - * necessary, false to clip any overflowing content (defaults to false). - */ + + + + + + + + + + + + + + + + + + + + + + + - /* // private internal config - * {Boolean} deferHeight - * True to defer height calculations to an external component, false to allow this component to set its own - * height (defaults to false). - */ + - // private + initComponent : function(){ Ext.BoxComponent.superclass.initComponent.call(this); this.addEvents( - /** - * @event resize - * Fires after the component is resized. - * @param {Ext.Component} this - * @param {Number} adjWidth The box-adjusted width that was set - * @param {Number} adjHeight The box-adjusted height that was set - * @param {Number} rawWidth The width that was originally specified - * @param {Number} rawHeight The height that was originally specified - */ + 'resize', - /** - * @event move - * Fires after the component is moved. - * @param {Ext.Component} this - * @param {Number} x The new x position - * @param {Number} y The new y position - */ + 'move' ); }, - // private, set in afterRender to signify that the component has been rendered + boxReady : false, - // private, used to defer height settings to subclasses + deferHeight: false, - /** - * Sets the width and height of this BoxComponent. This method fires the {@link #resize} event. This method can accept - * either width and height as separate arguments, or you can pass a size object like {width:10, height:20}. - * @param {Mixed} width The new width to set. This may be one of:
      - *
    • A Number specifying the new width in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).
    • - *
    • A String used to set the CSS width style.
    • - *
    • A size object in the format {width: widthValue, height: heightValue}.
    • - *
    • undefined to leave the width unchanged.
    • - *
    - * @param {Mixed} height The new height to set (not required if a size object is passed as the first arg). - * This may be one of:
      - *
    • A Number specifying the new height in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).
    • - *
    • A String used to set the CSS height style. Animation may not be used.
    • - *
    • undefined to leave the height unchanged.
    • - *
    - * @return {Ext.BoxComponent} this - */ + setSize : function(w, h){ - // support for standard size objects + if(typeof w == 'object'){ h = w.height; w = w.width; @@ -17599,14 +11129,14 @@ var myPanel = new Ext.Panel({ if (Ext.isDefined(h) && Ext.isDefined(this.boxMaxHeight) && (h > this.boxMaxHeight)) { h = this.boxMaxHeight; } - // not rendered + if(!this.boxReady){ this.width = w; this.height = h; return this; } - // prevent recalcs when not needed + if(this.cacheSizes !== false && this.lastSize && this.lastSize.width == w && this.lastSize.height == h){ return this; } @@ -17615,7 +11145,7 @@ var myPanel = new Ext.Panel({ aw = adj.width, ah = adj.height, rz; - if(aw !== undefined || ah !== undefined){ // this code is nasty but performs better with floaters + if(aw !== undefined || ah !== undefined){ rz = this.getResizeEl(); if(!this.deferHeight && aw !== undefined && ah !== undefined){ rz.setSize(aw, ah); @@ -17630,70 +11160,39 @@ var myPanel = new Ext.Panel({ return this; }, - /** - * Sets the width of the component. This method fires the {@link #resize} event. - * @param {Mixed} width The new width to set. This may be one of:
      - *
    • A Number specifying the new width in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit defaultUnit}s (by default, pixels).
    • - *
    • A String used to set the CSS width style.
    • - *
    - * @return {Ext.BoxComponent} this - */ + setWidth : function(width){ return this.setSize(width); }, - /** - * Sets the height of the component. This method fires the {@link #resize} event. - * @param {Mixed} height The new height to set. This may be one of:
      - *
    • A Number specifying the new height in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit defaultUnit}s (by default, pixels).
    • - *
    • A String used to set the CSS height style.
    • - *
    • undefined to leave the height unchanged.
    • - *
    - * @return {Ext.BoxComponent} this - */ + setHeight : function(height){ return this.setSize(undefined, height); }, - /** - * Gets the current size of the component's underlying element. - * @return {Object} An object containing the element's size {width: (element width), height: (element height)} - */ + getSize : function(){ return this.getResizeEl().getSize(); }, - /** - * Gets the current width of the component's underlying element. - * @return {Number} - */ + getWidth : function(){ return this.getResizeEl().getWidth(); }, - /** - * Gets the current height of the component's underlying element. - * @return {Number} - */ + getHeight : function(){ return this.getResizeEl().getHeight(); }, - /** - * Gets the current size of the component's underlying element, including space taken by its margins. - * @return {Object} An object containing the element's size {width: (element width + left/right margins), height: (element height + top/bottom margins)} - */ + getOuterSize : function(){ var el = this.getResizeEl(); return {width: el.getWidth() + el.getMargins('lr'), height: el.getHeight() + el.getMargins('tb')}; }, - /** - * Gets the current XY position of the component's underlying element. - * @param {Boolean} local (optional) If true the element's left and top are returned instead of page XY (defaults to false) - * @return {Array} The XY position of the element (e.g., [100, 200]) - */ + getPosition : function(local){ var el = this.getPositionEl(); if(local === true){ @@ -17702,11 +11201,7 @@ var myPanel = new Ext.Panel({ return this.xy || el.getXY(); }, - /** - * Gets the current box measurements of the component's underlying element. - * @param {Boolean} local (optional) If true the element's left and top are returned instead of page XY (defaults to false) - * @return {Object} box An object in the format {x, y, width, height} - */ + getBox : function(local){ var pos = this.getPosition(local); var s = this.getSize(); @@ -17715,37 +11210,19 @@ var myPanel = new Ext.Panel({ return s; }, - /** - * Sets the current box measurements of the component's underlying element. - * @param {Object} box An object in the format {x, y, width, height} - * @return {Ext.BoxComponent} this - */ + updateBox : function(box){ this.setSize(box.width, box.height); this.setPagePosition(box.x, box.y); return this; }, - /** - *

    Returns the outermost Element of this Component which defines the Components overall size.

    - *

    Usually this will return the same Element as {@link #getEl}, - * but in some cases, a Component may have some more wrapping Elements around its main - * active Element.

    - *

    An example is a ComboBox. It is encased in a wrapping Element which - * contains both the <input> Element (which is what would be returned - * by its {@link #getEl} method, and the trigger button Element. - * This Element is returned as the resizeEl. - * @return {Ext.Element} The Element which is to be resized by size managing layouts. - */ + getResizeEl : function(){ return this.resizeEl || this.el; }, - /** - * Sets the overflow on the content element of the component. - * @param {Boolean} scroll True to allow the Component to auto scroll. - * @return {Ext.BoxComponent} this - */ + setAutoScroll : function(scroll){ if(this.rendered){ this.getContentTarget().setOverflow(scroll ? 'auto' : ''); @@ -17754,13 +11231,7 @@ var myPanel = new Ext.Panel({ return this; }, - /** - * Sets the left and top of the component. To set the page XY position instead, use {@link #setPagePosition}. - * This method fires the {@link #move} event. - * @param {Number} left The new left - * @param {Number} top The new top - * @return {Ext.BoxComponent} this - */ + setPosition : function(x, y){ if(x && typeof x[1] == 'number'){ y = x[1]; @@ -17789,13 +11260,7 @@ var myPanel = new Ext.Panel({ return this; }, - /** - * Sets the page XY position of the component. To set the left and top instead, use {@link #setPosition}. - * This method fires the {@link #move} event. - * @param {Number} x The new x position - * @param {Number} y The new y position - * @return {Ext.BoxComponent} this - */ + setPagePosition : function(x, y){ if(x && typeof x[1] == 'number'){ y = x[1]; @@ -17806,7 +11271,7 @@ var myPanel = new Ext.Panel({ if(!this.boxReady){ return; } - if(x === undefined || y === undefined){ // cannot translate undefined points + if(x === undefined || y === undefined){ return; } var p = this.getPositionEl().translatePoints(x, y); @@ -17814,7 +11279,7 @@ var myPanel = new Ext.Panel({ return this; }, - // private + afterRender : function(){ Ext.BoxComponent.superclass.afterRender.call(this); if(this.resizeEl){ @@ -17833,38 +11298,23 @@ var myPanel = new Ext.Panel({ } }, - /** - * Force the component's size to recalculate based on the underlying element's current height and width. - * @return {Ext.BoxComponent} this - */ + syncSize : function(){ delete this.lastSize; this.setSize(this.autoWidth ? undefined : this.getResizeEl().getWidth(), this.autoHeight ? undefined : this.getResizeEl().getHeight()); return this; }, - /* // protected - * Called after the component is resized, this method is empty by default but can be implemented by any - * subclass that needs to perform custom logic after a resize occurs. - * @param {Number} adjWidth The box-adjusted width that was set - * @param {Number} adjHeight The box-adjusted height that was set - * @param {Number} rawWidth The width that was originally specified - * @param {Number} rawHeight The height that was originally specified - */ + onResize : function(adjWidth, adjHeight, rawWidth, rawHeight){ }, - /* // protected - * Called after the component is moved, this method is empty by default but can be implemented by any - * subclass that needs to perform custom logic after a move occurs. - * @param {Number} x The new x position - * @param {Number} y The new y position - */ + onPosition : function(x, y){ }, - // private + adjustSize : function(w, h){ if(this.autoWidth){ w = 'auto'; @@ -17875,7 +11325,7 @@ var myPanel = new Ext.Panel({ return {width : w, height: h}; }, - // private + adjustPosition : function(x, y){ return {x : x, y: y}; } @@ -17883,142 +11333,76 @@ var myPanel = new Ext.Panel({ Ext.reg('box', Ext.BoxComponent); -/** - * @class Ext.Spacer - * @extends Ext.BoxComponent - *

    Used to provide a sizable space in a layout.

    - * @constructor - * @param {Object} config - */ + Ext.Spacer = Ext.extend(Ext.BoxComponent, { autoEl:'div' }); -Ext.reg('spacer', Ext.Spacer);/** - * @class Ext.SplitBar - * @extends Ext.util.Observable - * Creates draggable splitter bar functionality from two elements (element to be dragged and element to be resized). - *

    - * Usage: - *
    
    -var split = new Ext.SplitBar("elementToDrag", "elementToSize",
    -                   Ext.SplitBar.HORIZONTAL, Ext.SplitBar.LEFT);
    -split.setAdapter(new Ext.SplitBar.AbsoluteLayoutAdapter("container"));
    -split.minSize = 100;
    -split.maxSize = 600;
    -split.animate = true;
    -split.on('moved', splitterMoved);
    -
    - * @constructor - * Create a new SplitBar - * @param {Mixed} dragElement The element to be dragged and act as the SplitBar. - * @param {Mixed} resizingElement The element to be resized based on where the SplitBar element is dragged - * @param {Number} orientation (optional) Either Ext.SplitBar.HORIZONTAL or Ext.SplitBar.VERTICAL. (Defaults to HORIZONTAL) - * @param {Number} placement (optional) Either Ext.SplitBar.LEFT or Ext.SplitBar.RIGHT for horizontal or - Ext.SplitBar.TOP or Ext.SplitBar.BOTTOM for vertical. (By default, this is determined automatically by the initial - position of the SplitBar). - */ +Ext.reg('spacer', Ext.Spacer); Ext.SplitBar = function(dragElement, resizingElement, orientation, placement, existingProxy){ - /** @private */ + this.el = Ext.get(dragElement, true); this.el.dom.unselectable = "on"; - /** @private */ + this.resizingEl = Ext.get(resizingElement, true); - /** - * @private - * The orientation of the split. Either Ext.SplitBar.HORIZONTAL or Ext.SplitBar.VERTICAL. (Defaults to HORIZONTAL) - * Note: If this is changed after creating the SplitBar, the placement property must be manually updated - * @type Number - */ + this.orientation = orientation || Ext.SplitBar.HORIZONTAL; - /** - * The increment, in pixels by which to move this SplitBar. When undefined, the SplitBar moves smoothly. - * @type Number - * @property tickSize - */ - /** - * The minimum size of the resizing element. (Defaults to 0) - * @type Number - */ + + this.minSize = 0; - /** - * The maximum size of the resizing element. (Defaults to 2000) - * @type Number - */ + this.maxSize = 2000; - /** - * Whether to animate the transition to the new size - * @type Boolean - */ + this.animate = false; - /** - * Whether to create a transparent shim that overlays the page when dragging, enables dragging across iframes. - * @type Boolean - */ + this.useShim = false; - /** @private */ + this.shim = null; if(!existingProxy){ - /** @private */ + this.proxy = Ext.SplitBar.createProxy(this.orientation); }else{ this.proxy = Ext.get(existingProxy).dom; } - /** @private */ + this.dd = new Ext.dd.DDProxy(this.el.dom.id, "XSplitBars", {dragElId : this.proxy.id}); - /** @private */ + this.dd.b4StartDrag = this.onStartProxyDrag.createDelegate(this); - /** @private */ + this.dd.endDrag = this.onEndProxyDrag.createDelegate(this); - /** @private */ + this.dragSpecs = {}; - /** - * @private The adapter to use to positon and resize elements - */ + this.adapter = new Ext.SplitBar.BasicLayoutAdapter(); this.adapter.init(this); if(this.orientation == Ext.SplitBar.HORIZONTAL){ - /** @private */ + this.placement = placement || (this.el.getX() > this.resizingEl.getX() ? Ext.SplitBar.LEFT : Ext.SplitBar.RIGHT); this.el.addClass("x-splitbar-h"); }else{ - /** @private */ + this.placement = placement || (this.el.getY() > this.resizingEl.getY() ? Ext.SplitBar.TOP : Ext.SplitBar.BOTTOM); this.el.addClass("x-splitbar-v"); } this.addEvents( - /** - * @event resize - * Fires when the splitter is moved (alias for {@link #moved}) - * @param {Ext.SplitBar} this - * @param {Number} newSize the new width or height - */ + "resize", - /** - * @event moved - * Fires when the splitter is moved - * @param {Ext.SplitBar} this - * @param {Number} newSize the new width or height - */ + "moved", - /** - * @event beforeresize - * Fires before the splitter is dragged - * @param {Ext.SplitBar} this - */ + "beforeresize", "beforeapply" @@ -18062,9 +11446,7 @@ Ext.extend(Ext.SplitBar, Ext.util.Observable, { Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd, x, y); }, - /** - * @private Called after the drag operation by the DDProxy - */ + onEndProxyDrag : function(e){ Ext.get(this.proxy).setDisplayed(false); var endPoint = Ext.lib.Event.getXY(e); @@ -18096,59 +11478,38 @@ Ext.extend(Ext.SplitBar, Ext.util.Observable, { } }, - /** - * Get the adapter this SplitBar uses - * @return The adapter object - */ + getAdapter : function(){ return this.adapter; }, - /** - * Set the adapter this SplitBar uses - * @param {Object} adapter A SplitBar adapter object - */ + setAdapter : function(adapter){ this.adapter = adapter; this.adapter.init(this); }, - /** - * Gets the minimum size for the resizing element - * @return {Number} The minimum size - */ + getMinimumSize : function(){ return this.minSize; }, - /** - * Sets the minimum size for the resizing element - * @param {Number} minSize The minimum size - */ + setMinimumSize : function(minSize){ this.minSize = minSize; }, - /** - * Gets the maximum size for the resizing element - * @return {Number} The maximum size - */ + getMaximumSize : function(){ return this.maxSize; }, - /** - * Sets the maximum size for the resizing element - * @param {Number} maxSize The maximum size - */ + setMaximumSize : function(maxSize){ this.maxSize = maxSize; }, - /** - * Sets the initialize size for the resizing element - * @param {Number} size The initial size - */ + setCurrentSize : function(size){ var oldAnimate = this.animate; this.animate = false; @@ -18156,10 +11517,7 @@ Ext.extend(Ext.SplitBar, Ext.util.Observable, { this.animate = oldAnimate; }, - /** - * Destroy this splitbar. - * @param {Boolean} removeEl True to remove the element - */ + destroy : function(removeEl){ Ext.destroy(this.shim, Ext.get(this.proxy)); this.dd.unreg(); @@ -18170,9 +11528,7 @@ Ext.extend(Ext.SplitBar, Ext.util.Observable, { } }); -/** - * @private static Create our own proxy element element. So it will be the same same size on all browsers, we won't use borders. Instead we use a background color. - */ + Ext.SplitBar.createProxy = function(dir){ var proxy = new Ext.Element(document.createElement("div")); document.body.appendChild(proxy.dom); @@ -18182,23 +11538,16 @@ Ext.SplitBar.createProxy = function(dir){ return proxy.dom; }; -/** - * @class Ext.SplitBar.BasicLayoutAdapter - * Default Adapter. It assumes the splitter and resizing element are not positioned - * elements and only gets/sets the width of the element. Generally used for table based layouts. - */ + Ext.SplitBar.BasicLayoutAdapter = function(){ }; Ext.SplitBar.BasicLayoutAdapter.prototype = { - // do nothing for now + init : function(s){ }, - /** - * Called before drag operations to get the current size of the resizing element. - * @param {Ext.SplitBar} s The SplitBar using this adapter - */ + getElementSize : function(s){ if(s.orientation == Ext.SplitBar.HORIZONTAL){ return s.resizingEl.getWidth(); @@ -18207,12 +11556,7 @@ Ext.SplitBar.BasicLayoutAdapter.prototype = { } }, - /** - * Called after drag operations to set the size of the resizing element. - * @param {Ext.SplitBar} s The SplitBar using this adapter - * @param {Number} newSize The new size to set - * @param {Function} onComplete A function to be invoked when resizing is complete - */ + setElementSize : function(s, newSize, onComplete){ if(s.orientation == Ext.SplitBar.HORIZONTAL){ if(!s.animate){ @@ -18237,14 +11581,7 @@ Ext.SplitBar.BasicLayoutAdapter.prototype = { } }; -/** - *@class Ext.SplitBar.AbsoluteLayoutAdapter - * @extends Ext.SplitBar.BasicLayoutAdapter - * Adapter that moves the splitter element to align with the resized sizing element. - * Used with an absolute positioned SplitBar. - * @param {Mixed} container The container that wraps around the absolute positioned content. If it's - * document.body, make sure you assign an id to the body element. - */ + Ext.SplitBar.AbsoluteLayoutAdapter = function(container){ this.basic = new Ext.SplitBar.BasicLayoutAdapter(); this.container = Ext.get(container); @@ -18282,488 +11619,70 @@ Ext.SplitBar.AbsoluteLayoutAdapter.prototype = { } }; -/** - * Orientation constant - Create a vertical SplitBar - * @static - * @type Number - */ + Ext.SplitBar.VERTICAL = 1; -/** - * Orientation constant - Create a horizontal SplitBar - * @static - * @type Number - */ + Ext.SplitBar.HORIZONTAL = 2; -/** - * Placement constant - The resizing element is to the left of the splitter element - * @static - * @type Number - */ + Ext.SplitBar.LEFT = 1; -/** - * Placement constant - The resizing element is to the right of the splitter element - * @static - * @type Number - */ + Ext.SplitBar.RIGHT = 2; -/** - * Placement constant - The resizing element is positioned above the splitter element - * @static - * @type Number - */ -Ext.SplitBar.TOP = 3; -/** - * Placement constant - The resizing element is positioned under splitter element - * @static - * @type Number - */ -Ext.SplitBar.BOTTOM = 4; -/** - * @class Ext.Container - * @extends Ext.BoxComponent - *

    Base class for any {@link Ext.BoxComponent} that may contain other Components. Containers handle the - * basic behavior of containing items, namely adding, inserting and removing items.

    - * - *

    The most commonly used Container classes are {@link Ext.Panel}, {@link Ext.Window} and {@link Ext.TabPanel}. - * If you do not need the capabilities offered by the aforementioned classes you can create a lightweight - * Container to be encapsulated by an HTML element to your specifications by using the - * {@link Ext.Component#autoEl autoEl} config option. This is a useful technique when creating - * embedded {@link Ext.layout.ColumnLayout column} layouts inside {@link Ext.form.FormPanel FormPanels} - * for example.

    - * - *

    The code below illustrates both how to explicitly create a Container, and how to implicitly - * create one using the 'container' xtype:

    
    -// explicitly create a Container
    -var embeddedColumns = new Ext.Container({
    -    autoEl: 'div',  // This is the default
    -    layout: 'column',
    -    defaults: {
    -        // implicitly create Container by specifying xtype
    -        xtype: 'container',
    -        autoEl: 'div', // This is the default.
    -        layout: 'form',
    -        columnWidth: 0.5,
    -        style: {
    -            padding: '10px'
    -        }
    -    },
    -//  The two items below will be Ext.Containers, each encapsulated by a <DIV> element.
    -    items: [{
    -        items: {
    -            xtype: 'datefield',
    -            name: 'startDate',
    -            fieldLabel: 'Start date'
    -        }
    -    }, {
    -        items: {
    -            xtype: 'datefield',
    -            name: 'endDate',
    -            fieldLabel: 'End date'
    -        }
    -    }]
    -});

    - * - *

    Layout

    - *

    Container classes delegate the rendering of child Components to a layout - * manager class which must be configured into the Container using the - * {@link #layout} configuration property.

    - *

    When either specifying child {@link #items} of a Container, - * or dynamically {@link #add adding} Components to a Container, remember to - * consider how you wish the Container to arrange those child elements, and - * whether those child elements need to be sized using one of Ext's built-in - * {@link #layout} schemes. By default, Containers use the - * {@link Ext.layout.ContainerLayout ContainerLayout} scheme which only - * renders child components, appending them one after the other inside the - * Container, and does not apply any sizing at all.

    - *

    A common mistake is when a developer neglects to specify a - * {@link #layout} (e.g. widgets like GridPanels or - * TreePanels are added to Containers for which no {@link #layout} - * has been specified). If a Container is left to use the default - * {@link Ext.layout.ContainerLayout ContainerLayout} scheme, none of its - * child components will be resized, or changed in any way when the Container - * is resized.

    - *

    Certain layout managers allow dynamic addition of child components. - * Those that do include {@link Ext.layout.CardLayout}, - * {@link Ext.layout.AnchorLayout}, {@link Ext.layout.FormLayout}, and - * {@link Ext.layout.TableLayout}. For example:

    
    -//  Create the GridPanel.
    -var myNewGrid = new Ext.grid.GridPanel({
    -    store: myStore,
    -    columns: myColumnModel,
    -    title: 'Results', // the title becomes the title of the tab
    -});
    +Ext.SplitBar.TOP = 3;
     
    -myTabPanel.add(myNewGrid); // {@link Ext.TabPanel} implicitly uses {@link Ext.layout.CardLayout CardLayout}
    -myTabPanel.{@link Ext.TabPanel#setActiveTab setActiveTab}(myNewGrid);
    - * 

    - *

    The example above adds a newly created GridPanel to a TabPanel. Note that - * a TabPanel uses {@link Ext.layout.CardLayout} as its layout manager which - * means all its child items are sized to {@link Ext.layout.FitLayout fit} - * exactly into its client area. - *

    Overnesting is a common problem. - * An example of overnesting occurs when a GridPanel is added to a TabPanel - * by wrapping the GridPanel inside a wrapping Panel (that has no - * {@link #layout} specified) and then add that wrapping Panel - * to the TabPanel. The point to realize is that a GridPanel is a - * Component which can be added directly to a Container. If the wrapping Panel - * has no {@link #layout} configuration, then the overnested - * GridPanel will not be sized as expected.

    - * - *

    Adding via remote configuration

    - * - *

    A server side script can be used to add Components which are generated dynamically on the server. - * An example of adding a GridPanel to a TabPanel where the GridPanel is generated by the server - * based on certain parameters: - *

    
    -// execute an Ajax request to invoke server side script:
    -Ext.Ajax.request({
    -    url: 'gen-invoice-grid.php',
    -    // send additional parameters to instruct server script
    -    params: {
    -        startDate: Ext.getCmp('start-date').getValue(),
    -        endDate: Ext.getCmp('end-date').getValue()
    -    },
    -    // process the response object to add it to the TabPanel:
    -    success: function(xhr) {
    -        var newComponent = eval(xhr.responseText); // see discussion below
    -        myTabPanel.add(newComponent); // add the component to the TabPanel
    -        myTabPanel.setActiveTab(newComponent);
    -    },
    -    failure: function() {
    -        Ext.Msg.alert("Grid create failed", "Server communication failure");
    -    }
    -});
    -
    - *

    The server script needs to return an executable Javascript statement which, when processed - * using eval(), will return either a config object with an {@link Ext.Component#xtype xtype}, - * or an instantiated Component. The server might return this for example:

    
    -(function() {
    -    function formatDate(value){
    -        return value ? value.dateFormat('M d, Y') : '';
    -    };
     
    -    var store = new Ext.data.Store({
    -        url: 'get-invoice-data.php',
    -        baseParams: {
    -            startDate: '01/01/2008',
    -            endDate: '01/31/2008'
    -        },
    -        reader: new Ext.data.JsonReader({
    -            record: 'transaction',
    -            idProperty: 'id',
    -            totalRecords: 'total'
    -        }, [
    -           'customer',
    -           'invNo',
    -           {name: 'date', type: 'date', dateFormat: 'm/d/Y'},
    -           {name: 'value', type: 'float'}
    -        ])
    -    });
    +Ext.SplitBar.BOTTOM = 4;
     
    -    var grid = new Ext.grid.GridPanel({
    -        title: 'Invoice Report',
    -        bbar: new Ext.PagingToolbar(store),
    -        store: store,
    -        columns: [
    -            {header: "Customer", width: 250, dataIndex: 'customer', sortable: true},
    -            {header: "Invoice Number", width: 120, dataIndex: 'invNo', sortable: true},
    -            {header: "Invoice Date", width: 100, dataIndex: 'date', renderer: formatDate, sortable: true},
    -            {header: "Value", width: 120, dataIndex: 'value', renderer: 'usMoney', sortable: true}
    -        ],
    -    });
    -    store.load();
    -    return grid;  // return instantiated component
    -})();
    -
    - *

    When the above code fragment is passed through the eval function in the success handler - * of the Ajax request, the code is executed by the Javascript processor, and the anonymous function - * runs, and returns the instantiated grid component.

    - *

    Note: since the code above is generated by a server script, the baseParams for - * the Store, the metadata to allow generation of the Record layout, and the ColumnModel - * can all be generated into the code since these are all known on the server.

    - * - * @xtype container - */ Ext.Container = Ext.extend(Ext.BoxComponent, { - /** - * @cfg {Boolean} monitorResize - * True to automatically monitor window resize events to handle anything that is sensitive to the current size - * of the viewport. This value is typically managed by the chosen {@link #layout} and should not need - * to be set manually. - */ - /** - * @cfg {String/Object} layout - *

    *Important: In order for child items to be correctly sized and - * positioned, typically a layout manager must be specified through - * the layout configuration option.

    - *

    The sizing and positioning of child {@link items} is the responsibility of - * the Container's layout manager which creates and manages the type of layout - * you have in mind. For example:

    
    -new Ext.Window({
    -    width:300, height: 300,
    -    layout: 'fit', // explicitly set layout manager: override the default (layout:'auto')
    -    items: [{
    -        title: 'Panel inside a Window'
    -    }]
    -}).show();
    -     * 
    - *

    If the {@link #layout} configuration is not explicitly specified for - * a general purpose container (e.g. Container or Panel) the - * {@link Ext.layout.ContainerLayout default layout manager} will be used - * which does nothing but render child components sequentially into the - * Container (no sizing or positioning will be performed in this situation). - * Some container classes implicitly specify a default layout - * (e.g. FormPanel specifies layout:'form'). Other specific - * purpose classes internally specify/manage their internal layout (e.g. - * GridPanel, TabPanel, TreePanel, Toolbar, Menu, etc.).

    - *

    layout may be specified as either as an Object or - * as a String:

      - * - *
    • Specify as an Object
    • - *
        - *
      • Example usage:
      • -
        
        -layout: {
        -    type: 'vbox',
        -    padding: '5',
        -    align: 'left'
        -}
        -
        - * - *
      • type
      • - *

        The layout type to be used for this container. If not specified, - * a default {@link Ext.layout.ContainerLayout} will be created and used.

        - *

        Valid layout type values are:

        - *
          - *
        • {@link Ext.layout.AbsoluteLayout absolute}
        • - *
        • {@link Ext.layout.AccordionLayout accordion}
        • - *
        • {@link Ext.layout.AnchorLayout anchor}
        • - *
        • {@link Ext.layout.ContainerLayout auto}     Default
        • - *
        • {@link Ext.layout.BorderLayout border}
        • - *
        • {@link Ext.layout.CardLayout card}
        • - *
        • {@link Ext.layout.ColumnLayout column}
        • - *
        • {@link Ext.layout.FitLayout fit}
        • - *
        • {@link Ext.layout.FormLayout form}
        • - *
        • {@link Ext.layout.HBoxLayout hbox}
        • - *
        • {@link Ext.layout.MenuLayout menu}
        • - *
        • {@link Ext.layout.TableLayout table}
        • - *
        • {@link Ext.layout.ToolbarLayout toolbar}
        • - *
        • {@link Ext.layout.VBoxLayout vbox}
        • - *
        - * - *
      • Layout specific configuration properties
      • - *

        Additional layout specific configuration properties may also be - * specified. For complete details regarding the valid config options for - * each layout type, see the layout class corresponding to the type - * specified.

        - * - *
      - * - *
    • Specify as a String
    • - *
        - *
      • Example usage:
      • -
        
        -layout: 'vbox',
        -layoutConfig: {
        -    padding: '5',
        -    align: 'left'
        -}
        -
        - *
      • layout
      • - *

        The layout type to be used for this container (see list - * of valid layout type values above).


        - *
      • {@link #layoutConfig}
      • - *

        Additional layout specific configuration properties. For complete - * details regarding the valid config options for each layout type, see the - * layout class corresponding to the layout specified.

        - *
    - */ - /** - * @cfg {Object} layoutConfig - * This is a config object containing properties specific to the chosen - * {@link #layout} if {@link #layout} - * has been specified as a string.

    - */ - /** - * @cfg {Boolean/Number} bufferResize - * When set to true (50 milliseconds) or a number of milliseconds, the layout assigned for this container will buffer - * the frequency it calculates and does a re-layout of components. This is useful for heavy containers or containers - * with a large quantity of sub-components for which frequent layout calls would be expensive. Defaults to 50. - */ + + + + bufferResize: 50, - /** - * @cfg {String/Number} activeItem - * A string component id or the numeric index of the component that should be initially activated within the - * container's layout on render. For example, activeItem: 'item-1' or activeItem: 0 (index 0 = the first - * item in the container's collection). activeItem only applies to layout styles that can display - * items one at a time (like {@link Ext.layout.AccordionLayout}, {@link Ext.layout.CardLayout} and - * {@link Ext.layout.FitLayout}). Related to {@link Ext.layout.ContainerLayout#activeItem}. - */ - /** - * @cfg {Object/Array} items - *
    ** IMPORTANT: be sure to {@link #layout specify a layout} if needed ! **
    - *

    A single item, or an array of child Components to be added to this container, - * for example:

    - *
    
    -// specifying a single item
    -items: {...},
    -layout: 'fit',    // specify a layout!
    -
    -// specifying multiple items
    -items: [{...}, {...}],
    -layout: 'anchor', // specify a layout!
    -     * 
    - *

    Each item may be:

    - *
      - *
    • any type of object based on {@link Ext.Component}
    • - *
    • a fully instanciated object or
    • - *
    • an object literal that:
    • - *
        - *
      • has a specified {@link Ext.Component#xtype xtype}
      • - *
      • the {@link Ext.Component#xtype} specified is associated with the Component - * desired and should be chosen from one of the available xtypes as listed - * in {@link Ext.Component}.
      • - *
      • If an {@link Ext.Component#xtype xtype} is not explicitly - * specified, the {@link #defaultType} for that Container is used.
      • - *
      • will be "lazily instanciated", avoiding the overhead of constructing a fully - * instanciated Component object
      • - *
    - *

    Notes:

    - *
      - *
    • Ext uses lazy rendering. Child Components will only be rendered - * should it become necessary. Items are automatically laid out when they are first - * shown (no sizing is done while hidden), or in response to a {@link #doLayout} call.
    • - *
    • Do not specify {@link Ext.Panel#contentEl contentEl}/ - * {@link Ext.Panel#html html} with items.
    • - *
    - */ - /** - * @cfg {Object|Function} defaults - *

    This option is a means of applying default settings to all added items whether added through the {@link #items} - * config or via the {@link #add} or {@link #insert} methods.

    - *

    If an added item is a config object, and not an instantiated Component, then the default properties are - * unconditionally applied. If the added item is an instantiated Component, then the default properties are - * applied conditionally so as not to override existing properties in the item.

    - *

    If the defaults option is specified as a function, then the function will be called using this Container as the - * scope (this reference) and passing the added item as the first parameter. Any resulting object - * from that call is then applied to the item as default properties.

    - *

    For example, to automatically apply padding to the body of each of a set of - * contained {@link Ext.Panel} items, you could pass: defaults: {bodyStyle:'padding:15px'}.

    - *

    Usage:

    
    -defaults: {               // defaults are applied to items, not the container
    -    autoScroll:true
    -},
    -items: [
    -    {
    -        xtype: 'panel',   // defaults do not have precedence over
    -        id: 'panel1',     // options in config objects, so the defaults
    -        autoScroll: false // will not be applied here, panel1 will be autoScroll:false
    -    },
    -    new Ext.Panel({       // defaults do have precedence over options
    -        id: 'panel2',     // options in components, so the defaults
    -        autoScroll: false // will be applied here, panel2 will be autoScroll:true.
    -    })
    -]
    -     * 
    - */ + + + - /** @cfg {Boolean} autoDestroy - * If true the container will automatically destroy any contained component that is removed from it, else - * destruction must be handled manually (defaults to true). - */ + autoDestroy : true, - /** @cfg {Boolean} forceLayout - * If true the container will force a layout initially even if hidden or collapsed. This option - * is useful for forcing forms to render in collapsed or hidden containers. (defaults to false). - */ + forceLayout: false, - /** @cfg {Boolean} hideBorders - * True to hide the borders of each contained component, false to defer to the component's existing - * border settings (defaults to false). - */ - /** @cfg {String} defaultType - *

    The default {@link Ext.Component xtype} of child Components to create in this Container when - * a child item is specified as a raw configuration object, rather than as an instantiated Component.

    - *

    Defaults to 'panel', except {@link Ext.menu.Menu} which defaults to 'menuitem', - * and {@link Ext.Toolbar} and {@link Ext.ButtonGroup} which default to 'button'.

    - */ + + defaultType : 'panel', - /** @cfg {String} resizeEvent - * The event to listen to for resizing in layouts. Defaults to 'resize'. - */ + resizeEvent: 'resize', - /** - * @cfg {Array} bubbleEvents - *

    An array of events that, when fired, should be bubbled to any parent container. - * See {@link Ext.util.Observable#enableBubble}. - * Defaults to ['add', 'remove']. - */ + bubbleEvents: ['add', 'remove'], - // private + initComponent : function(){ Ext.Container.superclass.initComponent.call(this); this.addEvents( - /** - * @event afterlayout - * Fires when the components in this container are arranged by the associated layout manager. - * @param {Ext.Container} this - * @param {ContainerLayout} layout The ContainerLayout implementation for this container - */ + 'afterlayout', - /** - * @event beforeadd - * Fires before any {@link Ext.Component} is added or inserted into the container. - * A handler can return false to cancel the add. - * @param {Ext.Container} this - * @param {Ext.Component} component The component being added - * @param {Number} index The index at which the component will be added to the container's items collection - */ + 'beforeadd', - /** - * @event beforeremove - * Fires before any {@link Ext.Component} is removed from the container. A handler can return - * false to cancel the remove. - * @param {Ext.Container} this - * @param {Ext.Component} component The component being removed - */ + 'beforeremove', - /** - * @event add - * @bubbles - * Fires after any {@link Ext.Component} is added or inserted into the container. - * @param {Ext.Container} this - * @param {Ext.Component} component The component that was added - * @param {Number} index The index at which the component was added to the container's items collection - */ + 'add', - /** - * @event remove - * @bubbles - * Fires after any {@link Ext.Component} is removed from the container. - * @param {Ext.Container} this - * @param {Ext.Component} component The component that was removed - */ + 'remove' ); - /** - * The collection of components in this container as a {@link Ext.util.MixedCollection} - * @type MixedCollection - * @property items - */ + var items = this.items; if(items){ delete this.items; @@ -18771,27 +11690,27 @@ items: [ } }, - // private + initItems : function(){ if(!this.items){ this.items = new Ext.util.MixedCollection(false, this.getComponentId); - this.getLayout(); // initialize the layout + this.getLayout(); } }, - // private + setLayout : function(layout){ if(this.layout && this.layout != layout){ this.layout.setContainer(null); } - this.initItems(); this.layout = layout; + this.initItems(); layout.setContainer(this); }, afterRender: function(){ - // Render this Container, this should be done before setLayout is called which - // will hook onResize + + Ext.Container.superclass.afterRender.call(this); if(!this.layout){ this.layout = 'auto'; @@ -18805,72 +11724,36 @@ items: [ } this.setLayout(this.layout); - // If a CardLayout, the active item set + if(this.activeItem !== undefined){ var item = this.activeItem; delete this.activeItem; this.layout.setActiveItem(item); } - // If we have no ownerCt, render and size all children + if(!this.ownerCt){ this.doLayout(false, true); } - // This is a manually configured flag set by users in conjunction with renderTo. - // Not to be confused with the flag by the same name used in Layouts. + + if(this.monitorResize === true){ Ext.EventManager.onWindowResize(this.doLayout, this, [false]); } }, - /** - *

    Returns the Element to be used to contain the child Components of this Container.

    - *

    An implementation is provided which returns the Container's {@link #getEl Element}, but - * if there is a more complex structure to a Container, this may be overridden to return - * the element into which the {@link #layout layout} renders child Components.

    - * @return {Ext.Element} The Element to render child Components into. - */ + getLayoutTarget : function(){ return this.el; }, - // private - used as the key lookup function for the items collection + getComponentId : function(comp){ return comp.getItemId(); }, - /** - *

    Adds {@link Ext.Component Component}(s) to this Container.

    - *

    Description : - *

      - *
    • Fires the {@link #beforeadd} event before adding
    • - *
    • The Container's {@link #defaults default config values} will be applied - * accordingly (see {@link #defaults} for details).
    • - *
    • Fires the {@link #add} event after the component has been added.
    • - *
    - *

    Notes : - *

      - *
    • If the Container is already rendered when add - * is called, you may need to call {@link #doLayout} to refresh the view which causes - * any unrendered child Components to be rendered. This is required so that you can - * add multiple child components if needed while only refreshing the layout - * once. For example:
      
      -var tb = new {@link Ext.Toolbar}();
      -tb.render(document.body);  // toolbar is rendered
      -tb.add({text:'Button 1'}); // add multiple items ({@link #defaultType} for {@link Ext.Toolbar Toolbar} is 'button')
      -tb.add({text:'Button 2'});
      -tb.{@link #doLayout}();             // refresh the layout
      -     * 
    • - *
    • Warning: Containers directly managed by the BorderLayout layout manager - * may not be removed or added. See the Notes for {@link Ext.layout.BorderLayout BorderLayout} - * for more details.
    • - *
    - * @param {...Object/Array} component - *

    Either one or more Components to add or an Array of Components to add. See - * {@link #items} for additional information.

    - * @return {Ext.Component/Array} The Components that were added. - */ + add : function(comp){ this.initItems(); var args = arguments.length > 1; @@ -18885,7 +11768,7 @@ tb.{@link #doLayout}(); // refresh the layout var index = this.items.length; if(this.fireEvent('beforeadd', this, c, index) !== false && this.onBeforeAdd(c) !== false){ this.items.add(c); - // *onAdded + c.onAdded(this, index); this.onAdd(c); this.fireEvent('add', this, c, index); @@ -18894,39 +11777,22 @@ tb.{@link #doLayout}(); // refresh the layout }, onAdd : function(c){ - // Empty template method + }, - // private + onAdded : function(container, pos) { - //overridden here so we can cascade down, not worth creating a template method. + this.ownerCt = container; this.initRef(); - //initialize references for child items + this.cascade(function(c){ c.initRef(); }); this.fireEvent('added', this, container, pos); }, - /** - * Inserts a Component into this Container at a specified index. Fires the - * {@link #beforeadd} event before inserting, then fires the {@link #add} event after the - * Component has been inserted. - * @param {Number} index The index at which the Component will be inserted - * into the Container's items collection - * @param {Ext.Component} component The child Component to insert.

    - * Ext uses lazy rendering, and will only render the inserted Component should - * it become necessary.

    - * A Component config object may be passed in order to avoid the overhead of - * constructing a real Component object if lazy rendering might mean that the - * inserted Component will not be rendered immediately. To take advantage of - * this 'lazy instantiation', set the {@link Ext.Component#xtype} config - * property to the registered type of the Component wanted.

    - * For a list of all available xtypes, see {@link Ext.Component}. - * @return {Ext.Component} component The Component (or config object) that was - * inserted with the Container's default config values applied. - */ + insert : function(index, comp){ this.initItems(); var a = arguments, len = a.length; @@ -18951,7 +11817,7 @@ tb.{@link #doLayout}(); // refresh the layout return c; }, - // private + applyDefaults : function(c){ var d = this.defaults; if(d){ @@ -18970,7 +11836,7 @@ tb.{@link #doLayout}(); // refresh the layout return c; }, - // private + onBeforeAdd : function(item){ if(item.ownerCt){ item.ownerCt.remove(item, false); @@ -18980,14 +11846,7 @@ tb.{@link #doLayout}(); // refresh the layout } }, - /** - * Removes a component from this container. Fires the {@link #beforeremove} event before removing, then fires - * the {@link #remove} event after the component has been removed. - * @param {Component/String} component The component reference or id to remove. - * @param {Boolean} autoDestroy (optional) True to automatically invoke the removed Component's {@link Ext.Component#destroy} function. - * Defaults to the value of this Container's {@link #autoDestroy} config. - * @return {Ext.Component} component The Component that was removed. - */ + remove : function(comp, autoDestroy){ this.initItems(); var c = this.getComponent(comp); @@ -18999,10 +11858,10 @@ tb.{@link #doLayout}(); // refresh the layout }, onRemove: function(c){ - // Empty template method + }, - // private + doRemove: function(c, autoDestroy){ var l = this.layout, hasLayout = l && this.rendered; @@ -19021,12 +11880,7 @@ tb.{@link #doLayout}(); // refresh the layout } }, - /** - * Removes all components from this container. - * @param {Boolean} autoDestroy (optional) True to automatically invoke the removed Component's {@link Ext.Component#destroy} function. - * Defaults to the value of this Container's {@link #autoDestroy} config. - * @return {Array} Array of the destroyed components - */ + removeAll: function(autoDestroy){ this.initItems(); var item, rem = [], items = []; @@ -19043,19 +11897,7 @@ tb.{@link #doLayout}(); // refresh the layout return items; }, - /** - * Examines this container's {@link #items} property - * and gets a direct child component of this container. - * @param {String/Number} comp This parameter may be any of the following: - *
      - *
    • a String : representing the {@link Ext.Component#itemId itemId} - * or {@link Ext.Component#id id} of the child component
    • - *
    • a Number : representing the position of the child component - * within the {@link #items} property
    • - *
    - *

    For additional information see {@link Ext.util.MixedCollection#get}. - * @return Ext.Component The component (if found). - */ + getComponent : function(comp){ if(Ext.isObject(comp)){ comp = comp.getItemId(); @@ -19063,7 +11905,7 @@ tb.{@link #doLayout}(); // refresh the layout return this.items.get(comp); }, - // private + lookupComponent : function(comp){ if(Ext.isString(comp)){ return Ext.ComponentMgr.get(comp); @@ -19073,13 +11915,13 @@ tb.{@link #doLayout}(); // refresh the layout return comp; }, - // private + createComponent : function(config, defaultType){ if (config.render) { return config; } - // add in ownerCt at creation time but then immediately - // remove so that onBeforeAdd can handle it + + var c = Ext.create(Ext.apply({ ownerCt: this }, config), defaultType || this.defaultType); @@ -19088,25 +11930,13 @@ tb.{@link #doLayout}(); // refresh the layout return c; }, - /** - * We can only lay out if there is a view area in which to layout. - * display:none on the layout target, *or any of its parent elements* will mean it has no view area. - */ - - // private + canLayout : function() { var el = this.getVisibilityEl(); return el && el.dom && !el.isStyle("display", "none"); }, - /** - * Force this container's layout to be recalculated. A call to this function is required after adding a new component - * to an already rendered container, or possibly after changing sizing/position properties of child components. - * @param {Boolean} shallow (optional) True to only calc the layout of this component, and let child components auto - * calc layouts as required (defaults to false, which calls doLayout recursively for each subcontainer) - * @param {Boolean} force (optional) True to force a layout to occur, even if the item is hidden. - * @return {Ext.Container} this - */ + doLayout : function(shallow, force){ var rendered = this.rendered, @@ -19136,32 +11966,28 @@ tb.{@link #doLayout}(); // refresh the layout if(rendered){ this.onLayout(shallow, forceLayout); } - // Initial layout completed + this.hasLayout = true; delete this.forceLayout; }, onLayout : Ext.emptyFn, - // private + shouldBufferLayout: function(){ - /* - * Returns true if the container should buffer a layout. - * This is true only if the container has previously been laid out - * and has a parent container that is pending a layout. - */ + var hl = this.hasLayout; if(this.ownerCt){ - // Only ever buffer if we've laid out the first time and we have one pending. + return hl ? !this.hasLayoutPending() : false; } - // Never buffer initial layout + return hl; }, - // private + hasLayoutPending: function(){ - // Traverse hierarchy to see if any parent container has a pending layout. + var pending = false; this.ownerCt.bubble(function(c){ if(c.layoutPending){ @@ -19173,20 +11999,16 @@ tb.{@link #doLayout}(); // refresh the layout }, onShow : function(){ - // removes css classes that were added to hide + Ext.Container.superclass.onShow.call(this); - // If we were sized during the time we were hidden, layout. + if(Ext.isDefined(this.deferLayout)){ delete this.deferLayout; this.doLayout(true); } }, - /** - * Returns the layout currently in use by the container. If the container does not currently have a layout - * set, a default {@link Ext.layout.ContainerLayout} will be created and set as the container's layout. - * @return {ContainerLayout} layout The container's layout - */ + getLayout : function(){ if(!this.layout){ var layout = new Ext.layout.AutoLayout(this.layoutConfig); @@ -19195,7 +12017,7 @@ tb.{@link #doLayout}(); // refresh the layout return this.layout; }, - // private + beforeDestroy : function(){ var c; if(this.items){ @@ -19210,16 +12032,7 @@ tb.{@link #doLayout}(); // refresh the layout Ext.Container.superclass.beforeDestroy.call(this); }, - /** - * Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (this) of - * function call will be the scope provided or the current component. The arguments to the function - * will be the args provided or the current component. If the function returns false at any point, - * the bubble is stopped. - * @param {Function} fn The function to call - * @param {Object} scope (optional) The scope of the function (defaults to current node) - * @param {Array} args (optional) The args to call the function with (default to passing the current component) - * @return {Ext.Container} this - */ + bubble : function(fn, scope, args){ var p = this; while(p){ @@ -19231,17 +12044,7 @@ tb.{@link #doLayout}(); // refresh the layout return this; }, - /** - * Cascades down the component/container heirarchy from this component (called first), calling the specified function with - * each component. The scope (this) of - * function call will be the scope provided or the current component. The arguments to the function - * will be the args provided or the current component. If the function returns false at any point, - * the cascade is stopped on that branch. - * @param {Function} fn The function to call - * @param {Object} scope (optional) The scope of the function (defaults to current component) - * @param {Array} args (optional) The args to call the function with (defaults to passing the current component) - * @return {Ext.Container} this - */ + cascade : function(fn, scope, args){ if(fn.apply(scope || this, args || [this]) !== false){ if(this.items){ @@ -19258,11 +12061,7 @@ tb.{@link #doLayout}(); // refresh the layout return this; }, - /** - * Find a component under this container at any level by id - * @param {String} id - * @return Ext.Component - */ + findById : function(id){ var m, ct = this; this.cascade(function(c){ @@ -19274,38 +12073,21 @@ tb.{@link #doLayout}(); // refresh the layout return m || null; }, - /** - * Find a component under this container at any level by xtype or class - * @param {String/Class} xtype The xtype string for a component, or the class of the component directly - * @param {Boolean} shallow (optional) False to check whether this Component is descended from the xtype (this is - * the default), or true to check whether this Component is directly of the specified xtype. - * @return {Array} Array of Ext.Components - */ + findByType : function(xtype, shallow){ return this.findBy(function(c){ return c.isXType(xtype, shallow); }); }, - /** - * Find a component under this container at any level by property - * @param {String} prop - * @param {String} value - * @return {Array} Array of Ext.Components - */ + find : function(prop, value){ return this.findBy(function(c){ return c[prop] === value; }); }, - /** - * Find a component under this container at any level by a custom function. If the passed function returns - * true, the component will be included in the results. The passed function is called with the arguments (component, this container). - * @param {Function} fn The function to call - * @param {Object} scope (optional) - * @return {Array} Array of Ext.Components - */ + findBy : function(fn, scope){ var m = [], ct = this; this.cascade(function(c){ @@ -19316,11 +12098,7 @@ tb.{@link #doLayout}(); // refresh the layout return m; }, - /** - * Get a component contained by this container (alias for items.get(key)) - * @param {String/Number} key The index or id of the component - * @return {Ext.Component} Ext.Component - */ + get : function(key){ return this.items.get(key); } @@ -19328,49 +12106,16 @@ tb.{@link #doLayout}(); // refresh the layout Ext.Container.LAYOUTS = {}; Ext.reg('container', Ext.Container); -/** - * @class Ext.layout.ContainerLayout - *

    This class is intended to be extended or created via the {@link Ext.Container#layout layout} - * configuration property. See {@link Ext.Container#layout} for additional details.

    - */ + Ext.layout.ContainerLayout = Ext.extend(Object, { - /** - * @cfg {String} extraCls - *

    An optional extra CSS class that will be added to the container. This can be useful for adding - * customized styles to the container or any of its children using standard CSS rules. See - * {@link Ext.Component}.{@link Ext.Component#ctCls ctCls} also.

    - *

    Note: extraCls defaults to '' except for the following classes - * which assign a value by default: - *

      - *
    • {@link Ext.layout.AbsoluteLayout Absolute Layout} : 'x-abs-layout-item'
    • - *
    • {@link Ext.layout.Box Box Layout} : 'x-box-item'
    • - *
    • {@link Ext.layout.ColumnLayout Column Layout} : 'x-column'
    • - *
    - * To configure the above Classes with an extra CSS class append to the default. For example, - * for ColumnLayout:
    
    -     * extraCls: 'x-column custom-class'
    -     * 
    - *

    - */ - /** - * @cfg {Boolean} renderHidden - * True to hide each contained item on render (defaults to false). - */ + + - /** - * A reference to the {@link Ext.Component} that is active. For example,
    
    -     * if(myPanel.layout.activeItem.id == 'item-1') { ... }
    -     * 
    - * activeItem only applies to layout styles that can display items one at a time - * (like {@link Ext.layout.AccordionLayout}, {@link Ext.layout.CardLayout} - * and {@link Ext.layout.FitLayout}). Read-only. Related to {@link Ext.Container#activeItem}. - * @type {Ext.Component} - * @property activeItem - */ + - // private + monitorResize:false, - // private + activeItem : null, constructor : function(config){ @@ -19380,10 +12125,7 @@ Ext.layout.ContainerLayout = Ext.extend(Object, { type: 'container', - /* Workaround for how IE measures autoWidth elements. It prefers bottom-up measurements - whereas other browser prefer top-down. We will hide all target child elements before we measure and - put them back to get an accurate measurement. - */ + IEMeasureHack : function(target, viewFlag) { var tChildren = target.dom.childNodes, tLen = tChildren.length, c, d = [], e, i, ret; for (i = 0 ; i < tLen ; i++) { @@ -19405,10 +12147,10 @@ Ext.layout.ContainerLayout = Ext.extend(Object, { return ret; }, - // Placeholder for the derived layouts + getLayoutTargetSize : Ext.EmptyFn, - // private + layout : function(){ var ct = this.container, target = ct.getLayoutTarget(); if(!(this.hasLayout || Ext.isEmpty(this.targetCls))){ @@ -19418,17 +12160,17 @@ Ext.layout.ContainerLayout = Ext.extend(Object, { ct.fireEvent('afterlayout', ct, this); }, - // private + onLayout : function(ct, target){ this.renderAll(ct, target); }, - // private + isValidParent : function(c, target){ return target && c.getPositionEl().dom.parentNode == (target.dom || target); }, - // private + renderAll : function(ct, target){ var items = ct.items.items, i, c, len = items.length; for(i = 0; i < len; i++) { @@ -19439,14 +12181,7 @@ Ext.layout.ContainerLayout = Ext.extend(Object, { } }, - /** - * @private - * Renders the given Component into the target Element. If the Component is already rendered, - * it is moved to the provided target instead. - * @param {Ext.Component} c The Component to render - * @param {Number} position The position within the target to render the item to - * @param {Ext.Element} target The target Element - */ + renderItem : function(c, position, target){ if (c) { if (!c.rendered) { @@ -19464,8 +12199,8 @@ Ext.layout.ContainerLayout = Ext.extend(Object, { } }, - // private. - // Get all rendered items to lay out. + + getRenderedItems: function(ct){ var t = ct.getLayoutTarget(), cti = ct.items.items, len = cti.length, i, c, items = []; for (i = 0; i < len; i++) { @@ -19476,17 +12211,14 @@ Ext.layout.ContainerLayout = Ext.extend(Object, { return items; }, - /** - * @private - * Applies extraCls and hides the item if renderHidden is true - */ + configureItem: function(c, position){ if (this.extraCls) { var t = c.getPositionEl ? c.getPositionEl() : c; t.addClass(this.extraCls); } - // If we are forcing a layout, do so *before* we hide so elements have height/width + if (c.doLayout && this.forceLayout) { c.doLayout(); } @@ -19512,7 +12244,7 @@ Ext.layout.ContainerLayout = Ext.extend(Object, { } }, - // private + onResize: function(){ var ct = this.container, b; @@ -19538,15 +12270,9 @@ Ext.layout.ContainerLayout = Ext.extend(Object, { delete ct.layoutPending; }, - // private + setContainer : function(ct){ - /** - * This monitorResize flag will be renamed soon as to avoid confusion - * with the Container version which hooks onWindowResize to doLayout - * - * monitorResize flag in this context attaches the resize event between - * a container and it's layout - */ + if(this.monitorResize && ct != this.container){ var old = this.container; if(old){ @@ -19559,12 +12285,7 @@ Ext.layout.ContainerLayout = Ext.extend(Object, { this.container = ct; }, - /** - * Parses a number or string representing margin sizes into an object. Supports CSS-style margin declarations - * (e.g. 10, "10", "10 10", "10 10 10" and "10 10 10 10" are all valid options and would return the same result) - * @param {Number|String} v The encoded margins - * @return {Object} An object with margin sizes for top, right, bottom and left - */ + parseMargins : function(v){ if (Ext.isNumber(v)) { v = v.toString(); @@ -19589,15 +12310,7 @@ Ext.layout.ContainerLayout = Ext.extend(Object, { }; }, - /** - * The {@link Ext.Template Ext.Template} used by Field rendering layout classes (such as - * {@link Ext.layout.FormLayout}) to create the DOM structure of a fully wrapped, - * labeled and styled form Field. A default Template is supplied, but this may be - * overriden to create custom field structures. The template processes values returned from - * {@link Ext.layout.FormLayout#getTemplateArgs}. - * @property fieldTpl - * @type Ext.Template - */ + fieldTpl: (function() { var t = new Ext.Template( '
    ', @@ -19610,13 +12323,9 @@ Ext.layout.ContainerLayout = Ext.extend(Object, { return t.compile(); })(), - /* - * Destroys this layout. This is a template method that is empty by default, but should be implemented - * by subclasses that require explicit destruction to purge event handlers or remove DOM nodes. - * @protected - */ + destroy : function(){ - // Stop any buffered layout tasks + if(this.resizeTask && this.resizeTask.cancel){ this.resizeTask.cancel(); } @@ -19627,13 +12336,7 @@ Ext.layout.ContainerLayout = Ext.extend(Object, { } } } -});/** - * @class Ext.layout.AutoLayout - *

    The AutoLayout is the default layout manager delegated by {@link Ext.Container} to - * render any child Components when no {@link Ext.Container#layout layout} is configured into - * a {@link Ext.Container Container}.. AutoLayout provides only a passthrough of any layout calls - * to any child containers.

    - */ +}); Ext.layout.AutoLayout = Ext.extend(Ext.layout.ContainerLayout, { type: 'auto', @@ -19645,7 +12348,7 @@ Ext.layout.AutoLayout = Ext.extend(Ext.layout.ContainerLayout, { for(i = 0; i < len; i++){ c = cs[i]; if (c.doLayout){ - // Shallow layout children + c.doLayout(true); } } @@ -19653,29 +12356,9 @@ Ext.layout.AutoLayout = Ext.extend(Ext.layout.ContainerLayout, { }); Ext.Container.LAYOUTS['auto'] = Ext.layout.AutoLayout; -/** - * @class Ext.layout.FitLayout - * @extends Ext.layout.ContainerLayout - *

    This is a base class for layouts that contain a single item that automatically expands to fill the layout's - * container. This class is intended to be extended or created via the layout:'fit' {@link Ext.Container#layout} - * config, and should generally not need to be created directly via the new keyword.

    - *

    FitLayout does not have any direct config options (other than inherited ones). To fit a panel to a container - * using FitLayout, simply set layout:'fit' on the container and add a single panel to it. If the container has - * multiple panels, only the first one will be displayed. Example usage:

    - *
    
    -var p = new Ext.Panel({
    -    title: 'Fit Layout',
    -    layout:'fit',
    -    items: {
    -        title: 'Inner Panel',
    -        html: '<p>This is the inner panel content</p>',
    -        border: false
    -    }
    -});
    -
    - */ + Ext.layout.FitLayout = Ext.extend(Ext.layout.ContainerLayout, { - // private + monitorResize:true, type: 'fit', @@ -19685,11 +12368,11 @@ Ext.layout.FitLayout = Ext.extend(Ext.layout.ContainerLayout, { if (!target) { return {}; } - // Style Sized (scrollbars not included) + return target.getStyleSize(); }, - // private + onLayout : function(ct, target){ Ext.layout.FitLayout.superclass.onLayout.call(this, ct, target); if(!ct.collapsed){ @@ -19697,115 +12380,37 @@ Ext.layout.FitLayout = Ext.extend(Ext.layout.ContainerLayout, { } }, - // private + setItemSize : function(item, size){ - if(item && size.height > 0){ // display none? + if(item && size.height > 0){ item.setSize(size); } } }); -Ext.Container.LAYOUTS['fit'] = Ext.layout.FitLayout;/** - * @class Ext.layout.CardLayout - * @extends Ext.layout.FitLayout - *

    This layout manages multiple child Components, each fitted to the Container, where only a single child Component can be - * visible at any given time. This layout style is most commonly used for wizards, tab implementations, etc. - * This class is intended to be extended or created via the layout:'card' {@link Ext.Container#layout} config, - * and should generally not need to be created directly via the new keyword.

    - *

    The CardLayout's focal method is {@link #setActiveItem}. Since only one panel is displayed at a time, - * the only way to move from one Component to the next is by calling setActiveItem, passing the id or index of - * the next panel to display. The layout itself does not provide a user interface for handling this navigation, - * so that functionality must be provided by the developer.

    - *

    In the following example, a simplistic wizard setup is demonstrated. A button bar is added - * to the footer of the containing panel to provide navigation buttons. The buttons will be handled by a - * common navigation routine -- for this example, the implementation of that routine has been ommitted since - * it can be any type of custom logic. Note that other uses of a CardLayout (like a tab control) would require a - * completely different implementation. For serious implementations, a better approach would be to extend - * CardLayout to provide the custom functionality needed. Example usage:

    - *
    
    -var navHandler = function(direction){
    -    // This routine could contain business logic required to manage the navigation steps.
    -    // It would call setActiveItem as needed, manage navigation button state, handle any
    -    // branching logic that might be required, handle alternate actions like cancellation
    -    // or finalization, etc.  A complete wizard implementation could get pretty
    -    // sophisticated depending on the complexity required, and should probably be
    -    // done as a subclass of CardLayout in a real-world implementation.
    -};
    -
    -var card = new Ext.Panel({
    -    title: 'Example Wizard',
    -    layout:'card',
    -    activeItem: 0, // make sure the active item is set on the container config!
    -    bodyStyle: 'padding:15px',
    -    defaults: {
    -        // applied to each contained panel
    -        border:false
    -    },
    -    // just an example of one possible navigation scheme, using buttons
    -    bbar: [
    -        {
    -            id: 'move-prev',
    -            text: 'Back',
    -            handler: navHandler.createDelegate(this, [-1]),
    -            disabled: true
    -        },
    -        '->', // greedy spacer so that the buttons are aligned to each side
    -        {
    -            id: 'move-next',
    -            text: 'Next',
    -            handler: navHandler.createDelegate(this, [1])
    -        }
    -    ],
    -    // the panels (or "cards") within the layout
    -    items: [{
    -        id: 'card-0',
    -        html: '<h1>Welcome to the Wizard!</h1><p>Step 1 of 3</p>'
    -    },{
    -        id: 'card-1',
    -        html: '<p>Step 2 of 3</p>'
    -    },{
    -        id: 'card-2',
    -        html: '<h1>Congratulations!</h1><p>Step 3 of 3 - Complete</p>'
    -    }]
    -});
    -
    - */ +Ext.Container.LAYOUTS['fit'] = Ext.layout.FitLayout; Ext.layout.CardLayout = Ext.extend(Ext.layout.FitLayout, { - /** - * @cfg {Boolean} deferredRender - * True to render each contained item at the time it becomes active, false to render all contained items - * as soon as the layout is rendered (defaults to false). If there is a significant amount of content or - * a lot of heavy controls being rendered into panels that are not displayed by default, setting this to - * true might improve performance. - */ + deferredRender : false, - /** - * @cfg {Boolean} layoutOnCardChange - * True to force a layout of the active item when the active card is changed. Defaults to false. - */ + layoutOnCardChange : false, - /** - * @cfg {Boolean} renderHidden @hide - */ - // private + + renderHidden : true, type: 'card', - /** - * Sets the active (visible) item in the layout. - * @param {String/Number} item The string component id or numeric index of the item to activate - */ + setActiveItem : function(item){ var ai = this.activeItem, ct = this.container; item = ct.getComponent(item); - // Is this a valid, different card? + if(item && ai != item){ - // Changing cards, hide the current one + if(ai){ ai.hide(); if (ai.hidden !== true) { @@ -19816,14 +12421,14 @@ Ext.layout.CardLayout = Ext.extend(Ext.layout.FitLayout, { var layout = item.doLayout && (this.layoutOnCardChange || !item.rendered); - // Change activeItem reference + this.activeItem = item; - // The container is about to get a recursive layout, remove any deferLayout reference - // because it will trigger a redundant layout. + + delete item.deferLayout; - // Show the new component + item.show(); this.layout(); @@ -19835,7 +12440,7 @@ Ext.layout.CardLayout = Ext.extend(Ext.layout.FitLayout, { } }, - // private + renderAll : function(ct, target){ if(this.deferredRender){ this.renderItem(this.activeItem, undefined, target); @@ -19845,103 +12450,16 @@ Ext.layout.CardLayout = Ext.extend(Ext.layout.FitLayout, { } }); Ext.Container.LAYOUTS['card'] = Ext.layout.CardLayout; -/** - * @class Ext.layout.AnchorLayout - * @extends Ext.layout.ContainerLayout - *

    This is a layout that enables anchoring of contained elements relative to the container's dimensions. - * If the container is resized, all anchored items are automatically rerendered according to their - * {@link #anchor} rules.

    - *

    This class is intended to be extended or created via the layout:'anchor' {@link Ext.Container#layout} - * config, and should generally not need to be created directly via the new keyword.

    - *

    AnchorLayout does not have any direct config options (other than inherited ones). By default, - * AnchorLayout will calculate anchor measurements based on the size of the container itself. However, the - * container using the AnchorLayout can supply an anchoring-specific config property of anchorSize. - * If anchorSize is specifed, the layout will use it as a virtual container for the purposes of calculating - * anchor measurements based on it instead, allowing the container to be sized independently of the anchoring - * logic if necessary. For example:

    - *
    
    -var viewport = new Ext.Viewport({
    -    layout:'anchor',
    -    anchorSize: {width:800, height:600},
    -    items:[{
    -        title:'Item 1',
    -        html:'Content 1',
    -        width:800,
    -        anchor:'right 20%'
    -    },{
    -        title:'Item 2',
    -        html:'Content 2',
    -        width:300,
    -        anchor:'50% 30%'
    -    },{
    -        title:'Item 3',
    -        html:'Content 3',
    -        width:600,
    -        anchor:'-100 50%'
    -    }]
    -});
    - * 
    - */ + Ext.layout.AnchorLayout = Ext.extend(Ext.layout.ContainerLayout, { - /** - * @cfg {String} anchor - *

    This configuation option is to be applied to child items of a container managed by - * this layout (ie. configured with layout:'anchor').


    - * - *

    This value is what tells the layout how an item should be anchored to the container. items - * added to an AnchorLayout accept an anchoring-specific config property of anchor which is a string - * containing two values: the horizontal anchor value and the vertical anchor value (for example, '100% 50%'). - * The following types of anchor values are supported:

      - * - *
    • Percentage : Any value between 1 and 100, expressed as a percentage.
      - * The first anchor is the percentage width that the item should take up within the container, and the - * second is the percentage height. For example:
      
      -// two values specified
      -anchor: '100% 50%' // render item complete width of the container and
      -                   // 1/2 height of the container
      -// one value specified
      -anchor: '100%'     // the width value; the height will default to auto
      -     * 
    • - * - *
    • Offsets : Any positive or negative integer value.
      - * This is a raw adjustment where the first anchor is the offset from the right edge of the container, - * and the second is the offset from the bottom edge. For example:
      
      -// two values specified
      -anchor: '-50 -100' // render item the complete width of the container
      -                   // minus 50 pixels and
      -                   // the complete height minus 100 pixels.
      -// one value specified
      -anchor: '-50'      // anchor value is assumed to be the right offset value
      -                   // bottom offset will default to 0
      -     * 
    • - * - *
    • Sides : Valid values are 'right' (or 'r') and 'bottom' - * (or 'b').
      - * Either the container must have a fixed size or an anchorSize config value defined at render time in - * order for these to have any effect.
    • - * - *
    • Mixed :
      - * Anchor values can also be mixed as needed. For example, to render the width offset from the container - * right edge by 50 pixels and 75% of the container's height use: - *
      
      -anchor: '-50 75%'
      -     * 
    • - * - * - *
    - */ + - // private + monitorResize : true, type : 'anchor', - /** - * @cfg {String} defaultAnchor - * - * default anchor for all child container items applied if no anchor or specific width is set on the child item. Defaults to '100%'. - * - */ + defaultAnchor : '100%', parseAnchorRE : /^(r|right|b|bottom)$/i, @@ -19951,11 +12469,11 @@ anchor: '-50 75%' if (!target) { return {}; } - // Style Sized (scrollbars not included) + return target.getStyleSize(); }, - // private + onLayout : function(ct, target){ Ext.layout.AnchorLayout.superclass.onLayout.call(this, ct, target); var size = this.getLayoutTargetSize(); @@ -19966,7 +12484,7 @@ anchor: '-50 75%' return; } - // find the container anchoring size + var aw, ah; if(ct.anchorSize){ if(typeof ct.anchorSize == 'number'){ @@ -19985,14 +12503,14 @@ anchor: '-50 75%' c = cs[i]; el = c.getPositionEl(); - // If a child container item has no anchor and no specific width, set the child to the default anchor size + if (!c.anchor && c.items && !Ext.isNumber(c.width) && !(Ext.isIE6 && Ext.isStrict)){ c.anchor = this.defaultAnchor; } if(c.anchor){ a = c.anchorSpec; - if(!a){ // cache all anchor values + if(!a){ vs = c.anchor.split(' '); c.anchorSpec = a = { right: this.parseAnchor(vs[0], c.initialConfig.width, aw), @@ -20017,11 +12535,11 @@ anchor: '-50 75%' } }, - // private + parseAnchor : function(a, start, cstart){ if(a && a != 'none'){ var last; - // standard anchor + if(this.parseAnchorRE.test(a)){ var diff = cstart - start; return function(v){ @@ -20030,7 +12548,7 @@ anchor: '-50 75%' return v - diff; } } - // percentage + }else if(a.indexOf('%') != -1){ var ratio = parseFloat(a.replace('%', ''))*.01; return function(v){ @@ -20039,7 +12557,7 @@ anchor: '-50 75%' return Math.floor(v*ratio); } } - // simple offset adjustment + }else{ a = parseInt(a, 10); if(!isNaN(a)){ @@ -20055,82 +12573,22 @@ anchor: '-50 75%' return false; }, - // private + adjustWidthAnchor : function(value, comp){ return value; }, - // private + adjustHeightAnchor : function(value, comp){ return value; } - /** - * @property activeItem - * @hide - */ + }); Ext.Container.LAYOUTS['anchor'] = Ext.layout.AnchorLayout; -/** - * @class Ext.layout.ColumnLayout - * @extends Ext.layout.ContainerLayout - *

    This is the layout style of choice for creating structural layouts in a multi-column format where the width of - * each column can be specified as a percentage or fixed width, but the height is allowed to vary based on the content. - * This class is intended to be extended or created via the layout:'column' {@link Ext.Container#layout} config, - * and should generally not need to be created directly via the new keyword.

    - *

    ColumnLayout does not have any direct config options (other than inherited ones), but it does support a - * specific config property of columnWidth that can be included in the config of any panel added to it. The - * layout will use the columnWidth (if present) or width of each panel during layout to determine how to size each panel. - * If width or columnWidth is not specified for a given panel, its width will default to the panel's width (or auto).

    - *

    The width property is always evaluated as pixels, and must be a number greater than or equal to 1. - * The columnWidth property is always evaluated as a percentage, and must be a decimal value greater than 0 and - * less than 1 (e.g., .25).

    - *

    The basic rules for specifying column widths are pretty simple. The logic makes two passes through the - * set of contained panels. During the first layout pass, all panels that either have a fixed width or none - * specified (auto) are skipped, but their widths are subtracted from the overall container width. During the second - * pass, all panels with columnWidths are assigned pixel widths in proportion to their percentages based on - * the total remaining container width. In other words, percentage width panels are designed to fill the space - * left over by all the fixed-width and/or auto-width panels. Because of this, while you can specify any number of columns - * with different percentages, the columnWidths must always add up to 1 (or 100%) when added together, otherwise your - * layout may not render as expected. Example usage:

    - *
    
    -// All columns are percentages -- they must add up to 1
    -var p = new Ext.Panel({
    -    title: 'Column Layout - Percentage Only',
    -    layout:'column',
    -    items: [{
    -        title: 'Column 1',
    -        columnWidth: .25
    -    },{
    -        title: 'Column 2',
    -        columnWidth: .6
    -    },{
    -        title: 'Column 3',
    -        columnWidth: .15
    -    }]
    -});
     
    -// Mix of width and columnWidth -- all columnWidth values must add up
    -// to 1. The first column will take up exactly 120px, and the last two
    -// columns will fill the remaining container width.
    -var p = new Ext.Panel({
    -    title: 'Column Layout - Mixed',
    -    layout:'column',
    -    items: [{
    -        title: 'Column 1',
    -        width: 120
    -    },{
    -        title: 'Column 2',
    -        columnWidth: .8
    -    },{
    -        title: 'Column 3',
    -        columnWidth: .2
    -    }]
    -});
    -
    - */ Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, { - // private + monitorResize:true, type: 'column', @@ -20139,7 +12597,7 @@ Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, { scrollOffset : 0, - // private + targetCls: 'x-column-layout-ct', @@ -20152,9 +12610,9 @@ Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, { if (target) { ret = target.getViewSize(); - // IE in strict mode will return a width of 0 on the 1st pass of getViewSize. - // Use getStyleSize to verify the 0 width, the adjustment pass will then work properly - // with getViewSize + + + if (Ext.isIE && Ext.isStrict && ret.width == 0){ ret = target.getStyleSize(); } @@ -20167,15 +12625,15 @@ Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, { renderAll : function(ct, target) { if(!this.innerCt){ - // the innerCt prevents wrapping and shuffling while - // the container is resizing + + this.innerCt = target.createChild({cls:'x-column-inner'}); this.innerCt.createChild({cls:'x-clear'}); } Ext.layout.ColumnLayout.superclass.renderAll.call(this, ct, this.innerCt); }, - // private + onLayout : function(ct, target){ var cs = ct.items.items, len = cs.length, @@ -20188,7 +12646,7 @@ Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, { var size = this.getLayoutTargetSize(); - if(size.width < 1 && size.height < 1){ // display none? + if(size.width < 1 && size.height < 1){ return; } @@ -20198,8 +12656,8 @@ Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, { this.innerCt.setWidth(w); - // some columns can be percentages while others are fixed - // so we need to make 2 passes + + for(i = 0; i < len; i++){ c = cs[i]; @@ -20220,8 +12678,8 @@ Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, { } } - // Browsers differ as to when they account for scrollbars. We need to re-measure to see if the scrollbar - // spaces were accounted for properly. If not, re-layout. + + if (Ext.isIE) { if (i = target.getStyle('overflow') && i != 'hidden' && !this.adjustmentPass) { var ts = this.getLayoutTargetSize(); @@ -20234,96 +12692,15 @@ Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, { delete this.adjustmentPass; } - /** - * @property activeItem - * @hide - */ + }); Ext.Container.LAYOUTS['column'] = Ext.layout.ColumnLayout; -/** - * @class Ext.layout.BorderLayout - * @extends Ext.layout.ContainerLayout - *

    This is a multi-pane, application-oriented UI layout style that supports multiple - * nested panels, automatic {@link Ext.layout.BorderLayout.Region#split split} bars between - * {@link Ext.layout.BorderLayout.Region#BorderLayout.Region regions} and built-in - * {@link Ext.layout.BorderLayout.Region#collapsible expanding and collapsing} of regions.

    - *

    This class is intended to be extended or created via the layout:'border' - * {@link Ext.Container#layout} config, and should generally not need to be created directly - * via the new keyword.

    - *

    BorderLayout does not have any direct config options (other than inherited ones). - * All configuration options available for customizing the BorderLayout are at the - * {@link Ext.layout.BorderLayout.Region} and {@link Ext.layout.BorderLayout.SplitRegion} - * levels.

    - *

    Example usage:

    - *
    
    -var myBorderPanel = new Ext.Panel({
    -    {@link Ext.Component#renderTo renderTo}: document.body,
    -    {@link Ext.BoxComponent#width width}: 700,
    -    {@link Ext.BoxComponent#height height}: 500,
    -    {@link Ext.Panel#title title}: 'Border Layout',
    -    {@link Ext.Container#layout layout}: 'border',
    -    {@link Ext.Container#items items}: [{
    -        {@link Ext.Panel#title title}: 'South Region is resizable',
    -        {@link Ext.layout.BorderLayout.Region#BorderLayout.Region region}: 'south',     // position for region
    -        {@link Ext.BoxComponent#height height}: 100,
    -        {@link Ext.layout.BorderLayout.Region#split split}: true,         // enable resizing
    -        {@link Ext.SplitBar#minSize minSize}: 75,         // defaults to {@link Ext.layout.BorderLayout.Region#minHeight 50}
    -        {@link Ext.SplitBar#maxSize maxSize}: 150,
    -        {@link Ext.layout.BorderLayout.Region#margins margins}: '0 5 5 5'
    -    },{
    -        // xtype: 'panel' implied by default
    -        {@link Ext.Panel#title title}: 'West Region is collapsible',
    -        {@link Ext.layout.BorderLayout.Region#BorderLayout.Region region}:'west',
    -        {@link Ext.layout.BorderLayout.Region#margins margins}: '5 0 0 5',
    -        {@link Ext.BoxComponent#width width}: 200,
    -        {@link Ext.layout.BorderLayout.Region#collapsible collapsible}: true,   // make collapsible
    -        {@link Ext.layout.BorderLayout.Region#cmargins cmargins}: '5 5 0 5', // adjust top margin when collapsed
    -        {@link Ext.Component#id id}: 'west-region-container',
    -        {@link Ext.Container#layout layout}: 'fit',
    -        {@link Ext.Panel#unstyled unstyled}: true
    -    },{
    -        {@link Ext.Panel#title title}: 'Center Region',
    -        {@link Ext.layout.BorderLayout.Region#BorderLayout.Region region}: 'center',     // center region is required, no width/height specified
    -        {@link Ext.Component#xtype xtype}: 'container',
    -        {@link Ext.Container#layout layout}: 'fit',
    -        {@link Ext.layout.BorderLayout.Region#margins margins}: '5 5 0 0'
    -    }]
    -});
    -
    - *

    Notes:

      - *
    • Any container using the BorderLayout must have a child item with region:'center'. - * The child item in the center region will always be resized to fill the remaining space not used by - * the other regions in the layout.
    • - *
    • Any child items with a region of west or east must have width defined - * (an integer representing the number of pixels that the region should take up).
    • - *
    • Any child items with a region of north or south must have height defined.
    • - *
    • The regions of a BorderLayout are fixed at render time and thereafter, its child Components may not be removed or added. To add/remove - * Components within a BorderLayout, have them wrapped by an additional Container which is directly - * managed by the BorderLayout. If the region is to be collapsible, the Container used directly - * by the BorderLayout manager should be a Panel. In the following example a Container (an Ext.Panel) - * is added to the west region: - *
      
      -wrc = {@link Ext#getCmp Ext.getCmp}('west-region-container');
      -wrc.{@link Ext.Panel#removeAll removeAll}();
      -wrc.{@link Ext.Container#add add}({
      -    title: 'Added Panel',
      -    html: 'Some content'
      -});
      -wrc.{@link Ext.Container#doLayout doLayout}();
      - * 
      - *
    • - *
    • To reference a {@link Ext.layout.BorderLayout.Region Region}: - *
      
      -wr = myBorderPanel.layout.west;
      - * 
      - *
    • - *
    - */ + Ext.layout.BorderLayout = Ext.extend(Ext.layout.ContainerLayout, { - // private + monitorResize:true, - // private + rendered : false, type: 'border', @@ -20335,7 +12712,7 @@ Ext.layout.BorderLayout = Ext.extend(Ext.layout.ContainerLayout, { return target ? target.getViewSize() : {}; }, - // private + onLayout : function(ct, target){ var collapsed, i, c, pos, items = ct.items.items, len = items.length; if(!this.rendered){ @@ -20360,7 +12737,7 @@ Ext.layout.BorderLayout = Ext.extend(Ext.layout.ContainerLayout, { } var size = this.getLayoutTargetSize(); - if(size.width < 20 || size.height < 20){ // display none? + if(size.width < 20 || size.height < 20){ if(collapsed){ this.restoreCollapsed = collapsed; } @@ -20434,10 +12811,10 @@ Ext.layout.BorderLayout = Ext.extend(Ext.layout.ContainerLayout, { collapsed[i].collapse(false); } } - if(Ext.isIE && Ext.isStrict){ // workaround IE strict repainting issue + if(Ext.isIE && Ext.isStrict){ target.repaint(); } - // Putting a border layout into an overflowed container is NOT correct and will make a second layout pass necessary. + if (i = target.getStyle('overflow') && i != 'hidden' && !this.adjustmentPass) { var ts = this.getLayoutTargetSize(); if (ts.width != size.width || ts.height != size.height){ @@ -20463,28 +12840,10 @@ Ext.layout.BorderLayout = Ext.extend(Ext.layout.ContainerLayout, { Ext.layout.BorderLayout.superclass.destroy.call(this); } - /** - * @property activeItem - * @hide - */ + }); -/** - * @class Ext.layout.BorderLayout.Region - *

    This is a region of a {@link Ext.layout.BorderLayout BorderLayout} that acts as a subcontainer - * within the layout. Each region has its own {@link Ext.layout.ContainerLayout layout} that is - * independent of other regions and the containing BorderLayout, and can be any of the - * {@link Ext.layout.ContainerLayout valid Ext layout types}.

    - *

    Region size is managed automatically and cannot be changed by the user -- for - * {@link #split resizable regions}, see {@link Ext.layout.BorderLayout.SplitRegion}.

    - * @constructor - * Create a new Region. - * @param {Layout} layout The {@link Ext.layout.BorderLayout BorderLayout} instance that is managing this Region. - * @param {Object} config The configuration options - * @param {String} position The region position. Valid values are: north, south, - * east, west and center. Every {@link Ext.layout.BorderLayout BorderLayout} - * must have a center region for the primary content -- all other regions are optional. - */ + Ext.layout.BorderLayout.Region = function(layout, config, pos){ Ext.apply(this, config); this.layout = layout; @@ -20508,166 +12867,38 @@ Ext.layout.BorderLayout.Region = function(layout, config, pos){ }; Ext.layout.BorderLayout.Region.prototype = { - /** - * @cfg {Boolean} animFloat - * When a collapsed region's bar is clicked, the region's panel will be displayed as a floated - * panel that will close again once the user mouses out of that panel (or clicks out if - * {@link #autoHide} = false). Setting {@link #animFloat} = false will - * prevent the open and close of these floated panels from being animated (defaults to true). - */ - /** - * @cfg {Boolean} autoHide - * When a collapsed region's bar is clicked, the region's panel will be displayed as a floated - * panel. If autoHide = true, the panel will automatically hide after the user mouses - * out of the panel. If autoHide = false, the panel will continue to display until the - * user clicks outside of the panel (defaults to true). - */ - /** - * @cfg {String} collapseMode - * collapseMode supports two configuration values:
      - *
    • undefined (default)
      By default, {@link #collapsible} - * regions are collapsed by clicking the expand/collapse tool button that renders into the region's - * title bar.
    • - *
    • 'mini'
      Optionally, when collapseMode is set to - * 'mini' the region's split bar will also display a small collapse button in the center of - * the bar. In 'mini' mode the region will collapse to a thinner bar than in normal mode. - *
    • - *

    - *

    Note: if a collapsible region does not have a title bar, then set collapseMode = - * 'mini' and {@link #split} = true in order for the region to be {@link #collapsible} - * by the user as the expand/collapse tool button (that would go in the title bar) will not be rendered.

    - *

    See also {@link #cmargins}.

    - */ - /** - * @cfg {Object} margins - * An object containing margins to apply to the region when in the expanded state in the - * format:
    
    -{
    -    top: (top margin),
    -    right: (right margin),
    -    bottom: (bottom margin),
    -    left: (left margin)
    -}
    - *

    May also be a string containing space-separated, numeric margin values. The order of the - * sides associated with each value matches the way CSS processes margin values:

    - *

      - *
    • If there is only one value, it applies to all sides.
    • - *
    • If there are two values, the top and bottom borders are set to the first value and the - * right and left are set to the second.
    • - *
    • If there are three values, the top is set to the first value, the left and right are set - * to the second, and the bottom is set to the third.
    • - *
    • If there are four values, they apply to the top, right, bottom, and left, respectively.
    • - *

    - *

    Defaults to:

    
    -     * {top:0, right:0, bottom:0, left:0}
    -     * 
    - */ - /** - * @cfg {Object} cmargins - * An object containing margins to apply to the region when in the collapsed state in the - * format:
    
    -{
    -    top: (top margin),
    -    right: (right margin),
    -    bottom: (bottom margin),
    -    left: (left margin)
    -}
    - *

    May also be a string containing space-separated, numeric margin values. The order of the - * sides associated with each value matches the way CSS processes margin values.

    - *

      - *
    • If there is only one value, it applies to all sides.
    • - *
    • If there are two values, the top and bottom borders are set to the first value and the - * right and left are set to the second.
    • - *
    • If there are three values, the top is set to the first value, the left and right are set - * to the second, and the bottom is set to the third.
    • - *
    • If there are four values, they apply to the top, right, bottom, and left, respectively.
    • - *

    - */ - /** - * @cfg {Boolean} collapsible - *

    true to allow the user to collapse this region (defaults to false). If - * true, an expand/collapse tool button will automatically be rendered into the title - * bar of the region, otherwise the button will not be shown.

    - *

    Note: that a title bar is required to display the collapse/expand toggle button -- if - * no title is specified for the region's panel, the region will only be collapsible if - * {@link #collapseMode} = 'mini' and {@link #split} = true. - */ + + + + + + collapsible : false, - /** - * @cfg {Boolean} split - *

    true to create a {@link Ext.layout.BorderLayout.SplitRegion SplitRegion} and - * display a 5px wide {@link Ext.SplitBar} between this region and its neighbor, allowing the user to - * resize the regions dynamically. Defaults to false creating a - * {@link Ext.layout.BorderLayout.Region Region}.


    - *

    Notes:

      - *
    • this configuration option is ignored if region='center'
    • - *
    • when split == true, it is common to specify a - * {@link Ext.SplitBar#minSize minSize} and {@link Ext.SplitBar#maxSize maxSize} - * for the {@link Ext.BoxComponent BoxComponent} representing the region. These are not native - * configs of {@link Ext.BoxComponent BoxComponent}, and are used only by this class.
    • - *
    • if {@link #collapseMode} = 'mini' requires split = true to reserve space - * for the collapse tool
    • - *
    - */ + split:false, - /** - * @cfg {Boolean} floatable - * true to allow clicking a collapsed region's bar to display the region's panel floated - * above the layout, false to force the user to fully expand a collapsed region by - * clicking the expand button to see it again (defaults to true). - */ + floatable: true, - /** - * @cfg {Number} minWidth - *

    The minimum allowable width in pixels for this region (defaults to 50). - * maxWidth may also be specified.


    - *

    Note: setting the {@link Ext.SplitBar#minSize minSize} / - * {@link Ext.SplitBar#maxSize maxSize} supersedes any specified - * minWidth / maxWidth.

    - */ + minWidth:50, - /** - * @cfg {Number} minHeight - * The minimum allowable height in pixels for this region (defaults to 50) - * maxHeight may also be specified.


    - *

    Note: setting the {@link Ext.SplitBar#minSize minSize} / - * {@link Ext.SplitBar#maxSize maxSize} supersedes any specified - * minHeight / maxHeight.

    - */ + minHeight:50, - // private + defaultMargins : {left:0,top:0,right:0,bottom:0}, - // private + defaultNSCMargins : {left:5,top:5,right:5,bottom:5}, - // private + defaultEWCMargins : {left:5,top:0,right:5,bottom:0}, floatingZIndex: 100, - /** - * True if this region is collapsed. Read-only. - * @type Boolean - * @property - */ + isCollapsed : false, - /** - * This region's panel. Read-only. - * @type Ext.Panel - * @property panel - */ - /** - * This region's layout. Read-only. - * @type Layout - * @property layout - */ - /** - * This region's layout position (north, south, east, west or center). Read-only. - * @type String - * @property position - */ + + + - // private + render : function(ct, p){ this.panel = p; p.el.enableDisplayMode(); @@ -20701,7 +12932,7 @@ Ext.layout.BorderLayout.Region.prototype = { } }, - // private + getCollapsedEl : function(){ if(!this.collapsedEl){ if(!this.toolTemplate){ @@ -20743,7 +12974,7 @@ Ext.layout.BorderLayout.Region.prototype = { return this.collapsedEl; }, - // private + onExpandClick : function(e){ if(this.isSlid){ this.panel.expand(false); @@ -20752,12 +12983,12 @@ Ext.layout.BorderLayout.Region.prototype = { } }, - // private + onCollapseClick : function(e){ this.panel.collapse(); }, - // private + beforeCollapse : function(p, animate){ this.lastAnim = animate; if(this.splitEl){ @@ -20771,7 +13002,7 @@ Ext.layout.BorderLayout.Region.prototype = { this.layout.layout(); }, - // private + onCollapse : function(animate){ this.panel.el.setStyle('z-index', 1); if(this.lastAnim === false || this.panel.animCollapse === false){ @@ -20783,7 +13014,7 @@ Ext.layout.BorderLayout.Region.prototype = { this.panel.saveState(); }, - // private + beforeExpand : function(animate){ if(this.isSlid){ this.afterSlideIn(); @@ -20800,7 +13031,7 @@ Ext.layout.BorderLayout.Region.prototype = { this.panel.el.setStyle('z-index', this.floatingZIndex); }, - // private + onExpand : function(){ this.isCollapsed = false; if(this.splitEl){ @@ -20812,7 +13043,7 @@ Ext.layout.BorderLayout.Region.prototype = { this.panel.saveState(); }, - // private + collapseClick : function(e){ if(this.isSlid){ e.stopPropagation(); @@ -20823,7 +13054,7 @@ Ext.layout.BorderLayout.Region.prototype = { } }, - // private + onHide : function(){ if(this.isCollapsed){ this.getCollapsedEl().hide(); @@ -20832,7 +13063,7 @@ Ext.layout.BorderLayout.Region.prototype = { } }, - // private + onShow : function(){ if(this.isCollapsed){ this.getCollapsedEl().show(); @@ -20841,67 +13072,44 @@ Ext.layout.BorderLayout.Region.prototype = { } }, - /** - * True if this region is currently visible, else false. - * @return {Boolean} - */ + isVisible : function(){ return !this.panel.hidden; }, - /** - * Returns the current margins for this region. If the region is collapsed, the - * {@link #cmargins} (collapsed margins) value will be returned, otherwise the - * {@link #margins} value will be returned. - * @return {Object} An object containing the element's margins: {left: (left - * margin), top: (top margin), right: (right margin), bottom: (bottom margin)} - */ + getMargins : function(){ return this.isCollapsed && this.cmargins ? this.cmargins : this.margins; }, - /** - * Returns the current size of this region. If the region is collapsed, the size of the - * collapsedEl will be returned, otherwise the size of the region's panel will be returned. - * @return {Object} An object containing the element's size: {width: (element width), - * height: (element height)} - */ + getSize : function(){ return this.isCollapsed ? this.getCollapsedEl().getSize() : this.panel.getSize(); }, - /** - * Sets the specified panel as the container element for this region. - * @param {Ext.Panel} panel The new panel - */ + setPanel : function(panel){ this.panel = panel; }, - /** - * Returns the minimum allowable width for this region. - * @return {Number} The minimum width - */ + getMinWidth: function(){ return this.minWidth; }, - /** - * Returns the minimum allowable height for this region. - * @return {Number} The minimum height - */ + getMinHeight: function(){ return this.minHeight; }, - // private + applyLayoutCollapsed : function(box){ var ce = this.getCollapsedEl(); ce.setLeftTop(box.x, box.y); ce.setSize(box.width, box.height); }, - // private + applyLayout : function(box){ if(this.isCollapsed){ this.applyLayoutCollapsed(box); @@ -20911,17 +13119,17 @@ Ext.layout.BorderLayout.Region.prototype = { } }, - // private + beforeSlide: function(){ this.panel.beforeEffect(); }, - // private + afterSlide : function(){ this.panel.afterEffect(); }, - // private + initAutoHide : function(){ if(this.autoHide !== false){ if(!this.autoHideHd){ @@ -20943,7 +13151,7 @@ Ext.layout.BorderLayout.Region.prototype = { } }, - // private + clearAutoHide : function(){ if(this.autoHide !== false){ this.el.un("mouseout", this.autoHideHd.mouseout); @@ -20953,16 +13161,12 @@ Ext.layout.BorderLayout.Region.prototype = { } }, - // private + clearMonitor : function(){ Ext.getDoc().un("click", this.slideInIf, this); }, - /** - * If this Region is {@link #floatable}, this method slides this Region into full visibility over the top - * of the center Region where it floats until either {@link #slideIn} is called, or other regions of the layout - * are clicked, or the mouse exits the Region. - */ + slideOut : function(){ if(this.isSlid || this.el.hasActiveFx()){ return; @@ -20974,24 +13178,24 @@ Ext.layout.BorderLayout.Region.prototype = { } this.el.show(); - // Temporarily clear the collapsed flag so we can onResize the panel on the slide + pc = this.panel.collapsed; this.panel.collapsed = false; if(this.position == 'east' || this.position == 'west'){ - // Temporarily clear the deferHeight flag so we can size the height on the slide + dh = this.panel.deferHeight; this.panel.deferHeight = false; this.panel.setSize(undefined, this.collapsedEl.getHeight()); - // Put the deferHeight flag back after setSize + this.panel.deferHeight = dh; }else{ this.panel.setSize(this.collapsedEl.getWidth(), undefined); } - // Put the collapsed flag back after onResize + this.panel.collapsed = pc; this.restoreLT = [this.el.dom.style.left, this.el.dom.style.top]; @@ -21015,7 +13219,7 @@ Ext.layout.BorderLayout.Region.prototype = { } }, - // private + afterSlideIn : function(){ this.clearAutoHide(); this.isSlid = false; @@ -21031,10 +13235,7 @@ Ext.layout.BorderLayout.Region.prototype = { } }, - /** - * If this Region is {@link #floatable}, and this Region has been slid into floating visibility, then this method slides - * this region back into its collapsed state. - */ + slideIn : function(cb){ if(!this.isSlid || this.el.hasActiveFx()){ Ext.callback(cb); @@ -21059,14 +13260,14 @@ Ext.layout.BorderLayout.Region.prototype = { } }, - // private + slideInIf : function(e){ if(!e.within(this.el)){ this.slideIn(); } }, - // private + anchors : { "west" : "left", "east" : "right", @@ -21074,7 +13275,7 @@ Ext.layout.BorderLayout.Region.prototype = { "south" : "bottom" }, - // private + sanchors : { "west" : "l", "east" : "r", @@ -21082,7 +13283,7 @@ Ext.layout.BorderLayout.Region.prototype = { "south" : "b" }, - // private + canchors : { "west" : "tl-tr", "east" : "tr-tl", @@ -21090,22 +13291,22 @@ Ext.layout.BorderLayout.Region.prototype = { "south" : "bl-tl" }, - // private + getAnchor : function(){ return this.anchors[this.position]; }, - // private + getCollapseAnchor : function(){ return this.canchors[this.position]; }, - // private + getSlideAnchor : function(){ return this.sanchors[this.position]; }, - // private + getAlignAdj : function(){ var cm = this.cmargins; switch(this.position){ @@ -21124,7 +13325,7 @@ Ext.layout.BorderLayout.Region.prototype = { } }, - // private + getExpandAdj : function(){ var c = this.collapsedEl, cm = this.cmargins; switch(this.position){ @@ -21151,56 +13352,23 @@ Ext.layout.BorderLayout.Region.prototype = { } }; -/** - * @class Ext.layout.BorderLayout.SplitRegion - * @extends Ext.layout.BorderLayout.Region - *

    This is a specialized type of {@link Ext.layout.BorderLayout.Region BorderLayout region} that - * has a built-in {@link Ext.SplitBar} for user resizing of regions. The movement of the split bar - * is configurable to move either {@link #tickSize smooth or incrementally}.

    - * @constructor - * Create a new SplitRegion. - * @param {Layout} layout The {@link Ext.layout.BorderLayout BorderLayout} instance that is managing this Region. - * @param {Object} config The configuration options - * @param {String} position The region position. Valid values are: north, south, east, west and center. Every - * BorderLayout must have a center region for the primary content -- all other regions are optional. - */ + Ext.layout.BorderLayout.SplitRegion = function(layout, config, pos){ Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this, layout, config, pos); - // prevent switch + this.applyLayout = this.applyFns[pos]; }; Ext.extend(Ext.layout.BorderLayout.SplitRegion, Ext.layout.BorderLayout.Region, { - /** - * @cfg {Number} tickSize - * The increment, in pixels by which to move this Region's {@link Ext.SplitBar SplitBar}. - * By default, the {@link Ext.SplitBar SplitBar} moves smoothly. - */ - /** - * @cfg {String} splitTip - * The tooltip to display when the user hovers over a - * {@link Ext.layout.BorderLayout.Region#collapsible non-collapsible} region's split bar - * (defaults to "Drag to resize."). Only applies if - * {@link #useSplitTips} = true. - */ + + splitTip : "Drag to resize.", - /** - * @cfg {String} collapsibleSplitTip - * The tooltip to display when the user hovers over a - * {@link Ext.layout.BorderLayout.Region#collapsible collapsible} region's split bar - * (defaults to "Drag to resize. Double click to hide."). Only applies if - * {@link #useSplitTips} = true. - */ + collapsibleSplitTip : "Drag to resize. Double click to hide.", - /** - * @cfg {Boolean} useSplitTips - * true to display a tooltip when the user hovers over a region's split bar - * (defaults to false). The tooltip text will be the value of either - * {@link #splitTip} or {@link #collapsibleSplitTip} as appropriate. - */ + useSplitTips : false, - // private + splitSettings : { north : { orientation: Ext.SplitBar.VERTICAL, @@ -21232,7 +13400,7 @@ Ext.extend(Ext.layout.BorderLayout.SplitRegion, Ext.layout.BorderLayout.Region, } }, - // private + applyFns : { west : function(box){ if(this.isCollapsed){ @@ -21284,7 +13452,7 @@ Ext.extend(Ext.layout.BorderLayout.SplitRegion, Ext.layout.BorderLayout.Region, } }, - // private + render : function(ct, p){ Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this, ct, p); @@ -21326,7 +13494,7 @@ Ext.extend(Ext.layout.BorderLayout.SplitRegion, Ext.layout.BorderLayout.Region, } }, - //docs inherit from superclass + getSize : function(){ if(this.isCollapsed){ return this.collapsedEl.getSize(); @@ -21340,21 +13508,21 @@ Ext.extend(Ext.layout.BorderLayout.SplitRegion, Ext.layout.BorderLayout.Region, return s; }, - // private + getHMaxSize : function(){ var cmax = this.maxSize || 10000; var center = this.layout.center; return Math.min(cmax, (this.el.getWidth()+center.el.getWidth())-center.getMinWidth()); }, - // private + getVMaxSize : function(){ var cmax = this.maxSize || 10000; var center = this.layout.center; return Math.min(cmax, (this.el.getHeight()+center.el.getHeight())-center.getMinHeight()); }, - // private + onSplitMove : function(split, newSize){ var s = this.panel.getSize(); this.lastSplitSize = newSize; @@ -21370,136 +13538,27 @@ Ext.extend(Ext.layout.BorderLayout.SplitRegion, Ext.layout.BorderLayout.Region, return false; }, - /** - * Returns a reference to the split bar in use by this region. - * @return {Ext.SplitBar} The split bar - */ + getSplitBar : function(){ return this.split; }, - // inherit docs + destroy : function() { Ext.destroy(this.miniSplitEl, this.split, this.splitEl); Ext.layout.BorderLayout.SplitRegion.superclass.destroy.call(this); } }); -Ext.Container.LAYOUTS['border'] = Ext.layout.BorderLayout;/** - * @class Ext.layout.FormLayout - * @extends Ext.layout.AnchorLayout - *

    This layout manager is specifically designed for rendering and managing child Components of - * {@link Ext.form.FormPanel forms}. It is responsible for rendering the labels of - * {@link Ext.form.Field Field}s.

    - * - *

    This layout manager is used when a Container is configured with the layout:'form' - * {@link Ext.Container#layout layout} config option, and should generally not need to be created directly - * via the new keyword. See {@link Ext.Container#layout} for additional details.

    - * - *

    In an application, it will usually be preferrable to use a {@link Ext.form.FormPanel FormPanel} - * (which is configured with FormLayout as its layout class by default) since it also provides built-in - * functionality for {@link Ext.form.BasicForm#doAction loading, validating and submitting} the form.

    - * - *

    A {@link Ext.Container Container} using the FormLayout layout manager (e.g. - * {@link Ext.form.FormPanel} or specifying layout:'form') can also accept the following - * layout-specific config properties:

      - *
    • {@link Ext.form.FormPanel#hideLabels hideLabels}
    • - *
    • {@link Ext.form.FormPanel#labelAlign labelAlign}
    • - *
    • {@link Ext.form.FormPanel#labelPad labelPad}
    • - *
    • {@link Ext.form.FormPanel#labelSeparator labelSeparator}
    • - *
    • {@link Ext.form.FormPanel#labelWidth labelWidth}
    • - *

    - * - *

    Any Component (including Fields) managed by FormLayout accepts the following as a config option: - *

      - *
    • {@link Ext.Component#anchor anchor}
    • - *

    - * - *

    Any Component managed by FormLayout may be rendered as a form field (with an associated label) by - * configuring it with a non-null {@link Ext.Component#fieldLabel fieldLabel}. Components configured - * in this way may be configured with the following options which affect the way the FormLayout renders them: - *

      - *
    • {@link Ext.Component#clearCls clearCls}
    • - *
    • {@link Ext.Component#fieldLabel fieldLabel}
    • - *
    • {@link Ext.Component#hideLabel hideLabel}
    • - *
    • {@link Ext.Component#itemCls itemCls}
    • - *
    • {@link Ext.Component#labelSeparator labelSeparator}
    • - *
    • {@link Ext.Component#labelStyle labelStyle}
    • - *

    - * - *

    Example usage:

    - *
    
    -// Required if showing validation messages
    -Ext.QuickTips.init();
    -
    -// While you can create a basic Panel with layout:'form', practically
    -// you should usually use a FormPanel to also get its form functionality
    -// since it already creates a FormLayout internally.
    -var form = new Ext.form.FormPanel({
    -    title: 'Form Layout',
    -    bodyStyle: 'padding:15px',
    -    width: 350,
    -    defaultType: 'textfield',
    -    defaults: {
    -        // applied to each contained item
    -        width: 230,
    -        msgTarget: 'side'
    -    },
    -    items: [{
    -            fieldLabel: 'First Name',
    -            name: 'first',
    -            allowBlank: false,
    -            {@link Ext.Component#labelSeparator labelSeparator}: ':' // override labelSeparator layout config
    -        },{
    -            fieldLabel: 'Last Name',
    -            name: 'last'
    -        },{
    -            fieldLabel: 'Email',
    -            name: 'email',
    -            vtype:'email'
    -        }, {
    -            xtype: 'textarea',
    -            hideLabel: true,     // override hideLabels layout config
    -            name: 'msg',
    -            anchor: '100% -53'
    -        }
    -    ],
    -    buttons: [
    -        {text: 'Save'},
    -        {text: 'Cancel'}
    -    ],
    -    layoutConfig: {
    -        {@link #labelSeparator}: '~' // superseded by assignment below
    -    },
    -    // config options applicable to container when layout='form':
    -    hideLabels: false,
    -    labelAlign: 'left',   // or 'right' or 'top'
    -    {@link Ext.form.FormPanel#labelSeparator labelSeparator}: '>>', // takes precedence over layoutConfig value
    -    labelWidth: 65,       // defaults to 100
    -    labelPad: 8           // defaults to 5, must specify labelWidth to be honored
    -});
    -
    - */ +Ext.Container.LAYOUTS['border'] = Ext.layout.BorderLayout; Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, { - /** - * @cfg {String} labelSeparator - * See {@link Ext.form.FormPanel}.{@link Ext.form.FormPanel#labelSeparator labelSeparator}. Configuration - * of this property at the container level takes precedence. - */ + labelSeparator : ':', - /** - * Read only. The CSS style specification string added to field labels in this layout if not - * otherwise {@link Ext.Component#labelStyle specified by each contained field}. - * @type String - * @property labelStyle - */ + - /** - * @cfg {Boolean} trackLabels - * True to show/hide the field label when the field is hidden. Defaults to false. - */ + trackLabels: false, type: 'form', @@ -21510,7 +13569,7 @@ Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, { c.un('show', this.onFieldShow, this); c.un('hide', this.onFieldHide, this); } - // check for itemCt, since we may be removing a fieldset or something similar + var el = c.getPositionEl(), ct = c.getItemCt && c.getItemCt(); if (c.rendered && ct) { @@ -21525,7 +13584,7 @@ Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, { } }, - // private + setContainer : function(ct){ Ext.layout.FormLayout.superclass.setContainer.call(this, ct); if(ct.labelAlign){ @@ -21559,20 +13618,25 @@ Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, { } }, - // private + isHide: function(c){ return c.hideLabel || this.container.hideLabels; }, onFieldShow: function(c){ c.getItemCt().removeClass('x-hide-' + c.hideMode); + + + if (c.isComposite) { + c.doLayout(); + } }, onFieldHide: function(c){ c.getItemCt().addClass('x-hide-' + c.hideMode); }, - //private + getLabelStyle: function(s){ var ls = '', items = [this.labelStyle, s]; for (var i = 0, len = items.length; i < len; ++i){ @@ -21586,44 +13650,9 @@ Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, { return ls; }, - /** - * @cfg {Ext.Template} fieldTpl - * A {@link Ext.Template#compile compile}d {@link Ext.Template} for rendering - * the fully wrapped, labeled and styled form Field. Defaults to:

    
    -new Ext.Template(
    -    '<div class="x-form-item {itemCls}" tabIndex="-1">',
    -        '<label for="{id}" style="{labelStyle}" class="x-form-item-label">{label}{labelSeparator}</label>',
    -        '<div class="x-form-element" id="x-form-el-{id}" style="{elementStyle}">',
    -        '</div><div class="{clearCls}"></div>',
    -    '</div>'
    -);
    -
    - *

    This may be specified to produce a different DOM structure when rendering form Fields.

    - *

    A description of the properties within the template follows:

      - *
    • itemCls : String
      The CSS class applied to the outermost div wrapper - * that contains this field label and field element (the default class is 'x-form-item' and itemCls - * will be added to that). If supplied, itemCls at the field level will override the default itemCls - * supplied at the container level.
    • - *
    • id : String
      The id of the Field
    • - *
    • {@link #labelStyle} : String
      - * A CSS style specification string to add to the field label for this field (defaults to '' or the - * {@link #labelStyle layout's value for labelStyle}).
    • - *
    • label : String
      The text to display as the label for this - * field (defaults to '')
    • - *
    • {@link #labelSeparator} : String
      The separator to display after - * the text of the label for this field (defaults to a colon ':' or the - * {@link #labelSeparator layout's value for labelSeparator}). To hide the separator use empty string ''.
    • - *
    • elementStyle : String
      The styles text for the input element's wrapper.
    • - *
    • clearCls : String
      The CSS class to apply to the special clearing div - * rendered directly after each form field wrapper (defaults to 'x-form-clear-left')
    • - *
    - *

    Also see {@link #getTemplateArgs}

    - */ + - /** - * @private - * - */ + renderItem : function(c, position, target){ if(c && (c.isFormField || c.fieldLabel) && c.inputType != 'hidden'){ var args = this.getTemplateArgs(c); @@ -21636,8 +13665,8 @@ new Ext.Template( c.itemCt = this.fieldTpl.append(target, args, true); } if(!c.getItemCt){ - // Non form fields don't have getItemCt, apply it here - // This will get cleaned up in onRemove + + Ext.apply(c, { getItemCt: function(){ return c.itemCt; @@ -21667,34 +13696,10 @@ new Ext.Template( } }, - /** - *

    Provides template arguments for rendering the fully wrapped, labeled and styled form Field.

    - *

    This method returns an object hash containing properties used by the layout's {@link #fieldTpl} - * to create a correctly wrapped, labeled and styled form Field. This may be overriden to - * create custom layouts. The properties which must be returned are:

      - *
    • itemCls : String
      The CSS class applied to the outermost div wrapper - * that contains this field label and field element (the default class is 'x-form-item' and itemCls - * will be added to that). If supplied, itemCls at the field level will override the default itemCls - * supplied at the container level.
    • - *
    • id : String
      The id of the Field
    • - *
    • {@link #labelStyle} : String
      - * A CSS style specification string to add to the field label for this field (defaults to '' or the - * {@link #labelStyle layout's value for labelStyle}).
    • - *
    • label : String
      The text to display as the label for this - * field (defaults to the field's configured fieldLabel property)
    • - *
    • {@link #labelSeparator} : String
      The separator to display after - * the text of the label for this field (defaults to a colon ':' or the - * {@link #labelSeparator layout's value for labelSeparator}). To hide the separator use empty string ''.
    • - *
    • elementStyle : String
      The styles text for the input element's wrapper.
    • - *
    • clearCls : String
      The CSS class to apply to the special clearing div - * rendered directly after each form field wrapper (defaults to 'x-form-clear-left')
    • - *
    - * @param (Ext.form.Field} field The {@link Ext.form.Field Field} being rendered. - * @return {Object} An object hash containing the properties required to render the Field. - */ + getTemplateArgs: function(field) { var noLabelSep = !field.fieldLabel || field.hideLabel; - + return { id : field.id, label : field.fieldLabel, @@ -21706,7 +13711,7 @@ new Ext.Template( }; }, - // private + adjustWidthAnchor: function(value, c){ if(c.label && !this.isHide(c) && (this.container.labelAlign != 'top')){ var adjust = Ext.isIE6 || (Ext.isIE && !Ext.isStrict); @@ -21722,104 +13727,32 @@ new Ext.Template( return value; }, - // private + isValidParent : function(c, target){ return target && this.container.getEl().contains(c.getPositionEl()); } - /** - * @property activeItem - * @hide - */ + }); Ext.Container.LAYOUTS['form'] = Ext.layout.FormLayout; -/** - * @class Ext.layout.AccordionLayout - * @extends Ext.layout.FitLayout - *

    This is a layout that manages multiple Panels in an expandable accordion style such that only - * one Panel can be expanded at any given time. Each Panel has built-in support for expanding and collapsing.

    - *

    Note: Only Ext.Panels and all subclasses of Ext.Panel may be used in an accordion layout Container.

    - *

    This class is intended to be extended or created via the {@link Ext.Container#layout layout} - * configuration property. See {@link Ext.Container#layout} for additional details.

    - *

    Example usage:

    - *
    
    -var accordion = new Ext.Panel({
    -    title: 'Accordion Layout',
    -    layout:'accordion',
    -    defaults: {
    -        // applied to each contained panel
    -        bodyStyle: 'padding:15px'
    -    },
    -    layoutConfig: {
    -        // layout-specific configs go here
    -        titleCollapse: false,
    -        animate: true,
    -        activeOnTop: true
    -    },
    -    items: [{
    -        title: 'Panel 1',
    -        html: '<p>Panel content!</p>'
    -    },{
    -        title: 'Panel 2',
    -        html: '<p>Panel content!</p>'
    -    },{
    -        title: 'Panel 3',
    -        html: '<p>Panel content!</p>'
    -    }]
    -});
    -
    - */ + Ext.layout.AccordionLayout = Ext.extend(Ext.layout.FitLayout, { - /** - * @cfg {Boolean} fill - * True to adjust the active item's height to fill the available space in the container, false to use the - * item's current height, or auto height if not explicitly set (defaults to true). - */ + fill : true, - /** - * @cfg {Boolean} autoWidth - * True to set each contained item's width to 'auto', false to use the item's current width (defaults to true). - * Note that some components, in particular the {@link Ext.grid.GridPanel grid}, will not function properly within - * layouts if they have auto width, so in such cases this config should be set to false. - */ + autoWidth : true, - /** - * @cfg {Boolean} titleCollapse - * True to allow expand/collapse of each contained panel by clicking anywhere on the title bar, false to allow - * expand/collapse only when the toggle tool button is clicked (defaults to true). When set to false, - * {@link #hideCollapseTool} should be false also. - */ + titleCollapse : true, - /** - * @cfg {Boolean} hideCollapseTool - * True to hide the contained panels' collapse/expand toggle buttons, false to display them (defaults to false). - * When set to true, {@link #titleCollapse} should be true also. - */ + hideCollapseTool : false, - /** - * @cfg {Boolean} collapseFirst - * True to make sure the collapse/expand toggle button always renders first (to the left of) any other tools - * in the contained panels' title bars, false to render it last (defaults to false). - */ + collapseFirst : false, - /** - * @cfg {Boolean} animate - * True to slide the contained panels open and closed during expand/collapse using animation, false to open and - * close directly with no animation (defaults to false). Note: to defer to the specific config setting of each - * contained panel for this property, set this to undefined at the layout level. - */ + animate : false, - /** - * @cfg {Boolean} sequence - * Experimental. If animate is set to true, this will result in each animation running in sequence. - */ + sequence : false, - /** - * @cfg {Boolean} activeOnTop - * True to swap the position of each panel as it is expanded so that it becomes the first item in the container, - * false to keep the panels in the rendered order. This is NOT compatible with "animate:true" (defaults to false). - */ + activeOnTop : false, type: 'accordion', @@ -21859,7 +13792,7 @@ Ext.layout.AccordionLayout = Ext.extend(Ext.layout.FitLayout, { c.un('beforeexpand', this.beforeExpand, this); }, - // private + beforeExpand : function(p, anim){ var ai = this.activeItem; if(ai){ @@ -21879,37 +13812,34 @@ Ext.layout.AccordionLayout = Ext.extend(Ext.layout.FitLayout, { if(this.activeOnTop){ p.el.dom.parentNode.insertBefore(p.el.dom, p.el.dom.parentNode.firstChild); } - // Items have been hidden an possibly rearranged, we need to get the container size again. + this.layout(); }, - // private + setItemSize : function(item, size){ if(this.fill && item){ var hh = 0, i, ct = this.getRenderedItems(this.container), len = ct.length, p; - // Add up all the header heights + for (i = 0; i < len; i++) { - if((p = ct[i]) != item){ + if((p = ct[i]) != item && !p.hidden){ hh += p.header.getHeight(); } }; - // Subtract the header heights from the container size + size.height -= hh; - // Call setSize on the container to set the correct height. For Panels, deferedHeight - // will simply store this size for when the expansion is done. + + item.setSize(size); } }, - /** - * Sets the active (expanded) item in the layout. - * @param {String/Number} item The string component id or numeric index of the item to activate - */ + setActiveItem : function(item){ this.setActive(item, true); }, - // private + setActive : function(item, expand){ var ai = this.activeItem; item = this.container.getComponent(item); @@ -21928,100 +13858,22 @@ Ext.layout.AccordionLayout = Ext.extend(Ext.layout.FitLayout, { }); Ext.Container.LAYOUTS.accordion = Ext.layout.AccordionLayout; -//backwards compat -Ext.layout.Accordion = Ext.layout.AccordionLayout;/** - * @class Ext.layout.TableLayout - * @extends Ext.layout.ContainerLayout - *

    This layout allows you to easily render content into an HTML table. The total number of columns can be - * specified, and rowspan and colspan can be used to create complex layouts within the table. - * This class is intended to be extended or created via the layout:'table' {@link Ext.Container#layout} config, - * and should generally not need to be created directly via the new keyword.

    - *

    Note that when creating a layout via config, the layout-specific config properties must be passed in via - * the {@link Ext.Container#layoutConfig} object which will then be applied internally to the layout. In the - * case of TableLayout, the only valid layout config property is {@link #columns}. However, the items added to a - * TableLayout can supply the following table-specific config properties:

    - *
      - *
    • rowspan Applied to the table cell containing the item.
    • - *
    • colspan Applied to the table cell containing the item.
    • - *
    • cellId An id applied to the table cell containing the item.
    • - *
    • cellCls A CSS class name added to the table cell containing the item.
    • - *
    - *

    The basic concept of building up a TableLayout is conceptually very similar to building up a standard - * HTML table. You simply add each panel (or "cell") that you want to include along with any span attributes - * specified as the special config properties of rowspan and colspan which work exactly like their HTML counterparts. - * Rather than explicitly creating and nesting rows and columns as you would in HTML, you simply specify the - * total column count in the layoutConfig and start adding panels in their natural order from left to right, - * top to bottom. The layout will automatically figure out, based on the column count, rowspans and colspans, - * how to position each panel within the table. Just like with HTML tables, your rowspans and colspans must add - * up correctly in your overall layout or you'll end up with missing and/or extra cells! Example usage:

    - *
    
    -// This code will generate a layout table that is 3 columns by 2 rows
    -// with some spanning included.  The basic layout will be:
    -// +--------+-----------------+
    -// |   A    |   B             |
    -// |        |--------+--------|
    -// |        |   C    |   D    |
    -// +--------+--------+--------+
    -var table = new Ext.Panel({
    -    title: 'Table Layout',
    -    layout:'table',
    -    defaults: {
    -        // applied to each contained panel
    -        bodyStyle:'padding:20px'
    -    },
    -    layoutConfig: {
    -        // The total column count must be specified here
    -        columns: 3
    -    },
    -    items: [{
    -        html: '<p>Cell A content</p>',
    -        rowspan: 2
    -    },{
    -        html: '<p>Cell B content</p>',
    -        colspan: 2
    -    },{
    -        html: '<p>Cell C content</p>',
    -        cellCls: 'highlight'
    -    },{
    -        html: '<p>Cell D content</p>'
    -    }]
    -});
    -
    - */ + +Ext.layout.Accordion = Ext.layout.AccordionLayout; Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, { - /** - * @cfg {Number} columns - * The total number of columns to create in the table for this layout. If not specified, all Components added to - * this layout will be rendered into a single row using one column per Component. - */ + - // private + monitorResize:false, type: 'table', targetCls: 'x-table-layout-ct', - /** - * @cfg {Object} tableAttrs - *

    An object containing properties which are added to the {@link Ext.DomHelper DomHelper} specification - * used to create the layout's <table> element. Example:

    
    -{
    -    xtype: 'panel',
    -    layout: 'table',
    -    layoutConfig: {
    -        tableAttrs: {
    -            style: {
    -                width: '100%'
    -            }
    -        },
    -        columns: 3
    -    }
    -}
    - */ + tableAttrs:null, - // private + setContainer : function(ct){ Ext.layout.TableLayout.superclass.setContainer.call(this, ct); @@ -22030,7 +13882,7 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, { this.cells = []; }, - // private + onLayout : function(ct, target){ var cs = ct.items.items, len = cs.length, c, i; @@ -22043,7 +13895,7 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, { this.renderAll(ct, target); }, - // private + getRow : function(index){ var row = this.table.tBodies[0].childNodes[index]; if(!row){ @@ -22053,7 +13905,7 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, { return row; }, - // private + getNextCell : function(c){ var cell = this.getNextNonSpan(this.currentColumn, this.currentRow); var curCol = this.currentColumn = cell[0], curRow = this.currentRow = cell[1]; @@ -22084,7 +13936,7 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, { return td; }, - // private + getNextNonSpan: function(colIndex, rowIndex){ var cols = this.columns; while((cols && colIndex >= cols) || (this.cells[rowIndex] && this.cells[rowIndex][colIndex])) { @@ -22098,9 +13950,9 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, { return [colIndex, rowIndex]; }, - // private + renderItem : function(c, position, target){ - // Ensure we have our inner table to get cells to render into. + if(!this.table){ this.table = target.createChild( Ext.apply({tag:'table', cls:'x-table-layout', cellspacing: 0, cn: {tag: 'tbody'}}, this.tableAttrs), null, true); @@ -22116,66 +13968,15 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, { } }, - // private + isValidParent : function(c, target){ return c.getPositionEl().up('table', 5).dom.parentNode === (target.dom || target); } - /** - * @property activeItem - * @hide - */ + }); -Ext.Container.LAYOUTS['table'] = Ext.layout.TableLayout;/** - * @class Ext.layout.AbsoluteLayout - * @extends Ext.layout.AnchorLayout - *

    This is a layout that inherits the anchoring of {@link Ext.layout.AnchorLayout} and adds the - * ability for x/y positioning using the standard x and y component config options.

    - *

    This class is intended to be extended or created via the {@link Ext.Container#layout layout} - * configuration property. See {@link Ext.Container#layout} for additional details.

    - *

    Example usage:

    - *
    
    -var form = new Ext.form.FormPanel({
    -    title: 'Absolute Layout',
    -    layout:'absolute',
    -    layoutConfig: {
    -        // layout-specific configs go here
    -        extraCls: 'x-abs-layout-item',
    -    },
    -    baseCls: 'x-plain',
    -    url:'save-form.php',
    -    defaultType: 'textfield',
    -    items: [{
    -        x: 0,
    -        y: 5,
    -        xtype:'label',
    -        text: 'Send To:'
    -    },{
    -        x: 60,
    -        y: 0,
    -        name: 'to',
    -        anchor:'100%'  // anchor width by percentage
    -    },{
    -        x: 0,
    -        y: 35,
    -        xtype:'label',
    -        text: 'Subject:'
    -    },{
    -        x: 60,
    -        y: 30,
    -        name: 'subject',
    -        anchor: '100%'  // anchor width by percentage
    -    },{
    -        x:0,
    -        y: 60,
    -        xtype: 'textarea',
    -        name: 'msg',
    -        anchor: '100% 100%'  // anchor width and height
    -    }]
    -});
    -
    - */ +Ext.Container.LAYOUTS['table'] = Ext.layout.TableLayout; Ext.layout.AbsoluteLayout = Ext.extend(Ext.layout.AnchorLayout, { extraCls: 'x-abs-layout-item', @@ -22189,79 +13990,28 @@ Ext.layout.AbsoluteLayout = Ext.extend(Ext.layout.AnchorLayout, { Ext.layout.AbsoluteLayout.superclass.onLayout.call(this, ct, target); }, - // private + adjustWidthAnchor : function(value, comp){ return value ? value - comp.getPosition(true)[0] + this.paddingLeft : value; }, - // private + adjustHeightAnchor : function(value, comp){ return value ? value - comp.getPosition(true)[1] + this.paddingTop : value; } - /** - * @property activeItem - * @hide - */ + }); Ext.Container.LAYOUTS['absolute'] = Ext.layout.AbsoluteLayout; -/** - * @class Ext.layout.BoxLayout - * @extends Ext.layout.ContainerLayout - *

    Base Class for HBoxLayout and VBoxLayout Classes. Generally it should not need to be used directly.

    - */ + Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, { - /** - * @cfg {Object} defaultMargins - *

    If the individual contained items do not have a margins - * property specified, the default margins from this property will be - * applied to each item.

    - *

    This property may be specified as an object containing margins - * to apply in the format:

    
    -{
    -    top: (top margin),
    -    right: (right margin),
    -    bottom: (bottom margin),
    -    left: (left margin)
    -}
    - *

    This property may also be specified as a string containing - * space-separated, numeric margin values. The order of the sides associated - * with each value matches the way CSS processes margin values:

    - *
      - *
    • If there is only one value, it applies to all sides.
    • - *
    • If there are two values, the top and bottom borders are set to the - * first value and the right and left are set to the second.
    • - *
    • If there are three values, the top is set to the first value, the left - * and right are set to the second, and the bottom is set to the third.
    • - *
    • If there are four values, they apply to the top, right, bottom, and - * left, respectively.
    • - *
    - *

    Defaults to:

    
    -     * {top:0, right:0, bottom:0, left:0}
    -     * 
    - */ + defaultMargins : {left:0,top:0,right:0,bottom:0}, - /** - * @cfg {String} padding - *

    Sets the padding to be applied to all child items managed by this layout.

    - *

    This property must be specified as a string containing - * space-separated, numeric padding values. The order of the sides associated - * with each value matches the way CSS processes padding values:

    - *
      - *
    • If there is only one value, it applies to all sides.
    • - *
    • If there are two values, the top and bottom borders are set to the - * first value and the right and left are set to the second.
    • - *
    • If there are three values, the top is set to the first value, the left - * and right are set to the second, and the bottom is set to the third.
    • - *
    • If there are four values, they apply to the top, right, bottom, and - * left, respectively.
    • - *
    - *

    Defaults to: "0"

    - */ + padding : '0', - // documented in subclasses + pack : 'start', - // private + monitorResize : true, type: 'box', scrollOffset : 0, @@ -22277,46 +14027,27 @@ Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, { } }, - /** - * @private - * Runs the child box calculations and caches them in childBoxCache. Subclasses can used these cached values - * when laying out - */ + onLayout: function(container, target) { Ext.layout.BoxLayout.superclass.onLayout.call(this, container, target); var items = this.getVisibleItems(container), tSize = this.getLayoutTargetSize(); - /** - * @private - * @property layoutTargetLastSize - * @type Object - * Private cache of the last measured size of the layout target. This should never be used except by - * BoxLayout subclasses during their onLayout run. - */ + this.layoutTargetLastSize = tSize; - /** - * @private - * @property childBoxCache - * @type Array - * Array of the last calculated height, width, top and left positions of each visible rendered component - * within the Box layout. - */ + this.childBoxCache = this.calculateChildBoxes(items, tSize); this.updateInnerCtSize(tSize, this.childBoxCache); this.updateChildBoxes(this.childBoxCache.boxes); - // Putting a box layout into an overflowed container is NOT correct and will make a second layout pass necessary. + this.handleTargetOverflow(tSize, container, target); }, - /** - * Resizes and repositions each child component - * @param {Array} boxes The box measurements - */ + updateChildBoxes: function(boxes) { for (var i = 0, length = boxes.length; i < length; i++) { var box = boxes[i], @@ -22325,7 +14056,7 @@ Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, { if (box.dirtySize) { comp.setSize(box.width, box.height); } - // Don't set positions to NaN + if (isNaN(box.left) || isNaN(box.top)) { continue; } @@ -22333,27 +14064,10 @@ Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, { } }, - /** - * @private - * Called by onRender just before the child components are sized and positioned. This resizes the innerCt - * to make sure all child items fit within it. We call this before sizing the children because if our child - * items are larger than the previous innerCt size the browser will insert scrollbars and then remove them - * again immediately afterwards, giving a performance hit. - * Subclasses should provide an implementation. - * @param {Object} currentSize The current height and width of the innerCt - * @param {Array} calculations The new box calculations of all items to be laid out - */ + updateInnerCtSize: Ext.emptyFn, - /** - * @private - * This should be called after onLayout of any BoxLayout subclass. If the target's overflow is not set to 'hidden', - * we need to lay out a second time because the scrollbars may have modified the height and width of the layout - * target. Having a Box layout inside such a target is therefore not recommended. - * @param {Object} previousTargetSize The size and height of the layout target before we just laid out - * @param {Ext.Container} container The container - * @param {Ext.Element} target The target element - */ + handleTargetOverflow: function(previousTargetSize, container, target) { var overflow = target.getStyle('overflow'); @@ -22368,16 +14082,12 @@ Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, { delete this.adjustmentPass; }, - // private + isValidParent : function(c, target){ return this.innerCt && c.getPositionEl().dom.parentNode == this.innerCt.dom; }, - /** - * @private - * Returns all items that are both rendered and visible - * @return {Array} All matching items - */ + getVisibleItems: function(ct) { var ct = ct || this.container, t = ct.getLayoutTarget(), @@ -22395,11 +14105,11 @@ Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, { return items; }, - // private + renderAll : function(ct, target){ if(!this.innerCt){ - // the innerCt prevents wrapping and shuffling while - // the container is resizing + + this.innerCt = target.createChild({cls:this.innerCls}); this.padding = this.parseMargins(this.padding); } @@ -22411,9 +14121,9 @@ Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, { if (target) { ret = target.getViewSize(); - // IE in strict mode will return a width of 0 on the 1st pass of getViewSize. - // Use getStyleSize to verify the 0 width, the adjustment pass will then work properly - // with getViewSize + + + if (Ext.isIE && Ext.isStrict && ret.width == 0){ ret = target.getStyleSize(); } @@ -22424,7 +14134,7 @@ Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, { return ret; }, - // private + renderItem : function(c){ if(Ext.isString(c.margins)){ c.margins = this.parseMargins(c.margins); @@ -22435,59 +14145,17 @@ Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, { } }); -/** - * @class Ext.layout.VBoxLayout - * @extends Ext.layout.BoxLayout - *

    A layout that arranges items vertically down a Container. This layout optionally divides available vertical - * space between child items containing a numeric flex configuration.

    - * This layout may also be used to set the widths of child items by configuring it with the {@link #align} option. - */ + Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, { - /** - * @cfg {String} align - * Controls how the child items of the container are aligned. Acceptable configuration values for this - * property are: - *
      - *
    • left : Default
      child items are aligned horizontally - * at the left side of the container
    • - *
    • center :
      child items are aligned horizontally at the - * mid-width of the container
    • - *
    • stretch :
      child items are stretched horizontally to fill - * the width of the container
    • - *
    • stretchmax :
      child items are stretched horizontally to - * the size of the largest item.
    • - *
    - */ - align : 'left', // left, center, stretch, strechmax + + align : 'left', type: 'vbox', - /** - * @cfg {String} pack - * Controls how the child items of the container are packed together. Acceptable configuration values - * for this property are: - *
      - *
    • start : Default
      child items are packed together at - * top side of container
    • - *
    • center :
      child items are packed together at - * mid-height of container
    • - *
    • end :
      child items are packed together at bottom - * side of container
    • - *
    - */ + - /** - * @cfg {Number} flex - * This configuation option is to be applied to child items of the container managed - * by this layout. Each child item with a flex property will be flexed vertically - * according to each item's relative flex value compared to the sum of all items with - * a flex value specified. Any child items that have either a flex = 0 or - * flex = undefined will not be 'flexed' (the initial size will not be changed). - */ + - /** - * @private - * See parent documentation - */ + updateInnerCtSize: function(tSize, calcs) { var innerCtHeight = tSize.height, innerCtWidth = calcs.meta.maxWidth + this.padding.left + this.padding.right; @@ -22498,20 +14166,12 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, { innerCtWidth = Math.max(tSize.width, innerCtWidth); } - //we set the innerCt size first because if our child items are larger than the previous innerCt size - //the browser will insert scrollbars and then remove them again immediately afterwards + + this.innerCt.setSize(innerCtWidth || undefined, innerCtHeight || undefined); }, - /** - * @private - * Calculates the size and positioning of each item in the VBox. This iterates over all of the rendered, - * visible items and returns a height, width, top and left for each, as well as a reference to each. Also - * returns meta data such as maxHeight which are useful when resizing layout wrappers such as this.innerCt. - * @param {Array} visibleItems The array of all rendered, visible items to be calculated for - * @param {Object} targetSize Object containing target size and height - * @return {Object} Object containing box measurements for each child, plus meta data - */ + calculateChildBoxes: function(visibleItems, targetSize) { var visibleCount = visibleItems.length, @@ -22533,13 +14193,13 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, { maxWidth = 0, totalFlex = 0, - //used to cache the calculated size and position values for each child item + boxes = [], - //used in the for loops below, just declared here for brevity + child, childWidth, childHeight, childSize, childMargins, canLayout, i, calcs, flexedHeight, horizMargins, stretchWidth; - //gather the total flex of all flexed items and the width taken up by fixed width items + for (i = 0; i < visibleCount; i++) { child = visibleItems[i]; childHeight = child.height; @@ -22547,17 +14207,17 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, { canLayout = !child.hasLayout && Ext.isFunction(child.doLayout); - // Static height (numeric) requires no calcs + if (!Ext.isNumber(childHeight)) { - // flex and not 'auto' height + if (child.flex && !childHeight) { totalFlex += child.flex; - // Not flexed or 'auto' height or undefined height + } else { - //Render and layout sub-containers without a flex or width defined, as otherwise we - //don't know how wide the sub-container should be and cannot calculate flexed widths + + if (!childHeight && canLayout) { child.doLayout(); } @@ -22572,7 +14232,7 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, { nonFlexHeight += (childHeight || 0) + childMargins.top + childMargins.bottom; - // Max width for align - force layout of non-layed out subcontainers without a numeric width + if (!Ext.isNumber(childWidth)) { if (canLayout) { child.doLayout(); @@ -22582,7 +14242,7 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, { maxWidth = Math.max(maxWidth, childWidth + childMargins.left + childMargins.right); - //cache the size of each child component + boxes.push({ component: child, height : childHeight || undefined, @@ -22590,7 +14250,7 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, { }); } - //the height available to the flexed items + var availableHeight = Math.max(0, (height - nonFlexHeight - paddingVert)); if (isCenter) { @@ -22599,11 +14259,11 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, { topOffset += availableHeight; } - //temporary variables used in the flex height calculations below + var remainingHeight = availableHeight, remainingFlex = totalFlex; - //calculate the height of each flexed item, and the left + top positions of every item + for (i = 0; i < visibleCount; i++) { child = visibleItems[i]; calcs = boxes[i]; @@ -22628,12 +14288,12 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, { switch (this.align) { case 'stretch': stretchWidth = availWidth - horizMargins; - calcs.width = stretchWidth.constrain(child.minHeight || 0, child.maxWidth || 1000000); + calcs.width = stretchWidth.constrain(child.minWidth || 0, child.maxWidth || 1000000); calcs.dirtySize = true; break; case 'stretchmax': stretchWidth = maxWidth - horizMargins; - calcs.width = stretchWidth.constrain(child.minHeight || 0, child.maxWidth || 1000000); + calcs.width = stretchWidth.constrain(child.minWidth || 0, child.maxWidth || 1000000); calcs.dirtySize = true; break; case 'center': @@ -22657,36 +14317,14 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, { Ext.Container.LAYOUTS.vbox = Ext.layout.VBoxLayout; -/** - * @class Ext.layout.HBoxLayout - * @extends Ext.layout.BoxLayout - *

    A layout that arranges items horizontally across a Container. This layout optionally divides available horizontal - * space between child items containing a numeric flex configuration.

    - * This layout may also be used to set the heights of child items by configuring it with the {@link #align} option. - */ + Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, { - /** - * @cfg {String} align - * Controls how the child items of the container are aligned. Acceptable configuration values for this - * property are: - *
      - *
    • top : Default
      child items are aligned vertically - * at the top of the container
    • - *
    • middle :
      child items are aligned vertically in the - * middle of the container
    • - *
    • stretch :
      child items are stretched vertically to fill - * the height of the container
    • - *
    • stretchmax :
      child items are stretched vertically to - * the height of the largest item.
    • - */ - align: 'top', // top, middle, stretch, strechmax + + align: 'top', type : 'hbox', - /** - * @private - * See parent documentation - */ + updateInnerCtSize: function(tSize, calcs) { var innerCtWidth = tSize.width, innerCtHeight = calcs.meta.maxHeight + this.padding.top + this.padding.bottom; @@ -22700,37 +14338,10 @@ Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, { this.innerCt.setSize(innerCtWidth || undefined, innerCtHeight || undefined); }, - /** - * @cfg {String} pack - * Controls how the child items of the container are packed together. Acceptable configuration values - * for this property are: - *
        - *
      • start : Default
        child items are packed together at - * left side of container
      • - *
      • center :
        child items are packed together at - * mid-width of container
      • - *
      • end :
        child items are packed together at right - * side of container
      • - *
      - */ - /** - * @cfg {Number} flex - * This configuation option is to be applied to child items of the container managed - * by this layout. Each child item with a flex property will be flexed horizontally - * according to each item's relative flex value compared to the sum of all items with - * a flex value specified. Any child items that have either a flex = 0 or - * flex = undefined will not be 'flexed' (the initial size will not be changed). - */ + + - /** - * @private - * Calculates the size and positioning of each item in the HBox. This iterates over all of the rendered, - * visible items and returns a height, width, top and left for each, as well as a reference to each. Also - * returns meta data such as maxHeight which are useful when resizing layout wrappers such as this.innerCt. - * @param {Array} visibleItems The array of all rendered, visible items to be calculated for - * @param {Object} targetSize Object containing target size and height - * @return {Object} Object containing box measurements for each child, plus meta data - */ + calculateChildBoxes: function(visibleItems, targetSize) { var visibleCount = visibleItems.length, @@ -22747,36 +14358,36 @@ Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, { isStart = this.pack == 'start', isCenter = this.pack == 'center', isEnd = this.pack == 'end', - // isRestore = ['stretch', 'stretchmax'].indexOf(this.align) == -1, + nonFlexWidth = 0, maxHeight = 0, totalFlex = 0, - //used to cache the calculated size and position values for each child item + boxes = [], - //used in the for loops below, just declared here for brevity + child, childWidth, childHeight, childSize, childMargins, canLayout, i, calcs, flexedWidth, vertMargins, stretchHeight; - //gather the total flex of all flexed items and the width taken up by fixed width items + for (i = 0; i < visibleCount; i++) { child = visibleItems[i]; childHeight = child.height; childWidth = child.width; canLayout = !child.hasLayout && Ext.isFunction(child.doLayout); - // Static width (numeric) requires no calcs + if (!Ext.isNumber(childWidth)) { - // flex and not 'auto' width + if (child.flex && !childWidth) { totalFlex += child.flex; - // Not flexed or 'auto' width or undefined width + } else { - //Render and layout sub-containers without a flex or width defined, as otherwise we - //don't know how wide the sub-container should be and cannot calculate flexed widths + + if (!childWidth && canLayout) { child.doLayout(); } @@ -22791,7 +14402,7 @@ Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, { nonFlexWidth += (childWidth || 0) + childMargins.left + childMargins.right; - // Max height for align - force layout of non-layed out subcontainers without a numeric height + if (!Ext.isNumber(childHeight)) { if (canLayout) { child.doLayout(); @@ -22801,7 +14412,7 @@ Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, { maxHeight = Math.max(maxHeight, childHeight + childMargins.top + childMargins.bottom); - //cache the size of each child component + boxes.push({ component: child, height : childHeight || undefined, @@ -22809,7 +14420,7 @@ Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, { }); } - //the width available to the flexed items + var availableWidth = Math.max(0, (width - nonFlexWidth - paddingHoriz)); if (isCenter) { @@ -22818,11 +14429,11 @@ Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, { leftOffset += availableWidth; } - //temporary variables used in the flex width calculations below + var remainingWidth = availableWidth, remainingFlex = totalFlex; - //calculate the widths of each flexed item, and the left + top positions of every item + for (i = 0; i < visibleCount; i++) { child = visibleItems[i]; calcs = boxes[i]; @@ -22874,46 +14485,22 @@ Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, { }); Ext.Container.LAYOUTS.hbox = Ext.layout.HBoxLayout; -/** - * @class Ext.layout.ToolbarLayout - * @extends Ext.layout.ContainerLayout - * Layout manager used by Ext.Toolbar. This is highly specialised for use by Toolbars and would not - * usually be used by any other class. - */ + Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, { monitorResize : true, type: 'toolbar', - /** - * @property triggerWidth - * @type Number - * The width allocated for the menu trigger at the extreme right end of the Toolbar - */ + triggerWidth: 18, - /** - * @property noItemsMenuText - * @type String - * HTML fragment to render into the toolbar overflow menu if there are no items to display - */ + noItemsMenuText : '
      (None)
      ', - /** - * @private - * @property lastOverflow - * @type Boolean - * Used internally to record whether the last layout caused an overflow or not - */ + lastOverflow: false, - /** - * @private - * @property tableHTML - * @type String - * String used to build the HTML injected to support the Toolbar's layout. The align property is - * injected into this string inside the td.x-toolbar-left element during onLayout. - */ + tableHTML: [ '
  • MethodDefined By
    ', '', @@ -22952,12 +14539,9 @@ Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, { '
    ' ].join(""), - /** - * @private - * Create the wrapping Toolbar HTML and render/move all the items into the correct places - */ + onLayout : function(ct, target) { - //render the Toolbar HTML if it's not already present + if (!this.leftTr) { var align = ct.buttonAlign == 'center' ? 'center' : 'left'; @@ -22969,12 +14553,7 @@ Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, { this.extrasTr = target.child('tr.x-toolbar-extras-row', true); if (this.hiddenItem == undefined) { - /** - * @property hiddenItems - * @type Array - * Holds all items that are currently hidden due to there not being enough space to render them - * These items will appear on the expand menu. - */ + this.hiddenItems = []; } } @@ -22983,7 +14562,7 @@ Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, { items = ct.items.items, position = 0; - //render each item if not already rendered, place it into the correct (left or right) target + for (var i = 0, len = items.length, c; i < len; i++, position++) { c = items[i]; @@ -23001,18 +14580,14 @@ Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, { } } - //strip extra empty cells + this.cleanup(this.leftTr); this.cleanup(this.rightTr); this.cleanup(this.extrasTr); this.fitToSize(target); }, - /** - * @private - * Removes any empty nodes from the given element - * @param {Ext.Element} el The element to clean up - */ + cleanup : function(el) { var cn = el.childNodes, i, c; @@ -23023,13 +14598,7 @@ Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, { } }, - /** - * @private - * Inserts the given Toolbar item into the given element - * @param {Ext.Component} c The component to add - * @param {Ext.Element} target The target to add the component to - * @param {Number} position The position to add the component at - */ + insertCell : function(c, target, position) { var td = document.createElement('td'); td.className = 'x-toolbar-cell'; @@ -23039,12 +14608,7 @@ Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, { return td; }, - /** - * @private - * Hides an item because it will not fit in the available width. The item will be unhidden again - * if the Toolbar is resized to be large enough to show it - * @param {Ext.Component} item The item to hide - */ + hideItem : function(item) { this.hiddenItems.push(item); @@ -23053,36 +14617,19 @@ Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, { item.hide(); }, - /** - * @private - * Unhides an item that was previously hidden due to there not being enough space left on the Toolbar - * @param {Ext.Component} item The item to show - */ + unhideItem : function(item) { item.show(); item.xtbHidden = false; this.hiddenItems.remove(item); }, - /** - * @private - * Returns the width of the given toolbar item. If the item is currently hidden because there - * is not enough room to render it, its previous width is returned - * @param {Ext.Component} c The component to measure - * @return {Number} The width of the item - */ + getItemWidth : function(c) { return c.hidden ? (c.xtbWidth || 0) : c.getPositionEl().dom.parentNode.offsetWidth; }, - /** - * @private - * Called at the end of onLayout. At this point the Toolbar has already been resized, so we need - * to fit the items into the available width. We add up the width required by all of the items in - * the toolbar - if we don't have enough space we hide the extra items and render the expand menu - * trigger. - * @param {Ext.Element} target The Element the Toolbar is currently laid out within - */ + fitToSize : function(target) { if (this.container.enableOverflow === false) { return; @@ -23121,7 +14668,7 @@ Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, { } } - //test for number of hidden items again here because they may have changed above + hasHiddens = hiddenItems.length != 0; if (hasHiddens) { @@ -23143,13 +14690,7 @@ Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, { } }, - /** - * @private - * Returns a menu config for a given component. This config is used to create a menu item - * to be added to the expander menu - * @param {Ext.Component} component The component to create the config for - * @param {Boolean} hideOnClick Passed through to the menu item - */ + createMenuConfig : function(component, hideOnClick){ var config = Ext.apply({}, component.initialConfig), group = component.toggleGroup; @@ -23182,12 +14723,7 @@ Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, { return config; }, - /** - * @private - * Adds the given Toolbar item to the given menu. Buttons inside a buttongroup are added individually. - * @param {Ext.menu.Menu} menu The menu to add to - * @param {Ext.Component} component The component to add - */ + addComponentToMenu : function(menu, component) { if (component instanceof Ext.Toolbar.Separator) { menu.add('-'); @@ -23207,11 +14743,7 @@ Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, { } }, - /** - * @private - * Deletes the sub-menu of each item in the expander menu. Submenus are created for items such as - * splitbuttons and buttongroups, where the Toolbar item cannot be represented by a single menu item - */ + clearMenu : function(){ var menu = this.moreMenu; if (menu && menu.items) { @@ -23221,12 +14753,7 @@ Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, { } }, - /** - * @private - * Called before the expand menu is shown, this rebuilds the menu since it was last shown because - * it is possible that the items hidden due to space limitations on the Toolbar have changed since. - * @param {Ext.menu.Menu} m The menu - */ + beforeMoreShow : function(menu) { var items = this.container.items.items, len = items.length, @@ -23250,26 +14777,16 @@ Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, { } } - // put something so the menu isn't empty if no compatible items found + if (menu.items.length < 1) { menu.add(this.noItemsMenuText); } }, - /** - * @private - * Creates the expand trigger and menu, adding them to the at the extreme right of the - * Toolbar table - */ + initMore : function(){ if (!this.more) { - /** - * @private - * @property moreMenu - * @type Ext.menu.Menu - * The expand menu - holds items for every Toolbar item that cannot be shown - * because the Toolbar is currently not wide enough. - */ + this.moreMenu = new Ext.menu.Menu({ ownerCt : this.container, listeners: { @@ -23278,12 +14795,7 @@ Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, { } }); - /** - * @private - * @property more - * @type Ext.Button - * The expand button which triggers the overflow menu to be shown - */ + this.more = new Ext.Button({ iconCls: 'x-toolbar-more-icon', cls : 'x-toolbar-more', @@ -23306,11 +14818,7 @@ Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, { }); Ext.Container.LAYOUTS.toolbar = Ext.layout.ToolbarLayout; -/** - * @class Ext.layout.MenuLayout - * @extends Ext.layout.ContainerLayout - *

    Layout manager used by {@link Ext.menu.Menu}. Generally this class should not need to be used directly.

    - */ + Ext.layout.MenuLayout = Ext.extend(Ext.layout.ContainerLayout, { monitorResize : true, @@ -23318,8 +14826,8 @@ Ext.Container.LAYOUTS.toolbar = Ext.layout.ToolbarLayout; setContainer : function(ct){ this.monitorResize = !ct.floating; - // This event is only fired by the menu in IE, used so we don't couple - // the menu with the layout. + + ct.on('autosize', this.doAutoSize, this); Ext.layout.MenuLayout.superclass.setContainer.call(this, ct); }, @@ -23341,16 +14849,16 @@ Ext.Container.LAYOUTS.toolbar = Ext.layout.ToolbarLayout; } var a = this.getItemArgs(c); -// The Component's positionEl is the
  • it is rendered into + c.render(c.positionEl = position ? this.itemTpl.insertBefore(position, a, true) : this.itemTpl.append(target, a, true)); -// Link the containing
  • to the item. + c.positionEl.menuItemId = c.getItemId(); -// If rendering a regular Component, and it needs an icon, -// move the Component rightwards. + + if (!a.isMenuItem && a.needsIcon) { c.positionEl.addClass('x-menu-list-item-indent'); } @@ -23375,7 +14883,7 @@ Ext.Container.LAYOUTS.toolbar = Ext.layout.ToolbarLayout; }; }, - // Valid if the Component is in a
  • which is part of our target
      + isValidParent : function(c, target) { return c.el.up('li.x-menu-list-item', 5).dom.parentNode === (target.dom || target); }, @@ -23392,111 +14900,27 @@ Ext.Container.LAYOUTS.toolbar = Ext.layout.ToolbarLayout; ct.setWidth(w); }else if(Ext.isIE){ ct.setWidth(Ext.isStrict && (Ext.isIE7 || Ext.isIE8) ? 'auto' : ct.minWidth); - var el = ct.getEl(), t = el.dom.offsetWidth; // force recalc + var el = ct.getEl(), t = el.dom.offsetWidth; ct.setWidth(ct.getLayoutTarget().getWidth() + el.getFrameWidth('lr')); } } } }); Ext.Container.LAYOUTS['menu'] = Ext.layout.MenuLayout; -/** - * @class Ext.Viewport - * @extends Ext.Container - *

      A specialized container representing the viewable application area (the browser viewport).

      - *

      The Viewport renders itself to the document body, and automatically sizes itself to the size of - * the browser viewport and manages window resizing. There may only be one Viewport created - * in a page. Inner layouts are available by virtue of the fact that all {@link Ext.Panel Panel}s - * added to the Viewport, either through its {@link #items}, or through the items, or the {@link #add} - * method of any of its child Panels may themselves have a layout.

      - *

      The Viewport does not provide scrolling, so child Panels within the Viewport should provide - * for scrolling if needed using the {@link #autoScroll} config.

      - *

      An example showing a classic application border layout:

      
      -new Ext.Viewport({
      -    layout: 'border',
      -    items: [{
      -        region: 'north',
      -        html: '<h1 class="x-panel-header">Page Title</h1>',
      -        autoHeight: true,
      -        border: false,
      -        margins: '0 0 5 0'
      -    }, {
      -        region: 'west',
      -        collapsible: true,
      -        title: 'Navigation',
      -        width: 200
      -        // the west region might typically utilize a {@link Ext.tree.TreePanel TreePanel} or a Panel with {@link Ext.layout.AccordionLayout Accordion layout}
      -    }, {
      -        region: 'south',
      -        title: 'Title for Panel',
      -        collapsible: true,
      -        html: 'Information goes here',
      -        split: true,
      -        height: 100,
      -        minHeight: 100
      -    }, {
      -        region: 'east',
      -        title: 'Title for the Grid Panel',
      -        collapsible: true,
      -        split: true,
      -        width: 200,
      -        xtype: 'grid',
      -        // remaining grid configuration not shown ...
      -        // notice that the GridPanel is added directly as the region
      -        // it is not "overnested" inside another Panel
      -    }, {
      -        region: 'center',
      -        xtype: 'tabpanel', // TabPanel itself has no title
      -        items: {
      -            title: 'Default Tab',
      -            html: 'The first tab\'s content. Others may be added dynamically'
      -        }
      -    }]
      -});
      -
      - * @constructor - * Create a new Viewport - * @param {Object} config The config object - * @xtype viewport - */ + Ext.Viewport = Ext.extend(Ext.Container, { - /* - * Privatize config options which, if used, would interfere with the - * correct operation of the Viewport as the sole manager of the - * layout of the document body. - */ - /** - * @cfg {Mixed} applyTo @hide - */ - /** - * @cfg {Boolean} allowDomMove @hide - */ - /** - * @cfg {Boolean} hideParent @hide - */ - /** - * @cfg {Mixed} renderTo @hide - */ - /** - * @cfg {Boolean} hideParent @hide - */ - /** - * @cfg {Number} height @hide - */ - /** - * @cfg {Number} width @hide - */ - /** - * @cfg {Boolean} autoHeight @hide - */ - /** - * @cfg {Boolean} autoWidth @hide - */ - /** - * @cfg {Boolean} deferHeight @hide - */ - /** - * @cfg {Boolean} monitorResize @hide - */ + + + + + + + + + + + + initComponent : function() { Ext.Viewport.superclass.initComponent.call(this); @@ -23518,772 +14942,126 @@ Ext.Viewport = Ext.extend(Ext.Container, { } }); Ext.reg('viewport', Ext.Viewport); -/** - * @class Ext.Panel - * @extends Ext.Container - *

      Panel is a container that has specific functionality and structural components that make - * it the perfect building block for application-oriented user interfaces.

      - *

      Panels are, by virtue of their inheritance from {@link Ext.Container}, capable - * of being configured with a {@link Ext.Container#layout layout}, and containing child Components.

      - *

      When either specifying child {@link Ext.Component#items items} of a Panel, or dynamically {@link Ext.Container#add adding} Components - * to a Panel, remember to consider how you wish the Panel to arrange those child elements, and whether - * those child elements need to be sized using one of Ext's built-in {@link Ext.Container#layout layout} schemes. By - * default, Panels use the {@link Ext.layout.ContainerLayout ContainerLayout} scheme. This simply renders - * child components, appending them one after the other inside the Container, and does not apply any sizing - * at all.

      - *

      A Panel may also contain {@link #bbar bottom} and {@link #tbar top} toolbars, along with separate - * {@link #header}, {@link #footer} and {@link #body} sections (see {@link #frame} for additional - * information).

      - *

      Panel also provides built-in {@link #collapsible expandable and collapsible behavior}, along with - * a variety of {@link #tools prebuilt tool buttons} that can be wired up to provide other customized - * behavior. Panels can be easily dropped into any {@link Ext.Container Container} or layout, and the - * layout and rendering pipeline is {@link Ext.Container#add completely managed by the framework}.

      - * @constructor - * @param {Object} config The config object - * @xtype panel - */ -Ext.Panel = Ext.extend(Ext.Container, { - /** - * The Panel's header {@link Ext.Element Element}. Read-only. - *

      This Element is used to house the {@link #title} and {@link #tools}

      - *

      Note: see the Note for {@link Ext.Component#el el} also.

      - * @type Ext.Element - * @property header - */ - /** - * The Panel's body {@link Ext.Element Element} which may be used to contain HTML content. - * The content may be specified in the {@link #html} config, or it may be loaded using the - * {@link autoLoad} config, or through the Panel's {@link #getUpdater Updater}. Read-only. - *

      If this is used to load visible HTML elements in either way, then - * the Panel may not be used as a Layout for hosting nested Panels.

      - *

      If this Panel is intended to be used as the host of a Layout (See {@link #layout} - * then the body Element must not be loaded or changed - it is under the control - * of the Panel's Layout. - *

      Note: see the Note for {@link Ext.Component#el el} also.

      - * @type Ext.Element - * @property body - */ - /** - * The Panel's bwrap {@link Ext.Element Element} used to contain other Panel elements - * (tbar, body, bbar, footer). See {@link #bodyCfg}. Read-only. - * @type Ext.Element - * @property bwrap - */ - /** - * True if this panel is collapsed. Read-only. - * @type Boolean - * @property collapsed - */ - /** - * @cfg {Object} bodyCfg - *

      A {@link Ext.DomHelper DomHelper} element specification object may be specified for any - * Panel Element.

      - *

      By default, the Default element in the table below will be used for the html markup to - * create a child element with the commensurate Default class name (baseCls will be - * replaced by {@link #baseCls}):

      - *
      -     * Panel      Default  Default             Custom      Additional       Additional
      -     * Element    element  class               element     class            style
      -     * ========   ==========================   =========   ==============   ===========
      -     * {@link #header}     div      {@link #baseCls}+'-header'   {@link #headerCfg}   headerCssClass   headerStyle
      -     * {@link #bwrap}      div      {@link #baseCls}+'-bwrap'     {@link #bwrapCfg}    bwrapCssClass    bwrapStyle
      -     * + tbar     div      {@link #baseCls}+'-tbar'       {@link #tbarCfg}     tbarCssClass     tbarStyle
      -     * + {@link #body}     div      {@link #baseCls}+'-body'       {@link #bodyCfg}     {@link #bodyCssClass}     {@link #bodyStyle}
      -     * + bbar     div      {@link #baseCls}+'-bbar'       {@link #bbarCfg}     bbarCssClass     bbarStyle
      -     * + {@link #footer}   div      {@link #baseCls}+'-footer'   {@link #footerCfg}   footerCssClass   footerStyle
      -     * 
      - *

      Configuring a Custom element may be used, for example, to force the {@link #body} Element - * to use a different form of markup than is created by default. An example of this might be - * to {@link Ext.Element#createChild create a child} Panel containing a custom content, such as - * a header, or forcing centering of all Panel content by having the body be a <center> - * element:

      - *
      
      -new Ext.Panel({
      -    title: 'Message Title',
      -    renderTo: Ext.getBody(),
      -    width: 200, height: 130,
      -    bodyCfg: {
      -        tag: 'center',
      -        cls: 'x-panel-body',  // Default class not applied if Custom element specified
      -        html: 'Message'
      -    },
      -    footerCfg: {
      -        tag: 'h2',
      -        cls: 'x-panel-footer'        // same as the Default class
      -        html: 'footer html'
      -    },
      -    footerCssClass: 'custom-footer', // additional css class, see {@link Ext.element#addClass addClass}
      -    footerStyle:    'background-color:red' // see {@link #bodyStyle}
      -});
      -     * 
      - *

      The example above also explicitly creates a {@link #footer} with custom markup and - * styling applied.

      - */ - /** - * @cfg {Object} headerCfg - *

      A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure - * of this Panel's {@link #header} Element. See {@link #bodyCfg} also.

      - */ - /** - * @cfg {Object} bwrapCfg - *

      A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure - * of this Panel's {@link #bwrap} Element. See {@link #bodyCfg} also.

      - */ - /** - * @cfg {Object} tbarCfg - *

      A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure - * of this Panel's {@link #tbar} Element. See {@link #bodyCfg} also.

      - */ - /** - * @cfg {Object} bbarCfg - *

      A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure - * of this Panel's {@link #bbar} Element. See {@link #bodyCfg} also.

      - */ - /** - * @cfg {Object} footerCfg - *

      A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure - * of this Panel's {@link #footer} Element. See {@link #bodyCfg} also.

      - */ - /** - * @cfg {Boolean} closable - * Panels themselves do not directly support being closed, but some Panel subclasses do (like - * {@link Ext.Window}) or a Panel Class within an {@link Ext.TabPanel}. Specify true - * to enable closing in such situations. Defaults to false. - */ - /** - * The Panel's footer {@link Ext.Element Element}. Read-only. - *

      This Element is used to house the Panel's {@link #buttons} or {@link #fbar}.

      - *

      Note: see the Note for {@link Ext.Component#el el} also.

      - * @type Ext.Element - * @property footer - */ - /** - * @cfg {Mixed} applyTo - *

      The id of the node, a DOM node or an existing Element corresponding to a DIV that is already present in - * the document that specifies some panel-specific structural markup. When applyTo is used, - * constituent parts of the panel can be specified by CSS class name within the main element, and the panel - * will automatically create those components from that markup. Any required components not specified in the - * markup will be autogenerated if necessary.

      - *

      The following class names are supported (baseCls will be replaced by {@link #baseCls}):

      - *
      • baseCls + '-header'
      • - *
      • baseCls + '-header-text'
      • - *
      • baseCls + '-bwrap'
      • - *
      • baseCls + '-tbar'
      • - *
      • baseCls + '-body'
      • - *
      • baseCls + '-bbar'
      • - *
      • baseCls + '-footer'
      - *

      Using this config, a call to render() is not required. If applyTo is specified, any value passed for - * {@link #renderTo} will be ignored and the target element's parent node will automatically be used as the - * panel's container.

      - */ - /** - * @cfg {Object/Array} tbar - *

      The top toolbar of the panel. This can be a {@link Ext.Toolbar} object, a toolbar config, or an array of - * buttons/button configs to be added to the toolbar. Note that this is not available as a property after render. - * To access the top toolbar after render, use {@link #getTopToolbar}.

      - *

      Note: Although a Toolbar may contain Field components, these will not be updated by a load - * of an ancestor FormPanel. A Panel's toolbars are not part of the standard Container->Component hierarchy, and - * so are not scanned to collect form items. However, the values will be submitted because form - * submission parameters are collected from the DOM tree.

      - */ - /** - * @cfg {Object/Array} bbar - *

      The bottom toolbar of the panel. This can be a {@link Ext.Toolbar} object, a toolbar config, or an array of - * buttons/button configs to be added to the toolbar. Note that this is not available as a property after render. - * To access the bottom toolbar after render, use {@link #getBottomToolbar}.

      - *

      Note: Although a Toolbar may contain Field components, these will not be updated by a load - * of an ancestor FormPanel. A Panel's toolbars are not part of the standard Container->Component hierarchy, and - * so are not scanned to collect form items. However, the values will be submitted because form - * submission parameters are collected from the DOM tree.

      - */ - /** @cfg {Object/Array} fbar - *

      A {@link Ext.Toolbar Toolbar} object, a Toolbar config, or an array of - * {@link Ext.Button Button}s/{@link Ext.Button Button} configs, describing a {@link Ext.Toolbar Toolbar} to be rendered into this Panel's footer element.

      - *

      After render, the fbar property will be an {@link Ext.Toolbar Toolbar} instance.

      - *

      If {@link #buttons} are specified, they will supersede the fbar configuration property.

      - * The Panel's {@link #buttonAlign} configuration affects the layout of these items, for example: - *
      
      -var w = new Ext.Window({
      -    height: 250,
      -    width: 500,
      -    bbar: new Ext.Toolbar({
      -        items: [{
      -            text: 'bbar Left'
      -        },'->',{
      -            text: 'bbar Right'
      -        }]
      -    }),
      -    {@link #buttonAlign}: 'left', // anything but 'center' or 'right' and you can use '-', and '->'
      -                                  // to control the alignment of fbar items
      -    fbar: [{
      -        text: 'fbar Left'
      -    },'->',{
      -        text: 'fbar Right'
      -    }]
      -}).show();
      -     * 
      - *

      Note: Although a Toolbar may contain Field components, these will not be updated by a load - * of an ancestor FormPanel. A Panel's toolbars are not part of the standard Container->Component hierarchy, and - * so are not scanned to collect form items. However, the values will be submitted because form - * submission parameters are collected from the DOM tree.

      - */ - /** - * @cfg {Boolean} header - * true to create the Panel's header element explicitly, false to skip creating - * it. If a {@link #title} is set the header will be created automatically, otherwise it will not. - * If a {@link #title} is set but header is explicitly set to false, the header - * will not be rendered. - */ - /** - * @cfg {Boolean} footer - * true to create the footer element explicitly, false to skip creating it. The footer - * will be created automatically if {@link #buttons} or a {@link #fbar} have - * been configured. See {@link #bodyCfg} for an example. - */ - /** - * @cfg {String} title - * The title text to be used as innerHTML (html tags are accepted) to display in the panel - * {@link #header} (defaults to ''). When a title is specified the - * {@link #header} element will automatically be created and displayed unless - * {@link #header} is explicitly set to false. If you do not want to specify a - * title at config time, but you may want one later, you must either specify a non-empty - * title (a blank space ' ' will do) or header:true so that the container - * element will get created. - */ - /** - * @cfg {Array} buttons - * buttons will be used as {@link Ext.Container#items items} for the toolbar in - * the footer ({@link #fbar}). Typically the value of this configuration property will be - * an array of {@link Ext.Button}s or {@link Ext.Button} configuration objects. - * If an item is configured with minWidth or the Panel is configured with minButtonWidth, - * that width will be applied to the item. - */ - /** - * @cfg {Object/String/Function} autoLoad - * A valid url spec according to the Updater {@link Ext.Updater#update} method. - * If autoLoad is not null, the panel will attempt to load its contents - * immediately upon render.

      - * The URL will become the default URL for this panel's {@link #body} element, - * so it may be {@link Ext.Element#refresh refresh}ed at any time.

      - */ - /** - * @cfg {Boolean} frame - * false by default to render with plain 1px square borders. true to render with - * 9 elements, complete with custom rounded corners (also see {@link Ext.Element#boxWrap}). - *

      The template generated for each condition is depicted below:

      
      -     *
      -// frame = false
      -<div id="developer-specified-id-goes-here" class="x-panel">
      -
      -    <div class="x-panel-header"><span class="x-panel-header-text">Title: (frame:false)</span></div>
      -
      -    <div class="x-panel-bwrap">
      -        <div class="x-panel-body"><p>html value goes here</p></div>
      -    </div>
      -</div>
      -
      -// frame = true (create 9 elements)
      -<div id="developer-specified-id-goes-here" class="x-panel">
      -    <div class="x-panel-tl"><div class="x-panel-tr"><div class="x-panel-tc">
      -        <div class="x-panel-header"><span class="x-panel-header-text">Title: (frame:true)</span></div>
      -    </div></div></div>
      -
      -    <div class="x-panel-bwrap">
      -        <div class="x-panel-ml"><div class="x-panel-mr"><div class="x-panel-mc">
      -            <div class="x-panel-body"><p>html value goes here</p></div>
      -        </div></div></div>
      -
      -        <div class="x-panel-bl"><div class="x-panel-br"><div class="x-panel-bc"/>
      -        </div></div></div>
      -</div>
      -     * 
      - */ - /** - * @cfg {Boolean} border - * True to display the borders of the panel's body element, false to hide them (defaults to true). By default, - * the border is a 2px wide inset border, but this can be further altered by setting {@link #bodyBorder} to false. - */ - /** - * @cfg {Boolean} bodyBorder - * True to display an interior border on the body element of the panel, false to hide it (defaults to true). - * This only applies when {@link #border} == true. If border == true and bodyBorder == false, the border will display - * as a 1px wide inset border, giving the entire body element an inset appearance. - */ - /** - * @cfg {String/Object/Function} bodyCssClass - * Additional css class selector to be applied to the {@link #body} element in the format expected by - * {@link Ext.Element#addClass} (defaults to null). See {@link #bodyCfg}. - */ - /** - * @cfg {String/Object/Function} bodyStyle - * Custom CSS styles to be applied to the {@link #body} element in the format expected by - * {@link Ext.Element#applyStyles} (defaults to null). See {@link #bodyCfg}. - */ - /** - * @cfg {String} iconCls - * The CSS class selector that specifies a background image to be used as the header icon (defaults to ''). - *

      An example of specifying a custom icon class would be something like: - *

      
      -// specify the property in the config for the class:
      -     ...
      -     iconCls: 'my-icon'
      -
      -// css class that specifies background image to be used as the icon image:
      -.my-icon { background-image: url(../images/my-icon.gif) 0 6px no-repeat !important; }
      -
      - */ - /** - * @cfg {Boolean} collapsible - * True to make the panel collapsible and have the expand/collapse toggle button automatically rendered into - * the header tool button area, false to keep the panel statically sized with no button (defaults to false). - */ - /** - * @cfg {Array} tools - * An array of tool button configs to be added to the header tool area. When rendered, each tool is - * stored as an {@link Ext.Element Element} referenced by a public property called tools.<tool-type> - *

      Each tool config may contain the following properties: - *

        - *
      • id : String
        Required. The type - * of tool to create. By default, this assigns a CSS class of the form x-tool-<tool-type> to the - * resulting tool Element. Ext provides CSS rules, and an icon sprite containing images for the tool types listed below. - * The developer may implement custom tools by supplying alternate CSS rules and background images: - *
          - *
          toggle (Created by default when {@link #collapsible} is true)
          - *
          close
          - *
          minimize
          - *
          maximize
          - *
          restore
          - *
          gear
          - *
          pin
          - *
          unpin
          - *
          right
          - *
          left
          - *
          up
          - *
          down
          - *
          refresh
          - *
          minus
          - *
          plus
          - *
          help
          - *
          search
          - *
          save
          - *
          print
          - *
      • - *
      • handler : Function
        Required. The function to - * call when clicked. Arguments passed are:
          - *
        • event : Ext.EventObject
          The click event.
        • - *
        • toolEl : Ext.Element
          The tool Element.
        • - *
        • panel : Ext.Panel
          The host Panel
        • - *
        • tc : Object
          The tool configuration object
        • - *
      • - *
      • stopEvent : Boolean
        Defaults to true. Specify as false to allow click event to propagate.
      • - *
      • scope : Object
        The scope in which to call the handler.
      • - *
      • qtip : String/Object
        A tip string, or - * a config argument to {@link Ext.QuickTip#register}
      • - *
      • hidden : Boolean
        True to initially render hidden.
      • - *
      • on : Object
        A listener config object specifiying - * event listeners in the format of an argument to {@link #addListener}
      • - *
      - *

      Note that, apart from the toggle tool which is provided when a panel is collapsible, these - * tools only provide the visual button. Any required functionality must be provided by adding - * handlers that implement the necessary behavior.

      - *

      Example usage:

      - *
      
      -tools:[{
      -    id:'refresh',
      -    qtip: 'Refresh form Data',
      -    // hidden:true,
      -    handler: function(event, toolEl, panel){
      -        // refresh logic
      -    }
      -},
      -{
      -    id:'help',
      -    qtip: 'Get Help',
      -    handler: function(event, toolEl, panel){
      -        // whatever
      -    }
      -}]
      -
      - *

      For the custom id of 'help' define two relevant css classes with a link to - * a 15x15 image:

      - *
      
      -.x-tool-help {background-image: url(images/help.png);}
      -.x-tool-help-over {background-image: url(images/help_over.png);}
      -// if using an image sprite:
      -.x-tool-help {background-image: url(images/help.png) no-repeat 0 0;}
      -.x-tool-help-over {background-position:-15px 0;}
      -
      - */ - /** - * @cfg {Ext.Template/Ext.XTemplate} toolTemplate - *

      A Template used to create {@link #tools} in the {@link #header} Element. Defaults to:

      
      -new Ext.Template('<div class="x-tool x-tool-{id}">&#160;</div>')
      - *

      This may may be overridden to provide a custom DOM structure for tools based upon a more - * complex XTemplate. The template's data is a single tool configuration object (Not the entire Array) - * as specified in {@link #tools}. In the following example an <a> tag is used to provide a - * visual indication when hovering over the tool:

      
      -var win = new Ext.Window({
      -    tools: [{
      -        id: 'download',
      -        href: '/MyPdfDoc.pdf'
      -    }],
      -    toolTemplate: new Ext.XTemplate(
      -        '<tpl if="id==\'download\'">',
      -            '<a class="x-tool x-tool-pdf" href="{href}"></a>',
      -        '</tpl>',
      -        '<tpl if="id!=\'download\'">',
      -            '<div class="x-tool x-tool-{id}">&#160;</div>',
      -        '</tpl>'
      -    ),
      -    width:500,
      -    height:300,
      -    closeAction:'hide'
      -});
      - *

      Note that the CSS class 'x-tool-pdf' should have an associated style rule which provides an - * appropriate background image, something like:

      -
      
      -    a.x-tool-pdf {background-image: url(../shared/extjs/images/pdf.gif)!important;}
      -    
      - */ - /** - * @cfg {Boolean} hideCollapseTool - * true to hide the expand/collapse toggle button when {@link #collapsible} == true, - * false to display it (defaults to false). - */ - /** - * @cfg {Boolean} titleCollapse - * true to allow expanding and collapsing the panel (when {@link #collapsible} = true) - * by clicking anywhere in the header bar, false) to allow it only by clicking to tool button - * (defaults to false)). If this panel is a child item of a border layout also see the - * {@link Ext.layout.BorderLayout.Region BorderLayout.Region} - * {@link Ext.layout.BorderLayout.Region#floatable floatable} config option. - */ - /** - * @cfg {Mixed} floating - *

      This property is used to configure the underlying {@link Ext.Layer}. Acceptable values for this - * configuration property are:

        - *
      • false : Default.
        Display the panel inline where it is - * rendered.
      • - *
      • true :
        Float the panel (absolute position it with automatic - * shimming and shadow).
          - *
          Setting floating to true will create an Ext.Layer for this panel and display the - * panel at negative offsets so that it is hidden.
          - *
          Since the panel will be absolute positioned, the position must be set explicitly - * after render (e.g., myPanel.setPosition(100,100);).
          - *
          Note: when floating a panel you should always assign a fixed width, - * otherwise it will be auto width and will expand to fill to the right edge of the viewport.
          - *
      • - *
      • {@link Ext.Layer object} :
        The specified object will be used - * as the configuration object for the {@link Ext.Layer} that will be created.
      • - *
      - */ - /** - * @cfg {Boolean/String} shadow - * true (or a valid Ext.Shadow {@link Ext.Shadow#mode} value) to display a shadow behind the - * panel, false to display no shadow (defaults to 'sides'). Note that this option - * only applies when {@link #floating} = true. - */ - /** - * @cfg {Number} shadowOffset - * The number of pixels to offset the shadow if displayed (defaults to 4). Note that this - * option only applies when {@link #floating} = true. - */ - /** - * @cfg {Boolean} shim - * false to disable the iframe shim in browsers which need one (defaults to true). - * Note that this option only applies when {@link #floating} = true. - */ - /** - * @cfg {Object/Array} keys - * A {@link Ext.KeyMap} config object (in the format expected by {@link Ext.KeyMap#addBinding} - * used to assign custom key handling to this panel (defaults to null). - */ - /** - * @cfg {Boolean/Object} draggable - *

      true to enable dragging of this Panel (defaults to false).

      - *

      For custom drag/drop implementations, an Ext.Panel.DD config could also be passed - * in this config instead of true. Ext.Panel.DD is an internal, undocumented class which - * moves a proxy Element around in place of the Panel's element, but provides no other behaviour - * during dragging or on drop. It is a subclass of {@link Ext.dd.DragSource}, so behaviour may be - * added by implementing the interface methods of {@link Ext.dd.DragDrop} e.g.: - *

      
      -new Ext.Panel({
      -    title: 'Drag me',
      -    x: 100,
      -    y: 100,
      -    renderTo: Ext.getBody(),
      -    floating: true,
      -    frame: true,
      -    width: 400,
      -    height: 200,
      -    draggable: {
      -//      Config option of Ext.Panel.DD class.
      -//      It's a floating Panel, so do not show a placeholder proxy in the original position.
      -        insertProxy: false,
      -
      -//      Called for each mousemove event while dragging the DD object.
      -        onDrag : function(e){
      -//          Record the x,y position of the drag proxy so that we can
      -//          position the Panel at end of drag.
      -            var pel = this.proxy.getEl();
      -            this.x = pel.getLeft(true);
      -            this.y = pel.getTop(true);
      -
      -//          Keep the Shadow aligned if there is one.
      -            var s = this.panel.getEl().shadow;
      -            if (s) {
      -                s.realign(this.x, this.y, pel.getWidth(), pel.getHeight());
      -            }
      -        },
      +Ext.Panel = Ext.extend(Ext.Container, {
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
      +    
       
      -//      Called on the mouseup event.
      -        endDrag : function(e){
      -            this.panel.setPosition(this.x, this.y);
      -        }
      -    }
      -}).show();
      -
      - */ - /** - * @cfg {Boolean} disabled - * Render this panel disabled (default is false). An important note when using the disabled - * config on panels is that IE will often fail to initialize the disabled mask element correectly if - * the panel's layout has not yet completed by the time the Panel is disabled during the render process. - * If you experience this issue, you may need to instead use the {@link #afterlayout} event to initialize - * the disabled state: - *
      
      -new Ext.Panel({
      -    ...
      -    listeners: {
      -        'afterlayout': {
      -            fn: function(p){
      -                p.disable();
      -            },
      -            single: true // important, as many layouts can occur
      -        }
      -    }
      -});
      -
      - */ - /** - * @cfg {Boolean} autoHeight - * true to use height:'auto', false to use fixed height (defaults to false). - * Note: Setting autoHeight: true means that the browser will manage the panel's height - * based on its contents, and that Ext will not manage it at all. If the panel is within a layout that - * manages dimensions (fit, border, etc.) then setting autoHeight: true - * can cause issues with scrolling and will not generally work as expected since the panel will take - * on the height of its contents rather than the height required by the Ext layout. - */ + + + + + + + + - /** - * @cfg {String} baseCls - * The base CSS class to apply to this panel's element (defaults to 'x-panel'). - *

      Another option available by default is to specify 'x-plain' which strips all styling - * except for required attributes for Ext layouts to function (e.g. overflow:hidden). - * See {@link #unstyled} also.

      - */ + baseCls : 'x-panel', - /** - * @cfg {String} collapsedCls - * A CSS class to add to the panel's element after it has been collapsed (defaults to - * 'x-panel-collapsed'). - */ + collapsedCls : 'x-panel-collapsed', - /** - * @cfg {Boolean} maskDisabled - * true to mask the panel when it is {@link #disabled}, false to not mask it (defaults - * to true). Either way, the panel will always tell its contained elements to disable themselves - * when it is disabled, but masking the panel can provide an additional visual cue that the panel is - * disabled. - */ + maskDisabled : true, - /** - * @cfg {Boolean} animCollapse - * true to animate the transition when the panel is collapsed, false to skip the - * animation (defaults to true if the {@link Ext.Fx} class is available, otherwise false). - */ + animCollapse : Ext.enableFx, - /** - * @cfg {Boolean} headerAsText - * true to display the panel {@link #title} in the {@link #header}, - * false to hide it (defaults to true). - */ + headerAsText : true, - /** - * @cfg {String} buttonAlign - * The alignment of any {@link #buttons} added to this panel. Valid values are 'right', - * 'left' and 'center' (defaults to 'right'). - */ + buttonAlign : 'right', - /** - * @cfg {Boolean} collapsed - * true to render the panel collapsed, false to render it expanded (defaults to - * false). - */ + collapsed : false, - /** - * @cfg {Boolean} collapseFirst - * true to make sure the collapse/expand toggle button always renders first (to the left of) - * any other tools in the panel's title bar, false to render it last (defaults to true). - */ + collapseFirst : true, - /** - * @cfg {Number} minButtonWidth - * Minimum width in pixels of all {@link #buttons} in this panel (defaults to 75) - */ + minButtonWidth : 75, - /** - * @cfg {Boolean} unstyled - * Overrides the {@link #baseCls} setting to {@link #baseCls} = 'x-plain' which renders - * the panel unstyled except for required attributes for Ext layouts to function (e.g. overflow:hidden). - */ - /** - * @cfg {String} elements - * A comma-delimited list of panel elements to initialize when the panel is rendered. Normally, this list will be - * generated automatically based on the items added to the panel at config time, but sometimes it might be useful to - * make sure a structural element is rendered even if not specified at config time (for example, you may want - * to add a button or toolbar dynamically after the panel has been rendered). Adding those elements to this - * list will allocate the required placeholders in the panel when it is rendered. Valid values are
        - *
      • header
      • - *
      • tbar (top bar)
      • - *
      • body
      • - *
      • bbar (bottom bar)
      • - *
      • footer
      • - *
      - * Defaults to 'body'. - */ + + elements : 'body', - /** - * @cfg {Boolean} preventBodyReset - * Defaults to false. When set to true, an extra css class 'x-panel-normal' - * will be added to the panel's element, effectively applying css styles suggested by the W3C - * (see http://www.w3.org/TR/CSS21/sample.html) to the Panel's body element (not the header, - * footer, etc.). - */ + preventBodyReset : false, - /** - * @cfg {Number/String} padding - * A shortcut for setting a padding style on the body element. The value can either be - * a number to be applied to all sides, or a normal css string describing padding. - * Defaults to undefined. - * - */ + padding: undefined, - /** @cfg {String} resizeEvent - * The event to listen to for resizing in layouts. Defaults to 'bodyresize'. - */ + resizeEvent: 'bodyresize', - // protected - these could be used to customize the behavior of the window, - // but changing them would not be useful without further mofifications and - // could lead to unexpected or undesirable results. + + + toolTarget : 'header', collapseEl : 'bwrap', slideAnchor : 't', disabledClass : '', - // private, notify box this class will handle heights + deferHeight : true, - // private + expandDefaults: { duration : 0.25 }, - // private + collapseDefaults : { duration : 0.25 }, - // private + initComponent : function(){ Ext.Panel.superclass.initComponent.call(this); this.addEvents( - /** - * @event bodyresize - * Fires after the Panel has been resized. - * @param {Ext.Panel} p the Panel which has been resized. - * @param {Number} width The Panel body's new width. - * @param {Number} height The Panel body's new height. - */ + 'bodyresize', - /** - * @event titlechange - * Fires after the Panel title has been {@link #title set} or {@link #setTitle changed}. - * @param {Ext.Panel} p the Panel which has had its title changed. - * @param {String} The new title. - */ + 'titlechange', - /** - * @event iconchange - * Fires after the Panel icon class has been {@link #iconCls set} or {@link #setIconClass changed}. - * @param {Ext.Panel} p the Panel which has had its {@link #iconCls icon class} changed. - * @param {String} The new icon class. - * @param {String} The old icon class. - */ + 'iconchange', - /** - * @event collapse - * Fires after the Panel has been collapsed. - * @param {Ext.Panel} p the Panel that has been collapsed. - */ + 'collapse', - /** - * @event expand - * Fires after the Panel has been expanded. - * @param {Ext.Panel} p The Panel that has been expanded. - */ + 'expand', - /** - * @event beforecollapse - * Fires before the Panel is collapsed. A handler can return false to cancel the collapse. - * @param {Ext.Panel} p the Panel being collapsed. - * @param {Boolean} animate True if the collapse is animated, else false. - */ + 'beforecollapse', - /** - * @event beforeexpand - * Fires before the Panel is expanded. A handler can return false to cancel the expand. - * @param {Ext.Panel} p The Panel being expanded. - * @param {Boolean} animate True if the expand is animated, else false. - */ + 'beforeexpand', - /** - * @event beforeclose - * Fires before the Panel is closed. Note that Panels do not directly support being closed, but some - * Panel subclasses do (like {@link Ext.Window}) or a Panel within a Ext.TabPanel. This event only - * applies to such subclasses. - * A handler can return false to cancel the close. - * @param {Ext.Panel} p The Panel being closed. - */ + 'beforeclose', - /** - * @event close - * Fires after the Panel is closed. Note that Panels do not directly support being closed, but some - * Panel subclasses do (like {@link Ext.Window}) or a Panel within a Ext.TabPanel. - * @param {Ext.Panel} p The Panel that has been closed. - */ + 'close', - /** - * @event activate - * Fires after the Panel has been visually activated. - * Note that Panels do not directly support being activated, but some Panel subclasses - * do (like {@link Ext.Window}). Panels which are child Components of a TabPanel fire the - * activate and deactivate events under the control of the TabPanel. - * @param {Ext.Panel} p The Panel that has been activated. - */ + 'activate', - /** - * @event deactivate - * Fires after the Panel has been visually deactivated. - * Note that Panels do not directly support being deactivated, but some Panel subclasses - * do (like {@link Ext.Window}). Panels which are child Components of a TabPanel fire the - * activate and deactivate events under the control of the TabPanel. - * @param {Ext.Panel} p The Panel that has been deactivated. - */ + 'deactivate' ); @@ -24293,7 +15071,7 @@ new Ext.Panel({ this.toolbars = []; - // shortcuts + if(this.tbar){ this.elements += ',tbar'; this.topToolbar = this.createToolbar(this.tbar); @@ -24330,7 +15108,7 @@ new Ext.Panel({ } }, - // private + createFbar : function(fbar){ var min = this.minButtonWidth; this.elements += ',footer'; @@ -24344,24 +15122,19 @@ new Ext.Panel({ }; } }); - // @compat addButton and buttons could possibly be removed - // @target 4.0 - /** - * This Panel's Array of buttons as created from the {@link #buttons} - * config property. Read only. - * @type Array - * @property buttons - */ + + + this.fbar.items.each(function(c){ c.minWidth = c.minWidth || this.minButtonWidth; }, this); this.buttons = this.fbar.items.items; }, - // private + createToolbar: function(tb, options){ var result; - // Convert array to proper toolbar config + if(Ext.isArray(tb)){ tb = { items: tb @@ -24372,7 +15145,7 @@ new Ext.Panel({ return result; }, - // private + createElement : function(name, pnode){ if(this[name]){ pnode.appendChild(this[name].dom); @@ -24396,7 +15169,7 @@ new Ext.Panel({ } }, - // private + onRender : function(ct, position){ Ext.Panel.superclass.onRender.call(this, ct, position); this.createClasses(); @@ -24423,7 +15196,7 @@ new Ext.Panel({ this.tools = {}; el.addClass(this.baseCls); - if(d.firstChild){ // existing markup + if(d.firstChild){ this.header = el.down('.'+this.headerCls); this.bwrap = el.down('.'+this.bwrapCls); var cp = this.bwrap ? this.bwrap : el; @@ -24444,16 +15217,16 @@ new Ext.Panel({ this.elements += ',footer'; } - // This block allows for maximum flexibility and performance when using existing markup + - // framing requires special markup + if(this.frame){ el.insertHtml('afterBegin', String.format(Ext.Element.boxMarkup, this.baseCls)); this.createElement('header', d.firstChild.firstChild.firstChild); this.createElement('bwrap', d); - // append the mid and bottom frame to the bwrap + bw = this.bwrap.dom; var ml = d.childNodes[1], bl = d.childNodes[2]; bw.appendChild(ml); @@ -24468,18 +15241,14 @@ new Ext.Panel({ if(!this.footer){ this.bwrap.dom.lastChild.className += ' x-panel-nofooter'; } - /* - * Store a reference to this element so: - * a) We aren't looking it up all the time - * b) The last element is reported incorrectly when using a loadmask - */ + this.ft = Ext.get(this.bwrap.dom.lastChild); this.mc = Ext.get(mc); }else{ this.createElement('header', d); this.createElement('bwrap', d); - // append the mid and bottom frame to the bwrap + bw = this.bwrap.dom; this.createElement('tbar', bw); this.createElement('body', bw); @@ -24524,7 +15293,7 @@ new Ext.Panel({ if(this.header){ this.header.unselectable(); - // for tools, we need to wrap any existing header markup + if(this.headerAsText){ this.header.dom.innerHTML = ''+this.header.dom.innerHTML+''; @@ -24547,7 +15316,7 @@ new Ext.Panel({ this.addTool.apply(this, ts); } - // Render Toolbars. + if(this.fbar){ this.footer.addClass('x-panel-btns'); this.fbar.ownerCt = this; @@ -24564,11 +15333,7 @@ new Ext.Panel({ } }, - /** - * Sets the CSS class that provides the icon image for this panel. This method will replace any existing - * icon class if one has already been set and fire the {@link #iconchange} event after completion. - * @param {String} cls The new CSS class name - */ + setIconClass : function(cls){ var old = this.iconCls; this.iconCls = cls; @@ -24594,7 +15359,7 @@ new Ext.Panel({ this.fireEvent('iconchange', this, cls, old); }, - // private + makeFloating : function(cfg){ this.floating = true; this.el = new Ext.Layer(Ext.apply({}, cfg, { @@ -24605,39 +15370,22 @@ new Ext.Panel({ }), this.el); }, - /** - * Returns the {@link Ext.Toolbar toolbar} from the top ({@link #tbar}) section of the panel. - * @return {Ext.Toolbar} The toolbar - */ + getTopToolbar : function(){ return this.topToolbar; }, - /** - * Returns the {@link Ext.Toolbar toolbar} from the bottom ({@link #bbar}) section of the panel. - * @return {Ext.Toolbar} The toolbar - */ + getBottomToolbar : function(){ return this.bottomToolbar; }, + - /** - * Returns the {@link Ext.Toolbar toolbar} from the footer ({@link #fbar}) section of the panel. - * @return {Ext.Toolbar} The toolbar - */ getFooterToolbar : function() { return this.fbar; }, - /** - * Adds a button to this panel. Note that this method must be called prior to rendering. The preferred - * approach is to add buttons via the {@link #buttons} config. - * @param {String/Object} config A valid {@link Ext.Button} config. A string will become the text for a default - * button config, an object will be treated as a button config object. - * @param {Function} handler The function to be called on button {@link Ext.Button#click} - * @param {Object} scope The scope (this reference) in which the button handler function is executed. Defaults to the Button. - * @return {Ext.Button} The button that was added - */ + addButton : function(config, handler, scope){ if(!this.fbar){ this.createFbar([]); @@ -24654,7 +15402,7 @@ new Ext.Panel({ return this.fbar.add(config); }, - // private + addTool : function(){ if(!this.rendered){ if(!this.tools){ @@ -24665,12 +15413,12 @@ new Ext.Panel({ }, this); return; } - // nowhere to render tools! + if(!this[this.toolTarget]){ return; } if(!this.toolTemplate){ - // initialize the global tool template on first use + var tt = new Ext.Template( '
       
      ' ); @@ -24736,7 +15484,7 @@ new Ext.Panel({ } }, - // private + onShow : function(){ if(this.floating){ return this.el.show(); @@ -24744,7 +15492,7 @@ new Ext.Panel({ Ext.Panel.superclass.onShow.call(this); }, - // private + onHide : function(){ if(this.floating){ return this.el.hide(); @@ -24752,7 +15500,7 @@ new Ext.Panel({ Ext.Panel.superclass.onHide.call(this); }, - // private + createToolHandler : function(t, tc, overCls, panel){ return function(e){ t.removeClass(overCls); @@ -24765,7 +15513,7 @@ new Ext.Panel({ }; }, - // private + afterRender : function(){ if(this.floating && !this.hidden){ this.el.show(); @@ -24773,7 +15521,7 @@ new Ext.Panel({ if(this.title){ this.setTitle(this.title); } - Ext.Panel.superclass.afterRender.call(this); // do sizing calcs last + Ext.Panel.superclass.afterRender.call(this); if (this.collapsed) { this.collapsed = false; this.collapse(false); @@ -24781,7 +15529,7 @@ new Ext.Panel({ this.initEvents(); }, - // private + getKeyMap : function(){ if(!this.keyMap){ this.keyMap = new Ext.KeyMap(this.el, this.keys); @@ -24789,7 +15537,7 @@ new Ext.Panel({ return this.keyMap; }, - // private + initEvents : function(){ if(this.keys){ this.getKeyMap(); @@ -24811,20 +15559,13 @@ new Ext.Panel({ }, - // private + initDraggable : function(){ - /** - *

      If this Panel is configured {@link #draggable}, this property will contain - * an instance of {@link Ext.dd.DragSource} which handles dragging the Panel.

      - * The developer must provide implementations of the abstract methods of {@link Ext.dd.DragSource} - * in order to supply behaviour for each stage of the drag/drop process. See {@link #draggable}. - * @type Ext.dd.DragSource. - * @property dd - */ + this.dd = new Ext.Panel.DD(this, Ext.isBoolean(this.draggable) ? null : this.draggable); }, - // private + beforeEffect : function(anim){ if(this.floating){ this.el.beforeAction(); @@ -24834,13 +15575,13 @@ new Ext.Panel({ } }, - // private + afterEffect : function(anim){ this.syncShadow(); this.el.removeClass('x-panel-animated'); }, - // private - wraps up an animation param with internal callbacks + createEffect : function(a, cb, scope){ var o = { scope:scope, @@ -24851,7 +15592,7 @@ new Ext.Panel({ return o; }else if(!a.callback){ o.callback = cb; - }else { // wrap it up + }else { o.callback = function(){ cb.call(scope); Ext.callback(a.callback, a.scope); @@ -24860,13 +15601,7 @@ new Ext.Panel({ return Ext.applyIf(o, a); }, - /** - * Collapses the panel body so that it becomes hidden. Fires the {@link #beforecollapse} event which will - * cancel the collapse action if it returns false. - * @param {Boolean} animate True to animate the transition, else false (defaults to the value of the - * {@link #animCollapse} panel config) - * @return {Ext.Panel} this - */ + collapse : function(animate){ if(this.collapsed || this.el.hasFxBlock() || this.fireEvent('beforecollapse', this, animate) === false){ return; @@ -24877,7 +15612,7 @@ new Ext.Panel({ return this; }, - // private + onCollapse : function(doAnim, animArg){ if(doAnim){ this[this.collapseEl].slideOut(this.slideAnchor, @@ -24889,7 +15624,7 @@ new Ext.Panel({ } }, - // private + afterCollapse : function(anim){ this.collapsed = true; this.el.addClass(this.collapsedCls); @@ -24898,22 +15633,16 @@ new Ext.Panel({ } this.afterEffect(anim); - // Reset lastSize of all sub-components so they KNOW they are in a collapsed container + this.cascade(function(c) { if (c.lastSize) { - c.lastSize = { width: 0, height: 0 }; + c.lastSize = { width: undefined, height: undefined }; } }); this.fireEvent('collapse', this); }, - /** - * Expands the panel body so that it becomes visible. Fires the {@link #beforeexpand} event which will - * cancel the expand action if it returns false. - * @param {Boolean} animate True to animate the transition, else false (defaults to the value of the - * {@link #animCollapse} panel config) - * @return {Ext.Panel} this - */ + expand : function(animate){ if(!this.collapsed || this.el.hasFxBlock() || this.fireEvent('beforeexpand', this, animate) === false){ return; @@ -24925,7 +15654,7 @@ new Ext.Panel({ return this; }, - // private + onExpand : function(doAnim, animArg){ if(doAnim){ this[this.collapseEl].slideIn(this.slideAnchor, @@ -24937,7 +15666,7 @@ new Ext.Panel({ } }, - // private + afterExpand : function(anim){ this.collapsed = false; if(anim !== false){ @@ -24951,18 +15680,13 @@ new Ext.Panel({ this.fireEvent('expand', this); }, - /** - * Shortcut for performing an {@link #expand} or {@link #collapse} based on the current state of the panel. - * @param {Boolean} animate True to animate the transition, else false (defaults to the value of the - * {@link #animCollapse} panel config) - * @return {Ext.Panel} this - */ + toggleCollapse : function(animate){ this[this.collapsed ? 'expand' : 'collapse'](animate); return this; }, - // private + onDisable : function(){ if(this.rendered && this.maskDisabled){ this.el.mask(); @@ -24970,7 +15694,7 @@ new Ext.Panel({ Ext.Panel.superclass.onDisable.call(this); }, - // private + onEnable : function(){ if(this.rendered && this.maskDisabled){ this.el.unmask(); @@ -24978,16 +15702,16 @@ new Ext.Panel({ Ext.Panel.superclass.onEnable.call(this); }, - // private + onResize : function(adjWidth, adjHeight, rawWidth, rawHeight){ var w = adjWidth, h = adjHeight; if(Ext.isDefined(w) || Ext.isDefined(h)){ if(!this.collapsed){ - // First, set the the Panel's body width. - // If we have auto-widthed it, get the resulting full offset width so we can size the Toolbars to match - // The Toolbars must not buffer this resize operation because we need to know their heights. + + + if(Ext.isNumber(w)){ this.body.setWidth(w = this.adjustBodyWidth(w - this.getFrameWidth())); @@ -25007,7 +15731,7 @@ new Ext.Panel({ this.bbar.setWidth(w); if(this.bottomToolbar){ this.bottomToolbar.setSize(w); - // The bbar does not move on resize without this. + if (Ext.isIE) { this.bbar.setStyle('position', 'static'); this.bbar.setStyle('position', ''); @@ -25021,10 +15745,10 @@ new Ext.Panel({ } } - // At this point, the Toolbars must be layed out for getFrameHeight to find a result. + if(Ext.isNumber(h)){ h = Math.max(0, h - this.getFrameHeight()); - //h = Math.max(0, h - (this.getHeight() - this.body.getHeight())); + this.body.setHeight(h); }else if(h == 'auto'){ this.body.setHeight(h); @@ -25034,7 +15758,7 @@ new Ext.Panel({ this.el._mask.setSize(this.el.dom.clientWidth, this.el.getHeight()); } }else{ - // Adds an event to set the correct height afterExpand. This accounts for the deferHeight flag in panel + this.queuedBodySize = {width: w, height: h}; if(!this.queuedExpand && this.allowQueuedExpand !== false){ this.queuedExpand = true; @@ -25051,12 +15775,12 @@ new Ext.Panel({ }, - // private + onBodyResize: function(w, h){ this.fireEvent('bodyresize', this, w, h); }, - // private + getToolbarHeight: function(){ var h = 0; if(this.rendered){ @@ -25067,26 +15791,22 @@ new Ext.Panel({ return h; }, - // deprecate + adjustBodyHeight : function(h){ return h; }, - // private + adjustBodyWidth : function(w){ return w; }, - // private + onPosition : function(){ this.syncShadow(); }, - /** - * Returns the width in pixels of the framing elements of this panel (not including the body width). To - * retrieve the body width see {@link #getInnerWidth}. - * @return {Number} The frame width - */ + getFrameWidth : function(){ var w = this.el.getFrameWidth('lr') + this.bwrap.getFrameWidth('lr'); @@ -25098,11 +15818,7 @@ new Ext.Panel({ return w; }, - /** - * Returns the height in pixels of the framing elements of this panel (including any top and bottom bars and - * header and footer elements, but not including the body height). To retrieve the body height see {@link #getInnerHeight}. - * @return {Number} The frame height - */ + getFrameHeight : function() { var h = Math.max(0, this.getHeight() - this.body.getHeight()); @@ -25111,67 +15827,38 @@ new Ext.Panel({ } return h; - /* Deprecate - var h = this.el.getFrameWidth('tb') + this.bwrap.getFrameWidth('tb'); - h += (this.tbar ? this.tbar.getHeight() : 0) + - (this.bbar ? this.bbar.getHeight() : 0); - - if(this.frame){ - h += this.el.dom.firstChild.offsetHeight + this.ft.dom.offsetHeight + this.mc.getFrameWidth('tb'); - }else{ - h += (this.header ? this.header.getHeight() : 0) + - (this.footer ? this.footer.getHeight() : 0); - } - return h; - */ + }, - /** - * Returns the width in pixels of the body element (not including the width of any framing elements). - * For the frame width see {@link #getFrameWidth}. - * @return {Number} The body width - */ + getInnerWidth : function(){ return this.getSize().width - this.getFrameWidth(); }, - /** - * Returns the height in pixels of the body element (not including the height of any framing elements). - * For the frame height see {@link #getFrameHeight}. - * @return {Number} The body height - */ + getInnerHeight : function(){ return this.body.getHeight(); - /* Deprecate - return this.getSize().height - this.getFrameHeight(); - */ + }, - // private + syncShadow : function(){ if(this.floating){ this.el.sync(true); } }, - // private + getLayoutTarget : function(){ return this.body; }, - // private + getContentTarget : function(){ return this.body; }, - /** - *

      Sets the title text for the panel and optionally the {@link #iconCls icon class}.

      - *

      In order to be able to set the title, a header element must have been created - * for the Panel. This is triggered either by configuring the Panel with a non-blank {@link #title}, - * or configuring it with {@link #header}: true.

      - * @param {String} title The title text to set - * @param {String} iconCls (optional) {@link #iconCls iconCls} A user-defined CSS class that provides the icon image for this panel - */ + setTitle : function(title, iconCls){ this.title = title; if(this.header && this.headerAsText){ @@ -25184,42 +15871,19 @@ new Ext.Panel({ return this; }, - /** - * Get the {@link Ext.Updater} for this panel. Enables you to perform Ajax updates of this panel's body. - * @return {Ext.Updater} The Updater - */ + getUpdater : function(){ return this.body.getUpdater(); }, - /** - * Loads this content panel immediately with content returned from an XHR call. - * @param {Object/String/Function} config A config object containing any of the following options: -
      
      -panel.load({
      -    url: 'your-url.php',
      -    params: {param1: 'foo', param2: 'bar'}, // or a URL encoded string
      -    callback: yourFunction,
      -    scope: yourObject, // optional scope for the callback
      -    discardUrl: false,
      -    nocache: false,
      -    text: 'Loading...',
      -    timeout: 30,
      -    scripts: false
      -});
      -
      - * The only required property is url. The optional properties nocache, text and scripts - * are shorthand for disableCaching, indicatorText and loadScripts and are used to set their - * associated property on this panel Updater instance. - * @return {Ext.Panel} this - */ + load : function(){ var um = this.body.getUpdater(); um.update.apply(um, arguments); return this; }, - // private + beforeDestroy : function(){ Ext.Panel.superclass.beforeDestroy.call(this); if(this.header){ @@ -25246,12 +15910,12 @@ panel.load({ this.ft, this.header, this.footer, - this.toolbars, this.tbar, this.bbar, this.body, this.mc, - this.bwrap + this.bwrap, + this.dd ); if (this.fbar) { Ext.destroy( @@ -25259,15 +15923,11 @@ panel.load({ this.fbar.el ); } - }else{ - Ext.destroy( - this.topToolbar, - this.bottomToolbar - ); } + Ext.destroy(this.toolbars); }, - // private + createClasses : function(){ this.headerCls = this.baseCls + '-header'; this.headerTextCls = this.baseCls + '-header-text'; @@ -25278,7 +15938,7 @@ panel.load({ this.footerCls = this.baseCls + '-footer'; }, - // private + createGhost : function(cls, useShim, appendTo){ var el = document.createElement('div'); el.className = 'x-panel-ghost ' + (cls ? cls : ''); @@ -25301,7 +15961,7 @@ panel.load({ } }, - // private + doAutoLoad : function(){ var u = this.body.getUpdater(); if(this.renderer){ @@ -25310,33 +15970,19 @@ panel.load({ u.update(Ext.isObject(this.autoLoad) ? this.autoLoad : {url: this.autoLoad}); }, - /** - * Retrieve a tool by id. - * @param {String} id - * @return {Object} tool - */ + getTool : function(id) { return this.tools[id]; } -/** - * @cfg {String} autoEl @hide - */ + }); Ext.reg('panel', Ext.Panel); -/** - * @class Ext.Editor - * @extends Ext.Component - * A base editor field that handles displaying/hiding on demand and has some built-in sizing and event handling logic. - * @constructor - * Create a new Editor - * @param {Object} config The config object - * @xtype editor - */ + Ext.Editor = function(field, config){ if(field.field){ this.field = Ext.create(field.field, 'textfield'); - config = Ext.apply({}, field); // copy so we don't disturb original config + config = Ext.apply({}, field); delete config.field; }else{ this.field = field; @@ -25345,135 +15991,51 @@ Ext.Editor = function(field, config){ }; Ext.extend(Ext.Editor, Ext.Component, { - /** - * @cfg {Ext.form.Field} field - * The Field object (or descendant) or config object for field - */ - /** - * @cfg {Boolean} allowBlur - * True to {@link #completeEdit complete the editing process} if in edit mode when the - * field is blurred. Defaults to true. - */ + + allowBlur: true, - /** - * @cfg {Boolean/String} autoSize - * True for the editor to automatically adopt the size of the underlying field, "width" to adopt the width only, - * or "height" to adopt the height only, "none" to always use the field dimensions. (defaults to false) - */ - /** - * @cfg {Boolean} revertInvalid - * True to automatically revert the field value and cancel the edit when the user completes an edit and the field - * validation fails (defaults to true) - */ - /** - * @cfg {Boolean} ignoreNoChange - * True to skip the edit completion process (no save, no events fired) if the user completes an edit and - * the value has not changed (defaults to false). Applies only to string values - edits for other data types - * will never be ignored. - */ - /** - * @cfg {Boolean} hideEl - * False to keep the bound element visible while the editor is displayed (defaults to true) - */ - /** - * @cfg {Mixed} value - * The data value of the underlying field (defaults to "") - */ + + + + + value : "", - /** - * @cfg {String} alignment - * The position to align to (see {@link Ext.Element#alignTo} for more details, defaults to "c-c?"). - */ + alignment: "c-c?", - /** - * @cfg {Array} offsets - * The offsets to use when aligning (see {@link Ext.Element#alignTo} for more details. Defaults to [0, 0]. - */ + offsets: [0, 0], - /** - * @cfg {Boolean/String} shadow "sides" for sides/bottom only, "frame" for 4-way shadow, and "drop" - * for bottom-right shadow (defaults to "frame") - */ + shadow : "frame", - /** - * @cfg {Boolean} constrain True to constrain the editor to the viewport - */ + constrain : false, - /** - * @cfg {Boolean} swallowKeys Handle the keydown/keypress events so they don't propagate (defaults to true) - */ + swallowKeys : true, - /** - * @cfg {Boolean} completeOnEnter True to complete the edit when the enter key is pressed. Defaults to true. - */ + completeOnEnter : true, - /** - * @cfg {Boolean} cancelOnEsc True to cancel the edit when the escape key is pressed. Defaults to true. - */ + cancelOnEsc : true, - /** - * @cfg {Boolean} updateEl True to update the innerHTML of the bound element when the update completes (defaults to false) - */ + updateEl : false, initComponent : function(){ Ext.Editor.superclass.initComponent.call(this); this.addEvents( - /** - * @event beforestartedit - * Fires when editing is initiated, but before the value changes. Editing can be canceled by returning - * false from the handler of this event. - * @param {Editor} this - * @param {Ext.Element} boundEl The underlying element bound to this editor - * @param {Mixed} value The field value being set - */ + "beforestartedit", - /** - * @event startedit - * Fires when this editor is displayed - * @param {Ext.Element} boundEl The underlying element bound to this editor - * @param {Mixed} value The starting field value - */ + "startedit", - /** - * @event beforecomplete - * Fires after a change has been made to the field, but before the change is reflected in the underlying - * field. Saving the change to the field can be canceled by returning false from the handler of this event. - * Note that if the value has not changed and ignoreNoChange = true, the editing will still end but this - * event will not fire since no edit actually occurred. - * @param {Editor} this - * @param {Mixed} value The current field value - * @param {Mixed} startValue The original field value - */ + "beforecomplete", - /** - * @event complete - * Fires after editing is complete and any changed value has been written to the underlying field. - * @param {Editor} this - * @param {Mixed} value The current field value - * @param {Mixed} startValue The original field value - */ + "complete", - /** - * @event canceledit - * Fires after editing has been canceled and the editor's value has been reset. - * @param {Editor} this - * @param {Mixed} value The user-entered field value that was discarded - * @param {Mixed} startValue The original field value that was set back into the editor after cancel - */ + "canceledit", - /** - * @event specialkey - * Fires when any key related to navigation (arrows, tab, enter, esc, etc.) is pressed. You can check - * {@link Ext.EventObject#getKey} to determine which key was pressed. - * @param {Ext.form.Field} this - * @param {Ext.EventObject} e The event object - */ + "specialkey" ); }, - // private + onRender : function(ct, position){ this.el = new Ext.Layer({ shadow: this.shadow, @@ -25504,13 +16066,13 @@ Ext.extend(Ext.Editor, Ext.Component, { this.field.getEl().dom.name = ''; if(this.swallowKeys){ this.field.el.swallowEvent([ - 'keypress', // *** Opera - 'keydown' // *** all other browsers + 'keypress', + 'keydown' ]); } }, - // private + onSpecialKey : function(field, e){ var key = e.getKey(), complete = this.completeOnEnter && key == e.ENTER, @@ -25529,12 +16091,7 @@ Ext.extend(Ext.Editor, Ext.Component, { this.fireEvent('specialkey', field, e); }, - /** - * Starts the editing process and shows the editor. - * @param {Mixed} el The element to edit - * @param {String} value (optional) A value to initialize the editor with. If a value is not provided, it defaults - * to the innerHTML of el. - */ + startEdit : function(el, value){ if(this.editing){ this.completeEdit(); @@ -25554,7 +16111,7 @@ Ext.extend(Ext.Editor, Ext.Component, { } }, - // private + doAutoSize : function(){ if(this.autoSize){ var sz = this.boundEl.getSize(), @@ -25576,27 +16133,20 @@ Ext.extend(Ext.Editor, Ext.Component, { } }, - /** - * Sets the height and width of this editor. - * @param {Number} width The new width - * @param {Number} height The new height - */ + setSize : function(w, h){ delete this.field.lastSize; this.field.setSize(w, h); if(this.el){ if(Ext.isGecko2 || Ext.isOpera){ - // prevent layer scrollbars + this.el.setSize(w, h); } this.el.sync(); } }, - /** - * Realigns the editor to the bound field based on the current alignment config value. - * @param {Boolean} autoSize (optional) True to size the field to the dimensions of the bound element. - */ + realign : function(autoSize){ if(autoSize === true){ this.doAutoSize(); @@ -25604,15 +16154,12 @@ Ext.extend(Ext.Editor, Ext.Component, { this.el.alignTo(this.boundEl, this.alignment, this.offsets); }, - /** - * Ends the editing process, persists the changed value to the underlying field, and hides the editor. - * @param {Boolean} remainVisible Override the default behavior and keep the editor visible after edit (defaults to false) - */ + completeEdit : function(remainVisible){ if(!this.editing){ return; } - // Assert combo values first + if (this.field.assertValue) { this.field.assertValue(); } @@ -25637,7 +16184,7 @@ Ext.extend(Ext.Editor, Ext.Component, { } }, - // private + onShow : function(){ this.el.show(); if(this.hideEl !== false){ @@ -25647,12 +16194,7 @@ Ext.extend(Ext.Editor, Ext.Component, { this.fireEvent("startedit", this.boundEl, this.startValue); }, - /** - * Cancels the editing process and hides the editor without persisting any changes. The field value will be - * reverted to the original starting value. - * @param {Boolean} remainVisible Override the default behavior and keep the editor visible after - * cancel (defaults to false) - */ + cancelEdit : function(remainVisible){ if(this.editing){ var v = this.getValue(); @@ -25662,7 +16204,7 @@ Ext.extend(Ext.Editor, Ext.Component, { } }, - // private + hideEdit: function(remainVisible){ if(remainVisible !== true){ this.editing = false; @@ -25670,15 +16212,15 @@ Ext.extend(Ext.Editor, Ext.Component, { } }, - // private + onBlur : function(){ - // selectSameEditor flag allows the same editor to be started without onBlur firing on itself + if(this.allowBlur === true && this.editing && this.selectSameEditor !== true){ this.completeEdit(); } }, - // private + onHide : function(){ if(this.editing){ this.completeEdit(); @@ -25694,18 +16236,12 @@ Ext.extend(Ext.Editor, Ext.Component, { } }, - /** - * Sets the data value of the editor - * @param {Mixed} value Any valid value supported by the underlying field - */ + setValue : function(v){ this.field.setValue(v); }, - /** - * Gets the data value of the editor - * @return {Mixed} The data value - */ + getValue : function(){ return this.field.getValue(); }, @@ -25718,71 +16254,22 @@ Ext.extend(Ext.Editor, Ext.Component, { } }); Ext.reg('editor', Ext.Editor); -/** - * @class Ext.ColorPalette - * @extends Ext.Component - * Simple color palette class for choosing colors. The palette can be rendered to any container.
      - * Here's an example of typical usage: - *
      
      -var cp = new Ext.ColorPalette({value:'993300'});  // initial selected color
      -cp.render('my-div');
      -
      -cp.on('select', function(palette, selColor){
      -    // do something with selColor
      -});
      -
      - * @constructor - * Create a new ColorPalette - * @param {Object} config The config object - * @xtype colorpalette - */ + Ext.ColorPalette = Ext.extend(Ext.Component, { - /** - * @cfg {String} tpl An existing XTemplate instance to be used in place of the default template for rendering the component. - */ - /** - * @cfg {String} itemCls - * The CSS class to apply to the containing element (defaults to 'x-color-palette') - */ + + itemCls : 'x-color-palette', - /** - * @cfg {String} value - * The initial color to highlight (should be a valid 6-digit color hex code without the # symbol). Note that - * the hex codes are case-sensitive. - */ + value : null, - /** - * @cfg {String} clickEvent - * The DOM event that will cause a color to be selected. This can be any valid event name (dblclick, contextmenu). - * Defaults to 'click'. - */ + clickEvent :'click', - // private + ctype : 'Ext.ColorPalette', - /** - * @cfg {Boolean} allowReselect If set to true then reselecting a color that is already selected fires the {@link #select} event - */ + allowReselect : false, - /** - *

      An array of 6-digit color hex code strings (without the # symbol). This array can contain any number - * of colors, and each hex code should be unique. The width of the palette is controlled via CSS by adjusting - * the width property of the 'x-color-palette' class (or assigning a custom class), so you can balance the number - * of colors with the width setting until the box is symmetrical.

      - *

      You can override individual colors if needed:

      - *
      
      -var cp = new Ext.ColorPalette();
      -cp.colors[0] = 'FF0000';  // change the first box to red
      -
      - -Or you can provide a custom array of your own for complete control: -
      
      -var cp = new Ext.ColorPalette();
      -cp.colors = ['000000', '993300', '333300'];
      -
      - * @type Array - */ + colors : [ '000000', '993300', '333300', '003300', '003366', '000080', '333399', '333333', '800000', 'FF6600', '808000', '008000', '008080', '0000FF', '666699', '808080', @@ -25791,30 +16278,14 @@ cp.colors = ['000000', '993300', '333300']; 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', '99CCFF', 'CC99FF', 'FFFFFF' ], - /** - * @cfg {Function} handler - * Optional. A function that will handle the select event of this palette. - * The handler is passed the following parameters:
        - *
      • palette : ColorPalette
        The {@link #palette Ext.ColorPalette}.
      • - *
      • color : String
        The 6-digit color hex code (without the # symbol).
      • - *
      - */ - /** - * @cfg {Object} scope - * The scope (this reference) in which the {@link #handler} - * function will be called. Defaults to this ColorPalette instance. - */ - // private + + + initComponent : function(){ Ext.ColorPalette.superclass.initComponent.call(this); this.addEvents( - /** - * @event select - * Fires when a color is selected - * @param {ColorPalette} this - * @param {String} color The 6-digit color hex code (without the # symbol) - */ + 'select' ); @@ -25823,7 +16294,7 @@ cp.colors = ['000000', '993300', '333300']; } }, - // private + onRender : function(container, position){ this.autoEl = { tag: 'div', @@ -25840,17 +16311,17 @@ cp.colors = ['000000', '993300', '333300']; } }, - // private + afterRender : function(){ Ext.ColorPalette.superclass.afterRender.call(this); if(this.value){ var s = this.value; this.value = null; - this.select(s); + this.select(s, true); } }, - // private + handleClick : function(e, t){ e.preventDefault(); if(!this.disabled){ @@ -25859,11 +16330,8 @@ cp.colors = ['000000', '993300', '333300']; } }, - /** - * Selects the specified color in the palette (fires the {@link #select} event) - * @param {String} color A valid 6-digit color hex code (# will be stripped if included) - */ - select : function(color){ + + select : function(color, suppressEvent){ color = color.replace('#', ''); if(color != this.value || this.allowReselect){ var el = this.el; @@ -25872,168 +16340,65 @@ cp.colors = ['000000', '993300', '333300']; } el.child('a.color-'+color).addClass('x-color-palette-sel'); this.value = color; - this.fireEvent('select', this, color); + if(suppressEvent !== true){ + this.fireEvent('select', this, color); + } } } - /** - * @cfg {String} autoEl @hide - */ + }); Ext.reg('colorpalette', Ext.ColorPalette); -/** - * @class Ext.DatePicker - * @extends Ext.Component - *

      A popup date picker. This class is used by the {@link Ext.form.DateField DateField} class - * to allow browsing and selection of valid dates.

      - *

      All the string values documented below may be overridden by including an Ext locale file in - * your page.

      - * @constructor - * Create a new DatePicker - * @param {Object} config The config object - * @xtype datepicker - */ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { - /** - * @cfg {String} todayText - * The text to display on the button that selects the current date (defaults to 'Today') - */ + todayText : 'Today', - /** - * @cfg {String} okText - * The text to display on the ok button (defaults to ' OK ' to give the user extra clicking room) - */ + okText : ' OK ', - /** - * @cfg {String} cancelText - * The text to display on the cancel button (defaults to 'Cancel') - */ + cancelText : 'Cancel', - /** - * @cfg {Function} handler - * Optional. A function that will handle the select event of this picker. - * The handler is passed the following parameters:
        - *
      • picker : DatePicker
        This DatePicker.
      • - *
      • date : Date
        The selected date.
      • - *
      - */ - /** - * @cfg {Object} scope - * The scope (this reference) in which the {@link #handler} - * function will be called. Defaults to this DatePicker instance. - */ - /** - * @cfg {String} todayTip - * A string used to format the message for displaying in a tooltip over the button that - * selects the current date. Defaults to '{0} (Spacebar)' where - * the {0} token is replaced by today's date. - */ + + + todayTip : '{0} (Spacebar)', - /** - * @cfg {String} minText - * The error text to display if the minDate validation fails (defaults to 'This date is before the minimum date') - */ + minText : 'This date is before the minimum date', - /** - * @cfg {String} maxText - * The error text to display if the maxDate validation fails (defaults to 'This date is after the maximum date') - */ + maxText : 'This date is after the maximum date', - /** - * @cfg {String} format - * The default date format string which can be overriden for localization support. The format must be - * valid according to {@link Date#parseDate} (defaults to 'm/d/y'). - */ + format : 'm/d/y', - /** - * @cfg {String} disabledDaysText - * The tooltip to display when the date falls on a disabled day (defaults to 'Disabled') - */ + disabledDaysText : 'Disabled', - /** - * @cfg {String} disabledDatesText - * The tooltip text to display when the date falls on a disabled date (defaults to 'Disabled') - */ + disabledDatesText : 'Disabled', - /** - * @cfg {Array} monthNames - * An array of textual month names which can be overriden for localization support (defaults to Date.monthNames) - */ + monthNames : Date.monthNames, - /** - * @cfg {Array} dayNames - * An array of textual day names which can be overriden for localization support (defaults to Date.dayNames) - */ + dayNames : Date.dayNames, - /** - * @cfg {String} nextText - * The next month navigation button tooltip (defaults to 'Next Month (Control+Right)') - */ + nextText : 'Next Month (Control+Right)', - /** - * @cfg {String} prevText - * The previous month navigation button tooltip (defaults to 'Previous Month (Control+Left)') - */ + prevText : 'Previous Month (Control+Left)', - /** - * @cfg {String} monthYearText - * The header month selector tooltip (defaults to 'Choose a month (Control+Up/Down to move years)') - */ + monthYearText : 'Choose a month (Control+Up/Down to move years)', - /** - * @cfg {Number} startDay - * Day index at which the week should begin, 0-based (defaults to 0, which is Sunday) - */ + startDay : 0, - /** - * @cfg {Boolean} showToday - * False to hide the footer area containing the Today button and disable the keyboard handler for spacebar - * that selects the current date (defaults to true). - */ + showToday : true, - /** - * @cfg {Date} minDate - * Minimum allowable date (JavaScript date object, defaults to null) - */ - /** - * @cfg {Date} maxDate - * Maximum allowable date (JavaScript date object, defaults to null) - */ - /** - * @cfg {Array} disabledDays - * An array of days to disable, 0-based. For example, [0, 6] disables Sunday and Saturday (defaults to null). - */ - /** - * @cfg {RegExp} disabledDatesRE - * JavaScript regular expression used to disable a pattern of dates (defaults to null). The {@link #disabledDates} - * config will generate this regex internally, but if you specify disabledDatesRE it will take precedence over the - * disabledDates value. - */ - /** - * @cfg {Array} disabledDates - * An array of 'dates' to disable, as strings. These strings will be used to build a dynamic regular - * expression so they are very powerful. Some examples: - *
        - *
      • ['03/08/2003', '09/16/2003'] would disable those exact dates
      • - *
      • ['03/08', '09/16'] would disable those days for every year
      • - *
      • ['^03/08'] would only match the beginning (useful if you are using short years)
      • - *
      • ['03/../2006'] would disable every day in March 2006
      • - *
      • ['^03'] would disable every day in every March
      • - *
      - * Note that the format of the dates included in the array should exactly match the {@link #format} config. - * In order to support regular expressions, if you are using a date format that has '.' in it, you will have to - * escape the dot when restricting dates. For example: ['03\\.08\\.03']. - */ + + + + + - // private - // Set by other components to stop the picker focus being updated when the value changes. + + focusOnSelect: true, - // default value used to initialise each date in the DatePicker - // (note: 12 noon was chosen because it steers well clear of all DST timezone changes) - initHour: 12, // 24-hour format + + + initHour: 12, - // private + initComponent : function(){ Ext.DatePicker.superclass.initComponent.call(this); @@ -26041,12 +16406,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { this.value.clearTime(true) : new Date().clearTime(); this.addEvents( - /** - * @event select - * Fires when a date is selected - * @param {DatePicker} this DatePicker - * @param {Date} date The selected date - */ + 'select' ); @@ -26057,7 +16417,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { this.initDisabledDays(); }, - // private + initDisabledDays : function(){ if(!this.disabledDatesRE && this.disabledDates){ var dd = this.disabledDates, @@ -26074,11 +16434,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { } }, - /** - * Replaces any existing disabled dates with new values and refreshes the DatePicker. - * @param {Array/RegExp} disabledDates An array of date strings (see the {@link #disabledDates} config - * for details on supported values), or a JavaScript regular expression used to disable a pattern of dates. - */ + setDisabledDates : function(dd){ if(Ext.isArray(dd)){ this.disabledDates = dd; @@ -26090,57 +16446,41 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { this.update(this.value, true); }, - /** - * Replaces any existing disabled days (by index, 0-6) with new values and refreshes the DatePicker. - * @param {Array} disabledDays An array of disabled day indexes. See the {@link #disabledDays} config - * for details on supported values. - */ + setDisabledDays : function(dd){ this.disabledDays = dd; this.update(this.value, true); }, - /** - * Replaces any existing {@link #minDate} with the new value and refreshes the DatePicker. - * @param {Date} value The minimum date that can be selected - */ + setMinDate : function(dt){ this.minDate = dt; this.update(this.value, true); }, - /** - * Replaces any existing {@link #maxDate} with the new value and refreshes the DatePicker. - * @param {Date} value The maximum date that can be selected - */ + setMaxDate : function(dt){ this.maxDate = dt; this.update(this.value, true); }, - /** - * Sets the value of the date field - * @param {Date} value The date to set - */ + setValue : function(value){ this.value = value.clearTime(true); this.update(this.value); }, - /** - * Gets the current selected value of the date field - * @return {Date} The selected date - */ + getValue : function(){ return this.value; }, - // private + focus : function(){ this.update(this.activeDate); }, - // private + onEnable: function(initial){ Ext.DatePicker.superclass.onEnable.call(this); this.doDisabled(false); @@ -26151,22 +16491,19 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { }, - // private + onDisable : function(){ Ext.DatePicker.superclass.onDisable.call(this); this.doDisabled(true); if(Ext.isIE && !Ext.isIE8){ - /* Really strange problem in IE6/7, when disabled, have to explicitly - * repaint each of the nodes to get them to display correctly, simply - * calling repaint on the main element doesn't appear to be enough. - */ + Ext.each([].concat(this.textNodes, this.el.query('th span')), function(el){ Ext.fly(el).repaint(); }); } }, - // private + doDisabled : function(disabled){ this.keyNav.setDisabled(disabled); this.prevRepeater.setDisabled(disabled); @@ -26177,7 +16514,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { } }, - // private + onRender : function(container, position){ var m = [ '
  • ', @@ -26307,7 +16644,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { this.onEnable(true); }, - // private + createMonthPicker : function(){ if(!this.monthPicker.dom.firstChild){ var buf = ['
    ']; @@ -26347,7 +16684,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { } }, - // private + showMonthPicker : function(){ if(!this.disabled){ this.createMonthPicker(); @@ -26364,7 +16701,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { } }, - // private + updateMPYear : function(y){ this.mpyear = y; var ys = this.mpYears.elements; @@ -26383,19 +16720,19 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { } }, - // private + updateMPMonth : function(sm){ this.mpMonths.each(function(m, a, i){ m[m.dom.xmonth == sm ? 'addClass' : 'removeClass']('x-date-mp-sel'); }); }, - // private + selectMPMonth : function(m){ }, - // private + onMonthClick : function(e, t){ e.stopEvent(); var el = new Ext.Element(t), pn; @@ -26405,7 +16742,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { else if(el.is('button.x-date-mp-ok')){ var d = new Date(this.mpSelYear, this.mpSelMonth, (this.activeDate || this.value).getDate()); if(d.getMonth() != this.mpSelMonth){ - // 'fix' the JS rolling date conversion if needed + d = new Date(this.mpSelYear, this.mpSelMonth, 1).getLastDateOfMonth(); } this.update(d); @@ -26429,7 +16766,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { } }, - // private + onMonthDblClick : function(e, t){ e.stopEvent(); var el = new Ext.Element(t), pn; @@ -26443,7 +16780,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { } }, - // private + hideMonthPicker : function(disableAnim){ if(this.monthPicker){ if(disableAnim === true){ @@ -26454,27 +16791,27 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { } }, - // private + showPrevMonth : function(e){ this.update(this.activeDate.add('mo', -1)); }, - // private + showNextMonth : function(e){ this.update(this.activeDate.add('mo', 1)); }, - // private + showPrevYear : function(){ this.update(this.activeDate.add('y', -1)); }, - // private + showNextYear : function(){ this.update(this.activeDate.add('y', 1)); }, - // private + handleMouseWheel : function(e){ e.stopEvent(); if(!this.disabled){ @@ -26487,7 +16824,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { } }, - // private + handleDateClick : function(e, t){ e.stopEvent(); if(!this.disabled && t.dateValue && !Ext.fly(t.parentNode).hasClass('x-date-disabled')){ @@ -26498,7 +16835,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { } }, - // private + selectToday : function(){ if(this.todayBtn && !this.todayBtn.disabled){ this.setValue(new Date().clearTime()); @@ -26506,7 +16843,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { } }, - // private + update : function(date, forceRefresh){ if(this.rendered){ var vd = this.activeDate, vis = this.isVisible(); @@ -26540,7 +16877,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { prevStart = pm.getDaysInMonth()-startingPos, cells = this.cells.elements, textEls = this.textNodes, - // convert everything to numbers so it's fast + d = (new Date(pm.getFullYear(), pm.getMonth(), prevStart, this.initHour)), today = new Date().clearTime().getTime(), sel = date.clearTime(true).getTime(), @@ -26578,7 +16915,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { Ext.fly(cell.firstChild).focus(50); } } - // disabling + if(t < min) { cell.className = ' x-date-disabled'; cell.title = cal.minText; @@ -26634,9 +16971,9 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { this.el.setWidth(w + this.el.getBorderWidth('lr')); Ext.fly(main).setWidth(w); this.internalRender = true; - // opera does not respect the auto grow header center column - // then, after it gets a width opera refuses to recalculate - // without a second pass + + + if(Ext.isOpera && !this.secondPass){ main.rows[0].cells[1].style.width = (w - (main.rows[0].cells[0].offsetWidth+main.rows[0].cells[2].offsetWidth)) + 'px'; this.secondPass = true; @@ -26646,7 +16983,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { } }, - // private + beforeDestroy : function() { if(this.rendered){ Ext.destroy( @@ -26664,29 +17001,11 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, { } } - /** - * @cfg {String} autoEl @hide - */ + }); Ext.reg('datepicker', Ext.DatePicker); -/** - * @class Ext.LoadMask - * A simple utility class for generically masking elements while loading data. If the {@link #store} - * config option is specified, the masking will be automatically synchronized with the store's loading - * process and the mask element will be cached for reuse. For all other elements, this mask will replace the - * element's Updater load indicator and will be destroyed after the initial load. - *

    Example usage:

    - *
    
    -// Basic mask:
    -var myMask = new Ext.LoadMask(Ext.getBody(), {msg:"Please wait..."});
    -myMask.show();
    -
    - * @constructor - * Create a new LoadMask - * @param {Mixed} el The element or DOM node, or its id - * @param {Object} config The config object - */ + Ext.LoadMask = function(el, config){ this.el = Ext.get(el); Ext.apply(this, config); @@ -26700,7 +17019,7 @@ Ext.LoadMask = function(el, config){ this.removeMask = Ext.value(this.removeMask, false); }else{ var um = this.el.getUpdater(); - um.showLoadIndicator = false; // disable the default indicator + um.showLoadIndicator = false; um.on({ scope: this, beforeupdate: this.onBeforeLoad, @@ -26712,74 +17031,49 @@ Ext.LoadMask = function(el, config){ }; Ext.LoadMask.prototype = { - /** - * @cfg {Ext.data.Store} store - * Optional Store to which the mask is bound. The mask is displayed when a load request is issued, and - * hidden on either load sucess, or load fail. - */ - /** - * @cfg {Boolean} removeMask - * True to create a single-use mask that is automatically destroyed after loading (useful for page loads), - * False to persist the mask element reference for multiple uses (e.g., for paged data widgets). Defaults to false. - */ - /** - * @cfg {String} msg - * The text to display in a centered loading message box (defaults to 'Loading...') - */ + + + msg : 'Loading...', - /** - * @cfg {String} msgCls - * The CSS class to apply to the loading message element (defaults to "x-mask-loading") - */ + msgCls : 'x-mask-loading', - /** - * Read-only. True if the mask is currently disabled so that it will not be displayed (defaults to false) - * @type Boolean - */ + disabled: false, - /** - * Disables the mask to prevent it from being displayed - */ + disable : function(){ this.disabled = true; }, - /** - * Enables the mask so that it can be displayed - */ + enable : function(){ this.disabled = false; }, - // private + onLoad : function(){ this.el.unmask(this.removeMask); }, - // private + onBeforeLoad : function(){ if(!this.disabled){ this.el.mask(this.msg, this.msgCls); } }, - /** - * Show this LoadMask over the configured Element. - */ + show: function(){ this.onBeforeLoad(); }, - /** - * Hide this LoadMask. - */ + hide: function(){ this.onLoad(); }, - // private + destroy : function(){ if(this.store){ this.store.un('beforeload', this.onBeforeLoad, this); @@ -26794,30 +17088,16 @@ Ext.LoadMask.prototype = { } };Ext.ns('Ext.slider'); -/** - * @class Ext.slider.Thumb - * @extends Object - * Represents a single thumb element on a Slider. This would not usually be created manually and would instead - * be created internally by an {@link Ext.slider.MultiSlider Ext.Slider}. - */ + Ext.slider.Thumb = Ext.extend(Object, { - /** - * @constructor - * @cfg {Ext.slider.MultiSlider} slider The Slider to render to (required) - */ + constructor: function(config) { - /** - * @property slider - * @type Ext.slider.MultiSlider - * The slider this thumb is contained within - */ + Ext.apply(this, config || {}, { cls: 'x-slider-thumb', - /** - * @cfg {Boolean} constrain True to constrain the thumb so that it cannot overlap its siblings - */ + constrain: false }); @@ -26828,34 +17108,26 @@ Ext.slider.Thumb = Ext.extend(Object, { } }, - /** - * Renders the thumb into a slider - */ + render: function() { this.el = this.slider.innerEl.insertFirst({cls: this.cls}); this.initEvents(); }, - /** - * Enables the thumb if it is currently disabled - */ + enable: function() { this.disabled = false; this.el.removeClass(this.slider.disabledClass); }, - /** - * Disables the thumb if it is currently enabled - */ + disable: function() { this.disabled = true; this.el.addClass(this.slider.disabledClass); }, - /** - * Sets up an Ext.dd.DragTracker for this thumb - */ + initEvents: function() { var el = this.el; @@ -26873,12 +17145,7 @@ Ext.slider.Thumb = Ext.extend(Object, { this.tracker.initEl(el); }, - /** - * @private - * This is tied into the internal Ext.dd.DragTracker. If the slider is currently disabled, - * this returns false to disable the DragTracker too. - * @return {Boolean} False if the slider is currently disabled - */ + onBeforeDragStart : function(e) { if (this.disabled) { return false; @@ -26888,11 +17155,7 @@ Ext.slider.Thumb = Ext.extend(Object, { } }, - /** - * @private - * This is tied into the internal Ext.dd.DragTracker's onStart template method. Adds the drag CSS class - * to the thumb and fires the 'dragstart' event - */ + onDragStart: function(e){ this.el.addClass('x-slider-thumb-drag'); this.dragging = true; @@ -26901,11 +17164,7 @@ Ext.slider.Thumb = Ext.extend(Object, { this.slider.fireEvent('dragstart', this.slider, e, this); }, - /** - * @private - * This is tied into the internal Ext.dd.DragTracker's onDrag template method. This is called every time - * the DragTracker detects a drag movement. It updates the Slider's value using the position of the drag - */ + onDrag: function(e) { var slider = this.slider, index = this.index, @@ -26930,11 +17189,7 @@ Ext.slider.Thumb = Ext.extend(Object, { return Ext.util.Format.round(slider.reverseValue(pos.left), slider.decimalPrecision); }, - /** - * @private - * This is tied to the internal Ext.dd.DragTracker's onEnd template method. Removes the drag CSS class and - * fires the 'changecomplete' event with the new value - */ + onDragEnd: function(e) { var slider = this.slider, value = this.value; @@ -26950,178 +17205,72 @@ Ext.slider.Thumb = Ext.extend(Object, { } }); -/** - * @class Ext.slider.MultiSlider - * @extends Ext.BoxComponent - * Slider which supports vertical or horizontal orientation, keyboard adjustments, configurable snapping, axis clicking and animation. Can be added as an item to any container. Example usage: -
    -new Ext.Slider({
    -    renderTo: Ext.getBody(),
    -    width: 200,
    -    value: 50,
    -    increment: 10,
    -    minValue: 0,
    -    maxValue: 100
    -});
    -
    - * Sliders can be created with more than one thumb handle by passing an array of values instead of a single one: -
    -new Ext.Slider({
    -    renderTo: Ext.getBody(),
    -    width: 200,
    -    values: [25, 50, 75],
    -    minValue: 0,
    -    maxValue: 100,
     
    -    //this defaults to true, setting to false allows the thumbs to pass each other
    -    {@link #constrainThumbs}: false
    -});
    -
    - */ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { - /** - * @cfg {Number} value The value to initialize the slider with. Defaults to minValue. - */ - /** - * @cfg {Boolean} vertical Orient the Slider vertically rather than horizontally, defaults to false. - */ + + vertical: false, - /** - * @cfg {Number} minValue The minimum value for the Slider. Defaults to 0. - */ + minValue: 0, - /** - * @cfg {Number} maxValue The maximum value for the Slider. Defaults to 100. - */ + maxValue: 100, - /** - * @cfg {Number/Boolean} decimalPrecision. - *

    The number of decimal places to which to round the Slider's value. Defaults to 0.

    - *

    To disable rounding, configure as false.

    - */ + decimalPrecision: 0, - /** - * @cfg {Number} keyIncrement How many units to change the Slider when adjusting with keyboard navigation. Defaults to 1. If the increment config is larger, it will be used instead. - */ + keyIncrement: 1, - /** - * @cfg {Number} increment How many units to change the slider when adjusting by drag and drop. Use this option to enable 'snapping'. - */ + increment: 0, - /** - * @private - * @property clickRange - * @type Array - * Determines whether or not a click to the slider component is considered to be a user request to change the value. Specified as an array of [top, bottom], - * the click event's 'top' property is compared to these numbers and the click only considered a change request if it falls within them. e.g. if the 'top' - * value of the click event is 4 or 16, the click is not considered a change request as it falls outside of the [5, 15] range - */ + clickRange: [5,15], - /** - * @cfg {Boolean} clickToChange Determines whether or not clicking on the Slider axis will change the slider. Defaults to true - */ + clickToChange : true, - /** - * @cfg {Boolean} animate Turn on or off animation. Defaults to true - */ + animate: true, - /** - * True while the thumb is in a drag operation - * @type Boolean - */ + dragging: false, - /** - * @cfg {Boolean} constrainThumbs True to disallow thumbs from overlapping one another. Defaults to true - */ + constrainThumbs: true, - /** - * @private - * @property topThumbZIndex - * @type Number - * The number used internally to set the z index of the top thumb (see promoteThumb for details) - */ + topThumbZIndex: 10000, - // private override + initComponent : function(){ if(!Ext.isDefined(this.value)){ this.value = this.minValue; } - /** - * @property thumbs - * @type Array - * Array containing references to each thumb - */ + this.thumbs = []; Ext.slider.MultiSlider.superclass.initComponent.call(this); this.keyIncrement = Math.max(this.increment, this.keyIncrement); this.addEvents( - /** - * @event beforechange - * Fires before the slider value is changed. By returning false from an event handler, - * you can cancel the event and prevent the slider from changing. - * @param {Ext.Slider} slider The slider - * @param {Number} newValue The new value which the slider is being changed to. - * @param {Number} oldValue The old value which the slider was previously. - */ + 'beforechange', - /** - * @event change - * Fires when the slider value is changed. - * @param {Ext.Slider} slider The slider - * @param {Number} newValue The new value which the slider has been changed to. - * @param {Ext.slider.Thumb} thumb The thumb that was changed - */ + 'change', - /** - * @event changecomplete - * Fires when the slider value is changed by the user and any drag operations have completed. - * @param {Ext.Slider} slider The slider - * @param {Number} newValue The new value which the slider has been changed to. - * @param {Ext.slider.Thumb} thumb The thumb that was changed - */ + 'changecomplete', - /** - * @event dragstart - * Fires after a drag operation has started. - * @param {Ext.Slider} slider The slider - * @param {Ext.EventObject} e The event fired from Ext.dd.DragTracker - */ + 'dragstart', - /** - * @event drag - * Fires continuously during the drag operation while the mouse is moving. - * @param {Ext.Slider} slider The slider - * @param {Ext.EventObject} e The event fired from Ext.dd.DragTracker - */ + 'drag', - /** - * @event dragend - * Fires after the drag operation has completed. - * @param {Ext.Slider} slider The slider - * @param {Ext.EventObject} e The event fired from Ext.dd.DragTracker - */ + 'dragend' ); - /** - * @property values - * @type Array - * Array of values to initalize the thumbs with - */ + if (this.values == undefined || Ext.isEmpty(this.values)) this.values = [0]; var values = this.values; @@ -27135,10 +17284,7 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { } }, - /** - * Creates a new thumb and adds it to the slider - * @param {Number} value The initial value to set on the thumb. Defaults to 0 - */ + addThumb: function(value) { var thumb = new Ext.slider.Thumb({ value : value, @@ -27148,18 +17294,11 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { }); this.thumbs.push(thumb); - //render the thumb now if needed + if (this.rendered) thumb.render(); }, - /** - * @private - * Moves the given thumb above all other by increasing its z-index. This is called when as drag - * any thumb, so that the thumb that was just dragged is always at the highest z-index. This is - * required when the thumbs are stacked on top of each other at one of the ends of the slider's - * range, which can result in the user not being able to move any of them. - * @param {Ext.slider.Thumb} topThumb The thumb to move to the top - */ + promoteThumb: function(topThumb) { var thumbs = this.thumbs, zIndex, thumb; @@ -27177,7 +17316,7 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { } }, - // private override + onRender : function() { this.autoEl = { cls: 'x-slider ' + (this.vertical ? 'x-slider-vert' : 'x-slider-horz'), @@ -27196,23 +17335,19 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { this.innerEl = this.endEl.first(); this.focusEl = this.innerEl.child('.x-slider-focus'); - //render each thumb + for (var i=0; i < this.thumbs.length; i++) { this.thumbs[i].render(); } - //calculate the size of half a thumb + var thumb = this.innerEl.child('.x-slider-thumb'); this.halfThumb = (this.vertical ? thumb.getHeight() : thumb.getWidth()) / 2; this.initEvents(); }, - /** - * @private - * Adds keyboard and mouse listeners on this.el. Ignores click events on the internal focus element. - * Creates a new DragTracker which is used to control what happens when the user drags the thumb around. - */ + initEvents : function(){ this.mon(this.el, { scope : this, @@ -27223,18 +17358,13 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { this.focusEl.swallowEvent("click", true); }, - /** - * @private - * Mousedown handler for the slider. If the clickToChange is enabled and the click was not on the draggable 'thumb', - * this calculates the new value of the slider and tells the implementation (Horizontal or Vertical) to move the thumb - * @param {Ext.EventObject} e The click event - */ + onMouseDown : function(e){ if(this.disabled){ return; } - //see if the click was on any of the thumbs + var thumbClicked = false; for (var i=0; i < this.thumbs.length; i++) { thumbClicked = thumbClicked || e.target == this.thumbs[i].el.dom; @@ -27247,15 +17377,10 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { this.focus(); }, - /** - * @private - * Moves the thumb to the indicated position. Note that a Vertical implementation is provided in Ext.slider.Vertical. - * Only changes the value if the click was within this.clickRange. - * @param {Object} local Object containing top and left values for the click event. - */ + onClickChange : function(local) { if (local.top > this.clickRange[0] && local.top < this.clickRange[1]) { - //find the nearest thumb to the click event + var thumb = this.getNearest(local, 'left'), index = thumb.index; @@ -27263,17 +17388,11 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { } }, - /** - * @private - * Returns the nearest thumb to a click event, along with its distance - * @param {Object} local Object containing top and left values from a click event - * @param {String} prop The property of local to compare on. Use 'left' for horizontal sliders, 'top' for vertical ones - * @return {Object} The closest thumb object and its distance from the click event - */ + getNearest: function(local, prop) { var localValue = prop == 'top' ? this.innerEl.getHeight() - local[prop] : local[prop], clickValue = this.reverseValue(localValue), - nearestDistance = (this.maxValue - this.minValue) + 5, //add a small fudge for the end of the slider + nearestDistance = (this.maxValue - this.minValue) + 5, index = 0, nearest = null; @@ -27291,46 +17410,34 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { return nearest; }, - /** - * @private - * Handler for any keypresses captured by the slider. If the key is UP or RIGHT, the thumb is moved along to the right - * by this.keyIncrement. If DOWN or LEFT it is moved left. Pressing CTRL moves the slider to the end in either direction - * @param {Ext.EventObject} e The Event object - */ + onKeyDown : function(e){ - if(this.disabled){e.preventDefault();return;} - var k = e.getKey(); + + if(this.disabled || this.thumbs.length !== 1){ + e.preventDefault(); + return; + } + var k = e.getKey(), + val; switch(k){ case e.UP: case e.RIGHT: e.stopEvent(); - if(e.ctrlKey){ - this.setValue(this.maxValue, undefined, true); - }else{ - this.setValue(this.value+this.keyIncrement, undefined, true); - } + val = e.ctrlKey ? this.maxValue : this.getValue(0) + this.keyIncrement; + this.setValue(0, val, undefined, true); break; case e.DOWN: case e.LEFT: e.stopEvent(); - if(e.ctrlKey){ - this.setValue(this.minValue, undefined, true); - }else{ - this.setValue(this.value-this.keyIncrement, undefined, true); - } + val = e.ctrlKey ? this.minValue : this.getValue(0) - this.keyIncrement; + this.setValue(0, val, undefined, true); break; default: e.preventDefault(); } }, - /** - * @private - * If using snapping, this takes a desired new value and returns the closest snapped - * value to it - * @param {Number} value The unsnapped value - * @return {Number} The value of the nearest snap target - */ + doSnap : function(value){ if (!(this.increment && value)) { return value; @@ -27349,7 +17456,7 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { return newValue.constrain(this.minValue, this.maxValue); }, - // private + afterRender : function(){ Ext.slider.MultiSlider.superclass.afterRender.apply(this, arguments); @@ -27360,7 +17467,7 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { var v = this.normalizeValue(thumb.value); if (v !== thumb.value) { - // delete this.value; + this.setValue(i, v, false); } else { this.moveThumb(i, this.translateValue(v), false); @@ -27369,24 +17476,14 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { }; }, - /** - * @private - * Returns the ratio of pixels to mapped values. e.g. if the slider is 200px wide and maxValue - minValue is 100, - * the ratio is 2 - * @return {Number} The ratio of pixels to mapped values - */ + getRatio : function(){ var w = this.innerEl.getWidth(), v = this.maxValue - this.minValue; return v == 0 ? w : (w/v); }, - /** - * @private - * Returns a snapped, constrained value when given a desired value - * @param {Number} value Raw number value - * @return {Number} The raw value rounded to the correct d.p. and constrained within the set max and min values - */ + normalizeValue : function(v){ v = this.doSnap(v); v = Ext.util.Format.round(v, this.decimalPrecision); @@ -27394,82 +17491,68 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { return v; }, - /** - * Sets the minimum value for the slider instance. If the current value is less than the - * minimum value, the current value will be changed. - * @param {Number} val The new minimum value - */ + setMinValue : function(val){ this.minValue = val; - this.syncThumb(); - - for (var i=0, j = this.thumbs.length; i < j; i++) { - if (this.thumbs[i].value < val) this.thumbs[i].value = val; + var i = 0, + thumbs = this.thumbs, + len = thumbs.length, + t; + + for(; i < len; ++i){ + t = thumbs[i]; + t.value = t.value < val ? val : t.value; } + this.syncThumb(); }, - /** - * Sets the maximum value for the slider instance. If the current value is more than the - * maximum value, the current value will be changed. - * @param {Number} val The new maximum value - */ + setMaxValue : function(val){ this.maxValue = val; - this.syncThumb(); - - for (var i=0; i < this.thumbs.length; i++) { - if (this.thumbs[i].value > val) this.thumbs[i].value = val; + var i = 0, + thumbs = this.thumbs, + len = thumbs.length, + t; + + for(; i < len; ++i){ + t = thumbs[i]; + t.value = t.value > val ? val : t.value; } + this.syncThumb(); }, - /** - * Programmatically sets the value of the Slider. Ensures that the value is constrained within - * the minValue and maxValue. - * @param {Number} index Index of the thumb to move - * @param {Number} value The value to set the slider to. (This will be constrained within minValue and maxValue) - * @param {Boolean} animate Turn on or off animation, defaults to true - */ + setValue : function(index, v, animate, changeComplete) { var thumb = this.thumbs[index], el = thumb.el; v = this.normalizeValue(v); - if (v !== thumb.value && this.fireEvent('beforechange', this, v, thumb.value) !== false) { + if (v !== thumb.value && this.fireEvent('beforechange', this, v, thumb.value, thumb) !== false) { thumb.value = v; - this.moveThumb(index, this.translateValue(v), animate !== false); - this.fireEvent('change', this, v, thumb); - if(changeComplete){ - this.fireEvent('changecomplete', this, v, thumb); + if(this.rendered){ + this.moveThumb(index, this.translateValue(v), animate !== false); + this.fireEvent('change', this, v, thumb); + if(changeComplete){ + this.fireEvent('changecomplete', this, v, thumb); + } } } }, - /** - * @private - */ + translateValue : function(v) { var ratio = this.getRatio(); return (v * ratio) - (this.minValue * ratio) - this.halfThumb; }, - /** - * @private - * Given a pixel location along the slider, returns the mapped slider value for that pixel. - * E.g. if we have a slider 200px wide with minValue = 100 and maxValue = 500, reverseValue(50) - * returns 200 - * @param {Number} pos The position along the slider to return a mapped value for - * @return {Number} The mapped value for the given position - */ + reverseValue : function(pos){ var ratio = this.getRatio(); return (pos + (this.minValue * ratio)) / ratio; }, - /** - * @private - * @param {Number} index Index of the thumb to move - */ + moveThumb: function(index, v, animate){ var thumb = this.thumbs[index].el; @@ -27480,21 +17563,18 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { } }, - // private + focus : function(){ this.focusEl.focus(10); }, - // private + onResize : function(w, h){ var thumbs = this.thumbs, len = thumbs.length, i = 0; - /* - * If we happen to be animating during a resize, the position of the thumb will likely be off - * when the animation stops. As such, just stop any animations before syncing the thumbs. - */ + for(; i < len; ++i){ thumbs[i].el.stopFx(); } @@ -27503,7 +17583,7 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { Ext.slider.MultiSlider.superclass.onResize.apply(this, arguments); }, - //private + onDisable: function(){ Ext.slider.MultiSlider.superclass.onDisable.call(this); @@ -27514,8 +17594,8 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { thumb.disable(); if(Ext.isIE){ - //IE breaks when using overflow visible and opacity other than 1. - //Create a place holder for the thumb and display it. + + var xy = el.getXY(); el.hide(); @@ -27530,7 +17610,7 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { } }, - //private + onEnable: function(){ Ext.slider.MultiSlider.superclass.onEnable.call(this); @@ -27551,12 +17631,7 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { } }, - /** - * Synchronizes the thumb position to the proper proportion of the total component width based - * on the current slider {@link #value}. This will be called automatically when the Slider - * is resized by a layout, but if it is rendered auto width, this method can be called from - * another resize handler to sync the Slider if necessary. - */ + syncThumb : function() { if (this.rendered) { for (var i=0; i < this.thumbs.length; i++) { @@ -27565,19 +17640,12 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { } }, - /** - * Returns the current value of the slider - * @param {Number} index The index of the thumb to return a value for - * @return {Number} The current value of the slider - */ + getValue : function(index) { return this.thumbs[index].value; }, - /** - * Returns an array of values - one for the location of each thumb - * @return {Array} The set of thumb values - */ + getValues: function() { var values = []; @@ -27588,7 +17656,7 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { return values; }, - // private + beforeDestroy : function(){ Ext.destroyMembers(this, 'endEl', 'innerEl', 'thumb', 'halfThumb', 'focusEl', 'tracker', 'thumbHolder'); Ext.slider.MultiSlider.superclass.beforeDestroy.call(this); @@ -27597,24 +17665,7 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { Ext.reg('multislider', Ext.slider.MultiSlider); -/** - * @class Ext.slider.SingleSlider - * @extends Ext.slider.MultiSlider - * Slider which supports vertical or horizontal orientation, keyboard adjustments, - * configurable snapping, axis clicking and animation. Can be added as an item to - * any container. Example usage: -
    
    -new Ext.slider.SingleSlider({
    -    renderTo: Ext.getBody(),
    -    width: 200,
    -    value: 50,
    -    increment: 10,
    -    minValue: 0,
    -    maxValue: 100
    -});
    -
    - * The class Ext.slider.SingleSlider is aliased to Ext.Slider for backwards compatibility. - */ + Ext.slider.SingleSlider = Ext.extend(Ext.slider.MultiSlider, { constructor: function(config) { config = config || {}; @@ -27626,28 +17677,20 @@ Ext.slider.SingleSlider = Ext.extend(Ext.slider.MultiSlider, { Ext.slider.SingleSlider.superclass.constructor.call(this, config); }, - /** - * Returns the current value of the slider - * @return {Number} The current value of the slider - */ + getValue: function() { - //just returns the value of the first thumb, which should be the only one in a single slider + return Ext.slider.SingleSlider.superclass.getValue.call(this, 0); }, - /** - * Programmatically sets the value of the Slider. Ensures that the value is constrained within - * the minValue and maxValue. - * @param {Number} value The value to set the slider to. (This will be constrained within minValue and maxValue) - * @param {Boolean} animate Turn on or off animation, defaults to true - */ + setValue: function(value, animate) { var args = Ext.toArray(arguments), len = args.length; - //this is to maintain backwards compatiblity for sliders with only one thunb. Usually you must pass the thumb - //index to setValue, but if we only have one thumb we inject the index here first if given the multi-slider - //signature without the required index. The index will always be 0 for a single slider + + + if (len == 1 || (len <= 3 && typeof arguments[1] != 'number')) { args.unshift(0); } @@ -27655,29 +17698,24 @@ Ext.slider.SingleSlider = Ext.extend(Ext.slider.MultiSlider, { return Ext.slider.SingleSlider.superclass.setValue.apply(this, args); }, - /** - * Synchronizes the thumb position to the proper proportion of the total component width based - * on the current slider {@link #value}. This will be called automatically when the Slider - * is resized by a layout, but if it is rendered auto width, this method can be called from - * another resize handler to sync the Slider if necessary. - */ + syncThumb : function() { return Ext.slider.SingleSlider.superclass.syncThumb.apply(this, [0].concat(arguments)); }, - // private + getNearest : function(){ - // Since there's only 1 thumb, it's always the nearest + return this.thumbs[0]; } }); -//backwards compatibility + Ext.Slider = Ext.slider.SingleSlider; Ext.reg('slider', Ext.slider.SingleSlider); -// private class to support vertical sliders + Ext.slider.Vertical = { onResize : function(w, h){ this.innerEl.setHeight(h - (this.el.getPadding('t') + this.endEl.getPadding('b'))); @@ -27712,7 +17750,7 @@ Ext.slider.Vertical = { } }; -//private class to support vertical dragging of thumbs within a slider + Ext.slider.Thumb.Vertical = { getNewValue: function() { var slider = this.slider, @@ -27723,56 +17761,27 @@ Ext.slider.Thumb.Vertical = { return slider.minValue + Ext.util.Format.round(bottom / slider.getRatio(), slider.decimalPrecision); } }; -/** - * @class Ext.ProgressBar - * @extends Ext.BoxComponent - *

    An updateable progress bar component. The progress bar supports two different modes: manual and automatic.

    - *

    In manual mode, you are responsible for showing, updating (via {@link #updateProgress}) and clearing the - * progress bar as needed from your own code. This method is most appropriate when you want to show progress - * throughout an operation that has predictable points of interest at which you can update the control.

    - *

    In automatic mode, you simply call {@link #wait} and let the progress bar run indefinitely, only clearing it - * once the operation is complete. You can optionally have the progress bar wait for a specific amount of time - * and then clear itself. Automatic mode is most appropriate for timed operations or asynchronous operations in - * which you have no need for indicating intermediate progress.

    - * @cfg {Float} value A floating point value between 0 and 1 (e.g., .5, defaults to 0) - * @cfg {String} text The progress bar text (defaults to '') - * @cfg {Mixed} textEl The element to render the progress text to (defaults to the progress - * bar's internal text element) - * @cfg {String} id The progress bar element's id (defaults to an auto-generated id) - * @xtype progress - */ + Ext.ProgressBar = Ext.extend(Ext.BoxComponent, { - /** - * @cfg {String} baseCls - * The base CSS class to apply to the progress bar's wrapper element (defaults to 'x-progress') - */ + baseCls : 'x-progress', - /** - * @cfg {Boolean} animate - * True to animate the progress bar during transitions (defaults to false) - */ + animate : false, - // private + waitTimer : null, - // private + initComponent : function(){ Ext.ProgressBar.superclass.initComponent.call(this); this.addEvents( - /** - * @event update - * Fires after each update interval - * @param {Ext.ProgressBar} this - * @param {Number} The current progress value - * @param {String} The current progress text - */ + "update" ); }, - // private + onRender : function(ct, position){ var tpl = new Ext.Template( '
    ', @@ -27799,11 +17808,11 @@ Ext.ProgressBar = Ext.extend(Ext.BoxComponent, { this.progressBar = Ext.get(inner.firstChild); if(this.textEl){ - //use an external text el + this.textEl = Ext.get(this.textEl); delete this.textTopEl; }else{ - //setup our internal layered text els + this.textTopEl = Ext.get(this.progressBar.dom.firstChild); var textBackEl = Ext.get(inner.childNodes[1]); this.textTopEl.setStyle("z-index", 99).addClass('x-hidden'); @@ -27813,7 +17822,7 @@ Ext.ProgressBar = Ext.extend(Ext.BoxComponent, { this.progressBar.setHeight(inner.offsetHeight); }, - // private + afterRender : function(){ Ext.ProgressBar.superclass.afterRender.call(this); if(this.value){ @@ -27823,17 +17832,7 @@ Ext.ProgressBar = Ext.extend(Ext.BoxComponent, { } }, - /** - * Updates the progress bar value, and optionally its text. If the text argument is not specified, - * any existing text value will be unchanged. To blank out existing text, pass ''. Note that even - * if the progress bar value exceeds 1, it will never automatically reset -- you are responsible for - * determining when the progress is complete and calling {@link #reset} to clear and/or hide the control. - * @param {Float} value (optional) A floating point value between 0 and 1 (e.g., .5, defaults to 0) - * @param {String} text (optional) The string to display in the progress text element (defaults to '') - * @param {Boolean} animate (optional) Whether to animate the transition of the progress bar. If this value is - * not specified, the default for the class is used (default to false) - * @return {Ext.ProgressBar} this - */ + updateProgress : function(value, text, animate){ this.value = value || 0; if(text){ @@ -27843,7 +17842,7 @@ Ext.ProgressBar = Ext.extend(Ext.BoxComponent, { var w = Math.floor(value*this.el.dom.firstChild.offsetWidth); this.progressBar.setWidth(w, animate === true || (animate !== false && this.animate)); if(this.textTopEl){ - //textTopEl should be the same width as the bar so overflow will clip as the bar moves + this.textTopEl.removeClass('x-hidden').setWidth(w); } } @@ -27851,63 +17850,7 @@ Ext.ProgressBar = Ext.extend(Ext.BoxComponent, { return this; }, - /** - * Initiates an auto-updating progress bar. A duration can be specified, in which case the progress - * bar will automatically reset after a fixed amount of time and optionally call a callback function - * if specified. If no duration is passed in, then the progress bar will run indefinitely and must - * be manually cleared by calling {@link #reset}. The wait method accepts a config object with - * the following properties: - *
    -Property   Type          Description
    ----------- ------------  ----------------------------------------------------------------------
    -duration   Number        The length of time in milliseconds that the progress bar should
    -                         run before resetting itself (defaults to undefined, in which case it
    -                         will run indefinitely until reset is called)
    -interval   Number        The length of time in milliseconds between each progress update
    -                         (defaults to 1000 ms)
    -animate    Boolean       Whether to animate the transition of the progress bar. If this value is
    -                         not specified, the default for the class is used.                                                   
    -increment  Number        The number of progress update segments to display within the progress
    -                         bar (defaults to 10).  If the bar reaches the end and is still
    -                         updating, it will automatically wrap back to the beginning.
    -text       String        Optional text to display in the progress bar element (defaults to '').
    -fn         Function      A callback function to execute after the progress bar finishes auto-
    -                         updating.  The function will be called with no arguments.  This function
    -                         will be ignored if duration is not specified since in that case the
    -                         progress bar can only be stopped programmatically, so any required function
    -                         should be called by the same code after it resets the progress bar.
    -scope      Object        The scope that is passed to the callback function (only applies when
    -                         duration and fn are both passed).
    -
    - * - * Example usage: - *
    
    -var p = new Ext.ProgressBar({
    -   renderTo: 'my-el'
    -});
    -
    -//Wait for 5 seconds, then update the status el (progress bar will auto-reset)
    -p.wait({
    -   interval: 100, //bar will move fast!
    -   duration: 5000,
    -   increment: 15,
    -   text: 'Updating...',
    -   scope: this,
    -   fn: function(){
    -      Ext.fly('status').update('Done!');
    -   }
    -});
    -
    -//Or update indefinitely until some async action completes, then reset manually
    -p.wait();
    -myAction.on('complete', function(){
    -    p.reset();
    -    Ext.fly('status').update('Done!');
    -});
    -
    - * @param {Object} config (optional) Configuration options - * @return {Ext.ProgressBar} this - */ + wait : function(o){ if(!this.waitTimer){ var scope = this; @@ -27933,20 +17876,12 @@ myAction.on('complete', function(){ return this; }, - /** - * Returns true if the progress bar is currently in a {@link #wait} operation - * @return {Boolean} True if waiting, else false - */ + isWaiting : function(){ return this.waitTimer !== null; }, - /** - * Updates the progress bar text. If specified, textEl will be updated, otherwise the progress - * bar itself will display the updated text. - * @param {String} text (optional) The string to display in the progress text element (defaults to '') - * @return {Ext.ProgressBar} this - */ + updateText : function(text){ this.text = text || ' '; if(this.rendered){ @@ -27955,12 +17890,7 @@ myAction.on('complete', function(){ return this; }, - /** - * Synchronizes the inner bar width to the proper proportion of the total componet width based - * on the current progress {@link #value}. This will be called automatically when the ProgressBar - * is resized by a layout, but if it is rendered auto width, this method can be called from - * another resize handler to sync the ProgressBar if necessary. - */ + syncProgressBar : function(){ if(this.value){ this.updateProgress(this.value, this.text); @@ -27968,12 +17898,7 @@ myAction.on('complete', function(){ return this; }, - /** - * Sets the size of the progress bar. - * @param {Number} width The new width in pixels - * @param {Number} height The new height in pixels - * @return {Ext.ProgressBar} this - */ + setSize : function(w, h){ Ext.ProgressBar.superclass.setSize.call(this, w, h); if(this.textTopEl){ @@ -27984,12 +17909,7 @@ myAction.on('complete', function(){ return this; }, - /** - * Resets the progress bar value to 0 and text to empty string. If hide = true, the progress - * bar will also be hidden (using the {@link #hideMode} property internally). - * @param {Boolean} hide (optional) True to hide the progress bar (defaults to false) - * @return {Ext.ProgressBar} this - */ + reset : function(hide){ this.updateProgress(0); if(this.textTopEl){ @@ -28002,10 +17922,10 @@ myAction.on('complete', function(){ return this; }, - // private + clearTimer : function(){ if(this.waitTimer){ - this.waitTimer.onStop = null; //prevent recursion + this.waitTimer.onStop = null; Ext.TaskMgr.stop(this.waitTimer); this.waitTimer = null; } @@ -28022,63 +17942,14 @@ myAction.on('complete', function(){ Ext.ProgressBar.superclass.onDestroy.call(this); } }); -Ext.reg('progress', Ext.ProgressBar);/* - * These classes are derivatives of the similarly named classes in the YUI Library. - * The original license: - * Copyright (c) 2006, Yahoo! Inc. All rights reserved. - * Code licensed under the BSD License: - * http://developer.yahoo.net/yui/license.txt - */ +Ext.reg('progress', Ext.ProgressBar); (function() { var Event=Ext.EventManager; var Dom=Ext.lib.Dom; -/** - * @class Ext.dd.DragDrop - * Defines the interface and base operation of items that that can be - * dragged or can be drop targets. It was designed to be extended, overriding - * the event handlers for startDrag, onDrag, onDragOver and onDragOut. - * Up to three html elements can be associated with a DragDrop instance: - *
      - *
    • linked element: the element that is passed into the constructor. - * This is the element which defines the boundaries for interaction with - * other DragDrop objects.
    • - *
    • handle element(s): The drag operation only occurs if the element that - * was clicked matches a handle element. By default this is the linked - * element, but there are times that you will want only a portion of the - * linked element to initiate the drag operation, and the setHandleElId() - * method provides a way to define this.
    • - *
    • drag element: this represents the element that would be moved along - * with the cursor during a drag operation. By default, this is the linked - * element itself as in {@link Ext.dd.DD}. setDragElId() lets you define - * a separate element that would be moved, as in {@link Ext.dd.DDProxy}. - *
    • - *
    - * This class should not be instantiated until the onload event to ensure that - * the associated elements are available. - * The following would define a DragDrop obj that would interact with any - * other DragDrop obj in the "group1" group: - *
    - *  dd = new Ext.dd.DragDrop("div1", "group1");
    - * 
    - * Since none of the event handlers have been implemented, nothing would - * actually happen if you were to run the code above. Normally you would - * override this class or one of the default implementations, but you can - * also override the methods you want on an instance of the class... - *
    - *  dd.onDragDrop = function(e, id) {
    - *    alert("dd was dropped on " + id);
    - *  }
    - * 
    - * @constructor - * @param {String} id of the element that is linked to this instance - * @param {String} sGroup the group of related DragDrop objects - * @param {object} config an object containing configurable attributes - * Valid properties for DragDrop: - * padding, isTarget, maintainOffset, primaryButtonOnly - */ + Ext.dd.DragDrop = function(id, sGroup, config) { if(id) { this.init(id, sGroup, config); @@ -28087,458 +17958,161 @@ Ext.dd.DragDrop = function(id, sGroup, config) { Ext.dd.DragDrop.prototype = { - /** - * Set to false to enable a DragDrop object to fire drag events while dragging - * over its own Element. Defaults to true - DragDrop objects do not by default - * fire drag events to themselves. - * @property ignoreSelf - * @type Boolean - */ + - /** - * The id of the element associated with this object. This is what we - * refer to as the "linked element" because the size and position of - * this element is used to determine when the drag and drop objects have - * interacted. - * @property id - * @type String - */ + id: null, - /** - * Configuration attributes passed into the constructor - * @property config - * @type object - */ + config: null, - /** - * The id of the element that will be dragged. By default this is same - * as the linked element, but could be changed to another element. Ex: - * Ext.dd.DDProxy - * @property dragElId - * @type String - * @private - */ + dragElId: null, - /** - * The ID of the element that initiates the drag operation. By default - * this is the linked element, but could be changed to be a child of this - * element. This lets us do things like only starting the drag when the - * header element within the linked html element is clicked. - * @property handleElId - * @type String - * @private - */ + handleElId: null, - /** - * An object who's property names identify HTML tags to be considered invalid as drag handles. - * A non-null property value identifies the tag as invalid. Defaults to the - * following value which prevents drag operations from being initiated by <a> elements:
    
    -{
    -    A: "A"
    -}
    - * @property invalidHandleTypes - * @type Object - */ + invalidHandleTypes: null, - /** - * An object who's property names identify the IDs of elements to be considered invalid as drag handles. - * A non-null property value identifies the ID as invalid. For example, to prevent - * dragging from being initiated on element ID "foo", use:
    
    -{
    -    foo: true
    -}
    - * @property invalidHandleIds - * @type Object - */ + invalidHandleIds: null, - /** - * An Array of CSS class names for elements to be considered in valid as drag handles. - * @property invalidHandleClasses - * @type Array - */ + invalidHandleClasses: null, - /** - * The linked element's absolute X position at the time the drag was - * started - * @property startPageX - * @type int - * @private - */ + startPageX: 0, - /** - * The linked element's absolute X position at the time the drag was - * started - * @property startPageY - * @type int - * @private - */ + startPageY: 0, - /** - * The group defines a logical collection of DragDrop objects that are - * related. Instances only get events when interacting with other - * DragDrop object in the same group. This lets us define multiple - * groups using a single DragDrop subclass if we want. - * @property groups - * @type object An object in the format {'group1':true, 'group2':true} - */ + groups: null, - /** - * Individual drag/drop instances can be locked. This will prevent - * onmousedown start drag. - * @property locked - * @type boolean - * @private - */ + locked: false, - /** - * Lock this instance - * @method lock - */ + lock: function() { this.locked = true; }, - /** - * When set to true, other DD objects in cooperating DDGroups do not receive - * notification events when this DD object is dragged over them. Defaults to false. - * @property moveOnly - * @type boolean - */ + moveOnly: false, - /** - * Unlock this instace - * @method unlock - */ + unlock: function() { this.locked = false; }, - /** - * By default, all instances can be a drop target. This can be disabled by - * setting isTarget to false. - * @property isTarget - * @type boolean - */ + isTarget: true, - /** - * The padding configured for this drag and drop object for calculating - * the drop zone intersection with this object. - * @property padding - * @type int[] An array containing the 4 padding values: [top, right, bottom, left] - */ + padding: null, - /** - * Cached reference to the linked element - * @property _domRef - * @private - */ + _domRef: null, - /** - * Internal typeof flag - * @property __ygDragDrop - * @private - */ + __ygDragDrop: true, - /** - * Set to true when horizontal contraints are applied - * @property constrainX - * @type boolean - * @private - */ + constrainX: false, - /** - * Set to true when vertical contraints are applied - * @property constrainY - * @type boolean - * @private - */ + constrainY: false, - /** - * The left constraint - * @property minX - * @type int - * @private - */ + minX: 0, - /** - * The right constraint - * @property maxX - * @type int - * @private - */ + maxX: 0, - /** - * The up constraint - * @property minY - * @type int - * @private - */ + minY: 0, - /** - * The down constraint - * @property maxY - * @type int - * @private - */ + maxY: 0, - /** - * Maintain offsets when we resetconstraints. Set to true when you want - * the position of the element relative to its parent to stay the same - * when the page changes - * - * @property maintainOffset - * @type boolean - */ + maintainOffset: false, - /** - * Array of pixel locations the element will snap to if we specified a - * horizontal graduation/interval. This array is generated automatically - * when you define a tick interval. - * @property xTicks - * @type int[] - */ + xTicks: null, - /** - * Array of pixel locations the element will snap to if we specified a - * vertical graduation/interval. This array is generated automatically - * when you define a tick interval. - * @property yTicks - * @type int[] - */ + yTicks: null, - /** - * By default the drag and drop instance will only respond to the primary - * button click (left button for a right-handed mouse). Set to true to - * allow drag and drop to start with any mouse click that is propogated - * by the browser - * @property primaryButtonOnly - * @type boolean - */ + primaryButtonOnly: true, - /** - * The available property is false until the linked dom element is accessible. - * @property available - * @type boolean - */ + available: false, - /** - * By default, drags can only be initiated if the mousedown occurs in the - * region the linked element is. This is done in part to work around a - * bug in some browsers that mis-report the mousedown if the previous - * mouseup happened outside of the window. This property is set to true - * if outer handles are defined. - * - * @property hasOuterHandles - * @type boolean - * @default false - */ + hasOuterHandles: false, - /** - * Code that executes immediately before the startDrag event - * @method b4StartDrag - * @private - */ + b4StartDrag: function(x, y) { }, - /** - * Abstract method called after a drag/drop object is clicked - * and the drag or mousedown time thresholds have beeen met. - * @method startDrag - * @param {int} X click location - * @param {int} Y click location - */ - startDrag: function(x, y) { /* override this */ }, + + startDrag: function(x, y) { }, - /** - * Code that executes immediately before the onDrag event - * @method b4Drag - * @private - */ + b4Drag: function(e) { }, - /** - * Abstract method called during the onMouseMove event while dragging an - * object. - * @method onDrag - * @param {Event} e the mousemove event - */ - onDrag: function(e) { /* override this */ }, + + onDrag: function(e) { }, - /** - * Abstract method called when this element fist begins hovering over - * another DragDrop obj - * @method onDragEnter - * @param {Event} e the mousemove event - * @param {String|DragDrop[]} id In POINT mode, the element - * id this is hovering over. In INTERSECT mode, an array of one or more - * dragdrop items being hovered over. - */ - onDragEnter: function(e, id) { /* override this */ }, + + onDragEnter: function(e, id) { }, - /** - * Code that executes immediately before the onDragOver event - * @method b4DragOver - * @private - */ + b4DragOver: function(e) { }, - /** - * Abstract method called when this element is hovering over another - * DragDrop obj - * @method onDragOver - * @param {Event} e the mousemove event - * @param {String|DragDrop[]} id In POINT mode, the element - * id this is hovering over. In INTERSECT mode, an array of dd items - * being hovered over. - */ - onDragOver: function(e, id) { /* override this */ }, + + onDragOver: function(e, id) { }, - /** - * Code that executes immediately before the onDragOut event - * @method b4DragOut - * @private - */ + b4DragOut: function(e) { }, - /** - * Abstract method called when we are no longer hovering over an element - * @method onDragOut - * @param {Event} e the mousemove event - * @param {String|DragDrop[]} id In POINT mode, the element - * id this was hovering over. In INTERSECT mode, an array of dd items - * that the mouse is no longer over. - */ - onDragOut: function(e, id) { /* override this */ }, + + onDragOut: function(e, id) { }, - /** - * Code that executes immediately before the onDragDrop event - * @method b4DragDrop - * @private - */ + b4DragDrop: function(e) { }, - /** - * Abstract method called when this item is dropped on another DragDrop - * obj - * @method onDragDrop - * @param {Event} e the mouseup event - * @param {String|DragDrop[]} id In POINT mode, the element - * id this was dropped on. In INTERSECT mode, an array of dd items this - * was dropped on. - */ - onDragDrop: function(e, id) { /* override this */ }, + + onDragDrop: function(e, id) { }, - /** - * Abstract method called when this item is dropped on an area with no - * drop target - * @method onInvalidDrop - * @param {Event} e the mouseup event - */ - onInvalidDrop: function(e) { /* override this */ }, + + onInvalidDrop: function(e) { }, - /** - * Code that executes immediately before the endDrag event - * @method b4EndDrag - * @private - */ + b4EndDrag: function(e) { }, - /** - * Fired when we are done dragging the object - * @method endDrag - * @param {Event} e the mouseup event - */ - endDrag: function(e) { /* override this */ }, + + endDrag: function(e) { }, - /** - * Code executed immediately before the onMouseDown event - * @method b4MouseDown - * @param {Event} e the mousedown event - * @private - */ + b4MouseDown: function(e) { }, - /** - * Event handler that fires when a drag/drop obj gets a mousedown - * @method onMouseDown - * @param {Event} e the mousedown event - */ - onMouseDown: function(e) { /* override this */ }, + + onMouseDown: function(e) { }, - /** - * Event handler that fires when a drag/drop obj gets a mouseup - * @method onMouseUp - * @param {Event} e the mouseup event - */ - onMouseUp: function(e) { /* override this */ }, + + onMouseUp: function(e) { }, - /** - * Override the onAvailable method to do what is needed after the initial - * position was determined. - * @method onAvailable - */ + onAvailable: function () { }, - /** - * Provides default constraint padding to "constrainTo" elements (defaults to {left: 0, right:0, top:0, bottom:0}). - * @type Object - */ + defaultPadding : {left:0, right:0, top:0, bottom:0}, - /** - * Initializes the drag drop object's constraints to restrict movement to a certain element. - * - * Usage: -
    
    - var dd = new Ext.dd.DDProxy("dragDiv1", "proxytest",
    -                { dragElId: "existingProxyDiv" });
    - dd.startDrag = function(){
    -     this.constrainTo("parent-id");
    - };
    - 
    - * Or you can initalize it using the {@link Ext.Element} object: -
    
    - Ext.get("dragDiv1").initDDProxy("proxytest", {dragElId: "existingProxyDiv"}, {
    -     startDrag : function(){
    -         this.constrainTo("parent-id");
    -     }
    - });
    - 
    - * @param {Mixed} constrainTo The element to constrain to. - * @param {Object/Number} pad (optional) Pad provides a way to specify "padding" of the constraints, - * and can be either a number for symmetrical padding (4 would be equal to {left:4, right:4, top:4, bottom:4}) or - * an object containing the sides to pad. For example: {right:10, bottom:10} - * @param {Boolean} inContent (optional) Constrain the draggable in the content box of the element (inside padding and borders) - */ + constrainTo : function(constrainTo, pad, inContent){ if(Ext.isNumber(pad)){ pad = {left: pad, right:pad, top:pad, bottom:pad}; @@ -28561,21 +18135,17 @@ Ext.dd.DragDrop.prototype = { leftSpace = b.x - c.x; this.resetConstraints(); - this.setXConstraint(leftSpace - (pad.left||0), // left - c.width - leftSpace - b.width - (pad.right||0), //right + this.setXConstraint(leftSpace - (pad.left||0), + c.width - leftSpace - b.width - (pad.right||0), this.xTickSize ); - this.setYConstraint(topSpace - (pad.top||0), //top - c.height - topSpace - b.height - (pad.bottom||0), //bottom + this.setYConstraint(topSpace - (pad.top||0), + c.height - topSpace - b.height - (pad.bottom||0), this.yTickSize ); }, - /** - * Returns a reference to the linked element - * @method getEl - * @return {HTMLElement} the html element - */ + getEl: function() { if (!this._domRef) { this._domRef = Ext.getDom(this.id); @@ -28584,69 +18154,49 @@ Ext.dd.DragDrop.prototype = { return this._domRef; }, - /** - * Returns a reference to the actual element to drag. By default this is - * the same as the html element, but it can be assigned to another - * element. An example of this can be found in Ext.dd.DDProxy - * @method getDragEl - * @return {HTMLElement} the html element - */ + getDragEl: function() { return Ext.getDom(this.dragElId); }, - /** - * Sets up the DragDrop object. Must be called in the constructor of any - * Ext.dd.DragDrop subclass - * @method init - * @param id the id of the linked element - * @param {String} sGroup the group of related items - * @param {object} config configuration attributes - */ + init: function(id, sGroup, config) { this.initTarget(id, sGroup, config); Event.on(this.id, "mousedown", this.handleMouseDown, this); - // Event.on(this.id, "selectstart", Event.preventDefault); + }, - /** - * Initializes Targeting functionality only... the object does not - * get a mousedown handler. - * @method initTarget - * @param id the id of the linked element - * @param {String} sGroup the group of related items - * @param {object} config configuration attributes - */ + initTarget: function(id, sGroup, config) { - // configuration attributes + this.config = config || {}; - // create a local reference to the drag and drop manager + this.DDM = Ext.dd.DDM; - // initialize the groups array + this.groups = {}; - // assume that we have an element reference instead of an id if the - // parameter is not a string + + if (typeof id !== "string") { id = Ext.id(id); } - // set the id + this.id = id; - // add to an interaction group + this.addToGroup((sGroup) ? sGroup : "default"); - // We don't want to register this as the handle with the manager - // so we just set the id rather than calling the setter. + + this.handleElId = id; - // the linked element is the element that gets dragged by default + this.setDragElId(id); - // by default, clicked anchors will not start drag operations. + this.invalidHandleTypes = { A: "A" }; this.invalidHandleIds = {}; this.invalidHandleClasses = []; @@ -28656,18 +18206,11 @@ Ext.dd.DragDrop.prototype = { this.handleOnAvailable(); }, - /** - * Applies the configuration parameters that were passed into the constructor. - * This is supposed to happen at each level through the inheritance chain. So - * a DDProxy implentation will execute apply config on DDProxy, DD, and - * DragDrop in order to get all of the parameters that are available in - * each object. - * @method applyConfig - */ + applyConfig: function() { - // configurable properties: - // padding, isTarget, maintainOffset, primaryButtonOnly + + this.padding = this.config.padding || [0, 0, 0, 0]; this.isTarget = (this.config.isTarget !== false); this.maintainOffset = (this.config.maintainOffset); @@ -28675,31 +18218,16 @@ Ext.dd.DragDrop.prototype = { }, - /** - * Executed when the linked element is available - * @method handleOnAvailable - * @private - */ + handleOnAvailable: function() { this.available = true; this.resetConstraints(); this.onAvailable(); }, - /** - * Configures the padding for the target zone in px. Effectively expands - * (or reduces) the virtual object size for targeting calculations. - * Supports css-style shorthand; if only one parameter is passed, all sides - * will have that padding, and if only two are passed, the top and bottom - * will have the first param, the left and right the second. - * @method setPadding - * @param {int} iTop Top pad - * @param {int} iRight Right pad - * @param {int} iBot Bot pad - * @param {int} iLeft Left pad - */ + setPadding: function(iTop, iRight, iBot, iLeft) { - // this.padding = [iLeft, iRight, iTop, iBot]; + if (!iRight && 0 !== iRight) { this.padding = [iTop, iTop, iTop, iTop]; } else if (!iBot && 0 !== iBot) { @@ -28709,12 +18237,7 @@ Ext.dd.DragDrop.prototype = { } }, - /** - * Stores the initial placement of the linked element. - * @method setInitPosition - * @param {int} diffX the X offset, default 0 - * @param {int} diffY the Y offset, default 0 - */ + setInitPosition: function(diffX, diffY) { var el = this.getEl(); @@ -28736,13 +18259,7 @@ Ext.dd.DragDrop.prototype = { this.setStartPosition(p); }, - /** - * Sets the start position of the element. This is set when the obj - * is initialized, the reset when a drag is started. - * @method setStartPosition - * @param pos current position (from previous lookup) - * @private - */ + setStartPosition: function(pos) { var p = pos || Dom.getXY( this.getEl() ); this.deltaSetXY = null; @@ -28751,23 +18268,13 @@ Ext.dd.DragDrop.prototype = { this.startPageY = p[1]; }, - /** - * Add this instance to a group of related drag/drop objects. All - * instances belong to at least one group, and can belong to as many - * groups as needed. - * @method addToGroup - * @param sGroup {string} the name of the group - */ + addToGroup: function(sGroup) { this.groups[sGroup] = true; this.DDM.regDragDrop(this, sGroup); }, - /** - * Remove's this instance from the supplied interaction group - * @method removeFromGroup - * @param {string} sGroup The group to drop - */ + removeFromGroup: function(sGroup) { if (this.groups[sGroup]) { delete this.groups[sGroup]; @@ -28776,27 +18283,12 @@ Ext.dd.DragDrop.prototype = { this.DDM.removeDDFromGroup(this, sGroup); }, - /** - * Allows you to specify that an element other than the linked element - * will be moved with the cursor during a drag - * @method setDragElId - * @param id {string} the id of the element that will be used to initiate the drag - */ + setDragElId: function(id) { this.dragElId = id; }, - /** - * Allows you to specify a child of the linked element that should be - * used to initiate the drag operation. An example of this would be if - * you have a content div with text and links. Clicking anywhere in the - * content area would normally start the drag operation. Use this method - * to specify that an element inside of the content div is the element - * that starts the drag operation. - * @method setHandleElId - * @param id {string} the id of the element that will be used to - * initiate the drag. - */ + setHandleElId: function(id) { if (typeof id !== "string") { id = Ext.id(id); @@ -28805,12 +18297,7 @@ Ext.dd.DragDrop.prototype = { this.DDM.regHandle(this.id, id); }, - /** - * Allows you to set an element outside of the linked element as a drag - * handle - * @method setOuterHandleElId - * @param id the id of the element that will be used to initiate the drag - */ + setOuterHandleElId: function(id) { if (typeof id !== "string") { id = Ext.id(id); @@ -28822,10 +18309,7 @@ Ext.dd.DragDrop.prototype = { this.hasOuterHandles = true; }, - /** - * Remove all drag and drop hooks for this element - * @method unreg - */ + unreg: function() { Event.un(this.id, "mousedown", this.handleMouseDown); @@ -28837,24 +18321,12 @@ Ext.dd.DragDrop.prototype = { this.unreg(); }, - /** - * Returns true if this instance is locked, or the drag drop mgr is locked - * (meaning that all drag/drop is disabled on the page.) - * @method isLocked - * @return {boolean} true if this obj or all drag/drop is locked, else - * false - */ + isLocked: function() { return (this.DDM.isLocked() || this.locked); }, - /** - * Fired when this object is clicked - * @method handleMouseDown - * @param {Event} e - * @param {Ext.dd.DragDrop} oDD the clicked dd object (this dd obj) - * @private - */ + handleMouseDown: function(e, oDD){ if (this.primaryButtonOnly && e.button != 0) { return; @@ -28871,7 +18343,7 @@ Ext.dd.DragDrop.prototype = { } else { if (this.clickValidator(e)) { - // set the initial element position + this.setStartPosition(); this.b4MouseDown(e); @@ -28894,24 +18366,13 @@ Ext.dd.DragDrop.prototype = { this.DDM.handleWasClicked(target, this.id)) ); }, - /** - * Allows you to specify a tag name that should not start a drag operation - * when clicked. This is designed to facilitate embedding links within a - * drag handle that do something other than start the drag. - * @method addInvalidHandleType - * @param {string} tagName the type of element to exclude - */ + addInvalidHandleType: function(tagName) { var type = tagName.toUpperCase(); this.invalidHandleTypes[type] = type; }, - /** - * Lets you to specify an element id for a child of a drag handle - * that should not initiate a drag - * @method addInvalidHandleId - * @param {string} id the element id of the element you wish to ignore - */ + addInvalidHandleId: function(id) { if (typeof id !== "string") { id = Ext.id(id); @@ -28919,31 +18380,19 @@ Ext.dd.DragDrop.prototype = { this.invalidHandleIds[id] = id; }, - /** - * Lets you specify a css class of elements that will not initiate a drag - * @method addInvalidHandleClass - * @param {string} cssClass the class of the elements you wish to ignore - */ + addInvalidHandleClass: function(cssClass) { this.invalidHandleClasses.push(cssClass); }, - /** - * Unsets an excluded tag name set by addInvalidHandleType - * @method removeInvalidHandleType - * @param {string} tagName the type of element to unexclude - */ + removeInvalidHandleType: function(tagName) { var type = tagName.toUpperCase(); - // this.invalidHandleTypes[type] = null; + delete this.invalidHandleTypes[type]; }, - /** - * Unsets an invalid handle id - * @method removeInvalidHandleId - * @param {string} id the id of the element to re-enable - */ + removeInvalidHandleId: function(id) { if (typeof id !== "string") { id = Ext.id(id); @@ -28951,12 +18400,7 @@ Ext.dd.DragDrop.prototype = { delete this.invalidHandleIds[id]; }, - /** - * Unsets an invalid css class - * @method removeInvalidHandleClass - * @param {string} cssClass the class of the element(s) you wish to - * re-enable - */ + removeInvalidHandleClass: function(cssClass) { for (var i=0, len=this.invalidHandleClasses.length; i= val) { - // The value is lower than the first tick, so we return the first - // tick. + + return tickArray[0]; } else { for (var i=0, len=tickArray.length; i - * Ext.dd.DragDropMgr.refreshCache(ddinstance.groups); - * - * Alternatively: - * - * Ext.dd.DragDropMgr.refreshCache({group1:true, group2:true}); - * - * @TODO this really should be an indexed array. Alternatively this - * method could accept both. - * @method refreshCache - * @param {Object} groups an associative array of groups to refresh - * @static - */ + refreshCache: function(groups) { for (var sGroup in groups) { if ("string" != typeof sGroup) { @@ -30056,31 +19101,22 @@ Ext.dd.DragDropMgr = function() { var oDD = this.ids[sGroup][i]; if (this.isTypeOfDD(oDD)) { - // if (this.isTypeOfDD(oDD) && oDD.isTarget) { + var loc = this.getLocation(oDD); if (loc) { this.locationCache[oDD.id] = loc; } else { delete this.locationCache[oDD.id]; - // this will unregister the drag and drop object if - // the element is not in a usable state - // oDD.unreg(); + + + } } } } }, - /** - * This checks to make sure an element exists and is in the DOM. The - * main purpose is to handle cases where innerHTML is used to remove - * drag and drop objects from the DOM. IE provides an 'unspecified - * error' when trying to access the offsetParent of such an element - * @method verifyEl - * @param {HTMLElement} el the element to check - * @return {boolean} true if the element looks usable - * @static - */ + verifyEl: function(el) { if (el) { var parent; @@ -30099,17 +19135,7 @@ Ext.dd.DragDropMgr = function() { return false; }, - /** - * Returns a Region object containing the drag and drop element's position - * and size, including the padding configured for it - * @method getLocation - * @param {DragDrop} oDD the drag and drop object to get the - * location for - * @return {Ext.lib.Region} a Region object representing the total area - * the element occupies, including any padding - * the instance is configured for. - * @static - */ + getLocation: function(oDD) { if (! this.isTypeOfDD(oDD)) { return null; @@ -30138,17 +19164,9 @@ Ext.dd.DragDropMgr = function() { return new Ext.lib.Region( t, r, b, l ); }, - /** - * Checks the cursor location to see if it over the target - * @method isOverTarget - * @param {Ext.lib.Point} pt The point to evaluate - * @param {DragDrop} oTarget the DragDrop object we are inspecting - * @return {boolean} true if the mouse is over the target - * @private - * @static - */ + isOverTarget: function(pt, oTarget, intersect) { - // use cache if available + var loc = this.locationCache[oTarget.id]; if (!loc || !this.useCache) { loc = this.getLocation(oTarget); @@ -30162,11 +19180,11 @@ Ext.dd.DragDropMgr = function() { oTarget.cursorIsOver = loc.contains( pt ); - // DragDrop is using this as a sanity check for the initial mousedown - // in this case we are done. In POINT mode, if the drag obj has no - // contraints, we are also done. Otherwise we need to evaluate the - // location of the target as related to the actual location of the - // dragged element. + + + + + var dc = this.dragCurrent; if (!dc || !dc.getTargetCoord || (!intersect && !dc.constrainX && !dc.constrainY)) { @@ -30175,10 +19193,10 @@ Ext.dd.DragDropMgr = function() { oTarget.overlap = null; - // Get the current location of the drag element, this is the - // location of the mouse event less the delta that represents - // where the original mousedown happened on the element. We - // need to consider constraints and ticks as well. + + + + var pos = dc.getTargetCoord(pt.x, pt.y); var el = dc.getDragEl(); @@ -30197,22 +19215,12 @@ Ext.dd.DragDropMgr = function() { } }, - /** - * unload event handler - * @method _onUnload - * @private - * @static - */ + _onUnload: function(e, me) { Ext.dd.DragDropMgr.unregAll(); }, - /** - * Cleans up the drag and drop events and objects. - * @method unregAll - * @private - * @static - */ + unregAll: function() { if (this.dragCurrent) { @@ -30230,23 +19238,10 @@ Ext.dd.DragDropMgr = function() { this.ids = {}; }, - /** - * A cache of DOM elements - * @property elementCache - * @private - * @static - */ + elementCache: {}, - /** - * Get the wrapper for the DOM element specified - * @method getElWrapper - * @param {String} id the id of the element to get - * @return {Ext.dd.DDM.ElementWrapper} the wrapped element - * @private - * @deprecated This wrapper isn't that useful - * @static - */ + getElWrapper: function(id) { var oWrapper = this.elementCache[id]; if (!oWrapper || !oWrapper.el) { @@ -30256,90 +19251,38 @@ Ext.dd.DragDropMgr = function() { return oWrapper; }, - /** - * Returns the actual DOM element - * @method getElement - * @param {String} id the id of the elment to get - * @return {Object} The element - * @deprecated use Ext.lib.Ext.getDom instead - * @static - */ + getElement: function(id) { return Ext.getDom(id); }, - /** - * Returns the style property for the DOM element (i.e., - * document.getElById(id).style) - * @method getCss - * @param {String} id the id of the elment to get - * @return {Object} The style property of the element - * @deprecated use Ext.lib.Dom instead - * @static - */ + getCss: function(id) { var el = Ext.getDom(id); return (el) ? el.style : null; }, - /** - * Inner class for cached elements - * @class Ext.dd.DragDropMgr.ElementWrapper - * @for DragDropMgr - * @private - * @deprecated - */ + ElementWrapper: function(el) { - /** - * The element - * @property el - */ + this.el = el || null; - /** - * The element id - * @property id - */ + this.id = this.el && el.id; - /** - * A reference to the style property - * @property css - */ + this.css = this.el && el.style; }, - /** - * Returns the X position of an html element - * @method getPosX - * @param el the element for which to get the position - * @return {int} the X coordinate - * @for DragDropMgr - * @deprecated use Ext.lib.Dom.getX instead - * @static - */ + getPosX: function(el) { return Ext.lib.Dom.getX(el); }, - /** - * Returns the Y position of an html element - * @method getPosY - * @param el the element for which to get the position - * @return {int} the Y coordinate - * @deprecated use Ext.lib.Dom.getY instead - * @static - */ + getPosY: function(el) { return Ext.lib.Dom.getY(el); }, - /** - * Swap two nodes. In IE, we use the native method, for others we - * emulate the IE behavior - * @method swapNode - * @param n1 the first node to swap - * @param n2 the other node to swap - * @static - */ + swapNode: function(n1, n2) { if (n1.swapNode) { n1.swapNode(n2); @@ -30358,12 +19301,7 @@ Ext.dd.DragDropMgr = function() { } }, - /** - * Returns the current scroll position - * @method getScroll - * @private - * @static - */ + getScroll: function () { var t, l, dde=document.documentElement, db=document.body; if (dde && (dde.scrollTop || dde.scrollLeft)) { @@ -30378,76 +19316,36 @@ Ext.dd.DragDropMgr = function() { return { top: t, left: l }; }, - /** - * Returns the specified element style property - * @method getStyle - * @param {HTMLElement} el the element - * @param {string} styleProp the style property - * @return {string} The value of the style property - * @deprecated use Ext.lib.Dom.getStyle - * @static - */ + getStyle: function(el, styleProp) { return Ext.fly(el).getStyle(styleProp); }, - /** - * Gets the scrollTop - * @method getScrollTop - * @return {int} the document's scrollTop - * @static - */ + getScrollTop: function () { return this.getScroll().top; }, - /** - * Gets the scrollLeft - * @method getScrollLeft - * @return {int} the document's scrollTop - * @static - */ + getScrollLeft: function () { return this.getScroll().left; }, - /** - * Sets the x/y position of an element to the location of the - * target element. - * @method moveToEl - * @param {HTMLElement} moveEl The element to move - * @param {HTMLElement} targetEl The position reference element - * @static - */ + moveToEl: function (moveEl, targetEl) { var aCoord = Ext.lib.Dom.getXY(targetEl); Ext.lib.Dom.setXY(moveEl, aCoord); }, - /** - * Numeric array sort function - * @method numericSort - * @static - */ + numericSort: function(a, b) { return (a - b); }, - /** - * Internal counter - * @property _timeoutCount - * @private - * @static - */ + _timeoutCount: 0, - /** - * Trying to make the load order less important. Without this we get - * an error if this file is loaded before the Event Utility. - * @method _addListeners - * @private - * @static - */ + _addListeners: function() { var DDM = Ext.dd.DDM; if ( Ext.lib.Event && document ) { @@ -30463,19 +19361,12 @@ Ext.dd.DragDropMgr = function() { } }, - /** - * Recursively searches the immediate parent and all child nodes for - * the handle element in order to determine wheter or not it was - * clicked. - * @method handleWasClicked - * @param node the html element to inspect - * @static - */ + handleWasClicked: function(node, id) { if (this.isHandle(id, node.id)) { return true; } else { - // check to see if this is a text node child of the one we want + var p = node.parentNode; while (p) { @@ -30494,24 +19385,13 @@ Ext.dd.DragDropMgr = function() { }(); -// shorter alias, save a few bytes + Ext.dd.DDM = Ext.dd.DragDropMgr; Ext.dd.DDM._addListeners(); } -/** - * @class Ext.dd.DD - * A DragDrop implementation where the linked element follows the - * mouse cursor during a drag. - * @extends Ext.dd.DragDrop - * @constructor - * @param {String} id the id of the linked element - * @param {String} sGroup the group of related DragDrop items - * @param {object} config an object containing configurable attributes - * Valid properties for DD: - * scroll - */ + Ext.dd.DD = function(id, sGroup, config) { if (id) { this.init(id, sGroup, config); @@ -30520,68 +19400,32 @@ Ext.dd.DD = function(id, sGroup, config) { Ext.extend(Ext.dd.DD, Ext.dd.DragDrop, { - /** - * When set to true, the utility automatically tries to scroll the browser - * window when a drag and drop element is dragged near the viewport boundary. - * Defaults to true. - * @property scroll - * @type boolean - */ + scroll: true, - /** - * Sets the pointer offset to the distance between the linked element's top - * left corner and the location the element was clicked - * @method autoOffset - * @param {int} iPageX the X coordinate of the click - * @param {int} iPageY the Y coordinate of the click - */ + autoOffset: function(iPageX, iPageY) { var x = iPageX - this.startPageX; var y = iPageY - this.startPageY; this.setDelta(x, y); }, - /** - * Sets the pointer offset. You can call this directly to force the - * offset to be in a particular location (e.g., pass in 0,0 to set it - * to the center of the object) - * @method setDelta - * @param {int} iDeltaX the distance from the left - * @param {int} iDeltaY the distance from the top - */ + setDelta: function(iDeltaX, iDeltaY) { this.deltaX = iDeltaX; this.deltaY = iDeltaY; }, - /** - * Sets the drag element to the location of the mousedown or click event, - * maintaining the cursor location relative to the location on the element - * that was clicked. Override this if you want to place the element in a - * location other than where the cursor is. - * @method setDragElPos - * @param {int} iPageX the X coordinate of the mousedown or drag event - * @param {int} iPageY the Y coordinate of the mousedown or drag event - */ + setDragElPos: function(iPageX, iPageY) { - // the first time we do this, we are going to check to make sure - // the element has css positioning + + var el = this.getDragEl(); this.alignElWithMouse(el, iPageX, iPageY); }, - /** - * Sets the element to the location of the mousedown or click event, - * maintaining the cursor location relative to the location on the element - * that was clicked. Override this if you want to place the element in a - * location other than where the cursor is. - * @method alignElWithMouse - * @param {HTMLElement} el the element to move - * @param {int} iPageX the X coordinate of the mousedown or drag event - * @param {int} iPageY the Y coordinate of the mousedown or drag event - */ + alignElWithMouse: function(el, iPageX, iPageY) { var oCoord = this.getTargetCoord(iPageX, iPageY); var fly = el.dom ? el : Ext.fly(el, '_dd'); @@ -30600,16 +19444,7 @@ Ext.extend(Ext.dd.DD, Ext.dd.DragDrop, { return oCoord; }, - /** - * Saves the most recent position so that we can reset the constraints and - * tick marks on-demand. We need to know this so that we can calculate the - * number of pixels the element is offset from its original position. - * @method cachePosition - * @param iPageX the current x position (optional, this just makes it so we - * don't have to look it up again) - * @param iPageY the current y position (optional, this just makes it so we - * don't have to look it up again) - */ + cachePosition: function(iPageX, iPageY) { if (iPageX) { this.lastPageX = iPageX; @@ -30621,90 +19456,73 @@ Ext.extend(Ext.dd.DD, Ext.dd.DragDrop, { } }, - /** - * Auto-scroll the window if the dragged object has been moved beyond the - * visible window boundary. - * @method autoScroll - * @param {int} x the drag element's x position - * @param {int} y the drag element's y position - * @param {int} h the height of the drag element - * @param {int} w the width of the drag element - * @private - */ + autoScroll: function(x, y, h, w) { if (this.scroll) { - // The client height + var clientH = Ext.lib.Dom.getViewHeight(); - // The client width + var clientW = Ext.lib.Dom.getViewWidth(); - // The amt scrolled down + var st = this.DDM.getScrollTop(); - // The amt scrolled right + var sl = this.DDM.getScrollLeft(); - // Location of the bottom of the element + var bot = h + y; - // Location of the right of the element + var right = w + x; - // The distance from the cursor to the bottom of the visible area, - // adjusted so that we don't scroll if the cursor is beyond the - // element drag constraints + + + var toBot = (clientH + st - y - this.deltaY); - // The distance from the cursor to the right of the visible area + var toRight = (clientW + sl - x - this.deltaX); - // How close to the edge the cursor must be before we scroll - // var thresh = (document.all) ? 100 : 40; + + var thresh = 40; - // How many pixels to scroll per autoscroll op. This helps to reduce - // clunky scrolling. IE is more sensitive about this ... it needs this - // value to be higher. + + + var scrAmt = (document.all) ? 80 : 30; - // Scroll down if we are near the bottom of the visible page and the - // obj extends below the crease + + if ( bot > clientH && toBot < thresh ) { window.scrollTo(sl, st + scrAmt); } - // Scroll up if the window is scrolled down and the top of the object - // goes above the top border + + if ( y < st && st > 0 && y - st < thresh ) { window.scrollTo(sl, st - scrAmt); } - // Scroll right if the obj is beyond the right border and the cursor is - // near the border. + + if ( right > clientW && toRight < thresh ) { window.scrollTo(sl + scrAmt, st); } - // Scroll left if the window has been scrolled to the right and the obj - // extends past the left border + + if ( x < sl && sl > 0 && x - sl < thresh ) { window.scrollTo(sl - scrAmt, st); } } }, - /** - * Finds the location the element should be placed if we want to move - * it to where the mouse location less the click offset would place us. - * @method getTargetCoord - * @param {int} iPageX the X coordinate of the click - * @param {int} iPageY the Y coordinate of the click - * @return an object that contains the coordinates (Object.x and Object.y) - * @private - */ + getTargetCoord: function(iPageX, iPageY) { var x = iPageX - this.deltaX; var y = iPageY - this.deltaY; @@ -30726,30 +19544,20 @@ Ext.extend(Ext.dd.DD, Ext.dd.DragDrop, { return {x:x, y:y}; }, - /** - * Sets up config options specific to this class. Overrides - * Ext.dd.DragDrop, but all versions of this method through the - * inheritance chain are called - */ + applyConfig: function() { Ext.dd.DD.superclass.applyConfig.call(this); this.scroll = (this.config.scroll !== false); }, - /** - * Event that fires prior to the onMouseDown event. Overrides - * Ext.dd.DragDrop. - */ + b4MouseDown: function(e) { - // this.resetConstraints(); + this.autoOffset(e.getPageX(), e.getPageY()); }, - /** - * Event that fires prior to the onDrag event. Overrides - * Ext.dd.DragDrop. - */ + b4Drag: function(e) { this.setDragElPos(e.getPageX(), e.getPageY()); @@ -30759,53 +19567,13 @@ Ext.extend(Ext.dd.DD, Ext.dd.DragDrop, { return ("DD " + this.id); } - ////////////////////////////////////////////////////////////////////////// - // Debugging ygDragDrop events that can be overridden - ////////////////////////////////////////////////////////////////////////// - /* - startDrag: function(x, y) { - }, - - onDrag: function(e) { - }, - - onDragEnter: function(e, id) { - }, - - onDragOver: function(e, id) { - }, - - onDragOut: function(e, id) { - }, - - onDragDrop: function(e, id) { - }, - - endDrag: function(e) { - } - - */ + + + + }); -/** - * @class Ext.dd.DDProxy - * A DragDrop implementation that inserts an empty, bordered div into - * the document that follows the cursor during drag operations. At the time of - * the click, the frame div is resized to the dimensions of the linked html - * element, and moved to the exact location of the linked element. - * - * References to the "frame" element refer to the single proxy element that - * was created to be dragged in place of all DDProxy elements on the - * page. - * - * @extends Ext.dd.DD - * @constructor - * @param {String} id the id of the linked html element - * @param {String} sGroup the group of related DragDrop objects - * @param {object} config an object containing configurable attributes - * Valid properties for DDProxy in addition to those in DragDrop: - * resizeFrame, centerFrame, dragElId - */ + Ext.dd.DDProxy = function(id, sGroup, config) { if (id) { this.init(id, sGroup, config); @@ -30813,39 +19581,18 @@ Ext.dd.DDProxy = function(id, sGroup, config) { } }; -/** - * The default drag frame div id - * @property Ext.dd.DDProxy.dragElId - * @type String - * @static - */ + Ext.dd.DDProxy.dragElId = "ygddfdiv"; Ext.extend(Ext.dd.DDProxy, Ext.dd.DD, { - /** - * By default we resize the drag frame to be the same size as the element - * we want to drag (this is to get the frame effect). We can turn it off - * if we want a different behavior. - * @property resizeFrame - * @type boolean - */ + resizeFrame: true, - /** - * By default the frame is positioned exactly where the drag element is, so - * we use the cursor offset provided by Ext.dd.DD. Another option that works only if - * you do not have constraints on the obj is to have the drag frame centered - * around the cursor. Set centerFrame to true for this effect. - * @property centerFrame - * @type boolean - */ + centerFrame: false, - /** - * Creates the proxy element if it does not yet exist - * @method createFrame - */ + createFrame: function() { var self = this; var body = document.body; @@ -30868,18 +19615,14 @@ Ext.extend(Ext.dd.DDProxy, Ext.dd.DD, { s.border = "2px solid #aaa"; s.zIndex = 999; - // appendChild can blow up IE if invoked prior to the window load event - // while rendering a table. It is possible there are other scenarios - // that would cause this to happen as well. + + + body.insertBefore(div, body.firstChild); } }, - /** - * Initialization for the drag frame element. Must be called in the - * constructor of all subclasses - * @method initFrame - */ + initFrame: function() { this.createFrame(); }, @@ -30892,14 +19635,7 @@ Ext.extend(Ext.dd.DDProxy, Ext.dd.DD, { this.setDragElId(this.config.dragElId || Ext.dd.DDProxy.dragElId); }, - /** - * Resizes the drag frame to the dimensions of the clicked object, positions - * it over the object, and finally displays it - * @method showFrame - * @param {int} iPageX X click position - * @param {int} iPageY Y click position - * @private - */ + showFrame: function(iPageX, iPageY) { var el = this.getEl(); var dragEl = this.getDragEl(); @@ -30917,12 +19653,7 @@ Ext.extend(Ext.dd.DDProxy, Ext.dd.DD, { Ext.fly(dragEl).show(); }, - /** - * The proxy is automatically resized to the dimensions of the linked - * element when a drag is initiated, unless resizeFrame is set to false - * @method _resizeProxy - * @private - */ + _resizeProxy: function() { if (this.resizeFrame) { var el = this.getEl(); @@ -30930,7 +19661,7 @@ Ext.extend(Ext.dd.DDProxy, Ext.dd.DD, { } }, - // overrides Ext.dd.DragDrop + b4MouseDown: function(e) { var x = e.getPageX(); var y = e.getPageY(); @@ -30938,31 +19669,31 @@ Ext.extend(Ext.dd.DDProxy, Ext.dd.DD, { this.setDragElPos(x, y); }, - // overrides Ext.dd.DragDrop + b4StartDrag: function(x, y) { - // show the drag frame + this.showFrame(x, y); }, - // overrides Ext.dd.DragDrop + b4EndDrag: function(e) { Ext.fly(this.getDragEl()).hide(); }, - // overrides Ext.dd.DragDrop - // By default we try to move the element to the last location of the frame. - // This is so that the default behavior mirrors that of Ext.dd.DD. + + + endDrag: function(e) { var lel = this.getEl(); var del = this.getDragEl(); - // Show the drag frame briefly so we can get its position + del.style.visibility = ""; this.beforeMove(); - // Hide the linked element before the move to get around a Safari - // rendering bug. + + lel.style.visibility = "hidden"; Ext.dd.DDM.moveToEl(lel, del); del.style.visibility = "hidden"; @@ -30984,261 +19715,96 @@ Ext.extend(Ext.dd.DDProxy, Ext.dd.DD, { } }); -/** - * @class Ext.dd.DDTarget - * A DragDrop implementation that does not move, but can be a drop - * target. You would get the same result by simply omitting implementation - * for the event callbacks, but this way we reduce the processing cost of the - * event listener and the callbacks. - * @extends Ext.dd.DragDrop - * @constructor - * @param {String} id the id of the element that is a drop target - * @param {String} sGroup the group of related DragDrop objects - * @param {object} config an object containing configurable attributes - * Valid properties for DDTarget in addition to those in - * DragDrop: - * none - */ + Ext.dd.DDTarget = function(id, sGroup, config) { if (id) { this.initTarget(id, sGroup, config); } }; -// Ext.dd.DDTarget.prototype = new Ext.dd.DragDrop(); + Ext.extend(Ext.dd.DDTarget, Ext.dd.DragDrop, { - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + getDragEl: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + isValidHandleChild: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + startDrag: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + endDrag: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + onDrag: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + onDragDrop: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + onDragEnter: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + onDragOut: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + onDragOver: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + onInvalidDrop: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + onMouseDown: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + onMouseUp: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + setXConstraint: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + setYConstraint: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + resetConstraints: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + clearConstraints: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + clearTicks: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + setInitPosition: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + setDragElId: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + setHandleElId: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + setOuterHandleElId: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + addInvalidHandleClass: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + addInvalidHandleId: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + addInvalidHandleType: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + removeInvalidHandleClass: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + removeInvalidHandleId: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ + removeInvalidHandleType: Ext.emptyFn, toString: function() { return ("DDTarget " + this.id); } -});/** - * @class Ext.dd.DragTracker - * @extends Ext.util.Observable - * A DragTracker listens for drag events on an Element and fires events at the start and end of the drag, - * as well as during the drag. This is useful for components such as {@link Ext.Slider}, where there is - * an element that can be dragged around to change the Slider's value. - * DragTracker provides a series of template methods that should be overridden to provide functionality - * in response to detected drag operations. These are onBeforeStart, onStart, onDrag and onEnd. - * See {@link Ext.Slider}'s initEvents function for an example implementation. - */ +}); Ext.dd.DragTracker = Ext.extend(Ext.util.Observable, { - /** - * @cfg {Boolean} active - * Defaults to false. - */ + active: false, - /** - * @cfg {Number} tolerance - * Number of pixels the drag target must be moved before dragging is considered to have started. Defaults to 5. - */ + tolerance: 5, - /** - * @cfg {Boolean/Number} autoStart - * Defaults to false. Specify true to defer trigger start by 1000 ms. - * Specify a Number for the number of milliseconds to defer trigger start. - */ + autoStart: false, constructor : function(config){ Ext.apply(this, config); this.addEvents( - /** - * @event mousedown - * @param {Object} this - * @param {Object} e event object - */ + 'mousedown', - /** - * @event mouseup - * @param {Object} this - * @param {Object} e event object - */ + 'mouseup', - /** - * @event mousemove - * @param {Object} this - * @param {Object} e event object - */ + 'mousemove', - /** - * @event dragstart - * @param {Object} this - * @param {Object} startXY the page coordinates of the event - */ + 'dragstart', - /** - * @event dragend - * @param {Object} this - * @param {Object} e event object - */ + 'dragend', - /** - * @event drag - * @param {Object} this - * @param {Object} e event object - */ + 'drag' ); @@ -31278,7 +19844,7 @@ Ext.dd.DragTracker = Ext.extend(Ext.util.Observable, { }, onMouseMove: function(e, target){ - // HACK: IE hack to see if button was released outside of window. */ + if(this.active && Ext.isIE && !e.browserEvent.button){ e.preventDefault(); this.onMouseUp(e); @@ -31336,45 +19902,27 @@ Ext.dd.DragTracker = Ext.extend(Ext.util.Observable, { return false; }, - /** - * Template method which should be overridden by each DragTracker instance. Called when the user first clicks and - * holds the mouse button down. Return false to disallow the drag - * @param {Ext.EventObject} e The event object - */ + onBeforeStart : function(e) { }, - /** - * Template method which should be overridden by each DragTracker instance. Called when a drag operation starts - * (e.g. the user has moved the tracked element beyond the specified tolerance) - * @param {Array} xy x and y co-ordinates of the original location of the tracked element - */ + onStart : function(xy) { }, - /** - * Template method which should be overridden by each DragTracker instance. Called whenever a drag has been detected. - * @param {Ext.EventObject} e The event object - */ + onDrag : function(e) { }, - /** - * Template method which should be overridden by each DragTracker instance. Called when a drag operation has been completed - * (e.g. the user clicked and held the mouse down, dragged the element and then released the mouse button) - * @param {Ext.EventObject} e The event object - */ + onEnd : function(e) { }, - /** - * Returns the drag target - * @return {Ext.Element} The element currently being tracked - */ + getDragTarget : function(){ return this.dragTarget; }, @@ -31413,26 +19961,7 @@ Ext.dd.DragTracker = Ext.extend(Ext.util.Observable, { return [dr.left, dr.top]; } } -});/** - * @class Ext.dd.ScrollManager - *

    Provides automatic scrolling of overflow regions in the page during drag operations.

    - *

    The ScrollManager configs will be used as the defaults for any scroll container registered with it, - * but you can also override most of the configs per scroll container by adding a - * ddScrollConfig object to the target element that contains these properties: {@link #hthresh}, - * {@link #vthresh}, {@link #increment} and {@link #frequency}. Example usage: - *

    
    -var el = Ext.get('scroll-ct');
    -el.ddScrollConfig = {
    -    vthresh: 50,
    -    hthresh: -1,
    -    frequency: 100,
    -    increment: 200
    -};
    -Ext.dd.ScrollManager.register(el);
    -
    - * Note: This class uses "Point Mode" and is untested in "Intersect Mode". - * @singleton - */ +}); Ext.dd.ScrollManager = function(){ var ddm = Ext.dd.DragDropMgr; var els = {}; @@ -31488,7 +20017,7 @@ Ext.dd.ScrollManager = function(){ var dds = Ext.dd.ScrollManager; if(!dragEl || dragEl != ddm.dragCurrent){ dragEl = ddm.dragCurrent; - // refresh regions on drag start + dds.refreshCache(); } @@ -31528,10 +20057,7 @@ Ext.dd.ScrollManager = function(){ ddm.stopDrag = ddm.stopDrag.createSequence(onStop, ddm); return { - /** - * Registers new overflow element(s) to auto scroll - * @param {Mixed/Array} el The id of or the element to be scrolled or an array of either - */ + register : function(el){ if(Ext.isArray(el)){ for(var i = 0, len = el.length; i < len; i++) { @@ -31543,10 +20069,7 @@ Ext.dd.ScrollManager = function(){ } }, - /** - * Unregisters overflow element(s) so they are no longer scrolled - * @param {Mixed/Array} el The id of or the element to be removed or an array of either - */ + unregister : function(el){ if(Ext.isArray(el)){ for(var i = 0, len = el.length; i < len; i++) { @@ -31558,61 +20081,33 @@ Ext.dd.ScrollManager = function(){ } }, - /** - * The number of pixels from the top or bottom edge of a container the pointer needs to be to - * trigger scrolling (defaults to 25) - * @type Number - */ + vthresh : 25, - /** - * The number of pixels from the right or left edge of a container the pointer needs to be to - * trigger scrolling (defaults to 25) - * @type Number - */ + hthresh : 25, - /** - * The number of pixels to scroll in each scroll increment (defaults to 50) - * @type Number - */ + increment : 100, - /** - * The frequency of scrolls in milliseconds (defaults to 500) - * @type Number - */ + frequency : 500, - /** - * True to animate the scroll (defaults to true) - * @type Boolean - */ + animate: true, - /** - * The animation duration in seconds - - * MUST BE less than Ext.dd.ScrollManager.frequency! (defaults to .4) - * @type Number - */ + animDuration: .4, - /** - * Manually trigger a cache refresh. - */ + refreshCache : function(){ for(var id in els){ - if(typeof els[id] == 'object'){ // for people extending the object prototype + if(typeof els[id] == 'object'){ els[id]._region = els[id].getRegion(); } } } }; -}();/** - * @class Ext.dd.Registry - * Provides easy access to all drag drop components that are registered on a page. Items can be retrieved either - * directly by DOM node id, or by passing in the drag drop event that occurred and looking up the event target. - * @singleton - */ +}(); Ext.dd.Registry = function(){ var elements = {}; var handles = {}; @@ -31631,22 +20126,7 @@ Ext.dd.Registry = function(){ }; return { - /** - * Resgister a drag drop element - * @param {String/HTMLElement} element The id or DOM node to register - * @param {Object} data (optional) An custom data object that will be passed between the elements that are involved - * in drag drop operations. You can populate this object with any arbitrary properties that your own code - * knows how to interpret, plus there are some specific properties known to the Registry that should be - * populated in the data object (if applicable): - *
    -Value      Description
    ---------- ------------------------------------------
    -handles Array of DOM nodes that trigger dragging
    - for the element being registered
    -isHandle True if the element passed in triggers
    - dragging itself, else false -
    - */ + register : function(el, data){ data = data || {}; if(typeof el == "string"){ @@ -31665,10 +20145,7 @@ isHandle True if the element passed in triggers
    } }, - /** - * Unregister a drag drop element - * @param {String/HTMLElement} element The id or DOM node to unregister - */ + unregister : function(el){ var id = getId(el, false); var data = elements[id]; @@ -31683,57 +20160,35 @@ isHandle True if the element passed in triggers
    } }, - /** - * Returns the handle registered for a DOM Node by id - * @param {String/HTMLElement} id The DOM node or id to look up - * @return {Object} handle The custom handle data - */ + getHandle : function(id){ - if(typeof id != "string"){ // must be element? + if(typeof id != "string"){ id = id.id; } return handles[id]; }, - /** - * Returns the handle that is registered for the DOM node that is the target of the event - * @param {Event} e The event - * @return {Object} handle The custom handle data - */ + getHandleFromEvent : function(e){ var t = Ext.lib.Event.getTarget(e); return t ? handles[t.id] : null; }, - /** - * Returns a custom data object that is registered for a DOM node by id - * @param {String/HTMLElement} id The DOM node or id to look up - * @return {Object} data The custom data - */ + getTarget : function(id){ - if(typeof id != "string"){ // must be element? + if(typeof id != "string"){ id = id.id; } return elements[id]; }, - /** - * Returns a custom data object that is registered for the DOM node that is the target of the event - * @param {Event} e The event - * @return {Object} data The custom data - */ + getTargetFromEvent : function(e){ var t = Ext.lib.Event.getTarget(e); return t ? elements[t.id] || handles[t.id] : null; } }; -}();/** - * @class Ext.dd.StatusProxy - * A specialized drag proxy that supports a drop status icon, {@link Ext.Layer} styles and auto-repair. This is the - * default drag proxy used by all Ext.dd components. - * @constructor - * @param {Object} config - */ +}(); Ext.dd.StatusProxy = function(config){ Ext.apply(this, config); this.id = this.id || Ext.id(); @@ -31751,22 +20206,12 @@ Ext.dd.StatusProxy = function(config){ }; Ext.dd.StatusProxy.prototype = { - /** - * @cfg {String} dropAllowed - * The CSS class to apply to the status element when drop is allowed (defaults to "x-dd-drop-ok"). - */ + dropAllowed : "x-dd-drop-ok", - /** - * @cfg {String} dropNotAllowed - * The CSS class to apply to the status element when drop is not allowed (defaults to "x-dd-drop-nodrop"). - */ + dropNotAllowed : "x-dd-drop-nodrop", - /** - * Updates the proxy's visual element to indicate the status of whether or not drop is allowed - * over the current target element. - * @param {String} cssClass The css class for the new drop status indicator image - */ + setStatus : function(cssClass){ cssClass = cssClass || this.dropNotAllowed; if(this.dropStatus != cssClass){ @@ -31775,10 +20220,7 @@ Ext.dd.StatusProxy.prototype = { } }, - /** - * Resets the status indicator to the default dropNotAllowed value - * @param {Boolean} clearGhost True to also remove all content from the ghost, false to preserve it - */ + reset : function(clearGhost){ this.el.dom.className = "x-dd-drag-proxy " + this.dropNotAllowed; this.dropStatus = this.dropNotAllowed; @@ -31787,11 +20229,7 @@ Ext.dd.StatusProxy.prototype = { } }, - /** - * Updates the contents of the ghost element - * @param {String/HTMLElement} html The html that will replace the current innerHTML of the ghost element, or a - * DOM node to append as the child of the ghost element (in which case the innerHTML will be cleared first). - */ + update : function(html){ if(typeof html == "string"){ this.ghost.update(html); @@ -31806,26 +20244,17 @@ Ext.dd.StatusProxy.prototype = { } }, - /** - * Returns the underlying proxy {@link Ext.Layer} - * @return {Ext.Layer} el - */ + getEl : function(){ return this.el; }, - /** - * Returns the ghost element - * @return {Ext.Element} el - */ + getGhost : function(){ return this.ghost; }, - /** - * Hides the proxy - * @param {Boolean} clear True to reset the status and clear the ghost contents, false to preserve them - */ + hide : function(clear){ this.el.hide(); if(clear){ @@ -31833,36 +20262,24 @@ Ext.dd.StatusProxy.prototype = { } }, - /** - * Stops the repair animation if it's currently running - */ + stop : function(){ if(this.anim && this.anim.isAnimated && this.anim.isAnimated()){ this.anim.stop(); } }, - /** - * Displays this proxy - */ + show : function(){ this.el.show(); }, - /** - * Force the Layer to sync its shadow and shim positions to the element - */ + sync : function(){ this.el.sync(); }, - /** - * Causes the proxy to return to its position of origin via an animation. Should be called after an - * invalid drop operation by the item being dragged. - * @param {Array} xy The XY position of the element ([x, y]) - * @param {Function} callback The function to call after the repair is complete. - * @param {Object} scope The scope (this reference) in which the callback function is executed. Defaults to the browser window. - */ + repair : function(xy, callback, scope){ this.callback = callback; this.scope = scope; @@ -31882,7 +20299,7 @@ Ext.dd.StatusProxy.prototype = { } }, - // private + afterRepair : function(){ this.hide(true); if(typeof this.callback == "function"){ @@ -31895,14 +20312,7 @@ Ext.dd.StatusProxy.prototype = { destroy: function(){ Ext.destroy(this.ghost, this.el); } -};/** - * @class Ext.dd.DragSource - * @extends Ext.dd.DDProxy - * A simple class that provides the basic implementation needed to make any element draggable. - * @constructor - * @param {Mixed} el The container element - * @param {Object} config - */ +}; Ext.dd.DragSource = function(el, config){ this.el = Ext.get(el); if(!this.dragData){ @@ -31921,31 +20331,18 @@ Ext.dd.DragSource = function(el, config){ }; Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, { - /** - * @cfg {String} ddGroup - * A named drag drop group to which this object belongs. If a group is specified, then this object will only - * interact with other drag drop objects in the same group (defaults to undefined). - */ - /** - * @cfg {String} dropAllowed - * The CSS class returned to the drag source when drop is allowed (defaults to "x-dd-drop-ok"). - */ + + dropAllowed : "x-dd-drop-ok", - /** - * @cfg {String} dropNotAllowed - * The CSS class returned to the drag source when drop is not allowed (defaults to "x-dd-drop-nodrop"). - */ + dropNotAllowed : "x-dd-drop-nodrop", - /** - * Returns the data object associated with this drag source - * @return {Object} data An object containing arbitrary data - */ + getDragData : function(e){ return this.dragData; }, - // private + onDragEnter : function(e, id){ var target = Ext.dd.DragDropMgr.getDDById(id); this.cachedTarget = target; @@ -31958,38 +20355,24 @@ Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, { } if(this.afterDragEnter){ - /** - * An empty function by default, but provided so that you can perform a custom action - * when the dragged item enters the drop target by providing an implementation. - * @param {Ext.dd.DragDrop} target The drop target - * @param {Event} e The event object - * @param {String} id The id of the dragged element - * @method afterDragEnter - */ + this.afterDragEnter(target, e, id); } } }, - /** - * An empty function by default, but provided so that you can perform a custom action - * before the dragged item enters the drop target and optionally cancel the onDragEnter. - * @param {Ext.dd.DragDrop} target The drop target - * @param {Event} e The event object - * @param {String} id The id of the dragged element - * @return {Boolean} isValid True if the drag event is valid, else false to cancel - */ + beforeDragEnter : function(target, e, id){ return true; }, - // private + alignElWithMouse: function() { Ext.dd.DragSource.superclass.alignElWithMouse.apply(this, arguments); this.proxy.sync(); }, - // private + onDragOver : function(e, id){ var target = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(id); if(this.beforeDragOver(target, e, id) !== false){ @@ -31999,32 +20382,18 @@ Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, { } if(this.afterDragOver){ - /** - * An empty function by default, but provided so that you can perform a custom action - * while the dragged item is over the drop target by providing an implementation. - * @param {Ext.dd.DragDrop} target The drop target - * @param {Event} e The event object - * @param {String} id The id of the dragged element - * @method afterDragOver - */ + this.afterDragOver(target, e, id); } } }, - /** - * An empty function by default, but provided so that you can perform a custom action - * while the dragged item is over the drop target and optionally cancel the onDragOver. - * @param {Ext.dd.DragDrop} target The drop target - * @param {Event} e The event object - * @param {String} id The id of the dragged element - * @return {Boolean} isValid True if the drag event is valid, else false to cancel - */ + beforeDragOver : function(target, e, id){ return true; }, - // private + onDragOut : function(e, id){ var target = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(id); if(this.beforeDragOut(target, e, id) !== false){ @@ -32033,38 +20402,24 @@ Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, { } this.proxy.reset(); if(this.afterDragOut){ - /** - * An empty function by default, but provided so that you can perform a custom action - * after the dragged item is dragged out of the target without dropping. - * @param {Ext.dd.DragDrop} target The drop target - * @param {Event} e The event object - * @param {String} id The id of the dragged element - * @method afterDragOut - */ + this.afterDragOut(target, e, id); } } this.cachedTarget = null; }, - /** - * An empty function by default, but provided so that you can perform a custom action before the dragged - * item is dragged out of the target without dropping, and optionally cancel the onDragOut. - * @param {Ext.dd.DragDrop} target The drop target - * @param {Event} e The event object - * @param {String} id The id of the dragged element - * @return {Boolean} isValid True if the drag event is valid, else false to cancel - */ + beforeDragOut : function(target, e, id){ return true; }, - // private + onDragDrop : function(e, id){ var target = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(id); if(this.beforeDragDrop(target, e, id) !== false){ if(target.isNotifyTarget){ - if(target.notifyDrop(this, e, this.dragData)){ // valid drop? + if(target.notifyDrop(this, e, this.dragData)){ this.onValidDrop(target, e, id); }else{ this.onInvalidDrop(target, e, id); @@ -32074,54 +20429,33 @@ Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, { } if(this.afterDragDrop){ - /** - * An empty function by default, but provided so that you can perform a custom action - * after a valid drag drop has occurred by providing an implementation. - * @param {Ext.dd.DragDrop} target The drop target - * @param {Event} e The event object - * @param {String} id The id of the dropped element - * @method afterDragDrop - */ + this.afterDragDrop(target, e, id); } } delete this.cachedTarget; }, - /** - * An empty function by default, but provided so that you can perform a custom action before the dragged - * item is dropped onto the target and optionally cancel the onDragDrop. - * @param {Ext.dd.DragDrop} target The drop target - * @param {Event} e The event object - * @param {String} id The id of the dragged element - * @return {Boolean} isValid True if the drag drop event is valid, else false to cancel - */ + beforeDragDrop : function(target, e, id){ return true; }, - // private + onValidDrop : function(target, e, id){ this.hideProxy(); if(this.afterValidDrop){ - /** - * An empty function by default, but provided so that you can perform a custom action - * after a valid drop has occurred by providing an implementation. - * @param {Object} target The target DD - * @param {Event} e The event object - * @param {String} id The id of the dropped element - * @method afterInvalidDrop - */ + this.afterValidDrop(target, e, id); } }, - // private + getRepairXY : function(e, data){ return this.el.getXY(); }, - // private + onInvalidDrop : function(target, e, id){ this.beforeInvalidDrop(target, e, id); if(this.cachedTarget){ @@ -32133,18 +20467,12 @@ Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, { this.proxy.repair(this.getRepairXY(e, this.dragData), this.afterRepair, this); if(this.afterInvalidDrop){ - /** - * An empty function by default, but provided so that you can perform a custom action - * after an invalid drop has occurred by providing an implementation. - * @param {Event} e The event object - * @param {String} id The id of the dropped element - * @method afterInvalidDrop - */ + this.afterInvalidDrop(e, id); } }, - // private + afterRepair : function(){ if(Ext.enableFx){ this.el.highlight(this.hlColor || "c3daf9"); @@ -32152,19 +20480,12 @@ Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, { this.dragging = false; }, - /** - * An empty function by default, but provided so that you can perform a custom action after an invalid - * drop has occurred. - * @param {Ext.dd.DragDrop} target The drop target - * @param {Event} e The event object - * @param {String} id The id of the dragged element - * @return {Boolean} isValid True if the invalid drop should proceed, else false to cancel - */ + beforeInvalidDrop : function(target, e, id){ return true; }, - // private + handleMouseDown : function(e){ if(this.dragging) { return; @@ -32177,26 +20498,15 @@ Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, { } }, - /** - * An empty function by default, but provided so that you can perform a custom action before the initial - * drag event begins and optionally cancel it. - * @param {Object} data An object containing arbitrary data to be shared with drop targets - * @param {Event} e The event object - * @return {Boolean} isValid True if the drag event is valid, else false to cancel - */ + onBeforeDrag : function(data, e){ return true; }, - /** - * An empty function by default, but provided so that you can perform a custom action once the initial - * drag event has begun. The drag cannot be canceled from this function. - * @param {Number} x The x position of the click on the dragged object - * @param {Number} y The y position of the click on the dragged object - */ + onStartDrag : Ext.emptyFn, - // private override + startDrag : function(x, y){ this.proxy.reset(); this.dragging = true; @@ -32205,51 +20515,46 @@ Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, { this.proxy.show(); }, - // private + onInitDrag : function(x, y){ var clone = this.el.dom.cloneNode(true); - clone.id = Ext.id(); // prevent duplicate ids + clone.id = Ext.id(); this.proxy.update(clone); this.onStartDrag(x, y); return true; }, - /** - * Returns the drag source's underlying {@link Ext.dd.StatusProxy} - * @return {Ext.dd.StatusProxy} proxy The StatusProxy - */ + getProxy : function(){ return this.proxy; }, - /** - * Hides the drag source's {@link Ext.dd.StatusProxy} - */ + hideProxy : function(){ this.proxy.hide(); this.proxy.reset(true); this.dragging = false; }, - // private + triggerCacheRefresh : function(){ Ext.dd.DDM.refreshCache(this.groups); }, - // private - override to prevent hiding + b4EndDrag: function(e) { }, - // private - override to prevent moving + endDrag : function(e){ this.onEndDrag(this.dragData, e); }, - // private + onEndDrag : function(data, e){ }, - // private - pin to cursor + autoOffset : function(x, y) { this.setDelta(-12, -20); }, @@ -32258,15 +20563,7 @@ Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, { Ext.dd.DragSource.superclass.destroy.call(this); Ext.destroy(this.proxy); } -});/** - * @class Ext.dd.DropTarget - * @extends Ext.dd.DDTarget - * A simple class that provides the basic implementation needed to make any element a drop target that can have - * draggable items dropped onto it. The drop has no effect until an implementation of notifyDrop is provided. - * @constructor - * @param {Mixed} el The container element - * @param {Object} config - */ +}); Ext.dd.DropTarget = function(el, config){ this.el = Ext.get(el); @@ -32282,42 +20579,20 @@ Ext.dd.DropTarget = function(el, config){ }; Ext.extend(Ext.dd.DropTarget, Ext.dd.DDTarget, { - /** - * @cfg {String} ddGroup - * A named drag drop group to which this object belongs. If a group is specified, then this object will only - * interact with other drag drop objects in the same group (defaults to undefined). - */ - /** - * @cfg {String} overClass - * The CSS class applied to the drop target element while the drag source is over it (defaults to ""). - */ - /** - * @cfg {String} dropAllowed - * The CSS class returned to the drag source when drop is allowed (defaults to "x-dd-drop-ok"). - */ + + + dropAllowed : "x-dd-drop-ok", - /** - * @cfg {String} dropNotAllowed - * The CSS class returned to the drag source when drop is not allowed (defaults to "x-dd-drop-nodrop"). - */ + dropNotAllowed : "x-dd-drop-nodrop", - // private + isTarget : true, - // private + isNotifyTarget : true, - /** - * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the source is now over the - * target. This default implementation adds the CSS class specified by overClass (if any) to the drop element - * and returns the dropAllowed config value. This method should be overridden if drop validation is required. - * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag source - * @return {String} status The CSS class that communicates the drop status back to the source so that the - * underlying {@link Ext.dd.StatusProxy} can be updated - */ + notifyEnter : function(dd, e, data){ if(this.overClass){ this.el.addClass(this.overClass); @@ -32325,105 +20600,23 @@ Ext.extend(Ext.dd.DropTarget, Ext.dd.DDTarget, { return this.dropAllowed; }, - /** - * The function a {@link Ext.dd.DragSource} calls continuously while it is being dragged over the target. - * This method will be called on every mouse movement while the drag source is over the drop target. - * This default implementation simply returns the dropAllowed config value. - * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag source - * @return {String} status The CSS class that communicates the drop status back to the source so that the - * underlying {@link Ext.dd.StatusProxy} can be updated - */ + notifyOver : function(dd, e, data){ return this.dropAllowed; }, - /** - * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the source has been dragged - * out of the target without dropping. This default implementation simply removes the CSS class specified by - * overClass (if any) from the drop element. - * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag source - */ + notifyOut : function(dd, e, data){ if(this.overClass){ this.el.removeClass(this.overClass); } }, - /** - * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the dragged item has - * been dropped on it. This method has no default implementation and returns false, so you must provide an - * implementation that does something to process the drop event and returns true so that the drag source's - * repair action does not run. - * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag source - * @return {Boolean} True if the drop was valid, else false - */ + notifyDrop : function(dd, e, data){ return false; } -});/** - * @class Ext.dd.DragZone - * @extends Ext.dd.DragSource - *

    This class provides a container DD instance that allows dragging of multiple child source nodes.

    - *

    This class does not move the drag target nodes, but a proxy element which may contain - * any DOM structure you wish. The DOM element to show in the proxy is provided by either a - * provided implementation of {@link #getDragData}, or by registered draggables registered with {@link Ext.dd.Registry}

    - *

    If you wish to provide draggability for an arbitrary number of DOM nodes, each of which represent some - * application object (For example nodes in a {@link Ext.DataView DataView}) then use of this class - * is the most efficient way to "activate" those nodes.

    - *

    By default, this class requires that draggable child nodes are registered with {@link Ext.dd.Registry}. - * However a simpler way to allow a DragZone to manage any number of draggable elements is to configure - * the DragZone with an implementation of the {@link #getDragData} method which interrogates the passed - * mouse event to see if it has taken place within an element, or class of elements. This is easily done - * by using the event's {@link Ext.EventObject#getTarget getTarget} method to identify a node based on a - * {@link Ext.DomQuery} selector. For example, to make the nodes of a DataView draggable, use the following - * technique. Knowledge of the use of the DataView is required:

    
    -myDataView.on('render', function(v) {
    -    myDataView.dragZone = new Ext.dd.DragZone(v.getEl(), {
    -
    -//      On receipt of a mousedown event, see if it is within a DataView node.
    -//      Return a drag data object if so.
    -        getDragData: function(e) {
    -
    -//          Use the DataView's own itemSelector (a mandatory property) to
    -//          test if the mousedown is within one of the DataView's nodes.
    -            var sourceEl = e.getTarget(v.itemSelector, 10);
    -
    -//          If the mousedown is within a DataView node, clone the node to produce
    -//          a ddel element for use by the drag proxy. Also add application data
    -//          to the returned data object.
    -            if (sourceEl) {
    -                d = sourceEl.cloneNode(true);
    -                d.id = Ext.id();
    -                return {
    -                    ddel: d,
    -                    sourceEl: sourceEl,
    -                    repairXY: Ext.fly(sourceEl).getXY(),
    -                    sourceStore: v.store,
    -                    draggedRecord: v.{@link Ext.DataView#getRecord getRecord}(sourceEl)
    -                }
    -            }
    -        },
    -
    -//      Provide coordinates for the proxy to slide back to on failed drag.
    -//      This is the original XY coordinates of the draggable element captured
    -//      in the getDragData method.
    -        getRepairXY: function() {
    -            return this.dragData.repairXY;
    -        }
    -    });
    -});
    - * See the {@link Ext.dd.DropZone DropZone} documentation for details about building a DropZone which - * cooperates with this DragZone. - * @constructor - * @param {Mixed} el The container element - * @param {Object} config - */ +}); Ext.dd.DragZone = function(el, config){ Ext.dd.DragZone.superclass.constructor.call(this, el, config); if(this.containerScroll){ @@ -32432,50 +20625,23 @@ Ext.dd.DragZone = function(el, config){ }; Ext.extend(Ext.dd.DragZone, Ext.dd.DragSource, { - /** - * This property contains the data representing the dragged object. This data is set up by the implementation - * of the {@link #getDragData} method. It must contain a ddel property, but can contain - * any other data according to the application's needs. - * @type Object - * @property dragData - */ - /** - * @cfg {Boolean} containerScroll True to register this container with the Scrollmanager - * for auto scrolling during drag operations. - */ - /** - * @cfg {String} hlColor The color to use when visually highlighting the drag source in the afterRepair - * method after a failed drop (defaults to "c3daf9" - light blue) - */ + + + - /** - * Called when a mousedown occurs in this container. Looks in {@link Ext.dd.Registry} - * for a valid target to drag based on the mouse down. Override this method - * to provide your own lookup logic (e.g. finding a child by class name). Make sure your returned - * object has a "ddel" attribute (with an HTML Element) for other functions to work. - * @param {EventObject} e The mouse down event - * @return {Object} The dragData - */ + getDragData : function(e){ return Ext.dd.Registry.getHandleFromEvent(e); }, - /** - * Called once drag threshold has been reached to initialize the proxy element. By default, it clones the - * this.dragData.ddel - * @param {Number} x The x position of the click on the dragged object - * @param {Number} y The y position of the click on the dragged object - * @return {Boolean} true to continue the drag, false to cancel - */ + onInitDrag : function(x, y){ this.proxy.update(this.dragData.ddel.cloneNode(true)); this.onStartDrag(x, y); return true; }, - /** - * Called after a repair of an invalid drop. By default, highlights this.dragData.ddel - */ + afterRepair : function(){ if(Ext.enableFx){ Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor || "c3daf9"); @@ -32483,214 +20649,60 @@ Ext.extend(Ext.dd.DragZone, Ext.dd.DragSource, { this.dragging = false; }, - /** - * Called before a repair of an invalid drop to get the XY to animate to. By default returns - * the XY of this.dragData.ddel - * @param {EventObject} e The mouse up event - * @return {Array} The xy location (e.g. [100, 200]) - */ + getRepairXY : function(e){ return Ext.Element.fly(this.dragData.ddel).getXY(); } -});/** - * @class Ext.dd.DropZone - * @extends Ext.dd.DropTarget - *

    This class provides a container DD instance that allows dropping on multiple child target nodes.

    - *

    By default, this class requires that child nodes accepting drop are registered with {@link Ext.dd.Registry}. - * However a simpler way to allow a DropZone to manage any number of target elements is to configure the - * DropZone with an implementation of {@link #getTargetFromEvent} which interrogates the passed - * mouse event to see if it has taken place within an element, or class of elements. This is easily done - * by using the event's {@link Ext.EventObject#getTarget getTarget} method to identify a node based on a - * {@link Ext.DomQuery} selector.

    - *

    Once the DropZone has detected through calling getTargetFromEvent, that the mouse is over - * a drop target, that target is passed as the first parameter to {@link #onNodeEnter}, {@link #onNodeOver}, - * {@link #onNodeOut}, {@link #onNodeDrop}. You may configure the instance of DropZone with implementations - * of these methods to provide application-specific behaviour for these events to update both - * application state, and UI state.

    - *

    For example to make a GridPanel a cooperating target with the example illustrated in - * {@link Ext.dd.DragZone DragZone}, the following technique might be used:

    
    -myGridPanel.on('render', function() {
    -    myGridPanel.dropZone = new Ext.dd.DropZone(myGridPanel.getView().scroller, {
    -
    -//      If the mouse is over a grid row, return that node. This is
    -//      provided as the "target" parameter in all "onNodeXXXX" node event handling functions
    -        getTargetFromEvent: function(e) {
    -            return e.getTarget(myGridPanel.getView().rowSelector);
    -        },
    -
    -//      On entry into a target node, highlight that node.
    -        onNodeEnter : function(target, dd, e, data){ 
    -            Ext.fly(target).addClass('my-row-highlight-class');
    -        },
    -
    -//      On exit from a target node, unhighlight that node.
    -        onNodeOut : function(target, dd, e, data){ 
    -            Ext.fly(target).removeClass('my-row-highlight-class');
    -        },
    -
    -//      While over a target node, return the default drop allowed class which
    -//      places a "tick" icon into the drag proxy.
    -        onNodeOver : function(target, dd, e, data){ 
    -            return Ext.dd.DropZone.prototype.dropAllowed;
    -        },
    -
    -//      On node drop we can interrogate the target to find the underlying
    -//      application object that is the real target of the dragged data.
    -//      In this case, it is a Record in the GridPanel's Store.
    -//      We can use the data set up by the DragZone's getDragData method to read
    -//      any data we decided to attach in the DragZone's getDragData method.
    -        onNodeDrop : function(target, dd, e, data){
    -            var rowIndex = myGridPanel.getView().findRowIndex(target);
    -            var r = myGridPanel.getStore().getAt(rowIndex);
    -            Ext.Msg.alert('Drop gesture', 'Dropped Record id ' + data.draggedRecord.id +
    -                ' on Record id ' + r.id);
    -            return true;
    -        }
    -    });
    -}
    -
    - * See the {@link Ext.dd.DragZone DragZone} documentation for details about building a DragZone which - * cooperates with this DropZone. - * @constructor - * @param {Mixed} el The container element - * @param {Object} config - */ +}); Ext.dd.DropZone = function(el, config){ Ext.dd.DropZone.superclass.constructor.call(this, el, config); }; Ext.extend(Ext.dd.DropZone, Ext.dd.DropTarget, { - /** - * Returns a custom data object associated with the DOM node that is the target of the event. By default - * this looks up the event target in the {@link Ext.dd.Registry}, although you can override this method to - * provide your own custom lookup. - * @param {Event} e The event - * @return {Object} data The custom data - */ + getTargetFromEvent : function(e){ return Ext.dd.Registry.getTargetFromEvent(e); }, - /** - * Called when the DropZone determines that a {@link Ext.dd.DragSource} has entered a drop node - * that has either been registered or detected by a configured implementation of {@link #getTargetFromEvent}. - * This method has no default implementation and should be overridden to provide - * node-specific processing if necessary. - * @param {Object} nodeData The custom data associated with the drop node (this is the same value returned from - * {@link #getTargetFromEvent} for this node) - * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag source - */ + onNodeEnter : function(n, dd, e, data){ }, - /** - * Called while the DropZone determines that a {@link Ext.dd.DragSource} is over a drop node - * that has either been registered or detected by a configured implementation of {@link #getTargetFromEvent}. - * The default implementation returns this.dropNotAllowed, so it should be - * overridden to provide the proper feedback. - * @param {Object} nodeData The custom data associated with the drop node (this is the same value returned from - * {@link #getTargetFromEvent} for this node) - * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag source - * @return {String} status The CSS class that communicates the drop status back to the source so that the - * underlying {@link Ext.dd.StatusProxy} can be updated - */ + onNodeOver : function(n, dd, e, data){ return this.dropAllowed; }, - /** - * Called when the DropZone determines that a {@link Ext.dd.DragSource} has been dragged out of - * the drop node without dropping. This method has no default implementation and should be overridden to provide - * node-specific processing if necessary. - * @param {Object} nodeData The custom data associated with the drop node (this is the same value returned from - * {@link #getTargetFromEvent} for this node) - * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag source - */ + onNodeOut : function(n, dd, e, data){ }, - /** - * Called when the DropZone determines that a {@link Ext.dd.DragSource} has been dropped onto - * the drop node. The default implementation returns false, so it should be overridden to provide the - * appropriate processing of the drop event and return true so that the drag source's repair action does not run. - * @param {Object} nodeData The custom data associated with the drop node (this is the same value returned from - * {@link #getTargetFromEvent} for this node) - * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag source - * @return {Boolean} True if the drop was valid, else false - */ + onNodeDrop : function(n, dd, e, data){ return false; }, - /** - * Called while the DropZone determines that a {@link Ext.dd.DragSource} is being dragged over it, - * but not over any of its registered drop nodes. The default implementation returns this.dropNotAllowed, so - * it should be overridden to provide the proper feedback if necessary. - * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag source - * @return {String} status The CSS class that communicates the drop status back to the source so that the - * underlying {@link Ext.dd.StatusProxy} can be updated - */ + onContainerOver : function(dd, e, data){ return this.dropNotAllowed; }, - /** - * Called when the DropZone determines that a {@link Ext.dd.DragSource} has been dropped on it, - * but not on any of its registered drop nodes. The default implementation returns false, so it should be - * overridden to provide the appropriate processing of the drop event if you need the drop zone itself to - * be able to accept drops. It should return true when valid so that the drag source's repair action does not run. - * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag source - * @return {Boolean} True if the drop was valid, else false - */ + onContainerDrop : function(dd, e, data){ return false; }, - /** - * The function a {@link Ext.dd.DragSource} calls once to notify this drop zone that the source is now over - * the zone. The default implementation returns this.dropNotAllowed and expects that only registered drop - * nodes can process drag drop operations, so if you need the drop zone itself to be able to process drops - * you should override this method and provide a custom implementation. - * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag source - * @return {String} status The CSS class that communicates the drop status back to the source so that the - * underlying {@link Ext.dd.StatusProxy} can be updated - */ + notifyEnter : function(dd, e, data){ return this.dropNotAllowed; }, - /** - * The function a {@link Ext.dd.DragSource} calls continuously while it is being dragged over the drop zone. - * This method will be called on every mouse movement while the drag source is over the drop zone. - * It will call {@link #onNodeOver} while the drag source is over a registered node, and will also automatically - * delegate to the appropriate node-specific methods as necessary when the drag source enters and exits - * registered nodes ({@link #onNodeEnter}, {@link #onNodeOut}). If the drag source is not currently over a - * registered node, it will call {@link #onContainerOver}. - * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag source - * @return {String} status The CSS class that communicates the drop status back to the source so that the - * underlying {@link Ext.dd.StatusProxy} can be updated - */ + notifyOver : function(dd, e, data){ var n = this.getTargetFromEvent(e); - if(!n){ // not over valid drop target + if(!n){ if(this.lastOverNode){ this.onNodeOut(this.lastOverNode, dd, e, data); this.lastOverNode = null; @@ -32707,14 +20719,7 @@ Ext.extend(Ext.dd.DropZone, Ext.dd.DropTarget, { return this.onNodeOver(n, dd, e, data); }, - /** - * The function a {@link Ext.dd.DragSource} calls once to notify this drop zone that the source has been dragged - * out of the zone without dropping. If the drag source is currently over a registered node, the notification - * will be delegated to {@link #onNodeOut} for node-specific handling, otherwise it will be ignored. - * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag zone - */ + notifyOut : function(dd, e, data){ if(this.lastOverNode){ this.onNodeOut(this.lastOverNode, dd, e, data); @@ -32722,16 +20727,7 @@ Ext.extend(Ext.dd.DropZone, Ext.dd.DropTarget, { } }, - /** - * The function a {@link Ext.dd.DragSource} calls once to notify this drop zone that the dragged item has - * been dropped on it. The drag zone will look up the target node based on the event passed in, and if there - * is a node registered for that event, it will delegate to {@link #onNodeDrop} for node-specific handling, - * otherwise it will call {@link #onContainerDrop}. - * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag source - * @return {Boolean} True if the drop was valid, else false - */ + notifyDrop : function(dd, e, data){ if(this.lastOverNode){ this.onNodeOut(this.lastOverNode, dd, e, data); @@ -32743,81 +20739,41 @@ Ext.extend(Ext.dd.DropZone, Ext.dd.DropTarget, { this.onContainerDrop(dd, e, data); }, - // private + triggerCacheRefresh : function(){ Ext.dd.DDM.refreshCache(this.groups); } -});/** - * @class Ext.Element - */ +}); Ext.Element.addMethods({ - /** - * Initializes a {@link Ext.dd.DD} drag drop object for this element. - * @param {String} group The group the DD object is member of - * @param {Object} config The DD config object - * @param {Object} overrides An object containing methods to override/implement on the DD object - * @return {Ext.dd.DD} The DD object - */ + initDD : function(group, config, overrides){ var dd = new Ext.dd.DD(Ext.id(this.dom), group, config); return Ext.apply(dd, overrides); }, - /** - * Initializes a {@link Ext.dd.DDProxy} object for this element. - * @param {String} group The group the DDProxy object is member of - * @param {Object} config The DDProxy config object - * @param {Object} overrides An object containing methods to override/implement on the DDProxy object - * @return {Ext.dd.DDProxy} The DDProxy object - */ + initDDProxy : function(group, config, overrides){ var dd = new Ext.dd.DDProxy(Ext.id(this.dom), group, config); return Ext.apply(dd, overrides); }, - /** - * Initializes a {@link Ext.dd.DDTarget} object for this element. - * @param {String} group The group the DDTarget object is member of - * @param {Object} config The DDTarget config object - * @param {Object} overrides An object containing methods to override/implement on the DDTarget object - * @return {Ext.dd.DDTarget} The DDTarget object - */ + initDDTarget : function(group, config, overrides){ var dd = new Ext.dd.DDTarget(Ext.id(this.dom), group, config); return Ext.apply(dd, overrides); } }); -/** - * @class Ext.data.Api - * @extends Object - * Ext.data.Api is a singleton designed to manage the data API including methods - * for validating a developer's DataProxy API. Defines variables for CRUD actions - * create, read, update and destroy in addition to a mapping of RESTful HTTP methods - * GET, POST, PUT and DELETE to CRUD actions. - * @singleton - */ + Ext.data.Api = (function() { - // private validActions. validActions is essentially an inverted hash of Ext.data.Api.actions, where value becomes the key. - // Some methods in this singleton (e.g.: getActions, getVerb) will loop through actions with the code for (var verb in this.actions) - // For efficiency, some methods will first check this hash for a match. Those methods which do acces validActions will cache their result here. - // We cannot pre-define this hash since the developer may over-ride the actions at runtime. + + + + var validActions = {}; return { - /** - * Defined actions corresponding to remote actions: - *
    
    -actions: {
    -    create  : 'create',  // Text representing the remote-action to create records on server.
    -    read    : 'read',    // Text representing the remote-action to read/load data from server.
    -    update  : 'update',  // Text representing the remote-action to update records on server.
    -    destroy : 'destroy'  // Text representing the remote-action to destroy records on server.
    -}
    -         * 
    - * @property actions - * @type Object - */ + actions : { create : 'create', read : 'read', @@ -32825,19 +20781,7 @@ actions: { destroy : 'destroy' }, - /** - * Defined {CRUD action}:{HTTP method} pairs to associate HTTP methods with the - * corresponding actions for {@link Ext.data.DataProxy#restful RESTful proxies}. - * Defaults to: - *
    
    -restActions : {
    -    create  : 'POST',
    -    read    : 'GET',
    -    update  : 'PUT',
    -    destroy : 'DELETE'
    -},
    -         * 
    - */ + restActions : { create : 'POST', read : 'GET', @@ -32845,27 +20789,15 @@ restActions : { destroy : 'DELETE' }, - /** - * Returns true if supplied action-name is a valid API action defined in {@link #actions} constants - * @param {String} action Action to test for availability. - * @return {Boolean} - */ + isAction : function(action) { return (Ext.data.Api.actions[action]) ? true : false; }, - /** - * Returns the actual CRUD action KEY "create", "read", "update" or "destroy" from the supplied action-name. This method is used internally and shouldn't generally - * need to be used directly. The key/value pair of Ext.data.Api.actions will often be identical but this is not necessarily true. A developer can override this naming - * convention if desired. However, the framework internally calls methods based upon the KEY so a way of retreiving the the words "create", "read", "update" and "destroy" is - * required. This method will cache discovered KEYS into the private validActions hash. - * @param {String} name The runtime name of the action. - * @return {String||null} returns the action-key, or verb of the user-action or null if invalid. - * @nodoc - */ + getVerb : function(name) { if (validActions[name]) { - return validActions[name]; // <-- found in cache. return immediately. + return validActions[name]; } for (var verb in this.actions) { if (this.actions[verb] === name) { @@ -32876,14 +20808,10 @@ restActions : { return (validActions[name] !== undefined) ? validActions[name] : null; }, - /** - * Returns true if the supplied API is valid; that is, check that all keys match defined actions - * otherwise returns an array of mistakes. - * @return {String[]|true} - */ + isValid : function(api){ var invalid = []; - var crud = this.actions; // <-- cache a copy of the actions. + var crud = this.actions; for (var action in api) { if (!(action in crud)) { invalid.push(action); @@ -32892,14 +20820,7 @@ restActions : { return (!invalid.length) ? true : invalid; }, - /** - * Returns true if the supplied verb upon the supplied proxy points to a unique url in that none of the other api-actions - * point to the same url. The question is important for deciding whether to insert the "xaction" HTTP parameter within an - * Ajax request. This method is used internally and shouldn't generally need to be called directly. - * @param {Ext.data.DataProxy} proxy - * @param {String} verb - * @return {Boolean} - */ + hasUniqueUrl : function(proxy, verb) { var url = (proxy.api[verb]) ? proxy.api[verb].url : null; var unique = true; @@ -32911,39 +20832,10 @@ restActions : { return unique; }, - /** - * This method is used internally by {@link Ext.data.DataProxy DataProxy} and should not generally need to be used directly. - * Each action of a DataProxy api can be initially defined as either a String or an Object. When specified as an object, - * one can explicitly define the HTTP method (GET|POST) to use for each CRUD action. This method will prepare the supplied API, setting - * each action to the Object form. If your API-actions do not explicitly define the HTTP method, the "method" configuration-parameter will - * be used. If the method configuration parameter is not specified, POST will be used. -
    
    -new Ext.data.HttpProxy({
    -    method: "POST",     // <-- default HTTP method when not specified.
    -    api: {
    -        create: 'create.php',
    -        load: 'read.php',
    -        save: 'save.php',
    -        destroy: 'destroy.php'
    -    }
    -});
    -
    -// Alternatively, one can use the object-form to specify the API
    -new Ext.data.HttpProxy({
    -    api: {
    -        load: {url: 'read.php', method: 'GET'},
    -        create: 'create.php',
    -        destroy: 'destroy.php',
    -        save: 'update.php'
    -    }
    -});
    -        
    - * - * @param {Ext.data.DataProxy} proxy - */ + prepare : function(proxy) { if (!proxy.api) { - proxy.api = {}; // <-- No api? create a blank one. + proxy.api = {}; } for (var verb in this.actions) { var action = this.actions[verb]; @@ -32957,19 +20849,15 @@ new Ext.data.HttpProxy({ } }, - /** - * Prepares a supplied Proxy to be RESTful. Sets the HTTP method for each api-action to be one of - * GET, POST, PUT, DELETE according to the defined {@link #restActions}. - * @param {Ext.data.DataProxy} proxy - */ + restify : function(proxy) { proxy.restful = true; for (var verb in this.restActions) { proxy.api[this.actions[verb]].method || (proxy.api[this.actions[verb]].method = this.restActions[verb]); } - // TODO: perhaps move this interceptor elsewhere? like into DataProxy, perhaps? Placed here - // to satisfy initial 3.0 final release of REST features. + + proxy.onWrite = proxy.onWrite.createInterceptor(function(action, o, response, rs) { var reader = o.reader; var res = new Ext.data.Response({ @@ -32978,18 +20866,18 @@ new Ext.data.HttpProxy({ }); switch (response.status) { - case 200: // standard 200 response, send control back to HttpProxy#onWrite by returning true from this intercepted #onWrite + case 200: return true; break; - case 201: // entity created but no response returned + case 201: if (Ext.isEmpty(res.raw.responseText)) { res.success = true; } else { - //if the response contains data, treat it like a 200 + return true; } break; - case 204: // no-content. Create a fake response. + case 204: res.success = true; res.data = null; break; @@ -33004,16 +20892,13 @@ new Ext.data.HttpProxy({ } o.request.callback.call(o.request.scope, res.data, res, res.success); - return false; // <-- false to prevent intercepted function from running. + return false; }, proxy); } }; })(); -/** - * Ext.data.Response - * Experimental. Do not use directly. - */ + Ext.data.Response = function(params, response) { Ext.apply(this, params, { raw: response @@ -33043,11 +20928,7 @@ Ext.data.Response.prototype = { } }; -/** - * @class Ext.data.Api.Error - * @extends Ext.Error - * Error class for Ext.data.Api errors - */ + Ext.data.Api.Error = Ext.extend(Ext.Error, { constructor : function(message, arg) { this.arg = arg; @@ -33066,60 +20947,32 @@ Ext.apply(Ext.data.Api.Error.prototype, { -/** - * @class Ext.data.SortTypes - * @singleton - * Defines the default sorting (casting?) comparison functions used when sorting data. - */ + Ext.data.SortTypes = { - /** - * Default sort that does nothing - * @param {Mixed} s The value being converted - * @return {Mixed} The comparison value - */ + none : function(s){ return s; }, - /** - * The regular expression used to strip tags - * @type {RegExp} - * @property - */ + stripTagsRE : /<\/?[^>]+>/gi, - /** - * Strips all HTML tags to sort on text only - * @param {Mixed} s The value being converted - * @return {String} The comparison value - */ + asText : function(s){ return String(s).replace(this.stripTagsRE, ""); }, - /** - * Strips all HTML tags to sort on text only - Case insensitive - * @param {Mixed} s The value being converted - * @return {String} The comparison value - */ + asUCText : function(s){ return String(s).toUpperCase().replace(this.stripTagsRE, ""); }, - /** - * Case insensitive string - * @param {Mixed} s The value being converted - * @return {String} The comparison value - */ + asUCString : function(s) { return String(s).toUpperCase(); }, - /** - * Date sorting - * @param {Mixed} s The value being converted - * @return {Number} The comparison value - */ + asDate : function(s) { if(!s){ return 0; @@ -33130,99 +20983,25 @@ Ext.data.SortTypes = { return Date.parse(String(s)); }, - /** - * Float sorting - * @param {Mixed} s The value being converted - * @return {Float} The comparison value - */ + asFloat : function(s) { var val = parseFloat(String(s).replace(/,/g, "")); return isNaN(val) ? 0 : val; }, - /** - * Integer sorting - * @param {Mixed} s The value being converted - * @return {Number} The comparison value - */ + asInt : function(s) { var val = parseInt(String(s).replace(/,/g, ""), 10); return isNaN(val) ? 0 : val; } -};/** - * @class Ext.data.Record - *

    Instances of this class encapsulate both Record definition information, and Record - * value information for use in {@link Ext.data.Store} objects, or any code which needs - * to access Records cached in an {@link Ext.data.Store} object.

    - *

    Constructors for this class are generated by passing an Array of field definition objects to {@link #create}. - * Instances are usually only created by {@link Ext.data.Reader} implementations when processing unformatted data - * objects.

    - *

    Note that an instance of a Record class may only belong to one {@link Ext.data.Store Store} at a time. - * In order to copy data from one Store to another, use the {@link #copy} method to create an exact - * copy of the Record, and insert the new instance into the other Store.

    - *

    When serializing a Record for submission to the server, be aware that it contains many private - * properties, and also a reference to its owning Store which in turn holds references to its Records. - * This means that a whole Record may not be encoded using {@link Ext.util.JSON.encode}. Instead, use the - * {@link #data} and {@link #id} properties.

    - *

    Record objects generated by this constructor inherit all the methods of Ext.data.Record listed below.

    - * @constructor - *

    This constructor should not be used to create Record objects. Instead, use {@link #create} to - * generate a subclass of Ext.data.Record configured with information about its constituent fields.

    - *

    The generated constructor has the same signature as this constructor.

    - * @param {Object} data (Optional) An object, the properties of which provide values for the new Record's - * fields. If not specified the {@link Ext.data.Field#defaultValue defaultValue} - * for each field will be assigned. - * @param {Object} id (Optional) The id of the Record. The id is used by the - * {@link Ext.data.Store} object which owns the Record to index its collection - * of Records (therefore this id should be unique within each store). If an - * id is not specified a {@link #phantom} - * Record will be created with an {@link #Record.id automatically generated id}. - */ +}; Ext.data.Record = function(data, id){ - // if no id, call the auto id method + this.id = (id || id === 0) ? id : Ext.data.Record.id(this); this.data = data || {}; }; -/** - * Generate a constructor for a specific Record layout. - * @param {Array} o An Array of {@link Ext.data.Field Field} definition objects. - * The constructor generated by this method may be used to create new Record instances. The data - * object must contain properties named after the {@link Ext.data.Field field} - * {@link Ext.data.Field#name}s. Example usage:
    
    -// create a Record constructor from a description of the fields
    -var TopicRecord = Ext.data.Record.create([ // creates a subclass of Ext.data.Record
    -    {{@link Ext.data.Field#name name}: 'title', {@link Ext.data.Field#mapping mapping}: 'topic_title'},
    -    {name: 'author', mapping: 'username', allowBlank: false},
    -    {name: 'totalPosts', mapping: 'topic_replies', type: 'int'},
    -    {name: 'lastPost', mapping: 'post_time', type: 'date'},
    -    {name: 'lastPoster', mapping: 'user2'},
    -    {name: 'excerpt', mapping: 'post_text', allowBlank: false},
    -    // In the simplest case, if no properties other than name are required,
    -    // a field definition may consist of just a String for the field name.
    -    'signature'
    -]);
     
    -// create Record instance
    -var myNewRecord = new TopicRecord(
    -    {
    -        title: 'Do my job please',
    -        author: 'noobie',
    -        totalPosts: 1,
    -        lastPost: new Date(),
    -        lastPoster: 'Animal',
    -        excerpt: 'No way dude!',
    -        signature: ''
    -    },
    -    id // optionally specify the id of the record otherwise {@link #Record.id one is auto-assigned}
    -);
    -myStore.{@link Ext.data.Store#add add}(myNewRecord);
    -
    - * @method create - * @return {Function} A constructor which is used to create new Records according - * to the definition. The constructor has the same signature as {@link #Record}. - * @static - */ Ext.data.Record.create = function(o){ var f = Ext.extend(Ext.data.Record, {}); var p = f.prototype; @@ -33245,122 +21024,34 @@ Ext.data.Record.REJECT = 'reject'; Ext.data.Record.COMMIT = 'commit'; -/** - * Generates a sequential id. This method is typically called when a record is {@link #create}d - * and {@link #Record no id has been specified}. The returned id takes the form: - * {PREFIX}-{AUTO_ID}.
      - *
    • PREFIX : String

      Ext.data.Record.PREFIX - * (defaults to 'ext-record')

    • - *
    • AUTO_ID : String

      Ext.data.Record.AUTO_ID - * (defaults to 1 initially)

    • - *
    - * @param {Record} rec The record being created. The record does not exist, it's a {@link #phantom}. - * @return {String} auto-generated string id, "ext-record-i++'; - */ + Ext.data.Record.id = function(rec) { rec.phantom = true; return [Ext.data.Record.PREFIX, '-', Ext.data.Record.AUTO_ID++].join(''); }; Ext.data.Record.prototype = { - /** - *

    This property is stored in the Record definition's prototype

    - * A MixedCollection containing the defined {@link Ext.data.Field Field}s for this Record. Read-only. - * @property fields - * @type Ext.util.MixedCollection - */ - /** - * An object hash representing the data for this Record. Every field name in the Record definition - * is represented by a property of that name in this object. Note that unless you specified a field - * with {@link Ext.data.Field#name name} "id" in the Record definition, this will not contain - * an id property. - * @property data - * @type {Object} - */ - /** - * The unique ID of the Record {@link #Record as specified at construction time}. - * @property id - * @type {Object} - */ - /** - *

    Only present if this Record was created by an {@link Ext.data.XmlReader XmlReader}.

    - *

    The XML element which was the source of the data for this Record.

    - * @property node - * @type {XMLElement} - */ - /** - *

    Only present if this Record was created by an {@link Ext.data.ArrayReader ArrayReader} or a {@link Ext.data.JsonReader JsonReader}.

    - *

    The Array or object which was the source of the data for this Record.

    - * @property json - * @type {Array|Object} - */ - /** - * Readonly flag - true if this Record has been modified. - * @type Boolean - */ + + + + + + dirty : false, editing : false, error : null, - /** - * This object contains a key and value storing the original values of all modified - * fields or is null if no fields have been modified. - * @property modified - * @type {Object} - */ + modified : null, - /** - * true when the record does not yet exist in a server-side database (see - * {@link #markDirty}). Any record which has a real database pk set as its id property - * is NOT a phantom -- it's real. - * @property phantom - * @type {Boolean} - */ + phantom : false, - // private + join : function(store){ - /** - * The {@link Ext.data.Store} to which this Record belongs. - * @property store - * @type {Ext.data.Store} - */ + this.store = store; }, - /** - * Set the {@link Ext.data.Field#name named field} to the specified value. For example: - *
    
    -// record has a field named 'firstname'
    -var Employee = Ext.data.Record.{@link #create}([
    -    {name: 'firstname'},
    -    ...
    -]);
    -
    -// update the 2nd record in the store:
    -var rec = myStore.{@link Ext.data.Store#getAt getAt}(1);
    -
    -// set the value (shows dirty flag):
    -rec.set('firstname', 'Betty');
    -
    -// commit the change (removes dirty flag):
    -rec.{@link #commit}();
    -
    -// update the record in the store, bypass setting dirty flag,
    -// and do not store the change in the {@link Ext.data.Store#getModifiedRecords modified records}
    -rec.{@link #data}['firstname'] = 'Wilma'; // updates record, but not the view
    -rec.{@link #commit}(); // updates the view
    -     * 
    - * Notes:
      - *
    • If the store has a writer and autoSave=true, each set() - * will execute an XHR to the server.
    • - *
    • Use {@link #beginEdit} to prevent the store's update - * event firing while using set().
    • - *
    • Use {@link #endEdit} to have the store's update - * event fire.
    • - *
    - * @param {String} name The {@link Ext.data.Field#name name of the field} to set. - * @param {String/Object/Array} value The value to set the field to. - */ + set : function(name, value){ var encode = Ext.isPrimitive(value) ? String : Ext.encode; if(encode(this.data[name]) == encode(value)) { @@ -33379,58 +21070,45 @@ rec.{@link #commit}(); // updates the view } }, - // private + afterEdit : function(){ if (this.store != undefined && typeof this.store.afterEdit == "function") { this.store.afterEdit(this); } }, - // private + afterReject : function(){ if(this.store){ this.store.afterReject(this); } }, - // private + afterCommit : function(){ if(this.store){ this.store.afterCommit(this); } }, - /** - * Get the value of the {@link Ext.data.Field#name named field}. - * @param {String} name The {@link Ext.data.Field#name name of the field} to get the value of. - * @return {Object} The value of the field. - */ + get : function(name){ return this.data[name]; }, - /** - * Begin an edit. While in edit mode, no events (e.g.. the update event) - * are relayed to the containing store. - * See also: {@link #endEdit} and {@link #cancelEdit}. - */ + beginEdit : function(){ this.editing = true; this.modified = this.modified || {}; }, - /** - * Cancels all changes made in the current edit operation. - */ + cancelEdit : function(){ this.editing = false; delete this.modified; }, - /** - * End an edit. If any data was modified, the containing store is notified - * (ie, the store's update event will fire). - */ + endEdit : function(){ this.editing = false; if(this.dirty){ @@ -33438,15 +21116,7 @@ rec.{@link #commit}(); // updates the view } }, - /** - * Usually called by the {@link Ext.data.Store} which owns the Record. - * Rejects all changes made to the Record since either creation, or the last commit operation. - * Modified fields are reverted to their original values. - *

    Developers should subscribe to the {@link Ext.data.Store#update} event - * to have their code notified of reject operations.

    - * @param {Boolean} silent (optional) True to skip notification of the owning - * store of the change (defaults to false) - */ + reject : function(silent){ var m = this.modified; for(var n in m){ @@ -33462,14 +21132,7 @@ rec.{@link #commit}(); // updates the view } }, - /** - * Usually called by the {@link Ext.data.Store} which owns the Record. - * Commits all changes made to the Record since either creation, or the last commit operation. - *

    Developers should subscribe to the {@link Ext.data.Store#update} event - * to have their code notified of commit operations.

    - * @param {Boolean} silent (optional) True to skip notification of the owning - * store of the change (defaults to false) - */ + commit : function(silent){ this.dirty = false; delete this.modified; @@ -33479,10 +21142,7 @@ rec.{@link #commit}(); // updates the view } }, - /** - * Gets a hash of only the fields that have been modified since this Record was created or commited. - * @return Object - */ + getChanges : function(){ var m = this.modified, cs = {}; for(var n in m){ @@ -33493,61 +21153,34 @@ rec.{@link #commit}(); // updates the view return cs; }, - // private + hasError : function(){ return this.error !== null; }, - // private + clearError : function(){ this.error = null; }, - /** - * Creates a copy (clone) of this Record. - * @param {String} id (optional) A new Record id, defaults to the id - * of the record being copied. See {@link #id}. - * To generate a phantom record with a new id use:
    
    -var rec = record.copy(); // clone the record
    -Ext.data.Record.id(rec); // automatically generate a unique sequential id
    -     * 
    - * @return {Record} - */ + copy : function(newId) { return new this.constructor(Ext.apply({}, this.data), newId || this.id); }, - /** - * Returns true if the passed field name has been {@link #modified} - * since the load or last commit. - * @param {String} fieldName {@link Ext.data.Field.{@link Ext.data.Field#name} - * @return {Boolean} - */ + isModified : function(fieldName){ return !!(this.modified && this.modified.hasOwnProperty(fieldName)); }, - /** - * By default returns false if any {@link Ext.data.Field field} within the - * record configured with {@link Ext.data.Field#allowBlank} = false returns - * true from an {@link Ext}.{@link Ext#isEmpty isempty} test. - * @return {Boolean} - */ + isValid : function() { return this.fields.find(function(f) { return (f.allowBlank === false && Ext.isEmpty(this.data[f.name])) ? true : false; },this) ? false : true; }, - /** - *

    Marks this Record as {@link #dirty}. This method - * is used interally when adding {@link #phantom} records to a - * {@link Ext.data.Store#writer writer enabled store}.

    - *

    Marking a record {@link #dirty} causes the phantom to - * be returned by {@link Ext.data.Store#getModifiedRecords} where it will - * have a create action composed for it during {@link Ext.data.Store#save store save} - * operations.

    - */ + markDirty : function(){ this.dirty = true; if(!this.modified){ @@ -33558,47 +21191,25 @@ Ext.data.Record.id(rec); // automatically generate a unique sequential id },this); } }; -/** - * @class Ext.StoreMgr - * @extends Ext.util.MixedCollection - * The default global group of stores. - * @singleton - */ + Ext.StoreMgr = Ext.apply(new Ext.util.MixedCollection(), { - /** - * @cfg {Object} listeners @hide - */ + - /** - * Registers one or more Stores with the StoreMgr. You do not normally need to register stores - * manually. Any store initialized with a {@link Ext.data.Store#storeId} will be auto-registered. - * @param {Ext.data.Store} store1 A Store instance - * @param {Ext.data.Store} store2 (optional) - * @param {Ext.data.Store} etc... (optional) - */ + register : function(){ for(var i = 0, s; (s = arguments[i]); i++){ this.add(s); } }, - /** - * Unregisters one or more Stores with the StoreMgr - * @param {String/Object} id1 The id of the Store, or a Store instance - * @param {String/Object} id2 (optional) - * @param {String/Object} etc... (optional) - */ + unregister : function(){ for(var i = 0, s; (s = arguments[i]); i++){ this.remove(this.lookup(s)); } }, - /** - * Gets a registered Store by id - * @param {String/Object} id The id of the Store, or a Store instance - * @return {Ext.data.Store} - */ + lookup : function(id){ if(Ext.isArray(id)){ var fields = ['field1'], expand = !Ext.isArray(id[0]); @@ -33619,257 +21230,47 @@ Ext.StoreMgr = Ext.apply(new Ext.util.MixedCollection(), { return Ext.isObject(id) ? (id.events ? id : Ext.create(id, 'store')) : this.get(id); }, - // getKey implementation for MixedCollection + getKey : function(o){ return o.storeId; } -});/** - * @class Ext.data.Store - * @extends Ext.util.Observable - *

    The Store class encapsulates a client side cache of {@link Ext.data.Record Record} - * objects which provide input data for Components such as the {@link Ext.grid.GridPanel GridPanel}, - * the {@link Ext.form.ComboBox ComboBox}, or the {@link Ext.DataView DataView}.

    - *

    Retrieving Data

    - *

    A Store object may access a data object using:

      - *
    • {@link #proxy configured implementation} of {@link Ext.data.DataProxy DataProxy}
    • - *
    • {@link #data} to automatically pass in data
    • - *
    • {@link #loadData} to manually pass in data
    • - *

    - *

    Reading Data

    - *

    A Store object has no inherent knowledge of the format of the data object (it could be - * an Array, XML, or JSON). A Store object uses an appropriate {@link #reader configured implementation} - * of a {@link Ext.data.DataReader DataReader} to create {@link Ext.data.Record Record} instances from the data - * object.

    - *

    Store Types

    - *

    There are several implementations of Store available which are customized for use with - * a specific DataReader implementation. Here is an example using an ArrayStore which implicitly - * creates a reader commensurate to an Array data object.

    - *
    
    -var myStore = new Ext.data.ArrayStore({
    -    fields: ['fullname', 'first'],
    -    idIndex: 0 // id for each record will be the first element
     });
    - * 
    - *

    For custom implementations create a basic {@link Ext.data.Store} configured as needed:

    - *
    
    -// create a {@link Ext.data.Record Record} constructor:
    -var rt = Ext.data.Record.create([
    -    {name: 'fullname'},
    -    {name: 'first'}
    -]);
    -var myStore = new Ext.data.Store({
    -    // explicitly create reader
    -    reader: new Ext.data.ArrayReader(
    -        {
    -            idIndex: 0  // id for each record will be the first element
    -        },
    -        rt // recordType
    -    )
    -});
    - * 
    - *

    Load some data into store (note the data object is an array which corresponds to the reader):

    - *
    
    -var myData = [
    -    [1, 'Fred Flintstone', 'Fred'],  // note that id for the record is the first element
    -    [2, 'Barney Rubble', 'Barney']
    -];
    -myStore.loadData(myData);
    - * 
    - *

    Records are cached and made available through accessor functions. An example of adding - * a record to the store:

    - *
    
    -var defaultData = {
    -    fullname: 'Full Name',
    -    first: 'First Name'
    -};
    -var recId = 100; // provide unique id for the record
    -var r = new myStore.recordType(defaultData, ++recId); // create new record
    -myStore.{@link #insert}(0, r); // insert a new record into the store (also see {@link #add})
    - * 
    - *

    Writing Data

    - *

    And new in Ext version 3, use the new {@link Ext.data.DataWriter DataWriter} to create an automated, Writable Store - * along with RESTful features. - * @constructor - * Creates a new Store. - * @param {Object} config A config object containing the objects needed for the Store to access data, - * and read the data into Records. - * @xtype store - */ Ext.data.Store = Ext.extend(Ext.util.Observable, { - /** - * @cfg {String} storeId If passed, the id to use to register with the {@link Ext.StoreMgr StoreMgr}. - *

    Note: if a (deprecated) {@link #id} is specified it will supersede the storeId - * assignment.

    - */ - /** - * @cfg {String} url If a {@link #proxy} is not specified the url will be used to - * implicitly configure a {@link Ext.data.HttpProxy HttpProxy} if an url is specified. - * Typically this option, or the {@link #data} option will be specified. - */ - /** - * @cfg {Boolean/Object} autoLoad If {@link #data} is not specified, and if autoLoad - * is true or an Object, this store's {@link #load} method is automatically called - * after creation. If the value of autoLoad is an Object, this Object will - * be passed to the store's {@link #load} method. - */ - /** - * @cfg {Ext.data.DataProxy} proxy The {@link Ext.data.DataProxy DataProxy} object which provides - * access to a data object. See {@link #url}. - */ - /** - * @cfg {Array} data An inline data object readable by the {@link #reader}. - * Typically this option, or the {@link #url} option will be specified. - */ - /** - * @cfg {Ext.data.DataReader} reader The {@link Ext.data.DataReader Reader} object which processes the - * data object and returns an Array of {@link Ext.data.Record} objects which are cached keyed by their - * {@link Ext.data.Record#id id} property. - */ - /** - * @cfg {Ext.data.DataWriter} writer - *

    The {@link Ext.data.DataWriter Writer} object which processes a record object for being written - * to the server-side database.

    - *

    When a writer is installed into a Store the {@link #add}, {@link #remove}, and {@link #update} - * events on the store are monitored in order to remotely {@link #createRecords create records}, - * {@link #destroyRecord destroy records}, or {@link #updateRecord update records}.

    - *

    The proxy for this store will relay any {@link #writexception} events to this store.

    - *

    Sample implementation: - *

    
    -var writer = new {@link Ext.data.JsonWriter}({
    -    encode: true,
    -    writeAllFields: true // write all fields, not just those that changed
    -});
    -
    -// Typical Store collecting the Proxy, Reader and Writer together.
    -var store = new Ext.data.Store({
    -    storeId: 'user',
    -    root: 'records',
    -    proxy: proxy,
    -    reader: reader,
    -    writer: writer,     // <-- plug a DataWriter into the store just as you would a Reader
    -    paramsAsHash: true,
    -    autoSave: false    // <-- false to delay executing create, update, destroy requests
    -                        //     until specifically told to do so.
    -});
    -     * 

    - */ + + + + + + + writer : undefined, - /** - * @cfg {Object} baseParams - *

    An object containing properties which are to be sent as parameters - * for every HTTP request.

    - *

    Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.

    - *

    Note: baseParams may be superseded by any params - * specified in a {@link #load} request, see {@link #load} - * for more details.

    - * This property may be modified after creation using the {@link #setBaseParam} - * method. - * @property - */ - /** - * @cfg {Object} sortInfo A config object to specify the sort order in the request of a Store's - * {@link #load} operation. Note that for local sorting, the direction property is - * case-sensitive. See also {@link #remoteSort} and {@link #paramNames}. - * For example:
    
    -sortInfo: {
    -    field: 'fieldName',
    -    direction: 'ASC' // or 'DESC' (case sensitive for local sorting)
    -}
    -
    - */ - /** - * @cfg {boolean} remoteSort true if sorting is to be handled by requesting the {@link #proxy Proxy} - * to provide a refreshed version of the data object in sorted order, as opposed to sorting the Record cache - * in place (defaults to false). - *

    If remoteSort is true, then clicking on a {@link Ext.grid.Column Grid Column}'s - * {@link Ext.grid.Column#header header} causes the current page to be requested from the server appending - * the following two parameters to the {@link #load params}:

      - *
    • sort : String

      The name (as specified in the Record's - * {@link Ext.data.Field Field definition}) of the field to sort on.

    • - *
    • dir : String

      The direction of the sort, 'ASC' or 'DESC' (case-sensitive).

    • - *

    - */ + + + remoteSort : false, - /** - * @cfg {Boolean} autoDestroy true to destroy the store when the component the store is bound - * to is destroyed (defaults to false). - *

    Note: this should be set to true when using stores that are bound to only 1 component.

    - */ + autoDestroy : false, - /** - * @cfg {Boolean} pruneModifiedRecords true to clear all modified record information each time - * the store is loaded or when a record is removed (defaults to false). See {@link #getModifiedRecords} - * for the accessor method to retrieve the modified records. - */ + pruneModifiedRecords : false, - /** - * Contains the last options object used as the parameter to the {@link #load} method. See {@link #load} - * for the details of what this may contain. This may be useful for accessing any params which were used - * to load the current Record cache. - * @property - */ + lastOptions : null, - /** - * @cfg {Boolean} autoSave - *

    Defaults to true causing the store to automatically {@link #save} records to - * the server when a record is modified (ie: becomes 'dirty'). Specify false to manually call {@link #save} - * to send all modifiedRecords to the server.

    - *

    Note: each CRUD action will be sent as a separate request.

    - */ + autoSave : true, - /** - * @cfg {Boolean} batch - *

    Defaults to true (unless {@link #restful}:true). Multiple - * requests for each CRUD action (CREATE, READ, UPDATE and DESTROY) will be combined - * and sent as one transaction. Only applies when {@link #autoSave} is set - * to false.

    - *

    If Store is RESTful, the DataProxy is also RESTful, and a unique transaction is - * generated for each record.

    - */ + batch : true, - /** - * @cfg {Boolean} restful - * Defaults to false. Set to true to have the Store and the set - * Proxy operate in a RESTful manner. The store will automatically generate GET, POST, - * PUT and DELETE requests to the server. The HTTP method used for any given CRUD - * action is described in {@link Ext.data.Api#restActions}. For additional information - * see {@link Ext.data.DataProxy#restful}. - *

    Note: if {@link #restful}:true batch will - * internally be set to false.

    - */ + restful: false, - /** - * @cfg {Object} paramNames - *

    An object containing properties which specify the names of the paging and - * sorting parameters passed to remote servers when loading blocks of data. By default, this - * object takes the following form:

    
    -{
    -    start : 'start',  // The parameter name which specifies the start row
    -    limit : 'limit',  // The parameter name which specifies number of rows to return
    -    sort : 'sort',    // The parameter name which specifies the column to sort on
    -    dir : 'dir'       // The parameter name which specifies the sort direction
    -}
    -
    - *

    The server must produce the requested data block upon receipt of these parameter names. - * If different parameter names are required, this property can be overriden using a configuration - * property.

    - *

    A {@link Ext.PagingToolbar PagingToolbar} bound to this Store uses this property to determine - * the parameter names to use in its {@link #load requests}. - */ + paramNames : undefined, - /** - * @cfg {Object} defaultParamNames - * Provides the default values for the {@link #paramNames} property. To globally modify the parameters - * for all stores, this object should be changed on the store prototype. - */ + defaultParamNames : { start : 'start', limit : 'limit', @@ -33877,21 +21278,13 @@ sortInfo: { dir : 'dir' }, - /** - * @property isDestroyed - * @type Boolean - * True if the store has been destroyed already. Read only - */ + isDestroyed: false, - /** - * @property hasMultiSort - * @type Boolean - * True if this store is currently sorted by more than one field/direction combination. - */ + hasMultiSort: false, - // private + batchKey : '_ext_batch_', constructor : function(config){ @@ -33901,7 +21294,7 @@ sortInfo: { }; - // temporary removed-records cache + this.removed = []; if(config && config.data){ @@ -33911,12 +21304,7 @@ sortInfo: { Ext.apply(this, config); - /** - * See the {@link #baseParams corresponding configuration option} - * for a description of this property. - * To modify this property see {@link #setBaseParam}. - * @property - */ + this.baseParams = Ext.isObject(this.baseParams) ? this.baseParams : {}; this.paramNames = Ext.applyIf(this.paramNames || {}, this.defaultParamNames); @@ -33924,23 +21312,23 @@ sortInfo: { if((this.url || this.api) && !this.proxy){ this.proxy = new Ext.data.HttpProxy({url: this.url, api: this.api}); } - // If Store is RESTful, so too is the DataProxy + if (this.restful === true && this.proxy) { - // When operating RESTfully, a unique transaction is generated for each record. - // TODO might want to allow implemention of faux REST where batch is possible using RESTful routes only. + + this.batch = false; Ext.data.Api.restify(this.proxy); } - if(this.reader){ // reader passed + if(this.reader){ if(!this.recordType){ this.recordType = this.reader.recordType; } if(this.reader.onMetaChange){ this.reader.onMetaChange = this.reader.onMetaChange.createSequence(this.onMetaChange, this); } - if (this.writer) { // writer passed - if (this.writer instanceof(Ext.data.DataWriter) === false) { // <-- config-object instead of instance. + if (this.writer) { + if (this.writer instanceof(Ext.data.DataWriter) === false) { this.writer = this.buildWriter(this.writer); } this.writer.meta = this.reader.meta; @@ -33948,216 +21336,51 @@ sortInfo: { } } - /** - * The {@link Ext.data.Record Record} constructor as supplied to (or created by) the - * {@link Ext.data.DataReader Reader}. Read-only. - *

    If the Reader was constructed by passing in an Array of {@link Ext.data.Field} definition objects, - * instead of a Record constructor, it will implicitly create a Record constructor from that Array (see - * {@link Ext.data.Record}.{@link Ext.data.Record#create create} for additional details).

    - *

    This property may be used to create new Records of the type held in this Store, for example:

    
    -    // create the data store
    -    var store = new Ext.data.ArrayStore({
    -        autoDestroy: true,
    -        fields: [
    -           {name: 'company'},
    -           {name: 'price', type: 'float'},
    -           {name: 'change', type: 'float'},
    -           {name: 'pctChange', type: 'float'},
    -           {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
    -        ]
    -    });
    -    store.loadData(myData);
    -
    -    // create the Grid
    -    var grid = new Ext.grid.EditorGridPanel({
    -        store: store,
    -        colModel: new Ext.grid.ColumnModel({
    -            columns: [
    -                {id:'company', header: 'Company', width: 160, dataIndex: 'company'},
    -                {header: 'Price', renderer: 'usMoney', dataIndex: 'price'},
    -                {header: 'Change', renderer: change, dataIndex: 'change'},
    -                {header: '% Change', renderer: pctChange, dataIndex: 'pctChange'},
    -                {header: 'Last Updated', width: 85,
    -                    renderer: Ext.util.Format.dateRenderer('m/d/Y'),
    -                    dataIndex: 'lastChange'}
    -            ],
    -            defaults: {
    -                sortable: true,
    -                width: 75
    -            }
    -        }),
    -        autoExpandColumn: 'company', // match the id specified in the column model
    -        height:350,
    -        width:600,
    -        title:'Array Grid',
    -        tbar: [{
    -            text: 'Add Record',
    -            handler : function(){
    -                var defaultData = {
    -                    change: 0,
    -                    company: 'New Company',
    -                    lastChange: (new Date()).clearTime(),
    -                    pctChange: 0,
    -                    price: 10
    -                };
    -                var recId = 3; // provide unique id
    -                var p = new store.recordType(defaultData, recId); // create new record
    -                grid.stopEditing();
    -                store.{@link #insert}(0, p); // insert a new record into the store (also see {@link #add})
    -                grid.startEditing(0, 0);
    -            }
    -        }]
    -    });
    -         * 
    - * @property recordType - * @type Function - */ + if(this.recordType){ - /** - * A {@link Ext.util.MixedCollection MixedCollection} containing the defined {@link Ext.data.Field Field}s - * for the {@link Ext.data.Record Records} stored in this Store. Read-only. - * @property fields - * @type Ext.util.MixedCollection - */ + this.fields = this.recordType.prototype.fields; } this.modified = []; this.addEvents( - /** - * @event datachanged - * Fires when the data cache has changed in a bulk manner (e.g., it has been sorted, filtered, etc.) and a - * widget that is using this Store as a Record cache should refresh its view. - * @param {Store} this - */ + 'datachanged', - /** - * @event metachange - * Fires when this store's reader provides new metadata (fields). This is currently only supported for JsonReaders. - * @param {Store} this - * @param {Object} meta The JSON metadata - */ + 'metachange', - /** - * @event add - * Fires when Records have been {@link #add}ed to the Store - * @param {Store} this - * @param {Ext.data.Record[]} records The array of Records added - * @param {Number} index The index at which the record(s) were added - */ + 'add', - /** - * @event remove - * Fires when a Record has been {@link #remove}d from the Store - * @param {Store} this - * @param {Ext.data.Record} record The Record that was removed - * @param {Number} index The index at which the record was removed - */ + 'remove', - /** - * @event update - * Fires when a Record has been updated - * @param {Store} this - * @param {Ext.data.Record} record The Record that was updated - * @param {String} operation The update operation being performed. Value may be one of: - *
    
    -     Ext.data.Record.EDIT
    -     Ext.data.Record.REJECT
    -     Ext.data.Record.COMMIT
    -             * 
    - */ + 'update', - /** - * @event clear - * Fires when the data cache has been cleared. - * @param {Store} this - * @param {Record[]} The records that were cleared. - */ + 'clear', - /** - * @event exception - *

    Fires if an exception occurs in the Proxy during a remote request. - * This event is relayed through the corresponding {@link Ext.data.DataProxy}. - * See {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#exception exception} - * for additional details. - * @param {misc} misc See {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#exception exception} - * for description. - */ + 'exception', - /** - * @event beforeload - * Fires before a request is made for a new data object. If the beforeload handler returns - * false the {@link #load} action will be canceled. - * @param {Store} this - * @param {Object} options The loading options that were specified (see {@link #load} for details) - */ + 'beforeload', - /** - * @event load - * Fires after a new set of Records has been loaded. - * @param {Store} this - * @param {Ext.data.Record[]} records The Records that were loaded - * @param {Object} options The loading options that were specified (see {@link #load} for details) - */ + 'load', - /** - * @event loadexception - *

    This event is deprecated in favor of the catch-all {@link #exception} - * event instead.

    - *

    This event is relayed through the corresponding {@link Ext.data.DataProxy}. - * See {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#loadexception loadexception} - * for additional details. - * @param {misc} misc See {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#loadexception loadexception} - * for description. - */ + 'loadexception', - /** - * @event beforewrite - * @param {Ext.data.Store} store - * @param {String} action [Ext.data.Api.actions.create|update|destroy] - * @param {Record/Record[]} rs The Record(s) being written. - * @param {Object} options The loading options that were specified. Edit options.params to add Http parameters to the request. (see {@link #save} for details) - * @param {Object} arg The callback's arg object passed to the {@link #request} function - */ + 'beforewrite', - /** - * @event write - * Fires if the server returns 200 after an Ext.data.Api.actions CRUD action. - * Success of the action is determined in the result['successProperty']property (NOTE for RESTful stores, - * a simple 20x response is sufficient for the actions "destroy" and "update". The "create" action should should return 200 along with a database pk). - * @param {Ext.data.Store} store - * @param {String} action [Ext.data.Api.actions.create|update|destroy] - * @param {Object} result The 'data' picked-out out of the response for convenience. - * @param {Ext.Direct.Transaction} res - * @param {Record/Record[]} rs Store's records, the subject(s) of the write-action - */ + 'write', - /** - * @event beforesave - * Fires before a save action is called. A save encompasses destroying records, updating records and creating records. - * @param {Ext.data.Store} store - * @param {Object} data An object containing the data that is to be saved. The object will contain a key for each appropriate action, - * with an array of records for each action. - */ + 'beforesave', - /** - * @event save - * Fires after a save is completed. A save encompasses destroying records, updating records and creating records. - * @param {Ext.data.Store} store - * @param {Number} batch The identifier for the batch that was saved. - * @param {Object} data An object containing the data that is to be saved. The object will contain a key for each appropriate action, - * with an array of records for each action. - */ + 'save' ); if(this.proxy){ - // TODO remove deprecated loadexception with ext-3.0.1 + this.relayEvents(this.proxy, ['loadexception', 'exception']); } - // With a writer set for the Store, we want to listen to add/remove events to remotely create/destroy records. + if (this.writer) { this.on({ scope: this, @@ -34192,17 +21415,12 @@ sortInfo: { typeof this.autoLoad == 'object' ? this.autoLoad : undefined]); } - // used internally to uniquely identify a batch + this.batchCounter = 0; this.batches = {}; }, - /** - * builds a DataWriter instance when Store constructor is provided with a writer config-object instead of an instace. - * @param {Object} config Writer configuration - * @return {Ext.data.DataWriter} - * @private - */ + buildWriter : function(config) { var klass = undefined, type = (config.format || 'json').toLowerCase(); @@ -34219,9 +21437,7 @@ sortInfo: { return new klass(config); }, - /** - * Destroys the store. - */ + destroy : function(){ if(!this.isDestroyed){ if(this.storeId){ @@ -34236,13 +21452,7 @@ sortInfo: { } }, - /** - * Add Records to the Store and fires the {@link #add} event. To add Records - * to the store from a remote source use {@link #load}({add:true}). - * See also {@link #recordType} and {@link #insert}. - * @param {Ext.data.Record[]} records An Array of Ext.data.Record objects - * to add to the cache. See {@link #recordType}. - */ + add : function(records){ records = [].concat(records); if(records.length < 1){ @@ -34259,25 +21469,19 @@ sortInfo: { this.fireEvent('add', this, records, index); }, - /** - * (Local sort only) Inserts the passed Record into the Store at the index where it - * should go based on the current sort information. - * @param {Ext.data.Record} record - */ + addSorted : function(record){ var index = this.findInsertIndex(record); this.insert(index, record); }, - /** - * Remove Records from the Store and fires the {@link #remove} event. - * @param {Ext.data.Record/Ext.data.Record[]} record The record object or array of records to remove from the cache. - */ + remove : function(record){ if(Ext.isArray(record)){ Ext.each(record, function(r){ this.remove(r); }, this); + return; } var index = this.data.indexOf(record); if(index > -1){ @@ -34295,18 +21499,12 @@ sortInfo: { } }, - /** - * Remove a Record from the Store at the specified index. Fires the {@link #remove} event. - * @param {Number} index The index of the record to remove. - */ + removeAt : function(index){ this.remove(this.getAt(index)); }, - /** - * Remove all Records from the Store and fires the {@link #clear} event. - * @param {Boolean} silent [false] Defaults to false. Set true to not fire clear event. - */ + removeAll : function(silent){ var items = []; this.each(function(rec){ @@ -34319,24 +21517,19 @@ sortInfo: { if(this.pruneModifiedRecords){ this.modified = []; } - if (silent !== true) { // <-- prevents write-actions when we just want to clear a store. + if (silent !== true) { this.fireEvent('clear', this, items); } }, - // private + onClear: function(store, records){ Ext.each(records, function(rec, index){ this.destroyRecord(this, rec, index); }, this); }, - /** - * Inserts Records into the Store at the given index and fires the {@link #add} event. - * See also {@link #add} and {@link #addSorted}. - * @param {Number} index The start index at which to insert the passed Records. - * @param {Ext.data.Record[]} records An Array of Ext.data.Record objects to add to the cache. - */ + insert : function(index, records){ records = [].concat(records); for(var i = 0, len = records.length; i < len; i++){ @@ -34349,53 +21542,32 @@ sortInfo: { this.fireEvent('add', this, records, index); }, - /** - * Get the index within the cache of the passed Record. - * @param {Ext.data.Record} record The Ext.data.Record object to find. - * @return {Number} The index of the passed Record. Returns -1 if not found. - */ + indexOf : function(record){ return this.data.indexOf(record); }, - /** - * Get the index within the cache of the Record with the passed id. - * @param {String} id The id of the Record to find. - * @return {Number} The index of the Record. Returns -1 if not found. - */ + indexOfId : function(id){ return this.data.indexOfKey(id); }, - /** - * Get the Record with the specified id. - * @param {String} id The id of the Record to find. - * @return {Ext.data.Record} The Record with the passed id. Returns undefined if not found. - */ + getById : function(id){ return (this.snapshot || this.data).key(id); }, - /** - * Get the Record at the specified index. - * @param {Number} index The index of the Record to find. - * @return {Ext.data.Record} The Record at the passed index. Returns undefined if not found. - */ + getAt : function(index){ return this.data.itemAt(index); }, - /** - * Returns a range of Records between specified indices. - * @param {Number} startIndex (optional) The starting index (defaults to 0) - * @param {Number} endIndex (optional) The ending index (defaults to the last Record in the Store) - * @return {Ext.data.Record[]} An array of Records - */ + getRange : function(start, end){ return this.data.getRange(start, end); }, - // private + storeOptions : function(o){ o = Ext.apply({}, o); delete o.callback; @@ -34403,7 +21575,7 @@ sortInfo: { this.lastOptions = o; }, - // private + clearData: function(){ this.data.each(function(rec) { rec.join(null); @@ -34411,37 +21583,7 @@ sortInfo: { this.data.clear(); }, - /** - *

    Loads the Record cache from the configured {@link #proxy} using the configured {@link #reader}.

    - *

    Notes:

      - *
    • Important: loading is asynchronous! This call will return before the new data has been - * loaded. To perform any post-processing where information from the load call is required, specify - * the callback function to be called, or use a {@link Ext.util.Observable#listeners a 'load' event handler}.
    • - *
    • If using {@link Ext.PagingToolbar remote paging}, the first load call must specify the start and limit - * properties in the options.params property to establish the initial position within the - * dataset, and the number of Records to cache on each read from the Proxy.
    • - *
    • If using {@link #remoteSort remote sorting}, the configured {@link #sortInfo} - * will be automatically included with the posted parameters according to the specified - * {@link #paramNames}.
    • - *
    - * @param {Object} options An object containing properties which control loading options:
      - *
    • params :Object

      An object containing properties to pass as HTTP - * parameters to a remote data source. Note: params will override any - * {@link #baseParams} of the same name.

      - *

      Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.

    • - *
    • callback : Function

      A function to be called after the Records - * have been loaded. The callback is called after the load event is fired, and is passed the following arguments:

        - *
      • r : Ext.data.Record[] An Array of Records loaded.
      • - *
      • options : Options object from the load call.
      • - *
      • success : Boolean success indicator.

    • - *
    • scope : Object

      Scope with which to call the callback (defaults - * to the Store object)

    • - *
    • add : Boolean

      Indicator to append loaded records rather than - * replace the current cache. Note: see note for {@link #loadData}

    • - *
    - * @return {Boolean} If the developer provided {@link #beforeload} event handler returns - * false, the load call will abort and will return false; otherwise will return true. - */ + load : function(options) { options = Ext.apply({}, options); this.storeOptions(options); @@ -34452,39 +21594,26 @@ sortInfo: { options.params[pn.dir] = this.sortInfo.direction; } try { - return this.execute('read', null, options); // <-- null represents rs. No rs for load actions. + return this.execute('read', null, options); } catch(e) { this.handleException(e); return false; } }, - /** - * updateRecord Should not be used directly. This method will be called automatically if a Writer is set. - * Listens to 'update' event. - * @param {Object} store - * @param {Object} record - * @param {Object} action - * @private - */ + updateRecord : function(store, record, action) { if (action == Ext.data.Record.EDIT && this.autoSave === true && (!record.phantom || (record.phantom && record.isValid()))) { this.save(); } }, - /** - * Should not be used directly. Store#add will call this automatically if a Writer is set - * @param {Object} store - * @param {Object} rs - * @param {Object} index - * @private - */ + createRecords : function(store, rs, index) { for (var i = 0, len = rs.length; i < len; i++) { if (rs[i].phantom && rs[i].isValid()) { - rs[i].markDirty(); // <-- Mark new records dirty - this.modified.push(rs[i]); // <-- add to modified + rs[i].markDirty(); + this.modified.push(rs[i]); } } if (this.autoSave === true) { @@ -34492,23 +21621,17 @@ sortInfo: { } }, - /** - * Destroys a Record. Should not be used directly. It's called by Store#remove if a Writer is set. - * @param {Store} store this - * @param {Ext.data.Record} record - * @param {Number} index - * @private - */ + destroyRecord : function(store, record, index) { - if (this.modified.indexOf(record) != -1) { // <-- handled already if @cfg pruneModifiedRecords == true + if (this.modified.indexOf(record) != -1) { this.modified.remove(record); } if (!record.phantom) { this.removed.push(record); - // since the record has already been removed from the store but the server request has not yet been executed, - // must keep track of the last known index this record existed. If a server error occurs, the record can be - // put back into the store. @see Store#createCallback where the record is returned when response status === false + + + record.lastIndex = index; if (this.autoSave === true) { @@ -34517,30 +21640,21 @@ sortInfo: { } }, - /** - * This method should generally not be used directly. This method is called internally - * by {@link #load}, or if a Writer is set will be called automatically when {@link #add}, - * {@link #remove}, or {@link #update} events fire. - * @param {String} action Action name ('read', 'create', 'update', or 'destroy') - * @param {Record/Record[]} rs - * @param {Object} options - * @throws Error - * @private - */ - execute : function(action, rs, options, /* private */ batch) { - // blow up if action not Ext.data.CREATE, READ, UPDATE, DESTROY + + execute : function(action, rs, options, batch) { + if (!Ext.data.Api.isAction(action)) { throw new Ext.data.Api.Error('execute', action); } - // make sure options has a fresh, new params hash + options = Ext.applyIf(options||{}, { params: {} }); if(batch !== undefined){ this.addToBatch(batch); } - // have to separate before-events since load has a different signature than create,destroy and save events since load does not - // include the rs (record resultset) parameter. Capture return values from the beforeaction into doRequest flag. + + var doRequest = true; if (action === 'read') { @@ -34548,50 +21662,36 @@ sortInfo: { Ext.applyIf(options.params, this.baseParams); } else { - // if Writer is configured as listful, force single-record rs to be [{}] instead of {} - // TODO Move listful rendering into DataWriter where the @cfg is defined. Should be easy now. + + if (this.writer.listful === true && this.restful !== true) { rs = (Ext.isArray(rs)) ? rs : [rs]; } - // if rs has just a single record, shift it off so that Writer writes data as '{}' rather than '[{}]' + else if (Ext.isArray(rs) && rs.length == 1) { rs = rs.shift(); } - // Write the action to options.params + if ((doRequest = this.fireEvent('beforewrite', this, action, rs, options)) !== false) { this.writer.apply(options.params, this.baseParams, action, rs); } } if (doRequest !== false) { - // Send request to proxy. + if (this.writer && this.proxy.url && !this.proxy.restful && !Ext.data.Api.hasUniqueUrl(this.proxy, action)) { - options.params.xaction = action; // <-- really old, probaby unecessary. + options.params.xaction = action; } - // Note: Up until this point we've been dealing with 'action' as a key from Ext.data.Api.actions. - // We'll flip it now and send the value into DataProxy#request, since it's the value which maps to - // the user's configured DataProxy#api - // TODO Refactor all Proxies to accept an instance of Ext.data.Request (not yet defined) instead of this looooooong list - // of params. This method is an artifact from Ext2. + + + + + this.proxy.request(Ext.data.Api.actions[action], rs, options.params, this.reader, this.createCallback(action, rs, batch), this, options); } return doRequest; }, - /** - * Saves all pending changes to the store. If the commensurate Ext.data.Api.actions action is not configured, then - * the configured {@link #url} will be used. - *
    -     * change            url
    -     * ---------------   --------------------
    -     * removed records   Ext.data.Api.actions.destroy
    -     * phantom records   Ext.data.Api.actions.create
    -     * {@link #getModifiedRecords modified records}  Ext.data.Api.actions.update
    -     * 
    - * @TODO: Create extensions of Error class and send associated Record with thrown exceptions. - * e.g.: Ext.data.DataReader.Error or Ext.data.Error or Ext.data.DataProxy.Error, etc. - * @return {Number} batch Returns a number to uniquely identify the "batch" of saves occurring. -1 will be returned - * if there are no items to save or the save was cancelled. - */ + save : function() { if (!this.writer) { throw new Ext.data.Store.Error('writer-undefined'); @@ -34602,15 +21702,15 @@ sortInfo: { trans, batch, data = {}; - // DESTROY: First check for removed records. Records in this.removed are guaranteed non-phantoms. @see Store#remove + if(this.removed.length){ queue.push(['destroy', this.removed]); } - // Check for modified records. Use a copy so Store#rejectChanges will work if server returns error. + var rs = [].concat(this.getModifiedRecords()); if(rs.length){ - // CREATE: Next check for phantoms within rs. splice-off and execute create. + var phantoms = []; for(var i = rs.length-1; i >= 0; i--){ if(rs[i].phantom === true){ @@ -34618,16 +21718,16 @@ sortInfo: { if(rec.isValid()){ phantoms.push(rec); } - }else if(!rs[i].isValid()){ // <-- while we're here, splice-off any !isValid real records + }else if(!rs[i].isValid()){ rs.splice(i,1); } } - // If we have valid phantoms, create them... + if(phantoms.length){ queue.push(['create', phantoms]); } - // UPDATE: And finally, if we're still here after splicing-off phantoms and !isValid real records, update the rest... + if(rs.length){ queue.push(['update', rs]); } @@ -34650,7 +21750,7 @@ sortInfo: { return -1; }, - // private. Simply wraps call to Store#execute in try/catch. Defers to Store#handleException on error. Loops if batch: false + doTransaction : function(action, rs, batch) { function transaction(records) { try{ @@ -34668,7 +21768,7 @@ sortInfo: { } }, - // private + addToBatch : function(batch){ var b = this.batches, key = this.batchKey + batch, @@ -34705,14 +21805,14 @@ sortInfo: { } }, - // @private callback-handler for remote CRUD actions - // Do not override -- override loadRecords, onCreateRecords, onDestroyRecords and onUpdateRecords instead. + + createCallback : function(action, rs, batch) { var actions = Ext.data.Api.actions; return (action == 'read') ? this.loadRecords : function(data, response, success) { - // calls: onCreateRecords | onUpdateRecords | onDestroyRecords + this['on' + Ext.util.Format.capitalize(action) + 'Records'](success, rs, [].concat(data)); - // If success === false here, exception will have been called in DataProxy + if (success === true) { this.fireEvent('write', this, action, data, response, rs); } @@ -34720,9 +21820,9 @@ sortInfo: { }; }, - // Clears records from modified array after an exception event. - // NOTE: records are left marked dirty. Do we want to commit them even though they were not updated/realized? - // TODO remove this method? + + + clearModified : function(rs) { if (Ext.isArray(rs)) { for (var n=rs.length-1;n>=0;n--) { @@ -34733,7 +21833,7 @@ sortInfo: { } }, - // remap record ids in MixedCollection after records have been realized. @see Store#onCreateRecords, @see DataReader#realize + reMap : function(record) { if (Ext.isArray(record)) { for (var i = 0, len = record.length; i < len; i++) { @@ -34748,7 +21848,7 @@ sortInfo: { } }, - // @protected onCreateRecord proxy callback for create action + onCreateRecords : function(success, rs, data) { if (success === true) { try { @@ -34758,14 +21858,14 @@ sortInfo: { catch (e) { this.handleException(e); if (Ext.isArray(rs)) { - // Recurse to run back into the try {}. DataReader#realize splices-off the rs until empty. + this.onCreateRecords(success, rs, data); } } } }, - // @protected, onUpdateRecords proxy callback for update action + onUpdateRecords : function(success, rs, data) { if (success === true) { try { @@ -34773,59 +21873,42 @@ sortInfo: { } catch (e) { this.handleException(e); if (Ext.isArray(rs)) { - // Recurse to run back into the try {}. DataReader#update splices-off the rs until empty. + this.onUpdateRecords(success, rs, data); } } } }, - // @protected onDestroyRecords proxy callback for destroy action + onDestroyRecords : function(success, rs, data) { - // splice each rec out of this.removed + rs = (rs instanceof Ext.data.Record) ? [rs] : [].concat(rs); for (var i=0,len=rs.length;i=0;i--) { - this.insert(rs[i].lastIndex, rs[i]); // <-- lastIndex set in Store#destroyRecord + this.insert(rs[i].lastIndex, rs[i]); } } }, - // protected handleException. Possibly temporary until Ext framework has an exception-handler. + handleException : function(e) { - // @see core/Error.js + Ext.handleError(e); }, - /** - *

    Reloads the Record cache from the configured Proxy using the configured - * {@link Ext.data.Reader Reader} and the options from the last load operation - * performed.

    - *

    Note: see the Important note in {@link #load}.

    - * @param {Object} options

    (optional) An Object containing - * {@link #load loading options} which may override the {@link #lastOptions options} - * used in the last {@link #load} operation. See {@link #load} for details - * (defaults to null, in which case the {@link #lastOptions} are - * used).

    - *

    To add new params to the existing params:

    
    -lastOptions = myStore.lastOptions;
    -Ext.apply(lastOptions.params, {
    -    myNewParam: true
    -});
    -myStore.reload(lastOptions);
    -     * 
    - */ + reload : function(options){ this.load(Ext.applyIf(options||{}, this.lastOptions)); }, - // private - // Called as a callback by the Reader during a load operation. + + loadRecords : function(o, options, success){ if (this.isDestroyed === true) { return; @@ -34866,89 +21949,47 @@ myStore.reload(lastOptions); } }, - /** - * Loads data from a passed data block and fires the {@link #load} event. A {@link Ext.data.Reader Reader} - * which understands the format of the data must have been configured in the constructor. - * @param {Object} data The data block from which to read the Records. The format of the data expected - * is dependent on the type of {@link Ext.data.Reader Reader} that is configured and should correspond to - * that {@link Ext.data.Reader Reader}'s {@link Ext.data.Reader#readRecords} parameter. - * @param {Boolean} append (Optional) true to append the new Records rather the default to replace - * the existing cache. - * Note: that Records in a Store are keyed by their {@link Ext.data.Record#id id}, so added Records - * with ids which are already present in the Store will replace existing Records. Only Records with - * new, unique ids will be added. - */ + loadData : function(o, append){ var r = this.reader.readRecords(o); this.loadRecords(r, {add: append}, true); }, - /** - * Gets the number of cached records. - *

    If using paging, this may not be the total size of the dataset. If the data object - * used by the Reader contains the dataset size, then the {@link #getTotalCount} function returns - * the dataset size. Note: see the Important note in {@link #load}.

    - * @return {Number} The number of Records in the Store's cache. - */ + getCount : function(){ return this.data.length || 0; }, - /** - * Gets the total number of records in the dataset as returned by the server. - *

    If using paging, for this to be accurate, the data object used by the {@link #reader Reader} - * must contain the dataset size. For remote data sources, the value for this property - * (totalProperty for {@link Ext.data.JsonReader JsonReader}, - * totalRecords for {@link Ext.data.XmlReader XmlReader}) shall be returned by a query on the server. - * Note: see the Important note in {@link #load}.

    - * @return {Number} The number of Records as specified in the data object passed to the Reader - * by the Proxy. - *

    Note: this value is not updated when changing the contents of the Store locally.

    - */ + getTotalCount : function(){ return this.totalLength || 0; }, - /** - * Returns an object describing the current sort state of this Store. - * @return {Object} The sort state of the Store. An object with two properties:
      - *
    • field : String

      The name of the field by which the Records are sorted.

    • - *
    • direction : String

      The sort order, 'ASC' or 'DESC' (case-sensitive).

    • - *
    - * See {@link #sortInfo} for additional details. - */ + getSortState : function(){ return this.sortInfo; }, - /** - * @private - * Invokes sortData if we have sortInfo to sort on and are not sorting remotely - */ + applySort : function(){ if ((this.sortInfo || this.multiSortInfo) && !this.remoteSort) { this.sortData(); } }, - /** - * @private - * Performs the actual sorting of data. This checks to see if we currently have a multi sort or not. It applies - * each sorter field/direction pair in turn by building an OR'ed master sorting function and running it against - * the full dataset - */ + sortData : function() { var sortInfo = this.hasMultiSort ? this.multiSortInfo : this.sortInfo, direction = sortInfo.direction || "ASC", sorters = sortInfo.sorters, sortFns = []; - //if we just have a single sorter, pretend it's the first in an array + if (!this.hasMultiSort) { sorters = [{direction: direction, field: sortInfo.field}]; } - //create a sorter function for each sorter field/direction combo + for (var i=0, j = sorters.length; i < j; i++) { sortFns.push(this.createSortFunction(sorters[i].field, sorters[i].direction)); } @@ -34957,15 +21998,15 @@ myStore.reload(lastOptions); return; } - //the direction modifier is multiplied with the result of the sorting functions to provide overall sort direction - //(as opposed to direction per field) + + var directionModifier = direction.toUpperCase() == "DESC" ? -1 : 1; - //create a function which ORs each sorter together to enable multi-sort + var fn = function(r1, r2) { var result = sortFns[0].call(this, r1, r2); - //if we have more than one sorter, OR any additional sorter functions together + if (sortFns.length > 1) { for (var i=1, j = sortFns.length; i < j; i++) { result = result || sortFns[i].call(this, r1, r2); @@ -34975,27 +22016,22 @@ myStore.reload(lastOptions); return directionModifier * result; }; - //sort the data + this.data.sort(direction, fn); if (this.snapshot && this.snapshot != this.data) { this.snapshot.sort(direction, fn); } }, - /** - * Creates and returns a function which sorts an array by the given field and direction - * @param {String} field The field to create the sorter for - * @param {String} direction The direction to sort by (defaults to "ASC") - * @return {Function} A function which sorts by the field/direction combination provided - */ + createSortFunction: function(field, direction) { direction = direction || "ASC"; var directionModifier = direction.toUpperCase() == "DESC" ? -1 : 1; var sortType = this.fields.get(field).sortType; - //create a comparison function. Takes 2 records, returns 1 if record 1 is greater, - //-1 if record 2 is greater or 0 if they are equal + + return function(r1, r2) { var v1 = sortType(r1.data[field]), v2 = sortType(r2.data[field]); @@ -35004,42 +22040,14 @@ myStore.reload(lastOptions); }; }, - /** - * Sets the default sort column and order to be used by the next {@link #load} operation. - * @param {String} fieldName The name of the field to sort by. - * @param {String} dir (optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to 'ASC') - */ + setDefaultSort : function(field, dir) { dir = dir ? dir.toUpperCase() : 'ASC'; this.sortInfo = {field: field, direction: dir}; this.sortToggle[field] = dir; }, - /** - * Sort the Records. - * If remote sorting is used, the sort is performed on the server, and the cache is reloaded. If local - * sorting is used, the cache is sorted internally. See also {@link #remoteSort} and {@link #paramNames}. - * This function accepts two call signatures - pass in a field name as the first argument to sort on a single - * field, or pass in an array of sort configuration objects to sort by multiple fields. - * Single sort example: - * store.sort('name', 'ASC'); - * Multi sort example: - * store.sort([ - * { - * field : 'name', - * direction: 'ASC' - * }, - * { - * field : 'salary', - * direction: 'DESC' - * } - * ], 'ASC'); - * In this second form, the sort configs are applied in order, with later sorters sorting within earlier sorters' results. - * For example, if two records with the same name are present they will also be sorted by salary if given the sort configs - * above. Any number of sort configs can be added. - * @param {String/Array} fieldName The name of the field to sort by, or an array of ordered sort configs - * @param {String} dir (optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to 'ASC') - */ + sort : function(fieldName, dir) { if (Ext.isArray(arguments[0])) { return this.multiSort.call(this, fieldName, dir); @@ -35048,12 +22056,7 @@ myStore.reload(lastOptions); } }, - /** - * Sorts the store contents by a single field and direction. This is called internally by {@link sort} and would - * not usually be called manually - * @param {String} fieldName The name of the field to sort by. - * @param {String} dir (optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to 'ASC') - */ + singleSort: function(fieldName, dir) { var field = this.fields.get(fieldName); if (!field) return false; @@ -35063,7 +22066,7 @@ myStore.reload(lastOptions); sortToggle = this.sortToggle ? this.sortToggle[name] : null; if (!dir) { - if (sortInfo && sortInfo.field == name) { // toggle sort dir + if (sortInfo && sortInfo.field == name) { dir = (this.sortToggle[name] || 'ASC').toggle('ASC', 'DESC'); } else { dir = field.sortDir; @@ -35089,28 +22092,17 @@ myStore.reload(lastOptions); } }, - /** - * Sorts the contents of this store by multiple field/direction sorters. This is called internally by {@link sort} - * and would not usually be called manually. - * Multi sorting only currently applies to local datasets - multiple sort data is not currently sent to a proxy - * if remoteSort is used. - * @param {Array} sorters Array of sorter objects (field and direction) - * @param {String} direction Overall direction to sort the ordered results by (defaults to "ASC") - */ + multiSort: function(sorters, direction) { this.hasMultiSort = true; direction = direction || "ASC"; - //toggle sort direction + if (this.multiSortInfo && direction == this.multiSortInfo.direction) { direction = direction.toggle("ASC", "DESC"); } - /** - * @property multiSortInfo - * @type Object - * Object containing overall sort direction and an ordered array of sorter configs used when sorting on multiple fields - */ + this.multiSortInfo = { sorters : sorters, direction: direction @@ -35125,38 +22117,17 @@ myStore.reload(lastOptions); } }, - /** - * Calls the specified function for each of the {@link Ext.data.Record Records} in the cache. - * @param {Function} fn The function to call. The {@link Ext.data.Record Record} is passed as the first parameter. - * Returning false aborts and exits the iteration. - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. - * Defaults to the current {@link Ext.data.Record Record} in the iteration. - */ + each : function(fn, scope){ this.data.each(fn, scope); }, - /** - * Gets all {@link Ext.data.Record records} modified since the last commit. Modified records are - * persisted across load operations (e.g., during paging). Note: deleted records are not - * included. See also {@link #pruneModifiedRecords} and - * {@link Ext.data.Record}{@link Ext.data.Record#markDirty markDirty}.. - * @return {Ext.data.Record[]} An array of {@link Ext.data.Record Records} containing outstanding - * modifications. To obtain modified fields within a modified record see - *{@link Ext.data.Record}{@link Ext.data.Record#modified modified}.. - */ + getModifiedRecords : function(){ return this.modified; }, - /** - * Sums the value of property for each {@link Ext.data.Record record} between start - * and end and returns the result. - * @param {String} property A field in each record - * @param {Number} start (optional) The record index to start at (defaults to 0) - * @param {Number} end (optional) The last record index to include (defaults to length - 1) - * @return {Number} The sum - */ + sum : function(property, start, end){ var rs = this.data.items, v = 0; start = start || 0; @@ -35168,16 +22139,7 @@ myStore.reload(lastOptions); return v; }, - /** - * @private - * Returns a filter function used to test a the given property's value. Defers most of the work to - * Ext.util.MixedCollection's createValueMatcher function - * @param {String} property The property to create the filter function for - * @param {String/RegExp} value The string/regex to compare the property value to - * @param {Boolean} anyMatch True if we don't care if the filter value is not the full value (defaults to false) - * @param {Boolean} caseSensitive True to create a case-sensitive regex (defaults to false) - * @param {Boolean} exactMatch True to force exact match (^ and $ characters added to the regex). Defaults to false. Ignored if anyMatch is true. - */ + createFilterFn : function(property, value, anyMatch, caseSensitive, exactMatch){ if(Ext.isEmpty(value, false)){ return false; @@ -35188,12 +22150,7 @@ myStore.reload(lastOptions); }; }, - /** - * Given an array of filter functions (each with optional scope), constructs and returns a single function that returns - * the result of all of the filters ANDed together - * @param {Array} filters The array of filter objects (each object should contain an 'fn' and optional scope) - * @return {Function} The multiple filter function - */ + createMultipleFilterFn: function(filters) { return function(record) { var isMatch = true; @@ -35210,37 +22167,9 @@ myStore.reload(lastOptions); }; }, - /** - * Filter the {@link Ext.data.Record records} by a specified property. Alternatively, pass an array of filter - * options to filter by more than one property. - * Single filter example: - * store.filter('name', 'Ed', true, true); //finds all records containing the substring 'Ed' - * Multiple filter example: - * store.filter([ - * { - * property : 'name', - * value : 'Ed', - * anyMatch : true, //optional, defaults to true - * caseSensitive: true //optional, defaults to true - * }, - * - * //filter functions can also be passed - * { - * fn : function(record) { - * return record.get('age') == 24 - * }, - * scope: this - * } - * ]); - * @param {String|Array} field A field on your records, or an array containing multiple filter options - * @param {String/RegExp} value Either a string that the field should begin with, or a RegExp to test - * against the field. - * @param {Boolean} anyMatch (optional) true to match any part not just the beginning - * @param {Boolean} caseSensitive (optional) true for case sensitive comparison - * @param {Boolean} exactMatch True to force exact match (^ and $ characters added to the regex). Defaults to false. Ignored if anyMatch is true. - */ + filter : function(property, value, anyMatch, caseSensitive, exactMatch){ - //we can accept an array of filter objects, or a single filter object - normalize them here + if (Ext.isObject(property)) { property = [property]; } @@ -35248,13 +22177,13 @@ myStore.reload(lastOptions); if (Ext.isArray(property)) { var filters = []; - //normalize the filters passed into an array of filter functions + for (var i=0, j = property.length; i < j; i++) { var filter = property[i], func = filter.fn, scope = filter.scope || this; - //if we weren't given a filter function, construct one now + if (!Ext.isFunction(func)) { func = this.createFilterFn(filter.property, filter.value, filter.anyMatch, filter.caseSensitive, filter.exactMatch); } @@ -35264,35 +22193,21 @@ myStore.reload(lastOptions); var fn = this.createMultipleFilterFn(filters); } else { - //classic single property filter + var fn = this.createFilterFn(property, value, anyMatch, caseSensitive, exactMatch); } return fn ? this.filterBy(fn) : this.clearFilter(); }, - /** - * Filter by a function. The specified function will be called for each - * Record in this Store. If the function returns true the Record is included, - * otherwise it is filtered out. - * @param {Function} fn The function to be called. It will be passed the following parameters:
      - *
    • record : Ext.data.Record

      The {@link Ext.data.Record record} - * to test for filtering. Access field values using {@link Ext.data.Record#get}.

    • - *
    • id : Object

      The ID of the Record passed.

    • - *
    - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to this Store. - */ + filterBy : function(fn, scope){ this.snapshot = this.snapshot || this.data; this.data = this.queryBy(fn, scope||this); this.fireEvent('datachanged', this); }, - /** - * Revert to a view of the Record cache with no filtering applied. - * @param {Boolean} suppressEvent If true the filter is cleared silently without firing the - * {@link #datachanged} event. - */ + clearFilter : function(suppressEvent){ if(this.isFiltered()){ this.data = this.snapshot; @@ -35303,96 +22218,42 @@ myStore.reload(lastOptions); } }, - /** - * Returns true if this store is currently filtered - * @return {Boolean} - */ + isFiltered : function(){ return !!this.snapshot && this.snapshot != this.data; }, - /** - * Query the records by a specified property. - * @param {String} field A field on your records - * @param {String/RegExp} value Either a string that the field - * should begin with, or a RegExp to test against the field. - * @param {Boolean} anyMatch (optional) True to match any part not just the beginning - * @param {Boolean} caseSensitive (optional) True for case sensitive comparison - * @return {MixedCollection} Returns an Ext.util.MixedCollection of the matched records - */ + query : function(property, value, anyMatch, caseSensitive){ var fn = this.createFilterFn(property, value, anyMatch, caseSensitive); return fn ? this.queryBy(fn) : this.data.clone(); }, - /** - * Query the cached records in this Store using a filtering function. The specified function - * will be called with each record in this Store. If the function returns true the record is - * included in the results. - * @param {Function} fn The function to be called. It will be passed the following parameters:
      - *
    • record : Ext.data.Record

      The {@link Ext.data.Record record} - * to test for filtering. Access field values using {@link Ext.data.Record#get}.

    • - *
    • id : Object

      The ID of the Record passed.

    • - *
    - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to this Store. - * @return {MixedCollection} Returns an Ext.util.MixedCollection of the matched records - **/ + queryBy : function(fn, scope){ var data = this.snapshot || this.data; return data.filterBy(fn, scope||this); }, - /** - * Finds the index of the first matching Record in this store by a specific field value. - * @param {String} fieldName The name of the Record field to test. - * @param {String/RegExp} value Either a string that the field value - * should begin with, or a RegExp to test against the field. - * @param {Number} startIndex (optional) The index to start searching at - * @param {Boolean} anyMatch (optional) True to match any part of the string, not just the beginning - * @param {Boolean} caseSensitive (optional) True for case sensitive comparison - * @return {Number} The matched index or -1 - */ + find : function(property, value, start, anyMatch, caseSensitive){ var fn = this.createFilterFn(property, value, anyMatch, caseSensitive); return fn ? this.data.findIndexBy(fn, null, start) : -1; }, - /** - * Finds the index of the first matching Record in this store by a specific field value. - * @param {String} fieldName The name of the Record field to test. - * @param {Mixed} value The value to match the field against. - * @param {Number} startIndex (optional) The index to start searching at - * @return {Number} The matched index or -1 - */ + findExact: function(property, value, start){ return this.data.findIndexBy(function(rec){ return rec.get(property) === value; }, this, start); }, - /** - * Find the index of the first matching Record in this Store by a function. - * If the function returns true it is considered a match. - * @param {Function} fn The function to be called. It will be passed the following parameters:
      - *
    • record : Ext.data.Record

      The {@link Ext.data.Record record} - * to test for filtering. Access field values using {@link Ext.data.Record#get}.

    • - *
    • id : Object

      The ID of the Record passed.

    • - *
    - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to this Store. - * @param {Number} startIndex (optional) The index to start searching at - * @return {Number} The matched index or -1 - */ + findBy : function(fn, scope, start){ return this.data.findIndexBy(fn, scope, start); }, - /** - * Collects unique values for a particular dataIndex from this store. - * @param {String} dataIndex The property to collect - * @param {Boolean} allowNull (optional) Pass true to allow null, undefined or empty string values - * @param {Boolean} bypassFilter (optional) Pass true to collect from all records, even ones which are filtered - * @return {Array} An array of the unique values - **/ + collect : function(dataIndex, allowNull, bypassFilter){ var d = (bypassFilter === true && this.snapshot) ? this.snapshot.items : this.data.items; @@ -35408,7 +22269,7 @@ myStore.reload(lastOptions); return r; }, - // private + afterEdit : function(record){ if(this.modified.indexOf(record) == -1){ this.modified.push(record); @@ -35416,23 +22277,19 @@ myStore.reload(lastOptions); this.fireEvent('update', this, record, Ext.data.Record.EDIT); }, - // private + afterReject : function(record){ this.modified.remove(record); this.fireEvent('update', this, record, Ext.data.Record.REJECT); }, - // private + afterCommit : function(record){ this.modified.remove(record); this.fireEvent('update', this, record, Ext.data.Record.COMMIT); }, - /** - * Commit all Records with {@link #getModifiedRecords outstanding changes}. To handle updates for changes, - * subscribe to the Store's {@link #update update event}, and perform updating when the third parameter is - * Ext.data.Record.COMMIT. - */ + commitChanges : function(){ var m = this.modified.slice(0); this.modified = []; @@ -35441,9 +22298,7 @@ myStore.reload(lastOptions); } }, - /** - * {@link Ext.data.Record#reject Reject} outstanding changes on all {@link #getModifiedRecords modified records}. - */ + rejectChanges : function(){ var m = this.modified.slice(0); this.modified = []; @@ -35458,7 +22313,7 @@ myStore.reload(lastOptions); } }, - // private + onMetaChange : function(meta){ this.recordType = this.reader.recordType; this.fields = this.recordType.prototype.fields; @@ -35475,7 +22330,7 @@ myStore.reload(lastOptions); this.fireEvent('metachange', this, this.reader.meta); }, - // private + findInsertIndex : function(record){ this.suspendEvents(); var data = this.data.clone(); @@ -35487,13 +22342,7 @@ myStore.reload(lastOptions); return index; }, - /** - * Set the value for a property name in this store's {@link #baseParams}. Usage:

    
    -myStore.setBaseParam('foo', {bar:3});
    -
    - * @param {String} name Name of the property to assign - * @param {Mixed} value Value to assign the named property - **/ + setBaseParam : function (name, value){ this.baseParams = this.baseParams || {}; this.baseParams[name] = value; @@ -35502,12 +22351,7 @@ myStore.setBaseParam('foo', {bar:3}); Ext.reg('store', Ext.data.Store); -/** - * @class Ext.data.Store.Error - * @extends Ext.Error - * Store Error extension. - * @param {String} name - */ + Ext.data.Store.Error = Ext.extend(Ext.Error, { name: 'Ext.data.Store' }); @@ -35516,13 +22360,7 @@ Ext.apply(Ext.data.Store.Error.prototype, { 'writer-undefined' : 'Attempted to execute a write-action without a DataWriter installed.' } }); -/** - * @class Ext.data.Field - *

    This class encapsulates the field definition information specified in the field definition objects - * passed to {@link Ext.data.Record#create}.

    - *

    Developers do not need to instantiate this class. Instances are created by {@link Ext.data.Record.create} - * and cached in the {@link Ext.data.Record#fields fields} property of the created Record constructor's prototype.

    - */ + Ext.data.Field = Ext.extend(Object, { constructor : function(config){ @@ -35543,7 +22381,7 @@ Ext.data.Field = Ext.extend(Object, { this.type = types.AUTO; } - // named sortTypes are supported, here we look them up + if(Ext.isString(st)){ this.sortType = Ext.data.SortTypes[st]; }else if(Ext.isEmpty(st)){ @@ -35555,260 +22393,80 @@ Ext.data.Field = Ext.extend(Object, { } }, - /** - * @cfg {String} name - * The name by which the field is referenced within the Record. This is referenced by, for example, - * the dataIndex property in column definition objects passed to {@link Ext.grid.ColumnModel}. - *

    Note: In the simplest case, if no properties other than name are required, a field - * definition may consist of just a String for the field name.

    - */ - /** - * @cfg {Mixed} type - * (Optional) The data type for automatic conversion from received data to the stored value if {@link Ext.data.Field#convert convert} - * has not been specified. This may be specified as a string value. Possible values are - *
      - *
    • auto (Default, implies no conversion)
    • - *
    • string
    • - *
    • int
    • - *
    • float
    • - *
    • boolean
    • - *
    • date
    - *

    This may also be specified by referencing a member of the {@link Ext.data.Types} class.

    - *

    Developers may create their own application-specific data types by defining new members of the - * {@link Ext.data.Types} class.

    - */ - /** - * @cfg {Function} convert - * (Optional) A function which converts the value provided by the Reader into an object that will be stored - * in the Record. It is passed the following parameters:
      - *
    • v : Mixed
      The data value as read by the Reader, if undefined will use - * the configured {@link Ext.data.Field#defaultValue defaultValue}.
    • - *
    • rec : Mixed
      The data object containing the row as read by the Reader. - * Depending on the Reader type, this could be an Array ({@link Ext.data.ArrayReader ArrayReader}), an object - * ({@link Ext.data.JsonReader JsonReader}), or an XML element ({@link Ext.data.XMLReader XMLReader}).
    • - *
    - *
    
    -// example of convert function
    -function fullName(v, record){
    -    return record.name.last + ', ' + record.name.first;
    -}
    -
    -function location(v, record){
    -    return !record.city ? '' : (record.city + ', ' + record.state);
    -}
    -
    -var Dude = Ext.data.Record.create([
    -    {name: 'fullname',  convert: fullName},
    -    {name: 'firstname', mapping: 'name.first'},
    -    {name: 'lastname',  mapping: 'name.last'},
    -    {name: 'city', defaultValue: 'homeless'},
    -    'state',
    -    {name: 'location',  convert: location}
    -]);
    -
    -// create the data store
    -var store = new Ext.data.Store({
    -    reader: new Ext.data.JsonReader(
    -        {
    -            idProperty: 'key',
    -            root: 'daRoot',
    -            totalProperty: 'total'
    -        },
    -        Dude  // recordType
    -    )
    -});
    -
    -var myData = [
    -    { key: 1,
    -      name: { first: 'Fat',    last:  'Albert' }
    -      // notice no city, state provided in data object
    -    },
    -    { key: 2,
    -      name: { first: 'Barney', last:  'Rubble' },
    -      city: 'Bedrock', state: 'Stoneridge'
    -    },
    -    { key: 3,
    -      name: { first: 'Cliff',  last:  'Claven' },
    -      city: 'Boston',  state: 'MA'
    -    }
    -];
    -     * 
    - */ - /** - * @cfg {String} dateFormat - *

    (Optional) Used when converting received data into a Date when the {@link #type} is specified as "date".

    - *

    A format string for the {@link Date#parseDate Date.parseDate} function, or "timestamp" if the - * value provided by the Reader is a UNIX timestamp, or "time" if the value provided by the Reader is a - * javascript millisecond timestamp. See {@link Date}

    - */ + + + + dateFormat: null, - /** - * @cfg {Mixed} defaultValue - * (Optional) The default value used when a Record is being created by a {@link Ext.data.Reader Reader} - * when the item referenced by the {@link Ext.data.Field#mapping mapping} does not exist in the data - * object (i.e. undefined). (defaults to "") - */ + defaultValue: "", - /** - * @cfg {String/Number} mapping - *

    (Optional) A path expression for use by the {@link Ext.data.DataReader} implementation - * that is creating the {@link Ext.data.Record Record} to extract the Field value from the data object. - * If the path expression is the same as the field name, the mapping may be omitted.

    - *

    The form of the mapping expression depends on the Reader being used.

    - *
      - *
    • {@link Ext.data.JsonReader}
      The mapping is a string containing the javascript - * expression to reference the data from an element of the data item's {@link Ext.data.JsonReader#root root} Array. Defaults to the field name.
    • - *
    • {@link Ext.data.XmlReader}
      The mapping is an {@link Ext.DomQuery} path to the data - * item relative to the DOM element that represents the {@link Ext.data.XmlReader#record record}. Defaults to the field name.
    • - *
    • {@link Ext.data.ArrayReader}
      The mapping is a number indicating the Array index - * of the field's value. Defaults to the field specification's Array position.
    • - *
    - *

    If a more complex value extraction strategy is required, then configure the Field with a {@link #convert} - * function. This is passed the whole row object, and may interrogate it in whatever way is necessary in order to - * return the desired data.

    - */ + mapping: null, - /** - * @cfg {Function} sortType - * (Optional) A function which converts a Field's value to a comparable value in order to ensure - * correct sort ordering. Predefined functions are provided in {@link Ext.data.SortTypes}. A custom - * sort example:
    
    -// current sort     after sort we want
    -// +-+------+          +-+------+
    -// |1|First |          |1|First |
    -// |2|Last  |          |3|Second|
    -// |3|Second|          |2|Last  |
    -// +-+------+          +-+------+
    -
    -sortType: function(value) {
    -   switch (value.toLowerCase()) // native toLowerCase():
    -   {
    -      case 'first': return 1;
    -      case 'second': return 2;
    -      default: return 3;
    -   }
    -}
    -     * 
    - */ + sortType : null, - /** - * @cfg {String} sortDir - * (Optional) Initial direction to sort ("ASC" or "DESC"). Defaults to - * "ASC". - */ + sortDir : "ASC", - /** - * @cfg {Boolean} allowBlank - * (Optional) Used for validating a {@link Ext.data.Record record}, defaults to true. - * An empty value here will cause {@link Ext.data.Record}.{@link Ext.data.Record#isValid isValid} - * to evaluate to false. - */ + allowBlank : true }); -/** - * @class Ext.data.DataReader - * Abstract base class for reading structured data from a data source and converting - * it into an object containing {@link Ext.data.Record} objects and metadata for use - * by an {@link Ext.data.Store}. This class is intended to be extended and should not - * be created directly. For existing implementations, see {@link Ext.data.ArrayReader}, - * {@link Ext.data.JsonReader} and {@link Ext.data.XmlReader}. - * @constructor Create a new DataReader - * @param {Object} meta Metadata configuration options (implementation-specific). - * @param {Array/Object} recordType - *

    Either an Array of {@link Ext.data.Field Field} definition objects (which - * will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record} - * constructor created using {@link Ext.data.Record#create}.

    - */ + Ext.data.DataReader = function(meta, recordType){ - /** - * This DataReader's configured metadata as passed to the constructor. - * @type Mixed - * @property meta - */ + this.meta = meta; - /** - * @cfg {Array/Object} fields - *

    Either an Array of {@link Ext.data.Field Field} definition objects (which - * will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record} - * constructor created from {@link Ext.data.Record#create}.

    - */ + this.recordType = Ext.isArray(recordType) ? Ext.data.Record.create(recordType) : recordType; - // if recordType defined make sure extraction functions are defined + if (this.recordType){ this.buildExtractors(); } }; Ext.data.DataReader.prototype = { - /** - * @cfg {String} messageProperty [undefined] Optional name of a property within a server-response that represents a user-feedback message. - */ - /** - * Abstract method created in extension's buildExtractors impl. - */ + + getTotal: Ext.emptyFn, - /** - * Abstract method created in extension's buildExtractors impl. - */ + getRoot: Ext.emptyFn, - /** - * Abstract method created in extension's buildExtractors impl. - */ + getMessage: Ext.emptyFn, - /** - * Abstract method created in extension's buildExtractors impl. - */ + getSuccess: Ext.emptyFn, - /** - * Abstract method created in extension's buildExtractors impl. - */ + getId: Ext.emptyFn, - /** - * Abstract method, overridden in DataReader extensions such as {@link Ext.data.JsonReader} and {@link Ext.data.XmlReader} - */ + buildExtractors : Ext.emptyFn, - /** - * Abstract method overridden in DataReader extensions such as {@link Ext.data.JsonReader} and {@link Ext.data.XmlReader} - */ + extractValues : Ext.emptyFn, - /** - * Used for un-phantoming a record after a successful database insert. Sets the records pk along with new data from server. - * You must return at least the database pk using the idProperty defined in your DataReader configuration. The incoming - * data from server will be merged with the data in the local record. - * In addition, you must return record-data from the server in the same order received. - * Will perform a commit as well, un-marking dirty-fields. Store's "update" event will be suppressed. - * @param {Record/Record[]} record The phantom record to be realized. - * @param {Object/Object[]} data The new record data to apply. Must include the primary-key from database defined in idProperty field. - */ + realize: function(rs, data){ if (Ext.isArray(rs)) { for (var i = rs.length - 1; i >= 0; i--) { - // recurse + if (Ext.isArray(data)) { this.realize(rs.splice(i,1).shift(), data.splice(i,1).shift()); } else { - // weird...rs is an array but data isn't?? recurse but just send in the whole invalid data object. - // the else clause below will detect !this.isData and throw exception. + + this.realize(rs.splice(i,1).shift(), data); } } } else { - // If rs is NOT an array but data IS, see if data contains just 1 record. If so extract it and carry on. + if (Ext.isArray(data) && data.length == 1) { data = data.shift(); } if (!this.isData(data)) { - // TODO: Let exception-handler choose to commit or not rather than blindly rs.commit() here. - //rs.commit(); + + throw new Ext.data.DataReader.Error('realize', rs); } - rs.phantom = false; // <-- That's what it's all about - rs._phid = rs.id; // <-- copy phantom-id -> _phid, so we can remap in Store#onCreateRecords + rs.phantom = false; + rs._phid = rs.id; rs.id = this.getId(data); rs.data = data; @@ -35816,14 +22474,7 @@ Ext.data.DataReader.prototype = { } }, - /** - * Used for updating a non-phantom or "real" record's data with fresh data from server after remote-save. - * If returning data from multiple-records after a batch-update, you must return record-data from the server in - * the same order received. Will perform a commit as well, un-marking dirty-fields. Store's "update" event will be - * suppressed as the record receives fresh new data-hash - * @param {Record/Record[]} rs - * @param {Object/Object[]} data - */ + update : function(rs, data) { if (Ext.isArray(rs)) { for (var i=rs.length-1; i >= 0; i--) { @@ -35831,14 +22482,14 @@ Ext.data.DataReader.prototype = { this.update(rs.splice(i,1).shift(), data.splice(i,1).shift()); } else { - // weird...rs is an array but data isn't?? recurse but just send in the whole data object. - // the else clause below will detect !this.isData and throw exception. + + this.update(rs.splice(i,1).shift(), data); } } } else { - // If rs is NOT an array but data IS, see if data contains just 1 record. If so extract it and carry on. + if (Ext.isArray(data) && data.length == 1) { data = data.shift(); } @@ -35849,20 +22500,15 @@ Ext.data.DataReader.prototype = { } }, - /** - * returns extracted, type-cast rows of data. Iterates to call #extractValues for each row - * @param {Object[]/Object} data-root from server response - * @param {Boolean} returnRecords [false] Set true to return instances of Ext.data.Record - * @private - */ + extractData : function(root, returnRecords) { - // A bit ugly this, too bad the Record's raw data couldn't be saved in a common property named "raw" or something. + var rawName = (this instanceof Ext.data.JsonReader) ? 'json' : 'node'; var rs = []; - // Had to add Check for XmlReader, #isData returns true if root is an Xml-object. Want to check in order to re-factor - // #extractData into DataReader base, since the implementations are almost identical for JsonReader, XmlReader + + if (this.isData(root) && !(this instanceof Ext.data.XmlReader)) { root = [root]; } @@ -35875,7 +22521,7 @@ Ext.data.DataReader.prototype = { for (var i = 0; i < root.length; i++) { var n = root[i]; var record = new Record(this.extractValues(n, fi, fl), this.getId(n)); - record[rawName] = n; // <-- There's implementation of ugly bit, setting the raw record-data. + record[rawName] = n; rs.push(record); } } @@ -35889,17 +22535,12 @@ Ext.data.DataReader.prototype = { return rs; }, - /** - * Returns true if the supplied data-hash looks and quacks like data. Checks to see if it has a key - * corresponding to idProperty defined in your DataReader config containing non-empty pk. - * @param {Object} data - * @return {Boolean} - */ + isData : function(data) { return (data && Ext.isObject(data) && !Ext.isEmpty(this.getId(data))) ? true : false; }, - // private function a store will createSequence upon + onMetaChange : function(meta){ delete this.ef; this.meta = meta; @@ -35908,11 +22549,7 @@ Ext.data.DataReader.prototype = { } }; -/** - * @class Ext.data.DataReader.Error - * @extends Ext.Error - * General error class for Ext.data.DataReader - */ + Ext.data.DataReader.Error = Ext.extend(Ext.Error, { constructor : function(message, arg) { this.arg = arg; @@ -35927,120 +22564,22 @@ Ext.apply(Ext.data.DataReader.Error.prototype, { 'invalid-response': "#readResponse received an invalid response from the server." } }); -/** - * @class Ext.data.DataWriter - *

    Ext.data.DataWriter facilitates create, update, and destroy actions between - * an Ext.data.Store and a server-side framework. A Writer enabled Store will - * automatically manage the Ajax requests to perform CRUD actions on a Store.

    - *

    Ext.data.DataWriter is an abstract base class which is intended to be extended - * and should not be created directly. For existing implementations, see - * {@link Ext.data.JsonWriter}.

    - *

    Creating a writer is simple:

    - *
    
    -var writer = new Ext.data.JsonWriter({
    -    encode: false   // <--- false causes data to be printed to jsonData config-property of Ext.Ajax#reqeust
    -});
    - * 
    - * *

    Same old JsonReader as Ext-2.x:

    - *
    
    -var reader = new Ext.data.JsonReader({idProperty: 'id'}, [{name: 'first'}, {name: 'last'}, {name: 'email'}]);
    - * 
    - * - *

    The proxy for a writer enabled store can be configured with a simple url:

    - *
    
    -// Create a standard HttpProxy instance.
    -var proxy = new Ext.data.HttpProxy({
    -    url: 'app.php/users'    // <--- Supports "provides"-type urls, such as '/users.json', '/products.xml' (Hello Rails/Merb)
    -});
    - * 
    - *

    For finer grained control, the proxy may also be configured with an API:

    - *
    
    -// Maximum flexibility with the API-configuration
    -var proxy = new Ext.data.HttpProxy({
    -    api: {
    -        read    : 'app.php/users/read',
    -        create  : 'app.php/users/create',
    -        update  : 'app.php/users/update',
    -        destroy : {  // <--- Supports object-syntax as well
    -            url: 'app.php/users/destroy',
    -            method: "DELETE"
    -        }
    -    }
    -});
    - * 
    - *

    Pulling it all together into a Writer-enabled Store:

    - *
    
    -var store = new Ext.data.Store({
    -    proxy: proxy,
    -    reader: reader,
    -    writer: writer,
    -    autoLoad: true,
    -    autoSave: true  // -- Cell-level updates.
    -});
    - * 
    - *

    Initiating write-actions automatically, using the existing Ext2.0 Store/Record API:

    - *
    
    -var rec = store.getAt(0);
    -rec.set('email', 'foo@bar.com');  // <--- Immediately initiates an UPDATE action through configured proxy.
    -
    -store.remove(rec);  // <---- Immediately initiates a DESTROY action through configured proxy.
    - * 
    - *

    For record/batch updates, use the Store-configuration {@link Ext.data.Store#autoSave autoSave:false}

    - *
    
    -var store = new Ext.data.Store({
    -    proxy: proxy,
    -    reader: reader,
    -    writer: writer,
    -    autoLoad: true,
    -    autoSave: false  // -- disable cell-updates
    -});
     
    -var urec = store.getAt(0);
    -urec.set('email', 'foo@bar.com');
    -
    -var drec = store.getAt(1);
    -store.remove(drec);
    -
    -// Push the button!
    -store.save();
    - * 
    - * @constructor Create a new DataWriter - * @param {Object} meta Metadata configuration options (implementation-specific) - * @param {Object} recordType Either an Array of field definition objects as specified - * in {@link Ext.data.Record#create}, or an {@link Ext.data.Record} object created - * using {@link Ext.data.Record#create}. - */ Ext.data.DataWriter = function(config){ Ext.apply(this, config); }; Ext.data.DataWriter.prototype = { - /** - * @cfg {Boolean} writeAllFields - * false by default. Set true to have DataWriter return ALL fields of a modified - * record -- not just those that changed. - * false to have DataWriter only request modified fields from a record. - */ + writeAllFields : false, - /** - * @cfg {Boolean} listful - * false by default. Set true to have the DataWriter always write HTTP params as a list, - * even when acting upon a single record. - */ - listful : false, // <-- listful is actually not used internally here in DataWriter. @see Ext.data.Store#execute. + + listful : false, - /** - * Compiles a Store recordset into a data-format defined by an extension such as {@link Ext.data.JsonWriter} or {@link Ext.data.XmlWriter} in preparation for a {@link Ext.data.Api#actions server-write action}. The first two params are similar similar in nature to {@link Ext#apply}, - * Where the first parameter is the receiver of paramaters and the second, baseParams, the source. - * @param {Object} params The request-params receiver. - * @param {Object} baseParams as defined by {@link Ext.data.Store#baseParams}. The baseParms must be encoded by the extending class, eg: {@link Ext.data.JsonWriter}, {@link Ext.data.XmlWriter}. - * @param {String} action [{@link Ext.data.Api#actions create|update|destroy}] - * @param {Record/Record[]} rs The recordset to write, the subject(s) of the write action. - */ + apply : function(params, baseParams, action, rs) { var data = [], renderer = action + 'Record'; - // TODO implement @cfg listful here + if (Ext.isArray(rs)) { Ext.each(rs, function(rec){ data.push(this[renderer](rec)); @@ -36052,44 +22591,19 @@ Ext.data.DataWriter.prototype = { this.render(params, baseParams, data); }, - /** - * abstract method meant to be overridden by all DataWriter extensions. It's the extension's job to apply the "data" to the "params". - * The data-object provided to render is populated with data according to the meta-info defined in the user's DataReader config, - * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] - * @param {Record[]} rs Store recordset - * @param {Object} params Http params to be sent to server. - * @param {Object} data object populated according to DataReader meta-data. - */ + render : Ext.emptyFn, - /** - * @cfg {Function} updateRecord Abstract method that should be implemented in all subclasses - * (e.g.: {@link Ext.data.JsonWriter#updateRecord JsonWriter.updateRecord} - */ + updateRecord : Ext.emptyFn, - /** - * @cfg {Function} createRecord Abstract method that should be implemented in all subclasses - * (e.g.: {@link Ext.data.JsonWriter#createRecord JsonWriter.createRecord}) - */ + createRecord : Ext.emptyFn, - /** - * @cfg {Function} destroyRecord Abstract method that should be implemented in all subclasses - * (e.g.: {@link Ext.data.JsonWriter#destroyRecord JsonWriter.destroyRecord}) - */ + destroyRecord : Ext.emptyFn, - /** - * Converts a Record to a hash, taking into account the state of the Ext.data.Record along with configuration properties - * related to its rendering, such as {@link #writeAllFields}, {@link Ext.data.Record#phantom phantom}, {@link Ext.data.Record#getChanges getChanges} and - * {@link Ext.data.DataReader#idProperty idProperty} - * @param {Ext.data.Record} rec The Record from which to create a hash. - * @param {Object} config NOT YET IMPLEMENTED. Will implement an exlude/only configuration for fine-control over which fields do/don't get rendered. - * @return {Object} - * @protected - * TODO Implement excludes/only configuration with 2nd param? - */ + toHash : function(rec, config) { var map = rec.fields.map, data = {}, @@ -36100,9 +22614,9 @@ Ext.data.DataWriter.prototype = { data[m.mapping ? m.mapping : m.name] = value; } }); - // we don't want to write Ext auto-generated id to hash. Careful not to remove it on Models not having auto-increment pk though. - // We can tell its not auto-increment if the user defined a DataReader field for it *and* that field's value is non-empty. - // we could also do a RegExp here for the Ext.data.Record AUTO_ID prefix. + + + if (rec.phantom) { if (rec.fields.containsKey(this.meta.idProperty) && Ext.isEmpty(rec.data[this.meta.idProperty])) { delete data[this.meta.idProperty]; @@ -36113,284 +22627,49 @@ Ext.data.DataWriter.prototype = { return data; }, - /** - * Converts a {@link Ext.data.DataWriter#toHash Hashed} {@link Ext.data.Record} to fields-array array suitable - * for encoding to xml via XTemplate, eg: -
    <tpl for="."><{name}>{value}</{name}</tpl>
    - * eg, non-phantom: -
    {id: 1, first: 'foo', last: 'bar'} --> [{name: 'id', value: 1}, {name: 'first', value: 'foo'}, {name: 'last', value: 'bar'}]
    - * {@link Ext.data.Record#phantom Phantom} records will have had their idProperty omitted in {@link #toHash} if determined to be auto-generated. - * Non AUTOINCREMENT pks should have been protected. - * @param {Hash} data Hashed by Ext.data.DataWriter#toHash - * @return {[Object]} Array of attribute-objects. - * @protected - */ + toArray : function(data) { var fields = []; Ext.iterate(data, function(k, v) {fields.push({name: k, value: v});},this); return fields; } -};/** - * @class Ext.data.DataProxy - * @extends Ext.util.Observable - *

    Abstract base class for implementations which provide retrieval of unformatted data objects. - * This class is intended to be extended and should not be created directly. For existing implementations, - * see {@link Ext.data.DirectProxy}, {@link Ext.data.HttpProxy}, {@link Ext.data.ScriptTagProxy} and - * {@link Ext.data.MemoryProxy}.

    - *

    DataProxy implementations are usually used in conjunction with an implementation of {@link Ext.data.DataReader} - * (of the appropriate type which knows how to parse the data object) to provide a block of - * {@link Ext.data.Records} to an {@link Ext.data.Store}.

    - *

    The parameter to a DataProxy constructor may be an {@link Ext.data.Connection} or can also be the - * config object to an {@link Ext.data.Connection}.

    - *

    Custom implementations must implement either the doRequest method (preferred) or the - * load method (deprecated). See - * {@link Ext.data.HttpProxy}.{@link Ext.data.HttpProxy#doRequest doRequest} or - * {@link Ext.data.HttpProxy}.{@link Ext.data.HttpProxy#load load} for additional details.

    - *

    Example 1

    - *
    
    -proxy: new Ext.data.ScriptTagProxy({
    -    {@link Ext.data.Connection#url url}: 'http://extjs.com/forum/topics-remote.php'
    -}),
    - * 
    - *

    Example 2

    - *
    
    -proxy : new Ext.data.HttpProxy({
    -    {@link Ext.data.Connection#method method}: 'GET',
    -    {@link Ext.data.HttpProxy#prettyUrls prettyUrls}: false,
    -    {@link Ext.data.Connection#url url}: 'local/default.php', // see options parameter for {@link Ext.Ajax#request}
    -    {@link #api}: {
    -        // all actions except the following will use above url
    -        create  : 'local/new.php',
    -        update  : 'local/update.php'
    -    }
    -}),
    - * 
    - *

    And new in Ext version 3, attach centralized event-listeners upon the DataProxy class itself! This is a great place - * to implement a messaging system to centralize your application's user-feedback and error-handling.

    - *
    
    -// Listen to all "beforewrite" event fired by all proxies.
    -Ext.data.DataProxy.on('beforewrite', function(proxy, action) {
    -    console.log('beforewrite: ', action);
    -});
    -
    -// Listen to "write" event fired by all proxies
    -Ext.data.DataProxy.on('write', function(proxy, action, data, res, rs) {
    -    console.info('write: ', action);
    -});
    -
    -// Listen to "exception" event fired by all proxies
    -Ext.data.DataProxy.on('exception', function(proxy, type, action) {
    -    console.error(type + action + ' exception);
    -});
    - * 
    - * Note: These three events are all fired with the signature of the corresponding DataProxy instance event {@link #beforewrite beforewrite}, {@link #write write} and {@link #exception exception}. - */ +}; Ext.data.DataProxy = function(conn){ - // make sure we have a config object here to support ux proxies. - // All proxies should now send config into superclass constructor. + + conn = conn || {}; - // This line caused a bug when people use custom Connection object having its own request method. - // http://extjs.com/forum/showthread.php?t=67194. Have to set DataProxy config - //Ext.applyIf(this, conn); + + + this.api = conn.api; this.url = conn.url; this.restful = conn.restful; this.listeners = conn.listeners; - // deprecated + this.prettyUrls = conn.prettyUrls; - /** - * @cfg {Object} api - * Specific urls to call on CRUD action methods "read", "create", "update" and "destroy". - * Defaults to:
    
    -api: {
    -    read    : undefined,
    -    create  : undefined,
    -    update  : undefined,
    -    destroy : undefined
    -}
    -     * 
    - *

    The url is built based upon the action being executed [load|create|save|destroy] - * using the commensurate {@link #api} property, or if undefined default to the - * configured {@link Ext.data.Store}.{@link Ext.data.Store#url url}.


    - *

    For example:

    - *
    
    -api: {
    -    load :    '/controller/load',
    -    create :  '/controller/new',  // Server MUST return idProperty of new record
    -    save :    '/controller/update',
    -    destroy : '/controller/destroy_action'
    -}
    -
    -// Alternatively, one can use the object-form to specify each API-action
    -api: {
    -    load: {url: 'read.php', method: 'GET'},
    -    create: 'create.php',
    -    destroy: 'destroy.php',
    -    save: 'update.php'
    -}
    -     * 
    - *

    If the specific URL for a given CRUD action is undefined, the CRUD action request - * will be directed to the configured {@link Ext.data.Connection#url url}.

    - *

    Note: To modify the URL for an action dynamically the appropriate API - * property should be modified before the action is requested using the corresponding before - * action event. For example to modify the URL associated with the load action: - *

    
    -// modify the url for the action
    -myStore.on({
    -    beforeload: {
    -        fn: function (store, options) {
    -            // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request.
    -            store.proxy.setUrl('changed1.php');
    -
    -            // set optional second parameter to true to make this URL change
    -            // permanent, applying this URL for all subsequent requests.
    -            store.proxy.setUrl('changed1.php', true);
    -
    -            // Altering the proxy API should be done using the public
    -            // method {@link Ext.data.DataProxy#setApi setApi}.
    -            store.proxy.setApi('read', 'changed2.php');
    -
    -            // Or set the entire API with a config-object.
    -            // When using the config-object option, you must redefine the entire
    -            // API -- not just a specific action of it.
    -            store.proxy.setApi({
    -                read    : 'changed_read.php',
    -                create  : 'changed_create.php',
    -                update  : 'changed_update.php',
    -                destroy : 'changed_destroy.php'
    -            });
    -        }
    -    }
    -});
    -     * 
    - *

    - */ + this.addEvents( - /** - * @event exception - *

    Fires if an exception occurs in the Proxy during a remote request. This event is relayed - * through a corresponding {@link Ext.data.Store}.{@link Ext.data.Store#exception exception}, - * so any Store instance may observe this event.

    - *

    In addition to being fired through the DataProxy instance that raised the event, this event is also fired - * through the Ext.data.DataProxy class to allow for centralized processing of exception events from all - * DataProxies by attaching a listener to the Ext.data.Proxy class itself.

    - *

    This event can be fired for one of two reasons:

    - *
      - *
    • remote-request failed :
      - * The server did not return status === 200. - *
    • - *
    • remote-request succeeded :
      - * The remote-request succeeded but the reader could not read the response. - * This means the server returned data, but the configured Reader threw an - * error while reading the response. In this case, this event will be - * raised and the caught error will be passed along into this event. - *
    • - *
    - *

    This event fires with two different contexts based upon the 2nd - * parameter type [remote|response]. The first four parameters - * are identical between the two contexts -- only the final two parameters - * differ.

    - * @param {DataProxy} this The proxy that sent the request - * @param {String} type - *

    The value of this parameter will be either 'response' or 'remote'.

    - *
      - *
    • 'response' :
      - *

      An invalid response from the server was returned: either 404, - * 500 or the response meta-data does not match that defined in the DataReader - * (e.g.: root, idProperty, successProperty).

      - *
    • - *
    • 'remote' :
      - *

      A valid response was returned from the server having - * successProperty === false. This response might contain an error-message - * sent from the server. For example, the user may have failed - * authentication/authorization or a database validation error occurred.

      - *
    • - *
    - * @param {String} action Name of the action (see {@link Ext.data.Api#actions}. - * @param {Object} options The options for the action that were specified in the {@link #request}. - * @param {Object} response - *

    The value of this parameter depends on the value of the type parameter:

    - *
      - *
    • 'response' :
      - *

      The raw browser response object (e.g.: XMLHttpRequest)

      - *
    • - *
    • 'remote' :
      - *

      The decoded response object sent from the server.

      - *
    • - *
    - * @param {Mixed} arg - *

    The type and value of this parameter depends on the value of the type parameter:

    - *
      - *
    • 'response' : Error
      - *

      The JavaScript Error object caught if the configured Reader could not read the data. - * If the remote request returns success===false, this parameter will be null.

      - *
    • - *
    • 'remote' : Record/Record[]
      - *

      This parameter will only exist if the action was a write action - * (Ext.data.Api.actions.create|update|destroy).

      - *
    • - *
    - */ + 'exception', - /** - * @event beforeload - * Fires before a request to retrieve a data object. - * @param {DataProxy} this The proxy for the request - * @param {Object} params The params object passed to the {@link #request} function - */ + 'beforeload', - /** - * @event load - * Fires before the load method's callback is called. - * @param {DataProxy} this The proxy for the request - * @param {Object} o The request transaction object - * @param {Object} options The callback's options property as passed to the {@link #request} function - */ + 'load', - /** - * @event loadexception - *

    This event is deprecated. The signature of the loadexception event - * varies depending on the proxy, use the catch-all {@link #exception} event instead. - * This event will fire in addition to the {@link #exception} event.

    - * @param {misc} misc See {@link #exception}. - * @deprecated - */ + 'loadexception', - /** - * @event beforewrite - *

    Fires before a request is generated for one of the actions Ext.data.Api.actions.create|update|destroy

    - *

    In addition to being fired through the DataProxy instance that raised the event, this event is also fired - * through the Ext.data.DataProxy class to allow for centralized processing of beforewrite events from all - * DataProxies by attaching a listener to the Ext.data.Proxy class itself.

    - * @param {DataProxy} this The proxy for the request - * @param {String} action [Ext.data.Api.actions.create|update|destroy] - * @param {Record/Record[]} rs The Record(s) to create|update|destroy. - * @param {Object} params The request params object. Edit params to add parameters to the request. - */ + 'beforewrite', - /** - * @event write - *

    Fires before the request-callback is called

    - *

    In addition to being fired through the DataProxy instance that raised the event, this event is also fired - * through the Ext.data.DataProxy class to allow for centralized processing of write events from all - * DataProxies by attaching a listener to the Ext.data.Proxy class itself.

    - * @param {DataProxy} this The proxy that sent the request - * @param {String} action [Ext.data.Api.actions.create|upate|destroy] - * @param {Object} data The data object extracted from the server-response - * @param {Object} response The decoded response from server - * @param {Record/Record[]} rs The Record(s) from Store - * @param {Object} options The callback's options property as passed to the {@link #request} function - */ + 'write' ); Ext.data.DataProxy.superclass.constructor.call(this); - // Prepare the proxy api. Ensures all API-actions are defined with the Object-form. + try { Ext.data.Api.prepare(this); } catch (e) { @@ -36398,68 +22677,15 @@ myStore.on({ e.toConsole(); } } - // relay each proxy's events onto Ext.data.DataProxy class for centralized Proxy-listening + Ext.data.DataProxy.relayEvents(this, ['beforewrite', 'write', 'exception']); }; Ext.extend(Ext.data.DataProxy, Ext.util.Observable, { - /** - * @cfg {Boolean} restful - *

    Defaults to false. Set to true to operate in a RESTful manner.

    - *

    Note: this parameter will automatically be set to true if the - * {@link Ext.data.Store} it is plugged into is set to restful: true. If the - * Store is RESTful, there is no need to set this option on the proxy.

    - *

    RESTful implementations enable the serverside framework to automatically route - * actions sent to one url based upon the HTTP method, for example: - *

    
    -store: new Ext.data.Store({
    -    restful: true,
    -    proxy: new Ext.data.HttpProxy({url:'/users'}); // all requests sent to /users
    -    ...
    -)}
    -     * 
    - * If there is no {@link #api} specified in the configuration of the proxy, - * all requests will be marshalled to a single RESTful url (/users) so the serverside - * framework can inspect the HTTP Method and act accordingly: - *
    -Method   url        action
    -POST     /users     create
    -GET      /users     read
    -PUT      /users/23  update
    -DESTROY  /users/23  delete
    -     * 

    - *

    If set to true, a {@link Ext.data.Record#phantom non-phantom} record's - * {@link Ext.data.Record#id id} will be appended to the url. Some MVC (e.g., Ruby on Rails, - * Merb and Django) support segment based urls where the segments in the URL follow the - * Model-View-Controller approach:

    
    -     * someSite.com/controller/action/id
    -     * 
    - * Where the segments in the url are typically:
      - *
    • The first segment : represents the controller class that should be invoked.
    • - *
    • The second segment : represents the class function, or method, that should be called.
    • - *
    • The third segment : represents the ID (a variable typically passed to the method).
    • - *

    - *

    Refer to {@link Ext.data.DataProxy#api} for additional information.

    - */ + restful: false, - /** - *

    Redefines the Proxy's API or a single action of an API. Can be called with two method signatures.

    - *

    If called with an object as the only parameter, the object should redefine the entire API, e.g.:

    
    -proxy.setApi({
    -    read    : '/users/read',
    -    create  : '/users/create',
    -    update  : '/users/update',
    -    destroy : '/users/destroy'
    -});
    -
    - *

    If called with two parameters, the first parameter should be a string specifying the API action to - * redefine and the second parameter should be the URL (or function if using DirectProxy) to call for that action, e.g.:

    
    -proxy.setApi(Ext.data.Api.actions.read, '/users/new_load_url');
    -
    - * @param {String/Object} api An API specification object, or the name of an action. - * @param {String/Function} url The URL (or function if using DirectProxy) to call for the action. - */ + setApi : function() { if (arguments.length == 1) { var valid = Ext.data.Api.isValid(arguments[0]); @@ -36479,28 +22705,12 @@ proxy.setApi(Ext.data.Api.actions.read, '/users/new_load_url'); Ext.data.Api.prepare(this); }, - /** - * Returns true if the specified action is defined as a unique action in the api-config. - * request. If all API-actions are routed to unique urls, the xaction parameter is unecessary. However, if no api is defined - * and all Proxy actions are routed to DataProxy#url, the server-side will require the xaction parameter to perform a switch to - * the corresponding code for CRUD action. - * @param {String [Ext.data.Api.CREATE|READ|UPDATE|DESTROY]} action - * @return {Boolean} - */ + isApiAction : function(action) { return (this.api[action]) ? true : false; }, - /** - * All proxy actions are executed through this method. Automatically fires the "before" + action event - * @param {String} action Name of the action - * @param {Ext.data.Record/Ext.data.Record[]/null} rs Will be null when action is 'load' - * @param {Object} params - * @param {Ext.data.DataReader} reader - * @param {Function} callback - * @param {Object} scope The scope (this reference) in which the callback function is executed. Defaults to the Proxy object. - * @param {Object} options Any options specified for the action (e.g. see {@link Ext.data.Store#load}. - */ + request : function(action, rs, params, reader, callback, scope, options) { if (!this.api[action] && !this.load) { throw new Ext.data.DataProxy.Error('action-undefined', action); @@ -36515,111 +22725,64 @@ proxy.setApi(Ext.data.Api.actions.read, '/users/new_load_url'); }, - /** - * Deprecated load method using old method signature. See {@doRequest} for preferred method. - * @deprecated - * @param {Object} params - * @param {Object} reader - * @param {Object} callback - * @param {Object} scope - * @param {Object} arg - */ + load : null, - /** - * @cfg {Function} doRequest Abstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers. - * (e.g.: {@link Ext.data.HttpProxy#doRequest HttpProxy.doRequest}, - * {@link Ext.data.DirectProxy#doRequest DirectProxy.doRequest}). - */ + doRequest : function(action, rs, params, reader, callback, scope, options) { - // default implementation of doRequest for backwards compatibility with 2.0 proxies. - // If we're executing here, the action is probably "load". - // Call with the pre-3.0 method signature. + + + this.load(params, reader, callback, scope, options); }, - /** - * @cfg {Function} onRead Abstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers. Callback for read {@link Ext.data.Api#actions action}. - * @param {String} action Action name as per {@link Ext.data.Api.actions#read}. - * @param {Object} o The request transaction object - * @param {Object} res The server response - * @fires loadexception (deprecated) - * @fires exception - * @fires load - * @protected - */ + onRead : Ext.emptyFn, - /** - * @cfg {Function} onWrite Abstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers. Callback for create, update and destroy {@link Ext.data.Api#actions actions}. - * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] - * @param {Object} trans The request transaction object - * @param {Object} res The server response - * @fires exception - * @fires write - * @protected - */ + onWrite : Ext.emptyFn, - /** - * buildUrl - * Sets the appropriate url based upon the action being executed. If restful is true, and only a single record is being acted upon, - * url will be built Rails-style, as in "/controller/action/32". restful will aply iff the supplied record is an - * instance of Ext.data.Record rather than an Array of them. - * @param {String} action The api action being executed [read|create|update|destroy] - * @param {Ext.data.Record/Ext.data.Record[]} record The record or Array of Records being acted upon. - * @return {String} url - * @private - */ + buildUrl : function(action, record) { record = record || null; - // conn.url gets nullified after each request. If it's NOT null here, that means the user must have intervened with a call - // to DataProxy#setUrl or DataProxy#setApi and changed it before the request was executed. If that's the case, use conn.url, - // otherwise, build the url from the api or this.url. + + + var url = (this.conn && this.conn.url) ? this.conn.url : (this.api[action]) ? this.api[action].url : this.url; if (!url) { throw new Ext.data.Api.Error('invalid-url', action); } - // look for urls having "provides" suffix used in some MVC frameworks like Rails/Merb and others. The provides suffice informs - // the server what data-format the client is dealing with and returns data in the same format (eg: application/json, application/xml, etc) - // e.g.: /users.json, /users.xml, etc. - // with restful routes, we need urls like: - // PUT /users/1.json - // DELETE /users/1.json + + + + + + var provides = null; var m = url.match(/(.*)(\.json|\.xml|\.html)$/); if (m) { - provides = m[2]; // eg ".json" - url = m[1]; // eg: "/users" + provides = m[2]; + url = m[1]; } - // prettyUrls is deprectated in favor of restful-config + if ((this.restful === true || this.prettyUrls === true) && record instanceof Ext.data.Record && !record.phantom) { url += '/' + record.id; } return (provides === null) ? url : url + provides; }, - /** - * Destroys the proxy by purging any event listeners and cancelling any active requests. - */ + destroy: function(){ this.purgeListeners(); } }); -// Apply the Observable prototype to the DataProxy class so that proxy instances can relay their -// events to the class. Allows for centralized listening of all proxy instances upon the DataProxy class. + + Ext.apply(Ext.data.DataProxy, Ext.util.Observable.prototype); Ext.util.Observable.call(Ext.data.DataProxy); -/** - * @class Ext.data.DataProxy.Error - * @extends Ext.Error - * DataProxy Error extension. - * constructor - * @param {String} message Message describing the error. - * @param {Record/Record[]} arg - */ + Ext.data.DataProxy.Error = Ext.extend(Ext.Error, { constructor : function(message, arg) { this.arg = arg; @@ -36635,139 +22798,43 @@ Ext.apply(Ext.data.DataProxy.Error.prototype, { }); -/** - * @class Ext.data.Request - * A simple Request class used internally to the data package to provide more generalized remote-requests - * to a DataProxy. - * TODO Not yet implemented. Implement in Ext.data.Store#execute - */ + Ext.data.Request = function(params) { Ext.apply(this, params); }; Ext.data.Request.prototype = { - /** - * @cfg {String} action - */ + action : undefined, - /** - * @cfg {Ext.data.Record[]/Ext.data.Record} rs The Store recordset associated with the request. - */ + rs : undefined, - /** - * @cfg {Object} params HTTP request params - */ + params: undefined, - /** - * @cfg {Function} callback The function to call when request is complete - */ + callback : Ext.emptyFn, - /** - * @cfg {Object} scope The scope of the callback funtion - */ + scope : undefined, - /** - * @cfg {Ext.data.DataReader} reader The DataReader instance which will parse the received response - */ + reader : undefined }; -/** - * @class Ext.data.Response - * A generic response class to normalize response-handling internally to the framework. - */ + Ext.data.Response = function(params) { Ext.apply(this, params); }; Ext.data.Response.prototype = { - /** - * @cfg {String} action {@link Ext.data.Api#actions} - */ + action: undefined, - /** - * @cfg {Boolean} success - */ + success : undefined, - /** - * @cfg {String} message - */ + message : undefined, - /** - * @cfg {Array/Object} data - */ + data: undefined, - /** - * @cfg {Object} raw The raw response returned from server-code - */ + raw: undefined, - /** - * @cfg {Ext.data.Record/Ext.data.Record[]} records related to the Request action - */ + records: undefined }; -/** - * @class Ext.data.ScriptTagProxy - * @extends Ext.data.DataProxy - * An implementation of Ext.data.DataProxy that reads a data object from a URL which may be in a domain - * other than the originating domain of the running page.
    - *

    - * Note that if you are retrieving data from a page that is in a domain that is NOT the same as the originating domain - * of the running page, you must use this class, rather than HttpProxy.
    - *

    - * The content passed back from a server resource requested by a ScriptTagProxy must be executable JavaScript - * source code because it is used as the source inside a <script> tag.
    - *

    - * In order for the browser to process the returned data, the server must wrap the data object - * with a call to a callback function, the name of which is passed as a parameter by the ScriptTagProxy. - * Below is a Java example for a servlet which returns data for either a ScriptTagProxy, or an HttpProxy - * depending on whether the callback name was passed: - *

    - *

    
    -boolean scriptTag = false;
    -String cb = request.getParameter("callback");
    -if (cb != null) {
    -    scriptTag = true;
    -    response.setContentType("text/javascript");
    -} else {
    -    response.setContentType("application/x-json");
    -}
    -Writer out = response.getWriter();
    -if (scriptTag) {
    -    out.write(cb + "(");
    -}
    -out.print(dataBlock.toJsonString());
    -if (scriptTag) {
    -    out.write(");");
    -}
    -
    - *

    Below is a PHP example to do the same thing:

    
    -$callback = $_REQUEST['callback'];
    -
    -// Create the output object.
    -$output = array('a' => 'Apple', 'b' => 'Banana');
    -
    -//start output
    -if ($callback) {
    -    header('Content-Type: text/javascript');
    -    echo $callback . '(' . json_encode($output) . ');';
    -} else {
    -    header('Content-Type: application/x-json');
    -    echo json_encode($output);
    -}
    -
    - *

    Below is the ASP.Net code to do the same thing:

    
    -String jsonString = "{success: true}";
    -String cb = Request.Params.Get("callback");
    -String responseString = "";
    -if (!String.IsNullOrEmpty(cb)) {
    -    responseString = cb + "(" + jsonString + ")";
    -} else {
    -    responseString = jsonString;
    -}
    -Response.Write(responseString);
    -
    - * - * @constructor - * @param {Object} config A configuration object. - */ + Ext.data.ScriptTagProxy = function(config){ Ext.apply(this, config); @@ -36775,67 +22842,21 @@ Ext.data.ScriptTagProxy = function(config){ this.head = document.getElementsByTagName("head")[0]; - /** - * @event loadexception - * Deprecated in favor of 'exception' event. - * Fires if an exception occurs in the Proxy during data loading. This event can be fired for one of two reasons: - *
    • The load call timed out. This means the load callback did not execute within the time limit - * specified by {@link #timeout}. In this case, this event will be raised and the - * fourth parameter (read error) will be null.
    • - *
    • The load succeeded but the reader could not read the response. This means the server returned - * data, but the configured Reader threw an error while reading the data. In this case, this event will be - * raised and the caught error will be passed along as the fourth parameter of this event.
    - * Note that this event is also relayed through {@link Ext.data.Store}, so you can listen for it directly - * on any Store instance. - * @param {Object} this - * @param {Object} options The loading options that were specified (see {@link #load} for details). If the load - * call timed out, this parameter will be null. - * @param {Object} arg The callback's arg object passed to the {@link #load} function - * @param {Error} e The JavaScript Error object caught if the configured Reader could not read the data. - * If the remote request returns success: false, this parameter will be null. - */ + }; Ext.data.ScriptTagProxy.TRANS_ID = 1000; Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, { - /** - * @cfg {String} url The URL from which to request the data object. - */ - /** - * @cfg {Number} timeout (optional) The number of milliseconds to wait for a response. Defaults to 30 seconds. - */ + + timeout : 30000, - /** - * @cfg {String} callbackParam (Optional) The name of the parameter to pass to the server which tells - * the server the name of the callback function set up by the load call to process the returned data object. - * Defaults to "callback".

    The server-side processing must read this parameter value, and generate - * javascript output which calls this named function passing the data object as its only parameter. - */ + callbackParam : "callback", - /** - * @cfg {Boolean} nocache (optional) Defaults to true. Disable caching by adding a unique parameter - * name to the request. - */ + nocache : true, - /** - * HttpProxy implementation of DataProxy#doRequest - * @param {String} action - * @param {Ext.data.Record/Ext.data.Record[]} rs If action is read, rs will be null - * @param {Object} params An object containing properties which are to be used as HTTP parameters - * for the request to the remote server. - * @param {Ext.data.DataReader} reader The Reader object which converts the data - * object into a block of Ext.data.Records. - * @param {Function} callback The function into which to pass the block of Ext.data.Records. - * The function must be passed

      - *
    • The Record block object
    • - *
    • The "arg" argument from the load function
    • - *
    • A boolean success indicator
    • - *
    - * @param {Object} scope The scope (this reference) in which the callback function is executed. Defaults to the browser window. - * @param {Object} arg An optional argument which is passed to the callback as its second parameter. - */ + doRequest : function(action, rs, params, reader, callback, scope, arg) { var p = Ext.urlEncode(Ext.apply(params, this.extraParams)); @@ -36878,7 +22899,7 @@ Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, { this.trans = trans; }, - // @private createCallback + createCallback : function(action, rs, trans) { var self = this; return function(res) { @@ -36891,19 +22912,13 @@ Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, { } }; }, - /** - * Callback for read actions - * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] - * @param {Object} trans The request transaction object - * @param {Object} res The server response - * @protected - */ + onRead : function(action, trans, res) { var result; try { result = trans.reader.readRecords(res); }catch(e){ - // @deprecated: fire loadexception + this.fireEvent("loadexception", this, trans, res, e); this.fireEvent('exception', this, 'response', action, trans, res, e); @@ -36911,7 +22926,7 @@ Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, { return; } if (result.success === false) { - // @deprecated: fire old loadexception for backwards-compat. + this.fireEvent('loadexception', this, trans, res); this.fireEvent('exception', this, 'remote', action, trans, res, null); @@ -36920,17 +22935,11 @@ Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, { } trans.callback.call(trans.scope||window, result, trans.arg, result.success); }, - /** - * Callback for write actions - * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] - * @param {Object} trans The request transaction object - * @param {Object} res The server response - * @protected - */ + onWrite : function(action, trans, response, rs) { var reader = trans.reader; try { - // though we already have a response object here in STP, run through readResponse to catch any meta-data exceptions. + var res = reader.readResponse(action, response); } catch (e) { this.fireEvent('exception', this, 'response', action, trans, res, e); @@ -36946,21 +22955,19 @@ Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, { trans.callback.call(trans.scope||window, res.data, res, true); }, - // private + isLoading : function(){ return this.trans ? true : false; }, - /** - * Abort the current server request. - */ + abort : function(){ if(this.isLoading()){ this.destroyTrans(this.trans); } }, - // private + destroyTrans : function(trans, isLoaded){ this.head.removeChild(document.getElementById(trans.scriptId)); clearTimeout(trans.timeoutId); @@ -36970,7 +22977,7 @@ Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, { delete window[trans.cb]; }catch(e){} }else{ - // if hasn't been loaded, wait for load to remove it to prevent script error + window[trans.cb] = function(){ window[trans.cb] = undefined; try{ @@ -36980,12 +22987,12 @@ Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, { } }, - // private + handleFailure : function(trans){ this.trans = false; this.destroyTrans(trans, false); if (trans.action === Ext.data.Api.actions.read) { - // @deprecated firing loadexception + this.fireEvent("loadexception", this, null, trans.arg); } @@ -36996,52 +23003,27 @@ Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, { trans.callback.call(trans.scope||window, null, trans.arg, false); }, - // inherit docs + destroy: function(){ this.abort(); Ext.data.ScriptTagProxy.superclass.destroy.call(this); } -});/** - * @class Ext.data.HttpProxy - * @extends Ext.data.DataProxy - *

    An implementation of {@link Ext.data.DataProxy} that processes data requests within the same - * domain of the originating page.

    - *

    Note: this class cannot be used to retrieve data from a domain other - * than the domain from which the running page was served. For cross-domain requests, use a - * {@link Ext.data.ScriptTagProxy ScriptTagProxy}.

    - *

    Be aware that to enable the browser to parse an XML document, the server must set - * the Content-Type header in the HTTP response to "text/xml".

    - * @constructor - * @param {Object} conn - * An {@link Ext.data.Connection} object, or options parameter to {@link Ext.Ajax#request}. - *

    Note that if this HttpProxy is being used by a {@link Ext.data.Store Store}, then the - * Store's call to {@link #load} will override any specified callback and params - * options. In this case, use the Store's {@link Ext.data.Store#events events} to modify parameters, - * or react to loading events. The Store's {@link Ext.data.Store#baseParams baseParams} may also be - * used to pass parameters known at instantiation time.

    - *

    If an options parameter is passed, the singleton {@link Ext.Ajax} object will be used to make - * the request.

    - */ +}); Ext.data.HttpProxy = function(conn){ Ext.data.HttpProxy.superclass.constructor.call(this, conn); - /** - * The Connection object (Or options parameter to {@link Ext.Ajax#request}) which this HttpProxy - * uses to make requests to the server. Properties of this object may be changed dynamically to - * change the way data is requested. - * @property - */ + this.conn = conn; - // nullify the connection url. The url param has been copied to 'this' above. The connection - // url will be set during each execution of doRequest when buildUrl is called. This makes it easier for users to override the - // connection url during beforeaction events (ie: beforeload, beforewrite, etc). - // Url is always re-defined during doRequest. + + + + this.conn.url = null; this.useAjax = !conn || !conn.events; - // A hash containing active requests, keyed on action [Ext.data.Api.actions.create|read|update|destroy] + var actions = Ext.data.Api.actions; this.activeRequest = {}; for (var verb in actions) { @@ -37050,25 +23032,12 @@ Ext.data.HttpProxy = function(conn){ }; Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, { - /** - * Return the {@link Ext.data.Connection} object being used by this Proxy. - * @return {Connection} The Connection object. This object may be used to subscribe to events on - * a finer-grained basis than the DataProxy events. - */ + getConnection : function() { return this.useAjax ? Ext.Ajax : this.conn; }, - /** - * Used for overriding the url used for a single request. Designed to be called during a beforeaction event. Calling setUrl - * will override any urls set via the api configuration parameter. Set the optional parameter makePermanent to set the url for - * all subsequent requests. If not set to makePermanent, the next request will use the same url or api configuration defined - * in the initial proxy configuration. - * @param {String} url - * @param {Boolean} makePermanent (Optional) [false] - * - * (e.g.: beforeload, beforesave, etc). - */ + setUrl : function(url, makePermanent) { this.conn.url = url; if (makePermanent === true) { @@ -37078,24 +23047,7 @@ Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, { } }, - /** - * HttpProxy implementation of DataProxy#doRequest - * @param {String} action The crud action type (create, read, update, destroy) - * @param {Ext.data.Record/Ext.data.Record[]} rs If action is load, rs will be null - * @param {Object} params An object containing properties which are to be used as HTTP parameters - * for the request to the remote server. - * @param {Ext.data.DataReader} reader The Reader object which converts the data - * object into a block of Ext.data.Records. - * @param {Function} callback - *

    A function to be called after the request. - * The callback is passed the following arguments:

      - *
    • r : Ext.data.Record[] The block of Ext.data.Records.
    • - *
    • options: Options object from the action request
    • - *
    • success: Boolean success indicator

    - * @param {Object} scope The scope (this reference) in which the callback function is executed. Defaults to the browser window. - * @param {Object} arg An optional argument which is passed to the callback as its second parameter. - * @protected - */ + doRequest : function(action, rs, params, reader, cb, scope, arg) { var o = { method: (this.api[action]) ? this.api[action]['method'] : undefined, @@ -37109,8 +23061,8 @@ Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, { scope: this }; - // If possible, transmit data using jsonData || xmlData on Ext.Ajax.request (An installed DataWriter would have written it there.). - // Use std HTTP params otherwise. + + if (params.jsonData) { o.jsonData = params.jsonData; } else if (params.xmlData) { @@ -37118,45 +23070,39 @@ Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, { } else { o.params = params || {}; } - // Set the connection url. If this.conn.url is not null here, - // the user must have overridden the url during a beforewrite/beforeload event-handler. - // this.conn.url is nullified after each request. + + + this.conn.url = this.buildUrl(action, rs); if(this.useAjax){ Ext.applyIf(o, this.conn); - // If a currently running request is found for this action, abort it. + if (this.activeRequest[action]) { - //// - // Disabled aborting activeRequest while implementing REST. activeRequest[action] will have to become an array - // TODO ideas anyone? - // - //Ext.Ajax.abort(this.activeRequest[action]); + + + + + } this.activeRequest[action] = Ext.Ajax.request(o); }else{ this.conn.request(o); } - // request is sent, nullify the connection url in preparation for the next request + this.conn.url = null; }, - /** - * Returns a callback function for a request. Note a special case is made for the - * read action vs all the others. - * @param {String} action [create|update|delete|load] - * @param {Ext.data.Record[]} rs The Store-recordset being acted upon - * @private - */ + createCallback : function(action, rs) { return function(o, success, response) { this.activeRequest[action] = undefined; if (!success) { if (action === Ext.data.Api.actions.read) { - // @deprecated: fire loadexception for backwards compat. - // TODO remove + + this.fireEvent('loadexception', this, o, response); } this.fireEvent('exception', this, 'response', action, o, response); @@ -37171,23 +23117,14 @@ Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, { }; }, - /** - * Callback for read action - * @param {String} action Action name as per {@link Ext.data.Api.actions#read}. - * @param {Object} o The request transaction object - * @param {Object} res The server response - * @fires loadexception (deprecated) - * @fires exception - * @fires load - * @protected - */ + onRead : function(action, o, response) { var result; try { result = o.reader.read(response); }catch(e){ - // @deprecated: fire old loadexception for backwards-compat. - // TODO remove + + this.fireEvent('loadexception', this, o, response, e); this.fireEvent('exception', this, 'response', action, o, response, e); @@ -37195,31 +23132,23 @@ Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, { return; } if (result.success === false) { - // @deprecated: fire old loadexception for backwards-compat. - // TODO remove + + this.fireEvent('loadexception', this, o, response); - // Get DataReader read-back a response-object to pass along to exception event + var res = o.reader.readResponse(action, response); this.fireEvent('exception', this, 'remote', action, o, res, null); } else { this.fireEvent('load', this, o, o.request.arg); } - // TODO refactor onRead, onWrite to be more generalized now that we're dealing with Ext.data.Response instance - // the calls to request.callback(...) in each will have to be made identical. - // NOTE reader.readResponse does not currently return Ext.data.Response + + + o.request.callback.call(o.request.scope, result, o.request.arg, result.success); }, - /** - * Callback for write actions - * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] - * @param {Object} trans The request transaction object - * @param {Object} res The server response - * @fires exception - * @fires write - * @protected - */ + onWrite : function(action, o, response, rs) { var reader = o.reader; var res; @@ -37235,13 +23164,13 @@ Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, { } else { this.fireEvent('exception', this, 'remote', action, o, res, rs); } - // TODO refactor onRead, onWrite to be more generalized now that we're dealing with Ext.data.Response instance - // the calls to request.callback(...) in each will have to be made similar. - // NOTE reader.readResponse does not currently return Ext.data.Response + + + o.request.callback.call(o.request.scope, res.data, res, res.success); }, - // inherit docs + destroy: function(){ if(!this.useAjax){ this.conn.abort(); @@ -37255,16 +23184,9 @@ Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, { } Ext.data.HttpProxy.superclass.destroy.call(this); } -});/** - * @class Ext.data.MemoryProxy - * @extends Ext.data.DataProxy - * An implementation of Ext.data.DataProxy that simply passes the data specified in its constructor - * to the Reader when its load method is called. - * @constructor - * @param {Object} data The data object which the Reader uses to construct a block of Ext.data.Records. - */ +}); Ext.data.MemoryProxy = function(data){ - // Must define a dummy api with "read" action to satisfy DataProxy#doRequest and Ext.data.Api#prepare *before* calling super + var api = {}; api[Ext.data.Api.actions.read] = true; Ext.data.MemoryProxy.superclass.constructor.call(this, { @@ -37274,41 +23196,17 @@ Ext.data.MemoryProxy = function(data){ }; Ext.extend(Ext.data.MemoryProxy, Ext.data.DataProxy, { - /** - * @event loadexception - * Fires if an exception occurs in the Proxy during data loading. Note that this event is also relayed - * through {@link Ext.data.Store}, so you can listen for it directly on any Store instance. - * @param {Object} this - * @param {Object} arg The callback's arg object passed to the {@link #load} function - * @param {Object} null This parameter does not apply and will always be null for MemoryProxy - * @param {Error} e The JavaScript Error object caught if the configured Reader could not read the data - */ + - /** - * MemoryProxy implementation of DataProxy#doRequest - * @param {String} action - * @param {Ext.data.Record/Ext.data.Record[]} rs If action is load, rs will be null - * @param {Object} params An object containing properties which are to be used as HTTP parameters - * for the request to the remote server. - * @param {Ext.data.DataReader} reader The Reader object which converts the data - * object into a block of Ext.data.Records. - * @param {Function} callback The function into which to pass the block of Ext.data.Records. - * The function must be passed
      - *
    • The Record block object
    • - *
    • The "arg" argument from the load function
    • - *
    • A boolean success indicator
    • - *
    - * @param {Object} scope The scope (this reference) in which the callback function is executed. Defaults to the browser window. - * @param {Object} arg An optional argument which is passed to the callback as its second parameter. - */ + doRequest : function(action, rs, params, reader, callback, scope, arg) { - // No implementation for CRUD in MemoryProxy. Assumes all actions are 'load' + params = params || {}; var result; try { result = reader.readRecords(this.data); }catch(e){ - // @deprecated loadexception + this.fireEvent("loadexception", this, null, arg, e); this.fireEvent('exception', this, 'response', action, arg, null, e); @@ -37317,92 +23215,28 @@ Ext.extend(Ext.data.MemoryProxy, Ext.data.DataProxy, { } callback.call(scope, result, arg, true); } -});/** - * @class Ext.data.Types - *

    This is s static class containing the system-supplied data types which may be given to a {@link Ext.data.Field Field}.

    - *

    The properties in this class are used as type indicators in the {@link Ext.data.Field Field} class, so to - * test whether a Field is of a certain type, compare the {@link Ext.data.Field#type type} property against properties - * of this class.

    - *

    Developers may add their own application-specific data types to this class. Definition names must be UPPERCASE. - * each type definition must contain three properties:

    - *
      - *
    • convert : Function
      A function to convert raw data values from a data block into the data - * to be stored in the Field. The function is passed the collowing parameters: - *
        - *
      • v : Mixed
        The data value as read by the Reader, if undefined will use - * the configured {@link Ext.data.Field#defaultValue defaultValue}.
      • - *
      • rec : Mixed
        The data object containing the row as read by the Reader. - * Depending on the Reader type, this could be an Array ({@link Ext.data.ArrayReader ArrayReader}), an object - * ({@link Ext.data.JsonReader JsonReader}), or an XML element ({@link Ext.data.XMLReader XMLReader}).
      • - *
    • - *
    • sortType : Function
      A function to convert the stored data into comparable form, as defined by {@link Ext.data.SortTypes}.
    • - *
    • type : String
      A textual data type name.
    • - *
    - *

    For example, to create a VELatLong field (See the Microsoft Bing Mapping API) containing the latitude/longitude value of a datapoint on a map from a JsonReader data block - * which contained the properties lat and long, you would define a new data type like this:

    - *
    
    -// Add a new Field data type which stores a VELatLong object in the Record.
    -Ext.data.Types.VELATLONG = {
    -    convert: function(v, data) {
    -        return new VELatLong(data.lat, data.long);
    -    },
    -    sortType: function(v) {
    -        return v.Latitude;  // When sorting, order by latitude
    -    },
    -    type: 'VELatLong'
    -};
    -
    - *

    Then, when declaring a Record, use

    
    -var types = Ext.data.Types; // allow shorthand type access
    -UnitRecord = Ext.data.Record.create([
    -    { name: 'unitName', mapping: 'UnitName' },
    -    { name: 'curSpeed', mapping: 'CurSpeed', type: types.INT },
    -    { name: 'latitude', mapping: 'lat', type: types.FLOAT },
    -    { name: 'latitude', mapping: 'lat', type: types.FLOAT },
    -    { name: 'position', type: types.VELATLONG }
    -]);
    -
    - * @singleton - */ +}); Ext.data.Types = new function(){ var st = Ext.data.SortTypes; Ext.apply(this, { - /** - * @type Regexp - * @property stripRe - * A regular expression for stripping non-numeric characters from a numeric value. Defaults to /[\$,%]/g. - * This should be overridden for localization. - */ + stripRe: /[\$,%]/g, - /** - * @type Object. - * @property AUTO - * This data type means that no conversion is applied to the raw data before it is placed into a Record. - */ + AUTO: { convert: function(v){ return v; }, sortType: st.none, type: 'auto' }, - /** - * @type Object. - * @property STRING - * This data type means that the raw data is converted into a String before it is placed into a Record. - */ + STRING: { convert: function(v){ return (v === undefined || v === null) ? '' : String(v); }, sortType: st.asUCString, type: 'string' }, - /** - * @type Object. - * @property INT - * This data type means that the raw data is converted into an integer before it is placed into a Record. - *

    The synonym INTEGER is equivalent.

    - */ + INT: { convert: function(v){ return v !== undefined && v !== null && v !== '' ? @@ -37412,12 +23246,7 @@ Ext.data.Types = new function(){ type: 'int' }, - /** - * @type Object. - * @property FLOAT - * This data type means that the raw data is converted into a number before it is placed into a Record. - *

    The synonym NUMBER is equivalent.

    - */ + FLOAT: { convert: function(v){ return v !== undefined && v !== null && v !== '' ? @@ -37427,26 +23256,14 @@ Ext.data.Types = new function(){ type: 'float' }, - /** - * @type Object. - * @property BOOL - *

    This data type means that the raw data is converted into a boolean before it is placed into - * a Record. The string "true" and the number 1 are converted to boolean true.

    - *

    The synonym BOOLEAN is equivalent.

    - */ + BOOL: { convert: function(v){ return v === true || v === 'true' || v == 1; }, sortType: st.none, type: 'bool' }, - /** - * @type Object. - * @property DATE - * This data type means that the raw data is converted into a Date before it is placed into a Record. - * The date format is specified in the constructor of the {@link Ext.data.Field} to which this type is - * being applied. - */ + DATE: { convert: function(v){ var df = this.dateFormat; @@ -37474,101 +23291,47 @@ Ext.data.Types = new function(){ }); Ext.apply(this, { - /** - * @type Object. - * @property BOOLEAN - *

    This data type means that the raw data is converted into a boolean before it is placed into - * a Record. The string "true" and the number 1 are converted to boolean true.

    - *

    The synonym BOOL is equivalent.

    - */ + BOOLEAN: this.BOOL, - /** - * @type Object. - * @property INTEGER - * This data type means that the raw data is converted into an integer before it is placed into a Record. - *

    The synonym INT is equivalent.

    - */ + INTEGER: this.INT, - /** - * @type Object. - * @property NUMBER - * This data type means that the raw data is converted into a number before it is placed into a Record. - *

    The synonym FLOAT is equivalent.

    - */ + NUMBER: this.FLOAT }); -};/** - * @class Ext.data.JsonWriter - * @extends Ext.data.DataWriter - * DataWriter extension for writing an array or single {@link Ext.data.Record} object(s) in preparation for executing a remote CRUD action. - */ +}; Ext.data.JsonWriter = Ext.extend(Ext.data.DataWriter, { - /** - * @cfg {Boolean} encode true to {@link Ext.util.JSON#encode encode} the - * {@link Ext.data.DataWriter#toHash hashed data}. Defaults to true. When using - * {@link Ext.data.DirectProxy}, set this to false since Ext.Direct.JsonProvider will perform - * its own json-encoding. In addition, if you're using {@link Ext.data.HttpProxy}, setting to false - * will cause HttpProxy to transmit data using the jsonData configuration-params of {@link Ext.Ajax#request} - * instead of params. When using a {@link Ext.data.Store#restful} Store, some serverside frameworks are - * tuned to expect data through the jsonData mechanism. In those cases, one will want to set encode: false, as in - * let the lower-level connection object (eg: Ext.Ajax) do the encoding. - */ + encode : true, - /** - * @cfg {Boolean} encodeDelete False to send only the id to the server on delete, true to encode it in an object - * literal, eg:
    
    -{id: 1}
    - * 
    Defaults to false - */ + encodeDelete: false, constructor : function(config){ Ext.data.JsonWriter.superclass.constructor.call(this, config); }, - /** - * Final action of a write event. Apply the written data-object to params. - * @param {Object} http params-object to write-to. - * @param {Object} baseParams as defined by {@link Ext.data.Store#baseParams}. The baseParms must be encoded by the extending class, eg: {@link Ext.data.JsonWriter}, {@link Ext.data.XmlWriter}. - * @param {Object/Object[]} data Data-object representing compiled Store-recordset. - */ + render : function(params, baseParams, data) { if (this.encode === true) { - // Encode here now. + Ext.apply(params, baseParams); params[this.meta.root] = Ext.encode(data); } else { - // defer encoding for some other layer, probably in {@link Ext.Ajax#request}. Place everything into "jsonData" key. + var jdata = Ext.apply({}, baseParams); jdata[this.meta.root] = data; params.jsonData = jdata; } }, - /** - * Implements abstract Ext.data.DataWriter#createRecord - * @protected - * @param {Ext.data.Record} rec - * @return {Object} - */ + createRecord : function(rec) { return this.toHash(rec); }, - /** - * Implements abstract Ext.data.DataWriter#updateRecord - * @protected - * @param {Ext.data.Record} rec - * @return {Object} - */ + updateRecord : function(rec) { return this.toHash(rec); }, - /** - * Implements abstract Ext.data.DataWriter#destroyRecord - * @protected - * @param {Ext.data.Record} rec - * @return {Object} - */ + destroyRecord : function(rec){ if(this.encodeDelete){ var data = {}; @@ -37578,137 +23341,13 @@ Ext.data.JsonWriter = Ext.extend(Ext.data.DataWriter, { return rec.id; } } -});/** - * @class Ext.data.JsonReader - * @extends Ext.data.DataReader - *

    Data reader class to create an Array of {@link Ext.data.Record} objects - * from a JSON packet based on mappings in a provided {@link Ext.data.Record} - * constructor.

    - *

    Example code:

    - *
    
    -var myReader = new Ext.data.JsonReader({
    -    // metadata configuration options:
    -    {@link #idProperty}: 'id'
    -    {@link #root}: 'rows',
    -    {@link #totalProperty}: 'results',
    -    {@link Ext.data.DataReader#messageProperty}: "msg"  // The element within the response that provides a user-feedback message (optional)
    -
    -    // the fields config option will internally create an {@link Ext.data.Record}
    -    // constructor that provides mapping for reading the record data objects
    -    {@link Ext.data.DataReader#fields fields}: [
    -        // map Record's 'firstname' field to data object's key of same name
    -        {name: 'name'},
    -        // map Record's 'job' field to data object's 'occupation' key
    -        {name: 'job', mapping: 'occupation'}
    -    ]
     });
    -
    - *

    This would consume a JSON data object of the form:

    
    -{
    -    results: 2000, // Reader's configured {@link #totalProperty}
    -    rows: [        // Reader's configured {@link #root}
    -        // record data objects:
    -        { {@link #idProperty id}: 1, firstname: 'Bill', occupation: 'Gardener' },
    -        { {@link #idProperty id}: 2, firstname: 'Ben' , occupation: 'Horticulturalist' },
    -        ...
    -    ]
    -}
    -
    - *

    Automatic configuration using metaData

    - *

    It is possible to change a JsonReader's metadata at any time by including - * a metaData property in the JSON data object. If the JSON data - * object has a metaData property, a {@link Ext.data.Store Store} - * object using this Reader will reconfigure itself to use the newly provided - * field definition and fire its {@link Ext.data.Store#metachange metachange} - * event. The metachange event handler may interrogate the metaData - * property to perform any configuration required.

    - *

    Note that reconfiguring a Store potentially invalidates objects which may - * refer to Fields or Records which no longer exist.

    - *

    To use this facility you would create the JsonReader like this:

    
    -var myReader = new Ext.data.JsonReader();
    -
    - *

    The first data packet from the server would configure the reader by - * containing a metaData property and the data. For - * example, the JSON data object might take the form:

    
    -{
    -    metaData: {
    -        "{@link #idProperty}": "id",
    -        "{@link #root}": "rows",
    -        "{@link #totalProperty}": "results"
    -        "{@link #successProperty}": "success",
    -        "{@link Ext.data.DataReader#fields fields}": [
    -            {"name": "name"},
    -            {"name": "job", "mapping": "occupation"}
    -        ],
    -        // used by store to set its sortInfo
    -        "sortInfo":{
    -           "field": "name",
    -           "direction": "ASC"
    -        },
    -        // {@link Ext.PagingToolbar paging data} (if applicable)
    -        "start": 0,
    -        "limit": 2,
    -        // custom property
    -        "foo": "bar"
    -    },
    -    // Reader's configured {@link #successProperty}
    -    "success": true,
    -    // Reader's configured {@link #totalProperty}
    -    "results": 2000,
    -    // Reader's configured {@link #root}
    -    // (this data simulates 2 results {@link Ext.PagingToolbar per page})
    -    "rows": [ // *Note: this must be an Array
    -        { "id": 1, "name": "Bill", "occupation": "Gardener" },
    -        { "id": 2, "name":  "Ben", "occupation": "Horticulturalist" }
    -    ]
    -}
    - * 
    - *

    The metaData property in the JSON data object should contain:

    - *
      - *
    • any of the configuration options for this class
    • - *
    • a {@link Ext.data.Record#fields fields} property which - * the JsonReader will use as an argument to the - * {@link Ext.data.Record#create data Record create method} in order to - * configure the layout of the Records it will produce.
    • - *
    • a {@link Ext.data.Store#sortInfo sortInfo} property - * which the JsonReader will use to set the {@link Ext.data.Store}'s - * {@link Ext.data.Store#sortInfo sortInfo} property
    • - *
    • any custom properties needed
    • - *
    - * - * @constructor - * Create a new JsonReader - * @param {Object} meta Metadata configuration options. - * @param {Array/Object} recordType - *

    Either an Array of {@link Ext.data.Field Field} definition objects (which - * will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record} - * constructor created from {@link Ext.data.Record#create}.

    - */ Ext.data.JsonReader = function(meta, recordType){ meta = meta || {}; - /** - * @cfg {String} idProperty [id] Name of the property within a row object - * that contains a record identifier value. Defaults to id - */ - /** - * @cfg {String} successProperty [success] Name of the property from which to - * retrieve the success attribute. Defaults to success. See - * {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#exception exception} - * for additional information. - */ - /** - * @cfg {String} totalProperty [total] Name of the property from which to - * retrieve the total number of records in the dataset. This is only needed - * if the whole dataset is not passed in one go, but is being paged from - * the remote server. Defaults to total. - */ - /** - * @cfg {String} root [undefined] Required. The name of the property - * which contains the Array of row objects. Defaults to undefined. - * An exception will be thrown if the root property is undefined. The data - * packet value for this property should be an empty array to clear the data - * or show no data. - */ + + + + Ext.applyIf(meta, { idProperty: 'id', successProperty: 'success', @@ -37718,18 +23357,8 @@ Ext.data.JsonReader = function(meta, recordType){ Ext.data.JsonReader.superclass.constructor.call(this, meta, recordType || meta.fields); }; Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, { - /** - * This JsonReader's metadata as passed to the constructor, or as passed in - * the last data packet's metaData property. - * @type Mixed - * @property meta - */ - /** - * This method is only used by a DataProxy which has retrieved data from a remote server. - * @param {Object} response The XHR object which contains the JSON data in its responseText. - * @return {Object} data A data block which is used by an Ext.data.Store object as - * a cache of Ext.data.Records. - */ + + read : function(response){ var json = response.responseText; var o = Ext.decode(json); @@ -37739,16 +23368,8 @@ Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, { return this.readRecords(o); }, - /* - * TODO: refactor code between JsonReader#readRecords, #readResponse into 1 method. - * there's ugly duplication going on due to maintaining backwards compat. with 2.0. It's time to do this. - */ - /** - * Decode a JSON response from server. - * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] - * @param {Object} response The XHR object returned through an Ajax server request. - * @return {Response} A {@link Ext.data.Response Response} object containing the data response, and also status information. - */ + + readResponse : function(action, response) { var o = (response.responseText !== undefined) ? Ext.decode(response.responseText) : response; if(!o) { @@ -37766,7 +23387,7 @@ Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, { } } - // instantiate response object + var res = new Ext.data.Response({ action: action, success: this.getSuccess(o), @@ -37775,27 +23396,16 @@ Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, { raw: o }); - // blow up if no successProperty + if (Ext.isEmpty(res.success)) { throw new Ext.data.JsonReader.Error('successProperty-response', this.meta.successProperty); } return res; }, - /** - * Create a data block containing Ext.data.Records from a JSON object. - * @param {Object} o An object which contains an Array of row objects in the property specified - * in the config as 'root, and optionally a property, specified in the config as 'totalProperty' - * which contains the total size of the dataset. - * @return {Object} data A data block which is used by an Ext.data.Store object as - * a cache of Ext.data.Records. - */ + readRecords : function(o){ - /** - * After any data loads, the raw JSON data is available for further custom processing. If no data is - * loaded or there is a load exception this property will be undefined. - * @type Object - */ + this.jsonData = o; if(o.metaData){ this.onMetaChange(o.metaData); @@ -37817,15 +23427,15 @@ Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, { } } - // TODO return Ext.data.Response instance instead. @see #readResponse + return { success : success, - records : this.extractData(root, true), // <-- true to return [Ext.data.Record] + records : this.extractData(root, true), totalRecords : totalRecords }; }, - // private + buildExtractors : function() { if(this.ef){ return; @@ -37861,17 +23471,12 @@ Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, { this.ef = ef; }, - /** - * @ignore - * TODO This isn't used anywhere?? Don't we want to use this where possible instead of complex #createAccessor? - */ + simpleAccess : function(obj, subsc) { return obj[subsc]; }, - /** - * @ignore - */ + createAccessor : function(){ var re = /[\[\.]/; return function(expr) { @@ -37892,13 +23497,7 @@ Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, { }; }(), - /** - * type-casts a single row of raw-data from server - * @param {Object} data - * @param {Array} items - * @param {Integer} len - * @private - */ + extractValues : function(data, items, len) { var f, values = {}; for(var j = 0; j < len; j++){ @@ -37910,10 +23509,7 @@ Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, { } }); -/** - * @class Ext.data.JsonReader.Error - * Error class for JsonReader - */ + Ext.data.JsonReader.Error = Ext.extend(Ext.Error, { constructor : function(message, arg) { this.arg = arg; @@ -37930,53 +23526,12 @@ Ext.apply(Ext.data.JsonReader.Error.prototype, { 'root-empty': 'Data was expected to be returned by the server in the "root" property of the response. Please review your JsonReader configuration to ensure the "root" property matches that returned in the server-response. See JsonReader docs.' } }); -/** - * @class Ext.data.ArrayReader - * @extends Ext.data.JsonReader - *

    Data reader class to create an Array of {@link Ext.data.Record} objects from an Array. - * Each element of that Array represents a row of data fields. The - * fields are pulled into a Record object using as a subscript, the mapping property - * of the field definition if it exists, or the field's ordinal position in the definition.

    - *

    Example code:

    - *
    
    -var Employee = Ext.data.Record.create([
    -    {name: 'name', mapping: 1},         // "mapping" only needed if an "id" field is present which
    -    {name: 'occupation', mapping: 2}    // precludes using the ordinal position as the index.
    -]);
    -var myReader = new Ext.data.ArrayReader({
    -    {@link #idIndex}: 0
    -}, Employee);
    -
    - *

    This would consume an Array like this:

    - *
    
    -[ [1, 'Bill', 'Gardener'], [2, 'Ben', 'Horticulturalist'] ]
    - * 
    - * @constructor - * Create a new ArrayReader - * @param {Object} meta Metadata configuration options. - * @param {Array/Object} recordType - *

    Either an Array of {@link Ext.data.Field Field} definition objects (which - * will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record} - * constructor created from {@link Ext.data.Record#create}.

    - */ + Ext.data.ArrayReader = Ext.extend(Ext.data.JsonReader, { - /** - * @cfg {String} successProperty - * @hide - */ - /** - * @cfg {Number} id (optional) The subscript within row Array that provides an ID for the Record. - * Deprecated. Use {@link #idIndex} instead. - */ - /** - * @cfg {Number} idIndex (optional) The subscript within row Array that provides an ID for the Record. - */ - /** - * Create a data block containing Ext.data.Records from an Array. - * @param {Object} o An Array of row objects which represents the dataset. - * @return {Object} data A data block which is used by an Ext.data.Store object as - * a cache of Ext.data.Records. - */ + + + + readRecords : function(o){ this.arrayData = o; var s = this.meta, @@ -38026,48 +23581,9 @@ Ext.data.ArrayReader = Ext.extend(Ext.data.JsonReader, { totalRecords : totalRecords }; } -});/** - * @class Ext.data.ArrayStore - * @extends Ext.data.Store - *

    Formerly known as "SimpleStore".

    - *

    Small helper class to make creating {@link Ext.data.Store}s from Array data easier. - * An ArrayStore will be automatically configured with a {@link Ext.data.ArrayReader}.

    - *

    A store configuration would be something like:

    
    -var store = new Ext.data.ArrayStore({
    -    // store configs
    -    autoDestroy: true,
    -    storeId: 'myStore',
    -    // reader configs
    -    idIndex: 0,  
    -    fields: [
    -       'company',
    -       {name: 'price', type: 'float'},
    -       {name: 'change', type: 'float'},
    -       {name: 'pctChange', type: 'float'},
    -       {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
    -    ]
     });
    - * 

    - *

    This store is configured to consume a returned object of the form:

    
    -var myData = [
    -    ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
    -    ['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
    -    ['Boeing Co.',75.43,0.53,0.71,'9/1 12:00am'],
    -    ['Hewlett-Packard Co.',36.53,-0.03,-0.08,'9/1 12:00am'],
    -    ['Wal-Mart Stores, Inc.',45.45,0.73,1.63,'9/1 12:00am']
    -];
    - * 
    - * An object literal of this form could also be used as the {@link #data} config option.

    - *

    *Note: Although not listed here, this class accepts all of the configuration options of - * {@link Ext.data.ArrayReader ArrayReader}.

    - * @constructor - * @param {Object} config - * @xtype arraystore - */ Ext.data.ArrayStore = Ext.extend(Ext.data.Store, { - /** - * @cfg {Ext.data.DataReader} reader @hide - */ + constructor: function(config){ Ext.data.ArrayStore.superclass.constructor.call(this, Ext.apply(config, { reader: new Ext.data.ArrayReader(config) @@ -38087,157 +23603,40 @@ Ext.data.ArrayStore = Ext.extend(Ext.data.Store, { }); Ext.reg('arraystore', Ext.data.ArrayStore); -// backwards compat + Ext.data.SimpleStore = Ext.data.ArrayStore; -Ext.reg('simplestore', Ext.data.SimpleStore);/** - * @class Ext.data.JsonStore - * @extends Ext.data.Store - *

    Small helper class to make creating {@link Ext.data.Store}s from JSON data easier. - * A JsonStore will be automatically configured with a {@link Ext.data.JsonReader}.

    - *

    A store configuration would be something like:

    
    -var store = new Ext.data.JsonStore({
    -    // store configs
    -    autoDestroy: true,
    -    url: 'get-images.php',
    -    storeId: 'myStore',
    -    // reader configs
    -    root: 'images',
    -    idProperty: 'name',
    -    fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date'}]
    -});
    - * 

    - *

    This store is configured to consume a returned object of the form:

    
    -{
    -    images: [
    -        {name: 'Image one', url:'/GetImage.php?id=1', size:46.5, lastmod: new Date(2007, 10, 29)},
    -        {name: 'Image Two', url:'/GetImage.php?id=2', size:43.2, lastmod: new Date(2007, 10, 30)}
    -    ]
    -}
    - * 
    - * An object literal of this form could also be used as the {@link #data} config option.

    - *

    *Note: Although not listed here, this class accepts all of the configuration options of - * {@link Ext.data.JsonReader JsonReader}.

    - * @constructor - * @param {Object} config - * @xtype jsonstore - */ +Ext.reg('simplestore', Ext.data.SimpleStore); Ext.data.JsonStore = Ext.extend(Ext.data.Store, { - /** - * @cfg {Ext.data.DataReader} reader @hide - */ + constructor: function(config){ Ext.data.JsonStore.superclass.constructor.call(this, Ext.apply(config, { reader: new Ext.data.JsonReader(config) })); } }); -Ext.reg('jsonstore', Ext.data.JsonStore);/** - * @class Ext.data.XmlWriter - * @extends Ext.data.DataWriter - * DataWriter extension for writing an array or single {@link Ext.data.Record} object(s) in preparation for executing a remote CRUD action via XML. - * XmlWriter uses an instance of {@link Ext.XTemplate} for maximum flexibility in defining your own custom XML schema if the default schema is not appropriate for your needs. - * See the {@link #tpl} configuration-property. - */ +Ext.reg('jsonstore', Ext.data.JsonStore); Ext.data.XmlWriter = function(params) { Ext.data.XmlWriter.superclass.constructor.apply(this, arguments); - // compile the XTemplate for rendering XML documents. + this.tpl = (typeof(this.tpl) === 'string') ? new Ext.XTemplate(this.tpl).compile() : this.tpl.compile(); }; Ext.extend(Ext.data.XmlWriter, Ext.data.DataWriter, { - /** - * @cfg {String} documentRoot [xrequest] (Optional) The name of the XML document root-node. Note: - * this parameter is required
    only when
    sending extra {@link Ext.data.Store#baseParams baseParams} to the server - * during a write-request -- if no baseParams are set, the {@link Ext.data.XmlReader#record} meta-property can - * suffice as the XML document root-node for write-actions involving just a single record. For requests - * involving multiple records and NO baseParams, the {@link Ext.data.XmlWriter#root} property can - * act as the XML document root. - */ + documentRoot: 'xrequest', - /** - * @cfg {Boolean} forceDocumentRoot [false] Set to true to force XML documents having a root-node as defined - * by {@link #documentRoot}, even with no baseParams defined. - */ + forceDocumentRoot: false, - /** - * @cfg {String} root [records] The name of the containing element which will contain the nodes of an write-action involving multiple records. Each - * xml-record written to the server will be wrapped in an element named after {@link Ext.data.XmlReader#record} property. - * eg: -
    -<?xml version="1.0" encoding="UTF-8"?>
    -<user><first>Barney</first></user>
    -
    - * However, when multiple records are written in a batch-operation, these records must be wrapped in a containing - * Element. - * eg: -
    -<?xml version="1.0" encoding="UTF-8"?>
    -    <records>
    -        <first>Barney</first></user>
    -        <records><first>Barney</first></user>
    -    </records>
    -
    - * Defaults to records. Do not confuse the nature of this property with that of {@link #documentRoot} - */ + root: 'records', - /** - * @cfg {String} xmlVersion [1.0] The version written to header of xml documents. -
    <?xml version="1.0" encoding="ISO-8859-15"?>
    - */ + xmlVersion : '1.0', - /** - * @cfg {String} xmlEncoding [ISO-8859-15] The encoding written to header of xml documents. -
    <?xml version="1.0" encoding="ISO-8859-15"?>
    - */ + xmlEncoding: 'ISO-8859-15', - /** - * @cfg {String/Ext.XTemplate} tpl The XML template used to render {@link Ext.data.Api#actions write-actions} to your server. - *

    One can easily provide his/her own custom {@link Ext.XTemplate#constructor template-definition} if the default does not suffice.

    - *

    Defaults to:

    -
    -<?xml version="{version}" encoding="{encoding}"?>
    -    <tpl if="documentRoot"><{documentRoot}>
    -    <tpl for="baseParams">
    -        <tpl for=".">
    -            <{name}>{value}</{name}>
    -        </tpl>
    -    </tpl>
    -    <tpl if="records.length > 1"><{root}>',
    -    <tpl for="records">
    -        <{parent.record}>
    -        <tpl for=".">
    -            <{name}>{value}</{name}>
    -        </tpl>
    -        </{parent.record}>
    -    </tpl>
    -    <tpl if="records.length > 1"></{root}></tpl>
    -    <tpl if="documentRoot"></{documentRoot}></tpl>
    -
    - *

    Templates will be called with the following API

    - *
      - *
    • {String} version [1.0] The xml version.
    • - *
    • {String} encoding [ISO-8859-15] The xml encoding.
    • - *
    • {String/false} documentRoot The XML document root-node name or false if not required. See {@link #documentRoot} and {@link #forceDocumentRoot}.
    • - *
    • {String} record The meta-data parameter defined on your {@link Ext.data.XmlReader#record} configuration represents the name of the xml-tag containing each record.
    • - *
    • {String} root The meta-data parameter defined by {@link Ext.data.XmlWriter#root} configuration-parameter. Represents the name of the xml root-tag when sending multiple records to the server.
    • - *
    • {Array} records The records being sent to the server, ie: the subject of the write-action being performed. The records parameter will be always be an array, even when only a single record is being acted upon. - * Each item within the records array will contain an array of field objects having the following properties: - *
        - *
      • {String} name The field-name of the record as defined by your {@link Ext.data.Record#create Ext.data.Record definition}. The "mapping" property will be used, otherwise it will match the "name" property. Use this parameter to define the XML tag-name of the property.
      • - *
      • {Mixed} value The record value of the field enclosed within XML tags specified by name property above.
      • - *
    • - *
    • {Array} baseParams. The baseParams as defined upon {@link Ext.data.Store#baseParams}. Note that the baseParams have been converted into an array of [{name : "foo", value: "bar"}, ...] pairs in the same manner as the records parameter above. See {@link #documentRoot} and {@link #forceDocumentRoot}.
    • - *
    - */ - // Encoding the ? here in case it's being included by some kind of page that will parse it (eg. PHP) + + tpl: '<\u003fxml version="{version}" encoding="{encoding}"\u003f><{documentRoot}><{name}>{value}<{root}><{parent.record}><{name}>{value}', - /** - * XmlWriter implementation of the final stage of a write action. - * @param {Object} params Transport-proxy's (eg: {@link Ext.Ajax#request}) params-object to write-to. - * @param {Object} baseParams as defined by {@link Ext.data.Store#baseParams}. The baseParms must be encoded by the extending class, eg: {@link Ext.data.JsonWriter}, {@link Ext.data.XmlWriter}. - * @param {Object/Object[]} data Data-object representing the compiled Store-recordset. - */ + render : function(params, baseParams, data) { baseParams = this.toArray(baseParams); params.xmlData = this.tpl.applyTemplate({ @@ -38251,94 +23650,28 @@ Ext.extend(Ext.data.XmlWriter, Ext.data.DataWriter, { }); }, - /** - * createRecord - * @protected - * @param {Ext.data.Record} rec - * @return {Array} Array of name:value pairs for attributes of the {@link Ext.data.Record}. See {@link Ext.data.DataWriter#toHash}. - */ + createRecord : function(rec) { return this.toArray(this.toHash(rec)); }, - /** - * updateRecord - * @protected - * @param {Ext.data.Record} rec - * @return {Array} Array of {name:value} pairs for attributes of the {@link Ext.data.Record}. See {@link Ext.data.DataWriter#toHash}. - */ + updateRecord : function(rec) { return this.toArray(this.toHash(rec)); }, - /** - * destroyRecord - * @protected - * @param {Ext.data.Record} rec - * @return {Array} Array containing a attribute-object (name/value pair) representing the {@link Ext.data.DataReader#idProperty idProperty}. - */ + destroyRecord : function(rec) { var data = {}; data[this.meta.idProperty] = rec.id; return this.toArray(data); } }); -/** - * @class Ext.data.XmlReader - * @extends Ext.data.DataReader - *

    Data reader class to create an Array of {@link Ext.data.Record} objects from an XML document - * based on mappings in a provided {@link Ext.data.Record} constructor.

    - *

    Note: that in order for the browser to parse a returned XML document, the Content-Type - * header in the HTTP response must be set to "text/xml" or "application/xml".

    - *

    Example code:

    - *
    
    -var Employee = Ext.data.Record.create([
    -   {name: 'name', mapping: 'name'},     // "mapping" property not needed if it is the same as "name"
    -   {name: 'occupation'}                 // This field will use "occupation" as the mapping.
    -]);
    -var myReader = new Ext.data.XmlReader({
    -   totalProperty: "results", // The element which contains the total dataset size (optional)
    -   record: "row",           // The repeated element which contains row information
    -   idProperty: "id"         // The element within the row that provides an ID for the record (optional)
    -   messageProperty: "msg"   // The element within the response that provides a user-feedback message (optional)
    -}, Employee);
    -
    - *

    - * This would consume an XML file like this: - *

    
    -<?xml version="1.0" encoding="UTF-8"?>
    -<dataset>
    - <results>2</results>
    - <row>
    -   <id>1</id>
    -   <name>Bill</name>
    -   <occupation>Gardener</occupation>
    - </row>
    - <row>
    -   <id>2</id>
    -   <name>Ben</name>
    -   <occupation>Horticulturalist</occupation>
    - </row>
    -</dataset>
    -
    - * @cfg {String} totalProperty The DomQuery path from which to retrieve the total number of records - * in the dataset. This is only needed if the whole dataset is not passed in one go, but is being - * paged from the remote server. - * @cfg {String} record The DomQuery path to the repeated element which contains record information. - * @cfg {String} record The DomQuery path to the repeated element which contains record information. - * @cfg {String} successProperty The DomQuery path to the success attribute used by forms. - * @cfg {String} idPath The DomQuery path relative from the record element to the element that contains - * a record identifier value. - * @constructor - * Create a new XmlReader. - * @param {Object} meta Metadata configuration options - * @param {Object} recordType Either an Array of field definition objects as passed to - * {@link Ext.data.Record#create}, or a Record constructor object created using {@link Ext.data.Record#create}. - */ + Ext.data.XmlReader = function(meta, recordType){ meta = meta || {}; - // backwards compat, convert idPath or id / success + Ext.applyIf(meta, { idProperty: meta.idProperty || meta.idPath || meta.id, successProperty: meta.successProperty || meta.success @@ -38347,13 +23680,7 @@ Ext.data.XmlReader = function(meta, recordType){ Ext.data.XmlReader.superclass.constructor.call(this, meta, recordType || meta.fields); }; Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, { - /** - * This method is only used by a DataProxy which has retrieved data from a remote server. - * @param {Object} response The XHR object which contains the parsed XML document. The response is expected - * to contain a property called responseXML which refers to an XML document object. - * @return {Object} records A data block which is used by an {@link Ext.data.Store} as - * a cache of Ext.data.Records. - */ + read : function(response){ var doc = response.responseXML; if(!doc) { @@ -38362,17 +23689,9 @@ Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, { return this.readRecords(doc); }, - /** - * Create a data block containing Ext.data.Records from an XML document. - * @param {Object} doc A parsed XML document. - * @return {Object} records A data block which is used by an {@link Ext.data.Store} as - * a cache of Ext.data.Records. - */ + readRecords : function(doc){ - /** - * After any data loads/reads, the raw XML Document is available for further custom processing. - * @type XMLDocument - */ + this.xmlData = doc; var root = doc.documentElement || doc, @@ -38387,9 +23706,9 @@ Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, { success = this.getSuccess(root); } - var records = this.extractData(q.select(this.meta.record, root), true); // <-- true to return Ext.data.Record[] + var records = this.extractData(q.select(this.meta.record, root), true); - // TODO return Ext.data.Response instance. @see #readResponse + return { success : success, records : records, @@ -38397,17 +23716,12 @@ Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, { }; }, - /** - * Decode an XML response from server. - * @param {String} action [{@link Ext.data.Api#actions} create|read|update|destroy] - * @param {Object} response HTTP Response object from browser. - * @return {Ext.data.Response} An instance of {@link Ext.data.Response} - */ + readResponse : function(action, response) { var q = Ext.DomQuery, doc = response.responseXML; - // create general Response instance. + var res = new Ext.data.Response({ action: action, success : this.getSuccess(doc), @@ -38420,7 +23734,7 @@ Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, { throw new Ext.data.DataReader.Error('successProperty-response', this.meta.successProperty); } - // Create actions from a response having status 200 must return pk + if (action === Ext.data.Api.actions.create) { var def = Ext.isDefined(res.data); if (def && Ext.isEmpty(res.data)) { @@ -38437,11 +23751,7 @@ Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, { return true; }, - /** - * build response-data extractor functions. - * @private - * @ignore - */ + buildExtractors : function() { if(this.ef){ return; @@ -38482,13 +23792,7 @@ Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, { this.ef = ef; }, - /** - * Creates a function to return some particular key of data from a response. - * @param {String} key - * @return {Function} - * @private - * @ignore - */ + createAccessor : function(){ var q = Ext.DomQuery; return function(key) { @@ -38514,14 +23818,7 @@ Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, { }; }(), - /** - * extracts values and type-casts a row of data from server, extracted by #extractData - * @param {Hash} data - * @param {Ext.data.Field[]} items - * @param {Number} len - * @private - * @ignore - */ + extractValues : function(data, items, len) { var f, values = {}; for(var j = 0; j < len; j++){ @@ -38531,101 +23828,26 @@ Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, { } return values; } -});/** - * @class Ext.data.XmlStore - * @extends Ext.data.Store - *

    Small helper class to make creating {@link Ext.data.Store}s from XML data easier. - * A XmlStore will be automatically configured with a {@link Ext.data.XmlReader}.

    - *

    A store configuration would be something like:

    
    -var store = new Ext.data.XmlStore({
    -    // store configs
    -    autoDestroy: true,
    -    storeId: 'myStore',
    -    url: 'sheldon.xml', // automatically configures a HttpProxy
    -    // reader configs
    -    record: 'Item', // records will have an "Item" tag
    -    idPath: 'ASIN',
    -    totalRecords: '@TotalResults'
    -    fields: [
    -        // set up the fields mapping into the xml doc
    -        // The first needs mapping, the others are very basic
    -        {name: 'Author', mapping: 'ItemAttributes > Author'},
    -        'Title', 'Manufacturer', 'ProductGroup'
    -    ]
     });
    - * 

    - *

    This store is configured to consume a returned object of the form:

    
    -<?xml version="1.0" encoding="UTF-8"?>
    -<ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2009-05-15">
    -    <Items>
    -        <Request>
    -            <IsValid>True</IsValid>
    -            <ItemSearchRequest>
    -                <Author>Sidney Sheldon</Author>
    -                <SearchIndex>Books</SearchIndex>
    -            </ItemSearchRequest>
    -        </Request>
    -        <TotalResults>203</TotalResults>
    -        <TotalPages>21</TotalPages>
    -        <Item>
    -            <ASIN>0446355453</ASIN>
    -            <DetailPageURL>
    -                http://www.amazon.com/
    -            </DetailPageURL>
    -            <ItemAttributes>
    -                <Author>Sidney Sheldon</Author>
    -                <Manufacturer>Warner Books</Manufacturer>
    -                <ProductGroup>Book</ProductGroup>
    -                <Title>Master of the Game</Title>
    -            </ItemAttributes>
    -        </Item>
    -    </Items>
    -</ItemSearchResponse>
    - * 
    - * An object literal of this form could also be used as the {@link #data} config option.

    - *

    Note: Although not listed here, this class accepts all of the configuration options of - * {@link Ext.data.XmlReader XmlReader}.

    - * @constructor - * @param {Object} config - * @xtype xmlstore - */ Ext.data.XmlStore = Ext.extend(Ext.data.Store, { - /** - * @cfg {Ext.data.DataReader} reader @hide - */ + constructor: function(config){ Ext.data.XmlStore.superclass.constructor.call(this, Ext.apply(config, { reader: new Ext.data.XmlReader(config) })); } }); -Ext.reg('xmlstore', Ext.data.XmlStore);/** - * @class Ext.data.GroupingStore - * @extends Ext.data.Store - * A specialized store implementation that provides for grouping records by one of the available fields. This - * is usually used in conjunction with an {@link Ext.grid.GroupingView} to provide the data model for - * a grouped GridPanel. - * - * Internally, GroupingStore is simply a normal Store with multi sorting enabled from the start. The grouping field - * and direction are always injected as the first sorter pair. GroupingView picks up on the configured groupField and - * builds grid rows appropriately. - * - * @constructor - * Creates a new GroupingStore. - * @param {Object} config A config object containing the objects needed for the Store to access data, - * and read the data into Records. - * @xtype groupingstore - */ +Ext.reg('xmlstore', Ext.data.XmlStore); Ext.data.GroupingStore = Ext.extend(Ext.data.Store, { - //inherit docs + constructor: function(config) { config = config || {}; - //We do some preprocessing here to massage the grouping + sorting options into a single - //multi sort array. If grouping and sorting options are both presented to the constructor, - //the sorters array consists of the grouping sorter object followed by the sorting sorter object - //see Ext.data.Store's sorting functions for details about how multi sorting works + + + + this.hasMultiSort = true; this.multiSortInfo = this.multiSortInfo || {sorters: []}; @@ -38634,7 +23856,7 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, { sortInfo = config.sortInfo || this.sortInfo, groupDir = config.groupDir || this.groupDir; - //add the grouping sorter object first + if(groupField){ sorters.push({ field : groupField, @@ -38642,7 +23864,7 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, { }); } - //add the sorting sorter object if it is present + if (sortInfo) { sorters.push(sortInfo); } @@ -38650,41 +23872,22 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, { Ext.data.GroupingStore.superclass.constructor.call(this, config); this.addEvents( - /** - * @event groupchange - * Fired whenever a call to store.groupBy successfully changes the grouping on the store - * @param {Ext.data.GroupingStore} store The grouping store - * @param {String} groupField The field that the store is now grouped by - */ + 'groupchange' ); this.applyGroupField(); }, - /** - * @cfg {String} groupField - * The field name by which to sort the store's data (defaults to ''). - */ - /** - * @cfg {Boolean} remoteGroup - * True if the grouping should apply on the server side, false if it is local only (defaults to false). If the - * grouping is local, it can be applied immediately to the data. If it is remote, then it will simply act as a - * helper, automatically sending the grouping field name as the 'groupBy' param with each XHR call. - */ + + remoteGroup : false, - /** - * @cfg {Boolean} groupOnSort - * True to sort the data on the grouping field when a grouping operation occurs, false to sort based on the - * existing sort info (defaults to false). - */ + groupOnSort:false, groupDir : 'ASC', - /** - * Clears any existing grouping and refreshes the data using the default sort. - */ + clearGrouping : function(){ this.groupField = false; @@ -38706,21 +23909,16 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, { } }, - /** - * Groups the data by the specified field. - * @param {String} field The field name by which to sort the store's data - * @param {Boolean} forceRegroup (optional) True to force the group to be refreshed even if the field passed - * in is the same as the current grouping field, false to skip grouping on the same field (defaults to false) - */ + groupBy : function(field, forceRegroup, direction) { direction = direction ? (String(direction).toUpperCase() == 'DESC' ? 'DESC' : 'ASC') : this.groupDir; if (this.groupField == field && this.groupDir == direction && !forceRegroup) { - return; // already grouped by this field + return; } - //check the contents of the first sorter. If the field matches the CURRENT groupField (before it is set to the new one), - //remove the sorter as it is actually the grouper. The new grouper is added back in by this.sort + + sorters = this.multiSortInfo.sorters; if (sorters.length > 0 && sorters[0].field == this.groupField) { sorters.shift(); @@ -38749,8 +23947,8 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, { } }, - //GroupingStore always uses multisorting so we intercept calls to sort here to make sure that our grouping sorter object - //is always injected first. + + sort : function(fieldName, dir) { if (this.remoteSort) { return Ext.data.GroupingStore.superclass.sort.call(this, fieldName, dir); @@ -38758,16 +23956,16 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, { var sorters = []; - //cater for any existing valid arguments to this.sort, massage them into an array of sorter objects + if (Ext.isArray(arguments[0])) { sorters = arguments[0]; } else if (fieldName == undefined) { - //we preserve the existing sortInfo here because this.sort is called after - //clearGrouping and there may be existing sorting - sorters = [this.sortInfo]; + + + sorters = this.sortInfo ? [this.sortInfo] : []; } else { - //TODO: this is lifted straight from Ext.data.Store's singleSort function. It should instead be - //refactored into a common method if possible + + var field = this.fields.get(fieldName); if (!field) return false; @@ -38776,7 +23974,7 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, { sortToggle = this.sortToggle ? this.sortToggle[name] : null; if (!dir) { - if (sortInfo && sortInfo.field == name) { // toggle sort dir + if (sortInfo && sortInfo.field == name) { dir = (this.sortToggle[name] || 'ASC').toggle('ASC', 'DESC'); } else { dir = field.sortDir; @@ -38789,7 +23987,7 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, { sorters = [this.sortInfo]; } - //add the grouping sorter object as the first multisort sorter + if (this.groupField) { sorters.unshift({direction: this.groupDir, field: this.groupField}); } @@ -38797,11 +23995,7 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, { return this.multiSort.call(this, sorters, dir); }, - /** - * @private - * Saves the current grouping field and direction to this.baseParams and this.lastOptions.params - * if we're using remote grouping. Does not actually perform any grouping - just stores values - */ + applyGroupField: function(){ if (this.remoteGroup) { if(!this.baseParams){ @@ -38817,17 +24011,13 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, { if (lo && lo.params) { lo.params.groupDir = this.groupDir; - //this is deleted because of a bug reported at http://www.extjs.com/forum/showthread.php?t=82907 + delete lo.params.groupBy; } } }, - /** - * @private - * TODO: This function is apparently never invoked anywhere in the framework. It has no documentation - * and should be considered for deletion - */ + applyGrouping : function(alwaysFireChange){ if(this.groupField !== false){ this.groupBy(this.groupField, true, this.groupDir); @@ -38840,22 +24030,14 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, { } }, - /** - * @private - * Returns the grouping field that should be used. If groupOnSort is used this will be sortInfo's field, - * otherwise it will be this.groupField - * @return {String} The group field - */ + getGroupState : function(){ return this.groupOnSort && this.groupField !== false ? (this.sortInfo ? this.sortInfo.field : undefined) : this.groupField; } }); Ext.reg('groupingstore', Ext.data.GroupingStore); -/** - * @class Ext.data.DirectProxy - * @extends Ext.data.DataProxy - */ + Ext.data.DirectProxy = function(config){ Ext.apply(this, config); if(typeof this.paramOrder == 'string'){ @@ -38865,62 +24047,26 @@ Ext.data.DirectProxy = function(config){ }; Ext.extend(Ext.data.DirectProxy, Ext.data.DataProxy, { - /** - * @cfg {Array/String} paramOrder Defaults to undefined. A list of params to be executed - * server side. Specify the params in the order in which they must be executed on the server-side - * as either (1) an Array of String values, or (2) a String of params delimited by either whitespace, - * comma, or pipe. For example, - * any of the following would be acceptable:
    
    -paramOrder: ['param1','param2','param3']
    -paramOrder: 'param1 param2 param3'
    -paramOrder: 'param1,param2,param3'
    -paramOrder: 'param1|param2|param'
    -     
    - */ + paramOrder: undefined, - /** - * @cfg {Boolean} paramsAsHash - * Send parameters as a collection of named arguments (defaults to true). Providing a - * {@link #paramOrder} nullifies this configuration. - */ + paramsAsHash: true, - /** - * @cfg {Function} directFn - * Function to call when executing a request. directFn is a simple alternative to defining the api configuration-parameter - * for Store's which will not implement a full CRUD api. - */ + directFn : undefined, - /** - * DirectProxy implementation of {@link Ext.data.DataProxy#doRequest} - * @param {String} action The crud action type (create, read, update, destroy) - * @param {Ext.data.Record/Ext.data.Record[]} rs If action is load, rs will be null - * @param {Object} params An object containing properties which are to be used as HTTP parameters - * for the request to the remote server. - * @param {Ext.data.DataReader} reader The Reader object which converts the data - * object into a block of Ext.data.Records. - * @param {Function} callback - *

    A function to be called after the request. - * The callback is passed the following arguments:

      - *
    • r : Ext.data.Record[] The block of Ext.data.Records.
    • - *
    • options: Options object from the action request
    • - *
    • success: Boolean success indicator

    - * @param {Object} scope The scope (this reference) in which the callback function is executed. Defaults to the browser window. - * @param {Object} arg An optional argument which is passed to the callback as its second parameter. - * @protected - */ + doRequest : function(action, rs, params, reader, callback, scope, options) { var args = [], directFn = this.api[action] || this.directFn; switch (action) { case Ext.data.Api.actions.create: - args.push(params.jsonData); // <-- create(Hash) + args.push(params.jsonData); break; case Ext.data.Api.actions.read: - // If the method has no parameters, ignore the paramOrder/paramsAsHash. + if(directFn.directCfg.method.len > 0){ if(this.paramOrder){ for(var i = 0, len = this.paramOrder.length; i < len; i++){ @@ -38932,10 +24078,10 @@ paramOrder: 'param1|param2|param' } break; case Ext.data.Api.actions.update: - args.push(params.jsonData); // <-- update(Hash/Hash[]) + args.push(params.jsonData); break; case Ext.data.Api.actions.destroy: - args.push(params.jsonData); // <-- destroy(Int/Int[]) + args.push(params.jsonData); break; } @@ -38953,12 +24099,12 @@ paramOrder: 'param1|param2|param' directFn.apply(window, args); }, - // private + createCallback : function(action, rs, trans) { var me = this; return function(result, res) { if (!res.status) { - // @deprecated fire loadexception + if (action === Ext.data.Api.actions.read) { me.fireEvent("loadexception", me, trans, res, null); } @@ -38974,21 +24120,14 @@ paramOrder: 'param1|param2|param' }; }, - /** - * Callback for read actions - * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] - * @param {Object} trans The request transaction object - * @param {Object} result Data object picked out of the server-response. - * @param {Object} res The server response - * @protected - */ + onRead : function(action, trans, result, res) { var records; try { records = trans.reader.readRecords(result); } catch (ex) { - // @deprecated: Fire old loadexception for backwards-compat. + this.fireEvent("loadexception", this, trans, res, ex); this.fireEvent('exception', this, 'response', action, trans, res, ex); @@ -38998,15 +24137,7 @@ paramOrder: 'param1|param2|param' this.fireEvent("load", this, res, trans.request.arg); trans.request.callback.call(trans.request.scope, records, trans.request.arg, true); }, - /** - * Callback for write actions - * @param {String} action [{@link Ext.data.Api#actions create|read|update|destroy}] - * @param {Object} trans The request transaction object - * @param {Object} result Data object picked out of the server-response. - * @param {Object} res The server response - * @param {Ext.data.Record/[Ext.data.Record]} rs The Store resultset associated with the action. - * @protected - */ + onWrite : function(action, trans, result, res, rs) { var data = trans.reader.extractData(trans.reader.getRoot(result), false); var success = trans.reader.getSuccess(result); @@ -39019,44 +24150,10 @@ paramOrder: 'param1|param2|param' trans.request.callback.call(trans.request.scope, data, res, success); } }); -/** - * @class Ext.data.DirectStore - * @extends Ext.data.Store - *

    Small helper class to create an {@link Ext.data.Store} configured with an - * {@link Ext.data.DirectProxy} and {@link Ext.data.JsonReader} to make interacting - * with an {@link Ext.Direct} Server-side {@link Ext.direct.Provider Provider} easier. - * To create a different proxy/reader combination create a basic {@link Ext.data.Store} - * configured as needed.

    - * - *

    *Note: Although they are not listed, this class inherits all of the config options of:

    - *
      - *
    • {@link Ext.data.Store Store}
    • - *
        - * - *
      - *
    • {@link Ext.data.JsonReader JsonReader}
    • - *
        - *
      • {@link Ext.data.JsonReader#root root}
      • - *
      • {@link Ext.data.JsonReader#idProperty idProperty}
      • - *
      • {@link Ext.data.JsonReader#totalProperty totalProperty}
      • - *
      - * - *
    • {@link Ext.data.DirectProxy DirectProxy}
    • - *
        - *
      • {@link Ext.data.DirectProxy#directFn directFn}
      • - *
      • {@link Ext.data.DirectProxy#paramOrder paramOrder}
      • - *
      • {@link Ext.data.DirectProxy#paramsAsHash paramsAsHash}
      • - *
      - *
    - * - * @xtype directstore - * - * @constructor - * @param {Object} config - */ + Ext.data.DirectStore = Ext.extend(Ext.data.Store, { constructor : function(config){ - // each transaction upon a singe record will generate a distinct Direct transaction since Direct queues them into one Ajax request. + var c = Ext.apply({}, { batchTransactions: false }, config); @@ -39067,86 +24164,11 @@ Ext.data.DirectStore = Ext.extend(Ext.data.Store, { } }); Ext.reg('directstore', Ext.data.DirectStore); -/** - * @class Ext.Direct - * @extends Ext.util.Observable - *

    Overview

    - * - *

    Ext.Direct aims to streamline communication between the client and server - * by providing a single interface that reduces the amount of common code - * typically required to validate data and handle returned data packets - * (reading data, error conditions, etc).

    - * - *

    The Ext.direct namespace includes several classes for a closer integration - * with the server-side. The Ext.data namespace also includes classes for working - * with Ext.data.Stores which are backed by data from an Ext.Direct method.

    - * - *

    Specification

    - * - *

    For additional information consult the - * Ext.Direct Specification.

    - * - *

    Providers

    - * - *

    Ext.Direct uses a provider architecture, where one or more providers are - * used to transport data to and from the server. There are several providers - * that exist in the core at the moment:

      - * - *
    • {@link Ext.direct.JsonProvider JsonProvider} for simple JSON operations
    • - *
    • {@link Ext.direct.PollingProvider PollingProvider} for repeated requests
    • - *
    • {@link Ext.direct.RemotingProvider RemotingProvider} exposes server side - * on the client.
    • - *
    - * - *

    A provider does not need to be invoked directly, providers are added via - * {@link Ext.Direct}.{@link Ext.Direct#add add}.

    - * - *

    Router

    - * - *

    Ext.Direct utilizes a "router" on the server to direct requests from the client - * to the appropriate server-side method. Because the Ext.Direct API is completely - * platform-agnostic, you could completely swap out a Java based server solution - * and replace it with one that uses C# without changing the client side JavaScript - * at all.

    - * - *

    Server side events

    - * - *

    Custom events from the server may be handled by the client by adding - * listeners, for example:

    - *
    
    -{"type":"event","name":"message","data":"Successfully polled at: 11:19:30 am"}
    -
    -// add a handler for a 'message' event sent by the server
    -Ext.Direct.on('message', function(e){
    -    out.append(String.format('<p><i>{0}</i></p>', e.data));
    -            out.el.scrollTo('t', 100000, true);
    -});
    - * 
    - * @singleton - */ + Ext.Direct = Ext.extend(Ext.util.Observable, { - /** - * Each event type implements a getData() method. The default event types are: - *
      - *
    • event : Ext.Direct.Event
    • - *
    • exception : Ext.Direct.ExceptionEvent
    • - *
    • rpc : Ext.Direct.RemotingEvent
    • - *
    - * @property eventTypes - * @type Object - */ + - /** - * Four types of possible exceptions which can occur: - *
      - *
    • Ext.Direct.exceptions.TRANSPORT : 'xhr'
    • - *
    • Ext.Direct.exceptions.PARSE : 'parse'
    • - *
    • Ext.Direct.exceptions.LOGIN : 'login'
    • - *
    • Ext.Direct.exceptions.SERVER : 'exception'
    • - *
    - * @property exceptions - * @type Object - */ + exceptions: { TRANSPORT: 'xhr', PARSE: 'parse', @@ -39154,65 +24176,19 @@ Ext.Direct = Ext.extend(Ext.util.Observable, { SERVER: 'exception' }, - // private + constructor: function(){ this.addEvents( - /** - * @event event - * Fires after an event. - * @param {event} e The {@link Ext.Direct#eventTypes Ext.Direct.Event type} that occurred. - * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}. - */ + 'event', - /** - * @event exception - * Fires after an event exception. - * @param {event} e The {@link Ext.Direct#eventTypes Ext.Direct.Event type} that occurred. - */ + 'exception' ); this.transactions = {}; this.providers = {}; }, - /** - * Adds an Ext.Direct Provider and creates the proxy or stub methods to execute server-side methods. - * If the provider is not already connected, it will auto-connect. - *
    
    -var pollProv = new Ext.direct.PollingProvider({
    -    url: 'php/poll2.php'
    -});
    -
    -Ext.Direct.addProvider(
    -    {
    -        "type":"remoting",       // create a {@link Ext.direct.RemotingProvider}
    -        "url":"php\/router.php", // url to connect to the Ext.Direct server-side router.
    -        "actions":{              // each property within the actions object represents a Class
    -            "TestAction":[       // array of methods within each server side Class
    -            {
    -                "name":"doEcho", // name of method
    -                "len":1
    -            },{
    -                "name":"multiply",
    -                "len":1
    -            },{
    -                "name":"doForm",
    -                "formHandler":true, // handle form on server with Ext.Direct.Transaction
    -                "len":1
    -            }]
    -        },
    -        "namespace":"myApplication",// namespace to create the Remoting Provider in
    -    },{
    -        type: 'polling', // create a {@link Ext.direct.PollingProvider}
    -        url:  'php/poll.php'
    -    },
    -    pollProv // reference to previously created instance
    -);
    -     * 
    - * @param {Object/Array} provider Accepts either an Array of Provider descriptions (an instance - * or config object for a Provider) or any number of Provider descriptions as arguments. Each - * Provider description instructs Ext.Direct how to create client-side stub methods. - */ + addProvider : function(provider){ var a = arguments; if(a.length > 1){ @@ -39222,7 +24198,7 @@ Ext.Direct.addProvider( return; } - // if provider has not already been instantiated + if(!provider.events){ provider = new Ext.Direct.PROVIDERS[provider.type](provider); } @@ -39240,12 +24216,7 @@ Ext.Direct.addProvider( return provider; }, - /** - * Retrieve a {@link Ext.direct.Provider provider} by the - * {@link Ext.direct.Provider#id id} specified when the provider is - * {@link #addProvider added}. - * @param {String} id Unique identifier assigned to the provider when calling {@link #addProvider} - */ + getProvider : function(id){ return this.providers[id]; }, @@ -39291,17 +24262,11 @@ Ext.Direct.addProvider( return new Ext.Direct.eventTypes[response.type](Ext.apply(response, extraProps)); } }); -// overwrite impl. with static instance + Ext.Direct = new Ext.Direct(); Ext.Direct.TID = 1; -Ext.Direct.PROVIDERS = {};/** - * @class Ext.Direct.Transaction - * @extends Object - *

    Supporting Class for Ext.Direct (not intended to be used directly).

    - * @constructor - * @param {Object} config - */ +Ext.Direct.PROVIDERS = {}; Ext.Direct.Transaction = function(config){ Ext.apply(this, config); this.tid = ++Ext.Direct.TID; @@ -39348,114 +24313,43 @@ Ext.Direct.eventTypes = { 'event': Ext.Direct.Event, 'exception': Ext.Direct.ExceptionEvent }; -/** - * @class Ext.direct.Provider - * @extends Ext.util.Observable - *

    Ext.direct.Provider is an abstract class meant to be extended.

    - * - *

    For example ExtJs implements the following subclasses:

    - *
    
    -Provider
    -|
    -+---{@link Ext.direct.JsonProvider JsonProvider} 
    -    |
    -    +---{@link Ext.direct.PollingProvider PollingProvider}   
    -    |
    -    +---{@link Ext.direct.RemotingProvider RemotingProvider}   
    - * 
    - * @abstract - */ + Ext.direct.Provider = Ext.extend(Ext.util.Observable, { - /** - * @cfg {String} id - * The unique id of the provider (defaults to an {@link Ext#id auto-assigned id}). - * You should assign an id if you need to be able to access the provider later and you do - * not have an object reference available, for example: - *
    
    -Ext.Direct.addProvider(
    -    {
    -        type: 'polling',
    -        url:  'php/poll.php',
    -        id:   'poll-provider'
    -    }
    -);
    -     
    -var p = {@link Ext.Direct Ext.Direct}.{@link Ext.Direct#getProvider getProvider}('poll-provider');
    -p.disconnect();
    -     * 
    - */ + + - /** - * @cfg {Number} priority - * Priority of the request. Lower is higher priority, 0 means "duplex" (always on). - * All Providers default to 1 except for PollingProvider which defaults to 3. - */ priority: 1, - /** - * @cfg {String} type - * Required, undefined by default. The type of provider specified - * to {@link Ext.Direct Ext.Direct}.{@link Ext.Direct#addProvider addProvider} to create a - * new Provider. Acceptable values by default are:
      - *
    • polling : {@link Ext.direct.PollingProvider PollingProvider}
    • - *
    • remoting : {@link Ext.direct.RemotingProvider RemotingProvider}
    • - *
    - */ + - // private + constructor : function(config){ Ext.apply(this, config); this.addEvents( - /** - * @event connect - * Fires when the Provider connects to the server-side - * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}. - */ + 'connect', - /** - * @event disconnect - * Fires when the Provider disconnects from the server-side - * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}. - */ + 'disconnect', - /** - * @event data - * Fires when the Provider receives data from the server-side - * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}. - * @param {event} e The {@link Ext.Direct#eventTypes Ext.Direct.Event type} that occurred. - */ + 'data', - /** - * @event exception - * Fires when the Provider receives an exception from the server-side - */ + 'exception' ); Ext.direct.Provider.superclass.constructor.call(this, config); }, - /** - * Returns whether or not the server-side is currently connected. - * Abstract method for subclasses to implement. - */ + isConnected: function(){ return false; }, - /** - * Abstract methods for subclasses to implement. - */ + connect: Ext.emptyFn, - /** - * Abstract methods for subclasses to implement. - */ + disconnect: Ext.emptyFn }); -/** - * @class Ext.direct.JsonProvider - * @extends Ext.direct.Provider - */ + Ext.direct.JsonProvider = Ext.extend(Ext.direct.Provider, { parseResponse: function(xhr){ if(!Ext.isEmpty(xhr.responseText)){ @@ -39490,92 +24384,36 @@ Ext.direct.JsonProvider = Ext.extend(Ext.direct.Provider, { } return events; } -});/** - * @class Ext.direct.PollingProvider - * @extends Ext.direct.JsonProvider - * - *

    Provides for repetitive polling of the server at distinct {@link #interval intervals}. - * The initial request for data originates from the client, and then is responded to by the - * server.

    - * - *

    All configurations for the PollingProvider should be generated by the server-side - * API portion of the Ext.Direct stack.

    - * - *

    An instance of PollingProvider may be created directly via the new keyword or by simply - * specifying type = 'polling'. For example:

    - *
    
    -var pollA = new Ext.direct.PollingProvider({
    -    type:'polling',
    -    url: 'php/pollA.php',
     });
    -Ext.Direct.addProvider(pollA);
    -pollA.disconnect();
    -
    -Ext.Direct.addProvider(
    -    {
    -        type:'polling',
    -        url: 'php/pollB.php',
    -        id: 'pollB-provider'
    -    }
    -);
    -var pollB = Ext.Direct.getProvider('pollB-provider');
    - * 
    - */ Ext.direct.PollingProvider = Ext.extend(Ext.direct.JsonProvider, { - /** - * @cfg {Number} priority - * Priority of the request (defaults to 3). See {@link Ext.direct.Provider#priority}. - */ - // override default priority + + priority: 3, - /** - * @cfg {Number} interval - * How often to poll the server-side in milliseconds (defaults to 3000 - every - * 3 seconds). - */ + interval: 3000, - /** - * @cfg {Object} baseParams An object containing properties which are to be sent as parameters - * on every polling request - */ - /** - * @cfg {String/Function} url - * The url which the PollingProvider should contact with each request. This can also be - * an imported Ext.Direct method which will accept the baseParams as its only argument. - */ + + - // private + constructor : function(config){ Ext.direct.PollingProvider.superclass.constructor.call(this, config); this.addEvents( - /** - * @event beforepoll - * Fired immediately before a poll takes place, an event handler can return false - * in order to cancel the poll. - * @param {Ext.direct.PollingProvider} - */ + 'beforepoll', - /** - * @event poll - * This event has not yet been implemented. - * @param {Ext.direct.PollingProvider} - */ + 'poll' ); }, - // inherited + isConnected: function(){ return !!this.pollTask; }, - /** - * Connect to the server-side and begin the polling process. To handle each - * response subscribe to the data event. - */ + connect: function(){ if(this.url && !this.pollTask){ this.pollTask = Ext.TaskMgr.start({ @@ -39602,10 +24440,7 @@ Ext.direct.PollingProvider = Ext.extend(Ext.direct.JsonProvider, { } }, - /** - * Disconnect from the server-side and stop the polling process. The disconnect - * event will be fired on a successful disconnect. - */ + disconnect: function(){ if(this.pollTask){ Ext.TaskMgr.stop(this.pollTask); @@ -39614,7 +24449,7 @@ Ext.direct.PollingProvider = Ext.extend(Ext.direct.JsonProvider, { } }, - // private + onData: function(opt, success, xhr){ if(success){ var events = this.getEvents(xhr); @@ -39634,133 +24469,31 @@ Ext.direct.PollingProvider = Ext.extend(Ext.direct.JsonProvider, { } }); -Ext.Direct.PROVIDERS['polling'] = Ext.direct.PollingProvider;/** - * @class Ext.direct.RemotingProvider - * @extends Ext.direct.JsonProvider - * - *

    The {@link Ext.direct.RemotingProvider RemotingProvider} exposes access to - * server side methods on the client (a remote procedure call (RPC) type of - * connection where the client can initiate a procedure on the server).

    - * - *

    This allows for code to be organized in a fashion that is maintainable, - * while providing a clear path between client and server, something that is - * not always apparent when using URLs.

    - * - *

    To accomplish this the server-side needs to describe what classes and methods - * are available on the client-side. This configuration will typically be - * outputted by the server-side Ext.Direct stack when the API description is built.

    - */ +Ext.Direct.PROVIDERS['polling'] = Ext.direct.PollingProvider; Ext.direct.RemotingProvider = Ext.extend(Ext.direct.JsonProvider, { - /** - * @cfg {Object} actions - * Object literal defining the server side actions and methods. For example, if - * the Provider is configured with: - *
    
    -"actions":{ // each property within the 'actions' object represents a server side Class 
    -    "TestAction":[ // array of methods within each server side Class to be   
    -    {              // stubbed out on client
    -        "name":"doEcho", 
    -        "len":1            
    -    },{
    -        "name":"multiply",// name of method
    -        "len":2           // The number of parameters that will be used to create an
    -                          // array of data to send to the server side function.
    -                          // Ensure the server sends back a Number, not a String. 
    -    },{
    -        "name":"doForm",
    -        "formHandler":true, // direct the client to use specialized form handling method 
    -        "len":1
    -    }]
    -}
    -     * 
    - *

    Note that a Store is not required, a server method can be called at any time. - * In the following example a client side handler is used to call the - * server side method "multiply" in the server-side "TestAction" Class:

    - *
    
    -TestAction.multiply(
    -    2, 4, // pass two arguments to server, so specify len=2
    -    // callback function after the server is called
    -    // result: the result returned by the server
    -    //      e: Ext.Direct.RemotingEvent object
    -    function(result, e){
    -        var t = e.getTransaction();
    -        var action = t.action; // server side Class called
    -        var method = t.method; // server side method called
    -        if(e.status){
    -            var answer = Ext.encode(result); // 8
         
    -        }else{
    -            var msg = e.message; // failure message
    -        }
    -    }
    -);
    -     * 
    - * In the example above, the server side "multiply" function will be passed two - * arguments (2 and 4). The "multiply" method should return the value 8 which will be - * available as the result in the example above. - */ - /** - * @cfg {String/Object} namespace - * Namespace for the Remoting Provider (defaults to the browser global scope of window). - * Explicitly specify the namespace Object, or specify a String to have a - * {@link Ext#namespace namespace created} implicitly. - */ - /** - * @cfg {String} url - * Required. The url to connect to the {@link Ext.Direct} server-side router. - */ - /** - * @cfg {String} enableUrlEncode - * Specify which param will hold the arguments for the method. - * Defaults to 'data'. - */ - /** - * @cfg {Number/Boolean} enableBuffer - *

    true or false to enable or disable combining of method - * calls. If a number is specified this is the amount of time in milliseconds - * to wait before sending a batched request (defaults to 10).

    - *

    Calls which are received within the specified timeframe will be - * concatenated together and sent in a single request, optimizing the - * application by reducing the amount of round trips that have to be made - * to the server.

    - */ + + + + enableBuffer: 10, - /** - * @cfg {Number} maxRetries - * Number of times to re-attempt delivery on failure of a call. Defaults to 1. - */ + maxRetries: 1, - /** - * @cfg {Number} timeout - * The timeout to use for each request. Defaults to undefined. - */ + timeout: undefined, constructor : function(config){ Ext.direct.RemotingProvider.superclass.constructor.call(this, config); this.addEvents( - /** - * @event beforecall - * Fires immediately before the client-side sends off the RPC call. - * By returning false from an event handler you can prevent the call from - * executing. - * @param {Ext.direct.RemotingProvider} provider - * @param {Ext.Direct.Transaction} transaction - */ + 'beforecall', - /** - * @event call - * Fires immediately after the request to the server-side is sent. This does - * NOT fire after the response has come back from the call. - * @param {Ext.direct.RemotingProvider} provider - * @param {Ext.Direct.Transaction} transaction - */ + 'call' ); this.namespace = (Ext.isString(this.namespace)) ? Ext.ns(this.namespace) : this.namespace || window; @@ -39768,7 +24501,7 @@ TestAction.multiply( this.callBuffer = []; }, - // private + initAPI : function(){ var o = this.actions; for(var c in o){ @@ -39781,7 +24514,7 @@ TestAction.multiply( } }, - // inherited + isConnected: function(){ return !!this.connected; }, @@ -39945,8 +24678,8 @@ TestAction.multiply( extUpload: String(isUpload) }; - // change made from typeof callback check to callback.params - // to support addl param passing in DirectSubmit EAC 6/2 + + Ext.apply(t, { form: Ext.getDom(form), isUpload: isUpload, @@ -40005,46 +24738,7 @@ TestAction.multiply( } } }); -Ext.Direct.PROVIDERS['remoting'] = Ext.direct.RemotingProvider;/** - * @class Ext.Resizable - * @extends Ext.util.Observable - *

    Applies drag handles to an element to make it resizable. The drag handles are inserted into the element - * and positioned absolute. Some elements, such as a textarea or image, don't support this. To overcome that, you can wrap - * the textarea in a div and set 'resizeChild' to true (or to the id of the element), or set wrap:true in your config and - * the element will be wrapped for you automatically.

    - *

    Here is the list of valid resize handles:

    - *
    -Value   Description
    -------  -------------------
    - 'n'     north
    - 's'     south
    - 'e'     east
    - 'w'     west
    - 'nw'    northwest
    - 'sw'    southwest
    - 'se'    southeast
    - 'ne'    northeast
    - 'all'   all
    -
    - *

    Here's an example showing the creation of a typical Resizable:

    - *
    
    -var resizer = new Ext.Resizable('element-id', {
    -    handles: 'all',
    -    minWidth: 200,
    -    minHeight: 100,
    -    maxWidth: 500,
    -    maxHeight: 400,
    -    pinned: true
    -});
    -resizer.on('resize', myHandler);
    -
    - *

    To hide a particular handle, set its display to none in CSS, or through script:
    - * resizer.east.setDisplayed(false);

    - * @constructor - * Create a new resizable component - * @param {Mixed} el The id or element to resize - * @param {Object} config configuration options - */ +Ext.Direct.PROVIDERS['remoting'] = Ext.direct.RemotingProvider; Ext.Resizable = Ext.extend(Ext.util.Observable, { constructor: function(el, config){ @@ -40065,13 +24759,7 @@ Ext.Resizable = Ext.extend(Ext.util.Observable, { } } - /** - * The proxy Element that is resized in place of the real Element during the resize operation. - * This may be queried using {@link Ext.Element#getBox} to provide the new area to resize to. - * Read only. - * @type Ext.Element. - * @property proxy - */ + this.proxy = this.el.createProxy({tag: 'div', cls: 'x-resizable-proxy', id: this.el.id + '-rzproxy'}, Ext.getBody()); this.proxy.unselectable(); this.proxy.enableDisplayMode('block'); @@ -40082,12 +24770,12 @@ Ext.Resizable = Ext.extend(Ext.util.Observable, { this.disableTrackOver = true; this.el.addClass('x-resizable-pinned'); } - // if the element isn't positioned, make it relative + var position = this.el.getStyle('position'); if(position != 'absolute' && position != 'fixed'){ this.el.setStyle('position', 'relative'); } - if(!this.handles){ // no handles passed, must be legacy style + if(!this.handles){ this.handles = 's,e,se'; if(this.multiDirectional){ this.handles += ',n,w'; @@ -40104,7 +24792,7 @@ Ext.Resizable = Ext.extend(Ext.util.Observable, { this[pos] = new Ext.Resizable.Handle(this, pos, this.disableTrackOver, this.transparent, this.handleCls); } } - // legacy + this.corner = this.southeast; if(this.handles.indexOf('n') != -1 || this.handles.indexOf('w') != -1){ @@ -40145,21 +24833,9 @@ Ext.Resizable = Ext.extend(Ext.util.Observable, { } this.addEvents( - /** - * @event beforeresize - * Fired before resize is allowed. Set {@link #enabled} to false to cancel resize. - * @param {Ext.Resizable} this - * @param {Ext.EventObject} e The mousedown event - */ + 'beforeresize', - /** - * @event resize - * Fired after a resize. - * @param {Ext.Resizable} this - * @param {Number} width The new width - * @param {Number} height The new height - * @param {Ext.EventObject} e The mouseup event - */ + 'resize' ); @@ -40174,142 +24850,72 @@ Ext.Resizable = Ext.extend(Ext.util.Observable, { Ext.Resizable.superclass.constructor.call(this); }, - /** - * @cfg {Array/String} adjustments String 'auto' or an array [width, height] with values to be added to the - * resize operation's new size (defaults to [0, 0]) - */ + adjustments : [0, 0], - /** - * @cfg {Boolean} animate True to animate the resize (not compatible with dynamic sizing, defaults to false) - */ + animate : false, - /** - * @cfg {Mixed} constrainTo Constrain the resize to a particular element - */ - /** - * @cfg {Boolean} disableTrackOver True to disable mouse tracking. This is only applied at config time. (defaults to false) - */ + + disableTrackOver : false, - /** - * @cfg {Boolean} draggable Convenience to initialize drag drop (defaults to false) - */ + draggable: false, - /** - * @cfg {Number} duration Animation duration if animate = true (defaults to 0.35) - */ + duration : 0.35, - /** - * @cfg {Boolean} dynamic True to resize the element while dragging instead of using a proxy (defaults to false) - */ + dynamic : false, - /** - * @cfg {String} easing Animation easing if animate = true (defaults to 'easingOutStrong') - */ + easing : 'easeOutStrong', - /** - * @cfg {Boolean} enabled False to disable resizing (defaults to true) - */ + enabled : true, - /** - * @property enabled Writable. False if resizing is disabled. - * @type Boolean - */ - /** - * @cfg {String} handles String consisting of the resize handles to display (defaults to undefined). - * Specify either 'all' or any of 'n s e w ne nw se sw'. - */ + + handles : false, - /** - * @cfg {Boolean} multiDirectional Deprecated. Deprecated style of adding multi-direction resize handles. - */ + multiDirectional : false, - /** - * @cfg {Number} height The height of the element in pixels (defaults to null) - */ + height : null, - /** - * @cfg {Number} width The width of the element in pixels (defaults to null) - */ + width : null, - /** - * @cfg {Number} heightIncrement The increment to snap the height resize in pixels - * (only applies if {@link #dynamic}==true). Defaults to 0. - */ + heightIncrement : 0, - /** - * @cfg {Number} widthIncrement The increment to snap the width resize in pixels - * (only applies if {@link #dynamic}==true). Defaults to 0. - */ + widthIncrement : 0, - /** - * @cfg {Number} minHeight The minimum height for the element (defaults to 5) - */ + minHeight : 5, - /** - * @cfg {Number} minWidth The minimum width for the element (defaults to 5) - */ + minWidth : 5, - /** - * @cfg {Number} maxHeight The maximum height for the element (defaults to 10000) - */ + maxHeight : 10000, - /** - * @cfg {Number} maxWidth The maximum width for the element (defaults to 10000) - */ + maxWidth : 10000, - /** - * @cfg {Number} minX The minimum x for the element (defaults to 0) - */ + minX: 0, - /** - * @cfg {Number} minY The minimum x for the element (defaults to 0) - */ + minY: 0, - /** - * @cfg {Boolean} pinned True to ensure that the resize handles are always visible, false to display them only when the - * user mouses over the resizable borders. This is only applied at config time. (defaults to false) - */ + pinned : false, - /** - * @cfg {Boolean} preserveRatio True to preserve the original ratio between height - * and width during resize (defaults to false) - */ + preserveRatio : false, - /** - * @cfg {Boolean/String/Element} resizeChild True to resize the first child, or id/element to resize (defaults to false) - */ + resizeChild : false, - /** - * @cfg {Boolean} transparent True for transparent handles. This is only applied at config time. (defaults to false) - */ + transparent: false, - /** - * @cfg {Ext.lib.Region} resizeRegion Constrain the resize to a particular region - */ - /** - * @cfg {Boolean} wrap True to wrap an element with a div if needed (required for textareas and images, defaults to false) - * in favor of the handles config option (defaults to false) - */ - /** - * @cfg {String} handleCls A css class to add to each handle. Defaults to ''. - */ + + + - /** - * Perform a manual resize and fires the 'resize' event. - * @param {Number} width - * @param {Number} height - */ + resizeTo : function(width, height){ this.el.setSize(width, height); this.updateChildSize(); this.fireEvent('resize', this, width, height, null); }, - // private + startSizing : function(e, handle){ this.fireEvent('beforeresize', this, e); - if(this.enabled){ // 2nd enabled check in case disabled before beforeresize handler + if(this.enabled){ if(!this.overlay){ this.overlay = this.el.createProxy({tag: 'div', cls: 'x-resizable-overlay', html: ' '}, Ext.getBody()); @@ -40342,7 +24948,7 @@ Ext.Resizable = Ext.extend(Ext.util.Observable, { ); } - this.proxy.setStyle('visibility', 'hidden'); // workaround display none + this.proxy.setStyle('visibility', 'hidden'); this.proxy.show(); this.proxy.setBox(this.startBox); if(!this.dynamic){ @@ -40351,7 +24957,7 @@ Ext.Resizable = Ext.extend(Ext.util.Observable, { } }, - // private + onMouseDown : function(handle, e){ if(this.enabled){ e.stopEvent(); @@ -40360,7 +24966,7 @@ Ext.Resizable = Ext.extend(Ext.util.Observable, { } }, - // private + onMouseUp : function(e){ this.activeHandle = null; var size = this.resizeElement(); @@ -40371,7 +24977,7 @@ Ext.Resizable = Ext.extend(Ext.util.Observable, { this.fireEvent('resize', this, size.width, size.height, e); }, - // private + updateChildSize : function(){ if(this.resizeChild){ var el = this.el; @@ -40381,10 +24987,10 @@ Ext.Resizable = Ext.extend(Ext.util.Observable, { var b = el.getSize(true); child.setSize(b.width+adj[0], b.height+adj[1]); } - // Second call here for IE - // The first call enables instant resizing and - // the second call corrects scroll bars if they - // exist + + + + if(Ext.isIE){ setTimeout(function(){ if(el.dom.offsetWidth){ @@ -40396,7 +25002,7 @@ Ext.Resizable = Ext.extend(Ext.util.Observable, { } }, - // private + snap : function(value, inc, min){ if(!inc || !value){ return value; @@ -40413,45 +25019,7 @@ Ext.Resizable = Ext.extend(Ext.util.Observable, { return Math.max(min, newValue); }, - /** - *

    Performs resizing of the associated Element. This method is called internally by this - * class, and should not be called by user code.

    - *

    If a Resizable is being used to resize an Element which encapsulates a more complex UI - * component such as a Panel, this method may be overridden by specifying an implementation - * as a config option to provide appropriate behaviour at the end of the resize operation on - * mouseup, for example resizing the Panel, and relaying the Panel's content.

    - *

    The new area to be resized to is available by examining the state of the {@link #proxy} - * Element. Example: -

    
    -new Ext.Panel({
    -    title: 'Resize me',
    -    x: 100,
    -    y: 100,
    -    renderTo: Ext.getBody(),
    -    floating: true,
    -    frame: true,
    -    width: 400,
    -    height: 200,
    -    listeners: {
    -        render: function(p) {
    -            new Ext.Resizable(p.getEl(), {
    -                handles: 'all',
    -                pinned: true,
    -                transparent: true,
    -                resizeElement: function() {
    -                    var box = this.proxy.getBox();
    -                    p.updateBox(box);
    -                    if (p.layout) {
    -                        p.doLayout();
    -                    }
    -                    return box;
    -                }
    -           });
    -       }
    -    }
    -}).show();
    -
    - */ + resizeElement : function(){ var box = this.proxy.getBox(); if(this.updateBox){ @@ -40470,7 +25038,7 @@ new Ext.Panel({ return box; }, - // private + constrain : function(v, diff, m, mx){ if(v - diff < m){ diff = v - m; @@ -40480,16 +25048,16 @@ new Ext.Panel({ return diff; }, - // private + onMouseMove : function(e){ if(this.enabled && this.activeHandle){ - try{// try catch so if something goes wrong the user doesn't get hung + try{ if(this.resizeRegion && !this.resizeRegion.contains(e.getPoint())) { return; } - //var curXY = this.startPoint; + var curSize = this.curSize || this.startBox, x = this.startBox.x, y = this.startBox.y, ox = x, @@ -40646,41 +25214,31 @@ new Ext.Panel({ } }, - // private + handleOver : function(){ if(this.enabled){ this.el.addClass('x-resizable-over'); } }, - // private + handleOut : function(){ if(!this.resizing){ this.el.removeClass('x-resizable-over'); } }, - /** - * Returns the element this component is bound to. - * @return {Ext.Element} - */ + getEl : function(){ return this.el; }, - /** - * Returns the resizeChild element (or null). - * @return {Ext.Element} - */ + getResizeChild : function(){ return this.resizeChild; }, - /** - * Destroys this resizable. If the element was wrapped and - * removeEl is not true then the element remains. - * @param {Boolean} removeEl (optional) true to remove the element from the DOM - */ + destroy : function(removeEl){ Ext.destroy(this.dd, this.overlay, this.proxy); this.overlay = null; @@ -40711,8 +25269,8 @@ new Ext.Panel({ } }); -// private -// hash to map config positions to true positions + + Ext.Resizable.positions = { n: 'north', s: 'south', e: 'east', w: 'west', se: 'southeast', sw: 'southwest', nw: 'northwest', ne: 'northeast' }; @@ -40720,7 +25278,7 @@ Ext.Resizable.positions = { Ext.Resizable.Handle = Ext.extend(Object, { constructor : function(rz, pos, disableTrackOver, transparent, cls){ if(!this.tpl){ - // only initialize the template if resizable is used + var tpl = Ext.DomHelper.createTemplate( {tag: 'div', cls: 'x-resizable-handle x-resizable-handle-{0}'} ); @@ -40747,274 +25305,105 @@ Ext.Resizable.Handle = Ext.extend(Object, { } }, - // private + afterResize : function(rz){ - // do nothing + }, - // private + onMouseDown : function(e){ this.rz.onMouseDown(this, e); }, - // private + onMouseOver : function(e){ this.rz.handleOver(this, e); }, - // private + onMouseOut : function(e){ this.rz.handleOut(this, e); }, - // private + destroy : function(){ Ext.destroy(this.el); this.el = null; } }); -/** - * @class Ext.Window - * @extends Ext.Panel - *

    A specialized panel intended for use as an application window. Windows are floated, {@link #resizable}, and - * {@link #draggable} by default. Windows can be {@link #maximizable maximized} to fill the viewport, - * restored to their prior size, and can be {@link #minimize}d.

    - *

    Windows can also be linked to a {@link Ext.WindowGroup} or managed by the {@link Ext.WindowMgr} to provide - * grouping, activation, to front, to back and other application-specific behavior.

    - *

    By default, Windows will be rendered to document.body. To {@link #constrain} a Window to another element - * specify {@link Ext.Component#renderTo renderTo}.

    - *

    Note: By default, the {@link #closable close} header tool destroys the Window resulting in - * destruction of any child Components. This makes the Window object, and all its descendants unusable. To enable - * re-use of a Window, use {@link #closeAction closeAction: 'hide'}.

    - * @constructor - * @param {Object} config The config object - * @xtype window - */ + Ext.Window = Ext.extend(Ext.Panel, { - /** - * @cfg {Number} x - * The X position of the left edge of the window on initial showing. Defaults to centering the Window within - * the width of the Window's container {@link Ext.Element Element) (The Element that the Window is rendered to). - */ - /** - * @cfg {Number} y - * The Y position of the top edge of the window on initial showing. Defaults to centering the Window within - * the height of the Window's container {@link Ext.Element Element) (The Element that the Window is rendered to). - */ - /** - * @cfg {Boolean} modal - * True to make the window modal and mask everything behind it when displayed, false to display it without - * restricting access to other UI elements (defaults to false). - */ - /** - * @cfg {String/Element} animateTarget - * Id or element from which the window should animate while opening (defaults to null with no animation). - */ - /** - * @cfg {String} resizeHandles - * A valid {@link Ext.Resizable} handles config string (defaults to 'all'). Only applies when resizable = true. - */ - /** - * @cfg {Ext.WindowGroup} manager - * A reference to the WindowGroup that should manage this window (defaults to {@link Ext.WindowMgr}). - */ - /** - * @cfg {String/Number/Component} defaultButton - *

    Specifies a Component to receive focus when this Window is focussed.

    - *

    This may be one of:

      - *
    • The index of a footer Button.
    • - *
    • The id of a Component.
    • - *
    • A Component.
    • - *
    - */ - /** - * @cfg {Function} onEsc - * Allows override of the built-in processing for the escape key. Default action - * is to close the Window (performing whatever action is specified in {@link #closeAction}. - * To prevent the Window closing when the escape key is pressed, specify this as - * Ext.emptyFn (See {@link Ext#emptyFn}). - */ - /** - * @cfg {Boolean} collapsed - * True to render the window collapsed, false to render it expanded (defaults to false). Note that if - * {@link #expandOnShow} is true (the default) it will override the collapsed config and the window - * will always be expanded when shown. - */ - /** - * @cfg {Boolean} maximized - * True to initially display the window in a maximized state. (Defaults to false). - */ + + + + + + + + + + - /** - * @cfg {String} baseCls - * The base CSS class to apply to this panel's element (defaults to 'x-window'). - */ + baseCls : 'x-window', - /** - * @cfg {Boolean} resizable - * True to allow user resizing at each edge and corner of the window, false to disable resizing (defaults to true). - */ + resizable : true, - /** - * @cfg {Boolean} draggable - * True to allow the window to be dragged by the header bar, false to disable dragging (defaults to true). Note - * that by default the window will be centered in the viewport, so if dragging is disabled the window may need - * to be positioned programmatically after render (e.g., myWindow.setPosition(100, 100);). - */ + draggable : true, - /** - * @cfg {Boolean} closable - *

    True to display the 'close' tool button and allow the user to close the window, false to - * hide the button and disallow closing the window (defaults to true).

    - *

    By default, when close is requested by either clicking the close button in the header - * or pressing ESC when the Window has focus, the {@link #close} method will be called. This - * will {@link Ext.Component#destroy destroy} the Window and its content meaning that - * it may not be reused.

    - *

    To make closing a Window hide the Window so that it may be reused, set - * {@link #closeAction} to 'hide'. - */ + closable : true, - /** - * @cfg {String} closeAction - *

    The action to take when the close header tool is clicked: - *

      - *
    • '{@link #close}' : Default
      - * {@link #close remove} the window from the DOM and {@link Ext.Component#destroy destroy} - * it and all descendant Components. The window will not be available to be - * redisplayed via the {@link #show} method. - *
    • - *
    • '{@link #hide}' :
      - * {@link #hide} the window by setting visibility to hidden and applying negative offsets. - * The window will be available to be redisplayed via the {@link #show} method. - *
    • - *
    - *

    Note: This setting does not affect the {@link #close} method - * which will always {@link Ext.Component#destroy destroy} the window. To - * programatically hide a window, call {@link #hide}.

    - */ + closeAction : 'close', - /** - * @cfg {Boolean} constrain - * True to constrain the window within its containing element, false to allow it to fall outside of its - * containing element. By default the window will be rendered to document.body. To render and constrain the - * window within another element specify {@link #renderTo}. - * (defaults to false). Optionally the header only can be constrained using {@link #constrainHeader}. - */ + constrain : false, - /** - * @cfg {Boolean} constrainHeader - * True to constrain the window header within its containing element (allowing the window body to fall outside - * of its containing element) or false to allow the header to fall outside its containing element (defaults to - * false). Optionally the entire window can be constrained using {@link #constrain}. - */ + constrainHeader : false, - /** - * @cfg {Boolean} plain - * True to render the window body with a transparent background so that it will blend into the framing - * elements, false to add a lighter background color to visually highlight the body element and separate it - * more distinctly from the surrounding frame (defaults to false). - */ + plain : false, - /** - * @cfg {Boolean} minimizable - * True to display the 'minimize' tool button and allow the user to minimize the window, false to hide the button - * and disallow minimizing the window (defaults to false). Note that this button provides no implementation -- - * the behavior of minimizing a window is implementation-specific, so the minimize event must be handled and a - * custom minimize behavior implemented for this option to be useful. - */ + minimizable : false, - /** - * @cfg {Boolean} maximizable - * True to display the 'maximize' tool button and allow the user to maximize the window, false to hide the button - * and disallow maximizing the window (defaults to false). Note that when a window is maximized, the tool button - * will automatically change to a 'restore' button with the appropriate behavior already built-in that will - * restore the window to its previous size. - */ + maximizable : false, - /** - * @cfg {Number} minHeight - * The minimum height in pixels allowed for this window (defaults to 100). Only applies when resizable = true. - */ + minHeight : 100, - /** - * @cfg {Number} minWidth - * The minimum width in pixels allowed for this window (defaults to 200). Only applies when resizable = true. - */ + minWidth : 200, - /** - * @cfg {Boolean} expandOnShow - * True to always expand the window when it is displayed, false to keep it in its current state (which may be - * {@link #collapsed}) when displayed (defaults to true). - */ + expandOnShow : true, - // inherited docs, same default + collapsible : false, - /** - * @cfg {Boolean} initHidden - * True to hide the window until show() is explicitly called (defaults to true). - * @deprecated - */ + initHidden : undefined, - /** - * @cfg {Boolean} hidden - * Render this component hidden (default is true). If true, the - * {@link #hide} method will be called internally. - */ + hidden : true, - // The following configs are set to provide the basic functionality of a window. - // Changing them would require additional code to handle correctly and should - // usually only be done in subclasses that can provide custom behavior. Changing them - // may have unexpected or undesirable results. - /** @cfg {String} elements @hide */ + + + + + elements : 'header,body', - /** @cfg {Boolean} frame @hide */ + frame : true, - /** @cfg {Boolean} floating @hide */ + floating : true, - // private + initComponent : function(){ this.initTools(); Ext.Window.superclass.initComponent.call(this); this.addEvents( - /** - * @event activate - * Fires after the window has been visually activated via {@link #setActive}. - * @param {Ext.Window} this - */ - /** - * @event deactivate - * Fires after the window has been visually deactivated via {@link #setActive}. - * @param {Ext.Window} this - */ - /** - * @event resize - * Fires after the window has been resized. - * @param {Ext.Window} this - * @param {Number} width The window's new width - * @param {Number} height The window's new height - */ + + + 'resize', - /** - * @event maximize - * Fires after the window has been maximized. - * @param {Ext.Window} this - */ + 'maximize', - /** - * @event minimize - * Fires after the window has been minimized. - * @param {Ext.Window} this - */ + 'minimize', - /** - * @event restore - * Fires after the window has been restored to its original size after being maximized. - * @param {Ext.Window} this - */ + 'restore' ); - // for backwards compat, this should be removed at some point + if(Ext.isDefined(this.initHidden)){ this.hidden = this.initHidden; } @@ -41024,12 +25413,12 @@ Ext.Window = Ext.extend(Ext.Panel, { } }, - // private + getState : function(){ return Ext.apply(Ext.Window.superclass.getState.call(this) || {}, this.getBox(true)); }, - // private + onRender : function(ct, position){ Ext.Window.superclass.onRender.call(this, ct, position); @@ -41037,7 +25426,7 @@ Ext.Window = Ext.extend(Ext.Panel, { this.el.addClass('x-window-plain'); } - // this element allows the Window to be focused for keyboard events + this.focusEl = this.el.createChild({ tag: 'a', href:'#', cls:'x-dlg-focus', tabIndex:'-1', html: ' '}); @@ -41057,7 +25446,7 @@ Ext.Window = Ext.extend(Ext.Panel, { } }, - // private + initEvents : function(){ Ext.Window.superclass.initEvents.call(this); if(this.animateTarget){ @@ -41095,26 +25484,17 @@ Ext.Window = Ext.extend(Ext.Panel, { }, initDraggable : function(){ - /** - *

    If this Window is configured {@link #draggable}, this property will contain - * an instance of {@link Ext.dd.DD} which handles dragging the Window's DOM Element.

    - *

    This has implementations of startDrag, onDrag and endDrag - * which perform the dragging action. If extra logic is needed at these points, use - * {@link Function#createInterceptor createInterceptor} or {@link Function#createSequence createSequence} to - * augment the existing implementations.

    - * @type Ext.dd.DD - * @property dd - */ + this.dd = new Ext.Window.DD(this); }, - // private + onEsc : function(k, e){ e.stopEvent(); this[this.closeAction](); }, - // private + beforeDestroy : function(){ if(this.rendered){ this.hide(); @@ -41130,7 +25510,7 @@ Ext.Window = Ext.extend(Ext.Panel, { Ext.Window.superclass.beforeDestroy.call(this); }, - // private + onDestroy : function(){ if(this.manager){ this.manager.unregister(this); @@ -41138,7 +25518,7 @@ Ext.Window = Ext.extend(Ext.Panel, { Ext.Window.superclass.onDestroy.call(this); }, - // private + initTools : function(){ if(this.minimizable){ this.addTool({ @@ -41165,7 +25545,7 @@ Ext.Window = Ext.extend(Ext.Panel, { } }, - // private + resizerAction : function(){ var box = this.proxy.getBox(); this.proxy.hide(); @@ -41173,14 +25553,14 @@ Ext.Window = Ext.extend(Ext.Panel, { return box; }, - // private + beforeResize : function(){ - this.resizer.minHeight = Math.max(this.minHeight, this.getFrameHeight() + 40); // 40 is a magic minimum content size? + this.resizer.minHeight = Math.max(this.minHeight, this.getFrameHeight() + 40); this.resizer.minWidth = Math.max(this.minWidth, this.getFrameWidth() + 40); this.resizeBox = this.el.getBox(); }, - // private + updateHandles : function(){ if(Ext.isIE && this.resizer){ this.resizer.syncHandleHeight(); @@ -41188,7 +25568,7 @@ Ext.Window = Ext.extend(Ext.Panel, { } }, - // private + handleResize : function(box){ var rz = this.resizeBox; if(rz.x != box.x || rz.y != box.y){ @@ -41204,10 +25584,7 @@ Ext.Window = Ext.extend(Ext.Panel, { this.saveState(); }, - /** - * Focuses the window. If a defaultButton is set, it will receive focus, otherwise the - * window itself will receive focus. - */ + focus : function(){ var f = this.focusEl, db = this.defaultButton, @@ -41234,16 +25611,13 @@ Ext.Window = Ext.extend(Ext.Panel, { f.focus.defer(10, f); }, - /** - * Sets the target element from which the window should animate while opening. - * @param {String/Element} el The target element or id - */ + setAnimateTarget : function(el){ el = Ext.get(el); this.animateTarget = el; }, - // private + beforeShow : function(){ delete this.el.lastXY; delete this.el.lastLT; @@ -41266,14 +25640,7 @@ Ext.Window = Ext.extend(Ext.Panel, { } }, - /** - * Shows the window, rendering it first if necessary, or activates it and brings it to front if hidden. - * @param {String/Element} animateTarget (optional) The target element or id from which the window should - * animate while opening (defaults to null with no animation) - * @param {Function} callback (optional) A callback function to call after the window is displayed - * @param {Object} scope (optional) The scope (this reference) in which the callback is executed. Defaults to this Window. - * @return {Ext.Window} this - */ + show : function(animateTarget, cb, scope){ if(!this.rendered){ this.render(Ext.getBody()); @@ -41301,7 +25668,7 @@ Ext.Window = Ext.extend(Ext.Panel, { return this; }, - // private + afterShow : function(isAnim){ if (this.isDestroyed){ return false; @@ -41312,7 +25679,7 @@ Ext.Window = Ext.extend(Ext.Panel, { if(this.maximized){ this.fitContainer(); } - if(Ext.isMac && Ext.isGecko2){ // work around stupid FF 2.0/Mac scroll bar bug + if(Ext.isMac && Ext.isGecko2){ this.cascade(this.setAutoScroll); } @@ -41334,7 +25701,7 @@ Ext.Window = Ext.extend(Ext.Panel, { this.fireEvent('show', this); }, - // private + animShow : function(){ this.proxy.show(); this.proxy.setBox(this.animateTarget.getBox()); @@ -41350,14 +25717,7 @@ Ext.Window = Ext.extend(Ext.Panel, { })); }, - /** - * Hides the window, setting it to invisible and applying negative offsets. - * @param {String/Element} animateTarget (optional) The target element or id to which the window should - * animate while hiding (defaults to null with no animation) - * @param {Function} callback (optional) A callback function to call after the window is hidden - * @param {Object} scope (optional) The scope (this reference) in which the callback is executed. Defaults to this Window. - * @return {Ext.Window} this - */ + hide : function(animateTarget, cb, scope){ if(this.hidden || this.fireEvent('beforehide', this) === false){ return this; @@ -41382,7 +25742,7 @@ Ext.Window = Ext.extend(Ext.Panel, { return this; }, - // private + afterHide : function(){ this.proxy.hide(); if(this.monitorResize || this.modal || this.constrain || this.constrainHeader){ @@ -41395,7 +25755,7 @@ Ext.Window = Ext.extend(Ext.Panel, { this.fireEvent('hide', this); }, - // private + animHide : function(){ this.proxy.setOpacity(0.5); this.proxy.show(); @@ -41411,19 +25771,13 @@ Ext.Window = Ext.extend(Ext.Panel, { })); }, - /** - * Method that is called immediately before the show event is fired. - * Defaults to Ext.emptyFn. - */ + onShow : Ext.emptyFn, - /** - * Method that is called immediately before the hide event is fired. - * Defaults to Ext.emptyFn. - */ + onHide : Ext.emptyFn, - // private + onWindowResize : function(){ if(this.maximized){ this.fitContainer(); @@ -41436,7 +25790,7 @@ Ext.Window = Ext.extend(Ext.Panel, { this.doConstrain(); }, - // private + doConstrain : function(){ if(this.constrain || this.constrainHeader){ var offsets; @@ -41461,7 +25815,7 @@ Ext.Window = Ext.extend(Ext.Panel, { } }, - // private - used for dragging + ghost : function(cls){ var ghost = this.createGhost(cls); var box = this.getBox(true); @@ -41472,7 +25826,7 @@ Ext.Window = Ext.extend(Ext.Panel, { return ghost; }, - // private + unghost : function(show, matchPosition){ if(!this.activeGhost) { return; @@ -41480,7 +25834,7 @@ Ext.Window = Ext.extend(Ext.Panel, { if(show !== false){ this.el.show(); this.focus.defer(10, this); - if(Ext.isMac && Ext.isGecko2){ // work around stupid FF 2.0/Mac scroll bar bug + if(Ext.isMac && Ext.isGecko2){ this.cascade(this.setAutoScroll); } } @@ -41492,25 +25846,13 @@ Ext.Window = Ext.extend(Ext.Panel, { delete this.activeGhost; }, - /** - * Placeholder method for minimizing the window. By default, this method simply fires the {@link #minimize} event - * since the behavior of minimizing a window is application-specific. To implement custom minimize behavior, - * either the minimize event can be handled or this method can be overridden. - * @return {Ext.Window} this - */ + minimize : function(){ this.fireEvent('minimize', this); return this; }, - /** - *

    Closes the Window, removes it from the DOM, {@link Ext.Component#destroy destroy}s - * the Window object and all its descendant Components. The {@link Ext.Panel#beforeclose beforeclose} - * event is fired before the close happens and will cancel the close action if it returns false.

    - *

    Note: This method is not affected by the {@link #closeAction} setting which - * only affects the action triggered when clicking the {@link #closable 'close' tool in the header}. - * To hide the Window without destroying it, call {@link #hide}.

    - */ + close : function(){ if(this.fireEvent('beforeclose', this) !== false){ if(this.hidden){ @@ -41521,18 +25863,13 @@ Ext.Window = Ext.extend(Ext.Panel, { } }, - // private + doClose : function(){ this.fireEvent('close', this); this.destroy(); }, - /** - * Fits the window within its current container and automatically replaces - * the {@link #maximizable 'maximize' tool button} with the 'restore' tool button. - * Also see {@link #toggleMaximize}. - * @return {Ext.Window} this - */ + maximize : function(){ if(!this.maximized){ this.expand(false); @@ -41561,13 +25898,7 @@ Ext.Window = Ext.extend(Ext.Panel, { return this; }, - /** - * Restores a {@link #maximizable maximized} window back to its original - * size and position prior to being maximized and also replaces - * the 'restore' tool button with the 'maximize' tool button. - * Also see {@link #toggleMaximize}. - * @return {Ext.Window} this - */ + restore : function(){ if(this.maximized){ var t = this.tools; @@ -41599,23 +25930,19 @@ Ext.Window = Ext.extend(Ext.Panel, { return this; }, - /** - * A shortcut method for toggling between {@link #maximize} and {@link #restore} based on the current maximized - * state of the window. - * @return {Ext.Window} this - */ + toggleMaximize : function(){ return this[this.maximized ? 'restore' : 'maximize'](); }, - // private + fitContainer : function(){ var vs = this.container.getViewSize(false); this.setSize(vs.width, vs.height); }, - // private - // z-index is managed by the WindowManager and may be overwritten at any time + + setZIndex : function(index){ if(this.modal){ this.mask.setStyle('z-index', index); @@ -41630,28 +25957,14 @@ Ext.Window = Ext.extend(Ext.Panel, { this.lastZIndex = index; }, - /** - * Aligns the window to the specified element - * @param {Mixed} element The element to align to. - * @param {String} position (optional, defaults to "tl-bl?") The position to align to (see {@link Ext.Element#alignTo} for more details). - * @param {Array} offsets (optional) Offset the positioning by [x, y] - * @return {Ext.Window} this - */ + alignTo : function(element, position, offsets){ var xy = this.el.getAlignToXY(element, position, offsets); this.setPagePosition(xy[0], xy[1]); return this; }, - /** - * Anchors this window to another element and realigns it when the window is resized or scrolled. - * @param {Mixed} element The element to align to. - * @param {String} position The position to align to (see {@link Ext.Element#alignTo} for more details) - * @param {Array} offsets (optional) Offset the positioning by [x, y] - * @param {Boolean/Number} monitorScroll (optional) true to monitor body scroll and reposition. If this parameter - * is a number, it is used as the buffer delay (defaults to 50ms). - * @return {Ext.Window} this - */ + anchorTo : function(el, alignment, offsets, monitorScroll){ this.clearAnchor(); this.anchorTarget = { @@ -41669,21 +25982,14 @@ Ext.Window = Ext.extend(Ext.Panel, { return this.doAnchor(); }, - /** - * Performs the anchor, using the saved anchorTarget property. - * @return {Ext.Window} this - * @private - */ + doAnchor : function(){ var o = this.anchorTarget; this.alignTo(o.el, o.alignment, o.offsets); return this; }, - /** - * Removes any existing anchor from this window. See {@link #anchorTo}. - * @return {Ext.Window} this - */ + clearAnchor : function(){ if(this.anchorTarget){ Ext.EventManager.removeResizeListener(this.doAnchor, this); @@ -41693,11 +25999,7 @@ Ext.Window = Ext.extend(Ext.Panel, { return this; }, - /** - * Brings this window to the front of any other visible windows - * @param {Boolean} e (optional) Specify false to prevent the window from being focused. - * @return {Ext.Window} this - */ + toFront : function(e){ if(this.manager.bringToFront(this)){ if(!e || !e.getTarget().focus){ @@ -41707,12 +26009,7 @@ Ext.Window = Ext.extend(Ext.Panel, { return this; }, - /** - * Makes this the active window by showing its shadow, or deactivates it by hiding its shadow. This method also - * fires the {@link #activate} or {@link #deactivate} event depending on which action occurred. This method is - * called internally by {@link Ext.WindowMgr}. - * @param {Boolean} active True to activate the window, false to deactivate it (defaults to false) - */ + setActive : function(active){ if(active){ if(!this.maximized){ @@ -41725,32 +26022,24 @@ Ext.Window = Ext.extend(Ext.Panel, { } }, - /** - * Sends this window to the back of (lower z-index than) any other visible windows - * @return {Ext.Window} this - */ + toBack : function(){ this.manager.sendToBack(this); return this; }, - /** - * Centers this window in the viewport - * @return {Ext.Window} this - */ + center : function(){ var xy = this.el.getAlignToXY(this.container, 'c-c'); this.setPagePosition(xy[0], xy[1]); return this; } - /** - * @cfg {Boolean} autoWidth @hide - **/ + }); Ext.reg('window', Ext.Window); -// private - custom Window DD implementation + Ext.Window.DD = function(win){ this.win = win; Ext.Window.DD.superclass.constructor.call(this, win.el.id, 'WindowDD-'+win.id); @@ -41783,23 +26072,18 @@ Ext.extend(Ext.Window.DD, Ext.dd.DD, { this.win.saveState(); } }); -/** - * @class Ext.WindowGroup - * An object that manages a group of {@link Ext.Window} instances and provides z-order management - * and window activation behavior. - * @constructor - */ + Ext.WindowGroup = function(){ var list = {}; var accessList = []; var front = null; - // private + var sortWindows = function(d1, d2){ return (!d1._lastAccess || d1._lastAccess < d2._lastAccess) ? -1 : 1; }; - // private + var orderWindows = function(){ var a = accessList, len = a.length; if(len > 0){ @@ -41815,7 +26099,7 @@ Ext.WindowGroup = function(){ activateLast(); }; - // private + var setActiveWin = function(win){ if(win != front){ if(front){ @@ -41828,7 +26112,7 @@ Ext.WindowGroup = function(){ } }; - // private + var activateLast = function(){ for(var i = accessList.length-1; i >=0; --i) { if(!accessList[i].hidden){ @@ -41836,29 +26120,15 @@ Ext.WindowGroup = function(){ return; } } - // none to activate + setActiveWin(null); }; return { - /** - * The starting z-index for windows in this WindowGroup (defaults to 9000) - * @type Number The z-index value - */ + zseed : 9000, - /** - *

    Registers a {@link Ext.Window Window} with this WindowManager. This should not - * need to be called under normal circumstances. Windows are automatically registered - * with a {@link Ext.Window#manager manager} at construction time.

    - *

    Where this may be useful is moving Windows between two WindowManagers. For example, - * to bring the Ext.MessageBox dialog under the same manager as the Desktop's - * WindowManager in the desktop sample app:

    -var msgWin = Ext.MessageBox.getDialog();
    -MyDesktop.getDesktop().getManager().register(msgWin);
    -
    - * @param {Window} win The Window to register. - */ + register : function(win){ if(win.manager){ win.manager.unregister(win); @@ -41870,12 +26140,7 @@ MyDesktop.getDesktop().getManager().register(msgWin); win.on('hide', activateLast); }, - /** - *

    Unregisters a {@link Ext.Window Window} from this WindowManager. This should not - * need to be called. Windows are automatically unregistered upon destruction. - * See {@link #register}.

    - * @param {Window} win The Window to unregister. - */ + unregister : function(win){ delete win.manager; delete list[win.id]; @@ -41883,21 +26148,12 @@ MyDesktop.getDesktop().getManager().register(msgWin); accessList.remove(win); }, - /** - * Gets a registered window by id. - * @param {String/Object} id The id of the window or a {@link Ext.Window} instance - * @return {Ext.Window} - */ + get : function(id){ return typeof id == "object" ? id : list[id]; }, - /** - * Brings the specified window to the front of any other active windows in this WindowGroup. - * @param {String/Object} win The id of the window or a {@link Ext.Window} instance - * @return {Boolean} True if the dialog was brought to the front, else false - * if it was already in front - */ + bringToFront : function(win){ win = this.get(win); if(win != front){ @@ -41908,11 +26164,7 @@ MyDesktop.getDesktop().getManager().register(msgWin); return false; }, - /** - * Sends the specified window to the back of other active windows in this WindowGroup. - * @param {String/Object} win The id of the window or a {@link Ext.Window} instance - * @return {Ext.Window} The window - */ + sendToBack : function(win){ win = this.get(win); win._lastAccess = -(new Date().getTime()); @@ -41920,9 +26172,7 @@ MyDesktop.getDesktop().getManager().register(msgWin); return win; }, - /** - * Hides all windows in this WindowGroup. - */ + hideAll : function(){ for(var id in list){ if(list[id] && typeof list[id] != "function" && list[id].isVisible()){ @@ -41931,23 +26181,12 @@ MyDesktop.getDesktop().getManager().register(msgWin); } }, - /** - * Gets the currently-active window in this WindowGroup. - * @return {Ext.Window} The active window - */ + getActive : function(){ return front; }, - /** - * Returns zero or more windows in this WindowGroup using the custom search function passed to this method. - * The function should accept a single {@link Ext.Window} reference as its only argument and should - * return true if the window matches the search criteria, otherwise it should return false. - * @param {Function} fn The search function - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to the Window being tested. - * that gets passed to the function if not specified) - * @return {Array} An array of zero or more matching windows - */ + getBy : function(fn, scope){ var r = []; for(var i = accessList.length-1; i >=0; --i) { @@ -41959,12 +26198,7 @@ MyDesktop.getDesktop().getManager().register(msgWin); return r; }, - /** - * Executes the specified function once for every window in this WindowGroup, passing each - * window as the only parameter. Returning false from the function will stop the iteration. - * @param {Function} fn The function to execute for each item - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to the current Window in the iteration. - */ + each : function(fn, scope){ for(var id in list){ if(list[id] && typeof list[id] != "function"){ @@ -41978,51 +26212,15 @@ MyDesktop.getDesktop().getManager().register(msgWin); }; -/** - * @class Ext.WindowMgr - * @extends Ext.WindowGroup - * The default global window group that is available automatically. To have more than one group of windows - * with separate z-order stacks, create additional instances of {@link Ext.WindowGroup} as needed. - * @singleton - */ -Ext.WindowMgr = new Ext.WindowGroup();/** - * @class Ext.MessageBox - *

    Utility class for generating different styles of message boxes. The alias Ext.Msg can also be used.

    - *

    Note that the MessageBox is asynchronous. Unlike a regular JavaScript alert (which will halt - * browser execution), showing a MessageBox will not cause the code to stop. For this reason, if you have code - * that should only run after some user feedback from the MessageBox, you must use a callback function - * (see the function parameter for {@link #show} for more details).

    - *

    Example usage:

    - *
    
    -// Basic alert:
    -Ext.Msg.alert('Status', 'Changes saved successfully.');
    -
    -// Prompt for user data and process the result using a callback:
    -Ext.Msg.prompt('Name', 'Please enter your name:', function(btn, text){
    -    if (btn == 'ok'){
    -        // process text value and close...
    -    }
    -});
     
    -// Show a dialog using config options:
    -Ext.Msg.show({
    -   title:'Save Changes?',
    -   msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
    -   buttons: Ext.Msg.YESNOCANCEL,
    -   fn: processResult,
    -   animEl: 'elId',
    -   icon: Ext.MessageBox.QUESTION
    -});
    -
    - * @singleton - */ +Ext.WindowMgr = new Ext.WindowGroup(); Ext.MessageBox = function(){ var dlg, opt, mask, waitTimer, bodyEl, msgEl, textboxEl, textareaEl, progressBar, pp, iconEl, spacerEl, buttons, activeTextEl, bwidth, bufferIcon = '', iconCls = '', buttonNames = ['ok', 'yes', 'no', 'cancel']; - // private + var handleButton = function(button){ buttons[button].blur(); if(dlg.isVisible()){ @@ -42032,7 +26230,7 @@ Ext.MessageBox = function(){ } }; - // private + var handleHide = function(){ if(opt && opt.cls){ dlg.el.removeClass(opt.cls); @@ -42040,7 +26238,7 @@ Ext.MessageBox = function(){ progressBar.reset(); }; - // private + var handleEsc = function(d, k, e){ if(opt && opt.closable !== false){ dlg.hide(); @@ -42051,7 +26249,7 @@ Ext.MessageBox = function(){ } }; - // private + var updateButtons = function(b){ var width = 0, cfg; @@ -42076,10 +26274,7 @@ Ext.MessageBox = function(){ }; return { - /** - * Returns a reference to the underlying {@link Ext.Window} element - * @return {Ext.Window} The window - */ + getDialog : function(titleText){ if(!dlg){ var btns = []; @@ -42152,15 +26347,10 @@ Ext.MessageBox = function(){ return dlg; }, - /** - * Updates the message box body text - * @param {String} text (optional) Replaces the message box element's innerHTML with the specified string (defaults to - * the XHTML-compliant non-breaking space character '&#160;') - * @return {Ext.MessageBox} this - */ + updateText : function(text){ if(!dlg.isVisible() && !opt.width){ - dlg.setSize(this.maxWidth, 100); // resize first so content is never clipped from previous shows + dlg.setSize(this.maxWidth, 100); } msgEl.update(text || ' '); @@ -42171,8 +26361,8 @@ Ext.MessageBox = function(){ w; if (Ext.isIE && iw > 0){ - //3 pixels get subtracted in the icon CSS for an IE margin issue, - //so we have to add it back here for the overall width to be consistent + + iw += 3; } w = Math.max(Math.min(opt.width || iw+mw+fw+bw, opt.maxWidth || this.maxWidth), @@ -42185,22 +26375,13 @@ Ext.MessageBox = function(){ progressBar.setSize(w-iw-fw-bw); } if(Ext.isIE && w == bwidth){ - w += 4; //Add offset when the content width is smaller than the buttons. + w += 4; } dlg.setSize(w, 'auto').center(); return this; }, - /** - * Updates a progress-style message box's text and progress bar. Only relevant on message boxes - * initiated via {@link Ext.MessageBox#progress} or {@link Ext.MessageBox#wait}, - * or by calling {@link Ext.MessageBox#show} with progress: true. - * @param {Number} value Any number between 0 and 1 (e.g., .5, defaults to 0) - * @param {String} progressText The progress text to display inside the progress bar (defaults to '') - * @param {String} msg The message box's body text is replaced with the specified string (defaults to undefined - * so that any existing body text will not get overwritten by default unless a new value is passed in) - * @return {Ext.MessageBox} this - */ + updateProgress : function(value, progressText, msg){ progressBar.updateProgress(value, progressText); if(msg){ @@ -42209,101 +26390,27 @@ Ext.MessageBox = function(){ return this; }, - /** - * Returns true if the message box is currently displayed - * @return {Boolean} True if the message box is visible, else false - */ + isVisible : function(){ return dlg && dlg.isVisible(); }, - /** - * Hides the message box if it is displayed - * @return {Ext.MessageBox} this - */ + hide : function(){ var proxy = dlg ? dlg.activeGhost : null; if(this.isVisible() || proxy){ dlg.hide(); handleHide(); if (proxy){ - // unghost is a private function, but i saw no better solution - // to fix the locking problem when dragging while it closes + + dlg.unghost(false, false); } } return this; }, - /** - * Displays a new message box, or reinitializes an existing message box, based on the config options - * passed in. All display functions (e.g. prompt, alert, etc.) on MessageBox call this function internally, - * although those calls are basic shortcuts and do not support all of the config options allowed here. - * @param {Object} config The following config options are supported:
      - *
    • animEl : String/Element
      An id or Element from which the message box should animate as it - * opens and closes (defaults to undefined)
    • - *
    • buttons : Object/Boolean
      A button config object (e.g., Ext.MessageBox.OKCANCEL or {ok:'Foo', - * cancel:'Bar'}), or false to not show any buttons (defaults to false)
    • - *
    • closable : Boolean
      False to hide the top-right close button (defaults to true). Note that - * progress and wait dialogs will ignore this property and always hide the close button as they can only - * be closed programmatically.
    • - *
    • cls : String
      A custom CSS class to apply to the message box's container element
    • - *
    • defaultTextHeight : Number
      The default height in pixels of the message box's multiline textarea - * if displayed (defaults to 75)
    • - *
    • fn : Function
      A callback function which is called when the dialog is dismissed either - * by clicking on the configured buttons, or on the dialog close button, or by pressing - * the return button to enter input. - *

      Progress and wait dialogs will ignore this option since they do not respond to user - * actions and can only be closed programmatically, so any required function should be called - * by the same code after it closes the dialog. Parameters passed:

        - *
      • buttonId : String
        The ID of the button pressed, one of:
          - *
        • ok
        • - *
        • yes
        • - *
        • no
        • - *
        • cancel
        • - *
      • - *
      • text : String
        Value of the input field if either prompt - * or multiline is true
      • - *
      • opt : Object
        The config object passed to show.
      • - *

    • - *
    • scope : Object
      The scope of the callback function
    • - *
    • icon : String
      A CSS class that provides a background image to be used as the body icon for the - * dialog (e.g. Ext.MessageBox.WARNING or 'custom-class') (defaults to '')
    • - *
    • iconCls : String
      The standard {@link Ext.Window#iconCls} to - * add an optional header icon (defaults to '')
    • - *
    • maxWidth : Number
      The maximum width in pixels of the message box (defaults to 600)
    • - *
    • minWidth : Number
      The minimum width in pixels of the message box (defaults to 100)
    • - *
    • modal : Boolean
      False to allow user interaction with the page while the message box is - * displayed (defaults to true)
    • - *
    • msg : String
      A string that will replace the existing message box body text (defaults to the - * XHTML-compliant non-breaking space character '&#160;')
    • - *
    • multiline : Boolean
      - * True to prompt the user to enter multi-line text (defaults to false)
    • - *
    • progress : Boolean
      True to display a progress bar (defaults to false)
    • - *
    • progressText : String
      The text to display inside the progress bar if progress = true (defaults to '')
    • - *
    • prompt : Boolean
      True to prompt the user to enter single-line text (defaults to false)
    • - *
    • proxyDrag : Boolean
      True to display a lightweight proxy while dragging (defaults to false)
    • - *
    • title : String
      The title text
    • - *
    • value : String
      The string value to set into the active textbox element if displayed
    • - *
    • wait : Boolean
      True to display a progress bar (defaults to false)
    • - *
    • waitConfig : Object
      A {@link Ext.ProgressBar#waitConfig} object (applies only if wait = true)
    • - *
    • width : Number
      The width of the dialog in pixels
    • - *
    - * Example usage: - *
    
    -Ext.Msg.show({
    -   title: 'Address',
    -   msg: 'Please enter your address:',
    -   width: 300,
    -   buttons: Ext.MessageBox.OKCANCEL,
    -   multiline: true,
    -   fn: saveAddress,
    -   animEl: 'addAddressBtn',
    -   icon: Ext.MessageBox.INFO
    -});
    -
    - * @return {Ext.MessageBox} this - */ + show : function(options){ if(this.isVisible()){ this.hide(); @@ -42360,10 +26467,10 @@ Ext.Msg.show({ d.modal = opt.modal !== false; d.mask = opt.modal !== false ? mask : false; if(!d.isVisible()){ - // force it to the end of the z-index stack so it gets a cursor in FF + document.body.appendChild(dlg.el.dom); d.setAnimateTarget(opt.animEl); - //workaround for window internally enabling keymap in afterShow + d.on('show', function(){ if(allowClose === true){ d.keyMap.enable(); @@ -42379,20 +26486,7 @@ Ext.Msg.show({ return this; }, - /** - * Adds the specified icon to the dialog. By default, the class 'ext-mb-icon' is applied for default - * styling, and the class passed in is expected to supply the background image url. Pass in empty string ('') - * to clear any existing icon. This method must be called before the MessageBox is shown. - * The following built-in icon classes are supported, but you can also pass in a custom class name: - *
    -Ext.MessageBox.INFO
    -Ext.MessageBox.WARNING
    -Ext.MessageBox.QUESTION
    -Ext.MessageBox.ERROR
    -         *
    - * @param {String} icon A CSS classname specifying the icon's background image url, or empty string to clear the icon - * @return {Ext.MessageBox} this - */ + setIcon : function(icon){ if(!dlg){ bufferIcon = icon; @@ -42412,15 +26506,7 @@ Ext.MessageBox.ERROR return this; }, - /** - * Displays a message box with a progress bar. This message box has no buttons and is not closeable by - * the user. You are responsible for updating the progress bar as needed via {@link Ext.MessageBox#updateProgress} - * and closing the message box when the process is complete. - * @param {String} title The title bar text - * @param {String} msg The message box body text - * @param {String} progressText (optional) The text to display inside the progress bar (defaults to '') - * @return {Ext.MessageBox} this - */ + progress : function(title, msg, progressText){ this.show({ title : title, @@ -42434,15 +26520,7 @@ Ext.MessageBox.ERROR return this; }, - /** - * Displays a message box with an infinitely auto-updating progress bar. This can be used to block user - * interaction while waiting for a long-running process to complete that does not have defined intervals. - * You are responsible for closing the message box when the process is complete. - * @param {String} msg The message box body text - * @param {String} title (optional) The title bar text - * @param {Object} config (optional) A {@link Ext.ProgressBar#waitConfig} object - * @return {Ext.MessageBox} this - */ + wait : function(msg, title, config){ this.show({ title : title, @@ -42457,17 +26535,7 @@ Ext.MessageBox.ERROR return this; }, - /** - * Displays a standard read-only message box with an OK button (comparable to the basic JavaScript alert prompt). - * If a callback function is passed it will be called after the user clicks the button, and the - * id of the button that was clicked will be passed as the only parameter to the callback - * (could also be the top-right close button). - * @param {String} title The title bar text - * @param {String} msg The message box body text - * @param {Function} fn (optional) The callback function invoked after the message box is closed - * @param {Object} scope (optional) The scope (this reference) in which the callback is executed. Defaults to the browser wnidow. - * @return {Ext.MessageBox} this - */ + alert : function(title, msg, fn, scope){ this.show({ title : title, @@ -42480,17 +26548,7 @@ Ext.MessageBox.ERROR return this; }, - /** - * Displays a confirmation message box with Yes and No buttons (comparable to JavaScript's confirm). - * If a callback function is passed it will be called after the user clicks either button, - * and the id of the button that was clicked will be passed as the only parameter to the callback - * (could also be the top-right close button). - * @param {String} title The title bar text - * @param {String} msg The message box body text - * @param {Function} fn (optional) The callback function invoked after the message box is closed - * @param {Object} scope (optional) The scope (this reference) in which the callback is executed. Defaults to the browser wnidow. - * @return {Ext.MessageBox} this - */ + confirm : function(title, msg, fn, scope){ this.show({ title : title, @@ -42504,20 +26562,7 @@ Ext.MessageBox.ERROR return this; }, - /** - * Displays a message box with OK and Cancel buttons prompting the user to enter some text (comparable to JavaScript's prompt). - * The prompt can be a single-line or multi-line textbox. If a callback function is passed it will be called after the user - * clicks either button, and the id of the button that was clicked (could also be the top-right - * close button) and the text that was entered will be passed as the two parameters to the callback. - * @param {String} title The title bar text - * @param {String} msg The message box body text - * @param {Function} fn (optional) The callback function invoked after the message box is closed - * @param {Object} scope (optional) The scope (this reference) in which the callback is executed. Defaults to the browser wnidow. - * @param {Boolean/Number} multiline (optional) True to create a multiline textbox using the defaultTextHeight - * property, or the height in pixels to create the textbox (defaults to false / single-line) - * @param {String} value (optional) Default value of the text input element (defaults to '') - * @return {Ext.MessageBox} this - */ + prompt : function(title, msg, fn, scope, multiline, value){ this.show({ title : title, @@ -42533,86 +26578,36 @@ Ext.MessageBox.ERROR return this; }, - /** - * Button config that displays a single OK button - * @type Object - */ + OK : {ok:true}, - /** - * Button config that displays a single Cancel button - * @type Object - */ + CANCEL : {cancel:true}, - /** - * Button config that displays OK and Cancel buttons - * @type Object - */ + OKCANCEL : {ok:true, cancel:true}, - /** - * Button config that displays Yes and No buttons - * @type Object - */ + YESNO : {yes:true, no:true}, - /** - * Button config that displays Yes, No and Cancel buttons - * @type Object - */ + YESNOCANCEL : {yes:true, no:true, cancel:true}, - /** - * The CSS class that provides the INFO icon image - * @type String - */ + INFO : 'ext-mb-info', - /** - * The CSS class that provides the WARNING icon image - * @type String - */ + WARNING : 'ext-mb-warning', - /** - * The CSS class that provides the QUESTION icon image - * @type String - */ + QUESTION : 'ext-mb-question', - /** - * The CSS class that provides the ERROR icon image - * @type String - */ + ERROR : 'ext-mb-error', - /** - * The default height in pixels of the message box's multiline textarea if displayed (defaults to 75) - * @type Number - */ + defaultTextHeight : 75, - /** - * The maximum width in pixels of the message box (defaults to 600) - * @type Number - */ + maxWidth : 600, - /** - * The minimum width in pixels of the message box (defaults to 100) - * @type Number - */ + minWidth : 100, - /** - * The minimum width in pixels of the message box if it is a progress-style dialog. This is useful - * for setting a different minimum width than text-only dialogs may need (defaults to 250). - * @type Number - */ + minProgressWidth : 250, - /** - * The minimum width in pixels of the message box if it is a prompt dialog. This is useful - * for setting a different minimum width than text-only dialogs may need (defaults to 250). - * @type Number - */ + minPromptWidth: 250, - /** - * An object containing the default button text strings that can be overriden for localized language support. - * Supported properties are: ok, cancel, yes and no. Generally you should include a locale-specific - * resource file for handling language support across the framework. - * Customize the default text like so: Ext.MessageBox.buttonText.yes = "oui"; //french - * @type Object - */ + buttonText : { ok : "OK", cancel : "Cancel", @@ -42622,17 +26617,8 @@ Ext.MessageBox.ERROR }; }(); -/** - * Shorthand for {@link Ext.MessageBox} - */ -Ext.Msg = Ext.MessageBox;/** - * @class Ext.dd.PanelProxy - * A custom drag proxy implementation specific to {@link Ext.Panel}s. This class is primarily used internally - * for the Panel's drag drop implementation, and should never need to be created directly. - * @constructor - * @param panel The {@link Ext.Panel} to proxy for - * @param config Configuration options - */ + +Ext.Msg = Ext.MessageBox; Ext.dd.PanelProxy = function(panel, config){ this.panel = panel; this.id = this.panel.id +'-ddproxy'; @@ -42640,46 +26626,32 @@ Ext.dd.PanelProxy = function(panel, config){ }; Ext.dd.PanelProxy.prototype = { - /** - * @cfg {Boolean} insertProxy True to insert a placeholder proxy element while dragging the panel, - * false to drag with no proxy (defaults to true). - */ + insertProxy : true, - // private overrides + setStatus : Ext.emptyFn, reset : Ext.emptyFn, update : Ext.emptyFn, stop : Ext.emptyFn, sync: Ext.emptyFn, - /** - * Gets the proxy's element - * @return {Element} The proxy's element - */ + getEl : function(){ return this.ghost; }, - /** - * Gets the proxy's ghost element - * @return {Element} The proxy's ghost element - */ + getGhost : function(){ return this.ghost; }, - /** - * Gets the proxy's element - * @return {Element} The proxy's element - */ + getProxy : function(){ return this.proxy; }, - /** - * Hides the proxy - */ + hide : function(){ if(this.ghost){ if(this.proxy){ @@ -42692,9 +26664,7 @@ Ext.dd.PanelProxy.prototype = { } }, - /** - * Shows the proxy - */ + show : function(){ if(!this.ghost){ this.ghost = this.panel.createGhost(undefined, undefined, Ext.getBody()); @@ -42707,7 +26677,7 @@ Ext.dd.PanelProxy.prototype = { } }, - // private + repair : function(xy, callback, scope){ this.hide(); if(typeof callback == "function"){ @@ -42715,13 +26685,7 @@ Ext.dd.PanelProxy.prototype = { } }, - /** - * Moves the proxy to a different position in the DOM. This is typically called while dragging the Panel - * to keep the proxy sync'd to the Panel's location. - * @param {HTMLElement} parentNode The proxy's parent DOM node - * @param {HTMLElement} before (optional) The sibling node before which the proxy should be inserted (defaults - * to the parent's last child if not specified) - */ + moveProxy : function(parentNode, before){ if(this.proxy){ parentNode.insertBefore(this.proxy.dom, before); @@ -42729,7 +26693,7 @@ Ext.dd.PanelProxy.prototype = { } }; -// private - DD implementation for Panels + Ext.Panel.DD = function(panel, cfg){ this.panel = panel; this.dragData = {panel: panel}; @@ -42772,64 +26736,37 @@ Ext.extend(Ext.Panel.DD, Ext.dd.DragSource, { y -= this.startPageY; this.setDelta(x, y); } -});/** - * @class Ext.state.Provider - * Abstract base class for state provider implementations. This class provides methods - * for encoding and decoding typed variables including dates and defines the - * Provider interface. - */ +}); Ext.state.Provider = function(){ - /** - * @event statechange - * Fires when a state change occurs. - * @param {Provider} this This state provider - * @param {String} key The state key which was changed - * @param {String} value The encoded value for the state - */ + this.addEvents("statechange"); this.state = {}; Ext.state.Provider.superclass.constructor.call(this); }; Ext.extend(Ext.state.Provider, Ext.util.Observable, { - /** - * Returns the current value for a key - * @param {String} name The key name - * @param {Mixed} defaultValue A default value to return if the key's value is not found - * @return {Mixed} The state data - */ + get : function(name, defaultValue){ return typeof this.state[name] == "undefined" ? defaultValue : this.state[name]; }, - /** - * Clears a value from the state - * @param {String} name The key name - */ + clear : function(name){ delete this.state[name]; this.fireEvent("statechange", this, name, null); }, - /** - * Sets the value for a key - * @param {String} name The key name - * @param {Mixed} value The value to set - */ + set : function(name, value){ this.state[name] = value; this.fireEvent("statechange", this, name, value); }, - /** - * Decodes a string previously encoded with {@link #encodeValue}. - * @param {String} value The value to decode - * @return {Mixed} The decoded value - */ + decodeValue : function(cookie){ var re = /^(a|n|d|b|s|o)\:(.*)$/; var matches = re.exec(unescape(cookie)); - if(!matches || !matches[1]) return; // non state cookie + if(!matches || !matches[1]) return; var type = matches[1]; var v = matches[2]; switch(type){ @@ -42861,11 +26798,7 @@ Ext.extend(Ext.state.Provider, Ext.util.Observable, { } }, - /** - * Encodes a value including type information. Decode with {@link #decodeValue}. - * @param {Mixed} value The value to encode - * @return {String} The encoded value - */ + encodeValue : function(v){ var enc; if(typeof v == "number"){ @@ -42895,97 +26828,42 @@ Ext.extend(Ext.state.Provider, Ext.util.Observable, { return escape(enc); } }); -/** - * @class Ext.state.Manager - * This is the global state manager. By default all components that are "state aware" check this class - * for state information if you don't pass them a custom state provider. In order for this class - * to be useful, it must be initialized with a provider when your application initializes. Example usage: -
    
    -// in your initialization function
    -init : function(){
    -   Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
    -   var win = new Window(...);
    -   win.restoreState();
    -}
    - 
    - * @singleton - */ + Ext.state.Manager = function(){ var provider = new Ext.state.Provider(); return { - /** - * Configures the default state provider for your application - * @param {Provider} stateProvider The state provider to set - */ + setProvider : function(stateProvider){ provider = stateProvider; }, - /** - * Returns the current value for a key - * @param {String} name The key name - * @param {Mixed} defaultValue The default value to return if the key lookup does not match - * @return {Mixed} The state data - */ + get : function(key, defaultValue){ return provider.get(key, defaultValue); }, - /** - * Sets the value for a key - * @param {String} name The key name - * @param {Mixed} value The state data - */ + set : function(key, value){ provider.set(key, value); }, - /** - * Clears a value from the state - * @param {String} name The key name - */ + clear : function(key){ provider.clear(key); }, - /** - * Gets the currently configured state provider - * @return {Provider} The state provider - */ + getProvider : function(){ return provider; } }; }(); -/** - * @class Ext.state.CookieProvider - * @extends Ext.state.Provider - * The default Provider implementation which saves state via cookies. - *
    Usage: -
    
    -   var cp = new Ext.state.CookieProvider({
    -       path: "/cgi-bin/",
    -       expires: new Date(new Date().getTime()+(1000*60*60*24*30)), //30 days
    -       domain: "extjs.com"
    -   });
    -   Ext.state.Manager.setProvider(cp);
    - 
    - * @cfg {String} path The path for which the cookie is active (defaults to root '/' which makes it active for all pages in the site) - * @cfg {Date} expires The cookie expiration date (defaults to 7 days from now) - * @cfg {String} domain The domain to save the cookie for. Note that you cannot specify a different domain than - * your page is on, but you can specify a sub-domain, or simply the domain itself like 'extjs.com' to include - * all sub-domains if you need to access cookies across different sub-domains (defaults to null which uses the same - * domain the page is running on including the 'www' like 'www.extjs.com') - * @cfg {Boolean} secure True if the site is using SSL (defaults to false) - * @constructor - * Create a new CookieProvider - * @param {Object} config The configuration object - */ + Ext.state.CookieProvider = function(config){ Ext.state.CookieProvider.superclass.constructor.call(this); this.path = "/"; - this.expires = new Date(new Date().getTime()+(1000*60*60*24*7)); //7 days + this.expires = new Date(new Date().getTime()+(1000*60*60*24*7)); this.domain = null; this.secure = false; Ext.apply(this, config); @@ -42993,7 +26871,7 @@ Ext.state.CookieProvider = function(config){ }; Ext.extend(Ext.state.CookieProvider, Ext.state.Provider, { - // private + set : function(name, value){ if(typeof value == "undefined" || value === null){ this.clear(name); @@ -43003,13 +26881,13 @@ Ext.extend(Ext.state.CookieProvider, Ext.state.Provider, { Ext.state.CookieProvider.superclass.set.call(this, name, value); }, - // private + clear : function(name){ this.clearCookie(name); Ext.state.CookieProvider.superclass.clear.call(this, name); }, - // private + readCookies : function(){ var cookies = {}; var c = document.cookie + ";"; @@ -43025,7 +26903,7 @@ Ext.extend(Ext.state.CookieProvider, Ext.state.Provider, { return cookies; }, - // private + setCookie : function(name, value){ document.cookie = "ys-"+ name + "=" + this.encodeValue(value) + ((this.expires == null) ? "" : ("; expires=" + this.expires.toGMTString())) + @@ -43034,142 +26912,40 @@ Ext.extend(Ext.state.CookieProvider, Ext.state.Provider, { ((this.secure == true) ? "; secure" : ""); }, - // private + clearCookie : function(name){ document.cookie = "ys-" + name + "=null; expires=Thu, 01-Jan-70 00:00:01 GMT" + ((this.path == null) ? "" : ("; path=" + this.path)) + ((this.domain == null) ? "" : ("; domain=" + this.domain)) + ((this.secure == true) ? "; secure" : ""); } -});/** - * @class Ext.DataView - * @extends Ext.BoxComponent - * A mechanism for displaying data using custom layout templates and formatting. DataView uses an {@link Ext.XTemplate} - * as its internal templating mechanism, and is bound to an {@link Ext.data.Store} - * so that as the data in the store changes the view is automatically updated to reflect the changes. The view also - * provides built-in behavior for many common events that can occur for its contained items including click, doubleclick, - * mouseover, mouseout, etc. as well as a built-in selection model. In order to use these features, an {@link #itemSelector} - * config must be provided for the DataView to determine what nodes it will be working with. - * - *

    The example below binds a DataView to a {@link Ext.data.Store} and renders it into an {@link Ext.Panel}.

    - *
    
    -var store = new Ext.data.JsonStore({
    -    url: 'get-images.php',
    -    root: 'images',
    -    fields: [
    -        'name', 'url',
    -        {name:'size', type: 'float'},
    -        {name:'lastmod', type:'date', dateFormat:'timestamp'}
    -    ]
     });
    -store.load();
    -
    -var tpl = new Ext.XTemplate(
    -    '<tpl for=".">',
    -        '<div class="thumb-wrap" id="{name}">',
    -        '<div class="thumb"><img src="{url}" title="{name}"></div>',
    -        '<span class="x-editable">{shortName}</span></div>',
    -    '</tpl>',
    -    '<div class="x-clear"></div>'
    -);
    -
    -var panel = new Ext.Panel({
    -    id:'images-view',
    -    frame:true,
    -    width:535,
    -    autoHeight:true,
    -    collapsible:true,
    -    layout:'fit',
    -    title:'Simple DataView',
    -
    -    items: new Ext.DataView({
    -        store: store,
    -        tpl: tpl,
    -        autoHeight:true,
    -        multiSelect: true,
    -        overClass:'x-view-over',
    -        itemSelector:'div.thumb-wrap',
    -        emptyText: 'No images to display'
    -    })
    -});
    -panel.render(document.body);
    -
    - * @constructor - * Create a new DataView - * @param {Object} config The config object - * @xtype dataview - */ Ext.DataView = Ext.extend(Ext.BoxComponent, { - /** - * @cfg {String/Array} tpl - * The HTML fragment or an array of fragments that will make up the template used by this DataView. This should - * be specified in the same format expected by the constructor of {@link Ext.XTemplate}. - */ - /** - * @cfg {Ext.data.Store} store - * The {@link Ext.data.Store} to bind this DataView to. - */ - /** - * @cfg {String} itemSelector - * This is a required setting. A simple CSS selector (e.g. div.some-class or - * span:first-child) that will be used to determine what nodes this DataView will be - * working with. - */ - /** - * @cfg {Boolean} multiSelect - * True to allow selection of more than one item at a time, false to allow selection of only a single item - * at a time or no selection at all, depending on the value of {@link #singleSelect} (defaults to false). - */ - /** - * @cfg {Boolean} singleSelect - * True to allow selection of exactly one item at a time, false to allow no selection at all (defaults to false). - * Note that if {@link #multiSelect} = true, this value will be ignored. - */ - /** - * @cfg {Boolean} simpleSelect - * True to enable multiselection by clicking on multiple items without requiring the user to hold Shift or Ctrl, - * false to force the user to hold Ctrl or Shift to select more than on item (defaults to false). - */ - /** - * @cfg {String} overClass - * A CSS class to apply to each item in the view on mouseover (defaults to undefined). - */ - /** - * @cfg {String} loadingText - * A string to display during data load operations (defaults to undefined). If specified, this text will be - * displayed in a loading div and the view's contents will be cleared while loading, otherwise the view's - * contents will continue to display normally until the new data is loaded and the contents are replaced. - */ - /** - * @cfg {String} selectedClass - * A CSS class to apply to each selected item in the view (defaults to 'x-view-selected'). - */ + + + + + + + + + selectedClass : "x-view-selected", - /** - * @cfg {String} emptyText - * The text to display in the view when there is no data to display (defaults to ''). - */ + emptyText : "", - /** - * @cfg {Boolean} deferEmptyText True to defer emptyText being applied until the store's first load - */ + deferEmptyText: true, - /** - * @cfg {Boolean} trackOver True to enable mouseenter and mouseleave events - */ + trackOver: false, - /** - * @cfg {Boolean} blockRefresh Set this to true to ignore datachanged events on the bound store. This is useful if - * you wish to provide custom transition animations via a plugin (defaults to false) - */ + blockRefresh: false, - //private + last: false, - // private + initComponent : function(){ Ext.DataView.superclass.initComponent.call(this); if(Ext.isString(this.tpl) || Ext.isArray(this.tpl)){ @@ -43177,89 +26953,26 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { } this.addEvents( - /** - * @event beforeclick - * Fires before a click is processed. Returns false to cancel the default action. - * @param {Ext.DataView} this - * @param {Number} index The index of the target node - * @param {HTMLElement} node The target node - * @param {Ext.EventObject} e The raw event object - */ + "beforeclick", - /** - * @event click - * Fires when a template node is clicked. - * @param {Ext.DataView} this - * @param {Number} index The index of the target node - * @param {HTMLElement} node The target node - * @param {Ext.EventObject} e The raw event object - */ + "click", - /** - * @event mouseenter - * Fires when the mouse enters a template node. trackOver:true or an overClass must be set to enable this event. - * @param {Ext.DataView} this - * @param {Number} index The index of the target node - * @param {HTMLElement} node The target node - * @param {Ext.EventObject} e The raw event object - */ + "mouseenter", - /** - * @event mouseleave - * Fires when the mouse leaves a template node. trackOver:true or an overClass must be set to enable this event. - * @param {Ext.DataView} this - * @param {Number} index The index of the target node - * @param {HTMLElement} node The target node - * @param {Ext.EventObject} e The raw event object - */ + "mouseleave", - /** - * @event containerclick - * Fires when a click occurs and it is not on a template node. - * @param {Ext.DataView} this - * @param {Ext.EventObject} e The raw event object - */ + "containerclick", - /** - * @event dblclick - * Fires when a template node is double clicked. - * @param {Ext.DataView} this - * @param {Number} index The index of the target node - * @param {HTMLElement} node The target node - * @param {Ext.EventObject} e The raw event object - */ + "dblclick", - /** - * @event contextmenu - * Fires when a template node is right clicked. - * @param {Ext.DataView} this - * @param {Number} index The index of the target node - * @param {HTMLElement} node The target node - * @param {Ext.EventObject} e The raw event object - */ + "contextmenu", - /** - * @event containercontextmenu - * Fires when a right click occurs that is not on a template node. - * @param {Ext.DataView} this - * @param {Ext.EventObject} e The raw event object - */ + "containercontextmenu", - /** - * @event selectionchange - * Fires when the selected nodes change. - * @param {Ext.DataView} this - * @param {Array} selections Array of the selected nodes - */ + "selectionchange", - /** - * @event beforeselect - * Fires before a selection is made. If any handlers return false, the selection is cancelled. - * @param {Ext.DataView} this - * @param {HTMLElement} node The node to be selected - * @param {Array} selections Array of currently selected nodes - */ + "beforeselect" ); @@ -43268,7 +26981,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { this.selected = new Ext.CompositeElementLite(); }, - // private + afterRender : function(){ Ext.DataView.superclass.afterRender.call(this); @@ -43292,9 +27005,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { } }, - /** - * Refreshes the view by reloading the data from the store and re-rendering the template. - */ + refresh : function() { this.clearSelections(false, true); var el = this.getTemplateTarget(); @@ -43317,31 +27028,12 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { return this.el; }, - /** - * Function which can be overridden to provide custom formatting for each Record that is used by this - * DataView's {@link #tpl template} to render each node. - * @param {Array/Object} data The raw data object that was used to create the Record. - * @param {Number} recordIndex the index number of the Record being prepared for rendering. - * @param {Record} record The Record being prepared for rendering. - * @return {Array/Object} The formatted data in a format expected by the internal {@link #tpl template}'s overwrite() method. - * (either an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})) - */ + prepareData : function(data){ return data; }, - /** - *

    Function which can be overridden which returns the data object passed to this - * DataView's {@link #tpl template} to render the whole DataView.

    - *

    This is usually an Array of data objects, each element of which is processed by an - * {@link Ext.XTemplate XTemplate} which uses '<tpl for=".">' to iterate over its supplied - * data object as an Array. However, named properties may be placed into the data object to - * provide non-repeating data such as headings, totals etc.

    - * @param {Array} records An Array of {@link Ext.data.Record}s to be rendered into the DataView. - * @param {Number} startIndex the index number of the Record being prepared for rendering. - * @return {Array} An Array of data objects to be processed by a repeating XTemplate. May also - * contain named properties. - */ + collectData : function(records, startIndex){ var r = []; for(var i = 0, len = records.length; i < len; i++){ @@ -43350,14 +27042,14 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { return r; }, - // private + bufferRender : function(records){ var div = document.createElement('div'); this.tpl.overwrite(div, this.collectData(records)); return Ext.query(this.itemSelector, div); }, - // private + onUpdate : function(ds, record){ var index = this.store.indexOf(record); if(index > -1){ @@ -43374,7 +27066,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { } }, - // private + onAdd : function(ds, records, index){ if(this.all.getCount() === 0){ this.refresh(); @@ -43391,7 +27083,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { this.updateIndexes(index); }, - // private + onRemove : function(ds, record, index){ this.deselect(index); this.all.removeElement(index, true); @@ -43401,15 +27093,12 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { } }, - /** - * Refreshes an individual node's data from the store. - * @param {Number} index The item's data index in the store - */ + refreshNode : function(index){ this.onUpdate(this.store, this.store.getAt(index)); }, - // private + updateIndexes : function(startIndex, endIndex){ var ns = this.all.elements; startIndex = startIndex || 0; @@ -43419,18 +27108,12 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { } }, - /** - * Returns the store associated with this DataView. - * @return {Ext.data.Store} The store - */ + getStore : function(){ return this.store; }, - /** - * Changes the data store bound to this view and refreshes it. - * @param {Store} store The store to bind to this view - */ + bindStore : function(store, initial){ if(!initial && this.store){ if(store !== this.store && this.store.autoDestroy){ @@ -43465,26 +27148,19 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { } }, - /** - * @private - * Calls this.refresh if this.blockRefresh is not true - */ + onDataChanged: function() { if (this.blockRefresh !== true) { this.refresh.apply(this, arguments); } }, - /** - * Returns the template node the passed child belongs to, or null if it doesn't belong to one. - * @param {HTMLElement} node - * @return {HTMLElement} The template node - */ + findItemFromChild : function(node){ return Ext.fly(node).findParent(this.itemSelector, this.getTemplateTarget()); }, - // private + onClick : function(e){ var item = e.getTarget(this.itemSelector, this.getTemplateTarget()); if(item){ @@ -43503,7 +27179,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { this.clearSelections(); }, - // private + onContextMenu : function(e){ var item = e.getTarget(this.itemSelector, this.getTemplateTarget()); if(item){ @@ -43513,7 +27189,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { } }, - // private + onDblClick : function(e){ var item = e.getTarget(this.itemSelector, this.getTemplateTarget()); if(item){ @@ -43521,7 +27197,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { } }, - // private + onMouseOver : function(e){ var item = e.getTarget(this.itemSelector, this.getTemplateTarget()); if(item && item !== this.lastItem){ @@ -43531,7 +27207,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { } }, - // private + onMouseOut : function(e){ if(this.lastItem){ if(!e.within(this.lastItem, true, true)){ @@ -43542,7 +27218,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { } }, - // private + onItemClick : function(item, index, e){ if(this.fireEvent("beforeclick", this, index, item, e) === false){ return false; @@ -43557,7 +27233,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { return true; }, - // private + doSingleSelection : function(item, index, e){ if(e.ctrlKey && this.isSelected(index)){ this.deselect(index); @@ -43566,12 +27242,12 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { } }, - // private + doMultiSelection : function(item, index, e){ if(e.shiftKey && this.last !== false){ var last = this.last; this.selectRange(last, index, e.ctrlKey); - this.last = last; // reset the last + this.last = last; }else{ if((e.ctrlKey||this.simpleSelect) && this.isSelected(index)){ this.deselect(index); @@ -43581,26 +27257,17 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { } }, - /** - * Gets the number of selected nodes. - * @return {Number} The node count - */ + getSelectionCount : function(){ return this.selected.getCount(); }, - /** - * Gets the currently selected nodes. - * @return {Array} An array of HTMLElements - */ + getSelectedNodes : function(){ return this.selected.elements; }, - /** - * Gets the indexes of the selected nodes. - * @return {Array} An array of numeric indexes - */ + getSelectedIndexes : function(){ var indexes = [], s = this.selected.elements; for(var i = 0, len = s.length; i < len; i++){ @@ -43609,10 +27276,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { return indexes; }, - /** - * Gets an array of the selected records - * @return {Array} An array of {@link Ext.data.Record} objects - */ + getSelectedRecords : function(){ var r = [], s = this.selected.elements; for(var i = 0, len = s.length; i < len; i++){ @@ -43621,11 +27285,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { return r; }, - /** - * Gets an array of the records from an array of nodes - * @param {Array} nodes The nodes to evaluate - * @return {Array} records The {@link Ext.data.Record} objects - */ + getRecords : function(nodes){ var r = [], s = nodes; for(var i = 0, len = s.length; i < len; i++){ @@ -43634,19 +27294,12 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { return r; }, - /** - * Gets a record from a node - * @param {HTMLElement} node The node to evaluate - * @return {Record} record The {@link Ext.data.Record} object - */ + getRecord : function(node){ return this.store.getAt(node.viewIndex); }, - /** - * Clears all selections. - * @param {Boolean} suppressEvent (optional) True to skip firing of the selectionchange event - */ + clearSelections : function(suppressEvent, skipUpdate){ if((this.multiSelect || this.singleSelect) && this.selected.getCount() > 0){ if(!skipUpdate){ @@ -43660,19 +27313,12 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { } }, - /** - * Returns true if the passed node is selected, else false. - * @param {HTMLElement/Number/Ext.data.Record} node The node, node index or record to check - * @return {Boolean} True if selected, else false - */ + isSelected : function(node){ return this.selected.contains(this.getNode(node)); }, - /** - * Deselects a node. - * @param {HTMLElement/Number/Record} node The node, node index or record to deselect - */ + deselect : function(node){ if(this.isSelected(node)){ node = this.getNode(node); @@ -43685,13 +27331,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { } }, - /** - * Selects a set of nodes. - * @param {Array/HTMLElement/String/Number/Ext.data.Record} nodeInfo An HTMLElement template node, index of a template node, - * id of a template node, record associated with a node or an array of any of those to select - * @param {Boolean} keepExisting (optional) true to keep existing selections - * @param {Boolean} suppressEvent (optional) true to skip firing of the selectionchange vent - */ + select : function(nodeInfo, keepExisting, suppressEvent){ if(Ext.isArray(nodeInfo)){ if(!keepExisting){ @@ -43721,12 +27361,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { } }, - /** - * Selects a range of nodes. All nodes between start and end are selected. - * @param {Number} start The index of the first node in the range - * @param {Number} end The index of the last node in the range - * @param {Boolean} keepExisting (optional) True to retain existing selections - */ + selectRange : function(start, end, keepExisting){ if(!keepExisting){ this.clearSelections(true); @@ -43734,12 +27369,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { this.select(this.getNodes(start, end), true); }, - /** - * Gets a template node. - * @param {HTMLElement/String/Number/Ext.data.Record} nodeInfo An HTMLElement template node, index of a template node, - * the id of a template node or the record associated with the node. - * @return {HTMLElement} The node or null if it wasn't found - */ + getNode : function(nodeInfo){ if(Ext.isString(nodeInfo)){ return document.getElementById(nodeInfo); @@ -43752,12 +27382,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { return nodeInfo; }, - /** - * Gets a range nodes. - * @param {Number} start (optional) The index of the first node in the range - * @param {Number} end (optional) The index of the last node in the range - * @return {Array} An array of nodes - */ + getNodes : function(start, end){ var ns = this.all.elements; start = start || 0; @@ -43775,12 +27400,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { return nodes; }, - /** - * Finds the index of the passed node. - * @param {HTMLElement/String/Number/Record} nodeInfo An HTMLElement template node, index of a template node, the id of a template node - * or a record associated with a node. - * @return {Number} The index of the node or -1 - */ + indexOf : function(node){ node = this.getNode(node); if(Ext.isNumber(node.viewIndex)){ @@ -43789,7 +27409,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { return this.all.indexOf(node); }, - // private + onBeforeLoad : function(){ if(this.loadingText){ this.clearSelections(false, true); @@ -43806,201 +27426,31 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { } }); -/** - * Changes the data store bound to this view and refreshes it. (deprecated in favor of bindStore) - * @param {Store} store The store to bind to this view - */ + Ext.DataView.prototype.setStore = Ext.DataView.prototype.bindStore; Ext.reg('dataview', Ext.DataView); -/** - * @class Ext.list.ListView - * @extends Ext.DataView - *

    Ext.list.ListView is a fast and light-weight implentation of a - * {@link Ext.grid.GridPanel Grid} like view with the following characteristics:

    - *
      - *
    • resizable columns
    • - *
    • selectable
    • - *
    • column widths are initially proportioned by percentage based on the container - * width and number of columns
    • - *
    • uses templates to render the data in any required format
    • - *
    • no horizontal scrolling
    • - *
    • no editing
    • - *
    - *

    Example usage:

    - *
    
    -// consume JSON of this form:
    -{
    -   "images":[
    -      {
    -         "name":"dance_fever.jpg",
    -         "size":2067,
    -         "lastmod":1236974993000,
    -         "url":"images\/thumbs\/dance_fever.jpg"
    -      },
    -      {
    -         "name":"zack_sink.jpg",
    -         "size":2303,
    -         "lastmod":1236974993000,
    -         "url":"images\/thumbs\/zack_sink.jpg"
    -      }
    -   ]
    -}
    -var store = new Ext.data.JsonStore({
    -    url: 'get-images.php',
    -    root: 'images',
    -    fields: [
    -        'name', 'url',
    -        {name:'size', type: 'float'},
    -        {name:'lastmod', type:'date', dateFormat:'timestamp'}
    -    ]
    -});
    -store.load();
    -
    -var listView = new Ext.list.ListView({
    -    store: store,
    -    multiSelect: true,
    -    emptyText: 'No images to display',
    -    reserveScrollOffset: true,
    -    columns: [{
    -        header: 'File',
    -        width: .5,
    -        dataIndex: 'name'
    -    },{
    -        header: 'Last Modified',
    -        width: .35,
    -        dataIndex: 'lastmod',
    -        tpl: '{lastmod:date("m-d h:i a")}'
    -    },{
    -        header: 'Size',
    -        dataIndex: 'size',
    -        tpl: '{size:fileSize}', // format using Ext.util.Format.fileSize()
    -        align: 'right'
    -    }]
    -});
    -
    -// put it in a Panel so it looks pretty
    -var panel = new Ext.Panel({
    -    id:'images-view',
    -    width:425,
    -    height:250,
    -    collapsible:true,
    -    layout:'fit',
    -    title:'Simple ListView (0 items selected)',
    -    items: listView
    -});
    -panel.render(document.body);
     
    -// little bit of feedback
    -listView.on('selectionchange', function(view, nodes){
    -    var l = nodes.length;
    -    var s = l != 1 ? 's' : '';
    -    panel.setTitle('Simple ListView ('+l+' item'+s+' selected)');
    -});
    - * 
    - * @constructor - * @param {Object} config - * @xtype listview - */ Ext.list.ListView = Ext.extend(Ext.DataView, { - /** - * Set this property to true to disable the header click handler disabling sort - * (defaults to false). - * @type Boolean - * @property disableHeaders - */ - /** - * @cfg {Boolean} hideHeaders - * true to hide the {@link #internalTpl header row} (defaults to false so - * the {@link #internalTpl header row} will be shown). - */ - /** - * @cfg {String} itemSelector - * Defaults to 'dl' to work with the preconfigured {@link Ext.DataView#tpl tpl}. - * This setting specifies the CSS selector (e.g. div.some-class or span:first-child) - * that will be used to determine what nodes the ListView will be working with. - */ + + + itemSelector: 'dl', - /** - * @cfg {String} selectedClass The CSS class applied to a selected row (defaults to - * 'x-list-selected'). An example overriding the default styling: -
    
    -    .x-list-selected {background-color: yellow;}
    -    
    - * @type String - */ + selectedClass:'x-list-selected', - /** - * @cfg {String} overClass The CSS class applied when over a row (defaults to - * 'x-list-over'). An example overriding the default styling: -
    
    -    .x-list-over {background-color: orange;}
    -    
    - * @type String - */ + overClass:'x-list-over', - /** - * @cfg {Boolean} reserveScrollOffset - * By default will defer accounting for the configured {@link #scrollOffset} - * for 10 milliseconds. Specify true to account for the configured - * {@link #scrollOffset} immediately. - */ - /** - * @cfg {Number} scrollOffset The amount of space to reserve for the scrollbar (defaults to - * undefined). If an explicit value isn't specified, this will be automatically - * calculated. - */ + + scrollOffset : undefined, - /** - * @cfg {Boolean/Object} columnResize - * Specify true or specify a configuration object for {@link Ext.list.ListView.ColumnResizer} - * to enable the columns to be resizable (defaults to true). - */ + columnResize: true, - /** - * @cfg {Array} columns An array of column configuration objects, for example: - *
    
    -{
    -    align: 'right',
    -    dataIndex: 'size',
    -    header: 'Size',
    -    tpl: '{size:fileSize}',
    -    width: .35
    -}
    -     * 
    - * Acceptable properties for each column configuration object are: - *
      - *
    • align : String
      Set the CSS text-align property - * of the column. Defaults to 'left'.
    • - *
    • dataIndex : String
      See {@link Ext.grid.Column}. - * {@link Ext.grid.Column#dataIndex dataIndex} for details.
    • - *
    • header : String
      See {@link Ext.grid.Column}. - * {@link Ext.grid.Column#header header} for details.
    • - *
    • tpl : String
      Specify a string to pass as the - * configuration string for {@link Ext.XTemplate}. By default an {@link Ext.XTemplate} - * will be implicitly created using the dataIndex.
    • - *
    • width : Number
      Percentage of the container width - * this column should be allocated. Columns that have no width specified will be - * allocated with an equal percentage to fill 100% of the container width. To easily take - * advantage of the full container width, leave the width of at least one column undefined. - * Note that if you do not want to take up the full width of the container, the width of - * every column needs to be explicitly defined.
    • - *
    - */ - /** - * @cfg {Boolean/Object} columnSort - * Specify true or specify a configuration object for {@link Ext.list.ListView.Sorter} - * to enable the columns to be sortable (defaults to true). - */ + + columnSort: true, - /** - * @cfg {String/Array} internalTpl - * The template to be used for the header row. See {@link #tpl} for more details. - */ + - /* - * IE has issues when setting percentage based widths to 100%. Default to 99. - */ + maxWidth: Ext.isIE ? 99 : 100, initComponent : function(){ @@ -44063,7 +27513,7 @@ Ext.list.ListView = Ext.extend(Ext.DataView, { cs = this.columns = columns; - // auto calculate missing column widths + if(colsWithWidth < len){ var remaining = len - colsWithWidth; if(allocatedWidth < this.maxWidth){ @@ -44099,20 +27549,7 @@ Ext.list.ListView = Ext.extend(Ext.DataView, { return this.innerBody; }, - /** - *

    Function which can be overridden which returns the data object passed to this - * view's {@link #tpl template} to render the whole ListView. The returned object - * shall contain the following properties:

    - *
      - *
    • columns : String
      See {@link #columns}
    • - *
    • rows : String
      See - * {@link Ext.DataView}.{@link Ext.DataView#collectData collectData}
    • - *
    - * @param {Array} records An Array of {@link Ext.data.Record}s to be rendered into the DataView. - * @param {Number} startIndex the index number of the Record being prepared for rendering. - * @return {Object} A data object containing properties to be processed by a repeating - * XTemplate as described above. - */ + collectData : function(){ var rs = Ext.list.ListView.superclass.collectData.apply(this, arguments); return { @@ -44127,7 +27564,7 @@ Ext.list.ListView = Ext.extend(Ext.DataView, { } }, - // private + onResize : function(w, h){ var bd = this.innerBody.dom; var hd = this.innerHd.dom; @@ -44182,63 +27619,26 @@ Ext.list.ListView = Ext.extend(Ext.DataView, { Ext.reg('listview', Ext.list.ListView); -// Backwards compatibility alias -Ext.ListView = Ext.list.ListView;/** - * @class Ext.list.Column - *

    This class encapsulates column configuration data to be used in the initialization of a - * {@link Ext.list.ListView ListView}.

    - *

    While subclasses are provided to render data in different ways, this class renders a passed - * data field unchanged and is usually used for textual columns.

    - */ + +Ext.ListView = Ext.list.ListView; Ext.list.Column = Ext.extend(Object, { - /** - * @private - * @cfg {Boolean} isColumn - * Used by ListView constructor method to avoid reprocessing a Column - * if isColumn is not set ListView will recreate a new Ext.list.Column - * Defaults to true. - */ + isColumn: true, - /** - * @cfg {String} align - * Set the CSS text-align property of the column. Defaults to 'left'. - */ + align: 'left', - /** - * @cfg {String} header Optional. The header text to be used as innerHTML - * (html tags are accepted) to display in the ListView. Note: to - * have a clickable header with no text displayed use ' '. - */ + header: '', - /** - * @cfg {Number} width Optional. Percentage of the container width - * this column should be allocated. Columns that have no width specified will be - * allocated with an equal percentage to fill 100% of the container width. To easily take - * advantage of the full container width, leave the width of at least one column undefined. - * Note that if you do not want to take up the full width of the container, the width of - * every column needs to be explicitly defined. - */ + width: null, - /** - * @cfg {String} cls Optional. This option can be used to add a CSS class to the cell of each - * row for this column. - */ + cls: '', - /** - * @cfg {String} tpl Optional. Specify a string to pass as the - * configuration string for {@link Ext.XTemplate}. By default an {@link Ext.XTemplate} - * will be implicitly created using the dataIndex. - */ + - /** - * @cfg {String} dataIndex

    Required. The name of the field in the - * ListViews's {@link Ext.data.Store}'s {@link Ext.data.Record} definition from - * which to draw the column's value.

    - */ + constructor : function(c){ if(!c.tpl){ @@ -44254,18 +27654,9 @@ Ext.list.Column = Ext.extend(Object, { Ext.reg('lvcolumn', Ext.list.Column); -/** - * @class Ext.list.NumberColumn - * @extends Ext.list.Column - *

    A Column definition class which renders a numeric data field according to a {@link #format} string. See the - * {@link Ext.list.Column#xtype xtype} config option of {@link Ext.list.Column} for more details.

    - */ + Ext.list.NumberColumn = Ext.extend(Ext.list.Column, { - /** - * @cfg {String} format - * A formatting string as used by {@link Ext.util.Format#number} to format a numeric value for this Column - * (defaults to '0,000.00'). - */ + format: '0,000.00', constructor : function(c) { @@ -44276,13 +27667,7 @@ Ext.list.NumberColumn = Ext.extend(Ext.list.Column, { Ext.reg('lvnumbercolumn', Ext.list.NumberColumn); -/** - * @class Ext.list.DateColumn - * @extends Ext.list.Column - *

    A Column definition class which renders a passed date according to the default locale, or a configured - * {@link #format}. See the {@link Ext.list.Column#xtype xtype} config option of {@link Ext.list.Column} - * for more details.

    - */ + Ext.list.DateColumn = Ext.extend(Ext.list.Column, { format: 'm/d/Y', constructor : function(c) { @@ -44292,28 +27677,13 @@ Ext.list.DateColumn = Ext.extend(Ext.list.Column, { }); Ext.reg('lvdatecolumn', Ext.list.DateColumn); -/** - * @class Ext.list.BooleanColumn - * @extends Ext.list.Column - *

    A Column definition class which renders boolean data fields. See the {@link Ext.list.Column#xtype xtype} - * config option of {@link Ext.list.Column} for more details.

    - */ + Ext.list.BooleanColumn = Ext.extend(Ext.list.Column, { - /** - * @cfg {String} trueText - * The string returned by the renderer when the column value is not falsey (defaults to 'true'). - */ + trueText: 'true', - /** - * @cfg {String} falseText - * The string returned by the renderer when the column value is falsey (but not undefined) (defaults to - * 'false'). - */ + falseText: 'false', - /** - * @cfg {String} undefinedText - * The string returned by the renderer when the column value is undefined (defaults to ' '). - */ + undefinedText: ' ', constructor : function(c) { @@ -44334,17 +27704,9 @@ Ext.list.BooleanColumn = Ext.extend(Ext.list.Column, { } }); -Ext.reg('lvbooleancolumn', Ext.list.BooleanColumn);/** - * @class Ext.list.ColumnResizer - * @extends Ext.util.Observable - *

    Supporting Class for Ext.list.ListView

    - * @constructor - * @param {Object} config - */ +Ext.reg('lvbooleancolumn', Ext.list.BooleanColumn); Ext.list.ColumnResizer = Ext.extend(Ext.util.Observable, { - /** - * @cfg {Number} minPct The minimum percentage to allot for any column (defaults to .05) - */ + minPct: .05, constructor: function(config){ @@ -44421,7 +27783,7 @@ Ext.list.ColumnResizer = Ext.extend(Ext.util.Observable, { }, onEnd: function(e){ - /* calculate desired width by measuring proxy and then remove it */ + var nw = this.proxy.getWidth(); this.proxy.remove(); @@ -44455,19 +27817,10 @@ Ext.list.ColumnResizer = Ext.extend(Ext.util.Observable, { } }); -// Backwards compatibility alias -Ext.ListView.ColumnResizer = Ext.list.ColumnResizer;/** - * @class Ext.list.Sorter - * @extends Ext.util.Observable - *

    Supporting Class for Ext.list.ListView

    - * @constructor - * @param {Object} config - */ + +Ext.ListView.ColumnResizer = Ext.list.ColumnResizer; Ext.list.Sorter = Ext.extend(Ext.util.Observable, { - /** - * @cfg {Array} sortClasses - * The CSS classes applied to a header when it is sorted. (defaults to ["sort-asc", "sort-desc"]) - */ + sortClasses : ["sort-asc", "sort-desc"], constructor: function(config){ @@ -44521,292 +27874,71 @@ Ext.list.Sorter = Ext.extend(Ext.util.Observable, { } }); -// Backwards compatibility alias -Ext.ListView.Sorter = Ext.list.Sorter;/** - * @class Ext.TabPanel - *

    A basic tab container. TabPanels can be used exactly like a standard {@link Ext.Panel} - * for layout purposes, but also have special support for containing child Components - * ({@link Ext.Container#items items}) that are managed using a - * {@link Ext.layout.CardLayout CardLayout layout manager}, and displayed as separate tabs.

    - * - * Note: By default, a tab's close tool destroys the child tab Component - * and all its descendants. This makes the child tab Component, and all its descendants unusable. To enable - * re-use of a tab, configure the TabPanel with {@link #autoDestroy autoDestroy: false}. - * - *

    TabPanel header/footer elements

    - *

    TabPanels use their {@link Ext.Panel#header header} or {@link Ext.Panel#footer footer} element - * (depending on the {@link #tabPosition} configuration) to accommodate the tab selector buttons. - * This means that a TabPanel will not display any configured title, and will not display any - * configured header {@link Ext.Panel#tools tools}.

    - *

    To display a header, embed the TabPanel in a {@link Ext.Panel Panel} which uses - * {@link Ext.Container#layout layout:'fit'}.

    - * - *

    Tab Events

    - *

    There is no actual tab class — each tab is simply a {@link Ext.BoxComponent Component} - * such as a {@link Ext.Panel Panel}. However, when rendered in a TabPanel, each child Component - * can fire additional events that only exist for tabs and are not available from other Components. - * These events are:

    - *
      - *
    • {@link Ext.Panel#activate activate} : Fires when this Component becomes - * the active tab.
    • - *
    • {@link Ext.Panel#deactivate deactivate} : Fires when the Component that - * was the active tab becomes deactivated.
    • - *
    • {@link Ext.Panel#beforeclose beforeclose} : Fires when the user clicks on the close tool of a closeable tab. - * May be vetoed by returning false from a handler.
    • - *
    • {@link Ext.Panel#close close} : Fires a closeable tab has been closed by the user.
    • - *
    - *

    Creating TabPanels from Code

    - *

    TabPanels can be created and rendered completely in code, as in this example:

    - *
    
    -var tabs = new Ext.TabPanel({
    -    renderTo: Ext.getBody(),
    -    activeTab: 0,
    -    items: [{
    -        title: 'Tab 1',
    -        html: 'A simple tab'
    -    },{
    -        title: 'Tab 2',
    -        html: 'Another one'
    -    }]
    -});
    -
    - *

    Creating TabPanels from Existing Markup

    - *

    TabPanels can also be rendered from pre-existing markup in a couple of ways.

    - *
      - * - *
    • Pre-Structured Markup
    • - *
      - *

      A container div with one or more nested tab divs with class 'x-tab' can be rendered entirely - * from existing markup (See the {@link #autoTabs} example).

      - *
      - * - *
    • Un-Structured Markup
    • - *
      - *

      A TabPanel can also be rendered from markup that is not strictly structured by simply specifying by id - * which elements should be the container and the tabs. Using this method tab content can be pulled from different - * elements within the page by id regardless of page structure. For example:

      - *
      
      -var tabs = new Ext.TabPanel({
      -    renderTo: 'my-tabs',
      -    activeTab: 0,
      -    items:[
      -        {contentEl:'tab1', title:'Tab 1'},
      -        {contentEl:'tab2', title:'Tab 2'}
      -    ]
      -});
       
      -// Note that the tabs do not have to be nested within the container (although they can be)
      -<div id="my-tabs"></div>
      -<div id="tab1" class="x-hide-display">A simple tab</div>
      -<div id="tab2" class="x-hide-display">Another one</div>
      -
      - * Note that the tab divs in this example contain the class 'x-hide-display' so that they can be rendered - * deferred without displaying outside the tabs. You could alternately set {@link #deferredRender} = false - * to render all content tabs on page load. - *
      - * - *
    - * - * @extends Ext.Panel - * @constructor - * @param {Object} config The configuration options - * @xtype tabpanel - */ +Ext.ListView.Sorter = Ext.list.Sorter; Ext.TabPanel = Ext.extend(Ext.Panel, { - /** - * @cfg {Boolean} layoutOnTabChange - * Set to true to force a layout of the active tab when the tab is changed. Defaults to false. - * See {@link Ext.layout.CardLayout}.{@link Ext.layout.CardLayout#layoutOnCardChange layoutOnCardChange}. - */ - /** - * @cfg {String} tabCls This config option is used on child Components of ths TabPanel. A CSS - * class name applied to the tab strip item representing the child Component, allowing special - * styling to be applied. - */ - /** - * @cfg {Boolean} deferredRender - *

    true by default to defer the rendering of child {@link Ext.Container#items items} - * to the browsers DOM until a tab is activated. false will render all contained - * {@link Ext.Container#items items} as soon as the {@link Ext.layout.CardLayout layout} - * is rendered. If there is a significant amount of content or a lot of heavy controls being - * rendered into panels that are not displayed by default, setting this to true might - * improve performance.

    - *

    The deferredRender property is internally passed to the layout manager for - * TabPanels ({@link Ext.layout.CardLayout}) as its {@link Ext.layout.CardLayout#deferredRender} - * configuration value.

    - *

    Note: leaving deferredRender as true means that the content - * within an unactivated tab will not be available. For example, this means that if the TabPanel - * is within a {@link Ext.form.FormPanel form}, then until a tab is activated, any Fields within - * unactivated tabs will not be rendered, and will therefore not be submitted and will not be - * available to either {@link Ext.form.BasicForm#getValues getValues} or - * {@link Ext.form.BasicForm#setValues setValues}.

    - */ + + + deferredRender : true, - /** - * @cfg {Number} tabWidth The initial width in pixels of each new tab (defaults to 120). - */ + tabWidth : 120, - /** - * @cfg {Number} minTabWidth The minimum width in pixels for each tab when {@link #resizeTabs} = true (defaults to 30). - */ + minTabWidth : 30, - /** - * @cfg {Boolean} resizeTabs True to automatically resize each tab so that the tabs will completely fill the - * tab strip (defaults to false). Setting this to true may cause specific widths that might be set per tab to - * be overridden in order to fit them all into view (although {@link #minTabWidth} will always be honored). - */ + resizeTabs : false, - /** - * @cfg {Boolean} enableTabScroll True to enable scrolling to tabs that may be invisible due to overflowing the - * overall TabPanel width. Only available with tabPosition:'top' (defaults to false). - */ + enableTabScroll : false, - /** - * @cfg {Number} scrollIncrement The number of pixels to scroll each time a tab scroll button is pressed - * (defaults to 100, or if {@link #resizeTabs} = true, the calculated tab width). Only - * applies when {@link #enableTabScroll} = true. - */ + scrollIncrement : 0, - /** - * @cfg {Number} scrollRepeatInterval Number of milliseconds between each scroll while a tab scroll button is - * continuously pressed (defaults to 400). - */ + scrollRepeatInterval : 400, - /** - * @cfg {Float} scrollDuration The number of milliseconds that each scroll animation should last (defaults - * to .35). Only applies when {@link #animScroll} = true. - */ + scrollDuration : 0.35, - /** - * @cfg {Boolean} animScroll True to animate tab scrolling so that hidden tabs slide smoothly into view (defaults - * to true). Only applies when {@link #enableTabScroll} = true. - */ + animScroll : true, - /** - * @cfg {String} tabPosition The position where the tab strip should be rendered (defaults to 'top'). - * The only other supported value is 'bottom'. Note: tab scrolling is only supported for - * tabPosition: 'top'. - */ + tabPosition : 'top', - /** - * @cfg {String} baseCls The base CSS class applied to the panel (defaults to 'x-tab-panel'). - */ + baseCls : 'x-tab-panel', - /** - * @cfg {Boolean} autoTabs - *

    true to query the DOM for any divs with a class of 'x-tab' to be automatically converted - * to tabs and added to this panel (defaults to false). Note that the query will be executed within - * the scope of the container element only (so that multiple tab panels from markup can be supported via this - * method).

    - *

    This method is only possible when the markup is structured correctly as a container with nested divs - * containing the class 'x-tab'. To create TabPanels without these limitations, or to pull tab content - * from other elements on the page, see the example at the top of the class for generating tabs from markup.

    - *

    There are a couple of things to note when using this method:

      - *
    • When using the autoTabs config (as opposed to passing individual tab configs in the TabPanel's - * {@link #items} collection), you must use {@link #applyTo} to correctly use the specified id - * as the tab container. The autoTabs method replaces existing content with the TabPanel - * components.
    • - *
    • Make sure that you set {@link #deferredRender}: false so that the content elements for each - * tab will be rendered into the TabPanel immediately upon page load, otherwise they will not be transformed - * until each tab is activated and will be visible outside the TabPanel.
    • - *
    Example usage:

    - *
    
    -var tabs = new Ext.TabPanel({
    -    applyTo: 'my-tabs',
    -    activeTab: 0,
    -    deferredRender: false,
    -    autoTabs: true
    -});
    -
    -// This markup will be converted to a TabPanel from the code above
    -<div id="my-tabs">
    -    <div class="x-tab" title="Tab 1">A simple tab</div>
    -    <div class="x-tab" title="Tab 2">Another one</div>
    -</div>
    -
    - */ + autoTabs : false, - /** - * @cfg {String} autoTabSelector The CSS selector used to search for tabs in existing markup when - * {@link #autoTabs} = true (defaults to 'div.x-tab'). This can be any valid selector - * supported by {@link Ext.DomQuery#select}. Note that the query will be executed within the scope of this - * tab panel only (so that multiple tab panels from markup can be supported on a page). - */ + autoTabSelector : 'div.x-tab', - /** - * @cfg {String/Number} activeTab A string id or the numeric index of the tab that should be initially - * activated on render (defaults to undefined). - */ + activeTab : undefined, - /** - * @cfg {Number} tabMargin The number of pixels of space to calculate into the sizing and scrolling of - * tabs. If you change the margin in CSS, you will need to update this value so calculations are correct - * with either {@link #resizeTabs} or scrolling tabs. (defaults to 2) - */ + tabMargin : 2, - /** - * @cfg {Boolean} plain
    true to render the tab strip without a background container image - * (defaults to false). - */ + plain : false, - /** - * @cfg {Number} wheelIncrement For scrolling tabs, the number of pixels to increment on mouse wheel - * scrolling (defaults to 20). - */ + wheelIncrement : 20, - /* - * This is a protected property used when concatenating tab ids to the TabPanel id for internal uniqueness. - * It does not generally need to be changed, but can be if external code also uses an id scheme that can - * potentially clash with this one. - */ + idDelimiter : '__', - // private + itemCls : 'x-tab-item', - // private config overrides + elements : 'body', headerAsText : false, frame : false, hideBorders :true, - // private + initComponent : function(){ this.frame = false; Ext.TabPanel.superclass.initComponent.call(this); this.addEvents( - /** - * @event beforetabchange - * Fires before the active tab changes. Handlers can return false to cancel the tab change. - * @param {TabPanel} this - * @param {Panel} newTab The tab being activated - * @param {Panel} currentTab The current active tab - */ + 'beforetabchange', - /** - * @event tabchange - * Fires after the active tab has changed. - * @param {TabPanel} this - * @param {Panel} tab The new active tab - */ + 'tabchange', - /** - * @event contextmenu - * Relays the contextmenu event from a tab selector element in the tab strip. - * @param {TabPanel} this - * @param {Panel} tab The target tab - * @param {EventObject} e - */ + 'contextmenu' ); - /** - * @cfg {Object} layoutConfig - * TabPanel implicitly uses {@link Ext.layout.CardLayout} as its layout manager. - * layoutConfig may be used to configure this layout manager. - * {@link #deferredRender} and {@link #layoutOnTabChange} - * configured on the TabPanel will be applied as configs to the layout manager. - */ + this.setLayout(new Ext.layout.CardLayout(Ext.apply({ layoutOnCardChange: this.layoutOnTabChange, deferredRender: this.deferredRender @@ -44825,7 +27957,7 @@ var tabs = new Ext.TabPanel({ this.initItems(); }, - // private + onRender : function(ct, position){ Ext.TabPanel.superclass.onRender.call(this, ct, position); @@ -44843,74 +27975,13 @@ var tabs = new Ext.TabPanel({ st.createChild({cls:'x-tab-strip-spacer'}, beforeEl); this.strip = new Ext.Element(this.stripWrap.dom.firstChild); - // create an empty span with class x-tab-strip-text to force the height of the header element when there's no tabs. + this.edge = this.strip.createChild({tag:'li', cls:'x-tab-edge', cn: [{tag: 'span', cls: 'x-tab-strip-text', cn: ' '}]}); this.strip.createChild({cls:'x-clear'}); this.body.addClass('x-tab-panel-body-'+this.tabPosition); - /** - * @cfg {Template/XTemplate} itemTpl

    (Optional) A {@link Ext.Template Template} or - * {@link Ext.XTemplate XTemplate} which may be provided to process the data object returned from - * {@link #getTemplateArgs} to produce a clickable selector element in the tab strip.

    - *

    The main element created should be a <li> element. In order for a click event on - * a selector element to be connected to its item, it must take its id from the TabPanel's - * native {@link #getTemplateArgs}.

    - *

    The child element which contains the title text must be marked by the CSS class - * x-tab-strip-inner.

    - *

    To enable closability, the created element should contain an element marked by the CSS class - * x-tab-strip-close.

    - *

    If a custom itemTpl is supplied, it is the developer's responsibility to create CSS - * style rules to create the desired appearance.

    - * Below is an example of how to create customized tab selector items:
    
    -new Ext.TabPanel({
    -    renderTo: document.body,
    -    minTabWidth: 115,
    -    tabWidth: 135,
    -    enableTabScroll: true,
    -    width: 600,
    -    height: 250,
    -    defaults: {autoScroll:true},
    -    itemTpl: new Ext.XTemplate(
    -    '<li class="{cls}" id="{id}" style="overflow:hidden">',
    -         '<tpl if="closable">',
    -            '<a class="x-tab-strip-close"></a>',
    -         '</tpl>',
    -         '<a class="x-tab-right" href="#" style="padding-left:6px">',
    -            '<em class="x-tab-left">',
    -                '<span class="x-tab-strip-inner">',
    -                    '<img src="{src}" style="float:left;margin:3px 3px 0 0">',
    -                    '<span style="margin-left:20px" class="x-tab-strip-text {iconCls}">{text} {extra}</span>',
    -                '</span>',
    -            '</em>',
    -        '</a>',
    -    '</li>'
    -    ),
    -    getTemplateArgs: function(item) {
    -//      Call the native method to collect the base data. Like the ID!
    -        var result = Ext.TabPanel.prototype.getTemplateArgs.call(this, item);
    -
    -//      Add stuff used in our template
    -        return Ext.apply(result, {
    -            closable: item.closable,
    -            src: item.iconSrc,
    -            extra: item.extraText || ''
    -        });
    -    },
    -    items: [{
    -        title: 'New Tab 1',
    -        iconSrc: '../shared/icons/fam/grid.png',
    -        html: 'Tab Body 1',
    -        closable: true
    -    }, {
    -        title: 'New Tab 2',
    -        iconSrc: '../shared/icons/fam/grid.png',
    -        html: 'Tab Body 2',
    -        extraText: 'Extra stuff in the tab button'
    -    }]
    -});
    -
    - */ + if(!this.itemTpl){ var tt = new Ext.Template( '
  • ', @@ -44926,7 +27997,7 @@ new Ext.TabPanel({ this.items.each(this.initTab, this); }, - // private + afterRender : function(){ Ext.TabPanel.superclass.afterRender.call(this); if(this.autoTabs){ @@ -44939,7 +28010,7 @@ new Ext.TabPanel({ } }, - // private + initEvents : function(){ Ext.TabPanel.superclass.initEvents.call(this); this.mon(this.strip, { @@ -44952,7 +28023,7 @@ new Ext.TabPanel({ } }, - // private + findTargets : function(e){ var item = null, itemEl = e.getTarget('li:not(.x-tab-edge)', this.strip); @@ -44974,7 +28045,7 @@ new Ext.TabPanel({ }; }, - // private + onStripMouseDown : function(e){ if(e.button !== 0){ return; @@ -44993,7 +28064,7 @@ new Ext.TabPanel({ } }, - // private + onStripContextMenu : function(e){ e.preventDefault(); var t = this.findTargets(e); @@ -45002,11 +28073,7 @@ new Ext.TabPanel({ } }, - /** - * True to scan the markup in this tab panel for {@link #autoTabs} using the - * {@link #autoTabSelector} - * @param {Boolean} removeExisting True to remove existing tabs - */ + readTabs : function(removeExisting){ if(removeExisting === true){ this.items.each(function(item){ @@ -45025,7 +28092,7 @@ new Ext.TabPanel({ } }, - // private + initTab : function(item, index){ var before = this.strip.dom.childNodes[index], p = this.getTemplateArgs(item), @@ -45048,7 +28115,7 @@ new Ext.TabPanel({ } item.tabEl = el; - // Route *keyboard triggered* click events to the tab strip mouse handler. + tabEl.select('a').on('click', function(e){ if(!e.getPageX()){ this.onStripMouseDown(e); @@ -45067,19 +28134,7 @@ new Ext.TabPanel({ - /** - *

    Provides template arguments for rendering a tab selector item in the tab strip.

    - *

    This method returns an object hash containing properties used by the TabPanel's {@link #itemTpl} - * to create a formatted, clickable tab selector element. The properties which must be returned - * are:

      - *
    • id : String
      A unique identifier which links to the item
    • - *
    • text : String
      The text to display
    • - *
    • cls : String
      The CSS class name
    • - *
    • iconCls : String
      A CSS class to provide appearance for an icon.
    • - *
    - * @param {Ext.BoxComponent} item The {@link Ext.BoxComponent BoxComponent} for which to create a selector element in the tab strip. - * @return {Object} An object hash containing the properties required to render the selector element. - */ + getTemplateArgs : function(item) { var cls = item.closable ? 'x-tab-strip-closable' : ''; if(item.disabled){ @@ -45100,20 +28155,17 @@ new Ext.TabPanel({ }; }, - // private + onAdd : function(c){ Ext.TabPanel.superclass.onAdd.call(this, c); if(this.rendered){ var items = this.items; this.initTab(c, items.indexOf(c)); - if(items.getCount() == 1 && !this.collapsed){ - this.syncSize(); - } this.delegateUpdates(); } }, - // private + onBeforeAdd : function(item){ var existing = item.events ? (this.items.containsKey(item.getItemId()) ? item : null) : this.items.get(item); if(existing){ @@ -45126,10 +28178,10 @@ new Ext.TabPanel({ item.border = (item.border === true); }, - // private + onRemove : function(c){ var te = Ext.get(c.tabEl); - // check if the tabEl exists, it won't if the tab isn't rendered + if(te){ te.select('a').removeAllListeners(); Ext.destroy(te); @@ -45157,7 +28209,7 @@ new Ext.TabPanel({ } }, - // private + onBeforeShowItem : function(item){ if(item != this.activeTab){ this.setActiveTab(item); @@ -45165,7 +28217,7 @@ new Ext.TabPanel({ } }, - // private + onItemDisabled : function(item){ var el = this.getTabEl(item); if(el){ @@ -45174,7 +28226,7 @@ new Ext.TabPanel({ this.stack.remove(item); }, - // private + onItemEnabled : function(item){ var el = this.getTabEl(item); if(el){ @@ -45182,7 +28234,7 @@ new Ext.TabPanel({ } }, - // private + onItemTitleChanged : function(item){ var el = this.getTabEl(item); if(el){ @@ -45190,7 +28242,7 @@ new Ext.TabPanel({ } }, - //private + onItemIconChanged : function(item, iconCls, oldCls){ var el = this.getTabEl(item); if(el){ @@ -45200,42 +28252,30 @@ new Ext.TabPanel({ } }, - /** - * Gets the DOM element for the tab strip item which activates the child panel with the specified - * ID. Access this to change the visual treatment of the item, for example by changing the CSS class name. - * @param {Panel/Number/String} tab The tab component, or the tab's index, or the tabs id or itemId. - * @return {HTMLElement} The DOM node - */ + getTabEl : function(item){ var c = this.getComponent(item); return c ? c.tabEl : null; }, - // private + onResize : function(){ Ext.TabPanel.superclass.onResize.apply(this, arguments); this.delegateUpdates(); }, - /** - * Suspends any internal calculations or scrolling while doing a bulk operation. See {@link #endUpdate} - */ + beginUpdate : function(){ this.suspendUpdates = true; }, - /** - * Resumes calculations and scrolling at the end of a bulk operation. See {@link #beginUpdate} - */ + endUpdate : function(){ this.suspendUpdates = false; this.delegateUpdates(); }, - /** - * Hides the tab strip item for the passed tab - * @param {Number/String/Panel} item The tab index, id or item - */ + hideTabStripItem : function(item){ item = this.getComponent(item); var el = this.getTabEl(item); @@ -45246,10 +28286,7 @@ new Ext.TabPanel({ this.stack.remove(item); }, - /** - * Unhides the tab strip item for the passed tab - * @param {Number/String/Panel} item The tab index, id or item - */ + unhideTabStripItem : function(item){ item = this.getComponent(item); var el = this.getTabEl(item); @@ -45259,7 +28296,7 @@ new Ext.TabPanel({ } }, - // private + delegateUpdates : function(){ if(this.suspendUpdates){ return; @@ -45272,18 +28309,18 @@ new Ext.TabPanel({ } }, - // private + autoSizeTabs : function(){ var count = this.items.length, ce = this.tabPosition != 'bottom' ? 'header' : 'footer', ow = this[ce].dom.offsetWidth, aw = this[ce].dom.clientWidth; - if(!this.resizeTabs || count < 1 || !aw){ // !aw for display:none + if(!this.resizeTabs || count < 1 || !aw){ return; } - var each = Math.max(Math.min(Math.floor((aw-4) / count) - this.tabMargin, this.tabWidth), this.minTabWidth); // -4 for float errors in IE + var each = Math.max(Math.min(Math.floor((aw-4) / count) - this.tabMargin, this.tabWidth), this.minTabWidth); this.lastTabWidth = each; var lis = this.strip.query('li:not(.x-tab-edge)'); for(var i = 0, len = lis.length; i < len; i++) { @@ -45295,7 +28332,7 @@ new Ext.TabPanel({ } }, - // private + adjustBodyWidth : function(w){ if(this.header){ this.header.setWidth(w); @@ -45306,19 +28343,7 @@ new Ext.TabPanel({ return w; }, - /** - * Sets the specified tab as the active tab. This method fires the {@link #beforetabchange} event which - * can return false to cancel the tab change. - * @param {String/Number} item - * The id or tab Panel to activate. This parameter may be any of the following: - *
      - *
    • a String : representing the {@link Ext.Component#itemId itemId} - * or {@link Ext.Component#id id} of the child component
    • - *
    • a Number : representing the position of the child component - * within the {@link Ext.Container#items items} property
    • - *
    - *

    For additional information see {@link Ext.util.MixedCollection#get}. - */ + setActiveTab : function(item){ item = this.getComponent(item); if(this.fireEvent('beforetabchange', this, item, this.activeTab) === false){ @@ -45335,10 +28360,10 @@ new Ext.TabPanel({ Ext.fly(oldEl).removeClass('x-tab-strip-active'); } } + this.activeTab = item; if(item){ var el = this.getTabEl(item); Ext.fly(el).addClass('x-tab-strip-active'); - this.activeTab = item; this.stack.add(item); this.layout.setActiveItem(item); @@ -45350,26 +28375,17 @@ new Ext.TabPanel({ } }, - /** - * Returns the Component which is the currently active tab. Note that before the TabPanel - * first activates a child Component, this method will return whatever was configured in the - * {@link #activeTab} config option. - * @return {BoxComponent} The currently active child Component if one is active, or the {@link #activeTab} config value. - */ + getActiveTab : function(){ return this.activeTab || null; }, - /** - * Gets the specified tab by id. - * @param {String} id The tab id - * @return {Panel} The tab - */ + getItem : function(item){ return this.getComponent(item); }, - // private + autoScrollTabs : function(){ this.pos = this.tabPosition=='bottom' ? this.footer : this.header; var count = this.items.length, @@ -45381,7 +28397,7 @@ new Ext.TabPanel({ pos = this.getScrollPos(), l = this.edge.getOffsetsTo(this.stripWrap)[0] + pos; - if(!this.enableTabScroll || count < 1 || cw < 20){ // 20 to prevent display:none issues + if(!this.enableTabScroll || count < 1 || cw < 20){ return; } if(l <= tw){ @@ -45392,7 +28408,7 @@ new Ext.TabPanel({ this.pos.removeClass('x-tab-scrolling'); this.scrollLeft.hide(); this.scrollRight.hide(); - // See here: http://extjs.com/forum/showthread.php?t=49308&highlight=isSafari + if(Ext.isAir || Ext.isWebKit){ wd.style.marginLeft = ''; wd.style.marginRight = ''; @@ -45401,7 +28417,7 @@ new Ext.TabPanel({ }else{ if(!this.scrolling){ this.pos.addClass('x-tab-scrolling'); - // See here: http://extjs.com/forum/showthread.php?t=49308&highlight=isSafari + if(Ext.isAir || Ext.isWebKit){ wd.style.marginLeft = '18px'; wd.style.marginRight = '18px'; @@ -45418,21 +28434,21 @@ new Ext.TabPanel({ } } this.scrolling = true; - if(pos > (l-tw)){ // ensure it stays within bounds + if(pos > (l-tw)){ wd.scrollLeft = l-tw; - }else{ // otherwise, make sure the active tab is still visible + }else{ this.scrollToTab(this.activeTab, false); } this.updateScrollButtons(); } }, - // private + createScrollers : function(){ this.pos.addClass('x-tab-scrolling-' + this.tabPosition); var h = this.stripWrap.dom.offsetHeight; - // left + var sl = this.pos.insertFirst({ cls:'x-tab-scroller-left' }); @@ -45445,7 +28461,7 @@ new Ext.TabPanel({ }); this.scrollLeft = sl; - // right + var sr = this.pos.insertFirst({ cls:'x-tab-scroller-right' }); @@ -45459,36 +28475,32 @@ new Ext.TabPanel({ this.scrollRight = sr; }, - // private + getScrollWidth : function(){ return this.edge.getOffsetsTo(this.stripWrap)[0] + this.getScrollPos(); }, - // private + getScrollPos : function(){ return parseInt(this.stripWrap.dom.scrollLeft, 10) || 0; }, - // private + getScrollArea : function(){ return parseInt(this.stripWrap.dom.clientWidth, 10) || 0; }, - // private + getScrollAnim : function(){ return {duration:this.scrollDuration, callback: this.updateScrollButtons, scope: this}; }, - // private + getScrollIncrement : function(){ return this.scrollIncrement || (this.resizeTabs ? this.lastTabWidth+2 : 100); }, - /** - * Scrolls to a particular tab if tab scrolling is enabled - * @param {Panel} item The item to scroll to - * @param {Boolean} animate True to enable animations - */ + scrollToTab : function(item, animate){ if(!item){ @@ -45506,7 +28518,7 @@ new Ext.TabPanel({ } }, - // private + scrollTo : function(pos, animate){ this.stripWrap.scrollTo('left', pos, animate ? this.getScrollAnim() : false); if(!animate){ @@ -45528,7 +28540,7 @@ new Ext.TabPanel({ } }, - // private + onScrollRight : function(){ var sw = this.getScrollWidth()-this.getScrollArea(), pos = this.getScrollPos(), @@ -45538,7 +28550,7 @@ new Ext.TabPanel({ } }, - // private + onScrollLeft : function(){ var pos = this.getScrollPos(), s = Math.max(0, pos - this.getScrollIncrement()); @@ -45547,14 +28559,14 @@ new Ext.TabPanel({ } }, - // private + updateScrollButtons : function(){ var pos = this.getScrollPos(); this.scrollLeft[pos === 0 ? 'addClass' : 'removeClass']('x-tab-scroller-left-disabled'); this.scrollRight[pos >= (this.getScrollWidth()-this.getScrollArea()) ? 'addClass' : 'removeClass']('x-tab-scroller-right-disabled'); }, - // private + beforeDestroy : function() { Ext.destroy(this.leftRepeater, this.rightRepeater); this.deleteMembers('strip', 'edge', 'scrollLeft', 'scrollRight', 'stripWrap'); @@ -45562,66 +28574,25 @@ new Ext.TabPanel({ Ext.TabPanel.superclass.beforeDestroy.apply(this); } - /** - * @cfg {Boolean} collapsible - * @hide - */ - /** - * @cfg {String} header - * @hide - */ - /** - * @cfg {Boolean} headerAsText - * @hide - */ - /** - * @property header - * @hide - */ - /** - * @cfg title - * @hide - */ - /** - * @cfg {Array} tools - * @hide - */ - /** - * @cfg {Array} toolTemplate - * @hide - */ - /** - * @cfg {Boolean} hideCollapseTool - * @hide - */ - /** - * @cfg {Boolean} titleCollapse - * @hide - */ - /** - * @cfg {Boolean} collapsed - * @hide - */ - /** - * @cfg {String} layout - * @hide - */ - /** - * @cfg {Boolean} preventBodyReset - * @hide - */ + + + + + + + + + + + + }); Ext.reg('tabpanel', Ext.TabPanel); -/** - * See {@link #setActiveTab}. Sets the specified tab as the active tab. This method fires - * the {@link #beforetabchange} event which can return false to cancel the tab change. - * @param {String/Panel} tab The id or tab Panel to activate - * @method activate - */ + Ext.TabPanel.prototype.activate = Ext.TabPanel.prototype.setActiveTab; -// private utility class used by TabPanel + Ext.TabPanel.AccessStack = function(){ var items = []; return { @@ -45647,249 +28618,81 @@ Ext.TabPanel.AccessStack = function(){ } }; }; -/** - * @class Ext.Button - * @extends Ext.BoxComponent - * Simple Button class - * @cfg {String} text The button text to be used as innerHTML (html tags are accepted) - * @cfg {String} icon The path to an image to display in the button (the image will be set as the background-image - * CSS property of the button by default, so if you want a mixed icon/text button, set cls:'x-btn-text-icon') - * @cfg {Function} handler A function called when the button is clicked (can be used instead of click event). - * The handler is passed the following parameters:

      - *
    • b : Button
      This Button.
    • - *
    • e : EventObject
      The click event.
    • - *
    - * @cfg {Number} minWidth The minimum width for this button (used to give a set of buttons a common width). - * See also {@link Ext.Panel}.{@link Ext.Panel#minButtonWidth minButtonWidth}. - * @cfg {String/Object} tooltip The tooltip for the button - can be a string to be used as innerHTML (html tags are accepted) or QuickTips config object - * @cfg {Boolean} hidden True to start hidden (defaults to false) - * @cfg {Boolean} disabled True to start disabled (defaults to false) - * @cfg {Boolean} pressed True to start pressed (only if enableToggle = true) - * @cfg {String} toggleGroup The group this toggle button is a member of (only 1 per group can be pressed) - * @cfg {Boolean/Object} repeat True to repeat fire the click event while the mouse is down. This can also be - * a {@link Ext.util.ClickRepeater ClickRepeater} config object (defaults to false). - * @constructor - * Create a new button - * @param {Object} config The config object - * @xtype button - */ + Ext.Button = Ext.extend(Ext.BoxComponent, { - /** - * Read-only. True if this button is hidden - * @type Boolean - */ + hidden : false, - /** - * Read-only. True if this button is disabled - * @type Boolean - */ + disabled : false, - /** - * Read-only. True if this button is pressed (only if enableToggle = true) - * @type Boolean - */ + pressed : false, - /** - * @cfg {Number} tabIndex Set a DOM tabIndex for this button (defaults to undefined) - */ + - /** - * @cfg {Boolean} allowDepress - * False to not allow a pressed Button to be depressed (defaults to undefined). Only valid when {@link #enableToggle} is true. - */ + - /** - * @cfg {Boolean} enableToggle - * True to enable pressed/not pressed toggling (defaults to false) - */ + enableToggle : false, - /** - * @cfg {Function} toggleHandler - * Function called when a Button with {@link #enableToggle} set to true is clicked. Two arguments are passed:
      - *
    • button : Ext.Button
      this Button object
    • - *
    • state : Boolean
      The next state of the Button, true means pressed.
    • - *
    - */ - /** - * @cfg {Mixed} menu - * Standard menu attribute consisting of a reference to a menu object, a menu id or a menu config blob (defaults to undefined). - */ - /** - * @cfg {String} menuAlign - * The position to align the menu to (see {@link Ext.Element#alignTo} for more details, defaults to 'tl-bl?'). - */ + + + menuAlign : 'tl-bl?', - /** - * @cfg {String} overflowText If used in a {@link Ext.Toolbar Toolbar}, the - * text to be used if this item is shown in the overflow menu. See also - * {@link Ext.Toolbar.Item}.{@link Ext.Toolbar.Item#overflowText overflowText}. - */ - /** - * @cfg {String} iconCls - * A css class which sets a background image to be used as the icon for this button - */ - /** - * @cfg {String} type - * submit, reset or button - defaults to 'button' - */ + + + type : 'button', - // private + menuClassTarget : 'tr:nth(2)', - /** - * @cfg {String} clickEvent - * The DOM event that will fire the handler of the button. This can be any valid event name (dblclick, contextmenu). - * Defaults to 'click'. - */ + clickEvent : 'click', - /** - * @cfg {Boolean} handleMouseEvents - * False to disable visual cues on mouseover, mouseout and mousedown (defaults to true) - */ + handleMouseEvents : true, - /** - * @cfg {String} tooltipType - * The type of tooltip to use. Either 'qtip' (default) for QuickTips or 'title' for title attribute. - */ + tooltipType : 'qtip', - /** - * @cfg {String} buttonSelector - *

    (Optional) A {@link Ext.DomQuery DomQuery} selector which is used to extract the active, clickable element from the - * DOM structure created.

    - *

    When a custom {@link #template} is used, you must ensure that this selector results in the selection of - * a focussable element.

    - *

    Defaults to 'button:first-child'.

    - */ + buttonSelector : 'button:first-child', - /** - * @cfg {String} scale - *

    (Optional) The size of the Button. Three values are allowed:

    - *
      - *
    • 'small'
      Results in the button element being 16px high.
    • - *
    • 'medium'
      Results in the button element being 24px high.
    • - *
    • 'large'
      Results in the button element being 32px high.
    • - *
    - *

    Defaults to 'small'.

    - */ + scale : 'small', - /** - * @cfg {Object} scope The scope (this reference) in which the - * {@link #handler} and {@link #toggleHandler} is - * executed. Defaults to this Button. - */ + - /** - * @cfg {String} iconAlign - *

    (Optional) The side of the Button box to render the icon. Four values are allowed:

    - *
      - *
    • 'top'
    • - *
    • 'right'
    • - *
    • 'bottom'
    • - *
    • 'left'
    • - *
    - *

    Defaults to 'left'.

    - */ + iconAlign : 'left', - /** - * @cfg {String} arrowAlign - *

    (Optional) The side of the Button box to render the arrow if the button has an associated {@link #menu}. - * Two values are allowed:

    - *
      - *
    • 'right'
    • - *
    • 'bottom'
    • - *
    - *

    Defaults to 'right'.

    - */ + arrowAlign : 'right', - /** - * @cfg {Ext.Template} template (Optional) - *

    A {@link Ext.Template Template} used to create the Button's DOM structure.

    - * Instances, or subclasses which need a different DOM structure may provide a different - * template layout in conjunction with an implementation of {@link #getTemplateArgs}. - * @type Ext.Template - * @property template - */ - /** - * @cfg {String} cls - * A CSS class string to apply to the button's main element. - */ - /** - * @property menu - * @type Menu - * The {@link Ext.menu.Menu Menu} object associated with this Button when configured with the {@link #menu} config option. - */ + + + + initComponent : function(){ Ext.Button.superclass.initComponent.call(this); this.addEvents( - /** - * @event click - * Fires when this button is clicked - * @param {Button} this - * @param {EventObject} e The click event - */ + 'click', - /** - * @event toggle - * Fires when the 'pressed' state of this button changes (only if enableToggle = true) - * @param {Button} this - * @param {Boolean} pressed - */ + 'toggle', - /** - * @event mouseover - * Fires when the mouse hovers over the button - * @param {Button} this - * @param {Event} e The event object - */ + 'mouseover', - /** - * @event mouseout - * Fires when the mouse exits the button - * @param {Button} this - * @param {Event} e The event object - */ + 'mouseout', - /** - * @event menushow - * If this button has a menu, this event fires when it is shown - * @param {Button} this - * @param {Menu} menu - */ + 'menushow', - /** - * @event menuhide - * If this button has a menu, this event fires when it is hidden - * @param {Button} this - * @param {Menu} menu - */ + 'menuhide', - /** - * @event menutriggerover - * If this button has a menu, this event fires when the mouse enters the menu triggering element - * @param {Button} this - * @param {Menu} menu - * @param {EventObject} e - */ + 'menutriggerover', - /** - * @event menutriggerout - * If this button has a menu, this event fires when the mouse leaves the menu triggering element - * @param {Button} this - * @param {Menu} menu - * @param {EventObject} e - */ + 'menutriggerout' ); if(this.menu){ @@ -45900,46 +28703,32 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { } }, -/** - *

    This method returns an Array which provides substitution parameters for the {@link #template Template} used - * to create this Button's DOM structure.

    - *

    Instances or subclasses which use a different Template to create a different DOM structure may need to provide their - * own implementation of this method.

    - *

    The default implementation which provides data for the default {@link #template} returns an Array containing the - * following items:

      - *
    • The <button>'s {@link #type}
    • - *
    • A CSS class name applied to the Button's main <tbody> element which determines the button's scale and icon alignment.
    • - *
    • A CSS class to determine the presence and position of an arrow icon. ('x-btn-arrow' or 'x-btn-arrow-bottom' or '')
    • - *
    • The {@link #cls} CSS class name applied to the button's wrapping <table> element.
    • - *
    • The Component id which is applied to the button's wrapping <table> element.
    • - *
    - * @return {Array} Substitution data for a Template. - */ + getTemplateArgs : function(){ return [this.type, 'x-btn-' + this.scale + ' x-btn-icon-' + this.scale + '-' + this.iconAlign, this.getMenuClass(), this.cls, this.id]; }, - // private + setButtonClass : function(){ if(this.useSetClass){ if(!Ext.isEmpty(this.oldCls)){ this.el.removeClass([this.oldCls, 'x-btn-pressed']); } - this.oldCls = (this.iconCls || this.icon) ? (this.text ? ' x-btn-text-icon' : ' x-btn-icon') : ' x-btn-noicon'; + this.oldCls = (this.iconCls || this.icon) ? (this.text ? 'x-btn-text-icon' : 'x-btn-icon') : 'x-btn-noicon'; this.el.addClass([this.oldCls, this.pressed ? 'x-btn-pressed' : null]); } }, - // protected + getMenuClass : function(){ return this.menu ? (this.arrowAlign != 'bottom' ? 'x-btn-arrow' : 'x-btn-arrow-bottom') : ''; }, - // private + onRender : function(ct, position){ if(!this.template){ if(!Ext.Button.buttonTemplate){ - // hideous table template + Ext.Button.buttonTemplate = new Ext.Template( '
  • ', '', @@ -45958,12 +28747,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { }else{ btn = this.template.append(ct, targs, true); } - /** - * An {@link Ext.Element Element} encapsulating the Button's clickable element. By default, - * this references a <button> element. Read only. - * @type Ext.Element - * @property btnEl - */ + this.btnEl = btn.child(this.buttonSelector); this.mon(this.btnEl, { scope: this, @@ -45976,7 +28760,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { Ext.ButtonToggleMgr.register(this); }, - // private + initButtonEl : function(btn, btnEl){ this.el = btn; this.setIcon(this.icon); @@ -45996,8 +28780,8 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { mousedown: this.onMouseDown }); - // new functionality for monitoring on the document level - //this.mon(btn, 'mouseout', this.onMouseOut, this); + + } if(this.menu){ @@ -46015,7 +28799,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { this.mon(btn, this.clickEvent, this.onClick, this); }, - // private + afterRender : function(){ Ext.Button.superclass.afterRender.call(this); this.useSetClass = true; @@ -46024,12 +28808,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { this.doAutoWidth(); }, - /** - * Sets the CSS class that provides a background image to use as the button's icon. This method also changes - * the value of the {@link iconCls} config internally. - * @param {String} cls The CSS class providing the icon image - * @return {Ext.Button} this - */ + setIconClass : function(cls){ this.iconCls = cls; if(this.el){ @@ -46040,15 +28819,8 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { return this; }, - /** - * Sets the tooltip for this Button. - * @param {String/Object} tooltip. This may be:
      - *
    • String : A string to be used as innerHTML (html tags are accepted) to show in a tooltip
    • - *
    • Object : A configuration object for {@link Ext.QuickTips#register}.
    • - *
    - * @return {Ext.Button} this - */ - setTooltip : function(tooltip, /* private */ initial){ + + setTooltip : function(tooltip, initial){ if(this.rendered){ if(!initial){ this.clearTip(); @@ -46067,14 +28839,14 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { return this; }, - // private + clearTip : function(){ if(Ext.isObject(this.tooltip)){ Ext.QuickTips.unregister(this.btnEl); } }, - // private + beforeDestroy : function(){ if(this.rendered){ this.clearTip(); @@ -46085,7 +28857,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { Ext.destroy(this.repeater); }, - // private + onDestroy : function(){ if(this.rendered){ this.doc.un('mouseover', this.monitorMouseOver, this); @@ -46097,9 +28869,9 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { Ext.Button.superclass.onDestroy.call(this); }, - // private + doAutoWidth : function(){ - if(this.el && this.text && this.width === undefined){ + if(this.autoWidth !== false && this.el && this.text && this.width === undefined){ this.el.setWidth('auto'); if(Ext.isIE7 && Ext.isStrict){ var ib = this.btnEl; @@ -46116,24 +28888,14 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { } }, - /** - * Assigns this Button's click handler - * @param {Function} handler The function to call when the button is clicked - * @param {Object} scope (optional) The scope (this reference) in which the handler function is executed. - * Defaults to this Button. - * @return {Ext.Button} this - */ + setHandler : function(handler, scope){ this.handler = handler; this.scope = scope; return this; }, - /** - * Sets this Button's text - * @param {String} text The button text - * @return {Ext.Button} this - */ + setText : function(text){ this.text = text; if(this.el){ @@ -46144,12 +28906,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { return this; }, - /** - * Sets the background image (inline style) of the button. This method also changes - * the value of the {@link icon} config internally. - * @param {String} icon The path to an image to display in the button - * @return {Ext.Button} this - */ + setIcon : function(icon){ this.icon = icon; if(this.el){ @@ -46159,20 +28916,12 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { return this; }, - /** - * Gets the text for this Button - * @return {String} The button text - */ + getText : function(){ return this.text; }, - /** - * If a state it passed, it becomes the pressed state otherwise the current state is toggled. - * @param {Boolean} state (optional) Force a particular state - * @param {Boolean} supressEvent (optional) True to stop events being fired when calling this method. - * @return {Ext.Button} this - */ + toggle : function(state, suppressEvent){ state = state === undefined ? !this.pressed : !!state; if(state != this.pressed){ @@ -46190,12 +28939,12 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { return this; }, - // private + onDisable : function(){ this.onDisableChange(true); }, - // private + onEnable : function(){ this.onDisableChange(false); }, @@ -46210,9 +28959,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { this.disabled = disabled; }, - /** - * Show this button's menu (if it has one) - */ + showMenu : function(){ if(this.rendered && this.menu){ if(this.tooltip){ @@ -46227,9 +28974,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { return this; }, - /** - * Hide this button's menu (if it has one) - */ + hideMenu : function(){ if(this.hasVisibleMenu()){ this.menu.hide(); @@ -46237,15 +28982,12 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { return this; }, - /** - * Returns true if the button has a menu and it is visible - * @return {Boolean} - */ + hasVisibleMenu : function(){ return this.menu && this.menu.ownerCt == this && this.menu.isVisible(); }, - // private + onClick : function(e){ if(e){ e.preventDefault(); @@ -46262,23 +29004,23 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { } this.fireEvent('click', this, e); if(this.handler){ - //this.el.removeClass('x-btn-over'); + this.handler.call(this.scope || this, this, e); } } }, - // private + isMenuTriggerOver : function(e, internal){ return this.menu && !internal; }, - // private + isMenuTriggerOut : function(e, internal){ return this.menu && !internal; }, - // private + onMouseOver : function(e){ if(!this.disabled){ var internal = e.within(this.el, true); @@ -46296,7 +29038,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { } }, - // private + monitorMouseOver : function(e){ if(e.target != this.el.dom && !e.within(this.el)){ if(this.monitoringMouseOver){ @@ -46307,7 +29049,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { } }, - // private + onMouseOut : function(e){ var internal = e.within(this.el) && e.target != this.el.dom; this.el.removeClass('x-btn-over'); @@ -46325,37 +29067,37 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { this.btnEl.blur(); }, - // private + onFocus : function(e){ if(!this.disabled){ this.el.addClass('x-btn-focus'); } }, - // private + onBlur : function(e){ this.el.removeClass('x-btn-focus'); }, - // private + getClickEl : function(e, isUp){ return this.el; }, - // private + onMouseDown : function(e){ if(!this.disabled && e.button === 0){ this.getClickEl(e).addClass('x-btn-click'); this.doc.on('mouseup', this.onMouseUp, this); } }, - // private + onMouseUp : function(e){ if(e.button === 0){ this.getClickEl(e, true).removeClass('x-btn-click'); this.doc.un('mouseup', this.onMouseUp, this); } }, - // private + onMenuShow : function(e){ if(this.menu.ownerCt == this){ this.menu.ownerCt = this; @@ -46364,7 +29106,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { this.fireEvent('menushow', this, this.menu); } }, - // private + onMenuHide : function(e){ if(this.menu.ownerCt == this){ this.el.removeClass('x-btn-menu-active'); @@ -46374,33 +29116,21 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { } }, - // private + restoreClick : function(){ this.ignoreNextClick = 0; } - /** - * @cfg {String} autoEl @hide - */ - /** - * @cfg {String/Object} html @hide - */ - /** - * @cfg {String} contentEl @hide - */ - /** - * @cfg {Mixed} data @hide - */ - /** - * @cfg {Mixed} tpl @hide - */ - /** - * @cfg {String} tplWriteMode @hide - */ + + + + + + }); Ext.reg('button', Ext.Button); -// Private utility class used by Button + Ext.ButtonToggleMgr = function(){ var groups = {}; @@ -46439,11 +29169,7 @@ Ext.ButtonToggleMgr = function(){ } }, - /** - * Gets the pressed button in the passed group or null - * @param {String} group - * @return Button - */ + getPressed : function(group){ var g = groups[group]; if(g){ @@ -46457,61 +29183,20 @@ Ext.ButtonToggleMgr = function(){ } }; }(); -/** - * @class Ext.SplitButton - * @extends Ext.Button - * A split button that provides a built-in dropdown arrow that can fire an event separately from the default - * click event of the button. Typically this would be used to display a dropdown menu that provides additional - * options to the primary button action, but any custom handler can provide the arrowclick implementation. Example usage: - *
    
    -// display a dropdown menu:
    -new Ext.SplitButton({
    -	renderTo: 'button-ct', // the container id
    -   	text: 'Options',
    -   	handler: optionsHandler, // handle a click on the button itself
    -   	menu: new Ext.menu.Menu({
    -        items: [
    -        	// these items will render as dropdown menu items when the arrow is clicked:
    -	        {text: 'Item 1', handler: item1Handler},
    -	        {text: 'Item 2', handler: item2Handler}
    -        ]
    -   	})
    -});
     
    -// Instead of showing a menu, you provide any type of custom
    -// functionality you want when the dropdown arrow is clicked:
    -new Ext.SplitButton({
    -	renderTo: 'button-ct',
    -   	text: 'Options',
    -   	handler: optionsHandler,
    -   	arrowHandler: myCustomHandler
    -});
    -
    - * @cfg {Function} arrowHandler A function called when the arrow button is clicked (can be used instead of click event) - * @cfg {String} arrowTooltip The title attribute of the arrow - * @constructor - * Create a new menu button - * @param {Object} config The config object - * @xtype splitbutton - */ Ext.SplitButton = Ext.extend(Ext.Button, { - // private + arrowSelector : 'em', split: true, - // private + initComponent : function(){ Ext.SplitButton.superclass.initComponent.call(this); - /** - * @event arrowclick - * Fires when this button's arrow is clicked - * @param {MenuButton} this - * @param {EventObject} e The click event - */ + this.addEvents("arrowclick"); }, - // private + onRender : function(){ Ext.SplitButton.superclass.onRender.apply(this, arguments); if(this.arrowTooltip){ @@ -46519,11 +29204,7 @@ Ext.SplitButton = Ext.extend(Ext.Button, { } }, - /** - * Sets this button's arrow click handler. - * @param {Function} handler The function to call when the arrow is clicked - * @param {Object} scope (optional) Scope for the function passed above - */ + setArrowHandler : function(handler, scope){ this.arrowHandler = handler; this.scope = scope; @@ -46543,7 +29224,7 @@ Ext.SplitButton = Ext.extend(Ext.Button, { } }, - // private + onClick : function(e, t){ e.preventDefault(); if(!this.disabled){ @@ -46567,76 +29248,27 @@ Ext.SplitButton = Ext.extend(Ext.Button, { } }, - // private + isMenuTriggerOver : function(e){ return this.menu && e.target.tagName == this.arrowSelector; }, - // private + isMenuTriggerOut : function(e, internal){ return this.menu && e.target.tagName != this.arrowSelector; } }); -Ext.reg('splitbutton', Ext.SplitButton);/** - * @class Ext.CycleButton - * @extends Ext.SplitButton - * A specialized SplitButton that contains a menu of {@link Ext.menu.CheckItem} elements. The button automatically - * cycles through each menu item on click, raising the button's {@link #change} event (or calling the button's - * {@link #changeHandler} function, if supplied) for the active menu item. Clicking on the arrow section of the - * button displays the dropdown menu just like a normal SplitButton. Example usage: - *
    
    -var btn = new Ext.CycleButton({
    -    showText: true,
    -    prependText: 'View as ',
    -    items: [{
    -        text:'text only',
    -        iconCls:'view-text',
    -        checked:true
    -    },{
    -        text:'HTML',
    -        iconCls:'view-html'
    -    }],
    -    changeHandler:function(btn, item){
    -        Ext.Msg.alert('Change View', item.text);
    -    }
    -});
    -
    - * @constructor - * Create a new split button - * @param {Object} config The config object - * @xtype cycle - */ +Ext.reg('splitbutton', Ext.SplitButton); Ext.CycleButton = Ext.extend(Ext.SplitButton, { - /** - * @cfg {Array} items An array of {@link Ext.menu.CheckItem} config objects to be used when creating the - * button's menu items (e.g., {text:'Foo', iconCls:'foo-icon'}) - */ - /** - * @cfg {Boolean} showText True to display the active item's text as the button text (defaults to false) - */ - /** - * @cfg {String} prependText A static string to prepend before the active item's text when displayed as the - * button's text (only applies when showText = true, defaults to '') - */ - /** - * @cfg {Function} changeHandler A callback function that will be invoked each time the active menu - * item in the button's menu has changed. If this callback is not supplied, the SplitButton will instead - * fire the {@link #change} event on active item change. The changeHandler function will be called with the - * following argument list: (SplitButton this, Ext.menu.CheckItem item) - */ - /** - * @cfg {String} forceIcon A css class which sets an image to be used as the static icon for this button. This - * icon will always be displayed regardless of which item is selected in the dropdown list. This overrides the - * default behavior of changing the button's icon to match the selected item's icon on change. - */ - /** - * @property menu - * @type Menu - * The {@link Ext.menu.Menu Menu} object used to display the {@link Ext.menu.CheckItem CheckItems} representing the available choices. - */ + + + + + + - // private + getItemText : function(item){ if(item && this.showText === true){ var text = ''; @@ -46649,11 +29281,7 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, { return undefined; }, - /** - * Sets the button's active menu item. - * @param {Ext.menu.CheckItem} item The item to activate - * @param {Boolean} suppressEvent True to prevent the button's change event from firing (defaults to false) - */ + setActiveItem : function(item, suppressEvent){ if(!Ext.isObject(item)){ item = this.menu.getComponent(item); @@ -46682,25 +29310,15 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, { } }, - /** - * Gets the currently active menu item. - * @return {Ext.menu.CheckItem} The active item - */ + getActiveItem : function(){ return this.activeItem; }, - // private + initComponent : function(){ this.addEvents( - /** - * @event change - * Fires after the button's active menu item has changed. Note that if a {@link #changeHandler} function - * is set on this CycleButton, it will be called instead on active item change and this change event will - * not be fired. - * @param {Ext.CycleButton} this - * @param {Ext.menu.CheckItem} item The menu item that was selected - */ + "change" ); @@ -46731,22 +29349,18 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, { this.setActiveItem(checked, true); }, - // private + checkHandler : function(item, pressed){ if(pressed){ this.setActiveItem(item); } }, - /** - * This is normally called internally on button click, but can be called externally to advance the button's - * active item programmatically to the next one in the menu. If the current item is the last one in the menu - * the active item will be set to the first item in the menu. - */ + toggleSelected : function(){ var m = this.menu; m.render(); - // layout if we haven't before so the items are active + if(!m.hasLayout){ m.doLayout(); } @@ -46754,9 +29368,9 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, { var nextIdx, checkItem; for (var i = 1; i < this.itemCount; i++) { nextIdx = (this.activeItem.itemIndex + i) % this.itemCount; - // check the potential item + checkItem = m.items.itemAt(nextIdx); - // if its not disabled then check it. + if (!checkItem.disabled) { checkItem.setChecked(true); break; @@ -46764,99 +29378,7 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, { } } }); -Ext.reg('cycle', Ext.CycleButton);/** - * @class Ext.Toolbar - * @extends Ext.Container - *

    Basic Toolbar class. Although the {@link Ext.Container#defaultType defaultType} for Toolbar - * is {@link Ext.Button button}, Toolbar elements (child items for the Toolbar container) may - * be virtually any type of Component. Toolbar elements can be created explicitly via their constructors, - * or implicitly via their xtypes, and can be {@link #add}ed dynamically.

    - *

    Some items have shortcut strings for creation:

    - *
    -Shortcut  xtype          Class                  Description
    -'->'      'tbfill'       {@link Ext.Toolbar.Fill}       begin using the right-justified button container
    -'-'       'tbseparator'  {@link Ext.Toolbar.Separator}  add a vertical separator bar between toolbar items
    -' '       'tbspacer'     {@link Ext.Toolbar.Spacer}     add horiztonal space between elements
    - * 
    - * - * Example usage of various elements: - *
    
    -var tb = new Ext.Toolbar({
    -    renderTo: document.body,
    -    width: 600,
    -    height: 100,
    -    items: [
    -        {
    -            // xtype: 'button', // default for Toolbars, same as 'tbbutton'
    -            text: 'Button'
    -        },
    -        {
    -            xtype: 'splitbutton', // same as 'tbsplitbutton'
    -            text: 'Split Button'
    -        },
    -        // begin using the right-justified button container
    -        '->', // same as {xtype: 'tbfill'}, // Ext.Toolbar.Fill
    -        {
    -            xtype: 'textfield',
    -            name: 'field1',
    -            emptyText: 'enter search term'
    -        },
    -        // add a vertical separator bar between toolbar items
    -        '-', // same as {xtype: 'tbseparator'} to create Ext.Toolbar.Separator
    -        'text 1', // same as {xtype: 'tbtext', text: 'text1'} to create Ext.Toolbar.TextItem
    -        {xtype: 'tbspacer'},// same as ' ' to create Ext.Toolbar.Spacer
    -        'text 2',
    -        {xtype: 'tbspacer', width: 50}, // add a 50px space
    -        'text 3'
    -    ]
    -});
    - * 
    - * Example adding a ComboBox within a menu of a button: - *
    
    -// ComboBox creation
    -var combo = new Ext.form.ComboBox({
    -    store: new Ext.data.ArrayStore({
    -        autoDestroy: true,
    -        fields: ['initials', 'fullname'],
    -        data : [
    -            ['FF', 'Fred Flintstone'],
    -            ['BR', 'Barney Rubble']
    -        ]
    -    }),
    -    displayField: 'fullname',
    -    typeAhead: true,
    -    mode: 'local',
    -    forceSelection: true,
    -    triggerAction: 'all',
    -    emptyText: 'Select a name...',
    -    selectOnFocus: true,
    -    width: 135,
    -    getListParent: function() {
    -        return this.el.up('.x-menu');
    -    },
    -    iconCls: 'no-icon' //use iconCls if placing within menu to shift to right side of menu
    -});
    -
    -// put ComboBox in a Menu
    -var menu = new Ext.menu.Menu({
    -    id: 'mainMenu',
    -    items: [
    -        combo // A Field in a Menu
    -    ]
    -});
    -
    -// add a Button with the menu
    -tb.add({
    -        text:'Button w/ Menu',
    -        menu: menu  // assign menu by instance
    -    });
    -tb.doLayout();
    - * 
    - * @constructor - * Creates a new Toolbar - * @param {Object/Array} config A config object or an array of buttons to {@link #add} - * @xtype toolbar - */ +Ext.reg('cycle', Ext.CycleButton); Ext.Toolbar = function(config){ if(Ext.isArray(config)){ config = {items: config, layout: 'toolbar'}; @@ -46879,29 +29401,12 @@ Ext.extend(T, Ext.Container, { defaultType: 'button', - /** - * @cfg {String/Object} layout - * This class assigns a default layout (layout:'toolbar'). - * Developers may override this configuration option if another layout - * is required (the constructor must be passed a configuration object in this - * case instead of an array). - * See {@link Ext.Container#layout} for additional information. - */ + enableOverflow : false, - /** - * @cfg {Boolean} enableOverflow - * Defaults to false. Configure true to make the toolbar provide a button - * which activates a dropdown Menu to show items which overflow the Toolbar's width. - */ - /** - * @cfg {String} buttonAlign - *

    The default position at which to align child items. Defaults to "left"

    - *

    May be specified as "center" to cause items added before a Fill (A "->") item - * to be centered in the Toolbar. Items added after a Fill are still right-aligned.

    - *

    Specify as "right" to right align all child items.

    - */ + + trackMenus : true, internalDefaults: {removeMode: 'container', hideParent: true}, @@ -46910,16 +29415,11 @@ Ext.extend(T, Ext.Container, { initComponent : function(){ T.superclass.initComponent.call(this); - /** - * @event overflowchange - * Fires after the overflow state has changed. - * @param {Object} c The Container - * @param {Boolean} lastOverflow overflow state - */ + this.addEvents('overflowchange'); }, - // private + onRender : function(ct, position){ if(!this.el){ if(!this.autoCreate){ @@ -46932,28 +29432,9 @@ Ext.extend(T, Ext.Container, { } }, - /** - *

    Adds element(s) to the toolbar -- this function takes a variable number of - * arguments of mixed type and adds them to the toolbar.

    - *

    Note: See the notes within {@link Ext.Container#add}.

    - * @param {Mixed} arg1 The following types of arguments are all valid:
    - *
      - *
    • {@link Ext.Button} config: A valid button config object (equivalent to {@link #addButton})
    • - *
    • HtmlElement: Any standard HTML element (equivalent to {@link #addElement})
    • - *
    • Field: Any form field (equivalent to {@link #addField})
    • - *
    • Item: Any subclass of {@link Ext.Toolbar.Item} (equivalent to {@link #addItem})
    • - *
    • String: Any generic string (gets wrapped in a {@link Ext.Toolbar.TextItem}, equivalent to {@link #addText}). - * Note that there are a few special strings that are treated differently as explained next.
    • - *
    • '-': Creates a separator element (equivalent to {@link #addSeparator})
    • - *
    • ' ': Creates a spacer element (equivalent to {@link #addSpacer})
    • - *
    • '->': Creates a fill element (equivalent to {@link #addFill})
    • - *
    - * @param {Mixed} arg2 - * @param {Mixed} etc. - * @method add - */ + - // private + lookupComponent : function(c){ if(Ext.isString(c)){ if(c == '-'){ @@ -46967,20 +29448,20 @@ Ext.extend(T, Ext.Container, { } this.applyDefaults(c); }else{ - if(c.isFormField || c.render){ // some kind of form field, some kind of Toolbar.Item + if(c.isFormField || c.render){ c = this.createComponent(c); - }else if(c.tag){ // DomHelper spec + }else if(c.tag){ c = new T.Item({autoEl: c}); - }else if(c.tagName){ // element + }else if(c.tagName){ c = new T.Item({el:c}); - }else if(Ext.isObject(c)){ // must be button config? + }else if(Ext.isObject(c)){ c = c.xtype ? this.createComponent(c) : this.constructButton(c); } } return c; }, - // private + applyDefaults : function(c){ if(!Ext.isString(c)){ c = Ext.Toolbar.superclass.applyDefaults.call(this, c); @@ -46995,58 +29476,32 @@ Ext.extend(T, Ext.Container, { return c; }, - /** - * Adds a separator - *

    Note: See the notes within {@link Ext.Container#add}.

    - * @return {Ext.Toolbar.Item} The separator {@link Ext.Toolbar.Item item} - */ + addSeparator : function(){ return this.add(new T.Separator()); }, - /** - * Adds a spacer element - *

    Note: See the notes within {@link Ext.Container#add}.

    - * @return {Ext.Toolbar.Spacer} The spacer item - */ + addSpacer : function(){ return this.add(new T.Spacer()); }, - /** - * Forces subsequent additions into the float:right toolbar - *

    Note: See the notes within {@link Ext.Container#add}.

    - */ + addFill : function(){ this.add(new T.Fill()); }, - /** - * Adds any standard HTML element to the toolbar - *

    Note: See the notes within {@link Ext.Container#add}.

    - * @param {Mixed} el The element or id of the element to add - * @return {Ext.Toolbar.Item} The element's item - */ + addElement : function(el){ return this.addItem(new T.Item({el:el})); }, - /** - * Adds any Toolbar.Item or subclass - *

    Note: See the notes within {@link Ext.Container#add}.

    - * @param {Ext.Toolbar.Item} item - * @return {Ext.Toolbar.Item} The item - */ + addItem : function(item){ return this.add.apply(this, arguments); }, - /** - * Adds a button (or buttons). See {@link Ext.Button} for more info on the config. - *

    Note: See the notes within {@link Ext.Container#add}.

    - * @param {Object/Array} config A button config or array of configs - * @return {Ext.Button/Array} - */ + addButton : function(config){ if(Ext.isArray(config)){ var buttons = []; @@ -47058,45 +29513,22 @@ Ext.extend(T, Ext.Container, { return this.add(this.constructButton(config)); }, - /** - * Adds text to the toolbar - *

    Note: See the notes within {@link Ext.Container#add}.

    - * @param {String} text The text to add - * @return {Ext.Toolbar.Item} The element's item - */ + addText : function(text){ return this.addItem(new T.TextItem(text)); }, - /** - * Adds a new element to the toolbar from the passed {@link Ext.DomHelper} config - *

    Note: See the notes within {@link Ext.Container#add}.

    - * @param {Object} config - * @return {Ext.Toolbar.Item} The element's item - */ + addDom : function(config){ return this.add(new T.Item({autoEl: config})); }, - /** - * Adds a dynamically rendered Ext.form field (TextField, ComboBox, etc). Note: the field should not have - * been rendered yet. For a field that has already been rendered, use {@link #addElement}. - *

    Note: See the notes within {@link Ext.Container#add}.

    - * @param {Ext.form.Field} field - * @return {Ext.Toolbar.Item} - */ + addField : function(field){ return this.add(field); }, - /** - * Inserts any {@link Ext.Toolbar.Item}/{@link Ext.Button} at the specified index. - *

    Note: See the notes within {@link Ext.Container#add}.

    - * @param {Number} index The index where the item is to be inserted - * @param {Object/Ext.Toolbar.Item/Ext.Button/Array} item The button, or button config object to be - * inserted, or an array of buttons/configs. - * @return {Ext.Button/Item} - */ + insertButton : function(index, item){ if(Ext.isArray(item)){ var buttons = []; @@ -47108,7 +29540,7 @@ Ext.extend(T, Ext.Container, { return Ext.Toolbar.superclass.insert.call(this, index, item); }, - // private + trackMenu : function(item, remove){ if(this.trackMenus && item.menu){ var method = remove ? 'mun' : 'mon'; @@ -47118,13 +29550,13 @@ Ext.extend(T, Ext.Container, { } }, - // private + constructButton : function(item){ var b = item.events ? item : this.createComponent(item, item.split ? 'splitbutton' : this.defaultType); return b; }, - // private + onAdd : function(c){ Ext.Toolbar.superclass.onAdd.call(this); this.trackMenu(c); @@ -47133,13 +29565,13 @@ Ext.extend(T, Ext.Container, { } }, - // private + onRemove : function(c){ Ext.Toolbar.superclass.onRemove.call(this); this.trackMenu(c, true); }, - // private + onDisable : function(){ this.items.each(function(item){ if(item.disable){ @@ -47148,7 +29580,7 @@ Ext.extend(T, Ext.Container, { }); }, - // private + onEnable : function(){ this.items.each(function(item){ if(item.enable){ @@ -47157,7 +29589,7 @@ Ext.extend(T, Ext.Container, { }); }, - // private + onButtonTriggerOver : function(btn){ if(this.activeMenuBtn && this.activeMenuBtn != btn){ this.activeMenuBtn.hideMenu(); @@ -47166,57 +29598,29 @@ Ext.extend(T, Ext.Container, { } }, - // private + onButtonMenuShow : function(btn){ this.activeMenuBtn = btn; }, - // private + onButtonMenuHide : function(btn){ delete this.activeMenuBtn; } }); Ext.reg('toolbar', Ext.Toolbar); -/** - * @class Ext.Toolbar.Item - * @extends Ext.BoxComponent - * The base class that other non-interacting Toolbar Item classes should extend in order to - * get some basic common toolbar item functionality. - * @constructor - * Creates a new Item - * @param {HTMLElement} el - * @xtype tbitem - */ + T.Item = Ext.extend(Ext.BoxComponent, { - hideParent: true, // Hiding a Toolbar.Item hides its containing TD + hideParent: true, enable:Ext.emptyFn, disable:Ext.emptyFn, focus:Ext.emptyFn - /** - * @cfg {String} overflowText Text to be used for the menu if the item is overflowed. - */ + }); Ext.reg('tbitem', T.Item); -/** - * @class Ext.Toolbar.Separator - * @extends Ext.Toolbar.Item - * A simple class that adds a vertical separator bar between toolbar items - * (css class:'xtb-sep'). Example usage: - *
    
    -new Ext.Panel({
    -    tbar : [
    -        'Item 1',
    -        {xtype: 'tbseparator'}, // or '-'
    -        'Item 2'
    -    ]
    -});
    -
    - * @constructor - * Creates a new Separator - * @xtype tbseparator - */ + T.Separator = Ext.extend(T.Item, { onRender : function(ct, position){ this.el = ct.createChild({tag:'span', cls:'xtb-sep'}, position); @@ -47224,37 +29628,9 @@ T.Separator = Ext.extend(T.Item, { }); Ext.reg('tbseparator', T.Separator); -/** - * @class Ext.Toolbar.Spacer - * @extends Ext.Toolbar.Item - * A simple element that adds extra horizontal space between items in a toolbar. - * By default a 2px wide space is added via css specification:
    
    -.x-toolbar .xtb-spacer {
    -    width:2px;
    -}
    - * 
    - *

    Example usage:

    - *
    
    -new Ext.Panel({
    -    tbar : [
    -        'Item 1',
    -        {xtype: 'tbspacer'}, // or ' '
    -        'Item 2',
    -        // space width is also configurable via javascript
    -        {xtype: 'tbspacer', width: 50}, // add a 50px space
    -        'Item 3'
    -    ]
    -});
    -
    - * @constructor - * Creates a new Spacer - * @xtype tbspacer - */ + T.Spacer = Ext.extend(T.Item, { - /** - * @cfg {Number} width - * The width of the spacer in pixels (defaults to 2px via css style .x-toolbar .xtb-spacer). - */ + onRender : function(ct, position){ this.el = ct.createChild({tag:'div', cls:'xtb-spacer', style: this.width?'width:'+this.width+'px':''}, position); @@ -47262,67 +29638,29 @@ T.Spacer = Ext.extend(T.Item, { }); Ext.reg('tbspacer', T.Spacer); -/** - * @class Ext.Toolbar.Fill - * @extends Ext.Toolbar.Spacer - * A non-rendering placeholder item which instructs the Toolbar's Layout to begin using - * the right-justified button container. - *
    
    -new Ext.Panel({
    -    tbar : [
    -        'Item 1',
    -        {xtype: 'tbfill'}, // or '->'
    -        'Item 2'
    -    ]
    -});
    -
    - * @constructor - * Creates a new Fill - * @xtype tbfill - */ + T.Fill = Ext.extend(T.Item, { - // private + render : Ext.emptyFn, isFill : true }); Ext.reg('tbfill', T.Fill); -/** - * @class Ext.Toolbar.TextItem - * @extends Ext.Toolbar.Item - * A simple class that renders text directly into a toolbar - * (with css class:'xtb-text'). Example usage: - *
    
    -new Ext.Panel({
    -    tbar : [
    -        {xtype: 'tbtext', text: 'Item 1'} // or simply 'Item 1'
    -    ]
    -});
    -
    - * @constructor - * Creates a new TextItem - * @param {String/Object} text A text string, or a config object containing a text property - * @xtype tbtext - */ + T.TextItem = Ext.extend(T.Item, { - /** - * @cfg {String} text The text to be used as innerHTML (html tags are accepted) - */ + constructor: function(config){ T.TextItem.superclass.constructor.call(this, Ext.isString(config) ? {text: config} : config); }, - // private + onRender : function(ct, position) { this.autoEl = {cls: 'xtb-text', html: this.text || ''}; T.TextItem.superclass.onRender.call(this, ct, position); }, - /** - * Updates this item's text, setting the text to be used as innerHTML. - * @param {String} t The text to display (html accepted). - */ + setText : function(t) { if(this.rendered){ this.el.update(t); @@ -47333,75 +29671,22 @@ T.TextItem = Ext.extend(T.Item, { }); Ext.reg('tbtext', T.TextItem); -// backwards compat + T.Button = Ext.extend(Ext.Button, {}); T.SplitButton = Ext.extend(Ext.SplitButton, {}); Ext.reg('tbbutton', T.Button); Ext.reg('tbsplit', T.SplitButton); })(); -/** - * @class Ext.ButtonGroup - * @extends Ext.Panel - * Container for a group of buttons. Example usage: - *
    
    -var p = new Ext.Panel({
    -    title: 'Panel with Button Group',
    -    width: 300,
    -    height:200,
    -    renderTo: document.body,
    -    html: 'whatever',
    -    tbar: [{
    -        xtype: 'buttongroup',
    -        {@link #columns}: 3,
    -        title: 'Clipboard',
    -        items: [{
    -            text: 'Paste',
    -            scale: 'large',
    -            rowspan: 3, iconCls: 'add',
    -            iconAlign: 'top',
    -            cls: 'x-btn-as-arrow'
    -        },{
    -            xtype:'splitbutton',
    -            text: 'Menu Button',
    -            scale: 'large',
    -            rowspan: 3,
    -            iconCls: 'add',
    -            iconAlign: 'top',
    -            arrowAlign:'bottom',
    -            menu: [{text: 'Menu Item 1'}]
    -        },{
    -            xtype:'splitbutton', text: 'Cut', iconCls: 'add16', menu: [{text: 'Cut Menu Item'}]
    -        },{
    -            text: 'Copy', iconCls: 'add16'
    -        },{
    -            text: 'Format', iconCls: 'add16'
    -        }]
    -    }]
    -});
    - * 
    - * @constructor - * Create a new ButtonGroup. - * @param {Object} config The config object - * @xtype buttongroup - */ + Ext.ButtonGroup = Ext.extend(Ext.Panel, { - /** - * @cfg {Number} columns The columns configuration property passed to the - * {@link #layout configured layout manager}. See {@link Ext.layout.TableLayout#columns}. - */ - /** - * @cfg {String} baseCls Defaults to 'x-btn-group'. See {@link Ext.Panel#baseCls}. - */ + + baseCls: 'x-btn-group', - /** - * @cfg {String} layout Defaults to 'table'. See {@link Ext.Container#layout}. - */ + layout:'table', defaultType: 'button', - /** - * @cfg {Boolean} frame Defaults to true. See {@link Ext.Panel#frame}. - */ + frame: true, internalDefaults: {removeMode: 'container', hideParent: true}, @@ -47434,204 +29719,45 @@ Ext.ButtonGroup = Ext.extend(Ext.Panel, { this.body.setWidth(bodyWidth); this.el.setWidth(bodyWidth + this.getFrameWidth()); } - /** - * @cfg {Array} tools @hide - */ + }); Ext.reg('buttongroup', Ext.ButtonGroup); -/** - * @class Ext.PagingToolbar - * @extends Ext.Toolbar - *

    As the amount of records increases, the time required for the browser to render - * them increases. Paging is used to reduce the amount of data exchanged with the client. - * Note: if there are more records/rows than can be viewed in the available screen area, vertical - * scrollbars will be added.

    - *

    Paging is typically handled on the server side (see exception below). The client sends - * parameters to the server side, which the server needs to interpret and then respond with the - * approprate data.

    - *

    Ext.PagingToolbar is a specialized toolbar that is bound to a {@link Ext.data.Store} - * and provides automatic paging control. This Component {@link Ext.data.Store#load load}s blocks - * of data into the {@link #store} by passing {@link Ext.data.Store#paramNames paramNames} used for - * paging criteria.

    - *

    PagingToolbar is typically used as one of the Grid's toolbars:

    - *
    
    -Ext.QuickTips.init(); // to display button quicktips
    -
    -var myStore = new Ext.data.Store({
    -    reader: new Ext.data.JsonReader({
    -        {@link Ext.data.JsonReader#totalProperty totalProperty}: 'results', 
    -        ...
    -    }),
    -    ...
    -});
     
    -var myPageSize = 25;  // server script should only send back 25 items at a time
    -
    -var grid = new Ext.grid.GridPanel({
    -    ...
    -    store: myStore,
    -    bbar: new Ext.PagingToolbar({
    -        {@link #store}: myStore,       // grid and PagingToolbar using same store
    -        {@link #displayInfo}: true,
    -        {@link #pageSize}: myPageSize,
    -        {@link #prependButtons}: true,
    -        items: [
    -            'text 1'
    -        ]
    -    })
    -});
    - * 
    - * - *

    To use paging, pass the paging requirements to the server when the store is first loaded.

    - *
    
    -store.load({
    -    params: {
    -        // specify params for the first page load if using paging
    -        start: 0,          
    -        limit: myPageSize,
    -        // other params
    -        foo:   'bar'
    -    }
    -});
    - * 
    - * - *

    If using {@link Ext.data.Store#autoLoad store's autoLoad} configuration:

    - *
    
    -var myStore = new Ext.data.Store({
    -    {@link Ext.data.Store#autoLoad autoLoad}: {params:{start: 0, limit: 25}},
    -    ...
    -});
    - * 
    - * - *

    The packet sent back from the server would have this form:

    - *
    
    -{
    -    "success": true,
    -    "results": 2000, 
    -    "rows": [ // *Note: this must be an Array 
    -        { "id":  1, "name": "Bill", "occupation": "Gardener" },
    -        { "id":  2, "name":  "Ben", "occupation": "Horticulturalist" },
    -        ...
    -        { "id": 25, "name":  "Sue", "occupation": "Botanist" }
    -    ]
    -}
    - * 
    - *

    Paging with Local Data

    - *

    Paging can also be accomplished with local data using extensions:

    - *
    - * @constructor Create a new PagingToolbar - * @param {Object} config The config object - * @xtype paging - */ (function() { var T = Ext.Toolbar; Ext.PagingToolbar = Ext.extend(Ext.Toolbar, { - /** - * @cfg {Ext.data.Store} store - * The {@link Ext.data.Store} the paging toolbar should use as its data source (required). - */ - /** - * @cfg {Boolean} displayInfo - * true to display the displayMsg (defaults to false) - */ - /** - * @cfg {Number} pageSize - * The number of records to display per page (defaults to 20) - */ + + + pageSize : 20, - /** - * @cfg {Boolean} prependButtons - * true to insert any configured items before the paging buttons. - * Defaults to false. - */ - /** - * @cfg {String} displayMsg - * The paging status message to display (defaults to 'Displaying {0} - {1} of {2}'). - * Note that this string is formatted using the braced numbers {0}-{2} as tokens - * that are replaced by the values for start, end and total respectively. These tokens should - * be preserved when overriding this string if showing those values is desired. - */ + + displayMsg : 'Displaying {0} - {1} of {2}', - /** - * @cfg {String} emptyMsg - * The message to display when no records are found (defaults to 'No data to display') - */ + emptyMsg : 'No data to display', - /** - * @cfg {String} beforePageText - * The text displayed before the input item (defaults to 'Page'). - */ + beforePageText : 'Page', - /** - * @cfg {String} afterPageText - * Customizable piece of the default paging text (defaults to 'of {0}'). Note that - * this string is formatted using {0} as a token that is replaced by the number of - * total pages. This token should be preserved when overriding this string if showing the - * total page count is desired. - */ + afterPageText : 'of {0}', - /** - * @cfg {String} firstText - * The quicktip text displayed for the first page button (defaults to 'First Page'). - * Note: quick tips must be initialized for the quicktip to show. - */ + firstText : 'First Page', - /** - * @cfg {String} prevText - * The quicktip text displayed for the previous page button (defaults to 'Previous Page'). - * Note: quick tips must be initialized for the quicktip to show. - */ + prevText : 'Previous Page', - /** - * @cfg {String} nextText - * The quicktip text displayed for the next page button (defaults to 'Next Page'). - * Note: quick tips must be initialized for the quicktip to show. - */ + nextText : 'Next Page', - /** - * @cfg {String} lastText - * The quicktip text displayed for the last page button (defaults to 'Last Page'). - * Note: quick tips must be initialized for the quicktip to show. - */ + lastText : 'Last Page', - /** - * @cfg {String} refreshText - * The quicktip text displayed for the Refresh button (defaults to 'Refresh'). - * Note: quick tips must be initialized for the quicktip to show. - */ + refreshText : 'Refresh', - /** - *

    Deprecated. paramNames should be set in the data store - * (see {@link Ext.data.Store#paramNames}).

    - *

    Object mapping of parameter names used for load calls, initially set to:

    - *
    {start: 'start', limit: 'limit'}
    - * @type Object - * @property paramNames - * @deprecated - */ + - /** - * The number of records to display per page. See also {@link #cursor}. - * @type Number - * @property pageSize - */ + - /** - * Indicator for the record position. This property might be used to get the active page - * number for example:
    
    -     * // t is reference to the paging toolbar instance
    -     * var activePage = Math.ceil((t.cursor + t.pageSize) / t.pageSize);
    -     * 
    - * @type Number - * @property cursor - */ + initComponent : function(){ var pagingItems = [this.first = new T.Button({ @@ -47699,34 +29825,9 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, { } Ext.PagingToolbar.superclass.initComponent.call(this); this.addEvents( - /** - * @event change - * Fires after the active page has been changed. - * @param {Ext.PagingToolbar} this - * @param {Object} pageData An object that has these properties:
      - *
    • total : Number
      The total number of records in the dataset as - * returned by the server
    • - *
    • activePage : Number
      The current page number
    • - *
    • pages : Number
      The total number of pages (calculated from - * the total number of records in the dataset as returned by the server and the current {@link #pageSize})
    • - *
    - */ + 'change', - /** - * @event beforechange - * Fires just before the active page is changed. - * Return false to prevent the active page from being changed. - * @param {Ext.PagingToolbar} this - * @param {Object} params An object hash of the parameters which the PagingToolbar will send when - * loading the required page. This will contain:
      - *
    • start : Number
      The starting row number for the next page of records to - * be retrieved from the server
    • - *
    • limit : Number
      The number of records to be retrieved from the server
    • - *
    - *

    (note: the names of the start and limit properties are determined - * by the store's {@link Ext.data.Store#paramNames paramNames} property.)

    - *

    Parameters may be added as required in the event handler.

    - */ + 'beforechange' ); this.on('afterlayout', this.onFirstLayout, this, {single: true}); @@ -47734,14 +29835,14 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, { this.bindStore(this.store, true); }, - // private + onFirstLayout : function(){ if(this.dsLoaded){ this.onLoad.apply(this, this.dsLoaded); } }, - // private + updateInfo : function(){ if(this.displayItem){ var count = this.store.getCount(); @@ -47755,7 +29856,7 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, { } }, - // private + onLoad : function(store, r, o){ if(!this.rendered){ this.dsLoaded = [store, r, o]; @@ -47776,7 +29877,7 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, { this.fireEvent('change', this, d); }, - // private + getPageData : function(){ var total = this.store.getTotalCount(); return { @@ -47786,15 +29887,12 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, { }; }, - /** - * Change the active page - * @param {Integer} page The page to display - */ + changePage : function(page){ this.doLoad(((page-1) * this.pageSize).constrain(0, this.store.getTotalCount())); }, - // private + onLoadError : function(){ if(!this.rendered){ return; @@ -47802,7 +29900,7 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, { this.refresh.enable(); }, - // private + readPage : function(d){ var v = this.inputItem.getValue(), pageNum; if (!v || isNaN(pageNum = parseInt(v, 10))) { @@ -47816,12 +29914,12 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, { this.inputItem.select(); }, - //private + onPagingBlur : function(e){ this.inputItem.setValue(this.getPageData().activePage); }, - // private + onPagingKeyDown : function(field, e){ var k = e.getKey(), d = this.getPageData(), pageNum; if (k == e.RETURN) { @@ -47850,20 +29948,20 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, { } }, - // private + getParams : function(){ - //retain backwards compat, allow params on the toolbar itself, if they exist. + return this.paramNames || this.store.paramNames; }, - // private + beforeLoad : function(){ if(this.rendered && this.refresh){ this.refresh.disable(); } }, - // private + doLoad : function(start){ var o = {}, pn = this.getParams(); o[pn.start] = start; @@ -47873,30 +29971,22 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, { } }, - /** - * Move to the first page, has the same effect as clicking the 'first' button. - */ + moveFirst : function(){ this.doLoad(0); }, - /** - * Move to the previous page, has the same effect as clicking the 'previous' button. - */ + movePrevious : function(){ this.doLoad(Math.max(0, this.cursor-this.pageSize)); }, - /** - * Move to the next page, has the same effect as clicking the 'next' button. - */ + moveNext : function(){ this.doLoad(this.cursor+this.pageSize); }, - /** - * Move to the last page, has the same effect as clicking the 'last' button. - */ + moveLast : function(){ var total = this.store.getTotalCount(), extra = total % this.pageSize; @@ -47904,18 +29994,12 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, { this.doLoad(extra ? (total - extra) : total - this.pageSize); }, - /** - * Refresh the current page, has the same effect as clicking the 'refresh' button. - */ + doRefresh : function(){ this.doLoad(this.cursor); }, - /** - * Binds the paging toolbar to the specified {@link Ext.data.Store} - * @param {Store} store The store to bind to this toolbar - * @param {Boolean} initial (Optional) true to not remove listeners - */ + bindStore : function(store, initial){ var doLoad; if(!initial && this.store){ @@ -47946,23 +30030,17 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, { } }, - /** - * Unbinds the paging toolbar from the specified {@link Ext.data.Store} (deprecated) - * @param {Ext.data.Store} store The data store to unbind - */ + unbind : function(store){ this.bindStore(null); }, - /** - * Binds the paging toolbar to the specified {@link Ext.data.Store} (deprecated) - * @param {Ext.data.Store} store The data store to bind - */ + bind : function(store){ this.bindStore(store); }, - // private + onDestroy : function(){ this.bindStore(null); Ext.PagingToolbar.superclass.onDestroy.call(this); @@ -47970,15 +30048,7 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, { }); })(); -Ext.reg('paging', Ext.PagingToolbar);/** - * @class Ext.History - * @extends Ext.util.Observable - * History management component that allows you to register arbitrary tokens that signify application - * history state on navigation actions. You can then handle the history {@link #change} event in order - * to reset your application UI to the appropriate state when the user navigates forward or backward through - * the browser history stack. - * @singleton - */ +Ext.reg('paging', Ext.PagingToolbar); Ext.History = (function () { var iframe, hiddenField; var ready = false; @@ -48071,27 +30141,14 @@ Ext.History = (function () { } return { - /** - * The id of the hidden field required for storing the current history token. - * @type String - * @property - */ + fieldId: 'x-history-field', - /** - * The id of the iframe required by IE to manage the history stack. - * @type String - * @property - */ + iframeId: 'x-history-frame', events:{}, - /** - * Initialize the global History instance. - * @param {Boolean} onReady (optional) A callback function that will be called once the history - * component is fully initialized. - * @param {Object} scope (optional) The scope (this reference) in which the callback is executed. Defaults to the browser window. - */ + init: function (onReady, scope) { if(ready) { Ext.callback(onReady, scope, [this]); @@ -48108,17 +30165,9 @@ Ext.History = (function () { iframe = Ext.getDom(Ext.History.iframeId); } this.addEvents( - /** - * @event ready - * Fires when the Ext.History singleton has been initialized and is ready for use. - * @param {Ext.History} The Ext.History singleton. - */ + 'ready', - /** - * @event change - * Fires when navigation back or forwards within the local page's history occurs. - * @param {String} token An identifier associated with the page state at that point in its history. - */ + 'change' ); if(onReady){ @@ -48127,21 +30176,7 @@ Ext.History = (function () { startUp(); }, - /** - * Add a new token to the history stack. This can be any arbitrary value, although it would - * commonly be the concatenation of a component id and another id marking the specifc history - * state of that component. Example usage: - *
    
    -// Handle tab changes on a TabPanel
    -tabPanel.on('tabchange', function(tabPanel, tab){
    -    Ext.History.add(tabPanel.id + ':' + tab.id);
    -});
    -
    - * @param {String} token The value that defines a particular application-specific history state - * @param {Boolean} preventDuplicates When true, if the passed token matches the current token - * it will not save a new history step. Set to false if the same state can be saved more than once - * at the same history stack location (defaults to true). - */ + add: function (token, preventDup) { if(preventDup !== false){ if(this.getToken() == token){ @@ -48156,71 +30191,38 @@ tabPanel.on('tabchange', function(tabPanel, tab){ } }, - /** - * Programmatically steps back one step in browser history (equivalent to the user pressing the Back button). - */ + back: function(){ history.go(-1); }, - /** - * Programmatically steps forward one step in browser history (equivalent to the user pressing the Forward button). - */ + forward: function(){ history.go(1); }, - /** - * Retrieves the currently-active history token. - * @return {String} The token - */ + getToken: function() { return ready ? currentToken : getHash(); } }; })(); -Ext.apply(Ext.History, new Ext.util.Observable());/** - * @class Ext.Tip - * @extends Ext.Panel - * @xtype tip - * This is the base class for {@link Ext.QuickTip} and {@link Ext.Tooltip} that provides the basic layout and - * positioning that all tip-based classes require. This class can be used directly for simple, statically-positioned - * tips that are displayed programmatically, or it can be extended to provide custom tip implementations. - * @constructor - * Create a new Tip - * @param {Object} config The configuration options - */ +Ext.apply(Ext.History, new Ext.util.Observable()); Ext.Tip = Ext.extend(Ext.Panel, { - /** - * @cfg {Boolean} closable True to render a close tool button into the tooltip header (defaults to false). - */ - /** - * @cfg {Number} width - * Width in pixels of the tip (defaults to auto). Width will be ignored if it exceeds the bounds of - * {@link #minWidth} or {@link #maxWidth}. The maximum supported value is 500. - */ - /** - * @cfg {Number} minWidth The minimum width of the tip in pixels (defaults to 40). - */ + + + minWidth : 40, - /** - * @cfg {Number} maxWidth The maximum width of the tip in pixels (defaults to 300). The maximum supported value is 500. - */ + maxWidth : 300, - /** - * @cfg {Boolean/String} shadow True or "sides" for the default effect, "frame" for 4-way shadow, and "drop" - * for bottom-right shadow (defaults to "sides"). - */ + shadow : "sides", - /** - * @cfg {String} defaultAlign Experimental. The default {@link Ext.Element#alignTo} anchor position value - * for this tip relative to its element of origin (defaults to "tl-bl?"). - */ + defaultAlign : "tl-bl?", autoRender: true, quickShowInterval : 250, - // private panel overrides + frame:true, hidden:true, baseCls: 'x-tip', @@ -48229,7 +30231,7 @@ Ext.Tip = Ext.extend(Ext.Panel, { closeAction: 'hide', - // private + initComponent : function(){ Ext.Tip.superclass.initComponent.call(this); if(this.closable && !this.title){ @@ -48237,7 +30239,7 @@ Ext.Tip = Ext.extend(Ext.Panel, { } }, - // private + afterRender : function(){ Ext.Tip.superclass.afterRender.call(this); if(this.closable){ @@ -48249,14 +30251,7 @@ Ext.Tip = Ext.extend(Ext.Panel, { } }, - /** - * Shows this tip at the specified XY position. Example usage: - *
    
    -// Show the tip at x:50 and y:100
    -tip.showAt([50,100]);
    -
    - * @param {Array} xy An array containing the x and y coordinates - */ + showAt : function(xy){ Ext.Tip.superclass.show.call(this); if(this.measureWidth !== false && (!this.initialConfig || typeof this.initialConfig.width != 'number')){ @@ -48268,7 +30263,7 @@ tip.showAt([50,100]); this.setPagePosition(xy[0], xy[1]); }, - // protected + doAutoWidth : function(adjust){ adjust = adjust || 0; var bw = this.body.getTextWidth(); @@ -48278,27 +30273,14 @@ tip.showAt([50,100]); bw += this.getFrameWidth() + (this.closable ? 20 : 0) + this.body.getPadding("lr") + adjust; this.setWidth(bw.constrain(this.minWidth, this.maxWidth)); - // IE7 repaint bug on initial show + if(Ext.isIE7 && !this.repainted){ this.el.repaint(); this.repainted = true; } }, - /** - * Experimental. Shows this tip at a position relative to another element using a standard {@link Ext.Element#alignTo} - * anchor position value. Example usage: - *
    
    -// Show the tip at the default position ('tl-br?')
    -tip.showBy('my-el');
    -
    -// Show the tip's top-left corner anchored to the element's top-right corner
    -tip.showBy('my-el', 'tl-tr');
    -
    - * @param {Mixed} el An HTMLElement, Ext.Element or string id of the target element to align to - * @param {String} position (optional) A valid {@link Ext.Element#alignTo} anchor position (defaults to 'tl-br?' or - * {@link #defaultAlign} if specified). - */ + showBy : function(el, pos){ if(!this.rendered){ this.render(Ext.getBody()); @@ -48314,7 +30296,7 @@ tip.showBy('my-el', 'tl-tr'); Ext.reg('tip', Ext.Tip); -// private - custom Tip DD implementation + Ext.Tip.DD = function(tip, config){ Ext.apply(this, config); this.tip = tip; @@ -48333,117 +30315,32 @@ Ext.extend(Ext.Tip.DD, Ext.dd.DD, { endDrag : function(e){ this.tip.el.enableShadow(true); } -});/** - * @class Ext.ToolTip - * @extends Ext.Tip - * A standard tooltip implementation for providing additional information when hovering over a target element. - * @xtype tooltip - * @constructor - * Create a new Tooltip - * @param {Object} config The configuration options - */ +}); Ext.ToolTip = Ext.extend(Ext.Tip, { - /** - * When a Tooltip is configured with the {@link #delegate} - * option to cause selected child elements of the {@link #target} - * Element to each trigger a seperate show event, this property is set to - * the DOM element which triggered the show. - * @type DOMElement - * @property triggerElement - */ - /** - * @cfg {Mixed} target The target HTMLElement, Ext.Element or id to monitor - * for mouseover events to trigger showing this ToolTip. - */ - /** - * @cfg {Boolean} autoHide True to automatically hide the tooltip after the - * mouse exits the target element or after the {@link #dismissDelay} - * has expired if set (defaults to true). If {@link closable} = true - * a close tool button will be rendered into the tooltip header. - */ - /** - * @cfg {Number} showDelay Delay in milliseconds before the tooltip displays - * after the mouse enters the target element (defaults to 500) - */ + + + + showDelay : 500, - /** - * @cfg {Number} hideDelay Delay in milliseconds after the mouse exits the - * target element but before the tooltip actually hides (defaults to 200). - * Set to 0 for the tooltip to hide immediately. - */ + hideDelay : 200, - /** - * @cfg {Number} dismissDelay Delay in milliseconds before the tooltip - * automatically hides (defaults to 5000). To disable automatic hiding, set - * dismissDelay = 0. - */ + dismissDelay : 5000, - /** - * @cfg {Array} mouseOffset An XY offset from the mouse position where the - * tooltip should be shown (defaults to [15,18]). - */ - /** - * @cfg {Boolean} trackMouse True to have the tooltip follow the mouse as it - * moves over the target element (defaults to false). - */ + + trackMouse : false, - /** - * @cfg {Boolean} anchorToTarget True to anchor the tooltip to the target - * element, false to anchor it relative to the mouse coordinates (defaults - * to true). When anchorToTarget is true, use - * {@link #defaultAlign} to control tooltip alignment to the - * target element. When anchorToTarget is false, use - * {@link #anchorPosition} instead to control alignment. - */ + anchorToTarget : true, - /** - * @cfg {Number} anchorOffset A numeric pixel value used to offset the - * default position of the anchor arrow (defaults to 0). When the anchor - * position is on the top or bottom of the tooltip, anchorOffset - * will be used as a horizontal offset. Likewise, when the anchor position - * is on the left or right side, anchorOffset will be used as - * a vertical offset. - */ + anchorOffset : 0, - /** - * @cfg {String} delegate

    Optional. A {@link Ext.DomQuery DomQuery} - * selector which allows selection of individual elements within the - * {@link #target} element to trigger showing and hiding the - * ToolTip as the mouse moves within the target.

    - *

    When specified, the child element of the target which caused a show - * event is placed into the {@link #triggerElement} property - * before the ToolTip is shown.

    - *

    This may be useful when a Component has regular, repeating elements - * in it, each of which need a Tooltip which contains information specific - * to that element. For example:

    
    -var myGrid = new Ext.grid.gridPanel(gridConfig);
    -myGrid.on('render', function(grid) {
    -    var store = grid.getStore();  // Capture the Store.
    -    var view = grid.getView();    // Capture the GridView.
    -    myGrid.tip = new Ext.ToolTip({
    -        target: view.mainBody,    // The overall target element.
    -        delegate: '.x-grid3-row', // Each grid row causes its own seperate show and hide.
    -        trackMouse: true,         // Moving within the row should not hide the tip.
    -        renderTo: document.body,  // Render immediately so that tip.body can be
    -                                  //  referenced prior to the first show.
    -        listeners: {              // Change content dynamically depending on which element
    -                                  //  triggered the show.
    -            beforeshow: function updateTipBody(tip) {
    -                var rowIndex = view.findRowIndex(tip.triggerElement);
    -                tip.body.dom.innerHTML = 'Over Record ID ' + store.getAt(rowIndex).id;
    -            }
    -        }
    -    });
    -});
    -     *
    - */ + - // private + targetCounter : 0, constrainPosition : false, - // private + initComponent : function(){ Ext.ToolTip.superclass.initComponent.call(this); this.lastActive = new Date(); @@ -48451,7 +30348,7 @@ myGrid.on('render', function(grid) { this.origAnchor = this.anchor; }, - // private + onRender : function(ct, position){ Ext.ToolTip.superclass.onRender.call(this, ct, position); this.anchorCls = 'x-tip-anchor-' + this.getAnchorPosition(); @@ -48460,16 +30357,13 @@ myGrid.on('render', function(grid) { }); }, - // private + afterRender : function(){ Ext.ToolTip.superclass.afterRender.call(this); this.anchorEl.setStyle('z-index', this.el.getZIndex() + 1); }, - /** - * Binds this ToolTip to the specified element. The tooltip will be displayed when the mouse moves over the element. - * @param {Mixed} t The Element, HtmlElement, or ID of an element to bind to - */ + initTarget : function(target){ var t; if((t = Ext.get(target))){ @@ -48492,7 +30386,7 @@ myGrid.on('render', function(grid) { } }, - // private + onMouseMove : function(e){ var t = this.delegate ? e.getTarget(this.delegate) : this.triggerElement = true; if (t) { @@ -48511,7 +30405,7 @@ myGrid.on('render', function(grid) { } }, - // private + getTargetXY : function(){ if(this.delegate){ this.anchorTarget = this.triggerElement; @@ -48585,7 +30479,7 @@ myGrid.on('render', function(grid) { return offset; }, - // private + getAnchorPosition : function(){ if(this.anchor){ this.tipAnchor = this.anchor.charAt(0); @@ -48605,7 +30499,7 @@ myGrid.on('render', function(grid) { return 'left'; }, - // private + getAnchorAlign : function(){ switch(this.anchor){ case 'top' : return 'tl-bl'; @@ -48615,7 +30509,7 @@ myGrid.on('render', function(grid) { } }, - // private + getOffsets : function(){ var offsets, ap = this.getAnchorPosition().charAt(0); @@ -48657,7 +30551,7 @@ myGrid.on('render', function(grid) { return offsets; }, - // private + onTargetOver : function(e){ if(this.disabled || e.within(this.target.dom, true)){ return; @@ -48671,7 +30565,7 @@ myGrid.on('render', function(grid) { } }, - // private + delayShow : function(){ if(this.hidden && !this.showTimer){ if(this.lastActive.getElapsed() < this.quickShowInterval){ @@ -48684,7 +30578,7 @@ myGrid.on('render', function(grid) { } }, - // private + onTargetOut : function(e){ if(this.disabled || e.within(this.target.dom, true)){ return; @@ -48695,16 +30589,14 @@ myGrid.on('render', function(grid) { } }, - // private + delayHide : function(){ if(!this.hidden && !this.hideTimer){ this.hideTimer = this.hide.defer(this.hideDelay, this); } }, - /** - * Hides this tooltip if visible. - */ + hide: function(){ this.clearTimer('dismiss'); this.lastActive = new Date(); @@ -48715,13 +30607,11 @@ myGrid.on('render', function(grid) { delete this.triggerElement; }, - /** - * Shows this tooltip at the current event target XY position. - */ + show : function(){ if(this.anchor){ - // pre-show it off screen so that the el will have dimensions - // for positioning calcs when getting xy next + + this.showAt([-1000,-1000]); this.origConstrainPosition = this.constrainPosition; this.constrainPosition = false; @@ -48738,7 +30628,7 @@ myGrid.on('render', function(grid) { } }, - // inherit docs + showAt : function(xy){ this.lastActive = new Date(); this.clearTimers(); @@ -48752,7 +30642,7 @@ myGrid.on('render', function(grid) { } }, - // private + syncAnchor : function(){ var anchorPos, targetPos, offset; switch(this.tipAnchor.charAt(0)){ @@ -48780,7 +30670,7 @@ myGrid.on('render', function(grid) { this.anchorEl.alignTo(this.el, anchorPos+'-'+targetPos, offset); }, - // private + setPagePosition : function(x, y){ Ext.ToolTip.superclass.setPagePosition.call(this, x, y); if(this.anchor){ @@ -48788,33 +30678,33 @@ myGrid.on('render', function(grid) { } }, - // private + clearTimer : function(name){ name = name + 'Timer'; clearTimeout(this[name]); delete this[name]; }, - // private + clearTimers : function(){ this.clearTimer('show'); this.clearTimer('dismiss'); this.clearTimer('hide'); }, - // private + onShow : function(){ Ext.ToolTip.superclass.onShow.call(this); Ext.getDoc().on('mousedown', this.onDocMouseDown, this); }, - // private + onHide : function(){ Ext.ToolTip.superclass.onHide.call(this); Ext.getDoc().un('mousedown', this.onDocMouseDown, this); }, - // private + onDocMouseDown : function(e){ if(this.autoHide !== true && !this.closable && !e.within(this.el.dom)){ this.disable(); @@ -48822,20 +30712,20 @@ myGrid.on('render', function(grid) { } }, - // private + doEnable : function(){ if(!this.isDestroyed){ this.enable(); } }, - // private + onDisable : function(){ this.clearTimers(); this.hide(); }, - // private + adjustPosition : function(x, y){ if(this.contstrainPosition){ var ay = this.targetXY[1], h = this.getSize().height; @@ -48856,33 +30746,20 @@ myGrid.on('render', function(grid) { Ext.ToolTip.superclass.beforeDestroy.call(this); }, - // private + onDestroy : function(){ Ext.getDoc().un('mousedown', this.onDocMouseDown, this); Ext.ToolTip.superclass.onDestroy.call(this); } }); -Ext.reg('tooltip', Ext.ToolTip);/** - * @class Ext.QuickTip - * @extends Ext.ToolTip - * @xtype quicktip - * A specialized tooltip class for tooltips that can be specified in markup and automatically managed by the global - * {@link Ext.QuickTips} instance. See the QuickTips class header for additional usage details and examples. - * @constructor - * Create a new Tip - * @param {Object} config The configuration options - */ +Ext.reg('tooltip', Ext.ToolTip); Ext.QuickTip = Ext.extend(Ext.ToolTip, { - /** - * @cfg {Mixed} target The target HTMLElement, Ext.Element or id to associate with this quicktip (defaults to the document). - */ - /** - * @cfg {Boolean} interceptTitles True to automatically use the element's DOM title value if available (defaults to false). - */ + + interceptTitles : false, - // private + tagConfig : { namespace : "ext", attribute : "qtip", @@ -48895,26 +30772,14 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, { anchor : "anchor" }, - // private + initComponent : function(){ this.target = this.target || Ext.getDoc(); this.targets = this.targets || {}; Ext.QuickTip.superclass.initComponent.call(this); }, - /** - * Configures a new quick tip instance and assigns it to a target element. The following config values are - * supported (for example usage, see the {@link Ext.QuickTips} class header): - *
      - *
    • autoHide
    • - *
    • cls
    • - *
    • dismissDelay (overrides the singleton value)
    • - *
    • target (required)
    • - *
    • text (required)
    • - *
    • title
    • - *
    • width
    - * @param {Object} config The config object - */ + register : function(config){ var cs = Ext.isArray(config) ? config : arguments; for(var i = 0, len = cs.length; i < len; i++){ @@ -48932,18 +30797,12 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, { } }, - /** - * Removes this quick tip from its element and destroys it. - * @param {String/HTMLElement/Element} el The element from which the quick tip is to be removed. - */ + unregister : function(el){ delete this.targets[Ext.id(el)]; }, - /** - * Hides a visible tip or cancels an impending show for a particular element. - * @param {String/HTMLElement/Element} el The element that is the target of the tip. - */ + cancelShow: function(el){ var at = this.activeTarget; el = Ext.get(el).dom; @@ -48972,7 +30831,7 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, { return ttp; }, - // private + onTargetOver : function(e){ if(this.disabled){ return; @@ -49018,10 +30877,10 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, { } }, - // private + onTargetOut : function(e){ - // If moving within the current target, and it does not have a new tip, ignore the mouseout + if (this.activeTarget && e.within(this.activeTarget.el) && !this.getTipCfg(e)) { return; } @@ -49032,7 +30891,7 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, { } }, - // inherit docs + showAt : function(xy){ var t = this.activeTarget; if(t){ @@ -49061,7 +30920,7 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, { } if(this.anchor){ this.constrainPosition = false; - }else if(t.align){ // TODO: this doesn't seem to work consistently + }else if(t.align){ xy = this.el.getAlignToXY(t.el, t.align); this.constrainPosition = false; }else{ @@ -49071,87 +30930,17 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, { Ext.QuickTip.superclass.showAt.call(this, xy); }, - // inherit docs + hide: function(){ delete this.activeTarget; Ext.QuickTip.superclass.hide.call(this); } }); -Ext.reg('quicktip', Ext.QuickTip);/** - * @class Ext.QuickTips - *

    Provides attractive and customizable tooltips for any element. The QuickTips - * singleton is used to configure and manage tooltips globally for multiple elements - * in a generic manner. To create individual tooltips with maximum customizability, - * you should consider either {@link Ext.Tip} or {@link Ext.ToolTip}.

    - *

    Quicktips can be configured via tag attributes directly in markup, or by - * registering quick tips programmatically via the {@link #register} method.

    - *

    The singleton's instance of {@link Ext.QuickTip} is available via - * {@link #getQuickTip}, and supports all the methods, and all the all the - * configuration properties of Ext.QuickTip. These settings will apply to all - * tooltips shown by the singleton.

    - *

    Below is the summary of the configuration properties which can be used. - * For detailed descriptions see {@link #getQuickTip}

    - *

    QuickTips singleton configs (all are optional)

    - *
    • dismissDelay
    • - *
    • hideDelay
    • - *
    • maxWidth
    • - *
    • minWidth
    • - *
    • showDelay
    • - *
    • trackMouse
    - *

    Target element configs (optional unless otherwise noted)

    - *
    • autoHide
    • - *
    • cls
    • - *
    • dismissDelay (overrides singleton value)
    • - *
    • target (required)
    • - *
    • text (required)
    • - *
    • title
    • - *
    • width
    - *

    Here is an example showing how some of these config options could be used:

    - *
    
    -// Init the singleton.  Any tag-based quick tips will start working.
    -Ext.QuickTips.init();
    -
    -// Apply a set of config properties to the singleton
    -Ext.apply(Ext.QuickTips.getQuickTip(), {
    -    maxWidth: 200,
    -    minWidth: 100,
    -    showDelay: 50,
    -    trackMouse: true
    -});
    -
    -// Manually register a quick tip for a specific element
    -Ext.QuickTips.register({
    -    target: 'my-div',
    -    title: 'My Tooltip',
    -    text: 'This tooltip was added in code',
    -    width: 100,
    -    dismissDelay: 20
    -});
    -
    - *

    To register a quick tip in markup, you simply add one or more of the valid QuickTip attributes prefixed with - * the ext: namespace. The HTML element itself is automatically set as the quick tip target. Here is the summary - * of supported attributes (optional unless otherwise noted):

    - *
    • hide: Specifying "user" is equivalent to setting autoHide = false. Any other value will be the - * same as autoHide = true.
    • - *
    • qclass: A CSS class to be applied to the quick tip (equivalent to the 'cls' target element config).
    • - *
    • qtip (required): The quick tip text (equivalent to the 'text' target element config).
    • - *
    • qtitle: The quick tip title (equivalent to the 'title' target element config).
    • - *
    • qwidth: The quick tip width (equivalent to the 'width' target element config).
    - *

    Here is an example of configuring an HTML element to display a tooltip from markup:

    - *
    
    -// Add a quick tip to an HTML button
    -<input type="button" value="OK" ext:qtitle="OK Button" ext:qwidth="100"
    -     ext:qtip="This is a quick tip from markup!"></input>
    -
    - * @singleton - */ +Ext.reg('quicktip', Ext.QuickTip); Ext.QuickTips = function(){ var tip, locks = []; return { - /** - * Initialize the global QuickTips instance and prepare any quick tips. - * @param {Boolean} autoRender True to render the QuickTips container immediately to preload images. (Defaults to true) - */ + init : function(autoRender){ if(!tip){ if(!Ext.isReady){ @@ -49167,9 +30956,7 @@ Ext.QuickTips = function(){ } }, - /** - * Enable quick tips globally. - */ + enable : function(){ if(tip){ locks.pop(); @@ -49179,9 +30966,7 @@ Ext.QuickTips = function(){ } }, - /** - * Disable quick tips globally. - */ + disable : function(){ if(tip){ tip.disable(); @@ -49189,72 +30974,32 @@ Ext.QuickTips = function(){ locks.push(1); }, - /** - * Returns true if quick tips are enabled, else false. - * @return {Boolean} - */ + isEnabled : function(){ return tip !== undefined && !tip.disabled; }, - /** - * Gets the global QuickTips instance. - */ + getQuickTip : function(){ return tip; }, - /** - * Configures a new quick tip instance and assigns it to a target element. See - * {@link Ext.QuickTip#register} for details. - * @param {Object} config The config object - */ + register : function(){ tip.register.apply(tip, arguments); }, - /** - * Removes any registered quick tip from the target element and destroys it. - * @param {String/HTMLElement/Element} el The element from which the quick tip is to be removed. - */ + unregister : function(){ tip.unregister.apply(tip, arguments); }, - /** - * Alias of {@link #register}. - * @param {Object} config The config object - */ + tips :function(){ tip.register.apply(tip, arguments); } } -}();/** - * @class Ext.slider.Tip - * @extends Ext.Tip - * Simple plugin for using an Ext.Tip with a slider to show the slider value. Example usage: -
    -new Ext.Slider({
    -    width: 214,
    -    minValue: 0,
    -    maxValue: 100,
    -    plugins: new Ext.slider.Tip()
    -});
    -
    - * Optionally provide your own tip text by overriding getText: -
    - new Ext.Slider({
    -     width: 214,
    -     minValue: 0,
    -     maxValue: 100,
    -     plugins: new Ext.slider.Tip({
    -         getText: function(thumb){
    -             return String.format('{0}% complete', thumb.value);
    -         }
    -     })
    - });
    - 
    - */ +}(); Ext.slider.Tip = Ext.extend(Ext.Tip, { minWidth: 10, offsets : [0, -10], @@ -49269,14 +31014,7 @@ Ext.slider.Tip = Ext.extend(Ext.Tip, { }); }, - /** - * @private - * Called whenever a dragstart or drag event is received on the associated Thumb. - * Aligns the Tip with the Thumb's new position. - * @param {Ext.slider.MultiSlider} slider The slider - * @param {Ext.EventObject} e The Event object - * @param {Ext.slider.Thumb} thumb The thumb that the Tip is attached to - */ + onSlide : function(slider, e, thumb) { this.show(); this.body.update(this.getText(thumb)); @@ -49284,130 +31022,14 @@ Ext.slider.Tip = Ext.extend(Ext.Tip, { this.el.alignTo(thumb.el, 'b-t?', this.offsets); }, - /** - * Used to create the text that appears in the Tip's body. By default this just returns - * the value of the Slider Thumb that the Tip is attached to. Override to customize. - * @param {Ext.slider.Thumb} thumb The Thumb that the Tip is attached to - * @return {String} The text to display in the tip - */ + getText : function(thumb) { return String(thumb.value); } }); -//backwards compatibility - SliderTip used to be a ux before 3.2 -Ext.ux.SliderTip = Ext.slider.Tip;/** - * @class Ext.tree.TreePanel - * @extends Ext.Panel - *

    The TreePanel provides tree-structured UI representation of tree-structured data.

    - *

    {@link Ext.tree.TreeNode TreeNode}s added to the TreePanel may each contain metadata - * used by your application in their {@link Ext.tree.TreeNode#attributes attributes} property.

    - *

    A TreePanel must have a {@link #root} node before it is rendered. This may either be - * specified using the {@link #root} config option, or using the {@link #setRootNode} method. - *

    An example of tree rendered to an existing div:

    
    -var tree = new Ext.tree.TreePanel({
    -    renderTo: 'tree-div',
    -    useArrows: true,
    -    autoScroll: true,
    -    animate: true,
    -    enableDD: true,
    -    containerScroll: true,
    -    border: false,
    -    // auto create TreeLoader
    -    dataUrl: 'get-nodes.php',
    -
    -    root: {
    -        nodeType: 'async',
    -        text: 'Ext JS',
    -        draggable: false,
    -        id: 'source'
    -    }
    -});
     
    -tree.getRootNode().expand();
    - * 
    - *

    The example above would work with a data packet similar to this:

    
    -[{
    -    "text": "adapter",
    -    "id": "source\/adapter",
    -    "cls": "folder"
    -}, {
    -    "text": "dd",
    -    "id": "source\/dd",
    -    "cls": "folder"
    -}, {
    -    "text": "debug.js",
    -    "id": "source\/debug.js",
    -    "leaf": true,
    -    "cls": "file"
    -}]
    - * 
    - *

    An example of tree within a Viewport:

    
    -new Ext.Viewport({
    -    layout: 'border',
    -    items: [{
    -        region: 'west',
    -        collapsible: true,
    -        title: 'Navigation',
    -        xtype: 'treepanel',
    -        width: 200,
    -        autoScroll: true,
    -        split: true,
    -        loader: new Ext.tree.TreeLoader(),
    -        root: new Ext.tree.AsyncTreeNode({
    -            expanded: true,
    -            children: [{
    -                text: 'Menu Option 1',
    -                leaf: true
    -            }, {
    -                text: 'Menu Option 2',
    -                leaf: true
    -            }, {
    -                text: 'Menu Option 3',
    -                leaf: true
    -            }]
    -        }),
    -        rootVisible: false,
    -        listeners: {
    -            click: function(n) {
    -                Ext.Msg.alert('Navigation Tree Click', 'You clicked: "' + n.attributes.text + '"');
    -            }
    -        }
    -    }, {
    -        region: 'center',
    -        xtype: 'tabpanel',
    -        // remaining code not shown ...
    -    }]
    -});
    -
    - * - * @cfg {Ext.tree.TreeNode} root The root node for the tree. - * @cfg {Boolean} rootVisible false to hide the root node (defaults to true) - * @cfg {Boolean} lines false to disable tree lines (defaults to true) - * @cfg {Boolean} enableDD true to enable drag and drop - * @cfg {Boolean} enableDrag true to enable just drag - * @cfg {Boolean} enableDrop true to enable just drop - * @cfg {Object} dragConfig Custom config to pass to the {@link Ext.tree.TreeDragZone} instance - * @cfg {Object} dropConfig Custom config to pass to the {@link Ext.tree.TreeDropZone} instance - * @cfg {String} ddGroup The DD group this TreePanel belongs to - * @cfg {Boolean} ddAppendOnly true if the tree should only allow append drops (use for trees which are sorted) - * @cfg {Boolean} ddScroll true to enable body scrolling - * @cfg {Boolean} containerScroll true to register this container with ScrollManager - * @cfg {Boolean} hlDrop false to disable node highlight on drop (defaults to the value of {@link Ext#enableFx}) - * @cfg {String} hlColor The color of the node highlight (defaults to 'C3DAF9') - * @cfg {Boolean} animate true to enable animated expand/collapse (defaults to the value of {@link Ext#enableFx}) - * @cfg {Boolean} singleExpand true if only 1 node per branch may be expanded - * @cfg {Object} selModel A tree selection model to use with this TreePanel (defaults to an {@link Ext.tree.DefaultSelectionModel}) - * @cfg {Boolean} trackMouseOver false to disable mouse over highlighting - * @cfg {Ext.tree.TreeLoader} loader A {@link Ext.tree.TreeLoader} for use with this TreePanel - * @cfg {String} pathSeparator The token used to separate sub-paths in path strings (defaults to '/') - * @cfg {Boolean} useArrows true to use Vista-style arrows in the tree (defaults to false) - * @cfg {String} requestMethod The HTTP request method for loading data (defaults to the value of {@link Ext.Ajax#method}). - * - * @constructor - * @param {Object} config - * @xtype treepanel - */ +Ext.ux.SliderTip = Ext.slider.Tip; Ext.tree.TreePanel = Ext.extend(Ext.Panel, { rootVisible : true, animate : Ext.enableFx, @@ -49416,12 +31038,7 @@ Ext.tree.TreePanel = Ext.extend(Ext.Panel, { hlDrop : Ext.enableFx, pathSeparator : '/', - /** - * @cfg {Array} bubbleEvents - *

    An array of events that, when fired, should be bubbled to any parent container. - * See {@link Ext.util.Observable#enableBubble}. - * Defaults to []. - */ + bubbleEvents : [], initComponent : function(){ @@ -49431,7 +31048,7 @@ Ext.tree.TreePanel = Ext.extend(Ext.Panel, { this.eventModel = new Ext.tree.TreeEventModel(this); } - // initialize the loader + var l = this.loader; if(!l){ l = new Ext.tree.TreeLoader({ @@ -49445,11 +31062,7 @@ Ext.tree.TreePanel = Ext.extend(Ext.Panel, { this.nodeHash = {}; - /** - * The root node of this tree. - * @type Ext.tree.TreeNode - * @property root - */ + if(this.root){ var r = this.root; delete this.root; @@ -49459,320 +31072,70 @@ Ext.tree.TreePanel = Ext.extend(Ext.Panel, { this.addEvents( - /** - * @event append - * Fires when a new child node is appended to a node in this tree. - * @param {Tree} tree The owner tree - * @param {Node} parent The parent node - * @param {Node} node The newly appended node - * @param {Number} index The index of the newly appended node - */ + 'append', - /** - * @event remove - * Fires when a child node is removed from a node in this tree. - * @param {Tree} tree The owner tree - * @param {Node} parent The parent node - * @param {Node} node The child node removed - */ + 'remove', - /** - * @event movenode - * Fires when a node is moved to a new location in the tree - * @param {Tree} tree The owner tree - * @param {Node} node The node moved - * @param {Node} oldParent The old parent of this node - * @param {Node} newParent The new parent of this node - * @param {Number} index The index it was moved to - */ + 'movenode', - /** - * @event insert - * Fires when a new child node is inserted in a node in this tree. - * @param {Tree} tree The owner tree - * @param {Node} parent The parent node - * @param {Node} node The child node inserted - * @param {Node} refNode The child node the node was inserted before - */ + 'insert', - /** - * @event beforeappend - * Fires before a new child is appended to a node in this tree, return false to cancel the append. - * @param {Tree} tree The owner tree - * @param {Node} parent The parent node - * @param {Node} node The child node to be appended - */ + 'beforeappend', - /** - * @event beforeremove - * Fires before a child is removed from a node in this tree, return false to cancel the remove. - * @param {Tree} tree The owner tree - * @param {Node} parent The parent node - * @param {Node} node The child node to be removed - */ + 'beforeremove', - /** - * @event beforemovenode - * Fires before a node is moved to a new location in the tree. Return false to cancel the move. - * @param {Tree} tree The owner tree - * @param {Node} node The node being moved - * @param {Node} oldParent The parent of the node - * @param {Node} newParent The new parent the node is moving to - * @param {Number} index The index it is being moved to - */ + 'beforemovenode', - /** - * @event beforeinsert - * Fires before a new child is inserted in a node in this tree, return false to cancel the insert. - * @param {Tree} tree The owner tree - * @param {Node} parent The parent node - * @param {Node} node The child node to be inserted - * @param {Node} refNode The child node the node is being inserted before - */ + 'beforeinsert', - /** - * @event beforeload - * Fires before a node is loaded, return false to cancel - * @param {Node} node The node being loaded - */ + 'beforeload', - /** - * @event load - * Fires when a node is loaded - * @param {Node} node The node that was loaded - */ + 'load', - /** - * @event textchange - * Fires when the text for a node is changed - * @param {Node} node The node - * @param {String} text The new text - * @param {String} oldText The old text - */ + 'textchange', - /** - * @event beforeexpandnode - * Fires before a node is expanded, return false to cancel. - * @param {Node} node The node - * @param {Boolean} deep - * @param {Boolean} anim - */ + 'beforeexpandnode', - /** - * @event beforecollapsenode - * Fires before a node is collapsed, return false to cancel. - * @param {Node} node The node - * @param {Boolean} deep - * @param {Boolean} anim - */ + 'beforecollapsenode', - /** - * @event expandnode - * Fires when a node is expanded - * @param {Node} node The node - */ + 'expandnode', - /** - * @event disabledchange - * Fires when the disabled status of a node changes - * @param {Node} node The node - * @param {Boolean} disabled - */ + 'disabledchange', - /** - * @event collapsenode - * Fires when a node is collapsed - * @param {Node} node The node - */ + 'collapsenode', - /** - * @event beforeclick - * Fires before click processing on a node. Return false to cancel the default action. - * @param {Node} node The node - * @param {Ext.EventObject} e The event object - */ + 'beforeclick', - /** - * @event click - * Fires when a node is clicked - * @param {Node} node The node - * @param {Ext.EventObject} e The event object - */ + 'click', - /** - * @event containerclick - * Fires when the tree container is clicked - * @param {Tree} this - * @param {Ext.EventObject} e The event object - */ + 'containerclick', - /** - * @event checkchange - * Fires when a node with a checkbox's checked property changes - * @param {Node} this This node - * @param {Boolean} checked - */ + 'checkchange', - /** - * @event beforedblclick - * Fires before double click processing on a node. Return false to cancel the default action. - * @param {Node} node The node - * @param {Ext.EventObject} e The event object - */ + 'beforedblclick', - /** - * @event dblclick - * Fires when a node is double clicked - * @param {Node} node The node - * @param {Ext.EventObject} e The event object - */ + 'dblclick', - /** - * @event containerdblclick - * Fires when the tree container is double clicked - * @param {Tree} this - * @param {Ext.EventObject} e The event object - */ + 'containerdblclick', - /** - * @event contextmenu - * Fires when a node is right clicked. To display a context menu in response to this - * event, first create a Menu object (see {@link Ext.menu.Menu} for details), then add - * a handler for this event:

    
    -new Ext.tree.TreePanel({
    -    title: 'My TreePanel',
    -    root: new Ext.tree.AsyncTreeNode({
    -        text: 'The Root',
    -        children: [
    -            { text: 'Child node 1', leaf: true },
    -            { text: 'Child node 2', leaf: true }
    -        ]
    -    }),
    -    contextMenu: new Ext.menu.Menu({
    -        items: [{
    -            id: 'delete-node',
    -            text: 'Delete Node'
    -        }],
    -        listeners: {
    -            itemclick: function(item) {
    -                switch (item.id) {
    -                    case 'delete-node':
    -                        var n = item.parentMenu.contextNode;
    -                        if (n.parentNode) {
    -                            n.remove();
    -                        }
    -                        break;
    -                }
    -            }
    -        }
    -    }),
    -    listeners: {
    -        contextmenu: function(node, e) {
    -//          Register the context node with the menu so that a Menu Item's handler function can access
    -//          it via its {@link Ext.menu.BaseItem#parentMenu parentMenu} property.
    -            node.select();
    -            var c = node.getOwnerTree().contextMenu;
    -            c.contextNode = node;
    -            c.showAt(e.getXY());
    -        }
    -    }
    -});
    -
    - * @param {Node} node The node - * @param {Ext.EventObject} e The event object - */ + 'contextmenu', - /** - * @event containercontextmenu - * Fires when the tree container is right clicked - * @param {Tree} this - * @param {Ext.EventObject} e The event object - */ + 'containercontextmenu', - /** - * @event beforechildrenrendered - * Fires right before the child nodes for a node are rendered - * @param {Node} node The node - */ + 'beforechildrenrendered', - /** - * @event startdrag - * Fires when a node starts being dragged - * @param {Ext.tree.TreePanel} this - * @param {Ext.tree.TreeNode} node - * @param {event} e The raw browser event - */ + 'startdrag', - /** - * @event enddrag - * Fires when a drag operation is complete - * @param {Ext.tree.TreePanel} this - * @param {Ext.tree.TreeNode} node - * @param {event} e The raw browser event - */ + 'enddrag', - /** - * @event dragdrop - * Fires when a dragged node is dropped on a valid DD target - * @param {Ext.tree.TreePanel} this - * @param {Ext.tree.TreeNode} node - * @param {DD} dd The dd it was dropped on - * @param {event} e The raw browser event - */ + 'dragdrop', - /** - * @event beforenodedrop - * Fires when a DD object is dropped on a node in this tree for preprocessing. Return false to cancel the drop. The dropEvent - * passed to handlers has the following properties:
    - *
      - *
    • tree - The TreePanel
    • - *
    • target - The node being targeted for the drop
    • - *
    • data - The drag data from the drag source
    • - *
    • point - The point of the drop - append, above or below
    • - *
    • source - The drag source
    • - *
    • rawEvent - Raw mouse event
    • - *
    • dropNode - Drop node(s) provided by the source OR you can supply node(s) - * to be inserted by setting them on this object.
    • - *
    • cancel - Set this to true to cancel the drop.
    • - *
    • dropStatus - If the default drop action is cancelled but the drop is valid, setting this to true - * will prevent the animated 'repair' from appearing.
    • - *
    - * @param {Object} dropEvent - */ + 'beforenodedrop', - /** - * @event nodedrop - * Fires after a DD object is dropped on a node in this tree. The dropEvent - * passed to handlers has the following properties:
    - *
      - *
    • tree - The TreePanel
    • - *
    • target - The node being targeted for the drop
    • - *
    • data - The drag data from the drag source
    • - *
    • point - The point of the drop - append, above or below
    • - *
    • source - The drag source
    • - *
    • rawEvent - Raw mouse event
    • - *
    • dropNode - Dropped node(s).
    • - *
    - * @param {Object} dropEvent - */ + 'nodedrop', - /** - * @event nodedragover - * Fires when a tree node is being targeted for a drag drop, return false to signal drop not allowed. The dragOverEvent - * passed to handlers has the following properties:
    - *
      - *
    • tree - The TreePanel
    • - *
    • target - The node being targeted for the drop
    • - *
    • data - The drag data from the drag source
    • - *
    • point - The point of the drop - append, above or below
    • - *
    • source - The drag source
    • - *
    • rawEvent - Raw mouse event
    • - *
    • dropNode - Drop node(s) provided by the source.
    • - *
    • cancel - Set this to true to signal drop not allowed.
    • - *
    - * @param {Object} dragOverEvent - */ + 'nodedragover' ); if(this.singleExpand){ @@ -49780,33 +31143,25 @@ new Ext.tree.TreePanel({ } }, - // private + proxyNodeEvent : function(ename, a1, a2, a3, a4, a5, a6){ if(ename == 'collapse' || ename == 'expand' || ename == 'beforecollapse' || ename == 'beforeexpand' || ename == 'move' || ename == 'beforemove'){ ename = ename+'node'; } - // args inline for performance while bubbling events + return this.fireEvent(ename, a1, a2, a3, a4, a5, a6); }, - /** - * Returns this root node for this tree - * @return {Node} - */ + getRootNode : function(){ return this.root; }, - /** - * Sets the root node for this tree. If the TreePanel has already rendered a root node, the - * previous root node (and all of its descendants) are destroyed before the new root node is rendered. - * @param {Node} node - * @return {Node} - */ + setRootNode : function(node){ this.destroyRoot(); - if(!node.render){ // attributes passed + if(!node.render){ node = this.loader.createNode(node); } this.root = node; @@ -49828,7 +31183,7 @@ new Ext.tree.TreePanel({ this.innerCt.update(''); }, - // private + renderRoot : function(){ this.root.render(); if(!this.rootVisible){ @@ -49836,31 +31191,27 @@ new Ext.tree.TreePanel({ } }, - /** - * Gets a node in this tree by its id - * @param {String} id - * @return {Node} - */ + getNodeById : function(id){ return this.nodeHash[id]; }, - // private + registerNode : function(node){ this.nodeHash[node.id] = node; }, - // private + unregisterNode : function(node){ delete this.nodeHash[node.id]; }, - // private + toString : function(){ return '[Tree'+(this.id?' '+this.id:'')+']'; }, - // private + restrictExpand : function(node){ var p = node.parentNode; if(p){ @@ -49871,12 +31222,7 @@ new Ext.tree.TreePanel({ } }, - /** - * Retrieve an array of checked nodes, or an array of a specific attribute of checked nodes (e.g. 'id') - * @param {String} attribute (optional) Defaults to null (return the actual nodes) - * @param {TreeNode} startNode (optional) The node to start from, defaults to the root - * @return {Array} - */ + getChecked : function(a, startNode){ startNode = startNode || this.root; var r = []; @@ -49889,32 +31235,22 @@ new Ext.tree.TreePanel({ return r; }, - /** - * Returns the default {@link Ext.tree.TreeLoader} for this TreePanel. - * @return {Ext.tree.TreeLoader} The TreeLoader for this TreePanel. - */ + getLoader : function(){ return this.loader; }, - /** - * Expand all nodes - */ + expandAll : function(){ this.root.expand(true); }, - /** - * Collapse all nodes - */ + collapseAll : function(){ this.root.collapse(true); }, - /** - * Returns the selection model used by this TreePanel. - * @return {TreeSelectionModel} The selection model used by this TreePanel - */ + getSelectionModel : function(){ if(!this.selModel){ this.selModel = new Ext.tree.DefaultSelectionModel(); @@ -49922,18 +31258,12 @@ new Ext.tree.TreePanel({ return this.selModel; }, - /** - * Expands a specified path in this TreePanel. A path can be retrieved from a node with {@link Ext.data.Node#getPath} - * @param {String} path - * @param {String} attr (optional) The attribute used in the path (see {@link Ext.data.Node#getPath} for more info) - * @param {Function} callback (optional) The callback to call when the expand is complete. The callback will be called with - * (bSuccess, oLastNode) where bSuccess is if the expand was successful and oLastNode is the last node that was expanded. - */ + expandPath : function(path, attr, callback){ attr = attr || 'id'; var keys = path.split(this.pathSeparator); var curNode = this.root; - if(curNode.attributes[attr] != keys[1]){ // invalid root + if(curNode.attributes[attr] != keys[1]){ if(callback){ callback(false, null); } @@ -49960,13 +31290,7 @@ new Ext.tree.TreePanel({ curNode.expand(false, false, f); }, - /** - * Selects the node in this tree at the specified path. A path can be retrieved from a node with {@link Ext.data.Node#getPath} - * @param {String} path - * @param {String} attr (optional) The attribute used in the path (see {@link Ext.data.Node#getPath} for more info) - * @param {Function} callback (optional) The callback to call when the selection is complete. The callback will be called with - * (bSuccess, oSelNode) where bSuccess is if the selection was successful and oSelNode is the selected node. - */ + selectPath : function(path, attr, callback){ attr = attr || 'id'; var keys = path.split(this.pathSeparator), @@ -49998,15 +31322,12 @@ new Ext.tree.TreePanel({ } }, - /** - * Returns the underlying Element for this tree - * @return {Ext.Element} The Element - */ + getTreeEl : function(){ return this.body; }, - // private + onRender : function(ct, position){ Ext.tree.TreePanel.superclass.onRender.call(this, ct, position); this.el.addClass('x-tree'); @@ -50015,7 +31336,7 @@ new Ext.tree.TreePanel({ (this.useArrows ? 'x-tree-arrows' : this.lines ? 'x-tree-lines' : 'x-tree-no-lines')}); }, - // private + initEvents : function(){ Ext.tree.TreePanel.superclass.initEvents.call(this); @@ -50023,21 +31344,13 @@ new Ext.tree.TreePanel({ Ext.dd.ScrollManager.register(this.body); } if((this.enableDD || this.enableDrop) && !this.dropZone){ - /** - * The dropZone used by this tree if drop is enabled (see {@link #enableDD} or {@link #enableDrop}) - * @property dropZone - * @type Ext.tree.TreeDropZone - */ + this.dropZone = new Ext.tree.TreeDropZone(this, this.dropConfig || { ddGroup: this.ddGroup || 'TreeDD', appendOnly: this.ddAppendOnly === true }); } if((this.enableDD || this.enableDrag) && !this.dragZone){ - /** - * The dragZone used by this tree if drag is enabled (see {@link #enableDD} or {@link #enableDrag}) - * @property dragZone - * @type Ext.tree.TreeDragZone - */ + this.dragZone = new Ext.tree.TreeDragZone(this, this.dragConfig || { ddGroup: this.ddGroup || 'TreeDD', scroll: this.ddScroll @@ -50046,7 +31359,7 @@ new Ext.tree.TreePanel({ this.getSelectionModel().init(this); }, - // private + afterRender : function(){ Ext.tree.TreePanel.superclass.afterRender.call(this); this.renderRoot(); @@ -50063,197 +31376,63 @@ new Ext.tree.TreePanel({ Ext.tree.TreePanel.superclass.beforeDestroy.call(this); }, - /** - * Destroy the root node. Not included by itself because we need to pass the silent parameter. - * @private - */ + destroyRoot : function(){ if(this.root && this.root.destroy){ this.root.destroy(true); } } - /** - * @cfg {String/Number} activeItem - * @hide - */ - /** - * @cfg {Boolean} autoDestroy - * @hide - */ - /** - * @cfg {Object/String/Function} autoLoad - * @hide - */ - /** - * @cfg {Boolean} autoWidth - * @hide - */ - /** - * @cfg {Boolean/Number} bufferResize - * @hide - */ - /** - * @cfg {String} defaultType - * @hide - */ - /** - * @cfg {Object} defaults - * @hide - */ - /** - * @cfg {Boolean} hideBorders - * @hide - */ - /** - * @cfg {Mixed} items - * @hide - */ - /** - * @cfg {String} layout - * @hide - */ - /** - * @cfg {Object} layoutConfig - * @hide - */ - /** - * @cfg {Boolean} monitorResize - * @hide - */ - /** - * @property items - * @hide - */ - /** - * @method cascade - * @hide - */ - /** - * @method doLayout - * @hide - */ - /** - * @method find - * @hide - */ - /** - * @method findBy - * @hide - */ - /** - * @method findById - * @hide - */ - /** - * @method findByType - * @hide - */ - /** - * @method getComponent - * @hide - */ - /** - * @method getLayout - * @hide - */ - /** - * @method getUpdater - * @hide - */ - /** - * @method insert - * @hide - */ - /** - * @method load - * @hide - */ - /** - * @method remove - * @hide - */ - /** - * @event add - * @hide - */ - /** - * @method removeAll - * @hide - */ - /** - * @event afterLayout - * @hide - */ - /** - * @event beforeadd - * @hide - */ - /** - * @event beforeremove - * @hide - */ - /** - * @event remove - * @hide - */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - /** - * @cfg {String} allowDomMove @hide - */ - /** - * @cfg {String} autoEl @hide - */ - /** - * @cfg {String} applyTo @hide - */ - /** - * @cfg {String} contentEl @hide - */ - /** - * @cfg {Mixed} data @hide - */ - /** - * @cfg {Mixed} tpl @hide - */ - /** - * @cfg {String} tplWriteMode @hide - */ - /** - * @cfg {String} disabledClass @hide - */ - /** - * @cfg {String} elements @hide - */ - /** - * @cfg {String} html @hide - */ - /** - * @cfg {Boolean} preventBodyReset - * @hide - */ - /** - * @property disabled - * @hide - */ - /** - * @method applyToMarkup - * @hide - */ - /** - * @method enable - * @hide - */ - /** - * @method disable - * @hide - */ - /** - * @method setDisabled - * @hide - */ + + + + + + + + + + + + + + + + }); Ext.tree.TreePanel.nodeTypes = {}; @@ -50321,11 +31500,11 @@ Ext.tree.TreeEventModel.prototype = { if(!this.beforeEvent(e)){ return; } - if(Ext.isGecko && !this.trackingDoc){ // prevent hanging in FF + if(Ext.isGecko && !this.trackingDoc){ Ext.getBody().on('mouseover', this.trackExit, this); this.trackingDoc = true; } - if(this.lastEcOver){ // prevent hung highlight + if(this.lastEcOver){ this.onIconOut(e, this.lastEcOver); delete this.lastEcOver; } @@ -50449,38 +31628,24 @@ Ext.tree.TreeEventModel.prototype = { enable: function(){ this.disabled = false; } -};/** - * @class Ext.tree.DefaultSelectionModel - * @extends Ext.util.Observable - * The default single selection for a TreePanel. - */ -Ext.tree.DefaultSelectionModel = function(config){ - this.selNode = null; +}; +Ext.tree.DefaultSelectionModel = Ext.extend(Ext.util.Observable, { + + constructor : function(config){ + this.selNode = null; - this.addEvents( - /** - * @event selectionchange - * Fires when the selected node changes - * @param {DefaultSelectionModel} this - * @param {TreeNode} node the new selection - */ - 'selectionchange', - - /** - * @event beforeselect - * Fires before the selected node changes, return false to cancel the change - * @param {DefaultSelectionModel} this - * @param {TreeNode} node the new selection - * @param {TreeNode} node the old selection - */ - 'beforeselect' - ); + this.addEvents( + + 'selectionchange', - Ext.apply(this, config); - Ext.tree.DefaultSelectionModel.superclass.constructor.call(this); -}; + + 'beforeselect' + ); -Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, { + Ext.apply(this, config); + Ext.tree.DefaultSelectionModel.superclass.constructor.call(this); + }, + init : function(tree){ this.tree = tree; tree.mon(tree.getTreeEl(), 'keydown', this.onKeyDown, this); @@ -50491,13 +31656,9 @@ Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, { this.select(node); }, - /** - * Select a node. - * @param {TreeNode} node The node to select - * @return {TreeNode} The selected node - */ - select : function(node, /* private*/ selectNextNode){ - // If node is hidden, select the next node in whatever direction was being moved in. + + select : function(node, selectNextNode){ + if (!Ext.fly(node.ui.wrap).isVisible() && selectNextNode) { return selectNextNode.call(this, node); } @@ -50515,21 +31676,14 @@ Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, { return node; }, - /** - * Deselect a node. - * @param {TreeNode} node The node to unselect - * @param {Boolean} silent True to stop the selectionchange event from firing. - */ + unselect : function(node, silent){ if(this.selNode == node){ this.clearSelections(silent); } }, - /** - * Clear all selections - * @param {Boolean} silent True to stop the selectionchange event from firing. - */ + clearSelections : function(silent){ var n = this.selNode; if(n){ @@ -50542,32 +31696,22 @@ Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, { return n; }, - /** - * Get the selected node - * @return {TreeNode} The selected node - */ + getSelectedNode : function(){ return this.selNode; }, - /** - * Returns true if the node is selected - * @param {TreeNode} node The node to check - * @return {Boolean} - */ + isSelected : function(node){ return this.selNode == node; }, - /** - * Selects the node above the selected node in the tree, intelligently walking the nodes - * @return TreeNode The new selection - */ - selectPrevious : function(/* private */ s){ + + selectPrevious : function( s){ if(!(s = s || this.selNode || this.lastSelNode)){ return null; } - // Here we pass in the current function to select to indicate the direction we're moving + var ps = s.previousSibling; if(ps){ if(!ps.isExpanded() || ps.childNodes.length < 1){ @@ -50585,15 +31729,12 @@ Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, { return null; }, - /** - * Selects the node above the selected node in the tree, intelligently walking the nodes - * @return TreeNode The new selection - */ - selectNext : function(/* private */ s){ + + selectNext : function( s){ if(!(s = s || this.selNode || this.lastSelNode)){ return null; } - // Here we pass in the current function to select to indicate the direction we're moving + if(s.firstChild && s.isExpanded() && Ext.fly(s.ui.wrap).isVisible()){ return this.select(s.firstChild, this.selectNext); }else if(s.nextSibling){ @@ -50613,7 +31754,7 @@ Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, { onKeyDown : function(e){ var s = this.selNode || this.lastSelNode; - // undesirable, but required + var sm = this; if(!s){ return; @@ -50650,28 +31791,20 @@ Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, { } }); -/** - * @class Ext.tree.MultiSelectionModel - * @extends Ext.util.Observable - * Multi selection for a TreePanel. - */ -Ext.tree.MultiSelectionModel = function(config){ - this.selNodes = []; - this.selMap = {}; - this.addEvents( - /** - * @event selectionchange - * Fires when the selected nodes change - * @param {MultiSelectionModel} this - * @param {Array} nodes Array of the selected nodes - */ - 'selectionchange' - ); - Ext.apply(this, config); - Ext.tree.MultiSelectionModel.superclass.constructor.call(this); -}; -Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, { +Ext.tree.MultiSelectionModel = Ext.extend(Ext.util.Observable, { + + constructor : function(config){ + this.selNodes = []; + this.selMap = {}; + this.addEvents( + + 'selectionchange' + ); + Ext.apply(this, config); + Ext.tree.MultiSelectionModel.superclass.constructor.call(this); + }, + init : function(tree){ this.tree = tree; tree.mon(tree.getTreeEl(), 'keydown', this.onKeyDown, this); @@ -50686,13 +31819,7 @@ Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, { } }, - /** - * Select a node. - * @param {TreeNode} node The node to select - * @param {EventObject} e (optional) An event associated with the selection - * @param {Boolean} keepExisting True to retain existing selections - * @return {TreeNode} The selected node - */ + select : function(node, e, keepExisting){ if(keepExisting !== true){ this.clearSelections(true); @@ -50709,10 +31836,7 @@ Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, { return node; }, - /** - * Deselect a node. - * @param {TreeNode} node The node to unselect - */ + unselect : function(node){ if(this.selMap[node.id]){ node.ui.onSelectedChange(false); @@ -50726,9 +31850,7 @@ Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, { } }, - /** - * Clear all selections - */ + clearSelections : function(suppressEvent){ var sn = this.selNodes; if(sn.length > 0){ @@ -50743,21 +31865,14 @@ Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, { } }, - /** - * Returns true if the node is selected - * @param {TreeNode} node The node to check - * @return {Boolean} - */ + isSelected : function(node){ return this.selMap[node.id] ? true : false; }, - /** - * Returns an array of the selected nodes - * @return {Array} - */ + getSelectedNodes : function(){ - return this.selNodes; + return this.selNodes.concat([]); }, onKeyDown : Ext.tree.DefaultSelectionModel.prototype.onKeyDown, @@ -50765,95 +31880,30 @@ Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, { selectNext : Ext.tree.DefaultSelectionModel.prototype.selectNext, selectPrevious : Ext.tree.DefaultSelectionModel.prototype.selectPrevious -});/** - * @class Ext.data.Tree - * @extends Ext.util.Observable - * Represents a tree data structure and bubbles all the events for its nodes. The nodes - * in the tree have most standard DOM functionality. - * @constructor - * @param {Node} root (optional) The root node - */ +}); Ext.data.Tree = function(root){ this.nodeHash = {}; - /** - * The root node for this tree - * @type Node - */ + this.root = null; if(root){ this.setRootNode(root); } this.addEvents( - /** - * @event append - * Fires when a new child node is appended to a node in this tree. - * @param {Tree} tree The owner tree - * @param {Node} parent The parent node - * @param {Node} node The newly appended node - * @param {Number} index The index of the newly appended node - */ + "append", - /** - * @event remove - * Fires when a child node is removed from a node in this tree. - * @param {Tree} tree The owner tree - * @param {Node} parent The parent node - * @param {Node} node The child node removed - */ + "remove", - /** - * @event move - * Fires when a node is moved to a new location in the tree - * @param {Tree} tree The owner tree - * @param {Node} node The node moved - * @param {Node} oldParent The old parent of this node - * @param {Node} newParent The new parent of this node - * @param {Number} index The index it was moved to - */ + "move", - /** - * @event insert - * Fires when a new child node is inserted in a node in this tree. - * @param {Tree} tree The owner tree - * @param {Node} parent The parent node - * @param {Node} node The child node inserted - * @param {Node} refNode The child node the node was inserted before - */ + "insert", - /** - * @event beforeappend - * Fires before a new child is appended to a node in this tree, return false to cancel the append. - * @param {Tree} tree The owner tree - * @param {Node} parent The parent node - * @param {Node} node The child node to be appended - */ + "beforeappend", - /** - * @event beforeremove - * Fires before a child is removed from a node in this tree, return false to cancel the remove. - * @param {Tree} tree The owner tree - * @param {Node} parent The parent node - * @param {Node} node The child node to be removed - */ + "beforeremove", - /** - * @event beforemove - * Fires before a node is moved to a new location in the tree. Return false to cancel the move. - * @param {Tree} tree The owner tree - * @param {Node} node The node being moved - * @param {Node} oldParent The parent of the node - * @param {Node} newParent The new parent the node is moving to - * @param {Number} index The index it is being moved to - */ + "beforemove", - /** - * @event beforeinsert - * Fires before a new child is inserted in a node in this tree, return false to cancel the insert. - * @param {Tree} tree The owner tree - * @param {Node} parent The parent node - * @param {Node} node The child node to be inserted - * @param {Node} refNode The child node the node is being inserted before - */ + "beforeinsert" ); @@ -50861,30 +31911,20 @@ Ext.data.Tree = function(root){ }; Ext.extend(Ext.data.Tree, Ext.util.Observable, { - /** - * @cfg {String} pathSeparator - * The token used to separate paths in node ids (defaults to '/'). - */ + pathSeparator: "/", - // private + proxyNodeEvent : function(){ return this.fireEvent.apply(this, arguments); }, - /** - * Returns the root node for this tree. - * @return {Node} - */ + getRootNode : function(){ return this.root; }, - /** - * Sets the root node for this tree. - * @param {Node} node - * @return {Node} - */ + setRootNode : function(node){ this.root = node; node.ownerTree = this; @@ -50893,21 +31933,17 @@ Ext.extend(Ext.data.Tree, Ext.util.Observable, { return node; }, - /** - * Gets a node in this tree by its id. - * @param {String} id - * @return {Node} - */ + getNodeById : function(id){ return this.nodeHash[id]; }, - // private + registerNode : function(node){ this.nodeHash[node.id] = node; }, - // private + unregisterNode : function(node){ delete this.nodeHash[node.id]; }, @@ -50917,34 +31953,20 @@ Ext.extend(Ext.data.Tree, Ext.util.Observable, { } }); -/** - * @class Ext.data.Node - * @extends Ext.util.Observable - * @cfg {Boolean} leaf true if this node is a leaf and does not have children - * @cfg {String} id The id for this node. If one is not specified, one is generated. - * @constructor - * @param {Object} attributes The attributes/config for the node - */ + Ext.data.Node = function(attributes){ - /** - * The attributes supplied for the node. You can use this property to access any custom attributes you supplied. - * @type {Object} - */ + this.attributes = attributes || {}; this.leaf = this.attributes.leaf; - /** - * The node id. @type String - */ + this.id = this.attributes.id; if(!this.id){ this.id = Ext.id(null, "xnode-"); this.attributes.id = this.id; } - /** - * All child nodes of this node. @type Array - */ + this.childNodes = []; - if(!this.childNodes.indexOf){ // indexOf is a must + if(!this.childNodes.indexOf){ this.childNodes.indexOf = function(o){ for(var i = 0, len = this.length; i < len; i++){ if(this[i] == o){ @@ -50954,98 +31976,33 @@ Ext.data.Node = function(attributes){ return -1; }; } - /** - * The parent node for this node. @type Node - */ + this.parentNode = null; - /** - * The first direct child node of this node, or null if this node has no child nodes. @type Node - */ + this.firstChild = null; - /** - * The last direct child node of this node, or null if this node has no child nodes. @type Node - */ + this.lastChild = null; - /** - * The node immediately preceding this node in the tree, or null if there is no sibling node. @type Node - */ + this.previousSibling = null; - /** - * The node immediately following this node in the tree, or null if there is no sibling node. @type Node - */ + this.nextSibling = null; this.addEvents({ - /** - * @event append - * Fires when a new child node is appended - * @param {Tree} tree The owner tree - * @param {Node} this This node - * @param {Node} node The newly appended node - * @param {Number} index The index of the newly appended node - */ + "append" : true, - /** - * @event remove - * Fires when a child node is removed - * @param {Tree} tree The owner tree - * @param {Node} this This node - * @param {Node} node The removed node - */ + "remove" : true, - /** - * @event move - * Fires when this node is moved to a new location in the tree - * @param {Tree} tree The owner tree - * @param {Node} this This node - * @param {Node} oldParent The old parent of this node - * @param {Node} newParent The new parent of this node - * @param {Number} index The index it was moved to - */ + "move" : true, - /** - * @event insert - * Fires when a new child node is inserted. - * @param {Tree} tree The owner tree - * @param {Node} this This node - * @param {Node} node The child node inserted - * @param {Node} refNode The child node the node was inserted before - */ + "insert" : true, - /** - * @event beforeappend - * Fires before a new child is appended, return false to cancel the append. - * @param {Tree} tree The owner tree - * @param {Node} this This node - * @param {Node} node The child node to be appended - */ + "beforeappend" : true, - /** - * @event beforeremove - * Fires before a child is removed, return false to cancel the remove. - * @param {Tree} tree The owner tree - * @param {Node} this This node - * @param {Node} node The child node to be removed - */ + "beforeremove" : true, - /** - * @event beforemove - * Fires before this node is moved to a new location in the tree. Return false to cancel the move. - * @param {Tree} tree The owner tree - * @param {Node} this This node - * @param {Node} oldParent The parent of this node - * @param {Node} newParent The new parent this node is moving to - * @param {Number} index The index it is being moved to - */ + "beforemove" : true, - /** - * @event beforeinsert - * Fires before a new child is inserted, return false to cancel the insert. - * @param {Tree} tree The owner tree - * @param {Node} this This node - * @param {Node} node The child node to be inserted - * @param {Node} refNode The child node the node is being inserted before - */ + "beforeinsert" : true }); this.listeners = this.attributes.listeners; @@ -51053,13 +32010,13 @@ Ext.data.Node = function(attributes){ }; Ext.extend(Ext.data.Node, Ext.util.Observable, { - // private + fireEvent : function(evtName){ - // first do standard event for this node + if(Ext.data.Node.superclass.fireEvent.apply(this, arguments) === false){ return false; } - // then bubble it up to the tree if the event wasn't cancelled + var ot = this.getOwnerTree(); if(ot){ if(ot.proxyNodeEvent.apply(ot, arguments) === false){ @@ -51069,63 +32026,43 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { return true; }, - /** - * Returns true if this node is a leaf - * @return {Boolean} - */ + isLeaf : function(){ return this.leaf === true; }, - // private + setFirstChild : function(node){ this.firstChild = node; }, - //private + setLastChild : function(node){ this.lastChild = node; }, - /** - * Returns true if this node is the last child of its parent - * @return {Boolean} - */ + isLast : function(){ return (!this.parentNode ? true : this.parentNode.lastChild == this); }, - /** - * Returns true if this node is the first child of its parent - * @return {Boolean} - */ + isFirst : function(){ return (!this.parentNode ? true : this.parentNode.firstChild == this); }, - /** - * Returns true if this node has one or more child nodes, else false. - * @return {Boolean} - */ + hasChildNodes : function(){ return !this.isLeaf() && this.childNodes.length > 0; }, - /** - * Returns true if this node has one or more child nodes, or if the expandable - * node attribute is explicitly specified as true (see {@link #attributes}), otherwise returns false. - * @return {Boolean} - */ + isExpandable : function(){ return this.attributes.expandable || this.hasChildNodes(); }, - /** - * Insert node(s) as the last child node of this node. - * @param {Node/Array} node The node or Array of nodes to append - * @return {Node} The appended node if single append, or null if an array was passed - */ + appendChild : function(node){ var multi = false; if(Ext.isArray(node)){ @@ -51133,7 +32070,7 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { }else if(arguments.length > 1){ multi = arguments; } - // if passed an array or multiple args do them one by one + if(multi){ for(var i = 0, len = multi.length; i < len; i++) { this.appendChild(multi[i]); @@ -51144,7 +32081,7 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { } var index = this.childNodes.length; var oldParent = node.parentNode; - // it's a move, make sure we move it cleanly + if(oldParent){ if(node.fireEvent("beforemove", node.getOwnerTree(), node, oldParent, this, index) === false){ return false; @@ -51175,12 +32112,7 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { } }, - /** - * Removes a child node from this node. - * @param {Node} node The node to remove - * @param {Boolean} destroy true to destroy the node upon removal. Defaults to false. - * @return {Node} The removed node - */ + removeChild : function(node, destroy){ var index = this.childNodes.indexOf(node); if(index == -1){ @@ -51190,10 +32122,10 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { return false; } - // remove it from childNodes collection + this.childNodes.splice(index, 1); - // update siblings + if(node.previousSibling){ node.previousSibling.nextSibling = node.nextSibling; } @@ -51201,7 +32133,7 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { node.nextSibling.previousSibling = node.previousSibling; } - // update child refs + if(this.firstChild == node){ this.setFirstChild(node.nextSibling); } @@ -51218,9 +32150,9 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { return node; }, - // private + clear : function(destroy){ - // clear any references from the node + this.setOwnerTree(null, destroy); this.parentNode = this.previousSibling = this.nextSibling = null; if(destroy){ @@ -51228,16 +32160,9 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { } }, - /** - * Destroys the node. - */ - destroy : function(/* private */ silent){ - /* - * Silent is to be used in a number of cases - * 1) When setRootNode is called. - * 2) When destroy on the tree is called - * 3) For destroying child nodes on a node - */ + + destroy : function( silent){ + if(silent === true){ this.purgeListeners(); this.clear(true); @@ -51250,17 +32175,12 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { } }, - /** - * Inserts the first node before the second node in this nodes childNodes collection. - * @param {Node} node The node to insert - * @param {Node} refNode The node to insert before (if null the node is appended) - * @return {Node} The inserted node - */ + insertBefore : function(node, refNode){ - if(!refNode){ // like standard Dom, refNode can be null for append + if(!refNode){ return this.appendChild(node); } - // nothing to do + if(node == refNode){ return false; } @@ -51272,12 +32192,12 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { var oldParent = node.parentNode; var refIndex = index; - // when moving internally, indexes will change after remove + if(oldParent == this && this.childNodes.indexOf(node) < index){ refIndex--; } - // it's a move, make sure we move it cleanly + if(oldParent){ if(node.fireEvent("beforemove", node.getOwnerTree(), node, oldParent, this, index, refNode) === false){ return false; @@ -51306,11 +32226,7 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { return node; }, - /** - * Removes this node from its parent - * @param {Boolean} destroy true to destroy the node upon removal. Defaults to false. - * @return {Node} this - */ + remove : function(destroy){ if (this.parentNode) { this.parentNode.removeChild(this, destroy); @@ -51318,11 +32234,7 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { return this; }, - /** - * Removes all child nodes from this node. - * @param {Boolean} destroy true to destroy the node upon removal. Defaults to false. - * @return {Node} this - */ + removeAll : function(destroy){ var cn = this.childNodes, n; @@ -51332,21 +32244,12 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { return this; }, - /** - * Returns the child node at the specified index. - * @param {Number} index - * @return {Node} - */ + item : function(index){ return this.childNodes[index]; }, - /** - * Replaces one child node in this node with another. - * @param {Node} newChild The replacement node - * @param {Node} oldChild The node to replace - * @return {Node} The replaced node - */ + replaceChild : function(newChild, oldChild){ var s = oldChild ? oldChild.nextSibling : null; this.removeChild(oldChild); @@ -51354,21 +32257,14 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { return oldChild; }, - /** - * Returns the index of a child node - * @param {Node} node - * @return {Number} The index of the node or -1 if it was not found - */ + indexOf : function(child){ return this.childNodes.indexOf(child); }, - /** - * Returns the tree this node is in. - * @return {Tree} - */ + getOwnerTree : function(){ - // if it doesn't have one, look for one + if(!this.ownerTree){ var p = this; while(p){ @@ -51382,10 +32278,7 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { return this.ownerTree; }, - /** - * Returns depth of this node (the root node has a depth of 0) - * @return {Number} - */ + getDepth : function(){ var depth = 0; var p = this; @@ -51396,15 +32289,15 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { return depth; }, - // private + setOwnerTree : function(tree, destroy){ - // if it is a move, we need to update everyone + if(tree != this.ownerTree){ if(this.ownerTree){ this.ownerTree.unregisterNode(this); } this.ownerTree = tree; - // If we're destroying, we don't need to recurse since it will be called on each child node + if(destroy !== true){ Ext.each(this.childNodes, function(n){ n.setOwnerTree(tree); @@ -51416,10 +32309,7 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { } }, - /** - * Changes the id of this node. - * @param {String} id The new id for the node. - */ + setId: function(id){ if(id !== this.id){ var t = this.ownerTree; @@ -51434,14 +32324,10 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { } }, - // private + onIdChange: Ext.emptyFn, - /** - * Returns the path for this node. The path can be used to expand or select this node programmatically. - * @param {String} attr (optional) The attr to use for the path (defaults to the node's id) - * @return {String} The path - */ + getPath : function(attr){ attr = attr || "id"; var p = this.parentNode; @@ -51454,14 +32340,7 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { return sep + b.join(sep); }, - /** - * Bubbles up the tree from this node, calling the specified function with each node. The arguments to the function - * will be the args provided or the current node. If the function returns false at any point, - * the bubble is stopped. - * @param {Function} fn The function to call - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to the current Node. - * @param {Array} args (optional) The args to call the function with (default to passing the current Node) - */ + bubble : function(fn, scope, args){ var p = this; while(p){ @@ -51472,14 +32351,7 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { } }, - /** - * Cascades down the tree from this node, calling the specified function with each node. The arguments to the function - * will be the args provided or the current node. If the function returns false at any point, - * the cascade is stopped on that branch. - * @param {Function} fn The function to call - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to the current Node. - * @param {Array} args (optional) The args to call the function with (default to passing the current Node) - */ + cascade : function(fn, scope, args){ if(fn.apply(scope || this, args || [this]) !== false){ var cs = this.childNodes; @@ -51489,14 +32361,7 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { } }, - /** - * Interates the child nodes of this node, calling the specified function with each node. The arguments to the function - * will be the args provided or the current node. If the function returns false at any point, - * the iteration stops. - * @param {Function} fn The function to call - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to the current Node in the iteration. - * @param {Array} args (optional) The args to call the function with (default to passing the current Node) - */ + eachChild : function(fn, scope, args){ var cs = this.childNodes; for(var i = 0, len = cs.length; i < len; i++) { @@ -51506,26 +32371,14 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { } }, - /** - * Finds the first child that has the attribute with the specified value. - * @param {String} attribute The attribute name - * @param {Mixed} value The value to search for - * @param {Boolean} deep (Optional) True to search through nodes deeper than the immediate children - * @return {Node} The found child or null if none was found - */ + findChild : function(attribute, value, deep){ return this.findChildBy(function(){ return this.attributes[attribute] == value; }, null, deep); }, - /** - * Finds the first child by a custom function. The child matches if the function passed returns true. - * @param {Function} fn A function which must return true if the passed Node is the required Node. - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to the Node being tested. - * @param {Boolean} deep (Optional) True to search through nodes deeper than the immediate children - * @return {Node} The found child or null if none was found - */ + findChildBy : function(fn, scope, deep){ var cs = this.childNodes, len = cs.length, @@ -51547,11 +32400,7 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { return null; }, - /** - * Sorts this nodes children using the supplied sort function. - * @param {Function} fn A function which, when passed two Nodes, returns -1, 0 or 1 depending upon required sort order. - * @param {Object} scope (optional)The scope (this reference) in which the function is executed. Defaults to the browser window. - */ + sort : function(fn, scope){ var cs = this.childNodes; var len = cs.length; @@ -51572,20 +32421,12 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { } }, - /** - * Returns true if this node is an ancestor (at any point) of the passed node. - * @param {Node} node - * @return {Boolean} - */ + contains : function(node){ return node.isAncestor(this); }, - /** - * Returns true if the passed node is an ancestor (at any point) of this node. - * @param {Node} node - * @return {Boolean} - */ + isAncestor : function(node){ var p = this.parentNode; while(p){ @@ -51600,35 +32441,7 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, { toString : function(){ return "[Node"+(this.id?" "+this.id:"")+"]"; } -});/** - * @class Ext.tree.TreeNode - * @extends Ext.data.Node - * @cfg {String} text The text for this node - * @cfg {Boolean} expanded true to start the node expanded - * @cfg {Boolean} allowDrag False to make this node undraggable if {@link #draggable} = true (defaults to true) - * @cfg {Boolean} allowDrop False if this node cannot have child nodes dropped on it (defaults to true) - * @cfg {Boolean} disabled true to start the node disabled - * @cfg {String} icon The path to an icon for the node. The preferred way to do this - * is to use the cls or iconCls attributes and add the icon via a CSS background image. - * @cfg {String} cls A css class to be added to the node - * @cfg {String} iconCls A css class to be added to the nodes icon element for applying css background images - * @cfg {String} href URL of the link used for the node (defaults to #) - * @cfg {String} hrefTarget target frame for the link - * @cfg {Boolean} hidden True to render hidden. (Defaults to false). - * @cfg {String} qtip An Ext QuickTip for the node - * @cfg {Boolean} expandable If set to true, the node will always show a plus/minus icon, even when empty - * @cfg {String} qtipCfg An Ext QuickTip config for the node (used instead of qtip) - * @cfg {Boolean} singleClickExpand True for single click expand on this node - * @cfg {Function} uiProvider A UI class to use for this node (defaults to Ext.tree.TreeNodeUI) - * @cfg {Boolean} checked True to render a checked checkbox for this node, false to render an unchecked checkbox - * (defaults to undefined with no checkbox rendered) - * @cfg {Boolean} draggable True to make this node draggable (defaults to false) - * @cfg {Boolean} isTarget False to not allow this node to act as a drop target (defaults to true) - * @cfg {Boolean} allowChildren False to not allow this node to have child nodes (defaults to true) - * @cfg {Boolean} editable False to not allow this node to be edited by an {@link Ext.tree.TreeEditor} (defaults to true) - * @constructor - * @param {Object/String} attributes The attributes/config for the node or just a string with the text for the node - */ +}); Ext.tree.TreeNode = function(attributes){ attributes = attributes || {}; if(Ext.isString(attributes)){ @@ -51642,140 +32455,55 @@ Ext.tree.TreeNode = function(attributes){ this.draggable = attributes.draggable !== false && attributes.allowDrag !== false; this.allowChildren = attributes.allowChildren !== false && attributes.allowDrop !== false; - /** - * Read-only. The text for this node. To change it use {@link #setText}. - * @type String - */ + this.text = attributes.text; - /** - * True if this node is disabled. - * @type Boolean - */ + this.disabled = attributes.disabled === true; - /** - * True if this node is hidden. - * @type Boolean - */ + this.hidden = attributes.hidden === true; this.addEvents( - /** - * @event textchange - * Fires when the text for this node is changed - * @param {Node} this This node - * @param {String} text The new text - * @param {String} oldText The old text - */ + 'textchange', - /** - * @event beforeexpand - * Fires before this node is expanded, return false to cancel. - * @param {Node} this This node - * @param {Boolean} deep - * @param {Boolean} anim - */ + 'beforeexpand', - /** - * @event beforecollapse - * Fires before this node is collapsed, return false to cancel. - * @param {Node} this This node - * @param {Boolean} deep - * @param {Boolean} anim - */ + 'beforecollapse', - /** - * @event expand - * Fires when this node is expanded - * @param {Node} this This node - */ + 'expand', - /** - * @event disabledchange - * Fires when the disabled status of this node changes - * @param {Node} this This node - * @param {Boolean} disabled - */ + 'disabledchange', - /** - * @event collapse - * Fires when this node is collapsed - * @param {Node} this This node - */ + 'collapse', - /** - * @event beforeclick - * Fires before click processing. Return false to cancel the default action. - * @param {Node} this This node - * @param {Ext.EventObject} e The event object - */ + 'beforeclick', - /** - * @event click - * Fires when this node is clicked - * @param {Node} this This node - * @param {Ext.EventObject} e The event object - */ + 'click', - /** - * @event checkchange - * Fires when a node with a checkbox's checked property changes - * @param {Node} this This node - * @param {Boolean} checked - */ + 'checkchange', - /** - * @event beforedblclick - * Fires before double click processing. Return false to cancel the default action. - * @param {Node} this This node - * @param {Ext.EventObject} e The event object - */ + 'beforedblclick', - /** - * @event dblclick - * Fires when this node is double clicked - * @param {Node} this This node - * @param {Ext.EventObject} e The event object - */ + 'dblclick', - /** - * @event contextmenu - * Fires when this node is right clicked - * @param {Node} this This node - * @param {Ext.EventObject} e The event object - */ + 'contextmenu', - /** - * @event beforechildrenrendered - * Fires right before the child nodes for this node are rendered - * @param {Node} this This node - */ + 'beforechildrenrendered' ); var uiClass = this.attributes.uiProvider || this.defaultUI || Ext.tree.TreeNodeUI; - /** - * Read-only. The UI for this node - * @type TreeNodeUI - */ + this.ui = new uiClass(this); }; Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { preventHScroll : true, - /** - * Returns true if this node is expanded - * @return {Boolean} - */ + isExpanded : function(){ return this.expanded; }, -/** - * Returns the UI object for this node. - * @return {TreeNodeUI} The object which is providing the user interface for this tree - * node. Unless otherwise specified in the {@link #uiProvider}, this will be an instance - * of {@link Ext.tree.TreeNodeUI} - */ + getUI : function(){ return this.ui; }, @@ -51785,7 +32513,7 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { return this.loader || ((owner = this.getOwnerTree()) && owner.loader ? owner.loader : (this.loader = new Ext.tree.TreeLoader())); }, - // private override + setFirstChild : function(node){ var of = this.firstChild; Ext.tree.TreeNode.superclass.setFirstChild.call(this, node); @@ -51797,7 +32525,7 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { } }, - // private override + setLastChild : function(node){ var ol = this.lastChild; Ext.tree.TreeNode.superclass.setLastChild.call(this, node); @@ -51809,8 +32537,8 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { } }, - // these methods are overridden to provide lazy rendering support - // private override + + appendChild : function(n){ if(!n.render && !Ext.isArray(n)){ n = this.getLoader().createNode(n); @@ -51823,13 +32551,13 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { return node; }, - // private override + removeChild : function(node, destroy){ this.ownerTree.getSelectionModel().unselect(node); Ext.tree.TreeNode.superclass.removeChild.apply(this, arguments); - // only update the ui if we're not destroying + if(!destroy){ - // if it's been rendered remove dom node + if(node.ui.rendered){ node.ui.remove(); } @@ -51845,7 +32573,7 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { return node; }, - // private override + insertBefore : function(node, refNode){ if(!node.render){ node = this.getLoader().createNode(node); @@ -51858,22 +32586,17 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { return newNode; }, - /** - * Sets the text for this node - * @param {String} text - */ + setText : function(text){ var oldText = this.text; this.text = this.attributes.text = text; - if(this.rendered){ // event without subscribing + if(this.rendered){ this.ui.onTextChange(this, text, oldText); } this.fireEvent('textchange', this, text, oldText); }, - /** - * Triggers selection of this node - */ + select : function(){ var t = this.getOwnerTree(); if(t){ @@ -51881,10 +32604,7 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { } }, - /** - * Triggers deselection of this node - * @param {Boolean} silent (optional) True to stop selection change events from firing. - */ + unselect : function(silent){ var t = this.getOwnerTree(); if(t){ @@ -51892,24 +32612,13 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { } }, - /** - * Returns true if this node is selected - * @return {Boolean} - */ + isSelected : function(){ var t = this.getOwnerTree(); return t ? t.getSelectionModel().isSelected(this) : false; }, - /** - * Expand this node. - * @param {Boolean} deep (optional) True to expand all children as well - * @param {Boolean} anim (optional) false to cancel the default animation - * @param {Function} callback (optional) A callback to be called when - * expanding this node completes (does not wait for deep expand to complete). - * Called with 1 parameter, this node. - * @param {Object} scope (optional) The scope (this reference) in which the callback is executed. Defaults to this TreeNode. - */ + expand : function(deep, anim, callback, scope){ if(!this.expanded){ if(this.fireEvent('beforeexpand', this, deep, anim) === false){ @@ -51951,15 +32660,7 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { return this.isRoot && !this.getOwnerTree().rootVisible; }, - /** - * Collapse this node. - * @param {Boolean} deep (optional) True to collapse all children as well - * @param {Boolean} anim (optional) false to cancel the default animation - * @param {Function} callback (optional) A callback to be called when - * expanding this node completes (does not wait for deep expand to complete). - * Called with 1 parameter, this node. - * @param {Object} scope (optional) The scope (this reference) in which the callback is executed. Defaults to this TreeNode. - */ + collapse : function(deep, anim, callback, scope){ if(this.expanded && !this.isHiddenRoot()){ if(this.fireEvent('beforecollapse', this, deep, anim) === false){ @@ -51991,14 +32692,14 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { } }, - // private + delayedExpand : function(delay){ if(!this.expandProcId){ this.expandProcId = this.expand.defer(delay, this); } }, - // private + cancelExpand : function(){ if(this.expandProcId){ clearTimeout(this.expandProcId); @@ -52006,9 +32707,7 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { this.expandProcId = false; }, - /** - * Toggles expanded/collapsed state of the node - */ + toggle : function(){ if(this.expanded){ this.collapse(); @@ -52017,25 +32716,17 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { } }, - /** - * Ensures all parent nodes are expanded, and if necessary, scrolls - * the node into view. - * @param {Function} callback (optional) A function to call when the node has been made visible. - * @param {Object} scope (optional) The scope (this reference) in which the callback is executed. Defaults to this TreeNode. - */ + ensureVisible : function(callback, scope){ var tree = this.getOwnerTree(); tree.expandPath(this.parentNode ? this.parentNode.getPath() : this.getPath(), false, function(){ - var node = tree.getNodeById(this.id); // Somehow if we don't do this, we lose changes that happened to node in the meantime + var node = tree.getNodeById(this.id); tree.getTreeEl().scrollChildIntoView(node.ui.anchor); this.runCallback(callback, scope || this, [this]); }.createDelegate(this)); }, - /** - * Expand all child nodes - * @param {Boolean} deep (optional) true if the child nodes should also expand their child nodes - */ + expandChildNodes : function(deep){ var cs = this.childNodes; for(var i = 0, len = cs.length; i < len; i++) { @@ -52043,10 +32734,7 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { } }, - /** - * Collapse all child nodes - * @param {Boolean} deep (optional) true if the child nodes should also collapse their child nodes - */ + collapseChildNodes : function(deep){ var cs = this.childNodes; for(var i = 0, len = cs.length; i < len; i++) { @@ -52054,30 +32742,26 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { } }, - /** - * Disables this node - */ + disable : function(){ this.disabled = true; this.unselect(); - if(this.rendered && this.ui.onDisableChange){ // event without subscribing + if(this.rendered && this.ui.onDisableChange){ this.ui.onDisableChange(this, true); } this.fireEvent('disabledchange', this, true); }, - /** - * Enables this node - */ + enable : function(){ this.disabled = false; - if(this.rendered && this.ui.onDisableChange){ // event without subscribing + if(this.rendered && this.ui.onDisableChange){ this.ui.onDisableChange(this, false); } this.fireEvent('disabledchange', this, false); }, - // private + renderChildren : function(suppressEvent){ if(suppressEvent !== false){ this.fireEvent('beforechildrenrendered', this); @@ -52089,7 +32773,7 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { this.childrenRendered = true; }, - // private + sort : function(fn, scope){ Ext.tree.TreeNode.superclass.sort.apply(this, arguments); if(this.childrenRendered){ @@ -52100,11 +32784,11 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { } }, - // private + render : function(bulkRender){ this.ui.render(bulkRender); if(!this.rendered){ - // make sure it is registered + this.getOwnerTree().registerNode(this); this.rendered = true; if(this.expanded){ @@ -52114,7 +32798,7 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { } }, - // private + renderIndent : function(deep, refresh){ if(refresh){ this.ui.childIndent = null; @@ -52138,7 +32822,7 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { } }, - //inherit docs + destroy : function(silent){ if(silent === true){ this.unselect(true); @@ -52148,46 +32832,28 @@ Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { this.ui = this.loader = null; }, - // private + onIdChange : function(id){ this.ui.onIdChange(id); } }); -Ext.tree.TreePanel.nodeTypes.node = Ext.tree.TreeNode;/** - * @class Ext.tree.AsyncTreeNode - * @extends Ext.tree.TreeNode - * @cfg {TreeLoader} loader A TreeLoader to be used by this node (defaults to the loader defined on the tree) - * @constructor - * @param {Object/String} attributes The attributes/config for the node or just a string with the text for the node - */ +Ext.tree.TreePanel.nodeTypes.node = Ext.tree.TreeNode; Ext.tree.AsyncTreeNode = function(config){ this.loaded = config && config.loaded === true; this.loading = false; Ext.tree.AsyncTreeNode.superclass.constructor.apply(this, arguments); - /** - * @event beforeload - * Fires before this node is loaded, return false to cancel - * @param {Node} this This node - */ + this.addEvents('beforeload', 'load'); - /** - * @event load - * Fires when this node is loaded - * @param {Node} this This node - */ - /** - * The loader used by this node (defaults to using the tree's defined loader) - * @type TreeLoader - * @property loader - */ + + }; Ext.extend(Ext.tree.AsyncTreeNode, Ext.tree.TreeNode, { expand : function(deep, anim, callback, scope){ - if(this.loading){ // if an async load is already running, waiting til it's done + if(this.loading){ var timer; var f = function(){ - if(!this.loading){ // done loading + if(!this.loading){ clearInterval(timer); this.expand(deep, anim, callback, scope); } @@ -52210,10 +32876,7 @@ Ext.extend(Ext.tree.AsyncTreeNode, Ext.tree.TreeNode, { Ext.tree.AsyncTreeNode.superclass.expand.call(this, deep, anim, callback, scope); }, - /** - * Returns true if this node is currently loading - * @return {Boolean} - */ + isLoading : function(){ return this.loading; }, @@ -52226,10 +32889,7 @@ Ext.extend(Ext.tree.AsyncTreeNode, Ext.tree.TreeNode, { this.expand(deep, anim, callback, scope); }, - /** - * Returns true if this node has been loaded - * @return {Boolean} - */ + isLoaded : function(){ return this.loaded; }, @@ -52242,11 +32902,7 @@ Ext.extend(Ext.tree.AsyncTreeNode, Ext.tree.TreeNode, { } }, - /** - * Trigger a reload for this node - * @param {Function} callback - * @param {Object} scope (optional) The scope (this reference) in which the callback is executed. Defaults to this Node. - */ + reload : function(callback, scope){ this.collapse(false, false); while(this.firstChild){ @@ -52261,19 +32917,7 @@ Ext.extend(Ext.tree.AsyncTreeNode, Ext.tree.TreeNode, { } }); -Ext.tree.TreePanel.nodeTypes.async = Ext.tree.AsyncTreeNode;/** - * @class Ext.tree.TreeNodeUI - * This class provides the default UI implementation for Ext TreeNodes. - * The TreeNode UI implementation is separate from the - * tree implementation, and allows customizing of the appearance of - * tree nodes.
    - *

    - * If you are customizing the Tree's user interface, you - * may need to extend this class, but you should never need to instantiate this class.
    - *

    - * This class provides access to the user interface components of an Ext TreeNode, through - * {@link Ext.tree.TreeNode#getUI} - */ +Ext.tree.TreePanel.nodeTypes.async = Ext.tree.AsyncTreeNode; Ext.tree.TreeNodeUI = function(node){ this.node = node; this.rendered = false; @@ -52284,31 +32928,31 @@ Ext.tree.TreeNodeUI = function(node){ }; Ext.tree.TreeNodeUI.prototype = { - // private + removeChild : function(node){ if(this.rendered){ this.ctNode.removeChild(node.ui.getEl()); } }, - // private + beforeLoad : function(){ this.addClass("x-tree-node-loading"); }, - // private + afterLoad : function(){ this.removeClass("x-tree-node-loading"); }, - // private + onTextChange : function(node, text, oldText){ if(this.rendered){ this.textNode.innerHTML = text; } }, - // private + onDisableChange : function(node, state){ this.disabled = state; if (this.checkbox) { @@ -52321,23 +32965,23 @@ Ext.tree.TreeNodeUI.prototype = { } }, - // private + onSelectedChange : function(state){ if(state){ this.focus(); this.addClass("x-tree-selected"); }else{ - //this.blur(); + this.removeClass("x-tree-selected"); } }, - // private + onMove : function(tree, node, oldParent, newParent, index, refNode){ this.childIndent = null; if(this.rendered){ var targetNode = newParent.ui.getContainer(); - if(!targetNode){//target not rendered + if(!targetNode){ this.holder = document.createElement("div"); this.holder.appendChild(this.wrap); return; @@ -52352,28 +32996,21 @@ Ext.tree.TreeNodeUI.prototype = { } }, -/** - * Adds one or more CSS classes to the node's UI element. - * Duplicate classes are automatically filtered out. - * @param {String/Array} className The CSS class to add, or an array of classes - */ + addClass : function(cls){ if(this.elNode){ Ext.fly(this.elNode).addClass(cls); } }, -/** - * Removes one or more CSS classes from the node's UI element. - * @param {String/Array} className The CSS class to remove, or an array of classes - */ + removeClass : function(cls){ if(this.elNode){ Ext.fly(this.elNode).removeClass(cls); } }, - // private + remove : function(){ if(this.rendered){ this.holder = document.createElement("div"); @@ -52381,12 +33018,12 @@ Ext.tree.TreeNodeUI.prototype = { } }, - // private + fireEvent : function(){ return this.node.fireEvent.apply(this.node, arguments); }, - // private + initEvents : function(){ this.node.on("move", this.onMove, this); @@ -52407,14 +33044,12 @@ Ext.tree.TreeNodeUI.prototype = { } }, - // private + getDDHandles : function(){ return [this.iconNode, this.textNode, this.elNode]; }, -/** - * Hides this node. - */ + hide : function(){ this.node.hidden = true; if(this.wrap){ @@ -52422,9 +33057,7 @@ Ext.tree.TreeNodeUI.prototype = { } }, -/** - * Shows this node. - */ + show : function(){ this.node.hidden = false; if(this.wrap){ @@ -52432,7 +33065,7 @@ Ext.tree.TreeNodeUI.prototype = { } }, - // private + onContextMenu : function(e){ if (this.node.hasListener("contextmenu") || this.node.getOwnerTree().hasListener("contextmenu")) { e.preventDefault(); @@ -52441,7 +33074,7 @@ Ext.tree.TreeNodeUI.prototype = { } }, - // private + onClick : function(e){ if(this.dropping){ e.stopEvent(); @@ -52470,7 +33103,7 @@ Ext.tree.TreeNodeUI.prototype = { } }, - // private + onDblClick : function(e){ e.preventDefault(); if(this.disabled){ @@ -52495,41 +33128,41 @@ Ext.tree.TreeNodeUI.prototype = { this.removeClass('x-tree-node-over'); }, - // private + onCheckChange : function(){ var checked = this.checkbox.checked; - // fix for IE6 + this.checkbox.defaultChecked = checked; this.node.attributes.checked = checked; this.fireEvent('checkchange', this.node, checked); }, - // private + ecClick : function(e){ if(!this.animating && this.node.isExpandable()){ this.node.toggle(); } }, - // private + startDrop : function(){ this.dropping = true; }, - // delayed drop so the click event doesn't get fired on a drop + endDrop : function(){ setTimeout(function(){ this.dropping = false; }.createDelegate(this), 50); }, - // private + expand : function(){ this.updateExpandIcon(); this.ctNode.style.display = ""; }, - // private + focus : function(){ if(!this.node.preventHScroll){ try{this.anchor.focus(); @@ -52544,11 +33177,7 @@ Ext.tree.TreeNodeUI.prototype = { } }, -/** - * Sets the checked status of the tree node to the passed value, or, if no value was passed, - * toggles the checked status. If the node was rendered with no checkbox, this has no effect. - * @param {Boolean} value (optional) The new checked status. - */ + toggleCheck : function(value){ var cb = this.checkbox; if(cb){ @@ -52557,14 +33186,14 @@ Ext.tree.TreeNodeUI.prototype = { } }, - // private + blur : function(){ try{ this.anchor.blur(); }catch(e){} }, - // private + animExpand : function(callback){ var ct = Ext.get(this.ctNode); ct.stopFx(); @@ -52587,7 +33216,7 @@ Ext.tree.TreeNodeUI.prototype = { }); }, - // private + highlight : function(){ var tree = this.node.getOwnerTree(); Ext.fly(this.wrap).highlight( @@ -52596,13 +33225,13 @@ Ext.tree.TreeNodeUI.prototype = { ); }, - // private + collapse : function(){ this.updateExpandIcon(); this.ctNode.style.display = "none"; }, - // private + animCollapse : function(callback){ var ct = Ext.get(this.ctNode); ct.enableDisplayMode('block'); @@ -52621,35 +33250,32 @@ Ext.tree.TreeNodeUI.prototype = { }); }, - // private + getContainer : function(){ return this.ctNode; }, -/** - * Returns the element which encapsulates this node. - * @return {HtmlElement} The DOM element. The default implementation uses a <li>. - */ + getEl : function(){ return this.wrap; }, - // private + appendDDGhost : function(ghostNode){ ghostNode.appendChild(this.elNode.cloneNode(true)); }, - // private + getDDRepairXY : function(){ return Ext.lib.Dom.getXY(this.iconNode); }, - // private + onRender : function(){ this.render(); }, - // private + render : function(bulkRender){ var n = this.node, a = n.attributes; var targetNode = n.parentNode ? @@ -52687,9 +33313,9 @@ Ext.tree.TreeNodeUI.prototype = { } }, - // private + renderElements : function(n, a, targetNode, bulkRender){ - // add some indent caching, this helps performance when rendering a large tree + this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : ''; var cb = Ext.isBoolean(a.checked), @@ -52720,7 +33346,7 @@ Ext.tree.TreeNodeUI.prototype = { var index = 3; if(cb){ this.checkbox = cs[3]; - // fix for IE6 + this.checkbox.defaultChecked = this.checkbox.checked; index++; } @@ -52728,40 +33354,27 @@ Ext.tree.TreeNodeUI.prototype = { this.textNode = cs[index].firstChild; }, -/** - * Returns the <a> element that provides focus for the node's UI. - * @return {HtmlElement} The DOM anchor element. - */ + getAnchor : function(){ return this.anchor; }, -/** - * Returns the text node. - * @return {HtmlNode} The DOM text node. - */ + getTextEl : function(){ return this.textNode; }, -/** - * Returns the icon <img> element. - * @return {HtmlElement} The DOM image element. - */ + getIconEl : function(){ return this.iconNode; }, -/** - * Returns the checked status of the node. If the node was rendered with no - * checkbox, it returns false. - * @return {Boolean} The checked flag. - */ + isChecked : function(){ return this.checkbox ? this.checkbox.checked : false; }, - // private + updateExpandIcon : function(){ if(this.rendered){ var n = this.node, @@ -52803,14 +33416,14 @@ Ext.tree.TreeNodeUI.prototype = { } }, - // private + onIdChange: function(id){ if(this.rendered){ this.elNode.setAttribute('ext:tree-node-id', id); } }, - // private + getChildIndent : function(){ if(!this.childIndent){ var buf = [], @@ -52830,7 +33443,7 @@ Ext.tree.TreeNodeUI.prototype = { return this.childIndent; }, - // private + renderIndent : function(){ if(this.rendered){ var indent = "", @@ -52838,7 +33451,7 @@ Ext.tree.TreeNodeUI.prototype = { if(p){ indent = p.ui.getChildIndent(); } - if(this.indentMarkup != indent){ // don't rerender if not required + if(this.indentMarkup != indent){ this.indentNode.innerHTML = indent; this.indentMarkup = indent; } @@ -52861,16 +33474,9 @@ Ext.tree.TreeNodeUI.prototype = { } }; -/** - * @class Ext.tree.RootTreeNodeUI - * This class provides the default UI implementation for root Ext TreeNodes. - * The RootTreeNode UI implementation allows customizing the appearance of the root tree node.
    - *

    - * If you are customizing the Tree's user interface, you - * may need to extend this class, but you should never need to instantiate this class.
    - */ + Ext.tree.RootTreeNodeUI = Ext.extend(Ext.tree.TreeNodeUI, { - // private + render : function(){ if(!this.rendered){ var targetNode = this.node.ownerTree.innerCt.dom; @@ -52881,73 +33487,17 @@ Ext.tree.RootTreeNodeUI = Ext.extend(Ext.tree.TreeNodeUI, { }, collapse : Ext.emptyFn, expand : Ext.emptyFn -});/** - * @class Ext.tree.TreeLoader - * @extends Ext.util.Observable - * A TreeLoader provides for lazy loading of an {@link Ext.tree.TreeNode}'s child - * nodes from a specified URL. The response must be a JavaScript Array definition - * whose elements are node definition objects. e.g.: - *

    
    -    [{
    -        id: 1,
    -        text: 'A leaf Node',
    -        leaf: true
    -    },{
    -        id: 2,
    -        text: 'A folder Node',
    -        children: [{
    -            id: 3,
    -            text: 'A child Node',
    -            leaf: true
    -        }]
    -   }]
    -
    - *

    - * A server request is sent, and child nodes are loaded only when a node is expanded. - * The loading node's id is passed to the server under the parameter name "node" to - * enable the server to produce the correct child nodes. - *

    - * To pass extra parameters, an event handler may be attached to the "beforeload" - * event, and the parameters specified in the TreeLoader's baseParams property: - *
    
    -    myTreeLoader.on("beforeload", function(treeLoader, node) {
    -        this.baseParams.category = node.attributes.category;
    -    }, this);
    -
    - * This would pass an HTTP parameter called "category" to the server containing - * the value of the Node's "category" attribute. - * @constructor - * Creates a new Treeloader. - * @param {Object} config A config object containing config properties. - */ +}); Ext.tree.TreeLoader = function(config){ this.baseParams = {}; Ext.apply(this, config); this.addEvents( - /** - * @event beforeload - * Fires before a network request is made to retrieve the Json text which specifies a node's children. - * @param {Object} This TreeLoader object. - * @param {Object} node The {@link Ext.tree.TreeNode} object being loaded. - * @param {Object} callback The callback function specified in the {@link #load} call. - */ + "beforeload", - /** - * @event load - * Fires when the node has been successfuly loaded. - * @param {Object} This TreeLoader object. - * @param {Object} node The {@link Ext.tree.TreeNode} object being loaded. - * @param {Object} response The response object containing the data from the server. - */ + "load", - /** - * @event loadexception - * Fires if the network request failed. - * @param {Object} This TreeLoader object. - * @param {Object} node The {@link Ext.tree.TreeNode} object being loaded. - * @param {Object} response The response object containing the data from the server. - */ + "loadexception" ); Ext.tree.TreeLoader.superclass.constructor.call(this); @@ -52957,95 +33507,38 @@ Ext.tree.TreeLoader = function(config){ }; Ext.extend(Ext.tree.TreeLoader, Ext.util.Observable, { - /** - * @cfg {String} dataUrl The URL from which to request a Json string which - * specifies an array of node definition objects representing the child nodes - * to be loaded. - */ - /** - * @cfg {String} requestMethod The HTTP request method for loading data (defaults to the value of {@link Ext.Ajax#method}). - */ - /** - * @cfg {String} url Equivalent to {@link #dataUrl}. - */ - /** - * @cfg {Boolean} preloadChildren If set to true, the loader recursively loads "children" attributes when doing the first load on nodes. - */ - /** - * @cfg {Object} baseParams (optional) An object containing properties which - * specify HTTP parameters to be passed to each request for child nodes. - */ - /** - * @cfg {Object} baseAttrs (optional) An object containing attributes to be added to all nodes - * created by this loader. If the attributes sent by the server have an attribute in this object, - * they take priority. - */ - /** - * @cfg {Object} uiProviders (optional) An object containing properties which - * specify custom {@link Ext.tree.TreeNodeUI} implementations. If the optional - * uiProvider attribute of a returned child node is a string rather - * than a reference to a TreeNodeUI implementation, then that string value - * is used as a property name in the uiProviders object. - */ + + + + + + + uiProviders : {}, - /** - * @cfg {Boolean} clearOnLoad (optional) Default to true. Remove previously existing - * child nodes before loading. - */ + clearOnLoad : true, - /** - * @cfg {Array/String} paramOrder Defaults to undefined. Only used when using directFn. - * Specifies the params in the order in which they must be passed to the server-side Direct method - * as either (1) an Array of String values, or (2) a String of params delimited by either whitespace, - * comma, or pipe. For example, - * any of the following would be acceptable:
    
    -nodeParameter: 'node',
    -paramOrder: ['param1','param2','param3']
    -paramOrder: 'node param1 param2 param3'
    -paramOrder: 'param1,node,param2,param3'
    -paramOrder: 'param1|param2|param|node'
    -     
    - */ + paramOrder: undefined, - /** - * @cfg {Boolean} paramsAsHash Only used when using directFn. - * Send parameters as a collection of named arguments (defaults to false). Providing a - * {@link #paramOrder} nullifies this configuration. - */ + paramsAsHash: false, - /** - * @cfg {String} nodeParameter The name of the parameter sent to the server which contains - * the identifier of the node. Defaults to 'node'. - */ + nodeParameter: 'node', - /** - * @cfg {Function} directFn - * Function to call when executing a request. - */ + directFn : undefined, - /** - * Load an {@link Ext.tree.TreeNode} from the URL specified in the constructor. - * This is called automatically when a node is expanded, but may be used to reload - * a node (or append new children if the {@link #clearOnLoad} option is false.) - * @param {Ext.tree.TreeNode} node - * @param {Function} callback Function to call after the node has been loaded. The - * function is passed the TreeNode which was requested to be loaded. - * @param {Object} scope The scope (this reference) in which the callback is executed. - * defaults to the loaded TreeNode. - */ + load : function(node, callback, scope){ if(this.clearOnLoad){ while(node.firstChild){ node.removeChild(node.firstChild); } } - if(this.doPreload(node)){ // preloaded json children + if(this.doPreload(node)){ this.runCallback(callback, scope || node, [node]); }else if(this.directFn || this.dataUrl || this.url){ this.requestData(node, callback, scope || node); @@ -53054,7 +33547,7 @@ paramOrder: 'param1|param2|param|node' doPreload : function(node){ if(node.attributes.children){ - if(node.childNodes.length < 1){ // preloaded? + if(node.childNodes.length < 1){ var cs = node.attributes.children; node.beginUpdate(); for(var i = 0, len = cs.length; i < len; i++){ @@ -53080,7 +33573,7 @@ paramOrder: 'param1|param2|param|node' if(this.directFn){ var buf = [node.id]; if(po){ - // reset 'buf' if the nodeParameter was included in paramOrder + if(np && po.indexOf(np) > -1){ buf = []; } @@ -53115,8 +33608,8 @@ paramOrder: 'param1|param2|param|node' }); } }else{ - // if the load is cancelled, make sure we notify - // the node that we are done + + this.runCallback(callback, scope || node, []); } }, @@ -53135,7 +33628,7 @@ paramOrder: 'param1|param2|param|node' } }, - // private + runCallback: function(cb, scope, args){ if(Ext.isFunction(cb)){ cb.apply(scope, args); @@ -53152,31 +33645,9 @@ paramOrder: 'param1|param2|param|node' } }, - /** - *

    Override this function for custom TreeNode node implementation, or to - * modify the attributes at creation time.

    - * Example:
    
    -new Ext.tree.TreePanel({
    -    ...
    -    loader: new Ext.tree.TreeLoader({
    -        url: 'dataUrl',
    -        createNode: function(attr) {
    -//          Allow consolidation consignments to have
    -//          consignments dropped into them.
    -            if (attr.isConsolidation) {
    -                attr.iconCls = 'x-consol',
    -                attr.allowDrop = true;
    -            }
    -            return Ext.tree.TreeLoader.prototype.createNode.call(this, attr);
    -        }
    -    }),
    -    ...
    -});
    -
    - * @param attr {Object} The attributes from which to create the new node. - */ + createNode : function(attr){ - // apply baseAttrs, nice idea Corey! + if(this.baseAttrs){ Ext.applyIf(attr, this.baseAttrs); } @@ -53231,12 +33702,7 @@ new Ext.tree.TreePanel({ this.abort(); this.purgeListeners(); } -});/** - * @class Ext.tree.TreeFilter - * Note this class is experimental and doesn't update the indent (lines) or expand collapse icons of the nodes - * @param {TreePanel} tree - * @param {Object} config (optional) - */ +}); Ext.tree.TreeFilter = function(tree, config){ this.tree = tree; this.filtered = {}; @@ -53249,19 +33715,13 @@ Ext.tree.TreeFilter.prototype = { autoClear:false, remove:false, - /** - * Filter the data by a specific attribute. - * @param {String/RegExp} value Either string that the attribute value - * should start with or a RegExp to test against the attribute - * @param {String} attr (optional) The attribute passed in your node's attributes collection. Defaults to "text". - * @param {TreeNode} startNode (optional) The node to start the filter at. - */ + filter : function(value, attr, startNode){ attr = attr || "text"; var f; if(typeof value == "string"){ var vlen = value.length; - // auto clear empty filter + if(vlen == 0 && this.clearBlank){ this.clear(); return; @@ -53270,7 +33730,7 @@ Ext.tree.TreeFilter.prototype = { f = function(n){ return n.attributes[attr].substr(0, vlen).toLowerCase() == value; }; - }else if(value.exec){ // regex? + }else if(value.exec){ f = function(n){ return value.test(n.attributes[attr]); }; @@ -53280,13 +33740,7 @@ Ext.tree.TreeFilter.prototype = { this.filterBy(f, null, startNode); }, - /** - * Filter by a function. The passed function will be called with each - * node in the tree (or from the startNode). If the function returns true, the node is kept - * otherwise it is filtered. If a node is filtered, its children are also filtered. - * @param {Function} fn The filter function - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to the current Node. - */ + filterBy : function(fn, scope, startNode){ startNode = startNode || this.tree.root; if(this.autoClear){ @@ -53321,10 +33775,7 @@ Ext.tree.TreeFilter.prototype = { } }, - /** - * Clears the current filter. Note: with the "remove" option - * set a filter cannot be cleared. - */ + clear : function(){ var t = this.tree; var af = this.filtered; @@ -53339,49 +33790,14 @@ Ext.tree.TreeFilter.prototype = { this.filtered = {}; } }; -/** - * @class Ext.tree.TreeSorter - * Provides sorting of nodes in a {@link Ext.tree.TreePanel}. The TreeSorter automatically monitors events on the - * associated TreePanel that might affect the tree's sort order (beforechildrenrendered, append, insert and textchange). - * Example usage:
    - *
    
    -new Ext.tree.TreeSorter(myTree, {
    -    folderSort: true,
    -    dir: "desc",
    -    sortType: function(node) {
    -        // sort by a custom, typed attribute:
    -        return parseInt(node.id, 10);
    -    }
    -});
    -
    - * @constructor - * @param {TreePanel} tree - * @param {Object} config - */ + Ext.tree.TreeSorter = function(tree, config){ - /** - * @cfg {Boolean} folderSort True to sort leaf nodes under non-leaf nodes (defaults to false) - */ - /** - * @cfg {String} property The named attribute on the node to sort by (defaults to "text"). Note that this - * property is only used if no {@link #sortType} function is specified, otherwise it is ignored. - */ - /** - * @cfg {String} dir The direction to sort ("asc" or "desc," case-insensitive, defaults to "asc") - */ - /** - * @cfg {String} leafAttr The attribute used to determine leaf nodes when {@link #folderSort} = true (defaults to "leaf") - */ - /** - * @cfg {Boolean} caseSensitive true for case-sensitive sort (defaults to false) - */ - /** - * @cfg {Function} sortType A custom "casting" function used to convert node values before sorting. The function - * will be called with a single parameter (the {@link Ext.tree.TreeNode} being evaluated) and is expected to return - * the node's sort value cast to the specific data type required for sorting. This could be used, for example, when - * a node's text (or other attribute) should be sorted as a date or numeric value. See the class description for - * example usage. Note that if a sortType is specified, any {@link #property} config will be ignored. - */ + + + + + + Ext.apply(this, config); tree.on("beforechildrenrendered", this.doSort, this); @@ -53438,79 +33854,46 @@ Ext.tree.TreeSorter.prototype = { this.doSort.defer(1, this, [p]); } } -};/** - * @class Ext.tree.TreeDropZone - * @extends Ext.dd.DropZone - * @constructor - * @param {String/HTMLElement/Element} tree The {@link Ext.tree.TreePanel} for which to enable dropping - * @param {Object} config - */ +}; if(Ext.dd.DropZone){ Ext.tree.TreeDropZone = function(tree, config){ - /** - * @cfg {Boolean} allowParentInsert - * Allow inserting a dragged node between an expanded parent node and its first child that will become a - * sibling of the parent when dropped (defaults to false) - */ + this.allowParentInsert = config.allowParentInsert || false; - /** - * @cfg {String} allowContainerDrop - * True if drops on the tree container (outside of a specific tree node) are allowed (defaults to false) - */ + this.allowContainerDrop = config.allowContainerDrop || false; - /** - * @cfg {String} appendOnly - * True if the tree should only allow append drops (use for trees which are sorted, defaults to false) - */ + this.appendOnly = config.appendOnly || false; Ext.tree.TreeDropZone.superclass.constructor.call(this, tree.getTreeEl(), config); - /** - * The TreePanel for this drop zone - * @type Ext.tree.TreePanel - * @property - */ + this.tree = tree; - /** - * Arbitrary data that can be associated with this tree and will be included in the event object that gets - * passed to any nodedragover event handler (defaults to {}) - * @type Ext.tree.TreePanel - * @property - */ + this.dragOverData = {}; - // private + this.lastInsertClass = "x-tree-no-status"; }; Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, { - /** - * @cfg {String} ddGroup - * A named drag drop group to which this object belongs. If a group is specified, then this object will only - * interact with other drag drop objects in the same group (defaults to 'TreeDD'). - */ + ddGroup : "TreeDD", - /** - * @cfg {String} expandDelay - * The delay in milliseconds to wait before expanding a target tree node while dragging a droppable node - * over the target (defaults to 1000) - */ + expandDelay : 1000, - // private + expandNode : function(node){ if(node.hasChildNodes() && !node.isExpanded()){ node.expand(false, null, this.triggerCacheRefresh.createDelegate(this)); } }, - // private + queueExpand : function(node){ this.expandProcId = this.expandNode.defer(this.expandDelay, this, [node]); }, - // private + cancelExpand : function(){ if(this.expandProcId){ clearTimeout(this.expandProcId); @@ -53518,12 +33901,12 @@ Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, { } }, - // private + isValidDropPoint : function(n, pt, dd, e, data){ if(!n || !data){ return false; } var targetNode = n.node; var dropNode = data.node; - // default drop rules + if(!(targetNode && targetNode.isTarget && pt)){ return false; } @@ -53536,7 +33919,7 @@ Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, { if(dropNode && (targetNode == dropNode || dropNode.contains(targetNode))){ return false; } - // reuse the object + var overEvent = this.dragOverData; overEvent.tree = this.tree; overEvent.target = targetNode; @@ -53550,11 +33933,11 @@ Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, { return overEvent.cancel === false && result !== false; }, - // private + getDropPoint : function(e, n, dd){ var tn = n.node; if(tn.isRoot){ - return tn.allowChildren !== false ? "append" : false; // always append for root + return tn.allowChildren !== false ? "append" : false; } var dragEl = n.ddel; var t = Ext.lib.Dom.getY(dragEl), b = t + dragEl.offsetHeight; @@ -53577,7 +33960,7 @@ Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, { } }, - // private + onNodeEnter : function(n, dd, e, data){ this.cancelExpand(); }, @@ -53589,19 +33972,19 @@ Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, { return this.dropNotAllowed; }, - // private + onNodeOver : function(n, dd, e, data){ var pt = this.getDropPoint(e, n, dd); var node = n.node; - // auto node expand check + if(!this.expandProcId && pt == "append" && node.hasChildNodes() && !n.node.isExpanded()){ this.queueExpand(node); }else if(pt != "append"){ this.cancelExpand(); } - // set the insert point style on the target node + var returnCls = this.dropNotAllowed; if(this.isValidDropPoint(n, pt, dd, e, data)){ if(pt){ @@ -53626,13 +34009,13 @@ Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, { return returnCls; }, - // private + onNodeOut : function(n, dd, e, data){ this.cancelExpand(); this.removeDropIndicators(n); }, - // private + onNodeDrop : function(n, dd, e, data){ var point = this.getDropPoint(e, n, dd); var targetNode = n.node; @@ -53641,7 +34024,7 @@ Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, { targetNode.ui.endDrop(); return false; } - // first try to find the drop node + var dropNode = data.node || (dd.getTreeNode ? dd.getTreeNode(data, targetNode, point, e) : null); return this.processDrop(targetNode, data, point, dd, e, dropNode); }, @@ -53656,7 +34039,7 @@ Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, { return false; }, - // private + processDrop: function(target, data, point, dd, e, dropNode){ var dropEvent = { tree : this.tree, @@ -53686,7 +34069,7 @@ Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, { return true; }, - // private + completeDrop : function(de){ var ns = de.dropNode, p = de.point, t = de.target; if(!Ext.isArray(ns)){ @@ -53711,7 +34094,7 @@ Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, { this.tree.fireEvent("nodedrop", de); }, - // private + afterNodeMoved : function(dd, data, e, targetNode, dropNode){ if(Ext.enableFx && this.tree.hlDrop){ dropNode.ui.focus(); @@ -53720,12 +34103,12 @@ Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, { this.tree.fireEvent("nodedrop", this.tree, targetNode, data, dd, e); }, - // private + getTree : function(){ return this.tree; }, - // private + removeDropIndicators : function(n){ if(n && n.ddel){ var el = n.ddel; @@ -53737,13 +34120,13 @@ Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, { } }, - // private + beforeDragDrop : function(target, e, id){ this.cancelExpand(); return true; }, - // private + afterRepair : function(data){ if(data && Ext.enableFx){ data.node.ui.highlight(); @@ -53752,39 +34135,25 @@ Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, { } }); -}/** - * @class Ext.tree.TreeDragZone - * @extends Ext.dd.DragZone - * @constructor - * @param {String/HTMLElement/Element} tree The {@link Ext.tree.TreePanel} for which to enable dragging - * @param {Object} config - */ +} if(Ext.dd.DragZone){ Ext.tree.TreeDragZone = function(tree, config){ Ext.tree.TreeDragZone.superclass.constructor.call(this, tree.innerCt, config); - /** - * The TreePanel for this drag zone - * @type Ext.tree.TreePanel - * @property - */ + this.tree = tree; }; Ext.extend(Ext.tree.TreeDragZone, Ext.dd.DragZone, { - /** - * @cfg {String} ddGroup - * A named drag drop group to which this object belongs. If a group is specified, then this object will only - * interact with other drag drop objects in the same group (defaults to 'TreeDD'). - */ + ddGroup : "TreeDD", - // private + onBeforeDrag : function(data, e){ var n = data.node; return n && n.draggable && !n.disabled; }, - // private + onInitDrag : function(e){ var data = this.dragData; this.tree.getSelectionModel().select(data.node); @@ -53794,32 +34163,32 @@ Ext.extend(Ext.tree.TreeDragZone, Ext.dd.DragZone, { this.tree.fireEvent("startdrag", this.tree, data.node, e); }, - // private + getRepairXY : function(e, data){ return data.node.ui.getDDRepairXY(); }, - // private + onEndDrag : function(data, e){ this.tree.eventModel.enable.defer(100, this.tree.eventModel); this.tree.fireEvent("enddrag", this.tree, data.node, e); }, - // private + onValidDrop : function(dd, e, id){ this.tree.fireEvent("dragdrop", this.tree, this.dragData.node, dd, e); this.hideProxy(); }, - // private + beforeInvalidDrop : function(e, id){ - // this scrolls the original position back into view + var sm = this.tree.getSelectionModel(); sm.clearSelections(); sm.select(this.dragData.node); }, - // private + afterRepair : function(){ if (Ext.enableFx && this.tree.hlDrop) { Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor || "c3daf9"); @@ -53827,17 +34196,7 @@ Ext.extend(Ext.tree.TreeDragZone, Ext.dd.DragZone, { this.dragging = false; } }); -}/** - * @class Ext.tree.TreeEditor - * @extends Ext.Editor - * Provides editor functionality for inline tree node editing. Any valid {@link Ext.form.Field} subclass can be used - * as the editor field. - * @constructor - * @param {TreePanel} tree - * @param {Object} fieldConfig (optional) Either a prebuilt {@link Ext.form.Field} instance or a Field config object - * that will be applied to the default field instance (defaults to a {@link Ext.form.TextField}). - * @param {Object} config (optional) A TreeEditor config object - */ +} Ext.tree.TreeEditor = function(tree, fc, config){ fc = fc || {}; var field = fc.events ? fc : new Ext.form.TextField(fc); @@ -53854,42 +34213,21 @@ Ext.tree.TreeEditor = function(tree, fc, config){ }; Ext.extend(Ext.tree.TreeEditor, Ext.Editor, { - /** - * @cfg {String} alignment - * The position to align to (see {@link Ext.Element#alignTo} for more details, defaults to "l-l"). - */ + alignment: "l-l", - // inherit + autoSize: false, - /** - * @cfg {Boolean} hideEl - * True to hide the bound element while the editor is displayed (defaults to false) - */ + hideEl : false, - /** - * @cfg {String} cls - * CSS class to apply to the editor (defaults to "x-small-editor x-tree-editor") - */ + cls: "x-small-editor x-tree-editor", - /** - * @cfg {Boolean} shim - * True to shim the editor if selects/iframes could be displayed beneath it (defaults to false) - */ + shim:false, - // inherit + shadow:"frame", - /** - * @cfg {Number} maxWidth - * The maximum width in pixels of the editor field (defaults to 250). Note that if the maxWidth would exceed - * the containing tree element's size, it will be automatically limited for you to the container width, taking - * scroll and client offsets into account prior to each edit. - */ + maxWidth: 250, - /** - * @cfg {Number} editDelay The number of milliseconds between clicks to register a double-click that will trigger - * editing on the current node (defaults to 350). If two clicks occur on the same node within this time span, - * the editor for the node will display, otherwise it will be processed as a regular click. - */ + editDelay : 350, initEditor : function(tree){ @@ -53909,30 +34247,23 @@ Ext.extend(Ext.tree.TreeEditor, Ext.Editor, { this.on('startedit', this.bindScroll, this, {delay:10}); }, - // private + fitToTree : function(ed, el){ var td = this.tree.getTreeEl().dom, nd = el.dom; - if(td.scrollLeft > nd.offsetLeft){ // ensure the node left point is visible + if(td.scrollLeft > nd.offsetLeft){ td.scrollLeft = nd.offsetLeft; } var w = Math.min( this.maxWidth, - (td.clientWidth > 20 ? td.clientWidth : td.offsetWidth) - Math.max(0, nd.offsetLeft-td.scrollLeft) - /*cushion*/5); + (td.clientWidth > 20 ? td.clientWidth : td.offsetWidth) - Math.max(0, nd.offsetLeft-td.scrollLeft) - 5); this.setSize(w, ''); }, - /** - * Edit the text of the passed {@link Ext.tree.TreeNode TreeNode}. - * @param node {Ext.tree.TreeNode} The TreeNode to edit. The TreeNode must be {@link Ext.tree.TreeNode#editable editable}. - */ + triggerEdit : function(node, defer){ this.completeEdit(); if(node.attributes.editable !== false){ - /** - * The {@link Ext.tree.TreeNode TreeNode} this editor is bound to. Read-only. - * @type Ext.tree.TreeNode - * @property editNode - */ + this.editNode = node; if(this.tree.autoScroll){ Ext.fly(node.ui.getEl()).scrollIntoView(this.tree.body); @@ -53946,12 +34277,12 @@ Ext.extend(Ext.tree.TreeEditor, Ext.Editor, { } }, - // private + bindScroll : function(){ this.tree.getTreeEl().on('scroll', this.cancelEdit, this); }, - // private + beforeNodeClick : function(node, e){ clearTimeout(this.autoEditTimer); if(this.tree.getSelectionModel().isSelected(node)){ @@ -53964,13 +34295,13 @@ Ext.extend(Ext.tree.TreeEditor, Ext.Editor, { clearTimeout(this.autoEditTimer); }, - // private + updateNode : function(ed, value){ this.tree.getTreeEl().un('scroll', this.cancelEdit, this); this.editNode.setText(value); }, - // private + onHide : function(){ Ext.tree.TreeEditor.superclass.onHide.call(this); if(this.editNode){ @@ -53978,7 +34309,7 @@ Ext.extend(Ext.tree.TreeEditor, Ext.Editor, { } }, - // private + onSpecialKey : function(field, e){ var k = e.getKey(); if(k == e.ESC){ @@ -53997,9 +34328,7 @@ Ext.extend(Ext.tree.TreeEditor, Ext.Editor, { tree.un('beforeclick', this.beforeNodeClick, this); tree.un('dblclick', this.onNodeDblClick, this); } -});/*! SWFObject v2.2 - is released under the MIT License -*/ +}); var swfobject = function() { @@ -54030,25 +34359,22 @@ var swfobject = function() { dynamicStylesheetMedia, autoHideShow = true, - /* Centralized function for browser feature detection - - User agent string detection is only used when no good alternative is possible - - Is executed directly for optimal performance - */ + ua = function() { var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF, u = nav.userAgent.toLowerCase(), p = nav.platform.toLowerCase(), windows = p ? /win/.test(p) : /win/.test(u), mac = p ? /mac/.test(p) : /mac/.test(u), - webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit - ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html + webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, + ie = !+"\v1", playerVersion = [0,0,0], d = null; if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) { d = nav.plugins[SHOCKWAVE_FLASH].description; - if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+ + if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { plugin = true; - ie = false; // cascaded feature detection for Internet Explorer + ie = false; d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10); playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10); @@ -54058,10 +34384,10 @@ var swfobject = function() { else if (typeof win.ActiveXObject != UNDEF) { try { var a = new ActiveXObject(SHOCKWAVE_FLASH_AX); - if (a) { // a will return null when ActiveX is disabled + if (a) { d = a.GetVariable("$version"); if (d) { - ie = true; // cascaded feature detection for Internet Explorer + ie = true; d = d.split(" ")[1].split(","); playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; } @@ -54072,14 +34398,10 @@ var swfobject = function() { return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac }; }(), - /* Cross-browser onDomLoad - - Will fire an event as soon as the DOM of a web page is loaded - - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/ - - Regular onload serves as fallback - */ + onDomLoad = function() { if (!ua.w3) { return; } - if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically + if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { callDomLoadFunctions(); } if (!isDomLoaded) { @@ -54093,7 +34415,7 @@ var swfobject = function() { callDomLoadFunctions(); } }); - if (win == top) { // if not inside an iframe + if (win == top) { (function(){ if (isDomLoaded) { return; } try { @@ -54123,7 +34445,7 @@ var swfobject = function() { function callDomLoadFunctions() { if (isDomLoaded) { return; } - try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early + try { var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span")); t.parentNode.removeChild(t); } @@ -54140,14 +34462,11 @@ var swfobject = function() { fn(); } else { - domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+ + domLoadFnArr[domLoadFnArr.length] = fn; } } - /* Cross-browser onload - - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/ - - Will fire an event as soon as a web page including all of its assets are loaded - */ + function addLoadEvent(fn) { if (typeof win.addEventListener != UNDEF) { win.addEventListener("load", fn, false); @@ -54170,9 +34489,7 @@ var swfobject = function() { } } - /* Main function - - Will preferably execute onDomLoad, otherwise onload (as a fallback) - */ + function main() { if (plugin) { testPlayerVersion(); @@ -54182,13 +34499,7 @@ var swfobject = function() { } } - /* Detect the Flash Player version for non-Internet Explorer browsers - - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description: - a. Both release and build numbers can be detected - b. Avoid wrong descriptions by corrupt installers provided by Adobe - c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports - - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available - */ + function testPlayerVersion() { var b = doc.getElementsByTagName("body")[0]; var o = createElement(OBJECT); @@ -54219,19 +34530,18 @@ var swfobject = function() { } } - /* Perform Flash Player and SWF version matching; static publishing only - */ + function matchVersions() { var rl = regObjArr.length; if (rl > 0) { - for (var i = 0; i < rl; i++) { // for each registered object element + for (var i = 0; i < rl; i++) { var id = regObjArr[i].id; var cb = regObjArr[i].callbackFn; var cbObj = {success:false, id:id}; if (ua.pv[0] > 0) { var obj = getElementById(id); if (obj) { - if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match! + if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { setVisibility(id, true); if (cb) { cbObj.success = true; @@ -54239,14 +34549,14 @@ var swfobject = function() { cb(cbObj); } } - else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported + else if (regObjArr[i].expressInstall && canExpressInstall()) { var att = {}; att.data = regObjArr[i].expressInstall; att.width = obj.getAttribute("width") || "0"; att.height = obj.getAttribute("height") || "0"; if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); } if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); } - // parse HTML object param element's name-value pairs + var par = {}; var p = obj.getElementsByTagName("param"); var pl = p.length; @@ -54257,16 +34567,16 @@ var swfobject = function() { } showExpressInstall(att, par, id, cb); } - else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF + else { displayAltContent(obj); if (cb) { cb(cbObj); } } } } - else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content) + else { setVisibility(id, true); if (cb) { - var o = getObjectById(id); // test whether there is an HTML object element or not + var o = getObjectById(id); if (o && typeof o.SetVariable != UNDEF) { cbObj.success = true; cbObj.ref = o; @@ -54295,30 +34605,23 @@ var swfobject = function() { return r; } - /* Requirements for Adobe Express Install - - only one instance can be active at a time - - fp 6.0.65 or higher - - Win/Mac OS only - - no Webkit engines older than version 312 - */ + function canExpressInstall() { return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312); } - /* Show the Adobe Express Install dialog - - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 - */ + function showExpressInstall(att, par, replaceElemIdStr, callbackFn) { isExpressInstallActive = true; storedCallbackFn = callbackFn || null; storedCallbackObj = {success:false, id:replaceElemIdStr}; var obj = getElementById(replaceElemIdStr); if (obj) { - if (obj.nodeName == "OBJECT") { // static publishing + if (obj.nodeName == "OBJECT") { storedAltContent = abstractAltContent(obj); storedAltContentId = null; } - else { // dynamic publishing + else { storedAltContent = obj; storedAltContentId = replaceElemIdStr; } @@ -54334,13 +34637,13 @@ var swfobject = function() { else { par.flashvars = fv; } - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work + + if (ua.ie && ua.win && obj.readyState != 4) { var newObj = createElement("div"); replaceElemIdStr += "SWFObjectNew"; newObj.setAttribute("id", replaceElemIdStr); - obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf + obj.parentNode.insertBefore(newObj, obj); obj.style.display = "none"; (function(){ if (obj.readyState == 4) { @@ -54355,14 +34658,13 @@ var swfobject = function() { } } - /* Functions to abstract and display alternative content - */ + function displayAltContent(obj) { if (ua.ie && ua.win && obj.readyState != 4) { - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work + + var el = createElement("div"); - obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content + obj.parentNode.insertBefore(el, obj); el.parentNode.replaceChild(abstractAltContent(obj), el); obj.style.display = "none"; (function(){ @@ -54401,23 +34703,22 @@ var swfobject = function() { return ac; } - /* Cross-browser dynamic SWF creation - */ + function createSWF(attObj, parObj, id) { var r, el = getElementById(id); if (ua.wk && ua.wk < 312) { return r; } if (el) { - if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content + if (typeof attObj.id == UNDEF) { attObj.id = id; } - if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML + if (ua.ie && ua.win) { var att = ""; for (var i in attObj) { - if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries + if (attObj[i] != Object.prototype[i]) { if (i.toLowerCase() == "data") { parObj.movie = attObj[i]; } - else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword + else if (i.toLowerCase() == "styleclass") { att += ' class="' + attObj[i] + '"'; } else if (i.toLowerCase() != "classid") { @@ -54427,29 +34728,29 @@ var swfobject = function() { } var par = ""; for (var j in parObj) { - if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries + if (parObj[j] != Object.prototype[j]) { par += ''; } } el.outerHTML = '' + par + ''; - objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only) + objIdArr[objIdArr.length] = attObj.id; r = getElementById(attObj.id); } - else { // well-behaving browsers + else { var o = createElement(OBJECT); o.setAttribute("type", FLASH_MIME_TYPE); for (var m in attObj) { - if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries - if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword + if (attObj[m] != Object.prototype[m]) { + if (m.toLowerCase() == "styleclass") { o.setAttribute("class", attObj[m]); } - else if (m.toLowerCase() != "classid") { // filter out IE specific attribute + else if (m.toLowerCase() != "classid") { o.setAttribute(m, attObj[m]); } } } for (var n in parObj) { - if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element + if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { createObjParam(o, n, parObj[n]); } } @@ -54467,9 +34768,7 @@ var swfobject = function() { el.appendChild(p); } - /* Cross-browser SWF removal - - Especially needed to safely and completely remove a SWF in Internet Explorer - */ + function removeSWF(id) { var obj = getElementById(id); if (obj && obj.nodeName == "OBJECT") { @@ -54502,8 +34801,7 @@ var swfobject = function() { } } - /* Functions to optimize JavaScript compression - */ + function getElementById(id) { var el = null; try { @@ -54517,38 +34815,33 @@ var swfobject = function() { return doc.createElement(el); } - /* Updated attachEvent function for Internet Explorer - - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks - */ + function addListener(target, eventType, fn) { target.attachEvent(eventType, fn); listenersArr[listenersArr.length] = [target, eventType, fn]; } - /* Flash Player and SWF content version matching - */ + function hasPlayerVersion(rv) { var pv = ua.pv, v = rv.split("."); v[0] = parseInt(v[0], 10); - v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0" + v[1] = parseInt(v[1], 10) || 0; v[2] = parseInt(v[2], 10) || 0; return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false; } - /* Cross-browser dynamic CSS creation - - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php - */ + function createCSS(sel, decl, media, newStyle) { if (ua.ie && ua.mac) { return; } var h = doc.getElementsByTagName("head")[0]; - if (!h) { return; } // to also support badly authored HTML pages that lack a head element + if (!h) { return; } var m = (media && typeof media == "string") ? media : "screen"; if (newStyle) { dynamicStylesheet = null; dynamicStylesheetMedia = null; } if (!dynamicStylesheet || dynamicStylesheetMedia != m) { - // create dynamic stylesheet + get a global reference to it + var s = createElement("style"); s.setAttribute("type", "text/css"); s.setAttribute("media", m); @@ -54558,7 +34851,7 @@ var swfobject = function() { } dynamicStylesheetMedia = m; } - // add style rule + if (ua.ie && ua.win) { if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) { dynamicStylesheet.addRule(sel, decl); @@ -54582,30 +34875,28 @@ var swfobject = function() { } } - /* Filter to avoid XSS attacks - */ + function urlEncodeIfNecessary(s) { var regex = /[\\\"<>\.;]/; var hasBadChars = regex.exec(s) != null; return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s; } - /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only) - */ + var cleanup = function() { if (ua.ie && ua.win) { window.attachEvent("onunload", function() { - // remove listeners to avoid memory leaks + var ll = listenersArr.length; for (var i = 0; i < ll; i++) { listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]); } - // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect + var il = objIdArr.length; for (var j = 0; j < il; j++) { removeSWF(objIdArr[j]); } - // cleanup library's main closures to avoid memory leaks + for (var k in ua) { ua[k] = null; } @@ -54619,9 +34910,7 @@ var swfobject = function() { }(); return { - /* Public API - - Reference: http://code.google.com/p/swfobject/wiki/documentation - */ + registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) { if (ua.w3 && objectIdStr && swfVersionStr) { var regObj = {}; @@ -54648,11 +34937,11 @@ var swfobject = function() { if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) { setVisibility(replaceElemIdStr, false); addDomLoadEvent(function() { - widthStr += ""; // auto-convert to string + widthStr += ""; heightStr += ""; var att = {}; if (attObj && typeof attObj === OBJECT) { - for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs + for (var i in attObj) { att[i] = attObj[i]; } } @@ -54661,12 +34950,12 @@ var swfobject = function() { att.height = heightStr; var par = {}; if (parObj && typeof parObj === OBJECT) { - for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs + for (var j in parObj) { par[j] = parObj[j]; } } if (flashvarsObj && typeof flashvarsObj === OBJECT) { - for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs + for (var k in flashvarsObj) { if (typeof par.flashvars != UNDEF) { par.flashvars += "&" + k + "=" + flashvarsObj[k]; } @@ -54675,7 +34964,7 @@ var swfobject = function() { } } } - if (hasPlayerVersion(swfVersionStr)) { // create SWF + if (hasPlayerVersion(swfVersionStr)) { var obj = createSWF(att, par, replaceElemIdStr); if (att.id == replaceElemIdStr) { setVisibility(replaceElemIdStr, true); @@ -54683,12 +34972,12 @@ var swfobject = function() { callbackObj.success = true; callbackObj.ref = obj; } - else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install + else if (xiSwfUrlStr && canExpressInstall()) { att.data = xiSwfUrlStr; showExpressInstall(att, par, replaceElemIdStr, callbackFn); return; } - else { // show alternative content + else { setVisibility(replaceElemIdStr, true); } if (callbackFn) { callbackFn(callbackObj); } @@ -54743,7 +35032,7 @@ var swfobject = function() { getQueryParamValue: function(param) { var q = doc.location.search || doc.location.hash; if (q) { - if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark + if (/\?/.test(q)) { q = q.split("?")[1]; } if (param == null) { return urlEncodeIfNecessary(q); } @@ -54757,7 +35046,7 @@ var swfobject = function() { return ""; }, - // For internal usage only + expressInstallCallback: function() { if (isExpressInstallActive) { var obj = getElementById(EXPRESS_INSTALL_ID); @@ -54774,69 +35063,37 @@ var swfobject = function() { } }; }(); -/** - * @class Ext.FlashComponent - * @extends Ext.BoxComponent - * @constructor - * @xtype flash - */ + Ext.FlashComponent = Ext.extend(Ext.BoxComponent, { - /** - * @cfg {String} flashVersion - * Indicates the version the flash content was published for. Defaults to '9.0.115'. - */ + flashVersion : '9.0.115', - /** - * @cfg {String} backgroundColor - * The background color of the chart. Defaults to '#ffffff'. - */ + backgroundColor: '#ffffff', - /** - * @cfg {String} wmode - * The wmode of the flash object. This can be used to control layering. Defaults to 'opaque'. - */ + wmode: 'opaque', - /** - * @cfg {Object} flashVars - * A set of key value pairs to be passed to the flash object as flash variables. Defaults to undefined. - */ + flashVars: undefined, - /** - * @cfg {Object} flashParams - * A set of key value pairs to be passed to the flash object as parameters. Possible parameters can be found here: - * http://kb2.adobe.com/cps/127/tn_12701.html Defaults to undefined. - */ + flashParams: undefined, - /** - * @cfg {String} url - * The URL of the chart to include. Defaults to undefined. - */ + url: undefined, swfId : undefined, swfWidth: '100%', swfHeight: '100%', - /** - * @cfg {Boolean} expressInstall - * True to prompt the user to install flash if not installed. Note that this uses - * Ext.FlashComponent.EXPRESS_INSTALL_URL, which should be set to the local resource. Defaults to false. - */ + expressInstall: false, initComponent : function(){ Ext.FlashComponent.superclass.initComponent.call(this); this.addEvents( - /** - * @event initialize - * - * @param {Chart} this - */ + 'initialize' ); }, @@ -54897,17 +35154,10 @@ Ext.FlashComponent = Ext.extend(Ext.BoxComponent, { onSwfReady : Ext.emptyFn }); -/** - * Sets the url for installing flash if it doesn't exist. This should be set to a local resource. - * @static - * @type String - */ + Ext.FlashComponent.EXPRESS_INSTALL_URL = 'http:/' + '/swfobject.googlecode.com/svn/trunk/swfobject/expressInstall.swf'; -Ext.reg('flash', Ext.FlashComponent);/** - * @class Ext.FlashProxy - * @singleton - */ +Ext.reg('flash', Ext.FlashComponent); Ext.FlashEventProxy = { onEvent : function(id, e){ var fp = Ext.getCmp(id); @@ -54917,29 +35167,14 @@ Ext.FlashEventProxy = { arguments.callee.defer(10, this, [id, e]); } } -};/** - * @class Ext.chart.Chart - * @extends Ext.FlashComponent - * The Ext.chart package provides the capability to visualize data with flash based charting. - * Each chart binds directly to an Ext.data.Store enabling automatic updates of the chart. - * To change the look and feel of a chart, see the {@link #chartStyle} and {@link #extraStyle} config options. - * @constructor - * @xtype chart - */ +}; Ext.chart.Chart = Ext.extend(Ext.FlashComponent, { refreshBuffer: 100, - /** - * @cfg {String} backgroundColor - * @hide - */ + - /** - * @cfg {Object} chartStyle - * Sets styles for this chart. This contains default styling, so modifying this property will override - * the built in styles of the chart. Use {@link #extraStyle} to add customizations to the default styling. - */ + chartStyle: { padding: 10, animationEnabled: true, @@ -54967,88 +35202,15 @@ Ext.FlashEventProxy = { } }, - /** - * @cfg {String} url - * The url to load the chart from. This defaults to Ext.chart.Chart.CHART_URL, which should - * be modified to point to the local charts resource. - */ + - /** - * @cfg {Object} extraStyle - * Contains extra styles that will be added or overwritten to the default chartStyle. Defaults to null. - * For a detailed list of the options available, visit the YUI Charts site - * at http://developer.yahoo.com/yui/charts/#basicstyles
    - * Some of the options availabe:
    - *
      - *
    • padding - The space around the edge of the chart's contents. Padding does not increase the size of the chart.
    • - *
    • animationEnabled - A Boolean value that specifies whether marker animations are enabled or not. Enabled by default.
    • - *
    • font - An Object defining the font style to be used in the chart. Defaults to { name: 'Tahoma', color: 0x444444, size: 11 }
      - *
        - *
      • name - font name
      • - *
      • color - font color (hex code, ie: "#ff0000", "ff0000" or 0xff0000)
      • - *
      • size - font size in points (numeric portion only, ie: 11)
      • - *
      • bold - boolean
      • - *
      • italic - boolean
      • - *
      • underline - boolean
      • - *
      - *
    • - *
    • border - An object defining the border style around the chart. The chart itself will decrease in dimensions to accomodate the border.
      - *
        - *
      • color - border color (hex code, ie: "#ff0000", "ff0000" or 0xff0000)
      • - *
      • size - border size in pixels (numeric portion only, ie: 1)
      • - *
      - *
    • - *
    • background - An object defining the background style of the chart.
      - *
        - *
      • color - border color (hex code, ie: "#ff0000", "ff0000" or 0xff0000)
      • - *
      • image - an image URL. May be relative to the current document or absolute.
      • - *
      - *
    • - *
    • legend - An object defining the legend style
      - *
        - *
      • display - location of the legend. Possible values are "none", "left", "right", "top", and "bottom".
      • - *
      • spacing - an image URL. May be relative to the current document or absolute.
      • - *
      • padding, border, background, font - same options as described above.
      • - *
    • - *
    • dataTip - An object defining the style of the data tip (tooltip).
      - *
        - *
      • padding, border, background, font - same options as described above.
      • - *
    • - *
    • xAxis and yAxis - An object defining the style of the style of either axis.
      - *
        - *
      • color - same option as described above.
      • - *
      • size - same option as described above.
      • - *
      • showLabels - boolean
      • - *
      • labelRotation - a value in degrees from -90 through 90. Default is zero.
      • - *
    • - *
    • majorGridLines and minorGridLines - An object defining the style of the style of the grid lines.
      - *
        - *
      • color, size - same options as described above.
      • - *
    • - *
    • zeroGridLine - An object defining the style of the style of the zero grid line.
      - *
        - *
      • color, size - same options as described above.
      • - *
    • - *
    • majorTicks and minorTicks - An object defining the style of the style of ticks in the chart.
      - *
        - *
      • color, size - same options as described above.
      • - *
      • length - the length of each tick in pixels extending from the axis.
      • - *
      • display - how the ticks are drawn. Possible values are "none", "inside", "outside", and "cross".
      • - *
    • - *
    - */ + extraStyle: null, - /** - * @cfg {Object} seriesStyles - * Contains styles to apply to the series after a refresh. Defaults to null. - */ + seriesStyles: null, - /** - * @cfg {Boolean} disableCaching - * True to add a "cache buster" to the end of the chart url. Defaults to true for Opera and IE. - */ + disableCaching: Ext.isIE || Ext.isOpera, disableCacheParam: '_dc', @@ -55068,47 +35230,25 @@ Ext.FlashEventProxy = { 'itemdragstart', 'itemdrag', 'itemdragend', - /** - * @event beforerefresh - * Fires before a refresh to the chart data is called. If the beforerefresh handler returns - * false the {@link #refresh} action will be cancelled. - * @param {Chart} this - */ + 'beforerefresh', - /** - * @event refresh - * Fires after the chart data has been refreshed. - * @param {Chart} this - */ + 'refresh' ); this.store = Ext.StoreMgr.lookup(this.store); }, - /** - * Sets a single style value on the Chart instance. - * - * @param name {String} Name of the Chart style value to change. - * @param value {Object} New value to pass to the Chart style. - */ + setStyle: function(name, value){ this.swf.setStyle(name, Ext.encode(value)); }, - /** - * Resets all styles on the Chart instance. - * - * @param styles {Object} Initializer for all Chart styles. - */ + setStyles: function(styles){ this.swf.setStyles(Ext.encode(styles)); }, - /** - * Sets the styles on all series in the Chart. - * - * @param styles {Array} Initializer for all Chart series styles. - */ + setSeriesStyles: function(styles){ this.seriesStyles = styles; var s = []; @@ -55148,10 +35288,7 @@ Ext.FlashEventProxy = { this.refresh(); }, - /** - * Changes the data store bound to this chart and refreshes it. - * @param {Store} store The store to bind to this chart - */ + bindStore : function(store, initial){ if(!initial && this.store){ if(store !== this.store && this.store.autoDestroy){ @@ -55218,13 +35355,13 @@ Ext.FlashEventProxy = { refresh : function(){ if(this.fireEvent('beforerefresh', this) !== false){ var styleChanged = false; - // convert the store data into something YUI charts can understand + var data = [], rs = this.store.data.items; for(var j = 0, len = rs.length; j < len; j++){ data[j] = rs[j].data; } - //make a copy of the series definitions so that we aren't - //editing them directly. + + var dataProvider = []; var seriesCount = 0; var currentSeries = null; @@ -55238,10 +35375,10 @@ Ext.FlashEventProxy = { if(prop == "style" && currentSeries.style !== null){ clonedSeries.style = Ext.encode(currentSeries.style); styleChanged = true; - //we don't want to modify the styles again next time - //so null out the style property. - // this causes issues - // currentSeries.style = null; + + + + } else{ clonedSeries[prop] = currentSeries[prop]; } @@ -55269,14 +35406,14 @@ Ext.FlashEventProxy = { } }, - // private + createFnProxy : function(fn){ var fnName = 'extFnProxy' + (++Ext.chart.Chart.PROXY_FN_ID); Ext.chart.Chart.proxyFunction[fnName] = fn; return 'Ext.chart.Chart.proxyFunction.' + fnName; }, - // private + removeFnProxy : function(fn){ if(!Ext.isEmpty(fn)){ fn = fn.replace('Ext.chart.Chart.proxyFunction.', ''); @@ -55284,7 +35421,7 @@ Ext.FlashEventProxy = { } }, - // private + getFunctionRef : function(val){ if(Ext.isFunction(val)){ return { @@ -55299,7 +35436,7 @@ Ext.FlashEventProxy = { } }, - // private + onDestroy: function(){ if (this.refreshTask && this.refreshTask.cancel){ this.refreshTask.cancel(); @@ -55314,19 +35451,10 @@ Ext.reg('chart', Ext.chart.Chart); Ext.chart.Chart.PROXY_FN_ID = 0; Ext.chart.Chart.proxyFunction = {}; -/** - * Sets the url to load the chart from. This should be set to a local resource. - * @static - * @type String - */ + Ext.chart.Chart.CHART_URL = 'http:/' + '/yui.yahooapis.com/2.8.0/build/charts/assets/charts.swf'; -/** - * @class Ext.chart.PieChart - * @extends Ext.chart.Chart - * @constructor - * @xtype piechart - */ + Ext.chart.PieChart = Ext.extend(Ext.chart.Chart, { type: 'pie', @@ -55349,12 +35477,7 @@ Ext.chart.PieChart = Ext.extend(Ext.chart.Chart, { }); Ext.reg('piechart', Ext.chart.PieChart); -/** - * @class Ext.chart.CartesianChart - * @extends Ext.chart.Chart - * @constructor - * @xtype cartesianchart - */ + Ext.chart.CartesianChart = Ext.extend(Ext.chart.Chart, { onSwfReady : function(isReset){ Ext.chart.CartesianChart.superclass.onSwfReady.call(this, isReset); @@ -55451,56 +35574,31 @@ Ext.chart.CartesianChart = Ext.extend(Ext.chart.Chart, { }); Ext.reg('cartesianchart', Ext.chart.CartesianChart); -/** - * @class Ext.chart.LineChart - * @extends Ext.chart.CartesianChart - * @constructor - * @xtype linechart - */ + Ext.chart.LineChart = Ext.extend(Ext.chart.CartesianChart, { type: 'line' }); Ext.reg('linechart', Ext.chart.LineChart); -/** - * @class Ext.chart.ColumnChart - * @extends Ext.chart.CartesianChart - * @constructor - * @xtype columnchart - */ + Ext.chart.ColumnChart = Ext.extend(Ext.chart.CartesianChart, { type: 'column' }); Ext.reg('columnchart', Ext.chart.ColumnChart); -/** - * @class Ext.chart.StackedColumnChart - * @extends Ext.chart.CartesianChart - * @constructor - * @xtype stackedcolumnchart - */ + Ext.chart.StackedColumnChart = Ext.extend(Ext.chart.CartesianChart, { type: 'stackcolumn' }); Ext.reg('stackedcolumnchart', Ext.chart.StackedColumnChart); -/** - * @class Ext.chart.BarChart - * @extends Ext.chart.CartesianChart - * @constructor - * @xtype barchart - */ + Ext.chart.BarChart = Ext.extend(Ext.chart.CartesianChart, { type: 'bar' }); Ext.reg('barchart', Ext.chart.BarChart); -/** - * @class Ext.chart.StackedBarChart - * @extends Ext.chart.CartesianChart - * @constructor - * @xtype stackedbarchart - */ + Ext.chart.StackedBarChart = Ext.extend(Ext.chart.CartesianChart, { type: 'stackbar' }); @@ -55508,526 +35606,212 @@ Ext.reg('stackedbarchart', Ext.chart.StackedBarChart); -/** - * @class Ext.chart.Axis - * Defines a CartesianChart's vertical or horizontal axis. - * @constructor - */ + Ext.chart.Axis = function(config){ Ext.apply(this, config); }; Ext.chart.Axis.prototype = { - /** - * The type of axis. - * - * @property type - * @type String - */ + type: null, - /** - * The direction in which the axis is drawn. May be "horizontal" or "vertical". - * - * @property orientation - * @type String - */ + orientation: "horizontal", - /** - * If true, the items on the axis will be drawn in opposite direction. - * - * @property reverse - * @type Boolean - */ + reverse: false, - /** - * A string reference to the globally-accessible function that may be called to - * determine each of the label values for this axis. - * - * @property labelFunction - * @type String - */ + labelFunction: null, - /** - * If true, labels that overlap previously drawn labels on the axis will be hidden. - * - * @property hideOverlappingLabels - * @type Boolean - */ + hideOverlappingLabels: true, - /** - * The space, in pixels, between labels on an axis. - * - * @property labelSpacing - * @type Number - */ + labelSpacing: 2 }; -/** - * @class Ext.chart.NumericAxis - * @extends Ext.chart.Axis - * A type of axis whose units are measured in numeric values. - * @constructor - */ + Ext.chart.NumericAxis = Ext.extend(Ext.chart.Axis, { type: "numeric", - /** - * The minimum value drawn by the axis. If not set explicitly, the axis - * minimum will be calculated automatically. - * - * @property minimum - * @type Number - */ + minimum: NaN, - /** - * The maximum value drawn by the axis. If not set explicitly, the axis - * maximum will be calculated automatically. - * - * @property maximum - * @type Number - */ + maximum: NaN, - /** - * The spacing between major intervals on this axis. - * - * @property majorUnit - * @type Number - */ + majorUnit: NaN, - /** - * The spacing between minor intervals on this axis. - * - * @property minorUnit - * @type Number - */ + minorUnit: NaN, - /** - * If true, the labels, ticks, gridlines, and other objects will snap to the - * nearest major or minor unit. If false, their position will be based on - * the minimum value. - * - * @property snapToUnits - * @type Boolean - */ + snapToUnits: true, - /** - * If true, and the bounds are calculated automatically, either the minimum - * or maximum will be set to zero. - * - * @property alwaysShowZero - * @type Boolean - */ + alwaysShowZero: true, - /** - * The scaling algorithm to use on this axis. May be "linear" or - * "logarithmic". - * - * @property scale - * @type String - */ + scale: "linear", - /** - * Indicates whether to round the major unit. - * - * @property roundMajorUnit - * @type Boolean - */ + roundMajorUnit: true, - /** - * Indicates whether to factor in the size of the labels when calculating a - * major unit. - * - * @property calculateByLabelSize - * @type Boolean - */ + calculateByLabelSize: true, - /** - * Indicates the position of the axis relative to the chart - * - * @property position - * @type String - */ + position: 'left', - /** - * Indicates whether to extend maximum beyond data's maximum to the nearest - * majorUnit. - * - * @property adjustMaximumByMajorUnit - * @type Boolean - */ + adjustMaximumByMajorUnit: true, - /** - * Indicates whether to extend the minimum beyond data's minimum to the - * nearest majorUnit. - * - * @property adjustMinimumByMajorUnit - * @type Boolean - */ + adjustMinimumByMajorUnit: true }); -/** - * @class Ext.chart.TimeAxis - * @extends Ext.chart.Axis - * A type of axis whose units are measured in time-based values. - * @constructor - */ + Ext.chart.TimeAxis = Ext.extend(Ext.chart.Axis, { type: "time", - /** - * The minimum value drawn by the axis. If not set explicitly, the axis - * minimum will be calculated automatically. - * - * @property minimum - * @type Date - */ + minimum: null, - /** - * The maximum value drawn by the axis. If not set explicitly, the axis - * maximum will be calculated automatically. - * - * @property maximum - * @type Number - */ + maximum: null, - /** - * The spacing between major intervals on this axis. - * - * @property majorUnit - * @type Number - */ + majorUnit: NaN, - /** - * The time unit used by the majorUnit. - * - * @property majorTimeUnit - * @type String - */ + majorTimeUnit: null, - /** - * The spacing between minor intervals on this axis. - * - * @property majorUnit - * @type Number - */ + minorUnit: NaN, - /** - * The time unit used by the minorUnit. - * - * @property majorTimeUnit - * @type String - */ + minorTimeUnit: null, - /** - * If true, the labels, ticks, gridlines, and other objects will snap to the - * nearest major or minor unit. If false, their position will be based on - * the minimum value. - * - * @property snapToUnits - * @type Boolean - */ + snapToUnits: true, - /** - * Series that are stackable will only stack when this value is set to true. - * - * @property stackingEnabled - * @type Boolean - */ + stackingEnabled: false, - /** - * Indicates whether to factor in the size of the labels when calculating a - * major unit. - * - * @property calculateByLabelSize - * @type Boolean - */ + calculateByLabelSize: true }); -/** - * @class Ext.chart.CategoryAxis - * @extends Ext.chart.Axis - * A type of axis that displays items in categories. - * @constructor - */ + Ext.chart.CategoryAxis = Ext.extend(Ext.chart.Axis, { type: "category", - /** - * A list of category names to display along this axis. - * - * @property categoryNames - * @type Array - */ + categoryNames: null, - /** - * Indicates whether or not to calculate the number of categories (ticks and - * labels) when there is not enough room to display all labels on the axis. - * If set to true, the axis will determine the number of categories to plot. - * If not, all categories will be plotted. - * - * @property calculateCategoryCount - * @type Boolean - */ + calculateCategoryCount: false }); -/** - * @class Ext.chart.Series - * Series class for the charts widget. - * @constructor - */ + Ext.chart.Series = function(config) { Ext.apply(this, config); }; Ext.chart.Series.prototype = { - /** - * The type of series. - * - * @property type - * @type String - */ + type: null, - /** - * The human-readable name of the series. - * - * @property displayName - * @type String - */ + displayName: null }; -/** - * @class Ext.chart.CartesianSeries - * @extends Ext.chart.Series - * CartesianSeries class for the charts widget. - * @constructor - */ + Ext.chart.CartesianSeries = Ext.extend(Ext.chart.Series, { - /** - * The field used to access the x-axis value from the items from the data - * source. - * - * @property xField - * @type String - */ + xField: null, - /** - * The field used to access the y-axis value from the items from the data - * source. - * - * @property yField - * @type String - */ + yField: null, - /** - * False to not show this series in the legend. Defaults to true. - * - * @property showInLegend - * @type Boolean - */ + showInLegend: true, - /** - * Indicates which axis the series will bind to - * - * @property axis - * @type String - */ + axis: 'primary' }); -/** - * @class Ext.chart.ColumnSeries - * @extends Ext.chart.CartesianSeries - * ColumnSeries class for the charts widget. - * @constructor - */ + Ext.chart.ColumnSeries = Ext.extend(Ext.chart.CartesianSeries, { type: "column" }); -/** - * @class Ext.chart.LineSeries - * @extends Ext.chart.CartesianSeries - * LineSeries class for the charts widget. - * @constructor - */ + Ext.chart.LineSeries = Ext.extend(Ext.chart.CartesianSeries, { type: "line" }); -/** - * @class Ext.chart.BarSeries - * @extends Ext.chart.CartesianSeries - * BarSeries class for the charts widget. - * @constructor - */ + Ext.chart.BarSeries = Ext.extend(Ext.chart.CartesianSeries, { type: "bar" }); -/** - * @class Ext.chart.PieSeries - * @extends Ext.chart.Series - * PieSeries class for the charts widget. - * @constructor - */ + Ext.chart.PieSeries = Ext.extend(Ext.chart.Series, { type: "pie", dataField: null, categoryField: null -});/** - * @class Ext.menu.Menu - * @extends Ext.Container - *

    A menu object. This is the container to which you may add menu items. Menu can also serve as a base class - * when you want a specialized menu based off of another component (like {@link Ext.menu.DateMenu} for example).

    - *

    Menus may contain either {@link Ext.menu.Item menu items}, or general {@link Ext.Component Component}s.

    - *

    To make a contained general {@link Ext.Component Component} line up with other {@link Ext.menu.Item menu items} - * specify iconCls: 'no-icon'. This reserves a space for an icon, and indents the Component in line - * with the other menu items. See {@link Ext.form.ComboBox}.{@link Ext.form.ComboBox#getListParent getListParent} - * for an example.

    - *

    By default, Menus are absolutely positioned, floating Components. By configuring a Menu with - * {@link #floating}:false, a Menu may be used as child of a Container.

    - * - * @xtype menu - */ +}); Ext.menu.Menu = Ext.extend(Ext.Container, { - /** - * @cfg {Object} defaults - * A config object that will be applied to all items added to this container either via the {@link #items} - * config or via the {@link #add} method. The defaults config can contain any number of - * name/value property pairs to be added to each item, and should be valid for the types of items - * being added to the menu. - */ - /** - * @cfg {Mixed} items - * An array of items to be added to this menu. Menus may contain either {@link Ext.menu.Item menu items}, - * or general {@link Ext.Component Component}s. - */ - /** - * @cfg {Number} minWidth The minimum width of the menu in pixels (defaults to 120) - */ + + + minWidth : 120, - /** - * @cfg {Boolean/String} shadow True or 'sides' for the default effect, 'frame' for 4-way shadow, and 'drop' - * for bottom-right shadow (defaults to 'sides') - */ + shadow : 'sides', - /** - * @cfg {String} subMenuAlign The {@link Ext.Element#alignTo} anchor position value to use for submenus of - * this menu (defaults to 'tl-tr?') - */ + subMenuAlign : 'tl-tr?', - /** - * @cfg {String} defaultAlign The default {@link Ext.Element#alignTo} anchor position value for this menu - * relative to its element of origin (defaults to 'tl-bl?') - */ + defaultAlign : 'tl-bl?', - /** - * @cfg {Boolean} allowOtherMenus True to allow multiple menus to be displayed at the same time (defaults to false) - */ + allowOtherMenus : false, - /** - * @cfg {Boolean} ignoreParentClicks True to ignore clicks on any item in this menu that is a parent item (displays - * a submenu) so that the submenu is not dismissed when clicking the parent item (defaults to false). - */ + ignoreParentClicks : false, - /** - * @cfg {Boolean} enableScrolling True to allow the menu container to have scroller controls if the menu is too long (defaults to true). - */ + enableScrolling : true, - /** - * @cfg {Number} maxHeight The maximum height of the menu. Only applies when enableScrolling is set to True (defaults to null). - */ + maxHeight : null, - /** - * @cfg {Number} scrollIncrement The amount to scroll the menu. Only applies when enableScrolling is set to True (defaults to 24). - */ + scrollIncrement : 24, - /** - * @cfg {Boolean} showSeparator True to show the icon separator. (defaults to true). - */ + showSeparator : true, - /** - * @cfg {Array} defaultOffsets An array specifying the [x, y] offset in pixels by which to - * change the default Menu popup position after aligning according to the {@link #defaultAlign} - * configuration. Defaults to [0, 0]. - */ + defaultOffsets : [0, 0], - /** - * @cfg {Boolean} plain - * True to remove the incised line down the left side of the menu. Defaults to false. - */ + plain : false, - /** - * @cfg {Boolean} floating - *

    By default, a Menu configured as floating:true - * will be rendered as an {@link Ext.Layer} (an absolutely positioned, - * floating Component with zindex=15000). - * If configured as floating:false, the Menu may be - * used as child item of another Container instead of a free-floating - * {@link Ext.Layer Layer}. - */ + floating : true, - /** - * @cfg {Number} zIndex - * zIndex to use when the menu is floating. - */ + zIndex: 15000, - // private + hidden : true, - /** - * @cfg {String/Object} layout - * This class assigns a default layout (layout:'menu'). - * Developers may override this configuration option if another layout is required. - * See {@link Ext.Container#layout} for additional information. - */ + layout : 'menu', - hideMode : 'offsets', // Important for laying out Components + hideMode : 'offsets', scrollerHeight : 8, - autoLayout : true, // Provided for backwards compat + autoLayout : true, defaultType : 'menuitem', bufferResize : false, @@ -56036,36 +35820,13 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { Ext.apply(this, {items:this.initialConfig}); } this.addEvents( - /** - * @event click - * Fires when this menu is clicked (or when the enter key is pressed while it is active) - * @param {Ext.menu.Menu} this - * @param {Ext.menu.Item} menuItem The menu item that was clicked - * @param {Ext.EventObject} e - */ + 'click', - /** - * @event mouseover - * Fires when the mouse is hovering over this menu - * @param {Ext.menu.Menu} this - * @param {Ext.EventObject} e - * @param {Ext.menu.Item} menuItem The menu item that was clicked - */ + 'mouseover', - /** - * @event mouseout - * Fires when the mouse exits this menu - * @param {Ext.menu.Menu} this - * @param {Ext.EventObject} e - * @param {Ext.menu.Item} menuItem The menu item that was clicked - */ + 'mouseout', - /** - * @event itemclick - * Fires when a menu item contained in this menu is clicked - * @param {Ext.menu.BaseItem} baseItem The BaseItem that was clicked - * @param {Ext.EventObject} e - */ + 'itemclick' ); Ext.menu.MenuMgr.register(this); @@ -56087,12 +35848,12 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { } }, - //private + getLayoutTarget : function() { return this.ul; }, - // private + onRender : function(ct, position){ if(!ct){ ct = Ext.getBody(); @@ -56123,7 +35884,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { if(!this.keyNav){ this.keyNav = new Ext.menu.MenuNav(this); } - // generic focus element + this.focusEl = this.el.child('a.x-menu-focus'); this.ul = this.el.child('ul.x-menu-list'); this.mon(this.ul, { @@ -56142,7 +35903,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { } }, - // private + findTargetItem : function(e){ var t = e.getTarget('.x-menu-list-item', this.ul, true); if(t && t.menuItemId){ @@ -56150,7 +35911,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { } }, - // private + onClick : function(e){ var t = this.findTargetItem(e); if(t){ @@ -56168,7 +35929,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { } }, - // private + setActiveItem : function(item, autoExpand){ if(item != this.activeItem){ this.deactivateActive(); @@ -56186,7 +35947,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { var a = this.activeItem; if(a){ if(a.isFormField){ - //Fields cannot deactivate, but Combos must collapse + if(a.collapse){ a.collapse(); } @@ -56197,7 +35958,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { } }, - // private + tryActivate : function(start, step){ var items = this.items; for(var i = start, len = items.length; i >= 0 && i < len; i+= step){ @@ -56210,7 +35971,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { return false; }, - // private + onMouseOver : function(e){ var t = this.findTargetItem(e); if(t){ @@ -56222,7 +35983,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { this.fireEvent('mouseover', this, e, t); }, - // private + onMouseOut : function(e){ var t = this.findTargetItem(e); if(t){ @@ -56235,7 +35996,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { this.fireEvent('mouseout', this, e, t); }, - // private + onScroll : function(e, t){ if(e){ e.stopEvent(); @@ -56247,7 +36008,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { } }, - // private + onScrollerIn : function(e, t){ var ul = this.ul.dom, top = Ext.fly(t).is('.x-menu-scroller-top'); if(top ? ul.scrollTop > 0 : ul.scrollTop + this.activeMax < ul.scrollHeight){ @@ -56255,19 +36016,12 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { } }, - // private + onScrollerOut : function(e, t){ Ext.fly(t).removeClass(['x-menu-item-active', 'x-menu-scroller-active']); }, - /** - * If {@link #floating}=true, shows this menu relative to - * another element using {@link #showat}, otherwise uses {@link Ext.Component#show}. - * @param {Mixed} element The element to align to - * @param {String} position (optional) The {@link Ext.Element#alignTo} anchor position to use in aligning to - * the element (defaults to this.defaultAlign) - * @param {Ext.menu.Menu} parentMenu (optional) This menu's parent menu, if applicable (defaults to undefined) - */ + show : function(el, pos, parentMenu){ if(this.floating){ this.parentMenu = parentMenu; @@ -56281,12 +36035,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { } }, - /** - * Displays this menu at a specific xy position and fires the 'show' event if a - * handler for the 'beforeshow' event does not return false cancelling the operation. - * @param {Array} xyPosition Contains X & Y [x, y] values for the position at which to show the menu (coordinates are page-based) - * @param {Ext.menu.Menu} parentMenu (optional) This menu's parent menu, if applicable (defaults to undefined) - */ + showAt : function(xy, parentMenu){ if(this.fireEvent('beforeshow', this) !== false){ this.parentMenu = parentMenu; @@ -56294,20 +36043,20 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { this.render(); } if(this.enableScrolling){ - // set the position so we can figure out the constrain value. + this.el.setXY(xy); - //constrain the value, keep the y coordinate the same + xy[1] = this.constrainScroll(xy[1]); xy = [this.el.adjustForConstraints(xy)[0], xy[1]]; }else{ - //constrain to the viewport. + xy = this.el.adjustForConstraints(xy); } this.el.setXY(xy); this.el.show(); Ext.menu.Menu.superclass.onShow.call(this); if(Ext.isIE){ - // internal event, used so we don't couple the layout to the menu + this.fireEvent('autosize', this); if(!Ext.isIE8){ this.el.repaint(); @@ -56326,13 +36075,13 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { parentEl = Ext.fly(this.el.dom.parentNode); scrollTop = parentEl.getScroll().top; viewHeight = parentEl.getViewSize().height; - //Normalize y by the scroll position for the parent element. Need to move it into the coordinate space - //of the view. + + normalY = y - scrollTop; max = this.maxHeight ? this.maxHeight : viewHeight - normalY; if(full > viewHeight) { max = viewHeight; - //Set returnY equal to (0,0) in view space by reducing y by the value of normalY + returnY = y - normalY; } else if(max < full) { returnY = y - (full - max); @@ -56341,7 +36090,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { }else{ max = this.getHeight(); } - // Always respect maxHeight + if (this.maxHeight){ max = Math.min(this.maxHeight, max); } @@ -56411,10 +36160,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { } }, - /** - * Hides this menu and optionally all parent menus - * @param {Boolean} deep (optional) True to hide all parent menus recursively, if any (defaults to false) - */ + hide : function(deep){ if (!this.isDestroyed) { this.deepHide = deep; @@ -56423,7 +36169,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { } }, - // private + onHide : function(){ Ext.menu.Menu.superclass.onHide.call(this); this.deactivateActive(); @@ -56440,7 +36186,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { } }, - // private + lookupComponent : function(c){ if(Ext.isString(c)){ c = (c == 'separator' || c == '-') ? new Ext.menu.Separator() : new Ext.menu.TextItem(c); @@ -56448,7 +36194,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { }else{ if(Ext.isObject(c)){ c = this.getMenuItem(c); - }else if(c.tagName || c.el){ // element. Wrap it. + }else if(c.tagName || c.el){ c = new Ext.BoxComponent({ el: c }); @@ -56473,7 +36219,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { return c; }, - // private + getMenuItem : function(config){ if(!config.isXType){ if(!config.xtype && Ext.isBoolean(config.checked)){ @@ -56484,53 +36230,34 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { return config; }, - /** - * Adds a separator bar to the menu - * @return {Ext.menu.Item} The menu item that was added - */ + addSeparator : function(){ return this.add(new Ext.menu.Separator()); }, - /** - * Adds an {@link Ext.Element} object to the menu - * @param {Mixed} el The element or DOM node to add, or its id - * @return {Ext.menu.Item} The menu item that was added - */ + addElement : function(el){ return this.add(new Ext.menu.BaseItem({ el: el })); }, - /** - * Adds an existing object based on {@link Ext.menu.BaseItem} to the menu - * @param {Ext.menu.Item} item The menu item to add - * @return {Ext.menu.Item} The menu item that was added - */ + addItem : function(item){ return this.add(item); }, - /** - * Creates a new {@link Ext.menu.Item} based an the supplied config object and adds it to the menu - * @param {Object} config A MenuItem config object - * @return {Ext.menu.Item} The menu item that was added - */ + addMenuItem : function(config){ return this.add(this.getMenuItem(config)); }, - /** - * Creates a new {@link Ext.menu.TextItem} with the supplied text and adds it to the menu - * @param {String} text The text to display in the menu item - * @return {Ext.menu.Item} The menu item that was added - */ + addText : function(text){ return this.add(new Ext.menu.TextItem(text)); }, - //private + onDestroy : function(){ Ext.EventManager.removeResizeListener(this.hide, this); var pm = this.parentMenu; @@ -56557,7 +36284,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, { Ext.reg('menu', Ext.menu.Menu); -// MenuNav is a private utility class used internally by the Menu + Ext.menu.MenuNav = Ext.extend(Ext.KeyNav, function(){ function up(e, m){ if(!m.tryActivate(m.items.indexOf(m.activeItem)-1, -1)){ @@ -56577,7 +36304,7 @@ Ext.menu.MenuNav = Ext.extend(Ext.KeyNav, function(){ doRelay : function(e, h){ var k = e.getKey(); -// Keystrokes within a form Field (e.g.: down in a Combo) do not navigate. Allow only TAB + if (this.menu.activeItem && this.menu.activeItem.isFormField && k != e.TAB) { return false; } @@ -56624,15 +36351,11 @@ Ext.menu.MenuNav = Ext.extend(Ext.KeyNav, function(){ } }; }()); -/** - * @class Ext.menu.MenuMgr - * Provides a common registry of all menu items on a page so that they can be easily accessed by id. - * @singleton - */ + Ext.menu.MenuMgr = function(){ var menus, active, groups = {}, attached = false, lastShow = new Date(); - // private - called when first menu is created + function init(){ menus = {}; active = new Ext.util.MixedCollection(); @@ -56643,7 +36366,7 @@ Ext.menu.MenuMgr = function(){ }); } - // private + function hideAll(){ if(active && active.length > 0){ var c = active.clone(); @@ -56655,7 +36378,7 @@ Ext.menu.MenuMgr = function(){ return false; } - // private + function onHide(m){ active.remove(m); if(active.length < 1){ @@ -56664,7 +36387,7 @@ Ext.menu.MenuMgr = function(){ } } - // private + function onShow(m){ var last = active.last(); lastShow = new Date(); @@ -56681,7 +36404,7 @@ Ext.menu.MenuMgr = function(){ } } - // private + function onBeforeHide(m){ if(m.activeChild){ m.activeChild.hide(); @@ -56692,7 +36415,7 @@ Ext.menu.MenuMgr = function(){ } } - // private + function onBeforeShow(m){ var pm = m.parentMenu; if(!pm && !m.allowOtherMenus){ @@ -56702,14 +36425,14 @@ Ext.menu.MenuMgr = function(){ } } - // private + function onMouseDown(e){ if(lastShow.getElapsed() > 50 && active.length > 0 && !e.getTarget(".x-menu")){ hideAll(); } } - // private + function onBeforeCheck(mi, state){ if(state){ var g = groups[mi.group]; @@ -56723,15 +36446,12 @@ Ext.menu.MenuMgr = function(){ return { - /** - * Hides all menus that are currently visible - * @return {Boolean} success True if any active menus were hidden. - */ + hideAll : function(){ return hideAll(); }, - // private + register : function(menu){ if(!menus){ init(); @@ -56745,28 +36465,23 @@ Ext.menu.MenuMgr = function(){ }); }, - /** - * Returns a {@link Ext.menu.Menu} object - * @param {String/Object} menu The string menu id, an existing menu object reference, or a Menu config that will - * be used to generate and return a new Menu instance. - * @return {Ext.menu.Menu} The specified menu, or null if none are found - */ + get : function(menu){ - if(typeof menu == "string"){ // menu id - if(!menus){ // not initialized, no menus to return + if(typeof menu == "string"){ + if(!menus){ return null; } return menus[menu]; - }else if(menu.events){ // menu instance + }else if(menu.events){ return menu; - }else if(typeof menu.length == 'number'){ // array of menu items? + }else if(typeof menu.length == 'number'){ return new Ext.menu.Menu({items:menu}); - }else{ // otherwise, must be a config + }else{ return Ext.create(menu, 'menu'); } }, - // private + unregister : function(menu){ delete menus[menu.id]; menu.un("beforehide", onBeforeHide); @@ -56775,7 +36490,7 @@ Ext.menu.MenuMgr = function(){ menu.un("show", onShow); }, - // private + registerCheckable : function(menuItem){ var g = menuItem.group; if(g){ @@ -56787,7 +36502,7 @@ Ext.menu.MenuMgr = function(){ } }, - // private + unregisterCheckable : function(menuItem){ var g = menuItem.group; if(g){ @@ -56821,78 +36536,34 @@ Ext.menu.MenuMgr = function(){ } }; }(); -/** - * @class Ext.menu.BaseItem - * @extends Ext.Component - * The base class for all items that render into menus. BaseItem provides default rendering, activated state - * management and base configuration options shared by all menu components. - * @constructor - * Creates a new BaseItem - * @param {Object} config Configuration options - * @xtype menubaseitem - */ + Ext.menu.BaseItem = Ext.extend(Ext.Component, { - /** - * @property parentMenu - * @type Ext.menu.Menu - * The parent Menu of this Item. - */ - /** - * @cfg {Function} handler - * A function that will handle the click event of this menu item (optional). - * The handler is passed the following parameters:

      - *
    • b : Item
      This menu Item.
    • - *
    • e : EventObject
      The click event.
    • - *
    - */ - /** - * @cfg {Object} scope - * The scope (this reference) in which the handler function will be called. - */ - /** - * @cfg {Boolean} canActivate True if this item can be visually activated (defaults to false) - */ + + + + canActivate : false, - /** - * @cfg {String} activeClass The CSS class to use when the item becomes activated (defaults to "x-menu-item-active") - */ + activeClass : "x-menu-item-active", - /** - * @cfg {Boolean} hideOnClick True to hide the containing menu after this item is clicked (defaults to true) - */ + hideOnClick : true, - /** - * @cfg {Number} clickHideDelay Length of time in milliseconds to wait before hiding after a click (defaults to 1) - */ + clickHideDelay : 1, - // private + ctype : "Ext.menu.BaseItem", - // private + actionMode : "container", initComponent : function(){ Ext.menu.BaseItem.superclass.initComponent.call(this); this.addEvents( - /** - * @event click - * Fires when this item is clicked - * @param {Ext.menu.BaseItem} this - * @param {Ext.EventObject} e - */ + 'click', - /** - * @event activate - * Fires when this item is activated - * @param {Ext.menu.BaseItem} this - */ + 'activate', - /** - * @event deactivate - * Fires when this item is deactivated - * @param {Ext.menu.BaseItem} this - */ + 'deactivate' ); if(this.handler){ @@ -56900,7 +36571,7 @@ Ext.menu.BaseItem = Ext.extend(Ext.Component, { } }, - // private + onRender : function(container, position){ Ext.menu.BaseItem.superclass.onRender.apply(this, arguments); if(this.ownerCt && this.ownerCt instanceof Ext.menu.Menu){ @@ -56916,12 +36587,7 @@ Ext.menu.BaseItem = Ext.extend(Ext.Component, { } }, - /** - * Sets the function that will handle click events for this item (equivalent to passing in the {@link #handler} - * config property). If an existing handler is already registered, it will be unregistered for you. - * @param {Function} handler The function that should be called on click - * @param {Object} scope The scope (this reference) in which the handler function is executed. Defaults to this menu item. - */ + setHandler : function(handler, scope){ if(this.handler){ this.un("click", this.handler, this.scope); @@ -56929,7 +36595,7 @@ Ext.menu.BaseItem = Ext.extend(Ext.Component, { this.on("click", this.handler = handler, this.scope = scope); }, - // private + onClick : function(e){ if(!this.disabled && this.fireEvent("click", this, e) !== false && (this.parentMenu && this.parentMenu.fireEvent("itemclick", this, e) !== false)){ @@ -56939,7 +36605,7 @@ Ext.menu.BaseItem = Ext.extend(Ext.Component, { } }, - // private + activate : function(){ if(this.disabled){ return false; @@ -56951,18 +36617,18 @@ Ext.menu.BaseItem = Ext.extend(Ext.Component, { return true; }, - // private + deactivate : function(){ this.container.removeClass(this.activeClass); this.fireEvent("deactivate", this); }, - // private + shouldDeactivate : function(e){ return !this.region || !this.region.contains(e.getPoint()); }, - // private + handleClick : function(e){ var pm = this.parentMenu; if(this.hideOnClick){ @@ -56974,33 +36640,18 @@ Ext.menu.BaseItem = Ext.extend(Ext.Component, { } }, - // private. Do nothing + expandMenu : Ext.emptyFn, - // private. Do nothing + hideMenu : Ext.emptyFn }); -Ext.reg('menubaseitem', Ext.menu.BaseItem);/** - * @class Ext.menu.TextItem - * @extends Ext.menu.BaseItem - * Adds a static text string to a menu, usually used as either a heading or group separator. - * @constructor - * Creates a new TextItem - * @param {Object/String} config If config is a string, it is used as the text to display, otherwise it - * is applied as a config object (and should contain a text property). - * @xtype menutextitem - */ +Ext.reg('menubaseitem', Ext.menu.BaseItem); Ext.menu.TextItem = Ext.extend(Ext.menu.BaseItem, { - /** - * @cfg {String} text The text to display for this item (defaults to '') - */ - /** - * @cfg {Boolean} hideOnClick True to hide the containing menu after this item is clicked (defaults to false) - */ + + hideOnClick : false, - /** - * @cfg {String} itemCls The default CSS class to use for text items (defaults to "x-menu-text") - */ + itemCls : "x-menu-text", constructor : function(config){ @@ -57010,7 +36661,7 @@ Ext.menu.TextItem = Ext.extend(Ext.menu.BaseItem, { Ext.menu.TextItem.superclass.constructor.call(this, config); }, - // private + onRender : function(){ var s = document.createElement("span"); s.className = this.itemCls; @@ -57019,32 +36670,17 @@ Ext.menu.TextItem = Ext.extend(Ext.menu.BaseItem, { Ext.menu.TextItem.superclass.onRender.apply(this, arguments); } }); -Ext.reg('menutextitem', Ext.menu.TextItem);/** - * @class Ext.menu.Separator - * @extends Ext.menu.BaseItem - * Adds a separator bar to a menu, used to divide logical groups of menu items. Generally you will - * add one of these by using "-" in you call to add() or in your items config rather than creating one directly. - * @constructor - * @param {Object} config Configuration options - * @xtype menuseparator - */ +Ext.reg('menutextitem', Ext.menu.TextItem); Ext.menu.Separator = Ext.extend(Ext.menu.BaseItem, { - /** - * @cfg {String} itemCls The default CSS class to use for separators (defaults to "x-menu-sep") - */ + itemCls : "x-menu-sep", - /** - * @cfg {Boolean} hideOnClick True to hide the containing menu after this item is clicked (defaults to false) - */ + hideOnClick : false, - /** - * @cfg {String} activeClass - * @hide - */ + activeClass: '', - // private + onRender : function(li){ var s = document.createElement("span"); s.className = this.itemCls; @@ -57054,60 +36690,25 @@ Ext.menu.Separator = Ext.extend(Ext.menu.BaseItem, { Ext.menu.Separator.superclass.onRender.apply(this, arguments); } }); -Ext.reg('menuseparator', Ext.menu.Separator);/** - * @class Ext.menu.Item - * @extends Ext.menu.BaseItem - * A base class for all menu items that require menu-related functionality (like sub-menus) and are not static - * display items. Item extends the base functionality of {@link Ext.menu.BaseItem} by adding menu-specific - * activation and click handling. - * @constructor - * Creates a new Item - * @param {Object} config Configuration options - * @xtype menuitem - */ +Ext.reg('menuseparator', Ext.menu.Separator); Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, { - /** - * @property menu - * @type Ext.menu.Menu - * The submenu associated with this Item if one was configured. - */ - /** - * @cfg {Mixed} menu (optional) Either an instance of {@link Ext.menu.Menu} or the config object for an - * {@link Ext.menu.Menu} which acts as the submenu when this item is activated. - */ - /** - * @cfg {String} icon The path to an icon to display in this item (defaults to Ext.BLANK_IMAGE_URL). If - * icon is specified {@link #iconCls} should not be. - */ - /** - * @cfg {String} iconCls A CSS class that specifies a background image that will be used as the icon for - * this item (defaults to ''). If iconCls is specified {@link #icon} should not be. - */ - /** - * @cfg {String} text The text to display in this item (defaults to ''). - */ - /** - * @cfg {String} href The href attribute to use for the underlying anchor link (defaults to '#'). - */ - /** - * @cfg {String} hrefTarget The target attribute to use for the underlying anchor link (defaults to ''). - */ - /** - * @cfg {String} itemCls The default CSS class to use for menu items (defaults to 'x-menu-item') - */ + + + + + + + + itemCls : 'x-menu-item', - /** - * @cfg {Boolean} canActivate True if this item can be visually activated (defaults to true) - */ + canActivate : true, - /** - * @cfg {Number} showDelay Length of time in milliseconds to wait before showing this item (defaults to 200) - */ + showDelay: 200, - // doc'd in BaseItem + hideDelay: 200, - // private + ctype: 'Ext.menu.Item', initComponent : function(){ @@ -57118,7 +36719,7 @@ Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, { } }, - // private + onRender : function(container, position){ if (!this.itemTpl) { this.itemTpl = Ext.menu.Item.prototype.itemTpl = new Ext.XTemplate( @@ -57136,7 +36737,7 @@ Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, { this.el = position ? this.itemTpl.insertBefore(position, a, true) : this.itemTpl.append(container, a, true); this.iconEl = this.el.child('img.x-menu-item-icon'); this.textEl = this.el.child('.x-menu-item-text'); - if(!this.href) { // if no link defined, prevent the default anchor event + if(!this.href) { this.mon(this.el, 'click', Ext.emptyFn, null, { preventDefault: true }); } Ext.menu.Item.superclass.onRender.call(this, container, position); @@ -57154,10 +36755,7 @@ Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, { }; }, - /** - * Sets the text to display in this menu item - * @param {String} text The text to display - */ + setText : function(text){ this.text = text||' '; if(this.rendered){ @@ -57166,10 +36764,7 @@ Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, { } }, - /** - * Sets the CSS class to apply to the item's icon element - * @param {String} cls The CSS class to apply - */ + setIconClass : function(cls){ var oldCls = this.iconCls; this.iconCls = cls; @@ -57178,7 +36773,7 @@ Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, { } }, - //private + beforeDestroy: function(){ if (this.menu){ delete this.menu.ownerCt; @@ -57187,15 +36782,15 @@ Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, { Ext.menu.Item.superclass.beforeDestroy.call(this); }, - // private + handleClick : function(e){ - if(!this.href){ // if no link defined, stop the event automatically + if(!this.href){ e.stopEvent(); } Ext.menu.Item.superclass.handleClick.apply(this, arguments); }, - // private + activate : function(autoExpand){ if(Ext.menu.Item.superclass.activate.apply(this, arguments)){ this.focus(); @@ -57206,7 +36801,7 @@ Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, { return true; }, - // private + shouldDeactivate : function(e){ if(Ext.menu.Item.superclass.shouldDeactivate.call(this, e)){ if(this.menu && this.menu.isVisible()){ @@ -57217,13 +36812,13 @@ Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, { return false; }, - // private + deactivate : function(){ Ext.menu.Item.superclass.deactivate.apply(this, arguments); this.hideMenu(); }, - // private + expandMenu : function(autoActivate){ if(!this.disabled && this.menu){ clearTimeout(this.hideTimer); @@ -57236,7 +36831,7 @@ Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, { } }, - // private + deferExpand : function(autoActivate){ delete this.showTimer; this.menu.show(this.container, this.parentMenu.subMenuAlign || 'tl-tr?', this.parentMenu); @@ -57245,7 +36840,7 @@ Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, { } }, - // private + hideMenu : function(){ clearTimeout(this.showTimer); delete this.showTimer; @@ -57254,7 +36849,7 @@ Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, { } }, - // private + deferHide : function(){ delete this.hideTimer; if(this.menu.over){ @@ -57264,72 +36859,36 @@ Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, { } } }); -Ext.reg('menuitem', Ext.menu.Item);/** - * @class Ext.menu.CheckItem - * @extends Ext.menu.Item - * Adds a menu item that contains a checkbox by default, but can also be part of a radio group. - * @constructor - * Creates a new CheckItem - * @param {Object} config Configuration options - * @xtype menucheckitem - */ +Ext.reg('menuitem', Ext.menu.Item); Ext.menu.CheckItem = Ext.extend(Ext.menu.Item, { - /** - * @cfg {String} group - * All check items with the same group name will automatically be grouped into a single-select - * radio button group (defaults to '') - */ - /** - * @cfg {String} itemCls The default CSS class to use for check items (defaults to "x-menu-item x-menu-check-item") - */ + + itemCls : "x-menu-item x-menu-check-item", - /** - * @cfg {String} groupClass The default CSS class to use for radio group check items (defaults to "x-menu-group-item") - */ + groupClass : "x-menu-group-item", - /** - * @cfg {Boolean} checked True to initialize this checkbox as checked (defaults to false). Note that - * if this checkbox is part of a radio group (group = true) only the last item in the group that is - * initialized with checked = true will be rendered as checked. - */ + checked: false, - // private + ctype: "Ext.menu.CheckItem", initComponent : function(){ Ext.menu.CheckItem.superclass.initComponent.call(this); this.addEvents( - /** - * @event beforecheckchange - * Fires before the checked value is set, providing an opportunity to cancel if needed - * @param {Ext.menu.CheckItem} this - * @param {Boolean} checked The new checked value that will be set - */ + "beforecheckchange" , - /** - * @event checkchange - * Fires after the checked value has been set - * @param {Ext.menu.CheckItem} this - * @param {Boolean} checked The checked value that was set - */ + "checkchange" ); - /** - * A function that handles the checkchange event. The function is undefined by default, but if an implementation - * is provided, it will be called automatically when the checkchange event fires. - * @param {Ext.menu.CheckItem} this - * @param {Boolean} checked The checked value that was set - * @method checkHandler - */ + if(this.checkHandler){ this.on('checkchange', this.checkHandler, this.scope); } Ext.menu.MenuMgr.registerCheckable(this); }, - // private + onRender : function(c){ Ext.menu.CheckItem.superclass.onRender.apply(this, arguments); if(this.group){ @@ -57341,17 +36900,13 @@ Ext.menu.CheckItem = Ext.extend(Ext.menu.Item, { } }, - // private + destroy : function(){ Ext.menu.MenuMgr.unregisterCheckable(this); Ext.menu.CheckItem.superclass.destroy.apply(this, arguments); }, - /** - * Set the checked state of this item - * @param {Boolean} checked The new checked value - * @param {Boolean} suppressEvent (optional) True to prevent the checkchange event from firing (defaults to false) - */ + setChecked : function(state, suppressEvent){ var suppress = suppressEvent === true; if(this.checked != state && (suppress || this.fireEvent("beforecheckchange", this, state) !== false)){ @@ -57365,83 +36920,34 @@ Ext.menu.CheckItem = Ext.extend(Ext.menu.Item, { } }, - // private + handleClick : function(e){ - if(!this.disabled && !(this.checked && this.group)){// disable unselect on radio item + if(!this.disabled && !(this.checked && this.group)){ this.setChecked(!this.checked); } Ext.menu.CheckItem.superclass.handleClick.apply(this, arguments); } }); -Ext.reg('menucheckitem', Ext.menu.CheckItem);/** - * @class Ext.menu.DateMenu - * @extends Ext.menu.Menu - *

    A menu containing an {@link Ext.DatePicker} Component.

    - *

    Notes:

      - *
    • Although not listed here, the constructor for this class - * accepts all of the configuration options of {@link Ext.DatePicker}.
    • - *
    • If subclassing DateMenu, any configuration options for the DatePicker must be - * applied to the initialConfig property of the DateMenu. - * Applying {@link Ext.DatePicker DatePicker} configuration settings to - * this will not affect the DatePicker's configuration.
    • - *
    - * @xtype datemenu - */ +Ext.reg('menucheckitem', Ext.menu.CheckItem); Ext.menu.DateMenu = Ext.extend(Ext.menu.Menu, { - /** - * @cfg {Boolean} enableScrolling - * @hide - */ + enableScrolling : false, - /** - * @cfg {Function} handler - * Optional. A function that will handle the select event of this menu. - * The handler is passed the following parameters:
      - *
    • picker : DatePicker
      The Ext.DatePicker.
    • - *
    • date : Date
      The selected date.
    • - *
    - */ - /** - * @cfg {Object} scope - * The scope (this reference) in which the {@link #handler} - * function will be called. Defaults to this DateMenu instance. - */ - /** - * @cfg {Boolean} hideOnClick - * False to continue showing the menu after a date is selected, defaults to true. - */ + + + hideOnClick : true, - /** - * @cfg {String} pickerId - * An id to assign to the underlying date picker. Defaults to null. - */ + pickerId : null, - /** - * @cfg {Number} maxHeight - * @hide - */ - /** - * @cfg {Number} scrollIncrement - * @hide - */ - /** - * The {@link Ext.DatePicker} instance for this DateMenu - * @property picker - * @type DatePicker - */ + + + cls : 'x-date-menu', - /** - * @event click - * @hide - */ - /** - * @event itemclick - * @hide - */ + + initComponent : function(){ this.on('beforeshow', this.onBeforeShow, this); @@ -57459,12 +36965,7 @@ Ext.reg('menucheckitem', Ext.menu.CheckItem);/** }); this.picker.purgeListeners(); Ext.menu.DateMenu.superclass.initComponent.call(this); - /** - * @event select - * Fires when a date is selected from the {@link #picker Ext.DatePicker} - * @param {DatePicker} picker The {@link #picker Ext.DatePicker} - * @param {Date} date The selected date - */ + this.relayEvents(this.picker, ['select']); this.on('show', this.picker.focus, this.picker); this.on('select', this.menuHide, this); @@ -57487,82 +36988,33 @@ Ext.reg('menucheckitem', Ext.menu.CheckItem);/** onShow : function(){ var el = this.picker.getEl(); - el.setWidth(el.getWidth()); //nasty hack for IE7 strict mode + el.setWidth(el.getWidth()); } }); Ext.reg('datemenu', Ext.menu.DateMenu); - /** - * @class Ext.menu.ColorMenu - * @extends Ext.menu.Menu - *

    A menu containing a {@link Ext.ColorPalette} Component.

    - *

    Notes:

      - *
    • Although not listed here, the constructor for this class - * accepts all of the configuration options of {@link Ext.ColorPalette}.
    • - *
    • If subclassing ColorMenu, any configuration options for the ColorPalette must be - * applied to the initialConfig property of the ColorMenu. - * Applying {@link Ext.ColorPalette ColorPalette} configuration settings to - * this will not affect the ColorPalette's configuration.
    • - *
    * - * @xtype colormenu - */ + Ext.menu.ColorMenu = Ext.extend(Ext.menu.Menu, { - /** - * @cfg {Boolean} enableScrolling - * @hide - */ + enableScrolling : false, - /** - * @cfg {Function} handler - * Optional. A function that will handle the select event of this menu. - * The handler is passed the following parameters:
      - *
    • palette : ColorPalette
      The {@link #palette Ext.ColorPalette}.
    • - *
    • color : String
      The 6-digit color hex code (without the # symbol).
    • - *
    - */ - /** - * @cfg {Object} scope - * The scope (this reference) in which the {@link #handler} - * function will be called. Defaults to this ColorMenu instance. - */ - - /** - * @cfg {Boolean} hideOnClick - * False to continue showing the menu after a color is selected, defaults to true. - */ + + + + hideOnClick : true, cls : 'x-color-menu', - /** - * @cfg {String} paletteId - * An id to assign to the underlying color palette. Defaults to null. - */ + paletteId : null, - /** - * @cfg {Number} maxHeight - * @hide - */ - /** - * @cfg {Number} scrollIncrement - * @hide - */ - /** - * @property palette - * @type ColorPalette - * The {@link Ext.ColorPalette} instance for this ColorMenu - */ - /** - * @event click - * @hide - */ - /** - * @event itemclick - * @hide - */ + + + + + initComponent : function(){ Ext.apply(this, { @@ -57574,12 +37026,7 @@ Ext.reg('menucheckitem', Ext.menu.CheckItem);/** }); this.palette.purgeListeners(); Ext.menu.ColorMenu.superclass.initComponent.call(this); - /** - * @event select - * Fires when a color is selected from the {@link #palette Ext.ColorPalette} - * @param {Ext.ColorPalette} palette The {@link #palette Ext.ColorPalette} - * @param {String} color The 6-digit color hex code (without the # symbol) - */ + this.relayEvents(this.palette, ['select']); this.on('select', this.menuHide, this); if(this.handler){ @@ -57594,220 +37041,77 @@ Ext.reg('menucheckitem', Ext.menu.CheckItem);/** } }); Ext.reg('colormenu', Ext.menu.ColorMenu); -/** - * @class Ext.form.Field - * @extends Ext.BoxComponent - * Base class for form fields that provides default event handling, sizing, value handling and other functionality. - * @constructor - * Creates a new Field - * @param {Object} config Configuration options - * @xtype field - */ + Ext.form.Field = Ext.extend(Ext.BoxComponent, { - /** - *

    The label Element associated with this Field. Only available after this Field has been rendered by a - * {@link form Ext.layout.FormLayout} layout manager.

    - * @type Ext.Element - * @property label - */ - /** - * @cfg {String} inputType The type attribute for input fields -- e.g. radio, text, password, file (defaults - * to 'text'). The types 'file' and 'password' must be used to render those field types currently -- there are - * no separate Ext components for those. Note that if you use inputType:'file', {@link #emptyText} - * is not supported and should be avoided. - */ - /** - * @cfg {Number} tabIndex The tabIndex for this field. Note this only applies to fields that are rendered, - * not those which are built via applyTo (defaults to undefined). - */ - /** - * @cfg {Mixed} value A value to initialize this field with (defaults to undefined). - */ - /** - * @cfg {String} name The field's HTML name attribute (defaults to ''). - * Note: this property must be set if this field is to be automatically included with - * {@link Ext.form.BasicForm#submit form submit()}. - */ - /** - * @cfg {String} cls A custom CSS class to apply to the field's underlying element (defaults to ''). - */ + + + + + + - /** - * @cfg {String} invalidClass The CSS class to use when marking a field invalid (defaults to 'x-form-invalid') - */ + invalidClass : 'x-form-invalid', - /** - * @cfg {String} invalidText The error text to use when marking a field invalid and no message is provided - * (defaults to 'The value in this field is invalid') - */ + invalidText : 'The value in this field is invalid', - /** - * @cfg {String} focusClass The CSS class to use when the field receives focus (defaults to 'x-form-focus') - */ + focusClass : 'x-form-focus', - /** - * @cfg {Boolean} preventMark - * true to disable {@link #markInvalid marking the field invalid}. - * Defaults to false. - */ - /** - * @cfg {String/Boolean} validationEvent The event that should initiate field validation. Set to false to disable - automatic validation (defaults to 'keyup'). - */ + + validationEvent : 'keyup', - /** - * @cfg {Boolean} validateOnBlur Whether the field should validate when it loses focus (defaults to true). - */ + validateOnBlur : true, - /** - * @cfg {Number} validationDelay The length of time in milliseconds after user input begins until validation - * is initiated (defaults to 250) - */ + validationDelay : 250, - /** - * @cfg {String/Object} autoCreate

    A {@link Ext.DomHelper DomHelper} element spec, or true for a default - * element spec. Used to create the {@link Ext.Component#getEl Element} which will encapsulate this Component. - * See {@link Ext.Component#autoEl autoEl} for details. Defaults to:

    - *
    {tag: 'input', type: 'text', size: '20', autocomplete: 'off'}
    - */ + defaultAutoCreate : {tag: 'input', type: 'text', size: '20', autocomplete: 'off'}, - /** - * @cfg {String} fieldClass The default CSS class for the field (defaults to 'x-form-field') - */ + fieldClass : 'x-form-field', - /** - * @cfg {String} msgTarget

    The location where the message text set through {@link #markInvalid} should display. - * Must be one of the following values:

    - *
      - *
    • qtip Display a quick tip containing the message when the user hovers over the field. This is the default. - *
      {@link Ext.QuickTips#init Ext.QuickTips.init} must have been called for this setting to work. - *
    • title Display the message in a default browser title attribute popup.
    • - *
    • under Add a block div beneath the field containing the error message.
    • - *
    • side Add an error icon to the right of the field, displaying the message in a popup on hover.
    • - *
    • [element id] Add the error message directly to the innerHTML of the specified element.
    • - *
    - */ + msgTarget : 'qtip', - /** - * @cfg {String} msgFx Experimental The effect used when displaying a validation message under the field - * (defaults to 'normal'). - */ + msgFx : 'normal', - /** - * @cfg {Boolean} readOnly true to mark the field as readOnly in HTML - * (defaults to false). - *

    Note: this only sets the element's readOnly DOM attribute. - * Setting readOnly=true, for example, will not disable triggering a - * ComboBox or DateField; it gives you the option of forcing the user to choose - * via the trigger without typing in the text box. To hide the trigger use - * {@link Ext.form.TriggerField#hideTrigger hideTrigger}.

    - */ + readOnly : false, - /** - * @cfg {Boolean} disabled True to disable the field (defaults to false). - *

    Be aware that conformant with the HTML specification, - * disabled Fields will not be {@link Ext.form.BasicForm#submit submitted}.

    - */ + disabled : false, - /** - * @cfg {Boolean} submitValue False to clear the name attribute on the field so that it is not submitted during a form post. - * Defaults to true. - */ + submitValue: true, - // private + isFormField : true, - // private + msgDisplay: '', - // private + hasFocus : false, - // private + initComponent : function(){ Ext.form.Field.superclass.initComponent.call(this); this.addEvents( - /** - * @event focus - * Fires when this field receives input focus. - * @param {Ext.form.Field} this - */ + 'focus', - /** - * @event blur - * Fires when this field loses input focus. - * @param {Ext.form.Field} this - */ + 'blur', - /** - * @event specialkey - * Fires when any key related to navigation (arrows, tab, enter, esc, etc.) is pressed. - * To handle other keys see {@link Ext.Panel#keys} or {@link Ext.KeyMap}. - * You can check {@link Ext.EventObject#getKey} to determine which key was pressed. - * For example:
    
    -var form = new Ext.form.FormPanel({
    -    ...
    -    items: [{
    -            fieldLabel: 'Field 1',
    -            name: 'field1',
    -            allowBlank: false
    -        },{
    -            fieldLabel: 'Field 2',
    -            name: 'field2',
    -            listeners: {
    -                specialkey: function(field, e){
    -                    // e.HOME, e.END, e.PAGE_UP, e.PAGE_DOWN,
    -                    // e.TAB, e.ESC, arrow keys: e.LEFT, e.RIGHT, e.UP, e.DOWN
    -                    if (e.{@link Ext.EventObject#getKey getKey()} == e.ENTER) {
    -                        var form = field.ownerCt.getForm();
    -                        form.submit();
    -                    }
    -                }
    -            }
    -        }
    -    ],
    -    ...
    -});
    -             * 
    - * @param {Ext.form.Field} this - * @param {Ext.EventObject} e The event object - */ + 'specialkey', - /** - * @event change - * Fires just before the field blurs if the field value has changed. - * @param {Ext.form.Field} this - * @param {Mixed} newValue The new value - * @param {Mixed} oldValue The original value - */ + 'change', - /** - * @event invalid - * Fires after the field has been marked as invalid. - * @param {Ext.form.Field} this - * @param {String} msg The validation message - */ + 'invalid', - /** - * @event valid - * Fires after the field has been validated with no errors. - * @param {Ext.form.Field} this - */ + 'valid' ); }, - /** - * Returns the {@link Ext.form.Field#name name} or {@link Ext.form.ComboBox#hiddenName hiddenName} - * attribute of the field if available. - * @return {String} name The field {@link Ext.form.Field#name name} or {@link Ext.form.ComboBox#hiddenName hiddenName} - */ + getName : function(){ return this.rendered && this.el.dom.name ? this.el.dom.name : this.name || this.id || ''; }, - // private + onRender : function(ct, position){ if(!this.el){ var cfg = this.getAutoCreate(); @@ -57841,38 +37145,23 @@ var form = new Ext.form.FormPanel({ this.el.addClass([this.fieldClass, this.cls]); }, - // private + getItemCt : function(){ return this.itemCt; }, - // private + initValue : function(){ if(this.value !== undefined){ this.setValue(this.value); }else if(!Ext.isEmpty(this.el.dom.value) && this.el.dom.value != this.emptyText){ this.setValue(this.el.dom.value); } - /** - * The original value of the field as configured in the {@link #value} configuration, or - * as loaded by the last form load operation if the form's {@link Ext.form.BasicForm#trackResetOnLoad trackResetOnLoad} - * setting is true. - * @type mixed - * @property originalValue - */ + this.originalValue = this.getValue(); }, - /** - *

    Returns true if the value of this Field has been changed from its original value. - * Will return false if the field is disabled or has not been rendered yet.

    - *

    Note that if the owning {@link Ext.form.BasicForm form} was configured with - * {@link Ext.form.BasicForm}.{@link Ext.form.BasicForm#trackResetOnLoad trackResetOnLoad} - * then the original value is updated when the values are loaded by - * {@link Ext.form.BasicForm}.{@link Ext.form.BasicForm#setValues setValues}.

    - * @return {Boolean} True if this field has been changed from its original value (and - * is not disabled), false otherwise. - */ + isDirty : function() { if(this.disabled || !this.rendered) { return false; @@ -57880,10 +37169,7 @@ var form = new Ext.form.FormPanel({ return String(this.getValue()) !== String(this.originalValue); }, - /** - * Sets the read only state of this field. - * @param {Boolean} readOnly Whether the field should be read only. - */ + setReadOnly : function(readOnly){ if(this.rendered){ this.el.dom.readOnly = readOnly; @@ -57891,43 +37177,40 @@ var form = new Ext.form.FormPanel({ this.readOnly = readOnly; }, - // private + afterRender : function(){ Ext.form.Field.superclass.afterRender.call(this); this.initEvents(); this.initValue(); }, - // private + fireKey : function(e){ if(e.isSpecialKey()){ this.fireEvent('specialkey', this, e); } }, - /** - * Resets the current field value to the originally loaded value and clears any validation messages. - * See {@link Ext.form.BasicForm}.{@link Ext.form.BasicForm#trackResetOnLoad trackResetOnLoad} - */ + reset : function(){ this.setValue(this.originalValue); this.clearInvalid(); }, - // private + initEvents : function(){ this.mon(this.el, Ext.EventManager.useKeydown ? 'keydown' : 'keypress', this.fireKey, this); this.mon(this.el, 'focus', this.onFocus, this); - // standardise buffer across all browsers + OS-es for consistent event order. - // (the 10ms buffer for Editors fixes a weird FF/Win editor issue when changing OS window focus) + + this.mon(this.el, 'blur', this.onBlur, this, this.inEditor ? {buffer:10} : null); }, - // private + preFocus: Ext.emptyFn, - // private + onFocus : function(){ this.preFocus(); if(this.focusClass){ @@ -57935,22 +37218,16 @@ var form = new Ext.form.FormPanel({ } if(!this.hasFocus){ this.hasFocus = true; - /** - *

    The value that the Field had at the time it was last focused. This is the value that is passed - * to the {@link #change} event which is fired if the value has been changed when the Field is blurred.

    - *

    This will be undefined until the Field has been visited. Compare {@link #originalValue}.

    - * @type mixed - * @property startValue - */ + this.startValue = this.getValue(); this.fireEvent('focus', this); } }, - // private + beforeBlur : Ext.emptyFn, - // private + onBlur : function(){ this.beforeBlur(); if(this.focusClass){ @@ -57968,16 +37245,10 @@ var form = new Ext.form.FormPanel({ this.postBlur(); }, - // private + postBlur : Ext.emptyFn, - /** - * Returns whether or not the field value is currently valid by - * {@link #validateValue validating} the {@link #processValue processed value} - * of the field. Note: {@link #disabled} fields are ignored. - * @param {Boolean} preventMark True to disable marking the field invalid - * @return {Boolean} True if the value is valid, else false - */ + isValid : function(preventMark){ if(this.disabled){ return true; @@ -57989,10 +37260,7 @@ var form = new Ext.form.FormPanel({ return v; }, - /** - * Validates the field value - * @return {Boolean} True if the value is valid, else false - */ + validate : function(){ if(this.disabled || this.validateValue(this.processValue(this.getRawValue()))){ this.clearInvalid(); @@ -58001,27 +37269,14 @@ var form = new Ext.form.FormPanel({ return false; }, - /** - * This method should only be overridden if necessary to prepare raw values - * for validation (see {@link #validate} and {@link #isValid}). This method - * is expected to return the processed value for the field which will - * be used for validation (see validateValue method). - * @param {Mixed} value - */ + processValue : function(value){ return value; }, - /** - * Uses getErrors to build an array of validation errors. If any errors are found, markInvalid is called - * with the first and false is returned, otherwise true is returned. Previously, subclasses were invited - * to provide an implementation of this to process validations - from 3.2 onwards getErrors should be - * overridden instead. - * @param {Mixed} The current value of the field - * @return {Boolean} True if all validations passed, false if one or more failed - */ + validateValue : function(value) { - //currently, we only show 1 error at a time for a field, so just use the first one + var error = this.getErrors(value)[0]; if (error == undefined) { @@ -58032,35 +37287,19 @@ var form = new Ext.form.FormPanel({ } }, - /** - * Runs this field's validators and returns an array of error messages for any validation failures. - * This is called internally during validation and would not usually need to be used manually. - * Each subclass should override or augment the return value to provide their own errors - * @return {Array} All error messages for this field - */ + getErrors: function() { return []; }, - /** - * Gets the active error message for this field. - * @return {String} Returns the active error message on the field, if there is no error, an empty string is returned. - */ + getActiveError : function(){ return this.activeError || ''; }, - /** - *

    Display an error message associated with this field, using {@link #msgTarget} to determine how to - * display the message and applying {@link #invalidClass} to the field's UI element.

    - *

    Note: this method does not cause the Field's {@link #validate} method to return false - * if the value does pass validation. So simply marking a Field as invalid will not prevent - * submission of forms submitted with the {@link Ext.form.Action.Submit#clientValidation} option set.

    - * {@link #isValid invalid}. - * @param {String} msg (optional) The validation message (defaults to {@link #invalidText}) - */ + markInvalid : function(msg){ - //don't set the error icon if we're not rendered or marking is prevented + if (this.rendered && !this.preventMark) { msg = msg || this.invalidText; @@ -58080,11 +37319,9 @@ var form = new Ext.form.FormPanel({ this.setActiveError(msg); }, - /** - * Clear any invalid styles/messages for this field - */ + clearInvalid : function(){ - //don't remove the error icon if we're not rendered or marking is prevented + if (this.rendered && !this.preventMark) { this.el.removeClass(this.invalidClass); var mt = this.getMessageHandler(); @@ -58103,53 +37340,40 @@ var form = new Ext.form.FormPanel({ this.unsetActiveError(); }, - /** - * Sets the current activeError to the given string. Fires the 'invalid' event. - * This does not set up the error icon, only sets the message and fires the event. To show the error icon, - * use markInvalid instead, which calls this method internally - * @param {String} msg The error message - * @param {Boolean} suppressEvent True to suppress the 'invalid' event from being fired - */ + setActiveError: function(msg, suppressEvent) { this.activeError = msg; if (suppressEvent !== true) this.fireEvent('invalid', this, msg); }, - /** - * Clears the activeError and fires the 'valid' event. This is called internally by clearInvalid and would not - * usually need to be called manually - * @param {Boolean} suppressEvent True to suppress the 'invalid' event from being fired - */ + unsetActiveError: function(suppressEvent) { delete this.activeError; if (suppressEvent !== true) this.fireEvent('valid', this); }, - // private + getMessageHandler : function(){ return Ext.form.MessageTargets[this.msgTarget]; }, - // private + getErrorCt : function(){ - return this.el.findParent('.x-form-element', 5, true) || // use form element wrap if available - this.el.findParent('.x-form-field-wrap', 5, true); // else direct field wrap + return this.el.findParent('.x-form-element', 5, true) || + this.el.findParent('.x-form-field-wrap', 5, true); }, - // Alignment for 'under' target + alignErrorEl : function(){ this.errorEl.setWidth(this.getErrorCt().getWidth(true) - 20); }, - // Alignment for 'side' target + alignErrorIcon : function(){ this.errorIcon.alignTo(this.el, 'tl-tr', [2, 0]); }, - /** - * Returns the raw data value which may or may not be a valid, defined value. To return a normalized value see {@link #getValue}. - * @return {Mixed} value The field value - */ + getRawValue : function(){ var v = this.rendered ? this.el.getValue() : Ext.value(this.value, ''); if(v === this.emptyText){ @@ -58158,10 +37382,7 @@ var form = new Ext.form.FormPanel({ return v; }, - /** - * Returns the normalized data value (undefined or emptyText will be returned as ''). To return the raw value see {@link #getRawValue}. - * @return {Mixed} value The field value - */ + getValue : function(){ if(!this.rendered) { return this.value; @@ -58173,20 +37394,12 @@ var form = new Ext.form.FormPanel({ return v; }, - /** - * Sets the underlying DOM field's value directly, bypassing validation. To set the value with validation see {@link #setValue}. - * @param {Mixed} value The value to set - * @return {Mixed} value The field value that is set - */ + setRawValue : function(v){ return this.rendered ? (this.el.dom.value = (Ext.isEmpty(v) ? '' : v)) : ''; }, - /** - * Sets a data value into the field and validates it. To set the value directly without validation see {@link #setRawValue}. - * @param {Mixed} value The value to set - * @return {Ext.form.Field} this - */ + setValue : function(v){ this.value = v; if(this.rendered){ @@ -58196,21 +37409,15 @@ var form = new Ext.form.FormPanel({ return this; }, - // private, does not work for all fields + append : function(v){ this.setValue([this.getValue(), v].join('')); } - /** - * @cfg {Boolean} autoWidth @hide - */ - /** - * @cfg {Boolean} autoHeight @hide - */ + + - /** - * @cfg {String} autoEl @hide - */ + }); @@ -58220,7 +37427,7 @@ Ext.form.MessageTargets = { field.el.addClass(field.invalidClass); field.el.dom.qtip = msg; field.el.dom.qclass = 'x-form-invalid-tip'; - if(Ext.QuickTips){ // fix for floating editors interacting with DND + if(Ext.QuickTips){ Ext.QuickTips.enable(); } }, @@ -58243,7 +37450,7 @@ Ext.form.MessageTargets = { field.el.addClass(field.invalidClass); if(!field.errorEl){ var elp = field.getErrorCt(); - if(!elp){ // field has no container el + if(!elp){ field.el.dom.title = msg; return; } @@ -58271,7 +37478,7 @@ Ext.form.MessageTargets = { field.el.addClass(field.invalidClass); if(!field.errorIcon){ var elp = field.getErrorCt(); - // field has no container el + if(!elp){ field.el.dom.title = msg; return; @@ -58303,7 +37510,7 @@ Ext.form.MessageTargets = { } }; -// anything other than normal should be considered experimental + Ext.form.Field.msgFx = { normal : { show: function(msgEl, f){ @@ -58338,206 +37545,65 @@ Ext.form.Field.msgFx = { } }; Ext.reg('field', Ext.form.Field); -/** - * @class Ext.form.TextField - * @extends Ext.form.Field - *

    Basic text field. Can be used as a direct replacement for traditional text inputs, - * or as the base class for more sophisticated input controls (like {@link Ext.form.TextArea} - * and {@link Ext.form.ComboBox}).

    - *

    Validation

    - *

    The validation procedure is described in the documentation for {@link #validateValue}.

    - *

    Alter Validation Behavior

    - *

    Validation behavior for each field can be configured:

    - *
      - *
    • {@link Ext.form.TextField#invalidText invalidText} : the default validation message to - * show if any validation step above does not provide a message when invalid
    • - *
    • {@link Ext.form.TextField#maskRe maskRe} : filter out keystrokes before any validation occurs
    • - *
    • {@link Ext.form.TextField#stripCharsRe stripCharsRe} : filter characters after being typed in, - * but before being validated
    • - *
    • {@link Ext.form.Field#invalidClass invalidClass} : alternate style when invalid
    • - *
    • {@link Ext.form.Field#validateOnBlur validateOnBlur}, - * {@link Ext.form.Field#validationDelay validationDelay}, and - * {@link Ext.form.Field#validationEvent validationEvent} : modify how/when validation is triggered
    • - *
    - * - * @constructor Creates a new TextField - * @param {Object} config Configuration options - * - * @xtype textfield - */ + Ext.form.TextField = Ext.extend(Ext.form.Field, { - /** - * @cfg {String} vtypeText A custom error message to display in place of the default message provided - * for the {@link #vtype} currently set for this field (defaults to ''). Note: - * only applies if {@link #vtype} is set, else ignored. - */ - /** - * @cfg {RegExp} stripCharsRe A JavaScript RegExp object used to strip unwanted content from the value - * before validation (defaults to null). - */ - /** - * @cfg {Boolean} grow true if this field should automatically grow and shrink to its content - * (defaults to false) - */ + + + grow : false, - /** - * @cfg {Number} growMin The minimum width to allow when {@link #grow} = true (defaults - * to 30) - */ + growMin : 30, - /** - * @cfg {Number} growMax The maximum width to allow when {@link #grow} = true (defaults - * to 800) - */ + growMax : 800, - /** - * @cfg {String} vtype A validation type name as defined in {@link Ext.form.VTypes} (defaults to null) - */ + vtype : null, - /** - * @cfg {RegExp} maskRe An input mask regular expression that will be used to filter keystrokes that do - * not match (defaults to null) - */ + maskRe : null, - /** - * @cfg {Boolean} disableKeyFilter Specify true to disable input keystroke filtering (defaults - * to false) - */ + disableKeyFilter : false, - /** - * @cfg {Boolean} allowBlank Specify false to validate that the value's length is > 0 (defaults to - * true) - */ + allowBlank : true, - /** - * @cfg {Number} minLength Minimum input field length required (defaults to 0) - */ + minLength : 0, - /** - * @cfg {Number} maxLength Maximum input field length allowed by validation (defaults to Number.MAX_VALUE). - * This behavior is intended to provide instant feedback to the user by improving usability to allow pasting - * and editing or overtyping and back tracking. To restrict the maximum number of characters that can be - * entered into the field use {@link Ext.form.Field#autoCreate autoCreate} to add - * any attributes you want to a field, for example:
    
    -var myField = new Ext.form.NumberField({
    -    id: 'mobile',
    -    anchor:'90%',
    -    fieldLabel: 'Mobile',
    -    maxLength: 16, // for validation
    -    autoCreate: {tag: 'input', type: 'text', size: '20', autocomplete: 'off', maxlength: '10'}
    -});
    -
    - */ + maxLength : Number.MAX_VALUE, - /** - * @cfg {String} minLengthText Error text to display if the {@link #minLength minimum length} - * validation fails (defaults to 'The minimum length for this field is {minLength}') - */ + minLengthText : 'The minimum length for this field is {0}', - /** - * @cfg {String} maxLengthText Error text to display if the {@link #maxLength maximum length} - * validation fails (defaults to 'The maximum length for this field is {maxLength}') - */ + maxLengthText : 'The maximum length for this field is {0}', - /** - * @cfg {Boolean} selectOnFocus true to automatically select any existing field text when the field - * receives input focus (defaults to false) - */ + selectOnFocus : false, - /** - * @cfg {String} blankText The error text to display if the {@link #allowBlank} validation - * fails (defaults to 'This field is required') - */ + blankText : 'This field is required', - /** - * @cfg {Function} validator - *

    A custom validation function to be called during field validation ({@link #validateValue}) - * (defaults to null). If specified, this function will be called first, allowing the - * developer to override the default validation process.

    - *

    This function will be passed the following Parameters:

    - *
      - *
    • value: Mixed - *
      The current field value
    • - *
    - *

    This function is to Return:

    - *
      - *
    • true: Boolean - *
      true if the value is valid
    • - *
    • msg: String - *
      An error message if the value is invalid
    • - *
    - */ + validator : null, - /** - * @cfg {RegExp} regex A JavaScript RegExp object to be tested against the field value during validation - * (defaults to null). If the test fails, the field will be marked invalid using - * {@link #regexText}. - */ + regex : null, - /** - * @cfg {String} regexText The error text to display if {@link #regex} is used and the - * test fails during validation (defaults to '') - */ + regexText : '', - /** - * @cfg {String} emptyText The default text to place into an empty field (defaults to null). - * Note: that this value will be submitted to the server if this field is enabled and configured - * with a {@link #name}. - */ + emptyText : null, - /** - * @cfg {String} emptyClass The CSS class to apply to an empty field to style the {@link #emptyText} - * (defaults to 'x-form-empty-field'). This class is automatically added and removed as needed - * depending on the current field value. - */ + emptyClass : 'x-form-empty-field', - /** - * @cfg {Boolean} enableKeyEvents true to enable the proxying of key events for the HTML input - * field (defaults to false) - */ + initComponent : function(){ Ext.form.TextField.superclass.initComponent.call(this); this.addEvents( - /** - * @event autosize - * Fires when the {@link #autoSize} function is triggered. The field may or - * may not have actually changed size according to the default logic, but this event provides - * a hook for the developer to apply additional logic at runtime to resize the field if needed. - * @param {Ext.form.Field} this This text field - * @param {Number} width The new field width - */ + 'autosize', - /** - * @event keydown - * Keydown input field event. This event only fires if {@link #enableKeyEvents} - * is set to true. - * @param {Ext.form.TextField} this This text field - * @param {Ext.EventObject} e - */ + 'keydown', - /** - * @event keyup - * Keyup input field event. This event only fires if {@link #enableKeyEvents} - * is set to true. - * @param {Ext.form.TextField} this This text field - * @param {Ext.EventObject} e - */ + 'keyup', - /** - * @event keypress - * Keypress input field event. This event only fires if {@link #enableKeyEvents} - * is set to true. - * @param {Ext.form.TextField} this This text field - * @param {Ext.EventObject} e - */ + 'keypress' ); }, - // private + initEvents : function(){ Ext.form.TextField.superclass.initEvents.call(this); if(this.validationEvent == 'keyup'){ @@ -58594,7 +37660,7 @@ var myField = new Ext.form.NumberField({ } }, - //private + onDisable: function(){ Ext.form.TextField.superclass.onDisable.call(this); if(Ext.isIE){ @@ -58602,7 +37668,7 @@ var myField = new Ext.form.NumberField({ } }, - //private + onEnable: function(){ Ext.form.TextField.superclass.onEnable.call(this); if(Ext.isIE){ @@ -58610,38 +37676,34 @@ var myField = new Ext.form.NumberField({ } }, - // private + onKeyUpBuffered : function(e){ if(this.doAutoSize(e)){ this.autoSize(); } }, - // private + doAutoSize : function(e){ return !e.isNavKeyPress(); }, - // private + onKeyUp : function(e){ this.fireEvent('keyup', this, e); }, - // private + onKeyDown : function(e){ this.fireEvent('keydown', this, e); }, - // private + onKeyPress : function(e){ this.fireEvent('keypress', this, e); }, - /** - * Resets the current field value to the originally-loaded value and clears any validation messages. - * Also adds {@link #emptyText} and {@link #emptyClass} if the - * original value was blank. - */ + reset : function(){ Ext.form.TextField.superclass.reset.call(this); this.applyEmptyText(); @@ -58654,7 +37716,7 @@ var myField = new Ext.form.NumberField({ } }, - // private + preFocus : function(){ var el = this.el; if(this.emptyText){ @@ -58668,12 +37730,12 @@ var myField = new Ext.form.NumberField({ } }, - // private + postBlur : function(){ this.applyEmptyText(); }, - // private + filterKeys : function(e){ if(e.ctrlKey){ return; @@ -58701,87 +37763,29 @@ var myField = new Ext.form.NumberField({ return this; }, - /** - *

    Validates a value according to the field's validation rules and returns an array of errors - * for any failing validations. Validation rules are processed in the following order:

    - *
      - * - *
    • 1. Field specific validator - *
      - *

      A validator offers a way to customize and reuse a validation specification. - * If a field is configured with a {@link #validator} - * function, it will be passed the current field value. The {@link #validator} - * function is expected to return either: - *

        - *
      • Boolean true if the value is valid (validation continues).
      • - *
      • a String to represent the invalid message if invalid (validation halts).
      • - *
      - *
    • - * - *
    • 2. Basic Validation - *
      - *

      If the {@link #validator} has not halted validation, - * basic validation proceeds as follows:

      - * - *
        - * - *
      • {@link #allowBlank} : (Invalid message = - * {@link #emptyText})
        - * Depending on the configuration of {@link #allowBlank}, a - * blank field will cause validation to halt at this step and return - * Boolean true or false accordingly. - *
      • - * - *
      • {@link #minLength} : (Invalid message = - * {@link #minLengthText})
        - * If the passed value does not satisfy the {@link #minLength} - * specified, validation halts. - *
      • - * - *
      • {@link #maxLength} : (Invalid message = - * {@link #maxLengthText})
        - * If the passed value does not satisfy the {@link #maxLength} - * specified, validation halts. - *
      • - * - *
      - *
    • - * - *
    • 3. Preconfigured Validation Types (VTypes) - *
      - *

      If none of the prior validation steps halts validation, a field - * configured with a {@link #vtype} will utilize the - * corresponding {@link Ext.form.VTypes VTypes} validation function. - * If invalid, either the field's {@link #vtypeText} or - * the VTypes vtype Text property will be used for the invalid message. - * Keystrokes on the field will be filtered according to the VTypes - * vtype Mask property.

      - *
    • - * - *
    • 4. Field specific regex test - *
      - *

      If none of the prior validation steps halts validation, a field's - * configured {@link #regex} test will be processed. - * The invalid message for this test is configured with - * {@link #regexText}.

      - *
    • - * - * @param {Mixed} value The value to validate. The processed raw value will be used if nothing is passed - * @return {Array} Array of any validation errors - */ + getErrors: function(value) { var errors = Ext.form.TextField.superclass.getErrors.apply(this, arguments); value = value || this.processValue(this.getRawValue()); - if(Ext.isFunction(this.validator)){ + if (Ext.isFunction(this.validator)) { var msg = this.validator(value); if (msg !== true) { errors.push(msg); } } - if (!this.allowBlank && (value.length < 1 || value === this.emptyText)) { // if it's blank + if (value.length < 1 || value === this.emptyText) { + if (this.allowBlank) { + + return errors; + } else { + errors.push(this.blankText); + } + } + + if (!this.allowBlank && (value.length < 1 || value === this.emptyText)) { errors.push(this.blankText); } @@ -58807,11 +37811,7 @@ var myField = new Ext.form.NumberField({ return errors; }, - /** - * Selects text in this field - * @param {Number} start (optional) The index where the selection should start (defaults to 0) - * @param {Number} end (optional) The index where the selection should end (defaults to the text length) - */ + selectText : function(start, end){ var v = this.getRawValue(); var doFocus = false; @@ -58836,10 +37836,7 @@ var myField = new Ext.form.NumberField({ } }, - /** - * Automatically grows the field to accomodate the width of the text up to the maximum field width allowed. - * This only takes effect if {@link #grow} = true, and fires the {@link #autosize} event. - */ + autoSize : function(){ if(!this.grow || !this.rendered){ return; @@ -58855,7 +37852,7 @@ var myField = new Ext.form.NumberField({ Ext.removeNode(d); d = null; v += ' '; - var w = Math.min(this.growMax, Math.max(this.metrics.getWidth(v) + /* add extra padding */ 10, this.growMin)); + var w = Math.min(this.growMax, Math.max(this.metrics.getWidth(v) + 10, this.growMin)); this.el.setWidth(w); this.fireEvent('autosize', this, w); }, @@ -58869,88 +37866,34 @@ var myField = new Ext.form.NumberField({ } }); Ext.reg('textfield', Ext.form.TextField); -/** - * @class Ext.form.TriggerField - * @extends Ext.form.TextField - * Provides a convenient wrapper for TextFields that adds a clickable trigger button (looks like a combobox by default). - * The trigger has no default action, so you must assign a function to implement the trigger click handler by - * overriding {@link #onTriggerClick}. You can create a TriggerField directly, as it renders exactly like a combobox - * for which you can provide a custom implementation. For example: - *
      
      -var trigger = new Ext.form.TriggerField();
      -trigger.onTriggerClick = myTriggerFn;
      -trigger.applyToMarkup('my-field');
      -
      - * - * However, in general you will most likely want to use TriggerField as the base class for a reusable component. - * {@link Ext.form.DateField} and {@link Ext.form.ComboBox} are perfect examples of this. - * - * @constructor - * Create a new TriggerField. - * @param {Object} config Configuration options (valid {@Ext.form.TextField} config options will also be applied - * to the base TextField) - * @xtype trigger - */ + Ext.form.TriggerField = Ext.extend(Ext.form.TextField, { - /** - * @cfg {String} triggerClass - * An additional CSS class used to style the trigger button. The trigger will always get the - * class 'x-form-trigger' by default and triggerClass will be appended if specified. - */ - /** - * @cfg {Mixed} triggerConfig - *

      A {@link Ext.DomHelper DomHelper} config object specifying the structure of the - * trigger element for this Field. (Optional).

      - *

      Specify this when you need a customized element to act as the trigger button for a TriggerField.

      - *

      Note that when using this option, it is the developer's responsibility to ensure correct sizing, positioning - * and appearance of the trigger. Defaults to:

      - *
      {tag: "img", src: Ext.BLANK_IMAGE_URL, cls: "x-form-trigger " + this.triggerClass}
      - */ - /** - * @cfg {String/Object} autoCreate

      A {@link Ext.DomHelper DomHelper} element spec, or true for a default - * element spec. Used to create the {@link Ext.Component#getEl Element} which will encapsulate this Component. - * See {@link Ext.Component#autoEl autoEl} for details. Defaults to:

      - *
      {tag: "input", type: "text", size: "16", autocomplete: "off"}
      - */ + + + defaultAutoCreate : {tag: "input", type: "text", size: "16", autocomplete: "off"}, - /** - * @cfg {Boolean} hideTrigger true to hide the trigger element and display only the base - * text field (defaults to false) - */ + hideTrigger:false, - /** - * @cfg {Boolean} editable false to prevent the user from typing text directly into the field, - * the field will only respond to a click on the trigger to set the value. (defaults to true). - */ + editable: true, - /** - * @cfg {Boolean} readOnly true to prevent the user from changing the field, and - * hides the trigger. Superceeds the editable and hideTrigger options if the value is true. - * (defaults to false) - */ + readOnly: false, - /** - * @cfg {String} wrapFocusClass The class added to the to the wrap of the trigger element. Defaults to - * x-trigger-wrap-focus. - */ + wrapFocusClass: 'x-trigger-wrap-focus', - /** - * @hide - * @method autoSize - */ + autoSize: Ext.emptyFn, - // private + monitorTab : true, - // private + deferHeight : true, - // private + mimicing : false, actionMode: 'wrap', defaultTriggerWidth: 17, - // private + onResize : function(w, h){ Ext.form.TriggerField.superclass.onResize.call(this, w, h); var tw = this.getTriggerWidth(); @@ -58968,14 +37911,14 @@ Ext.form.TriggerField = Ext.extend(Ext.form.TextField, { return tw; }, - // private + alignErrorIcon : function(){ if(this.wrap){ this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]); } }, - // private + onRender : function(ct, position){ this.doc = Ext.isIE ? Ext.getBody() : Ext.getDoc(); Ext.form.TriggerField.superclass.onRender.call(this, ct, position); @@ -59024,13 +37967,7 @@ Ext.form.TriggerField = Ext.extend(Ext.form.TextField, { } }, - /** - * @param {Boolean} value True to allow the user to directly edit the field text - * Allow or prevent the user from directly editing the field text. If false is passed, - * the user will only be able to modify the field using the trigger. Will also add - * a click event to the text field which will call the trigger. This method - * is the runtime equivalent of setting the 'editable' config option at config time. - */ + setEditable: function(editable){ if(editable != this.editable){ this.editable = editable; @@ -59038,13 +37975,7 @@ Ext.form.TriggerField = Ext.extend(Ext.form.TextField, { } }, - /** - * @param {Boolean} value True to prevent the user changing the field and explicitly - * hide the trigger. - * Setting this to true will superceed settings editable and hideTrigger. - * Setting this to false will defer back to editable and hideTrigger. This method - * is the runtime equivalent of setting the 'readOnly' config option at config time. - */ + setReadOnly: function(readOnly){ if(readOnly != this.readOnly){ this.readOnly = readOnly; @@ -59057,14 +37988,14 @@ Ext.form.TriggerField = Ext.extend(Ext.form.TextField, { this.updateEditState(); }, - // private + initTrigger : function(){ this.mon(this.trigger, 'click', this.onTriggerClick, this, {preventDefault:true}); this.trigger.addClassOnOver('x-form-trigger-over'); this.trigger.addClassOnClick('x-form-trigger-click'); }, - // private + onDestroy : function(){ Ext.destroy(this.trigger, this.wrap); if (this.mimicing){ @@ -59074,7 +38005,7 @@ Ext.form.TriggerField = Ext.extend(Ext.form.TextField, { Ext.form.TriggerField.superclass.onDestroy.call(this); }, - // private + onFocus : function(){ Ext.form.TriggerField.superclass.onFocus.call(this); if(!this.mimicing){ @@ -59087,24 +38018,24 @@ Ext.form.TriggerField = Ext.extend(Ext.form.TextField, { } }, - // private + checkTab : function(me, e){ if(e.getKey() == e.TAB){ this.triggerBlur(); } }, - // private + onBlur : Ext.emptyFn, - // private + mimicBlur : function(e){ if(!this.isDestroyed && !this.wrap.contains(e.target) && this.validateBlur(e)){ this.triggerBlur(); } }, - // private + triggerBlur : function(){ this.mimicing = false; this.doc.un('mousedown', this.mimicBlur, this); @@ -59119,61 +38050,25 @@ Ext.form.TriggerField = Ext.extend(Ext.form.TextField, { beforeBlur : Ext.emptyFn, - // private - // This should be overriden by any subclass that needs to check whether or not the field can be blurred. + + validateBlur : function(e){ return true; }, - /** - * The function that should handle the trigger's click event. This method does nothing by default - * until overridden by an implementing function. See Ext.form.ComboBox and Ext.form.DateField for - * sample implementations. - * @method - * @param {EventObject} e - */ + onTriggerClick : Ext.emptyFn - /** - * @cfg {Boolean} grow @hide - */ - /** - * @cfg {Number} growMin @hide - */ - /** - * @cfg {Number} growMax @hide - */ + + + }); -/** - * @class Ext.form.TwinTriggerField - * @extends Ext.form.TriggerField - * TwinTriggerField is not a public class to be used directly. It is meant as an abstract base class - * to be extended by an implementing class. For an example of implementing this class, see the custom - * SearchField implementation here: - * http://extjs.com/deploy/ext/examples/form/custom.html - */ + Ext.form.TwinTriggerField = Ext.extend(Ext.form.TriggerField, { - /** - * @cfg {Mixed} triggerConfig - *

      A {@link Ext.DomHelper DomHelper} config object specifying the structure of the trigger elements - * for this Field. (Optional).

      - *

      Specify this when you need a customized element to contain the two trigger elements for this Field. - * Each trigger element must be marked by the CSS class x-form-trigger (also see - * {@link #trigger1Class} and {@link #trigger2Class}).

      - *

      Note that when using this option, it is the developer's responsibility to ensure correct sizing, - * positioning and appearance of the triggers.

      - */ - /** - * @cfg {String} trigger1Class - * An additional CSS class used to style the trigger button. The trigger will always get the - * class 'x-form-trigger' by default and triggerClass will be appended if specified. - */ - /** - * @cfg {String} trigger2Class - * An additional CSS class used to style the trigger button. The trigger will always get the - * class 'x-form-trigger' by default and triggerClass will be appended if specified. - */ + + + initComponent : function(){ Ext.form.TwinTriggerField.superclass.initComponent.call(this); @@ -59232,69 +38127,33 @@ Ext.form.TwinTriggerField = Ext.extend(Ext.form.TriggerField, { return tw; }, - // private + onDestroy : function() { Ext.destroy(this.triggers); Ext.form.TwinTriggerField.superclass.onDestroy.call(this); }, - /** - * The function that should handle the trigger's click event. This method does nothing by default - * until overridden by an implementing function. See {@link Ext.form.TriggerField#onTriggerClick} - * for additional information. - * @method - * @param {EventObject} e - */ + onTrigger1Click : Ext.emptyFn, - /** - * The function that should handle the trigger's click event. This method does nothing by default - * until overridden by an implementing function. See {@link Ext.form.TriggerField#onTriggerClick} - * for additional information. - * @method - * @param {EventObject} e - */ + onTrigger2Click : Ext.emptyFn }); Ext.reg('trigger', Ext.form.TriggerField); -/** - * @class Ext.form.TextArea - * @extends Ext.form.TextField - * Multiline text field. Can be used as a direct replacement for traditional textarea fields, plus adds - * support for auto-sizing. - * @constructor - * Creates a new TextArea - * @param {Object} config Configuration options - * @xtype textarea - */ + Ext.form.TextArea = Ext.extend(Ext.form.TextField, { - /** - * @cfg {Number} growMin The minimum height to allow when {@link Ext.form.TextField#grow grow}=true - * (defaults to 60) - */ + growMin : 60, - /** - * @cfg {Number} growMax The maximum height to allow when {@link Ext.form.TextField#grow grow}=true - * (defaults to 1000) - */ + growMax: 1000, growAppend : ' \n ', enterIsSpecial : false, - /** - * @cfg {Boolean} preventScrollbars true to prevent scrollbars from appearing regardless of how much text is - * in the field. This option is only relevant when {@link #grow} is true. Equivalent to setting overflow: hidden, defaults to - * false. - */ + preventScrollbars: false, - /** - * @cfg {String/Object} autoCreate

      A {@link Ext.DomHelper DomHelper} element spec, or true for a default - * element spec. Used to create the {@link Ext.Component#getEl Element} which will encapsulate this Component. - * See {@link Ext.Component#autoEl autoEl} for details. Defaults to:

      - *
      {tag: "textarea", style: "width:100px;height:60px;", autocomplete: "off"}
      - */ + - // private + onRender : function(ct, position){ if(!this.el){ this.defaultAutoCreate = { @@ -59326,15 +38185,12 @@ Ext.form.TextArea = Ext.extend(Ext.form.TextField, { } }, - // private + doAutoSize : function(e){ return !e.isNavKeyPress() || e.getKey() == e.ENTER; }, - /** - * Automatically grows the field to accomodate the height of the text up to the maximum field height allowed. - * This only takes effect if grow = true, and fires the {@link #autosize} event if the height changes. - */ + autoSize: function(){ if(!this.grow || !this.textSizeEl){ return; @@ -59362,69 +38218,34 @@ Ext.form.TextArea = Ext.extend(Ext.form.TextField, { } } }); -Ext.reg('textarea', Ext.form.TextArea);/** - * @class Ext.form.NumberField - * @extends Ext.form.TextField - * Numeric text field that provides automatic keystroke filtering and numeric validation. - * @constructor - * Creates a new NumberField - * @param {Object} config Configuration options - * @xtype numberfield - */ +Ext.reg('textarea', Ext.form.TextArea); Ext.form.NumberField = Ext.extend(Ext.form.TextField, { - /** - * @cfg {RegExp} stripCharsRe @hide - */ - /** - * @cfg {RegExp} maskRe @hide - */ - /** - * @cfg {String} fieldClass The default CSS class for the field (defaults to "x-form-field x-form-num-field") - */ + + + fieldClass: "x-form-field x-form-num-field", - /** - * @cfg {Boolean} allowDecimals False to disallow decimal values (defaults to true) - */ + allowDecimals : true, - /** - * @cfg {String} decimalSeparator Character(s) to allow as the decimal separator (defaults to '.') - */ + decimalSeparator : ".", - /** - * @cfg {Number} decimalPrecision The maximum precision to display after the decimal separator (defaults to 2) - */ + decimalPrecision : 2, - /** - * @cfg {Boolean} allowNegative False to prevent entering a negative sign (defaults to true) - */ + allowNegative : true, - /** - * @cfg {Number} minValue The minimum allowed value (defaults to Number.NEGATIVE_INFINITY) - */ + minValue : Number.NEGATIVE_INFINITY, - /** - * @cfg {Number} maxValue The maximum allowed value (defaults to Number.MAX_VALUE) - */ + maxValue : Number.MAX_VALUE, - /** - * @cfg {String} minText Error text to display if the minimum value validation fails (defaults to "The minimum value for this field is {minValue}") - */ + minText : "The minimum value for this field is {0}", - /** - * @cfg {String} maxText Error text to display if the maximum value validation fails (defaults to "The maximum value for this field is {maxValue}") - */ + maxText : "The maximum value for this field is {0}", - /** - * @cfg {String} nanText Error text to display if the value is not a valid number. For example, this can happen - * if a valid character like '.' or '-' is left in the field with no number (defaults to "{value} is not a valid number") - */ + nanText : "{0} is not a valid number", - /** - * @cfg {String} baseChars The base set of characters to evaluate as valid numbers (defaults to '0123456789'). - */ + baseChars : "0123456789", - // private + initEvents : function(){ var allowed = this.baseChars + ''; if (this.allowDecimals) { @@ -59437,20 +38258,13 @@ Ext.form.NumberField = Ext.extend(Ext.form.TextField, { Ext.form.NumberField.superclass.initEvents.call(this); }, - /** - * Runs all of NumberFields validations and returns an array of any errors. Note that this first - * runs TextField's validations, so the returned array is an amalgamation of all field errors. - * The additional validations run test that the value is a number, and that it is within the - * configured min and max values. - * @param {Mixed} value The value to get errors for (defaults to the current field value) - * @return {Array} All validation errors for this field - */ + getErrors: function(value) { var errors = Ext.form.NumberField.superclass.getErrors.apply(this, arguments); value = value || this.processValue(this.getRawValue()); - if (value.length < 1) { // if it's blank and textfield didn't flag it then it's valid + if (value.length < 1) { return errors; } @@ -59483,29 +38297,23 @@ Ext.form.NumberField = Ext.extend(Ext.form.TextField, { return Ext.form.NumberField.superclass.setValue.call(this, v); }, - /** - * Replaces any existing {@link #minValue} with the new value. - * @param {Number} value The minimum value - */ + setMinValue : function(value){ this.minValue = Ext.num(value, Number.NEGATIVE_INFINITY); }, - /** - * Replaces any existing {@link #maxValue} with the new value. - * @param {Number} value The maximum value - */ + setMaxValue : function(value){ this.maxValue = Ext.num(value, Number.MAX_VALUE); }, - // private + parseValue : function(value){ value = parseFloat(String(value).replace(this.decimalSeparator, ".")); return isNaN(value) ? '' : value; }, - // private + fixPrecision : function(value){ var nan = isNaN(value); if(!this.allowDecimals || this.decimalPrecision == -1 || nan || !value){ @@ -59521,132 +38329,48 @@ Ext.form.NumberField = Ext.extend(Ext.form.TextField, { } } }); -Ext.reg('numberfield', Ext.form.NumberField);/** - * @class Ext.form.DateField - * @extends Ext.form.TriggerField - * Provides a date input field with a {@link Ext.DatePicker} dropdown and automatic date validation. - * @constructor - * Create a new DateField - * @param {Object} config - * @xtype datefield - */ +Ext.reg('numberfield', Ext.form.NumberField); Ext.form.DateField = Ext.extend(Ext.form.TriggerField, { - /** - * @cfg {String} format - * The default date format string which can be overriden for localization support. The format must be - * valid according to {@link Date#parseDate} (defaults to 'm/d/Y'). - */ + format : "m/d/Y", - /** - * @cfg {String} altFormats - * Multiple date formats separated by "|" to try when parsing a user input value and it - * does not match the defined format (defaults to - * 'm/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d'). - */ + altFormats : "m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d", - /** - * @cfg {String} disabledDaysText - * The tooltip to display when the date falls on a disabled day (defaults to 'Disabled') - */ + disabledDaysText : "Disabled", - /** - * @cfg {String} disabledDatesText - * The tooltip text to display when the date falls on a disabled date (defaults to 'Disabled') - */ + disabledDatesText : "Disabled", - /** - * @cfg {String} minText - * The error text to display when the date in the cell is before {@link #minValue} (defaults to - * 'The date in this field must be after {minValue}'). - */ + minText : "The date in this field must be equal to or after {0}", - /** - * @cfg {String} maxText - * The error text to display when the date in the cell is after {@link #maxValue} (defaults to - * 'The date in this field must be before {maxValue}'). - */ + maxText : "The date in this field must be equal to or before {0}", - /** - * @cfg {String} invalidText - * The error text to display when the date in the field is invalid (defaults to - * '{value} is not a valid date - it must be in the format {format}'). - */ + invalidText : "{0} is not a valid date - it must be in the format {1}", - /** - * @cfg {String} triggerClass - * An additional CSS class used to style the trigger button. The trigger will always get the - * class 'x-form-trigger' and triggerClass will be appended if specified - * (defaults to 'x-form-date-trigger' which displays a calendar icon). - */ + triggerClass : 'x-form-date-trigger', - /** - * @cfg {Boolean} showToday - * false to hide the footer area of the DatePicker containing the Today button and disable - * the keyboard handler for spacebar that selects the current date (defaults to true). - */ + showToday : true, - /** - * @cfg {Date/String} minValue - * The minimum allowed date. Can be either a Javascript date object or a string date in a - * valid format (defaults to null). - */ - /** - * @cfg {Date/String} maxValue - * The maximum allowed date. Can be either a Javascript date object or a string date in a - * valid format (defaults to null). - */ - /** - * @cfg {Array} disabledDays - * An array of days to disable, 0 based (defaults to null). Some examples:
      
      -// disable Sunday and Saturday:
      -disabledDays:  [0, 6]
      -// disable weekdays:
      -disabledDays: [1,2,3,4,5]
      -     * 
      - */ - /** - * @cfg {Array} disabledDates - * An array of "dates" to disable, as strings. These strings will be used to build a dynamic regular - * expression so they are very powerful. Some examples:
      
      -// disable these exact dates:
      -disabledDates: ["03/08/2003", "09/16/2003"]
      -// disable these days for every year:
      -disabledDates: ["03/08", "09/16"]
      -// only match the beginning (useful if you are using short years):
      -disabledDates: ["^03/08"]
      -// disable every day in March 2006:
      -disabledDates: ["03/../2006"]
      -// disable every day in every March:
      -disabledDates: ["^03"]
      -     * 
      - * Note that the format of the dates included in the array should exactly match the {@link #format} config. - * In order to support regular expressions, if you are using a {@link #format date format} that has "." in - * it, you will have to escape the dot when restricting dates. For example: ["03\\.08\\.03"]. - */ - /** - * @cfg {String/Object} autoCreate - * A {@link Ext.DomHelper DomHelper element specification object}, or true for the default element - * specification object:
      
      -     * autoCreate: {tag: "input", type: "text", size: "10", autocomplete: "off"}
      -     * 
      - */ + + + + + - // private + defaultAutoCreate : {tag: "input", type: "text", size: "10", autocomplete: "off"}, - // in the absence of a time value, a default value of 12 noon will be used - // (note: 12 noon was chosen because it steers well clear of all DST timezone changes) - initTime: '12', // 24 hour format + + + initTime: '12', initTimeFormat: 'H', - // PUBLIC -- to be documented + safeParse : function(value, format) { if (/[gGhH]/.test(format.replace(/(\\.)/g, ''))) { - // if parse format contains hour information, no DST adjustment is necessary + return Date.parseDate(value, format); } else { - // set time to 12 noon, then clear the time + var parsedDate = Date.parseDate(value + ' ' + this.initTime, format + ' ' + this.initTimeFormat); if (parsedDate) return parsedDate.clearTime(); @@ -59657,12 +38381,7 @@ disabledDates: ["^03"] Ext.form.DateField.superclass.initComponent.call(this); this.addEvents( - /** - * @event select - * Fires when a date is selected via the date picker. - * @param {Ext.form.DateField} this - * @param {Date} date The date that was selected - */ + 'select' ); @@ -59688,7 +38407,7 @@ disabledDates: ["^03"] }, - // private + initDisabledDays : function(){ if(this.disabledDates){ var dd = this.disabledDates, @@ -59705,11 +38424,7 @@ disabledDates: ["^03"] } }, - /** - * Replaces any existing disabled dates with new values and refreshes the DatePicker. - * @param {Array} disabledDates An array of date strings (see the {@link #disabledDates} config - * for details on supported values) used to disable a pattern of dates. - */ + setDisabledDates : function(dd){ this.disabledDates = dd; this.initDisabledDays(); @@ -59718,11 +38433,7 @@ disabledDates: ["^03"] } }, - /** - * Replaces any existing disabled days (by index, 0-6) with new values and refreshes the DatePicker. - * @param {Array} disabledDays An array of disabled day indexes. See the {@link #disabledDays} - * config for details on supported values. - */ + setDisabledDays : function(dd){ this.disabledDays = dd; if(this.menu){ @@ -59730,10 +38441,7 @@ disabledDates: ["^03"] } }, - /** - * Replaces any existing {@link #minValue} with the new value and refreshes the DatePicker. - * @param {Date} value The minimum date that can be selected - */ + setMinValue : function(dt){ this.minValue = (Ext.isString(dt) ? this.parseDate(dt) : dt); if(this.menu){ @@ -59741,10 +38449,7 @@ disabledDates: ["^03"] } }, - /** - * Replaces any existing {@link #maxValue} with the new value and refreshes the DatePicker. - * @param {Date} value The maximum date that can be selected - */ + setMaxValue : function(dt){ this.maxValue = (Ext.isString(dt) ? this.parseDate(dt) : dt); if(this.menu){ @@ -59752,21 +38457,13 @@ disabledDates: ["^03"] } }, - /** - * Runs all of NumberFields validations and returns an array of any errors. Note that this first - * runs TextField's validations, so the returned array is an amalgamation of all field errors. - * The additional validation checks are testing that the date format is valid, that the chosen - * date is within the min and max date constraints set, that the date chosen is not in the disabledDates - * regex and that the day chosed is not one of the disabledDays. - * @param {Mixed} value The value to get errors for (defaults to the current field value) - * @return {Array} All validation errors for this field - */ + getErrors: function(value) { var errors = Ext.form.DateField.superclass.getErrors.apply(this, arguments); value = this.formatDate(value || this.processValue(this.getRawValue())); - if (value.length < 1) { // if it's blank and textfield didn't flag it then it's valid + if (value.length < 1) { return errors; } @@ -59805,47 +38502,23 @@ disabledDates: ["^03"] return errors; }, - // private - // Provides logic to override the default TriggerField.validateBlur which just returns true + + validateBlur : function(){ return !this.menu || !this.menu.isVisible(); }, - /** - * Returns the current date value of the date field. - * @return {Date} The date value - */ + getValue : function(){ return this.parseDate(Ext.form.DateField.superclass.getValue.call(this)) || ""; }, - /** - * Sets the value of the date field. You can pass a date object or any string that can be - * parsed into a valid date, using {@link #format} as the date format, according - * to the same rules as {@link Date#parseDate} (the default format used is "m/d/Y"). - *
      Usage: - *
      
      -//All of these calls set the same date value (May 4, 2006)
      -
      -//Pass a date object:
      -var dt = new Date('5/4/2006');
      -dateField.setValue(dt);
      -
      -//Pass a date string (default format):
      -dateField.setValue('05/04/2006');
      -
      -//Pass a date string (custom format):
      -dateField.format = 'Y-m-d';
      -dateField.setValue('2006-05-04');
      -
      - * @param {String/Date} date The date or valid date string - * @return {Ext.form.Field} this - */ + setValue : function(date){ return Ext.form.DateField.superclass.setValue.call(this, this.formatDate(this.parseDate(date))); }, - // private + parseDate : function(value) { if(!value || Ext.isDate(value)){ return value; @@ -59865,23 +38538,20 @@ dateField.setValue('2006-05-04'); return v; }, - // private + onDestroy : function(){ Ext.destroy(this.menu, this.keyNav); Ext.form.DateField.superclass.onDestroy.call(this); }, - // private + formatDate : function(date){ return Ext.isDate(date) ? date.dateFormat(this.format) : date; }, - /** - * @method onTriggerClick - * @hide - */ - // private - // Implements the default empty TriggerField.onTriggerClick function to display the DatePicker + + + onTriggerClick : function(){ if(this.disabled){ return; @@ -59910,7 +38580,7 @@ dateField.setValue('2006-05-04'); this.menuEvents('on'); }, - //private + menuEvents: function(method){ this.menu[method]('select', this.onSelect, this); this.menu[method]('hide', this.onMenuHide, this); @@ -59928,7 +38598,7 @@ dateField.setValue('2006-05-04'); this.menuEvents('un'); }, - // private + beforeBlur : function(){ var v = this.parseDate(this.getRawValue()); if(v){ @@ -59936,45 +38606,22 @@ dateField.setValue('2006-05-04'); } } - /** - * @cfg {Boolean} grow @hide - */ - /** - * @cfg {Number} growMin @hide - */ - /** - * @cfg {Number} growMax @hide - */ - /** - * @hide - * @method autoSize - */ + + + + }); -Ext.reg('datefield', Ext.form.DateField);/** - * @class Ext.form.DisplayField - * @extends Ext.form.Field - * A display-only text field which is not validated and not submitted. - * @constructor - * Creates a new DisplayField. - * @param {Object} config Configuration options - * @xtype displayfield - */ +Ext.reg('datefield', Ext.form.DateField); Ext.form.DisplayField = Ext.extend(Ext.form.Field, { validationEvent : false, validateOnBlur : false, defaultAutoCreate : {tag: "div"}, - /** - * @cfg {String} fieldClass The default CSS class for the field (defaults to "x-form-display-field") - */ + fieldClass : "x-form-display-field", - /** - * @cfg {Boolean} htmlEncode false to skip HTML-encoding the text when rendering it (defaults to - * false). This might be useful if you want to include tags in the field's innerHTML rather than - * rendering them as string literals per the default logic. - */ + htmlEncode: false, - // private + initEvents : Ext.emptyFn, isValid : function(){ @@ -60015,454 +38662,106 @@ Ext.form.DisplayField = Ext.extend(Ext.form.Field, { this.setRawValue(v); return this; } - /** - * @cfg {String} inputType - * @hide - */ - /** - * @cfg {Boolean} disabled - * @hide - */ - /** - * @cfg {Boolean} readOnly - * @hide - */ - /** - * @cfg {Boolean} validateOnBlur - * @hide - */ - /** - * @cfg {Number} validationDelay - * @hide - */ - /** - * @cfg {String/Boolean} validationEvent - * @hide - */ + + + + + + }); Ext.reg('displayfield', Ext.form.DisplayField); -/** - * @class Ext.form.ComboBox - * @extends Ext.form.TriggerField - *

      A combobox control with support for autocomplete, remote-loading, paging and many other features.

      - *

      A ComboBox works in a similar manner to a traditional HTML <select> field. The difference is - * that to submit the {@link #valueField}, you must specify a {@link #hiddenName} to create a hidden input - * field to hold the value of the valueField. The {@link #displayField} is shown in the text field - * which is named according to the {@link #name}.

      - *

      Events

      - *

      To do something when something in ComboBox is selected, configure the select event:

      
      -var cb = new Ext.form.ComboBox({
      -    // all of your config options
      -    listeners:{
      -         scope: yourScope,
      -         'select': yourFunction
      -    }
      -});
      -
      -// Alternatively, you can assign events after the object is created:
      -var cb = new Ext.form.ComboBox(yourOptions);
      -cb.on('select', yourFunction, yourScope);
      - * 

      - * - *

      ComboBox in Grid

      - *

      If using a ComboBox in an {@link Ext.grid.EditorGridPanel Editor Grid} a {@link Ext.grid.Column#renderer renderer} - * will be needed to show the displayField when the editor is not active. Set up the renderer manually, or implement - * a reusable render, for example:

      
      -// create reusable renderer
      -Ext.util.Format.comboRenderer = function(combo){
      -    return function(value){
      -        var record = combo.findRecord(combo.{@link #valueField}, value);
      -        return record ? record.get(combo.{@link #displayField}) : combo.{@link #valueNotFoundText};
      -    }
      -}
      -
      -// create the combo instance
      -var combo = new Ext.form.ComboBox({
      -    {@link #typeAhead}: true,
      -    {@link #triggerAction}: 'all',
      -    {@link #lazyRender}:true,
      -    {@link #mode}: 'local',
      -    {@link #store}: new Ext.data.ArrayStore({
      -        id: 0,
      -        fields: [
      -            'myId',
      -            'displayText'
      -        ],
      -        data: [[1, 'item1'], [2, 'item2']]
      -    }),
      -    {@link #valueField}: 'myId',
      -    {@link #displayField}: 'displayText'
      -});
       
      -// snippet of column model used within grid
      -var cm = new Ext.grid.ColumnModel([{
      -       ...
      -    },{
      -       header: "Some Header",
      -       dataIndex: 'whatever',
      -       width: 130,
      -       editor: combo, // specify reference to combo instance
      -       renderer: Ext.util.Format.comboRenderer(combo) // pass combo instance to reusable renderer
      -    },
      -    ...
      -]);
      - * 

      - * - *

      Filtering

      - *

      A ComboBox {@link #doQuery uses filtering itself}, for information about filtering the ComboBox - * store manually see {@link #lastQuery}.

      - * @constructor - * Create a new ComboBox. - * @param {Object} config Configuration options - * @xtype combo - */ Ext.form.ComboBox = Ext.extend(Ext.form.TriggerField, { - /** - * @cfg {Mixed} transform The id, DOM node or element of an existing HTML SELECT to convert to a ComboBox. - * Note that if you specify this and the combo is going to be in an {@link Ext.form.BasicForm} or - * {@link Ext.form.FormPanel}, you must also set {@link #lazyRender} = true. - */ - /** - * @cfg {Boolean} lazyRender true to prevent the ComboBox from rendering until requested - * (should always be used when rendering into an {@link Ext.Editor} (e.g. {@link Ext.grid.EditorGridPanel Grids}), - * defaults to false). - */ - /** - * @cfg {String/Object} autoCreate

      A {@link Ext.DomHelper DomHelper} element spec, or true for a default - * element spec. Used to create the {@link Ext.Component#getEl Element} which will encapsulate this Component. - * See {@link Ext.Component#autoEl autoEl} for details. Defaults to:

      - *
      {tag: "input", type: "text", size: "24", autocomplete: "off"}
      - */ - /** - * @cfg {Ext.data.Store/Array} store The data source to which this combo is bound (defaults to undefined). - * Acceptable values for this property are: - *
        - *
      • any {@link Ext.data.Store Store} subclass
      • - *
      • an Array : Arrays will be converted to a {@link Ext.data.ArrayStore} internally, - * automatically generating {@link Ext.data.Field#name field names} to work with all data components. - *
          - *
        • 1-dimensional array : (e.g., ['Foo','Bar'])
          - * A 1-dimensional array will automatically be expanded (each array item will be used for both the combo - * {@link #valueField} and {@link #displayField})
        • - *
        • 2-dimensional array : (e.g., [['f','Foo'],['b','Bar']])
          - * For a multi-dimensional array, the value in index 0 of each item will be assumed to be the combo - * {@link #valueField}, while the value at index 1 is assumed to be the combo {@link #displayField}. - *
      - *

      See also {@link #mode}.

      - */ - /** - * @cfg {String} title If supplied, a header element is created containing this text and added into the top of - * the dropdown list (defaults to undefined, with no header element) - */ + + + + + - // private + defaultAutoCreate : {tag: "input", type: "text", size: "24", autocomplete: "off"}, - /** - * @cfg {Number} listWidth The width (used as a parameter to {@link Ext.Element#setWidth}) of the dropdown - * list (defaults to the width of the ComboBox field). See also {@link #minListWidth} - */ - /** - * @cfg {String} displayField The underlying {@link Ext.data.Field#name data field name} to bind to this - * ComboBox (defaults to undefined if {@link #mode} = 'remote' or 'field1' if - * {@link #transform transforming a select} or if the {@link #store field name is autogenerated based on - * the store configuration}). - *

      See also {@link #valueField}.

      - *

      Note: if using a ComboBox in an {@link Ext.grid.EditorGridPanel Editor Grid} a - * {@link Ext.grid.Column#renderer renderer} will be needed to show the displayField when the editor is not - * active.

      - */ - /** - * @cfg {String} valueField The underlying {@link Ext.data.Field#name data value name} to bind to this - * ComboBox (defaults to undefined if {@link #mode} = 'remote' or 'field2' if - * {@link #transform transforming a select} or if the {@link #store field name is autogenerated based on - * the store configuration}). - *

      Note: use of a valueField requires the user to make a selection in order for a value to be - * mapped. See also {@link #hiddenName}, {@link #hiddenValue}, and {@link #displayField}.

      - */ - /** - * @cfg {String} hiddenName If specified, a hidden form field with this name is dynamically generated to store the - * field's data value (defaults to the underlying DOM element's name). Required for the combo's value to automatically - * post during a form submission. See also {@link #valueField}. - *

      Note: the hidden field's id will also default to this name if {@link #hiddenId} is not specified. - * The ComboBox {@link Ext.Component#id id} and the {@link #hiddenId} should be different, since - * no two DOM nodes should share the same id. So, if the ComboBox {@link Ext.form.Field#name name} and - * hiddenName are the same, you should specify a unique {@link #hiddenId}.

      - */ - /** - * @cfg {String} hiddenId If {@link #hiddenName} is specified, hiddenId can also be provided - * to give the hidden field a unique id (defaults to the {@link #hiddenName}). The hiddenId - * and combo {@link Ext.Component#id id} should be different, since no two DOM - * nodes should share the same id. - */ - /** - * @cfg {String} hiddenValue Sets the initial value of the hidden field if {@link #hiddenName} is - * specified to contain the selected {@link #valueField}, from the Store. Defaults to the configured - * {@link Ext.form.Field#value value}. - */ - /** - * @cfg {String} listClass The CSS class to add to the predefined 'x-combo-list' class - * applied the dropdown list element (defaults to ''). - */ + + + + + + + listClass : '', - /** - * @cfg {String} selectedClass CSS class to apply to the selected item in the dropdown list - * (defaults to 'x-combo-selected') - */ + selectedClass : 'x-combo-selected', - /** - * @cfg {String} listEmptyText The empty text to display in the data view if no items are found. - * (defaults to '') - */ + listEmptyText: '', - /** - * @cfg {String} triggerClass An additional CSS class used to style the trigger button. The trigger will always - * get the class 'x-form-trigger' and triggerClass will be appended if specified - * (defaults to 'x-form-arrow-trigger' which displays a downward arrow icon). - */ + triggerClass : 'x-form-arrow-trigger', - /** - * @cfg {Boolean/String} shadow true or "sides" for the default effect, "frame" for - * 4-way shadow, and "drop" for bottom-right - */ + shadow : 'sides', - /** - * @cfg {String/Array} listAlign A valid anchor position value. See {@link Ext.Element#alignTo} for details - * on supported anchor positions and offsets. To specify x/y offsets as well, this value - * may be specified as an Array of {@link Ext.Element#alignTo} method arguments.

      - *
      [ 'tl-bl?', [6,0] ]
      (defaults to 'tl-bl?') - */ + listAlign : 'tl-bl?', - /** - * @cfg {Number} maxHeight The maximum height in pixels of the dropdown list before scrollbars are shown - * (defaults to 300) - */ + maxHeight : 300, - /** - * @cfg {Number} minHeight The minimum height in pixels of the dropdown list when the list is constrained by its - * distance to the viewport edges (defaults to 90) - */ + minHeight : 90, - /** - * @cfg {String} triggerAction The action to execute when the trigger is clicked. - *
        - *
      • 'query' : Default - *

        {@link #doQuery run the query} using the {@link Ext.form.Field#getRawValue raw value}.

      • - *
      • 'all' : - *

        {@link #doQuery run the query} specified by the {@link #allQuery} config option

      • - *
      - *

      See also {@link #queryParam}.

      - */ + triggerAction : 'query', - /** - * @cfg {Number} minChars The minimum number of characters the user must type before autocomplete and - * {@link #typeAhead} activate (defaults to 4 if {@link #mode} = 'remote' or 0 if - * {@link #mode} = 'local', does not apply if - * {@link Ext.form.TriggerField#editable editable} = false). - */ + minChars : 4, - /** - * @cfg {Boolean} autoSelect true to select the first result gathered by the data store (defaults - * to true). A false value would require a manual selection from the dropdown list to set the components value - * unless the value of ({@link #typeAheadDelay}) were true. - */ + autoSelect : true, - /** - * @cfg {Boolean} typeAhead true to populate and autoselect the remainder of the text being - * typed after a configurable delay ({@link #typeAheadDelay}) if it matches a known value (defaults - * to false) - */ + typeAhead : false, - /** - * @cfg {Number} queryDelay The length of time in milliseconds to delay between the start of typing and - * sending the query to filter the dropdown list (defaults to 500 if {@link #mode} = 'remote' - * or 10 if {@link #mode} = 'local') - */ + queryDelay : 500, - /** - * @cfg {Number} pageSize If greater than 0, a {@link Ext.PagingToolbar} is displayed in the - * footer of the dropdown list and the {@link #doQuery filter queries} will execute with page start and - * {@link Ext.PagingToolbar#pageSize limit} parameters. Only applies when {@link #mode} = 'remote' - * (defaults to 0). - */ + pageSize : 0, - /** - * @cfg {Boolean} selectOnFocus true to select any existing text in the field immediately on focus. - * Only applies when {@link Ext.form.TriggerField#editable editable} = true (defaults to - * false). - */ + selectOnFocus : false, - /** - * @cfg {String} queryParam Name of the query ({@link Ext.data.Store#baseParam baseParam} name for the store) - * as it will be passed on the querystring (defaults to 'query') - */ + queryParam : 'query', - /** - * @cfg {String} loadingText The text to display in the dropdown list while data is loading. Only applies - * when {@link #mode} = 'remote' (defaults to 'Loading...') - */ + loadingText : 'Loading...', - /** - * @cfg {Boolean} resizable true to add a resize handle to the bottom of the dropdown list - * (creates an {@link Ext.Resizable} with 'se' {@link Ext.Resizable#pinned pinned} handles). - * Defaults to false. - */ + resizable : false, - /** - * @cfg {Number} handleHeight The height in pixels of the dropdown list resize handle if - * {@link #resizable} = true (defaults to 8) - */ + handleHeight : 8, - /** - * @cfg {String} allQuery The text query to send to the server to return all records for the list - * with no filtering (defaults to '') - */ + allQuery: '', - /** - * @cfg {String} mode Acceptable values are: - *
        - *
      • 'remote' : Default - *

        Automatically loads the {@link #store} the first time the trigger - * is clicked. If you do not want the store to be automatically loaded the first time the trigger is - * clicked, set to 'local' and manually load the store. To force a requery of the store - * every time the trigger is clicked see {@link #lastQuery}.

      • - *
      • 'local' : - *

        ComboBox loads local data

        - *
        
        -var combo = new Ext.form.ComboBox({
        -    renderTo: document.body,
        -    mode: 'local',
        -    store: new Ext.data.ArrayStore({
        -        id: 0,
        -        fields: [
        -            'myId',  // numeric value is the key
        -            'displayText'
        -        ],
        -        data: [[1, 'item1'], [2, 'item2']]  // data is local
        -    }),
        -    valueField: 'myId',
        -    displayField: 'displayText',
        -    triggerAction: 'all'
        -});
        -     * 
      • - *
      - */ + mode: 'remote', - /** - * @cfg {Number} minListWidth The minimum width of the dropdown list in pixels (defaults to 70, will - * be ignored if {@link #listWidth} has a higher value) - */ + minListWidth : 70, - /** - * @cfg {Boolean} forceSelection true to restrict the selected value to one of the values in the list, - * false to allow the user to set arbitrary text into the field (defaults to false) - */ + forceSelection : false, - /** - * @cfg {Number} typeAheadDelay The length of time in milliseconds to wait until the typeahead text is displayed - * if {@link #typeAhead} = true (defaults to 250) - */ + typeAheadDelay : 250, - /** - * @cfg {String} valueNotFoundText When using a name/value combo, if the value passed to setValue is not found in - * the store, valueNotFoundText will be displayed as the field text if defined (defaults to undefined). If this - * default text is used, it means there is no value set and no validation will occur on this field. - */ + - /** - * @cfg {Boolean} lazyInit true to not initialize the list for this combo until the field is focused - * (defaults to true) - */ + lazyInit : true, - /** - * @cfg {Boolean} clearFilterOnReset true to clear any filters on the store (when in local mode) when reset is called - * (defaults to true) - */ + clearFilterOnReset : true, - /** - * @cfg {Boolean} submitValue False to clear the name attribute on the field so that it is not submitted during a form post. - * If a hiddenName is specified, setting this to true will cause both the hidden field and the element to be submitted. - * Defaults to undefined. - */ + submitValue: undefined, - /** - * The value of the match string used to filter the store. Delete this property to force a requery. - * Example use: - *
      
      -var combo = new Ext.form.ComboBox({
      -    ...
      -    mode: 'remote',
      -    ...
      -    listeners: {
      -        // delete the previous query in the beforequery event or set
      -        // combo.lastQuery = null (this will reload the store the next time it expands)
      -        beforequery: function(qe){
      -            delete qe.combo.lastQuery;
      -        }
      -    }
      -});
      -     * 
      - * To make sure the filter in the store is not cleared the first time the ComboBox trigger is used - * configure the combo with lastQuery=''. Example use: - *
      
      -var combo = new Ext.form.ComboBox({
      -    ...
      -    mode: 'local',
      -    triggerAction: 'all',
      -    lastQuery: ''
      -});
      -     * 
      - * @property lastQuery - * @type String - */ + - // private + initComponent : function(){ Ext.form.ComboBox.superclass.initComponent.call(this); this.addEvents( - /** - * @event expand - * Fires when the dropdown list is expanded - * @param {Ext.form.ComboBox} combo This combo box - */ + 'expand', - /** - * @event collapse - * Fires when the dropdown list is collapsed - * @param {Ext.form.ComboBox} combo This combo box - */ + 'collapse', - /** - * @event beforeselect - * Fires before a list item is selected. Return false to cancel the selection. - * @param {Ext.form.ComboBox} combo This combo box - * @param {Ext.data.Record} record The data record returned from the underlying store - * @param {Number} index The index of the selected item in the dropdown list - */ + 'beforeselect', - /** - * @event select - * Fires when a list item is selected - * @param {Ext.form.ComboBox} combo This combo box - * @param {Ext.data.Record} record The data record returned from the underlying store - * @param {Number} index The index of the selected item in the dropdown list - */ + 'select', - /** - * @event beforequery - * Fires before all queries are processed. Return false to cancel the query or set the queryEvent's - * cancel property to true. - * @param {Object} queryEvent An object that has these properties:
        - *
      • combo : Ext.form.ComboBox
        This combo box
      • - *
      • query : String
        The query
      • - *
      • forceAll : Boolean
        True to force "all" query
      • - *
      • cancel : Boolean
        Set to true to cancel the query
      • - *
      - */ + 'beforequery' ); if(this.transform){ @@ -60490,7 +38789,7 @@ var combo = new Ext.form.ComboBox({ this.valueField = 'value'; this.displayField = 'text'; } - s.name = Ext.id(); // wipe out the name in case somewhere else they have a reference + s.name = Ext.id(); if(!this.lazyRender){ this.target = true; this.el = Ext.DomHelper.insertBefore(s, this.autoCreate || this.defaultAutoCreate); @@ -60498,7 +38797,7 @@ var combo = new Ext.form.ComboBox({ } Ext.removeNode(s); } - //auto-configure store from local array data + else if(this.store){ this.store = Ext.StoreMgr.lookup(this.store); if(this.store.autoCreated){ @@ -60521,7 +38820,7 @@ var combo = new Ext.form.ComboBox({ } }, - // private + onRender : function(ct, position){ if(this.hiddenName && !Ext.isDefined(this.submitValue)){ this.submitValue = false; @@ -60543,7 +38842,7 @@ var combo = new Ext.form.ComboBox({ } }, - // private + initValue : function(){ Ext.form.ComboBox.superclass.initValue.call(this); if(this.hiddenField){ @@ -60563,7 +38862,7 @@ var combo = new Ext.form.ComboBox({ return zindex; }, - // private + initList : function(){ if(!this.list){ var cls = 'x-combo-list', @@ -60610,40 +38909,12 @@ var combo = new Ext.form.ComboBox({ } if(!this.tpl){ - /** - * @cfg {String/Ext.XTemplate} tpl

      The template string, or {@link Ext.XTemplate} instance to - * use to display each item in the dropdown list. The dropdown list is displayed in a - * DataView. See {@link #view}.

      - *

      The default template string is:

      
      -                  '<tpl for="."><div class="x-combo-list-item">{' + this.displayField + '}</div></tpl>'
      -                * 
      - *

      Override the default value to create custom UI layouts for items in the list. - * For example:

      
      -                  '<tpl for="."><div ext:qtip="{state}. {nick}" class="x-combo-list-item">{state}</div></tpl>'
      -                * 
      - *

      The template must contain one or more substitution parameters using field - * names from the Combo's {@link #store Store}. In the example above an - *

      ext:qtip
      attribute is added to display other fields from the Store.

      - *

      To preserve the default visual look of list items, add the CSS class name - *

      x-combo-list-item
      to the template's container element.

      - *

      Also see {@link #itemSelector} for additional details.

      - */ + this.tpl = '
      {' + this.displayField + '}
      '; - /** - * @cfg {String} itemSelector - *

      A simple CSS selector (e.g. div.some-class or span:first-child) that will be - * used to determine what nodes the {@link #view Ext.DataView} which handles the dropdown - * display will be working with.

      - *

      Note: this setting is required if a custom XTemplate has been - * specified in {@link #tpl} which assigns a class other than

      'x-combo-list-item'
      - * to dropdown list items
      - */ - } - - /** - * The {@link Ext.DataView DataView} used to display the ComboBox's options. - * @type Ext.DataView - */ + + } + + this.view = new Ext.DataView({ applyTo: this.innerList, tpl: this.tpl, @@ -60678,57 +38949,17 @@ var combo = new Ext.form.ComboBox({ } }, - /** - *

      Returns the element used to house this ComboBox's pop-up list. Defaults to the document body.

      - * A custom implementation may be provided as a configuration option if the floating list needs to be rendered - * to a different Element. An example might be rendering the list inside a Menu so that clicking - * the list does not hide the Menu:
      
      -var store = new Ext.data.ArrayStore({
      -    autoDestroy: true,
      -    fields: ['initials', 'fullname'],
      -    data : [
      -        ['FF', 'Fred Flintstone'],
      -        ['BR', 'Barney Rubble']
      -    ]
      -});
      -
      -var combo = new Ext.form.ComboBox({
      -    store: store,
      -    displayField: 'fullname',
      -    emptyText: 'Select a name...',
      -    forceSelection: true,
      -    getListParent: function() {
      -        return this.el.up('.x-menu');
      -    },
      -    iconCls: 'no-icon', //use iconCls if placing within menu to shift to right side of menu
      -    mode: 'local',
      -    selectOnFocus: true,
      -    triggerAction: 'all',
      -    typeAhead: true,
      -    width: 135
      -});
      -
      -var menu = new Ext.menu.Menu({
      -    id: 'mainMenu',
      -    items: [
      -        combo // A Field in a Menu
      -    ]
      -});
      -
      - */ + getListParent : function() { return document.body; }, - /** - * Returns the store associated with this combo. - * @return {Ext.data.Store} The store - */ + getStore : function(){ return this.store; }, - // private + bindStore : function(store, initial){ if(this.store && !initial){ if(this.store !== store && this.store.autoDestroy){ @@ -60777,11 +39008,11 @@ var menu = new Ext.menu.Menu({ } }, - // private + initEvents : function(){ Ext.form.ComboBox.superclass.initEvents.call(this); - + this.keyNav = new Ext.KeyNav(this.el, { "up" : function(e){ this.inKeyMode = true; @@ -60818,10 +39049,10 @@ var menu = new Ext.menu.Menu({ doRelay : function(e, h, hname){ if(hname == 'down' || this.scope.isExpanded()){ - // this MUST be called before ComboBox#fireKey() + var relay = Ext.KeyNav.prototype.doRelay.apply(this, arguments); if(!Ext.isIE && Ext.EventManager.useKeydown){ - // call Combo#fireKey() for browsers which use keydown event (except IE) + this.scope.fireKey(e); } return relay; @@ -60844,7 +39075,7 @@ var menu = new Ext.menu.Menu({ }, - // private + onDestroy : function(){ if (this.dqTask){ this.dqTask.cancel(); @@ -60861,14 +39092,14 @@ var menu = new Ext.menu.Menu({ Ext.form.ComboBox.superclass.onDestroy.call(this); }, - // private + fireKey : function(e){ if (!this.isExpanded()) { Ext.form.ComboBox.superclass.fireKey.call(this, e); } }, - // private + onResize : function(w, h){ Ext.form.ComboBox.superclass.onResize.apply(this, arguments); if(!isNaN(w) && this.isVisible() && this.list){ @@ -60886,7 +39117,7 @@ var menu = new Ext.menu.Menu({ } }, - // private + onEnable : function(){ Ext.form.ComboBox.superclass.onEnable.apply(this, arguments); if(this.hiddenField){ @@ -60894,7 +39125,7 @@ var menu = new Ext.menu.Menu({ } }, - // private + onDisable : function(){ Ext.form.ComboBox.superclass.onDisable.apply(this, arguments); if(this.hiddenField){ @@ -60902,7 +39133,7 @@ var menu = new Ext.menu.Menu({ } }, - // private + onBeforeLoad : function(){ if(!this.hasFocus){ return; @@ -60913,7 +39144,7 @@ var menu = new Ext.menu.Menu({ this.selectedIndex = -1; }, - // private + onLoad : function(){ if(!this.hasFocus){ return; @@ -60943,7 +39174,7 @@ var menu = new Ext.menu.Menu({ }, - // private + onTypeAhead : function(){ if(this.store.getCount() > 0){ var r = this.store.getAt(0); @@ -60957,7 +39188,7 @@ var menu = new Ext.menu.Menu({ } }, - // private + assertValue : function(){ var val = this.getRawValue(), rec = this.findRecord(this.displayField, val); @@ -60971,9 +39202,9 @@ var menu = new Ext.menu.Menu({ } }else{ if(rec){ - // onSelect may have already set the value and by doing so - // set the display field properly. Let's not wipe out the - // valueField here by just sending the displayField. + + + if (val == rec.get(this.displayField) && this.value == rec.get(this.valueField)){ return; } @@ -60983,7 +39214,7 @@ var menu = new Ext.menu.Menu({ } }, - // private + onSelect : function(record, index){ if(this.fireEvent('beforeselect', this, record, index) !== false){ this.setValue(record.data[this.valueField || this.displayField]); @@ -60992,16 +39223,13 @@ var menu = new Ext.menu.Menu({ } }, - // inherit docs + getName: function(){ var hf = this.hiddenField; return hf && hf.name ? hf.name : this.hiddenName || Ext.form.ComboBox.superclass.getName.call(this); }, - /** - * Returns the currently selected field value or empty string if no value is set. - * @return {String} value The selected value - */ + getValue : function(){ if(this.valueField){ return Ext.isDefined(this.value) ? this.value : ''; @@ -61010,9 +39238,7 @@ var menu = new Ext.menu.Menu({ } }, - /** - * Clears any text/value currently set in the field - */ + clearValue : function(){ if(this.hiddenField){ this.hiddenField.value = ''; @@ -61023,14 +39249,7 @@ var menu = new Ext.menu.Menu({ this.value = ''; }, - /** - * Sets the specified value into the field. If the value finds a match, the corresponding record text - * will be displayed in the field. If the value does not match the data value of an existing item, - * and the valueNotFoundText config option is defined, it will be displayed as the default field text. - * Otherwise the field will be blank (although the value will still be set). - * @param {String} value The value to match - * @return {Ext.form.Field} this - */ + setValue : function(v){ var text = v; if(this.valueField){ @@ -61050,7 +39269,7 @@ var menu = new Ext.menu.Menu({ return this; }, - // private + findRecord : function(prop, value){ var record; if(this.store.getCount() > 0){ @@ -61064,14 +39283,14 @@ var menu = new Ext.menu.Menu({ return record; }, - // private + onViewMove : function(e, t){ this.inKeyMode = false; }, - // private + onViewOver : function(e, t){ - if(this.inKeyMode){ // prevent key nav and mouse over conflicts + if(this.inKeyMode){ return; } var item = this.view.findItemFromChild(t); @@ -61081,7 +39300,7 @@ var menu = new Ext.menu.Menu({ } }, - // private + onViewClick : function(doFocus){ var index = this.view.getSelectedIndexes()[0], s = this.store, @@ -61097,7 +39316,7 @@ var menu = new Ext.menu.Menu({ }, - // private + restrictHeight : function(){ this.innerList.dom.style.height = ''; var inner = this.innerList.dom, @@ -61116,21 +39335,12 @@ var menu = new Ext.menu.Menu({ this.list.endUpdate(); }, - /** - * Returns true if the dropdown list is expanded, else false. - */ + isExpanded : function(){ return this.list && this.list.isVisible(); }, - /** - * Select an item in the dropdown list by its data value. This function does NOT cause the select event to fire. - * The store must be loaded and the list expanded for this function to work, otherwise use setValue. - * @param {String} value The data value of the item to select - * @param {Boolean} scrollIntoView False to prevent the dropdown list from autoscrolling to display the - * selected item if it is not currently in view (defaults to true) - * @return {Boolean} True if the value matched an item in the list, else false - */ + selectByValue : function(v, scrollIntoView){ if(!Ext.isEmpty(v, true)){ var r = this.findRecord(this.valueField || this.displayField, v); @@ -61142,13 +39352,7 @@ var menu = new Ext.menu.Menu({ return false; }, - /** - * Select an item in the dropdown list by its numeric index in the list. This function does NOT cause the select event to fire. - * The store must be loaded and the list expanded for this function to work, otherwise use setValue. - * @param {Number} index The zero-based index of the list item to select - * @param {Boolean} scrollIntoView False to prevent the dropdown list from autoscrolling to display the - * selected item if it is not currently in view (defaults to true) - */ + select : function(index, scrollIntoView){ this.selectedIndex = index; this.view.select(index); @@ -61161,7 +39365,7 @@ var menu = new Ext.menu.Menu({ }, - // private + selectNext : function(){ var ct = this.store.getCount(); if(ct > 0){ @@ -61173,7 +39377,7 @@ var menu = new Ext.menu.Menu({ } }, - // private + selectPrev : function(){ var ct = this.store.getCount(); if(ct > 0){ @@ -61185,7 +39389,7 @@ var menu = new Ext.menu.Menu({ } }, - // private + onKeyUp : function(e){ var k = e.getKey(); if(this.editable !== false && this.readOnly !== true && (k == e.BACKSPACE || !e.isSpecialKey())){ @@ -61196,36 +39400,29 @@ var menu = new Ext.menu.Menu({ Ext.form.ComboBox.superclass.onKeyUp.call(this, e); }, - // private + validateBlur : function(){ return !this.list || !this.list.isVisible(); }, - // private + initQuery : function(){ this.doQuery(this.getRawValue()); }, - // private + beforeBlur : function(){ this.assertValue(); }, - // private + postBlur : function(){ Ext.form.ComboBox.superclass.postBlur.call(this); this.collapse(); this.inKeyMode = false; }, - /** - * Execute a query to filter the dropdown list. Fires the {@link #beforequery} event prior to performing the - * query allowing the query action to be canceled if needed. - * @param {String} query The SQL query to execute - * @param {Boolean} forceAll true to force the query to execute even if there are currently fewer - * characters in the field than the minimum specified by the {@link #minChars} config option. It - * also clears any filter previously saved in the current store (defaults to false) - */ + doQuery : function(q, forceAll){ q = Ext.isEmpty(q) ? '' : q; var qe = { @@ -61264,10 +39461,10 @@ var menu = new Ext.menu.Menu({ } }, - // private + getParams : function(q){ var p = {}; - //p[this.queryParam] = q; + if(this.pageSize){ p.start = 0; p.limit = this.pageSize; @@ -61275,9 +39472,7 @@ var menu = new Ext.menu.Menu({ return p; }, - /** - * Hides the dropdown list if it is currently expanded. Fires the {@link #collapse} event on completion. - */ + collapse : function(){ if(!this.isExpanded()){ return; @@ -61288,16 +39483,14 @@ var menu = new Ext.menu.Menu({ this.fireEvent('collapse', this); }, - // private + collapseIf : function(e){ if(!this.isDestroyed && !e.within(this.wrap) && !e.within(this.list)){ this.collapse(); } }, - /** - * Expands the dropdown list if it is currently hidden. Fires the {@link #expand} event on completion. - */ + expand : function(){ if(this.isExpanded() || !this.hasFocus){ return; @@ -61319,7 +39512,7 @@ var menu = new Ext.menu.Menu({ } this.list.alignTo.apply(this.list, [this.el].concat(this.listAlign)); - // zindex can change, re-check it and set it if necessary + var listParent = Ext.getDom(this.getListParent() || Ext.getBody()), zindex = parseInt(Ext.fly(listParent).getStyle('z-index') ,10); if (!zindex){ @@ -61330,7 +39523,7 @@ var menu = new Ext.menu.Menu({ } this.list.show(); if(Ext.isGecko2){ - this.innerList.setOverflow('auto'); // necessary for FF 2.0/Mac + this.innerList.setOverflow('auto'); } this.mon(Ext.getDoc(), { scope: this, @@ -61340,12 +39533,9 @@ var menu = new Ext.menu.Menu({ this.fireEvent('expand', this); }, - /** - * @method onTriggerClick - * @hide - */ - // private - // Implements the default empty TriggerField.onTriggerClick function + + + onTriggerClick : function(){ if(this.readOnly || this.disabled){ return; @@ -61364,90 +39554,43 @@ var menu = new Ext.menu.Menu({ } } - /** - * @hide - * @method autoSize - */ - /** - * @cfg {Boolean} grow @hide - */ - /** - * @cfg {Number} growMin @hide - */ - /** - * @cfg {Number} growMax @hide - */ + + + + }); Ext.reg('combo', Ext.form.ComboBox); -/** - * @class Ext.form.Checkbox - * @extends Ext.form.Field - * Single checkbox field. Can be used as a direct replacement for traditional checkbox fields. - * @constructor - * Creates a new Checkbox - * @param {Object} config Configuration options - * @xtype checkbox - */ + Ext.form.Checkbox = Ext.extend(Ext.form.Field, { - /** - * @cfg {String} focusClass The CSS class to use when the checkbox receives focus (defaults to undefined) - */ + focusClass : undefined, - /** - * @cfg {String} fieldClass The default CSS class for the checkbox (defaults to 'x-form-field') - */ + fieldClass : 'x-form-field', - /** - * @cfg {Boolean} checked true if the checkbox should render initially checked (defaults to false) - */ + checked : false, - /** - * @cfg {String} boxLabel The text that appears beside the checkbox - */ + boxLabel: ' ', - /** - * @cfg {String/Object} autoCreate A DomHelper element spec, or true for a default element spec (defaults to - * {tag: 'input', type: 'checkbox', autocomplete: 'off'}) - */ + defaultAutoCreate : { tag: 'input', type: 'checkbox', autocomplete: 'off'}, - /** - * @cfg {String} boxLabel The text that appears beside the checkbox - */ - /** - * @cfg {String} inputValue The value that should go into the generated input element's value attribute - */ - /** - * @cfg {Function} handler A function called when the {@link #checked} value changes (can be used instead of - * handling the check event). The handler is passed the following parameters: - *
        - *
      • checkbox : Ext.form.Checkbox
        The Checkbox being toggled.
      • - *
      • checked : Boolean
        The new checked state of the checkbox.
      • - *
      - */ - /** - * @cfg {Object} scope An object to use as the scope ('this' reference) of the {@link #handler} function - * (defaults to this Checkbox). - */ + + + + - // private + actionMode : 'wrap', - // private + initComponent : function(){ Ext.form.Checkbox.superclass.initComponent.call(this); this.addEvents( - /** - * @event check - * Fires when the checkbox is checked or unchecked. - * @param {Ext.form.Checkbox} this This checkbox - * @param {Boolean} checked The new checked value - */ + 'check' ); }, - // private + onResize : function(){ Ext.form.Checkbox.superclass.onResize.apply(this, arguments); if(!this.boxLabel && !this.fieldLabel){ @@ -61455,7 +39598,7 @@ Ext.form.Checkbox = Ext.extend(Ext.form.Field, { } }, - // private + initEvents : function(){ Ext.form.Checkbox.superclass.initEvents.call(this); this.mon(this.el, { @@ -61465,20 +39608,12 @@ Ext.form.Checkbox = Ext.extend(Ext.form.Field, { }); }, - /** - * @hide - * Overridden and disabled. The editor element does not support standard valid/invalid marking. - * @method - */ + markInvalid : Ext.emptyFn, - /** - * @hide - * Overridden and disabled. The editor element does not support standard valid/invalid marking. - * @method - */ + clearInvalid : Ext.emptyFn, - // private + onRender : function(ct, position){ Ext.form.Checkbox.superclass.onRender.call(this, ct, position); if(this.inputValue !== undefined){ @@ -61493,28 +39628,25 @@ Ext.form.Checkbox = Ext.extend(Ext.form.Field, { }else{ this.checked = this.el.dom.checked; } - // Need to repaint for IE, otherwise positioning is broken + if(Ext.isIE){ this.wrap.repaint(); } this.resizeEl = this.positionEl = this.wrap; }, - // private + onDestroy : function(){ Ext.destroy(this.wrap); Ext.form.Checkbox.superclass.onDestroy.call(this); }, - // private + initValue : function() { this.originalValue = this.getValue(); }, - /** - * Returns the checked state of the checkbox. - * @return {Boolean} True if checked, else false - */ + getValue : function(){ if(this.rendered){ return this.el.dom.checked; @@ -61522,20 +39654,14 @@ Ext.form.Checkbox = Ext.extend(Ext.form.Field, { return this.checked; }, - // private + onClick : function(){ if(this.el.dom.checked != this.checked){ this.setValue(this.el.dom.checked); } }, - /** - * Sets the checked state of the checkbox, fires the 'check' event, and calls a - * {@link #handler} (if configured). - * @param {Boolean/String} checked The following values will check the checkbox: - * true, 'true', '1', or 'on'. Any other value will uncheck the checkbox. - * @return {Ext.form.Field} this - */ + setValue : function(v){ var checked = this.checked ; this.checked = (v === true || v === 'true' || v == '1' || String(v).toLowerCase() == 'on'); @@ -61553,90 +39679,35 @@ Ext.form.Checkbox = Ext.extend(Ext.form.Field, { } }); Ext.reg('checkbox', Ext.form.Checkbox); -/** - * @class Ext.form.CheckboxGroup - * @extends Ext.form.Field - *

      A grouping container for {@link Ext.form.Checkbox} controls.

      - *

      Sample usage:

      - *
      
      -var myCheckboxGroup = new Ext.form.CheckboxGroup({
      -    id:'myGroup',
      -    xtype: 'checkboxgroup',
      -    fieldLabel: 'Single Column',
      -    itemCls: 'x-check-group-alt',
      -    // Put all controls in a single column with width 100%
      -    columns: 1,
      -    items: [
      -        {boxLabel: 'Item 1', name: 'cb-col-1'},
      -        {boxLabel: 'Item 2', name: 'cb-col-2', checked: true},
      -        {boxLabel: 'Item 3', name: 'cb-col-3'}
      -    ]
      -});
      - * 
      - * @constructor - * Creates a new CheckboxGroup - * @param {Object} config Configuration options - * @xtype checkboxgroup - */ + Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, { - /** - * @cfg {Array} items An Array of {@link Ext.form.Checkbox Checkbox}es or Checkbox config objects - * to arrange in the group. - */ - /** - * @cfg {String/Number/Array} columns Specifies the number of columns to use when displaying grouped - * checkbox/radio controls using automatic layout. This config can take several types of values: - *
      • 'auto' :

        The controls will be rendered one per column on one row and the width - * of each column will be evenly distributed based on the width of the overall field container. This is the default.

      • - *
      • Number :

        If you specific a number (e.g., 3) that number of columns will be - * created and the contained controls will be automatically distributed based on the value of {@link #vertical}.

      • - *
      • Array : Object

        You can also specify an array of column widths, mixing integer - * (fixed width) and float (percentage width) values as needed (e.g., [100, .25, .75]). Any integer values will - * be rendered first, then any float values will be calculated as a percentage of the remaining space. Float - * values do not have to add up to 1 (100%) although if you want the controls to take up the entire field - * container you should do so.

      - */ + + columns : 'auto', - /** - * @cfg {Boolean} vertical True to distribute contained controls across columns, completely filling each column - * top to bottom before starting on the next column. The number of controls in each column will be automatically - * calculated to keep columns as even as possible. The default value is false, so that controls will be added - * to columns one at a time, completely filling each row left to right before starting on the next row. - */ + vertical : false, - /** - * @cfg {Boolean} allowBlank False to validate that at least one item in the group is checked (defaults to true). - * If no items are selected at validation time, {@link @blankText} will be used as the error text. - */ + allowBlank : true, - /** - * @cfg {String} blankText Error text to display if the {@link #allowBlank} validation fails (defaults to "You must - * select at least one item in this group") - */ + blankText : "You must select at least one item in this group", - // private + defaultType : 'checkbox', - // private + groupCls : 'x-form-check-group', - // private + initComponent: function(){ this.addEvents( - /** - * @event change - * Fires when the state of a child checkbox changes. - * @param {Ext.form.CheckboxGroup} this - * @param {Array} checked An array containing the checked boxes. - */ + 'change' ); this.on('change', this.validate, this); Ext.form.CheckboxGroup.superclass.initComponent.call(this); }, - // private + onRender : function(ct, position){ if(!this.el){ var panelCfg = { @@ -61646,7 +39717,7 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, { cls: this.groupCls, layout: 'column', renderTo: ct, - bufferResize: false // Default this to false, since it doesn't really have a proper ownerCt. + bufferResize: false }; var colCfg = { xtype: 'container', @@ -61660,7 +39731,7 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, { if(this.items[0].items){ - // The container has standard ColumnLayout configs, so pass them in directly + Ext.apply(panelCfg, { layoutConfig: {columns: this.items.length}, @@ -61673,25 +39744,25 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, { }else{ - // The container has field item configs, so we have to generate the column - // panels first then move the items into the columns as needed. + + var numCols, cols = []; - if(typeof this.columns == 'string'){ // 'auto' so create a col per item + if(typeof this.columns == 'string'){ this.columns = this.items.length; } if(!Ext.isArray(this.columns)){ var cs = []; for(var i=0; i
      of each column will be adjusted - * to fit the grid width and prevent horizontal scrolling. If columns are later resized (manually - * or programmatically), the other columns in the grid will not be resized to fit the grid width. - * See {@link #forceFit} also. - */ + autoFill : false, - /** - * @cfg {Boolean} forceFit - * Defaults to false. Specify true to have the column widths re-proportioned - * at all times. The {@link Ext.grid.Column#width initially configured width} of each - * column will be adjusted to fit the grid width and prevent horizontal scrolling. If columns are - * later resized (manually or programmatically), the other columns in the grid will be resized - * to fit the grid width. See {@link #autoFill} also. - */ + forceFit : false, - /** - * @cfg {Array} sortClasses The CSS classes applied to a header when it is sorted. (defaults to ['sort-asc', 'sort-desc']) - */ + sortClasses : ['sort-asc', 'sort-desc'], - /** - * @cfg {String} sortAscText The text displayed in the 'Sort Ascending' menu item (defaults to 'Sort Ascending') - */ + sortAscText : 'Sort Ascending', - /** - * @cfg {String} sortDescText The text displayed in the 'Sort Descending' menu item (defaults to 'Sort Descending') - */ + sortDescText : 'Sort Descending', - /** - * @cfg {String} columnsText The text displayed in the 'Columns' menu item (defaults to 'Columns') - */ + columnsText : 'Columns', - /** - * @cfg {String} selectedRowClass The CSS class applied to a selected row (defaults to 'x-grid3-row-selected'). An - * example overriding the default styling: -
      
      -    .x-grid3-row-selected {background-color: yellow;}
      -    
      - * Note that this only controls the row, and will not do anything for the text inside it. To style inner - * facets (like text) use something like: -
      
      -    .x-grid3-row-selected .x-grid3-cell-inner {
      -        color: #FFCC00;
      -    }
      -    
      - * @type String - */ + selectedRowClass : 'x-grid3-row-selected', - // private + borderWidth : 2, tdClass : 'x-grid3-cell', hdCls : 'x-grid3-hd', markDirty : true, - /** - * @cfg {Number} cellSelectorDepth The number of levels to search for cells in event delegation (defaults to 4) - */ + cellSelectorDepth : 4, - /** - * @cfg {Number} rowSelectorDepth The number of levels to search for rows in event delegation (defaults to 10) - */ + rowSelectorDepth : 10, - /** - * @cfg {Number} rowBodySelectorDepth The number of levels to search for row bodies in event delegation (defaults to 10) - */ + rowBodySelectorDepth : 10, - /** - * @cfg {String} cellSelector The selector used to find cells internally (defaults to 'td.x-grid3-cell') - */ + cellSelector : 'td.x-grid3-cell', - /** - * @cfg {String} rowSelector The selector used to find rows internally (defaults to 'div.x-grid3-row') - */ + rowSelector : 'div.x-grid3-row', - /** - * @cfg {String} rowBodySelector The selector used to find row bodies internally (defaults to 'div.x-grid3-row') - */ + rowBodySelector : 'div.x-grid3-row-body', - // private + firstRowCls: 'x-grid3-row-first', lastRowCls: 'x-grid3-row-last', rowClsRe: /(?:^|\s+)x-grid3-row-(first|last|alt)(?:\s+|$)/g, constructor : function(config){ Ext.apply(this, config); - // These events are only used internally by the grid components + this.addEvents( - /** - * @event beforerowremoved - * Internal UI Event. Fired before a row is removed. - * @param {Ext.grid.GridView} view - * @param {Number} rowIndex The index of the row to be removed. - * @param {Ext.data.Record} record The Record to be removed - */ + 'beforerowremoved', - /** - * @event beforerowsinserted - * Internal UI Event. Fired before rows are inserted. - * @param {Ext.grid.GridView} view - * @param {Number} firstRow The index of the first row to be inserted. - * @param {Number} lastRow The index of the last row to be inserted. - */ + 'beforerowsinserted', - /** - * @event beforerefresh - * Internal UI Event. Fired before the view is refreshed. - * @param {Ext.grid.GridView} view - */ + 'beforerefresh', - /** - * @event rowremoved - * Internal UI Event. Fired after a row is removed. - * @param {Ext.grid.GridView} view - * @param {Number} rowIndex The index of the row that was removed. - * @param {Ext.data.Record} record The Record that was removed - */ + 'rowremoved', - /** - * @event rowsinserted - * Internal UI Event. Fired after rows are inserted. - * @param {Ext.grid.GridView} view - * @param {Number} firstRow The index of the first inserted. - * @param {Number} lastRow The index of the last row inserted. - */ + 'rowsinserted', - /** - * @event rowupdated - * Internal UI Event. Fired after a row has been updated. - * @param {Ext.grid.GridView} view - * @param {Number} firstRow The index of the row updated. - * @param {Ext.data.record} record The Record backing the row updated. - */ + 'rowupdated', - /** - * @event refresh - * Internal UI Event. Fired after the GridView's body has been refreshed. - * @param {Ext.grid.GridView} view - */ + 'refresh' ); Ext.grid.GridView.superclass.constructor.call(this); }, - /* -------------------------------- UI Specific ----------------------------- */ + - // private + initTemplates : function(){ var ts = this.templates || {}; if(!ts.master){ @@ -68072,7 +43566,7 @@ viewConfig: { this.colRe = new RegExp('x-grid3-td-([^\\s]+)', ''); }, - // private + fly : function(el){ if(!this._flyweight){ this._flyweight = new Ext.Element.Flyweight(document.body); @@ -68081,12 +43575,12 @@ viewConfig: { return this._flyweight; }, - // private + getEditorParent : function(){ return this.scroller.dom; }, - // private + initElements : function(){ var E = Ext.Element; @@ -68107,12 +43601,7 @@ viewConfig: { if(this.forceFit){ this.scroller.setStyle('overflow-x', 'hidden'); } - /** - * Read-only. The GridView's body Element which encapsulates all rows in the Grid. - * This {@link Ext.Element Element} is only available after the GridPanel has been rendered. - * @type Ext.Element - * @property mainBody - */ + this.mainBody = new E(this.scroller.dom.firstChild); this.focusEl = new E(this.scroller.dom.childNodes[1]); @@ -68122,14 +43611,14 @@ viewConfig: { this.resizeProxy = new E(cs[2]); }, - // private + getRows : function(){ return this.hasRows() ? this.mainBody.dom.childNodes : []; }, - // finder methods, used with delegation + - // private + findCell : function(el){ if(!el){ return false; @@ -68137,12 +43626,7 @@ viewConfig: { return this.fly(el).findParent(this.cellSelector, this.cellSelectorDepth); }, - /** - *

      Return the index of the grid column which contains the passed HTMLElement.

      - * See also {@link #findRowIndex} - * @param {HTMLElement} el The target element - * @return {Number} The column index, or false if the target element is not within a row of this GridView. - */ + findCellIndex : function(el, requiredCls){ var cell = this.findCell(el); if(cell && (!requiredCls || this.fly(cell).hasClass(requiredCls))){ @@ -68151,7 +43635,7 @@ viewConfig: { return false; }, - // private + getCellIndex : function(el){ if(el){ var m = el.className.match(this.colRe); @@ -68162,22 +43646,18 @@ viewConfig: { return false; }, - // private + findHeaderCell : function(el){ var cell = this.findCell(el); return cell && this.fly(cell).hasClass(this.hdCls) ? cell : null; }, - // private + findHeaderIndex : function(el){ return this.findCellIndex(el, this.hdCls); }, - /** - * Return the HtmlElement representing the grid row which contains the passed element. - * @param {HTMLElement} el The target HTMLElement - * @return {HTMLElement} The row element, or null if the target element is not within a row of this GridView. - */ + findRow : function(el){ if(!el){ return false; @@ -68185,22 +43665,13 @@ viewConfig: { return this.fly(el).findParent(this.rowSelector, this.rowSelectorDepth); }, - /** - *

      Return the index of the grid row which contains the passed HTMLElement.

      - * See also {@link #findCellIndex} - * @param {HTMLElement} el The target HTMLElement - * @return {Number} The row index, or false if the target element is not within a row of this GridView. - */ + findRowIndex : function(el){ var r = this.findRow(el); return r ? r.rowIndex : false; }, - /** - * Return the HtmlElement representing the grid row body which contains the passed element. - * @param {HTMLElement} el The target HTMLElement - * @return {HTMLElement} The row body element, or null if the target element is not within a row body of this GridView. - */ + findRowBody : function(el){ if(!el){ return false; @@ -68208,39 +43679,26 @@ viewConfig: { return this.fly(el).findParent(this.rowBodySelector, this.rowBodySelectorDepth); }, - // getter methods for fetching elements dynamically in the grid + - /** - * Return the <div> HtmlElement which represents a Grid row for the specified index. - * @param {Number} index The row index - * @return {HtmlElement} The div element. - */ + getRow : function(row){ return this.getRows()[row]; }, - /** - * Returns the grid's <td> HtmlElement at the specified coordinates. - * @param {Number} row The row index in which to find the cell. - * @param {Number} col The column index of the cell. - * @return {HtmlElement} The td at the specified coordinates. - */ + getCell : function(row, col){ return this.getRow(row).getElementsByTagName('td')[col]; }, - /** - * Return the <td> HtmlElement which represents the Grid's header cell for the specified column index. - * @param {Number} index The column index - * @return {HtmlElement} The td element. - */ + getHeaderCell : function(index){ return this.mainHd.dom.getElementsByTagName('td')[index]; }, - // manipulating elements + - // private - use getRowClass to apply custom row classes + addRowClass : function(row, cls){ var r = this.getRow(row); if(r){ @@ -68248,7 +43706,7 @@ viewConfig: { } }, - // private + removeRowClass : function(row, cls){ var r = this.getRow(row); if(r){ @@ -68256,13 +43714,13 @@ viewConfig: { } }, - // private + removeRow : function(row){ Ext.removeNode(this.getRow(row)); this.syncFocusEl(row); }, - // private + removeRows : function(firstRow, lastRow){ var bd = this.mainBody.dom; for(var rowIndex = firstRow; rowIndex <= lastRow; rowIndex++){ @@ -68271,51 +43729,49 @@ viewConfig: { this.syncFocusEl(firstRow); }, - // scrolling stuff + - // private + getScrollState : function(){ var sb = this.scroller.dom; return {left: sb.scrollLeft, top: sb.scrollTop}; }, - // private + restoreScroll : function(state){ var sb = this.scroller.dom; sb.scrollLeft = state.left; sb.scrollTop = state.top; }, - /** - * Scrolls the grid to the top - */ + scrollToTop : function(){ this.scroller.dom.scrollTop = 0; this.scroller.dom.scrollLeft = 0; }, - // private + syncScroll : function(){ this.syncHeaderScroll(); var mb = this.scroller.dom; this.grid.fireEvent('bodyscroll', mb.scrollLeft, mb.scrollTop); }, - // private + syncHeaderScroll : function(){ var mb = this.scroller.dom; this.innerHd.scrollLeft = mb.scrollLeft; - this.innerHd.scrollLeft = mb.scrollLeft; // second time for IE (1/2 time first fails, other browsers ignore) + this.innerHd.scrollLeft = mb.scrollLeft; }, - // private + updateSortIcon : function(col, dir){ var sc = this.sortClasses; var hds = this.mainHd.select('td').removeClass(sc); hds.item(col).addClass(sc[dir == 'DESC' ? 1 : 0]); }, - // private + updateAllColumnWidths : function(){ var tw = this.getTotalWidth(), clen = this.cm.getColumnCount(), @@ -68352,7 +43808,7 @@ viewConfig: { this.onAllColumnWidthsUpdated(ws, tw); }, - // private + updateColumnWidth : function(col, width){ var w = this.getColumnWidth(col); var tw = this.getTotalWidth(); @@ -68375,7 +43831,7 @@ viewConfig: { this.onColumnWidthUpdated(col, w, tw); }, - // private + updateColumnHidden : function(col, hidden){ var tw = this.getTotalWidth(); this.innerHd.firstChild.style.width = this.getOffsetWidth(); @@ -68397,23 +43853,11 @@ viewConfig: { } this.onColumnHiddenUpdated(col, hidden, tw); - delete this.lastViewWidth; // force recalc + delete this.lastViewWidth; this.layout(); }, - /** - * @private - * Renders all of the rows to a string buffer and returns the string. This is called internally - * by renderRows and performs the actual string building for the rows - it does not inject HTML into the DOM. - * @param {Array} columns The column data acquired from getColumnData. - * @param {Array} records The array of records to render - * @param {Ext.data.Store} store The store to render the rows from - * @param {Number} startRow The index of the first row being rendered. Sometimes we only render a subset of - * the rows so this is used to maintain logic for striping etc - * @param {Number} colCount The total number of columns in the column model - * @param {Boolean} stripe True to stripe the rows - * @return {String} A string containing the HTML for the rendered rows - */ + doRender : function(columns, records, store, startRow, colCount, stripe) { var templates = this.templates, cellTemplate = templates.cell, @@ -68422,7 +43866,7 @@ viewConfig: { var tstyle = 'width:' + this.getTotalWidth() + ';'; - // buffers + var rowBuffer = [], colBuffer = [], rowParams = {tstyle: tstyle}, @@ -68430,14 +43874,14 @@ viewConfig: { column, record; - //build up each row's HTML + for (var j = 0, len = records.length; j < len; j++) { record = records[j]; colBuffer = []; var rowIndex = j + startRow; - //build up each column's HTML + for (var i = 0; i < colCount; i++) { column = columns[i]; @@ -68458,7 +43902,7 @@ viewConfig: { colBuffer[colBuffer.length] = cellTemplate.apply(meta); } - //set up row striping and row dirtiness CSS classes + var alt = []; if (stripe && ((rowIndex + 1) % 2 === 0)) { @@ -68484,7 +43928,7 @@ viewConfig: { return rowBuffer.join(''); }, - // private + processRows : function(startRow, skipStripe) { if (!this.ds || this.ds.getCount() < 1) { return; @@ -68510,7 +43954,7 @@ viewConfig: { } } - // add first/last-row classes + if (startRow === 0) { Ext.fly(rows[0]).addClass(this.firstRowCls); } @@ -68531,12 +43975,7 @@ viewConfig: { this.grid.fireEvent('viewready', this.grid); }, - /** - * @private - * Renders each of the UI elements in turn. This is called internally, once, by this.render. It does not - * render rows from the store, just the surrounding UI elements. It also sets up listeners on the UI elements - * and sets up options like column menus, moving and resizing. - */ + renderUI : function() { var templates = this.templates, header = this.renderHeaders(), @@ -68555,7 +43994,7 @@ viewConfig: { this.initElements(); - // get mousedowns early + Ext.fly(this.innerHd).on('click', this.handleHdDown, this); this.mainHd.on({ @@ -68618,7 +44057,7 @@ viewConfig: { this.updateHeaderSortState(); }, - // private + processEvent : function(name, e) { var t = e.getTarget(), g = this.grid, @@ -68647,17 +44086,17 @@ viewConfig: { } }, - // private + layout : function() { if(!this.mainBody){ - return; // not rendered + return; } var g = this.grid; var c = g.getGridEl(); var csize = c.getSize(true); var vw = csize.width; - if(!g.hideHeaders && (vw < 20 || csize.height < 20)){ // display: none? + if(!g.hideHeaders && (vw < 20 || csize.height < 20)){ return; } @@ -68689,34 +44128,34 @@ viewConfig: { this.onLayout(vw, vh); }, - // template functions for subclasses and plugins - // these functions include precalculated values + + onLayout : function(vw, vh){ - // do nothing + }, onColumnWidthUpdated : function(col, w, tw){ - //template method + }, onAllColumnWidthsUpdated : function(ws, tw){ - //template method + }, onColumnHiddenUpdated : function(col, hidden, tw){ - // template method + }, updateColumnText : function(col, text){ - // template method + }, afterMove : function(colIndex){ - // template method + }, - /* ----------------------------------- Core Specific -------------------------------------------*/ - // private + + init : function(grid){ this.grid = grid; @@ -68725,12 +44164,12 @@ viewConfig: { this.initUI(grid); }, - // private + getColumnId : function(index){ return this.cm.getColumnId(index); }, - // private + getOffsetWidth : function() { return (this.cm.getTotalWidth() + this.getScrollOffset()) + 'px'; }, @@ -68739,12 +44178,7 @@ viewConfig: { return Ext.num(this.scrollOffset, Ext.getScrollBarWidth()); }, - /** - * @private - * Renders the header row using the 'header' template. Does not inject the HTML into the DOM, just - * returns a string. - * @return {String} Rendered header row - */ + renderHeaders : function() { var cm = this.cm, ts = this.templates, @@ -68771,7 +44205,7 @@ viewConfig: { return ts.header.apply({cells: cb.join(''), tstyle:'width:'+this.getTotalWidth()+';'}); }, - // private + getColumnTooltip : function(i){ var tt = this.cm.getColumnTooltip(i); if(tt){ @@ -68784,31 +44218,24 @@ viewConfig: { return ''; }, - // private + beforeUpdate : function(){ this.grid.stopEditing(true); }, - // private + updateHeaders : function(){ this.innerHd.firstChild.innerHTML = this.renderHeaders(); this.innerHd.firstChild.style.width = this.getOffsetWidth(); this.innerHd.firstChild.firstChild.style.width = this.getTotalWidth(); }, - /** - * Focuses the specified row. - * @param {Number} row The row index - */ + focusRow : function(row){ this.focusCell(row, 0, false); }, - /** - * Focuses the specified cell. - * @param {Number} row The row index - * @param {Number} col The column index - */ + focusCell : function(row, col, hscroll){ this.syncFocusEl(this.ensureVisible(row, col, hscroll)); if(Ext.isGecko){ @@ -68911,7 +44338,7 @@ viewConfig: { return this.getResolvedXY(resolved); }, - // private + insertRows : function(dm, firstRow, lastRow, isUpdate) { var last = dm.getCount() - 1; if( !isUpdate && firstRow === 0 && lastRow >= last) { @@ -68940,14 +44367,14 @@ viewConfig: { this.fireEvent('rowsinserted', this, firstRow, lastRow); this.processRows(firstRow); } else if (firstRow === 0 || firstRow >= last) { - //ensure first/last row is kept after an update. + Ext.fly(this.getRow(firstRow)).addClass(firstRow === 0 ? this.firstRowCls : this.lastRowCls); } } this.syncFocusEl(firstRow); }, - // private + deleteRows : function(dm, firstRow, lastRow){ if(dm.getRowCount()<1){ this.refresh(); @@ -68961,7 +44388,7 @@ viewConfig: { } }, - // private + getColumnStyle : function(col, isHeader){ var style = !isHeader ? (this.cm.config[col].css || '') : ''; style += 'width:'+this.getColumnWidth(col)+';'; @@ -68975,7 +44402,7 @@ viewConfig: { return style; }, - // private + getColumnWidth : function(col){ var w = this.cm.getColumnWidth(col); if(Ext.isNumber(w)){ @@ -68984,18 +44411,18 @@ viewConfig: { return w; }, - // private + getTotalWidth : function(){ return this.cm.getTotalWidth()+'px'; }, - // private + fitColumns : function(preventRefresh, onlyExpand, omitColumn){ var cm = this.cm, i; var tw = cm.getTotalWidth(false); var aw = this.grid.getGridEl().getWidth(true)-this.getScrollOffset(); - if(aw < 20){ // not initialized, so don't screw up the default widths + if(aw < 20){ return; } var extra = aw - tw; @@ -69045,7 +44472,7 @@ viewConfig: { return true; }, - // private + autoExpand : function(preventUpdate){ var g = this.grid, cm = this.cm; if(!this.userResized && g.autoExpandColumn){ @@ -69065,13 +44492,9 @@ viewConfig: { } }, - /** - * @private - * Returns an array of column configurations - one for each column - * @return {Array} Array of column config objects. This includes the column name, renderer, id style and renderer - */ + getColumnData : function(){ - // build a map for all the columns + var cs = [], cm = this.cm, colCount = cm.getColumnCount(); @@ -69091,9 +44514,9 @@ viewConfig: { return cs; }, - // private + renderRows : function(startRow, endRow){ - // pull in all the crap needed to render rows + var g = this.grid, cm = g.colModel, ds = g.store, stripe = g.stripeRows; var colCount = cm.getColumnCount(); @@ -69106,19 +44529,19 @@ viewConfig: { startRow = startRow || 0; endRow = !Ext.isDefined(endRow) ? ds.getCount()-1 : endRow; - // records to render + var rs = ds.getRange(startRow, endRow); return this.doRender(cs, rs, ds, startRow, colCount, stripe); }, - // private + renderBody : function(){ var markup = this.renderRows() || ' '; return this.templates.body.apply({rows: markup}); }, - // private + refreshRow : function(record){ var ds = this.ds, index; if(Ext.isNumber(record)){ @@ -69139,10 +44562,7 @@ viewConfig: { this.fireEvent('rowupdated', this, index, record); }, - /** - * Refreshs the grid UI - * @param {Boolean} headersToo (optional) True to also refresh the headers - */ + refresh : function(headersToo){ this.fireEvent('beforerefresh', this); this.grid.stopEditing(true); @@ -69159,21 +44579,14 @@ viewConfig: { this.fireEvent('refresh', this); }, - /** - * @private - * Displays the configured emptyText if there are currently no rows to display - */ + applyEmptyText : function(){ if(this.emptyText && !this.hasRows()){ this.mainBody.update('
      ' + this.emptyText + '
      '); } }, - /** - * @private - * Adds sorting classes to the column headers based on the bound store's sortInfo. Fires the 'sortchange' event - * if the sorting has changed since this function was last run. - */ + updateHeaderSortState : function(){ var state = this.ds.getSortState(); if (!state) { @@ -69193,10 +44606,7 @@ viewConfig: { } }, - /** - * @private - * Removes any sorting indicator classes from the column headers - */ + clearHeaderSortState : function(){ if (!this.sortState) { return; @@ -69206,7 +44616,7 @@ viewConfig: { delete this.sortState; }, - // private + destroy : function(){ if (this.scrollToTopTask && this.scrollToTopTask.cancel){ this.scrollToTopTask.cancel(); @@ -69255,7 +44665,7 @@ viewConfig: { delete Ext.dd.DDM.ids[this.columnDrop.ddGroup]; } - if (this.splitZone){ // enableColumnResize + if (this.splitZone){ this.splitZone.destroy(); delete this.splitZone._domRef; delete Ext.dd.DDM.ids["gridSplitters" + this.grid.getGridEl().id]; @@ -69292,12 +44702,12 @@ viewConfig: { Ext.EventManager.removeResizeListener(this.onWindowResize, this); }, - // private + onDenyColumnHide : function(){ }, - // private + render : function(){ if(this.autoFill){ var ct = this.grid.ownerCt; @@ -69318,8 +44728,8 @@ viewConfig: { this.renderUI(); }, - /* --------------------------------- Model Events and Handlers --------------------------------*/ - // private + + initData : function(ds, cm){ if(this.ds){ this.ds.un('load', this.onLoad, this); @@ -69366,30 +44776,30 @@ viewConfig: { this.cm = cm; }, - // private + onDataChange : function(){ this.refresh(); this.updateHeaderSortState(); this.syncFocusEl(0); }, - // private + onClear : function(){ this.refresh(); this.syncFocusEl(0); }, - // private + onUpdate : function(ds, record){ this.refreshRow(record); }, - // private + onAdd : function(ds, records, index){ this.insertRows(ds, index, index + (records.length-1)); }, - // private + onRemove : function(ds, record, index, isUpdate){ if(isUpdate !== true){ this.fireEvent('beforerowremoved', this, index, record); @@ -69402,7 +44812,7 @@ viewConfig: { } }, - // private + onLoad : function(){ if (Ext.isGecko){ if (!this.scrollToTopTask) { @@ -69414,22 +44824,22 @@ viewConfig: { } }, - // private + onColWidthChange : function(cm, col, width){ this.updateColumnWidth(col, width); }, - // private + onHeaderChange : function(cm, col, text){ this.updateHeaders(); }, - // private + onHiddenChange : function(cm, col, hidden){ this.updateColumnHidden(col, hidden); }, - // private + onColumnMove : function(cm, oldIndex, newIndex){ this.indexMap = null; var s = this.getScrollState(); @@ -69439,24 +44849,24 @@ viewConfig: { this.grid.fireEvent('columnmove', oldIndex, newIndex); }, - // private + onColConfigChange : function(){ delete this.lastViewWidth; this.indexMap = null; this.refresh(true); }, - /* -------------------- UI Events and Handlers ------------------------------ */ - // private + + initUI : function(grid){ grid.on('headerclick', this.onHeaderClick, this); }, - // private + initEvents : function(){ }, - // private + onHeaderClick : function(g, index){ if(this.headersDisabled || !this.cm.isSortable(index)){ return; @@ -69465,7 +44875,7 @@ viewConfig: { g.store.sort(this.cm.getDataIndex(index)); }, - // private + onRowOver : function(e, t){ var row; if((row = this.findRowIndex(t)) !== false){ @@ -69473,7 +44883,7 @@ viewConfig: { } }, - // private + onRowOut : function(e, t){ var row; if((row = this.findRowIndex(t)) !== false && !e.within(this.getRow(row), true)){ @@ -69481,22 +44891,22 @@ viewConfig: { } }, - // private + handleWheel : function(e){ e.stopPropagation(); }, - // private + onRowSelect : function(row){ this.addRowClass(row, this.selectedRowClass); }, - // private + onRowDeselect : function(row){ this.removeRowClass(row, this.selectedRowClass); }, - // private + onCellSelect : function(row, col){ var cell = this.getCell(row, col); if(cell){ @@ -69504,7 +44914,7 @@ viewConfig: { } }, - // private + onCellDeselect : function(row, col){ var cell = this.getCell(row, col); if(cell){ @@ -69512,7 +44922,7 @@ viewConfig: { } }, - // private + onColumnSplitterMoved : function(i, w){ this.userResized = true; var cm = this.grid.colModel; @@ -69529,7 +44939,7 @@ viewConfig: { this.grid.fireEvent('columnresize', i, w); }, - // private + handleHdMenuClick : function(item){ var index = this.hdCtxIndex, cm = this.cm, @@ -69555,12 +44965,12 @@ viewConfig: { return true; }, - // private + isHideableColumn : function(c){ return !c.hidden; }, - // private + beforeColMenuShow : function(){ var cm = this.cm, colCount = cm.getColumnCount(); this.colMenu.removeAll(); @@ -69577,7 +44987,7 @@ viewConfig: { } }, - // private + handleHdDown : function(e, t){ if(Ext.fly(t).hasClass('x-grid3-hd-btn')){ e.stopEvent(); @@ -69595,7 +45005,7 @@ viewConfig: { } }, - // private + handleHdOver : function(e, t){ var hd = this.findHeaderCell(t); if(hd && !this.headersDisabled){ @@ -69613,7 +45023,7 @@ viewConfig: { } }, - // private + handleHdMove : function(e, t){ var hd = this.findHeaderCell(this.activeHdRef); if(hd && !this.headersDisabled){ @@ -69624,7 +45034,7 @@ viewConfig: { cur = ''; if(this.grid.enableColumnResize !== false){ if(x - r.left <= hw && this.cm.isResizable(this.activeHdIndex-1)){ - cur = Ext.isAir ? 'move' : Ext.isWebKit ? 'e-resize' : 'col-resize'; // col-resize not always supported + cur = Ext.isAir ? 'move' : Ext.isWebKit ? 'e-resize' : 'col-resize'; }else if(r.right - x <= (!this.activeHdBtn ? hw : 2) && this.cm.isResizable(this.activeHdIndex)){ cur = Ext.isAir ? 'move' : Ext.isWebKit ? 'w-resize' : 'col-resize'; } @@ -69633,7 +45043,7 @@ viewConfig: { } }, - // private + handleHdOut : function(e, t){ var hd = this.findHeaderCell(t); if(hd && (!Ext.isIE || !e.within(hd, true))){ @@ -69643,21 +45053,21 @@ viewConfig: { } }, - // private + hasRows : function(){ var fc = this.mainBody.dom.firstChild; return fc && fc.nodeType == 1 && fc.className != 'x-grid-empty'; }, - // back compat + bind : function(d, c){ this.initData(d, c); } }); -// private -// This is a support class used internally by the Grid components + + Ext.grid.GridView.SplitDragZone = Ext.extend(Ext.dd.DDProxy, { constructor: function(grid, hd){ @@ -69701,7 +45111,7 @@ Ext.grid.GridView.SplitDragZone = Ext.extend(Ext.dd.DDProxy, { if(t && this.allowHeaderDrag(e)){ var xy = this.view.fly(t).getXY(), x = xy[0], - y = xy[1]; + y = xy[1], exy = e.getXY(), ex = exy[0], w = t.offsetWidth, adjust = false; @@ -69752,8 +45162,8 @@ Ext.grid.GridView.SplitDragZone = Ext.extend(Ext.dd.DDProxy, { this.setDelta(0,0); } }); -// private -// This is a support class used internally by the Grid components + + Ext.grid.HeaderDragZone = Ext.extend(Ext.dd.DragZone, { maxDragWidth: 120, @@ -69779,7 +45189,7 @@ Ext.grid.HeaderDragZone = Ext.extend(Ext.dd.DragZone, { }, onInitDrag : function(e){ - // keep the value here so we can restore it; + this.dragHeadersDisabled = this.view.headersDisabled; this.view.headersDisabled = true; var clone = this.dragData.ddel.cloneNode(true); @@ -69806,8 +45216,8 @@ Ext.grid.HeaderDragZone = Ext.extend(Ext.dd.DragZone, { } }); -// private -// This is a support class used internally by the Grid components + + Ext.grid.HeaderDropZone = Ext.extend(Ext.dd.DropZone, { proxyOffsets : [-4, -9], fly: Ext.Element.fly, @@ -69815,7 +45225,7 @@ Ext.grid.HeaderDropZone = Ext.extend(Ext.dd.DropZone, { constructor : function(grid, hd, hd2){ this.grid = grid; this.view = grid.getView(); - // split the proxies so they don't interfere with mouse events + this.proxyTop = Ext.DomHelper.append(document.body, { cls:"col-move-top", html:" " }, true); @@ -69827,8 +45237,8 @@ Ext.grid.HeaderDropZone = Ext.extend(Ext.dd.DropZone, { this.setStyle("visibility", "hidden"); }; this.ddGroup = "gridHeader" + this.grid.getGridEl().id; - // temporarily disabled - //Ext.dd.ScrollManager.register(this.view.scroller.dom); + + Ext.grid.HeaderDropZone.superclass.constructor.call(this, grid.getGridEl().dom); }, @@ -69951,8 +45361,8 @@ Ext.grid.GridView.ColumnDragZone = Ext.extend(Ext.grid.HeaderDragZone, { callHandleMouseDown : function(e){ Ext.grid.GridView.ColumnDragZone.superclass.handleMouseDown.call(this, e); } -});// private -// This is a support class used internally by the Grid components +}); + Ext.grid.SplitDragZone = Ext.extend(Ext.dd.DDProxy, { fly: Ext.Element.fly, @@ -70007,16 +45417,7 @@ Ext.grid.SplitDragZone = Ext.extend(Ext.dd.DDProxy, { autoOffset : function(){ this.setDelta(0,0); } -});/** - * @class Ext.grid.GridDragZone - * @extends Ext.dd.DragZone - *

      A customized implementation of a {@link Ext.dd.DragZone DragZone} which provides default implementations of two of the - * template methods of DragZone to enable dragging of the selected rows of a GridPanel.

      - *

      A cooperating {@link Ext.dd.DropZone DropZone} must be created who's template method implementations of - * {@link Ext.dd.DropZone#onNodeEnter onNodeEnter}, {@link Ext.dd.DropZone#onNodeOver onNodeOver}, - * {@link Ext.dd.DropZone#onNodeOut onNodeOut} and {@link Ext.dd.DropZone#onNodeDrop onNodeDrop}

      are able - * to process the {@link #getDragData data} which is provided. - */ +}); Ext.grid.GridDragZone = function(grid, config){ this.view = grid.getView(); Ext.grid.GridDragZone.superclass.constructor.call(this, this.view.mainBody.dom, config); @@ -70029,17 +45430,7 @@ Ext.grid.GridDragZone = function(grid, config){ Ext.extend(Ext.grid.GridDragZone, Ext.dd.DragZone, { ddGroup : "GridDD", - /** - *

      The provided implementation of the getDragData method which collects the data to be dragged from the GridPanel on mousedown.

      - *

      This data is available for processing in the {@link Ext.dd.DropZone#onNodeEnter onNodeEnter}, {@link Ext.dd.DropZone#onNodeOver onNodeOver}, - * {@link Ext.dd.DropZone#onNodeOut onNodeOut} and {@link Ext.dd.DropZone#onNodeDrop onNodeDrop} methods of a cooperating {@link Ext.dd.DropZone DropZone}.

      - *

      The data object contains the following properties:

        - *
      • grid : Ext.Grid.GridPanel
        The GridPanel from which the data is being dragged.
      • - *
      • ddel : htmlElement
        An htmlElement which provides the "picture" of the data being dragged.
      • - *
      • rowIndex : Number
        The index of the row which receieved the mousedown gesture which triggered the drag.
      • - *
      • selections : Array
        An Array of the selected Records which are being dragged from the GridPanel.
      • - *

      - */ + getDragData : function(e){ var t = Ext.lib.Event.getTarget(e); var rowIndex = this.view.findRowIndex(t); @@ -70053,42 +45444,30 @@ Ext.extend(Ext.grid.GridDragZone, Ext.dd.DragZone, { return false; }, - /** - *

      The provided implementation of the onInitDrag method. Sets the innerHTML of the drag proxy which provides the "picture" - * of the data being dragged.

      - *

      The innerHTML data is found by calling the owning GridPanel's {@link Ext.grid.GridPanel#getDragDropText getDragDropText}.

      - */ + onInitDrag : function(e){ var data = this.dragData; this.ddel.innerHTML = this.grid.getDragDropText(); this.proxy.update(this.ddel); - // fire start drag? + }, - /** - * An empty immplementation. Implement this to provide behaviour after a repair of an invalid drop. An implementation might highlight - * the selected rows to show that they have not been dragged. - */ + afterRepair : function(){ this.dragging = false; }, - /** - *

      An empty implementation. Implement this to provide coordinates for the drag proxy to slide back to after an invalid drop.

      - *

      Called before a repair of an invalid drop to get the XY to animate to.

      - * @param {EventObject} e The mouse up event - * @return {Array} The xy location (e.g. [100, 200]) - */ + getRepairXY : function(e, data){ return false; }, onEndDrag : function(data, e){ - // fire end drag? + }, onValidDrop : function(dd, e, id){ - // fire drag drop? + this.hideProxy(); }, @@ -70096,122 +45475,17 @@ Ext.extend(Ext.grid.GridDragZone, Ext.dd.DragZone, { } }); -/** - * @class Ext.grid.ColumnModel - * @extends Ext.util.Observable - *

      After the data has been read into the client side cache ({@link Ext.data.Store Store}), - * the ColumnModel is used to configure how and what parts of that data will be displayed in the - * vertical slices (columns) of the grid. The Ext.grid.ColumnModel Class is the default implementation - * of a ColumnModel used by implentations of {@link Ext.grid.GridPanel GridPanel}.

      - *

      Data is mapped into the store's records and then indexed into the ColumnModel using the - * {@link Ext.grid.Column#dataIndex dataIndex}:

      - *
      
      -{data source} == mapping ==> {data store} == {@link Ext.grid.Column#dataIndex dataIndex} ==> {ColumnModel}
      - * 
      - *

      Each {@link Ext.grid.Column Column} in the grid's ColumnModel is configured with a - * {@link Ext.grid.Column#dataIndex dataIndex} to specify how the data within - * each record in the store is indexed into the ColumnModel.

      - *

      There are two ways to initialize the ColumnModel class:

      - *

      Initialization Method 1: an Array

      -
      
      - var colModel = new Ext.grid.ColumnModel([
      -    { header: "Ticker", width: 60, sortable: true},
      -    { header: "Company Name", width: 150, sortable: true, id: 'company'},
      -    { header: "Market Cap.", width: 100, sortable: true},
      -    { header: "$ Sales", width: 100, sortable: true, renderer: money},
      -    { header: "Employees", width: 100, sortable: true, resizable: false}
      - ]);
      - 
      - *

      The ColumnModel may be initialized with an Array of {@link Ext.grid.Column} column configuration - * objects to define the initial layout / display of the columns in the Grid. The order of each - * {@link Ext.grid.Column} column configuration object within the specified Array defines the initial - * order of the column display. A Column's display may be initially hidden using the - * {@link Ext.grid.Column#hidden hidden} config property (and then shown using the column - * header menu). Fields that are not included in the ColumnModel will not be displayable at all.

      - *

      How each column in the grid correlates (maps) to the {@link Ext.data.Record} field in the - * {@link Ext.data.Store Store} the column draws its data from is configured through the - * {@link Ext.grid.Column#dataIndex dataIndex}. If the - * {@link Ext.grid.Column#dataIndex dataIndex} is not explicitly defined (as shown in the - * example above) it will use the column configuration's index in the Array as the index.

      - *

      See {@link Ext.grid.Column} for additional configuration options for each column.

      - *

      Initialization Method 2: an Object

      - *

      In order to use configuration options from Ext.grid.ColumnModel, an Object may be used to - * initialize the ColumnModel. The column configuration Array will be specified in the {@link #columns} - * config property. The {@link #defaults} config property can be used to apply defaults - * for all columns, e.g.:

      
      - var colModel = new Ext.grid.ColumnModel({
      -    columns: [
      -        { header: "Ticker", width: 60, menuDisabled: false},
      -        { header: "Company Name", width: 150, id: 'company'},
      -        { header: "Market Cap."},
      -        { header: "$ Sales", renderer: money},
      -        { header: "Employees", resizable: false}
      -    ],
      -    defaults: {
      -        sortable: true,
      -        menuDisabled: true,
      -        width: 100
      -    },
      -    listeners: {
      -        {@link #hiddenchange}: function(cm, colIndex, hidden) {
      -            saveConfig(colIndex, hidden);
      -        }
      -    }
      -});
      - 
      - *

      In both examples above, the ability to apply a CSS class to all cells in a column (including the - * header) is demonstrated through the use of the {@link Ext.grid.Column#id id} config - * option. This column could be styled by including the following css:

      
      - //add this css *after* the core css is loaded
      -.x-grid3-td-company {
      -    color: red; // entire column will have red font
      -}
      -// modify the header row only, adding an icon to the column header
      -.x-grid3-hd-company {
      -    background: transparent
      -        url(../../resources/images/icons/silk/building.png)
      -        no-repeat 3px 3px ! important;
      -        padding-left:20px;
      -}
      - 
      - * Note that the "Company Name" column could be specified as the - * {@link Ext.grid.GridPanel}.{@link Ext.grid.GridPanel#autoExpandColumn autoExpandColumn}. - * @constructor - * @param {Mixed} config Specify either an Array of {@link Ext.grid.Column} configuration objects or specify - * a configuration Object (see introductory section discussion utilizing Initialization Method 2 above). - */ + Ext.grid.ColumnModel = Ext.extend(Ext.util.Observable, { - /** - * @cfg {Number} defaultWidth (optional) The width of columns which have no {@link #width} - * specified (defaults to 100). This property shall preferably be configured through the - * {@link #defaults} config property. - */ + defaultWidth: 100, - /** - * @cfg {Boolean} defaultSortable (optional) Default sortable of columns which have no - * sortable specified (defaults to false). This property shall preferably be configured - * through the {@link #defaults} config property. - */ + defaultSortable: false, - /** - * @cfg {Array} columns An Array of object literals. The config options defined by - * {@link Ext.grid.Column} are the options which may appear in the object literal for each - * individual column definition. - */ - /** - * @cfg {Object} defaults Object literal which will be used to apply {@link Ext.grid.Column} - * configuration options to all {@link #columns}. Configuration options specified with - * individual {@link Ext.grid.Column column} configs will supersede these {@link #defaults}. - */ + + constructor : function(config){ - /** - * An Array of {@link Ext.grid.Column Column definition} objects representing the configuration - * of this ColumnModel. See {@link Ext.grid.Column} for the configuration properties that may - * be specified. - * @property config - * @type Array - */ + if(config.columns){ Ext.apply(this, config); this.setConfig(config.columns, true); @@ -70219,56 +45493,21 @@ Ext.grid.ColumnModel = Ext.extend(Ext.util.Observable, { this.setConfig(config, true); } this.addEvents( - /** - * @event widthchange - * Fires when the width of a column is programmaticially changed using - * {@link #setColumnWidth}. - * Note internal resizing suppresses the event from firing. See also - * {@link Ext.grid.GridPanel}.{@link #columnresize}. - * @param {ColumnModel} this - * @param {Number} columnIndex The column index - * @param {Number} newWidth The new width - */ + "widthchange", - /** - * @event headerchange - * Fires when the text of a header changes. - * @param {ColumnModel} this - * @param {Number} columnIndex The column index - * @param {String} newText The new header text - */ + "headerchange", - /** - * @event hiddenchange - * Fires when a column is hidden or "unhidden". - * @param {ColumnModel} this - * @param {Number} columnIndex The column index - * @param {Boolean} hidden true if hidden, false otherwise - */ + "hiddenchange", - /** - * @event columnmoved - * Fires when a column is moved. - * @param {ColumnModel} this - * @param {Number} oldIndex - * @param {Number} newIndex - */ + "columnmoved", - /** - * @event configchange - * Fires when the configuration is changed - * @param {ColumnModel} this - */ + "configchange" ); Ext.grid.ColumnModel.superclass.constructor.call(this); }, - /** - * Returns the id of the column at the specified index. - * @param {Number} index The column index - * @return {String} the id - */ + getColumnId : function(index){ return this.config[index].id; }, @@ -70277,30 +45516,21 @@ Ext.grid.ColumnModel = Ext.extend(Ext.util.Observable, { return this.config[index]; }, - /** - *

      Reconfigures this column model according to the passed Array of column definition objects. - * For a description of the individual properties of a column definition object, see the - * Config Options.

      - *

      Causes the {@link #configchange} event to be fired. A {@link Ext.grid.GridPanel GridPanel} - * using this ColumnModel will listen for this event and refresh its UI automatically.

      - * @param {Array} config Array of Column definition objects. - * @param {Boolean} initial Specify true to bypass cleanup which deletes the totalWidth - * and destroys existing editors. - */ + setConfig : function(config, initial){ var i, c, len; - if(!initial){ // cleanup + if(!initial){ delete this.totalWidth; for(i = 0, len = this.config.length; i < len; i++){ c = this.config[i]; if(c.setEditor){ - //check here, in case we have a special column like a CheckboxSelectionModel + c.setEditor(null); } } } - // backward compatibility + this.defaults = Ext.apply({ width: this.defaultWidth, sortable: this.defaultSortable @@ -70311,7 +45541,7 @@ Ext.grid.ColumnModel = Ext.extend(Ext.util.Observable, { for(i = 0, len = config.length; i < len; i++){ c = Ext.applyIf(config[i], this.defaults); - // if no id, create one using column's ordinal position + if(Ext.isEmpty(c.id)){ c.id = i; } @@ -70327,20 +45557,12 @@ Ext.grid.ColumnModel = Ext.extend(Ext.util.Observable, { } }, - /** - * Returns the column for a specified id. - * @param {String} id The column id - * @return {Object} the column - */ + getColumnById : function(id){ return this.lookup[id]; }, - /** - * Returns the index for a specified column id. - * @param {String} id The column id - * @return {Number} the index, or -1 if not found - */ + getIndexById : function(id){ for(var i = 0, len = this.config.length; i < len; i++){ if(this.config[i].id == id){ @@ -70350,11 +45572,7 @@ Ext.grid.ColumnModel = Ext.extend(Ext.util.Observable, { return -1; }, - /** - * Moves a column from one position to another. - * @param {Number} oldIndex The index of the column to move. - * @param {Number} newIndex The position at which to reinsert the coolumn. - */ + moveColumn : function(oldIndex, newIndex){ var c = this.config[oldIndex]; this.config.splice(oldIndex, 1); @@ -70363,11 +45581,7 @@ Ext.grid.ColumnModel = Ext.extend(Ext.util.Observable, { this.fireEvent("columnmoved", this, oldIndex, newIndex); }, - /** - * Returns the number of columns. - * @param {Boolean} visibleOnly Optional. Pass as true to only include visible columns. - * @return {Number} - */ + getColumnCount : function(visibleOnly){ if(visibleOnly === true){ var c = 0; @@ -70381,21 +45595,7 @@ Ext.grid.ColumnModel = Ext.extend(Ext.util.Observable, { return this.config.length; }, - /** - * Returns the column configs that return true by the passed function that is called - * with (columnConfig, index) -
      
      -// returns an array of column config objects for all hidden columns
      -var columns = grid.getColumnModel().getColumnsBy(function(c){
      -  return c.hidden;
      -});
      -
      - * @param {Function} fn A function which, when passed a {@link Ext.grid.Column Column} object, must - * return true if the column is to be included in the returned Array. - * @param {Object} scope (optional) The scope (this reference) in which the function - * is executed. Defaults to this ColumnModel. - * @return {Array} result - */ + getColumnsBy : function(fn, scope){ var r = []; for(var i = 0, len = this.config.length; i < len; i++){ @@ -70407,29 +45607,17 @@ var columns = grid.getColumnModel().getColumnsBy(function(c){ return r; }, - /** - * Returns true if the specified column is sortable. - * @param {Number} col The column index - * @return {Boolean} - */ + isSortable : function(col){ return !!this.config[col].sortable; }, - /** - * Returns true if the specified column menu is disabled. - * @param {Number} col The column index - * @return {Boolean} - */ + isMenuDisabled : function(col){ return !!this.config[col].menuDisabled; }, - /** - * Returns the rendering (formatting) function defined for the column. - * @param {Number} col The column index. - * @return {Function} The function used to render the cell. See {@link #setRenderer}. - */ + getRenderer : function(col){ if(!this.config[col].renderer){ return Ext.grid.ColumnModel.defaultRenderer; @@ -70441,43 +45629,17 @@ var columns = grid.getColumnModel().getColumnsBy(function(c){ return this.config[col].scope; }, - /** - * Sets the rendering (formatting) function for a column. See {@link Ext.util.Format} for some - * default formatting functions. - * @param {Number} col The column index - * @param {Function} fn The function to use to process the cell's raw data - * to return HTML markup for the grid view. The render function is called with - * the following parameters:
        - *
      • value : Object

        The data value for the cell.

      • - *
      • metadata : Object

        An object in which you may set the following attributes:

          - *
        • css : String

          A CSS class name to add to the cell's TD element.

        • - *
        • attr : String

          An HTML attribute definition string to apply to the data container element within the table cell - * (e.g. 'style="color:red;"').

      • - *
      • record : Ext.data.record

        The {@link Ext.data.Record} from which the data was extracted.

      • - *
      • rowIndex : Number

        Row index

      • - *
      • colIndex : Number

        Column index

      • - *
      • store : Ext.data.Store

        The {@link Ext.data.Store} object from which the Record was extracted.

      - */ + setRenderer : function(col, fn){ this.config[col].renderer = fn; }, - /** - * Returns the width for the specified column. - * @param {Number} col The column index - * @return {Number} - */ + getColumnWidth : function(col){ return this.config[col].width; }, - /** - * Sets the width for a column. - * @param {Number} col The column index - * @param {Number} width The new width - * @param {Boolean} suppressEvent True to suppress firing the {@link #widthchange} - * event. Defaults to false. - */ + setColumnWidth : function(col, width, suppressEvent){ this.config[col].width = width; this.totalWidth = null; @@ -70486,11 +45648,7 @@ var columns = grid.getColumnModel().getColumnsBy(function(c){ } }, - /** - * Returns the total width of all columns. - * @param {Boolean} includeHidden True to include hidden column widths - * @return {Number} - */ + getTotalWidth : function(includeHidden){ if(!this.totalWidth){ this.totalWidth = 0; @@ -70503,69 +45661,37 @@ var columns = grid.getColumnModel().getColumnsBy(function(c){ return this.totalWidth; }, - /** - * Returns the header for the specified column. - * @param {Number} col The column index - * @return {String} - */ + getColumnHeader : function(col){ return this.config[col].header; }, - /** - * Sets the header for a column. - * @param {Number} col The column index - * @param {String} header The new header - */ + setColumnHeader : function(col, header){ this.config[col].header = header; this.fireEvent("headerchange", this, col, header); }, - /** - * Returns the tooltip for the specified column. - * @param {Number} col The column index - * @return {String} - */ + getColumnTooltip : function(col){ return this.config[col].tooltip; }, - /** - * Sets the tooltip for a column. - * @param {Number} col The column index - * @param {String} tooltip The new tooltip - */ + setColumnTooltip : function(col, tooltip){ this.config[col].tooltip = tooltip; }, - /** - * Returns the dataIndex for the specified column. -
      
      -// Get field name for the column
      -var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
      -
      - * @param {Number} col The column index - * @return {String} The column's dataIndex - */ + getDataIndex : function(col){ return this.config[col].dataIndex; }, - /** - * Sets the dataIndex for a column. - * @param {Number} col The column index - * @param {String} dataIndex The new dataIndex - */ + setDataIndex : function(col, dataIndex){ this.config[col].dataIndex = dataIndex; }, - /** - * Finds the index of the first matching column for the given dataIndex. - * @param {String} col The dataIndex to find - * @return {Number} The column index, or -1 if no match was found - */ + findColumnIndex : function(dataIndex){ var c = this.config; for(var i = 0, len = c.length; i < len; i++){ @@ -70576,93 +45702,40 @@ var fieldName = grid.getColumnModel().getDataIndex(columnIndex); return -1; }, - /** - * Returns true if the cell is editable. -
      
      -var store = new Ext.data.Store({...});
      -var colModel = new Ext.grid.ColumnModel({
      -  columns: [...],
      -  isCellEditable: function(col, row) {
      -    var record = store.getAt(row);
      -    if (record.get('readonly')) { // replace with your condition
      -      return false;
      -    }
      -    return Ext.grid.ColumnModel.prototype.isCellEditable.call(this, col, row);
      -  }
      -});
      -var grid = new Ext.grid.GridPanel({
      -  store: store,
      -  colModel: colModel,
      -  ...
      -});
      -
      - * @param {Number} colIndex The column index - * @param {Number} rowIndex The row index - * @return {Boolean} - */ + isCellEditable : function(colIndex, rowIndex){ var c = this.config[colIndex], ed = c.editable; - //force boolean + return !!(ed || (!Ext.isDefined(ed) && c.editor)); }, - /** - * Returns the editor defined for the cell/column. - * @param {Number} colIndex The column index - * @param {Number} rowIndex The row index - * @return {Ext.Editor} The {@link Ext.Editor Editor} that was created to wrap - * the {@link Ext.form.Field Field} used to edit the cell. - */ + getCellEditor : function(colIndex, rowIndex){ return this.config[colIndex].getCellEditor(rowIndex); }, - /** - * Sets if a column is editable. - * @param {Number} col The column index - * @param {Boolean} editable True if the column is editable - */ + setEditable : function(col, editable){ this.config[col].editable = editable; }, - /** - * Returns true if the column is {@link Ext.grid.Column#hidden hidden}, - * false otherwise. - * @param {Number} colIndex The column index - * @return {Boolean} - */ + isHidden : function(colIndex){ - return !!this.config[colIndex].hidden; // ensure returns boolean + return !!this.config[colIndex].hidden; }, - /** - * Returns true if the column is {@link Ext.grid.Column#fixed fixed}, - * false otherwise. - * @param {Number} colIndex The column index - * @return {Boolean} - */ + isFixed : function(colIndex){ return !!this.config[colIndex].fixed; }, - /** - * Returns true if the column can be resized - * @return {Boolean} - */ + isResizable : function(colIndex){ return colIndex >= 0 && this.config[colIndex].resizable !== false && this.config[colIndex].fixed !== true; }, - /** - * Sets if a column is hidden. -
      
      -myGrid.getColumnModel().setHidden(0, true); // hide column 0 (0 = the first column).
      -
      - * @param {Number} colIndex The column index - * @param {Boolean} hidden True if the column is hidden - */ + setHidden : function(colIndex, hidden){ var c = this.config[colIndex]; if(c.hidden !== hidden){ @@ -70672,18 +45745,12 @@ myGrid.getColumnModel().setHidden(0, true); // hide column 0 (0 = the first colu } }, - /** - * Sets the editor for a column and destroys the prior editor. - * @param {Number} col The column index - * @param {Object} editor The editor object - */ + setEditor : function(col, editor){ this.config[col].setEditor(editor); }, - /** - * Destroys this column model by purging any event listeners, and removing any editors. - */ + destroy : function(){ var c; for(var i = 0, len = this.config.length; i < len; i++){ @@ -70696,32 +45763,22 @@ myGrid.getColumnModel().setHidden(0, true); // hide column 0 (0 = the first colu } }); -// private + Ext.grid.ColumnModel.defaultRenderer = function(value){ if(typeof value == "string" && value.length < 1){ return " "; } return value; -};/** - * @class Ext.grid.AbstractSelectionModel - * @extends Ext.util.Observable - * Abstract base class for grid SelectionModels. It provides the interface that should be - * implemented by descendant classes. This class should not be directly instantiated. - * @constructor - */ +}; Ext.grid.AbstractSelectionModel = Ext.extend(Ext.util.Observable, { - /** - * The GridPanel for which this SelectionModel is handling selection. Read-only. - * @type Object - * @property grid - */ + constructor : function(){ this.locked = false; Ext.grid.AbstractSelectionModel.superclass.constructor.call(this); }, - /** @ignore Called by the grid automatically. Do not call directly. */ + init : function(grid){ this.grid = grid; if(this.lockOnInit){ @@ -70732,13 +45789,11 @@ Ext.grid.AbstractSelectionModel = Ext.extend(Ext.util.Observable, { this.initEvents(); }, - /** - * Locks the selections. - */ + lock : function(){ if(!this.locked){ this.locked = true; - // If the grid has been set, then the view is already initialized. + var g = this.grid; if(g){ g.getView().on({ @@ -70752,26 +45807,24 @@ Ext.grid.AbstractSelectionModel = Ext.extend(Ext.util.Observable, { } }, - // set the lock states before and after a view refresh + sortLock : function() { this.locked = true; }, - // set the lock states before and after a view refresh + sortUnLock : function() { this.locked = false; }, - /** - * Unlocks the selections. - */ + unlock : function(){ if(this.locked){ this.locked = false; var g = this.grid, gv; - // If the grid has been set, then the view is already initialized. + if(g){ gv = g.getView(); gv.un('beforerefresh', this.sortUnLock, this); @@ -70782,10 +45835,7 @@ Ext.grid.AbstractSelectionModel = Ext.extend(Ext.util.Observable, { } }, - /** - * Returns true if the selections are locked. - * @return {Boolean} - */ + isLocked : function(){ return this.locked; }, @@ -70794,22 +45844,9 @@ Ext.grid.AbstractSelectionModel = Ext.extend(Ext.util.Observable, { this.unlock(); this.purgeListeners(); } -});/** - * @class Ext.grid.RowSelectionModel - * @extends Ext.grid.AbstractSelectionModel - * The default SelectionModel used by {@link Ext.grid.GridPanel}. - * It supports multiple selections and keyboard selection/navigation. The objects stored - * as selections and returned by {@link #getSelected}, and {@link #getSelections} are - * the {@link Ext.data.Record Record}s which provide the data for the selected rows. - * @constructor - * @param {Object} config - */ +}); Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { - /** - * @cfg {Boolean} singleSelect - * true to allow selection of only one row at a time (defaults to false - * allowing multiple selections) - */ + singleSelect : false, constructor : function(config){ @@ -70822,48 +45859,20 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { this.lastActive = false; this.addEvents( - /** - * @event selectionchange - * Fires when the selection changes - * @param {SelectionModel} this - */ + 'selectionchange', - /** - * @event beforerowselect - * Fires before a row is selected, return false to cancel the selection. - * @param {SelectionModel} this - * @param {Number} rowIndex The index to be selected - * @param {Boolean} keepExisting False if other selections will be cleared - * @param {Record} record The record to be selected - */ + 'beforerowselect', - /** - * @event rowselect - * Fires when a row is selected. - * @param {SelectionModel} this - * @param {Number} rowIndex The selected index - * @param {Ext.data.Record} r The selected record - */ + 'rowselect', - /** - * @event rowdeselect - * Fires when a row is deselected. To prevent deselection - * {@link Ext.grid.AbstractSelectionModel#lock lock the selections}. - * @param {SelectionModel} this - * @param {Number} rowIndex - * @param {Record} record - */ + 'rowdeselect' ); Ext.grid.RowSelectionModel.superclass.constructor.call(this); }, - /** - * @cfg {Boolean} moveEditorOnEnter - * false to turn off moving the editor to the next row down when the enter key is pressed - * or the next row up when shift + enter keys are pressed. - */ - // private + + initEvents : function(){ if(!this.grid.enableDragDrop && !this.grid.enableDrag){ @@ -70910,7 +45919,7 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { }); }, - // private + onRefresh : function(){ var ds = this.grid.store, index; var s = this.getSelections(); @@ -70926,25 +45935,21 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { } }, - // private + onRemove : function(v, index, r){ if(this.selections.remove(r) !== false){ this.fireEvent('selectionchange', this); } }, - // private + onRowUpdated : function(v, index, r){ if(this.isSelected(r)){ v.onRowSelect(index); } }, - /** - * Select records. - * @param {Array} records The records to select - * @param {Boolean} keepExisting (optional) true to keep existing selections - */ + selectRecords : function(records, keepExisting){ if(!keepExisting){ this.clearSelections(); @@ -70955,34 +45960,22 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { } }, - /** - * Gets the number of selected rows. - * @return {Number} - */ + getCount : function(){ return this.selections.length; }, - /** - * Selects the first row in the grid. - */ + selectFirstRow : function(){ this.selectRow(0); }, - /** - * Select the last row. - * @param {Boolean} keepExisting (optional) true to keep existing selections - */ + selectLastRow : function(keepExisting){ this.selectRow(this.grid.store.getCount() - 1, keepExisting); }, - /** - * Selects the row immediately following the last selected row. - * @param {Boolean} keepExisting (optional) true to keep existing selections - * @return {Boolean} true if there is a next row, else false - */ + selectNext : function(keepExisting){ if(this.hasNext()){ this.selectRow(this.last+1, keepExisting); @@ -70992,11 +45985,7 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { return false; }, - /** - * Selects the row that precedes the last selected row. - * @param {Boolean} keepExisting (optional) true to keep existing selections - * @return {Boolean} true if there is a previous row, else false - */ + selectPrevious : function(keepExisting){ if(this.hasPrevious()){ this.selectRow(this.last-1, keepExisting); @@ -71006,47 +45995,28 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { return false; }, - /** - * Returns true if there is a next record to select - * @return {Boolean} - */ + hasNext : function(){ return this.last !== false && (this.last+1) < this.grid.store.getCount(); }, - /** - * Returns true if there is a previous record to select - * @return {Boolean} - */ + hasPrevious : function(){ return !!this.last; }, - /** - * Returns the selected records - * @return {Array} Array of selected records - */ + getSelections : function(){ return [].concat(this.selections.items); }, - /** - * Returns the first selected record. - * @return {Record} - */ + getSelected : function(){ return this.selections.itemAt(0); }, - /** - * Calls the passed function with each selection. If the function returns - * false, iteration is stopped and this function returns - * false. Otherwise it returns true. - * @param {Function} fn The function to call upon each iteration. It is passed the selected {@link Ext.data.Record Record}. - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to this RowSelectionModel. - * @return {Boolean} true if all selections were iterated - */ + each : function(fn, scope){ var s = this.getSelections(); for(var i = 0, len = s.length; i < len; i++){ @@ -71057,12 +46027,7 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { return true; }, - /** - * Clears all selections if the selection model - * {@link Ext.grid.AbstractSelectionModel#isLocked is not locked}. - * @param {Boolean} fast (optional) true to bypass the - * conditional checks and events described in {@link #deselectRow}. - */ + clearSelections : function(fast){ if(this.isLocked()){ return; @@ -71081,10 +46046,7 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { }, - /** - * Selects all rows if the selection model - * {@link Ext.grid.AbstractSelectionModel#isLocked is not locked}. - */ + selectAll : function(){ if(this.isLocked()){ return; @@ -71095,34 +46057,23 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { } }, - /** - * Returns true if there is a selection. - * @return {Boolean} - */ + hasSelection : function(){ return this.selections.length > 0; }, - /** - * Returns true if the specified row is selected. - * @param {Number/Record} index The record or index of the record to check - * @return {Boolean} - */ + isSelected : function(index){ var r = Ext.isNumber(index) ? this.grid.store.getAt(index) : index; return (r && this.selections.key(r.id) ? true : false); }, - /** - * Returns true if the specified record id is selected. - * @param {String} id The id of record to check - * @return {Boolean} - */ + isIdSelected : function(id){ return (this.selections.key(id) ? true : false); }, - // private + handleMouseDown : function(g, rowIndex, e){ if(e.button !== 0 || this.isLocked()){ return; @@ -71131,7 +46082,7 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { if(e.shiftKey && !this.singleSelect && this.last !== false){ var last = this.last; this.selectRange(last, rowIndex, e.ctrlKey); - this.last = last; // reset the last + this.last = last; view.focusRow(rowIndex); }else{ var isSelected = this.isSelected(rowIndex); @@ -71144,12 +46095,7 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { } }, - /** - * Selects multiple rows. - * @param {Array} rows Array of the indexes of the row to select - * @param {Boolean} keepExisting (optional) true to keep - * existing selections (defaults to false) - */ + selectRows : function(rows, keepExisting){ if(!keepExisting){ this.clearSelections(); @@ -71159,14 +46105,7 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { } }, - /** - * Selects a range of rows if the selection model - * {@link Ext.grid.AbstractSelectionModel#isLocked is not locked}. - * All rows in between startRow and endRow are also selected. - * @param {Number} startRow The index of the first row in the range - * @param {Number} endRow The index of the last row in the range - * @param {Boolean} keepExisting (optional) True to retain existing selections - */ + selectRange : function(startRow, endRow, keepExisting){ var i; if(this.isLocked()){ @@ -71186,13 +46125,7 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { } }, - /** - * Deselects a range of rows if the selection model - * {@link Ext.grid.AbstractSelectionModel#isLocked is not locked}. - * All rows in between startRow and endRow are also deselected. - * @param {Number} startRow The index of the first row in the range - * @param {Number} endRow The index of the last row in the range - */ + deselectRange : function(startRow, endRow, preventViewNotify){ if(this.isLocked()){ return; @@ -71202,17 +46135,7 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { } }, - /** - * Selects a row. Before selecting a row, checks if the selection model - * {@link Ext.grid.AbstractSelectionModel#isLocked is locked} and fires the - * {@link #beforerowselect} event. If these checks are satisfied the row - * will be selected and followed up by firing the {@link #rowselect} and - * {@link #selectionchange} events. - * @param {Number} row The index of the row to select - * @param {Boolean} keepExisting (optional) true to keep existing selections - * @param {Boolean} preventViewNotify (optional) Specify true to - * prevent notifying the view (disables updating the selected appearance) - */ + selectRow : function(index, keepExisting, preventViewNotify){ if(this.isLocked() || (index < 0 || index >= this.grid.store.getCount()) || (keepExisting && this.isSelected(index))){ return; @@ -71232,15 +46155,7 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { } }, - /** - * Deselects a row. Before deselecting a row, checks if the selection model - * {@link Ext.grid.AbstractSelectionModel#isLocked is locked}. - * If this check is satisfied the row will be deselected and followed up by - * firing the {@link #rowdeselect} and {@link #selectionchange} events. - * @param {Number} row The index of the row to deselect - * @param {Boolean} preventViewNotify (optional) Specify true to - * prevent notifying the view (disables updating the selected appearance) - */ + deselectRow : function(index, preventViewNotify){ if(this.isLocked()){ return; @@ -71262,19 +46177,19 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { } }, - // private + restoreLast : function(){ if(this._last){ this.last = this._last; } }, - // private + acceptsNav : function(row, col, cm){ return !cm.isHidden(col) && cm.isCellEditable(col, row); }, - // private + onEditorKey : function(field, e){ var k = e.getKey(), newCell, @@ -71305,13 +46220,13 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { c = newCell[1]; if(last.row != r){ - this.selectRow(r); // *** highlight newly-selected cell and update selection + this.selectRow(r); } - if(g.isEditor && g.editing){ // *** handle tabbing while editorgrid is in edit mode + if(g.isEditor && g.editing){ ae = g.activeEditor; if(ae && ae.field.triggerBlur){ - // *** if activeEditor is a TriggerField, explicitly call its triggerBlur() method + ae.field.triggerBlur(); } } @@ -71326,217 +46241,32 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { } Ext.grid.RowSelectionModel.superclass.destroy.call(this); } -});/** - * @class Ext.grid.Column - *

      This class encapsulates column configuration data to be used in the initialization of a - * {@link Ext.grid.ColumnModel ColumnModel}.

      - *

      While subclasses are provided to render data in different ways, this class renders a passed - * data field unchanged and is usually used for textual columns.

      - */ -Ext.grid.Column = Ext.extend(Object, { - /** - * @cfg {Boolean} editable Optional. Defaults to true, enabling the configured - * {@link #editor}. Set to false to initially disable editing on this column. - * The initial configuration may be dynamically altered using - * {@link Ext.grid.ColumnModel}.{@link Ext.grid.ColumnModel#setEditable setEditable()}. - */ - /** - * @cfg {String} id Optional. A name which identifies this column (defaults to the column's initial - * ordinal position.) The id is used to create a CSS class name which is applied to all - * table cells (including headers) in that column (in this context the id does not need to be - * unique). The class name takes the form of
      x-grid3-td-id
      - * Header cells will also receive this class name, but will also have the class
      x-grid3-hd
      - * So, to target header cells, use CSS selectors such as:
      .x-grid3-hd-row .x-grid3-td-id
      - * The {@link Ext.grid.GridPanel#autoExpandColumn} grid config option references the column via this - * unique identifier. - */ - /** - * @cfg {String} header Optional. The header text to be used as innerHTML - * (html tags are accepted) to display in the Grid view. Note: to - * have a clickable header with no text displayed use ' '. - */ - /** - * @cfg {Boolean} groupable Optional. If the grid is being rendered by an {@link Ext.grid.GroupingView}, this option - * may be used to disable the header menu item to group by the column selected. Defaults to true, - * which enables the header menu group option. Set to false to disable (but still show) the - * group option in the header menu for the column. See also {@link #groupName}. - */ - /** - * @cfg {String} groupName Optional. If the grid is being rendered by an {@link Ext.grid.GroupingView}, this option - * may be used to specify the text with which to prefix the group field value in the group header line. - * See also {@link #groupRenderer} and - * {@link Ext.grid.GroupingView}.{@link Ext.grid.GroupingView#showGroupName showGroupName}. - */ - /** - * @cfg {Function} groupRenderer

      Optional. If the grid is being rendered by an {@link Ext.grid.GroupingView}, this option - * may be used to specify the function used to format the grouping field value for display in the group - * {@link #groupName header}. If a groupRenderer is not specified, the configured - * {@link #renderer} will be called; if a {@link #renderer} is also not specified - * the new value of the group field will be used.

      - *

      The called function (either the groupRenderer or {@link #renderer}) will be - * passed the following parameters: - *

        - *
      • v : Object

        The new value of the group field.

      • - *
      • unused : undefined

        Unused parameter.

      • - *
      • r : Ext.data.Record

        The Record providing the data - * for the row which caused group change.

      • - *
      • rowIndex : Number

        The row index of the Record which caused group change.

      • - *
      • colIndex : Number

        The column index of the group field.

      • - *
      • ds : Ext.data.Store

        The Store which is providing the data Model.

      • - *

      - *

      The function should return a string value.

      - */ - /** - * @cfg {String} emptyGroupText Optional. If the grid is being rendered by an {@link Ext.grid.GroupingView}, this option - * may be used to specify the text to display when there is an empty group value. Defaults to the - * {@link Ext.grid.GroupingView}.{@link Ext.grid.GroupingView#emptyGroupText emptyGroupText}. - */ - /** - * @cfg {String} dataIndex

      Required. The name of the field in the - * grid's {@link Ext.data.Store}'s {@link Ext.data.Record} definition from - * which to draw the column's value.

      - */ - /** - * @cfg {Number} width - * Optional. The initial width in pixels of the column. - * The width of each column can also be affected if any of the following are configured: - *
        - *
      • {@link Ext.grid.GridPanel}.{@link Ext.grid.GridPanel#autoExpandColumn autoExpandColumn}
      • - *
      • {@link Ext.grid.GridView}.{@link Ext.grid.GridView#forceFit forceFit} - *
        - *

        By specifying forceFit:true, {@link #fixed non-fixed width} columns will be - * re-proportioned (based on the relative initial widths) to fill the width of the grid so - * that no horizontal scrollbar is shown.

        - *
      • - *
      • {@link Ext.grid.GridView}.{@link Ext.grid.GridView#autoFill autoFill}
      • - *
      • {@link Ext.grid.GridPanel}.{@link Ext.grid.GridPanel#minColumnWidth minColumnWidth}
      • - *

        Note: when the width of each column is determined, a space on the right side - * is reserved for the vertical scrollbar. The - * {@link Ext.grid.GridView}.{@link Ext.grid.GridView#scrollOffset scrollOffset} - * can be modified to reduce or eliminate the reserved offset.

        - */ - /** - * @cfg {Boolean} sortable Optional. true if sorting is to be allowed on this column. - * Defaults to the value of the {@link Ext.grid.ColumnModel#defaultSortable} property. - * Whether local/remote sorting is used is specified in {@link Ext.data.Store#remoteSort}. - */ - /** - * @cfg {Boolean} fixed Optional. true if the column width cannot be changed. Defaults to false. - */ - /** - * @cfg {Boolean} resizable Optional. false to disable column resizing. Defaults to true. - */ - /** - * @cfg {Boolean} menuDisabled Optional. true to disable the column menu. Defaults to false. - */ - /** - * @cfg {Boolean} hidden - * Optional. true to initially hide this column. Defaults to false. - * A hidden column {@link Ext.grid.GridPanel#enableColumnHide may be shown via the header row menu}. - * If a column is never to be shown, simply do not include this column in the Column Model at all. - */ - /** - * @cfg {String} tooltip Optional. A text string to use as the column header's tooltip. If Quicktips - * are enabled, this value will be used as the text of the quick tip, otherwise it will be set as the - * header's HTML title attribute. Defaults to ''. - */ - /** - * @cfg {Mixed} renderer - *

        For an alternative to specifying a renderer see {@link #xtype}

        - *

        Optional. A renderer is an 'interceptor' method which can be used transform data (value, - * appearance, etc.) before it is rendered). This may be specified in either of three ways: - *

          - *
        • A renderer function used to return HTML markup for a cell given the cell's data value.
        • - *
        • A string which references a property name of the {@link Ext.util.Format} class which - * provides a renderer function.
        • - *
        • An object specifying both the renderer function, and its execution scope (this - * reference) e.g.:
          
          -{
          -    fn: this.gridRenderer,
          -    scope: this
          -}
          -
        - * If not specified, the default renderer uses the raw data value.

        - *

        For information about the renderer function (passed parameters, etc.), see - * {@link Ext.grid.ColumnModel#setRenderer}. An example of specifying renderer function inline:

        
        -var companyColumn = {
        -   header: 'Company Name',
        -   dataIndex: 'company',
        -   renderer: function(value, metaData, record, rowIndex, colIndex, store) {
        -      // provide the logic depending on business rules
        -      // name of your own choosing to manipulate the cell depending upon
        -      // the data in the underlying Record object.
        -      if (value == 'whatever') {
        -          //metaData.css : String : A CSS class name to add to the TD element of the cell.
        -          //metaData.attr : String : An html attribute definition string to apply to
        -          //                         the data container element within the table
        -          //                         cell (e.g. 'style="color:red;"').
        -          metaData.css = 'name-of-css-class-you-will-define';
        -      }
        -      return value;
        -   }
        -}
        -     * 
        - * See also {@link #scope}. - */ - /** - * @cfg {String} xtype Optional. A String which references a predefined {@link Ext.grid.Column} subclass - * type which is preconfigured with an appropriate {@link #renderer} to be easily - * configured into a ColumnModel. The predefined {@link Ext.grid.Column} subclass types are: - *
          - *
        • gridcolumn : {@link Ext.grid.Column} (Default)

        • - *
        • booleancolumn : {@link Ext.grid.BooleanColumn}

        • - *
        • numbercolumn : {@link Ext.grid.NumberColumn}

        • - *
        • datecolumn : {@link Ext.grid.DateColumn}

        • - *
        • templatecolumn : {@link Ext.grid.TemplateColumn}

        • - *
        - *

        Configuration properties for the specified xtype may be specified with - * the Column configuration properties, for example:

        - *
        
        -var grid = new Ext.grid.GridPanel({
        -    ...
        -    columns: [{
        -        header: 'Last Updated',
        -        dataIndex: 'lastChange',
        -        width: 85,
        -        sortable: true,
        -        //renderer: Ext.util.Format.dateRenderer('m/d/Y'),
        -        xtype: 'datecolumn', // use xtype instead of renderer
        -        format: 'M/d/Y' // configuration property for {@link Ext.grid.DateColumn}
        -    }, {
        -        ...
        -    }]
         });
        -     * 
        - */ - /** - * @cfg {Object} scope Optional. The scope (this reference) in which to execute the - * renderer. Defaults to the Column configuration object. - */ - /** - * @cfg {String} align Optional. Set the CSS text-align property of the column. Defaults to undefined. - */ - /** - * @cfg {String} css Optional. An inline style definition string which is applied to all table cells in the column - * (excluding headers). Defaults to undefined. - */ - /** - * @cfg {Boolean} hideable Optional. Specify as false to prevent the user from hiding this column - * (defaults to true). To disallow column hiding globally for all columns in the grid, use - * {@link Ext.grid.GridPanel#enableColumnHide} instead. - */ - /** - * @cfg {Ext.form.Field} editor Optional. The {@link Ext.form.Field} to use when editing values in this column - * if editing is supported by the grid. See {@link #editable} also. - */ +Ext.grid.Column = Ext.extend(Object, { + + + + + + + + + + + + + + + + + + + + + + - /** - * @private - * @cfg {Boolean} isColumn - * Used by ColumnModel setConfig method to avoid reprocessing a Column - * if isColumn is not set ColumnModel will recreate a new Ext.grid.Column - * Defaults to true. - */ + isColumn : true, constructor : function(config){ @@ -71557,24 +46287,7 @@ var grid = new Ext.grid.GridPanel({ this.setEditor(ed); }, - /** - * Optional. A function which returns displayable data when passed the following parameters: - *
          - *
        • value : Object

          The data value for the cell.

        • - *
        • metadata : Object

          An object in which you may set the following attributes:

            - *
          • css : String

            A CSS class name to add to the cell's TD element.

          • - *
          • attr : String

            An HTML attribute definition string to apply to the data container - * element within the table cell (e.g. 'style="color:red;"').

        • - *
        • record : Ext.data.record

          The {@link Ext.data.Record} from which the data was - * extracted.

        • - *
        • rowIndex : Number

          Row index

        • - *
        • colIndex : Number

          Column index

        • - *
        • store : Ext.data.Store

          The {@link Ext.data.Store} object from which the Record - * was extracted.

        • - *
        - * @property renderer - * @type Function - */ + renderer : function(value){ if(Ext.isString(value) && value.length < 1){ return ' '; @@ -71582,15 +46295,12 @@ var grid = new Ext.grid.GridPanel({ return value; }, - // private + getEditor: function(rowIndex){ return this.editable !== false ? this.editor : null; }, - /** - * Sets a new editor for this column. - * @param {Ext.Editor/Ext.form.Field} editor The editor to set - */ + setEditor : function(editor){ var ed = this.editor; if(ed){ @@ -71603,7 +46313,7 @@ var grid = new Ext.grid.GridPanel({ } this.editor = null; if(editor){ - //not an instance, create it + if(!editor.isXType){ editor = Ext.create(editor, 'textfield'); } @@ -71611,12 +46321,7 @@ var grid = new Ext.grid.GridPanel({ } }, - /** - * Returns the {@link Ext.Editor editor} defined for this column that was created to wrap the {@link Ext.form.Field Field} - * used to edit the cell. - * @param {Number} rowIndex The row index - * @return {Ext.Editor} - */ + getCellEditor: function(rowIndex){ var ed = this.getEditor(rowIndex); if(ed){ @@ -71631,28 +46336,13 @@ var grid = new Ext.grid.GridPanel({ } }); -/** - * @class Ext.grid.BooleanColumn - * @extends Ext.grid.Column - *

        A Column definition class which renders boolean data fields. See the {@link Ext.grid.Column#xtype xtype} - * config option of {@link Ext.grid.Column} for more details.

        - */ + Ext.grid.BooleanColumn = Ext.extend(Ext.grid.Column, { - /** - * @cfg {String} trueText - * The string returned by the renderer when the column value is not falsey (defaults to 'true'). - */ + trueText: 'true', - /** - * @cfg {String} falseText - * The string returned by the renderer when the column value is falsey (but not undefined) (defaults to - * 'false'). - */ + falseText: 'false', - /** - * @cfg {String} undefinedText - * The string returned by the renderer when the column value is undefined (defaults to ' '). - */ + undefinedText: ' ', constructor: function(cfg){ @@ -71670,18 +46360,9 @@ Ext.grid.BooleanColumn = Ext.extend(Ext.grid.Column, { } }); -/** - * @class Ext.grid.NumberColumn - * @extends Ext.grid.Column - *

        A Column definition class which renders a numeric data field according to a {@link #format} string. See the - * {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column} for more details.

        - */ + Ext.grid.NumberColumn = Ext.extend(Ext.grid.Column, { - /** - * @cfg {String} format - * A formatting string as used by {@link Ext.util.Format#number} to format a numeric value for this Column - * (defaults to '0,000.00'). - */ + format : '0,000.00', constructor: function(cfg){ Ext.grid.NumberColumn.superclass.constructor.call(this, cfg); @@ -71689,19 +46370,9 @@ Ext.grid.NumberColumn = Ext.extend(Ext.grid.Column, { } }); -/** - * @class Ext.grid.DateColumn - * @extends Ext.grid.Column - *

        A Column definition class which renders a passed date according to the default locale, or a configured - * {@link #format}. See the {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column} - * for more details.

        - */ + Ext.grid.DateColumn = Ext.extend(Ext.grid.Column, { - /** - * @cfg {String} format - * A formatting string as used by {@link Date#format} to format a Date for this Column - * (defaults to 'm/d/Y'). - */ + format : 'm/d/Y', constructor: function(cfg){ Ext.grid.DateColumn.superclass.constructor.call(this, cfg); @@ -71709,20 +46380,9 @@ Ext.grid.DateColumn = Ext.extend(Ext.grid.Column, { } }); -/** - * @class Ext.grid.TemplateColumn - * @extends Ext.grid.Column - *

        A Column definition class which renders a value by processing a {@link Ext.data.Record Record}'s - * {@link Ext.data.Record#data data} using a {@link #tpl configured} {@link Ext.XTemplate XTemplate}. - * See the {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column} for more - * details.

        - */ + Ext.grid.TemplateColumn = Ext.extend(Ext.grid.Column, { - /** - * @cfg {String/XTemplate} tpl - * An {@link Ext.XTemplate XTemplate}, or an XTemplate definition string to use to process a - * {@link Ext.data.Record Record}'s {@link Ext.data.Record#data data} to produce a column's rendered value. - */ + constructor: function(cfg){ Ext.grid.TemplateColumn.superclass.constructor.call(this, cfg); var tpl = (!Ext.isPrimitive(this.tpl) && this.tpl.compile) ? this.tpl : new Ext.XTemplate(this.tpl); @@ -71733,58 +46393,20 @@ Ext.grid.TemplateColumn = Ext.extend(Ext.grid.Column, { } }); -/* - * @property types - * @type Object - * @member Ext.grid.Column - * @static - *

        An object containing predefined Column classes keyed by a mnemonic code which may be referenced - * by the {@link Ext.grid.ColumnModel#xtype xtype} config option of ColumnModel.

        - *

        This contains the following properties

          - *
        • gridcolumn : {@link Ext.grid.Column Column constructor}
        • - *
        • booleancolumn : {@link Ext.grid.BooleanColumn BooleanColumn constructor}
        • - *
        • numbercolumn : {@link Ext.grid.NumberColumn NumberColumn constructor}
        • - *
        • datecolumn : {@link Ext.grid.DateColumn DateColumn constructor}
        • - *
        • templatecolumn : {@link Ext.grid.TemplateColumn TemplateColumn constructor}
        • - *
        - */ + Ext.grid.Column.types = { gridcolumn : Ext.grid.Column, booleancolumn: Ext.grid.BooleanColumn, numbercolumn: Ext.grid.NumberColumn, datecolumn: Ext.grid.DateColumn, templatecolumn: Ext.grid.TemplateColumn -};/** - * @class Ext.grid.RowNumberer - * This is a utility class that can be passed into a {@link Ext.grid.ColumnModel} as a column config that provides - * an automatic row numbering column. - *
        Usage:
        -
        
        - // This is a typical column config with the first column providing row numbers
        - var colModel = new Ext.grid.ColumnModel([
        -    new Ext.grid.RowNumberer(),
        -    {header: "Name", width: 80, sortable: true},
        -    {header: "Code", width: 50, sortable: true},
        -    {header: "Description", width: 200, sortable: true}
        - ]);
        - 
        - * @constructor - * @param {Object} config The configuration options - */ +}; Ext.grid.RowNumberer = Ext.extend(Object, { - /** - * @cfg {String} header Any valid text or HTML fragment to display in the header cell for the row - * number column (defaults to ''). - */ + header: "", - /** - * @cfg {Number} width The default width in pixels of the row number column (defaults to 23). - */ + width: 23, - /** - * @cfg {Boolean} sortable True if the row number column is sortable (defaults to false). - * @hide - */ + sortable: false, constructor : function(config){ @@ -71794,7 +46416,7 @@ Ext.grid.RowNumberer = Ext.extend(Object, { } }, - // private + fixed:true, hideable: false, menuDisabled:true, @@ -71802,49 +46424,25 @@ Ext.grid.RowNumberer = Ext.extend(Object, { id: 'numberer', rowspan: undefined, - // private + renderer : function(v, p, record, rowIndex){ if(this.rowspan){ p.cellAttr = 'rowspan="'+this.rowspan+'"'; } return rowIndex+1; } -});/** - * @class Ext.grid.CheckboxSelectionModel - * @extends Ext.grid.RowSelectionModel - * A custom selection model that renders a column of checkboxes that can be toggled to select or deselect rows. - * @constructor - * @param {Object} config The configuration options - */ +}); Ext.grid.CheckboxSelectionModel = Ext.extend(Ext.grid.RowSelectionModel, { - /** - * @cfg {Boolean} checkOnly true if rows can only be selected by clicking on the - * checkbox column (defaults to false). - */ - /** - * @cfg {String} header Any valid text or HTML fragment to display in the header cell for the - * checkbox column. Defaults to:
        
        -     * '<div class="x-grid3-hd-checker">&#160;</div>'
        -     * 
        - * The default CSS class of 'x-grid3-hd-checker' displays a checkbox in the header - * and provides support for automatic check all/none behavior on header click. This string - * can be replaced by any valid HTML fragment, including a simple text string (e.g., - * 'Select Rows'), but the automatic check all/none behavior will only work if the - * 'x-grid3-hd-checker' class is supplied. - */ + + header : '
         
        ', - /** - * @cfg {Number} width The default width in pixels of the checkbox column (defaults to 20). - */ + width : 20, - /** - * @cfg {Boolean} sortable true if the checkbox column is sortable (defaults to - * false). - */ + sortable : false, - // private + menuDisabled : true, fixed : true, hideable: false, @@ -71859,7 +46457,7 @@ Ext.grid.CheckboxSelectionModel = Ext.extend(Ext.grid.RowSelectionModel, { } }, - // private + initEvents : function(){ Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this); this.grid.on('render', function(){ @@ -71870,33 +46468,34 @@ Ext.grid.CheckboxSelectionModel = Ext.extend(Ext.grid.RowSelectionModel, { }, this); }, - // If handleMouseDown was called from another event (enableDragDrop), set a flag so - // onMouseDown does not process it a second time + + handleMouseDown : function() { Ext.grid.CheckboxSelectionModel.superclass.handleMouseDown.apply(this, arguments); this.mouseHandled = true; }, - // private + onMouseDown : function(e, t){ - if(e.button === 0 && t.className == 'x-grid3-row-checker'){ // Only fire if left-click + if(e.button === 0 && t.className == 'x-grid3-row-checker'){ e.stopEvent(); var row = e.getTarget('.x-grid3-row'); - // mouseHandled flag check for a duplicate selection (handleMouseDown) call + if(!this.mouseHandled && row){ var index = row.rowIndex; if(this.isSelected(index)){ this.deselectRow(index); }else{ this.selectRow(index, true); + this.grid.getView().focusRow(index); } } } this.mouseHandled = false; }, - // private + onHdMouseDown : function(e, t){ if(t.className == 'x-grid3-hd-checker'){ e.stopEvent(); @@ -71912,23 +46511,11 @@ Ext.grid.CheckboxSelectionModel = Ext.extend(Ext.grid.RowSelectionModel, { } }, - // private + renderer : function(v, p, record){ return '
         
        '; } -});/** - * @class Ext.grid.CellSelectionModel - * @extends Ext.grid.AbstractSelectionModel - * This class provides the basic implementation for single cell selection in a grid. - * The object stored as the selection contains the following properties: - *
          - *
        • cell : see {@link #getSelectedCell} - *
        • record : Ext.data.record The {@link Ext.data.Record Record} - * which provides the data for the row containing the selection
        • - *
        - * @constructor - * @param {Object} config The object containing the configuration of this model. - */ +}); Ext.grid.CellSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { constructor : function(config){ @@ -71937,40 +46524,18 @@ Ext.grid.CellSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { this.selection = null; this.addEvents( - /** - * @event beforecellselect - * Fires before a cell is selected, return false to cancel the selection. - * @param {SelectionModel} this - * @param {Number} rowIndex The selected row index - * @param {Number} colIndex The selected cell index - */ + "beforecellselect", - /** - * @event cellselect - * Fires when a cell is selected. - * @param {SelectionModel} this - * @param {Number} rowIndex The selected row index - * @param {Number} colIndex The selected cell index - */ + "cellselect", - /** - * @event selectionchange - * Fires when the active selection changes. - * @param {SelectionModel} this - * @param {Object} selection null for no selection or an object with two properties - *
          - *
        • cell : see {@link #getSelectedCell} - *
        • record : Ext.data.record

          The {@link Ext.data.Record Record} - * which provides the data for the row containing the selection

        • - *
        - */ + "selectionchange" ); Ext.grid.CellSelectionModel.superclass.constructor.call(this); }, - /** @ignore */ + initEvents : function(){ this.grid.on('cellmousedown', this.handleMouseDown, this); this.grid.on(Ext.EventManager.useKeydown ? 'keydown' : 'keypress', this.handleKeyDown, this); @@ -71986,49 +46551,29 @@ Ext.grid.CellSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, { } }, - //private + beforeEdit : function(e){ this.select(e.row, e.column, false, true, e.record); }, - //private + onRowUpdated : function(v, index, r){ if(this.selection && this.selection.record == r){ v.onCellSelect(index, this.selection.cell[1]); } }, - //private + onViewChange : function(){ this.clearSelections(true); }, - /** - * Returns an array containing the row and column indexes of the currently selected cell - * (e.g., [0, 0]), or null if none selected. The array has elements: - *
          - *
        • rowIndex : Number

          The index of the selected row

        • - *
        • cellIndex : Number

          The index of the selected cell. - * Due to possible column reordering, the cellIndex should not be used as an - * index into the Record's data. Instead, use the cellIndex to determine the name - * of the selected cell and use the field name to retrieve the data value from the record:

          
          -// get name
          -var fieldName = grid.getColumnModel().getDataIndex(cellIndex);
          -// get data value based on name
          -var data = record.get(fieldName);
          -     * 

        • - *
        - * @return {Array} An array containing the row and column indexes of the selected cell, or null if none selected. - */ + getSelectedCell : function(){ return this.selection ? this.selection.cell : null; }, - /** - * If anything is selected, clears all selections and fires the selectionchange event. - * @param {Boolean} preventNotify true to prevent the gridview from - * being notified about the change. - */ + clearSelections : function(preventNotify){ var s = this.selection; if(s){ @@ -72040,15 +46585,12 @@ var data = record.get(fieldName); } }, - /** - * Returns true if there is a selection. - * @return {Boolean} - */ + hasSelection : function(){ return this.selection ? true : false; }, - /** @ignore */ + handleMouseDown : function(g, row, cell, e){ if(e.button !== 0 || this.isLocked()){ return; @@ -72056,20 +46598,8 @@ var data = record.get(fieldName); this.select(row, cell); }, - /** - * Selects a cell. Before selecting a cell, fires the - * {@link #beforecellselect} event. If this check is satisfied the cell - * will be selected and followed up by firing the {@link #cellselect} and - * {@link #selectionchange} events. - * @param {Number} rowIndex The index of the row to select - * @param {Number} colIndex The index of the column to select - * @param {Boolean} preventViewNotify (optional) Specify true to - * prevent notifying the view (disables updating the selected appearance) - * @param {Boolean} preventFocus (optional) Whether to prevent the cell at - * the specified rowIndex / colIndex from being focused. - * @param {Ext.data.Record} r (optional) The record to select - */ - select : function(rowIndex, colIndex, preventViewNotify, preventFocus, /*internal*/ r){ + + select : function(rowIndex, colIndex, preventViewNotify, preventFocus, r){ if(this.fireEvent("beforecellselect", this, rowIndex, colIndex) !== false){ this.clearSelections(); r = r || this.grid.store.getAt(rowIndex); @@ -72089,19 +46619,19 @@ var data = record.get(fieldName); } }, - //private + isSelectable : function(rowIndex, colIndex, cm){ return !cm.isHidden(colIndex); }, - // private + onEditorKey: function(field, e){ if(e.getKey() == e.TAB){ this.handleKeyDown(e); } }, - /** @ignore */ + handleKeyDown : function(e){ if(!e.isNavKeyPress()){ return; @@ -72116,7 +46646,7 @@ var data = record.get(fieldName); row, col, step, - g.isEditor && g.editing ? sm.acceptsNav : sm.isSelectable, // *** handle tabbing while editorgrid is in edit mode + g.isEditor && g.editing ? sm.acceptsNav : sm.isSelectable, sm ); }, @@ -72126,25 +46656,25 @@ var data = record.get(fieldName); case e.ESC: case e.PAGE_UP: case e.PAGE_DOWN: - // do nothing + break; default: - // *** call e.stopEvent() only for non ESC, PAGE UP/DOWN KEYS + e.stopEvent(); break; } if(!s){ - cell = walk(0, 0, 1); // *** use private walk() function defined above + cell = walk(0, 0, 1); if(cell){ this.select(cell[0], cell[1]); } return; } - cell = s.cell; // currently selected cell - r = cell[0]; // current row - c = cell[1]; // current column + cell = s.cell; + r = cell[0]; + c = cell[1]; switch(k){ case e.TAB: @@ -72175,16 +46705,16 @@ var data = record.get(fieldName); } if(newCell){ - // *** reassign r & c variables to newly-selected cell's row and column + r = newCell[0]; c = newCell[1]; - this.select(r, c); // *** highlight newly-selected cell and update selection + this.select(r, c); - if(g.isEditor && g.editing){ // *** handle tabbing while editorgrid is in edit mode + if(g.isEditor && g.editing){ ae = g.activeEditor; if(ae && ae.field.triggerBlur){ - // *** if activeEditor is a TriggerField, explicitly call its triggerBlur() method + ae.field.triggerBlur(); } g.startEditing(r, c); @@ -72195,150 +46725,48 @@ var data = record.get(fieldName); acceptsNav : function(row, col, cm){ return !cm.isHidden(col) && cm.isCellEditable(col, row); } -});/** - * @class Ext.grid.EditorGridPanel - * @extends Ext.grid.GridPanel - *

        This class extends the {@link Ext.grid.GridPanel GridPanel Class} to provide cell editing - * on selected {@link Ext.grid.Column columns}. The editable columns are specified by providing - * an {@link Ext.grid.ColumnModel#editor editor} in the {@link Ext.grid.Column column configuration}.

        - *

        Editability of columns may be controlled programatically by inserting an implementation - * of {@link Ext.grid.ColumnModel#isCellEditable isCellEditable} into the - * {@link Ext.grid.ColumnModel ColumnModel}.

        - *

        Editing is performed on the value of the field specified by the column's - * {@link Ext.grid.ColumnModel#dataIndex dataIndex} in the backing {@link Ext.data.Store Store} - * (so if you are using a {@link Ext.grid.ColumnModel#setRenderer renderer} in order to display - * transformed data, this must be accounted for).

        - *

        If a value-to-description mapping is used to render a column, then a {@link Ext.form.Field#ComboBox ComboBox} - * which uses the same {@link Ext.form.Field#valueField value}-to-{@link Ext.form.Field#displayFieldField description} - * mapping would be an appropriate editor.

        - * If there is a more complex mismatch between the visible data in the grid, and the editable data in - * the {@link Edt.data.Store Store}, then code to transform the data both before and after editing can be - * injected using the {@link #beforeedit} and {@link #afteredit} events. - * @constructor - * @param {Object} config The config object - * @xtype editorgrid - */ +}); Ext.grid.EditorGridPanel = Ext.extend(Ext.grid.GridPanel, { - /** - * @cfg {Number} clicksToEdit - *

        The number of clicks on a cell required to display the cell's editor (defaults to 2).

        - *

        Setting this option to 'auto' means that mousedown on the selected cell starts - * editing that cell.

        - */ + clicksToEdit: 2, - /** - * @cfg {Boolean} forceValidation - * True to force validation even if the value is unmodified (defaults to false) - */ + forceValidation: false, - // private + isEditor : true, - // private + detectEdit: false, - /** - * @cfg {Boolean} autoEncode - * True to automatically HTML encode and decode values pre and post edit (defaults to false) - */ + autoEncode : false, - /** - * @cfg {Boolean} trackMouseOver @hide - */ - // private - trackMouseOver: false, // causes very odd FF errors + + + trackMouseOver: false, - // private + initComponent : function(){ Ext.grid.EditorGridPanel.superclass.initComponent.call(this); if(!this.selModel){ - /** - * @cfg {Object} selModel Any subclass of AbstractSelectionModel that will provide the selection model for - * the grid (defaults to {@link Ext.grid.CellSelectionModel} if not specified). - */ + this.selModel = new Ext.grid.CellSelectionModel(); } this.activeEditor = null; this.addEvents( - /** - * @event beforeedit - * Fires before cell editing is triggered. The edit event object has the following properties
        - *
          - *
        • grid - This grid
        • - *
        • record - The record being edited
        • - *
        • field - The field name being edited
        • - *
        • value - The value for the field being edited.
        • - *
        • row - The grid row index
        • - *
        • column - The grid column index
        • - *
        • cancel - Set this to true to cancel the edit or return false from your handler.
        • - *
        - * @param {Object} e An edit event (see above for description) - */ + "beforeedit", - /** - * @event afteredit - * Fires after a cell is edited. The edit event object has the following properties
        - *
          - *
        • grid - This grid
        • - *
        • record - The record being edited
        • - *
        • field - The field name being edited
        • - *
        • value - The value being set
        • - *
        • originalValue - The original value for the field, before the edit.
        • - *
        • row - The grid row index
        • - *
        • column - The grid column index
        • - *
        - * - *
        
        -grid.on('afteredit', afterEdit, this );
        -
        -function afterEdit(e) {
        -    // execute an XHR to send/commit data to the server, in callback do (if successful):
        -    e.record.commit();
        -};
        -             * 
        - * @param {Object} e An edit event (see above for description) - */ + "afteredit", - /** - * @event validateedit - * Fires after a cell is edited, but before the value is set in the record. Return false - * to cancel the change. The edit event object has the following properties
        - *
          - *
        • grid - This grid
        • - *
        • record - The record being edited
        • - *
        • field - The field name being edited
        • - *
        • value - The value being set
        • - *
        • originalValue - The original value for the field, before the edit.
        • - *
        • row - The grid row index
        • - *
        • column - The grid column index
        • - *
        • cancel - Set this to true to cancel the edit or return false from your handler.
        • - *
        - * Usage example showing how to remove the red triangle (dirty record indicator) from some - * records (not all). By observing the grid's validateedit event, it can be cancelled if - * the edit occurs on a targeted row (for example) and then setting the field's new value - * in the Record directly: - *
        
        -grid.on('validateedit', function(e) {
        -  var myTargetRow = 6;
        -
        -  if (e.row == myTargetRow) {
        -    e.cancel = true;
        -    e.record.data[e.field] = e.value;
        -  }
        -});
        -             * 
        - * @param {Object} e An edit event (see above for description) - */ + "validateedit" ); }, - // private + initEvents : function(){ Ext.grid.EditorGridPanel.superclass.initEvents.call(this); @@ -72364,12 +46792,12 @@ grid.on('validateedit', function(e) { } }, - // private + onCellDblClick : function(g, row, col){ this.startEditing(row, col); }, - // private + onAutoEditClick : function(e, t){ if(e.button !== 0){ return; @@ -72378,7 +46806,7 @@ grid.on('validateedit', function(e) { col = this.view.findCellIndex(t); if(row !== false && col !== false){ this.stopEditing(); - if(this.selModel.getSelectedCell){ // cell sm + if(this.selModel.getSelectedCell){ var sc = this.selModel.getSelectedCell(); if(sc && sc[0] === row && sc[1] === col){ this.startEditing(row, col); @@ -72391,7 +46819,7 @@ grid.on('validateedit', function(e) { } }, - // private + onEditComplete : function(ed, value, startValue){ this.editing = false; this.lastActiveEditor = this.activeEditor; @@ -72420,11 +46848,7 @@ grid.on('validateedit', function(e) { this.view.focusCell(ed.row, ed.col); }, - /** - * Starts editing the specified for the specified row/column - * @param {Number} rowIndex - * @param {Number} colIndex - */ + startEditing : function(row, col){ this.stopEditing(); if(this.colModel.isCellEditable(col, row)){ @@ -72474,13 +46898,13 @@ grid.on('validateedit', function(e) { col: col }; this.activeEditor = ed; - // Set the selectSameEditor flag if we are reusing the same editor again and - // need to prevent the editor from firing onBlur on itself. + + ed.selectSameEditor = (this.activeEditor == this.lastActiveEditor); var v = this.preEditValue(r, field); ed.startEdit(this.view.getCell(row, col).firstChild, Ext.isDefined(v) ? v : ''); - // Clear the selectSameEditor flag + (function(){ delete ed.selectSameEditor; }).defer(50); @@ -72488,24 +46912,21 @@ grid.on('validateedit', function(e) { } }, - // private + preEditValue : function(r, field){ var value = r.data[field]; return this.autoEncode && Ext.isString(value) ? Ext.util.Format.htmlDecode(value) : value; }, - // private + postEditValue : function(value, originalValue, r, field){ return this.autoEncode && Ext.isString(value) ? Ext.util.Format.htmlEncode(value) : value; }, - /** - * Stops any active editing - * @param {Boolean} cancel (optional) True to cancel any changes - */ + stopEditing : function(cancel){ if(this.editing){ - // Store the lastActiveEditor to check if it is changing + var ae = this.lastActiveEditor = this.activeEditor; if(ae){ ae[cancel === true ? 'cancelEdit' : 'completeEdit'](); @@ -72516,8 +46937,8 @@ grid.on('validateedit', function(e) { this.editing = false; } }); -Ext.reg('editorgrid', Ext.grid.EditorGridPanel);// private -// This is a support class used internally by the Grid components +Ext.reg('editorgrid', Ext.grid.EditorGridPanel); + Ext.grid.GridEditor = function(field, config){ Ext.grid.GridEditor.superclass.constructor.call(this, field, config); field.monitorTab = false; @@ -72530,40 +46951,12 @@ Ext.extend(Ext.grid.GridEditor, Ext.Editor, { cls: "x-small-editor x-grid-editor", shim:false, shadow:false -});/** - * @class Ext.grid.PropertyRecord - * A specific {@link Ext.data.Record} type that represents a name/value pair and is made to work with the - * {@link Ext.grid.PropertyGrid}. Typically, PropertyRecords do not need to be created directly as they can be - * created implicitly by simply using the appropriate data configs either via the {@link Ext.grid.PropertyGrid#source} - * config property or by calling {@link Ext.grid.PropertyGrid#setSource}. However, if the need arises, these records - * can also be created explicitly as shwon below. Example usage: - *
        
        -var rec = new Ext.grid.PropertyRecord({
        -    name: 'Birthday',
        -    value: new Date(Date.parse('05/26/1972'))
         });
        -// Add record to an already populated grid
        -grid.store.addSorted(rec);
        -
        - * @constructor - * @param {Object} config A data object in the format: {name: [name], value: [value]}. The specified value's type - * will be read automatically by the grid to determine the type of editor to use when displaying it. - */ Ext.grid.PropertyRecord = Ext.data.Record.create([ {name:'name',type:'string'}, 'value' ]); -/** - * @class Ext.grid.PropertyStore - * @extends Ext.util.Observable - * A custom wrapper for the {@link Ext.grid.PropertyGrid}'s {@link Ext.data.Store}. This class handles the mapping - * between the custom data source objects supported by the grid and the {@link Ext.grid.PropertyRecord} format - * required for compatibility with the underlying store. Generally this class should not need to be used directly -- - * the grid's data should be accessed from the underlying store via the {@link #store} property. - * @constructor - * @param {Ext.grid.Grid} grid The grid this store will be bound to - * @param {Object} source The source data config object - */ + Ext.grid.PropertyStore = Ext.extend(Ext.util.Observable, { constructor : function(grid, source){ @@ -72578,7 +46971,7 @@ Ext.grid.PropertyStore = Ext.extend(Ext.util.Observable, { Ext.grid.PropertyStore.superclass.constructor.call(this); }, - // protected - should only be called by the grid. Use grid.setSource instead. + setSource : function(o){ this.source = o; this.store.removeAll(); @@ -72591,7 +46984,7 @@ Ext.grid.PropertyStore = Ext.extend(Ext.util.Observable, { this.store.loadRecords({records: data}, {}, true); }, - // private + onUpdate : function(ds, record, type){ if(type == Ext.data.Record.EDIT){ var v = record.data.value; @@ -72606,24 +46999,24 @@ Ext.grid.PropertyStore = Ext.extend(Ext.util.Observable, { } }, - // private + getProperty : function(row){ return this.store.getAt(row); }, - // private + isEditableValue: function(val){ return Ext.isPrimitive(val) || Ext.isDate(val); }, - // private + setValue : function(prop, value, create){ var r = this.getRec(prop); if(r){ r.set('value', value); this.source[prop] = value; }else if(create){ - // only create if specified. + this.source[prop] = value; r = new Ext.grid.PropertyRecord({name: prop, value: value}, prop); this.store.add(r); @@ -72631,7 +47024,7 @@ Ext.grid.PropertyStore = Ext.extend(Ext.util.Observable, { } }, - // private + remove : function(prop){ var r = this.getRec(prop); if(r){ @@ -72640,27 +47033,20 @@ Ext.grid.PropertyStore = Ext.extend(Ext.util.Observable, { } }, - // private + getRec : function(prop){ return this.store.getById(prop); }, - // protected - should only be called by the grid. Use grid.getSource instead. + getSource : function(){ return this.source; } }); -/** - * @class Ext.grid.PropertyColumnModel - * @extends Ext.grid.ColumnModel - * A custom column model for the {@link Ext.grid.PropertyGrid}. Generally it should not need to be used directly. - * @constructor - * @param {Ext.grid.Grid} grid The grid this store will be bound to - * @param {Object} source The source data config object - */ + Ext.grid.PropertyColumnModel = Ext.extend(Ext.grid.ColumnModel, { - // private - strings used for locale support + nameText : 'Name', valueText : 'Value', dateFormat : 'm/j/Y', @@ -72699,33 +47085,33 @@ Ext.grid.PropertyColumnModel = Ext.extend(Ext.grid.ColumnModel, { this.renderPropDelegate = this.renderProp.createDelegate(this); }, - // private + renderDate : function(dateVal){ return dateVal.dateFormat(this.dateFormat); }, - // private + renderBool : function(bVal){ return this[bVal ? 'trueText' : 'falseText']; }, - // private + isCellEditable : function(colIndex, rowIndex){ return colIndex == 1; }, - // private + getRenderer : function(col){ return col == 1 ? this.renderCellDelegate : this.renderPropDelegate; }, - // private + renderProp : function(v){ return this.getPropertyName(v); }, - // private + renderCell : function(val, meta, rec){ var renderer = this.grid.customRenderers[rec.get('name')]; if(renderer){ @@ -72740,13 +47126,13 @@ Ext.grid.PropertyColumnModel = Ext.extend(Ext.grid.ColumnModel, { return Ext.util.Format.htmlEncode(rv); }, - // private + getPropertyName : function(name){ var pn = this.grid.propertyNames; return pn && pn[name] ? pn[name] : name; }, - // private + getCellEditor : function(colIndex, rowIndex){ var p = this.store.getProperty(rowIndex), n = p.data.name, @@ -72765,7 +47151,7 @@ Ext.grid.PropertyColumnModel = Ext.extend(Ext.grid.ColumnModel, { } }, - // inherit docs + destroy : function(){ Ext.grid.PropertyColumnModel.superclass.destroy.call(this); for(var ed in this.editors){ @@ -72774,85 +47160,15 @@ Ext.grid.PropertyColumnModel = Ext.extend(Ext.grid.ColumnModel, { } }); -/** - * @class Ext.grid.PropertyGrid - * @extends Ext.grid.EditorGridPanel - * A specialized grid implementation intended to mimic the traditional property grid as typically seen in - * development IDEs. Each row in the grid represents a property of some object, and the data is stored - * as a set of name/value pairs in {@link Ext.grid.PropertyRecord}s. Example usage: - *
        
        -var grid = new Ext.grid.PropertyGrid({
        -    title: 'Properties Grid',
        -    autoHeight: true,
        -    width: 300,
        -    renderTo: 'grid-ct',
        -    source: {
        -        "(name)": "My Object",
        -        "Created": new Date(Date.parse('10/15/2006')),
        -        "Available": false,
        -        "Version": .01,
        -        "Description": "A test object"
        -    }
        -});
        -
        - * @constructor - * @param {Object} config The grid config object - */ + Ext.grid.PropertyGrid = Ext.extend(Ext.grid.EditorGridPanel, { - /** - * @cfg {Object} propertyNames An object containing property name/display name pairs. - * If specified, the display name will be shown in the name column instead of the property name. - */ - /** - * @cfg {Object} source A data object to use as the data source of the grid (see {@link #setSource} for details). - */ - /** - * @cfg {Object} customEditors An object containing name/value pairs of custom editor type definitions that allow - * the grid to support additional types of editable fields. By default, the grid supports strongly-typed editing - * of strings, dates, numbers and booleans using built-in form editors, but any custom type can be supported and - * associated with a custom input control by specifying a custom editor. The name of the editor - * type should correspond with the name of the property that will use the editor. Example usage: - *
        
        -var grid = new Ext.grid.PropertyGrid({
        -    ...
        -    customEditors: {
        -        'Start Time': new Ext.grid.GridEditor(new Ext.form.TimeField({selectOnFocus:true}))
        -    },
        -    source: {
        -        'Start Time': '10:00 AM'
        -    }
        -});
        -
        - */ - /** - * @cfg {Object} source A data object to use as the data source of the grid (see {@link #setSource} for details). - */ - /** - * @cfg {Object} customRenderers An object containing name/value pairs of custom renderer type definitions that allow - * the grid to support custom rendering of fields. By default, the grid supports strongly-typed rendering - * of strings, dates, numbers and booleans using built-in form editors, but any custom type can be supported and - * associated with the type of the value. The name of the renderer type should correspond with the name of the property - * that it will render. Example usage: - *
        
        -var grid = new Ext.grid.PropertyGrid({
        -    ...
        -    customRenderers: {
        -        Available: function(v){
        -            if(v){
        -                return 'Yes';
        -            }else{
        -                return 'No';
        -            }
        -        }
        -    },
        -    source: {
        -        Available: true
        -    }
        -});
        -
        - */ + + + + + - // private config overrides + enableColumnMove:false, stripeRows:false, trackMouseOver: false, @@ -72862,7 +47178,7 @@ var grid = new Ext.grid.PropertyGrid({ forceFit:true }, - // private + initComponent : function(){ this.customRenderers = this.customRenderers || {}; this.customEditors = this.customEditors || {}; @@ -72872,26 +47188,9 @@ var grid = new Ext.grid.PropertyGrid({ var cm = new Ext.grid.PropertyColumnModel(this, store); store.store.sort('name', 'ASC'); this.addEvents( - /** - * @event beforepropertychange - * Fires before a property value changes. Handlers can return false to cancel the property change - * (this will internally call {@link Ext.data.Record#reject} on the property's record). - * @param {Object} source The source data object for the grid (corresponds to the same object passed in - * as the {@link #source} config property). - * @param {String} recordId The record's id in the data store - * @param {Mixed} value The current edited property value - * @param {Mixed} oldValue The original property value prior to editing - */ + 'beforepropertychange', - /** - * @event propertychange - * Fires after a property value has changed. - * @param {Object} source The source data object for the grid (corresponds to the same object passed in - * as the {@link #source} config property). - * @param {String} recordId The record's id in the data store - * @param {Mixed} value The current edited property value - * @param {Mixed} oldValue The original property value prior to editing - */ + 'propertychange' ); this.cm = cm; @@ -72906,14 +47205,14 @@ var grid = new Ext.grid.PropertyGrid({ }, this); }, - // private + onRender : function(){ Ext.grid.PropertyGrid.superclass.onRender.apply(this, arguments); this.getGridEl().addClass('x-props-grid'); }, - // private + afterRender: function(){ Ext.grid.PropertyGrid.superclass.afterRender.apply(this, arguments); if(this.source){ @@ -72921,220 +47220,64 @@ var grid = new Ext.grid.PropertyGrid({ } }, - /** - * Sets the source data object containing the property data. The data object can contain one or more name/value - * pairs representing all of the properties of an object to display in the grid, and this data will automatically - * be loaded into the grid's {@link #store}. The values should be supplied in the proper data type if needed, - * otherwise string type will be assumed. If the grid already contains data, this method will replace any - * existing data. See also the {@link #source} config value. Example usage: - *
        
        -grid.setSource({
        -    "(name)": "My Object",
        -    "Created": new Date(Date.parse('10/15/2006')),  // date type
        -    "Available": false,  // boolean type
        -    "Version": .01,      // decimal type
        -    "Description": "A test object"
        -});
        -
        - * @param {Object} source The data object - */ + setSource : function(source){ this.propStore.setSource(source); }, - /** - * Gets the source data object containing the property data. See {@link #setSource} for details regarding the - * format of the data object. - * @return {Object} The data object - */ + getSource : function(){ return this.propStore.getSource(); }, - /** - * Sets the value of a property. - * @param {String} prop The name of the property to set - * @param {Mixed} value The value to test - * @param {Boolean} create (Optional) True to create the property if it doesn't already exist. Defaults to false. - */ + setProperty : function(prop, value, create){ this.propStore.setValue(prop, value, create); }, - /** - * Removes a property from the grid. - * @param {String} prop The name of the property to remove - */ + removeProperty : function(prop){ this.propStore.remove(prop); } - /** - * @cfg store - * @hide - */ - /** - * @cfg colModel - * @hide - */ - /** - * @cfg cm - * @hide - */ - /** - * @cfg columns - * @hide - */ + + + + }); Ext.reg("propertygrid", Ext.grid.PropertyGrid); -/** - * @class Ext.grid.GroupingView - * @extends Ext.grid.GridView - * Adds the ability for single level grouping to the grid. A {@link Ext.data.GroupingStore GroupingStore} - * must be used to enable grouping. Some grouping characteristics may also be configured at the - * {@link Ext.grid.Column Column level}
          - *
        • {@link Ext.grid.Column#emptyGroupText emptyGroupText}
        • - *
        • {@link Ext.grid.Column#groupable groupable}
        • - *
        • {@link Ext.grid.Column#groupName groupName}
        • - *
        • {@link Ext.grid.Column#groupRender groupRender}
        • - *
        - *

        Sample usage:

        - *
        
        -var grid = new Ext.grid.GridPanel({
        -    // A groupingStore is required for a GroupingView
        -    store: new {@link Ext.data.GroupingStore}({
        -        autoDestroy: true,
        -        reader: reader,
        -        data: xg.dummyData,
        -        sortInfo: {field: 'company', direction: 'ASC'},
        -        {@link Ext.data.GroupingStore#groupOnSort groupOnSort}: true,
        -        {@link Ext.data.GroupingStore#remoteGroup remoteGroup}: true,
        -        {@link Ext.data.GroupingStore#groupField groupField}: 'industry'
        -    }),
        -    colModel: new {@link Ext.grid.ColumnModel}({
        -        columns:[
        -            {id:'company',header: 'Company', width: 60, dataIndex: 'company'},
        -            // {@link Ext.grid.Column#groupable groupable}, {@link Ext.grid.Column#groupName groupName}, {@link Ext.grid.Column#groupRender groupRender} are also configurable at column level
        -            {header: 'Price', renderer: Ext.util.Format.usMoney, dataIndex: 'price', {@link Ext.grid.Column#groupable groupable}: false},
        -            {header: 'Change', dataIndex: 'change', renderer: Ext.util.Format.usMoney},
        -            {header: 'Industry', dataIndex: 'industry'},
        -            {header: 'Last Updated', renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
        -        ],
        -        defaults: {
        -            sortable: true,
        -            menuDisabled: false,
        -            width: 20
        -        }
        -    }),
        -
        -    view: new Ext.grid.GroupingView({
        -        {@link Ext.grid.GridView#forceFit forceFit}: true,
        -        // custom grouping text template to display the number of items per group
        -        {@link #groupTextTpl}: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
        -    }),
         
        -    frame:true,
        -    width: 700,
        -    height: 450,
        -    collapsible: true,
        -    animCollapse: false,
        -    title: 'Grouping Example',
        -    iconCls: 'icon-grid',
        -    renderTo: document.body
        -});
        - * 
        - * @constructor - * @param {Object} config - */ Ext.grid.GroupingView = Ext.extend(Ext.grid.GridView, { - /** - * @cfg {String} groupByText Text displayed in the grid header menu for grouping by a column - * (defaults to 'Group By This Field'). - */ + groupByText : 'Group By This Field', - /** - * @cfg {String} showGroupsText Text displayed in the grid header for enabling/disabling grouping - * (defaults to 'Show in Groups'). - */ + showGroupsText : 'Show in Groups', - /** - * @cfg {Boolean} hideGroupedColumn true to hide the column that is currently grouped (defaults to false) - */ + hideGroupedColumn : false, - /** - * @cfg {Boolean} showGroupName If true will display a prefix plus a ': ' before the group field value - * in the group header line. The prefix will consist of the {@link Ext.grid.Column#groupName groupName} - * (or the configured {@link Ext.grid.Column#header header} if not provided) configured in the - * {@link Ext.grid.Column} for each set of grouped rows (defaults to true). - */ + showGroupName : true, - /** - * @cfg {Boolean} startCollapsed true to start all groups collapsed (defaults to false) - */ + startCollapsed : false, - /** - * @cfg {Boolean} enableGrouping false to disable grouping functionality (defaults to true) - */ + enableGrouping : true, - /** - * @cfg {Boolean} enableGroupingMenu true to enable the grouping control in the column menu (defaults to true) - */ + enableGroupingMenu : true, - /** - * @cfg {Boolean} enableNoGroups true to allow the user to turn off grouping (defaults to true) - */ + enableNoGroups : true, - /** - * @cfg {String} emptyGroupText The text to display when there is an empty group value (defaults to '(None)'). - * May also be specified per column, see {@link Ext.grid.Column}.{@link Ext.grid.Column#emptyGroupText emptyGroupText}. - */ + emptyGroupText : '(None)', - /** - * @cfg {Boolean} ignoreAdd true to skip refreshing the view when new rows are added (defaults to false) - */ + ignoreAdd : false, - /** - * @cfg {String} groupTextTpl The template used to render the group header (defaults to '{text}'). - * This is used to format an object which contains the following properties: - *
          - *
        • group : String

          The rendered value of the group field. - * By default this is the unchanged value of the group field. If a {@link Ext.grid.Column#groupRenderer groupRenderer} - * is specified, it is the result of a call to that function.

        • - *
        • gvalue : Object

          The raw value of the group field.

        • - *
        • text : String

          The configured header (as described in {@link #showGroupName}) - * if {@link #showGroupName} is true) plus the rendered group field value.

        • - *
        • groupId : String

          A unique, generated ID which is applied to the - * View Element which contains the group.

        • - *
        • startRow : Number

          The row index of the Record which caused group change.

        • - *
        • rs : Array

          Contains a single element: The Record providing the data - * for the row which caused group change.

        • - *
        • cls : String

          The generated class name string to apply to the group header Element.

        • - *
        • style : String

          The inline style rules to apply to the group header Element.

        • - *

        - * See {@link Ext.XTemplate} for information on how to format data using a template. Possible usage:
        
        -var grid = new Ext.grid.GridPanel({
        -    ...
        -    view: new Ext.grid.GroupingView({
        -        groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
        -    }),
        -});
        -     * 
        - */ + groupTextTpl : '{text}', - /** - * @cfg {String} groupMode Indicates how to construct the group identifier. 'value' constructs the id using - * raw value, 'display' constructs the id using the rendered value. Defaults to 'value'. - */ + groupMode: 'value', - /** - * @cfg {Function} groupRenderer This property must be configured in the {@link Ext.grid.Column} for - * each column. - */ + - // private + initTemplates : function(){ Ext.grid.GroupingView.superclass.initTemplates.call(this); this.state = {}; @@ -73157,17 +47300,17 @@ var grid = new Ext.grid.GridPanel({ } }, - // private + findGroup : function(el){ return Ext.fly(el).up('.x-grid-group', this.mainBody.dom); }, - // private + getGroups : function(){ return this.hasRows() ? this.mainBody.dom.childNodes : []; }, - // private + onAdd : function(ds, records, index) { if (this.canGroup() && !this.ignoreAdd) { var ss = this.getScrollState(); @@ -73180,7 +47323,7 @@ var grid = new Ext.grid.GridPanel({ } }, - // private + onRemove : function(ds, record, index, isUpdate){ Ext.grid.GroupingView.superclass.onRemove.apply(this, arguments); var g = document.getElementById(record._groupId); @@ -73190,7 +47333,7 @@ var grid = new Ext.grid.GridPanel({ this.applyEmptyText(); }, - // private + refreshRow : function(record){ if(this.ds.getCount()==1){ this.refresh(); @@ -73201,7 +47344,7 @@ var grid = new Ext.grid.GridPanel({ } }, - // private + beforeMenuShow : function(){ var item, items = this.hmenu.items, disabled = this.cm.config[this.hdCtxIndex].groupable === false; if((item = items.get('groupBy'))){ @@ -73213,7 +47356,7 @@ var grid = new Ext.grid.GridPanel({ } }, - // private + renderUI : function(){ Ext.grid.GroupingView.superclass.renderUI.call(this); this.mainBody.on('mousedown', this.interceptMouse, this); @@ -73243,12 +47386,12 @@ var grid = new Ext.grid.GridPanel({ Ext.grid.GroupingView.superclass.processEvent.call(this, name, e); var hd = e.getTarget('.x-grid-group-hd', this.mainBody); if(hd){ - // group value is at the end of the string + var field = this.getGroupField(), prefix = this.getPrefix(field), groupValue = hd.id.substring(prefix.length); - // remove trailing '-hd' + groupValue = groupValue.substr(0, groupValue.length - 3); if(groupValue){ this.grid.fireEvent('group' + name, this.grid, field, groupValue, e); @@ -73257,16 +47400,16 @@ var grid = new Ext.grid.GridPanel({ }, - // private + onGroupByClick : function(){ this.enableGrouping = true; this.grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex)); this.grid.fireEvent('groupchange', this, this.grid.store.getGroupState()); - this.beforeMenuShow(); // Make sure the checkboxes get properly set when changing groups + this.beforeMenuShow(); this.refresh(); }, - // private + onShowGroupsClick : function(mi, checked){ this.enableGrouping = checked; if(checked){ @@ -73277,11 +47420,7 @@ var grid = new Ext.grid.GridPanel({ } }, - /** - * Toggle the group that contains the specific row. - * @param {Number} rowIndex The row inside the group - * @param {Boolean} expanded (optional) - */ + toggleRowIndex : function(rowIndex, expanded){ if(!this.canGroup()){ return; @@ -73292,11 +47431,7 @@ var grid = new Ext.grid.GridPanel({ } }, - /** - * Toggles the specified group if no value is passed, otherwise sets the expanded state of the group to the value passed. - * @param {String} groupId The groupId assigned to the group (see getGroupId) - * @param {Boolean} expanded (optional) - */ + toggleGroup : function(group, expanded){ var gel = Ext.get(group); expanded = Ext.isDefined(expanded) ? expanded : gel.hasClass('x-grid-group-collapsed'); @@ -73307,10 +47442,7 @@ var grid = new Ext.grid.GridPanel({ } }, - /** - * Toggles all groups if no value is passed, otherwise sets the expanded state of all groups to the value passed. - * @param {Boolean} expanded (optional) - */ + toggleAllGroups : function(expanded){ var groups = this.getGroups(); for(var i = 0, len = groups.length; i < len; i++){ @@ -73318,21 +47450,17 @@ var grid = new Ext.grid.GridPanel({ } }, - /** - * Expands all grouped rows. - */ + expandAllGroups : function(){ this.toggleAllGroups(true); }, - /** - * Collapses all grouped rows. - */ + collapseAllGroups : function(){ this.toggleAllGroups(false); }, - // private + interceptMouse : function(e){ var hd = e.getTarget('.x-grid-group-hd', this.mainBody); if(hd){ @@ -73341,7 +47469,7 @@ var grid = new Ext.grid.GridPanel({ } }, - // private + getGroup : function(v, r, groupRenderer, rowIndex, colIndex, ds){ var g = groupRenderer ? groupRenderer(v, {}, r, rowIndex, colIndex, ds) : String(v); if(g === '' || g === ' '){ @@ -73350,12 +47478,12 @@ var grid = new Ext.grid.GridPanel({ return g; }, - // private + getGroupField : function(){ return this.grid.store.getGroupState(); }, - // private + afterRender : function(){ if(!this.ds || !this.cm){ return; @@ -73366,11 +47494,11 @@ var grid = new Ext.grid.GridPanel({ } }, - // private + renderRows : function(){ var groupField = this.getGroupField(); var eg = !!groupField; - // if they turned off grouping and the last grouped field is hidden + if(this.hideGroupedColumn) { var colIndex = this.cm.findColumnIndex(groupField), hasLastGroupField = Ext.isDefined(this.lastGroupField); @@ -73393,7 +47521,7 @@ var grid = new Ext.grid.GridPanel({ this, arguments); }, - // private + doRender : function(cs, rs, ds, startRow, colCount, stripe){ if(rs.length < 1){ return ''; @@ -73421,8 +47549,8 @@ var grid = new Ext.grid.GridPanel({ g = this.getGroup(gvalue, r, groupRenderer, rowIndex, colIndex, ds); if(!curGroup || curGroup.group != g){ gid = this.constructId(gvalue, groupField, colIndex); - // if state is defined use it, however state is in terms of expanded - // so negate it, otherwise use the default. + + this.state[gid] = !(Ext.isDefined(this.state[gid]) ? !this.state[gid] : this.startCollapsed); curGroup = { group: g, @@ -73453,17 +47581,13 @@ var grid = new Ext.grid.GridPanel({ return buf.join(''); }, - /** - * Dynamically tries to determine the groupId of a specific value - * @param {String} value - * @return {String} The group id - */ + getGroupId : function(value){ var field = this.getGroupField(); return this.constructId(value, field, this.cm.findColumnIndex(field)); }, - // private + constructId : function(value, field, idx){ var cfg = this.cm.config[idx], groupRenderer = cfg.groupRenderer || cfg.renderer, @@ -73472,27 +47596,27 @@ var grid = new Ext.grid.GridPanel({ return this.getPrefix(field) + Ext.util.Format.htmlEncode(val); }, - // private + canGroup : function(){ return this.enableGrouping && !!this.getGroupField(); }, - // private + getPrefix: function(field){ return this.grid.getGridEl().id + '-gp-' + field + '-'; }, - // private + doGroupStart : function(buf, g, cs, ds, colCount){ buf[buf.length] = this.startGroup.apply(g); }, - // private + doGroupEnd : function(buf, g, cs, ds, colCount){ buf[buf.length] = this.endGroup; }, - // private + getRows : function(){ if(!this.canGroup()){ return Ext.grid.GroupingView.superclass.getRows.call(this); @@ -73516,7 +47640,7 @@ var grid = new Ext.grid.GridPanel({ return r; }, - // private + updateGroupWidths : function(){ if(!this.canGroup() || !this.hasRows()){ return; @@ -73528,33 +47652,33 @@ var grid = new Ext.grid.GridPanel({ } }, - // private + onColumnWidthUpdated : function(col, w, tw){ Ext.grid.GroupingView.superclass.onColumnWidthUpdated.call(this, col, w, tw); this.updateGroupWidths(); }, - // private + onAllColumnWidthsUpdated : function(ws, tw){ Ext.grid.GroupingView.superclass.onAllColumnWidthsUpdated.call(this, ws, tw); this.updateGroupWidths(); }, - // private + onColumnHiddenUpdated : function(col, hidden, tw){ Ext.grid.GroupingView.superclass.onColumnHiddenUpdated.call(this, col, hidden, tw); this.updateGroupWidths(); }, - // private + onLayout : function(){ this.updateGroupWidths(); }, - // private + onBeforeRowSelect : function(sm, rowIndex){ this.toggleRowIndex(rowIndex, true); } }); -// private -Ext.grid.GroupingView.GROUP_ID = 1000; \ No newline at end of file + +Ext.grid.GroupingView.GROUP_ID = 1000; diff --git a/ext-all.js b/ext-all.js index 86da440c..74c6e3ca 100644 --- a/ext-all.js +++ b/ext-all.js @@ -1,19 +1,11 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ -Ext.DomHelper=function(){var s=null,j=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,l=/^table|tbody|tr|td$/i,p,m="afterbegin",n="afterend",c="beforebegin",o="beforeend",a="
      
    ",h="
    ",b=a+"",i=""+h,k=b+"",r=""+i;function g(x,z,y,A,v,t){var u=p.insertHtml(A,Ext.getDom(x),q(z));return y?Ext.get(u,true):u}function q(A){var v="",u,z,y,t,B;if(Ext.isString(A)){v=A}else{if(Ext.isArray(A)){for(var x=0;x"}}}return v}function e(B,y,x,z){s.innerHTML=[y,x,z].join("");var t=-1,v=s,u;while(++t "'+z+'"'},insertBefore:function(t,v,u){return g(t,v,u,c)},insertAfter:function(t,v,u){return g(t,v,u,n,"nextSibling")},insertFirst:function(t,v,u){return g(t,v,u,m,"firstChild")},append:function(t,v,u){return g(t,v,u,o,"",true)},overwrite:function(t,v,u){t=Ext.getDom(t);t.innerHTML=q(v);return u?Ext.get(t.firstChild):t.firstChild},createHtml:q};return p}();Ext.apply(Ext.DomHelper,function(){var d,a="afterbegin",g="afterend",h="beforebegin",c="beforeend";function e(l,n,m,p,k,i){l=Ext.getDom(l);var j;if(d.useDom){j=b(n,null);if(i){l.appendChild(j)}else{(k=="firstChild"?l:l.parentNode).insertBefore(j,l[k]||l)}}else{j=Ext.DomHelper.insertHtml(p,l,Ext.DomHelper.createHtml(n))}return m?Ext.get(j,true):j}function b(p,j){var l,m=document,k,i,n,q;if(Ext.isArray(p)){l=m.createDocumentFragment();Ext.each(p,function(o){b(o,l)})}else{if(Ext.isString(p)){l=m.createTextNode(p)}else{l=m.createElement(p.tag||"div");k=!!l.setAttribute;Ext.iterate(p,function(o,r){if(!/tag|children|cn|html|style/.test(o)){if(o=="cls"){l.className=r}else{if(k){l.setAttribute(o,r)}else{l[o]=r}}}});Ext.DomHelper.applyStyles(l,p.style);if((q=p.children||p.cn)){b(q,l)}else{if(p.html){l.innerHTML=p.html}}}}if(j){j.appendChild(l)}return l}d={createTemplate:function(j){var i=Ext.DomHelper.createHtml(j);return new Ext.Template(i)},useDom:false,insertBefore:function(i,k,j){return e(i,k,j,h)},insertAfter:function(i,k,j){return e(i,k,j,g,"nextSibling")},insertFirst:function(i,k,j){return e(i,k,j,a,"firstChild")},append:function(i,k,j){return e(i,k,j,c,"",true)},createDom:b};return d}());Ext.Template=function(d){var e=this,b=arguments,c=[];if(Ext.isArray(d)){d=d.join("")}else{if(b.length>1){Ext.each(b,function(a){if(Ext.isObject(a)){Ext.apply(e,a)}else{c.push(a)}});d=c.join("")}}e.html=d;if(e.compiled){e.compile()}};Ext.Template.prototype={re:/\{([\w-]+)\}/g,applyTemplate:function(a){var b=this;return b.compiled?b.compiled(a):b.html.replace(b.re,function(c,d){return a[d]!==undefined?a[d]:""})},set:function(a,c){var b=this;b.html=a;b.compiled=null;return c?b.compile():b},compile:function(){var me=this,sep=Ext.isGecko?"+":",";function fn(m,name){name="values['"+name+"']";return"'"+sep+"("+name+" == undefined ? '' : "+name+")"+sep+"'"}eval("this.compiled = function(values){ return "+(Ext.isGecko?"'":"['")+me.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn)+(Ext.isGecko?"';};":"'].join('');};"));return me},insertFirst:function(b,a,c){return this.doInsert("afterBegin",b,a,c)},insertBefore:function(b,a,c){return this.doInsert("beforeBegin",b,a,c)},insertAfter:function(b,a,c){return this.doInsert("afterEnd",b,a,c)},append:function(b,a,c){return this.doInsert("beforeEnd",b,a,c)},doInsert:function(c,e,b,a){e=Ext.getDom(e);var d=Ext.DomHelper.insertHtml(c,e,this.applyTemplate(b));return a?Ext.get(d,true):d},overwrite:function(b,a,c){b=Ext.getDom(b);b.innerHTML=this.applyTemplate(a);return c?Ext.get(b.firstChild,true):b.firstChild}};Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.Template.from=function(b,a){b=Ext.getDom(b);return new Ext.Template(b.value||b.innerHTML,a||"")};Ext.apply(Ext.Template.prototype,{disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,applyTemplate:function(b){var g=this,a=g.disableFormats!==true,e=Ext.util.Format,c=g;if(g.compiled){return g.compiled(b)}function d(j,l,p,k){if(p&&a){if(p.substr(0,5)=="this."){return c.call(p.substr(5),b[l],b)}else{if(k){var o=/^\s*['"](.*)["']\s*$/;k=k.split(",");for(var n=0,h=k.length;n+~]\s?|\s|$)/,tagTokenRe=/^(#)?([\w-\*]+)/,nthRe=/(\d*)n\+?(\d*)/,nthRe2=/\D/,isIE=window.ActiveXObject?true:false,key=30803;eval("var batch = 30803;");function child(parent,index){var i=0,n=parent.firstChild;while(n){if(n.nodeType==1){if(++i==index){return n}}n=n.nextSibling}return null}function next(n){while((n=n.nextSibling)&&n.nodeType!=1){}return n}function prev(n){while((n=n.previousSibling)&&n.nodeType!=1){}return n}function children(parent){var n=parent.firstChild,nodeIndex=-1,nextNode;while(n){nextNode=n.nextSibling;if(n.nodeType==3&&!nonSpace.test(n.nodeValue)){parent.removeChild(n)}else{n.nodeIndex=++nodeIndex}n=nextNode}return this}function byClassName(nodeSet,cls){if(!cls){return nodeSet}var result=[],ri=-1;for(var i=0,ci;ci=nodeSet[i];i++){if((" "+ci.className+" ").indexOf(cls)!=-1){result[++ri]=ci}}return result}function attrValue(n,attr){if(!n.tagName&&typeof n.length!="undefined"){n=n[0]}if(!n){return null}if(attr=="for"){return n.htmlFor}if(attr=="class"||attr=="className"){return n.className}return n.getAttribute(attr)||n[attr]}function getNodes(ns,mode,tagName){var result=[],ri=-1,cs;if(!ns){return result}tagName=tagName||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns]}if(!mode){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(tagName);for(var j=0,ci;ci=cs[j];j++){result[++ri]=ci}}}else{if(mode=="/"||mode==">"){var utag=tagName.toUpperCase();for(var i=0,ni,cn;ni=ns[i];i++){cn=ni.childNodes;for(var j=0,cj;cj=cn[j];j++){if(cj.nodeName==utag||cj.nodeName==tagName||tagName=="*"){result[++ri]=cj}}}}else{if(mode=="+"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(n&&(n.nodeName==utag||n.nodeName==tagName||tagName=="*")){result[++ri]=n}}}else{if(mode=="~"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)){if(n.nodeName==utag||n.nodeName==tagName||tagName=="*"){result[++ri]=n}}}}}}}return result}function concat(a,b){if(b.slice){return a.concat(b)}for(var i=0,l=b.length;i1){return nodup(results)}return results},isXml:function(el){var docEl=(el?el.ownerDocument||el:0).documentElement;return docEl?docEl.nodeName!=="HTML":false},select:document.querySelectorAll?function(path,root,type){root=root||document;if(!Ext.DomQuery.isXml(root)){try{var cs=root.querySelectorAll(path);return Ext.toArray(cs)}catch(ex){}}return Ext.DomQuery.jsSelect.call(this,path,root,type)}:function(path,root,type){return Ext.DomQuery.jsSelect.call(this,path,root,type)},selectNode:function(path,root){return Ext.DomQuery.select(path,root)[0]},selectValue:function(path,root,defaultValue){path=path.replace(trimRe,"");if(!valueCache[path]){valueCache[path]=Ext.DomQuery.compile(path,"select")}var n=valueCache[path](root),v;n=n[0]?n[0]:n;if(typeof n.normalize=="function"){n.normalize()}v=(n&&n.firstChild?n.firstChild.nodeValue:null);return((v===null||v===undefined||v==="")?defaultValue:v)},selectNumber:function(path,root,defaultValue){var v=Ext.DomQuery.selectValue(path,root,defaultValue||0);return parseFloat(v)},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el)}var isArray=Ext.isArray(el),result=Ext.DomQuery.filter(isArray?el:[el],ss);return isArray?(result.length==el.length):(result.length>0)},filter:function(els,ss,nonMatches){ss=ss.replace(trimRe,"");if(!simpleCache[ss]){simpleCache[ss]=Ext.DomQuery.compile(ss,"simple")}var result=simpleCache[ss](els);return nonMatches?quickDiff(result,els):result},matchers:[{re:/^\.([\w-]+)/,select:'n = byClassName(n, " {1} ");'},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'},{re:/^#([\w-]+)/,select:'n = byId(n, "{1}");'},{re:/^@([\w-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,v){return a==v},"!=":function(a,v){return a!=v},"^=":function(a,v){return a&&a.substr(0,v.length)==v},"$=":function(a,v){return a&&a.substr(a.length-v.length)==v},"*=":function(a,v){return a&&a.indexOf(v)!==-1},"%=":function(a,v){return(a%v)==0},"|=":function(a,v){return a&&(a==v||a.substr(0,v.length+1)==v+"-")},"~=":function(a,v){return a&&(" "+a+" ").indexOf(" "+v+" ")!=-1}},pseudos:{"first-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"last-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"nth-child":function(c,a){var r=[],ri=-1,m=nthRe.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!nthRe2.test(a)&&"n+"+a||a),f=(m[1]||1)-0,l=m[2]-0;for(var i=0,n;n=c[i];i++){var pn=n.parentNode;if(batch!=pn._batch){var j=0;for(var cn=pn.firstChild;cn;cn=cn.nextSibling){if(cn.nodeType==1){cn.nodeIndex=++j}}pn._batch=batch}if(f==1){if(l==0||n.nodeIndex==l){r[++ri]=n}}else{if((n.nodeIndex+l)%f==0){r[++ri]=n}}}return r},"only-child":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(!prev(ci)&&!next(ci)){r[++ri]=ci}}return r},empty:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,empty=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){empty=false;break}}if(empty){r[++ri]=ci}}return r},contains:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if((ci.textContent||ci.innerText||"").indexOf(v)!=-1){r[++ri]=ci}}return r},nodeValue:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[++ri]=ci}}return r},checked:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[++ri]=ci}}return r},not:function(c,ss){return Ext.DomQuery.filter(c,ss,true)},any:function(c,selectors){var ss=selectors.split("|"),r=[],ri=-1,s;for(var i=0,ci;ci=c[i];i++){for(var j=0;s=ss[j];j++){if(Ext.DomQuery.is(ci,s)){r[++ri]=ci;break}}}return r},odd:function(c){return this["nth-child"](c,"odd")},even:function(c){return this["nth-child"](c,"even")},nth:function(c,a){return c[a-1]||[]},first:function(c){return c[0]||[]},last:function(c){return c[c.length-1]||[]},has:function(c,ss){var s=Ext.DomQuery.select,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[++ri]=ci}}return r},next:function(c,ss){var is=Ext.DomQuery.is,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=next(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r},prev:function(c,ss){var is=Ext.DomQuery.is,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=prev(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r}}}}();Ext.query=Ext.DomQuery.select;Ext.util.DelayedTask=function(d,c,a){var e=this,g,b=function(){clearInterval(g);g=null;d.apply(c,a||[])};e.delay=function(i,k,j,h){e.cancel();d=k||d;c=j||c;a=h||a;g=setInterval(b,i)};e.cancel=function(){if(g){clearInterval(g);g=null}}};(function(){var i=Ext.util,l=Ext.toArray,k=Ext.each,a=Ext.isObject,h=true,j=false;i.Observable=function(){var m=this,n=m.events;if(m.listeners){m.on(m.listeners);delete m.listeners}m.events=n||{}};i.Observable.prototype={filterOptRe:/^(?:scope|delay|buffer|single)$/,fireEvent:function(){var m=l(arguments),o=m[0].toLowerCase(),p=this,n=h,s=p.events[o],r,t;if(p.eventsSuspended===h){if(r=p.eventQueue){r.push(m)}}else{if(a(s)&&s.bubble){if(s.fire.apply(s,m.slice(1))===j){return j}t=p.getBubbleTarget&&p.getBubbleTarget();if(t&&t.enableBubble){if(!t.events[o]||!Ext.isObject(t.events[o])||!t.events[o].bubble){t.enableBubble(o)}return t.fireEvent.apply(t,m)}}else{if(a(s)){m.shift();n=s.fire.apply(s,m)}}}return n},addListener:function(p,s,u,n){var r=this,q,v,t,m;if(a(p)){n=p;for(q in n){v=n[q];if(!r.filterOptRe.test(q)){r.addListener(q,v.fn||v,v.scope||n.scope,v.fn?v:n)}}}else{p=p.toLowerCase();m=r.events[p]||h;if(Ext.isBoolean(m)){r.events[p]=m=new i.Event(r,p)}m.addListener(s,u,a(n)?n:{})}},removeListener:function(m,o,n){var p=this.events[m.toLowerCase()];if(a(p)){p.removeListener(o,n)}},purgeListeners:function(){var o=this.events,m,n;for(n in o){m=o[n];if(a(m)){m.clearListeners()}}},addEvents:function(q){var p=this;p.events=p.events||{};if(Ext.isString(q)){var m=arguments,n=m.length;while(n--){p.events[m[n]]=p.events[m[n]]||h}}else{Ext.applyIf(p.events,q)}},hasListener:function(m){var n=this.events[m.toLowerCase()];return a(n)&&n.listeners.length>0},suspendEvents:function(m){this.eventsSuspended=h;if(m&&!this.eventQueue){this.eventQueue=[]}},resumeEvents:function(){var m=this,n=m.eventQueue||[];m.eventsSuspended=j;delete m.eventQueue;k(n,function(o){m.fireEvent.apply(m,o)})}};var e=i.Observable.prototype;e.on=e.addListener;e.un=e.removeListener;i.Observable.releaseCapture=function(m){m.fireEvent=e.fireEvent};function g(n,p,m){return function(){if(p.target==arguments[0]){n.apply(m,l(arguments))}}}function c(p,q,m,n){m.task=new i.DelayedTask();return function(){m.task.delay(q.buffer,p,n,l(arguments))}}function d(o,p,n,m){return function(){p.removeListener(n,m);return o.apply(m,arguments)}}function b(p,q,m,n){return function(){var o=new i.DelayedTask();if(!m.tasks){m.tasks=[]}m.tasks.push(o);o.delay(q.delay||10,p,n,l(arguments))}}i.Event=function(n,m){this.name=m;this.obj=n;this.listeners=[]};i.Event.prototype={addListener:function(p,o,n){var q=this,m;o=o||q.obj;if(!q.isListening(p,o)){m=q.createListener(p,o,n);if(q.firing){q.listeners=q.listeners.slice(0)}q.listeners.push(m)}},createListener:function(q,p,r){r=r||{},p=p||this.obj;var m={fn:q,scope:p,options:r},n=q;if(r.target){n=g(n,r,p)}if(r.delay){n=b(n,r,m,p)}if(r.single){n=d(n,this,q,p)}if(r.buffer){n=c(n,r,m,p)}m.fireFn=n;return m},findListener:function(p,o){var q=this.listeners,n=q.length,m;o=o||this.obj;while(n--){m=q[n];if(m){if(m.fn==p&&m.scope==o){return n}}}return -1},isListening:function(n,m){return this.findListener(n,m)!=-1},removeListener:function(r,q){var p,m,n,s=this,o=j;if((p=s.findListener(r,q))!=-1){if(s.firing){s.listeners=s.listeners.slice(0)}m=s.listeners[p];if(m.task){m.task.cancel();delete m.task}n=m.tasks&&m.tasks.length;if(n){while(n--){m.tasks[n].cancel()}delete m.tasks}s.listeners.splice(p,1);o=h}return o},clearListeners:function(){var o=this,m=o.listeners,n=m.length;while(n--){o.removeListener(m[n].fn,m[n].scope)}},fire:function(){var r=this,o=l(arguments),q=r.listeners,m=q.length,p=0,n;if(m>0){r.firing=h;for(;p=525:!((Ext.isGecko&&!Ext.isWindows)||Ext.isOpera);return{doResizeEvent:function(){var l=a.getViewHeight(),k=a.getViewWidth();if(g!=l||h!=k){c.fire(h=k,g=l)}},onWindowResize:function(m,l,k){if(!c){c=new Ext.util.Event();j=new Ext.util.DelayedTask(this.doResizeEvent);Ext.EventManager.on(window,"resize",this.fireWindowResize,this)}c.addListener(m,l,k)},fireWindowResize:function(){if(c){j.delay(100)}},onTextResize:function(n,m,k){if(!e){e=new Ext.util.Event();var l=new Ext.Element(document.createElement("div"));l.dom.className="x-text-resize";l.dom.innerHTML="X";l.appendTo(document.body);b=l.dom.offsetHeight;setInterval(function(){if(l.dom.offsetHeight!=b){e.fire(b,b=l.dom.offsetHeight)}},this.textResizeInterval)}e.addListener(n,m,k)},removeResizeListener:function(l,k){if(c){c.removeListener(l,k)}},fireResize:function(){if(c){c.fire(a.getViewWidth(),a.getViewHeight())}},textResizeInterval:50,ieDeferSrc:false,useKeydown:d}}());Ext.EventManager.on=Ext.EventManager.addListener;Ext.apply(Ext.EventObjectImpl.prototype,{BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,RETURN:13,SHIFT:16,CTRL:17,CONTROL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGEUP:33,PAGE_DOWN:34,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,isNavKeyPress:function(){var b=this,a=this.normalizeKey(b.keyCode);return(a>=33&&a<=40)||a==b.RETURN||a==b.TAB||a==b.ESC},isSpecialKey:function(){var a=this.normalizeKey(this.keyCode);return(this.type=="keypress"&&this.ctrlKey)||this.isNavKeyPress()||(a==this.BACKSPACE)||(a>=16&&a<=20)||(a>=44&&a<=46)},getPoint:function(){return new Ext.lib.Point(this.xy[0],this.xy[1])},hasModifier:function(){return((this.ctrlKey||this.altKey)||this.shiftKey)}});(function(){var j=document;Ext.Element=function(o,p){var q=typeof o=="string"?j.getElementById(o):o,r;if(!q){return null}r=q.id;if(!p&&r&&Ext.elCache[r]){return Ext.elCache[r].el}this.dom=q;this.id=r||Ext.id(q)};var a=Ext.lib.Dom,g=Ext.DomHelper,m=Ext.lib.Event,e=Ext.lib.Anim,h=Ext.Element,b=Ext.elCache;h.prototype={set:function(t,q){var r=this.dom,p,s,q=(q!==false)&&!!r.setAttribute;for(p in t){if(t.hasOwnProperty(p)){s=t[p];if(p=="style"){g.applyStyles(r,s)}else{if(p=="cls"){r.className=s}else{if(q){r.setAttribute(p,s)}else{r[p]=s}}}}}return this},defaultUnit:"px",is:function(o){return Ext.DomQuery.is(this.dom,o)},focus:function(r,q){var o=this,q=q||o.dom;try{if(Number(r)){o.focus.defer(r,null,[null,q])}else{q.focus()}}catch(p){}return o},blur:function(){try{this.dom.blur()}catch(o){}return this},getValue:function(o){var p=this.dom.value;return o?parseInt(p,10):p},addListener:function(o,r,q,p){Ext.EventManager.on(this.dom,o,r,q||this,p);return this},removeListener:function(o,q,p){Ext.EventManager.removeListener(this.dom,o,q,p||this);return this},removeAllListeners:function(){Ext.EventManager.removeAll(this.dom);return this},purgeAllListeners:function(){Ext.EventManager.purgeElement(this,true);return this},addUnits:function(o){if(o===""||o=="auto"||o===undefined){o=o||""}else{if(!isNaN(o)||!k.test(o)){o=o+(this.defaultUnit||"px")}}return o},load:function(p,q,o){Ext.Ajax.request(Ext.apply({params:q,url:p.url||p,callback:o,el:this.dom,indicatorText:p.indicatorText||""},Ext.isObject(p)?p:{}));return this},isBorderBox:function(){return i[(this.dom.tagName||"").toLowerCase()]||Ext.isBorderBox},remove:function(){var o=this,p=o.dom;if(p){delete o.dom;Ext.removeNode(p)}},hover:function(p,o,r,q){var s=this;s.on("mouseenter",p,r||s.dom,q);s.on("mouseleave",o,r||s.dom,q);return s},contains:function(o){return !o?false:Ext.lib.Dom.isAncestor(this.dom,o.dom?o.dom:o)},getAttributeNS:function(p,o){return this.getAttribute(o,p)},getAttribute:Ext.isIE?function(o,q){var r=this.dom,p=typeof r[q+":"+o];if(["undefined","unknown"].indexOf(p)==-1){return r[q+":"+o]}return r[o]}:function(o,p){var q=this.dom;return q.getAttributeNS(p,o)||q.getAttribute(p+":"+o)||q.getAttribute(o)||q[o]},update:function(o){if(this.dom){this.dom.innerHTML=o}return this}};var n=h.prototype;h.addMethods=function(p){Ext.apply(n,p)};n.on=n.addListener;n.un=n.removeListener;n.autoBoxAdjust=true;var k=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i,d;h.get=function(p){var o,s,r;if(!p){return null}if(typeof p=="string"){if(!(s=j.getElementById(p))){return null}if(b[p]&&b[p].el){o=b[p].el;o.dom=s}else{o=h.addToCache(new h(s))}return o}else{if(p.tagName){if(!(r=p.id)){r=Ext.id(p)}if(b[r]&&b[r].el){o=b[r].el;o.dom=p}else{o=h.addToCache(new h(p))}return o}else{if(p instanceof h){if(p!=d){if(Ext.isIE&&(p.id==undefined||p.id=="")){p.dom=p.dom}else{p.dom=j.getElementById(p.id)||p.dom}}return p}else{if(p.isComposite){return p}else{if(Ext.isArray(p)){return h.select(p)}else{if(p==j){if(!d){var q=function(){};q.prototype=h.prototype;d=new q();d.dom=j}return d}}}}}}return null};h.addToCache=function(o,p){p=p||o.id;b[p]={el:o,data:{},events:{}};return o};h.data=function(p,o,q){p=h.get(p);if(!p){return null}var r=b[p.id].data;if(arguments.length==2){return r[o]}else{return(r[o]=q)}};function l(){if(!Ext.enableGarbageCollector){clearInterval(h.collectorThreadId)}else{var p,r,u,s;for(p in b){s=b[p];if(s.skipGC){continue}r=s.el;u=r.dom;if(!u||!u.parentNode||(!u.offsetParent&&!j.getElementById(p))){if(Ext.enableListenerCollection){Ext.EventManager.removeAll(u)}delete b[p]}}if(Ext.isIE){var q={};for(p in b){q[p]=b[p]}b=Ext.elCache=q}}}h.collectorThreadId=setInterval(l,30000);var c=function(){};c.prototype=h.prototype;h.Flyweight=function(o){this.dom=o};h.Flyweight.prototype=new c();h.Flyweight.prototype.isFlyweight=true;h._flyweights={};h.fly=function(q,o){var p=null;o=o||"_global";if(q=Ext.getDom(q)){(h._flyweights[o]=h._flyweights[o]||new h.Flyweight()).dom=q;p=h._flyweights[o]}return p};Ext.get=h.get;Ext.fly=h.fly;var i=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko){i.button=1}})();Ext.Element.addMethods({swallowEvent:function(a,b){var d=this;function c(g){g.stopPropagation();if(b){g.preventDefault()}}if(Ext.isArray(a)){Ext.each(a,function(g){d.on(g,c)});return d}d.on(a,c);return d},relayEvent:function(a,b){this.on(a,function(c){b.fireEvent(a,c)})},clean:function(b){var d=this,e=d.dom,g=e.firstChild,c=-1;if(Ext.Element.data(e,"isCleaned")&&b!==true){return d}while(g){var a=g.nextSibling;if(g.nodeType==3&&!/\S/.test(g.nodeValue)){e.removeChild(g)}else{g.nodeIndex=++c}g=a}Ext.Element.data(e,"isCleaned",true);return d},load:function(){var a=this.getUpdater();a.update.apply(a,arguments);return this},getUpdater:function(){return this.updateManager||(this.updateManager=new Ext.Updater(this))},update:function(html,loadScripts,callback){if(!this.dom){return this}html=html||"";if(loadScripts!==true){this.dom.innerHTML=html;if(Ext.isFunction(callback)){callback()}return this}var id=Ext.id(),dom=this.dom;html+='';Ext.lib.Event.onAvailable(id,function(){var DOC=document,hd=DOC.getElementsByTagName("head")[0],re=/(?:]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,srcRe=/\ssrc=([\'\"])(.*?)\1/i,typeRe=/\stype=([\'\"])(.*?)\1/i,match,attrs,srcMatch,typeMatch,el,s;while((match=re.exec(html))){attrs=match[1];srcMatch=attrs?attrs.match(srcRe):false;if(srcMatch&&srcMatch[2]){s=DOC.createElement("script");s.src=srcMatch[2];typeMatch=attrs.match(typeRe);if(typeMatch&&typeMatch[2]){s.type=typeMatch[2]}hd.appendChild(s)}else{if(match[2]&&match[2].length>0){if(window.execScript){window.execScript(match[2])}else{window.eval(match[2])}}}}el=DOC.getElementById(id);if(el){Ext.removeNode(el)}if(Ext.isFunction(callback)){callback()}});dom.innerHTML=html.replace(/(?:)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this},removeAllListeners:function(){this.removeAnchor();Ext.EventManager.removeAll(this.dom);return this},createProxy:function(a,e,d){a=Ext.isObject(a)?a:{tag:"div",cls:a};var c=this,b=e?Ext.DomHelper.append(e,a,true):Ext.DomHelper.insertBefore(c.dom,a,true);if(d&&c.setBox&&c.getBox){b.setBox(c.getBox())}return b}});Ext.Element.prototype.getUpdateManager=Ext.Element.prototype.getUpdater;Ext.Element.addMethods({getAnchorXY:function(e,l,q){e=(e||"tl").toLowerCase();q=q||{};var k=this,b=k.dom==document.body||k.dom==document,n=q.width||b?Ext.lib.Dom.getViewWidth():k.getWidth(),i=q.height||b?Ext.lib.Dom.getViewHeight():k.getHeight(),p,a=Math.round,c=k.getXY(),m=k.getScroll(),j=b?m.left:!l?c[0]:0,g=b?m.top:!l?c[1]:0,d={c:[a(n*0.5),a(i*0.5)],t:[a(n*0.5),0],l:[0,a(i*0.5)],r:[n,a(i*0.5)],b:[a(n*0.5),i],tl:[0,0],bl:[0,i],br:[n,i],tr:[n,0]};p=d[e];return[p[0]+j,p[1]+g]},anchorTo:function(b,h,c,a,k,l){var i=this,e=i.dom,j=!Ext.isEmpty(k),d=function(){Ext.fly(e).alignTo(b,h,c,a);Ext.callback(l,Ext.fly(e))},g=this.getAnchor();this.removeAnchor();Ext.apply(g,{fn:d,scroll:j});Ext.EventManager.onWindowResize(d,null);if(j){Ext.EventManager.on(window,"scroll",d,null,{buffer:!isNaN(k)?k:50})}d.call(i);return i},removeAnchor:function(){var b=this,a=this.getAnchor();if(a&&a.fn){Ext.EventManager.removeResizeListener(a.fn);if(a.scroll){Ext.EventManager.un(window,"scroll",a.fn)}delete a.fn}return b},getAnchor:function(){var b=Ext.Element.data,c=this.dom;if(!c){return}var a=b(c,"_anchor");if(!a){a=b(c,"_anchor",{})}return a},getAlignToXY:function(g,A,B){g=Ext.get(g);if(!g||!g.dom){throw"Element.alignToXY with an element that doesn't exist"}B=B||[0,0];A=(!A||A=="?"?"tl-bl?":(!/-/.test(A)&&A!==""?"tl-"+A:A||"tl-bl")).toLowerCase();var K=this,H=K.dom,M,L,n,l,s,F,v,t=Ext.lib.Dom.getViewWidth()-10,G=Ext.lib.Dom.getViewHeight()-10,b,i,j,k,u,z,N=document,J=N.documentElement,q=N.body,E=(J.scrollLeft||q.scrollLeft||0)+5,D=(J.scrollTop||q.scrollTop||0)+5,I=false,e="",a="",C=A.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!C){throw"Element.alignTo with an invalid alignment "+A}e=C[1];a=C[2];I=!!C[3];M=K.getAnchorXY(e,true);L=g.getAnchorXY(a,false);n=L[0]-M[0]+B[0];l=L[1]-M[1]+B[1];if(I){s=K.getWidth();F=K.getHeight();v=g.getRegion();b=e.charAt(0);i=e.charAt(e.length-1);j=a.charAt(0);k=a.charAt(a.length-1);u=((b=="t"&&j=="b")||(b=="b"&&j=="t"));z=((i=="r"&&k=="l")||(i=="l"&&k=="r"));if(n+s>t+E){n=z?v.left-s:t+E-s}if(nG+D){l=u?v.top-F:G+D-F}if(lA){o=A-p;l=true}if((n+B)>g){n=g-B;l=true}if(o "+g,this.dom);return h?i:a(i)},parent:function(g,h){return this.matchNode(d,d,g,h)},next:function(g,h){return this.matchNode(b,b,g,h)},prev:function(g,h){return this.matchNode(c,c,g,h)},first:function(g,h){return this.matchNode(b,"firstChild",g,h)},last:function(g,h){return this.matchNode(c,"lastChild",g,h)},matchNode:function(h,k,g,i){var j=this.dom[k];while(j){if(j.nodeType==1&&(!g||e.is(j,g))){return !i?a(j):j}j=j[h]}return null}}}());Ext.Element.addMethods({select:function(a,b){return Ext.Element.select(a,b,this.dom)}});Ext.Element.addMethods(function(){var c=Ext.getDom,a=Ext.get,b=Ext.DomHelper;return{appendChild:function(d){return a(d).appendTo(this)},appendTo:function(d){c(d).appendChild(this.dom);return this},insertBefore:function(d){(d=c(d)).parentNode.insertBefore(this.dom,d);return this},insertAfter:function(d){(d=c(d)).parentNode.insertBefore(this.dom,d.nextSibling);return this},insertFirst:function(e,d){e=e||{};if(e.nodeType||e.dom||typeof e=="string"){e=c(e);this.dom.insertBefore(e,this.dom.firstChild);return !d?a(e):e}else{return this.createChild(e,this.dom.firstChild,d)}},replace:function(d){d=a(d);this.insertBefore(d);d.remove();return this},replaceWith:function(d){var e=this;if(d.nodeType||d.dom||typeof d=="string"){d=c(d);e.dom.parentNode.insertBefore(d,e.dom)}else{d=b.insertBefore(e.dom,d)}delete Ext.elCache[e.id];Ext.removeNode(e.dom);e.id=Ext.id(e.dom=d);Ext.Element.addToCache(e.isFlyweight?new Ext.Element(e.dom):e);return e},createChild:function(e,d,g){e=e||{tag:"div"};return d?b.insertBefore(d,e,g!==true):b[!this.dom.firstChild?"overwrite":"append"](this.dom,e,g!==true)},wrap:function(d,e){var g=b.insertBefore(this.dom,d||{tag:"div"},!e);g.dom?g.dom.appendChild(this.dom):g.appendChild(this.dom);return g},insertHtml:function(e,g,d){var h=b.insertHtml(e,this.dom,g);return d?Ext.get(h):h}}}());Ext.apply(Ext.Element.prototype,function(){var c=Ext.getDom,a=Ext.get,b=Ext.DomHelper;return{insertSibling:function(i,g,h){var j=this,e,d=(g||"before").toLowerCase()=="after",k;if(Ext.isArray(i)){k=j;Ext.each(i,function(l){e=Ext.fly(k,"_internal").insertSibling(l,g,h);if(d){k=e}});return e}i=i||{};if(i.nodeType||i.dom){e=j.dom.parentNode.insertBefore(c(i),d?j.dom.nextSibling:j.dom);if(!h){e=a(e)}}else{if(d&&!j.dom.nextSibling){e=b.append(j.dom.parentNode,i,!h)}else{e=b[d?"insertAfter":"insertBefore"](j.dom,i,!h)}}return e}}}());Ext.Element.addMethods(function(){var h={},y=/(-[a-z])/gi,b={},s=document.defaultView,u=Ext.isIE?"styleFloat":"cssFloat",D=/alpha\(opacity=(.*)\)/i,l=/^\s+|\s+$/g,B=Ext.Element,d="padding",c="margin",z="border",t="-left",q="-right",x="-top",o="-bottom",j="-width",r=Math,A="hidden",e="isClipped",k="overflow",n="overflow-x",m="overflow-y",C="originalClip",i={l:z+t+j,r:z+q+j,t:z+x+j,b:z+o+j},g={l:d+t,r:d+q,t:d+x,b:d+o},a={l:c+t,r:c+q,t:c+x,b:c+o},E=Ext.Element.data;function p(F,G){return G.charAt(1).toUpperCase()}function v(F){return h[F]||(h[F]=F=="float"?u:F.replace(y,p))}return{adjustWidth:function(F){var G=this;var H=Ext.isNumber(F);if(H&&G.autoBoxAdjust&&!G.isBorderBox()){F-=(G.getBorderWidth("lr")+G.getPadding("lr"))}return(H&&F<0)?0:F},adjustHeight:function(F){var G=this;var H=Ext.isNumber(F);if(H&&G.autoBoxAdjust&&!G.isBorderBox()){F-=(G.getBorderWidth("tb")+G.getPadding("tb"))}return(H&&F<0)?0:F},addClass:function(I){var J=this,H,F,G;I=Ext.isArray(I)?I:[I];for(H=0,F=I.length;H5?H.toLowerCase():G)},setStyle:function(J,I){var G,H,F;if(!Ext.isObject(J)){G={};G[J]=I;J=G}for(H in J){I=J[H];H=="opacity"?this.setOpacity(I):this.dom.style[v(H)]=I}return this},setOpacity:function(G,F){var J=this,H=J.dom.style;if(!F||!J.anim){if(Ext.isIE){var I=G<1?"alpha(opacity="+G*100+")":"",K=H.filter.replace(D,"").replace(l,"");H.zoom=1;H.filter=K+(K.length>0?" ":"")+I}else{H.opacity=G}}else{J.anim({opacity:{to:G}},J.preanim(arguments,1),null,0.35,"easeIn")}return J},clearOpacity:function(){var F=this.dom.style;if(Ext.isIE){if(!Ext.isEmpty(F.filter)){F.filter=F.filter.replace(D,"").replace(l,"")}}else{F.opacity=F["-moz-opacity"]=F["-khtml-opacity"]=""}return this},getHeight:function(H){var G=this,J=G.dom,I=Ext.isIE&&G.isStyle("display","none"),F=r.max(J.offsetHeight,I?0:J.clientHeight)||0;F=!H?F:F-G.getBorderWidth("tb")-G.getPadding("tb");return F<0?0:F},getWidth:function(G){var H=this,J=H.dom,I=Ext.isIE&&H.isStyle("display","none"),F=r.max(J.offsetWidth,I?0:J.clientWidth)||0;F=!G?F:F-H.getBorderWidth("lr")-H.getPadding("lr");return F<0?0:F},setWidth:function(G,F){var H=this;G=H.adjustWidth(G);!F||!H.anim?H.dom.style.width=H.addUnits(G):H.anim({width:{to:G}},H.preanim(arguments,1));return H},setHeight:function(F,G){var H=this;F=H.adjustHeight(F);!G||!H.anim?H.dom.style.height=H.addUnits(F):H.anim({height:{to:F}},H.preanim(arguments,1));return H},getBorderWidth:function(F){return this.addStyles(F,i)},getPadding:function(F){return this.addStyles(F,g)},clip:function(){var F=this,G=F.dom;if(!E(G,e)){E(G,e,true);E(G,C,{o:F.getStyle(k),x:F.getStyle(n),y:F.getStyle(m)});F.setStyle(k,A);F.setStyle(n,A);F.setStyle(m,A)}return F},unclip:function(){var F=this,H=F.dom;if(E(H,e)){E(H,e,false);var G=E(H,C);if(G.o){F.setStyle(k,G.o)}if(G.x){F.setStyle(n,G.x)}if(G.y){F.setStyle(m,G.y)}}return F},addStyles:function(K,J){var L=0,G=K.match(/\w/g),I;for(var H=0,F=G.length;H"+String.format(Ext.Element.boxMarkup,c)+""));Ext.DomQuery.selectNode("."+c+"-mc",d.dom).appendChild(this.dom);return d},setSize:function(e,c,d){var g=this;if(Ext.isObject(e)){c=e.height;e=e.width}e=g.adjustWidth(e);c=g.adjustHeight(c);if(!d||!g.anim){g.dom.style.width=g.addUnits(e);g.dom.style.height=g.addUnits(c)}else{g.anim({width:{to:e},height:{to:c}},g.preanim(arguments,2))}return g},getComputedHeight:function(){var d=this,c=Math.max(d.dom.offsetHeight,d.dom.clientHeight);if(!c){c=parseFloat(d.getStyle("height"))||0;if(!d.isBorderBox()){c+=d.getFrameWidth("tb")}}return c},getComputedWidth:function(){var c=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!c){c=parseFloat(this.getStyle("width"))||0;if(!this.isBorderBox()){c+=this.getFrameWidth("lr")}}return c},getFrameWidth:function(d,c){return c&&this.isBorderBox()?0:(this.getPadding(d)+this.getBorderWidth(d))},addClassOnOver:function(c){this.hover(function(){Ext.fly(this,a).addClass(c)},function(){Ext.fly(this,a).removeClass(c)});return this},addClassOnFocus:function(c){this.on("focus",function(){Ext.fly(this,a).addClass(c)},this.dom);this.on("blur",function(){Ext.fly(this,a).removeClass(c)},this.dom);return this},addClassOnClick:function(c){var d=this.dom;this.on("mousedown",function(){Ext.fly(d,a).addClass(c);var g=Ext.getDoc(),e=function(){Ext.fly(d,a).removeClass(c);g.removeListener("mouseup",e)};g.on("mouseup",e)});return this},getViewSize:function(){var g=document,h=this.dom,c=(h==g||h==g.body);if(c){var e=Ext.lib.Dom;return{width:e.getViewWidth(),height:e.getViewHeight()}}else{return{width:h.clientWidth,height:h.clientHeight}}},getStyleSize:function(){var j=this,c,i,l=document,m=this.dom,e=(m==l||m==l.body),g=m.style;if(e){var k=Ext.lib.Dom;return{width:k.getViewWidth(),height:k.getViewHeight()}}if(g.width&&g.width!="auto"){c=parseFloat(g.width);if(j.isBorderBox()){c-=j.getFrameWidth("lr")}}if(g.height&&g.height!="auto"){i=parseFloat(g.height);if(j.isBorderBox()){i-=j.getFrameWidth("tb")}}return{width:c||j.getWidth(true),height:i||j.getHeight(true)}},getSize:function(c){return{width:this.getWidth(c),height:this.getHeight(c)}},repaint:function(){var c=this.dom;this.addClass("x-repaint");setTimeout(function(){Ext.fly(c).removeClass("x-repaint")},1);return this},unselectable:function(){this.dom.unselectable="on";return this.swallowEvent("selectstart",true).applyStyles("-moz-user-select:none;-khtml-user-select:none;").addClass("x-unselectable")},getMargins:function(d){var e=this,c,g={t:"top",l:"left",r:"right",b:"bottom"},h={};if(!d){for(c in e.margins){h[g[c]]=parseFloat(e.getStyle(e.margins[c]))||0}return h}else{return e.addStyles.call(e,d,e.margins)}}}}());(function(){var a=Ext.lib.Dom,b="left",g="right",d="top",i="bottom",h="position",c="static",e="relative",j="auto",k="z-index";Ext.Element.addMethods({getX:function(){return a.getX(this.dom)},getY:function(){return a.getY(this.dom)},getXY:function(){return a.getXY(this.dom)},getOffsetsTo:function(l){var n=this.getXY(),m=Ext.fly(l,"_internal").getXY();return[n[0]-m[0],n[1]-m[1]]},setX:function(l,m){return this.setXY([l,this.getY()],this.animTest(arguments,m,1))},setY:function(m,l){return this.setXY([this.getX(),m],this.animTest(arguments,l,1))},setLeft:function(l){this.setStyle(b,this.addUnits(l));return this},setTop:function(l){this.setStyle(d,this.addUnits(l));return this},setRight:function(l){this.setStyle(g,this.addUnits(l));return this},setBottom:function(l){this.setStyle(i,this.addUnits(l));return this},setXY:function(n,l){var m=this;if(!l||!m.anim){a.setXY(m.dom,n)}else{m.anim({points:{to:n}},m.preanim(arguments,1),"motion")}return m},setLocation:function(l,n,m){return this.setXY([l,n],this.animTest(arguments,m,2))},moveTo:function(l,n,m){return this.setXY([l,n],this.animTest(arguments,m,2))},getLeft:function(l){return !l?this.getX():parseInt(this.getStyle(b),10)||0},getRight:function(l){var m=this;return !l?m.getX()+m.getWidth():(m.getLeft(true)+m.getWidth())||0},getTop:function(l){return !l?this.getY():parseInt(this.getStyle(d),10)||0},getBottom:function(l){var m=this;return !l?m.getY()+m.getHeight():(m.getTop(true)+m.getHeight())||0},position:function(p,o,l,n){var m=this;if(!p&&m.isStyle(h,c)){m.setStyle(h,e)}else{if(p){m.setStyle(h,p)}}if(o){m.setStyle(k,o)}if(l||n){m.setXY([l||false,n||false])}},clearPositioning:function(l){l=l||"";this.setStyle({left:l,right:l,top:l,bottom:l,"z-index":"",position:c});return this},getPositioning:function(){var m=this.getStyle(b);var n=this.getStyle(d);return{position:this.getStyle(h),left:m,right:m?"":this.getStyle(g),top:n,bottom:n?"":this.getStyle(i),"z-index":this.getStyle(k)}},setPositioning:function(l){var n=this,m=n.dom.style;n.setStyle(l);if(l.right==j){m.right=""}if(l.bottom==j){m.bottom=""}return n},translatePoints:function(m,u){u=isNaN(m[1])?u:m[1];m=isNaN(m[0])?m:m[0];var q=this,r=q.isStyle(h,e),s=q.getXY(),n=parseInt(q.getStyle(b),10),p=parseInt(q.getStyle(d),10);n=!isNaN(n)?n:(r?0:q.dom.offsetLeft);p=!isNaN(p)?p:(r?0:q.dom.offsetTop);return{left:(m-s[0]+n),top:(u-s[1]+p)}},animTest:function(m,l,n){return !!l&&this.preanim?this.preanim(m,n):false}})})();Ext.Element.addMethods({setBox:function(e,g,b){var d=this,a=e.width,c=e.height;if((g&&!d.autoBoxAdjust)&&!d.isBorderBox()){a-=(d.getBorderWidth("lr")+d.getPadding("lr"));c-=(d.getBorderWidth("tb")+d.getPadding("tb"))}d.setBounds(e.x,e.y,a,c,d.animTest.call(d,arguments,b,2));return d},getBox:function(j,p){var m=this,v,e,o,d=m.getBorderWidth,q=m.getPadding,g,a,u,n;if(!p){v=m.getXY()}else{e=parseInt(m.getStyle("left"),10)||0;o=parseInt(m.getStyle("top"),10)||0;v=[e,o]}var c=m.dom,s=c.offsetWidth,i=c.offsetHeight,k;if(!j){k={x:v[0],y:v[1],0:v[0],1:v[1],width:s,height:i}}else{g=d.call(m,"l")+q.call(m,"l");a=d.call(m,"r")+q.call(m,"r");u=d.call(m,"t")+q.call(m,"t");n=d.call(m,"b")+q.call(m,"b");k={x:v[0]+g,y:v[1]+u,0:v[0]+g,1:v[1]+u,width:s-(g+a),height:i-(u+n)}}k.right=k.x+k.width;k.bottom=k.y+k.height;return k},move:function(j,b,c){var g=this,m=g.getXY(),k=m[0],i=m[1],d=[k-b,i],l=[k+b,i],h=[k,i-b],a=[k,i+b],e={l:d,left:d,r:l,right:l,t:h,top:h,up:h,b:a,bottom:a,down:a};j=j.toLowerCase();g.moveTo(e[j][0],e[j][1],g.animTest.call(g,arguments,c,2))},setLeftTop:function(d,c){var b=this,a=b.dom.style;a.left=b.addUnits(d);a.top=b.addUnits(c);return b},getRegion:function(){return Ext.lib.Dom.getRegion(this.dom)},setBounds:function(b,g,d,a,c){var e=this;if(!c||!e.anim){e.setSize(d,a);e.setLocation(b,g)}else{e.anim({points:{to:[b,g]},width:{to:e.adjustWidth(d)},height:{to:e.adjustHeight(a)}},e.preanim(arguments,4),"motion")}return e},setRegion:function(b,a){return this.setBounds(b.left,b.top,b.right-b.left,b.bottom-b.top,this.animTest.call(this,arguments,a,1))}});Ext.Element.addMethods({isScrollable:function(){var a=this.dom;return a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth},scrollTo:function(a,b){this.dom["scroll"+(/top/i.test(a)?"Top":"Left")]=b;return this},getScroll:function(){var i=this.dom,h=document,a=h.body,c=h.documentElement,b,g,e;if(i==h||i==a){if(Ext.isIE&&Ext.isStrict){b=c.scrollLeft;g=c.scrollTop}else{b=window.pageXOffset;g=window.pageYOffset}e={left:b||(a?a.scrollLeft:0),top:g||(a?a.scrollTop:0)}}else{e={left:i.scrollLeft,top:i.scrollTop}}return e}});Ext.Element.addMethods({scrollTo:function(b,d,a){var e=/top/i.test(b),c=this,g=c.dom,h;if(!a||!c.anim){h="scroll"+(e?"Top":"Left"),g[h]=d}else{h="scroll"+(e?"Left":"Top"),c.anim({scroll:{to:e?[g[h],d]:[d,g[h]]}},c.preanim(arguments,2),"scroll")}return c},scrollIntoView:function(e,i){var p=Ext.getDom(e)||Ext.getBody().dom,h=this.dom,g=this.getOffsetsTo(p),k=g[0]+p.scrollLeft,u=g[1]+p.scrollTop,q=u+h.offsetHeight,d=k+h.offsetWidth,a=p.clientHeight,m=parseInt(p.scrollTop,10),s=parseInt(p.scrollLeft,10),j=m+a,n=s+p.clientWidth;if(h.offsetHeight>a||uj){p.scrollTop=q-a}}p.scrollTop=p.scrollTop;if(i!==false){if(h.offsetWidth>p.clientWidth||kn){p.scrollLeft=d-p.clientWidth}}p.scrollLeft=p.scrollLeft}return this},scrollChildIntoView:function(b,a){Ext.fly(b,"_scrollChildIntoView").scrollIntoView(this,a)},scroll:function(m,b,d){if(!this.isScrollable()){return}var e=this.dom,g=e.scrollLeft,p=e.scrollTop,n=e.scrollWidth,k=e.scrollHeight,i=e.clientWidth,a=e.clientHeight,c=false,o,j={l:Math.min(g+b,n-i),r:o=Math.max(g-b,0),t:Math.max(p-b,0),b:Math.min(p+b,k-a)};j.d=j.b;j.u=j.t;m=m.substr(0,1);if((o=j[m])>-1){c=true;this.scrollTo(m=="l"||m=="r"?"left":"top",o,this.preanim(arguments,2))}return c}});Ext.Element.VISIBILITY=1;Ext.Element.DISPLAY=2;Ext.Element.addMethods(function(){var h="visibility",d="display",b="hidden",k="offsets",j="none",a="originalDisplay",c="visibilityMode",e=Ext.Element.DISPLAY,g=Ext.Element.data,i=function(n){var m=g(n,a);if(m===undefined){g(n,a,m="")}return m},l=function(o){var n=g(o,c);if(n===undefined){g(o,c,n=1)}return n};return{originalDisplay:"",visibilityMode:1,setVisibilityMode:function(m){g(this.dom,c,m);return this},animate:function(n,p,o,q,m){this.anim(n,{duration:p,callback:o,easing:q},m);return this},anim:function(p,q,n,s,o,m){n=n||"run";q=q||{};var r=this,t=Ext.lib.Anim[n](r.dom,p,(q.duration||s)||0.35,(q.easing||o)||"easeOut",function(){if(m){m.call(r)}if(q.callback){q.callback.call(q.scope||r,r,q)}},r);q.anim=t;return t},preanim:function(m,n){return !m[n]?false:(Ext.isObject(m[n])?m[n]:{duration:m[n+1],callback:m[n+2],easing:m[n+3]})},isVisible:function(){return !this.isStyle(h,b)&&!this.isStyle(d,j)},setVisible:function(r,o){var p=this,n,m,s,q=p.dom;if(Ext.isString(o)){n=o==d;m=o==h;s=o==k;o=false}else{n=l(this.dom)==e;m=!n}if(!o||!p.anim){if(n){p.setDisplayed(r)}else{if(s){if(!r){p.hideModeStyles={position:p.getStyle("position"),top:p.getStyle("top"),left:p.getStyle("left")};p.applyStyles({position:"absolute",top:"-10000px",left:"-10000px"})}else{p.applyStyles(p.hideModeStyles||{position:"",top:"",left:""})}}else{p.fixDisplay();q.style.visibility=r?"visible":b}}}else{if(r){p.setOpacity(0.01);p.setVisible(true)}p.anim({opacity:{to:(r?1:0)}},p.preanim(arguments,1),null,0.35,"easeIn",function(){if(!r){q.style[n?d:h]=(n)?j:b;Ext.fly(q).setOpacity(1)}})}return p},toggle:function(m){var n=this;n.setVisible(!n.isVisible(),n.preanim(arguments,0));return n},setDisplayed:function(m){if(typeof m=="boolean"){m=m?i(this.dom):j}this.setStyle(d,m);return this},fixDisplay:function(){var m=this;if(m.isStyle(d,j)){m.setStyle(h,b);m.setStyle(d,i(this.dom));if(m.isStyle(d,j)){m.setStyle(d,"block")}}},hide:function(m){if(Ext.isString(m)){this.setVisible(false,m);return this}this.setVisible(false,this.preanim(arguments,0));return this},show:function(m){if(Ext.isString(m)){this.setVisible(true,m);return this}this.setVisible(true,this.preanim(arguments,0));return this}}}());Ext.Element.addMethods(function(){var d="visibility",b="display",a="hidden",h="none",c="x-masked",g="x-masked-relative",e=Ext.Element.data;return{isVisible:function(i){var j=!this.isStyle(d,a)&&!this.isStyle(b,h),k=this.dom.parentNode;if(i!==true||!j){return j}while(k&&!/^body/i.test(k.tagName)){if(!Ext.fly(k,"_isVisible").isVisible()){return false}k=k.parentNode}return true},isDisplayed:function(){return !this.isStyle(b,h)},enableDisplayMode:function(i){this.setVisibilityMode(Ext.Element.DISPLAY);if(!Ext.isEmpty(i)){e(this.dom,"originalDisplay",i)}return this},mask:function(j,n){var p=this,l=p.dom,o=Ext.DomHelper,m="ext-el-mask-msg",i,q;if(!/^body/i.test(l.tagName)&&p.getStyle("position")=="static"){p.addClass(g)}if((i=e(l,"maskMsg"))){i.remove()}if((i=e(l,"mask"))){i.remove()}q=o.append(l,{cls:"ext-el-mask"},true);e(l,"mask",q);p.addClass(c);q.setDisplayed(true);if(typeof j=="string"){var k=o.append(l,{cls:m,cn:{tag:"div"}},true);e(l,"maskMsg",k);k.dom.className=n?m+" "+n:m;k.dom.firstChild.innerHTML=j;k.setDisplayed(true);k.center(p)}if(Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&p.getStyle("height")=="auto"){q.setSize(undefined,p.getHeight())}return q},unmask:function(){var k=this,l=k.dom,i=e(l,"mask"),j=e(l,"maskMsg");if(i){if(j){j.remove();e(l,"maskMsg",undefined)}i.remove();e(l,"mask",undefined)}k.removeClass([c,g])},isMasked:function(){var i=e(this.dom,"mask");return i&&i.isVisible()},createShim:function(){var i=document.createElement("iframe"),j;i.frameBorder="0";i.className="ext-shim";i.src=Ext.SSL_SECURE_URL;j=Ext.get(this.dom.parentNode.insertBefore(i,this.dom));j.autoBoxAdjust=false;return j}}}());Ext.Element.addMethods({addKeyListener:function(b,d,c){var a;if(!Ext.isObject(b)||Ext.isArray(b)){a={key:b,fn:d,scope:c}}else{a={key:b.key,shift:b.shift,ctrl:b.ctrl,alt:b.alt,fn:d,scope:c}}return new Ext.KeyMap(this,a)},addKeyMap:function(a){return new Ext.KeyMap(this,a)}});(function(){var z=null,B=undefined,k=true,t=false,j="setX",h="setY",a="setXY",n="left",l="bottom",s="top",m="right",q="height",g="width",i="points",x="hidden",A="absolute",u="visible",e="motion",o="position",r="easeOut",d=new Ext.Element.Flyweight(),v={},y=function(C){return C||{}},p=function(C){d.dom=C;d.id=Ext.id(C);return d},c=function(C){if(!v[C]){v[C]=[]}return v[C]},b=function(D,C){v[D]=C};Ext.enableFx=k;Ext.Fx={switchStatements:function(D,E,C){return E.apply(this,C[D])},slideIn:function(I,F){F=y(F);var K=this,H=K.dom,N=H.style,P,C,M,E,D,N,J,O,L,G;I=I||"t";K.queueFx(F,function(){P=p(H).getXY();p(H).fixDisplay();C=p(H).getFxRestore();M={x:P[0],y:P[1],0:P[0],1:P[1],width:H.offsetWidth,height:H.offsetHeight};M.right=M.x+M.width;M.bottom=M.y+M.height;p(H).setWidth(M.width).setHeight(M.height);E=p(H).fxWrap(C.pos,F,x);N.visibility=u;N.position=A;function Q(){p(H).fxUnwrap(E,C.pos,F);N.width=C.width;N.height=C.height;p(H).afterFx(F)}O={to:[M.x,M.y]};L={to:M.width};G={to:M.height};function R(V,S,W,T,Y,aa,ad,ac,ab,X,U){var Z={};p(V).setWidth(W).setHeight(T);if(p(V)[Y]){p(V)[Y](aa)}S[ad]=S[ac]="0";if(ab){Z.width=ab}if(X){Z.height=X}if(U){Z.points=U}return Z}J=p(H).switchStatements(I.toLowerCase(),R,{t:[E,N,M.width,0,z,z,n,l,z,G,z],l:[E,N,0,M.height,z,z,m,s,L,z,z],r:[E,N,M.width,M.height,j,M.right,n,s,z,z,O],b:[E,N,M.width,M.height,h,M.bottom,n,s,z,G,O],tl:[E,N,0,0,z,z,m,l,L,G,O],bl:[E,N,0,0,h,M.y+M.height,m,s,L,G,O],br:[E,N,0,0,a,[M.right,M.bottom],n,s,L,G,O],tr:[E,N,0,0,j,M.x+M.width,n,l,L,G,O]});N.visibility=u;p(E).show();arguments.callee.anim=p(E).fxanim(J,F,e,0.5,r,Q)});return K},slideOut:function(G,E){E=y(E);var I=this,F=I.dom,L=F.style,M=I.getXY(),D,C,J,K,H={to:0};G=G||"t";I.queueFx(E,function(){C=p(F).getFxRestore();J={x:M[0],y:M[1],0:M[0],1:M[1],width:F.offsetWidth,height:F.offsetHeight};J.right=J.x+J.width;J.bottom=J.y+J.height;p(F).setWidth(J.width).setHeight(J.height);D=p(F).fxWrap(C.pos,E,u);L.visibility=u;L.position=A;p(D).setWidth(J.width).setHeight(J.height);function N(){E.useDisplay?p(F).setDisplayed(t):p(F).hide();p(F).fxUnwrap(D,C.pos,E);L.width=C.width;L.height=C.height;p(F).afterFx(E)}function O(P,X,V,Y,T,W,S,U,R){var Q={};P[X]=P[V]="0";Q[Y]=T;if(W){Q[W]=S}if(U){Q[U]=R}return Q}K=p(F).switchStatements(G.toLowerCase(),O,{t:[L,n,l,q,H],l:[L,m,s,g,H],r:[L,n,s,g,H,i,{to:[J.right,J.y]}],b:[L,n,s,q,H,i,{to:[J.x,J.bottom]}],tl:[L,m,l,g,H,q,H],bl:[L,m,s,g,H,q,H,i,{to:[J.x,J.bottom]}],br:[L,n,s,g,H,q,H,i,{to:[J.x+J.width,J.bottom]}],tr:[L,n,l,g,H,q,H,i,{to:[J.right,J.y]}]});arguments.callee.anim=p(D).fxanim(K,E,e,0.5,r,N)});return I},puff:function(I){I=y(I);var G=this,H=G.dom,D=H.style,E,C,F;G.queueFx(I,function(){E=p(H).getWidth();C=p(H).getHeight();p(H).clearOpacity();p(H).show();F=p(H).getFxRestore();function J(){I.useDisplay?p(H).setDisplayed(t):p(H).hide();p(H).clearOpacity();p(H).setPositioning(F.pos);D.width=F.width;D.height=F.height;D.fontSize="";p(H).afterFx(I)}arguments.callee.anim=p(H).fxanim({width:{to:p(H).adjustWidth(E*2)},height:{to:p(H).adjustHeight(C*2)},points:{by:[-E*0.5,-C*0.5]},opacity:{to:0},fontSize:{to:200,unit:"%"}},I,e,0.5,r,J)});return G},switchOff:function(G){G=y(G);var E=this,F=E.dom,C=F.style,D;E.queueFx(G,function(){p(F).clearOpacity();p(F).clip();D=p(F).getFxRestore();function H(){G.useDisplay?p(F).setDisplayed(t):p(F).hide();p(F).clearOpacity();p(F).setPositioning(D.pos);C.width=D.width;C.height=D.height;p(F).afterFx(G)}p(F).fxanim({opacity:{to:0.3}},z,z,0.1,z,function(){p(F).clearOpacity();(function(){p(F).fxanim({height:{to:1},points:{by:[0,p(F).getHeight()*0.5]}},G,e,0.3,"easeIn",H)}).defer(100)})});return E},highlight:function(E,I){I=y(I);var G=this,H=G.dom,C=I.attr||"backgroundColor",D={},F;G.queueFx(I,function(){p(H).clearOpacity();p(H).show();function J(){H.style[C]=F;p(H).afterFx(I)}F=H.style[C];D[C]={from:E||"ffff9c",to:I.endColor||p(H).getColor(C)||"ffffff"};arguments.callee.anim=p(H).fxanim(D,I,"color",1,"easeIn",J)});return G},frame:function(C,F,I){I=y(I);var E=this,H=E.dom,D,G;E.queueFx(I,function(){C=C||"#C3DAF9";if(C.length==6){C="#"+C}F=F||1;p(H).show();var M=p(H).getXY(),K={x:M[0],y:M[1],0:M[0],1:M[1],width:H.offsetWidth,height:H.offsetHeight},J=function(){D=p(document.body||document.documentElement).createChild({style:{position:A,"z-index":35000,border:"0px solid "+C}});return D.queueFx({},L)};arguments.callee.anim={isAnimated:true,stop:function(){F=0;D.stopFx()}};function L(){var N=Ext.isBorderBox?2:1;G=D.anim({top:{from:K.y,to:K.y-20},left:{from:K.x,to:K.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:K.height,to:K.height+20*N},width:{from:K.width,to:K.width+20*N}},{duration:I.duration||1,callback:function(){D.remove();--F>0?J():p(H).afterFx(I)}});arguments.callee.anim={isAnimated:true,stop:function(){G.stop()}}}J()});return E},pause:function(E){var D=this.dom,C;this.queueFx({},function(){C=setTimeout(function(){p(D).afterFx({})},E*1000);arguments.callee.anim={isAnimated:true,stop:function(){clearTimeout(C);p(D).afterFx({})}}});return this},fadeIn:function(E){E=y(E);var C=this,D=C.dom,F=E.endOpacity||1;C.queueFx(E,function(){p(D).setOpacity(0);p(D).fixDisplay();D.style.visibility=u;arguments.callee.anim=p(D).fxanim({opacity:{to:F}},E,z,0.5,r,function(){if(F==1){p(D).clearOpacity()}p(D).afterFx(E)})});return C},fadeOut:function(F){F=y(F);var D=this,E=D.dom,C=E.style,G=F.endOpacity||0;D.queueFx(F,function(){arguments.callee.anim=p(E).fxanim({opacity:{to:G}},F,z,0.5,r,function(){if(G==0){Ext.Element.data(E,"visibilityMode")==Ext.Element.DISPLAY||F.useDisplay?C.display="none":C.visibility=x;p(E).clearOpacity()}p(E).afterFx(F)})});return D},scale:function(C,D,E){this.shift(Ext.apply({},E,{width:C,height:D}));return this},shift:function(E){E=y(E);var D=this.dom,C={};this.queueFx(E,function(){for(var F in E){if(E[F]!=B){C[F]={to:E[F]}}}C.width?C.width.to=p(D).adjustWidth(E.width):C;C.height?C.height.to=p(D).adjustWidth(E.height):C;if(C.x||C.y||C.xy){C.points=C.xy||{to:[C.x?C.x.to:p(D).getX(),C.y?C.y.to:p(D).getY()]}}arguments.callee.anim=p(D).fxanim(C,E,e,0.35,r,function(){p(D).afterFx(E)})});return this},ghost:function(F,D){D=y(D);var H=this,E=H.dom,K=E.style,I={opacity:{to:0},points:{}},L=I.points,C,J,G;F=F||"b";H.queueFx(D,function(){C=p(E).getFxRestore();J=p(E).getWidth();G=p(E).getHeight();function M(){D.useDisplay?p(E).setDisplayed(t):p(E).hide();p(E).clearOpacity();p(E).setPositioning(C.pos);K.width=C.width;K.height=C.height;p(E).afterFx(D)}L.by=p(E).switchStatements(F.toLowerCase(),function(O,N){return[O,N]},{t:[0,-G],l:[-J,0],r:[J,0],b:[0,G],tl:[-J,-G],bl:[-J,G],br:[J,G],tr:[J,-G]});arguments.callee.anim=p(E).fxanim(I,D,e,0.5,r,M)});return H},syncFx:function(){var C=this;C.fxDefaults=Ext.apply(C.fxDefaults||{},{block:t,concurrent:k,stopFx:t});return C},sequenceFx:function(){var C=this;C.fxDefaults=Ext.apply(C.fxDefaults||{},{block:t,concurrent:t,stopFx:t});return C},nextFx:function(){var C=c(this.dom.id)[0];if(C){C.call(this)}},hasActiveFx:function(){return c(this.dom.id)[0]},stopFx:function(C){var D=this,F=D.dom.id;if(D.hasActiveFx()){var E=c(F)[0];if(E&&E.anim){if(E.anim.isAnimated){b(F,[E]);E.anim.stop(C!==undefined?C:k)}else{b(F,[])}}}return D},beforeFx:function(C){if(this.hasActiveFx()&&!C.concurrent){if(C.stopFx){this.stopFx();return k}return t}return k},hasFxBlock:function(){var C=c(this.dom.id);return C&&C[0]&&C[0].block},queueFx:function(F,C){var D=p(this.dom);if(!D.hasFxBlock()){Ext.applyIf(F,D.fxDefaults);if(!F.concurrent){var E=D.beforeFx(F);C.block=F.block;c(D.dom.id).push(C);if(E){D.nextFx()}}else{C.call(D)}}return D},fxWrap:function(I,G,E){var F=this.dom,D,C;if(!G.wrap||!(D=Ext.getDom(G.wrap))){if(G.fixPosition){C=p(F).getXY()}var H=document.createElement("div");H.style.visibility=E;D=F.parentNode.insertBefore(H,F);p(D).setPositioning(I);if(p(D).isStyle(o,"static")){p(D).position("relative")}p(F).clearPositioning("auto");p(D).clip();D.appendChild(F);if(C){p(D).setXY(C)}}return D},fxUnwrap:function(D,G,F){var E=this.dom;p(E).clearPositioning();p(E).setPositioning(G);if(!F.wrap){var C=p(D).dom.parentNode;C.insertBefore(E,D);p(D).remove()}},getFxRestore:function(){var C=this.dom.style;return{pos:this.getPositioning(),width:C.width,height:C.height}},afterFx:function(D){var C=this.dom,E=C.id;if(D.afterStyle){p(C).setStyle(D.afterStyle)}if(D.afterCls){p(C).addClass(D.afterCls)}if(D.remove==k){p(C).remove()}if(D.callback){D.callback.call(D.scope,p(C))}if(!D.concurrent){c(E).shift();p(C).nextFx()}},fxanim:function(F,G,D,H,E,C){D=D||"run";G=G||{};var I=Ext.lib.Anim[D](this.dom,F,(G.duration||H)||0.35,(G.easing||E)||r,C,this);G.anim=I;return I}};Ext.Fx.resize=Ext.Fx.scale;Ext.Element.addMethods(Ext.Fx)})();Ext.CompositeElementLite=function(b,a){this.elements=[];this.add(b,a);this.el=new Ext.Element.Flyweight()};Ext.CompositeElementLite.prototype={isComposite:true,getElement:function(a){var b=this.el;b.dom=a;b.id=a.id;return b},transformElement:function(a){return Ext.getDom(a)},getCount:function(){return this.elements.length},add:function(d,b){var e=this,g=e.elements;if(!d){return this}if(Ext.isString(d)){d=Ext.Element.selectorFunction(d,b)}else{if(d.isComposite){d=d.elements}else{if(!Ext.isIterable(d)){d=[d]}}}for(var c=0,a=d.length;c-1){c=Ext.getDom(c);if(a){g=this.elements[b];g.parentNode.insertBefore(c,g);Ext.removeNode(g)}this.elements.splice(b,1,c)}return this},clear:function(){this.elements=[]}};Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener;(function(){var c,b=Ext.Element.prototype,a=Ext.CompositeElementLite.prototype;for(c in b){if(Ext.isFunction(b[c])){(function(d){a[d]=a[d]||function(){return this.invoke(d,arguments)}}).call(a,c)}}})();if(Ext.DomQuery){Ext.Element.selectorFunction=Ext.DomQuery.select}Ext.Element.select=function(a,b){var c;if(typeof a=="string"){c=Ext.Element.selectorFunction(a,b)}else{if(a.length!==undefined){c=a}else{throw"Invalid selector"}}return new Ext.CompositeElementLite(c)};Ext.select=Ext.Element.select;Ext.apply(Ext.CompositeElementLite.prototype,{addElements:function(c,a){if(!c){return this}if(typeof c=="string"){c=Ext.Element.selectorFunction(c,a)}var b=this.elements;Ext.each(c,function(d){b.push(Ext.get(d))});return this},first:function(){return this.item(0)},last:function(){return this.item(this.getCount()-1)},contains:function(a){return this.indexOf(a)!=-1},removeElement:function(d,e){var c=this,a=this.elements,b;Ext.each(d,function(g){if((b=(a[g]||a[g=c.indexOf(g)]))){if(e){if(b.dom){b.remove()}else{Ext.removeNode(b)}}a.splice(g,1)}});return this}});Ext.CompositeElement=function(b,a){this.elements=[];this.add(b,a)};Ext.extend(Ext.CompositeElement,Ext.CompositeElementLite,{getElement:function(a){return a},transformElement:function(a){return Ext.get(a)}});Ext.Element.select=function(a,d,b){var c;if(typeof a=="string"){c=Ext.Element.selectorFunction(a,b)}else{if(a.length!==undefined){c=a}else{throw"Invalid selector"}}return(d===true)?new Ext.CompositeElement(c):new Ext.CompositeElementLite(c)};Ext.select=Ext.Element.select;(function(){var b="beforerequest",e="requestcomplete",d="requestexception",h=undefined,c="load",i="POST",a="GET",g=window;Ext.data.Connection=function(j){Ext.apply(this,j);this.addEvents(b,e,d);Ext.data.Connection.superclass.constructor.call(this)};Ext.extend(Ext.data.Connection,Ext.util.Observable,{timeout:30000,autoAbort:false,disableCaching:true,disableCachingParam:"_dc",request:function(n){var s=this;if(s.fireEvent(b,s,n)){if(n.el){if(!Ext.isEmpty(n.indicatorText)){s.indicatorText='
    '+n.indicatorText+"
    "}if(s.indicatorText){Ext.getDom(n.el).innerHTML=s.indicatorText}n.success=(Ext.isFunction(n.success)?n.success:function(){}).createInterceptor(function(o){Ext.getDom(n.el).innerHTML=o.responseText})}var l=n.params,k=n.url||s.url,j,q={success:s.handleResponse,failure:s.handleFailure,scope:s,argument:{options:n},timeout:n.timeout||s.timeout},m,t;if(Ext.isFunction(l)){l=l.call(n.scope||g,n)}l=Ext.urlEncode(s.extraParams,Ext.isObject(l)?Ext.urlEncode(l):l);if(Ext.isFunction(k)){k=k.call(n.scope||g,n)}if((m=Ext.getDom(n.form))){k=k||m.action;if(n.isUpload||/multipart\/form-data/i.test(m.getAttribute("enctype"))){return s.doFormUpload.call(s,n,l,k)}t=Ext.lib.Ajax.serializeForm(m);l=l?(l+"&"+t):t}j=n.method||s.method||((l||n.xmlData||n.jsonData)?i:a);if(j===a&&(s.disableCaching&&n.disableCaching!==false)||n.disableCaching===true){var r=n.disableCachingParam||s.disableCachingParam;k=Ext.urlAppend(k,r+"="+(new Date().getTime()))}n.headers=Ext.apply(n.headers||{},s.defaultHeaders||{});if(n.autoAbort===true||s.autoAbort){s.abort()}if((j==a||n.xmlData||n.jsonData)&&l){k=Ext.urlAppend(k,l);l=""}return(s.transId=Ext.lib.Ajax.request(j,k,q,l,n))}else{return n.callback?n.callback.apply(n.scope,[n,h,h]):null}},isLoading:function(j){return j?Ext.lib.Ajax.isCallInProgress(j):!!this.transId},abort:function(j){if(j||this.isLoading()){Ext.lib.Ajax.abort(j||this.transId)}},handleResponse:function(j){this.transId=false;var k=j.argument.options;j.argument=k?k.argument:null;this.fireEvent(e,this,j,k);if(k.success){k.success.call(k.scope,j,k)}if(k.callback){k.callback.call(k.scope,k,true,j)}},handleFailure:function(j,l){this.transId=false;var k=j.argument.options;j.argument=k?k.argument:null;this.fireEvent(d,this,j,k,l);if(k.failure){k.failure.call(k.scope,j,k)}if(k.callback){k.callback.call(k.scope,k,false,j)}},doFormUpload:function(q,j,k){var l=Ext.id(),v=document,r=v.createElement("iframe"),m=Ext.getDom(q.form),u=[],t,p="multipart/form-data",n={target:m.target,method:m.method,encoding:m.encoding,enctype:m.enctype,action:m.action};Ext.fly(r).set({id:l,name:l,cls:"x-hidden"});v.body.appendChild(r);Ext.fly(r).set({src:Ext.SSL_SECURE_URL});if(Ext.isIE){document.frames[l].name=l}Ext.fly(m).set({target:l,method:i,enctype:p,encoding:p,action:k||n.action});Ext.iterate(Ext.urlDecode(j,false),function(x,o){t=v.createElement("input");Ext.fly(t).set({type:"hidden",value:o,name:x});m.appendChild(t);u.push(t)});function s(){var y=this,x={responseText:"",responseXML:null,argument:q.argument},B,A;try{B=r.contentWindow.document||r.contentDocument||g.frames[l].document;if(B){if(B.body){if(/textarea/i.test((A=B.body.firstChild||{}).tagName)){x.responseText=A.value}else{x.responseText=B.body.innerHTML}}x.responseXML=B.XMLDocument||B}}catch(z){}Ext.EventManager.removeListener(r,c,s,y);y.fireEvent(e,y,x,q);function o(E,D,C){if(Ext.isFunction(E)){E.apply(D,C)}}o(q.success,q.scope,[x,q]);o(q.callback,q.scope,[q,true,x]);if(!y.debugUploads){setTimeout(function(){Ext.removeNode(r)},100)}}Ext.EventManager.on(r,c,s,this);m.submit();Ext.fly(m).set(n);Ext.each(u,function(o){Ext.removeNode(o)})}})})();Ext.Ajax=new Ext.data.Connection({autoAbort:false,serializeForm:function(a){return Ext.lib.Ajax.serializeForm(a)}});Ext.UpdateManager=Ext.Updater=Ext.extend(Ext.util.Observable,function(){var b="beforeupdate",d="update",c="failure";function a(h){var i=this;i.transaction=null;if(h.argument.form&&h.argument.reset){try{h.argument.form.reset()}catch(j){}}if(i.loadScripts){i.renderer.render(i.el,h,i,g.createDelegate(i,[h]))}else{i.renderer.render(i.el,h,i);g.call(i,h)}}function g(h,i,j){this.fireEvent(i||d,this.el,h);if(Ext.isFunction(h.argument.callback)){h.argument.callback.call(h.argument.scope,this.el,Ext.isEmpty(j)?true:false,h,h.argument.options)}}function e(h){g.call(this,h,c,!!(this.transaction=null))}return{constructor:function(i,h){var j=this;i=Ext.get(i);if(!h&&i.updateManager){return i.updateManager}j.el=i;j.defaultUrl=null;j.addEvents(b,d,c);Ext.apply(j,Ext.Updater.defaults);j.transaction=null;j.refreshDelegate=j.refresh.createDelegate(j);j.updateDelegate=j.update.createDelegate(j);j.formUpdateDelegate=(j.formUpdate||function(){}).createDelegate(j);j.renderer=j.renderer||j.getDefaultRenderer();Ext.Updater.superclass.constructor.call(j)},setRenderer:function(h){this.renderer=h},getRenderer:function(){return this.renderer},getDefaultRenderer:function(){return new Ext.Updater.BasicRenderer()},setDefaultUrl:function(h){this.defaultUrl=h},getEl:function(){return this.el},update:function(i,n,p,l){var k=this,h,j;if(k.fireEvent(b,k.el,i,n)!==false){if(Ext.isObject(i)){h=i;i=h.url;n=n||h.params;p=p||h.callback;l=l||h.discardUrl;j=h.scope;if(!Ext.isEmpty(h.nocache)){k.disableCaching=h.nocache}if(!Ext.isEmpty(h.text)){k.indicatorText='
    '+h.text+"
    "}if(!Ext.isEmpty(h.scripts)){k.loadScripts=h.scripts}if(!Ext.isEmpty(h.timeout)){k.timeout=h.timeout}}k.showLoading();if(!l){k.defaultUrl=i}if(Ext.isFunction(i)){i=i.call(k)}var m=Ext.apply({},{url:i,params:(Ext.isFunction(n)&&j)?n.createDelegate(j):n,success:a,failure:e,scope:k,callback:undefined,timeout:(k.timeout*1000),disableCaching:k.disableCaching,argument:{options:h,url:i,form:null,callback:p,scope:j||window,params:n}},h);k.transaction=Ext.Ajax.request(m)}},formUpdate:function(k,h,j,l){var i=this;if(i.fireEvent(b,i.el,k,h)!==false){if(Ext.isFunction(h)){h=h.call(i)}k=Ext.getDom(k);i.transaction=Ext.Ajax.request({form:k,url:h,success:a,failure:e,scope:i,timeout:(i.timeout*1000),argument:{url:h,form:k,callback:l,reset:j}});i.showLoading.defer(1,i)}},startAutoRefresh:function(i,j,l,m,h){var k=this;if(h){k.update(j||k.defaultUrl,l,m,true)}if(k.autoRefreshProcId){clearInterval(k.autoRefreshProcId)}k.autoRefreshProcId=setInterval(k.update.createDelegate(k,[j||k.defaultUrl,l,m,true]),i*1000)},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);delete this.autoRefreshProcId}},isAutoRefreshing:function(){return !!this.autoRefreshProcId},showLoading:function(){if(this.showLoadIndicator){this.el.dom.innerHTML=this.indicatorText}},abort:function(){if(this.transaction){Ext.Ajax.abort(this.transaction)}},isUpdating:function(){return this.transaction?Ext.Ajax.isLoading(this.transaction):false},refresh:function(h){if(this.defaultUrl){this.update(this.defaultUrl,null,h,true)}}}}());Ext.Updater.defaults={timeout:30,disableCaching:false,showLoadIndicator:true,indicatorText:'
    Loading...
    ',loadScripts:false,sslBlankUrl:Ext.SSL_SECURE_URL};Ext.Updater.updateElement=function(d,c,e,b){var a=Ext.get(d).getUpdater();Ext.apply(a,b);a.update(c,e,b?b.callback:null)};Ext.Updater.BasicRenderer=function(){};Ext.Updater.BasicRenderer.prototype={render:function(c,a,b,d){c.update(a.responseText,b.loadScripts,d)}};(function(){Date.useStrict=false;function b(d){var c=Array.prototype.slice.call(arguments,1);return d.replace(/\{(\d+)\}/g,function(e,g){return c[g]})}Date.formatCodeToRegex=function(d,c){var e=Date.parseCodes[d];if(e){e=typeof e=="function"?e():e;Date.parseCodes[d]=e}return e?Ext.applyIf({c:e.c?b(e.c,c||"{0}"):e.c},e):{g:0,c:null,s:Ext.escapeRe(d)}};var a=Date.formatCodeToRegex;Ext.apply(Date,{parseFunctions:{"M$":function(d,c){var e=new RegExp("\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/");var g=(d||"").match(e);return g?new Date(((g[1]||"")+g[2])*1):null}},parseRegexes:[],formatFunctions:{"M$":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},getShortMonthName:function(c){return Date.monthNames[c].substring(0,3)},getShortDayName:function(c){return Date.dayNames[c].substring(0,3)},getMonthNumber:function(c){return Date.monthNumbers[c.substring(0,1).toUpperCase()+c.substring(1,3).toLowerCase()]},formatCodes:{d:"String.leftPad(this.getDate(), 2, '0')",D:"Date.getShortDayName(this.getDay())",j:"this.getDate()",l:"Date.dayNames[this.getDay()]",N:"(this.getDay() ? this.getDay() : 7)",S:"this.getSuffix()",w:"this.getDay()",z:"this.getDayOfYear()",W:"String.leftPad(this.getWeekOfYear(), 2, '0')",F:"Date.monthNames[this.getMonth()]",m:"String.leftPad(this.getMonth() + 1, 2, '0')",M:"Date.getShortMonthName(this.getMonth())",n:"(this.getMonth() + 1)",t:"this.getDaysInMonth()",L:"(this.isLeapYear() ? 1 : 0)",o:"(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))",Y:"this.getFullYear()",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:"String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",H:"String.leftPad(this.getHours(), 2, '0')",i:"String.leftPad(this.getMinutes(), 2, '0')",s:"String.leftPad(this.getSeconds(), 2, '0')",u:"String.leftPad(this.getMilliseconds(), 3, '0')",O:"this.getGMTOffset()",P:"this.getGMTOffset(true)",T:"this.getTimezone()",Z:"(this.getTimezoneOffset() * -60)",c:function(){for(var k="Y-m-dTH:i:sP",h=[],g=0,d=k.length;g= 0 && y >= 0){","v = new Date(y, 0, 1, h, i, s, ms);","v = !strict? v : (strict === true && (z <= 364 || (v.isLeapYear() && z <= 365))? v.add(Date.DAY, z) : null);","}else if(strict === true && !Date.isValid(y, m + 1, d, h, i, s, ms)){","v = null;","}else{","v = new Date(y, m, d, h, i, s, ms);","}","}","}","if(v){","if(zz != null){","v = v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - zz);","}else if(o){","v = v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));","}","}","return v;"].join("\n");return function(m){var e=Date.parseRegexes.length,n=1,g=[],l=[],k=false,d="";for(var j=0;j Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"},a:{g:1,c:"if (results[{0}] == 'am') {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(am|pm)"},A:{g:1,c:"if (results[{0}] == 'AM') {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(AM|PM)"},g:function(){return a("G")},G:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},h:function(){return a("H")},H:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},i:{g:1,c:"i = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},s:{g:1,c:"s = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},u:{g:1,c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",s:"(\\d+)"},O:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),","mn = o.substring(3,5) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{4})"},P:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),","mn = o.substring(4,6) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{2}:\\d{2})"},T:{g:0,c:null,s:"[A-Z]{1,4}"},Z:{g:1,c:"zz = results[{0}] * 1;\nzz = (-43200 <= zz && zz <= 50400)? zz : null;\n",s:"([+-]?\\d{1,5})"},c:function(){var e=[],c=[a("Y",1),a("m",2),a("d",3),a("h",4),a("i",5),a("s",6),{c:"ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"},{c:["if(results[8]) {","if(results[8] == 'Z'){","zz = 0;","}else if (results[8].indexOf(':') > -1){",a("P",8).c,"}else{",a("O",8).c,"}","}"].join("\n")}];for(var g=0,d=c.length;g0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+(a?":":"")+String.leftPad(Math.abs(this.getTimezoneOffset()%60),2,"0")},getDayOfYear:function(){var b=0,e=this.clone(),a=this.getMonth(),c;for(c=0,e.setDate(1),e.setMonth(0);c28){a=Math.min(a,this.getFirstDateOfMonth().add("mo",c).getLastDateOfMonth().getDate())}e.setDate(a);e.setMonth(this.getMonth()+c);break;case Date.YEAR:e.setFullYear(this.getFullYear()+c);break}return e},between:function(c,a){var b=this.getTime();return c.getTime()<=b&&b<=a.getTime()}});Date.prototype.format=Date.prototype.dateFormat;if(Ext.isSafari&&(navigator.userAgent.match(/WebKit\/(\d+)/)[1]||NaN)<420){Ext.apply(Date.prototype,{_xMonth:Date.prototype.setMonth,_xDate:Date.prototype.setDate,setMonth:function(a){if(a<=-1){var d=Math.ceil(-a),c=Math.ceil(d/12),b=(d%12)?12-d%12:0;this.setFullYear(this.getFullYear()-c);return this._xMonth(b)}else{return this._xMonth(a)}},setDate:function(a){return this.setTime(this.getTime()-(this.getDate()-a)*86400000)}})}Ext.util.MixedCollection=function(b,a){this.items=[];this.map={};this.keys=[];this.length=0;this.addEvents("clear","add","replace","remove","sort");this.allowFunctions=b===true;if(a){this.getKey=a}Ext.util.MixedCollection.superclass.constructor.call(this)};Ext.extend(Ext.util.MixedCollection,Ext.util.Observable,{allowFunctions:false,add:function(b,c){if(arguments.length==1){c=arguments[0];b=this.getKey(c)}if(typeof b!="undefined"&&b!==null){var a=this.map[b];if(typeof a!="undefined"){return this.replace(b,c)}this.map[b]=c}this.length++;this.items.push(c);this.keys.push(b);this.fireEvent("add",this.length-1,c,b);return c},getKey:function(a){return a.id},replace:function(c,d){if(arguments.length==1){d=arguments[0];c=this.getKey(d)}var a=this.map[c];if(typeof c=="undefined"||c===null||typeof a=="undefined"){return this.add(c,d)}var b=this.indexOfKey(c);this.items[b]=d;this.map[c]=d;this.fireEvent("replace",c,a,d);return d},addAll:function(e){if(arguments.length>1||Ext.isArray(e)){var b=arguments.length>1?arguments:e;for(var d=0,a=b.length;d=this.length){return this.add(b,c)}this.length++;this.items.splice(a,0,c);if(typeof b!="undefined"&&b!==null){this.map[b]=c}this.keys.splice(a,0,b);this.fireEvent("add",a,c,b);return c},remove:function(a){return this.removeAt(this.indexOf(a))},removeAt:function(a){if(a=0){this.length--;var c=this.items[a];this.items.splice(a,1);var b=this.keys[a];if(typeof b!="undefined"){delete this.map[b]}this.keys.splice(a,1);this.fireEvent("remove",c,b);return c}return false},removeKey:function(a){return this.removeAt(this.indexOfKey(a))},getCount:function(){return this.length},indexOf:function(a){return this.items.indexOf(a)},indexOfKey:function(a){return this.keys.indexOf(a)},item:function(b){var a=this.map[b],c=a!==undefined?a:(typeof b=="number")?this.items[b]:undefined;return !Ext.isFunction(c)||this.allowFunctions?c:null},itemAt:function(a){return this.items[a]},key:function(a){return this.map[a]},contains:function(a){return this.indexOf(a)!=-1},containsKey:function(a){return typeof this.map[a]!="undefined"},clear:function(){this.length=0;this.items=[];this.keys=[];this.map={};this.fireEvent("clear")},first:function(){return this.items[0]},last:function(){return this.items[this.length-1]},_sort:function(k,a,j){var d,e,b=String(a).toUpperCase()=="DESC"?-1:1,h=[],l=this.keys,g=this.items;j=j||function(i,c){return i-c};for(d=0,e=g.length;de?1:(g=a;c--){d[d.length]=b[c]}}return d},filter:function(c,b,d,a){if(Ext.isEmpty(b,false)){return this.clone()}b=this.createValueMatcher(b,d,a);return this.filterBy(function(e){return e&&b.test(e[c])})},filterBy:function(g,e){var h=new Ext.util.MixedCollection();h.getKey=this.getKey;var b=this.keys,d=this.items;for(var c=0,a=d.length;c]+>/gi,stripScriptsRe=/(?:)((\n|\r|.)*?)(?:<\/script>)/ig,nl2brRe=/\r?\n/g;return{ellipsis:function(value,len,word){if(value&&value.length>len){if(word){var vs=value.substr(0,len-2),index=Math.max(vs.lastIndexOf(" "),vs.lastIndexOf("."),vs.lastIndexOf("!"),vs.lastIndexOf("?"));if(index==-1||index<(len-15)){return value.substr(0,len-3)+"..."}else{return vs.substr(0,index)+"..."}}else{return value.substr(0,len-3)+"..."}}return value},undef:function(value){return value!==undefined?value:""},defaultValue:function(value,defaultValue){return value!==undefined&&value!==""?value:defaultValue},htmlEncode:function(value){return !value?value:String(value).replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&")},trim:function(value){return String(value).replace(trimRe,"")},substr:function(value,start,length){return String(value).substr(start,length)},lowercase:function(value){return String(value).toLowerCase()},uppercase:function(value){return String(value).toUpperCase()},capitalize:function(value){return !value?value:value.charAt(0).toUpperCase()+value.substr(1).toLowerCase()},call:function(value,fn){if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);args.unshift(value);return eval(fn).apply(window,args)}else{return eval(fn).call(window,value)}},usMoney:function(v){v=(Math.round((v-0)*100))/100;v=(v==Math.floor(v))?v+".00":((v*10==Math.floor(v*10))?v+"0":v);v=String(v);var ps=v.split("."),whole=ps[0],sub=ps[1]?"."+ps[1]:".00",r=/(\d+)(\d{3})/;while(r.test(whole)){whole=whole.replace(r,"$1,$2")}v=whole+sub;if(v.charAt(0)=="-"){return"-$"+v.substr(1)}return"$"+v},date:function(v,format){if(!v){return""}if(!Ext.isDate(v)){v=new Date(Date.parse(v))}return v.dateFormat(format||"m/d/Y")},dateRenderer:function(format){return function(v){return Ext.util.Format.date(v,format)}},stripTags:function(v){return !v?v:String(v).replace(stripTagsRE,"")},stripScripts:function(v){return !v?v:String(v).replace(stripScriptsRe,"")},fileSize:function(size){if(size<1024){return size+" bytes"}else{if(size<1048576){return(Math.round(((size*10)/1024))/10)+" KB"}else{return(Math.round(((size*10)/1048576))/10)+" MB"}}},math:function(){var fns={};return function(v,a){if(!fns[a]){fns[a]=new Function("v","return v "+a+";")}return fns[a](v)}}(),round:function(value,precision){var result=Number(value);if(typeof precision=="number"){precision=Math.pow(10,precision);result=Math.round(value*precision)/precision}return result},number:function(v,format){if(!format){return v}v=Ext.num(v,NaN);if(isNaN(v)){return""}var comma=",",dec=".",i18n=false,neg=v<0;v=Math.abs(v);if(format.substr(format.length-2)=="/i"){format=format.substr(0,format.length-2);i18n=true;comma=".";dec=","}var hasComma=format.indexOf(comma)!=-1,psplit=(i18n?format.replace(/[^\d\,]/g,""):format.replace(/[^\d\.]/g,"")).split(dec);if(1")}}}();Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var x=this,i=x.html,p=/]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,d=/^]*?for="(.*?)"/,t=/^]*?if="(.*?)"/,v=/^]*?exec="(.*?)"/,q,o=0,j=[],n="values",u="parent",k="xindex",l="xcount",e="return ",c="with(values){ ";i=["",i,""].join("");while((q=i.match(p))){var b=q[0].match(d),a=q[0].match(t),z=q[0].match(v),g=null,h=null,r=null,y=b&&b[1]?b[1]:"";if(a){g=a&&a[1]?a[1]:null;if(g){h=new Function(n,u,k,l,c+e+(Ext.util.Format.htmlDecode(g))+"; }")}}if(z){g=z&&z[1]?z[1]:null;if(g){r=new Function(n,u,k,l,c+(Ext.util.Format.htmlDecode(g))+"; }")}}if(y){switch(y){case".":y=new Function(n,u,c+e+n+"; }");break;case"..":y=new Function(n,u,c+e+u+"; }");break;default:y=new Function(n,u,c+e+y+"; }")}}j.push({id:o,target:y,exec:r,test:h,body:q[1]||""});i=i.replace(q[0],"{xtpl"+o+"}");++o}Ext.each(j,function(m){x.compileTpl(m)});x.master=j[j.length-1];x.tpls=j};Ext.extend(Ext.XTemplate,Ext.Template,{re:/\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,codeRe:/\{\[((?:\\\]|.|\n)*?)\]\}/g,applySubTemplate:function(a,i,h,d,c){var g=this,e,k=g.tpls[a],j,b=[];if((k.test&&!k.test.call(g,i,h,d,c))||(k.exec&&k.exec.call(g,i,h,d,c))){return""}j=k.target?k.target.call(g,i,h):i;e=j.length;h=k.target?i:h;if(k.target&&Ext.isArray(j)){Ext.each(j,function(l,m){b[b.length]=k.compiled.call(g,l,h,m+1,e)});return b.join("")}return k.compiled.call(g,j,h,d,c)},compileTpl:function(tpl){var fm=Ext.util.Format,useF=this.disableFormats!==true,sep=Ext.isGecko?"+":",",body;function fn(m,name,format,args,math){if(name.substr(0,4)=="xtpl"){return"'"+sep+"this.applySubTemplate("+name.substr(4)+", values, parent, xindex, xcount)"+sep+"'"}var v;if(name==="."){v="values"}else{if(name==="#"){v="xindex"}else{if(name.indexOf(".")!=-1){v=name}else{v="values['"+name+"']"}}}if(math){v="("+v+math+")"}if(format&&useF){args=args?","+args:"";if(format.substr(0,5)!="this."){format="fm."+format+"("}else{format='this.call("'+format.substr(5)+'", ';args=", values"}}else{args="";format="("+v+" === undefined ? '' : "}return"'"+sep+format+v+args+")"+sep+"'"}function codeFn(m,code){return"'"+sep+"("+code.replace(/\\'/g,"'")+")"+sep+"'"}if(Ext.isGecko){body="tpl.compiled = function(values, parent, xindex, xcount){ return '"+tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn)+"';};"}else{body=["tpl.compiled = function(values, parent, xindex, xcount){ return ['"];body.push(tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn));body.push("'].join('');};");body=body.join("")}eval(body);return this},applyTemplate:function(a){return this.master.compiled.call(this,a,{},1,1)},compile:function(){return this}});Ext.XTemplate.prototype.apply=Ext.XTemplate.prototype.applyTemplate;Ext.XTemplate.from=function(a){a=Ext.getDom(a);return new Ext.XTemplate(a.value||a.innerHTML)};Ext.util.CSS=function(){var d=null;var c=document;var b=/(-[a-z])/gi;var a=function(e,g){return g.charAt(1).toUpperCase()};return{createStyleSheet:function(i,l){var h;var g=c.getElementsByTagName("head")[0];var k=c.createElement("style");k.setAttribute("type","text/css");if(l){k.setAttribute("id",l)}if(Ext.isIE){g.appendChild(k);h=k.styleSheet;h.cssText=i}else{try{k.appendChild(c.createTextNode(i))}catch(j){k.cssText=i}g.appendChild(k);h=k.styleSheet?k.styleSheet:(k.sheet||c.styleSheets[c.styleSheets.length-1])}this.cacheStyleSheet(h);return h},removeStyleSheet:function(g){var e=c.getElementById(g);if(e){e.parentNode.removeChild(e)}},swapStyleSheet:function(h,e){this.removeStyleSheet(h);var g=c.createElement("link");g.setAttribute("rel","stylesheet");g.setAttribute("type","text/css");g.setAttribute("id",h);g.setAttribute("href",e);c.getElementsByTagName("head")[0].appendChild(g)},refreshCache:function(){return this.getRules(true)},cacheStyleSheet:function(h){if(!d){d={}}try{var k=h.cssRules||h.rules;for(var g=k.length-1;g>=0;--g){d[k[g].selectorText.toLowerCase()]=k[g]}}catch(i){}},getRules:function(h){if(d===null||h){d={};var k=c.styleSheets;for(var j=0,g=k.length;j=37&&a<=40){b.stopEvent()}},destroy:function(){this.disable()},enable:function(){if(this.disabled){if(Ext.isSafari2){this.el.on("keyup",this.stopKeyUp,this)}this.el.on(this.isKeydown()?"keydown":"keypress",this.relay,this);this.disabled=false}},disable:function(){if(!this.disabled){if(Ext.isSafari2){this.el.un("keyup",this.stopKeyUp,this)}this.el.un(this.isKeydown()?"keydown":"keypress",this.relay,this);this.disabled=true}},setDisabled:function(a){this[a?"disable":"enable"]()},isKeydown:function(){return this.forceKeyDown||Ext.EventManager.useKeydown}};Ext.KeyMap=function(c,b,a){this.el=Ext.get(c);this.eventName=a||"keydown";this.bindings=[];if(b){this.addBinding(b)}this.enable()};Ext.KeyMap.prototype={stopEvent:false,addBinding:function(b){if(Ext.isArray(b)){Ext.each(b,function(j){this.addBinding(j)},this);return}var k=b.key,g=b.fn||b.handler,l=b.scope;if(b.stopEvent){this.stopEvent=b.stopEvent}if(typeof k=="string"){var h=[];var e=k.toUpperCase();for(var c=0,d=e.length;c2)?a[2]:null;var h=(i>3)?a[3]:"/";var d=(i>4)?a[4]:null;var g=(i>5)?a[5]:false;document.cookie=c+"="+escape(e)+((b===null)?"":("; expires="+b.toGMTString()))+((h===null)?"":("; path="+h))+((d===null)?"":("; domain="+d))+((g===true)?"; secure":"")},get:function(d){var b=d+"=";var g=b.length;var a=document.cookie.length;var e=0;var c=0;while(e0){return this.ownerCt.items.itemAt(a-1)}}return null},getBubbleTarget:function(){return this.ownerCt}});Ext.reg("component",Ext.Component);Ext.Action=Ext.extend(Object,{constructor:function(a){this.initialConfig=a;this.itemId=a.itemId=(a.itemId||a.id||Ext.id());this.items=[]},isAction:true,setText:function(a){this.initialConfig.text=a;this.callEach("setText",[a])},getText:function(){return this.initialConfig.text},setIconClass:function(a){this.initialConfig.iconCls=a;this.callEach("setIconClass",[a])},getIconClass:function(){return this.initialConfig.iconCls},setDisabled:function(a){this.initialConfig.disabled=a;this.callEach("setDisabled",[a])},enable:function(){this.setDisabled(false)},disable:function(){this.setDisabled(true)},isDisabled:function(){return this.initialConfig.disabled},setHidden:function(a){this.initialConfig.hidden=a;this.callEach("setVisible",[!a])},show:function(){this.setHidden(false)},hide:function(){this.setHidden(true)},isHidden:function(){return this.initialConfig.hidden},setHandler:function(b,a){this.initialConfig.handler=b;this.initialConfig.scope=a;this.callEach("setHandler",[b,a])},each:function(b,a){Ext.each(this.items,b,a)},callEach:function(e,b){var d=this.items;for(var c=0,a=d.length;cj+o.left){k=j-l-c;g=true}if((i+e)>d+o.top){i=d-e-c;g=true}if(k=m){i=m-e-5}}n=[k,i];this.storeXY(n);a.setXY.call(this,n);this.sync()}}return this},isVisible:function(){return this.visible},showAction:function(){this.visible=true;if(this.useDisplay===true){this.setDisplayed("")}else{if(this.lastXY){a.setXY.call(this,this.lastXY)}else{if(this.lastLT){a.setLeftTop.call(this,this.lastLT[0],this.lastLT[1])}}}},hideAction:function(){this.visible=false;if(this.useDisplay===true){this.setDisplayed(false)}else{this.setLeftTop(-10000,-10000)}},setVisible:function(i,h,k,l,j){if(i){this.showAction()}if(h&&i){var g=function(){this.sync(true);if(l){l()}}.createDelegate(this);a.setVisible.call(this,true,true,k,g,j)}else{if(!i){this.hideUnders(true)}var g=l;if(h){g=function(){this.hideAction();if(l){l()}}.createDelegate(this)}a.setVisible.call(this,i,h,k,g,j);if(i){this.sync(true)}else{if(!h){this.hideAction()}}}return this},storeXY:function(c){delete this.lastLT;this.lastXY=c},storeLeftTop:function(d,c){delete this.lastXY;this.lastLT=[d,c]},beforeFx:function(){this.beforeAction();return Ext.Layer.superclass.beforeFx.apply(this,arguments)},afterFx:function(){Ext.Layer.superclass.afterFx.apply(this,arguments);this.sync(this.isVisible())},beforeAction:function(){if(!this.updating&&this.shadow){this.shadow.hide()}},setLeft:function(c){this.storeLeftTop(c,this.getTop(true));a.setLeft.apply(this,arguments);this.sync();return this},setTop:function(c){this.storeLeftTop(this.getLeft(true),c);a.setTop.apply(this,arguments);this.sync();return this},setLeftTop:function(d,c){this.storeLeftTop(d,c);a.setLeftTop.apply(this,arguments);this.sync();return this},setXY:function(j,h,k,l,i){this.fixDisplay();this.beforeAction();this.storeXY(j);var g=this.createCB(l);a.setXY.call(this,j,h,k,g,i);if(!h){g()}return this},createCB:function(e){var d=this;return function(){d.constrainXY();d.sync(true);if(e){e()}}},setX:function(g,h,j,k,i){this.setXY([g,this.getY()],h,j,k,i);return this},setY:function(k,g,i,j,h){this.setXY([this.getX(),k],g,i,j,h);return this},setSize:function(j,k,i,m,n,l){this.beforeAction();var g=this.createCB(n);a.setSize.call(this,j,k,i,m,g,l);if(!i){g()}return this},setWidth:function(i,h,k,l,j){this.beforeAction();var g=this.createCB(l);a.setWidth.call(this,i,h,k,g,j);if(!h){g()}return this},setHeight:function(j,i,l,m,k){this.beforeAction();var g=this.createCB(m);a.setHeight.call(this,j,i,l,g,k);if(!i){g()}return this},setBounds:function(o,m,p,i,n,k,l,j){this.beforeAction();var g=this.createCB(l);if(!n){this.storeXY([o,m]);a.setXY.call(this,[o,m]);a.setSize.call(this,p,i,n,k,g,j);g()}else{a.setBounds.call(this,o,m,p,i,n,k,g,j)}return this},setZIndex:function(c){this.zindex=c;this.setStyle("z-index",c+2);if(this.shadow){this.shadow.setZIndex(c+1)}if(this.shim){this.shim.setStyle("z-index",c)}return this}})})();Ext.Shadow=function(d){Ext.apply(this,d);if(typeof this.mode!="string"){this.mode=this.defaultMode}var e=this.offset,c={h:0};var b=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case"drop":c.w=0;c.l=c.t=e;c.t-=1;if(Ext.isIE){c.l-=this.offset+b;c.t-=this.offset+b;c.w-=b;c.h-=b;c.t+=1}break;case"sides":c.w=(e*2);c.l=-e;c.t=e-1;if(Ext.isIE){c.l-=(this.offset-b);c.t-=this.offset+b;c.l+=1;c.w-=(this.offset-b)*2;c.w-=b+1;c.h-=1}break;case"frame":c.w=c.h=(e*2);c.l=c.t=-e;c.t+=1;c.h-=2;if(Ext.isIE){c.l-=(this.offset-b);c.t-=(this.offset-b);c.l+=1;c.w-=(this.offset+b+1);c.h-=(this.offset+b);c.h+=1}break}this.adjusts=c};Ext.Shadow.prototype={offset:4,defaultMode:"drop",show:function(a){a=Ext.get(a);if(!this.el){this.el=Ext.Shadow.Pool.pull();if(this.el.dom.nextSibling!=a.dom){this.el.insertBefore(a)}}this.el.setStyle("z-index",this.zIndex||parseInt(a.getStyle("z-index"),10)-1);if(Ext.isIE){this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")"}this.realign(a.getLeft(true),a.getTop(true),a.getWidth(),a.getHeight());this.el.dom.style.display="block"},isVisible:function(){return this.el?true:false},realign:function(b,r,q,g){if(!this.el){return}var n=this.adjusts,k=this.el.dom,u=k.style;var i=0;u.left=(b+n.l)+"px";u.top=(r+n.t)+"px";var p=(q+n.w),e=(g+n.h),j=p+"px",o=e+"px";if(u.width!=j||u.height!=o){u.width=j;u.height=o;if(!Ext.isIE){var m=k.childNodes;var c=Math.max(0,(p-12))+"px";m[0].childNodes[1].style.width=c;m[1].childNodes[1].style.width=c;m[2].childNodes[1].style.width=c;m[1].style.height=Math.max(0,(e-12))+"px"}}},hide:function(){if(this.el){this.el.dom.style.display="none";Ext.Shadow.Pool.push(this.el);delete this.el}},setZIndex:function(a){this.zIndex=a;if(this.el){this.el.setStyle("z-index",a)}}};Ext.Shadow.Pool=function(){var b=[];var a=Ext.isIE?'
    ':'
    ';return{pull:function(){var c=b.shift();if(!c){c=Ext.get(Ext.DomHelper.insertHtml("beforeBegin",document.body.firstChild,a));c.autoBoxAdjust=false}return c},push:function(c){b.push(c)}}}();Ext.BoxComponent=Ext.extend(Ext.Component,{initComponent:function(){Ext.BoxComponent.superclass.initComponent.call(this);this.addEvents("resize","move")},boxReady:false,deferHeight:false,setSize:function(b,d){if(typeof b=="object"){d=b.height;b=b.width}if(Ext.isDefined(b)&&Ext.isDefined(this.boxMinWidth)&&(bthis.boxMaxWidth)){b=this.boxMaxWidth}if(Ext.isDefined(d)&&Ext.isDefined(this.boxMaxHeight)&&(d>this.boxMaxHeight)){d=this.boxMaxHeight}if(!this.boxReady){this.width=b;this.height=d;return this}if(this.cacheSizes!==false&&this.lastSize&&this.lastSize.width==b&&this.lastSize.height==d){return this}this.lastSize={width:b,height:d};var c=this.adjustSize(b,d),g=c.width,a=c.height,e;if(g!==undefined||a!==undefined){e=this.getResizeEl();if(!this.deferHeight&&g!==undefined&&a!==undefined){e.setSize(g,a)}else{if(!this.deferHeight&&a!==undefined){e.setHeight(a)}else{if(g!==undefined){e.setWidth(g)}}}this.onResize(g,a,b,d);this.fireEvent("resize",this,g,a,b,d)}return this},setWidth:function(a){return this.setSize(a)},setHeight:function(a){return this.setSize(undefined,a)},getSize:function(){return this.getResizeEl().getSize()},getWidth:function(){return this.getResizeEl().getWidth()},getHeight:function(){return this.getResizeEl().getHeight()},getOuterSize:function(){var a=this.getResizeEl();return{width:a.getWidth()+a.getMargins("lr"),height:a.getHeight()+a.getMargins("tb")}},getPosition:function(a){var b=this.getPositionEl();if(a===true){return[b.getLeft(true),b.getTop(true)]}return this.xy||b.getXY()},getBox:function(a){var c=this.getPosition(a);var b=this.getSize();b.x=c[0];b.y=c[1];return b},updateBox:function(a){this.setSize(a.width,a.height);this.setPagePosition(a.x,a.y);return this},getResizeEl:function(){return this.resizeEl||this.el},setAutoScroll:function(a){if(this.rendered){this.getContentTarget().setOverflow(a?"auto":"")}this.autoScroll=a;return this},setPosition:function(a,g){if(a&&typeof a[1]=="number"){g=a[1];a=a[0]}this.x=a;this.y=g;if(!this.boxReady){return this}var b=this.adjustPosition(a,g);var e=b.x,d=b.y;var c=this.getPositionEl();if(e!==undefined||d!==undefined){if(e!==undefined&&d!==undefined){c.setLeftTop(e,d)}else{if(e!==undefined){c.setLeft(e)}else{if(d!==undefined){c.setTop(d)}}}this.onPosition(e,d);this.fireEvent("move",this,e,d)}return this},setPagePosition:function(a,c){if(a&&typeof a[1]=="number"){c=a[1];a=a[0]}this.pageX=a;this.pageY=c;if(!this.boxReady){return}if(a===undefined||c===undefined){return}var b=this.getPositionEl().translatePoints(a,c);this.setPosition(b.left,b.top);return this},afterRender:function(){Ext.BoxComponent.superclass.afterRender.call(this);if(this.resizeEl){this.resizeEl=Ext.get(this.resizeEl)}if(this.positionEl){this.positionEl=Ext.get(this.positionEl)}this.boxReady=true;Ext.isDefined(this.autoScroll)&&this.setAutoScroll(this.autoScroll);this.setSize(this.width,this.height);if(this.x||this.y){this.setPosition(this.x,this.y)}else{if(this.pageX||this.pageY){this.setPagePosition(this.pageX,this.pageY)}}},syncSize:function(){delete this.lastSize;this.setSize(this.autoWidth?undefined:this.getResizeEl().getWidth(),this.autoHeight?undefined:this.getResizeEl().getHeight());return this},onResize:function(d,b,a,c){},onPosition:function(a,b){},adjustSize:function(a,b){if(this.autoWidth){a="auto"}if(this.autoHeight){b="auto"}return{width:a,height:b}},adjustPosition:function(a,b){return{x:a,y:b}}});Ext.reg("box",Ext.BoxComponent);Ext.Spacer=Ext.extend(Ext.BoxComponent,{autoEl:"div"});Ext.reg("spacer",Ext.Spacer);Ext.SplitBar=function(c,e,b,d,a){this.el=Ext.get(c,true);this.el.dom.unselectable="on";this.resizingEl=Ext.get(e,true);this.orientation=b||Ext.SplitBar.HORIZONTAL;this.minSize=0;this.maxSize=2000;this.animate=false;this.useShim=false;this.shim=null;if(!a){this.proxy=Ext.SplitBar.createProxy(this.orientation)}else{this.proxy=Ext.get(a).dom}this.dd=new Ext.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id});this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this);this.dd.endDrag=this.onEndProxyDrag.createDelegate(this);this.dragSpecs={};this.adapter=new Ext.SplitBar.BasicLayoutAdapter();this.adapter.init(this);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.placement=d||(this.el.getX()>this.resizingEl.getX()?Ext.SplitBar.LEFT:Ext.SplitBar.RIGHT);this.el.addClass("x-splitbar-h")}else{this.placement=d||(this.el.getY()>this.resizingEl.getY()?Ext.SplitBar.TOP:Ext.SplitBar.BOTTOM);this.el.addClass("x-splitbar-v")}this.addEvents("resize","moved","beforeresize","beforeapply");Ext.SplitBar.superclass.constructor.call(this)};Ext.extend(Ext.SplitBar,Ext.util.Observable,{onStartProxyDrag:function(a,e){this.fireEvent("beforeresize",this);this.overlay=Ext.DomHelper.append(document.body,{cls:"x-drag-overlay",html:" "},true);this.overlay.unselectable();this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();Ext.get(this.proxy).setDisplayed("block");var c=this.adapter.getElementSize(this);this.activeMinSize=this.getMinimumSize();this.activeMaxSize=this.getMaximumSize();var d=c-this.activeMinSize;var b=Math.max(this.activeMaxSize-c,0);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.dd.resetConstraints();this.dd.setXConstraint(this.placement==Ext.SplitBar.LEFT?d:b,this.placement==Ext.SplitBar.LEFT?b:d,this.tickSize);this.dd.setYConstraint(0,0)}else{this.dd.resetConstraints();this.dd.setXConstraint(0,0);this.dd.setYConstraint(this.placement==Ext.SplitBar.TOP?d:b,this.placement==Ext.SplitBar.TOP?b:d,this.tickSize)}this.dragSpecs.startSize=c;this.dragSpecs.startPoint=[a,e];Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd,a,e)},onEndProxyDrag:function(c){Ext.get(this.proxy).setDisplayed(false);var b=Ext.lib.Event.getXY(c);if(this.overlay){Ext.destroy(this.overlay);delete this.overlay}var a;if(this.orientation==Ext.SplitBar.HORIZONTAL){a=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.LEFT?b[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-b[0])}else{a=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.TOP?b[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-b[1])}a=Math.min(Math.max(a,this.activeMinSize),this.activeMaxSize);if(a!=this.dragSpecs.startSize){if(this.fireEvent("beforeapply",this,a)!==false){this.adapter.setElementSize(this,a);this.fireEvent("moved",this,a);this.fireEvent("resize",this,a)}}},getAdapter:function(){return this.adapter},setAdapter:function(a){this.adapter=a;this.adapter.init(this)},getMinimumSize:function(){return this.minSize},setMinimumSize:function(a){this.minSize=a},getMaximumSize:function(){return this.maxSize},setMaximumSize:function(a){this.maxSize=a},setCurrentSize:function(b){var a=this.animate;this.animate=false;this.adapter.setElementSize(this,b);this.animate=a},destroy:function(a){Ext.destroy(this.shim,Ext.get(this.proxy));this.dd.unreg();if(a){this.el.remove()}this.purgeListeners()}});Ext.SplitBar.createProxy=function(b){var c=new Ext.Element(document.createElement("div"));document.body.appendChild(c.dom);c.unselectable();var a="x-splitbar-proxy";c.addClass(a+" "+(b==Ext.SplitBar.HORIZONTAL?a+"-h":a+"-v"));return c.dom};Ext.SplitBar.BasicLayoutAdapter=function(){};Ext.SplitBar.BasicLayoutAdapter.prototype={init:function(a){},getElementSize:function(a){if(a.orientation==Ext.SplitBar.HORIZONTAL){return a.resizingEl.getWidth()}else{return a.resizingEl.getHeight()}},setElementSize:function(b,a,c){if(b.orientation==Ext.SplitBar.HORIZONTAL){if(!b.animate){b.resizingEl.setWidth(a);if(c){c(b,a)}}else{b.resizingEl.setWidth(a,true,0.1,c,"easeOut")}}else{if(!b.animate){b.resizingEl.setHeight(a);if(c){c(b,a)}}else{b.resizingEl.setHeight(a,true,0.1,c,"easeOut")}}}};Ext.SplitBar.AbsoluteLayoutAdapter=function(a){this.basic=new Ext.SplitBar.BasicLayoutAdapter();this.container=Ext.get(a)};Ext.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(a){this.basic.init(a)},getElementSize:function(a){return this.basic.getElementSize(a)},setElementSize:function(b,a,c){this.basic.setElementSize(b,a,this.moveSplitter.createDelegate(this,[b]))},moveSplitter:function(a){var b=Ext.SplitBar;switch(a.placement){case b.LEFT:a.el.setX(a.resizingEl.getRight());break;case b.RIGHT:a.el.setStyle("right",(this.container.getWidth()-a.resizingEl.getLeft())+"px");break;case b.TOP:a.el.setY(a.resizingEl.getBottom());break;case b.BOTTOM:a.el.setY(a.resizingEl.getTop()-a.el.getHeight());break}}};Ext.SplitBar.VERTICAL=1;Ext.SplitBar.HORIZONTAL=2;Ext.SplitBar.LEFT=1;Ext.SplitBar.RIGHT=2;Ext.SplitBar.TOP=3;Ext.SplitBar.BOTTOM=4;Ext.Container=Ext.extend(Ext.BoxComponent,{bufferResize:50,autoDestroy:true,forceLayout:false,defaultType:"panel",resizeEvent:"resize",bubbleEvents:["add","remove"],initComponent:function(){Ext.Container.superclass.initComponent.call(this);this.addEvents("afterlayout","beforeadd","beforeremove","add","remove");var a=this.items;if(a){delete this.items;this.add(a)}},initItems:function(){if(!this.items){this.items=new Ext.util.MixedCollection(false,this.getComponentId);this.getLayout()}},setLayout:function(a){if(this.layout&&this.layout!=a){this.layout.setContainer(null)}this.initItems();this.layout=a;a.setContainer(this)},afterRender:function(){Ext.Container.superclass.afterRender.call(this);if(!this.layout){this.layout="auto"}if(Ext.isObject(this.layout)&&!this.layout.layout){this.layoutConfig=this.layout;this.layout=this.layoutConfig.type}if(Ext.isString(this.layout)){this.layout=new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig)}this.setLayout(this.layout);if(this.activeItem!==undefined){var a=this.activeItem;delete this.activeItem;this.layout.setActiveItem(a)}if(!this.ownerCt){this.doLayout(false,true)}if(this.monitorResize===true){Ext.EventManager.onWindowResize(this.doLayout,this,[false])}},getLayoutTarget:function(){return this.el},getComponentId:function(a){return a.getItemId()},add:function(b){this.initItems();var e=arguments.length>1;if(e||Ext.isArray(b)){var a=[];Ext.each(e?arguments:b,function(h){a.push(this.add(h))},this);return a}var g=this.lookupComponent(this.applyDefaults(b));var d=this.items.length;if(this.fireEvent("beforeadd",this,g,d)!==false&&this.onBeforeAdd(g)!==false){this.items.add(g);g.onAdded(this,d);this.onAdd(g);this.fireEvent("add",this,g,d)}return g},onAdd:function(a){},onAdded:function(a,b){this.ownerCt=a;this.initRef();this.cascade(function(d){d.initRef()});this.fireEvent("added",this,a,b)},insert:function(h,g){this.initItems();var e=arguments,d=e.length;if(d>2){var b=[];for(var j=d-1;j>=1;--j){b.push(this.insert(h,e[j]))}return b}var k=this.lookupComponent(this.applyDefaults(g));h=Math.min(h,this.items.length);if(this.fireEvent("beforeadd",this,k,h)!==false&&this.onBeforeAdd(k)!==false){if(k.ownerCt==this){this.items.remove(k)}this.items.insert(h,k);k.onAdded(this,h);this.onAdd(k);this.fireEvent("add",this,k,h)}return k},applyDefaults:function(b){var a=this.defaults;if(a){if(Ext.isFunction(a)){a=a.call(this,b)}if(Ext.isString(b)){b=Ext.ComponentMgr.get(b);Ext.apply(b,a)}else{if(!b.events){Ext.applyIf(b,a)}else{Ext.apply(b,a)}}}return b},onBeforeAdd:function(a){if(a.ownerCt){a.ownerCt.remove(a,false)}if(this.hideBorders===true){a.border=(a.border===true)}},remove:function(a,b){this.initItems();var d=this.getComponent(a);if(d&&this.fireEvent("beforeremove",this,d)!==false){this.doRemove(d,b);this.fireEvent("remove",this,d)}return d},onRemove:function(a){},doRemove:function(e,d){var b=this.layout,a=b&&this.rendered;if(a){b.onRemove(e)}this.items.remove(e);e.onRemoved();this.onRemove(e);if(d===true||(d!==false&&this.autoDestroy)){e.destroy()}if(a){b.afterRemove(e)}},removeAll:function(c){this.initItems();var e,g=[],b=[];this.items.each(function(h){g.push(h)});for(var d=0,a=g.length;d','','
    ','
    ',"");a.disableFormats=true;return a.compile()})(),destroy:function(){if(this.resizeTask&&this.resizeTask.cancel){this.resizeTask.cancel()}if(!Ext.isEmpty(this.targetCls)){var a=this.container.getLayoutTarget();if(a){a.removeClass(this.targetCls)}}}});Ext.layout.AutoLayout=Ext.extend(Ext.layout.ContainerLayout,{type:"auto",monitorResize:true,onLayout:function(d,g){Ext.layout.AutoLayout.superclass.onLayout.call(this,d,g);var e=this.getRenderedItems(d),a=e.length,b,h;for(b=0;b0){b.setSize(a)}}});Ext.Container.LAYOUTS.fit=Ext.layout.FitLayout;Ext.layout.CardLayout=Ext.extend(Ext.layout.FitLayout,{deferredRender:false,layoutOnCardChange:false,renderHidden:true,type:"card",setActiveItem:function(d){var a=this.activeItem,b=this.container;d=b.getComponent(d);if(d&&a!=d){if(a){a.hide();if(a.hidden!==true){return false}a.fireEvent("deactivate",a)}var c=d.doLayout&&(this.layoutOnCardChange||!d.rendered);this.activeItem=d;delete d.deferLayout;d.show();this.layout();if(c){d.doLayout()}d.fireEvent("activate",d)}},renderAll:function(a,b){if(this.deferredRender){this.renderItem(this.activeItem,undefined,b)}else{Ext.layout.CardLayout.superclass.renderAll.call(this,a,b)}}});Ext.Container.LAYOUTS.card=Ext.layout.CardLayout;Ext.layout.AnchorLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"anchor",defaultAnchor:"100%",parseAnchorRE:/^(r|right|b|bottom)$/i,getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();if(!a){return{}}return a.getStyleSize()},onLayout:function(m,p){Ext.layout.AnchorLayout.superclass.onLayout.call(this,m,p);var v=this.getLayoutTargetSize();var t=v.width,l=v.height;if(t<20&&l<20){return}var d,r;if(m.anchorSize){if(typeof m.anchorSize=="number"){d=m.anchorSize}else{d=m.anchorSize.width;r=m.anchorSize.height}}else{d=m.initialConfig.width;r=m.initialConfig.height}var o=this.getRenderedItems(m),n=o.length,j,q,s,g,b,e,u,k=[];for(j=0;j ');b.disableFormats=true;b.compile();Ext.layout.BorderLayout.Region.prototype.toolTemplate=b}this.collapsedEl=this.targetEl.createChild({cls:"x-layout-collapsed x-layout-collapsed-"+this.position,id:this.panel.id+"-xcollapsed"});this.collapsedEl.enableDisplayMode("block");if(this.collapseMode=="mini"){this.collapsedEl.addClass("x-layout-cmini-"+this.position);this.miniCollapsedEl=this.collapsedEl.createChild({cls:"x-layout-mini x-layout-mini-"+this.position,html:" "});this.miniCollapsedEl.addClassOnOver("x-layout-mini-over");this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this.onExpandClick,this,{stopEvent:true})}else{if(this.collapsible!==false&&!this.hideCollapseTool){var a=this.toolTemplate.append(this.collapsedEl.dom,{id:"expand-"+this.position},true);a.addClassOnOver("x-tool-expand-"+this.position+"-over");a.on("click",this.onExpandClick,this,{stopEvent:true})}if(this.floatable!==false||this.titleCollapse){this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this[this.floatable?"collapseClick":"onExpandClick"],this)}}}return this.collapsedEl},onExpandClick:function(a){if(this.isSlid){this.panel.expand(false)}else{this.panel.expand()}},onCollapseClick:function(a){this.panel.collapse()},beforeCollapse:function(c,a){this.lastAnim=a;if(this.splitEl){this.splitEl.hide()}this.getCollapsedEl().show();var b=this.panel.getEl();this.originalZIndex=b.getStyle("z-index");b.setStyle("z-index",100);this.isCollapsed=true;this.layout.layout()},onCollapse:function(a){this.panel.el.setStyle("z-index",1);if(this.lastAnim===false||this.panel.animCollapse===false){this.getCollapsedEl().dom.style.visibility="visible"}else{this.getCollapsedEl().slideIn(this.panel.slideAnchor,{duration:0.2})}this.state.collapsed=true;this.panel.saveState()},beforeExpand:function(a){if(this.isSlid){this.afterSlideIn()}var b=this.getCollapsedEl();this.el.show();if(this.position=="east"||this.position=="west"){this.panel.setSize(undefined,b.getHeight())}else{this.panel.setSize(b.getWidth(),undefined)}b.hide();b.dom.style.visibility="hidden";this.panel.el.setStyle("z-index",this.floatingZIndex)},onExpand:function(){this.isCollapsed=false;if(this.splitEl){this.splitEl.show()}this.layout.layout();this.panel.el.setStyle("z-index",this.originalZIndex);this.state.collapsed=false;this.panel.saveState()},collapseClick:function(a){if(this.isSlid){a.stopPropagation();this.slideIn()}else{a.stopPropagation();this.slideOut()}},onHide:function(){if(this.isCollapsed){this.getCollapsedEl().hide()}else{if(this.splitEl){this.splitEl.hide()}}},onShow:function(){if(this.isCollapsed){this.getCollapsedEl().show()}else{if(this.splitEl){this.splitEl.show()}}},isVisible:function(){return !this.panel.hidden},getMargins:function(){return this.isCollapsed&&this.cmargins?this.cmargins:this.margins},getSize:function(){return this.isCollapsed?this.getCollapsedEl().getSize():this.panel.getSize()},setPanel:function(a){this.panel=a},getMinWidth:function(){return this.minWidth},getMinHeight:function(){return this.minHeight},applyLayoutCollapsed:function(a){var b=this.getCollapsedEl();b.setLeftTop(a.x,a.y);b.setSize(a.width,a.height)},applyLayout:function(a){if(this.isCollapsed){this.applyLayoutCollapsed(a)}else{this.panel.setPosition(a.x,a.y);this.panel.setSize(a.width,a.height)}},beforeSlide:function(){this.panel.beforeEffect()},afterSlide:function(){this.panel.afterEffect()},initAutoHide:function(){if(this.autoHide!==false){if(!this.autoHideHd){this.autoHideSlideTask=new Ext.util.DelayedTask(this.slideIn,this);this.autoHideHd={mouseout:function(a){if(!a.within(this.el,true)){this.autoHideSlideTask.delay(500)}},mouseover:function(a){this.autoHideSlideTask.cancel()},scope:this}}this.el.on(this.autoHideHd);this.collapsedEl.on(this.autoHideHd)}},clearAutoHide:function(){if(this.autoHide!==false){this.el.un("mouseout",this.autoHideHd.mouseout);this.el.un("mouseover",this.autoHideHd.mouseover);this.collapsedEl.un("mouseout",this.autoHideHd.mouseout);this.collapsedEl.un("mouseover",this.autoHideHd.mouseover)}},clearMonitor:function(){Ext.getDoc().un("click",this.slideInIf,this)},slideOut:function(){if(this.isSlid||this.el.hasActiveFx()){return}this.isSlid=true;var b=this.panel.tools,c,a;if(b&&b.toggle){b.toggle.hide()}this.el.show();a=this.panel.collapsed;this.panel.collapsed=false;if(this.position=="east"||this.position=="west"){c=this.panel.deferHeight;this.panel.deferHeight=false;this.panel.setSize(undefined,this.collapsedEl.getHeight());this.panel.deferHeight=c}else{this.panel.setSize(this.collapsedEl.getWidth(),undefined)}this.panel.collapsed=a;this.restoreLT=[this.el.dom.style.left,this.el.dom.style.top];this.el.alignTo(this.collapsedEl,this.getCollapseAnchor());this.el.setStyle("z-index",this.floatingZIndex+2);this.panel.el.replaceClass("x-panel-collapsed","x-panel-floating");if(this.animFloat!==false){this.beforeSlide();this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide();this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)},scope:this,block:true})}else{this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)}},afterSlideIn:function(){this.clearAutoHide();this.isSlid=false;this.clearMonitor();this.el.setStyle("z-index","");this.panel.el.replaceClass("x-panel-floating","x-panel-collapsed");this.el.dom.style.left=this.restoreLT[0];this.el.dom.style.top=this.restoreLT[1];var a=this.panel.tools;if(a&&a.toggle){a.toggle.show()}},slideIn:function(a){if(!this.isSlid||this.el.hasActiveFx()){Ext.callback(a);return}this.isSlid=false;if(this.animFloat!==false){this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.hide();this.afterSlide();this.afterSlideIn();Ext.callback(a)},scope:this,block:true})}else{this.el.hide();this.afterSlideIn()}},slideInIf:function(a){if(!a.within(this.el)){this.slideIn()}},anchors:{west:"left",east:"right",north:"top",south:"bottom"},sanchors:{west:"l",east:"r",north:"t",south:"b"},canchors:{west:"tl-tr",east:"tr-tl",north:"tl-bl",south:"bl-tl"},getAnchor:function(){return this.anchors[this.position]},getCollapseAnchor:function(){return this.canchors[this.position]},getSlideAnchor:function(){return this.sanchors[this.position]},getAlignAdj:function(){var a=this.cmargins;switch(this.position){case"west":return[0,0];break;case"east":return[0,0];break;case"north":return[0,0];break;case"south":return[0,0];break}},getExpandAdj:function(){var b=this.collapsedEl,a=this.cmargins;switch(this.position){case"west":return[-(a.right+b.getWidth()+a.left),0];break;case"east":return[a.right+b.getWidth()+a.left,0];break;case"north":return[0,-(a.top+a.bottom+b.getHeight())];break;case"south":return[0,a.top+a.bottom+b.getHeight()];break}},destroy:function(){if(this.autoHideSlideTask&&this.autoHideSlideTask.cancel){this.autoHideSlideTask.cancel()}Ext.destroy(this.miniCollapsedEl,this.collapsedEl)}};Ext.layout.BorderLayout.SplitRegion=function(b,a,c){Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this,b,a,c);this.applyLayout=this.applyFns[c]};Ext.extend(Ext.layout.BorderLayout.SplitRegion,Ext.layout.BorderLayout.Region,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,splitSettings:{north:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.TOP,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},south:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.BOTTOM,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},east:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.RIGHT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"},west:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.LEFT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"}},applyFns:{west:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;this.panel.setPosition(c.x,c.y);var a=d.offsetWidth;b.left=(c.x+c.width-a)+"px";b.top=(c.y)+"px";b.height=Math.max(0,c.height)+"px";this.panel.setSize(c.width-a,c.height)},east:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetWidth;this.panel.setPosition(c.x+a,c.y);b.left=(c.x)+"px";b.top=(c.y)+"px";b.height=Math.max(0,c.height)+"px";this.panel.setSize(c.width-a,c.height)},north:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetHeight;this.panel.setPosition(c.x,c.y);b.left=(c.x)+"px";b.top=(c.y+c.height-a)+"px";b.width=Math.max(0,c.width)+"px";this.panel.setSize(c.width,c.height-a)},south:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetHeight;this.panel.setPosition(c.x,c.y+a);b.left=(c.x)+"px";b.top=(c.y)+"px";b.width=Math.max(0,c.width)+"px";this.panel.setSize(c.width,c.height-a)}},render:function(a,c){Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this,a,c);var d=this.position;this.splitEl=a.createChild({cls:"x-layout-split x-layout-split-"+d,html:" ",id:this.panel.id+"-xsplit"});if(this.collapseMode=="mini"){this.miniSplitEl=this.splitEl.createChild({cls:"x-layout-mini x-layout-mini-"+d,html:" "});this.miniSplitEl.addClassOnOver("x-layout-mini-over");this.miniSplitEl.on("click",this.onCollapseClick,this,{stopEvent:true})}var b=this.splitSettings[d];this.split=new Ext.SplitBar(this.splitEl.dom,c.el,b.orientation);this.split.tickSize=this.tickSize;this.split.placement=b.placement;this.split.getMaximumSize=this[b.maxFn].createDelegate(this);this.split.minSize=this.minSize||this[b.minProp];this.split.on("beforeapply",this.onSplitMove,this);this.split.useShim=this.useShim===true;this.maxSize=this.maxSize||this[b.maxProp];if(c.hidden){this.splitEl.hide()}if(this.useSplitTips){this.splitEl.dom.title=this.collapsible?this.collapsibleSplitTip:this.splitTip}if(this.collapsible){this.splitEl.on("dblclick",this.onCollapseClick,this)}},getSize:function(){if(this.isCollapsed){return this.collapsedEl.getSize()}var a=this.panel.getSize();if(this.position=="north"||this.position=="south"){a.height+=this.splitEl.dom.offsetHeight}else{a.width+=this.splitEl.dom.offsetWidth}return a},getHMaxSize:function(){var b=this.maxSize||10000;var a=this.layout.center;return Math.min(b,(this.el.getWidth()+a.el.getWidth())-a.getMinWidth())},getVMaxSize:function(){var b=this.maxSize||10000;var a=this.layout.center;return Math.min(b,(this.el.getHeight()+a.el.getHeight())-a.getMinHeight())},onSplitMove:function(b,a){var c=this.panel.getSize();this.lastSplitSize=a;if(this.position=="north"||this.position=="south"){this.panel.setSize(c.width,a);this.state.height=a}else{this.panel.setSize(a,c.height);this.state.width=a}this.layout.layout();this.panel.saveState();return false},getSplitBar:function(){return this.split},destroy:function(){Ext.destroy(this.miniSplitEl,this.split,this.splitEl);Ext.layout.BorderLayout.SplitRegion.superclass.destroy.call(this)}});Ext.Container.LAYOUTS.border=Ext.layout.BorderLayout;Ext.layout.FormLayout=Ext.extend(Ext.layout.AnchorLayout,{labelSeparator:":",trackLabels:false,type:"form",onRemove:function(d){Ext.layout.FormLayout.superclass.onRemove.call(this,d);if(this.trackLabels){d.un("show",this.onFieldShow,this);d.un("hide",this.onFieldHide,this)}var b=d.getPositionEl(),a=d.getItemCt&&d.getItemCt();if(d.rendered&&a){if(b&&b.dom){b.insertAfter(a)}Ext.destroy(a);Ext.destroyMembers(d,"label","itemCt");if(d.customItemCt){Ext.destroyMembers(d,"getItemCt","customItemCt")}}},setContainer:function(a){Ext.layout.FormLayout.superclass.setContainer.call(this,a);if(a.labelAlign){a.addClass("x-form-label-"+a.labelAlign)}if(a.hideLabels){Ext.apply(this,{labelStyle:"display:none",elementStyle:"padding-left:0;",labelAdjust:0})}else{this.labelSeparator=a.labelSeparator||this.labelSeparator;a.labelWidth=a.labelWidth||100;if(Ext.isNumber(a.labelWidth)){var b=Ext.isNumber(a.labelPad)?a.labelPad:5;Ext.apply(this,{labelAdjust:a.labelWidth+b,labelStyle:"width:"+a.labelWidth+"px;",elementStyle:"padding-left:"+(a.labelWidth+b)+"px"})}if(a.labelAlign=="top"){Ext.apply(this,{labelStyle:"width:auto;",labelAdjust:0,elementStyle:"padding-left:0;"})}}},isHide:function(a){return a.hideLabel||this.container.hideLabels},onFieldShow:function(a){a.getItemCt().removeClass("x-hide-"+a.hideMode)},onFieldHide:function(a){a.getItemCt().addClass("x-hide-"+a.hideMode)},getLabelStyle:function(e){var b="",c=[this.labelStyle,e];for(var d=0,a=c.length;d=b)||(this.cells[c]&&this.cells[c][a])){if(b&&a>=b){c++;a=0}else{a++}}return[a,c]},renderItem:function(e,a,d){if(!this.table){this.table=d.createChild(Ext.apply({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},this.tableAttrs),null,true)}if(e&&!e.rendered){e.render(this.getNextCell(e));this.configureItem(e,a)}else{if(e&&!this.isValidParent(e,d)){var b=this.getNextCell(e);b.insertBefore(e.getPositionEl().dom,null);e.container=Ext.get(b);this.configureItem(e,a)}}},isValidParent:function(b,a){return b.getPositionEl().up("table",5).dom.parentNode===(a.dom||a)}});Ext.Container.LAYOUTS.table=Ext.layout.TableLayout;Ext.layout.AbsoluteLayout=Ext.extend(Ext.layout.AnchorLayout,{extraCls:"x-abs-layout-item",type:"absolute",onLayout:function(a,b){b.position();this.paddingLeft=b.getPadding("l");this.paddingTop=b.getPadding("t");Ext.layout.AbsoluteLayout.superclass.onLayout.call(this,a,b)},adjustWidthAnchor:function(b,a){return b?b-a.getPosition(true)[0]+this.paddingLeft:b},adjustHeightAnchor:function(b,a){return b?b-a.getPosition(true)[1]+this.paddingTop:b}});Ext.Container.LAYOUTS.absolute=Ext.layout.AbsoluteLayout;Ext.layout.BoxLayout=Ext.extend(Ext.layout.ContainerLayout,{defaultMargins:{left:0,top:0,right:0,bottom:0},padding:"0",pack:"start",monitorResize:true,type:"box",scrollOffset:0,extraCls:"x-box-item",targetCls:"x-box-layout-ct",innerCls:"x-box-inner",constructor:function(a){Ext.layout.BoxLayout.superclass.constructor.call(this,a);if(Ext.isString(this.defaultMargins)){this.defaultMargins=this.parseMargins(this.defaultMargins)}},onLayout:function(a,d){Ext.layout.BoxLayout.superclass.onLayout.call(this,a,d);var b=this.getVisibleItems(a),c=this.getLayoutTargetSize();this.layoutTargetLastSize=c;this.childBoxCache=this.calculateChildBoxes(b,c);this.updateInnerCtSize(c,this.childBoxCache);this.updateChildBoxes(this.childBoxCache.boxes);this.handleTargetOverflow(c,a,d)},updateChildBoxes:function(c){for(var b=0,e=c.length;b0){s.left=p+H+(r/2)}}z+=s.height+t.bottom}return{boxes:j,meta:{maxWidth:F}}}});Ext.Container.LAYOUTS.vbox=Ext.layout.VBoxLayout;Ext.layout.HBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"top",type:"hbox",updateInnerCtSize:function(b,d){var a=b.width,c=d.meta.maxHeight+this.padding.top+this.padding.bottom;if(this.align=="stretch"){c=b.height}else{if(this.align=="middle"){c=Math.max(b.height,c)}}this.innerCt.setSize(a||undefined,c||undefined)},calculateChildBoxes:function(A,e){var n=A.length,y=this.padding,D=y.top,r=y.left,s=D+y.bottom,a=r+y.right,C=e.width-this.scrollOffset,z=e.height,h=Math.max(0,z-s),o=this.pack=="start",p=this.pack=="center",q=this.pack=="end",J=0,B=0,E=0,m=[],l,d,g,c,x,G,F,v,I,j,t;for(F=0;F0){v.top=D+j+(u/2)}}r+=v.width+x.right}return{boxes:m,meta:{maxHeight:B}}}});Ext.Container.LAYOUTS.hbox=Ext.layout.HBoxLayout;Ext.layout.ToolbarLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"toolbar",triggerWidth:18,noItemsMenuText:'
    (None)
    ',lastOverflow:false,tableHTML:['',"","",'",'","","","
    ','',"",'',"","
    ","
    ','',"","","","","","","
    ",'',"",'',"","
    ","
    ",'',"",'',"","
    ","
    ","
    "].join(""),onLayout:function(e,j){if(!this.leftTr){var h=e.buttonAlign=="center"?"center":"left";j.addClass("x-toolbar-layout-ct");j.insertHtml("beforeEnd",String.format(this.tableHTML,h));this.leftTr=j.child("tr.x-toolbar-left-row",true);this.rightTr=j.child("tr.x-toolbar-right-row",true);this.extrasTr=j.child("tr.x-toolbar-extras-row",true);if(this.hiddenItem==undefined){this.hiddenItems=[]}}var k=e.buttonAlign=="right"?this.rightTr:this.leftTr,l=e.items.items,d=0;for(var b=0,g=l.length,m;b=0&&(d=e[a]);a--){if(!d.firstChild){b.removeChild(d)}}},insertCell:function(e,b,a){var d=document.createElement("td");d.className="x-toolbar-cell";b.insertBefore(d,b.childNodes[a]||null);return d},hideItem:function(a){this.hiddenItems.push(a);a.xtbHidden=true;a.xtbWidth=a.getPositionEl().dom.parentNode.offsetWidth;a.hide()},unhideItem:function(a){a.show();a.xtbHidden=false;this.hiddenItems.remove(a)},getItemWidth:function(a){return a.hidden?(a.xtbWidth||0):a.getPositionEl().dom.parentNode.offsetWidth},fitToSize:function(k){if(this.container.enableOverflow===false){return}var b=k.dom.clientWidth,j=k.dom.firstChild.offsetWidth,m=b-this.triggerWidth,a=this.lastWidth||0,c=this.hiddenItems,e=c.length!=0,n=b>=a;this.lastWidth=b;if(j>b||(e&&n)){var l=this.container.items.items,h=l.length,d=0,o;for(var g=0;gm){if(!(o.hidden||o.xtbHidden)){this.hideItem(o)}}else{if(o.xtbHidden){this.unhideItem(o)}}}}}e=c.length!=0;if(e){this.initMore();if(!this.lastOverflow){this.container.fireEvent("overflowchange",this.container,true);this.lastOverflow=true}}else{if(this.more){this.clearMenu();this.more.destroy();delete this.more;if(this.lastOverflow){this.container.fireEvent("overflowchange",this.container,false);this.lastOverflow=false}}}},createMenuConfig:function(c,a){var b=Ext.apply({},c.initialConfig),d=c.toggleGroup;Ext.copyTo(b,c,["iconCls","icon","itemId","disabled","handler","scope","menu"]);Ext.apply(b,{text:c.overflowText||c.text,hideOnClick:a});if(d||c.enableToggle){Ext.apply(b,{group:d,checked:c.pressed,listeners:{checkchange:function(g,e){c.toggle(e)}}})}delete b.ownerCt;delete b.xtype;delete b.id;return b},addComponentToMenu:function(b,a){if(a instanceof Ext.Toolbar.Separator){b.add("-")}else{if(Ext.isFunction(a.isXType)){if(a.isXType("splitbutton")){b.add(this.createMenuConfig(a,true))}else{if(a.isXType("button")){b.add(this.createMenuConfig(a,!a.menu))}else{if(a.isXType("buttongroup")){a.items.each(function(c){this.addComponentToMenu(b,c)},this)}}}}}},clearMenu:function(){var a=this.moreMenu;if(a&&a.items){a.items.each(function(b){delete b.menu})}},beforeMoreShow:function(h){var b=this.container.items.items,a=b.length,g,e;var c=function(j,i){return j.isXType("buttongroup")&&!(i instanceof Ext.Toolbar.Separator)};this.clearMenu();h.removeAll();for(var d=0;d','','',"","")}if(g&&!g.rendered){if(Ext.isNumber(b)){b=e.dom.childNodes[b]}var d=this.getItemArgs(g);g.render(g.positionEl=b?this.itemTpl.insertBefore(b,d,true):this.itemTpl.append(e,d,true));g.positionEl.menuItemId=g.getItemId();if(!d.isMenuItem&&d.needsIcon){g.positionEl.addClass("x-menu-list-item-indent")}this.configureItem(g,b)}else{if(g&&!this.isValidParent(g,e)){if(Ext.isNumber(b)){b=e.dom.childNodes[b]}e.dom.insertBefore(g.getActionEl().dom,b||null)}}},getItemArgs:function(b){var a=b instanceof Ext.menu.Item;return{isMenuItem:a,needsIcon:!a&&(b.icon||b.iconCls),icon:b.icon||Ext.BLANK_IMAGE_URL,iconCls:"x-menu-item-icon "+(b.iconCls||""),itemId:"x-menu-el-"+b.id,itemCls:"x-menu-list-item "}},isValidParent:function(b,a){return b.el.up("li.x-menu-list-item",5).dom.parentNode===(a.dom||a)},onLayout:function(a,b){Ext.layout.MenuLayout.superclass.onLayout.call(this,a,b);this.doAutoSize()},doAutoSize:function(){var c=this.container,a=c.width;if(c.floating){if(a){c.setWidth(a)}else{if(Ext.isIE){c.setWidth(Ext.isStrict&&(Ext.isIE7||Ext.isIE8)?"auto":c.minWidth);var d=c.getEl(),b=d.dom.offsetWidth;c.setWidth(c.getLayoutTarget().getWidth()+d.getFrameWidth("lr"))}}}}});Ext.Container.LAYOUTS.menu=Ext.layout.MenuLayout;Ext.Viewport=Ext.extend(Ext.Container,{initComponent:function(){Ext.Viewport.superclass.initComponent.call(this);document.getElementsByTagName("html")[0].className+=" x-viewport";this.el=Ext.getBody();this.el.setHeight=Ext.emptyFn;this.el.setWidth=Ext.emptyFn;this.el.setSize=Ext.emptyFn;this.el.dom.scroll="no";this.allowDomMove=false;this.autoWidth=true;this.autoHeight=true;Ext.EventManager.onWindowResize(this.fireResize,this);this.renderTo=this.el},fireResize:function(a,b){this.fireEvent("resize",this,a,b,a,b)}});Ext.reg("viewport",Ext.Viewport);Ext.Panel=Ext.extend(Ext.Container,{baseCls:"x-panel",collapsedCls:"x-panel-collapsed",maskDisabled:true,animCollapse:Ext.enableFx,headerAsText:true,buttonAlign:"right",collapsed:false,collapseFirst:true,minButtonWidth:75,elements:"body",preventBodyReset:false,padding:undefined,resizeEvent:"bodyresize",toolTarget:"header",collapseEl:"bwrap",slideAnchor:"t",disabledClass:"",deferHeight:true,expandDefaults:{duration:0.25},collapseDefaults:{duration:0.25},initComponent:function(){Ext.Panel.superclass.initComponent.call(this);this.addEvents("bodyresize","titlechange","iconchange","collapse","expand","beforecollapse","beforeexpand","beforeclose","close","activate","deactivate");if(this.unstyled){this.baseCls="x-plain"}this.toolbars=[];if(this.tbar){this.elements+=",tbar";this.topToolbar=this.createToolbar(this.tbar);this.tbar=null}if(this.bbar){this.elements+=",bbar";this.bottomToolbar=this.createToolbar(this.bbar);this.bbar=null}if(this.header===true){this.elements+=",header";this.header=null}else{if(this.headerCfg||(this.title&&this.header!==false)){this.elements+=",header"}}if(this.footerCfg||this.footer===true){this.elements+=",footer";this.footer=null}if(this.buttons){this.fbar=this.buttons;this.buttons=null}if(this.fbar){this.createFbar(this.fbar)}if(this.autoLoad){this.on("render",this.doAutoLoad,this,{delay:10})}},createFbar:function(b){var a=this.minButtonWidth;this.elements+=",footer";this.fbar=this.createToolbar(b,{buttonAlign:this.buttonAlign,toolbarCls:"x-panel-fbar",enableOverflow:false,defaults:function(d){return{minWidth:d.minWidth||a}}});this.fbar.items.each(function(d){d.minWidth=d.minWidth||this.minButtonWidth},this);this.buttons=this.fbar.items.items},createToolbar:function(b,c){var a;if(Ext.isArray(b)){b={items:b}}a=b.events?Ext.apply(b,c):this.createComponent(Ext.apply({},b,c),"toolbar");this.toolbars.push(a);return a},createElement:function(a,c){if(this[a]){c.appendChild(this[a].dom);return}if(a==="bwrap"||this.elements.indexOf(a)!=-1){if(this[a+"Cfg"]){this[a]=Ext.fly(c).createChild(this[a+"Cfg"])}else{var b=document.createElement("div");b.className=this[a+"Cls"];this[a]=Ext.get(c.appendChild(b))}if(this[a+"CssClass"]){this[a].addClass(this[a+"CssClass"])}if(this[a+"Style"]){this[a].applyStyles(this[a+"Style"])}}},onRender:function(g,e){Ext.Panel.superclass.onRender.call(this,g,e);this.createClasses();var a=this.el,h=a.dom,k,i;if(this.collapsible&&!this.hideCollapseTool){this.tools=this.tools?this.tools.slice(0):[];this.tools[this.collapseFirst?"unshift":"push"]({id:"toggle",handler:this.toggleCollapse,scope:this})}if(this.tools){i=this.tools;this.elements+=(this.header!==false)?",header":""}this.tools={};a.addClass(this.baseCls);if(h.firstChild){this.header=a.down("."+this.headerCls);this.bwrap=a.down("."+this.bwrapCls);var j=this.bwrap?this.bwrap:a;this.tbar=j.down("."+this.tbarCls);this.body=j.down("."+this.bodyCls);this.bbar=j.down("."+this.bbarCls);this.footer=j.down("."+this.footerCls);this.fromMarkup=true}if(this.preventBodyReset===true){a.addClass("x-panel-reset")}if(this.cls){a.addClass(this.cls)}if(this.buttons){this.elements+=",footer"}if(this.frame){a.insertHtml("afterBegin",String.format(Ext.Element.boxMarkup,this.baseCls));this.createElement("header",h.firstChild.firstChild.firstChild);this.createElement("bwrap",h);k=this.bwrap.dom;var c=h.childNodes[1],b=h.childNodes[2];k.appendChild(c);k.appendChild(b);var l=k.firstChild.firstChild.firstChild;this.createElement("tbar",l);this.createElement("body",l);this.createElement("bbar",l);this.createElement("footer",k.lastChild.firstChild.firstChild);if(!this.footer){this.bwrap.dom.lastChild.className+=" x-panel-nofooter"}this.ft=Ext.get(this.bwrap.dom.lastChild);this.mc=Ext.get(l)}else{this.createElement("header",h);this.createElement("bwrap",h);k=this.bwrap.dom;this.createElement("tbar",k);this.createElement("body",k);this.createElement("bbar",k);this.createElement("footer",k);if(!this.header){this.body.addClass(this.bodyCls+"-noheader");if(this.tbar){this.tbar.addClass(this.tbarCls+"-noheader")}}}if(Ext.isDefined(this.padding)){this.body.setStyle("padding",this.body.addUnits(this.padding))}if(this.border===false){this.el.addClass(this.baseCls+"-noborder");this.body.addClass(this.bodyCls+"-noborder");if(this.header){this.header.addClass(this.headerCls+"-noborder")}if(this.footer){this.footer.addClass(this.footerCls+"-noborder")}if(this.tbar){this.tbar.addClass(this.tbarCls+"-noborder")}if(this.bbar){this.bbar.addClass(this.bbarCls+"-noborder")}}if(this.bodyBorder===false){this.body.addClass(this.bodyCls+"-noborder")}this.bwrap.enableDisplayMode("block");if(this.header){this.header.unselectable();if(this.headerAsText){this.header.dom.innerHTML=''+this.header.dom.innerHTML+"";if(this.iconCls){this.setIconClass(this.iconCls)}}}if(this.floating){this.makeFloating(this.floating)}if(this.collapsible&&this.titleCollapse&&this.header){this.mon(this.header,"click",this.toggleCollapse,this);this.header.setStyle("cursor","pointer")}if(i){this.addTool.apply(this,i)}if(this.fbar){this.footer.addClass("x-panel-btns");this.fbar.ownerCt=this;this.fbar.render(this.footer);this.footer.createChild({cls:"x-clear"})}if(this.tbar&&this.topToolbar){this.topToolbar.ownerCt=this;this.topToolbar.render(this.tbar)}if(this.bbar&&this.bottomToolbar){this.bottomToolbar.ownerCt=this;this.bottomToolbar.render(this.bbar)}},setIconClass:function(b){var a=this.iconCls;this.iconCls=b;if(this.rendered&&this.header){if(this.frame){this.header.addClass("x-panel-icon");this.header.replaceClass(a,this.iconCls)}else{var e=this.header,c=e.child("img.x-panel-inline-icon");if(c){Ext.fly(c).replaceClass(a,this.iconCls)}else{var d=e.child("span."+this.headerTextCls);if(d){Ext.DomHelper.insertBefore(d.dom,{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-panel-inline-icon "+this.iconCls})}}}}this.fireEvent("iconchange",this,b,a)},makeFloating:function(a){this.floating=true;this.el=new Ext.Layer(Ext.apply({},a,{shadow:Ext.isDefined(this.shadow)?this.shadow:"sides",shadowOffset:this.shadowOffset,constrain:false,shim:this.shim===false?false:undefined}),this.el)},getTopToolbar:function(){return this.topToolbar},getBottomToolbar:function(){return this.bottomToolbar},getFooterToolbar:function(){return this.fbar},addButton:function(a,c,b){if(!this.fbar){this.createFbar([])}if(c){if(Ext.isString(a)){a={text:a}}a=Ext.apply({handler:c,scope:b},a)}return this.fbar.add(a)},addTool:function(){if(!this.rendered){if(!this.tools){this.tools=[]}Ext.each(arguments,function(a){this.tools.push(a)},this);return}if(!this[this.toolTarget]){return}if(!this.toolTemplate){var h=new Ext.Template('
     
    ');h.disableFormats=true;h.compile();Ext.Panel.prototype.toolTemplate=h}for(var g=0,d=arguments,c=d.length;g0){Ext.each(this.toolbars,function(c){c.doLayout(undefined,a)});this.syncHeight()}},syncHeight:function(){var b=this.toolbarHeight,c=this.body,a=this.lastSize.height,d;if(this.autoHeight||!Ext.isDefined(a)||a=="auto"){return}if(b!=this.getToolbarHeight()){b=Math.max(0,a-this.getFrameHeight());c.setHeight(b);d=c.getSize();this.toolbarHeight=this.getToolbarHeight();this.onBodyResize(d.width,d.height)}},onShow:function(){if(this.floating){return this.el.show()}Ext.Panel.superclass.onShow.call(this)},onHide:function(){if(this.floating){return this.el.hide()}Ext.Panel.superclass.onHide.call(this)},createToolHandler:function(c,a,d,b){return function(g){c.removeClass(d);if(a.stopEvent!==false){g.stopEvent()}if(a.handler){a.handler.call(a.scope||c,g,c,b,a)}}},afterRender:function(){if(this.floating&&!this.hidden){this.el.show()}if(this.title){this.setTitle(this.title)}Ext.Panel.superclass.afterRender.call(this);if(this.collapsed){this.collapsed=false;this.collapse(false)}this.initEvents()},getKeyMap:function(){if(!this.keyMap){this.keyMap=new Ext.KeyMap(this.el,this.keys)}return this.keyMap},initEvents:function(){if(this.keys){this.getKeyMap()}if(this.draggable){this.initDraggable()}if(this.toolbars.length>0){Ext.each(this.toolbars,function(a){a.doLayout();a.on({scope:this,afterlayout:this.syncHeight,remove:this.syncHeight})},this);this.syncHeight()}},initDraggable:function(){this.dd=new Ext.Panel.DD(this,Ext.isBoolean(this.draggable)?null:this.draggable)},beforeEffect:function(a){if(this.floating){this.el.beforeAction()}if(a!==false){this.el.addClass("x-panel-animated")}},afterEffect:function(a){this.syncShadow();this.el.removeClass("x-panel-animated")},createEffect:function(c,b,d){var e={scope:d,block:true};if(c===true){e.callback=b;return e}else{if(!c.callback){e.callback=b}else{e.callback=function(){b.call(d);Ext.callback(c.callback,c.scope)}}}return Ext.applyIf(e,c)},collapse:function(b){if(this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforecollapse",this,b)===false){return}var a=b===true||(b!==false&&this.animCollapse);this.beforeEffect(a);this.onCollapse(a,b);return this},onCollapse:function(a,b){if(a){this[this.collapseEl].slideOut(this.slideAnchor,Ext.apply(this.createEffect(b||true,this.afterCollapse,this),this.collapseDefaults))}else{this[this.collapseEl].hide(this.hideMode);this.afterCollapse(false)}},afterCollapse:function(a){this.collapsed=true;this.el.addClass(this.collapsedCls);if(a!==false){this[this.collapseEl].hide(this.hideMode)}this.afterEffect(a);this.cascade(function(b){if(b.lastSize){b.lastSize={width:0,height:0}}});this.fireEvent("collapse",this)},expand:function(b){if(!this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforeexpand",this,b)===false){return}var a=b===true||(b!==false&&this.animCollapse);this.el.removeClass(this.collapsedCls);this.beforeEffect(a);this.onExpand(a,b);return this},onExpand:function(a,b){if(a){this[this.collapseEl].slideIn(this.slideAnchor,Ext.apply(this.createEffect(b||true,this.afterExpand,this),this.expandDefaults))}else{this[this.collapseEl].show(this.hideMode);this.afterExpand(false)}},afterExpand:function(a){this.collapsed=false;if(a!==false){this[this.collapseEl].show(this.hideMode)}this.afterEffect(a);if(this.deferLayout){delete this.deferLayout;this.doLayout(true)}this.fireEvent("expand",this)},toggleCollapse:function(a){this[this.collapsed?"expand":"collapse"](a);return this},onDisable:function(){if(this.rendered&&this.maskDisabled){this.el.mask()}Ext.Panel.superclass.onDisable.call(this)},onEnable:function(){if(this.rendered&&this.maskDisabled){this.el.unmask()}Ext.Panel.superclass.onEnable.call(this)},onResize:function(g,d,c,e){var a=g,b=d;if(Ext.isDefined(a)||Ext.isDefined(b)){if(!this.collapsed){if(Ext.isNumber(a)){this.body.setWidth(a=this.adjustBodyWidth(a-this.getFrameWidth()))}else{if(a=="auto"){a=this.body.setWidth("auto").dom.offsetWidth}else{a=this.body.dom.offsetWidth}}if(this.tbar){this.tbar.setWidth(a);if(this.topToolbar){this.topToolbar.setSize(a)}}if(this.bbar){this.bbar.setWidth(a);if(this.bottomToolbar){this.bottomToolbar.setSize(a);if(Ext.isIE){this.bbar.setStyle("position","static");this.bbar.setStyle("position","")}}}if(this.footer){this.footer.setWidth(a);if(this.fbar){this.fbar.setSize(Ext.isIE?(a-this.footer.getFrameWidth("lr")):"auto")}}if(Ext.isNumber(b)){b=Math.max(0,b-this.getFrameHeight());this.body.setHeight(b)}else{if(b=="auto"){this.body.setHeight(b)}}if(this.disabled&&this.el._mask){this.el._mask.setSize(this.el.dom.clientWidth,this.el.getHeight())}}else{this.queuedBodySize={width:a,height:b};if(!this.queuedExpand&&this.allowQueuedExpand!==false){this.queuedExpand=true;this.on("expand",function(){delete this.queuedExpand;this.onResize(this.queuedBodySize.width,this.queuedBodySize.height)},this,{single:true})}}this.onBodyResize(a,b)}this.syncShadow();Ext.Panel.superclass.onResize.call(this,g,d,c,e)},onBodyResize:function(a,b){this.fireEvent("bodyresize",this,a,b)},getToolbarHeight:function(){var a=0;if(this.rendered){Ext.each(this.toolbars,function(b){a+=b.getHeight()},this)}return a},adjustBodyHeight:function(a){return a},adjustBodyWidth:function(a){return a},onPosition:function(){this.syncShadow()},getFrameWidth:function(){var b=this.el.getFrameWidth("lr")+this.bwrap.getFrameWidth("lr");if(this.frame){var a=this.bwrap.dom.firstChild;b+=(Ext.fly(a).getFrameWidth("l")+Ext.fly(a.firstChild).getFrameWidth("r"));b+=this.mc.getFrameWidth("lr")}return b},getFrameHeight:function(){var a=Math.max(0,this.getHeight()-this.body.getHeight());if(isNaN(a)){a=0}return a},getInnerWidth:function(){return this.getSize().width-this.getFrameWidth()},getInnerHeight:function(){return this.body.getHeight()},syncShadow:function(){if(this.floating){this.el.sync(true)}},getLayoutTarget:function(){return this.body},getContentTarget:function(){return this.body},setTitle:function(b,a){this.title=b;if(this.header&&this.headerAsText){this.header.child("span").update(b)}if(a){this.setIconClass(a)}this.fireEvent("titlechange",this,b);return this},getUpdater:function(){return this.body.getUpdater()},load:function(){var a=this.body.getUpdater();a.update.apply(a,arguments);return this},beforeDestroy:function(){Ext.Panel.superclass.beforeDestroy.call(this);if(this.header){this.header.removeAllListeners()}if(this.tools){for(var a in this.tools){Ext.destroy(this.tools[a])}}if(this.toolbars.length>0){Ext.each(this.toolbars,function(b){b.un("afterlayout",this.syncHeight,this);b.un("remove",this.syncHeight,this)},this)}if(Ext.isArray(this.buttons)){while(this.buttons.length){Ext.destroy(this.buttons[0])}}if(this.rendered){Ext.destroy(this.ft,this.header,this.footer,this.toolbars,this.tbar,this.bbar,this.body,this.mc,this.bwrap);if(this.fbar){Ext.destroy(this.fbar,this.fbar.el)}}else{Ext.destroy(this.topToolbar,this.bottomToolbar)}},createClasses:function(){this.headerCls=this.baseCls+"-header";this.headerTextCls=this.baseCls+"-header-text";this.bwrapCls=this.baseCls+"-bwrap";this.tbarCls=this.baseCls+"-tbar";this.bodyCls=this.baseCls+"-body";this.bbarCls=this.baseCls+"-bbar";this.footerCls=this.baseCls+"-footer"},createGhost:function(a,e,b){var d=document.createElement("div");d.className="x-panel-ghost "+(a?a:"");if(this.header){d.appendChild(this.el.dom.firstChild.cloneNode(true))}Ext.fly(d.appendChild(document.createElement("ul"))).setHeight(this.bwrap.getHeight());d.style.width=this.el.dom.offsetWidth+"px";if(!b){this.container.dom.appendChild(d)}else{Ext.getDom(b).appendChild(d)}if(e!==false&&this.el.useShim!==false){var c=new Ext.Layer({shadow:false,useDisplay:true,constrain:false},d);c.show();return c}else{return new Ext.Element(d)}},doAutoLoad:function(){var a=this.body.getUpdater();if(this.renderer){a.setRenderer(this.renderer)}a.update(Ext.isObject(this.autoLoad)?this.autoLoad:{url:this.autoLoad})},getTool:function(a){return this.tools[a]}});Ext.reg("panel",Ext.Panel);Ext.Editor=function(b,a){if(b.field){this.field=Ext.create(b.field,"textfield");a=Ext.apply({},b);delete a.field}else{this.field=b}Ext.Editor.superclass.constructor.call(this,a)};Ext.extend(Ext.Editor,Ext.Component,{allowBlur:true,value:"",alignment:"c-c?",offsets:[0,0],shadow:"frame",constrain:false,swallowKeys:true,completeOnEnter:true,cancelOnEsc:true,updateEl:false,initComponent:function(){Ext.Editor.superclass.initComponent.call(this);this.addEvents("beforestartedit","startedit","beforecomplete","complete","canceledit","specialkey")},onRender:function(b,a){this.el=new Ext.Layer({shadow:this.shadow,cls:"x-editor",parentEl:b,shim:this.shim,shadowOffset:this.shadowOffset||4,id:this.id,constrain:this.constrain});if(this.zIndex){this.el.setZIndex(this.zIndex)}this.el.setStyle("overflow",Ext.isGecko?"auto":"hidden");if(this.field.msgTarget!="title"){this.field.msgTarget="qtip"}this.field.inEditor=true;this.mon(this.field,{scope:this,blur:this.onBlur,specialkey:this.onSpecialKey});if(this.field.grow){this.mon(this.field,"autosize",this.el.sync,this.el,{delay:1})}this.field.render(this.el).show();this.field.getEl().dom.name="";if(this.swallowKeys){this.field.el.swallowEvent(["keypress","keydown"])}},onSpecialKey:function(g,d){var b=d.getKey(),a=this.completeOnEnter&&b==d.ENTER,c=this.cancelOnEsc&&b==d.ESC;if(a||c){d.stopEvent();if(a){this.completeEdit()}else{this.cancelEdit()}if(g.triggerBlur){g.triggerBlur()}}this.fireEvent("specialkey",g,d)},startEdit:function(b,c){if(this.editing){this.completeEdit()}this.boundEl=Ext.get(b);var a=c!==undefined?c:this.boundEl.dom.innerHTML;if(!this.rendered){this.render(this.parentEl||document.body)}if(this.fireEvent("beforestartedit",this,this.boundEl,a)!==false){this.startValue=a;this.field.reset();this.field.setValue(a);this.realign(true);this.editing=true;this.show()}},doAutoSize:function(){if(this.autoSize){var b=this.boundEl.getSize(),a=this.field.getSize();switch(this.autoSize){case"width":this.setSize(b.width,a.height);break;case"height":this.setSize(a.width,b.height);break;case"none":this.setSize(a.width,a.height);break;default:this.setSize(b.width,b.height)}}},setSize:function(a,b){delete this.field.lastSize;this.field.setSize(a,b);if(this.el){if(Ext.isGecko2||Ext.isOpera){this.el.setSize(a,b)}this.el.sync()}},realign:function(a){if(a===true){this.doAutoSize()}this.el.alignTo(this.boundEl,this.alignment,this.offsets)},completeEdit:function(a){if(!this.editing){return}if(this.field.assertValue){this.field.assertValue()}var b=this.getValue();if(!this.field.isValid()){if(this.revertInvalid!==false){this.cancelEdit(a)}return}if(String(b)===String(this.startValue)&&this.ignoreNoChange){this.hideEdit(a);return}if(this.fireEvent("beforecomplete",this,b,this.startValue)!==false){b=this.getValue();if(this.updateEl&&this.boundEl){this.boundEl.update(b)}this.hideEdit(a);this.fireEvent("complete",this,b,this.startValue)}},onShow:function(){this.el.show();if(this.hideEl!==false){this.boundEl.hide()}this.field.show().focus(false,true);this.fireEvent("startedit",this.boundEl,this.startValue)},cancelEdit:function(a){if(this.editing){var b=this.getValue();this.setValue(this.startValue);this.hideEdit(a);this.fireEvent("canceledit",this,b,this.startValue)}},hideEdit:function(a){if(a!==true){this.editing=false;this.hide()}},onBlur:function(){if(this.allowBlur===true&&this.editing&&this.selectSameEditor!==true){this.completeEdit()}},onHide:function(){if(this.editing){this.completeEdit();return}this.field.blur();if(this.field.collapse){this.field.collapse()}this.el.hide();if(this.hideEl!==false){this.boundEl.show()}},setValue:function(a){this.field.setValue(a)},getValue:function(){return this.field.getValue()},beforeDestroy:function(){Ext.destroyMembers(this,"field");delete this.parentEl;delete this.boundEl}});Ext.reg("editor",Ext.Editor);Ext.ColorPalette=Ext.extend(Ext.Component,{itemCls:"x-color-palette",value:null,clickEvent:"click",ctype:"Ext.ColorPalette",allowReselect:false,colors:["000000","993300","333300","003300","003366","000080","333399","333333","800000","FF6600","808000","008000","008080","0000FF","666699","808080","FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","969696","FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0","FF99CC","FFCC99","FFFF99","CCFFCC","CCFFFF","99CCFF","CC99FF","FFFFFF"],initComponent:function(){Ext.ColorPalette.superclass.initComponent.call(this);this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope,true)}},onRender:function(b,a){this.autoEl={tag:"div",cls:this.itemCls};Ext.ColorPalette.superclass.onRender.call(this,b,a);var c=this.tpl||new Ext.XTemplate(' ');c.overwrite(this.el,this.colors);this.mon(this.el,this.clickEvent,this.handleClick,this,{delegate:"a"});if(this.clickEvent!="click"){this.mon(this.el,"click",Ext.emptyFn,this,{delegate:"a",preventDefault:true})}},afterRender:function(){Ext.ColorPalette.superclass.afterRender.call(this);if(this.value){var a=this.value;this.value=null;this.select(a)}},handleClick:function(b,a){b.preventDefault();if(!this.disabled){var d=a.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];this.select(d.toUpperCase())}},select:function(a){a=a.replace("#","");if(a!=this.value||this.allowReselect){var b=this.el;if(this.value){b.child("a.color-"+this.value).removeClass("x-color-palette-sel")}b.child("a.color-"+a).addClass("x-color-palette-sel");this.value=a;this.fireEvent("select",this,a)}}});Ext.reg("colorpalette",Ext.ColorPalette);Ext.DatePicker=Ext.extend(Ext.BoxComponent,{todayText:"Today",okText:" OK ",cancelText:"Cancel",todayTip:"{0} (Spacebar)",minText:"This date is before the minimum date",maxText:"This date is after the maximum date",format:"m/d/y",disabledDaysText:"Disabled",disabledDatesText:"Disabled",monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:"Next Month (Control+Right)",prevText:"Previous Month (Control+Left)",monthYearText:"Choose a month (Control+Up/Down to move years)",startDay:0,showToday:true,focusOnSelect:true,initHour:12,initComponent:function(){Ext.DatePicker.superclass.initComponent.call(this);this.value=this.value?this.value.clearTime(true):new Date().clearTime();this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope||this)}this.initDisabledDays()},initDisabledDays:function(){if(!this.disabledDatesRE&&this.disabledDates){var b=this.disabledDates,a=b.length-1,c="(?:";Ext.each(b,function(g,e){c+=Ext.isDate(g)?"^"+Ext.escapeRe(g.dateFormat(this.format))+"$":b[e];if(e!=a){c+="|"}},this);this.disabledDatesRE=new RegExp(c+")")}},setDisabledDates:function(a){if(Ext.isArray(a)){this.disabledDates=a;this.disabledDatesRE=null}else{this.disabledDatesRE=a}this.initDisabledDays();this.update(this.value,true)},setDisabledDays:function(a){this.disabledDays=a;this.update(this.value,true)},setMinDate:function(a){this.minDate=a;this.update(this.value,true)},setMaxDate:function(a){this.maxDate=a;this.update(this.value,true)},setValue:function(a){this.value=a.clearTime(true);this.update(this.value)},getValue:function(){return this.value},focus:function(){this.update(this.activeDate)},onEnable:function(a){Ext.DatePicker.superclass.onEnable.call(this);this.doDisabled(false);this.update(a?this.value:this.activeDate);if(Ext.isIE){this.el.repaint()}},onDisable:function(){Ext.DatePicker.superclass.onDisable.call(this);this.doDisabled(true);if(Ext.isIE&&!Ext.isIE8){Ext.each([].concat(this.textNodes,this.el.query("th span")),function(a){Ext.fly(a).repaint()})}},doDisabled:function(a){this.keyNav.setDisabled(a);this.prevRepeater.setDisabled(a);this.nextRepeater.setDisabled(a);if(this.showToday){this.todayKeyListener.setDisabled(a);this.todayBtn.setDisabled(a)}},onRender:function(e,b){var a=['','','",this.showToday?'':"",'
      
    '],c=this.dayNames,h;for(h=0;h<7;h++){var k=this.startDay+h;if(k>6){k=k-7}a.push("")}a[a.length]="";for(h=0;h<42;h++){if(h%7===0&&h!==0){a[a.length]=""}a[a.length]=''}a.push("
    ",c[k].substr(0,1),"
    ');var j=document.createElement("div");j.className="x-date-picker";j.innerHTML=a.join("");e.dom.insertBefore(j,b);this.el=Ext.get(j);this.eventEl=Ext.get(j.firstChild);this.prevRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-left a"),{handler:this.showPrevMonth,scope:this,preventDefault:true,stopDefault:true});this.nextRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-right a"),{handler:this.showNextMonth,scope:this,preventDefault:true,stopDefault:true});this.monthPicker=this.el.down("div.x-date-mp");this.monthPicker.enableDisplayMode("block");this.keyNav=new Ext.KeyNav(this.eventEl,{left:function(d){if(d.ctrlKey){this.showPrevMonth()}else{this.update(this.activeDate.add("d",-1))}},right:function(d){if(d.ctrlKey){this.showNextMonth()}else{this.update(this.activeDate.add("d",1))}},up:function(d){if(d.ctrlKey){this.showNextYear()}else{this.update(this.activeDate.add("d",-7))}},down:function(d){if(d.ctrlKey){this.showPrevYear()}else{this.update(this.activeDate.add("d",7))}},pageUp:function(d){this.showNextMonth()},pageDown:function(d){this.showPrevMonth()},enter:function(d){d.stopPropagation();return true},scope:this});this.el.unselectable();this.cells=this.el.select("table.x-date-inner tbody td");this.textNodes=this.el.query("table.x-date-inner tbody span");this.mbtn=new Ext.Button({text:" ",tooltip:this.monthYearText,renderTo:this.el.child("td.x-date-middle",true)});this.mbtn.el.child("em").addClass("x-btn-arrow");if(this.showToday){this.todayKeyListener=this.eventEl.addKeyListener(Ext.EventObject.SPACE,this.selectToday,this);var g=(new Date()).dateFormat(this.format);this.todayBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom",true),text:String.format(this.todayText,g),tooltip:String.format(this.todayTip,g),handler:this.selectToday,scope:this})}this.mon(this.eventEl,"mousewheel",this.handleMouseWheel,this);this.mon(this.eventEl,"click",this.handleDateClick,this,{delegate:"a.x-date-date"});this.mon(this.mbtn,"click",this.showMonthPicker,this);this.onEnable(true)},createMonthPicker:function(){if(!this.monthPicker.dom.firstChild){var a=[''];for(var b=0;b<6;b++){a.push('",'",b===0?'':'')}a.push('","
    ',Date.getShortMonthName(b),"',Date.getShortMonthName(b+6),"
    ");this.monthPicker.update(a.join(""));this.mon(this.monthPicker,"click",this.onMonthClick,this);this.mon(this.monthPicker,"dblclick",this.onMonthDblClick,this);this.mpMonths=this.monthPicker.select("td.x-date-mp-month");this.mpYears=this.monthPicker.select("td.x-date-mp-year");this.mpMonths.each(function(c,d,e){e+=1;if((e%2)===0){c.dom.xmonth=5+Math.round(e*0.5)}else{c.dom.xmonth=Math.round((e-1)*0.5)}})}},showMonthPicker:function(){if(!this.disabled){this.createMonthPicker();var a=this.el.getSize();this.monthPicker.setSize(a);this.monthPicker.child("table").setSize(a);this.mpSelMonth=(this.activeDate||this.value).getMonth();this.updateMPMonth(this.mpSelMonth);this.mpSelYear=(this.activeDate||this.value).getFullYear();this.updateMPYear(this.mpSelYear);this.monthPicker.slideIn("t",{duration:0.2})}},updateMPYear:function(e){this.mpyear=e;var c=this.mpYears.elements;for(var b=1;b<=10;b++){var d=c[b-1],a;if((b%2)===0){a=e+Math.round(b*0.5);d.firstChild.innerHTML=a;d.xyear=a}else{a=e-(5-Math.round(b*0.5));d.firstChild.innerHTML=a;d.xyear=a}this.mpYears.item(b-1)[a==this.mpSelYear?"addClass":"removeClass"]("x-date-mp-sel")}},updateMPMonth:function(a){this.mpMonths.each(function(b,c,d){b[b.dom.xmonth==a?"addClass":"removeClass"]("x-date-mp-sel")})},selectMPMonth:function(a){},onMonthClick:function(g,b){g.stopEvent();var c=new Ext.Element(b),a;if(c.is("button.x-date-mp-cancel")){this.hideMonthPicker()}else{if(c.is("button.x-date-mp-ok")){var h=new Date(this.mpSelYear,this.mpSelMonth,(this.activeDate||this.value).getDate());if(h.getMonth()!=this.mpSelMonth){h=new Date(this.mpSelYear,this.mpSelMonth,1).getLastDateOfMonth()}this.update(h);this.hideMonthPicker()}else{if((a=c.up("td.x-date-mp-month",2))){this.mpMonths.removeClass("x-date-mp-sel");a.addClass("x-date-mp-sel");this.mpSelMonth=a.dom.xmonth}else{if((a=c.up("td.x-date-mp-year",2))){this.mpYears.removeClass("x-date-mp-sel");a.addClass("x-date-mp-sel");this.mpSelYear=a.dom.xyear}else{if(c.is("a.x-date-mp-prev")){this.updateMPYear(this.mpyear-10)}else{if(c.is("a.x-date-mp-next")){this.updateMPYear(this.mpyear+10)}}}}}}},onMonthDblClick:function(d,b){d.stopEvent();var c=new Ext.Element(b),a;if((a=c.up("td.x-date-mp-month",2))){this.update(new Date(this.mpSelYear,a.dom.xmonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}else{if((a=c.up("td.x-date-mp-year",2))){this.update(new Date(a.dom.xyear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}}},hideMonthPicker:function(a){if(this.monthPicker){if(a===true){this.monthPicker.hide()}else{this.monthPicker.slideOut("t",{duration:0.2})}}},showPrevMonth:function(a){this.update(this.activeDate.add("mo",-1))},showNextMonth:function(a){this.update(this.activeDate.add("mo",1))},showPrevYear:function(){this.update(this.activeDate.add("y",-1))},showNextYear:function(){this.update(this.activeDate.add("y",1))},handleMouseWheel:function(a){a.stopEvent();if(!this.disabled){var b=a.getWheelDelta();if(b>0){this.showPrevMonth()}else{if(b<0){this.showNextMonth()}}}},handleDateClick:function(b,a){b.stopEvent();if(!this.disabled&&a.dateValue&&!Ext.fly(a.parentNode).hasClass("x-date-disabled")){this.cancelFocus=this.focusOnSelect===false;this.setValue(new Date(a.dateValue));delete this.cancelFocus;this.fireEvent("select",this,this.value)}},selectToday:function(){if(this.todayBtn&&!this.todayBtn.disabled){this.setValue(new Date().clearTime());this.fireEvent("select",this,this.value)}},update:function(G,A){if(this.rendered){var a=this.activeDate,p=this.isVisible();this.activeDate=G;if(!A&&a&&this.el){var o=G.getTime();if(a.getMonth()==G.getMonth()&&a.getFullYear()==G.getFullYear()){this.cells.removeClass("x-date-selected");this.cells.each(function(d){if(d.dom.firstChild.dateValue==o){d.addClass("x-date-selected");if(p&&!this.cancelFocus){Ext.fly(d.dom.firstChild).focus(50)}return false}},this);return}}var k=G.getDaysInMonth(),q=G.getFirstDateOfMonth(),g=q.getDay()-this.startDay;if(g<0){g+=7}k+=g;var B=G.add("mo",-1),h=B.getDaysInMonth()-g,e=this.cells.elements,r=this.textNodes,D=(new Date(B.getFullYear(),B.getMonth(),h,this.initHour)),C=new Date().clearTime().getTime(),v=G.clearTime(true).getTime(),u=this.minDate?this.minDate.clearTime(true):Number.NEGATIVE_INFINITY,y=this.maxDate?this.maxDate.clearTime(true):Number.POSITIVE_INFINITY,F=this.disabledDatesRE,s=this.disabledDatesText,I=this.disabledDays?this.disabledDays.join(""):false,E=this.disabledDaysText,z=this.format;if(this.showToday){var m=new Date().clearTime(),c=(my||(F&&z&&F.test(m.dateFormat(z)))||(I&&I.indexOf(m.getDay())!=-1));if(!this.disabled){this.todayBtn.setDisabled(c);this.todayKeyListener[c?"disable":"enable"]()}}var l=function(K,d){d.title="";var i=D.clearTime(true).getTime();d.firstChild.dateValue=i;if(i==C){d.className+=" x-date-today";d.title=K.todayText}if(i==v){d.className+=" x-date-selected";if(p){Ext.fly(d.firstChild).focus(50)}}if(iy){d.className=" x-date-disabled";d.title=K.maxText;return}if(I){if(I.indexOf(D.getDay())!=-1){d.title=E;d.className=" x-date-disabled"}}if(F&&z){var J=D.dateFormat(z);if(F.test(J)){d.title=s.replace("%0",J);d.className=" x-date-disabled"}}};var x=0;for(;x=a.value){d=a.value}}c.setValue(b,d,false);c.fireEvent("drag",c,g,this)},getNewValue:function(){var a=this.slider,b=a.innerEl.translatePoints(this.tracker.getXY());return Ext.util.Format.round(a.reverseValue(b.left),a.decimalPrecision)},onDragEnd:function(c){var a=this.slider,b=this.value;this.el.removeClass("x-slider-thumb-drag");this.dragging=false;a.fireEvent("dragend",a,c);if(this.dragStartValue!=b){a.fireEvent("changecomplete",a,b,this)}}});Ext.slider.MultiSlider=Ext.extend(Ext.BoxComponent,{vertical:false,minValue:0,maxValue:100,decimalPrecision:0,keyIncrement:1,increment:0,clickRange:[5,15],clickToChange:true,animate:true,dragging:false,constrainThumbs:true,topThumbZIndex:10000,initComponent:function(){if(!Ext.isDefined(this.value)){this.value=this.minValue}this.thumbs=[];Ext.slider.MultiSlider.superclass.initComponent.call(this);this.keyIncrement=Math.max(this.increment,this.keyIncrement);this.addEvents("beforechange","change","changecomplete","dragstart","drag","dragend");if(this.values==undefined||Ext.isEmpty(this.values)){this.values=[0]}var a=this.values;for(var b=0;bthis.clickRange[0]&&c.top=c){d+=c}else{if(a*2<-c){d-=c}}}return d.constrain(this.minValue,this.maxValue)},afterRender:function(){Ext.slider.MultiSlider.superclass.afterRender.apply(this,arguments);for(var c=0;cb){this.thumbs[a].value=b}}},setValue:function(d,c,b,g){var a=this.thumbs[d],e=a.el;c=this.normalizeValue(c);if(c!==a.value&&this.fireEvent("beforechange",this,c,a.value)!==false){a.value=c;this.moveThumb(d,this.translateValue(c),b!==false);this.fireEvent("change",this,c,a);if(g){this.fireEvent("changecomplete",this,c,a)}}},translateValue:function(a){var b=this.getRatio();return(a*b)-(this.minValue*b)-this.halfThumb},reverseValue:function(b){var a=this.getRatio();return(b+(this.minValue*a))/a},moveThumb:function(d,c,b){var a=this.thumbs[d].el;if(!b||this.animate===false){a.setLeft(c)}else{a.shift({left:c,stopFx:true,duration:0.35})}},focus:function(){this.focusEl.focus(10)},onResize:function(c,e){var b=this.thumbs,a=b.length,d=0;for(;dthis.clickRange[0]&&c.left','
    ','
    ','
    ',"
     
    ","
    ","
    ",'
    ',"
     
    ","
    ","
    ","");this.el=a?c.insertBefore(a,{cls:this.baseCls},true):c.append(d,{cls:this.baseCls},true);if(this.id){this.el.dom.id=this.id}var b=this.el.dom.firstChild;this.progressBar=Ext.get(b.firstChild);if(this.textEl){this.textEl=Ext.get(this.textEl);delete this.textTopEl}else{this.textTopEl=Ext.get(this.progressBar.dom.firstChild);var e=Ext.get(b.childNodes[1]);this.textTopEl.setStyle("z-index",99).addClass("x-hidden");this.textEl=new Ext.CompositeElement([this.textTopEl.dom.firstChild,e.dom.firstChild]);this.textEl.setWidth(b.offsetWidth)}this.progressBar.setHeight(b.offsetHeight)},afterRender:function(){Ext.ProgressBar.superclass.afterRender.call(this);if(this.value){this.updateProgress(this.value,this.text)}else{this.updateText(this.text)}},updateProgress:function(c,d,b){this.value=c||0;if(d){this.updateText(d)}if(this.rendered&&!this.isDestroyed){var a=Math.floor(c*this.el.dom.firstChild.offsetWidth);this.progressBar.setWidth(a,b===true||(b!==false&&this.animate));if(this.textTopEl){this.textTopEl.removeClass("x-hidden").setWidth(a)}}this.fireEvent("update",this,c,d);return this},wait:function(b){if(!this.waitTimer){var a=this;b=b||{};this.updateText(b.text);this.waitTimer=Ext.TaskMgr.start({run:function(c){var d=b.increment||10;c-=1;this.updateProgress(((((c+d)%d)+1)*(100/d))*0.01,null,b.animate)},interval:b.interval||1000,duration:b.duration,onStop:function(){if(b.fn){b.fn.apply(b.scope||this)}this.reset()},scope:a})}return this},isWaiting:function(){return this.waitTimer!==null},updateText:function(a){this.text=a||" ";if(this.rendered){this.textEl.update(this.text)}return this},syncProgressBar:function(){if(this.value){this.updateProgress(this.value,this.text)}return this},setSize:function(a,c){Ext.ProgressBar.superclass.setSize.call(this,a,c);if(this.textTopEl){var b=this.el.dom.firstChild;this.textEl.setSize(b.offsetWidth,b.offsetHeight)}this.syncProgressBar();return this},reset:function(a){this.updateProgress(0);if(this.textTopEl){this.textTopEl.addClass("x-hidden")}this.clearTimer();if(a===true){this.hide()}return this},clearTimer:function(){if(this.waitTimer){this.waitTimer.onStop=null;Ext.TaskMgr.stop(this.waitTimer);this.waitTimer=null}},onDestroy:function(){this.clearTimer();if(this.rendered){if(this.textEl.isComposite){this.textEl.clear()}Ext.destroyMembers(this,"textEl","progressBar","textTopEl")}Ext.ProgressBar.superclass.onDestroy.call(this)}});Ext.reg("progress",Ext.ProgressBar);(function(){var a=Ext.EventManager;var b=Ext.lib.Dom;Ext.dd.DragDrop=function(e,c,d){if(e){this.init(e,c,d)}};Ext.dd.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true},moveOnly:false,unlock:function(){this.locked=false},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(c,d){},startDrag:function(c,d){},b4Drag:function(c){},onDrag:function(c){},onDragEnter:function(c,d){},b4DragOver:function(c){},onDragOver:function(c,d){},b4DragOut:function(c){},onDragOut:function(c,d){},b4DragDrop:function(c){},onDragDrop:function(c,d){},onInvalidDrop:function(c){},b4EndDrag:function(c){},endDrag:function(c){},b4MouseDown:function(c){},onMouseDown:function(c){},onMouseUp:function(c){},onAvailable:function(){},defaultPadding:{left:0,right:0,top:0,bottom:0},constrainTo:function(j,h,o){if(Ext.isNumber(h)){h={left:h,right:h,top:h,bottom:h}}h=h||this.defaultPadding;var l=Ext.get(this.getEl()).getBox(),d=Ext.get(j),n=d.getScroll(),k,e=d.dom;if(e==document.body){k={x:n.left,y:n.top,width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()}}else{var m=d.getXY();k={x:m[0],y:m[1],width:e.clientWidth,height:e.clientHeight}}var i=l.y-k.y,g=l.x-k.x;this.resetConstraints();this.setXConstraint(g-(h.left||0),k.width-g-l.width-(h.right||0),this.xTickSize);this.setYConstraint(i-(h.top||0),k.height-i-l.height-(h.bottom||0),this.yTickSize)},getEl:function(){if(!this._domRef){this._domRef=Ext.getDom(this.id)}return this._domRef},getDragEl:function(){return Ext.getDom(this.dragElId)},init:function(e,c,d){this.initTarget(e,c,d);a.on(this.id,"mousedown",this.handleMouseDown,this)},initTarget:function(e,c,d){this.config=d||{};this.DDM=Ext.dd.DDM;this.groups={};if(typeof e!=="string"){e=Ext.id(e)}this.id=e;this.addToGroup((c)?c:"default");this.handleElId=e;this.setDragElId(e);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();this.handleOnAvailable()},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false)},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable()},setPadding:function(e,c,g,d){if(!c&&0!==c){this.padding=[e,e,e,e]}else{if(!g&&0!==g){this.padding=[e,c,e,c]}else{this.padding=[e,c,g,d]}}},setInitPosition:function(g,e){var h=this.getEl();if(!this.DDM.verifyEl(h)){return}var d=g||0;var c=e||0;var i=b.getXY(h);this.initPageX=i[0]-d;this.initPageY=i[1]-c;this.lastPageX=i[0];this.lastPageY=i[1];this.setStartPosition(i)},setStartPosition:function(d){var c=d||b.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=c[0];this.startPageY=c[1]},addToGroup:function(c){this.groups[c]=true;this.DDM.regDragDrop(this,c)},removeFromGroup:function(c){if(this.groups[c]){delete this.groups[c]}this.DDM.removeDDFromGroup(this,c)},setDragElId:function(c){this.dragElId=c},setHandleElId:function(c){if(typeof c!=="string"){c=Ext.id(c)}this.handleElId=c;this.DDM.regHandle(this.id,c)},setOuterHandleElId:function(c){if(typeof c!=="string"){c=Ext.id(c)}a.on(c,"mousedown",this.handleMouseDown,this);this.setHandleElId(c);this.hasOuterHandles=true},unreg:function(){a.un(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this)},destroy:function(){this.unreg()},isLocked:function(){return(this.DDM.isLocked()||this.locked)},handleMouseDown:function(g,d){if(this.primaryButtonOnly&&g.button!=0){return}if(this.isLocked()){return}this.DDM.refreshCache(this.groups);var c=new Ext.lib.Point(Ext.lib.Event.getPageX(g),Ext.lib.Event.getPageY(g));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(c,this)){}else{if(this.clickValidator(g)){this.setStartPosition();this.b4MouseDown(g);this.onMouseDown(g);this.DDM.handleMouseDown(g,this);this.DDM.stopEvent(g)}else{}}},clickValidator:function(d){var c=d.getTarget();return(this.isValidHandleChild(c)&&(this.id==this.handleElId||this.DDM.handleWasClicked(c,this.id)))},addInvalidHandleType:function(c){var d=c.toUpperCase();this.invalidHandleTypes[d]=d},addInvalidHandleId:function(c){if(typeof c!=="string"){c=Ext.id(c)}this.invalidHandleIds[c]=c},addInvalidHandleClass:function(c){this.invalidHandleClasses.push(c)},removeInvalidHandleType:function(c){var d=c.toUpperCase();delete this.invalidHandleTypes[d]},removeInvalidHandleId:function(c){if(typeof c!=="string"){c=Ext.id(c)}delete this.invalidHandleIds[c]},removeInvalidHandleClass:function(d){for(var e=0,c=this.invalidHandleClasses.length;e=this.minX;d=d-c){if(!e[d]){this.xTicks[this.xTicks.length]=d;e[d]=true}}for(d=this.initPageX;d<=this.maxX;d=d+c){if(!e[d]){this.xTicks[this.xTicks.length]=d;e[d]=true}}this.xTicks.sort(this.DDM.numericSort)},setYTicks:function(g,c){this.yTicks=[];this.yTickSize=c;var e={};for(var d=this.initPageY;d>=this.minY;d=d-c){if(!e[d]){this.yTicks[this.yTicks.length]=d;e[d]=true}}for(d=this.initPageY;d<=this.maxY;d=d+c){if(!e[d]){this.yTicks[this.yTicks.length]=d;e[d]=true}}this.yTicks.sort(this.DDM.numericSort)},setXConstraint:function(e,d,c){this.leftConstraint=e;this.rightConstraint=d;this.minX=this.initPageX-e;this.maxX=this.initPageX+d;if(c){this.setXTicks(this.initPageX,c)}this.constrainX=true},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks()},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0},setYConstraint:function(c,e,d){this.topConstraint=c;this.bottomConstraint=e;this.minY=this.initPageY-c;this.maxY=this.initPageY+e;if(d){this.setYTicks(this.initPageY,d)}this.constrainY=true},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var d=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var c=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(d,c)}else{this.setInitPosition()}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize)}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize)}},getTick:function(k,g){if(!g){return k}else{if(g[0]>=k){return g[0]}else{for(var d=0,c=g.length;d=k){var j=k-g[d];var h=g[e]-k;return(h>j)?g[d]:g[e]}}return g[g.length-1]}}},toString:function(){return("DragDrop "+this.id)}}})(); -/* - * The drag and drop utility provides a framework for building drag and drop - * applications. In addition to enabling drag and drop for specific elements, - * the drag and drop elements are tracked by the manager class, and the - * interactions between the various elements are tracked during the drag and - * the implementing code is notified about these important moments. - */ -if(!Ext.dd.DragDropMgr){Ext.dd.DragDropMgr=function(){var a=Ext.EventManager;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,init:function(){this.initialized=true},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(d,c){for(var e in this.ids){for(var b in this.ids[e]){var g=this.ids[e][b];if(!this.isTypeOfDD(g)){continue}g[d].apply(g,c)}}},_onLoad:function(){this.init();a.on(document,"mouseup",this.handleMouseUp,this,true);a.on(document,"mousemove",this.handleMouseMove,this,true);a.on(window,"unload",this._onUnload,this,true);a.on(window,"resize",this._onResize,this,true)},_onResize:function(b){this._execOnAll("resetConstraints",[])},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){return this.locked},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:350,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(c,b){if(!this.initialized){this.init()}if(!this.ids[b]){this.ids[b]={}}this.ids[b][c.id]=c},removeDDFromGroup:function(d,b){if(!this.ids[b]){this.ids[b]={}}var c=this.ids[b];if(c&&c[d.id]){delete c[d.id]}},_remove:function(c){for(var b in c.groups){if(b&&this.ids[b]&&this.ids[b][c.id]){delete this.ids[b][c.id]}}delete this.handleIds[c.id]},regHandle:function(c,b){if(!this.handleIds[c]){this.handleIds[c]={}}this.handleIds[c][b]=b},isDragDrop:function(b){return(this.getDDById(b))?true:false},getRelated:function(h,c){var g=[];for(var e in h.groups){for(var d in this.ids[e]){var b=this.ids[e][d];if(!this.isTypeOfDD(b)){continue}if(!c||b.isTarget){g[g.length]=b}}}return g},isLegalTarget:function(g,e){var c=this.getRelated(g,true);for(var d=0,b=c.length;dthis.clickPixelThresh||b>this.clickPixelThresh){this.startDrag(this.startX,this.startY)}}if(this.dragThreshMet){this.dragCurrent.b4Drag(d);this.dragCurrent.onDrag(d);if(!this.dragCurrent.moveOnly){this.fireEvents(d,false)}}this.stopEvent(d);return true},fireEvents:function(n,o){var q=this.dragCurrent;if(!q||q.isLocked()){return}var r=n.getPoint();var b=[];var g=[];var l=[];var j=[];var d=[];for(var h in this.dragOvers){var c=this.dragOvers[h];if(!this.isTypeOfDD(c)){continue}if(!this.isOverTarget(r,c,this.mode)){g.push(c)}b[h]=true;delete this.dragOvers[h]}for(var p in q.groups){if("string"!=typeof p){continue}for(h in this.ids[p]){var k=this.ids[p][h];if(!this.isTypeOfDD(k)){continue}if(k.isTarget&&!k.isLocked()&&((k!=q)||(q.ignoreSelf===false))){if(this.isOverTarget(r,k,this.mode)){if(o){j.push(k)}else{if(!b[k.id]){d.push(k)}else{l.push(k)}this.dragOvers[k.id]=k}}}}}if(this.mode){if(g.length){q.b4DragOut(n,g);q.onDragOut(n,g)}if(d.length){q.onDragEnter(n,d)}if(l.length){q.b4DragOver(n,l);q.onDragOver(n,l)}if(j.length){q.b4DragDrop(n,j);q.onDragDrop(n,j)}}else{var m=0;for(h=0,m=g.length;h2000){}else{setTimeout(b._addListeners,10);if(document&&document.body){b._timeoutCount+=1}}}},handleWasClicked:function(b,d){if(this.isHandle(d,b.id)){return true}else{var c=b.parentNode;while(c){if(this.isHandle(d,c.id)){return true}else{c=c.parentNode}}}return false}}}();Ext.dd.DDM=Ext.dd.DragDropMgr;Ext.dd.DDM._addListeners()}Ext.dd.DD=function(c,a,b){if(c){this.init(c,a,b)}};Ext.extend(Ext.dd.DD,Ext.dd.DragDrop,{scroll:true,autoOffset:function(c,b){var a=c-this.startPageX;var d=b-this.startPageY;this.setDelta(a,d)},setDelta:function(b,a){this.deltaX=b;this.deltaY=a},setDragElPos:function(c,b){var a=this.getDragEl();this.alignElWithMouse(a,c,b)},alignElWithMouse:function(c,h,g){var e=this.getTargetCoord(h,g);var b=c.dom?c:Ext.fly(c,"_dd");if(!this.deltaSetXY){var i=[e.x,e.y];b.setXY(i);var d=b.getLeft(true);var a=b.getTop(true);this.deltaSetXY=[d-e.x,a-e.y]}else{b.setLeftTop(e.x+this.deltaSetXY[0],e.y+this.deltaSetXY[1])}this.cachePosition(e.x,e.y);this.autoScroll(e.x,e.y,c.offsetHeight,c.offsetWidth);return e},cachePosition:function(b,a){if(b){this.lastPageX=b;this.lastPageY=a}else{var c=Ext.lib.Dom.getXY(this.getEl());this.lastPageX=c[0];this.lastPageY=c[1]}},autoScroll:function(l,k,e,m){if(this.scroll){var n=Ext.lib.Dom.getViewHeight();var b=Ext.lib.Dom.getViewWidth();var p=this.DDM.getScrollTop();var d=this.DDM.getScrollLeft();var j=e+k;var o=m+l;var i=(n+p-k-this.deltaY);var g=(b+d-l-this.deltaX);var c=40;var a=(document.all)?80:30;if(j>n&&i0&&k-pb&&g0&&l-dthis.maxX){a=this.maxX}}if(this.constrainY){if(dthis.maxY){d=this.maxY}}a=this.getTick(a,this.xTicks);d=this.getTick(d,this.yTicks);return{x:a,y:d}},applyConfig:function(){Ext.dd.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false)},b4MouseDown:function(a){this.autoOffset(a.getPageX(),a.getPageY())},b4Drag:function(a){this.setDragElPos(a.getPageX(),a.getPageY())},toString:function(){return("DD "+this.id)}});Ext.dd.DDProxy=function(c,a,b){if(c){this.init(c,a,b);this.initFrame()}};Ext.dd.DDProxy.dragElId="ygddfdiv";Ext.extend(Ext.dd.DDProxy,Ext.dd.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var b=this;var a=document.body;if(!a||!a.firstChild){setTimeout(function(){b.createFrame()},50);return}var d=this.getDragEl();if(!d){d=document.createElement("div");d.id=this.dragElId;var c=d.style;c.position="absolute";c.visibility="hidden";c.cursor="move";c.border="2px solid #aaa";c.zIndex=999;a.insertBefore(d,a.firstChild)}},initFrame:function(){this.createFrame()},applyConfig:function(){Ext.dd.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||Ext.dd.DDProxy.dragElId)},showFrame:function(e,d){var c=this.getEl();var a=this.getDragEl();var b=a.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(b.width,10)/2),Math.round(parseInt(b.height,10)/2))}this.setDragElPos(e,d);Ext.fly(a).show()},_resizeProxy:function(){if(this.resizeFrame){var a=this.getEl();Ext.fly(this.getDragEl()).setSize(a.offsetWidth,a.offsetHeight)}},b4MouseDown:function(b){var a=b.getPageX();var c=b.getPageY();this.autoOffset(a,c);this.setDragElPos(a,c)},b4StartDrag:function(a,b){this.showFrame(a,b)},b4EndDrag:function(a){Ext.fly(this.getDragEl()).hide()},endDrag:function(c){var b=this.getEl();var a=this.getDragEl();a.style.visibility="";this.beforeMove();b.style.visibility="hidden";Ext.dd.DDM.moveToEl(b,a);a.style.visibility="hidden";b.style.visibility="";this.afterDrag()},beforeMove:function(){},afterDrag:function(){},toString:function(){return("DDProxy "+this.id)}});Ext.dd.DDTarget=function(c,a,b){if(c){this.initTarget(c,a,b)}};Ext.extend(Ext.dd.DDTarget,Ext.dd.DragDrop,{getDragEl:Ext.emptyFn,isValidHandleChild:Ext.emptyFn,startDrag:Ext.emptyFn,endDrag:Ext.emptyFn,onDrag:Ext.emptyFn,onDragDrop:Ext.emptyFn,onDragEnter:Ext.emptyFn,onDragOut:Ext.emptyFn,onDragOver:Ext.emptyFn,onInvalidDrop:Ext.emptyFn,onMouseDown:Ext.emptyFn,onMouseUp:Ext.emptyFn,setXConstraint:Ext.emptyFn,setYConstraint:Ext.emptyFn,resetConstraints:Ext.emptyFn,clearConstraints:Ext.emptyFn,clearTicks:Ext.emptyFn,setInitPosition:Ext.emptyFn,setDragElId:Ext.emptyFn,setHandleElId:Ext.emptyFn,setOuterHandleElId:Ext.emptyFn,addInvalidHandleClass:Ext.emptyFn,addInvalidHandleId:Ext.emptyFn,addInvalidHandleType:Ext.emptyFn,removeInvalidHandleClass:Ext.emptyFn,removeInvalidHandleId:Ext.emptyFn,removeInvalidHandleType:Ext.emptyFn,toString:function(){return("DDTarget "+this.id)}});Ext.dd.DragTracker=Ext.extend(Ext.util.Observable,{active:false,tolerance:5,autoStart:false,constructor:function(a){Ext.apply(this,a);this.addEvents("mousedown","mouseup","mousemove","dragstart","dragend","drag");this.dragRegion=new Ext.lib.Region(0,0,0,0);if(this.el){this.initEl(this.el)}Ext.dd.DragTracker.superclass.constructor.call(this,a)},initEl:function(a){this.el=Ext.get(a);a.on("mousedown",this.onMouseDown,this,this.delegate?{delegate:this.delegate}:undefined)},destroy:function(){this.el.un("mousedown",this.onMouseDown,this)},onMouseDown:function(c,b){if(this.fireEvent("mousedown",this,c)!==false&&this.onBeforeStart(c)!==false){this.startXY=this.lastXY=c.getXY();this.dragTarget=this.delegate?b:this.el.dom;if(this.preventDefault!==false){c.preventDefault()}var a=Ext.getDoc();a.on("mouseup",this.onMouseUp,this);a.on("mousemove",this.onMouseMove,this);a.on("selectstart",this.stopSelect,this);if(this.autoStart){this.timer=this.triggerStart.defer(this.autoStart===true?1000:this.autoStart,this)}}},onMouseMove:function(d,c){if(this.active&&Ext.isIE&&!d.browserEvent.button){d.preventDefault();this.onMouseUp(d);return}d.preventDefault();var b=d.getXY(),a=this.startXY;this.lastXY=b;if(!this.active){if(Math.abs(a[0]-b[0])>this.tolerance||Math.abs(a[1]-b[1])>this.tolerance){this.triggerStart()}else{return}}this.fireEvent("mousemove",this,d);this.onDrag(d);this.fireEvent("drag",this,d)},onMouseUp:function(c){var b=Ext.getDoc();b.un("mousemove",this.onMouseMove,this);b.un("mouseup",this.onMouseUp,this);b.un("selectstart",this.stopSelect,this);c.preventDefault();this.clearStart();var a=this.active;this.active=false;delete this.elRegion;this.fireEvent("mouseup",this,c);if(a){this.onEnd(c);this.fireEvent("dragend",this,c)}},triggerStart:function(a){this.clearStart();this.active=true;this.onStart(this.startXY);this.fireEvent("dragstart",this,this.startXY)},clearStart:function(){if(this.timer){clearTimeout(this.timer);delete this.timer}},stopSelect:function(a){a.stopEvent();return false},onBeforeStart:function(a){},onStart:function(a){},onDrag:function(a){},onEnd:function(a){},getDragTarget:function(){return this.dragTarget},getDragCt:function(){return this.el},getXY:function(a){return a?this.constrainModes[a].call(this,this.lastXY):this.lastXY},getOffset:function(c){var b=this.getXY(c);var a=this.startXY;return[a[0]-b[0],a[1]-b[1]]},constrainModes:{point:function(b){if(!this.elRegion){this.elRegion=this.getDragCt().getRegion()}var a=this.dragRegion;a.left=b[0];a.top=b[1];a.right=b[0];a.bottom=b[1];a.constrainTo(this.elRegion);return[a.left,a.top]}}});Ext.dd.ScrollManager=function(){var c=Ext.dd.DragDropMgr;var e={};var b=null;var i={};var h=function(l){b=null;a()};var j=function(){if(c.dragCurrent){c.refreshCache(c.dragCurrent.groups)}};var d=function(){if(c.dragCurrent){var l=Ext.dd.ScrollManager;var m=i.el.ddScrollConfig?i.el.ddScrollConfig.increment:l.increment;if(!l.animate){if(i.el.scroll(i.dir,m)){j()}}else{i.el.scroll(i.dir,m,true,l.animDuration,j)}}};var a=function(){if(i.id){clearInterval(i.id)}i.id=0;i.el=null;i.dir=""};var g=function(m,l){a();i.el=m;i.dir=l;var n=(m.ddScrollConfig&&m.ddScrollConfig.frequency)?m.ddScrollConfig.frequency:Ext.dd.ScrollManager.frequency;i.id=setInterval(d,n)};var k=function(o,q){if(q||!c.dragCurrent){return}var s=Ext.dd.ScrollManager;if(!b||b!=c.dragCurrent){b=c.dragCurrent;s.refreshCache()}var t=Ext.lib.Event.getXY(o);var u=new Ext.lib.Point(t[0],t[1]);for(var m in e){var n=e[m],l=n._region;var p=n.ddScrollConfig?n.ddScrollConfig:s;if(l&&l.contains(u)&&n.isScrollable()){if(l.bottom-u.y<=p.vthresh){if(i.el!=n){g(n,"down")}return}else{if(l.right-u.x<=p.hthresh){if(i.el!=n){g(n,"left")}return}else{if(u.y-l.top<=p.vthresh){if(i.el!=n){g(n,"up")}return}else{if(u.x-l.left<=p.hthresh){if(i.el!=n){g(n,"right")}return}}}}}}a()};c.fireEvents=c.fireEvents.createSequence(k,c);c.stopDrag=c.stopDrag.createSequence(h,c);return{register:function(n){if(Ext.isArray(n)){for(var m=0,l=n.length;m]+>/gi,asText:function(a){return String(a).replace(this.stripTagsRE,"")},asUCText:function(a){return String(a).toUpperCase().replace(this.stripTagsRE,"")},asUCString:function(a){return String(a).toUpperCase()},asDate:function(a){if(!a){return 0}if(Ext.isDate(a)){return a.getTime()}return Date.parse(String(a))},asFloat:function(a){var b=parseFloat(String(a).replace(/,/g,""));return isNaN(b)?0:b},asInt:function(a){var b=parseInt(String(a).replace(/,/g,""),10);return isNaN(b)?0:b}};Ext.data.Record=function(a,b){this.id=(b||b===0)?b:Ext.data.Record.id(this);this.data=a||{}};Ext.data.Record.create=function(e){var c=Ext.extend(Ext.data.Record,{});var d=c.prototype;d.fields=new Ext.util.MixedCollection(false,function(g){return g.name});for(var b=0,a=e.length;b-1){a.join(null);this.data.removeAt(b)}if(this.pruneModifiedRecords){this.modified.remove(a)}if(this.snapshot){this.snapshot.remove(a)}if(b>-1){this.fireEvent("remove",this,a,b)}},removeAt:function(a){this.remove(this.getAt(a))},removeAll:function(b){var a=[];this.each(function(c){a.push(c)});this.clearData();if(this.snapshot){this.snapshot.clear()}if(this.pruneModifiedRecords){this.modified=[]}if(b!==true){this.fireEvent("clear",this,a)}},onClear:function(b,a){Ext.each(a,function(d,c){this.destroyRecord(this,d,c)},this)},insert:function(c,b){b=[].concat(b);for(var d=0,a=b.length;d=0;d--){if(b[d].phantom===true){var a=b.splice(d,1).shift();if(a.isValid()){g.push(a)}}else{if(!b[d].isValid()){b.splice(d,1)}}}if(g.length){h.push(["create",g])}if(b.length){h.push(["update",b])}}j=h.length;if(j){e=++this.batchCounter;for(var d=0;d=0;b--){this.modified.splice(this.modified.indexOf(a[b]),1)}}else{this.modified.splice(this.modified.indexOf(a),1)}},reMap:function(b){if(Ext.isArray(b)){for(var d=0,a=b.length;d=0;c--){this.insert(b[c].lastIndex,b[c])}}},handleException:function(a){Ext.handleError(a)},reload:function(a){this.load(Ext.applyIf(a||{},this.lastOptions))},loadRecords:function(h,b,g){if(this.isDestroyed===true){return}if(!h||g===false){if(g!==false){this.fireEvent("load",this,[],b)}if(b.callback){b.callback.call(b.scope||this,[],b,false,h)}return}var e=h.records,d=h.totalRecords||e.length;if(!b||b.add!==true){if(this.pruneModifiedRecords){this.modified=[]}for(var c=0,a=e.length;c1){for(var p=1,o=c.length;ph?1:(i=0;b--){if(Ext.isArray(c)){this.realize(a.splice(b,1).shift(),c.splice(b,1).shift())}else{this.realize(a.splice(b,1).shift(),c)}}}else{if(Ext.isArray(c)&&c.length==1){c=c.shift()}if(!this.isData(c)){throw new Ext.data.DataReader.Error("realize",a)}a.phantom=false;a._phid=a.id;a.id=this.getId(c);a.data=c;a.commit()}},update:function(a,c){if(Ext.isArray(a)){for(var b=a.length-1;b>=0;b--){if(Ext.isArray(c)){this.update(a.splice(b,1).shift(),c.splice(b,1).shift())}else{this.update(a.splice(b,1).shift(),c)}}}else{if(Ext.isArray(c)&&c.length==1){c=c.shift()}if(this.isData(c)){a.data=Ext.apply(a.data,c)}a.commit()}},extractData:function(k,a){var j=(this instanceof Ext.data.JsonReader)?"json":"node";var c=[];if(this.isData(k)&&!(this instanceof Ext.data.XmlReader)){k=[k]}var h=this.recordType.prototype.fields,o=h.items,m=h.length,c=[];if(a===true){var l=this.recordType;for(var e=0;e=0){return new Function("obj","return obj"+(b>0?".":"")+c)}return function(d){return d[c]}}}(),extractValues:function(h,d,a){var g,c={};for(var e=0;e<\u003fxml version="{version}" encoding="{encoding}"\u003f><{documentRoot}><{name}>{value}<{root}><{parent.record}><{name}>{value}',render:function(b,c,a){c=this.toArray(c);b.xmlData=this.tpl.applyTemplate({version:this.xmlVersion,encoding:this.xmlEncoding,documentRoot:(c.length>0||this.forceDocumentRoot===true)?this.documentRoot:false,record:this.meta.record,root:this.root,baseParams:c,records:(Ext.isArray(a[0]))?a:[a]})},createRecord:function(a){return this.toArray(this.toHash(a))},updateRecord:function(a){return this.toArray(this.toHash(a))},destroyRecord:function(b){var a={};a[this.meta.idProperty]=b.id;return this.toArray(a)}});Ext.data.XmlReader=function(a,b){a=a||{};Ext.applyIf(a,{idProperty:a.idProperty||a.idPath||a.id,successProperty:a.successProperty||a.success});Ext.data.XmlReader.superclass.constructor.call(this,a,b||a.fields)};Ext.extend(Ext.data.XmlReader,Ext.data.DataReader,{read:function(a){var b=a.responseXML;if(!b){throw {message:"XmlReader.read: XML Document not available"}}return this.readRecords(b)},readRecords:function(d){this.xmlData=d;var a=d.documentElement||d,c=Ext.DomQuery,g=0,e=true;if(this.meta.totalProperty){g=this.getTotal(a,0)}if(this.meta.successProperty){e=this.getSuccess(a)}var b=this.extractData(c.select(this.meta.record,a),true);return{success:e,records:b,totalRecords:g||b.length}},readResponse:function(e,a){var d=Ext.DomQuery,g=a.responseXML;var b=new Ext.data.Response({action:e,success:this.getSuccess(g),message:this.getMessage(g),data:this.extractData(d.select(this.meta.record,g)||d.select(this.meta.root,g),false),raw:g});if(Ext.isEmpty(b.success)){throw new Ext.data.DataReader.Error("successProperty-response",this.meta.successProperty)}if(e===Ext.data.Api.actions.create){var c=Ext.isDefined(b.data);if(c&&Ext.isEmpty(b.data)){throw new Ext.data.JsonReader.Error("root-empty",this.meta.root)}else{if(!c){throw new Ext.data.JsonReader.Error("root-undefined-response",this.meta.root)}}}return b},getSuccess:function(){return true},buildExtractors:function(){if(this.ef){return}var l=this.meta,h=this.recordType,e=h.prototype.fields,k=e.items,j=e.length;if(l.totalProperty){this.getTotal=this.createAccessor(l.totalProperty)}if(l.successProperty){this.getSuccess=this.createAccessor(l.successProperty)}if(l.messageProperty){this.getMessage=this.createAccessor(l.messageProperty)}this.getRoot=function(g){return(!Ext.isEmpty(g[this.meta.record]))?g[this.meta.record]:g[this.meta.root]};if(l.idPath||l.idProperty){var d=this.createAccessor(l.idPath||l.idProperty);this.getId=function(g){var i=d(g)||g.id;return(i===undefined||i==="")?null:i}}else{this.getId=function(){return null}}var c=[];for(var b=0;b0&&sorters[0].field==this.groupField){sorters.shift()}this.groupField=d;this.groupDir=c;this.applyGroupField();var b=function(){this.fireEvent("groupchange",this,this.getGroupState())};if(this.groupOnSort){this.sort(d,c);b.call(this);return}if(this.remoteGroup){this.on("load",b,this,{single:true});this.reload()}else{this.sort(sorters);b.call(this)}},sort:function(h,c){if(this.remoteSort){return Ext.data.GroupingStore.superclass.sort.call(this,h,c)}var g=[];if(Ext.isArray(arguments[0])){g=arguments[0]}else{if(h==undefined){g=[this.sortInfo]}else{var e=this.fields.get(h);if(!e){return false}var b=e.name,a=this.sortInfo||null,d=this.sortToggle?this.sortToggle[b]:null;if(!c){if(a&&a.field==b){c=(this.sortToggle[b]||"ASC").toggle("ASC","DESC")}else{c=e.sortDir}}this.sortToggle[b]=c;this.sortInfo={field:b,direction:c};g=[this.sortInfo]}}if(this.groupField){g.unshift({direction:this.groupDir,field:this.groupField})}return this.multiSort.call(this,g,c)},applyGroupField:function(){if(this.remoteGroup){if(!this.baseParams){this.baseParams={}}Ext.apply(this.baseParams,{groupBy:this.groupField,groupDir:this.groupDir});var a=this.lastOptions;if(a&&a.params){a.params.groupDir=this.groupDir;delete a.params.groupBy}}},applyGrouping:function(a){if(this.groupField!==false){this.groupBy(this.groupField,true,this.groupDir);return true}else{if(a===true){this.fireEvent("datachanged",this)}return false}},getGroupState:function(){return this.groupOnSort&&this.groupField!==false?(this.sortInfo?this.sortInfo.field:undefined):this.groupField}});Ext.reg("groupingstore",Ext.data.GroupingStore);Ext.data.DirectProxy=function(a){Ext.apply(this,a);if(typeof this.paramOrder=="string"){this.paramOrder=this.paramOrder.split(/[\s,|]/)}Ext.data.DirectProxy.superclass.constructor.call(this,a)};Ext.extend(Ext.data.DirectProxy,Ext.data.DataProxy,{paramOrder:undefined,paramsAsHash:true,directFn:undefined,doRequest:function(b,c,a,e,k,l,n){var j=[],h=this.api[b]||this.directFn;switch(b){case Ext.data.Api.actions.create:j.push(a.jsonData);break;case Ext.data.Api.actions.read:if(h.directCfg.method.len>0){if(this.paramOrder){for(var d=0,g=this.paramOrder.length;d1){for(var d=0,b=c.length;d0){this.doSend(a==1?this.callBuffer[0]:this.callBuffer);this.callBuffer=[]}},queueTransaction:function(a){if(a.form){this.processForm(a);return}this.callBuffer.push(a);if(this.enableBuffer){if(!this.callTask){this.callTask=new Ext.util.DelayedTask(this.combineAndSend,this)}this.callTask.delay(Ext.isNumber(this.enableBuffer)?this.enableBuffer:10)}else{this.combineAndSend()}},doCall:function(i,a,b){var h=null,e=b[a.len],g=b[a.len+1];if(a.len!==0){h=b.slice(0,a.len)}var d=new Ext.Direct.Transaction({provider:this,args:b,action:i,method:a.name,data:h,cb:g&&Ext.isFunction(e)?e.createDelegate(g):e});if(this.fireEvent("beforecall",this,d)!==false){Ext.Direct.addTransaction(d);this.queueTransaction(d);this.fireEvent("call",this,d)}},doForm:function(j,b,g,i,e){var d=new Ext.Direct.Transaction({provider:this,action:j,method:b.name,args:[g,i,e],cb:e&&Ext.isFunction(i)?i.createDelegate(e):i,isForm:true});if(this.fireEvent("beforecall",this,d)!==false){Ext.Direct.addTransaction(d);var a=String(g.getAttribute("enctype")).toLowerCase()=="multipart/form-data",h={extTID:d.tid,extAction:j,extMethod:b.name,extType:"rpc",extUpload:String(a)};Ext.apply(d,{form:Ext.getDom(g),isUpload:a,params:i&&Ext.isObject(i.params)?Ext.apply(h,i.params):h});this.fireEvent("call",this,d);this.processForm(d)}},processForm:function(a){Ext.Ajax.request({url:this.url,params:a.params,callback:this.onData,scope:this,form:a.form,isUpload:a.isUpload,ts:a})},createMethod:function(d,a){var b;if(!a.formHandler){b=function(){this.doCall(d,a,Array.prototype.slice.call(arguments,0))}.createDelegate(this)}else{b=function(e,g,c){this.doForm(d,a,e,g,c)}.createDelegate(this)}b.directCfg={action:d,method:a};return b},getTransaction:function(a){return a&&a.tid?Ext.Direct.getTransaction(a.tid):null},doCallback:function(c,g){var d=g.status?"success":"failure";if(c&&c.cb){var b=c.cb,a=Ext.isDefined(g.result)?g.result:g.data;if(Ext.isFunction(b)){b(a,g)}else{Ext.callback(b[d],b.scope,[a,g]);Ext.callback(b.callback,b.scope,[a,g])}}}});Ext.Direct.PROVIDERS.remoting=Ext.direct.RemotingProvider;Ext.Resizable=Ext.extend(Ext.util.Observable,{constructor:function(d,e){this.el=Ext.get(d);if(e&&e.wrap){e.resizeChild=this.el;this.el=this.el.wrap(typeof e.wrap=="object"?e.wrap:{cls:"xresizable-wrap"});this.el.id=this.el.dom.id=e.resizeChild.id+"-rzwrap";this.el.setStyle("overflow","hidden");this.el.setPositioning(e.resizeChild.getPositioning());e.resizeChild.clearPositioning();if(!e.width||!e.height){var g=e.resizeChild.getSize();this.el.setSize(g.width,g.height)}if(e.pinned&&!e.adjustments){e.adjustments="auto"}}this.proxy=this.el.createProxy({tag:"div",cls:"x-resizable-proxy",id:this.el.id+"-rzproxy"},Ext.getBody());this.proxy.unselectable();this.proxy.enableDisplayMode("block");Ext.apply(this,e);if(this.pinned){this.disableTrackOver=true;this.el.addClass("x-resizable-pinned")}var k=this.el.getStyle("position");if(k!="absolute"&&k!="fixed"){this.el.setStyle("position","relative")}if(!this.handles){this.handles="s,e,se";if(this.multiDirectional){this.handles+=",n,w"}}if(this.handles=="all"){this.handles="n s e w ne nw se sw"}var o=this.handles.split(/\s*?[,;]\s*?| /);var c=Ext.Resizable.positions;for(var j=0,l=o.length;j0){if(a>(e/2)){d=c+(e-a)}else{d=c-a}}return Math.max(b,d)},resizeElement:function(){var a=this.proxy.getBox();if(this.updateBox){this.el.setBox(a,false,this.animate,this.duration,null,this.easing)}else{this.el.setSize(a.width,a.height,this.animate,this.duration,null,this.easing)}this.updateChildSize();if(!this.dynamic){this.proxy.hide()}if(this.draggable&&this.constrainTo){this.dd.resetConstraints();this.dd.constrainTo(this.constrainTo)}return a},constrain:function(b,c,a,d){if(b-cd){c=b-d}}return c},onMouseMove:function(z){if(this.enabled&&this.activeHandle){try{if(this.resizeRegion&&!this.resizeRegion.contains(z.getPoint())){return}var t=this.curSize||this.startBox,l=this.startBox.x,k=this.startBox.y,c=l,b=k,m=t.width,u=t.height,d=m,o=u,n=this.minWidth,A=this.minHeight,s=this.maxWidth,D=this.maxHeight,i=this.widthIncrement,a=this.heightIncrement,B=z.getXY(),r=-(this.startPoint[0]-Math.max(this.minX,B[0])),p=-(this.startPoint[1]-Math.max(this.minY,B[1])),j=this.activeHandle.position,E,g;switch(j){case"east":m+=r;m=Math.min(Math.max(n,m),s);break;case"south":u+=p;u=Math.min(Math.max(A,u),D);break;case"southeast":m+=r;u+=p;m=Math.min(Math.max(n,m),s);u=Math.min(Math.max(A,u),D);break;case"north":p=this.constrain(u,p,A,D);k+=p;u-=p;break;case"west":r=this.constrain(m,r,n,s);l+=r;m-=r;break;case"northeast":m+=r;m=Math.min(Math.max(n,m),s);p=this.constrain(u,p,A,D);k+=p;u-=p;break;case"northwest":r=this.constrain(m,r,n,s);p=this.constrain(u,p,A,D);k+=p;u-=p;l+=r;m-=r;break;case"southwest":r=this.constrain(m,r,n,s);u+=p;u=Math.min(Math.max(A,u),D);l+=r;m-=r;break}var q=this.snap(m,i,n);var C=this.snap(u,a,A);if(q!=m||C!=u){switch(j){case"northeast":k-=C-u;break;case"north":k-=C-u;break;case"southwest":l-=q-m;break;case"west":l-=q-m;break;case"northwest":l-=q-m;k-=C-u;break}m=q;u=C}if(this.preserveRatio){switch(j){case"southeast":case"east":u=o*(m/d);u=Math.min(Math.max(A,u),D);m=d*(u/o);break;case"south":m=d*(u/o);m=Math.min(Math.max(n,m),s);u=o*(m/d);break;case"northeast":m=d*(u/o);m=Math.min(Math.max(n,m),s);u=o*(m/d);break;case"north":E=m;m=d*(u/o);m=Math.min(Math.max(n,m),s);u=o*(m/d);l+=(E-m)/2;break;case"southwest":u=o*(m/d);u=Math.min(Math.max(A,u),D);E=m;m=d*(u/o);l+=E-m;break;case"west":g=u;u=o*(m/d);u=Math.min(Math.max(A,u),D);k+=(g-u)/2;E=m;m=d*(u/o);l+=E-m;break;case"northwest":E=m;g=u;u=o*(m/d);u=Math.min(Math.max(A,u),D);m=d*(u/o);k+=g-u;l+=E-m;break}}this.proxy.setBounds(l,k,m,u);if(this.dynamic){this.resizeElement()}}catch(v){}}},handleOver:function(){if(this.enabled){this.el.addClass("x-resizable-over")}},handleOut:function(){if(!this.resizing){this.el.removeClass("x-resizable-over")}},getEl:function(){return this.el},getResizeChild:function(){return this.resizeChild},destroy:function(b){Ext.destroy(this.dd,this.overlay,this.proxy);this.overlay=null;this.proxy=null;var c=Ext.Resizable.positions;for(var a in c){if(typeof c[a]!="function"&&this[c[a]]){this[c[a]].destroy()}}if(b){this.el.update("");Ext.destroy(this.el);this.el=null}this.purgeListeners()},syncHandleHeight:function(){var a=this.el.getHeight(true);if(this.west){this.west.el.setHeight(a)}if(this.east){this.east.el.setHeight(a)}}});Ext.Resizable.positions={n:"north",s:"south",e:"east",w:"west",se:"southeast",sw:"southwest",nw:"northwest",ne:"northeast"};Ext.Resizable.Handle=Ext.extend(Object,{constructor:function(d,g,c,e,a){if(!this.tpl){var b=Ext.DomHelper.createTemplate({tag:"div",cls:"x-resizable-handle x-resizable-handle-{0}"});b.compile();Ext.Resizable.Handle.prototype.tpl=b}this.position=g;this.rz=d;this.el=this.tpl.append(d.el.dom,[this.position],true);this.el.unselectable();if(e){this.el.setOpacity(0)}if(!Ext.isEmpty(a)){this.el.addClass(a)}this.el.on("mousedown",this.onMouseDown,this);if(!c){this.el.on({scope:this,mouseover:this.onMouseOver,mouseout:this.onMouseOut})}},afterResize:function(a){},onMouseDown:function(a){this.rz.onMouseDown(this,a)},onMouseOver:function(a){this.rz.handleOver(this,a)},onMouseOut:function(a){this.rz.handleOut(this,a)},destroy:function(){Ext.destroy(this.el);this.el=null}});Ext.Window=Ext.extend(Ext.Panel,{baseCls:"x-window",resizable:true,draggable:true,closable:true,closeAction:"close",constrain:false,constrainHeader:false,plain:false,minimizable:false,maximizable:false,minHeight:100,minWidth:200,expandOnShow:true,collapsible:false,initHidden:undefined,hidden:true,elements:"header,body",frame:true,floating:true,initComponent:function(){this.initTools();Ext.Window.superclass.initComponent.call(this);this.addEvents("resize","maximize","minimize","restore");if(Ext.isDefined(this.initHidden)){this.hidden=this.initHidden}if(this.hidden===false){this.hidden=true;this.show()}},getState:function(){return Ext.apply(Ext.Window.superclass.getState.call(this)||{},this.getBox(true))},onRender:function(b,a){Ext.Window.superclass.onRender.call(this,b,a);if(this.plain){this.el.addClass("x-window-plain")}this.focusEl=this.el.createChild({tag:"a",href:"#",cls:"x-dlg-focus",tabIndex:"-1",html:" "});this.focusEl.swallowEvent("click",true);this.proxy=this.el.createProxy("x-window-proxy");this.proxy.enableDisplayMode("block");if(this.modal){this.mask=this.container.createChild({cls:"ext-el-mask"},this.el.dom);this.mask.enableDisplayMode("block");this.mask.hide();this.mon(this.mask,"click",this.focus,this)}if(this.maximizable){this.mon(this.header,"dblclick",this.toggleMaximize,this)}},initEvents:function(){Ext.Window.superclass.initEvents.call(this);if(this.animateTarget){this.setAnimateTarget(this.animateTarget)}if(this.resizable){this.resizer=new Ext.Resizable(this.el,{minWidth:this.minWidth,minHeight:this.minHeight,handles:this.resizeHandles||"all",pinned:true,resizeElement:this.resizerAction,handleCls:"x-window-handle"});this.resizer.window=this;this.mon(this.resizer,"beforeresize",this.beforeResize,this)}if(this.draggable){this.header.addClass("x-window-draggable")}this.mon(this.el,"mousedown",this.toFront,this);this.manager=this.manager||Ext.WindowMgr;this.manager.register(this);if(this.maximized){this.maximized=false;this.maximize()}if(this.closable){var a=this.getKeyMap();a.on(27,this.onEsc,this);a.disable()}},initDraggable:function(){this.dd=new Ext.Window.DD(this)},onEsc:function(a,b){b.stopEvent();this[this.closeAction]()},beforeDestroy:function(){if(this.rendered){this.hide();this.clearAnchor();Ext.destroy(this.focusEl,this.resizer,this.dd,this.proxy,this.mask)}Ext.Window.superclass.beforeDestroy.call(this)},onDestroy:function(){if(this.manager){this.manager.unregister(this)}Ext.Window.superclass.onDestroy.call(this)},initTools:function(){if(this.minimizable){this.addTool({id:"minimize",handler:this.minimize.createDelegate(this,[])})}if(this.maximizable){this.addTool({id:"maximize",handler:this.maximize.createDelegate(this,[])});this.addTool({id:"restore",handler:this.restore.createDelegate(this,[]),hidden:true})}if(this.closable){this.addTool({id:"close",handler:this[this.closeAction].createDelegate(this,[])})}},resizerAction:function(){var a=this.proxy.getBox();this.proxy.hide();this.window.handleResize(a);return a},beforeResize:function(){this.resizer.minHeight=Math.max(this.minHeight,this.getFrameHeight()+40);this.resizer.minWidth=Math.max(this.minWidth,this.getFrameWidth()+40);this.resizeBox=this.el.getBox()},updateHandles:function(){if(Ext.isIE&&this.resizer){this.resizer.syncHandleHeight();this.el.repaint()}},handleResize:function(b){var a=this.resizeBox;if(a.x!=b.x||a.y!=b.y){this.updateBox(b)}else{this.setSize(b);if(Ext.isIE6&&Ext.isStrict){this.doLayout()}}this.focus();this.updateHandles();this.saveState()},focus:function(){var e=this.focusEl,a=this.defaultButton,c=typeof a,d,b;if(Ext.isDefined(a)){if(Ext.isNumber(a)&&this.fbar){e=this.fbar.items.get(a)}else{if(Ext.isString(a)){e=Ext.getCmp(a)}else{e=a}}d=e.getEl();b=Ext.getDom(this.container);if(d&&b){if(!Ext.lib.Region.getRegion(b).contains(Ext.lib.Region.getRegion(d.dom))){return}}}e=e||this.focusEl;e.focus.defer(10,e)},setAnimateTarget:function(a){a=Ext.get(a);this.animateTarget=a},beforeShow:function(){delete this.el.lastXY;delete this.el.lastLT;if(this.x===undefined||this.y===undefined){var a=this.el.getAlignToXY(this.container,"c-c");var b=this.el.translatePoints(a[0],a[1]);this.x=this.x===undefined?b.left:this.x;this.y=this.y===undefined?b.top:this.y}this.el.setLeftTop(this.x,this.y);if(this.expandOnShow){this.expand(false)}if(this.modal){Ext.getBody().addClass("x-body-masked");this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.mask.show()}},show:function(c,a,b){if(!this.rendered){this.render(Ext.getBody())}if(this.hidden===false){this.toFront();return this}if(this.fireEvent("beforeshow",this)===false){return this}if(a){this.on("show",a,b,{single:true})}this.hidden=false;if(Ext.isDefined(c)){this.setAnimateTarget(c)}this.beforeShow();if(this.animateTarget){this.animShow()}else{this.afterShow()}return this},afterShow:function(b){if(this.isDestroyed){return false}this.proxy.hide();this.el.setStyle("display","block");this.el.show();if(this.maximized){this.fitContainer()}if(Ext.isMac&&Ext.isGecko2){this.cascade(this.setAutoScroll)}if(this.monitorResize||this.modal||this.constrain||this.constrainHeader){Ext.EventManager.onWindowResize(this.onWindowResize,this)}this.doConstrain();this.doLayout();if(this.keyMap){this.keyMap.enable()}this.toFront();this.updateHandles();if(b&&(Ext.isIE||Ext.isWebKit)){var a=this.getSize();this.onResize(a.width,a.height)}this.onShow();this.fireEvent("show",this)},animShow:function(){this.proxy.show();this.proxy.setBox(this.animateTarget.getBox());this.proxy.setOpacity(0);var a=this.getBox();this.el.setStyle("display","none");this.proxy.shift(Ext.apply(a,{callback:this.afterShow.createDelegate(this,[true],false),scope:this,easing:"easeNone",duration:0.25,opacity:0.5}))},hide:function(c,a,b){if(this.hidden||this.fireEvent("beforehide",this)===false){return this}if(a){this.on("hide",a,b,{single:true})}this.hidden=true;if(c!==undefined){this.setAnimateTarget(c)}if(this.modal){this.mask.hide();Ext.getBody().removeClass("x-body-masked")}if(this.animateTarget){this.animHide()}else{this.el.hide();this.afterHide()}return this},afterHide:function(){this.proxy.hide();if(this.monitorResize||this.modal||this.constrain||this.constrainHeader){Ext.EventManager.removeResizeListener(this.onWindowResize,this)}if(this.keyMap){this.keyMap.disable()}this.onHide();this.fireEvent("hide",this)},animHide:function(){this.proxy.setOpacity(0.5);this.proxy.show();var a=this.getBox(false);this.proxy.setBox(a);this.el.hide();this.proxy.shift(Ext.apply(this.animateTarget.getBox(),{callback:this.afterHide,scope:this,duration:0.25,easing:"easeNone",opacity:0}))},onShow:Ext.emptyFn,onHide:Ext.emptyFn,onWindowResize:function(){if(this.maximized){this.fitContainer()}if(this.modal){this.mask.setSize("100%","100%");var a=this.mask.dom.offsetHeight;this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true))}this.doConstrain()},doConstrain:function(){if(this.constrain||this.constrainHeader){var b;if(this.constrain){b={right:this.el.shadowOffset,left:this.el.shadowOffset,bottom:this.el.shadowOffset}}else{var a=this.getSize();b={right:-(a.width-100),bottom:-(a.height-25)}}var c=this.el.getConstrainToXY(this.container,true,b);if(c){this.setPosition(c[0],c[1])}}},ghost:function(a){var c=this.createGhost(a);var b=this.getBox(true);c.setLeftTop(b.x,b.y);c.setWidth(b.width);this.el.hide();this.activeGhost=c;return c},unghost:function(b,a){if(!this.activeGhost){return}if(b!==false){this.el.show();this.focus.defer(10,this);if(Ext.isMac&&Ext.isGecko2){this.cascade(this.setAutoScroll)}}if(a!==false){this.setPosition(this.activeGhost.getLeft(true),this.activeGhost.getTop(true))}this.activeGhost.hide();this.activeGhost.remove();delete this.activeGhost},minimize:function(){this.fireEvent("minimize",this);return this},close:function(){if(this.fireEvent("beforeclose",this)!==false){if(this.hidden){this.doClose()}else{this.hide(null,this.doClose,this)}}},doClose:function(){this.fireEvent("close",this);this.destroy()},maximize:function(){if(!this.maximized){this.expand(false);this.restoreSize=this.getSize();this.restorePos=this.getPosition(true);if(this.maximizable){this.tools.maximize.hide();this.tools.restore.show()}this.maximized=true;this.el.disableShadow();if(this.dd){this.dd.lock()}if(this.collapsible){this.tools.toggle.hide()}this.el.addClass("x-window-maximized");this.container.addClass("x-window-maximized-ct");this.setPosition(0,0);this.fitContainer();this.fireEvent("maximize",this)}return this},restore:function(){if(this.maximized){var a=this.tools;this.el.removeClass("x-window-maximized");if(a.restore){a.restore.hide()}if(a.maximize){a.maximize.show()}this.setPosition(this.restorePos[0],this.restorePos[1]);this.setSize(this.restoreSize.width,this.restoreSize.height);delete this.restorePos;delete this.restoreSize;this.maximized=false;this.el.enableShadow(true);if(this.dd){this.dd.unlock()}if(this.collapsible&&a.toggle){a.toggle.show()}this.container.removeClass("x-window-maximized-ct");this.doConstrain();this.fireEvent("restore",this)}return this},toggleMaximize:function(){return this[this.maximized?"restore":"maximize"]()},fitContainer:function(){var a=this.container.getViewSize(false);this.setSize(a.width,a.height)},setZIndex:function(a){if(this.modal){this.mask.setStyle("z-index",a)}this.el.setZIndex(++a);a+=5;if(this.resizer){this.resizer.proxy.setStyle("z-index",++a)}this.lastZIndex=a},alignTo:function(b,a,c){var d=this.el.getAlignToXY(b,a,c);this.setPagePosition(d[0],d[1]);return this},anchorTo:function(c,e,d,b){this.clearAnchor();this.anchorTarget={el:c,alignment:e,offsets:d};Ext.EventManager.onWindowResize(this.doAnchor,this);var a=typeof b;if(a!="undefined"){Ext.EventManager.on(window,"scroll",this.doAnchor,this,{buffer:a=="number"?b:50})}return this.doAnchor()},doAnchor:function(){var a=this.anchorTarget;this.alignTo(a.el,a.alignment,a.offsets);return this},clearAnchor:function(){if(this.anchorTarget){Ext.EventManager.removeResizeListener(this.doAnchor,this);Ext.EventManager.un(window,"scroll",this.doAnchor,this);delete this.anchorTarget}return this},toFront:function(a){if(this.manager.bringToFront(this)){if(!a||!a.getTarget().focus){this.focus()}}return this},setActive:function(a){if(a){if(!this.maximized){this.el.enableShadow(true)}this.fireEvent("activate",this)}else{this.el.disableShadow();this.fireEvent("deactivate",this)}},toBack:function(){this.manager.sendToBack(this);return this},center:function(){var a=this.el.getAlignToXY(this.container,"c-c");this.setPagePosition(a[0],a[1]);return this}});Ext.reg("window",Ext.Window);Ext.Window.DD=function(a){this.win=a;Ext.Window.DD.superclass.constructor.call(this,a.el.id,"WindowDD-"+a.id);this.setHandleElId(a.header.id);this.scroll=false};Ext.extend(Ext.Window.DD,Ext.dd.DD,{moveOnly:true,headerOffsets:[100,25],startDrag:function(){var a=this.win;this.proxy=a.ghost();if(a.constrain!==false){var c=a.el.shadowOffset;this.constrainTo(a.container,{right:c,left:c,bottom:c})}else{if(a.constrainHeader!==false){var b=this.proxy.getSize();this.constrainTo(a.container,{right:-(b.width-this.headerOffsets[0]),bottom:-(b.height-this.headerOffsets[1])})}}},b4Drag:Ext.emptyFn,onDrag:function(a){this.alignElWithMouse(this.proxy,a.getPageX(),a.getPageY())},endDrag:function(a){this.win.unghost();this.win.saveState()}});Ext.WindowGroup=function(){var g={};var d=[];var e=null;var c=function(j,i){return(!j._lastAccess||j._lastAccess0){l.sort(c);var k=l[0].manager.zseed;for(var m=0;m=0;--j){if(!d[j].hidden){b(d[j]);return}}b(null)};return{zseed:9000,register:function(i){if(i.manager){i.manager.unregister(i)}i.manager=this;g[i.id]=i;d.push(i);i.on("hide",a)},unregister:function(i){delete i.manager;delete g[i.id];i.un("hide",a);d.remove(i)},get:function(i){return typeof i=="object"?i:g[i]},bringToFront:function(i){i=this.get(i);if(i!=e){i._lastAccess=new Date().getTime();h();return true}return false},sendToBack:function(i){i=this.get(i);i._lastAccess=-(new Date().getTime());h();return i},hideAll:function(){for(var i in g){if(g[i]&&typeof g[i]!="function"&&g[i].isVisible()){g[i].hide()}}},getActive:function(){return e},getBy:function(l,k){var m=[];for(var j=d.length-1;j>=0;--j){var n=d[j];if(l.call(k||n,n)!==false){m.push(n)}}return m},each:function(j,i){for(var k in g){if(g[k]&&typeof g[k]!="function"){if(j.call(i||g[k],g[k])===false){return}}}}}};Ext.WindowMgr=new Ext.WindowGroup();Ext.MessageBox=function(){var u,b,q,t,h,l,s,a,n,p,j,g,r,v,o,i="",d="",m=["ok","yes","no","cancel"];var c=function(y){r[y].blur();if(u.isVisible()){u.hide();x();Ext.callback(b.fn,b.scope||window,[y,v.dom.value,b],1)}};var x=function(){if(b&&b.cls){u.el.removeClass(b.cls)}n.reset()};var e=function(A,y,z){if(b&&b.closable!==false){u.hide();x()}if(z){z.stopEvent()}};var k=function(y){var A=0,z;if(!y){Ext.each(m,function(B){r[B].hide()});return A}u.footer.dom.style.display="";Ext.iterate(r,function(B,C){z=y[B];if(z){C.show();C.setText(Ext.isString(z)?z:Ext.MessageBox.buttonText[B]);A+=C.getEl().getWidth()+15}else{C.hide()}});return A};return{getDialog:function(y){if(!u){var A=[];r={};Ext.each(m,function(B){A.push(r[B]=new Ext.Button({text:this.buttonText[B],handler:c.createCallback(B),hideMode:"offsets"}))},this);u=new Ext.Window({autoCreate:true,title:y,resizable:false,constrain:true,constrainHeader:true,minimizable:false,maximizable:false,stateful:false,modal:true,shim:true,buttonAlign:"center",width:400,height:100,minHeight:80,plain:true,footer:true,closable:true,close:function(){if(b&&b.buttons&&b.buttons.no&&!b.buttons.cancel){c("no")}else{c("cancel")}},fbar:new Ext.Toolbar({items:A,enableOverflow:false})});u.render(document.body);u.getEl().addClass("x-window-dlg");q=u.mask;h=u.body.createChild({html:'

    '});j=Ext.get(h.dom.firstChild);var z=h.dom.childNodes[1];l=Ext.get(z.firstChild);s=Ext.get(z.childNodes[2].firstChild);s.enableDisplayMode();s.addKeyListener([10,13],function(){if(u.isVisible()&&b&&b.buttons){if(b.buttons.ok){c("ok")}else{if(b.buttons.yes){c("yes")}}}});a=Ext.get(z.childNodes[2].childNodes[1]);a.enableDisplayMode();n=new Ext.ProgressBar({renderTo:h});h.createChild({cls:"x-clear"})}return u},updateText:function(B){if(!u.isVisible()&&!b.width){u.setSize(this.maxWidth,100)}l.update(B||" ");var z=d!=""?(j.getWidth()+j.getMargins("lr")):0,D=l.getWidth()+l.getMargins("lr"),A=u.getFrameWidth("lr"),C=u.body.getFrameWidth("lr"),y;if(Ext.isIE&&z>0){z+=3}y=Math.max(Math.min(b.width||z+D+A+C,b.maxWidth||this.maxWidth),Math.max(b.minWidth||this.minWidth,o||0));if(b.prompt===true){v.setWidth(y-z-A-C)}if(b.progress===true||b.wait===true){n.setSize(y-z-A-C)}if(Ext.isIE&&y==o){y+=4}u.setSize(y,"auto").center();return this},updateProgress:function(z,y,A){n.updateProgress(z,y);if(A){this.updateText(A)}return this},isVisible:function(){return u&&u.isVisible()},hide:function(){var y=u?u.activeGhost:null;if(this.isVisible()||y){u.hide();x();if(y){u.unghost(false,false)}}return this},show:function(B){if(this.isVisible()){this.hide()}b=B;var C=this.getDialog(b.title||" ");C.setTitle(b.title||" ");var y=(b.closable!==false&&b.progress!==true&&b.wait!==true);C.tools.close.setDisplayed(y);v=s;b.prompt=b.prompt||(b.multiline?true:false);if(b.prompt){if(b.multiline){s.hide();a.show();a.setHeight(Ext.isNumber(b.multiline)?b.multiline:this.defaultTextHeight);v=a}else{s.show();a.hide()}}else{s.hide();a.hide()}v.dom.value=b.value||"";if(b.prompt){C.focusEl=v}else{var A=b.buttons;var z=null;if(A&&A.ok){z=r.ok}else{if(A&&A.yes){z=r.yes}}if(z){C.focusEl=z}}if(b.iconCls){C.setIconClass(b.iconCls)}this.setIcon(Ext.isDefined(b.icon)?b.icon:i);o=k(b.buttons);n.setVisible(b.progress===true||b.wait===true);this.updateProgress(0,b.progressText);this.updateText(b.msg);if(b.cls){C.el.addClass(b.cls)}C.proxyDrag=b.proxyDrag===true;C.modal=b.modal!==false;C.mask=b.modal!==false?q:false;if(!C.isVisible()){document.body.appendChild(u.el.dom);C.setAnimateTarget(b.animEl);C.on("show",function(){if(y===true){C.keyMap.enable()}else{C.keyMap.disable()}},this,{single:true});C.show(b.animEl)}if(b.wait===true){n.wait(b.waitConfig)}return this},setIcon:function(y){if(!u){i=y;return}i=undefined;if(y&&y!=""){j.removeClass("x-hidden");j.replaceClass(d,y);h.addClass("x-dlg-icon");d=y}else{j.replaceClass(d,"x-hidden");h.removeClass("x-dlg-icon");d=""}return this},progress:function(A,z,y){this.show({title:A,msg:z,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth,progressText:y});return this},wait:function(A,z,y){this.show({title:z,msg:A,buttons:false,closable:false,wait:true,modal:true,minWidth:this.minProgressWidth,waitConfig:y});return this},alert:function(B,A,z,y){this.show({title:B,msg:A,buttons:this.OK,fn:z,scope:y,minWidth:this.minWidth});return this},confirm:function(B,A,z,y){this.show({title:B,msg:A,buttons:this.YESNO,fn:z,scope:y,icon:this.QUESTION,minWidth:this.minWidth});return this},prompt:function(D,C,A,z,y,B){this.show({title:D,msg:C,buttons:this.OKCANCEL,fn:A,minWidth:this.minPromptWidth,scope:z,prompt:true,multiline:y,value:B});return this},OK:{ok:true},CANCEL:{cancel:true},OKCANCEL:{ok:true,cancel:true},YESNO:{yes:true,no:true},YESNOCANCEL:{yes:true,no:true,cancel:true},INFO:"ext-mb-info",WARNING:"ext-mb-warning",QUESTION:"ext-mb-question",ERROR:"ext-mb-error",defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,minPromptWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}}}();Ext.Msg=Ext.MessageBox;Ext.dd.PanelProxy=function(a,b){this.panel=a;this.id=this.panel.id+"-ddproxy";Ext.apply(this,b)};Ext.dd.PanelProxy.prototype={insertProxy:true,setStatus:Ext.emptyFn,reset:Ext.emptyFn,update:Ext.emptyFn,stop:Ext.emptyFn,sync:Ext.emptyFn,getEl:function(){return this.ghost},getGhost:function(){return this.ghost},getProxy:function(){return this.proxy},hide:function(){if(this.ghost){if(this.proxy){this.proxy.remove();delete this.proxy}this.panel.el.dom.style.display="";this.ghost.remove();delete this.ghost}},show:function(){if(!this.ghost){this.ghost=this.panel.createGhost(undefined,undefined,Ext.getBody());this.ghost.setXY(this.panel.el.getXY());if(this.insertProxy){this.proxy=this.panel.el.insertSibling({cls:"x-panel-dd-spacer"});this.proxy.setSize(this.panel.getSize())}this.panel.el.dom.style.display="none"}},repair:function(b,c,a){this.hide();if(typeof c=="function"){c.call(a||this)}},moveProxy:function(a,b){if(this.proxy){a.insertBefore(this.proxy.dom,b)}}};Ext.Panel.DD=function(b,a){this.panel=b;this.dragData={panel:b};this.proxy=new Ext.dd.PanelProxy(b,a);Ext.Panel.DD.superclass.constructor.call(this,b.el,a);var c=b.header;if(c){this.setHandleElId(c.id)}(c?c:this.panel.body).setStyle("cursor","move");this.scroll=false};Ext.extend(Ext.Panel.DD,Ext.dd.DragSource,{showFrame:Ext.emptyFn,startDrag:Ext.emptyFn,b4StartDrag:function(a,b){this.proxy.show()},b4MouseDown:function(b){var a=b.getPageX();var c=b.getPageY();this.autoOffset(a,c)},onInitDrag:function(a,b){this.onStartDrag(a,b);return true},createFrame:Ext.emptyFn,getDragEl:function(a){return this.proxy.ghost.dom},endDrag:function(a){this.proxy.hide();this.panel.saveState()},autoOffset:function(a,b){a-=this.startPageX;b-=this.startPageY;this.setDelta(a,b)}});Ext.state.Provider=function(){this.addEvents("statechange");this.state={};Ext.state.Provider.superclass.constructor.call(this)};Ext.extend(Ext.state.Provider,Ext.util.Observable,{get:function(b,a){return typeof this.state[b]=="undefined"?a:this.state[b]},clear:function(a){delete this.state[a];this.fireEvent("statechange",this,a,null)},set:function(a,b){this.state[a]=b;this.fireEvent("statechange",this,a,b)},decodeValue:function(b){var e=/^(a|n|d|b|s|o)\:(.*)$/;var g=e.exec(unescape(b));if(!g||!g[1]){return}var d=g[1];var a=g[2];switch(d){case"n":return parseFloat(a);case"d":return new Date(Date.parse(a));case"b":return(a=="1");case"a":var c=[];if(a!=""){Ext.each(a.split("^"),function(h){c.push(this.decodeValue(h))},this)}return c;case"o":var c={};if(a!=""){Ext.each(a.split("^"),function(i){var h=i.split("=");c[h[0]]=this.decodeValue(h[1])},this)}return c;default:return a}},encodeValue:function(c){var b;if(typeof c=="number"){b="n:"+c}else{if(typeof c=="boolean"){b="b:"+(c?"1":"0")}else{if(Ext.isDate(c)){b="d:"+c.toGMTString()}else{if(Ext.isArray(c)){var g="";for(var e=0,a=c.length;e-1){var e=this.isSelected(b);var c=this.all.elements[b];var d=this.bufferRender([a],b)[0];this.all.replaceElement(b,d,true);if(e){this.selected.replaceElement(c,d);this.all.item(b).addClass(this.selectedClass)}this.updateIndexes(b,b)}},onAdd:function(g,d,e){if(this.all.getCount()===0){this.refresh();return}var c=this.bufferRender(d,e),h,b=this.all.elements;if(e0){if(!b){this.selected.removeClass(this.selectedClass)}this.selected.clear();this.last=false;if(!a){this.fireEvent("selectionchange",this,this.selected.elements)}}},isSelected:function(a){return this.selected.contains(this.getNode(a))},deselect:function(a){if(this.isSelected(a)){a=this.getNode(a);this.selected.removeElement(a);if(this.last==a.viewIndex){this.last=false}Ext.fly(a).removeClass(this.selectedClass);this.fireEvent("selectionchange",this,this.selected.elements)}},select:function(d,g,b){if(Ext.isArray(d)){if(!g){this.clearSelections(true)}for(var c=0,a=d.length;c=a&&d[c];c--){b.push(d[c])}}return b},indexOf:function(a){a=this.getNode(a);if(Ext.isNumber(a.viewIndex)){return a.viewIndex}return this.all.indexOf(a)},onBeforeLoad:function(){if(this.loadingText){this.clearSelections(false,true);this.getTemplateTarget().update('
    '+this.loadingText+"
    ");this.all.clear()}},onDestroy:function(){this.all.clear();this.selected.clear();Ext.DataView.superclass.onDestroy.call(this);this.bindStore(null)}});Ext.DataView.prototype.setStore=Ext.DataView.prototype.bindStore;Ext.reg("dataview",Ext.DataView);Ext.list.ListView=Ext.extend(Ext.DataView,{itemSelector:"dl",selectedClass:"x-list-selected",overClass:"x-list-over",scrollOffset:undefined,columnResize:true,columnSort:true,maxWidth:Ext.isIE?99:100,initComponent:function(){if(this.columnResize){this.colResizer=new Ext.list.ColumnResizer(this.colResizer);this.colResizer.init(this)}if(this.columnSort){this.colSorter=new Ext.list.Sorter(this.columnSort);this.colSorter.init(this)}if(!this.internalTpl){this.internalTpl=new Ext.XTemplate('
    ','','
    ',"{header}","
    ","
    ",'
    ',"
    ",'
    ',"
    ")}if(!this.tpl){this.tpl=new Ext.XTemplate('',"
    ",'','
    ',' class="{cls}">',"{[values.tpl.apply(parent)]}","
    ","
    ",'
    ',"
    ","
    ")}var l=this.columns,h=0,k=0,m=l.length,b=[];for(var g=0;g10)){e.style.width=a+"px";g.style.width=a+"px"}else{e.style.width=b+"px";g.style.width=b+"px";setTimeout(function(){if((c.offsetWidth-c.clientWidth)>10){e.style.width=a+"px";g.style.width=a+"px"}},10)}}if(Ext.isNumber(d)){c.style.height=(d-g.parentNode.offsetHeight)+"px"}},updateIndexes:function(){Ext.list.ListView.superclass.updateIndexes.apply(this,arguments);this.verifyInternalSize()},findHeaderIndex:function(e){e=e.dom||e;var a=e.parentNode,d=a.parentNode.childNodes;for(var b=0,g;g=d[b];b++){if(g==a){return b}}return -1},setHdWidths:function(){var c=this.innerHd.dom.getElementsByTagName("div");for(var b=0,d=this.columns,a=d.length;b','','{text}',"");d.disableFormats=true;d.compile();Ext.TabPanel.prototype.itemTpl=d}this.items.each(this.initTab,this)},afterRender:function(){Ext.TabPanel.superclass.afterRender.call(this);if(this.autoTabs){this.readTabs(false)}if(this.activeTab!==undefined){var a=Ext.isObject(this.activeTab)?this.activeTab:this.items.get(this.activeTab);delete this.activeTab;this.setActiveTab(a)}},initEvents:function(){Ext.TabPanel.superclass.initEvents.call(this);this.mon(this.strip,{scope:this,mousedown:this.onStripMouseDown,contextmenu:this.onStripContextMenu});if(this.enableTabScroll){this.mon(this.strip,"mousewheel",this.onWheel,this)}},findTargets:function(c){var b=null,a=c.getTarget("li:not(.x-tab-edge)",this.strip);if(a){b=this.getComponent(a.id.split(this.idDelimiter)[1]);if(b.disabled){return{close:null,item:null,el:null}}}return{close:c.getTarget(".x-tab-strip-close",this.strip),item:b,el:a}},onStripMouseDown:function(b){if(b.button!==0){return}b.preventDefault();var a=this.findTargets(b);if(a.close){if(a.item.fireEvent("beforeclose",a.item)!==false){a.item.fireEvent("close",a.item);this.remove(a.item)}return}if(a.item&&a.item!=this.activeTab){this.setActiveTab(a.item)}},onStripContextMenu:function(b){b.preventDefault();var a=this.findTargets(b);if(a.item){this.fireEvent("contextmenu",this,a.item,b)}},readTabs:function(d){if(d===true){this.items.each(function(h){this.remove(h)},this)}var c=this.el.query(this.autoTabSelector);for(var b=0,a=c.length;b0){this.setActiveTab(0)}else{this.setActiveTab(null)}}}if(!this.destroying){this.delegateUpdates()}},onBeforeShowItem:function(a){if(a!=this.activeTab){this.setActiveTab(a);return false}},onItemDisabled:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).addClass("x-item-disabled")}this.stack.remove(b)},onItemEnabled:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).removeClass("x-item-disabled")}},onItemTitleChanged:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).child("span.x-tab-strip-text",true).innerHTML=b.title}},onItemIconChanged:function(d,a,c){var b=this.getTabEl(d);if(b){b=Ext.get(b);b.child("span.x-tab-strip-text").replaceClass(c,a);b[Ext.isEmpty(a)?"removeClass":"addClass"]("x-tab-with-icon")}},getTabEl:function(a){var b=this.getComponent(a);return b?b.tabEl:null},onResize:function(){Ext.TabPanel.superclass.onResize.apply(this,arguments);this.delegateUpdates()},beginUpdate:function(){this.suspendUpdates=true},endUpdate:function(){this.suspendUpdates=false;this.delegateUpdates()},hideTabStripItem:function(b){b=this.getComponent(b);var a=this.getTabEl(b);if(a){a.style.display="none";this.delegateUpdates()}this.stack.remove(b)},unhideTabStripItem:function(b){b=this.getComponent(b);var a=this.getTabEl(b);if(a){a.style.display="";this.delegateUpdates()}},delegateUpdates:function(){if(this.suspendUpdates){return}if(this.resizeTabs&&this.rendered){this.autoSizeTabs()}if(this.enableTabScroll&&this.rendered){this.autoScrollTabs()}},autoSizeTabs:function(){var h=this.items.length,b=this.tabPosition!="bottom"?"header":"footer",c=this[b].dom.offsetWidth,a=this[b].dom.clientWidth;if(!this.resizeTabs||h<1||!a){return}var k=Math.max(Math.min(Math.floor((a-4)/h)-this.tabMargin,this.tabWidth),this.minTabWidth);this.lastTabWidth=k;var m=this.strip.query("li:not(.x-tab-edge)");for(var e=0,j=m.length;e20?c:20);if(!this.scrolling){if(!this.scrollLeft){this.createScrollers()}else{this.scrollLeft.show();this.scrollRight.show()}}this.scrolling=true;if(i>(a-c)){e.scrollLeft=a-c}else{this.scrollToTab(this.activeTab,false)}this.updateScrollButtons()}},createScrollers:function(){this.pos.addClass("x-tab-scrolling-"+this.tabPosition);var c=this.stripWrap.dom.offsetHeight;var a=this.pos.insertFirst({cls:"x-tab-scroller-left"});a.setHeight(c);a.addClassOnOver("x-tab-scroller-left-over");this.leftRepeater=new Ext.util.ClickRepeater(a,{interval:this.scrollRepeatInterval,handler:this.onScrollLeft,scope:this});this.scrollLeft=a;var b=this.pos.insertFirst({cls:"x-tab-scroller-right"});b.setHeight(c);b.addClassOnOver("x-tab-scroller-right-over");this.rightRepeater=new Ext.util.ClickRepeater(b,{interval:this.scrollRepeatInterval,handler:this.onScrollRight,scope:this});this.scrollRight=b},getScrollWidth:function(){return this.edge.getOffsetsTo(this.stripWrap)[0]+this.getScrollPos()},getScrollPos:function(){return parseInt(this.stripWrap.dom.scrollLeft,10)||0},getScrollArea:function(){return parseInt(this.stripWrap.dom.clientWidth,10)||0},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},getScrollIncrement:function(){return this.scrollIncrement||(this.resizeTabs?this.lastTabWidth+2:100)},scrollToTab:function(e,a){if(!e){return}var c=this.getTabEl(e),h=this.getScrollPos(),d=this.getScrollArea(),g=Ext.fly(c).getOffsetsTo(this.stripWrap)[0]+h,b=g+c.offsetWidth;if(g(h+d)){this.scrollTo(b-d,a)}}},scrollTo:function(b,a){this.stripWrap.scrollTo("left",b,a?this.getScrollAnim():false);if(!a){this.updateScrollButtons()}},onWheel:function(g){var h=g.getWheelDelta()*this.wheelIncrement*-1;g.stopEvent();var i=this.getScrollPos(),c=i+h,a=this.getScrollWidth()-this.getScrollArea();var b=Math.max(0,Math.min(a,c));if(b!=i){this.scrollTo(b,false)}},onScrollRight:function(){var a=this.getScrollWidth()-this.getScrollArea(),c=this.getScrollPos(),b=Math.min(a,c+this.getScrollIncrement());if(b!=c){this.scrollTo(b,this.animScroll)}},onScrollLeft:function(){var b=this.getScrollPos(),a=Math.max(0,b-this.getScrollIncrement());if(a!=b){this.scrollTo(a,this.animScroll)}},updateScrollButtons:function(){var a=this.getScrollPos();this.scrollLeft[a===0?"addClass":"removeClass"]("x-tab-scroller-left-disabled");this.scrollRight[a>=(this.getScrollWidth()-this.getScrollArea())?"addClass":"removeClass"]("x-tab-scroller-right-disabled")},beforeDestroy:function(){Ext.destroy(this.leftRepeater,this.rightRepeater);this.deleteMembers("strip","edge","scrollLeft","scrollRight","stripWrap");this.activeTab=null;Ext.TabPanel.superclass.beforeDestroy.apply(this)}});Ext.reg("tabpanel",Ext.TabPanel);Ext.TabPanel.prototype.activate=Ext.TabPanel.prototype.setActiveTab;Ext.TabPanel.AccessStack=function(){var a=[];return{add:function(b){a.push(b);if(a.length>10){a.shift()}},remove:function(e){var d=[];for(var c=0,b=a.length;c','  ','  ','  ',"");Ext.Button.buttonTemplate.compile()}this.template=Ext.Button.buttonTemplate}var b,d=this.getTemplateArgs();if(a){b=this.template.insertBefore(a,d,true)}else{b=this.template.append(c,d,true)}this.btnEl=b.child(this.buttonSelector);this.mon(this.btnEl,{scope:this,focus:this.onFocus,blur:this.onBlur});this.initButtonEl(b,this.btnEl);Ext.ButtonToggleMgr.register(this)},initButtonEl:function(b,c){this.el=b;this.setIcon(this.icon);this.setText(this.text);this.setIconClass(this.iconCls);if(Ext.isDefined(this.tabIndex)){c.dom.tabIndex=this.tabIndex}if(this.tooltip){this.setTooltip(this.tooltip,true)}if(this.handleMouseEvents){this.mon(b,{scope:this,mouseover:this.onMouseOver,mousedown:this.onMouseDown})}if(this.menu){this.mon(this.menu,{scope:this,show:this.onMenuShow,hide:this.onMenuHide})}if(this.repeat){var a=new Ext.util.ClickRepeater(b,Ext.isObject(this.repeat)?this.repeat:{});this.mon(a,"click",this.onClick,this)}this.mon(b,this.clickEvent,this.onClick,this)},afterRender:function(){Ext.Button.superclass.afterRender.call(this);this.useSetClass=true;this.setButtonClass();this.doc=Ext.getDoc();this.doAutoWidth()},setIconClass:function(a){this.iconCls=a;if(this.el){this.btnEl.dom.className="";this.btnEl.addClass(["x-btn-text",a||""]);this.setButtonClass()}return this},setTooltip:function(b,a){if(this.rendered){if(!a){this.clearTip()}if(Ext.isObject(b)){Ext.QuickTips.register(Ext.apply({target:this.btnEl.id},b));this.tooltip=b}else{this.btnEl.dom[this.tooltipType]=b}}else{this.tooltip=b}return this},clearTip:function(){if(Ext.isObject(this.tooltip)){Ext.QuickTips.unregister(this.btnEl)}},beforeDestroy:function(){if(this.rendered){this.clearTip()}if(this.menu&&this.destroyMenu!==false){Ext.destroy(this.menu)}Ext.destroy(this.repeater)},onDestroy:function(){if(this.rendered){this.doc.un("mouseover",this.monitorMouseOver,this);this.doc.un("mouseup",this.onMouseUp,this);delete this.doc;delete this.btnEl;Ext.ButtonToggleMgr.unregister(this)}Ext.Button.superclass.onDestroy.call(this)},doAutoWidth:function(){if(this.el&&this.text&&this.width===undefined){this.el.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var a=this.btnEl;if(a&&a.getWidth()>20){a.clip();a.setWidth(Ext.util.TextMetrics.measure(a,this.text).width+a.getFrameWidth("lr"))}}if(this.minWidth){if(this.el.getWidth()a}else{return c.getPageY()>this.btnEl.getRegion().bottom}},onClick:function(b,a){b.preventDefault();if(!this.disabled){if(this.isClickOnArrow(b)){if(this.menu&&!this.menu.isVisible()&&!this.ignoreNextClick){this.showMenu()}this.fireEvent("arrowclick",this,b);if(this.arrowHandler){this.arrowHandler.call(this.scope||this,this,b)}}else{if(this.enableToggle){this.toggle()}this.fireEvent("click",this,b);if(this.handler){this.handler.call(this.scope||this,this,b)}}}},isMenuTriggerOver:function(a){return this.menu&&a.target.tagName==this.arrowSelector},isMenuTriggerOut:function(b,a){return this.menu&&b.target.tagName!=this.arrowSelector}});Ext.reg("splitbutton",Ext.SplitButton);Ext.CycleButton=Ext.extend(Ext.SplitButton,{getItemText:function(a){if(a&&this.showText===true){var b="";if(this.prependText){b+=this.prependText}b+=a.text;return b}return undefined},setActiveItem:function(c,a){if(!Ext.isObject(c)){c=this.menu.getComponent(c)}if(c){if(!this.rendered){this.text=this.getItemText(c);this.iconCls=c.iconCls}else{var b=this.getItemText(c);if(b){this.setText(b)}this.setIconClass(c.iconCls)}this.activeItem=c;if(!c.checked){c.setChecked(true,false)}if(this.forceIcon){this.setIconClass(this.forceIcon)}if(!a){this.fireEvent("change",this,c)}}},getActiveItem:function(){return this.activeItem},initComponent:function(){this.addEvents("change");if(this.changeHandler){this.on("change",this.changeHandler,this.scope||this);delete this.changeHandler}this.itemCount=this.items.length;this.menu={cls:"x-cycle-menu",items:[]};var a=0;Ext.each(this.items,function(c,b){Ext.apply(c,{group:c.group||this.id,itemIndex:b,checkHandler:this.checkHandler,scope:this,checked:c.checked||false});this.menu.items.push(c);if(c.checked){a=b}},this);Ext.CycleButton.superclass.initComponent.call(this);this.on("click",this.toggleSelected,this);this.setActiveItem(a,true)},checkHandler:function(a,b){if(b){this.setActiveItem(a)}},toggleSelected:function(){var a=this.menu;a.render();if(!a.hasLayout){a.doLayout()}var d,b;for(var c=1;c"){b=new a.Fill()}else{b=new a.TextItem(b)}}}this.applyDefaults(b)}else{if(b.isFormField||b.render){b=this.createComponent(b)}else{if(b.tag){b=new a.Item({autoEl:b})}else{if(b.tagName){b=new a.Item({el:b})}else{if(Ext.isObject(b)){b=b.xtype?this.createComponent(b):this.constructButton(b)}}}}}return b},applyDefaults:function(e){if(!Ext.isString(e)){e=Ext.Toolbar.superclass.applyDefaults.call(this,e);var b=this.internalDefaults;if(e.events){Ext.applyIf(e.initialConfig,b);Ext.apply(e,b)}else{Ext.applyIf(e,b)}}return e},addSeparator:function(){return this.add(new a.Separator())},addSpacer:function(){return this.add(new a.Spacer())},addFill:function(){this.add(new a.Fill())},addElement:function(b){return this.addItem(new a.Item({el:b}))},addItem:function(b){return this.add.apply(this,arguments)},addButton:function(c){if(Ext.isArray(c)){var e=[];for(var d=0,b=c.length;d");this.items.push(this.displayItem=new a.TextItem({}))}Ext.PagingToolbar.superclass.initComponent.call(this);this.addEvents("change","beforechange");this.on("afterlayout",this.onFirstLayout,this,{single:true});this.cursor=0;this.bindStore(this.store,true)},onFirstLayout:function(){if(this.dsLoaded){this.onLoad.apply(this,this.dsLoaded)}},updateInfo:function(){if(this.displayItem){var b=this.store.getCount();var c=b==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+b,this.store.getTotalCount());this.displayItem.setText(c)}},onLoad:function(b,e,j){if(!this.rendered){this.dsLoaded=[b,e,j];return}var g=this.getParams();this.cursor=(j.params&&j.params[g.start])?j.params[g.start]:0;var i=this.getPageData(),c=i.activePage,h=i.pages;this.afterTextItem.setText(String.format(this.afterPageText,i.pages));this.inputItem.setValue(c);this.first.setDisabled(c==1);this.prev.setDisabled(c==1);this.next.setDisabled(c==h);this.last.setDisabled(c==h);this.refresh.enable();this.updateInfo();this.fireEvent("change",this,i)},getPageData:function(){var b=this.store.getTotalCount();return{total:b,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:b=1&g<=j.pages){i.setValue(g)}}}}}},getParams:function(){return this.paramNames||this.store.paramNames},beforeLoad:function(){if(this.rendered&&this.refresh){this.refresh.disable()}},doLoad:function(d){var c={},b=this.getParams();c[b.start]=d;c[b.limit]=this.pageSize;if(this.fireEvent("beforechange",this,c)!==false){this.store.load({params:c})}},moveFirst:function(){this.doLoad(0)},movePrevious:function(){this.doLoad(Math.max(0,this.cursor-this.pageSize))},moveNext:function(){this.doLoad(this.cursor+this.pageSize)},moveLast:function(){var c=this.store.getTotalCount(),b=c%this.pageSize;this.doLoad(b?(c-b):c-this.pageSize)},doRefresh:function(){this.doLoad(this.cursor)},bindStore:function(c,d){var b;if(!d&&this.store){if(c!==this.store&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("beforeload",this.beforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.onLoadError,this)}if(!c){this.store=null}}if(c){c=Ext.StoreMgr.lookup(c);c.on({scope:this,beforeload:this.beforeLoad,load:this.onLoad,exception:this.onLoadError});b=true}this.store=c;if(b){this.onLoad(c,null,{})}},unbind:function(b){this.bindStore(null)},bind:function(b){this.bindStore(b)},onDestroy:function(){this.bindStore(null);Ext.PagingToolbar.superclass.onDestroy.call(this)}})})();Ext.reg("paging",Ext.PagingToolbar);Ext.History=(function(){var e,c;var k=false;var d;function g(){var l=top.location.href,m=l.indexOf("#");return m>=0?l.substr(m+1):null}function a(){c.value=d}function h(l){d=l;Ext.History.fireEvent("change",l)}function i(m){var l=['
    ',Ext.util.Format.htmlEncode(m),"
    "].join("");try{var o=e.contentWindow.document;o.open();o.write(l);o.close();return true}catch(n){return false}}function b(){if(!e.contentWindow||!e.contentWindow.document){setTimeout(b,10);return}var o=e.contentWindow.document;var m=o.getElementById("state");var l=m?m.innerText:null;var n=g();setInterval(function(){o=e.contentWindow.document;m=o.getElementById("state");var q=m?m.innerText:null;var p=g();if(q!==l){l=q;h(l);top.location.hash=l;n=l;a()}else{if(p!==n){n=p;i(p)}}},50);k=true;Ext.History.fireEvent("ready",Ext.History)}function j(){d=c.value?c.value:g();if(Ext.isIE){b()}else{var l=g();setInterval(function(){var m=g();if(m!==l){l=m;h(l);a()}},50);k=true;Ext.History.fireEvent("ready",Ext.History)}}return{fieldId:"x-history-field",iframeId:"x-history-frame",events:{},init:function(m,l){if(k){Ext.callback(m,l,[this]);return}if(!Ext.isReady){Ext.onReady(function(){Ext.History.init(m,l)});return}c=Ext.getDom(Ext.History.fieldId);if(Ext.isIE){e=Ext.getDom(Ext.History.iframeId)}this.addEvents("ready","change");if(m){this.on("ready",m,l,{single:true})}j()},add:function(l,m){if(m!==false){if(this.getToken()==l){return true}}if(Ext.isIE){return i(l)}else{top.location.hash=l;return true}},back:function(){history.go(-1)},forward:function(){history.go(1)},getToken:function(){return k?d:g()}}})();Ext.apply(Ext.History,new Ext.util.Observable());Ext.Tip=Ext.extend(Ext.Panel,{minWidth:40,maxWidth:300,shadow:"sides",defaultAlign:"tl-bl?",autoRender:true,quickShowInterval:250,frame:true,hidden:true,baseCls:"x-tip",floating:{shadow:true,shim:true,useDisplay:true,constrain:false},autoHeight:true,closeAction:"hide",initComponent:function(){Ext.Tip.superclass.initComponent.call(this);if(this.closable&&!this.title){this.elements+=",header"}},afterRender:function(){Ext.Tip.superclass.afterRender.call(this);if(this.closable){this.addTool({id:"close",handler:this[this.closeAction],scope:this})}},showAt:function(a){Ext.Tip.superclass.show.call(this);if(this.measureWidth!==false&&(!this.initialConfig||typeof this.initialConfig.width!="number")){this.doAutoWidth()}if(this.constrainPosition){a=this.el.adjustForConstraints(a)}this.setPagePosition(a[0],a[1])},doAutoWidth:function(a){a=a||0;var b=this.body.getTextWidth();if(this.title){b=Math.max(b,this.header.child("span").getTextWidth(this.title))}b+=this.getFrameWidth()+(this.closable?20:0)+this.body.getPadding("lr")+a;this.setWidth(b.constrain(this.minWidth,this.maxWidth));if(Ext.isIE7&&!this.repainted){this.el.repaint();this.repainted=true}},showBy:function(a,b){if(!this.rendered){this.render(Ext.getBody())}this.showAt(this.el.getAlignToXY(a,b||this.defaultAlign))},initDraggable:function(){this.dd=new Ext.Tip.DD(this,typeof this.draggable=="boolean"?null:this.draggable);this.header.addClass("x-tip-draggable")}});Ext.reg("tip",Ext.Tip);Ext.Tip.DD=function(b,a){Ext.apply(this,a);this.tip=b;Ext.Tip.DD.superclass.constructor.call(this,b.el.id,"WindowDD-"+b.id);this.setHandleElId(b.header.id);this.scroll=false};Ext.extend(Ext.Tip.DD,Ext.dd.DD,{moveOnly:true,scroll:false,headerOffsets:[100,25],startDrag:function(){this.tip.el.disableShadow()},endDrag:function(a){this.tip.el.enableShadow(true)}});Ext.ToolTip=Ext.extend(Ext.Tip,{showDelay:500,hideDelay:200,dismissDelay:5000,trackMouse:false,anchorToTarget:true,anchorOffset:0,targetCounter:0,constrainPosition:false,initComponent:function(){Ext.ToolTip.superclass.initComponent.call(this);this.lastActive=new Date();this.initTarget(this.target);this.origAnchor=this.anchor},onRender:function(b,a){Ext.ToolTip.superclass.onRender.call(this,b,a);this.anchorCls="x-tip-anchor-"+this.getAnchorPosition();this.anchorEl=this.el.createChild({cls:"x-tip-anchor "+this.anchorCls})},afterRender:function(){Ext.ToolTip.superclass.afterRender.call(this);this.anchorEl.setStyle("z-index",this.el.getZIndex()+1)},initTarget:function(c){var a;if((a=Ext.get(c))){if(this.target){var b=Ext.get(this.target);this.mun(b,"mouseover",this.onTargetOver,this);this.mun(b,"mouseout",this.onTargetOut,this);this.mun(b,"mousemove",this.onMouseMove,this)}this.mon(a,{mouseover:this.onTargetOver,mouseout:this.onTargetOut,mousemove:this.onMouseMove,scope:this});this.target=a}if(this.anchor){this.anchorTarget=this.target}},onMouseMove:function(b){var a=this.delegate?b.getTarget(this.delegate):this.triggerElement=true;if(a){this.targetXY=b.getXY();if(a===this.triggerElement){if(!this.hidden&&this.trackMouse){this.setPagePosition(this.getTargetXY())}}else{this.hide();this.lastActive=new Date(0);this.onTargetOver(b)}}else{if(!this.closable&&this.isVisible()){this.hide()}}},getTargetXY:function(){if(this.delegate){this.anchorTarget=this.triggerElement}if(this.anchor){this.targetCounter++;var c=this.getOffsets(),l=(this.anchorToTarget&&!this.trackMouse)?this.el.getAlignToXY(this.anchorTarget,this.getAnchorAlign()):this.targetXY,a=Ext.lib.Dom.getViewWidth()-5,h=Ext.lib.Dom.getViewHeight()-5,i=document.documentElement,e=document.body,k=(i.scrollLeft||e.scrollLeft||0)+5,j=(i.scrollTop||e.scrollTop||0)+5,b=[l[0]+c[0],l[1]+c[1]],g=this.getSize();this.anchorEl.removeClass(this.anchorCls);if(this.targetCounter<2){if(b[0]a){if(this.anchorToTarget){this.defaultAlign="r-l";if(this.mouseOffset){this.mouseOffset[0]*=-1}}this.anchor="right";return this.getTargetXY()}if(b[1]h){if(this.anchorToTarget){this.defaultAlign="b-t";if(this.mouseOffset){this.mouseOffset[1]*=-1}}this.anchor="bottom";return this.getTargetXY()}}this.anchorCls="x-tip-anchor-"+this.getAnchorPosition();this.anchorEl.addClass(this.anchorCls);this.targetCounter=0;return b}else{var d=this.getMouseOffset();return[this.targetXY[0]+d[0],this.targetXY[1]+d[1]]}},getMouseOffset:function(){var a=this.anchor?[0,0]:[15,18];if(this.mouseOffset){a[0]+=this.mouseOffset[0];a[1]+=this.mouseOffset[1]}return a},getAnchorPosition:function(){if(this.anchor){this.tipAnchor=this.anchor.charAt(0)}else{var a=this.defaultAlign.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!a){throw"AnchorTip.defaultAlign is invalid"}this.tipAnchor=a[1].charAt(0)}switch(this.tipAnchor){case"t":return"top";case"b":return"bottom";case"r":return"right"}return"left"},getAnchorAlign:function(){switch(this.anchor){case"top":return"tl-bl";case"left":return"tl-tr";case"right":return"tr-tl";default:return"bl-tl"}},getOffsets:function(){var b,a=this.getAnchorPosition().charAt(0);if(this.anchorToTarget&&!this.trackMouse){switch(a){case"t":b=[0,9];break;case"b":b=[0,-13];break;case"r":b=[-13,0];break;default:b=[9,0];break}}else{switch(a){case"t":b=[-15-this.anchorOffset,30];break;case"b":b=[-19-this.anchorOffset,-13-this.el.dom.offsetHeight];break;case"r":b=[-15-this.el.dom.offsetWidth,-13-this.anchorOffset];break;default:b=[25,-13-this.anchorOffset];break}}var c=this.getMouseOffset();b[0]+=c[0];b[1]+=c[1];return b},onTargetOver:function(b){if(this.disabled||b.within(this.target.dom,true)){return}var a=b.getTarget(this.delegate);if(a){this.triggerElement=a;this.clearTimer("hide");this.targetXY=b.getXY();this.delayShow()}},delayShow:function(){if(this.hidden&&!this.showTimer){if(this.lastActive.getElapsed()=c){d=c-b-5}}return{x:a,y:d}},beforeDestroy:function(){this.clearTimers();Ext.destroy(this.anchorEl);delete this.anchorEl;delete this.target;delete this.anchorTarget;delete this.triggerElement;Ext.ToolTip.superclass.beforeDestroy.call(this)},onDestroy:function(){Ext.getDoc().un("mousedown",this.onDocMouseDown,this);Ext.ToolTip.superclass.onDestroy.call(this)}});Ext.reg("tooltip",Ext.ToolTip);Ext.QuickTip=Ext.extend(Ext.ToolTip,{interceptTitles:false,tagConfig:{namespace:"ext",attribute:"qtip",width:"qwidth",target:"target",title:"qtitle",hide:"hide",cls:"qclass",align:"qalign",anchor:"anchor"},initComponent:function(){this.target=this.target||Ext.getDoc();this.targets=this.targets||{};Ext.QuickTip.superclass.initComponent.call(this)},register:function(e){var h=Ext.isArray(e)?e:arguments;for(var g=0,a=h.length;g1){var d=function(i,h){if(i&&h){var j=h.findChild(a,b);if(j){j.select();if(g){g(true,j)}}else{if(g){g(false,j)}}}else{if(g){g(false,j)}}};this.expandPath(c.join(this.pathSeparator),a,d)}else{this.root.select();if(g){g(true,this.root)}}},getTreeEl:function(){return this.body},onRender:function(b,a){Ext.tree.TreePanel.superclass.onRender.call(this,b,a);this.el.addClass("x-tree");this.innerCt=this.body.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.useArrows?"x-tree-arrows":this.lines?"x-tree-lines":"x-tree-no-lines")})},initEvents:function(){Ext.tree.TreePanel.superclass.initEvents.call(this);if(this.containerScroll){Ext.dd.ScrollManager.register(this.body)}if((this.enableDD||this.enableDrop)&&!this.dropZone){this.dropZone=new Ext.tree.TreeDropZone(this,this.dropConfig||{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.ddAppendOnly===true})}if((this.enableDD||this.enableDrag)&&!this.dragZone){this.dragZone=new Ext.tree.TreeDragZone(this,this.dragConfig||{ddGroup:this.ddGroup||"TreeDD",scroll:this.ddScroll})}this.getSelectionModel().init(this)},afterRender:function(){Ext.tree.TreePanel.superclass.afterRender.call(this);this.renderRoot()},beforeDestroy:function(){if(this.rendered){Ext.dd.ScrollManager.unregister(this.body);Ext.destroy(this.dropZone,this.dragZone)}this.destroyRoot();Ext.destroy(this.loader);this.nodeHash=this.root=this.loader=null;Ext.tree.TreePanel.superclass.beforeDestroy.call(this)},destroyRoot:function(){if(this.root&&this.root.destroy){this.root.destroy(true)}}});Ext.tree.TreePanel.nodeTypes={};Ext.reg("treepanel",Ext.tree.TreePanel);Ext.tree.TreeEventModel=function(a){this.tree=a;this.tree.on("render",this.initEvents,this)};Ext.tree.TreeEventModel.prototype={initEvents:function(){var a=this.tree;if(a.trackMouseOver!==false){a.mon(a.innerCt,{scope:this,mouseover:this.delegateOver,mouseout:this.delegateOut})}a.mon(a.getTreeEl(),{scope:this,click:this.delegateClick,dblclick:this.delegateDblClick,contextmenu:this.delegateContextMenu})},getNode:function(b){var a;if(a=b.getTarget(".x-tree-node-el",10)){var c=Ext.fly(a,"_treeEvents").getAttribute("tree-node-id","ext");if(c){return this.tree.getNodeById(c)}}return null},getNodeTarget:function(b){var a=b.getTarget(".x-tree-node-icon",1);if(!a){a=b.getTarget(".x-tree-node-el",6)}return a},delegateOut:function(b,a){if(!this.beforeEvent(b)){return}if(b.getTarget(".x-tree-ec-icon",1)){var c=this.getNode(b);this.onIconOut(b,c);if(c==this.lastEcOver){delete this.lastEcOver}}if((a=this.getNodeTarget(b))&&!b.within(a,true)){this.onNodeOut(b,this.getNode(b))}},delegateOver:function(b,a){if(!this.beforeEvent(b)){return}if(Ext.isGecko&&!this.trackingDoc){Ext.getBody().on("mouseover",this.trackExit,this);this.trackingDoc=true}if(this.lastEcOver){this.onIconOut(b,this.lastEcOver);delete this.lastEcOver}if(b.getTarget(".x-tree-ec-icon",1)){this.lastEcOver=this.getNode(b);this.onIconOver(b,this.lastEcOver)}if(a=this.getNodeTarget(b)){this.onNodeOver(b,this.getNode(b))}},trackExit:function(a){if(this.lastOverNode){if(this.lastOverNode.ui&&!a.within(this.lastOverNode.ui.getEl())){this.onNodeOut(a,this.lastOverNode)}delete this.lastOverNode;Ext.getBody().un("mouseover",this.trackExit,this);this.trackingDoc=false}},delegateClick:function(b,a){if(this.beforeEvent(b)){if(b.getTarget("input[type=checkbox]",1)){this.onCheckboxClick(b,this.getNode(b))}else{if(b.getTarget(".x-tree-ec-icon",1)){this.onIconClick(b,this.getNode(b))}else{if(this.getNodeTarget(b)){this.onNodeClick(b,this.getNode(b))}}}}else{this.checkContainerEvent(b,"click")}},delegateDblClick:function(b,a){if(this.beforeEvent(b)){if(this.getNodeTarget(b)){this.onNodeDblClick(b,this.getNode(b))}}else{this.checkContainerEvent(b,"dblclick")}},delegateContextMenu:function(b,a){if(this.beforeEvent(b)){if(this.getNodeTarget(b)){this.onNodeContextMenu(b,this.getNode(b))}}else{this.checkContainerEvent(b,"contextmenu")}},checkContainerEvent:function(b,a){if(this.disabled){b.stopEvent();return false}this.onContainerEvent(b,a)},onContainerEvent:function(b,a){this.tree.fireEvent("container"+a,this.tree,b)},onNodeClick:function(b,a){a.ui.onClick(b)},onNodeOver:function(b,a){this.lastOverNode=a;a.ui.onOver(b)},onNodeOut:function(b,a){a.ui.onOut(b)},onIconOver:function(b,a){a.ui.addClass("x-tree-ec-over")},onIconOut:function(b,a){a.ui.removeClass("x-tree-ec-over")},onIconClick:function(b,a){a.ui.ecClick(b)},onCheckboxClick:function(b,a){a.ui.onCheckChange(b)},onNodeDblClick:function(b,a){a.ui.onDblClick(b)},onNodeContextMenu:function(b,a){a.ui.onContextMenu(b)},beforeEvent:function(b){var a=this.getNode(b);if(this.disabled||!a||!a.ui){b.stopEvent();return false}return true},disable:function(){this.disabled=true},enable:function(){this.disabled=false}};Ext.tree.DefaultSelectionModel=function(a){this.selNode=null;this.addEvents("selectionchange","beforeselect");Ext.apply(this,a);Ext.tree.DefaultSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.tree.DefaultSelectionModel,Ext.util.Observable,{init:function(a){this.tree=a;a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this);a.on("click",this.onNodeClick,this)},onNodeClick:function(a,b){this.select(a)},select:function(c,a){if(!Ext.fly(c.ui.wrap).isVisible()&&a){return a.call(this,c)}var b=this.selNode;if(c==b){c.ui.onSelectedChange(true)}else{if(this.fireEvent("beforeselect",this,c,b)!==false){if(b&&b.ui){b.ui.onSelectedChange(false)}this.selNode=c;c.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,c,b)}}return c},unselect:function(b,a){if(this.selNode==b){this.clearSelections(a)}},clearSelections:function(a){var b=this.selNode;if(b){b.ui.onSelectedChange(false);this.selNode=null;if(a!==true){this.fireEvent("selectionchange",this,null)}}return b},getSelectedNode:function(){return this.selNode},isSelected:function(a){return this.selNode==a},selectPrevious:function(a){if(!(a=a||this.selNode||this.lastSelNode)){return null}var c=a.previousSibling;if(c){if(!c.isExpanded()||c.childNodes.length<1){return this.select(c,this.selectPrevious)}else{var b=c.lastChild;while(b&&b.isExpanded()&&Ext.fly(b.ui.wrap).isVisible()&&b.childNodes.length>0){b=b.lastChild}return this.select(b,this.selectPrevious)}}else{if(a.parentNode&&(this.tree.rootVisible||!a.parentNode.isRoot)){return this.select(a.parentNode,this.selectPrevious)}}return null},selectNext:function(b){if(!(b=b||this.selNode||this.lastSelNode)){return null}if(b.firstChild&&b.isExpanded()&&Ext.fly(b.ui.wrap).isVisible()){return this.select(b.firstChild,this.selectNext)}else{if(b.nextSibling){return this.select(b.nextSibling,this.selectNext)}else{if(b.parentNode){var a=null;b.parentNode.bubble(function(){if(this.nextSibling){a=this.getOwnerTree().selModel.select(this.nextSibling,this.selectNext);return false}});return a}}}return null},onKeyDown:function(c){var b=this.selNode||this.lastSelNode;var d=this;if(!b){return}var a=c.getKey();switch(a){case c.DOWN:c.stopEvent();this.selectNext();break;case c.UP:c.stopEvent();this.selectPrevious();break;case c.RIGHT:c.preventDefault();if(b.hasChildNodes()){if(!b.isExpanded()){b.expand()}else{if(b.firstChild){this.select(b.firstChild,c)}}}break;case c.LEFT:c.preventDefault();if(b.hasChildNodes()&&b.isExpanded()){b.collapse()}else{if(b.parentNode&&(this.tree.rootVisible||b.parentNode!=this.tree.getRootNode())){this.select(b.parentNode,c)}}break}}});Ext.tree.MultiSelectionModel=function(a){this.selNodes=[];this.selMap={};this.addEvents("selectionchange");Ext.apply(this,a);Ext.tree.MultiSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.tree.MultiSelectionModel,Ext.util.Observable,{init:function(a){this.tree=a;a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this);a.on("click",this.onNodeClick,this)},onNodeClick:function(a,b){if(b.ctrlKey&&this.isSelected(a)){this.unselect(a)}else{this.select(a,b,b.ctrlKey)}},select:function(a,c,b){if(b!==true){this.clearSelections(true)}if(this.isSelected(a)){this.lastSelNode=a;return a}this.selNodes.push(a);this.selMap[a.id]=a;this.lastSelNode=a;a.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,this.selNodes);return a},unselect:function(b){if(this.selMap[b.id]){b.ui.onSelectedChange(false);var c=this.selNodes;var a=c.indexOf(b);if(a!=-1){this.selNodes.splice(a,1)}delete this.selMap[b.id];this.fireEvent("selectionchange",this,this.selNodes)}},clearSelections:function(b){var d=this.selNodes;if(d.length>0){for(var c=0,a=d.length;c0},isExpandable:function(){return this.attributes.expandable||this.hasChildNodes()},appendChild:function(e){var g=false;if(Ext.isArray(e)){g=e}else{if(arguments.length>1){g=arguments}}if(g){for(var d=0,a=g.length;d0){var g=d?function(){e.apply(d,arguments)}:e;c.sort(g);for(var b=0;b
    ','',this.indentMarkup,"",'','',g?('':"/>")):"",'',e.text,"
    ",'',""].join("");if(l!==true&&e.nextSibling&&(b=e.nextSibling.ui.getEl())){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",b,d)}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",j,d)}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var i=this.elNode.childNodes;this.indentNode=i[0];this.ecNode=i[1];this.iconNode=i[2];var h=3;if(g){this.checkbox=i[3];this.checkbox.defaultChecked=this.checkbox.checked;h++}this.anchor=i[h];this.textNode=i[h].firstChild},getAnchor:function(){return this.anchor},getTextEl:function(){return this.textNode},getIconEl:function(){return this.iconNode},isChecked:function(){return this.checkbox?this.checkbox.checked:false},updateExpandIcon:function(){if(this.rendered){var g=this.node,d,c,a=g.isLast()?"x-tree-elbow-end":"x-tree-elbow",e=g.hasChildNodes();if(e||g.attributes.expandable){if(g.expanded){a+="-minus";d="x-tree-node-collapsed";c="x-tree-node-expanded"}else{a+="-plus";d="x-tree-node-expanded";c="x-tree-node-collapsed"}if(this.wasLeaf){this.removeClass("x-tree-node-leaf");this.wasLeaf=false}if(this.c1!=d||this.c2!=c){Ext.fly(this.elNode).replaceClass(d,c);this.c1=d;this.c2=c}}else{if(!this.wasLeaf){Ext.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-collapsed");delete this.c1;delete this.c2;this.wasLeaf=true}}var b="x-tree-ec-icon "+a;if(this.ecc!=b){this.ecNode.className=b;this.ecc=b}}},onIdChange:function(a){if(this.rendered){this.elNode.setAttribute("ext:tree-node-id",a)}},getChildIndent:function(){if(!this.childIndent){var a=[],b=this.node;while(b){if(!b.isRoot||(b.isRoot&&b.ownerTree.rootVisible)){if(!b.isLast()){a.unshift('')}else{a.unshift('')}}b=b.parentNode}this.childIndent=a.join("")}return this.childIndent},renderIndent:function(){if(this.rendered){var a="",b=this.node.parentNode;if(b){a=b.ui.getChildIndent()}if(this.indentMarkup!=a){this.indentNode.innerHTML=a;this.indentMarkup=a}this.updateExpandIcon()}},destroy:function(){if(this.elNode){Ext.dd.Registry.unregister(this.elNode.id)}Ext.each(["textnode","anchor","checkbox","indentNode","ecNode","iconNode","elNode","ctNode","wrap","holder"],function(a){if(this[a]){Ext.fly(this[a]).remove();delete this[a]}},this);delete this.node}};Ext.tree.RootTreeNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{render:function(){if(!this.rendered){var a=this.node.ownerTree.innerCt.dom;this.node.expanded=true;a.innerHTML='
    ';this.wrap=this.ctNode=a.firstChild}},collapse:Ext.emptyFn,expand:Ext.emptyFn});Ext.tree.TreeLoader=function(a){this.baseParams={};Ext.apply(this,a);this.addEvents("beforeload","load","loadexception");Ext.tree.TreeLoader.superclass.constructor.call(this);if(Ext.isString(this.paramOrder)){this.paramOrder=this.paramOrder.split(/[\s,|]/)}};Ext.extend(Ext.tree.TreeLoader,Ext.util.Observable,{uiProviders:{},clearOnLoad:true,paramOrder:undefined,paramsAsHash:false,nodeParameter:"node",directFn:undefined,load:function(b,c,a){if(this.clearOnLoad){while(b.firstChild){b.removeChild(b.firstChild)}}if(this.doPreload(b)){this.runCallback(c,a||b,[b])}else{if(this.directFn||this.dataUrl||this.url){this.requestData(b,c,a||b)}}},doPreload:function(d){if(d.attributes.children){if(d.childNodes.length<1){var c=d.attributes.children;d.beginUpdate();for(var b=0,a=c.length;b-1){c=[]}for(var d=0,a=b.length;dl){return e?-1:+1}else{return 0}}}};Ext.tree.TreeSorter.prototype={doSort:function(a){a.sort(this.sortFn)},compareNodes:function(b,a){return(b.text.toUpperCase()>a.text.toUpperCase()?1:-1)},updateSort:function(a,b){if(b.childrenRendered){this.doSort.defer(1,this,[b])}},updateSortParent:function(a){var b=a.parentNode;if(b&&b.childrenRendered){this.doSort.defer(1,this,[b])}}};if(Ext.dd.DropZone){Ext.tree.TreeDropZone=function(a,b){this.allowParentInsert=b.allowParentInsert||false;this.allowContainerDrop=b.allowContainerDrop||false;this.appendOnly=b.appendOnly||false;Ext.tree.TreeDropZone.superclass.constructor.call(this,a.getTreeEl(),b);this.tree=a;this.dragOverData={};this.lastInsertClass="x-tree-no-status"};Ext.extend(Ext.tree.TreeDropZone,Ext.dd.DropZone,{ddGroup:"TreeDD",expandDelay:1000,expandNode:function(a){if(a.hasChildNodes()&&!a.isExpanded()){a.expand(false,null,this.triggerCacheRefresh.createDelegate(this))}},queueExpand:function(a){this.expandProcId=this.expandNode.defer(this.expandDelay,this,[a])},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId);this.expandProcId=false}},isValidDropPoint:function(a,k,i,d,c){if(!a||!c){return false}var g=a.node;var h=c.node;if(!(g&&g.isTarget&&k)){return false}if(k=="append"&&g.allowChildren===false){return false}if((k=="above"||k=="below")&&(g.parentNode&&g.parentNode.allowChildren===false)){return false}if(h&&(g==h||h.contains(g))){return false}var b=this.dragOverData;b.tree=this.tree;b.target=g;b.data=c;b.point=k;b.source=i;b.rawEvent=d;b.dropNode=h;b.cancel=false;var j=this.tree.fireEvent("nodedragover",b);return b.cancel===false&&j!==false},getDropPoint:function(h,g,l){var m=g.node;if(m.isRoot){return m.allowChildren!==false?"append":false}var c=g.ddel;var o=Ext.lib.Dom.getY(c),j=o+c.offsetHeight;var i=Ext.lib.Event.getPageY(h);var k=m.allowChildren===false||m.isLeaf();if(this.appendOnly||m.parentNode.allowChildren===false){return k?false:"append"}var d=false;if(!this.allowParentInsert){d=m.hasChildNodes()&&m.isExpanded()}var a=(j-o)/(k?2:3);if(i>=o&&i<(o+a)){return"above"}else{if(!d&&(k||i>=j-a&&i<=j)){return"below"}else{return"append"}}},onNodeEnter:function(d,a,c,b){this.cancelExpand()},onContainerOver:function(a,c,b){if(this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,node:this.tree.getRootNode()},"append",a,c,b)){return this.dropAllowed}return this.dropNotAllowed},onNodeOver:function(b,i,h,g){var k=this.getDropPoint(h,b,i);var c=b.node;if(!this.expandProcId&&k=="append"&&c.hasChildNodes()&&!b.node.isExpanded()){this.queueExpand(c)}else{if(k!="append"){this.cancelExpand()}}var d=this.dropNotAllowed;if(this.isValidDropPoint(b,k,i,h,g)){if(k){var a=b.ddel;var j;if(k=="above"){d=b.node.isFirst()?"x-tree-drop-ok-above":"x-tree-drop-ok-between";j="x-tree-drag-insert-above"}else{if(k=="below"){d=b.node.isLast()?"x-tree-drop-ok-below":"x-tree-drop-ok-between";j="x-tree-drag-insert-below"}else{d="x-tree-drop-ok-append";j="x-tree-drag-append"}}if(this.lastInsertClass!=j){Ext.fly(a).replaceClass(this.lastInsertClass,j);this.lastInsertClass=j}}}return d},onNodeOut:function(d,a,c,b){this.cancelExpand();this.removeDropIndicators(d)},onNodeDrop:function(i,b,h,d){var a=this.getDropPoint(h,i,b);var g=i.node;g.ui.startDrop();if(!this.isValidDropPoint(i,a,b,h,d)){g.ui.endDrop();return false}var c=d.node||(b.getTreeNode?b.getTreeNode(d,g,a,h):null);return this.processDrop(g,d,a,b,h,c)},onContainerDrop:function(a,g,c){if(this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,node:this.tree.getRootNode()},"append",a,g,c)){var d=this.tree.getRootNode();d.ui.startDrop();var b=c.node||(a.getTreeNode?a.getTreeNode(c,d,"append",g):null);return this.processDrop(d,c,"append",a,g,b)}return false},processDrop:function(j,h,b,a,i,d){var g={tree:this.tree,target:j,data:h,point:b,source:a,rawEvent:i,dropNode:d,cancel:!d,dropStatus:false};var c=this.tree.fireEvent("beforenodedrop",g);if(c===false||g.cancel===true||!g.dropNode){j.ui.endDrop();return g.dropStatus}j=g.target;if(b=="append"&&!j.isExpanded()){j.expand(false,null,function(){this.completeDrop(g)}.createDelegate(this))}else{this.completeDrop(g)}return true},completeDrop:function(h){var d=h.dropNode,e=h.point,c=h.target;if(!Ext.isArray(d)){d=[d]}var g;for(var b=0,a=d.length;bd.offsetLeft){e.scrollLeft=d.offsetLeft}var a=Math.min(this.maxWidth,(e.clientWidth>20?e.clientWidth:e.offsetWidth)-Math.max(0,d.offsetLeft-e.scrollLeft)-5);this.setSize(a,"")},triggerEdit:function(a,c){this.completeEdit();if(a.attributes.editable!==false){this.editNode=a;if(this.tree.autoScroll){Ext.fly(a.ui.getEl()).scrollIntoView(this.tree.body)}var b=a.text||"";if(!Ext.isGecko&&Ext.isEmpty(a.text)){a.setText(" ")}this.autoEditTimer=this.startEdit.defer(this.editDelay,this,[a.ui.textNode,b]);return false}},bindScroll:function(){this.tree.getTreeEl().on("scroll",this.cancelEdit,this)},beforeNodeClick:function(a,b){clearTimeout(this.autoEditTimer);if(this.tree.getSelectionModel().isSelected(a)){b.stopEvent();return this.triggerEdit(a)}},onNodeDblClick:function(a,b){clearTimeout(this.autoEditTimer)},updateNode:function(a,b){this.tree.getTreeEl().un("scroll",this.cancelEdit,this);this.editNode.setText(b)},onHide:function(){Ext.tree.TreeEditor.superclass.onHide.call(this);if(this.editNode){this.editNode.ui.focus.defer(50,this.editNode.ui)}},onSpecialKey:function(c,b){var a=b.getKey();if(a==b.ESC){b.stopEvent();this.cancelEdit()}else{if(a==b.ENTER&&!b.hasModifier()){b.stopEvent();this.completeEdit()}}},onDestroy:function(){clearTimeout(this.autoEditTimer);Ext.tree.TreeEditor.superclass.onDestroy.call(this);var a=this.tree;a.un("beforeclick",this.beforeNodeClick,this);a.un("dblclick",this.onNodeDblClick,this)}}); +Ext.DomHelper=function(){var w=null,k=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,m=/^table|tbody|tr|td$/i,d=/tag|children|cn|html$/i,s=/td|tr|tbody/i,o=/([a-z0-9-]+)\s*:\s*([^;\s]+(?:\s*[^;\s]+)*);?/gi,u=/end/i,r,n="afterbegin",p="afterend",c="beforebegin",q="beforeend",a="",i="
    ",b=a+"",j=""+i,l=b+"",v=""+j;function h(A,C,B,D,z,x){var y=r.insertHtml(D,Ext.getDom(A),t(C));return B?Ext.get(y,true):y}function t(D){var z="",y,C,B,x,E;if(typeof D=="string"){z=D}else{if(Ext.isArray(D)){for(var A=0;A"}}}return z}function g(E,B,A,C){w.innerHTML=[B,A,C].join("");var x=-1,z=w,y;while(++x "'+C+'"'},insertBefore:function(x,z,y){return h(x,z,y,c)},insertAfter:function(x,z,y){return h(x,z,y,p,"nextSibling")},insertFirst:function(x,z,y){return h(x,z,y,n,"firstChild")},append:function(x,z,y){return h(x,z,y,q,"",true)},overwrite:function(x,z,y){x=Ext.getDom(x);x.innerHTML=t(z);return y?Ext.get(x.firstChild):x.firstChild},createHtml:t};return r}();Ext.apply(Ext.DomHelper,function(){var e,a="afterbegin",h="afterend",i="beforebegin",d="beforeend",b=/tag|children|cn|html$/i;function g(m,p,n,q,l,j){m=Ext.getDom(m);var k;if(e.useDom){k=c(p,null);if(j){m.appendChild(k)}else{(l=="firstChild"?m:m.parentNode).insertBefore(k,m[l]||m)}}else{k=Ext.DomHelper.insertHtml(q,m,Ext.DomHelper.createHtml(p))}return n?Ext.get(k,true):k}function c(j,r){var k,u=document,p,s,m,t;if(Ext.isArray(j)){k=u.createDocumentFragment();for(var q=0,n=j.length;q1){for(var g=0,b=c.length;g+~]\s?|\s|$)/,tagTokenRe=/^(#)?([\w-\*]+)/,nthRe=/(\d*)n\+?(\d*)/,nthRe2=/\D/,isIE=window.ActiveXObject?true:false,key=30803;eval("var batch = 30803;");function child(parent,index){var i=0,n=parent.firstChild;while(n){if(n.nodeType==1){if(++i==index){return n}}n=n.nextSibling}return null}function next(n){while((n=n.nextSibling)&&n.nodeType!=1){}return n}function prev(n){while((n=n.previousSibling)&&n.nodeType!=1){}return n}function children(parent){var n=parent.firstChild,nodeIndex=-1,nextNode;while(n){nextNode=n.nextSibling;if(n.nodeType==3&&!nonSpace.test(n.nodeValue)){parent.removeChild(n)}else{n.nodeIndex=++nodeIndex}n=nextNode}return this}function byClassName(nodeSet,cls){if(!cls){return nodeSet}var result=[],ri=-1;for(var i=0,ci;ci=nodeSet[i];i++){if((" "+ci.className+" ").indexOf(cls)!=-1){result[++ri]=ci}}return result}function attrValue(n,attr){if(!n.tagName&&typeof n.length!="undefined"){n=n[0]}if(!n){return null}if(attr=="for"){return n.htmlFor}if(attr=="class"||attr=="className"){return n.className}return n.getAttribute(attr)||n[attr]}function getNodes(ns,mode,tagName){var result=[],ri=-1,cs;if(!ns){return result}tagName=tagName||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns]}if(!mode){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(tagName);for(var j=0,ci;ci=cs[j];j++){result[++ri]=ci}}}else{if(mode=="/"||mode==">"){var utag=tagName.toUpperCase();for(var i=0,ni,cn;ni=ns[i];i++){cn=ni.childNodes;for(var j=0,cj;cj=cn[j];j++){if(cj.nodeName==utag||cj.nodeName==tagName||tagName=="*"){result[++ri]=cj}}}}else{if(mode=="+"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(n&&(n.nodeName==utag||n.nodeName==tagName||tagName=="*")){result[++ri]=n}}}else{if(mode=="~"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)){if(n.nodeName==utag||n.nodeName==tagName||tagName=="*"){result[++ri]=n}}}}}}}return result}function concat(a,b){if(b.slice){return a.concat(b)}for(var i=0,l=b.length;i1){return nodup(results)}return results},isXml:function(el){var docEl=(el?el.ownerDocument||el:0).documentElement;return docEl?docEl.nodeName!=="HTML":false},select:document.querySelectorAll?function(path,root,type){root=root||document;if(!Ext.DomQuery.isXml(root)){try{var cs=root.querySelectorAll(path);return Ext.toArray(cs)}catch(ex){}}return Ext.DomQuery.jsSelect.call(this,path,root,type)}:function(path,root,type){return Ext.DomQuery.jsSelect.call(this,path,root,type)},selectNode:function(path,root){return Ext.DomQuery.select(path,root)[0]},selectValue:function(path,root,defaultValue){path=path.replace(trimRe,"");if(!valueCache[path]){valueCache[path]=Ext.DomQuery.compile(path,"select")}var n=valueCache[path](root),v;n=n[0]?n[0]:n;if(typeof n.normalize=="function"){n.normalize()}v=(n&&n.firstChild?n.firstChild.nodeValue:null);return((v===null||v===undefined||v==="")?defaultValue:v)},selectNumber:function(path,root,defaultValue){var v=Ext.DomQuery.selectValue(path,root,defaultValue||0);return parseFloat(v)},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el)}var isArray=Ext.isArray(el),result=Ext.DomQuery.filter(isArray?el:[el],ss);return isArray?(result.length==el.length):(result.length>0)},filter:function(els,ss,nonMatches){ss=ss.replace(trimRe,"");if(!simpleCache[ss]){simpleCache[ss]=Ext.DomQuery.compile(ss,"simple")}var result=simpleCache[ss](els);return nonMatches?quickDiff(result,els):result},matchers:[{re:/^\.([\w-]+)/,select:'n = byClassName(n, " {1} ");'},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'},{re:/^#([\w-]+)/,select:'n = byId(n, "{1}");'},{re:/^@([\w-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,v){return a==v},"!=":function(a,v){return a!=v},"^=":function(a,v){return a&&a.substr(0,v.length)==v},"$=":function(a,v){return a&&a.substr(a.length-v.length)==v},"*=":function(a,v){return a&&a.indexOf(v)!==-1},"%=":function(a,v){return(a%v)==0},"|=":function(a,v){return a&&(a==v||a.substr(0,v.length+1)==v+"-")},"~=":function(a,v){return a&&(" "+a+" ").indexOf(" "+v+" ")!=-1}},pseudos:{"first-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"last-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"nth-child":function(c,a){var r=[],ri=-1,m=nthRe.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!nthRe2.test(a)&&"n+"+a||a),f=(m[1]||1)-0,l=m[2]-0;for(var i=0,n;n=c[i];i++){var pn=n.parentNode;if(batch!=pn._batch){var j=0;for(var cn=pn.firstChild;cn;cn=cn.nextSibling){if(cn.nodeType==1){cn.nodeIndex=++j}}pn._batch=batch}if(f==1){if(l==0||n.nodeIndex==l){r[++ri]=n}}else{if((n.nodeIndex+l)%f==0){r[++ri]=n}}}return r},"only-child":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(!prev(ci)&&!next(ci)){r[++ri]=ci}}return r},empty:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,empty=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){empty=false;break}}if(empty){r[++ri]=ci}}return r},contains:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if((ci.textContent||ci.innerText||"").indexOf(v)!=-1){r[++ri]=ci}}return r},nodeValue:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[++ri]=ci}}return r},checked:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[++ri]=ci}}return r},not:function(c,ss){return Ext.DomQuery.filter(c,ss,true)},any:function(c,selectors){var ss=selectors.split("|"),r=[],ri=-1,s;for(var i=0,ci;ci=c[i];i++){for(var j=0;s=ss[j];j++){if(Ext.DomQuery.is(ci,s)){r[++ri]=ci;break}}}return r},odd:function(c){return this["nth-child"](c,"odd")},even:function(c){return this["nth-child"](c,"even")},nth:function(c,a){return c[a-1]||[]},first:function(c){return c[0]||[]},last:function(c){return c[c.length-1]||[]},has:function(c,ss){var s=Ext.DomQuery.select,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[++ri]=ci}}return r},next:function(c,ss){var is=Ext.DomQuery.is,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=next(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r},prev:function(c,ss){var is=Ext.DomQuery.is,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=prev(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r}}}}();Ext.query=Ext.DomQuery.select;Ext.util.DelayedTask=function(d,c,a){var e=this,g,b=function(){clearInterval(g);g=null;d.apply(c,a||[])};e.delay=function(i,k,j,h){e.cancel();d=k||d;c=j||c;a=h||a;g=setInterval(b,i)};e.cancel=function(){if(g){clearInterval(g);g=null}}};(function(){var h=Ext.util,j=Ext.each,g=true,i=false;h.Observable=function(){var k=this,l=k.events;if(k.listeners){k.on(k.listeners);delete k.listeners}k.events=l||{}};h.Observable.prototype={filterOptRe:/^(?:scope|delay|buffer|single)$/,fireEvent:function(){var k=Array.prototype.slice.call(arguments,0),m=k[0].toLowerCase(),n=this,l=g,p=n.events[m],s,o,r;if(n.eventsSuspended===g){if(o=n.eventQueue){o.push(k)}}else{if(typeof p=="object"){if(p.bubble){if(p.fire.apply(p,k.slice(1))===i){return i}r=n.getBubbleTarget&&n.getBubbleTarget();if(r&&r.enableBubble){s=r.events[m];if(!s||typeof s!="object"||!s.bubble){r.enableBubble(m)}return r.fireEvent.apply(r,k)}}else{k.shift();l=p.fire.apply(p,k)}}}return l},addListener:function(m,q,s,l){var p=this,n,t,r,k;if(typeof m=="object"){l=m;for(n in l){t=l[n];if(!p.filterOptRe.test(n)){p.addListener(n,t.fn||t,t.scope||l.scope,t.fn?t:l)}}}else{m=m.toLowerCase();k=p.events[m]||g;if(typeof k=="boolean"){p.events[m]=k=new h.Event(p,m)}k.addListener(q,s,typeof l=="object"?l:{})}},removeListener:function(k,m,l){var n=this.events[k.toLowerCase()];if(typeof n=="object"){n.removeListener(m,l)}},purgeListeners:function(){var m=this.events,k,l;for(l in m){k=m[l];if(typeof k=="object"){k.clearListeners()}}},addEvents:function(n){var m=this;m.events=m.events||{};if(typeof n=="string"){var k=arguments,l=k.length;while(l--){m.events[k[l]]=m.events[k[l]]||g}}else{Ext.applyIf(m.events,n)}},hasListener:function(k){var l=this.events[k.toLowerCase()];return typeof l=="object"&&l.listeners.length>0},suspendEvents:function(k){this.eventsSuspended=g;if(k&&!this.eventQueue){this.eventQueue=[]}},resumeEvents:function(){var k=this,l=k.eventQueue||[];k.eventsSuspended=i;delete k.eventQueue;j(l,function(m){k.fireEvent.apply(k,m)})}};var d=h.Observable.prototype;d.on=d.addListener;d.un=d.removeListener;h.Observable.releaseCapture=function(k){k.fireEvent=d.fireEvent};function e(l,m,k){return function(){if(m.target==arguments[0]){l.apply(k,Array.prototype.slice.call(arguments,0))}}}function b(n,p,k,m){k.task=new h.DelayedTask();return function(){k.task.delay(p.buffer,n,m,Array.prototype.slice.call(arguments,0))}}function c(m,n,l,k){return function(){n.removeListener(l,k);return m.apply(k,arguments)}}function a(n,p,k,m){return function(){var l=new h.DelayedTask();if(!k.tasks){k.tasks=[]}k.tasks.push(l);l.delay(p.delay||10,n,m,Array.prototype.slice.call(arguments,0))}}h.Event=function(l,k){this.name=k;this.obj=l;this.listeners=[]};h.Event.prototype={addListener:function(o,n,m){var p=this,k;n=n||p.obj;if(!p.isListening(o,n)){k=p.createListener(o,n,m);if(p.firing){p.listeners=p.listeners.slice(0)}p.listeners.push(k)}},createListener:function(p,n,q){q=q||{},n=n||this.obj;var k={fn:p,scope:n,options:q},m=p;if(q.target){m=e(m,q,n)}if(q.delay){m=a(m,q,k,n)}if(q.single){m=c(m,this,p,n)}if(q.buffer){m=b(m,q,k,n)}k.fireFn=m;return k},findListener:function(o,n){var p=this.listeners,m=p.length,k;n=n||this.obj;while(m--){k=p[m];if(k){if(k.fn==o&&k.scope==n){return m}}}return -1},isListening:function(l,k){return this.findListener(l,k)!=-1},removeListener:function(r,q){var p,m,n,s=this,o=i;if((p=s.findListener(r,q))!=-1){if(s.firing){s.listeners=s.listeners.slice(0)}m=s.listeners[p];if(m.task){m.task.cancel();delete m.task}n=m.tasks&&m.tasks.length;if(n){while(n--){m.tasks[n].cancel()}delete m.tasks}s.listeners.splice(p,1);o=g}return o},clearListeners:function(){var n=this,k=n.listeners,m=k.length;while(m--){n.removeListener(k[m].fn,k[m].scope)}},fire:function(){var q=this,p=q.listeners,k=p.length,o=0,m;if(k>0){q.firing=g;var n=Array.prototype.slice.call(arguments,0);for(;o=525:!((Ext.isGecko&&!Ext.isWindows)||Ext.isOpera);return{doResizeEvent:function(){var l=a.getViewHeight(),k=a.getViewWidth();if(g!=l||h!=k){c.fire(h=k,g=l)}},onWindowResize:function(m,l,k){if(!c){c=new Ext.util.Event();j=new Ext.util.DelayedTask(this.doResizeEvent);Ext.EventManager.on(window,"resize",this.fireWindowResize,this)}c.addListener(m,l,k)},fireWindowResize:function(){if(c){j.delay(100)}},onTextResize:function(n,m,k){if(!e){e=new Ext.util.Event();var l=new Ext.Element(document.createElement("div"));l.dom.className="x-text-resize";l.dom.innerHTML="X";l.appendTo(document.body);b=l.dom.offsetHeight;setInterval(function(){if(l.dom.offsetHeight!=b){e.fire(b,b=l.dom.offsetHeight)}},this.textResizeInterval)}e.addListener(n,m,k)},removeResizeListener:function(l,k){if(c){c.removeListener(l,k)}},fireResize:function(){if(c){c.fire(a.getViewWidth(),a.getViewHeight())}},textResizeInterval:50,ieDeferSrc:false,useKeydown:d}}());Ext.EventManager.on=Ext.EventManager.addListener;Ext.apply(Ext.EventObjectImpl.prototype,{BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,RETURN:13,SHIFT:16,CTRL:17,CONTROL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGEUP:33,PAGE_DOWN:34,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,isNavKeyPress:function(){var b=this,a=this.normalizeKey(b.keyCode);return(a>=33&&a<=40)||a==b.RETURN||a==b.TAB||a==b.ESC},isSpecialKey:function(){var a=this.normalizeKey(this.keyCode);return(this.type=="keypress"&&this.ctrlKey)||this.isNavKeyPress()||(a==this.BACKSPACE)||(a>=16&&a<=20)||(a>=44&&a<=46)},getPoint:function(){return new Ext.lib.Point(this.xy[0],this.xy[1])},hasModifier:function(){return((this.ctrlKey||this.altKey)||this.shiftKey)}});(function(){var j=document;Ext.Element=function(o,p){var q=typeof o=="string"?j.getElementById(o):o,r;if(!q){return null}r=q.id;if(!p&&r&&Ext.elCache[r]){return Ext.elCache[r].el}this.dom=q;this.id=r||Ext.id(q)};var a=Ext.lib.Dom,g=Ext.DomHelper,m=Ext.lib.Event,e=Ext.lib.Anim,h=Ext.Element,b=Ext.elCache;h.prototype={set:function(t,q){var r=this.dom,p,s,q=(q!==false)&&!!r.setAttribute;for(p in t){if(t.hasOwnProperty(p)){s=t[p];if(p=="style"){g.applyStyles(r,s)}else{if(p=="cls"){r.className=s}else{if(q){r.setAttribute(p,s)}else{r[p]=s}}}}}return this},defaultUnit:"px",is:function(o){return Ext.DomQuery.is(this.dom,o)},focus:function(r,q){var o=this,q=q||o.dom;try{if(Number(r)){o.focus.defer(r,null,[null,q])}else{q.focus()}}catch(p){}return o},blur:function(){try{this.dom.blur()}catch(o){}return this},getValue:function(o){var p=this.dom.value;return o?parseInt(p,10):p},addListener:function(o,r,q,p){Ext.EventManager.on(this.dom,o,r,q||this,p);return this},removeListener:function(o,q,p){Ext.EventManager.removeListener(this.dom,o,q,p||this);return this},removeAllListeners:function(){Ext.EventManager.removeAll(this.dom);return this},purgeAllListeners:function(){Ext.EventManager.purgeElement(this,true);return this},addUnits:function(o){if(o===""||o=="auto"||o===undefined){o=o||""}else{if(!isNaN(o)||!k.test(o)){o=o+(this.defaultUnit||"px")}}return o},load:function(p,q,o){Ext.Ajax.request(Ext.apply({params:q,url:p.url||p,callback:o,el:this.dom,indicatorText:p.indicatorText||""},Ext.isObject(p)?p:{}));return this},isBorderBox:function(){return i[(this.dom.tagName||"").toLowerCase()]||Ext.isBorderBox},remove:function(){var o=this,p=o.dom;if(p){delete o.dom;Ext.removeNode(p)}},hover:function(p,o,r,q){var s=this;s.on("mouseenter",p,r||s.dom,q);s.on("mouseleave",o,r||s.dom,q);return s},contains:function(o){return !o?false:Ext.lib.Dom.isAncestor(this.dom,o.dom?o.dom:o)},getAttributeNS:function(p,o){return this.getAttribute(o,p)},getAttribute:Ext.isIE?function(o,q){var r=this.dom,p=typeof r[q+":"+o];if(["undefined","unknown"].indexOf(p)==-1){return r[q+":"+o]}return r[o]}:function(o,p){var q=this.dom;return q.getAttributeNS(p,o)||q.getAttribute(p+":"+o)||q.getAttribute(o)||q[o]},update:function(o){if(this.dom){this.dom.innerHTML=o}return this}};var n=h.prototype;h.addMethods=function(p){Ext.apply(n,p)};n.on=n.addListener;n.un=n.removeListener;n.autoBoxAdjust=true;var k=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i,d;h.get=function(p){var o,s,r;if(!p){return null}if(typeof p=="string"){if(!(s=j.getElementById(p))){return null}if(b[p]&&b[p].el){o=b[p].el;o.dom=s}else{o=h.addToCache(new h(s))}return o}else{if(p.tagName){if(!(r=p.id)){r=Ext.id(p)}if(b[r]&&b[r].el){o=b[r].el;o.dom=p}else{o=h.addToCache(new h(p))}return o}else{if(p instanceof h){if(p!=d){if(Ext.isIE&&(p.id==undefined||p.id=="")){p.dom=p.dom}else{p.dom=j.getElementById(p.id)||p.dom}}return p}else{if(p.isComposite){return p}else{if(Ext.isArray(p)){return h.select(p)}else{if(p==j){if(!d){var q=function(){};q.prototype=h.prototype;d=new q();d.dom=j}return d}}}}}}return null};h.addToCache=function(o,p){p=p||o.id;b[p]={el:o,data:{},events:{}};return o};h.data=function(p,o,q){p=h.get(p);if(!p){return null}var r=b[p.id].data;if(arguments.length==2){return r[o]}else{return(r[o]=q)}};function l(){if(!Ext.enableGarbageCollector){clearInterval(h.collectorThreadId)}else{var p,r,u,s;for(p in b){s=b[p];if(s.skipGC){continue}r=s.el;u=r.dom;if(!u||!u.parentNode||(!u.offsetParent&&!j.getElementById(p))){if(Ext.enableListenerCollection){Ext.EventManager.removeAll(u)}delete b[p]}}if(Ext.isIE){var q={};for(p in b){q[p]=b[p]}b=Ext.elCache=q}}}h.collectorThreadId=setInterval(l,30000);var c=function(){};c.prototype=h.prototype;h.Flyweight=function(o){this.dom=o};h.Flyweight.prototype=new c();h.Flyweight.prototype.isFlyweight=true;h._flyweights={};h.fly=function(q,o){var p=null;o=o||"_global";if(q=Ext.getDom(q)){(h._flyweights[o]=h._flyweights[o]||new h.Flyweight()).dom=q;p=h._flyweights[o]}return p};Ext.get=h.get;Ext.fly=h.fly;var i=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko){i.button=1}})();Ext.Element.addMethods({swallowEvent:function(a,b){var d=this;function c(g){g.stopPropagation();if(b){g.preventDefault()}}if(Ext.isArray(a)){Ext.each(a,function(g){d.on(g,c)});return d}d.on(a,c);return d},relayEvent:function(a,b){this.on(a,function(c){b.fireEvent(a,c)})},clean:function(b){var d=this,e=d.dom,g=e.firstChild,c=-1;if(Ext.Element.data(e,"isCleaned")&&b!==true){return d}while(g){var a=g.nextSibling;if(g.nodeType==3&&!/\S/.test(g.nodeValue)){e.removeChild(g)}else{g.nodeIndex=++c}g=a}Ext.Element.data(e,"isCleaned",true);return d},load:function(){var a=this.getUpdater();a.update.apply(a,arguments);return this},getUpdater:function(){return this.updateManager||(this.updateManager=new Ext.Updater(this))},update:function(html,loadScripts,callback){if(!this.dom){return this}html=html||"";if(loadScripts!==true){this.dom.innerHTML=html;if(typeof callback=="function"){callback()}return this}var id=Ext.id(),dom=this.dom;html+='';Ext.lib.Event.onAvailable(id,function(){var DOC=document,hd=DOC.getElementsByTagName("head")[0],re=/(?:]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,srcRe=/\ssrc=([\'\"])(.*?)\1/i,typeRe=/\stype=([\'\"])(.*?)\1/i,match,attrs,srcMatch,typeMatch,el,s;while((match=re.exec(html))){attrs=match[1];srcMatch=attrs?attrs.match(srcRe):false;if(srcMatch&&srcMatch[2]){s=DOC.createElement("script");s.src=srcMatch[2];typeMatch=attrs.match(typeRe);if(typeMatch&&typeMatch[2]){s.type=typeMatch[2]}hd.appendChild(s)}else{if(match[2]&&match[2].length>0){if(window.execScript){window.execScript(match[2])}else{window.eval(match[2])}}}}el=DOC.getElementById(id);if(el){Ext.removeNode(el)}if(typeof callback=="function"){callback()}});dom.innerHTML=html.replace(/(?:)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this},removeAllListeners:function(){this.removeAnchor();Ext.EventManager.removeAll(this.dom);return this},createProxy:function(a,e,d){a=(typeof a=="object")?a:{tag:"div",cls:a};var c=this,b=e?Ext.DomHelper.append(e,a,true):Ext.DomHelper.insertBefore(c.dom,a,true);if(d&&c.setBox&&c.getBox){b.setBox(c.getBox())}return b}});Ext.Element.prototype.getUpdateManager=Ext.Element.prototype.getUpdater;Ext.Element.addMethods({getAnchorXY:function(e,l,q){e=(e||"tl").toLowerCase();q=q||{};var k=this,b=k.dom==document.body||k.dom==document,n=q.width||b?Ext.lib.Dom.getViewWidth():k.getWidth(),i=q.height||b?Ext.lib.Dom.getViewHeight():k.getHeight(),p,a=Math.round,c=k.getXY(),m=k.getScroll(),j=b?m.left:!l?c[0]:0,g=b?m.top:!l?c[1]:0,d={c:[a(n*0.5),a(i*0.5)],t:[a(n*0.5),0],l:[0,a(i*0.5)],r:[n,a(i*0.5)],b:[a(n*0.5),i],tl:[0,0],bl:[0,i],br:[n,i],tr:[n,0]};p=d[e];return[p[0]+j,p[1]+g]},anchorTo:function(b,h,c,a,k,l){var i=this,e=i.dom,j=!Ext.isEmpty(k),d=function(){Ext.fly(e).alignTo(b,h,c,a);Ext.callback(l,Ext.fly(e))},g=this.getAnchor();this.removeAnchor();Ext.apply(g,{fn:d,scroll:j});Ext.EventManager.onWindowResize(d,null);if(j){Ext.EventManager.on(window,"scroll",d,null,{buffer:!isNaN(k)?k:50})}d.call(i);return i},removeAnchor:function(){var b=this,a=this.getAnchor();if(a&&a.fn){Ext.EventManager.removeResizeListener(a.fn);if(a.scroll){Ext.EventManager.un(window,"scroll",a.fn)}delete a.fn}return b},getAnchor:function(){var b=Ext.Element.data,c=this.dom;if(!c){return}var a=b(c,"_anchor");if(!a){a=b(c,"_anchor",{})}return a},getAlignToXY:function(g,A,B){g=Ext.get(g);if(!g||!g.dom){throw"Element.alignToXY with an element that doesn't exist"}B=B||[0,0];A=(!A||A=="?"?"tl-bl?":(!/-/.test(A)&&A!==""?"tl-"+A:A||"tl-bl")).toLowerCase();var K=this,H=K.dom,M,L,n,l,s,F,v,t=Ext.lib.Dom.getViewWidth()-10,G=Ext.lib.Dom.getViewHeight()-10,b,i,j,k,u,z,N=document,J=N.documentElement,q=N.body,E=(J.scrollLeft||q.scrollLeft||0)+5,D=(J.scrollTop||q.scrollTop||0)+5,I=false,e="",a="",C=A.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!C){throw"Element.alignTo with an invalid alignment "+A}e=C[1];a=C[2];I=!!C[3];M=K.getAnchorXY(e,true);L=g.getAnchorXY(a,false);n=L[0]-M[0]+B[0];l=L[1]-M[1]+B[1];if(I){s=K.getWidth();F=K.getHeight();v=g.getRegion();b=e.charAt(0);i=e.charAt(e.length-1);j=a.charAt(0);k=a.charAt(a.length-1);u=((b=="t"&&j=="b")||(b=="b"&&j=="t"));z=((i=="r"&&k=="l")||(i=="l"&&k=="r"));if(n+s>t+E){n=z?v.left-s:t+E-s}if(nG+D){l=u?v.top-F:G+D-F}if(lA){o=A-p;l=true}if((n+B)>g){n=g-B;l=true}if(o "+g,this.dom);return h?i:a(i)},parent:function(g,h){return this.matchNode(d,d,g,h)},next:function(g,h){return this.matchNode(b,b,g,h)},prev:function(g,h){return this.matchNode(c,c,g,h)},first:function(g,h){return this.matchNode(b,"firstChild",g,h)},last:function(g,h){return this.matchNode(c,"lastChild",g,h)},matchNode:function(h,k,g,i){var j=this.dom[k];while(j){if(j.nodeType==1&&(!g||e.is(j,g))){return !i?a(j):j}j=j[h]}return null}}}());Ext.Element.addMethods({select:function(a,b){return Ext.Element.select(a,b,this.dom)}});Ext.Element.addMethods(function(){var c=Ext.getDom,a=Ext.get,b=Ext.DomHelper;return{appendChild:function(d){return a(d).appendTo(this)},appendTo:function(d){c(d).appendChild(this.dom);return this},insertBefore:function(d){(d=c(d)).parentNode.insertBefore(this.dom,d);return this},insertAfter:function(d){(d=c(d)).parentNode.insertBefore(this.dom,d.nextSibling);return this},insertFirst:function(e,d){e=e||{};if(e.nodeType||e.dom||typeof e=="string"){e=c(e);this.dom.insertBefore(e,this.dom.firstChild);return !d?a(e):e}else{return this.createChild(e,this.dom.firstChild,d)}},replace:function(d){d=a(d);this.insertBefore(d);d.remove();return this},replaceWith:function(d){var e=this;if(d.nodeType||d.dom||typeof d=="string"){d=c(d);e.dom.parentNode.insertBefore(d,e.dom)}else{d=b.insertBefore(e.dom,d)}delete Ext.elCache[e.id];Ext.removeNode(e.dom);e.id=Ext.id(e.dom=d);Ext.Element.addToCache(e.isFlyweight?new Ext.Element(e.dom):e);return e},createChild:function(e,d,g){e=e||{tag:"div"};return d?b.insertBefore(d,e,g!==true):b[!this.dom.firstChild?"overwrite":"append"](this.dom,e,g!==true)},wrap:function(d,e){var g=b.insertBefore(this.dom,d||{tag:"div"},!e);g.dom?g.dom.appendChild(this.dom):g.appendChild(this.dom);return g},insertHtml:function(e,g,d){var h=b.insertHtml(e,this.dom,g);return d?Ext.get(h):h}}}());Ext.apply(Ext.Element.prototype,function(){var c=Ext.getDom,a=Ext.get,b=Ext.DomHelper;return{insertSibling:function(i,g,h){var j=this,e,d=(g||"before").toLowerCase()=="after",k;if(Ext.isArray(i)){k=j;Ext.each(i,function(l){e=Ext.fly(k,"_internal").insertSibling(l,g,h);if(d){k=e}});return e}i=i||{};if(i.nodeType||i.dom){e=j.dom.parentNode.insertBefore(c(i),d?j.dom.nextSibling:j.dom);if(!h){e=a(e)}}else{if(d&&!j.dom.nextSibling){e=b.append(j.dom.parentNode,i,!h)}else{e=b[d?"insertAfter":"insertBefore"](j.dom,i,!h)}}return e}}}());Ext.Element.addMethods(function(){var i={},z=/(-[a-z])/gi,c={},t=document.defaultView,w=Ext.isIE?"styleFloat":"cssFloat",E=/alpha\(opacity=(.*)\)/i,m=/^\s+|\s+$/g,v=/\s+/,b=/\w/g,C=Ext.Element,e="padding",d="margin",A="border",u="-left",r="-right",y="-top",p="-bottom",k="-width",s=Math,B="hidden",g="isClipped",l="overflow",o="overflow-x",n="overflow-y",D="originalClip",j={l:A+u+k,r:A+r+k,t:A+y+k,b:A+p+k},h={l:e+u,r:e+r,t:e+y,b:e+p},a={l:d+u,r:d+r,t:d+y,b:d+p},F=Ext.Element.data;function q(G,H){return H.charAt(1).toUpperCase()}function x(G){return i[G]||(i[G]=G=="float"?w:G.replace(z,q))}return{adjustWidth:function(G){var H=this;var I=(typeof G=="number");if(I&&H.autoBoxAdjust&&!H.isBorderBox()){G-=(H.getBorderWidth("lr")+H.getPadding("lr"))}return(I&&G<0)?0:G},adjustHeight:function(G){var H=this;var I=(typeof G=="number");if(I&&H.autoBoxAdjust&&!H.isBorderBox()){G-=(H.getBorderWidth("tb")+H.getPadding("tb"))}return(I&&G<0)?0:G},addClass:function(K){var L=this,J,G,I,H=[];if(!Ext.isArray(K)){if(typeof K=="string"&&!this.hasClass(K)){L.dom.className+=" "+K}}else{for(J=0,G=K.length;J5?I.toLowerCase():H)},setStyle:function(K,J){var H,I,G;if(typeof K!="object"){H={};H[K]=J;K=H}for(I in K){J=K[I];I=="opacity"?this.setOpacity(J):this.dom.style[x(I)]=J}return this},setOpacity:function(H,G){var K=this,I=K.dom.style;if(!G||!K.anim){if(Ext.isIE){var J=H<1?"alpha(opacity="+H*100+")":"",L=I.filter.replace(E,"").replace(m,"");I.zoom=1;I.filter=L+(L.length>0?" ":"")+J}else{I.opacity=H}}else{K.anim({opacity:{to:H}},K.preanim(arguments,1),null,0.35,"easeIn")}return K},clearOpacity:function(){var G=this.dom.style;if(Ext.isIE){if(!Ext.isEmpty(G.filter)){G.filter=G.filter.replace(E,"").replace(m,"")}}else{G.opacity=G["-moz-opacity"]=G["-khtml-opacity"]=""}return this},getHeight:function(I){var H=this,K=H.dom,J=Ext.isIE&&H.isStyle("display","none"),G=s.max(K.offsetHeight,J?0:K.clientHeight)||0;G=!I?G:G-H.getBorderWidth("tb")-H.getPadding("tb");return G<0?0:G},getWidth:function(H){var I=this,K=I.dom,J=Ext.isIE&&I.isStyle("display","none"),G=s.max(K.offsetWidth,J?0:K.clientWidth)||0;G=!H?G:G-I.getBorderWidth("lr")-I.getPadding("lr");return G<0?0:G},setWidth:function(H,G){var I=this;H=I.adjustWidth(H);!G||!I.anim?I.dom.style.width=I.addUnits(H):I.anim({width:{to:H}},I.preanim(arguments,1));return I},setHeight:function(G,H){var I=this;G=I.adjustHeight(G);!H||!I.anim?I.dom.style.height=I.addUnits(G):I.anim({height:{to:G}},I.preanim(arguments,1));return I},getBorderWidth:function(G){return this.addStyles(G,j)},getPadding:function(G){return this.addStyles(G,h)},clip:function(){var G=this,H=G.dom;if(!F(H,g)){F(H,g,true);F(H,D,{o:G.getStyle(l),x:G.getStyle(o),y:G.getStyle(n)});G.setStyle(l,B);G.setStyle(o,B);G.setStyle(n,B)}return G},unclip:function(){var G=this,I=G.dom;if(F(I,g)){F(I,g,false);var H=F(I,D);if(H.o){G.setStyle(l,H.o)}if(H.x){G.setStyle(o,H.x)}if(H.y){G.setStyle(n,H.y)}}return G},addStyles:function(N,M){var K=0,L=N.match(b),J,I,H,G=L.length;for(H=0;H"+String.format(Ext.Element.boxMarkup,c)+""));Ext.DomQuery.selectNode("."+c+"-mc",d.dom).appendChild(this.dom);return d},setSize:function(e,c,d){var g=this;if(typeof e=="object"){c=e.height;e=e.width}e=g.adjustWidth(e);c=g.adjustHeight(c);if(!d||!g.anim){g.dom.style.width=g.addUnits(e);g.dom.style.height=g.addUnits(c)}else{g.anim({width:{to:e},height:{to:c}},g.preanim(arguments,2))}return g},getComputedHeight:function(){var d=this,c=Math.max(d.dom.offsetHeight,d.dom.clientHeight);if(!c){c=parseFloat(d.getStyle("height"))||0;if(!d.isBorderBox()){c+=d.getFrameWidth("tb")}}return c},getComputedWidth:function(){var c=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!c){c=parseFloat(this.getStyle("width"))||0;if(!this.isBorderBox()){c+=this.getFrameWidth("lr")}}return c},getFrameWidth:function(d,c){return c&&this.isBorderBox()?0:(this.getPadding(d)+this.getBorderWidth(d))},addClassOnOver:function(c){this.hover(function(){Ext.fly(this,a).addClass(c)},function(){Ext.fly(this,a).removeClass(c)});return this},addClassOnFocus:function(c){this.on("focus",function(){Ext.fly(this,a).addClass(c)},this.dom);this.on("blur",function(){Ext.fly(this,a).removeClass(c)},this.dom);return this},addClassOnClick:function(c){var d=this.dom;this.on("mousedown",function(){Ext.fly(d,a).addClass(c);var g=Ext.getDoc(),e=function(){Ext.fly(d,a).removeClass(c);g.removeListener("mouseup",e)};g.on("mouseup",e)});return this},getViewSize:function(){var g=document,h=this.dom,c=(h==g||h==g.body);if(c){var e=Ext.lib.Dom;return{width:e.getViewWidth(),height:e.getViewHeight()}}else{return{width:h.clientWidth,height:h.clientHeight}}},getStyleSize:function(){var j=this,c,i,l=document,m=this.dom,e=(m==l||m==l.body),g=m.style;if(e){var k=Ext.lib.Dom;return{width:k.getViewWidth(),height:k.getViewHeight()}}if(g.width&&g.width!="auto"){c=parseFloat(g.width);if(j.isBorderBox()){c-=j.getFrameWidth("lr")}}if(g.height&&g.height!="auto"){i=parseFloat(g.height);if(j.isBorderBox()){i-=j.getFrameWidth("tb")}}return{width:c||j.getWidth(true),height:i||j.getHeight(true)}},getSize:function(c){return{width:this.getWidth(c),height:this.getHeight(c)}},repaint:function(){var c=this.dom;this.addClass("x-repaint");setTimeout(function(){Ext.fly(c).removeClass("x-repaint")},1);return this},unselectable:function(){this.dom.unselectable="on";return this.swallowEvent("selectstart",true).applyStyles("-moz-user-select:none;-khtml-user-select:none;").addClass("x-unselectable")},getMargins:function(d){var e=this,c,g={t:"top",l:"left",r:"right",b:"bottom"},h={};if(!d){for(c in e.margins){h[g[c]]=parseFloat(e.getStyle(e.margins[c]))||0}return h}else{return e.addStyles.call(e,d,e.margins)}}}}());(function(){var a=Ext.lib.Dom,b="left",g="right",d="top",i="bottom",h="position",c="static",e="relative",j="auto",k="z-index";Ext.Element.addMethods({getX:function(){return a.getX(this.dom)},getY:function(){return a.getY(this.dom)},getXY:function(){return a.getXY(this.dom)},getOffsetsTo:function(l){var n=this.getXY(),m=Ext.fly(l,"_internal").getXY();return[n[0]-m[0],n[1]-m[1]]},setX:function(l,m){return this.setXY([l,this.getY()],this.animTest(arguments,m,1))},setY:function(m,l){return this.setXY([this.getX(),m],this.animTest(arguments,l,1))},setLeft:function(l){this.setStyle(b,this.addUnits(l));return this},setTop:function(l){this.setStyle(d,this.addUnits(l));return this},setRight:function(l){this.setStyle(g,this.addUnits(l));return this},setBottom:function(l){this.setStyle(i,this.addUnits(l));return this},setXY:function(n,l){var m=this;if(!l||!m.anim){a.setXY(m.dom,n)}else{m.anim({points:{to:n}},m.preanim(arguments,1),"motion")}return m},setLocation:function(l,n,m){return this.setXY([l,n],this.animTest(arguments,m,2))},moveTo:function(l,n,m){return this.setXY([l,n],this.animTest(arguments,m,2))},getLeft:function(l){return !l?this.getX():parseInt(this.getStyle(b),10)||0},getRight:function(l){var m=this;return !l?m.getX()+m.getWidth():(m.getLeft(true)+m.getWidth())||0},getTop:function(l){return !l?this.getY():parseInt(this.getStyle(d),10)||0},getBottom:function(l){var m=this;return !l?m.getY()+m.getHeight():(m.getTop(true)+m.getHeight())||0},position:function(p,o,l,n){var m=this;if(!p&&m.isStyle(h,c)){m.setStyle(h,e)}else{if(p){m.setStyle(h,p)}}if(o){m.setStyle(k,o)}if(l||n){m.setXY([l||false,n||false])}},clearPositioning:function(l){l=l||"";this.setStyle({left:l,right:l,top:l,bottom:l,"z-index":"",position:c});return this},getPositioning:function(){var m=this.getStyle(b);var n=this.getStyle(d);return{position:this.getStyle(h),left:m,right:m?"":this.getStyle(g),top:n,bottom:n?"":this.getStyle(i),"z-index":this.getStyle(k)}},setPositioning:function(l){var n=this,m=n.dom.style;n.setStyle(l);if(l.right==j){m.right=""}if(l.bottom==j){m.bottom=""}return n},translatePoints:function(m,u){u=isNaN(m[1])?u:m[1];m=isNaN(m[0])?m:m[0];var q=this,r=q.isStyle(h,e),s=q.getXY(),n=parseInt(q.getStyle(b),10),p=parseInt(q.getStyle(d),10);n=!isNaN(n)?n:(r?0:q.dom.offsetLeft);p=!isNaN(p)?p:(r?0:q.dom.offsetTop);return{left:(m-s[0]+n),top:(u-s[1]+p)}},animTest:function(m,l,n){return !!l&&this.preanim?this.preanim(m,n):false}})})();Ext.Element.addMethods({setBox:function(e,g,b){var d=this,a=e.width,c=e.height;if((g&&!d.autoBoxAdjust)&&!d.isBorderBox()){a-=(d.getBorderWidth("lr")+d.getPadding("lr"));c-=(d.getBorderWidth("tb")+d.getPadding("tb"))}d.setBounds(e.x,e.y,a,c,d.animTest.call(d,arguments,b,2));return d},getBox:function(j,p){var m=this,v,e,o,d=m.getBorderWidth,q=m.getPadding,g,a,u,n;if(!p){v=m.getXY()}else{e=parseInt(m.getStyle("left"),10)||0;o=parseInt(m.getStyle("top"),10)||0;v=[e,o]}var c=m.dom,s=c.offsetWidth,i=c.offsetHeight,k;if(!j){k={x:v[0],y:v[1],0:v[0],1:v[1],width:s,height:i}}else{g=d.call(m,"l")+q.call(m,"l");a=d.call(m,"r")+q.call(m,"r");u=d.call(m,"t")+q.call(m,"t");n=d.call(m,"b")+q.call(m,"b");k={x:v[0]+g,y:v[1]+u,0:v[0]+g,1:v[1]+u,width:s-(g+a),height:i-(u+n)}}k.right=k.x+k.width;k.bottom=k.y+k.height;return k},move:function(j,b,c){var g=this,m=g.getXY(),k=m[0],i=m[1],d=[k-b,i],l=[k+b,i],h=[k,i-b],a=[k,i+b],e={l:d,left:d,r:l,right:l,t:h,top:h,up:h,b:a,bottom:a,down:a};j=j.toLowerCase();g.moveTo(e[j][0],e[j][1],g.animTest.call(g,arguments,c,2))},setLeftTop:function(d,c){var b=this,a=b.dom.style;a.left=b.addUnits(d);a.top=b.addUnits(c);return b},getRegion:function(){return Ext.lib.Dom.getRegion(this.dom)},setBounds:function(b,g,d,a,c){var e=this;if(!c||!e.anim){e.setSize(d,a);e.setLocation(b,g)}else{e.anim({points:{to:[b,g]},width:{to:e.adjustWidth(d)},height:{to:e.adjustHeight(a)}},e.preanim(arguments,4),"motion")}return e},setRegion:function(b,a){return this.setBounds(b.left,b.top,b.right-b.left,b.bottom-b.top,this.animTest.call(this,arguments,a,1))}});Ext.Element.addMethods({isScrollable:function(){var a=this.dom;return a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth},scrollTo:function(a,b){this.dom["scroll"+(/top/i.test(a)?"Top":"Left")]=b;return this},getScroll:function(){var i=this.dom,h=document,a=h.body,c=h.documentElement,b,g,e;if(i==h||i==a){if(Ext.isIE&&Ext.isStrict){b=c.scrollLeft;g=c.scrollTop}else{b=window.pageXOffset;g=window.pageYOffset}e={left:b||(a?a.scrollLeft:0),top:g||(a?a.scrollTop:0)}}else{e={left:i.scrollLeft,top:i.scrollTop}}return e}});Ext.Element.addMethods({scrollTo:function(b,d,a){var e=/top/i.test(b),c=this,g=c.dom,h;if(!a||!c.anim){h="scroll"+(e?"Top":"Left"),g[h]=d}else{h="scroll"+(e?"Left":"Top"),c.anim({scroll:{to:e?[g[h],d]:[d,g[h]]}},c.preanim(arguments,2),"scroll")}return c},scrollIntoView:function(e,i){var p=Ext.getDom(e)||Ext.getBody().dom,h=this.dom,g=this.getOffsetsTo(p),k=g[0]+p.scrollLeft,u=g[1]+p.scrollTop,q=u+h.offsetHeight,d=k+h.offsetWidth,a=p.clientHeight,m=parseInt(p.scrollTop,10),s=parseInt(p.scrollLeft,10),j=m+a,n=s+p.clientWidth;if(h.offsetHeight>a||uj){p.scrollTop=q-a}}p.scrollTop=p.scrollTop;if(i!==false){if(h.offsetWidth>p.clientWidth||kn){p.scrollLeft=d-p.clientWidth}}p.scrollLeft=p.scrollLeft}return this},scrollChildIntoView:function(b,a){Ext.fly(b,"_scrollChildIntoView").scrollIntoView(this,a)},scroll:function(m,b,d){if(!this.isScrollable()){return}var e=this.dom,g=e.scrollLeft,p=e.scrollTop,n=e.scrollWidth,k=e.scrollHeight,i=e.clientWidth,a=e.clientHeight,c=false,o,j={l:Math.min(g+b,n-i),r:o=Math.max(g-b,0),t:Math.max(p-b,0),b:Math.min(p+b,k-a)};j.d=j.b;j.u=j.t;m=m.substr(0,1);if((o=j[m])>-1){c=true;this.scrollTo(m=="l"||m=="r"?"left":"top",o,this.preanim(arguments,2))}return c}});Ext.Element.VISIBILITY=1;Ext.Element.DISPLAY=2;Ext.Element.addMethods(function(){var h="visibility",d="display",b="hidden",k="offsets",j="none",a="originalDisplay",c="visibilityMode",e=Ext.Element.DISPLAY,g=Ext.Element.data,i=function(n){var m=g(n,a);if(m===undefined){g(n,a,m="")}return m},l=function(o){var n=g(o,c);if(n===undefined){g(o,c,n=1)}return n};return{originalDisplay:"",visibilityMode:1,setVisibilityMode:function(m){g(this.dom,c,m);return this},animate:function(n,p,o,q,m){this.anim(n,{duration:p,callback:o,easing:q},m);return this},anim:function(p,q,n,s,o,m){n=n||"run";q=q||{};var r=this,t=Ext.lib.Anim[n](r.dom,p,(q.duration||s)||0.35,(q.easing||o)||"easeOut",function(){if(m){m.call(r)}if(q.callback){q.callback.call(q.scope||r,r,q)}},r);q.anim=t;return t},preanim:function(m,n){return !m[n]?false:(typeof m[n]=="object"?m[n]:{duration:m[n+1],callback:m[n+2],easing:m[n+3]})},isVisible:function(){return !this.isStyle(h,b)&&!this.isStyle(d,j)},setVisible:function(r,o){var p=this,n,m,s,q=p.dom;if(typeof o=="string"){n=o==d;m=o==h;s=o==k;o=false}else{n=l(this.dom)==e;m=!n}if(!o||!p.anim){if(n){p.setDisplayed(r)}else{if(s){if(!r){p.hideModeStyles={position:p.getStyle("position"),top:p.getStyle("top"),left:p.getStyle("left")};p.applyStyles({position:"absolute",top:"-10000px",left:"-10000px"})}else{p.applyStyles(p.hideModeStyles||{position:"",top:"",left:""})}}else{p.fixDisplay();q.style.visibility=r?"visible":b}}}else{if(r){p.setOpacity(0.01);p.setVisible(true)}p.anim({opacity:{to:(r?1:0)}},p.preanim(arguments,1),null,0.35,"easeIn",function(){if(!r){q.style[n?d:h]=(n)?j:b;Ext.fly(q).setOpacity(1)}})}return p},toggle:function(m){var n=this;n.setVisible(!n.isVisible(),n.preanim(arguments,0));return n},setDisplayed:function(m){if(typeof m=="boolean"){m=m?i(this.dom):j}this.setStyle(d,m);return this},fixDisplay:function(){var m=this;if(m.isStyle(d,j)){m.setStyle(h,b);m.setStyle(d,i(this.dom));if(m.isStyle(d,j)){m.setStyle(d,"block")}}},hide:function(m){if(typeof m=="string"){this.setVisible(false,m);return this}this.setVisible(false,this.preanim(arguments,0));return this},show:function(m){if(typeof m=="string"){this.setVisible(true,m);return this}this.setVisible(true,this.preanim(arguments,0));return this}}}());Ext.Element.addMethods(function(){var d="visibility",b="display",a="hidden",h="none",c="x-masked",g="x-masked-relative",e=Ext.Element.data;return{isVisible:function(i){var j=!this.isStyle(d,a)&&!this.isStyle(b,h),k=this.dom.parentNode;if(i!==true||!j){return j}while(k&&!/^body/i.test(k.tagName)){if(!Ext.fly(k,"_isVisible").isVisible()){return false}k=k.parentNode}return true},isDisplayed:function(){return !this.isStyle(b,h)},enableDisplayMode:function(i){this.setVisibilityMode(Ext.Element.DISPLAY);if(!Ext.isEmpty(i)){e(this.dom,"originalDisplay",i)}return this},mask:function(j,n){var p=this,l=p.dom,o=Ext.DomHelper,m="ext-el-mask-msg",i,q;if(!/^body/i.test(l.tagName)&&p.getStyle("position")=="static"){p.addClass(g)}if((i=e(l,"maskMsg"))){i.remove()}if((i=e(l,"mask"))){i.remove()}q=o.append(l,{cls:"ext-el-mask"},true);e(l,"mask",q);p.addClass(c);q.setDisplayed(true);if(typeof j=="string"){var k=o.append(l,{cls:m,cn:{tag:"div"}},true);e(l,"maskMsg",k);k.dom.className=n?m+" "+n:m;k.dom.firstChild.innerHTML=j;k.setDisplayed(true);k.center(p)}if(Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&p.getStyle("height")=="auto"){q.setSize(undefined,p.getHeight())}return q},unmask:function(){var k=this,l=k.dom,i=e(l,"mask"),j=e(l,"maskMsg");if(i){if(j){j.remove();e(l,"maskMsg",undefined)}i.remove();e(l,"mask",undefined)}k.removeClass([c,g])},isMasked:function(){var i=e(this.dom,"mask");return i&&i.isVisible()},createShim:function(){var i=document.createElement("iframe"),j;i.frameBorder="0";i.className="ext-shim";i.src=Ext.SSL_SECURE_URL;j=Ext.get(this.dom.parentNode.insertBefore(i,this.dom));j.autoBoxAdjust=false;return j}}}());Ext.Element.addMethods({addKeyListener:function(b,d,c){var a;if(typeof b!="object"||Ext.isArray(b)){a={key:b,fn:d,scope:c}}else{a={key:b.key,shift:b.shift,ctrl:b.ctrl,alt:b.alt,fn:d,scope:c}}return new Ext.KeyMap(this,a)},addKeyMap:function(a){return new Ext.KeyMap(this,a)}});(function(){var y=null,A=undefined,k=true,t=false,j="setX",h="setY",a="setXY",n="left",l="bottom",s="top",m="right",q="height",g="width",i="points",w="hidden",z="absolute",u="visible",e="motion",o="position",r="easeOut",d=new Ext.Element.Flyweight(),v={},x=function(B){return B||{}},p=function(B){d.dom=B;d.id=Ext.id(B);return d},c=function(B){if(!v[B]){v[B]=[]}return v[B]},b=function(C,B){v[C]=B};Ext.enableFx=k;Ext.Fx={switchStatements:function(C,D,B){return D.apply(this,B[C])},slideIn:function(H,E){E=x(E);var J=this,G=J.dom,M=G.style,O,B,L,D,C,M,I,N,K,F;H=H||"t";J.queueFx(E,function(){O=p(G).getXY();p(G).fixDisplay();B=p(G).getFxRestore();L={x:O[0],y:O[1],0:O[0],1:O[1],width:G.offsetWidth,height:G.offsetHeight};L.right=L.x+L.width;L.bottom=L.y+L.height;p(G).setWidth(L.width).setHeight(L.height);D=p(G).fxWrap(B.pos,E,w);M.visibility=u;M.position=z;function P(){p(G).fxUnwrap(D,B.pos,E);M.width=B.width;M.height=B.height;p(G).afterFx(E)}N={to:[L.x,L.y]};K={to:L.width};F={to:L.height};function Q(U,R,V,S,X,Z,ac,ab,aa,W,T){var Y={};p(U).setWidth(V).setHeight(S);if(p(U)[X]){p(U)[X](Z)}R[ac]=R[ab]="0";if(aa){Y.width=aa}if(W){Y.height=W}if(T){Y.points=T}return Y}I=p(G).switchStatements(H.toLowerCase(),Q,{t:[D,M,L.width,0,y,y,n,l,y,F,y],l:[D,M,0,L.height,y,y,m,s,K,y,y],r:[D,M,L.width,L.height,j,L.right,n,s,y,y,N],b:[D,M,L.width,L.height,h,L.bottom,n,s,y,F,N],tl:[D,M,0,0,y,y,m,l,K,F,N],bl:[D,M,0,0,h,L.y+L.height,m,s,K,F,N],br:[D,M,0,0,a,[L.right,L.bottom],n,s,K,F,N],tr:[D,M,0,0,j,L.x+L.width,n,l,K,F,N]});M.visibility=u;p(D).show();arguments.callee.anim=p(D).fxanim(I,E,e,0.5,r,P)});return J},slideOut:function(F,D){D=x(D);var H=this,E=H.dom,K=E.style,L=H.getXY(),C,B,I,J,G={to:0};F=F||"t";H.queueFx(D,function(){B=p(E).getFxRestore();I={x:L[0],y:L[1],0:L[0],1:L[1],width:E.offsetWidth,height:E.offsetHeight};I.right=I.x+I.width;I.bottom=I.y+I.height;p(E).setWidth(I.width).setHeight(I.height);C=p(E).fxWrap(B.pos,D,u);K.visibility=u;K.position=z;p(C).setWidth(I.width).setHeight(I.height);function M(){D.useDisplay?p(E).setDisplayed(t):p(E).hide();p(E).fxUnwrap(C,B.pos,D);K.width=B.width;K.height=B.height;p(E).afterFx(D)}function N(O,W,U,X,S,V,R,T,Q){var P={};O[W]=O[U]="0";P[X]=S;if(V){P[V]=R}if(T){P[T]=Q}return P}J=p(E).switchStatements(F.toLowerCase(),N,{t:[K,n,l,q,G],l:[K,m,s,g,G],r:[K,n,s,g,G,i,{to:[I.right,I.y]}],b:[K,n,s,q,G,i,{to:[I.x,I.bottom]}],tl:[K,m,l,g,G,q,G],bl:[K,m,s,g,G,q,G,i,{to:[I.x,I.bottom]}],br:[K,n,s,g,G,q,G,i,{to:[I.x+I.width,I.bottom]}],tr:[K,n,l,g,G,q,G,i,{to:[I.right,I.y]}]});arguments.callee.anim=p(C).fxanim(J,D,e,0.5,r,M)});return H},puff:function(H){H=x(H);var F=this,G=F.dom,C=G.style,D,B,E;F.queueFx(H,function(){D=p(G).getWidth();B=p(G).getHeight();p(G).clearOpacity();p(G).show();E=p(G).getFxRestore();function I(){H.useDisplay?p(G).setDisplayed(t):p(G).hide();p(G).clearOpacity();p(G).setPositioning(E.pos);C.width=E.width;C.height=E.height;C.fontSize="";p(G).afterFx(H)}arguments.callee.anim=p(G).fxanim({width:{to:p(G).adjustWidth(D*2)},height:{to:p(G).adjustHeight(B*2)},points:{by:[-D*0.5,-B*0.5]},opacity:{to:0},fontSize:{to:200,unit:"%"}},H,e,0.5,r,I)});return F},switchOff:function(F){F=x(F);var D=this,E=D.dom,B=E.style,C;D.queueFx(F,function(){p(E).clearOpacity();p(E).clip();C=p(E).getFxRestore();function G(){F.useDisplay?p(E).setDisplayed(t):p(E).hide();p(E).clearOpacity();p(E).setPositioning(C.pos);B.width=C.width;B.height=C.height;p(E).afterFx(F)}p(E).fxanim({opacity:{to:0.3}},y,y,0.1,y,function(){p(E).clearOpacity();(function(){p(E).fxanim({height:{to:1},points:{by:[0,p(E).getHeight()*0.5]}},F,e,0.3,"easeIn",G)}).defer(100)})});return D},highlight:function(D,H){H=x(H);var F=this,G=F.dom,B=H.attr||"backgroundColor",C={},E;F.queueFx(H,function(){p(G).clearOpacity();p(G).show();function I(){G.style[B]=E;p(G).afterFx(H)}E=G.style[B];C[B]={from:D||"ffff9c",to:H.endColor||p(G).getColor(B)||"ffffff"};arguments.callee.anim=p(G).fxanim(C,H,"color",1,"easeIn",I)});return F},frame:function(B,E,H){H=x(H);var D=this,G=D.dom,C,F;D.queueFx(H,function(){B=B||"#C3DAF9";if(B.length==6){B="#"+B}E=E||1;p(G).show();var L=p(G).getXY(),J={x:L[0],y:L[1],0:L[0],1:L[1],width:G.offsetWidth,height:G.offsetHeight},I=function(){C=p(document.body||document.documentElement).createChild({style:{position:z,"z-index":35000,border:"0px solid "+B}});return C.queueFx({},K)};arguments.callee.anim={isAnimated:true,stop:function(){E=0;C.stopFx()}};function K(){var M=Ext.isBorderBox?2:1;F=C.anim({top:{from:J.y,to:J.y-20},left:{from:J.x,to:J.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:J.height,to:J.height+20*M},width:{from:J.width,to:J.width+20*M}},{duration:H.duration||1,callback:function(){C.remove();--E>0?I():p(G).afterFx(H)}});arguments.callee.anim={isAnimated:true,stop:function(){F.stop()}}}I()});return D},pause:function(D){var C=this.dom,B;this.queueFx({},function(){B=setTimeout(function(){p(C).afterFx({})},D*1000);arguments.callee.anim={isAnimated:true,stop:function(){clearTimeout(B);p(C).afterFx({})}}});return this},fadeIn:function(D){D=x(D);var B=this,C=B.dom,E=D.endOpacity||1;B.queueFx(D,function(){p(C).setOpacity(0);p(C).fixDisplay();C.style.visibility=u;arguments.callee.anim=p(C).fxanim({opacity:{to:E}},D,y,0.5,r,function(){if(E==1){p(C).clearOpacity()}p(C).afterFx(D)})});return B},fadeOut:function(E){E=x(E);var C=this,D=C.dom,B=D.style,F=E.endOpacity||0;C.queueFx(E,function(){arguments.callee.anim=p(D).fxanim({opacity:{to:F}},E,y,0.5,r,function(){if(F==0){Ext.Element.data(D,"visibilityMode")==Ext.Element.DISPLAY||E.useDisplay?B.display="none":B.visibility=w;p(D).clearOpacity()}p(D).afterFx(E)})});return C},scale:function(B,C,D){this.shift(Ext.apply({},D,{width:B,height:C}));return this},shift:function(D){D=x(D);var C=this.dom,B={};this.queueFx(D,function(){for(var E in D){if(D[E]!=A){B[E]={to:D[E]}}}B.width?B.width.to=p(C).adjustWidth(D.width):B;B.height?B.height.to=p(C).adjustWidth(D.height):B;if(B.x||B.y||B.xy){B.points=B.xy||{to:[B.x?B.x.to:p(C).getX(),B.y?B.y.to:p(C).getY()]}}arguments.callee.anim=p(C).fxanim(B,D,e,0.35,r,function(){p(C).afterFx(D)})});return this},ghost:function(E,C){C=x(C);var G=this,D=G.dom,J=D.style,H={opacity:{to:0},points:{}},K=H.points,B,I,F;E=E||"b";G.queueFx(C,function(){B=p(D).getFxRestore();I=p(D).getWidth();F=p(D).getHeight();function L(){C.useDisplay?p(D).setDisplayed(t):p(D).hide();p(D).clearOpacity();p(D).setPositioning(B.pos);J.width=B.width;J.height=B.height;p(D).afterFx(C)}K.by=p(D).switchStatements(E.toLowerCase(),function(N,M){return[N,M]},{t:[0,-F],l:[-I,0],r:[I,0],b:[0,F],tl:[-I,-F],bl:[-I,F],br:[I,F],tr:[I,-F]});arguments.callee.anim=p(D).fxanim(H,C,e,0.5,r,L)});return G},syncFx:function(){var B=this;B.fxDefaults=Ext.apply(B.fxDefaults||{},{block:t,concurrent:k,stopFx:t});return B},sequenceFx:function(){var B=this;B.fxDefaults=Ext.apply(B.fxDefaults||{},{block:t,concurrent:t,stopFx:t});return B},nextFx:function(){var B=c(this.dom.id)[0];if(B){B.call(this)}},hasActiveFx:function(){return c(this.dom.id)[0]},stopFx:function(B){var C=this,E=C.dom.id;if(C.hasActiveFx()){var D=c(E)[0];if(D&&D.anim){if(D.anim.isAnimated){b(E,[D]);D.anim.stop(B!==undefined?B:k)}else{b(E,[])}}}return C},beforeFx:function(B){if(this.hasActiveFx()&&!B.concurrent){if(B.stopFx){this.stopFx();return k}return t}return k},hasFxBlock:function(){var B=c(this.dom.id);return B&&B[0]&&B[0].block},queueFx:function(E,B){var C=p(this.dom);if(!C.hasFxBlock()){Ext.applyIf(E,C.fxDefaults);if(!E.concurrent){var D=C.beforeFx(E);B.block=E.block;c(C.dom.id).push(B);if(D){C.nextFx()}}else{B.call(C)}}return C},fxWrap:function(H,F,D){var E=this.dom,C,B;if(!F.wrap||!(C=Ext.getDom(F.wrap))){if(F.fixPosition){B=p(E).getXY()}var G=document.createElement("div");G.style.visibility=D;C=E.parentNode.insertBefore(G,E);p(C).setPositioning(H);if(p(C).isStyle(o,"static")){p(C).position("relative")}p(E).clearPositioning("auto");p(C).clip();C.appendChild(E);if(B){p(C).setXY(B)}}return C},fxUnwrap:function(C,F,E){var D=this.dom;p(D).clearPositioning();p(D).setPositioning(F);if(!E.wrap){var B=p(C).dom.parentNode;B.insertBefore(D,C);p(C).remove()}},getFxRestore:function(){var B=this.dom.style;return{pos:this.getPositioning(),width:B.width,height:B.height}},afterFx:function(C){var B=this.dom,D=B.id;if(C.afterStyle){p(B).setStyle(C.afterStyle)}if(C.afterCls){p(B).addClass(C.afterCls)}if(C.remove==k){p(B).remove()}if(C.callback){C.callback.call(C.scope,p(B))}if(!C.concurrent){c(D).shift();p(B).nextFx()}},fxanim:function(E,F,C,G,D,B){C=C||"run";F=F||{};var H=Ext.lib.Anim[C](this.dom,E,(F.duration||G)||0.35,(F.easing||D)||r,B,this);F.anim=H;return H}};Ext.Fx.resize=Ext.Fx.scale;Ext.Element.addMethods(Ext.Fx)})();Ext.CompositeElementLite=function(b,a){this.elements=[];this.add(b,a);this.el=new Ext.Element.Flyweight()};Ext.CompositeElementLite.prototype={isComposite:true,getElement:function(a){var b=this.el;b.dom=a;b.id=a.id;return b},transformElement:function(a){return Ext.getDom(a)},getCount:function(){return this.elements.length},add:function(d,b){var e=this,g=e.elements;if(!d){return this}if(typeof d=="string"){d=Ext.Element.selectorFunction(d,b)}else{if(d.isComposite){d=d.elements}else{if(!Ext.isIterable(d)){d=[d]}}}for(var c=0,a=d.length;c-1){c=Ext.getDom(c);if(a){g=this.elements[b];g.parentNode.insertBefore(c,g);Ext.removeNode(g)}this.elements.splice(b,1,c)}return this},clear:function(){this.elements=[]}};Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener;(function(){var c,b=Ext.Element.prototype,a=Ext.CompositeElementLite.prototype;for(c in b){if(Ext.isFunction(b[c])){(function(d){a[d]=a[d]||function(){return this.invoke(d,arguments)}}).call(a,c)}}})();if(Ext.DomQuery){Ext.Element.selectorFunction=Ext.DomQuery.select}Ext.Element.select=function(a,b){var c;if(typeof a=="string"){c=Ext.Element.selectorFunction(a,b)}else{if(a.length!==undefined){c=a}else{throw"Invalid selector"}}return new Ext.CompositeElementLite(c)};Ext.select=Ext.Element.select;Ext.apply(Ext.CompositeElementLite.prototype,{addElements:function(c,a){if(!c){return this}if(typeof c=="string"){c=Ext.Element.selectorFunction(c,a)}var b=this.elements;Ext.each(c,function(d){b.push(Ext.get(d))});return this},first:function(){return this.item(0)},last:function(){return this.item(this.getCount()-1)},contains:function(a){return this.indexOf(a)!=-1},removeElement:function(d,e){var c=this,a=this.elements,b;Ext.each(d,function(g){if((b=(a[g]||a[g=c.indexOf(g)]))){if(e){if(b.dom){b.remove()}else{Ext.removeNode(b)}}a.splice(g,1)}});return this}});Ext.CompositeElement=Ext.extend(Ext.CompositeElementLite,{constructor:function(b,a){this.elements=[];this.add(b,a)},getElement:function(a){return a},transformElement:function(a){return Ext.get(a)}});Ext.Element.select=function(a,d,b){var c;if(typeof a=="string"){c=Ext.Element.selectorFunction(a,b)}else{if(a.length!==undefined){c=a}else{throw"Invalid selector"}}return(d===true)?new Ext.CompositeElement(c):new Ext.CompositeElementLite(c)};Ext.select=Ext.Element.select;(function(){var b="beforerequest",e="requestcomplete",d="requestexception",h=undefined,c="load",i="POST",a="GET",g=window;Ext.data.Connection=function(j){Ext.apply(this,j);this.addEvents(b,e,d);Ext.data.Connection.superclass.constructor.call(this)};Ext.extend(Ext.data.Connection,Ext.util.Observable,{timeout:30000,autoAbort:false,disableCaching:true,disableCachingParam:"_dc",request:function(n){var s=this;if(s.fireEvent(b,s,n)){if(n.el){if(!Ext.isEmpty(n.indicatorText)){s.indicatorText='
    '+n.indicatorText+"
    "}if(s.indicatorText){Ext.getDom(n.el).innerHTML=s.indicatorText}n.success=(Ext.isFunction(n.success)?n.success:function(){}).createInterceptor(function(o){Ext.getDom(n.el).innerHTML=o.responseText})}var l=n.params,k=n.url||s.url,j,q={success:s.handleResponse,failure:s.handleFailure,scope:s,argument:{options:n},timeout:n.timeout||s.timeout},m,t;if(Ext.isFunction(l)){l=l.call(n.scope||g,n)}l=Ext.urlEncode(s.extraParams,Ext.isObject(l)?Ext.urlEncode(l):l);if(Ext.isFunction(k)){k=k.call(n.scope||g,n)}if((m=Ext.getDom(n.form))){k=k||m.action;if(n.isUpload||/multipart\/form-data/i.test(m.getAttribute("enctype"))){return s.doFormUpload.call(s,n,l,k)}t=Ext.lib.Ajax.serializeForm(m);l=l?(l+"&"+t):t}j=n.method||s.method||((l||n.xmlData||n.jsonData)?i:a);if(j===a&&(s.disableCaching&&n.disableCaching!==false)||n.disableCaching===true){var r=n.disableCachingParam||s.disableCachingParam;k=Ext.urlAppend(k,r+"="+(new Date().getTime()))}n.headers=Ext.apply(n.headers||{},s.defaultHeaders||{});if(n.autoAbort===true||s.autoAbort){s.abort()}if((j==a||n.xmlData||n.jsonData)&&l){k=Ext.urlAppend(k,l);l=""}return(s.transId=Ext.lib.Ajax.request(j,k,q,l,n))}else{return n.callback?n.callback.apply(n.scope,[n,h,h]):null}},isLoading:function(j){return j?Ext.lib.Ajax.isCallInProgress(j):!!this.transId},abort:function(j){if(j||this.isLoading()){Ext.lib.Ajax.abort(j||this.transId)}},handleResponse:function(j){this.transId=false;var k=j.argument.options;j.argument=k?k.argument:null;this.fireEvent(e,this,j,k);if(k.success){k.success.call(k.scope,j,k)}if(k.callback){k.callback.call(k.scope,k,true,j)}},handleFailure:function(j,l){this.transId=false;var k=j.argument.options;j.argument=k?k.argument:null;this.fireEvent(d,this,j,k,l);if(k.failure){k.failure.call(k.scope,j,k)}if(k.callback){k.callback.call(k.scope,k,false,j)}},doFormUpload:function(q,j,k){var l=Ext.id(),v=document,r=v.createElement("iframe"),m=Ext.getDom(q.form),u=[],t,p="multipart/form-data",n={target:m.target,method:m.method,encoding:m.encoding,enctype:m.enctype,action:m.action};Ext.fly(r).set({id:l,name:l,cls:"x-hidden",src:Ext.SSL_SECURE_URL});v.body.appendChild(r);if(Ext.isIE){document.frames[l].name=l}Ext.fly(m).set({target:l,method:i,enctype:p,encoding:p,action:k||n.action});Ext.iterate(Ext.urlDecode(j,false),function(w,o){t=v.createElement("input");Ext.fly(t).set({type:"hidden",value:o,name:w});m.appendChild(t);u.push(t)});function s(){var x=this,w={responseText:"",responseXML:null,argument:q.argument},A,z;try{A=r.contentWindow.document||r.contentDocument||g.frames[l].document;if(A){if(A.body){if(/textarea/i.test((z=A.body.firstChild||{}).tagName)){w.responseText=z.value}else{w.responseText=A.body.innerHTML}}w.responseXML=A.XMLDocument||A}}catch(y){}Ext.EventManager.removeListener(r,c,s,x);x.fireEvent(e,x,w,q);function o(D,C,B){if(Ext.isFunction(D)){D.apply(C,B)}}o(q.success,q.scope,[w,q]);o(q.callback,q.scope,[q,true,w]);if(!x.debugUploads){setTimeout(function(){Ext.removeNode(r)},100)}}Ext.EventManager.on(r,c,s,this);m.submit();Ext.fly(m).set(n);Ext.each(u,function(o){Ext.removeNode(o)})}})})();Ext.Ajax=new Ext.data.Connection({autoAbort:false,serializeForm:function(a){return Ext.lib.Ajax.serializeForm(a)}});Ext.UpdateManager=Ext.Updater=Ext.extend(Ext.util.Observable,function(){var b="beforeupdate",d="update",c="failure";function a(h){var i=this;i.transaction=null;if(h.argument.form&&h.argument.reset){try{h.argument.form.reset()}catch(j){}}if(i.loadScripts){i.renderer.render(i.el,h,i,g.createDelegate(i,[h]))}else{i.renderer.render(i.el,h,i);g.call(i,h)}}function g(h,i,j){this.fireEvent(i||d,this.el,h);if(Ext.isFunction(h.argument.callback)){h.argument.callback.call(h.argument.scope,this.el,Ext.isEmpty(j)?true:false,h,h.argument.options)}}function e(h){g.call(this,h,c,!!(this.transaction=null))}return{constructor:function(i,h){var j=this;i=Ext.get(i);if(!h&&i.updateManager){return i.updateManager}j.el=i;j.defaultUrl=null;j.addEvents(b,d,c);Ext.apply(j,Ext.Updater.defaults);j.transaction=null;j.refreshDelegate=j.refresh.createDelegate(j);j.updateDelegate=j.update.createDelegate(j);j.formUpdateDelegate=(j.formUpdate||function(){}).createDelegate(j);j.renderer=j.renderer||j.getDefaultRenderer();Ext.Updater.superclass.constructor.call(j)},setRenderer:function(h){this.renderer=h},getRenderer:function(){return this.renderer},getDefaultRenderer:function(){return new Ext.Updater.BasicRenderer()},setDefaultUrl:function(h){this.defaultUrl=h},getEl:function(){return this.el},update:function(i,n,p,l){var k=this,h,j;if(k.fireEvent(b,k.el,i,n)!==false){if(Ext.isObject(i)){h=i;i=h.url;n=n||h.params;p=p||h.callback;l=l||h.discardUrl;j=h.scope;if(!Ext.isEmpty(h.nocache)){k.disableCaching=h.nocache}if(!Ext.isEmpty(h.text)){k.indicatorText='
    '+h.text+"
    "}if(!Ext.isEmpty(h.scripts)){k.loadScripts=h.scripts}if(!Ext.isEmpty(h.timeout)){k.timeout=h.timeout}}k.showLoading();if(!l){k.defaultUrl=i}if(Ext.isFunction(i)){i=i.call(k)}var m=Ext.apply({},{url:i,params:(Ext.isFunction(n)&&j)?n.createDelegate(j):n,success:a,failure:e,scope:k,callback:undefined,timeout:(k.timeout*1000),disableCaching:k.disableCaching,argument:{options:h,url:i,form:null,callback:p,scope:j||window,params:n}},h);k.transaction=Ext.Ajax.request(m)}},formUpdate:function(k,h,j,l){var i=this;if(i.fireEvent(b,i.el,k,h)!==false){if(Ext.isFunction(h)){h=h.call(i)}k=Ext.getDom(k);i.transaction=Ext.Ajax.request({form:k,url:h,success:a,failure:e,scope:i,timeout:(i.timeout*1000),argument:{url:h,form:k,callback:l,reset:j}});i.showLoading.defer(1,i)}},startAutoRefresh:function(i,j,l,m,h){var k=this;if(h){k.update(j||k.defaultUrl,l,m,true)}if(k.autoRefreshProcId){clearInterval(k.autoRefreshProcId)}k.autoRefreshProcId=setInterval(k.update.createDelegate(k,[j||k.defaultUrl,l,m,true]),i*1000)},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);delete this.autoRefreshProcId}},isAutoRefreshing:function(){return !!this.autoRefreshProcId},showLoading:function(){if(this.showLoadIndicator){this.el.dom.innerHTML=this.indicatorText}},abort:function(){if(this.transaction){Ext.Ajax.abort(this.transaction)}},isUpdating:function(){return this.transaction?Ext.Ajax.isLoading(this.transaction):false},refresh:function(h){if(this.defaultUrl){this.update(this.defaultUrl,null,h,true)}}}}());Ext.Updater.defaults={timeout:30,disableCaching:false,showLoadIndicator:true,indicatorText:'
    Loading...
    ',loadScripts:false,sslBlankUrl:Ext.SSL_SECURE_URL};Ext.Updater.updateElement=function(d,c,e,b){var a=Ext.get(d).getUpdater();Ext.apply(a,b);a.update(c,e,b?b.callback:null)};Ext.Updater.BasicRenderer=function(){};Ext.Updater.BasicRenderer.prototype={render:function(c,a,b,d){c.update(a.responseText,b.loadScripts,d)}};(function(){Date.useStrict=false;function b(d){var c=Array.prototype.slice.call(arguments,1);return d.replace(/\{(\d+)\}/g,function(e,g){return c[g]})}Date.formatCodeToRegex=function(d,c){var e=Date.parseCodes[d];if(e){e=typeof e=="function"?e():e;Date.parseCodes[d]=e}return e?Ext.applyIf({c:e.c?b(e.c,c||"{0}"):e.c},e):{g:0,c:null,s:Ext.escapeRe(d)}};var a=Date.formatCodeToRegex;Ext.apply(Date,{parseFunctions:{"M$":function(d,c){var e=new RegExp("\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/");var g=(d||"").match(e);return g?new Date(((g[1]||"")+g[2])*1):null}},parseRegexes:[],formatFunctions:{"M$":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},getShortMonthName:function(c){return Date.monthNames[c].substring(0,3)},getShortDayName:function(c){return Date.dayNames[c].substring(0,3)},getMonthNumber:function(c){return Date.monthNumbers[c.substring(0,1).toUpperCase()+c.substring(1,3).toLowerCase()]},formatCodes:{d:"String.leftPad(this.getDate(), 2, '0')",D:"Date.getShortDayName(this.getDay())",j:"this.getDate()",l:"Date.dayNames[this.getDay()]",N:"(this.getDay() ? this.getDay() : 7)",S:"this.getSuffix()",w:"this.getDay()",z:"this.getDayOfYear()",W:"String.leftPad(this.getWeekOfYear(), 2, '0')",F:"Date.monthNames[this.getMonth()]",m:"String.leftPad(this.getMonth() + 1, 2, '0')",M:"Date.getShortMonthName(this.getMonth())",n:"(this.getMonth() + 1)",t:"this.getDaysInMonth()",L:"(this.isLeapYear() ? 1 : 0)",o:"(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))",Y:"this.getFullYear()",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:"String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",H:"String.leftPad(this.getHours(), 2, '0')",i:"String.leftPad(this.getMinutes(), 2, '0')",s:"String.leftPad(this.getSeconds(), 2, '0')",u:"String.leftPad(this.getMilliseconds(), 3, '0')",O:"this.getGMTOffset()",P:"this.getGMTOffset(true)",T:"this.getTimezone()",Z:"(this.getTimezoneOffset() * -60)",c:function(){for(var k="Y-m-dTH:i:sP",h=[],g=0,d=k.length;g= 0 && y >= 0){","v = new Date(y, 0, 1, h, i, s, ms);","v = !strict? v : (strict === true && (z <= 364 || (v.isLeapYear() && z <= 365))? v.add(Date.DAY, z) : null);","}else if(strict === true && !Date.isValid(y, m + 1, d, h, i, s, ms)){","v = null;","}else{","v = new Date(y, m, d, h, i, s, ms);","}","}","}","if(v){","if(zz != null){","v = v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - zz);","}else if(o){","v = v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));","}","}","return v;"].join("\n");return function(m){var e=Date.parseRegexes.length,n=1,g=[],l=[],k=false,d="";for(var j=0;j Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"},a:{g:1,c:"if (results[{0}] == 'am') {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(am|pm)"},A:{g:1,c:"if (results[{0}] == 'AM') {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(AM|PM)"},g:function(){return a("G")},G:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},h:function(){return a("H")},H:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},i:{g:1,c:"i = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},s:{g:1,c:"s = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},u:{g:1,c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",s:"(\\d+)"},O:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),","mn = o.substring(3,5) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{4})"},P:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),","mn = o.substring(4,6) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{2}:\\d{2})"},T:{g:0,c:null,s:"[A-Z]{1,4}"},Z:{g:1,c:"zz = results[{0}] * 1;\nzz = (-43200 <= zz && zz <= 50400)? zz : null;\n",s:"([+-]?\\d{1,5})"},c:function(){var e=[],c=[a("Y",1),a("m",2),a("d",3),a("h",4),a("i",5),a("s",6),{c:"ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"},{c:["if(results[8]) {","if(results[8] == 'Z'){","zz = 0;","}else if (results[8].indexOf(':') > -1){",a("P",8).c,"}else{",a("O",8).c,"}","}"].join("\n")}];for(var g=0,d=c.length;g0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+(a?":":"")+String.leftPad(Math.abs(this.getTimezoneOffset()%60),2,"0")},getDayOfYear:function(){var b=0,e=this.clone(),a=this.getMonth(),c;for(c=0,e.setDate(1),e.setMonth(0);c28){a=Math.min(a,this.getFirstDateOfMonth().add("mo",c).getLastDateOfMonth().getDate())}e.setDate(a);e.setMonth(this.getMonth()+c);break;case Date.YEAR:e.setFullYear(this.getFullYear()+c);break}return e},between:function(c,a){var b=this.getTime();return c.getTime()<=b&&b<=a.getTime()}});Date.prototype.format=Date.prototype.dateFormat;if(Ext.isSafari&&(navigator.userAgent.match(/WebKit\/(\d+)/)[1]||NaN)<420){Ext.apply(Date.prototype,{_xMonth:Date.prototype.setMonth,_xDate:Date.prototype.setDate,setMonth:function(a){if(a<=-1){var d=Math.ceil(-a),c=Math.ceil(d/12),b=(d%12)?12-d%12:0;this.setFullYear(this.getFullYear()-c);return this._xMonth(b)}else{return this._xMonth(a)}},setDate:function(a){return this.setTime(this.getTime()-(this.getDate()-a)*86400000)}})}Ext.util.MixedCollection=function(b,a){this.items=[];this.map={};this.keys=[];this.length=0;this.addEvents("clear","add","replace","remove","sort");this.allowFunctions=b===true;if(a){this.getKey=a}Ext.util.MixedCollection.superclass.constructor.call(this)};Ext.extend(Ext.util.MixedCollection,Ext.util.Observable,{allowFunctions:false,add:function(b,c){if(arguments.length==1){c=arguments[0];b=this.getKey(c)}if(typeof b!="undefined"&&b!==null){var a=this.map[b];if(typeof a!="undefined"){return this.replace(b,c)}this.map[b]=c}this.length++;this.items.push(c);this.keys.push(b);this.fireEvent("add",this.length-1,c,b);return c},getKey:function(a){return a.id},replace:function(c,d){if(arguments.length==1){d=arguments[0];c=this.getKey(d)}var a=this.map[c];if(typeof c=="undefined"||c===null||typeof a=="undefined"){return this.add(c,d)}var b=this.indexOfKey(c);this.items[b]=d;this.map[c]=d;this.fireEvent("replace",c,a,d);return d},addAll:function(e){if(arguments.length>1||Ext.isArray(e)){var b=arguments.length>1?arguments:e;for(var d=0,a=b.length;d=this.length){return this.add(b,c)}this.length++;this.items.splice(a,0,c);if(typeof b!="undefined"&&b!==null){this.map[b]=c}this.keys.splice(a,0,b);this.fireEvent("add",a,c,b);return c},remove:function(a){return this.removeAt(this.indexOf(a))},removeAt:function(a){if(a=0){this.length--;var c=this.items[a];this.items.splice(a,1);var b=this.keys[a];if(typeof b!="undefined"){delete this.map[b]}this.keys.splice(a,1);this.fireEvent("remove",c,b);return c}return false},removeKey:function(a){return this.removeAt(this.indexOfKey(a))},getCount:function(){return this.length},indexOf:function(a){return this.items.indexOf(a)},indexOfKey:function(a){return this.keys.indexOf(a)},item:function(b){var a=this.map[b],c=a!==undefined?a:(typeof b=="number")?this.items[b]:undefined;return typeof c!="function"||this.allowFunctions?c:null},itemAt:function(a){return this.items[a]},key:function(a){return this.map[a]},contains:function(a){return this.indexOf(a)!=-1},containsKey:function(a){return typeof this.map[a]!="undefined"},clear:function(){this.length=0;this.items=[];this.keys=[];this.map={};this.fireEvent("clear")},first:function(){return this.items[0]},last:function(){return this.items[this.length-1]},_sort:function(k,a,j){var d,e,b=String(a).toUpperCase()=="DESC"?-1:1,h=[],l=this.keys,g=this.items;j=j||function(i,c){return i-c};for(d=0,e=g.length;de?1:(g=a;c--){d[d.length]=b[c]}}return d},filter:function(c,b,d,a){if(Ext.isEmpty(b,false)){return this.clone()}b=this.createValueMatcher(b,d,a);return this.filterBy(function(e){return e&&b.test(e[c])})},filterBy:function(g,e){var h=new Ext.util.MixedCollection();h.getKey=this.getKey;var b=this.keys,d=this.items;for(var c=0,a=d.length;c]+>/gi,stripScriptsRe=/(?:)((\n|\r|.)*?)(?:<\/script>)/ig,nl2brRe=/\r?\n/g;return{ellipsis:function(value,len,word){if(value&&value.length>len){if(word){var vs=value.substr(0,len-2),index=Math.max(vs.lastIndexOf(" "),vs.lastIndexOf("."),vs.lastIndexOf("!"),vs.lastIndexOf("?"));if(index==-1||index<(len-15)){return value.substr(0,len-3)+"..."}else{return vs.substr(0,index)+"..."}}else{return value.substr(0,len-3)+"..."}}return value},undef:function(value){return value!==undefined?value:""},defaultValue:function(value,defaultValue){return value!==undefined&&value!==""?value:defaultValue},htmlEncode:function(value){return !value?value:String(value).replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&")},trim:function(value){return String(value).replace(trimRe,"")},substr:function(value,start,length){return String(value).substr(start,length)},lowercase:function(value){return String(value).toLowerCase()},uppercase:function(value){return String(value).toUpperCase()},capitalize:function(value){return !value?value:value.charAt(0).toUpperCase()+value.substr(1).toLowerCase()},call:function(value,fn){if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);args.unshift(value);return eval(fn).apply(window,args)}else{return eval(fn).call(window,value)}},usMoney:function(v){v=(Math.round((v-0)*100))/100;v=(v==Math.floor(v))?v+".00":((v*10==Math.floor(v*10))?v+"0":v);v=String(v);var ps=v.split("."),whole=ps[0],sub=ps[1]?"."+ps[1]:".00",r=/(\d+)(\d{3})/;while(r.test(whole)){whole=whole.replace(r,"$1,$2")}v=whole+sub;if(v.charAt(0)=="-"){return"-$"+v.substr(1)}return"$"+v},date:function(v,format){if(!v){return""}if(!Ext.isDate(v)){v=new Date(Date.parse(v))}return v.dateFormat(format||"m/d/Y")},dateRenderer:function(format){return function(v){return Ext.util.Format.date(v,format)}},stripTags:function(v){return !v?v:String(v).replace(stripTagsRE,"")},stripScripts:function(v){return !v?v:String(v).replace(stripScriptsRe,"")},fileSize:function(size){if(size<1024){return size+" bytes"}else{if(size<1048576){return(Math.round(((size*10)/1024))/10)+" KB"}else{return(Math.round(((size*10)/1048576))/10)+" MB"}}},math:function(){var fns={};return function(v,a){if(!fns[a]){fns[a]=new Function("v","return v "+a+";")}return fns[a](v)}}(),round:function(value,precision){var result=Number(value);if(typeof precision=="number"){precision=Math.pow(10,precision);result=Math.round(value*precision)/precision}return result},number:function(v,format){if(!format){return v}v=Ext.num(v,NaN);if(isNaN(v)){return""}var comma=",",dec=".",i18n=false,neg=v<0;v=Math.abs(v);if(format.substr(format.length-2)=="/i"){format=format.substr(0,format.length-2);i18n=true;comma=".";dec=","}var hasComma=format.indexOf(comma)!=-1,psplit=(i18n?format.replace(/[^\d\,]/g,""):format.replace(/[^\d\.]/g,"")).split(dec);if(1")}}}();Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var y=this,j=y.html,q=/]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,d=/^]*?for="(.*?)"/,v=/^]*?if="(.*?)"/,x=/^]*?exec="(.*?)"/,r,p=0,k=[],o="values",w="parent",l="xindex",n="xcount",e="return ",c="with(values){ ";j=["",j,""].join("");while((r=j.match(q))){var b=r[0].match(d),a=r[0].match(v),A=r[0].match(x),g=null,h=null,t=null,z=b&&b[1]?b[1]:"";if(a){g=a&&a[1]?a[1]:null;if(g){h=new Function(o,w,l,n,c+e+(Ext.util.Format.htmlDecode(g))+"; }")}}if(A){g=A&&A[1]?A[1]:null;if(g){t=new Function(o,w,l,n,c+(Ext.util.Format.htmlDecode(g))+"; }")}}if(z){switch(z){case".":z=new Function(o,w,c+e+o+"; }");break;case"..":z=new Function(o,w,c+e+w+"; }");break;default:z=new Function(o,w,c+e+z+"; }")}}k.push({id:p,target:z,exec:t,test:h,body:r[1]||""});j=j.replace(r[0],"{xtpl"+p+"}");++p}for(var u=k.length-1;u>=0;--u){y.compileTpl(k[u])}y.master=k[k.length-1];y.tpls=k};Ext.extend(Ext.XTemplate,Ext.Template,{re:/\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,codeRe:/\{\[((?:\\\]|.|\n)*?)\]\}/g,applySubTemplate:function(a,k,j,d,c){var h=this,g,m=h.tpls[a],l,b=[];if((m.test&&!m.test.call(h,k,j,d,c))||(m.exec&&m.exec.call(h,k,j,d,c))){return""}l=m.target?m.target.call(h,k,j):k;g=l.length;j=m.target?k:j;if(m.target&&Ext.isArray(l)){for(var e=0,g=l.length;e=0;--g){d[k[g].selectorText.toLowerCase()]=k[g]}}catch(i){}},getRules:function(h){if(d===null||h){d={};var k=c.styleSheets;for(var j=0,g=k.length;j=37&&a<=40){b.stopEvent()}},destroy:function(){this.disable()},enable:function(){if(this.disabled){if(Ext.isSafari2){this.el.on("keyup",this.stopKeyUp,this)}this.el.on(this.isKeydown()?"keydown":"keypress",this.relay,this);this.disabled=false}},disable:function(){if(!this.disabled){if(Ext.isSafari2){this.el.un("keyup",this.stopKeyUp,this)}this.el.un(this.isKeydown()?"keydown":"keypress",this.relay,this);this.disabled=true}},setDisabled:function(a){this[a?"disable":"enable"]()},isKeydown:function(){return this.forceKeyDown||Ext.EventManager.useKeydown}};Ext.KeyMap=function(c,b,a){this.el=Ext.get(c);this.eventName=a||"keydown";this.bindings=[];if(b){this.addBinding(b)}this.enable()};Ext.KeyMap.prototype={stopEvent:false,addBinding:function(b){if(Ext.isArray(b)){Ext.each(b,function(j){this.addBinding(j)},this);return}var k=b.key,g=b.fn||b.handler,l=b.scope;if(b.stopEvent){this.stopEvent=b.stopEvent}if(typeof k=="string"){var h=[];var e=k.toUpperCase();for(var c=0,d=e.length;c2)?a[2]:null;var h=(i>3)?a[3]:"/";var d=(i>4)?a[4]:null;var g=(i>5)?a[5]:false;document.cookie=c+"="+escape(e)+((b===null)?"":("; expires="+b.toGMTString()))+((h===null)?"":("; path="+h))+((d===null)?"":("; domain="+d))+((g===true)?"; secure":"")},get:function(d){var b=d+"=";var g=b.length;var a=document.cookie.length;var e=0;var c=0;while(e0){return this.ownerCt.items.itemAt(a-1)}}return null},getBubbleTarget:function(){return this.ownerCt}});Ext.reg("component",Ext.Component);Ext.Action=Ext.extend(Object,{constructor:function(a){this.initialConfig=a;this.itemId=a.itemId=(a.itemId||a.id||Ext.id());this.items=[]},isAction:true,setText:function(a){this.initialConfig.text=a;this.callEach("setText",[a])},getText:function(){return this.initialConfig.text},setIconClass:function(a){this.initialConfig.iconCls=a;this.callEach("setIconClass",[a])},getIconClass:function(){return this.initialConfig.iconCls},setDisabled:function(a){this.initialConfig.disabled=a;this.callEach("setDisabled",[a])},enable:function(){this.setDisabled(false)},disable:function(){this.setDisabled(true)},isDisabled:function(){return this.initialConfig.disabled},setHidden:function(a){this.initialConfig.hidden=a;this.callEach("setVisible",[!a])},show:function(){this.setHidden(false)},hide:function(){this.setHidden(true)},isHidden:function(){return this.initialConfig.hidden},setHandler:function(b,a){this.initialConfig.handler=b;this.initialConfig.scope=a;this.callEach("setHandler",[b,a])},each:function(b,a){Ext.each(this.items,b,a)},callEach:function(e,b){var d=this.items;for(var c=0,a=d.length;cj+o.left){k=j-l-c;g=true}if((i+e)>d+o.top){i=d-e-c;g=true}if(k=m){i=m-e-5}}n=[k,i];this.storeXY(n);a.setXY.call(this,n);this.sync()}}return this},isVisible:function(){return this.visible},showAction:function(){this.visible=true;if(this.useDisplay===true){this.setDisplayed("")}else{if(this.lastXY){a.setXY.call(this,this.lastXY)}else{if(this.lastLT){a.setLeftTop.call(this,this.lastLT[0],this.lastLT[1])}}}},hideAction:function(){this.visible=false;if(this.useDisplay===true){this.setDisplayed(false)}else{this.setLeftTop(-10000,-10000)}},setVisible:function(i,h,k,l,j){if(i){this.showAction()}if(h&&i){var g=function(){this.sync(true);if(l){l()}}.createDelegate(this);a.setVisible.call(this,true,true,k,g,j)}else{if(!i){this.hideUnders(true)}var g=l;if(h){g=function(){this.hideAction();if(l){l()}}.createDelegate(this)}a.setVisible.call(this,i,h,k,g,j);if(i){this.sync(true)}else{if(!h){this.hideAction()}}}return this},storeXY:function(c){delete this.lastLT;this.lastXY=c},storeLeftTop:function(d,c){delete this.lastXY;this.lastLT=[d,c]},beforeFx:function(){this.beforeAction();return Ext.Layer.superclass.beforeFx.apply(this,arguments)},afterFx:function(){Ext.Layer.superclass.afterFx.apply(this,arguments);this.sync(this.isVisible())},beforeAction:function(){if(!this.updating&&this.shadow){this.shadow.hide()}},setLeft:function(c){this.storeLeftTop(c,this.getTop(true));a.setLeft.apply(this,arguments);this.sync();return this},setTop:function(c){this.storeLeftTop(this.getLeft(true),c);a.setTop.apply(this,arguments);this.sync();return this},setLeftTop:function(d,c){this.storeLeftTop(d,c);a.setLeftTop.apply(this,arguments);this.sync();return this},setXY:function(j,h,k,l,i){this.fixDisplay();this.beforeAction();this.storeXY(j);var g=this.createCB(l);a.setXY.call(this,j,h,k,g,i);if(!h){g()}return this},createCB:function(e){var d=this;return function(){d.constrainXY();d.sync(true);if(e){e()}}},setX:function(g,h,j,k,i){this.setXY([g,this.getY()],h,j,k,i);return this},setY:function(k,g,i,j,h){this.setXY([this.getX(),k],g,i,j,h);return this},setSize:function(j,k,i,m,n,l){this.beforeAction();var g=this.createCB(n);a.setSize.call(this,j,k,i,m,g,l);if(!i){g()}return this},setWidth:function(i,h,k,l,j){this.beforeAction();var g=this.createCB(l);a.setWidth.call(this,i,h,k,g,j);if(!h){g()}return this},setHeight:function(j,i,l,m,k){this.beforeAction();var g=this.createCB(m);a.setHeight.call(this,j,i,l,g,k);if(!i){g()}return this},setBounds:function(o,m,p,i,n,k,l,j){this.beforeAction();var g=this.createCB(l);if(!n){this.storeXY([o,m]);a.setXY.call(this,[o,m]);a.setSize.call(this,p,i,n,k,g,j);g()}else{a.setBounds.call(this,o,m,p,i,n,k,g,j)}return this},setZIndex:function(c){this.zindex=c;this.setStyle("z-index",c+2);if(this.shadow){this.shadow.setZIndex(c+1)}if(this.shim){this.shim.setStyle("z-index",c)}return this}})})();Ext.Shadow=function(d){Ext.apply(this,d);if(typeof this.mode!="string"){this.mode=this.defaultMode}var e=this.offset,c={h:0};var b=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case"drop":c.w=0;c.l=c.t=e;c.t-=1;if(Ext.isIE){c.l-=this.offset+b;c.t-=this.offset+b;c.w-=b;c.h-=b;c.t+=1}break;case"sides":c.w=(e*2);c.l=-e;c.t=e-1;if(Ext.isIE){c.l-=(this.offset-b);c.t-=this.offset+b;c.l+=1;c.w-=(this.offset-b)*2;c.w-=b+1;c.h-=1}break;case"frame":c.w=c.h=(e*2);c.l=c.t=-e;c.t+=1;c.h-=2;if(Ext.isIE){c.l-=(this.offset-b);c.t-=(this.offset-b);c.l+=1;c.w-=(this.offset+b+1);c.h-=(this.offset+b);c.h+=1}break}this.adjusts=c};Ext.Shadow.prototype={offset:4,defaultMode:"drop",show:function(a){a=Ext.get(a);if(!this.el){this.el=Ext.Shadow.Pool.pull();if(this.el.dom.nextSibling!=a.dom){this.el.insertBefore(a)}}this.el.setStyle("z-index",this.zIndex||parseInt(a.getStyle("z-index"),10)-1);if(Ext.isIE){this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")"}this.realign(a.getLeft(true),a.getTop(true),a.getWidth(),a.getHeight());this.el.dom.style.display="block"},isVisible:function(){return this.el?true:false},realign:function(b,r,q,g){if(!this.el){return}var n=this.adjusts,k=this.el.dom,u=k.style;var i=0;u.left=(b+n.l)+"px";u.top=(r+n.t)+"px";var p=(q+n.w),e=(g+n.h),j=p+"px",o=e+"px";if(u.width!=j||u.height!=o){u.width=j;u.height=o;if(!Ext.isIE){var m=k.childNodes;var c=Math.max(0,(p-12))+"px";m[0].childNodes[1].style.width=c;m[1].childNodes[1].style.width=c;m[2].childNodes[1].style.width=c;m[1].style.height=Math.max(0,(e-12))+"px"}}},hide:function(){if(this.el){this.el.dom.style.display="none";Ext.Shadow.Pool.push(this.el);delete this.el}},setZIndex:function(a){this.zIndex=a;if(this.el){this.el.setStyle("z-index",a)}}};Ext.Shadow.Pool=function(){var b=[];var a=Ext.isIE?'
    ':'
    ';return{pull:function(){var c=b.shift();if(!c){c=Ext.get(Ext.DomHelper.insertHtml("beforeBegin",document.body.firstChild,a));c.autoBoxAdjust=false}return c},push:function(c){b.push(c)}}}();Ext.BoxComponent=Ext.extend(Ext.Component,{initComponent:function(){Ext.BoxComponent.superclass.initComponent.call(this);this.addEvents("resize","move")},boxReady:false,deferHeight:false,setSize:function(b,d){if(typeof b=="object"){d=b.height;b=b.width}if(Ext.isDefined(b)&&Ext.isDefined(this.boxMinWidth)&&(bthis.boxMaxWidth)){b=this.boxMaxWidth}if(Ext.isDefined(d)&&Ext.isDefined(this.boxMaxHeight)&&(d>this.boxMaxHeight)){d=this.boxMaxHeight}if(!this.boxReady){this.width=b;this.height=d;return this}if(this.cacheSizes!==false&&this.lastSize&&this.lastSize.width==b&&this.lastSize.height==d){return this}this.lastSize={width:b,height:d};var c=this.adjustSize(b,d),g=c.width,a=c.height,e;if(g!==undefined||a!==undefined){e=this.getResizeEl();if(!this.deferHeight&&g!==undefined&&a!==undefined){e.setSize(g,a)}else{if(!this.deferHeight&&a!==undefined){e.setHeight(a)}else{if(g!==undefined){e.setWidth(g)}}}this.onResize(g,a,b,d);this.fireEvent("resize",this,g,a,b,d)}return this},setWidth:function(a){return this.setSize(a)},setHeight:function(a){return this.setSize(undefined,a)},getSize:function(){return this.getResizeEl().getSize()},getWidth:function(){return this.getResizeEl().getWidth()},getHeight:function(){return this.getResizeEl().getHeight()},getOuterSize:function(){var a=this.getResizeEl();return{width:a.getWidth()+a.getMargins("lr"),height:a.getHeight()+a.getMargins("tb")}},getPosition:function(a){var b=this.getPositionEl();if(a===true){return[b.getLeft(true),b.getTop(true)]}return this.xy||b.getXY()},getBox:function(a){var c=this.getPosition(a);var b=this.getSize();b.x=c[0];b.y=c[1];return b},updateBox:function(a){this.setSize(a.width,a.height);this.setPagePosition(a.x,a.y);return this},getResizeEl:function(){return this.resizeEl||this.el},setAutoScroll:function(a){if(this.rendered){this.getContentTarget().setOverflow(a?"auto":"")}this.autoScroll=a;return this},setPosition:function(a,g){if(a&&typeof a[1]=="number"){g=a[1];a=a[0]}this.x=a;this.y=g;if(!this.boxReady){return this}var b=this.adjustPosition(a,g);var e=b.x,d=b.y;var c=this.getPositionEl();if(e!==undefined||d!==undefined){if(e!==undefined&&d!==undefined){c.setLeftTop(e,d)}else{if(e!==undefined){c.setLeft(e)}else{if(d!==undefined){c.setTop(d)}}}this.onPosition(e,d);this.fireEvent("move",this,e,d)}return this},setPagePosition:function(a,c){if(a&&typeof a[1]=="number"){c=a[1];a=a[0]}this.pageX=a;this.pageY=c;if(!this.boxReady){return}if(a===undefined||c===undefined){return}var b=this.getPositionEl().translatePoints(a,c);this.setPosition(b.left,b.top);return this},afterRender:function(){Ext.BoxComponent.superclass.afterRender.call(this);if(this.resizeEl){this.resizeEl=Ext.get(this.resizeEl)}if(this.positionEl){this.positionEl=Ext.get(this.positionEl)}this.boxReady=true;Ext.isDefined(this.autoScroll)&&this.setAutoScroll(this.autoScroll);this.setSize(this.width,this.height);if(this.x||this.y){this.setPosition(this.x,this.y)}else{if(this.pageX||this.pageY){this.setPagePosition(this.pageX,this.pageY)}}},syncSize:function(){delete this.lastSize;this.setSize(this.autoWidth?undefined:this.getResizeEl().getWidth(),this.autoHeight?undefined:this.getResizeEl().getHeight());return this},onResize:function(d,b,a,c){},onPosition:function(a,b){},adjustSize:function(a,b){if(this.autoWidth){a="auto"}if(this.autoHeight){b="auto"}return{width:a,height:b}},adjustPosition:function(a,b){return{x:a,y:b}}});Ext.reg("box",Ext.BoxComponent);Ext.Spacer=Ext.extend(Ext.BoxComponent,{autoEl:"div"});Ext.reg("spacer",Ext.Spacer);Ext.SplitBar=function(c,e,b,d,a){this.el=Ext.get(c,true);this.el.dom.unselectable="on";this.resizingEl=Ext.get(e,true);this.orientation=b||Ext.SplitBar.HORIZONTAL;this.minSize=0;this.maxSize=2000;this.animate=false;this.useShim=false;this.shim=null;if(!a){this.proxy=Ext.SplitBar.createProxy(this.orientation)}else{this.proxy=Ext.get(a).dom}this.dd=new Ext.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id});this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this);this.dd.endDrag=this.onEndProxyDrag.createDelegate(this);this.dragSpecs={};this.adapter=new Ext.SplitBar.BasicLayoutAdapter();this.adapter.init(this);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.placement=d||(this.el.getX()>this.resizingEl.getX()?Ext.SplitBar.LEFT:Ext.SplitBar.RIGHT);this.el.addClass("x-splitbar-h")}else{this.placement=d||(this.el.getY()>this.resizingEl.getY()?Ext.SplitBar.TOP:Ext.SplitBar.BOTTOM);this.el.addClass("x-splitbar-v")}this.addEvents("resize","moved","beforeresize","beforeapply");Ext.SplitBar.superclass.constructor.call(this)};Ext.extend(Ext.SplitBar,Ext.util.Observable,{onStartProxyDrag:function(a,e){this.fireEvent("beforeresize",this);this.overlay=Ext.DomHelper.append(document.body,{cls:"x-drag-overlay",html:" "},true);this.overlay.unselectable();this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();Ext.get(this.proxy).setDisplayed("block");var c=this.adapter.getElementSize(this);this.activeMinSize=this.getMinimumSize();this.activeMaxSize=this.getMaximumSize();var d=c-this.activeMinSize;var b=Math.max(this.activeMaxSize-c,0);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.dd.resetConstraints();this.dd.setXConstraint(this.placement==Ext.SplitBar.LEFT?d:b,this.placement==Ext.SplitBar.LEFT?b:d,this.tickSize);this.dd.setYConstraint(0,0)}else{this.dd.resetConstraints();this.dd.setXConstraint(0,0);this.dd.setYConstraint(this.placement==Ext.SplitBar.TOP?d:b,this.placement==Ext.SplitBar.TOP?b:d,this.tickSize)}this.dragSpecs.startSize=c;this.dragSpecs.startPoint=[a,e];Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd,a,e)},onEndProxyDrag:function(c){Ext.get(this.proxy).setDisplayed(false);var b=Ext.lib.Event.getXY(c);if(this.overlay){Ext.destroy(this.overlay);delete this.overlay}var a;if(this.orientation==Ext.SplitBar.HORIZONTAL){a=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.LEFT?b[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-b[0])}else{a=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.TOP?b[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-b[1])}a=Math.min(Math.max(a,this.activeMinSize),this.activeMaxSize);if(a!=this.dragSpecs.startSize){if(this.fireEvent("beforeapply",this,a)!==false){this.adapter.setElementSize(this,a);this.fireEvent("moved",this,a);this.fireEvent("resize",this,a)}}},getAdapter:function(){return this.adapter},setAdapter:function(a){this.adapter=a;this.adapter.init(this)},getMinimumSize:function(){return this.minSize},setMinimumSize:function(a){this.minSize=a},getMaximumSize:function(){return this.maxSize},setMaximumSize:function(a){this.maxSize=a},setCurrentSize:function(b){var a=this.animate;this.animate=false;this.adapter.setElementSize(this,b);this.animate=a},destroy:function(a){Ext.destroy(this.shim,Ext.get(this.proxy));this.dd.unreg();if(a){this.el.remove()}this.purgeListeners()}});Ext.SplitBar.createProxy=function(b){var c=new Ext.Element(document.createElement("div"));document.body.appendChild(c.dom);c.unselectable();var a="x-splitbar-proxy";c.addClass(a+" "+(b==Ext.SplitBar.HORIZONTAL?a+"-h":a+"-v"));return c.dom};Ext.SplitBar.BasicLayoutAdapter=function(){};Ext.SplitBar.BasicLayoutAdapter.prototype={init:function(a){},getElementSize:function(a){if(a.orientation==Ext.SplitBar.HORIZONTAL){return a.resizingEl.getWidth()}else{return a.resizingEl.getHeight()}},setElementSize:function(b,a,c){if(b.orientation==Ext.SplitBar.HORIZONTAL){if(!b.animate){b.resizingEl.setWidth(a);if(c){c(b,a)}}else{b.resizingEl.setWidth(a,true,0.1,c,"easeOut")}}else{if(!b.animate){b.resizingEl.setHeight(a);if(c){c(b,a)}}else{b.resizingEl.setHeight(a,true,0.1,c,"easeOut")}}}};Ext.SplitBar.AbsoluteLayoutAdapter=function(a){this.basic=new Ext.SplitBar.BasicLayoutAdapter();this.container=Ext.get(a)};Ext.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(a){this.basic.init(a)},getElementSize:function(a){return this.basic.getElementSize(a)},setElementSize:function(b,a,c){this.basic.setElementSize(b,a,this.moveSplitter.createDelegate(this,[b]))},moveSplitter:function(a){var b=Ext.SplitBar;switch(a.placement){case b.LEFT:a.el.setX(a.resizingEl.getRight());break;case b.RIGHT:a.el.setStyle("right",(this.container.getWidth()-a.resizingEl.getLeft())+"px");break;case b.TOP:a.el.setY(a.resizingEl.getBottom());break;case b.BOTTOM:a.el.setY(a.resizingEl.getTop()-a.el.getHeight());break}}};Ext.SplitBar.VERTICAL=1;Ext.SplitBar.HORIZONTAL=2;Ext.SplitBar.LEFT=1;Ext.SplitBar.RIGHT=2;Ext.SplitBar.TOP=3;Ext.SplitBar.BOTTOM=4;Ext.Container=Ext.extend(Ext.BoxComponent,{bufferResize:50,autoDestroy:true,forceLayout:false,defaultType:"panel",resizeEvent:"resize",bubbleEvents:["add","remove"],initComponent:function(){Ext.Container.superclass.initComponent.call(this);this.addEvents("afterlayout","beforeadd","beforeremove","add","remove");var a=this.items;if(a){delete this.items;this.add(a)}},initItems:function(){if(!this.items){this.items=new Ext.util.MixedCollection(false,this.getComponentId);this.getLayout()}},setLayout:function(a){if(this.layout&&this.layout!=a){this.layout.setContainer(null)}this.layout=a;this.initItems();a.setContainer(this)},afterRender:function(){Ext.Container.superclass.afterRender.call(this);if(!this.layout){this.layout="auto"}if(Ext.isObject(this.layout)&&!this.layout.layout){this.layoutConfig=this.layout;this.layout=this.layoutConfig.type}if(Ext.isString(this.layout)){this.layout=new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig)}this.setLayout(this.layout);if(this.activeItem!==undefined){var a=this.activeItem;delete this.activeItem;this.layout.setActiveItem(a)}if(!this.ownerCt){this.doLayout(false,true)}if(this.monitorResize===true){Ext.EventManager.onWindowResize(this.doLayout,this,[false])}},getLayoutTarget:function(){return this.el},getComponentId:function(a){return a.getItemId()},add:function(b){this.initItems();var e=arguments.length>1;if(e||Ext.isArray(b)){var a=[];Ext.each(e?arguments:b,function(h){a.push(this.add(h))},this);return a}var g=this.lookupComponent(this.applyDefaults(b));var d=this.items.length;if(this.fireEvent("beforeadd",this,g,d)!==false&&this.onBeforeAdd(g)!==false){this.items.add(g);g.onAdded(this,d);this.onAdd(g);this.fireEvent("add",this,g,d)}return g},onAdd:function(a){},onAdded:function(a,b){this.ownerCt=a;this.initRef();this.cascade(function(d){d.initRef()});this.fireEvent("added",this,a,b)},insert:function(h,g){this.initItems();var e=arguments,d=e.length;if(d>2){var b=[];for(var j=d-1;j>=1;--j){b.push(this.insert(h,e[j]))}return b}var k=this.lookupComponent(this.applyDefaults(g));h=Math.min(h,this.items.length);if(this.fireEvent("beforeadd",this,k,h)!==false&&this.onBeforeAdd(k)!==false){if(k.ownerCt==this){this.items.remove(k)}this.items.insert(h,k);k.onAdded(this,h);this.onAdd(k);this.fireEvent("add",this,k,h)}return k},applyDefaults:function(b){var a=this.defaults;if(a){if(Ext.isFunction(a)){a=a.call(this,b)}if(Ext.isString(b)){b=Ext.ComponentMgr.get(b);Ext.apply(b,a)}else{if(!b.events){Ext.applyIf(b,a)}else{Ext.apply(b,a)}}}return b},onBeforeAdd:function(a){if(a.ownerCt){a.ownerCt.remove(a,false)}if(this.hideBorders===true){a.border=(a.border===true)}},remove:function(a,b){this.initItems();var d=this.getComponent(a);if(d&&this.fireEvent("beforeremove",this,d)!==false){this.doRemove(d,b);this.fireEvent("remove",this,d)}return d},onRemove:function(a){},doRemove:function(e,d){var b=this.layout,a=b&&this.rendered;if(a){b.onRemove(e)}this.items.remove(e);e.onRemoved();this.onRemove(e);if(d===true||(d!==false&&this.autoDestroy)){e.destroy()}if(a){b.afterRemove(e)}},removeAll:function(c){this.initItems();var e,g=[],b=[];this.items.each(function(h){g.push(h)});for(var d=0,a=g.length;d','','
    ','
    ',"");a.disableFormats=true;return a.compile()})(),destroy:function(){if(this.resizeTask&&this.resizeTask.cancel){this.resizeTask.cancel()}if(!Ext.isEmpty(this.targetCls)){var a=this.container.getLayoutTarget();if(a){a.removeClass(this.targetCls)}}}});Ext.layout.AutoLayout=Ext.extend(Ext.layout.ContainerLayout,{type:"auto",monitorResize:true,onLayout:function(d,g){Ext.layout.AutoLayout.superclass.onLayout.call(this,d,g);var e=this.getRenderedItems(d),a=e.length,b,h;for(b=0;b0){b.setSize(a)}}});Ext.Container.LAYOUTS.fit=Ext.layout.FitLayout;Ext.layout.CardLayout=Ext.extend(Ext.layout.FitLayout,{deferredRender:false,layoutOnCardChange:false,renderHidden:true,type:"card",setActiveItem:function(d){var a=this.activeItem,b=this.container;d=b.getComponent(d);if(d&&a!=d){if(a){a.hide();if(a.hidden!==true){return false}a.fireEvent("deactivate",a)}var c=d.doLayout&&(this.layoutOnCardChange||!d.rendered);this.activeItem=d;delete d.deferLayout;d.show();this.layout();if(c){d.doLayout()}d.fireEvent("activate",d)}},renderAll:function(a,b){if(this.deferredRender){this.renderItem(this.activeItem,undefined,b)}else{Ext.layout.CardLayout.superclass.renderAll.call(this,a,b)}}});Ext.Container.LAYOUTS.card=Ext.layout.CardLayout;Ext.layout.AnchorLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"anchor",defaultAnchor:"100%",parseAnchorRE:/^(r|right|b|bottom)$/i,getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();if(!a){return{}}return a.getStyleSize()},onLayout:function(m,p){Ext.layout.AnchorLayout.superclass.onLayout.call(this,m,p);var v=this.getLayoutTargetSize();var t=v.width,l=v.height;if(t<20&&l<20){return}var d,r;if(m.anchorSize){if(typeof m.anchorSize=="number"){d=m.anchorSize}else{d=m.anchorSize.width;r=m.anchorSize.height}}else{d=m.initialConfig.width;r=m.initialConfig.height}var o=this.getRenderedItems(m),n=o.length,j,q,s,g,b,e,u,k=[];for(j=0;j ');b.disableFormats=true;b.compile();Ext.layout.BorderLayout.Region.prototype.toolTemplate=b}this.collapsedEl=this.targetEl.createChild({cls:"x-layout-collapsed x-layout-collapsed-"+this.position,id:this.panel.id+"-xcollapsed"});this.collapsedEl.enableDisplayMode("block");if(this.collapseMode=="mini"){this.collapsedEl.addClass("x-layout-cmini-"+this.position);this.miniCollapsedEl=this.collapsedEl.createChild({cls:"x-layout-mini x-layout-mini-"+this.position,html:" "});this.miniCollapsedEl.addClassOnOver("x-layout-mini-over");this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this.onExpandClick,this,{stopEvent:true})}else{if(this.collapsible!==false&&!this.hideCollapseTool){var a=this.toolTemplate.append(this.collapsedEl.dom,{id:"expand-"+this.position},true);a.addClassOnOver("x-tool-expand-"+this.position+"-over");a.on("click",this.onExpandClick,this,{stopEvent:true})}if(this.floatable!==false||this.titleCollapse){this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this[this.floatable?"collapseClick":"onExpandClick"],this)}}}return this.collapsedEl},onExpandClick:function(a){if(this.isSlid){this.panel.expand(false)}else{this.panel.expand()}},onCollapseClick:function(a){this.panel.collapse()},beforeCollapse:function(c,a){this.lastAnim=a;if(this.splitEl){this.splitEl.hide()}this.getCollapsedEl().show();var b=this.panel.getEl();this.originalZIndex=b.getStyle("z-index");b.setStyle("z-index",100);this.isCollapsed=true;this.layout.layout()},onCollapse:function(a){this.panel.el.setStyle("z-index",1);if(this.lastAnim===false||this.panel.animCollapse===false){this.getCollapsedEl().dom.style.visibility="visible"}else{this.getCollapsedEl().slideIn(this.panel.slideAnchor,{duration:0.2})}this.state.collapsed=true;this.panel.saveState()},beforeExpand:function(a){if(this.isSlid){this.afterSlideIn()}var b=this.getCollapsedEl();this.el.show();if(this.position=="east"||this.position=="west"){this.panel.setSize(undefined,b.getHeight())}else{this.panel.setSize(b.getWidth(),undefined)}b.hide();b.dom.style.visibility="hidden";this.panel.el.setStyle("z-index",this.floatingZIndex)},onExpand:function(){this.isCollapsed=false;if(this.splitEl){this.splitEl.show()}this.layout.layout();this.panel.el.setStyle("z-index",this.originalZIndex);this.state.collapsed=false;this.panel.saveState()},collapseClick:function(a){if(this.isSlid){a.stopPropagation();this.slideIn()}else{a.stopPropagation();this.slideOut()}},onHide:function(){if(this.isCollapsed){this.getCollapsedEl().hide()}else{if(this.splitEl){this.splitEl.hide()}}},onShow:function(){if(this.isCollapsed){this.getCollapsedEl().show()}else{if(this.splitEl){this.splitEl.show()}}},isVisible:function(){return !this.panel.hidden},getMargins:function(){return this.isCollapsed&&this.cmargins?this.cmargins:this.margins},getSize:function(){return this.isCollapsed?this.getCollapsedEl().getSize():this.panel.getSize()},setPanel:function(a){this.panel=a},getMinWidth:function(){return this.minWidth},getMinHeight:function(){return this.minHeight},applyLayoutCollapsed:function(a){var b=this.getCollapsedEl();b.setLeftTop(a.x,a.y);b.setSize(a.width,a.height)},applyLayout:function(a){if(this.isCollapsed){this.applyLayoutCollapsed(a)}else{this.panel.setPosition(a.x,a.y);this.panel.setSize(a.width,a.height)}},beforeSlide:function(){this.panel.beforeEffect()},afterSlide:function(){this.panel.afterEffect()},initAutoHide:function(){if(this.autoHide!==false){if(!this.autoHideHd){this.autoHideSlideTask=new Ext.util.DelayedTask(this.slideIn,this);this.autoHideHd={mouseout:function(a){if(!a.within(this.el,true)){this.autoHideSlideTask.delay(500)}},mouseover:function(a){this.autoHideSlideTask.cancel()},scope:this}}this.el.on(this.autoHideHd);this.collapsedEl.on(this.autoHideHd)}},clearAutoHide:function(){if(this.autoHide!==false){this.el.un("mouseout",this.autoHideHd.mouseout);this.el.un("mouseover",this.autoHideHd.mouseover);this.collapsedEl.un("mouseout",this.autoHideHd.mouseout);this.collapsedEl.un("mouseover",this.autoHideHd.mouseover)}},clearMonitor:function(){Ext.getDoc().un("click",this.slideInIf,this)},slideOut:function(){if(this.isSlid||this.el.hasActiveFx()){return}this.isSlid=true;var b=this.panel.tools,c,a;if(b&&b.toggle){b.toggle.hide()}this.el.show();a=this.panel.collapsed;this.panel.collapsed=false;if(this.position=="east"||this.position=="west"){c=this.panel.deferHeight;this.panel.deferHeight=false;this.panel.setSize(undefined,this.collapsedEl.getHeight());this.panel.deferHeight=c}else{this.panel.setSize(this.collapsedEl.getWidth(),undefined)}this.panel.collapsed=a;this.restoreLT=[this.el.dom.style.left,this.el.dom.style.top];this.el.alignTo(this.collapsedEl,this.getCollapseAnchor());this.el.setStyle("z-index",this.floatingZIndex+2);this.panel.el.replaceClass("x-panel-collapsed","x-panel-floating");if(this.animFloat!==false){this.beforeSlide();this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide();this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)},scope:this,block:true})}else{this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)}},afterSlideIn:function(){this.clearAutoHide();this.isSlid=false;this.clearMonitor();this.el.setStyle("z-index","");this.panel.el.replaceClass("x-panel-floating","x-panel-collapsed");this.el.dom.style.left=this.restoreLT[0];this.el.dom.style.top=this.restoreLT[1];var a=this.panel.tools;if(a&&a.toggle){a.toggle.show()}},slideIn:function(a){if(!this.isSlid||this.el.hasActiveFx()){Ext.callback(a);return}this.isSlid=false;if(this.animFloat!==false){this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.hide();this.afterSlide();this.afterSlideIn();Ext.callback(a)},scope:this,block:true})}else{this.el.hide();this.afterSlideIn()}},slideInIf:function(a){if(!a.within(this.el)){this.slideIn()}},anchors:{west:"left",east:"right",north:"top",south:"bottom"},sanchors:{west:"l",east:"r",north:"t",south:"b"},canchors:{west:"tl-tr",east:"tr-tl",north:"tl-bl",south:"bl-tl"},getAnchor:function(){return this.anchors[this.position]},getCollapseAnchor:function(){return this.canchors[this.position]},getSlideAnchor:function(){return this.sanchors[this.position]},getAlignAdj:function(){var a=this.cmargins;switch(this.position){case"west":return[0,0];break;case"east":return[0,0];break;case"north":return[0,0];break;case"south":return[0,0];break}},getExpandAdj:function(){var b=this.collapsedEl,a=this.cmargins;switch(this.position){case"west":return[-(a.right+b.getWidth()+a.left),0];break;case"east":return[a.right+b.getWidth()+a.left,0];break;case"north":return[0,-(a.top+a.bottom+b.getHeight())];break;case"south":return[0,a.top+a.bottom+b.getHeight()];break}},destroy:function(){if(this.autoHideSlideTask&&this.autoHideSlideTask.cancel){this.autoHideSlideTask.cancel()}Ext.destroy(this.miniCollapsedEl,this.collapsedEl)}};Ext.layout.BorderLayout.SplitRegion=function(b,a,c){Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this,b,a,c);this.applyLayout=this.applyFns[c]};Ext.extend(Ext.layout.BorderLayout.SplitRegion,Ext.layout.BorderLayout.Region,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,splitSettings:{north:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.TOP,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},south:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.BOTTOM,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},east:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.RIGHT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"},west:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.LEFT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"}},applyFns:{west:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;this.panel.setPosition(c.x,c.y);var a=d.offsetWidth;b.left=(c.x+c.width-a)+"px";b.top=(c.y)+"px";b.height=Math.max(0,c.height)+"px";this.panel.setSize(c.width-a,c.height)},east:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetWidth;this.panel.setPosition(c.x+a,c.y);b.left=(c.x)+"px";b.top=(c.y)+"px";b.height=Math.max(0,c.height)+"px";this.panel.setSize(c.width-a,c.height)},north:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetHeight;this.panel.setPosition(c.x,c.y);b.left=(c.x)+"px";b.top=(c.y+c.height-a)+"px";b.width=Math.max(0,c.width)+"px";this.panel.setSize(c.width,c.height-a)},south:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetHeight;this.panel.setPosition(c.x,c.y+a);b.left=(c.x)+"px";b.top=(c.y)+"px";b.width=Math.max(0,c.width)+"px";this.panel.setSize(c.width,c.height-a)}},render:function(a,c){Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this,a,c);var d=this.position;this.splitEl=a.createChild({cls:"x-layout-split x-layout-split-"+d,html:" ",id:this.panel.id+"-xsplit"});if(this.collapseMode=="mini"){this.miniSplitEl=this.splitEl.createChild({cls:"x-layout-mini x-layout-mini-"+d,html:" "});this.miniSplitEl.addClassOnOver("x-layout-mini-over");this.miniSplitEl.on("click",this.onCollapseClick,this,{stopEvent:true})}var b=this.splitSettings[d];this.split=new Ext.SplitBar(this.splitEl.dom,c.el,b.orientation);this.split.tickSize=this.tickSize;this.split.placement=b.placement;this.split.getMaximumSize=this[b.maxFn].createDelegate(this);this.split.minSize=this.minSize||this[b.minProp];this.split.on("beforeapply",this.onSplitMove,this);this.split.useShim=this.useShim===true;this.maxSize=this.maxSize||this[b.maxProp];if(c.hidden){this.splitEl.hide()}if(this.useSplitTips){this.splitEl.dom.title=this.collapsible?this.collapsibleSplitTip:this.splitTip}if(this.collapsible){this.splitEl.on("dblclick",this.onCollapseClick,this)}},getSize:function(){if(this.isCollapsed){return this.collapsedEl.getSize()}var a=this.panel.getSize();if(this.position=="north"||this.position=="south"){a.height+=this.splitEl.dom.offsetHeight}else{a.width+=this.splitEl.dom.offsetWidth}return a},getHMaxSize:function(){var b=this.maxSize||10000;var a=this.layout.center;return Math.min(b,(this.el.getWidth()+a.el.getWidth())-a.getMinWidth())},getVMaxSize:function(){var b=this.maxSize||10000;var a=this.layout.center;return Math.min(b,(this.el.getHeight()+a.el.getHeight())-a.getMinHeight())},onSplitMove:function(b,a){var c=this.panel.getSize();this.lastSplitSize=a;if(this.position=="north"||this.position=="south"){this.panel.setSize(c.width,a);this.state.height=a}else{this.panel.setSize(a,c.height);this.state.width=a}this.layout.layout();this.panel.saveState();return false},getSplitBar:function(){return this.split},destroy:function(){Ext.destroy(this.miniSplitEl,this.split,this.splitEl);Ext.layout.BorderLayout.SplitRegion.superclass.destroy.call(this)}});Ext.Container.LAYOUTS.border=Ext.layout.BorderLayout;Ext.layout.FormLayout=Ext.extend(Ext.layout.AnchorLayout,{labelSeparator:":",trackLabels:false,type:"form",onRemove:function(d){Ext.layout.FormLayout.superclass.onRemove.call(this,d);if(this.trackLabels){d.un("show",this.onFieldShow,this);d.un("hide",this.onFieldHide,this)}var b=d.getPositionEl(),a=d.getItemCt&&d.getItemCt();if(d.rendered&&a){if(b&&b.dom){b.insertAfter(a)}Ext.destroy(a);Ext.destroyMembers(d,"label","itemCt");if(d.customItemCt){Ext.destroyMembers(d,"getItemCt","customItemCt")}}},setContainer:function(a){Ext.layout.FormLayout.superclass.setContainer.call(this,a);if(a.labelAlign){a.addClass("x-form-label-"+a.labelAlign)}if(a.hideLabels){Ext.apply(this,{labelStyle:"display:none",elementStyle:"padding-left:0;",labelAdjust:0})}else{this.labelSeparator=a.labelSeparator||this.labelSeparator;a.labelWidth=a.labelWidth||100;if(Ext.isNumber(a.labelWidth)){var b=Ext.isNumber(a.labelPad)?a.labelPad:5;Ext.apply(this,{labelAdjust:a.labelWidth+b,labelStyle:"width:"+a.labelWidth+"px;",elementStyle:"padding-left:"+(a.labelWidth+b)+"px"})}if(a.labelAlign=="top"){Ext.apply(this,{labelStyle:"width:auto;",labelAdjust:0,elementStyle:"padding-left:0;"})}}},isHide:function(a){return a.hideLabel||this.container.hideLabels},onFieldShow:function(a){a.getItemCt().removeClass("x-hide-"+a.hideMode);if(a.isComposite){a.doLayout()}},onFieldHide:function(a){a.getItemCt().addClass("x-hide-"+a.hideMode)},getLabelStyle:function(e){var b="",c=[this.labelStyle,e];for(var d=0,a=c.length;d=b)||(this.cells[c]&&this.cells[c][a])){if(b&&a>=b){c++;a=0}else{a++}}return[a,c]},renderItem:function(e,a,d){if(!this.table){this.table=d.createChild(Ext.apply({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},this.tableAttrs),null,true)}if(e&&!e.rendered){e.render(this.getNextCell(e));this.configureItem(e,a)}else{if(e&&!this.isValidParent(e,d)){var b=this.getNextCell(e);b.insertBefore(e.getPositionEl().dom,null);e.container=Ext.get(b);this.configureItem(e,a)}}},isValidParent:function(b,a){return b.getPositionEl().up("table",5).dom.parentNode===(a.dom||a)}});Ext.Container.LAYOUTS.table=Ext.layout.TableLayout;Ext.layout.AbsoluteLayout=Ext.extend(Ext.layout.AnchorLayout,{extraCls:"x-abs-layout-item",type:"absolute",onLayout:function(a,b){b.position();this.paddingLeft=b.getPadding("l");this.paddingTop=b.getPadding("t");Ext.layout.AbsoluteLayout.superclass.onLayout.call(this,a,b)},adjustWidthAnchor:function(b,a){return b?b-a.getPosition(true)[0]+this.paddingLeft:b},adjustHeightAnchor:function(b,a){return b?b-a.getPosition(true)[1]+this.paddingTop:b}});Ext.Container.LAYOUTS.absolute=Ext.layout.AbsoluteLayout;Ext.layout.BoxLayout=Ext.extend(Ext.layout.ContainerLayout,{defaultMargins:{left:0,top:0,right:0,bottom:0},padding:"0",pack:"start",monitorResize:true,type:"box",scrollOffset:0,extraCls:"x-box-item",targetCls:"x-box-layout-ct",innerCls:"x-box-inner",constructor:function(a){Ext.layout.BoxLayout.superclass.constructor.call(this,a);if(Ext.isString(this.defaultMargins)){this.defaultMargins=this.parseMargins(this.defaultMargins)}},onLayout:function(a,d){Ext.layout.BoxLayout.superclass.onLayout.call(this,a,d);var b=this.getVisibleItems(a),c=this.getLayoutTargetSize();this.layoutTargetLastSize=c;this.childBoxCache=this.calculateChildBoxes(b,c);this.updateInnerCtSize(c,this.childBoxCache);this.updateChildBoxes(this.childBoxCache.boxes);this.handleTargetOverflow(c,a,d)},updateChildBoxes:function(c){for(var b=0,e=c.length;b0){s.left=p+G+(r/2)}}y+=s.height+t.bottom}return{boxes:j,meta:{maxWidth:E}}}});Ext.Container.LAYOUTS.vbox=Ext.layout.VBoxLayout;Ext.layout.HBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"top",type:"hbox",updateInnerCtSize:function(b,d){var a=b.width,c=d.meta.maxHeight+this.padding.top+this.padding.bottom;if(this.align=="stretch"){c=b.height}else{if(this.align=="middle"){c=Math.max(b.height,c)}}this.innerCt.setSize(a||undefined,c||undefined)},calculateChildBoxes:function(z,e){var n=z.length,x=this.padding,C=x.top,r=x.left,s=C+x.bottom,a=r+x.right,B=e.width-this.scrollOffset,y=e.height,h=Math.max(0,y-s),o=this.pack=="start",p=this.pack=="center",q=this.pack=="end",I=0,A=0,D=0,m=[],l,d,g,c,w,F,E,v,H,j,t;for(E=0;E0){v.top=C+j+(u/2)}}r+=v.width+w.right}return{boxes:m,meta:{maxHeight:A}}}});Ext.Container.LAYOUTS.hbox=Ext.layout.HBoxLayout;Ext.layout.ToolbarLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"toolbar",triggerWidth:18,noItemsMenuText:'
    (None)
    ',lastOverflow:false,tableHTML:['',"","",'",'","","","
    ','',"",'',"","
    ","
    ','',"","","","","","","
    ",'',"",'',"","
    ","
    ",'',"",'',"","
    ","
    ","
    "].join(""),onLayout:function(e,j){if(!this.leftTr){var h=e.buttonAlign=="center"?"center":"left";j.addClass("x-toolbar-layout-ct");j.insertHtml("beforeEnd",String.format(this.tableHTML,h));this.leftTr=j.child("tr.x-toolbar-left-row",true);this.rightTr=j.child("tr.x-toolbar-right-row",true);this.extrasTr=j.child("tr.x-toolbar-extras-row",true);if(this.hiddenItem==undefined){this.hiddenItems=[]}}var k=e.buttonAlign=="right"?this.rightTr:this.leftTr,l=e.items.items,d=0;for(var b=0,g=l.length,m;b=0&&(d=e[a]);a--){if(!d.firstChild){b.removeChild(d)}}},insertCell:function(e,b,a){var d=document.createElement("td");d.className="x-toolbar-cell";b.insertBefore(d,b.childNodes[a]||null);return d},hideItem:function(a){this.hiddenItems.push(a);a.xtbHidden=true;a.xtbWidth=a.getPositionEl().dom.parentNode.offsetWidth;a.hide()},unhideItem:function(a){a.show();a.xtbHidden=false;this.hiddenItems.remove(a)},getItemWidth:function(a){return a.hidden?(a.xtbWidth||0):a.getPositionEl().dom.parentNode.offsetWidth},fitToSize:function(k){if(this.container.enableOverflow===false){return}var b=k.dom.clientWidth,j=k.dom.firstChild.offsetWidth,m=b-this.triggerWidth,a=this.lastWidth||0,c=this.hiddenItems,e=c.length!=0,n=b>=a;this.lastWidth=b;if(j>b||(e&&n)){var l=this.container.items.items,h=l.length,d=0,o;for(var g=0;gm){if(!(o.hidden||o.xtbHidden)){this.hideItem(o)}}else{if(o.xtbHidden){this.unhideItem(o)}}}}}e=c.length!=0;if(e){this.initMore();if(!this.lastOverflow){this.container.fireEvent("overflowchange",this.container,true);this.lastOverflow=true}}else{if(this.more){this.clearMenu();this.more.destroy();delete this.more;if(this.lastOverflow){this.container.fireEvent("overflowchange",this.container,false);this.lastOverflow=false}}}},createMenuConfig:function(c,a){var b=Ext.apply({},c.initialConfig),d=c.toggleGroup;Ext.copyTo(b,c,["iconCls","icon","itemId","disabled","handler","scope","menu"]);Ext.apply(b,{text:c.overflowText||c.text,hideOnClick:a});if(d||c.enableToggle){Ext.apply(b,{group:d,checked:c.pressed,listeners:{checkchange:function(g,e){c.toggle(e)}}})}delete b.ownerCt;delete b.xtype;delete b.id;return b},addComponentToMenu:function(b,a){if(a instanceof Ext.Toolbar.Separator){b.add("-")}else{if(Ext.isFunction(a.isXType)){if(a.isXType("splitbutton")){b.add(this.createMenuConfig(a,true))}else{if(a.isXType("button")){b.add(this.createMenuConfig(a,!a.menu))}else{if(a.isXType("buttongroup")){a.items.each(function(c){this.addComponentToMenu(b,c)},this)}}}}}},clearMenu:function(){var a=this.moreMenu;if(a&&a.items){a.items.each(function(b){delete b.menu})}},beforeMoreShow:function(h){var b=this.container.items.items,a=b.length,g,e;var c=function(j,i){return j.isXType("buttongroup")&&!(i instanceof Ext.Toolbar.Separator)};this.clearMenu();h.removeAll();for(var d=0;d','','',"","")}if(g&&!g.rendered){if(Ext.isNumber(b)){b=e.dom.childNodes[b]}var d=this.getItemArgs(g);g.render(g.positionEl=b?this.itemTpl.insertBefore(b,d,true):this.itemTpl.append(e,d,true));g.positionEl.menuItemId=g.getItemId();if(!d.isMenuItem&&d.needsIcon){g.positionEl.addClass("x-menu-list-item-indent")}this.configureItem(g,b)}else{if(g&&!this.isValidParent(g,e)){if(Ext.isNumber(b)){b=e.dom.childNodes[b]}e.dom.insertBefore(g.getActionEl().dom,b||null)}}},getItemArgs:function(b){var a=b instanceof Ext.menu.Item;return{isMenuItem:a,needsIcon:!a&&(b.icon||b.iconCls),icon:b.icon||Ext.BLANK_IMAGE_URL,iconCls:"x-menu-item-icon "+(b.iconCls||""),itemId:"x-menu-el-"+b.id,itemCls:"x-menu-list-item "}},isValidParent:function(b,a){return b.el.up("li.x-menu-list-item",5).dom.parentNode===(a.dom||a)},onLayout:function(a,b){Ext.layout.MenuLayout.superclass.onLayout.call(this,a,b);this.doAutoSize()},doAutoSize:function(){var c=this.container,a=c.width;if(c.floating){if(a){c.setWidth(a)}else{if(Ext.isIE){c.setWidth(Ext.isStrict&&(Ext.isIE7||Ext.isIE8)?"auto":c.minWidth);var d=c.getEl(),b=d.dom.offsetWidth;c.setWidth(c.getLayoutTarget().getWidth()+d.getFrameWidth("lr"))}}}}});Ext.Container.LAYOUTS.menu=Ext.layout.MenuLayout;Ext.Viewport=Ext.extend(Ext.Container,{initComponent:function(){Ext.Viewport.superclass.initComponent.call(this);document.getElementsByTagName("html")[0].className+=" x-viewport";this.el=Ext.getBody();this.el.setHeight=Ext.emptyFn;this.el.setWidth=Ext.emptyFn;this.el.setSize=Ext.emptyFn;this.el.dom.scroll="no";this.allowDomMove=false;this.autoWidth=true;this.autoHeight=true;Ext.EventManager.onWindowResize(this.fireResize,this);this.renderTo=this.el},fireResize:function(a,b){this.fireEvent("resize",this,a,b,a,b)}});Ext.reg("viewport",Ext.Viewport);Ext.Panel=Ext.extend(Ext.Container,{baseCls:"x-panel",collapsedCls:"x-panel-collapsed",maskDisabled:true,animCollapse:Ext.enableFx,headerAsText:true,buttonAlign:"right",collapsed:false,collapseFirst:true,minButtonWidth:75,elements:"body",preventBodyReset:false,padding:undefined,resizeEvent:"bodyresize",toolTarget:"header",collapseEl:"bwrap",slideAnchor:"t",disabledClass:"",deferHeight:true,expandDefaults:{duration:0.25},collapseDefaults:{duration:0.25},initComponent:function(){Ext.Panel.superclass.initComponent.call(this);this.addEvents("bodyresize","titlechange","iconchange","collapse","expand","beforecollapse","beforeexpand","beforeclose","close","activate","deactivate");if(this.unstyled){this.baseCls="x-plain"}this.toolbars=[];if(this.tbar){this.elements+=",tbar";this.topToolbar=this.createToolbar(this.tbar);this.tbar=null}if(this.bbar){this.elements+=",bbar";this.bottomToolbar=this.createToolbar(this.bbar);this.bbar=null}if(this.header===true){this.elements+=",header";this.header=null}else{if(this.headerCfg||(this.title&&this.header!==false)){this.elements+=",header"}}if(this.footerCfg||this.footer===true){this.elements+=",footer";this.footer=null}if(this.buttons){this.fbar=this.buttons;this.buttons=null}if(this.fbar){this.createFbar(this.fbar)}if(this.autoLoad){this.on("render",this.doAutoLoad,this,{delay:10})}},createFbar:function(b){var a=this.minButtonWidth;this.elements+=",footer";this.fbar=this.createToolbar(b,{buttonAlign:this.buttonAlign,toolbarCls:"x-panel-fbar",enableOverflow:false,defaults:function(d){return{minWidth:d.minWidth||a}}});this.fbar.items.each(function(d){d.minWidth=d.minWidth||this.minButtonWidth},this);this.buttons=this.fbar.items.items},createToolbar:function(b,c){var a;if(Ext.isArray(b)){b={items:b}}a=b.events?Ext.apply(b,c):this.createComponent(Ext.apply({},b,c),"toolbar");this.toolbars.push(a);return a},createElement:function(a,c){if(this[a]){c.appendChild(this[a].dom);return}if(a==="bwrap"||this.elements.indexOf(a)!=-1){if(this[a+"Cfg"]){this[a]=Ext.fly(c).createChild(this[a+"Cfg"])}else{var b=document.createElement("div");b.className=this[a+"Cls"];this[a]=Ext.get(c.appendChild(b))}if(this[a+"CssClass"]){this[a].addClass(this[a+"CssClass"])}if(this[a+"Style"]){this[a].applyStyles(this[a+"Style"])}}},onRender:function(g,e){Ext.Panel.superclass.onRender.call(this,g,e);this.createClasses();var a=this.el,h=a.dom,k,i;if(this.collapsible&&!this.hideCollapseTool){this.tools=this.tools?this.tools.slice(0):[];this.tools[this.collapseFirst?"unshift":"push"]({id:"toggle",handler:this.toggleCollapse,scope:this})}if(this.tools){i=this.tools;this.elements+=(this.header!==false)?",header":""}this.tools={};a.addClass(this.baseCls);if(h.firstChild){this.header=a.down("."+this.headerCls);this.bwrap=a.down("."+this.bwrapCls);var j=this.bwrap?this.bwrap:a;this.tbar=j.down("."+this.tbarCls);this.body=j.down("."+this.bodyCls);this.bbar=j.down("."+this.bbarCls);this.footer=j.down("."+this.footerCls);this.fromMarkup=true}if(this.preventBodyReset===true){a.addClass("x-panel-reset")}if(this.cls){a.addClass(this.cls)}if(this.buttons){this.elements+=",footer"}if(this.frame){a.insertHtml("afterBegin",String.format(Ext.Element.boxMarkup,this.baseCls));this.createElement("header",h.firstChild.firstChild.firstChild);this.createElement("bwrap",h);k=this.bwrap.dom;var c=h.childNodes[1],b=h.childNodes[2];k.appendChild(c);k.appendChild(b);var l=k.firstChild.firstChild.firstChild;this.createElement("tbar",l);this.createElement("body",l);this.createElement("bbar",l);this.createElement("footer",k.lastChild.firstChild.firstChild);if(!this.footer){this.bwrap.dom.lastChild.className+=" x-panel-nofooter"}this.ft=Ext.get(this.bwrap.dom.lastChild);this.mc=Ext.get(l)}else{this.createElement("header",h);this.createElement("bwrap",h);k=this.bwrap.dom;this.createElement("tbar",k);this.createElement("body",k);this.createElement("bbar",k);this.createElement("footer",k);if(!this.header){this.body.addClass(this.bodyCls+"-noheader");if(this.tbar){this.tbar.addClass(this.tbarCls+"-noheader")}}}if(Ext.isDefined(this.padding)){this.body.setStyle("padding",this.body.addUnits(this.padding))}if(this.border===false){this.el.addClass(this.baseCls+"-noborder");this.body.addClass(this.bodyCls+"-noborder");if(this.header){this.header.addClass(this.headerCls+"-noborder")}if(this.footer){this.footer.addClass(this.footerCls+"-noborder")}if(this.tbar){this.tbar.addClass(this.tbarCls+"-noborder")}if(this.bbar){this.bbar.addClass(this.bbarCls+"-noborder")}}if(this.bodyBorder===false){this.body.addClass(this.bodyCls+"-noborder")}this.bwrap.enableDisplayMode("block");if(this.header){this.header.unselectable();if(this.headerAsText){this.header.dom.innerHTML=''+this.header.dom.innerHTML+"";if(this.iconCls){this.setIconClass(this.iconCls)}}}if(this.floating){this.makeFloating(this.floating)}if(this.collapsible&&this.titleCollapse&&this.header){this.mon(this.header,"click",this.toggleCollapse,this);this.header.setStyle("cursor","pointer")}if(i){this.addTool.apply(this,i)}if(this.fbar){this.footer.addClass("x-panel-btns");this.fbar.ownerCt=this;this.fbar.render(this.footer);this.footer.createChild({cls:"x-clear"})}if(this.tbar&&this.topToolbar){this.topToolbar.ownerCt=this;this.topToolbar.render(this.tbar)}if(this.bbar&&this.bottomToolbar){this.bottomToolbar.ownerCt=this;this.bottomToolbar.render(this.bbar)}},setIconClass:function(b){var a=this.iconCls;this.iconCls=b;if(this.rendered&&this.header){if(this.frame){this.header.addClass("x-panel-icon");this.header.replaceClass(a,this.iconCls)}else{var e=this.header,c=e.child("img.x-panel-inline-icon");if(c){Ext.fly(c).replaceClass(a,this.iconCls)}else{var d=e.child("span."+this.headerTextCls);if(d){Ext.DomHelper.insertBefore(d.dom,{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-panel-inline-icon "+this.iconCls})}}}}this.fireEvent("iconchange",this,b,a)},makeFloating:function(a){this.floating=true;this.el=new Ext.Layer(Ext.apply({},a,{shadow:Ext.isDefined(this.shadow)?this.shadow:"sides",shadowOffset:this.shadowOffset,constrain:false,shim:this.shim===false?false:undefined}),this.el)},getTopToolbar:function(){return this.topToolbar},getBottomToolbar:function(){return this.bottomToolbar},getFooterToolbar:function(){return this.fbar},addButton:function(a,c,b){if(!this.fbar){this.createFbar([])}if(c){if(Ext.isString(a)){a={text:a}}a=Ext.apply({handler:c,scope:b},a)}return this.fbar.add(a)},addTool:function(){if(!this.rendered){if(!this.tools){this.tools=[]}Ext.each(arguments,function(a){this.tools.push(a)},this);return}if(!this[this.toolTarget]){return}if(!this.toolTemplate){var h=new Ext.Template('
     
    ');h.disableFormats=true;h.compile();Ext.Panel.prototype.toolTemplate=h}for(var g=0,d=arguments,c=d.length;g0){Ext.each(this.toolbars,function(c){c.doLayout(undefined,a)});this.syncHeight()}},syncHeight:function(){var b=this.toolbarHeight,c=this.body,a=this.lastSize.height,d;if(this.autoHeight||!Ext.isDefined(a)||a=="auto"){return}if(b!=this.getToolbarHeight()){b=Math.max(0,a-this.getFrameHeight());c.setHeight(b);d=c.getSize();this.toolbarHeight=this.getToolbarHeight();this.onBodyResize(d.width,d.height)}},onShow:function(){if(this.floating){return this.el.show()}Ext.Panel.superclass.onShow.call(this)},onHide:function(){if(this.floating){return this.el.hide()}Ext.Panel.superclass.onHide.call(this)},createToolHandler:function(c,a,d,b){return function(g){c.removeClass(d);if(a.stopEvent!==false){g.stopEvent()}if(a.handler){a.handler.call(a.scope||c,g,c,b,a)}}},afterRender:function(){if(this.floating&&!this.hidden){this.el.show()}if(this.title){this.setTitle(this.title)}Ext.Panel.superclass.afterRender.call(this);if(this.collapsed){this.collapsed=false;this.collapse(false)}this.initEvents()},getKeyMap:function(){if(!this.keyMap){this.keyMap=new Ext.KeyMap(this.el,this.keys)}return this.keyMap},initEvents:function(){if(this.keys){this.getKeyMap()}if(this.draggable){this.initDraggable()}if(this.toolbars.length>0){Ext.each(this.toolbars,function(a){a.doLayout();a.on({scope:this,afterlayout:this.syncHeight,remove:this.syncHeight})},this);this.syncHeight()}},initDraggable:function(){this.dd=new Ext.Panel.DD(this,Ext.isBoolean(this.draggable)?null:this.draggable)},beforeEffect:function(a){if(this.floating){this.el.beforeAction()}if(a!==false){this.el.addClass("x-panel-animated")}},afterEffect:function(a){this.syncShadow();this.el.removeClass("x-panel-animated")},createEffect:function(c,b,d){var e={scope:d,block:true};if(c===true){e.callback=b;return e}else{if(!c.callback){e.callback=b}else{e.callback=function(){b.call(d);Ext.callback(c.callback,c.scope)}}}return Ext.applyIf(e,c)},collapse:function(b){if(this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforecollapse",this,b)===false){return}var a=b===true||(b!==false&&this.animCollapse);this.beforeEffect(a);this.onCollapse(a,b);return this},onCollapse:function(a,b){if(a){this[this.collapseEl].slideOut(this.slideAnchor,Ext.apply(this.createEffect(b||true,this.afterCollapse,this),this.collapseDefaults))}else{this[this.collapseEl].hide(this.hideMode);this.afterCollapse(false)}},afterCollapse:function(a){this.collapsed=true;this.el.addClass(this.collapsedCls);if(a!==false){this[this.collapseEl].hide(this.hideMode)}this.afterEffect(a);this.cascade(function(b){if(b.lastSize){b.lastSize={width:undefined,height:undefined}}});this.fireEvent("collapse",this)},expand:function(b){if(!this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforeexpand",this,b)===false){return}var a=b===true||(b!==false&&this.animCollapse);this.el.removeClass(this.collapsedCls);this.beforeEffect(a);this.onExpand(a,b);return this},onExpand:function(a,b){if(a){this[this.collapseEl].slideIn(this.slideAnchor,Ext.apply(this.createEffect(b||true,this.afterExpand,this),this.expandDefaults))}else{this[this.collapseEl].show(this.hideMode);this.afterExpand(false)}},afterExpand:function(a){this.collapsed=false;if(a!==false){this[this.collapseEl].show(this.hideMode)}this.afterEffect(a);if(this.deferLayout){delete this.deferLayout;this.doLayout(true)}this.fireEvent("expand",this)},toggleCollapse:function(a){this[this.collapsed?"expand":"collapse"](a);return this},onDisable:function(){if(this.rendered&&this.maskDisabled){this.el.mask()}Ext.Panel.superclass.onDisable.call(this)},onEnable:function(){if(this.rendered&&this.maskDisabled){this.el.unmask()}Ext.Panel.superclass.onEnable.call(this)},onResize:function(g,d,c,e){var a=g,b=d;if(Ext.isDefined(a)||Ext.isDefined(b)){if(!this.collapsed){if(Ext.isNumber(a)){this.body.setWidth(a=this.adjustBodyWidth(a-this.getFrameWidth()))}else{if(a=="auto"){a=this.body.setWidth("auto").dom.offsetWidth}else{a=this.body.dom.offsetWidth}}if(this.tbar){this.tbar.setWidth(a);if(this.topToolbar){this.topToolbar.setSize(a)}}if(this.bbar){this.bbar.setWidth(a);if(this.bottomToolbar){this.bottomToolbar.setSize(a);if(Ext.isIE){this.bbar.setStyle("position","static");this.bbar.setStyle("position","")}}}if(this.footer){this.footer.setWidth(a);if(this.fbar){this.fbar.setSize(Ext.isIE?(a-this.footer.getFrameWidth("lr")):"auto")}}if(Ext.isNumber(b)){b=Math.max(0,b-this.getFrameHeight());this.body.setHeight(b)}else{if(b=="auto"){this.body.setHeight(b)}}if(this.disabled&&this.el._mask){this.el._mask.setSize(this.el.dom.clientWidth,this.el.getHeight())}}else{this.queuedBodySize={width:a,height:b};if(!this.queuedExpand&&this.allowQueuedExpand!==false){this.queuedExpand=true;this.on("expand",function(){delete this.queuedExpand;this.onResize(this.queuedBodySize.width,this.queuedBodySize.height)},this,{single:true})}}this.onBodyResize(a,b)}this.syncShadow();Ext.Panel.superclass.onResize.call(this,g,d,c,e)},onBodyResize:function(a,b){this.fireEvent("bodyresize",this,a,b)},getToolbarHeight:function(){var a=0;if(this.rendered){Ext.each(this.toolbars,function(b){a+=b.getHeight()},this)}return a},adjustBodyHeight:function(a){return a},adjustBodyWidth:function(a){return a},onPosition:function(){this.syncShadow()},getFrameWidth:function(){var b=this.el.getFrameWidth("lr")+this.bwrap.getFrameWidth("lr");if(this.frame){var a=this.bwrap.dom.firstChild;b+=(Ext.fly(a).getFrameWidth("l")+Ext.fly(a.firstChild).getFrameWidth("r"));b+=this.mc.getFrameWidth("lr")}return b},getFrameHeight:function(){var a=Math.max(0,this.getHeight()-this.body.getHeight());if(isNaN(a)){a=0}return a},getInnerWidth:function(){return this.getSize().width-this.getFrameWidth()},getInnerHeight:function(){return this.body.getHeight()},syncShadow:function(){if(this.floating){this.el.sync(true)}},getLayoutTarget:function(){return this.body},getContentTarget:function(){return this.body},setTitle:function(b,a){this.title=b;if(this.header&&this.headerAsText){this.header.child("span").update(b)}if(a){this.setIconClass(a)}this.fireEvent("titlechange",this,b);return this},getUpdater:function(){return this.body.getUpdater()},load:function(){var a=this.body.getUpdater();a.update.apply(a,arguments);return this},beforeDestroy:function(){Ext.Panel.superclass.beforeDestroy.call(this);if(this.header){this.header.removeAllListeners()}if(this.tools){for(var a in this.tools){Ext.destroy(this.tools[a])}}if(this.toolbars.length>0){Ext.each(this.toolbars,function(b){b.un("afterlayout",this.syncHeight,this);b.un("remove",this.syncHeight,this)},this)}if(Ext.isArray(this.buttons)){while(this.buttons.length){Ext.destroy(this.buttons[0])}}if(this.rendered){Ext.destroy(this.ft,this.header,this.footer,this.tbar,this.bbar,this.body,this.mc,this.bwrap,this.dd);if(this.fbar){Ext.destroy(this.fbar,this.fbar.el)}}Ext.destroy(this.toolbars)},createClasses:function(){this.headerCls=this.baseCls+"-header";this.headerTextCls=this.baseCls+"-header-text";this.bwrapCls=this.baseCls+"-bwrap";this.tbarCls=this.baseCls+"-tbar";this.bodyCls=this.baseCls+"-body";this.bbarCls=this.baseCls+"-bbar";this.footerCls=this.baseCls+"-footer"},createGhost:function(a,e,b){var d=document.createElement("div");d.className="x-panel-ghost "+(a?a:"");if(this.header){d.appendChild(this.el.dom.firstChild.cloneNode(true))}Ext.fly(d.appendChild(document.createElement("ul"))).setHeight(this.bwrap.getHeight());d.style.width=this.el.dom.offsetWidth+"px";if(!b){this.container.dom.appendChild(d)}else{Ext.getDom(b).appendChild(d)}if(e!==false&&this.el.useShim!==false){var c=new Ext.Layer({shadow:false,useDisplay:true,constrain:false},d);c.show();return c}else{return new Ext.Element(d)}},doAutoLoad:function(){var a=this.body.getUpdater();if(this.renderer){a.setRenderer(this.renderer)}a.update(Ext.isObject(this.autoLoad)?this.autoLoad:{url:this.autoLoad})},getTool:function(a){return this.tools[a]}});Ext.reg("panel",Ext.Panel);Ext.Editor=function(b,a){if(b.field){this.field=Ext.create(b.field,"textfield");a=Ext.apply({},b);delete a.field}else{this.field=b}Ext.Editor.superclass.constructor.call(this,a)};Ext.extend(Ext.Editor,Ext.Component,{allowBlur:true,value:"",alignment:"c-c?",offsets:[0,0],shadow:"frame",constrain:false,swallowKeys:true,completeOnEnter:true,cancelOnEsc:true,updateEl:false,initComponent:function(){Ext.Editor.superclass.initComponent.call(this);this.addEvents("beforestartedit","startedit","beforecomplete","complete","canceledit","specialkey")},onRender:function(b,a){this.el=new Ext.Layer({shadow:this.shadow,cls:"x-editor",parentEl:b,shim:this.shim,shadowOffset:this.shadowOffset||4,id:this.id,constrain:this.constrain});if(this.zIndex){this.el.setZIndex(this.zIndex)}this.el.setStyle("overflow",Ext.isGecko?"auto":"hidden");if(this.field.msgTarget!="title"){this.field.msgTarget="qtip"}this.field.inEditor=true;this.mon(this.field,{scope:this,blur:this.onBlur,specialkey:this.onSpecialKey});if(this.field.grow){this.mon(this.field,"autosize",this.el.sync,this.el,{delay:1})}this.field.render(this.el).show();this.field.getEl().dom.name="";if(this.swallowKeys){this.field.el.swallowEvent(["keypress","keydown"])}},onSpecialKey:function(g,d){var b=d.getKey(),a=this.completeOnEnter&&b==d.ENTER,c=this.cancelOnEsc&&b==d.ESC;if(a||c){d.stopEvent();if(a){this.completeEdit()}else{this.cancelEdit()}if(g.triggerBlur){g.triggerBlur()}}this.fireEvent("specialkey",g,d)},startEdit:function(b,c){if(this.editing){this.completeEdit()}this.boundEl=Ext.get(b);var a=c!==undefined?c:this.boundEl.dom.innerHTML;if(!this.rendered){this.render(this.parentEl||document.body)}if(this.fireEvent("beforestartedit",this,this.boundEl,a)!==false){this.startValue=a;this.field.reset();this.field.setValue(a);this.realign(true);this.editing=true;this.show()}},doAutoSize:function(){if(this.autoSize){var b=this.boundEl.getSize(),a=this.field.getSize();switch(this.autoSize){case"width":this.setSize(b.width,a.height);break;case"height":this.setSize(a.width,b.height);break;case"none":this.setSize(a.width,a.height);break;default:this.setSize(b.width,b.height)}}},setSize:function(a,b){delete this.field.lastSize;this.field.setSize(a,b);if(this.el){if(Ext.isGecko2||Ext.isOpera){this.el.setSize(a,b)}this.el.sync()}},realign:function(a){if(a===true){this.doAutoSize()}this.el.alignTo(this.boundEl,this.alignment,this.offsets)},completeEdit:function(a){if(!this.editing){return}if(this.field.assertValue){this.field.assertValue()}var b=this.getValue();if(!this.field.isValid()){if(this.revertInvalid!==false){this.cancelEdit(a)}return}if(String(b)===String(this.startValue)&&this.ignoreNoChange){this.hideEdit(a);return}if(this.fireEvent("beforecomplete",this,b,this.startValue)!==false){b=this.getValue();if(this.updateEl&&this.boundEl){this.boundEl.update(b)}this.hideEdit(a);this.fireEvent("complete",this,b,this.startValue)}},onShow:function(){this.el.show();if(this.hideEl!==false){this.boundEl.hide()}this.field.show().focus(false,true);this.fireEvent("startedit",this.boundEl,this.startValue)},cancelEdit:function(a){if(this.editing){var b=this.getValue();this.setValue(this.startValue);this.hideEdit(a);this.fireEvent("canceledit",this,b,this.startValue)}},hideEdit:function(a){if(a!==true){this.editing=false;this.hide()}},onBlur:function(){if(this.allowBlur===true&&this.editing&&this.selectSameEditor!==true){this.completeEdit()}},onHide:function(){if(this.editing){this.completeEdit();return}this.field.blur();if(this.field.collapse){this.field.collapse()}this.el.hide();if(this.hideEl!==false){this.boundEl.show()}},setValue:function(a){this.field.setValue(a)},getValue:function(){return this.field.getValue()},beforeDestroy:function(){Ext.destroyMembers(this,"field");delete this.parentEl;delete this.boundEl}});Ext.reg("editor",Ext.Editor);Ext.ColorPalette=Ext.extend(Ext.Component,{itemCls:"x-color-palette",value:null,clickEvent:"click",ctype:"Ext.ColorPalette",allowReselect:false,colors:["000000","993300","333300","003300","003366","000080","333399","333333","800000","FF6600","808000","008000","008080","0000FF","666699","808080","FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","969696","FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0","FF99CC","FFCC99","FFFF99","CCFFCC","CCFFFF","99CCFF","CC99FF","FFFFFF"],initComponent:function(){Ext.ColorPalette.superclass.initComponent.call(this);this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope,true)}},onRender:function(b,a){this.autoEl={tag:"div",cls:this.itemCls};Ext.ColorPalette.superclass.onRender.call(this,b,a);var c=this.tpl||new Ext.XTemplate(' ');c.overwrite(this.el,this.colors);this.mon(this.el,this.clickEvent,this.handleClick,this,{delegate:"a"});if(this.clickEvent!="click"){this.mon(this.el,"click",Ext.emptyFn,this,{delegate:"a",preventDefault:true})}},afterRender:function(){Ext.ColorPalette.superclass.afterRender.call(this);if(this.value){var a=this.value;this.value=null;this.select(a,true)}},handleClick:function(b,a){b.preventDefault();if(!this.disabled){var d=a.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];this.select(d.toUpperCase())}},select:function(b,a){b=b.replace("#","");if(b!=this.value||this.allowReselect){var c=this.el;if(this.value){c.child("a.color-"+this.value).removeClass("x-color-palette-sel")}c.child("a.color-"+b).addClass("x-color-palette-sel");this.value=b;if(a!==true){this.fireEvent("select",this,b)}}}});Ext.reg("colorpalette",Ext.ColorPalette);Ext.DatePicker=Ext.extend(Ext.BoxComponent,{todayText:"Today",okText:" OK ",cancelText:"Cancel",todayTip:"{0} (Spacebar)",minText:"This date is before the minimum date",maxText:"This date is after the maximum date",format:"m/d/y",disabledDaysText:"Disabled",disabledDatesText:"Disabled",monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:"Next Month (Control+Right)",prevText:"Previous Month (Control+Left)",monthYearText:"Choose a month (Control+Up/Down to move years)",startDay:0,showToday:true,focusOnSelect:true,initHour:12,initComponent:function(){Ext.DatePicker.superclass.initComponent.call(this);this.value=this.value?this.value.clearTime(true):new Date().clearTime();this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope||this)}this.initDisabledDays()},initDisabledDays:function(){if(!this.disabledDatesRE&&this.disabledDates){var b=this.disabledDates,a=b.length-1,c="(?:";Ext.each(b,function(g,e){c+=Ext.isDate(g)?"^"+Ext.escapeRe(g.dateFormat(this.format))+"$":b[e];if(e!=a){c+="|"}},this);this.disabledDatesRE=new RegExp(c+")")}},setDisabledDates:function(a){if(Ext.isArray(a)){this.disabledDates=a;this.disabledDatesRE=null}else{this.disabledDatesRE=a}this.initDisabledDays();this.update(this.value,true)},setDisabledDays:function(a){this.disabledDays=a;this.update(this.value,true)},setMinDate:function(a){this.minDate=a;this.update(this.value,true)},setMaxDate:function(a){this.maxDate=a;this.update(this.value,true)},setValue:function(a){this.value=a.clearTime(true);this.update(this.value)},getValue:function(){return this.value},focus:function(){this.update(this.activeDate)},onEnable:function(a){Ext.DatePicker.superclass.onEnable.call(this);this.doDisabled(false);this.update(a?this.value:this.activeDate);if(Ext.isIE){this.el.repaint()}},onDisable:function(){Ext.DatePicker.superclass.onDisable.call(this);this.doDisabled(true);if(Ext.isIE&&!Ext.isIE8){Ext.each([].concat(this.textNodes,this.el.query("th span")),function(a){Ext.fly(a).repaint()})}},doDisabled:function(a){this.keyNav.setDisabled(a);this.prevRepeater.setDisabled(a);this.nextRepeater.setDisabled(a);if(this.showToday){this.todayKeyListener.setDisabled(a);this.todayBtn.setDisabled(a)}},onRender:function(e,b){var a=['','','",this.showToday?'':"",'
      
    '],c=this.dayNames,h;for(h=0;h<7;h++){var k=this.startDay+h;if(k>6){k=k-7}a.push("")}a[a.length]="";for(h=0;h<42;h++){if(h%7===0&&h!==0){a[a.length]=""}a[a.length]=''}a.push("
    ",c[k].substr(0,1),"
    ');var j=document.createElement("div");j.className="x-date-picker";j.innerHTML=a.join("");e.dom.insertBefore(j,b);this.el=Ext.get(j);this.eventEl=Ext.get(j.firstChild);this.prevRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-left a"),{handler:this.showPrevMonth,scope:this,preventDefault:true,stopDefault:true});this.nextRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-right a"),{handler:this.showNextMonth,scope:this,preventDefault:true,stopDefault:true});this.monthPicker=this.el.down("div.x-date-mp");this.monthPicker.enableDisplayMode("block");this.keyNav=new Ext.KeyNav(this.eventEl,{left:function(d){if(d.ctrlKey){this.showPrevMonth()}else{this.update(this.activeDate.add("d",-1))}},right:function(d){if(d.ctrlKey){this.showNextMonth()}else{this.update(this.activeDate.add("d",1))}},up:function(d){if(d.ctrlKey){this.showNextYear()}else{this.update(this.activeDate.add("d",-7))}},down:function(d){if(d.ctrlKey){this.showPrevYear()}else{this.update(this.activeDate.add("d",7))}},pageUp:function(d){this.showNextMonth()},pageDown:function(d){this.showPrevMonth()},enter:function(d){d.stopPropagation();return true},scope:this});this.el.unselectable();this.cells=this.el.select("table.x-date-inner tbody td");this.textNodes=this.el.query("table.x-date-inner tbody span");this.mbtn=new Ext.Button({text:" ",tooltip:this.monthYearText,renderTo:this.el.child("td.x-date-middle",true)});this.mbtn.el.child("em").addClass("x-btn-arrow");if(this.showToday){this.todayKeyListener=this.eventEl.addKeyListener(Ext.EventObject.SPACE,this.selectToday,this);var g=(new Date()).dateFormat(this.format);this.todayBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom",true),text:String.format(this.todayText,g),tooltip:String.format(this.todayTip,g),handler:this.selectToday,scope:this})}this.mon(this.eventEl,"mousewheel",this.handleMouseWheel,this);this.mon(this.eventEl,"click",this.handleDateClick,this,{delegate:"a.x-date-date"});this.mon(this.mbtn,"click",this.showMonthPicker,this);this.onEnable(true)},createMonthPicker:function(){if(!this.monthPicker.dom.firstChild){var a=[''];for(var b=0;b<6;b++){a.push('",'",b===0?'':'')}a.push('","
    ',Date.getShortMonthName(b),"',Date.getShortMonthName(b+6),"
    ");this.monthPicker.update(a.join(""));this.mon(this.monthPicker,"click",this.onMonthClick,this);this.mon(this.monthPicker,"dblclick",this.onMonthDblClick,this);this.mpMonths=this.monthPicker.select("td.x-date-mp-month");this.mpYears=this.monthPicker.select("td.x-date-mp-year");this.mpMonths.each(function(c,d,e){e+=1;if((e%2)===0){c.dom.xmonth=5+Math.round(e*0.5)}else{c.dom.xmonth=Math.round((e-1)*0.5)}})}},showMonthPicker:function(){if(!this.disabled){this.createMonthPicker();var a=this.el.getSize();this.monthPicker.setSize(a);this.monthPicker.child("table").setSize(a);this.mpSelMonth=(this.activeDate||this.value).getMonth();this.updateMPMonth(this.mpSelMonth);this.mpSelYear=(this.activeDate||this.value).getFullYear();this.updateMPYear(this.mpSelYear);this.monthPicker.slideIn("t",{duration:0.2})}},updateMPYear:function(e){this.mpyear=e;var c=this.mpYears.elements;for(var b=1;b<=10;b++){var d=c[b-1],a;if((b%2)===0){a=e+Math.round(b*0.5);d.firstChild.innerHTML=a;d.xyear=a}else{a=e-(5-Math.round(b*0.5));d.firstChild.innerHTML=a;d.xyear=a}this.mpYears.item(b-1)[a==this.mpSelYear?"addClass":"removeClass"]("x-date-mp-sel")}},updateMPMonth:function(a){this.mpMonths.each(function(b,c,d){b[b.dom.xmonth==a?"addClass":"removeClass"]("x-date-mp-sel")})},selectMPMonth:function(a){},onMonthClick:function(g,b){g.stopEvent();var c=new Ext.Element(b),a;if(c.is("button.x-date-mp-cancel")){this.hideMonthPicker()}else{if(c.is("button.x-date-mp-ok")){var h=new Date(this.mpSelYear,this.mpSelMonth,(this.activeDate||this.value).getDate());if(h.getMonth()!=this.mpSelMonth){h=new Date(this.mpSelYear,this.mpSelMonth,1).getLastDateOfMonth()}this.update(h);this.hideMonthPicker()}else{if((a=c.up("td.x-date-mp-month",2))){this.mpMonths.removeClass("x-date-mp-sel");a.addClass("x-date-mp-sel");this.mpSelMonth=a.dom.xmonth}else{if((a=c.up("td.x-date-mp-year",2))){this.mpYears.removeClass("x-date-mp-sel");a.addClass("x-date-mp-sel");this.mpSelYear=a.dom.xyear}else{if(c.is("a.x-date-mp-prev")){this.updateMPYear(this.mpyear-10)}else{if(c.is("a.x-date-mp-next")){this.updateMPYear(this.mpyear+10)}}}}}}},onMonthDblClick:function(d,b){d.stopEvent();var c=new Ext.Element(b),a;if((a=c.up("td.x-date-mp-month",2))){this.update(new Date(this.mpSelYear,a.dom.xmonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}else{if((a=c.up("td.x-date-mp-year",2))){this.update(new Date(a.dom.xyear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}}},hideMonthPicker:function(a){if(this.monthPicker){if(a===true){this.monthPicker.hide()}else{this.monthPicker.slideOut("t",{duration:0.2})}}},showPrevMonth:function(a){this.update(this.activeDate.add("mo",-1))},showNextMonth:function(a){this.update(this.activeDate.add("mo",1))},showPrevYear:function(){this.update(this.activeDate.add("y",-1))},showNextYear:function(){this.update(this.activeDate.add("y",1))},handleMouseWheel:function(a){a.stopEvent();if(!this.disabled){var b=a.getWheelDelta();if(b>0){this.showPrevMonth()}else{if(b<0){this.showNextMonth()}}}},handleDateClick:function(b,a){b.stopEvent();if(!this.disabled&&a.dateValue&&!Ext.fly(a.parentNode).hasClass("x-date-disabled")){this.cancelFocus=this.focusOnSelect===false;this.setValue(new Date(a.dateValue));delete this.cancelFocus;this.fireEvent("select",this,this.value)}},selectToday:function(){if(this.todayBtn&&!this.todayBtn.disabled){this.setValue(new Date().clearTime());this.fireEvent("select",this,this.value)}},update:function(G,A){if(this.rendered){var a=this.activeDate,p=this.isVisible();this.activeDate=G;if(!A&&a&&this.el){var o=G.getTime();if(a.getMonth()==G.getMonth()&&a.getFullYear()==G.getFullYear()){this.cells.removeClass("x-date-selected");this.cells.each(function(d){if(d.dom.firstChild.dateValue==o){d.addClass("x-date-selected");if(p&&!this.cancelFocus){Ext.fly(d.dom.firstChild).focus(50)}return false}},this);return}}var k=G.getDaysInMonth(),q=G.getFirstDateOfMonth(),g=q.getDay()-this.startDay;if(g<0){g+=7}k+=g;var B=G.add("mo",-1),h=B.getDaysInMonth()-g,e=this.cells.elements,r=this.textNodes,D=(new Date(B.getFullYear(),B.getMonth(),h,this.initHour)),C=new Date().clearTime().getTime(),v=G.clearTime(true).getTime(),u=this.minDate?this.minDate.clearTime(true):Number.NEGATIVE_INFINITY,y=this.maxDate?this.maxDate.clearTime(true):Number.POSITIVE_INFINITY,F=this.disabledDatesRE,s=this.disabledDatesText,I=this.disabledDays?this.disabledDays.join(""):false,E=this.disabledDaysText,z=this.format;if(this.showToday){var m=new Date().clearTime(),c=(my||(F&&z&&F.test(m.dateFormat(z)))||(I&&I.indexOf(m.getDay())!=-1));if(!this.disabled){this.todayBtn.setDisabled(c);this.todayKeyListener[c?"disable":"enable"]()}}var l=function(J,d){d.title="";var i=D.clearTime(true).getTime();d.firstChild.dateValue=i;if(i==C){d.className+=" x-date-today";d.title=J.todayText}if(i==v){d.className+=" x-date-selected";if(p){Ext.fly(d.firstChild).focus(50)}}if(iy){d.className=" x-date-disabled";d.title=J.maxText;return}if(I){if(I.indexOf(D.getDay())!=-1){d.title=E;d.className=" x-date-disabled"}}if(F&&z){var w=D.dateFormat(z);if(F.test(w)){d.title=s.replace("%0",w);d.className=" x-date-disabled"}}};var x=0;for(;x=a.value){d=a.value}}c.setValue(b,d,false);c.fireEvent("drag",c,g,this)},getNewValue:function(){var a=this.slider,b=a.innerEl.translatePoints(this.tracker.getXY());return Ext.util.Format.round(a.reverseValue(b.left),a.decimalPrecision)},onDragEnd:function(c){var a=this.slider,b=this.value;this.el.removeClass("x-slider-thumb-drag");this.dragging=false;a.fireEvent("dragend",a,c);if(this.dragStartValue!=b){a.fireEvent("changecomplete",a,b,this)}}});Ext.slider.MultiSlider=Ext.extend(Ext.BoxComponent,{vertical:false,minValue:0,maxValue:100,decimalPrecision:0,keyIncrement:1,increment:0,clickRange:[5,15],clickToChange:true,animate:true,dragging:false,constrainThumbs:true,topThumbZIndex:10000,initComponent:function(){if(!Ext.isDefined(this.value)){this.value=this.minValue}this.thumbs=[];Ext.slider.MultiSlider.superclass.initComponent.call(this);this.keyIncrement=Math.max(this.increment,this.keyIncrement);this.addEvents("beforechange","change","changecomplete","dragstart","drag","dragend");if(this.values==undefined||Ext.isEmpty(this.values)){this.values=[0]}var a=this.values;for(var b=0;bthis.clickRange[0]&&c.top=c){d+=c}else{if(a*2<-c){d-=c}}}return d.constrain(this.minValue,this.maxValue)},afterRender:function(){Ext.slider.MultiSlider.superclass.afterRender.apply(this,arguments);for(var c=0;ce?e:c.value}this.syncThumb()},setValue:function(d,c,b,g){var a=this.thumbs[d],e=a.el;c=this.normalizeValue(c);if(c!==a.value&&this.fireEvent("beforechange",this,c,a.value,a)!==false){a.value=c;if(this.rendered){this.moveThumb(d,this.translateValue(c),b!==false);this.fireEvent("change",this,c,a);if(g){this.fireEvent("changecomplete",this,c,a)}}}},translateValue:function(a){var b=this.getRatio();return(a*b)-(this.minValue*b)-this.halfThumb},reverseValue:function(b){var a=this.getRatio();return(b+(this.minValue*a))/a},moveThumb:function(d,c,b){var a=this.thumbs[d].el;if(!b||this.animate===false){a.setLeft(c)}else{a.shift({left:c,stopFx:true,duration:0.35})}},focus:function(){this.focusEl.focus(10)},onResize:function(c,e){var b=this.thumbs,a=b.length,d=0;for(;dthis.clickRange[0]&&c.left','
    ','
    ','
    ',"
     
    ","
    ","
    ",'
    ',"
     
    ","
    ","
    ","");this.el=a?c.insertBefore(a,{cls:this.baseCls},true):c.append(d,{cls:this.baseCls},true);if(this.id){this.el.dom.id=this.id}var b=this.el.dom.firstChild;this.progressBar=Ext.get(b.firstChild);if(this.textEl){this.textEl=Ext.get(this.textEl);delete this.textTopEl}else{this.textTopEl=Ext.get(this.progressBar.dom.firstChild);var e=Ext.get(b.childNodes[1]);this.textTopEl.setStyle("z-index",99).addClass("x-hidden");this.textEl=new Ext.CompositeElement([this.textTopEl.dom.firstChild,e.dom.firstChild]);this.textEl.setWidth(b.offsetWidth)}this.progressBar.setHeight(b.offsetHeight)},afterRender:function(){Ext.ProgressBar.superclass.afterRender.call(this);if(this.value){this.updateProgress(this.value,this.text)}else{this.updateText(this.text)}},updateProgress:function(c,d,b){this.value=c||0;if(d){this.updateText(d)}if(this.rendered&&!this.isDestroyed){var a=Math.floor(c*this.el.dom.firstChild.offsetWidth);this.progressBar.setWidth(a,b===true||(b!==false&&this.animate));if(this.textTopEl){this.textTopEl.removeClass("x-hidden").setWidth(a)}}this.fireEvent("update",this,c,d);return this},wait:function(b){if(!this.waitTimer){var a=this;b=b||{};this.updateText(b.text);this.waitTimer=Ext.TaskMgr.start({run:function(c){var d=b.increment||10;c-=1;this.updateProgress(((((c+d)%d)+1)*(100/d))*0.01,null,b.animate)},interval:b.interval||1000,duration:b.duration,onStop:function(){if(b.fn){b.fn.apply(b.scope||this)}this.reset()},scope:a})}return this},isWaiting:function(){return this.waitTimer!==null},updateText:function(a){this.text=a||" ";if(this.rendered){this.textEl.update(this.text)}return this},syncProgressBar:function(){if(this.value){this.updateProgress(this.value,this.text)}return this},setSize:function(a,c){Ext.ProgressBar.superclass.setSize.call(this,a,c);if(this.textTopEl){var b=this.el.dom.firstChild;this.textEl.setSize(b.offsetWidth,b.offsetHeight)}this.syncProgressBar();return this},reset:function(a){this.updateProgress(0);if(this.textTopEl){this.textTopEl.addClass("x-hidden")}this.clearTimer();if(a===true){this.hide()}return this},clearTimer:function(){if(this.waitTimer){this.waitTimer.onStop=null;Ext.TaskMgr.stop(this.waitTimer);this.waitTimer=null}},onDestroy:function(){this.clearTimer();if(this.rendered){if(this.textEl.isComposite){this.textEl.clear()}Ext.destroyMembers(this,"textEl","progressBar","textTopEl")}Ext.ProgressBar.superclass.onDestroy.call(this)}});Ext.reg("progress",Ext.ProgressBar);(function(){var a=Ext.EventManager;var b=Ext.lib.Dom;Ext.dd.DragDrop=function(e,c,d){if(e){this.init(e,c,d)}};Ext.dd.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true},moveOnly:false,unlock:function(){this.locked=false},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(c,d){},startDrag:function(c,d){},b4Drag:function(c){},onDrag:function(c){},onDragEnter:function(c,d){},b4DragOver:function(c){},onDragOver:function(c,d){},b4DragOut:function(c){},onDragOut:function(c,d){},b4DragDrop:function(c){},onDragDrop:function(c,d){},onInvalidDrop:function(c){},b4EndDrag:function(c){},endDrag:function(c){},b4MouseDown:function(c){},onMouseDown:function(c){},onMouseUp:function(c){},onAvailable:function(){},defaultPadding:{left:0,right:0,top:0,bottom:0},constrainTo:function(j,h,o){if(Ext.isNumber(h)){h={left:h,right:h,top:h,bottom:h}}h=h||this.defaultPadding;var l=Ext.get(this.getEl()).getBox(),d=Ext.get(j),n=d.getScroll(),k,e=d.dom;if(e==document.body){k={x:n.left,y:n.top,width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()}}else{var m=d.getXY();k={x:m[0],y:m[1],width:e.clientWidth,height:e.clientHeight}}var i=l.y-k.y,g=l.x-k.x;this.resetConstraints();this.setXConstraint(g-(h.left||0),k.width-g-l.width-(h.right||0),this.xTickSize);this.setYConstraint(i-(h.top||0),k.height-i-l.height-(h.bottom||0),this.yTickSize)},getEl:function(){if(!this._domRef){this._domRef=Ext.getDom(this.id)}return this._domRef},getDragEl:function(){return Ext.getDom(this.dragElId)},init:function(e,c,d){this.initTarget(e,c,d);a.on(this.id,"mousedown",this.handleMouseDown,this)},initTarget:function(e,c,d){this.config=d||{};this.DDM=Ext.dd.DDM;this.groups={};if(typeof e!=="string"){e=Ext.id(e)}this.id=e;this.addToGroup((c)?c:"default");this.handleElId=e;this.setDragElId(e);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();this.handleOnAvailable()},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false)},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable()},setPadding:function(e,c,g,d){if(!c&&0!==c){this.padding=[e,e,e,e]}else{if(!g&&0!==g){this.padding=[e,c,e,c]}else{this.padding=[e,c,g,d]}}},setInitPosition:function(g,e){var h=this.getEl();if(!this.DDM.verifyEl(h)){return}var d=g||0;var c=e||0;var i=b.getXY(h);this.initPageX=i[0]-d;this.initPageY=i[1]-c;this.lastPageX=i[0];this.lastPageY=i[1];this.setStartPosition(i)},setStartPosition:function(d){var c=d||b.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=c[0];this.startPageY=c[1]},addToGroup:function(c){this.groups[c]=true;this.DDM.regDragDrop(this,c)},removeFromGroup:function(c){if(this.groups[c]){delete this.groups[c]}this.DDM.removeDDFromGroup(this,c)},setDragElId:function(c){this.dragElId=c},setHandleElId:function(c){if(typeof c!=="string"){c=Ext.id(c)}this.handleElId=c;this.DDM.regHandle(this.id,c)},setOuterHandleElId:function(c){if(typeof c!=="string"){c=Ext.id(c)}a.on(c,"mousedown",this.handleMouseDown,this);this.setHandleElId(c);this.hasOuterHandles=true},unreg:function(){a.un(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this)},destroy:function(){this.unreg()},isLocked:function(){return(this.DDM.isLocked()||this.locked)},handleMouseDown:function(g,d){if(this.primaryButtonOnly&&g.button!=0){return}if(this.isLocked()){return}this.DDM.refreshCache(this.groups);var c=new Ext.lib.Point(Ext.lib.Event.getPageX(g),Ext.lib.Event.getPageY(g));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(c,this)){}else{if(this.clickValidator(g)){this.setStartPosition();this.b4MouseDown(g);this.onMouseDown(g);this.DDM.handleMouseDown(g,this);this.DDM.stopEvent(g)}else{}}},clickValidator:function(d){var c=d.getTarget();return(this.isValidHandleChild(c)&&(this.id==this.handleElId||this.DDM.handleWasClicked(c,this.id)))},addInvalidHandleType:function(c){var d=c.toUpperCase();this.invalidHandleTypes[d]=d},addInvalidHandleId:function(c){if(typeof c!=="string"){c=Ext.id(c)}this.invalidHandleIds[c]=c},addInvalidHandleClass:function(c){this.invalidHandleClasses.push(c)},removeInvalidHandleType:function(c){var d=c.toUpperCase();delete this.invalidHandleTypes[d]},removeInvalidHandleId:function(c){if(typeof c!=="string"){c=Ext.id(c)}delete this.invalidHandleIds[c]},removeInvalidHandleClass:function(d){for(var e=0,c=this.invalidHandleClasses.length;e=this.minX;d=d-c){if(!e[d]){this.xTicks[this.xTicks.length]=d;e[d]=true}}for(d=this.initPageX;d<=this.maxX;d=d+c){if(!e[d]){this.xTicks[this.xTicks.length]=d;e[d]=true}}this.xTicks.sort(this.DDM.numericSort)},setYTicks:function(g,c){this.yTicks=[];this.yTickSize=c;var e={};for(var d=this.initPageY;d>=this.minY;d=d-c){if(!e[d]){this.yTicks[this.yTicks.length]=d;e[d]=true}}for(d=this.initPageY;d<=this.maxY;d=d+c){if(!e[d]){this.yTicks[this.yTicks.length]=d;e[d]=true}}this.yTicks.sort(this.DDM.numericSort)},setXConstraint:function(e,d,c){this.leftConstraint=e;this.rightConstraint=d;this.minX=this.initPageX-e;this.maxX=this.initPageX+d;if(c){this.setXTicks(this.initPageX,c)}this.constrainX=true},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks()},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0},setYConstraint:function(c,e,d){this.topConstraint=c;this.bottomConstraint=e;this.minY=this.initPageY-c;this.maxY=this.initPageY+e;if(d){this.setYTicks(this.initPageY,d)}this.constrainY=true},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var d=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var c=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(d,c)}else{this.setInitPosition()}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize)}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize)}},getTick:function(k,g){if(!g){return k}else{if(g[0]>=k){return g[0]}else{for(var d=0,c=g.length;d=k){var j=k-g[d];var h=g[e]-k;return(h>j)?g[d]:g[e]}}return g[g.length-1]}}},toString:function(){return("DragDrop "+this.id)}}})();if(!Ext.dd.DragDropMgr){Ext.dd.DragDropMgr=function(){var a=Ext.EventManager;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,init:function(){this.initialized=true},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(d,c){for(var e in this.ids){for(var b in this.ids[e]){var g=this.ids[e][b];if(!this.isTypeOfDD(g)){continue}g[d].apply(g,c)}}},_onLoad:function(){this.init();a.on(document,"mouseup",this.handleMouseUp,this,true);a.on(document,"mousemove",this.handleMouseMove,this,true);a.on(window,"unload",this._onUnload,this,true);a.on(window,"resize",this._onResize,this,true)},_onResize:function(b){this._execOnAll("resetConstraints",[])},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){return this.locked},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:350,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(c,b){if(!this.initialized){this.init()}if(!this.ids[b]){this.ids[b]={}}this.ids[b][c.id]=c},removeDDFromGroup:function(d,b){if(!this.ids[b]){this.ids[b]={}}var c=this.ids[b];if(c&&c[d.id]){delete c[d.id]}},_remove:function(c){for(var b in c.groups){if(b&&this.ids[b]&&this.ids[b][c.id]){delete this.ids[b][c.id]}}delete this.handleIds[c.id]},regHandle:function(c,b){if(!this.handleIds[c]){this.handleIds[c]={}}this.handleIds[c][b]=b},isDragDrop:function(b){return(this.getDDById(b))?true:false},getRelated:function(h,c){var g=[];for(var e in h.groups){for(var d in this.ids[e]){var b=this.ids[e][d];if(!this.isTypeOfDD(b)){continue}if(!c||b.isTarget){g[g.length]=b}}}return g},isLegalTarget:function(g,e){var c=this.getRelated(g,true);for(var d=0,b=c.length;dthis.clickPixelThresh||b>this.clickPixelThresh){this.startDrag(this.startX,this.startY)}}if(this.dragThreshMet){this.dragCurrent.b4Drag(d);this.dragCurrent.onDrag(d);if(!this.dragCurrent.moveOnly){this.fireEvents(d,false)}}this.stopEvent(d);return true},fireEvents:function(n,o){var q=this.dragCurrent;if(!q||q.isLocked()){return}var r=n.getPoint();var b=[];var g=[];var l=[];var j=[];var d=[];for(var h in this.dragOvers){var c=this.dragOvers[h];if(!this.isTypeOfDD(c)){continue}if(!this.isOverTarget(r,c,this.mode)){g.push(c)}b[h]=true;delete this.dragOvers[h]}for(var p in q.groups){if("string"!=typeof p){continue}for(h in this.ids[p]){var k=this.ids[p][h];if(!this.isTypeOfDD(k)){continue}if(k.isTarget&&!k.isLocked()&&((k!=q)||(q.ignoreSelf===false))){if(this.isOverTarget(r,k,this.mode)){if(o){j.push(k)}else{if(!b[k.id]){d.push(k)}else{l.push(k)}this.dragOvers[k.id]=k}}}}}if(this.mode){if(g.length){q.b4DragOut(n,g);q.onDragOut(n,g)}if(d.length){q.onDragEnter(n,d)}if(l.length){q.b4DragOver(n,l);q.onDragOver(n,l)}if(j.length){q.b4DragDrop(n,j);q.onDragDrop(n,j)}}else{var m=0;for(h=0,m=g.length;h2000){}else{setTimeout(b._addListeners,10);if(document&&document.body){b._timeoutCount+=1}}}},handleWasClicked:function(b,d){if(this.isHandle(d,b.id)){return true}else{var c=b.parentNode;while(c){if(this.isHandle(d,c.id)){return true}else{c=c.parentNode}}}return false}}}();Ext.dd.DDM=Ext.dd.DragDropMgr;Ext.dd.DDM._addListeners()}Ext.dd.DD=function(c,a,b){if(c){this.init(c,a,b)}};Ext.extend(Ext.dd.DD,Ext.dd.DragDrop,{scroll:true,autoOffset:function(c,b){var a=c-this.startPageX;var d=b-this.startPageY;this.setDelta(a,d)},setDelta:function(b,a){this.deltaX=b;this.deltaY=a},setDragElPos:function(c,b){var a=this.getDragEl();this.alignElWithMouse(a,c,b)},alignElWithMouse:function(c,h,g){var e=this.getTargetCoord(h,g);var b=c.dom?c:Ext.fly(c,"_dd");if(!this.deltaSetXY){var i=[e.x,e.y];b.setXY(i);var d=b.getLeft(true);var a=b.getTop(true);this.deltaSetXY=[d-e.x,a-e.y]}else{b.setLeftTop(e.x+this.deltaSetXY[0],e.y+this.deltaSetXY[1])}this.cachePosition(e.x,e.y);this.autoScroll(e.x,e.y,c.offsetHeight,c.offsetWidth);return e},cachePosition:function(b,a){if(b){this.lastPageX=b;this.lastPageY=a}else{var c=Ext.lib.Dom.getXY(this.getEl());this.lastPageX=c[0];this.lastPageY=c[1]}},autoScroll:function(l,k,e,m){if(this.scroll){var n=Ext.lib.Dom.getViewHeight();var b=Ext.lib.Dom.getViewWidth();var p=this.DDM.getScrollTop();var d=this.DDM.getScrollLeft();var j=e+k;var o=m+l;var i=(n+p-k-this.deltaY);var g=(b+d-l-this.deltaX);var c=40;var a=(document.all)?80:30;if(j>n&&i0&&k-pb&&g0&&l-dthis.maxX){a=this.maxX}}if(this.constrainY){if(dthis.maxY){d=this.maxY}}a=this.getTick(a,this.xTicks);d=this.getTick(d,this.yTicks);return{x:a,y:d}},applyConfig:function(){Ext.dd.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false)},b4MouseDown:function(a){this.autoOffset(a.getPageX(),a.getPageY())},b4Drag:function(a){this.setDragElPos(a.getPageX(),a.getPageY())},toString:function(){return("DD "+this.id)}});Ext.dd.DDProxy=function(c,a,b){if(c){this.init(c,a,b);this.initFrame()}};Ext.dd.DDProxy.dragElId="ygddfdiv";Ext.extend(Ext.dd.DDProxy,Ext.dd.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var b=this;var a=document.body;if(!a||!a.firstChild){setTimeout(function(){b.createFrame()},50);return}var d=this.getDragEl();if(!d){d=document.createElement("div");d.id=this.dragElId;var c=d.style;c.position="absolute";c.visibility="hidden";c.cursor="move";c.border="2px solid #aaa";c.zIndex=999;a.insertBefore(d,a.firstChild)}},initFrame:function(){this.createFrame()},applyConfig:function(){Ext.dd.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||Ext.dd.DDProxy.dragElId)},showFrame:function(e,d){var c=this.getEl();var a=this.getDragEl();var b=a.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(b.width,10)/2),Math.round(parseInt(b.height,10)/2))}this.setDragElPos(e,d);Ext.fly(a).show()},_resizeProxy:function(){if(this.resizeFrame){var a=this.getEl();Ext.fly(this.getDragEl()).setSize(a.offsetWidth,a.offsetHeight)}},b4MouseDown:function(b){var a=b.getPageX();var c=b.getPageY();this.autoOffset(a,c);this.setDragElPos(a,c)},b4StartDrag:function(a,b){this.showFrame(a,b)},b4EndDrag:function(a){Ext.fly(this.getDragEl()).hide()},endDrag:function(c){var b=this.getEl();var a=this.getDragEl();a.style.visibility="";this.beforeMove();b.style.visibility="hidden";Ext.dd.DDM.moveToEl(b,a);a.style.visibility="hidden";b.style.visibility="";this.afterDrag()},beforeMove:function(){},afterDrag:function(){},toString:function(){return("DDProxy "+this.id)}});Ext.dd.DDTarget=function(c,a,b){if(c){this.initTarget(c,a,b)}};Ext.extend(Ext.dd.DDTarget,Ext.dd.DragDrop,{getDragEl:Ext.emptyFn,isValidHandleChild:Ext.emptyFn,startDrag:Ext.emptyFn,endDrag:Ext.emptyFn,onDrag:Ext.emptyFn,onDragDrop:Ext.emptyFn,onDragEnter:Ext.emptyFn,onDragOut:Ext.emptyFn,onDragOver:Ext.emptyFn,onInvalidDrop:Ext.emptyFn,onMouseDown:Ext.emptyFn,onMouseUp:Ext.emptyFn,setXConstraint:Ext.emptyFn,setYConstraint:Ext.emptyFn,resetConstraints:Ext.emptyFn,clearConstraints:Ext.emptyFn,clearTicks:Ext.emptyFn,setInitPosition:Ext.emptyFn,setDragElId:Ext.emptyFn,setHandleElId:Ext.emptyFn,setOuterHandleElId:Ext.emptyFn,addInvalidHandleClass:Ext.emptyFn,addInvalidHandleId:Ext.emptyFn,addInvalidHandleType:Ext.emptyFn,removeInvalidHandleClass:Ext.emptyFn,removeInvalidHandleId:Ext.emptyFn,removeInvalidHandleType:Ext.emptyFn,toString:function(){return("DDTarget "+this.id)}});Ext.dd.DragTracker=Ext.extend(Ext.util.Observable,{active:false,tolerance:5,autoStart:false,constructor:function(a){Ext.apply(this,a);this.addEvents("mousedown","mouseup","mousemove","dragstart","dragend","drag");this.dragRegion=new Ext.lib.Region(0,0,0,0);if(this.el){this.initEl(this.el)}Ext.dd.DragTracker.superclass.constructor.call(this,a)},initEl:function(a){this.el=Ext.get(a);a.on("mousedown",this.onMouseDown,this,this.delegate?{delegate:this.delegate}:undefined)},destroy:function(){this.el.un("mousedown",this.onMouseDown,this)},onMouseDown:function(c,b){if(this.fireEvent("mousedown",this,c)!==false&&this.onBeforeStart(c)!==false){this.startXY=this.lastXY=c.getXY();this.dragTarget=this.delegate?b:this.el.dom;if(this.preventDefault!==false){c.preventDefault()}var a=Ext.getDoc();a.on("mouseup",this.onMouseUp,this);a.on("mousemove",this.onMouseMove,this);a.on("selectstart",this.stopSelect,this);if(this.autoStart){this.timer=this.triggerStart.defer(this.autoStart===true?1000:this.autoStart,this)}}},onMouseMove:function(d,c){if(this.active&&Ext.isIE&&!d.browserEvent.button){d.preventDefault();this.onMouseUp(d);return}d.preventDefault();var b=d.getXY(),a=this.startXY;this.lastXY=b;if(!this.active){if(Math.abs(a[0]-b[0])>this.tolerance||Math.abs(a[1]-b[1])>this.tolerance){this.triggerStart()}else{return}}this.fireEvent("mousemove",this,d);this.onDrag(d);this.fireEvent("drag",this,d)},onMouseUp:function(c){var b=Ext.getDoc();b.un("mousemove",this.onMouseMove,this);b.un("mouseup",this.onMouseUp,this);b.un("selectstart",this.stopSelect,this);c.preventDefault();this.clearStart();var a=this.active;this.active=false;delete this.elRegion;this.fireEvent("mouseup",this,c);if(a){this.onEnd(c);this.fireEvent("dragend",this,c)}},triggerStart:function(a){this.clearStart();this.active=true;this.onStart(this.startXY);this.fireEvent("dragstart",this,this.startXY)},clearStart:function(){if(this.timer){clearTimeout(this.timer);delete this.timer}},stopSelect:function(a){a.stopEvent();return false},onBeforeStart:function(a){},onStart:function(a){},onDrag:function(a){},onEnd:function(a){},getDragTarget:function(){return this.dragTarget},getDragCt:function(){return this.el},getXY:function(a){return a?this.constrainModes[a].call(this,this.lastXY):this.lastXY},getOffset:function(c){var b=this.getXY(c);var a=this.startXY;return[a[0]-b[0],a[1]-b[1]]},constrainModes:{point:function(b){if(!this.elRegion){this.elRegion=this.getDragCt().getRegion()}var a=this.dragRegion;a.left=b[0];a.top=b[1];a.right=b[0];a.bottom=b[1];a.constrainTo(this.elRegion);return[a.left,a.top]}}});Ext.dd.ScrollManager=function(){var c=Ext.dd.DragDropMgr;var e={};var b=null;var i={};var h=function(l){b=null;a()};var j=function(){if(c.dragCurrent){c.refreshCache(c.dragCurrent.groups)}};var d=function(){if(c.dragCurrent){var l=Ext.dd.ScrollManager;var m=i.el.ddScrollConfig?i.el.ddScrollConfig.increment:l.increment;if(!l.animate){if(i.el.scroll(i.dir,m)){j()}}else{i.el.scroll(i.dir,m,true,l.animDuration,j)}}};var a=function(){if(i.id){clearInterval(i.id)}i.id=0;i.el=null;i.dir=""};var g=function(m,l){a();i.el=m;i.dir=l;var n=(m.ddScrollConfig&&m.ddScrollConfig.frequency)?m.ddScrollConfig.frequency:Ext.dd.ScrollManager.frequency;i.id=setInterval(d,n)};var k=function(o,q){if(q||!c.dragCurrent){return}var s=Ext.dd.ScrollManager;if(!b||b!=c.dragCurrent){b=c.dragCurrent;s.refreshCache()}var t=Ext.lib.Event.getXY(o);var u=new Ext.lib.Point(t[0],t[1]);for(var m in e){var n=e[m],l=n._region;var p=n.ddScrollConfig?n.ddScrollConfig:s;if(l&&l.contains(u)&&n.isScrollable()){if(l.bottom-u.y<=p.vthresh){if(i.el!=n){g(n,"down")}return}else{if(l.right-u.x<=p.hthresh){if(i.el!=n){g(n,"left")}return}else{if(u.y-l.top<=p.vthresh){if(i.el!=n){g(n,"up")}return}else{if(u.x-l.left<=p.hthresh){if(i.el!=n){g(n,"right")}return}}}}}}a()};c.fireEvents=c.fireEvents.createSequence(k,c);c.stopDrag=c.stopDrag.createSequence(h,c);return{register:function(n){if(Ext.isArray(n)){for(var m=0,l=n.length;m]+>/gi,asText:function(a){return String(a).replace(this.stripTagsRE,"")},asUCText:function(a){return String(a).toUpperCase().replace(this.stripTagsRE,"")},asUCString:function(a){return String(a).toUpperCase()},asDate:function(a){if(!a){return 0}if(Ext.isDate(a)){return a.getTime()}return Date.parse(String(a))},asFloat:function(a){var b=parseFloat(String(a).replace(/,/g,""));return isNaN(b)?0:b},asInt:function(a){var b=parseInt(String(a).replace(/,/g,""),10);return isNaN(b)?0:b}};Ext.data.Record=function(a,b){this.id=(b||b===0)?b:Ext.data.Record.id(this);this.data=a||{}};Ext.data.Record.create=function(e){var c=Ext.extend(Ext.data.Record,{});var d=c.prototype;d.fields=new Ext.util.MixedCollection(false,function(g){return g.name});for(var b=0,a=e.length;b-1){a.join(null);this.data.removeAt(b)}if(this.pruneModifiedRecords){this.modified.remove(a)}if(this.snapshot){this.snapshot.remove(a)}if(b>-1){this.fireEvent("remove",this,a,b)}},removeAt:function(a){this.remove(this.getAt(a))},removeAll:function(b){var a=[];this.each(function(c){a.push(c)});this.clearData();if(this.snapshot){this.snapshot.clear()}if(this.pruneModifiedRecords){this.modified=[]}if(b!==true){this.fireEvent("clear",this,a)}},onClear:function(b,a){Ext.each(a,function(d,c){this.destroyRecord(this,d,c)},this)},insert:function(c,b){b=[].concat(b);for(var d=0,a=b.length;d=0;d--){if(b[d].phantom===true){var a=b.splice(d,1).shift();if(a.isValid()){g.push(a)}}else{if(!b[d].isValid()){b.splice(d,1)}}}if(g.length){h.push(["create",g])}if(b.length){h.push(["update",b])}}j=h.length;if(j){e=++this.batchCounter;for(var d=0;d=0;b--){this.modified.splice(this.modified.indexOf(a[b]),1)}}else{this.modified.splice(this.modified.indexOf(a),1)}},reMap:function(b){if(Ext.isArray(b)){for(var d=0,a=b.length;d=0;c--){this.insert(b[c].lastIndex,b[c])}}},handleException:function(a){Ext.handleError(a)},reload:function(a){this.load(Ext.applyIf(a||{},this.lastOptions))},loadRecords:function(h,b,g){if(this.isDestroyed===true){return}if(!h||g===false){if(g!==false){this.fireEvent("load",this,[],b)}if(b.callback){b.callback.call(b.scope||this,[],b,false,h)}return}var e=h.records,d=h.totalRecords||e.length;if(!b||b.add!==true){if(this.pruneModifiedRecords){this.modified=[]}for(var c=0,a=e.length;c1){for(var p=1,o=c.length;ph?1:(i=0;b--){if(Ext.isArray(c)){this.realize(a.splice(b,1).shift(),c.splice(b,1).shift())}else{this.realize(a.splice(b,1).shift(),c)}}}else{if(Ext.isArray(c)&&c.length==1){c=c.shift()}if(!this.isData(c)){throw new Ext.data.DataReader.Error("realize",a)}a.phantom=false;a._phid=a.id;a.id=this.getId(c);a.data=c;a.commit()}},update:function(a,c){if(Ext.isArray(a)){for(var b=a.length-1;b>=0;b--){if(Ext.isArray(c)){this.update(a.splice(b,1).shift(),c.splice(b,1).shift())}else{this.update(a.splice(b,1).shift(),c)}}}else{if(Ext.isArray(c)&&c.length==1){c=c.shift()}if(this.isData(c)){a.data=Ext.apply(a.data,c)}a.commit()}},extractData:function(k,a){var j=(this instanceof Ext.data.JsonReader)?"json":"node";var c=[];if(this.isData(k)&&!(this instanceof Ext.data.XmlReader)){k=[k]}var h=this.recordType.prototype.fields,o=h.items,m=h.length,c=[];if(a===true){var l=this.recordType;for(var e=0;e=0){return new Function("obj","return obj"+(b>0?".":"")+c)}return function(d){return d[c]}}}(),extractValues:function(h,d,a){var g,c={};for(var e=0;e<\u003fxml version="{version}" encoding="{encoding}"\u003f><{documentRoot}><{name}>{value}<{root}><{parent.record}><{name}>{value}',render:function(b,c,a){c=this.toArray(c);b.xmlData=this.tpl.applyTemplate({version:this.xmlVersion,encoding:this.xmlEncoding,documentRoot:(c.length>0||this.forceDocumentRoot===true)?this.documentRoot:false,record:this.meta.record,root:this.root,baseParams:c,records:(Ext.isArray(a[0]))?a:[a]})},createRecord:function(a){return this.toArray(this.toHash(a))},updateRecord:function(a){return this.toArray(this.toHash(a))},destroyRecord:function(b){var a={};a[this.meta.idProperty]=b.id;return this.toArray(a)}});Ext.data.XmlReader=function(a,b){a=a||{};Ext.applyIf(a,{idProperty:a.idProperty||a.idPath||a.id,successProperty:a.successProperty||a.success});Ext.data.XmlReader.superclass.constructor.call(this,a,b||a.fields)};Ext.extend(Ext.data.XmlReader,Ext.data.DataReader,{read:function(a){var b=a.responseXML;if(!b){throw {message:"XmlReader.read: XML Document not available"}}return this.readRecords(b)},readRecords:function(d){this.xmlData=d;var a=d.documentElement||d,c=Ext.DomQuery,g=0,e=true;if(this.meta.totalProperty){g=this.getTotal(a,0)}if(this.meta.successProperty){e=this.getSuccess(a)}var b=this.extractData(c.select(this.meta.record,a),true);return{success:e,records:b,totalRecords:g||b.length}},readResponse:function(e,a){var d=Ext.DomQuery,g=a.responseXML;var b=new Ext.data.Response({action:e,success:this.getSuccess(g),message:this.getMessage(g),data:this.extractData(d.select(this.meta.record,g)||d.select(this.meta.root,g),false),raw:g});if(Ext.isEmpty(b.success)){throw new Ext.data.DataReader.Error("successProperty-response",this.meta.successProperty)}if(e===Ext.data.Api.actions.create){var c=Ext.isDefined(b.data);if(c&&Ext.isEmpty(b.data)){throw new Ext.data.JsonReader.Error("root-empty",this.meta.root)}else{if(!c){throw new Ext.data.JsonReader.Error("root-undefined-response",this.meta.root)}}}return b},getSuccess:function(){return true},buildExtractors:function(){if(this.ef){return}var l=this.meta,h=this.recordType,e=h.prototype.fields,k=e.items,j=e.length;if(l.totalProperty){this.getTotal=this.createAccessor(l.totalProperty)}if(l.successProperty){this.getSuccess=this.createAccessor(l.successProperty)}if(l.messageProperty){this.getMessage=this.createAccessor(l.messageProperty)}this.getRoot=function(g){return(!Ext.isEmpty(g[this.meta.record]))?g[this.meta.record]:g[this.meta.root]};if(l.idPath||l.idProperty){var d=this.createAccessor(l.idPath||l.idProperty);this.getId=function(g){var i=d(g)||g.id;return(i===undefined||i==="")?null:i}}else{this.getId=function(){return null}}var c=[];for(var b=0;b0&&sorters[0].field==this.groupField){sorters.shift()}this.groupField=d;this.groupDir=c;this.applyGroupField();var b=function(){this.fireEvent("groupchange",this,this.getGroupState())};if(this.groupOnSort){this.sort(d,c);b.call(this);return}if(this.remoteGroup){this.on("load",b,this,{single:true});this.reload()}else{this.sort(sorters);b.call(this)}},sort:function(h,c){if(this.remoteSort){return Ext.data.GroupingStore.superclass.sort.call(this,h,c)}var g=[];if(Ext.isArray(arguments[0])){g=arguments[0]}else{if(h==undefined){g=this.sortInfo?[this.sortInfo]:[]}else{var e=this.fields.get(h);if(!e){return false}var b=e.name,a=this.sortInfo||null,d=this.sortToggle?this.sortToggle[b]:null;if(!c){if(a&&a.field==b){c=(this.sortToggle[b]||"ASC").toggle("ASC","DESC")}else{c=e.sortDir}}this.sortToggle[b]=c;this.sortInfo={field:b,direction:c};g=[this.sortInfo]}}if(this.groupField){g.unshift({direction:this.groupDir,field:this.groupField})}return this.multiSort.call(this,g,c)},applyGroupField:function(){if(this.remoteGroup){if(!this.baseParams){this.baseParams={}}Ext.apply(this.baseParams,{groupBy:this.groupField,groupDir:this.groupDir});var a=this.lastOptions;if(a&&a.params){a.params.groupDir=this.groupDir;delete a.params.groupBy}}},applyGrouping:function(a){if(this.groupField!==false){this.groupBy(this.groupField,true,this.groupDir);return true}else{if(a===true){this.fireEvent("datachanged",this)}return false}},getGroupState:function(){return this.groupOnSort&&this.groupField!==false?(this.sortInfo?this.sortInfo.field:undefined):this.groupField}});Ext.reg("groupingstore",Ext.data.GroupingStore);Ext.data.DirectProxy=function(a){Ext.apply(this,a);if(typeof this.paramOrder=="string"){this.paramOrder=this.paramOrder.split(/[\s,|]/)}Ext.data.DirectProxy.superclass.constructor.call(this,a)};Ext.extend(Ext.data.DirectProxy,Ext.data.DataProxy,{paramOrder:undefined,paramsAsHash:true,directFn:undefined,doRequest:function(b,c,a,e,k,l,n){var j=[],h=this.api[b]||this.directFn;switch(b){case Ext.data.Api.actions.create:j.push(a.jsonData);break;case Ext.data.Api.actions.read:if(h.directCfg.method.len>0){if(this.paramOrder){for(var d=0,g=this.paramOrder.length;d1){for(var d=0,b=c.length;d0){this.doSend(a==1?this.callBuffer[0]:this.callBuffer);this.callBuffer=[]}},queueTransaction:function(a){if(a.form){this.processForm(a);return}this.callBuffer.push(a);if(this.enableBuffer){if(!this.callTask){this.callTask=new Ext.util.DelayedTask(this.combineAndSend,this)}this.callTask.delay(Ext.isNumber(this.enableBuffer)?this.enableBuffer:10)}else{this.combineAndSend()}},doCall:function(i,a,b){var h=null,e=b[a.len],g=b[a.len+1];if(a.len!==0){h=b.slice(0,a.len)}var d=new Ext.Direct.Transaction({provider:this,args:b,action:i,method:a.name,data:h,cb:g&&Ext.isFunction(e)?e.createDelegate(g):e});if(this.fireEvent("beforecall",this,d)!==false){Ext.Direct.addTransaction(d);this.queueTransaction(d);this.fireEvent("call",this,d)}},doForm:function(j,b,g,i,e){var d=new Ext.Direct.Transaction({provider:this,action:j,method:b.name,args:[g,i,e],cb:e&&Ext.isFunction(i)?i.createDelegate(e):i,isForm:true});if(this.fireEvent("beforecall",this,d)!==false){Ext.Direct.addTransaction(d);var a=String(g.getAttribute("enctype")).toLowerCase()=="multipart/form-data",h={extTID:d.tid,extAction:j,extMethod:b.name,extType:"rpc",extUpload:String(a)};Ext.apply(d,{form:Ext.getDom(g),isUpload:a,params:i&&Ext.isObject(i.params)?Ext.apply(h,i.params):h});this.fireEvent("call",this,d);this.processForm(d)}},processForm:function(a){Ext.Ajax.request({url:this.url,params:a.params,callback:this.onData,scope:this,form:a.form,isUpload:a.isUpload,ts:a})},createMethod:function(d,a){var b;if(!a.formHandler){b=function(){this.doCall(d,a,Array.prototype.slice.call(arguments,0))}.createDelegate(this)}else{b=function(e,g,c){this.doForm(d,a,e,g,c)}.createDelegate(this)}b.directCfg={action:d,method:a};return b},getTransaction:function(a){return a&&a.tid?Ext.Direct.getTransaction(a.tid):null},doCallback:function(c,g){var d=g.status?"success":"failure";if(c&&c.cb){var b=c.cb,a=Ext.isDefined(g.result)?g.result:g.data;if(Ext.isFunction(b)){b(a,g)}else{Ext.callback(b[d],b.scope,[a,g]);Ext.callback(b.callback,b.scope,[a,g])}}}});Ext.Direct.PROVIDERS.remoting=Ext.direct.RemotingProvider;Ext.Resizable=Ext.extend(Ext.util.Observable,{constructor:function(d,e){this.el=Ext.get(d);if(e&&e.wrap){e.resizeChild=this.el;this.el=this.el.wrap(typeof e.wrap=="object"?e.wrap:{cls:"xresizable-wrap"});this.el.id=this.el.dom.id=e.resizeChild.id+"-rzwrap";this.el.setStyle("overflow","hidden");this.el.setPositioning(e.resizeChild.getPositioning());e.resizeChild.clearPositioning();if(!e.width||!e.height){var g=e.resizeChild.getSize();this.el.setSize(g.width,g.height)}if(e.pinned&&!e.adjustments){e.adjustments="auto"}}this.proxy=this.el.createProxy({tag:"div",cls:"x-resizable-proxy",id:this.el.id+"-rzproxy"},Ext.getBody());this.proxy.unselectable();this.proxy.enableDisplayMode("block");Ext.apply(this,e);if(this.pinned){this.disableTrackOver=true;this.el.addClass("x-resizable-pinned")}var k=this.el.getStyle("position");if(k!="absolute"&&k!="fixed"){this.el.setStyle("position","relative")}if(!this.handles){this.handles="s,e,se";if(this.multiDirectional){this.handles+=",n,w"}}if(this.handles=="all"){this.handles="n s e w ne nw se sw"}var o=this.handles.split(/\s*?[,;]\s*?| /);var c=Ext.Resizable.positions;for(var j=0,l=o.length;j0){if(a>(e/2)){d=c+(e-a)}else{d=c-a}}return Math.max(b,d)},resizeElement:function(){var a=this.proxy.getBox();if(this.updateBox){this.el.setBox(a,false,this.animate,this.duration,null,this.easing)}else{this.el.setSize(a.width,a.height,this.animate,this.duration,null,this.easing)}this.updateChildSize();if(!this.dynamic){this.proxy.hide()}if(this.draggable&&this.constrainTo){this.dd.resetConstraints();this.dd.constrainTo(this.constrainTo)}return a},constrain:function(b,c,a,d){if(b-cd){c=b-d}}return c},onMouseMove:function(z){if(this.enabled&&this.activeHandle){try{if(this.resizeRegion&&!this.resizeRegion.contains(z.getPoint())){return}var t=this.curSize||this.startBox,l=this.startBox.x,k=this.startBox.y,c=l,b=k,m=t.width,u=t.height,d=m,o=u,n=this.minWidth,A=this.minHeight,s=this.maxWidth,D=this.maxHeight,i=this.widthIncrement,a=this.heightIncrement,B=z.getXY(),r=-(this.startPoint[0]-Math.max(this.minX,B[0])),p=-(this.startPoint[1]-Math.max(this.minY,B[1])),j=this.activeHandle.position,E,g;switch(j){case"east":m+=r;m=Math.min(Math.max(n,m),s);break;case"south":u+=p;u=Math.min(Math.max(A,u),D);break;case"southeast":m+=r;u+=p;m=Math.min(Math.max(n,m),s);u=Math.min(Math.max(A,u),D);break;case"north":p=this.constrain(u,p,A,D);k+=p;u-=p;break;case"west":r=this.constrain(m,r,n,s);l+=r;m-=r;break;case"northeast":m+=r;m=Math.min(Math.max(n,m),s);p=this.constrain(u,p,A,D);k+=p;u-=p;break;case"northwest":r=this.constrain(m,r,n,s);p=this.constrain(u,p,A,D);k+=p;u-=p;l+=r;m-=r;break;case"southwest":r=this.constrain(m,r,n,s);u+=p;u=Math.min(Math.max(A,u),D);l+=r;m-=r;break}var q=this.snap(m,i,n);var C=this.snap(u,a,A);if(q!=m||C!=u){switch(j){case"northeast":k-=C-u;break;case"north":k-=C-u;break;case"southwest":l-=q-m;break;case"west":l-=q-m;break;case"northwest":l-=q-m;k-=C-u;break}m=q;u=C}if(this.preserveRatio){switch(j){case"southeast":case"east":u=o*(m/d);u=Math.min(Math.max(A,u),D);m=d*(u/o);break;case"south":m=d*(u/o);m=Math.min(Math.max(n,m),s);u=o*(m/d);break;case"northeast":m=d*(u/o);m=Math.min(Math.max(n,m),s);u=o*(m/d);break;case"north":E=m;m=d*(u/o);m=Math.min(Math.max(n,m),s);u=o*(m/d);l+=(E-m)/2;break;case"southwest":u=o*(m/d);u=Math.min(Math.max(A,u),D);E=m;m=d*(u/o);l+=E-m;break;case"west":g=u;u=o*(m/d);u=Math.min(Math.max(A,u),D);k+=(g-u)/2;E=m;m=d*(u/o);l+=E-m;break;case"northwest":E=m;g=u;u=o*(m/d);u=Math.min(Math.max(A,u),D);m=d*(u/o);k+=g-u;l+=E-m;break}}this.proxy.setBounds(l,k,m,u);if(this.dynamic){this.resizeElement()}}catch(v){}}},handleOver:function(){if(this.enabled){this.el.addClass("x-resizable-over")}},handleOut:function(){if(!this.resizing){this.el.removeClass("x-resizable-over")}},getEl:function(){return this.el},getResizeChild:function(){return this.resizeChild},destroy:function(b){Ext.destroy(this.dd,this.overlay,this.proxy);this.overlay=null;this.proxy=null;var c=Ext.Resizable.positions;for(var a in c){if(typeof c[a]!="function"&&this[c[a]]){this[c[a]].destroy()}}if(b){this.el.update("");Ext.destroy(this.el);this.el=null}this.purgeListeners()},syncHandleHeight:function(){var a=this.el.getHeight(true);if(this.west){this.west.el.setHeight(a)}if(this.east){this.east.el.setHeight(a)}}});Ext.Resizable.positions={n:"north",s:"south",e:"east",w:"west",se:"southeast",sw:"southwest",nw:"northwest",ne:"northeast"};Ext.Resizable.Handle=Ext.extend(Object,{constructor:function(d,g,c,e,a){if(!this.tpl){var b=Ext.DomHelper.createTemplate({tag:"div",cls:"x-resizable-handle x-resizable-handle-{0}"});b.compile();Ext.Resizable.Handle.prototype.tpl=b}this.position=g;this.rz=d;this.el=this.tpl.append(d.el.dom,[this.position],true);this.el.unselectable();if(e){this.el.setOpacity(0)}if(!Ext.isEmpty(a)){this.el.addClass(a)}this.el.on("mousedown",this.onMouseDown,this);if(!c){this.el.on({scope:this,mouseover:this.onMouseOver,mouseout:this.onMouseOut})}},afterResize:function(a){},onMouseDown:function(a){this.rz.onMouseDown(this,a)},onMouseOver:function(a){this.rz.handleOver(this,a)},onMouseOut:function(a){this.rz.handleOut(this,a)},destroy:function(){Ext.destroy(this.el);this.el=null}});Ext.Window=Ext.extend(Ext.Panel,{baseCls:"x-window",resizable:true,draggable:true,closable:true,closeAction:"close",constrain:false,constrainHeader:false,plain:false,minimizable:false,maximizable:false,minHeight:100,minWidth:200,expandOnShow:true,collapsible:false,initHidden:undefined,hidden:true,elements:"header,body",frame:true,floating:true,initComponent:function(){this.initTools();Ext.Window.superclass.initComponent.call(this);this.addEvents("resize","maximize","minimize","restore");if(Ext.isDefined(this.initHidden)){this.hidden=this.initHidden}if(this.hidden===false){this.hidden=true;this.show()}},getState:function(){return Ext.apply(Ext.Window.superclass.getState.call(this)||{},this.getBox(true))},onRender:function(b,a){Ext.Window.superclass.onRender.call(this,b,a);if(this.plain){this.el.addClass("x-window-plain")}this.focusEl=this.el.createChild({tag:"a",href:"#",cls:"x-dlg-focus",tabIndex:"-1",html:" "});this.focusEl.swallowEvent("click",true);this.proxy=this.el.createProxy("x-window-proxy");this.proxy.enableDisplayMode("block");if(this.modal){this.mask=this.container.createChild({cls:"ext-el-mask"},this.el.dom);this.mask.enableDisplayMode("block");this.mask.hide();this.mon(this.mask,"click",this.focus,this)}if(this.maximizable){this.mon(this.header,"dblclick",this.toggleMaximize,this)}},initEvents:function(){Ext.Window.superclass.initEvents.call(this);if(this.animateTarget){this.setAnimateTarget(this.animateTarget)}if(this.resizable){this.resizer=new Ext.Resizable(this.el,{minWidth:this.minWidth,minHeight:this.minHeight,handles:this.resizeHandles||"all",pinned:true,resizeElement:this.resizerAction,handleCls:"x-window-handle"});this.resizer.window=this;this.mon(this.resizer,"beforeresize",this.beforeResize,this)}if(this.draggable){this.header.addClass("x-window-draggable")}this.mon(this.el,"mousedown",this.toFront,this);this.manager=this.manager||Ext.WindowMgr;this.manager.register(this);if(this.maximized){this.maximized=false;this.maximize()}if(this.closable){var a=this.getKeyMap();a.on(27,this.onEsc,this);a.disable()}},initDraggable:function(){this.dd=new Ext.Window.DD(this)},onEsc:function(a,b){b.stopEvent();this[this.closeAction]()},beforeDestroy:function(){if(this.rendered){this.hide();this.clearAnchor();Ext.destroy(this.focusEl,this.resizer,this.dd,this.proxy,this.mask)}Ext.Window.superclass.beforeDestroy.call(this)},onDestroy:function(){if(this.manager){this.manager.unregister(this)}Ext.Window.superclass.onDestroy.call(this)},initTools:function(){if(this.minimizable){this.addTool({id:"minimize",handler:this.minimize.createDelegate(this,[])})}if(this.maximizable){this.addTool({id:"maximize",handler:this.maximize.createDelegate(this,[])});this.addTool({id:"restore",handler:this.restore.createDelegate(this,[]),hidden:true})}if(this.closable){this.addTool({id:"close",handler:this[this.closeAction].createDelegate(this,[])})}},resizerAction:function(){var a=this.proxy.getBox();this.proxy.hide();this.window.handleResize(a);return a},beforeResize:function(){this.resizer.minHeight=Math.max(this.minHeight,this.getFrameHeight()+40);this.resizer.minWidth=Math.max(this.minWidth,this.getFrameWidth()+40);this.resizeBox=this.el.getBox()},updateHandles:function(){if(Ext.isIE&&this.resizer){this.resizer.syncHandleHeight();this.el.repaint()}},handleResize:function(b){var a=this.resizeBox;if(a.x!=b.x||a.y!=b.y){this.updateBox(b)}else{this.setSize(b);if(Ext.isIE6&&Ext.isStrict){this.doLayout()}}this.focus();this.updateHandles();this.saveState()},focus:function(){var e=this.focusEl,a=this.defaultButton,c=typeof a,d,b;if(Ext.isDefined(a)){if(Ext.isNumber(a)&&this.fbar){e=this.fbar.items.get(a)}else{if(Ext.isString(a)){e=Ext.getCmp(a)}else{e=a}}d=e.getEl();b=Ext.getDom(this.container);if(d&&b){if(!Ext.lib.Region.getRegion(b).contains(Ext.lib.Region.getRegion(d.dom))){return}}}e=e||this.focusEl;e.focus.defer(10,e)},setAnimateTarget:function(a){a=Ext.get(a);this.animateTarget=a},beforeShow:function(){delete this.el.lastXY;delete this.el.lastLT;if(this.x===undefined||this.y===undefined){var a=this.el.getAlignToXY(this.container,"c-c");var b=this.el.translatePoints(a[0],a[1]);this.x=this.x===undefined?b.left:this.x;this.y=this.y===undefined?b.top:this.y}this.el.setLeftTop(this.x,this.y);if(this.expandOnShow){this.expand(false)}if(this.modal){Ext.getBody().addClass("x-body-masked");this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.mask.show()}},show:function(c,a,b){if(!this.rendered){this.render(Ext.getBody())}if(this.hidden===false){this.toFront();return this}if(this.fireEvent("beforeshow",this)===false){return this}if(a){this.on("show",a,b,{single:true})}this.hidden=false;if(Ext.isDefined(c)){this.setAnimateTarget(c)}this.beforeShow();if(this.animateTarget){this.animShow()}else{this.afterShow()}return this},afterShow:function(b){if(this.isDestroyed){return false}this.proxy.hide();this.el.setStyle("display","block");this.el.show();if(this.maximized){this.fitContainer()}if(Ext.isMac&&Ext.isGecko2){this.cascade(this.setAutoScroll)}if(this.monitorResize||this.modal||this.constrain||this.constrainHeader){Ext.EventManager.onWindowResize(this.onWindowResize,this)}this.doConstrain();this.doLayout();if(this.keyMap){this.keyMap.enable()}this.toFront();this.updateHandles();if(b&&(Ext.isIE||Ext.isWebKit)){var a=this.getSize();this.onResize(a.width,a.height)}this.onShow();this.fireEvent("show",this)},animShow:function(){this.proxy.show();this.proxy.setBox(this.animateTarget.getBox());this.proxy.setOpacity(0);var a=this.getBox();this.el.setStyle("display","none");this.proxy.shift(Ext.apply(a,{callback:this.afterShow.createDelegate(this,[true],false),scope:this,easing:"easeNone",duration:0.25,opacity:0.5}))},hide:function(c,a,b){if(this.hidden||this.fireEvent("beforehide",this)===false){return this}if(a){this.on("hide",a,b,{single:true})}this.hidden=true;if(c!==undefined){this.setAnimateTarget(c)}if(this.modal){this.mask.hide();Ext.getBody().removeClass("x-body-masked")}if(this.animateTarget){this.animHide()}else{this.el.hide();this.afterHide()}return this},afterHide:function(){this.proxy.hide();if(this.monitorResize||this.modal||this.constrain||this.constrainHeader){Ext.EventManager.removeResizeListener(this.onWindowResize,this)}if(this.keyMap){this.keyMap.disable()}this.onHide();this.fireEvent("hide",this)},animHide:function(){this.proxy.setOpacity(0.5);this.proxy.show();var a=this.getBox(false);this.proxy.setBox(a);this.el.hide();this.proxy.shift(Ext.apply(this.animateTarget.getBox(),{callback:this.afterHide,scope:this,duration:0.25,easing:"easeNone",opacity:0}))},onShow:Ext.emptyFn,onHide:Ext.emptyFn,onWindowResize:function(){if(this.maximized){this.fitContainer()}if(this.modal){this.mask.setSize("100%","100%");var a=this.mask.dom.offsetHeight;this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true))}this.doConstrain()},doConstrain:function(){if(this.constrain||this.constrainHeader){var b;if(this.constrain){b={right:this.el.shadowOffset,left:this.el.shadowOffset,bottom:this.el.shadowOffset}}else{var a=this.getSize();b={right:-(a.width-100),bottom:-(a.height-25)}}var c=this.el.getConstrainToXY(this.container,true,b);if(c){this.setPosition(c[0],c[1])}}},ghost:function(a){var c=this.createGhost(a);var b=this.getBox(true);c.setLeftTop(b.x,b.y);c.setWidth(b.width);this.el.hide();this.activeGhost=c;return c},unghost:function(b,a){if(!this.activeGhost){return}if(b!==false){this.el.show();this.focus.defer(10,this);if(Ext.isMac&&Ext.isGecko2){this.cascade(this.setAutoScroll)}}if(a!==false){this.setPosition(this.activeGhost.getLeft(true),this.activeGhost.getTop(true))}this.activeGhost.hide();this.activeGhost.remove();delete this.activeGhost},minimize:function(){this.fireEvent("minimize",this);return this},close:function(){if(this.fireEvent("beforeclose",this)!==false){if(this.hidden){this.doClose()}else{this.hide(null,this.doClose,this)}}},doClose:function(){this.fireEvent("close",this);this.destroy()},maximize:function(){if(!this.maximized){this.expand(false);this.restoreSize=this.getSize();this.restorePos=this.getPosition(true);if(this.maximizable){this.tools.maximize.hide();this.tools.restore.show()}this.maximized=true;this.el.disableShadow();if(this.dd){this.dd.lock()}if(this.collapsible){this.tools.toggle.hide()}this.el.addClass("x-window-maximized");this.container.addClass("x-window-maximized-ct");this.setPosition(0,0);this.fitContainer();this.fireEvent("maximize",this)}return this},restore:function(){if(this.maximized){var a=this.tools;this.el.removeClass("x-window-maximized");if(a.restore){a.restore.hide()}if(a.maximize){a.maximize.show()}this.setPosition(this.restorePos[0],this.restorePos[1]);this.setSize(this.restoreSize.width,this.restoreSize.height);delete this.restorePos;delete this.restoreSize;this.maximized=false;this.el.enableShadow(true);if(this.dd){this.dd.unlock()}if(this.collapsible&&a.toggle){a.toggle.show()}this.container.removeClass("x-window-maximized-ct");this.doConstrain();this.fireEvent("restore",this)}return this},toggleMaximize:function(){return this[this.maximized?"restore":"maximize"]()},fitContainer:function(){var a=this.container.getViewSize(false);this.setSize(a.width,a.height)},setZIndex:function(a){if(this.modal){this.mask.setStyle("z-index",a)}this.el.setZIndex(++a);a+=5;if(this.resizer){this.resizer.proxy.setStyle("z-index",++a)}this.lastZIndex=a},alignTo:function(b,a,c){var d=this.el.getAlignToXY(b,a,c);this.setPagePosition(d[0],d[1]);return this},anchorTo:function(c,e,d,b){this.clearAnchor();this.anchorTarget={el:c,alignment:e,offsets:d};Ext.EventManager.onWindowResize(this.doAnchor,this);var a=typeof b;if(a!="undefined"){Ext.EventManager.on(window,"scroll",this.doAnchor,this,{buffer:a=="number"?b:50})}return this.doAnchor()},doAnchor:function(){var a=this.anchorTarget;this.alignTo(a.el,a.alignment,a.offsets);return this},clearAnchor:function(){if(this.anchorTarget){Ext.EventManager.removeResizeListener(this.doAnchor,this);Ext.EventManager.un(window,"scroll",this.doAnchor,this);delete this.anchorTarget}return this},toFront:function(a){if(this.manager.bringToFront(this)){if(!a||!a.getTarget().focus){this.focus()}}return this},setActive:function(a){if(a){if(!this.maximized){this.el.enableShadow(true)}this.fireEvent("activate",this)}else{this.el.disableShadow();this.fireEvent("deactivate",this)}},toBack:function(){this.manager.sendToBack(this);return this},center:function(){var a=this.el.getAlignToXY(this.container,"c-c");this.setPagePosition(a[0],a[1]);return this}});Ext.reg("window",Ext.Window);Ext.Window.DD=function(a){this.win=a;Ext.Window.DD.superclass.constructor.call(this,a.el.id,"WindowDD-"+a.id);this.setHandleElId(a.header.id);this.scroll=false};Ext.extend(Ext.Window.DD,Ext.dd.DD,{moveOnly:true,headerOffsets:[100,25],startDrag:function(){var a=this.win;this.proxy=a.ghost();if(a.constrain!==false){var c=a.el.shadowOffset;this.constrainTo(a.container,{right:c,left:c,bottom:c})}else{if(a.constrainHeader!==false){var b=this.proxy.getSize();this.constrainTo(a.container,{right:-(b.width-this.headerOffsets[0]),bottom:-(b.height-this.headerOffsets[1])})}}},b4Drag:Ext.emptyFn,onDrag:function(a){this.alignElWithMouse(this.proxy,a.getPageX(),a.getPageY())},endDrag:function(a){this.win.unghost();this.win.saveState()}});Ext.WindowGroup=function(){var g={};var d=[];var e=null;var c=function(j,i){return(!j._lastAccess||j._lastAccess0){l.sort(c);var k=l[0].manager.zseed;for(var m=0;m=0;--j){if(!d[j].hidden){b(d[j]);return}}b(null)};return{zseed:9000,register:function(i){if(i.manager){i.manager.unregister(i)}i.manager=this;g[i.id]=i;d.push(i);i.on("hide",a)},unregister:function(i){delete i.manager;delete g[i.id];i.un("hide",a);d.remove(i)},get:function(i){return typeof i=="object"?i:g[i]},bringToFront:function(i){i=this.get(i);if(i!=e){i._lastAccess=new Date().getTime();h();return true}return false},sendToBack:function(i){i=this.get(i);i._lastAccess=-(new Date().getTime());h();return i},hideAll:function(){for(var i in g){if(g[i]&&typeof g[i]!="function"&&g[i].isVisible()){g[i].hide()}}},getActive:function(){return e},getBy:function(l,k){var m=[];for(var j=d.length-1;j>=0;--j){var n=d[j];if(l.call(k||n,n)!==false){m.push(n)}}return m},each:function(j,i){for(var k in g){if(g[k]&&typeof g[k]!="function"){if(j.call(i||g[k],g[k])===false){return}}}}}};Ext.WindowMgr=new Ext.WindowGroup();Ext.MessageBox=function(){var u,b,q,t,h,l,s,a,n,p,j,g,r,v,o,i="",d="",m=["ok","yes","no","cancel"];var c=function(x){r[x].blur();if(u.isVisible()){u.hide();w();Ext.callback(b.fn,b.scope||window,[x,v.dom.value,b],1)}};var w=function(){if(b&&b.cls){u.el.removeClass(b.cls)}n.reset()};var e=function(z,x,y){if(b&&b.closable!==false){u.hide();w()}if(y){y.stopEvent()}};var k=function(x){var z=0,y;if(!x){Ext.each(m,function(A){r[A].hide()});return z}u.footer.dom.style.display="";Ext.iterate(r,function(A,B){y=x[A];if(y){B.show();B.setText(Ext.isString(y)?y:Ext.MessageBox.buttonText[A]);z+=B.getEl().getWidth()+15}else{B.hide()}});return z};return{getDialog:function(x){if(!u){var z=[];r={};Ext.each(m,function(A){z.push(r[A]=new Ext.Button({text:this.buttonText[A],handler:c.createCallback(A),hideMode:"offsets"}))},this);u=new Ext.Window({autoCreate:true,title:x,resizable:false,constrain:true,constrainHeader:true,minimizable:false,maximizable:false,stateful:false,modal:true,shim:true,buttonAlign:"center",width:400,height:100,minHeight:80,plain:true,footer:true,closable:true,close:function(){if(b&&b.buttons&&b.buttons.no&&!b.buttons.cancel){c("no")}else{c("cancel")}},fbar:new Ext.Toolbar({items:z,enableOverflow:false})});u.render(document.body);u.getEl().addClass("x-window-dlg");q=u.mask;h=u.body.createChild({html:'

    '});j=Ext.get(h.dom.firstChild);var y=h.dom.childNodes[1];l=Ext.get(y.firstChild);s=Ext.get(y.childNodes[2].firstChild);s.enableDisplayMode();s.addKeyListener([10,13],function(){if(u.isVisible()&&b&&b.buttons){if(b.buttons.ok){c("ok")}else{if(b.buttons.yes){c("yes")}}}});a=Ext.get(y.childNodes[2].childNodes[1]);a.enableDisplayMode();n=new Ext.ProgressBar({renderTo:h});h.createChild({cls:"x-clear"})}return u},updateText:function(A){if(!u.isVisible()&&!b.width){u.setSize(this.maxWidth,100)}l.update(A||" ");var y=d!=""?(j.getWidth()+j.getMargins("lr")):0,C=l.getWidth()+l.getMargins("lr"),z=u.getFrameWidth("lr"),B=u.body.getFrameWidth("lr"),x;if(Ext.isIE&&y>0){y+=3}x=Math.max(Math.min(b.width||y+C+z+B,b.maxWidth||this.maxWidth),Math.max(b.minWidth||this.minWidth,o||0));if(b.prompt===true){v.setWidth(x-y-z-B)}if(b.progress===true||b.wait===true){n.setSize(x-y-z-B)}if(Ext.isIE&&x==o){x+=4}u.setSize(x,"auto").center();return this},updateProgress:function(y,x,z){n.updateProgress(y,x);if(z){this.updateText(z)}return this},isVisible:function(){return u&&u.isVisible()},hide:function(){var x=u?u.activeGhost:null;if(this.isVisible()||x){u.hide();w();if(x){u.unghost(false,false)}}return this},show:function(A){if(this.isVisible()){this.hide()}b=A;var B=this.getDialog(b.title||" ");B.setTitle(b.title||" ");var x=(b.closable!==false&&b.progress!==true&&b.wait!==true);B.tools.close.setDisplayed(x);v=s;b.prompt=b.prompt||(b.multiline?true:false);if(b.prompt){if(b.multiline){s.hide();a.show();a.setHeight(Ext.isNumber(b.multiline)?b.multiline:this.defaultTextHeight);v=a}else{s.show();a.hide()}}else{s.hide();a.hide()}v.dom.value=b.value||"";if(b.prompt){B.focusEl=v}else{var z=b.buttons;var y=null;if(z&&z.ok){y=r.ok}else{if(z&&z.yes){y=r.yes}}if(y){B.focusEl=y}}if(b.iconCls){B.setIconClass(b.iconCls)}this.setIcon(Ext.isDefined(b.icon)?b.icon:i);o=k(b.buttons);n.setVisible(b.progress===true||b.wait===true);this.updateProgress(0,b.progressText);this.updateText(b.msg);if(b.cls){B.el.addClass(b.cls)}B.proxyDrag=b.proxyDrag===true;B.modal=b.modal!==false;B.mask=b.modal!==false?q:false;if(!B.isVisible()){document.body.appendChild(u.el.dom);B.setAnimateTarget(b.animEl);B.on("show",function(){if(x===true){B.keyMap.enable()}else{B.keyMap.disable()}},this,{single:true});B.show(b.animEl)}if(b.wait===true){n.wait(b.waitConfig)}return this},setIcon:function(x){if(!u){i=x;return}i=undefined;if(x&&x!=""){j.removeClass("x-hidden");j.replaceClass(d,x);h.addClass("x-dlg-icon");d=x}else{j.replaceClass(d,"x-hidden");h.removeClass("x-dlg-icon");d=""}return this},progress:function(z,y,x){this.show({title:z,msg:y,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth,progressText:x});return this},wait:function(z,y,x){this.show({title:y,msg:z,buttons:false,closable:false,wait:true,modal:true,minWidth:this.minProgressWidth,waitConfig:x});return this},alert:function(A,z,y,x){this.show({title:A,msg:z,buttons:this.OK,fn:y,scope:x,minWidth:this.minWidth});return this},confirm:function(A,z,y,x){this.show({title:A,msg:z,buttons:this.YESNO,fn:y,scope:x,icon:this.QUESTION,minWidth:this.minWidth});return this},prompt:function(C,B,z,y,x,A){this.show({title:C,msg:B,buttons:this.OKCANCEL,fn:z,minWidth:this.minPromptWidth,scope:y,prompt:true,multiline:x,value:A});return this},OK:{ok:true},CANCEL:{cancel:true},OKCANCEL:{ok:true,cancel:true},YESNO:{yes:true,no:true},YESNOCANCEL:{yes:true,no:true,cancel:true},INFO:"ext-mb-info",WARNING:"ext-mb-warning",QUESTION:"ext-mb-question",ERROR:"ext-mb-error",defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,minPromptWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}}}();Ext.Msg=Ext.MessageBox;Ext.dd.PanelProxy=function(a,b){this.panel=a;this.id=this.panel.id+"-ddproxy";Ext.apply(this,b)};Ext.dd.PanelProxy.prototype={insertProxy:true,setStatus:Ext.emptyFn,reset:Ext.emptyFn,update:Ext.emptyFn,stop:Ext.emptyFn,sync:Ext.emptyFn,getEl:function(){return this.ghost},getGhost:function(){return this.ghost},getProxy:function(){return this.proxy},hide:function(){if(this.ghost){if(this.proxy){this.proxy.remove();delete this.proxy}this.panel.el.dom.style.display="";this.ghost.remove();delete this.ghost}},show:function(){if(!this.ghost){this.ghost=this.panel.createGhost(undefined,undefined,Ext.getBody());this.ghost.setXY(this.panel.el.getXY());if(this.insertProxy){this.proxy=this.panel.el.insertSibling({cls:"x-panel-dd-spacer"});this.proxy.setSize(this.panel.getSize())}this.panel.el.dom.style.display="none"}},repair:function(b,c,a){this.hide();if(typeof c=="function"){c.call(a||this)}},moveProxy:function(a,b){if(this.proxy){a.insertBefore(this.proxy.dom,b)}}};Ext.Panel.DD=function(b,a){this.panel=b;this.dragData={panel:b};this.proxy=new Ext.dd.PanelProxy(b,a);Ext.Panel.DD.superclass.constructor.call(this,b.el,a);var c=b.header;if(c){this.setHandleElId(c.id)}(c?c:this.panel.body).setStyle("cursor","move");this.scroll=false};Ext.extend(Ext.Panel.DD,Ext.dd.DragSource,{showFrame:Ext.emptyFn,startDrag:Ext.emptyFn,b4StartDrag:function(a,b){this.proxy.show()},b4MouseDown:function(b){var a=b.getPageX();var c=b.getPageY();this.autoOffset(a,c)},onInitDrag:function(a,b){this.onStartDrag(a,b);return true},createFrame:Ext.emptyFn,getDragEl:function(a){return this.proxy.ghost.dom},endDrag:function(a){this.proxy.hide();this.panel.saveState()},autoOffset:function(a,b){a-=this.startPageX;b-=this.startPageY;this.setDelta(a,b)}});Ext.state.Provider=function(){this.addEvents("statechange");this.state={};Ext.state.Provider.superclass.constructor.call(this)};Ext.extend(Ext.state.Provider,Ext.util.Observable,{get:function(b,a){return typeof this.state[b]=="undefined"?a:this.state[b]},clear:function(a){delete this.state[a];this.fireEvent("statechange",this,a,null)},set:function(a,b){this.state[a]=b;this.fireEvent("statechange",this,a,b)},decodeValue:function(b){var e=/^(a|n|d|b|s|o)\:(.*)$/;var g=e.exec(unescape(b));if(!g||!g[1]){return}var d=g[1];var a=g[2];switch(d){case"n":return parseFloat(a);case"d":return new Date(Date.parse(a));case"b":return(a=="1");case"a":var c=[];if(a!=""){Ext.each(a.split("^"),function(h){c.push(this.decodeValue(h))},this)}return c;case"o":var c={};if(a!=""){Ext.each(a.split("^"),function(i){var h=i.split("=");c[h[0]]=this.decodeValue(h[1])},this)}return c;default:return a}},encodeValue:function(c){var b;if(typeof c=="number"){b="n:"+c}else{if(typeof c=="boolean"){b="b:"+(c?"1":"0")}else{if(Ext.isDate(c)){b="d:"+c.toGMTString()}else{if(Ext.isArray(c)){var g="";for(var e=0,a=c.length;e-1){var e=this.isSelected(b);var c=this.all.elements[b];var d=this.bufferRender([a],b)[0];this.all.replaceElement(b,d,true);if(e){this.selected.replaceElement(c,d);this.all.item(b).addClass(this.selectedClass)}this.updateIndexes(b,b)}},onAdd:function(g,d,e){if(this.all.getCount()===0){this.refresh();return}var c=this.bufferRender(d,e),h,b=this.all.elements;if(e0){if(!b){this.selected.removeClass(this.selectedClass)}this.selected.clear();this.last=false;if(!a){this.fireEvent("selectionchange",this,this.selected.elements)}}},isSelected:function(a){return this.selected.contains(this.getNode(a))},deselect:function(a){if(this.isSelected(a)){a=this.getNode(a);this.selected.removeElement(a);if(this.last==a.viewIndex){this.last=false}Ext.fly(a).removeClass(this.selectedClass);this.fireEvent("selectionchange",this,this.selected.elements)}},select:function(d,g,b){if(Ext.isArray(d)){if(!g){this.clearSelections(true)}for(var c=0,a=d.length;c=a&&d[c];c--){b.push(d[c])}}return b},indexOf:function(a){a=this.getNode(a);if(Ext.isNumber(a.viewIndex)){return a.viewIndex}return this.all.indexOf(a)},onBeforeLoad:function(){if(this.loadingText){this.clearSelections(false,true);this.getTemplateTarget().update('
    '+this.loadingText+"
    ");this.all.clear()}},onDestroy:function(){this.all.clear();this.selected.clear();Ext.DataView.superclass.onDestroy.call(this);this.bindStore(null)}});Ext.DataView.prototype.setStore=Ext.DataView.prototype.bindStore;Ext.reg("dataview",Ext.DataView);Ext.list.ListView=Ext.extend(Ext.DataView,{itemSelector:"dl",selectedClass:"x-list-selected",overClass:"x-list-over",scrollOffset:undefined,columnResize:true,columnSort:true,maxWidth:Ext.isIE?99:100,initComponent:function(){if(this.columnResize){this.colResizer=new Ext.list.ColumnResizer(this.colResizer);this.colResizer.init(this)}if(this.columnSort){this.colSorter=new Ext.list.Sorter(this.columnSort);this.colSorter.init(this)}if(!this.internalTpl){this.internalTpl=new Ext.XTemplate('
    ','','
    ',"{header}","
    ","
    ",'
    ',"
    ",'
    ',"
    ")}if(!this.tpl){this.tpl=new Ext.XTemplate('',"
    ",'','
    ',' class="{cls}">',"{[values.tpl.apply(parent)]}","
    ","
    ",'
    ',"
    ","
    ")}var l=this.columns,h=0,k=0,m=l.length,b=[];for(var g=0;g10)){e.style.width=a+"px";g.style.width=a+"px"}else{e.style.width=b+"px";g.style.width=b+"px";setTimeout(function(){if((c.offsetWidth-c.clientWidth)>10){e.style.width=a+"px";g.style.width=a+"px"}},10)}}if(Ext.isNumber(d)){c.style.height=(d-g.parentNode.offsetHeight)+"px"}},updateIndexes:function(){Ext.list.ListView.superclass.updateIndexes.apply(this,arguments);this.verifyInternalSize()},findHeaderIndex:function(e){e=e.dom||e;var a=e.parentNode,d=a.parentNode.childNodes;for(var b=0,g;g=d[b];b++){if(g==a){return b}}return -1},setHdWidths:function(){var c=this.innerHd.dom.getElementsByTagName("div");for(var b=0,d=this.columns,a=d.length;b','','{text}',"");d.disableFormats=true;d.compile();Ext.TabPanel.prototype.itemTpl=d}this.items.each(this.initTab,this)},afterRender:function(){Ext.TabPanel.superclass.afterRender.call(this);if(this.autoTabs){this.readTabs(false)}if(this.activeTab!==undefined){var a=Ext.isObject(this.activeTab)?this.activeTab:this.items.get(this.activeTab);delete this.activeTab;this.setActiveTab(a)}},initEvents:function(){Ext.TabPanel.superclass.initEvents.call(this);this.mon(this.strip,{scope:this,mousedown:this.onStripMouseDown,contextmenu:this.onStripContextMenu});if(this.enableTabScroll){this.mon(this.strip,"mousewheel",this.onWheel,this)}},findTargets:function(c){var b=null,a=c.getTarget("li:not(.x-tab-edge)",this.strip);if(a){b=this.getComponent(a.id.split(this.idDelimiter)[1]);if(b.disabled){return{close:null,item:null,el:null}}}return{close:c.getTarget(".x-tab-strip-close",this.strip),item:b,el:a}},onStripMouseDown:function(b){if(b.button!==0){return}b.preventDefault();var a=this.findTargets(b);if(a.close){if(a.item.fireEvent("beforeclose",a.item)!==false){a.item.fireEvent("close",a.item);this.remove(a.item)}return}if(a.item&&a.item!=this.activeTab){this.setActiveTab(a.item)}},onStripContextMenu:function(b){b.preventDefault();var a=this.findTargets(b);if(a.item){this.fireEvent("contextmenu",this,a.item,b)}},readTabs:function(d){if(d===true){this.items.each(function(h){this.remove(h)},this)}var c=this.el.query(this.autoTabSelector);for(var b=0,a=c.length;b0){this.setActiveTab(0)}else{this.setActiveTab(null)}}}if(!this.destroying){this.delegateUpdates()}},onBeforeShowItem:function(a){if(a!=this.activeTab){this.setActiveTab(a);return false}},onItemDisabled:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).addClass("x-item-disabled")}this.stack.remove(b)},onItemEnabled:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).removeClass("x-item-disabled")}},onItemTitleChanged:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).child("span.x-tab-strip-text",true).innerHTML=b.title}},onItemIconChanged:function(d,a,c){var b=this.getTabEl(d);if(b){b=Ext.get(b);b.child("span.x-tab-strip-text").replaceClass(c,a);b[Ext.isEmpty(a)?"removeClass":"addClass"]("x-tab-with-icon")}},getTabEl:function(a){var b=this.getComponent(a);return b?b.tabEl:null},onResize:function(){Ext.TabPanel.superclass.onResize.apply(this,arguments);this.delegateUpdates()},beginUpdate:function(){this.suspendUpdates=true},endUpdate:function(){this.suspendUpdates=false;this.delegateUpdates()},hideTabStripItem:function(b){b=this.getComponent(b);var a=this.getTabEl(b);if(a){a.style.display="none";this.delegateUpdates()}this.stack.remove(b)},unhideTabStripItem:function(b){b=this.getComponent(b);var a=this.getTabEl(b);if(a){a.style.display="";this.delegateUpdates()}},delegateUpdates:function(){if(this.suspendUpdates){return}if(this.resizeTabs&&this.rendered){this.autoSizeTabs()}if(this.enableTabScroll&&this.rendered){this.autoScrollTabs()}},autoSizeTabs:function(){var h=this.items.length,b=this.tabPosition!="bottom"?"header":"footer",c=this[b].dom.offsetWidth,a=this[b].dom.clientWidth;if(!this.resizeTabs||h<1||!a){return}var k=Math.max(Math.min(Math.floor((a-4)/h)-this.tabMargin,this.tabWidth),this.minTabWidth);this.lastTabWidth=k;var m=this.strip.query("li:not(.x-tab-edge)");for(var e=0,j=m.length;e20?c:20);if(!this.scrolling){if(!this.scrollLeft){this.createScrollers()}else{this.scrollLeft.show();this.scrollRight.show()}}this.scrolling=true;if(i>(a-c)){e.scrollLeft=a-c}else{this.scrollToTab(this.activeTab,false)}this.updateScrollButtons()}},createScrollers:function(){this.pos.addClass("x-tab-scrolling-"+this.tabPosition);var c=this.stripWrap.dom.offsetHeight;var a=this.pos.insertFirst({cls:"x-tab-scroller-left"});a.setHeight(c);a.addClassOnOver("x-tab-scroller-left-over");this.leftRepeater=new Ext.util.ClickRepeater(a,{interval:this.scrollRepeatInterval,handler:this.onScrollLeft,scope:this});this.scrollLeft=a;var b=this.pos.insertFirst({cls:"x-tab-scroller-right"});b.setHeight(c);b.addClassOnOver("x-tab-scroller-right-over");this.rightRepeater=new Ext.util.ClickRepeater(b,{interval:this.scrollRepeatInterval,handler:this.onScrollRight,scope:this});this.scrollRight=b},getScrollWidth:function(){return this.edge.getOffsetsTo(this.stripWrap)[0]+this.getScrollPos()},getScrollPos:function(){return parseInt(this.stripWrap.dom.scrollLeft,10)||0},getScrollArea:function(){return parseInt(this.stripWrap.dom.clientWidth,10)||0},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},getScrollIncrement:function(){return this.scrollIncrement||(this.resizeTabs?this.lastTabWidth+2:100)},scrollToTab:function(e,a){if(!e){return}var c=this.getTabEl(e),h=this.getScrollPos(),d=this.getScrollArea(),g=Ext.fly(c).getOffsetsTo(this.stripWrap)[0]+h,b=g+c.offsetWidth;if(g(h+d)){this.scrollTo(b-d,a)}}},scrollTo:function(b,a){this.stripWrap.scrollTo("left",b,a?this.getScrollAnim():false);if(!a){this.updateScrollButtons()}},onWheel:function(g){var h=g.getWheelDelta()*this.wheelIncrement*-1;g.stopEvent();var i=this.getScrollPos(),c=i+h,a=this.getScrollWidth()-this.getScrollArea();var b=Math.max(0,Math.min(a,c));if(b!=i){this.scrollTo(b,false)}},onScrollRight:function(){var a=this.getScrollWidth()-this.getScrollArea(),c=this.getScrollPos(),b=Math.min(a,c+this.getScrollIncrement());if(b!=c){this.scrollTo(b,this.animScroll)}},onScrollLeft:function(){var b=this.getScrollPos(),a=Math.max(0,b-this.getScrollIncrement());if(a!=b){this.scrollTo(a,this.animScroll)}},updateScrollButtons:function(){var a=this.getScrollPos();this.scrollLeft[a===0?"addClass":"removeClass"]("x-tab-scroller-left-disabled");this.scrollRight[a>=(this.getScrollWidth()-this.getScrollArea())?"addClass":"removeClass"]("x-tab-scroller-right-disabled")},beforeDestroy:function(){Ext.destroy(this.leftRepeater,this.rightRepeater);this.deleteMembers("strip","edge","scrollLeft","scrollRight","stripWrap");this.activeTab=null;Ext.TabPanel.superclass.beforeDestroy.apply(this)}});Ext.reg("tabpanel",Ext.TabPanel);Ext.TabPanel.prototype.activate=Ext.TabPanel.prototype.setActiveTab;Ext.TabPanel.AccessStack=function(){var a=[];return{add:function(b){a.push(b);if(a.length>10){a.shift()}},remove:function(e){var d=[];for(var c=0,b=a.length;c','  ','  ','  ',"");Ext.Button.buttonTemplate.compile()}this.template=Ext.Button.buttonTemplate}var b,d=this.getTemplateArgs();if(a){b=this.template.insertBefore(a,d,true)}else{b=this.template.append(c,d,true)}this.btnEl=b.child(this.buttonSelector);this.mon(this.btnEl,{scope:this,focus:this.onFocus,blur:this.onBlur});this.initButtonEl(b,this.btnEl);Ext.ButtonToggleMgr.register(this)},initButtonEl:function(b,c){this.el=b;this.setIcon(this.icon);this.setText(this.text);this.setIconClass(this.iconCls);if(Ext.isDefined(this.tabIndex)){c.dom.tabIndex=this.tabIndex}if(this.tooltip){this.setTooltip(this.tooltip,true)}if(this.handleMouseEvents){this.mon(b,{scope:this,mouseover:this.onMouseOver,mousedown:this.onMouseDown})}if(this.menu){this.mon(this.menu,{scope:this,show:this.onMenuShow,hide:this.onMenuHide})}if(this.repeat){var a=new Ext.util.ClickRepeater(b,Ext.isObject(this.repeat)?this.repeat:{});this.mon(a,"click",this.onClick,this)}this.mon(b,this.clickEvent,this.onClick,this)},afterRender:function(){Ext.Button.superclass.afterRender.call(this);this.useSetClass=true;this.setButtonClass();this.doc=Ext.getDoc();this.doAutoWidth()},setIconClass:function(a){this.iconCls=a;if(this.el){this.btnEl.dom.className="";this.btnEl.addClass(["x-btn-text",a||""]);this.setButtonClass()}return this},setTooltip:function(b,a){if(this.rendered){if(!a){this.clearTip()}if(Ext.isObject(b)){Ext.QuickTips.register(Ext.apply({target:this.btnEl.id},b));this.tooltip=b}else{this.btnEl.dom[this.tooltipType]=b}}else{this.tooltip=b}return this},clearTip:function(){if(Ext.isObject(this.tooltip)){Ext.QuickTips.unregister(this.btnEl)}},beforeDestroy:function(){if(this.rendered){this.clearTip()}if(this.menu&&this.destroyMenu!==false){Ext.destroy(this.menu)}Ext.destroy(this.repeater)},onDestroy:function(){if(this.rendered){this.doc.un("mouseover",this.monitorMouseOver,this);this.doc.un("mouseup",this.onMouseUp,this);delete this.doc;delete this.btnEl;Ext.ButtonToggleMgr.unregister(this)}Ext.Button.superclass.onDestroy.call(this)},doAutoWidth:function(){if(this.autoWidth!==false&&this.el&&this.text&&this.width===undefined){this.el.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var a=this.btnEl;if(a&&a.getWidth()>20){a.clip();a.setWidth(Ext.util.TextMetrics.measure(a,this.text).width+a.getFrameWidth("lr"))}}if(this.minWidth){if(this.el.getWidth()a}else{return c.getPageY()>this.btnEl.getRegion().bottom}},onClick:function(b,a){b.preventDefault();if(!this.disabled){if(this.isClickOnArrow(b)){if(this.menu&&!this.menu.isVisible()&&!this.ignoreNextClick){this.showMenu()}this.fireEvent("arrowclick",this,b);if(this.arrowHandler){this.arrowHandler.call(this.scope||this,this,b)}}else{if(this.enableToggle){this.toggle()}this.fireEvent("click",this,b);if(this.handler){this.handler.call(this.scope||this,this,b)}}}},isMenuTriggerOver:function(a){return this.menu&&a.target.tagName==this.arrowSelector},isMenuTriggerOut:function(b,a){return this.menu&&b.target.tagName!=this.arrowSelector}});Ext.reg("splitbutton",Ext.SplitButton);Ext.CycleButton=Ext.extend(Ext.SplitButton,{getItemText:function(a){if(a&&this.showText===true){var b="";if(this.prependText){b+=this.prependText}b+=a.text;return b}return undefined},setActiveItem:function(c,a){if(!Ext.isObject(c)){c=this.menu.getComponent(c)}if(c){if(!this.rendered){this.text=this.getItemText(c);this.iconCls=c.iconCls}else{var b=this.getItemText(c);if(b){this.setText(b)}this.setIconClass(c.iconCls)}this.activeItem=c;if(!c.checked){c.setChecked(true,false)}if(this.forceIcon){this.setIconClass(this.forceIcon)}if(!a){this.fireEvent("change",this,c)}}},getActiveItem:function(){return this.activeItem},initComponent:function(){this.addEvents("change");if(this.changeHandler){this.on("change",this.changeHandler,this.scope||this);delete this.changeHandler}this.itemCount=this.items.length;this.menu={cls:"x-cycle-menu",items:[]};var a=0;Ext.each(this.items,function(c,b){Ext.apply(c,{group:c.group||this.id,itemIndex:b,checkHandler:this.checkHandler,scope:this,checked:c.checked||false});this.menu.items.push(c);if(c.checked){a=b}},this);Ext.CycleButton.superclass.initComponent.call(this);this.on("click",this.toggleSelected,this);this.setActiveItem(a,true)},checkHandler:function(a,b){if(b){this.setActiveItem(a)}},toggleSelected:function(){var a=this.menu;a.render();if(!a.hasLayout){a.doLayout()}var d,b;for(var c=1;c"){b=new a.Fill()}else{b=new a.TextItem(b)}}}this.applyDefaults(b)}else{if(b.isFormField||b.render){b=this.createComponent(b)}else{if(b.tag){b=new a.Item({autoEl:b})}else{if(b.tagName){b=new a.Item({el:b})}else{if(Ext.isObject(b)){b=b.xtype?this.createComponent(b):this.constructButton(b)}}}}}return b},applyDefaults:function(e){if(!Ext.isString(e)){e=Ext.Toolbar.superclass.applyDefaults.call(this,e);var b=this.internalDefaults;if(e.events){Ext.applyIf(e.initialConfig,b);Ext.apply(e,b)}else{Ext.applyIf(e,b)}}return e},addSeparator:function(){return this.add(new a.Separator())},addSpacer:function(){return this.add(new a.Spacer())},addFill:function(){this.add(new a.Fill())},addElement:function(b){return this.addItem(new a.Item({el:b}))},addItem:function(b){return this.add.apply(this,arguments)},addButton:function(c){if(Ext.isArray(c)){var e=[];for(var d=0,b=c.length;d");this.items.push(this.displayItem=new a.TextItem({}))}Ext.PagingToolbar.superclass.initComponent.call(this);this.addEvents("change","beforechange");this.on("afterlayout",this.onFirstLayout,this,{single:true});this.cursor=0;this.bindStore(this.store,true)},onFirstLayout:function(){if(this.dsLoaded){this.onLoad.apply(this,this.dsLoaded)}},updateInfo:function(){if(this.displayItem){var b=this.store.getCount();var c=b==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+b,this.store.getTotalCount());this.displayItem.setText(c)}},onLoad:function(b,e,j){if(!this.rendered){this.dsLoaded=[b,e,j];return}var g=this.getParams();this.cursor=(j.params&&j.params[g.start])?j.params[g.start]:0;var i=this.getPageData(),c=i.activePage,h=i.pages;this.afterTextItem.setText(String.format(this.afterPageText,i.pages));this.inputItem.setValue(c);this.first.setDisabled(c==1);this.prev.setDisabled(c==1);this.next.setDisabled(c==h);this.last.setDisabled(c==h);this.refresh.enable();this.updateInfo();this.fireEvent("change",this,i)},getPageData:function(){var b=this.store.getTotalCount();return{total:b,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:b=1&g<=j.pages){i.setValue(g)}}}}}},getParams:function(){return this.paramNames||this.store.paramNames},beforeLoad:function(){if(this.rendered&&this.refresh){this.refresh.disable()}},doLoad:function(d){var c={},b=this.getParams();c[b.start]=d;c[b.limit]=this.pageSize;if(this.fireEvent("beforechange",this,c)!==false){this.store.load({params:c})}},moveFirst:function(){this.doLoad(0)},movePrevious:function(){this.doLoad(Math.max(0,this.cursor-this.pageSize))},moveNext:function(){this.doLoad(this.cursor+this.pageSize)},moveLast:function(){var c=this.store.getTotalCount(),b=c%this.pageSize;this.doLoad(b?(c-b):c-this.pageSize)},doRefresh:function(){this.doLoad(this.cursor)},bindStore:function(c,d){var b;if(!d&&this.store){if(c!==this.store&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("beforeload",this.beforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.onLoadError,this)}if(!c){this.store=null}}if(c){c=Ext.StoreMgr.lookup(c);c.on({scope:this,beforeload:this.beforeLoad,load:this.onLoad,exception:this.onLoadError});b=true}this.store=c;if(b){this.onLoad(c,null,{})}},unbind:function(b){this.bindStore(null)},bind:function(b){this.bindStore(b)},onDestroy:function(){this.bindStore(null);Ext.PagingToolbar.superclass.onDestroy.call(this)}})})();Ext.reg("paging",Ext.PagingToolbar);Ext.History=(function(){var e,c;var k=false;var d;function g(){var l=top.location.href,m=l.indexOf("#");return m>=0?l.substr(m+1):null}function a(){c.value=d}function h(l){d=l;Ext.History.fireEvent("change",l)}function i(m){var l=['
    ',Ext.util.Format.htmlEncode(m),"
    "].join("");try{var o=e.contentWindow.document;o.open();o.write(l);o.close();return true}catch(n){return false}}function b(){if(!e.contentWindow||!e.contentWindow.document){setTimeout(b,10);return}var o=e.contentWindow.document;var m=o.getElementById("state");var l=m?m.innerText:null;var n=g();setInterval(function(){o=e.contentWindow.document;m=o.getElementById("state");var q=m?m.innerText:null;var p=g();if(q!==l){l=q;h(l);top.location.hash=l;n=l;a()}else{if(p!==n){n=p;i(p)}}},50);k=true;Ext.History.fireEvent("ready",Ext.History)}function j(){d=c.value?c.value:g();if(Ext.isIE){b()}else{var l=g();setInterval(function(){var m=g();if(m!==l){l=m;h(l);a()}},50);k=true;Ext.History.fireEvent("ready",Ext.History)}}return{fieldId:"x-history-field",iframeId:"x-history-frame",events:{},init:function(m,l){if(k){Ext.callback(m,l,[this]);return}if(!Ext.isReady){Ext.onReady(function(){Ext.History.init(m,l)});return}c=Ext.getDom(Ext.History.fieldId);if(Ext.isIE){e=Ext.getDom(Ext.History.iframeId)}this.addEvents("ready","change");if(m){this.on("ready",m,l,{single:true})}j()},add:function(l,m){if(m!==false){if(this.getToken()==l){return true}}if(Ext.isIE){return i(l)}else{top.location.hash=l;return true}},back:function(){history.go(-1)},forward:function(){history.go(1)},getToken:function(){return k?d:g()}}})();Ext.apply(Ext.History,new Ext.util.Observable());Ext.Tip=Ext.extend(Ext.Panel,{minWidth:40,maxWidth:300,shadow:"sides",defaultAlign:"tl-bl?",autoRender:true,quickShowInterval:250,frame:true,hidden:true,baseCls:"x-tip",floating:{shadow:true,shim:true,useDisplay:true,constrain:false},autoHeight:true,closeAction:"hide",initComponent:function(){Ext.Tip.superclass.initComponent.call(this);if(this.closable&&!this.title){this.elements+=",header"}},afterRender:function(){Ext.Tip.superclass.afterRender.call(this);if(this.closable){this.addTool({id:"close",handler:this[this.closeAction],scope:this})}},showAt:function(a){Ext.Tip.superclass.show.call(this);if(this.measureWidth!==false&&(!this.initialConfig||typeof this.initialConfig.width!="number")){this.doAutoWidth()}if(this.constrainPosition){a=this.el.adjustForConstraints(a)}this.setPagePosition(a[0],a[1])},doAutoWidth:function(a){a=a||0;var b=this.body.getTextWidth();if(this.title){b=Math.max(b,this.header.child("span").getTextWidth(this.title))}b+=this.getFrameWidth()+(this.closable?20:0)+this.body.getPadding("lr")+a;this.setWidth(b.constrain(this.minWidth,this.maxWidth));if(Ext.isIE7&&!this.repainted){this.el.repaint();this.repainted=true}},showBy:function(a,b){if(!this.rendered){this.render(Ext.getBody())}this.showAt(this.el.getAlignToXY(a,b||this.defaultAlign))},initDraggable:function(){this.dd=new Ext.Tip.DD(this,typeof this.draggable=="boolean"?null:this.draggable);this.header.addClass("x-tip-draggable")}});Ext.reg("tip",Ext.Tip);Ext.Tip.DD=function(b,a){Ext.apply(this,a);this.tip=b;Ext.Tip.DD.superclass.constructor.call(this,b.el.id,"WindowDD-"+b.id);this.setHandleElId(b.header.id);this.scroll=false};Ext.extend(Ext.Tip.DD,Ext.dd.DD,{moveOnly:true,scroll:false,headerOffsets:[100,25],startDrag:function(){this.tip.el.disableShadow()},endDrag:function(a){this.tip.el.enableShadow(true)}});Ext.ToolTip=Ext.extend(Ext.Tip,{showDelay:500,hideDelay:200,dismissDelay:5000,trackMouse:false,anchorToTarget:true,anchorOffset:0,targetCounter:0,constrainPosition:false,initComponent:function(){Ext.ToolTip.superclass.initComponent.call(this);this.lastActive=new Date();this.initTarget(this.target);this.origAnchor=this.anchor},onRender:function(b,a){Ext.ToolTip.superclass.onRender.call(this,b,a);this.anchorCls="x-tip-anchor-"+this.getAnchorPosition();this.anchorEl=this.el.createChild({cls:"x-tip-anchor "+this.anchorCls})},afterRender:function(){Ext.ToolTip.superclass.afterRender.call(this);this.anchorEl.setStyle("z-index",this.el.getZIndex()+1)},initTarget:function(c){var a;if((a=Ext.get(c))){if(this.target){var b=Ext.get(this.target);this.mun(b,"mouseover",this.onTargetOver,this);this.mun(b,"mouseout",this.onTargetOut,this);this.mun(b,"mousemove",this.onMouseMove,this)}this.mon(a,{mouseover:this.onTargetOver,mouseout:this.onTargetOut,mousemove:this.onMouseMove,scope:this});this.target=a}if(this.anchor){this.anchorTarget=this.target}},onMouseMove:function(b){var a=this.delegate?b.getTarget(this.delegate):this.triggerElement=true;if(a){this.targetXY=b.getXY();if(a===this.triggerElement){if(!this.hidden&&this.trackMouse){this.setPagePosition(this.getTargetXY())}}else{this.hide();this.lastActive=new Date(0);this.onTargetOver(b)}}else{if(!this.closable&&this.isVisible()){this.hide()}}},getTargetXY:function(){if(this.delegate){this.anchorTarget=this.triggerElement}if(this.anchor){this.targetCounter++;var c=this.getOffsets(),l=(this.anchorToTarget&&!this.trackMouse)?this.el.getAlignToXY(this.anchorTarget,this.getAnchorAlign()):this.targetXY,a=Ext.lib.Dom.getViewWidth()-5,h=Ext.lib.Dom.getViewHeight()-5,i=document.documentElement,e=document.body,k=(i.scrollLeft||e.scrollLeft||0)+5,j=(i.scrollTop||e.scrollTop||0)+5,b=[l[0]+c[0],l[1]+c[1]],g=this.getSize();this.anchorEl.removeClass(this.anchorCls);if(this.targetCounter<2){if(b[0]a){if(this.anchorToTarget){this.defaultAlign="r-l";if(this.mouseOffset){this.mouseOffset[0]*=-1}}this.anchor="right";return this.getTargetXY()}if(b[1]h){if(this.anchorToTarget){this.defaultAlign="b-t";if(this.mouseOffset){this.mouseOffset[1]*=-1}}this.anchor="bottom";return this.getTargetXY()}}this.anchorCls="x-tip-anchor-"+this.getAnchorPosition();this.anchorEl.addClass(this.anchorCls);this.targetCounter=0;return b}else{var d=this.getMouseOffset();return[this.targetXY[0]+d[0],this.targetXY[1]+d[1]]}},getMouseOffset:function(){var a=this.anchor?[0,0]:[15,18];if(this.mouseOffset){a[0]+=this.mouseOffset[0];a[1]+=this.mouseOffset[1]}return a},getAnchorPosition:function(){if(this.anchor){this.tipAnchor=this.anchor.charAt(0)}else{var a=this.defaultAlign.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!a){throw"AnchorTip.defaultAlign is invalid"}this.tipAnchor=a[1].charAt(0)}switch(this.tipAnchor){case"t":return"top";case"b":return"bottom";case"r":return"right"}return"left"},getAnchorAlign:function(){switch(this.anchor){case"top":return"tl-bl";case"left":return"tl-tr";case"right":return"tr-tl";default:return"bl-tl"}},getOffsets:function(){var b,a=this.getAnchorPosition().charAt(0);if(this.anchorToTarget&&!this.trackMouse){switch(a){case"t":b=[0,9];break;case"b":b=[0,-13];break;case"r":b=[-13,0];break;default:b=[9,0];break}}else{switch(a){case"t":b=[-15-this.anchorOffset,30];break;case"b":b=[-19-this.anchorOffset,-13-this.el.dom.offsetHeight];break;case"r":b=[-15-this.el.dom.offsetWidth,-13-this.anchorOffset];break;default:b=[25,-13-this.anchorOffset];break}}var c=this.getMouseOffset();b[0]+=c[0];b[1]+=c[1];return b},onTargetOver:function(b){if(this.disabled||b.within(this.target.dom,true)){return}var a=b.getTarget(this.delegate);if(a){this.triggerElement=a;this.clearTimer("hide");this.targetXY=b.getXY();this.delayShow()}},delayShow:function(){if(this.hidden&&!this.showTimer){if(this.lastActive.getElapsed()=c){d=c-b-5}}return{x:a,y:d}},beforeDestroy:function(){this.clearTimers();Ext.destroy(this.anchorEl);delete this.anchorEl;delete this.target;delete this.anchorTarget;delete this.triggerElement;Ext.ToolTip.superclass.beforeDestroy.call(this)},onDestroy:function(){Ext.getDoc().un("mousedown",this.onDocMouseDown,this);Ext.ToolTip.superclass.onDestroy.call(this)}});Ext.reg("tooltip",Ext.ToolTip);Ext.QuickTip=Ext.extend(Ext.ToolTip,{interceptTitles:false,tagConfig:{namespace:"ext",attribute:"qtip",width:"qwidth",target:"target",title:"qtitle",hide:"hide",cls:"qclass",align:"qalign",anchor:"anchor"},initComponent:function(){this.target=this.target||Ext.getDoc();this.targets=this.targets||{};Ext.QuickTip.superclass.initComponent.call(this)},register:function(e){var h=Ext.isArray(e)?e:arguments;for(var g=0,a=h.length;g1){var d=function(i,h){if(i&&h){var j=h.findChild(a,b);if(j){j.select();if(g){g(true,j)}}else{if(g){g(false,j)}}}else{if(g){g(false,j)}}};this.expandPath(c.join(this.pathSeparator),a,d)}else{this.root.select();if(g){g(true,this.root)}}},getTreeEl:function(){return this.body},onRender:function(b,a){Ext.tree.TreePanel.superclass.onRender.call(this,b,a);this.el.addClass("x-tree");this.innerCt=this.body.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.useArrows?"x-tree-arrows":this.lines?"x-tree-lines":"x-tree-no-lines")})},initEvents:function(){Ext.tree.TreePanel.superclass.initEvents.call(this);if(this.containerScroll){Ext.dd.ScrollManager.register(this.body)}if((this.enableDD||this.enableDrop)&&!this.dropZone){this.dropZone=new Ext.tree.TreeDropZone(this,this.dropConfig||{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.ddAppendOnly===true})}if((this.enableDD||this.enableDrag)&&!this.dragZone){this.dragZone=new Ext.tree.TreeDragZone(this,this.dragConfig||{ddGroup:this.ddGroup||"TreeDD",scroll:this.ddScroll})}this.getSelectionModel().init(this)},afterRender:function(){Ext.tree.TreePanel.superclass.afterRender.call(this);this.renderRoot()},beforeDestroy:function(){if(this.rendered){Ext.dd.ScrollManager.unregister(this.body);Ext.destroy(this.dropZone,this.dragZone)}this.destroyRoot();Ext.destroy(this.loader);this.nodeHash=this.root=this.loader=null;Ext.tree.TreePanel.superclass.beforeDestroy.call(this)},destroyRoot:function(){if(this.root&&this.root.destroy){this.root.destroy(true)}}});Ext.tree.TreePanel.nodeTypes={};Ext.reg("treepanel",Ext.tree.TreePanel);Ext.tree.TreeEventModel=function(a){this.tree=a;this.tree.on("render",this.initEvents,this)};Ext.tree.TreeEventModel.prototype={initEvents:function(){var a=this.tree;if(a.trackMouseOver!==false){a.mon(a.innerCt,{scope:this,mouseover:this.delegateOver,mouseout:this.delegateOut})}a.mon(a.getTreeEl(),{scope:this,click:this.delegateClick,dblclick:this.delegateDblClick,contextmenu:this.delegateContextMenu})},getNode:function(b){var a;if(a=b.getTarget(".x-tree-node-el",10)){var c=Ext.fly(a,"_treeEvents").getAttribute("tree-node-id","ext");if(c){return this.tree.getNodeById(c)}}return null},getNodeTarget:function(b){var a=b.getTarget(".x-tree-node-icon",1);if(!a){a=b.getTarget(".x-tree-node-el",6)}return a},delegateOut:function(b,a){if(!this.beforeEvent(b)){return}if(b.getTarget(".x-tree-ec-icon",1)){var c=this.getNode(b);this.onIconOut(b,c);if(c==this.lastEcOver){delete this.lastEcOver}}if((a=this.getNodeTarget(b))&&!b.within(a,true)){this.onNodeOut(b,this.getNode(b))}},delegateOver:function(b,a){if(!this.beforeEvent(b)){return}if(Ext.isGecko&&!this.trackingDoc){Ext.getBody().on("mouseover",this.trackExit,this);this.trackingDoc=true}if(this.lastEcOver){this.onIconOut(b,this.lastEcOver);delete this.lastEcOver}if(b.getTarget(".x-tree-ec-icon",1)){this.lastEcOver=this.getNode(b);this.onIconOver(b,this.lastEcOver)}if(a=this.getNodeTarget(b)){this.onNodeOver(b,this.getNode(b))}},trackExit:function(a){if(this.lastOverNode){if(this.lastOverNode.ui&&!a.within(this.lastOverNode.ui.getEl())){this.onNodeOut(a,this.lastOverNode)}delete this.lastOverNode;Ext.getBody().un("mouseover",this.trackExit,this);this.trackingDoc=false}},delegateClick:function(b,a){if(this.beforeEvent(b)){if(b.getTarget("input[type=checkbox]",1)){this.onCheckboxClick(b,this.getNode(b))}else{if(b.getTarget(".x-tree-ec-icon",1)){this.onIconClick(b,this.getNode(b))}else{if(this.getNodeTarget(b)){this.onNodeClick(b,this.getNode(b))}}}}else{this.checkContainerEvent(b,"click")}},delegateDblClick:function(b,a){if(this.beforeEvent(b)){if(this.getNodeTarget(b)){this.onNodeDblClick(b,this.getNode(b))}}else{this.checkContainerEvent(b,"dblclick")}},delegateContextMenu:function(b,a){if(this.beforeEvent(b)){if(this.getNodeTarget(b)){this.onNodeContextMenu(b,this.getNode(b))}}else{this.checkContainerEvent(b,"contextmenu")}},checkContainerEvent:function(b,a){if(this.disabled){b.stopEvent();return false}this.onContainerEvent(b,a)},onContainerEvent:function(b,a){this.tree.fireEvent("container"+a,this.tree,b)},onNodeClick:function(b,a){a.ui.onClick(b)},onNodeOver:function(b,a){this.lastOverNode=a;a.ui.onOver(b)},onNodeOut:function(b,a){a.ui.onOut(b)},onIconOver:function(b,a){a.ui.addClass("x-tree-ec-over")},onIconOut:function(b,a){a.ui.removeClass("x-tree-ec-over")},onIconClick:function(b,a){a.ui.ecClick(b)},onCheckboxClick:function(b,a){a.ui.onCheckChange(b)},onNodeDblClick:function(b,a){a.ui.onDblClick(b)},onNodeContextMenu:function(b,a){a.ui.onContextMenu(b)},beforeEvent:function(b){var a=this.getNode(b);if(this.disabled||!a||!a.ui){b.stopEvent();return false}return true},disable:function(){this.disabled=true},enable:function(){this.disabled=false}};Ext.tree.DefaultSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(a){this.selNode=null;this.addEvents("selectionchange","beforeselect");Ext.apply(this,a);Ext.tree.DefaultSelectionModel.superclass.constructor.call(this)},init:function(a){this.tree=a;a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this);a.on("click",this.onNodeClick,this)},onNodeClick:function(a,b){this.select(a)},select:function(c,a){if(!Ext.fly(c.ui.wrap).isVisible()&&a){return a.call(this,c)}var b=this.selNode;if(c==b){c.ui.onSelectedChange(true)}else{if(this.fireEvent("beforeselect",this,c,b)!==false){if(b&&b.ui){b.ui.onSelectedChange(false)}this.selNode=c;c.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,c,b)}}return c},unselect:function(b,a){if(this.selNode==b){this.clearSelections(a)}},clearSelections:function(a){var b=this.selNode;if(b){b.ui.onSelectedChange(false);this.selNode=null;if(a!==true){this.fireEvent("selectionchange",this,null)}}return b},getSelectedNode:function(){return this.selNode},isSelected:function(a){return this.selNode==a},selectPrevious:function(a){if(!(a=a||this.selNode||this.lastSelNode)){return null}var c=a.previousSibling;if(c){if(!c.isExpanded()||c.childNodes.length<1){return this.select(c,this.selectPrevious)}else{var b=c.lastChild;while(b&&b.isExpanded()&&Ext.fly(b.ui.wrap).isVisible()&&b.childNodes.length>0){b=b.lastChild}return this.select(b,this.selectPrevious)}}else{if(a.parentNode&&(this.tree.rootVisible||!a.parentNode.isRoot)){return this.select(a.parentNode,this.selectPrevious)}}return null},selectNext:function(b){if(!(b=b||this.selNode||this.lastSelNode)){return null}if(b.firstChild&&b.isExpanded()&&Ext.fly(b.ui.wrap).isVisible()){return this.select(b.firstChild,this.selectNext)}else{if(b.nextSibling){return this.select(b.nextSibling,this.selectNext)}else{if(b.parentNode){var a=null;b.parentNode.bubble(function(){if(this.nextSibling){a=this.getOwnerTree().selModel.select(this.nextSibling,this.selectNext);return false}});return a}}}return null},onKeyDown:function(c){var b=this.selNode||this.lastSelNode;var d=this;if(!b){return}var a=c.getKey();switch(a){case c.DOWN:c.stopEvent();this.selectNext();break;case c.UP:c.stopEvent();this.selectPrevious();break;case c.RIGHT:c.preventDefault();if(b.hasChildNodes()){if(!b.isExpanded()){b.expand()}else{if(b.firstChild){this.select(b.firstChild,c)}}}break;case c.LEFT:c.preventDefault();if(b.hasChildNodes()&&b.isExpanded()){b.collapse()}else{if(b.parentNode&&(this.tree.rootVisible||b.parentNode!=this.tree.getRootNode())){this.select(b.parentNode,c)}}break}}});Ext.tree.MultiSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(a){this.selNodes=[];this.selMap={};this.addEvents("selectionchange");Ext.apply(this,a);Ext.tree.MultiSelectionModel.superclass.constructor.call(this)},init:function(a){this.tree=a;a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this);a.on("click",this.onNodeClick,this)},onNodeClick:function(a,b){if(b.ctrlKey&&this.isSelected(a)){this.unselect(a)}else{this.select(a,b,b.ctrlKey)}},select:function(a,c,b){if(b!==true){this.clearSelections(true)}if(this.isSelected(a)){this.lastSelNode=a;return a}this.selNodes.push(a);this.selMap[a.id]=a;this.lastSelNode=a;a.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,this.selNodes);return a},unselect:function(b){if(this.selMap[b.id]){b.ui.onSelectedChange(false);var c=this.selNodes;var a=c.indexOf(b);if(a!=-1){this.selNodes.splice(a,1)}delete this.selMap[b.id];this.fireEvent("selectionchange",this,this.selNodes)}},clearSelections:function(b){var d=this.selNodes;if(d.length>0){for(var c=0,a=d.length;c0},isExpandable:function(){return this.attributes.expandable||this.hasChildNodes()},appendChild:function(e){var g=false;if(Ext.isArray(e)){g=e}else{if(arguments.length>1){g=arguments}}if(g){for(var d=0,a=g.length;d0){var g=d?function(){e.apply(d,arguments)}:e;c.sort(g);for(var b=0;b
    ','',this.indentMarkup,"",'','',g?('':"/>")):"",'',e.text,"
    ",'',""].join("");if(l!==true&&e.nextSibling&&(b=e.nextSibling.ui.getEl())){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",b,d)}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",j,d)}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var i=this.elNode.childNodes;this.indentNode=i[0];this.ecNode=i[1];this.iconNode=i[2];var h=3;if(g){this.checkbox=i[3];this.checkbox.defaultChecked=this.checkbox.checked;h++}this.anchor=i[h];this.textNode=i[h].firstChild},getAnchor:function(){return this.anchor},getTextEl:function(){return this.textNode},getIconEl:function(){return this.iconNode},isChecked:function(){return this.checkbox?this.checkbox.checked:false},updateExpandIcon:function(){if(this.rendered){var g=this.node,d,c,a=g.isLast()?"x-tree-elbow-end":"x-tree-elbow",e=g.hasChildNodes();if(e||g.attributes.expandable){if(g.expanded){a+="-minus";d="x-tree-node-collapsed";c="x-tree-node-expanded"}else{a+="-plus";d="x-tree-node-expanded";c="x-tree-node-collapsed"}if(this.wasLeaf){this.removeClass("x-tree-node-leaf");this.wasLeaf=false}if(this.c1!=d||this.c2!=c){Ext.fly(this.elNode).replaceClass(d,c);this.c1=d;this.c2=c}}else{if(!this.wasLeaf){Ext.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-collapsed");delete this.c1;delete this.c2;this.wasLeaf=true}}var b="x-tree-ec-icon "+a;if(this.ecc!=b){this.ecNode.className=b;this.ecc=b}}},onIdChange:function(a){if(this.rendered){this.elNode.setAttribute("ext:tree-node-id",a)}},getChildIndent:function(){if(!this.childIndent){var a=[],b=this.node;while(b){if(!b.isRoot||(b.isRoot&&b.ownerTree.rootVisible)){if(!b.isLast()){a.unshift('')}else{a.unshift('')}}b=b.parentNode}this.childIndent=a.join("")}return this.childIndent},renderIndent:function(){if(this.rendered){var a="",b=this.node.parentNode;if(b){a=b.ui.getChildIndent()}if(this.indentMarkup!=a){this.indentNode.innerHTML=a;this.indentMarkup=a}this.updateExpandIcon()}},destroy:function(){if(this.elNode){Ext.dd.Registry.unregister(this.elNode.id)}Ext.each(["textnode","anchor","checkbox","indentNode","ecNode","iconNode","elNode","ctNode","wrap","holder"],function(a){if(this[a]){Ext.fly(this[a]).remove();delete this[a]}},this);delete this.node}};Ext.tree.RootTreeNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{render:function(){if(!this.rendered){var a=this.node.ownerTree.innerCt.dom;this.node.expanded=true;a.innerHTML='
    ';this.wrap=this.ctNode=a.firstChild}},collapse:Ext.emptyFn,expand:Ext.emptyFn});Ext.tree.TreeLoader=function(a){this.baseParams={};Ext.apply(this,a);this.addEvents("beforeload","load","loadexception");Ext.tree.TreeLoader.superclass.constructor.call(this);if(Ext.isString(this.paramOrder)){this.paramOrder=this.paramOrder.split(/[\s,|]/)}};Ext.extend(Ext.tree.TreeLoader,Ext.util.Observable,{uiProviders:{},clearOnLoad:true,paramOrder:undefined,paramsAsHash:false,nodeParameter:"node",directFn:undefined,load:function(b,c,a){if(this.clearOnLoad){while(b.firstChild){b.removeChild(b.firstChild)}}if(this.doPreload(b)){this.runCallback(c,a||b,[b])}else{if(this.directFn||this.dataUrl||this.url){this.requestData(b,c,a||b)}}},doPreload:function(d){if(d.attributes.children){if(d.childNodes.length<1){var c=d.attributes.children;d.beginUpdate();for(var b=0,a=c.length;b-1){c=[]}for(var d=0,a=b.length;dl){return e?-1:+1}else{return 0}}}};Ext.tree.TreeSorter.prototype={doSort:function(a){a.sort(this.sortFn)},compareNodes:function(b,a){return(b.text.toUpperCase()>a.text.toUpperCase()?1:-1)},updateSort:function(a,b){if(b.childrenRendered){this.doSort.defer(1,this,[b])}},updateSortParent:function(a){var b=a.parentNode;if(b&&b.childrenRendered){this.doSort.defer(1,this,[b])}}};if(Ext.dd.DropZone){Ext.tree.TreeDropZone=function(a,b){this.allowParentInsert=b.allowParentInsert||false;this.allowContainerDrop=b.allowContainerDrop||false;this.appendOnly=b.appendOnly||false;Ext.tree.TreeDropZone.superclass.constructor.call(this,a.getTreeEl(),b);this.tree=a;this.dragOverData={};this.lastInsertClass="x-tree-no-status"};Ext.extend(Ext.tree.TreeDropZone,Ext.dd.DropZone,{ddGroup:"TreeDD",expandDelay:1000,expandNode:function(a){if(a.hasChildNodes()&&!a.isExpanded()){a.expand(false,null,this.triggerCacheRefresh.createDelegate(this))}},queueExpand:function(a){this.expandProcId=this.expandNode.defer(this.expandDelay,this,[a])},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId);this.expandProcId=false}},isValidDropPoint:function(a,k,i,d,c){if(!a||!c){return false}var g=a.node;var h=c.node;if(!(g&&g.isTarget&&k)){return false}if(k=="append"&&g.allowChildren===false){return false}if((k=="above"||k=="below")&&(g.parentNode&&g.parentNode.allowChildren===false)){return false}if(h&&(g==h||h.contains(g))){return false}var b=this.dragOverData;b.tree=this.tree;b.target=g;b.data=c;b.point=k;b.source=i;b.rawEvent=d;b.dropNode=h;b.cancel=false;var j=this.tree.fireEvent("nodedragover",b);return b.cancel===false&&j!==false},getDropPoint:function(h,g,l){var m=g.node;if(m.isRoot){return m.allowChildren!==false?"append":false}var c=g.ddel;var o=Ext.lib.Dom.getY(c),j=o+c.offsetHeight;var i=Ext.lib.Event.getPageY(h);var k=m.allowChildren===false||m.isLeaf();if(this.appendOnly||m.parentNode.allowChildren===false){return k?false:"append"}var d=false;if(!this.allowParentInsert){d=m.hasChildNodes()&&m.isExpanded()}var a=(j-o)/(k?2:3);if(i>=o&&i<(o+a)){return"above"}else{if(!d&&(k||i>=j-a&&i<=j)){return"below"}else{return"append"}}},onNodeEnter:function(d,a,c,b){this.cancelExpand()},onContainerOver:function(a,c,b){if(this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,node:this.tree.getRootNode()},"append",a,c,b)){return this.dropAllowed}return this.dropNotAllowed},onNodeOver:function(b,i,h,g){var k=this.getDropPoint(h,b,i);var c=b.node;if(!this.expandProcId&&k=="append"&&c.hasChildNodes()&&!b.node.isExpanded()){this.queueExpand(c)}else{if(k!="append"){this.cancelExpand()}}var d=this.dropNotAllowed;if(this.isValidDropPoint(b,k,i,h,g)){if(k){var a=b.ddel;var j;if(k=="above"){d=b.node.isFirst()?"x-tree-drop-ok-above":"x-tree-drop-ok-between";j="x-tree-drag-insert-above"}else{if(k=="below"){d=b.node.isLast()?"x-tree-drop-ok-below":"x-tree-drop-ok-between";j="x-tree-drag-insert-below"}else{d="x-tree-drop-ok-append";j="x-tree-drag-append"}}if(this.lastInsertClass!=j){Ext.fly(a).replaceClass(this.lastInsertClass,j);this.lastInsertClass=j}}}return d},onNodeOut:function(d,a,c,b){this.cancelExpand();this.removeDropIndicators(d)},onNodeDrop:function(i,b,h,d){var a=this.getDropPoint(h,i,b);var g=i.node;g.ui.startDrop();if(!this.isValidDropPoint(i,a,b,h,d)){g.ui.endDrop();return false}var c=d.node||(b.getTreeNode?b.getTreeNode(d,g,a,h):null);return this.processDrop(g,d,a,b,h,c)},onContainerDrop:function(a,g,c){if(this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,node:this.tree.getRootNode()},"append",a,g,c)){var d=this.tree.getRootNode();d.ui.startDrop();var b=c.node||(a.getTreeNode?a.getTreeNode(c,d,"append",g):null);return this.processDrop(d,c,"append",a,g,b)}return false},processDrop:function(j,h,b,a,i,d){var g={tree:this.tree,target:j,data:h,point:b,source:a,rawEvent:i,dropNode:d,cancel:!d,dropStatus:false};var c=this.tree.fireEvent("beforenodedrop",g);if(c===false||g.cancel===true||!g.dropNode){j.ui.endDrop();return g.dropStatus}j=g.target;if(b=="append"&&!j.isExpanded()){j.expand(false,null,function(){this.completeDrop(g)}.createDelegate(this))}else{this.completeDrop(g)}return true},completeDrop:function(h){var d=h.dropNode,e=h.point,c=h.target;if(!Ext.isArray(d)){d=[d]}var g;for(var b=0,a=d.length;bd.offsetLeft){e.scrollLeft=d.offsetLeft}var a=Math.min(this.maxWidth,(e.clientWidth>20?e.clientWidth:e.offsetWidth)-Math.max(0,d.offsetLeft-e.scrollLeft)-5);this.setSize(a,"")},triggerEdit:function(a,c){this.completeEdit();if(a.attributes.editable!==false){this.editNode=a;if(this.tree.autoScroll){Ext.fly(a.ui.getEl()).scrollIntoView(this.tree.body)}var b=a.text||"";if(!Ext.isGecko&&Ext.isEmpty(a.text)){a.setText(" ")}this.autoEditTimer=this.startEdit.defer(this.editDelay,this,[a.ui.textNode,b]);return false}},bindScroll:function(){this.tree.getTreeEl().on("scroll",this.cancelEdit,this)},beforeNodeClick:function(a,b){clearTimeout(this.autoEditTimer);if(this.tree.getSelectionModel().isSelected(a)){b.stopEvent();return this.triggerEdit(a)}},onNodeDblClick:function(a,b){clearTimeout(this.autoEditTimer)},updateNode:function(a,b){this.tree.getTreeEl().un("scroll",this.cancelEdit,this);this.editNode.setText(b)},onHide:function(){Ext.tree.TreeEditor.superclass.onHide.call(this);if(this.editNode){this.editNode.ui.focus.defer(50,this.editNode.ui)}},onSpecialKey:function(c,b){var a=b.getKey();if(a==b.ESC){b.stopEvent();this.cancelEdit()}else{if(a==b.ENTER&&!b.hasModifier()){b.stopEvent();this.completeEdit()}}},onDestroy:function(){clearTimeout(this.autoEditTimer);Ext.tree.TreeEditor.superclass.onDestroy.call(this);var a=this.tree;a.un("beforeclick",this.beforeNodeClick,this);a.un("dblclick",this.onNodeDblClick,this)}}); /* SWFObject v2.2 is released under the MIT License */ -var swfobject=function(){var F="undefined",s="object",U="Shockwave Flash",Y="ShockwaveFlash.ShockwaveFlash",r="application/x-shockwave-flash",T="SWFObjectExprInst",z="onreadystatechange",Q=window,k=document,u=navigator,V=false,W=[i],p=[],P=[],K=[],m,S,G,D,L=false,a=false,o,I,n=true,O=function(){var ac=typeof k.getElementById!=F&&typeof k.getElementsByTagName!=F&&typeof k.createElement!=F,aj=u.userAgent.toLowerCase(),aa=u.platform.toLowerCase(),ag=aa?/win/.test(aa):/win/.test(aj),ae=aa?/mac/.test(aa):/mac/.test(aj),ah=/webkit/.test(aj)?parseFloat(aj.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,Z=!+"\v1",ai=[0,0,0],ad=null;if(typeof u.plugins!=F&&typeof u.plugins[U]==s){ad=u.plugins[U].description;if(ad&&!(typeof u.mimeTypes!=F&&u.mimeTypes[r]&&!u.mimeTypes[r].enabledPlugin)){V=true;Z=false;ad=ad.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ai[0]=parseInt(ad.replace(/^(.*)\..*$/,"$1"),10);ai[1]=parseInt(ad.replace(/^.*\.(.*)\s.*$/,"$1"),10);ai[2]=/[a-zA-Z]/.test(ad)?parseInt(ad.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof Q.ActiveXObject!=F){try{var af=new ActiveXObject(Y);if(af){ad=af.GetVariable("$version");if(ad){Z=true;ad=ad.split(" ")[1].split(",");ai=[parseInt(ad[0],10),parseInt(ad[1],10),parseInt(ad[2],10)]}}}catch(ab){}}}return{w3:ac,pv:ai,wk:ah,ie:Z,win:ag,mac:ae}}(),l=function(){if(!O.w3){return}if((typeof k.readyState!=F&&k.readyState=="complete")||(typeof k.readyState==F&&(k.getElementsByTagName("body")[0]||k.body))){g()}if(!L){if(typeof k.addEventListener!=F){k.addEventListener("DOMContentLoaded",g,false)}if(O.ie&&O.win){k.attachEvent(z,function(){if(k.readyState=="complete"){k.detachEvent(z,arguments.callee);g()}});if(Q==top){(function(){if(L){return}try{k.documentElement.doScroll("left")}catch(Z){setTimeout(arguments.callee,0);return}g()})()}}if(O.wk){(function(){if(L){return}if(!/loaded|complete/.test(k.readyState)){setTimeout(arguments.callee,0);return}g()})()}t(g)}}();function g(){if(L){return}try{var ab=k.getElementsByTagName("body")[0].appendChild(E("span"));ab.parentNode.removeChild(ab)}catch(ac){return}L=true;var Z=W.length;for(var aa=0;aa0){for(var ah=0;ah0){var ag=c(aa);if(ag){if(H(p[ah].swfVersion)&&!(O.wk&&O.wk<312)){y(aa,true);if(ad){ac.success=true;ac.ref=B(aa);ad(ac)}}else{if(p[ah].expressInstall&&C()){var ak={};ak.data=p[ah].expressInstall;ak.width=ag.getAttribute("width")||"0";ak.height=ag.getAttribute("height")||"0";if(ag.getAttribute("class")){ak.styleclass=ag.getAttribute("class")}if(ag.getAttribute("align")){ak.align=ag.getAttribute("align")}var aj={};var Z=ag.getElementsByTagName("param");var ae=Z.length;for(var af=0;af'}}ac.outerHTML='"+ah+"";P[P.length]=ak.id;Z=c(ak.id)}else{var ab=E(s);ab.setAttribute("type",r);for(var ae in ak){if(ak[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="styleclass"){ab.setAttribute("class",ak[ae])}else{if(ae.toLowerCase()!="classid"){ab.setAttribute(ae,ak[ae])}}}}for(var ad in ai){if(ai[ad]!=Object.prototype[ad]&&ad.toLowerCase()!="movie"){e(ab,ad,ai[ad])}}ac.parentNode.replaceChild(ab,ac);Z=ab}}return Z}function e(ab,Z,aa){var ac=E("param");ac.setAttribute("name",Z);ac.setAttribute("value",aa);ab.appendChild(ac)}function A(aa){var Z=c(aa);if(Z&&Z.nodeName=="OBJECT"){if(O.ie&&O.win){Z.style.display="none";(function(){if(Z.readyState==4){b(aa)}else{setTimeout(arguments.callee,10)}})()}else{Z.parentNode.removeChild(Z)}}}function b(ab){var aa=c(ab);if(aa){for(var Z in aa){if(typeof aa[Z]=="function"){aa[Z]=null}}aa.parentNode.removeChild(aa)}}function c(ab){var Z=null;try{Z=k.getElementById(ab)}catch(aa){}return Z}function E(Z){return k.createElement(Z)}function j(ab,Z,aa){ab.attachEvent(Z,aa);K[K.length]=[ab,Z,aa]}function H(ab){var aa=O.pv,Z=ab.split(".");Z[0]=parseInt(Z[0],10);Z[1]=parseInt(Z[1],10)||0;Z[2]=parseInt(Z[2],10)||0;return(aa[0]>Z[0]||(aa[0]==Z[0]&&aa[1]>Z[1])||(aa[0]==Z[0]&&aa[1]==Z[1]&&aa[2]>=Z[2]))?true:false}function x(ae,aa,af,ad){if(O.ie&&O.mac){return}var ac=k.getElementsByTagName("head")[0];if(!ac){return}var Z=(af&&typeof af=="string")?af:"screen";if(ad){o=null;I=null}if(!o||I!=Z){var ab=E("style");ab.setAttribute("type","text/css");ab.setAttribute("media",Z);o=ac.appendChild(ab);if(O.ie&&O.win&&typeof k.styleSheets!=F&&k.styleSheets.length>0){o=k.styleSheets[k.styleSheets.length-1]}I=Z}if(O.ie&&O.win){if(o&&typeof o.addRule==s){o.addRule(ae,aa)}}else{if(o&&typeof k.createTextNode!=F){o.appendChild(k.createTextNode(ae+" {"+aa+"}"))}}}function y(ab,Z){if(!n){return}var aa=Z?"visible":"hidden";if(L&&c(ab)){c(ab).style.visibility=aa}else{x("#"+ab,"visibility:"+aa)}}function N(aa){var ab=/[\\\"<>\.;]/;var Z=ab.exec(aa)!=null;return Z&&typeof encodeURIComponent!=F?encodeURIComponent(aa):aa}var d=function(){if(O.ie&&O.win){window.attachEvent("onunload",function(){var ae=K.length;for(var ad=0;ad0){for(h=0;h-1&&e.position=="left"){e.position="bottom"}return e},onDestroy:function(){Ext.chart.CartesianChart.superclass.onDestroy.call(this);Ext.each(this.labelFn,function(a){this.removeFnProxy(a)},this)}});Ext.reg("cartesianchart",Ext.chart.CartesianChart);Ext.chart.LineChart=Ext.extend(Ext.chart.CartesianChart,{type:"line"});Ext.reg("linechart",Ext.chart.LineChart);Ext.chart.ColumnChart=Ext.extend(Ext.chart.CartesianChart,{type:"column"});Ext.reg("columnchart",Ext.chart.ColumnChart);Ext.chart.StackedColumnChart=Ext.extend(Ext.chart.CartesianChart,{type:"stackcolumn"});Ext.reg("stackedcolumnchart",Ext.chart.StackedColumnChart);Ext.chart.BarChart=Ext.extend(Ext.chart.CartesianChart,{type:"bar"});Ext.reg("barchart",Ext.chart.BarChart);Ext.chart.StackedBarChart=Ext.extend(Ext.chart.CartesianChart,{type:"stackbar"});Ext.reg("stackedbarchart",Ext.chart.StackedBarChart);Ext.chart.Axis=function(a){Ext.apply(this,a)};Ext.chart.Axis.prototype={type:null,orientation:"horizontal",reverse:false,labelFunction:null,hideOverlappingLabels:true,labelSpacing:2};Ext.chart.NumericAxis=Ext.extend(Ext.chart.Axis,{type:"numeric",minimum:NaN,maximum:NaN,majorUnit:NaN,minorUnit:NaN,snapToUnits:true,alwaysShowZero:true,scale:"linear",roundMajorUnit:true,calculateByLabelSize:true,position:"left",adjustMaximumByMajorUnit:true,adjustMinimumByMajorUnit:true});Ext.chart.TimeAxis=Ext.extend(Ext.chart.Axis,{type:"time",minimum:null,maximum:null,majorUnit:NaN,majorTimeUnit:null,minorUnit:NaN,minorTimeUnit:null,snapToUnits:true,stackingEnabled:false,calculateByLabelSize:true});Ext.chart.CategoryAxis=Ext.extend(Ext.chart.Axis,{type:"category",categoryNames:null,calculateCategoryCount:false});Ext.chart.Series=function(a){Ext.apply(this,a)};Ext.chart.Series.prototype={type:null,displayName:null};Ext.chart.CartesianSeries=Ext.extend(Ext.chart.Series,{xField:null,yField:null,showInLegend:true,axis:"primary"});Ext.chart.ColumnSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"column"});Ext.chart.LineSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"line"});Ext.chart.BarSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"bar"});Ext.chart.PieSeries=Ext.extend(Ext.chart.Series,{type:"pie",dataField:null,categoryField:null});Ext.menu.Menu=Ext.extend(Ext.Container,{minWidth:120,shadow:"sides",subMenuAlign:"tl-tr?",defaultAlign:"tl-bl?",allowOtherMenus:false,ignoreParentClicks:false,enableScrolling:true,maxHeight:null,scrollIncrement:24,showSeparator:true,defaultOffsets:[0,0],plain:false,floating:true,zIndex:15000,hidden:true,layout:"menu",hideMode:"offsets",scrollerHeight:8,autoLayout:true,defaultType:"menuitem",bufferResize:false,initComponent:function(){if(Ext.isArray(this.initialConfig)){Ext.apply(this,{items:this.initialConfig})}this.addEvents("click","mouseover","mouseout","itemclick");Ext.menu.MenuMgr.register(this);if(this.floating){Ext.EventManager.onWindowResize(this.hide,this)}else{if(this.initialConfig.hidden!==false){this.hidden=false}this.internalDefaults={hideOnClick:false}}Ext.menu.Menu.superclass.initComponent.call(this);if(this.autoLayout){var a=this.doLayout.createDelegate(this,[]);this.on({add:a,remove:a})}},getLayoutTarget:function(){return this.ul},onRender:function(b,a){if(!b){b=Ext.getBody()}var c={id:this.getId(),cls:"x-menu "+((this.floating)?"x-menu-floating x-layer ":"")+(this.cls||"")+(this.plain?" x-menu-plain":"")+(this.showSeparator?"":" x-menu-nosep"),style:this.style,cn:[{tag:"a",cls:"x-menu-focus",href:"#",onclick:"return false;",tabIndex:"-1"},{tag:"ul",cls:"x-menu-list"}]};if(this.floating){this.el=new Ext.Layer({shadow:this.shadow,dh:c,constrain:false,parentEl:b,zindex:this.zIndex})}else{this.el=b.createChild(c)}Ext.menu.Menu.superclass.onRender.call(this,b,a);if(!this.keyNav){this.keyNav=new Ext.menu.MenuNav(this)}this.focusEl=this.el.child("a.x-menu-focus");this.ul=this.el.child("ul.x-menu-list");this.mon(this.ul,{scope:this,click:this.onClick,mouseover:this.onMouseOver,mouseout:this.onMouseOut});if(this.enableScrolling){this.mon(this.el,{scope:this,delegate:".x-menu-scroller",click:this.onScroll,mouseover:this.deactivateActive})}},findTargetItem:function(b){var a=b.getTarget(".x-menu-list-item",this.ul,true);if(a&&a.menuItemId){return this.items.get(a.menuItemId)}},onClick:function(b){var a=this.findTargetItem(b);if(a){if(a.isFormField){this.setActiveItem(a)}else{if(a instanceof Ext.menu.BaseItem){if(a.menu&&this.ignoreParentClicks){a.expandMenu();b.preventDefault()}else{if(a.onClick){a.onClick(b);this.fireEvent("click",this,a,b)}}}}}},setActiveItem:function(a,b){if(a!=this.activeItem){this.deactivateActive();if((this.activeItem=a).isFormField){a.focus()}else{a.activate(b)}}else{if(b){a.expandMenu()}}},deactivateActive:function(){var b=this.activeItem;if(b){if(b.isFormField){if(b.collapse){b.collapse()}}else{b.deactivate()}delete this.activeItem}},tryActivate:function(g,e){var b=this.items;for(var c=g,a=b.length;c>=0&&c=a.scrollHeight){this.onScrollerOut(null,b)}},onScrollerIn:function(d,b){var a=this.ul.dom,c=Ext.fly(b).is(".x-menu-scroller-top");if(c?a.scrollTop>0:a.scrollTop+this.activeMaxc){b=c;a=i-h}else{if(bb&&b>0){this.activeMax=b-this.scrollerHeight*2-this.el.getFrameWidth("tb")-Ext.num(this.el.shadowOffset,0);this.ul.setHeight(this.activeMax);this.createScrollers();this.el.select(".x-menu-scroller").setDisplayed("")}else{this.ul.setHeight(d);this.el.select(".x-menu-scroller").setDisplayed("none")}this.ul.dom.scrollTop=0;return a},createScrollers:function(){if(!this.scroller){this.scroller={pos:0,top:this.el.insertFirst({tag:"div",cls:"x-menu-scroller x-menu-scroller-top",html:" "}),bottom:this.el.createChild({tag:"div",cls:"x-menu-scroller x-menu-scroller-bottom",html:" "})};this.scroller.top.hover(this.onScrollerIn,this.onScrollerOut,this);this.scroller.topRepeater=new Ext.util.ClickRepeater(this.scroller.top,{listeners:{click:this.onScroll.createDelegate(this,[null,this.scroller.top],false)}});this.scroller.bottom.hover(this.onScrollerIn,this.onScrollerOut,this);this.scroller.bottomRepeater=new Ext.util.ClickRepeater(this.scroller.bottom,{listeners:{click:this.onScroll.createDelegate(this,[null,this.scroller.bottom],false)}})}},onLayout:function(){if(this.isVisible()){if(this.enableScrolling){this.constrainScroll(this.el.getTop())}if(this.floating){this.el.sync()}}},focus:function(){if(!this.hidden){this.doFocus.defer(50,this)}},doFocus:function(){if(!this.hidden){this.focusEl.focus()}},hide:function(a){if(!this.isDestroyed){this.deepHide=a;Ext.menu.Menu.superclass.hide.call(this);delete this.deepHide}},onHide:function(){Ext.menu.Menu.superclass.onHide.call(this);this.deactivateActive();if(this.el&&this.floating){this.el.hide()}var a=this.parentMenu;if(this.deepHide===true&&a){if(a.floating){a.hide(true)}else{a.deactivateActive()}}},lookupComponent:function(a){if(Ext.isString(a)){a=(a=="separator"||a=="-")?new Ext.menu.Separator():new Ext.menu.TextItem(a);this.applyDefaults(a)}else{if(Ext.isObject(a)){a=this.getMenuItem(a)}else{if(a.tagName||a.el){a=new Ext.BoxComponent({el:a})}}}return a},applyDefaults:function(b){if(!Ext.isString(b)){b=Ext.menu.Menu.superclass.applyDefaults.call(this,b);var a=this.internalDefaults;if(a){if(b.events){Ext.applyIf(b.initialConfig,a);Ext.apply(b,a)}else{Ext.applyIf(b,a)}}}return b},getMenuItem:function(a){if(!a.isXType){if(!a.xtype&&Ext.isBoolean(a.checked)){return new Ext.menu.CheckItem(a)}return Ext.create(a,this.defaultType)}return a},addSeparator:function(){return this.add(new Ext.menu.Separator())},addElement:function(a){return this.add(new Ext.menu.BaseItem({el:a}))},addItem:function(a){return this.add(a)},addMenuItem:function(a){return this.add(this.getMenuItem(a))},addText:function(a){return this.add(new Ext.menu.TextItem(a))},onDestroy:function(){Ext.EventManager.removeResizeListener(this.hide,this);var a=this.parentMenu;if(a&&a.activeChild==this){delete a.activeChild}delete this.parentMenu;Ext.menu.Menu.superclass.onDestroy.call(this);Ext.menu.MenuMgr.unregister(this);if(this.keyNav){this.keyNav.disable()}var b=this.scroller;if(b){Ext.destroy(b.topRepeater,b.bottomRepeater,b.top,b.bottom)}Ext.destroy(this.el,this.focusEl,this.ul)}});Ext.reg("menu",Ext.menu.Menu);Ext.menu.MenuNav=Ext.extend(Ext.KeyNav,function(){function a(d,c){if(!c.tryActivate(c.items.indexOf(c.activeItem)-1,-1)){c.tryActivate(c.items.length-1,-1)}}function b(d,c){if(!c.tryActivate(c.items.indexOf(c.activeItem)+1,1)){c.tryActivate(0,1)}}return{constructor:function(c){Ext.menu.MenuNav.superclass.constructor.call(this,c.el);this.scope=this.menu=c},doRelay:function(g,d){var c=g.getKey();if(this.menu.activeItem&&this.menu.activeItem.isFormField&&c!=g.TAB){return false}if(!this.menu.activeItem&&g.isNavKeyPress()&&c!=g.SPACE&&c!=g.RETURN){this.menu.tryActivate(0,1);return false}return d.call(this.scope||this,g,this.menu)},tab:function(d,c){d.stopEvent();if(d.shiftKey){a(d,c)}else{b(d,c)}},up:a,down:b,right:function(d,c){if(c.activeItem){c.activeItem.expandMenu(true)}},left:function(d,c){c.hide();if(c.parentMenu&&c.parentMenu.activeItem){c.parentMenu.activeItem.activate()}},enter:function(d,c){if(c.activeItem){d.stopPropagation();c.activeItem.onClick(d);c.fireEvent("click",this,c.activeItem);return true}}}}());Ext.menu.MenuMgr=function(){var g,d,c={},a=false,l=new Date();function n(){g={};d=new Ext.util.MixedCollection();Ext.getDoc().addKeyListener(27,function(){if(d.length>0){i()}})}function i(){if(d&&d.length>0){var o=d.clone();o.each(function(p){p.hide()});return true}return false}function e(o){d.remove(o);if(d.length<1){Ext.getDoc().un("mousedown",m);a=false}}function k(o){var p=d.last();l=new Date();d.add(o);if(!a){Ext.getDoc().on("mousedown",m);a=true}if(o.parentMenu){o.getEl().setZIndex(parseInt(o.parentMenu.getEl().getStyle("z-index"),10)+3);o.parentMenu.activeChild=o}else{if(p&&!p.isDestroyed&&p.isVisible()){o.getEl().setZIndex(parseInt(p.getEl().getStyle("z-index"),10)+3)}}}function b(o){if(o.activeChild){o.activeChild.hide()}if(o.autoHideTimer){clearTimeout(o.autoHideTimer);delete o.autoHideTimer}}function h(o){var p=o.parentMenu;if(!p&&!o.allowOtherMenus){i()}else{if(p&&p.activeChild){p.activeChild.hide()}}}function m(o){if(l.getElapsed()>50&&d.length>0&&!o.getTarget(".x-menu")){i()}}function j(p,s){if(s){var r=c[p.group];for(var q=0,o=r.length;q',' target="{hrefTarget}"',"",">",'','{text}',"")}var c=this.getTemplateArgs();this.el=b?this.itemTpl.insertBefore(b,c,true):this.itemTpl.append(d,c,true);this.iconEl=this.el.child("img.x-menu-item-icon");this.textEl=this.el.child(".x-menu-item-text");if(!this.href){this.mon(this.el,"click",Ext.emptyFn,null,{preventDefault:true})}Ext.menu.Item.superclass.onRender.call(this,d,b)},getTemplateArgs:function(){return{id:this.id,cls:this.itemCls+(this.menu?" x-menu-item-arrow":"")+(this.cls?" "+this.cls:""),href:this.href||"#",hrefTarget:this.hrefTarget,icon:this.icon||Ext.BLANK_IMAGE_URL,iconCls:this.iconCls||"",text:this.itemText||this.text||" "}},setText:function(a){this.text=a||" ";if(this.rendered){this.textEl.update(this.text);this.parentMenu.layout.doAutoSize()}},setIconClass:function(a){var b=this.iconCls;this.iconCls=a;if(this.rendered){this.iconEl.replaceClass(b,this.iconCls)}},beforeDestroy:function(){if(this.menu){delete this.menu.ownerCt;this.menu.destroy()}Ext.menu.Item.superclass.beforeDestroy.call(this)},handleClick:function(a){if(!this.href){a.stopEvent()}Ext.menu.Item.superclass.handleClick.apply(this,arguments)},activate:function(a){if(Ext.menu.Item.superclass.activate.apply(this,arguments)){this.focus();if(a){this.expandMenu()}}return true},shouldDeactivate:function(a){if(Ext.menu.Item.superclass.shouldDeactivate.call(this,a)){if(this.menu&&this.menu.isVisible()){return !this.menu.getEl().getRegion().contains(a.getPoint())}return true}return false},deactivate:function(){Ext.menu.Item.superclass.deactivate.apply(this,arguments);this.hideMenu()},expandMenu:function(a){if(!this.disabled&&this.menu){clearTimeout(this.hideTimer);delete this.hideTimer;if(!this.menu.isVisible()&&!this.showTimer){this.showTimer=this.deferExpand.defer(this.showDelay,this,[a])}else{if(this.menu.isVisible()&&a){this.menu.tryActivate(0,1)}}}},deferExpand:function(a){delete this.showTimer;this.menu.show(this.container,this.parentMenu.subMenuAlign||"tl-tr?",this.parentMenu);if(a){this.menu.tryActivate(0,1)}},hideMenu:function(){clearTimeout(this.showTimer);delete this.showTimer;if(!this.hideTimer&&this.menu&&this.menu.isVisible()){this.hideTimer=this.deferHide.defer(this.hideDelay,this)}},deferHide:function(){delete this.hideTimer;if(this.menu.over){this.parentMenu.setActiveItem(this,false)}else{this.menu.hide()}}});Ext.reg("menuitem",Ext.menu.Item);Ext.menu.CheckItem=Ext.extend(Ext.menu.Item,{itemCls:"x-menu-item x-menu-check-item",groupClass:"x-menu-group-item",checked:false,ctype:"Ext.menu.CheckItem",initComponent:function(){Ext.menu.CheckItem.superclass.initComponent.call(this);this.addEvents("beforecheckchange","checkchange");if(this.checkHandler){this.on("checkchange",this.checkHandler,this.scope)}Ext.menu.MenuMgr.registerCheckable(this)},onRender:function(a){Ext.menu.CheckItem.superclass.onRender.apply(this,arguments);if(this.group){this.el.addClass(this.groupClass)}if(this.checked){this.checked=false;this.setChecked(true,true)}},destroy:function(){Ext.menu.MenuMgr.unregisterCheckable(this);Ext.menu.CheckItem.superclass.destroy.apply(this,arguments)},setChecked:function(b,a){var c=a===true;if(this.checked!=b&&(c||this.fireEvent("beforecheckchange",this,b)!==false)){if(this.container){this.container[b?"addClass":"removeClass"]("x-menu-item-checked")}this.checked=b;if(!c){this.fireEvent("checkchange",this,b)}}},handleClick:function(a){if(!this.disabled&&!(this.checked&&this.group)){this.setChecked(!this.checked)}Ext.menu.CheckItem.superclass.handleClick.apply(this,arguments)}});Ext.reg("menucheckitem",Ext.menu.CheckItem);Ext.menu.DateMenu=Ext.extend(Ext.menu.Menu,{enableScrolling:false,hideOnClick:true,pickerId:null,cls:"x-date-menu",initComponent:function(){this.on("beforeshow",this.onBeforeShow,this);if(this.strict=(Ext.isIE7&&Ext.isStrict)){this.on("show",this.onShow,this,{single:true,delay:20})}Ext.apply(this,{plain:true,showSeparator:false,items:this.picker=new Ext.DatePicker(Ext.applyIf({internalRender:this.strict||!Ext.isIE,ctCls:"x-menu-date-item",id:this.pickerId},this.initialConfig))});this.picker.purgeListeners();Ext.menu.DateMenu.superclass.initComponent.call(this);this.relayEvents(this.picker,["select"]);this.on("show",this.picker.focus,this.picker);this.on("select",this.menuHide,this);if(this.handler){this.on("select",this.handler,this.scope||this)}},menuHide:function(){if(this.hideOnClick){this.hide(true)}},onBeforeShow:function(){if(this.picker){this.picker.hideMonthPicker(true)}},onShow:function(){var a=this.picker.getEl();a.setWidth(a.getWidth())}});Ext.reg("datemenu",Ext.menu.DateMenu);Ext.menu.ColorMenu=Ext.extend(Ext.menu.Menu,{enableScrolling:false,hideOnClick:true,cls:"x-color-menu",paletteId:null,initComponent:function(){Ext.apply(this,{plain:true,showSeparator:false,items:this.palette=new Ext.ColorPalette(Ext.applyIf({id:this.paletteId},this.initialConfig))});this.palette.purgeListeners();Ext.menu.ColorMenu.superclass.initComponent.call(this);this.relayEvents(this.palette,["select"]);this.on("select",this.menuHide,this);if(this.handler){this.on("select",this.handler,this.scope||this)}},menuHide:function(){if(this.hideOnClick){this.hide(true)}}});Ext.reg("colormenu",Ext.menu.ColorMenu);Ext.form.Field=Ext.extend(Ext.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",msgTarget:"qtip",msgFx:"normal",readOnly:false,disabled:false,submitValue:true,isFormField:true,msgDisplay:"",hasFocus:false,initComponent:function(){Ext.form.Field.superclass.initComponent.call(this);this.addEvents("focus","blur","specialkey","change","invalid","valid")},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:this.name||this.id||""},onRender:function(c,a){if(!this.el){var b=this.getAutoCreate();if(!b.name){b.name=this.name||this.id}if(this.inputType){b.type=this.inputType}this.autoEl=b}Ext.form.Field.superclass.onRender.call(this,c,a);if(this.submitValue===false){this.el.dom.removeAttribute("name")}var d=this.el.dom.type;if(d){if(d=="password"){d="text"}this.el.addClass("x-form-"+d)}if(this.readOnly){this.setReadOnly(true)}if(this.tabIndex!==undefined){this.el.dom.setAttribute("tabIndex",this.tabIndex)}this.el.addClass([this.fieldClass,this.cls])},getItemCt:function(){return this.itemCt},initValue:function(){if(this.value!==undefined){this.setValue(this.value)}else{if(!Ext.isEmpty(this.el.dom.value)&&this.el.dom.value!=this.emptyText){this.setValue(this.el.dom.value)}}this.originalValue=this.getValue()},isDirty:function(){if(this.disabled||!this.rendered){return false}return String(this.getValue())!==String(this.originalValue)},setReadOnly:function(a){if(this.rendered){this.el.dom.readOnly=a}this.readOnly=a},afterRender:function(){Ext.form.Field.superclass.afterRender.call(this);this.initEvents();this.initValue()},fireKey:function(a){if(a.isSpecialKey()){this.fireEvent("specialkey",this,a)}},reset:function(){this.setValue(this.originalValue);this.clearInvalid()},initEvents:function(){this.mon(this.el,Ext.EventManager.useKeydown?"keydown":"keypress",this.fireKey,this);this.mon(this.el,"focus",this.onFocus,this);this.mon(this.el,"blur",this.onBlur,this,this.inEditor?{buffer:10}:null)},preFocus:Ext.emptyFn,onFocus:function(){this.preFocus();if(this.focusClass){this.el.addClass(this.focusClass)}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this)}},beforeBlur:Ext.emptyFn,onBlur:function(){this.beforeBlur();if(this.focusClass){this.el.removeClass(this.focusClass)}this.hasFocus=false;if(this.validationEvent!==false&&(this.validateOnBlur||this.validationEvent=="blur")){this.validate()}var a=this.getValue();if(String(a)!==String(this.startValue)){this.fireEvent("change",this,a,this.startValue)}this.fireEvent("blur",this);this.postBlur()},postBlur:Ext.emptyFn,isValid:function(a){if(this.disabled){return true}var c=this.preventMark;this.preventMark=a===true;var b=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=c;return b},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true}return false},processValue:function(a){return a},validateValue:function(b){var a=this.getErrors(b)[0];if(a==undefined){return true}else{this.markInvalid(a);return false}},getErrors:function(){return[]},getActiveError:function(){return this.activeError||""},markInvalid:function(c){if(this.rendered&&!this.preventMark){c=c||this.invalidText;var a=this.getMessageHandler();if(a){a.mark(this,c)}else{if(this.msgTarget){this.el.addClass(this.invalidClass);var b=Ext.getDom(this.msgTarget);if(b){b.innerHTML=c;b.style.display=this.msgDisplay}}}}this.setActiveError(c)},clearInvalid:function(){if(this.rendered&&!this.preventMark){this.el.removeClass(this.invalidClass);var a=this.getMessageHandler();if(a){a.clear(this)}else{if(this.msgTarget){this.el.removeClass(this.invalidClass);var b=Ext.getDom(this.msgTarget);if(b){b.innerHTML="";b.style.display="none"}}}}this.unsetActiveError()},setActiveError:function(b,a){this.activeError=b;if(a!==true){this.fireEvent("invalid",this,b)}},unsetActiveError:function(a){delete this.activeError;if(a!==true){this.fireEvent("valid",this)}},getMessageHandler:function(){return Ext.form.MessageTargets[this.msgTarget]},getErrorCt:function(){return this.el.findParent(".x-form-element",5,true)||this.el.findParent(".x-form-field-wrap",5,true)},alignErrorEl:function(){this.errorEl.setWidth(this.getErrorCt().getWidth(true)-20)},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,"tl-tr",[2,0])},getRawValue:function(){var a=this.rendered?this.el.getValue():Ext.value(this.value,"");if(a===this.emptyText){a=""}return a},getValue:function(){if(!this.rendered){return this.value}var a=this.el.getValue();if(a===this.emptyText||a===undefined){a=""}return a},setRawValue:function(a){return this.rendered?(this.el.dom.value=(Ext.isEmpty(a)?"":a)):""},setValue:function(a){this.value=a;if(this.rendered){this.el.dom.value=(Ext.isEmpty(a)?"":a);this.validate()}return this},append:function(a){this.setValue([this.getValue(),a].join(""))}});Ext.form.MessageTargets={qtip:{mark:function(a,b){a.el.addClass(a.invalidClass);a.el.dom.qtip=b;a.el.dom.qclass="x-form-invalid-tip";if(Ext.QuickTips){Ext.QuickTips.enable()}},clear:function(a){a.el.removeClass(a.invalidClass);a.el.dom.qtip=""}},title:{mark:function(a,b){a.el.addClass(a.invalidClass);a.el.dom.title=b},clear:function(a){a.el.dom.title=""}},under:{mark:function(b,c){b.el.addClass(b.invalidClass);if(!b.errorEl){var a=b.getErrorCt();if(!a){b.el.dom.title=c;return}b.errorEl=a.createChild({cls:"x-form-invalid-msg"});b.on("resize",b.alignErrorEl,b);b.on("destroy",function(){Ext.destroy(this.errorEl)},b)}b.alignErrorEl();b.errorEl.update(c);Ext.form.Field.msgFx[b.msgFx].show(b.errorEl,b)},clear:function(a){a.el.removeClass(a.invalidClass);if(a.errorEl){Ext.form.Field.msgFx[a.msgFx].hide(a.errorEl,a)}else{a.el.dom.title=""}}},side:{mark:function(b,c){b.el.addClass(b.invalidClass);if(!b.errorIcon){var a=b.getErrorCt();if(!a){b.el.dom.title=c;return}b.errorIcon=a.createChild({cls:"x-form-invalid-icon"});if(b.ownerCt){b.ownerCt.on("afterlayout",b.alignErrorIcon,b);b.ownerCt.on("expand",b.alignErrorIcon,b)}b.on("resize",b.alignErrorIcon,b);b.on("destroy",function(){Ext.destroy(this.errorIcon)},b)}b.alignErrorIcon();b.errorIcon.dom.qtip=c;b.errorIcon.dom.qclass="x-form-invalid-tip";b.errorIcon.show()},clear:function(a){a.el.removeClass(a.invalidClass);if(a.errorIcon){a.errorIcon.dom.qtip="";a.errorIcon.hide()}else{a.el.dom.title=""}}}};Ext.form.Field.msgFx={normal:{show:function(a,b){a.setDisplayed("block")},hide:function(a,b){a.setDisplayed(false).update("")}},slide:{show:function(a,b){a.slideIn("t",{stopFx:true})},hide:function(a,b){a.slideOut("t",{stopFx:true,useDisplay:true})}},slideRight:{show:function(a,b){a.fixDisplay();a.alignTo(b.el,"tl-tr");a.slideIn("l",{stopFx:true})},hide:function(a,b){a.slideOut("l",{stopFx:true,useDisplay:true})}}};Ext.reg("field",Ext.form.Field);Ext.form.TextField=Ext.extend(Ext.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,emptyClass:"x-form-empty-field",initComponent:function(){Ext.form.TextField.superclass.initComponent.call(this);this.addEvents("autosize","keydown","keyup","keypress")},initEvents:function(){Ext.form.TextField.superclass.initEvents.call(this);if(this.validationEvent=="keyup"){this.validationTask=new Ext.util.DelayedTask(this.validate,this);this.mon(this.el,"keyup",this.filterValidation,this)}else{if(this.validationEvent!==false&&this.validationEvent!="blur"){this.mon(this.el,this.validationEvent,this.validate,this,{buffer:this.validationDelay})}}if(this.selectOnFocus||this.emptyText){this.mon(this.el,"mousedown",this.onMouseDown,this);if(this.emptyText){this.applyEmptyText()}}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Ext.form.VTypes[this.vtype+"Mask"]))){this.mon(this.el,"keypress",this.filterKeys,this)}if(this.grow){this.mon(this.el,"keyup",this.onKeyUpBuffered,this,{buffer:50});this.mon(this.el,"click",this.autoSize,this)}if(this.enableKeyEvents){this.mon(this.el,{scope:this,keyup:this.onKeyUp,keydown:this.onKeyDown,keypress:this.onKeyPress})}},onMouseDown:function(a){if(!this.hasFocus){this.mon(this.el,"mouseup",Ext.emptyFn,this,{single:true,preventDefault:true})}},processValue:function(a){if(this.stripCharsRe){var b=a.replace(this.stripCharsRe,"");if(b!==a){this.setRawValue(b);return b}}return a},filterValidation:function(a){if(!a.isNavKeyPress()){this.validationTask.delay(this.validationDelay)}},onDisable:function(){Ext.form.TextField.superclass.onDisable.call(this);if(Ext.isIE){this.el.dom.unselectable="on"}},onEnable:function(){Ext.form.TextField.superclass.onEnable.call(this);if(Ext.isIE){this.el.dom.unselectable=""}},onKeyUpBuffered:function(a){if(this.doAutoSize(a)){this.autoSize()}},doAutoSize:function(a){return !a.isNavKeyPress()},onKeyUp:function(a){this.fireEvent("keyup",this,a)},onKeyDown:function(a){this.fireEvent("keydown",this,a)},onKeyPress:function(a){this.fireEvent("keypress",this,a)},reset:function(){Ext.form.TextField.superclass.reset.call(this);this.applyEmptyText()},applyEmptyText:function(){if(this.rendered&&this.emptyText&&this.getRawValue().length<1&&!this.hasFocus){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass)}},preFocus:function(){var a=this.el;if(this.emptyText){if(a.dom.value==this.emptyText){this.setRawValue("")}a.removeClass(this.emptyClass)}if(this.selectOnFocus){a.dom.select()}},postBlur:function(){this.applyEmptyText()},filterKeys:function(b){if(b.ctrlKey){return}var a=b.getKey();if(Ext.isGecko&&(b.isNavKeyPress()||a==b.BACKSPACE||(a==b.DELETE&&b.button==-1))){return}var c=String.fromCharCode(b.getCharCode());if(!Ext.isGecko&&b.isSpecialKey()&&!c){return}if(!this.maskRe.test(c)){b.stopEvent()}},setValue:function(a){if(this.emptyText&&this.el&&!Ext.isEmpty(a)){this.el.removeClass(this.emptyClass)}Ext.form.TextField.superclass.setValue.apply(this,arguments);this.applyEmptyText();this.autoSize();return this},getErrors:function(a){var d=Ext.form.TextField.superclass.getErrors.apply(this,arguments);a=a||this.processValue(this.getRawValue());if(Ext.isFunction(this.validator)){var c=this.validator(a);if(c!==true){d.push(c)}}if(!this.allowBlank&&(a.length<1||a===this.emptyText)){d.push(this.blankText)}if(a.lengththis.maxLength){d.push(String.format(this.maxLengthText,this.maxLength))}if(this.vtype){var b=Ext.form.VTypes;if(!b[this.vtype](a,this)){d.push(this.vtypeText||b[this.vtype+"Text"])}}if(this.regex&&!this.regex.test(a)){d.push(this.regexText)}return d},selectText:function(h,a){var c=this.getRawValue();var e=false;if(c.length>0){h=h===undefined?0:h;a=a===undefined?c.length:a;var g=this.el.dom;if(g.setSelectionRange){g.setSelectionRange(h,a)}else{if(g.createTextRange){var b=g.createTextRange();b.moveStart("character",h);b.moveEnd("character",a-c.length);b.select()}}e=Ext.isGecko||Ext.isOpera}else{e=true}if(e){this.focus()}},autoSize:function(){if(!this.grow||!this.rendered){return}if(!this.metrics){this.metrics=Ext.util.TextMetrics.createInstance(this.el)}var c=this.el;var b=c.dom.value;var e=document.createElement("div");e.appendChild(document.createTextNode(b));b=e.innerHTML;Ext.removeNode(e);e=null;b+=" ";var a=Math.min(this.growMax,Math.max(this.metrics.getWidth(b)+10,this.growMin));this.el.setWidth(a);this.fireEvent("autosize",this,a)},onDestroy:function(){if(this.validationTask){this.validationTask.cancel();this.validationTask=null}Ext.form.TextField.superclass.onDestroy.call(this)}});Ext.reg("textfield",Ext.form.TextField);Ext.form.TriggerField=Ext.extend(Ext.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},hideTrigger:false,editable:true,readOnly:false,wrapFocusClass:"x-trigger-wrap-focus",autoSize:Ext.emptyFn,monitorTab:true,deferHeight:true,mimicing:false,actionMode:"wrap",defaultTriggerWidth:17,onResize:function(a,c){Ext.form.TriggerField.superclass.onResize.call(this,a,c);var b=this.getTriggerWidth();if(Ext.isNumber(a)){this.el.setWidth(a-b)}this.wrap.setWidth(this.el.getWidth()+b)},getTriggerWidth:function(){var a=this.trigger.getWidth();if(!this.hideTrigger&&!this.readOnly&&a===0){a=this.defaultTriggerWidth}return a},alignErrorIcon:function(){if(this.wrap){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}},onRender:function(b,a){this.doc=Ext.isIE?Ext.getBody():Ext.getDoc();Ext.form.TriggerField.superclass.onRender.call(this,b,a);this.wrap=this.el.wrap({cls:"x-form-field-wrap x-form-field-trigger-wrap"});this.trigger=this.wrap.createChild(this.triggerConfig||{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});this.initTrigger();if(!this.width){this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())}this.resizeEl=this.positionEl=this.wrap},getWidth:function(){return(this.el.getWidth()+this.trigger.getWidth())},updateEditState:function(){if(this.rendered){if(this.readOnly){this.el.dom.readOnly=true;this.el.addClass("x-trigger-noedit");this.mun(this.el,"click",this.onTriggerClick,this);this.trigger.setDisplayed(false)}else{if(!this.editable){this.el.dom.readOnly=true;this.el.addClass("x-trigger-noedit");this.mon(this.el,"click",this.onTriggerClick,this)}else{this.el.dom.readOnly=false;this.el.removeClass("x-trigger-noedit");this.mun(this.el,"click",this.onTriggerClick,this)}this.trigger.setDisplayed(!this.hideTrigger)}this.onResize(this.width||this.wrap.getWidth())}},setHideTrigger:function(a){if(a!=this.hideTrigger){this.hideTrigger=a;this.updateEditState()}},setEditable:function(a){if(a!=this.editable){this.editable=a;this.updateEditState()}},setReadOnly:function(a){if(a!=this.readOnly){this.readOnly=a;this.updateEditState()}},afterRender:function(){Ext.form.TriggerField.superclass.afterRender.call(this);this.updateEditState()},initTrigger:function(){this.mon(this.trigger,"click",this.onTriggerClick,this,{preventDefault:true});this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},onDestroy:function(){Ext.destroy(this.trigger,this.wrap);if(this.mimicing){this.doc.un("mousedown",this.mimicBlur,this)}delete this.doc;Ext.form.TriggerField.superclass.onDestroy.call(this)},onFocus:function(){Ext.form.TriggerField.superclass.onFocus.call(this);if(!this.mimicing){this.wrap.addClass(this.wrapFocusClass);this.mimicing=true;this.doc.on("mousedown",this.mimicBlur,this,{delay:10});if(this.monitorTab){this.on("specialkey",this.checkTab,this)}}},checkTab:function(a,b){if(b.getKey()==b.TAB){this.triggerBlur()}},onBlur:Ext.emptyFn,mimicBlur:function(a){if(!this.isDestroyed&&!this.wrap.contains(a.target)&&this.validateBlur(a)){this.triggerBlur()}},triggerBlur:function(){this.mimicing=false;this.doc.un("mousedown",this.mimicBlur,this);if(this.monitorTab&&this.el){this.un("specialkey",this.checkTab,this)}Ext.form.TriggerField.superclass.onBlur.call(this);if(this.wrap){this.wrap.removeClass(this.wrapFocusClass)}},beforeBlur:Ext.emptyFn,validateBlur:function(a){return true},onTriggerClick:Ext.emptyFn});Ext.form.TwinTriggerField=Ext.extend(Ext.form.TriggerField,{initComponent:function(){Ext.form.TwinTriggerField.superclass.initComponent.call(this);this.triggerConfig={tag:"span",cls:"x-form-twin-triggers",cn:[{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger2Class}]}},getTrigger:function(a){return this.triggers[a]},initTrigger:function(){var a=this.trigger.select(".x-form-trigger",true);var b=this;a.each(function(d,g,c){var e="Trigger"+(c+1);d.hide=function(){var h=b.wrap.getWidth();this.dom.style.display="none";b.el.setWidth(h-b.trigger.getWidth());this["hidden"+e]=true};d.show=function(){var h=b.wrap.getWidth();this.dom.style.display="";b.el.setWidth(h-b.trigger.getWidth());this["hidden"+e]=false};if(this["hide"+e]){d.dom.style.display="none";this["hidden"+e]=true}this.mon(d,"click",this["on"+e+"Click"],this,{preventDefault:true});d.addClassOnOver("x-form-trigger-over");d.addClassOnClick("x-form-trigger-click")},this);this.triggers=a.elements},getTriggerWidth:function(){var a=0;Ext.each(this.triggers,function(d,c){var e="Trigger"+(c+1),b=d.getWidth();if(b===0&&!this["hidden"+e]){a+=this.defaultTriggerWidth}else{a+=b}},this);return a},onDestroy:function(){Ext.destroy(this.triggers);Ext.form.TwinTriggerField.superclass.onDestroy.call(this)},onTrigger1Click:Ext.emptyFn,onTrigger2Click:Ext.emptyFn});Ext.reg("trigger",Ext.form.TriggerField);Ext.form.TextArea=Ext.extend(Ext.form.TextField,{growMin:60,growMax:1000,growAppend:" \n ",enterIsSpecial:false,preventScrollbars:false,onRender:function(b,a){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:100px;height:60px;",autocomplete:"off"}}Ext.form.TextArea.superclass.onRender.call(this,b,a);if(this.grow){this.textSizeEl=Ext.DomHelper.append(document.body,{tag:"pre",cls:"x-form-grow-sizer"});if(this.preventScrollbars){this.el.setStyle("overflow","hidden")}this.el.setHeight(this.growMin)}},onDestroy:function(){Ext.removeNode(this.textSizeEl);Ext.form.TextArea.superclass.onDestroy.call(this)},fireKey:function(a){if(a.isSpecialKey()&&(this.enterIsSpecial||(a.getKey()!=a.ENTER||a.hasModifier()))){this.fireEvent("specialkey",this,a)}},doAutoSize:function(a){return !a.isNavKeyPress()||a.getKey()==a.ENTER},autoSize:function(){if(!this.grow||!this.textSizeEl){return}var c=this.el,a=Ext.util.Format.htmlEncode(c.dom.value),d=this.textSizeEl,b;Ext.fly(d).setWidth(this.el.getWidth());if(a.length<1){a="  "}else{a+=this.growAppend;if(Ext.isIE){a=a.replace(/\n/g," 
    ")}}d.innerHTML=a;b=Math.min(this.growMax,Math.max(d.offsetHeight,this.growMin));if(b!=this.lastHeight){this.lastHeight=b;this.el.setHeight(b);this.fireEvent("autosize",this,b)}}});Ext.reg("textarea",Ext.form.TextArea);Ext.form.NumberField=Ext.extend(Ext.form.TextField,{fieldClass:"x-form-field x-form-num-field",allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",baseChars:"0123456789",initEvents:function(){var a=this.baseChars+"";if(this.allowDecimals){a+=this.decimalSeparator}if(this.allowNegative){a+="-"}this.maskRe=new RegExp("["+Ext.escapeRe(a)+"]");Ext.form.NumberField.superclass.initEvents.call(this)},getErrors:function(b){var c=Ext.form.NumberField.superclass.getErrors.apply(this,arguments);b=b||this.processValue(this.getRawValue());if(b.length<1){return c}b=String(b).replace(this.decimalSeparator,".");if(isNaN(b)){c.push(String.format(this.nanText,b))}var a=this.parseValue(b);if(athis.maxValue){c.push(String.format(this.maxText,this.maxValue))}return c},getValue:function(){return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this)))},setValue:function(a){a=Ext.isNumber(a)?a:parseFloat(String(a).replace(this.decimalSeparator,"."));a=isNaN(a)?"":String(a).replace(".",this.decimalSeparator);return Ext.form.NumberField.superclass.setValue.call(this,a)},setMinValue:function(a){this.minValue=Ext.num(a,Number.NEGATIVE_INFINITY)},setMaxValue:function(a){this.maxValue=Ext.num(a,Number.MAX_VALUE)},parseValue:function(a){a=parseFloat(String(a).replace(this.decimalSeparator,"."));return isNaN(a)?"":a},fixPrecision:function(b){var a=isNaN(b);if(!this.allowDecimals||this.decimalPrecision==-1||a||!b){return a?"":b}return parseFloat(parseFloat(b).toFixed(this.decimalPrecision))},beforeBlur:function(){var a=this.parseValue(this.getRawValue());if(!Ext.isEmpty(a)){this.setValue(this.fixPrecision(a))}}});Ext.reg("numberfield",Ext.form.NumberField);Ext.form.DateField=Ext.extend(Ext.form.TriggerField,{format:"m/d/Y",altFormats:"m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d",disabledDaysText:"Disabled",disabledDatesText:"Disabled",minText:"The date in this field must be equal to or after {0}",maxText:"The date in this field must be equal to or before {0}",invalidText:"{0} is not a valid date - it must be in the format {1}",triggerClass:"x-form-date-trigger",showToday:true,defaultAutoCreate:{tag:"input",type:"text",size:"10",autocomplete:"off"},initTime:"12",initTimeFormat:"H",safeParse:function(b,c){if(/[gGhH]/.test(c.replace(/(\\.)/g,""))){return Date.parseDate(b,c)}else{var a=Date.parseDate(b+" "+this.initTime,c+" "+this.initTimeFormat);if(a){return a.clearTime()}}},initComponent:function(){Ext.form.DateField.superclass.initComponent.call(this);this.addEvents("select");if(Ext.isString(this.minValue)){this.minValue=this.parseDate(this.minValue)}if(Ext.isString(this.maxValue)){this.maxValue=this.parseDate(this.maxValue)}this.disabledDatesRE=null;this.initDisabledDays()},initEvents:function(){Ext.form.DateField.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{down:function(a){this.onTriggerClick()},scope:this,forceKeyDown:true})},initDisabledDays:function(){if(this.disabledDates){var b=this.disabledDates,a=b.length-1,c="(?:";Ext.each(b,function(g,e){c+=Ext.isDate(g)?"^"+Ext.escapeRe(g.dateFormat(this.format))+"$":b[e];if(e!=a){c+="|"}},this);this.disabledDatesRE=new RegExp(c+")")}},setDisabledDates:function(a){this.disabledDates=a;this.initDisabledDays();if(this.menu){this.menu.picker.setDisabledDates(this.disabledDatesRE)}},setDisabledDays:function(a){this.disabledDays=a;if(this.menu){this.menu.picker.setDisabledDays(a)}},setMinValue:function(a){this.minValue=(Ext.isString(a)?this.parseDate(a):a);if(this.menu){this.menu.picker.setMinDate(this.minValue)}},setMaxValue:function(a){this.maxValue=(Ext.isString(a)?this.parseDate(a):a);if(this.menu){this.menu.picker.setMaxDate(this.maxValue)}},getErrors:function(e){var h=Ext.form.DateField.superclass.getErrors.apply(this,arguments);e=this.formatDate(e||this.processValue(this.getRawValue()));if(e.length<1){return h}var c=e;e=this.parseDate(e);if(!e){h.push(String.format(this.invalidText,c,this.format));return h}var g=e.getTime();if(this.minValue&&gthis.maxValue.getTime()){h.push(String.format(this.maxText,this.formatDate(this.maxValue)))}if(this.disabledDays){var a=e.getDay();for(var b=0;b
    {'+this.displayField+"}
    "}this.view=new Ext.DataView({applyTo:this.innerList,tpl:this.tpl,singleSelect:true,selectedClass:this.selectedClass,itemSelector:this.itemSelector||"."+a+"-item",emptyText:this.listEmptyText,deferEmptyText:false});this.mon(this.view,{containerclick:this.onViewClick,click:this.onViewClick,scope:this});this.bindStore(this.store,true);if(this.resizable){this.resizer=new Ext.Resizable(this.list,{pinned:true,handles:"se"});this.mon(this.resizer,"resize",function(i,e,g){this.maxHeight=g-this.handleHeight-this.list.getFrameWidth("tb")-this.assetHeight;this.listWidth=e;this.innerList.setWidth(e-this.list.getFrameWidth("lr"));this.restrictHeight()},this);this[this.pageSize?"footer":"innerList"].setStyle("margin-bottom",this.handleHeight+"px")}}},getListParent:function(){return document.body},getStore:function(){return this.store},bindStore:function(a,b){if(this.store&&!b){if(this.store!==a&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.collapse,this)}if(!a){this.store=null;if(this.view){this.view.bindStore(null)}if(this.pageTb){this.pageTb.bindStore(null)}}}if(a){if(!b){this.lastQuery=null;if(this.pageTb){this.pageTb.bindStore(a)}}this.store=Ext.StoreMgr.lookup(a);this.store.on({scope:this,beforeload:this.onBeforeLoad,load:this.onLoad,exception:this.collapse});if(this.view){this.view.bindStore(a)}}},reset:function(){Ext.form.ComboBox.superclass.reset.call(this);if(this.clearFilterOnReset&&this.mode=="local"){this.store.clearFilter()}},initEvents:function(){Ext.form.ComboBox.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{up:function(a){this.inKeyMode=true;this.selectPrev()},down:function(a){if(!this.isExpanded()){this.onTriggerClick()}else{this.inKeyMode=true;this.selectNext()}},enter:function(a){this.onViewClick()},esc:function(a){this.collapse()},tab:function(a){if(this.forceSelection===true){this.collapse()}else{this.onViewClick(false)}return true},scope:this,doRelay:function(c,b,a){if(a=="down"||this.scope.isExpanded()){var d=Ext.KeyNav.prototype.doRelay.apply(this,arguments);if(!Ext.isIE&&Ext.EventManager.useKeydown){this.scope.fireKey(c)}return d}return true},forceKeyDown:true,defaultEventAction:"stopEvent"});this.queryDelay=Math.max(this.queryDelay||10,this.mode=="local"?10:250);this.dqTask=new Ext.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Ext.util.DelayedTask(this.onTypeAhead,this)}if(!this.enableKeyEvents){this.mon(this.el,"keyup",this.onKeyUp,this)}},onDestroy:function(){if(this.dqTask){this.dqTask.cancel();this.dqTask=null}this.bindStore(null);Ext.destroy(this.resizer,this.view,this.pageTb,this.list);Ext.destroyMembers(this,"hiddenField");Ext.form.ComboBox.superclass.onDestroy.call(this)},fireKey:function(a){if(!this.isExpanded()){Ext.form.ComboBox.superclass.fireKey.call(this,a)}},onResize:function(a,b){Ext.form.ComboBox.superclass.onResize.apply(this,arguments);if(!isNaN(a)&&this.isVisible()&&this.list){this.doResize(a)}else{this.bufferSize=a}},doResize:function(a){if(!Ext.isDefined(this.listWidth)){var b=Math.max(a,this.minListWidth);this.list.setWidth(b);this.innerList.setWidth(b-this.list.getFrameWidth("lr"))}},onEnable:function(){Ext.form.ComboBox.superclass.onEnable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=false}},onDisable:function(){Ext.form.ComboBox.superclass.onDisable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=true}},onBeforeLoad:function(){if(!this.hasFocus){return}this.innerList.update(this.loadingText?'
    '+this.loadingText+"
    ":"");this.restrictHeight();this.selectedIndex=-1},onLoad:function(){if(!this.hasFocus){return}if(this.store.getCount()>0||this.listEmptyText){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable){this.el.dom.select()}if(this.autoSelect!==false&&!this.selectByValue(this.value,true)){this.select(0,true)}}else{if(this.autoSelect!==false){this.selectNext()}if(this.typeAhead&&this.lastKey!=Ext.EventObject.BACKSPACE&&this.lastKey!=Ext.EventObject.DELETE){this.taTask.delay(this.typeAheadDelay)}}}else{this.collapse()}},onTypeAhead:function(){if(this.store.getCount()>0){var b=this.store.getAt(0);var c=b.data[this.displayField];var a=c.length;var d=this.getRawValue().length;if(d!=a){this.setRawValue(c);this.selectText(d,c.length)}}},assertValue:function(){var b=this.getRawValue(),a=this.findRecord(this.displayField,b);if(!a&&this.forceSelection){if(b.length>0&&b!=this.emptyText){this.el.dom.value=Ext.value(this.lastSelectionText,"");this.applyEmptyText()}else{this.clearValue()}}else{if(a){if(b==a.get(this.displayField)&&this.value==a.get(this.valueField)){return}b=a.get(this.valueField||this.displayField)}this.setValue(b)}},onSelect:function(a,b){if(this.fireEvent("beforeselect",this,a,b)!==false){this.setValue(a.data[this.valueField||this.displayField]);this.collapse();this.fireEvent("select",this,a,b)}},getName:function(){var a=this.hiddenField;return a&&a.name?a.name:this.hiddenName||Ext.form.ComboBox.superclass.getName.call(this)},getValue:function(){if(this.valueField){return Ext.isDefined(this.value)?this.value:""}else{return Ext.form.ComboBox.superclass.getValue.call(this)}},clearValue:function(){if(this.hiddenField){this.hiddenField.value=""}this.setRawValue("");this.lastSelectionText="";this.applyEmptyText();this.value=""},setValue:function(a){var c=a;if(this.valueField){var b=this.findRecord(this.valueField,a);if(b){c=b.data[this.displayField]}else{if(Ext.isDefined(this.valueNotFoundText)){c=this.valueNotFoundText}}}this.lastSelectionText=c;if(this.hiddenField){this.hiddenField.value=Ext.value(a,"")}Ext.form.ComboBox.superclass.setValue.call(this,c);this.value=a;return this},findRecord:function(c,b){var a;if(this.store.getCount()>0){this.store.each(function(d){if(d.data[c]==b){a=d;return false}})}return a},onViewMove:function(b,a){this.inKeyMode=false},onViewOver:function(d,b){if(this.inKeyMode){return}var c=this.view.findItemFromChild(b);if(c){var a=this.view.indexOf(c);this.select(a,false)}},onViewClick:function(b){var a=this.view.getSelectedIndexes()[0],c=this.store,d=c.getAt(a);if(d){this.onSelect(d,a)}else{this.collapse()}if(b!==false){this.el.focus()}},restrictHeight:function(){this.innerList.dom.style.height="";var b=this.innerList.dom,e=this.list.getFrameWidth("tb")+(this.resizable?this.handleHeight:0)+this.assetHeight,c=Math.max(b.clientHeight,b.offsetHeight,b.scrollHeight),a=this.getPosition()[1]-Ext.getBody().getScroll().top,g=Ext.lib.Dom.getViewHeight()-a-this.getSize().height,d=Math.max(a,g,this.minHeight||0)-this.list.shadowOffset-e-5;c=Math.min(c,d,this.maxHeight);this.innerList.setHeight(c);this.list.beginUpdate();this.list.setHeight(c+e);this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));this.list.endUpdate()},isExpanded:function(){return this.list&&this.list.isVisible()},selectByValue:function(a,c){if(!Ext.isEmpty(a,true)){var b=this.findRecord(this.valueField||this.displayField,a);if(b){this.select(this.store.indexOf(b),c);return true}}return false},select:function(a,c){this.selectedIndex=a;this.view.select(a);if(c!==false){var b=this.view.getNode(a);if(b){this.innerList.scrollChildIntoView(b,false)}}},selectNext:function(){var a=this.store.getCount();if(a>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex!==0){this.select(this.selectedIndex-1)}}}},onKeyUp:function(b){var a=b.getKey();if(this.editable!==false&&this.readOnly!==true&&(a==b.BACKSPACE||!b.isSpecialKey())){this.lastKey=a;this.dqTask.delay(this.queryDelay)}Ext.form.ComboBox.superclass.onKeyUp.call(this,b)},validateBlur:function(){return !this.list||!this.list.isVisible()},initQuery:function(){this.doQuery(this.getRawValue())},beforeBlur:function(){this.assertValue()},postBlur:function(){Ext.form.ComboBox.superclass.postBlur.call(this);this.collapse();this.inKeyMode=false},doQuery:function(c,b){c=Ext.isEmpty(c)?"":c;var a={query:c,forceAll:b,combo:this,cancel:false};if(this.fireEvent("beforequery",a)===false||a.cancel){return false}c=a.query;b=a.forceAll;if(b===true||(c.length>=this.minChars)){if(this.lastQuery!==c){this.lastQuery=c;if(this.mode=="local"){this.selectedIndex=-1;if(b){this.store.clearFilter()}else{this.store.filter(this.displayField,c)}this.onLoad()}else{this.store.baseParams[this.queryParam]=c;this.store.load({params:this.getParams(c)});this.expand()}}else{this.selectedIndex=-1;this.onLoad()}}},getParams:function(a){var b={};if(this.pageSize){b.start=0;b.limit=this.pageSize}return b},collapse:function(){if(!this.isExpanded()){return}this.list.hide();Ext.getDoc().un("mousewheel",this.collapseIf,this);Ext.getDoc().un("mousedown",this.collapseIf,this);this.fireEvent("collapse",this)},collapseIf:function(a){if(!this.isDestroyed&&!a.within(this.wrap)&&!a.within(this.list)){this.collapse()}},expand:function(){if(this.isExpanded()||!this.hasFocus){return}if(this.title||this.pageSize){this.assetHeight=0;if(this.title){this.assetHeight+=this.header.getHeight()}if(this.pageSize){this.assetHeight+=this.footer.getHeight()}}if(this.bufferSize){this.doResize(this.bufferSize);delete this.bufferSize}this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));var b=Ext.getDom(this.getListParent()||Ext.getBody()),a=parseInt(Ext.fly(b).getStyle("z-index"),10);if(!a){a=this.getParentZIndex()}if(a){this.list.setZIndex(a+5)}this.list.show();if(Ext.isGecko2){this.innerList.setOverflow("auto")}this.mon(Ext.getDoc(),{scope:this,mousewheel:this.collapseIf,mousedown:this.collapseIf});this.fireEvent("expand",this)},onTriggerClick:function(){if(this.readOnly||this.disabled){return}if(this.isExpanded()){this.collapse();this.el.focus()}else{this.onFocus({});if(this.triggerAction=="all"){this.doQuery(this.allQuery,true)}else{this.doQuery(this.getRawValue())}this.el.focus()}}});Ext.reg("combo",Ext.form.ComboBox);Ext.form.Checkbox=Ext.extend(Ext.form.Field,{focusClass:undefined,fieldClass:"x-form-field",checked:false,boxLabel:" ",defaultAutoCreate:{tag:"input",type:"checkbox",autocomplete:"off"},actionMode:"wrap",initComponent:function(){Ext.form.Checkbox.superclass.initComponent.call(this);this.addEvents("check")},onResize:function(){Ext.form.Checkbox.superclass.onResize.apply(this,arguments);if(!this.boxLabel&&!this.fieldLabel){this.el.alignTo(this.wrap,"c-c")}},initEvents:function(){Ext.form.Checkbox.superclass.initEvents.call(this);this.mon(this.el,{scope:this,click:this.onClick,change:this.onClick})},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,onRender:function(b,a){Ext.form.Checkbox.superclass.onRender.call(this,b,a);if(this.inputValue!==undefined){this.el.dom.value=this.inputValue}this.wrap=this.el.wrap({cls:"x-form-check-wrap"});if(this.boxLabel){this.wrap.createChild({tag:"label",htmlFor:this.el.id,cls:"x-form-cb-label",html:this.boxLabel})}if(this.checked){this.setValue(true)}else{this.checked=this.el.dom.checked}if(Ext.isIE){this.wrap.repaint()}this.resizeEl=this.positionEl=this.wrap},onDestroy:function(){Ext.destroy(this.wrap);Ext.form.Checkbox.superclass.onDestroy.call(this)},initValue:function(){this.originalValue=this.getValue()},getValue:function(){if(this.rendered){return this.el.dom.checked}return this.checked},onClick:function(){if(this.el.dom.checked!=this.checked){this.setValue(this.el.dom.checked)}},setValue:function(a){var b=this.checked;this.checked=(a===true||a==="true"||a=="1"||String(a).toLowerCase()=="on");if(this.rendered){this.el.dom.checked=this.checked;this.el.dom.defaultChecked=this.checked}if(b!=this.checked){this.fireEvent("check",this,this.checked);if(this.handler){this.handler.call(this.scope||this,this,this.checked)}}return this}});Ext.reg("checkbox",Ext.form.Checkbox);Ext.form.CheckboxGroup=Ext.extend(Ext.form.Field,{columns:"auto",vertical:false,allowBlank:true,blankText:"You must select at least one item in this group",defaultType:"checkbox",groupCls:"x-form-check-group",initComponent:function(){this.addEvents("change");this.on("change",this.validate,this);Ext.form.CheckboxGroup.superclass.initComponent.call(this)},onRender:function(j,g){if(!this.el){var p={autoEl:{id:this.id},cls:this.groupCls,layout:"column",renderTo:j,bufferResize:false};var a={xtype:"container",defaultType:this.defaultType,layout:"form",defaults:{hideLabel:true,anchor:"100%"}};if(this.items[0].items){Ext.apply(p,{layoutConfig:{columns:this.items.length},defaults:this.defaults,items:this.items});for(var e=0,m=this.items.length;e0&&e%r==0){o++}if(this.items[e].fieldLabel){this.items[e].hideLabel=false}n[o].items.push(this.items[e])}}else{for(var e=0,m=this.items.length;e-1){b.setValue(true)}})},getBox:function(b){var a=null;this.eachItem(function(c){if(b==c||c.dataIndex==b||c.id==b||c.getName()==b){a=c;return false}});return a},getValue:function(){var a=[];this.eachItem(function(b){if(b.checked){a.push(b)}});return a},eachItem:function(b,a){if(this.items&&this.items.each){this.items.each(b,a||this)}},getRawValue:Ext.emptyFn,setRawValue:Ext.emptyFn});Ext.reg("checkboxgroup",Ext.form.CheckboxGroup);Ext.form.CompositeField=Ext.extend(Ext.form.Field,{defaultMargins:"0 5 0 0",skipLastItemMargin:true,isComposite:true,combineErrors:true,initComponent:function(){var e=[],a=this.items,d;for(var c=0,b=a.length;c")},sortErrors:function(){var a=this.items;this.fieldErrors.sort("ASC",function(g,d){var c=function(b){return function(i){return i.getName()==b}};var h=a.findIndexBy(c(g.field)),e=a.findIndexBy(c(d.field));return h1){var a=this.getBox(c);if(a){a.setValue(b);if(a.checked){this.eachItem(function(d){if(d!==a){d.setValue(false)}})}}}else{this.setValueForItem(c)}},setValueForItem:function(a){a=String(a).split(",")[0];this.eachItem(function(b){b.setValue(a==b.inputValue)})},fireChecked:function(){if(!this.checkTask){this.checkTask=new Ext.util.DelayedTask(this.bufferChecked,this)}this.checkTask.delay(10)},bufferChecked:function(){var a=null;this.eachItem(function(b){if(b.checked){a=b;return false}});this.fireEvent("change",this,a)},onDestroy:function(){if(this.checkTask){this.checkTask.cancel();this.checkTask=null}Ext.form.RadioGroup.superclass.onDestroy.call(this)}});Ext.reg("radiogroup",Ext.form.RadioGroup);Ext.form.Hidden=Ext.extend(Ext.form.Field,{inputType:"hidden",onRender:function(){Ext.form.Hidden.superclass.onRender.apply(this,arguments)},initEvents:function(){this.originalValue=this.getValue()},setSize:Ext.emptyFn,setWidth:Ext.emptyFn,setHeight:Ext.emptyFn,setPosition:Ext.emptyFn,setPagePosition:Ext.emptyFn,markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn});Ext.reg("hidden",Ext.form.Hidden);Ext.form.BasicForm=Ext.extend(Ext.util.Observable,{constructor:function(b,a){Ext.apply(this,a);if(Ext.isString(this.paramOrder)){this.paramOrder=this.paramOrder.split(/[\s,|]/)}this.items=new Ext.util.MixedCollection(false,function(c){return c.getItemId()});this.addEvents("beforeaction","actionfailed","actioncomplete");if(b){this.initEl(b)}Ext.form.BasicForm.superclass.constructor.call(this)},timeout:30,paramOrder:undefined,paramsAsHash:false,waitTitle:"Please Wait...",activeAction:null,trackResetOnLoad:false,initEl:function(a){this.el=Ext.get(a);this.id=this.el.id||Ext.id();if(!this.standardSubmit){this.el.on("submit",this.onSubmit,this)}this.el.addClass("x-form")},getEl:function(){return this.el},onSubmit:function(a){a.stopEvent()},destroy:function(a){if(a!==true){this.items.each(function(b){Ext.destroy(b)});Ext.destroy(this.el)}this.items.clear();this.purgeListeners()},isValid:function(){var a=true;this.items.each(function(b){if(!b.validate()){a=false}});return a},isDirty:function(){var a=false;this.items.each(function(b){if(b.isDirty()){a=true;return false}});return a},doAction:function(b,a){if(Ext.isString(b)){b=new Ext.form.Action.ACTION_TYPES[b](this,a)}if(this.fireEvent("beforeaction",this,b)!==false){this.beforeAction(b);b.run.defer(100,b)}return this},submit:function(b){b=b||{};if(this.standardSubmit){var a=b.clientValidation===false||this.isValid();if(a){var c=this.el.dom;if(this.url&&Ext.isEmpty(c.action)){c.action=this.url}c.submit()}return a}var d=String.format("{0}submit",this.api?"direct":"");this.doAction(d,b);return this},load:function(a){var b=String.format("{0}load",this.api?"direct":"");this.doAction(b,a);return this},updateRecord:function(b){b.beginEdit();var a=b.fields;a.each(function(c){var d=this.findField(c.name);if(d){b.set(c.name,d.getValue())}},this);b.endEdit();return this},loadRecord:function(a){this.setValues(a.data);return this},beforeAction:function(a){this.items.each(function(c){if(c.isFormField&&c.syncValue){c.syncValue()}});var b=a.options;if(b.waitMsg){if(this.waitMsgTarget===true){this.el.mask(b.waitMsg,"x-mask-loading")}else{if(this.waitMsgTarget){this.waitMsgTarget=Ext.get(this.waitMsgTarget);this.waitMsgTarget.mask(b.waitMsg,"x-mask-loading")}else{Ext.MessageBox.wait(b.waitMsg,b.waitTitle||this.waitTitle)}}}},afterAction:function(a,c){this.activeAction=null;var b=a.options;if(b.waitMsg){if(this.waitMsgTarget===true){this.el.unmask()}else{if(this.waitMsgTarget){this.waitMsgTarget.unmask()}else{Ext.MessageBox.updateProgress(1);Ext.MessageBox.hide()}}}if(c){if(b.reset){this.reset()}Ext.callback(b.success,b.scope,[this,a]);this.fireEvent("actioncomplete",this,a)}else{Ext.callback(b.failure,b.scope,[this,a]);this.fireEvent("actionfailed",this,a)}},findField:function(c){var b=this.items.get(c);if(!Ext.isObject(b)){var a=function(d){if(d.isFormField){if(d.dataIndex==c||d.id==c||d.getName()==c){b=d;return false}else{if(d.isComposite){return d.items.each(a)}}}};this.items.each(a)}return b||null},markInvalid:function(h){if(Ext.isArray(h)){for(var c=0,a=h.length;c':">"),c,"")}return d.join("")},createToolbar:function(e){var c=[];var a=Ext.QuickTips&&Ext.QuickTips.isEnabled();function d(j,h,i){return{itemId:j,cls:"x-btn-icon",iconCls:"x-edit-"+j,enableToggle:h!==false,scope:e,handler:i||e.relayBtnCmd,clickEvent:"mousedown",tooltip:a?e.buttonTips[j]||undefined:undefined,overflowText:e.buttonTips[j].title||undefined,tabIndex:-1}}if(this.enableFont&&!Ext.isSafari2){var g=new Ext.Toolbar.Item({autoEl:{tag:"select",cls:"x-font-select",html:this.createFontOptions()}});c.push(g,"-")}if(this.enableFormat){c.push(d("bold"),d("italic"),d("underline"))}if(this.enableFontSize){c.push("-",d("increasefontsize",false,this.adjustFont),d("decreasefontsize",false,this.adjustFont))}if(this.enableColors){c.push("-",{itemId:"forecolor",cls:"x-btn-icon",iconCls:"x-edit-forecolor",clickEvent:"mousedown",tooltip:a?e.buttonTips.forecolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({allowReselect:true,focus:Ext.emptyFn,value:"000000",plain:true,listeners:{scope:this,select:function(i,h){this.execCmd("forecolor",Ext.isWebKit||Ext.isIE?"#"+h:h);this.deferFocus()}},clickEvent:"mousedown"})},{itemId:"backcolor",cls:"x-btn-icon",iconCls:"x-edit-backcolor",clickEvent:"mousedown",tooltip:a?e.buttonTips.backcolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({focus:Ext.emptyFn,value:"FFFFFF",plain:true,allowReselect:true,listeners:{scope:this,select:function(i,h){if(Ext.isGecko){this.execCmd("useCSS",false);this.execCmd("hilitecolor",h);this.execCmd("useCSS",true);this.deferFocus()}else{this.execCmd(Ext.isOpera?"hilitecolor":"backcolor",Ext.isWebKit||Ext.isIE?"#"+h:h);this.deferFocus()}}},clickEvent:"mousedown"})})}if(this.enableAlignments){c.push("-",d("justifyleft"),d("justifycenter"),d("justifyright"))}if(!Ext.isSafari2){if(this.enableLinks){c.push("-",d("createlink",false,this.createLink))}if(this.enableLists){c.push("-",d("insertorderedlist"),d("insertunorderedlist"))}if(this.enableSourceEdit){c.push("-",d("sourceedit",true,function(h){this.toggleSourceEdit(!this.sourceEditMode)}))}}var b=new Ext.Toolbar({renderTo:this.wrap.dom.firstChild,items:c});if(g){this.fontSelect=g.el;this.mon(this.fontSelect,"change",function(){var h=this.fontSelect.dom.value;this.relayCmd("fontname",h);this.deferFocus()},this)}this.mon(b.el,"click",function(h){h.preventDefault()});this.tb=b;this.tb.doLayout()},onDisable:function(){this.wrap.mask();Ext.form.HtmlEditor.superclass.onDisable.call(this)},onEnable:function(){this.wrap.unmask();Ext.form.HtmlEditor.superclass.onEnable.call(this)},setReadOnly:function(b){Ext.form.HtmlEditor.superclass.setReadOnly.call(this,b);if(this.initialized){this.setDesignMode(!b);var a=this.getEditorBody();if(a){a.style.cursor=this.readOnly?"default":"text"}this.disableItems(b)}},getDocMarkup:function(){var a=Ext.fly(this.iframe).getHeight()-this.iframePad*2;return String.format('',this.iframePad,a)},getEditorBody:function(){var a=this.getDoc();return a.body||a.documentElement},getDoc:function(){return Ext.isIE?this.getWin().document:(this.iframe.contentDocument||this.getWin().document)},getWin:function(){return Ext.isIE?this.iframe.contentWindow:window.frames[this.iframe.name]},onRender:function(b,a){Ext.form.HtmlEditor.superclass.onRender.call(this,b,a);this.el.dom.style.border="0 none";this.el.dom.setAttribute("tabIndex",-1);this.el.addClass("x-hidden");if(Ext.isIE){this.el.applyStyles("margin-top:-1px;margin-bottom:-1px;")}this.wrap=this.el.wrap({cls:"x-html-editor-wrap",cn:{cls:"x-html-editor-tb"}});this.createToolbar(this);this.disableItems(true);this.tb.doLayout();this.createIFrame();if(!this.width){var c=this.el.getSize();this.setSize(c.width,this.height||c.height)}this.resizeEl=this.positionEl=this.wrap},createIFrame:function(){var a=document.createElement("iframe");a.name=Ext.id();a.frameBorder="0";a.style.overflow="auto";this.wrap.dom.appendChild(a);this.iframe=a;this.monitorTask=Ext.TaskMgr.start({run:this.checkDesignMode,scope:this,interval:100})},initFrame:function(){Ext.TaskMgr.stop(this.monitorTask);var b=this.getDoc();this.win=this.getWin();b.open();b.write(this.getDocMarkup());b.close();var a={run:function(){var c=this.getDoc();if(c.body||c.readyState=="complete"){Ext.TaskMgr.stop(a);this.setDesignMode(true);this.initEditor.defer(10,this)}},interval:10,duration:10000,scope:this};Ext.TaskMgr.start(a)},checkDesignMode:function(){if(this.wrap&&this.wrap.dom.offsetWidth){var a=this.getDoc();if(!a){return}if(!a.editorInitialized||this.getDesignMode()!="on"){this.initFrame()}}},setDesignMode:function(b){var a;if(a=this.getDoc()){if(this.readOnly){b=false}a.designMode=(/on|true/i).test(String(b).toLowerCase())?"on":"off"}},getDesignMode:function(){var a=this.getDoc();if(!a){return""}return String(a.designMode).toLowerCase()},disableItems:function(a){if(this.fontSelect){this.fontSelect.dom.disabled=a}this.tb.items.each(function(b){if(b.getItemId()!="sourceedit"){b.setDisabled(a)}})},onResize:function(b,c){Ext.form.HtmlEditor.superclass.onResize.apply(this,arguments);if(this.el&&this.iframe){if(Ext.isNumber(b)){var e=b-this.wrap.getFrameWidth("lr");this.el.setWidth(e);this.tb.setWidth(e);this.iframe.style.width=Math.max(e,0)+"px"}if(Ext.isNumber(c)){var a=c-this.wrap.getFrameWidth("tb")-this.tb.el.getHeight();this.el.setHeight(a);this.iframe.style.height=Math.max(a,0)+"px";var d=this.getEditorBody();if(d){d.style.height=Math.max((a-(this.iframePad*2)),0)+"px"}}}},toggleSourceEdit:function(b){var d,a;if(b===undefined){b=!this.sourceEditMode}this.sourceEditMode=b===true;var c=this.tb.getComponent("sourceedit");if(c.pressed!==this.sourceEditMode){c.toggle(this.sourceEditMode);if(!c.xtbHidden){return}}if(this.sourceEditMode){ls=this.getSize();d=Ext.get(this.iframe).getHeight();this.disableItems(true);this.syncValue();this.iframe.className="x-hidden";this.el.removeClass("x-hidden");this.el.dom.removeAttribute("tabIndex");this.el.focus();this.el.dom.style.height=d+"px"}else{a=parseInt(this.el.dom.style.height,10);if(this.initialized){this.disableItems(this.readOnly)}this.pushValue();this.iframe.className="";this.el.addClass("x-hidden");this.el.dom.setAttribute("tabIndex",-1);this.deferFocus();this.setSize(ls);this.iframe.style.height=a+"px"}this.fireEvent("editmodechange",this,this.sourceEditMode)},createLink:function(){var a=prompt(this.createLinkText,this.defaultLinkValue);if(a&&a!="http://"){this.relayCmd("createlink",a)}},initEvents:function(){this.originalValue=this.getValue()},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,setValue:function(a){Ext.form.HtmlEditor.superclass.setValue.call(this,a);this.pushValue();return this},cleanHtml:function(a){a=String(a);if(Ext.isWebKit){a=a.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,"")}if(a.charCodeAt(0)==this.defaultValue.replace(/\D/g,"")){a=a.substring(1)}return a},syncValue:function(){if(this.initialized){var d=this.getEditorBody();var c=d.innerHTML;if(Ext.isWebKit){var b=d.getAttribute("style");var a=b.match(/text-align:(.*?);/i);if(a&&a[1]){c='
    '+c+"
    "}}c=this.cleanHtml(c);if(this.fireEvent("beforesync",this,c)!==false){this.el.dom.value=c;this.fireEvent("sync",this,c)}}},getValue:function(){this[this.sourceEditMode?"pushValue":"syncValue"]();return Ext.form.HtmlEditor.superclass.getValue.call(this)},pushValue:function(){if(this.initialized){var a=this.el.dom.value;if(!this.activated&&a.length<1){a=this.defaultValue}if(this.fireEvent("beforepush",this,a)!==false){this.getEditorBody().innerHTML=a;if(Ext.isGecko){this.setDesignMode(false)}this.setDesignMode(true);this.fireEvent("push",this,a)}}},deferFocus:function(){this.focus.defer(10,this)},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus()}else{this.el.focus()}},initEditor:function(){try{var c=this.getEditorBody(),a=this.el.getStyles("font-size","font-family","background-image","background-repeat","background-color","color"),g,b;a["background-attachment"]="fixed";c.bgProperties="fixed";Ext.DomHelper.applyStyles(c,a);g=this.getDoc();if(g){try{Ext.EventManager.removeAll(g)}catch(d){}}b=this.onEditorEvent.createDelegate(this);Ext.EventManager.on(g,{mousedown:b,dblclick:b,click:b,keyup:b,buffer:100});if(Ext.isGecko){Ext.EventManager.on(g,"keypress",this.applyCommand,this)}if(Ext.isIE||Ext.isWebKit||Ext.isOpera){Ext.EventManager.on(g,"keydown",this.fixKeys,this)}g.editorInitialized=true;this.initialized=true;this.pushValue();this.setReadOnly(this.readOnly);this.fireEvent("initialize",this)}catch(d){}},onDestroy:function(){if(this.monitorTask){Ext.TaskMgr.stop(this.monitorTask)}if(this.rendered){Ext.destroy(this.tb);var b=this.getDoc();if(b){try{Ext.EventManager.removeAll(b);for(var c in b){delete b[c]}}catch(a){}}if(this.wrap){this.wrap.dom.innerHTML="";this.wrap.remove()}}if(this.el){this.el.removeAllListeners();this.el.remove()}this.purgeListeners()},onFirstFocus:function(){this.activated=true;this.disableItems(this.readOnly);if(Ext.isGecko){this.win.focus();var a=this.win.getSelection();if(!a.focusNode||a.focusNode.nodeType!=3){var b=a.getRangeAt(0);b.selectNodeContents(this.getEditorBody());b.collapse(true);this.deferFocus()}try{this.execCmd("useCSS",true);this.execCmd("styleWithCSS",false)}catch(c){}}this.fireEvent("activate",this)},adjustFont:function(b){var d=b.getItemId()=="increasefontsize"?1:-1,c=this.getDoc(),a=parseInt(c.queryCommandValue("FontSize")||2,10);if((Ext.isSafari&&!Ext.isSafari2)||Ext.isChrome||Ext.isAir){if(a<=10){a=1+d}else{if(a<=13){a=2+d}else{if(a<=16){a=3+d}else{if(a<=18){a=4+d}else{if(a<=24){a=5+d}else{a=6+d}}}}}a=a.constrain(1,6)}else{if(Ext.isSafari){d*=2}a=Math.max(1,a+d)+(Ext.isSafari?"px":0)}this.execCmd("FontSize",a)},onEditorEvent:function(a){this.updateToolbar()},updateToolbar:function(){if(this.readOnly){return}if(!this.activated){this.onFirstFocus();return}var b=this.tb.items.map,c=this.getDoc();if(this.enableFont&&!Ext.isSafari2){var a=(c.queryCommandValue("FontName")||this.defaultFont).toLowerCase();if(a!=this.fontSelect.dom.value){this.fontSelect.dom.value=a}}if(this.enableFormat){b.bold.toggle(c.queryCommandState("bold"));b.italic.toggle(c.queryCommandState("italic"));b.underline.toggle(c.queryCommandState("underline"))}if(this.enableAlignments){b.justifyleft.toggle(c.queryCommandState("justifyleft"));b.justifycenter.toggle(c.queryCommandState("justifycenter"));b.justifyright.toggle(c.queryCommandState("justifyright"))}if(!Ext.isSafari2&&this.enableLists){b.insertorderedlist.toggle(c.queryCommandState("insertorderedlist"));b.insertunorderedlist.toggle(c.queryCommandState("insertunorderedlist"))}Ext.menu.MenuMgr.hideAll();this.syncValue()},relayBtnCmd:function(a){this.relayCmd(a.getItemId())},relayCmd:function(b,a){(function(){this.focus();this.execCmd(b,a);this.updateToolbar()}).defer(10,this)},execCmd:function(b,a){var c=this.getDoc();c.execCommand(b,false,a===undefined?null:a);this.syncValue()},applyCommand:function(b){if(b.ctrlKey){var d=b.getCharCode(),a;if(d>0){d=String.fromCharCode(d);switch(d){case"b":a="bold";break;case"i":a="italic";break;case"u":a="underline";break}if(a){this.win.focus();this.execCmd(a);this.deferFocus();b.preventDefault()}}}},insertAtCursor:function(c){if(!this.activated){return}if(Ext.isIE){this.win.focus();var b=this.getDoc(),a=b.selection.createRange();if(a){a.pasteHTML(c);this.syncValue();this.deferFocus()}}else{this.win.focus();this.execCmd("InsertHTML",c);this.deferFocus()}},fixKeys:function(){if(Ext.isIE){return function(g){var a=g.getKey(),d=this.getDoc(),b;if(a==g.TAB){g.stopEvent();b=d.selection.createRange();if(b){b.collapse(true);b.pasteHTML("    ");this.deferFocus()}}else{if(a==g.ENTER){b=d.selection.createRange();if(b){var c=b.parentElement();if(!c||c.tagName.toLowerCase()!="li"){g.stopEvent();b.pasteHTML("
    ");b.collapse(false);b.select()}}}}}}else{if(Ext.isOpera){return function(b){var a=b.getKey();if(a==b.TAB){b.stopEvent();this.win.focus();this.execCmd("InsertHTML","    ");this.deferFocus()}}}else{if(Ext.isWebKit){return function(b){var a=b.getKey();if(a==b.TAB){b.stopEvent();this.execCmd("InsertText","\t");this.deferFocus()}else{if(a==b.ENTER){b.stopEvent();this.execCmd("InsertHtml","

    ");this.deferFocus()}}}}}}}(),getToolbar:function(){return this.tb},buttonTips:{bold:{title:"Bold (Ctrl+B)",text:"Make the selected text bold.",cls:"x-html-editor-tip"},italic:{title:"Italic (Ctrl+I)",text:"Make the selected text italic.",cls:"x-html-editor-tip"},underline:{title:"Underline (Ctrl+U)",text:"Underline the selected text.",cls:"x-html-editor-tip"},increasefontsize:{title:"Grow Text",text:"Increase the font size.",cls:"x-html-editor-tip"},decreasefontsize:{title:"Shrink Text",text:"Decrease the font size.",cls:"x-html-editor-tip"},backcolor:{title:"Text Highlight Color",text:"Change the background color of the selected text.",cls:"x-html-editor-tip"},forecolor:{title:"Font Color",text:"Change the color of the selected text.",cls:"x-html-editor-tip"},justifyleft:{title:"Align Text Left",text:"Align text to the left.",cls:"x-html-editor-tip"},justifycenter:{title:"Center Text",text:"Center text in the editor.",cls:"x-html-editor-tip"},justifyright:{title:"Align Text Right",text:"Align text to the right.",cls:"x-html-editor-tip"},insertunorderedlist:{title:"Bullet List",text:"Start a bulleted list.",cls:"x-html-editor-tip"},insertorderedlist:{title:"Numbered List",text:"Start a numbered list.",cls:"x-html-editor-tip"},createlink:{title:"Hyperlink",text:"Make the selected text a hyperlink.",cls:"x-html-editor-tip"},sourceedit:{title:"Source Edit",text:"Switch to source editing mode.",cls:"x-html-editor-tip"}}});Ext.reg("htmleditor",Ext.form.HtmlEditor);Ext.form.TimeField=Ext.extend(Ext.form.ComboBox,{minValue:undefined,maxValue:undefined,minText:"The time in this field must be equal to or after {0}",maxText:"The time in this field must be equal to or before {0}",invalidText:"{0} is not a valid time",format:"g:i A",altFormats:"g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H|gi a|hi a|giA|hiA|gi A|hi A",increment:15,mode:"local",triggerAction:"all",typeAhead:false,initDate:"1/1/2008",initDateFormat:"j/n/Y",initComponent:function(){if(Ext.isDefined(this.minValue)){this.setMinValue(this.minValue,true)}if(Ext.isDefined(this.maxValue)){this.setMaxValue(this.maxValue,true)}if(!this.store){this.generateStore(true)}Ext.form.TimeField.superclass.initComponent.call(this)},setMinValue:function(b,a){this.setLimit(b,true,a);return this},setMaxValue:function(b,a){this.setLimit(b,false,a);return this},generateStore:function(b){var c=this.minValue||new Date(this.initDate).clearTime(),a=this.maxValue||new Date(this.initDate).clearTime().add("mi",(24*60)-1),d=[];while(c<=a){d.push(c.dateFormat(this.format));c=c.add("mi",this.increment)}this.bindStore(d,b)},setLimit:function(b,g,a){var e;if(Ext.isString(b)){e=this.parseDate(b)}else{if(Ext.isDate(b)){e=b}}if(e){var c=new Date(this.initDate).clearTime();c.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());this[g?"minValue":"maxValue"]=c;if(!a){this.generateStore()}}},getValue:function(){var a=Ext.form.TimeField.superclass.getValue.call(this);return this.formatDate(this.parseDate(a))||""},setValue:function(a){return Ext.form.TimeField.superclass.setValue.call(this,this.formatDate(this.parseDate(a)))},validateValue:Ext.form.DateField.prototype.validateValue,formatDate:Ext.form.DateField.prototype.formatDate,parseDate:function(h){if(!h||Ext.isDate(h)){return h}var j=this.initDate+" ",g=this.initDateFormat+" ",b=Date.parseDate(j+h,g+this.format),c=this.altFormats;if(!b&&c){if(!this.altFormatsArray){this.altFormatsArray=c.split("|")}for(var e=0,d=this.altFormatsArray,a=d.length;e=0){if(!d){c=g-1}d=false;while(c>=0){if(e.call(j||this,k,c,i)===true){return[k,c]}c--}k--}}else{if(c>=g){k++;d=false}while(k','
    ','
    {header}
    ','
    {body}
    ',"
    ",'
     
    ','
     
    ',"")}if(!c.header){c.header=new Ext.Template('','{cells}',"
    ")}if(!c.hcell){c.hcell=new Ext.Template('
    ',this.grid.enableHdMenu?'':"",'{value}',"
    ")}if(!c.body){c.body=new Ext.Template("{rows}")}if(!c.row){c.row=new Ext.Template('
    ',"{cells}",(this.enableRowBody?'':""),"
    {body}
    ")}if(!c.cell){c.cell=new Ext.Template('','
    {value}
    ',"")}for(var a in c){var b=c[a];if(b&&Ext.isFunction(b.compile)&&!b.compiled){b.disableFormats=true;b.compile()}}this.templates=c;this.colRe=new RegExp("x-grid3-td-([^\\s]+)","")},fly:function(a){if(!this._flyweight){this._flyweight=new Ext.Element.Flyweight(document.body)}this._flyweight.dom=a;return this._flyweight},getEditorParent:function(){return this.scroller.dom},initElements:function(){var c=Ext.Element;var b=this.grid.getGridEl().dom.firstChild;var a=b.childNodes;this.el=new c(b);this.mainWrap=new c(a[0]);this.mainHd=new c(this.mainWrap.dom.firstChild);if(this.grid.hideHeaders){this.mainHd.setDisplayed(false)}this.innerHd=this.mainHd.dom.firstChild;this.scroller=new c(this.mainWrap.dom.childNodes[1]);if(this.forceFit){this.scroller.setStyle("overflow-x","hidden")}this.mainBody=new c(this.scroller.dom.firstChild);this.focusEl=new c(this.scroller.dom.childNodes[1]);this.focusEl.swallowEvent("click",true);this.resizeMarker=new c(a[1]);this.resizeProxy=new c(a[2])},getRows:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},findCell:function(a){if(!a){return false}return this.fly(a).findParent(this.cellSelector,this.cellSelectorDepth)},findCellIndex:function(c,b){var a=this.findCell(c);if(a&&(!b||this.fly(a).hasClass(b))){return this.getCellIndex(a)}return false},getCellIndex:function(b){if(b){var a=b.className.match(this.colRe);if(a&&a[1]){return this.cm.getIndexById(a[1])}}return false},findHeaderCell:function(b){var a=this.findCell(b);return a&&this.fly(a).hasClass(this.hdCls)?a:null},findHeaderIndex:function(a){return this.findCellIndex(a,this.hdCls)},findRow:function(a){if(!a){return false}return this.fly(a).findParent(this.rowSelector,this.rowSelectorDepth)},findRowIndex:function(a){var b=this.findRow(a);return b?b.rowIndex:false},findRowBody:function(a){if(!a){return false}return this.fly(a).findParent(this.rowBodySelector,this.rowBodySelectorDepth)},getRow:function(a){return this.getRows()[a]},getCell:function(b,a){return this.getRow(b).getElementsByTagName("td")[a]},getHeaderCell:function(a){return this.mainHd.dom.getElementsByTagName("td")[a]},addRowClass:function(c,a){var b=this.getRow(c);if(b){this.fly(b).addClass(a)}},removeRowClass:function(c,a){var b=this.getRow(c);if(b){this.fly(b).removeClass(a)}},removeRow:function(a){Ext.removeNode(this.getRow(a));this.syncFocusEl(a)},removeRows:function(c,a){var b=this.mainBody.dom;for(var d=c;d<=a;d++){Ext.removeNode(b.childNodes[c])}this.syncFocusEl(c)},getScrollState:function(){var a=this.scroller.dom;return{left:a.scrollLeft,top:a.scrollTop}},restoreScroll:function(a){var b=this.scroller.dom;b.scrollLeft=a.left;b.scrollTop=a.top},scrollToTop:function(){this.scroller.dom.scrollTop=0;this.scroller.dom.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var a=this.scroller.dom;this.grid.fireEvent("bodyscroll",a.scrollLeft,a.scrollTop)},syncHeaderScroll:function(){var a=this.scroller.dom;this.innerHd.scrollLeft=a.scrollLeft;this.innerHd.scrollLeft=a.scrollLeft},updateSortIcon:function(b,a){var d=this.sortClasses;var c=this.mainHd.select("td").removeClass(d);c.item(b).addClass(d[a=="DESC"?1:0])},updateAllColumnWidths:function(){var d=this.getTotalWidth(),l=this.cm.getColumnCount(),g=[],e,b;for(b=0;b=this.ds.getCount()){return null}d=(d!==undefined?d:0);var c=this.getRow(h),a=this.cm,e=a.getColumnCount(),b;if(!(g===false&&d===0)){while(dm){n.scrollTop=q-a}}if(e!==false){var l=parseInt(h.offsetLeft,10);var j=l+h.offsetWidth;var i=parseInt(n.scrollLeft,10);var b=i+n.clientWidth;if(lb){n.scrollLeft=j-n.clientWidth}}}return this.getResolvedXY(r)},insertRows:function(a,i,e,h){var d=a.getCount()-1;if(!h&&i===0&&e>=d){this.fireEvent("beforerowsinserted",this,i,e);this.refresh();this.fireEvent("rowsinserted",this,i,e)}else{if(!h){this.fireEvent("beforerowsinserted",this,i,e)}var b=this.renderRows(i,e),g=this.getRow(i);if(g){if(i===0){Ext.fly(this.getRow(0)).removeClass(this.firstRowCls)}Ext.DomHelper.insertHtml("beforeBegin",g,b)}else{var c=this.getRow(d-1);if(c){Ext.fly(c).removeClass(this.lastRowCls)}Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,b)}if(!h){this.fireEvent("rowsinserted",this,i,e);this.processRows(i)}else{if(i===0||i>=d){Ext.fly(this.getRow(i)).addClass(i===0?this.firstRowCls:this.lastRowCls)}}}this.syncFocusEl(i)},deleteRows:function(a,c,b){if(a.getRowCount()<1){this.refresh()}else{this.fireEvent("beforerowsdeleted",this,c,b);this.removeRows(c,b);this.processRows(c);this.fireEvent("rowsdeleted",this,c,b)}},getColumnStyle:function(a,c){var b=!c?(this.cm.config[a].css||""):"";b+="width:"+this.getColumnWidth(a)+";";if(this.cm.isHidden(a)){b+="display:none;"}var d=this.cm.config[a].align;if(d){b+="text-align:"+d+";"}return b},getColumnWidth:function(b){var a=this.cm.getColumnWidth(b);if(Ext.isNumber(a)){return(Ext.isBorderBox||(Ext.isWebKit&&!Ext.isSafari2)?a:(a-this.borderWidth>0?a-this.borderWidth:0))+"px"}return a},getTotalWidth:function(){return this.cm.getTotalWidth()+"px"},fitColumns:function(d,h,j){var q=this.cm,k;var l=q.getTotalWidth(false);var a=this.grid.getGridEl().getWidth(true)-this.getScrollOffset();if(a<20){return}var e=a-l;if(e===0){return false}var m=q.getColumnCount(true);var s=m-(Ext.isNumber(j)?1:0);if(s===0){s=1;j=undefined}var r=q.getColumnCount();var o=[];var n=0;var c=0;var p;for(k=0;ka){var g=s!=m?j:n;q.setColumnWidth(g,Math.max(1,q.getColumnWidth(g)-(l-a)),true)}if(d!==true){this.updateAllColumnWidths()}return true},autoExpand:function(b){var i=this.grid,a=this.cm;if(!this.userResized&&i.autoExpandColumn){var d=a.getTotalWidth(false);var j=this.grid.getGridEl().getWidth(true)-this.getScrollOffset();if(d!=j){var h=a.getIndexById(i.autoExpandColumn);var e=a.getColumnWidth(h);var c=Math.min(Math.max(((j-d)+e),i.autoExpandMin),i.autoExpandMax);if(c!=e){a.setColumnWidth(h,c,true);if(b!==true){this.updateColumnWidth(h,c)}}}}},getColumnData:function(){var d=[],a=this.cm,e=a.getColumnCount();for(var c=0;c'+this.emptyText+"")}},updateHeaderSortState:function(){var b=this.ds.getSortState();if(!b){return}if(!this.sortState||(this.sortState.field!=b.field||this.sortState.direction!=b.direction)){this.grid.fireEvent("sortchange",this.grid,b)}this.sortState=b;var c=this.cm.findColumnIndex(b.field);if(c!=-1){var a=b.direction;this.updateSortIcon(c,a)}},clearHeaderSortState:function(){if(!this.sortState){return}this.grid.fireEvent("sortchange",this.grid,null);this.mainHd.select("td").removeClass(this.sortClasses);delete this.sortState},destroy:function(){if(this.scrollToTopTask&&this.scrollToTopTask.cancel){this.scrollToTopTask.cancel()}if(this.colMenu){Ext.menu.MenuMgr.unregister(this.colMenu);this.colMenu.destroy();delete this.colMenu}if(this.hmenu){Ext.menu.MenuMgr.unregister(this.hmenu);this.hmenu.destroy();delete this.hmenu}this.initData(null,null);this.purgeListeners();Ext.fly(this.innerHd).un("click",this.handleHdDown,this);if(this.grid.enableColumnMove){Ext.destroy(this.columnDrag.el,this.columnDrag.proxy.ghost,this.columnDrag.proxy.el,this.columnDrop.el,this.columnDrop.proxyTop,this.columnDrop.proxyBottom,this.columnDrag.dragData.ddel,this.columnDrag.dragData.header);if(this.columnDrag.proxy.anim){Ext.destroy(this.columnDrag.proxy.anim)}delete this.columnDrag.proxy.ghost;delete this.columnDrag.dragData.ddel;delete this.columnDrag.dragData.header;this.columnDrag.destroy();delete Ext.dd.DDM.locationCache[this.columnDrag.id];delete this.columnDrag._domRef;delete this.columnDrop.proxyTop;delete this.columnDrop.proxyBottom;this.columnDrop.destroy();delete Ext.dd.DDM.locationCache["gridHeader"+this.grid.getGridEl().id];delete this.columnDrop._domRef;delete Ext.dd.DDM.ids[this.columnDrop.ddGroup]}if(this.splitZone){this.splitZone.destroy();delete this.splitZone._domRef;delete Ext.dd.DDM.ids["gridSplitters"+this.grid.getGridEl().id]}Ext.fly(this.innerHd).removeAllListeners();Ext.removeNode(this.innerHd);delete this.innerHd;Ext.destroy(this.el,this.mainWrap,this.mainHd,this.scroller,this.mainBody,this.focusEl,this.resizeMarker,this.resizeProxy,this.activeHdBtn,this.dragZone,this.splitZone,this._flyweight);delete this.grid.container;if(this.dragZone){this.dragZone.destroy()}Ext.dd.DDM.currentTarget=null;delete Ext.dd.DDM.locationCache[this.grid.getGridEl().id];Ext.EventManager.removeResizeListener(this.onWindowResize,this)},onDenyColumnHide:function(){},render:function(){if(this.autoFill){var a=this.grid.ownerCt;if(a&&a.getLayout()){a.on("afterlayout",function(){this.fitColumns(true,true);this.updateHeaders()},this,{single:true})}else{this.fitColumns(true,true)}}else{if(this.forceFit){this.fitColumns(true,false)}else{if(this.grid.autoExpandColumn){this.autoExpand(true)}}}this.renderUI()},initData:function(b,a){if(this.ds){this.ds.un("load",this.onLoad,this);this.ds.un("datachanged",this.onDataChange,this);this.ds.un("add",this.onAdd,this);this.ds.un("remove",this.onRemove,this);this.ds.un("update",this.onUpdate,this);this.ds.un("clear",this.onClear,this);if(this.ds!==b&&this.ds.autoDestroy){this.ds.destroy()}}if(b){b.on({scope:this,load:this.onLoad,datachanged:this.onDataChange,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,clear:this.onClear})}this.ds=b;if(this.cm){this.cm.un("configchange",this.onColConfigChange,this);this.cm.un("widthchange",this.onColWidthChange,this);this.cm.un("headerchange",this.onHeaderChange,this);this.cm.un("hiddenchange",this.onHiddenChange,this);this.cm.un("columnmoved",this.onColumnMove,this)}if(a){delete this.lastViewWidth;a.on({scope:this,configchange:this.onColConfigChange,widthchange:this.onColWidthChange,headerchange:this.onHeaderChange,hiddenchange:this.onHiddenChange,columnmoved:this.onColumnMove})}this.cm=a},onDataChange:function(){this.refresh();this.updateHeaderSortState();this.syncFocusEl(0)},onClear:function(){this.refresh();this.syncFocusEl(0)},onUpdate:function(b,a){this.refreshRow(a)},onAdd:function(c,a,b){this.insertRows(c,b,b+(a.length-1))},onRemove:function(d,a,b,c){if(c!==true){this.fireEvent("beforerowremoved",this,b,a)}this.removeRow(b);if(c!==true){this.processRows(b);this.applyEmptyText();this.fireEvent("rowremoved",this,b,a)}},onLoad:function(){if(Ext.isGecko){if(!this.scrollToTopTask){this.scrollToTopTask=new Ext.util.DelayedTask(this.scrollToTop,this)}this.scrollToTopTask.delay(1)}else{this.scrollToTop()}},onColWidthChange:function(a,b,c){this.updateColumnWidth(b,c)},onHeaderChange:function(a,b,c){this.updateHeaders()},onHiddenChange:function(a,b,c){this.updateColumnHidden(b,c)},onColumnMove:function(a,d,b){this.indexMap=null;var c=this.getScrollState();this.refresh(true);this.restoreScroll(c);this.afterMove(b);this.grid.fireEvent("columnmove",d,b)},onColConfigChange:function(){delete this.lastViewWidth;this.indexMap=null;this.refresh(true)},initUI:function(a){a.on("headerclick",this.onHeaderClick,this)},initEvents:function(){},onHeaderClick:function(b,a){if(this.headersDisabled||!this.cm.isSortable(a)){return}b.stopEditing(true);b.store.sort(this.cm.getDataIndex(a))},onRowOver:function(b,a){var c;if((c=this.findRowIndex(a))!==false){this.addRowClass(c,"x-grid3-row-over")}},onRowOut:function(b,a){var c;if((c=this.findRowIndex(a))!==false&&!b.within(this.getRow(c),true)){this.removeRowClass(c,"x-grid3-row-over")}},handleWheel:function(a){a.stopPropagation()},onRowSelect:function(a){this.addRowClass(a,this.selectedRowClass)},onRowDeselect:function(a){this.removeRowClass(a,this.selectedRowClass)},onCellSelect:function(c,b){var a=this.getCell(c,b);if(a){this.fly(a).addClass("x-grid3-cell-selected")}},onCellDeselect:function(c,b){var a=this.getCell(c,b);if(a){this.fly(a).removeClass("x-grid3-cell-selected")}},onColumnSplitterMoved:function(c,b){this.userResized=true;var a=this.grid.colModel;a.setColumnWidth(c,b,true);if(this.forceFit){this.fitColumns(true,false,c);this.updateAllColumnWidths()}else{this.updateColumnWidth(c,b);this.syncHeaderScroll()}this.grid.fireEvent("columnresize",c,b)},handleHdMenuClick:function(c){var b=this.hdCtxIndex,a=this.cm,d=this.ds,e=c.getItemId();switch(e){case"asc":d.sort(a.getDataIndex(b),"ASC");break;case"desc":d.sort(a.getDataIndex(b),"DESC");break;default:b=a.getIndexById(e.substr(4));if(b!=-1){if(c.checked&&a.getColumnsBy(this.isHideableColumn,this).length<=1){this.onDenyColumnHide();return false}a.setHidden(b,c.checked)}}return true},isHideableColumn:function(a){return !a.hidden},beforeColMenuShow:function(){var a=this.cm,c=a.getColumnCount();this.colMenu.removeAll();for(var b=0;b=0&&this.config[a].resizable!==false&&this.config[a].fixed!==true},setHidden:function(a,b){var d=this.config[a];if(d.hidden!==b){d.hidden=b;this.totalWidth=null;this.fireEvent("hiddenchange",this,a,b)}},setEditor:function(a,b){this.config[a].setEditor(b)},destroy:function(){var d;for(var b=0,a=this.config.length;b0},isSelected:function(a){var b=Ext.isNumber(a)?this.grid.store.getAt(a):a;return(b&&this.selections.key(b.id)?true:false)},isIdSelected:function(a){return(this.selections.key(a)?true:false)},handleMouseDown:function(d,i,h){if(h.button!==0||this.isLocked()){return}var a=this.grid.getView();if(h.shiftKey&&!this.singleSelect&&this.last!==false){var c=this.last;this.selectRange(c,i,h.ctrlKey);this.last=c;a.focusRow(i)}else{var b=this.isSelected(i);if(h.ctrlKey&&b){this.deselectRow(i)}else{if(!b||this.getCount()>1){this.selectRow(i,h.ctrlKey||h.shiftKey);a.focusRow(i)}}}},selectRows:function(c,d){if(!d){this.clearSelections()}for(var b=0,a=c.length;b=a;c--){this.selectRow(c,true)}}},deselectRange:function(c,b,a){if(this.isLocked()){return}for(var d=c;d<=b;d++){this.deselectRow(d,a)}},selectRow:function(b,d,a){if(this.isLocked()||(b<0||b>=this.grid.store.getCount())||(d&&this.isSelected(b))){return}var c=this.grid.store.getAt(b);if(c&&this.fireEvent("beforerowselect",this,b,d,c)!==false){if(!d||this.singleSelect){this.clearSelections()}this.selections.add(c);this.last=this.lastActive=b;if(!a){this.grid.getView().onRowSelect(b)}this.fireEvent("rowselect",this,b,c);this.fireEvent("selectionchange",this)}},deselectRow:function(b,a){if(this.isLocked()){return}if(this.last==b){this.last=false}if(this.lastActive==b){this.lastActive=false}var c=this.grid.store.getAt(b);if(c){this.selections.remove(c);if(!a){this.grid.getView().onRowDeselect(b)}this.fireEvent("rowdeselect",this,b,c);this.fireEvent("selectionchange",this)}},restoreLast:function(){if(this._last){this.last=this._last}},acceptsNav:function(c,b,a){return !a.isHidden(b)&&a.isCellEditable(b,c)},onEditorKey:function(n,l){var d=l.getKey(),h,i=this.grid,o=i.lastEdit,j=i.activeEditor,p,o,a,m;var b=l.shiftKey;if(d==l.TAB){l.stopEvent();j.completeEdit();if(b){h=i.walkCells(j.row,j.col-1,-1,this.acceptsNav,this)}else{h=i.walkCells(j.row,j.col+1,1,this.acceptsNav,this)}}else{if(d==l.ENTER){if(this.moveEditorOnEnter!==false){if(b){h=i.walkCells(o.row-1,o.col,-1,this.acceptsNav,this)}else{h=i.walkCells(o.row+1,o.col,1,this.acceptsNav,this)}}}}if(h){a=h[0];m=h[1];if(o.row!=a){this.selectRow(a)}if(i.isEditor&&i.editing){p=i.activeEditor;if(p&&p.field.triggerBlur){p.field.triggerBlur()}}i.startEditing(a,m)}},destroy:function(){if(this.rowNav){this.rowNav.disable();this.rowNav=null}Ext.grid.RowSelectionModel.superclass.destroy.call(this)}});Ext.grid.Column=Ext.extend(Object,{isColumn:true,constructor:function(b){Ext.apply(this,b);if(Ext.isString(this.renderer)){this.renderer=Ext.util.Format[this.renderer]}else{if(Ext.isObject(this.renderer)){this.scope=this.renderer.scope;this.renderer=this.renderer.fn}}if(!this.scope){this.scope=this}var a=this.editor;delete this.editor;this.setEditor(a)},renderer:function(a){if(Ext.isString(a)&&a.length<1){return" "}return a},getEditor:function(a){return this.editable!==false?this.editor:null},setEditor:function(b){var a=this.editor;if(a){if(a.gridEditor){a.gridEditor.destroy();delete a.gridEditor}else{a.destroy()}}this.editor=null;if(b){if(!b.isXType){b=Ext.create(b,"textfield")}this.editor=b}},getCellEditor:function(b){var a=this.getEditor(b);if(a){if(!a.startEdit){if(!a.gridEditor){a.gridEditor=new Ext.grid.GridEditor(a)}a=a.gridEditor}}return a}});Ext.grid.BooleanColumn=Ext.extend(Ext.grid.Column,{trueText:"true",falseText:"false",undefinedText:" ",constructor:function(a){Ext.grid.BooleanColumn.superclass.constructor.call(this,a);var c=this.trueText,d=this.falseText,b=this.undefinedText;this.renderer=function(e){if(e===undefined){return b}if(!e||e==="false"){return d}return c}}});Ext.grid.NumberColumn=Ext.extend(Ext.grid.Column,{format:"0,000.00",constructor:function(a){Ext.grid.NumberColumn.superclass.constructor.call(this,a);this.renderer=Ext.util.Format.numberRenderer(this.format)}});Ext.grid.DateColumn=Ext.extend(Ext.grid.Column,{format:"m/d/Y",constructor:function(a){Ext.grid.DateColumn.superclass.constructor.call(this,a);this.renderer=Ext.util.Format.dateRenderer(this.format)}});Ext.grid.TemplateColumn=Ext.extend(Ext.grid.Column,{constructor:function(a){Ext.grid.TemplateColumn.superclass.constructor.call(this,a);var b=(!Ext.isPrimitive(this.tpl)&&this.tpl.compile)?this.tpl:new Ext.XTemplate(this.tpl);this.renderer=function(d,e,c){return b.apply(c.data)};this.tpl=b}});Ext.grid.Column.types={gridcolumn:Ext.grid.Column,booleancolumn:Ext.grid.BooleanColumn,numbercolumn:Ext.grid.NumberColumn,datecolumn:Ext.grid.DateColumn,templatecolumn:Ext.grid.TemplateColumn};Ext.grid.RowNumberer=Ext.extend(Object,{header:"",width:23,sortable:false,constructor:function(a){Ext.apply(this,a);if(this.rowspan){this.renderer=this.renderer.createDelegate(this)}},fixed:true,hideable:false,menuDisabled:true,dataIndex:"",id:"numberer",rowspan:undefined,renderer:function(b,c,a,d){if(this.rowspan){c.cellAttr='rowspan="'+this.rowspan+'"'}return d+1}});Ext.grid.CheckboxSelectionModel=Ext.extend(Ext.grid.RowSelectionModel,{header:'
     
    ',width:20,sortable:false,menuDisabled:true,fixed:true,hideable:false,dataIndex:"",id:"checker",constructor:function(){Ext.grid.CheckboxSelectionModel.superclass.constructor.apply(this,arguments);if(this.checkOnly){this.handleMouseDown=Ext.emptyFn}},initEvents:function(){Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this);this.grid.on("render",function(){var a=this.grid.getView();a.mainBody.on("mousedown",this.onMouseDown,this);Ext.fly(a.innerHd).on("mousedown",this.onHdMouseDown,this)},this)},handleMouseDown:function(){Ext.grid.CheckboxSelectionModel.superclass.handleMouseDown.apply(this,arguments);this.mouseHandled=true},onMouseDown:function(c,b){if(c.button===0&&b.className=="x-grid3-row-checker"){c.stopEvent();var d=c.getTarget(".x-grid3-row");if(!this.mouseHandled&&d){var a=d.rowIndex;if(this.isSelected(a)){this.deselectRow(a)}else{this.selectRow(a,true)}}}this.mouseHandled=false},onHdMouseDown:function(c,a){if(a.className=="x-grid3-hd-checker"){c.stopEvent();var b=Ext.fly(a.parentNode);var d=b.hasClass("x-grid3-hd-checker-on");if(d){b.removeClass("x-grid3-hd-checker-on");this.clearSelections()}else{b.addClass("x-grid3-hd-checker-on");this.selectAll()}}},renderer:function(b,c,a){return'
     
    '}});Ext.grid.CellSelectionModel=Ext.extend(Ext.grid.AbstractSelectionModel,{constructor:function(a){Ext.apply(this,a);this.selection=null;this.addEvents("beforecellselect","cellselect","selectionchange");Ext.grid.CellSelectionModel.superclass.constructor.call(this)},initEvents:function(){this.grid.on("cellmousedown",this.handleMouseDown,this);this.grid.on(Ext.EventManager.useKeydown?"keydown":"keypress",this.handleKeyDown,this);this.grid.getView().on({scope:this,refresh:this.onViewChange,rowupdated:this.onRowUpdated,beforerowremoved:this.clearSelections,beforerowsinserted:this.clearSelections});if(this.grid.isEditor){this.grid.on("beforeedit",this.beforeEdit,this)}},beforeEdit:function(a){this.select(a.row,a.column,false,true,a.record)},onRowUpdated:function(a,b,c){if(this.selection&&this.selection.record==c){a.onCellSelect(b,this.selection.cell[1])}},onViewChange:function(){this.clearSelections(true)},getSelectedCell:function(){return this.selection?this.selection.cell:null},clearSelections:function(b){var a=this.selection;if(a){if(b!==true){this.grid.view.onCellDeselect(a.cell[0],a.cell[1])}this.selection=null;this.fireEvent("selectionchange",this,null)}},hasSelection:function(){return this.selection?true:false},handleMouseDown:function(b,d,a,c){if(c.button!==0||this.isLocked()){return}this.select(d,a)},select:function(g,c,b,e,d){if(this.fireEvent("beforecellselect",this,g,c)!==false){this.clearSelections();d=d||this.grid.store.getAt(g);this.selection={record:d,cell:[g,c]};if(!b){var a=this.grid.getView();a.onCellSelect(g,c);if(e!==true){a.focusCell(g,c)}}this.fireEvent("cellselect",this,g,c);this.fireEvent("selectionchange",this,this.selection)}},isSelectable:function(c,b,a){return !a.isHidden(b)},onEditorKey:function(b,a){if(a.getKey()==a.TAB){this.handleKeyDown(a)}},handleKeyDown:function(j){if(!j.isNavKeyPress()){return}var d=j.getKey(),i=this.grid,p=this.selection,b=this,m=function(g,c,e){return i.walkCells(g,c,e,i.isEditor&&i.editing?b.acceptsNav:b.isSelectable,b)},o,h,a,l,n;switch(d){case j.ESC:case j.PAGE_UP:case j.PAGE_DOWN:break;default:j.stopEvent();break}if(!p){o=m(0,0,1);if(o){this.select(o[0],o[1])}return}o=p.cell;a=o[0];l=o[1];switch(d){case j.TAB:if(j.shiftKey){h=m(a,l-1,-1)}else{h=m(a,l+1,1)}break;case j.DOWN:h=m(a+1,l,1);break;case j.UP:h=m(a-1,l,-1);break;case j.RIGHT:h=m(a,l+1,1);break;case j.LEFT:h=m(a,l-1,-1);break;case j.ENTER:if(i.isEditor&&!i.editing){i.startEditing(a,l);return}break}if(h){a=h[0];l=h[1];this.select(a,l);if(i.isEditor&&i.editing){n=i.activeEditor;if(n&&n.field.triggerBlur){n.field.triggerBlur()}i.startEditing(a,l)}}},acceptsNav:function(c,b,a){return !a.isHidden(b)&&a.isCellEditable(b,c)}});Ext.grid.EditorGridPanel=Ext.extend(Ext.grid.GridPanel,{clicksToEdit:2,forceValidation:false,isEditor:true,detectEdit:false,autoEncode:false,trackMouseOver:false,initComponent:function(){Ext.grid.EditorGridPanel.superclass.initComponent.call(this);if(!this.selModel){this.selModel=new Ext.grid.CellSelectionModel()}this.activeEditor=null;this.addEvents("beforeedit","afteredit","validateedit")},initEvents:function(){Ext.grid.EditorGridPanel.superclass.initEvents.call(this);this.getGridEl().on("mousewheel",this.stopEditing.createDelegate(this,[true]),this);this.on("columnresize",this.stopEditing,this,[true]);if(this.clicksToEdit==1){this.on("cellclick",this.onCellDblClick,this)}else{var a=this.getView();if(this.clicksToEdit=="auto"&&a.mainBody){a.mainBody.on("mousedown",this.onAutoEditClick,this)}this.on("celldblclick",this.onCellDblClick,this)}},onResize:function(){Ext.grid.EditorGridPanel.superclass.onResize.apply(this,arguments);var a=this.activeEditor;if(this.editing&&a){a.realign(true)}},onCellDblClick:function(b,c,a){this.startEditing(c,a)},onAutoEditClick:function(c,b){if(c.button!==0){return}var g=this.view.findRowIndex(b),a=this.view.findCellIndex(b);if(g!==false&&a!==false){this.stopEditing();if(this.selModel.getSelectedCell){var d=this.selModel.getSelectedCell();if(d&&d[0]===g&&d[1]===a){this.startEditing(g,a)}}else{if(this.selModel.isSelected(g)){this.startEditing(g,a)}}}},onEditComplete:function(b,d,a){this.editing=false;this.lastActiveEditor=this.activeEditor;this.activeEditor=null;var c=b.record,h=this.colModel.getDataIndex(b.col);d=this.postEditValue(d,a,c,h);if(this.forceValidation===true||String(d)!==String(a)){var g={grid:this,record:c,field:h,originalValue:a,value:d,row:b.row,column:b.col,cancel:false};if(this.fireEvent("validateedit",g)!==false&&!g.cancel&&String(d)!==String(a)){c.set(h,g.value);delete g.cancel;this.fireEvent("afteredit",g)}}this.view.focusCell(b.row,b.col)},startEditing:function(i,c){this.stopEditing();if(this.colModel.isCellEditable(c,i)){this.view.ensureVisible(i,c,true);var d=this.store.getAt(i),h=this.colModel.getDataIndex(c),g={grid:this,record:d,field:h,value:d.data[h],row:i,column:c,cancel:false};if(this.fireEvent("beforeedit",g)!==false&&!g.cancel){this.editing=true;var b=this.colModel.getCellEditor(c,i);if(!b){return}if(!b.rendered){b.parentEl=this.view.getEditorParent(b);b.on({scope:this,render:{fn:function(e){e.field.focus(false,true)},single:true,scope:this},specialkey:function(k,j){this.getSelectionModel().onEditorKey(k,j)},complete:this.onEditComplete,canceledit:this.stopEditing.createDelegate(this,[true])})}Ext.apply(b,{row:i,col:c,record:d});this.lastEdit={row:i,col:c};this.activeEditor=b;b.selectSameEditor=(this.activeEditor==this.lastActiveEditor);var a=this.preEditValue(d,h);b.startEdit(this.view.getCell(i,c).firstChild,Ext.isDefined(a)?a:"");(function(){delete b.selectSameEditor}).defer(50)}}},preEditValue:function(a,c){var b=a.data[c];return this.autoEncode&&Ext.isString(b)?Ext.util.Format.htmlDecode(b):b},postEditValue:function(c,a,b,d){return this.autoEncode&&Ext.isString(c)?Ext.util.Format.htmlEncode(c):c},stopEditing:function(b){if(this.editing){var a=this.lastActiveEditor=this.activeEditor;if(a){a[b===true?"cancelEdit":"completeEdit"]();this.view.focusCell(a.row,a.col)}this.activeEditor=null}this.editing=false}});Ext.reg("editorgrid",Ext.grid.EditorGridPanel);Ext.grid.GridEditor=function(b,a){Ext.grid.GridEditor.superclass.constructor.call(this,b,a);b.monitorTab=false};Ext.extend(Ext.grid.GridEditor,Ext.Editor,{alignment:"tl-tl",autoSize:"width",hideEl:false,cls:"x-small-editor x-grid-editor",shim:false,shadow:false});Ext.grid.PropertyRecord=Ext.data.Record.create([{name:"name",type:"string"},"value"]);Ext.grid.PropertyStore=Ext.extend(Ext.util.Observable,{constructor:function(a,b){this.grid=a;this.store=new Ext.data.Store({recordType:Ext.grid.PropertyRecord});this.store.on("update",this.onUpdate,this);if(b){this.setSource(b)}Ext.grid.PropertyStore.superclass.constructor.call(this)},setSource:function(c){this.source=c;this.store.removeAll();var b=[];for(var a in c){if(this.isEditableValue(c[a])){b.push(new Ext.grid.PropertyRecord({name:a,value:c[a]},a))}}this.store.loadRecords({records:b},{},true)},onUpdate:function(e,a,d){if(d==Ext.data.Record.EDIT){var b=a.data.value;var c=a.modified.value;if(this.grid.fireEvent("beforepropertychange",this.source,a.id,b,c)!==false){this.source[a.id]=b;a.commit();this.grid.fireEvent("propertychange",this.source,a.id,b,c)}else{a.reject()}}},getProperty:function(a){return this.store.getAt(a)},isEditableValue:function(a){return Ext.isPrimitive(a)||Ext.isDate(a)},setValue:function(d,c,a){var b=this.getRec(d);if(b){b.set("value",c);this.source[d]=c}else{if(a){this.source[d]=c;b=new Ext.grid.PropertyRecord({name:d,value:c},d);this.store.add(b)}}},remove:function(b){var a=this.getRec(b);if(a){this.store.remove(a);delete this.source[b]}},getRec:function(a){return this.store.getById(a)},getSource:function(){return this.source}});Ext.grid.PropertyColumnModel=Ext.extend(Ext.grid.ColumnModel,{nameText:"Name",valueText:"Value",dateFormat:"m/j/Y",trueText:"true",falseText:"false",constructor:function(c,b){var d=Ext.grid,e=Ext.form;this.grid=c;d.PropertyColumnModel.superclass.constructor.call(this,[{header:this.nameText,width:50,sortable:true,dataIndex:"name",id:"name",menuDisabled:true},{header:this.valueText,width:50,resizable:false,dataIndex:"value",id:"value",menuDisabled:true}]);this.store=b;var a=new e.Field({autoCreate:{tag:"select",children:[{tag:"option",value:"true",html:this.trueText},{tag:"option",value:"false",html:this.falseText}]},getValue:function(){return this.el.dom.value=="true"}});this.editors={date:new d.GridEditor(new e.DateField({selectOnFocus:true})),string:new d.GridEditor(new e.TextField({selectOnFocus:true})),number:new d.GridEditor(new e.NumberField({selectOnFocus:true,style:"text-align:left;"})),"boolean":new d.GridEditor(a,{autoSize:"both"})};this.renderCellDelegate=this.renderCell.createDelegate(this);this.renderPropDelegate=this.renderProp.createDelegate(this)},renderDate:function(a){return a.dateFormat(this.dateFormat)},renderBool:function(a){return this[a?"trueText":"falseText"]},isCellEditable:function(a,b){return a==1},getRenderer:function(a){return a==1?this.renderCellDelegate:this.renderPropDelegate},renderProp:function(a){return this.getPropertyName(a)},renderCell:function(d,b,c){var a=this.grid.customRenderers[c.get("name")];if(a){return a.apply(this,arguments)}var e=d;if(Ext.isDate(d)){e=this.renderDate(d)}else{if(typeof d=="boolean"){e=this.renderBool(d)}}return Ext.util.Format.htmlEncode(e)},getPropertyName:function(b){var a=this.grid.propertyNames;return a&&a[b]?a[b]:b},getCellEditor:function(a,e){var b=this.store.getProperty(e),d=b.data.name,c=b.data.value;if(this.grid.customEditors[d]){return this.grid.customEditors[d]}if(Ext.isDate(c)){return this.editors.date}else{if(typeof c=="number"){return this.editors.number}else{if(typeof c=="boolean"){return this.editors["boolean"]}else{return this.editors.string}}}},destroy:function(){Ext.grid.PropertyColumnModel.superclass.destroy.call(this);for(var a in this.editors){Ext.destroy(this.editors[a])}}});Ext.grid.PropertyGrid=Ext.extend(Ext.grid.EditorGridPanel,{enableColumnMove:false,stripeRows:false,trackMouseOver:false,clicksToEdit:1,enableHdMenu:false,viewConfig:{forceFit:true},initComponent:function(){this.customRenderers=this.customRenderers||{};this.customEditors=this.customEditors||{};this.lastEditRow=null;var b=new Ext.grid.PropertyStore(this);this.propStore=b;var a=new Ext.grid.PropertyColumnModel(this,b);b.store.sort("name","ASC");this.addEvents("beforepropertychange","propertychange");this.cm=a;this.ds=b.store;Ext.grid.PropertyGrid.superclass.initComponent.call(this);this.mon(this.selModel,"beforecellselect",function(e,d,c){if(c===0){this.startEditing.defer(200,this,[d,1]);return false}},this)},onRender:function(){Ext.grid.PropertyGrid.superclass.onRender.apply(this,arguments);this.getGridEl().addClass("x-props-grid")},afterRender:function(){Ext.grid.PropertyGrid.superclass.afterRender.apply(this,arguments);if(this.source){this.setSource(this.source)}},setSource:function(a){this.propStore.setSource(a)},getSource:function(){return this.propStore.getSource()},setProperty:function(c,b,a){this.propStore.setValue(c,b,a)},removeProperty:function(a){this.propStore.remove(a)}});Ext.reg("propertygrid",Ext.grid.PropertyGrid);Ext.grid.GroupingView=Ext.extend(Ext.grid.GridView,{groupByText:"Group By This Field",showGroupsText:"Show in Groups",hideGroupedColumn:false,showGroupName:true,startCollapsed:false,enableGrouping:true,enableGroupingMenu:true,enableNoGroups:true,emptyGroupText:"(None)",ignoreAdd:false,groupTextTpl:"{text}",groupMode:"value",initTemplates:function(){Ext.grid.GroupingView.superclass.initTemplates.call(this);this.state={};var a=this.grid.getSelectionModel();a.on(a.selectRow?"beforerowselect":"beforecellselect",this.onBeforeRowSelect,this);if(!this.startGroup){this.startGroup=new Ext.XTemplate('
    ','
    ',this.groupTextTpl,"
    ",'
    ')}this.startGroup.compile();if(!this.endGroup){this.endGroup="
    "}},findGroup:function(a){return Ext.fly(a).up(".x-grid-group",this.mainBody.dom)},getGroups:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},onAdd:function(d,a,b){if(this.canGroup()&&!this.ignoreAdd){var c=this.getScrollState();this.fireEvent("beforerowsinserted",d,b,b+(a.length-1));this.refresh();this.restoreScroll(c);this.fireEvent("rowsinserted",d,b,b+(a.length-1))}else{if(!this.canGroup()){Ext.grid.GroupingView.superclass.onAdd.apply(this,arguments)}}},onRemove:function(e,a,b,d){Ext.grid.GroupingView.superclass.onRemove.apply(this,arguments);var c=document.getElementById(a._groupId);if(c&&c.childNodes[1].childNodes.length<1){Ext.removeNode(c)}this.applyEmptyText()},refreshRow:function(a){if(this.ds.getCount()==1){this.refresh()}else{this.isUpdating=true;Ext.grid.GroupingView.superclass.refreshRow.apply(this,arguments);this.isUpdating=false}},beforeMenuShow:function(){var c,a=this.hmenu.items,b=this.cm.config[this.hdCtxIndex].groupable===false;if((c=a.get("groupBy"))){c.setDisabled(b)}if((c=a.get("showGroups"))){c.setDisabled(b);c.setChecked(this.enableGrouping,true)}},renderUI:function(){Ext.grid.GroupingView.superclass.renderUI.call(this);this.mainBody.on("mousedown",this.interceptMouse,this);if(this.enableGroupingMenu&&this.hmenu){this.hmenu.add("-",{itemId:"groupBy",text:this.groupByText,handler:this.onGroupByClick,scope:this,iconCls:"x-group-by-icon"});if(this.enableNoGroups){this.hmenu.add({itemId:"showGroups",text:this.showGroupsText,checked:true,checkHandler:this.onShowGroupsClick,scope:this})}this.hmenu.on("beforeshow",this.beforeMenuShow,this)}},processEvent:function(b,h){Ext.grid.GroupingView.superclass.processEvent.call(this,b,h);var g=h.getTarget(".x-grid-group-hd",this.mainBody);if(g){var d=this.getGroupField(),c=this.getPrefix(d),a=g.id.substring(c.length);a=a.substr(0,a.length-3);if(a){this.grid.fireEvent("group"+b,this.grid,d,a,h)}}},onGroupByClick:function(){this.enableGrouping=true;this.grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));this.grid.fireEvent("groupchange",this,this.grid.store.getGroupState());this.beforeMenuShow();this.refresh()},onShowGroupsClick:function(a,b){this.enableGrouping=b;if(b){this.onGroupByClick()}else{this.grid.store.clearGrouping();this.grid.fireEvent("groupchange",this,null)}},toggleRowIndex:function(c,a){if(!this.canGroup()){return}var b=this.getRow(c);if(b){this.toggleGroup(this.findGroup(b),a)}},toggleGroup:function(c,b){var a=Ext.get(c);b=Ext.isDefined(b)?b:a.hasClass("x-grid-group-collapsed");if(this.state[a.id]!==b){this.grid.stopEditing(true);this.state[a.id]=b;a[b?"removeClass":"addClass"]("x-grid-group-collapsed")}},toggleAllGroups:function(c){var b=this.getGroups();for(var d=0,a=b.length;d0){for(var ag=0;ag0){var af=c(Z);if(af){if(G(p[ag].swfVersion)&&!(N.wk&&N.wk<312)){x(Z,true);if(ac){ab.success=true;ab.ref=A(Z);ac(ab)}}else{if(p[ag].expressInstall&&B()){var aj={};aj.data=p[ag].expressInstall;aj.width=af.getAttribute("width")||"0";aj.height=af.getAttribute("height")||"0";if(af.getAttribute("class")){aj.styleclass=af.getAttribute("class")}if(af.getAttribute("align")){aj.align=af.getAttribute("align")}var ai={};var Y=af.getElementsByTagName("param");var ad=Y.length;for(var ae=0;ae'}}ab.outerHTML='"+ag+"";O[O.length]=aj.id;Y=c(aj.id)}else{var aa=D(s);aa.setAttribute("type",r);for(var ad in aj){if(aj[ad]!=Object.prototype[ad]){if(ad.toLowerCase()=="styleclass"){aa.setAttribute("class",aj[ad])}else{if(ad.toLowerCase()!="classid"){aa.setAttribute(ad,aj[ad])}}}}for(var ac in ah){if(ah[ac]!=Object.prototype[ac]&&ac.toLowerCase()!="movie"){e(aa,ac,ah[ac])}}ab.parentNode.replaceChild(aa,ab);Y=aa}}return Y}function e(aa,Y,Z){var ab=D("param");ab.setAttribute("name",Y);ab.setAttribute("value",Z);aa.appendChild(ab)}function z(Z){var Y=c(Z);if(Y&&Y.nodeName=="OBJECT"){if(N.ie&&N.win){Y.style.display="none";(function(){if(Y.readyState==4){b(Z)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.removeChild(Y)}}}function b(aa){var Z=c(aa);if(Z){for(var Y in Z){if(typeof Z[Y]=="function"){Z[Y]=null}}Z.parentNode.removeChild(Z)}}function c(aa){var Y=null;try{Y=k.getElementById(aa)}catch(Z){}return Y}function D(Y){return k.createElement(Y)}function j(aa,Y,Z){aa.attachEvent(Y,Z);J[J.length]=[aa,Y,Z]}function G(aa){var Z=N.pv,Y=aa.split(".");Y[0]=parseInt(Y[0],10);Y[1]=parseInt(Y[1],10)||0;Y[2]=parseInt(Y[2],10)||0;return(Z[0]>Y[0]||(Z[0]==Y[0]&&Z[1]>Y[1])||(Z[0]==Y[0]&&Z[1]==Y[1]&&Z[2]>=Y[2]))?true:false}function w(ad,Z,ae,ac){if(N.ie&&N.mac){return}var ab=k.getElementsByTagName("head")[0];if(!ab){return}var Y=(ae&&typeof ae=="string")?ae:"screen";if(ac){o=null;H=null}if(!o||H!=Y){var aa=D("style");aa.setAttribute("type","text/css");aa.setAttribute("media",Y);o=ab.appendChild(aa);if(N.ie&&N.win&&typeof k.styleSheets!=E&&k.styleSheets.length>0){o=k.styleSheets[k.styleSheets.length-1]}H=Y}if(N.ie&&N.win){if(o&&typeof o.addRule==s){o.addRule(ad,Z)}}else{if(o&&typeof k.createTextNode!=E){o.appendChild(k.createTextNode(ad+" {"+Z+"}"))}}}function x(aa,Y){if(!n){return}var Z=Y?"visible":"hidden";if(K&&c(aa)){c(aa).style.visibility=Z}else{w("#"+aa,"visibility:"+Z)}}function M(Z){var aa=/[\\\"<>\.;]/;var Y=aa.exec(Z)!=null;return Y&&typeof encodeURIComponent!=E?encodeURIComponent(Z):Z}var d=function(){if(N.ie&&N.win){window.attachEvent("onunload",function(){var ad=J.length;for(var ac=0;ac0){for(h=0;h-1&&e.position=="left"){e.position="bottom"}return e},onDestroy:function(){Ext.chart.CartesianChart.superclass.onDestroy.call(this);Ext.each(this.labelFn,function(a){this.removeFnProxy(a)},this)}});Ext.reg("cartesianchart",Ext.chart.CartesianChart);Ext.chart.LineChart=Ext.extend(Ext.chart.CartesianChart,{type:"line"});Ext.reg("linechart",Ext.chart.LineChart);Ext.chart.ColumnChart=Ext.extend(Ext.chart.CartesianChart,{type:"column"});Ext.reg("columnchart",Ext.chart.ColumnChart);Ext.chart.StackedColumnChart=Ext.extend(Ext.chart.CartesianChart,{type:"stackcolumn"});Ext.reg("stackedcolumnchart",Ext.chart.StackedColumnChart);Ext.chart.BarChart=Ext.extend(Ext.chart.CartesianChart,{type:"bar"});Ext.reg("barchart",Ext.chart.BarChart);Ext.chart.StackedBarChart=Ext.extend(Ext.chart.CartesianChart,{type:"stackbar"});Ext.reg("stackedbarchart",Ext.chart.StackedBarChart);Ext.chart.Axis=function(a){Ext.apply(this,a)};Ext.chart.Axis.prototype={type:null,orientation:"horizontal",reverse:false,labelFunction:null,hideOverlappingLabels:true,labelSpacing:2};Ext.chart.NumericAxis=Ext.extend(Ext.chart.Axis,{type:"numeric",minimum:NaN,maximum:NaN,majorUnit:NaN,minorUnit:NaN,snapToUnits:true,alwaysShowZero:true,scale:"linear",roundMajorUnit:true,calculateByLabelSize:true,position:"left",adjustMaximumByMajorUnit:true,adjustMinimumByMajorUnit:true});Ext.chart.TimeAxis=Ext.extend(Ext.chart.Axis,{type:"time",minimum:null,maximum:null,majorUnit:NaN,majorTimeUnit:null,minorUnit:NaN,minorTimeUnit:null,snapToUnits:true,stackingEnabled:false,calculateByLabelSize:true});Ext.chart.CategoryAxis=Ext.extend(Ext.chart.Axis,{type:"category",categoryNames:null,calculateCategoryCount:false});Ext.chart.Series=function(a){Ext.apply(this,a)};Ext.chart.Series.prototype={type:null,displayName:null};Ext.chart.CartesianSeries=Ext.extend(Ext.chart.Series,{xField:null,yField:null,showInLegend:true,axis:"primary"});Ext.chart.ColumnSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"column"});Ext.chart.LineSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"line"});Ext.chart.BarSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"bar"});Ext.chart.PieSeries=Ext.extend(Ext.chart.Series,{type:"pie",dataField:null,categoryField:null});Ext.menu.Menu=Ext.extend(Ext.Container,{minWidth:120,shadow:"sides",subMenuAlign:"tl-tr?",defaultAlign:"tl-bl?",allowOtherMenus:false,ignoreParentClicks:false,enableScrolling:true,maxHeight:null,scrollIncrement:24,showSeparator:true,defaultOffsets:[0,0],plain:false,floating:true,zIndex:15000,hidden:true,layout:"menu",hideMode:"offsets",scrollerHeight:8,autoLayout:true,defaultType:"menuitem",bufferResize:false,initComponent:function(){if(Ext.isArray(this.initialConfig)){Ext.apply(this,{items:this.initialConfig})}this.addEvents("click","mouseover","mouseout","itemclick");Ext.menu.MenuMgr.register(this);if(this.floating){Ext.EventManager.onWindowResize(this.hide,this)}else{if(this.initialConfig.hidden!==false){this.hidden=false}this.internalDefaults={hideOnClick:false}}Ext.menu.Menu.superclass.initComponent.call(this);if(this.autoLayout){var a=this.doLayout.createDelegate(this,[]);this.on({add:a,remove:a})}},getLayoutTarget:function(){return this.ul},onRender:function(b,a){if(!b){b=Ext.getBody()}var c={id:this.getId(),cls:"x-menu "+((this.floating)?"x-menu-floating x-layer ":"")+(this.cls||"")+(this.plain?" x-menu-plain":"")+(this.showSeparator?"":" x-menu-nosep"),style:this.style,cn:[{tag:"a",cls:"x-menu-focus",href:"#",onclick:"return false;",tabIndex:"-1"},{tag:"ul",cls:"x-menu-list"}]};if(this.floating){this.el=new Ext.Layer({shadow:this.shadow,dh:c,constrain:false,parentEl:b,zindex:this.zIndex})}else{this.el=b.createChild(c)}Ext.menu.Menu.superclass.onRender.call(this,b,a);if(!this.keyNav){this.keyNav=new Ext.menu.MenuNav(this)}this.focusEl=this.el.child("a.x-menu-focus");this.ul=this.el.child("ul.x-menu-list");this.mon(this.ul,{scope:this,click:this.onClick,mouseover:this.onMouseOver,mouseout:this.onMouseOut});if(this.enableScrolling){this.mon(this.el,{scope:this,delegate:".x-menu-scroller",click:this.onScroll,mouseover:this.deactivateActive})}},findTargetItem:function(b){var a=b.getTarget(".x-menu-list-item",this.ul,true);if(a&&a.menuItemId){return this.items.get(a.menuItemId)}},onClick:function(b){var a=this.findTargetItem(b);if(a){if(a.isFormField){this.setActiveItem(a)}else{if(a instanceof Ext.menu.BaseItem){if(a.menu&&this.ignoreParentClicks){a.expandMenu();b.preventDefault()}else{if(a.onClick){a.onClick(b);this.fireEvent("click",this,a,b)}}}}}},setActiveItem:function(a,b){if(a!=this.activeItem){this.deactivateActive();if((this.activeItem=a).isFormField){a.focus()}else{a.activate(b)}}else{if(b){a.expandMenu()}}},deactivateActive:function(){var b=this.activeItem;if(b){if(b.isFormField){if(b.collapse){b.collapse()}}else{b.deactivate()}delete this.activeItem}},tryActivate:function(g,e){var b=this.items;for(var c=g,a=b.length;c>=0&&c=a.scrollHeight){this.onScrollerOut(null,b)}},onScrollerIn:function(d,b){var a=this.ul.dom,c=Ext.fly(b).is(".x-menu-scroller-top");if(c?a.scrollTop>0:a.scrollTop+this.activeMaxc){b=c;a=i-h}else{if(bb&&b>0){this.activeMax=b-this.scrollerHeight*2-this.el.getFrameWidth("tb")-Ext.num(this.el.shadowOffset,0);this.ul.setHeight(this.activeMax);this.createScrollers();this.el.select(".x-menu-scroller").setDisplayed("")}else{this.ul.setHeight(d);this.el.select(".x-menu-scroller").setDisplayed("none")}this.ul.dom.scrollTop=0;return a},createScrollers:function(){if(!this.scroller){this.scroller={pos:0,top:this.el.insertFirst({tag:"div",cls:"x-menu-scroller x-menu-scroller-top",html:" "}),bottom:this.el.createChild({tag:"div",cls:"x-menu-scroller x-menu-scroller-bottom",html:" "})};this.scroller.top.hover(this.onScrollerIn,this.onScrollerOut,this);this.scroller.topRepeater=new Ext.util.ClickRepeater(this.scroller.top,{listeners:{click:this.onScroll.createDelegate(this,[null,this.scroller.top],false)}});this.scroller.bottom.hover(this.onScrollerIn,this.onScrollerOut,this);this.scroller.bottomRepeater=new Ext.util.ClickRepeater(this.scroller.bottom,{listeners:{click:this.onScroll.createDelegate(this,[null,this.scroller.bottom],false)}})}},onLayout:function(){if(this.isVisible()){if(this.enableScrolling){this.constrainScroll(this.el.getTop())}if(this.floating){this.el.sync()}}},focus:function(){if(!this.hidden){this.doFocus.defer(50,this)}},doFocus:function(){if(!this.hidden){this.focusEl.focus()}},hide:function(a){if(!this.isDestroyed){this.deepHide=a;Ext.menu.Menu.superclass.hide.call(this);delete this.deepHide}},onHide:function(){Ext.menu.Menu.superclass.onHide.call(this);this.deactivateActive();if(this.el&&this.floating){this.el.hide()}var a=this.parentMenu;if(this.deepHide===true&&a){if(a.floating){a.hide(true)}else{a.deactivateActive()}}},lookupComponent:function(a){if(Ext.isString(a)){a=(a=="separator"||a=="-")?new Ext.menu.Separator():new Ext.menu.TextItem(a);this.applyDefaults(a)}else{if(Ext.isObject(a)){a=this.getMenuItem(a)}else{if(a.tagName||a.el){a=new Ext.BoxComponent({el:a})}}}return a},applyDefaults:function(b){if(!Ext.isString(b)){b=Ext.menu.Menu.superclass.applyDefaults.call(this,b);var a=this.internalDefaults;if(a){if(b.events){Ext.applyIf(b.initialConfig,a);Ext.apply(b,a)}else{Ext.applyIf(b,a)}}}return b},getMenuItem:function(a){if(!a.isXType){if(!a.xtype&&Ext.isBoolean(a.checked)){return new Ext.menu.CheckItem(a)}return Ext.create(a,this.defaultType)}return a},addSeparator:function(){return this.add(new Ext.menu.Separator())},addElement:function(a){return this.add(new Ext.menu.BaseItem({el:a}))},addItem:function(a){return this.add(a)},addMenuItem:function(a){return this.add(this.getMenuItem(a))},addText:function(a){return this.add(new Ext.menu.TextItem(a))},onDestroy:function(){Ext.EventManager.removeResizeListener(this.hide,this);var a=this.parentMenu;if(a&&a.activeChild==this){delete a.activeChild}delete this.parentMenu;Ext.menu.Menu.superclass.onDestroy.call(this);Ext.menu.MenuMgr.unregister(this);if(this.keyNav){this.keyNav.disable()}var b=this.scroller;if(b){Ext.destroy(b.topRepeater,b.bottomRepeater,b.top,b.bottom)}Ext.destroy(this.el,this.focusEl,this.ul)}});Ext.reg("menu",Ext.menu.Menu);Ext.menu.MenuNav=Ext.extend(Ext.KeyNav,function(){function a(d,c){if(!c.tryActivate(c.items.indexOf(c.activeItem)-1,-1)){c.tryActivate(c.items.length-1,-1)}}function b(d,c){if(!c.tryActivate(c.items.indexOf(c.activeItem)+1,1)){c.tryActivate(0,1)}}return{constructor:function(c){Ext.menu.MenuNav.superclass.constructor.call(this,c.el);this.scope=this.menu=c},doRelay:function(g,d){var c=g.getKey();if(this.menu.activeItem&&this.menu.activeItem.isFormField&&c!=g.TAB){return false}if(!this.menu.activeItem&&g.isNavKeyPress()&&c!=g.SPACE&&c!=g.RETURN){this.menu.tryActivate(0,1);return false}return d.call(this.scope||this,g,this.menu)},tab:function(d,c){d.stopEvent();if(d.shiftKey){a(d,c)}else{b(d,c)}},up:a,down:b,right:function(d,c){if(c.activeItem){c.activeItem.expandMenu(true)}},left:function(d,c){c.hide();if(c.parentMenu&&c.parentMenu.activeItem){c.parentMenu.activeItem.activate()}},enter:function(d,c){if(c.activeItem){d.stopPropagation();c.activeItem.onClick(d);c.fireEvent("click",this,c.activeItem);return true}}}}());Ext.menu.MenuMgr=function(){var g,d,c={},a=false,l=new Date();function n(){g={};d=new Ext.util.MixedCollection();Ext.getDoc().addKeyListener(27,function(){if(d.length>0){i()}})}function i(){if(d&&d.length>0){var o=d.clone();o.each(function(p){p.hide()});return true}return false}function e(o){d.remove(o);if(d.length<1){Ext.getDoc().un("mousedown",m);a=false}}function k(o){var p=d.last();l=new Date();d.add(o);if(!a){Ext.getDoc().on("mousedown",m);a=true}if(o.parentMenu){o.getEl().setZIndex(parseInt(o.parentMenu.getEl().getStyle("z-index"),10)+3);o.parentMenu.activeChild=o}else{if(p&&!p.isDestroyed&&p.isVisible()){o.getEl().setZIndex(parseInt(p.getEl().getStyle("z-index"),10)+3)}}}function b(o){if(o.activeChild){o.activeChild.hide()}if(o.autoHideTimer){clearTimeout(o.autoHideTimer);delete o.autoHideTimer}}function h(o){var p=o.parentMenu;if(!p&&!o.allowOtherMenus){i()}else{if(p&&p.activeChild){p.activeChild.hide()}}}function m(o){if(l.getElapsed()>50&&d.length>0&&!o.getTarget(".x-menu")){i()}}function j(p,s){if(s){var r=c[p.group];for(var q=0,o=r.length;q',' target="{hrefTarget}"',"",">",'','{text}',"")}var c=this.getTemplateArgs();this.el=b?this.itemTpl.insertBefore(b,c,true):this.itemTpl.append(d,c,true);this.iconEl=this.el.child("img.x-menu-item-icon");this.textEl=this.el.child(".x-menu-item-text");if(!this.href){this.mon(this.el,"click",Ext.emptyFn,null,{preventDefault:true})}Ext.menu.Item.superclass.onRender.call(this,d,b)},getTemplateArgs:function(){return{id:this.id,cls:this.itemCls+(this.menu?" x-menu-item-arrow":"")+(this.cls?" "+this.cls:""),href:this.href||"#",hrefTarget:this.hrefTarget,icon:this.icon||Ext.BLANK_IMAGE_URL,iconCls:this.iconCls||"",text:this.itemText||this.text||" "}},setText:function(a){this.text=a||" ";if(this.rendered){this.textEl.update(this.text);this.parentMenu.layout.doAutoSize()}},setIconClass:function(a){var b=this.iconCls;this.iconCls=a;if(this.rendered){this.iconEl.replaceClass(b,this.iconCls)}},beforeDestroy:function(){if(this.menu){delete this.menu.ownerCt;this.menu.destroy()}Ext.menu.Item.superclass.beforeDestroy.call(this)},handleClick:function(a){if(!this.href){a.stopEvent()}Ext.menu.Item.superclass.handleClick.apply(this,arguments)},activate:function(a){if(Ext.menu.Item.superclass.activate.apply(this,arguments)){this.focus();if(a){this.expandMenu()}}return true},shouldDeactivate:function(a){if(Ext.menu.Item.superclass.shouldDeactivate.call(this,a)){if(this.menu&&this.menu.isVisible()){return !this.menu.getEl().getRegion().contains(a.getPoint())}return true}return false},deactivate:function(){Ext.menu.Item.superclass.deactivate.apply(this,arguments);this.hideMenu()},expandMenu:function(a){if(!this.disabled&&this.menu){clearTimeout(this.hideTimer);delete this.hideTimer;if(!this.menu.isVisible()&&!this.showTimer){this.showTimer=this.deferExpand.defer(this.showDelay,this,[a])}else{if(this.menu.isVisible()&&a){this.menu.tryActivate(0,1)}}}},deferExpand:function(a){delete this.showTimer;this.menu.show(this.container,this.parentMenu.subMenuAlign||"tl-tr?",this.parentMenu);if(a){this.menu.tryActivate(0,1)}},hideMenu:function(){clearTimeout(this.showTimer);delete this.showTimer;if(!this.hideTimer&&this.menu&&this.menu.isVisible()){this.hideTimer=this.deferHide.defer(this.hideDelay,this)}},deferHide:function(){delete this.hideTimer;if(this.menu.over){this.parentMenu.setActiveItem(this,false)}else{this.menu.hide()}}});Ext.reg("menuitem",Ext.menu.Item);Ext.menu.CheckItem=Ext.extend(Ext.menu.Item,{itemCls:"x-menu-item x-menu-check-item",groupClass:"x-menu-group-item",checked:false,ctype:"Ext.menu.CheckItem",initComponent:function(){Ext.menu.CheckItem.superclass.initComponent.call(this);this.addEvents("beforecheckchange","checkchange");if(this.checkHandler){this.on("checkchange",this.checkHandler,this.scope)}Ext.menu.MenuMgr.registerCheckable(this)},onRender:function(a){Ext.menu.CheckItem.superclass.onRender.apply(this,arguments);if(this.group){this.el.addClass(this.groupClass)}if(this.checked){this.checked=false;this.setChecked(true,true)}},destroy:function(){Ext.menu.MenuMgr.unregisterCheckable(this);Ext.menu.CheckItem.superclass.destroy.apply(this,arguments)},setChecked:function(b,a){var c=a===true;if(this.checked!=b&&(c||this.fireEvent("beforecheckchange",this,b)!==false)){if(this.container){this.container[b?"addClass":"removeClass"]("x-menu-item-checked")}this.checked=b;if(!c){this.fireEvent("checkchange",this,b)}}},handleClick:function(a){if(!this.disabled&&!(this.checked&&this.group)){this.setChecked(!this.checked)}Ext.menu.CheckItem.superclass.handleClick.apply(this,arguments)}});Ext.reg("menucheckitem",Ext.menu.CheckItem);Ext.menu.DateMenu=Ext.extend(Ext.menu.Menu,{enableScrolling:false,hideOnClick:true,pickerId:null,cls:"x-date-menu",initComponent:function(){this.on("beforeshow",this.onBeforeShow,this);if(this.strict=(Ext.isIE7&&Ext.isStrict)){this.on("show",this.onShow,this,{single:true,delay:20})}Ext.apply(this,{plain:true,showSeparator:false,items:this.picker=new Ext.DatePicker(Ext.applyIf({internalRender:this.strict||!Ext.isIE,ctCls:"x-menu-date-item",id:this.pickerId},this.initialConfig))});this.picker.purgeListeners();Ext.menu.DateMenu.superclass.initComponent.call(this);this.relayEvents(this.picker,["select"]);this.on("show",this.picker.focus,this.picker);this.on("select",this.menuHide,this);if(this.handler){this.on("select",this.handler,this.scope||this)}},menuHide:function(){if(this.hideOnClick){this.hide(true)}},onBeforeShow:function(){if(this.picker){this.picker.hideMonthPicker(true)}},onShow:function(){var a=this.picker.getEl();a.setWidth(a.getWidth())}});Ext.reg("datemenu",Ext.menu.DateMenu);Ext.menu.ColorMenu=Ext.extend(Ext.menu.Menu,{enableScrolling:false,hideOnClick:true,cls:"x-color-menu",paletteId:null,initComponent:function(){Ext.apply(this,{plain:true,showSeparator:false,items:this.palette=new Ext.ColorPalette(Ext.applyIf({id:this.paletteId},this.initialConfig))});this.palette.purgeListeners();Ext.menu.ColorMenu.superclass.initComponent.call(this);this.relayEvents(this.palette,["select"]);this.on("select",this.menuHide,this);if(this.handler){this.on("select",this.handler,this.scope||this)}},menuHide:function(){if(this.hideOnClick){this.hide(true)}}});Ext.reg("colormenu",Ext.menu.ColorMenu);Ext.form.Field=Ext.extend(Ext.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",msgTarget:"qtip",msgFx:"normal",readOnly:false,disabled:false,submitValue:true,isFormField:true,msgDisplay:"",hasFocus:false,initComponent:function(){Ext.form.Field.superclass.initComponent.call(this);this.addEvents("focus","blur","specialkey","change","invalid","valid")},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:this.name||this.id||""},onRender:function(c,a){if(!this.el){var b=this.getAutoCreate();if(!b.name){b.name=this.name||this.id}if(this.inputType){b.type=this.inputType}this.autoEl=b}Ext.form.Field.superclass.onRender.call(this,c,a);if(this.submitValue===false){this.el.dom.removeAttribute("name")}var d=this.el.dom.type;if(d){if(d=="password"){d="text"}this.el.addClass("x-form-"+d)}if(this.readOnly){this.setReadOnly(true)}if(this.tabIndex!==undefined){this.el.dom.setAttribute("tabIndex",this.tabIndex)}this.el.addClass([this.fieldClass,this.cls])},getItemCt:function(){return this.itemCt},initValue:function(){if(this.value!==undefined){this.setValue(this.value)}else{if(!Ext.isEmpty(this.el.dom.value)&&this.el.dom.value!=this.emptyText){this.setValue(this.el.dom.value)}}this.originalValue=this.getValue()},isDirty:function(){if(this.disabled||!this.rendered){return false}return String(this.getValue())!==String(this.originalValue)},setReadOnly:function(a){if(this.rendered){this.el.dom.readOnly=a}this.readOnly=a},afterRender:function(){Ext.form.Field.superclass.afterRender.call(this);this.initEvents();this.initValue()},fireKey:function(a){if(a.isSpecialKey()){this.fireEvent("specialkey",this,a)}},reset:function(){this.setValue(this.originalValue);this.clearInvalid()},initEvents:function(){this.mon(this.el,Ext.EventManager.useKeydown?"keydown":"keypress",this.fireKey,this);this.mon(this.el,"focus",this.onFocus,this);this.mon(this.el,"blur",this.onBlur,this,this.inEditor?{buffer:10}:null)},preFocus:Ext.emptyFn,onFocus:function(){this.preFocus();if(this.focusClass){this.el.addClass(this.focusClass)}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this)}},beforeBlur:Ext.emptyFn,onBlur:function(){this.beforeBlur();if(this.focusClass){this.el.removeClass(this.focusClass)}this.hasFocus=false;if(this.validationEvent!==false&&(this.validateOnBlur||this.validationEvent=="blur")){this.validate()}var a=this.getValue();if(String(a)!==String(this.startValue)){this.fireEvent("change",this,a,this.startValue)}this.fireEvent("blur",this);this.postBlur()},postBlur:Ext.emptyFn,isValid:function(a){if(this.disabled){return true}var c=this.preventMark;this.preventMark=a===true;var b=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=c;return b},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true}return false},processValue:function(a){return a},validateValue:function(b){var a=this.getErrors(b)[0];if(a==undefined){return true}else{this.markInvalid(a);return false}},getErrors:function(){return[]},getActiveError:function(){return this.activeError||""},markInvalid:function(c){if(this.rendered&&!this.preventMark){c=c||this.invalidText;var a=this.getMessageHandler();if(a){a.mark(this,c)}else{if(this.msgTarget){this.el.addClass(this.invalidClass);var b=Ext.getDom(this.msgTarget);if(b){b.innerHTML=c;b.style.display=this.msgDisplay}}}}this.setActiveError(c)},clearInvalid:function(){if(this.rendered&&!this.preventMark){this.el.removeClass(this.invalidClass);var a=this.getMessageHandler();if(a){a.clear(this)}else{if(this.msgTarget){this.el.removeClass(this.invalidClass);var b=Ext.getDom(this.msgTarget);if(b){b.innerHTML="";b.style.display="none"}}}}this.unsetActiveError()},setActiveError:function(b,a){this.activeError=b;if(a!==true){this.fireEvent("invalid",this,b)}},unsetActiveError:function(a){delete this.activeError;if(a!==true){this.fireEvent("valid",this)}},getMessageHandler:function(){return Ext.form.MessageTargets[this.msgTarget]},getErrorCt:function(){return this.el.findParent(".x-form-element",5,true)||this.el.findParent(".x-form-field-wrap",5,true)},alignErrorEl:function(){this.errorEl.setWidth(this.getErrorCt().getWidth(true)-20)},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,"tl-tr",[2,0])},getRawValue:function(){var a=this.rendered?this.el.getValue():Ext.value(this.value,"");if(a===this.emptyText){a=""}return a},getValue:function(){if(!this.rendered){return this.value}var a=this.el.getValue();if(a===this.emptyText||a===undefined){a=""}return a},setRawValue:function(a){return this.rendered?(this.el.dom.value=(Ext.isEmpty(a)?"":a)):""},setValue:function(a){this.value=a;if(this.rendered){this.el.dom.value=(Ext.isEmpty(a)?"":a);this.validate()}return this},append:function(a){this.setValue([this.getValue(),a].join(""))}});Ext.form.MessageTargets={qtip:{mark:function(a,b){a.el.addClass(a.invalidClass);a.el.dom.qtip=b;a.el.dom.qclass="x-form-invalid-tip";if(Ext.QuickTips){Ext.QuickTips.enable()}},clear:function(a){a.el.removeClass(a.invalidClass);a.el.dom.qtip=""}},title:{mark:function(a,b){a.el.addClass(a.invalidClass);a.el.dom.title=b},clear:function(a){a.el.dom.title=""}},under:{mark:function(b,c){b.el.addClass(b.invalidClass);if(!b.errorEl){var a=b.getErrorCt();if(!a){b.el.dom.title=c;return}b.errorEl=a.createChild({cls:"x-form-invalid-msg"});b.on("resize",b.alignErrorEl,b);b.on("destroy",function(){Ext.destroy(this.errorEl)},b)}b.alignErrorEl();b.errorEl.update(c);Ext.form.Field.msgFx[b.msgFx].show(b.errorEl,b)},clear:function(a){a.el.removeClass(a.invalidClass);if(a.errorEl){Ext.form.Field.msgFx[a.msgFx].hide(a.errorEl,a)}else{a.el.dom.title=""}}},side:{mark:function(b,c){b.el.addClass(b.invalidClass);if(!b.errorIcon){var a=b.getErrorCt();if(!a){b.el.dom.title=c;return}b.errorIcon=a.createChild({cls:"x-form-invalid-icon"});if(b.ownerCt){b.ownerCt.on("afterlayout",b.alignErrorIcon,b);b.ownerCt.on("expand",b.alignErrorIcon,b)}b.on("resize",b.alignErrorIcon,b);b.on("destroy",function(){Ext.destroy(this.errorIcon)},b)}b.alignErrorIcon();b.errorIcon.dom.qtip=c;b.errorIcon.dom.qclass="x-form-invalid-tip";b.errorIcon.show()},clear:function(a){a.el.removeClass(a.invalidClass);if(a.errorIcon){a.errorIcon.dom.qtip="";a.errorIcon.hide()}else{a.el.dom.title=""}}}};Ext.form.Field.msgFx={normal:{show:function(a,b){a.setDisplayed("block")},hide:function(a,b){a.setDisplayed(false).update("")}},slide:{show:function(a,b){a.slideIn("t",{stopFx:true})},hide:function(a,b){a.slideOut("t",{stopFx:true,useDisplay:true})}},slideRight:{show:function(a,b){a.fixDisplay();a.alignTo(b.el,"tl-tr");a.slideIn("l",{stopFx:true})},hide:function(a,b){a.slideOut("l",{stopFx:true,useDisplay:true})}}};Ext.reg("field",Ext.form.Field);Ext.form.TextField=Ext.extend(Ext.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,emptyClass:"x-form-empty-field",initComponent:function(){Ext.form.TextField.superclass.initComponent.call(this);this.addEvents("autosize","keydown","keyup","keypress")},initEvents:function(){Ext.form.TextField.superclass.initEvents.call(this);if(this.validationEvent=="keyup"){this.validationTask=new Ext.util.DelayedTask(this.validate,this);this.mon(this.el,"keyup",this.filterValidation,this)}else{if(this.validationEvent!==false&&this.validationEvent!="blur"){this.mon(this.el,this.validationEvent,this.validate,this,{buffer:this.validationDelay})}}if(this.selectOnFocus||this.emptyText){this.mon(this.el,"mousedown",this.onMouseDown,this);if(this.emptyText){this.applyEmptyText()}}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Ext.form.VTypes[this.vtype+"Mask"]))){this.mon(this.el,"keypress",this.filterKeys,this)}if(this.grow){this.mon(this.el,"keyup",this.onKeyUpBuffered,this,{buffer:50});this.mon(this.el,"click",this.autoSize,this)}if(this.enableKeyEvents){this.mon(this.el,{scope:this,keyup:this.onKeyUp,keydown:this.onKeyDown,keypress:this.onKeyPress})}},onMouseDown:function(a){if(!this.hasFocus){this.mon(this.el,"mouseup",Ext.emptyFn,this,{single:true,preventDefault:true})}},processValue:function(a){if(this.stripCharsRe){var b=a.replace(this.stripCharsRe,"");if(b!==a){this.setRawValue(b);return b}}return a},filterValidation:function(a){if(!a.isNavKeyPress()){this.validationTask.delay(this.validationDelay)}},onDisable:function(){Ext.form.TextField.superclass.onDisable.call(this);if(Ext.isIE){this.el.dom.unselectable="on"}},onEnable:function(){Ext.form.TextField.superclass.onEnable.call(this);if(Ext.isIE){this.el.dom.unselectable=""}},onKeyUpBuffered:function(a){if(this.doAutoSize(a)){this.autoSize()}},doAutoSize:function(a){return !a.isNavKeyPress()},onKeyUp:function(a){this.fireEvent("keyup",this,a)},onKeyDown:function(a){this.fireEvent("keydown",this,a)},onKeyPress:function(a){this.fireEvent("keypress",this,a)},reset:function(){Ext.form.TextField.superclass.reset.call(this);this.applyEmptyText()},applyEmptyText:function(){if(this.rendered&&this.emptyText&&this.getRawValue().length<1&&!this.hasFocus){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass)}},preFocus:function(){var a=this.el;if(this.emptyText){if(a.dom.value==this.emptyText){this.setRawValue("")}a.removeClass(this.emptyClass)}if(this.selectOnFocus){a.dom.select()}},postBlur:function(){this.applyEmptyText()},filterKeys:function(b){if(b.ctrlKey){return}var a=b.getKey();if(Ext.isGecko&&(b.isNavKeyPress()||a==b.BACKSPACE||(a==b.DELETE&&b.button==-1))){return}var c=String.fromCharCode(b.getCharCode());if(!Ext.isGecko&&b.isSpecialKey()&&!c){return}if(!this.maskRe.test(c)){b.stopEvent()}},setValue:function(a){if(this.emptyText&&this.el&&!Ext.isEmpty(a)){this.el.removeClass(this.emptyClass)}Ext.form.TextField.superclass.setValue.apply(this,arguments);this.applyEmptyText();this.autoSize();return this},getErrors:function(a){var d=Ext.form.TextField.superclass.getErrors.apply(this,arguments);a=a||this.processValue(this.getRawValue());if(Ext.isFunction(this.validator)){var c=this.validator(a);if(c!==true){d.push(c)}}if(a.length<1||a===this.emptyText){if(this.allowBlank){return d}else{d.push(this.blankText)}}if(!this.allowBlank&&(a.length<1||a===this.emptyText)){d.push(this.blankText)}if(a.lengththis.maxLength){d.push(String.format(this.maxLengthText,this.maxLength))}if(this.vtype){var b=Ext.form.VTypes;if(!b[this.vtype](a,this)){d.push(this.vtypeText||b[this.vtype+"Text"])}}if(this.regex&&!this.regex.test(a)){d.push(this.regexText)}return d},selectText:function(h,a){var c=this.getRawValue();var e=false;if(c.length>0){h=h===undefined?0:h;a=a===undefined?c.length:a;var g=this.el.dom;if(g.setSelectionRange){g.setSelectionRange(h,a)}else{if(g.createTextRange){var b=g.createTextRange();b.moveStart("character",h);b.moveEnd("character",a-c.length);b.select()}}e=Ext.isGecko||Ext.isOpera}else{e=true}if(e){this.focus()}},autoSize:function(){if(!this.grow||!this.rendered){return}if(!this.metrics){this.metrics=Ext.util.TextMetrics.createInstance(this.el)}var c=this.el;var b=c.dom.value;var e=document.createElement("div");e.appendChild(document.createTextNode(b));b=e.innerHTML;Ext.removeNode(e);e=null;b+=" ";var a=Math.min(this.growMax,Math.max(this.metrics.getWidth(b)+10,this.growMin));this.el.setWidth(a);this.fireEvent("autosize",this,a)},onDestroy:function(){if(this.validationTask){this.validationTask.cancel();this.validationTask=null}Ext.form.TextField.superclass.onDestroy.call(this)}});Ext.reg("textfield",Ext.form.TextField);Ext.form.TriggerField=Ext.extend(Ext.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},hideTrigger:false,editable:true,readOnly:false,wrapFocusClass:"x-trigger-wrap-focus",autoSize:Ext.emptyFn,monitorTab:true,deferHeight:true,mimicing:false,actionMode:"wrap",defaultTriggerWidth:17,onResize:function(a,c){Ext.form.TriggerField.superclass.onResize.call(this,a,c);var b=this.getTriggerWidth();if(Ext.isNumber(a)){this.el.setWidth(a-b)}this.wrap.setWidth(this.el.getWidth()+b)},getTriggerWidth:function(){var a=this.trigger.getWidth();if(!this.hideTrigger&&!this.readOnly&&a===0){a=this.defaultTriggerWidth}return a},alignErrorIcon:function(){if(this.wrap){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}},onRender:function(b,a){this.doc=Ext.isIE?Ext.getBody():Ext.getDoc();Ext.form.TriggerField.superclass.onRender.call(this,b,a);this.wrap=this.el.wrap({cls:"x-form-field-wrap x-form-field-trigger-wrap"});this.trigger=this.wrap.createChild(this.triggerConfig||{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});this.initTrigger();if(!this.width){this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())}this.resizeEl=this.positionEl=this.wrap},getWidth:function(){return(this.el.getWidth()+this.trigger.getWidth())},updateEditState:function(){if(this.rendered){if(this.readOnly){this.el.dom.readOnly=true;this.el.addClass("x-trigger-noedit");this.mun(this.el,"click",this.onTriggerClick,this);this.trigger.setDisplayed(false)}else{if(!this.editable){this.el.dom.readOnly=true;this.el.addClass("x-trigger-noedit");this.mon(this.el,"click",this.onTriggerClick,this)}else{this.el.dom.readOnly=false;this.el.removeClass("x-trigger-noedit");this.mun(this.el,"click",this.onTriggerClick,this)}this.trigger.setDisplayed(!this.hideTrigger)}this.onResize(this.width||this.wrap.getWidth())}},setHideTrigger:function(a){if(a!=this.hideTrigger){this.hideTrigger=a;this.updateEditState()}},setEditable:function(a){if(a!=this.editable){this.editable=a;this.updateEditState()}},setReadOnly:function(a){if(a!=this.readOnly){this.readOnly=a;this.updateEditState()}},afterRender:function(){Ext.form.TriggerField.superclass.afterRender.call(this);this.updateEditState()},initTrigger:function(){this.mon(this.trigger,"click",this.onTriggerClick,this,{preventDefault:true});this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},onDestroy:function(){Ext.destroy(this.trigger,this.wrap);if(this.mimicing){this.doc.un("mousedown",this.mimicBlur,this)}delete this.doc;Ext.form.TriggerField.superclass.onDestroy.call(this)},onFocus:function(){Ext.form.TriggerField.superclass.onFocus.call(this);if(!this.mimicing){this.wrap.addClass(this.wrapFocusClass);this.mimicing=true;this.doc.on("mousedown",this.mimicBlur,this,{delay:10});if(this.monitorTab){this.on("specialkey",this.checkTab,this)}}},checkTab:function(a,b){if(b.getKey()==b.TAB){this.triggerBlur()}},onBlur:Ext.emptyFn,mimicBlur:function(a){if(!this.isDestroyed&&!this.wrap.contains(a.target)&&this.validateBlur(a)){this.triggerBlur()}},triggerBlur:function(){this.mimicing=false;this.doc.un("mousedown",this.mimicBlur,this);if(this.monitorTab&&this.el){this.un("specialkey",this.checkTab,this)}Ext.form.TriggerField.superclass.onBlur.call(this);if(this.wrap){this.wrap.removeClass(this.wrapFocusClass)}},beforeBlur:Ext.emptyFn,validateBlur:function(a){return true},onTriggerClick:Ext.emptyFn});Ext.form.TwinTriggerField=Ext.extend(Ext.form.TriggerField,{initComponent:function(){Ext.form.TwinTriggerField.superclass.initComponent.call(this);this.triggerConfig={tag:"span",cls:"x-form-twin-triggers",cn:[{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger2Class}]}},getTrigger:function(a){return this.triggers[a]},initTrigger:function(){var a=this.trigger.select(".x-form-trigger",true);var b=this;a.each(function(d,g,c){var e="Trigger"+(c+1);d.hide=function(){var h=b.wrap.getWidth();this.dom.style.display="none";b.el.setWidth(h-b.trigger.getWidth());this["hidden"+e]=true};d.show=function(){var h=b.wrap.getWidth();this.dom.style.display="";b.el.setWidth(h-b.trigger.getWidth());this["hidden"+e]=false};if(this["hide"+e]){d.dom.style.display="none";this["hidden"+e]=true}this.mon(d,"click",this["on"+e+"Click"],this,{preventDefault:true});d.addClassOnOver("x-form-trigger-over");d.addClassOnClick("x-form-trigger-click")},this);this.triggers=a.elements},getTriggerWidth:function(){var a=0;Ext.each(this.triggers,function(d,c){var e="Trigger"+(c+1),b=d.getWidth();if(b===0&&!this["hidden"+e]){a+=this.defaultTriggerWidth}else{a+=b}},this);return a},onDestroy:function(){Ext.destroy(this.triggers);Ext.form.TwinTriggerField.superclass.onDestroy.call(this)},onTrigger1Click:Ext.emptyFn,onTrigger2Click:Ext.emptyFn});Ext.reg("trigger",Ext.form.TriggerField);Ext.form.TextArea=Ext.extend(Ext.form.TextField,{growMin:60,growMax:1000,growAppend:" \n ",enterIsSpecial:false,preventScrollbars:false,onRender:function(b,a){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:100px;height:60px;",autocomplete:"off"}}Ext.form.TextArea.superclass.onRender.call(this,b,a);if(this.grow){this.textSizeEl=Ext.DomHelper.append(document.body,{tag:"pre",cls:"x-form-grow-sizer"});if(this.preventScrollbars){this.el.setStyle("overflow","hidden")}this.el.setHeight(this.growMin)}},onDestroy:function(){Ext.removeNode(this.textSizeEl);Ext.form.TextArea.superclass.onDestroy.call(this)},fireKey:function(a){if(a.isSpecialKey()&&(this.enterIsSpecial||(a.getKey()!=a.ENTER||a.hasModifier()))){this.fireEvent("specialkey",this,a)}},doAutoSize:function(a){return !a.isNavKeyPress()||a.getKey()==a.ENTER},autoSize:function(){if(!this.grow||!this.textSizeEl){return}var c=this.el,a=Ext.util.Format.htmlEncode(c.dom.value),d=this.textSizeEl,b;Ext.fly(d).setWidth(this.el.getWidth());if(a.length<1){a="  "}else{a+=this.growAppend;if(Ext.isIE){a=a.replace(/\n/g," 
    ")}}d.innerHTML=a;b=Math.min(this.growMax,Math.max(d.offsetHeight,this.growMin));if(b!=this.lastHeight){this.lastHeight=b;this.el.setHeight(b);this.fireEvent("autosize",this,b)}}});Ext.reg("textarea",Ext.form.TextArea);Ext.form.NumberField=Ext.extend(Ext.form.TextField,{fieldClass:"x-form-field x-form-num-field",allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",baseChars:"0123456789",initEvents:function(){var a=this.baseChars+"";if(this.allowDecimals){a+=this.decimalSeparator}if(this.allowNegative){a+="-"}this.maskRe=new RegExp("["+Ext.escapeRe(a)+"]");Ext.form.NumberField.superclass.initEvents.call(this)},getErrors:function(b){var c=Ext.form.NumberField.superclass.getErrors.apply(this,arguments);b=b||this.processValue(this.getRawValue());if(b.length<1){return c}b=String(b).replace(this.decimalSeparator,".");if(isNaN(b)){c.push(String.format(this.nanText,b))}var a=this.parseValue(b);if(athis.maxValue){c.push(String.format(this.maxText,this.maxValue))}return c},getValue:function(){return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this)))},setValue:function(a){a=Ext.isNumber(a)?a:parseFloat(String(a).replace(this.decimalSeparator,"."));a=isNaN(a)?"":String(a).replace(".",this.decimalSeparator);return Ext.form.NumberField.superclass.setValue.call(this,a)},setMinValue:function(a){this.minValue=Ext.num(a,Number.NEGATIVE_INFINITY)},setMaxValue:function(a){this.maxValue=Ext.num(a,Number.MAX_VALUE)},parseValue:function(a){a=parseFloat(String(a).replace(this.decimalSeparator,"."));return isNaN(a)?"":a},fixPrecision:function(b){var a=isNaN(b);if(!this.allowDecimals||this.decimalPrecision==-1||a||!b){return a?"":b}return parseFloat(parseFloat(b).toFixed(this.decimalPrecision))},beforeBlur:function(){var a=this.parseValue(this.getRawValue());if(!Ext.isEmpty(a)){this.setValue(this.fixPrecision(a))}}});Ext.reg("numberfield",Ext.form.NumberField);Ext.form.DateField=Ext.extend(Ext.form.TriggerField,{format:"m/d/Y",altFormats:"m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d",disabledDaysText:"Disabled",disabledDatesText:"Disabled",minText:"The date in this field must be equal to or after {0}",maxText:"The date in this field must be equal to or before {0}",invalidText:"{0} is not a valid date - it must be in the format {1}",triggerClass:"x-form-date-trigger",showToday:true,defaultAutoCreate:{tag:"input",type:"text",size:"10",autocomplete:"off"},initTime:"12",initTimeFormat:"H",safeParse:function(b,c){if(/[gGhH]/.test(c.replace(/(\\.)/g,""))){return Date.parseDate(b,c)}else{var a=Date.parseDate(b+" "+this.initTime,c+" "+this.initTimeFormat);if(a){return a.clearTime()}}},initComponent:function(){Ext.form.DateField.superclass.initComponent.call(this);this.addEvents("select");if(Ext.isString(this.minValue)){this.minValue=this.parseDate(this.minValue)}if(Ext.isString(this.maxValue)){this.maxValue=this.parseDate(this.maxValue)}this.disabledDatesRE=null;this.initDisabledDays()},initEvents:function(){Ext.form.DateField.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{down:function(a){this.onTriggerClick()},scope:this,forceKeyDown:true})},initDisabledDays:function(){if(this.disabledDates){var b=this.disabledDates,a=b.length-1,c="(?:";Ext.each(b,function(g,e){c+=Ext.isDate(g)?"^"+Ext.escapeRe(g.dateFormat(this.format))+"$":b[e];if(e!=a){c+="|"}},this);this.disabledDatesRE=new RegExp(c+")")}},setDisabledDates:function(a){this.disabledDates=a;this.initDisabledDays();if(this.menu){this.menu.picker.setDisabledDates(this.disabledDatesRE)}},setDisabledDays:function(a){this.disabledDays=a;if(this.menu){this.menu.picker.setDisabledDays(a)}},setMinValue:function(a){this.minValue=(Ext.isString(a)?this.parseDate(a):a);if(this.menu){this.menu.picker.setMinDate(this.minValue)}},setMaxValue:function(a){this.maxValue=(Ext.isString(a)?this.parseDate(a):a);if(this.menu){this.menu.picker.setMaxDate(this.maxValue)}},getErrors:function(e){var h=Ext.form.DateField.superclass.getErrors.apply(this,arguments);e=this.formatDate(e||this.processValue(this.getRawValue()));if(e.length<1){return h}var c=e;e=this.parseDate(e);if(!e){h.push(String.format(this.invalidText,c,this.format));return h}var g=e.getTime();if(this.minValue&&gthis.maxValue.getTime()){h.push(String.format(this.maxText,this.formatDate(this.maxValue)))}if(this.disabledDays){var a=e.getDay();for(var b=0;b
    {'+this.displayField+"}
    "}this.view=new Ext.DataView({applyTo:this.innerList,tpl:this.tpl,singleSelect:true,selectedClass:this.selectedClass,itemSelector:this.itemSelector||"."+a+"-item",emptyText:this.listEmptyText,deferEmptyText:false});this.mon(this.view,{containerclick:this.onViewClick,click:this.onViewClick,scope:this});this.bindStore(this.store,true);if(this.resizable){this.resizer=new Ext.Resizable(this.list,{pinned:true,handles:"se"});this.mon(this.resizer,"resize",function(i,e,g){this.maxHeight=g-this.handleHeight-this.list.getFrameWidth("tb")-this.assetHeight;this.listWidth=e;this.innerList.setWidth(e-this.list.getFrameWidth("lr"));this.restrictHeight()},this);this[this.pageSize?"footer":"innerList"].setStyle("margin-bottom",this.handleHeight+"px")}}},getListParent:function(){return document.body},getStore:function(){return this.store},bindStore:function(a,b){if(this.store&&!b){if(this.store!==a&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.collapse,this)}if(!a){this.store=null;if(this.view){this.view.bindStore(null)}if(this.pageTb){this.pageTb.bindStore(null)}}}if(a){if(!b){this.lastQuery=null;if(this.pageTb){this.pageTb.bindStore(a)}}this.store=Ext.StoreMgr.lookup(a);this.store.on({scope:this,beforeload:this.onBeforeLoad,load:this.onLoad,exception:this.collapse});if(this.view){this.view.bindStore(a)}}},reset:function(){Ext.form.ComboBox.superclass.reset.call(this);if(this.clearFilterOnReset&&this.mode=="local"){this.store.clearFilter()}},initEvents:function(){Ext.form.ComboBox.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{up:function(a){this.inKeyMode=true;this.selectPrev()},down:function(a){if(!this.isExpanded()){this.onTriggerClick()}else{this.inKeyMode=true;this.selectNext()}},enter:function(a){this.onViewClick()},esc:function(a){this.collapse()},tab:function(a){if(this.forceSelection===true){this.collapse()}else{this.onViewClick(false)}return true},scope:this,doRelay:function(c,b,a){if(a=="down"||this.scope.isExpanded()){var d=Ext.KeyNav.prototype.doRelay.apply(this,arguments);if(!Ext.isIE&&Ext.EventManager.useKeydown){this.scope.fireKey(c)}return d}return true},forceKeyDown:true,defaultEventAction:"stopEvent"});this.queryDelay=Math.max(this.queryDelay||10,this.mode=="local"?10:250);this.dqTask=new Ext.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Ext.util.DelayedTask(this.onTypeAhead,this)}if(!this.enableKeyEvents){this.mon(this.el,"keyup",this.onKeyUp,this)}},onDestroy:function(){if(this.dqTask){this.dqTask.cancel();this.dqTask=null}this.bindStore(null);Ext.destroy(this.resizer,this.view,this.pageTb,this.list);Ext.destroyMembers(this,"hiddenField");Ext.form.ComboBox.superclass.onDestroy.call(this)},fireKey:function(a){if(!this.isExpanded()){Ext.form.ComboBox.superclass.fireKey.call(this,a)}},onResize:function(a,b){Ext.form.ComboBox.superclass.onResize.apply(this,arguments);if(!isNaN(a)&&this.isVisible()&&this.list){this.doResize(a)}else{this.bufferSize=a}},doResize:function(a){if(!Ext.isDefined(this.listWidth)){var b=Math.max(a,this.minListWidth);this.list.setWidth(b);this.innerList.setWidth(b-this.list.getFrameWidth("lr"))}},onEnable:function(){Ext.form.ComboBox.superclass.onEnable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=false}},onDisable:function(){Ext.form.ComboBox.superclass.onDisable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=true}},onBeforeLoad:function(){if(!this.hasFocus){return}this.innerList.update(this.loadingText?'
    '+this.loadingText+"
    ":"");this.restrictHeight();this.selectedIndex=-1},onLoad:function(){if(!this.hasFocus){return}if(this.store.getCount()>0||this.listEmptyText){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable){this.el.dom.select()}if(this.autoSelect!==false&&!this.selectByValue(this.value,true)){this.select(0,true)}}else{if(this.autoSelect!==false){this.selectNext()}if(this.typeAhead&&this.lastKey!=Ext.EventObject.BACKSPACE&&this.lastKey!=Ext.EventObject.DELETE){this.taTask.delay(this.typeAheadDelay)}}}else{this.collapse()}},onTypeAhead:function(){if(this.store.getCount()>0){var b=this.store.getAt(0);var c=b.data[this.displayField];var a=c.length;var d=this.getRawValue().length;if(d!=a){this.setRawValue(c);this.selectText(d,c.length)}}},assertValue:function(){var b=this.getRawValue(),a=this.findRecord(this.displayField,b);if(!a&&this.forceSelection){if(b.length>0&&b!=this.emptyText){this.el.dom.value=Ext.value(this.lastSelectionText,"");this.applyEmptyText()}else{this.clearValue()}}else{if(a){if(b==a.get(this.displayField)&&this.value==a.get(this.valueField)){return}b=a.get(this.valueField||this.displayField)}this.setValue(b)}},onSelect:function(a,b){if(this.fireEvent("beforeselect",this,a,b)!==false){this.setValue(a.data[this.valueField||this.displayField]);this.collapse();this.fireEvent("select",this,a,b)}},getName:function(){var a=this.hiddenField;return a&&a.name?a.name:this.hiddenName||Ext.form.ComboBox.superclass.getName.call(this)},getValue:function(){if(this.valueField){return Ext.isDefined(this.value)?this.value:""}else{return Ext.form.ComboBox.superclass.getValue.call(this)}},clearValue:function(){if(this.hiddenField){this.hiddenField.value=""}this.setRawValue("");this.lastSelectionText="";this.applyEmptyText();this.value=""},setValue:function(a){var c=a;if(this.valueField){var b=this.findRecord(this.valueField,a);if(b){c=b.data[this.displayField]}else{if(Ext.isDefined(this.valueNotFoundText)){c=this.valueNotFoundText}}}this.lastSelectionText=c;if(this.hiddenField){this.hiddenField.value=Ext.value(a,"")}Ext.form.ComboBox.superclass.setValue.call(this,c);this.value=a;return this},findRecord:function(c,b){var a;if(this.store.getCount()>0){this.store.each(function(d){if(d.data[c]==b){a=d;return false}})}return a},onViewMove:function(b,a){this.inKeyMode=false},onViewOver:function(d,b){if(this.inKeyMode){return}var c=this.view.findItemFromChild(b);if(c){var a=this.view.indexOf(c);this.select(a,false)}},onViewClick:function(b){var a=this.view.getSelectedIndexes()[0],c=this.store,d=c.getAt(a);if(d){this.onSelect(d,a)}else{this.collapse()}if(b!==false){this.el.focus()}},restrictHeight:function(){this.innerList.dom.style.height="";var b=this.innerList.dom,e=this.list.getFrameWidth("tb")+(this.resizable?this.handleHeight:0)+this.assetHeight,c=Math.max(b.clientHeight,b.offsetHeight,b.scrollHeight),a=this.getPosition()[1]-Ext.getBody().getScroll().top,g=Ext.lib.Dom.getViewHeight()-a-this.getSize().height,d=Math.max(a,g,this.minHeight||0)-this.list.shadowOffset-e-5;c=Math.min(c,d,this.maxHeight);this.innerList.setHeight(c);this.list.beginUpdate();this.list.setHeight(c+e);this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));this.list.endUpdate()},isExpanded:function(){return this.list&&this.list.isVisible()},selectByValue:function(a,c){if(!Ext.isEmpty(a,true)){var b=this.findRecord(this.valueField||this.displayField,a);if(b){this.select(this.store.indexOf(b),c);return true}}return false},select:function(a,c){this.selectedIndex=a;this.view.select(a);if(c!==false){var b=this.view.getNode(a);if(b){this.innerList.scrollChildIntoView(b,false)}}},selectNext:function(){var a=this.store.getCount();if(a>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex!==0){this.select(this.selectedIndex-1)}}}},onKeyUp:function(b){var a=b.getKey();if(this.editable!==false&&this.readOnly!==true&&(a==b.BACKSPACE||!b.isSpecialKey())){this.lastKey=a;this.dqTask.delay(this.queryDelay)}Ext.form.ComboBox.superclass.onKeyUp.call(this,b)},validateBlur:function(){return !this.list||!this.list.isVisible()},initQuery:function(){this.doQuery(this.getRawValue())},beforeBlur:function(){this.assertValue()},postBlur:function(){Ext.form.ComboBox.superclass.postBlur.call(this);this.collapse();this.inKeyMode=false},doQuery:function(c,b){c=Ext.isEmpty(c)?"":c;var a={query:c,forceAll:b,combo:this,cancel:false};if(this.fireEvent("beforequery",a)===false||a.cancel){return false}c=a.query;b=a.forceAll;if(b===true||(c.length>=this.minChars)){if(this.lastQuery!==c){this.lastQuery=c;if(this.mode=="local"){this.selectedIndex=-1;if(b){this.store.clearFilter()}else{this.store.filter(this.displayField,c)}this.onLoad()}else{this.store.baseParams[this.queryParam]=c;this.store.load({params:this.getParams(c)});this.expand()}}else{this.selectedIndex=-1;this.onLoad()}}},getParams:function(a){var b={};if(this.pageSize){b.start=0;b.limit=this.pageSize}return b},collapse:function(){if(!this.isExpanded()){return}this.list.hide();Ext.getDoc().un("mousewheel",this.collapseIf,this);Ext.getDoc().un("mousedown",this.collapseIf,this);this.fireEvent("collapse",this)},collapseIf:function(a){if(!this.isDestroyed&&!a.within(this.wrap)&&!a.within(this.list)){this.collapse()}},expand:function(){if(this.isExpanded()||!this.hasFocus){return}if(this.title||this.pageSize){this.assetHeight=0;if(this.title){this.assetHeight+=this.header.getHeight()}if(this.pageSize){this.assetHeight+=this.footer.getHeight()}}if(this.bufferSize){this.doResize(this.bufferSize);delete this.bufferSize}this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));var b=Ext.getDom(this.getListParent()||Ext.getBody()),a=parseInt(Ext.fly(b).getStyle("z-index"),10);if(!a){a=this.getParentZIndex()}if(a){this.list.setZIndex(a+5)}this.list.show();if(Ext.isGecko2){this.innerList.setOverflow("auto")}this.mon(Ext.getDoc(),{scope:this,mousewheel:this.collapseIf,mousedown:this.collapseIf});this.fireEvent("expand",this)},onTriggerClick:function(){if(this.readOnly||this.disabled){return}if(this.isExpanded()){this.collapse();this.el.focus()}else{this.onFocus({});if(this.triggerAction=="all"){this.doQuery(this.allQuery,true)}else{this.doQuery(this.getRawValue())}this.el.focus()}}});Ext.reg("combo",Ext.form.ComboBox);Ext.form.Checkbox=Ext.extend(Ext.form.Field,{focusClass:undefined,fieldClass:"x-form-field",checked:false,boxLabel:" ",defaultAutoCreate:{tag:"input",type:"checkbox",autocomplete:"off"},actionMode:"wrap",initComponent:function(){Ext.form.Checkbox.superclass.initComponent.call(this);this.addEvents("check")},onResize:function(){Ext.form.Checkbox.superclass.onResize.apply(this,arguments);if(!this.boxLabel&&!this.fieldLabel){this.el.alignTo(this.wrap,"c-c")}},initEvents:function(){Ext.form.Checkbox.superclass.initEvents.call(this);this.mon(this.el,{scope:this,click:this.onClick,change:this.onClick})},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,onRender:function(b,a){Ext.form.Checkbox.superclass.onRender.call(this,b,a);if(this.inputValue!==undefined){this.el.dom.value=this.inputValue}this.wrap=this.el.wrap({cls:"x-form-check-wrap"});if(this.boxLabel){this.wrap.createChild({tag:"label",htmlFor:this.el.id,cls:"x-form-cb-label",html:this.boxLabel})}if(this.checked){this.setValue(true)}else{this.checked=this.el.dom.checked}if(Ext.isIE){this.wrap.repaint()}this.resizeEl=this.positionEl=this.wrap},onDestroy:function(){Ext.destroy(this.wrap);Ext.form.Checkbox.superclass.onDestroy.call(this)},initValue:function(){this.originalValue=this.getValue()},getValue:function(){if(this.rendered){return this.el.dom.checked}return this.checked},onClick:function(){if(this.el.dom.checked!=this.checked){this.setValue(this.el.dom.checked)}},setValue:function(a){var b=this.checked;this.checked=(a===true||a==="true"||a=="1"||String(a).toLowerCase()=="on");if(this.rendered){this.el.dom.checked=this.checked;this.el.dom.defaultChecked=this.checked}if(b!=this.checked){this.fireEvent("check",this,this.checked);if(this.handler){this.handler.call(this.scope||this,this,this.checked)}}return this}});Ext.reg("checkbox",Ext.form.Checkbox);Ext.form.CheckboxGroup=Ext.extend(Ext.form.Field,{columns:"auto",vertical:false,allowBlank:true,blankText:"You must select at least one item in this group",defaultType:"checkbox",groupCls:"x-form-check-group",initComponent:function(){this.addEvents("change");this.on("change",this.validate,this);Ext.form.CheckboxGroup.superclass.initComponent.call(this)},onRender:function(j,g){if(!this.el){var p={autoEl:{id:this.id},cls:this.groupCls,layout:"column",renderTo:j,bufferResize:false};var a={xtype:"container",defaultType:this.defaultType,layout:"form",defaults:{hideLabel:true,anchor:"100%"}};if(this.items[0].items){Ext.apply(p,{layoutConfig:{columns:this.items.length},defaults:this.defaults,items:this.items});for(var e=0,m=this.items.length;e0&&e%r==0){o++}if(this.items[e].fieldLabel){this.items[e].hideLabel=false}n[o].items.push(this.items[e])}}else{for(var e=0,m=this.items.length;e-1){b.setValue(true)}})},getBox:function(b){var a=null;this.eachItem(function(c){if(b==c||c.dataIndex==b||c.id==b||c.getName()==b){a=c;return false}});return a},getValue:function(){var a=[];this.eachItem(function(b){if(b.checked){a.push(b)}});return a},eachItem:function(b,a){if(this.items&&this.items.each){this.items.each(b,a||this)}},getRawValue:Ext.emptyFn,setRawValue:Ext.emptyFn});Ext.reg("checkboxgroup",Ext.form.CheckboxGroup);Ext.form.CompositeField=Ext.extend(Ext.form.Field,{defaultMargins:"0 5 0 0",skipLastItemMargin:true,isComposite:true,combineErrors:true,initComponent:function(){var e=[],a=this.items,d;for(var c=0,b=a.length;c")},sortErrors:function(){var a=this.items;this.fieldErrors.sort("ASC",function(g,d){var c=function(b){return function(i){return i.getName()==b}};var h=a.findIndexBy(c(g.field)),e=a.findIndexBy(c(d.field));return h1){var a=this.getBox(c);if(a){a.setValue(b);if(a.checked){this.eachItem(function(d){if(d!==a){d.setValue(false)}})}}}else{this.setValueForItem(c)}},setValueForItem:function(a){a=String(a).split(",")[0];this.eachItem(function(b){b.setValue(a==b.inputValue)})},fireChecked:function(){if(!this.checkTask){this.checkTask=new Ext.util.DelayedTask(this.bufferChecked,this)}this.checkTask.delay(10)},bufferChecked:function(){var a=null;this.eachItem(function(b){if(b.checked){a=b;return false}});this.fireEvent("change",this,a)},onDestroy:function(){if(this.checkTask){this.checkTask.cancel();this.checkTask=null}Ext.form.RadioGroup.superclass.onDestroy.call(this)}});Ext.reg("radiogroup",Ext.form.RadioGroup);Ext.form.Hidden=Ext.extend(Ext.form.Field,{inputType:"hidden",onRender:function(){Ext.form.Hidden.superclass.onRender.apply(this,arguments)},initEvents:function(){this.originalValue=this.getValue()},setSize:Ext.emptyFn,setWidth:Ext.emptyFn,setHeight:Ext.emptyFn,setPosition:Ext.emptyFn,setPagePosition:Ext.emptyFn,markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn});Ext.reg("hidden",Ext.form.Hidden);Ext.form.BasicForm=Ext.extend(Ext.util.Observable,{constructor:function(b,a){Ext.apply(this,a);if(Ext.isString(this.paramOrder)){this.paramOrder=this.paramOrder.split(/[\s,|]/)}this.items=new Ext.util.MixedCollection(false,function(c){return c.getItemId()});this.addEvents("beforeaction","actionfailed","actioncomplete");if(b){this.initEl(b)}Ext.form.BasicForm.superclass.constructor.call(this)},timeout:30,paramOrder:undefined,paramsAsHash:false,waitTitle:"Please Wait...",activeAction:null,trackResetOnLoad:false,initEl:function(a){this.el=Ext.get(a);this.id=this.el.id||Ext.id();if(!this.standardSubmit){this.el.on("submit",this.onSubmit,this)}this.el.addClass("x-form")},getEl:function(){return this.el},onSubmit:function(a){a.stopEvent()},destroy:function(a){if(a!==true){this.items.each(function(b){Ext.destroy(b)});Ext.destroy(this.el)}this.items.clear();this.purgeListeners()},isValid:function(){var a=true;this.items.each(function(b){if(!b.validate()){a=false}});return a},isDirty:function(){var a=false;this.items.each(function(b){if(b.isDirty()){a=true;return false}});return a},doAction:function(b,a){if(Ext.isString(b)){b=new Ext.form.Action.ACTION_TYPES[b](this,a)}if(this.fireEvent("beforeaction",this,b)!==false){this.beforeAction(b);b.run.defer(100,b)}return this},submit:function(b){b=b||{};if(this.standardSubmit){var a=b.clientValidation===false||this.isValid();if(a){var c=this.el.dom;if(this.url&&Ext.isEmpty(c.action)){c.action=this.url}c.submit()}return a}var d=String.format("{0}submit",this.api?"direct":"");this.doAction(d,b);return this},load:function(a){var b=String.format("{0}load",this.api?"direct":"");this.doAction(b,a);return this},updateRecord:function(b){b.beginEdit();var a=b.fields;a.each(function(c){var d=this.findField(c.name);if(d){b.set(c.name,d.getValue())}},this);b.endEdit();return this},loadRecord:function(a){this.setValues(a.data);return this},beforeAction:function(a){this.items.each(function(c){if(c.isFormField&&c.syncValue){c.syncValue()}});var b=a.options;if(b.waitMsg){if(this.waitMsgTarget===true){this.el.mask(b.waitMsg,"x-mask-loading")}else{if(this.waitMsgTarget){this.waitMsgTarget=Ext.get(this.waitMsgTarget);this.waitMsgTarget.mask(b.waitMsg,"x-mask-loading")}else{Ext.MessageBox.wait(b.waitMsg,b.waitTitle||this.waitTitle)}}}},afterAction:function(a,c){this.activeAction=null;var b=a.options;if(b.waitMsg){if(this.waitMsgTarget===true){this.el.unmask()}else{if(this.waitMsgTarget){this.waitMsgTarget.unmask()}else{Ext.MessageBox.updateProgress(1);Ext.MessageBox.hide()}}}if(c){if(b.reset){this.reset()}Ext.callback(b.success,b.scope,[this,a]);this.fireEvent("actioncomplete",this,a)}else{Ext.callback(b.failure,b.scope,[this,a]);this.fireEvent("actionfailed",this,a)}},findField:function(c){var b=this.items.get(c);if(!Ext.isObject(b)){var a=function(d){if(d.isFormField){if(d.dataIndex==c||d.id==c||d.getName()==c){b=d;return false}else{if(d.isComposite&&d.rendered){return d.items.each(a)}}}};this.items.each(a)}return b||null},markInvalid:function(h){if(Ext.isArray(h)){for(var c=0,a=h.length;c':">"),c,"")}return d.join("")},createToolbar:function(e){var c=[];var a=Ext.QuickTips&&Ext.QuickTips.isEnabled();function d(j,h,i){return{itemId:j,cls:"x-btn-icon",iconCls:"x-edit-"+j,enableToggle:h!==false,scope:e,handler:i||e.relayBtnCmd,clickEvent:"mousedown",tooltip:a?e.buttonTips[j]||undefined:undefined,overflowText:e.buttonTips[j].title||undefined,tabIndex:-1}}if(this.enableFont&&!Ext.isSafari2){var g=new Ext.Toolbar.Item({autoEl:{tag:"select",cls:"x-font-select",html:this.createFontOptions()}});c.push(g,"-")}if(this.enableFormat){c.push(d("bold"),d("italic"),d("underline"))}if(this.enableFontSize){c.push("-",d("increasefontsize",false,this.adjustFont),d("decreasefontsize",false,this.adjustFont))}if(this.enableColors){c.push("-",{itemId:"forecolor",cls:"x-btn-icon",iconCls:"x-edit-forecolor",clickEvent:"mousedown",tooltip:a?e.buttonTips.forecolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({allowReselect:true,focus:Ext.emptyFn,value:"000000",plain:true,listeners:{scope:this,select:function(i,h){this.execCmd("forecolor",Ext.isWebKit||Ext.isIE?"#"+h:h);this.deferFocus()}},clickEvent:"mousedown"})},{itemId:"backcolor",cls:"x-btn-icon",iconCls:"x-edit-backcolor",clickEvent:"mousedown",tooltip:a?e.buttonTips.backcolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({focus:Ext.emptyFn,value:"FFFFFF",plain:true,allowReselect:true,listeners:{scope:this,select:function(i,h){if(Ext.isGecko){this.execCmd("useCSS",false);this.execCmd("hilitecolor",h);this.execCmd("useCSS",true);this.deferFocus()}else{this.execCmd(Ext.isOpera?"hilitecolor":"backcolor",Ext.isWebKit||Ext.isIE?"#"+h:h);this.deferFocus()}}},clickEvent:"mousedown"})})}if(this.enableAlignments){c.push("-",d("justifyleft"),d("justifycenter"),d("justifyright"))}if(!Ext.isSafari2){if(this.enableLinks){c.push("-",d("createlink",false,this.createLink))}if(this.enableLists){c.push("-",d("insertorderedlist"),d("insertunorderedlist"))}if(this.enableSourceEdit){c.push("-",d("sourceedit",true,function(h){this.toggleSourceEdit(!this.sourceEditMode)}))}}var b=new Ext.Toolbar({renderTo:this.wrap.dom.firstChild,items:c});if(g){this.fontSelect=g.el;this.mon(this.fontSelect,"change",function(){var h=this.fontSelect.dom.value;this.relayCmd("fontname",h);this.deferFocus()},this)}this.mon(b.el,"click",function(h){h.preventDefault()});this.tb=b;this.tb.doLayout()},onDisable:function(){this.wrap.mask();Ext.form.HtmlEditor.superclass.onDisable.call(this)},onEnable:function(){this.wrap.unmask();Ext.form.HtmlEditor.superclass.onEnable.call(this)},setReadOnly:function(b){Ext.form.HtmlEditor.superclass.setReadOnly.call(this,b);if(this.initialized){if(Ext.isIE){this.getEditorBody().contentEditable=!b}else{this.setDesignMode(!b)}var a=this.getEditorBody();if(a){a.style.cursor=this.readOnly?"default":"text"}this.disableItems(b)}},getDocMarkup:function(){var a=Ext.fly(this.iframe).getHeight()-this.iframePad*2;return String.format('',this.iframePad,a)},getEditorBody:function(){var a=this.getDoc();return a.body||a.documentElement},getDoc:function(){return Ext.isIE?this.getWin().document:(this.iframe.contentDocument||this.getWin().document)},getWin:function(){return Ext.isIE?this.iframe.contentWindow:window.frames[this.iframe.name]},onRender:function(b,a){Ext.form.HtmlEditor.superclass.onRender.call(this,b,a);this.el.dom.style.border="0 none";this.el.dom.setAttribute("tabIndex",-1);this.el.addClass("x-hidden");if(Ext.isIE){this.el.applyStyles("margin-top:-1px;margin-bottom:-1px;")}this.wrap=this.el.wrap({cls:"x-html-editor-wrap",cn:{cls:"x-html-editor-tb"}});this.createToolbar(this);this.disableItems(true);this.tb.doLayout();this.createIFrame();if(!this.width){var c=this.el.getSize();this.setSize(c.width,this.height||c.height)}this.resizeEl=this.positionEl=this.wrap},createIFrame:function(){var a=document.createElement("iframe");a.name=Ext.id();a.frameBorder="0";a.style.overflow="auto";this.wrap.dom.appendChild(a);this.iframe=a;this.monitorTask=Ext.TaskMgr.start({run:this.checkDesignMode,scope:this,interval:100})},initFrame:function(){Ext.TaskMgr.stop(this.monitorTask);var b=this.getDoc();this.win=this.getWin();b.open();b.write(this.getDocMarkup());b.close();var a={run:function(){var c=this.getDoc();if(c.body||c.readyState=="complete"){Ext.TaskMgr.stop(a);this.setDesignMode(true);this.initEditor.defer(10,this)}},interval:10,duration:10000,scope:this};Ext.TaskMgr.start(a)},checkDesignMode:function(){if(this.wrap&&this.wrap.dom.offsetWidth){var a=this.getDoc();if(!a){return}if(!a.editorInitialized||this.getDesignMode()!="on"){this.initFrame()}}},setDesignMode:function(b){var a;if(a=this.getDoc()){if(this.readOnly){b=false}a.designMode=(/on|true/i).test(String(b).toLowerCase())?"on":"off"}},getDesignMode:function(){var a=this.getDoc();if(!a){return""}return String(a.designMode).toLowerCase()},disableItems:function(a){if(this.fontSelect){this.fontSelect.dom.disabled=a}this.tb.items.each(function(b){if(b.getItemId()!="sourceedit"){b.setDisabled(a)}})},onResize:function(b,c){Ext.form.HtmlEditor.superclass.onResize.apply(this,arguments);if(this.el&&this.iframe){if(Ext.isNumber(b)){var e=b-this.wrap.getFrameWidth("lr");this.el.setWidth(e);this.tb.setWidth(e);this.iframe.style.width=Math.max(e,0)+"px"}if(Ext.isNumber(c)){var a=c-this.wrap.getFrameWidth("tb")-this.tb.el.getHeight();this.el.setHeight(a);this.iframe.style.height=Math.max(a,0)+"px";var d=this.getEditorBody();if(d){d.style.height=Math.max((a-(this.iframePad*2)),0)+"px"}}}},toggleSourceEdit:function(c){var e,b,a;if(c===undefined){c=!this.sourceEditMode}this.sourceEditMode=c===true;var d=this.tb.getComponent("sourceedit");if(d.pressed!==this.sourceEditMode){d.toggle(this.sourceEditMode);if(!d.xtbHidden){return}}if(this.sourceEditMode){a=this.getSize();e=Ext.get(this.iframe).getHeight();this.disableItems(true);this.syncValue();this.iframe.className="x-hidden";this.el.removeClass("x-hidden");this.el.dom.removeAttribute("tabIndex");this.el.focus();this.el.dom.style.height=e+"px"}else{b=parseInt(this.el.dom.style.height,10);if(this.initialized){this.disableItems(this.readOnly)}this.pushValue();this.iframe.className="";this.el.addClass("x-hidden");this.el.dom.setAttribute("tabIndex",-1);this.deferFocus();this.setSize(a);this.iframe.style.height=b+"px"}this.fireEvent("editmodechange",this,this.sourceEditMode)},createLink:function(){var a=prompt(this.createLinkText,this.defaultLinkValue);if(a&&a!="http://"){this.relayCmd("createlink",a)}},initEvents:function(){this.originalValue=this.getValue()},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,setValue:function(a){Ext.form.HtmlEditor.superclass.setValue.call(this,a);this.pushValue();return this},cleanHtml:function(a){a=String(a);if(Ext.isWebKit){a=a.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,"")}if(a.charCodeAt(0)==this.defaultValue.replace(/\D/g,"")){a=a.substring(1)}return a},syncValue:function(){if(this.initialized){var d=this.getEditorBody();var c=d.innerHTML;if(Ext.isWebKit){var b=d.getAttribute("style");var a=b.match(/text-align:(.*?);/i);if(a&&a[1]){c='
    '+c+"
    "}}c=this.cleanHtml(c);if(this.fireEvent("beforesync",this,c)!==false){this.el.dom.value=c;this.fireEvent("sync",this,c)}}},getValue:function(){this[this.sourceEditMode?"pushValue":"syncValue"]();return Ext.form.HtmlEditor.superclass.getValue.call(this)},pushValue:function(){if(this.initialized){var a=this.el.dom.value;if(!this.activated&&a.length<1){a=this.defaultValue}if(this.fireEvent("beforepush",this,a)!==false){this.getEditorBody().innerHTML=a;if(Ext.isGecko){this.setDesignMode(false);this.setDesignMode(true)}this.fireEvent("push",this,a)}}},deferFocus:function(){this.focus.defer(10,this)},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus()}else{this.el.focus()}},initEditor:function(){try{var c=this.getEditorBody(),a=this.el.getStyles("font-size","font-family","background-image","background-repeat","background-color","color"),g,b;a["background-attachment"]="fixed";c.bgProperties="fixed";Ext.DomHelper.applyStyles(c,a);g=this.getDoc();if(g){try{Ext.EventManager.removeAll(g)}catch(d){}}b=this.onEditorEvent.createDelegate(this);Ext.EventManager.on(g,{mousedown:b,dblclick:b,click:b,keyup:b,buffer:100});if(Ext.isGecko){Ext.EventManager.on(g,"keypress",this.applyCommand,this)}if(Ext.isIE||Ext.isWebKit||Ext.isOpera){Ext.EventManager.on(g,"keydown",this.fixKeys,this)}g.editorInitialized=true;this.initialized=true;this.pushValue();this.setReadOnly(this.readOnly);this.fireEvent("initialize",this)}catch(d){}},onDestroy:function(){if(this.monitorTask){Ext.TaskMgr.stop(this.monitorTask)}if(this.rendered){Ext.destroy(this.tb);var b=this.getDoc();if(b){try{Ext.EventManager.removeAll(b);for(var c in b){delete b[c]}}catch(a){}}if(this.wrap){this.wrap.dom.innerHTML="";this.wrap.remove()}}if(this.el){this.el.removeAllListeners();this.el.remove()}this.purgeListeners()},onFirstFocus:function(){this.activated=true;this.disableItems(this.readOnly);if(Ext.isGecko){this.win.focus();var a=this.win.getSelection();if(!a.focusNode||a.focusNode.nodeType!=3){var b=a.getRangeAt(0);b.selectNodeContents(this.getEditorBody());b.collapse(true);this.deferFocus()}try{this.execCmd("useCSS",true);this.execCmd("styleWithCSS",false)}catch(c){}}this.fireEvent("activate",this)},adjustFont:function(b){var d=b.getItemId()=="increasefontsize"?1:-1,c=this.getDoc(),a=parseInt(c.queryCommandValue("FontSize")||2,10);if((Ext.isSafari&&!Ext.isSafari2)||Ext.isChrome||Ext.isAir){if(a<=10){a=1+d}else{if(a<=13){a=2+d}else{if(a<=16){a=3+d}else{if(a<=18){a=4+d}else{if(a<=24){a=5+d}else{a=6+d}}}}}a=a.constrain(1,6)}else{if(Ext.isSafari){d*=2}a=Math.max(1,a+d)+(Ext.isSafari?"px":0)}this.execCmd("FontSize",a)},onEditorEvent:function(a){this.updateToolbar()},updateToolbar:function(){if(this.readOnly){return}if(!this.activated){this.onFirstFocus();return}var b=this.tb.items.map,c=this.getDoc();if(this.enableFont&&!Ext.isSafari2){var a=(c.queryCommandValue("FontName")||this.defaultFont).toLowerCase();if(a!=this.fontSelect.dom.value){this.fontSelect.dom.value=a}}if(this.enableFormat){b.bold.toggle(c.queryCommandState("bold"));b.italic.toggle(c.queryCommandState("italic"));b.underline.toggle(c.queryCommandState("underline"))}if(this.enableAlignments){b.justifyleft.toggle(c.queryCommandState("justifyleft"));b.justifycenter.toggle(c.queryCommandState("justifycenter"));b.justifyright.toggle(c.queryCommandState("justifyright"))}if(!Ext.isSafari2&&this.enableLists){b.insertorderedlist.toggle(c.queryCommandState("insertorderedlist"));b.insertunorderedlist.toggle(c.queryCommandState("insertunorderedlist"))}Ext.menu.MenuMgr.hideAll();this.syncValue()},relayBtnCmd:function(a){this.relayCmd(a.getItemId())},relayCmd:function(b,a){(function(){this.focus();this.execCmd(b,a);this.updateToolbar()}).defer(10,this)},execCmd:function(b,a){var c=this.getDoc();c.execCommand(b,false,a===undefined?null:a);this.syncValue()},applyCommand:function(b){if(b.ctrlKey){var d=b.getCharCode(),a;if(d>0){d=String.fromCharCode(d);switch(d){case"b":a="bold";break;case"i":a="italic";break;case"u":a="underline";break}if(a){this.win.focus();this.execCmd(a);this.deferFocus();b.preventDefault()}}}},insertAtCursor:function(c){if(!this.activated){return}if(Ext.isIE){this.win.focus();var b=this.getDoc(),a=b.selection.createRange();if(a){a.pasteHTML(c);this.syncValue();this.deferFocus()}}else{this.win.focus();this.execCmd("InsertHTML",c);this.deferFocus()}},fixKeys:function(){if(Ext.isIE){return function(g){var a=g.getKey(),d=this.getDoc(),b;if(a==g.TAB){g.stopEvent();b=d.selection.createRange();if(b){b.collapse(true);b.pasteHTML("    ");this.deferFocus()}}else{if(a==g.ENTER){b=d.selection.createRange();if(b){var c=b.parentElement();if(!c||c.tagName.toLowerCase()!="li"){g.stopEvent();b.pasteHTML("
    ");b.collapse(false);b.select()}}}}}}else{if(Ext.isOpera){return function(b){var a=b.getKey();if(a==b.TAB){b.stopEvent();this.win.focus();this.execCmd("InsertHTML","    ");this.deferFocus()}}}else{if(Ext.isWebKit){return function(b){var a=b.getKey();if(a==b.TAB){b.stopEvent();this.execCmd("InsertText","\t");this.deferFocus()}else{if(a==b.ENTER){b.stopEvent();this.execCmd("InsertHtml","

    ");this.deferFocus()}}}}}}}(),getToolbar:function(){return this.tb},buttonTips:{bold:{title:"Bold (Ctrl+B)",text:"Make the selected text bold.",cls:"x-html-editor-tip"},italic:{title:"Italic (Ctrl+I)",text:"Make the selected text italic.",cls:"x-html-editor-tip"},underline:{title:"Underline (Ctrl+U)",text:"Underline the selected text.",cls:"x-html-editor-tip"},increasefontsize:{title:"Grow Text",text:"Increase the font size.",cls:"x-html-editor-tip"},decreasefontsize:{title:"Shrink Text",text:"Decrease the font size.",cls:"x-html-editor-tip"},backcolor:{title:"Text Highlight Color",text:"Change the background color of the selected text.",cls:"x-html-editor-tip"},forecolor:{title:"Font Color",text:"Change the color of the selected text.",cls:"x-html-editor-tip"},justifyleft:{title:"Align Text Left",text:"Align text to the left.",cls:"x-html-editor-tip"},justifycenter:{title:"Center Text",text:"Center text in the editor.",cls:"x-html-editor-tip"},justifyright:{title:"Align Text Right",text:"Align text to the right.",cls:"x-html-editor-tip"},insertunorderedlist:{title:"Bullet List",text:"Start a bulleted list.",cls:"x-html-editor-tip"},insertorderedlist:{title:"Numbered List",text:"Start a numbered list.",cls:"x-html-editor-tip"},createlink:{title:"Hyperlink",text:"Make the selected text a hyperlink.",cls:"x-html-editor-tip"},sourceedit:{title:"Source Edit",text:"Switch to source editing mode.",cls:"x-html-editor-tip"}}});Ext.reg("htmleditor",Ext.form.HtmlEditor);Ext.form.TimeField=Ext.extend(Ext.form.ComboBox,{minValue:undefined,maxValue:undefined,minText:"The time in this field must be equal to or after {0}",maxText:"The time in this field must be equal to or before {0}",invalidText:"{0} is not a valid time",format:"g:i A",altFormats:"g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H|gi a|hi a|giA|hiA|gi A|hi A",increment:15,mode:"local",triggerAction:"all",typeAhead:false,initDate:"1/1/2008",initDateFormat:"j/n/Y",initComponent:function(){if(Ext.isDefined(this.minValue)){this.setMinValue(this.minValue,true)}if(Ext.isDefined(this.maxValue)){this.setMaxValue(this.maxValue,true)}if(!this.store){this.generateStore(true)}Ext.form.TimeField.superclass.initComponent.call(this)},setMinValue:function(b,a){this.setLimit(b,true,a);return this},setMaxValue:function(b,a){this.setLimit(b,false,a);return this},generateStore:function(b){var c=this.minValue||new Date(this.initDate).clearTime(),a=this.maxValue||new Date(this.initDate).clearTime().add("mi",(24*60)-1),d=[];while(c<=a){d.push(c.dateFormat(this.format));c=c.add("mi",this.increment)}this.bindStore(d,b)},setLimit:function(b,g,a){var e;if(Ext.isString(b)){e=this.parseDate(b)}else{if(Ext.isDate(b)){e=b}}if(e){var c=new Date(this.initDate).clearTime();c.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());this[g?"minValue":"maxValue"]=c;if(!a){this.generateStore()}}},getValue:function(){var a=Ext.form.TimeField.superclass.getValue.call(this);return this.formatDate(this.parseDate(a))||""},setValue:function(a){return Ext.form.TimeField.superclass.setValue.call(this,this.formatDate(this.parseDate(a)))},validateValue:Ext.form.DateField.prototype.validateValue,formatDate:Ext.form.DateField.prototype.formatDate,parseDate:function(h){if(!h||Ext.isDate(h)){return h}var j=this.initDate+" ",g=this.initDateFormat+" ",b=Date.parseDate(j+h,g+this.format),c=this.altFormats;if(!b&&c){if(!this.altFormatsArray){this.altFormatsArray=c.split("|")}for(var e=0,d=this.altFormatsArray,a=d.length;e=0){if(!d){c=g-1}d=false;while(c>=0){if(e.call(j||this,k,c,i)===true){return[k,c]}c--}k--}}else{if(c>=g){k++;d=false}while(k','
    ','
    {header}
    ','
    {body}
    ',"
    ",'
     
    ','
     
    ',"")}if(!c.header){c.header=new Ext.Template('','{cells}',"
    ")}if(!c.hcell){c.hcell=new Ext.Template('
    ',this.grid.enableHdMenu?'':"",'{value}',"
    ")}if(!c.body){c.body=new Ext.Template("{rows}")}if(!c.row){c.row=new Ext.Template('
    ',"{cells}",(this.enableRowBody?'':""),"
    {body}
    ")}if(!c.cell){c.cell=new Ext.Template('','
    {value}
    ',"")}for(var a in c){var b=c[a];if(b&&Ext.isFunction(b.compile)&&!b.compiled){b.disableFormats=true;b.compile()}}this.templates=c;this.colRe=new RegExp("x-grid3-td-([^\\s]+)","")},fly:function(a){if(!this._flyweight){this._flyweight=new Ext.Element.Flyweight(document.body)}this._flyweight.dom=a;return this._flyweight},getEditorParent:function(){return this.scroller.dom},initElements:function(){var c=Ext.Element;var b=this.grid.getGridEl().dom.firstChild;var a=b.childNodes;this.el=new c(b);this.mainWrap=new c(a[0]);this.mainHd=new c(this.mainWrap.dom.firstChild);if(this.grid.hideHeaders){this.mainHd.setDisplayed(false)}this.innerHd=this.mainHd.dom.firstChild;this.scroller=new c(this.mainWrap.dom.childNodes[1]);if(this.forceFit){this.scroller.setStyle("overflow-x","hidden")}this.mainBody=new c(this.scroller.dom.firstChild);this.focusEl=new c(this.scroller.dom.childNodes[1]);this.focusEl.swallowEvent("click",true);this.resizeMarker=new c(a[1]);this.resizeProxy=new c(a[2])},getRows:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},findCell:function(a){if(!a){return false}return this.fly(a).findParent(this.cellSelector,this.cellSelectorDepth)},findCellIndex:function(c,b){var a=this.findCell(c);if(a&&(!b||this.fly(a).hasClass(b))){return this.getCellIndex(a)}return false},getCellIndex:function(b){if(b){var a=b.className.match(this.colRe);if(a&&a[1]){return this.cm.getIndexById(a[1])}}return false},findHeaderCell:function(b){var a=this.findCell(b);return a&&this.fly(a).hasClass(this.hdCls)?a:null},findHeaderIndex:function(a){return this.findCellIndex(a,this.hdCls)},findRow:function(a){if(!a){return false}return this.fly(a).findParent(this.rowSelector,this.rowSelectorDepth)},findRowIndex:function(a){var b=this.findRow(a);return b?b.rowIndex:false},findRowBody:function(a){if(!a){return false}return this.fly(a).findParent(this.rowBodySelector,this.rowBodySelectorDepth)},getRow:function(a){return this.getRows()[a]},getCell:function(b,a){return this.getRow(b).getElementsByTagName("td")[a]},getHeaderCell:function(a){return this.mainHd.dom.getElementsByTagName("td")[a]},addRowClass:function(c,a){var b=this.getRow(c);if(b){this.fly(b).addClass(a)}},removeRowClass:function(c,a){var b=this.getRow(c);if(b){this.fly(b).removeClass(a)}},removeRow:function(a){Ext.removeNode(this.getRow(a));this.syncFocusEl(a)},removeRows:function(c,a){var b=this.mainBody.dom;for(var d=c;d<=a;d++){Ext.removeNode(b.childNodes[c])}this.syncFocusEl(c)},getScrollState:function(){var a=this.scroller.dom;return{left:a.scrollLeft,top:a.scrollTop}},restoreScroll:function(a){var b=this.scroller.dom;b.scrollLeft=a.left;b.scrollTop=a.top},scrollToTop:function(){this.scroller.dom.scrollTop=0;this.scroller.dom.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var a=this.scroller.dom;this.grid.fireEvent("bodyscroll",a.scrollLeft,a.scrollTop)},syncHeaderScroll:function(){var a=this.scroller.dom;this.innerHd.scrollLeft=a.scrollLeft;this.innerHd.scrollLeft=a.scrollLeft},updateSortIcon:function(b,a){var d=this.sortClasses;var c=this.mainHd.select("td").removeClass(d);c.item(b).addClass(d[a=="DESC"?1:0])},updateAllColumnWidths:function(){var d=this.getTotalWidth(),l=this.cm.getColumnCount(),g=[],e,b;for(b=0;b=this.ds.getCount()){return null}d=(d!==undefined?d:0);var c=this.getRow(h),a=this.cm,e=a.getColumnCount(),b;if(!(g===false&&d===0)){while(dm){n.scrollTop=q-a}}if(e!==false){var l=parseInt(h.offsetLeft,10);var j=l+h.offsetWidth;var i=parseInt(n.scrollLeft,10);var b=i+n.clientWidth;if(lb){n.scrollLeft=j-n.clientWidth}}}return this.getResolvedXY(r)},insertRows:function(a,i,e,h){var d=a.getCount()-1;if(!h&&i===0&&e>=d){this.fireEvent("beforerowsinserted",this,i,e);this.refresh();this.fireEvent("rowsinserted",this,i,e)}else{if(!h){this.fireEvent("beforerowsinserted",this,i,e)}var b=this.renderRows(i,e),g=this.getRow(i);if(g){if(i===0){Ext.fly(this.getRow(0)).removeClass(this.firstRowCls)}Ext.DomHelper.insertHtml("beforeBegin",g,b)}else{var c=this.getRow(d-1);if(c){Ext.fly(c).removeClass(this.lastRowCls)}Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,b)}if(!h){this.fireEvent("rowsinserted",this,i,e);this.processRows(i)}else{if(i===0||i>=d){Ext.fly(this.getRow(i)).addClass(i===0?this.firstRowCls:this.lastRowCls)}}}this.syncFocusEl(i)},deleteRows:function(a,c,b){if(a.getRowCount()<1){this.refresh()}else{this.fireEvent("beforerowsdeleted",this,c,b);this.removeRows(c,b);this.processRows(c);this.fireEvent("rowsdeleted",this,c,b)}},getColumnStyle:function(a,c){var b=!c?(this.cm.config[a].css||""):"";b+="width:"+this.getColumnWidth(a)+";";if(this.cm.isHidden(a)){b+="display:none;"}var d=this.cm.config[a].align;if(d){b+="text-align:"+d+";"}return b},getColumnWidth:function(b){var a=this.cm.getColumnWidth(b);if(Ext.isNumber(a)){return(Ext.isBorderBox||(Ext.isWebKit&&!Ext.isSafari2)?a:(a-this.borderWidth>0?a-this.borderWidth:0))+"px"}return a},getTotalWidth:function(){return this.cm.getTotalWidth()+"px"},fitColumns:function(d,h,j){var q=this.cm,k;var l=q.getTotalWidth(false);var a=this.grid.getGridEl().getWidth(true)-this.getScrollOffset();if(a<20){return}var e=a-l;if(e===0){return false}var m=q.getColumnCount(true);var s=m-(Ext.isNumber(j)?1:0);if(s===0){s=1;j=undefined}var r=q.getColumnCount();var o=[];var n=0;var c=0;var p;for(k=0;ka){var g=s!=m?j:n;q.setColumnWidth(g,Math.max(1,q.getColumnWidth(g)-(l-a)),true)}if(d!==true){this.updateAllColumnWidths()}return true},autoExpand:function(b){var i=this.grid,a=this.cm;if(!this.userResized&&i.autoExpandColumn){var d=a.getTotalWidth(false);var j=this.grid.getGridEl().getWidth(true)-this.getScrollOffset();if(d!=j){var h=a.getIndexById(i.autoExpandColumn);var e=a.getColumnWidth(h);var c=Math.min(Math.max(((j-d)+e),i.autoExpandMin),i.autoExpandMax);if(c!=e){a.setColumnWidth(h,c,true);if(b!==true){this.updateColumnWidth(h,c)}}}}},getColumnData:function(){var d=[],a=this.cm,e=a.getColumnCount();for(var c=0;c'+this.emptyText+"")}},updateHeaderSortState:function(){var b=this.ds.getSortState();if(!b){return}if(!this.sortState||(this.sortState.field!=b.field||this.sortState.direction!=b.direction)){this.grid.fireEvent("sortchange",this.grid,b)}this.sortState=b;var c=this.cm.findColumnIndex(b.field);if(c!=-1){var a=b.direction;this.updateSortIcon(c,a)}},clearHeaderSortState:function(){if(!this.sortState){return}this.grid.fireEvent("sortchange",this.grid,null);this.mainHd.select("td").removeClass(this.sortClasses);delete this.sortState},destroy:function(){if(this.scrollToTopTask&&this.scrollToTopTask.cancel){this.scrollToTopTask.cancel()}if(this.colMenu){Ext.menu.MenuMgr.unregister(this.colMenu);this.colMenu.destroy();delete this.colMenu}if(this.hmenu){Ext.menu.MenuMgr.unregister(this.hmenu);this.hmenu.destroy();delete this.hmenu}this.initData(null,null);this.purgeListeners();Ext.fly(this.innerHd).un("click",this.handleHdDown,this);if(this.grid.enableColumnMove){Ext.destroy(this.columnDrag.el,this.columnDrag.proxy.ghost,this.columnDrag.proxy.el,this.columnDrop.el,this.columnDrop.proxyTop,this.columnDrop.proxyBottom,this.columnDrag.dragData.ddel,this.columnDrag.dragData.header);if(this.columnDrag.proxy.anim){Ext.destroy(this.columnDrag.proxy.anim)}delete this.columnDrag.proxy.ghost;delete this.columnDrag.dragData.ddel;delete this.columnDrag.dragData.header;this.columnDrag.destroy();delete Ext.dd.DDM.locationCache[this.columnDrag.id];delete this.columnDrag._domRef;delete this.columnDrop.proxyTop;delete this.columnDrop.proxyBottom;this.columnDrop.destroy();delete Ext.dd.DDM.locationCache["gridHeader"+this.grid.getGridEl().id];delete this.columnDrop._domRef;delete Ext.dd.DDM.ids[this.columnDrop.ddGroup]}if(this.splitZone){this.splitZone.destroy();delete this.splitZone._domRef;delete Ext.dd.DDM.ids["gridSplitters"+this.grid.getGridEl().id]}Ext.fly(this.innerHd).removeAllListeners();Ext.removeNode(this.innerHd);delete this.innerHd;Ext.destroy(this.el,this.mainWrap,this.mainHd,this.scroller,this.mainBody,this.focusEl,this.resizeMarker,this.resizeProxy,this.activeHdBtn,this.dragZone,this.splitZone,this._flyweight);delete this.grid.container;if(this.dragZone){this.dragZone.destroy()}Ext.dd.DDM.currentTarget=null;delete Ext.dd.DDM.locationCache[this.grid.getGridEl().id];Ext.EventManager.removeResizeListener(this.onWindowResize,this)},onDenyColumnHide:function(){},render:function(){if(this.autoFill){var a=this.grid.ownerCt;if(a&&a.getLayout()){a.on("afterlayout",function(){this.fitColumns(true,true);this.updateHeaders()},this,{single:true})}else{this.fitColumns(true,true)}}else{if(this.forceFit){this.fitColumns(true,false)}else{if(this.grid.autoExpandColumn){this.autoExpand(true)}}}this.renderUI()},initData:function(b,a){if(this.ds){this.ds.un("load",this.onLoad,this);this.ds.un("datachanged",this.onDataChange,this);this.ds.un("add",this.onAdd,this);this.ds.un("remove",this.onRemove,this);this.ds.un("update",this.onUpdate,this);this.ds.un("clear",this.onClear,this);if(this.ds!==b&&this.ds.autoDestroy){this.ds.destroy()}}if(b){b.on({scope:this,load:this.onLoad,datachanged:this.onDataChange,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,clear:this.onClear})}this.ds=b;if(this.cm){this.cm.un("configchange",this.onColConfigChange,this);this.cm.un("widthchange",this.onColWidthChange,this);this.cm.un("headerchange",this.onHeaderChange,this);this.cm.un("hiddenchange",this.onHiddenChange,this);this.cm.un("columnmoved",this.onColumnMove,this)}if(a){delete this.lastViewWidth;a.on({scope:this,configchange:this.onColConfigChange,widthchange:this.onColWidthChange,headerchange:this.onHeaderChange,hiddenchange:this.onHiddenChange,columnmoved:this.onColumnMove})}this.cm=a},onDataChange:function(){this.refresh();this.updateHeaderSortState();this.syncFocusEl(0)},onClear:function(){this.refresh();this.syncFocusEl(0)},onUpdate:function(b,a){this.refreshRow(a)},onAdd:function(c,a,b){this.insertRows(c,b,b+(a.length-1))},onRemove:function(d,a,b,c){if(c!==true){this.fireEvent("beforerowremoved",this,b,a)}this.removeRow(b);if(c!==true){this.processRows(b);this.applyEmptyText();this.fireEvent("rowremoved",this,b,a)}},onLoad:function(){if(Ext.isGecko){if(!this.scrollToTopTask){this.scrollToTopTask=new Ext.util.DelayedTask(this.scrollToTop,this)}this.scrollToTopTask.delay(1)}else{this.scrollToTop()}},onColWidthChange:function(a,b,c){this.updateColumnWidth(b,c)},onHeaderChange:function(a,b,c){this.updateHeaders()},onHiddenChange:function(a,b,c){this.updateColumnHidden(b,c)},onColumnMove:function(a,d,b){this.indexMap=null;var c=this.getScrollState();this.refresh(true);this.restoreScroll(c);this.afterMove(b);this.grid.fireEvent("columnmove",d,b)},onColConfigChange:function(){delete this.lastViewWidth;this.indexMap=null;this.refresh(true)},initUI:function(a){a.on("headerclick",this.onHeaderClick,this)},initEvents:function(){},onHeaderClick:function(b,a){if(this.headersDisabled||!this.cm.isSortable(a)){return}b.stopEditing(true);b.store.sort(this.cm.getDataIndex(a))},onRowOver:function(b,a){var c;if((c=this.findRowIndex(a))!==false){this.addRowClass(c,"x-grid3-row-over")}},onRowOut:function(b,a){var c;if((c=this.findRowIndex(a))!==false&&!b.within(this.getRow(c),true)){this.removeRowClass(c,"x-grid3-row-over")}},handleWheel:function(a){a.stopPropagation()},onRowSelect:function(a){this.addRowClass(a,this.selectedRowClass)},onRowDeselect:function(a){this.removeRowClass(a,this.selectedRowClass)},onCellSelect:function(c,b){var a=this.getCell(c,b);if(a){this.fly(a).addClass("x-grid3-cell-selected")}},onCellDeselect:function(c,b){var a=this.getCell(c,b);if(a){this.fly(a).removeClass("x-grid3-cell-selected")}},onColumnSplitterMoved:function(c,b){this.userResized=true;var a=this.grid.colModel;a.setColumnWidth(c,b,true);if(this.forceFit){this.fitColumns(true,false,c);this.updateAllColumnWidths()}else{this.updateColumnWidth(c,b);this.syncHeaderScroll()}this.grid.fireEvent("columnresize",c,b)},handleHdMenuClick:function(c){var b=this.hdCtxIndex,a=this.cm,d=this.ds,e=c.getItemId();switch(e){case"asc":d.sort(a.getDataIndex(b),"ASC");break;case"desc":d.sort(a.getDataIndex(b),"DESC");break;default:b=a.getIndexById(e.substr(4));if(b!=-1){if(c.checked&&a.getColumnsBy(this.isHideableColumn,this).length<=1){this.onDenyColumnHide();return false}a.setHidden(b,c.checked)}}return true},isHideableColumn:function(a){return !a.hidden},beforeColMenuShow:function(){var a=this.cm,c=a.getColumnCount();this.colMenu.removeAll();for(var b=0;b=0&&this.config[a].resizable!==false&&this.config[a].fixed!==true},setHidden:function(a,b){var d=this.config[a];if(d.hidden!==b){d.hidden=b;this.totalWidth=null;this.fireEvent("hiddenchange",this,a,b)}},setEditor:function(a,b){this.config[a].setEditor(b)},destroy:function(){var d;for(var b=0,a=this.config.length;b0},isSelected:function(a){var b=Ext.isNumber(a)?this.grid.store.getAt(a):a;return(b&&this.selections.key(b.id)?true:false)},isIdSelected:function(a){return(this.selections.key(a)?true:false)},handleMouseDown:function(d,i,h){if(h.button!==0||this.isLocked()){return}var a=this.grid.getView();if(h.shiftKey&&!this.singleSelect&&this.last!==false){var c=this.last;this.selectRange(c,i,h.ctrlKey);this.last=c;a.focusRow(i)}else{var b=this.isSelected(i);if(h.ctrlKey&&b){this.deselectRow(i)}else{if(!b||this.getCount()>1){this.selectRow(i,h.ctrlKey||h.shiftKey);a.focusRow(i)}}}},selectRows:function(c,d){if(!d){this.clearSelections()}for(var b=0,a=c.length;b=a;c--){this.selectRow(c,true)}}},deselectRange:function(c,b,a){if(this.isLocked()){return}for(var d=c;d<=b;d++){this.deselectRow(d,a)}},selectRow:function(b,d,a){if(this.isLocked()||(b<0||b>=this.grid.store.getCount())||(d&&this.isSelected(b))){return}var c=this.grid.store.getAt(b);if(c&&this.fireEvent("beforerowselect",this,b,d,c)!==false){if(!d||this.singleSelect){this.clearSelections()}this.selections.add(c);this.last=this.lastActive=b;if(!a){this.grid.getView().onRowSelect(b)}this.fireEvent("rowselect",this,b,c);this.fireEvent("selectionchange",this)}},deselectRow:function(b,a){if(this.isLocked()){return}if(this.last==b){this.last=false}if(this.lastActive==b){this.lastActive=false}var c=this.grid.store.getAt(b);if(c){this.selections.remove(c);if(!a){this.grid.getView().onRowDeselect(b)}this.fireEvent("rowdeselect",this,b,c);this.fireEvent("selectionchange",this)}},restoreLast:function(){if(this._last){this.last=this._last}},acceptsNav:function(c,b,a){return !a.isHidden(b)&&a.isCellEditable(b,c)},onEditorKey:function(n,l){var d=l.getKey(),h,i=this.grid,o=i.lastEdit,j=i.activeEditor,p,o,a,m;var b=l.shiftKey;if(d==l.TAB){l.stopEvent();j.completeEdit();if(b){h=i.walkCells(j.row,j.col-1,-1,this.acceptsNav,this)}else{h=i.walkCells(j.row,j.col+1,1,this.acceptsNav,this)}}else{if(d==l.ENTER){if(this.moveEditorOnEnter!==false){if(b){h=i.walkCells(o.row-1,o.col,-1,this.acceptsNav,this)}else{h=i.walkCells(o.row+1,o.col,1,this.acceptsNav,this)}}}}if(h){a=h[0];m=h[1];if(o.row!=a){this.selectRow(a)}if(i.isEditor&&i.editing){p=i.activeEditor;if(p&&p.field.triggerBlur){p.field.triggerBlur()}}i.startEditing(a,m)}},destroy:function(){if(this.rowNav){this.rowNav.disable();this.rowNav=null}Ext.grid.RowSelectionModel.superclass.destroy.call(this)}});Ext.grid.Column=Ext.extend(Object,{isColumn:true,constructor:function(b){Ext.apply(this,b);if(Ext.isString(this.renderer)){this.renderer=Ext.util.Format[this.renderer]}else{if(Ext.isObject(this.renderer)){this.scope=this.renderer.scope;this.renderer=this.renderer.fn}}if(!this.scope){this.scope=this}var a=this.editor;delete this.editor;this.setEditor(a)},renderer:function(a){if(Ext.isString(a)&&a.length<1){return" "}return a},getEditor:function(a){return this.editable!==false?this.editor:null},setEditor:function(b){var a=this.editor;if(a){if(a.gridEditor){a.gridEditor.destroy();delete a.gridEditor}else{a.destroy()}}this.editor=null;if(b){if(!b.isXType){b=Ext.create(b,"textfield")}this.editor=b}},getCellEditor:function(b){var a=this.getEditor(b);if(a){if(!a.startEdit){if(!a.gridEditor){a.gridEditor=new Ext.grid.GridEditor(a)}a=a.gridEditor}}return a}});Ext.grid.BooleanColumn=Ext.extend(Ext.grid.Column,{trueText:"true",falseText:"false",undefinedText:" ",constructor:function(a){Ext.grid.BooleanColumn.superclass.constructor.call(this,a);var c=this.trueText,d=this.falseText,b=this.undefinedText;this.renderer=function(e){if(e===undefined){return b}if(!e||e==="false"){return d}return c}}});Ext.grid.NumberColumn=Ext.extend(Ext.grid.Column,{format:"0,000.00",constructor:function(a){Ext.grid.NumberColumn.superclass.constructor.call(this,a);this.renderer=Ext.util.Format.numberRenderer(this.format)}});Ext.grid.DateColumn=Ext.extend(Ext.grid.Column,{format:"m/d/Y",constructor:function(a){Ext.grid.DateColumn.superclass.constructor.call(this,a);this.renderer=Ext.util.Format.dateRenderer(this.format)}});Ext.grid.TemplateColumn=Ext.extend(Ext.grid.Column,{constructor:function(a){Ext.grid.TemplateColumn.superclass.constructor.call(this,a);var b=(!Ext.isPrimitive(this.tpl)&&this.tpl.compile)?this.tpl:new Ext.XTemplate(this.tpl);this.renderer=function(d,e,c){return b.apply(c.data)};this.tpl=b}});Ext.grid.Column.types={gridcolumn:Ext.grid.Column,booleancolumn:Ext.grid.BooleanColumn,numbercolumn:Ext.grid.NumberColumn,datecolumn:Ext.grid.DateColumn,templatecolumn:Ext.grid.TemplateColumn};Ext.grid.RowNumberer=Ext.extend(Object,{header:"",width:23,sortable:false,constructor:function(a){Ext.apply(this,a);if(this.rowspan){this.renderer=this.renderer.createDelegate(this)}},fixed:true,hideable:false,menuDisabled:true,dataIndex:"",id:"numberer",rowspan:undefined,renderer:function(b,c,a,d){if(this.rowspan){c.cellAttr='rowspan="'+this.rowspan+'"'}return d+1}});Ext.grid.CheckboxSelectionModel=Ext.extend(Ext.grid.RowSelectionModel,{header:'
     
    ',width:20,sortable:false,menuDisabled:true,fixed:true,hideable:false,dataIndex:"",id:"checker",constructor:function(){Ext.grid.CheckboxSelectionModel.superclass.constructor.apply(this,arguments);if(this.checkOnly){this.handleMouseDown=Ext.emptyFn}},initEvents:function(){Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this);this.grid.on("render",function(){var a=this.grid.getView();a.mainBody.on("mousedown",this.onMouseDown,this);Ext.fly(a.innerHd).on("mousedown",this.onHdMouseDown,this)},this)},handleMouseDown:function(){Ext.grid.CheckboxSelectionModel.superclass.handleMouseDown.apply(this,arguments);this.mouseHandled=true},onMouseDown:function(c,b){if(c.button===0&&b.className=="x-grid3-row-checker"){c.stopEvent();var d=c.getTarget(".x-grid3-row");if(!this.mouseHandled&&d){var a=d.rowIndex;if(this.isSelected(a)){this.deselectRow(a)}else{this.selectRow(a,true);this.grid.getView().focusRow(a)}}}this.mouseHandled=false},onHdMouseDown:function(c,a){if(a.className=="x-grid3-hd-checker"){c.stopEvent();var b=Ext.fly(a.parentNode);var d=b.hasClass("x-grid3-hd-checker-on");if(d){b.removeClass("x-grid3-hd-checker-on");this.clearSelections()}else{b.addClass("x-grid3-hd-checker-on");this.selectAll()}}},renderer:function(b,c,a){return'
     
    '}});Ext.grid.CellSelectionModel=Ext.extend(Ext.grid.AbstractSelectionModel,{constructor:function(a){Ext.apply(this,a);this.selection=null;this.addEvents("beforecellselect","cellselect","selectionchange");Ext.grid.CellSelectionModel.superclass.constructor.call(this)},initEvents:function(){this.grid.on("cellmousedown",this.handleMouseDown,this);this.grid.on(Ext.EventManager.useKeydown?"keydown":"keypress",this.handleKeyDown,this);this.grid.getView().on({scope:this,refresh:this.onViewChange,rowupdated:this.onRowUpdated,beforerowremoved:this.clearSelections,beforerowsinserted:this.clearSelections});if(this.grid.isEditor){this.grid.on("beforeedit",this.beforeEdit,this)}},beforeEdit:function(a){this.select(a.row,a.column,false,true,a.record)},onRowUpdated:function(a,b,c){if(this.selection&&this.selection.record==c){a.onCellSelect(b,this.selection.cell[1])}},onViewChange:function(){this.clearSelections(true)},getSelectedCell:function(){return this.selection?this.selection.cell:null},clearSelections:function(b){var a=this.selection;if(a){if(b!==true){this.grid.view.onCellDeselect(a.cell[0],a.cell[1])}this.selection=null;this.fireEvent("selectionchange",this,null)}},hasSelection:function(){return this.selection?true:false},handleMouseDown:function(b,d,a,c){if(c.button!==0||this.isLocked()){return}this.select(d,a)},select:function(g,c,b,e,d){if(this.fireEvent("beforecellselect",this,g,c)!==false){this.clearSelections();d=d||this.grid.store.getAt(g);this.selection={record:d,cell:[g,c]};if(!b){var a=this.grid.getView();a.onCellSelect(g,c);if(e!==true){a.focusCell(g,c)}}this.fireEvent("cellselect",this,g,c);this.fireEvent("selectionchange",this,this.selection)}},isSelectable:function(c,b,a){return !a.isHidden(b)},onEditorKey:function(b,a){if(a.getKey()==a.TAB){this.handleKeyDown(a)}},handleKeyDown:function(j){if(!j.isNavKeyPress()){return}var d=j.getKey(),i=this.grid,p=this.selection,b=this,m=function(g,c,e){return i.walkCells(g,c,e,i.isEditor&&i.editing?b.acceptsNav:b.isSelectable,b)},o,h,a,l,n;switch(d){case j.ESC:case j.PAGE_UP:case j.PAGE_DOWN:break;default:j.stopEvent();break}if(!p){o=m(0,0,1);if(o){this.select(o[0],o[1])}return}o=p.cell;a=o[0];l=o[1];switch(d){case j.TAB:if(j.shiftKey){h=m(a,l-1,-1)}else{h=m(a,l+1,1)}break;case j.DOWN:h=m(a+1,l,1);break;case j.UP:h=m(a-1,l,-1);break;case j.RIGHT:h=m(a,l+1,1);break;case j.LEFT:h=m(a,l-1,-1);break;case j.ENTER:if(i.isEditor&&!i.editing){i.startEditing(a,l);return}break}if(h){a=h[0];l=h[1];this.select(a,l);if(i.isEditor&&i.editing){n=i.activeEditor;if(n&&n.field.triggerBlur){n.field.triggerBlur()}i.startEditing(a,l)}}},acceptsNav:function(c,b,a){return !a.isHidden(b)&&a.isCellEditable(b,c)}});Ext.grid.EditorGridPanel=Ext.extend(Ext.grid.GridPanel,{clicksToEdit:2,forceValidation:false,isEditor:true,detectEdit:false,autoEncode:false,trackMouseOver:false,initComponent:function(){Ext.grid.EditorGridPanel.superclass.initComponent.call(this);if(!this.selModel){this.selModel=new Ext.grid.CellSelectionModel()}this.activeEditor=null;this.addEvents("beforeedit","afteredit","validateedit")},initEvents:function(){Ext.grid.EditorGridPanel.superclass.initEvents.call(this);this.getGridEl().on("mousewheel",this.stopEditing.createDelegate(this,[true]),this);this.on("columnresize",this.stopEditing,this,[true]);if(this.clicksToEdit==1){this.on("cellclick",this.onCellDblClick,this)}else{var a=this.getView();if(this.clicksToEdit=="auto"&&a.mainBody){a.mainBody.on("mousedown",this.onAutoEditClick,this)}this.on("celldblclick",this.onCellDblClick,this)}},onResize:function(){Ext.grid.EditorGridPanel.superclass.onResize.apply(this,arguments);var a=this.activeEditor;if(this.editing&&a){a.realign(true)}},onCellDblClick:function(b,c,a){this.startEditing(c,a)},onAutoEditClick:function(c,b){if(c.button!==0){return}var g=this.view.findRowIndex(b),a=this.view.findCellIndex(b);if(g!==false&&a!==false){this.stopEditing();if(this.selModel.getSelectedCell){var d=this.selModel.getSelectedCell();if(d&&d[0]===g&&d[1]===a){this.startEditing(g,a)}}else{if(this.selModel.isSelected(g)){this.startEditing(g,a)}}}},onEditComplete:function(b,d,a){this.editing=false;this.lastActiveEditor=this.activeEditor;this.activeEditor=null;var c=b.record,h=this.colModel.getDataIndex(b.col);d=this.postEditValue(d,a,c,h);if(this.forceValidation===true||String(d)!==String(a)){var g={grid:this,record:c,field:h,originalValue:a,value:d,row:b.row,column:b.col,cancel:false};if(this.fireEvent("validateedit",g)!==false&&!g.cancel&&String(d)!==String(a)){c.set(h,g.value);delete g.cancel;this.fireEvent("afteredit",g)}}this.view.focusCell(b.row,b.col)},startEditing:function(i,c){this.stopEditing();if(this.colModel.isCellEditable(c,i)){this.view.ensureVisible(i,c,true);var d=this.store.getAt(i),h=this.colModel.getDataIndex(c),g={grid:this,record:d,field:h,value:d.data[h],row:i,column:c,cancel:false};if(this.fireEvent("beforeedit",g)!==false&&!g.cancel){this.editing=true;var b=this.colModel.getCellEditor(c,i);if(!b){return}if(!b.rendered){b.parentEl=this.view.getEditorParent(b);b.on({scope:this,render:{fn:function(e){e.field.focus(false,true)},single:true,scope:this},specialkey:function(k,j){this.getSelectionModel().onEditorKey(k,j)},complete:this.onEditComplete,canceledit:this.stopEditing.createDelegate(this,[true])})}Ext.apply(b,{row:i,col:c,record:d});this.lastEdit={row:i,col:c};this.activeEditor=b;b.selectSameEditor=(this.activeEditor==this.lastActiveEditor);var a=this.preEditValue(d,h);b.startEdit(this.view.getCell(i,c).firstChild,Ext.isDefined(a)?a:"");(function(){delete b.selectSameEditor}).defer(50)}}},preEditValue:function(a,c){var b=a.data[c];return this.autoEncode&&Ext.isString(b)?Ext.util.Format.htmlDecode(b):b},postEditValue:function(c,a,b,d){return this.autoEncode&&Ext.isString(c)?Ext.util.Format.htmlEncode(c):c},stopEditing:function(b){if(this.editing){var a=this.lastActiveEditor=this.activeEditor;if(a){a[b===true?"cancelEdit":"completeEdit"]();this.view.focusCell(a.row,a.col)}this.activeEditor=null}this.editing=false}});Ext.reg("editorgrid",Ext.grid.EditorGridPanel);Ext.grid.GridEditor=function(b,a){Ext.grid.GridEditor.superclass.constructor.call(this,b,a);b.monitorTab=false};Ext.extend(Ext.grid.GridEditor,Ext.Editor,{alignment:"tl-tl",autoSize:"width",hideEl:false,cls:"x-small-editor x-grid-editor",shim:false,shadow:false});Ext.grid.PropertyRecord=Ext.data.Record.create([{name:"name",type:"string"},"value"]);Ext.grid.PropertyStore=Ext.extend(Ext.util.Observable,{constructor:function(a,b){this.grid=a;this.store=new Ext.data.Store({recordType:Ext.grid.PropertyRecord});this.store.on("update",this.onUpdate,this);if(b){this.setSource(b)}Ext.grid.PropertyStore.superclass.constructor.call(this)},setSource:function(c){this.source=c;this.store.removeAll();var b=[];for(var a in c){if(this.isEditableValue(c[a])){b.push(new Ext.grid.PropertyRecord({name:a,value:c[a]},a))}}this.store.loadRecords({records:b},{},true)},onUpdate:function(e,a,d){if(d==Ext.data.Record.EDIT){var b=a.data.value;var c=a.modified.value;if(this.grid.fireEvent("beforepropertychange",this.source,a.id,b,c)!==false){this.source[a.id]=b;a.commit();this.grid.fireEvent("propertychange",this.source,a.id,b,c)}else{a.reject()}}},getProperty:function(a){return this.store.getAt(a)},isEditableValue:function(a){return Ext.isPrimitive(a)||Ext.isDate(a)},setValue:function(d,c,a){var b=this.getRec(d);if(b){b.set("value",c);this.source[d]=c}else{if(a){this.source[d]=c;b=new Ext.grid.PropertyRecord({name:d,value:c},d);this.store.add(b)}}},remove:function(b){var a=this.getRec(b);if(a){this.store.remove(a);delete this.source[b]}},getRec:function(a){return this.store.getById(a)},getSource:function(){return this.source}});Ext.grid.PropertyColumnModel=Ext.extend(Ext.grid.ColumnModel,{nameText:"Name",valueText:"Value",dateFormat:"m/j/Y",trueText:"true",falseText:"false",constructor:function(c,b){var d=Ext.grid,e=Ext.form;this.grid=c;d.PropertyColumnModel.superclass.constructor.call(this,[{header:this.nameText,width:50,sortable:true,dataIndex:"name",id:"name",menuDisabled:true},{header:this.valueText,width:50,resizable:false,dataIndex:"value",id:"value",menuDisabled:true}]);this.store=b;var a=new e.Field({autoCreate:{tag:"select",children:[{tag:"option",value:"true",html:this.trueText},{tag:"option",value:"false",html:this.falseText}]},getValue:function(){return this.el.dom.value=="true"}});this.editors={date:new d.GridEditor(new e.DateField({selectOnFocus:true})),string:new d.GridEditor(new e.TextField({selectOnFocus:true})),number:new d.GridEditor(new e.NumberField({selectOnFocus:true,style:"text-align:left;"})),"boolean":new d.GridEditor(a,{autoSize:"both"})};this.renderCellDelegate=this.renderCell.createDelegate(this);this.renderPropDelegate=this.renderProp.createDelegate(this)},renderDate:function(a){return a.dateFormat(this.dateFormat)},renderBool:function(a){return this[a?"trueText":"falseText"]},isCellEditable:function(a,b){return a==1},getRenderer:function(a){return a==1?this.renderCellDelegate:this.renderPropDelegate},renderProp:function(a){return this.getPropertyName(a)},renderCell:function(d,b,c){var a=this.grid.customRenderers[c.get("name")];if(a){return a.apply(this,arguments)}var e=d;if(Ext.isDate(d)){e=this.renderDate(d)}else{if(typeof d=="boolean"){e=this.renderBool(d)}}return Ext.util.Format.htmlEncode(e)},getPropertyName:function(b){var a=this.grid.propertyNames;return a&&a[b]?a[b]:b},getCellEditor:function(a,e){var b=this.store.getProperty(e),d=b.data.name,c=b.data.value;if(this.grid.customEditors[d]){return this.grid.customEditors[d]}if(Ext.isDate(c)){return this.editors.date}else{if(typeof c=="number"){return this.editors.number}else{if(typeof c=="boolean"){return this.editors["boolean"]}else{return this.editors.string}}}},destroy:function(){Ext.grid.PropertyColumnModel.superclass.destroy.call(this);for(var a in this.editors){Ext.destroy(this.editors[a])}}});Ext.grid.PropertyGrid=Ext.extend(Ext.grid.EditorGridPanel,{enableColumnMove:false,stripeRows:false,trackMouseOver:false,clicksToEdit:1,enableHdMenu:false,viewConfig:{forceFit:true},initComponent:function(){this.customRenderers=this.customRenderers||{};this.customEditors=this.customEditors||{};this.lastEditRow=null;var b=new Ext.grid.PropertyStore(this);this.propStore=b;var a=new Ext.grid.PropertyColumnModel(this,b);b.store.sort("name","ASC");this.addEvents("beforepropertychange","propertychange");this.cm=a;this.ds=b.store;Ext.grid.PropertyGrid.superclass.initComponent.call(this);this.mon(this.selModel,"beforecellselect",function(e,d,c){if(c===0){this.startEditing.defer(200,this,[d,1]);return false}},this)},onRender:function(){Ext.grid.PropertyGrid.superclass.onRender.apply(this,arguments);this.getGridEl().addClass("x-props-grid")},afterRender:function(){Ext.grid.PropertyGrid.superclass.afterRender.apply(this,arguments);if(this.source){this.setSource(this.source)}},setSource:function(a){this.propStore.setSource(a)},getSource:function(){return this.propStore.getSource()},setProperty:function(c,b,a){this.propStore.setValue(c,b,a)},removeProperty:function(a){this.propStore.remove(a)}});Ext.reg("propertygrid",Ext.grid.PropertyGrid);Ext.grid.GroupingView=Ext.extend(Ext.grid.GridView,{groupByText:"Group By This Field",showGroupsText:"Show in Groups",hideGroupedColumn:false,showGroupName:true,startCollapsed:false,enableGrouping:true,enableGroupingMenu:true,enableNoGroups:true,emptyGroupText:"(None)",ignoreAdd:false,groupTextTpl:"{text}",groupMode:"value",initTemplates:function(){Ext.grid.GroupingView.superclass.initTemplates.call(this);this.state={};var a=this.grid.getSelectionModel();a.on(a.selectRow?"beforerowselect":"beforecellselect",this.onBeforeRowSelect,this);if(!this.startGroup){this.startGroup=new Ext.XTemplate('
    ','
    ',this.groupTextTpl,"
    ",'
    ')}this.startGroup.compile();if(!this.endGroup){this.endGroup="
    "}},findGroup:function(a){return Ext.fly(a).up(".x-grid-group",this.mainBody.dom)},getGroups:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},onAdd:function(d,a,b){if(this.canGroup()&&!this.ignoreAdd){var c=this.getScrollState();this.fireEvent("beforerowsinserted",d,b,b+(a.length-1));this.refresh();this.restoreScroll(c);this.fireEvent("rowsinserted",d,b,b+(a.length-1))}else{if(!this.canGroup()){Ext.grid.GroupingView.superclass.onAdd.apply(this,arguments)}}},onRemove:function(e,a,b,d){Ext.grid.GroupingView.superclass.onRemove.apply(this,arguments);var c=document.getElementById(a._groupId);if(c&&c.childNodes[1].childNodes.length<1){Ext.removeNode(c)}this.applyEmptyText()},refreshRow:function(a){if(this.ds.getCount()==1){this.refresh()}else{this.isUpdating=true;Ext.grid.GroupingView.superclass.refreshRow.apply(this,arguments);this.isUpdating=false}},beforeMenuShow:function(){var c,a=this.hmenu.items,b=this.cm.config[this.hdCtxIndex].groupable===false;if((c=a.get("groupBy"))){c.setDisabled(b)}if((c=a.get("showGroups"))){c.setDisabled(b);c.setChecked(this.enableGrouping,true)}},renderUI:function(){Ext.grid.GroupingView.superclass.renderUI.call(this);this.mainBody.on("mousedown",this.interceptMouse,this);if(this.enableGroupingMenu&&this.hmenu){this.hmenu.add("-",{itemId:"groupBy",text:this.groupByText,handler:this.onGroupByClick,scope:this,iconCls:"x-group-by-icon"});if(this.enableNoGroups){this.hmenu.add({itemId:"showGroups",text:this.showGroupsText,checked:true,checkHandler:this.onShowGroupsClick,scope:this})}this.hmenu.on("beforeshow",this.beforeMenuShow,this)}},processEvent:function(b,h){Ext.grid.GroupingView.superclass.processEvent.call(this,b,h);var g=h.getTarget(".x-grid-group-hd",this.mainBody);if(g){var d=this.getGroupField(),c=this.getPrefix(d),a=g.id.substring(c.length);a=a.substr(0,a.length-3);if(a){this.grid.fireEvent("group"+b,this.grid,d,a,h)}}},onGroupByClick:function(){this.enableGrouping=true;this.grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));this.grid.fireEvent("groupchange",this,this.grid.store.getGroupState());this.beforeMenuShow();this.refresh()},onShowGroupsClick:function(a,b){this.enableGrouping=b;if(b){this.onGroupByClick()}else{this.grid.store.clearGrouping();this.grid.fireEvent("groupchange",this,null)}},toggleRowIndex:function(c,a){if(!this.canGroup()){return}var b=this.getRow(c);if(b){this.toggleGroup(this.findGroup(b),a)}},toggleGroup:function(c,b){var a=Ext.get(c);b=Ext.isDefined(b)?b:a.hasClass("x-grid-group-collapsed");if(this.state[a.id]!==b){this.grid.stopEditing(true);this.state[a.id]=b;a[b?"removeClass":"addClass"]("x-grid-group-collapsed")}},toggleAllGroups:function(c){var b=this.getGroups();for(var d=0,a=b.length;d{@link #fbar}
    ) section of the panel. * @return {Ext.Toolbar} The toolbar @@ -10441,7 +10445,7 @@ new Ext.Panel({ // Reset lastSize of all sub-components so they KNOW they are in a collapsed container this.cascade(function(c) { if (c.lastSize) { - c.lastSize = { width: 0, height: 0 }; + c.lastSize = { width: undefined, height: undefined }; } }); this.fireEvent('collapse', this); @@ -10786,12 +10790,12 @@ panel.load({ this.ft, this.header, this.footer, - this.toolbars, this.tbar, this.bbar, this.body, this.mc, - this.bwrap + this.bwrap, + this.dd ); if (this.fbar) { Ext.destroy( @@ -10799,12 +10803,8 @@ panel.load({ this.fbar.el ); } - }else{ - Ext.destroy( - this.topToolbar, - this.bottomToolbar - ); } + Ext.destroy(this.toolbars); }, // private @@ -11386,7 +11386,7 @@ cp.colors = ['000000', '993300', '333300']; if(this.value){ var s = this.value; this.value = null; - this.select(s); + this.select(s, true); } }, @@ -11402,8 +11402,9 @@ cp.colors = ['000000', '993300', '333300']; /** * Selects the specified color in the palette (fires the {@link #select} event) * @param {String} color A valid 6-digit color hex code (# will be stripped if included) + * @param {Boolean} suppressEvent (optional) True to stop the select event from firing. Defaults to false. */ - select : function(color){ + select : function(color, suppressEvent){ color = color.replace('#', ''); if(color != this.value || this.allowReselect){ var el = this.el; @@ -11412,7 +11413,9 @@ cp.colors = ['000000', '993300', '333300']; } el.child('a.color-'+color).addClass('x-color-palette-sel'); this.value = color; - this.fireEvent('select', this, color); + if(suppressEvent !== true){ + this.fireEvent('select', this, color); + } } } @@ -11420,8 +11423,7 @@ cp.colors = ['000000', '993300', '333300']; * @cfg {String} autoEl @hide */ }); -Ext.reg('colorpalette', Ext.ColorPalette); -/** +Ext.reg('colorpalette', Ext.ColorPalette);/** * @class Ext.DatePicker * @extends Ext.Component *

    A popup date picker. This class is used by the {@link Ext.form.DateField DateField} class @@ -12838,26 +12840,29 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { * @param {Ext.EventObject} e The Event object */ onKeyDown : function(e){ - if(this.disabled){e.preventDefault();return;} - var k = e.getKey(); + /* + * The behaviour for keyboard handling with multiple thumbs is currently undefined. + * There's no real sane default for it, so leave it like this until we come up + * with a better way of doing it. + */ + if(this.disabled || this.thumbs.length !== 1){ + e.preventDefault(); + return; + } + var k = e.getKey(), + val; switch(k){ case e.UP: case e.RIGHT: e.stopEvent(); - if(e.ctrlKey){ - this.setValue(this.maxValue, undefined, true); - }else{ - this.setValue(this.value+this.keyIncrement, undefined, true); - } + val = e.ctrlKey ? this.maxValue : this.getValue(0) + this.keyIncrement; + this.setValue(0, val, undefined, true); break; case e.DOWN: case e.LEFT: e.stopEvent(); - if(e.ctrlKey){ - this.setValue(this.minValue, undefined, true); - }else{ - this.setValue(this.value-this.keyIncrement, undefined, true); - } + val = e.ctrlKey ? this.minValue : this.getValue(0) - this.keyIncrement; + this.setValue(0, val, undefined, true); break; default: e.preventDefault(); @@ -12941,11 +12946,16 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { */ setMinValue : function(val){ this.minValue = val; - this.syncThumb(); - - for (var i=0, j = this.thumbs.length; i < j; i++) { - if (this.thumbs[i].value < val) this.thumbs[i].value = val; + var i = 0, + thumbs = this.thumbs, + len = thumbs.length, + t; + + for(; i < len; ++i){ + t = thumbs[i]; + t.value = t.value < val ? val : t.value; } + this.syncThumb(); }, /** @@ -12955,11 +12965,16 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { */ setMaxValue : function(val){ this.maxValue = val; - this.syncThumb(); - - for (var i=0; i < this.thumbs.length; i++) { - if (this.thumbs[i].value > val) this.thumbs[i].value = val; + var i = 0, + thumbs = this.thumbs, + len = thumbs.length, + t; + + for(; i < len; ++i){ + t = thumbs[i]; + t.value = t.value > val ? val : t.value; } + this.syncThumb(); }, /** @@ -12975,12 +12990,14 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, { v = this.normalizeValue(v); - if (v !== thumb.value && this.fireEvent('beforechange', this, v, thumb.value) !== false) { + if (v !== thumb.value && this.fireEvent('beforechange', this, v, thumb.value, thumb) !== false) { thumb.value = v; - this.moveThumb(index, this.translateValue(v), animate !== false); - this.fireEvent('change', this, v, thumb); - if(changeComplete){ - this.fireEvent('changecomplete', this, v, thumb); + if(this.rendered){ + this.moveThumb(index, this.translateValue(v), animate !== false); + this.fireEvent('change', this, v, thumb); + if(changeComplete){ + this.fireEvent('changecomplete', this, v, thumb); + } } } }, diff --git a/pkgs/cmp-foundation.js b/pkgs/cmp-foundation.js index 771cef97..6ee6e564 100644 --- a/pkgs/cmp-foundation.js +++ b/pkgs/cmp-foundation.js @@ -1,7 +1,7 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ -Ext.ComponentMgr=function(){var c=new Ext.util.MixedCollection();var b={};var a={};return{register:function(d){c.add(d)},unregister:function(d){c.remove(d)},get:function(d){return c.get(d)},onAvailable:function(f,e,d){c.on("add",function(g,h){if(h.id==f){e.call(d||h,h);c.un("add",e,d)}})},all:c,types:b,ptypes:a,isRegistered:function(d){return b[d]!==undefined},isPluginRegistered:function(d){return a[d]!==undefined},registerType:function(e,d){b[e]=d;d.xtype=e},create:function(d,e){return d.render?d:new b[d.xtype||e](d)},registerPlugin:function(e,d){a[e]=d;d.ptype=e},createPlugin:function(e,f){var d=a[e.ptype||f];if(d.init){return d}else{return new d(e)}}}}();Ext.reg=Ext.ComponentMgr.registerType;Ext.preg=Ext.ComponentMgr.registerPlugin;Ext.create=Ext.ComponentMgr.create;Ext.Component=function(b){b=b||{};if(b.initialConfig){if(b.isAction){this.baseAction=b}b=b.initialConfig}else{if(b.tagName||b.dom||Ext.isString(b)){b={applyTo:b,id:b.id||b}}}this.initialConfig=b;Ext.apply(this,b);this.addEvents("added","disable","enable","beforeshow","show","beforehide","hide","removed","beforerender","render","afterrender","beforedestroy","destroy","beforestaterestore","staterestore","beforestatesave","statesave");this.getId();Ext.ComponentMgr.register(this);Ext.Component.superclass.constructor.call(this);if(this.baseAction){this.baseAction.addComponent(this)}this.initComponent();if(this.plugins){if(Ext.isArray(this.plugins)){for(var c=0,a=this.plugins.length;c0){return this.ownerCt.items.itemAt(a-1)}}return null},getBubbleTarget:function(){return this.ownerCt}});Ext.reg("component",Ext.Component);Ext.Action=Ext.extend(Object,{constructor:function(a){this.initialConfig=a;this.itemId=a.itemId=(a.itemId||a.id||Ext.id());this.items=[]},isAction:true,setText:function(a){this.initialConfig.text=a;this.callEach("setText",[a])},getText:function(){return this.initialConfig.text},setIconClass:function(a){this.initialConfig.iconCls=a;this.callEach("setIconClass",[a])},getIconClass:function(){return this.initialConfig.iconCls},setDisabled:function(a){this.initialConfig.disabled=a;this.callEach("setDisabled",[a])},enable:function(){this.setDisabled(false)},disable:function(){this.setDisabled(true)},isDisabled:function(){return this.initialConfig.disabled},setHidden:function(a){this.initialConfig.hidden=a;this.callEach("setVisible",[!a])},show:function(){this.setHidden(false)},hide:function(){this.setHidden(true)},isHidden:function(){return this.initialConfig.hidden},setHandler:function(b,a){this.initialConfig.handler=b;this.initialConfig.scope=a;this.callEach("setHandler",[b,a])},each:function(b,a){Ext.each(this.items,b,a)},callEach:function(e,b){var d=this.items;for(var c=0,a=d.length;ci+n.left){j=i-k-c;f=true}if((g+e)>d+n.top){g=d-e-c;f=true}if(j=l){g=l-e-5}}m=[j,g];this.storeXY(m);a.setXY.call(this,m);this.sync()}}return this},isVisible:function(){return this.visible},showAction:function(){this.visible=true;if(this.useDisplay===true){this.setDisplayed("")}else{if(this.lastXY){a.setXY.call(this,this.lastXY)}else{if(this.lastLT){a.setLeftTop.call(this,this.lastLT[0],this.lastLT[1])}}}},hideAction:function(){this.visible=false;if(this.useDisplay===true){this.setDisplayed(false)}else{this.setLeftTop(-10000,-10000)}},setVisible:function(h,g,j,k,i){if(h){this.showAction()}if(g&&h){var f=function(){this.sync(true);if(k){k()}}.createDelegate(this);a.setVisible.call(this,true,true,j,f,i)}else{if(!h){this.hideUnders(true)}var f=k;if(g){f=function(){this.hideAction();if(k){k()}}.createDelegate(this)}a.setVisible.call(this,h,g,j,f,i);if(h){this.sync(true)}else{if(!g){this.hideAction()}}}return this},storeXY:function(c){delete this.lastLT;this.lastXY=c},storeLeftTop:function(d,c){delete this.lastXY;this.lastLT=[d,c]},beforeFx:function(){this.beforeAction();return Ext.Layer.superclass.beforeFx.apply(this,arguments)},afterFx:function(){Ext.Layer.superclass.afterFx.apply(this,arguments);this.sync(this.isVisible())},beforeAction:function(){if(!this.updating&&this.shadow){this.shadow.hide()}},setLeft:function(c){this.storeLeftTop(c,this.getTop(true));a.setLeft.apply(this,arguments);this.sync();return this},setTop:function(c){this.storeLeftTop(this.getLeft(true),c);a.setTop.apply(this,arguments);this.sync();return this},setLeftTop:function(d,c){this.storeLeftTop(d,c);a.setLeftTop.apply(this,arguments);this.sync();return this},setXY:function(i,g,j,k,h){this.fixDisplay();this.beforeAction();this.storeXY(i);var f=this.createCB(k);a.setXY.call(this,i,g,j,f,h);if(!g){f()}return this},createCB:function(e){var d=this;return function(){d.constrainXY();d.sync(true);if(e){e()}}},setX:function(f,g,i,j,h){this.setXY([f,this.getY()],g,i,j,h);return this},setY:function(j,f,h,i,g){this.setXY([this.getX(),j],f,h,i,g);return this},setSize:function(i,j,g,l,m,k){this.beforeAction();var f=this.createCB(m);a.setSize.call(this,i,j,g,l,f,k);if(!g){f()}return this},setWidth:function(h,g,j,k,i){this.beforeAction();var f=this.createCB(k);a.setWidth.call(this,h,g,j,f,i);if(!g){f()}return this},setHeight:function(i,g,k,l,j){this.beforeAction();var f=this.createCB(l);a.setHeight.call(this,i,g,k,f,j);if(!g){f()}return this},setBounds:function(n,l,o,g,m,j,k,i){this.beforeAction();var f=this.createCB(k);if(!m){this.storeXY([n,l]);a.setXY.call(this,[n,l]);a.setSize.call(this,o,g,m,j,f,i);f()}else{a.setBounds.call(this,n,l,o,g,m,j,f,i)}return this},setZIndex:function(c){this.zindex=c;this.setStyle("z-index",c+2);if(this.shadow){this.shadow.setZIndex(c+1)}if(this.shim){this.shim.setStyle("z-index",c)}return this}})})();Ext.Shadow=function(d){Ext.apply(this,d);if(typeof this.mode!="string"){this.mode=this.defaultMode}var e=this.offset,c={h:0};var b=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case"drop":c.w=0;c.l=c.t=e;c.t-=1;if(Ext.isIE){c.l-=this.offset+b;c.t-=this.offset+b;c.w-=b;c.h-=b;c.t+=1}break;case"sides":c.w=(e*2);c.l=-e;c.t=e-1;if(Ext.isIE){c.l-=(this.offset-b);c.t-=this.offset+b;c.l+=1;c.w-=(this.offset-b)*2;c.w-=b+1;c.h-=1}break;case"frame":c.w=c.h=(e*2);c.l=c.t=-e;c.t+=1;c.h-=2;if(Ext.isIE){c.l-=(this.offset-b);c.t-=(this.offset-b);c.l+=1;c.w-=(this.offset+b+1);c.h-=(this.offset+b);c.h+=1}break}this.adjusts=c};Ext.Shadow.prototype={offset:4,defaultMode:"drop",show:function(a){a=Ext.get(a);if(!this.el){this.el=Ext.Shadow.Pool.pull();if(this.el.dom.nextSibling!=a.dom){this.el.insertBefore(a)}}this.el.setStyle("z-index",this.zIndex||parseInt(a.getStyle("z-index"),10)-1);if(Ext.isIE){this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")"}this.realign(a.getLeft(true),a.getTop(true),a.getWidth(),a.getHeight());this.el.dom.style.display="block"},isVisible:function(){return this.el?true:false},realign:function(b,q,p,f){if(!this.el){return}var m=this.adjusts,j=this.el.dom,r=j.style;var g=0;r.left=(b+m.l)+"px";r.top=(q+m.t)+"px";var o=(p+m.w),e=(f+m.h),i=o+"px",n=e+"px";if(r.width!=i||r.height!=n){r.width=i;r.height=n;if(!Ext.isIE){var k=j.childNodes;var c=Math.max(0,(o-12))+"px";k[0].childNodes[1].style.width=c;k[1].childNodes[1].style.width=c;k[2].childNodes[1].style.width=c;k[1].style.height=Math.max(0,(e-12))+"px"}}},hide:function(){if(this.el){this.el.dom.style.display="none";Ext.Shadow.Pool.push(this.el);delete this.el}},setZIndex:function(a){this.zIndex=a;if(this.el){this.el.setStyle("z-index",a)}}};Ext.Shadow.Pool=function(){var b=[];var a=Ext.isIE?'

    ':'
    ';return{pull:function(){var c=b.shift();if(!c){c=Ext.get(Ext.DomHelper.insertHtml("beforeBegin",document.body.firstChild,a));c.autoBoxAdjust=false}return c},push:function(c){b.push(c)}}}();Ext.BoxComponent=Ext.extend(Ext.Component,{initComponent:function(){Ext.BoxComponent.superclass.initComponent.call(this);this.addEvents("resize","move")},boxReady:false,deferHeight:false,setSize:function(b,d){if(typeof b=="object"){d=b.height;b=b.width}if(Ext.isDefined(b)&&Ext.isDefined(this.boxMinWidth)&&(bthis.boxMaxWidth)){b=this.boxMaxWidth}if(Ext.isDefined(d)&&Ext.isDefined(this.boxMaxHeight)&&(d>this.boxMaxHeight)){d=this.boxMaxHeight}if(!this.boxReady){this.width=b;this.height=d;return this}if(this.cacheSizes!==false&&this.lastSize&&this.lastSize.width==b&&this.lastSize.height==d){return this}this.lastSize={width:b,height:d};var c=this.adjustSize(b,d),f=c.width,a=c.height,e;if(f!==undefined||a!==undefined){e=this.getResizeEl();if(!this.deferHeight&&f!==undefined&&a!==undefined){e.setSize(f,a)}else{if(!this.deferHeight&&a!==undefined){e.setHeight(a)}else{if(f!==undefined){e.setWidth(f)}}}this.onResize(f,a,b,d);this.fireEvent("resize",this,f,a,b,d)}return this},setWidth:function(a){return this.setSize(a)},setHeight:function(a){return this.setSize(undefined,a)},getSize:function(){return this.getResizeEl().getSize()},getWidth:function(){return this.getResizeEl().getWidth()},getHeight:function(){return this.getResizeEl().getHeight()},getOuterSize:function(){var a=this.getResizeEl();return{width:a.getWidth()+a.getMargins("lr"),height:a.getHeight()+a.getMargins("tb")}},getPosition:function(a){var b=this.getPositionEl();if(a===true){return[b.getLeft(true),b.getTop(true)]}return this.xy||b.getXY()},getBox:function(a){var c=this.getPosition(a);var b=this.getSize();b.x=c[0];b.y=c[1];return b},updateBox:function(a){this.setSize(a.width,a.height);this.setPagePosition(a.x,a.y);return this},getResizeEl:function(){return this.resizeEl||this.el},setAutoScroll:function(a){if(this.rendered){this.getContentTarget().setOverflow(a?"auto":"")}this.autoScroll=a;return this},setPosition:function(a,f){if(a&&typeof a[1]=="number"){f=a[1];a=a[0]}this.x=a;this.y=f;if(!this.boxReady){return this}var b=this.adjustPosition(a,f);var e=b.x,d=b.y;var c=this.getPositionEl();if(e!==undefined||d!==undefined){if(e!==undefined&&d!==undefined){c.setLeftTop(e,d)}else{if(e!==undefined){c.setLeft(e)}else{if(d!==undefined){c.setTop(d)}}}this.onPosition(e,d);this.fireEvent("move",this,e,d)}return this},setPagePosition:function(a,c){if(a&&typeof a[1]=="number"){c=a[1];a=a[0]}this.pageX=a;this.pageY=c;if(!this.boxReady){return}if(a===undefined||c===undefined){return}var b=this.getPositionEl().translatePoints(a,c);this.setPosition(b.left,b.top);return this},afterRender:function(){Ext.BoxComponent.superclass.afterRender.call(this);if(this.resizeEl){this.resizeEl=Ext.get(this.resizeEl)}if(this.positionEl){this.positionEl=Ext.get(this.positionEl)}this.boxReady=true;Ext.isDefined(this.autoScroll)&&this.setAutoScroll(this.autoScroll);this.setSize(this.width,this.height);if(this.x||this.y){this.setPosition(this.x,this.y)}else{if(this.pageX||this.pageY){this.setPagePosition(this.pageX,this.pageY)}}},syncSize:function(){delete this.lastSize;this.setSize(this.autoWidth?undefined:this.getResizeEl().getWidth(),this.autoHeight?undefined:this.getResizeEl().getHeight());return this},onResize:function(d,b,a,c){},onPosition:function(a,b){},adjustSize:function(a,b){if(this.autoWidth){a="auto"}if(this.autoHeight){b="auto"}return{width:a,height:b}},adjustPosition:function(a,b){return{x:a,y:b}}});Ext.reg("box",Ext.BoxComponent);Ext.Spacer=Ext.extend(Ext.BoxComponent,{autoEl:"div"});Ext.reg("spacer",Ext.Spacer);Ext.SplitBar=function(c,e,b,d,a){this.el=Ext.get(c,true);this.el.dom.unselectable="on";this.resizingEl=Ext.get(e,true);this.orientation=b||Ext.SplitBar.HORIZONTAL;this.minSize=0;this.maxSize=2000;this.animate=false;this.useShim=false;this.shim=null;if(!a){this.proxy=Ext.SplitBar.createProxy(this.orientation)}else{this.proxy=Ext.get(a).dom}this.dd=new Ext.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id});this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this);this.dd.endDrag=this.onEndProxyDrag.createDelegate(this);this.dragSpecs={};this.adapter=new Ext.SplitBar.BasicLayoutAdapter();this.adapter.init(this);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.placement=d||(this.el.getX()>this.resizingEl.getX()?Ext.SplitBar.LEFT:Ext.SplitBar.RIGHT);this.el.addClass("x-splitbar-h")}else{this.placement=d||(this.el.getY()>this.resizingEl.getY()?Ext.SplitBar.TOP:Ext.SplitBar.BOTTOM);this.el.addClass("x-splitbar-v")}this.addEvents("resize","moved","beforeresize","beforeapply");Ext.SplitBar.superclass.constructor.call(this)};Ext.extend(Ext.SplitBar,Ext.util.Observable,{onStartProxyDrag:function(a,e){this.fireEvent("beforeresize",this);this.overlay=Ext.DomHelper.append(document.body,{cls:"x-drag-overlay",html:" "},true);this.overlay.unselectable();this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();Ext.get(this.proxy).setDisplayed("block");var c=this.adapter.getElementSize(this);this.activeMinSize=this.getMinimumSize();this.activeMaxSize=this.getMaximumSize();var d=c-this.activeMinSize;var b=Math.max(this.activeMaxSize-c,0);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.dd.resetConstraints();this.dd.setXConstraint(this.placement==Ext.SplitBar.LEFT?d:b,this.placement==Ext.SplitBar.LEFT?b:d,this.tickSize);this.dd.setYConstraint(0,0)}else{this.dd.resetConstraints();this.dd.setXConstraint(0,0);this.dd.setYConstraint(this.placement==Ext.SplitBar.TOP?d:b,this.placement==Ext.SplitBar.TOP?b:d,this.tickSize)}this.dragSpecs.startSize=c;this.dragSpecs.startPoint=[a,e];Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd,a,e)},onEndProxyDrag:function(c){Ext.get(this.proxy).setDisplayed(false);var b=Ext.lib.Event.getXY(c);if(this.overlay){Ext.destroy(this.overlay);delete this.overlay}var a;if(this.orientation==Ext.SplitBar.HORIZONTAL){a=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.LEFT?b[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-b[0])}else{a=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.TOP?b[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-b[1])}a=Math.min(Math.max(a,this.activeMinSize),this.activeMaxSize);if(a!=this.dragSpecs.startSize){if(this.fireEvent("beforeapply",this,a)!==false){this.adapter.setElementSize(this,a);this.fireEvent("moved",this,a);this.fireEvent("resize",this,a)}}},getAdapter:function(){return this.adapter},setAdapter:function(a){this.adapter=a;this.adapter.init(this)},getMinimumSize:function(){return this.minSize},setMinimumSize:function(a){this.minSize=a},getMaximumSize:function(){return this.maxSize},setMaximumSize:function(a){this.maxSize=a},setCurrentSize:function(b){var a=this.animate;this.animate=false;this.adapter.setElementSize(this,b);this.animate=a},destroy:function(a){Ext.destroy(this.shim,Ext.get(this.proxy));this.dd.unreg();if(a){this.el.remove()}this.purgeListeners()}});Ext.SplitBar.createProxy=function(b){var c=new Ext.Element(document.createElement("div"));document.body.appendChild(c.dom);c.unselectable();var a="x-splitbar-proxy";c.addClass(a+" "+(b==Ext.SplitBar.HORIZONTAL?a+"-h":a+"-v"));return c.dom};Ext.SplitBar.BasicLayoutAdapter=function(){};Ext.SplitBar.BasicLayoutAdapter.prototype={init:function(a){},getElementSize:function(a){if(a.orientation==Ext.SplitBar.HORIZONTAL){return a.resizingEl.getWidth()}else{return a.resizingEl.getHeight()}},setElementSize:function(b,a,c){if(b.orientation==Ext.SplitBar.HORIZONTAL){if(!b.animate){b.resizingEl.setWidth(a);if(c){c(b,a)}}else{b.resizingEl.setWidth(a,true,0.1,c,"easeOut")}}else{if(!b.animate){b.resizingEl.setHeight(a);if(c){c(b,a)}}else{b.resizingEl.setHeight(a,true,0.1,c,"easeOut")}}}};Ext.SplitBar.AbsoluteLayoutAdapter=function(a){this.basic=new Ext.SplitBar.BasicLayoutAdapter();this.container=Ext.get(a)};Ext.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(a){this.basic.init(a)},getElementSize:function(a){return this.basic.getElementSize(a)},setElementSize:function(b,a,c){this.basic.setElementSize(b,a,this.moveSplitter.createDelegate(this,[b]))},moveSplitter:function(a){var b=Ext.SplitBar;switch(a.placement){case b.LEFT:a.el.setX(a.resizingEl.getRight());break;case b.RIGHT:a.el.setStyle("right",(this.container.getWidth()-a.resizingEl.getLeft())+"px");break;case b.TOP:a.el.setY(a.resizingEl.getBottom());break;case b.BOTTOM:a.el.setY(a.resizingEl.getTop()-a.el.getHeight());break}}};Ext.SplitBar.VERTICAL=1;Ext.SplitBar.HORIZONTAL=2;Ext.SplitBar.LEFT=1;Ext.SplitBar.RIGHT=2;Ext.SplitBar.TOP=3;Ext.SplitBar.BOTTOM=4;Ext.Container=Ext.extend(Ext.BoxComponent,{bufferResize:50,autoDestroy:true,forceLayout:false,defaultType:"panel",resizeEvent:"resize",bubbleEvents:["add","remove"],initComponent:function(){Ext.Container.superclass.initComponent.call(this);this.addEvents("afterlayout","beforeadd","beforeremove","add","remove");var a=this.items;if(a){delete this.items;this.add(a)}},initItems:function(){if(!this.items){this.items=new Ext.util.MixedCollection(false,this.getComponentId);this.getLayout()}},setLayout:function(a){if(this.layout&&this.layout!=a){this.layout.setContainer(null)}this.initItems();this.layout=a;a.setContainer(this)},afterRender:function(){Ext.Container.superclass.afterRender.call(this);if(!this.layout){this.layout="auto"}if(Ext.isObject(this.layout)&&!this.layout.layout){this.layoutConfig=this.layout;this.layout=this.layoutConfig.type}if(Ext.isString(this.layout)){this.layout=new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig)}this.setLayout(this.layout);if(this.activeItem!==undefined){var a=this.activeItem;delete this.activeItem;this.layout.setActiveItem(a)}if(!this.ownerCt){this.doLayout(false,true)}if(this.monitorResize===true){Ext.EventManager.onWindowResize(this.doLayout,this,[false])}},getLayoutTarget:function(){return this.el},getComponentId:function(a){return a.getItemId()},add:function(b){this.initItems();var e=arguments.length>1;if(e||Ext.isArray(b)){var a=[];Ext.each(e?arguments:b,function(g){a.push(this.add(g))},this);return a}var f=this.lookupComponent(this.applyDefaults(b));var d=this.items.length;if(this.fireEvent("beforeadd",this,f,d)!==false&&this.onBeforeAdd(f)!==false){this.items.add(f);f.onAdded(this,d);this.onAdd(f);this.fireEvent("add",this,f,d)}return f},onAdd:function(a){},onAdded:function(a,b){this.ownerCt=a;this.initRef();this.cascade(function(d){d.initRef()});this.fireEvent("added",this,a,b)},insert:function(g,f){this.initItems();var e=arguments,d=e.length;if(d>2){var b=[];for(var h=d-1;h>=1;--h){b.push(this.insert(g,e[h]))}return b}var j=this.lookupComponent(this.applyDefaults(f));g=Math.min(g,this.items.length);if(this.fireEvent("beforeadd",this,j,g)!==false&&this.onBeforeAdd(j)!==false){if(j.ownerCt==this){this.items.remove(j)}this.items.insert(g,j);j.onAdded(this,g);this.onAdd(j);this.fireEvent("add",this,j,g)}return j},applyDefaults:function(b){var a=this.defaults;if(a){if(Ext.isFunction(a)){a=a.call(this,b)}if(Ext.isString(b)){b=Ext.ComponentMgr.get(b);Ext.apply(b,a)}else{if(!b.events){Ext.applyIf(b,a)}else{Ext.apply(b,a)}}}return b},onBeforeAdd:function(a){if(a.ownerCt){a.ownerCt.remove(a,false)}if(this.hideBorders===true){a.border=(a.border===true)}},remove:function(a,b){this.initItems();var d=this.getComponent(a);if(d&&this.fireEvent("beforeremove",this,d)!==false){this.doRemove(d,b);this.fireEvent("remove",this,d)}return d},onRemove:function(a){},doRemove:function(e,d){var b=this.layout,a=b&&this.rendered;if(a){b.onRemove(e)}this.items.remove(e);e.onRemoved();this.onRemove(e);if(d===true||(d!==false&&this.autoDestroy)){e.destroy()}if(a){b.afterRemove(e)}},removeAll:function(c){this.initItems();var e,f=[],b=[];this.items.each(function(g){f.push(g)});for(var d=0,a=f.length;d','','
    ','
    ',"");a.disableFormats=true;return a.compile()})(),destroy:function(){if(this.resizeTask&&this.resizeTask.cancel){this.resizeTask.cancel()}if(!Ext.isEmpty(this.targetCls)){var a=this.container.getLayoutTarget();if(a){a.removeClass(this.targetCls)}}}});Ext.layout.AutoLayout=Ext.extend(Ext.layout.ContainerLayout,{type:"auto",monitorResize:true,onLayout:function(d,f){Ext.layout.AutoLayout.superclass.onLayout.call(this,d,f);var e=this.getRenderedItems(d),a=e.length,b,g;for(b=0;b0){b.setSize(a)}}});Ext.Container.LAYOUTS.fit=Ext.layout.FitLayout;Ext.layout.CardLayout=Ext.extend(Ext.layout.FitLayout,{deferredRender:false,layoutOnCardChange:false,renderHidden:true,type:"card",setActiveItem:function(d){var a=this.activeItem,b=this.container;d=b.getComponent(d);if(d&&a!=d){if(a){a.hide();if(a.hidden!==true){return false}a.fireEvent("deactivate",a)}var c=d.doLayout&&(this.layoutOnCardChange||!d.rendered);this.activeItem=d;delete d.deferLayout;d.show();this.layout();if(c){d.doLayout()}d.fireEvent("activate",d)}},renderAll:function(a,b){if(this.deferredRender){this.renderItem(this.activeItem,undefined,b)}else{Ext.layout.CardLayout.superclass.renderAll.call(this,a,b)}}});Ext.Container.LAYOUTS.card=Ext.layout.CardLayout;Ext.layout.AnchorLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"anchor",defaultAnchor:"100%",parseAnchorRE:/^(r|right|b|bottom)$/i,getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();if(!a){return{}}return a.getStyleSize()},onLayout:function(l,o){Ext.layout.AnchorLayout.superclass.onLayout.call(this,l,o);var u=this.getLayoutTargetSize();var s=u.width,k=u.height;if(s<20&&k<20){return}var d,q;if(l.anchorSize){if(typeof l.anchorSize=="number"){d=l.anchorSize}else{d=l.anchorSize.width;q=l.anchorSize.height}}else{d=l.initialConfig.width;q=l.initialConfig.height}var n=this.getRenderedItems(l),m=n.length,g,p,r,f,b,e,t,j=[];for(g=0;g ');b.disableFormats=true;b.compile();Ext.layout.BorderLayout.Region.prototype.toolTemplate=b}this.collapsedEl=this.targetEl.createChild({cls:"x-layout-collapsed x-layout-collapsed-"+this.position,id:this.panel.id+"-xcollapsed"});this.collapsedEl.enableDisplayMode("block");if(this.collapseMode=="mini"){this.collapsedEl.addClass("x-layout-cmini-"+this.position);this.miniCollapsedEl=this.collapsedEl.createChild({cls:"x-layout-mini x-layout-mini-"+this.position,html:" "});this.miniCollapsedEl.addClassOnOver("x-layout-mini-over");this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this.onExpandClick,this,{stopEvent:true})}else{if(this.collapsible!==false&&!this.hideCollapseTool){var a=this.toolTemplate.append(this.collapsedEl.dom,{id:"expand-"+this.position},true);a.addClassOnOver("x-tool-expand-"+this.position+"-over");a.on("click",this.onExpandClick,this,{stopEvent:true})}if(this.floatable!==false||this.titleCollapse){this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this[this.floatable?"collapseClick":"onExpandClick"],this)}}}return this.collapsedEl},onExpandClick:function(a){if(this.isSlid){this.panel.expand(false)}else{this.panel.expand()}},onCollapseClick:function(a){this.panel.collapse()},beforeCollapse:function(c,a){this.lastAnim=a;if(this.splitEl){this.splitEl.hide()}this.getCollapsedEl().show();var b=this.panel.getEl();this.originalZIndex=b.getStyle("z-index");b.setStyle("z-index",100);this.isCollapsed=true;this.layout.layout()},onCollapse:function(a){this.panel.el.setStyle("z-index",1);if(this.lastAnim===false||this.panel.animCollapse===false){this.getCollapsedEl().dom.style.visibility="visible"}else{this.getCollapsedEl().slideIn(this.panel.slideAnchor,{duration:0.2})}this.state.collapsed=true;this.panel.saveState()},beforeExpand:function(a){if(this.isSlid){this.afterSlideIn()}var b=this.getCollapsedEl();this.el.show();if(this.position=="east"||this.position=="west"){this.panel.setSize(undefined,b.getHeight())}else{this.panel.setSize(b.getWidth(),undefined)}b.hide();b.dom.style.visibility="hidden";this.panel.el.setStyle("z-index",this.floatingZIndex)},onExpand:function(){this.isCollapsed=false;if(this.splitEl){this.splitEl.show()}this.layout.layout();this.panel.el.setStyle("z-index",this.originalZIndex);this.state.collapsed=false;this.panel.saveState()},collapseClick:function(a){if(this.isSlid){a.stopPropagation();this.slideIn()}else{a.stopPropagation();this.slideOut()}},onHide:function(){if(this.isCollapsed){this.getCollapsedEl().hide()}else{if(this.splitEl){this.splitEl.hide()}}},onShow:function(){if(this.isCollapsed){this.getCollapsedEl().show()}else{if(this.splitEl){this.splitEl.show()}}},isVisible:function(){return !this.panel.hidden},getMargins:function(){return this.isCollapsed&&this.cmargins?this.cmargins:this.margins},getSize:function(){return this.isCollapsed?this.getCollapsedEl().getSize():this.panel.getSize()},setPanel:function(a){this.panel=a},getMinWidth:function(){return this.minWidth},getMinHeight:function(){return this.minHeight},applyLayoutCollapsed:function(a){var b=this.getCollapsedEl();b.setLeftTop(a.x,a.y);b.setSize(a.width,a.height)},applyLayout:function(a){if(this.isCollapsed){this.applyLayoutCollapsed(a)}else{this.panel.setPosition(a.x,a.y);this.panel.setSize(a.width,a.height)}},beforeSlide:function(){this.panel.beforeEffect()},afterSlide:function(){this.panel.afterEffect()},initAutoHide:function(){if(this.autoHide!==false){if(!this.autoHideHd){this.autoHideSlideTask=new Ext.util.DelayedTask(this.slideIn,this);this.autoHideHd={mouseout:function(a){if(!a.within(this.el,true)){this.autoHideSlideTask.delay(500)}},mouseover:function(a){this.autoHideSlideTask.cancel()},scope:this}}this.el.on(this.autoHideHd);this.collapsedEl.on(this.autoHideHd)}},clearAutoHide:function(){if(this.autoHide!==false){this.el.un("mouseout",this.autoHideHd.mouseout);this.el.un("mouseover",this.autoHideHd.mouseover);this.collapsedEl.un("mouseout",this.autoHideHd.mouseout);this.collapsedEl.un("mouseover",this.autoHideHd.mouseover)}},clearMonitor:function(){Ext.getDoc().un("click",this.slideInIf,this)},slideOut:function(){if(this.isSlid||this.el.hasActiveFx()){return}this.isSlid=true;var b=this.panel.tools,c,a;if(b&&b.toggle){b.toggle.hide()}this.el.show();a=this.panel.collapsed;this.panel.collapsed=false;if(this.position=="east"||this.position=="west"){c=this.panel.deferHeight;this.panel.deferHeight=false;this.panel.setSize(undefined,this.collapsedEl.getHeight());this.panel.deferHeight=c}else{this.panel.setSize(this.collapsedEl.getWidth(),undefined)}this.panel.collapsed=a;this.restoreLT=[this.el.dom.style.left,this.el.dom.style.top];this.el.alignTo(this.collapsedEl,this.getCollapseAnchor());this.el.setStyle("z-index",this.floatingZIndex+2);this.panel.el.replaceClass("x-panel-collapsed","x-panel-floating");if(this.animFloat!==false){this.beforeSlide();this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide();this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)},scope:this,block:true})}else{this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)}},afterSlideIn:function(){this.clearAutoHide();this.isSlid=false;this.clearMonitor();this.el.setStyle("z-index","");this.panel.el.replaceClass("x-panel-floating","x-panel-collapsed");this.el.dom.style.left=this.restoreLT[0];this.el.dom.style.top=this.restoreLT[1];var a=this.panel.tools;if(a&&a.toggle){a.toggle.show()}},slideIn:function(a){if(!this.isSlid||this.el.hasActiveFx()){Ext.callback(a);return}this.isSlid=false;if(this.animFloat!==false){this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.hide();this.afterSlide();this.afterSlideIn();Ext.callback(a)},scope:this,block:true})}else{this.el.hide();this.afterSlideIn()}},slideInIf:function(a){if(!a.within(this.el)){this.slideIn()}},anchors:{west:"left",east:"right",north:"top",south:"bottom"},sanchors:{west:"l",east:"r",north:"t",south:"b"},canchors:{west:"tl-tr",east:"tr-tl",north:"tl-bl",south:"bl-tl"},getAnchor:function(){return this.anchors[this.position]},getCollapseAnchor:function(){return this.canchors[this.position]},getSlideAnchor:function(){return this.sanchors[this.position]},getAlignAdj:function(){var a=this.cmargins;switch(this.position){case"west":return[0,0];break;case"east":return[0,0];break;case"north":return[0,0];break;case"south":return[0,0];break}},getExpandAdj:function(){var b=this.collapsedEl,a=this.cmargins;switch(this.position){case"west":return[-(a.right+b.getWidth()+a.left),0];break;case"east":return[a.right+b.getWidth()+a.left,0];break;case"north":return[0,-(a.top+a.bottom+b.getHeight())];break;case"south":return[0,a.top+a.bottom+b.getHeight()];break}},destroy:function(){if(this.autoHideSlideTask&&this.autoHideSlideTask.cancel){this.autoHideSlideTask.cancel()}Ext.destroy(this.miniCollapsedEl,this.collapsedEl)}};Ext.layout.BorderLayout.SplitRegion=function(b,a,c){Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this,b,a,c);this.applyLayout=this.applyFns[c]};Ext.extend(Ext.layout.BorderLayout.SplitRegion,Ext.layout.BorderLayout.Region,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,splitSettings:{north:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.TOP,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},south:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.BOTTOM,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},east:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.RIGHT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"},west:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.LEFT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"}},applyFns:{west:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;this.panel.setPosition(c.x,c.y);var a=d.offsetWidth;b.left=(c.x+c.width-a)+"px";b.top=(c.y)+"px";b.height=Math.max(0,c.height)+"px";this.panel.setSize(c.width-a,c.height)},east:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetWidth;this.panel.setPosition(c.x+a,c.y);b.left=(c.x)+"px";b.top=(c.y)+"px";b.height=Math.max(0,c.height)+"px";this.panel.setSize(c.width-a,c.height)},north:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetHeight;this.panel.setPosition(c.x,c.y);b.left=(c.x)+"px";b.top=(c.y+c.height-a)+"px";b.width=Math.max(0,c.width)+"px";this.panel.setSize(c.width,c.height-a)},south:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetHeight;this.panel.setPosition(c.x,c.y+a);b.left=(c.x)+"px";b.top=(c.y)+"px";b.width=Math.max(0,c.width)+"px";this.panel.setSize(c.width,c.height-a)}},render:function(a,c){Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this,a,c);var d=this.position;this.splitEl=a.createChild({cls:"x-layout-split x-layout-split-"+d,html:" ",id:this.panel.id+"-xsplit"});if(this.collapseMode=="mini"){this.miniSplitEl=this.splitEl.createChild({cls:"x-layout-mini x-layout-mini-"+d,html:" "});this.miniSplitEl.addClassOnOver("x-layout-mini-over");this.miniSplitEl.on("click",this.onCollapseClick,this,{stopEvent:true})}var b=this.splitSettings[d];this.split=new Ext.SplitBar(this.splitEl.dom,c.el,b.orientation);this.split.tickSize=this.tickSize;this.split.placement=b.placement;this.split.getMaximumSize=this[b.maxFn].createDelegate(this);this.split.minSize=this.minSize||this[b.minProp];this.split.on("beforeapply",this.onSplitMove,this);this.split.useShim=this.useShim===true;this.maxSize=this.maxSize||this[b.maxProp];if(c.hidden){this.splitEl.hide()}if(this.useSplitTips){this.splitEl.dom.title=this.collapsible?this.collapsibleSplitTip:this.splitTip}if(this.collapsible){this.splitEl.on("dblclick",this.onCollapseClick,this)}},getSize:function(){if(this.isCollapsed){return this.collapsedEl.getSize()}var a=this.panel.getSize();if(this.position=="north"||this.position=="south"){a.height+=this.splitEl.dom.offsetHeight}else{a.width+=this.splitEl.dom.offsetWidth}return a},getHMaxSize:function(){var b=this.maxSize||10000;var a=this.layout.center;return Math.min(b,(this.el.getWidth()+a.el.getWidth())-a.getMinWidth())},getVMaxSize:function(){var b=this.maxSize||10000;var a=this.layout.center;return Math.min(b,(this.el.getHeight()+a.el.getHeight())-a.getMinHeight())},onSplitMove:function(b,a){var c=this.panel.getSize();this.lastSplitSize=a;if(this.position=="north"||this.position=="south"){this.panel.setSize(c.width,a);this.state.height=a}else{this.panel.setSize(a,c.height);this.state.width=a}this.layout.layout();this.panel.saveState();return false},getSplitBar:function(){return this.split},destroy:function(){Ext.destroy(this.miniSplitEl,this.split,this.splitEl);Ext.layout.BorderLayout.SplitRegion.superclass.destroy.call(this)}});Ext.Container.LAYOUTS.border=Ext.layout.BorderLayout;Ext.layout.FormLayout=Ext.extend(Ext.layout.AnchorLayout,{labelSeparator:":",trackLabels:false,type:"form",onRemove:function(d){Ext.layout.FormLayout.superclass.onRemove.call(this,d);if(this.trackLabels){d.un("show",this.onFieldShow,this);d.un("hide",this.onFieldHide,this)}var b=d.getPositionEl(),a=d.getItemCt&&d.getItemCt();if(d.rendered&&a){if(b&&b.dom){b.insertAfter(a)}Ext.destroy(a);Ext.destroyMembers(d,"label","itemCt");if(d.customItemCt){Ext.destroyMembers(d,"getItemCt","customItemCt")}}},setContainer:function(a){Ext.layout.FormLayout.superclass.setContainer.call(this,a);if(a.labelAlign){a.addClass("x-form-label-"+a.labelAlign)}if(a.hideLabels){Ext.apply(this,{labelStyle:"display:none",elementStyle:"padding-left:0;",labelAdjust:0})}else{this.labelSeparator=a.labelSeparator||this.labelSeparator;a.labelWidth=a.labelWidth||100;if(Ext.isNumber(a.labelWidth)){var b=Ext.isNumber(a.labelPad)?a.labelPad:5;Ext.apply(this,{labelAdjust:a.labelWidth+b,labelStyle:"width:"+a.labelWidth+"px;",elementStyle:"padding-left:"+(a.labelWidth+b)+"px"})}if(a.labelAlign=="top"){Ext.apply(this,{labelStyle:"width:auto;",labelAdjust:0,elementStyle:"padding-left:0;"})}}},isHide:function(a){return a.hideLabel||this.container.hideLabels},onFieldShow:function(a){a.getItemCt().removeClass("x-hide-"+a.hideMode)},onFieldHide:function(a){a.getItemCt().addClass("x-hide-"+a.hideMode)},getLabelStyle:function(e){var b="",c=[this.labelStyle,e];for(var d=0,a=c.length;d=b)||(this.cells[c]&&this.cells[c][a])){if(b&&a>=b){c++;a=0}else{a++}}return[a,c]},renderItem:function(e,a,d){if(!this.table){this.table=d.createChild(Ext.apply({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},this.tableAttrs),null,true)}if(e&&!e.rendered){e.render(this.getNextCell(e));this.configureItem(e,a)}else{if(e&&!this.isValidParent(e,d)){var b=this.getNextCell(e);b.insertBefore(e.getPositionEl().dom,null);e.container=Ext.get(b);this.configureItem(e,a)}}},isValidParent:function(b,a){return b.getPositionEl().up("table",5).dom.parentNode===(a.dom||a)}});Ext.Container.LAYOUTS.table=Ext.layout.TableLayout;Ext.layout.AbsoluteLayout=Ext.extend(Ext.layout.AnchorLayout,{extraCls:"x-abs-layout-item",type:"absolute",onLayout:function(a,b){b.position();this.paddingLeft=b.getPadding("l");this.paddingTop=b.getPadding("t");Ext.layout.AbsoluteLayout.superclass.onLayout.call(this,a,b)},adjustWidthAnchor:function(b,a){return b?b-a.getPosition(true)[0]+this.paddingLeft:b},adjustHeightAnchor:function(b,a){return b?b-a.getPosition(true)[1]+this.paddingTop:b}});Ext.Container.LAYOUTS.absolute=Ext.layout.AbsoluteLayout;Ext.layout.BoxLayout=Ext.extend(Ext.layout.ContainerLayout,{defaultMargins:{left:0,top:0,right:0,bottom:0},padding:"0",pack:"start",monitorResize:true,type:"box",scrollOffset:0,extraCls:"x-box-item",targetCls:"x-box-layout-ct",innerCls:"x-box-inner",constructor:function(a){Ext.layout.BoxLayout.superclass.constructor.call(this,a);if(Ext.isString(this.defaultMargins)){this.defaultMargins=this.parseMargins(this.defaultMargins)}},onLayout:function(a,d){Ext.layout.BoxLayout.superclass.onLayout.call(this,a,d);var b=this.getVisibleItems(a),c=this.getLayoutTargetSize();this.layoutTargetLastSize=c;this.childBoxCache=this.calculateChildBoxes(b,c);this.updateInnerCtSize(c,this.childBoxCache);this.updateChildBoxes(this.childBoxCache.boxes);this.handleTargetOverflow(c,a,d)},updateChildBoxes:function(c){for(var b=0,e=c.length;b0){r.left=o+F+(q/2)}}x+=r.height+s.bottom}return{boxes:h,meta:{maxWidth:D}}}});Ext.Container.LAYOUTS.vbox=Ext.layout.VBoxLayout;Ext.layout.HBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"top",type:"hbox",updateInnerCtSize:function(b,d){var a=b.width,c=d.meta.maxHeight+this.padding.top+this.padding.bottom;if(this.align=="stretch"){c=b.height}else{if(this.align=="middle"){c=Math.max(b.height,c)}}this.innerCt.setSize(a||undefined,c||undefined)},calculateChildBoxes:function(y,e){var m=y.length,w=this.padding,B=w.top,q=w.left,r=B+w.bottom,a=q+w.right,A=e.width-this.scrollOffset,x=e.height,g=Math.max(0,x-r),n=this.pack=="start",o=this.pack=="center",p=this.pack=="end",H=0,z=0,C=0,l=[],k,d,f,c,v,E,D,u,G,h,s;for(D=0;D0){u.top=B+h+(t/2)}}q+=u.width+v.right}return{boxes:l,meta:{maxHeight:z}}}});Ext.Container.LAYOUTS.hbox=Ext.layout.HBoxLayout;Ext.layout.ToolbarLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"toolbar",triggerWidth:18,noItemsMenuText:'
    (None)
    ',lastOverflow:false,tableHTML:['',"","",'",'","","","
    ','',"",'',"","
    ","
    ','',"","","","","","","
    ",'',"",'',"","
    ","
    ",'',"",'',"","
    ","
    ","
    "].join(""),onLayout:function(e,h){if(!this.leftTr){var g=e.buttonAlign=="center"?"center":"left";h.addClass("x-toolbar-layout-ct");h.insertHtml("beforeEnd",String.format(this.tableHTML,g));this.leftTr=h.child("tr.x-toolbar-left-row",true);this.rightTr=h.child("tr.x-toolbar-right-row",true);this.extrasTr=h.child("tr.x-toolbar-extras-row",true);if(this.hiddenItem==undefined){this.hiddenItems=[]}}var j=e.buttonAlign=="right"?this.rightTr:this.leftTr,k=e.items.items,d=0;for(var b=0,f=k.length,l;b=0&&(d=e[a]);a--){if(!d.firstChild){b.removeChild(d)}}},insertCell:function(e,b,a){var d=document.createElement("td");d.className="x-toolbar-cell";b.insertBefore(d,b.childNodes[a]||null);return d},hideItem:function(a){this.hiddenItems.push(a);a.xtbHidden=true;a.xtbWidth=a.getPositionEl().dom.parentNode.offsetWidth;a.hide()},unhideItem:function(a){a.show();a.xtbHidden=false;this.hiddenItems.remove(a)},getItemWidth:function(a){return a.hidden?(a.xtbWidth||0):a.getPositionEl().dom.parentNode.offsetWidth},fitToSize:function(j){if(this.container.enableOverflow===false){return}var b=j.dom.clientWidth,h=j.dom.firstChild.offsetWidth,l=b-this.triggerWidth,a=this.lastWidth||0,c=this.hiddenItems,e=c.length!=0,m=b>=a;this.lastWidth=b;if(h>b||(e&&m)){var k=this.container.items.items,g=k.length,d=0,n;for(var f=0;fl){if(!(n.hidden||n.xtbHidden)){this.hideItem(n)}}else{if(n.xtbHidden){this.unhideItem(n)}}}}}e=c.length!=0;if(e){this.initMore();if(!this.lastOverflow){this.container.fireEvent("overflowchange",this.container,true);this.lastOverflow=true}}else{if(this.more){this.clearMenu();this.more.destroy();delete this.more;if(this.lastOverflow){this.container.fireEvent("overflowchange",this.container,false);this.lastOverflow=false}}}},createMenuConfig:function(c,a){var b=Ext.apply({},c.initialConfig),d=c.toggleGroup;Ext.copyTo(b,c,["iconCls","icon","itemId","disabled","handler","scope","menu"]);Ext.apply(b,{text:c.overflowText||c.text,hideOnClick:a});if(d||c.enableToggle){Ext.apply(b,{group:d,checked:c.pressed,listeners:{checkchange:function(f,e){c.toggle(e)}}})}delete b.ownerCt;delete b.xtype;delete b.id;return b},addComponentToMenu:function(b,a){if(a instanceof Ext.Toolbar.Separator){b.add("-")}else{if(Ext.isFunction(a.isXType)){if(a.isXType("splitbutton")){b.add(this.createMenuConfig(a,true))}else{if(a.isXType("button")){b.add(this.createMenuConfig(a,!a.menu))}else{if(a.isXType("buttongroup")){a.items.each(function(c){this.addComponentToMenu(b,c)},this)}}}}}},clearMenu:function(){var a=this.moreMenu;if(a&&a.items){a.items.each(function(b){delete b.menu})}},beforeMoreShow:function(g){var b=this.container.items.items,a=b.length,f,e;var c=function(i,h){return i.isXType("buttongroup")&&!(h instanceof Ext.Toolbar.Separator)};this.clearMenu();g.removeAll();for(var d=0;d','','',"","")}if(f&&!f.rendered){if(Ext.isNumber(b)){b=e.dom.childNodes[b]}var d=this.getItemArgs(f);f.render(f.positionEl=b?this.itemTpl.insertBefore(b,d,true):this.itemTpl.append(e,d,true));f.positionEl.menuItemId=f.getItemId();if(!d.isMenuItem&&d.needsIcon){f.positionEl.addClass("x-menu-list-item-indent")}this.configureItem(f,b)}else{if(f&&!this.isValidParent(f,e)){if(Ext.isNumber(b)){b=e.dom.childNodes[b]}e.dom.insertBefore(f.getActionEl().dom,b||null)}}},getItemArgs:function(b){var a=b instanceof Ext.menu.Item;return{isMenuItem:a,needsIcon:!a&&(b.icon||b.iconCls),icon:b.icon||Ext.BLANK_IMAGE_URL,iconCls:"x-menu-item-icon "+(b.iconCls||""),itemId:"x-menu-el-"+b.id,itemCls:"x-menu-list-item "}},isValidParent:function(b,a){return b.el.up("li.x-menu-list-item",5).dom.parentNode===(a.dom||a)},onLayout:function(a,b){Ext.layout.MenuLayout.superclass.onLayout.call(this,a,b);this.doAutoSize()},doAutoSize:function(){var c=this.container,a=c.width;if(c.floating){if(a){c.setWidth(a)}else{if(Ext.isIE){c.setWidth(Ext.isStrict&&(Ext.isIE7||Ext.isIE8)?"auto":c.minWidth);var d=c.getEl(),b=d.dom.offsetWidth;c.setWidth(c.getLayoutTarget().getWidth()+d.getFrameWidth("lr"))}}}}});Ext.Container.LAYOUTS.menu=Ext.layout.MenuLayout;Ext.Viewport=Ext.extend(Ext.Container,{initComponent:function(){Ext.Viewport.superclass.initComponent.call(this);document.getElementsByTagName("html")[0].className+=" x-viewport";this.el=Ext.getBody();this.el.setHeight=Ext.emptyFn;this.el.setWidth=Ext.emptyFn;this.el.setSize=Ext.emptyFn;this.el.dom.scroll="no";this.allowDomMove=false;this.autoWidth=true;this.autoHeight=true;Ext.EventManager.onWindowResize(this.fireResize,this);this.renderTo=this.el},fireResize:function(a,b){this.fireEvent("resize",this,a,b,a,b)}});Ext.reg("viewport",Ext.Viewport);Ext.Panel=Ext.extend(Ext.Container,{baseCls:"x-panel",collapsedCls:"x-panel-collapsed",maskDisabled:true,animCollapse:Ext.enableFx,headerAsText:true,buttonAlign:"right",collapsed:false,collapseFirst:true,minButtonWidth:75,elements:"body",preventBodyReset:false,padding:undefined,resizeEvent:"bodyresize",toolTarget:"header",collapseEl:"bwrap",slideAnchor:"t",disabledClass:"",deferHeight:true,expandDefaults:{duration:0.25},collapseDefaults:{duration:0.25},initComponent:function(){Ext.Panel.superclass.initComponent.call(this);this.addEvents("bodyresize","titlechange","iconchange","collapse","expand","beforecollapse","beforeexpand","beforeclose","close","activate","deactivate");if(this.unstyled){this.baseCls="x-plain"}this.toolbars=[];if(this.tbar){this.elements+=",tbar";this.topToolbar=this.createToolbar(this.tbar);this.tbar=null}if(this.bbar){this.elements+=",bbar";this.bottomToolbar=this.createToolbar(this.bbar);this.bbar=null}if(this.header===true){this.elements+=",header";this.header=null}else{if(this.headerCfg||(this.title&&this.header!==false)){this.elements+=",header"}}if(this.footerCfg||this.footer===true){this.elements+=",footer";this.footer=null}if(this.buttons){this.fbar=this.buttons;this.buttons=null}if(this.fbar){this.createFbar(this.fbar)}if(this.autoLoad){this.on("render",this.doAutoLoad,this,{delay:10})}},createFbar:function(b){var a=this.minButtonWidth;this.elements+=",footer";this.fbar=this.createToolbar(b,{buttonAlign:this.buttonAlign,toolbarCls:"x-panel-fbar",enableOverflow:false,defaults:function(d){return{minWidth:d.minWidth||a}}});this.fbar.items.each(function(d){d.minWidth=d.minWidth||this.minButtonWidth},this);this.buttons=this.fbar.items.items},createToolbar:function(b,c){var a;if(Ext.isArray(b)){b={items:b}}a=b.events?Ext.apply(b,c):this.createComponent(Ext.apply({},b,c),"toolbar");this.toolbars.push(a);return a},createElement:function(a,c){if(this[a]){c.appendChild(this[a].dom);return}if(a==="bwrap"||this.elements.indexOf(a)!=-1){if(this[a+"Cfg"]){this[a]=Ext.fly(c).createChild(this[a+"Cfg"])}else{var b=document.createElement("div");b.className=this[a+"Cls"];this[a]=Ext.get(c.appendChild(b))}if(this[a+"CssClass"]){this[a].addClass(this[a+"CssClass"])}if(this[a+"Style"]){this[a].applyStyles(this[a+"Style"])}}},onRender:function(f,e){Ext.Panel.superclass.onRender.call(this,f,e);this.createClasses();var a=this.el,g=a.dom,j,h;if(this.collapsible&&!this.hideCollapseTool){this.tools=this.tools?this.tools.slice(0):[];this.tools[this.collapseFirst?"unshift":"push"]({id:"toggle",handler:this.toggleCollapse,scope:this})}if(this.tools){h=this.tools;this.elements+=(this.header!==false)?",header":""}this.tools={};a.addClass(this.baseCls);if(g.firstChild){this.header=a.down("."+this.headerCls);this.bwrap=a.down("."+this.bwrapCls);var i=this.bwrap?this.bwrap:a;this.tbar=i.down("."+this.tbarCls);this.body=i.down("."+this.bodyCls);this.bbar=i.down("."+this.bbarCls);this.footer=i.down("."+this.footerCls);this.fromMarkup=true}if(this.preventBodyReset===true){a.addClass("x-panel-reset")}if(this.cls){a.addClass(this.cls)}if(this.buttons){this.elements+=",footer"}if(this.frame){a.insertHtml("afterBegin",String.format(Ext.Element.boxMarkup,this.baseCls));this.createElement("header",g.firstChild.firstChild.firstChild);this.createElement("bwrap",g);j=this.bwrap.dom;var c=g.childNodes[1],b=g.childNodes[2];j.appendChild(c);j.appendChild(b);var k=j.firstChild.firstChild.firstChild;this.createElement("tbar",k);this.createElement("body",k);this.createElement("bbar",k);this.createElement("footer",j.lastChild.firstChild.firstChild);if(!this.footer){this.bwrap.dom.lastChild.className+=" x-panel-nofooter"}this.ft=Ext.get(this.bwrap.dom.lastChild);this.mc=Ext.get(k)}else{this.createElement("header",g);this.createElement("bwrap",g);j=this.bwrap.dom;this.createElement("tbar",j);this.createElement("body",j);this.createElement("bbar",j);this.createElement("footer",j);if(!this.header){this.body.addClass(this.bodyCls+"-noheader");if(this.tbar){this.tbar.addClass(this.tbarCls+"-noheader")}}}if(Ext.isDefined(this.padding)){this.body.setStyle("padding",this.body.addUnits(this.padding))}if(this.border===false){this.el.addClass(this.baseCls+"-noborder");this.body.addClass(this.bodyCls+"-noborder");if(this.header){this.header.addClass(this.headerCls+"-noborder")}if(this.footer){this.footer.addClass(this.footerCls+"-noborder")}if(this.tbar){this.tbar.addClass(this.tbarCls+"-noborder")}if(this.bbar){this.bbar.addClass(this.bbarCls+"-noborder")}}if(this.bodyBorder===false){this.body.addClass(this.bodyCls+"-noborder")}this.bwrap.enableDisplayMode("block");if(this.header){this.header.unselectable();if(this.headerAsText){this.header.dom.innerHTML=''+this.header.dom.innerHTML+"";if(this.iconCls){this.setIconClass(this.iconCls)}}}if(this.floating){this.makeFloating(this.floating)}if(this.collapsible&&this.titleCollapse&&this.header){this.mon(this.header,"click",this.toggleCollapse,this);this.header.setStyle("cursor","pointer")}if(h){this.addTool.apply(this,h)}if(this.fbar){this.footer.addClass("x-panel-btns");this.fbar.ownerCt=this;this.fbar.render(this.footer);this.footer.createChild({cls:"x-clear"})}if(this.tbar&&this.topToolbar){this.topToolbar.ownerCt=this;this.topToolbar.render(this.tbar)}if(this.bbar&&this.bottomToolbar){this.bottomToolbar.ownerCt=this;this.bottomToolbar.render(this.bbar)}},setIconClass:function(b){var a=this.iconCls;this.iconCls=b;if(this.rendered&&this.header){if(this.frame){this.header.addClass("x-panel-icon");this.header.replaceClass(a,this.iconCls)}else{var e=this.header,c=e.child("img.x-panel-inline-icon");if(c){Ext.fly(c).replaceClass(a,this.iconCls)}else{var d=e.child("span."+this.headerTextCls);if(d){Ext.DomHelper.insertBefore(d.dom,{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-panel-inline-icon "+this.iconCls})}}}}this.fireEvent("iconchange",this,b,a)},makeFloating:function(a){this.floating=true;this.el=new Ext.Layer(Ext.apply({},a,{shadow:Ext.isDefined(this.shadow)?this.shadow:"sides",shadowOffset:this.shadowOffset,constrain:false,shim:this.shim===false?false:undefined}),this.el)},getTopToolbar:function(){return this.topToolbar},getBottomToolbar:function(){return this.bottomToolbar},getFooterToolbar:function(){return this.fbar},addButton:function(a,c,b){if(!this.fbar){this.createFbar([])}if(c){if(Ext.isString(a)){a={text:a}}a=Ext.apply({handler:c,scope:b},a)}return this.fbar.add(a)},addTool:function(){if(!this.rendered){if(!this.tools){this.tools=[]}Ext.each(arguments,function(a){this.tools.push(a)},this);return}if(!this[this.toolTarget]){return}if(!this.toolTemplate){var g=new Ext.Template('
     
    ');g.disableFormats=true;g.compile();Ext.Panel.prototype.toolTemplate=g}for(var f=0,d=arguments,c=d.length;f0){Ext.each(this.toolbars,function(c){c.doLayout(undefined,a)});this.syncHeight()}},syncHeight:function(){var b=this.toolbarHeight,c=this.body,a=this.lastSize.height,d;if(this.autoHeight||!Ext.isDefined(a)||a=="auto"){return}if(b!=this.getToolbarHeight()){b=Math.max(0,a-this.getFrameHeight());c.setHeight(b);d=c.getSize();this.toolbarHeight=this.getToolbarHeight();this.onBodyResize(d.width,d.height)}},onShow:function(){if(this.floating){return this.el.show()}Ext.Panel.superclass.onShow.call(this)},onHide:function(){if(this.floating){return this.el.hide()}Ext.Panel.superclass.onHide.call(this)},createToolHandler:function(c,a,d,b){return function(f){c.removeClass(d);if(a.stopEvent!==false){f.stopEvent()}if(a.handler){a.handler.call(a.scope||c,f,c,b,a)}}},afterRender:function(){if(this.floating&&!this.hidden){this.el.show()}if(this.title){this.setTitle(this.title)}Ext.Panel.superclass.afterRender.call(this);if(this.collapsed){this.collapsed=false;this.collapse(false)}this.initEvents()},getKeyMap:function(){if(!this.keyMap){this.keyMap=new Ext.KeyMap(this.el,this.keys)}return this.keyMap},initEvents:function(){if(this.keys){this.getKeyMap()}if(this.draggable){this.initDraggable()}if(this.toolbars.length>0){Ext.each(this.toolbars,function(a){a.doLayout();a.on({scope:this,afterlayout:this.syncHeight,remove:this.syncHeight})},this);this.syncHeight()}},initDraggable:function(){this.dd=new Ext.Panel.DD(this,Ext.isBoolean(this.draggable)?null:this.draggable)},beforeEffect:function(a){if(this.floating){this.el.beforeAction()}if(a!==false){this.el.addClass("x-panel-animated")}},afterEffect:function(a){this.syncShadow();this.el.removeClass("x-panel-animated")},createEffect:function(c,b,d){var e={scope:d,block:true};if(c===true){e.callback=b;return e}else{if(!c.callback){e.callback=b}else{e.callback=function(){b.call(d);Ext.callback(c.callback,c.scope)}}}return Ext.applyIf(e,c)},collapse:function(b){if(this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforecollapse",this,b)===false){return}var a=b===true||(b!==false&&this.animCollapse);this.beforeEffect(a);this.onCollapse(a,b);return this},onCollapse:function(a,b){if(a){this[this.collapseEl].slideOut(this.slideAnchor,Ext.apply(this.createEffect(b||true,this.afterCollapse,this),this.collapseDefaults))}else{this[this.collapseEl].hide(this.hideMode);this.afterCollapse(false)}},afterCollapse:function(a){this.collapsed=true;this.el.addClass(this.collapsedCls);if(a!==false){this[this.collapseEl].hide(this.hideMode)}this.afterEffect(a);this.cascade(function(b){if(b.lastSize){b.lastSize={width:0,height:0}}});this.fireEvent("collapse",this)},expand:function(b){if(!this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforeexpand",this,b)===false){return}var a=b===true||(b!==false&&this.animCollapse);this.el.removeClass(this.collapsedCls);this.beforeEffect(a);this.onExpand(a,b);return this},onExpand:function(a,b){if(a){this[this.collapseEl].slideIn(this.slideAnchor,Ext.apply(this.createEffect(b||true,this.afterExpand,this),this.expandDefaults))}else{this[this.collapseEl].show(this.hideMode);this.afterExpand(false)}},afterExpand:function(a){this.collapsed=false;if(a!==false){this[this.collapseEl].show(this.hideMode)}this.afterEffect(a);if(this.deferLayout){delete this.deferLayout;this.doLayout(true)}this.fireEvent("expand",this)},toggleCollapse:function(a){this[this.collapsed?"expand":"collapse"](a);return this},onDisable:function(){if(this.rendered&&this.maskDisabled){this.el.mask()}Ext.Panel.superclass.onDisable.call(this)},onEnable:function(){if(this.rendered&&this.maskDisabled){this.el.unmask()}Ext.Panel.superclass.onEnable.call(this)},onResize:function(f,d,c,e){var a=f,b=d;if(Ext.isDefined(a)||Ext.isDefined(b)){if(!this.collapsed){if(Ext.isNumber(a)){this.body.setWidth(a=this.adjustBodyWidth(a-this.getFrameWidth()))}else{if(a=="auto"){a=this.body.setWidth("auto").dom.offsetWidth}else{a=this.body.dom.offsetWidth}}if(this.tbar){this.tbar.setWidth(a);if(this.topToolbar){this.topToolbar.setSize(a)}}if(this.bbar){this.bbar.setWidth(a);if(this.bottomToolbar){this.bottomToolbar.setSize(a);if(Ext.isIE){this.bbar.setStyle("position","static");this.bbar.setStyle("position","")}}}if(this.footer){this.footer.setWidth(a);if(this.fbar){this.fbar.setSize(Ext.isIE?(a-this.footer.getFrameWidth("lr")):"auto")}}if(Ext.isNumber(b)){b=Math.max(0,b-this.getFrameHeight());this.body.setHeight(b)}else{if(b=="auto"){this.body.setHeight(b)}}if(this.disabled&&this.el._mask){this.el._mask.setSize(this.el.dom.clientWidth,this.el.getHeight())}}else{this.queuedBodySize={width:a,height:b};if(!this.queuedExpand&&this.allowQueuedExpand!==false){this.queuedExpand=true;this.on("expand",function(){delete this.queuedExpand;this.onResize(this.queuedBodySize.width,this.queuedBodySize.height)},this,{single:true})}}this.onBodyResize(a,b)}this.syncShadow();Ext.Panel.superclass.onResize.call(this,f,d,c,e)},onBodyResize:function(a,b){this.fireEvent("bodyresize",this,a,b)},getToolbarHeight:function(){var a=0;if(this.rendered){Ext.each(this.toolbars,function(b){a+=b.getHeight()},this)}return a},adjustBodyHeight:function(a){return a},adjustBodyWidth:function(a){return a},onPosition:function(){this.syncShadow()},getFrameWidth:function(){var b=this.el.getFrameWidth("lr")+this.bwrap.getFrameWidth("lr");if(this.frame){var a=this.bwrap.dom.firstChild;b+=(Ext.fly(a).getFrameWidth("l")+Ext.fly(a.firstChild).getFrameWidth("r"));b+=this.mc.getFrameWidth("lr")}return b},getFrameHeight:function(){var a=Math.max(0,this.getHeight()-this.body.getHeight());if(isNaN(a)){a=0}return a},getInnerWidth:function(){return this.getSize().width-this.getFrameWidth()},getInnerHeight:function(){return this.body.getHeight()},syncShadow:function(){if(this.floating){this.el.sync(true)}},getLayoutTarget:function(){return this.body},getContentTarget:function(){return this.body},setTitle:function(b,a){this.title=b;if(this.header&&this.headerAsText){this.header.child("span").update(b)}if(a){this.setIconClass(a)}this.fireEvent("titlechange",this,b);return this},getUpdater:function(){return this.body.getUpdater()},load:function(){var a=this.body.getUpdater();a.update.apply(a,arguments);return this},beforeDestroy:function(){Ext.Panel.superclass.beforeDestroy.call(this);if(this.header){this.header.removeAllListeners()}if(this.tools){for(var a in this.tools){Ext.destroy(this.tools[a])}}if(this.toolbars.length>0){Ext.each(this.toolbars,function(b){b.un("afterlayout",this.syncHeight,this);b.un("remove",this.syncHeight,this)},this)}if(Ext.isArray(this.buttons)){while(this.buttons.length){Ext.destroy(this.buttons[0])}}if(this.rendered){Ext.destroy(this.ft,this.header,this.footer,this.toolbars,this.tbar,this.bbar,this.body,this.mc,this.bwrap);if(this.fbar){Ext.destroy(this.fbar,this.fbar.el)}}else{Ext.destroy(this.topToolbar,this.bottomToolbar)}},createClasses:function(){this.headerCls=this.baseCls+"-header";this.headerTextCls=this.baseCls+"-header-text";this.bwrapCls=this.baseCls+"-bwrap";this.tbarCls=this.baseCls+"-tbar";this.bodyCls=this.baseCls+"-body";this.bbarCls=this.baseCls+"-bbar";this.footerCls=this.baseCls+"-footer"},createGhost:function(a,e,b){var d=document.createElement("div");d.className="x-panel-ghost "+(a?a:"");if(this.header){d.appendChild(this.el.dom.firstChild.cloneNode(true))}Ext.fly(d.appendChild(document.createElement("ul"))).setHeight(this.bwrap.getHeight());d.style.width=this.el.dom.offsetWidth+"px";if(!b){this.container.dom.appendChild(d)}else{Ext.getDom(b).appendChild(d)}if(e!==false&&this.el.useShim!==false){var c=new Ext.Layer({shadow:false,useDisplay:true,constrain:false},d);c.show();return c}else{return new Ext.Element(d)}},doAutoLoad:function(){var a=this.body.getUpdater();if(this.renderer){a.setRenderer(this.renderer)}a.update(Ext.isObject(this.autoLoad)?this.autoLoad:{url:this.autoLoad})},getTool:function(a){return this.tools[a]}});Ext.reg("panel",Ext.Panel);Ext.Editor=function(b,a){if(b.field){this.field=Ext.create(b.field,"textfield");a=Ext.apply({},b);delete a.field}else{this.field=b}Ext.Editor.superclass.constructor.call(this,a)};Ext.extend(Ext.Editor,Ext.Component,{allowBlur:true,value:"",alignment:"c-c?",offsets:[0,0],shadow:"frame",constrain:false,swallowKeys:true,completeOnEnter:true,cancelOnEsc:true,updateEl:false,initComponent:function(){Ext.Editor.superclass.initComponent.call(this);this.addEvents("beforestartedit","startedit","beforecomplete","complete","canceledit","specialkey")},onRender:function(b,a){this.el=new Ext.Layer({shadow:this.shadow,cls:"x-editor",parentEl:b,shim:this.shim,shadowOffset:this.shadowOffset||4,id:this.id,constrain:this.constrain});if(this.zIndex){this.el.setZIndex(this.zIndex)}this.el.setStyle("overflow",Ext.isGecko?"auto":"hidden");if(this.field.msgTarget!="title"){this.field.msgTarget="qtip"}this.field.inEditor=true;this.mon(this.field,{scope:this,blur:this.onBlur,specialkey:this.onSpecialKey});if(this.field.grow){this.mon(this.field,"autosize",this.el.sync,this.el,{delay:1})}this.field.render(this.el).show();this.field.getEl().dom.name="";if(this.swallowKeys){this.field.el.swallowEvent(["keypress","keydown"])}},onSpecialKey:function(f,d){var b=d.getKey(),a=this.completeOnEnter&&b==d.ENTER,c=this.cancelOnEsc&&b==d.ESC;if(a||c){d.stopEvent();if(a){this.completeEdit()}else{this.cancelEdit()}if(f.triggerBlur){f.triggerBlur()}}this.fireEvent("specialkey",f,d)},startEdit:function(b,c){if(this.editing){this.completeEdit()}this.boundEl=Ext.get(b);var a=c!==undefined?c:this.boundEl.dom.innerHTML;if(!this.rendered){this.render(this.parentEl||document.body)}if(this.fireEvent("beforestartedit",this,this.boundEl,a)!==false){this.startValue=a;this.field.reset();this.field.setValue(a);this.realign(true);this.editing=true;this.show()}},doAutoSize:function(){if(this.autoSize){var b=this.boundEl.getSize(),a=this.field.getSize();switch(this.autoSize){case"width":this.setSize(b.width,a.height);break;case"height":this.setSize(a.width,b.height);break;case"none":this.setSize(a.width,a.height);break;default:this.setSize(b.width,b.height)}}},setSize:function(a,b){delete this.field.lastSize;this.field.setSize(a,b);if(this.el){if(Ext.isGecko2||Ext.isOpera){this.el.setSize(a,b)}this.el.sync()}},realign:function(a){if(a===true){this.doAutoSize()}this.el.alignTo(this.boundEl,this.alignment,this.offsets)},completeEdit:function(a){if(!this.editing){return}if(this.field.assertValue){this.field.assertValue()}var b=this.getValue();if(!this.field.isValid()){if(this.revertInvalid!==false){this.cancelEdit(a)}return}if(String(b)===String(this.startValue)&&this.ignoreNoChange){this.hideEdit(a);return}if(this.fireEvent("beforecomplete",this,b,this.startValue)!==false){b=this.getValue();if(this.updateEl&&this.boundEl){this.boundEl.update(b)}this.hideEdit(a);this.fireEvent("complete",this,b,this.startValue)}},onShow:function(){this.el.show();if(this.hideEl!==false){this.boundEl.hide()}this.field.show().focus(false,true);this.fireEvent("startedit",this.boundEl,this.startValue)},cancelEdit:function(a){if(this.editing){var b=this.getValue();this.setValue(this.startValue);this.hideEdit(a);this.fireEvent("canceledit",this,b,this.startValue)}},hideEdit:function(a){if(a!==true){this.editing=false;this.hide()}},onBlur:function(){if(this.allowBlur===true&&this.editing&&this.selectSameEditor!==true){this.completeEdit()}},onHide:function(){if(this.editing){this.completeEdit();return}this.field.blur();if(this.field.collapse){this.field.collapse()}this.el.hide();if(this.hideEl!==false){this.boundEl.show()}},setValue:function(a){this.field.setValue(a)},getValue:function(){return this.field.getValue()},beforeDestroy:function(){Ext.destroyMembers(this,"field");delete this.parentEl;delete this.boundEl}});Ext.reg("editor",Ext.Editor);Ext.ColorPalette=Ext.extend(Ext.Component,{itemCls:"x-color-palette",value:null,clickEvent:"click",ctype:"Ext.ColorPalette",allowReselect:false,colors:["000000","993300","333300","003300","003366","000080","333399","333333","800000","FF6600","808000","008000","008080","0000FF","666699","808080","FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","969696","FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0","FF99CC","FFCC99","FFFF99","CCFFCC","CCFFFF","99CCFF","CC99FF","FFFFFF"],initComponent:function(){Ext.ColorPalette.superclass.initComponent.call(this);this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope,true)}},onRender:function(b,a){this.autoEl={tag:"div",cls:this.itemCls};Ext.ColorPalette.superclass.onRender.call(this,b,a);var c=this.tpl||new Ext.XTemplate(' ');c.overwrite(this.el,this.colors);this.mon(this.el,this.clickEvent,this.handleClick,this,{delegate:"a"});if(this.clickEvent!="click"){this.mon(this.el,"click",Ext.emptyFn,this,{delegate:"a",preventDefault:true})}},afterRender:function(){Ext.ColorPalette.superclass.afterRender.call(this);if(this.value){var a=this.value;this.value=null;this.select(a)}},handleClick:function(b,a){b.preventDefault();if(!this.disabled){var d=a.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];this.select(d.toUpperCase())}},select:function(a){a=a.replace("#","");if(a!=this.value||this.allowReselect){var b=this.el;if(this.value){b.child("a.color-"+this.value).removeClass("x-color-palette-sel")}b.child("a.color-"+a).addClass("x-color-palette-sel");this.value=a;this.fireEvent("select",this,a)}}});Ext.reg("colorpalette",Ext.ColorPalette);Ext.DatePicker=Ext.extend(Ext.BoxComponent,{todayText:"Today",okText:" OK ",cancelText:"Cancel",todayTip:"{0} (Spacebar)",minText:"This date is before the minimum date",maxText:"This date is after the maximum date",format:"m/d/y",disabledDaysText:"Disabled",disabledDatesText:"Disabled",monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:"Next Month (Control+Right)",prevText:"Previous Month (Control+Left)",monthYearText:"Choose a month (Control+Up/Down to move years)",startDay:0,showToday:true,focusOnSelect:true,initHour:12,initComponent:function(){Ext.DatePicker.superclass.initComponent.call(this);this.value=this.value?this.value.clearTime(true):new Date().clearTime();this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope||this)}this.initDisabledDays()},initDisabledDays:function(){if(!this.disabledDatesRE&&this.disabledDates){var b=this.disabledDates,a=b.length-1,c="(?:";Ext.each(b,function(f,e){c+=Ext.isDate(f)?"^"+Ext.escapeRe(f.dateFormat(this.format))+"$":b[e];if(e!=a){c+="|"}},this);this.disabledDatesRE=new RegExp(c+")")}},setDisabledDates:function(a){if(Ext.isArray(a)){this.disabledDates=a;this.disabledDatesRE=null}else{this.disabledDatesRE=a}this.initDisabledDays();this.update(this.value,true)},setDisabledDays:function(a){this.disabledDays=a;this.update(this.value,true)},setMinDate:function(a){this.minDate=a;this.update(this.value,true)},setMaxDate:function(a){this.maxDate=a;this.update(this.value,true)},setValue:function(a){this.value=a.clearTime(true);this.update(this.value)},getValue:function(){return this.value},focus:function(){this.update(this.activeDate)},onEnable:function(a){Ext.DatePicker.superclass.onEnable.call(this);this.doDisabled(false);this.update(a?this.value:this.activeDate);if(Ext.isIE){this.el.repaint()}},onDisable:function(){Ext.DatePicker.superclass.onDisable.call(this);this.doDisabled(true);if(Ext.isIE&&!Ext.isIE8){Ext.each([].concat(this.textNodes,this.el.query("th span")),function(a){Ext.fly(a).repaint()})}},doDisabled:function(a){this.keyNav.setDisabled(a);this.prevRepeater.setDisabled(a);this.nextRepeater.setDisabled(a);if(this.showToday){this.todayKeyListener.setDisabled(a);this.todayBtn.setDisabled(a)}},onRender:function(e,b){var a=['','','",this.showToday?'':"",'
      
    '],c=this.dayNames,g;for(g=0;g<7;g++){var j=this.startDay+g;if(j>6){j=j-7}a.push("")}a[a.length]="";for(g=0;g<42;g++){if(g%7===0&&g!==0){a[a.length]=""}a[a.length]=''}a.push("
    ",c[j].substr(0,1),"
    ');var h=document.createElement("div");h.className="x-date-picker";h.innerHTML=a.join("");e.dom.insertBefore(h,b);this.el=Ext.get(h);this.eventEl=Ext.get(h.firstChild);this.prevRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-left a"),{handler:this.showPrevMonth,scope:this,preventDefault:true,stopDefault:true});this.nextRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-right a"),{handler:this.showNextMonth,scope:this,preventDefault:true,stopDefault:true});this.monthPicker=this.el.down("div.x-date-mp");this.monthPicker.enableDisplayMode("block");this.keyNav=new Ext.KeyNav(this.eventEl,{left:function(d){if(d.ctrlKey){this.showPrevMonth()}else{this.update(this.activeDate.add("d",-1))}},right:function(d){if(d.ctrlKey){this.showNextMonth()}else{this.update(this.activeDate.add("d",1))}},up:function(d){if(d.ctrlKey){this.showNextYear()}else{this.update(this.activeDate.add("d",-7))}},down:function(d){if(d.ctrlKey){this.showPrevYear()}else{this.update(this.activeDate.add("d",7))}},pageUp:function(d){this.showNextMonth()},pageDown:function(d){this.showPrevMonth()},enter:function(d){d.stopPropagation();return true},scope:this});this.el.unselectable();this.cells=this.el.select("table.x-date-inner tbody td");this.textNodes=this.el.query("table.x-date-inner tbody span");this.mbtn=new Ext.Button({text:" ",tooltip:this.monthYearText,renderTo:this.el.child("td.x-date-middle",true)});this.mbtn.el.child("em").addClass("x-btn-arrow");if(this.showToday){this.todayKeyListener=this.eventEl.addKeyListener(Ext.EventObject.SPACE,this.selectToday,this);var f=(new Date()).dateFormat(this.format);this.todayBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom",true),text:String.format(this.todayText,f),tooltip:String.format(this.todayTip,f),handler:this.selectToday,scope:this})}this.mon(this.eventEl,"mousewheel",this.handleMouseWheel,this);this.mon(this.eventEl,"click",this.handleDateClick,this,{delegate:"a.x-date-date"});this.mon(this.mbtn,"click",this.showMonthPicker,this);this.onEnable(true)},createMonthPicker:function(){if(!this.monthPicker.dom.firstChild){var a=[''];for(var b=0;b<6;b++){a.push('",'",b===0?'':'')}a.push('","
    ',Date.getShortMonthName(b),"',Date.getShortMonthName(b+6),"
    ");this.monthPicker.update(a.join(""));this.mon(this.monthPicker,"click",this.onMonthClick,this);this.mon(this.monthPicker,"dblclick",this.onMonthDblClick,this);this.mpMonths=this.monthPicker.select("td.x-date-mp-month");this.mpYears=this.monthPicker.select("td.x-date-mp-year");this.mpMonths.each(function(c,d,e){e+=1;if((e%2)===0){c.dom.xmonth=5+Math.round(e*0.5)}else{c.dom.xmonth=Math.round((e-1)*0.5)}})}},showMonthPicker:function(){if(!this.disabled){this.createMonthPicker();var a=this.el.getSize();this.monthPicker.setSize(a);this.monthPicker.child("table").setSize(a);this.mpSelMonth=(this.activeDate||this.value).getMonth();this.updateMPMonth(this.mpSelMonth);this.mpSelYear=(this.activeDate||this.value).getFullYear();this.updateMPYear(this.mpSelYear);this.monthPicker.slideIn("t",{duration:0.2})}},updateMPYear:function(e){this.mpyear=e;var c=this.mpYears.elements;for(var b=1;b<=10;b++){var d=c[b-1],a;if((b%2)===0){a=e+Math.round(b*0.5);d.firstChild.innerHTML=a;d.xyear=a}else{a=e-(5-Math.round(b*0.5));d.firstChild.innerHTML=a;d.xyear=a}this.mpYears.item(b-1)[a==this.mpSelYear?"addClass":"removeClass"]("x-date-mp-sel")}},updateMPMonth:function(a){this.mpMonths.each(function(b,c,d){b[b.dom.xmonth==a?"addClass":"removeClass"]("x-date-mp-sel")})},selectMPMonth:function(a){},onMonthClick:function(f,b){f.stopEvent();var c=new Ext.Element(b),a;if(c.is("button.x-date-mp-cancel")){this.hideMonthPicker()}else{if(c.is("button.x-date-mp-ok")){var g=new Date(this.mpSelYear,this.mpSelMonth,(this.activeDate||this.value).getDate());if(g.getMonth()!=this.mpSelMonth){g=new Date(this.mpSelYear,this.mpSelMonth,1).getLastDateOfMonth()}this.update(g);this.hideMonthPicker()}else{if((a=c.up("td.x-date-mp-month",2))){this.mpMonths.removeClass("x-date-mp-sel");a.addClass("x-date-mp-sel");this.mpSelMonth=a.dom.xmonth}else{if((a=c.up("td.x-date-mp-year",2))){this.mpYears.removeClass("x-date-mp-sel");a.addClass("x-date-mp-sel");this.mpSelYear=a.dom.xyear}else{if(c.is("a.x-date-mp-prev")){this.updateMPYear(this.mpyear-10)}else{if(c.is("a.x-date-mp-next")){this.updateMPYear(this.mpyear+10)}}}}}}},onMonthDblClick:function(d,b){d.stopEvent();var c=new Ext.Element(b),a;if((a=c.up("td.x-date-mp-month",2))){this.update(new Date(this.mpSelYear,a.dom.xmonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}else{if((a=c.up("td.x-date-mp-year",2))){this.update(new Date(a.dom.xyear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}}},hideMonthPicker:function(a){if(this.monthPicker){if(a===true){this.monthPicker.hide()}else{this.monthPicker.slideOut("t",{duration:0.2})}}},showPrevMonth:function(a){this.update(this.activeDate.add("mo",-1))},showNextMonth:function(a){this.update(this.activeDate.add("mo",1))},showPrevYear:function(){this.update(this.activeDate.add("y",-1))},showNextYear:function(){this.update(this.activeDate.add("y",1))},handleMouseWheel:function(a){a.stopEvent();if(!this.disabled){var b=a.getWheelDelta();if(b>0){this.showPrevMonth()}else{if(b<0){this.showNextMonth()}}}},handleDateClick:function(b,a){b.stopEvent();if(!this.disabled&&a.dateValue&&!Ext.fly(a.parentNode).hasClass("x-date-disabled")){this.cancelFocus=this.focusOnSelect===false;this.setValue(new Date(a.dateValue));delete this.cancelFocus;this.fireEvent("select",this,this.value)}},selectToday:function(){if(this.todayBtn&&!this.todayBtn.disabled){this.setValue(new Date().clearTime());this.fireEvent("select",this,this.value)}},update:function(F,z){if(this.rendered){var a=this.activeDate,o=this.isVisible();this.activeDate=F;if(!z&&a&&this.el){var n=F.getTime();if(a.getMonth()==F.getMonth()&&a.getFullYear()==F.getFullYear()){this.cells.removeClass("x-date-selected");this.cells.each(function(d){if(d.dom.firstChild.dateValue==n){d.addClass("x-date-selected");if(o&&!this.cancelFocus){Ext.fly(d.dom.firstChild).focus(50)}return false}},this);return}}var j=F.getDaysInMonth(),p=F.getFirstDateOfMonth(),f=p.getDay()-this.startDay;if(f<0){f+=7}j+=f;var A=F.add("mo",-1),g=A.getDaysInMonth()-f,e=this.cells.elements,q=this.textNodes,C=(new Date(A.getFullYear(),A.getMonth(),g,this.initHour)),B=new Date().clearTime().getTime(),u=F.clearTime(true).getTime(),s=this.minDate?this.minDate.clearTime(true):Number.NEGATIVE_INFINITY,x=this.maxDate?this.maxDate.clearTime(true):Number.POSITIVE_INFINITY,E=this.disabledDatesRE,r=this.disabledDatesText,H=this.disabledDays?this.disabledDays.join(""):false,D=this.disabledDaysText,y=this.format;if(this.showToday){var l=new Date().clearTime(),c=(lx||(E&&y&&E.test(l.dateFormat(y)))||(H&&H.indexOf(l.getDay())!=-1));if(!this.disabled){this.todayBtn.setDisabled(c);this.todayKeyListener[c?"disable":"enable"]()}}var k=function(I,d){d.title="";var i=C.clearTime(true).getTime();d.firstChild.dateValue=i;if(i==B){d.className+=" x-date-today";d.title=I.todayText}if(i==u){d.className+=" x-date-selected";if(o){Ext.fly(d.firstChild).focus(50)}}if(ix){d.className=" x-date-disabled";d.title=I.maxText;return}if(H){if(H.indexOf(C.getDay())!=-1){d.title=D;d.className=" x-date-disabled"}}if(E&&y){var w=C.dateFormat(y);if(E.test(w)){d.title=r.replace("%0",w);d.className=" x-date-disabled"}}};var v=0;for(;v=a.value){d=a.value}}c.setValue(b,d,false);c.fireEvent("drag",c,f,this)},getNewValue:function(){var a=this.slider,b=a.innerEl.translatePoints(this.tracker.getXY());return Ext.util.Format.round(a.reverseValue(b.left),a.decimalPrecision)},onDragEnd:function(c){var a=this.slider,b=this.value;this.el.removeClass("x-slider-thumb-drag");this.dragging=false;a.fireEvent("dragend",a,c);if(this.dragStartValue!=b){a.fireEvent("changecomplete",a,b,this)}}});Ext.slider.MultiSlider=Ext.extend(Ext.BoxComponent,{vertical:false,minValue:0,maxValue:100,decimalPrecision:0,keyIncrement:1,increment:0,clickRange:[5,15],clickToChange:true,animate:true,dragging:false,constrainThumbs:true,topThumbZIndex:10000,initComponent:function(){if(!Ext.isDefined(this.value)){this.value=this.minValue}this.thumbs=[];Ext.slider.MultiSlider.superclass.initComponent.call(this);this.keyIncrement=Math.max(this.increment,this.keyIncrement);this.addEvents("beforechange","change","changecomplete","dragstart","drag","dragend");if(this.values==undefined||Ext.isEmpty(this.values)){this.values=[0]}var a=this.values;for(var b=0;bthis.clickRange[0]&&c.top=c){d+=c}else{if(a*2<-c){d-=c}}}return d.constrain(this.minValue,this.maxValue)},afterRender:function(){Ext.slider.MultiSlider.superclass.afterRender.apply(this,arguments);for(var c=0;cb){this.thumbs[a].value=b}}},setValue:function(d,c,b,f){var a=this.thumbs[d],e=a.el;c=this.normalizeValue(c);if(c!==a.value&&this.fireEvent("beforechange",this,c,a.value)!==false){a.value=c;this.moveThumb(d,this.translateValue(c),b!==false);this.fireEvent("change",this,c,a);if(f){this.fireEvent("changecomplete",this,c,a)}}},translateValue:function(a){var b=this.getRatio();return(a*b)-(this.minValue*b)-this.halfThumb},reverseValue:function(b){var a=this.getRatio();return(b+(this.minValue*a))/a},moveThumb:function(d,c,b){var a=this.thumbs[d].el;if(!b||this.animate===false){a.setLeft(c)}else{a.shift({left:c,stopFx:true,duration:0.35})}},focus:function(){this.focusEl.focus(10)},onResize:function(c,e){var b=this.thumbs,a=b.length,d=0;for(;dthis.clickRange[0]&&c.left','
    ','
    ','
    ',"
     
    ","
    ","
    ",'
    ',"
     
    ","
    ","
    ","");this.el=a?c.insertBefore(a,{cls:this.baseCls},true):c.append(d,{cls:this.baseCls},true);if(this.id){this.el.dom.id=this.id}var b=this.el.dom.firstChild;this.progressBar=Ext.get(b.firstChild);if(this.textEl){this.textEl=Ext.get(this.textEl);delete this.textTopEl}else{this.textTopEl=Ext.get(this.progressBar.dom.firstChild);var e=Ext.get(b.childNodes[1]);this.textTopEl.setStyle("z-index",99).addClass("x-hidden");this.textEl=new Ext.CompositeElement([this.textTopEl.dom.firstChild,e.dom.firstChild]);this.textEl.setWidth(b.offsetWidth)}this.progressBar.setHeight(b.offsetHeight)},afterRender:function(){Ext.ProgressBar.superclass.afterRender.call(this);if(this.value){this.updateProgress(this.value,this.text)}else{this.updateText(this.text)}},updateProgress:function(c,d,b){this.value=c||0;if(d){this.updateText(d)}if(this.rendered&&!this.isDestroyed){var a=Math.floor(c*this.el.dom.firstChild.offsetWidth);this.progressBar.setWidth(a,b===true||(b!==false&&this.animate));if(this.textTopEl){this.textTopEl.removeClass("x-hidden").setWidth(a)}}this.fireEvent("update",this,c,d);return this},wait:function(b){if(!this.waitTimer){var a=this;b=b||{};this.updateText(b.text);this.waitTimer=Ext.TaskMgr.start({run:function(c){var d=b.increment||10;c-=1;this.updateProgress(((((c+d)%d)+1)*(100/d))*0.01,null,b.animate)},interval:b.interval||1000,duration:b.duration,onStop:function(){if(b.fn){b.fn.apply(b.scope||this)}this.reset()},scope:a})}return this},isWaiting:function(){return this.waitTimer!==null},updateText:function(a){this.text=a||" ";if(this.rendered){this.textEl.update(this.text)}return this},syncProgressBar:function(){if(this.value){this.updateProgress(this.value,this.text)}return this},setSize:function(a,c){Ext.ProgressBar.superclass.setSize.call(this,a,c);if(this.textTopEl){var b=this.el.dom.firstChild;this.textEl.setSize(b.offsetWidth,b.offsetHeight)}this.syncProgressBar();return this},reset:function(a){this.updateProgress(0);if(this.textTopEl){this.textTopEl.addClass("x-hidden")}this.clearTimer();if(a===true){this.hide()}return this},clearTimer:function(){if(this.waitTimer){this.waitTimer.onStop=null;Ext.TaskMgr.stop(this.waitTimer);this.waitTimer=null}},onDestroy:function(){this.clearTimer();if(this.rendered){if(this.textEl.isComposite){this.textEl.clear()}Ext.destroyMembers(this,"textEl","progressBar","textTopEl")}Ext.ProgressBar.superclass.onDestroy.call(this)}});Ext.reg("progress",Ext.ProgressBar); \ No newline at end of file +Ext.ComponentMgr=function(){var c=new Ext.util.MixedCollection();var b={};var a={};return{register:function(d){c.add(d)},unregister:function(d){c.remove(d)},get:function(d){return c.get(d)},onAvailable:function(f,e,d){c.on("add",function(g,h){if(h.id==f){e.call(d||h,h);c.un("add",e,d)}})},all:c,types:b,ptypes:a,isRegistered:function(d){return b[d]!==undefined},isPluginRegistered:function(d){return a[d]!==undefined},registerType:function(e,d){b[e]=d;d.xtype=e},create:function(d,e){return d.render?d:new b[d.xtype||e](d)},registerPlugin:function(e,d){a[e]=d;d.ptype=e},createPlugin:function(e,f){var d=a[e.ptype||f];if(d.init){return d}else{return new d(e)}}}}();Ext.reg=Ext.ComponentMgr.registerType;Ext.preg=Ext.ComponentMgr.registerPlugin;Ext.create=Ext.ComponentMgr.create;Ext.Component=function(b){b=b||{};if(b.initialConfig){if(b.isAction){this.baseAction=b}b=b.initialConfig}else{if(b.tagName||b.dom||Ext.isString(b)){b={applyTo:b,id:b.id||b}}}this.initialConfig=b;Ext.apply(this,b);this.addEvents("added","disable","enable","beforeshow","show","beforehide","hide","removed","beforerender","render","afterrender","beforedestroy","destroy","beforestaterestore","staterestore","beforestatesave","statesave");this.getId();Ext.ComponentMgr.register(this);Ext.Component.superclass.constructor.call(this);if(this.baseAction){this.baseAction.addComponent(this)}this.initComponent();if(this.plugins){if(Ext.isArray(this.plugins)){for(var c=0,a=this.plugins.length;c0){return this.ownerCt.items.itemAt(a-1)}}return null},getBubbleTarget:function(){return this.ownerCt}});Ext.reg("component",Ext.Component);Ext.Action=Ext.extend(Object,{constructor:function(a){this.initialConfig=a;this.itemId=a.itemId=(a.itemId||a.id||Ext.id());this.items=[]},isAction:true,setText:function(a){this.initialConfig.text=a;this.callEach("setText",[a])},getText:function(){return this.initialConfig.text},setIconClass:function(a){this.initialConfig.iconCls=a;this.callEach("setIconClass",[a])},getIconClass:function(){return this.initialConfig.iconCls},setDisabled:function(a){this.initialConfig.disabled=a;this.callEach("setDisabled",[a])},enable:function(){this.setDisabled(false)},disable:function(){this.setDisabled(true)},isDisabled:function(){return this.initialConfig.disabled},setHidden:function(a){this.initialConfig.hidden=a;this.callEach("setVisible",[!a])},show:function(){this.setHidden(false)},hide:function(){this.setHidden(true)},isHidden:function(){return this.initialConfig.hidden},setHandler:function(b,a){this.initialConfig.handler=b;this.initialConfig.scope=a;this.callEach("setHandler",[b,a])},each:function(b,a){Ext.each(this.items,b,a)},callEach:function(e,b){var d=this.items;for(var c=0,a=d.length;ci+n.left){j=i-k-c;f=true}if((g+e)>d+n.top){g=d-e-c;f=true}if(j=l){g=l-e-5}}m=[j,g];this.storeXY(m);a.setXY.call(this,m);this.sync()}}return this},isVisible:function(){return this.visible},showAction:function(){this.visible=true;if(this.useDisplay===true){this.setDisplayed("")}else{if(this.lastXY){a.setXY.call(this,this.lastXY)}else{if(this.lastLT){a.setLeftTop.call(this,this.lastLT[0],this.lastLT[1])}}}},hideAction:function(){this.visible=false;if(this.useDisplay===true){this.setDisplayed(false)}else{this.setLeftTop(-10000,-10000)}},setVisible:function(h,g,j,k,i){if(h){this.showAction()}if(g&&h){var f=function(){this.sync(true);if(k){k()}}.createDelegate(this);a.setVisible.call(this,true,true,j,f,i)}else{if(!h){this.hideUnders(true)}var f=k;if(g){f=function(){this.hideAction();if(k){k()}}.createDelegate(this)}a.setVisible.call(this,h,g,j,f,i);if(h){this.sync(true)}else{if(!g){this.hideAction()}}}return this},storeXY:function(c){delete this.lastLT;this.lastXY=c},storeLeftTop:function(d,c){delete this.lastXY;this.lastLT=[d,c]},beforeFx:function(){this.beforeAction();return Ext.Layer.superclass.beforeFx.apply(this,arguments)},afterFx:function(){Ext.Layer.superclass.afterFx.apply(this,arguments);this.sync(this.isVisible())},beforeAction:function(){if(!this.updating&&this.shadow){this.shadow.hide()}},setLeft:function(c){this.storeLeftTop(c,this.getTop(true));a.setLeft.apply(this,arguments);this.sync();return this},setTop:function(c){this.storeLeftTop(this.getLeft(true),c);a.setTop.apply(this,arguments);this.sync();return this},setLeftTop:function(d,c){this.storeLeftTop(d,c);a.setLeftTop.apply(this,arguments);this.sync();return this},setXY:function(i,g,j,k,h){this.fixDisplay();this.beforeAction();this.storeXY(i);var f=this.createCB(k);a.setXY.call(this,i,g,j,f,h);if(!g){f()}return this},createCB:function(e){var d=this;return function(){d.constrainXY();d.sync(true);if(e){e()}}},setX:function(f,g,i,j,h){this.setXY([f,this.getY()],g,i,j,h);return this},setY:function(j,f,h,i,g){this.setXY([this.getX(),j],f,h,i,g);return this},setSize:function(i,j,g,l,m,k){this.beforeAction();var f=this.createCB(m);a.setSize.call(this,i,j,g,l,f,k);if(!g){f()}return this},setWidth:function(h,g,j,k,i){this.beforeAction();var f=this.createCB(k);a.setWidth.call(this,h,g,j,f,i);if(!g){f()}return this},setHeight:function(i,g,k,l,j){this.beforeAction();var f=this.createCB(l);a.setHeight.call(this,i,g,k,f,j);if(!g){f()}return this},setBounds:function(n,l,o,g,m,j,k,i){this.beforeAction();var f=this.createCB(k);if(!m){this.storeXY([n,l]);a.setXY.call(this,[n,l]);a.setSize.call(this,o,g,m,j,f,i);f()}else{a.setBounds.call(this,n,l,o,g,m,j,f,i)}return this},setZIndex:function(c){this.zindex=c;this.setStyle("z-index",c+2);if(this.shadow){this.shadow.setZIndex(c+1)}if(this.shim){this.shim.setStyle("z-index",c)}return this}})})();Ext.Shadow=function(d){Ext.apply(this,d);if(typeof this.mode!="string"){this.mode=this.defaultMode}var e=this.offset,c={h:0};var b=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case"drop":c.w=0;c.l=c.t=e;c.t-=1;if(Ext.isIE){c.l-=this.offset+b;c.t-=this.offset+b;c.w-=b;c.h-=b;c.t+=1}break;case"sides":c.w=(e*2);c.l=-e;c.t=e-1;if(Ext.isIE){c.l-=(this.offset-b);c.t-=this.offset+b;c.l+=1;c.w-=(this.offset-b)*2;c.w-=b+1;c.h-=1}break;case"frame":c.w=c.h=(e*2);c.l=c.t=-e;c.t+=1;c.h-=2;if(Ext.isIE){c.l-=(this.offset-b);c.t-=(this.offset-b);c.l+=1;c.w-=(this.offset+b+1);c.h-=(this.offset+b);c.h+=1}break}this.adjusts=c};Ext.Shadow.prototype={offset:4,defaultMode:"drop",show:function(a){a=Ext.get(a);if(!this.el){this.el=Ext.Shadow.Pool.pull();if(this.el.dom.nextSibling!=a.dom){this.el.insertBefore(a)}}this.el.setStyle("z-index",this.zIndex||parseInt(a.getStyle("z-index"),10)-1);if(Ext.isIE){this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")"}this.realign(a.getLeft(true),a.getTop(true),a.getWidth(),a.getHeight());this.el.dom.style.display="block"},isVisible:function(){return this.el?true:false},realign:function(b,q,p,f){if(!this.el){return}var m=this.adjusts,j=this.el.dom,r=j.style;var g=0;r.left=(b+m.l)+"px";r.top=(q+m.t)+"px";var o=(p+m.w),e=(f+m.h),i=o+"px",n=e+"px";if(r.width!=i||r.height!=n){r.width=i;r.height=n;if(!Ext.isIE){var k=j.childNodes;var c=Math.max(0,(o-12))+"px";k[0].childNodes[1].style.width=c;k[1].childNodes[1].style.width=c;k[2].childNodes[1].style.width=c;k[1].style.height=Math.max(0,(e-12))+"px"}}},hide:function(){if(this.el){this.el.dom.style.display="none";Ext.Shadow.Pool.push(this.el);delete this.el}},setZIndex:function(a){this.zIndex=a;if(this.el){this.el.setStyle("z-index",a)}}};Ext.Shadow.Pool=function(){var b=[];var a=Ext.isIE?'
    ':'
    ';return{pull:function(){var c=b.shift();if(!c){c=Ext.get(Ext.DomHelper.insertHtml("beforeBegin",document.body.firstChild,a));c.autoBoxAdjust=false}return c},push:function(c){b.push(c)}}}();Ext.BoxComponent=Ext.extend(Ext.Component,{initComponent:function(){Ext.BoxComponent.superclass.initComponent.call(this);this.addEvents("resize","move")},boxReady:false,deferHeight:false,setSize:function(b,d){if(typeof b=="object"){d=b.height;b=b.width}if(Ext.isDefined(b)&&Ext.isDefined(this.boxMinWidth)&&(bthis.boxMaxWidth)){b=this.boxMaxWidth}if(Ext.isDefined(d)&&Ext.isDefined(this.boxMaxHeight)&&(d>this.boxMaxHeight)){d=this.boxMaxHeight}if(!this.boxReady){this.width=b;this.height=d;return this}if(this.cacheSizes!==false&&this.lastSize&&this.lastSize.width==b&&this.lastSize.height==d){return this}this.lastSize={width:b,height:d};var c=this.adjustSize(b,d),f=c.width,a=c.height,e;if(f!==undefined||a!==undefined){e=this.getResizeEl();if(!this.deferHeight&&f!==undefined&&a!==undefined){e.setSize(f,a)}else{if(!this.deferHeight&&a!==undefined){e.setHeight(a)}else{if(f!==undefined){e.setWidth(f)}}}this.onResize(f,a,b,d);this.fireEvent("resize",this,f,a,b,d)}return this},setWidth:function(a){return this.setSize(a)},setHeight:function(a){return this.setSize(undefined,a)},getSize:function(){return this.getResizeEl().getSize()},getWidth:function(){return this.getResizeEl().getWidth()},getHeight:function(){return this.getResizeEl().getHeight()},getOuterSize:function(){var a=this.getResizeEl();return{width:a.getWidth()+a.getMargins("lr"),height:a.getHeight()+a.getMargins("tb")}},getPosition:function(a){var b=this.getPositionEl();if(a===true){return[b.getLeft(true),b.getTop(true)]}return this.xy||b.getXY()},getBox:function(a){var c=this.getPosition(a);var b=this.getSize();b.x=c[0];b.y=c[1];return b},updateBox:function(a){this.setSize(a.width,a.height);this.setPagePosition(a.x,a.y);return this},getResizeEl:function(){return this.resizeEl||this.el},setAutoScroll:function(a){if(this.rendered){this.getContentTarget().setOverflow(a?"auto":"")}this.autoScroll=a;return this},setPosition:function(a,f){if(a&&typeof a[1]=="number"){f=a[1];a=a[0]}this.x=a;this.y=f;if(!this.boxReady){return this}var b=this.adjustPosition(a,f);var e=b.x,d=b.y;var c=this.getPositionEl();if(e!==undefined||d!==undefined){if(e!==undefined&&d!==undefined){c.setLeftTop(e,d)}else{if(e!==undefined){c.setLeft(e)}else{if(d!==undefined){c.setTop(d)}}}this.onPosition(e,d);this.fireEvent("move",this,e,d)}return this},setPagePosition:function(a,c){if(a&&typeof a[1]=="number"){c=a[1];a=a[0]}this.pageX=a;this.pageY=c;if(!this.boxReady){return}if(a===undefined||c===undefined){return}var b=this.getPositionEl().translatePoints(a,c);this.setPosition(b.left,b.top);return this},afterRender:function(){Ext.BoxComponent.superclass.afterRender.call(this);if(this.resizeEl){this.resizeEl=Ext.get(this.resizeEl)}if(this.positionEl){this.positionEl=Ext.get(this.positionEl)}this.boxReady=true;Ext.isDefined(this.autoScroll)&&this.setAutoScroll(this.autoScroll);this.setSize(this.width,this.height);if(this.x||this.y){this.setPosition(this.x,this.y)}else{if(this.pageX||this.pageY){this.setPagePosition(this.pageX,this.pageY)}}},syncSize:function(){delete this.lastSize;this.setSize(this.autoWidth?undefined:this.getResizeEl().getWidth(),this.autoHeight?undefined:this.getResizeEl().getHeight());return this},onResize:function(d,b,a,c){},onPosition:function(a,b){},adjustSize:function(a,b){if(this.autoWidth){a="auto"}if(this.autoHeight){b="auto"}return{width:a,height:b}},adjustPosition:function(a,b){return{x:a,y:b}}});Ext.reg("box",Ext.BoxComponent);Ext.Spacer=Ext.extend(Ext.BoxComponent,{autoEl:"div"});Ext.reg("spacer",Ext.Spacer);Ext.SplitBar=function(c,e,b,d,a){this.el=Ext.get(c,true);this.el.dom.unselectable="on";this.resizingEl=Ext.get(e,true);this.orientation=b||Ext.SplitBar.HORIZONTAL;this.minSize=0;this.maxSize=2000;this.animate=false;this.useShim=false;this.shim=null;if(!a){this.proxy=Ext.SplitBar.createProxy(this.orientation)}else{this.proxy=Ext.get(a).dom}this.dd=new Ext.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id});this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this);this.dd.endDrag=this.onEndProxyDrag.createDelegate(this);this.dragSpecs={};this.adapter=new Ext.SplitBar.BasicLayoutAdapter();this.adapter.init(this);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.placement=d||(this.el.getX()>this.resizingEl.getX()?Ext.SplitBar.LEFT:Ext.SplitBar.RIGHT);this.el.addClass("x-splitbar-h")}else{this.placement=d||(this.el.getY()>this.resizingEl.getY()?Ext.SplitBar.TOP:Ext.SplitBar.BOTTOM);this.el.addClass("x-splitbar-v")}this.addEvents("resize","moved","beforeresize","beforeapply");Ext.SplitBar.superclass.constructor.call(this)};Ext.extend(Ext.SplitBar,Ext.util.Observable,{onStartProxyDrag:function(a,e){this.fireEvent("beforeresize",this);this.overlay=Ext.DomHelper.append(document.body,{cls:"x-drag-overlay",html:" "},true);this.overlay.unselectable();this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();Ext.get(this.proxy).setDisplayed("block");var c=this.adapter.getElementSize(this);this.activeMinSize=this.getMinimumSize();this.activeMaxSize=this.getMaximumSize();var d=c-this.activeMinSize;var b=Math.max(this.activeMaxSize-c,0);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.dd.resetConstraints();this.dd.setXConstraint(this.placement==Ext.SplitBar.LEFT?d:b,this.placement==Ext.SplitBar.LEFT?b:d,this.tickSize);this.dd.setYConstraint(0,0)}else{this.dd.resetConstraints();this.dd.setXConstraint(0,0);this.dd.setYConstraint(this.placement==Ext.SplitBar.TOP?d:b,this.placement==Ext.SplitBar.TOP?b:d,this.tickSize)}this.dragSpecs.startSize=c;this.dragSpecs.startPoint=[a,e];Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd,a,e)},onEndProxyDrag:function(c){Ext.get(this.proxy).setDisplayed(false);var b=Ext.lib.Event.getXY(c);if(this.overlay){Ext.destroy(this.overlay);delete this.overlay}var a;if(this.orientation==Ext.SplitBar.HORIZONTAL){a=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.LEFT?b[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-b[0])}else{a=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.TOP?b[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-b[1])}a=Math.min(Math.max(a,this.activeMinSize),this.activeMaxSize);if(a!=this.dragSpecs.startSize){if(this.fireEvent("beforeapply",this,a)!==false){this.adapter.setElementSize(this,a);this.fireEvent("moved",this,a);this.fireEvent("resize",this,a)}}},getAdapter:function(){return this.adapter},setAdapter:function(a){this.adapter=a;this.adapter.init(this)},getMinimumSize:function(){return this.minSize},setMinimumSize:function(a){this.minSize=a},getMaximumSize:function(){return this.maxSize},setMaximumSize:function(a){this.maxSize=a},setCurrentSize:function(b){var a=this.animate;this.animate=false;this.adapter.setElementSize(this,b);this.animate=a},destroy:function(a){Ext.destroy(this.shim,Ext.get(this.proxy));this.dd.unreg();if(a){this.el.remove()}this.purgeListeners()}});Ext.SplitBar.createProxy=function(b){var c=new Ext.Element(document.createElement("div"));document.body.appendChild(c.dom);c.unselectable();var a="x-splitbar-proxy";c.addClass(a+" "+(b==Ext.SplitBar.HORIZONTAL?a+"-h":a+"-v"));return c.dom};Ext.SplitBar.BasicLayoutAdapter=function(){};Ext.SplitBar.BasicLayoutAdapter.prototype={init:function(a){},getElementSize:function(a){if(a.orientation==Ext.SplitBar.HORIZONTAL){return a.resizingEl.getWidth()}else{return a.resizingEl.getHeight()}},setElementSize:function(b,a,c){if(b.orientation==Ext.SplitBar.HORIZONTAL){if(!b.animate){b.resizingEl.setWidth(a);if(c){c(b,a)}}else{b.resizingEl.setWidth(a,true,0.1,c,"easeOut")}}else{if(!b.animate){b.resizingEl.setHeight(a);if(c){c(b,a)}}else{b.resizingEl.setHeight(a,true,0.1,c,"easeOut")}}}};Ext.SplitBar.AbsoluteLayoutAdapter=function(a){this.basic=new Ext.SplitBar.BasicLayoutAdapter();this.container=Ext.get(a)};Ext.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(a){this.basic.init(a)},getElementSize:function(a){return this.basic.getElementSize(a)},setElementSize:function(b,a,c){this.basic.setElementSize(b,a,this.moveSplitter.createDelegate(this,[b]))},moveSplitter:function(a){var b=Ext.SplitBar;switch(a.placement){case b.LEFT:a.el.setX(a.resizingEl.getRight());break;case b.RIGHT:a.el.setStyle("right",(this.container.getWidth()-a.resizingEl.getLeft())+"px");break;case b.TOP:a.el.setY(a.resizingEl.getBottom());break;case b.BOTTOM:a.el.setY(a.resizingEl.getTop()-a.el.getHeight());break}}};Ext.SplitBar.VERTICAL=1;Ext.SplitBar.HORIZONTAL=2;Ext.SplitBar.LEFT=1;Ext.SplitBar.RIGHT=2;Ext.SplitBar.TOP=3;Ext.SplitBar.BOTTOM=4;Ext.Container=Ext.extend(Ext.BoxComponent,{bufferResize:50,autoDestroy:true,forceLayout:false,defaultType:"panel",resizeEvent:"resize",bubbleEvents:["add","remove"],initComponent:function(){Ext.Container.superclass.initComponent.call(this);this.addEvents("afterlayout","beforeadd","beforeremove","add","remove");var a=this.items;if(a){delete this.items;this.add(a)}},initItems:function(){if(!this.items){this.items=new Ext.util.MixedCollection(false,this.getComponentId);this.getLayout()}},setLayout:function(a){if(this.layout&&this.layout!=a){this.layout.setContainer(null)}this.layout=a;this.initItems();a.setContainer(this)},afterRender:function(){Ext.Container.superclass.afterRender.call(this);if(!this.layout){this.layout="auto"}if(Ext.isObject(this.layout)&&!this.layout.layout){this.layoutConfig=this.layout;this.layout=this.layoutConfig.type}if(Ext.isString(this.layout)){this.layout=new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig)}this.setLayout(this.layout);if(this.activeItem!==undefined){var a=this.activeItem;delete this.activeItem;this.layout.setActiveItem(a)}if(!this.ownerCt){this.doLayout(false,true)}if(this.monitorResize===true){Ext.EventManager.onWindowResize(this.doLayout,this,[false])}},getLayoutTarget:function(){return this.el},getComponentId:function(a){return a.getItemId()},add:function(b){this.initItems();var e=arguments.length>1;if(e||Ext.isArray(b)){var a=[];Ext.each(e?arguments:b,function(g){a.push(this.add(g))},this);return a}var f=this.lookupComponent(this.applyDefaults(b));var d=this.items.length;if(this.fireEvent("beforeadd",this,f,d)!==false&&this.onBeforeAdd(f)!==false){this.items.add(f);f.onAdded(this,d);this.onAdd(f);this.fireEvent("add",this,f,d)}return f},onAdd:function(a){},onAdded:function(a,b){this.ownerCt=a;this.initRef();this.cascade(function(d){d.initRef()});this.fireEvent("added",this,a,b)},insert:function(g,f){this.initItems();var e=arguments,d=e.length;if(d>2){var b=[];for(var h=d-1;h>=1;--h){b.push(this.insert(g,e[h]))}return b}var j=this.lookupComponent(this.applyDefaults(f));g=Math.min(g,this.items.length);if(this.fireEvent("beforeadd",this,j,g)!==false&&this.onBeforeAdd(j)!==false){if(j.ownerCt==this){this.items.remove(j)}this.items.insert(g,j);j.onAdded(this,g);this.onAdd(j);this.fireEvent("add",this,j,g)}return j},applyDefaults:function(b){var a=this.defaults;if(a){if(Ext.isFunction(a)){a=a.call(this,b)}if(Ext.isString(b)){b=Ext.ComponentMgr.get(b);Ext.apply(b,a)}else{if(!b.events){Ext.applyIf(b,a)}else{Ext.apply(b,a)}}}return b},onBeforeAdd:function(a){if(a.ownerCt){a.ownerCt.remove(a,false)}if(this.hideBorders===true){a.border=(a.border===true)}},remove:function(a,b){this.initItems();var d=this.getComponent(a);if(d&&this.fireEvent("beforeremove",this,d)!==false){this.doRemove(d,b);this.fireEvent("remove",this,d)}return d},onRemove:function(a){},doRemove:function(e,d){var b=this.layout,a=b&&this.rendered;if(a){b.onRemove(e)}this.items.remove(e);e.onRemoved();this.onRemove(e);if(d===true||(d!==false&&this.autoDestroy)){e.destroy()}if(a){b.afterRemove(e)}},removeAll:function(c){this.initItems();var e,f=[],b=[];this.items.each(function(g){f.push(g)});for(var d=0,a=f.length;d','','
    ','
    ',"");a.disableFormats=true;return a.compile()})(),destroy:function(){if(this.resizeTask&&this.resizeTask.cancel){this.resizeTask.cancel()}if(!Ext.isEmpty(this.targetCls)){var a=this.container.getLayoutTarget();if(a){a.removeClass(this.targetCls)}}}});Ext.layout.AutoLayout=Ext.extend(Ext.layout.ContainerLayout,{type:"auto",monitorResize:true,onLayout:function(d,f){Ext.layout.AutoLayout.superclass.onLayout.call(this,d,f);var e=this.getRenderedItems(d),a=e.length,b,g;for(b=0;b0){b.setSize(a)}}});Ext.Container.LAYOUTS.fit=Ext.layout.FitLayout;Ext.layout.CardLayout=Ext.extend(Ext.layout.FitLayout,{deferredRender:false,layoutOnCardChange:false,renderHidden:true,type:"card",setActiveItem:function(d){var a=this.activeItem,b=this.container;d=b.getComponent(d);if(d&&a!=d){if(a){a.hide();if(a.hidden!==true){return false}a.fireEvent("deactivate",a)}var c=d.doLayout&&(this.layoutOnCardChange||!d.rendered);this.activeItem=d;delete d.deferLayout;d.show();this.layout();if(c){d.doLayout()}d.fireEvent("activate",d)}},renderAll:function(a,b){if(this.deferredRender){this.renderItem(this.activeItem,undefined,b)}else{Ext.layout.CardLayout.superclass.renderAll.call(this,a,b)}}});Ext.Container.LAYOUTS.card=Ext.layout.CardLayout;Ext.layout.AnchorLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"anchor",defaultAnchor:"100%",parseAnchorRE:/^(r|right|b|bottom)$/i,getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();if(!a){return{}}return a.getStyleSize()},onLayout:function(l,o){Ext.layout.AnchorLayout.superclass.onLayout.call(this,l,o);var u=this.getLayoutTargetSize();var s=u.width,k=u.height;if(s<20&&k<20){return}var d,q;if(l.anchorSize){if(typeof l.anchorSize=="number"){d=l.anchorSize}else{d=l.anchorSize.width;q=l.anchorSize.height}}else{d=l.initialConfig.width;q=l.initialConfig.height}var n=this.getRenderedItems(l),m=n.length,g,p,r,f,b,e,t,j=[];for(g=0;g ');b.disableFormats=true;b.compile();Ext.layout.BorderLayout.Region.prototype.toolTemplate=b}this.collapsedEl=this.targetEl.createChild({cls:"x-layout-collapsed x-layout-collapsed-"+this.position,id:this.panel.id+"-xcollapsed"});this.collapsedEl.enableDisplayMode("block");if(this.collapseMode=="mini"){this.collapsedEl.addClass("x-layout-cmini-"+this.position);this.miniCollapsedEl=this.collapsedEl.createChild({cls:"x-layout-mini x-layout-mini-"+this.position,html:" "});this.miniCollapsedEl.addClassOnOver("x-layout-mini-over");this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this.onExpandClick,this,{stopEvent:true})}else{if(this.collapsible!==false&&!this.hideCollapseTool){var a=this.toolTemplate.append(this.collapsedEl.dom,{id:"expand-"+this.position},true);a.addClassOnOver("x-tool-expand-"+this.position+"-over");a.on("click",this.onExpandClick,this,{stopEvent:true})}if(this.floatable!==false||this.titleCollapse){this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this[this.floatable?"collapseClick":"onExpandClick"],this)}}}return this.collapsedEl},onExpandClick:function(a){if(this.isSlid){this.panel.expand(false)}else{this.panel.expand()}},onCollapseClick:function(a){this.panel.collapse()},beforeCollapse:function(c,a){this.lastAnim=a;if(this.splitEl){this.splitEl.hide()}this.getCollapsedEl().show();var b=this.panel.getEl();this.originalZIndex=b.getStyle("z-index");b.setStyle("z-index",100);this.isCollapsed=true;this.layout.layout()},onCollapse:function(a){this.panel.el.setStyle("z-index",1);if(this.lastAnim===false||this.panel.animCollapse===false){this.getCollapsedEl().dom.style.visibility="visible"}else{this.getCollapsedEl().slideIn(this.panel.slideAnchor,{duration:0.2})}this.state.collapsed=true;this.panel.saveState()},beforeExpand:function(a){if(this.isSlid){this.afterSlideIn()}var b=this.getCollapsedEl();this.el.show();if(this.position=="east"||this.position=="west"){this.panel.setSize(undefined,b.getHeight())}else{this.panel.setSize(b.getWidth(),undefined)}b.hide();b.dom.style.visibility="hidden";this.panel.el.setStyle("z-index",this.floatingZIndex)},onExpand:function(){this.isCollapsed=false;if(this.splitEl){this.splitEl.show()}this.layout.layout();this.panel.el.setStyle("z-index",this.originalZIndex);this.state.collapsed=false;this.panel.saveState()},collapseClick:function(a){if(this.isSlid){a.stopPropagation();this.slideIn()}else{a.stopPropagation();this.slideOut()}},onHide:function(){if(this.isCollapsed){this.getCollapsedEl().hide()}else{if(this.splitEl){this.splitEl.hide()}}},onShow:function(){if(this.isCollapsed){this.getCollapsedEl().show()}else{if(this.splitEl){this.splitEl.show()}}},isVisible:function(){return !this.panel.hidden},getMargins:function(){return this.isCollapsed&&this.cmargins?this.cmargins:this.margins},getSize:function(){return this.isCollapsed?this.getCollapsedEl().getSize():this.panel.getSize()},setPanel:function(a){this.panel=a},getMinWidth:function(){return this.minWidth},getMinHeight:function(){return this.minHeight},applyLayoutCollapsed:function(a){var b=this.getCollapsedEl();b.setLeftTop(a.x,a.y);b.setSize(a.width,a.height)},applyLayout:function(a){if(this.isCollapsed){this.applyLayoutCollapsed(a)}else{this.panel.setPosition(a.x,a.y);this.panel.setSize(a.width,a.height)}},beforeSlide:function(){this.panel.beforeEffect()},afterSlide:function(){this.panel.afterEffect()},initAutoHide:function(){if(this.autoHide!==false){if(!this.autoHideHd){this.autoHideSlideTask=new Ext.util.DelayedTask(this.slideIn,this);this.autoHideHd={mouseout:function(a){if(!a.within(this.el,true)){this.autoHideSlideTask.delay(500)}},mouseover:function(a){this.autoHideSlideTask.cancel()},scope:this}}this.el.on(this.autoHideHd);this.collapsedEl.on(this.autoHideHd)}},clearAutoHide:function(){if(this.autoHide!==false){this.el.un("mouseout",this.autoHideHd.mouseout);this.el.un("mouseover",this.autoHideHd.mouseover);this.collapsedEl.un("mouseout",this.autoHideHd.mouseout);this.collapsedEl.un("mouseover",this.autoHideHd.mouseover)}},clearMonitor:function(){Ext.getDoc().un("click",this.slideInIf,this)},slideOut:function(){if(this.isSlid||this.el.hasActiveFx()){return}this.isSlid=true;var b=this.panel.tools,c,a;if(b&&b.toggle){b.toggle.hide()}this.el.show();a=this.panel.collapsed;this.panel.collapsed=false;if(this.position=="east"||this.position=="west"){c=this.panel.deferHeight;this.panel.deferHeight=false;this.panel.setSize(undefined,this.collapsedEl.getHeight());this.panel.deferHeight=c}else{this.panel.setSize(this.collapsedEl.getWidth(),undefined)}this.panel.collapsed=a;this.restoreLT=[this.el.dom.style.left,this.el.dom.style.top];this.el.alignTo(this.collapsedEl,this.getCollapseAnchor());this.el.setStyle("z-index",this.floatingZIndex+2);this.panel.el.replaceClass("x-panel-collapsed","x-panel-floating");if(this.animFloat!==false){this.beforeSlide();this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide();this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)},scope:this,block:true})}else{this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)}},afterSlideIn:function(){this.clearAutoHide();this.isSlid=false;this.clearMonitor();this.el.setStyle("z-index","");this.panel.el.replaceClass("x-panel-floating","x-panel-collapsed");this.el.dom.style.left=this.restoreLT[0];this.el.dom.style.top=this.restoreLT[1];var a=this.panel.tools;if(a&&a.toggle){a.toggle.show()}},slideIn:function(a){if(!this.isSlid||this.el.hasActiveFx()){Ext.callback(a);return}this.isSlid=false;if(this.animFloat!==false){this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.hide();this.afterSlide();this.afterSlideIn();Ext.callback(a)},scope:this,block:true})}else{this.el.hide();this.afterSlideIn()}},slideInIf:function(a){if(!a.within(this.el)){this.slideIn()}},anchors:{west:"left",east:"right",north:"top",south:"bottom"},sanchors:{west:"l",east:"r",north:"t",south:"b"},canchors:{west:"tl-tr",east:"tr-tl",north:"tl-bl",south:"bl-tl"},getAnchor:function(){return this.anchors[this.position]},getCollapseAnchor:function(){return this.canchors[this.position]},getSlideAnchor:function(){return this.sanchors[this.position]},getAlignAdj:function(){var a=this.cmargins;switch(this.position){case"west":return[0,0];break;case"east":return[0,0];break;case"north":return[0,0];break;case"south":return[0,0];break}},getExpandAdj:function(){var b=this.collapsedEl,a=this.cmargins;switch(this.position){case"west":return[-(a.right+b.getWidth()+a.left),0];break;case"east":return[a.right+b.getWidth()+a.left,0];break;case"north":return[0,-(a.top+a.bottom+b.getHeight())];break;case"south":return[0,a.top+a.bottom+b.getHeight()];break}},destroy:function(){if(this.autoHideSlideTask&&this.autoHideSlideTask.cancel){this.autoHideSlideTask.cancel()}Ext.destroy(this.miniCollapsedEl,this.collapsedEl)}};Ext.layout.BorderLayout.SplitRegion=function(b,a,c){Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this,b,a,c);this.applyLayout=this.applyFns[c]};Ext.extend(Ext.layout.BorderLayout.SplitRegion,Ext.layout.BorderLayout.Region,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,splitSettings:{north:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.TOP,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},south:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.BOTTOM,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},east:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.RIGHT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"},west:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.LEFT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"}},applyFns:{west:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;this.panel.setPosition(c.x,c.y);var a=d.offsetWidth;b.left=(c.x+c.width-a)+"px";b.top=(c.y)+"px";b.height=Math.max(0,c.height)+"px";this.panel.setSize(c.width-a,c.height)},east:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetWidth;this.panel.setPosition(c.x+a,c.y);b.left=(c.x)+"px";b.top=(c.y)+"px";b.height=Math.max(0,c.height)+"px";this.panel.setSize(c.width-a,c.height)},north:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetHeight;this.panel.setPosition(c.x,c.y);b.left=(c.x)+"px";b.top=(c.y+c.height-a)+"px";b.width=Math.max(0,c.width)+"px";this.panel.setSize(c.width,c.height-a)},south:function(c){if(this.isCollapsed){return this.applyLayoutCollapsed(c)}var d=this.splitEl.dom,b=d.style;var a=d.offsetHeight;this.panel.setPosition(c.x,c.y+a);b.left=(c.x)+"px";b.top=(c.y)+"px";b.width=Math.max(0,c.width)+"px";this.panel.setSize(c.width,c.height-a)}},render:function(a,c){Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this,a,c);var d=this.position;this.splitEl=a.createChild({cls:"x-layout-split x-layout-split-"+d,html:" ",id:this.panel.id+"-xsplit"});if(this.collapseMode=="mini"){this.miniSplitEl=this.splitEl.createChild({cls:"x-layout-mini x-layout-mini-"+d,html:" "});this.miniSplitEl.addClassOnOver("x-layout-mini-over");this.miniSplitEl.on("click",this.onCollapseClick,this,{stopEvent:true})}var b=this.splitSettings[d];this.split=new Ext.SplitBar(this.splitEl.dom,c.el,b.orientation);this.split.tickSize=this.tickSize;this.split.placement=b.placement;this.split.getMaximumSize=this[b.maxFn].createDelegate(this);this.split.minSize=this.minSize||this[b.minProp];this.split.on("beforeapply",this.onSplitMove,this);this.split.useShim=this.useShim===true;this.maxSize=this.maxSize||this[b.maxProp];if(c.hidden){this.splitEl.hide()}if(this.useSplitTips){this.splitEl.dom.title=this.collapsible?this.collapsibleSplitTip:this.splitTip}if(this.collapsible){this.splitEl.on("dblclick",this.onCollapseClick,this)}},getSize:function(){if(this.isCollapsed){return this.collapsedEl.getSize()}var a=this.panel.getSize();if(this.position=="north"||this.position=="south"){a.height+=this.splitEl.dom.offsetHeight}else{a.width+=this.splitEl.dom.offsetWidth}return a},getHMaxSize:function(){var b=this.maxSize||10000;var a=this.layout.center;return Math.min(b,(this.el.getWidth()+a.el.getWidth())-a.getMinWidth())},getVMaxSize:function(){var b=this.maxSize||10000;var a=this.layout.center;return Math.min(b,(this.el.getHeight()+a.el.getHeight())-a.getMinHeight())},onSplitMove:function(b,a){var c=this.panel.getSize();this.lastSplitSize=a;if(this.position=="north"||this.position=="south"){this.panel.setSize(c.width,a);this.state.height=a}else{this.panel.setSize(a,c.height);this.state.width=a}this.layout.layout();this.panel.saveState();return false},getSplitBar:function(){return this.split},destroy:function(){Ext.destroy(this.miniSplitEl,this.split,this.splitEl);Ext.layout.BorderLayout.SplitRegion.superclass.destroy.call(this)}});Ext.Container.LAYOUTS.border=Ext.layout.BorderLayout;Ext.layout.FormLayout=Ext.extend(Ext.layout.AnchorLayout,{labelSeparator:":",trackLabels:false,type:"form",onRemove:function(d){Ext.layout.FormLayout.superclass.onRemove.call(this,d);if(this.trackLabels){d.un("show",this.onFieldShow,this);d.un("hide",this.onFieldHide,this)}var b=d.getPositionEl(),a=d.getItemCt&&d.getItemCt();if(d.rendered&&a){if(b&&b.dom){b.insertAfter(a)}Ext.destroy(a);Ext.destroyMembers(d,"label","itemCt");if(d.customItemCt){Ext.destroyMembers(d,"getItemCt","customItemCt")}}},setContainer:function(a){Ext.layout.FormLayout.superclass.setContainer.call(this,a);if(a.labelAlign){a.addClass("x-form-label-"+a.labelAlign)}if(a.hideLabels){Ext.apply(this,{labelStyle:"display:none",elementStyle:"padding-left:0;",labelAdjust:0})}else{this.labelSeparator=a.labelSeparator||this.labelSeparator;a.labelWidth=a.labelWidth||100;if(Ext.isNumber(a.labelWidth)){var b=Ext.isNumber(a.labelPad)?a.labelPad:5;Ext.apply(this,{labelAdjust:a.labelWidth+b,labelStyle:"width:"+a.labelWidth+"px;",elementStyle:"padding-left:"+(a.labelWidth+b)+"px"})}if(a.labelAlign=="top"){Ext.apply(this,{labelStyle:"width:auto;",labelAdjust:0,elementStyle:"padding-left:0;"})}}},isHide:function(a){return a.hideLabel||this.container.hideLabels},onFieldShow:function(a){a.getItemCt().removeClass("x-hide-"+a.hideMode);if(a.isComposite){a.doLayout()}},onFieldHide:function(a){a.getItemCt().addClass("x-hide-"+a.hideMode)},getLabelStyle:function(e){var b="",c=[this.labelStyle,e];for(var d=0,a=c.length;d=b)||(this.cells[c]&&this.cells[c][a])){if(b&&a>=b){c++;a=0}else{a++}}return[a,c]},renderItem:function(e,a,d){if(!this.table){this.table=d.createChild(Ext.apply({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},this.tableAttrs),null,true)}if(e&&!e.rendered){e.render(this.getNextCell(e));this.configureItem(e,a)}else{if(e&&!this.isValidParent(e,d)){var b=this.getNextCell(e);b.insertBefore(e.getPositionEl().dom,null);e.container=Ext.get(b);this.configureItem(e,a)}}},isValidParent:function(b,a){return b.getPositionEl().up("table",5).dom.parentNode===(a.dom||a)}});Ext.Container.LAYOUTS.table=Ext.layout.TableLayout;Ext.layout.AbsoluteLayout=Ext.extend(Ext.layout.AnchorLayout,{extraCls:"x-abs-layout-item",type:"absolute",onLayout:function(a,b){b.position();this.paddingLeft=b.getPadding("l");this.paddingTop=b.getPadding("t");Ext.layout.AbsoluteLayout.superclass.onLayout.call(this,a,b)},adjustWidthAnchor:function(b,a){return b?b-a.getPosition(true)[0]+this.paddingLeft:b},adjustHeightAnchor:function(b,a){return b?b-a.getPosition(true)[1]+this.paddingTop:b}});Ext.Container.LAYOUTS.absolute=Ext.layout.AbsoluteLayout;Ext.layout.BoxLayout=Ext.extend(Ext.layout.ContainerLayout,{defaultMargins:{left:0,top:0,right:0,bottom:0},padding:"0",pack:"start",monitorResize:true,type:"box",scrollOffset:0,extraCls:"x-box-item",targetCls:"x-box-layout-ct",innerCls:"x-box-inner",constructor:function(a){Ext.layout.BoxLayout.superclass.constructor.call(this,a);if(Ext.isString(this.defaultMargins)){this.defaultMargins=this.parseMargins(this.defaultMargins)}},onLayout:function(a,d){Ext.layout.BoxLayout.superclass.onLayout.call(this,a,d);var b=this.getVisibleItems(a),c=this.getLayoutTargetSize();this.layoutTargetLastSize=c;this.childBoxCache=this.calculateChildBoxes(b,c);this.updateInnerCtSize(c,this.childBoxCache);this.updateChildBoxes(this.childBoxCache.boxes);this.handleTargetOverflow(c,a,d)},updateChildBoxes:function(c){for(var b=0,e=c.length;b0){r.left=o+F+(q/2)}}x+=r.height+s.bottom}return{boxes:h,meta:{maxWidth:D}}}});Ext.Container.LAYOUTS.vbox=Ext.layout.VBoxLayout;Ext.layout.HBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"top",type:"hbox",updateInnerCtSize:function(b,d){var a=b.width,c=d.meta.maxHeight+this.padding.top+this.padding.bottom;if(this.align=="stretch"){c=b.height}else{if(this.align=="middle"){c=Math.max(b.height,c)}}this.innerCt.setSize(a||undefined,c||undefined)},calculateChildBoxes:function(y,e){var m=y.length,w=this.padding,B=w.top,q=w.left,r=B+w.bottom,a=q+w.right,A=e.width-this.scrollOffset,x=e.height,g=Math.max(0,x-r),n=this.pack=="start",o=this.pack=="center",p=this.pack=="end",H=0,z=0,C=0,l=[],k,d,f,c,v,E,D,u,G,h,s;for(D=0;D0){u.top=B+h+(t/2)}}q+=u.width+v.right}return{boxes:l,meta:{maxHeight:z}}}});Ext.Container.LAYOUTS.hbox=Ext.layout.HBoxLayout;Ext.layout.ToolbarLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"toolbar",triggerWidth:18,noItemsMenuText:'
    (None)
    ',lastOverflow:false,tableHTML:['',"","",'",'","","","
    ','',"",'',"","
    ","
    ','',"","","","","","","
    ",'',"",'',"","
    ","
    ",'',"",'',"","
    ","
    ","
    "].join(""),onLayout:function(e,h){if(!this.leftTr){var g=e.buttonAlign=="center"?"center":"left";h.addClass("x-toolbar-layout-ct");h.insertHtml("beforeEnd",String.format(this.tableHTML,g));this.leftTr=h.child("tr.x-toolbar-left-row",true);this.rightTr=h.child("tr.x-toolbar-right-row",true);this.extrasTr=h.child("tr.x-toolbar-extras-row",true);if(this.hiddenItem==undefined){this.hiddenItems=[]}}var j=e.buttonAlign=="right"?this.rightTr:this.leftTr,k=e.items.items,d=0;for(var b=0,f=k.length,l;b=0&&(d=e[a]);a--){if(!d.firstChild){b.removeChild(d)}}},insertCell:function(e,b,a){var d=document.createElement("td");d.className="x-toolbar-cell";b.insertBefore(d,b.childNodes[a]||null);return d},hideItem:function(a){this.hiddenItems.push(a);a.xtbHidden=true;a.xtbWidth=a.getPositionEl().dom.parentNode.offsetWidth;a.hide()},unhideItem:function(a){a.show();a.xtbHidden=false;this.hiddenItems.remove(a)},getItemWidth:function(a){return a.hidden?(a.xtbWidth||0):a.getPositionEl().dom.parentNode.offsetWidth},fitToSize:function(j){if(this.container.enableOverflow===false){return}var b=j.dom.clientWidth,h=j.dom.firstChild.offsetWidth,l=b-this.triggerWidth,a=this.lastWidth||0,c=this.hiddenItems,e=c.length!=0,m=b>=a;this.lastWidth=b;if(h>b||(e&&m)){var k=this.container.items.items,g=k.length,d=0,n;for(var f=0;fl){if(!(n.hidden||n.xtbHidden)){this.hideItem(n)}}else{if(n.xtbHidden){this.unhideItem(n)}}}}}e=c.length!=0;if(e){this.initMore();if(!this.lastOverflow){this.container.fireEvent("overflowchange",this.container,true);this.lastOverflow=true}}else{if(this.more){this.clearMenu();this.more.destroy();delete this.more;if(this.lastOverflow){this.container.fireEvent("overflowchange",this.container,false);this.lastOverflow=false}}}},createMenuConfig:function(c,a){var b=Ext.apply({},c.initialConfig),d=c.toggleGroup;Ext.copyTo(b,c,["iconCls","icon","itemId","disabled","handler","scope","menu"]);Ext.apply(b,{text:c.overflowText||c.text,hideOnClick:a});if(d||c.enableToggle){Ext.apply(b,{group:d,checked:c.pressed,listeners:{checkchange:function(f,e){c.toggle(e)}}})}delete b.ownerCt;delete b.xtype;delete b.id;return b},addComponentToMenu:function(b,a){if(a instanceof Ext.Toolbar.Separator){b.add("-")}else{if(Ext.isFunction(a.isXType)){if(a.isXType("splitbutton")){b.add(this.createMenuConfig(a,true))}else{if(a.isXType("button")){b.add(this.createMenuConfig(a,!a.menu))}else{if(a.isXType("buttongroup")){a.items.each(function(c){this.addComponentToMenu(b,c)},this)}}}}}},clearMenu:function(){var a=this.moreMenu;if(a&&a.items){a.items.each(function(b){delete b.menu})}},beforeMoreShow:function(g){var b=this.container.items.items,a=b.length,f,e;var c=function(i,h){return i.isXType("buttongroup")&&!(h instanceof Ext.Toolbar.Separator)};this.clearMenu();g.removeAll();for(var d=0;d','','',"","")}if(f&&!f.rendered){if(Ext.isNumber(b)){b=e.dom.childNodes[b]}var d=this.getItemArgs(f);f.render(f.positionEl=b?this.itemTpl.insertBefore(b,d,true):this.itemTpl.append(e,d,true));f.positionEl.menuItemId=f.getItemId();if(!d.isMenuItem&&d.needsIcon){f.positionEl.addClass("x-menu-list-item-indent")}this.configureItem(f,b)}else{if(f&&!this.isValidParent(f,e)){if(Ext.isNumber(b)){b=e.dom.childNodes[b]}e.dom.insertBefore(f.getActionEl().dom,b||null)}}},getItemArgs:function(b){var a=b instanceof Ext.menu.Item;return{isMenuItem:a,needsIcon:!a&&(b.icon||b.iconCls),icon:b.icon||Ext.BLANK_IMAGE_URL,iconCls:"x-menu-item-icon "+(b.iconCls||""),itemId:"x-menu-el-"+b.id,itemCls:"x-menu-list-item "}},isValidParent:function(b,a){return b.el.up("li.x-menu-list-item",5).dom.parentNode===(a.dom||a)},onLayout:function(a,b){Ext.layout.MenuLayout.superclass.onLayout.call(this,a,b);this.doAutoSize()},doAutoSize:function(){var c=this.container,a=c.width;if(c.floating){if(a){c.setWidth(a)}else{if(Ext.isIE){c.setWidth(Ext.isStrict&&(Ext.isIE7||Ext.isIE8)?"auto":c.minWidth);var d=c.getEl(),b=d.dom.offsetWidth;c.setWidth(c.getLayoutTarget().getWidth()+d.getFrameWidth("lr"))}}}}});Ext.Container.LAYOUTS.menu=Ext.layout.MenuLayout;Ext.Viewport=Ext.extend(Ext.Container,{initComponent:function(){Ext.Viewport.superclass.initComponent.call(this);document.getElementsByTagName("html")[0].className+=" x-viewport";this.el=Ext.getBody();this.el.setHeight=Ext.emptyFn;this.el.setWidth=Ext.emptyFn;this.el.setSize=Ext.emptyFn;this.el.dom.scroll="no";this.allowDomMove=false;this.autoWidth=true;this.autoHeight=true;Ext.EventManager.onWindowResize(this.fireResize,this);this.renderTo=this.el},fireResize:function(a,b){this.fireEvent("resize",this,a,b,a,b)}});Ext.reg("viewport",Ext.Viewport);Ext.Panel=Ext.extend(Ext.Container,{baseCls:"x-panel",collapsedCls:"x-panel-collapsed",maskDisabled:true,animCollapse:Ext.enableFx,headerAsText:true,buttonAlign:"right",collapsed:false,collapseFirst:true,minButtonWidth:75,elements:"body",preventBodyReset:false,padding:undefined,resizeEvent:"bodyresize",toolTarget:"header",collapseEl:"bwrap",slideAnchor:"t",disabledClass:"",deferHeight:true,expandDefaults:{duration:0.25},collapseDefaults:{duration:0.25},initComponent:function(){Ext.Panel.superclass.initComponent.call(this);this.addEvents("bodyresize","titlechange","iconchange","collapse","expand","beforecollapse","beforeexpand","beforeclose","close","activate","deactivate");if(this.unstyled){this.baseCls="x-plain"}this.toolbars=[];if(this.tbar){this.elements+=",tbar";this.topToolbar=this.createToolbar(this.tbar);this.tbar=null}if(this.bbar){this.elements+=",bbar";this.bottomToolbar=this.createToolbar(this.bbar);this.bbar=null}if(this.header===true){this.elements+=",header";this.header=null}else{if(this.headerCfg||(this.title&&this.header!==false)){this.elements+=",header"}}if(this.footerCfg||this.footer===true){this.elements+=",footer";this.footer=null}if(this.buttons){this.fbar=this.buttons;this.buttons=null}if(this.fbar){this.createFbar(this.fbar)}if(this.autoLoad){this.on("render",this.doAutoLoad,this,{delay:10})}},createFbar:function(b){var a=this.minButtonWidth;this.elements+=",footer";this.fbar=this.createToolbar(b,{buttonAlign:this.buttonAlign,toolbarCls:"x-panel-fbar",enableOverflow:false,defaults:function(d){return{minWidth:d.minWidth||a}}});this.fbar.items.each(function(d){d.minWidth=d.minWidth||this.minButtonWidth},this);this.buttons=this.fbar.items.items},createToolbar:function(b,c){var a;if(Ext.isArray(b)){b={items:b}}a=b.events?Ext.apply(b,c):this.createComponent(Ext.apply({},b,c),"toolbar");this.toolbars.push(a);return a},createElement:function(a,c){if(this[a]){c.appendChild(this[a].dom);return}if(a==="bwrap"||this.elements.indexOf(a)!=-1){if(this[a+"Cfg"]){this[a]=Ext.fly(c).createChild(this[a+"Cfg"])}else{var b=document.createElement("div");b.className=this[a+"Cls"];this[a]=Ext.get(c.appendChild(b))}if(this[a+"CssClass"]){this[a].addClass(this[a+"CssClass"])}if(this[a+"Style"]){this[a].applyStyles(this[a+"Style"])}}},onRender:function(f,e){Ext.Panel.superclass.onRender.call(this,f,e);this.createClasses();var a=this.el,g=a.dom,j,h;if(this.collapsible&&!this.hideCollapseTool){this.tools=this.tools?this.tools.slice(0):[];this.tools[this.collapseFirst?"unshift":"push"]({id:"toggle",handler:this.toggleCollapse,scope:this})}if(this.tools){h=this.tools;this.elements+=(this.header!==false)?",header":""}this.tools={};a.addClass(this.baseCls);if(g.firstChild){this.header=a.down("."+this.headerCls);this.bwrap=a.down("."+this.bwrapCls);var i=this.bwrap?this.bwrap:a;this.tbar=i.down("."+this.tbarCls);this.body=i.down("."+this.bodyCls);this.bbar=i.down("."+this.bbarCls);this.footer=i.down("."+this.footerCls);this.fromMarkup=true}if(this.preventBodyReset===true){a.addClass("x-panel-reset")}if(this.cls){a.addClass(this.cls)}if(this.buttons){this.elements+=",footer"}if(this.frame){a.insertHtml("afterBegin",String.format(Ext.Element.boxMarkup,this.baseCls));this.createElement("header",g.firstChild.firstChild.firstChild);this.createElement("bwrap",g);j=this.bwrap.dom;var c=g.childNodes[1],b=g.childNodes[2];j.appendChild(c);j.appendChild(b);var k=j.firstChild.firstChild.firstChild;this.createElement("tbar",k);this.createElement("body",k);this.createElement("bbar",k);this.createElement("footer",j.lastChild.firstChild.firstChild);if(!this.footer){this.bwrap.dom.lastChild.className+=" x-panel-nofooter"}this.ft=Ext.get(this.bwrap.dom.lastChild);this.mc=Ext.get(k)}else{this.createElement("header",g);this.createElement("bwrap",g);j=this.bwrap.dom;this.createElement("tbar",j);this.createElement("body",j);this.createElement("bbar",j);this.createElement("footer",j);if(!this.header){this.body.addClass(this.bodyCls+"-noheader");if(this.tbar){this.tbar.addClass(this.tbarCls+"-noheader")}}}if(Ext.isDefined(this.padding)){this.body.setStyle("padding",this.body.addUnits(this.padding))}if(this.border===false){this.el.addClass(this.baseCls+"-noborder");this.body.addClass(this.bodyCls+"-noborder");if(this.header){this.header.addClass(this.headerCls+"-noborder")}if(this.footer){this.footer.addClass(this.footerCls+"-noborder")}if(this.tbar){this.tbar.addClass(this.tbarCls+"-noborder")}if(this.bbar){this.bbar.addClass(this.bbarCls+"-noborder")}}if(this.bodyBorder===false){this.body.addClass(this.bodyCls+"-noborder")}this.bwrap.enableDisplayMode("block");if(this.header){this.header.unselectable();if(this.headerAsText){this.header.dom.innerHTML=''+this.header.dom.innerHTML+"";if(this.iconCls){this.setIconClass(this.iconCls)}}}if(this.floating){this.makeFloating(this.floating)}if(this.collapsible&&this.titleCollapse&&this.header){this.mon(this.header,"click",this.toggleCollapse,this);this.header.setStyle("cursor","pointer")}if(h){this.addTool.apply(this,h)}if(this.fbar){this.footer.addClass("x-panel-btns");this.fbar.ownerCt=this;this.fbar.render(this.footer);this.footer.createChild({cls:"x-clear"})}if(this.tbar&&this.topToolbar){this.topToolbar.ownerCt=this;this.topToolbar.render(this.tbar)}if(this.bbar&&this.bottomToolbar){this.bottomToolbar.ownerCt=this;this.bottomToolbar.render(this.bbar)}},setIconClass:function(b){var a=this.iconCls;this.iconCls=b;if(this.rendered&&this.header){if(this.frame){this.header.addClass("x-panel-icon");this.header.replaceClass(a,this.iconCls)}else{var e=this.header,c=e.child("img.x-panel-inline-icon");if(c){Ext.fly(c).replaceClass(a,this.iconCls)}else{var d=e.child("span."+this.headerTextCls);if(d){Ext.DomHelper.insertBefore(d.dom,{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-panel-inline-icon "+this.iconCls})}}}}this.fireEvent("iconchange",this,b,a)},makeFloating:function(a){this.floating=true;this.el=new Ext.Layer(Ext.apply({},a,{shadow:Ext.isDefined(this.shadow)?this.shadow:"sides",shadowOffset:this.shadowOffset,constrain:false,shim:this.shim===false?false:undefined}),this.el)},getTopToolbar:function(){return this.topToolbar},getBottomToolbar:function(){return this.bottomToolbar},getFooterToolbar:function(){return this.fbar},addButton:function(a,c,b){if(!this.fbar){this.createFbar([])}if(c){if(Ext.isString(a)){a={text:a}}a=Ext.apply({handler:c,scope:b},a)}return this.fbar.add(a)},addTool:function(){if(!this.rendered){if(!this.tools){this.tools=[]}Ext.each(arguments,function(a){this.tools.push(a)},this);return}if(!this[this.toolTarget]){return}if(!this.toolTemplate){var g=new Ext.Template('
     
    ');g.disableFormats=true;g.compile();Ext.Panel.prototype.toolTemplate=g}for(var f=0,d=arguments,c=d.length;f0){Ext.each(this.toolbars,function(c){c.doLayout(undefined,a)});this.syncHeight()}},syncHeight:function(){var b=this.toolbarHeight,c=this.body,a=this.lastSize.height,d;if(this.autoHeight||!Ext.isDefined(a)||a=="auto"){return}if(b!=this.getToolbarHeight()){b=Math.max(0,a-this.getFrameHeight());c.setHeight(b);d=c.getSize();this.toolbarHeight=this.getToolbarHeight();this.onBodyResize(d.width,d.height)}},onShow:function(){if(this.floating){return this.el.show()}Ext.Panel.superclass.onShow.call(this)},onHide:function(){if(this.floating){return this.el.hide()}Ext.Panel.superclass.onHide.call(this)},createToolHandler:function(c,a,d,b){return function(f){c.removeClass(d);if(a.stopEvent!==false){f.stopEvent()}if(a.handler){a.handler.call(a.scope||c,f,c,b,a)}}},afterRender:function(){if(this.floating&&!this.hidden){this.el.show()}if(this.title){this.setTitle(this.title)}Ext.Panel.superclass.afterRender.call(this);if(this.collapsed){this.collapsed=false;this.collapse(false)}this.initEvents()},getKeyMap:function(){if(!this.keyMap){this.keyMap=new Ext.KeyMap(this.el,this.keys)}return this.keyMap},initEvents:function(){if(this.keys){this.getKeyMap()}if(this.draggable){this.initDraggable()}if(this.toolbars.length>0){Ext.each(this.toolbars,function(a){a.doLayout();a.on({scope:this,afterlayout:this.syncHeight,remove:this.syncHeight})},this);this.syncHeight()}},initDraggable:function(){this.dd=new Ext.Panel.DD(this,Ext.isBoolean(this.draggable)?null:this.draggable)},beforeEffect:function(a){if(this.floating){this.el.beforeAction()}if(a!==false){this.el.addClass("x-panel-animated")}},afterEffect:function(a){this.syncShadow();this.el.removeClass("x-panel-animated")},createEffect:function(c,b,d){var e={scope:d,block:true};if(c===true){e.callback=b;return e}else{if(!c.callback){e.callback=b}else{e.callback=function(){b.call(d);Ext.callback(c.callback,c.scope)}}}return Ext.applyIf(e,c)},collapse:function(b){if(this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforecollapse",this,b)===false){return}var a=b===true||(b!==false&&this.animCollapse);this.beforeEffect(a);this.onCollapse(a,b);return this},onCollapse:function(a,b){if(a){this[this.collapseEl].slideOut(this.slideAnchor,Ext.apply(this.createEffect(b||true,this.afterCollapse,this),this.collapseDefaults))}else{this[this.collapseEl].hide(this.hideMode);this.afterCollapse(false)}},afterCollapse:function(a){this.collapsed=true;this.el.addClass(this.collapsedCls);if(a!==false){this[this.collapseEl].hide(this.hideMode)}this.afterEffect(a);this.cascade(function(b){if(b.lastSize){b.lastSize={width:undefined,height:undefined}}});this.fireEvent("collapse",this)},expand:function(b){if(!this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforeexpand",this,b)===false){return}var a=b===true||(b!==false&&this.animCollapse);this.el.removeClass(this.collapsedCls);this.beforeEffect(a);this.onExpand(a,b);return this},onExpand:function(a,b){if(a){this[this.collapseEl].slideIn(this.slideAnchor,Ext.apply(this.createEffect(b||true,this.afterExpand,this),this.expandDefaults))}else{this[this.collapseEl].show(this.hideMode);this.afterExpand(false)}},afterExpand:function(a){this.collapsed=false;if(a!==false){this[this.collapseEl].show(this.hideMode)}this.afterEffect(a);if(this.deferLayout){delete this.deferLayout;this.doLayout(true)}this.fireEvent("expand",this)},toggleCollapse:function(a){this[this.collapsed?"expand":"collapse"](a);return this},onDisable:function(){if(this.rendered&&this.maskDisabled){this.el.mask()}Ext.Panel.superclass.onDisable.call(this)},onEnable:function(){if(this.rendered&&this.maskDisabled){this.el.unmask()}Ext.Panel.superclass.onEnable.call(this)},onResize:function(f,d,c,e){var a=f,b=d;if(Ext.isDefined(a)||Ext.isDefined(b)){if(!this.collapsed){if(Ext.isNumber(a)){this.body.setWidth(a=this.adjustBodyWidth(a-this.getFrameWidth()))}else{if(a=="auto"){a=this.body.setWidth("auto").dom.offsetWidth}else{a=this.body.dom.offsetWidth}}if(this.tbar){this.tbar.setWidth(a);if(this.topToolbar){this.topToolbar.setSize(a)}}if(this.bbar){this.bbar.setWidth(a);if(this.bottomToolbar){this.bottomToolbar.setSize(a);if(Ext.isIE){this.bbar.setStyle("position","static");this.bbar.setStyle("position","")}}}if(this.footer){this.footer.setWidth(a);if(this.fbar){this.fbar.setSize(Ext.isIE?(a-this.footer.getFrameWidth("lr")):"auto")}}if(Ext.isNumber(b)){b=Math.max(0,b-this.getFrameHeight());this.body.setHeight(b)}else{if(b=="auto"){this.body.setHeight(b)}}if(this.disabled&&this.el._mask){this.el._mask.setSize(this.el.dom.clientWidth,this.el.getHeight())}}else{this.queuedBodySize={width:a,height:b};if(!this.queuedExpand&&this.allowQueuedExpand!==false){this.queuedExpand=true;this.on("expand",function(){delete this.queuedExpand;this.onResize(this.queuedBodySize.width,this.queuedBodySize.height)},this,{single:true})}}this.onBodyResize(a,b)}this.syncShadow();Ext.Panel.superclass.onResize.call(this,f,d,c,e)},onBodyResize:function(a,b){this.fireEvent("bodyresize",this,a,b)},getToolbarHeight:function(){var a=0;if(this.rendered){Ext.each(this.toolbars,function(b){a+=b.getHeight()},this)}return a},adjustBodyHeight:function(a){return a},adjustBodyWidth:function(a){return a},onPosition:function(){this.syncShadow()},getFrameWidth:function(){var b=this.el.getFrameWidth("lr")+this.bwrap.getFrameWidth("lr");if(this.frame){var a=this.bwrap.dom.firstChild;b+=(Ext.fly(a).getFrameWidth("l")+Ext.fly(a.firstChild).getFrameWidth("r"));b+=this.mc.getFrameWidth("lr")}return b},getFrameHeight:function(){var a=Math.max(0,this.getHeight()-this.body.getHeight());if(isNaN(a)){a=0}return a},getInnerWidth:function(){return this.getSize().width-this.getFrameWidth()},getInnerHeight:function(){return this.body.getHeight()},syncShadow:function(){if(this.floating){this.el.sync(true)}},getLayoutTarget:function(){return this.body},getContentTarget:function(){return this.body},setTitle:function(b,a){this.title=b;if(this.header&&this.headerAsText){this.header.child("span").update(b)}if(a){this.setIconClass(a)}this.fireEvent("titlechange",this,b);return this},getUpdater:function(){return this.body.getUpdater()},load:function(){var a=this.body.getUpdater();a.update.apply(a,arguments);return this},beforeDestroy:function(){Ext.Panel.superclass.beforeDestroy.call(this);if(this.header){this.header.removeAllListeners()}if(this.tools){for(var a in this.tools){Ext.destroy(this.tools[a])}}if(this.toolbars.length>0){Ext.each(this.toolbars,function(b){b.un("afterlayout",this.syncHeight,this);b.un("remove",this.syncHeight,this)},this)}if(Ext.isArray(this.buttons)){while(this.buttons.length){Ext.destroy(this.buttons[0])}}if(this.rendered){Ext.destroy(this.ft,this.header,this.footer,this.tbar,this.bbar,this.body,this.mc,this.bwrap,this.dd);if(this.fbar){Ext.destroy(this.fbar,this.fbar.el)}}Ext.destroy(this.toolbars)},createClasses:function(){this.headerCls=this.baseCls+"-header";this.headerTextCls=this.baseCls+"-header-text";this.bwrapCls=this.baseCls+"-bwrap";this.tbarCls=this.baseCls+"-tbar";this.bodyCls=this.baseCls+"-body";this.bbarCls=this.baseCls+"-bbar";this.footerCls=this.baseCls+"-footer"},createGhost:function(a,e,b){var d=document.createElement("div");d.className="x-panel-ghost "+(a?a:"");if(this.header){d.appendChild(this.el.dom.firstChild.cloneNode(true))}Ext.fly(d.appendChild(document.createElement("ul"))).setHeight(this.bwrap.getHeight());d.style.width=this.el.dom.offsetWidth+"px";if(!b){this.container.dom.appendChild(d)}else{Ext.getDom(b).appendChild(d)}if(e!==false&&this.el.useShim!==false){var c=new Ext.Layer({shadow:false,useDisplay:true,constrain:false},d);c.show();return c}else{return new Ext.Element(d)}},doAutoLoad:function(){var a=this.body.getUpdater();if(this.renderer){a.setRenderer(this.renderer)}a.update(Ext.isObject(this.autoLoad)?this.autoLoad:{url:this.autoLoad})},getTool:function(a){return this.tools[a]}});Ext.reg("panel",Ext.Panel);Ext.Editor=function(b,a){if(b.field){this.field=Ext.create(b.field,"textfield");a=Ext.apply({},b);delete a.field}else{this.field=b}Ext.Editor.superclass.constructor.call(this,a)};Ext.extend(Ext.Editor,Ext.Component,{allowBlur:true,value:"",alignment:"c-c?",offsets:[0,0],shadow:"frame",constrain:false,swallowKeys:true,completeOnEnter:true,cancelOnEsc:true,updateEl:false,initComponent:function(){Ext.Editor.superclass.initComponent.call(this);this.addEvents("beforestartedit","startedit","beforecomplete","complete","canceledit","specialkey")},onRender:function(b,a){this.el=new Ext.Layer({shadow:this.shadow,cls:"x-editor",parentEl:b,shim:this.shim,shadowOffset:this.shadowOffset||4,id:this.id,constrain:this.constrain});if(this.zIndex){this.el.setZIndex(this.zIndex)}this.el.setStyle("overflow",Ext.isGecko?"auto":"hidden");if(this.field.msgTarget!="title"){this.field.msgTarget="qtip"}this.field.inEditor=true;this.mon(this.field,{scope:this,blur:this.onBlur,specialkey:this.onSpecialKey});if(this.field.grow){this.mon(this.field,"autosize",this.el.sync,this.el,{delay:1})}this.field.render(this.el).show();this.field.getEl().dom.name="";if(this.swallowKeys){this.field.el.swallowEvent(["keypress","keydown"])}},onSpecialKey:function(f,d){var b=d.getKey(),a=this.completeOnEnter&&b==d.ENTER,c=this.cancelOnEsc&&b==d.ESC;if(a||c){d.stopEvent();if(a){this.completeEdit()}else{this.cancelEdit()}if(f.triggerBlur){f.triggerBlur()}}this.fireEvent("specialkey",f,d)},startEdit:function(b,c){if(this.editing){this.completeEdit()}this.boundEl=Ext.get(b);var a=c!==undefined?c:this.boundEl.dom.innerHTML;if(!this.rendered){this.render(this.parentEl||document.body)}if(this.fireEvent("beforestartedit",this,this.boundEl,a)!==false){this.startValue=a;this.field.reset();this.field.setValue(a);this.realign(true);this.editing=true;this.show()}},doAutoSize:function(){if(this.autoSize){var b=this.boundEl.getSize(),a=this.field.getSize();switch(this.autoSize){case"width":this.setSize(b.width,a.height);break;case"height":this.setSize(a.width,b.height);break;case"none":this.setSize(a.width,a.height);break;default:this.setSize(b.width,b.height)}}},setSize:function(a,b){delete this.field.lastSize;this.field.setSize(a,b);if(this.el){if(Ext.isGecko2||Ext.isOpera){this.el.setSize(a,b)}this.el.sync()}},realign:function(a){if(a===true){this.doAutoSize()}this.el.alignTo(this.boundEl,this.alignment,this.offsets)},completeEdit:function(a){if(!this.editing){return}if(this.field.assertValue){this.field.assertValue()}var b=this.getValue();if(!this.field.isValid()){if(this.revertInvalid!==false){this.cancelEdit(a)}return}if(String(b)===String(this.startValue)&&this.ignoreNoChange){this.hideEdit(a);return}if(this.fireEvent("beforecomplete",this,b,this.startValue)!==false){b=this.getValue();if(this.updateEl&&this.boundEl){this.boundEl.update(b)}this.hideEdit(a);this.fireEvent("complete",this,b,this.startValue)}},onShow:function(){this.el.show();if(this.hideEl!==false){this.boundEl.hide()}this.field.show().focus(false,true);this.fireEvent("startedit",this.boundEl,this.startValue)},cancelEdit:function(a){if(this.editing){var b=this.getValue();this.setValue(this.startValue);this.hideEdit(a);this.fireEvent("canceledit",this,b,this.startValue)}},hideEdit:function(a){if(a!==true){this.editing=false;this.hide()}},onBlur:function(){if(this.allowBlur===true&&this.editing&&this.selectSameEditor!==true){this.completeEdit()}},onHide:function(){if(this.editing){this.completeEdit();return}this.field.blur();if(this.field.collapse){this.field.collapse()}this.el.hide();if(this.hideEl!==false){this.boundEl.show()}},setValue:function(a){this.field.setValue(a)},getValue:function(){return this.field.getValue()},beforeDestroy:function(){Ext.destroyMembers(this,"field");delete this.parentEl;delete this.boundEl}});Ext.reg("editor",Ext.Editor);Ext.ColorPalette=Ext.extend(Ext.Component,{itemCls:"x-color-palette",value:null,clickEvent:"click",ctype:"Ext.ColorPalette",allowReselect:false,colors:["000000","993300","333300","003300","003366","000080","333399","333333","800000","FF6600","808000","008000","008080","0000FF","666699","808080","FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","969696","FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0","FF99CC","FFCC99","FFFF99","CCFFCC","CCFFFF","99CCFF","CC99FF","FFFFFF"],initComponent:function(){Ext.ColorPalette.superclass.initComponent.call(this);this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope,true)}},onRender:function(b,a){this.autoEl={tag:"div",cls:this.itemCls};Ext.ColorPalette.superclass.onRender.call(this,b,a);var c=this.tpl||new Ext.XTemplate(' ');c.overwrite(this.el,this.colors);this.mon(this.el,this.clickEvent,this.handleClick,this,{delegate:"a"});if(this.clickEvent!="click"){this.mon(this.el,"click",Ext.emptyFn,this,{delegate:"a",preventDefault:true})}},afterRender:function(){Ext.ColorPalette.superclass.afterRender.call(this);if(this.value){var a=this.value;this.value=null;this.select(a,true)}},handleClick:function(b,a){b.preventDefault();if(!this.disabled){var d=a.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];this.select(d.toUpperCase())}},select:function(b,a){b=b.replace("#","");if(b!=this.value||this.allowReselect){var c=this.el;if(this.value){c.child("a.color-"+this.value).removeClass("x-color-palette-sel")}c.child("a.color-"+b).addClass("x-color-palette-sel");this.value=b;if(a!==true){this.fireEvent("select",this,b)}}}});Ext.reg("colorpalette",Ext.ColorPalette);Ext.DatePicker=Ext.extend(Ext.BoxComponent,{todayText:"Today",okText:" OK ",cancelText:"Cancel",todayTip:"{0} (Spacebar)",minText:"This date is before the minimum date",maxText:"This date is after the maximum date",format:"m/d/y",disabledDaysText:"Disabled",disabledDatesText:"Disabled",monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:"Next Month (Control+Right)",prevText:"Previous Month (Control+Left)",monthYearText:"Choose a month (Control+Up/Down to move years)",startDay:0,showToday:true,focusOnSelect:true,initHour:12,initComponent:function(){Ext.DatePicker.superclass.initComponent.call(this);this.value=this.value?this.value.clearTime(true):new Date().clearTime();this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope||this)}this.initDisabledDays()},initDisabledDays:function(){if(!this.disabledDatesRE&&this.disabledDates){var b=this.disabledDates,a=b.length-1,c="(?:";Ext.each(b,function(f,e){c+=Ext.isDate(f)?"^"+Ext.escapeRe(f.dateFormat(this.format))+"$":b[e];if(e!=a){c+="|"}},this);this.disabledDatesRE=new RegExp(c+")")}},setDisabledDates:function(a){if(Ext.isArray(a)){this.disabledDates=a;this.disabledDatesRE=null}else{this.disabledDatesRE=a}this.initDisabledDays();this.update(this.value,true)},setDisabledDays:function(a){this.disabledDays=a;this.update(this.value,true)},setMinDate:function(a){this.minDate=a;this.update(this.value,true)},setMaxDate:function(a){this.maxDate=a;this.update(this.value,true)},setValue:function(a){this.value=a.clearTime(true);this.update(this.value)},getValue:function(){return this.value},focus:function(){this.update(this.activeDate)},onEnable:function(a){Ext.DatePicker.superclass.onEnable.call(this);this.doDisabled(false);this.update(a?this.value:this.activeDate);if(Ext.isIE){this.el.repaint()}},onDisable:function(){Ext.DatePicker.superclass.onDisable.call(this);this.doDisabled(true);if(Ext.isIE&&!Ext.isIE8){Ext.each([].concat(this.textNodes,this.el.query("th span")),function(a){Ext.fly(a).repaint()})}},doDisabled:function(a){this.keyNav.setDisabled(a);this.prevRepeater.setDisabled(a);this.nextRepeater.setDisabled(a);if(this.showToday){this.todayKeyListener.setDisabled(a);this.todayBtn.setDisabled(a)}},onRender:function(e,b){var a=['','','",this.showToday?'':"",'
      
    '],c=this.dayNames,g;for(g=0;g<7;g++){var j=this.startDay+g;if(j>6){j=j-7}a.push("")}a[a.length]="";for(g=0;g<42;g++){if(g%7===0&&g!==0){a[a.length]=""}a[a.length]=''}a.push("
    ",c[j].substr(0,1),"
    ');var h=document.createElement("div");h.className="x-date-picker";h.innerHTML=a.join("");e.dom.insertBefore(h,b);this.el=Ext.get(h);this.eventEl=Ext.get(h.firstChild);this.prevRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-left a"),{handler:this.showPrevMonth,scope:this,preventDefault:true,stopDefault:true});this.nextRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-right a"),{handler:this.showNextMonth,scope:this,preventDefault:true,stopDefault:true});this.monthPicker=this.el.down("div.x-date-mp");this.monthPicker.enableDisplayMode("block");this.keyNav=new Ext.KeyNav(this.eventEl,{left:function(d){if(d.ctrlKey){this.showPrevMonth()}else{this.update(this.activeDate.add("d",-1))}},right:function(d){if(d.ctrlKey){this.showNextMonth()}else{this.update(this.activeDate.add("d",1))}},up:function(d){if(d.ctrlKey){this.showNextYear()}else{this.update(this.activeDate.add("d",-7))}},down:function(d){if(d.ctrlKey){this.showPrevYear()}else{this.update(this.activeDate.add("d",7))}},pageUp:function(d){this.showNextMonth()},pageDown:function(d){this.showPrevMonth()},enter:function(d){d.stopPropagation();return true},scope:this});this.el.unselectable();this.cells=this.el.select("table.x-date-inner tbody td");this.textNodes=this.el.query("table.x-date-inner tbody span");this.mbtn=new Ext.Button({text:" ",tooltip:this.monthYearText,renderTo:this.el.child("td.x-date-middle",true)});this.mbtn.el.child("em").addClass("x-btn-arrow");if(this.showToday){this.todayKeyListener=this.eventEl.addKeyListener(Ext.EventObject.SPACE,this.selectToday,this);var f=(new Date()).dateFormat(this.format);this.todayBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom",true),text:String.format(this.todayText,f),tooltip:String.format(this.todayTip,f),handler:this.selectToday,scope:this})}this.mon(this.eventEl,"mousewheel",this.handleMouseWheel,this);this.mon(this.eventEl,"click",this.handleDateClick,this,{delegate:"a.x-date-date"});this.mon(this.mbtn,"click",this.showMonthPicker,this);this.onEnable(true)},createMonthPicker:function(){if(!this.monthPicker.dom.firstChild){var a=[''];for(var b=0;b<6;b++){a.push('",'",b===0?'':'')}a.push('","
    ',Date.getShortMonthName(b),"',Date.getShortMonthName(b+6),"
    ");this.monthPicker.update(a.join(""));this.mon(this.monthPicker,"click",this.onMonthClick,this);this.mon(this.monthPicker,"dblclick",this.onMonthDblClick,this);this.mpMonths=this.monthPicker.select("td.x-date-mp-month");this.mpYears=this.monthPicker.select("td.x-date-mp-year");this.mpMonths.each(function(c,d,e){e+=1;if((e%2)===0){c.dom.xmonth=5+Math.round(e*0.5)}else{c.dom.xmonth=Math.round((e-1)*0.5)}})}},showMonthPicker:function(){if(!this.disabled){this.createMonthPicker();var a=this.el.getSize();this.monthPicker.setSize(a);this.monthPicker.child("table").setSize(a);this.mpSelMonth=(this.activeDate||this.value).getMonth();this.updateMPMonth(this.mpSelMonth);this.mpSelYear=(this.activeDate||this.value).getFullYear();this.updateMPYear(this.mpSelYear);this.monthPicker.slideIn("t",{duration:0.2})}},updateMPYear:function(e){this.mpyear=e;var c=this.mpYears.elements;for(var b=1;b<=10;b++){var d=c[b-1],a;if((b%2)===0){a=e+Math.round(b*0.5);d.firstChild.innerHTML=a;d.xyear=a}else{a=e-(5-Math.round(b*0.5));d.firstChild.innerHTML=a;d.xyear=a}this.mpYears.item(b-1)[a==this.mpSelYear?"addClass":"removeClass"]("x-date-mp-sel")}},updateMPMonth:function(a){this.mpMonths.each(function(b,c,d){b[b.dom.xmonth==a?"addClass":"removeClass"]("x-date-mp-sel")})},selectMPMonth:function(a){},onMonthClick:function(f,b){f.stopEvent();var c=new Ext.Element(b),a;if(c.is("button.x-date-mp-cancel")){this.hideMonthPicker()}else{if(c.is("button.x-date-mp-ok")){var g=new Date(this.mpSelYear,this.mpSelMonth,(this.activeDate||this.value).getDate());if(g.getMonth()!=this.mpSelMonth){g=new Date(this.mpSelYear,this.mpSelMonth,1).getLastDateOfMonth()}this.update(g);this.hideMonthPicker()}else{if((a=c.up("td.x-date-mp-month",2))){this.mpMonths.removeClass("x-date-mp-sel");a.addClass("x-date-mp-sel");this.mpSelMonth=a.dom.xmonth}else{if((a=c.up("td.x-date-mp-year",2))){this.mpYears.removeClass("x-date-mp-sel");a.addClass("x-date-mp-sel");this.mpSelYear=a.dom.xyear}else{if(c.is("a.x-date-mp-prev")){this.updateMPYear(this.mpyear-10)}else{if(c.is("a.x-date-mp-next")){this.updateMPYear(this.mpyear+10)}}}}}}},onMonthDblClick:function(d,b){d.stopEvent();var c=new Ext.Element(b),a;if((a=c.up("td.x-date-mp-month",2))){this.update(new Date(this.mpSelYear,a.dom.xmonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}else{if((a=c.up("td.x-date-mp-year",2))){this.update(new Date(a.dom.xyear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}}},hideMonthPicker:function(a){if(this.monthPicker){if(a===true){this.monthPicker.hide()}else{this.monthPicker.slideOut("t",{duration:0.2})}}},showPrevMonth:function(a){this.update(this.activeDate.add("mo",-1))},showNextMonth:function(a){this.update(this.activeDate.add("mo",1))},showPrevYear:function(){this.update(this.activeDate.add("y",-1))},showNextYear:function(){this.update(this.activeDate.add("y",1))},handleMouseWheel:function(a){a.stopEvent();if(!this.disabled){var b=a.getWheelDelta();if(b>0){this.showPrevMonth()}else{if(b<0){this.showNextMonth()}}}},handleDateClick:function(b,a){b.stopEvent();if(!this.disabled&&a.dateValue&&!Ext.fly(a.parentNode).hasClass("x-date-disabled")){this.cancelFocus=this.focusOnSelect===false;this.setValue(new Date(a.dateValue));delete this.cancelFocus;this.fireEvent("select",this,this.value)}},selectToday:function(){if(this.todayBtn&&!this.todayBtn.disabled){this.setValue(new Date().clearTime());this.fireEvent("select",this,this.value)}},update:function(F,z){if(this.rendered){var a=this.activeDate,o=this.isVisible();this.activeDate=F;if(!z&&a&&this.el){var n=F.getTime();if(a.getMonth()==F.getMonth()&&a.getFullYear()==F.getFullYear()){this.cells.removeClass("x-date-selected");this.cells.each(function(d){if(d.dom.firstChild.dateValue==n){d.addClass("x-date-selected");if(o&&!this.cancelFocus){Ext.fly(d.dom.firstChild).focus(50)}return false}},this);return}}var j=F.getDaysInMonth(),p=F.getFirstDateOfMonth(),f=p.getDay()-this.startDay;if(f<0){f+=7}j+=f;var A=F.add("mo",-1),g=A.getDaysInMonth()-f,e=this.cells.elements,q=this.textNodes,C=(new Date(A.getFullYear(),A.getMonth(),g,this.initHour)),B=new Date().clearTime().getTime(),u=F.clearTime(true).getTime(),s=this.minDate?this.minDate.clearTime(true):Number.NEGATIVE_INFINITY,x=this.maxDate?this.maxDate.clearTime(true):Number.POSITIVE_INFINITY,E=this.disabledDatesRE,r=this.disabledDatesText,H=this.disabledDays?this.disabledDays.join(""):false,D=this.disabledDaysText,y=this.format;if(this.showToday){var l=new Date().clearTime(),c=(lx||(E&&y&&E.test(l.dateFormat(y)))||(H&&H.indexOf(l.getDay())!=-1));if(!this.disabled){this.todayBtn.setDisabled(c);this.todayKeyListener[c?"disable":"enable"]()}}var k=function(I,d){d.title="";var i=C.clearTime(true).getTime();d.firstChild.dateValue=i;if(i==B){d.className+=" x-date-today";d.title=I.todayText}if(i==u){d.className+=" x-date-selected";if(o){Ext.fly(d.firstChild).focus(50)}}if(ix){d.className=" x-date-disabled";d.title=I.maxText;return}if(H){if(H.indexOf(C.getDay())!=-1){d.title=D;d.className=" x-date-disabled"}}if(E&&y){var w=C.dateFormat(y);if(E.test(w)){d.title=r.replace("%0",w);d.className=" x-date-disabled"}}};var v=0;for(;v=a.value){d=a.value}}c.setValue(b,d,false);c.fireEvent("drag",c,f,this)},getNewValue:function(){var a=this.slider,b=a.innerEl.translatePoints(this.tracker.getXY());return Ext.util.Format.round(a.reverseValue(b.left),a.decimalPrecision)},onDragEnd:function(c){var a=this.slider,b=this.value;this.el.removeClass("x-slider-thumb-drag");this.dragging=false;a.fireEvent("dragend",a,c);if(this.dragStartValue!=b){a.fireEvent("changecomplete",a,b,this)}}});Ext.slider.MultiSlider=Ext.extend(Ext.BoxComponent,{vertical:false,minValue:0,maxValue:100,decimalPrecision:0,keyIncrement:1,increment:0,clickRange:[5,15],clickToChange:true,animate:true,dragging:false,constrainThumbs:true,topThumbZIndex:10000,initComponent:function(){if(!Ext.isDefined(this.value)){this.value=this.minValue}this.thumbs=[];Ext.slider.MultiSlider.superclass.initComponent.call(this);this.keyIncrement=Math.max(this.increment,this.keyIncrement);this.addEvents("beforechange","change","changecomplete","dragstart","drag","dragend");if(this.values==undefined||Ext.isEmpty(this.values)){this.values=[0]}var a=this.values;for(var b=0;bthis.clickRange[0]&&c.top=c){d+=c}else{if(a*2<-c){d-=c}}}return d.constrain(this.minValue,this.maxValue)},afterRender:function(){Ext.slider.MultiSlider.superclass.afterRender.apply(this,arguments);for(var c=0;ce?e:c.value}this.syncThumb()},setValue:function(d,c,b,f){var a=this.thumbs[d],e=a.el;c=this.normalizeValue(c);if(c!==a.value&&this.fireEvent("beforechange",this,c,a.value,a)!==false){a.value=c;if(this.rendered){this.moveThumb(d,this.translateValue(c),b!==false);this.fireEvent("change",this,c,a);if(f){this.fireEvent("changecomplete",this,c,a)}}}},translateValue:function(a){var b=this.getRatio();return(a*b)-(this.minValue*b)-this.halfThumb},reverseValue:function(b){var a=this.getRatio();return(b+(this.minValue*a))/a},moveThumb:function(d,c,b){var a=this.thumbs[d].el;if(!b||this.animate===false){a.setLeft(c)}else{a.shift({left:c,stopFx:true,duration:0.35})}},focus:function(){this.focusEl.focus(10)},onResize:function(c,e){var b=this.thumbs,a=b.length,d=0;for(;dthis.clickRange[0]&&c.left','
    ','
    ','
    ',"
     
    ","
    ","
    ",'
    ',"
     
    ","
    ","
    ","");this.el=a?c.insertBefore(a,{cls:this.baseCls},true):c.append(d,{cls:this.baseCls},true);if(this.id){this.el.dom.id=this.id}var b=this.el.dom.firstChild;this.progressBar=Ext.get(b.firstChild);if(this.textEl){this.textEl=Ext.get(this.textEl);delete this.textTopEl}else{this.textTopEl=Ext.get(this.progressBar.dom.firstChild);var e=Ext.get(b.childNodes[1]);this.textTopEl.setStyle("z-index",99).addClass("x-hidden");this.textEl=new Ext.CompositeElement([this.textTopEl.dom.firstChild,e.dom.firstChild]);this.textEl.setWidth(b.offsetWidth)}this.progressBar.setHeight(b.offsetHeight)},afterRender:function(){Ext.ProgressBar.superclass.afterRender.call(this);if(this.value){this.updateProgress(this.value,this.text)}else{this.updateText(this.text)}},updateProgress:function(c,d,b){this.value=c||0;if(d){this.updateText(d)}if(this.rendered&&!this.isDestroyed){var a=Math.floor(c*this.el.dom.firstChild.offsetWidth);this.progressBar.setWidth(a,b===true||(b!==false&&this.animate));if(this.textTopEl){this.textTopEl.removeClass("x-hidden").setWidth(a)}}this.fireEvent("update",this,c,d);return this},wait:function(b){if(!this.waitTimer){var a=this;b=b||{};this.updateText(b.text);this.waitTimer=Ext.TaskMgr.start({run:function(c){var d=b.increment||10;c-=1;this.updateProgress(((((c+d)%d)+1)*(100/d))*0.01,null,b.animate)},interval:b.interval||1000,duration:b.duration,onStop:function(){if(b.fn){b.fn.apply(b.scope||this)}this.reset()},scope:a})}return this},isWaiting:function(){return this.waitTimer!==null},updateText:function(a){this.text=a||" ";if(this.rendered){this.textEl.update(this.text)}return this},syncProgressBar:function(){if(this.value){this.updateProgress(this.value,this.text)}return this},setSize:function(a,c){Ext.ProgressBar.superclass.setSize.call(this,a,c);if(this.textTopEl){var b=this.el.dom.firstChild;this.textEl.setSize(b.offsetWidth,b.offsetHeight)}this.syncProgressBar();return this},reset:function(a){this.updateProgress(0);if(this.textTopEl){this.textTopEl.addClass("x-hidden")}this.clearTimer();if(a===true){this.hide()}return this},clearTimer:function(){if(this.waitTimer){this.waitTimer.onStop=null;Ext.TaskMgr.stop(this.waitTimer);this.waitTimer=null}},onDestroy:function(){this.clearTimer();if(this.rendered){if(this.textEl.isComposite){this.textEl.clear()}Ext.destroyMembers(this,"textEl","progressBar","textTopEl")}Ext.ProgressBar.superclass.onDestroy.call(this)}});Ext.reg("progress",Ext.ProgressBar); \ No newline at end of file diff --git a/pkgs/data-foundation-debug.js b/pkgs/data-foundation-debug.js index 4690ee8f..dae79d24 100644 --- a/pkgs/data-foundation-debug.js +++ b/pkgs/data-foundation-debug.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -1496,6 +1496,7 @@ sortInfo: { Ext.each(record, function(r){ this.remove(r); }, this); + return; } var index = this.data.indexOf(record); if(index > -1){ @@ -2201,6 +2202,7 @@ myStore.reload(lastOptions); }, /** + * @private * Creates and returns a function which sorts an array by the given field and direction * @param {String} field The field to create the sorter for * @param {String} direction The direction to sort by (defaults to "ASC") @@ -2407,6 +2409,7 @@ myStore.reload(lastOptions); }, /** + * @private * Given an array of filter functions (each with optional scope), constructs and returns a single function that returns * the result of all of the filters ANDed together * @param {Array} filters The array of filter objects (each object should contain an 'fn' and optional scope) @@ -2434,6 +2437,7 @@ myStore.reload(lastOptions); * Single filter example: * store.filter('name', 'Ed', true, true); //finds all records containing the substring 'Ed' * Multiple filter example: + *
    
          * store.filter([
          *   {
          *     property     : 'name',
    @@ -2450,6 +2454,7 @@ myStore.reload(lastOptions);
          *     scope: this
          *   }
          * ]);
    +     * 
    * @param {String|Array} field A field on your records, or an array containing multiple filter options * @param {String/RegExp} value Either a string that the field should begin with, or a RegExp to test * against the field. diff --git a/pkgs/data-foundation.js b/pkgs/data-foundation.js index 03a2330f..edd64e1c 100644 --- a/pkgs/data-foundation.js +++ b/pkgs/data-foundation.js @@ -1,7 +1,7 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ -Ext.data.Api=(function(){var a={};return{actions:{create:"create",read:"read",update:"update",destroy:"destroy"},restActions:{create:"POST",read:"GET",update:"PUT",destroy:"DELETE"},isAction:function(b){return(Ext.data.Api.actions[b])?true:false},getVerb:function(b){if(a[b]){return a[b]}for(var c in this.actions){if(this.actions[c]===b){a[b]=c;break}}return(a[b]!==undefined)?a[b]:null},isValid:function(b){var e=[];var d=this.actions;for(var c in b){if(!(c in d)){e.push(c)}}return(!e.length)?true:e},hasUniqueUrl:function(c,f){var b=(c.api[f])?c.api[f].url:null;var e=true;for(var d in c.api){if((e=(d===f)?true:(c.api[d].url!=b)?true:false)===false){break}}return e},prepare:function(b){if(!b.api){b.api={}}for(var d in this.actions){var c=this.actions[d];b.api[c]=b.api[c]||b.url||b.directFn;if(typeof(b.api[c])=="string"){b.api[c]={url:b.api[c],method:(b.restful===true)?Ext.data.Api.restActions[c]:undefined}}}},restify:function(b){b.restful=true;for(var c in this.restActions){b.api[this.actions[c]].method||(b.api[this.actions[c]].method=this.restActions[c])}b.onWrite=b.onWrite.createInterceptor(function(h,i,f,e){var d=i.reader;var g=new Ext.data.Response({action:h,raw:f});switch(f.status){case 200:return true;break;case 201:if(Ext.isEmpty(g.raw.responseText)){g.success=true}else{return true}break;case 204:g.success=true;g.data=null;break;default:return true;break}if(g.success===true){this.fireEvent("write",this,h,g.data,g,e,i.request.arg)}else{this.fireEvent("exception",this,"remote",h,i,g,e)}i.request.callback.call(i.request.scope,g.data,g,g.success);return false},b)}}})();Ext.data.Response=function(b,a){Ext.apply(this,b,{raw:a})};Ext.data.Response.prototype={message:null,success:false,status:null,root:null,raw:null,getMessage:function(){return this.message},getSuccess:function(){return this.success},getStatus:function(){return this.status},getRoot:function(){return this.root},getRawResponse:function(){return this.raw}};Ext.data.Api.Error=Ext.extend(Ext.Error,{constructor:function(b,a){this.arg=a;Ext.Error.call(this,b)},name:"Ext.data.Api"});Ext.apply(Ext.data.Api.Error.prototype,{lang:{"action-url-undefined":"No fallback url defined for this action. When defining a DataProxy api, please be sure to define an url for each CRUD action in Ext.data.Api.actions or define a default url in addition to your api-configuration.",invalid:"received an invalid API-configuration. Please ensure your proxy API-configuration contains only the actions defined in Ext.data.Api.actions","invalid-url":"Invalid url. Please review your proxy configuration.",execute:'Attempted to execute an unknown action. Valid API actions are defined in Ext.data.Api.actions"'}});Ext.data.SortTypes={none:function(a){return a},stripTagsRE:/<\/?[^>]+>/gi,asText:function(a){return String(a).replace(this.stripTagsRE,"")},asUCText:function(a){return String(a).toUpperCase().replace(this.stripTagsRE,"")},asUCString:function(a){return String(a).toUpperCase()},asDate:function(a){if(!a){return 0}if(Ext.isDate(a)){return a.getTime()}return Date.parse(String(a))},asFloat:function(a){var b=parseFloat(String(a).replace(/,/g,""));return isNaN(b)?0:b},asInt:function(a){var b=parseInt(String(a).replace(/,/g,""),10);return isNaN(b)?0:b}};Ext.data.Record=function(a,b){this.id=(b||b===0)?b:Ext.data.Record.id(this);this.data=a||{}};Ext.data.Record.create=function(e){var c=Ext.extend(Ext.data.Record,{});var d=c.prototype;d.fields=new Ext.util.MixedCollection(false,function(f){return f.name});for(var b=0,a=e.length;b-1){a.join(null);this.data.removeAt(b)}if(this.pruneModifiedRecords){this.modified.remove(a)}if(this.snapshot){this.snapshot.remove(a)}if(b>-1){this.fireEvent("remove",this,a,b)}},removeAt:function(a){this.remove(this.getAt(a))},removeAll:function(b){var a=[];this.each(function(c){a.push(c)});this.clearData();if(this.snapshot){this.snapshot.clear()}if(this.pruneModifiedRecords){this.modified=[]}if(b!==true){this.fireEvent("clear",this,a)}},onClear:function(b,a){Ext.each(a,function(d,c){this.destroyRecord(this,d,c)},this)},insert:function(c,b){b=[].concat(b);for(var d=0,a=b.length;d=0;d--){if(b[d].phantom===true){var a=b.splice(d,1).shift();if(a.isValid()){f.push(a)}}else{if(!b[d].isValid()){b.splice(d,1)}}}if(f.length){g.push(["create",f])}if(b.length){g.push(["update",b])}}h=g.length;if(h){e=++this.batchCounter;for(var d=0;d=0;b--){this.modified.splice(this.modified.indexOf(a[b]),1)}}else{this.modified.splice(this.modified.indexOf(a),1)}},reMap:function(b){if(Ext.isArray(b)){for(var d=0,a=b.length;d=0;c--){this.insert(b[c].lastIndex,b[c])}}},handleException:function(a){Ext.handleError(a)},reload:function(a){this.load(Ext.applyIf(a||{},this.lastOptions))},loadRecords:function(g,b,f){if(this.isDestroyed===true){return}if(!g||f===false){if(f!==false){this.fireEvent("load",this,[],b)}if(b.callback){b.callback.call(b.scope||this,[],b,false,g)}return}var e=g.records,d=g.totalRecords||e.length;if(!b||b.add!==true){if(this.pruneModifiedRecords){this.modified=[]}for(var c=0,a=e.length;c1){for(var o=1,n=c.length;og?1:(h=0;b--){if(Ext.isArray(c)){this.realize(a.splice(b,1).shift(),c.splice(b,1).shift())}else{this.realize(a.splice(b,1).shift(),c)}}}else{if(Ext.isArray(c)&&c.length==1){c=c.shift()}if(!this.isData(c)){throw new Ext.data.DataReader.Error("realize",a)}a.phantom=false;a._phid=a.id;a.id=this.getId(c);a.data=c;a.commit()}},update:function(a,c){if(Ext.isArray(a)){for(var b=a.length-1;b>=0;b--){if(Ext.isArray(c)){this.update(a.splice(b,1).shift(),c.splice(b,1).shift())}else{this.update(a.splice(b,1).shift(),c)}}}else{if(Ext.isArray(c)&&c.length==1){c=c.shift()}if(this.isData(c)){a.data=Ext.apply(a.data,c)}a.commit()}},extractData:function(k,a){var j=(this instanceof Ext.data.JsonReader)?"json":"node";var c=[];if(this.isData(k)&&!(this instanceof Ext.data.XmlReader)){k=[k]}var h=this.recordType.prototype.fields,o=h.items,m=h.length,c=[];if(a===true){var l=this.recordType;for(var e=0;e]+>/gi,asText:function(a){return String(a).replace(this.stripTagsRE,"")},asUCText:function(a){return String(a).toUpperCase().replace(this.stripTagsRE,"")},asUCString:function(a){return String(a).toUpperCase()},asDate:function(a){if(!a){return 0}if(Ext.isDate(a)){return a.getTime()}return Date.parse(String(a))},asFloat:function(a){var b=parseFloat(String(a).replace(/,/g,""));return isNaN(b)?0:b},asInt:function(a){var b=parseInt(String(a).replace(/,/g,""),10);return isNaN(b)?0:b}};Ext.data.Record=function(a,b){this.id=(b||b===0)?b:Ext.data.Record.id(this);this.data=a||{}};Ext.data.Record.create=function(e){var c=Ext.extend(Ext.data.Record,{});var d=c.prototype;d.fields=new Ext.util.MixedCollection(false,function(f){return f.name});for(var b=0,a=e.length;b-1){a.join(null);this.data.removeAt(b)}if(this.pruneModifiedRecords){this.modified.remove(a)}if(this.snapshot){this.snapshot.remove(a)}if(b>-1){this.fireEvent("remove",this,a,b)}},removeAt:function(a){this.remove(this.getAt(a))},removeAll:function(b){var a=[];this.each(function(c){a.push(c)});this.clearData();if(this.snapshot){this.snapshot.clear()}if(this.pruneModifiedRecords){this.modified=[]}if(b!==true){this.fireEvent("clear",this,a)}},onClear:function(b,a){Ext.each(a,function(d,c){this.destroyRecord(this,d,c)},this)},insert:function(c,b){b=[].concat(b);for(var d=0,a=b.length;d=0;d--){if(b[d].phantom===true){var a=b.splice(d,1).shift();if(a.isValid()){f.push(a)}}else{if(!b[d].isValid()){b.splice(d,1)}}}if(f.length){g.push(["create",f])}if(b.length){g.push(["update",b])}}h=g.length;if(h){e=++this.batchCounter;for(var d=0;d=0;b--){this.modified.splice(this.modified.indexOf(a[b]),1)}}else{this.modified.splice(this.modified.indexOf(a),1)}},reMap:function(b){if(Ext.isArray(b)){for(var d=0,a=b.length;d=0;c--){this.insert(b[c].lastIndex,b[c])}}},handleException:function(a){Ext.handleError(a)},reload:function(a){this.load(Ext.applyIf(a||{},this.lastOptions))},loadRecords:function(g,b,f){if(this.isDestroyed===true){return}if(!g||f===false){if(f!==false){this.fireEvent("load",this,[],b)}if(b.callback){b.callback.call(b.scope||this,[],b,false,g)}return}var e=g.records,d=g.totalRecords||e.length;if(!b||b.add!==true){if(this.pruneModifiedRecords){this.modified=[]}for(var c=0,a=e.length;c1){for(var o=1,n=c.length;og?1:(h=0;b--){if(Ext.isArray(c)){this.realize(a.splice(b,1).shift(),c.splice(b,1).shift())}else{this.realize(a.splice(b,1).shift(),c)}}}else{if(Ext.isArray(c)&&c.length==1){c=c.shift()}if(!this.isData(c)){throw new Ext.data.DataReader.Error("realize",a)}a.phantom=false;a._phid=a.id;a.id=this.getId(c);a.data=c;a.commit()}},update:function(a,c){if(Ext.isArray(a)){for(var b=a.length-1;b>=0;b--){if(Ext.isArray(c)){this.update(a.splice(b,1).shift(),c.splice(b,1).shift())}else{this.update(a.splice(b,1).shift(),c)}}}else{if(Ext.isArray(c)&&c.length==1){c=c.shift()}if(this.isData(c)){a.data=Ext.apply(a.data,c)}a.commit()}},extractData:function(k,a){var j=(this instanceof Ext.data.JsonReader)?"json":"node";var c=[];if(this.isData(k)&&!(this instanceof Ext.data.XmlReader)){k=[k]}var h=this.recordType.prototype.fields,o=h.items,m=h.length,c=[];if(a===true){var l=this.recordType;for(var e=0;e0&&sorters[0].field==this.groupField){sorters.shift()}this.groupField=d;this.groupDir=c;this.applyGroupField();var b=function(){this.fireEvent("groupchange",this,this.getGroupState())};if(this.groupOnSort){this.sort(d,c);b.call(this);return}if(this.remoteGroup){this.on("load",b,this,{single:true});this.reload()}else{this.sort(sorters);b.call(this)}},sort:function(g,c){if(this.remoteSort){return Ext.data.GroupingStore.superclass.sort.call(this,g,c)}var f=[];if(Ext.isArray(arguments[0])){f=arguments[0]}else{if(g==undefined){f=[this.sortInfo]}else{var e=this.fields.get(g);if(!e){return false}var b=e.name,a=this.sortInfo||null,d=this.sortToggle?this.sortToggle[b]:null;if(!c){if(a&&a.field==b){c=(this.sortToggle[b]||"ASC").toggle("ASC","DESC")}else{c=e.sortDir}}this.sortToggle[b]=c;this.sortInfo={field:b,direction:c};f=[this.sortInfo]}}if(this.groupField){f.unshift({direction:this.groupDir,field:this.groupField})}return this.multiSort.call(this,f,c)},applyGroupField:function(){if(this.remoteGroup){if(!this.baseParams){this.baseParams={}}Ext.apply(this.baseParams,{groupBy:this.groupField,groupDir:this.groupDir});var a=this.lastOptions;if(a&&a.params){a.params.groupDir=this.groupDir;delete a.params.groupBy}}},applyGrouping:function(a){if(this.groupField!==false){this.groupBy(this.groupField,true,this.groupDir);return true}else{if(a===true){this.fireEvent("datachanged",this)}return false}},getGroupState:function(){return this.groupOnSort&&this.groupField!==false?(this.sortInfo?this.sortInfo.field:undefined):this.groupField}});Ext.reg("groupingstore",Ext.data.GroupingStore); \ No newline at end of file +Ext.data.GroupingStore=Ext.extend(Ext.data.Store,{constructor:function(d){d=d||{};this.hasMultiSort=true;this.multiSortInfo=this.multiSortInfo||{sorters:[]};var e=this.multiSortInfo.sorters,c=d.groupField||this.groupField,b=d.sortInfo||this.sortInfo,a=d.groupDir||this.groupDir;if(c){e.push({field:c,direction:a})}if(b){e.push(b)}Ext.data.GroupingStore.superclass.constructor.call(this,d);this.addEvents("groupchange");this.applyGroupField()},remoteGroup:false,groupOnSort:false,groupDir:"ASC",clearGrouping:function(){this.groupField=false;if(this.remoteGroup){if(this.baseParams){delete this.baseParams.groupBy;delete this.baseParams.groupDir}var a=this.lastOptions;if(a&&a.params){delete a.params.groupBy;delete a.params.groupDir}this.reload()}else{this.sort();this.fireEvent("datachanged",this)}},groupBy:function(d,a,c){c=c?(String(c).toUpperCase()=="DESC"?"DESC":"ASC"):this.groupDir;if(this.groupField==d&&this.groupDir==c&&!a){return}sorters=this.multiSortInfo.sorters;if(sorters.length>0&&sorters[0].field==this.groupField){sorters.shift()}this.groupField=d;this.groupDir=c;this.applyGroupField();var b=function(){this.fireEvent("groupchange",this,this.getGroupState())};if(this.groupOnSort){this.sort(d,c);b.call(this);return}if(this.remoteGroup){this.on("load",b,this,{single:true});this.reload()}else{this.sort(sorters);b.call(this)}},sort:function(g,c){if(this.remoteSort){return Ext.data.GroupingStore.superclass.sort.call(this,g,c)}var f=[];if(Ext.isArray(arguments[0])){f=arguments[0]}else{if(g==undefined){f=this.sortInfo?[this.sortInfo]:[]}else{var e=this.fields.get(g);if(!e){return false}var b=e.name,a=this.sortInfo||null,d=this.sortToggle?this.sortToggle[b]:null;if(!c){if(a&&a.field==b){c=(this.sortToggle[b]||"ASC").toggle("ASC","DESC")}else{c=e.sortDir}}this.sortToggle[b]=c;this.sortInfo={field:b,direction:c};f=[this.sortInfo]}}if(this.groupField){f.unshift({direction:this.groupDir,field:this.groupField})}return this.multiSort.call(this,f,c)},applyGroupField:function(){if(this.remoteGroup){if(!this.baseParams){this.baseParams={}}Ext.apply(this.baseParams,{groupBy:this.groupField,groupDir:this.groupDir});var a=this.lastOptions;if(a&&a.params){a.params.groupDir=this.groupDir;delete a.params.groupBy}}},applyGrouping:function(a){if(this.groupField!==false){this.groupBy(this.groupField,true,this.groupDir);return true}else{if(a===true){this.fireEvent("datachanged",this)}return false}},getGroupState:function(){return this.groupOnSort&&this.groupField!==false?(this.sortInfo?this.sortInfo.field:undefined):this.groupField}});Ext.reg("groupingstore",Ext.data.GroupingStore); \ No newline at end of file diff --git a/pkgs/data-json-debug.js b/pkgs/data-json-debug.js index 9a6af56f..0ef5fcc3 100644 --- a/pkgs/data-json-debug.js +++ b/pkgs/data-json-debug.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/data-json.js b/pkgs/data-json.js index 1d0c1d76..35197efb 100644 --- a/pkgs/data-json.js +++ b/pkgs/data-json.js @@ -1,5 +1,5 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/data-list-views-debug.js b/pkgs/data-list-views-debug.js index 3076cc50..a2fffcf1 100644 --- a/pkgs/data-list-views-debug.js +++ b/pkgs/data-list-views-debug.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/data-list-views.js b/pkgs/data-list-views.js index 91870ca3..db7c916a 100644 --- a/pkgs/data-list-views.js +++ b/pkgs/data-list-views.js @@ -1,5 +1,5 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/data-xml-debug.js b/pkgs/data-xml-debug.js index 638ac9d5..6df4a408 100644 --- a/pkgs/data-xml-debug.js +++ b/pkgs/data-xml-debug.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/data-xml.js b/pkgs/data-xml.js index 727550d0..fb072573 100644 --- a/pkgs/data-xml.js +++ b/pkgs/data-xml.js @@ -1,5 +1,5 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/direct-debug.js b/pkgs/direct-debug.js index de21d016..f1e8a884 100644 --- a/pkgs/direct-debug.js +++ b/pkgs/direct-debug.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/direct.js b/pkgs/direct.js index 6cc59095..379fd0d7 100644 --- a/pkgs/direct.js +++ b/pkgs/direct.js @@ -1,5 +1,5 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/ext-dd-debug.js b/pkgs/ext-dd-debug.js index c0cde04c..85fabaf8 100644 --- a/pkgs/ext-dd-debug.js +++ b/pkgs/ext-dd-debug.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -1179,7 +1179,7 @@ Ext.dd.DragDrop.prototype = { }; })(); -/*! +/* * The drag and drop utility provides a framework for building drag and drop * applications. In addition to enabling drag and drop for specific elements, * the drag and drop elements are tracked by the manager class, and the diff --git a/pkgs/ext-dd.js b/pkgs/ext-dd.js index 2e99277a..3b7ef36c 100644 --- a/pkgs/ext-dd.js +++ b/pkgs/ext-dd.js @@ -1,15 +1,7 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ -(function(){var a=Ext.EventManager;var b=Ext.lib.Dom;Ext.dd.DragDrop=function(e,c,d){if(e){this.init(e,c,d)}};Ext.dd.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true},moveOnly:false,unlock:function(){this.locked=false},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(c,d){},startDrag:function(c,d){},b4Drag:function(c){},onDrag:function(c){},onDragEnter:function(c,d){},b4DragOver:function(c){},onDragOver:function(c,d){},b4DragOut:function(c){},onDragOut:function(c,d){},b4DragDrop:function(c){},onDragDrop:function(c,d){},onInvalidDrop:function(c){},b4EndDrag:function(c){},endDrag:function(c){},b4MouseDown:function(c){},onMouseDown:function(c){},onMouseUp:function(c){},onAvailable:function(){},defaultPadding:{left:0,right:0,top:0,bottom:0},constrainTo:function(i,g,n){if(Ext.isNumber(g)){g={left:g,right:g,top:g,bottom:g}}g=g||this.defaultPadding;var k=Ext.get(this.getEl()).getBox(),d=Ext.get(i),m=d.getScroll(),j,e=d.dom;if(e==document.body){j={x:m.left,y:m.top,width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()}}else{var l=d.getXY();j={x:l[0],y:l[1],width:e.clientWidth,height:e.clientHeight}}var h=k.y-j.y,f=k.x-j.x;this.resetConstraints();this.setXConstraint(f-(g.left||0),j.width-f-k.width-(g.right||0),this.xTickSize);this.setYConstraint(h-(g.top||0),j.height-h-k.height-(g.bottom||0),this.yTickSize)},getEl:function(){if(!this._domRef){this._domRef=Ext.getDom(this.id)}return this._domRef},getDragEl:function(){return Ext.getDom(this.dragElId)},init:function(e,c,d){this.initTarget(e,c,d);a.on(this.id,"mousedown",this.handleMouseDown,this)},initTarget:function(e,c,d){this.config=d||{};this.DDM=Ext.dd.DDM;this.groups={};if(typeof e!=="string"){e=Ext.id(e)}this.id=e;this.addToGroup((c)?c:"default");this.handleElId=e;this.setDragElId(e);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();this.handleOnAvailable()},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false)},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable()},setPadding:function(e,c,f,d){if(!c&&0!==c){this.padding=[e,e,e,e]}else{if(!f&&0!==f){this.padding=[e,c,e,c]}else{this.padding=[e,c,f,d]}}},setInitPosition:function(f,e){var g=this.getEl();if(!this.DDM.verifyEl(g)){return}var d=f||0;var c=e||0;var h=b.getXY(g);this.initPageX=h[0]-d;this.initPageY=h[1]-c;this.lastPageX=h[0];this.lastPageY=h[1];this.setStartPosition(h)},setStartPosition:function(d){var c=d||b.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=c[0];this.startPageY=c[1]},addToGroup:function(c){this.groups[c]=true;this.DDM.regDragDrop(this,c)},removeFromGroup:function(c){if(this.groups[c]){delete this.groups[c]}this.DDM.removeDDFromGroup(this,c)},setDragElId:function(c){this.dragElId=c},setHandleElId:function(c){if(typeof c!=="string"){c=Ext.id(c)}this.handleElId=c;this.DDM.regHandle(this.id,c)},setOuterHandleElId:function(c){if(typeof c!=="string"){c=Ext.id(c)}a.on(c,"mousedown",this.handleMouseDown,this);this.setHandleElId(c);this.hasOuterHandles=true},unreg:function(){a.un(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this)},destroy:function(){this.unreg()},isLocked:function(){return(this.DDM.isLocked()||this.locked)},handleMouseDown:function(f,d){if(this.primaryButtonOnly&&f.button!=0){return}if(this.isLocked()){return}this.DDM.refreshCache(this.groups);var c=new Ext.lib.Point(Ext.lib.Event.getPageX(f),Ext.lib.Event.getPageY(f));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(c,this)){}else{if(this.clickValidator(f)){this.setStartPosition();this.b4MouseDown(f);this.onMouseDown(f);this.DDM.handleMouseDown(f,this);this.DDM.stopEvent(f)}else{}}},clickValidator:function(d){var c=d.getTarget();return(this.isValidHandleChild(c)&&(this.id==this.handleElId||this.DDM.handleWasClicked(c,this.id)))},addInvalidHandleType:function(c){var d=c.toUpperCase();this.invalidHandleTypes[d]=d},addInvalidHandleId:function(c){if(typeof c!=="string"){c=Ext.id(c)}this.invalidHandleIds[c]=c},addInvalidHandleClass:function(c){this.invalidHandleClasses.push(c)},removeInvalidHandleType:function(c){var d=c.toUpperCase();delete this.invalidHandleTypes[d]},removeInvalidHandleId:function(c){if(typeof c!=="string"){c=Ext.id(c)}delete this.invalidHandleIds[c]},removeInvalidHandleClass:function(d){for(var e=0,c=this.invalidHandleClasses.length;e=this.minX;d=d-c){if(!e[d]){this.xTicks[this.xTicks.length]=d;e[d]=true}}for(d=this.initPageX;d<=this.maxX;d=d+c){if(!e[d]){this.xTicks[this.xTicks.length]=d;e[d]=true}}this.xTicks.sort(this.DDM.numericSort)},setYTicks:function(f,c){this.yTicks=[];this.yTickSize=c;var e={};for(var d=this.initPageY;d>=this.minY;d=d-c){if(!e[d]){this.yTicks[this.yTicks.length]=d;e[d]=true}}for(d=this.initPageY;d<=this.maxY;d=d+c){if(!e[d]){this.yTicks[this.yTicks.length]=d;e[d]=true}}this.yTicks.sort(this.DDM.numericSort)},setXConstraint:function(e,d,c){this.leftConstraint=e;this.rightConstraint=d;this.minX=this.initPageX-e;this.maxX=this.initPageX+d;if(c){this.setXTicks(this.initPageX,c)}this.constrainX=true},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks()},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0},setYConstraint:function(c,e,d){this.topConstraint=c;this.bottomConstraint=e;this.minY=this.initPageY-c;this.maxY=this.initPageY+e;if(d){this.setYTicks(this.initPageY,d)}this.constrainY=true},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var d=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var c=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(d,c)}else{this.setInitPosition()}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize)}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize)}},getTick:function(j,f){if(!f){return j}else{if(f[0]>=j){return f[0]}else{for(var d=0,c=f.length;d=j){var h=j-f[d];var g=f[e]-j;return(g>h)?f[d]:f[e]}}return f[f.length-1]}}},toString:function(){return("DragDrop "+this.id)}}})(); -/* - * The drag and drop utility provides a framework for building drag and drop - * applications. In addition to enabling drag and drop for specific elements, - * the drag and drop elements are tracked by the manager class, and the - * interactions between the various elements are tracked during the drag and - * the implementing code is notified about these important moments. - */ -if(!Ext.dd.DragDropMgr){Ext.dd.DragDropMgr=function(){var a=Ext.EventManager;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,init:function(){this.initialized=true},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(d,c){for(var e in this.ids){for(var b in this.ids[e]){var f=this.ids[e][b];if(!this.isTypeOfDD(f)){continue}f[d].apply(f,c)}}},_onLoad:function(){this.init();a.on(document,"mouseup",this.handleMouseUp,this,true);a.on(document,"mousemove",this.handleMouseMove,this,true);a.on(window,"unload",this._onUnload,this,true);a.on(window,"resize",this._onResize,this,true)},_onResize:function(b){this._execOnAll("resetConstraints",[])},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){return this.locked},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:350,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(c,b){if(!this.initialized){this.init()}if(!this.ids[b]){this.ids[b]={}}this.ids[b][c.id]=c},removeDDFromGroup:function(d,b){if(!this.ids[b]){this.ids[b]={}}var c=this.ids[b];if(c&&c[d.id]){delete c[d.id]}},_remove:function(c){for(var b in c.groups){if(b&&this.ids[b]&&this.ids[b][c.id]){delete this.ids[b][c.id]}}delete this.handleIds[c.id]},regHandle:function(c,b){if(!this.handleIds[c]){this.handleIds[c]={}}this.handleIds[c][b]=b},isDragDrop:function(b){return(this.getDDById(b))?true:false},getRelated:function(g,c){var f=[];for(var e in g.groups){for(var d in this.ids[e]){var b=this.ids[e][d];if(!this.isTypeOfDD(b)){continue}if(!c||b.isTarget){f[f.length]=b}}}return f},isLegalTarget:function(f,e){var c=this.getRelated(f,true);for(var d=0,b=c.length;dthis.clickPixelThresh||b>this.clickPixelThresh){this.startDrag(this.startX,this.startY)}}if(this.dragThreshMet){this.dragCurrent.b4Drag(d);this.dragCurrent.onDrag(d);if(!this.dragCurrent.moveOnly){this.fireEvents(d,false)}}this.stopEvent(d);return true},fireEvents:function(m,n){var p=this.dragCurrent;if(!p||p.isLocked()){return}var q=m.getPoint();var b=[];var f=[];var k=[];var h=[];var d=[];for(var g in this.dragOvers){var c=this.dragOvers[g];if(!this.isTypeOfDD(c)){continue}if(!this.isOverTarget(q,c,this.mode)){f.push(c)}b[g]=true;delete this.dragOvers[g]}for(var o in p.groups){if("string"!=typeof o){continue}for(g in this.ids[o]){var j=this.ids[o][g];if(!this.isTypeOfDD(j)){continue}if(j.isTarget&&!j.isLocked()&&((j!=p)||(p.ignoreSelf===false))){if(this.isOverTarget(q,j,this.mode)){if(n){h.push(j)}else{if(!b[j.id]){d.push(j)}else{k.push(j)}this.dragOvers[j.id]=j}}}}}if(this.mode){if(f.length){p.b4DragOut(m,f);p.onDragOut(m,f)}if(d.length){p.onDragEnter(m,d)}if(k.length){p.b4DragOver(m,k);p.onDragOver(m,k)}if(h.length){p.b4DragDrop(m,h);p.onDragDrop(m,h)}}else{var l=0;for(g=0,l=f.length;g2000){}else{setTimeout(b._addListeners,10);if(document&&document.body){b._timeoutCount+=1}}}},handleWasClicked:function(b,d){if(this.isHandle(d,b.id)){return true}else{var c=b.parentNode;while(c){if(this.isHandle(d,c.id)){return true}else{c=c.parentNode}}}return false}}}();Ext.dd.DDM=Ext.dd.DragDropMgr;Ext.dd.DDM._addListeners()}Ext.dd.DD=function(c,a,b){if(c){this.init(c,a,b)}};Ext.extend(Ext.dd.DD,Ext.dd.DragDrop,{scroll:true,autoOffset:function(c,b){var a=c-this.startPageX;var d=b-this.startPageY;this.setDelta(a,d)},setDelta:function(b,a){this.deltaX=b;this.deltaY=a},setDragElPos:function(c,b){var a=this.getDragEl();this.alignElWithMouse(a,c,b)},alignElWithMouse:function(c,g,f){var e=this.getTargetCoord(g,f);var b=c.dom?c:Ext.fly(c,"_dd");if(!this.deltaSetXY){var h=[e.x,e.y];b.setXY(h);var d=b.getLeft(true);var a=b.getTop(true);this.deltaSetXY=[d-e.x,a-e.y]}else{b.setLeftTop(e.x+this.deltaSetXY[0],e.y+this.deltaSetXY[1])}this.cachePosition(e.x,e.y);this.autoScroll(e.x,e.y,c.offsetHeight,c.offsetWidth);return e},cachePosition:function(b,a){if(b){this.lastPageX=b;this.lastPageY=a}else{var c=Ext.lib.Dom.getXY(this.getEl());this.lastPageX=c[0];this.lastPageY=c[1]}},autoScroll:function(k,j,e,l){if(this.scroll){var m=Ext.lib.Dom.getViewHeight();var b=Ext.lib.Dom.getViewWidth();var o=this.DDM.getScrollTop();var d=this.DDM.getScrollLeft();var i=e+j;var n=l+k;var g=(m+o-j-this.deltaY);var f=(b+d-k-this.deltaX);var c=40;var a=(document.all)?80:30;if(i>m&&g0&&j-ob&&f0&&k-dthis.maxX){a=this.maxX}}if(this.constrainY){if(dthis.maxY){d=this.maxY}}a=this.getTick(a,this.xTicks);d=this.getTick(d,this.yTicks);return{x:a,y:d}},applyConfig:function(){Ext.dd.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false)},b4MouseDown:function(a){this.autoOffset(a.getPageX(),a.getPageY())},b4Drag:function(a){this.setDragElPos(a.getPageX(),a.getPageY())},toString:function(){return("DD "+this.id)}});Ext.dd.DDProxy=function(c,a,b){if(c){this.init(c,a,b);this.initFrame()}};Ext.dd.DDProxy.dragElId="ygddfdiv";Ext.extend(Ext.dd.DDProxy,Ext.dd.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var b=this;var a=document.body;if(!a||!a.firstChild){setTimeout(function(){b.createFrame()},50);return}var d=this.getDragEl();if(!d){d=document.createElement("div");d.id=this.dragElId;var c=d.style;c.position="absolute";c.visibility="hidden";c.cursor="move";c.border="2px solid #aaa";c.zIndex=999;a.insertBefore(d,a.firstChild)}},initFrame:function(){this.createFrame()},applyConfig:function(){Ext.dd.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||Ext.dd.DDProxy.dragElId)},showFrame:function(e,d){var c=this.getEl();var a=this.getDragEl();var b=a.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(b.width,10)/2),Math.round(parseInt(b.height,10)/2))}this.setDragElPos(e,d);Ext.fly(a).show()},_resizeProxy:function(){if(this.resizeFrame){var a=this.getEl();Ext.fly(this.getDragEl()).setSize(a.offsetWidth,a.offsetHeight)}},b4MouseDown:function(b){var a=b.getPageX();var c=b.getPageY();this.autoOffset(a,c);this.setDragElPos(a,c)},b4StartDrag:function(a,b){this.showFrame(a,b)},b4EndDrag:function(a){Ext.fly(this.getDragEl()).hide()},endDrag:function(c){var b=this.getEl();var a=this.getDragEl();a.style.visibility="";this.beforeMove();b.style.visibility="hidden";Ext.dd.DDM.moveToEl(b,a);a.style.visibility="hidden";b.style.visibility="";this.afterDrag()},beforeMove:function(){},afterDrag:function(){},toString:function(){return("DDProxy "+this.id)}});Ext.dd.DDTarget=function(c,a,b){if(c){this.initTarget(c,a,b)}};Ext.extend(Ext.dd.DDTarget,Ext.dd.DragDrop,{getDragEl:Ext.emptyFn,isValidHandleChild:Ext.emptyFn,startDrag:Ext.emptyFn,endDrag:Ext.emptyFn,onDrag:Ext.emptyFn,onDragDrop:Ext.emptyFn,onDragEnter:Ext.emptyFn,onDragOut:Ext.emptyFn,onDragOver:Ext.emptyFn,onInvalidDrop:Ext.emptyFn,onMouseDown:Ext.emptyFn,onMouseUp:Ext.emptyFn,setXConstraint:Ext.emptyFn,setYConstraint:Ext.emptyFn,resetConstraints:Ext.emptyFn,clearConstraints:Ext.emptyFn,clearTicks:Ext.emptyFn,setInitPosition:Ext.emptyFn,setDragElId:Ext.emptyFn,setHandleElId:Ext.emptyFn,setOuterHandleElId:Ext.emptyFn,addInvalidHandleClass:Ext.emptyFn,addInvalidHandleId:Ext.emptyFn,addInvalidHandleType:Ext.emptyFn,removeInvalidHandleClass:Ext.emptyFn,removeInvalidHandleId:Ext.emptyFn,removeInvalidHandleType:Ext.emptyFn,toString:function(){return("DDTarget "+this.id)}});Ext.dd.DragTracker=Ext.extend(Ext.util.Observable,{active:false,tolerance:5,autoStart:false,constructor:function(a){Ext.apply(this,a);this.addEvents("mousedown","mouseup","mousemove","dragstart","dragend","drag");this.dragRegion=new Ext.lib.Region(0,0,0,0);if(this.el){this.initEl(this.el)}Ext.dd.DragTracker.superclass.constructor.call(this,a)},initEl:function(a){this.el=Ext.get(a);a.on("mousedown",this.onMouseDown,this,this.delegate?{delegate:this.delegate}:undefined)},destroy:function(){this.el.un("mousedown",this.onMouseDown,this)},onMouseDown:function(c,b){if(this.fireEvent("mousedown",this,c)!==false&&this.onBeforeStart(c)!==false){this.startXY=this.lastXY=c.getXY();this.dragTarget=this.delegate?b:this.el.dom;if(this.preventDefault!==false){c.preventDefault()}var a=Ext.getDoc();a.on("mouseup",this.onMouseUp,this);a.on("mousemove",this.onMouseMove,this);a.on("selectstart",this.stopSelect,this);if(this.autoStart){this.timer=this.triggerStart.defer(this.autoStart===true?1000:this.autoStart,this)}}},onMouseMove:function(d,c){if(this.active&&Ext.isIE&&!d.browserEvent.button){d.preventDefault();this.onMouseUp(d);return}d.preventDefault();var b=d.getXY(),a=this.startXY;this.lastXY=b;if(!this.active){if(Math.abs(a[0]-b[0])>this.tolerance||Math.abs(a[1]-b[1])>this.tolerance){this.triggerStart()}else{return}}this.fireEvent("mousemove",this,d);this.onDrag(d);this.fireEvent("drag",this,d)},onMouseUp:function(c){var b=Ext.getDoc();b.un("mousemove",this.onMouseMove,this);b.un("mouseup",this.onMouseUp,this);b.un("selectstart",this.stopSelect,this);c.preventDefault();this.clearStart();var a=this.active;this.active=false;delete this.elRegion;this.fireEvent("mouseup",this,c);if(a){this.onEnd(c);this.fireEvent("dragend",this,c)}},triggerStart:function(a){this.clearStart();this.active=true;this.onStart(this.startXY);this.fireEvent("dragstart",this,this.startXY)},clearStart:function(){if(this.timer){clearTimeout(this.timer);delete this.timer}},stopSelect:function(a){a.stopEvent();return false},onBeforeStart:function(a){},onStart:function(a){},onDrag:function(a){},onEnd:function(a){},getDragTarget:function(){return this.dragTarget},getDragCt:function(){return this.el},getXY:function(a){return a?this.constrainModes[a].call(this,this.lastXY):this.lastXY},getOffset:function(c){var b=this.getXY(c);var a=this.startXY;return[a[0]-b[0],a[1]-b[1]]},constrainModes:{point:function(b){if(!this.elRegion){this.elRegion=this.getDragCt().getRegion()}var a=this.dragRegion;a.left=b[0];a.top=b[1];a.right=b[0];a.bottom=b[1];a.constrainTo(this.elRegion);return[a.left,a.top]}}});Ext.dd.ScrollManager=function(){var c=Ext.dd.DragDropMgr;var e={};var b=null;var h={};var g=function(k){b=null;a()};var i=function(){if(c.dragCurrent){c.refreshCache(c.dragCurrent.groups)}};var d=function(){if(c.dragCurrent){var k=Ext.dd.ScrollManager;var l=h.el.ddScrollConfig?h.el.ddScrollConfig.increment:k.increment;if(!k.animate){if(h.el.scroll(h.dir,l)){i()}}else{h.el.scroll(h.dir,l,true,k.animDuration,i)}}};var a=function(){if(h.id){clearInterval(h.id)}h.id=0;h.el=null;h.dir=""};var f=function(l,k){a();h.el=l;h.dir=k;var m=(l.ddScrollConfig&&l.ddScrollConfig.frequency)?l.ddScrollConfig.frequency:Ext.dd.ScrollManager.frequency;h.id=setInterval(d,m)};var j=function(n,p){if(p||!c.dragCurrent){return}var q=Ext.dd.ScrollManager;if(!b||b!=c.dragCurrent){b=c.dragCurrent;q.refreshCache()}var s=Ext.lib.Event.getXY(n);var t=new Ext.lib.Point(s[0],s[1]);for(var l in e){var m=e[l],k=m._region;var o=m.ddScrollConfig?m.ddScrollConfig:q;if(k&&k.contains(t)&&m.isScrollable()){if(k.bottom-t.y<=o.vthresh){if(h.el!=m){f(m,"down")}return}else{if(k.right-t.x<=o.hthresh){if(h.el!=m){f(m,"left")}return}else{if(t.y-k.top<=o.vthresh){if(h.el!=m){f(m,"up")}return}else{if(t.x-k.left<=o.hthresh){if(h.el!=m){f(m,"right")}return}}}}}}a()};c.fireEvents=c.fireEvents.createSequence(j,c);c.stopDrag=c.stopDrag.createSequence(g,c);return{register:function(m){if(Ext.isArray(m)){for(var l=0,k=m.length;l=this.minX;d=d-c){if(!e[d]){this.xTicks[this.xTicks.length]=d;e[d]=true}}for(d=this.initPageX;d<=this.maxX;d=d+c){if(!e[d]){this.xTicks[this.xTicks.length]=d;e[d]=true}}this.xTicks.sort(this.DDM.numericSort)},setYTicks:function(f,c){this.yTicks=[];this.yTickSize=c;var e={};for(var d=this.initPageY;d>=this.minY;d=d-c){if(!e[d]){this.yTicks[this.yTicks.length]=d;e[d]=true}}for(d=this.initPageY;d<=this.maxY;d=d+c){if(!e[d]){this.yTicks[this.yTicks.length]=d;e[d]=true}}this.yTicks.sort(this.DDM.numericSort)},setXConstraint:function(e,d,c){this.leftConstraint=e;this.rightConstraint=d;this.minX=this.initPageX-e;this.maxX=this.initPageX+d;if(c){this.setXTicks(this.initPageX,c)}this.constrainX=true},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks()},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0},setYConstraint:function(c,e,d){this.topConstraint=c;this.bottomConstraint=e;this.minY=this.initPageY-c;this.maxY=this.initPageY+e;if(d){this.setYTicks(this.initPageY,d)}this.constrainY=true},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var d=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var c=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(d,c)}else{this.setInitPosition()}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize)}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize)}},getTick:function(j,f){if(!f){return j}else{if(f[0]>=j){return f[0]}else{for(var d=0,c=f.length;d=j){var h=j-f[d];var g=f[e]-j;return(g>h)?f[d]:f[e]}}return f[f.length-1]}}},toString:function(){return("DragDrop "+this.id)}}})();if(!Ext.dd.DragDropMgr){Ext.dd.DragDropMgr=function(){var a=Ext.EventManager;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,init:function(){this.initialized=true},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(d,c){for(var e in this.ids){for(var b in this.ids[e]){var f=this.ids[e][b];if(!this.isTypeOfDD(f)){continue}f[d].apply(f,c)}}},_onLoad:function(){this.init();a.on(document,"mouseup",this.handleMouseUp,this,true);a.on(document,"mousemove",this.handleMouseMove,this,true);a.on(window,"unload",this._onUnload,this,true);a.on(window,"resize",this._onResize,this,true)},_onResize:function(b){this._execOnAll("resetConstraints",[])},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){return this.locked},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:350,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(c,b){if(!this.initialized){this.init()}if(!this.ids[b]){this.ids[b]={}}this.ids[b][c.id]=c},removeDDFromGroup:function(d,b){if(!this.ids[b]){this.ids[b]={}}var c=this.ids[b];if(c&&c[d.id]){delete c[d.id]}},_remove:function(c){for(var b in c.groups){if(b&&this.ids[b]&&this.ids[b][c.id]){delete this.ids[b][c.id]}}delete this.handleIds[c.id]},regHandle:function(c,b){if(!this.handleIds[c]){this.handleIds[c]={}}this.handleIds[c][b]=b},isDragDrop:function(b){return(this.getDDById(b))?true:false},getRelated:function(g,c){var f=[];for(var e in g.groups){for(var d in this.ids[e]){var b=this.ids[e][d];if(!this.isTypeOfDD(b)){continue}if(!c||b.isTarget){f[f.length]=b}}}return f},isLegalTarget:function(f,e){var c=this.getRelated(f,true);for(var d=0,b=c.length;dthis.clickPixelThresh||b>this.clickPixelThresh){this.startDrag(this.startX,this.startY)}}if(this.dragThreshMet){this.dragCurrent.b4Drag(d);this.dragCurrent.onDrag(d);if(!this.dragCurrent.moveOnly){this.fireEvents(d,false)}}this.stopEvent(d);return true},fireEvents:function(m,n){var p=this.dragCurrent;if(!p||p.isLocked()){return}var q=m.getPoint();var b=[];var f=[];var k=[];var h=[];var d=[];for(var g in this.dragOvers){var c=this.dragOvers[g];if(!this.isTypeOfDD(c)){continue}if(!this.isOverTarget(q,c,this.mode)){f.push(c)}b[g]=true;delete this.dragOvers[g]}for(var o in p.groups){if("string"!=typeof o){continue}for(g in this.ids[o]){var j=this.ids[o][g];if(!this.isTypeOfDD(j)){continue}if(j.isTarget&&!j.isLocked()&&((j!=p)||(p.ignoreSelf===false))){if(this.isOverTarget(q,j,this.mode)){if(n){h.push(j)}else{if(!b[j.id]){d.push(j)}else{k.push(j)}this.dragOvers[j.id]=j}}}}}if(this.mode){if(f.length){p.b4DragOut(m,f);p.onDragOut(m,f)}if(d.length){p.onDragEnter(m,d)}if(k.length){p.b4DragOver(m,k);p.onDragOver(m,k)}if(h.length){p.b4DragDrop(m,h);p.onDragDrop(m,h)}}else{var l=0;for(g=0,l=f.length;g2000){}else{setTimeout(b._addListeners,10);if(document&&document.body){b._timeoutCount+=1}}}},handleWasClicked:function(b,d){if(this.isHandle(d,b.id)){return true}else{var c=b.parentNode;while(c){if(this.isHandle(d,c.id)){return true}else{c=c.parentNode}}}return false}}}();Ext.dd.DDM=Ext.dd.DragDropMgr;Ext.dd.DDM._addListeners()}Ext.dd.DD=function(c,a,b){if(c){this.init(c,a,b)}};Ext.extend(Ext.dd.DD,Ext.dd.DragDrop,{scroll:true,autoOffset:function(c,b){var a=c-this.startPageX;var d=b-this.startPageY;this.setDelta(a,d)},setDelta:function(b,a){this.deltaX=b;this.deltaY=a},setDragElPos:function(c,b){var a=this.getDragEl();this.alignElWithMouse(a,c,b)},alignElWithMouse:function(c,g,f){var e=this.getTargetCoord(g,f);var b=c.dom?c:Ext.fly(c,"_dd");if(!this.deltaSetXY){var h=[e.x,e.y];b.setXY(h);var d=b.getLeft(true);var a=b.getTop(true);this.deltaSetXY=[d-e.x,a-e.y]}else{b.setLeftTop(e.x+this.deltaSetXY[0],e.y+this.deltaSetXY[1])}this.cachePosition(e.x,e.y);this.autoScroll(e.x,e.y,c.offsetHeight,c.offsetWidth);return e},cachePosition:function(b,a){if(b){this.lastPageX=b;this.lastPageY=a}else{var c=Ext.lib.Dom.getXY(this.getEl());this.lastPageX=c[0];this.lastPageY=c[1]}},autoScroll:function(k,j,e,l){if(this.scroll){var m=Ext.lib.Dom.getViewHeight();var b=Ext.lib.Dom.getViewWidth();var o=this.DDM.getScrollTop();var d=this.DDM.getScrollLeft();var i=e+j;var n=l+k;var g=(m+o-j-this.deltaY);var f=(b+d-k-this.deltaX);var c=40;var a=(document.all)?80:30;if(i>m&&g0&&j-ob&&f0&&k-dthis.maxX){a=this.maxX}}if(this.constrainY){if(dthis.maxY){d=this.maxY}}a=this.getTick(a,this.xTicks);d=this.getTick(d,this.yTicks);return{x:a,y:d}},applyConfig:function(){Ext.dd.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false)},b4MouseDown:function(a){this.autoOffset(a.getPageX(),a.getPageY())},b4Drag:function(a){this.setDragElPos(a.getPageX(),a.getPageY())},toString:function(){return("DD "+this.id)}});Ext.dd.DDProxy=function(c,a,b){if(c){this.init(c,a,b);this.initFrame()}};Ext.dd.DDProxy.dragElId="ygddfdiv";Ext.extend(Ext.dd.DDProxy,Ext.dd.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var b=this;var a=document.body;if(!a||!a.firstChild){setTimeout(function(){b.createFrame()},50);return}var d=this.getDragEl();if(!d){d=document.createElement("div");d.id=this.dragElId;var c=d.style;c.position="absolute";c.visibility="hidden";c.cursor="move";c.border="2px solid #aaa";c.zIndex=999;a.insertBefore(d,a.firstChild)}},initFrame:function(){this.createFrame()},applyConfig:function(){Ext.dd.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||Ext.dd.DDProxy.dragElId)},showFrame:function(e,d){var c=this.getEl();var a=this.getDragEl();var b=a.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(b.width,10)/2),Math.round(parseInt(b.height,10)/2))}this.setDragElPos(e,d);Ext.fly(a).show()},_resizeProxy:function(){if(this.resizeFrame){var a=this.getEl();Ext.fly(this.getDragEl()).setSize(a.offsetWidth,a.offsetHeight)}},b4MouseDown:function(b){var a=b.getPageX();var c=b.getPageY();this.autoOffset(a,c);this.setDragElPos(a,c)},b4StartDrag:function(a,b){this.showFrame(a,b)},b4EndDrag:function(a){Ext.fly(this.getDragEl()).hide()},endDrag:function(c){var b=this.getEl();var a=this.getDragEl();a.style.visibility="";this.beforeMove();b.style.visibility="hidden";Ext.dd.DDM.moveToEl(b,a);a.style.visibility="hidden";b.style.visibility="";this.afterDrag()},beforeMove:function(){},afterDrag:function(){},toString:function(){return("DDProxy "+this.id)}});Ext.dd.DDTarget=function(c,a,b){if(c){this.initTarget(c,a,b)}};Ext.extend(Ext.dd.DDTarget,Ext.dd.DragDrop,{getDragEl:Ext.emptyFn,isValidHandleChild:Ext.emptyFn,startDrag:Ext.emptyFn,endDrag:Ext.emptyFn,onDrag:Ext.emptyFn,onDragDrop:Ext.emptyFn,onDragEnter:Ext.emptyFn,onDragOut:Ext.emptyFn,onDragOver:Ext.emptyFn,onInvalidDrop:Ext.emptyFn,onMouseDown:Ext.emptyFn,onMouseUp:Ext.emptyFn,setXConstraint:Ext.emptyFn,setYConstraint:Ext.emptyFn,resetConstraints:Ext.emptyFn,clearConstraints:Ext.emptyFn,clearTicks:Ext.emptyFn,setInitPosition:Ext.emptyFn,setDragElId:Ext.emptyFn,setHandleElId:Ext.emptyFn,setOuterHandleElId:Ext.emptyFn,addInvalidHandleClass:Ext.emptyFn,addInvalidHandleId:Ext.emptyFn,addInvalidHandleType:Ext.emptyFn,removeInvalidHandleClass:Ext.emptyFn,removeInvalidHandleId:Ext.emptyFn,removeInvalidHandleType:Ext.emptyFn,toString:function(){return("DDTarget "+this.id)}});Ext.dd.DragTracker=Ext.extend(Ext.util.Observable,{active:false,tolerance:5,autoStart:false,constructor:function(a){Ext.apply(this,a);this.addEvents("mousedown","mouseup","mousemove","dragstart","dragend","drag");this.dragRegion=new Ext.lib.Region(0,0,0,0);if(this.el){this.initEl(this.el)}Ext.dd.DragTracker.superclass.constructor.call(this,a)},initEl:function(a){this.el=Ext.get(a);a.on("mousedown",this.onMouseDown,this,this.delegate?{delegate:this.delegate}:undefined)},destroy:function(){this.el.un("mousedown",this.onMouseDown,this)},onMouseDown:function(c,b){if(this.fireEvent("mousedown",this,c)!==false&&this.onBeforeStart(c)!==false){this.startXY=this.lastXY=c.getXY();this.dragTarget=this.delegate?b:this.el.dom;if(this.preventDefault!==false){c.preventDefault()}var a=Ext.getDoc();a.on("mouseup",this.onMouseUp,this);a.on("mousemove",this.onMouseMove,this);a.on("selectstart",this.stopSelect,this);if(this.autoStart){this.timer=this.triggerStart.defer(this.autoStart===true?1000:this.autoStart,this)}}},onMouseMove:function(d,c){if(this.active&&Ext.isIE&&!d.browserEvent.button){d.preventDefault();this.onMouseUp(d);return}d.preventDefault();var b=d.getXY(),a=this.startXY;this.lastXY=b;if(!this.active){if(Math.abs(a[0]-b[0])>this.tolerance||Math.abs(a[1]-b[1])>this.tolerance){this.triggerStart()}else{return}}this.fireEvent("mousemove",this,d);this.onDrag(d);this.fireEvent("drag",this,d)},onMouseUp:function(c){var b=Ext.getDoc();b.un("mousemove",this.onMouseMove,this);b.un("mouseup",this.onMouseUp,this);b.un("selectstart",this.stopSelect,this);c.preventDefault();this.clearStart();var a=this.active;this.active=false;delete this.elRegion;this.fireEvent("mouseup",this,c);if(a){this.onEnd(c);this.fireEvent("dragend",this,c)}},triggerStart:function(a){this.clearStart();this.active=true;this.onStart(this.startXY);this.fireEvent("dragstart",this,this.startXY)},clearStart:function(){if(this.timer){clearTimeout(this.timer);delete this.timer}},stopSelect:function(a){a.stopEvent();return false},onBeforeStart:function(a){},onStart:function(a){},onDrag:function(a){},onEnd:function(a){},getDragTarget:function(){return this.dragTarget},getDragCt:function(){return this.el},getXY:function(a){return a?this.constrainModes[a].call(this,this.lastXY):this.lastXY},getOffset:function(c){var b=this.getXY(c);var a=this.startXY;return[a[0]-b[0],a[1]-b[1]]},constrainModes:{point:function(b){if(!this.elRegion){this.elRegion=this.getDragCt().getRegion()}var a=this.dragRegion;a.left=b[0];a.top=b[1];a.right=b[0];a.bottom=b[1];a.constrainTo(this.elRegion);return[a.left,a.top]}}});Ext.dd.ScrollManager=function(){var c=Ext.dd.DragDropMgr;var e={};var b=null;var h={};var g=function(k){b=null;a()};var i=function(){if(c.dragCurrent){c.refreshCache(c.dragCurrent.groups)}};var d=function(){if(c.dragCurrent){var k=Ext.dd.ScrollManager;var l=h.el.ddScrollConfig?h.el.ddScrollConfig.increment:k.increment;if(!k.animate){if(h.el.scroll(h.dir,l)){i()}}else{h.el.scroll(h.dir,l,true,k.animDuration,i)}}};var a=function(){if(h.id){clearInterval(h.id)}h.id=0;h.el=null;h.dir=""};var f=function(l,k){a();h.el=l;h.dir=k;var m=(l.ddScrollConfig&&l.ddScrollConfig.frequency)?l.ddScrollConfig.frequency:Ext.dd.ScrollManager.frequency;h.id=setInterval(d,m)};var j=function(n,p){if(p||!c.dragCurrent){return}var q=Ext.dd.ScrollManager;if(!b||b!=c.dragCurrent){b=c.dragCurrent;q.refreshCache()}var s=Ext.lib.Event.getXY(n);var t=new Ext.lib.Point(s[0],s[1]);for(var l in e){var m=e[l],k=m._region;var o=m.ddScrollConfig?m.ddScrollConfig:q;if(k&&k.contains(t)&&m.isScrollable()){if(k.bottom-t.y<=o.vthresh){if(h.el!=m){f(m,"down")}return}else{if(k.right-t.x<=o.hthresh){if(h.el!=m){f(m,"left")}return}else{if(t.y-k.top<=o.vthresh){if(h.el!=m){f(m,"up")}return}else{if(t.x-k.left<=o.hthresh){if(h.el!=m){f(m,"right")}return}}}}}}a()};c.fireEvents=c.fireEvents.createSequence(j,c);c.stopDrag=c.stopDrag.createSequence(g,c);return{register:function(m){if(Ext.isArray(m)){for(var l=0,k=m.length;lRepresents an HTML fragment template. Templates may be {@link #compile precompiled} * for greater performance.

    *

    For example usage {@link #Template see the constructor}.

    - * + * * @constructor * An instance of this class may be created by passing to the constructor either * a single argument, or multiple arguments: @@ -601,7 +610,7 @@ var t = new Ext.Template( { compiled: true, // {@link #compile} immediately disableFormats: true // See Notes below. - } + } ); *
    *

    Notes:

    @@ -617,19 +626,21 @@ var t = new Ext.Template( */ Ext.Template = function(html){ var me = this, - a = arguments, - buf = []; + a = arguments, + buf = [], + v; if (Ext.isArray(html)) { html = html.join(""); } else if (a.length > 1) { - Ext.each(a, function(v) { - if (Ext.isObject(v)) { + for(var i = 0, len = a.length; i < len; i++){ + v = a[i]; + if(typeof v == 'object'){ Ext.apply(me, v); } else { buf.push(v); } - }); + }; html = buf.join(''); } @@ -667,14 +678,14 @@ Ext.Template.prototype = { * @return {String} The HTML fragment */ applyTemplate : function(values){ - var me = this; + var me = this; return me.compiled ? - me.compiled(values) : - me.html.replace(me.re, function(m, name){ - return values[name] !== undefined ? values[name] : ""; - }); - }, + me.compiled(values) : + me.html.replace(me.re, function(m, name){ + return values[name] !== undefined ? values[name] : ""; + }); + }, /** * Sets the HTML used as the template and optionally compiles it. @@ -683,7 +694,7 @@ Ext.Template.prototype = { * @return {Ext.Template} this */ set : function(html, compile){ - var me = this; + var me = this; me.html = html; me.compiled = null; return compile ? me.compile() : me; @@ -695,13 +706,13 @@ Ext.Template.prototype = { */ compile : function(){ var me = this, - sep = Ext.isGecko ? "+" : ","; + sep = Ext.isGecko ? "+" : ","; - function fn(m, name){ - name = "values['" + name + "']"; - return "'"+ sep + '(' + name + " == undefined ? '' : " + name + ')' + sep + "'"; + function fn(m, name){ + name = "values['" + name + "']"; + return "'"+ sep + '(' + name + " == undefined ? '' : " + name + ')' + sep + "'"; } - + eval("this.compiled = function(values){ return " + (Ext.isGecko ? "'" : "['") + me.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn) + (Ext.isGecko ? "';};" : "'].join('');};")); @@ -797,7 +808,8 @@ Ext.Template.prototype.apply = Ext.Template.prototype.applyTemplate; Ext.Template.from = function(el, config){ el = Ext.getDom(el); return new Ext.Template(el.value || el.innerHTML, config || ''); -};/** +}; +/** * @class Ext.Template */ Ext.apply(Ext.Template.prototype, { @@ -814,12 +826,12 @@ var t = new Ext.Template( { compiled: true, // {@link #compile} immediately disableFormats: true // reduce {@link #apply} time since no formatting - } + } ); * * For a list of available format functions, see {@link Ext.util.Format}. */ - disableFormats : false, + disableFormats : false, /** * See {@link #disableFormats}. * @type Boolean @@ -833,6 +845,10 @@ var t = new Ext.Template( * @hide repeat doc */ re : /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g, + argsRe : /^\s*['"](.*)["']\s*$/, + compileARe : /\\/g, + compileBRe : /(\r\n|\n)/g, + compileCRe : /'/g, /** * Returns an HTML fragment of this template with the specified values applied. @@ -841,11 +857,11 @@ var t = new Ext.Template( * @hide repeat doc */ applyTemplate : function(values){ - var me = this, - useF = me.disableFormats !== true, - fm = Ext.util.Format, - tpl = me; - + var me = this, + useF = me.disableFormats !== true, + fm = Ext.util.Format, + tpl = me; + if(me.compiled){ return me.compiled(values); } @@ -858,7 +874,7 @@ var t = new Ext.Template( // quoted values are required for strings in compiled templates, // but for non compiled we need to strip them // quoted reversed for jsmin - var re = /^\s*['"](.*)["']\s*$/; + var re = me.argsRe; args = args.split(','); for(var i = 0, len = args.length; i < len; i++){ args[i] = args[i].replace(re, "$1"); @@ -875,7 +891,7 @@ var t = new Ext.Template( } return me.html.replace(me.re, fn); }, - + /** * Compiles the template into an internal function, eliminating the RegEx overhead. * @return {Ext.Template} this @@ -883,11 +899,11 @@ var t = new Ext.Template( */ compile : function(){ var me = this, - fm = Ext.util.Format, - useF = me.disableFormats !== true, - sep = Ext.isGecko ? "+" : ",", - body; - + fm = Ext.util.Format, + useF = me.disableFormats !== true, + sep = Ext.isGecko ? "+" : ",", + body; + function fn(m, name, format, args){ if(format && useF){ args = args ? ',' + args : ""; @@ -902,28 +918,29 @@ var t = new Ext.Template( } return "'"+ sep + format + "values['" + name + "']" + args + ")"+sep+"'"; } - + // branched to use + in gecko and [].join() in others if(Ext.isGecko){ body = "this.compiled = function(values){ return '" + - me.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn) + + me.html.replace(me.compileARe, '\\\\').replace(me.compileBRe, '\\n').replace(me.compileCRe, "\\'").replace(me.re, fn) + "';};"; }else{ body = ["this.compiled = function(values){ return ['"]; - body.push(me.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn)); + body.push(me.html.replace(me.compileARe, '\\\\').replace(me.compileBRe, '\\n').replace(me.compileCRe, "\\'").replace(me.re, fn)); body.push("'].join('');};"); body = body.join(''); } eval(body); return me; }, - + // private function used to call members call : function(fnName, value, allValues){ return this[fnName](value, allValues); } }); -Ext.Template.prototype.apply = Ext.Template.prototype.applyTemplate; /* +Ext.Template.prototype.apply = Ext.Template.prototype.applyTemplate; +/* * This is code is also distributed under MIT license for use * with jQuery and prototype JavaScript libraries. */ @@ -1909,9 +1926,7 @@ Ext.util.DelayedTask = function(fn, scope, args){ };(function(){ var EXTUTIL = Ext.util, - TOARRAY = Ext.toArray, EACH = Ext.each, - ISOBJECT = Ext.isObject, TRUE = true, FALSE = false; /** @@ -2031,11 +2046,12 @@ EXTUTIL.Observable.prototype = { * @return {Boolean} returns false if any of the handlers return false otherwise it returns true. */ fireEvent : function(){ - var a = TOARRAY(arguments), + var a = Array.prototype.slice.call(arguments, 0), ename = a[0].toLowerCase(), me = this, ret = TRUE, ce = me.events[ename], + cc, q, c; if (me.eventsSuspended === TRUE) { @@ -2043,20 +2059,21 @@ EXTUTIL.Observable.prototype = { q.push(a); } } - else if(ISOBJECT(ce) && ce.bubble){ - if(ce.fire.apply(ce, a.slice(1)) === FALSE) { - return FALSE; - } - c = me.getBubbleTarget && me.getBubbleTarget(); - if(c && c.enableBubble) { - if(!c.events[ename] || !Ext.isObject(c.events[ename]) || !c.events[ename].bubble) { - c.enableBubble(ename); + else if(typeof ce == 'object') { + if (ce.bubble){ + if(ce.fire.apply(ce, a.slice(1)) === FALSE) { + return FALSE; + } + c = me.getBubbleTarget && me.getBubbleTarget(); + if(c && c.enableBubble) { + cc = c.events[ename]; + if(!cc || typeof cc != 'object' || !cc.bubble) { + c.enableBubble(ename); + } + return c.fireEvent.apply(c, a); } - return c.fireEvent.apply(c, a); } - } - else { - if (ISOBJECT(ce)) { + else { a.shift(); ret = ce.fire.apply(ce, a); } @@ -2129,7 +2146,7 @@ myGridPanel.on({ oe, isF, ce; - if (ISOBJECT(eventName)) { + if (typeof eventName == 'object') { o = eventName; for (e in o){ oe = o[e]; @@ -2140,10 +2157,10 @@ myGridPanel.on({ } else { eventName = eventName.toLowerCase(); ce = me.events[eventName] || TRUE; - if (Ext.isBoolean(ce)) { + if (typeof ce == 'boolean') { me.events[eventName] = ce = new EXTUTIL.Event(me, eventName); } - ce.addListener(fn, scope, ISOBJECT(o) ? o : {}); + ce.addListener(fn, scope, typeof o == 'object' ? o : {}); } }, @@ -2155,7 +2172,7 @@ myGridPanel.on({ */ removeListener : function(eventName, fn, scope){ var ce = this.events[eventName.toLowerCase()]; - if (ISOBJECT(ce)) { + if (typeof ce == 'object') { ce.removeListener(fn, scope); } }, @@ -2169,7 +2186,7 @@ myGridPanel.on({ key; for(key in events){ evt = events[key]; - if(ISOBJECT(evt)){ + if(typeof evt == 'object'){ evt.clearListeners(); } } @@ -2187,7 +2204,7 @@ this.addEvents('storeloaded', 'storecleared'); addEvents : function(o){ var me = this; me.events = me.events || {}; - if (Ext.isString(o)) { + if (typeof o == 'string') { var a = arguments, i = a.length; while(i--) { @@ -2205,7 +2222,7 @@ this.addEvents('storeloaded', 'storecleared'); */ hasListener : function(eventName){ var e = this.events[eventName.toLowerCase()]; - return ISOBJECT(e) && e.listeners.length > 0; + return typeof e == 'object' && e.listeners.length > 0; }, /** @@ -2268,7 +2285,7 @@ EXTUTIL.Observable.releaseCapture = function(o){ function createTargeted(h, o, scope){ return function(){ if(o.target == arguments[0]){ - h.apply(scope, TOARRAY(arguments)); + h.apply(scope, Array.prototype.slice.call(arguments, 0)); } }; }; @@ -2276,7 +2293,7 @@ function createTargeted(h, o, scope){ function createBuffered(h, o, l, scope){ l.task = new EXTUTIL.DelayedTask(); return function(){ - l.task.delay(o.buffer, h, scope, TOARRAY(arguments)); + l.task.delay(o.buffer, h, scope, Array.prototype.slice.call(arguments, 0)); }; }; @@ -2294,7 +2311,7 @@ function createDelayed(h, o, l, scope){ l.tasks = []; } l.tasks.push(task); - task.delay(o.delay || 10, h, scope, TOARRAY(arguments)); + task.delay(o.delay || 10, h, scope, Array.prototype.slice.call(arguments, 0)); }; }; @@ -2345,7 +2362,7 @@ EXTUTIL.Event.prototype = { var list = this.listeners, i = list.length, l; - + scope = scope || this.obj; while(i--){ l = list[i]; @@ -2402,7 +2419,6 @@ EXTUTIL.Event.prototype = { fire : function(){ var me = this, - args = TOARRAY(arguments), listeners = me.listeners, len = listeners.length, i = 0, @@ -2410,6 +2426,7 @@ EXTUTIL.Event.prototype = { if(len > 0){ me.firing = TRUE; + var args = Array.prototype.slice.call(arguments, 0); for (; i < len; i++) { l = listeners[i]; if(l && l.fireFn.apply(l.scope || me.obj || window, args) === FALSE) { @@ -2420,8 +2437,10 @@ EXTUTIL.Event.prototype = { me.firing = FALSE; return TRUE; } + }; -})();/** +})(); +/** * @class Ext.util.Observable */ Ext.apply(Ext.util.Observable.prototype, function(){ @@ -2440,9 +2459,13 @@ Ext.apply(Ext.util.Observable.prototype, function(){ e.after = []; var makeCall = function(fn, scope, args){ - if (!Ext.isEmpty(v = fn.apply(scope || obj, args))) { - if (Ext.isObject(v)) { - returnValue = !Ext.isEmpty(v.returnValue) ? v.returnValue : v; + if((v = fn.apply(scope || obj, args)) !== undefined){ + if (typeof v == 'object') { + if(v.returnValue !== undefined){ + returnValue = v.returnValue; + }else{ + returnValue = v; + } cancel = !!v.cancel; } else @@ -2456,26 +2479,30 @@ Ext.apply(Ext.util.Observable.prototype, function(){ }; this[method] = function(){ - var args = Ext.toArray(arguments); + var args = Array.prototype.slice.call(arguments, 0), + b; returnValue = v = undefined; cancel = false; - Ext.each(e.before, function(b){ + for(var i = 0, len = e.before.length; i < len; i++){ + b = e.before[i]; makeCall(b.fn, b.scope, args); if (cancel) { return returnValue; } - }); + } - if (!Ext.isEmpty(v = e.originalFn.apply(obj, args))) { + if((v = e.originalFn.apply(obj, args)) !== undefined){ returnValue = v; } - Ext.each(e.after, function(a){ - makeCall(a.fn, a.scope, args); + + for(var i = 0, len = e.after.length; i < len; i++){ + b = e.after[i]; + makeCall(b.fn, b.scope, args); if (cancel) { return returnValue; } - }); + } return returnValue; }; } @@ -2502,21 +2529,18 @@ Ext.apply(Ext.util.Observable.prototype, function(){ }, removeMethodListener: function(method, fn, scope){ - var e = getMethodEvent.call(this, method), found = false; - Ext.each(e.before, function(b, i, arr){ - if (b.fn == fn && b.scope == scope) { - arr.splice(i, 1); - found = true; - return false; + var e = this.getMethodEvent(method); + for(var i = 0, len = e.before.length; i < len; i++){ + if(e.before[i].fn == fn && e.before[i].scope == scope){ + e.before.splice(i, 1); + return; + } + } + for(var i = 0, len = e.after.length; i < len; i++){ + if(e.after[i].fn == fn && e.after[i].scope == scope){ + e.after.splice(i, 1); + return; } - }); - if (!found) { - Ext.each(e.after, function(a, i, arr){ - if (a.fn == fn && a.scope == scope) { - arr.splice(i, 1); - return false; - } - }); } }, @@ -2529,13 +2553,14 @@ Ext.apply(Ext.util.Observable.prototype, function(){ var me = this; function createHandler(ename){ return function(){ - return me.fireEvent.apply(me, [ename].concat(Ext.toArray(arguments))); + return me.fireEvent.apply(me, [ename].concat(Array.prototype.slice.call(arguments, 0))); }; } - Ext.each(events, function(ename){ + for(var i = 0, len = events.length; i < len; i++){ + var ename = events[i]; me.events[ename] = me.events[ename] || true; o.on(ename, createHandler(ename), me); - }); + } }, /** @@ -2578,16 +2603,17 @@ var myForm = new Ext.formPanel({ enableBubble : function(events){ var me = this; if(!Ext.isEmpty(events)){ - events = Ext.isArray(events) ? events : Ext.toArray(arguments); - Ext.each(events, function(ename){ + events = Ext.isArray(events) ? events : Array.prototype.slice.call(arguments, 0); + for(var i = 0, len = events.length; i < len; i++){ + var ename = events[i]; ename = ename.toLowerCase(); var ce = me.events[ename] || true; - if (Ext.isBoolean(ce)) { + if (typeof ce == 'boolean') { ce = new Ext.util.Event(me, ename); me.events[ename] = ce; } ce.bubble = true; - }); + } } } }; @@ -2619,7 +2645,7 @@ Ext.data.Connection.on('beforerequest', function(con, options) { console.log('Ajax request made to ' + options.url); }); * @param {Function} c The class constructor to make observable. - * @param {Object} listeners An object containing a series of listeners to add. See {@link #addListener}. + * @param {Object} listeners An object containing a series of listeners to add. See {@link #addListener}. * @static */ Ext.util.Observable.observeClass = function(c, listeners){ @@ -2628,12 +2654,13 @@ Ext.util.Observable.observeClass = function(c, listeners){ Ext.apply(c, new Ext.util.Observable()); Ext.util.Observable.capture(c.prototype, c.fireEvent, c); } - if(Ext.isObject(listeners)){ + if(typeof listeners == 'object'){ c.on(listeners); } return c; } -};/** +}; +/** * @class Ext.EventManager * Registers event handlers that want to receive a normalized EventObject instead of the standard browser event and provides * several useful events directly. @@ -2877,7 +2904,7 @@ Ext.EventManager = function(){ }; function listen(element, ename, opt, fn, scope){ - var o = !Ext.isObject(opt) ? {} : opt, + var o = (!opt || typeof opt == "boolean") ? {} : opt, el = Ext.getDom(element), task; fn = fn || o.fn; @@ -2965,7 +2992,7 @@ Ext.EventManager = function(){ *

    See {@link Ext.Element#addListener} for examples of how to use these options.

    */ addListener : function(element, eventName, fn, scope, options){ - if(Ext.isObject(eventName)){ + if(typeof eventName == 'object'){ var o = eventName, e, val; for(e in o){ val = o[e]; @@ -3145,7 +3172,7 @@ Ext.EventManager = function(){ conn, tid, ajax = Ext.lib.Ajax; - (Ext.isObject(ajax.conn)) ? conn = ajax.conn : conn = {}; + (typeof ajax.conn == 'object') ? conn = ajax.conn : conn = {}; for (tid in conn) { c = conn[tid]; if (c) { @@ -4910,7 +4937,7 @@ Ext.Element.addMethods({ if(loadScripts !== true){ this.dom.innerHTML = html; - if(Ext.isFunction(callback)){ + if(typeof callback == 'function'){ callback(); } return this; @@ -4955,7 +4982,7 @@ Ext.Element.addMethods({ } el = DOC.getElementById(id); if(el){Ext.removeNode(el);} - if(Ext.isFunction(callback)){ + if(typeof callback == 'function'){ callback(); } }); @@ -4978,7 +5005,7 @@ Ext.Element.addMethods({ * @return {Ext.Element} The new proxy element */ createProxy : function(config, renderTo, matchBox){ - config = Ext.isObject(config) ? config : {tag : "div", cls: config}; + config = (typeof config == 'object') ? config : {tag : "div", cls: config}; var me = this, proxy = renderTo ? Ext.DomHelper.append(renderTo, config, true) : @@ -5778,6 +5805,8 @@ Ext.Element.addMethods(function(){ propFloat = Ext.isIE ? 'styleFloat' : 'cssFloat', opacityRe = /alpha\(opacity=(.*)\)/i, trimRe = /^\s+|\s+$/g, + spacesRe = /\s+/, + wordsRe = /\w/g, EL = Ext.Element, PADDING = "padding", MARGIN = "margin", @@ -5814,7 +5843,7 @@ Ext.Element.addMethods(function(){ // private ==> used by Fx adjustWidth : function(width) { var me = this; - var isNum = Ext.isNumber(width); + var isNum = (typeof width == "number"); if(isNum && me.autoBoxAdjust && !me.isBorderBox()){ width -= (me.getBorderWidth("lr") + me.getPadding("lr")); } @@ -5824,7 +5853,7 @@ Ext.Element.addMethods(function(){ // private ==> used by Fx adjustHeight : function(height) { var me = this; - var isNum = Ext.isNumber(height); + var isNum = (typeof height == "number"); if(isNum && me.autoBoxAdjust && !me.isBorderBox()){ height -= (me.getBorderWidth("tb") + me.getPadding("tb")); } @@ -5838,14 +5867,60 @@ Ext.Element.addMethods(function(){ * @return {Ext.Element} this */ addClass : function(className){ - var me = this, i, len, v; - className = Ext.isArray(className) ? className : [className]; - for (i=0, len = className.length; i < len; i++) { - v = className[i]; - if (v) { - me.dom.className += (!me.hasClass(v) && v ? " " + v : ""); - }; - }; + var me = this, + i, + len, + v, + cls = []; + // Separate case is for speed + if (!Ext.isArray(className)) { + if (typeof className == 'string' && !this.hasClass(className)) { + me.dom.className += " " + className; + } + } + else { + for (i = 0, len = className.length; i < len; i++) { + v = className[i]; + if (typeof v == 'string' && (' ' + me.dom.className + ' ').indexOf(' ' + v + ' ') == -1) { + cls.push(v); + } + } + if (cls.length) { + me.dom.className += " " + cls.join(" "); + } + } + return me; + }, + + /** + * Removes one or more CSS classes from the element. + * @param {String/Array} className The CSS class to remove, or an array of classes + * @return {Ext.Element} this + */ + removeClass : function(className){ + var me = this, + i, + idx, + len, + cls, + elClasses; + if (!Ext.isArray(className)){ + className = [className]; + } + if (me.dom && me.dom.className) { + elClasses = me.dom.className.replace(trimRe, '').split(spacesRe); + for (i = 0, len = className.length; i < len; i++) { + cls = className[i]; + if (typeof cls == 'string') { + cls = cls.replace(trimRe, ''); + idx = elClasses.indexOf(cls); + if (idx != -1) { + elClasses.splice(idx, 1); + } + } + } + me.dom.className = elClasses.join(" "); + } return me; }, @@ -5855,38 +5930,20 @@ Ext.Element.addMethods(function(){ * @return {Ext.Element} this */ radioClass : function(className){ - var cn = this.dom.parentNode.childNodes, v; + var cn = this.dom.parentNode.childNodes, + v, + i, + len; className = Ext.isArray(className) ? className : [className]; - for (var i=0, len = cn.length; i < len; i++) { + for (i = 0, len = cn.length; i < len; i++) { v = cn[i]; - if(v && v.nodeType == 1) { + if (v && v.nodeType == 1) { Ext.fly(v, '_internal').removeClass(className); } }; return this.addClass(className); }, - /** - * Removes one or more CSS classes from the element. - * @param {String/Array} className The CSS class to remove, or an array of classes - * @return {Ext.Element} this - */ - removeClass : function(className){ - var me = this, v; - className = Ext.isArray(className) ? className : [className]; - if (me.dom && me.dom.className) { - for (var i=0, len=className.length; i < len; i++) { - v = className[i]; - if(v) { - me.dom.className = me.dom.className.replace( - classReCache[v] = classReCache[v] || new RegExp('(?:^|\\s+)' + v + '(?:\\s+|$)', "g"), " " - ); - } - }; - } - return me; - }, - /** * Toggles the specified CSS class on this element (removes it if it already exists, otherwise adds it). * @param {String} className The CSS class to toggle @@ -5934,7 +5991,7 @@ Ext.Element.addMethods(function(){ display, wk = Ext.isWebKit, display; - + if(el == document){ return null; } @@ -5989,7 +6046,7 @@ Ext.Element.addMethods(function(){ */ getColor : function(attr, defaultValue, prefix){ var v = this.getStyle(attr), - color = Ext.isDefined(prefix) ? prefix : '#', + color = (typeof prefix != 'undefined') ? prefix : '#', h; if(!v || /transparent|inherit/.test(v)){ @@ -6017,7 +6074,7 @@ Ext.Element.addMethods(function(){ var tmp, style, camel; - if (!Ext.isObject(prop)) { + if (typeof prop != 'object') { tmp = {}; tmp[prop] = value; prop = tmp; @@ -6218,16 +6275,20 @@ Ext.fly('elId').setHeight(150, { // private addStyles : function(sides, styles){ - var val = 0, - m = sides.match(/\w/g), - s; - for (var i=0, len=m.length; ithis reference) in which the function is executed. (defaults to the Element) * @return {CompositeElement} this */ - each : function(fn, scope){ + each : function(fn, scope){ var me = this, els = me.elements, len = els.length, i, e; - + for(i = 0; i */ -Ext.CompositeElement = function(els, root){ - this.elements = []; - this.add(els, root); -}; - -Ext.extend(Ext.CompositeElement, Ext.CompositeElementLite, { +Ext.CompositeElement = Ext.extend(Ext.CompositeElementLite, { + + constructor : function(els, root){ + this.elements = []; + this.add(els, root); + }, // private getElement : function(el){ @@ -9326,7 +9390,7 @@ Ext.Element.select = function(selector, unique, root){ * @param {Boolean} unique (optional) true to create a unique Ext.Element for each element (defaults to a shared flyweight object) * @param {HTMLElement/String} root (optional) The root element of the query or id of the root * @return {CompositeElementLite/CompositeElement} - * @member Ext.Element + * @member Ext * @method select */ Ext.select = Ext.Element.select;(function(){ @@ -9680,20 +9744,20 @@ Ext.Ajax.request({ action: form.action }; + /* + * Originally this behaviour was modified for Opera 10 to apply the secure URL after + * the frame had been added to the document. It seems this has since been corrected in + * Opera so the behaviour has been reverted, the URL will be set before being added. + */ Ext.fly(frame).set({ id: id, name: id, - cls: 'x-hidden' - - }); + cls: 'x-hidden', + src: Ext.SSL_SECURE_URL + }); doc.body.appendChild(frame); - //Reset the Frame to neutral domain - Ext.fly(frame).set({ - src : Ext.SSL_SECURE_URL - }); - // This is required so that IE doesn't pop the response up in a new window. if(Ext.isIE){ document.frames[id].name = id; @@ -12074,7 +12138,7 @@ mc.add(otherEl); item : function(key){ var mk = this.map[key], item = mk !== undefined ? mk : (typeof key == 'number') ? this.items[key] : undefined; - return !Ext.isFunction(item) || this.allowFunctions ? item : null; // for prototype! + return typeof item != 'function' || this.allowFunctions ? item : null; // for prototype! }, /** @@ -12153,26 +12217,26 @@ mc.add(otherEl); _sort : function(property, dir, fn){ var i, len, dsc = String(dir).toUpperCase() == 'DESC' ? -1 : 1, - + //this is a temporary array used to apply the sorting function c = [], keys = this.keys, items = this.items; - + //default to a simple sorter function if one is not provided fn = fn || function(a, b) { return a - b; }; - + //copy all the items into a temporary array, which we will sort for(i = 0, len = items.length; i < len; i++){ c[c.length] = { - key : keys[i], - value: items[i], + key : keys[i], + value: items[i], index: i }; } - + //sort the temporary array c.sort(function(a, b){ var v = fn(a[property], b[property]) * dsc; @@ -12181,13 +12245,13 @@ mc.add(otherEl); } return v; }); - + //copy the temporary array back into the main this.items and this.keys objects for(i = 0, len = c.length; i < len; i++){ items[i] = c[i].value; keys[i] = c[i].key; } - + this.fireEvent('sort', this); }, @@ -12200,7 +12264,7 @@ mc.add(otherEl); sort : function(dir, fn){ this._sort('value', dir, fn); }, - + /** * Reorders each of the items based on a mapping from old index to new index. Internally this * just translates into a sort. The 'sort' event is fired whenever reordering has occured. @@ -12208,33 +12272,33 @@ mc.add(otherEl); */ reorder: function(mapping) { this.suspendEvents(); - + var items = this.items, index = 0, length = items.length, order = [], remaining = []; - + //object of {oldPosition: newPosition} reversed to {newPosition: oldPosition} for (oldIndex in mapping) { order[mapping[oldIndex]] = items[oldIndex]; - } - + } + for (index = 0; index < length; index++) { if (mapping[index] == undefined) { remaining.push(items[index]); } } - + for (index = 0; index < length; index++) { if (order[index] == undefined) { order[index] = remaining.shift(); } } - + this.clear(); this.addAll(order); - + this.resumeEvents(); this.fireEvent('sort', this); }, @@ -12369,7 +12433,7 @@ mc.add(otherEl); if (!value.exec) { // not a regex var er = Ext.escapeRe; value = String(value); - + if (anyMatch === true) { value = er(value); } else { @@ -12407,7 +12471,8 @@ mc.add(otherEl); * not found, returns undefined. If an item was found, but is a Class, * returns null. */ -Ext.util.MixedCollection.prototype.get = Ext.util.MixedCollection.prototype.item;/** +Ext.util.MixedCollection.prototype.get = Ext.util.MixedCollection.prototype.item; +/** * @class Ext.util.JSON * Modified version of Douglas Crockford"s json.js that doesn"t * mess with the Object prototype @@ -12967,17 +13032,17 @@ Ext.util.Format = function(){ *
  • {@link Ext.layout.MenuLayout}
  • *
  • {@link Ext.ColorPalette}
  • *

    - * - *

    For example usage {@link #XTemplate see the constructor}.

    - * + * + *

    For example usage {@link #XTemplate see the constructor}.

    + * * @constructor * The {@link Ext.Template#Template Ext.Template constructor} describes * the acceptable parameters to pass to the constructor. The following * examples demonstrate all of the supported features.

    - * + * *
      - * - *
    • Sample Data + * + *
    • Sample Data *
      *

      This is the data object used for reference in each code example:

      *
      
      @@ -13005,9 +13070,9 @@ var data = {
        * 
      *
      *
    • - * - * - *
    • Auto filling of arrays + * + * + *
    • Auto filling of arrays *
      *

      The tpl tag and the for operator are used * to process the provided data object: @@ -13078,9 +13143,9 @@ tpl.overwrite(panel.body, data); * *

      *
    • - * - * - *
    • Conditional processing with basic comparison operators + * + * + *
    • Conditional processing with basic comparison operators *
      *

      The tpl tag and the if operator are used * to provide conditional checks for deciding whether or not to render specific @@ -13115,9 +13180,9 @@ tpl.overwrite(panel.body, data); * *

      *
    • - * - * - *
    • Basic math support + * + * + *
    • Basic math support *
      *

      The following basic math operators may be applied directly on numeric * data values:

      @@ -13141,8 +13206,8 @@ tpl.overwrite(panel.body, data);
        * 
      *
    • * - * - *
    • Execute arbitrary inline code with special built-in template variables + * + *
    • Execute arbitrary inline code with special built-in template variables *
      *

      Anything between {[ ... ]} is considered code to be executed * in the scope of the template. There are some special variables available in that code: @@ -13173,8 +13238,8 @@ tpl.overwrite(panel.body, data); * *

      *
    • - * - *
    • Template member functions + * + *
    • Template member functions *
      *

      One or more member functions can be specified in a configuration * object passed into the XTemplate constructor for more complex processing:

      @@ -13211,40 +13276,40 @@ tpl.overwrite(panel.body, data); * *
      *
    • - * + * *
    - * + * * @param {Mixed} config */ Ext.XTemplate = function(){ Ext.XTemplate.superclass.constructor.apply(this, arguments); var me = this, - s = me.html, - re = /]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/, - nameRe = /^]*?for="(.*?)"/, - ifRe = /^]*?if="(.*?)"/, - execRe = /^]*?exec="(.*?)"/, - m, - id = 0, - tpls = [], - VALUES = 'values', - PARENT = 'parent', - XINDEX = 'xindex', - XCOUNT = 'xcount', - RETURN = 'return ', - WITHVALUES = 'with(values){ '; + s = me.html, + re = /]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/, + nameRe = /^]*?for="(.*?)"/, + ifRe = /^]*?if="(.*?)"/, + execRe = /^]*?exec="(.*?)"/, + m, + id = 0, + tpls = [], + VALUES = 'values', + PARENT = 'parent', + XINDEX = 'xindex', + XCOUNT = 'xcount', + RETURN = 'return ', + WITHVALUES = 'with(values){ '; s = ['', s, ''].join(''); while((m = s.match(re))){ - var m2 = m[0].match(nameRe), - m3 = m[0].match(ifRe), - m4 = m[0].match(execRe), - exp = null, - fn = null, - exec = null, - name = m2 && m2[1] ? m2[1] : ''; + var m2 = m[0].match(nameRe), + m3 = m[0].match(ifRe), + m4 = m[0].match(execRe), + exp = null, + fn = null, + exec = null, + name = m2 && m2[1] ? m2[1] : ''; if (m3) { exp = m3 && m3[1] ? m3[1] : null; @@ -13275,9 +13340,9 @@ Ext.XTemplate = function(){ s = s.replace(m[0], '{xtpl'+ id + '}'); ++id; } - Ext.each(tpls, function(t) { - me.compileTpl(t); - }); + for(var i = tpls.length-1; i >= 0; --i){ + me.compileTpl(tpls[i]); + } me.master = tpls[tpls.length-1]; me.tpls = tpls; }; @@ -13290,10 +13355,10 @@ Ext.extend(Ext.XTemplate, Ext.Template, { // private applySubTemplate : function(id, values, parent, xindex, xcount){ var me = this, - len, - t = me.tpls[id], - vs, - buf = []; + len, + t = me.tpls[id], + vs, + buf = []; if ((t.test && !t.test.call(me, values, parent, xindex, xcount)) || (t.exec && t.exec.call(me, values, parent, xindex, xcount))) { return ''; @@ -13302,9 +13367,9 @@ Ext.extend(Ext.XTemplate, Ext.Template, { len = vs.length; parent = t.target ? values : parent; if(t.target && Ext.isArray(vs)){ - Ext.each(vs, function(v, i) { - buf[buf.length] = t.compiled.call(me, v, parent, i+1, len); - }); + for(var i = 0, len = vs.length; i < len; i++){ + buf[buf.length] = t.compiled.call(me, vs[i], parent, i+1, len); + } return buf.join(''); } return t.compiled.call(me, vs, parent, xindex, xcount); @@ -13313,7 +13378,7 @@ Ext.extend(Ext.XTemplate, Ext.Template, { // private compileTpl : function(tpl){ var fm = Ext.util.Format, - useF = this.disableFormats !== true, + useF = this.disableFormats !== true, sep = Ext.isGecko ? "+" : ",", body; @@ -13416,7 +13481,8 @@ Ext.XTemplate.prototype.apply = Ext.XTemplate.prototype.applyTemplate; Ext.XTemplate.from = function(el){ el = Ext.getDom(el); return new Ext.XTemplate(el.value || el.innerHTML); -};/** +}; +/** * @class Ext.util.CSS * Utility class for manipulating CSS rules * @singleton diff --git a/pkgs/ext-foundation.js b/pkgs/ext-foundation.js index baace22f..51ed2f0d 100644 --- a/pkgs/ext-foundation.js +++ b/pkgs/ext-foundation.js @@ -1,7 +1,7 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ -Ext.DomHelper=function(){var s=null,j=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,l=/^table|tbody|tr|td$/i,p,m="afterbegin",n="afterend",c="beforebegin",o="beforeend",a="",h="
    ",b=a+"",i=""+h,k=b+"",r=""+i;function g(w,y,x,z,v,t){var u=p.insertHtml(z,Ext.getDom(w),q(y));return x?Ext.get(u,true):u}function q(z){var v="",u,y,x,t,A;if(Ext.isString(z)){v=z}else{if(Ext.isArray(z)){for(var w=0;w"}}}return v}function e(A,x,w,y){s.innerHTML=[x,w,y].join("");var t=-1,v=s,u;while(++t "'+y+'"'},insertBefore:function(t,v,u){return g(t,v,u,c)},insertAfter:function(t,v,u){return g(t,v,u,n,"nextSibling")},insertFirst:function(t,v,u){return g(t,v,u,m,"firstChild")},append:function(t,v,u){return g(t,v,u,o,"",true)},overwrite:function(t,v,u){t=Ext.getDom(t);t.innerHTML=q(v);return u?Ext.get(t.firstChild):t.firstChild},createHtml:q};return p}();Ext.apply(Ext.DomHelper,function(){var d,a="afterbegin",g="afterend",h="beforebegin",c="beforeend";function e(l,n,m,p,k,i){l=Ext.getDom(l);var j;if(d.useDom){j=b(n,null);if(i){l.appendChild(j)}else{(k=="firstChild"?l:l.parentNode).insertBefore(j,l[k]||l)}}else{j=Ext.DomHelper.insertHtml(p,l,Ext.DomHelper.createHtml(n))}return m?Ext.get(j,true):j}function b(p,j){var l,m=document,k,i,n,q;if(Ext.isArray(p)){l=m.createDocumentFragment();Ext.each(p,function(o){b(o,l)})}else{if(Ext.isString(p)){l=m.createTextNode(p)}else{l=m.createElement(p.tag||"div");k=!!l.setAttribute;Ext.iterate(p,function(o,r){if(!/tag|children|cn|html|style/.test(o)){if(o=="cls"){l.className=r}else{if(k){l.setAttribute(o,r)}else{l[o]=r}}}});Ext.DomHelper.applyStyles(l,p.style);if((q=p.children||p.cn)){b(q,l)}else{if(p.html){l.innerHTML=p.html}}}}if(j){j.appendChild(l)}return l}d={createTemplate:function(j){var i=Ext.DomHelper.createHtml(j);return new Ext.Template(i)},useDom:false,insertBefore:function(i,k,j){return e(i,k,j,h)},insertAfter:function(i,k,j){return e(i,k,j,g,"nextSibling")},insertFirst:function(i,k,j){return e(i,k,j,a,"firstChild")},append:function(i,k,j){return e(i,k,j,c,"",true)},createDom:b};return d}());Ext.Template=function(d){var e=this,b=arguments,c=[];if(Ext.isArray(d)){d=d.join("")}else{if(b.length>1){Ext.each(b,function(a){if(Ext.isObject(a)){Ext.apply(e,a)}else{c.push(a)}});d=c.join("")}}e.html=d;if(e.compiled){e.compile()}};Ext.Template.prototype={re:/\{([\w-]+)\}/g,applyTemplate:function(a){var b=this;return b.compiled?b.compiled(a):b.html.replace(b.re,function(c,d){return a[d]!==undefined?a[d]:""})},set:function(a,c){var b=this;b.html=a;b.compiled=null;return c?b.compile():b},compile:function(){var me=this,sep=Ext.isGecko?"+":",";function fn(m,name){name="values['"+name+"']";return"'"+sep+"("+name+" == undefined ? '' : "+name+")"+sep+"'"}eval("this.compiled = function(values){ return "+(Ext.isGecko?"'":"['")+me.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn)+(Ext.isGecko?"';};":"'].join('');};"));return me},insertFirst:function(b,a,c){return this.doInsert("afterBegin",b,a,c)},insertBefore:function(b,a,c){return this.doInsert("beforeBegin",b,a,c)},insertAfter:function(b,a,c){return this.doInsert("afterEnd",b,a,c)},append:function(b,a,c){return this.doInsert("beforeEnd",b,a,c)},doInsert:function(c,e,b,a){e=Ext.getDom(e);var d=Ext.DomHelper.insertHtml(c,e,this.applyTemplate(b));return a?Ext.get(d,true):d},overwrite:function(b,a,c){b=Ext.getDom(b);b.innerHTML=this.applyTemplate(a);return c?Ext.get(b.firstChild,true):b.firstChild}};Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.Template.from=function(b,a){b=Ext.getDom(b);return new Ext.Template(b.value||b.innerHTML,a||"")};Ext.apply(Ext.Template.prototype,{disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,applyTemplate:function(b){var g=this,a=g.disableFormats!==true,e=Ext.util.Format,c=g;if(g.compiled){return g.compiled(b)}function d(j,l,p,k){if(p&&a){if(p.substr(0,5)=="this."){return c.call(p.substr(5),b[l],b)}else{if(k){var o=/^\s*['"](.*)["']\s*$/;k=k.split(",");for(var n=0,h=k.length;n+~]\s?|\s|$)/,tagTokenRe=/^(#)?([\w-\*]+)/,nthRe=/(\d*)n\+?(\d*)/,nthRe2=/\D/,isIE=window.ActiveXObject?true:false,key=30803;eval("var batch = 30803;");function child(parent,index){var i=0,n=parent.firstChild;while(n){if(n.nodeType==1){if(++i==index){return n}}n=n.nextSibling}return null}function next(n){while((n=n.nextSibling)&&n.nodeType!=1){}return n}function prev(n){while((n=n.previousSibling)&&n.nodeType!=1){}return n}function children(parent){var n=parent.firstChild,nodeIndex=-1,nextNode;while(n){nextNode=n.nextSibling;if(n.nodeType==3&&!nonSpace.test(n.nodeValue)){parent.removeChild(n)}else{n.nodeIndex=++nodeIndex}n=nextNode}return this}function byClassName(nodeSet,cls){if(!cls){return nodeSet}var result=[],ri=-1;for(var i=0,ci;ci=nodeSet[i];i++){if((" "+ci.className+" ").indexOf(cls)!=-1){result[++ri]=ci}}return result}function attrValue(n,attr){if(!n.tagName&&typeof n.length!="undefined"){n=n[0]}if(!n){return null}if(attr=="for"){return n.htmlFor}if(attr=="class"||attr=="className"){return n.className}return n.getAttribute(attr)||n[attr]}function getNodes(ns,mode,tagName){var result=[],ri=-1,cs;if(!ns){return result}tagName=tagName||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns]}if(!mode){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(tagName);for(var j=0,ci;ci=cs[j];j++){result[++ri]=ci}}}else{if(mode=="/"||mode==">"){var utag=tagName.toUpperCase();for(var i=0,ni,cn;ni=ns[i];i++){cn=ni.childNodes;for(var j=0,cj;cj=cn[j];j++){if(cj.nodeName==utag||cj.nodeName==tagName||tagName=="*"){result[++ri]=cj}}}}else{if(mode=="+"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(n&&(n.nodeName==utag||n.nodeName==tagName||tagName=="*")){result[++ri]=n}}}else{if(mode=="~"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)){if(n.nodeName==utag||n.nodeName==tagName||tagName=="*"){result[++ri]=n}}}}}}}return result}function concat(a,b){if(b.slice){return a.concat(b)}for(var i=0,l=b.length;i1){return nodup(results)}return results},isXml:function(el){var docEl=(el?el.ownerDocument||el:0).documentElement;return docEl?docEl.nodeName!=="HTML":false},select:document.querySelectorAll?function(path,root,type){root=root||document;if(!Ext.DomQuery.isXml(root)){try{var cs=root.querySelectorAll(path);return Ext.toArray(cs)}catch(ex){}}return Ext.DomQuery.jsSelect.call(this,path,root,type)}:function(path,root,type){return Ext.DomQuery.jsSelect.call(this,path,root,type)},selectNode:function(path,root){return Ext.DomQuery.select(path,root)[0]},selectValue:function(path,root,defaultValue){path=path.replace(trimRe,"");if(!valueCache[path]){valueCache[path]=Ext.DomQuery.compile(path,"select")}var n=valueCache[path](root),v;n=n[0]?n[0]:n;if(typeof n.normalize=="function"){n.normalize()}v=(n&&n.firstChild?n.firstChild.nodeValue:null);return((v===null||v===undefined||v==="")?defaultValue:v)},selectNumber:function(path,root,defaultValue){var v=Ext.DomQuery.selectValue(path,root,defaultValue||0);return parseFloat(v)},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el)}var isArray=Ext.isArray(el),result=Ext.DomQuery.filter(isArray?el:[el],ss);return isArray?(result.length==el.length):(result.length>0)},filter:function(els,ss,nonMatches){ss=ss.replace(trimRe,"");if(!simpleCache[ss]){simpleCache[ss]=Ext.DomQuery.compile(ss,"simple")}var result=simpleCache[ss](els);return nonMatches?quickDiff(result,els):result},matchers:[{re:/^\.([\w-]+)/,select:'n = byClassName(n, " {1} ");'},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'},{re:/^#([\w-]+)/,select:'n = byId(n, "{1}");'},{re:/^@([\w-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,v){return a==v},"!=":function(a,v){return a!=v},"^=":function(a,v){return a&&a.substr(0,v.length)==v},"$=":function(a,v){return a&&a.substr(a.length-v.length)==v},"*=":function(a,v){return a&&a.indexOf(v)!==-1},"%=":function(a,v){return(a%v)==0},"|=":function(a,v){return a&&(a==v||a.substr(0,v.length+1)==v+"-")},"~=":function(a,v){return a&&(" "+a+" ").indexOf(" "+v+" ")!=-1}},pseudos:{"first-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"last-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"nth-child":function(c,a){var r=[],ri=-1,m=nthRe.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!nthRe2.test(a)&&"n+"+a||a),f=(m[1]||1)-0,l=m[2]-0;for(var i=0,n;n=c[i];i++){var pn=n.parentNode;if(batch!=pn._batch){var j=0;for(var cn=pn.firstChild;cn;cn=cn.nextSibling){if(cn.nodeType==1){cn.nodeIndex=++j}}pn._batch=batch}if(f==1){if(l==0||n.nodeIndex==l){r[++ri]=n}}else{if((n.nodeIndex+l)%f==0){r[++ri]=n}}}return r},"only-child":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(!prev(ci)&&!next(ci)){r[++ri]=ci}}return r},empty:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,empty=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){empty=false;break}}if(empty){r[++ri]=ci}}return r},contains:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if((ci.textContent||ci.innerText||"").indexOf(v)!=-1){r[++ri]=ci}}return r},nodeValue:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[++ri]=ci}}return r},checked:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[++ri]=ci}}return r},not:function(c,ss){return Ext.DomQuery.filter(c,ss,true)},any:function(c,selectors){var ss=selectors.split("|"),r=[],ri=-1,s;for(var i=0,ci;ci=c[i];i++){for(var j=0;s=ss[j];j++){if(Ext.DomQuery.is(ci,s)){r[++ri]=ci;break}}}return r},odd:function(c){return this["nth-child"](c,"odd")},even:function(c){return this["nth-child"](c,"even")},nth:function(c,a){return c[a-1]||[]},first:function(c){return c[0]||[]},last:function(c){return c[c.length-1]||[]},has:function(c,ss){var s=Ext.DomQuery.select,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[++ri]=ci}}return r},next:function(c,ss){var is=Ext.DomQuery.is,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=next(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r},prev:function(c,ss){var is=Ext.DomQuery.is,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=prev(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r}}}}();Ext.query=Ext.DomQuery.select;Ext.util.DelayedTask=function(d,c,a){var e=this,g,b=function(){clearInterval(g);g=null;d.apply(c,a||[])};e.delay=function(i,k,j,h){e.cancel();d=k||d;c=j||c;a=h||a;g=setInterval(b,i)};e.cancel=function(){if(g){clearInterval(g);g=null}}};(function(){var i=Ext.util,l=Ext.toArray,k=Ext.each,a=Ext.isObject,h=true,j=false;i.Observable=function(){var m=this,n=m.events;if(m.listeners){m.on(m.listeners);delete m.listeners}m.events=n||{}};i.Observable.prototype={filterOptRe:/^(?:scope|delay|buffer|single)$/,fireEvent:function(){var m=l(arguments),o=m[0].toLowerCase(),p=this,n=h,s=p.events[o],r,t;if(p.eventsSuspended===h){if(r=p.eventQueue){r.push(m)}}else{if(a(s)&&s.bubble){if(s.fire.apply(s,m.slice(1))===j){return j}t=p.getBubbleTarget&&p.getBubbleTarget();if(t&&t.enableBubble){if(!t.events[o]||!Ext.isObject(t.events[o])||!t.events[o].bubble){t.enableBubble(o)}return t.fireEvent.apply(t,m)}}else{if(a(s)){m.shift();n=s.fire.apply(s,m)}}}return n},addListener:function(p,s,u,n){var r=this,q,v,t,m;if(a(p)){n=p;for(q in n){v=n[q];if(!r.filterOptRe.test(q)){r.addListener(q,v.fn||v,v.scope||n.scope,v.fn?v:n)}}}else{p=p.toLowerCase();m=r.events[p]||h;if(Ext.isBoolean(m)){r.events[p]=m=new i.Event(r,p)}m.addListener(s,u,a(n)?n:{})}},removeListener:function(m,o,n){var p=this.events[m.toLowerCase()];if(a(p)){p.removeListener(o,n)}},purgeListeners:function(){var o=this.events,m,n;for(n in o){m=o[n];if(a(m)){m.clearListeners()}}},addEvents:function(q){var p=this;p.events=p.events||{};if(Ext.isString(q)){var m=arguments,n=m.length;while(n--){p.events[m[n]]=p.events[m[n]]||h}}else{Ext.applyIf(p.events,q)}},hasListener:function(m){var n=this.events[m.toLowerCase()];return a(n)&&n.listeners.length>0},suspendEvents:function(m){this.eventsSuspended=h;if(m&&!this.eventQueue){this.eventQueue=[]}},resumeEvents:function(){var m=this,n=m.eventQueue||[];m.eventsSuspended=j;delete m.eventQueue;k(n,function(o){m.fireEvent.apply(m,o)})}};var e=i.Observable.prototype;e.on=e.addListener;e.un=e.removeListener;i.Observable.releaseCapture=function(m){m.fireEvent=e.fireEvent};function g(n,p,m){return function(){if(p.target==arguments[0]){n.apply(m,l(arguments))}}}function c(p,q,m,n){m.task=new i.DelayedTask();return function(){m.task.delay(q.buffer,p,n,l(arguments))}}function d(o,p,n,m){return function(){p.removeListener(n,m);return o.apply(m,arguments)}}function b(p,q,m,n){return function(){var o=new i.DelayedTask();if(!m.tasks){m.tasks=[]}m.tasks.push(o);o.delay(q.delay||10,p,n,l(arguments))}}i.Event=function(n,m){this.name=m;this.obj=n;this.listeners=[]};i.Event.prototype={addListener:function(p,o,n){var q=this,m;o=o||q.obj;if(!q.isListening(p,o)){m=q.createListener(p,o,n);if(q.firing){q.listeners=q.listeners.slice(0)}q.listeners.push(m)}},createListener:function(q,p,r){r=r||{},p=p||this.obj;var m={fn:q,scope:p,options:r},n=q;if(r.target){n=g(n,r,p)}if(r.delay){n=b(n,r,m,p)}if(r.single){n=d(n,this,q,p)}if(r.buffer){n=c(n,r,m,p)}m.fireFn=n;return m},findListener:function(p,o){var q=this.listeners,n=q.length,m;o=o||this.obj;while(n--){m=q[n];if(m){if(m.fn==p&&m.scope==o){return n}}}return -1},isListening:function(n,m){return this.findListener(n,m)!=-1},removeListener:function(r,q){var p,m,n,s=this,o=j;if((p=s.findListener(r,q))!=-1){if(s.firing){s.listeners=s.listeners.slice(0)}m=s.listeners[p];if(m.task){m.task.cancel();delete m.task}n=m.tasks&&m.tasks.length;if(n){while(n--){m.tasks[n].cancel()}delete m.tasks}s.listeners.splice(p,1);o=h}return o},clearListeners:function(){var o=this,m=o.listeners,n=m.length;while(n--){o.removeListener(m[n].fn,m[n].scope)}},fire:function(){var r=this,o=l(arguments),q=r.listeners,m=q.length,p=0,n;if(m>0){r.firing=h;for(;p=525:!((Ext.isGecko&&!Ext.isWindows)||Ext.isOpera);return{doResizeEvent:function(){var l=a.getViewHeight(),k=a.getViewWidth();if(g!=l||h!=k){c.fire(h=k,g=l)}},onWindowResize:function(m,l,k){if(!c){c=new Ext.util.Event();j=new Ext.util.DelayedTask(this.doResizeEvent);Ext.EventManager.on(window,"resize",this.fireWindowResize,this)}c.addListener(m,l,k)},fireWindowResize:function(){if(c){j.delay(100)}},onTextResize:function(n,m,k){if(!e){e=new Ext.util.Event();var l=new Ext.Element(document.createElement("div"));l.dom.className="x-text-resize";l.dom.innerHTML="X";l.appendTo(document.body);b=l.dom.offsetHeight;setInterval(function(){if(l.dom.offsetHeight!=b){e.fire(b,b=l.dom.offsetHeight)}},this.textResizeInterval)}e.addListener(n,m,k)},removeResizeListener:function(l,k){if(c){c.removeListener(l,k)}},fireResize:function(){if(c){c.fire(a.getViewWidth(),a.getViewHeight())}},textResizeInterval:50,ieDeferSrc:false,useKeydown:d}}());Ext.EventManager.on=Ext.EventManager.addListener;Ext.apply(Ext.EventObjectImpl.prototype,{BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,RETURN:13,SHIFT:16,CTRL:17,CONTROL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGEUP:33,PAGE_DOWN:34,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,isNavKeyPress:function(){var b=this,a=this.normalizeKey(b.keyCode);return(a>=33&&a<=40)||a==b.RETURN||a==b.TAB||a==b.ESC},isSpecialKey:function(){var a=this.normalizeKey(this.keyCode);return(this.type=="keypress"&&this.ctrlKey)||this.isNavKeyPress()||(a==this.BACKSPACE)||(a>=16&&a<=20)||(a>=44&&a<=46)},getPoint:function(){return new Ext.lib.Point(this.xy[0],this.xy[1])},hasModifier:function(){return((this.ctrlKey||this.altKey)||this.shiftKey)}});(function(){var j=document;Ext.Element=function(o,p){var q=typeof o=="string"?j.getElementById(o):o,r;if(!q){return null}r=q.id;if(!p&&r&&Ext.elCache[r]){return Ext.elCache[r].el}this.dom=q;this.id=r||Ext.id(q)};var a=Ext.lib.Dom,g=Ext.DomHelper,m=Ext.lib.Event,e=Ext.lib.Anim,h=Ext.Element,b=Ext.elCache;h.prototype={set:function(t,q){var r=this.dom,p,s,q=(q!==false)&&!!r.setAttribute;for(p in t){if(t.hasOwnProperty(p)){s=t[p];if(p=="style"){g.applyStyles(r,s)}else{if(p=="cls"){r.className=s}else{if(q){r.setAttribute(p,s)}else{r[p]=s}}}}}return this},defaultUnit:"px",is:function(o){return Ext.DomQuery.is(this.dom,o)},focus:function(r,q){var o=this,q=q||o.dom;try{if(Number(r)){o.focus.defer(r,null,[null,q])}else{q.focus()}}catch(p){}return o},blur:function(){try{this.dom.blur()}catch(o){}return this},getValue:function(o){var p=this.dom.value;return o?parseInt(p,10):p},addListener:function(o,r,q,p){Ext.EventManager.on(this.dom,o,r,q||this,p);return this},removeListener:function(o,q,p){Ext.EventManager.removeListener(this.dom,o,q,p||this);return this},removeAllListeners:function(){Ext.EventManager.removeAll(this.dom);return this},purgeAllListeners:function(){Ext.EventManager.purgeElement(this,true);return this},addUnits:function(o){if(o===""||o=="auto"||o===undefined){o=o||""}else{if(!isNaN(o)||!k.test(o)){o=o+(this.defaultUnit||"px")}}return o},load:function(p,q,o){Ext.Ajax.request(Ext.apply({params:q,url:p.url||p,callback:o,el:this.dom,indicatorText:p.indicatorText||""},Ext.isObject(p)?p:{}));return this},isBorderBox:function(){return i[(this.dom.tagName||"").toLowerCase()]||Ext.isBorderBox},remove:function(){var o=this,p=o.dom;if(p){delete o.dom;Ext.removeNode(p)}},hover:function(p,o,r,q){var s=this;s.on("mouseenter",p,r||s.dom,q);s.on("mouseleave",o,r||s.dom,q);return s},contains:function(o){return !o?false:Ext.lib.Dom.isAncestor(this.dom,o.dom?o.dom:o)},getAttributeNS:function(p,o){return this.getAttribute(o,p)},getAttribute:Ext.isIE?function(o,q){var r=this.dom,p=typeof r[q+":"+o];if(["undefined","unknown"].indexOf(p)==-1){return r[q+":"+o]}return r[o]}:function(o,p){var q=this.dom;return q.getAttributeNS(p,o)||q.getAttribute(p+":"+o)||q.getAttribute(o)||q[o]},update:function(o){if(this.dom){this.dom.innerHTML=o}return this}};var n=h.prototype;h.addMethods=function(p){Ext.apply(n,p)};n.on=n.addListener;n.un=n.removeListener;n.autoBoxAdjust=true;var k=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i,d;h.get=function(p){var o,s,r;if(!p){return null}if(typeof p=="string"){if(!(s=j.getElementById(p))){return null}if(b[p]&&b[p].el){o=b[p].el;o.dom=s}else{o=h.addToCache(new h(s))}return o}else{if(p.tagName){if(!(r=p.id)){r=Ext.id(p)}if(b[r]&&b[r].el){o=b[r].el;o.dom=p}else{o=h.addToCache(new h(p))}return o}else{if(p instanceof h){if(p!=d){if(Ext.isIE&&(p.id==undefined||p.id=="")){p.dom=p.dom}else{p.dom=j.getElementById(p.id)||p.dom}}return p}else{if(p.isComposite){return p}else{if(Ext.isArray(p)){return h.select(p)}else{if(p==j){if(!d){var q=function(){};q.prototype=h.prototype;d=new q();d.dom=j}return d}}}}}}return null};h.addToCache=function(o,p){p=p||o.id;b[p]={el:o,data:{},events:{}};return o};h.data=function(p,o,q){p=h.get(p);if(!p){return null}var r=b[p.id].data;if(arguments.length==2){return r[o]}else{return(r[o]=q)}};function l(){if(!Ext.enableGarbageCollector){clearInterval(h.collectorThreadId)}else{var p,r,u,s;for(p in b){s=b[p];if(s.skipGC){continue}r=s.el;u=r.dom;if(!u||!u.parentNode||(!u.offsetParent&&!j.getElementById(p))){if(Ext.enableListenerCollection){Ext.EventManager.removeAll(u)}delete b[p]}}if(Ext.isIE){var q={};for(p in b){q[p]=b[p]}b=Ext.elCache=q}}}h.collectorThreadId=setInterval(l,30000);var c=function(){};c.prototype=h.prototype;h.Flyweight=function(o){this.dom=o};h.Flyweight.prototype=new c();h.Flyweight.prototype.isFlyweight=true;h._flyweights={};h.fly=function(q,o){var p=null;o=o||"_global";if(q=Ext.getDom(q)){(h._flyweights[o]=h._flyweights[o]||new h.Flyweight()).dom=q;p=h._flyweights[o]}return p};Ext.get=h.get;Ext.fly=h.fly;var i=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko){i.button=1}})();Ext.Element.addMethods({swallowEvent:function(a,b){var d=this;function c(g){g.stopPropagation();if(b){g.preventDefault()}}if(Ext.isArray(a)){Ext.each(a,function(g){d.on(g,c)});return d}d.on(a,c);return d},relayEvent:function(a,b){this.on(a,function(c){b.fireEvent(a,c)})},clean:function(b){var d=this,e=d.dom,g=e.firstChild,c=-1;if(Ext.Element.data(e,"isCleaned")&&b!==true){return d}while(g){var a=g.nextSibling;if(g.nodeType==3&&!/\S/.test(g.nodeValue)){e.removeChild(g)}else{g.nodeIndex=++c}g=a}Ext.Element.data(e,"isCleaned",true);return d},load:function(){var a=this.getUpdater();a.update.apply(a,arguments);return this},getUpdater:function(){return this.updateManager||(this.updateManager=new Ext.Updater(this))},update:function(html,loadScripts,callback){if(!this.dom){return this}html=html||"";if(loadScripts!==true){this.dom.innerHTML=html;if(Ext.isFunction(callback)){callback()}return this}var id=Ext.id(),dom=this.dom;html+='';Ext.lib.Event.onAvailable(id,function(){var DOC=document,hd=DOC.getElementsByTagName("head")[0],re=/(?:]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,srcRe=/\ssrc=([\'\"])(.*?)\1/i,typeRe=/\stype=([\'\"])(.*?)\1/i,match,attrs,srcMatch,typeMatch,el,s;while((match=re.exec(html))){attrs=match[1];srcMatch=attrs?attrs.match(srcRe):false;if(srcMatch&&srcMatch[2]){s=DOC.createElement("script");s.src=srcMatch[2];typeMatch=attrs.match(typeRe);if(typeMatch&&typeMatch[2]){s.type=typeMatch[2]}hd.appendChild(s)}else{if(match[2]&&match[2].length>0){if(window.execScript){window.execScript(match[2])}else{window.eval(match[2])}}}}el=DOC.getElementById(id);if(el){Ext.removeNode(el)}if(Ext.isFunction(callback)){callback()}});dom.innerHTML=html.replace(/(?:)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this},removeAllListeners:function(){this.removeAnchor();Ext.EventManager.removeAll(this.dom);return this},createProxy:function(a,e,d){a=Ext.isObject(a)?a:{tag:"div",cls:a};var c=this,b=e?Ext.DomHelper.append(e,a,true):Ext.DomHelper.insertBefore(c.dom,a,true);if(d&&c.setBox&&c.getBox){b.setBox(c.getBox())}return b}});Ext.Element.prototype.getUpdateManager=Ext.Element.prototype.getUpdater;Ext.Element.addMethods({getAnchorXY:function(e,l,q){e=(e||"tl").toLowerCase();q=q||{};var k=this,b=k.dom==document.body||k.dom==document,n=q.width||b?Ext.lib.Dom.getViewWidth():k.getWidth(),i=q.height||b?Ext.lib.Dom.getViewHeight():k.getHeight(),p,a=Math.round,c=k.getXY(),m=k.getScroll(),j=b?m.left:!l?c[0]:0,g=b?m.top:!l?c[1]:0,d={c:[a(n*0.5),a(i*0.5)],t:[a(n*0.5),0],l:[0,a(i*0.5)],r:[n,a(i*0.5)],b:[a(n*0.5),i],tl:[0,0],bl:[0,i],br:[n,i],tr:[n,0]};p=d[e];return[p[0]+j,p[1]+g]},anchorTo:function(b,h,c,a,k,l){var i=this,e=i.dom,j=!Ext.isEmpty(k),d=function(){Ext.fly(e).alignTo(b,h,c,a);Ext.callback(l,Ext.fly(e))},g=this.getAnchor();this.removeAnchor();Ext.apply(g,{fn:d,scroll:j});Ext.EventManager.onWindowResize(d,null);if(j){Ext.EventManager.on(window,"scroll",d,null,{buffer:!isNaN(k)?k:50})}d.call(i);return i},removeAnchor:function(){var b=this,a=this.getAnchor();if(a&&a.fn){Ext.EventManager.removeResizeListener(a.fn);if(a.scroll){Ext.EventManager.un(window,"scroll",a.fn)}delete a.fn}return b},getAnchor:function(){var b=Ext.Element.data,c=this.dom;if(!c){return}var a=b(c,"_anchor");if(!a){a=b(c,"_anchor",{})}return a},getAlignToXY:function(g,A,B){g=Ext.get(g);if(!g||!g.dom){throw"Element.alignToXY with an element that doesn't exist"}B=B||[0,0];A=(!A||A=="?"?"tl-bl?":(!/-/.test(A)&&A!==""?"tl-"+A:A||"tl-bl")).toLowerCase();var K=this,H=K.dom,M,L,n,l,s,F,v,t=Ext.lib.Dom.getViewWidth()-10,G=Ext.lib.Dom.getViewHeight()-10,b,i,j,k,u,z,N=document,J=N.documentElement,q=N.body,E=(J.scrollLeft||q.scrollLeft||0)+5,D=(J.scrollTop||q.scrollTop||0)+5,I=false,e="",a="",C=A.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!C){throw"Element.alignTo with an invalid alignment "+A}e=C[1];a=C[2];I=!!C[3];M=K.getAnchorXY(e,true);L=g.getAnchorXY(a,false);n=L[0]-M[0]+B[0];l=L[1]-M[1]+B[1];if(I){s=K.getWidth();F=K.getHeight();v=g.getRegion();b=e.charAt(0);i=e.charAt(e.length-1);j=a.charAt(0);k=a.charAt(a.length-1);u=((b=="t"&&j=="b")||(b=="b"&&j=="t"));z=((i=="r"&&k=="l")||(i=="l"&&k=="r"));if(n+s>t+E){n=z?v.left-s:t+E-s}if(nG+D){l=u?v.top-F:G+D-F}if(lA){o=A-p;l=true}if((n+B)>g){n=g-B;l=true}if(o "+g,this.dom);return h?i:a(i)},parent:function(g,h){return this.matchNode(d,d,g,h)},next:function(g,h){return this.matchNode(b,b,g,h)},prev:function(g,h){return this.matchNode(c,c,g,h)},first:function(g,h){return this.matchNode(b,"firstChild",g,h)},last:function(g,h){return this.matchNode(c,"lastChild",g,h)},matchNode:function(h,k,g,i){var j=this.dom[k];while(j){if(j.nodeType==1&&(!g||e.is(j,g))){return !i?a(j):j}j=j[h]}return null}}}());Ext.Element.addMethods({select:function(a,b){return Ext.Element.select(a,b,this.dom)}});Ext.Element.addMethods(function(){var c=Ext.getDom,a=Ext.get,b=Ext.DomHelper;return{appendChild:function(d){return a(d).appendTo(this)},appendTo:function(d){c(d).appendChild(this.dom);return this},insertBefore:function(d){(d=c(d)).parentNode.insertBefore(this.dom,d);return this},insertAfter:function(d){(d=c(d)).parentNode.insertBefore(this.dom,d.nextSibling);return this},insertFirst:function(e,d){e=e||{};if(e.nodeType||e.dom||typeof e=="string"){e=c(e);this.dom.insertBefore(e,this.dom.firstChild);return !d?a(e):e}else{return this.createChild(e,this.dom.firstChild,d)}},replace:function(d){d=a(d);this.insertBefore(d);d.remove();return this},replaceWith:function(d){var e=this;if(d.nodeType||d.dom||typeof d=="string"){d=c(d);e.dom.parentNode.insertBefore(d,e.dom)}else{d=b.insertBefore(e.dom,d)}delete Ext.elCache[e.id];Ext.removeNode(e.dom);e.id=Ext.id(e.dom=d);Ext.Element.addToCache(e.isFlyweight?new Ext.Element(e.dom):e);return e},createChild:function(e,d,g){e=e||{tag:"div"};return d?b.insertBefore(d,e,g!==true):b[!this.dom.firstChild?"overwrite":"append"](this.dom,e,g!==true)},wrap:function(d,e){var g=b.insertBefore(this.dom,d||{tag:"div"},!e);g.dom?g.dom.appendChild(this.dom):g.appendChild(this.dom);return g},insertHtml:function(e,g,d){var h=b.insertHtml(e,this.dom,g);return d?Ext.get(h):h}}}());Ext.apply(Ext.Element.prototype,function(){var c=Ext.getDom,a=Ext.get,b=Ext.DomHelper;return{insertSibling:function(i,g,h){var j=this,e,d=(g||"before").toLowerCase()=="after",k;if(Ext.isArray(i)){k=j;Ext.each(i,function(l){e=Ext.fly(k,"_internal").insertSibling(l,g,h);if(d){k=e}});return e}i=i||{};if(i.nodeType||i.dom){e=j.dom.parentNode.insertBefore(c(i),d?j.dom.nextSibling:j.dom);if(!h){e=a(e)}}else{if(d&&!j.dom.nextSibling){e=b.append(j.dom.parentNode,i,!h)}else{e=b[d?"insertAfter":"insertBefore"](j.dom,i,!h)}}return e}}}());Ext.Element.addMethods(function(){var h={},x=/(-[a-z])/gi,b={},s=document.defaultView,u=Ext.isIE?"styleFloat":"cssFloat",C=/alpha\(opacity=(.*)\)/i,l=/^\s+|\s+$/g,A=Ext.Element,d="padding",c="margin",y="border",t="-left",q="-right",w="-top",o="-bottom",j="-width",r=Math,z="hidden",e="isClipped",k="overflow",n="overflow-x",m="overflow-y",B="originalClip",i={l:y+t+j,r:y+q+j,t:y+w+j,b:y+o+j},g={l:d+t,r:d+q,t:d+w,b:d+o},a={l:c+t,r:c+q,t:c+w,b:c+o},D=Ext.Element.data;function p(E,F){return F.charAt(1).toUpperCase()}function v(E){return h[E]||(h[E]=E=="float"?u:E.replace(x,p))}return{adjustWidth:function(E){var F=this;var G=Ext.isNumber(E);if(G&&F.autoBoxAdjust&&!F.isBorderBox()){E-=(F.getBorderWidth("lr")+F.getPadding("lr"))}return(G&&E<0)?0:E},adjustHeight:function(E){var F=this;var G=Ext.isNumber(E);if(G&&F.autoBoxAdjust&&!F.isBorderBox()){E-=(F.getBorderWidth("tb")+F.getPadding("tb"))}return(G&&E<0)?0:E},addClass:function(H){var I=this,G,E,F;H=Ext.isArray(H)?H:[H];for(G=0,E=H.length;G5?G.toLowerCase():F)},setStyle:function(I,H){var F,G,E;if(!Ext.isObject(I)){F={};F[I]=H;I=F}for(G in I){H=I[G];G=="opacity"?this.setOpacity(H):this.dom.style[v(G)]=H}return this},setOpacity:function(F,E){var I=this,G=I.dom.style;if(!E||!I.anim){if(Ext.isIE){var H=F<1?"alpha(opacity="+F*100+")":"",J=G.filter.replace(C,"").replace(l,"");G.zoom=1;G.filter=J+(J.length>0?" ":"")+H}else{G.opacity=F}}else{I.anim({opacity:{to:F}},I.preanim(arguments,1),null,0.35,"easeIn")}return I},clearOpacity:function(){var E=this.dom.style;if(Ext.isIE){if(!Ext.isEmpty(E.filter)){E.filter=E.filter.replace(C,"").replace(l,"")}}else{E.opacity=E["-moz-opacity"]=E["-khtml-opacity"]=""}return this},getHeight:function(G){var F=this,I=F.dom,H=Ext.isIE&&F.isStyle("display","none"),E=r.max(I.offsetHeight,H?0:I.clientHeight)||0;E=!G?E:E-F.getBorderWidth("tb")-F.getPadding("tb");return E<0?0:E},getWidth:function(F){var G=this,I=G.dom,H=Ext.isIE&&G.isStyle("display","none"),E=r.max(I.offsetWidth,H?0:I.clientWidth)||0;E=!F?E:E-G.getBorderWidth("lr")-G.getPadding("lr");return E<0?0:E},setWidth:function(F,E){var G=this;F=G.adjustWidth(F);!E||!G.anim?G.dom.style.width=G.addUnits(F):G.anim({width:{to:F}},G.preanim(arguments,1));return G},setHeight:function(E,F){var G=this;E=G.adjustHeight(E);!F||!G.anim?G.dom.style.height=G.addUnits(E):G.anim({height:{to:E}},G.preanim(arguments,1));return G},getBorderWidth:function(E){return this.addStyles(E,i)},getPadding:function(E){return this.addStyles(E,g)},clip:function(){var E=this,F=E.dom;if(!D(F,e)){D(F,e,true);D(F,B,{o:E.getStyle(k),x:E.getStyle(n),y:E.getStyle(m)});E.setStyle(k,z);E.setStyle(n,z);E.setStyle(m,z)}return E},unclip:function(){var E=this,G=E.dom;if(D(G,e)){D(G,e,false);var F=D(G,B);if(F.o){E.setStyle(k,F.o)}if(F.x){E.setStyle(n,F.x)}if(F.y){E.setStyle(m,F.y)}}return E},addStyles:function(J,I){var K=0,F=J.match(/\w/g),H;for(var G=0,E=F.length;G"+String.format(Ext.Element.boxMarkup,c)+""));Ext.DomQuery.selectNode("."+c+"-mc",d.dom).appendChild(this.dom);return d},setSize:function(e,c,d){var g=this;if(Ext.isObject(e)){c=e.height;e=e.width}e=g.adjustWidth(e);c=g.adjustHeight(c);if(!d||!g.anim){g.dom.style.width=g.addUnits(e);g.dom.style.height=g.addUnits(c)}else{g.anim({width:{to:e},height:{to:c}},g.preanim(arguments,2))}return g},getComputedHeight:function(){var d=this,c=Math.max(d.dom.offsetHeight,d.dom.clientHeight);if(!c){c=parseFloat(d.getStyle("height"))||0;if(!d.isBorderBox()){c+=d.getFrameWidth("tb")}}return c},getComputedWidth:function(){var c=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!c){c=parseFloat(this.getStyle("width"))||0;if(!this.isBorderBox()){c+=this.getFrameWidth("lr")}}return c},getFrameWidth:function(d,c){return c&&this.isBorderBox()?0:(this.getPadding(d)+this.getBorderWidth(d))},addClassOnOver:function(c){this.hover(function(){Ext.fly(this,a).addClass(c)},function(){Ext.fly(this,a).removeClass(c)});return this},addClassOnFocus:function(c){this.on("focus",function(){Ext.fly(this,a).addClass(c)},this.dom);this.on("blur",function(){Ext.fly(this,a).removeClass(c)},this.dom);return this},addClassOnClick:function(c){var d=this.dom;this.on("mousedown",function(){Ext.fly(d,a).addClass(c);var g=Ext.getDoc(),e=function(){Ext.fly(d,a).removeClass(c);g.removeListener("mouseup",e)};g.on("mouseup",e)});return this},getViewSize:function(){var g=document,h=this.dom,c=(h==g||h==g.body);if(c){var e=Ext.lib.Dom;return{width:e.getViewWidth(),height:e.getViewHeight()}}else{return{width:h.clientWidth,height:h.clientHeight}}},getStyleSize:function(){var j=this,c,i,l=document,m=this.dom,e=(m==l||m==l.body),g=m.style;if(e){var k=Ext.lib.Dom;return{width:k.getViewWidth(),height:k.getViewHeight()}}if(g.width&&g.width!="auto"){c=parseFloat(g.width);if(j.isBorderBox()){c-=j.getFrameWidth("lr")}}if(g.height&&g.height!="auto"){i=parseFloat(g.height);if(j.isBorderBox()){i-=j.getFrameWidth("tb")}}return{width:c||j.getWidth(true),height:i||j.getHeight(true)}},getSize:function(c){return{width:this.getWidth(c),height:this.getHeight(c)}},repaint:function(){var c=this.dom;this.addClass("x-repaint");setTimeout(function(){Ext.fly(c).removeClass("x-repaint")},1);return this},unselectable:function(){this.dom.unselectable="on";return this.swallowEvent("selectstart",true).applyStyles("-moz-user-select:none;-khtml-user-select:none;").addClass("x-unselectable")},getMargins:function(d){var e=this,c,g={t:"top",l:"left",r:"right",b:"bottom"},h={};if(!d){for(c in e.margins){h[g[c]]=parseFloat(e.getStyle(e.margins[c]))||0}return h}else{return e.addStyles.call(e,d,e.margins)}}}}());(function(){var a=Ext.lib.Dom,b="left",g="right",d="top",i="bottom",h="position",c="static",e="relative",j="auto",k="z-index";Ext.Element.addMethods({getX:function(){return a.getX(this.dom)},getY:function(){return a.getY(this.dom)},getXY:function(){return a.getXY(this.dom)},getOffsetsTo:function(l){var n=this.getXY(),m=Ext.fly(l,"_internal").getXY();return[n[0]-m[0],n[1]-m[1]]},setX:function(l,m){return this.setXY([l,this.getY()],this.animTest(arguments,m,1))},setY:function(m,l){return this.setXY([this.getX(),m],this.animTest(arguments,l,1))},setLeft:function(l){this.setStyle(b,this.addUnits(l));return this},setTop:function(l){this.setStyle(d,this.addUnits(l));return this},setRight:function(l){this.setStyle(g,this.addUnits(l));return this},setBottom:function(l){this.setStyle(i,this.addUnits(l));return this},setXY:function(n,l){var m=this;if(!l||!m.anim){a.setXY(m.dom,n)}else{m.anim({points:{to:n}},m.preanim(arguments,1),"motion")}return m},setLocation:function(l,n,m){return this.setXY([l,n],this.animTest(arguments,m,2))},moveTo:function(l,n,m){return this.setXY([l,n],this.animTest(arguments,m,2))},getLeft:function(l){return !l?this.getX():parseInt(this.getStyle(b),10)||0},getRight:function(l){var m=this;return !l?m.getX()+m.getWidth():(m.getLeft(true)+m.getWidth())||0},getTop:function(l){return !l?this.getY():parseInt(this.getStyle(d),10)||0},getBottom:function(l){var m=this;return !l?m.getY()+m.getHeight():(m.getTop(true)+m.getHeight())||0},position:function(p,o,l,n){var m=this;if(!p&&m.isStyle(h,c)){m.setStyle(h,e)}else{if(p){m.setStyle(h,p)}}if(o){m.setStyle(k,o)}if(l||n){m.setXY([l||false,n||false])}},clearPositioning:function(l){l=l||"";this.setStyle({left:l,right:l,top:l,bottom:l,"z-index":"",position:c});return this},getPositioning:function(){var m=this.getStyle(b);var n=this.getStyle(d);return{position:this.getStyle(h),left:m,right:m?"":this.getStyle(g),top:n,bottom:n?"":this.getStyle(i),"z-index":this.getStyle(k)}},setPositioning:function(l){var n=this,m=n.dom.style;n.setStyle(l);if(l.right==j){m.right=""}if(l.bottom==j){m.bottom=""}return n},translatePoints:function(m,u){u=isNaN(m[1])?u:m[1];m=isNaN(m[0])?m:m[0];var q=this,r=q.isStyle(h,e),s=q.getXY(),n=parseInt(q.getStyle(b),10),p=parseInt(q.getStyle(d),10);n=!isNaN(n)?n:(r?0:q.dom.offsetLeft);p=!isNaN(p)?p:(r?0:q.dom.offsetTop);return{left:(m-s[0]+n),top:(u-s[1]+p)}},animTest:function(m,l,n){return !!l&&this.preanim?this.preanim(m,n):false}})})();Ext.Element.addMethods({setBox:function(e,g,b){var d=this,a=e.width,c=e.height;if((g&&!d.autoBoxAdjust)&&!d.isBorderBox()){a-=(d.getBorderWidth("lr")+d.getPadding("lr"));c-=(d.getBorderWidth("tb")+d.getPadding("tb"))}d.setBounds(e.x,e.y,a,c,d.animTest.call(d,arguments,b,2));return d},getBox:function(j,p){var m=this,v,e,o,d=m.getBorderWidth,q=m.getPadding,g,a,u,n;if(!p){v=m.getXY()}else{e=parseInt(m.getStyle("left"),10)||0;o=parseInt(m.getStyle("top"),10)||0;v=[e,o]}var c=m.dom,s=c.offsetWidth,i=c.offsetHeight,k;if(!j){k={x:v[0],y:v[1],0:v[0],1:v[1],width:s,height:i}}else{g=d.call(m,"l")+q.call(m,"l");a=d.call(m,"r")+q.call(m,"r");u=d.call(m,"t")+q.call(m,"t");n=d.call(m,"b")+q.call(m,"b");k={x:v[0]+g,y:v[1]+u,0:v[0]+g,1:v[1]+u,width:s-(g+a),height:i-(u+n)}}k.right=k.x+k.width;k.bottom=k.y+k.height;return k},move:function(j,b,c){var g=this,m=g.getXY(),k=m[0],i=m[1],d=[k-b,i],l=[k+b,i],h=[k,i-b],a=[k,i+b],e={l:d,left:d,r:l,right:l,t:h,top:h,up:h,b:a,bottom:a,down:a};j=j.toLowerCase();g.moveTo(e[j][0],e[j][1],g.animTest.call(g,arguments,c,2))},setLeftTop:function(d,c){var b=this,a=b.dom.style;a.left=b.addUnits(d);a.top=b.addUnits(c);return b},getRegion:function(){return Ext.lib.Dom.getRegion(this.dom)},setBounds:function(b,g,d,a,c){var e=this;if(!c||!e.anim){e.setSize(d,a);e.setLocation(b,g)}else{e.anim({points:{to:[b,g]},width:{to:e.adjustWidth(d)},height:{to:e.adjustHeight(a)}},e.preanim(arguments,4),"motion")}return e},setRegion:function(b,a){return this.setBounds(b.left,b.top,b.right-b.left,b.bottom-b.top,this.animTest.call(this,arguments,a,1))}});Ext.Element.addMethods({isScrollable:function(){var a=this.dom;return a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth},scrollTo:function(a,b){this.dom["scroll"+(/top/i.test(a)?"Top":"Left")]=b;return this},getScroll:function(){var i=this.dom,h=document,a=h.body,c=h.documentElement,b,g,e;if(i==h||i==a){if(Ext.isIE&&Ext.isStrict){b=c.scrollLeft;g=c.scrollTop}else{b=window.pageXOffset;g=window.pageYOffset}e={left:b||(a?a.scrollLeft:0),top:g||(a?a.scrollTop:0)}}else{e={left:i.scrollLeft,top:i.scrollTop}}return e}});Ext.Element.addMethods({scrollTo:function(b,d,a){var e=/top/i.test(b),c=this,g=c.dom,h;if(!a||!c.anim){h="scroll"+(e?"Top":"Left"),g[h]=d}else{h="scroll"+(e?"Left":"Top"),c.anim({scroll:{to:e?[g[h],d]:[d,g[h]]}},c.preanim(arguments,2),"scroll")}return c},scrollIntoView:function(e,i){var p=Ext.getDom(e)||Ext.getBody().dom,h=this.dom,g=this.getOffsetsTo(p),k=g[0]+p.scrollLeft,u=g[1]+p.scrollTop,q=u+h.offsetHeight,d=k+h.offsetWidth,a=p.clientHeight,m=parseInt(p.scrollTop,10),s=parseInt(p.scrollLeft,10),j=m+a,n=s+p.clientWidth;if(h.offsetHeight>a||uj){p.scrollTop=q-a}}p.scrollTop=p.scrollTop;if(i!==false){if(h.offsetWidth>p.clientWidth||kn){p.scrollLeft=d-p.clientWidth}}p.scrollLeft=p.scrollLeft}return this},scrollChildIntoView:function(b,a){Ext.fly(b,"_scrollChildIntoView").scrollIntoView(this,a)},scroll:function(m,b,d){if(!this.isScrollable()){return}var e=this.dom,g=e.scrollLeft,p=e.scrollTop,n=e.scrollWidth,k=e.scrollHeight,i=e.clientWidth,a=e.clientHeight,c=false,o,j={l:Math.min(g+b,n-i),r:o=Math.max(g-b,0),t:Math.max(p-b,0),b:Math.min(p+b,k-a)};j.d=j.b;j.u=j.t;m=m.substr(0,1);if((o=j[m])>-1){c=true;this.scrollTo(m=="l"||m=="r"?"left":"top",o,this.preanim(arguments,2))}return c}});Ext.Element.VISIBILITY=1;Ext.Element.DISPLAY=2;Ext.Element.addMethods(function(){var h="visibility",d="display",b="hidden",k="offsets",j="none",a="originalDisplay",c="visibilityMode",e=Ext.Element.DISPLAY,g=Ext.Element.data,i=function(n){var m=g(n,a);if(m===undefined){g(n,a,m="")}return m},l=function(o){var n=g(o,c);if(n===undefined){g(o,c,n=1)}return n};return{originalDisplay:"",visibilityMode:1,setVisibilityMode:function(m){g(this.dom,c,m);return this},animate:function(n,p,o,q,m){this.anim(n,{duration:p,callback:o,easing:q},m);return this},anim:function(p,q,n,s,o,m){n=n||"run";q=q||{};var r=this,t=Ext.lib.Anim[n](r.dom,p,(q.duration||s)||0.35,(q.easing||o)||"easeOut",function(){if(m){m.call(r)}if(q.callback){q.callback.call(q.scope||r,r,q)}},r);q.anim=t;return t},preanim:function(m,n){return !m[n]?false:(Ext.isObject(m[n])?m[n]:{duration:m[n+1],callback:m[n+2],easing:m[n+3]})},isVisible:function(){return !this.isStyle(h,b)&&!this.isStyle(d,j)},setVisible:function(r,o){var p=this,n,m,s,q=p.dom;if(Ext.isString(o)){n=o==d;m=o==h;s=o==k;o=false}else{n=l(this.dom)==e;m=!n}if(!o||!p.anim){if(n){p.setDisplayed(r)}else{if(s){if(!r){p.hideModeStyles={position:p.getStyle("position"),top:p.getStyle("top"),left:p.getStyle("left")};p.applyStyles({position:"absolute",top:"-10000px",left:"-10000px"})}else{p.applyStyles(p.hideModeStyles||{position:"",top:"",left:""})}}else{p.fixDisplay();q.style.visibility=r?"visible":b}}}else{if(r){p.setOpacity(0.01);p.setVisible(true)}p.anim({opacity:{to:(r?1:0)}},p.preanim(arguments,1),null,0.35,"easeIn",function(){if(!r){q.style[n?d:h]=(n)?j:b;Ext.fly(q).setOpacity(1)}})}return p},toggle:function(m){var n=this;n.setVisible(!n.isVisible(),n.preanim(arguments,0));return n},setDisplayed:function(m){if(typeof m=="boolean"){m=m?i(this.dom):j}this.setStyle(d,m);return this},fixDisplay:function(){var m=this;if(m.isStyle(d,j)){m.setStyle(h,b);m.setStyle(d,i(this.dom));if(m.isStyle(d,j)){m.setStyle(d,"block")}}},hide:function(m){if(Ext.isString(m)){this.setVisible(false,m);return this}this.setVisible(false,this.preanim(arguments,0));return this},show:function(m){if(Ext.isString(m)){this.setVisible(true,m);return this}this.setVisible(true,this.preanim(arguments,0));return this}}}());Ext.Element.addMethods(function(){var d="visibility",b="display",a="hidden",h="none",c="x-masked",g="x-masked-relative",e=Ext.Element.data;return{isVisible:function(i){var j=!this.isStyle(d,a)&&!this.isStyle(b,h),k=this.dom.parentNode;if(i!==true||!j){return j}while(k&&!/^body/i.test(k.tagName)){if(!Ext.fly(k,"_isVisible").isVisible()){return false}k=k.parentNode}return true},isDisplayed:function(){return !this.isStyle(b,h)},enableDisplayMode:function(i){this.setVisibilityMode(Ext.Element.DISPLAY);if(!Ext.isEmpty(i)){e(this.dom,"originalDisplay",i)}return this},mask:function(j,n){var p=this,l=p.dom,o=Ext.DomHelper,m="ext-el-mask-msg",i,q;if(!/^body/i.test(l.tagName)&&p.getStyle("position")=="static"){p.addClass(g)}if((i=e(l,"maskMsg"))){i.remove()}if((i=e(l,"mask"))){i.remove()}q=o.append(l,{cls:"ext-el-mask"},true);e(l,"mask",q);p.addClass(c);q.setDisplayed(true);if(typeof j=="string"){var k=o.append(l,{cls:m,cn:{tag:"div"}},true);e(l,"maskMsg",k);k.dom.className=n?m+" "+n:m;k.dom.firstChild.innerHTML=j;k.setDisplayed(true);k.center(p)}if(Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&p.getStyle("height")=="auto"){q.setSize(undefined,p.getHeight())}return q},unmask:function(){var k=this,l=k.dom,i=e(l,"mask"),j=e(l,"maskMsg");if(i){if(j){j.remove();e(l,"maskMsg",undefined)}i.remove();e(l,"mask",undefined)}k.removeClass([c,g])},isMasked:function(){var i=e(this.dom,"mask");return i&&i.isVisible()},createShim:function(){var i=document.createElement("iframe"),j;i.frameBorder="0";i.className="ext-shim";i.src=Ext.SSL_SECURE_URL;j=Ext.get(this.dom.parentNode.insertBefore(i,this.dom));j.autoBoxAdjust=false;return j}}}());Ext.Element.addMethods({addKeyListener:function(b,d,c){var a;if(!Ext.isObject(b)||Ext.isArray(b)){a={key:b,fn:d,scope:c}}else{a={key:b.key,shift:b.shift,ctrl:b.ctrl,alt:b.alt,fn:d,scope:c}}return new Ext.KeyMap(this,a)},addKeyMap:function(a){return new Ext.KeyMap(this,a)}});(function(){var y=null,A=undefined,k=true,t=false,j="setX",h="setY",a="setXY",n="left",l="bottom",s="top",m="right",q="height",g="width",i="points",w="hidden",z="absolute",u="visible",e="motion",o="position",r="easeOut",d=new Ext.Element.Flyweight(),v={},x=function(B){return B||{}},p=function(B){d.dom=B;d.id=Ext.id(B);return d},c=function(B){if(!v[B]){v[B]=[]}return v[B]},b=function(C,B){v[C]=B};Ext.enableFx=k;Ext.Fx={switchStatements:function(C,D,B){return D.apply(this,B[C])},slideIn:function(H,E){E=x(E);var J=this,G=J.dom,M=G.style,O,B,L,D,C,M,I,N,K,F;H=H||"t";J.queueFx(E,function(){O=p(G).getXY();p(G).fixDisplay();B=p(G).getFxRestore();L={x:O[0],y:O[1],0:O[0],1:O[1],width:G.offsetWidth,height:G.offsetHeight};L.right=L.x+L.width;L.bottom=L.y+L.height;p(G).setWidth(L.width).setHeight(L.height);D=p(G).fxWrap(B.pos,E,w);M.visibility=u;M.position=z;function P(){p(G).fxUnwrap(D,B.pos,E);M.width=B.width;M.height=B.height;p(G).afterFx(E)}N={to:[L.x,L.y]};K={to:L.width};F={to:L.height};function Q(U,R,V,S,X,Z,ac,ab,aa,W,T){var Y={};p(U).setWidth(V).setHeight(S);if(p(U)[X]){p(U)[X](Z)}R[ac]=R[ab]="0";if(aa){Y.width=aa}if(W){Y.height=W}if(T){Y.points=T}return Y}I=p(G).switchStatements(H.toLowerCase(),Q,{t:[D,M,L.width,0,y,y,n,l,y,F,y],l:[D,M,0,L.height,y,y,m,s,K,y,y],r:[D,M,L.width,L.height,j,L.right,n,s,y,y,N],b:[D,M,L.width,L.height,h,L.bottom,n,s,y,F,N],tl:[D,M,0,0,y,y,m,l,K,F,N],bl:[D,M,0,0,h,L.y+L.height,m,s,K,F,N],br:[D,M,0,0,a,[L.right,L.bottom],n,s,K,F,N],tr:[D,M,0,0,j,L.x+L.width,n,l,K,F,N]});M.visibility=u;p(D).show();arguments.callee.anim=p(D).fxanim(I,E,e,0.5,r,P)});return J},slideOut:function(F,D){D=x(D);var H=this,E=H.dom,K=E.style,L=H.getXY(),C,B,I,J,G={to:0};F=F||"t";H.queueFx(D,function(){B=p(E).getFxRestore();I={x:L[0],y:L[1],0:L[0],1:L[1],width:E.offsetWidth,height:E.offsetHeight};I.right=I.x+I.width;I.bottom=I.y+I.height;p(E).setWidth(I.width).setHeight(I.height);C=p(E).fxWrap(B.pos,D,u);K.visibility=u;K.position=z;p(C).setWidth(I.width).setHeight(I.height);function M(){D.useDisplay?p(E).setDisplayed(t):p(E).hide();p(E).fxUnwrap(C,B.pos,D);K.width=B.width;K.height=B.height;p(E).afterFx(D)}function N(O,W,U,X,S,V,R,T,Q){var P={};O[W]=O[U]="0";P[X]=S;if(V){P[V]=R}if(T){P[T]=Q}return P}J=p(E).switchStatements(F.toLowerCase(),N,{t:[K,n,l,q,G],l:[K,m,s,g,G],r:[K,n,s,g,G,i,{to:[I.right,I.y]}],b:[K,n,s,q,G,i,{to:[I.x,I.bottom]}],tl:[K,m,l,g,G,q,G],bl:[K,m,s,g,G,q,G,i,{to:[I.x,I.bottom]}],br:[K,n,s,g,G,q,G,i,{to:[I.x+I.width,I.bottom]}],tr:[K,n,l,g,G,q,G,i,{to:[I.right,I.y]}]});arguments.callee.anim=p(C).fxanim(J,D,e,0.5,r,M)});return H},puff:function(H){H=x(H);var F=this,G=F.dom,C=G.style,D,B,E;F.queueFx(H,function(){D=p(G).getWidth();B=p(G).getHeight();p(G).clearOpacity();p(G).show();E=p(G).getFxRestore();function I(){H.useDisplay?p(G).setDisplayed(t):p(G).hide();p(G).clearOpacity();p(G).setPositioning(E.pos);C.width=E.width;C.height=E.height;C.fontSize="";p(G).afterFx(H)}arguments.callee.anim=p(G).fxanim({width:{to:p(G).adjustWidth(D*2)},height:{to:p(G).adjustHeight(B*2)},points:{by:[-D*0.5,-B*0.5]},opacity:{to:0},fontSize:{to:200,unit:"%"}},H,e,0.5,r,I)});return F},switchOff:function(F){F=x(F);var D=this,E=D.dom,B=E.style,C;D.queueFx(F,function(){p(E).clearOpacity();p(E).clip();C=p(E).getFxRestore();function G(){F.useDisplay?p(E).setDisplayed(t):p(E).hide();p(E).clearOpacity();p(E).setPositioning(C.pos);B.width=C.width;B.height=C.height;p(E).afterFx(F)}p(E).fxanim({opacity:{to:0.3}},y,y,0.1,y,function(){p(E).clearOpacity();(function(){p(E).fxanim({height:{to:1},points:{by:[0,p(E).getHeight()*0.5]}},F,e,0.3,"easeIn",G)}).defer(100)})});return D},highlight:function(D,H){H=x(H);var F=this,G=F.dom,B=H.attr||"backgroundColor",C={},E;F.queueFx(H,function(){p(G).clearOpacity();p(G).show();function I(){G.style[B]=E;p(G).afterFx(H)}E=G.style[B];C[B]={from:D||"ffff9c",to:H.endColor||p(G).getColor(B)||"ffffff"};arguments.callee.anim=p(G).fxanim(C,H,"color",1,"easeIn",I)});return F},frame:function(B,E,H){H=x(H);var D=this,G=D.dom,C,F;D.queueFx(H,function(){B=B||"#C3DAF9";if(B.length==6){B="#"+B}E=E||1;p(G).show();var L=p(G).getXY(),J={x:L[0],y:L[1],0:L[0],1:L[1],width:G.offsetWidth,height:G.offsetHeight},I=function(){C=p(document.body||document.documentElement).createChild({style:{position:z,"z-index":35000,border:"0px solid "+B}});return C.queueFx({},K)};arguments.callee.anim={isAnimated:true,stop:function(){E=0;C.stopFx()}};function K(){var M=Ext.isBorderBox?2:1;F=C.anim({top:{from:J.y,to:J.y-20},left:{from:J.x,to:J.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:J.height,to:J.height+20*M},width:{from:J.width,to:J.width+20*M}},{duration:H.duration||1,callback:function(){C.remove();--E>0?I():p(G).afterFx(H)}});arguments.callee.anim={isAnimated:true,stop:function(){F.stop()}}}I()});return D},pause:function(D){var C=this.dom,B;this.queueFx({},function(){B=setTimeout(function(){p(C).afterFx({})},D*1000);arguments.callee.anim={isAnimated:true,stop:function(){clearTimeout(B);p(C).afterFx({})}}});return this},fadeIn:function(D){D=x(D);var B=this,C=B.dom,E=D.endOpacity||1;B.queueFx(D,function(){p(C).setOpacity(0);p(C).fixDisplay();C.style.visibility=u;arguments.callee.anim=p(C).fxanim({opacity:{to:E}},D,y,0.5,r,function(){if(E==1){p(C).clearOpacity()}p(C).afterFx(D)})});return B},fadeOut:function(E){E=x(E);var C=this,D=C.dom,B=D.style,F=E.endOpacity||0;C.queueFx(E,function(){arguments.callee.anim=p(D).fxanim({opacity:{to:F}},E,y,0.5,r,function(){if(F==0){Ext.Element.data(D,"visibilityMode")==Ext.Element.DISPLAY||E.useDisplay?B.display="none":B.visibility=w;p(D).clearOpacity()}p(D).afterFx(E)})});return C},scale:function(B,C,D){this.shift(Ext.apply({},D,{width:B,height:C}));return this},shift:function(D){D=x(D);var C=this.dom,B={};this.queueFx(D,function(){for(var E in D){if(D[E]!=A){B[E]={to:D[E]}}}B.width?B.width.to=p(C).adjustWidth(D.width):B;B.height?B.height.to=p(C).adjustWidth(D.height):B;if(B.x||B.y||B.xy){B.points=B.xy||{to:[B.x?B.x.to:p(C).getX(),B.y?B.y.to:p(C).getY()]}}arguments.callee.anim=p(C).fxanim(B,D,e,0.35,r,function(){p(C).afterFx(D)})});return this},ghost:function(E,C){C=x(C);var G=this,D=G.dom,J=D.style,H={opacity:{to:0},points:{}},K=H.points,B,I,F;E=E||"b";G.queueFx(C,function(){B=p(D).getFxRestore();I=p(D).getWidth();F=p(D).getHeight();function L(){C.useDisplay?p(D).setDisplayed(t):p(D).hide();p(D).clearOpacity();p(D).setPositioning(B.pos);J.width=B.width;J.height=B.height;p(D).afterFx(C)}K.by=p(D).switchStatements(E.toLowerCase(),function(N,M){return[N,M]},{t:[0,-F],l:[-I,0],r:[I,0],b:[0,F],tl:[-I,-F],bl:[-I,F],br:[I,F],tr:[I,-F]});arguments.callee.anim=p(D).fxanim(H,C,e,0.5,r,L)});return G},syncFx:function(){var B=this;B.fxDefaults=Ext.apply(B.fxDefaults||{},{block:t,concurrent:k,stopFx:t});return B},sequenceFx:function(){var B=this;B.fxDefaults=Ext.apply(B.fxDefaults||{},{block:t,concurrent:t,stopFx:t});return B},nextFx:function(){var B=c(this.dom.id)[0];if(B){B.call(this)}},hasActiveFx:function(){return c(this.dom.id)[0]},stopFx:function(B){var C=this,E=C.dom.id;if(C.hasActiveFx()){var D=c(E)[0];if(D&&D.anim){if(D.anim.isAnimated){b(E,[D]);D.anim.stop(B!==undefined?B:k)}else{b(E,[])}}}return C},beforeFx:function(B){if(this.hasActiveFx()&&!B.concurrent){if(B.stopFx){this.stopFx();return k}return t}return k},hasFxBlock:function(){var B=c(this.dom.id);return B&&B[0]&&B[0].block},queueFx:function(E,B){var C=p(this.dom);if(!C.hasFxBlock()){Ext.applyIf(E,C.fxDefaults);if(!E.concurrent){var D=C.beforeFx(E);B.block=E.block;c(C.dom.id).push(B);if(D){C.nextFx()}}else{B.call(C)}}return C},fxWrap:function(H,F,D){var E=this.dom,C,B;if(!F.wrap||!(C=Ext.getDom(F.wrap))){if(F.fixPosition){B=p(E).getXY()}var G=document.createElement("div");G.style.visibility=D;C=E.parentNode.insertBefore(G,E);p(C).setPositioning(H);if(p(C).isStyle(o,"static")){p(C).position("relative")}p(E).clearPositioning("auto");p(C).clip();C.appendChild(E);if(B){p(C).setXY(B)}}return C},fxUnwrap:function(C,F,E){var D=this.dom;p(D).clearPositioning();p(D).setPositioning(F);if(!E.wrap){var B=p(C).dom.parentNode;B.insertBefore(D,C);p(C).remove()}},getFxRestore:function(){var B=this.dom.style;return{pos:this.getPositioning(),width:B.width,height:B.height}},afterFx:function(C){var B=this.dom,D=B.id;if(C.afterStyle){p(B).setStyle(C.afterStyle)}if(C.afterCls){p(B).addClass(C.afterCls)}if(C.remove==k){p(B).remove()}if(C.callback){C.callback.call(C.scope,p(B))}if(!C.concurrent){c(D).shift();p(B).nextFx()}},fxanim:function(E,F,C,G,D,B){C=C||"run";F=F||{};var H=Ext.lib.Anim[C](this.dom,E,(F.duration||G)||0.35,(F.easing||D)||r,B,this);F.anim=H;return H}};Ext.Fx.resize=Ext.Fx.scale;Ext.Element.addMethods(Ext.Fx)})();Ext.CompositeElementLite=function(b,a){this.elements=[];this.add(b,a);this.el=new Ext.Element.Flyweight()};Ext.CompositeElementLite.prototype={isComposite:true,getElement:function(a){var b=this.el;b.dom=a;b.id=a.id;return b},transformElement:function(a){return Ext.getDom(a)},getCount:function(){return this.elements.length},add:function(d,b){var e=this,g=e.elements;if(!d){return this}if(Ext.isString(d)){d=Ext.Element.selectorFunction(d,b)}else{if(d.isComposite){d=d.elements}else{if(!Ext.isIterable(d)){d=[d]}}}for(var c=0,a=d.length;c-1){c=Ext.getDom(c);if(a){g=this.elements[b];g.parentNode.insertBefore(c,g);Ext.removeNode(g)}this.elements.splice(b,1,c)}return this},clear:function(){this.elements=[]}};Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener;(function(){var c,b=Ext.Element.prototype,a=Ext.CompositeElementLite.prototype;for(c in b){if(Ext.isFunction(b[c])){(function(d){a[d]=a[d]||function(){return this.invoke(d,arguments)}}).call(a,c)}}})();if(Ext.DomQuery){Ext.Element.selectorFunction=Ext.DomQuery.select}Ext.Element.select=function(a,b){var c;if(typeof a=="string"){c=Ext.Element.selectorFunction(a,b)}else{if(a.length!==undefined){c=a}else{throw"Invalid selector"}}return new Ext.CompositeElementLite(c)};Ext.select=Ext.Element.select;Ext.apply(Ext.CompositeElementLite.prototype,{addElements:function(c,a){if(!c){return this}if(typeof c=="string"){c=Ext.Element.selectorFunction(c,a)}var b=this.elements;Ext.each(c,function(d){b.push(Ext.get(d))});return this},first:function(){return this.item(0)},last:function(){return this.item(this.getCount()-1)},contains:function(a){return this.indexOf(a)!=-1},removeElement:function(d,e){var c=this,a=this.elements,b;Ext.each(d,function(g){if((b=(a[g]||a[g=c.indexOf(g)]))){if(e){if(b.dom){b.remove()}else{Ext.removeNode(b)}}a.splice(g,1)}});return this}});Ext.CompositeElement=function(b,a){this.elements=[];this.add(b,a)};Ext.extend(Ext.CompositeElement,Ext.CompositeElementLite,{getElement:function(a){return a},transformElement:function(a){return Ext.get(a)}});Ext.Element.select=function(a,d,b){var c;if(typeof a=="string"){c=Ext.Element.selectorFunction(a,b)}else{if(a.length!==undefined){c=a}else{throw"Invalid selector"}}return(d===true)?new Ext.CompositeElement(c):new Ext.CompositeElementLite(c)};Ext.select=Ext.Element.select;(function(){var b="beforerequest",e="requestcomplete",d="requestexception",h=undefined,c="load",i="POST",a="GET",g=window;Ext.data.Connection=function(j){Ext.apply(this,j);this.addEvents(b,e,d);Ext.data.Connection.superclass.constructor.call(this)};Ext.extend(Ext.data.Connection,Ext.util.Observable,{timeout:30000,autoAbort:false,disableCaching:true,disableCachingParam:"_dc",request:function(n){var s=this;if(s.fireEvent(b,s,n)){if(n.el){if(!Ext.isEmpty(n.indicatorText)){s.indicatorText='
    '+n.indicatorText+"
    "}if(s.indicatorText){Ext.getDom(n.el).innerHTML=s.indicatorText}n.success=(Ext.isFunction(n.success)?n.success:function(){}).createInterceptor(function(o){Ext.getDom(n.el).innerHTML=o.responseText})}var l=n.params,k=n.url||s.url,j,q={success:s.handleResponse,failure:s.handleFailure,scope:s,argument:{options:n},timeout:n.timeout||s.timeout},m,t;if(Ext.isFunction(l)){l=l.call(n.scope||g,n)}l=Ext.urlEncode(s.extraParams,Ext.isObject(l)?Ext.urlEncode(l):l);if(Ext.isFunction(k)){k=k.call(n.scope||g,n)}if((m=Ext.getDom(n.form))){k=k||m.action;if(n.isUpload||/multipart\/form-data/i.test(m.getAttribute("enctype"))){return s.doFormUpload.call(s,n,l,k)}t=Ext.lib.Ajax.serializeForm(m);l=l?(l+"&"+t):t}j=n.method||s.method||((l||n.xmlData||n.jsonData)?i:a);if(j===a&&(s.disableCaching&&n.disableCaching!==false)||n.disableCaching===true){var r=n.disableCachingParam||s.disableCachingParam;k=Ext.urlAppend(k,r+"="+(new Date().getTime()))}n.headers=Ext.apply(n.headers||{},s.defaultHeaders||{});if(n.autoAbort===true||s.autoAbort){s.abort()}if((j==a||n.xmlData||n.jsonData)&&l){k=Ext.urlAppend(k,l);l=""}return(s.transId=Ext.lib.Ajax.request(j,k,q,l,n))}else{return n.callback?n.callback.apply(n.scope,[n,h,h]):null}},isLoading:function(j){return j?Ext.lib.Ajax.isCallInProgress(j):!!this.transId},abort:function(j){if(j||this.isLoading()){Ext.lib.Ajax.abort(j||this.transId)}},handleResponse:function(j){this.transId=false;var k=j.argument.options;j.argument=k?k.argument:null;this.fireEvent(e,this,j,k);if(k.success){k.success.call(k.scope,j,k)}if(k.callback){k.callback.call(k.scope,k,true,j)}},handleFailure:function(j,l){this.transId=false;var k=j.argument.options;j.argument=k?k.argument:null;this.fireEvent(d,this,j,k,l);if(k.failure){k.failure.call(k.scope,j,k)}if(k.callback){k.callback.call(k.scope,k,false,j)}},doFormUpload:function(q,j,k){var l=Ext.id(),v=document,r=v.createElement("iframe"),m=Ext.getDom(q.form),u=[],t,p="multipart/form-data",n={target:m.target,method:m.method,encoding:m.encoding,enctype:m.enctype,action:m.action};Ext.fly(r).set({id:l,name:l,cls:"x-hidden"});v.body.appendChild(r);Ext.fly(r).set({src:Ext.SSL_SECURE_URL});if(Ext.isIE){document.frames[l].name=l}Ext.fly(m).set({target:l,method:i,enctype:p,encoding:p,action:k||n.action});Ext.iterate(Ext.urlDecode(j,false),function(w,o){t=v.createElement("input");Ext.fly(t).set({type:"hidden",value:o,name:w});m.appendChild(t);u.push(t)});function s(){var x=this,w={responseText:"",responseXML:null,argument:q.argument},A,z;try{A=r.contentWindow.document||r.contentDocument||g.frames[l].document;if(A){if(A.body){if(/textarea/i.test((z=A.body.firstChild||{}).tagName)){w.responseText=z.value}else{w.responseText=A.body.innerHTML}}w.responseXML=A.XMLDocument||A}}catch(y){}Ext.EventManager.removeListener(r,c,s,x);x.fireEvent(e,x,w,q);function o(D,C,B){if(Ext.isFunction(D)){D.apply(C,B)}}o(q.success,q.scope,[w,q]);o(q.callback,q.scope,[q,true,w]);if(!x.debugUploads){setTimeout(function(){Ext.removeNode(r)},100)}}Ext.EventManager.on(r,c,s,this);m.submit();Ext.fly(m).set(n);Ext.each(u,function(o){Ext.removeNode(o)})}})})();Ext.Ajax=new Ext.data.Connection({autoAbort:false,serializeForm:function(a){return Ext.lib.Ajax.serializeForm(a)}});Ext.UpdateManager=Ext.Updater=Ext.extend(Ext.util.Observable,function(){var b="beforeupdate",d="update",c="failure";function a(h){var i=this;i.transaction=null;if(h.argument.form&&h.argument.reset){try{h.argument.form.reset()}catch(j){}}if(i.loadScripts){i.renderer.render(i.el,h,i,g.createDelegate(i,[h]))}else{i.renderer.render(i.el,h,i);g.call(i,h)}}function g(h,i,j){this.fireEvent(i||d,this.el,h);if(Ext.isFunction(h.argument.callback)){h.argument.callback.call(h.argument.scope,this.el,Ext.isEmpty(j)?true:false,h,h.argument.options)}}function e(h){g.call(this,h,c,!!(this.transaction=null))}return{constructor:function(i,h){var j=this;i=Ext.get(i);if(!h&&i.updateManager){return i.updateManager}j.el=i;j.defaultUrl=null;j.addEvents(b,d,c);Ext.apply(j,Ext.Updater.defaults);j.transaction=null;j.refreshDelegate=j.refresh.createDelegate(j);j.updateDelegate=j.update.createDelegate(j);j.formUpdateDelegate=(j.formUpdate||function(){}).createDelegate(j);j.renderer=j.renderer||j.getDefaultRenderer();Ext.Updater.superclass.constructor.call(j)},setRenderer:function(h){this.renderer=h},getRenderer:function(){return this.renderer},getDefaultRenderer:function(){return new Ext.Updater.BasicRenderer()},setDefaultUrl:function(h){this.defaultUrl=h},getEl:function(){return this.el},update:function(i,n,p,l){var k=this,h,j;if(k.fireEvent(b,k.el,i,n)!==false){if(Ext.isObject(i)){h=i;i=h.url;n=n||h.params;p=p||h.callback;l=l||h.discardUrl;j=h.scope;if(!Ext.isEmpty(h.nocache)){k.disableCaching=h.nocache}if(!Ext.isEmpty(h.text)){k.indicatorText='
    '+h.text+"
    "}if(!Ext.isEmpty(h.scripts)){k.loadScripts=h.scripts}if(!Ext.isEmpty(h.timeout)){k.timeout=h.timeout}}k.showLoading();if(!l){k.defaultUrl=i}if(Ext.isFunction(i)){i=i.call(k)}var m=Ext.apply({},{url:i,params:(Ext.isFunction(n)&&j)?n.createDelegate(j):n,success:a,failure:e,scope:k,callback:undefined,timeout:(k.timeout*1000),disableCaching:k.disableCaching,argument:{options:h,url:i,form:null,callback:p,scope:j||window,params:n}},h);k.transaction=Ext.Ajax.request(m)}},formUpdate:function(k,h,j,l){var i=this;if(i.fireEvent(b,i.el,k,h)!==false){if(Ext.isFunction(h)){h=h.call(i)}k=Ext.getDom(k);i.transaction=Ext.Ajax.request({form:k,url:h,success:a,failure:e,scope:i,timeout:(i.timeout*1000),argument:{url:h,form:k,callback:l,reset:j}});i.showLoading.defer(1,i)}},startAutoRefresh:function(i,j,l,m,h){var k=this;if(h){k.update(j||k.defaultUrl,l,m,true)}if(k.autoRefreshProcId){clearInterval(k.autoRefreshProcId)}k.autoRefreshProcId=setInterval(k.update.createDelegate(k,[j||k.defaultUrl,l,m,true]),i*1000)},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);delete this.autoRefreshProcId}},isAutoRefreshing:function(){return !!this.autoRefreshProcId},showLoading:function(){if(this.showLoadIndicator){this.el.dom.innerHTML=this.indicatorText}},abort:function(){if(this.transaction){Ext.Ajax.abort(this.transaction)}},isUpdating:function(){return this.transaction?Ext.Ajax.isLoading(this.transaction):false},refresh:function(h){if(this.defaultUrl){this.update(this.defaultUrl,null,h,true)}}}}());Ext.Updater.defaults={timeout:30,disableCaching:false,showLoadIndicator:true,indicatorText:'
    Loading...
    ',loadScripts:false,sslBlankUrl:Ext.SSL_SECURE_URL};Ext.Updater.updateElement=function(d,c,e,b){var a=Ext.get(d).getUpdater();Ext.apply(a,b);a.update(c,e,b?b.callback:null)};Ext.Updater.BasicRenderer=function(){};Ext.Updater.BasicRenderer.prototype={render:function(c,a,b,d){c.update(a.responseText,b.loadScripts,d)}};(function(){Date.useStrict=false;function b(d){var c=Array.prototype.slice.call(arguments,1);return d.replace(/\{(\d+)\}/g,function(e,g){return c[g]})}Date.formatCodeToRegex=function(d,c){var e=Date.parseCodes[d];if(e){e=typeof e=="function"?e():e;Date.parseCodes[d]=e}return e?Ext.applyIf({c:e.c?b(e.c,c||"{0}"):e.c},e):{g:0,c:null,s:Ext.escapeRe(d)}};var a=Date.formatCodeToRegex;Ext.apply(Date,{parseFunctions:{"M$":function(d,c){var e=new RegExp("\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/");var g=(d||"").match(e);return g?new Date(((g[1]||"")+g[2])*1):null}},parseRegexes:[],formatFunctions:{"M$":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},getShortMonthName:function(c){return Date.monthNames[c].substring(0,3)},getShortDayName:function(c){return Date.dayNames[c].substring(0,3)},getMonthNumber:function(c){return Date.monthNumbers[c.substring(0,1).toUpperCase()+c.substring(1,3).toLowerCase()]},formatCodes:{d:"String.leftPad(this.getDate(), 2, '0')",D:"Date.getShortDayName(this.getDay())",j:"this.getDate()",l:"Date.dayNames[this.getDay()]",N:"(this.getDay() ? this.getDay() : 7)",S:"this.getSuffix()",w:"this.getDay()",z:"this.getDayOfYear()",W:"String.leftPad(this.getWeekOfYear(), 2, '0')",F:"Date.monthNames[this.getMonth()]",m:"String.leftPad(this.getMonth() + 1, 2, '0')",M:"Date.getShortMonthName(this.getMonth())",n:"(this.getMonth() + 1)",t:"this.getDaysInMonth()",L:"(this.isLeapYear() ? 1 : 0)",o:"(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))",Y:"this.getFullYear()",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:"String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",H:"String.leftPad(this.getHours(), 2, '0')",i:"String.leftPad(this.getMinutes(), 2, '0')",s:"String.leftPad(this.getSeconds(), 2, '0')",u:"String.leftPad(this.getMilliseconds(), 3, '0')",O:"this.getGMTOffset()",P:"this.getGMTOffset(true)",T:"this.getTimezone()",Z:"(this.getTimezoneOffset() * -60)",c:function(){for(var k="Y-m-dTH:i:sP",h=[],g=0,d=k.length;g= 0 && y >= 0){","v = new Date(y, 0, 1, h, i, s, ms);","v = !strict? v : (strict === true && (z <= 364 || (v.isLeapYear() && z <= 365))? v.add(Date.DAY, z) : null);","}else if(strict === true && !Date.isValid(y, m + 1, d, h, i, s, ms)){","v = null;","}else{","v = new Date(y, m, d, h, i, s, ms);","}","}","}","if(v){","if(zz != null){","v = v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - zz);","}else if(o){","v = v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));","}","}","return v;"].join("\n");return function(m){var e=Date.parseRegexes.length,n=1,g=[],l=[],k=false,d="";for(var j=0;j Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"},a:{g:1,c:"if (results[{0}] == 'am') {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(am|pm)"},A:{g:1,c:"if (results[{0}] == 'AM') {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(AM|PM)"},g:function(){return a("G")},G:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},h:function(){return a("H")},H:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},i:{g:1,c:"i = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},s:{g:1,c:"s = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},u:{g:1,c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",s:"(\\d+)"},O:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),","mn = o.substring(3,5) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{4})"},P:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),","mn = o.substring(4,6) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{2}:\\d{2})"},T:{g:0,c:null,s:"[A-Z]{1,4}"},Z:{g:1,c:"zz = results[{0}] * 1;\nzz = (-43200 <= zz && zz <= 50400)? zz : null;\n",s:"([+-]?\\d{1,5})"},c:function(){var e=[],c=[a("Y",1),a("m",2),a("d",3),a("h",4),a("i",5),a("s",6),{c:"ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"},{c:["if(results[8]) {","if(results[8] == 'Z'){","zz = 0;","}else if (results[8].indexOf(':') > -1){",a("P",8).c,"}else{",a("O",8).c,"}","}"].join("\n")}];for(var g=0,d=c.length;g0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+(a?":":"")+String.leftPad(Math.abs(this.getTimezoneOffset()%60),2,"0")},getDayOfYear:function(){var b=0,e=this.clone(),a=this.getMonth(),c;for(c=0,e.setDate(1),e.setMonth(0);c28){a=Math.min(a,this.getFirstDateOfMonth().add("mo",c).getLastDateOfMonth().getDate())}e.setDate(a);e.setMonth(this.getMonth()+c);break;case Date.YEAR:e.setFullYear(this.getFullYear()+c);break}return e},between:function(c,a){var b=this.getTime();return c.getTime()<=b&&b<=a.getTime()}});Date.prototype.format=Date.prototype.dateFormat;if(Ext.isSafari&&(navigator.userAgent.match(/WebKit\/(\d+)/)[1]||NaN)<420){Ext.apply(Date.prototype,{_xMonth:Date.prototype.setMonth,_xDate:Date.prototype.setDate,setMonth:function(a){if(a<=-1){var d=Math.ceil(-a),c=Math.ceil(d/12),b=(d%12)?12-d%12:0;this.setFullYear(this.getFullYear()-c);return this._xMonth(b)}else{return this._xMonth(a)}},setDate:function(a){return this.setTime(this.getTime()-(this.getDate()-a)*86400000)}})}Ext.util.MixedCollection=function(b,a){this.items=[];this.map={};this.keys=[];this.length=0;this.addEvents("clear","add","replace","remove","sort");this.allowFunctions=b===true;if(a){this.getKey=a}Ext.util.MixedCollection.superclass.constructor.call(this)};Ext.extend(Ext.util.MixedCollection,Ext.util.Observable,{allowFunctions:false,add:function(b,c){if(arguments.length==1){c=arguments[0];b=this.getKey(c)}if(typeof b!="undefined"&&b!==null){var a=this.map[b];if(typeof a!="undefined"){return this.replace(b,c)}this.map[b]=c}this.length++;this.items.push(c);this.keys.push(b);this.fireEvent("add",this.length-1,c,b);return c},getKey:function(a){return a.id},replace:function(c,d){if(arguments.length==1){d=arguments[0];c=this.getKey(d)}var a=this.map[c];if(typeof c=="undefined"||c===null||typeof a=="undefined"){return this.add(c,d)}var b=this.indexOfKey(c);this.items[b]=d;this.map[c]=d;this.fireEvent("replace",c,a,d);return d},addAll:function(e){if(arguments.length>1||Ext.isArray(e)){var b=arguments.length>1?arguments:e;for(var d=0,a=b.length;d=this.length){return this.add(b,c)}this.length++;this.items.splice(a,0,c);if(typeof b!="undefined"&&b!==null){this.map[b]=c}this.keys.splice(a,0,b);this.fireEvent("add",a,c,b);return c},remove:function(a){return this.removeAt(this.indexOf(a))},removeAt:function(a){if(a=0){this.length--;var c=this.items[a];this.items.splice(a,1);var b=this.keys[a];if(typeof b!="undefined"){delete this.map[b]}this.keys.splice(a,1);this.fireEvent("remove",c,b);return c}return false},removeKey:function(a){return this.removeAt(this.indexOfKey(a))},getCount:function(){return this.length},indexOf:function(a){return this.items.indexOf(a)},indexOfKey:function(a){return this.keys.indexOf(a)},item:function(b){var a=this.map[b],c=a!==undefined?a:(typeof b=="number")?this.items[b]:undefined;return !Ext.isFunction(c)||this.allowFunctions?c:null},itemAt:function(a){return this.items[a]},key:function(a){return this.map[a]},contains:function(a){return this.indexOf(a)!=-1},containsKey:function(a){return typeof this.map[a]!="undefined"},clear:function(){this.length=0;this.items=[];this.keys=[];this.map={};this.fireEvent("clear")},first:function(){return this.items[0]},last:function(){return this.items[this.length-1]},_sort:function(k,a,j){var d,e,b=String(a).toUpperCase()=="DESC"?-1:1,h=[],l=this.keys,g=this.items;j=j||function(i,c){return i-c};for(d=0,e=g.length;de?1:(g=a;c--){d[d.length]=b[c]}}return d},filter:function(c,b,d,a){if(Ext.isEmpty(b,false)){return this.clone()}b=this.createValueMatcher(b,d,a);return this.filterBy(function(e){return e&&b.test(e[c])})},filterBy:function(g,e){var h=new Ext.util.MixedCollection();h.getKey=this.getKey;var b=this.keys,d=this.items;for(var c=0,a=d.length;c]+>/gi,stripScriptsRe=/(?:)((\n|\r|.)*?)(?:<\/script>)/ig,nl2brRe=/\r?\n/g;return{ellipsis:function(value,len,word){if(value&&value.length>len){if(word){var vs=value.substr(0,len-2),index=Math.max(vs.lastIndexOf(" "),vs.lastIndexOf("."),vs.lastIndexOf("!"),vs.lastIndexOf("?"));if(index==-1||index<(len-15)){return value.substr(0,len-3)+"..."}else{return vs.substr(0,index)+"..."}}else{return value.substr(0,len-3)+"..."}}return value},undef:function(value){return value!==undefined?value:""},defaultValue:function(value,defaultValue){return value!==undefined&&value!==""?value:defaultValue},htmlEncode:function(value){return !value?value:String(value).replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&")},trim:function(value){return String(value).replace(trimRe,"")},substr:function(value,start,length){return String(value).substr(start,length)},lowercase:function(value){return String(value).toLowerCase()},uppercase:function(value){return String(value).toUpperCase()},capitalize:function(value){return !value?value:value.charAt(0).toUpperCase()+value.substr(1).toLowerCase()},call:function(value,fn){if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);args.unshift(value);return eval(fn).apply(window,args)}else{return eval(fn).call(window,value)}},usMoney:function(v){v=(Math.round((v-0)*100))/100;v=(v==Math.floor(v))?v+".00":((v*10==Math.floor(v*10))?v+"0":v);v=String(v);var ps=v.split("."),whole=ps[0],sub=ps[1]?"."+ps[1]:".00",r=/(\d+)(\d{3})/;while(r.test(whole)){whole=whole.replace(r,"$1,$2")}v=whole+sub;if(v.charAt(0)=="-"){return"-$"+v.substr(1)}return"$"+v},date:function(v,format){if(!v){return""}if(!Ext.isDate(v)){v=new Date(Date.parse(v))}return v.dateFormat(format||"m/d/Y")},dateRenderer:function(format){return function(v){return Ext.util.Format.date(v,format)}},stripTags:function(v){return !v?v:String(v).replace(stripTagsRE,"")},stripScripts:function(v){return !v?v:String(v).replace(stripScriptsRe,"")},fileSize:function(size){if(size<1024){return size+" bytes"}else{if(size<1048576){return(Math.round(((size*10)/1024))/10)+" KB"}else{return(Math.round(((size*10)/1048576))/10)+" MB"}}},math:function(){var fns={};return function(v,a){if(!fns[a]){fns[a]=new Function("v","return v "+a+";")}return fns[a](v)}}(),round:function(value,precision){var result=Number(value);if(typeof precision=="number"){precision=Math.pow(10,precision);result=Math.round(value*precision)/precision}return result},number:function(v,format){if(!format){return v}v=Ext.num(v,NaN);if(isNaN(v)){return""}var comma=",",dec=".",i18n=false,neg=v<0;v=Math.abs(v);if(format.substr(format.length-2)=="/i"){format=format.substr(0,format.length-2);i18n=true;comma=".";dec=","}var hasComma=format.indexOf(comma)!=-1,psplit=(i18n?format.replace(/[^\d\,]/g,""):format.replace(/[^\d\.]/g,"")).split(dec);if(1")}}}();Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var w=this,i=w.html,p=/]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,d=/^]*?for="(.*?)"/,t=/^]*?if="(.*?)"/,v=/^]*?exec="(.*?)"/,q,o=0,j=[],n="values",u="parent",k="xindex",l="xcount",e="return ",c="with(values){ ";i=["",i,""].join("");while((q=i.match(p))){var b=q[0].match(d),a=q[0].match(t),y=q[0].match(v),g=null,h=null,r=null,x=b&&b[1]?b[1]:"";if(a){g=a&&a[1]?a[1]:null;if(g){h=new Function(n,u,k,l,c+e+(Ext.util.Format.htmlDecode(g))+"; }")}}if(y){g=y&&y[1]?y[1]:null;if(g){r=new Function(n,u,k,l,c+(Ext.util.Format.htmlDecode(g))+"; }")}}if(x){switch(x){case".":x=new Function(n,u,c+e+n+"; }");break;case"..":x=new Function(n,u,c+e+u+"; }");break;default:x=new Function(n,u,c+e+x+"; }")}}j.push({id:o,target:x,exec:r,test:h,body:q[1]||""});i=i.replace(q[0],"{xtpl"+o+"}");++o}Ext.each(j,function(m){w.compileTpl(m)});w.master=j[j.length-1];w.tpls=j};Ext.extend(Ext.XTemplate,Ext.Template,{re:/\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,codeRe:/\{\[((?:\\\]|.|\n)*?)\]\}/g,applySubTemplate:function(a,i,h,d,c){var g=this,e,k=g.tpls[a],j,b=[];if((k.test&&!k.test.call(g,i,h,d,c))||(k.exec&&k.exec.call(g,i,h,d,c))){return""}j=k.target?k.target.call(g,i,h):i;e=j.length;h=k.target?i:h;if(k.target&&Ext.isArray(j)){Ext.each(j,function(l,m){b[b.length]=k.compiled.call(g,l,h,m+1,e)});return b.join("")}return k.compiled.call(g,j,h,d,c)},compileTpl:function(tpl){var fm=Ext.util.Format,useF=this.disableFormats!==true,sep=Ext.isGecko?"+":",",body;function fn(m,name,format,args,math){if(name.substr(0,4)=="xtpl"){return"'"+sep+"this.applySubTemplate("+name.substr(4)+", values, parent, xindex, xcount)"+sep+"'"}var v;if(name==="."){v="values"}else{if(name==="#"){v="xindex"}else{if(name.indexOf(".")!=-1){v=name}else{v="values['"+name+"']"}}}if(math){v="("+v+math+")"}if(format&&useF){args=args?","+args:"";if(format.substr(0,5)!="this."){format="fm."+format+"("}else{format='this.call("'+format.substr(5)+'", ';args=", values"}}else{args="";format="("+v+" === undefined ? '' : "}return"'"+sep+format+v+args+")"+sep+"'"}function codeFn(m,code){return"'"+sep+"("+code.replace(/\\'/g,"'")+")"+sep+"'"}if(Ext.isGecko){body="tpl.compiled = function(values, parent, xindex, xcount){ return '"+tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn)+"';};"}else{body=["tpl.compiled = function(values, parent, xindex, xcount){ return ['"];body.push(tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn));body.push("'].join('');};");body=body.join("")}eval(body);return this},applyTemplate:function(a){return this.master.compiled.call(this,a,{},1,1)},compile:function(){return this}});Ext.XTemplate.prototype.apply=Ext.XTemplate.prototype.applyTemplate;Ext.XTemplate.from=function(a){a=Ext.getDom(a);return new Ext.XTemplate(a.value||a.innerHTML)};Ext.util.CSS=function(){var d=null;var c=document;var b=/(-[a-z])/gi;var a=function(e,g){return g.charAt(1).toUpperCase()};return{createStyleSheet:function(i,l){var h;var g=c.getElementsByTagName("head")[0];var k=c.createElement("style");k.setAttribute("type","text/css");if(l){k.setAttribute("id",l)}if(Ext.isIE){g.appendChild(k);h=k.styleSheet;h.cssText=i}else{try{k.appendChild(c.createTextNode(i))}catch(j){k.cssText=i}g.appendChild(k);h=k.styleSheet?k.styleSheet:(k.sheet||c.styleSheets[c.styleSheets.length-1])}this.cacheStyleSheet(h);return h},removeStyleSheet:function(g){var e=c.getElementById(g);if(e){e.parentNode.removeChild(e)}},swapStyleSheet:function(h,e){this.removeStyleSheet(h);var g=c.createElement("link");g.setAttribute("rel","stylesheet");g.setAttribute("type","text/css");g.setAttribute("id",h);g.setAttribute("href",e);c.getElementsByTagName("head")[0].appendChild(g)},refreshCache:function(){return this.getRules(true)},cacheStyleSheet:function(h){if(!d){d={}}try{var k=h.cssRules||h.rules;for(var g=k.length-1;g>=0;--g){d[k[g].selectorText.toLowerCase()]=k[g]}}catch(i){}},getRules:function(h){if(d===null||h){d={};var k=c.styleSheets;for(var j=0,g=k.length;j=37&&a<=40){b.stopEvent()}},destroy:function(){this.disable()},enable:function(){if(this.disabled){if(Ext.isSafari2){this.el.on("keyup",this.stopKeyUp,this)}this.el.on(this.isKeydown()?"keydown":"keypress",this.relay,this);this.disabled=false}},disable:function(){if(!this.disabled){if(Ext.isSafari2){this.el.un("keyup",this.stopKeyUp,this)}this.el.un(this.isKeydown()?"keydown":"keypress",this.relay,this);this.disabled=true}},setDisabled:function(a){this[a?"disable":"enable"]()},isKeydown:function(){return this.forceKeyDown||Ext.EventManager.useKeydown}};Ext.KeyMap=function(c,b,a){this.el=Ext.get(c);this.eventName=a||"keydown";this.bindings=[];if(b){this.addBinding(b)}this.enable()};Ext.KeyMap.prototype={stopEvent:false,addBinding:function(b){if(Ext.isArray(b)){Ext.each(b,function(j){this.addBinding(j)},this);return}var k=b.key,g=b.fn||b.handler,l=b.scope;if(b.stopEvent){this.stopEvent=b.stopEvent}if(typeof k=="string"){var h=[];var e=k.toUpperCase();for(var c=0,d=e.length;c2)?a[2]:null;var h=(i>3)?a[3]:"/";var d=(i>4)?a[4]:null;var g=(i>5)?a[5]:false;document.cookie=c+"="+escape(e)+((b===null)?"":("; expires="+b.toGMTString()))+((h===null)?"":("; path="+h))+((d===null)?"":("; domain="+d))+((g===true)?"; secure":"")},get:function(d){var b=d+"=";var g=b.length;var a=document.cookie.length;var e=0;var c=0;while(e",i="",b=a+"",j=""+i,l=b+"",v=""+j;function h(A,C,B,D,z,x){var y=r.insertHtml(D,Ext.getDom(A),t(C));return B?Ext.get(y,true):y}function t(D){var z="",y,C,B,x,E;if(typeof D=="string"){z=D}else{if(Ext.isArray(D)){for(var A=0;A"}}}return z}function g(E,B,A,C){w.innerHTML=[B,A,C].join("");var x=-1,z=w,y;while(++x "'+C+'"'},insertBefore:function(x,z,y){return h(x,z,y,c)},insertAfter:function(x,z,y){return h(x,z,y,p,"nextSibling")},insertFirst:function(x,z,y){return h(x,z,y,n,"firstChild")},append:function(x,z,y){return h(x,z,y,q,"",true)},overwrite:function(x,z,y){x=Ext.getDom(x);x.innerHTML=t(z);return y?Ext.get(x.firstChild):x.firstChild},createHtml:t};return r}();Ext.apply(Ext.DomHelper,function(){var e,a="afterbegin",h="afterend",i="beforebegin",d="beforeend",b=/tag|children|cn|html$/i;function g(m,p,n,q,l,j){m=Ext.getDom(m);var k;if(e.useDom){k=c(p,null);if(j){m.appendChild(k)}else{(l=="firstChild"?m:m.parentNode).insertBefore(k,m[l]||m)}}else{k=Ext.DomHelper.insertHtml(q,m,Ext.DomHelper.createHtml(p))}return n?Ext.get(k,true):k}function c(j,r){var k,u=document,p,s,m,t;if(Ext.isArray(j)){k=u.createDocumentFragment();for(var q=0,n=j.length;q1){for(var g=0,b=c.length;g+~]\s?|\s|$)/,tagTokenRe=/^(#)?([\w-\*]+)/,nthRe=/(\d*)n\+?(\d*)/,nthRe2=/\D/,isIE=window.ActiveXObject?true:false,key=30803;eval("var batch = 30803;");function child(parent,index){var i=0,n=parent.firstChild;while(n){if(n.nodeType==1){if(++i==index){return n}}n=n.nextSibling}return null}function next(n){while((n=n.nextSibling)&&n.nodeType!=1){}return n}function prev(n){while((n=n.previousSibling)&&n.nodeType!=1){}return n}function children(parent){var n=parent.firstChild,nodeIndex=-1,nextNode;while(n){nextNode=n.nextSibling;if(n.nodeType==3&&!nonSpace.test(n.nodeValue)){parent.removeChild(n)}else{n.nodeIndex=++nodeIndex}n=nextNode}return this}function byClassName(nodeSet,cls){if(!cls){return nodeSet}var result=[],ri=-1;for(var i=0,ci;ci=nodeSet[i];i++){if((" "+ci.className+" ").indexOf(cls)!=-1){result[++ri]=ci}}return result}function attrValue(n,attr){if(!n.tagName&&typeof n.length!="undefined"){n=n[0]}if(!n){return null}if(attr=="for"){return n.htmlFor}if(attr=="class"||attr=="className"){return n.className}return n.getAttribute(attr)||n[attr]}function getNodes(ns,mode,tagName){var result=[],ri=-1,cs;if(!ns){return result}tagName=tagName||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns]}if(!mode){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(tagName);for(var j=0,ci;ci=cs[j];j++){result[++ri]=ci}}}else{if(mode=="/"||mode==">"){var utag=tagName.toUpperCase();for(var i=0,ni,cn;ni=ns[i];i++){cn=ni.childNodes;for(var j=0,cj;cj=cn[j];j++){if(cj.nodeName==utag||cj.nodeName==tagName||tagName=="*"){result[++ri]=cj}}}}else{if(mode=="+"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(n&&(n.nodeName==utag||n.nodeName==tagName||tagName=="*")){result[++ri]=n}}}else{if(mode=="~"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)){if(n.nodeName==utag||n.nodeName==tagName||tagName=="*"){result[++ri]=n}}}}}}}return result}function concat(a,b){if(b.slice){return a.concat(b)}for(var i=0,l=b.length;i1){return nodup(results)}return results},isXml:function(el){var docEl=(el?el.ownerDocument||el:0).documentElement;return docEl?docEl.nodeName!=="HTML":false},select:document.querySelectorAll?function(path,root,type){root=root||document;if(!Ext.DomQuery.isXml(root)){try{var cs=root.querySelectorAll(path);return Ext.toArray(cs)}catch(ex){}}return Ext.DomQuery.jsSelect.call(this,path,root,type)}:function(path,root,type){return Ext.DomQuery.jsSelect.call(this,path,root,type)},selectNode:function(path,root){return Ext.DomQuery.select(path,root)[0]},selectValue:function(path,root,defaultValue){path=path.replace(trimRe,"");if(!valueCache[path]){valueCache[path]=Ext.DomQuery.compile(path,"select")}var n=valueCache[path](root),v;n=n[0]?n[0]:n;if(typeof n.normalize=="function"){n.normalize()}v=(n&&n.firstChild?n.firstChild.nodeValue:null);return((v===null||v===undefined||v==="")?defaultValue:v)},selectNumber:function(path,root,defaultValue){var v=Ext.DomQuery.selectValue(path,root,defaultValue||0);return parseFloat(v)},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el)}var isArray=Ext.isArray(el),result=Ext.DomQuery.filter(isArray?el:[el],ss);return isArray?(result.length==el.length):(result.length>0)},filter:function(els,ss,nonMatches){ss=ss.replace(trimRe,"");if(!simpleCache[ss]){simpleCache[ss]=Ext.DomQuery.compile(ss,"simple")}var result=simpleCache[ss](els);return nonMatches?quickDiff(result,els):result},matchers:[{re:/^\.([\w-]+)/,select:'n = byClassName(n, " {1} ");'},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'},{re:/^#([\w-]+)/,select:'n = byId(n, "{1}");'},{re:/^@([\w-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,v){return a==v},"!=":function(a,v){return a!=v},"^=":function(a,v){return a&&a.substr(0,v.length)==v},"$=":function(a,v){return a&&a.substr(a.length-v.length)==v},"*=":function(a,v){return a&&a.indexOf(v)!==-1},"%=":function(a,v){return(a%v)==0},"|=":function(a,v){return a&&(a==v||a.substr(0,v.length+1)==v+"-")},"~=":function(a,v){return a&&(" "+a+" ").indexOf(" "+v+" ")!=-1}},pseudos:{"first-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"last-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"nth-child":function(c,a){var r=[],ri=-1,m=nthRe.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!nthRe2.test(a)&&"n+"+a||a),f=(m[1]||1)-0,l=m[2]-0;for(var i=0,n;n=c[i];i++){var pn=n.parentNode;if(batch!=pn._batch){var j=0;for(var cn=pn.firstChild;cn;cn=cn.nextSibling){if(cn.nodeType==1){cn.nodeIndex=++j}}pn._batch=batch}if(f==1){if(l==0||n.nodeIndex==l){r[++ri]=n}}else{if((n.nodeIndex+l)%f==0){r[++ri]=n}}}return r},"only-child":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(!prev(ci)&&!next(ci)){r[++ri]=ci}}return r},empty:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,empty=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){empty=false;break}}if(empty){r[++ri]=ci}}return r},contains:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if((ci.textContent||ci.innerText||"").indexOf(v)!=-1){r[++ri]=ci}}return r},nodeValue:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[++ri]=ci}}return r},checked:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[++ri]=ci}}return r},not:function(c,ss){return Ext.DomQuery.filter(c,ss,true)},any:function(c,selectors){var ss=selectors.split("|"),r=[],ri=-1,s;for(var i=0,ci;ci=c[i];i++){for(var j=0;s=ss[j];j++){if(Ext.DomQuery.is(ci,s)){r[++ri]=ci;break}}}return r},odd:function(c){return this["nth-child"](c,"odd")},even:function(c){return this["nth-child"](c,"even")},nth:function(c,a){return c[a-1]||[]},first:function(c){return c[0]||[]},last:function(c){return c[c.length-1]||[]},has:function(c,ss){var s=Ext.DomQuery.select,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[++ri]=ci}}return r},next:function(c,ss){var is=Ext.DomQuery.is,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=next(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r},prev:function(c,ss){var is=Ext.DomQuery.is,r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=prev(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r}}}}();Ext.query=Ext.DomQuery.select;Ext.util.DelayedTask=function(d,c,a){var e=this,g,b=function(){clearInterval(g);g=null;d.apply(c,a||[])};e.delay=function(i,k,j,h){e.cancel();d=k||d;c=j||c;a=h||a;g=setInterval(b,i)};e.cancel=function(){if(g){clearInterval(g);g=null}}};(function(){var h=Ext.util,j=Ext.each,g=true,i=false;h.Observable=function(){var k=this,l=k.events;if(k.listeners){k.on(k.listeners);delete k.listeners}k.events=l||{}};h.Observable.prototype={filterOptRe:/^(?:scope|delay|buffer|single)$/,fireEvent:function(){var k=Array.prototype.slice.call(arguments,0),m=k[0].toLowerCase(),n=this,l=g,p=n.events[m],s,o,r;if(n.eventsSuspended===g){if(o=n.eventQueue){o.push(k)}}else{if(typeof p=="object"){if(p.bubble){if(p.fire.apply(p,k.slice(1))===i){return i}r=n.getBubbleTarget&&n.getBubbleTarget();if(r&&r.enableBubble){s=r.events[m];if(!s||typeof s!="object"||!s.bubble){r.enableBubble(m)}return r.fireEvent.apply(r,k)}}else{k.shift();l=p.fire.apply(p,k)}}}return l},addListener:function(m,q,s,l){var p=this,n,t,r,k;if(typeof m=="object"){l=m;for(n in l){t=l[n];if(!p.filterOptRe.test(n)){p.addListener(n,t.fn||t,t.scope||l.scope,t.fn?t:l)}}}else{m=m.toLowerCase();k=p.events[m]||g;if(typeof k=="boolean"){p.events[m]=k=new h.Event(p,m)}k.addListener(q,s,typeof l=="object"?l:{})}},removeListener:function(k,m,l){var n=this.events[k.toLowerCase()];if(typeof n=="object"){n.removeListener(m,l)}},purgeListeners:function(){var m=this.events,k,l;for(l in m){k=m[l];if(typeof k=="object"){k.clearListeners()}}},addEvents:function(n){var m=this;m.events=m.events||{};if(typeof n=="string"){var k=arguments,l=k.length;while(l--){m.events[k[l]]=m.events[k[l]]||g}}else{Ext.applyIf(m.events,n)}},hasListener:function(k){var l=this.events[k.toLowerCase()];return typeof l=="object"&&l.listeners.length>0},suspendEvents:function(k){this.eventsSuspended=g;if(k&&!this.eventQueue){this.eventQueue=[]}},resumeEvents:function(){var k=this,l=k.eventQueue||[];k.eventsSuspended=i;delete k.eventQueue;j(l,function(m){k.fireEvent.apply(k,m)})}};var d=h.Observable.prototype;d.on=d.addListener;d.un=d.removeListener;h.Observable.releaseCapture=function(k){k.fireEvent=d.fireEvent};function e(l,m,k){return function(){if(m.target==arguments[0]){l.apply(k,Array.prototype.slice.call(arguments,0))}}}function b(n,p,k,m){k.task=new h.DelayedTask();return function(){k.task.delay(p.buffer,n,m,Array.prototype.slice.call(arguments,0))}}function c(m,n,l,k){return function(){n.removeListener(l,k);return m.apply(k,arguments)}}function a(n,p,k,m){return function(){var l=new h.DelayedTask();if(!k.tasks){k.tasks=[]}k.tasks.push(l);l.delay(p.delay||10,n,m,Array.prototype.slice.call(arguments,0))}}h.Event=function(l,k){this.name=k;this.obj=l;this.listeners=[]};h.Event.prototype={addListener:function(o,n,m){var p=this,k;n=n||p.obj;if(!p.isListening(o,n)){k=p.createListener(o,n,m);if(p.firing){p.listeners=p.listeners.slice(0)}p.listeners.push(k)}},createListener:function(p,n,q){q=q||{},n=n||this.obj;var k={fn:p,scope:n,options:q},m=p;if(q.target){m=e(m,q,n)}if(q.delay){m=a(m,q,k,n)}if(q.single){m=c(m,this,p,n)}if(q.buffer){m=b(m,q,k,n)}k.fireFn=m;return k},findListener:function(o,n){var p=this.listeners,m=p.length,k;n=n||this.obj;while(m--){k=p[m];if(k){if(k.fn==o&&k.scope==n){return m}}}return -1},isListening:function(l,k){return this.findListener(l,k)!=-1},removeListener:function(r,q){var p,m,n,s=this,o=i;if((p=s.findListener(r,q))!=-1){if(s.firing){s.listeners=s.listeners.slice(0)}m=s.listeners[p];if(m.task){m.task.cancel();delete m.task}n=m.tasks&&m.tasks.length;if(n){while(n--){m.tasks[n].cancel()}delete m.tasks}s.listeners.splice(p,1);o=g}return o},clearListeners:function(){var n=this,k=n.listeners,m=k.length;while(m--){n.removeListener(k[m].fn,k[m].scope)}},fire:function(){var q=this,p=q.listeners,k=p.length,o=0,m;if(k>0){q.firing=g;var n=Array.prototype.slice.call(arguments,0);for(;o=525:!((Ext.isGecko&&!Ext.isWindows)||Ext.isOpera);return{doResizeEvent:function(){var l=a.getViewHeight(),k=a.getViewWidth();if(g!=l||h!=k){c.fire(h=k,g=l)}},onWindowResize:function(m,l,k){if(!c){c=new Ext.util.Event();j=new Ext.util.DelayedTask(this.doResizeEvent);Ext.EventManager.on(window,"resize",this.fireWindowResize,this)}c.addListener(m,l,k)},fireWindowResize:function(){if(c){j.delay(100)}},onTextResize:function(n,m,k){if(!e){e=new Ext.util.Event();var l=new Ext.Element(document.createElement("div"));l.dom.className="x-text-resize";l.dom.innerHTML="X";l.appendTo(document.body);b=l.dom.offsetHeight;setInterval(function(){if(l.dom.offsetHeight!=b){e.fire(b,b=l.dom.offsetHeight)}},this.textResizeInterval)}e.addListener(n,m,k)},removeResizeListener:function(l,k){if(c){c.removeListener(l,k)}},fireResize:function(){if(c){c.fire(a.getViewWidth(),a.getViewHeight())}},textResizeInterval:50,ieDeferSrc:false,useKeydown:d}}());Ext.EventManager.on=Ext.EventManager.addListener;Ext.apply(Ext.EventObjectImpl.prototype,{BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,RETURN:13,SHIFT:16,CTRL:17,CONTROL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGEUP:33,PAGE_DOWN:34,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,isNavKeyPress:function(){var b=this,a=this.normalizeKey(b.keyCode);return(a>=33&&a<=40)||a==b.RETURN||a==b.TAB||a==b.ESC},isSpecialKey:function(){var a=this.normalizeKey(this.keyCode);return(this.type=="keypress"&&this.ctrlKey)||this.isNavKeyPress()||(a==this.BACKSPACE)||(a>=16&&a<=20)||(a>=44&&a<=46)},getPoint:function(){return new Ext.lib.Point(this.xy[0],this.xy[1])},hasModifier:function(){return((this.ctrlKey||this.altKey)||this.shiftKey)}});(function(){var j=document;Ext.Element=function(o,p){var q=typeof o=="string"?j.getElementById(o):o,r;if(!q){return null}r=q.id;if(!p&&r&&Ext.elCache[r]){return Ext.elCache[r].el}this.dom=q;this.id=r||Ext.id(q)};var a=Ext.lib.Dom,g=Ext.DomHelper,m=Ext.lib.Event,e=Ext.lib.Anim,h=Ext.Element,b=Ext.elCache;h.prototype={set:function(t,q){var r=this.dom,p,s,q=(q!==false)&&!!r.setAttribute;for(p in t){if(t.hasOwnProperty(p)){s=t[p];if(p=="style"){g.applyStyles(r,s)}else{if(p=="cls"){r.className=s}else{if(q){r.setAttribute(p,s)}else{r[p]=s}}}}}return this},defaultUnit:"px",is:function(o){return Ext.DomQuery.is(this.dom,o)},focus:function(r,q){var o=this,q=q||o.dom;try{if(Number(r)){o.focus.defer(r,null,[null,q])}else{q.focus()}}catch(p){}return o},blur:function(){try{this.dom.blur()}catch(o){}return this},getValue:function(o){var p=this.dom.value;return o?parseInt(p,10):p},addListener:function(o,r,q,p){Ext.EventManager.on(this.dom,o,r,q||this,p);return this},removeListener:function(o,q,p){Ext.EventManager.removeListener(this.dom,o,q,p||this);return this},removeAllListeners:function(){Ext.EventManager.removeAll(this.dom);return this},purgeAllListeners:function(){Ext.EventManager.purgeElement(this,true);return this},addUnits:function(o){if(o===""||o=="auto"||o===undefined){o=o||""}else{if(!isNaN(o)||!k.test(o)){o=o+(this.defaultUnit||"px")}}return o},load:function(p,q,o){Ext.Ajax.request(Ext.apply({params:q,url:p.url||p,callback:o,el:this.dom,indicatorText:p.indicatorText||""},Ext.isObject(p)?p:{}));return this},isBorderBox:function(){return i[(this.dom.tagName||"").toLowerCase()]||Ext.isBorderBox},remove:function(){var o=this,p=o.dom;if(p){delete o.dom;Ext.removeNode(p)}},hover:function(p,o,r,q){var s=this;s.on("mouseenter",p,r||s.dom,q);s.on("mouseleave",o,r||s.dom,q);return s},contains:function(o){return !o?false:Ext.lib.Dom.isAncestor(this.dom,o.dom?o.dom:o)},getAttributeNS:function(p,o){return this.getAttribute(o,p)},getAttribute:Ext.isIE?function(o,q){var r=this.dom,p=typeof r[q+":"+o];if(["undefined","unknown"].indexOf(p)==-1){return r[q+":"+o]}return r[o]}:function(o,p){var q=this.dom;return q.getAttributeNS(p,o)||q.getAttribute(p+":"+o)||q.getAttribute(o)||q[o]},update:function(o){if(this.dom){this.dom.innerHTML=o}return this}};var n=h.prototype;h.addMethods=function(p){Ext.apply(n,p)};n.on=n.addListener;n.un=n.removeListener;n.autoBoxAdjust=true;var k=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i,d;h.get=function(p){var o,s,r;if(!p){return null}if(typeof p=="string"){if(!(s=j.getElementById(p))){return null}if(b[p]&&b[p].el){o=b[p].el;o.dom=s}else{o=h.addToCache(new h(s))}return o}else{if(p.tagName){if(!(r=p.id)){r=Ext.id(p)}if(b[r]&&b[r].el){o=b[r].el;o.dom=p}else{o=h.addToCache(new h(p))}return o}else{if(p instanceof h){if(p!=d){if(Ext.isIE&&(p.id==undefined||p.id=="")){p.dom=p.dom}else{p.dom=j.getElementById(p.id)||p.dom}}return p}else{if(p.isComposite){return p}else{if(Ext.isArray(p)){return h.select(p)}else{if(p==j){if(!d){var q=function(){};q.prototype=h.prototype;d=new q();d.dom=j}return d}}}}}}return null};h.addToCache=function(o,p){p=p||o.id;b[p]={el:o,data:{},events:{}};return o};h.data=function(p,o,q){p=h.get(p);if(!p){return null}var r=b[p.id].data;if(arguments.length==2){return r[o]}else{return(r[o]=q)}};function l(){if(!Ext.enableGarbageCollector){clearInterval(h.collectorThreadId)}else{var p,r,u,s;for(p in b){s=b[p];if(s.skipGC){continue}r=s.el;u=r.dom;if(!u||!u.parentNode||(!u.offsetParent&&!j.getElementById(p))){if(Ext.enableListenerCollection){Ext.EventManager.removeAll(u)}delete b[p]}}if(Ext.isIE){var q={};for(p in b){q[p]=b[p]}b=Ext.elCache=q}}}h.collectorThreadId=setInterval(l,30000);var c=function(){};c.prototype=h.prototype;h.Flyweight=function(o){this.dom=o};h.Flyweight.prototype=new c();h.Flyweight.prototype.isFlyweight=true;h._flyweights={};h.fly=function(q,o){var p=null;o=o||"_global";if(q=Ext.getDom(q)){(h._flyweights[o]=h._flyweights[o]||new h.Flyweight()).dom=q;p=h._flyweights[o]}return p};Ext.get=h.get;Ext.fly=h.fly;var i=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko){i.button=1}})();Ext.Element.addMethods({swallowEvent:function(a,b){var d=this;function c(g){g.stopPropagation();if(b){g.preventDefault()}}if(Ext.isArray(a)){Ext.each(a,function(g){d.on(g,c)});return d}d.on(a,c);return d},relayEvent:function(a,b){this.on(a,function(c){b.fireEvent(a,c)})},clean:function(b){var d=this,e=d.dom,g=e.firstChild,c=-1;if(Ext.Element.data(e,"isCleaned")&&b!==true){return d}while(g){var a=g.nextSibling;if(g.nodeType==3&&!/\S/.test(g.nodeValue)){e.removeChild(g)}else{g.nodeIndex=++c}g=a}Ext.Element.data(e,"isCleaned",true);return d},load:function(){var a=this.getUpdater();a.update.apply(a,arguments);return this},getUpdater:function(){return this.updateManager||(this.updateManager=new Ext.Updater(this))},update:function(html,loadScripts,callback){if(!this.dom){return this}html=html||"";if(loadScripts!==true){this.dom.innerHTML=html;if(typeof callback=="function"){callback()}return this}var id=Ext.id(),dom=this.dom;html+='';Ext.lib.Event.onAvailable(id,function(){var DOC=document,hd=DOC.getElementsByTagName("head")[0],re=/(?:]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,srcRe=/\ssrc=([\'\"])(.*?)\1/i,typeRe=/\stype=([\'\"])(.*?)\1/i,match,attrs,srcMatch,typeMatch,el,s;while((match=re.exec(html))){attrs=match[1];srcMatch=attrs?attrs.match(srcRe):false;if(srcMatch&&srcMatch[2]){s=DOC.createElement("script");s.src=srcMatch[2];typeMatch=attrs.match(typeRe);if(typeMatch&&typeMatch[2]){s.type=typeMatch[2]}hd.appendChild(s)}else{if(match[2]&&match[2].length>0){if(window.execScript){window.execScript(match[2])}else{window.eval(match[2])}}}}el=DOC.getElementById(id);if(el){Ext.removeNode(el)}if(typeof callback=="function"){callback()}});dom.innerHTML=html.replace(/(?:)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this},removeAllListeners:function(){this.removeAnchor();Ext.EventManager.removeAll(this.dom);return this},createProxy:function(a,e,d){a=(typeof a=="object")?a:{tag:"div",cls:a};var c=this,b=e?Ext.DomHelper.append(e,a,true):Ext.DomHelper.insertBefore(c.dom,a,true);if(d&&c.setBox&&c.getBox){b.setBox(c.getBox())}return b}});Ext.Element.prototype.getUpdateManager=Ext.Element.prototype.getUpdater;Ext.Element.addMethods({getAnchorXY:function(e,l,q){e=(e||"tl").toLowerCase();q=q||{};var k=this,b=k.dom==document.body||k.dom==document,n=q.width||b?Ext.lib.Dom.getViewWidth():k.getWidth(),i=q.height||b?Ext.lib.Dom.getViewHeight():k.getHeight(),p,a=Math.round,c=k.getXY(),m=k.getScroll(),j=b?m.left:!l?c[0]:0,g=b?m.top:!l?c[1]:0,d={c:[a(n*0.5),a(i*0.5)],t:[a(n*0.5),0],l:[0,a(i*0.5)],r:[n,a(i*0.5)],b:[a(n*0.5),i],tl:[0,0],bl:[0,i],br:[n,i],tr:[n,0]};p=d[e];return[p[0]+j,p[1]+g]},anchorTo:function(b,h,c,a,k,l){var i=this,e=i.dom,j=!Ext.isEmpty(k),d=function(){Ext.fly(e).alignTo(b,h,c,a);Ext.callback(l,Ext.fly(e))},g=this.getAnchor();this.removeAnchor();Ext.apply(g,{fn:d,scroll:j});Ext.EventManager.onWindowResize(d,null);if(j){Ext.EventManager.on(window,"scroll",d,null,{buffer:!isNaN(k)?k:50})}d.call(i);return i},removeAnchor:function(){var b=this,a=this.getAnchor();if(a&&a.fn){Ext.EventManager.removeResizeListener(a.fn);if(a.scroll){Ext.EventManager.un(window,"scroll",a.fn)}delete a.fn}return b},getAnchor:function(){var b=Ext.Element.data,c=this.dom;if(!c){return}var a=b(c,"_anchor");if(!a){a=b(c,"_anchor",{})}return a},getAlignToXY:function(g,A,B){g=Ext.get(g);if(!g||!g.dom){throw"Element.alignToXY with an element that doesn't exist"}B=B||[0,0];A=(!A||A=="?"?"tl-bl?":(!/-/.test(A)&&A!==""?"tl-"+A:A||"tl-bl")).toLowerCase();var K=this,H=K.dom,M,L,n,l,s,F,v,t=Ext.lib.Dom.getViewWidth()-10,G=Ext.lib.Dom.getViewHeight()-10,b,i,j,k,u,z,N=document,J=N.documentElement,q=N.body,E=(J.scrollLeft||q.scrollLeft||0)+5,D=(J.scrollTop||q.scrollTop||0)+5,I=false,e="",a="",C=A.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!C){throw"Element.alignTo with an invalid alignment "+A}e=C[1];a=C[2];I=!!C[3];M=K.getAnchorXY(e,true);L=g.getAnchorXY(a,false);n=L[0]-M[0]+B[0];l=L[1]-M[1]+B[1];if(I){s=K.getWidth();F=K.getHeight();v=g.getRegion();b=e.charAt(0);i=e.charAt(e.length-1);j=a.charAt(0);k=a.charAt(a.length-1);u=((b=="t"&&j=="b")||(b=="b"&&j=="t"));z=((i=="r"&&k=="l")||(i=="l"&&k=="r"));if(n+s>t+E){n=z?v.left-s:t+E-s}if(nG+D){l=u?v.top-F:G+D-F}if(lA){o=A-p;l=true}if((n+B)>g){n=g-B;l=true}if(o "+g,this.dom);return h?i:a(i)},parent:function(g,h){return this.matchNode(d,d,g,h)},next:function(g,h){return this.matchNode(b,b,g,h)},prev:function(g,h){return this.matchNode(c,c,g,h)},first:function(g,h){return this.matchNode(b,"firstChild",g,h)},last:function(g,h){return this.matchNode(c,"lastChild",g,h)},matchNode:function(h,k,g,i){var j=this.dom[k];while(j){if(j.nodeType==1&&(!g||e.is(j,g))){return !i?a(j):j}j=j[h]}return null}}}());Ext.Element.addMethods({select:function(a,b){return Ext.Element.select(a,b,this.dom)}});Ext.Element.addMethods(function(){var c=Ext.getDom,a=Ext.get,b=Ext.DomHelper;return{appendChild:function(d){return a(d).appendTo(this)},appendTo:function(d){c(d).appendChild(this.dom);return this},insertBefore:function(d){(d=c(d)).parentNode.insertBefore(this.dom,d);return this},insertAfter:function(d){(d=c(d)).parentNode.insertBefore(this.dom,d.nextSibling);return this},insertFirst:function(e,d){e=e||{};if(e.nodeType||e.dom||typeof e=="string"){e=c(e);this.dom.insertBefore(e,this.dom.firstChild);return !d?a(e):e}else{return this.createChild(e,this.dom.firstChild,d)}},replace:function(d){d=a(d);this.insertBefore(d);d.remove();return this},replaceWith:function(d){var e=this;if(d.nodeType||d.dom||typeof d=="string"){d=c(d);e.dom.parentNode.insertBefore(d,e.dom)}else{d=b.insertBefore(e.dom,d)}delete Ext.elCache[e.id];Ext.removeNode(e.dom);e.id=Ext.id(e.dom=d);Ext.Element.addToCache(e.isFlyweight?new Ext.Element(e.dom):e);return e},createChild:function(e,d,g){e=e||{tag:"div"};return d?b.insertBefore(d,e,g!==true):b[!this.dom.firstChild?"overwrite":"append"](this.dom,e,g!==true)},wrap:function(d,e){var g=b.insertBefore(this.dom,d||{tag:"div"},!e);g.dom?g.dom.appendChild(this.dom):g.appendChild(this.dom);return g},insertHtml:function(e,g,d){var h=b.insertHtml(e,this.dom,g);return d?Ext.get(h):h}}}());Ext.apply(Ext.Element.prototype,function(){var c=Ext.getDom,a=Ext.get,b=Ext.DomHelper;return{insertSibling:function(i,g,h){var j=this,e,d=(g||"before").toLowerCase()=="after",k;if(Ext.isArray(i)){k=j;Ext.each(i,function(l){e=Ext.fly(k,"_internal").insertSibling(l,g,h);if(d){k=e}});return e}i=i||{};if(i.nodeType||i.dom){e=j.dom.parentNode.insertBefore(c(i),d?j.dom.nextSibling:j.dom);if(!h){e=a(e)}}else{if(d&&!j.dom.nextSibling){e=b.append(j.dom.parentNode,i,!h)}else{e=b[d?"insertAfter":"insertBefore"](j.dom,i,!h)}}return e}}}());Ext.Element.addMethods(function(){var i={},z=/(-[a-z])/gi,c={},t=document.defaultView,w=Ext.isIE?"styleFloat":"cssFloat",E=/alpha\(opacity=(.*)\)/i,m=/^\s+|\s+$/g,v=/\s+/,b=/\w/g,C=Ext.Element,e="padding",d="margin",A="border",u="-left",r="-right",y="-top",p="-bottom",k="-width",s=Math,B="hidden",g="isClipped",l="overflow",o="overflow-x",n="overflow-y",D="originalClip",j={l:A+u+k,r:A+r+k,t:A+y+k,b:A+p+k},h={l:e+u,r:e+r,t:e+y,b:e+p},a={l:d+u,r:d+r,t:d+y,b:d+p},F=Ext.Element.data;function q(G,H){return H.charAt(1).toUpperCase()}function x(G){return i[G]||(i[G]=G=="float"?w:G.replace(z,q))}return{adjustWidth:function(G){var H=this;var I=(typeof G=="number");if(I&&H.autoBoxAdjust&&!H.isBorderBox()){G-=(H.getBorderWidth("lr")+H.getPadding("lr"))}return(I&&G<0)?0:G},adjustHeight:function(G){var H=this;var I=(typeof G=="number");if(I&&H.autoBoxAdjust&&!H.isBorderBox()){G-=(H.getBorderWidth("tb")+H.getPadding("tb"))}return(I&&G<0)?0:G},addClass:function(K){var L=this,J,G,I,H=[];if(!Ext.isArray(K)){if(typeof K=="string"&&!this.hasClass(K)){L.dom.className+=" "+K}}else{for(J=0,G=K.length;J5?I.toLowerCase():H)},setStyle:function(K,J){var H,I,G;if(typeof K!="object"){H={};H[K]=J;K=H}for(I in K){J=K[I];I=="opacity"?this.setOpacity(J):this.dom.style[x(I)]=J}return this},setOpacity:function(H,G){var K=this,I=K.dom.style;if(!G||!K.anim){if(Ext.isIE){var J=H<1?"alpha(opacity="+H*100+")":"",L=I.filter.replace(E,"").replace(m,"");I.zoom=1;I.filter=L+(L.length>0?" ":"")+J}else{I.opacity=H}}else{K.anim({opacity:{to:H}},K.preanim(arguments,1),null,0.35,"easeIn")}return K},clearOpacity:function(){var G=this.dom.style;if(Ext.isIE){if(!Ext.isEmpty(G.filter)){G.filter=G.filter.replace(E,"").replace(m,"")}}else{G.opacity=G["-moz-opacity"]=G["-khtml-opacity"]=""}return this},getHeight:function(I){var H=this,K=H.dom,J=Ext.isIE&&H.isStyle("display","none"),G=s.max(K.offsetHeight,J?0:K.clientHeight)||0;G=!I?G:G-H.getBorderWidth("tb")-H.getPadding("tb");return G<0?0:G},getWidth:function(H){var I=this,K=I.dom,J=Ext.isIE&&I.isStyle("display","none"),G=s.max(K.offsetWidth,J?0:K.clientWidth)||0;G=!H?G:G-I.getBorderWidth("lr")-I.getPadding("lr");return G<0?0:G},setWidth:function(H,G){var I=this;H=I.adjustWidth(H);!G||!I.anim?I.dom.style.width=I.addUnits(H):I.anim({width:{to:H}},I.preanim(arguments,1));return I},setHeight:function(G,H){var I=this;G=I.adjustHeight(G);!H||!I.anim?I.dom.style.height=I.addUnits(G):I.anim({height:{to:G}},I.preanim(arguments,1));return I},getBorderWidth:function(G){return this.addStyles(G,j)},getPadding:function(G){return this.addStyles(G,h)},clip:function(){var G=this,H=G.dom;if(!F(H,g)){F(H,g,true);F(H,D,{o:G.getStyle(l),x:G.getStyle(o),y:G.getStyle(n)});G.setStyle(l,B);G.setStyle(o,B);G.setStyle(n,B)}return G},unclip:function(){var G=this,I=G.dom;if(F(I,g)){F(I,g,false);var H=F(I,D);if(H.o){G.setStyle(l,H.o)}if(H.x){G.setStyle(o,H.x)}if(H.y){G.setStyle(n,H.y)}}return G},addStyles:function(N,M){var K=0,L=N.match(b),J,I,H,G=L.length;for(H=0;H"+String.format(Ext.Element.boxMarkup,c)+""));Ext.DomQuery.selectNode("."+c+"-mc",d.dom).appendChild(this.dom);return d},setSize:function(e,c,d){var g=this;if(typeof e=="object"){c=e.height;e=e.width}e=g.adjustWidth(e);c=g.adjustHeight(c);if(!d||!g.anim){g.dom.style.width=g.addUnits(e);g.dom.style.height=g.addUnits(c)}else{g.anim({width:{to:e},height:{to:c}},g.preanim(arguments,2))}return g},getComputedHeight:function(){var d=this,c=Math.max(d.dom.offsetHeight,d.dom.clientHeight);if(!c){c=parseFloat(d.getStyle("height"))||0;if(!d.isBorderBox()){c+=d.getFrameWidth("tb")}}return c},getComputedWidth:function(){var c=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!c){c=parseFloat(this.getStyle("width"))||0;if(!this.isBorderBox()){c+=this.getFrameWidth("lr")}}return c},getFrameWidth:function(d,c){return c&&this.isBorderBox()?0:(this.getPadding(d)+this.getBorderWidth(d))},addClassOnOver:function(c){this.hover(function(){Ext.fly(this,a).addClass(c)},function(){Ext.fly(this,a).removeClass(c)});return this},addClassOnFocus:function(c){this.on("focus",function(){Ext.fly(this,a).addClass(c)},this.dom);this.on("blur",function(){Ext.fly(this,a).removeClass(c)},this.dom);return this},addClassOnClick:function(c){var d=this.dom;this.on("mousedown",function(){Ext.fly(d,a).addClass(c);var g=Ext.getDoc(),e=function(){Ext.fly(d,a).removeClass(c);g.removeListener("mouseup",e)};g.on("mouseup",e)});return this},getViewSize:function(){var g=document,h=this.dom,c=(h==g||h==g.body);if(c){var e=Ext.lib.Dom;return{width:e.getViewWidth(),height:e.getViewHeight()}}else{return{width:h.clientWidth,height:h.clientHeight}}},getStyleSize:function(){var j=this,c,i,l=document,m=this.dom,e=(m==l||m==l.body),g=m.style;if(e){var k=Ext.lib.Dom;return{width:k.getViewWidth(),height:k.getViewHeight()}}if(g.width&&g.width!="auto"){c=parseFloat(g.width);if(j.isBorderBox()){c-=j.getFrameWidth("lr")}}if(g.height&&g.height!="auto"){i=parseFloat(g.height);if(j.isBorderBox()){i-=j.getFrameWidth("tb")}}return{width:c||j.getWidth(true),height:i||j.getHeight(true)}},getSize:function(c){return{width:this.getWidth(c),height:this.getHeight(c)}},repaint:function(){var c=this.dom;this.addClass("x-repaint");setTimeout(function(){Ext.fly(c).removeClass("x-repaint")},1);return this},unselectable:function(){this.dom.unselectable="on";return this.swallowEvent("selectstart",true).applyStyles("-moz-user-select:none;-khtml-user-select:none;").addClass("x-unselectable")},getMargins:function(d){var e=this,c,g={t:"top",l:"left",r:"right",b:"bottom"},h={};if(!d){for(c in e.margins){h[g[c]]=parseFloat(e.getStyle(e.margins[c]))||0}return h}else{return e.addStyles.call(e,d,e.margins)}}}}());(function(){var a=Ext.lib.Dom,b="left",g="right",d="top",i="bottom",h="position",c="static",e="relative",j="auto",k="z-index";Ext.Element.addMethods({getX:function(){return a.getX(this.dom)},getY:function(){return a.getY(this.dom)},getXY:function(){return a.getXY(this.dom)},getOffsetsTo:function(l){var n=this.getXY(),m=Ext.fly(l,"_internal").getXY();return[n[0]-m[0],n[1]-m[1]]},setX:function(l,m){return this.setXY([l,this.getY()],this.animTest(arguments,m,1))},setY:function(m,l){return this.setXY([this.getX(),m],this.animTest(arguments,l,1))},setLeft:function(l){this.setStyle(b,this.addUnits(l));return this},setTop:function(l){this.setStyle(d,this.addUnits(l));return this},setRight:function(l){this.setStyle(g,this.addUnits(l));return this},setBottom:function(l){this.setStyle(i,this.addUnits(l));return this},setXY:function(n,l){var m=this;if(!l||!m.anim){a.setXY(m.dom,n)}else{m.anim({points:{to:n}},m.preanim(arguments,1),"motion")}return m},setLocation:function(l,n,m){return this.setXY([l,n],this.animTest(arguments,m,2))},moveTo:function(l,n,m){return this.setXY([l,n],this.animTest(arguments,m,2))},getLeft:function(l){return !l?this.getX():parseInt(this.getStyle(b),10)||0},getRight:function(l){var m=this;return !l?m.getX()+m.getWidth():(m.getLeft(true)+m.getWidth())||0},getTop:function(l){return !l?this.getY():parseInt(this.getStyle(d),10)||0},getBottom:function(l){var m=this;return !l?m.getY()+m.getHeight():(m.getTop(true)+m.getHeight())||0},position:function(p,o,l,n){var m=this;if(!p&&m.isStyle(h,c)){m.setStyle(h,e)}else{if(p){m.setStyle(h,p)}}if(o){m.setStyle(k,o)}if(l||n){m.setXY([l||false,n||false])}},clearPositioning:function(l){l=l||"";this.setStyle({left:l,right:l,top:l,bottom:l,"z-index":"",position:c});return this},getPositioning:function(){var m=this.getStyle(b);var n=this.getStyle(d);return{position:this.getStyle(h),left:m,right:m?"":this.getStyle(g),top:n,bottom:n?"":this.getStyle(i),"z-index":this.getStyle(k)}},setPositioning:function(l){var n=this,m=n.dom.style;n.setStyle(l);if(l.right==j){m.right=""}if(l.bottom==j){m.bottom=""}return n},translatePoints:function(m,u){u=isNaN(m[1])?u:m[1];m=isNaN(m[0])?m:m[0];var q=this,r=q.isStyle(h,e),s=q.getXY(),n=parseInt(q.getStyle(b),10),p=parseInt(q.getStyle(d),10);n=!isNaN(n)?n:(r?0:q.dom.offsetLeft);p=!isNaN(p)?p:(r?0:q.dom.offsetTop);return{left:(m-s[0]+n),top:(u-s[1]+p)}},animTest:function(m,l,n){return !!l&&this.preanim?this.preanim(m,n):false}})})();Ext.Element.addMethods({setBox:function(e,g,b){var d=this,a=e.width,c=e.height;if((g&&!d.autoBoxAdjust)&&!d.isBorderBox()){a-=(d.getBorderWidth("lr")+d.getPadding("lr"));c-=(d.getBorderWidth("tb")+d.getPadding("tb"))}d.setBounds(e.x,e.y,a,c,d.animTest.call(d,arguments,b,2));return d},getBox:function(j,p){var m=this,v,e,o,d=m.getBorderWidth,q=m.getPadding,g,a,u,n;if(!p){v=m.getXY()}else{e=parseInt(m.getStyle("left"),10)||0;o=parseInt(m.getStyle("top"),10)||0;v=[e,o]}var c=m.dom,s=c.offsetWidth,i=c.offsetHeight,k;if(!j){k={x:v[0],y:v[1],0:v[0],1:v[1],width:s,height:i}}else{g=d.call(m,"l")+q.call(m,"l");a=d.call(m,"r")+q.call(m,"r");u=d.call(m,"t")+q.call(m,"t");n=d.call(m,"b")+q.call(m,"b");k={x:v[0]+g,y:v[1]+u,0:v[0]+g,1:v[1]+u,width:s-(g+a),height:i-(u+n)}}k.right=k.x+k.width;k.bottom=k.y+k.height;return k},move:function(j,b,c){var g=this,m=g.getXY(),k=m[0],i=m[1],d=[k-b,i],l=[k+b,i],h=[k,i-b],a=[k,i+b],e={l:d,left:d,r:l,right:l,t:h,top:h,up:h,b:a,bottom:a,down:a};j=j.toLowerCase();g.moveTo(e[j][0],e[j][1],g.animTest.call(g,arguments,c,2))},setLeftTop:function(d,c){var b=this,a=b.dom.style;a.left=b.addUnits(d);a.top=b.addUnits(c);return b},getRegion:function(){return Ext.lib.Dom.getRegion(this.dom)},setBounds:function(b,g,d,a,c){var e=this;if(!c||!e.anim){e.setSize(d,a);e.setLocation(b,g)}else{e.anim({points:{to:[b,g]},width:{to:e.adjustWidth(d)},height:{to:e.adjustHeight(a)}},e.preanim(arguments,4),"motion")}return e},setRegion:function(b,a){return this.setBounds(b.left,b.top,b.right-b.left,b.bottom-b.top,this.animTest.call(this,arguments,a,1))}});Ext.Element.addMethods({isScrollable:function(){var a=this.dom;return a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth},scrollTo:function(a,b){this.dom["scroll"+(/top/i.test(a)?"Top":"Left")]=b;return this},getScroll:function(){var i=this.dom,h=document,a=h.body,c=h.documentElement,b,g,e;if(i==h||i==a){if(Ext.isIE&&Ext.isStrict){b=c.scrollLeft;g=c.scrollTop}else{b=window.pageXOffset;g=window.pageYOffset}e={left:b||(a?a.scrollLeft:0),top:g||(a?a.scrollTop:0)}}else{e={left:i.scrollLeft,top:i.scrollTop}}return e}});Ext.Element.addMethods({scrollTo:function(b,d,a){var e=/top/i.test(b),c=this,g=c.dom,h;if(!a||!c.anim){h="scroll"+(e?"Top":"Left"),g[h]=d}else{h="scroll"+(e?"Left":"Top"),c.anim({scroll:{to:e?[g[h],d]:[d,g[h]]}},c.preanim(arguments,2),"scroll")}return c},scrollIntoView:function(e,i){var p=Ext.getDom(e)||Ext.getBody().dom,h=this.dom,g=this.getOffsetsTo(p),k=g[0]+p.scrollLeft,u=g[1]+p.scrollTop,q=u+h.offsetHeight,d=k+h.offsetWidth,a=p.clientHeight,m=parseInt(p.scrollTop,10),s=parseInt(p.scrollLeft,10),j=m+a,n=s+p.clientWidth;if(h.offsetHeight>a||uj){p.scrollTop=q-a}}p.scrollTop=p.scrollTop;if(i!==false){if(h.offsetWidth>p.clientWidth||kn){p.scrollLeft=d-p.clientWidth}}p.scrollLeft=p.scrollLeft}return this},scrollChildIntoView:function(b,a){Ext.fly(b,"_scrollChildIntoView").scrollIntoView(this,a)},scroll:function(m,b,d){if(!this.isScrollable()){return}var e=this.dom,g=e.scrollLeft,p=e.scrollTop,n=e.scrollWidth,k=e.scrollHeight,i=e.clientWidth,a=e.clientHeight,c=false,o,j={l:Math.min(g+b,n-i),r:o=Math.max(g-b,0),t:Math.max(p-b,0),b:Math.min(p+b,k-a)};j.d=j.b;j.u=j.t;m=m.substr(0,1);if((o=j[m])>-1){c=true;this.scrollTo(m=="l"||m=="r"?"left":"top",o,this.preanim(arguments,2))}return c}});Ext.Element.VISIBILITY=1;Ext.Element.DISPLAY=2;Ext.Element.addMethods(function(){var h="visibility",d="display",b="hidden",k="offsets",j="none",a="originalDisplay",c="visibilityMode",e=Ext.Element.DISPLAY,g=Ext.Element.data,i=function(n){var m=g(n,a);if(m===undefined){g(n,a,m="")}return m},l=function(o){var n=g(o,c);if(n===undefined){g(o,c,n=1)}return n};return{originalDisplay:"",visibilityMode:1,setVisibilityMode:function(m){g(this.dom,c,m);return this},animate:function(n,p,o,q,m){this.anim(n,{duration:p,callback:o,easing:q},m);return this},anim:function(p,q,n,s,o,m){n=n||"run";q=q||{};var r=this,t=Ext.lib.Anim[n](r.dom,p,(q.duration||s)||0.35,(q.easing||o)||"easeOut",function(){if(m){m.call(r)}if(q.callback){q.callback.call(q.scope||r,r,q)}},r);q.anim=t;return t},preanim:function(m,n){return !m[n]?false:(typeof m[n]=="object"?m[n]:{duration:m[n+1],callback:m[n+2],easing:m[n+3]})},isVisible:function(){return !this.isStyle(h,b)&&!this.isStyle(d,j)},setVisible:function(r,o){var p=this,n,m,s,q=p.dom;if(typeof o=="string"){n=o==d;m=o==h;s=o==k;o=false}else{n=l(this.dom)==e;m=!n}if(!o||!p.anim){if(n){p.setDisplayed(r)}else{if(s){if(!r){p.hideModeStyles={position:p.getStyle("position"),top:p.getStyle("top"),left:p.getStyle("left")};p.applyStyles({position:"absolute",top:"-10000px",left:"-10000px"})}else{p.applyStyles(p.hideModeStyles||{position:"",top:"",left:""})}}else{p.fixDisplay();q.style.visibility=r?"visible":b}}}else{if(r){p.setOpacity(0.01);p.setVisible(true)}p.anim({opacity:{to:(r?1:0)}},p.preanim(arguments,1),null,0.35,"easeIn",function(){if(!r){q.style[n?d:h]=(n)?j:b;Ext.fly(q).setOpacity(1)}})}return p},toggle:function(m){var n=this;n.setVisible(!n.isVisible(),n.preanim(arguments,0));return n},setDisplayed:function(m){if(typeof m=="boolean"){m=m?i(this.dom):j}this.setStyle(d,m);return this},fixDisplay:function(){var m=this;if(m.isStyle(d,j)){m.setStyle(h,b);m.setStyle(d,i(this.dom));if(m.isStyle(d,j)){m.setStyle(d,"block")}}},hide:function(m){if(typeof m=="string"){this.setVisible(false,m);return this}this.setVisible(false,this.preanim(arguments,0));return this},show:function(m){if(typeof m=="string"){this.setVisible(true,m);return this}this.setVisible(true,this.preanim(arguments,0));return this}}}());Ext.Element.addMethods(function(){var d="visibility",b="display",a="hidden",h="none",c="x-masked",g="x-masked-relative",e=Ext.Element.data;return{isVisible:function(i){var j=!this.isStyle(d,a)&&!this.isStyle(b,h),k=this.dom.parentNode;if(i!==true||!j){return j}while(k&&!/^body/i.test(k.tagName)){if(!Ext.fly(k,"_isVisible").isVisible()){return false}k=k.parentNode}return true},isDisplayed:function(){return !this.isStyle(b,h)},enableDisplayMode:function(i){this.setVisibilityMode(Ext.Element.DISPLAY);if(!Ext.isEmpty(i)){e(this.dom,"originalDisplay",i)}return this},mask:function(j,n){var p=this,l=p.dom,o=Ext.DomHelper,m="ext-el-mask-msg",i,q;if(!/^body/i.test(l.tagName)&&p.getStyle("position")=="static"){p.addClass(g)}if((i=e(l,"maskMsg"))){i.remove()}if((i=e(l,"mask"))){i.remove()}q=o.append(l,{cls:"ext-el-mask"},true);e(l,"mask",q);p.addClass(c);q.setDisplayed(true);if(typeof j=="string"){var k=o.append(l,{cls:m,cn:{tag:"div"}},true);e(l,"maskMsg",k);k.dom.className=n?m+" "+n:m;k.dom.firstChild.innerHTML=j;k.setDisplayed(true);k.center(p)}if(Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&p.getStyle("height")=="auto"){q.setSize(undefined,p.getHeight())}return q},unmask:function(){var k=this,l=k.dom,i=e(l,"mask"),j=e(l,"maskMsg");if(i){if(j){j.remove();e(l,"maskMsg",undefined)}i.remove();e(l,"mask",undefined)}k.removeClass([c,g])},isMasked:function(){var i=e(this.dom,"mask");return i&&i.isVisible()},createShim:function(){var i=document.createElement("iframe"),j;i.frameBorder="0";i.className="ext-shim";i.src=Ext.SSL_SECURE_URL;j=Ext.get(this.dom.parentNode.insertBefore(i,this.dom));j.autoBoxAdjust=false;return j}}}());Ext.Element.addMethods({addKeyListener:function(b,d,c){var a;if(typeof b!="object"||Ext.isArray(b)){a={key:b,fn:d,scope:c}}else{a={key:b.key,shift:b.shift,ctrl:b.ctrl,alt:b.alt,fn:d,scope:c}}return new Ext.KeyMap(this,a)},addKeyMap:function(a){return new Ext.KeyMap(this,a)}});(function(){var y=null,A=undefined,k=true,t=false,j="setX",h="setY",a="setXY",n="left",l="bottom",s="top",m="right",q="height",g="width",i="points",w="hidden",z="absolute",u="visible",e="motion",o="position",r="easeOut",d=new Ext.Element.Flyweight(),v={},x=function(B){return B||{}},p=function(B){d.dom=B;d.id=Ext.id(B);return d},c=function(B){if(!v[B]){v[B]=[]}return v[B]},b=function(C,B){v[C]=B};Ext.enableFx=k;Ext.Fx={switchStatements:function(C,D,B){return D.apply(this,B[C])},slideIn:function(H,E){E=x(E);var J=this,G=J.dom,M=G.style,O,B,L,D,C,M,I,N,K,F;H=H||"t";J.queueFx(E,function(){O=p(G).getXY();p(G).fixDisplay();B=p(G).getFxRestore();L={x:O[0],y:O[1],0:O[0],1:O[1],width:G.offsetWidth,height:G.offsetHeight};L.right=L.x+L.width;L.bottom=L.y+L.height;p(G).setWidth(L.width).setHeight(L.height);D=p(G).fxWrap(B.pos,E,w);M.visibility=u;M.position=z;function P(){p(G).fxUnwrap(D,B.pos,E);M.width=B.width;M.height=B.height;p(G).afterFx(E)}N={to:[L.x,L.y]};K={to:L.width};F={to:L.height};function Q(U,R,V,S,X,Z,ac,ab,aa,W,T){var Y={};p(U).setWidth(V).setHeight(S);if(p(U)[X]){p(U)[X](Z)}R[ac]=R[ab]="0";if(aa){Y.width=aa}if(W){Y.height=W}if(T){Y.points=T}return Y}I=p(G).switchStatements(H.toLowerCase(),Q,{t:[D,M,L.width,0,y,y,n,l,y,F,y],l:[D,M,0,L.height,y,y,m,s,K,y,y],r:[D,M,L.width,L.height,j,L.right,n,s,y,y,N],b:[D,M,L.width,L.height,h,L.bottom,n,s,y,F,N],tl:[D,M,0,0,y,y,m,l,K,F,N],bl:[D,M,0,0,h,L.y+L.height,m,s,K,F,N],br:[D,M,0,0,a,[L.right,L.bottom],n,s,K,F,N],tr:[D,M,0,0,j,L.x+L.width,n,l,K,F,N]});M.visibility=u;p(D).show();arguments.callee.anim=p(D).fxanim(I,E,e,0.5,r,P)});return J},slideOut:function(F,D){D=x(D);var H=this,E=H.dom,K=E.style,L=H.getXY(),C,B,I,J,G={to:0};F=F||"t";H.queueFx(D,function(){B=p(E).getFxRestore();I={x:L[0],y:L[1],0:L[0],1:L[1],width:E.offsetWidth,height:E.offsetHeight};I.right=I.x+I.width;I.bottom=I.y+I.height;p(E).setWidth(I.width).setHeight(I.height);C=p(E).fxWrap(B.pos,D,u);K.visibility=u;K.position=z;p(C).setWidth(I.width).setHeight(I.height);function M(){D.useDisplay?p(E).setDisplayed(t):p(E).hide();p(E).fxUnwrap(C,B.pos,D);K.width=B.width;K.height=B.height;p(E).afterFx(D)}function N(O,W,U,X,S,V,R,T,Q){var P={};O[W]=O[U]="0";P[X]=S;if(V){P[V]=R}if(T){P[T]=Q}return P}J=p(E).switchStatements(F.toLowerCase(),N,{t:[K,n,l,q,G],l:[K,m,s,g,G],r:[K,n,s,g,G,i,{to:[I.right,I.y]}],b:[K,n,s,q,G,i,{to:[I.x,I.bottom]}],tl:[K,m,l,g,G,q,G],bl:[K,m,s,g,G,q,G,i,{to:[I.x,I.bottom]}],br:[K,n,s,g,G,q,G,i,{to:[I.x+I.width,I.bottom]}],tr:[K,n,l,g,G,q,G,i,{to:[I.right,I.y]}]});arguments.callee.anim=p(C).fxanim(J,D,e,0.5,r,M)});return H},puff:function(H){H=x(H);var F=this,G=F.dom,C=G.style,D,B,E;F.queueFx(H,function(){D=p(G).getWidth();B=p(G).getHeight();p(G).clearOpacity();p(G).show();E=p(G).getFxRestore();function I(){H.useDisplay?p(G).setDisplayed(t):p(G).hide();p(G).clearOpacity();p(G).setPositioning(E.pos);C.width=E.width;C.height=E.height;C.fontSize="";p(G).afterFx(H)}arguments.callee.anim=p(G).fxanim({width:{to:p(G).adjustWidth(D*2)},height:{to:p(G).adjustHeight(B*2)},points:{by:[-D*0.5,-B*0.5]},opacity:{to:0},fontSize:{to:200,unit:"%"}},H,e,0.5,r,I)});return F},switchOff:function(F){F=x(F);var D=this,E=D.dom,B=E.style,C;D.queueFx(F,function(){p(E).clearOpacity();p(E).clip();C=p(E).getFxRestore();function G(){F.useDisplay?p(E).setDisplayed(t):p(E).hide();p(E).clearOpacity();p(E).setPositioning(C.pos);B.width=C.width;B.height=C.height;p(E).afterFx(F)}p(E).fxanim({opacity:{to:0.3}},y,y,0.1,y,function(){p(E).clearOpacity();(function(){p(E).fxanim({height:{to:1},points:{by:[0,p(E).getHeight()*0.5]}},F,e,0.3,"easeIn",G)}).defer(100)})});return D},highlight:function(D,H){H=x(H);var F=this,G=F.dom,B=H.attr||"backgroundColor",C={},E;F.queueFx(H,function(){p(G).clearOpacity();p(G).show();function I(){G.style[B]=E;p(G).afterFx(H)}E=G.style[B];C[B]={from:D||"ffff9c",to:H.endColor||p(G).getColor(B)||"ffffff"};arguments.callee.anim=p(G).fxanim(C,H,"color",1,"easeIn",I)});return F},frame:function(B,E,H){H=x(H);var D=this,G=D.dom,C,F;D.queueFx(H,function(){B=B||"#C3DAF9";if(B.length==6){B="#"+B}E=E||1;p(G).show();var L=p(G).getXY(),J={x:L[0],y:L[1],0:L[0],1:L[1],width:G.offsetWidth,height:G.offsetHeight},I=function(){C=p(document.body||document.documentElement).createChild({style:{position:z,"z-index":35000,border:"0px solid "+B}});return C.queueFx({},K)};arguments.callee.anim={isAnimated:true,stop:function(){E=0;C.stopFx()}};function K(){var M=Ext.isBorderBox?2:1;F=C.anim({top:{from:J.y,to:J.y-20},left:{from:J.x,to:J.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:J.height,to:J.height+20*M},width:{from:J.width,to:J.width+20*M}},{duration:H.duration||1,callback:function(){C.remove();--E>0?I():p(G).afterFx(H)}});arguments.callee.anim={isAnimated:true,stop:function(){F.stop()}}}I()});return D},pause:function(D){var C=this.dom,B;this.queueFx({},function(){B=setTimeout(function(){p(C).afterFx({})},D*1000);arguments.callee.anim={isAnimated:true,stop:function(){clearTimeout(B);p(C).afterFx({})}}});return this},fadeIn:function(D){D=x(D);var B=this,C=B.dom,E=D.endOpacity||1;B.queueFx(D,function(){p(C).setOpacity(0);p(C).fixDisplay();C.style.visibility=u;arguments.callee.anim=p(C).fxanim({opacity:{to:E}},D,y,0.5,r,function(){if(E==1){p(C).clearOpacity()}p(C).afterFx(D)})});return B},fadeOut:function(E){E=x(E);var C=this,D=C.dom,B=D.style,F=E.endOpacity||0;C.queueFx(E,function(){arguments.callee.anim=p(D).fxanim({opacity:{to:F}},E,y,0.5,r,function(){if(F==0){Ext.Element.data(D,"visibilityMode")==Ext.Element.DISPLAY||E.useDisplay?B.display="none":B.visibility=w;p(D).clearOpacity()}p(D).afterFx(E)})});return C},scale:function(B,C,D){this.shift(Ext.apply({},D,{width:B,height:C}));return this},shift:function(D){D=x(D);var C=this.dom,B={};this.queueFx(D,function(){for(var E in D){if(D[E]!=A){B[E]={to:D[E]}}}B.width?B.width.to=p(C).adjustWidth(D.width):B;B.height?B.height.to=p(C).adjustWidth(D.height):B;if(B.x||B.y||B.xy){B.points=B.xy||{to:[B.x?B.x.to:p(C).getX(),B.y?B.y.to:p(C).getY()]}}arguments.callee.anim=p(C).fxanim(B,D,e,0.35,r,function(){p(C).afterFx(D)})});return this},ghost:function(E,C){C=x(C);var G=this,D=G.dom,J=D.style,H={opacity:{to:0},points:{}},K=H.points,B,I,F;E=E||"b";G.queueFx(C,function(){B=p(D).getFxRestore();I=p(D).getWidth();F=p(D).getHeight();function L(){C.useDisplay?p(D).setDisplayed(t):p(D).hide();p(D).clearOpacity();p(D).setPositioning(B.pos);J.width=B.width;J.height=B.height;p(D).afterFx(C)}K.by=p(D).switchStatements(E.toLowerCase(),function(N,M){return[N,M]},{t:[0,-F],l:[-I,0],r:[I,0],b:[0,F],tl:[-I,-F],bl:[-I,F],br:[I,F],tr:[I,-F]});arguments.callee.anim=p(D).fxanim(H,C,e,0.5,r,L)});return G},syncFx:function(){var B=this;B.fxDefaults=Ext.apply(B.fxDefaults||{},{block:t,concurrent:k,stopFx:t});return B},sequenceFx:function(){var B=this;B.fxDefaults=Ext.apply(B.fxDefaults||{},{block:t,concurrent:t,stopFx:t});return B},nextFx:function(){var B=c(this.dom.id)[0];if(B){B.call(this)}},hasActiveFx:function(){return c(this.dom.id)[0]},stopFx:function(B){var C=this,E=C.dom.id;if(C.hasActiveFx()){var D=c(E)[0];if(D&&D.anim){if(D.anim.isAnimated){b(E,[D]);D.anim.stop(B!==undefined?B:k)}else{b(E,[])}}}return C},beforeFx:function(B){if(this.hasActiveFx()&&!B.concurrent){if(B.stopFx){this.stopFx();return k}return t}return k},hasFxBlock:function(){var B=c(this.dom.id);return B&&B[0]&&B[0].block},queueFx:function(E,B){var C=p(this.dom);if(!C.hasFxBlock()){Ext.applyIf(E,C.fxDefaults);if(!E.concurrent){var D=C.beforeFx(E);B.block=E.block;c(C.dom.id).push(B);if(D){C.nextFx()}}else{B.call(C)}}return C},fxWrap:function(H,F,D){var E=this.dom,C,B;if(!F.wrap||!(C=Ext.getDom(F.wrap))){if(F.fixPosition){B=p(E).getXY()}var G=document.createElement("div");G.style.visibility=D;C=E.parentNode.insertBefore(G,E);p(C).setPositioning(H);if(p(C).isStyle(o,"static")){p(C).position("relative")}p(E).clearPositioning("auto");p(C).clip();C.appendChild(E);if(B){p(C).setXY(B)}}return C},fxUnwrap:function(C,F,E){var D=this.dom;p(D).clearPositioning();p(D).setPositioning(F);if(!E.wrap){var B=p(C).dom.parentNode;B.insertBefore(D,C);p(C).remove()}},getFxRestore:function(){var B=this.dom.style;return{pos:this.getPositioning(),width:B.width,height:B.height}},afterFx:function(C){var B=this.dom,D=B.id;if(C.afterStyle){p(B).setStyle(C.afterStyle)}if(C.afterCls){p(B).addClass(C.afterCls)}if(C.remove==k){p(B).remove()}if(C.callback){C.callback.call(C.scope,p(B))}if(!C.concurrent){c(D).shift();p(B).nextFx()}},fxanim:function(E,F,C,G,D,B){C=C||"run";F=F||{};var H=Ext.lib.Anim[C](this.dom,E,(F.duration||G)||0.35,(F.easing||D)||r,B,this);F.anim=H;return H}};Ext.Fx.resize=Ext.Fx.scale;Ext.Element.addMethods(Ext.Fx)})();Ext.CompositeElementLite=function(b,a){this.elements=[];this.add(b,a);this.el=new Ext.Element.Flyweight()};Ext.CompositeElementLite.prototype={isComposite:true,getElement:function(a){var b=this.el;b.dom=a;b.id=a.id;return b},transformElement:function(a){return Ext.getDom(a)},getCount:function(){return this.elements.length},add:function(d,b){var e=this,g=e.elements;if(!d){return this}if(typeof d=="string"){d=Ext.Element.selectorFunction(d,b)}else{if(d.isComposite){d=d.elements}else{if(!Ext.isIterable(d)){d=[d]}}}for(var c=0,a=d.length;c-1){c=Ext.getDom(c);if(a){g=this.elements[b];g.parentNode.insertBefore(c,g);Ext.removeNode(g)}this.elements.splice(b,1,c)}return this},clear:function(){this.elements=[]}};Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener;(function(){var c,b=Ext.Element.prototype,a=Ext.CompositeElementLite.prototype;for(c in b){if(Ext.isFunction(b[c])){(function(d){a[d]=a[d]||function(){return this.invoke(d,arguments)}}).call(a,c)}}})();if(Ext.DomQuery){Ext.Element.selectorFunction=Ext.DomQuery.select}Ext.Element.select=function(a,b){var c;if(typeof a=="string"){c=Ext.Element.selectorFunction(a,b)}else{if(a.length!==undefined){c=a}else{throw"Invalid selector"}}return new Ext.CompositeElementLite(c)};Ext.select=Ext.Element.select;Ext.apply(Ext.CompositeElementLite.prototype,{addElements:function(c,a){if(!c){return this}if(typeof c=="string"){c=Ext.Element.selectorFunction(c,a)}var b=this.elements;Ext.each(c,function(d){b.push(Ext.get(d))});return this},first:function(){return this.item(0)},last:function(){return this.item(this.getCount()-1)},contains:function(a){return this.indexOf(a)!=-1},removeElement:function(d,e){var c=this,a=this.elements,b;Ext.each(d,function(g){if((b=(a[g]||a[g=c.indexOf(g)]))){if(e){if(b.dom){b.remove()}else{Ext.removeNode(b)}}a.splice(g,1)}});return this}});Ext.CompositeElement=Ext.extend(Ext.CompositeElementLite,{constructor:function(b,a){this.elements=[];this.add(b,a)},getElement:function(a){return a},transformElement:function(a){return Ext.get(a)}});Ext.Element.select=function(a,d,b){var c;if(typeof a=="string"){c=Ext.Element.selectorFunction(a,b)}else{if(a.length!==undefined){c=a}else{throw"Invalid selector"}}return(d===true)?new Ext.CompositeElement(c):new Ext.CompositeElementLite(c)};Ext.select=Ext.Element.select;(function(){var b="beforerequest",e="requestcomplete",d="requestexception",h=undefined,c="load",i="POST",a="GET",g=window;Ext.data.Connection=function(j){Ext.apply(this,j);this.addEvents(b,e,d);Ext.data.Connection.superclass.constructor.call(this)};Ext.extend(Ext.data.Connection,Ext.util.Observable,{timeout:30000,autoAbort:false,disableCaching:true,disableCachingParam:"_dc",request:function(n){var s=this;if(s.fireEvent(b,s,n)){if(n.el){if(!Ext.isEmpty(n.indicatorText)){s.indicatorText='
    '+n.indicatorText+"
    "}if(s.indicatorText){Ext.getDom(n.el).innerHTML=s.indicatorText}n.success=(Ext.isFunction(n.success)?n.success:function(){}).createInterceptor(function(o){Ext.getDom(n.el).innerHTML=o.responseText})}var l=n.params,k=n.url||s.url,j,q={success:s.handleResponse,failure:s.handleFailure,scope:s,argument:{options:n},timeout:n.timeout||s.timeout},m,t;if(Ext.isFunction(l)){l=l.call(n.scope||g,n)}l=Ext.urlEncode(s.extraParams,Ext.isObject(l)?Ext.urlEncode(l):l);if(Ext.isFunction(k)){k=k.call(n.scope||g,n)}if((m=Ext.getDom(n.form))){k=k||m.action;if(n.isUpload||/multipart\/form-data/i.test(m.getAttribute("enctype"))){return s.doFormUpload.call(s,n,l,k)}t=Ext.lib.Ajax.serializeForm(m);l=l?(l+"&"+t):t}j=n.method||s.method||((l||n.xmlData||n.jsonData)?i:a);if(j===a&&(s.disableCaching&&n.disableCaching!==false)||n.disableCaching===true){var r=n.disableCachingParam||s.disableCachingParam;k=Ext.urlAppend(k,r+"="+(new Date().getTime()))}n.headers=Ext.apply(n.headers||{},s.defaultHeaders||{});if(n.autoAbort===true||s.autoAbort){s.abort()}if((j==a||n.xmlData||n.jsonData)&&l){k=Ext.urlAppend(k,l);l=""}return(s.transId=Ext.lib.Ajax.request(j,k,q,l,n))}else{return n.callback?n.callback.apply(n.scope,[n,h,h]):null}},isLoading:function(j){return j?Ext.lib.Ajax.isCallInProgress(j):!!this.transId},abort:function(j){if(j||this.isLoading()){Ext.lib.Ajax.abort(j||this.transId)}},handleResponse:function(j){this.transId=false;var k=j.argument.options;j.argument=k?k.argument:null;this.fireEvent(e,this,j,k);if(k.success){k.success.call(k.scope,j,k)}if(k.callback){k.callback.call(k.scope,k,true,j)}},handleFailure:function(j,l){this.transId=false;var k=j.argument.options;j.argument=k?k.argument:null;this.fireEvent(d,this,j,k,l);if(k.failure){k.failure.call(k.scope,j,k)}if(k.callback){k.callback.call(k.scope,k,false,j)}},doFormUpload:function(q,j,k){var l=Ext.id(),v=document,r=v.createElement("iframe"),m=Ext.getDom(q.form),u=[],t,p="multipart/form-data",n={target:m.target,method:m.method,encoding:m.encoding,enctype:m.enctype,action:m.action};Ext.fly(r).set({id:l,name:l,cls:"x-hidden",src:Ext.SSL_SECURE_URL});v.body.appendChild(r);if(Ext.isIE){document.frames[l].name=l}Ext.fly(m).set({target:l,method:i,enctype:p,encoding:p,action:k||n.action});Ext.iterate(Ext.urlDecode(j,false),function(w,o){t=v.createElement("input");Ext.fly(t).set({type:"hidden",value:o,name:w});m.appendChild(t);u.push(t)});function s(){var x=this,w={responseText:"",responseXML:null,argument:q.argument},A,z;try{A=r.contentWindow.document||r.contentDocument||g.frames[l].document;if(A){if(A.body){if(/textarea/i.test((z=A.body.firstChild||{}).tagName)){w.responseText=z.value}else{w.responseText=A.body.innerHTML}}w.responseXML=A.XMLDocument||A}}catch(y){}Ext.EventManager.removeListener(r,c,s,x);x.fireEvent(e,x,w,q);function o(D,C,B){if(Ext.isFunction(D)){D.apply(C,B)}}o(q.success,q.scope,[w,q]);o(q.callback,q.scope,[q,true,w]);if(!x.debugUploads){setTimeout(function(){Ext.removeNode(r)},100)}}Ext.EventManager.on(r,c,s,this);m.submit();Ext.fly(m).set(n);Ext.each(u,function(o){Ext.removeNode(o)})}})})();Ext.Ajax=new Ext.data.Connection({autoAbort:false,serializeForm:function(a){return Ext.lib.Ajax.serializeForm(a)}});Ext.UpdateManager=Ext.Updater=Ext.extend(Ext.util.Observable,function(){var b="beforeupdate",d="update",c="failure";function a(h){var i=this;i.transaction=null;if(h.argument.form&&h.argument.reset){try{h.argument.form.reset()}catch(j){}}if(i.loadScripts){i.renderer.render(i.el,h,i,g.createDelegate(i,[h]))}else{i.renderer.render(i.el,h,i);g.call(i,h)}}function g(h,i,j){this.fireEvent(i||d,this.el,h);if(Ext.isFunction(h.argument.callback)){h.argument.callback.call(h.argument.scope,this.el,Ext.isEmpty(j)?true:false,h,h.argument.options)}}function e(h){g.call(this,h,c,!!(this.transaction=null))}return{constructor:function(i,h){var j=this;i=Ext.get(i);if(!h&&i.updateManager){return i.updateManager}j.el=i;j.defaultUrl=null;j.addEvents(b,d,c);Ext.apply(j,Ext.Updater.defaults);j.transaction=null;j.refreshDelegate=j.refresh.createDelegate(j);j.updateDelegate=j.update.createDelegate(j);j.formUpdateDelegate=(j.formUpdate||function(){}).createDelegate(j);j.renderer=j.renderer||j.getDefaultRenderer();Ext.Updater.superclass.constructor.call(j)},setRenderer:function(h){this.renderer=h},getRenderer:function(){return this.renderer},getDefaultRenderer:function(){return new Ext.Updater.BasicRenderer()},setDefaultUrl:function(h){this.defaultUrl=h},getEl:function(){return this.el},update:function(i,n,p,l){var k=this,h,j;if(k.fireEvent(b,k.el,i,n)!==false){if(Ext.isObject(i)){h=i;i=h.url;n=n||h.params;p=p||h.callback;l=l||h.discardUrl;j=h.scope;if(!Ext.isEmpty(h.nocache)){k.disableCaching=h.nocache}if(!Ext.isEmpty(h.text)){k.indicatorText='
    '+h.text+"
    "}if(!Ext.isEmpty(h.scripts)){k.loadScripts=h.scripts}if(!Ext.isEmpty(h.timeout)){k.timeout=h.timeout}}k.showLoading();if(!l){k.defaultUrl=i}if(Ext.isFunction(i)){i=i.call(k)}var m=Ext.apply({},{url:i,params:(Ext.isFunction(n)&&j)?n.createDelegate(j):n,success:a,failure:e,scope:k,callback:undefined,timeout:(k.timeout*1000),disableCaching:k.disableCaching,argument:{options:h,url:i,form:null,callback:p,scope:j||window,params:n}},h);k.transaction=Ext.Ajax.request(m)}},formUpdate:function(k,h,j,l){var i=this;if(i.fireEvent(b,i.el,k,h)!==false){if(Ext.isFunction(h)){h=h.call(i)}k=Ext.getDom(k);i.transaction=Ext.Ajax.request({form:k,url:h,success:a,failure:e,scope:i,timeout:(i.timeout*1000),argument:{url:h,form:k,callback:l,reset:j}});i.showLoading.defer(1,i)}},startAutoRefresh:function(i,j,l,m,h){var k=this;if(h){k.update(j||k.defaultUrl,l,m,true)}if(k.autoRefreshProcId){clearInterval(k.autoRefreshProcId)}k.autoRefreshProcId=setInterval(k.update.createDelegate(k,[j||k.defaultUrl,l,m,true]),i*1000)},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);delete this.autoRefreshProcId}},isAutoRefreshing:function(){return !!this.autoRefreshProcId},showLoading:function(){if(this.showLoadIndicator){this.el.dom.innerHTML=this.indicatorText}},abort:function(){if(this.transaction){Ext.Ajax.abort(this.transaction)}},isUpdating:function(){return this.transaction?Ext.Ajax.isLoading(this.transaction):false},refresh:function(h){if(this.defaultUrl){this.update(this.defaultUrl,null,h,true)}}}}());Ext.Updater.defaults={timeout:30,disableCaching:false,showLoadIndicator:true,indicatorText:'
    Loading...
    ',loadScripts:false,sslBlankUrl:Ext.SSL_SECURE_URL};Ext.Updater.updateElement=function(d,c,e,b){var a=Ext.get(d).getUpdater();Ext.apply(a,b);a.update(c,e,b?b.callback:null)};Ext.Updater.BasicRenderer=function(){};Ext.Updater.BasicRenderer.prototype={render:function(c,a,b,d){c.update(a.responseText,b.loadScripts,d)}};(function(){Date.useStrict=false;function b(d){var c=Array.prototype.slice.call(arguments,1);return d.replace(/\{(\d+)\}/g,function(e,g){return c[g]})}Date.formatCodeToRegex=function(d,c){var e=Date.parseCodes[d];if(e){e=typeof e=="function"?e():e;Date.parseCodes[d]=e}return e?Ext.applyIf({c:e.c?b(e.c,c||"{0}"):e.c},e):{g:0,c:null,s:Ext.escapeRe(d)}};var a=Date.formatCodeToRegex;Ext.apply(Date,{parseFunctions:{"M$":function(d,c){var e=new RegExp("\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/");var g=(d||"").match(e);return g?new Date(((g[1]||"")+g[2])*1):null}},parseRegexes:[],formatFunctions:{"M$":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},getShortMonthName:function(c){return Date.monthNames[c].substring(0,3)},getShortDayName:function(c){return Date.dayNames[c].substring(0,3)},getMonthNumber:function(c){return Date.monthNumbers[c.substring(0,1).toUpperCase()+c.substring(1,3).toLowerCase()]},formatCodes:{d:"String.leftPad(this.getDate(), 2, '0')",D:"Date.getShortDayName(this.getDay())",j:"this.getDate()",l:"Date.dayNames[this.getDay()]",N:"(this.getDay() ? this.getDay() : 7)",S:"this.getSuffix()",w:"this.getDay()",z:"this.getDayOfYear()",W:"String.leftPad(this.getWeekOfYear(), 2, '0')",F:"Date.monthNames[this.getMonth()]",m:"String.leftPad(this.getMonth() + 1, 2, '0')",M:"Date.getShortMonthName(this.getMonth())",n:"(this.getMonth() + 1)",t:"this.getDaysInMonth()",L:"(this.isLeapYear() ? 1 : 0)",o:"(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))",Y:"this.getFullYear()",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:"String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",H:"String.leftPad(this.getHours(), 2, '0')",i:"String.leftPad(this.getMinutes(), 2, '0')",s:"String.leftPad(this.getSeconds(), 2, '0')",u:"String.leftPad(this.getMilliseconds(), 3, '0')",O:"this.getGMTOffset()",P:"this.getGMTOffset(true)",T:"this.getTimezone()",Z:"(this.getTimezoneOffset() * -60)",c:function(){for(var k="Y-m-dTH:i:sP",h=[],g=0,d=k.length;g= 0 && y >= 0){","v = new Date(y, 0, 1, h, i, s, ms);","v = !strict? v : (strict === true && (z <= 364 || (v.isLeapYear() && z <= 365))? v.add(Date.DAY, z) : null);","}else if(strict === true && !Date.isValid(y, m + 1, d, h, i, s, ms)){","v = null;","}else{","v = new Date(y, m, d, h, i, s, ms);","}","}","}","if(v){","if(zz != null){","v = v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - zz);","}else if(o){","v = v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));","}","}","return v;"].join("\n");return function(m){var e=Date.parseRegexes.length,n=1,g=[],l=[],k=false,d="";for(var j=0;j Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"},a:{g:1,c:"if (results[{0}] == 'am') {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(am|pm)"},A:{g:1,c:"if (results[{0}] == 'AM') {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(AM|PM)"},g:function(){return a("G")},G:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},h:function(){return a("H")},H:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},i:{g:1,c:"i = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},s:{g:1,c:"s = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},u:{g:1,c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",s:"(\\d+)"},O:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),","mn = o.substring(3,5) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{4})"},P:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),","mn = o.substring(4,6) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{2}:\\d{2})"},T:{g:0,c:null,s:"[A-Z]{1,4}"},Z:{g:1,c:"zz = results[{0}] * 1;\nzz = (-43200 <= zz && zz <= 50400)? zz : null;\n",s:"([+-]?\\d{1,5})"},c:function(){var e=[],c=[a("Y",1),a("m",2),a("d",3),a("h",4),a("i",5),a("s",6),{c:"ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"},{c:["if(results[8]) {","if(results[8] == 'Z'){","zz = 0;","}else if (results[8].indexOf(':') > -1){",a("P",8).c,"}else{",a("O",8).c,"}","}"].join("\n")}];for(var g=0,d=c.length;g0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+(a?":":"")+String.leftPad(Math.abs(this.getTimezoneOffset()%60),2,"0")},getDayOfYear:function(){var b=0,e=this.clone(),a=this.getMonth(),c;for(c=0,e.setDate(1),e.setMonth(0);c28){a=Math.min(a,this.getFirstDateOfMonth().add("mo",c).getLastDateOfMonth().getDate())}e.setDate(a);e.setMonth(this.getMonth()+c);break;case Date.YEAR:e.setFullYear(this.getFullYear()+c);break}return e},between:function(c,a){var b=this.getTime();return c.getTime()<=b&&b<=a.getTime()}});Date.prototype.format=Date.prototype.dateFormat;if(Ext.isSafari&&(navigator.userAgent.match(/WebKit\/(\d+)/)[1]||NaN)<420){Ext.apply(Date.prototype,{_xMonth:Date.prototype.setMonth,_xDate:Date.prototype.setDate,setMonth:function(a){if(a<=-1){var d=Math.ceil(-a),c=Math.ceil(d/12),b=(d%12)?12-d%12:0;this.setFullYear(this.getFullYear()-c);return this._xMonth(b)}else{return this._xMonth(a)}},setDate:function(a){return this.setTime(this.getTime()-(this.getDate()-a)*86400000)}})}Ext.util.MixedCollection=function(b,a){this.items=[];this.map={};this.keys=[];this.length=0;this.addEvents("clear","add","replace","remove","sort");this.allowFunctions=b===true;if(a){this.getKey=a}Ext.util.MixedCollection.superclass.constructor.call(this)};Ext.extend(Ext.util.MixedCollection,Ext.util.Observable,{allowFunctions:false,add:function(b,c){if(arguments.length==1){c=arguments[0];b=this.getKey(c)}if(typeof b!="undefined"&&b!==null){var a=this.map[b];if(typeof a!="undefined"){return this.replace(b,c)}this.map[b]=c}this.length++;this.items.push(c);this.keys.push(b);this.fireEvent("add",this.length-1,c,b);return c},getKey:function(a){return a.id},replace:function(c,d){if(arguments.length==1){d=arguments[0];c=this.getKey(d)}var a=this.map[c];if(typeof c=="undefined"||c===null||typeof a=="undefined"){return this.add(c,d)}var b=this.indexOfKey(c);this.items[b]=d;this.map[c]=d;this.fireEvent("replace",c,a,d);return d},addAll:function(e){if(arguments.length>1||Ext.isArray(e)){var b=arguments.length>1?arguments:e;for(var d=0,a=b.length;d=this.length){return this.add(b,c)}this.length++;this.items.splice(a,0,c);if(typeof b!="undefined"&&b!==null){this.map[b]=c}this.keys.splice(a,0,b);this.fireEvent("add",a,c,b);return c},remove:function(a){return this.removeAt(this.indexOf(a))},removeAt:function(a){if(a=0){this.length--;var c=this.items[a];this.items.splice(a,1);var b=this.keys[a];if(typeof b!="undefined"){delete this.map[b]}this.keys.splice(a,1);this.fireEvent("remove",c,b);return c}return false},removeKey:function(a){return this.removeAt(this.indexOfKey(a))},getCount:function(){return this.length},indexOf:function(a){return this.items.indexOf(a)},indexOfKey:function(a){return this.keys.indexOf(a)},item:function(b){var a=this.map[b],c=a!==undefined?a:(typeof b=="number")?this.items[b]:undefined;return typeof c!="function"||this.allowFunctions?c:null},itemAt:function(a){return this.items[a]},key:function(a){return this.map[a]},contains:function(a){return this.indexOf(a)!=-1},containsKey:function(a){return typeof this.map[a]!="undefined"},clear:function(){this.length=0;this.items=[];this.keys=[];this.map={};this.fireEvent("clear")},first:function(){return this.items[0]},last:function(){return this.items[this.length-1]},_sort:function(k,a,j){var d,e,b=String(a).toUpperCase()=="DESC"?-1:1,h=[],l=this.keys,g=this.items;j=j||function(i,c){return i-c};for(d=0,e=g.length;de?1:(g=a;c--){d[d.length]=b[c]}}return d},filter:function(c,b,d,a){if(Ext.isEmpty(b,false)){return this.clone()}b=this.createValueMatcher(b,d,a);return this.filterBy(function(e){return e&&b.test(e[c])})},filterBy:function(g,e){var h=new Ext.util.MixedCollection();h.getKey=this.getKey;var b=this.keys,d=this.items;for(var c=0,a=d.length;c]+>/gi,stripScriptsRe=/(?:)((\n|\r|.)*?)(?:<\/script>)/ig,nl2brRe=/\r?\n/g;return{ellipsis:function(value,len,word){if(value&&value.length>len){if(word){var vs=value.substr(0,len-2),index=Math.max(vs.lastIndexOf(" "),vs.lastIndexOf("."),vs.lastIndexOf("!"),vs.lastIndexOf("?"));if(index==-1||index<(len-15)){return value.substr(0,len-3)+"..."}else{return vs.substr(0,index)+"..."}}else{return value.substr(0,len-3)+"..."}}return value},undef:function(value){return value!==undefined?value:""},defaultValue:function(value,defaultValue){return value!==undefined&&value!==""?value:defaultValue},htmlEncode:function(value){return !value?value:String(value).replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&")},trim:function(value){return String(value).replace(trimRe,"")},substr:function(value,start,length){return String(value).substr(start,length)},lowercase:function(value){return String(value).toLowerCase()},uppercase:function(value){return String(value).toUpperCase()},capitalize:function(value){return !value?value:value.charAt(0).toUpperCase()+value.substr(1).toLowerCase()},call:function(value,fn){if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);args.unshift(value);return eval(fn).apply(window,args)}else{return eval(fn).call(window,value)}},usMoney:function(v){v=(Math.round((v-0)*100))/100;v=(v==Math.floor(v))?v+".00":((v*10==Math.floor(v*10))?v+"0":v);v=String(v);var ps=v.split("."),whole=ps[0],sub=ps[1]?"."+ps[1]:".00",r=/(\d+)(\d{3})/;while(r.test(whole)){whole=whole.replace(r,"$1,$2")}v=whole+sub;if(v.charAt(0)=="-"){return"-$"+v.substr(1)}return"$"+v},date:function(v,format){if(!v){return""}if(!Ext.isDate(v)){v=new Date(Date.parse(v))}return v.dateFormat(format||"m/d/Y")},dateRenderer:function(format){return function(v){return Ext.util.Format.date(v,format)}},stripTags:function(v){return !v?v:String(v).replace(stripTagsRE,"")},stripScripts:function(v){return !v?v:String(v).replace(stripScriptsRe,"")},fileSize:function(size){if(size<1024){return size+" bytes"}else{if(size<1048576){return(Math.round(((size*10)/1024))/10)+" KB"}else{return(Math.round(((size*10)/1048576))/10)+" MB"}}},math:function(){var fns={};return function(v,a){if(!fns[a]){fns[a]=new Function("v","return v "+a+";")}return fns[a](v)}}(),round:function(value,precision){var result=Number(value);if(typeof precision=="number"){precision=Math.pow(10,precision);result=Math.round(value*precision)/precision}return result},number:function(v,format){if(!format){return v}v=Ext.num(v,NaN);if(isNaN(v)){return""}var comma=",",dec=".",i18n=false,neg=v<0;v=Math.abs(v);if(format.substr(format.length-2)=="/i"){format=format.substr(0,format.length-2);i18n=true;comma=".";dec=","}var hasComma=format.indexOf(comma)!=-1,psplit=(i18n?format.replace(/[^\d\,]/g,""):format.replace(/[^\d\.]/g,"")).split(dec);if(1")}}}();Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var y=this,j=y.html,q=/]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,d=/^]*?for="(.*?)"/,v=/^]*?if="(.*?)"/,x=/^]*?exec="(.*?)"/,r,p=0,k=[],o="values",w="parent",l="xindex",n="xcount",e="return ",c="with(values){ ";j=["",j,""].join("");while((r=j.match(q))){var b=r[0].match(d),a=r[0].match(v),A=r[0].match(x),g=null,h=null,t=null,z=b&&b[1]?b[1]:"";if(a){g=a&&a[1]?a[1]:null;if(g){h=new Function(o,w,l,n,c+e+(Ext.util.Format.htmlDecode(g))+"; }")}}if(A){g=A&&A[1]?A[1]:null;if(g){t=new Function(o,w,l,n,c+(Ext.util.Format.htmlDecode(g))+"; }")}}if(z){switch(z){case".":z=new Function(o,w,c+e+o+"; }");break;case"..":z=new Function(o,w,c+e+w+"; }");break;default:z=new Function(o,w,c+e+z+"; }")}}k.push({id:p,target:z,exec:t,test:h,body:r[1]||""});j=j.replace(r[0],"{xtpl"+p+"}");++p}for(var u=k.length-1;u>=0;--u){y.compileTpl(k[u])}y.master=k[k.length-1];y.tpls=k};Ext.extend(Ext.XTemplate,Ext.Template,{re:/\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,codeRe:/\{\[((?:\\\]|.|\n)*?)\]\}/g,applySubTemplate:function(a,k,j,d,c){var h=this,g,m=h.tpls[a],l,b=[];if((m.test&&!m.test.call(h,k,j,d,c))||(m.exec&&m.exec.call(h,k,j,d,c))){return""}l=m.target?m.target.call(h,k,j):k;g=l.length;j=m.target?k:j;if(m.target&&Ext.isArray(l)){for(var e=0,g=l.length;e=0;--g){d[k[g].selectorText.toLowerCase()]=k[g]}}catch(i){}},getRules:function(h){if(d===null||h){d={};var k=c.styleSheets;for(var j=0,g=k.length;j=37&&a<=40){b.stopEvent()}},destroy:function(){this.disable()},enable:function(){if(this.disabled){if(Ext.isSafari2){this.el.on("keyup",this.stopKeyUp,this)}this.el.on(this.isKeydown()?"keydown":"keypress",this.relay,this);this.disabled=false}},disable:function(){if(!this.disabled){if(Ext.isSafari2){this.el.un("keyup",this.stopKeyUp,this)}this.el.un(this.isKeydown()?"keydown":"keypress",this.relay,this);this.disabled=true}},setDisabled:function(a){this[a?"disable":"enable"]()},isKeydown:function(){return this.forceKeyDown||Ext.EventManager.useKeydown}};Ext.KeyMap=function(c,b,a){this.el=Ext.get(c);this.eventName=a||"keydown";this.bindings=[];if(b){this.addBinding(b)}this.enable()};Ext.KeyMap.prototype={stopEvent:false,addBinding:function(b){if(Ext.isArray(b)){Ext.each(b,function(j){this.addBinding(j)},this);return}var k=b.key,g=b.fn||b.handler,l=b.scope;if(b.stopEvent){this.stopEvent=b.stopEvent}if(typeof k=="string"){var h=[];var e=k.toUpperCase();for(var c=0,d=e.length;c2)?a[2]:null;var h=(i>3)?a[3]:"/";var d=(i>4)?a[4]:null;var g=(i>5)?a[5]:false;document.cookie=c+"="+escape(e)+((b===null)?"":("; expires="+b.toGMTString()))+((h===null)?"":("; path="+h))+((d===null)?"":("; domain="+d))+((g===true)?"; secure":"")},get:function(d){var b=d+"=";var g=b.length;var a=document.cookie.length;var e=0;var c=0;while(eundefined. + */ initComponent : function(){ Ext.Button.superclass.initComponent.call(this); @@ -282,7 +289,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { if(!Ext.isEmpty(this.oldCls)){ this.el.removeClass([this.oldCls, 'x-btn-pressed']); } - this.oldCls = (this.iconCls || this.icon) ? (this.text ? ' x-btn-text-icon' : ' x-btn-icon') : ' x-btn-noicon'; + this.oldCls = (this.iconCls || this.icon) ? (this.text ? 'x-btn-text-icon' : 'x-btn-icon') : 'x-btn-noicon'; this.el.addClass([this.oldCls, this.pressed ? 'x-btn-pressed' : null]); } }, @@ -456,7 +463,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, { // private doAutoWidth : function(){ - if(this.el && this.text && this.width === undefined){ + if(this.autoWidth !== false && this.el && this.text && this.width === undefined){ this.el.setWidth('auto'); if(Ext.isIE7 && Ext.isStrict){ var ib = this.btnEl; diff --git a/pkgs/pkg-buttons.js b/pkgs/pkg-buttons.js index 13496500..6c94cde7 100644 --- a/pkgs/pkg-buttons.js +++ b/pkgs/pkg-buttons.js @@ -1,7 +1,7 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ -Ext.Button=Ext.extend(Ext.BoxComponent,{hidden:false,disabled:false,pressed:false,enableToggle:false,menuAlign:"tl-bl?",type:"button",menuClassTarget:"tr:nth(2)",clickEvent:"click",handleMouseEvents:true,tooltipType:"qtip",buttonSelector:"button:first-child",scale:"small",iconAlign:"left",arrowAlign:"right",initComponent:function(){Ext.Button.superclass.initComponent.call(this);this.addEvents("click","toggle","mouseover","mouseout","menushow","menuhide","menutriggerover","menutriggerout");if(this.menu){this.menu=Ext.menu.MenuMgr.get(this.menu)}if(Ext.isString(this.toggleGroup)){this.enableToggle=true}},getTemplateArgs:function(){return[this.type,"x-btn-"+this.scale+" x-btn-icon-"+this.scale+"-"+this.iconAlign,this.getMenuClass(),this.cls,this.id]},setButtonClass:function(){if(this.useSetClass){if(!Ext.isEmpty(this.oldCls)){this.el.removeClass([this.oldCls,"x-btn-pressed"])}this.oldCls=(this.iconCls||this.icon)?(this.text?" x-btn-text-icon":" x-btn-icon"):" x-btn-noicon";this.el.addClass([this.oldCls,this.pressed?"x-btn-pressed":null])}},getMenuClass:function(){return this.menu?(this.arrowAlign!="bottom"?"x-btn-arrow":"x-btn-arrow-bottom"):""},onRender:function(c,a){if(!this.template){if(!Ext.Button.buttonTemplate){Ext.Button.buttonTemplate=new Ext.Template('','','','',"
      
      
      
    ");Ext.Button.buttonTemplate.compile()}this.template=Ext.Button.buttonTemplate}var b,d=this.getTemplateArgs();if(a){b=this.template.insertBefore(a,d,true)}else{b=this.template.append(c,d,true)}this.btnEl=b.child(this.buttonSelector);this.mon(this.btnEl,{scope:this,focus:this.onFocus,blur:this.onBlur});this.initButtonEl(b,this.btnEl);Ext.ButtonToggleMgr.register(this)},initButtonEl:function(b,c){this.el=b;this.setIcon(this.icon);this.setText(this.text);this.setIconClass(this.iconCls);if(Ext.isDefined(this.tabIndex)){c.dom.tabIndex=this.tabIndex}if(this.tooltip){this.setTooltip(this.tooltip,true)}if(this.handleMouseEvents){this.mon(b,{scope:this,mouseover:this.onMouseOver,mousedown:this.onMouseDown})}if(this.menu){this.mon(this.menu,{scope:this,show:this.onMenuShow,hide:this.onMenuHide})}if(this.repeat){var a=new Ext.util.ClickRepeater(b,Ext.isObject(this.repeat)?this.repeat:{});this.mon(a,"click",this.onClick,this)}this.mon(b,this.clickEvent,this.onClick,this)},afterRender:function(){Ext.Button.superclass.afterRender.call(this);this.useSetClass=true;this.setButtonClass();this.doc=Ext.getDoc();this.doAutoWidth()},setIconClass:function(a){this.iconCls=a;if(this.el){this.btnEl.dom.className="";this.btnEl.addClass(["x-btn-text",a||""]);this.setButtonClass()}return this},setTooltip:function(b,a){if(this.rendered){if(!a){this.clearTip()}if(Ext.isObject(b)){Ext.QuickTips.register(Ext.apply({target:this.btnEl.id},b));this.tooltip=b}else{this.btnEl.dom[this.tooltipType]=b}}else{this.tooltip=b}return this},clearTip:function(){if(Ext.isObject(this.tooltip)){Ext.QuickTips.unregister(this.btnEl)}},beforeDestroy:function(){if(this.rendered){this.clearTip()}if(this.menu&&this.destroyMenu!==false){Ext.destroy(this.menu)}Ext.destroy(this.repeater)},onDestroy:function(){if(this.rendered){this.doc.un("mouseover",this.monitorMouseOver,this);this.doc.un("mouseup",this.onMouseUp,this);delete this.doc;delete this.btnEl;Ext.ButtonToggleMgr.unregister(this)}Ext.Button.superclass.onDestroy.call(this)},doAutoWidth:function(){if(this.el&&this.text&&this.width===undefined){this.el.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var a=this.btnEl;if(a&&a.getWidth()>20){a.clip();a.setWidth(Ext.util.TextMetrics.measure(a,this.text).width+a.getFrameWidth("lr"))}}if(this.minWidth){if(this.el.getWidth()a}else{return c.getPageY()>this.btnEl.getRegion().bottom}},onClick:function(b,a){b.preventDefault();if(!this.disabled){if(this.isClickOnArrow(b)){if(this.menu&&!this.menu.isVisible()&&!this.ignoreNextClick){this.showMenu()}this.fireEvent("arrowclick",this,b);if(this.arrowHandler){this.arrowHandler.call(this.scope||this,this,b)}}else{if(this.enableToggle){this.toggle()}this.fireEvent("click",this,b);if(this.handler){this.handler.call(this.scope||this,this,b)}}}},isMenuTriggerOver:function(a){return this.menu&&a.target.tagName==this.arrowSelector},isMenuTriggerOut:function(b,a){return this.menu&&b.target.tagName!=this.arrowSelector}});Ext.reg("splitbutton",Ext.SplitButton);Ext.CycleButton=Ext.extend(Ext.SplitButton,{getItemText:function(a){if(a&&this.showText===true){var b="";if(this.prependText){b+=this.prependText}b+=a.text;return b}return undefined},setActiveItem:function(c,a){if(!Ext.isObject(c)){c=this.menu.getComponent(c)}if(c){if(!this.rendered){this.text=this.getItemText(c);this.iconCls=c.iconCls}else{var b=this.getItemText(c);if(b){this.setText(b)}this.setIconClass(c.iconCls)}this.activeItem=c;if(!c.checked){c.setChecked(true,false)}if(this.forceIcon){this.setIconClass(this.forceIcon)}if(!a){this.fireEvent("change",this,c)}}},getActiveItem:function(){return this.activeItem},initComponent:function(){this.addEvents("change");if(this.changeHandler){this.on("change",this.changeHandler,this.scope||this);delete this.changeHandler}this.itemCount=this.items.length;this.menu={cls:"x-cycle-menu",items:[]};var a=0;Ext.each(this.items,function(c,b){Ext.apply(c,{group:c.group||this.id,itemIndex:b,checkHandler:this.checkHandler,scope:this,checked:c.checked||false});this.menu.items.push(c);if(c.checked){a=b}},this);Ext.CycleButton.superclass.initComponent.call(this);this.on("click",this.toggleSelected,this);this.setActiveItem(a,true)},checkHandler:function(a,b){if(b){this.setActiveItem(a)}},toggleSelected:function(){var a=this.menu;a.render();if(!a.hasLayout){a.doLayout()}var d,b;for(var c=1;c','  ','  ','  ',"");Ext.Button.buttonTemplate.compile()}this.template=Ext.Button.buttonTemplate}var b,d=this.getTemplateArgs();if(a){b=this.template.insertBefore(a,d,true)}else{b=this.template.append(c,d,true)}this.btnEl=b.child(this.buttonSelector);this.mon(this.btnEl,{scope:this,focus:this.onFocus,blur:this.onBlur});this.initButtonEl(b,this.btnEl);Ext.ButtonToggleMgr.register(this)},initButtonEl:function(b,c){this.el=b;this.setIcon(this.icon);this.setText(this.text);this.setIconClass(this.iconCls);if(Ext.isDefined(this.tabIndex)){c.dom.tabIndex=this.tabIndex}if(this.tooltip){this.setTooltip(this.tooltip,true)}if(this.handleMouseEvents){this.mon(b,{scope:this,mouseover:this.onMouseOver,mousedown:this.onMouseDown})}if(this.menu){this.mon(this.menu,{scope:this,show:this.onMenuShow,hide:this.onMenuHide})}if(this.repeat){var a=new Ext.util.ClickRepeater(b,Ext.isObject(this.repeat)?this.repeat:{});this.mon(a,"click",this.onClick,this)}this.mon(b,this.clickEvent,this.onClick,this)},afterRender:function(){Ext.Button.superclass.afterRender.call(this);this.useSetClass=true;this.setButtonClass();this.doc=Ext.getDoc();this.doAutoWidth()},setIconClass:function(a){this.iconCls=a;if(this.el){this.btnEl.dom.className="";this.btnEl.addClass(["x-btn-text",a||""]);this.setButtonClass()}return this},setTooltip:function(b,a){if(this.rendered){if(!a){this.clearTip()}if(Ext.isObject(b)){Ext.QuickTips.register(Ext.apply({target:this.btnEl.id},b));this.tooltip=b}else{this.btnEl.dom[this.tooltipType]=b}}else{this.tooltip=b}return this},clearTip:function(){if(Ext.isObject(this.tooltip)){Ext.QuickTips.unregister(this.btnEl)}},beforeDestroy:function(){if(this.rendered){this.clearTip()}if(this.menu&&this.destroyMenu!==false){Ext.destroy(this.menu)}Ext.destroy(this.repeater)},onDestroy:function(){if(this.rendered){this.doc.un("mouseover",this.monitorMouseOver,this);this.doc.un("mouseup",this.onMouseUp,this);delete this.doc;delete this.btnEl;Ext.ButtonToggleMgr.unregister(this)}Ext.Button.superclass.onDestroy.call(this)},doAutoWidth:function(){if(this.autoWidth!==false&&this.el&&this.text&&this.width===undefined){this.el.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var a=this.btnEl;if(a&&a.getWidth()>20){a.clip();a.setWidth(Ext.util.TextMetrics.measure(a,this.text).width+a.getFrameWidth("lr"))}}if(this.minWidth){if(this.el.getWidth()a}else{return c.getPageY()>this.btnEl.getRegion().bottom}},onClick:function(b,a){b.preventDefault();if(!this.disabled){if(this.isClickOnArrow(b)){if(this.menu&&!this.menu.isVisible()&&!this.ignoreNextClick){this.showMenu()}this.fireEvent("arrowclick",this,b);if(this.arrowHandler){this.arrowHandler.call(this.scope||this,this,b)}}else{if(this.enableToggle){this.toggle()}this.fireEvent("click",this,b);if(this.handler){this.handler.call(this.scope||this,this,b)}}}},isMenuTriggerOver:function(a){return this.menu&&a.target.tagName==this.arrowSelector},isMenuTriggerOut:function(b,a){return this.menu&&b.target.tagName!=this.arrowSelector}});Ext.reg("splitbutton",Ext.SplitButton);Ext.CycleButton=Ext.extend(Ext.SplitButton,{getItemText:function(a){if(a&&this.showText===true){var b="";if(this.prependText){b+=this.prependText}b+=a.text;return b}return undefined},setActiveItem:function(c,a){if(!Ext.isObject(c)){c=this.menu.getComponent(c)}if(c){if(!this.rendered){this.text=this.getItemText(c);this.iconCls=c.iconCls}else{var b=this.getItemText(c);if(b){this.setText(b)}this.setIconClass(c.iconCls)}this.activeItem=c;if(!c.checked){c.setChecked(true,false)}if(this.forceIcon){this.setIconClass(this.forceIcon)}if(!a){this.fireEvent("change",this,c)}}},getActiveItem:function(){return this.activeItem},initComponent:function(){this.addEvents("change");if(this.changeHandler){this.on("change",this.changeHandler,this.scope||this);delete this.changeHandler}this.itemCount=this.items.length;this.menu={cls:"x-cycle-menu",items:[]};var a=0;Ext.each(this.items,function(c,b){Ext.apply(c,{group:c.group||this.id,itemIndex:b,checkHandler:this.checkHandler,scope:this,checked:c.checked||false});this.menu.items.push(c);if(c.checked){a=b}},this);Ext.CycleButton.superclass.initComponent.call(this);this.on("click",this.toggleSelected,this);this.setActiveItem(a,true)},checkHandler:function(a,b){if(b){this.setActiveItem(a)}},toggleSelected:function(){var a=this.menu;a.render();if(!a.hasLayout){a.doLayout()}var d,b;for(var c=1;cA {@link Ext.KeyNav KeyNav} object which handles navigation keys for this ComboBox. This performs actions + * based on keystrokes typed when the input field is focused.

    + *

    After the ComboBox has been rendered, you may override existing navigation key functionality, + * or add your own based upon key names as specified in the {@link Ext.KeyNav KeyNav} class.

    + *

    The function is executed in the scope (this reference of the ComboBox. Example:

    
    +myCombo.keyNav.esc = function(e) {  // Override ESC handling function
    +    this.collapse();                // Standard behaviour of Ext's ComboBox.
    +    this.setValue(this.startValue); // We reset to starting value on ESC
    +};
    +myCombo.keyNav.tab = function() {   // Override TAB handling function
    +    this.onViewClick(false);        // Select the currently highlighted row
    +};
    +
    + */ this.keyNav = new Ext.KeyNav(this.el, { "up" : function(e){ this.inKeyMode = true; @@ -5644,7 +5669,7 @@ myFormPanel.getForm().submit({ if (f.dataIndex == id || f.id == id || f.getName() == id) { field = f; return false; - } else if (f.isComposite) { + } else if (f.isComposite && f.rendered) { return f.items.each(findMatchingField); } } @@ -5820,6 +5845,13 @@ myFormPanel.getForm().submit({ return this; }, + /** + * Removes all fields from the collection that have been destroyed. + */ + cleanDestroyed : function() { + this.items.filterBy(function(o) { return !!o.isDestroyed; }).each(this.remove, this); + }, + /** * Iterates through the {@link Ext.form.Field Field}s which have been {@link #add add}ed to this BasicForm, * checks them for an id attribute, and calls {@link Ext.form.Field#applyToMarkup} on the existing dom element with that id. @@ -6137,6 +6169,9 @@ Ext.FormPanel = Ext.extend(Ext.Panel, { // If a Container, its already destroyed by the time it gets here. Remove any references to destroyed fields. }else if (c.findBy){ Ext.each(c.findBy(this.isField), this.form.remove, this.form); + if (c.isDestroyed) { + this.form.cleanDestroyed(); + } } } }, @@ -6217,7 +6252,8 @@ Ext.FormPanel = Ext.extend(Ext.Panel, { }); Ext.reg('form', Ext.FormPanel); -Ext.form.FormPanel = Ext.FormPanel;/** +Ext.form.FormPanel = Ext.FormPanel; +/** * @class Ext.form.FieldSet * @extends Ext.Panel * Standard container used for grouping items within a {@link Ext.form.FormPanel form}. @@ -6881,7 +6917,11 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, { Ext.form.HtmlEditor.superclass.setReadOnly.call(this, readOnly); if(this.initialized){ - this.setDesignMode(!readOnly); + if(Ext.isIE){ + this.getEditorBody().contentEditable = !readOnly; + }else{ + this.setDesignMode(!readOnly); + } var bd = this.getEditorBody(); if(bd){ bd.style.cursor = this.readOnly ? 'default' : 'text'; @@ -7060,20 +7100,23 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, { * @param {Boolean} sourceEdit (optional) True for source edit, false for standard */ toggleSourceEdit : function(sourceEditMode){ - var iframeHeight, elHeight; - if(sourceEditMode === undefined){ + var iframeHeight, + elHeight, + ls; + + if (sourceEditMode === undefined) { sourceEditMode = !this.sourceEditMode; } this.sourceEditMode = sourceEditMode === true; var btn = this.tb.getComponent('sourceedit'); - if(btn.pressed !== this.sourceEditMode){ + if (btn.pressed !== this.sourceEditMode) { btn.toggle(this.sourceEditMode); - if(!btn.xtbHidden){ + if (!btn.xtbHidden) { return; } } - if(this.sourceEditMode){ + if (this.sourceEditMode) { // grab the height of the containing panel before we hide the iframe ls = this.getSize(); @@ -7086,9 +7129,10 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, { this.el.dom.removeAttribute('tabIndex'); this.el.focus(); this.el.dom.style.height = iframeHeight + 'px'; - }else{ + } + else { elHeight = parseInt(this.el.dom.style.height, 10); - if(this.initialized){ + if (this.initialized) { this.disableItems(this.readOnly); } this.pushValue(); @@ -7104,7 +7148,7 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, { }, // private used internally - createLink : function(){ + createLink : function() { var url = prompt(this.createLinkText, this.defaultLinkValue); if(url && url != 'http:/'+'/'){ this.relayCmd('createlink', url); @@ -7202,9 +7246,8 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, { if(Ext.isGecko){ // Gecko hack, see: https://bugzilla.mozilla.org/show_bug.cgi?id=232791#c8 this.setDesignMode(false); //toggle off first - + this.setDesignMode(true); } - this.setDesignMode(true); this.fireEvent('push', this, v); } @@ -7759,7 +7802,8 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, { * @hide */ }); -Ext.reg('htmleditor', Ext.form.HtmlEditor);/** +Ext.reg('htmleditor', Ext.form.HtmlEditor); +/** * @class Ext.form.TimeField * @extends Ext.form.ComboBox * Provides a time input field with a time dropdown and automatic time validation. Example usage: @@ -8001,6 +8045,7 @@ Ext.form.SliderField = Ext.extend(Ext.form.Field, { }; Ext.form.SliderField.superclass.onRender.call(this, ct, position); this.wrap = this.el.wrap({cls: 'x-form-field-wrap'}); + this.resizeEl = this.positionEl = this.wrap; this.slider.render(this.wrap); }, @@ -8960,7 +9005,7 @@ Ext.apply(Ext.form.VTypes, { timeMask: /[\d\s:amp]/i }); * - * Another example: + * Another example: *
    
     // custom Vtype for vtype:'IPAddress'
     Ext.apply(Ext.form.VTypes, {
    @@ -8986,7 +9031,7 @@ Ext.form.VTypes = function(){
              * The function used to validate email addresses.  Note that this is a very basic validation -- complete
              * validation per the email RFC specifications is very complex and beyond the scope of this class, although
              * this function can be overridden if a more comprehensive validation scheme is desired.  See the validation
    -         * section of the Wikipedia article on email addresses 
    +         * section of the Wikipedia article on email addresses
              * for additional information.  This implementation is intended to validate the following emails:
              * 'barney@example.de', 'barney.rubble@example.com', 'barney-rubble@example.coop', 'barney+rubble@example.com'
              * .
    @@ -9003,12 +9048,12 @@ Ext.form.VTypes = function(){
              */
             'emailText' : 'This field should be an e-mail address in the format "user@example.com"',
             /**
    -         * The keystroke filter mask to be applied on email input.  See the {@link #email} method for 
    +         * The keystroke filter mask to be applied on email input.  See the {@link #email} method for
              * information about more complex email validation. Defaults to:
              * /[a-z0-9_\.\-@]/i
              * @type RegExp
              */
    -        'emailMask' : /[a-z0-9_\.\-@]/i,
    +        'emailMask' : /[a-z0-9_\.\-@\+]/i,
     
             /**
              * The function used to validate URLs
    @@ -9024,7 +9069,7 @@ Ext.form.VTypes = function(){
              * @type String
              */
             'urlText' : 'This field should be a URL in the format "http:/'+'/www.example.com"',
    -        
    +
             /**
              * The function used to validate alpha values
              * @param {String} value The value
    @@ -9067,4 +9112,4 @@ Ext.form.VTypes = function(){
              */
             'alphanumMask' : /[a-z0-9_]/i
         };
    -}();
    \ No newline at end of file
    +}();
    diff --git a/pkgs/pkg-forms.js b/pkgs/pkg-forms.js
    index 0b5518a4..92b5cd5a 100644
    --- a/pkgs/pkg-forms.js
    +++ b/pkgs/pkg-forms.js
    @@ -1,7 +1,7 @@
     /*
    - * Ext JS Library 3.2.0
    + * Ext JS Library 3.2.1
      * Copyright(c) 2006-2010 Ext JS, Inc.
      * licensing@extjs.com
      * http://www.extjs.com/license
      */
    -Ext.form.Field=Ext.extend(Ext.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",msgTarget:"qtip",msgFx:"normal",readOnly:false,disabled:false,submitValue:true,isFormField:true,msgDisplay:"",hasFocus:false,initComponent:function(){Ext.form.Field.superclass.initComponent.call(this);this.addEvents("focus","blur","specialkey","change","invalid","valid")},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:this.name||this.id||""},onRender:function(c,a){if(!this.el){var b=this.getAutoCreate();if(!b.name){b.name=this.name||this.id}if(this.inputType){b.type=this.inputType}this.autoEl=b}Ext.form.Field.superclass.onRender.call(this,c,a);if(this.submitValue===false){this.el.dom.removeAttribute("name")}var d=this.el.dom.type;if(d){if(d=="password"){d="text"}this.el.addClass("x-form-"+d)}if(this.readOnly){this.setReadOnly(true)}if(this.tabIndex!==undefined){this.el.dom.setAttribute("tabIndex",this.tabIndex)}this.el.addClass([this.fieldClass,this.cls])},getItemCt:function(){return this.itemCt},initValue:function(){if(this.value!==undefined){this.setValue(this.value)}else{if(!Ext.isEmpty(this.el.dom.value)&&this.el.dom.value!=this.emptyText){this.setValue(this.el.dom.value)}}this.originalValue=this.getValue()},isDirty:function(){if(this.disabled||!this.rendered){return false}return String(this.getValue())!==String(this.originalValue)},setReadOnly:function(a){if(this.rendered){this.el.dom.readOnly=a}this.readOnly=a},afterRender:function(){Ext.form.Field.superclass.afterRender.call(this);this.initEvents();this.initValue()},fireKey:function(a){if(a.isSpecialKey()){this.fireEvent("specialkey",this,a)}},reset:function(){this.setValue(this.originalValue);this.clearInvalid()},initEvents:function(){this.mon(this.el,Ext.EventManager.useKeydown?"keydown":"keypress",this.fireKey,this);this.mon(this.el,"focus",this.onFocus,this);this.mon(this.el,"blur",this.onBlur,this,this.inEditor?{buffer:10}:null)},preFocus:Ext.emptyFn,onFocus:function(){this.preFocus();if(this.focusClass){this.el.addClass(this.focusClass)}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this)}},beforeBlur:Ext.emptyFn,onBlur:function(){this.beforeBlur();if(this.focusClass){this.el.removeClass(this.focusClass)}this.hasFocus=false;if(this.validationEvent!==false&&(this.validateOnBlur||this.validationEvent=="blur")){this.validate()}var a=this.getValue();if(String(a)!==String(this.startValue)){this.fireEvent("change",this,a,this.startValue)}this.fireEvent("blur",this);this.postBlur()},postBlur:Ext.emptyFn,isValid:function(a){if(this.disabled){return true}var c=this.preventMark;this.preventMark=a===true;var b=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=c;return b},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true}return false},processValue:function(a){return a},validateValue:function(b){var a=this.getErrors(b)[0];if(a==undefined){return true}else{this.markInvalid(a);return false}},getErrors:function(){return[]},getActiveError:function(){return this.activeError||""},markInvalid:function(c){if(this.rendered&&!this.preventMark){c=c||this.invalidText;var a=this.getMessageHandler();if(a){a.mark(this,c)}else{if(this.msgTarget){this.el.addClass(this.invalidClass);var b=Ext.getDom(this.msgTarget);if(b){b.innerHTML=c;b.style.display=this.msgDisplay}}}}this.setActiveError(c)},clearInvalid:function(){if(this.rendered&&!this.preventMark){this.el.removeClass(this.invalidClass);var a=this.getMessageHandler();if(a){a.clear(this)}else{if(this.msgTarget){this.el.removeClass(this.invalidClass);var b=Ext.getDom(this.msgTarget);if(b){b.innerHTML="";b.style.display="none"}}}}this.unsetActiveError()},setActiveError:function(b,a){this.activeError=b;if(a!==true){this.fireEvent("invalid",this,b)}},unsetActiveError:function(a){delete this.activeError;if(a!==true){this.fireEvent("valid",this)}},getMessageHandler:function(){return Ext.form.MessageTargets[this.msgTarget]},getErrorCt:function(){return this.el.findParent(".x-form-element",5,true)||this.el.findParent(".x-form-field-wrap",5,true)},alignErrorEl:function(){this.errorEl.setWidth(this.getErrorCt().getWidth(true)-20)},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,"tl-tr",[2,0])},getRawValue:function(){var a=this.rendered?this.el.getValue():Ext.value(this.value,"");if(a===this.emptyText){a=""}return a},getValue:function(){if(!this.rendered){return this.value}var a=this.el.getValue();if(a===this.emptyText||a===undefined){a=""}return a},setRawValue:function(a){return this.rendered?(this.el.dom.value=(Ext.isEmpty(a)?"":a)):""},setValue:function(a){this.value=a;if(this.rendered){this.el.dom.value=(Ext.isEmpty(a)?"":a);this.validate()}return this},append:function(a){this.setValue([this.getValue(),a].join(""))}});Ext.form.MessageTargets={qtip:{mark:function(a,b){a.el.addClass(a.invalidClass);a.el.dom.qtip=b;a.el.dom.qclass="x-form-invalid-tip";if(Ext.QuickTips){Ext.QuickTips.enable()}},clear:function(a){a.el.removeClass(a.invalidClass);a.el.dom.qtip=""}},title:{mark:function(a,b){a.el.addClass(a.invalidClass);a.el.dom.title=b},clear:function(a){a.el.dom.title=""}},under:{mark:function(b,c){b.el.addClass(b.invalidClass);if(!b.errorEl){var a=b.getErrorCt();if(!a){b.el.dom.title=c;return}b.errorEl=a.createChild({cls:"x-form-invalid-msg"});b.on("resize",b.alignErrorEl,b);b.on("destroy",function(){Ext.destroy(this.errorEl)},b)}b.alignErrorEl();b.errorEl.update(c);Ext.form.Field.msgFx[b.msgFx].show(b.errorEl,b)},clear:function(a){a.el.removeClass(a.invalidClass);if(a.errorEl){Ext.form.Field.msgFx[a.msgFx].hide(a.errorEl,a)}else{a.el.dom.title=""}}},side:{mark:function(b,c){b.el.addClass(b.invalidClass);if(!b.errorIcon){var a=b.getErrorCt();if(!a){b.el.dom.title=c;return}b.errorIcon=a.createChild({cls:"x-form-invalid-icon"});if(b.ownerCt){b.ownerCt.on("afterlayout",b.alignErrorIcon,b);b.ownerCt.on("expand",b.alignErrorIcon,b)}b.on("resize",b.alignErrorIcon,b);b.on("destroy",function(){Ext.destroy(this.errorIcon)},b)}b.alignErrorIcon();b.errorIcon.dom.qtip=c;b.errorIcon.dom.qclass="x-form-invalid-tip";b.errorIcon.show()},clear:function(a){a.el.removeClass(a.invalidClass);if(a.errorIcon){a.errorIcon.dom.qtip="";a.errorIcon.hide()}else{a.el.dom.title=""}}}};Ext.form.Field.msgFx={normal:{show:function(a,b){a.setDisplayed("block")},hide:function(a,b){a.setDisplayed(false).update("")}},slide:{show:function(a,b){a.slideIn("t",{stopFx:true})},hide:function(a,b){a.slideOut("t",{stopFx:true,useDisplay:true})}},slideRight:{show:function(a,b){a.fixDisplay();a.alignTo(b.el,"tl-tr");a.slideIn("l",{stopFx:true})},hide:function(a,b){a.slideOut("l",{stopFx:true,useDisplay:true})}}};Ext.reg("field",Ext.form.Field);Ext.form.TextField=Ext.extend(Ext.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,emptyClass:"x-form-empty-field",initComponent:function(){Ext.form.TextField.superclass.initComponent.call(this);this.addEvents("autosize","keydown","keyup","keypress")},initEvents:function(){Ext.form.TextField.superclass.initEvents.call(this);if(this.validationEvent=="keyup"){this.validationTask=new Ext.util.DelayedTask(this.validate,this);this.mon(this.el,"keyup",this.filterValidation,this)}else{if(this.validationEvent!==false&&this.validationEvent!="blur"){this.mon(this.el,this.validationEvent,this.validate,this,{buffer:this.validationDelay})}}if(this.selectOnFocus||this.emptyText){this.mon(this.el,"mousedown",this.onMouseDown,this);if(this.emptyText){this.applyEmptyText()}}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Ext.form.VTypes[this.vtype+"Mask"]))){this.mon(this.el,"keypress",this.filterKeys,this)}if(this.grow){this.mon(this.el,"keyup",this.onKeyUpBuffered,this,{buffer:50});this.mon(this.el,"click",this.autoSize,this)}if(this.enableKeyEvents){this.mon(this.el,{scope:this,keyup:this.onKeyUp,keydown:this.onKeyDown,keypress:this.onKeyPress})}},onMouseDown:function(a){if(!this.hasFocus){this.mon(this.el,"mouseup",Ext.emptyFn,this,{single:true,preventDefault:true})}},processValue:function(a){if(this.stripCharsRe){var b=a.replace(this.stripCharsRe,"");if(b!==a){this.setRawValue(b);return b}}return a},filterValidation:function(a){if(!a.isNavKeyPress()){this.validationTask.delay(this.validationDelay)}},onDisable:function(){Ext.form.TextField.superclass.onDisable.call(this);if(Ext.isIE){this.el.dom.unselectable="on"}},onEnable:function(){Ext.form.TextField.superclass.onEnable.call(this);if(Ext.isIE){this.el.dom.unselectable=""}},onKeyUpBuffered:function(a){if(this.doAutoSize(a)){this.autoSize()}},doAutoSize:function(a){return !a.isNavKeyPress()},onKeyUp:function(a){this.fireEvent("keyup",this,a)},onKeyDown:function(a){this.fireEvent("keydown",this,a)},onKeyPress:function(a){this.fireEvent("keypress",this,a)},reset:function(){Ext.form.TextField.superclass.reset.call(this);this.applyEmptyText()},applyEmptyText:function(){if(this.rendered&&this.emptyText&&this.getRawValue().length<1&&!this.hasFocus){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass)}},preFocus:function(){var a=this.el;if(this.emptyText){if(a.dom.value==this.emptyText){this.setRawValue("")}a.removeClass(this.emptyClass)}if(this.selectOnFocus){a.dom.select()}},postBlur:function(){this.applyEmptyText()},filterKeys:function(b){if(b.ctrlKey){return}var a=b.getKey();if(Ext.isGecko&&(b.isNavKeyPress()||a==b.BACKSPACE||(a==b.DELETE&&b.button==-1))){return}var c=String.fromCharCode(b.getCharCode());if(!Ext.isGecko&&b.isSpecialKey()&&!c){return}if(!this.maskRe.test(c)){b.stopEvent()}},setValue:function(a){if(this.emptyText&&this.el&&!Ext.isEmpty(a)){this.el.removeClass(this.emptyClass)}Ext.form.TextField.superclass.setValue.apply(this,arguments);this.applyEmptyText();this.autoSize();return this},getErrors:function(a){var d=Ext.form.TextField.superclass.getErrors.apply(this,arguments);a=a||this.processValue(this.getRawValue());if(Ext.isFunction(this.validator)){var c=this.validator(a);if(c!==true){d.push(c)}}if(!this.allowBlank&&(a.length<1||a===this.emptyText)){d.push(this.blankText)}if(a.lengththis.maxLength){d.push(String.format(this.maxLengthText,this.maxLength))}if(this.vtype){var b=Ext.form.VTypes;if(!b[this.vtype](a,this)){d.push(this.vtypeText||b[this.vtype+"Text"])}}if(this.regex&&!this.regex.test(a)){d.push(this.regexText)}return d},selectText:function(g,a){var c=this.getRawValue();var e=false;if(c.length>0){g=g===undefined?0:g;a=a===undefined?c.length:a;var f=this.el.dom;if(f.setSelectionRange){f.setSelectionRange(g,a)}else{if(f.createTextRange){var b=f.createTextRange();b.moveStart("character",g);b.moveEnd("character",a-c.length);b.select()}}e=Ext.isGecko||Ext.isOpera}else{e=true}if(e){this.focus()}},autoSize:function(){if(!this.grow||!this.rendered){return}if(!this.metrics){this.metrics=Ext.util.TextMetrics.createInstance(this.el)}var c=this.el;var b=c.dom.value;var e=document.createElement("div");e.appendChild(document.createTextNode(b));b=e.innerHTML;Ext.removeNode(e);e=null;b+=" ";var a=Math.min(this.growMax,Math.max(this.metrics.getWidth(b)+10,this.growMin));this.el.setWidth(a);this.fireEvent("autosize",this,a)},onDestroy:function(){if(this.validationTask){this.validationTask.cancel();this.validationTask=null}Ext.form.TextField.superclass.onDestroy.call(this)}});Ext.reg("textfield",Ext.form.TextField);Ext.form.TriggerField=Ext.extend(Ext.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},hideTrigger:false,editable:true,readOnly:false,wrapFocusClass:"x-trigger-wrap-focus",autoSize:Ext.emptyFn,monitorTab:true,deferHeight:true,mimicing:false,actionMode:"wrap",defaultTriggerWidth:17,onResize:function(a,c){Ext.form.TriggerField.superclass.onResize.call(this,a,c);var b=this.getTriggerWidth();if(Ext.isNumber(a)){this.el.setWidth(a-b)}this.wrap.setWidth(this.el.getWidth()+b)},getTriggerWidth:function(){var a=this.trigger.getWidth();if(!this.hideTrigger&&!this.readOnly&&a===0){a=this.defaultTriggerWidth}return a},alignErrorIcon:function(){if(this.wrap){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}},onRender:function(b,a){this.doc=Ext.isIE?Ext.getBody():Ext.getDoc();Ext.form.TriggerField.superclass.onRender.call(this,b,a);this.wrap=this.el.wrap({cls:"x-form-field-wrap x-form-field-trigger-wrap"});this.trigger=this.wrap.createChild(this.triggerConfig||{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});this.initTrigger();if(!this.width){this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())}this.resizeEl=this.positionEl=this.wrap},getWidth:function(){return(this.el.getWidth()+this.trigger.getWidth())},updateEditState:function(){if(this.rendered){if(this.readOnly){this.el.dom.readOnly=true;this.el.addClass("x-trigger-noedit");this.mun(this.el,"click",this.onTriggerClick,this);this.trigger.setDisplayed(false)}else{if(!this.editable){this.el.dom.readOnly=true;this.el.addClass("x-trigger-noedit");this.mon(this.el,"click",this.onTriggerClick,this)}else{this.el.dom.readOnly=false;this.el.removeClass("x-trigger-noedit");this.mun(this.el,"click",this.onTriggerClick,this)}this.trigger.setDisplayed(!this.hideTrigger)}this.onResize(this.width||this.wrap.getWidth())}},setHideTrigger:function(a){if(a!=this.hideTrigger){this.hideTrigger=a;this.updateEditState()}},setEditable:function(a){if(a!=this.editable){this.editable=a;this.updateEditState()}},setReadOnly:function(a){if(a!=this.readOnly){this.readOnly=a;this.updateEditState()}},afterRender:function(){Ext.form.TriggerField.superclass.afterRender.call(this);this.updateEditState()},initTrigger:function(){this.mon(this.trigger,"click",this.onTriggerClick,this,{preventDefault:true});this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},onDestroy:function(){Ext.destroy(this.trigger,this.wrap);if(this.mimicing){this.doc.un("mousedown",this.mimicBlur,this)}delete this.doc;Ext.form.TriggerField.superclass.onDestroy.call(this)},onFocus:function(){Ext.form.TriggerField.superclass.onFocus.call(this);if(!this.mimicing){this.wrap.addClass(this.wrapFocusClass);this.mimicing=true;this.doc.on("mousedown",this.mimicBlur,this,{delay:10});if(this.monitorTab){this.on("specialkey",this.checkTab,this)}}},checkTab:function(a,b){if(b.getKey()==b.TAB){this.triggerBlur()}},onBlur:Ext.emptyFn,mimicBlur:function(a){if(!this.isDestroyed&&!this.wrap.contains(a.target)&&this.validateBlur(a)){this.triggerBlur()}},triggerBlur:function(){this.mimicing=false;this.doc.un("mousedown",this.mimicBlur,this);if(this.monitorTab&&this.el){this.un("specialkey",this.checkTab,this)}Ext.form.TriggerField.superclass.onBlur.call(this);if(this.wrap){this.wrap.removeClass(this.wrapFocusClass)}},beforeBlur:Ext.emptyFn,validateBlur:function(a){return true},onTriggerClick:Ext.emptyFn});Ext.form.TwinTriggerField=Ext.extend(Ext.form.TriggerField,{initComponent:function(){Ext.form.TwinTriggerField.superclass.initComponent.call(this);this.triggerConfig={tag:"span",cls:"x-form-twin-triggers",cn:[{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger2Class}]}},getTrigger:function(a){return this.triggers[a]},initTrigger:function(){var a=this.trigger.select(".x-form-trigger",true);var b=this;a.each(function(d,f,c){var e="Trigger"+(c+1);d.hide=function(){var g=b.wrap.getWidth();this.dom.style.display="none";b.el.setWidth(g-b.trigger.getWidth());this["hidden"+e]=true};d.show=function(){var g=b.wrap.getWidth();this.dom.style.display="";b.el.setWidth(g-b.trigger.getWidth());this["hidden"+e]=false};if(this["hide"+e]){d.dom.style.display="none";this["hidden"+e]=true}this.mon(d,"click",this["on"+e+"Click"],this,{preventDefault:true});d.addClassOnOver("x-form-trigger-over");d.addClassOnClick("x-form-trigger-click")},this);this.triggers=a.elements},getTriggerWidth:function(){var a=0;Ext.each(this.triggers,function(d,c){var e="Trigger"+(c+1),b=d.getWidth();if(b===0&&!this["hidden"+e]){a+=this.defaultTriggerWidth}else{a+=b}},this);return a},onDestroy:function(){Ext.destroy(this.triggers);Ext.form.TwinTriggerField.superclass.onDestroy.call(this)},onTrigger1Click:Ext.emptyFn,onTrigger2Click:Ext.emptyFn});Ext.reg("trigger",Ext.form.TriggerField);Ext.form.TextArea=Ext.extend(Ext.form.TextField,{growMin:60,growMax:1000,growAppend:" \n ",enterIsSpecial:false,preventScrollbars:false,onRender:function(b,a){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:100px;height:60px;",autocomplete:"off"}}Ext.form.TextArea.superclass.onRender.call(this,b,a);if(this.grow){this.textSizeEl=Ext.DomHelper.append(document.body,{tag:"pre",cls:"x-form-grow-sizer"});if(this.preventScrollbars){this.el.setStyle("overflow","hidden")}this.el.setHeight(this.growMin)}},onDestroy:function(){Ext.removeNode(this.textSizeEl);Ext.form.TextArea.superclass.onDestroy.call(this)},fireKey:function(a){if(a.isSpecialKey()&&(this.enterIsSpecial||(a.getKey()!=a.ENTER||a.hasModifier()))){this.fireEvent("specialkey",this,a)}},doAutoSize:function(a){return !a.isNavKeyPress()||a.getKey()==a.ENTER},autoSize:function(){if(!this.grow||!this.textSizeEl){return}var c=this.el,a=Ext.util.Format.htmlEncode(c.dom.value),d=this.textSizeEl,b;Ext.fly(d).setWidth(this.el.getWidth());if(a.length<1){a="  "}else{a+=this.growAppend;if(Ext.isIE){a=a.replace(/\n/g," 
    ")}}d.innerHTML=a;b=Math.min(this.growMax,Math.max(d.offsetHeight,this.growMin));if(b!=this.lastHeight){this.lastHeight=b;this.el.setHeight(b);this.fireEvent("autosize",this,b)}}});Ext.reg("textarea",Ext.form.TextArea);Ext.form.NumberField=Ext.extend(Ext.form.TextField,{fieldClass:"x-form-field x-form-num-field",allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",baseChars:"0123456789",initEvents:function(){var a=this.baseChars+"";if(this.allowDecimals){a+=this.decimalSeparator}if(this.allowNegative){a+="-"}this.maskRe=new RegExp("["+Ext.escapeRe(a)+"]");Ext.form.NumberField.superclass.initEvents.call(this)},getErrors:function(b){var c=Ext.form.NumberField.superclass.getErrors.apply(this,arguments);b=b||this.processValue(this.getRawValue());if(b.length<1){return c}b=String(b).replace(this.decimalSeparator,".");if(isNaN(b)){c.push(String.format(this.nanText,b))}var a=this.parseValue(b);if(athis.maxValue){c.push(String.format(this.maxText,this.maxValue))}return c},getValue:function(){return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this)))},setValue:function(a){a=Ext.isNumber(a)?a:parseFloat(String(a).replace(this.decimalSeparator,"."));a=isNaN(a)?"":String(a).replace(".",this.decimalSeparator);return Ext.form.NumberField.superclass.setValue.call(this,a)},setMinValue:function(a){this.minValue=Ext.num(a,Number.NEGATIVE_INFINITY)},setMaxValue:function(a){this.maxValue=Ext.num(a,Number.MAX_VALUE)},parseValue:function(a){a=parseFloat(String(a).replace(this.decimalSeparator,"."));return isNaN(a)?"":a},fixPrecision:function(b){var a=isNaN(b);if(!this.allowDecimals||this.decimalPrecision==-1||a||!b){return a?"":b}return parseFloat(parseFloat(b).toFixed(this.decimalPrecision))},beforeBlur:function(){var a=this.parseValue(this.getRawValue());if(!Ext.isEmpty(a)){this.setValue(this.fixPrecision(a))}}});Ext.reg("numberfield",Ext.form.NumberField);Ext.form.DateField=Ext.extend(Ext.form.TriggerField,{format:"m/d/Y",altFormats:"m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d",disabledDaysText:"Disabled",disabledDatesText:"Disabled",minText:"The date in this field must be equal to or after {0}",maxText:"The date in this field must be equal to or before {0}",invalidText:"{0} is not a valid date - it must be in the format {1}",triggerClass:"x-form-date-trigger",showToday:true,defaultAutoCreate:{tag:"input",type:"text",size:"10",autocomplete:"off"},initTime:"12",initTimeFormat:"H",safeParse:function(b,c){if(/[gGhH]/.test(c.replace(/(\\.)/g,""))){return Date.parseDate(b,c)}else{var a=Date.parseDate(b+" "+this.initTime,c+" "+this.initTimeFormat);if(a){return a.clearTime()}}},initComponent:function(){Ext.form.DateField.superclass.initComponent.call(this);this.addEvents("select");if(Ext.isString(this.minValue)){this.minValue=this.parseDate(this.minValue)}if(Ext.isString(this.maxValue)){this.maxValue=this.parseDate(this.maxValue)}this.disabledDatesRE=null;this.initDisabledDays()},initEvents:function(){Ext.form.DateField.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{down:function(a){this.onTriggerClick()},scope:this,forceKeyDown:true})},initDisabledDays:function(){if(this.disabledDates){var b=this.disabledDates,a=b.length-1,c="(?:";Ext.each(b,function(f,e){c+=Ext.isDate(f)?"^"+Ext.escapeRe(f.dateFormat(this.format))+"$":b[e];if(e!=a){c+="|"}},this);this.disabledDatesRE=new RegExp(c+")")}},setDisabledDates:function(a){this.disabledDates=a;this.initDisabledDays();if(this.menu){this.menu.picker.setDisabledDates(this.disabledDatesRE)}},setDisabledDays:function(a){this.disabledDays=a;if(this.menu){this.menu.picker.setDisabledDays(a)}},setMinValue:function(a){this.minValue=(Ext.isString(a)?this.parseDate(a):a);if(this.menu){this.menu.picker.setMinDate(this.minValue)}},setMaxValue:function(a){this.maxValue=(Ext.isString(a)?this.parseDate(a):a);if(this.menu){this.menu.picker.setMaxDate(this.maxValue)}},getErrors:function(e){var g=Ext.form.DateField.superclass.getErrors.apply(this,arguments);e=this.formatDate(e||this.processValue(this.getRawValue()));if(e.length<1){return g}var c=e;e=this.parseDate(e);if(!e){g.push(String.format(this.invalidText,c,this.format));return g}var f=e.getTime();if(this.minValue&&fthis.maxValue.getTime()){g.push(String.format(this.maxText,this.formatDate(this.maxValue)))}if(this.disabledDays){var a=e.getDay();for(var b=0;b
    {'+this.displayField+"}
    "}this.view=new Ext.DataView({applyTo:this.innerList,tpl:this.tpl,singleSelect:true,selectedClass:this.selectedClass,itemSelector:this.itemSelector||"."+a+"-item",emptyText:this.listEmptyText,deferEmptyText:false});this.mon(this.view,{containerclick:this.onViewClick,click:this.onViewClick,scope:this});this.bindStore(this.store,true);if(this.resizable){this.resizer=new Ext.Resizable(this.list,{pinned:true,handles:"se"});this.mon(this.resizer,"resize",function(g,e,f){this.maxHeight=f-this.handleHeight-this.list.getFrameWidth("tb")-this.assetHeight;this.listWidth=e;this.innerList.setWidth(e-this.list.getFrameWidth("lr"));this.restrictHeight()},this);this[this.pageSize?"footer":"innerList"].setStyle("margin-bottom",this.handleHeight+"px")}}},getListParent:function(){return document.body},getStore:function(){return this.store},bindStore:function(a,b){if(this.store&&!b){if(this.store!==a&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.collapse,this)}if(!a){this.store=null;if(this.view){this.view.bindStore(null)}if(this.pageTb){this.pageTb.bindStore(null)}}}if(a){if(!b){this.lastQuery=null;if(this.pageTb){this.pageTb.bindStore(a)}}this.store=Ext.StoreMgr.lookup(a);this.store.on({scope:this,beforeload:this.onBeforeLoad,load:this.onLoad,exception:this.collapse});if(this.view){this.view.bindStore(a)}}},reset:function(){Ext.form.ComboBox.superclass.reset.call(this);if(this.clearFilterOnReset&&this.mode=="local"){this.store.clearFilter()}},initEvents:function(){Ext.form.ComboBox.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{up:function(a){this.inKeyMode=true;this.selectPrev()},down:function(a){if(!this.isExpanded()){this.onTriggerClick()}else{this.inKeyMode=true;this.selectNext()}},enter:function(a){this.onViewClick()},esc:function(a){this.collapse()},tab:function(a){if(this.forceSelection===true){this.collapse()}else{this.onViewClick(false)}return true},scope:this,doRelay:function(c,b,a){if(a=="down"||this.scope.isExpanded()){var d=Ext.KeyNav.prototype.doRelay.apply(this,arguments);if(!Ext.isIE&&Ext.EventManager.useKeydown){this.scope.fireKey(c)}return d}return true},forceKeyDown:true,defaultEventAction:"stopEvent"});this.queryDelay=Math.max(this.queryDelay||10,this.mode=="local"?10:250);this.dqTask=new Ext.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Ext.util.DelayedTask(this.onTypeAhead,this)}if(!this.enableKeyEvents){this.mon(this.el,"keyup",this.onKeyUp,this)}},onDestroy:function(){if(this.dqTask){this.dqTask.cancel();this.dqTask=null}this.bindStore(null);Ext.destroy(this.resizer,this.view,this.pageTb,this.list);Ext.destroyMembers(this,"hiddenField");Ext.form.ComboBox.superclass.onDestroy.call(this)},fireKey:function(a){if(!this.isExpanded()){Ext.form.ComboBox.superclass.fireKey.call(this,a)}},onResize:function(a,b){Ext.form.ComboBox.superclass.onResize.apply(this,arguments);if(!isNaN(a)&&this.isVisible()&&this.list){this.doResize(a)}else{this.bufferSize=a}},doResize:function(a){if(!Ext.isDefined(this.listWidth)){var b=Math.max(a,this.minListWidth);this.list.setWidth(b);this.innerList.setWidth(b-this.list.getFrameWidth("lr"))}},onEnable:function(){Ext.form.ComboBox.superclass.onEnable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=false}},onDisable:function(){Ext.form.ComboBox.superclass.onDisable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=true}},onBeforeLoad:function(){if(!this.hasFocus){return}this.innerList.update(this.loadingText?'
    '+this.loadingText+"
    ":"");this.restrictHeight();this.selectedIndex=-1},onLoad:function(){if(!this.hasFocus){return}if(this.store.getCount()>0||this.listEmptyText){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable){this.el.dom.select()}if(this.autoSelect!==false&&!this.selectByValue(this.value,true)){this.select(0,true)}}else{if(this.autoSelect!==false){this.selectNext()}if(this.typeAhead&&this.lastKey!=Ext.EventObject.BACKSPACE&&this.lastKey!=Ext.EventObject.DELETE){this.taTask.delay(this.typeAheadDelay)}}}else{this.collapse()}},onTypeAhead:function(){if(this.store.getCount()>0){var b=this.store.getAt(0);var c=b.data[this.displayField];var a=c.length;var d=this.getRawValue().length;if(d!=a){this.setRawValue(c);this.selectText(d,c.length)}}},assertValue:function(){var b=this.getRawValue(),a=this.findRecord(this.displayField,b);if(!a&&this.forceSelection){if(b.length>0&&b!=this.emptyText){this.el.dom.value=Ext.value(this.lastSelectionText,"");this.applyEmptyText()}else{this.clearValue()}}else{if(a){if(b==a.get(this.displayField)&&this.value==a.get(this.valueField)){return}b=a.get(this.valueField||this.displayField)}this.setValue(b)}},onSelect:function(a,b){if(this.fireEvent("beforeselect",this,a,b)!==false){this.setValue(a.data[this.valueField||this.displayField]);this.collapse();this.fireEvent("select",this,a,b)}},getName:function(){var a=this.hiddenField;return a&&a.name?a.name:this.hiddenName||Ext.form.ComboBox.superclass.getName.call(this)},getValue:function(){if(this.valueField){return Ext.isDefined(this.value)?this.value:""}else{return Ext.form.ComboBox.superclass.getValue.call(this)}},clearValue:function(){if(this.hiddenField){this.hiddenField.value=""}this.setRawValue("");this.lastSelectionText="";this.applyEmptyText();this.value=""},setValue:function(a){var c=a;if(this.valueField){var b=this.findRecord(this.valueField,a);if(b){c=b.data[this.displayField]}else{if(Ext.isDefined(this.valueNotFoundText)){c=this.valueNotFoundText}}}this.lastSelectionText=c;if(this.hiddenField){this.hiddenField.value=Ext.value(a,"")}Ext.form.ComboBox.superclass.setValue.call(this,c);this.value=a;return this},findRecord:function(c,b){var a;if(this.store.getCount()>0){this.store.each(function(d){if(d.data[c]==b){a=d;return false}})}return a},onViewMove:function(b,a){this.inKeyMode=false},onViewOver:function(d,b){if(this.inKeyMode){return}var c=this.view.findItemFromChild(b);if(c){var a=this.view.indexOf(c);this.select(a,false)}},onViewClick:function(b){var a=this.view.getSelectedIndexes()[0],c=this.store,d=c.getAt(a);if(d){this.onSelect(d,a)}else{this.collapse()}if(b!==false){this.el.focus()}},restrictHeight:function(){this.innerList.dom.style.height="";var b=this.innerList.dom,e=this.list.getFrameWidth("tb")+(this.resizable?this.handleHeight:0)+this.assetHeight,c=Math.max(b.clientHeight,b.offsetHeight,b.scrollHeight),a=this.getPosition()[1]-Ext.getBody().getScroll().top,f=Ext.lib.Dom.getViewHeight()-a-this.getSize().height,d=Math.max(a,f,this.minHeight||0)-this.list.shadowOffset-e-5;c=Math.min(c,d,this.maxHeight);this.innerList.setHeight(c);this.list.beginUpdate();this.list.setHeight(c+e);this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));this.list.endUpdate()},isExpanded:function(){return this.list&&this.list.isVisible()},selectByValue:function(a,c){if(!Ext.isEmpty(a,true)){var b=this.findRecord(this.valueField||this.displayField,a);if(b){this.select(this.store.indexOf(b),c);return true}}return false},select:function(a,c){this.selectedIndex=a;this.view.select(a);if(c!==false){var b=this.view.getNode(a);if(b){this.innerList.scrollChildIntoView(b,false)}}},selectNext:function(){var a=this.store.getCount();if(a>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex!==0){this.select(this.selectedIndex-1)}}}},onKeyUp:function(b){var a=b.getKey();if(this.editable!==false&&this.readOnly!==true&&(a==b.BACKSPACE||!b.isSpecialKey())){this.lastKey=a;this.dqTask.delay(this.queryDelay)}Ext.form.ComboBox.superclass.onKeyUp.call(this,b)},validateBlur:function(){return !this.list||!this.list.isVisible()},initQuery:function(){this.doQuery(this.getRawValue())},beforeBlur:function(){this.assertValue()},postBlur:function(){Ext.form.ComboBox.superclass.postBlur.call(this);this.collapse();this.inKeyMode=false},doQuery:function(c,b){c=Ext.isEmpty(c)?"":c;var a={query:c,forceAll:b,combo:this,cancel:false};if(this.fireEvent("beforequery",a)===false||a.cancel){return false}c=a.query;b=a.forceAll;if(b===true||(c.length>=this.minChars)){if(this.lastQuery!==c){this.lastQuery=c;if(this.mode=="local"){this.selectedIndex=-1;if(b){this.store.clearFilter()}else{this.store.filter(this.displayField,c)}this.onLoad()}else{this.store.baseParams[this.queryParam]=c;this.store.load({params:this.getParams(c)});this.expand()}}else{this.selectedIndex=-1;this.onLoad()}}},getParams:function(a){var b={};if(this.pageSize){b.start=0;b.limit=this.pageSize}return b},collapse:function(){if(!this.isExpanded()){return}this.list.hide();Ext.getDoc().un("mousewheel",this.collapseIf,this);Ext.getDoc().un("mousedown",this.collapseIf,this);this.fireEvent("collapse",this)},collapseIf:function(a){if(!this.isDestroyed&&!a.within(this.wrap)&&!a.within(this.list)){this.collapse()}},expand:function(){if(this.isExpanded()||!this.hasFocus){return}if(this.title||this.pageSize){this.assetHeight=0;if(this.title){this.assetHeight+=this.header.getHeight()}if(this.pageSize){this.assetHeight+=this.footer.getHeight()}}if(this.bufferSize){this.doResize(this.bufferSize);delete this.bufferSize}this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));var b=Ext.getDom(this.getListParent()||Ext.getBody()),a=parseInt(Ext.fly(b).getStyle("z-index"),10);if(!a){a=this.getParentZIndex()}if(a){this.list.setZIndex(a+5)}this.list.show();if(Ext.isGecko2){this.innerList.setOverflow("auto")}this.mon(Ext.getDoc(),{scope:this,mousewheel:this.collapseIf,mousedown:this.collapseIf});this.fireEvent("expand",this)},onTriggerClick:function(){if(this.readOnly||this.disabled){return}if(this.isExpanded()){this.collapse();this.el.focus()}else{this.onFocus({});if(this.triggerAction=="all"){this.doQuery(this.allQuery,true)}else{this.doQuery(this.getRawValue())}this.el.focus()}}});Ext.reg("combo",Ext.form.ComboBox);Ext.form.Checkbox=Ext.extend(Ext.form.Field,{focusClass:undefined,fieldClass:"x-form-field",checked:false,boxLabel:" ",defaultAutoCreate:{tag:"input",type:"checkbox",autocomplete:"off"},actionMode:"wrap",initComponent:function(){Ext.form.Checkbox.superclass.initComponent.call(this);this.addEvents("check")},onResize:function(){Ext.form.Checkbox.superclass.onResize.apply(this,arguments);if(!this.boxLabel&&!this.fieldLabel){this.el.alignTo(this.wrap,"c-c")}},initEvents:function(){Ext.form.Checkbox.superclass.initEvents.call(this);this.mon(this.el,{scope:this,click:this.onClick,change:this.onClick})},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,onRender:function(b,a){Ext.form.Checkbox.superclass.onRender.call(this,b,a);if(this.inputValue!==undefined){this.el.dom.value=this.inputValue}this.wrap=this.el.wrap({cls:"x-form-check-wrap"});if(this.boxLabel){this.wrap.createChild({tag:"label",htmlFor:this.el.id,cls:"x-form-cb-label",html:this.boxLabel})}if(this.checked){this.setValue(true)}else{this.checked=this.el.dom.checked}if(Ext.isIE){this.wrap.repaint()}this.resizeEl=this.positionEl=this.wrap},onDestroy:function(){Ext.destroy(this.wrap);Ext.form.Checkbox.superclass.onDestroy.call(this)},initValue:function(){this.originalValue=this.getValue()},getValue:function(){if(this.rendered){return this.el.dom.checked}return this.checked},onClick:function(){if(this.el.dom.checked!=this.checked){this.setValue(this.el.dom.checked)}},setValue:function(a){var b=this.checked;this.checked=(a===true||a==="true"||a=="1"||String(a).toLowerCase()=="on");if(this.rendered){this.el.dom.checked=this.checked;this.el.dom.defaultChecked=this.checked}if(b!=this.checked){this.fireEvent("check",this,this.checked);if(this.handler){this.handler.call(this.scope||this,this,this.checked)}}return this}});Ext.reg("checkbox",Ext.form.Checkbox);Ext.form.CheckboxGroup=Ext.extend(Ext.form.Field,{columns:"auto",vertical:false,allowBlank:true,blankText:"You must select at least one item in this group",defaultType:"checkbox",groupCls:"x-form-check-group",initComponent:function(){this.addEvents("change");this.on("change",this.validate,this);Ext.form.CheckboxGroup.superclass.initComponent.call(this)},onRender:function(h,f){if(!this.el){var o={autoEl:{id:this.id},cls:this.groupCls,layout:"column",renderTo:h,bufferResize:false};var a={xtype:"container",defaultType:this.defaultType,layout:"form",defaults:{hideLabel:true,anchor:"100%"}};if(this.items[0].items){Ext.apply(o,{layoutConfig:{columns:this.items.length},defaults:this.defaults,items:this.items});for(var e=0,k=this.items.length;e0&&e%q==0){n++}if(this.items[e].fieldLabel){this.items[e].hideLabel=false}m[n].items.push(this.items[e])}}else{for(var e=0,k=this.items.length;e-1){b.setValue(true)}})},getBox:function(b){var a=null;this.eachItem(function(c){if(b==c||c.dataIndex==b||c.id==b||c.getName()==b){a=c;return false}});return a},getValue:function(){var a=[];this.eachItem(function(b){if(b.checked){a.push(b)}});return a},eachItem:function(b,a){if(this.items&&this.items.each){this.items.each(b,a||this)}},getRawValue:Ext.emptyFn,setRawValue:Ext.emptyFn});Ext.reg("checkboxgroup",Ext.form.CheckboxGroup);Ext.form.CompositeField=Ext.extend(Ext.form.Field,{defaultMargins:"0 5 0 0",skipLastItemMargin:true,isComposite:true,combineErrors:true,initComponent:function(){var e=[],a=this.items,d;for(var c=0,b=a.length;c")},sortErrors:function(){var a=this.items;this.fieldErrors.sort("ASC",function(f,d){var c=function(b){return function(h){return h.getName()==b}};var g=a.findIndexBy(c(f.field)),e=a.findIndexBy(c(d.field));return g1){var a=this.getBox(c);if(a){a.setValue(b);if(a.checked){this.eachItem(function(d){if(d!==a){d.setValue(false)}})}}}else{this.setValueForItem(c)}},setValueForItem:function(a){a=String(a).split(",")[0];this.eachItem(function(b){b.setValue(a==b.inputValue)})},fireChecked:function(){if(!this.checkTask){this.checkTask=new Ext.util.DelayedTask(this.bufferChecked,this)}this.checkTask.delay(10)},bufferChecked:function(){var a=null;this.eachItem(function(b){if(b.checked){a=b;return false}});this.fireEvent("change",this,a)},onDestroy:function(){if(this.checkTask){this.checkTask.cancel();this.checkTask=null}Ext.form.RadioGroup.superclass.onDestroy.call(this)}});Ext.reg("radiogroup",Ext.form.RadioGroup);Ext.form.Hidden=Ext.extend(Ext.form.Field,{inputType:"hidden",onRender:function(){Ext.form.Hidden.superclass.onRender.apply(this,arguments)},initEvents:function(){this.originalValue=this.getValue()},setSize:Ext.emptyFn,setWidth:Ext.emptyFn,setHeight:Ext.emptyFn,setPosition:Ext.emptyFn,setPagePosition:Ext.emptyFn,markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn});Ext.reg("hidden",Ext.form.Hidden);Ext.form.BasicForm=Ext.extend(Ext.util.Observable,{constructor:function(b,a){Ext.apply(this,a);if(Ext.isString(this.paramOrder)){this.paramOrder=this.paramOrder.split(/[\s,|]/)}this.items=new Ext.util.MixedCollection(false,function(c){return c.getItemId()});this.addEvents("beforeaction","actionfailed","actioncomplete");if(b){this.initEl(b)}Ext.form.BasicForm.superclass.constructor.call(this)},timeout:30,paramOrder:undefined,paramsAsHash:false,waitTitle:"Please Wait...",activeAction:null,trackResetOnLoad:false,initEl:function(a){this.el=Ext.get(a);this.id=this.el.id||Ext.id();if(!this.standardSubmit){this.el.on("submit",this.onSubmit,this)}this.el.addClass("x-form")},getEl:function(){return this.el},onSubmit:function(a){a.stopEvent()},destroy:function(a){if(a!==true){this.items.each(function(b){Ext.destroy(b)});Ext.destroy(this.el)}this.items.clear();this.purgeListeners()},isValid:function(){var a=true;this.items.each(function(b){if(!b.validate()){a=false}});return a},isDirty:function(){var a=false;this.items.each(function(b){if(b.isDirty()){a=true;return false}});return a},doAction:function(b,a){if(Ext.isString(b)){b=new Ext.form.Action.ACTION_TYPES[b](this,a)}if(this.fireEvent("beforeaction",this,b)!==false){this.beforeAction(b);b.run.defer(100,b)}return this},submit:function(b){b=b||{};if(this.standardSubmit){var a=b.clientValidation===false||this.isValid();if(a){var c=this.el.dom;if(this.url&&Ext.isEmpty(c.action)){c.action=this.url}c.submit()}return a}var d=String.format("{0}submit",this.api?"direct":"");this.doAction(d,b);return this},load:function(a){var b=String.format("{0}load",this.api?"direct":"");this.doAction(b,a);return this},updateRecord:function(b){b.beginEdit();var a=b.fields;a.each(function(c){var d=this.findField(c.name);if(d){b.set(c.name,d.getValue())}},this);b.endEdit();return this},loadRecord:function(a){this.setValues(a.data);return this},beforeAction:function(a){this.items.each(function(c){if(c.isFormField&&c.syncValue){c.syncValue()}});var b=a.options;if(b.waitMsg){if(this.waitMsgTarget===true){this.el.mask(b.waitMsg,"x-mask-loading")}else{if(this.waitMsgTarget){this.waitMsgTarget=Ext.get(this.waitMsgTarget);this.waitMsgTarget.mask(b.waitMsg,"x-mask-loading")}else{Ext.MessageBox.wait(b.waitMsg,b.waitTitle||this.waitTitle)}}}},afterAction:function(a,c){this.activeAction=null;var b=a.options;if(b.waitMsg){if(this.waitMsgTarget===true){this.el.unmask()}else{if(this.waitMsgTarget){this.waitMsgTarget.unmask()}else{Ext.MessageBox.updateProgress(1);Ext.MessageBox.hide()}}}if(c){if(b.reset){this.reset()}Ext.callback(b.success,b.scope,[this,a]);this.fireEvent("actioncomplete",this,a)}else{Ext.callback(b.failure,b.scope,[this,a]);this.fireEvent("actionfailed",this,a)}},findField:function(c){var b=this.items.get(c);if(!Ext.isObject(b)){var a=function(d){if(d.isFormField){if(d.dataIndex==c||d.id==c||d.getName()==c){b=d;return false}else{if(d.isComposite){return d.items.each(a)}}}};this.items.each(a)}return b||null},markInvalid:function(h){if(Ext.isArray(h)){for(var c=0,a=h.length;c':">"),c,"")}return d.join("")},createToolbar:function(e){var c=[];var a=Ext.QuickTips&&Ext.QuickTips.isEnabled();function d(i,g,h){return{itemId:i,cls:"x-btn-icon",iconCls:"x-edit-"+i,enableToggle:g!==false,scope:e,handler:h||e.relayBtnCmd,clickEvent:"mousedown",tooltip:a?e.buttonTips[i]||undefined:undefined,overflowText:e.buttonTips[i].title||undefined,tabIndex:-1}}if(this.enableFont&&!Ext.isSafari2){var f=new Ext.Toolbar.Item({autoEl:{tag:"select",cls:"x-font-select",html:this.createFontOptions()}});c.push(f,"-")}if(this.enableFormat){c.push(d("bold"),d("italic"),d("underline"))}if(this.enableFontSize){c.push("-",d("increasefontsize",false,this.adjustFont),d("decreasefontsize",false,this.adjustFont))}if(this.enableColors){c.push("-",{itemId:"forecolor",cls:"x-btn-icon",iconCls:"x-edit-forecolor",clickEvent:"mousedown",tooltip:a?e.buttonTips.forecolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({allowReselect:true,focus:Ext.emptyFn,value:"000000",plain:true,listeners:{scope:this,select:function(h,g){this.execCmd("forecolor",Ext.isWebKit||Ext.isIE?"#"+g:g);this.deferFocus()}},clickEvent:"mousedown"})},{itemId:"backcolor",cls:"x-btn-icon",iconCls:"x-edit-backcolor",clickEvent:"mousedown",tooltip:a?e.buttonTips.backcolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({focus:Ext.emptyFn,value:"FFFFFF",plain:true,allowReselect:true,listeners:{scope:this,select:function(h,g){if(Ext.isGecko){this.execCmd("useCSS",false);this.execCmd("hilitecolor",g);this.execCmd("useCSS",true);this.deferFocus()}else{this.execCmd(Ext.isOpera?"hilitecolor":"backcolor",Ext.isWebKit||Ext.isIE?"#"+g:g);this.deferFocus()}}},clickEvent:"mousedown"})})}if(this.enableAlignments){c.push("-",d("justifyleft"),d("justifycenter"),d("justifyright"))}if(!Ext.isSafari2){if(this.enableLinks){c.push("-",d("createlink",false,this.createLink))}if(this.enableLists){c.push("-",d("insertorderedlist"),d("insertunorderedlist"))}if(this.enableSourceEdit){c.push("-",d("sourceedit",true,function(g){this.toggleSourceEdit(!this.sourceEditMode)}))}}var b=new Ext.Toolbar({renderTo:this.wrap.dom.firstChild,items:c});if(f){this.fontSelect=f.el;this.mon(this.fontSelect,"change",function(){var g=this.fontSelect.dom.value;this.relayCmd("fontname",g);this.deferFocus()},this)}this.mon(b.el,"click",function(g){g.preventDefault()});this.tb=b;this.tb.doLayout()},onDisable:function(){this.wrap.mask();Ext.form.HtmlEditor.superclass.onDisable.call(this)},onEnable:function(){this.wrap.unmask();Ext.form.HtmlEditor.superclass.onEnable.call(this)},setReadOnly:function(b){Ext.form.HtmlEditor.superclass.setReadOnly.call(this,b);if(this.initialized){this.setDesignMode(!b);var a=this.getEditorBody();if(a){a.style.cursor=this.readOnly?"default":"text"}this.disableItems(b)}},getDocMarkup:function(){var a=Ext.fly(this.iframe).getHeight()-this.iframePad*2;return String.format('',this.iframePad,a)},getEditorBody:function(){var a=this.getDoc();return a.body||a.documentElement},getDoc:function(){return Ext.isIE?this.getWin().document:(this.iframe.contentDocument||this.getWin().document)},getWin:function(){return Ext.isIE?this.iframe.contentWindow:window.frames[this.iframe.name]},onRender:function(b,a){Ext.form.HtmlEditor.superclass.onRender.call(this,b,a);this.el.dom.style.border="0 none";this.el.dom.setAttribute("tabIndex",-1);this.el.addClass("x-hidden");if(Ext.isIE){this.el.applyStyles("margin-top:-1px;margin-bottom:-1px;")}this.wrap=this.el.wrap({cls:"x-html-editor-wrap",cn:{cls:"x-html-editor-tb"}});this.createToolbar(this);this.disableItems(true);this.tb.doLayout();this.createIFrame();if(!this.width){var c=this.el.getSize();this.setSize(c.width,this.height||c.height)}this.resizeEl=this.positionEl=this.wrap},createIFrame:function(){var a=document.createElement("iframe");a.name=Ext.id();a.frameBorder="0";a.style.overflow="auto";this.wrap.dom.appendChild(a);this.iframe=a;this.monitorTask=Ext.TaskMgr.start({run:this.checkDesignMode,scope:this,interval:100})},initFrame:function(){Ext.TaskMgr.stop(this.monitorTask);var b=this.getDoc();this.win=this.getWin();b.open();b.write(this.getDocMarkup());b.close();var a={run:function(){var c=this.getDoc();if(c.body||c.readyState=="complete"){Ext.TaskMgr.stop(a);this.setDesignMode(true);this.initEditor.defer(10,this)}},interval:10,duration:10000,scope:this};Ext.TaskMgr.start(a)},checkDesignMode:function(){if(this.wrap&&this.wrap.dom.offsetWidth){var a=this.getDoc();if(!a){return}if(!a.editorInitialized||this.getDesignMode()!="on"){this.initFrame()}}},setDesignMode:function(b){var a;if(a=this.getDoc()){if(this.readOnly){b=false}a.designMode=(/on|true/i).test(String(b).toLowerCase())?"on":"off"}},getDesignMode:function(){var a=this.getDoc();if(!a){return""}return String(a.designMode).toLowerCase()},disableItems:function(a){if(this.fontSelect){this.fontSelect.dom.disabled=a}this.tb.items.each(function(b){if(b.getItemId()!="sourceedit"){b.setDisabled(a)}})},onResize:function(b,c){Ext.form.HtmlEditor.superclass.onResize.apply(this,arguments);if(this.el&&this.iframe){if(Ext.isNumber(b)){var e=b-this.wrap.getFrameWidth("lr");this.el.setWidth(e);this.tb.setWidth(e);this.iframe.style.width=Math.max(e,0)+"px"}if(Ext.isNumber(c)){var a=c-this.wrap.getFrameWidth("tb")-this.tb.el.getHeight();this.el.setHeight(a);this.iframe.style.height=Math.max(a,0)+"px";var d=this.getEditorBody();if(d){d.style.height=Math.max((a-(this.iframePad*2)),0)+"px"}}}},toggleSourceEdit:function(b){var d,a;if(b===undefined){b=!this.sourceEditMode}this.sourceEditMode=b===true;var c=this.tb.getComponent("sourceedit");if(c.pressed!==this.sourceEditMode){c.toggle(this.sourceEditMode);if(!c.xtbHidden){return}}if(this.sourceEditMode){ls=this.getSize();d=Ext.get(this.iframe).getHeight();this.disableItems(true);this.syncValue();this.iframe.className="x-hidden";this.el.removeClass("x-hidden");this.el.dom.removeAttribute("tabIndex");this.el.focus();this.el.dom.style.height=d+"px"}else{a=parseInt(this.el.dom.style.height,10);if(this.initialized){this.disableItems(this.readOnly)}this.pushValue();this.iframe.className="";this.el.addClass("x-hidden");this.el.dom.setAttribute("tabIndex",-1);this.deferFocus();this.setSize(ls);this.iframe.style.height=a+"px"}this.fireEvent("editmodechange",this,this.sourceEditMode)},createLink:function(){var a=prompt(this.createLinkText,this.defaultLinkValue);if(a&&a!="http://"){this.relayCmd("createlink",a)}},initEvents:function(){this.originalValue=this.getValue()},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,setValue:function(a){Ext.form.HtmlEditor.superclass.setValue.call(this,a);this.pushValue();return this},cleanHtml:function(a){a=String(a);if(Ext.isWebKit){a=a.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,"")}if(a.charCodeAt(0)==this.defaultValue.replace(/\D/g,"")){a=a.substring(1)}return a},syncValue:function(){if(this.initialized){var d=this.getEditorBody();var c=d.innerHTML;if(Ext.isWebKit){var b=d.getAttribute("style");var a=b.match(/text-align:(.*?);/i);if(a&&a[1]){c='
    '+c+"
    "}}c=this.cleanHtml(c);if(this.fireEvent("beforesync",this,c)!==false){this.el.dom.value=c;this.fireEvent("sync",this,c)}}},getValue:function(){this[this.sourceEditMode?"pushValue":"syncValue"]();return Ext.form.HtmlEditor.superclass.getValue.call(this)},pushValue:function(){if(this.initialized){var a=this.el.dom.value;if(!this.activated&&a.length<1){a=this.defaultValue}if(this.fireEvent("beforepush",this,a)!==false){this.getEditorBody().innerHTML=a;if(Ext.isGecko){this.setDesignMode(false)}this.setDesignMode(true);this.fireEvent("push",this,a)}}},deferFocus:function(){this.focus.defer(10,this)},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus()}else{this.el.focus()}},initEditor:function(){try{var c=this.getEditorBody(),a=this.el.getStyles("font-size","font-family","background-image","background-repeat","background-color","color"),f,b;a["background-attachment"]="fixed";c.bgProperties="fixed";Ext.DomHelper.applyStyles(c,a);f=this.getDoc();if(f){try{Ext.EventManager.removeAll(f)}catch(d){}}b=this.onEditorEvent.createDelegate(this);Ext.EventManager.on(f,{mousedown:b,dblclick:b,click:b,keyup:b,buffer:100});if(Ext.isGecko){Ext.EventManager.on(f,"keypress",this.applyCommand,this)}if(Ext.isIE||Ext.isWebKit||Ext.isOpera){Ext.EventManager.on(f,"keydown",this.fixKeys,this)}f.editorInitialized=true;this.initialized=true;this.pushValue();this.setReadOnly(this.readOnly);this.fireEvent("initialize",this)}catch(d){}},onDestroy:function(){if(this.monitorTask){Ext.TaskMgr.stop(this.monitorTask)}if(this.rendered){Ext.destroy(this.tb);var b=this.getDoc();if(b){try{Ext.EventManager.removeAll(b);for(var c in b){delete b[c]}}catch(a){}}if(this.wrap){this.wrap.dom.innerHTML="";this.wrap.remove()}}if(this.el){this.el.removeAllListeners();this.el.remove()}this.purgeListeners()},onFirstFocus:function(){this.activated=true;this.disableItems(this.readOnly);if(Ext.isGecko){this.win.focus();var a=this.win.getSelection();if(!a.focusNode||a.focusNode.nodeType!=3){var b=a.getRangeAt(0);b.selectNodeContents(this.getEditorBody());b.collapse(true);this.deferFocus()}try{this.execCmd("useCSS",true);this.execCmd("styleWithCSS",false)}catch(c){}}this.fireEvent("activate",this)},adjustFont:function(b){var d=b.getItemId()=="increasefontsize"?1:-1,c=this.getDoc(),a=parseInt(c.queryCommandValue("FontSize")||2,10);if((Ext.isSafari&&!Ext.isSafari2)||Ext.isChrome||Ext.isAir){if(a<=10){a=1+d}else{if(a<=13){a=2+d}else{if(a<=16){a=3+d}else{if(a<=18){a=4+d}else{if(a<=24){a=5+d}else{a=6+d}}}}}a=a.constrain(1,6)}else{if(Ext.isSafari){d*=2}a=Math.max(1,a+d)+(Ext.isSafari?"px":0)}this.execCmd("FontSize",a)},onEditorEvent:function(a){this.updateToolbar()},updateToolbar:function(){if(this.readOnly){return}if(!this.activated){this.onFirstFocus();return}var b=this.tb.items.map,c=this.getDoc();if(this.enableFont&&!Ext.isSafari2){var a=(c.queryCommandValue("FontName")||this.defaultFont).toLowerCase();if(a!=this.fontSelect.dom.value){this.fontSelect.dom.value=a}}if(this.enableFormat){b.bold.toggle(c.queryCommandState("bold"));b.italic.toggle(c.queryCommandState("italic"));b.underline.toggle(c.queryCommandState("underline"))}if(this.enableAlignments){b.justifyleft.toggle(c.queryCommandState("justifyleft"));b.justifycenter.toggle(c.queryCommandState("justifycenter"));b.justifyright.toggle(c.queryCommandState("justifyright"))}if(!Ext.isSafari2&&this.enableLists){b.insertorderedlist.toggle(c.queryCommandState("insertorderedlist"));b.insertunorderedlist.toggle(c.queryCommandState("insertunorderedlist"))}Ext.menu.MenuMgr.hideAll();this.syncValue()},relayBtnCmd:function(a){this.relayCmd(a.getItemId())},relayCmd:function(b,a){(function(){this.focus();this.execCmd(b,a);this.updateToolbar()}).defer(10,this)},execCmd:function(b,a){var c=this.getDoc();c.execCommand(b,false,a===undefined?null:a);this.syncValue()},applyCommand:function(b){if(b.ctrlKey){var d=b.getCharCode(),a;if(d>0){d=String.fromCharCode(d);switch(d){case"b":a="bold";break;case"i":a="italic";break;case"u":a="underline";break}if(a){this.win.focus();this.execCmd(a);this.deferFocus();b.preventDefault()}}}},insertAtCursor:function(c){if(!this.activated){return}if(Ext.isIE){this.win.focus();var b=this.getDoc(),a=b.selection.createRange();if(a){a.pasteHTML(c);this.syncValue();this.deferFocus()}}else{this.win.focus();this.execCmd("InsertHTML",c);this.deferFocus()}},fixKeys:function(){if(Ext.isIE){return function(f){var a=f.getKey(),d=this.getDoc(),b;if(a==f.TAB){f.stopEvent();b=d.selection.createRange();if(b){b.collapse(true);b.pasteHTML("    ");this.deferFocus()}}else{if(a==f.ENTER){b=d.selection.createRange();if(b){var c=b.parentElement();if(!c||c.tagName.toLowerCase()!="li"){f.stopEvent();b.pasteHTML("
    ");b.collapse(false);b.select()}}}}}}else{if(Ext.isOpera){return function(b){var a=b.getKey();if(a==b.TAB){b.stopEvent();this.win.focus();this.execCmd("InsertHTML","    ");this.deferFocus()}}}else{if(Ext.isWebKit){return function(b){var a=b.getKey();if(a==b.TAB){b.stopEvent();this.execCmd("InsertText","\t");this.deferFocus()}else{if(a==b.ENTER){b.stopEvent();this.execCmd("InsertHtml","

    ");this.deferFocus()}}}}}}}(),getToolbar:function(){return this.tb},buttonTips:{bold:{title:"Bold (Ctrl+B)",text:"Make the selected text bold.",cls:"x-html-editor-tip"},italic:{title:"Italic (Ctrl+I)",text:"Make the selected text italic.",cls:"x-html-editor-tip"},underline:{title:"Underline (Ctrl+U)",text:"Underline the selected text.",cls:"x-html-editor-tip"},increasefontsize:{title:"Grow Text",text:"Increase the font size.",cls:"x-html-editor-tip"},decreasefontsize:{title:"Shrink Text",text:"Decrease the font size.",cls:"x-html-editor-tip"},backcolor:{title:"Text Highlight Color",text:"Change the background color of the selected text.",cls:"x-html-editor-tip"},forecolor:{title:"Font Color",text:"Change the color of the selected text.",cls:"x-html-editor-tip"},justifyleft:{title:"Align Text Left",text:"Align text to the left.",cls:"x-html-editor-tip"},justifycenter:{title:"Center Text",text:"Center text in the editor.",cls:"x-html-editor-tip"},justifyright:{title:"Align Text Right",text:"Align text to the right.",cls:"x-html-editor-tip"},insertunorderedlist:{title:"Bullet List",text:"Start a bulleted list.",cls:"x-html-editor-tip"},insertorderedlist:{title:"Numbered List",text:"Start a numbered list.",cls:"x-html-editor-tip"},createlink:{title:"Hyperlink",text:"Make the selected text a hyperlink.",cls:"x-html-editor-tip"},sourceedit:{title:"Source Edit",text:"Switch to source editing mode.",cls:"x-html-editor-tip"}}});Ext.reg("htmleditor",Ext.form.HtmlEditor);Ext.form.TimeField=Ext.extend(Ext.form.ComboBox,{minValue:undefined,maxValue:undefined,minText:"The time in this field must be equal to or after {0}",maxText:"The time in this field must be equal to or before {0}",invalidText:"{0} is not a valid time",format:"g:i A",altFormats:"g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H|gi a|hi a|giA|hiA|gi A|hi A",increment:15,mode:"local",triggerAction:"all",typeAhead:false,initDate:"1/1/2008",initDateFormat:"j/n/Y",initComponent:function(){if(Ext.isDefined(this.minValue)){this.setMinValue(this.minValue,true)}if(Ext.isDefined(this.maxValue)){this.setMaxValue(this.maxValue,true)}if(!this.store){this.generateStore(true)}Ext.form.TimeField.superclass.initComponent.call(this)},setMinValue:function(b,a){this.setLimit(b,true,a);return this},setMaxValue:function(b,a){this.setLimit(b,false,a);return this},generateStore:function(b){var c=this.minValue||new Date(this.initDate).clearTime(),a=this.maxValue||new Date(this.initDate).clearTime().add("mi",(24*60)-1),d=[];while(c<=a){d.push(c.dateFormat(this.format));c=c.add("mi",this.increment)}this.bindStore(d,b)},setLimit:function(b,f,a){var e;if(Ext.isString(b)){e=this.parseDate(b)}else{if(Ext.isDate(b)){e=b}}if(e){var c=new Date(this.initDate).clearTime();c.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());this[f?"minValue":"maxValue"]=c;if(!a){this.generateStore()}}},getValue:function(){var a=Ext.form.TimeField.superclass.getValue.call(this);return this.formatDate(this.parseDate(a))||""},setValue:function(a){return Ext.form.TimeField.superclass.setValue.call(this,this.formatDate(this.parseDate(a)))},validateValue:Ext.form.DateField.prototype.validateValue,formatDate:Ext.form.DateField.prototype.formatDate,parseDate:function(g){if(!g||Ext.isDate(g)){return g}var h=this.initDate+" ",f=this.initDateFormat+" ",b=Date.parseDate(h+g,f+this.format),c=this.altFormats;if(!b&&c){if(!this.altFormatsArray){this.altFormatsArray=c.split("|")}for(var e=0,d=this.altFormatsArray,a=d.length;ethis.maxLength){d.push(String.format(this.maxLengthText,this.maxLength))}if(this.vtype){var b=Ext.form.VTypes;if(!b[this.vtype](a,this)){d.push(this.vtypeText||b[this.vtype+"Text"])}}if(this.regex&&!this.regex.test(a)){d.push(this.regexText)}return d},selectText:function(g,a){var c=this.getRawValue();var e=false;if(c.length>0){g=g===undefined?0:g;a=a===undefined?c.length:a;var f=this.el.dom;if(f.setSelectionRange){f.setSelectionRange(g,a)}else{if(f.createTextRange){var b=f.createTextRange();b.moveStart("character",g);b.moveEnd("character",a-c.length);b.select()}}e=Ext.isGecko||Ext.isOpera}else{e=true}if(e){this.focus()}},autoSize:function(){if(!this.grow||!this.rendered){return}if(!this.metrics){this.metrics=Ext.util.TextMetrics.createInstance(this.el)}var c=this.el;var b=c.dom.value;var e=document.createElement("div");e.appendChild(document.createTextNode(b));b=e.innerHTML;Ext.removeNode(e);e=null;b+=" ";var a=Math.min(this.growMax,Math.max(this.metrics.getWidth(b)+10,this.growMin));this.el.setWidth(a);this.fireEvent("autosize",this,a)},onDestroy:function(){if(this.validationTask){this.validationTask.cancel();this.validationTask=null}Ext.form.TextField.superclass.onDestroy.call(this)}});Ext.reg("textfield",Ext.form.TextField);Ext.form.TriggerField=Ext.extend(Ext.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},hideTrigger:false,editable:true,readOnly:false,wrapFocusClass:"x-trigger-wrap-focus",autoSize:Ext.emptyFn,monitorTab:true,deferHeight:true,mimicing:false,actionMode:"wrap",defaultTriggerWidth:17,onResize:function(a,c){Ext.form.TriggerField.superclass.onResize.call(this,a,c);var b=this.getTriggerWidth();if(Ext.isNumber(a)){this.el.setWidth(a-b)}this.wrap.setWidth(this.el.getWidth()+b)},getTriggerWidth:function(){var a=this.trigger.getWidth();if(!this.hideTrigger&&!this.readOnly&&a===0){a=this.defaultTriggerWidth}return a},alignErrorIcon:function(){if(this.wrap){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}},onRender:function(b,a){this.doc=Ext.isIE?Ext.getBody():Ext.getDoc();Ext.form.TriggerField.superclass.onRender.call(this,b,a);this.wrap=this.el.wrap({cls:"x-form-field-wrap x-form-field-trigger-wrap"});this.trigger=this.wrap.createChild(this.triggerConfig||{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});this.initTrigger();if(!this.width){this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())}this.resizeEl=this.positionEl=this.wrap},getWidth:function(){return(this.el.getWidth()+this.trigger.getWidth())},updateEditState:function(){if(this.rendered){if(this.readOnly){this.el.dom.readOnly=true;this.el.addClass("x-trigger-noedit");this.mun(this.el,"click",this.onTriggerClick,this);this.trigger.setDisplayed(false)}else{if(!this.editable){this.el.dom.readOnly=true;this.el.addClass("x-trigger-noedit");this.mon(this.el,"click",this.onTriggerClick,this)}else{this.el.dom.readOnly=false;this.el.removeClass("x-trigger-noedit");this.mun(this.el,"click",this.onTriggerClick,this)}this.trigger.setDisplayed(!this.hideTrigger)}this.onResize(this.width||this.wrap.getWidth())}},setHideTrigger:function(a){if(a!=this.hideTrigger){this.hideTrigger=a;this.updateEditState()}},setEditable:function(a){if(a!=this.editable){this.editable=a;this.updateEditState()}},setReadOnly:function(a){if(a!=this.readOnly){this.readOnly=a;this.updateEditState()}},afterRender:function(){Ext.form.TriggerField.superclass.afterRender.call(this);this.updateEditState()},initTrigger:function(){this.mon(this.trigger,"click",this.onTriggerClick,this,{preventDefault:true});this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},onDestroy:function(){Ext.destroy(this.trigger,this.wrap);if(this.mimicing){this.doc.un("mousedown",this.mimicBlur,this)}delete this.doc;Ext.form.TriggerField.superclass.onDestroy.call(this)},onFocus:function(){Ext.form.TriggerField.superclass.onFocus.call(this);if(!this.mimicing){this.wrap.addClass(this.wrapFocusClass);this.mimicing=true;this.doc.on("mousedown",this.mimicBlur,this,{delay:10});if(this.monitorTab){this.on("specialkey",this.checkTab,this)}}},checkTab:function(a,b){if(b.getKey()==b.TAB){this.triggerBlur()}},onBlur:Ext.emptyFn,mimicBlur:function(a){if(!this.isDestroyed&&!this.wrap.contains(a.target)&&this.validateBlur(a)){this.triggerBlur()}},triggerBlur:function(){this.mimicing=false;this.doc.un("mousedown",this.mimicBlur,this);if(this.monitorTab&&this.el){this.un("specialkey",this.checkTab,this)}Ext.form.TriggerField.superclass.onBlur.call(this);if(this.wrap){this.wrap.removeClass(this.wrapFocusClass)}},beforeBlur:Ext.emptyFn,validateBlur:function(a){return true},onTriggerClick:Ext.emptyFn});Ext.form.TwinTriggerField=Ext.extend(Ext.form.TriggerField,{initComponent:function(){Ext.form.TwinTriggerField.superclass.initComponent.call(this);this.triggerConfig={tag:"span",cls:"x-form-twin-triggers",cn:[{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger2Class}]}},getTrigger:function(a){return this.triggers[a]},initTrigger:function(){var a=this.trigger.select(".x-form-trigger",true);var b=this;a.each(function(d,f,c){var e="Trigger"+(c+1);d.hide=function(){var g=b.wrap.getWidth();this.dom.style.display="none";b.el.setWidth(g-b.trigger.getWidth());this["hidden"+e]=true};d.show=function(){var g=b.wrap.getWidth();this.dom.style.display="";b.el.setWidth(g-b.trigger.getWidth());this["hidden"+e]=false};if(this["hide"+e]){d.dom.style.display="none";this["hidden"+e]=true}this.mon(d,"click",this["on"+e+"Click"],this,{preventDefault:true});d.addClassOnOver("x-form-trigger-over");d.addClassOnClick("x-form-trigger-click")},this);this.triggers=a.elements},getTriggerWidth:function(){var a=0;Ext.each(this.triggers,function(d,c){var e="Trigger"+(c+1),b=d.getWidth();if(b===0&&!this["hidden"+e]){a+=this.defaultTriggerWidth}else{a+=b}},this);return a},onDestroy:function(){Ext.destroy(this.triggers);Ext.form.TwinTriggerField.superclass.onDestroy.call(this)},onTrigger1Click:Ext.emptyFn,onTrigger2Click:Ext.emptyFn});Ext.reg("trigger",Ext.form.TriggerField);Ext.form.TextArea=Ext.extend(Ext.form.TextField,{growMin:60,growMax:1000,growAppend:" \n ",enterIsSpecial:false,preventScrollbars:false,onRender:function(b,a){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:100px;height:60px;",autocomplete:"off"}}Ext.form.TextArea.superclass.onRender.call(this,b,a);if(this.grow){this.textSizeEl=Ext.DomHelper.append(document.body,{tag:"pre",cls:"x-form-grow-sizer"});if(this.preventScrollbars){this.el.setStyle("overflow","hidden")}this.el.setHeight(this.growMin)}},onDestroy:function(){Ext.removeNode(this.textSizeEl);Ext.form.TextArea.superclass.onDestroy.call(this)},fireKey:function(a){if(a.isSpecialKey()&&(this.enterIsSpecial||(a.getKey()!=a.ENTER||a.hasModifier()))){this.fireEvent("specialkey",this,a)}},doAutoSize:function(a){return !a.isNavKeyPress()||a.getKey()==a.ENTER},autoSize:function(){if(!this.grow||!this.textSizeEl){return}var c=this.el,a=Ext.util.Format.htmlEncode(c.dom.value),d=this.textSizeEl,b;Ext.fly(d).setWidth(this.el.getWidth());if(a.length<1){a="  "}else{a+=this.growAppend;if(Ext.isIE){a=a.replace(/\n/g," 
    ")}}d.innerHTML=a;b=Math.min(this.growMax,Math.max(d.offsetHeight,this.growMin));if(b!=this.lastHeight){this.lastHeight=b;this.el.setHeight(b);this.fireEvent("autosize",this,b)}}});Ext.reg("textarea",Ext.form.TextArea);Ext.form.NumberField=Ext.extend(Ext.form.TextField,{fieldClass:"x-form-field x-form-num-field",allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",baseChars:"0123456789",initEvents:function(){var a=this.baseChars+"";if(this.allowDecimals){a+=this.decimalSeparator}if(this.allowNegative){a+="-"}this.maskRe=new RegExp("["+Ext.escapeRe(a)+"]");Ext.form.NumberField.superclass.initEvents.call(this)},getErrors:function(b){var c=Ext.form.NumberField.superclass.getErrors.apply(this,arguments);b=b||this.processValue(this.getRawValue());if(b.length<1){return c}b=String(b).replace(this.decimalSeparator,".");if(isNaN(b)){c.push(String.format(this.nanText,b))}var a=this.parseValue(b);if(athis.maxValue){c.push(String.format(this.maxText,this.maxValue))}return c},getValue:function(){return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this)))},setValue:function(a){a=Ext.isNumber(a)?a:parseFloat(String(a).replace(this.decimalSeparator,"."));a=isNaN(a)?"":String(a).replace(".",this.decimalSeparator);return Ext.form.NumberField.superclass.setValue.call(this,a)},setMinValue:function(a){this.minValue=Ext.num(a,Number.NEGATIVE_INFINITY)},setMaxValue:function(a){this.maxValue=Ext.num(a,Number.MAX_VALUE)},parseValue:function(a){a=parseFloat(String(a).replace(this.decimalSeparator,"."));return isNaN(a)?"":a},fixPrecision:function(b){var a=isNaN(b);if(!this.allowDecimals||this.decimalPrecision==-1||a||!b){return a?"":b}return parseFloat(parseFloat(b).toFixed(this.decimalPrecision))},beforeBlur:function(){var a=this.parseValue(this.getRawValue());if(!Ext.isEmpty(a)){this.setValue(this.fixPrecision(a))}}});Ext.reg("numberfield",Ext.form.NumberField);Ext.form.DateField=Ext.extend(Ext.form.TriggerField,{format:"m/d/Y",altFormats:"m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d",disabledDaysText:"Disabled",disabledDatesText:"Disabled",minText:"The date in this field must be equal to or after {0}",maxText:"The date in this field must be equal to or before {0}",invalidText:"{0} is not a valid date - it must be in the format {1}",triggerClass:"x-form-date-trigger",showToday:true,defaultAutoCreate:{tag:"input",type:"text",size:"10",autocomplete:"off"},initTime:"12",initTimeFormat:"H",safeParse:function(b,c){if(/[gGhH]/.test(c.replace(/(\\.)/g,""))){return Date.parseDate(b,c)}else{var a=Date.parseDate(b+" "+this.initTime,c+" "+this.initTimeFormat);if(a){return a.clearTime()}}},initComponent:function(){Ext.form.DateField.superclass.initComponent.call(this);this.addEvents("select");if(Ext.isString(this.minValue)){this.minValue=this.parseDate(this.minValue)}if(Ext.isString(this.maxValue)){this.maxValue=this.parseDate(this.maxValue)}this.disabledDatesRE=null;this.initDisabledDays()},initEvents:function(){Ext.form.DateField.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{down:function(a){this.onTriggerClick()},scope:this,forceKeyDown:true})},initDisabledDays:function(){if(this.disabledDates){var b=this.disabledDates,a=b.length-1,c="(?:";Ext.each(b,function(f,e){c+=Ext.isDate(f)?"^"+Ext.escapeRe(f.dateFormat(this.format))+"$":b[e];if(e!=a){c+="|"}},this);this.disabledDatesRE=new RegExp(c+")")}},setDisabledDates:function(a){this.disabledDates=a;this.initDisabledDays();if(this.menu){this.menu.picker.setDisabledDates(this.disabledDatesRE)}},setDisabledDays:function(a){this.disabledDays=a;if(this.menu){this.menu.picker.setDisabledDays(a)}},setMinValue:function(a){this.minValue=(Ext.isString(a)?this.parseDate(a):a);if(this.menu){this.menu.picker.setMinDate(this.minValue)}},setMaxValue:function(a){this.maxValue=(Ext.isString(a)?this.parseDate(a):a);if(this.menu){this.menu.picker.setMaxDate(this.maxValue)}},getErrors:function(e){var g=Ext.form.DateField.superclass.getErrors.apply(this,arguments);e=this.formatDate(e||this.processValue(this.getRawValue()));if(e.length<1){return g}var c=e;e=this.parseDate(e);if(!e){g.push(String.format(this.invalidText,c,this.format));return g}var f=e.getTime();if(this.minValue&&fthis.maxValue.getTime()){g.push(String.format(this.maxText,this.formatDate(this.maxValue)))}if(this.disabledDays){var a=e.getDay();for(var b=0;b
    {'+this.displayField+"}
    "}this.view=new Ext.DataView({applyTo:this.innerList,tpl:this.tpl,singleSelect:true,selectedClass:this.selectedClass,itemSelector:this.itemSelector||"."+a+"-item",emptyText:this.listEmptyText,deferEmptyText:false});this.mon(this.view,{containerclick:this.onViewClick,click:this.onViewClick,scope:this});this.bindStore(this.store,true);if(this.resizable){this.resizer=new Ext.Resizable(this.list,{pinned:true,handles:"se"});this.mon(this.resizer,"resize",function(g,e,f){this.maxHeight=f-this.handleHeight-this.list.getFrameWidth("tb")-this.assetHeight;this.listWidth=e;this.innerList.setWidth(e-this.list.getFrameWidth("lr"));this.restrictHeight()},this);this[this.pageSize?"footer":"innerList"].setStyle("margin-bottom",this.handleHeight+"px")}}},getListParent:function(){return document.body},getStore:function(){return this.store},bindStore:function(a,b){if(this.store&&!b){if(this.store!==a&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.collapse,this)}if(!a){this.store=null;if(this.view){this.view.bindStore(null)}if(this.pageTb){this.pageTb.bindStore(null)}}}if(a){if(!b){this.lastQuery=null;if(this.pageTb){this.pageTb.bindStore(a)}}this.store=Ext.StoreMgr.lookup(a);this.store.on({scope:this,beforeload:this.onBeforeLoad,load:this.onLoad,exception:this.collapse});if(this.view){this.view.bindStore(a)}}},reset:function(){Ext.form.ComboBox.superclass.reset.call(this);if(this.clearFilterOnReset&&this.mode=="local"){this.store.clearFilter()}},initEvents:function(){Ext.form.ComboBox.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{up:function(a){this.inKeyMode=true;this.selectPrev()},down:function(a){if(!this.isExpanded()){this.onTriggerClick()}else{this.inKeyMode=true;this.selectNext()}},enter:function(a){this.onViewClick()},esc:function(a){this.collapse()},tab:function(a){if(this.forceSelection===true){this.collapse()}else{this.onViewClick(false)}return true},scope:this,doRelay:function(c,b,a){if(a=="down"||this.scope.isExpanded()){var d=Ext.KeyNav.prototype.doRelay.apply(this,arguments);if(!Ext.isIE&&Ext.EventManager.useKeydown){this.scope.fireKey(c)}return d}return true},forceKeyDown:true,defaultEventAction:"stopEvent"});this.queryDelay=Math.max(this.queryDelay||10,this.mode=="local"?10:250);this.dqTask=new Ext.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Ext.util.DelayedTask(this.onTypeAhead,this)}if(!this.enableKeyEvents){this.mon(this.el,"keyup",this.onKeyUp,this)}},onDestroy:function(){if(this.dqTask){this.dqTask.cancel();this.dqTask=null}this.bindStore(null);Ext.destroy(this.resizer,this.view,this.pageTb,this.list);Ext.destroyMembers(this,"hiddenField");Ext.form.ComboBox.superclass.onDestroy.call(this)},fireKey:function(a){if(!this.isExpanded()){Ext.form.ComboBox.superclass.fireKey.call(this,a)}},onResize:function(a,b){Ext.form.ComboBox.superclass.onResize.apply(this,arguments);if(!isNaN(a)&&this.isVisible()&&this.list){this.doResize(a)}else{this.bufferSize=a}},doResize:function(a){if(!Ext.isDefined(this.listWidth)){var b=Math.max(a,this.minListWidth);this.list.setWidth(b);this.innerList.setWidth(b-this.list.getFrameWidth("lr"))}},onEnable:function(){Ext.form.ComboBox.superclass.onEnable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=false}},onDisable:function(){Ext.form.ComboBox.superclass.onDisable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=true}},onBeforeLoad:function(){if(!this.hasFocus){return}this.innerList.update(this.loadingText?'
    '+this.loadingText+"
    ":"");this.restrictHeight();this.selectedIndex=-1},onLoad:function(){if(!this.hasFocus){return}if(this.store.getCount()>0||this.listEmptyText){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable){this.el.dom.select()}if(this.autoSelect!==false&&!this.selectByValue(this.value,true)){this.select(0,true)}}else{if(this.autoSelect!==false){this.selectNext()}if(this.typeAhead&&this.lastKey!=Ext.EventObject.BACKSPACE&&this.lastKey!=Ext.EventObject.DELETE){this.taTask.delay(this.typeAheadDelay)}}}else{this.collapse()}},onTypeAhead:function(){if(this.store.getCount()>0){var b=this.store.getAt(0);var c=b.data[this.displayField];var a=c.length;var d=this.getRawValue().length;if(d!=a){this.setRawValue(c);this.selectText(d,c.length)}}},assertValue:function(){var b=this.getRawValue(),a=this.findRecord(this.displayField,b);if(!a&&this.forceSelection){if(b.length>0&&b!=this.emptyText){this.el.dom.value=Ext.value(this.lastSelectionText,"");this.applyEmptyText()}else{this.clearValue()}}else{if(a){if(b==a.get(this.displayField)&&this.value==a.get(this.valueField)){return}b=a.get(this.valueField||this.displayField)}this.setValue(b)}},onSelect:function(a,b){if(this.fireEvent("beforeselect",this,a,b)!==false){this.setValue(a.data[this.valueField||this.displayField]);this.collapse();this.fireEvent("select",this,a,b)}},getName:function(){var a=this.hiddenField;return a&&a.name?a.name:this.hiddenName||Ext.form.ComboBox.superclass.getName.call(this)},getValue:function(){if(this.valueField){return Ext.isDefined(this.value)?this.value:""}else{return Ext.form.ComboBox.superclass.getValue.call(this)}},clearValue:function(){if(this.hiddenField){this.hiddenField.value=""}this.setRawValue("");this.lastSelectionText="";this.applyEmptyText();this.value=""},setValue:function(a){var c=a;if(this.valueField){var b=this.findRecord(this.valueField,a);if(b){c=b.data[this.displayField]}else{if(Ext.isDefined(this.valueNotFoundText)){c=this.valueNotFoundText}}}this.lastSelectionText=c;if(this.hiddenField){this.hiddenField.value=Ext.value(a,"")}Ext.form.ComboBox.superclass.setValue.call(this,c);this.value=a;return this},findRecord:function(c,b){var a;if(this.store.getCount()>0){this.store.each(function(d){if(d.data[c]==b){a=d;return false}})}return a},onViewMove:function(b,a){this.inKeyMode=false},onViewOver:function(d,b){if(this.inKeyMode){return}var c=this.view.findItemFromChild(b);if(c){var a=this.view.indexOf(c);this.select(a,false)}},onViewClick:function(b){var a=this.view.getSelectedIndexes()[0],c=this.store,d=c.getAt(a);if(d){this.onSelect(d,a)}else{this.collapse()}if(b!==false){this.el.focus()}},restrictHeight:function(){this.innerList.dom.style.height="";var b=this.innerList.dom,e=this.list.getFrameWidth("tb")+(this.resizable?this.handleHeight:0)+this.assetHeight,c=Math.max(b.clientHeight,b.offsetHeight,b.scrollHeight),a=this.getPosition()[1]-Ext.getBody().getScroll().top,f=Ext.lib.Dom.getViewHeight()-a-this.getSize().height,d=Math.max(a,f,this.minHeight||0)-this.list.shadowOffset-e-5;c=Math.min(c,d,this.maxHeight);this.innerList.setHeight(c);this.list.beginUpdate();this.list.setHeight(c+e);this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));this.list.endUpdate()},isExpanded:function(){return this.list&&this.list.isVisible()},selectByValue:function(a,c){if(!Ext.isEmpty(a,true)){var b=this.findRecord(this.valueField||this.displayField,a);if(b){this.select(this.store.indexOf(b),c);return true}}return false},select:function(a,c){this.selectedIndex=a;this.view.select(a);if(c!==false){var b=this.view.getNode(a);if(b){this.innerList.scrollChildIntoView(b,false)}}},selectNext:function(){var a=this.store.getCount();if(a>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex!==0){this.select(this.selectedIndex-1)}}}},onKeyUp:function(b){var a=b.getKey();if(this.editable!==false&&this.readOnly!==true&&(a==b.BACKSPACE||!b.isSpecialKey())){this.lastKey=a;this.dqTask.delay(this.queryDelay)}Ext.form.ComboBox.superclass.onKeyUp.call(this,b)},validateBlur:function(){return !this.list||!this.list.isVisible()},initQuery:function(){this.doQuery(this.getRawValue())},beforeBlur:function(){this.assertValue()},postBlur:function(){Ext.form.ComboBox.superclass.postBlur.call(this);this.collapse();this.inKeyMode=false},doQuery:function(c,b){c=Ext.isEmpty(c)?"":c;var a={query:c,forceAll:b,combo:this,cancel:false};if(this.fireEvent("beforequery",a)===false||a.cancel){return false}c=a.query;b=a.forceAll;if(b===true||(c.length>=this.minChars)){if(this.lastQuery!==c){this.lastQuery=c;if(this.mode=="local"){this.selectedIndex=-1;if(b){this.store.clearFilter()}else{this.store.filter(this.displayField,c)}this.onLoad()}else{this.store.baseParams[this.queryParam]=c;this.store.load({params:this.getParams(c)});this.expand()}}else{this.selectedIndex=-1;this.onLoad()}}},getParams:function(a){var b={};if(this.pageSize){b.start=0;b.limit=this.pageSize}return b},collapse:function(){if(!this.isExpanded()){return}this.list.hide();Ext.getDoc().un("mousewheel",this.collapseIf,this);Ext.getDoc().un("mousedown",this.collapseIf,this);this.fireEvent("collapse",this)},collapseIf:function(a){if(!this.isDestroyed&&!a.within(this.wrap)&&!a.within(this.list)){this.collapse()}},expand:function(){if(this.isExpanded()||!this.hasFocus){return}if(this.title||this.pageSize){this.assetHeight=0;if(this.title){this.assetHeight+=this.header.getHeight()}if(this.pageSize){this.assetHeight+=this.footer.getHeight()}}if(this.bufferSize){this.doResize(this.bufferSize);delete this.bufferSize}this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));var b=Ext.getDom(this.getListParent()||Ext.getBody()),a=parseInt(Ext.fly(b).getStyle("z-index"),10);if(!a){a=this.getParentZIndex()}if(a){this.list.setZIndex(a+5)}this.list.show();if(Ext.isGecko2){this.innerList.setOverflow("auto")}this.mon(Ext.getDoc(),{scope:this,mousewheel:this.collapseIf,mousedown:this.collapseIf});this.fireEvent("expand",this)},onTriggerClick:function(){if(this.readOnly||this.disabled){return}if(this.isExpanded()){this.collapse();this.el.focus()}else{this.onFocus({});if(this.triggerAction=="all"){this.doQuery(this.allQuery,true)}else{this.doQuery(this.getRawValue())}this.el.focus()}}});Ext.reg("combo",Ext.form.ComboBox);Ext.form.Checkbox=Ext.extend(Ext.form.Field,{focusClass:undefined,fieldClass:"x-form-field",checked:false,boxLabel:" ",defaultAutoCreate:{tag:"input",type:"checkbox",autocomplete:"off"},actionMode:"wrap",initComponent:function(){Ext.form.Checkbox.superclass.initComponent.call(this);this.addEvents("check")},onResize:function(){Ext.form.Checkbox.superclass.onResize.apply(this,arguments);if(!this.boxLabel&&!this.fieldLabel){this.el.alignTo(this.wrap,"c-c")}},initEvents:function(){Ext.form.Checkbox.superclass.initEvents.call(this);this.mon(this.el,{scope:this,click:this.onClick,change:this.onClick})},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,onRender:function(b,a){Ext.form.Checkbox.superclass.onRender.call(this,b,a);if(this.inputValue!==undefined){this.el.dom.value=this.inputValue}this.wrap=this.el.wrap({cls:"x-form-check-wrap"});if(this.boxLabel){this.wrap.createChild({tag:"label",htmlFor:this.el.id,cls:"x-form-cb-label",html:this.boxLabel})}if(this.checked){this.setValue(true)}else{this.checked=this.el.dom.checked}if(Ext.isIE){this.wrap.repaint()}this.resizeEl=this.positionEl=this.wrap},onDestroy:function(){Ext.destroy(this.wrap);Ext.form.Checkbox.superclass.onDestroy.call(this)},initValue:function(){this.originalValue=this.getValue()},getValue:function(){if(this.rendered){return this.el.dom.checked}return this.checked},onClick:function(){if(this.el.dom.checked!=this.checked){this.setValue(this.el.dom.checked)}},setValue:function(a){var b=this.checked;this.checked=(a===true||a==="true"||a=="1"||String(a).toLowerCase()=="on");if(this.rendered){this.el.dom.checked=this.checked;this.el.dom.defaultChecked=this.checked}if(b!=this.checked){this.fireEvent("check",this,this.checked);if(this.handler){this.handler.call(this.scope||this,this,this.checked)}}return this}});Ext.reg("checkbox",Ext.form.Checkbox);Ext.form.CheckboxGroup=Ext.extend(Ext.form.Field,{columns:"auto",vertical:false,allowBlank:true,blankText:"You must select at least one item in this group",defaultType:"checkbox",groupCls:"x-form-check-group",initComponent:function(){this.addEvents("change");this.on("change",this.validate,this);Ext.form.CheckboxGroup.superclass.initComponent.call(this)},onRender:function(h,f){if(!this.el){var o={autoEl:{id:this.id},cls:this.groupCls,layout:"column",renderTo:h,bufferResize:false};var a={xtype:"container",defaultType:this.defaultType,layout:"form",defaults:{hideLabel:true,anchor:"100%"}};if(this.items[0].items){Ext.apply(o,{layoutConfig:{columns:this.items.length},defaults:this.defaults,items:this.items});for(var e=0,k=this.items.length;e0&&e%q==0){n++}if(this.items[e].fieldLabel){this.items[e].hideLabel=false}m[n].items.push(this.items[e])}}else{for(var e=0,k=this.items.length;e-1){b.setValue(true)}})},getBox:function(b){var a=null;this.eachItem(function(c){if(b==c||c.dataIndex==b||c.id==b||c.getName()==b){a=c;return false}});return a},getValue:function(){var a=[];this.eachItem(function(b){if(b.checked){a.push(b)}});return a},eachItem:function(b,a){if(this.items&&this.items.each){this.items.each(b,a||this)}},getRawValue:Ext.emptyFn,setRawValue:Ext.emptyFn});Ext.reg("checkboxgroup",Ext.form.CheckboxGroup);Ext.form.CompositeField=Ext.extend(Ext.form.Field,{defaultMargins:"0 5 0 0",skipLastItemMargin:true,isComposite:true,combineErrors:true,initComponent:function(){var e=[],a=this.items,d;for(var c=0,b=a.length;c")},sortErrors:function(){var a=this.items;this.fieldErrors.sort("ASC",function(f,d){var c=function(b){return function(h){return h.getName()==b}};var g=a.findIndexBy(c(f.field)),e=a.findIndexBy(c(d.field));return g1){var a=this.getBox(c);if(a){a.setValue(b);if(a.checked){this.eachItem(function(d){if(d!==a){d.setValue(false)}})}}}else{this.setValueForItem(c)}},setValueForItem:function(a){a=String(a).split(",")[0];this.eachItem(function(b){b.setValue(a==b.inputValue)})},fireChecked:function(){if(!this.checkTask){this.checkTask=new Ext.util.DelayedTask(this.bufferChecked,this)}this.checkTask.delay(10)},bufferChecked:function(){var a=null;this.eachItem(function(b){if(b.checked){a=b;return false}});this.fireEvent("change",this,a)},onDestroy:function(){if(this.checkTask){this.checkTask.cancel();this.checkTask=null}Ext.form.RadioGroup.superclass.onDestroy.call(this)}});Ext.reg("radiogroup",Ext.form.RadioGroup);Ext.form.Hidden=Ext.extend(Ext.form.Field,{inputType:"hidden",onRender:function(){Ext.form.Hidden.superclass.onRender.apply(this,arguments)},initEvents:function(){this.originalValue=this.getValue()},setSize:Ext.emptyFn,setWidth:Ext.emptyFn,setHeight:Ext.emptyFn,setPosition:Ext.emptyFn,setPagePosition:Ext.emptyFn,markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn});Ext.reg("hidden",Ext.form.Hidden);Ext.form.BasicForm=Ext.extend(Ext.util.Observable,{constructor:function(b,a){Ext.apply(this,a);if(Ext.isString(this.paramOrder)){this.paramOrder=this.paramOrder.split(/[\s,|]/)}this.items=new Ext.util.MixedCollection(false,function(c){return c.getItemId()});this.addEvents("beforeaction","actionfailed","actioncomplete");if(b){this.initEl(b)}Ext.form.BasicForm.superclass.constructor.call(this)},timeout:30,paramOrder:undefined,paramsAsHash:false,waitTitle:"Please Wait...",activeAction:null,trackResetOnLoad:false,initEl:function(a){this.el=Ext.get(a);this.id=this.el.id||Ext.id();if(!this.standardSubmit){this.el.on("submit",this.onSubmit,this)}this.el.addClass("x-form")},getEl:function(){return this.el},onSubmit:function(a){a.stopEvent()},destroy:function(a){if(a!==true){this.items.each(function(b){Ext.destroy(b)});Ext.destroy(this.el)}this.items.clear();this.purgeListeners()},isValid:function(){var a=true;this.items.each(function(b){if(!b.validate()){a=false}});return a},isDirty:function(){var a=false;this.items.each(function(b){if(b.isDirty()){a=true;return false}});return a},doAction:function(b,a){if(Ext.isString(b)){b=new Ext.form.Action.ACTION_TYPES[b](this,a)}if(this.fireEvent("beforeaction",this,b)!==false){this.beforeAction(b);b.run.defer(100,b)}return this},submit:function(b){b=b||{};if(this.standardSubmit){var a=b.clientValidation===false||this.isValid();if(a){var c=this.el.dom;if(this.url&&Ext.isEmpty(c.action)){c.action=this.url}c.submit()}return a}var d=String.format("{0}submit",this.api?"direct":"");this.doAction(d,b);return this},load:function(a){var b=String.format("{0}load",this.api?"direct":"");this.doAction(b,a);return this},updateRecord:function(b){b.beginEdit();var a=b.fields;a.each(function(c){var d=this.findField(c.name);if(d){b.set(c.name,d.getValue())}},this);b.endEdit();return this},loadRecord:function(a){this.setValues(a.data);return this},beforeAction:function(a){this.items.each(function(c){if(c.isFormField&&c.syncValue){c.syncValue()}});var b=a.options;if(b.waitMsg){if(this.waitMsgTarget===true){this.el.mask(b.waitMsg,"x-mask-loading")}else{if(this.waitMsgTarget){this.waitMsgTarget=Ext.get(this.waitMsgTarget);this.waitMsgTarget.mask(b.waitMsg,"x-mask-loading")}else{Ext.MessageBox.wait(b.waitMsg,b.waitTitle||this.waitTitle)}}}},afterAction:function(a,c){this.activeAction=null;var b=a.options;if(b.waitMsg){if(this.waitMsgTarget===true){this.el.unmask()}else{if(this.waitMsgTarget){this.waitMsgTarget.unmask()}else{Ext.MessageBox.updateProgress(1);Ext.MessageBox.hide()}}}if(c){if(b.reset){this.reset()}Ext.callback(b.success,b.scope,[this,a]);this.fireEvent("actioncomplete",this,a)}else{Ext.callback(b.failure,b.scope,[this,a]);this.fireEvent("actionfailed",this,a)}},findField:function(c){var b=this.items.get(c);if(!Ext.isObject(b)){var a=function(d){if(d.isFormField){if(d.dataIndex==c||d.id==c||d.getName()==c){b=d;return false}else{if(d.isComposite&&d.rendered){return d.items.each(a)}}}};this.items.each(a)}return b||null},markInvalid:function(h){if(Ext.isArray(h)){for(var c=0,a=h.length;c':">"),c,"")}return d.join("")},createToolbar:function(e){var c=[];var a=Ext.QuickTips&&Ext.QuickTips.isEnabled();function d(i,g,h){return{itemId:i,cls:"x-btn-icon",iconCls:"x-edit-"+i,enableToggle:g!==false,scope:e,handler:h||e.relayBtnCmd,clickEvent:"mousedown",tooltip:a?e.buttonTips[i]||undefined:undefined,overflowText:e.buttonTips[i].title||undefined,tabIndex:-1}}if(this.enableFont&&!Ext.isSafari2){var f=new Ext.Toolbar.Item({autoEl:{tag:"select",cls:"x-font-select",html:this.createFontOptions()}});c.push(f,"-")}if(this.enableFormat){c.push(d("bold"),d("italic"),d("underline"))}if(this.enableFontSize){c.push("-",d("increasefontsize",false,this.adjustFont),d("decreasefontsize",false,this.adjustFont))}if(this.enableColors){c.push("-",{itemId:"forecolor",cls:"x-btn-icon",iconCls:"x-edit-forecolor",clickEvent:"mousedown",tooltip:a?e.buttonTips.forecolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({allowReselect:true,focus:Ext.emptyFn,value:"000000",plain:true,listeners:{scope:this,select:function(h,g){this.execCmd("forecolor",Ext.isWebKit||Ext.isIE?"#"+g:g);this.deferFocus()}},clickEvent:"mousedown"})},{itemId:"backcolor",cls:"x-btn-icon",iconCls:"x-edit-backcolor",clickEvent:"mousedown",tooltip:a?e.buttonTips.backcolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({focus:Ext.emptyFn,value:"FFFFFF",plain:true,allowReselect:true,listeners:{scope:this,select:function(h,g){if(Ext.isGecko){this.execCmd("useCSS",false);this.execCmd("hilitecolor",g);this.execCmd("useCSS",true);this.deferFocus()}else{this.execCmd(Ext.isOpera?"hilitecolor":"backcolor",Ext.isWebKit||Ext.isIE?"#"+g:g);this.deferFocus()}}},clickEvent:"mousedown"})})}if(this.enableAlignments){c.push("-",d("justifyleft"),d("justifycenter"),d("justifyright"))}if(!Ext.isSafari2){if(this.enableLinks){c.push("-",d("createlink",false,this.createLink))}if(this.enableLists){c.push("-",d("insertorderedlist"),d("insertunorderedlist"))}if(this.enableSourceEdit){c.push("-",d("sourceedit",true,function(g){this.toggleSourceEdit(!this.sourceEditMode)}))}}var b=new Ext.Toolbar({renderTo:this.wrap.dom.firstChild,items:c});if(f){this.fontSelect=f.el;this.mon(this.fontSelect,"change",function(){var g=this.fontSelect.dom.value;this.relayCmd("fontname",g);this.deferFocus()},this)}this.mon(b.el,"click",function(g){g.preventDefault()});this.tb=b;this.tb.doLayout()},onDisable:function(){this.wrap.mask();Ext.form.HtmlEditor.superclass.onDisable.call(this)},onEnable:function(){this.wrap.unmask();Ext.form.HtmlEditor.superclass.onEnable.call(this)},setReadOnly:function(b){Ext.form.HtmlEditor.superclass.setReadOnly.call(this,b);if(this.initialized){if(Ext.isIE){this.getEditorBody().contentEditable=!b}else{this.setDesignMode(!b)}var a=this.getEditorBody();if(a){a.style.cursor=this.readOnly?"default":"text"}this.disableItems(b)}},getDocMarkup:function(){var a=Ext.fly(this.iframe).getHeight()-this.iframePad*2;return String.format('',this.iframePad,a)},getEditorBody:function(){var a=this.getDoc();return a.body||a.documentElement},getDoc:function(){return Ext.isIE?this.getWin().document:(this.iframe.contentDocument||this.getWin().document)},getWin:function(){return Ext.isIE?this.iframe.contentWindow:window.frames[this.iframe.name]},onRender:function(b,a){Ext.form.HtmlEditor.superclass.onRender.call(this,b,a);this.el.dom.style.border="0 none";this.el.dom.setAttribute("tabIndex",-1);this.el.addClass("x-hidden");if(Ext.isIE){this.el.applyStyles("margin-top:-1px;margin-bottom:-1px;")}this.wrap=this.el.wrap({cls:"x-html-editor-wrap",cn:{cls:"x-html-editor-tb"}});this.createToolbar(this);this.disableItems(true);this.tb.doLayout();this.createIFrame();if(!this.width){var c=this.el.getSize();this.setSize(c.width,this.height||c.height)}this.resizeEl=this.positionEl=this.wrap},createIFrame:function(){var a=document.createElement("iframe");a.name=Ext.id();a.frameBorder="0";a.style.overflow="auto";this.wrap.dom.appendChild(a);this.iframe=a;this.monitorTask=Ext.TaskMgr.start({run:this.checkDesignMode,scope:this,interval:100})},initFrame:function(){Ext.TaskMgr.stop(this.monitorTask);var b=this.getDoc();this.win=this.getWin();b.open();b.write(this.getDocMarkup());b.close();var a={run:function(){var c=this.getDoc();if(c.body||c.readyState=="complete"){Ext.TaskMgr.stop(a);this.setDesignMode(true);this.initEditor.defer(10,this)}},interval:10,duration:10000,scope:this};Ext.TaskMgr.start(a)},checkDesignMode:function(){if(this.wrap&&this.wrap.dom.offsetWidth){var a=this.getDoc();if(!a){return}if(!a.editorInitialized||this.getDesignMode()!="on"){this.initFrame()}}},setDesignMode:function(b){var a;if(a=this.getDoc()){if(this.readOnly){b=false}a.designMode=(/on|true/i).test(String(b).toLowerCase())?"on":"off"}},getDesignMode:function(){var a=this.getDoc();if(!a){return""}return String(a.designMode).toLowerCase()},disableItems:function(a){if(this.fontSelect){this.fontSelect.dom.disabled=a}this.tb.items.each(function(b){if(b.getItemId()!="sourceedit"){b.setDisabled(a)}})},onResize:function(b,c){Ext.form.HtmlEditor.superclass.onResize.apply(this,arguments);if(this.el&&this.iframe){if(Ext.isNumber(b)){var e=b-this.wrap.getFrameWidth("lr");this.el.setWidth(e);this.tb.setWidth(e);this.iframe.style.width=Math.max(e,0)+"px"}if(Ext.isNumber(c)){var a=c-this.wrap.getFrameWidth("tb")-this.tb.el.getHeight();this.el.setHeight(a);this.iframe.style.height=Math.max(a,0)+"px";var d=this.getEditorBody();if(d){d.style.height=Math.max((a-(this.iframePad*2)),0)+"px"}}}},toggleSourceEdit:function(c){var e,b,a;if(c===undefined){c=!this.sourceEditMode}this.sourceEditMode=c===true;var d=this.tb.getComponent("sourceedit");if(d.pressed!==this.sourceEditMode){d.toggle(this.sourceEditMode);if(!d.xtbHidden){return}}if(this.sourceEditMode){a=this.getSize();e=Ext.get(this.iframe).getHeight();this.disableItems(true);this.syncValue();this.iframe.className="x-hidden";this.el.removeClass("x-hidden");this.el.dom.removeAttribute("tabIndex");this.el.focus();this.el.dom.style.height=e+"px"}else{b=parseInt(this.el.dom.style.height,10);if(this.initialized){this.disableItems(this.readOnly)}this.pushValue();this.iframe.className="";this.el.addClass("x-hidden");this.el.dom.setAttribute("tabIndex",-1);this.deferFocus();this.setSize(a);this.iframe.style.height=b+"px"}this.fireEvent("editmodechange",this,this.sourceEditMode)},createLink:function(){var a=prompt(this.createLinkText,this.defaultLinkValue);if(a&&a!="http://"){this.relayCmd("createlink",a)}},initEvents:function(){this.originalValue=this.getValue()},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,setValue:function(a){Ext.form.HtmlEditor.superclass.setValue.call(this,a);this.pushValue();return this},cleanHtml:function(a){a=String(a);if(Ext.isWebKit){a=a.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,"")}if(a.charCodeAt(0)==this.defaultValue.replace(/\D/g,"")){a=a.substring(1)}return a},syncValue:function(){if(this.initialized){var d=this.getEditorBody();var c=d.innerHTML;if(Ext.isWebKit){var b=d.getAttribute("style");var a=b.match(/text-align:(.*?);/i);if(a&&a[1]){c='
    '+c+"
    "}}c=this.cleanHtml(c);if(this.fireEvent("beforesync",this,c)!==false){this.el.dom.value=c;this.fireEvent("sync",this,c)}}},getValue:function(){this[this.sourceEditMode?"pushValue":"syncValue"]();return Ext.form.HtmlEditor.superclass.getValue.call(this)},pushValue:function(){if(this.initialized){var a=this.el.dom.value;if(!this.activated&&a.length<1){a=this.defaultValue}if(this.fireEvent("beforepush",this,a)!==false){this.getEditorBody().innerHTML=a;if(Ext.isGecko){this.setDesignMode(false);this.setDesignMode(true)}this.fireEvent("push",this,a)}}},deferFocus:function(){this.focus.defer(10,this)},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus()}else{this.el.focus()}},initEditor:function(){try{var c=this.getEditorBody(),a=this.el.getStyles("font-size","font-family","background-image","background-repeat","background-color","color"),f,b;a["background-attachment"]="fixed";c.bgProperties="fixed";Ext.DomHelper.applyStyles(c,a);f=this.getDoc();if(f){try{Ext.EventManager.removeAll(f)}catch(d){}}b=this.onEditorEvent.createDelegate(this);Ext.EventManager.on(f,{mousedown:b,dblclick:b,click:b,keyup:b,buffer:100});if(Ext.isGecko){Ext.EventManager.on(f,"keypress",this.applyCommand,this)}if(Ext.isIE||Ext.isWebKit||Ext.isOpera){Ext.EventManager.on(f,"keydown",this.fixKeys,this)}f.editorInitialized=true;this.initialized=true;this.pushValue();this.setReadOnly(this.readOnly);this.fireEvent("initialize",this)}catch(d){}},onDestroy:function(){if(this.monitorTask){Ext.TaskMgr.stop(this.monitorTask)}if(this.rendered){Ext.destroy(this.tb);var b=this.getDoc();if(b){try{Ext.EventManager.removeAll(b);for(var c in b){delete b[c]}}catch(a){}}if(this.wrap){this.wrap.dom.innerHTML="";this.wrap.remove()}}if(this.el){this.el.removeAllListeners();this.el.remove()}this.purgeListeners()},onFirstFocus:function(){this.activated=true;this.disableItems(this.readOnly);if(Ext.isGecko){this.win.focus();var a=this.win.getSelection();if(!a.focusNode||a.focusNode.nodeType!=3){var b=a.getRangeAt(0);b.selectNodeContents(this.getEditorBody());b.collapse(true);this.deferFocus()}try{this.execCmd("useCSS",true);this.execCmd("styleWithCSS",false)}catch(c){}}this.fireEvent("activate",this)},adjustFont:function(b){var d=b.getItemId()=="increasefontsize"?1:-1,c=this.getDoc(),a=parseInt(c.queryCommandValue("FontSize")||2,10);if((Ext.isSafari&&!Ext.isSafari2)||Ext.isChrome||Ext.isAir){if(a<=10){a=1+d}else{if(a<=13){a=2+d}else{if(a<=16){a=3+d}else{if(a<=18){a=4+d}else{if(a<=24){a=5+d}else{a=6+d}}}}}a=a.constrain(1,6)}else{if(Ext.isSafari){d*=2}a=Math.max(1,a+d)+(Ext.isSafari?"px":0)}this.execCmd("FontSize",a)},onEditorEvent:function(a){this.updateToolbar()},updateToolbar:function(){if(this.readOnly){return}if(!this.activated){this.onFirstFocus();return}var b=this.tb.items.map,c=this.getDoc();if(this.enableFont&&!Ext.isSafari2){var a=(c.queryCommandValue("FontName")||this.defaultFont).toLowerCase();if(a!=this.fontSelect.dom.value){this.fontSelect.dom.value=a}}if(this.enableFormat){b.bold.toggle(c.queryCommandState("bold"));b.italic.toggle(c.queryCommandState("italic"));b.underline.toggle(c.queryCommandState("underline"))}if(this.enableAlignments){b.justifyleft.toggle(c.queryCommandState("justifyleft"));b.justifycenter.toggle(c.queryCommandState("justifycenter"));b.justifyright.toggle(c.queryCommandState("justifyright"))}if(!Ext.isSafari2&&this.enableLists){b.insertorderedlist.toggle(c.queryCommandState("insertorderedlist"));b.insertunorderedlist.toggle(c.queryCommandState("insertunorderedlist"))}Ext.menu.MenuMgr.hideAll();this.syncValue()},relayBtnCmd:function(a){this.relayCmd(a.getItemId())},relayCmd:function(b,a){(function(){this.focus();this.execCmd(b,a);this.updateToolbar()}).defer(10,this)},execCmd:function(b,a){var c=this.getDoc();c.execCommand(b,false,a===undefined?null:a);this.syncValue()},applyCommand:function(b){if(b.ctrlKey){var d=b.getCharCode(),a;if(d>0){d=String.fromCharCode(d);switch(d){case"b":a="bold";break;case"i":a="italic";break;case"u":a="underline";break}if(a){this.win.focus();this.execCmd(a);this.deferFocus();b.preventDefault()}}}},insertAtCursor:function(c){if(!this.activated){return}if(Ext.isIE){this.win.focus();var b=this.getDoc(),a=b.selection.createRange();if(a){a.pasteHTML(c);this.syncValue();this.deferFocus()}}else{this.win.focus();this.execCmd("InsertHTML",c);this.deferFocus()}},fixKeys:function(){if(Ext.isIE){return function(f){var a=f.getKey(),d=this.getDoc(),b;if(a==f.TAB){f.stopEvent();b=d.selection.createRange();if(b){b.collapse(true);b.pasteHTML("    ");this.deferFocus()}}else{if(a==f.ENTER){b=d.selection.createRange();if(b){var c=b.parentElement();if(!c||c.tagName.toLowerCase()!="li"){f.stopEvent();b.pasteHTML("
    ");b.collapse(false);b.select()}}}}}}else{if(Ext.isOpera){return function(b){var a=b.getKey();if(a==b.TAB){b.stopEvent();this.win.focus();this.execCmd("InsertHTML","    ");this.deferFocus()}}}else{if(Ext.isWebKit){return function(b){var a=b.getKey();if(a==b.TAB){b.stopEvent();this.execCmd("InsertText","\t");this.deferFocus()}else{if(a==b.ENTER){b.stopEvent();this.execCmd("InsertHtml","

    ");this.deferFocus()}}}}}}}(),getToolbar:function(){return this.tb},buttonTips:{bold:{title:"Bold (Ctrl+B)",text:"Make the selected text bold.",cls:"x-html-editor-tip"},italic:{title:"Italic (Ctrl+I)",text:"Make the selected text italic.",cls:"x-html-editor-tip"},underline:{title:"Underline (Ctrl+U)",text:"Underline the selected text.",cls:"x-html-editor-tip"},increasefontsize:{title:"Grow Text",text:"Increase the font size.",cls:"x-html-editor-tip"},decreasefontsize:{title:"Shrink Text",text:"Decrease the font size.",cls:"x-html-editor-tip"},backcolor:{title:"Text Highlight Color",text:"Change the background color of the selected text.",cls:"x-html-editor-tip"},forecolor:{title:"Font Color",text:"Change the color of the selected text.",cls:"x-html-editor-tip"},justifyleft:{title:"Align Text Left",text:"Align text to the left.",cls:"x-html-editor-tip"},justifycenter:{title:"Center Text",text:"Center text in the editor.",cls:"x-html-editor-tip"},justifyright:{title:"Align Text Right",text:"Align text to the right.",cls:"x-html-editor-tip"},insertunorderedlist:{title:"Bullet List",text:"Start a bulleted list.",cls:"x-html-editor-tip"},insertorderedlist:{title:"Numbered List",text:"Start a numbered list.",cls:"x-html-editor-tip"},createlink:{title:"Hyperlink",text:"Make the selected text a hyperlink.",cls:"x-html-editor-tip"},sourceedit:{title:"Source Edit",text:"Switch to source editing mode.",cls:"x-html-editor-tip"}}});Ext.reg("htmleditor",Ext.form.HtmlEditor);Ext.form.TimeField=Ext.extend(Ext.form.ComboBox,{minValue:undefined,maxValue:undefined,minText:"The time in this field must be equal to or after {0}",maxText:"The time in this field must be equal to or before {0}",invalidText:"{0} is not a valid time",format:"g:i A",altFormats:"g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H|gi a|hi a|giA|hiA|gi A|hi A",increment:15,mode:"local",triggerAction:"all",typeAhead:false,initDate:"1/1/2008",initDateFormat:"j/n/Y",initComponent:function(){if(Ext.isDefined(this.minValue)){this.setMinValue(this.minValue,true)}if(Ext.isDefined(this.maxValue)){this.setMaxValue(this.maxValue,true)}if(!this.store){this.generateStore(true)}Ext.form.TimeField.superclass.initComponent.call(this)},setMinValue:function(b,a){this.setLimit(b,true,a);return this},setMaxValue:function(b,a){this.setLimit(b,false,a);return this},generateStore:function(b){var c=this.minValue||new Date(this.initDate).clearTime(),a=this.maxValue||new Date(this.initDate).clearTime().add("mi",(24*60)-1),d=[];while(c<=a){d.push(c.dateFormat(this.format));c=c.add("mi",this.increment)}this.bindStore(d,b)},setLimit:function(b,f,a){var e;if(Ext.isString(b)){e=this.parseDate(b)}else{if(Ext.isDate(b)){e=b}}if(e){var c=new Date(this.initDate).clearTime();c.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());this[f?"minValue":"maxValue"]=c;if(!a){this.generateStore()}}},getValue:function(){var a=Ext.form.TimeField.superclass.getValue.call(this);return this.formatDate(this.parseDate(a))||""},setValue:function(a){return Ext.form.TimeField.superclass.setValue.call(this,this.formatDate(this.parseDate(a)))},validateValue:Ext.form.DateField.prototype.validateValue,formatDate:Ext.form.DateField.prototype.formatDate,parseDate:function(g){if(!g||Ext.isDate(g)){return g}var h=this.initDate+" ",f=this.initDateFormat+" ",b=Date.parseDate(h+g,f+this.format),c=this.altFormats;if(!b&&c){if(!this.altFormatsArray){this.altFormatsArray=c.split("|")}for(var e=0,d=this.altFormatsArray,a=d.length;e=0){if(!d){c=f-1}d=false;while(c>=0){if(e.call(i||this,j,c,h)===true){return[j,c]}c--}j--}}else{if(c>=f){j++;d=false}while(j','
    ','
    {header}
    ','
    {body}
    ',"
    ",'
     
    ','
     
    ',"")}if(!c.header){c.header=new Ext.Template('','{cells}',"
    ")}if(!c.hcell){c.hcell=new Ext.Template('
    ',this.grid.enableHdMenu?'':"",'{value}',"
    ")}if(!c.body){c.body=new Ext.Template("{rows}")}if(!c.row){c.row=new Ext.Template('
    ',"{cells}",(this.enableRowBody?'':""),"
    {body}
    ")}if(!c.cell){c.cell=new Ext.Template('','
    {value}
    ',"")}for(var a in c){var b=c[a];if(b&&Ext.isFunction(b.compile)&&!b.compiled){b.disableFormats=true;b.compile()}}this.templates=c;this.colRe=new RegExp("x-grid3-td-([^\\s]+)","")},fly:function(a){if(!this._flyweight){this._flyweight=new Ext.Element.Flyweight(document.body)}this._flyweight.dom=a;return this._flyweight},getEditorParent:function(){return this.scroller.dom},initElements:function(){var c=Ext.Element;var b=this.grid.getGridEl().dom.firstChild;var a=b.childNodes;this.el=new c(b);this.mainWrap=new c(a[0]);this.mainHd=new c(this.mainWrap.dom.firstChild);if(this.grid.hideHeaders){this.mainHd.setDisplayed(false)}this.innerHd=this.mainHd.dom.firstChild;this.scroller=new c(this.mainWrap.dom.childNodes[1]);if(this.forceFit){this.scroller.setStyle("overflow-x","hidden")}this.mainBody=new c(this.scroller.dom.firstChild);this.focusEl=new c(this.scroller.dom.childNodes[1]);this.focusEl.swallowEvent("click",true);this.resizeMarker=new c(a[1]);this.resizeProxy=new c(a[2])},getRows:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},findCell:function(a){if(!a){return false}return this.fly(a).findParent(this.cellSelector,this.cellSelectorDepth)},findCellIndex:function(c,b){var a=this.findCell(c);if(a&&(!b||this.fly(a).hasClass(b))){return this.getCellIndex(a)}return false},getCellIndex:function(b){if(b){var a=b.className.match(this.colRe);if(a&&a[1]){return this.cm.getIndexById(a[1])}}return false},findHeaderCell:function(b){var a=this.findCell(b);return a&&this.fly(a).hasClass(this.hdCls)?a:null},findHeaderIndex:function(a){return this.findCellIndex(a,this.hdCls)},findRow:function(a){if(!a){return false}return this.fly(a).findParent(this.rowSelector,this.rowSelectorDepth)},findRowIndex:function(a){var b=this.findRow(a);return b?b.rowIndex:false},findRowBody:function(a){if(!a){return false}return this.fly(a).findParent(this.rowBodySelector,this.rowBodySelectorDepth)},getRow:function(a){return this.getRows()[a]},getCell:function(b,a){return this.getRow(b).getElementsByTagName("td")[a]},getHeaderCell:function(a){return this.mainHd.dom.getElementsByTagName("td")[a]},addRowClass:function(c,a){var b=this.getRow(c);if(b){this.fly(b).addClass(a)}},removeRowClass:function(c,a){var b=this.getRow(c);if(b){this.fly(b).removeClass(a)}},removeRow:function(a){Ext.removeNode(this.getRow(a));this.syncFocusEl(a)},removeRows:function(c,a){var b=this.mainBody.dom;for(var d=c;d<=a;d++){Ext.removeNode(b.childNodes[c])}this.syncFocusEl(c)},getScrollState:function(){var a=this.scroller.dom;return{left:a.scrollLeft,top:a.scrollTop}},restoreScroll:function(a){var b=this.scroller.dom;b.scrollLeft=a.left;b.scrollTop=a.top},scrollToTop:function(){this.scroller.dom.scrollTop=0;this.scroller.dom.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var a=this.scroller.dom;this.grid.fireEvent("bodyscroll",a.scrollLeft,a.scrollTop)},syncHeaderScroll:function(){var a=this.scroller.dom;this.innerHd.scrollLeft=a.scrollLeft;this.innerHd.scrollLeft=a.scrollLeft},updateSortIcon:function(b,a){var d=this.sortClasses;var c=this.mainHd.select("td").removeClass(d);c.item(b).addClass(d[a=="DESC"?1:0])},updateAllColumnWidths:function(){var d=this.getTotalWidth(),k=this.cm.getColumnCount(),f=[],e,b;for(b=0;b=this.ds.getCount()){return null}d=(d!==undefined?d:0);var c=this.getRow(g),a=this.cm,e=a.getColumnCount(),b;if(!(f===false&&d===0)){while(dl){m.scrollTop=o-a}}if(e!==false){var k=parseInt(g.offsetLeft,10);var i=k+g.offsetWidth;var h=parseInt(m.scrollLeft,10);var b=h+m.clientWidth;if(kb){m.scrollLeft=i-m.clientWidth}}}return this.getResolvedXY(q)},insertRows:function(a,h,e,g){var d=a.getCount()-1;if(!g&&h===0&&e>=d){this.fireEvent("beforerowsinserted",this,h,e);this.refresh();this.fireEvent("rowsinserted",this,h,e)}else{if(!g){this.fireEvent("beforerowsinserted",this,h,e)}var b=this.renderRows(h,e),f=this.getRow(h);if(f){if(h===0){Ext.fly(this.getRow(0)).removeClass(this.firstRowCls)}Ext.DomHelper.insertHtml("beforeBegin",f,b)}else{var c=this.getRow(d-1);if(c){Ext.fly(c).removeClass(this.lastRowCls)}Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,b)}if(!g){this.fireEvent("rowsinserted",this,h,e);this.processRows(h)}else{if(h===0||h>=d){Ext.fly(this.getRow(h)).addClass(h===0?this.firstRowCls:this.lastRowCls)}}}this.syncFocusEl(h)},deleteRows:function(a,c,b){if(a.getRowCount()<1){this.refresh()}else{this.fireEvent("beforerowsdeleted",this,c,b);this.removeRows(c,b);this.processRows(c);this.fireEvent("rowsdeleted",this,c,b)}},getColumnStyle:function(a,c){var b=!c?(this.cm.config[a].css||""):"";b+="width:"+this.getColumnWidth(a)+";";if(this.cm.isHidden(a)){b+="display:none;"}var d=this.cm.config[a].align;if(d){b+="text-align:"+d+";"}return b},getColumnWidth:function(b){var a=this.cm.getColumnWidth(b);if(Ext.isNumber(a)){return(Ext.isBorderBox||(Ext.isWebKit&&!Ext.isSafari2)?a:(a-this.borderWidth>0?a-this.borderWidth:0))+"px"}return a},getTotalWidth:function(){return this.cm.getTotalWidth()+"px"},fitColumns:function(d,g,h){var p=this.cm,j;var k=p.getTotalWidth(false);var a=this.grid.getGridEl().getWidth(true)-this.getScrollOffset();if(a<20){return}var e=a-k;if(e===0){return false}var l=p.getColumnCount(true);var r=l-(Ext.isNumber(h)?1:0);if(r===0){r=1;h=undefined}var q=p.getColumnCount();var n=[];var m=0;var c=0;var o;for(j=0;ja){var f=r!=l?h:m;p.setColumnWidth(f,Math.max(1,p.getColumnWidth(f)-(k-a)),true)}if(d!==true){this.updateAllColumnWidths()}return true},autoExpand:function(b){var h=this.grid,a=this.cm;if(!this.userResized&&h.autoExpandColumn){var d=a.getTotalWidth(false);var i=this.grid.getGridEl().getWidth(true)-this.getScrollOffset();if(d!=i){var f=a.getIndexById(h.autoExpandColumn);var e=a.getColumnWidth(f);var c=Math.min(Math.max(((i-d)+e),h.autoExpandMin),h.autoExpandMax);if(c!=e){a.setColumnWidth(f,c,true);if(b!==true){this.updateColumnWidth(f,c)}}}}},getColumnData:function(){var d=[],a=this.cm,e=a.getColumnCount();for(var c=0;c'+this.emptyText+"")}},updateHeaderSortState:function(){var b=this.ds.getSortState();if(!b){return}if(!this.sortState||(this.sortState.field!=b.field||this.sortState.direction!=b.direction)){this.grid.fireEvent("sortchange",this.grid,b)}this.sortState=b;var c=this.cm.findColumnIndex(b.field);if(c!=-1){var a=b.direction;this.updateSortIcon(c,a)}},clearHeaderSortState:function(){if(!this.sortState){return}this.grid.fireEvent("sortchange",this.grid,null);this.mainHd.select("td").removeClass(this.sortClasses);delete this.sortState},destroy:function(){if(this.scrollToTopTask&&this.scrollToTopTask.cancel){this.scrollToTopTask.cancel()}if(this.colMenu){Ext.menu.MenuMgr.unregister(this.colMenu);this.colMenu.destroy();delete this.colMenu}if(this.hmenu){Ext.menu.MenuMgr.unregister(this.hmenu);this.hmenu.destroy();delete this.hmenu}this.initData(null,null);this.purgeListeners();Ext.fly(this.innerHd).un("click",this.handleHdDown,this);if(this.grid.enableColumnMove){Ext.destroy(this.columnDrag.el,this.columnDrag.proxy.ghost,this.columnDrag.proxy.el,this.columnDrop.el,this.columnDrop.proxyTop,this.columnDrop.proxyBottom,this.columnDrag.dragData.ddel,this.columnDrag.dragData.header);if(this.columnDrag.proxy.anim){Ext.destroy(this.columnDrag.proxy.anim)}delete this.columnDrag.proxy.ghost;delete this.columnDrag.dragData.ddel;delete this.columnDrag.dragData.header;this.columnDrag.destroy();delete Ext.dd.DDM.locationCache[this.columnDrag.id];delete this.columnDrag._domRef;delete this.columnDrop.proxyTop;delete this.columnDrop.proxyBottom;this.columnDrop.destroy();delete Ext.dd.DDM.locationCache["gridHeader"+this.grid.getGridEl().id];delete this.columnDrop._domRef;delete Ext.dd.DDM.ids[this.columnDrop.ddGroup]}if(this.splitZone){this.splitZone.destroy();delete this.splitZone._domRef;delete Ext.dd.DDM.ids["gridSplitters"+this.grid.getGridEl().id]}Ext.fly(this.innerHd).removeAllListeners();Ext.removeNode(this.innerHd);delete this.innerHd;Ext.destroy(this.el,this.mainWrap,this.mainHd,this.scroller,this.mainBody,this.focusEl,this.resizeMarker,this.resizeProxy,this.activeHdBtn,this.dragZone,this.splitZone,this._flyweight);delete this.grid.container;if(this.dragZone){this.dragZone.destroy()}Ext.dd.DDM.currentTarget=null;delete Ext.dd.DDM.locationCache[this.grid.getGridEl().id];Ext.EventManager.removeResizeListener(this.onWindowResize,this)},onDenyColumnHide:function(){},render:function(){if(this.autoFill){var a=this.grid.ownerCt;if(a&&a.getLayout()){a.on("afterlayout",function(){this.fitColumns(true,true);this.updateHeaders()},this,{single:true})}else{this.fitColumns(true,true)}}else{if(this.forceFit){this.fitColumns(true,false)}else{if(this.grid.autoExpandColumn){this.autoExpand(true)}}}this.renderUI()},initData:function(b,a){if(this.ds){this.ds.un("load",this.onLoad,this);this.ds.un("datachanged",this.onDataChange,this);this.ds.un("add",this.onAdd,this);this.ds.un("remove",this.onRemove,this);this.ds.un("update",this.onUpdate,this);this.ds.un("clear",this.onClear,this);if(this.ds!==b&&this.ds.autoDestroy){this.ds.destroy()}}if(b){b.on({scope:this,load:this.onLoad,datachanged:this.onDataChange,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,clear:this.onClear})}this.ds=b;if(this.cm){this.cm.un("configchange",this.onColConfigChange,this);this.cm.un("widthchange",this.onColWidthChange,this);this.cm.un("headerchange",this.onHeaderChange,this);this.cm.un("hiddenchange",this.onHiddenChange,this);this.cm.un("columnmoved",this.onColumnMove,this)}if(a){delete this.lastViewWidth;a.on({scope:this,configchange:this.onColConfigChange,widthchange:this.onColWidthChange,headerchange:this.onHeaderChange,hiddenchange:this.onHiddenChange,columnmoved:this.onColumnMove})}this.cm=a},onDataChange:function(){this.refresh();this.updateHeaderSortState();this.syncFocusEl(0)},onClear:function(){this.refresh();this.syncFocusEl(0)},onUpdate:function(b,a){this.refreshRow(a)},onAdd:function(c,a,b){this.insertRows(c,b,b+(a.length-1))},onRemove:function(d,a,b,c){if(c!==true){this.fireEvent("beforerowremoved",this,b,a)}this.removeRow(b);if(c!==true){this.processRows(b);this.applyEmptyText();this.fireEvent("rowremoved",this,b,a)}},onLoad:function(){if(Ext.isGecko){if(!this.scrollToTopTask){this.scrollToTopTask=new Ext.util.DelayedTask(this.scrollToTop,this)}this.scrollToTopTask.delay(1)}else{this.scrollToTop()}},onColWidthChange:function(a,b,c){this.updateColumnWidth(b,c)},onHeaderChange:function(a,b,c){this.updateHeaders()},onHiddenChange:function(a,b,c){this.updateColumnHidden(b,c)},onColumnMove:function(a,d,b){this.indexMap=null;var c=this.getScrollState();this.refresh(true);this.restoreScroll(c);this.afterMove(b);this.grid.fireEvent("columnmove",d,b)},onColConfigChange:function(){delete this.lastViewWidth;this.indexMap=null;this.refresh(true)},initUI:function(a){a.on("headerclick",this.onHeaderClick,this)},initEvents:function(){},onHeaderClick:function(b,a){if(this.headersDisabled||!this.cm.isSortable(a)){return}b.stopEditing(true);b.store.sort(this.cm.getDataIndex(a))},onRowOver:function(b,a){var c;if((c=this.findRowIndex(a))!==false){this.addRowClass(c,"x-grid3-row-over")}},onRowOut:function(b,a){var c;if((c=this.findRowIndex(a))!==false&&!b.within(this.getRow(c),true)){this.removeRowClass(c,"x-grid3-row-over")}},handleWheel:function(a){a.stopPropagation()},onRowSelect:function(a){this.addRowClass(a,this.selectedRowClass)},onRowDeselect:function(a){this.removeRowClass(a,this.selectedRowClass)},onCellSelect:function(c,b){var a=this.getCell(c,b);if(a){this.fly(a).addClass("x-grid3-cell-selected")}},onCellDeselect:function(c,b){var a=this.getCell(c,b);if(a){this.fly(a).removeClass("x-grid3-cell-selected")}},onColumnSplitterMoved:function(c,b){this.userResized=true;var a=this.grid.colModel;a.setColumnWidth(c,b,true);if(this.forceFit){this.fitColumns(true,false,c);this.updateAllColumnWidths()}else{this.updateColumnWidth(c,b);this.syncHeaderScroll()}this.grid.fireEvent("columnresize",c,b)},handleHdMenuClick:function(c){var b=this.hdCtxIndex,a=this.cm,d=this.ds,e=c.getItemId();switch(e){case"asc":d.sort(a.getDataIndex(b),"ASC");break;case"desc":d.sort(a.getDataIndex(b),"DESC");break;default:b=a.getIndexById(e.substr(4));if(b!=-1){if(c.checked&&a.getColumnsBy(this.isHideableColumn,this).length<=1){this.onDenyColumnHide();return false}a.setHidden(b,c.checked)}}return true},isHideableColumn:function(a){return !a.hidden},beforeColMenuShow:function(){var a=this.cm,c=a.getColumnCount();this.colMenu.removeAll();for(var b=0;b=0&&this.config[a].resizable!==false&&this.config[a].fixed!==true},setHidden:function(a,b){var d=this.config[a];if(d.hidden!==b){d.hidden=b;this.totalWidth=null;this.fireEvent("hiddenchange",this,a,b)}},setEditor:function(a,b){this.config[a].setEditor(b)},destroy:function(){var d;for(var b=0,a=this.config.length;b0},isSelected:function(a){var b=Ext.isNumber(a)?this.grid.store.getAt(a):a;return(b&&this.selections.key(b.id)?true:false)},isIdSelected:function(a){return(this.selections.key(a)?true:false)},handleMouseDown:function(d,h,f){if(f.button!==0||this.isLocked()){return}var a=this.grid.getView();if(f.shiftKey&&!this.singleSelect&&this.last!==false){var c=this.last;this.selectRange(c,h,f.ctrlKey);this.last=c;a.focusRow(h)}else{var b=this.isSelected(h);if(f.ctrlKey&&b){this.deselectRow(h)}else{if(!b||this.getCount()>1){this.selectRow(h,f.ctrlKey||f.shiftKey);a.focusRow(h)}}}},selectRows:function(c,d){if(!d){this.clearSelections()}for(var b=0,a=c.length;b=a;c--){this.selectRow(c,true)}}},deselectRange:function(c,b,a){if(this.isLocked()){return}for(var d=c;d<=b;d++){this.deselectRow(d,a)}},selectRow:function(b,d,a){if(this.isLocked()||(b<0||b>=this.grid.store.getCount())||(d&&this.isSelected(b))){return}var c=this.grid.store.getAt(b);if(c&&this.fireEvent("beforerowselect",this,b,d,c)!==false){if(!d||this.singleSelect){this.clearSelections()}this.selections.add(c);this.last=this.lastActive=b;if(!a){this.grid.getView().onRowSelect(b)}this.fireEvent("rowselect",this,b,c);this.fireEvent("selectionchange",this)}},deselectRow:function(b,a){if(this.isLocked()){return}if(this.last==b){this.last=false}if(this.lastActive==b){this.lastActive=false}var c=this.grid.store.getAt(b);if(c){this.selections.remove(c);if(!a){this.grid.getView().onRowDeselect(b)}this.fireEvent("rowdeselect",this,b,c);this.fireEvent("selectionchange",this)}},restoreLast:function(){if(this._last){this.last=this._last}},acceptsNav:function(c,b,a){return !a.isHidden(b)&&a.isCellEditable(b,c)},onEditorKey:function(m,j){var d=j.getKey(),f,h=this.grid,n=h.lastEdit,i=h.activeEditor,o,n,a,l;var b=j.shiftKey;if(d==j.TAB){j.stopEvent();i.completeEdit();if(b){f=h.walkCells(i.row,i.col-1,-1,this.acceptsNav,this)}else{f=h.walkCells(i.row,i.col+1,1,this.acceptsNav,this)}}else{if(d==j.ENTER){if(this.moveEditorOnEnter!==false){if(b){f=h.walkCells(n.row-1,n.col,-1,this.acceptsNav,this)}else{f=h.walkCells(n.row+1,n.col,1,this.acceptsNav,this)}}}}if(f){a=f[0];l=f[1];if(n.row!=a){this.selectRow(a)}if(h.isEditor&&h.editing){o=h.activeEditor;if(o&&o.field.triggerBlur){o.field.triggerBlur()}}h.startEditing(a,l)}},destroy:function(){if(this.rowNav){this.rowNav.disable();this.rowNav=null}Ext.grid.RowSelectionModel.superclass.destroy.call(this)}});Ext.grid.Column=Ext.extend(Object,{isColumn:true,constructor:function(b){Ext.apply(this,b);if(Ext.isString(this.renderer)){this.renderer=Ext.util.Format[this.renderer]}else{if(Ext.isObject(this.renderer)){this.scope=this.renderer.scope;this.renderer=this.renderer.fn}}if(!this.scope){this.scope=this}var a=this.editor;delete this.editor;this.setEditor(a)},renderer:function(a){if(Ext.isString(a)&&a.length<1){return" "}return a},getEditor:function(a){return this.editable!==false?this.editor:null},setEditor:function(b){var a=this.editor;if(a){if(a.gridEditor){a.gridEditor.destroy();delete a.gridEditor}else{a.destroy()}}this.editor=null;if(b){if(!b.isXType){b=Ext.create(b,"textfield")}this.editor=b}},getCellEditor:function(b){var a=this.getEditor(b);if(a){if(!a.startEdit){if(!a.gridEditor){a.gridEditor=new Ext.grid.GridEditor(a)}a=a.gridEditor}}return a}});Ext.grid.BooleanColumn=Ext.extend(Ext.grid.Column,{trueText:"true",falseText:"false",undefinedText:" ",constructor:function(a){Ext.grid.BooleanColumn.superclass.constructor.call(this,a);var c=this.trueText,d=this.falseText,b=this.undefinedText;this.renderer=function(e){if(e===undefined){return b}if(!e||e==="false"){return d}return c}}});Ext.grid.NumberColumn=Ext.extend(Ext.grid.Column,{format:"0,000.00",constructor:function(a){Ext.grid.NumberColumn.superclass.constructor.call(this,a);this.renderer=Ext.util.Format.numberRenderer(this.format)}});Ext.grid.DateColumn=Ext.extend(Ext.grid.Column,{format:"m/d/Y",constructor:function(a){Ext.grid.DateColumn.superclass.constructor.call(this,a);this.renderer=Ext.util.Format.dateRenderer(this.format)}});Ext.grid.TemplateColumn=Ext.extend(Ext.grid.Column,{constructor:function(a){Ext.grid.TemplateColumn.superclass.constructor.call(this,a);var b=(!Ext.isPrimitive(this.tpl)&&this.tpl.compile)?this.tpl:new Ext.XTemplate(this.tpl);this.renderer=function(d,e,c){return b.apply(c.data)};this.tpl=b}});Ext.grid.Column.types={gridcolumn:Ext.grid.Column,booleancolumn:Ext.grid.BooleanColumn,numbercolumn:Ext.grid.NumberColumn,datecolumn:Ext.grid.DateColumn,templatecolumn:Ext.grid.TemplateColumn};Ext.grid.RowNumberer=Ext.extend(Object,{header:"",width:23,sortable:false,constructor:function(a){Ext.apply(this,a);if(this.rowspan){this.renderer=this.renderer.createDelegate(this)}},fixed:true,hideable:false,menuDisabled:true,dataIndex:"",id:"numberer",rowspan:undefined,renderer:function(b,c,a,d){if(this.rowspan){c.cellAttr='rowspan="'+this.rowspan+'"'}return d+1}});Ext.grid.CheckboxSelectionModel=Ext.extend(Ext.grid.RowSelectionModel,{header:'
     
    ',width:20,sortable:false,menuDisabled:true,fixed:true,hideable:false,dataIndex:"",id:"checker",constructor:function(){Ext.grid.CheckboxSelectionModel.superclass.constructor.apply(this,arguments);if(this.checkOnly){this.handleMouseDown=Ext.emptyFn}},initEvents:function(){Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this);this.grid.on("render",function(){var a=this.grid.getView();a.mainBody.on("mousedown",this.onMouseDown,this);Ext.fly(a.innerHd).on("mousedown",this.onHdMouseDown,this)},this)},handleMouseDown:function(){Ext.grid.CheckboxSelectionModel.superclass.handleMouseDown.apply(this,arguments);this.mouseHandled=true},onMouseDown:function(c,b){if(c.button===0&&b.className=="x-grid3-row-checker"){c.stopEvent();var d=c.getTarget(".x-grid3-row");if(!this.mouseHandled&&d){var a=d.rowIndex;if(this.isSelected(a)){this.deselectRow(a)}else{this.selectRow(a,true)}}}this.mouseHandled=false},onHdMouseDown:function(c,a){if(a.className=="x-grid3-hd-checker"){c.stopEvent();var b=Ext.fly(a.parentNode);var d=b.hasClass("x-grid3-hd-checker-on");if(d){b.removeClass("x-grid3-hd-checker-on");this.clearSelections()}else{b.addClass("x-grid3-hd-checker-on");this.selectAll()}}},renderer:function(b,c,a){return'
     
    '}}); \ No newline at end of file +Ext.grid.GridPanel=Ext.extend(Ext.Panel,{autoExpandColumn:false,autoExpandMax:1000,autoExpandMin:50,columnLines:false,ddText:"{0} selected row{1}",deferRowRender:true,enableColumnHide:true,enableColumnMove:true,enableDragDrop:false,enableHdMenu:true,loadMask:false,minColumnWidth:25,stripeRows:false,trackMouseOver:true,stateEvents:["columnmove","columnresize","sortchange","groupchange"],view:null,bubbleEvents:[],rendered:false,viewReady:false,initComponent:function(){Ext.grid.GridPanel.superclass.initComponent.call(this);if(this.columnLines){this.cls=(this.cls||"")+" x-grid-with-col-lines"}this.autoScroll=false;this.autoWidth=false;if(Ext.isArray(this.columns)){this.colModel=new Ext.grid.ColumnModel(this.columns);delete this.columns}if(this.ds){this.store=this.ds;delete this.ds}if(this.cm){this.colModel=this.cm;delete this.cm}if(this.sm){this.selModel=this.sm;delete this.sm}this.store=Ext.StoreMgr.lookup(this.store);this.addEvents("click","dblclick","contextmenu","mousedown","mouseup","mouseover","mouseout","keypress","keydown","cellmousedown","rowmousedown","headermousedown","groupmousedown","rowbodymousedown","containermousedown","cellclick","celldblclick","rowclick","rowdblclick","headerclick","headerdblclick","groupclick","groupdblclick","containerclick","containerdblclick","rowbodyclick","rowbodydblclick","rowcontextmenu","cellcontextmenu","headercontextmenu","groupcontextmenu","containercontextmenu","rowbodycontextmenu","bodyscroll","columnresize","columnmove","sortchange","groupchange","reconfigure","viewready")},onRender:function(d,a){Ext.grid.GridPanel.superclass.onRender.apply(this,arguments);var e=this.getGridEl();this.el.addClass("x-grid-panel");this.mon(e,{scope:this,mousedown:this.onMouseDown,click:this.onClick,dblclick:this.onDblClick,contextmenu:this.onContextMenu});this.relayEvents(e,["mousedown","mouseup","mouseover","mouseout","keypress","keydown"]);var b=this.getView();b.init(this);b.render();this.getSelectionModel().init(this)},initEvents:function(){Ext.grid.GridPanel.superclass.initEvents.call(this);if(this.loadMask){this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({store:this.store},this.loadMask))}},initStateEvents:function(){Ext.grid.GridPanel.superclass.initStateEvents.call(this);this.mon(this.colModel,"hiddenchange",this.saveState,this,{delay:100})},applyState:function(a){var k=this.colModel,f=a.columns,j=this.store,l,g,h;if(f){for(var d=0,e=f.length;d=0){if(!d){c=f-1}d=false;while(c>=0){if(e.call(i||this,j,c,h)===true){return[j,c]}c--}j--}}else{if(c>=f){j++;d=false}while(j','
    ','
    {header}
    ','
    {body}
    ',"
    ",'
     
    ','
     
    ',"")}if(!c.header){c.header=new Ext.Template('','{cells}',"
    ")}if(!c.hcell){c.hcell=new Ext.Template('
    ',this.grid.enableHdMenu?'':"",'{value}',"
    ")}if(!c.body){c.body=new Ext.Template("{rows}")}if(!c.row){c.row=new Ext.Template('
    ',"{cells}",(this.enableRowBody?'':""),"
    {body}
    ")}if(!c.cell){c.cell=new Ext.Template('','
    {value}
    ',"")}for(var a in c){var b=c[a];if(b&&Ext.isFunction(b.compile)&&!b.compiled){b.disableFormats=true;b.compile()}}this.templates=c;this.colRe=new RegExp("x-grid3-td-([^\\s]+)","")},fly:function(a){if(!this._flyweight){this._flyweight=new Ext.Element.Flyweight(document.body)}this._flyweight.dom=a;return this._flyweight},getEditorParent:function(){return this.scroller.dom},initElements:function(){var c=Ext.Element;var b=this.grid.getGridEl().dom.firstChild;var a=b.childNodes;this.el=new c(b);this.mainWrap=new c(a[0]);this.mainHd=new c(this.mainWrap.dom.firstChild);if(this.grid.hideHeaders){this.mainHd.setDisplayed(false)}this.innerHd=this.mainHd.dom.firstChild;this.scroller=new c(this.mainWrap.dom.childNodes[1]);if(this.forceFit){this.scroller.setStyle("overflow-x","hidden")}this.mainBody=new c(this.scroller.dom.firstChild);this.focusEl=new c(this.scroller.dom.childNodes[1]);this.focusEl.swallowEvent("click",true);this.resizeMarker=new c(a[1]);this.resizeProxy=new c(a[2])},getRows:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},findCell:function(a){if(!a){return false}return this.fly(a).findParent(this.cellSelector,this.cellSelectorDepth)},findCellIndex:function(c,b){var a=this.findCell(c);if(a&&(!b||this.fly(a).hasClass(b))){return this.getCellIndex(a)}return false},getCellIndex:function(b){if(b){var a=b.className.match(this.colRe);if(a&&a[1]){return this.cm.getIndexById(a[1])}}return false},findHeaderCell:function(b){var a=this.findCell(b);return a&&this.fly(a).hasClass(this.hdCls)?a:null},findHeaderIndex:function(a){return this.findCellIndex(a,this.hdCls)},findRow:function(a){if(!a){return false}return this.fly(a).findParent(this.rowSelector,this.rowSelectorDepth)},findRowIndex:function(a){var b=this.findRow(a);return b?b.rowIndex:false},findRowBody:function(a){if(!a){return false}return this.fly(a).findParent(this.rowBodySelector,this.rowBodySelectorDepth)},getRow:function(a){return this.getRows()[a]},getCell:function(b,a){return this.getRow(b).getElementsByTagName("td")[a]},getHeaderCell:function(a){return this.mainHd.dom.getElementsByTagName("td")[a]},addRowClass:function(c,a){var b=this.getRow(c);if(b){this.fly(b).addClass(a)}},removeRowClass:function(c,a){var b=this.getRow(c);if(b){this.fly(b).removeClass(a)}},removeRow:function(a){Ext.removeNode(this.getRow(a));this.syncFocusEl(a)},removeRows:function(c,a){var b=this.mainBody.dom;for(var d=c;d<=a;d++){Ext.removeNode(b.childNodes[c])}this.syncFocusEl(c)},getScrollState:function(){var a=this.scroller.dom;return{left:a.scrollLeft,top:a.scrollTop}},restoreScroll:function(a){var b=this.scroller.dom;b.scrollLeft=a.left;b.scrollTop=a.top},scrollToTop:function(){this.scroller.dom.scrollTop=0;this.scroller.dom.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var a=this.scroller.dom;this.grid.fireEvent("bodyscroll",a.scrollLeft,a.scrollTop)},syncHeaderScroll:function(){var a=this.scroller.dom;this.innerHd.scrollLeft=a.scrollLeft;this.innerHd.scrollLeft=a.scrollLeft},updateSortIcon:function(b,a){var d=this.sortClasses;var c=this.mainHd.select("td").removeClass(d);c.item(b).addClass(d[a=="DESC"?1:0])},updateAllColumnWidths:function(){var d=this.getTotalWidth(),k=this.cm.getColumnCount(),f=[],e,b;for(b=0;b=this.ds.getCount()){return null}d=(d!==undefined?d:0);var c=this.getRow(g),a=this.cm,e=a.getColumnCount(),b;if(!(f===false&&d===0)){while(dl){m.scrollTop=o-a}}if(e!==false){var k=parseInt(g.offsetLeft,10);var i=k+g.offsetWidth;var h=parseInt(m.scrollLeft,10);var b=h+m.clientWidth;if(kb){m.scrollLeft=i-m.clientWidth}}}return this.getResolvedXY(q)},insertRows:function(a,h,e,g){var d=a.getCount()-1;if(!g&&h===0&&e>=d){this.fireEvent("beforerowsinserted",this,h,e);this.refresh();this.fireEvent("rowsinserted",this,h,e)}else{if(!g){this.fireEvent("beforerowsinserted",this,h,e)}var b=this.renderRows(h,e),f=this.getRow(h);if(f){if(h===0){Ext.fly(this.getRow(0)).removeClass(this.firstRowCls)}Ext.DomHelper.insertHtml("beforeBegin",f,b)}else{var c=this.getRow(d-1);if(c){Ext.fly(c).removeClass(this.lastRowCls)}Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,b)}if(!g){this.fireEvent("rowsinserted",this,h,e);this.processRows(h)}else{if(h===0||h>=d){Ext.fly(this.getRow(h)).addClass(h===0?this.firstRowCls:this.lastRowCls)}}}this.syncFocusEl(h)},deleteRows:function(a,c,b){if(a.getRowCount()<1){this.refresh()}else{this.fireEvent("beforerowsdeleted",this,c,b);this.removeRows(c,b);this.processRows(c);this.fireEvent("rowsdeleted",this,c,b)}},getColumnStyle:function(a,c){var b=!c?(this.cm.config[a].css||""):"";b+="width:"+this.getColumnWidth(a)+";";if(this.cm.isHidden(a)){b+="display:none;"}var d=this.cm.config[a].align;if(d){b+="text-align:"+d+";"}return b},getColumnWidth:function(b){var a=this.cm.getColumnWidth(b);if(Ext.isNumber(a)){return(Ext.isBorderBox||(Ext.isWebKit&&!Ext.isSafari2)?a:(a-this.borderWidth>0?a-this.borderWidth:0))+"px"}return a},getTotalWidth:function(){return this.cm.getTotalWidth()+"px"},fitColumns:function(d,g,h){var p=this.cm,j;var k=p.getTotalWidth(false);var a=this.grid.getGridEl().getWidth(true)-this.getScrollOffset();if(a<20){return}var e=a-k;if(e===0){return false}var l=p.getColumnCount(true);var r=l-(Ext.isNumber(h)?1:0);if(r===0){r=1;h=undefined}var q=p.getColumnCount();var n=[];var m=0;var c=0;var o;for(j=0;ja){var f=r!=l?h:m;p.setColumnWidth(f,Math.max(1,p.getColumnWidth(f)-(k-a)),true)}if(d!==true){this.updateAllColumnWidths()}return true},autoExpand:function(b){var h=this.grid,a=this.cm;if(!this.userResized&&h.autoExpandColumn){var d=a.getTotalWidth(false);var i=this.grid.getGridEl().getWidth(true)-this.getScrollOffset();if(d!=i){var f=a.getIndexById(h.autoExpandColumn);var e=a.getColumnWidth(f);var c=Math.min(Math.max(((i-d)+e),h.autoExpandMin),h.autoExpandMax);if(c!=e){a.setColumnWidth(f,c,true);if(b!==true){this.updateColumnWidth(f,c)}}}}},getColumnData:function(){var d=[],a=this.cm,e=a.getColumnCount();for(var c=0;c'+this.emptyText+"")}},updateHeaderSortState:function(){var b=this.ds.getSortState();if(!b){return}if(!this.sortState||(this.sortState.field!=b.field||this.sortState.direction!=b.direction)){this.grid.fireEvent("sortchange",this.grid,b)}this.sortState=b;var c=this.cm.findColumnIndex(b.field);if(c!=-1){var a=b.direction;this.updateSortIcon(c,a)}},clearHeaderSortState:function(){if(!this.sortState){return}this.grid.fireEvent("sortchange",this.grid,null);this.mainHd.select("td").removeClass(this.sortClasses);delete this.sortState},destroy:function(){if(this.scrollToTopTask&&this.scrollToTopTask.cancel){this.scrollToTopTask.cancel()}if(this.colMenu){Ext.menu.MenuMgr.unregister(this.colMenu);this.colMenu.destroy();delete this.colMenu}if(this.hmenu){Ext.menu.MenuMgr.unregister(this.hmenu);this.hmenu.destroy();delete this.hmenu}this.initData(null,null);this.purgeListeners();Ext.fly(this.innerHd).un("click",this.handleHdDown,this);if(this.grid.enableColumnMove){Ext.destroy(this.columnDrag.el,this.columnDrag.proxy.ghost,this.columnDrag.proxy.el,this.columnDrop.el,this.columnDrop.proxyTop,this.columnDrop.proxyBottom,this.columnDrag.dragData.ddel,this.columnDrag.dragData.header);if(this.columnDrag.proxy.anim){Ext.destroy(this.columnDrag.proxy.anim)}delete this.columnDrag.proxy.ghost;delete this.columnDrag.dragData.ddel;delete this.columnDrag.dragData.header;this.columnDrag.destroy();delete Ext.dd.DDM.locationCache[this.columnDrag.id];delete this.columnDrag._domRef;delete this.columnDrop.proxyTop;delete this.columnDrop.proxyBottom;this.columnDrop.destroy();delete Ext.dd.DDM.locationCache["gridHeader"+this.grid.getGridEl().id];delete this.columnDrop._domRef;delete Ext.dd.DDM.ids[this.columnDrop.ddGroup]}if(this.splitZone){this.splitZone.destroy();delete this.splitZone._domRef;delete Ext.dd.DDM.ids["gridSplitters"+this.grid.getGridEl().id]}Ext.fly(this.innerHd).removeAllListeners();Ext.removeNode(this.innerHd);delete this.innerHd;Ext.destroy(this.el,this.mainWrap,this.mainHd,this.scroller,this.mainBody,this.focusEl,this.resizeMarker,this.resizeProxy,this.activeHdBtn,this.dragZone,this.splitZone,this._flyweight);delete this.grid.container;if(this.dragZone){this.dragZone.destroy()}Ext.dd.DDM.currentTarget=null;delete Ext.dd.DDM.locationCache[this.grid.getGridEl().id];Ext.EventManager.removeResizeListener(this.onWindowResize,this)},onDenyColumnHide:function(){},render:function(){if(this.autoFill){var a=this.grid.ownerCt;if(a&&a.getLayout()){a.on("afterlayout",function(){this.fitColumns(true,true);this.updateHeaders()},this,{single:true})}else{this.fitColumns(true,true)}}else{if(this.forceFit){this.fitColumns(true,false)}else{if(this.grid.autoExpandColumn){this.autoExpand(true)}}}this.renderUI()},initData:function(b,a){if(this.ds){this.ds.un("load",this.onLoad,this);this.ds.un("datachanged",this.onDataChange,this);this.ds.un("add",this.onAdd,this);this.ds.un("remove",this.onRemove,this);this.ds.un("update",this.onUpdate,this);this.ds.un("clear",this.onClear,this);if(this.ds!==b&&this.ds.autoDestroy){this.ds.destroy()}}if(b){b.on({scope:this,load:this.onLoad,datachanged:this.onDataChange,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,clear:this.onClear})}this.ds=b;if(this.cm){this.cm.un("configchange",this.onColConfigChange,this);this.cm.un("widthchange",this.onColWidthChange,this);this.cm.un("headerchange",this.onHeaderChange,this);this.cm.un("hiddenchange",this.onHiddenChange,this);this.cm.un("columnmoved",this.onColumnMove,this)}if(a){delete this.lastViewWidth;a.on({scope:this,configchange:this.onColConfigChange,widthchange:this.onColWidthChange,headerchange:this.onHeaderChange,hiddenchange:this.onHiddenChange,columnmoved:this.onColumnMove})}this.cm=a},onDataChange:function(){this.refresh();this.updateHeaderSortState();this.syncFocusEl(0)},onClear:function(){this.refresh();this.syncFocusEl(0)},onUpdate:function(b,a){this.refreshRow(a)},onAdd:function(c,a,b){this.insertRows(c,b,b+(a.length-1))},onRemove:function(d,a,b,c){if(c!==true){this.fireEvent("beforerowremoved",this,b,a)}this.removeRow(b);if(c!==true){this.processRows(b);this.applyEmptyText();this.fireEvent("rowremoved",this,b,a)}},onLoad:function(){if(Ext.isGecko){if(!this.scrollToTopTask){this.scrollToTopTask=new Ext.util.DelayedTask(this.scrollToTop,this)}this.scrollToTopTask.delay(1)}else{this.scrollToTop()}},onColWidthChange:function(a,b,c){this.updateColumnWidth(b,c)},onHeaderChange:function(a,b,c){this.updateHeaders()},onHiddenChange:function(a,b,c){this.updateColumnHidden(b,c)},onColumnMove:function(a,d,b){this.indexMap=null;var c=this.getScrollState();this.refresh(true);this.restoreScroll(c);this.afterMove(b);this.grid.fireEvent("columnmove",d,b)},onColConfigChange:function(){delete this.lastViewWidth;this.indexMap=null;this.refresh(true)},initUI:function(a){a.on("headerclick",this.onHeaderClick,this)},initEvents:function(){},onHeaderClick:function(b,a){if(this.headersDisabled||!this.cm.isSortable(a)){return}b.stopEditing(true);b.store.sort(this.cm.getDataIndex(a))},onRowOver:function(b,a){var c;if((c=this.findRowIndex(a))!==false){this.addRowClass(c,"x-grid3-row-over")}},onRowOut:function(b,a){var c;if((c=this.findRowIndex(a))!==false&&!b.within(this.getRow(c),true)){this.removeRowClass(c,"x-grid3-row-over")}},handleWheel:function(a){a.stopPropagation()},onRowSelect:function(a){this.addRowClass(a,this.selectedRowClass)},onRowDeselect:function(a){this.removeRowClass(a,this.selectedRowClass)},onCellSelect:function(c,b){var a=this.getCell(c,b);if(a){this.fly(a).addClass("x-grid3-cell-selected")}},onCellDeselect:function(c,b){var a=this.getCell(c,b);if(a){this.fly(a).removeClass("x-grid3-cell-selected")}},onColumnSplitterMoved:function(c,b){this.userResized=true;var a=this.grid.colModel;a.setColumnWidth(c,b,true);if(this.forceFit){this.fitColumns(true,false,c);this.updateAllColumnWidths()}else{this.updateColumnWidth(c,b);this.syncHeaderScroll()}this.grid.fireEvent("columnresize",c,b)},handleHdMenuClick:function(c){var b=this.hdCtxIndex,a=this.cm,d=this.ds,e=c.getItemId();switch(e){case"asc":d.sort(a.getDataIndex(b),"ASC");break;case"desc":d.sort(a.getDataIndex(b),"DESC");break;default:b=a.getIndexById(e.substr(4));if(b!=-1){if(c.checked&&a.getColumnsBy(this.isHideableColumn,this).length<=1){this.onDenyColumnHide();return false}a.setHidden(b,c.checked)}}return true},isHideableColumn:function(a){return !a.hidden},beforeColMenuShow:function(){var a=this.cm,c=a.getColumnCount();this.colMenu.removeAll();for(var b=0;b=0&&this.config[a].resizable!==false&&this.config[a].fixed!==true},setHidden:function(a,b){var d=this.config[a];if(d.hidden!==b){d.hidden=b;this.totalWidth=null;this.fireEvent("hiddenchange",this,a,b)}},setEditor:function(a,b){this.config[a].setEditor(b)},destroy:function(){var d;for(var b=0,a=this.config.length;b0},isSelected:function(a){var b=Ext.isNumber(a)?this.grid.store.getAt(a):a;return(b&&this.selections.key(b.id)?true:false)},isIdSelected:function(a){return(this.selections.key(a)?true:false)},handleMouseDown:function(d,h,f){if(f.button!==0||this.isLocked()){return}var a=this.grid.getView();if(f.shiftKey&&!this.singleSelect&&this.last!==false){var c=this.last;this.selectRange(c,h,f.ctrlKey);this.last=c;a.focusRow(h)}else{var b=this.isSelected(h);if(f.ctrlKey&&b){this.deselectRow(h)}else{if(!b||this.getCount()>1){this.selectRow(h,f.ctrlKey||f.shiftKey);a.focusRow(h)}}}},selectRows:function(c,d){if(!d){this.clearSelections()}for(var b=0,a=c.length;b=a;c--){this.selectRow(c,true)}}},deselectRange:function(c,b,a){if(this.isLocked()){return}for(var d=c;d<=b;d++){this.deselectRow(d,a)}},selectRow:function(b,d,a){if(this.isLocked()||(b<0||b>=this.grid.store.getCount())||(d&&this.isSelected(b))){return}var c=this.grid.store.getAt(b);if(c&&this.fireEvent("beforerowselect",this,b,d,c)!==false){if(!d||this.singleSelect){this.clearSelections()}this.selections.add(c);this.last=this.lastActive=b;if(!a){this.grid.getView().onRowSelect(b)}this.fireEvent("rowselect",this,b,c);this.fireEvent("selectionchange",this)}},deselectRow:function(b,a){if(this.isLocked()){return}if(this.last==b){this.last=false}if(this.lastActive==b){this.lastActive=false}var c=this.grid.store.getAt(b);if(c){this.selections.remove(c);if(!a){this.grid.getView().onRowDeselect(b)}this.fireEvent("rowdeselect",this,b,c);this.fireEvent("selectionchange",this)}},restoreLast:function(){if(this._last){this.last=this._last}},acceptsNav:function(c,b,a){return !a.isHidden(b)&&a.isCellEditable(b,c)},onEditorKey:function(m,j){var d=j.getKey(),f,h=this.grid,n=h.lastEdit,i=h.activeEditor,o,n,a,l;var b=j.shiftKey;if(d==j.TAB){j.stopEvent();i.completeEdit();if(b){f=h.walkCells(i.row,i.col-1,-1,this.acceptsNav,this)}else{f=h.walkCells(i.row,i.col+1,1,this.acceptsNav,this)}}else{if(d==j.ENTER){if(this.moveEditorOnEnter!==false){if(b){f=h.walkCells(n.row-1,n.col,-1,this.acceptsNav,this)}else{f=h.walkCells(n.row+1,n.col,1,this.acceptsNav,this)}}}}if(f){a=f[0];l=f[1];if(n.row!=a){this.selectRow(a)}if(h.isEditor&&h.editing){o=h.activeEditor;if(o&&o.field.triggerBlur){o.field.triggerBlur()}}h.startEditing(a,l)}},destroy:function(){if(this.rowNav){this.rowNav.disable();this.rowNav=null}Ext.grid.RowSelectionModel.superclass.destroy.call(this)}});Ext.grid.Column=Ext.extend(Object,{isColumn:true,constructor:function(b){Ext.apply(this,b);if(Ext.isString(this.renderer)){this.renderer=Ext.util.Format[this.renderer]}else{if(Ext.isObject(this.renderer)){this.scope=this.renderer.scope;this.renderer=this.renderer.fn}}if(!this.scope){this.scope=this}var a=this.editor;delete this.editor;this.setEditor(a)},renderer:function(a){if(Ext.isString(a)&&a.length<1){return" "}return a},getEditor:function(a){return this.editable!==false?this.editor:null},setEditor:function(b){var a=this.editor;if(a){if(a.gridEditor){a.gridEditor.destroy();delete a.gridEditor}else{a.destroy()}}this.editor=null;if(b){if(!b.isXType){b=Ext.create(b,"textfield")}this.editor=b}},getCellEditor:function(b){var a=this.getEditor(b);if(a){if(!a.startEdit){if(!a.gridEditor){a.gridEditor=new Ext.grid.GridEditor(a)}a=a.gridEditor}}return a}});Ext.grid.BooleanColumn=Ext.extend(Ext.grid.Column,{trueText:"true",falseText:"false",undefinedText:" ",constructor:function(a){Ext.grid.BooleanColumn.superclass.constructor.call(this,a);var c=this.trueText,d=this.falseText,b=this.undefinedText;this.renderer=function(e){if(e===undefined){return b}if(!e||e==="false"){return d}return c}}});Ext.grid.NumberColumn=Ext.extend(Ext.grid.Column,{format:"0,000.00",constructor:function(a){Ext.grid.NumberColumn.superclass.constructor.call(this,a);this.renderer=Ext.util.Format.numberRenderer(this.format)}});Ext.grid.DateColumn=Ext.extend(Ext.grid.Column,{format:"m/d/Y",constructor:function(a){Ext.grid.DateColumn.superclass.constructor.call(this,a);this.renderer=Ext.util.Format.dateRenderer(this.format)}});Ext.grid.TemplateColumn=Ext.extend(Ext.grid.Column,{constructor:function(a){Ext.grid.TemplateColumn.superclass.constructor.call(this,a);var b=(!Ext.isPrimitive(this.tpl)&&this.tpl.compile)?this.tpl:new Ext.XTemplate(this.tpl);this.renderer=function(d,e,c){return b.apply(c.data)};this.tpl=b}});Ext.grid.Column.types={gridcolumn:Ext.grid.Column,booleancolumn:Ext.grid.BooleanColumn,numbercolumn:Ext.grid.NumberColumn,datecolumn:Ext.grid.DateColumn,templatecolumn:Ext.grid.TemplateColumn};Ext.grid.RowNumberer=Ext.extend(Object,{header:"",width:23,sortable:false,constructor:function(a){Ext.apply(this,a);if(this.rowspan){this.renderer=this.renderer.createDelegate(this)}},fixed:true,hideable:false,menuDisabled:true,dataIndex:"",id:"numberer",rowspan:undefined,renderer:function(b,c,a,d){if(this.rowspan){c.cellAttr='rowspan="'+this.rowspan+'"'}return d+1}});Ext.grid.CheckboxSelectionModel=Ext.extend(Ext.grid.RowSelectionModel,{header:'
     
    ',width:20,sortable:false,menuDisabled:true,fixed:true,hideable:false,dataIndex:"",id:"checker",constructor:function(){Ext.grid.CheckboxSelectionModel.superclass.constructor.apply(this,arguments);if(this.checkOnly){this.handleMouseDown=Ext.emptyFn}},initEvents:function(){Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this);this.grid.on("render",function(){var a=this.grid.getView();a.mainBody.on("mousedown",this.onMouseDown,this);Ext.fly(a.innerHd).on("mousedown",this.onHdMouseDown,this)},this)},handleMouseDown:function(){Ext.grid.CheckboxSelectionModel.superclass.handleMouseDown.apply(this,arguments);this.mouseHandled=true},onMouseDown:function(c,b){if(c.button===0&&b.className=="x-grid3-row-checker"){c.stopEvent();var d=c.getTarget(".x-grid3-row");if(!this.mouseHandled&&d){var a=d.rowIndex;if(this.isSelected(a)){this.deselectRow(a)}else{this.selectRow(a,true);this.grid.getView().focusRow(a)}}}this.mouseHandled=false},onHdMouseDown:function(c,a){if(a.className=="x-grid3-hd-checker"){c.stopEvent();var b=Ext.fly(a.parentNode);var d=b.hasClass("x-grid3-hd-checker-on");if(d){b.removeClass("x-grid3-hd-checker-on");this.clearSelections()}else{b.addClass("x-grid3-hd-checker-on");this.selectAll()}}},renderer:function(b,c,a){return'
     
    '}}); \ No newline at end of file diff --git a/pkgs/pkg-grid-grouping-debug.js b/pkgs/pkg-grid-grouping-debug.js index f7b302d3..f268cf7c 100644 --- a/pkgs/pkg-grid-grouping-debug.js +++ b/pkgs/pkg-grid-grouping-debug.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/pkg-grid-grouping.js b/pkgs/pkg-grid-grouping.js index 9481270b..05de49a4 100644 --- a/pkgs/pkg-grid-grouping.js +++ b/pkgs/pkg-grid-grouping.js @@ -1,5 +1,5 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/pkg-grid-property-debug.js b/pkgs/pkg-grid-property-debug.js index 8a374f56..4b044fed 100644 --- a/pkgs/pkg-grid-property-debug.js +++ b/pkgs/pkg-grid-property-debug.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/pkg-grid-property.js b/pkgs/pkg-grid-property.js index a4b62aab..e0e4c902 100644 --- a/pkgs/pkg-grid-property.js +++ b/pkgs/pkg-grid-property.js @@ -1,5 +1,5 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/pkg-history-debug.js b/pkgs/pkg-history-debug.js index 5a6f3cf1..dcf50f10 100644 --- a/pkgs/pkg-history-debug.js +++ b/pkgs/pkg-history-debug.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/pkg-history.js b/pkgs/pkg-history.js index b7d107d1..fa0cdfb5 100644 --- a/pkgs/pkg-history.js +++ b/pkgs/pkg-history.js @@ -1,5 +1,5 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/pkg-menu-debug.js b/pkgs/pkg-menu-debug.js index f4a0a646..71028f54 100644 --- a/pkgs/pkg-menu-debug.js +++ b/pkgs/pkg-menu-debug.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/pkg-menu.js b/pkgs/pkg-menu.js index c3761869..61efdc1c 100644 --- a/pkgs/pkg-menu.js +++ b/pkgs/pkg-menu.js @@ -1,5 +1,5 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/pkg-tabs-debug.js b/pkgs/pkg-tabs-debug.js index c9637702..bb697776 100644 --- a/pkgs/pkg-tabs-debug.js +++ b/pkgs/pkg-tabs-debug.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -588,9 +588,6 @@ new Ext.TabPanel({ if(this.rendered){ var items = this.items; this.initTab(c, items.indexOf(c)); - if(items.getCount() == 1 && !this.collapsed){ - this.syncSize(); - } this.delegateUpdates(); } }, @@ -817,10 +814,10 @@ new Ext.TabPanel({ Ext.fly(oldEl).removeClass('x-tab-strip-active'); } } + this.activeTab = item; if(item){ var el = this.getTabEl(item); Ext.fly(el).addClass('x-tab-strip-active'); - this.activeTab = item; this.stack.add(item); this.layout.setActiveItem(item); diff --git a/pkgs/pkg-tabs.js b/pkgs/pkg-tabs.js index 74d6b7e2..6b78b077 100644 --- a/pkgs/pkg-tabs.js +++ b/pkgs/pkg-tabs.js @@ -1,7 +1,7 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ -Ext.TabPanel=Ext.extend(Ext.Panel,{deferredRender:true,tabWidth:120,minTabWidth:30,resizeTabs:false,enableTabScroll:false,scrollIncrement:0,scrollRepeatInterval:400,scrollDuration:0.35,animScroll:true,tabPosition:"top",baseCls:"x-tab-panel",autoTabs:false,autoTabSelector:"div.x-tab",activeTab:undefined,tabMargin:2,plain:false,wheelIncrement:20,idDelimiter:"__",itemCls:"x-tab-item",elements:"body",headerAsText:false,frame:false,hideBorders:true,initComponent:function(){this.frame=false;Ext.TabPanel.superclass.initComponent.call(this);this.addEvents("beforetabchange","tabchange","contextmenu");this.setLayout(new Ext.layout.CardLayout(Ext.apply({layoutOnCardChange:this.layoutOnTabChange,deferredRender:this.deferredRender},this.layoutConfig)));if(this.tabPosition=="top"){this.elements+=",header";this.stripTarget="header"}else{this.elements+=",footer";this.stripTarget="footer"}if(!this.stack){this.stack=Ext.TabPanel.AccessStack()}this.initItems()},onRender:function(c,a){Ext.TabPanel.superclass.onRender.call(this,c,a);if(this.plain){var f=this.tabPosition=="top"?"header":"footer";this[f].addClass("x-tab-panel-"+f+"-plain")}var b=this[this.stripTarget];this.stripWrap=b.createChild({cls:"x-tab-strip-wrap",cn:{tag:"ul",cls:"x-tab-strip x-tab-strip-"+this.tabPosition}});var e=(this.tabPosition=="bottom"?this.stripWrap:null);b.createChild({cls:"x-tab-strip-spacer"},e);this.strip=new Ext.Element(this.stripWrap.dom.firstChild);this.edge=this.strip.createChild({tag:"li",cls:"x-tab-edge",cn:[{tag:"span",cls:"x-tab-strip-text",cn:" "}]});this.strip.createChild({cls:"x-clear"});this.body.addClass("x-tab-panel-body-"+this.tabPosition);if(!this.itemTpl){var d=new Ext.Template('
  • ','','{text}',"
  • ");d.disableFormats=true;d.compile();Ext.TabPanel.prototype.itemTpl=d}this.items.each(this.initTab,this)},afterRender:function(){Ext.TabPanel.superclass.afterRender.call(this);if(this.autoTabs){this.readTabs(false)}if(this.activeTab!==undefined){var a=Ext.isObject(this.activeTab)?this.activeTab:this.items.get(this.activeTab);delete this.activeTab;this.setActiveTab(a)}},initEvents:function(){Ext.TabPanel.superclass.initEvents.call(this);this.mon(this.strip,{scope:this,mousedown:this.onStripMouseDown,contextmenu:this.onStripContextMenu});if(this.enableTabScroll){this.mon(this.strip,"mousewheel",this.onWheel,this)}},findTargets:function(c){var b=null,a=c.getTarget("li:not(.x-tab-edge)",this.strip);if(a){b=this.getComponent(a.id.split(this.idDelimiter)[1]);if(b.disabled){return{close:null,item:null,el:null}}}return{close:c.getTarget(".x-tab-strip-close",this.strip),item:b,el:a}},onStripMouseDown:function(b){if(b.button!==0){return}b.preventDefault();var a=this.findTargets(b);if(a.close){if(a.item.fireEvent("beforeclose",a.item)!==false){a.item.fireEvent("close",a.item);this.remove(a.item)}return}if(a.item&&a.item!=this.activeTab){this.setActiveTab(a.item)}},onStripContextMenu:function(b){b.preventDefault();var a=this.findTargets(b);if(a.item){this.fireEvent("contextmenu",this,a.item,b)}},readTabs:function(d){if(d===true){this.items.each(function(g){this.remove(g)},this)}var c=this.el.query(this.autoTabSelector);for(var b=0,a=c.length;b0){this.setActiveTab(0)}else{this.setActiveTab(null)}}}if(!this.destroying){this.delegateUpdates()}},onBeforeShowItem:function(a){if(a!=this.activeTab){this.setActiveTab(a);return false}},onItemDisabled:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).addClass("x-item-disabled")}this.stack.remove(b)},onItemEnabled:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).removeClass("x-item-disabled")}},onItemTitleChanged:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).child("span.x-tab-strip-text",true).innerHTML=b.title}},onItemIconChanged:function(d,a,c){var b=this.getTabEl(d);if(b){b=Ext.get(b);b.child("span.x-tab-strip-text").replaceClass(c,a);b[Ext.isEmpty(a)?"removeClass":"addClass"]("x-tab-with-icon")}},getTabEl:function(a){var b=this.getComponent(a);return b?b.tabEl:null},onResize:function(){Ext.TabPanel.superclass.onResize.apply(this,arguments);this.delegateUpdates()},beginUpdate:function(){this.suspendUpdates=true},endUpdate:function(){this.suspendUpdates=false;this.delegateUpdates()},hideTabStripItem:function(b){b=this.getComponent(b);var a=this.getTabEl(b);if(a){a.style.display="none";this.delegateUpdates()}this.stack.remove(b)},unhideTabStripItem:function(b){b=this.getComponent(b);var a=this.getTabEl(b);if(a){a.style.display="";this.delegateUpdates()}},delegateUpdates:function(){if(this.suspendUpdates){return}if(this.resizeTabs&&this.rendered){this.autoSizeTabs()}if(this.enableTabScroll&&this.rendered){this.autoScrollTabs()}},autoSizeTabs:function(){var g=this.items.length,b=this.tabPosition!="bottom"?"header":"footer",c=this[b].dom.offsetWidth,a=this[b].dom.clientWidth;if(!this.resizeTabs||g<1||!a){return}var j=Math.max(Math.min(Math.floor((a-4)/g)-this.tabMargin,this.tabWidth),this.minTabWidth);this.lastTabWidth=j;var l=this.strip.query("li:not(.x-tab-edge)");for(var e=0,h=l.length;e20?c:20);if(!this.scrolling){if(!this.scrollLeft){this.createScrollers()}else{this.scrollLeft.show();this.scrollRight.show()}}this.scrolling=true;if(h>(a-c)){e.scrollLeft=a-c}else{this.scrollToTab(this.activeTab,false)}this.updateScrollButtons()}},createScrollers:function(){this.pos.addClass("x-tab-scrolling-"+this.tabPosition);var c=this.stripWrap.dom.offsetHeight;var a=this.pos.insertFirst({cls:"x-tab-scroller-left"});a.setHeight(c);a.addClassOnOver("x-tab-scroller-left-over");this.leftRepeater=new Ext.util.ClickRepeater(a,{interval:this.scrollRepeatInterval,handler:this.onScrollLeft,scope:this});this.scrollLeft=a;var b=this.pos.insertFirst({cls:"x-tab-scroller-right"});b.setHeight(c);b.addClassOnOver("x-tab-scroller-right-over");this.rightRepeater=new Ext.util.ClickRepeater(b,{interval:this.scrollRepeatInterval,handler:this.onScrollRight,scope:this});this.scrollRight=b},getScrollWidth:function(){return this.edge.getOffsetsTo(this.stripWrap)[0]+this.getScrollPos()},getScrollPos:function(){return parseInt(this.stripWrap.dom.scrollLeft,10)||0},getScrollArea:function(){return parseInt(this.stripWrap.dom.clientWidth,10)||0},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},getScrollIncrement:function(){return this.scrollIncrement||(this.resizeTabs?this.lastTabWidth+2:100)},scrollToTab:function(e,a){if(!e){return}var c=this.getTabEl(e),g=this.getScrollPos(),d=this.getScrollArea(),f=Ext.fly(c).getOffsetsTo(this.stripWrap)[0]+g,b=f+c.offsetWidth;if(f(g+d)){this.scrollTo(b-d,a)}}},scrollTo:function(b,a){this.stripWrap.scrollTo("left",b,a?this.getScrollAnim():false);if(!a){this.updateScrollButtons()}},onWheel:function(f){var g=f.getWheelDelta()*this.wheelIncrement*-1;f.stopEvent();var h=this.getScrollPos(),c=h+g,a=this.getScrollWidth()-this.getScrollArea();var b=Math.max(0,Math.min(a,c));if(b!=h){this.scrollTo(b,false)}},onScrollRight:function(){var a=this.getScrollWidth()-this.getScrollArea(),c=this.getScrollPos(),b=Math.min(a,c+this.getScrollIncrement());if(b!=c){this.scrollTo(b,this.animScroll)}},onScrollLeft:function(){var b=this.getScrollPos(),a=Math.max(0,b-this.getScrollIncrement());if(a!=b){this.scrollTo(a,this.animScroll)}},updateScrollButtons:function(){var a=this.getScrollPos();this.scrollLeft[a===0?"addClass":"removeClass"]("x-tab-scroller-left-disabled");this.scrollRight[a>=(this.getScrollWidth()-this.getScrollArea())?"addClass":"removeClass"]("x-tab-scroller-right-disabled")},beforeDestroy:function(){Ext.destroy(this.leftRepeater,this.rightRepeater);this.deleteMembers("strip","edge","scrollLeft","scrollRight","stripWrap");this.activeTab=null;Ext.TabPanel.superclass.beforeDestroy.apply(this)}});Ext.reg("tabpanel",Ext.TabPanel);Ext.TabPanel.prototype.activate=Ext.TabPanel.prototype.setActiveTab;Ext.TabPanel.AccessStack=function(){var a=[];return{add:function(b){a.push(b);if(a.length>10){a.shift()}},remove:function(e){var d=[];for(var c=0,b=a.length;c','','{text}',"");d.disableFormats=true;d.compile();Ext.TabPanel.prototype.itemTpl=d}this.items.each(this.initTab,this)},afterRender:function(){Ext.TabPanel.superclass.afterRender.call(this);if(this.autoTabs){this.readTabs(false)}if(this.activeTab!==undefined){var a=Ext.isObject(this.activeTab)?this.activeTab:this.items.get(this.activeTab);delete this.activeTab;this.setActiveTab(a)}},initEvents:function(){Ext.TabPanel.superclass.initEvents.call(this);this.mon(this.strip,{scope:this,mousedown:this.onStripMouseDown,contextmenu:this.onStripContextMenu});if(this.enableTabScroll){this.mon(this.strip,"mousewheel",this.onWheel,this)}},findTargets:function(c){var b=null,a=c.getTarget("li:not(.x-tab-edge)",this.strip);if(a){b=this.getComponent(a.id.split(this.idDelimiter)[1]);if(b.disabled){return{close:null,item:null,el:null}}}return{close:c.getTarget(".x-tab-strip-close",this.strip),item:b,el:a}},onStripMouseDown:function(b){if(b.button!==0){return}b.preventDefault();var a=this.findTargets(b);if(a.close){if(a.item.fireEvent("beforeclose",a.item)!==false){a.item.fireEvent("close",a.item);this.remove(a.item)}return}if(a.item&&a.item!=this.activeTab){this.setActiveTab(a.item)}},onStripContextMenu:function(b){b.preventDefault();var a=this.findTargets(b);if(a.item){this.fireEvent("contextmenu",this,a.item,b)}},readTabs:function(d){if(d===true){this.items.each(function(g){this.remove(g)},this)}var c=this.el.query(this.autoTabSelector);for(var b=0,a=c.length;b0){this.setActiveTab(0)}else{this.setActiveTab(null)}}}if(!this.destroying){this.delegateUpdates()}},onBeforeShowItem:function(a){if(a!=this.activeTab){this.setActiveTab(a);return false}},onItemDisabled:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).addClass("x-item-disabled")}this.stack.remove(b)},onItemEnabled:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).removeClass("x-item-disabled")}},onItemTitleChanged:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).child("span.x-tab-strip-text",true).innerHTML=b.title}},onItemIconChanged:function(d,a,c){var b=this.getTabEl(d);if(b){b=Ext.get(b);b.child("span.x-tab-strip-text").replaceClass(c,a);b[Ext.isEmpty(a)?"removeClass":"addClass"]("x-tab-with-icon")}},getTabEl:function(a){var b=this.getComponent(a);return b?b.tabEl:null},onResize:function(){Ext.TabPanel.superclass.onResize.apply(this,arguments);this.delegateUpdates()},beginUpdate:function(){this.suspendUpdates=true},endUpdate:function(){this.suspendUpdates=false;this.delegateUpdates()},hideTabStripItem:function(b){b=this.getComponent(b);var a=this.getTabEl(b);if(a){a.style.display="none";this.delegateUpdates()}this.stack.remove(b)},unhideTabStripItem:function(b){b=this.getComponent(b);var a=this.getTabEl(b);if(a){a.style.display="";this.delegateUpdates()}},delegateUpdates:function(){if(this.suspendUpdates){return}if(this.resizeTabs&&this.rendered){this.autoSizeTabs()}if(this.enableTabScroll&&this.rendered){this.autoScrollTabs()}},autoSizeTabs:function(){var g=this.items.length,b=this.tabPosition!="bottom"?"header":"footer",c=this[b].dom.offsetWidth,a=this[b].dom.clientWidth;if(!this.resizeTabs||g<1||!a){return}var j=Math.max(Math.min(Math.floor((a-4)/g)-this.tabMargin,this.tabWidth),this.minTabWidth);this.lastTabWidth=j;var l=this.strip.query("li:not(.x-tab-edge)");for(var e=0,h=l.length;e20?c:20);if(!this.scrolling){if(!this.scrollLeft){this.createScrollers()}else{this.scrollLeft.show();this.scrollRight.show()}}this.scrolling=true;if(h>(a-c)){e.scrollLeft=a-c}else{this.scrollToTab(this.activeTab,false)}this.updateScrollButtons()}},createScrollers:function(){this.pos.addClass("x-tab-scrolling-"+this.tabPosition);var c=this.stripWrap.dom.offsetHeight;var a=this.pos.insertFirst({cls:"x-tab-scroller-left"});a.setHeight(c);a.addClassOnOver("x-tab-scroller-left-over");this.leftRepeater=new Ext.util.ClickRepeater(a,{interval:this.scrollRepeatInterval,handler:this.onScrollLeft,scope:this});this.scrollLeft=a;var b=this.pos.insertFirst({cls:"x-tab-scroller-right"});b.setHeight(c);b.addClassOnOver("x-tab-scroller-right-over");this.rightRepeater=new Ext.util.ClickRepeater(b,{interval:this.scrollRepeatInterval,handler:this.onScrollRight,scope:this});this.scrollRight=b},getScrollWidth:function(){return this.edge.getOffsetsTo(this.stripWrap)[0]+this.getScrollPos()},getScrollPos:function(){return parseInt(this.stripWrap.dom.scrollLeft,10)||0},getScrollArea:function(){return parseInt(this.stripWrap.dom.clientWidth,10)||0},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},getScrollIncrement:function(){return this.scrollIncrement||(this.resizeTabs?this.lastTabWidth+2:100)},scrollToTab:function(e,a){if(!e){return}var c=this.getTabEl(e),g=this.getScrollPos(),d=this.getScrollArea(),f=Ext.fly(c).getOffsetsTo(this.stripWrap)[0]+g,b=f+c.offsetWidth;if(f(g+d)){this.scrollTo(b-d,a)}}},scrollTo:function(b,a){this.stripWrap.scrollTo("left",b,a?this.getScrollAnim():false);if(!a){this.updateScrollButtons()}},onWheel:function(f){var g=f.getWheelDelta()*this.wheelIncrement*-1;f.stopEvent();var h=this.getScrollPos(),c=h+g,a=this.getScrollWidth()-this.getScrollArea();var b=Math.max(0,Math.min(a,c));if(b!=h){this.scrollTo(b,false)}},onScrollRight:function(){var a=this.getScrollWidth()-this.getScrollArea(),c=this.getScrollPos(),b=Math.min(a,c+this.getScrollIncrement());if(b!=c){this.scrollTo(b,this.animScroll)}},onScrollLeft:function(){var b=this.getScrollPos(),a=Math.max(0,b-this.getScrollIncrement());if(a!=b){this.scrollTo(a,this.animScroll)}},updateScrollButtons:function(){var a=this.getScrollPos();this.scrollLeft[a===0?"addClass":"removeClass"]("x-tab-scroller-left-disabled");this.scrollRight[a>=(this.getScrollWidth()-this.getScrollArea())?"addClass":"removeClass"]("x-tab-scroller-right-disabled")},beforeDestroy:function(){Ext.destroy(this.leftRepeater,this.rightRepeater);this.deleteMembers("strip","edge","scrollLeft","scrollRight","stripWrap");this.activeTab=null;Ext.TabPanel.superclass.beforeDestroy.apply(this)}});Ext.reg("tabpanel",Ext.TabPanel);Ext.TabPanel.prototype.activate=Ext.TabPanel.prototype.setActiveTab;Ext.TabPanel.AccessStack=function(){var a=[];return{add:function(b){a.push(b);if(a.length>10){a.shift()}},remove:function(e){var d=[];for(var c=0,b=a.length;c1){var d=function(h,f){if(h&&f){var i=f.findChild(a,b);if(i){i.select();if(g){g(true,i)}}else{if(g){g(false,i)}}}else{if(g){g(false,i)}}};this.expandPath(c.join(this.pathSeparator),a,d)}else{this.root.select();if(g){g(true,this.root)}}},getTreeEl:function(){return this.body},onRender:function(b,a){Ext.tree.TreePanel.superclass.onRender.call(this,b,a);this.el.addClass("x-tree");this.innerCt=this.body.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.useArrows?"x-tree-arrows":this.lines?"x-tree-lines":"x-tree-no-lines")})},initEvents:function(){Ext.tree.TreePanel.superclass.initEvents.call(this);if(this.containerScroll){Ext.dd.ScrollManager.register(this.body)}if((this.enableDD||this.enableDrop)&&!this.dropZone){this.dropZone=new Ext.tree.TreeDropZone(this,this.dropConfig||{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.ddAppendOnly===true})}if((this.enableDD||this.enableDrag)&&!this.dragZone){this.dragZone=new Ext.tree.TreeDragZone(this,this.dragConfig||{ddGroup:this.ddGroup||"TreeDD",scroll:this.ddScroll})}this.getSelectionModel().init(this)},afterRender:function(){Ext.tree.TreePanel.superclass.afterRender.call(this);this.renderRoot()},beforeDestroy:function(){if(this.rendered){Ext.dd.ScrollManager.unregister(this.body);Ext.destroy(this.dropZone,this.dragZone)}this.destroyRoot();Ext.destroy(this.loader);this.nodeHash=this.root=this.loader=null;Ext.tree.TreePanel.superclass.beforeDestroy.call(this)},destroyRoot:function(){if(this.root&&this.root.destroy){this.root.destroy(true)}}});Ext.tree.TreePanel.nodeTypes={};Ext.reg("treepanel",Ext.tree.TreePanel);Ext.tree.TreeEventModel=function(a){this.tree=a;this.tree.on("render",this.initEvents,this)};Ext.tree.TreeEventModel.prototype={initEvents:function(){var a=this.tree;if(a.trackMouseOver!==false){a.mon(a.innerCt,{scope:this,mouseover:this.delegateOver,mouseout:this.delegateOut})}a.mon(a.getTreeEl(),{scope:this,click:this.delegateClick,dblclick:this.delegateDblClick,contextmenu:this.delegateContextMenu})},getNode:function(b){var a;if(a=b.getTarget(".x-tree-node-el",10)){var c=Ext.fly(a,"_treeEvents").getAttribute("tree-node-id","ext");if(c){return this.tree.getNodeById(c)}}return null},getNodeTarget:function(b){var a=b.getTarget(".x-tree-node-icon",1);if(!a){a=b.getTarget(".x-tree-node-el",6)}return a},delegateOut:function(b,a){if(!this.beforeEvent(b)){return}if(b.getTarget(".x-tree-ec-icon",1)){var c=this.getNode(b);this.onIconOut(b,c);if(c==this.lastEcOver){delete this.lastEcOver}}if((a=this.getNodeTarget(b))&&!b.within(a,true)){this.onNodeOut(b,this.getNode(b))}},delegateOver:function(b,a){if(!this.beforeEvent(b)){return}if(Ext.isGecko&&!this.trackingDoc){Ext.getBody().on("mouseover",this.trackExit,this);this.trackingDoc=true}if(this.lastEcOver){this.onIconOut(b,this.lastEcOver);delete this.lastEcOver}if(b.getTarget(".x-tree-ec-icon",1)){this.lastEcOver=this.getNode(b);this.onIconOver(b,this.lastEcOver)}if(a=this.getNodeTarget(b)){this.onNodeOver(b,this.getNode(b))}},trackExit:function(a){if(this.lastOverNode){if(this.lastOverNode.ui&&!a.within(this.lastOverNode.ui.getEl())){this.onNodeOut(a,this.lastOverNode)}delete this.lastOverNode;Ext.getBody().un("mouseover",this.trackExit,this);this.trackingDoc=false}},delegateClick:function(b,a){if(this.beforeEvent(b)){if(b.getTarget("input[type=checkbox]",1)){this.onCheckboxClick(b,this.getNode(b))}else{if(b.getTarget(".x-tree-ec-icon",1)){this.onIconClick(b,this.getNode(b))}else{if(this.getNodeTarget(b)){this.onNodeClick(b,this.getNode(b))}}}}else{this.checkContainerEvent(b,"click")}},delegateDblClick:function(b,a){if(this.beforeEvent(b)){if(this.getNodeTarget(b)){this.onNodeDblClick(b,this.getNode(b))}}else{this.checkContainerEvent(b,"dblclick")}},delegateContextMenu:function(b,a){if(this.beforeEvent(b)){if(this.getNodeTarget(b)){this.onNodeContextMenu(b,this.getNode(b))}}else{this.checkContainerEvent(b,"contextmenu")}},checkContainerEvent:function(b,a){if(this.disabled){b.stopEvent();return false}this.onContainerEvent(b,a)},onContainerEvent:function(b,a){this.tree.fireEvent("container"+a,this.tree,b)},onNodeClick:function(b,a){a.ui.onClick(b)},onNodeOver:function(b,a){this.lastOverNode=a;a.ui.onOver(b)},onNodeOut:function(b,a){a.ui.onOut(b)},onIconOver:function(b,a){a.ui.addClass("x-tree-ec-over")},onIconOut:function(b,a){a.ui.removeClass("x-tree-ec-over")},onIconClick:function(b,a){a.ui.ecClick(b)},onCheckboxClick:function(b,a){a.ui.onCheckChange(b)},onNodeDblClick:function(b,a){a.ui.onDblClick(b)},onNodeContextMenu:function(b,a){a.ui.onContextMenu(b)},beforeEvent:function(b){var a=this.getNode(b);if(this.disabled||!a||!a.ui){b.stopEvent();return false}return true},disable:function(){this.disabled=true},enable:function(){this.disabled=false}};Ext.tree.DefaultSelectionModel=function(a){this.selNode=null;this.addEvents("selectionchange","beforeselect");Ext.apply(this,a);Ext.tree.DefaultSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.tree.DefaultSelectionModel,Ext.util.Observable,{init:function(a){this.tree=a;a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this);a.on("click",this.onNodeClick,this)},onNodeClick:function(a,b){this.select(a)},select:function(c,a){if(!Ext.fly(c.ui.wrap).isVisible()&&a){return a.call(this,c)}var b=this.selNode;if(c==b){c.ui.onSelectedChange(true)}else{if(this.fireEvent("beforeselect",this,c,b)!==false){if(b&&b.ui){b.ui.onSelectedChange(false)}this.selNode=c;c.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,c,b)}}return c},unselect:function(b,a){if(this.selNode==b){this.clearSelections(a)}},clearSelections:function(a){var b=this.selNode;if(b){b.ui.onSelectedChange(false);this.selNode=null;if(a!==true){this.fireEvent("selectionchange",this,null)}}return b},getSelectedNode:function(){return this.selNode},isSelected:function(a){return this.selNode==a},selectPrevious:function(a){if(!(a=a||this.selNode||this.lastSelNode)){return null}var c=a.previousSibling;if(c){if(!c.isExpanded()||c.childNodes.length<1){return this.select(c,this.selectPrevious)}else{var b=c.lastChild;while(b&&b.isExpanded()&&Ext.fly(b.ui.wrap).isVisible()&&b.childNodes.length>0){b=b.lastChild}return this.select(b,this.selectPrevious)}}else{if(a.parentNode&&(this.tree.rootVisible||!a.parentNode.isRoot)){return this.select(a.parentNode,this.selectPrevious)}}return null},selectNext:function(b){if(!(b=b||this.selNode||this.lastSelNode)){return null}if(b.firstChild&&b.isExpanded()&&Ext.fly(b.ui.wrap).isVisible()){return this.select(b.firstChild,this.selectNext)}else{if(b.nextSibling){return this.select(b.nextSibling,this.selectNext)}else{if(b.parentNode){var a=null;b.parentNode.bubble(function(){if(this.nextSibling){a=this.getOwnerTree().selModel.select(this.nextSibling,this.selectNext);return false}});return a}}}return null},onKeyDown:function(c){var b=this.selNode||this.lastSelNode;var d=this;if(!b){return}var a=c.getKey();switch(a){case c.DOWN:c.stopEvent();this.selectNext();break;case c.UP:c.stopEvent();this.selectPrevious();break;case c.RIGHT:c.preventDefault();if(b.hasChildNodes()){if(!b.isExpanded()){b.expand()}else{if(b.firstChild){this.select(b.firstChild,c)}}}break;case c.LEFT:c.preventDefault();if(b.hasChildNodes()&&b.isExpanded()){b.collapse()}else{if(b.parentNode&&(this.tree.rootVisible||b.parentNode!=this.tree.getRootNode())){this.select(b.parentNode,c)}}break}}});Ext.tree.MultiSelectionModel=function(a){this.selNodes=[];this.selMap={};this.addEvents("selectionchange");Ext.apply(this,a);Ext.tree.MultiSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.tree.MultiSelectionModel,Ext.util.Observable,{init:function(a){this.tree=a;a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this);a.on("click",this.onNodeClick,this)},onNodeClick:function(a,b){if(b.ctrlKey&&this.isSelected(a)){this.unselect(a)}else{this.select(a,b,b.ctrlKey)}},select:function(a,c,b){if(b!==true){this.clearSelections(true)}if(this.isSelected(a)){this.lastSelNode=a;return a}this.selNodes.push(a);this.selMap[a.id]=a;this.lastSelNode=a;a.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,this.selNodes);return a},unselect:function(b){if(this.selMap[b.id]){b.ui.onSelectedChange(false);var c=this.selNodes;var a=c.indexOf(b);if(a!=-1){this.selNodes.splice(a,1)}delete this.selMap[b.id];this.fireEvent("selectionchange",this,this.selNodes)}},clearSelections:function(b){var d=this.selNodes;if(d.length>0){for(var c=0,a=d.length;c0},isExpandable:function(){return this.attributes.expandable||this.hasChildNodes()},appendChild:function(e){var f=false;if(Ext.isArray(e)){f=e}else{if(arguments.length>1){f=arguments}}if(f){for(var d=0,a=f.length;d0){var f=d?function(){e.apply(d,arguments)}:e;c.sort(f);for(var b=0;b
    ','',this.indentMarkup,"",'','',f?('':"/>")):"",'',e.text,"
    ",'',""].join("");if(k!==true&&e.nextSibling&&(b=e.nextSibling.ui.getEl())){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",b,d)}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",i,d)}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var h=this.elNode.childNodes;this.indentNode=h[0];this.ecNode=h[1];this.iconNode=h[2];var g=3;if(f){this.checkbox=h[3];this.checkbox.defaultChecked=this.checkbox.checked;g++}this.anchor=h[g];this.textNode=h[g].firstChild},getAnchor:function(){return this.anchor},getTextEl:function(){return this.textNode},getIconEl:function(){return this.iconNode},isChecked:function(){return this.checkbox?this.checkbox.checked:false},updateExpandIcon:function(){if(this.rendered){var f=this.node,d,c,a=f.isLast()?"x-tree-elbow-end":"x-tree-elbow",e=f.hasChildNodes();if(e||f.attributes.expandable){if(f.expanded){a+="-minus";d="x-tree-node-collapsed";c="x-tree-node-expanded"}else{a+="-plus";d="x-tree-node-expanded";c="x-tree-node-collapsed"}if(this.wasLeaf){this.removeClass("x-tree-node-leaf");this.wasLeaf=false}if(this.c1!=d||this.c2!=c){Ext.fly(this.elNode).replaceClass(d,c);this.c1=d;this.c2=c}}else{if(!this.wasLeaf){Ext.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-collapsed");delete this.c1;delete this.c2;this.wasLeaf=true}}var b="x-tree-ec-icon "+a;if(this.ecc!=b){this.ecNode.className=b;this.ecc=b}}},onIdChange:function(a){if(this.rendered){this.elNode.setAttribute("ext:tree-node-id",a)}},getChildIndent:function(){if(!this.childIndent){var a=[],b=this.node;while(b){if(!b.isRoot||(b.isRoot&&b.ownerTree.rootVisible)){if(!b.isLast()){a.unshift('')}else{a.unshift('')}}b=b.parentNode}this.childIndent=a.join("")}return this.childIndent},renderIndent:function(){if(this.rendered){var a="",b=this.node.parentNode;if(b){a=b.ui.getChildIndent()}if(this.indentMarkup!=a){this.indentNode.innerHTML=a;this.indentMarkup=a}this.updateExpandIcon()}},destroy:function(){if(this.elNode){Ext.dd.Registry.unregister(this.elNode.id)}Ext.each(["textnode","anchor","checkbox","indentNode","ecNode","iconNode","elNode","ctNode","wrap","holder"],function(a){if(this[a]){Ext.fly(this[a]).remove();delete this[a]}},this);delete this.node}};Ext.tree.RootTreeNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{render:function(){if(!this.rendered){var a=this.node.ownerTree.innerCt.dom;this.node.expanded=true;a.innerHTML='
    ';this.wrap=this.ctNode=a.firstChild}},collapse:Ext.emptyFn,expand:Ext.emptyFn});Ext.tree.TreeLoader=function(a){this.baseParams={};Ext.apply(this,a);this.addEvents("beforeload","load","loadexception");Ext.tree.TreeLoader.superclass.constructor.call(this);if(Ext.isString(this.paramOrder)){this.paramOrder=this.paramOrder.split(/[\s,|]/)}};Ext.extend(Ext.tree.TreeLoader,Ext.util.Observable,{uiProviders:{},clearOnLoad:true,paramOrder:undefined,paramsAsHash:false,nodeParameter:"node",directFn:undefined,load:function(b,c,a){if(this.clearOnLoad){while(b.firstChild){b.removeChild(b.firstChild)}}if(this.doPreload(b)){this.runCallback(c,a||b,[b])}else{if(this.directFn||this.dataUrl||this.url){this.requestData(b,c,a||b)}}},doPreload:function(d){if(d.attributes.children){if(d.childNodes.length<1){var c=d.attributes.children;d.beginUpdate();for(var b=0,a=c.length;b-1){c=[]}for(var d=0,a=b.length;dk){return e?-1:+1}else{return 0}}}};Ext.tree.TreeSorter.prototype={doSort:function(a){a.sort(this.sortFn)},compareNodes:function(b,a){return(b.text.toUpperCase()>a.text.toUpperCase()?1:-1)},updateSort:function(a,b){if(b.childrenRendered){this.doSort.defer(1,this,[b])}},updateSortParent:function(a){var b=a.parentNode;if(b&&b.childrenRendered){this.doSort.defer(1,this,[b])}}};if(Ext.dd.DropZone){Ext.tree.TreeDropZone=function(a,b){this.allowParentInsert=b.allowParentInsert||false;this.allowContainerDrop=b.allowContainerDrop||false;this.appendOnly=b.appendOnly||false;Ext.tree.TreeDropZone.superclass.constructor.call(this,a.getTreeEl(),b);this.tree=a;this.dragOverData={};this.lastInsertClass="x-tree-no-status"};Ext.extend(Ext.tree.TreeDropZone,Ext.dd.DropZone,{ddGroup:"TreeDD",expandDelay:1000,expandNode:function(a){if(a.hasChildNodes()&&!a.isExpanded()){a.expand(false,null,this.triggerCacheRefresh.createDelegate(this))}},queueExpand:function(a){this.expandProcId=this.expandNode.defer(this.expandDelay,this,[a])},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId);this.expandProcId=false}},isValidDropPoint:function(a,j,h,d,c){if(!a||!c){return false}var f=a.node;var g=c.node;if(!(f&&f.isTarget&&j)){return false}if(j=="append"&&f.allowChildren===false){return false}if((j=="above"||j=="below")&&(f.parentNode&&f.parentNode.allowChildren===false)){return false}if(g&&(f==g||g.contains(f))){return false}var b=this.dragOverData;b.tree=this.tree;b.target=f;b.data=c;b.point=j;b.source=h;b.rawEvent=d;b.dropNode=g;b.cancel=false;var i=this.tree.fireEvent("nodedragover",b);return b.cancel===false&&i!==false},getDropPoint:function(g,f,k){var l=f.node;if(l.isRoot){return l.allowChildren!==false?"append":false}var c=f.ddel;var m=Ext.lib.Dom.getY(c),i=m+c.offsetHeight;var h=Ext.lib.Event.getPageY(g);var j=l.allowChildren===false||l.isLeaf();if(this.appendOnly||l.parentNode.allowChildren===false){return j?false:"append"}var d=false;if(!this.allowParentInsert){d=l.hasChildNodes()&&l.isExpanded()}var a=(i-m)/(j?2:3);if(h>=m&&h<(m+a)){return"above"}else{if(!d&&(j||h>=i-a&&h<=i)){return"below"}else{return"append"}}},onNodeEnter:function(d,a,c,b){this.cancelExpand()},onContainerOver:function(a,c,b){if(this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,node:this.tree.getRootNode()},"append",a,c,b)){return this.dropAllowed}return this.dropNotAllowed},onNodeOver:function(b,h,g,f){var j=this.getDropPoint(g,b,h);var c=b.node;if(!this.expandProcId&&j=="append"&&c.hasChildNodes()&&!b.node.isExpanded()){this.queueExpand(c)}else{if(j!="append"){this.cancelExpand()}}var d=this.dropNotAllowed;if(this.isValidDropPoint(b,j,h,g,f)){if(j){var a=b.ddel;var i;if(j=="above"){d=b.node.isFirst()?"x-tree-drop-ok-above":"x-tree-drop-ok-between";i="x-tree-drag-insert-above"}else{if(j=="below"){d=b.node.isLast()?"x-tree-drop-ok-below":"x-tree-drop-ok-between";i="x-tree-drag-insert-below"}else{d="x-tree-drop-ok-append";i="x-tree-drag-append"}}if(this.lastInsertClass!=i){Ext.fly(a).replaceClass(this.lastInsertClass,i);this.lastInsertClass=i}}}return d},onNodeOut:function(d,a,c,b){this.cancelExpand();this.removeDropIndicators(d)},onNodeDrop:function(h,b,g,d){var a=this.getDropPoint(g,h,b);var f=h.node;f.ui.startDrop();if(!this.isValidDropPoint(h,a,b,g,d)){f.ui.endDrop();return false}var c=d.node||(b.getTreeNode?b.getTreeNode(d,f,a,g):null);return this.processDrop(f,d,a,b,g,c)},onContainerDrop:function(a,f,c){if(this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,node:this.tree.getRootNode()},"append",a,f,c)){var d=this.tree.getRootNode();d.ui.startDrop();var b=c.node||(a.getTreeNode?a.getTreeNode(c,d,"append",f):null);return this.processDrop(d,c,"append",a,f,b)}return false},processDrop:function(i,g,b,a,h,d){var f={tree:this.tree,target:i,data:g,point:b,source:a,rawEvent:h,dropNode:d,cancel:!d,dropStatus:false};var c=this.tree.fireEvent("beforenodedrop",f);if(c===false||f.cancel===true||!f.dropNode){i.ui.endDrop();return f.dropStatus}i=f.target;if(b=="append"&&!i.isExpanded()){i.expand(false,null,function(){this.completeDrop(f)}.createDelegate(this))}else{this.completeDrop(f)}return true},completeDrop:function(g){var d=g.dropNode,e=g.point,c=g.target;if(!Ext.isArray(d)){d=[d]}var f;for(var b=0,a=d.length;bd.offsetLeft){e.scrollLeft=d.offsetLeft}var a=Math.min(this.maxWidth,(e.clientWidth>20?e.clientWidth:e.offsetWidth)-Math.max(0,d.offsetLeft-e.scrollLeft)-5);this.setSize(a,"")},triggerEdit:function(a,c){this.completeEdit();if(a.attributes.editable!==false){this.editNode=a;if(this.tree.autoScroll){Ext.fly(a.ui.getEl()).scrollIntoView(this.tree.body)}var b=a.text||"";if(!Ext.isGecko&&Ext.isEmpty(a.text)){a.setText(" ")}this.autoEditTimer=this.startEdit.defer(this.editDelay,this,[a.ui.textNode,b]);return false}},bindScroll:function(){this.tree.getTreeEl().on("scroll",this.cancelEdit,this)},beforeNodeClick:function(a,b){clearTimeout(this.autoEditTimer);if(this.tree.getSelectionModel().isSelected(a)){b.stopEvent();return this.triggerEdit(a)}},onNodeDblClick:function(a,b){clearTimeout(this.autoEditTimer)},updateNode:function(a,b){this.tree.getTreeEl().un("scroll",this.cancelEdit,this);this.editNode.setText(b)},onHide:function(){Ext.tree.TreeEditor.superclass.onHide.call(this);if(this.editNode){this.editNode.ui.focus.defer(50,this.editNode.ui)}},onSpecialKey:function(c,b){var a=b.getKey();if(a==b.ESC){b.stopEvent();this.cancelEdit()}else{if(a==b.ENTER&&!b.hasModifier()){b.stopEvent();this.completeEdit()}}},onDestroy:function(){clearTimeout(this.autoEditTimer);Ext.tree.TreeEditor.superclass.onDestroy.call(this);var a=this.tree;a.un("beforeclick",this.beforeNodeClick,this);a.un("dblclick",this.onNodeDblClick,this)}}); \ No newline at end of file +Ext.tree.TreePanel=Ext.extend(Ext.Panel,{rootVisible:true,animate:Ext.enableFx,lines:true,enableDD:false,hlDrop:Ext.enableFx,pathSeparator:"/",bubbleEvents:[],initComponent:function(){Ext.tree.TreePanel.superclass.initComponent.call(this);if(!this.eventModel){this.eventModel=new Ext.tree.TreeEventModel(this)}var a=this.loader;if(!a){a=new Ext.tree.TreeLoader({dataUrl:this.dataUrl,requestMethod:this.requestMethod})}else{if(Ext.isObject(a)&&!a.load){a=new Ext.tree.TreeLoader(a)}}this.loader=a;this.nodeHash={};if(this.root){var b=this.root;delete this.root;this.setRootNode(b)}this.addEvents("append","remove","movenode","insert","beforeappend","beforeremove","beforemovenode","beforeinsert","beforeload","load","textchange","beforeexpandnode","beforecollapsenode","expandnode","disabledchange","collapsenode","beforeclick","click","containerclick","checkchange","beforedblclick","dblclick","containerdblclick","contextmenu","containercontextmenu","beforechildrenrendered","startdrag","enddrag","dragdrop","beforenodedrop","nodedrop","nodedragover");if(this.singleExpand){this.on("beforeexpandnode",this.restrictExpand,this)}},proxyNodeEvent:function(c,b,a,g,f,e,d){if(c=="collapse"||c=="expand"||c=="beforecollapse"||c=="beforeexpand"||c=="move"||c=="beforemove"){c=c+"node"}return this.fireEvent(c,b,a,g,f,e,d)},getRootNode:function(){return this.root},setRootNode:function(b){this.destroyRoot();if(!b.render){b=this.loader.createNode(b)}this.root=b;b.ownerTree=this;b.isRoot=true;this.registerNode(b);if(!this.rootVisible){var a=b.attributes.uiProvider;b.ui=a?new a(b):new Ext.tree.RootTreeNodeUI(b)}if(this.innerCt){this.clearInnerCt();this.renderRoot()}return b},clearInnerCt:function(){this.innerCt.update("")},renderRoot:function(){this.root.render();if(!this.rootVisible){this.root.renderChildren()}},getNodeById:function(a){return this.nodeHash[a]},registerNode:function(a){this.nodeHash[a.id]=a},unregisterNode:function(a){delete this.nodeHash[a.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"},restrictExpand:function(a){var b=a.parentNode;if(b){if(b.expandedChild&&b.expandedChild.parentNode==b){b.expandedChild.collapse()}b.expandedChild=a}},getChecked:function(b,c){c=c||this.root;var d=[];var e=function(){if(this.attributes.checked){d.push(!b?this:(b=="id"?this.id:this.attributes[b]))}};c.cascade(e);return d},getLoader:function(){return this.loader},expandAll:function(){this.root.expand(true)},collapseAll:function(){this.root.collapse(true)},getSelectionModel:function(){if(!this.selModel){this.selModel=new Ext.tree.DefaultSelectionModel()}return this.selModel},expandPath:function(g,a,h){a=a||"id";var d=g.split(this.pathSeparator);var c=this.root;if(c.attributes[a]!=d[1]){if(h){h(false,null)}return}var b=1;var e=function(){if(++b==d.length){if(h){h(true,c)}return}var f=c.findChild(a,d[b]);if(!f){if(h){h(false,c)}return}c=f;f.expand(false,false,e)};c.expand(false,false,e)},selectPath:function(e,a,g){a=a||"id";var c=e.split(this.pathSeparator),b=c.pop();if(c.length>1){var d=function(h,f){if(h&&f){var i=f.findChild(a,b);if(i){i.select();if(g){g(true,i)}}else{if(g){g(false,i)}}}else{if(g){g(false,i)}}};this.expandPath(c.join(this.pathSeparator),a,d)}else{this.root.select();if(g){g(true,this.root)}}},getTreeEl:function(){return this.body},onRender:function(b,a){Ext.tree.TreePanel.superclass.onRender.call(this,b,a);this.el.addClass("x-tree");this.innerCt=this.body.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.useArrows?"x-tree-arrows":this.lines?"x-tree-lines":"x-tree-no-lines")})},initEvents:function(){Ext.tree.TreePanel.superclass.initEvents.call(this);if(this.containerScroll){Ext.dd.ScrollManager.register(this.body)}if((this.enableDD||this.enableDrop)&&!this.dropZone){this.dropZone=new Ext.tree.TreeDropZone(this,this.dropConfig||{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.ddAppendOnly===true})}if((this.enableDD||this.enableDrag)&&!this.dragZone){this.dragZone=new Ext.tree.TreeDragZone(this,this.dragConfig||{ddGroup:this.ddGroup||"TreeDD",scroll:this.ddScroll})}this.getSelectionModel().init(this)},afterRender:function(){Ext.tree.TreePanel.superclass.afterRender.call(this);this.renderRoot()},beforeDestroy:function(){if(this.rendered){Ext.dd.ScrollManager.unregister(this.body);Ext.destroy(this.dropZone,this.dragZone)}this.destroyRoot();Ext.destroy(this.loader);this.nodeHash=this.root=this.loader=null;Ext.tree.TreePanel.superclass.beforeDestroy.call(this)},destroyRoot:function(){if(this.root&&this.root.destroy){this.root.destroy(true)}}});Ext.tree.TreePanel.nodeTypes={};Ext.reg("treepanel",Ext.tree.TreePanel);Ext.tree.TreeEventModel=function(a){this.tree=a;this.tree.on("render",this.initEvents,this)};Ext.tree.TreeEventModel.prototype={initEvents:function(){var a=this.tree;if(a.trackMouseOver!==false){a.mon(a.innerCt,{scope:this,mouseover:this.delegateOver,mouseout:this.delegateOut})}a.mon(a.getTreeEl(),{scope:this,click:this.delegateClick,dblclick:this.delegateDblClick,contextmenu:this.delegateContextMenu})},getNode:function(b){var a;if(a=b.getTarget(".x-tree-node-el",10)){var c=Ext.fly(a,"_treeEvents").getAttribute("tree-node-id","ext");if(c){return this.tree.getNodeById(c)}}return null},getNodeTarget:function(b){var a=b.getTarget(".x-tree-node-icon",1);if(!a){a=b.getTarget(".x-tree-node-el",6)}return a},delegateOut:function(b,a){if(!this.beforeEvent(b)){return}if(b.getTarget(".x-tree-ec-icon",1)){var c=this.getNode(b);this.onIconOut(b,c);if(c==this.lastEcOver){delete this.lastEcOver}}if((a=this.getNodeTarget(b))&&!b.within(a,true)){this.onNodeOut(b,this.getNode(b))}},delegateOver:function(b,a){if(!this.beforeEvent(b)){return}if(Ext.isGecko&&!this.trackingDoc){Ext.getBody().on("mouseover",this.trackExit,this);this.trackingDoc=true}if(this.lastEcOver){this.onIconOut(b,this.lastEcOver);delete this.lastEcOver}if(b.getTarget(".x-tree-ec-icon",1)){this.lastEcOver=this.getNode(b);this.onIconOver(b,this.lastEcOver)}if(a=this.getNodeTarget(b)){this.onNodeOver(b,this.getNode(b))}},trackExit:function(a){if(this.lastOverNode){if(this.lastOverNode.ui&&!a.within(this.lastOverNode.ui.getEl())){this.onNodeOut(a,this.lastOverNode)}delete this.lastOverNode;Ext.getBody().un("mouseover",this.trackExit,this);this.trackingDoc=false}},delegateClick:function(b,a){if(this.beforeEvent(b)){if(b.getTarget("input[type=checkbox]",1)){this.onCheckboxClick(b,this.getNode(b))}else{if(b.getTarget(".x-tree-ec-icon",1)){this.onIconClick(b,this.getNode(b))}else{if(this.getNodeTarget(b)){this.onNodeClick(b,this.getNode(b))}}}}else{this.checkContainerEvent(b,"click")}},delegateDblClick:function(b,a){if(this.beforeEvent(b)){if(this.getNodeTarget(b)){this.onNodeDblClick(b,this.getNode(b))}}else{this.checkContainerEvent(b,"dblclick")}},delegateContextMenu:function(b,a){if(this.beforeEvent(b)){if(this.getNodeTarget(b)){this.onNodeContextMenu(b,this.getNode(b))}}else{this.checkContainerEvent(b,"contextmenu")}},checkContainerEvent:function(b,a){if(this.disabled){b.stopEvent();return false}this.onContainerEvent(b,a)},onContainerEvent:function(b,a){this.tree.fireEvent("container"+a,this.tree,b)},onNodeClick:function(b,a){a.ui.onClick(b)},onNodeOver:function(b,a){this.lastOverNode=a;a.ui.onOver(b)},onNodeOut:function(b,a){a.ui.onOut(b)},onIconOver:function(b,a){a.ui.addClass("x-tree-ec-over")},onIconOut:function(b,a){a.ui.removeClass("x-tree-ec-over")},onIconClick:function(b,a){a.ui.ecClick(b)},onCheckboxClick:function(b,a){a.ui.onCheckChange(b)},onNodeDblClick:function(b,a){a.ui.onDblClick(b)},onNodeContextMenu:function(b,a){a.ui.onContextMenu(b)},beforeEvent:function(b){var a=this.getNode(b);if(this.disabled||!a||!a.ui){b.stopEvent();return false}return true},disable:function(){this.disabled=true},enable:function(){this.disabled=false}};Ext.tree.DefaultSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(a){this.selNode=null;this.addEvents("selectionchange","beforeselect");Ext.apply(this,a);Ext.tree.DefaultSelectionModel.superclass.constructor.call(this)},init:function(a){this.tree=a;a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this);a.on("click",this.onNodeClick,this)},onNodeClick:function(a,b){this.select(a)},select:function(c,a){if(!Ext.fly(c.ui.wrap).isVisible()&&a){return a.call(this,c)}var b=this.selNode;if(c==b){c.ui.onSelectedChange(true)}else{if(this.fireEvent("beforeselect",this,c,b)!==false){if(b&&b.ui){b.ui.onSelectedChange(false)}this.selNode=c;c.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,c,b)}}return c},unselect:function(b,a){if(this.selNode==b){this.clearSelections(a)}},clearSelections:function(a){var b=this.selNode;if(b){b.ui.onSelectedChange(false);this.selNode=null;if(a!==true){this.fireEvent("selectionchange",this,null)}}return b},getSelectedNode:function(){return this.selNode},isSelected:function(a){return this.selNode==a},selectPrevious:function(a){if(!(a=a||this.selNode||this.lastSelNode)){return null}var c=a.previousSibling;if(c){if(!c.isExpanded()||c.childNodes.length<1){return this.select(c,this.selectPrevious)}else{var b=c.lastChild;while(b&&b.isExpanded()&&Ext.fly(b.ui.wrap).isVisible()&&b.childNodes.length>0){b=b.lastChild}return this.select(b,this.selectPrevious)}}else{if(a.parentNode&&(this.tree.rootVisible||!a.parentNode.isRoot)){return this.select(a.parentNode,this.selectPrevious)}}return null},selectNext:function(b){if(!(b=b||this.selNode||this.lastSelNode)){return null}if(b.firstChild&&b.isExpanded()&&Ext.fly(b.ui.wrap).isVisible()){return this.select(b.firstChild,this.selectNext)}else{if(b.nextSibling){return this.select(b.nextSibling,this.selectNext)}else{if(b.parentNode){var a=null;b.parentNode.bubble(function(){if(this.nextSibling){a=this.getOwnerTree().selModel.select(this.nextSibling,this.selectNext);return false}});return a}}}return null},onKeyDown:function(c){var b=this.selNode||this.lastSelNode;var d=this;if(!b){return}var a=c.getKey();switch(a){case c.DOWN:c.stopEvent();this.selectNext();break;case c.UP:c.stopEvent();this.selectPrevious();break;case c.RIGHT:c.preventDefault();if(b.hasChildNodes()){if(!b.isExpanded()){b.expand()}else{if(b.firstChild){this.select(b.firstChild,c)}}}break;case c.LEFT:c.preventDefault();if(b.hasChildNodes()&&b.isExpanded()){b.collapse()}else{if(b.parentNode&&(this.tree.rootVisible||b.parentNode!=this.tree.getRootNode())){this.select(b.parentNode,c)}}break}}});Ext.tree.MultiSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(a){this.selNodes=[];this.selMap={};this.addEvents("selectionchange");Ext.apply(this,a);Ext.tree.MultiSelectionModel.superclass.constructor.call(this)},init:function(a){this.tree=a;a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this);a.on("click",this.onNodeClick,this)},onNodeClick:function(a,b){if(b.ctrlKey&&this.isSelected(a)){this.unselect(a)}else{this.select(a,b,b.ctrlKey)}},select:function(a,c,b){if(b!==true){this.clearSelections(true)}if(this.isSelected(a)){this.lastSelNode=a;return a}this.selNodes.push(a);this.selMap[a.id]=a;this.lastSelNode=a;a.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,this.selNodes);return a},unselect:function(b){if(this.selMap[b.id]){b.ui.onSelectedChange(false);var c=this.selNodes;var a=c.indexOf(b);if(a!=-1){this.selNodes.splice(a,1)}delete this.selMap[b.id];this.fireEvent("selectionchange",this,this.selNodes)}},clearSelections:function(b){var d=this.selNodes;if(d.length>0){for(var c=0,a=d.length;c0},isExpandable:function(){return this.attributes.expandable||this.hasChildNodes()},appendChild:function(e){var f=false;if(Ext.isArray(e)){f=e}else{if(arguments.length>1){f=arguments}}if(f){for(var d=0,a=f.length;d0){var f=d?function(){e.apply(d,arguments)}:e;c.sort(f);for(var b=0;b
    ','',this.indentMarkup,"",'','',f?('':"/>")):"",'',e.text,"
    ",'',""].join("");if(k!==true&&e.nextSibling&&(b=e.nextSibling.ui.getEl())){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",b,d)}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",i,d)}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var h=this.elNode.childNodes;this.indentNode=h[0];this.ecNode=h[1];this.iconNode=h[2];var g=3;if(f){this.checkbox=h[3];this.checkbox.defaultChecked=this.checkbox.checked;g++}this.anchor=h[g];this.textNode=h[g].firstChild},getAnchor:function(){return this.anchor},getTextEl:function(){return this.textNode},getIconEl:function(){return this.iconNode},isChecked:function(){return this.checkbox?this.checkbox.checked:false},updateExpandIcon:function(){if(this.rendered){var f=this.node,d,c,a=f.isLast()?"x-tree-elbow-end":"x-tree-elbow",e=f.hasChildNodes();if(e||f.attributes.expandable){if(f.expanded){a+="-minus";d="x-tree-node-collapsed";c="x-tree-node-expanded"}else{a+="-plus";d="x-tree-node-expanded";c="x-tree-node-collapsed"}if(this.wasLeaf){this.removeClass("x-tree-node-leaf");this.wasLeaf=false}if(this.c1!=d||this.c2!=c){Ext.fly(this.elNode).replaceClass(d,c);this.c1=d;this.c2=c}}else{if(!this.wasLeaf){Ext.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-collapsed");delete this.c1;delete this.c2;this.wasLeaf=true}}var b="x-tree-ec-icon "+a;if(this.ecc!=b){this.ecNode.className=b;this.ecc=b}}},onIdChange:function(a){if(this.rendered){this.elNode.setAttribute("ext:tree-node-id",a)}},getChildIndent:function(){if(!this.childIndent){var a=[],b=this.node;while(b){if(!b.isRoot||(b.isRoot&&b.ownerTree.rootVisible)){if(!b.isLast()){a.unshift('')}else{a.unshift('')}}b=b.parentNode}this.childIndent=a.join("")}return this.childIndent},renderIndent:function(){if(this.rendered){var a="",b=this.node.parentNode;if(b){a=b.ui.getChildIndent()}if(this.indentMarkup!=a){this.indentNode.innerHTML=a;this.indentMarkup=a}this.updateExpandIcon()}},destroy:function(){if(this.elNode){Ext.dd.Registry.unregister(this.elNode.id)}Ext.each(["textnode","anchor","checkbox","indentNode","ecNode","iconNode","elNode","ctNode","wrap","holder"],function(a){if(this[a]){Ext.fly(this[a]).remove();delete this[a]}},this);delete this.node}};Ext.tree.RootTreeNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{render:function(){if(!this.rendered){var a=this.node.ownerTree.innerCt.dom;this.node.expanded=true;a.innerHTML='
    ';this.wrap=this.ctNode=a.firstChild}},collapse:Ext.emptyFn,expand:Ext.emptyFn});Ext.tree.TreeLoader=function(a){this.baseParams={};Ext.apply(this,a);this.addEvents("beforeload","load","loadexception");Ext.tree.TreeLoader.superclass.constructor.call(this);if(Ext.isString(this.paramOrder)){this.paramOrder=this.paramOrder.split(/[\s,|]/)}};Ext.extend(Ext.tree.TreeLoader,Ext.util.Observable,{uiProviders:{},clearOnLoad:true,paramOrder:undefined,paramsAsHash:false,nodeParameter:"node",directFn:undefined,load:function(b,c,a){if(this.clearOnLoad){while(b.firstChild){b.removeChild(b.firstChild)}}if(this.doPreload(b)){this.runCallback(c,a||b,[b])}else{if(this.directFn||this.dataUrl||this.url){this.requestData(b,c,a||b)}}},doPreload:function(d){if(d.attributes.children){if(d.childNodes.length<1){var c=d.attributes.children;d.beginUpdate();for(var b=0,a=c.length;b-1){c=[]}for(var d=0,a=b.length;dk){return e?-1:+1}else{return 0}}}};Ext.tree.TreeSorter.prototype={doSort:function(a){a.sort(this.sortFn)},compareNodes:function(b,a){return(b.text.toUpperCase()>a.text.toUpperCase()?1:-1)},updateSort:function(a,b){if(b.childrenRendered){this.doSort.defer(1,this,[b])}},updateSortParent:function(a){var b=a.parentNode;if(b&&b.childrenRendered){this.doSort.defer(1,this,[b])}}};if(Ext.dd.DropZone){Ext.tree.TreeDropZone=function(a,b){this.allowParentInsert=b.allowParentInsert||false;this.allowContainerDrop=b.allowContainerDrop||false;this.appendOnly=b.appendOnly||false;Ext.tree.TreeDropZone.superclass.constructor.call(this,a.getTreeEl(),b);this.tree=a;this.dragOverData={};this.lastInsertClass="x-tree-no-status"};Ext.extend(Ext.tree.TreeDropZone,Ext.dd.DropZone,{ddGroup:"TreeDD",expandDelay:1000,expandNode:function(a){if(a.hasChildNodes()&&!a.isExpanded()){a.expand(false,null,this.triggerCacheRefresh.createDelegate(this))}},queueExpand:function(a){this.expandProcId=this.expandNode.defer(this.expandDelay,this,[a])},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId);this.expandProcId=false}},isValidDropPoint:function(a,j,h,d,c){if(!a||!c){return false}var f=a.node;var g=c.node;if(!(f&&f.isTarget&&j)){return false}if(j=="append"&&f.allowChildren===false){return false}if((j=="above"||j=="below")&&(f.parentNode&&f.parentNode.allowChildren===false)){return false}if(g&&(f==g||g.contains(f))){return false}var b=this.dragOverData;b.tree=this.tree;b.target=f;b.data=c;b.point=j;b.source=h;b.rawEvent=d;b.dropNode=g;b.cancel=false;var i=this.tree.fireEvent("nodedragover",b);return b.cancel===false&&i!==false},getDropPoint:function(g,f,k){var l=f.node;if(l.isRoot){return l.allowChildren!==false?"append":false}var c=f.ddel;var m=Ext.lib.Dom.getY(c),i=m+c.offsetHeight;var h=Ext.lib.Event.getPageY(g);var j=l.allowChildren===false||l.isLeaf();if(this.appendOnly||l.parentNode.allowChildren===false){return j?false:"append"}var d=false;if(!this.allowParentInsert){d=l.hasChildNodes()&&l.isExpanded()}var a=(i-m)/(j?2:3);if(h>=m&&h<(m+a)){return"above"}else{if(!d&&(j||h>=i-a&&h<=i)){return"below"}else{return"append"}}},onNodeEnter:function(d,a,c,b){this.cancelExpand()},onContainerOver:function(a,c,b){if(this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,node:this.tree.getRootNode()},"append",a,c,b)){return this.dropAllowed}return this.dropNotAllowed},onNodeOver:function(b,h,g,f){var j=this.getDropPoint(g,b,h);var c=b.node;if(!this.expandProcId&&j=="append"&&c.hasChildNodes()&&!b.node.isExpanded()){this.queueExpand(c)}else{if(j!="append"){this.cancelExpand()}}var d=this.dropNotAllowed;if(this.isValidDropPoint(b,j,h,g,f)){if(j){var a=b.ddel;var i;if(j=="above"){d=b.node.isFirst()?"x-tree-drop-ok-above":"x-tree-drop-ok-between";i="x-tree-drag-insert-above"}else{if(j=="below"){d=b.node.isLast()?"x-tree-drop-ok-below":"x-tree-drop-ok-between";i="x-tree-drag-insert-below"}else{d="x-tree-drop-ok-append";i="x-tree-drag-append"}}if(this.lastInsertClass!=i){Ext.fly(a).replaceClass(this.lastInsertClass,i);this.lastInsertClass=i}}}return d},onNodeOut:function(d,a,c,b){this.cancelExpand();this.removeDropIndicators(d)},onNodeDrop:function(h,b,g,d){var a=this.getDropPoint(g,h,b);var f=h.node;f.ui.startDrop();if(!this.isValidDropPoint(h,a,b,g,d)){f.ui.endDrop();return false}var c=d.node||(b.getTreeNode?b.getTreeNode(d,f,a,g):null);return this.processDrop(f,d,a,b,g,c)},onContainerDrop:function(a,f,c){if(this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,node:this.tree.getRootNode()},"append",a,f,c)){var d=this.tree.getRootNode();d.ui.startDrop();var b=c.node||(a.getTreeNode?a.getTreeNode(c,d,"append",f):null);return this.processDrop(d,c,"append",a,f,b)}return false},processDrop:function(i,g,b,a,h,d){var f={tree:this.tree,target:i,data:g,point:b,source:a,rawEvent:h,dropNode:d,cancel:!d,dropStatus:false};var c=this.tree.fireEvent("beforenodedrop",f);if(c===false||f.cancel===true||!f.dropNode){i.ui.endDrop();return f.dropStatus}i=f.target;if(b=="append"&&!i.isExpanded()){i.expand(false,null,function(){this.completeDrop(f)}.createDelegate(this))}else{this.completeDrop(f)}return true},completeDrop:function(g){var d=g.dropNode,e=g.point,c=g.target;if(!Ext.isArray(d)){d=[d]}var f;for(var b=0,a=d.length;bd.offsetLeft){e.scrollLeft=d.offsetLeft}var a=Math.min(this.maxWidth,(e.clientWidth>20?e.clientWidth:e.offsetWidth)-Math.max(0,d.offsetLeft-e.scrollLeft)-5);this.setSize(a,"")},triggerEdit:function(a,c){this.completeEdit();if(a.attributes.editable!==false){this.editNode=a;if(this.tree.autoScroll){Ext.fly(a.ui.getEl()).scrollIntoView(this.tree.body)}var b=a.text||"";if(!Ext.isGecko&&Ext.isEmpty(a.text)){a.setText(" ")}this.autoEditTimer=this.startEdit.defer(this.editDelay,this,[a.ui.textNode,b]);return false}},bindScroll:function(){this.tree.getTreeEl().on("scroll",this.cancelEdit,this)},beforeNodeClick:function(a,b){clearTimeout(this.autoEditTimer);if(this.tree.getSelectionModel().isSelected(a)){b.stopEvent();return this.triggerEdit(a)}},onNodeDblClick:function(a,b){clearTimeout(this.autoEditTimer)},updateNode:function(a,b){this.tree.getTreeEl().un("scroll",this.cancelEdit,this);this.editNode.setText(b)},onHide:function(){Ext.tree.TreeEditor.superclass.onHide.call(this);if(this.editNode){this.editNode.ui.focus.defer(50,this.editNode.ui)}},onSpecialKey:function(c,b){var a=b.getKey();if(a==b.ESC){b.stopEvent();this.cancelEdit()}else{if(a==b.ENTER&&!b.hasModifier()){b.stopEvent();this.completeEdit()}}},onDestroy:function(){clearTimeout(this.autoEditTimer);Ext.tree.TreeEditor.superclass.onDestroy.call(this);var a=this.tree;a.un("beforeclick",this.beforeNodeClick,this);a.un("dblclick",this.onNodeDblClick,this)}}); \ No newline at end of file diff --git a/pkgs/resizable-debug.js b/pkgs/resizable-debug.js index b23299a1..14612fc3 100644 --- a/pkgs/resizable-debug.js +++ b/pkgs/resizable-debug.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/resizable.js b/pkgs/resizable.js index 60aa3663..055f2dbb 100644 --- a/pkgs/resizable.js +++ b/pkgs/resizable.js @@ -1,5 +1,5 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/state-debug.js b/pkgs/state-debug.js index b7768436..fe73a2d3 100644 --- a/pkgs/state-debug.js +++ b/pkgs/state-debug.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/state.js b/pkgs/state.js index 83ec0205..29f9165e 100644 --- a/pkgs/state.js +++ b/pkgs/state.js @@ -1,5 +1,5 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/window-debug.js b/pkgs/window-debug.js index e1cbf3a6..ffc8a337 100644 --- a/pkgs/window-debug.js +++ b/pkgs/window-debug.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/pkgs/window.js b/pkgs/window.js index 74e5f466..db37081c 100644 --- a/pkgs/window.js +++ b/pkgs/window.js @@ -1,5 +1,5 @@ /* - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/debug.css b/resources/css/debug.css index fa61235c..bbbf36f0 100644 --- a/resources/css/debug.css +++ b/resources/css/debug.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/ext-all-notheme.css b/resources/css/ext-all-notheme.css index ca7f6742..2dc750d1 100644 --- a/resources/css/ext-all-notheme.css +++ b/resources/css/ext-all-notheme.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -1038,10 +1038,6 @@ textarea { border: 1px solid; } -.ext-webkit .x-form-invalid{ - border: 1px solid; -} - .x-form-inner-invalid, textarea.x-form-inner-invalid{ background:repeat-x bottom; } diff --git a/resources/css/ext-all.css b/resources/css/ext-all.css index 42a8618b..305728bb 100644 --- a/resources/css/ext-all.css +++ b/resources/css/ext-all.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -1038,10 +1038,6 @@ textarea { border: 1px solid; } -.ext-webkit .x-form-invalid{ - border: 1px solid; -} - .x-form-inner-invalid, textarea.x-form-inner-invalid{ background:repeat-x bottom; } diff --git a/resources/css/reset-min.css b/resources/css/reset-min.css index 866bffa1..2be2e4ae 100644 --- a/resources/css/reset-min.css +++ b/resources/css/reset-min.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/borders.css b/resources/css/structure/borders.css index 5a128c2d..420243ea 100644 --- a/resources/css/structure/borders.css +++ b/resources/css/structure/borders.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/box.css b/resources/css/structure/box.css index a724b18a..fec03cbe 100644 --- a/resources/css/structure/box.css +++ b/resources/css/structure/box.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/button.css b/resources/css/structure/button.css index f463b938..0050a6fd 100644 --- a/resources/css/structure/button.css +++ b/resources/css/structure/button.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/combo.css b/resources/css/structure/combo.css index 0eb37884..c62bf7a2 100644 --- a/resources/css/structure/combo.css +++ b/resources/css/structure/combo.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/core.css b/resources/css/structure/core.css index 9a57570c..f9869975 100644 --- a/resources/css/structure/core.css +++ b/resources/css/structure/core.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/date-picker.css b/resources/css/structure/date-picker.css index d796f2fe..c9486f50 100644 --- a/resources/css/structure/date-picker.css +++ b/resources/css/structure/date-picker.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/dd.css b/resources/css/structure/dd.css index f12be52a..f385c342 100644 --- a/resources/css/structure/dd.css +++ b/resources/css/structure/dd.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/debug.css b/resources/css/structure/debug.css index da515e2f..e2b9e5dc 100644 --- a/resources/css/structure/debug.css +++ b/resources/css/structure/debug.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/dialog.css b/resources/css/structure/dialog.css index 0b32238c..574a83a0 100644 --- a/resources/css/structure/dialog.css +++ b/resources/css/structure/dialog.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/editor.css b/resources/css/structure/editor.css index 1c8a8005..5e375f68 100644 --- a/resources/css/structure/editor.css +++ b/resources/css/structure/editor.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/form.css b/resources/css/structure/form.css index a0ba3aa8..a87befea 100644 --- a/resources/css/structure/form.css +++ b/resources/css/structure/form.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -190,10 +190,6 @@ textarea { border: 1px solid; } -.ext-webkit .x-form-invalid{ - border: 1px solid; -} - .x-form-inner-invalid, textarea.x-form-inner-invalid{ background:repeat-x bottom; } diff --git a/resources/css/structure/grid.css b/resources/css/structure/grid.css index abd45982..e3056e74 100644 --- a/resources/css/structure/grid.css +++ b/resources/css/structure/grid.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/layout.css b/resources/css/structure/layout.css index f4c7169c..b98779f7 100644 --- a/resources/css/structure/layout.css +++ b/resources/css/structure/layout.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/list-view.css b/resources/css/structure/list-view.css index 64c2ea00..5b171381 100644 --- a/resources/css/structure/list-view.css +++ b/resources/css/structure/list-view.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/menu.css b/resources/css/structure/menu.css index 38ddcb0a..0de96c32 100644 --- a/resources/css/structure/menu.css +++ b/resources/css/structure/menu.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/panel-reset.css b/resources/css/structure/panel-reset.css index 5f795a8a..319eb070 100644 --- a/resources/css/structure/panel-reset.css +++ b/resources/css/structure/panel-reset.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/panel.css b/resources/css/structure/panel.css index aaf8d243..8db1ca42 100644 --- a/resources/css/structure/panel.css +++ b/resources/css/structure/panel.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/progress.css b/resources/css/structure/progress.css index 98f913a7..e06e9281 100644 --- a/resources/css/structure/progress.css +++ b/resources/css/structure/progress.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/qtips.css b/resources/css/structure/qtips.css index d5e293a6..6d4a3616 100644 --- a/resources/css/structure/qtips.css +++ b/resources/css/structure/qtips.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/reset.css b/resources/css/structure/reset.css index 866bffa1..2be2e4ae 100644 --- a/resources/css/structure/reset.css +++ b/resources/css/structure/reset.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/resizable.css b/resources/css/structure/resizable.css index 82b86341..0ae7ff75 100644 --- a/resources/css/structure/resizable.css +++ b/resources/css/structure/resizable.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/slider.css b/resources/css/structure/slider.css index f3a685f6..00e1059b 100644 --- a/resources/css/structure/slider.css +++ b/resources/css/structure/slider.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/tabs.css b/resources/css/structure/tabs.css index 79cd88cc..864c3949 100644 --- a/resources/css/structure/tabs.css +++ b/resources/css/structure/tabs.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/toolbar.css b/resources/css/structure/toolbar.css index 4e555446..6568c53a 100644 --- a/resources/css/structure/toolbar.css +++ b/resources/css/structure/toolbar.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/tree.css b/resources/css/structure/tree.css index ca41098f..5e5c7a8a 100644 --- a/resources/css/structure/tree.css +++ b/resources/css/structure/tree.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/structure/window.css b/resources/css/structure/window.css index fc71e278..a8c6fc6b 100644 --- a/resources/css/structure/window.css +++ b/resources/css/structure/window.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/borders.css b/resources/css/theme-access/borders.css index 896c35f7..80cc97ee 100644 --- a/resources/css/theme-access/borders.css +++ b/resources/css/theme-access/borders.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/box.css b/resources/css/theme-access/box.css index 02bc7508..6880310e 100644 --- a/resources/css/theme-access/box.css +++ b/resources/css/theme-access/box.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/button.css b/resources/css/theme-access/button.css index 2e9d2fdc..4df2a20d 100644 --- a/resources/css/theme-access/button.css +++ b/resources/css/theme-access/button.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/combo.css b/resources/css/theme-access/combo.css index c2155a4c..e9e451ce 100644 --- a/resources/css/theme-access/combo.css +++ b/resources/css/theme-access/combo.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/core.css b/resources/css/theme-access/core.css index a1881704..c2ffb064 100644 --- a/resources/css/theme-access/core.css +++ b/resources/css/theme-access/core.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/date-picker.css b/resources/css/theme-access/date-picker.css index 6fdcd6fc..e3af9634 100644 --- a/resources/css/theme-access/date-picker.css +++ b/resources/css/theme-access/date-picker.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/dd.css b/resources/css/theme-access/dd.css index 4f38b97b..40c59e14 100644 --- a/resources/css/theme-access/dd.css +++ b/resources/css/theme-access/dd.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/debug.css b/resources/css/theme-access/debug.css index e9d527ea..87a95088 100644 --- a/resources/css/theme-access/debug.css +++ b/resources/css/theme-access/debug.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/dialog.css b/resources/css/theme-access/dialog.css index 109bee68..03d32a4d 100644 --- a/resources/css/theme-access/dialog.css +++ b/resources/css/theme-access/dialog.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/editor.css b/resources/css/theme-access/editor.css index 9c1f4ed3..eeeea8e2 100644 --- a/resources/css/theme-access/editor.css +++ b/resources/css/theme-access/editor.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/form.css b/resources/css/theme-access/form.css index b9165cd7..fb992a8a 100644 --- a/resources/css/theme-access/form.css +++ b/resources/css/theme-access/form.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/grid.css b/resources/css/theme-access/grid.css index 8927f1fd..a3b40c10 100644 --- a/resources/css/theme-access/grid.css +++ b/resources/css/theme-access/grid.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/layout.css b/resources/css/theme-access/layout.css index 6bc5816f..c6315f34 100644 --- a/resources/css/theme-access/layout.css +++ b/resources/css/theme-access/layout.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/list-view.css b/resources/css/theme-access/list-view.css index a907b4c5..b42bbe46 100644 --- a/resources/css/theme-access/list-view.css +++ b/resources/css/theme-access/list-view.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/menu.css b/resources/css/theme-access/menu.css index 970e7263..b4cfa585 100644 --- a/resources/css/theme-access/menu.css +++ b/resources/css/theme-access/menu.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/panel.css b/resources/css/theme-access/panel.css index 8351b25a..a82e7438 100644 --- a/resources/css/theme-access/panel.css +++ b/resources/css/theme-access/panel.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/progress.css b/resources/css/theme-access/progress.css index a9bf01ed..9678e97b 100644 --- a/resources/css/theme-access/progress.css +++ b/resources/css/theme-access/progress.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/qtips.css b/resources/css/theme-access/qtips.css index 5ef35883..67ccf214 100644 --- a/resources/css/theme-access/qtips.css +++ b/resources/css/theme-access/qtips.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/resizable.css b/resources/css/theme-access/resizable.css index ccc41973..1f1870cc 100644 --- a/resources/css/theme-access/resizable.css +++ b/resources/css/theme-access/resizable.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/slider.css b/resources/css/theme-access/slider.css index 2f28271a..0a0249d7 100644 --- a/resources/css/theme-access/slider.css +++ b/resources/css/theme-access/slider.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/tabs.css b/resources/css/theme-access/tabs.css index f5e0d9cd..410dd12e 100644 --- a/resources/css/theme-access/tabs.css +++ b/resources/css/theme-access/tabs.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/toolbar.css b/resources/css/theme-access/toolbar.css index 024aa32a..e58b9a0f 100644 --- a/resources/css/theme-access/toolbar.css +++ b/resources/css/theme-access/toolbar.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/tree.css b/resources/css/theme-access/tree.css index ac0c8ce7..e0940900 100644 --- a/resources/css/theme-access/tree.css +++ b/resources/css/theme-access/tree.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-access/window.css b/resources/css/theme-access/window.css index 8c18fd1d..a9296e25 100644 --- a/resources/css/theme-access/window.css +++ b/resources/css/theme-access/window.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/borders.css b/resources/css/theme-gray/borders.css index 78853f0b..d7035c79 100644 --- a/resources/css/theme-gray/borders.css +++ b/resources/css/theme-gray/borders.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/box.css b/resources/css/theme-gray/box.css index 529b9bd3..fe023a5a 100644 --- a/resources/css/theme-gray/box.css +++ b/resources/css/theme-gray/box.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/button.css b/resources/css/theme-gray/button.css index c22cfbce..33ecb02c 100644 --- a/resources/css/theme-gray/button.css +++ b/resources/css/theme-gray/button.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/combo.css b/resources/css/theme-gray/combo.css index 091e1fc3..de26ebf6 100644 --- a/resources/css/theme-gray/combo.css +++ b/resources/css/theme-gray/combo.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/core.css b/resources/css/theme-gray/core.css index ead8a75a..312d4bc8 100644 --- a/resources/css/theme-gray/core.css +++ b/resources/css/theme-gray/core.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/date-picker.css b/resources/css/theme-gray/date-picker.css index 95ee0d8e..06ed6328 100644 --- a/resources/css/theme-gray/date-picker.css +++ b/resources/css/theme-gray/date-picker.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -53,8 +53,8 @@ } .x-date-inner .x-date-selected a{ + background-image: none; background-color:#D8D8D8; - background-image:url(../images/gray/glass-bg.gif); border-color:#DCDCDC; } diff --git a/resources/css/theme-gray/dd.css b/resources/css/theme-gray/dd.css index 3aef4e7a..49d24a3d 100644 --- a/resources/css/theme-gray/dd.css +++ b/resources/css/theme-gray/dd.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/debug.css b/resources/css/theme-gray/debug.css index 655c22d0..13221074 100644 --- a/resources/css/theme-gray/debug.css +++ b/resources/css/theme-gray/debug.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/dialog.css b/resources/css/theme-gray/dialog.css index 0124309a..4057d5e7 100644 --- a/resources/css/theme-gray/dialog.css +++ b/resources/css/theme-gray/dialog.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/editor.css b/resources/css/theme-gray/editor.css index 3a9bc037..d5844e54 100644 --- a/resources/css/theme-gray/editor.css +++ b/resources/css/theme-gray/editor.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/form.css b/resources/css/theme-gray/form.css index a112f37c..0a53835e 100644 --- a/resources/css/theme-gray/form.css +++ b/resources/css/theme-gray/form.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/grid.css b/resources/css/theme-gray/grid.css index 42ef925a..9bc9f18e 100644 --- a/resources/css/theme-gray/grid.css +++ b/resources/css/theme-gray/grid.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/layout.css b/resources/css/theme-gray/layout.css index 8b260499..cff4ffac 100644 --- a/resources/css/theme-gray/layout.css +++ b/resources/css/theme-gray/layout.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/list-view.css b/resources/css/theme-gray/list-view.css index 505def93..6984e11d 100644 --- a/resources/css/theme-gray/list-view.css +++ b/resources/css/theme-gray/list-view.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -32,6 +32,6 @@ } .x-list-header-inner em.sort-asc, .x-list-header-inner em.sort-desc { - background-image:url(../images/gray/grid/sort-hd.gif); + background-image:none; border-color: #d0d0d0; } diff --git a/resources/css/theme-gray/menu.css b/resources/css/theme-gray/menu.css index a9f7b141..dfbddd42 100644 --- a/resources/css/theme-gray/menu.css +++ b/resources/css/theme-gray/menu.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/panel.css b/resources/css/theme-gray/panel.css index ac29e51e..4465e870 100644 --- a/resources/css/theme-gray/panel.css +++ b/resources/css/theme-gray/panel.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/progress.css b/resources/css/theme-gray/progress.css index 9275b290..7485e859 100644 --- a/resources/css/theme-gray/progress.css +++ b/resources/css/theme-gray/progress.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/qtips.css b/resources/css/theme-gray/qtips.css index dbb9c9ee..7da4c6c7 100644 --- a/resources/css/theme-gray/qtips.css +++ b/resources/css/theme-gray/qtips.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/resizable.css b/resources/css/theme-gray/resizable.css index 586ea7ef..92d650c3 100644 --- a/resources/css/theme-gray/resizable.css +++ b/resources/css/theme-gray/resizable.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/slider.css b/resources/css/theme-gray/slider.css index 6e422392..c82e4f1c 100644 --- a/resources/css/theme-gray/slider.css +++ b/resources/css/theme-gray/slider.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/tabs.css b/resources/css/theme-gray/tabs.css index 9382c2fd..a91db579 100644 --- a/resources/css/theme-gray/tabs.css +++ b/resources/css/theme-gray/tabs.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/toolbar.css b/resources/css/theme-gray/toolbar.css index 41276bcc..5dfacda1 100644 --- a/resources/css/theme-gray/toolbar.css +++ b/resources/css/theme-gray/toolbar.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/tree.css b/resources/css/theme-gray/tree.css index ccabccdf..efe672c4 100644 --- a/resources/css/theme-gray/tree.css +++ b/resources/css/theme-gray/tree.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/theme-gray/window.css b/resources/css/theme-gray/window.css index 9585025a..7738cfca 100644 --- a/resources/css/theme-gray/window.css +++ b/resources/css/theme-gray/window.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/borders.css b/resources/css/visual/borders.css index 0e97ee0b..d06e3516 100644 --- a/resources/css/visual/borders.css +++ b/resources/css/visual/borders.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/box.css b/resources/css/visual/box.css index 2a7ae590..da1ff475 100644 --- a/resources/css/visual/box.css +++ b/resources/css/visual/box.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/button.css b/resources/css/visual/button.css index 4b133f8c..b4b7cf30 100644 --- a/resources/css/visual/button.css +++ b/resources/css/visual/button.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/combo.css b/resources/css/visual/combo.css index b61dc668..6430a3d5 100644 --- a/resources/css/visual/combo.css +++ b/resources/css/visual/combo.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/core.css b/resources/css/visual/core.css index f27ad0f5..a4348d0a 100644 --- a/resources/css/visual/core.css +++ b/resources/css/visual/core.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/date-picker.css b/resources/css/visual/date-picker.css index 966560c2..6a5d9a51 100644 --- a/resources/css/visual/date-picker.css +++ b/resources/css/visual/date-picker.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/dd.css b/resources/css/visual/dd.css index 3eadb546..9febe0a7 100644 --- a/resources/css/visual/dd.css +++ b/resources/css/visual/dd.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/debug.css b/resources/css/visual/debug.css index ea659d75..03e86cee 100644 --- a/resources/css/visual/debug.css +++ b/resources/css/visual/debug.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/dialog.css b/resources/css/visual/dialog.css index 7437d506..1b559419 100644 --- a/resources/css/visual/dialog.css +++ b/resources/css/visual/dialog.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/editor.css b/resources/css/visual/editor.css index 323369ef..fabe843e 100644 --- a/resources/css/visual/editor.css +++ b/resources/css/visual/editor.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/form.css b/resources/css/visual/form.css index c6e4ad7d..05bb9773 100644 --- a/resources/css/visual/form.css +++ b/resources/css/visual/form.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/grid.css b/resources/css/visual/grid.css index 4cbc6a19..0b000b5c 100644 --- a/resources/css/visual/grid.css +++ b/resources/css/visual/grid.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/layout.css b/resources/css/visual/layout.css index d96a58f8..99d32d9c 100644 --- a/resources/css/visual/layout.css +++ b/resources/css/visual/layout.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/list-view.css b/resources/css/visual/list-view.css index cd20d6ff..9014f3c3 100644 --- a/resources/css/visual/list-view.css +++ b/resources/css/visual/list-view.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/menu.css b/resources/css/visual/menu.css index 045953c5..72dbfb92 100644 --- a/resources/css/visual/menu.css +++ b/resources/css/visual/menu.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/panel.css b/resources/css/visual/panel.css index a5c6b2cb..1f291f2a 100644 --- a/resources/css/visual/panel.css +++ b/resources/css/visual/panel.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/progress.css b/resources/css/visual/progress.css index aacce399..6fa039a6 100644 --- a/resources/css/visual/progress.css +++ b/resources/css/visual/progress.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/qtips.css b/resources/css/visual/qtips.css index e6b098e9..82258e92 100644 --- a/resources/css/visual/qtips.css +++ b/resources/css/visual/qtips.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/resizable.css b/resources/css/visual/resizable.css index b460ed8b..e569b1a3 100644 --- a/resources/css/visual/resizable.css +++ b/resources/css/visual/resizable.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/slider.css b/resources/css/visual/slider.css index af9e51a5..afbc0605 100644 --- a/resources/css/visual/slider.css +++ b/resources/css/visual/slider.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/tabs.css b/resources/css/visual/tabs.css index 8e9059b7..f1dc91e0 100644 --- a/resources/css/visual/tabs.css +++ b/resources/css/visual/tabs.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/toolbar.css b/resources/css/visual/toolbar.css index 1989da90..167cd60e 100644 --- a/resources/css/visual/toolbar.css +++ b/resources/css/visual/toolbar.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/tree.css b/resources/css/visual/tree.css index f7f0fcdb..7975731a 100644 --- a/resources/css/visual/tree.css +++ b/resources/css/visual/tree.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/visual/window.css b/resources/css/visual/window.css index 6ac33ed8..a66853e3 100644 --- a/resources/css/visual/window.css +++ b/resources/css/visual/window.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/xtheme-access.css b/resources/css/xtheme-access.css index a4fba68d..0a38af83 100644 --- a/resources/css/xtheme-access.css +++ b/resources/css/xtheme-access.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/xtheme-blue.css b/resources/css/xtheme-blue.css index 934f3a74..9d525640 100644 --- a/resources/css/xtheme-blue.css +++ b/resources/css/xtheme-blue.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/css/xtheme-gray.css b/resources/css/xtheme-gray.css index 473df07e..5801f454 100644 --- a/resources/css/xtheme-gray.css +++ b/resources/css/xtheme-gray.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -1011,8 +1011,8 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as } .x-date-inner .x-date-selected a{ + background-image: none; background-color:#D8D8D8; - background-image:url(../images/gray/glass-bg.gif); border-color:#DCDCDC; } @@ -1606,7 +1606,7 @@ body.x-body-masked .x-window-plain .x-window-mc { } .x-list-header-inner em.sort-asc, .x-list-header-inner em.sort-desc { - background-image:url(../images/gray/grid/sort-hd.gif); + background-image:none; border-color: #d0d0d0; } .x-slider-horz, .x-slider-horz .x-slider-end, .x-slider-horz .x-slider-inner { diff --git a/resources/css/yourtheme.css b/resources/css/yourtheme.css index 934f3a74..9d525640 100644 --- a/resources/css/yourtheme.css +++ b/resources/css/yourtheme.css @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/resources/images/gray/sizer/ne-handle.gif b/resources/images/gray/sizer/ne-handle.gif index 92ad82cf..6f7b0c29 100644 Binary files a/resources/images/gray/sizer/ne-handle.gif and b/resources/images/gray/sizer/ne-handle.gif differ diff --git a/src/adapter/ext-base-dom-more.js b/src/adapter/ext-base-dom-more.js index a4c3b01c..341db2c6 100644 --- a/src/adapter/ext-base-dom-more.js +++ b/src/adapter/ext-base-dom-more.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/adapter/jquery-bridge.js b/src/adapter/jquery-bridge.js index 22adffee..5e908ce2 100644 --- a/src/adapter/jquery-bridge.js +++ b/src/adapter/jquery-bridge.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/adapter/prototype-bridge.js b/src/adapter/prototype-bridge.js index fef8aadd..f068810a 100644 --- a/src/adapter/prototype-bridge.js +++ b/src/adapter/prototype-bridge.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/adapter/yui-bridge.js b/src/adapter/yui-bridge.js index a099ac04..74a3e8a5 100644 --- a/src/adapter/yui-bridge.js +++ b/src/adapter/yui-bridge.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/core/CompositeElement.js b/src/core/CompositeElement.js index 376daaf0..2290632a 100644 --- a/src/core/CompositeElement.js +++ b/src/core/CompositeElement.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -25,12 +25,12 @@ els.hide(true); // all elements fade out and hide els.setWidth(100).hide(true);
    */ -Ext.CompositeElement = function(els, root){ - this.elements = []; - this.add(els, root); -}; - -Ext.extend(Ext.CompositeElement, Ext.CompositeElementLite, { +Ext.CompositeElement = Ext.extend(Ext.CompositeElementLite, { + + constructor : function(els, root){ + this.elements = []; + this.add(els, root); + }, // private getElement : function(el){ @@ -106,7 +106,7 @@ Ext.Element.select = function(selector, unique, root){ * @param {Boolean} unique (optional) true to create a unique Ext.Element for each element (defaults to a shared flyweight object) * @param {HTMLElement/String} root (optional) The root element of the query or id of the root * @return {CompositeElementLite/CompositeElement} - * @member Ext.Element + * @member Ext * @method select */ Ext.select = Ext.Element.select; \ No newline at end of file diff --git a/src/core/CompositeElementLite-more.js b/src/core/CompositeElementLite-more.js index 3e82070e..9f0160ad 100644 --- a/src/core/CompositeElementLite-more.js +++ b/src/core/CompositeElementLite-more.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -7,29 +7,29 @@ /** * @class Ext.CompositeElementLite */ -Ext.apply(Ext.CompositeElementLite.prototype, { - addElements : function(els, root){ +Ext.apply(Ext.CompositeElementLite.prototype, { + addElements : function(els, root){ if(!els){ return this; } if(typeof els == "string"){ els = Ext.Element.selectorFunction(els, root); } - var yels = this.elements; - Ext.each(els, function(e) { - yels.push(Ext.get(e)); + var yels = this.elements; + Ext.each(els, function(e) { + yels.push(Ext.get(e)); }); return this; }, - + /** * Returns the first Element * @return {Ext.Element} */ first : function(){ return this.item(0); - }, - + }, + /** * Returns the last Element * @return {Ext.Element} @@ -37,7 +37,7 @@ Ext.apply(Ext.CompositeElementLite.prototype, { last : function(){ return this.item(this.getCount()-1); }, - + /** * Returns true if this composite contains the passed element * @param el {Mixed} The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection. @@ -46,7 +46,7 @@ Ext.apply(Ext.CompositeElementLite.prototype, { contains : function(el){ return this.indexOf(el) != -1; }, - + /** * Removes the specified element(s). * @param {Mixed} el The id of an element, the Element itself, the index of the element in this composite @@ -56,20 +56,20 @@ Ext.apply(Ext.CompositeElementLite.prototype, { */ removeElement : function(keys, removeDom){ var me = this, - els = this.elements, - el; - Ext.each(keys, function(val){ - if ((el = (els[val] || els[val = me.indexOf(val)]))) { - if(removeDom){ + els = this.elements, + el; + Ext.each(keys, function(val){ + if ((el = (els[val] || els[val = me.indexOf(val)]))) { + if(removeDom){ if(el.dom){ el.remove(); }else{ Ext.removeNode(el); } } - els.splice(val, 1); - } - }); + els.splice(val, 1); + } + }); return this; - } + } }); diff --git a/src/core/DomHelper-more.js b/src/core/DomHelper-more.js index 4060641f..6e5d5f4f 100644 --- a/src/core/DomHelper-more.js +++ b/src/core/DomHelper-more.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -9,22 +9,23 @@ */ Ext.apply(Ext.DomHelper, function(){ - var pub, - afterbegin = 'afterbegin', - afterend = 'afterend', - beforebegin = 'beforebegin', - beforeend = 'beforeend'; + var pub, + afterbegin = 'afterbegin', + afterend = 'afterend', + beforebegin = 'beforebegin', + beforeend = 'beforeend', + confRe = /tag|children|cn|html$/i; - // private + // private function doInsert(el, o, returnElement, pos, sibling, append){ el = Ext.getDom(el); var newNode; if (pub.useDom) { newNode = createDom(o, null); if (append) { - el.appendChild(newNode); + el.appendChild(newNode); } else { - (sibling == 'firstChild' ? el : el.parentNode).insertBefore(newNode, el[sibling] || el); + (sibling == 'firstChild' ? el : el.parentNode).insertBefore(newNode, el[sibling] || el); } } else { newNode = Ext.DomHelper.insertHtml(pos, el, Ext.DomHelper.createHtml(o)); @@ -32,39 +33,40 @@ function(){ return returnElement ? Ext.get(newNode, true) : newNode; } - // build as dom + // build as dom /** @ignore */ function createDom(o, parentNode){ var el, - doc = document, - useSet, - attr, - val, - cn; + doc = document, + useSet, + attr, + val, + cn; if (Ext.isArray(o)) { // Allow Arrays of siblings to be inserted el = doc.createDocumentFragment(); // in one shot using a DocumentFragment - Ext.each(o, function(v) { - createDom(v, el); - }); - } else if (Ext.isString(o)) { // Allow a string as a child spec. + for (var i = 0, l = o.length; i < l; i++) { + createDom(o[i], el); + } + } else if (typeof o == 'string') { // Allow a string as a child spec. el = doc.createTextNode(o); } else { el = doc.createElement( o.tag || 'div' ); useSet = !!el.setAttribute; // In IE some elements don't have setAttribute - Ext.iterate(o, function(attr, val){ - if(!/tag|children|cn|html|style/.test(attr)){ - if(attr == 'cls'){ - el.className = val; - }else{ + for (var attr in o) { + if(!confRe.test(attr)){ + val = o[attr]; + if(attr == 'cls'){ + el.className = val; + }else{ if(useSet){ el.setAttribute(attr, val); }else{ el[attr] = val; } - } + } } - }); + } Ext.DomHelper.applyStyles(el, o.style); if ((cn = o.children || o.cn)) { @@ -79,74 +81,74 @@ function(){ return el; } - pub = { - /** - * Creates a new Ext.Template from the DOM object spec. - * @param {Object} o The DOM object spec (and children) - * @return {Ext.Template} The new template - */ - createTemplate : function(o){ - var html = Ext.DomHelper.createHtml(o); - return new Ext.Template(html); - }, + pub = { + /** + * Creates a new Ext.Template from the DOM object spec. + * @param {Object} o The DOM object spec (and children) + * @return {Ext.Template} The new template + */ + createTemplate : function(o){ + var html = Ext.DomHelper.createHtml(o); + return new Ext.Template(html); + }, - /** True to force the use of DOM instead of html fragments @type Boolean */ - useDom : false, + /** True to force the use of DOM instead of html fragments @type Boolean */ + useDom : false, - /** - * Creates new DOM element(s) and inserts them before el. - * @param {Mixed} el The context element - * @param {Object/String} o The DOM object spec (and children) or raw HTML blob - * @param {Boolean} returnElement (optional) true to return a Ext.Element - * @return {HTMLElement/Ext.Element} The new node + /** + * Creates new DOM element(s) and inserts them before el. + * @param {Mixed} el The context element + * @param {Object/String} o The DOM object spec (and children) or raw HTML blob + * @param {Boolean} returnElement (optional) true to return a Ext.Element + * @return {HTMLElement/Ext.Element} The new node * @hide (repeat) - */ - insertBefore : function(el, o, returnElement){ - return doInsert(el, o, returnElement, beforebegin); - }, + */ + insertBefore : function(el, o, returnElement){ + return doInsert(el, o, returnElement, beforebegin); + }, - /** - * Creates new DOM element(s) and inserts them after el. - * @param {Mixed} el The context element - * @param {Object} o The DOM object spec (and children) - * @param {Boolean} returnElement (optional) true to return a Ext.Element - * @return {HTMLElement/Ext.Element} The new node + /** + * Creates new DOM element(s) and inserts them after el. + * @param {Mixed} el The context element + * @param {Object} o The DOM object spec (and children) + * @param {Boolean} returnElement (optional) true to return a Ext.Element + * @return {HTMLElement/Ext.Element} The new node * @hide (repeat) - */ - insertAfter : function(el, o, returnElement){ - return doInsert(el, o, returnElement, afterend, 'nextSibling'); - }, + */ + insertAfter : function(el, o, returnElement){ + return doInsert(el, o, returnElement, afterend, 'nextSibling'); + }, - /** - * Creates new DOM element(s) and inserts them as the first child of el. - * @param {Mixed} el The context element - * @param {Object/String} o The DOM object spec (and children) or raw HTML blob - * @param {Boolean} returnElement (optional) true to return a Ext.Element - * @return {HTMLElement/Ext.Element} The new node + /** + * Creates new DOM element(s) and inserts them as the first child of el. + * @param {Mixed} el The context element + * @param {Object/String} o The DOM object spec (and children) or raw HTML blob + * @param {Boolean} returnElement (optional) true to return a Ext.Element + * @return {HTMLElement/Ext.Element} The new node * @hide (repeat) - */ - insertFirst : function(el, o, returnElement){ - return doInsert(el, o, returnElement, afterbegin, 'firstChild'); - }, + */ + insertFirst : function(el, o, returnElement){ + return doInsert(el, o, returnElement, afterbegin, 'firstChild'); + }, - /** - * Creates new DOM element(s) and appends them to el. - * @param {Mixed} el The context element - * @param {Object/String} o The DOM object spec (and children) or raw HTML blob - * @param {Boolean} returnElement (optional) true to return a Ext.Element - * @return {HTMLElement/Ext.Element} The new node + /** + * Creates new DOM element(s) and appends them to el. + * @param {Mixed} el The context element + * @param {Object/String} o The DOM object spec (and children) or raw HTML blob + * @param {Boolean} returnElement (optional) true to return a Ext.Element + * @return {HTMLElement/Ext.Element} The new node * @hide (repeat) - */ - append: function(el, o, returnElement){ + */ + append: function(el, o, returnElement){ return doInsert(el, o, returnElement, beforeend, '', true); }, - /** - * Creates new DOM element(s) without inserting them to the document. - * @param {Object/String} o The DOM object spec (and children) or raw HTML blob - * @return {HTMLElement} The new uninserted node - */ + /** + * Creates new DOM element(s) without inserting them to the document. + * @param {Object/String} o The DOM object spec (and children) or raw HTML blob + * @return {HTMLElement} The new uninserted node + */ createDom: createDom - }; - return pub; -}()); \ No newline at end of file + }; + return pub; +}()); diff --git a/src/core/Element-more.js b/src/core/Element-more.js index 11305b3e..03a36d70 100644 --- a/src/core/Element-more.js +++ b/src/core/Element-more.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -109,7 +109,7 @@ Ext.Element.addMethods({ if(loadScripts !== true){ this.dom.innerHTML = html; - if(Ext.isFunction(callback)){ + if(typeof callback == 'function'){ callback(); } return this; @@ -154,7 +154,7 @@ Ext.Element.addMethods({ } el = DOC.getElementById(id); if(el){Ext.removeNode(el);} - if(Ext.isFunction(callback)){ + if(typeof callback == 'function'){ callback(); } }); @@ -177,7 +177,7 @@ Ext.Element.addMethods({ * @return {Ext.Element} The new proxy element */ createProxy : function(config, renderTo, matchBox){ - config = Ext.isObject(config) ? config : {tag : "div", cls: config}; + config = (typeof config == 'object') ? config : {tag : "div", cls: config}; var me = this, proxy = renderTo ? Ext.DomHelper.append(renderTo, config, true) : diff --git a/src/core/Element.alignment.js b/src/core/Element.alignment.js index ec74e812..55592539 100644 --- a/src/core/Element.alignment.js +++ b/src/core/Element.alignment.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/core/Element.dd.js b/src/core/Element.dd.js index f0d6797c..2771b13b 100644 --- a/src/core/Element.dd.js +++ b/src/core/Element.dd.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/core/Element.fx-more.js b/src/core/Element.fx-more.js index 3db75a4f..82d819bc 100644 --- a/src/core/Element.fx-more.js +++ b/src/core/Element.fx-more.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/core/Element.insertion-more.js b/src/core/Element.insertion-more.js index fa8a2214..53376e7d 100644 --- a/src/core/Element.insertion-more.js +++ b/src/core/Element.insertion-more.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/core/Element.keys.js b/src/core/Element.keys.js index 2318f49b..e5a2e1df 100644 --- a/src/core/Element.keys.js +++ b/src/core/Element.keys.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -18,7 +18,7 @@ Ext.Element.addMethods({ */ addKeyListener : function(key, fn, scope){ var config; - if(!Ext.isObject(key) || Ext.isArray(key)){ + if(typeof key != 'object' || Ext.isArray(key)){ config = { key: key, fn: fn, @@ -45,4 +45,4 @@ Ext.Element.addMethods({ addKeyMap : function(config){ return new Ext.KeyMap(this, config); } -}); \ No newline at end of file +}); diff --git a/src/core/Element.legacy.js b/src/core/Element.legacy.js index 4716b94d..4ab95231 100644 --- a/src/core/Element.legacy.js +++ b/src/core/Element.legacy.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/core/Element.position-more.js b/src/core/Element.position-more.js index f53dc6c5..03f5a8a8 100644 --- a/src/core/Element.position-more.js +++ b/src/core/Element.position-more.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/core/Element.scroll-more.js b/src/core/Element.scroll-more.js index 6cf418c6..f313e5e6 100644 --- a/src/core/Element.scroll-more.js +++ b/src/core/Element.scroll-more.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/core/Element.style-more.js b/src/core/Element.style-more.js index 062d95cc..c6897485 100644 --- a/src/core/Element.style-more.js +++ b/src/core/Element.style-more.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -106,7 +106,7 @@ Ext.Element.addMethods(function(){ */ setSize : function(width, height, animate){ var me = this; - if(Ext.isObject(width)){ // in case of object from getSize() + if(typeof width == 'object'){ // in case of object from getSize() height = width.height; width = width.width; } diff --git a/src/core/Element.traversal-more.js b/src/core/Element.traversal-more.js index bebd07e2..e985cd9c 100644 --- a/src/core/Element.traversal-more.js +++ b/src/core/Element.traversal-more.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/core/Error.js b/src/core/Error.js index b4ded0ae..01d90281 100644 --- a/src/core/Error.js +++ b/src/core/Error.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/core/EventManager-more.js b/src/core/EventManager-more.js index 03cf4e3d..e8351a51 100644 --- a/src/core/EventManager-more.js +++ b/src/core/EventManager-more.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/core/Ext-more.js b/src/core/Ext-more.js index d90f429a..cd9d3578 100644 --- a/src/core/Ext-more.js +++ b/src/core/Ext-more.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -17,7 +17,7 @@ Ext.ns("Ext.grid", "Ext.list", "Ext.dd", "Ext.tree", "Ext.form", "Ext.menu", */ Ext.apply(Ext, function(){ - var E = Ext, + var E = Ext, idSeed = 0, scrollWidth = null; @@ -30,13 +30,13 @@ Ext.apply(Ext, function(){ emptyFn : function(){}, /** - * URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images. + * URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images. * In older versions of IE, this defaults to "http://extjs.com/s.gif" and you should change this to a URL on your server. * For other browsers it uses an inline data URL. * @type String */ BLANK_IMAGE_URL : Ext.isIE6 || Ext.isIE7 || Ext.isAir ? - 'http:/' + '/extjs.com/s.gif' : + 'http:/' + '/www.extjs.com/s.gif' : 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', extendX : function(supr, fn){ @@ -58,7 +58,7 @@ Ext.apply(Ext, function(){ * @return {Number} Value, if numeric, else defaultValue */ num : function(v, defaultValue){ - v = Number(Ext.isEmpty(v) || Ext.isArray(v) || Ext.isBoolean(v) || (Ext.isString(v) && v.trim().length == 0) ? NaN : v); + v = Number(Ext.isEmpty(v) || Ext.isArray(v) || typeof v == 'boolean' || (typeof v == 'string' && v.trim().length == 0) ? NaN : v); return isNaN(v) ? defaultValue : v; }, @@ -101,13 +101,13 @@ Ext.addBehaviors({ '#foo a@click' : function(e, t){ // do something }, - + // add the same listener to multiple selectors (separated by comma BEFORE the @) '#foo a, #bar span.some-class@mouseover' : function(){ // do something } }); - * + * * @param {Object} obj The list of behaviors to apply */ addBehaviors : function(o){ @@ -132,7 +132,7 @@ Ext.addBehaviors({ cache = null; } }, - + /** * Utility method for getting the width of the browser scrollbar. This can differ depending on * operating system settings, such as the theme or font size. @@ -143,7 +143,7 @@ Ext.addBehaviors({ if(!Ext.isReady){ return 0; } - + if(force === true || scrollWidth === null){ // Append our div, do our calculation and then remove it var div = Ext.getBody().createChild('
    '), @@ -185,7 +185,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { this.initialBox = Ext.copyTo({}, this.initialConfig, 'x,y,width,height'); } }); - * + * * @param {Object} dest The destination object. * @param {Object} source The source object. * @param {Array/String} names Either an Array of property names, or a comma-delimited list @@ -193,7 +193,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { * @return {Object} The modified object. */ copyTo : function(dest, source, names){ - if(Ext.isString(names)){ + if(typeof names == 'string'){ names = names.split(/[,;\s]/); } Ext.each(names, function(name){ @@ -219,11 +219,11 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { if(arg){ if(Ext.isArray(arg)){ this.destroy.apply(this, arg); - }else if(Ext.isFunction(arg.destroy)){ + }else if(typeof arg.destroy == 'function'){ arg.destroy(); }else if(arg.dom){ arg.remove(); - } + } } }, this); }, @@ -350,8 +350,8 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { /** * Partitions the set into two sets: a true set and a false set. - * Example: - * Example2: + * Example: + * Example2: *
    
     // Example 1:
     Ext.partition([true, false, true, true, false]); // [[true, true, true], [false, false]]
    @@ -395,7 +395,7 @@ Ext.invoke(Ext.query("p"), "getAttribute", "id");
                 var ret = [],
                     args = Array.prototype.slice.call(arguments, 2);
                 Ext.each(arr, function(v,i) {
    -                if (v && Ext.isFunction(v[methodName])) {
    +                if (v && typeof v[methodName] == 'function') {
                         ret.push(v[methodName].apply(v, args));
                     } else {
                         ret.push(undefined);
    @@ -442,7 +442,7 @@ Ext.zip(
              * @return {Array} The zipped set.
              */
             zip : function(){
    -            var parts = Ext.partition(arguments, function( val ){ return !Ext.isFunction(val); }),
    +            var parts = Ext.partition(arguments, function( val ){ return typeof val != 'function'; }),
                     arrs = parts[0],
                     fn = parts[1][0],
                     len = Ext.max(Ext.pluck(arrs, "length")),
    @@ -519,7 +519,7 @@ Ext.zip(
                         case RegExp: return 'regexp';
                         case Date: return 'date';
                     }
    -                if(Ext.isNumber(o.length) && Ext.isFunction(o.item)) {
    +                if(typeof o.length == 'number' && typeof o.item == 'function') {
                         return 'nodelist';
                     }
                 }
    @@ -532,7 +532,7 @@ Ext.zip(
     
             // internal
             callback : function(cb, scope, args, delay){
    -            if(Ext.isFunction(cb)){
    +            if(typeof cb == 'function'){
                     if(delay){
                         cb.defer(delay, scope, args || []);
                     }else{
    @@ -572,7 +572,7 @@ sayGoodbye('Fred'); // both alerts show
          */
         createSequence : function(fcn, scope){
             var method = this;
    -        return !Ext.isFunction(fcn) ?
    +        return (typeof fcn != 'function') ?
                     this :
                     function(){
                         var retval = method.apply(this || window, arguments);
    diff --git a/src/core/Template-more.js b/src/core/Template-more.js
    index 2efe4dc7..de0ed5b9 100644
    --- a/src/core/Template-more.js
    +++ b/src/core/Template-more.js
    @@ -1,5 +1,5 @@
     /*!
    - * Ext JS Library 3.2.0
    + * Ext JS Library 3.2.1
      * Copyright(c) 2006-2010 Ext JS, Inc.
      * licensing@extjs.com
      * http://www.extjs.com/license
    @@ -21,12 +21,12 @@ var t = new Ext.Template(
         {
             compiled: true,      // {@link #compile} immediately
             disableFormats: true // reduce {@link #apply} time since no formatting
    -    }    
    +    }
     );
          * 
    * For a list of available format functions, see {@link Ext.util.Format}. */ - disableFormats : false, + disableFormats : false, /** * See {@link #disableFormats}. * @type Boolean @@ -40,6 +40,10 @@ var t = new Ext.Template( * @hide repeat doc */ re : /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g, + argsRe : /^\s*['"](.*)["']\s*$/, + compileARe : /\\/g, + compileBRe : /(\r\n|\n)/g, + compileCRe : /'/g, /** * Returns an HTML fragment of this template with the specified values applied. @@ -48,11 +52,11 @@ var t = new Ext.Template( * @hide repeat doc */ applyTemplate : function(values){ - var me = this, - useF = me.disableFormats !== true, - fm = Ext.util.Format, - tpl = me; - + var me = this, + useF = me.disableFormats !== true, + fm = Ext.util.Format, + tpl = me; + if(me.compiled){ return me.compiled(values); } @@ -65,7 +69,7 @@ var t = new Ext.Template( // quoted values are required for strings in compiled templates, // but for non compiled we need to strip them // quoted reversed for jsmin - var re = /^\s*['"](.*)["']\s*$/; + var re = me.argsRe; args = args.split(','); for(var i = 0, len = args.length; i < len; i++){ args[i] = args[i].replace(re, "$1"); @@ -82,7 +86,7 @@ var t = new Ext.Template( } return me.html.replace(me.re, fn); }, - + /** * Compiles the template into an internal function, eliminating the RegEx overhead. * @return {Ext.Template} this @@ -90,11 +94,11 @@ var t = new Ext.Template( */ compile : function(){ var me = this, - fm = Ext.util.Format, - useF = me.disableFormats !== true, - sep = Ext.isGecko ? "+" : ",", - body; - + fm = Ext.util.Format, + useF = me.disableFormats !== true, + sep = Ext.isGecko ? "+" : ",", + body; + function fn(m, name, format, args){ if(format && useF){ args = args ? ',' + args : ""; @@ -109,25 +113,25 @@ var t = new Ext.Template( } return "'"+ sep + format + "values['" + name + "']" + args + ")"+sep+"'"; } - + // branched to use + in gecko and [].join() in others if(Ext.isGecko){ body = "this.compiled = function(values){ return '" + - me.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn) + + me.html.replace(me.compileARe, '\\\\').replace(me.compileBRe, '\\n').replace(me.compileCRe, "\\'").replace(me.re, fn) + "';};"; }else{ body = ["this.compiled = function(values){ return ['"]; - body.push(me.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn)); + body.push(me.html.replace(me.compileARe, '\\\\').replace(me.compileBRe, '\\n').replace(me.compileCRe, "\\'").replace(me.re, fn)); body.push("'].join('');};"); body = body.join(''); } eval(body); return me; }, - + // private function used to call members call : function(fnName, value, allValues){ return this[fnName](value, allValues); } }); -Ext.Template.prototype.apply = Ext.Template.prototype.applyTemplate; \ No newline at end of file +Ext.Template.prototype.apply = Ext.Template.prototype.applyTemplate; diff --git a/src/data/Api.js b/src/data/Api.js index 9283b512..1b96c1ec 100644 --- a/src/data/Api.js +++ b/src/data/Api.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/ArrayReader.js b/src/data/ArrayReader.js index f741a3d1..509d0919 100644 --- a/src/data/ArrayReader.js +++ b/src/data/ArrayReader.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/ArrayStore.js b/src/data/ArrayStore.js index 3e061bc2..c4e06e3c 100644 --- a/src/data/ArrayStore.js +++ b/src/data/ArrayStore.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/DataField.js b/src/data/DataField.js index 39662fb6..86d97143 100644 --- a/src/data/DataField.js +++ b/src/data/DataField.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/DataProxy.js b/src/data/DataProxy.js index 252b67cf..38ac5fce 100644 --- a/src/data/DataProxy.js +++ b/src/data/DataProxy.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/DataReader.js b/src/data/DataReader.js index 30a9f091..f1224d56 100644 --- a/src/data/DataReader.js +++ b/src/data/DataReader.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/DataWriter.js b/src/data/DataWriter.js index 5a8b75f1..5196c791 100644 --- a/src/data/DataWriter.js +++ b/src/data/DataWriter.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/DirectProxy.js b/src/data/DirectProxy.js index 28f70a66..73c8ad1c 100644 --- a/src/data/DirectProxy.js +++ b/src/data/DirectProxy.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/DirectStore.js b/src/data/DirectStore.js index ee595e5c..b239c962 100644 --- a/src/data/DirectStore.js +++ b/src/data/DirectStore.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/GroupingStore.js b/src/data/GroupingStore.js index 1cd2a0a1..91163d84 100644 --- a/src/data/GroupingStore.js +++ b/src/data/GroupingStore.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -169,7 +169,7 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, { } else if (fieldName == undefined) { //we preserve the existing sortInfo here because this.sort is called after //clearGrouping and there may be existing sorting - sorters = [this.sortInfo]; + sorters = this.sortInfo ? [this.sortInfo] : []; } else { //TODO: this is lifted straight from Ext.data.Store's singleSort function. It should instead be //refactored into a common method if possible diff --git a/src/data/HttpProxy.js b/src/data/HttpProxy.js index bd444d6f..81ef4142 100644 --- a/src/data/HttpProxy.js +++ b/src/data/HttpProxy.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/JsonReader.js b/src/data/JsonReader.js index 88680b7a..d93f9f5d 100644 --- a/src/data/JsonReader.js +++ b/src/data/JsonReader.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/JsonStore.js b/src/data/JsonStore.js index 1e850814..b465698a 100644 --- a/src/data/JsonStore.js +++ b/src/data/JsonStore.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/JsonWriter.js b/src/data/JsonWriter.js index 75388c3d..5745bd89 100644 --- a/src/data/JsonWriter.js +++ b/src/data/JsonWriter.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/MemoryProxy.js b/src/data/MemoryProxy.js index b17cea16..0e366d6a 100644 --- a/src/data/MemoryProxy.js +++ b/src/data/MemoryProxy.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/Record.js b/src/data/Record.js index 3eb2f42f..9931f677 100644 --- a/src/data/Record.js +++ b/src/data/Record.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/Request.js b/src/data/Request.js index ef02fd3f..5c72215d 100644 --- a/src/data/Request.js +++ b/src/data/Request.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/Response.js b/src/data/Response.js index 0c4e83a7..dbe23e43 100644 --- a/src/data/Response.js +++ b/src/data/Response.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/ScriptTagProxy.js b/src/data/ScriptTagProxy.js index aa623a97..0c33fefb 100644 --- a/src/data/ScriptTagProxy.js +++ b/src/data/ScriptTagProxy.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/SortTypes.js b/src/data/SortTypes.js index 508b171f..c3e97a85 100644 --- a/src/data/SortTypes.js +++ b/src/data/SortTypes.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/Store.js b/src/data/Store.js index afd25303..552db7bf 100644 --- a/src/data/Store.js +++ b/src/data/Store.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -659,6 +659,7 @@ sortInfo: { Ext.each(record, function(r){ this.remove(r); }, this); + return; } var index = this.data.indexOf(record); if(index > -1){ @@ -1364,6 +1365,7 @@ myStore.reload(lastOptions); }, /** + * @private * Creates and returns a function which sorts an array by the given field and direction * @param {String} field The field to create the sorter for * @param {String} direction The direction to sort by (defaults to "ASC") @@ -1570,6 +1572,7 @@ myStore.reload(lastOptions); }, /** + * @private * Given an array of filter functions (each with optional scope), constructs and returns a single function that returns * the result of all of the filters ANDed together * @param {Array} filters The array of filter objects (each object should contain an 'fn' and optional scope) @@ -1597,6 +1600,7 @@ myStore.reload(lastOptions); * Single filter example: * store.filter('name', 'Ed', true, true); //finds all records containing the substring 'Ed' * Multiple filter example: + *
    
          * store.filter([
          *   {
          *     property     : 'name',
    @@ -1613,6 +1617,7 @@ myStore.reload(lastOptions);
          *     scope: this
          *   }
          * ]);
    +     * 
    * @param {String|Array} field A field on your records, or an array containing multiple filter options * @param {String/RegExp} value Either a string that the field should begin with, or a RegExp to test * against the field. diff --git a/src/data/StoreMgr.js b/src/data/StoreMgr.js index f8ef1e9f..e1689ed8 100644 --- a/src/data/StoreMgr.js +++ b/src/data/StoreMgr.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/Tree.js b/src/data/Tree.js index 3740962b..12923d3e 100644 --- a/src/data/Tree.js +++ b/src/data/Tree.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/Types.js b/src/data/Types.js index 8a2a8f2b..e609991a 100644 --- a/src/data/Types.js +++ b/src/data/Types.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/XmlReader.js b/src/data/XmlReader.js index 085a5759..4d1fec2a 100644 --- a/src/data/XmlReader.js +++ b/src/data/XmlReader.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/XmlStore.js b/src/data/XmlStore.js index fa2ad5db..35d3b551 100644 --- a/src/data/XmlStore.js +++ b/src/data/XmlStore.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/data/XmlWriter.js b/src/data/XmlWriter.js index c26b504b..02e5913f 100644 --- a/src/data/XmlWriter.js +++ b/src/data/XmlWriter.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/dd/DDCore.js b/src/dd/DDCore.js index c3965430..2fb3ee22 100644 --- a/src/dd/DDCore.js +++ b/src/dd/DDCore.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -1179,7 +1179,7 @@ Ext.dd.DragDrop.prototype = { }; })(); -/*! +/* * The drag and drop utility provides a framework for building drag and drop * applications. In addition to enabling drag and drop for specific elements, * the drag and drop elements are tracked by the manager class, and the diff --git a/src/dd/DragSource.js b/src/dd/DragSource.js index 6d329f76..1c774544 100644 --- a/src/dd/DragSource.js +++ b/src/dd/DragSource.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/dd/DragTracker.js b/src/dd/DragTracker.js index ac8da741..9b159a6c 100644 --- a/src/dd/DragTracker.js +++ b/src/dd/DragTracker.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/dd/DragZone.js b/src/dd/DragZone.js index 99e82dfe..cc10a48d 100644 --- a/src/dd/DragZone.js +++ b/src/dd/DragZone.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/dd/DropTarget.js b/src/dd/DropTarget.js index 9f5ad583..c1fddfc1 100644 --- a/src/dd/DropTarget.js +++ b/src/dd/DropTarget.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/dd/DropZone.js b/src/dd/DropZone.js index e03497c2..6b5d29fd 100644 --- a/src/dd/DropZone.js +++ b/src/dd/DropZone.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/dd/Registry.js b/src/dd/Registry.js index f3d9c7f3..90ac3f15 100644 --- a/src/dd/Registry.js +++ b/src/dd/Registry.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/dd/ScrollManager.js b/src/dd/ScrollManager.js index 8a8ebe87..00f2fa92 100644 --- a/src/dd/ScrollManager.js +++ b/src/dd/ScrollManager.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/dd/StatusProxy.js b/src/dd/StatusProxy.js index efacd11d..2fbfa306 100644 --- a/src/dd/StatusProxy.js +++ b/src/dd/StatusProxy.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/debug.js b/src/debug.js index 03db1aba..f8455479 100644 --- a/src/debug.js +++ b/src/debug.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/direct/Direct.js b/src/direct/Direct.js index 0772f726..2a276908 100644 --- a/src/direct/Direct.js +++ b/src/direct/Direct.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/direct/Event.js b/src/direct/Event.js index 80e020e4..c5ed6334 100644 --- a/src/direct/Event.js +++ b/src/direct/Event.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/direct/JsonProvider.js b/src/direct/JsonProvider.js index 3f1540af..270c2c66 100644 --- a/src/direct/JsonProvider.js +++ b/src/direct/JsonProvider.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/direct/PollingProvider.js b/src/direct/PollingProvider.js index 04f74055..8a757e64 100644 --- a/src/direct/PollingProvider.js +++ b/src/direct/PollingProvider.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/direct/Provider.js b/src/direct/Provider.js index 9d8a181c..ecbe9256 100644 --- a/src/direct/Provider.js +++ b/src/direct/Provider.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/direct/RemotingProvider.js b/src/direct/RemotingProvider.js index acc481c9..9c61b52e 100644 --- a/src/direct/RemotingProvider.js +++ b/src/direct/RemotingProvider.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/direct/Transaction.js b/src/direct/Transaction.js index f9c02a87..3817ebb8 100644 --- a/src/direct/Transaction.js +++ b/src/direct/Transaction.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/ext-core/examples/carousel/carousel.js b/src/ext-core/examples/carousel/carousel.js index fff6e4fe..612c459a 100644 --- a/src/ext-core/examples/carousel/carousel.js +++ b/src/ext-core/examples/carousel/carousel.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/ext-core/examples/jsonp/jsonp.js b/src/ext-core/examples/jsonp/jsonp.js index 6aa6f586..56515c19 100644 --- a/src/ext-core/examples/jsonp/jsonp.js +++ b/src/ext-core/examples/jsonp/jsonp.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/ext-core/examples/lightbox/lightbox.js b/src/ext-core/examples/lightbox/lightbox.js index 86fab2c4..9b3b3f67 100644 --- a/src/ext-core/examples/lightbox/lightbox.js +++ b/src/ext-core/examples/lightbox/lightbox.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/ext-core/examples/menu/menu.js b/src/ext-core/examples/menu/menu.js index 120879c4..b662efd9 100644 --- a/src/ext-core/examples/menu/menu.js +++ b/src/ext-core/examples/menu/menu.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/ext-core/examples/rating/rating.js b/src/ext-core/examples/rating/rating.js index 49e7051a..3b1dff74 100644 --- a/src/ext-core/examples/rating/rating.js +++ b/src/ext-core/examples/rating/rating.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/ext-core/examples/tabs/tabs.js b/src/ext-core/examples/tabs/tabs.js index 606023cd..90854e4c 100644 --- a/src/ext-core/examples/tabs/tabs.js +++ b/src/ext-core/examples/tabs/tabs.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/ext-core/src/adapter/ext-base-ajax.js b/src/ext-core/src/adapter/ext-base-ajax.js index b12db970..a584570e 100644 --- a/src/ext-core/src/adapter/ext-base-ajax.js +++ b/src/ext-core/src/adapter/ext-base-ajax.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/ext-core/src/adapter/ext-base-anim-extra.js b/src/ext-core/src/adapter/ext-base-anim-extra.js index 2fc704b6..179d55f6 100644 --- a/src/ext-core/src/adapter/ext-base-anim-extra.js +++ b/src/ext-core/src/adapter/ext-base-anim-extra.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/ext-core/src/adapter/ext-base-anim.js b/src/ext-core/src/adapter/ext-base-anim.js index fa29919f..226b5491 100644 --- a/src/ext-core/src/adapter/ext-base-anim.js +++ b/src/ext-core/src/adapter/ext-base-anim.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/ext-core/src/adapter/ext-base-begin.js b/src/ext-core/src/adapter/ext-base-begin.js index 9c5b5008..aa346e6c 100644 --- a/src/ext-core/src/adapter/ext-base-begin.js +++ b/src/ext-core/src/adapter/ext-base-begin.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/ext-core/src/adapter/ext-base-dom.js b/src/ext-core/src/adapter/ext-base-dom.js index 15397e4b..50ad9a0a 100644 --- a/src/ext-core/src/adapter/ext-base-dom.js +++ b/src/ext-core/src/adapter/ext-base-dom.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/ext-core/src/adapter/ext-base-end.js b/src/ext-core/src/adapter/ext-base-end.js index 5ffe62c1..5883506f 100644 --- a/src/ext-core/src/adapter/ext-base-end.js +++ b/src/ext-core/src/adapter/ext-base-end.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/ext-core/src/adapter/ext-base-event.js b/src/ext-core/src/adapter/ext-base-event.js index 8062ae86..12c9cf2b 100644 --- a/src/ext-core/src/adapter/ext-base-event.js +++ b/src/ext-core/src/adapter/ext-base-event.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -99,20 +99,22 @@ Ext.lib.Event = function() { function _tryPreloadAttach() { var ret = false, notAvail = [], - element, i, len, v, + element, i, v, override, tryAgain = !loadComplete || (retryCount > 0); - if (!locked) { + if(!locked){ locked = true; - - for (i = 0, len = onAvailStack.length; i < len; i++) { + + for(i = 0; i < onAvailStack.length; ++i){ v = onAvailStack[i]; if(v && (element = doc.getElementById(v.id))){ if(!v.checkReady || loadComplete || element.nextSibling || (doc && doc.body)) { - element = v.override ? (v.override === true ? v.obj : v.override) : element; + override = v.override; + element = override ? (override === true ? v.obj : override) : element; v.fn.call(element, v.obj); onAvailStack.remove(v); - } else { + --i; + }else{ notAvail.push(v); } } @@ -126,7 +128,6 @@ Ext.lib.Event = function() { clearInterval(_interval); _interval = null; } - ret = !(locked = false); } return ret; diff --git a/src/ext-core/src/adapter/ext-base-point.js b/src/ext-core/src/adapter/ext-base-point.js index 76838ad9..16c87b5b 100644 --- a/src/ext-core/src/adapter/ext-base-point.js +++ b/src/ext-core/src/adapter/ext-base-point.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/ext-core/src/adapter/ext-base-region.js b/src/ext-core/src/adapter/ext-base-region.js index 731e0446..cb99c70e 100644 --- a/src/ext-core/src/adapter/ext-base-region.js +++ b/src/ext-core/src/adapter/ext-base-region.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/ext-core/src/core/CompositeElementLite.js b/src/ext-core/src/core/CompositeElementLite.js index 65ba42a5..8c8707aa 100644 --- a/src/ext-core/src/core/CompositeElementLite.js +++ b/src/ext-core/src/core/CompositeElementLite.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -55,8 +55,8 @@ Ext.override(Ext.CompositeElementLite, { }; Ext.CompositeElementLite.prototype = { - isComposite: true, - + isComposite: true, + // private getElement : function(el){ // Set the shared flyweight dom property to the current element @@ -65,19 +65,19 @@ Ext.CompositeElementLite.prototype = { e.id = el.id; return e; }, - + // private transformElement : function(el){ return Ext.getDom(el); }, - + /** * Returns the number of elements in this Composite. * @return Number */ getCount : function(){ return this.elements.length; - }, + }, /** * Adds elements to this Composite object. * @param {Mixed} els Either an Array of DOM elements to add, or another Composite object who's elements should be added. @@ -89,27 +89,27 @@ Ext.CompositeElementLite.prototype = { if(!els){ return this; } - if(Ext.isString(els)){ + if(typeof els == "string"){ els = Ext.Element.selectorFunction(els, root); }else if(els.isComposite){ els = els.elements; }else if(!Ext.isIterable(els)){ els = [els]; } - + for(var i = 0, len = els.length; i < len; ++i){ elements.push(me.transformElement(els[i])); } return me; }, - + invoke : function(fn, args){ var me = this, els = me.elements, - len = els.length, - e, + len = els.length, + e, i; - + for(i = 0; i < len; i++) { e = els[i]; if(e){ @@ -139,7 +139,7 @@ Ext.CompositeElementLite.prototype = { var els = this.elements, len = els.length, i, e; - + for(i = 0; ithis reference) in which the function is executed. (defaults to the Element) * @return {CompositeElement} this */ - each : function(fn, scope){ + each : function(fn, scope){ var me = this, els = me.elements, len = els.length, i, e; - + for(i = 0; i used by Fx adjustWidth : function(width) { var me = this; - var isNum = Ext.isNumber(width); + var isNum = (typeof width == "number"); if(isNum && me.autoBoxAdjust && !me.isBorderBox()){ width -= (me.getBorderWidth("lr") + me.getPadding("lr")); } @@ -62,7 +64,7 @@ Ext.Element.addMethods(function(){ // private ==> used by Fx adjustHeight : function(height) { var me = this; - var isNum = Ext.isNumber(height); + var isNum = (typeof height == "number"); if(isNum && me.autoBoxAdjust && !me.isBorderBox()){ height -= (me.getBorderWidth("tb") + me.getPadding("tb")); } @@ -76,14 +78,60 @@ Ext.Element.addMethods(function(){ * @return {Ext.Element} this */ addClass : function(className){ - var me = this, i, len, v; - className = Ext.isArray(className) ? className : [className]; - for (i=0, len = className.length; i < len; i++) { - v = className[i]; - if (v) { - me.dom.className += (!me.hasClass(v) && v ? " " + v : ""); - }; - }; + var me = this, + i, + len, + v, + cls = []; + // Separate case is for speed + if (!Ext.isArray(className)) { + if (typeof className == 'string' && !this.hasClass(className)) { + me.dom.className += " " + className; + } + } + else { + for (i = 0, len = className.length; i < len; i++) { + v = className[i]; + if (typeof v == 'string' && (' ' + me.dom.className + ' ').indexOf(' ' + v + ' ') == -1) { + cls.push(v); + } + } + if (cls.length) { + me.dom.className += " " + cls.join(" "); + } + } + return me; + }, + + /** + * Removes one or more CSS classes from the element. + * @param {String/Array} className The CSS class to remove, or an array of classes + * @return {Ext.Element} this + */ + removeClass : function(className){ + var me = this, + i, + idx, + len, + cls, + elClasses; + if (!Ext.isArray(className)){ + className = [className]; + } + if (me.dom && me.dom.className) { + elClasses = me.dom.className.replace(trimRe, '').split(spacesRe); + for (i = 0, len = className.length; i < len; i++) { + cls = className[i]; + if (typeof cls == 'string') { + cls = cls.replace(trimRe, ''); + idx = elClasses.indexOf(cls); + if (idx != -1) { + elClasses.splice(idx, 1); + } + } + } + me.dom.className = elClasses.join(" "); + } return me; }, @@ -93,38 +141,20 @@ Ext.Element.addMethods(function(){ * @return {Ext.Element} this */ radioClass : function(className){ - var cn = this.dom.parentNode.childNodes, v; + var cn = this.dom.parentNode.childNodes, + v, + i, + len; className = Ext.isArray(className) ? className : [className]; - for (var i=0, len = cn.length; i < len; i++) { + for (i = 0, len = cn.length; i < len; i++) { v = cn[i]; - if(v && v.nodeType == 1) { + if (v && v.nodeType == 1) { Ext.fly(v, '_internal').removeClass(className); } }; return this.addClass(className); }, - /** - * Removes one or more CSS classes from the element. - * @param {String/Array} className The CSS class to remove, or an array of classes - * @return {Ext.Element} this - */ - removeClass : function(className){ - var me = this, v; - className = Ext.isArray(className) ? className : [className]; - if (me.dom && me.dom.className) { - for (var i=0, len=className.length; i < len; i++) { - v = className[i]; - if(v) { - me.dom.className = me.dom.className.replace( - classReCache[v] = classReCache[v] || new RegExp('(?:^|\\s+)' + v + '(?:\\s+|$)', "g"), " " - ); - } - }; - } - return me; - }, - /** * Toggles the specified CSS class on this element (removes it if it already exists, otherwise adds it). * @param {String} className The CSS class to toggle @@ -172,7 +202,7 @@ Ext.Element.addMethods(function(){ display, wk = Ext.isWebKit, display; - + if(el == document){ return null; } @@ -227,7 +257,7 @@ Ext.Element.addMethods(function(){ */ getColor : function(attr, defaultValue, prefix){ var v = this.getStyle(attr), - color = Ext.isDefined(prefix) ? prefix : '#', + color = (typeof prefix != 'undefined') ? prefix : '#', h; if(!v || /transparent|inherit/.test(v)){ @@ -255,7 +285,7 @@ Ext.Element.addMethods(function(){ var tmp, style, camel; - if (!Ext.isObject(prop)) { + if (typeof prop != 'object') { tmp = {}; tmp[prop] = value; prop = tmp; @@ -456,16 +486,20 @@ Ext.fly('elId').setHeight(150, { // private addStyles : function(sides, styles){ - var val = 0, - m = sides.match(/\w/g), - s; - for (var i=0, len=m.length; iSee {@link Ext.Element#addListener} for examples of how to use these options.

    */ addListener : function(element, eventName, fn, scope, options){ - if(Ext.isObject(eventName)){ + if(typeof eventName == 'object'){ var o = eventName, e, val; for(e in o){ val = o[e]; @@ -516,7 +516,7 @@ Ext.EventManager = function(){ conn, tid, ajax = Ext.lib.Ajax; - (Ext.isObject(ajax.conn)) ? conn = ajax.conn : conn = {}; + (typeof ajax.conn == 'object') ? conn = ajax.conn : conn = {}; for (tid in conn) { c = conn[tid]; if (c) { diff --git a/src/ext-core/src/core/Ext.js b/src/ext-core/src/core/Ext.js index d07ecef7..802f2775 100644 --- a/src/ext-core/src/core/Ext.js +++ b/src/ext-core/src/core/Ext.js @@ -1,10 +1,9 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ - // for old browsers window.undefined = window.undefined; @@ -19,7 +18,12 @@ Ext = { * The version of the framework * @type String */ - version : '3.2.0' + version : '3.2.1', + versionDetail : { + major: 3, + minor: 2, + patch: 1 + } }; /** @@ -227,7 +231,7 @@ MyGridPanel = Ext.extend(Ext.grid.GridPanel, { var oc = Object.prototype.constructor; return function(sb, sp, overrides){ - if(Ext.isObject(sp)){ + if(typeof sp == 'object'){ overrides = sp; sp = sb; sb = overrides.constructor != oc ? overrides.constructor : function(){sp.apply(this, arguments);}; @@ -475,7 +479,7 @@ Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {foo: "1", bar: ["2" if(Ext.isIterable(obj)){ Ext.each(obj, fn, scope); return; - }else if(Ext.isObject(obj)){ + }else if(typeof obj == 'object'){ for(var prop in obj){ if(obj.hasOwnProperty(prop)){ if(fn.call(scope || obj, prop, obj[prop], obj) === false){ @@ -516,7 +520,7 @@ function(el){ if (el.dom){ return el.dom; } else { - if (Ext.isString(el)) { + if (typeof el == 'string') { var e = DOC.getElementById(el); // IE returns elements with the 'name' and 'id' attribute. // we do a strict check to return the element with only the id attribute diff --git a/src/ext-core/src/core/Fx.js b/src/ext-core/src/core/Fx.js index 0ae581c4..f2ce177b 100644 --- a/src/ext-core/src/core/Fx.js +++ b/src/ext-core/src/core/Fx.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license diff --git a/src/ext-core/src/core/Loader.js b/src/ext-core/src/core/Loader.js new file mode 100644 index 00000000..b22d89d8 --- /dev/null +++ b/src/ext-core/src/core/Loader.js @@ -0,0 +1,96 @@ +/*! + * Ext JS Library 3.2.1 + * Copyright(c) 2006-2010 Ext JS, Inc. + * licensing@extjs.com + * http://www.extjs.com/license + */ +/** + * @class Ext.Loader + * @singleton + * Simple class to help load JavaScript files on demand + */ +Ext.Loader = Ext.apply({}, { + /** + * Loads a given set of .js files. Calls the callback function when all files have been loaded + * Set preserveOrder to true to ensure non-parallel loading of files if load order is important + * @param {Array} fileList Array of all files to load + * @param {Function} callback Callback to call after all files have been loaded + * @param {Object} scope The scope to call the callback in + * @param {Boolean} preserveOrder True to make files load in serial, one after the other (defaults to false) + */ + load: function(fileList, callback, scope, preserveOrder) { + var scope = scope || this, + head = document.getElementsByTagName("head")[0], + fragment = document.createDocumentFragment(), + numFiles = fileList.length, + loadedFiles = 0, + me = this; + + /** + * Loads a particular file from the fileList by index. This is used when preserving order + */ + var loadFileIndex = function(index) { + head.appendChild( + me.buildScriptTag(fileList[index], onFileLoaded) + ); + }; + + /** + * Callback function which is called after each file has been loaded. This calls the callback + * passed to load once the final file in the fileList has been loaded + */ + var onFileLoaded = function() { + loadedFiles ++; + + //if this was the last file, call the callback, otherwise load the next file + if (numFiles == loadedFiles && typeof callback == 'function') { + callback.call(scope); + } else { + if (preserveOrder === true) { + loadFileIndex(loadedFiles); + } + } + }; + + if (preserveOrder === true) { + loadFileIndex.call(this, 0); + } else { + //load each file (most browsers will do this in parallel) + Ext.each(fileList, function(file, index) { + fragment.appendChild( + this.buildScriptTag(file, onFileLoaded) + ); + }, this); + + head.appendChild(fragment); + } + }, + + /** + * @private + * Creates and returns a script tag, but does not place it into the document. If a callback function + * is passed, this is called when the script has been loaded + * @param {String} filename The name of the file to create a script tag for + * @param {Function} callback Optional callback, which is called when the script has been loaded + * @return {Element} The new script ta + */ + buildScriptTag: function(filename, callback) { + var script = document.createElement('script'); + script.type = "text/javascript"; + script.src = filename; + + //IE has a different way of handling