X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6e39d509471fe9b4e2660e0d1631b350d0c66f40..refs/tags/3.1.1:/pkgs/ext-foundation-debug.js diff --git a/pkgs/ext-foundation-debug.js b/pkgs/ext-foundation-debug.js index 687eb3d6..50932113 100644 --- a/pkgs/ext-foundation-debug.js +++ b/pkgs/ext-foundation-debug.js @@ -1,6 +1,6 @@ /*! - * Ext JS Library 3.1.0 - * Copyright(c) 2006-2009 Ext JS, LLC + * Ext JS Library 3.1.1 + * Copyright(c) 2006-2010 Ext JS, LLC * licensing@extjs.com * http://www.extjs.com/license */ @@ -976,6 +976,7 @@ All selectors, attribute filters and pseudos below can be combined infinitely in
this
reference) in which the handler function executes. Defaults to the browser window.
@@ -3356,11 +3464,7 @@ Ext.apply(Ext.EventManager, function(){
// exposed only to allow manual firing
fireWindowResize : function(){
if(resizeEvent){
- if((Ext.isIE||Ext.isAir) && resizeTask){
- resizeTask.delay(50);
- }else{
- resizeEvent.fire(D.getViewWidth(), D.getViewHeight());
- }
+ resizeTask.delay(100);
}
},
@@ -4453,7 +4557,7 @@ El.get = function(el){
};
El.addToCache = function(el, id){
- id = id || el.id;
+ id = id || el.id;
EC[id] = {
el: el,
data: {},
@@ -4607,11 +4711,6 @@ if(Ext.isIE || Ext.isGecko){
noBoxAdjust['button'] = 1;
}
-
-Ext.EventManager.on(window, 'unload', function(){
- delete EC;
- delete El._flyweights;
-});
})();
/**
* @class Ext.Element
@@ -6051,7 +6150,7 @@ Ext.Element.boxMarkup = '{width: <element width>, height: <element height>}
- */
- getViewSize : function(contentBox){
+ *
+ *
+ * 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,
- me = this,
- d = me.dom,
- extdom = Ext.lib.Dom,
- isDoc = (d == doc || d == doc.body),
- isBB, w, h, tbBorder = 0, lrBorder = 0,
- tbPadding = 0, lrPadding = 0;
+ d = this.dom,
+ isDoc = (d == doc || d == doc.body);
+
+ // If the body, use Ext.lib.Dom
if (isDoc) {
- return { width: extdom.getViewWidth(), height: extdom.getViewHeight() };
- }
- isBB = me.isBorderBox();
- tbBorder = me.getBorderWidth('tb');
- lrBorder = me.getBorderWidth('lr');
- tbPadding = me.getPadding('tb');
- lrPadding = me.getPadding('lr');
-
- // Width calcs
- // Try the style first, then clientWidth, then offsetWidth
- if (w = me.getStyle('width').match(pxMatch)){
- if ((w = parseInt(w[1], 10)) && isBB){
- // Style includes the padding and border if isBB
- w -= (lrBorder + lrPadding);
- }
- if (!contentBox){
- w += lrPadding;
+ var extdom = Ext.lib.Dom;
+ return {
+ width : extdom.getViewWidth(),
+ height : extdom.getViewHeight()
}
+
+ // Else use clientHeight/clientWidth
} else {
- if (!(w = d.clientWidth) && (w = d.offsetWidth)){
- w -= lrBorder;
- }
- if (w && contentBox){
- w -= lrPadding;
+ return {
+ width : d.clientWidth,
+ height : d.clientHeight
}
}
+ },
- // Height calcs
- // Try the style first, then clientHeight, then offsetHeight
- if (h = me.getStyle('height').match(pxMatch)){
- if ((h = parseInt(h[1], 10)) && isBB){
- // Style includes the padding and border if isBB
- h -= (tbBorder + tbPadding);
- }
- if (!contentBox){
- h += tbPadding;
+ /**
+ * 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,
+ w, h,
+ doc = document,
+ d = this.dom,
+ isDoc = (d == doc || d == doc.body),
+ s = d.style;
+
+ // If the body, use Ext.lib.Dom
+ if (isDoc) {
+ var extdom = Ext.lib.Dom;
+ return {
+ width : extdom.getViewWidth(),
+ height : extdom.getViewHeight()
}
- } else {
- if (!(h = d.clientHeight) && (h = d.offsetHeight)){
- h -= tbBorder;
+ }
+ // Use Styles if they are set
+ if(s.width && s.width != 'auto'){
+ w = parseFloat(s.width);
+ if(me.isBorderBox()){
+ w -= me.getFrameWidth('lr');
}
- if (h && contentBox){
- h -= tbPadding;
+ }
+ // Use Styles if they are set
+ if(s.height && s.height != 'auto'){
+ h = parseFloat(s.height);
+ if(me.isBorderBox()){
+ h -= me.getFrameWidth('tb');
}
}
-
- return {
- width : w,
- height : h
- };
+ // Use getWidth/getHeight if style not set.
+ return {width: w || me.getWidth(true), height: h || me.getHeight(true)};
},
/**
@@ -6402,7 +6486,7 @@ Ext.Element.addMethods(function(){
if (!side) {
for (key in me.margins){
- o[hash[key]] = parseInt(me.getStyle(me.margins[key]), 10) || 0;
+ o[hash[key]] = parseFloat(me.getStyle(me.margins[key])) || 0;
}
return o;
} else {
@@ -7359,7 +7443,7 @@ function(){
XMASKED = "x-masked",
XMASKEDRELATIVE = "x-masked-relative",
data = Ext.Element.data;
-
+
return {
/**
* Checks whether the element is currently visible using both visibility and display properties.
@@ -7371,8 +7455,8 @@ function(){
p = this.dom.parentNode;
if(deep !== true || !vis){
return vis;
- }
- while(p && !/body/i.test(p.tagName)){
+ }
+ while(p && !/^body/i.test(p.tagName)){
if(!Ext.fly(p, '_isVisible').isVisible()){
return false;
}
@@ -7380,7 +7464,7 @@ function(){
}
return true;
},
-
+
/**
* Returns true if display is not "none"
* @return {Boolean}
@@ -7388,20 +7472,20 @@ function(){
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){
+ enableDisplayMode : function(display){
this.setVisibilityMode(Ext.Element.DISPLAY);
if(!Ext.isEmpty(display)){
data(this.dom, 'originalDisplay', display);
}
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.
@@ -7414,9 +7498,9 @@ function(){
dom = me.dom,
dh = Ext.DomHelper,
EXTELMASKMSG = "ext-el-mask-msg",
- el,
+ el,
mask;
-
+
if(me.getStyle("position") == "static"){
me.addClass(XMASKEDRELATIVE);
}
@@ -7426,10 +7510,10 @@ function(){
if((el = data(dom, 'mask'))){
el.remove();
}
-
+
mask = dh.append(dom, {cls : "ext-el-mask"}, true);
data(dom, 'mask', mask);
-
+
me.addClass(XMASKED);
mask.setDisplayed(true);
if(typeof msg == 'string'){
@@ -7445,7 +7529,7 @@ function(){
}
return mask;
},
-
+
/**
* Removes a previously applied mask.
*/
@@ -7464,7 +7548,7 @@ function(){
}
me.removeClass([XMASKED, XMASKEDRELATIVE]);
},
-
+
/**
* Returns true if this element is masked
* @return {Boolean}
@@ -7473,14 +7557,14 @@ 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'),
+ var el = document.createElement('iframe'),
shim;
el.frameBorder = '0';
el.className = 'ext-shim';
@@ -8740,9 +8824,10 @@ Ext.CompositeElementLite.prototype = {
var me = this,
els = me.elements,
len = els.length,
- e;
+ e,
+ i;
- for(i = 0; i
Important: Ajax server requests are asynchronous, and this call will @@ -9275,8 +9360,8 @@ Ext.Ajax.request({ * parameters:
True if the form object is a file upload (will be set automatically if the form was * configured with enctype "multipart/form-data").
@@ -9343,15 +9428,15 @@ Ext.Ajax.request({ me.indicatorText = 'Common Events you may want to set are:
An example request:
*
@@ -9605,7 +9697,7 @@ Ext.Ajax.{@link Ext.data.Connection#request request}({
form: 'some-form',
params: 'foo=bar'
});
- *
+ *
*
* @singleton
*/
@@ -10826,15 +10918,15 @@ dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null
"dt = (new Date()).clearTime();",
// date calculations (note: these calculations create a dependency on Ext.num())
- "y = y >= 0? y : Ext.num(def.y, dt.getFullYear());",
- "m = m >= 0? m : Ext.num(def.m - 1, dt.getMonth());",
- "d = d >= 0? d : Ext.num(def.d, dt.getDate());",
+ "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 = h || Ext.num(def.h, dt.getHours());",
- "i = i || Ext.num(def.i, dt.getMinutes());",
- "s = s || Ext.num(def.s, dt.getSeconds());",
- "ms = ms || Ext.num(def.ms, dt.getMilliseconds());",
+ "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.
@@ -12235,6 +12327,18 @@ 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) + "-" +