X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6e39d509471fe9b4e2660e0d1631b350d0c66f40..b37ceabb82336ee82757cd32efe353cfab8ec267:/adapter/jquery/ext-jquery-adapter-debug.js diff --git a/adapter/jquery/ext-jquery-adapter-debug.js b/adapter/jquery/ext-jquery-adapter-debug.js index 21f97546..d96988cc 100644 --- a/adapter/jquery/ext-jquery-adapter-debug.js +++ b/adapter/jquery/ext-jquery-adapter-debug.js @@ -1,10 +1,9 @@ /*! - * Ext JS Library 3.1.0 - * Copyright(c) 2006-2009 Ext JS, LLC + * Ext JS Library 3.2.2 + * 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.1.0' + version : '3.2.2', + versionDetail : { + major: 3, + minor: 2, + patch: 2 + } }; /** @@ -53,7 +57,7 @@ Ext.apply = function(o, c, defaults){ DOC = document, isStrict = DOC.compatMode == "CSS1Compat", isOpera = check(/opera/), - isChrome = check(/chrome/), + isChrome = check(/\bchrome\b/), isWebKit = check(/webkit/), isSafari = !isChrome && check(/safari/), isSafari2 = isSafari && check(/applewebkit\/4/), // unique to Safari 2 @@ -161,7 +165,11 @@ Ext.apply = function(o, c, defaults){ * @return {String} The generated Id. */ id : function(el, prefix){ - return (el = Ext.getDom(el) || {}).id = el.id || (prefix || "ext-gen") + (++idSeed); + el = Ext.getDom(el, true) || {}; + if (!el.id) { + el.id = (prefix || "ext-gen") + (++idSeed); + } + return el.id; }, /** @@ -223,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);}; @@ -390,7 +398,7 @@ Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {foo: "1", bar: ["2" } : function(a, i, j){ return Array.prototype.slice.call(a, i || 0, j || a.length); - } + }; }(), isIterable : function(v){ @@ -404,7 +412,7 @@ Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {foo: "1", bar: ["2" } //NodeList has an item and length property //IXMLDOMNodeList has nextNode method, needs to be checked first. - return ((v.nextNode || v.item) && Ext.isNumber(v.length)); + return ((typeof v.nextNode != 'undefined' || v.item) && Ext.isNumber(v.length)); }, /** @@ -471,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){ @@ -484,6 +492,8 @@ 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
@@ -503,11 +513,29 @@ function(el){
          * @param {Mixed} el
          * @return HTMLElement
          */
-        getDom : function(el){
+        getDom : function(el, strict){
             if(!el || !DOC){
                 return null;
             }
-            return el.dom ? el.dom : (Ext.isString(el) ? DOC.getElementById(el) : el);
+            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;
+                }
+            }
         },
 
         /**
@@ -517,6 +545,22 @@ function(el){
         getBody : function(){
             return Ext.get(DOC.body || DOC.documentElement);
         },
+        
+        /**
+         * Returns the current document body as an {@link Ext.Element}.
+         * @return Ext.Element The document body
+         */
+        getHead : function() {
+            var head;
+            
+            return function() {
+                if (head == undefined) {
+                    head = Ext.get(DOC.getElementsByTagName("head")[0]);
+                }
+                
+                return head;
+            };
+        }(),
 
         /**
          * Removes a DOM node from the document.
@@ -538,7 +582,7 @@ function(el){
                     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);
@@ -641,7 +685,7 @@ function(el){
          * @return {Boolean}
          */
         isElement : function(v) {
-            return !!v && v.tagName;
+            return v ? !!v.tagName : false;
         },
 
         /**
@@ -1009,7 +1053,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;
 
@@ -1022,13 +1066,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){
@@ -1050,7 +1094,7 @@ Ext.apply(Ext, function(){
          * @return {Number} Value, if numeric, else defaultValue
          */
         num : function(v, defaultValue){
-            v = Number(Ext.isEmpty(v) || Ext.isBoolean(v) ? 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;
         },
 
@@ -1093,13 +1137,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){ @@ -1124,7 +1168,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. @@ -1135,7 +1179,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('
'), @@ -1177,15 +1221,15 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { this.initialBox = Ext.copyTo({}, this.initialConfig, 'x,y,width,height'); } }); - * - * @param {Object} The destination object. - * @param {Object} The source object. - * @param {Array/String} Either an Array of property names, or a comma-delimited list + * + * @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){ @@ -1211,11 +1255,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); }, @@ -1324,7 +1368,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, { * @return {Number} The mean. */ mean : function(arr){ - return Ext.sum(arr) / arr.length; + return arr.length > 0 ? Ext.sum(arr) / arr.length : undefined; }, /** @@ -1342,8 +1386,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]]
@@ -1380,14 +1424,14 @@ Ext.invoke(Ext.query("p"), "getAttribute", "id");
          * 
* @param {Array|NodeList} arr The Array of items to invoke the method on. * @param {String} methodName The method name to invoke. - * @param {Anything} ... Arguments to send into the method invocation. + * @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); @@ -1434,7 +1478,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")), @@ -1511,7 +1555,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'; } } @@ -1524,7 +1568,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{ @@ -1564,7 +1608,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); @@ -1704,6 +1748,7 @@ Ext.TaskMgr.start({ }); * + *

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

* Also see {@link Ext.util.DelayedTask}. * * @constructor @@ -1775,21 +1820,25 @@ Ext.util.TaskRunner = function(interval){ /** * Starts a new task. * @method start - * @param {Object} task A config object that supports the following properties:

+ *

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){ @@ -1843,6 +1892,7 @@ var task = { } 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();if(typeof jQuery == "undefined"){ @@ -1865,7 +1915,7 @@ Ext.lib.Dom = { isAncestor : function(p, c){ var ret = false; - + p = Ext.getDom(p); c = Ext.getDom(c); if (p && c) { @@ -1875,10 +1925,10 @@ Ext.lib.Dom = { return !!(p.compareDocumentPosition(c) & 16); } else { while (c = c.parentNode) { - ret = c == p || ret; + ret = c == p || ret; } - } - } + } + } return ret; }, @@ -2106,15 +2156,15 @@ Ext.lib.Ajax = function(){ } }; }; - + var createResponse = function(cb, xhr){ var headerObj = {}, - headerStr, + headerStr, t, s; try { - headerStr = xhr.getAllResponseHeaders(); + headerStr = xhr.getAllResponseHeaders(); Ext.each(headerStr.replace(/\r\n/g, '\n').split('\n'), function(v){ t = v.indexOf(':'); if(t >= 0){ @@ -2126,7 +2176,7 @@ Ext.lib.Ajax = function(){ } }); } catch(e) {} - + return { responseText: xhr.responseText, responseXML : xhr.responseXML, @@ -2296,9 +2346,10 @@ Ext.lib.Anim = function(){ if (args.top.from) e.setTop(args.top.from); break; + // jQuery can't handle callback, scope, and xy arguments, so break here case 'callback': case 'scope': - // jQuery can't handle callback and scope arguments, so break here + case 'xy': break; default: