Alien-Web-ExtJS-V3
view release on metacpan or search on metacpan
share/ext-all-debug-w-comments.js view on Meta::CPAN
$f("O", 8).c, // timezone offset without colon separator
"}",
"}"
].join('\n')}
];
for (var i = 0, l = arr.length; i < l; ++i) {
calc.push(arr[i].c);
}
return {
g:1,
c:calc.join(""),
s:[
arr[0].s, // year (required)
"(?:", "-", arr[1].s, // month (optional)
"(?:", "-", arr[2].s, // day (optional)
"(?:",
"(?: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)
")?",
")?",
")?"
].join("")
};
},
U: {
g:1,
c:"u = parseInt(results[{0}], 10);\n",
s:"(-?\\d+)" // leading minus sign indicates seconds before UNIX epoch
}
}
});
}());
Ext.apply(Date.prototype, {
// private
dateFormat : function(format) {
if (Date.formatFunctions[format] == null) {
Date.createFormat(format);
}
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")
+ (colon ? ":" : "")
+ 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(),
m = this.getMonth(),
i;
for (i = 0, d.setDate(1), d.setMonth(0); i < m; d.setMonth(++i)) {
num += d.getDaysInMonth();
}
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
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
Wyr = new Date(AWN * ms7d).getUTCFullYear();
return AWN - Math.floor(Date.UTC(Wyr, 0, 7) / ms7d) + 1;
};
}(),
share/ext-all-debug-w-comments.js view on Meta::CPAN
};
Ext.ColorPalette.superclass.onRender.call(this, container, position);
var t = this.tpl || new Ext.XTemplate(
'<tpl for="."><a href="#" class="color-{.}" hidefocus="on"><em><span style="background:#{.}" class="x-unselectable" unselectable="on"> </span></em></a></tpl>'
);
t.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});
}
},
// private
afterRender : function(){
Ext.ColorPalette.superclass.afterRender.call(this);
if(this.value){
var s = this.value;
this.value = null;
this.select(s, true);
}
},
// private
handleClick : function(e, t){
e.preventDefault();
if(!this.disabled){
var c = t.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];
this.select(c.toUpperCase());
}
},
/**
* 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 <tt>false</tt>.
*/
select : function(color, suppressEvent){
color = color.replace('#', '');
if(color != this.value || this.allowReselect){
var el = this.el;
if(this.value){
el.child('a.color-'+this.value).removeClass('x-color-palette-sel');
}
el.child('a.color-'+color).addClass('x-color-palette-sel');
this.value = color;
if(suppressEvent !== true){
this.fireEvent('select', this, color);
}
}
}
/**
* @cfg {String} autoEl @hide
*/
});
Ext.reg('colorpalette', Ext.ColorPalette);/**
* @class Ext.DatePicker
* @extends Ext.Component
* <p>A popup date picker. This class is used by the {@link Ext.form.DateField DateField} class
* to allow browsing and selection of valid dates.</p>
* <p>All the string values documented below may be overridden by including an Ext locale file in
* your page.</p>
* @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 <code>'Today'</code>)
*/
todayText : 'Today',
/**
* @cfg {String} okText
* The text to display on the ok button (defaults to <code>' OK '</code> to give the user extra clicking room)
*/
okText : ' OK ',
/**
* @cfg {String} cancelText
* The text to display on the cancel button (defaults to <code>'Cancel'</code>)
*/
cancelText : 'Cancel',
/**
* @cfg {Function} handler
* Optional. A function that will handle the select event of this picker.
* The handler is passed the following parameters:<div class="mdetail-params"><ul>
* <li><code>picker</code> : DatePicker<div class="sub-desc">This DatePicker.</div></li>
* <li><code>date</code> : Date<div class="sub-desc">The selected date.</div></li>
* </ul></div>
*/
/**
* @cfg {Object} scope
* The scope (<code><b>this</b></code> reference) in which the <code>{@link #handler}</code>
* 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 <code>'{0} (Spacebar)'</code> where
* the <code>{0}</code> 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 <code>'This date is before the minimum date'</code>)
*/
minText : 'This date is before the minimum date',
/**
* @cfg {String} maxText
* The error text to display if the maxDate validation fails (defaults to <code>'This date is after the maximum date'</code>)
*/
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 <code>'m/d/y'</code>).
*/
format : 'm/d/y',
/**
* @cfg {String} disabledDaysText
share/ext-all-debug-w-comments.js view on Meta::CPAN
/**
* 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",
yes : "Yes",
no : "No"
}
};
}();
/**
* 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.dd.PanelProxy = Ext.extend(Object, {
constructor : function(panel, config){
this.panel = panel;
this.id = this.panel.id +'-ddproxy';
Ext.apply(this, config);
},
/**
* @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;
},
share/ext-all-debug-w-comments.js view on Meta::CPAN
*/
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 <tt>dataIndex</tt>.
*/
/**
* @cfg {String} dataIndex <p><b>Required</b>. 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.</p>
*/
constructor : function(c){
if(!c.tpl){
c.tpl = new Ext.XTemplate('{' + c.dataIndex + '}');
}
else if(Ext.isString(c.tpl)){
c.tpl = new Ext.XTemplate(c.tpl);
}
Ext.apply(this, c);
}
});
Ext.reg('lvcolumn', Ext.list.Column);
/**
* @class Ext.list.NumberColumn
* @extends Ext.list.Column
* <p>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.</p>
*/
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 <tt>'0,000.00'</tt>).
*/
format: '0,000.00',
constructor : function(c) {
c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':number("' + (c.format || this.format) + '")}');
Ext.list.NumberColumn.superclass.constructor.call(this, c);
}
});
Ext.reg('lvnumbercolumn', Ext.list.NumberColumn);
/**
* @class Ext.list.DateColumn
* @extends Ext.list.Column
* <p>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.</p>
*/
Ext.list.DateColumn = Ext.extend(Ext.list.Column, {
format: 'm/d/Y',
constructor : function(c) {
c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':date("' + (c.format || this.format) + '")}');
Ext.list.DateColumn.superclass.constructor.call(this, c);
}
});
Ext.reg('lvdatecolumn', Ext.list.DateColumn);
/**
* @class Ext.list.BooleanColumn
* @extends Ext.list.Column
* <p>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.</p>
*/
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 <tt>'true'</tt>).
*/
trueText: 'true',
/**
* @cfg {String} falseText
* The string returned by the renderer when the column value is falsey (but not undefined) (defaults to
* <tt>'false'</tt>).
*/
falseText: 'false',
/**
* @cfg {String} undefinedText
* The string returned by the renderer when the column value is undefined (defaults to <tt>' '</tt>).
*/
undefinedText: ' ',
constructor : function(c) {
c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':this.format}');
var t = this.trueText, f = this.falseText, u = this.undefinedText;
c.tpl.format = function(v){
if(v === undefined){
return u;
}
if(!v || v === 'false'){
return f;
}
return t;
};
Ext.list.DateColumn.superclass.constructor.call(this, c);
}
});
Ext.reg('lvbooleancolumn', Ext.list.BooleanColumn);/**
* @class Ext.list.ColumnResizer
* @extends Ext.util.Observable
* <p>Supporting Class for Ext.list.ListView</p>
* @constructor
* @param {Object} config
share/ext-all-debug-w-comments.js view on Meta::CPAN
* @class Ext.grid.BooleanColumn
* @extends Ext.grid.Column
* <p>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.</p>
*/
Ext.grid.BooleanColumn = Ext.extend(Ext.grid.Column, {
/**
* @cfg {String} trueText
* The string returned by the renderer when the column value is not falsy (defaults to <tt>'true'</tt>).
*/
trueText: 'true',
/**
* @cfg {String} falseText
* The string returned by the renderer when the column value is falsy (but not undefined) (defaults to
* <tt>'false'</tt>).
*/
falseText: 'false',
/**
* @cfg {String} undefinedText
* The string returned by the renderer when the column value is undefined (defaults to <tt>'&#160;'</tt>).
*/
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
* <p>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.</p>
*/
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 <tt>'0,000.00'</tt>).
*/
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
* <p>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.</p>
*/
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 <tt>'m/d/Y'</tt>).
*/
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
* <p>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.</p>
*/
Ext.grid.TemplateColumn = Ext.extend(Ext.grid.Column, {
/**
* @cfg {String/XTemplate} tpl
* An {@link Ext.XTemplate XTemplate}, or an XTemplate <i>definition string</i> 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;
}
});
/**
* @class Ext.grid.ActionColumn
* @extends Ext.grid.Column
* <p>A Grid column type which renders an icon, or a series of icons in a grid cell, and offers a scoped click
* handler for each icon. Example usage:</p>
<pre><code>
new Ext.grid.GridPanel({
store: myStore,
columns: [
{
xtype: 'actioncolumn',
width: 50,
items: [
{
icon : 'sell.gif', // Use a URL in the icon config
tooltip: 'Sell stock',
handler: function(grid, rowIndex, colIndex) {
var rec = store.getAt(rowIndex);
alert("Sell " + rec.get('company'));
}
share/ext-all-debug-w-comments.js view on Meta::CPAN
}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
( run in 0.866 second using v1.01-cache-2.11-cpan-ceb78f64989 )