summaryrefslogtreecommitdiffstats
path: root/deluge/ui/web
diff options
context:
space:
mode:
authorCalum Lind <calumlind@gmail.com>2018-10-08 13:02:16 +0100
committerCalum Lind <calumlind@gmail.com>2018-10-08 14:47:27 +0100
commitd5dea44689c703b88c638431c5a0e32d682dde96 (patch)
treee394abdab0e4f5e14bf2ac5f1ff4dcb64775a57c /deluge/ui/web
parent5743382c655811f08a51d6e14cf4f6afb21d3d6c (diff)
downloaddeluge-d5dea44689c703b88c638431c5a0e32d682dde96.tar.gz
deluge-d5dea44689c703b88c638431c5a0e32d682dde96.tar.bz2
deluge-d5dea44689c703b88c638431c5a0e32d682dde96.zip
[WebUI] Update extjs to 3.4.1.1
Better late than never... http://cdn.sencha.com/ext/commercial/3.4.1.1/release-notes.html
Diffstat (limited to 'deluge/ui/web')
-rw-r--r--deluge/ui/web/css/ext-all-notheme.css57
-rw-r--r--deluge/ui/web/js/extjs/ext-all-debug.js41410
-rw-r--r--deluge/ui/web/js/extjs/ext-all.js28
-rw-r--r--deluge/ui/web/js/extjs/ext-base-debug.js591
-rw-r--r--deluge/ui/web/js/extjs/ext-base.js26
5 files changed, 7946 insertions, 34166 deletions
diff --git a/deluge/ui/web/css/ext-all-notheme.css b/deluge/ui/web/css/ext-all-notheme.css
index d44038e47..40bac829e 100644
--- a/deluge/ui/web/css/ext-all-notheme.css
+++ b/deluge/ui/web/css/ext-all-notheme.css
@@ -1,9 +1,23 @@
-/*!
- * Ext JS Library 3.4.0
- * Copyright(c) 2006-2011 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
+/*
+This file is part of Ext JS 3.4
+
+Copyright (c) 2011-2013 Sencha Inc
+
+Contact: http://www.sencha.com/contact
+
+GNU General Public License Usage
+This file may be used under the terms of the GNU General Public License version 3.0 as
+published by the Free Software Foundation and appearing in the file LICENSE included in the
+packaging of this file.
+
+Please review the following information to ensure the GNU General Public License version 3.0
+requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+
+If you are unsure which license is appropriate for your use, please contact the sales department
+at http://www.sencha.com/contact.
+
+Build date: 2013-04-03 15:07:25
+*/
html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}img,body,html{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;}q:before,q:after{content:'';}
.ext-forced-border-box, .ext-forced-border-box * {
@@ -105,9 +119,12 @@ html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,bloc
}
.x-unselectable, .x-unselectable * {
- -moz-user-select: none;
- -khtml-user-select: none;
- -webkit-user-select:ignore;
+ user-select: none;
+ -o-user-select: none;
+ -ms-user-select: none;
+ -moz-user-select: -moz-none;
+ -webkit-user-select: none;
+ cursor:default;
}
.x-repaint {
@@ -657,27 +674,28 @@ ul.x-tab-strip li.x-tab-edge {
}
/*
- * Horrible hack for IE8 in quirks mode
+ * For IE8/9 in quirks mode
*/
.ext-ie8 .x-tab-strip li {
position: relative;
}
-.ext-border-box .ext-ie8 .x-tab-strip-top .x-tab-right {
+.ext-border-box .ext-ie8 .x-tab-strip-top .x-tab-right, .ext-border-box .ext-ie9 .x-tab-strip-top .x-tab-right {
top: 1px;
}
-.ext-ie8 .x-tab-strip-top {
- padding-top: 1;
+.ext-ie8 .x-tab-strip-top, .ext-ie9 .x-tab-strip-top {
+ padding-top: 1px;
}
-.ext-border-box .ext-ie8 .x-tab-strip-top {
+.ext-border-box .ext-ie8 .x-tab-strip-top, .ext-border-box .ext-ie9 .x-tab-strip-top {
padding-top: 0;
}
-.ext-ie8 .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close {
+.ext-ie8 .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close, .ext-ie9 .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close {
top:3px;
}
-.ext-border-box .ext-ie8 .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close {
+.ext-border-box .ext-ie8 .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close,
+.ext-border-box .ext-ie9 .x-tab-strip .x-tab-strip-closable a.x-tab-strip-close {
top:4px;
}
-.ext-ie8 .x-tab-strip-bottom .x-tab-right{
+.ext-ie8 .x-tab-strip-bottom .x-tab-right, .ext-ie9 .x-tab-strip-bottom .x-tab-right{
top:0;
}
@@ -2685,6 +2703,11 @@ a.x-grid3-hd-btn:hover {
top:-1px;
}
+.x-grid-editor .x-form-check-wrap {
+ text-align: center;
+ margin-top: -4px;
+}
+
.ext-ie .x-props-grid .x-editor .x-form-text {
position:static;
top:0;
diff --git a/deluge/ui/web/js/extjs/ext-all-debug.js b/deluge/ui/web/js/extjs/ext-all-debug.js
index effa07771..c3ffcdd76 100644
--- a/deluge/ui/web/js/extjs/ext-all-debug.js
+++ b/deluge/ui/web/js/extjs/ext-all-debug.js
@@ -1,111 +1,32 @@
-/*!
- * Ext JS Library 3.4.0
- * Copyright(c) 2006-2011 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
+/*
+This file is part of Ext JS 3.4
+
+Copyright (c) 2011-2013 Sencha Inc
+
+Contact: http://www.sencha.com/contact
+
+GNU General Public License Usage
+This file may be used under the terms of the GNU General Public License version 3.0 as
+published by the Free Software Foundation and appearing in the file LICENSE included in the
+packaging of this file.
+
+Please review the following information to ensure the GNU General Public License version 3.0
+requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+
+If you are unsure which license is appropriate for your use, please contact the sales department
+at http://www.sencha.com/contact.
+
+Build date: 2013-04-03 15:07:25
+*/
(function(){
var EXTUTIL = Ext.util,
EACH = Ext.each,
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.<br>
- * For example:
- * <pre><code>
-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&#39;s
- // constructor will add them.
- this.listeners = config.listeners;
- // Call our superclass constructor to complete construction process.
- Employee.superclass.constructor.call(this, config)
- }
-});
-</code></pre>
- * This could then be used like this:<pre><code>
-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!");
- }
- }
-});
-</code></pre>
- */
EXTUTIL.Observable = function(){
- /**
- * @cfg {Object} listeners (optional) <p>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.</p>
- * <br><p><b><u>DOM events from ExtJs {@link Ext.Component Components}</u></b></p>
- * <br><p>While <i>some</i> 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
- * <b><code>{@link Ext.DataView#click click}</code></b> event passing the node clicked on. To access DOM
- * events directly from a Component's HTMLElement, listeners must be added to the <i>{@link Ext.Component#getEl Element}</i> after the Component
- * has been rendered. A plugin can simplify this step:<pre><code>
-// 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&#39;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'
-});
- * </code></pre></p>
- */
var me = this, e = me.events;
if(me.listeners){
me.on(me.listeners);
@@ -115,17 +36,10 @@ var combo = new Ext.form.ComboBox({
};
EXTUTIL.Observable.prototype = {
- // private
+
filterOptRe : /^(?:scope|delay|buffer|single)$/,
- /**
- * <p>Fires the specified event with the passed parameters (minus the event name).</p>
- * <p>An event may be set to bubble up an Observable parent hierarchy (See {@link Ext.Component#getBubbleTarget})
- * by calling {@link #enableBubble}.</p>
- * @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 = Array.prototype.slice.call(arguments, 0),
ename = a[0].toLowerCase(),
@@ -162,65 +76,7 @@ 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 (<code><b>this</b></code> reference) in which the handler function is executed.
- * <b>If omitted, defaults to the object which fired the event.</b>
- * @param {Object} options (optional) An object containing handler configuration.
- * properties. This may contain any of the following properties:<ul>
- * <li><b>scope</b> : Object<div class="sub-desc">The scope (<code><b>this</b></code> reference) in which the handler function is executed.
- * <b>If omitted, defaults to the object which fired the event.</b></div></li>
- * <li><b>delay</b> : Number<div class="sub-desc">The number of milliseconds to delay the invocation of the handler after the event fires.</div></li>
- * <li><b>single</b> : Boolean<div class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</div></li>
- * <li><b>buffer</b> : Number<div class="sub-desc">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 <em>not</em> invoked, but the new handler is scheduled in its place.</div></li>
- * <li><b>target</b> : Observable<div class="sub-desc">Only call the handler if the event was fired on the target Observable, <i>not</i>
- * if the event was bubbled up from a child Observable.</div></li>
- * </ul><br>
- * <p>
- * <b>Combining Options</b><br>
- * Using the options argument, it is possible to combine different types of listeners:<br>
- * <br>
- * A delayed, one-time listener.
- * <pre><code>
-myDataView.on('click', this.onClick, this, {
-single: true,
-delay: 100
-});</code></pre>
- * <p>
- * <b>Attaching multiple handlers in 1 call</b><br>
- * The method also allows for a single argument to be passed which is a config object containing properties
- * which specify multiple handlers.
- * <p>
- * <pre><code>
-myGridPanel.on({
-'click' : {
- fn: this.onClick,
- scope: this,
- delay: 100
-},
-'mouseover' : {
- fn: this.onMouseOver,
- scope: this
-},
-'mouseout' : {
- fn: this.onMouseOut,
- scope: this
-}
-});</code></pre>
- * <p>
- * Or a shorthand syntax:<br>
- * <pre><code>
-myGridPanel.on({
-'click' : this.onClick,
-'mouseover' : this.onMouseOver,
-'mouseout' : this.onMouseOut,
- scope: this
-});</code></pre>
- */
+
addListener : function(eventName, fn, scope, o){
var me = this,
e,
@@ -245,12 +101,7 @@ myGridPanel.on({
}
},
- /**
- * Removes an event handler.
- * @param {String} eventName The type of event the handler was associated with.
- * @param {Function} handler The handler to remove. <b>This must be a reference to the function passed into the {@link #addListener} call.</b>
- * @param {Object} scope (optional) The scope originally specified for the handler.
- */
+
removeListener : function(eventName, fn, scope){
var ce = this.events[eventName.toLowerCase()];
if (typeof ce == 'object') {
@@ -258,9 +109,7 @@ myGridPanel.on({
}
},
- /**
- * Removes all listeners for this object
- */
+
purgeListeners : function(){
var events = this.events,
evt,
@@ -273,15 +122,7 @@ myGridPanel.on({
}
},
- /**
- * 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 <code>true</code>
- * 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:<pre><code>
-this.addEvents('storeloaded', 'storecleared');
-</code></pre>
- */
+
addEvents : function(o){
var me = this;
me.events = me.events || {};
@@ -296,21 +137,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 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){
@@ -318,11 +151,7 @@ this.addEvents('storeloaded', 'storecleared');
}
},
- /**
- * Resume firing events. (see {@link #suspendEvents})
- * If events were suspended using the <tt><b>queueSuspended</b></tt> parameter, then all
- * events fired during event suspension will be sent to any listeners now.
- */
+
resumeEvents : function(){
var me = this,
queued = me.eventQueue || [];
@@ -335,30 +164,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 (<code><b>this</b></code> reference) in which the handler function is executed.
- * <b>If omitted, defaults to the object which fired the event.</b>
- * @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. <b>This must be a reference to the function passed into the {@link #addListener} call.</b>
- * @param {Object} scope (optional) The scope originally specified for the handler.
- * @method
- */
+
OBSERVABLE.un = OBSERVABLE.removeListener;
-/**
- * Removes <b>all</b> added captures from the Observable.
- * @param {Observable} o The Observable to release
- * @static
- */
+
EXTUTIL.Observable.releaseCapture = function(o){
o.fireEvent = OBSERVABLE.fireEvent;
};
@@ -413,7 +224,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);
@@ -493,7 +304,7 @@ EXTUTIL.Event.prototype = {
return ret;
},
- // Iterate to stop any buffered/delayed events
+
clearListeners : function(){
var me = this,
l = me.listeners,
@@ -526,134 +337,7 @@ EXTUTIL.Event.prototype = {
};
})();
-/**
- * @class Ext.DomHelper
- * <p>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.</p>
- *
- * <p><b><u>DomHelper element specification object</u></b></p>
- * <p>A specification object is used when creating elements. Attributes of this object
- * are assumed to be element attributes, except for 4 special attributes:
- * <div class="mdetail-params"><ul>
- * <li><b><tt>tag</tt></b> : <div class="sub-desc">The tag name of the element</div></li>
- * <li><b><tt>children</tt></b> : or <tt>cn</tt><div class="sub-desc">An array of the
- * same kind of element definition objects to be created and appended. These can be nested
- * as deep as you want.</div></li>
- * <li><b><tt>cls</tt></b> : <div class="sub-desc">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.</div></li>
- * <li><b><tt>html</tt></b> : <div class="sub-desc">The innerHTML for the element</div></li>
- * </ul></div></p>
- *
- * <p><b><u>Insertion methods</u></b></p>
- * <p>Commonly used insertion methods:
- * <div class="mdetail-params"><ul>
- * <li><b><tt>{@link #append}</tt></b> : <div class="sub-desc"></div></li>
- * <li><b><tt>{@link #insertBefore}</tt></b> : <div class="sub-desc"></div></li>
- * <li><b><tt>{@link #insertAfter}</tt></b> : <div class="sub-desc"></div></li>
- * <li><b><tt>{@link #overwrite}</tt></b> : <div class="sub-desc"></div></li>
- * <li><b><tt>{@link #createTemplate}</tt></b> : <div class="sub-desc"></div></li>
- * <li><b><tt>{@link #insertHtml}</tt></b> : <div class="sub-desc"></div></li>
- * </ul></div></p>
- *
- * <p><b><u>Example</u></b></p>
- * <p>This is an example, where an unordered list with 3 children items is appended to an existing
- * element with id <tt>'my-div'</tt>:<br>
- <pre><code>
-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
-);
- </code></pre></p>
- * <p>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:<pre><code>
-dh.append('my-ul', [
- {tag: 'li', id: 'item3', html: 'List Item 3'},
- {tag: 'li', id: 'item4', html: 'List Item 4'}
-]);
- * </code></pre></p>
- *
- * <p><b><u>Templating</u></b></p>
- * <p>The real power is in the built-in templating. Instead of creating or appending any elements,
- * <tt>{@link #createTemplate}</tt> 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:
- * <pre><code>
-// 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
-}
- * </code></pre></p>
- * <p>An example using a template:<pre><code>
-var html = '<a id="{0}" href="{1}" class="nav">{2}</a>';
-
-var tpl = new Ext.DomHelper.createTemplate(html);
-tpl.append('blog-roll', ['link1', 'http://www.jackslocum.com/', "Jack&#39;s Site"]);
-tpl.append('blog-roll', ['link2', 'http://www.dustindiaz.com/', "Dustin&#39;s Site"]);
- * </code></pre></p>
- *
- * <p>The same example using named parameters:<pre><code>
-var html = '<a id="{id}" href="{url}" class="nav">{text}</a>';
-
-var tpl = new Ext.DomHelper.createTemplate(html);
-tpl.append('blog-roll', {
- id: 'link1',
- url: 'http://www.jackslocum.com/',
- text: "Jack&#39;s Site"
-});
-tpl.append('blog-roll', {
- id: 'link2',
- url: 'http://www.dustindiaz.com/',
- text: "Dustin&#39;s Site"
-});
- * </code></pre></p>
- *
- * <p><b><u>Compiling Templates</u></b></p>
- * <p>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.
- * <pre><code>
-var html = '<a id="{id}" href="{url}" class="nav">{text}</a>';
-
-var tpl = new Ext.DomHelper.createTemplate(html);
-tpl.compile();
-
-//... use template like normal
- * </code></pre></p>
- *
- * <p><b><u>Performance Boost</u></b></p>
- * <p>DomHelper will transparently create HTML fragments when it can. Using HTML fragments instead
- * of DOM can significantly boost performance.</p>
- * <p>Element creation specification parameters may also be strings. If {@link #useDom} is <tt>false</tt>,
- * then the string is used as innerHTML. If {@link #useDom} is <tt>true</tt>, a string specification
- * results in the creation of a text node. Usage:</p>
- * <pre><code>
-Ext.DomHelper.useDom = true; // force it to use DOM; reduces performance
- * </code></pre>
- * @singleton
- */
Ext.DomHelper = function(){
var tempTableEl = null,
emptyTags = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,
@@ -663,7 +347,7 @@ Ext.DomHelper = function(){
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',
@@ -675,13 +359,13 @@ Ext.DomHelper = function(){
trs = tbs + '<tr>',
tre = '</tr>'+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,
@@ -713,7 +397,7 @@ Ext.DomHelper = function(){
}
}
};
- // Now either just close the tag or try to add children and close the tag.
+
if (emptyTags.test(o.tag)) {
b += '/>';
} else {
@@ -737,7 +421,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){
@@ -750,10 +434,7 @@ Ext.DomHelper = function(){
return el;
}
- /**
- * @ignore
- * Nasty code for IE's broken table implementation
- */
+
function insertIntoTable(tag, where, el, html) {
var node,
before;
@@ -784,10 +465,7 @@ Ext.DomHelper = function(){
return node;
}
- /**
- * @ignore
- * Fix for IE9 createContextualFragment missing method
- */
+
function createContextualFragment(html){
var div = document.createElement("div"),
fragment = document.createDocumentFragment(),
@@ -806,21 +484,12 @@ 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 matches;
@@ -830,12 +499,7 @@ Ext.DomHelper = function(){
styles = styles.call();
}
if (typeof styles == "string") {
- /**
- * Since we're using the g flag on the regex, we need to set the lastIndex.
- * This automatically happens on some implementations, but not others, see:
- * http://stackoverflow.com/questions/2645273/javascript-regular-expression-literal-persists-between-function-calls
- * http://blog.stevenlevithan.com/archives/fixing-javascript-regexp
- */
+
cssRe.lastIndex = 0;
while ((matches = cssRe.exec(styles))) {
el.setStyle(matches[1], matches[2]);
@@ -845,13 +509,7 @@ Ext.DomHelper = function(){
}
}
},
- /**
- * 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,
@@ -862,7 +520,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'];
@@ -870,7 +528,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])) {
@@ -914,57 +572,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);
@@ -975,61 +603,7 @@ Ext.DomHelper = function(){
};
return pub;
}();
-/**
- * @class Ext.Template
- * <p>Represents an HTML fragment template. Templates may be {@link #compile precompiled}
- * for greater performance.</p>
- * <p>For example usage {@link #Template see the constructor}.</p>
- *
- * @constructor
- * An instance of this class may be created by passing to the constructor either
- * a single argument, or multiple arguments:
- * <div class="mdetail-params"><ul>
- * <li><b>single argument</b> : String/Array
- * <div class="sub-desc">
- * The single argument may be either a String or an Array:<ul>
- * <li><tt>String</tt> : </li><pre><code>
-var t = new Ext.Template("&lt;div>Hello {0}.&lt;/div>");
-t.{@link #append}('some-element', ['foo']);
- * </code></pre>
- * <li><tt>Array</tt> : </li>
- * An Array will be combined with <code>join('')</code>.
-<pre><code>
-var t = new Ext.Template([
- '&lt;div name="{id}"&gt;',
- '&lt;span class="{cls}"&gt;{name:trim} {value:ellipsis(10)}&lt;/span&gt;',
- '&lt;/div&gt;',
-]);
-t.{@link #compile}();
-t.{@link #append}('some-element', {id: 'myid', cls: 'myclass', name: 'foo', value: 'bar'});
-</code></pre>
- * </ul></div></li>
- * <li><b>multiple arguments</b> : String, Object, Array, ...
- * <div class="sub-desc">
- * Multiple arguments will be combined with <code>join('')</code>.
- * <pre><code>
-var t = new Ext.Template(
- '&lt;div name="{id}"&gt;',
- '&lt;span class="{cls}"&gt;{name} {value}&lt;/span&gt;',
- '&lt;/div&gt;',
- // a configuration object:
- {
- compiled: true, // {@link #compile} immediately
- disableFormats: true // See Notes below.
- }
-);
- * </code></pre>
- * <p><b>Notes</b>:</p>
- * <div class="mdetail-params"><ul>
- * <li>Formatting and <code>disableFormats</code> are not applicable for Ext Core.</li>
- * <li>For a list of available format functions, see {@link Ext.util.Format}.</li>
- * <li><code>disableFormats</code> reduces <code>{@link #apply}</code> time
- * when no formatting is required.</li>
- * </ul></div>
- * </div></li>
- * </ul></div>
- * @param {Mixed} config
- */
+
Ext.Template = function(html){
var me = this,
a = arguments,
@@ -1050,39 +624,19 @@ Ext.Template = function(html){
html = buf.join('');
}
- /**@private*/
+
me.html = html;
- /**
- * @cfg {Boolean} compiled Specify <tt>true</tt> to compile the template
- * immediately (see <code>{@link #compile}</code>).
- * Defaults to <tt>false</tt>.
- */
+
if (me.compiled) {
me.compile();
}
};
Ext.Template.prototype = {
- /**
- * @cfg {RegExp} re The regular expression used to match template variables.
- * Defaults to:<pre><code>
- * re : /\{([\w\-]+)\}/g // for Ext Core
- * re : /\{([\w\-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g // for Ext JS
- * </code></pre>
- */
+
re : /\{([\w\-]+)\}/g,
- /**
- * See <code>{@link #re}</code>.
- * @type RegExp
- * @property re
- */
- /**
- * Returns an HTML fragment of this template with the specified <code>values</code> applied.
- * @param {Object/Array} values
- * The template values. Can be an array if the params are numeric (i.e. <code>{0}</code>)
- * or an object (i.e. <code>{foo: 'bar'}</code>).
- * @return {String} The HTML fragment
- */
+
+
applyTemplate : function(values){
var me = this;
@@ -1093,12 +647,7 @@ Ext.Template.prototype = {
});
},
- /**
- * 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;
me.html = html;
@@ -1106,10 +655,7 @@ Ext.Template.prototype = {
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 ? "+" : ",";
@@ -1125,50 +671,22 @@ Ext.Template.prototype = {
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 <code>values</code> to the template and appends
- * the new node(s) to the specified <code>el</code>.
- * <p>For example usage {@link #Template see the constructor}.</p>
- * @param {Mixed} el The context element
- * @param {Object/Array} values
- * The template values. Can be an array if the params are numeric (i.e. <code>{0}</code>)
- * or an object (i.e. <code>{foo: 'bar'}</code>).
- * @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);
},
@@ -1179,131 +697,46 @@ 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 <code>values</code> applied.
- * @param {Object/Array} values
- * The template values. Can be an array if the params are numeric (i.e. <code>{0}</code>)
- * or an object (i.e. <code>{foo: 'bar'}</code>).
- * @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 (<i>display:none</i> 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 || '');
};
-/*
- * This is code is also distributed under MIT license for use
- * with jQuery and prototype JavaScript libraries.
- */
-/**
- * @class Ext.DomQuery
-Provides high performance selector/xpath processing by compiling queries into reusable functions. New pseudo classes and matchers can be plugged. It works on HTML and XML documents (if a content node is passed in).
-<p>
-DomQuery supports most of the <a href="http://www.w3.org/TR/2005/WD-css3-selectors-20051215/#selectors">CSS3 selectors spec</a>, along with some custom selectors and basic XPath.</p>
-
-<p>
-All selectors, attribute filters and pseudos below can be combined infinitely in any order. For example "div.foo:nth-child(odd)[@foo=bar].bar:first" would be a perfectly valid selector. Node filters are processed in the order in which they appear, which allows you to optimize your queries for your document structure.
-</p>
-<h4>Element Selectors:</h4>
-<ul class="list">
- <li> <b>*</b> any element</li>
- <li> <b>E</b> an element with the tag E</li>
- <li> <b>E F</b> All descendent elements of E that have the tag F</li>
- <li> <b>E > F</b> or <b>E/F</b> all direct children elements of E that have the tag F</li>
- <li> <b>E + F</b> all elements with the tag F that are immediately preceded by an element with the tag E</li>
- <li> <b>E ~ F</b> all elements with the tag F that are preceded by a sibling element with the tag E</li>
-</ul>
-<h4>Attribute Selectors:</h4>
-<p>The use of &#64; and quotes are optional. For example, div[&#64;foo='bar'] is also a valid attribute selector.</p>
-<ul class="list">
- <li> <b>E[foo]</b> has an attribute "foo"</li>
- <li> <b>E[foo=bar]</b> has an attribute "foo" that equals "bar"</li>
- <li> <b>E[foo^=bar]</b> has an attribute "foo" that starts with "bar"</li>
- <li> <b>E[foo$=bar]</b> has an attribute "foo" that ends with "bar"</li>
- <li> <b>E[foo*=bar]</b> has an attribute "foo" that contains the substring "bar"</li>
- <li> <b>E[foo%=2]</b> has an attribute "foo" that is evenly divisible by 2</li>
- <li> <b>E[foo!=bar]</b> attribute "foo" does not equal "bar"</li>
-</ul>
-<h4>Pseudo Classes:</h4>
-<ul class="list">
- <li> <b>E:first-child</b> E is the first child of its parent</li>
- <li> <b>E:last-child</b> E is the last child of its parent</li>
- <li> <b>E:nth-child(<i>n</i>)</b> E is the <i>n</i>th child of its parent (1 based as per the spec)</li>
- <li> <b>E:nth-child(odd)</b> E is an odd child of its parent</li>
- <li> <b>E:nth-child(even)</b> E is an even child of its parent</li>
- <li> <b>E:only-child</b> E is the only child of its parent</li>
- <li> <b>E:checked</b> E is an element that is has a checked attribute that is true (e.g. a radio or checkbox) </li>
- <li> <b>E:first</b> the first E in the resultset</li>
- <li> <b>E:last</b> the last E in the resultset</li>
- <li> <b>E:nth(<i>n</i>)</b> the <i>n</i>th E in the resultset (1 based)</li>
- <li> <b>E:odd</b> shortcut for :nth-child(odd)</li>
- <li> <b>E:even</b> shortcut for :nth-child(even)</li>
- <li> <b>E:contains(foo)</b> E's innerHTML contains the substring "foo"</li>
- <li> <b>E:nodeValue(foo)</b> E contains a textNode with a nodeValue that equals "foo"</li>
- <li> <b>E:not(S)</b> an E element that does not match simple selector S</li>
- <li> <b>E:has(S)</b> an E element that has a descendent that matches simple selector S</li>
- <li> <b>E:next(S)</b> an E element whose next sibling matches simple selector S</li>
- <li> <b>E:prev(S)</b> an E element whose previous sibling matches simple selector S</li>
- <li> <b>E:any(S1|S2|S2)</b> an E element which matches any of the simple selectors S1, S2 or S3//\\</li>
-</ul>
-<h4>CSS Value Selectors:</h4>
-<ul class="list">
- <li> <b>E{display=none}</b> css value "display" that equals "none"</li>
- <li> <b>E{display^=none}</b> css value "display" that starts with "none"</li>
- <li> <b>E{display$=none}</b> css value "display" that ends with "none"</li>
- <li> <b>E{display*=none}</b> css value "display" that contains the substring "none"</li>
- <li> <b>E{display%=2}</b> css value "display" that is evenly divisible by 2</li>
- <li> <b>E{display!=none}</b> css value "display" that does not equal "none"</li>
-</ul>
- * @singleton
- */
+
+
Ext.DomQuery = function(){
- var cache = {},
- simpleCache = {},
+ var cache = {},
+ simpleCache = {},
valueCache = {},
nonSpace = /\S/,
trimRe = /^\s+|\s+$/g,
tplRe = /\{(\d+)\}/g,
modeRe = /^(\s?[\/>+~]\s?|\s|$)/,
- tagTokenRe = /^(#)?([\w\-\*]+)/,
- nthRe = /(\d*)n\+?(\d*)/,
+ 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.
+
+
+ eval("var batch = 30803;");
+
+
+
function child(parent, index){
var i = 0,
n = parent.firstChild;
@@ -1318,31 +751,31 @@ Ext.DomQuery = function(){
return null;
}
- // retrieve the next element node
- function next(n){
+
+ 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;
@@ -1351,8 +784,8 @@ Ext.DomQuery = function(){
}
- // nodeSet - array of nodes
- // cls - CSS Class
+
+
function byClassName(nodeSet, cls){
if(!cls){
return nodeSet;
@@ -1367,7 +800,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];
}
@@ -1386,22 +819,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);
@@ -1409,8 +842,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++){
@@ -1421,8 +854,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++){
@@ -1431,8 +864,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++){
@@ -1490,29 +923,29 @@ Ext.DomQuery = function(){
return result;
}
- // operators are =, !=, ^=, $=, *=, %=, |= and ~=
- // custom can be "{"
+
+
function byAttribute(cs, attr, value, op, custom){
- var result = [],
- ri = -1,
- useGetStyle = custom == "{",
- fn = Ext.DomQuery.operators[op],
+ var result = [],
+ ri = -1,
+ useGetStyle = custom == "{",
+ fn = Ext.DomQuery.operators[op],
a,
xml,
hasXml;
for(var i = 0, ci; ci = cs[i]; i++){
- // skip non-element nodes.
+
if(ci.nodeType != 1){
continue;
}
- // only need to do this for the first node
+
if(!hasXml){
xml = Ext.DomQuery.isXml(ci);
hasXml = true;
}
-
- // we only need to change the property names if we're dealing with html nodes, not XML
+
+
if(!xml){
if(useGetStyle){
a = Ext.DomQuery.getStyle(ci, attr);
@@ -1521,8 +954,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);
@@ -1542,7 +975,7 @@ Ext.DomQuery = function(){
}
function nodupIEXml(cs){
- var d = ++key,
+ var d = ++key,
r;
cs[0].setAttribute("_nodup", d);
r = [cs[0]];
@@ -1597,7 +1030,7 @@ Ext.DomQuery = function(){
r = [];
for(var i = 0, len = c1.length; i < len; i++){
c1[i].setAttribute("_qdiff", d);
- }
+ }
for(var i = 0, len = c2.length; i < len; i++){
if(c2[i].getAttribute("_qdiff") != d){
r[r.length] = c2[i];
@@ -1618,10 +1051,10 @@ Ext.DomQuery = function(){
}
if(isIE && typeof c1[0].selectSingleNode != "undefined"){
return quickDiffIEXml(c1, c2);
- }
+ }
for(var i = 0; i < len1; i++){
c1[i]._qdiff = d;
- }
+ }
for(var i = 0, len = c2.length; i < len; i++){
if(c2[i]._qdiff != d){
r[r.length] = c2[i];
@@ -1643,32 +1076,26 @@ 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,
+ mode,
+ lastPath,
matchers = Ext.DomQuery.matchers,
matchersLn = matchers.length,
modeMatch,
- // accept leading mode switch
+
lmode = path.match(modeRe);
-
+
if(lmode && lmode[1]){
fn[fn.length] = 'mode="'+lmode[1].replace(trimRe, "")+'";';
path = path.replace(lmode[1], "");
}
-
- // strip leading slashes
+
+
while(path.substr(0, 1)=="/"){
path = path.substr(1);
}
@@ -1678,9 +1105,9 @@ 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]+'");';
+ fn[fn.length] = 'n = quickId(n, mode, root, "'+tokenMatch[2]+'");';
}else{
fn[fn.length] = 'n = getNodes(n, mode, "'+tokenMatch[2]+'");';
}
@@ -1688,7 +1115,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] == "#"){
@@ -1713,7 +1140,7 @@ Ext.DomQuery = function(){
break;
}
}
- // prevent infinite loop on bad selector
+
if(!matched){
throw 'Error parsing selector, parsing failed at "' + path + '"';
}
@@ -1723,35 +1150,29 @@ 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"){
root = document.getElementById(root);
}
var paths = path.split(","),
results = [];
-
- // loop over each selector
- for(var i = 0, len = paths.length; i < len; i++){
+
+
+ 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]){
@@ -1763,9 +1184,9 @@ Ext.DomQuery = function(){
results = results.concat(result);
}
}
-
- // if there were multiple selectors, make sure dups
- // are eliminated
+
+
+
if(paths.length > 1){
return nodup(results);
}
@@ -1782,30 +1203,19 @@ Ext.DomQuery = function(){
var cs = root.querySelectorAll(path);
return Ext.toArray(cs);
}
- catch (ex) {}
- }
+ catch (ex) {}
+ }
return Ext.DomQuery.jsSelect.call(this, path, root, type);
} : function(path, root, type) {
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]){
@@ -1813,35 +1223,24 @@ 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);
@@ -1851,15 +1250,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]){
@@ -1869,11 +1260,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} ");'
@@ -2155,30 +1542,30 @@ Ext.query = Ext.DomQuery.select;
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
+// 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);
+ task.{@link #delay}(500);
});
- * </code></pre>
+ * </code></pre>
* <p>Note that we are using a DelayedTask here to illustrate a point. The configuration
* option <tt>buffer</tt> for {@link Ext.util.Observable#addListener addListener/on} will
- * also setup a delayed task for you to buffer events.</p>
+ * also setup a delayed task for you to buffer events.</p>
* @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 <code><b>this</b></code> reference) in which the
+ * @param {Object} scope (optional) The default scope (The <code><b>this</b></code> reference) in which the
* function is called. If not specified, <code>this</code> 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,
+ id,
call = function(){
clearInterval(id);
id = null;
fn.apply(scope, args || []);
};
-
+
/**
* Cancels any pending timeout and queues a new one
* @param {Number} delay The milliseconds to delay
@@ -2809,7 +2196,7 @@ el.un('click', this.handlerFn);
},
/**
- * <p>Updates the <a href="http://developer.mozilla.org/en/DOM/element.innerHTML">innerHTML</a> of this Element
+ * <p>Updates the <a href="http:
* from a specified URL. Note that this is subject to the <a href="http://en.wikipedia.org/wiki/Same_origin_policy">Same Origin Policy</a></p>
* <p>Updating innerHTML of an element will <b>not</b> execute embedded <tt>&lt;script></tt> elements. This is a browser restriction.</p>
* @param {Mixed} options. Either a sring containing the URL from which to load the HTML, or an {@link Ext.Ajax#request} options object specifying
@@ -2827,17 +2214,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 Ext.isBorderBox || Ext.isForcedBorderBox || noBoxAdjust[(this.dom.tagName || "").toLowerCase()];
},
- /**
- * <p>Removes this element's dom reference. Note that event and cache removal is handled at {@link Ext#removeNode}</p>
- */
+
remove : function(){
var me = this,
dom = me.dom;
@@ -2848,14 +2230,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 (<code>this</code> 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 <tt>options</tt> parameter}.
- * @return {Ext.Element} this
- */
+
hover : function(overFn, outFn, scope, options){
var me = this;
me.on('mouseenter', overFn, scope || me.dom, options);
@@ -2863,32 +2238,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: (function(){
var test = document.createElement('table'),
isBrokenOnTable = false,
@@ -2946,11 +2306,7 @@ el.un('click', this.handlerFn);
test = null;
})(),
- /**
- * 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;
@@ -2965,61 +2321,26 @@ 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 (<code>this</code> 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. <b>This must be a reference to the function passed into the {@link #addListener} call.</b>
- * @param {Object} scope If a scope (<b><code>this</code></b> 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.
- * <p><b>This method does not retrieve {@link Ext.Component Component}s.</b> This method
- * retrieves Ext.Element objects which encapsulate DOM elements. To retrieve a Component by
- * its ID, use {@link Ext.ComponentMgr#get}.</p>
- * <p>Uses simple caching to consistently return the same object. Automatically fixes if an
- * object was recreated with the same id via AJAX or DOM.</p>
- * @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;
}
@@ -3030,7 +2351,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);
}
@@ -3043,10 +2364,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 {
@@ -3059,7 +2380,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;
@@ -3081,7 +2402,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) {
@@ -3095,9 +2416,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);
@@ -3110,27 +2431,28 @@ function garbageCollect(){
for(eid in EC){
o = EC[eid];
if(o.skipGC){
+ Ext.EventManager.removeFromSpecialCache(o.el);
continue;
}
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);
@@ -3138,7 +2460,7 @@ function garbageCollect(){
delete EC[eid];
}
}
- // Cleanup IE Object leaks
+
if (Ext.isIE) {
var t = {};
for (eid in EC) {
@@ -3153,7 +2475,7 @@ El.collectorThreadId = setInterval(garbageCollect, 30000);
var flyFn = function(){};
flyFn.prototype = El.prototype;
-// dom is optional
+
El.Flyweight = function(dom){
this.dom = dom;
};
@@ -3162,19 +2484,7 @@ El.Flyweight.prototype = new flyFn();
El.Flyweight.prototype.isFlyweight = true;
El._flyweights = {};
-/**
- * <p>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}</p>
- * <p>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.</p>
- * @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';
@@ -3186,37 +2496,13 @@ El.fly = function(el, named){
return ret;
};
-/**
- * Retrieves Ext.Element objects.
- * <p><b>This method does not retrieve {@link Ext.Component Component}s.</b> This method
- * retrieves Ext.Element objects which encapsulate DOM elements. To retrieve a Component by
- * its ID, use {@link Ext.ComponentMgr#get}.</p>
- * <p>Uses simple caching to consistently return the same object. Automatically fixes if an
- * object was recreated with the same id via AJAX or DOM.</p>
- * 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;
-/**
- * <p>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}</p>
- * <p>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.</p>
- * @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
} : {
@@ -3227,9 +2513,7 @@ if(Ext.isIE || Ext.isGecko){
}
})();
-/**
- * @class Ext.Element
- */
+
Ext.Element.addMethods(function(){
var PARENTNODE = 'parentNode',
NEXTSIBLING = 'nextSibling',
@@ -3238,18 +2522,12 @@ 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,
- depth = 0,
- stopEl;
+ b = document.body,
+ depth = 0,
+ stopEl;
if(Ext.isGecko && Object.prototype.toString.call(p) == '[object XULElement]') {
return null;
}
@@ -3268,118 +2546,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);
},
@@ -3395,9 +2616,7 @@ Ext.Element.addMethods(function(){
return null;
}
};
-}());/**
- * @class Ext.Element
- */
+}());
Ext.Element.addMethods(
function() {
var GETDOM = Ext.getDom,
@@ -3405,66 +2624,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);
@@ -3472,11 +2667,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;
@@ -3494,50 +2685,30 @@ 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 ?
- DH.insertBefore(insertBefore, config, returnDom !== true) :
- DH[!this.dom.firstChild ? 'overwrite' : 'append'](this.dom, config, returnDom !== true);
+ DH.insertBefore(insertBefore, config, returnDom !== true) :
+ 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.Element.addMethods(function(){
- // local style camelizing for speed
+
var supports = Ext.supports,
propCache = {},
camelRe = /(-[a-z])/gi,
@@ -3562,14 +2733,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();
}
@@ -3579,7 +2750,7 @@ Ext.Element.addMethods(function(){
}
return {
- // private ==> used by Fx
+
adjustWidth : function(width) {
var me = this;
var isNum = (typeof width == "number");
@@ -3589,7 +2760,7 @@ Ext.Element.addMethods(function(){
return (isNum && width < 0) ? 0 : width;
},
- // private ==> used by Fx
+
adjustHeight : function(height) {
var me = this;
var isNum = (typeof height == "number");
@@ -3600,18 +2771,14 @@ 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,
cls = [];
- // Separate case is for speed
+
if (!Ext.isArray(className)) {
if (typeof className == 'string' && !this.hasClass(className)) {
me.dom.className += " " + className;
@@ -3631,11 +2798,7 @@ Ext.Element.addMethods(function(){
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,
@@ -3663,11 +2826,7 @@ Ext.Element.addMethods(function(){
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
- */
+
radioClass : function(className){
var cn = this.dom.parentNode.childNodes,
v,
@@ -3683,30 +2842,17 @@ Ext.Element.addMethods(function(){
return this.addClass(className);
},
- /**
- * 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);
},
@@ -3715,11 +2861,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){
@@ -3736,8 +2878,8 @@ Ext.Element.addMethods(function(){
out = (v = el.style[prop]) ? v :
(cs = view.getComputedStyle(el, "")) ? cs[prop] : null;
- // Ignore cases when the margin is correctly reported as 0, the bug only shows
- // numbers larger.
+
+
if(prop == 'marginRight' && out != '0px' && !supports.correctRightMargin){
display = el.style.display;
el.style.display = 'inline-block';
@@ -3772,14 +2914,7 @@ 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 = (typeof prefix != 'undefined') ? prefix : '#',
@@ -3800,12 +2935,7 @@ 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;
@@ -3823,19 +2953,13 @@ 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 <tt>true</tt> for
- * the default animation (<tt>{duration: .35, easing: 'easeIn'}</tt>)
- * @return {Ext.Element} this
- */
+
setOpacity : function(opacity, animate){
var me = this,
s = me.dom.style;
if(!animate || !me.anim){
- if(Ext.isIE){
+ if(Ext.isIE9m){
var opac = opacity < 1 ? 'alpha(opacity=' + opacity * 100 + ')' : '',
val = s.filter.replace(opacityRe, '').replace(trimRe, '');
@@ -3850,13 +2974,10 @@ 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){
+ if(Ext.isIE9m){
if(!Ext.isEmpty(style.filter)){
style.filter = style.filter.replace(opacityRe, '').replace(trimRe, '');
}
@@ -3866,44 +2987,28 @@ 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,
- hidden = Ext.isIE && me.isStyle('display', 'none'),
+ hidden = Ext.isIE9m && me.isStyle('display', 'none'),
h = MATH.max(dom.offsetHeight, hidden ? 0 : dom.clientHeight) || 0;
h = !contentHeight ? h : h - me.getBorderWidth("tb") - me.getPadding("tb");
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,
- hidden = Ext.isIE && me.isStyle('display', 'none'),
+ hidden = Ext.isIE9m && me.isStyle('display', 'none'),
w = MATH.max(dom.offsetWidth, hidden ? 0 : dom.clientWidth) || 0;
w = !contentWidth ? w : w - me.getBorderWidth("lr") - me.getPadding("lr");
return w < 0 ? 0 : w;
},
- /**
- * Set the width of this Element.
- * @param {Mixed} width The new width. This may be one of:<div class="mdetail-params"><ul>
- * <li>A Number specifying the new width in this Element's {@link #defaultUnit}s (by default, pixels).</li>
- * <li>A String used to set the CSS width style. Animation may <b>not</b> be used.
- * </ul></div>
- * @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);
@@ -3913,26 +3018,7 @@ Ext.Element.addMethods(function(){
return me;
},
- /**
- * Set the height of this Element.
- * <pre><code>
-// 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"); }
-});
- * </code></pre>
- * @param {Mixed} height The new height. This may be one of:<div class="mdetail-params"><ul>
- * <li>A Number specifying the new height in this Element's {@link #defaultUnit}s (by default, pixels.)</li>
- * <li>A String used to set the CSS height style. Animation may <b>not</b> be used.</li>
- * </ul></div>
- * @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);
@@ -3942,30 +3028,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 <tt>'lr'</tt> would get the border <b><u>l</u></b>eft width + the border <b><u>r</u></b>ight 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 <tt>'lr'</tt> would get the padding <b><u>l</u></b>eft + the padding <b><u>r</u></b>ight.
- * @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 <tt>{@link #unclip}</tt> to remove
- * @return {Ext.Element} this
- */
+
clip : function(){
var me = this,
dom = me.dom;
@@ -3984,10 +3057,7 @@ Ext.fly('elId').setHeight(150, {
return me;
},
- /**
- * Return clipping (overflow) to original clipping before <tt>{@link #clip}</tt> was called
- * @return {Ext.Element} this
- */
+
unclip : function(){
var me = this,
dom = me.dom;
@@ -4008,7 +3078,7 @@ Ext.fly('elId').setHeight(150, {
return me;
},
- // private
+
addStyles : function(sides, styles){
var ttlSize = 0,
sidesArr = sides.match(wordsRe),
@@ -4030,9 +3100,7 @@ Ext.fly('elId').setHeight(150, {
};
}()
);
-/**
- * @class Ext.Element
- */
+
(function(){
var D = Ext.lib.Dom,
LEFT = "left",
@@ -4046,108 +3114,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();
+ 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){
@@ -4158,76 +3181,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;
@@ -4242,11 +3228,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({
@@ -4260,11 +3242,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);
@@ -4278,14 +3256,10 @@ 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;
+ style = me.dom.style;
me.setStyle(pc);
@@ -4299,20 +3273,15 @@ 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];
var me = this,
- relative = me.isStyle(POSITION, RELATIVE),
- o = me.getXY(),
- l = parseInt(me.getStyle(LEFT), 10),
- t = parseInt(me.getStyle(TOP), 10);
+ relative = me.isStyle(POSITION, RELATIVE),
+ o = me.getXY(),
+ l = parseInt(me.getStyle(LEFT), 10),
+ t = parseInt(me.getStyle(TOP), 10);
l = !isNaN(l) ? l : (relative ? 0 : me.dom.offsetLeft);
t = !isNaN(t) ? t : (relative ? 0 : me.dom.offsetTop);
@@ -4324,34 +3293,21 @@ Ext.Element.addMethods({
return !!animate && this.preanim ? this.preanim(args, i) : false;
}
});
-})();/**
- * @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,
@@ -4375,38 +3331,19 @@ Ext.Element.addMethods({
}
return ret;
}
-});/**
- * @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;
-/**
- * Visibility mode constant for use with {@link #setVisibilityMode}. Use offsets (x and y positioning offscreen)
- * to hide element.
- * @static
- * @type Number
- */
+
Ext.Element.OFFSETS = 3;
Ext.Element.ASCLASS = 4;
-/**
- * Defaults to 'x-hide-nosize'
- * @static
- * @type String
- */
+
Ext.Element.visibilityCls = 'x-hide-nosize';
Ext.Element.addMethods(function(){
@@ -4439,154 +3376,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.
- * <div><ul class="mdetail-params">
- * <li><u>Animation Properties</u></li>
- *
- * <p>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:</p><div><ul class="mdetail-params">
- * <li><tt>bottom, top, left, right</tt></li>
- * <li><tt>height, width</tt></li>
- * <li><tt>margin, padding</tt></li>
- * <li><tt>borderWidth</tt></li>
- * <li><tt>opacity</tt></li>
- * <li><tt>fontSize</tt></li>
- * <li><tt>lineHeight</tt></li>
- * </ul></div>
- *
- *
- * <li><u>Animation Property Attributes</u></li>
- *
- * <p>Each Animation Property is a config object with optional properties:</p>
- * <div><ul class="mdetail-params">
- * <li><tt>by</tt>* : relative change - start at current value, change by this value</li>
- * <li><tt>from</tt> : ignore current value, start from this value</li>
- * <li><tt>to</tt>* : start at current value, go to this value</li>
- * <li><tt>unit</tt> : any allowable unit specification</li>
- * <p>* do not specify both <tt>to</tt> and <tt>by</tt> for an animation property</p>
- * </ul></div>
- *
- * <li><u>Animation Types</u></li>
- *
- * <p>The supported animation types:</p><div><ul class="mdetail-params">
- * <li><tt>'run'</tt> : Default
- * <pre><code>
-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')
-);
- * </code></pre>
- * </li>
- * <li><tt>'color'</tt>
- * <p>Animates transition of background, text, or border colors.</p>
- * <pre><code>
-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')
-);
- * </code></pre>
- * </li>
- *
- * <li><tt>'motion'</tt>
- * <p>Animates the motion of an element to/from specific points using optional bezier
- * way points during transit.</p>
- * <pre><code>
-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')
-);
- * </code></pre>
- * </li>
- * <li><tt>'scroll'</tt>
- * <p>Animate horizontal or vertical scrolling of an overflowing page element.</p>
- * <pre><code>
-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')
-);
- * </code></pre>
- * </li>
- * </ul></div>
- *
- * </ul></div>
- *
- * @param {Object} args The animation control args
- * @param {Float} duration (optional) How long the animation lasts in seconds (defaults to <tt>.35</tt>)
- * @param {Function} onComplete (optional) Function to call when animation completes
- * @param {String} easing (optional) {@link Ext.Fx#easing} method to use (defaults to <tt>'easeOut'</tt>)
- * @param {String} animType (optional) <tt>'run'</tt> is the default. Can also be <tt>'color'</tt>,
- * <tt>'motion'</tt>, or <tt>'scroll'</tt>
- * @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 || {};
@@ -4606,24 +3412,21 @@ el.animate(
return anim;
},
- // private legacy anim prep
+
preanim : function(a, i){
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() {
var me = this,
dom = me.dom,
visible = data(dom, ISVISIBLE);
- if(typeof visible == 'boolean'){ //return the cached value if registered
+ if(typeof visible == 'boolean'){
return visible;
}
- //Determine the current state based on display states
+
visible = !me.isStyle(VISIBILITY, HIDDEN) &&
!me.isStyle(DISPLAY, NONE) &&
!((getVisMode(dom) == El.ASCLASS) && me.hasClass(me.visibilityCls || El.visibilityCls));
@@ -4632,20 +3435,14 @@ el.animate(
return visible;
},
- /**
- * 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, isVisibility, isOffsets, isNosize,
dom = me.dom,
visMode = getVisMode(dom);
- // hideMode string override
+
if (typeof animate == 'string'){
switch (animate) {
case DISPLAY:
@@ -4694,7 +3491,7 @@ el.animate(
dom.style.visibility = visible ? "visible" : HIDDEN;
}
}else{
- // closure for composites
+
if(visible){
me.setOpacity(.01);
me.setVisible(true);
@@ -4708,37 +3505,25 @@ el.animate(
visible || me.setVisible(false).setOpacity(1);
});
}
- data(dom, ISVISIBLE, visible); //set logical visibility state
+ data(dom, ISVISIBLE, visible);
return me;
},
- /**
- * @private
- * Determine if the Element has a relevant height and width available based
- * upon current logical visibility state
- */
+
hasMetrics : function(){
var dom = this.dom;
return this.isVisible() || (getVisMode(dom) == El.VISIBILITY);
},
- /**
- * 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;
@@ -4747,25 +3532,21 @@ 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 (typeof animate == 'string'){
this.setVisible(false, animate);
return this;
@@ -4774,13 +3555,9 @@ 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 (typeof animate == 'string'){
this.setVisible(true, animate);
return this;
@@ -4790,7 +3567,7 @@ el.animate(
}
};
}());(function(){
- // contants
+
var NULL = null,
UNDEFINED = undefined,
TRUE = true,
@@ -4811,9 +3588,7 @@ el.animate(
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){
@@ -4824,9 +3599,7 @@ el.animate(
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] = [];
@@ -4837,117 +3610,19 @@ el.animate(
queues[id] = value;
};
-//Notifies Element that fx methods are available
+
Ext.enableFx = TRUE;
-/**
- * @class Ext.Fx
- * <p>A class to provide basic animation and visual effects support. <b>Note:</b> 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 <b>must</b> be
- * {@link Ext#enableFx included} in order for the Element effects to work.</p><br/>
- *
- * <p><b><u>Method Chaining</u></b></p>
- * <p>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 <tt>{@link #callback}</tt>.</p><br/>
- *
- * <p><b><u>Anchor Options for Motion Effects</u></b></p>
- * <p>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:</p>
-<pre>
-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
-</pre>
- * <b>Note</b>: 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.</b>
- *
- * @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 <b><u>Method Chaining</u></b> above), for example:<pre><code>
- * el.slideIn().highlight();
- * </code></pre>
- * 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 (<code>this</code> reference) in which the <tt>{@link #callback}</tt> function is executed. Defaults to the browser window.
- *
- * @cfg {String} easing A valid Ext.lib.Easing value for the effect:</p><div class="mdetail-params"><ul>
- * <li><b><tt>backBoth</tt></b></li>
- * <li><b><tt>backIn</tt></b></li>
- * <li><b><tt>backOut</tt></b></li>
- * <li><b><tt>bounceBoth</tt></b></li>
- * <li><b><tt>bounceIn</tt></b></li>
- * <li><b><tt>bounceOut</tt></b></li>
- * <li><b><tt>easeBoth</tt></b></li>
- * <li><b><tt>easeBothStrong</tt></b></li>
- * <li><b><tt>easeIn</tt></b></li>
- * <li><b><tt>easeInStrong</tt></b></li>
- * <li><b><tt>easeNone</tt></b></li>
- * <li><b><tt>easeOut</tt></b></li>
- * <li><b><tt>easeOutStrong</tt></b></li>
- * <li><b><tt>elasticBoth</tt></b></li>
- * <li><b><tt>elasticIn</tt></b></li>
- * <li><b><tt>elasticOut</tt></b></li>
- * </ul></div>
- *
- * @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
- * <tt>0</tt> and <tt>1</tt> 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 <i>display</i> CSS property instead of <i>visibility</i> 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. <tt>"width:100px"</tt>, or an object
- * in the form <tt>{width:"100px"}</tt>, 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:
- *<pre><code>
-// 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
-});
-</code></pre>
- * @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,
@@ -4963,30 +3638,30 @@ el.slideIn('t', {
pt,
bw,
bh;
-
+
anchor = anchor || "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;
@@ -4994,7 +3669,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};
@@ -5041,33 +3716,8 @@ 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:
- *<pre><code>
-// 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
-});
-</code></pre>
- * @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,
@@ -5083,17 +3733,17 @@ el.slideOut('t', {
anchor = anchor || "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;
@@ -5144,26 +3794,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:
- *<pre><code>
-// default
-el.puff();
-
-// common config options shown with default values
-el.puff({
- easing: 'easeOut',
- duration: .5,
- remove: false,
- useDisplay: false
-});
-</code></pre>
- * @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,
@@ -5179,7 +3810,7 @@ el.puff({
fly(dom).clearOpacity();
fly(dom).show();
- // restore values after effect
+
r = fly(dom).getFxRestore();
function after(){
@@ -5208,26 +3839,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:
- *<pre><code>
-// default
-el.switchOff();
-
-// all config options shown with default values
-el.switchOff({
- easing: 'easeIn',
- duration: .3,
- remove: false,
- useDisplay: false
-});
-</code></pre>
- * @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,
@@ -5239,7 +3851,7 @@ el.switchOff({
fly(dom).clearOpacity();
fly(dom).clip();
- // restore values after effect
+
r = fly(dom).getFxRestore();
function after(){
@@ -5274,30 +3886,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:
-<pre><code>
-// 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
-});
-</code></pre>
- * @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,
@@ -5326,27 +3915,7 @@ el.highlight("ffff9c", {
return me;
},
- /**
- * Shows a ripple of exploding, attenuating borders to draw attention to an Element.
- * Usage:
-<pre><code>
-// 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
-});
-</code></pre>
- * @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,
@@ -5368,7 +3937,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
}
});
@@ -5412,16 +3981,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:
-<pre><code>
-el.pause(1);
-</code></pre>
- * @param {Number} seconds The length of time to pause (in seconds)
- * @return {Ext.Element} The Element
- */
+
pause : function(seconds){
var dom = this.dom,
t;
@@ -5441,27 +4001,7 @@ el.pause(1);
return this;
},
- /**
- * Fade an element in (from transparent to opaque). The ending opacity can be specified
- * using the <tt>{@link #endOpacity}</tt> config option.
- * Usage:
-<pre><code>
-// 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
-});
-</code></pre>
- * @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,
@@ -5483,30 +4023,7 @@ el.fadeIn({
return me;
},
- /**
- * Fade an element out (from opaque to transparent). The ending opacity can be specified
- * using the <tt>{@link #endOpacity}</tt> config option. Note that IE may require
- * <tt>{@link #useDisplay}:true</tt> in order to redisplay correctly.
- * Usage:
-<pre><code>
-// 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
-});
-</code></pre>
- * @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,
@@ -5535,29 +4052,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:
-<pre><code>
-// 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&#39;s existing values if passed as null.
-el.scale(
- [element&#39;s width],
- [element&#39;s height], {
- easing: 'easeOut',
- duration: .35
- }
-);
-</code></pre>
- * @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,
@@ -5566,30 +4061,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:
-<pre><code>
-// 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&#39;s width],
- height: [element&#39;s height],
- x: [element&#39;s x position],
- y: [element&#39;s y position],
- opacity: [element&#39;s opacity],
- easing: 'easeOut',
- duration: .35
-});
-</code></pre>
- * @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,
@@ -5623,29 +4095,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:
- *<pre><code>
-// 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
-});
-</code></pre>
- * @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,
@@ -5660,7 +4110,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();
@@ -5673,7 +4123,7 @@ el.ghost('b', {
st.height = r.height;
fly(dom).afterFx(o);
}
-
+
pt.by = fly(dom).switchStatements(anchor.toLowerCase(), function(v1,v2){ return [v1, v2];}, {
t : [0, -h],
l : [-w, 0],
@@ -5694,11 +4144,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 || {}, {
@@ -5709,11 +4155,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 || {}, {
@@ -5724,7 +4166,7 @@ el.ghost('b', {
return me;
},
- /* @private */
+
nextFx : function(){
var ef = getQueue(this.dom.id)[0];
if(ef){
@@ -5732,19 +4174,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;
@@ -5752,7 +4187,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, []);
@@ -5762,7 +4197,7 @@ el.ghost('b', {
return me;
},
- /* @private */
+
beforeFx : function(o){
if(this.hasActiveFx() && !o.concurrent){
if(o.stopFx){
@@ -5774,19 +4209,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()){
@@ -5805,7 +4234,7 @@ el.ghost('b', {
return me;
},
- /* @private */
+
fxWrap : function(pos, o, vis){
var dom = this.dom,
wrap,
@@ -5831,7 +4260,7 @@ el.ghost('b', {
return wrap;
},
- /* @private */
+
fxUnwrap : function(wrap, pos, o){
var dom = this.dom;
fly(dom).clearPositioning();
@@ -5843,13 +4272,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;
@@ -5871,7 +4300,7 @@ el.ghost('b', {
}
},
- /* @private */
+
fxanim : function(args, opt, animType, defaultDur, defaultEase, cb){
animType = animType || 'run';
opt = opt || {};
@@ -5888,58 +4317,16 @@ 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
- * <p>This class encapsulates a <i>collection</i> of DOM elements, providing methods to filter
- * members, or to perform collective actions upon the whole set.</p>
- * <p>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.</p>
- * Example:<pre><code>
-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);
-</code>
- */
+
Ext.CompositeElementLite = function(els, root){
- /**
- * <p>The Array of DOM elements which this CompositeElement encapsulates. Read-only.</p>
- * <p>This will not <i>usually</i> 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.</p>
- * <p>For example to add the <code>nextAll</code> method to the class to <b>add</b> all
- * following siblings of selected elements, the code would be</p><code><pre>
-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);
- }
-});</pre></code>
- * @type Array
- * @property elements
- */
+
this.elements = [];
this.add(els, root);
this.el = new Ext.Element.Flyweight();
@@ -5948,32 +4335,25 @@ Ext.override(Ext.CompositeElementLite, {
Ext.CompositeElementLite.prototype = {
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;
@@ -6009,11 +4389,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],
@@ -6025,7 +4401,7 @@ Ext.CompositeElementLite.prototype = {
return out;
},
- // fixes scope with flyweight
+
addListener : function(eventName, handler, scope, opt){
var els = this.elements,
len = els.length,
@@ -6039,18 +4415,7 @@ Ext.CompositeElementLite.prototype = {
}
return this;
},
- /**
- * <p>Calls the passed function for each element in this composite.</p>
- * @param {Function} fn The function to call. The function is passed the following parameters:<ul>
- * <li><b>el</b> : Element<div class="sub-desc">The current Element in the iteration.
- * <b>This is the flyweight (shared) Ext.Element instance, so if you require a
- * a reference to the dom node, use el.dom.</b></div></li>
- * <li><b>c</b> : Composite<div class="sub-desc">This Composite object.</div></li>
- * <li><b>idx</b> : Number<div class="sub-desc">The zero-based index in the iteration.</div></li>
- * </ul>
- * @param {Object} scope (optional) The scope (<i>this</i> reference) in which the function is executed. (defaults to the Element)
- * @return {CompositeElement} this
- */
+
each : function(fn, scope){
var me = this,
els = me.elements,
@@ -6069,11 +4434,7 @@ Ext.CompositeElementLite.prototype = {
return me;
},
- /**
- * Clears this Composite and adds the elements passed.
- * @param {Mixed} els Either an array of DOM elements, or another Composite from which to fill this Composite.
- * @return {CompositeElement} this
- */
+
fill : function(els){
var me = this;
me.elements = [];
@@ -6081,15 +4442,7 @@ Ext.CompositeElementLite.prototype = {
return me;
},
- /**
- * Filters this composite to only elements that match the passed selector.
- * @param {String/Function} selector A string CSS selector or a comparison function.
- * The comparison function will be called with the following arguments:<ul>
- * <li><code>el</code> : Ext.Element<div class="sub-desc">The current DOM element.</div></li>
- * <li><code>index</code> : Number<div class="sub-desc">The current index within the collection.</div></li>
- * </ul>
- * @return {CompositeElement} this
- */
+
filter : function(selector){
var els = [],
me = this,
@@ -6108,23 +4461,12 @@ Ext.CompositeElementLite.prototype = {
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;
@@ -6140,9 +4482,7 @@ Ext.CompositeElementLite.prototype = {
return this;
},
- /**
- * Removes all elements.
- */
+
clear : function(){
this.elements = [];
}
@@ -6150,12 +4490,7 @@ Ext.CompositeElementLite.prototype = {
Ext.CompositeElementLite.prototype.on = Ext.CompositeElementLite.prototype.addListener;
-/**
- * @private
- * Copies all of the functions from Ext.Element's prototype onto CompositeElementLite's prototype.
- * This is called twice - once immediately below, and once again after additional Ext.Element
- * are added in Ext JS
- */
+
Ext.CompositeElementLite.importElementMethods = function() {
var fnName,
ElProto = Ext.Element.prototype,
@@ -6179,16 +4514,7 @@ 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"){
@@ -6200,16 +4526,7 @@ 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;
(function(){
var BEFOREREQUEST = "beforerequest",
@@ -6221,214 +4538,37 @@ Ext.select = Ext.Element.select;
GET = 'GET',
WINDOW = window;
- /**
- * @class Ext.data.Connection
- * @extends Ext.util.Observable
- * <p>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.</p>
- * <p>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
- * <a href="#request-option-success" ext:member="request-option-success" ext:cls="Ext.data.Connection">success callback</a>
- * in the request options object,
- * or an {@link #requestcomplete event listener}.</p>
- * <p><h3>File Uploads</h3><a href="#request-option-isUpload" ext:member="request-option-isUpload" ext:cls="Ext.data.Connection">File uploads</a> are not performed using normal "Ajax" techniques, that
- * is they are <b>not</b> performed using XMLHttpRequests. Instead the form is submitted in the standard
- * manner with the DOM <tt>&lt;form></tt> element temporarily modified to have its
- * <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer
- * to a dynamically generated, hidden <tt>&lt;iframe></tt> which is inserted into the document
- * but removed after the return data has been gathered.</p>
- * <p>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
- * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a> header
- * must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.</p>
- * <p>Characters which are significant to an HTML parser must be sent as HTML entities, so encode
- * "&lt;" as "&amp;lt;", "&amp;" as "&amp;amp;" etc.</p>
- * <p>The response text is retrieved from the document, and a fake XMLHttpRequest object
- * is created containing a <tt>responseText</tt> property in order to conform to the
- * requirements of event handlers and callbacks.</p>
- * <p>Be aware that file upload packets are sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form</a>
- * and some server technologies (notably JEE) may require some custom processing in order to
- * retrieve parameter names and parameter values from the packet content.</p>
- * <p>Also note that it's not possible to check the response code of the hidden iframe, so the success handler will ALWAYS fire.</p>
- * @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 <a href="http://www.w3.org/TR/XMLHttpRequest/">The XMLHttpRequest Object</a>
- * 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 <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">HTTP Status Code Definitions</a>
- * for details of HTTP status codes.
- * @param {Connection} conn This Connection object.
- * @param {Object} response The XHR object containing the response data.
- * See <a href="http://www.w3.org/TR/XMLHttpRequest/">The XMLHttpRequest Object</a>
- * 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) <p>The default URL to be used for requests to the server. Defaults to undefined.</p>
- * <p>The <code>url</code> config may be a function which <i>returns</i> the URL to use for the Ajax request. The scope
- * (<code><b>this</b></code> reference) of the function is the <code>scope</code> option passed to the {@link #request} method.</p>
- */
- /**
- * @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',
- /**
- * <p>Sends an HTTP request to a remote server.</p>
- * <p><b>Important:</b> Ajax server requests are asynchronous, and this call will
- * return before the response has been received. Process any returned data
- * in a callback function.</p>
- * <pre><code>
-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);
- }
-});
- * </code></pre>
- * <p>To execute a callback function in the correct scope, use the <tt>scope</tt> option.</p>
- * @param {Object} options An object which may contain the following properties:<ul>
- * <li><b>url</b> : String/Function (Optional)<div class="sub-desc">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 <tt>scope</tt> option. Defaults to the configured
- * <tt>{@link #url}</tt>.</div></li>
- * <li><b>params</b> : Object/String/Function (Optional)<div class="sub-desc">
- * 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 <tt>scope</tt> option.</div></li>
- * <li><b>method</b> : String (Optional)<div class="sub-desc">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.</div></li>
- * <li><b>callback</b> : Function (Optional)<div class="sub-desc">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:<ul>
- * <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>
- * <li><b>success</b> : Boolean<div class="sub-desc">True if the request succeeded.</div></li>
- * <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data.
- * See <a href="http://www.w3.org/TR/XMLHttpRequest/">http://www.w3.org/TR/XMLHttpRequest/</a> for details about
- * accessing elements of the response.</div></li>
- * </ul></div></li>
- * <li><a id="request-option-success"></a><b>success</b> : Function (Optional)<div class="sub-desc">The function
- * to be called upon success of the request. The callback is passed the following
- * parameters:<ul>
- * <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data.</div></li>
- * <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>
- * </ul></div></li>
- * <li><b>failure</b> : Function (Optional)<div class="sub-desc">The function
- * to be called upon failure of the request. The callback is passed the
- * following parameters:<ul>
- * <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data.</div></li>
- * <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>
- * </ul></div></li>
- * <li><b>scope</b> : Object (Optional)<div class="sub-desc">The scope in
- * which to execute the callbacks: The "this" object for the callback function. If the <tt>url</tt>, or <tt>params</tt> 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.</div></li>
- * <li><b>timeout</b> : Number (Optional)<div class="sub-desc">The timeout in milliseconds to be used for this request. Defaults to 30 seconds.</div></li>
- * <li><b>form</b> : Element/HTMLElement/String (Optional)<div class="sub-desc">The <tt>&lt;form&gt;</tt>
- * Element or the id of the <tt>&lt;form&gt;</tt> to pull parameters from.</div></li>
- * <li><a id="request-option-isUpload"></a><b>isUpload</b> : Boolean (Optional)<div class="sub-desc"><b>Only meaningful when used
- * with the <tt>form</tt> option</b>.
- * <p>True if the form object is a file upload (will be set automatically if the form was
- * configured with <b><tt>enctype</tt></b> "multipart/form-data").</p>
- * <p>File uploads are not performed using normal "Ajax" techniques, that is they are <b>not</b>
- * performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the
- * DOM <tt>&lt;form></tt> element temporarily modified to have its
- * <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer
- * to a dynamically generated, hidden <tt>&lt;iframe></tt> which is inserted into the document
- * but removed after the return data has been gathered.</p>
- * <p>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
- * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a> header
- * must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.</p>
- * <p>The response text is retrieved from the document, and a fake XMLHttpRequest object
- * is created containing a <tt>responseText</tt> property in order to conform to the
- * requirements of event handlers and callbacks.</p>
- * <p>Be aware that file upload packets are sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form</a>
- * and some server technologies (notably JEE) may require some custom processing in order to
- * retrieve parameter names and parameter values from the packet content.</p>
- * </div></li>
- * <li><b>headers</b> : Object (Optional)<div class="sub-desc">Request
- * headers to set for the request.</div></li>
- * <li><b>xmlData</b> : Object (Optional)<div class="sub-desc">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.</div></li>
- * <li><b>jsonData</b> : Object/String (Optional)<div class="sub-desc">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.</div></li>
- * <li><b>disableCaching</b> : Boolean (Optional)<div class="sub-desc">True
- * to add a unique cache-buster param to GET requests.</div></li>
- * </ul></p>
- * <p>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.</p>
- * @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)){
@@ -6499,26 +4639,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;
@@ -6532,7 +4665,7 @@ Ext.Ajax.request({
}
},
- // private
+
handleFailure : function(response, e){
this.transId = false;
var options = response.argument.options;
@@ -6546,7 +4679,7 @@ Ext.Ajax.request({
}
},
- // private
+
doFormUpload : function(o, ps, url){
var id = Ext.id(),
doc = document,
@@ -6563,11 +4696,7 @@ 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,
@@ -6577,7 +4706,7 @@ Ext.Ajax.request({
doc.body.appendChild(frame);
- // This is required so that IE doesn't pop the response up in a new window.
+
if(Ext.isIE){
document.frames[id].name = id;
}
@@ -6591,7 +4720,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({
@@ -6605,7 +4734,7 @@ Ext.Ajax.request({
function cb(){
var me = this,
- // bogus response object
+
r = {responseText : '',
responseXML : null,
argument : o.argument},
@@ -6616,13 +4745,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;
}
}
@@ -6657,144 +4786,33 @@ Ext.Ajax.request({
});
})();
-/**
- * @class Ext.Ajax
- * @extends Ext.data.Connection
- * <p>The global Ajax request class that provides a simple way to make Ajax requests
- * with maximum flexibility.</p>
- * <p>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.</p>
- * <p>Common <b>Properties</b> you may want to set are:<div class="mdetail-params"><ul>
- * <li><b><tt>{@link #method}</tt></b><p class="sub-desc"></p></li>
- * <li><b><tt>{@link #extraParams}</tt></b><p class="sub-desc"></p></li>
- * <li><b><tt>{@link #url}</tt></b><p class="sub-desc"></p></li>
- * </ul></div>
- * <pre><code>
-// Default headers to pass in every request
-Ext.Ajax.defaultHeaders = {
- 'Powered-By': 'Ext'
-};
- * </code></pre>
- * </p>
- * <p>Common <b>Events</b> you may want to set are:<div class="mdetail-params"><ul>
- * <li><b><tt>{@link Ext.data.Connection#beforerequest beforerequest}</tt></b><p class="sub-desc"></p></li>
- * <li><b><tt>{@link Ext.data.Connection#requestcomplete requestcomplete}</tt></b><p class="sub-desc"></p></li>
- * <li><b><tt>{@link Ext.data.Connection#requestexception requestexception}</tt></b><p class="sub-desc"></p></li>
- * </ul></div>
- * <pre><code>
-// 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);
- * </code></pre>
- * </p>
- * <p>An example request:</p>
- * <pre><code>
-// 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'
-});
- * </code></pre>
- * </p>
- * @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
- * <tt>"POST"</tt>, otherwise will use <tt>"GET"</tt>.)
- * @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.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.JSON = new (function(){
var useHasOwn = !!{}.hasOwnProperty,
isNative = function() {
@@ -6824,14 +4842,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];
@@ -6900,18 +4918,7 @@ Ext.util.JSON = new (function(){
return a.join("");
};
- /**
- * <p>Encodes a Date. This returns the actual string which is inserted into the JSON string as the literal expression.
- * <b>The returned value includes enclosing double quotation marks.</b></p>
- * <p>The default return format is "yyyy-mm-ddThh:mm:ss".</p>
- * <p>To override this:</p><pre><code>
-Ext.util.JSON.encodeDate = function(d) {
- return d.format('"Y-m-d"');
-};
-</code></pre>
- * @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) + "-" +
@@ -6921,16 +4928,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);
@@ -6938,16 +4941,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);
@@ -6955,35 +4954,16 @@ 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.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,
docReadyProcId,
docReadyState = false,
- DETECT_NATIVE = Ext.isGecko || Ext.isWebKit || Ext.isSafari,
+ DETECT_NATIVE = Ext.isGecko || Ext.isWebKit || Ext.isSafari || Ext.isIE10p,
E = Ext.lib.Event,
D = Ext.lib.Dom,
DOC = document,
@@ -6991,10 +4971,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){
@@ -7006,7 +4983,7 @@ Ext.EventManager = function(){
if (el) {
if (el.getElementById || el.navigator) {
- // look up the id
+
for(; i < len; ++i){
o = specialElCache[i];
if(o.el === el){
@@ -7015,7 +4992,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,
@@ -7036,7 +5013,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),
@@ -7046,18 +5023,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);
@@ -7066,17 +5038,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;
}
@@ -7090,13 +5059,10 @@ 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()){
+ if(Ext.isIE9m && doScrollChk()){
return true;
}
if(DOC.readyState == COMPLETE){
@@ -7125,7 +5091,7 @@ Ext.EventManager = function(){
function fireDocReady(e){
if(!docReadyState){
- docReadyState = true; //only attempt listener removal once
+ docReadyState = true;
if(docReadyProcId){
clearTimeout(docReadyProcId);
@@ -7133,7 +5099,7 @@ Ext.EventManager = function(){
if(DETECT_NATIVE) {
DOC.removeEventListener(DOMCONTENTLOADED, fireDocReady, false);
}
- if(Ext.isIE && checkReadyState.bindIE){ //was this was actually set ??
+ if(Ext.isIE9m && checkReadyState.bindIE){
DOC.detachEvent('onreadystatechange', checkReadyState);
}
E.un(WINDOW, "load", arguments.callee);
@@ -7151,32 +5117,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 (Ext.isIE9m){
+
+
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);
}
@@ -7191,7 +5152,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)]);
};
}
@@ -7225,8 +5186,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);
@@ -7272,36 +5233,7 @@ 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:<ul>
- * <li>evt : EventObject<div class="sub-desc">The {@link Ext.EventObject EventObject} describing the event.</div></li>
- * <li>t : Element<div class="sub-desc">The {@link Ext.Element Element} which was the target of the event.
- * Note that this may be filtered by using the <tt>delegate</tt> option.</div></li>
- * <li>o : Object<div class="sub-desc">The options object from the addListener call.</div></li>
- * </ul>
- * @param {Object} scope (optional) The scope (<b><code>this</code></b> reference) in which the handler function is executed. <b>Defaults to the Element</b>.
- * @param {Object} options (optional) An object containing handler configuration properties.
- * This may contain any of the following properties:<ul>
- * <li>scope : Object<div class="sub-desc">The scope (<b><code>this</code></b> reference) in which the handler function is executed. <b>Defaults to the Element</b>.</div></li>
- * <li>delegate : String<div class="sub-desc">A simple selector to filter the target or look for a descendant of the target</div></li>
- * <li>stopEvent : Boolean<div class="sub-desc">True to stop the event. That is stop propagation, and prevent the default action.</div></li>
- * <li>preventDefault : Boolean<div class="sub-desc">True to prevent the default action</div></li>
- * <li>stopPropagation : Boolean<div class="sub-desc">True to prevent event propagation</div></li>
- * <li>normalized : Boolean<div class="sub-desc">False to pass a browser event to the handler function instead of an Ext.EventObject</div></li>
- * <li>delay : Number<div class="sub-desc">The number of milliseconds to delay the invocation of the handler after te event fires.</div></li>
- * <li>single : Boolean<div class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</div></li>
- * <li>buffer : Number<div class="sub-desc">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 <em>not</em> invoked, but the new handler is scheduled in its place.</div></li>
- * <li>target : Element<div class="sub-desc">Only call the handler if the event was fired on the target Element, <i>not</i> if the event was bubbled up from a child node.</div></li>
- * </ul><br>
- * <p>See {@link Ext.Element#addListener} for examples of how to use these options.</p>
- */
+
addListener : function(element, eventName, fn, scope, options){
if(typeof eventName == 'object'){
var o = eventName, e, val;
@@ -7309,10 +5241,10 @@ Ext.EventManager = function(){
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);
}
}
@@ -7322,15 +5254,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. <b>This must be a reference to the function passed into the {@link #addListener} call.</b>
- * @param {Object} scope If a scope (<b><code>this</code></b> 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),
@@ -7339,12 +5263,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();
@@ -7359,12 +5278,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);
}
@@ -7382,11 +5301,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),
@@ -7397,12 +5312,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]) {
@@ -7417,12 +5327,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);
}
@@ -7447,6 +5357,17 @@ Ext.EventManager = function(){
}
},
+ removeFromSpecialCache: function(o) {
+ var i = 0,
+ len = specialElCache.length;
+
+ for (; i < len; ++i) {
+ if (specialElCache[i].el == o) {
+ specialElCache.splice(i, 1);
+ }
+ }
+ },
+
purgeElement : function(el, recurse, eventName) {
el = Ext.getDom(el);
var id = getId(el),
@@ -7478,7 +5399,7 @@ Ext.EventManager = function(){
delete Ext.elCache;
delete Ext.Element._flyweights;
- // Abort any outstanding Ajax requests
+
var c,
conn,
tid,
@@ -7491,16 +5412,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 (<code>this</code> 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
- * <code>{single: true}</code> 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();
@@ -7515,65 +5429,65 @@ 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) (<code>this</code> reference) in which the handler function executes. <b>Defaults to the Element</b>.
- * @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. <b>This must be a reference to the function passed into the {@link #on} call.</b>
- * @param {Object} scope If a scope (<b><code>this</code></b> 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 (<code>this</code> 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
- * <code>{single: true}</code> 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 = [' ',
- Ext.isIE ? "ext-ie " + (Ext.isIE6 ? 'ext-ie6' : (Ext.isIE7 ? 'ext-ie7' : (Ext.isIE8 ? 'ext-ie8' : 'ext-ie9')))
- : Ext.isGecko ? "ext-gecko " + (Ext.isGecko2 ? 'ext-gecko2' : 'ext-gecko3')
- : Ext.isOpera ? "ext-opera"
- : Ext.isWebKit ? "ext-webkit" : ""];
+ var cls = [];
+
+ if (Ext.isIE) {
+
+ if (!Ext.isIE10p) {
+ cls.push('ext-ie');
+ }
+ if (Ext.isIE6) {
+ cls.push('ext-ie6');
+ } else if (Ext.isIE7) {
+ cls.push('ext-ie7', 'ext-ie7m');
+ } else if (Ext.isIE8) {
+ cls.push('ext-ie8', 'ext-ie8m');
+ } else if (Ext.isIE9) {
+ cls.push('ext-ie9', 'ext-ie9m');
+ } else if (Ext.isIE10) {
+ cls.push('ext-ie10');
+ }
+ }
+
+ if (Ext.isGecko) {
+ if (Ext.isGecko2) {
+ cls.push('ext-gecko2');
+ } else {
+ cls.push('ext-gecko3');
+ }
+ }
+
+ if (Ext.isOpera) {
+ cls.push('ext-opera');
+ }
+
+ if (Ext.isWebKit) {
+ cls.push('ext-webkit');
+ }
if (Ext.isSafari) {
cls.push("ext-safari " + (Ext.isSafari2 ? 'ext-safari2' : (Ext.isSafari3 ? 'ext-safari3' : 'ext-safari4')));
@@ -7588,21 +5502,21 @@ Ext.onReady = Ext.EventManager.onDocumentReady;
cls.push("ext-linux");
}
- // add to the parent to allow for selectors like ".ext-strict .ext-ie"
+
if (Ext.isStrict || Ext.isBorderBox) {
var p = bd.parentNode;
if (p) {
if (!Ext.isStrict) {
Ext.fly(p, '_internal').addClass('x-quirks');
- if (Ext.isIE && !Ext.isStrict) {
+ if (Ext.isIE9m && !Ext.isStrict) {
Ext.isIEQuirks = true;
}
}
Ext.fly(p, '_internal').addClass(((Ext.isStrict && Ext.isIE ) || (!Ext.enableForcedBoxModel && !Ext.isIE)) ? ' ext-strict' : ' ext-border-box');
}
}
- // Forced border box model class applied to all elements. Bypassing javascript based box model adjustments
- // in favor of css. This is for non-IE browsers.
+
+
if (Ext.enableForcedBoxModel && !Ext.isIE) {
Ext.isForcedBorderBox = true;
cls.push("ext-forced-border-box");
@@ -7617,25 +5531,17 @@ Ext.onReady = Ext.EventManager.onDocumentReady;
}
})();
-/**
- * Code used to detect certain browser feature/quirks/bugs at startup.
- */
+
(function(){
+
var supports = Ext.apply(Ext.supports, {
- /**
- * In Webkit, there is an issue with getting the margin right property, see
- * https://bugs.webkit.org/show_bug.cgi?id=13343
- */
+
correctRightMargin: true,
- /**
- * Webkit browsers return rgba(0, 0, 0) when a transparent color is used
- */
+
correctTransparentColor: true,
- /**
- * IE uses styleFloat, not cssFloat for the float property.
- */
+
cssFloat: true
});
@@ -7669,47 +5575,24 @@ 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.
- * <p>For example:</p>
- * <pre><code>
-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);
- </code></pre>
- * @singleton
- */
+
Ext.EventObject = function(){
var E = Ext.lib.Event,
clickRe = /(dbl)?click/,
- // 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} : {0:0,1:1,2:2};
Ext.EventObjectImpl = function(e){
@@ -7719,30 +5602,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(clickRe.test(e.type) && 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;
@@ -7757,9 +5640,7 @@ Ext.EventObject = function(){
return me;
},
- /**
- * Stop the event (preventDefault and stopPropagation)
- */
+
stopEvent : function(){
var me = this;
if(me.browserEvent){
@@ -7770,18 +5651,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){
@@ -7792,108 +5669,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:<pre><code>
- // 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!');
- }
- });
- </code></pre>
- * @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"]();
@@ -7904,20 +5732,9 @@ Ext.EventObject = function(){
};
return new Ext.EventObjectImpl();
-}();/**
- * @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],
@@ -7926,23 +5743,18 @@ Ext.Loader = Ext.apply({}, {
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 {
@@ -7955,7 +5767,7 @@ Ext.Loader = Ext.apply({}, {
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)
@@ -7966,20 +5778,13 @@ Ext.Loader = Ext.apply({}, {
}
},
- /**
- * @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 &lt;script&gt; loads, so we need to check for it here
+
if (script.readyState) {
script.onreadystatechange = function() {
if (script.readyState == "loaded" || script.readyState == "complete") {
@@ -7994,17 +5799,11 @@ Ext.Loader = Ext.apply({}, {
return script;
}
});
-/**
- * @class Ext
- */
+
Ext.ns("Ext.grid", "Ext.list", "Ext.dd", "Ext.tree", "Ext.form", "Ext.menu",
"Ext.state", "Ext.layout.boxOverflow", "Ext.app", "Ext.ux", "Ext.chart", "Ext.direct", "Ext.slider");
- /**
- * Namespace alloted for extensions to the framework.
- * @property ux
- * @type Object
- */
+
Ext.apply(Ext, function(){
var E = Ext,
@@ -8012,19 +5811,10 @@ Ext.apply(Ext, function(){
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==',
@@ -8033,47 +5823,23 @@ Ext.apply(Ext, function(){
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;
},
- /**
- * <p>Utility method for returning a default value if the passed value is empty.</p>
- * <p>The value is deemed to be empty if it is<div class="mdetail-params"><ul>
- * <li>null</li>
- * <li>undefined</li>
- * <li>an empty array</li>
- * <li>a zero length string (Unless the <tt>allowBlank</tt> parameter is <tt>true</tt>)</li>
- * </ul></div>
- * @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");
},
@@ -8082,36 +5848,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 <tt>&#64;</tt> suffix.
- * <pre><code>
-Ext.addBehaviors({
- // add a listener for click on all anchors in element with id foo
- '#foo a&#64;click' : function(e, t){
- // do something
- },
-
- // add the same listener to multiple selectors (separated by comma BEFORE the &#64;)
- '#foo a, #bar span.some-class&#64;mouseover' : function(){
- // do something
- }
-});
- * </code></pre>
- * @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);
@@ -8123,33 +5872,28 @@ Ext.addBehaviors({
}
},
- /**
- * 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('<div class="x-hide-offsets" style="width:100px;height:50px;overflow:hidden;"><div style="height:200px;"></div></div>'),
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++){
@@ -8165,23 +5909,7 @@ Ext.addBehaviors({
return r;
},
- /**
- * Copies a set of named properties fom the source object to the destination object.
- * <p>example:<pre><code>
-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');
- }
-});
- * </code></pre>
- * @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]/);
@@ -8194,16 +5922,7 @@ 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){
@@ -8218,12 +5937,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, {
}, 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]]);
@@ -8231,11 +5945,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){
@@ -8246,11 +5956,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 = {};
@@ -8264,11 +5970,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) {
@@ -8284,13 +5986,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; };
@@ -8300,13 +5996,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; };
@@ -8316,20 +6006,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) {
@@ -8338,29 +6020,7 @@ ImageComponent = Ext.extend(Ext.BoxComponent, {
return ret;
},
- /**
- * Partitions the set into two sets: a true set and a false set.
- * Example:
- * Example2:
- * <pre><code>
-// 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.
- * </code></pre>
- * @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<Array>,false<Array>]
- */
+
partition : function(arr, truth){
var ret = [[],[]];
Ext.each(arr, function(v, i, a) {
@@ -8369,18 +6029,7 @@ Ext.partition(
return ret;
},
- /**
- * Invokes a method on each item in an Array.
- * <pre><code>
-// Example:
-Ext.invoke(Ext.query("p"), "getAttribute", "id");
-// [el1.getAttribute("id"), el2.getAttribute("id"), ..., elN.getAttribute("id")]
- * </code></pre>
- * @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);
@@ -8394,16 +6043,7 @@ Ext.invoke(Ext.query("p"), "getAttribute", "id");
return ret;
},
- /**
- * Plucks the value of a property from each item in the Array
- * <pre><code>
-// Example:
-Ext.pluck(Ext.query("p"), "className"); // [el1.className, el2.className, ..., elN.className]
- * </code></pre>
- * @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) {
@@ -8412,25 +6052,7 @@ Ext.pluck(Ext.query("p"), "className"); // [el1.className, el2.className, ..., e
return ret;
},
- /**
- * <p>Zips N sets together.</p>
- * <pre><code>
-// 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"]
- * </code></pre>
- * @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],
@@ -8451,44 +6073,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, <tt>undefined</tt> if not found, or <tt>null</tt> 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:<div class="mdetail-params"><ul>
- * <li><b>string</b>: If the object passed is a string</li>
- * <li><b>number</b>: If the object passed is a number</li>
- * <li><b>boolean</b>: If the object passed is a boolean value</li>
- * <li><b>date</b>: If the object passed is a Date object</li>
- * <li><b>function</b>: If the object passed is a function reference</li>
- * <li><b>object</b>: If the object passed is an object</li>
- * <li><b>array</b>: If the object passed is an array</li>
- * <li><b>regexp</b>: If the object passed is a regular expression</li>
- * <li><b>element</b>: If the object passed is a DOM Element</li>
- * <li><b>nodelist</b>: If the object passed is a DOM NodeList</li>
- * <li><b>textnode</b>: If the object passed is a DOM text node and contains something other than whitespace</li>
- * <li><b>whitespace</b>: If the object passed is a DOM text node and contains only whitespace</li>
- * </ul></div>
- * @param {Mixed} object
- * @return {String}
- */
+
+
type : function(o){
if(o === undefined || o === null){
return false;
@@ -8520,7 +6114,7 @@ Ext.zip(
o[name] = o[name].createInterceptor(fn, scope);
},
- // internal
+
callback : function(cb, scope, args, delay){
if(typeof cb == 'function'){
if(delay){
@@ -8533,33 +6127,9 @@ 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:
- * <pre><code>
-var sayHi = function(name){
- alert('Hi, ' + name);
-}
-
-sayHi('Fred'); // alerts "Hi, Fred"
-var sayGoodbye = sayHi.createSequence(function(name){
- alert('Bye, ' + name);
-});
+Ext.apply(Function.prototype, {
-sayGoodbye('Fred'); // both alerts show
-</code></pre>
- * @param {Function} fcn The function to sequence
- * @param {Object} scope (optional) The scope (<code><b>this</b></code> reference) in which the passed function is executed.
- * <b>If omitted, defaults to the scope in which the original function is called or the browser window.</b>
- * @return {Function} The new function
- */
createSequence : function(fcn, scope){
var method = this;
return (typeof fcn != 'function') ?
@@ -8573,35 +6143,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:
- * <pre><code>
-var s = String.leftPad('123', 5, '0');
-// s now contains the string: '00123'
- * </code></pre>
- * @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) {
@@ -8614,64 +6164,27 @@ 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.
- * <pre><code>
-// alternate sort directions
-sort = sort.toggle('ASC', 'DESC');
-// instead of conditional logic:
-sort = (sort == 'ASC' ? 'DESC' : 'ASC');
-</code></pre>
- * @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:
- * <pre><code>
-var s = ' foo bar ';
-alert('-' + s + '-'); //alerts "- foo bar -"
-alert('-' + s.trim() + '-'); //alerts "-foo bar-"
-</code></pre>
- * @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);
}
@@ -8705,10 +6218,10 @@ Ext.lib.Dom.getRegion = function(el) {
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);
+ 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);
@@ -8717,10 +6230,10 @@ Ext.lib.Dom.getRegion = function(el) {
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);
+ 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);
},
@@ -8746,10 +6259,10 @@ Ext.lib.Dom.getRegion = function(el) {
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];
+ 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) {
@@ -8763,9 +6276,7 @@ Ext.lib.Dom.getRegion = function(el) {
};
Ext.lib.Point.prototype = new Ext.lib.Region();
-/**
- * @class Ext.DomHelper
- */
+
Ext.apply(Ext.DomHelper,
function(){
var pub,
@@ -8775,7 +6286,7 @@ function(){
beforeend = 'beforeend',
confRe = /tag|children|cn|html$/i;
- // private
+
function doInsert(el, o, returnElement, pos, sibling, append){
el = Ext.getDom(el);
var newNode;
@@ -8792,8 +6303,8 @@ function(){
return returnElement ? Ext.get(newNode, true) : newNode;
}
- // build as dom
- /** @ignore */
+
+
function createDom(o, parentNode){
var el,
doc = document,
@@ -8802,16 +6313,16 @@ function(){
val,
cn;
- if (Ext.isArray(o)) { // Allow Arrays of siblings to be inserted
- el = doc.createDocumentFragment(); // in one shot using a DocumentFragment
+ 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') { // Allow a string as a child spec.
+ } 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
+ useSet = !!el.setAttribute;
for (var attr in o) {
if(!confRe.test(attr)){
val = o[attr];
@@ -8841,111 +6352,47 @@ function(){
}
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,
- /**
- * 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);
},
- /**
- * 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');
},
- /**
- * 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');
},
- /**
- * 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){
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
- */
+
Ext.apply(Ext.Template.prototype, {
- /**
- * @cfg {Boolean} disableFormats Specify <tt>true</tt> to disable format
- * functions in the template. If the template does not contain
- * {@link Ext.util.Format format functions}, setting <code>disableFormats</code>
- * to true will reduce <code>{@link #apply}</code> time. Defaults to <tt>false</tt>.
- * <pre><code>
-var t = new Ext.Template(
- '&lt;div name="{id}"&gt;',
- '&lt;span class="{cls}"&gt;{name} {value}&lt;/span&gt;',
- '&lt;/div&gt;',
- {
- compiled: true, // {@link #compile} immediately
- disableFormats: true // reduce <code>{@link #apply}</code> time since no formatting
- }
-);
- * </code></pre>
- * For a list of available format functions, see {@link Ext.util.Format}.
- */
+
disableFormats : false,
- /**
- * See <code>{@link #disableFormats}</code>.
- * @type Boolean
- * @property disableFormats
- */
- /**
- * The regular expression used to match template variables
- * @type RegExp
- * @property
- * @hide repeat doc
- */
+
+
re : /\{([\w\-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,
argsRe : /^\s*['"](.*)["']\s*$/,
compileARe : /\\/g,
@@ -9245,7 +6692,7 @@ Ext.defer = Ext.util.Functions.defer;
* <b>If omitted, defaults to the scope in which the original function is called or the browser window.</b>
* @return {Function} The new function
* @member Ext
- * @method defer
+ * @method createInterceptor
*/
Ext.createInterceptor = Ext.util.Functions.createInterceptor;
@@ -9258,7 +6705,7 @@ Ext.createInterceptor = Ext.util.Functions.createInterceptor;
* If omitted, defaults to the scope in which the original function is called or the browser window.
* @return {Function} The new function
* @member Ext
- * @method defer
+ * @method createSequence
*/
Ext.createSequence = Ext.util.Functions.createSequence;
@@ -9273,7 +6720,7 @@ Ext.createSequence = Ext.util.Functions.createSequence;
* if a number the args are inserted at the specified position
* @return {Function} The new function
* @member Ext
- * @method defer
+ * @method createDelegate
*/
Ext.createDelegate = Ext.util.Functions.createDelegate;
/**
@@ -9407,12 +6854,12 @@ Ext.apply(Ext.util.Observable.prototype, function(){
* access the required target more quickly.</p>
* <p>Example:</p><pre><code>
Ext.override(Ext.form.Field, {
- // Add functionality to Field&#39;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&#39;s events to bubble directly to the FormPanel.
+
getBubbleTarget : function() {
if (!this.formPanel) {
this.formPanel = this.findParentByType('form');
@@ -9428,7 +6875,7 @@ var myForm = new Ext.formPanel({
}],
listeners: {
change: function() {
- // Title goes red if form has been modified.
+
myForm.header.setStyle('color', 'red');
}
}
@@ -9456,34 +6903,13 @@ var myForm = new Ext.formPanel({
}());
-/**
- * Starts capture on the specified Observable. All events will be passed
- * to the supplied function with the event name + standard signature of the event
- * <b>before</b> 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 (<code>this</code> 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.<p>
- * <p>This makes any event fired on any instance of the passed class also fire a single event through
- * the <i>class</i> allowing for central handling of events on many instances at once.</p>
- * <p>Usage:</p><pre><code>
-Ext.util.Observable.observeClass(Ext.data.Connection);
-Ext.data.Connection.on('beforerequest', function(con, options) {
- console.log('Ajax request made to ' + options.url);
-});</code></pre>
- * @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){
@@ -9496,9 +6922,7 @@ Ext.util.Observable.observeClass = function(c, listeners){
return c;
}
};
-/**
-* @class Ext.EventManager
-*/
+
Ext.apply(Ext.EventManager, function(){
var resizeEvent,
resizeTask,
@@ -9509,9 +6933,9 @@ Ext.apply(Ext.EventManager, function(){
unload = Ext.EventManager._unload,
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);
@@ -9522,24 +6946,18 @@ Ext.apply(Ext.EventManager, function(){
unload.call(Ext.EventManager);
},
- // 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 (<code>this</code> 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();
@@ -9549,19 +6967,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 (<code>this</code> 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();
@@ -9579,41 +6992,33 @@ 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, short accessor for useKeydown
+
getKeyEvent : function(){
return useKeydown ? 'keydown' : 'keypress';
},
- // protected for use inside the framework
- // detects whether we should use keydown or keypress based on the browser.
+
+
useKeydown: useKeydown
};
}());
@@ -9622,189 +7027,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;
@@ -9814,32 +7219,22 @@ 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
- */
+});
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) {
@@ -9859,26 +7254,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,
@@ -9903,11 +7286,7 @@ 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 updateManager = this.getUpdater();
updateManager.update.apply(updateManager, arguments);
@@ -9915,21 +7294,12 @@ Ext.Element.addMethods({
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;
@@ -9995,20 +7365,14 @@ 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 = (typeof config == 'object') ? config : {tag : "div", cls: config};
@@ -10016,7 +7380,7 @@ Ext.Element.addMethods({
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;
@@ -10024,63 +7388,42 @@ 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 || {};
var me = this,
- vp = me.dom == document.body || me.dom == document,
- w = s.width || vp ? Ext.lib.Dom.getViewWidth() : me.getWidth(),
- h = s.height || vp ? Ext.lib.Dom.getViewHeight() : me.getHeight(),
- xy,
- r = Math.round,
- o = me.getXY(),
- scroll = me.getScroll(),
- extraX = vp ? scroll.left : !local ? o[0] : 0,
- extraY = vp ? scroll.top : !local ? o[1] : 0,
- hash = {
- c : [r(w * 0.5), r(h * 0.5)],
- t : [r(w * 0.5), 0],
- l : [0, r(h * 0.5)],
- r : [w, r(h * 0.5)],
- b : [r(w * 0.5), h],
- tl : [0, 0],
- bl : [0, h],
- br : [w, h],
- tr : [w, 0]
- };
+ vp = me.dom == document.body || me.dom == document,
+ w = s.width || vp ? Ext.lib.Dom.getViewWidth() : me.getWidth(),
+ h = s.height || vp ? Ext.lib.Dom.getViewHeight() : me.getHeight(),
+ xy,
+ r = Math.round,
+ o = me.getXY(),
+ scroll = me.getScroll(),
+ extraX = vp ? scroll.left : !local ? o[0] : 0,
+ extraY = vp ? scroll.top : !local ? o[1] : 0,
+ hash = {
+ c : [r(w * 0.5), r(h * 0.5)],
+ t : [r(w * 0.5), 0],
+ l : [0, r(h * 0.5)],
+ r : [w, r(h * 0.5)],
+ b : [r(w * 0.5), h],
+ tl : [0, 0],
+ bl : [0, h],
+ br : [w, h],
+ tr : [w, 0]
+ };
xy = hash[anchor];
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,
@@ -10091,7 +7434,7 @@ Ext.Element.addMethods({
},
anchor = this.getAnchor();
- // previous listener anchor, remove it
+
this.removeAnchor();
Ext.apply(anchor, {
fn: action,
@@ -10104,14 +7447,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();
@@ -10126,7 +7466,7 @@ Ext.Element.addMethods({
return me;
},
- // private
+
getAnchor : function(){
var data = Ext.Element.data,
dom = this.dom;
@@ -10141,14 +7481,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);
@@ -10160,32 +7493,32 @@ Ext.Element.addMethods({
p = (!p || p == "?" ? "tl-bl?" : (!(/-/).test(p) && p !== "" ? "tl-" + p : p || "tl-bl")).toLowerCase();
var me = this,
- d = me.dom,
- a1,
- 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
- p1y,
- p1x,
- p2y,
- p2x,
- swapY,
- swapX,
- doc = document,
- docElement = doc.documentElement,
- docBody = doc.body,
- scrollX = (docElement.scrollLeft || docBody.scrollLeft || 0)+5,
- scrollY = (docElement.scrollTop || docBody.scrollTop || 0)+5,
- c = false, //constrain to viewport
- p1 = "",
- p2 = "",
- m = p.match(/^([a-z]+)-([a-z]+)(\?)?$/);
+ d = me.dom,
+ a1,
+ a2,
+ x,
+ y,
+
+ w,
+ h,
+ r,
+ dw = Ext.lib.Dom.getViewWidth() -10,
+ dh = Ext.lib.Dom.getViewHeight()-10,
+ p1y,
+ p1x,
+ p2y,
+ p2x,
+ swapY,
+ swapX,
+ doc = document,
+ docElement = doc.documentElement,
+ docBody = doc.body,
+ scrollX = (docElement.scrollLeft || docBody.scrollLeft || 0)+5,
+ scrollY = (docElement.scrollTop || docBody.scrollTop || 0)+5,
+ c = false,
+ p1 = "",
+ p2 = "",
+ m = p.match(/^([a-z]+)-([a-z]+)(\?)?$/);
if(!m){
throw "Element.alignTo with an invalid alignment " + p;
@@ -10195,8 +7528,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);
@@ -10207,9 +7540,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);
@@ -10234,69 +7567,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:
- * <ul>
- * <li><b>Blank</b>: Defaults to aligning the element's top-left corner to the target's bottom-left corner ("tl-bl").</li>
- * <li><b>One anchor (deprecated)</b>: 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. <i>This method has been
- * deprecated in favor of the newer two anchor syntax below</i>.</li>
- * <li><b>Two anchors</b>: 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.</li>
- * </ul>
- * 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:
-<pre>
-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
-</pre>
-Example Usage:
-<pre><code>
-// 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]);
-</code></pre>
- * @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);
+ 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};
@@ -10334,10 +7617,10 @@ el.alignTo("other-el", "c-bl", [-6, 0]);
w = this.dom.offsetWidth + offset,
h = this.dom.offsetHeight + offset;
- // only move it if it needs it
+
var moved = false;
- // first validate right/bottom
+
if((x + w) > vr){
x = vr - w;
moved = true;
@@ -10346,7 +7629,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;
@@ -10361,112 +7644,91 @@ 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;
-// },
-
- // private, used internally
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
getConstrainOffset : function(){
return 0;
},
- /**
- * 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({
- /**
- * 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.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,
+ rt,
isAfter = (where || 'before').toLowerCase() == 'after',
insertEl;
@@ -10498,37 +7760,22 @@ Ext.apply(Ext.Element.prototype, function() {
return rt;
}
};
-}());/**
- * @class Ext.Element
- */
+}());
+
-// special markup used throughout Ext when box wrapping elements
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>';
Ext.Element.addMethods(function(){
var INTERNAL = "_internal",
pxMatch = /(\d+\.?\d+)px/;
return {
- /**
- * More flexible version of {@link #setStyle} for setting style properties.
- * @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.
- * @return {Ext.Element} this
- */
+
applyStyles : function(style){
Ext.DomHelper.applyStyles(this.dom, style);
return this;
},
- /**
- * Returns an object with properties matching the styles requested.
- * For example, el.getStyles('color', 'font-size', 'width') might return
- * {'color': '#FFFFFF', 'font-size': '13px', 'width': '100px'}.
- * @param {String} style1 A style name
- * @param {String} style2 A style name
- * @param {String} etc.
- * @return {Object} The style object
- */
+
getStyles : function(){
var ret = {};
Ext.each(arguments, function(v) {
@@ -10538,10 +7785,10 @@ Ext.Element.addMethods(function(){
return ret;
},
- // private ==> 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{
@@ -10549,58 +7796,18 @@ Ext.Element.addMethods(function(){
}
},
- /**
- * <p>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.</p>
- * <p>This special markup is used throughout Ext when box wrapping elements ({@link Ext.Button},
- * {@link Ext.Panel} when <tt>{@link Ext.Panel#frame frame=true}</tt>, {@link Ext.Window}). The markup
- * is of this form:</p>
- * <pre><code>
- Ext.Element.boxMarkup =
- &#39;&lt;div class="{0}-tl">&lt;div class="{0}-tr">&lt;div class="{0}-tc">&lt;/div>&lt;/div>&lt;/div>
- &lt;div class="{0}-ml">&lt;div class="{0}-mr">&lt;div class="{0}-mc">&lt;/div>&lt;/div>&lt;/div>
- &lt;div class="{0}-bl">&lt;div class="{0}-br">&lt;div class="{0}-bc">&lt;/div>&lt;/div>&lt;/div>&#39;;
- * </code></pre>
- * <p>Example usage:</p>
- * <pre><code>
- // 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");
- * </code></pre>
- * @param {String} class (optional) A base CSS class to apply to the containing wrapper element
- * (defaults to <tt>'x-box'</tt>). 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", "<div class='" + cls + "'>" + String.format(Ext.Element.boxMarkup, cls) + "</div>")); //String.format('<div class="{0}">'+Ext.Element.boxMarkup+'</div>', cls)));
+ var el = Ext.get(this.insertHtml("beforeBegin", "<div class='" + cls + "'>" + String.format(Ext.Element.boxMarkup, cls) + "</div>"));
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:<div class="mdetail-params"><ul>
- * <li>A Number specifying the new width in this Element's {@link #defaultUnit}s (by default, pixels).</li>
- * <li>A String used to set the CSS width style. Animation may <b>not</b> be used.
- * <li>A size object in the format <code>{width: widthValue, height: heightValue}</code>.</li>
- * </ul></div>
- * @param {Mixed} height The new height. This may be one of:<div class="mdetail-params"><ul>
- * <li>A Number specifying the new height in this Element's {@link #defaultUnit}s (by default, pixels).</li>
- * <li>A String used to set the CSS height style. Animation may <b>not</b> be used.</li>
- * </ul></div>
- * @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(typeof width == 'object'){ // in case of object from getSize()
+ if(typeof width == 'object'){
height = width.height;
width = width.width;
}
@@ -10615,12 +7822,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);
@@ -10633,12 +7835,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){
@@ -10650,21 +7847,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(){
@@ -10677,11 +7865,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);
@@ -10692,11 +7876,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(){
@@ -10711,32 +7891,14 @@ Ext.Element.addMethods(function(){
return this;
},
- /**
- * <p>Returns the dimensions of the element available to lay content out in.<p>
- * <p>If the element (or any ancestor element) has CSS style <code>display : none</code>, the dimensions will be zero.</p>
- * example:<pre><code>
- 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.
- * </code></pre>
- *
- * 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 {
@@ -10744,7 +7906,7 @@ Ext.Element.addMethods(function(){
height : extdom.getViewHeight()
};
- // Else use clientHeight/clientWidth
+
} else {
return {
width : d.clientWidth,
@@ -10753,14 +7915,7 @@ Ext.Element.addMethods(function(){
}
},
- /**
- * <p>Returns the dimensions of the element available to lay content out in.<p>
- *
- * 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,
@@ -10770,7 +7925,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 {
@@ -10778,37 +7933,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");
@@ -10818,23 +7966,14 @@ 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).
- applyStyles("-moz-user-select:none;-khtml-user-select:none;").
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,
@@ -10852,21 +7991,13 @@ Ext.Element.addMethods(function(){
}
};
}());
-/**
- * @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,
- h = box.height;
+ w = box.width,
+ h = box.height;
if((adjust && !me.autoBoxAdjust) && !me.isBorderBox()){
w -= (me.getBorderWidth("lr") + me.getPadding("lr"));
h -= (me.getBorderWidth("tb") + me.getPadding("tb"));
@@ -10875,35 +8006,18 @@ 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<pre><code>
-{
- x: &lt;Element's X position>,
- y: &lt;Element's Y position>,
- width: &lt;Element's width>,
- height: &lt;Element's height>,
- bottom: &lt;Element's lower bound>,
- right: &lt;Element's rightmost bound>
-}
-</code></pre>
- * 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,
- left,
- top,
- getBorderWidth = me.getBorderWidth,
- getPadding = me.getPadding,
- l,
- r,
- t,
- b;
+ xy,
+ left,
+ top,
+ getBorderWidth = me.getBorderWidth,
+ getPadding = me.getPadding,
+ l,
+ r,
+ t,
+ b;
if(!local){
xy = me.getXY();
}else{
@@ -10926,77 +8040,48 @@ 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(),
- x = xy[0],
- y = xy[1],
- left = [x - distance, y],
- right = [x + distance, y],
- top = [x, y - distance],
- bottom = [x, y + distance],
- hash = {
- l : left,
- left : left,
- r : right,
- right : right,
- t : top,
- top : top,
- up : top,
- b : bottom,
- bottom : bottom,
- down : bottom
+ xy = me.getXY(),
+ x = xy[0],
+ y = xy[1],
+ left = [x - distance, y],
+ right = [x + distance, y],
+ top = [x, y - distance],
+ bottom = [x, y + distance],
+ hash = {
+ l : left,
+ left : left,
+ r : right,
+ right : right,
+ t : top,
+ top : top,
+ up : top,
+ b : bottom,
+ bottom : bottom,
+ down : bottom
};
- direction = direction.toLowerCase();
- me.moveTo(hash[direction][0], hash[direction][1], me.animTest.call(me, arguments, animate, 2));
+ direction = direction.toLowerCase();
+ 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;
+ style = me.dom.style;
style.left = me.addUnits(left);
style.top = me.addUnits(top);
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:<div class="mdetail-params"><ul>
- * <li>A Number specifying the new width in this Element's {@link #defaultUnit}s (by default, pixels)</li>
- * <li>A String used to set the CSS width style. Animation may <b>not</b> be used.
- * </ul></div>
- * @param {Mixed} height The new height. This may be one of:<div class="mdetail-params"><ul>
- * <li>A Number specifying the new height in this Element's {@link #defaultUnit}s (by default, pixels)</li>
- * <li>A String used to set the CSS height style. Animation may <b>not</b> be used.</li>
- * </ul></div>
- * @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) {
@@ -11004,60 +8089,41 @@ Ext.Element.addMethods({
me.setLocation(x, y);
} else {
me.anim({points: {to: [x, y]},
- width: {to: me.adjustWidth(width)},
- height: {to: me.adjustHeight(height)}},
+ width: {to: me.adjustWidth(width)},
+ height: {to: me.adjustHeight(height)}},
me.preanim(arguments, 4),
'motion');
}
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({
- /**
- * 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) {
- //check if we're scrolling top or left
+
var top = /top/i.test(side),
me = this,
dom = me.dom,
prop;
if (!animate || !me.anim) {
- // just setting the value, so grab the direction
+
prop = 'scroll' + (top ? 'Top' : 'Left');
dom[prop] = value;
}
else {
- // 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,
@@ -11078,7 +8144,7 @@ Ext.Element.addMethods({
else if (b > cb) {
c.scrollTop = b-ch;
}
- // corrects IE, other browsers will ignore
+
c.scrollTop = c.scrollTop;
if (hscroll !== false) {
@@ -11093,20 +8159,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 false;
@@ -11132,9 +8190,7 @@ Ext.Element.addMethods({
}
return scrolled;
}
-});/**
- * @class Ext.Element
- */
+});
Ext.Element.addMethods(
function() {
var VISIBILITY = "visibility",
@@ -11146,11 +8202,7 @@ Ext.Element.addMethods(
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;
@@ -11168,19 +8220,12 @@ Ext.Element.addMethods(
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);
@@ -11191,13 +8236,7 @@ Ext.Element.addMethods(
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,
@@ -11231,7 +8270,7 @@ Ext.Element.addMethods(
mm.center(me);
}
- // ie will not expand full height automatically
+
if (Ext.isIE && !(Ext.isIE7 && Ext.isStrict) && me.getStyle('height') == 'auto') {
mask.setSize(undefined, me.getHeight());
}
@@ -11239,9 +8278,7 @@ Ext.Element.addMethods(
return mask;
},
- /**
- * Removes a previously applied mask.
- */
+
unmask : function() {
var me = this,
dom = me.dom,
@@ -11260,20 +8297,13 @@ Ext.Element.addMethods(
}
},
- /**
- * 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;
@@ -11287,18 +8317,9 @@ Ext.Element.addMethods(
}
};
}()
-);/**
- * @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:
- * <code>{key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}</code>
- * @param {Function} fn The function to call
- * @param {Object} scope (optional) The scope (<code>this</code> 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(typeof key != 'object' || Ext.isArray(key)){
@@ -11320,21 +8341,15 @@ 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);
}
});
-//Import the newly-added Ext.Element functions into CompositeElementLite. We call this here because
-//Element.keys.js is the last extra Ext.Element include in the ext-all.js build
-Ext.CompositeElementLite.importElementMethods();/**
- * @class Ext.CompositeElementLite
- */
+
+
+Ext.CompositeElementLite.importElementMethods();
Ext.apply(Ext.CompositeElementLite.prototype, {
addElements : function(els, root){
if(!els){
@@ -11350,38 +8365,22 @@ Ext.apply(Ext.CompositeElementLite.prototype, {
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,
@@ -11401,27 +8400,7 @@ Ext.apply(Ext.CompositeElementLite.prototype, {
return this;
}
});
-/**
- * @class Ext.CompositeElement
- * @extends Ext.CompositeElementLite
- * <p>This class encapsulates a <i>collection</i> of DOM elements, providing methods to filter
- * members, or to perform collective actions upon the whole set.</p>
- * <p>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.</p>
- * <p>All methods return <i>this</i> and can be chained.</p>
- * Usage:
-<pre><code>
-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);
-</code></pre>
- */
Ext.CompositeElement = Ext.extend(Ext.CompositeElementLite, {
constructor : function(els, root){
@@ -11429,59 +8408,25 @@ Ext.CompositeElement = Ext.extend(Ext.CompositeElementLite, {
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 <code>element</code> in this <code>composite</code>
- * calling the supplied function using {@link Ext#each}.
- * @param {Function} fn The function to be called with each
- * <code>element</code>. If the supplied function returns <tt>false</tt>,
- * iteration stops. This function is called with the following arguments:
- * <div class="mdetail-params"><ul>
- * <li><code>element</code> : <i>Ext.Element</i><div class="sub-desc">The element at the current <code>index</code>
- * in the <code>composite</code></div></li>
- * <li><code>composite</code> : <i>Object</i> <div class="sub-desc">This composite.</div></li>
- * <li><code>index</code> : <i>Number</i> <div class="sub-desc">The current index within the <code>composite</code> </div></li>
- * </ul></div>
- * @param {Object} scope (optional) The scope (<code><this</code> reference) in which the specified function is executed.
- * Defaults to the <code>element</code> at the current <code>index</code>
- * 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"){
@@ -11495,68 +8440,20 @@ 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
- * @method select
- */
-Ext.select = Ext.Element.select;/**
- * @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.<br><br>
- * Usage:<br>
- * <pre><code>
- * 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");
- * <br>
- * // 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);
- * <br>
- * // short handed call directly from the element object
- * Ext.get("foo").load({
- url: "bar.php",
- scripts: true,
- params: "param1=foo&amp;param2=bar",
- text: "Loading Foo..."
- * });
- * </code></pre>
- * @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.select = Ext.Element.select;
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){}
}
@@ -11569,7 +8466,7 @@ function() {
}
}
- // private
+
function updateComplete(response, type, success){
this.fireEvent(type || UPDATE, this.el, response);
if(Ext.isFunction(response.argument.callback)){
@@ -11577,7 +8474,7 @@ function() {
}
}
- // private
+
function processFailure(response){
updateComplete.call(this, response, FAILURE, !!(this.transaction = null));
}
@@ -11589,207 +8486,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 <b>asynchronous</b> request, updating this element with the response.
- * If params are specified it uses POST, otherwise it uses GET.<br><br>
- * <b>Note:</b> 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 <b><code>update</code></b> event handler.
- * @param {Object} options A config object containing any of the following options:<ul>
- * <li>url : <b>String/Function</b><p class="sub-desc">The URL to request or a function which
- * <i>returns</i> the URL (defaults to the value of {@link Ext.Ajax#url} if not specified).</p></li>
- * <li>method : <b>String</b><p class="sub-desc">The HTTP method to
- * use. Defaults to POST if the <code>params</code> argument is present, otherwise GET.</p></li>
- * <li>params : <b>String/Object/Function</b><p class="sub-desc">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.</p></li>
- * <li>scripts : <b>Boolean</b><p class="sub-desc">If <code>true</code>
- * any &lt;script&gt; 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 <i>after</i> the execution of the scripts.</p></li>
- * <li>callback : <b>Function</b><p class="sub-desc">A function to
- * be called when the response from the server arrives. The following
- * parameters are passed:<ul>
- * <li><b>el</b> : Ext.Element<p class="sub-desc">The Element being updated.</p></li>
- * <li><b>success</b> : Boolean<p class="sub-desc">True for success, false for failure.</p></li>
- * <li><b>response</b> : XMLHttpRequest<p class="sub-desc">The XMLHttpRequest which processed the update.</p></li>
- * <li><b>options</b> : Object<p class="sub-desc">The config object passed to the update call.</p></li></ul>
- * </p></li>
- * <li>scope : <b>Object</b><p class="sub-desc">The scope in which
- * to execute the callback (The callback's <code>this</code> reference.) If the
- * <code>params</code> argument is a function, this scope is used for that function also.</p></li>
- * <li>discardUrl : <b>Boolean</b><p class="sub-desc">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 <code>discardUrl:true</code> (defaults to false).</p></li>
- * <li>timeout : <b>Number</b><p class="sub-desc">The number of seconds to wait for a response before
- * timing out (defaults to {@link Ext.Updater.defaults#timeout}).</p></li>
- * <li>text : <b>String</b><p class="sub-desc">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.</p></li>
- * <li>nocache : <b>Boolean</b><p class="sub-desc">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}).</p></li></ul>
- * <p>
- * For example:
- <pre><code>
- 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.
- });
- </code></pre>
- */
+
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;
@@ -11833,28 +8599,7 @@ function() {
}
},
- /**
- * <p>Performs an asynchronous form post, updating this element with the response. If the form has the attribute
- * enctype="<a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form-data</a>", it assumes it's a file upload.
- * Uses this.sslBlankUrl for SSL file uploads to prevent IE security warning.</p>
- * <p>File uploads are not performed using normal "Ajax" techniques, that is they are <b>not</b>
- * performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the
- * DOM <code>&lt;form></code> element temporarily modified to have its
- * <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer
- * to a dynamically generated, hidden <code>&lt;iframe></code> which is inserted into the document
- * but removed after the return data has been gathered.</p>
- * <p>Be aware that file upload packets, sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form-data</a>
- * and some server technologies (notably JEE) may require some custom processing in order to
- * retrieve parameter names and parameter values from the packet content.</p>
- * @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:<ul>
- * <li><b>el</b> : Ext.Element<p class="sub-desc">The Element being updated.</p></li>
- * <li><b>success</b> : Boolean<p class="sub-desc">True for success, false for failure.</p></li>
- * <li><b>response</b> : XMLHttpRequest<p class="sub-desc">The XMLHttpRequest which processed the update.</p></li></ul>
- */
+
formUpdate : function(form, url, reset, callback){
var me = this;
if(me.fireEvent(BEFOREUPDATE, me.el, form, url) !== false){
@@ -11880,18 +8625,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
- * "&param1=1&param2=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){
@@ -11903,9 +8637,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);
@@ -11913,44 +8645,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);
@@ -11959,212 +8678,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 '&lt;div class="loading-indicator"&gt;Loading...&lt;/div&gt;').
- * @type String
- */
+
indicatorText : '<div class="loading-indicator">Loading...</div>',
- /**
- * 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. <b>This method is deprecated in favor of el.load({url:'foo.php', ...})</b>.
- * Usage:
- * <pre><code>Ext.Updater.updateElement("my-div", "stuff.php");</code></pre>
- * @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
- * <p>This class is a base class implementing a simple render method which updates an element using results from an Ajax request.</p>
- * <p>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.</p>
- */
+
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
- * <a href="http://www.php.net/date">PHP's date() function</a>, and the formats that are
- * supported will provide results equivalent to their PHP versions.
- *
- * The following is a list of all currently supported formats:
- * <pre>
-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)\/
-</pre>
- *
- * Example usage (note that you must escape format specifiers with '\\' to render them as character literals):
- * <pre><code>
-// 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
-</code></pre>
- *
- * 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.
- * <pre><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"
};
-</code></pre>
- *
- * Example usage:
- * <pre><code>
-var dt = new Date();
-document.write(dt.format(Date.patterns.ShortDate));
-</code></pre>
- * <p>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}.</p>
- */
-/*
- * 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 <tt>false</tt>.
- * @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) {
@@ -12173,14 +8731,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({
@@ -12188,40 +8746,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, {
- /**
- * <p>An object hash in which each property is a date parsing function. The property name is the
- * format string which that function parses.</p>
- * <p>This object is automatically populated with date parsing functions as
- * date formats are requested for Ext standard formatting strings.</p>
- * <p>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}.<p>
- * <p>Example:</p><pre><code>
-Date.parseFunctions['x-date-format'] = myDateParser;
-</code></pre>
- * <p>A parsing function should return a Date object, and is passed the following parameters:<div class="mdetail-params"><ul>
- * <li><code>date</code> : String<div class="sub-desc">The date string to parse.</div></li>
- * <li><code>strict</code> : Boolean<div class="sub-desc">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.</div></li>
- * </ul></div></p>
- * <p>To enable Dates to also be <i>formatted</i> 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;
@@ -12229,126 +8766,41 @@ Date.parseFunctions['x-date-format'] = myDateParser;
},
parseRegexes: [],
- /**
- * <p>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.</p>
- * <p>This object is automatically populated with date formatting functions as
- * date formats are requested for Ext standard formatting strings.</p>
- * <p>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:</p><pre><code>
-Date.formatFunctions['x-date-format'] = myDateFormatter;
-</code></pre>
- * <p>A formatting function should return a string representation of the passed Date object, and is passed the following parameters:<div class="mdetail-params"><ul>
- * <li><code>date</code> : Date<div class="sub-desc">The Date to format.</div></li>
- * </ul></div></p>
- * <p>To enable date strings to also be <i>parsed</i> 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",
- /**
- * <p>An object hash containing default date values used during date parsing.</p>
- * <p>The following properties are available:<div class="mdetail-params"><ul>
- * <li><code>y</code> : Number<div class="sub-desc">The default year value. (defaults to undefined)</div></li>
- * <li><code>m</code> : Number<div class="sub-desc">The default 1-based month value. (defaults to undefined)</div></li>
- * <li><code>d</code> : Number<div class="sub-desc">The default day value. (defaults to undefined)</div></li>
- * <li><code>h</code> : Number<div class="sub-desc">The default hour value. (defaults to undefined)</div></li>
- * <li><code>i</code> : Number<div class="sub-desc">The default minute value. (defaults to undefined)</div></li>
- * <li><code>s</code> : Number<div class="sub-desc">The default second value. (defaults to undefined)</div></li>
- * <li><code>ms</code> : Number<div class="sub-desc">The default millisecond value. (defaults to undefined)</div></li>
- * </ul></div></p>
- * <p>Override these properties to customize the default date values used by the {@link #parseDate} method.</p>
- * <p><b>Note: In countries which experience Daylight Saving Time (i.e. DST), the <tt>h</tt>, <tt>i</tt>, <tt>s</tt>
- * and <tt>ms</tt> properties may coincide with the exact time in which DST takes effect.
- * It is the responsiblity of the developer to account for this.</b></p>
- * Example Usage:
- * <pre><code>
-// 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
-</code></pre>
- * @property defaults
- * @static
- * @type Object
- */
defaults: {},
- /**
- * An array of textual day names.
- * Override these values for international dates.
- * Example:
- * <pre><code>
-Date.dayNames = [
- 'SundayInYourLang',
- 'MondayInYourLang',
- ...
-];
-</code></pre>
- * @type Array
- * @static
- */
+
dayNames : [
"Sunday",
"Monday",
@@ -12359,20 +8811,7 @@ Date.dayNames = [
"Saturday"
],
- /**
- * An array of textual month names.
- * Override these values for international dates.
- * Example:
- * <pre><code>
-Date.monthNames = [
- 'JanInYourLang',
- 'FebInYourLang',
- ...
-];
-</code></pre>
- * @type Array
- * @static
- */
+
monthNames : [
"January",
"February",
@@ -12388,20 +8827,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:
- * <pre><code>
-Date.monthNumbers = {
- 'ShortJanNameInYourLang':0,
- 'ShortFebNameInYourLang':1,
- ...
-};
-</code></pre>
- * @type Object
- * @static
- */
+
monthNumbers : {
Jan:0,
Feb:1,
@@ -12417,46 +8843,23 @@ 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()];
},
- /**
- * Checks if the specified format contains hour information
- * @param {Object} format The format to check
- * @return {Boolean} True if the format contains hour information
- * @static
- */
+
formatContainsHourInfo : (function(){
var stripEscapeRe = /(\\.)/g,
hourInfoRe = /([gGhHisucUOPZ]|M\$)/;
@@ -12465,24 +8868,10 @@ Date.monthNumbers = {
};
})(),
- /**
- * 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:
- * <pre><code>
-Date.formatCodes.x = "String.leftPad(this.getDate(), 2, '0')";
-(new Date()).format("X"); // returns the current day of the month
-</code></pre>
- * @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)",
@@ -12492,7 +8881,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)",
@@ -12513,51 +8902,27 @@ 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;
ms = ms || 0;
- // Special handling for year < 100
+
var dt = new Date(y < 100 ? 100 : y, m - 1, d, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0);
return y == dt.getFullYear() &&
@@ -12569,37 +8934,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).
- * <p>Example:</p><pre><code>
-//dt = Fri May 25 2007 (current date)
-var dt = new Date();
-
-//dt = Thu May 25 2006 (today&#39;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
-</code></pre>
- * @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) {
@@ -12608,20 +8943,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,
@@ -12641,62 +8976,62 @@ 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
- // handle years < 100 appropriately
+
+
+
+
"v = new Date(y < 100 ? 100 : y, 0, 1, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0);",
- // 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
- // handle years < 100 properly
+
+
"v = new Date(y < 100 ? 100 : y, m, d, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0);",
"}",
"}",
"}",
"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));",
"}",
"}",
@@ -12745,26 +9080,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,
@@ -12781,7 +9111,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,
@@ -12791,27 +9121,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"));
@@ -12819,17 +9149,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,
@@ -12842,24 +9172,20 @@ 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})"
},
- /**
- * In the am/pm parsing routines, we allow both upper and lower case
- * even though it doesn't exactly match the spec. It gives much more flexibility
- * in being able to specify case insensitive regexes.
- */
+
a: function(){
return $f("A");
},
A: {
- // We need to calculate the hour before we apply AM/PM when parsing
+
calcLast: true,
g:1,
c:"if (/(am)/i.test(results[{0}])) {\n"
@@ -12873,7 +9199,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");
@@ -12881,74 +9207,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')}
@@ -12962,15 +9288,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}))?",
")?",
")?",
")?"
@@ -12980,7 +9306,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+)"
}
}
});
@@ -12988,7 +9314,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);
@@ -12996,38 +9322,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")
@@ -13035,10 +9347,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(),
@@ -13051,100 +9360,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
- 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
+ var ms1d = 864e5,
+ ms7d = 7 * ms1d;
+
+ 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:
- * <pre><code>
-var dt = new Date('1/10/2007');
-document.write(Date.dayNames[dt.getFirstDayOfMonth()]); //output: 'Monday'
-</code></pre>
- * @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:
- * <pre><code>
-var dt = new Date('1/10/2007');
-document.write(Date.dayNames[dt.getLastDayOfMonth()]); //output: 'Wednesday'
-</code></pre>
- * @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:
@@ -13162,68 +9432,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:
- * <pre><code>
-//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'
-</code></pre>
- * @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);
@@ -13233,30 +9473,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:
- * <pre><code>
-// 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'
-</code></pre>
- *
- * @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;
@@ -13292,12 +9509,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();
@@ -13305,23 +9517,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),
@@ -13336,12 +9543,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);
}
});
@@ -13349,80 +9556,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 <tt>true</tt> if the {@link #addAll}
- * function should add function references to the collection. Defaults to
- * <tt>false</tt>.
- * @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'
);
@@ -13435,23 +9583,10 @@ Ext.util.MixedCollection = function(allowFunctions, keyFn){
Ext.extend(Ext.util.MixedCollection, Ext.util.Observable, {
- /**
- * @cfg {Boolean} allowFunctions Specify <tt>true</tt> if the {@link #addAll}
- * function should add function references to the collection. Defaults to
- * <tt>false</tt>.
- */
+
allowFunctions : false,
- /**
- * Adds an item to the collection. Fires the {@link #add} event when complete.
- * @param {String} key <p>The key to associate with the item, or the new item.</p>
- * <p>If a {@link #getKey} implementation was specified for this MixedCollection,
- * or if the key of the stored items is in a property called <tt><b>id</b></tt>,
- * the MixedCollection will be able to <i>derive</i> the key for the new item.
- * In this case just pass the new item in this parameter.</p>
- * @param {Object} o The item to add.
- * @return {Object} The item added.
- */
+
add : function(key, o){
if(arguments.length == 1){
o = arguments[0];
@@ -13471,49 +9606,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 <b><code>item.id</code></b> but you can provide your own implementation
- * to return a different value as in the following examples:<pre><code>
-// 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);
- * </code></pre>
- * @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 <p>The key associated with the item to replace, or the replacement item.</p>
- * <p>If you supplied a {@link #getKey} implementation for this MixedCollection, or if the key
- * of your stored items is in a property called <tt><b>id</b></tt>, then the MixedCollection
- * will be able to <i>derive</i> 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.</p>
- * @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];
@@ -13530,13 +9628,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 <code>{@link #allowFunctions}</code>
- * has been set to <tt>true</tt>.
- */
+
addAll : function(objs){
if(arguments.length > 1 || Ext.isArray(objs)){
var args = arguments.length > 1 ? arguments : objs;
@@ -13552,19 +9644,9 @@ mc.add(otherEl);
}
},
- /**
- * Executes the specified function once for every item in the collection, passing the following arguments:
- * <div class="mdetail-params"><ul>
- * <li><b>item</b> : Mixed<p class="sub-desc">The collection item</p></li>
- * <li><b>index</b> : Number<p class="sub-desc">The item's index</p></li>
- * <li><b>length</b> : Number<p class="sub-desc">The total number of items in the collection</p></li>
- * </ul></div>
- * 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 (<code>this</code> 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;
@@ -13572,25 +9654,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 (<code>this</code> 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 (<code>this</code> 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])){
@@ -13600,13 +9671,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];
@@ -13630,20 +9695,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--;
@@ -13660,94 +9717,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 <tt>undefined</tt>.
- * If an item was found, but is a Class, returns <tt>null</tt>.
- */
+
item : function(key){
var mk = this.map[key],
item = mk !== undefined ? mk : (typeof key == 'number') ? this.items[key] : undefined;
- return typeof item != 'function' || 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 = [];
@@ -13756,47 +9773,32 @@ 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],
@@ -13805,7 +9807,7 @@ mc.add(otherEl);
};
}
- //sort the temporary array
+
c.sort(function(a, b){
var v = fn(a[property], b[property]) * dsc;
if(v === 0){
@@ -13814,7 +9816,7 @@ 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;
@@ -13823,21 +9825,12 @@ mc.add(otherEl);
this.fireEvent('sort', this);
},
- /**
- * Sorts this collection by <b>item</b> 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();
@@ -13848,7 +9841,7 @@ mc.add(otherEl);
remaining = [],
oldIndex;
- //object of {oldPosition: newPosition} reversed to {newPosition: oldPosition}
+
for (oldIndex in mapping) {
order[mapping[oldIndex]] = items[oldIndex];
}
@@ -13872,12 +9865,7 @@ mc.add(otherEl);
this.fireEvent('sort', this);
},
- /**
- * Sorts this collection by <b>key</b>s.
- * @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();
@@ -13885,12 +9873,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){
@@ -13911,16 +9894,7 @@ mc.add(otherEl);
return r;
},
- /**
- * Filter the <i>objects</i> 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();
@@ -13931,14 +9905,7 @@ mc.add(otherEl);
});
},
- /**
- * Filter by a function. Returns a <i>new</i> 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 (<code>this</code> 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;
@@ -13951,16 +9918,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;
@@ -13971,14 +9929,7 @@ mc.add(otherEl);
}, null, start);
},
- /**
- * Find the index of the first matching object in this collection by a function.
- * If the function returns <i>true</i> 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 (<code>this</code> 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++){
@@ -13989,17 +9940,9 @@ 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);
@@ -14016,10 +9959,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;
@@ -14030,95 +9970,48 @@ 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 <tt>undefined</tt>. If an item was found, but is a Class,
- * returns <tt>null</tt>.
- */
+
Ext.util.MixedCollection.prototype.get = Ext.util.MixedCollection.prototype.item;
-/**
- * @class Ext.AbstractManager
- * @extends Object
- * Base Manager class - extended by ComponentMgr and PluginMgr
- */
+
Ext.AbstractManager = Ext.extend(Object, {
typeName: 'type',
constructor: function(config) {
Ext.apply(this, config || {});
-
- /**
- * Contains all of the items currently managed
- * @property all
- * @type Ext.util.MixedCollection
- */
+
+
this.all = new Ext.util.MixedCollection();
this.types = {};
},
- /**
- * 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, <code>undefined</code> if not found, or <code>null</code> if a
- * Class was found.
- */
+
get : function(id){
return this.all.get(id);
},
- /**
- * Registers an item to be managed
- * @param {Mixed} item The item to register
- */
+
register: function(item) {
this.all.add(item);
},
- /**
- * Unregisters a component by removing it from this manager
- * @param {Mixed} item The item to unregister
- */
+
unregister: function(item) {
this.all.remove(item);
},
- /**
- * <p>Registers a new Component constructor, keyed by a new
- * {@link Ext.Component#xtype}.</p>
- * <p>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}</p>
- * @param {String} xtype The mnemonic string by which the Component class may be looked up.
- * @param {Constructor} cls The new Component class.
- */
+
registerType : function(type, cls){
this.types[type] = cls;
cls[this.typeName] = type;
},
- /**
- * 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(type){
return this.types[type] !== undefined;
},
- /**
- * Creates and returns an instance of whatever this manager manages, based on the supplied type and config object
- * @param {Object} config The config object
- * @param {String} defaultType If no type is discovered in the config object, we fall back to this type
- * @return {Mixed} The instance of whatever this manager is managing
- */
+
create: function(config, defaultType) {
var type = config[this.typeName] || config.type || defaultType,
Constructor = this.types[type];
@@ -14130,12 +10023,7 @@ Ext.AbstractManager = Ext.extend(Object, {
return new Constructor(config);
},
- /**
- * Registers a function that will be called when a Component with the specified id is added to the manager. 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 (<code>this</code> reference) in which the callback is executed. Defaults to the Component.
- */
+
onAvailable : function(id, fn, scope){
var all = this.all;
@@ -14146,11 +10034,7 @@ Ext.AbstractManager = Ext.extend(Object, {
}
});
}
-});/**
- * @class Ext.util.Format
- * Reusable data formatting functions
- * @singleton
- */
+});
Ext.util.Format = function() {
var trimRe = /^\s+|\s+$/g,
stripTagsRE = /<\/?[^>]+>/gi,
@@ -14158,13 +10042,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) {
@@ -14182,91 +10060,55 @@ 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) {
+ if (!defaultValue && defaultValue !== 0) {
+ 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, "&amp;").replace(/>/g, "&gt;").replace(/</g, "&lt;").replace(/"/g, "&quot;");
},
- /**
- * Convert certain characters (&, <, >, 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(/&gt;/g, ">").replace(/&lt;/g, "<").replace(/&quot;/g, '"').replace(/&amp;/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);
@@ -14277,11 +10119,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);
@@ -14300,12 +10138,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 <a href="http://www.w3schools.com/jsref/jsref_parse.asp">parse()</a> 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 "";
@@ -14316,40 +10149,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";
@@ -14360,12 +10177,7 @@ Ext.util.Format = function() {
}
},
- /**
- * It does simple math for use in a template, for example:<pre><code>
- * var tpl = new Ext.Template('{value} * 10 = {value:math("* 10")}');
- * </code></pre>
- * @return {Function} A function that operates on the passed value.
- */
+
math : function(){
var fns = {};
@@ -14377,12 +10189,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') {
@@ -14392,23 +10199,7 @@ Ext.util.Format = function() {
return result;
},
- /**
- * Formats the number according to the format string.
- * <div style="margin-left:40px">examples (123456.789):
- * <div style="margin-left:10px">
- * 0 - (123456) show only digits, no precision<br>
- * 0.00 - (123456.78) show only digits, 2 precision<br>
- * 0.0000 - (123456.7890) show only digits, 4 precision<br>
- * 0,000 - (123,456) show comma and digits, no precision<br>
- * 0,000.00 - (123,456.78) show comma and digits, 2 precision<br>
- * 0,0.00 - (123,456.78) shortcut method, show comma and digits, 2 precision<br>
- * To reverse the grouping (,) and decimal (.) for international numbers, add /i to the end.
- * For example: 0.000,00/i
- * </div></div>
- * @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;
@@ -14474,310 +10265,25 @@ 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 &lt;br/>
- * @param {String} The string value to format.
- * @return {String} The string with embedded &lt;br/> tags in place of newlines.
- */
+
nl2br : function(v) {
return Ext.isEmpty(v) ? '' : v.replace(nl2brRe, '<br/>');
}
};
}();
-/**
- * @class Ext.XTemplate
- * @extends Ext.Template
- * <p>A template class that supports advanced functionality like:<div class="mdetail-params"><ul>
- * <li>Autofilling arrays using templates and sub-templates</li>
- * <li>Conditional processing with basic comparison operators</li>
- * <li>Basic math function support</li>
- * <li>Execute arbitrary inline code with special built-in template variables</li>
- * <li>Custom member functions</li>
- * <li>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</li>
- * </ul></div></p>
- * <p>XTemplate provides the templating mechanism built into:<div class="mdetail-params"><ul>
- * <li>{@link Ext.DataView}</li>
- * <li>{@link Ext.ListView}</li>
- * <li>{@link Ext.form.ComboBox}</li>
- * <li>{@link Ext.grid.TemplateColumn}</li>
- * <li>{@link Ext.grid.GroupingView}</li>
- * <li>{@link Ext.menu.Item}</li>
- * <li>{@link Ext.layout.MenuLayout}</li>
- * <li>{@link Ext.ColorPalette}</li>
- * </ul></div></p>
- *
- * <p>For example usage {@link #XTemplate see the constructor}.</p>
- *
- * @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.</p>
- *
- * <div class="mdetail-params"><ul>
- *
- * <li><b><u>Sample Data</u></b>
- * <div class="sub-desc">
- * <p>This is the data object used for reference in each code example:</p>
- * <pre><code>
-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
- }]
-};
- * </code></pre>
- * </div>
- * </li>
- *
- *
- * <li><b><u>Auto filling of arrays</u></b>
- * <div class="sub-desc">
- * <p>The <b><tt>tpl</tt></b> tag and the <b><tt>for</tt></b> operator are used
- * to process the provided data object:
- * <ul>
- * <li>If the value specified in <tt>for</tt> is an array, it will auto-fill,
- * repeating the template block inside the <tt>tpl</tt> tag for each item in the
- * array.</li>
- * <li>If <tt>for="."</tt> is specified, the data object provided is examined.</li>
- * <li>While processing an array, the special variable <tt>{#}</tt>
- * will provide the current array index + 1 (starts at 1, not 0).</li>
- * </ul>
- * </p>
- * <pre><code>
-&lt;tpl <b>for</b>=".">...&lt;/tpl> // loop through array at root node
-&lt;tpl <b>for</b>="foo">...&lt;/tpl> // loop through array at foo node
-&lt;tpl <b>for</b>="foo.bar">...&lt;/tpl> // loop through array at foo.bar node
- * </code></pre>
- * Using the sample data above:
- * <pre><code>
-var tpl = new Ext.XTemplate(
- '&lt;p>Kids: ',
- '&lt;tpl <b>for</b>=".">', // process the data.kids node
- '&lt;p>{#}. {name}&lt;/p>', // use current array index to autonumber
- '&lt;/tpl>&lt;/p>'
-);
-tpl.overwrite(panel.body, data.kids); // pass the kids property of the data object
- * </code></pre>
- * <p>An example illustrating how the <b><tt>for</tt></b> property can be leveraged
- * to access specified members of the provided data object to populate the template:</p>
- * <pre><code>
-var tpl = new Ext.XTemplate(
- '&lt;p>Name: {name}&lt;/p>',
- '&lt;p>Title: {title}&lt;/p>',
- '&lt;p>Company: {company}&lt;/p>',
- '&lt;p>Kids: ',
- '&lt;tpl <b>for="kids"</b>>', // interrogate the kids property within the data
- '&lt;p>{name}&lt;/p>',
- '&lt;/tpl>&lt;/p>'
-);
-tpl.overwrite(panel.body, data); // pass the root node of the data object
- * </code></pre>
- * <p>Flat arrays that contain values (and not objects) can be auto-rendered
- * using the special <b><tt>{.}</tt></b> variable inside a loop. This variable
- * will represent the value of the array at the current index:</p>
- * <pre><code>
-var tpl = new Ext.XTemplate(
- '&lt;p>{name}\&#39;s favorite beverages:&lt;/p>',
- '&lt;tpl for="drinks">',
- '&lt;div> - {.}&lt;/div>',
- '&lt;/tpl>'
-);
-tpl.overwrite(panel.body, data);
- * </code></pre>
- * <p>When processing a sub-template, for example while looping through a child array,
- * you can access the parent object's members via the <b><tt>parent</tt></b> object:</p>
- * <pre><code>
-var tpl = new Ext.XTemplate(
- '&lt;p>Name: {name}&lt;/p>',
- '&lt;p>Kids: ',
- '&lt;tpl for="kids">',
- '&lt;tpl if="age > 1">',
- '&lt;p>{name}&lt;/p>',
- '&lt;p>Dad: {<b>parent</b>.name}&lt;/p>',
- '&lt;/tpl>',
- '&lt;/tpl>&lt;/p>'
-);
-tpl.overwrite(panel.body, data);
- * </code></pre>
- * </div>
- * </li>
- *
- *
- * <li><b><u>Conditional processing with basic comparison operators</u></b>
- * <div class="sub-desc">
- * <p>The <b><tt>tpl</tt></b> tag and the <b><tt>if</tt></b> operator are used
- * to provide conditional checks for deciding whether or not to render specific
- * parts of the template. Notes:<div class="sub-desc"><ul>
- * <li>Double quotes must be encoded if used within the conditional</li>
- * <li>There is no <tt>else</tt> operator &mdash; if needed, two opposite
- * <tt>if</tt> statements should be used.</li>
- * </ul></div>
- * <pre><code>
-&lt;tpl if="age &gt; 1 &amp;&amp; age &lt; 10">Child&lt;/tpl>
-&lt;tpl if="age >= 10 && age < 18">Teenager&lt;/tpl>
-&lt;tpl <b>if</b>="this.isGirl(name)">...&lt;/tpl>
-&lt;tpl <b>if</b>="id==\'download\'">...&lt;/tpl>
-&lt;tpl <b>if</b>="needsIcon">&lt;img src="{icon}" class="{iconCls}"/>&lt;/tpl>
-// no good:
-&lt;tpl if="name == "Jack"">Hello&lt;/tpl>
-// encode &#34; if it is part of the condition, e.g.
-&lt;tpl if="name == &#38;quot;Jack&#38;quot;">Hello&lt;/tpl>
- * </code></pre>
- * Using the sample data above:
- * <pre><code>
-var tpl = new Ext.XTemplate(
- '&lt;p>Name: {name}&lt;/p>',
- '&lt;p>Kids: ',
- '&lt;tpl for="kids">',
- '&lt;tpl if="age > 1">',
- '&lt;p>{name}&lt;/p>',
- '&lt;/tpl>',
- '&lt;/tpl>&lt;/p>'
-);
-tpl.overwrite(panel.body, data);
- * </code></pre>
- * </div>
- * </li>
- *
- *
- * <li><b><u>Basic math support</u></b>
- * <div class="sub-desc">
- * <p>The following basic math operators may be applied directly on numeric
- * data values:</p><pre>
- * + - * /
- * </pre>
- * For example:
- * <pre><code>
-var tpl = new Ext.XTemplate(
- '&lt;p>Name: {name}&lt;/p>',
- '&lt;p>Kids: ',
- '&lt;tpl for="kids">',
- '&lt;tpl if="age &amp;gt; 1">', // <-- Note that the &gt; is encoded
- '&lt;p>{#}: {name}&lt;/p>', // <-- Auto-number each item
- '&lt;p>In 5 Years: {age+5}&lt;/p>', // <-- Basic math
- '&lt;p>Dad: {parent.name}&lt;/p>',
- '&lt;/tpl>',
- '&lt;/tpl>&lt;/p>'
-);
-tpl.overwrite(panel.body, data);
-</code></pre>
- * </div>
- * </li>
- *
- *
- * <li><b><u>Execute arbitrary inline code with special built-in template variables</u></b>
- * <div class="sub-desc">
- * <p>Anything between <code>{[ ... ]}</code> is considered code to be executed
- * in the scope of the template. There are some special variables available in that code:
- * <ul>
- * <li><b><tt>values</tt></b>: The values in the current scope. If you are using
- * scope changing sub-templates, you can change what <tt>values</tt> is.</li>
- * <li><b><tt>parent</tt></b>: The scope (values) of the ancestor template.</li>
- * <li><b><tt>xindex</tt></b>: If you are in a looping template, the index of the
- * loop you are in (1-based).</li>
- * <li><b><tt>xcount</tt></b>: If you are in a looping template, the total length
- * of the array you are looping.</li>
- * <li><b><tt>fm</tt></b>: An alias for <tt>Ext.util.Format</tt>.</li>
- * </ul>
- * This example demonstrates basic row striping using an inline code block and the
- * <tt>xindex</tt> variable:</p>
- * <pre><code>
-var tpl = new Ext.XTemplate(
- '&lt;p>Name: {name}&lt;/p>',
- '&lt;p>Company: {[values.company.toUpperCase() + ", " + values.title]}&lt;/p>',
- '&lt;p>Kids: ',
- '&lt;tpl for="kids">',
- '&lt;div class="{[xindex % 2 === 0 ? "even" : "odd"]}">',
- '{name}',
- '&lt;/div>',
- '&lt;/tpl>&lt;/p>'
-);
-tpl.overwrite(panel.body, data);
- * </code></pre>
- * </div>
- * </li>
- *
- * <li><b><u>Template member functions</u></b>
- * <div class="sub-desc">
- * <p>One or more member functions can be specified in a configuration
- * object passed into the XTemplate constructor for more complex processing:</p>
- * <pre><code>
-var tpl = new Ext.XTemplate(
- '&lt;p>Name: {name}&lt;/p>',
- '&lt;p>Kids: ',
- '&lt;tpl for="kids">',
- '&lt;tpl if="this.isGirl(name)">',
- '&lt;p>Girl: {name} - {age}&lt;/p>',
- '&lt;/tpl>',
- // use opposite if statement to simulate 'else' processing:
- '&lt;tpl if="this.isGirl(name) == false">',
- '&lt;p>Boy: {name} - {age}&lt;/p>',
- '&lt;/tpl>',
- '&lt;tpl if="this.isBaby(age)">',
- '&lt;p>{name} is a baby!&lt;/p>',
- '&lt;/tpl>',
- '&lt;/tpl>&lt;/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);
- * </code></pre>
- * </div>
- * </li>
- *
- * </ul></div>
- *
- * @param {Mixed} config
- */
+
Ext.XTemplate = function(){
Ext.XTemplate.superclass.constructor.apply(this, arguments);
@@ -14844,12 +10350,12 @@ Ext.XTemplate = function(){
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,
@@ -14872,7 +10378,7 @@ Ext.extend(Ext.XTemplate, Ext.Template, {
return t.compiled.call(me, vs, parent, xindex, xcount);
},
- // private
+
compileTpl : function(tpl){
var fm = Ext.util.Format,
useF = this.disableFormats !== true,
@@ -14911,11 +10417,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) +
@@ -14930,60 +10436,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 (<i>display:none</i> 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;
@@ -14992,13 +10466,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];
@@ -15024,10 +10492,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){
@@ -15035,11 +10500,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");
@@ -15049,33 +10510,26 @@ Ext.util.CSS = function(){
ss.setAttribute("href", url);
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];
}
}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 = {};
@@ -15083,18 +10537,13 @@ Ext.util.CSS = function(){
for(var i =0, len = ds.length; i < len; i++){
try{
this.cacheStyleSheet(ds[i]);
- }catch(e){}
+ }catch(e){}
}
}
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)){
@@ -15107,15 +10556,9 @@ Ext.util.CSS = function(){
}
return null;
},
-
-
- /**
- * 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);
@@ -15132,36 +10575,8 @@ 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 = Ext.extend(Ext.util.Observable, {
constructor : function(el, config){
@@ -15171,26 +10586,11 @@ Ext.util.ClickRepeater = Ext.extend(Ext.util.Observable, {
Ext.apply(this, config);
this.addEvents(
- /**
- * @event mousedown
- * Fires when the mouse button is depressed.
- * @param {Ext.util.ClickRepeater} this
- * @param {Ext.EventObject} e
- */
+
"mousedown",
- /**
- * @event click
- * Fires on a specified interval during the time the element is pressed.
- * @param {Ext.util.ClickRepeater} this
- * @param {Ext.EventObject} e
- */
+
"click",
- /**
- * @event mouseup
- * Fires when the mouse key is released.
- * @param {Ext.util.ClickRepeater} this
- * @param {Ext.EventObject} e
- */
+
"mouseup"
);
@@ -15199,7 +10599,7 @@ Ext.util.ClickRepeater = Ext.extend(Ext.util.Observable, {
this.enable();
}
- // allow inline handler
+
if(this.handler){
this.on("click", this.handler, this.scope || this);
}
@@ -15213,9 +10613,7 @@ Ext.util.ClickRepeater = Ext.extend(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);
@@ -15229,10 +10627,8 @@ Ext.util.ClickRepeater = Ext.extend(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){
@@ -15244,10 +10640,7 @@ Ext.util.ClickRepeater = Ext.extend(Ext.util.Observable, {
this.disabled = true;
},
- /**
- * Convenience function for setting disabled/enabled by boolean.
- * @param {Boolean} disabled
- */
+
setDisabled: function(disabled){
this[disabled ? 'disable' : 'enable']();
},
@@ -15261,7 +10654,7 @@ Ext.util.ClickRepeater = Ext.extend(Ext.util.Observable, {
}
},
- // private
+
destroy : function() {
this.disable(true);
Ext.destroy(this.el);
@@ -15276,7 +10669,7 @@ Ext.util.ClickRepeater = Ext.extend(Ext.util.Observable, {
this.fireEvent("click", this, e);
},
- // private
+
handleMouseDown : function(e){
clearTimeout(this.timer);
this.el.blur();
@@ -15291,14 +10684,14 @@ Ext.util.ClickRepeater = Ext.extend(Ext.util.Observable, {
this.fireEvent("mousedown", this, e);
this.fireEvent("click", this, e);
- // 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, [e]);
},
- // private
+
click : function(e){
this.fireEvent("click", this, e);
this.timer = this.click.defer(this.accelerate ?
@@ -15313,7 +10706,7 @@ Ext.util.ClickRepeater = Ext.extend(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){
@@ -15322,7 +10715,7 @@ Ext.util.ClickRepeater = Ext.extend(Ext.util.Observable, {
this.el.on("mouseover", this.handleMouseReturn, this);
},
- // private
+
handleMouseReturn : function(){
this.el.un("mouseover", this.handleMouseReturn, this);
if(this.pressClass){
@@ -15331,7 +10724,7 @@ Ext.util.ClickRepeater = Ext.extend(Ext.util.Observable, {
this.click();
},
- // private
+
handleMouseUp : function(e){
clearTimeout(this.timer);
this.el.un("mouseover", this.handleMouseReturn, this);
@@ -15340,31 +10733,7 @@ Ext.util.ClickRepeater = Ext.extend(Ext.util.Observable, {
this.el.removeClass(this.pressClass);
this.fireEvent("mouseup", this, e);
}
-});/**
- * @class Ext.KeyNav
- * <p>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.</p>
- * <p>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:</p>
- <pre><code>
-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
});
-</code></pre>
- * @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);
@@ -15375,27 +10744,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(),
h = this.keyToHandler[k];
@@ -15406,12 +10762,12 @@ Ext.KeyNav.prototype = {
}
},
- // private
+
doRelay : function(e, h, hname){
return h.call(this.scope || this, e, hname);
},
- // possible handlers
+
enter : false,
left : false,
right : false,
@@ -15426,7 +10782,7 @@ Ext.KeyNav.prototype = {
end : false,
space : false,
- // quick lookup hash
+
keyToHandler : {
37 : "left",
39 : "right",
@@ -15442,31 +10798,27 @@ Ext.KeyNav.prototype = {
9 : "tab",
32 : "space"
},
-
+
stopKeyUp: function(e) {
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();
+ 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);
}
@@ -15475,13 +10827,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);
}
@@ -15489,66 +10839,18 @@ Ext.KeyNav.prototype = {
this.disabled = true;
}
},
-
- /**
- * 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.<br />
- * Usage:
- <pre><code>
-// 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.'); }
- }
-]);
-</code></pre>
- * <b>Note: A KeyMap starts enabled</b>
- * @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";
@@ -15560,47 +10862,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:
- * <pre>
-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)
-</pre>
- *
- * Usage:
- * <pre><code>
-// 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
-});
-</code></pre>
- * @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){
@@ -15613,8 +10878,8 @@ map.addBinding({
scope = config.scope;
if (config.stopEvent) {
- this.stopEvent = config.stopEvent;
- }
+ this.stopEvent = config.stopEvent;
+ }
if(typeof keyCode == "string"){
var ks = [];
@@ -15625,7 +10890,7 @@ map.addBinding({
keyCode = ks;
}
var keyArray = Ext.isArray(keyCode);
-
+
var handler = function(e){
if(this.checkModifiers(config, e)){
var k = e.getKey();
@@ -15651,8 +10916,8 @@ 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){
@@ -15665,14 +10930,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 (<code>this</code> 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)){
@@ -15693,9 +10951,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);
@@ -15703,17 +10961,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);
@@ -15721,42 +10974,23 @@ map.addBinding({
}
},
- /**
- * Disable this KeyMap
- */
+
disable: function(){
if(this.enabled){
this.el.removeListener(this.eventName, this.handleKeyDown, this);
this.enabled = false;
}
},
-
- /**
- * 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);
@@ -15766,14 +11000,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);
}
@@ -15792,12 +11019,7 @@ Ext.util.TextMetrics.Instance = function(bindTo, fixedWidth){
}
var instance = {
- /**
- * <p><b>Only available on the instance returned from {@link #createInstance}, <u>not</u> on the singleton.</b></p>
- * 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();
@@ -15805,46 +11027,25 @@ Ext.util.TextMetrics.Instance = function(bindTo, fixedWidth){
return s;
},
- /**
- * <p><b>Only available on the instance returned from {@link #createInstance}, <u>not</u> on the singleton.</b></p>
- * 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')
);
},
- /**
- * <p><b>Only available on the instance returned from {@link #createInstance}, <u>not</u> on the singleton.</b></p>
- * 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);
},
- /**
- * <p><b>Only available on the instance returned from {@link #createInstance}, <u>not</u> on the singleton.</b></p>
- * 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;
},
- /**
- * <p><b>Only available on the instance returned from {@link #createInstance}, <u>not</u> on the singleton.</b></p>
- * 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;
}
@@ -15856,46 +11057,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 (<tt>'/'</tt>).
- * @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 <tt>false</tt>. 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;
@@ -15906,18 +11075,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, <code>get()</code> returns <tt>null</tt>. The following
- * example retrieves the cookie called "valid" and stores the String value
- * in the variable <tt>validStatus</tt>.
- * <pre><code>
- * var validStatus = Ext.util.Cookies.get("valid");
- * </code></pre>
- * @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;
@@ -15937,19 +11095,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){
@@ -15957,135 +11109,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
- * <p>A base error class. Future implementations are intended to provide more
- * robust error handling throughout the framework (<b>in the debug build only</b>)
- * 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.</p>
- * <p>Some sample messages currently implemented:</p><pre>
-"DataProxy attempted to execute an API-action but found an undefined
-url / function. Please review your Proxy url/api-configuration."
- * </pre><pre>
-"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."
- * </pre>
- * <p>An example of the code used for generating error messages:</p><pre><code>
-try {
- generateError({
- foo: 'bar'
- });
-}
-catch (e) {
- console.error(e);
-}
-function generateError(data) {
- throw new Ext.Error('foo-error', data);
-}
- * </code></pre>
- * @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
- * <p>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}).</p>
- * <p>This object also provides a registry of available Component <i>classes</i>
- * indexed by a mnemonic code known as the Component's {@link Ext.Component#xtype xtype}.
- * The <code>{@link Ext.Component#xtype xtype}</code> provides a way to avoid instantiating child Components
- * when creating a full, nested config object for a complete Ext page.</p>
- * <p>A child Component may be specified simply as a <i>config object</i>
- * as long as the correct <code>{@link Ext.Component#xtype xtype}</code> is specified so that if and when the Component
- * needs rendering, the correct type can be looked up for lazy instantiation.</p>
- * <p>For a list of all available <code>{@link Ext.Component#xtype xtypes}</code>, see {@link Ext.Component}.</p>
- * @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, <code>undefined</code> if not found, or <code>null</code> 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 (<code>this</code> 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){
@@ -16095,398 +11171,109 @@ 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;
+ 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;
- },
+ return ptypes[ptype] !== undefined;
+ },
+
- /**
- * <p>Registers a new Component constructor, keyed by a new
- * {@link Ext.Component#xtype}.</p>
- * <p>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}</p>
- * @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 <code>xtype</code>. (Optional if the config contains a <code>xtype</code>).
- * @return {Ext.Component} The newly instantiated Component.
- */
+
create : function(config, defaultType){
return config.render ? config : new types[config.xtype || defaultType](config);
},
- /**
- * <p>Registers a new Plugin constructor, keyed by a new
- * {@link Ext.Component#ptype}.</p>
- * <p>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.</p>
- * @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 <code>ptype</code>. (Optional if the config contains a <code>ptype</code>).
- * @return {Ext.Component} The newly instantiated Plugin.
- */
+
createPlugin : function(config, defaultType){
var PluginCls = ptypes[config.ptype || defaultType];
if (PluginCls.init) {
- return PluginCls;
+ return PluginCls;
} else {
return new PluginCls(config);
- }
+ }
}
};
}();
-/**
- * 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 <code>xtype</code>. (Optional if the config contains a <code>xtype</code>).
- * @return {Ext.Component} The newly instantiated Component.
- * @member Ext
- * @method create
- */
-Ext.create = Ext.ComponentMgr.create;/**
- * @class Ext.Component
- * @extends Ext.util.Observable
- * <p>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.</p>
- * <p>The Component base class has built-in support for basic hide/show and enable/disable behavior.</p>
- * <p>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}.</p>
- * <p>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).</p>
- * <p>See the <a href="http://extjs.com/learn/Tutorial:Creating_new_UI_controls">Creating new UI controls</a> tutorial for details on how
- * and to either extend or augment ExtJs base classes to create custom Components.</p>
- * <p>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:</p>
- * <pre>
-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}
-multislider {@link Ext.slider.MultiSlider}
-panel {@link Ext.Panel}
-progress {@link Ext.ProgressBar}
-propertygrid {@link Ext.grid.PropertyGrid}
-slider {@link Ext.slider.SingleSlider}
-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}
-compositefield {@link Ext.form.CompositeField}
-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}
-</pre>
- * @constructor
- * @param {Ext.Element/String/Object} config The configuration options may be specified as either:
- * <div class="mdetail-params"><ul>
- * <li><b>an element</b> :
- * <p class="sub-desc">it is set as the internal element and its id used as the component id</p></li>
- * <li><b>a string</b> :
- * <p class="sub-desc">it is assumed to be the id of an existing element and is used as the component id</p></li>
- * <li><b>anything else</b> :
- * <p class="sub-desc">it is assumed to be a standard config object and is applied to the component</p></li>
- * </ul></div>
- */
+
+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
- * <p>Fires after the component rendering is finished.</p>
- * <p>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.</p>
- * @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 <b><tt>applyState</tt></b>. 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 <b><tt>applyState</tt></b>. 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
- * <b><tt>getState()</tt></b> 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
- * <b><tt>getState()</tt></b> 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();
@@ -16522,556 +11309,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 <p>The label text to display next to this Component (defaults to '').</p>
- * <br><p><b>Note</b>: this config is only used when this Component is rendered by a Container which
- * has been configured to use the <b>{@link Ext.layout.FormLayout FormLayout}</b> layout manager (e.g.
- * {@link Ext.form.FormPanel} or specifying <tt>layout:'form'</tt>).</p><br>
- * <p>Also see <tt>{@link #hideLabel}</tt> and
- * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}.</p>
- * Example use:<pre><code>
-new Ext.FormPanel({
- height: 100,
- renderTo: Ext.getBody(),
- items: [{
- xtype: 'textfield',
- fieldLabel: 'Name'
- }]
-});
-</code></pre>
- */
- /**
- * @cfg {String} labelStyle <p>A CSS style specification string to apply directly to this field's
- * label. Defaults to the container's labelStyle value if set (e.g.,
- * <tt>{@link Ext.layout.FormLayout#labelStyle}</tt> , or '').</p>
- * <br><p><b>Note</b>: see the note for <code>{@link #clearCls}</code>.</p><br>
- * <p>Also see <code>{@link #hideLabel}</code> and
- * <code>{@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}.</code></p>
- * Example use:<pre><code>
-new Ext.FormPanel({
- height: 100,
- renderTo: Ext.getBody(),
- items: [{
- xtype: 'textfield',
- fieldLabel: 'Name',
- labelStyle: 'font-weight:bold;'
- }]
-});
-</code></pre>
- */
- /**
- * @cfg {String} labelSeparator <p>The separator to display after the text of each
- * <tt>{@link #fieldLabel}</tt>. This property may be configured at various levels.
- * The order of precedence is:
- * <div class="mdetail-params"><ul>
- * <li>field / component level</li>
- * <li>container level</li>
- * <li>{@link Ext.layout.FormLayout#labelSeparator layout level} (defaults to colon <tt>':'</tt>)</li>
- * </ul></div>
- * To display no separator for this field's label specify empty string ''.</p>
- * <br><p><b>Note</b>: see the note for <tt>{@link #clearCls}</tt>.</p><br>
- * <p>Also see <tt>{@link #hideLabel}</tt> and
- * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}.</p>
- * Example use:<pre><code>
-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 '='
- }]
-});
-</code></pre>
- */
- /**
- * @cfg {Boolean} hideLabel <p><tt>true</tt> to completely hide the label element
- * ({@link #fieldLabel label} and {@link #labelSeparator separator}). Defaults to <tt>false</tt>.
- * By default, even if you do not specify a <tt>{@link #fieldLabel}</tt> the space will still be
- * reserved so that the field will line up with other fields that do have labels.
- * Setting this to <tt>true</tt> will cause the field to not reserve that space.</p>
- * <br><p><b>Note</b>: see the note for <tt>{@link #clearCls}</tt>.</p><br>
- * Example use:<pre><code>
-new Ext.FormPanel({
- height: 100,
- renderTo: Ext.getBody(),
- items: [{
- xtype: 'textfield'
- hideLabel: true
- }]
-});
-</code></pre>
- */
- /**
- * @cfg {String} clearCls <p>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
- * <tt>'x-form-clear-left'</tt>).</p>
- * <br><p><b>Note</b>: this config is only used when this Component is rendered by a Container
- * which has been configured to use the <b>{@link Ext.layout.FormLayout FormLayout}</b> layout
- * manager (e.g. {@link Ext.form.FormPanel} or specifying <tt>layout:'form'</tt>) and either a
- * <tt>{@link #fieldLabel}</tt> is specified or <tt>isFormField=true</tt> is specified.</p><br>
- * <p>See {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl} also.</p>
- */
- /**
- * @cfg {String} itemCls
- * <p><b>Note</b>: this config is only used when this Component is rendered by a Container which
- * has been configured to use the <b>{@link Ext.layout.FormLayout FormLayout}</b> layout manager (e.g.
- * {@link Ext.form.FormPanel} or specifying <tt>layout:'form'</tt>).</p><br>
- * <p>An additional CSS class to apply to the div wrapping the form item
- * element of this field. If supplied, <tt>itemCls</tt> at the <b>field</b> level will override
- * the default <tt>itemCls</tt> supplied at the <b>container</b> level. The value specified for
- * <tt>itemCls</tt> will be added to the default class (<tt>'x-form-item'</tt>).</p>
- * <p>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.</p>
- * <br><p><b>Note</b>: see the note for <tt>{@link #fieldLabel}</tt>.</p><br>
- * Example use:<pre><code>
-// Apply a style to the field&#39;s label:
-&lt;style>
- .required .x-form-item-label {font-weight:bold;color:red;}
-&lt;/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'
- }]
-});
-</code></pre>
- */
- /**
- * @cfg {String} id
- * <p>The <b>unique</b> 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}).</p>
- * <p>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.</p>
- * <p><b>Note</b>: to avoid complications imposed by a unique <tt>id</tt> also see
- * <code>{@link #itemId}</code> and <code>{@link #ref}</code>.</p>
- * <p><b>Note</b>: to access the container of an item see <code>{@link #ownerCt}</code>.</p>
- */
- /**
- * @cfg {String} itemId
- * <p>An <tt>itemId</tt> can be used as an alternative way to get a reference to a component
- * when no object reference is available. Instead of using an <code>{@link #id}</code> with
- * {@link Ext}.{@link Ext#getCmp getCmp}, use <code>itemId</code> with
- * {@link Ext.Container}.{@link Ext.Container#getComponent getComponent} which will retrieve
- * <code>itemId</code>'s or <tt>{@link #id}</tt>'s. Since <code>itemId</code>'s are an index to the
- * container's internal MixedCollection, the <code>itemId</code> is scoped locally to the container --
- * avoiding potential conflicts with {@link Ext.ComponentMgr} which requires a <b>unique</b>
- * <code>{@link #id}</code>.</p>
- * <pre><code>
-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
- * </code></pre>
- * <p>Also see <tt>{@link #id}</tt> and <code>{@link #ref}</code>.</p>
- * <p><b>Note</b>: to access the container of an item see <tt>{@link #ownerCt}</tt>.</p>
- */
- /**
- * @cfg {String} xtype
- * The registered <tt>xtype</tt> 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 <i>Component config
- * object</i>. The <tt>xtype</tt> will be looked up at render time up to determine what
- * type of child Component to create.<br><br>
- * The predefined xtypes are listed {@link Ext.Component here}.
- * <br><br>
- * 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 <tt>ptype</tt> 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 <i>Component config
- * object</i>. The <tt>ptype</tt> will be looked up at render time up to determine what
- * type of Plugin to create.<br><br>
- * 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}.
- * <pre><code>
-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'
- }
- })
- ]
-});
- * </code></pre>
- */
- /**
- * @cfg {String} ctCls
- * <p>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.</p>
- * <p><b>Note</b>: <tt>ctCls</tt> defaults to <tt>''</tt> except for the following class
- * which assigns a value by default:
- * <div class="mdetail-params"><ul>
- * <li>{@link Ext.layout.Box Box Layout} : <tt>'x-box-layout-ct'</tt></li>
- * </ul></div>
- * To configure the above Class with an extra CSS class append to the default. For example,
- * for BoxLayout (Hbox and Vbox):<pre><code>
- * ctCls: 'x-box-layout-ct custom-class'
- * </code></pre>
- * </p>
- */
- /**
- * @cfg {Boolean} disabled
- * Render this component disabled (default is false).
- */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
disabled : false,
- /**
- * @cfg {Boolean} hidden
- * Render this component hidden (default is false). If <tt>true</tt>, 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
- * <p>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.</p><div><ul>
- * <li><b>Description</b> : <ul>
- * <div class="sub-desc">When <tt>applyTo</tt> 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.</div>
- * </ul></li>
- * <li><b>Notes</b> : <ul>
- * <div class="sub-desc">When using this config, a call to render() is not required.</div>
- * <div class="sub-desc">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.</div>
- * </ul></li>
- * </ul></div>
- */
- /**
- * @cfg {Mixed} renderTo
- * <p>Specify the id of the element, a DOM element or an existing Element that this component
- * will be rendered into.</p><div><ul>
- * <li><b>Notes</b> : <ul>
- * <div class="sub-desc">Do <u>not</u> 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.</div>
- * <div class="sub-desc">When using this config, a call to render() is not required.</div>
- * </ul></li>
- * </ul></div>
- * <p>See <tt>{@link #render}</tt> also.</p>
- */
- /**
- * @cfg {Boolean} stateful
- * <p>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 <code>{@link #stateId}</code> or <code>{@link #id}</code> 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.<p>
- * <p>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.</p>
- * <p>To set the state provider for the current page:</p>
- * <pre><code>
-Ext.state.Manager.setProvider(new Ext.state.CookieProvider({
- expires: new Date(new Date().getTime()+(1000*60*60*24*7)), //7 days from now
-}));
- * </code></pre>
- * <p>A stateful Component attempts to save state when one of the events
- * listed in the <code>{@link #stateEvents}</code> configuration fires.</p>
- * <p>To save state, a stateful Component first serializes its state by
- * calling <b><code>getState</code></b>. By default, this function does
- * nothing. The developer must provide an implementation which returns an
- * object hash which represents the Component's restorable state.</p>
- * <p>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 <code>{@link stateId}</code>, or, if that is not
- * specified, its <code>{@link #id}</code>.</p>
- * <p>During construction, a stateful Component attempts to <i>restore</i>
- * its state by calling {@link Ext.state.Manager#get} passing the
- * <code>{@link #stateId}</code>, or, if that is not specified, the
- * <code>{@link #id}</code>.</p>
- * <p>The resulting object is passed to <b><code>applyState</code></b>.
- * The default implementation of <code>applyState</code> simply copies
- * properties into the object, but a developer may override this to support
- * more behaviour.</p>
- * <p>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.</p>
- */
- /**
- * @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).
- * <p>See <code>{@link #stateful}</code> for an explanation of saving and
- * restoring Component state.</p>
- */
- /**
- * @cfg {Array} stateEvents
- * <p>An array of events that, when fired, should trigger this component to
- * save its state (defaults to none). <code>stateEvents</code> may be any type
- * of event supported by this component, including browser or custom events
- * (e.g., <tt>['click', 'customerchange']</tt>).</p>
- * <p>See <code>{@link #stateful}</code> for an explanation of saving and
- * restoring Component state.</p>
- */
- /**
- * @cfg {Mixed} autoEl
- * <p>A tag name or {@link Ext.DomHelper DomHelper} spec used to create the {@link #getEl Element} which will
- * encapsulate this Component.</p>
- * <p>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 <b><tt>'div'</tt></b>. The more complex Ext classes use a more complex
- * DOM structure created by their own onRender methods.</p>
- * <p>This is intended to allow the developer to create application-specific utility Components encapsulated by
- * different DOM elements. Example usage:</p><pre><code>
-{
- 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'
- }
-}
-</code></pre>
- */
+
+
+
+
+
+
+
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
- * <p>How this component should be hidden. Supported values are <tt>'visibility'</tt>
- * (css visibility), <tt>'offsets'</tt> (negative offset position) and <tt>'display'</tt>
- * (css display).</p>
- * <br><p><b>Note</b>: the default of <tt>'display'</tt> is generally preferred
- * since items are automatically laid out when they are first shown (no sizing
- * is done while hidden).</p>
- */
+
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,
- /**
- * <p>The {@link Ext.Element} which encapsulates this Component. Read-only.</p>
- * <p>This will <i>usually</i> be a &lt;DIV> element created by the class's onRender method, but
- * that may be overridden using the <code>{@link #autoEl}</code> config.</p>
- * <br><p><b>Note</b>: this element will not be available until this Component has been rendered.</p><br>
- * <p>To add listeners for <b>DOM events</b> 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:</p><pre><code>
-new Ext.Panel({
- title: 'The Clickable Panel',
- listeners: {
- render: function(p) {
- // Append the Panel to the click handler&#39;s argument list.
- p.getEl().on('click', handlePanelClick.createDelegate(null, [p], true));
- },
- single: true // Remove the listener after first invocation
- }
-});
-</code></pre>
- * <p>See also <tt>{@link #getEl getEl}</p>
- * @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.
- * <p><b>Note</b>: to access items within the Container see <tt>{@link #itemId}</tt>.</p>
- * @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
- * <p>Optional. Specify an existing HTML element, or the <code>id</code> of an existing HTML element to use as the content
- * for this component.</p>
- * <ul>
- * <li><b>Description</b> :
- * <div class="sub-desc">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 <i>after the Component is rendered</i> to use as the content.</div></li>
- * <li><b>Notes</b> :
- * <div class="sub-desc">The specified HTML element is appended to the layout element of the component <i>after any configured
- * {@link #html HTML} has been inserted</i>, and so the document will not contain this element at the time the {@link #render} event is fired.</div>
- * <div class="sub-desc">The specified HTML element used will not participate in any <code><b>{@link Ext.Container#layout layout}</b></code>
- * scheme that the Component may use. It is just HTML. Layouts operate on child <code><b>{@link Ext.Container#items items}</b></code>.</div>
- * <div class="sub-desc">Add either the <code>x-hidden</code> or the <code>x-hide-display</code> CSS class to
- * prevent a brief flicker of the content before it is rendered to the panel.</div></li>
- * </ul>
- */
- /**
- * @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 <i>before</i> any configured {@link #contentEl} is appended.
- */
- /**
- * @cfg {Mixed} tpl
- * An <bold>{@link Ext.Template}</bold>, <bold>{@link Ext.XTemplate}</bold>
- * or an array of strings to form an Ext.XTemplate.
- * Used in conjunction with the <code>{@link #data}</code> and
- * <code>{@link #tplWriteMode}</code> configurations.
- */
- /**
- * @cfg {String} tplWriteMode The Ext.(X)Template method to use when
- * updating the content area of the Component. Defaults to <tt>'overwrite'</tt>
- * (see <code>{@link Ext.XTemplate#overwrite}</code>).
- */
+
+
+
+
tplWriteMode : 'overwrite',
- /**
- * @cfg {Mixed} data
- * The initial set of data to apply to the <code>{@link #tpl}</code> to
- * update the content area of the Component.
- */
- /**
- * @cfg {Array} bubbleEvents
- * <p>An array of events that, when fired, should be bubbled to any parent container.
- * See {@link Ext.util.Observable#enableBubble}.
- * Defaults to <tt>[]</tt>.
- */
+
+
bubbleEvents: [],
- // private
+
ctype : 'Ext.Component',
- // private
+
actionMode : 'el',
- // private
+
getActionEl : function(){
return this[this.actionMode];
},
@@ -17088,45 +11396,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).
- * <pre><code>
-// 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
- });
- }
-}
-</code></pre>
- */
- 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;
@@ -17134,32 +11406,7 @@ Ext.Foo = Ext.extend(Ext.Bar, {
this.enableBubble(this.bubbleEvents);
},
- /**
- * <p>Render this Component into the passed HTML element.</p>
- * <p><b>If you are using a {@link Ext.Container Container} object to house this Component, then
- * do not use the render method.</b></p>
- * <p>A Container's child Components are rendered by that Container's
- * {@link Ext.Container#layout layout} manager when the Container is first rendered.</p>
- * <p>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}.</p>
- * <p>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.</p>
- * <p>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.</p>
- * <p><b>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.</b></p>
- * @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 <b>before</b>
- * 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){
@@ -17197,8 +11444,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));
@@ -17222,11 +11469,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);
}
@@ -17239,18 +11486,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") {
@@ -17262,66 +11498,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
- * <p>A path specification, relative to the Component's <code>{@link #ownerCt}</code>
- * specifying into which ancestor Container to place a named reference to this Component.</p>
- * <p>The ancestor axis can be traversed by using '/' characters in the path.
- * For example, to put a reference to a Toolbar Button into <i>the Panel which owns the Toolbar</i>:</p><pre><code>
-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();
- }
- }
-});
-</code></pre>
- * <p>In the code above, if the <code>ref</code> had been <code>'saveButton'</code>
- * the reference would have been placed into the Toolbar. Each '/' in the <code>ref</code>
- * moves up one level from the Component's <code>{@link #ownerCt}</code>.</p>
- * <p>Also see the <code>{@link #added}</code> and <code>{@link #removed}</code> events.</p>
- */
+
if(this.ref && !this.refOwner){
var levels = this.ref.split('/'),
last = levels.length,
@@ -17334,12 +11527,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 <code>ref</code>.
- */
+
this.refOwner = t;
}
}
@@ -17352,7 +11540,7 @@ var myGrid = new Ext.grid.EditorGridPanel({
}
},
- // private
+
initState : function(){
if(Ext.state.Manager){
var id = this.getStateId();
@@ -17368,12 +11556,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++){
@@ -17382,19 +11570,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();
@@ -17408,21 +11596,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);
@@ -17432,11 +11613,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);
@@ -17446,8 +11623,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)){
@@ -17473,7 +11650,7 @@ var myGrid = new Ext.grid.EditorGridPanel({
}
},
- // private
+
getAutoCreate : function(){
var cfg = Ext.isObject(this.autoCreate) ?
this.autoCreate : Ext.apply({}, this.defaultAutoCreate);
@@ -17483,16 +11660,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){
@@ -17507,7 +11678,7 @@ var myGrid = new Ext.grid.EditorGridPanel({
this.container.remove();
}
}
- // Stop any buffered tasks
+
if(this.focusTask && this.focusTask.cancel){
this.focusTask.cancel();
}
@@ -17528,69 +11699,33 @@ var myGrid = new Ext.grid.EditorGridPanel({
}
},
- // private
+
beforeDestroy : Ext.emptyFn,
- // private
+
onDestroy : Ext.emptyFn,
- /**
- * <p>Returns the {@link Ext.Element} which encapsulates this Component.</p>
- * <p>This will <i>usually</i> be a &lt;DIV> element created by the class's onRender method, but
- * that may be overridden using the {@link #autoEl} config.</p>
- * <br><p><b>Note</b>: this element will not be available until this Component has been rendered.</p><br>
- * <p>To add listeners for <b>DOM events</b> 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:</p><pre><code>
-new Ext.Panel({
- title: 'The Clickable Panel',
- listeners: {
- render: function(p) {
- // Append the Panel to the click handler&#39;s argument list.
- p.getEl().on('click', handlePanelClick.createDelegate(null, [p], true));
- },
- single: true // Remove the listener after first invocation
- }
-});
-</code></pre>
- * @return {Ext.Element} The Element which encapsulates this Component.
- */
+
getEl : function(){
return this.el;
},
- // private
+
getContentTarget : function(){
return this.el;
},
- /**
- * Returns the <code>id</code> of this component or automatically generates and
- * returns an <code>id</code> if an <code>id</code> is not defined yet:<pre><code>
- * 'ext-comp-' + (++Ext.Component.AUTO_ID)
- * </code></pre>
- * @return {String} id
- */
+
getId : function(){
return this.id || (this.id = 'ext-comp-' + (++Ext.Component.AUTO_ID));
},
- /**
- * Returns the <code>{@link #itemId}</code> of this component. If an
- * <code>{@link #itemId}</code> was not assigned through configuration the
- * <code>id</code> is returned using <code>{@link #getId}</code>.
- * @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]);
@@ -17606,7 +11741,7 @@ new Ext.Panel({
return this;
},
- // private
+
blur : function(){
if(this.rendered){
this.el.blur();
@@ -17614,11 +11749,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();
}
@@ -17629,16 +11761,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();
@@ -17648,27 +11777,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
- * <tt>false</tt> 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;
@@ -17683,18 +11803,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
- * <tt>false</tt> 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 <code>{@link #hidden}</code>.
- * @return {Ext.Component} this
- */
+
hide : function(){
if(this.fireEvent('beforehide', this) !== false){
this.doHide();
@@ -17703,7 +11817,7 @@ new Ext.Panel({
return this;
},
- // private
+
doHide: function(){
this.hidden = true;
if(this.rendered){
@@ -17711,107 +11825,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:
- * <pre><code>
-var t = new Ext.form.TextField();
-alert(t.getXType()); // alerts 'textfield'
-</code></pre>
- * @return {String} The xtype
- */
+
getXType : function(){
return this.constructor.xtype;
},
- /**
- * <p>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).</p>
- * <p><b>If using your own subclasses, be aware that a Component must register its own xtype
- * to participate in determination of inherited xtypes.</b></p>
- * <p>For a list of all available xtypes, see the {@link Ext.Component} header.</p>
- * <p>Example usage:</p>
- * <pre><code>
-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
-</code></pre>
- * @param {String/Ext.Component/Class} xtype The xtype to check for this Component. Note that the the component can either be an instance
- * or a component class:
- * <pre><code>
-var c = new Ext.Component();
-console.log(c.isXType(c));
-console.log(c.isXType(Ext.Component));
-</code></pre>
- * @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;
},
- /**
- * <p>Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all
- * available xtypes, see the {@link Ext.Component} header.</p>
- * <p><b>If using your own subclasses, be aware that a Component must register its own xtype
- * to participate in determination of inherited xtypes.</b></p>
- * <p>Example usage:</p>
- * <pre><code>
-var t = new Ext.form.TextField();
-alert(t.getXTypes()); // alerts 'component/box/field/textfield'
-</code></pre>
- * @return {String} The xtype hierarchy string
- */
+
getXTypes : function(){
var tc = this.constructor;
if(!tc.xtypes){
@@ -17826,41 +11886,20 @@ 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/Ext.Component/Class} xtype The xtype to check for this Component. Note that the the component can either be an instance
- * or a component class:
- * @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 {Ext.Container} The first Container which matches the given xtype or class
- */
+
findParentByType : function(xtype, shallow){
return this.findParentBy(function(c){
return c.isXType(xtype, shallow);
});
},
- /**
- * Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (<i>this</i>) 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.Component} this
- */
+
bubble : function(fn, scope, args){
var p = this;
while(p){
@@ -17872,12 +11911,12 @@ alert(t.getXTypes()); // alerts 'component/box/field/textfield'
return this;
},
- // protected
+
getPositionEl : function(){
return this.positionEl || this.el;
},
- // private
+
purgeListeners : function(){
Ext.Component.superclass.purgeListeners.call(this);
if(this.mons){
@@ -17885,7 +11924,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);
@@ -17893,7 +11932,7 @@ alert(t.getXTypes()); // alerts 'component/box/field/textfield'
this.mons = [];
},
- // private
+
createMons: function(){
if(!this.mons){
this.mons = [];
@@ -17901,26 +11940,7 @@ alert(t.getXTypes()); // alerts 'component/box/field/textfield'
}
},
- /**
- * <p>Adds listeners to any Observable object (or Elements) which are automatically removed when this Component
- * is destroyed. Usage:</p><code><pre>
-myGridPanel.mon(myGridPanel.getSelectionModel(), 'selectionchange', handleSelectionChange, null, {buffer: 50});
-</pre></code>
- * <p>or:</p><code><pre>
-myGridPanel.mon(myGridPanel.getSelectionModel(), {
- selectionchange: handleSelectionChange,
- buffer: 50
-});
-</pre></code>
- * @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 <code>ename</code> parameter was an event name, this
- * is the handler function.
- * @param {Object} scope Optional. If the <code>ename</code> parameter was an event name, this
- * is the scope (<code>this</code> reference) in which the handler function is executed.
- * @param {Object} opt Optional. If the <code>ename</code> 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)){
@@ -17932,13 +11952,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
});
@@ -17954,15 +11974,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 <code>ename</code> parameter was an event name, this
- * is the handler function.
- * @param {Object} scope Optional. If the <code>ename</code> parameter was an event name, this
- * is the scope (<code>this</code> reference) in which the handler function is executed.
- */
+
mun : function(item, ename, fn, scope){
var found, mon;
this.createMons();
@@ -17978,10 +11990,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);
@@ -17992,10 +12001,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);
@@ -18006,233 +12012,109 @@ 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
- * <p>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).</p>
- * <p>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).</p>
- * Example usage:<br>
- * <pre><code>
-// 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()
-});
+Ext.Action = Ext.extend(Object, {
+
+
+
+
+
-// 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');
-</code></pre>
- * @constructor
- * @param {Object} config The configuration options
- */
-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 '').
- * <p>An example of specifying a custom icon class would be something like:
- * </p><pre><code>
-// 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; }
-</code></pre>
- */
- /**
- * @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 (<tt><b>this</b></tt> reference) in which the
- * <code>{@link #handler}</code> is executed. Defaults to this Button.
- */
constructor : function(config){
this.initialConfig = config;
this.itemId = config.itemId = (config.itemId || config.id || Ext.id());
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 <code>{@link #hide}</code> and <code>{@link #show}</code>.
- * @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 (<code>this</code> 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 (<code>this</code> 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++){
@@ -18240,49 +12122,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 <code>{@link #setHandler}</code>. 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 <tt>true</tt>
- * to use css style <tt>'display:none;'</tt> 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 || {};
@@ -18324,7 +12180,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, {
@@ -18386,9 +12242,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)){
@@ -18408,7 +12264,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';
@@ -18426,7 +12282,7 @@ Ext.extend(Ext.Layer, Ext.Element, {
}
},
- // private
+
destroy : function(){
this.hideShim();
if(this.shadow){
@@ -18441,18 +12297,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();
@@ -18460,7 +12316,7 @@ Ext.extend(Ext.Layer, Ext.Element, {
this.hideShim();
},
- // private
+
constrainXY : function(){
if(this.constrain){
var vw = Ext.lib.Dom.getViewWidth(),
@@ -18471,9 +12327,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;
@@ -18482,7 +12338,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;
@@ -18515,9 +12371,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){
@@ -18527,7 +12383,7 @@ Ext.extend(Ext.Layer, Ext.Element, {
}
},
- // private
+
hideAction : function(){
this.visible = false;
if(this.useDisplay === true){
@@ -18537,7 +12393,7 @@ Ext.extend(Ext.Layer, Ext.Element, {
}
},
- // overridden Element method
+
setVisible : function(v, a, d, c, e){
if(v){
this.showAction();
@@ -18583,26 +12439,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);
@@ -18636,7 +12492,7 @@ Ext.extend(Ext.Layer, Ext.Element, {
return this;
},
- // private
+
createCB : function(c){
var el = this;
return function(){
@@ -18648,19 +12504,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);
@@ -18671,7 +12527,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);
@@ -18682,7 +12538,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);
@@ -18693,7 +12549,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);
@@ -18708,13 +12564,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);
@@ -18728,15 +12578,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") {
@@ -18748,12 +12590,12 @@ Ext.Shadow = function(config) {
},
rad = Math.floor(this.offset / 2);
switch (this.mode.toLowerCase()) {
- // all this hideous nonsense calculates the various offsets for shadows
+
case "drop":
a.w = 0;
a.l = a.t = o;
a.t -= 1;
- if (Ext.isIE) {
+ if (Ext.isIE9m) {
a.l -= this.offset + rad;
a.t -= this.offset + rad;
a.w -= rad;
@@ -18765,7 +12607,7 @@ Ext.Shadow = function(config) {
a.w = (o * 2);
a.l = -o;
a.t = o - 1;
- if (Ext.isIE) {
+ if (Ext.isIE9m) {
a.l -= (this.offset - rad);
a.t -= this.offset + rad;
a.l += 1;
@@ -18779,7 +12621,7 @@ Ext.Shadow = function(config) {
a.l = a.t = -o;
a.t += 1;
a.h -= 2;
- if (Ext.isIE) {
+ if (Ext.isIE9m) {
a.l -= (this.offset - rad);
a.t -= (this.offset - rad);
a.l += 1;
@@ -18794,27 +12636,14 @@ Ext.Shadow = function(config) {
};
Ext.Shadow.prototype = {
- /**
- * @cfg {String} mode
- * The shadow display mode. Supports the following options:<div class="mdetail-params"><ul>
- * <li><b><tt>sides</tt></b> : Shadow displays on both sides and bottom only</li>
- * <li><b><tt>frame</tt></b> : Shadow displays equally on all four sides</li>
- * <li><b><tt>drop</tt></b> : Traditional bottom-right drop shadow</li>
- * </ul></div>
- */
- /**
- * @cfg {String} offset
- * The number of pixels to offset the shadow from the element (defaults to <tt>4</tt>)
- */
+
+
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) {
@@ -18824,7 +12653,7 @@ Ext.Shadow.prototype = {
}
}
this.el.setStyle("z-index", this.zIndex || parseInt(target.getStyle("z-index"), 10) - 1);
- if (Ext.isIE) {
+ if (Ext.isIE9m) {
this.el.dom.style.filter = "progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius=" + (this.offset) + ")";
}
this.realign(
@@ -18836,21 +12665,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;
@@ -18870,7 +12690,7 @@ Ext.Shadow.prototype = {
if (s.width != sws || s.height != shs) {
s.width = sws;
s.height = shs;
- if (!Ext.isIE) {
+ if (!Ext.isIE9m) {
cn = d.childNodes;
sww = Math.max(0, (sw - 12)) + "px";
cn[0].childNodes[1].style.width = sww;
@@ -18881,9 +12701,7 @@ Ext.Shadow.prototype = {
}
},
- /**
- * Hides this shadow
- */
+
hide: function() {
if (this.el) {
this.el.dom.style.display = "none";
@@ -18892,10 +12710,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) {
@@ -18904,10 +12719,10 @@ Ext.Shadow.prototype = {
}
};
-// Private utility class that manages the internal Shadow cache
+
Ext.Shadow.Pool = function() {
var p = [],
- markup = Ext.isIE ?
+ markup = Ext.isIE9m ?
'<div class="x-ie-shadow"></div>':
'<div class="x-shadow"><div class="xst"><div class="xstl"></div><div class="xstc"></div><div class="xstr"></div></div><div class="xsc"><div class="xsml"></div><div class="xsmc"></div><div class="xsmr"></div></div><div class="xsb"><div class="xsbl"></div><div class="xsbc"></div><div class="xsbr"></div></div></div>';
return {
@@ -18924,280 +12739,55 @@ Ext.Shadow.Pool = function() {
p.push(sh);
}
};
-}();/**
- * @class Ext.BoxComponent
- * @extends Ext.Component
- * <p>Base class for any {@link Ext.Component Component} that is to be sized as a box, using width and height.</p>
- * <p>BoxComponent provides automatic box model adjustments for sizing and positioning and will work correctly
- * within the Component rendering model.</p>
- * <p>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 <b>Box</b>Component in order to have its width and height managed.</p>
- * <p>To use a pre-existing element as a BoxComponent, configure it so that you preset the <b>el</b> property to the
- * element to reference:<pre><code>
-var pageHeader = new Ext.BoxComponent({
- el: 'my-header-div'
-});</code></pre>
- * This may then be {@link Ext.Container#add added} to a {@link Ext.Container Container} as a child item.</p>
- * <p>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:<pre><code>
-var myImage = new Ext.BoxComponent({
- autoEl: {
- tag: 'img',
- src: '/images/my-image.jpg'
- }
-});</code></pre></p>
- * @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
- * <p><b>Note</b>: this config is only used when this Component is rendered
- * by a Container which has been configured to use a <b>{@link Ext.layout.BoxLayout BoxLayout}.</b>
- * Each child Component with a <code>flex</code> property will be flexed either vertically (by a VBoxLayout)
- * or horizontally (by an HBoxLayout) according to the item's <b>relative</b> <code>flex</code> value
- * compared to the sum of all Components with <code>flex</flex> value specified. Any child items that have
- * either a <code>flex = 0</code> or <code>flex = undefined</code> 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 <p><b>Note</b>: this config is only used when this Component is rendered
- * by a Container which has been configured to use an <b>{@link Ext.layout.AnchorLayout AnchorLayout} (or subclass thereof).</b>
- * based layout manager, for example:<div class="mdetail-params"><ul>
- * <li>{@link Ext.form.FormPanel}</li>
- * <li>specifying <code>layout: 'anchor' // or 'form', or 'absolute'</code></li>
- * </ul></div></p>
- * <p>See {@link Ext.layout.AnchorLayout}.{@link Ext.layout.AnchorLayout#anchor anchor} also.</p>
- */
- // tabTip config is used when a BoxComponent is a child of a TabPanel
- /**
- * @cfg {String} tabTip
- * <p><b>Note</b>: this config is only used when this BoxComponent is a child item of a TabPanel.</p>
- * 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 <p><b>Note</b>: this config is only used when this BoxComponent is rendered
- * by a Container which has been configured to use the <b>{@link Ext.layout.BorderLayout BorderLayout}</b>
- * layout manager (e.g. specifying <tt>layout:'border'</tt>).</p><br>
- * <p>See {@link Ext.layout.BorderLayout} also.</p>
- */
- // margins config is used when a BoxComponent is rendered by BorderLayout or BoxLayout.
- /**
- * @cfg {Object} margins <p><b>Note</b>: this config is only used when this BoxComponent is rendered
- * by a Container which has been configured to use the <b>{@link Ext.layout.BorderLayout BorderLayout}</b>
- * or one of the two <b>{@link Ext.layout.BoxLayout BoxLayout} subclasses.</b></p>
- * <p>An object containing margins to apply to this BoxComponent in the
- * format:</p><pre><code>
-{
- top: (top margin),
- right: (right margin),
- bottom: (bottom margin),
- left: (left margin)
-}</code></pre>
- * <p>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:</p>
- * <p><div class="mdetail-params"><ul>
- * <li>If there is only one value, it applies to all sides.</li>
- * <li>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.</li>
- * <li>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.</li>
- * <li>If there are four values, they apply to the top, right, bottom, and left, respectively.</li>
- * </ul></div></p>
- * <p>Defaults to:</p><pre><code>
- * {top:0, right:0, bottom:0, left:0}
- * </code></pre>
- */
- /**
- * @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).
- * <b>Note</b> 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).
- * <b>Note</b> to express this dimension as a percentage or offset see {@link Ext.Component#anchor}.
- */
- /**
- * @cfg {Number} boxMinHeight
- * <p>The minimum value in pixels which this BoxComponent will set its height to.</p>
- * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
- */
- /**
- * @cfg {Number} boxMinWidth
- * <p>The minimum value in pixels which this BoxComponent will set its width to.</p>
- * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
- */
- /**
- * @cfg {Number} boxMaxHeight
- * <p>The maximum value in pixels which this BoxComponent will set its height to.</p>
- * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
- */
- /**
- * @cfg {Number} boxMaxWidth
- * <p>The maximum value in pixels which this BoxComponent will set its width to.</p>
- * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
- */
- /**
- * @cfg {Boolean} autoHeight
- * <p>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.</p>
- * <p><b>Note</b>: 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.</p>
- * <p>If the <i>browser</i> 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:</p><pre><code>
-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();
-</code></pre>
- */
- /**
- * @cfg {Boolean} autoWidth
- * <p>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.</p>
- * <p><b>Note</b>: 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.</p>
- * <p>If the <i>browser</i> 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:</p><pre><code>
-&lt;div id='grid-container' style='margin-left:25%;width:50%'>&lt;/div>
-</code></pre>
- * 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:<pre><code>
-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'
- }],
-});
-</code></pre>
- */
- /**
- * @cfg {Boolean} autoScroll
- * <code>true</code> to use overflow:'auto' on the components layout element and show scroll bars automatically when
- * necessary, <code>false</code> to clip any overflowing content (defaults to <code>false</code>).
- */
- /* // 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 <code>{width:10, height:20}</code>.
- * @param {Mixed} width The new width to set. This may be one of:<div class="mdetail-params"><ul>
- * <li>A Number specifying the new width in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).</li>
- * <li>A String used to set the CSS width style.</li>
- * <li>A size object in the format <code>{width: widthValue, height: heightValue}</code>.</li>
- * <li><code>undefined</code> to leave the width unchanged.</li>
- * </ul></div>
- * @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:<div class="mdetail-params"><ul>
- * <li>A Number specifying the new height in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).</li>
- * <li>A String used to set the CSS height style. Animation may <b>not</b> be used.</li>
- * <li><code>undefined</code> to leave the height unchanged.</li>
- * </ul></div>
- * @return {Ext.BoxComponent} this
- */
+
setSize : function(w, h){
- // support for standard size objects
+
if(typeof w == 'object'){
h = w.height;
w = w.width;
@@ -19214,14 +12804,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;
}
@@ -19230,7 +12820,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);
@@ -19245,70 +12835,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:<div class="mdetail-params"><ul>
- * <li>A Number specifying the new width in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit defaultUnit}s (by default, pixels).</li>
- * <li>A String used to set the CSS width style.</li>
- * </ul></div>
- * @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:<div class="mdetail-params"><ul>
- * <li>A Number specifying the new height in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit defaultUnit}s (by default, pixels).</li>
- * <li>A String used to set the CSS height style.</li>
- * <li><i>undefined</i> to leave the height unchanged.</li>
- * </ul></div>
- * @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){
@@ -19317,11 +12876,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();
@@ -19330,37 +12885,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;
},
- /**
- * <p>Returns the outermost Element of this Component which defines the Components overall size.</p>
- * <p><i>Usually</i> this will return the same Element as <code>{@link #getEl}</code>,
- * but in some cases, a Component may have some more wrapping Elements around its main
- * active Element.</p>
- * <p>An example is a ComboBox. It is encased in a <i>wrapping</i> Element which
- * contains both the <code>&lt;input></code> Element (which is what would be returned
- * by its <code>{@link #getEl}</code> method, <i>and</i> the trigger button Element.
- * This Element is returned as the <code>resizeEl</code>.
- * @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' : '');
@@ -19369,13 +12906,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];
@@ -19404,13 +12935,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];
@@ -19421,7 +12946,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);
@@ -19429,7 +12954,7 @@ var myPanel = new Ext.Panel({
return this;
},
- // private
+
afterRender : function(){
Ext.BoxComponent.superclass.afterRender.call(this);
if(this.resizeEl){
@@ -19448,38 +12973,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';
@@ -19490,7 +13000,7 @@ var myPanel = new Ext.Panel({
return {width : w, height: h};
},
- // private
+
adjustPosition : function(x, y){
return {x : x, y: y};
}
@@ -19498,142 +13008,76 @@ var myPanel = new Ext.Panel({
Ext.reg('box', Ext.BoxComponent);
-/**
- * @class Ext.Spacer
- * @extends Ext.BoxComponent
- * <p>Used to provide a sizable space in a layout.</p>
- * @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).
- * <br><br>
- * Usage:
- * <pre><code>
-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);
-</code></pre>
- * @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.el.unselectable();
+
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 <i>undefined</i>, 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"
@@ -19677,9 +13121,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);
@@ -19711,59 +13153,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;
@@ -19771,10 +13192,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();
@@ -19785,9 +13203,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);
@@ -19797,23 +13213,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();
@@ -19822,12 +13231,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){
@@ -19852,14 +13256,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);
@@ -19897,488 +13294,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
- * <p>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.</p>
- *
- * <p>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
- * <code><b>{@link Ext.Component#autoEl autoEl}</b></code> config option. This is a useful technique when creating
- * embedded {@link Ext.layout.ColumnLayout column} layouts inside {@link Ext.form.FormPanel FormPanels}
- * for example.</p>
- *
- * <p>The code below illustrates both how to explicitly create a Container, and how to implicitly
- * create one using the <b><code>'container'</code></b> xtype:<pre><code>
-// 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 &lt;DIV> element.
- items: [{
- items: {
- xtype: 'datefield',
- name: 'startDate',
- fieldLabel: 'Start date'
- }
- }, {
- items: {
- xtype: 'datefield',
- name: 'endDate',
- fieldLabel: 'End date'
- }
- }]
-});</code></pre></p>
- *
- * <p><u><b>Layout</b></u></p>
- * <p>Container classes delegate the rendering of child Components to a layout
- * manager class which must be configured into the Container using the
- * <code><b>{@link #layout}</b></code> configuration property.</p>
- * <p>When either specifying child <code>{@link #items}</code> 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
- * <b><code>{@link #layout}</code></b> 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 <b>does not apply any sizing</b> at all.</p>
- * <p>A common mistake is when a developer neglects to specify a
- * <b><code>{@link #layout}</code></b> (e.g. widgets like GridPanels or
- * TreePanels are added to Containers for which no <code><b>{@link #layout}</b></code>
- * 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.</p>
- * <p>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:<pre><code>
-// Create the GridPanel.
-var myNewGrid = new Ext.grid.GridPanel({
- store: myStore,
- columns: myColumnModel,
- title: 'Results', // the title becomes the title of the tab
-});
-myTabPanel.add(myNewGrid); // {@link Ext.TabPanel} implicitly uses {@link Ext.layout.CardLayout CardLayout}
-myTabPanel.{@link Ext.TabPanel#setActiveTab setActiveTab}(myNewGrid);
- * </code></pre></p>
- * <p>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.
- * <p><b><u>Overnesting is a common problem</u></b>.
- * An example of overnesting occurs when a GridPanel is added to a TabPanel
- * by wrapping the GridPanel <i>inside</i> a wrapping Panel (that has no
- * <code><b>{@link #layout}</b></code> specified) and then add that wrapping Panel
- * to the TabPanel. The point to realize is that a GridPanel <b>is</b> a
- * Component which can be added directly to a Container. If the wrapping Panel
- * has no <code><b>{@link #layout}</b></code> configuration, then the overnested
- * GridPanel will not be sized as expected.<p>
- *
- * <p><u><b>Adding via remote configuration</b></u></p>
- *
- * <p>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:
- * </p><pre><code>
-// 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");
- }
-});
-</code></pre>
- * <p>The server script needs to return an executable Javascript statement which, when processed
- * using <code>eval()</code>, will return either a config object with an {@link Ext.Component#xtype xtype},
- * or an instantiated Component. The server might return this for example:</p><pre><code>
-(function() {
- function formatDate(value){
- return value ? value.dateFormat('M d, Y') : '';
- };
+Ext.Container = Ext.extend(Ext.BoxComponent, {
+
+
- 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'}
- ])
- });
- 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
-})();
-</code></pre>
- * <p>When the above code fragment is passed through the <code>eval</code> 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.</p>
- * <p>Note: since the code above is <i>generated</i> by a server script, the <code>baseParams</code> 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.</p>
- *
- * @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 <code>{@link #layout}</code> and should not need
- * to be set manually.
- */
- /**
- * @cfg {String/Object} layout
- * <p><b>*Important</b>: In order for child items to be correctly sized and
- * positioned, typically a layout manager <b>must</b> be specified through
- * the <code>layout</code> configuration option.</p>
- * <br><p>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:</p><pre><code>
-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();
- * </code></pre>
- * <p>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 <code>layout:'form'</code>). Other specific
- * purpose classes internally specify/manage their internal layout (e.g.
- * GridPanel, TabPanel, TreePanel, Toolbar, Menu, etc.).</p>
- * <br><p><b><code>layout</code></b> may be specified as either as an Object or
- * as a String:</p><div><ul class="mdetail-params">
- *
- * <li><u>Specify as an Object</u></li>
- * <div><ul class="mdetail-params">
- * <li>Example usage:</li>
-<pre><code>
-layout: {
- type: 'vbox',
- padding: '5',
- align: 'left'
-}
-</code></pre>
- *
- * <li><code><b>type</b></code></li>
- * <br/><p>The layout type to be used for this container. If not specified,
- * a default {@link Ext.layout.ContainerLayout} will be created and used.</p>
- * <br/><p>Valid layout <code>type</code> values are:</p>
- * <div class="sub-desc"><ul class="mdetail-params">
- * <li><code><b>{@link Ext.layout.AbsoluteLayout absolute}</b></code></li>
- * <li><code><b>{@link Ext.layout.AccordionLayout accordion}</b></code></li>
- * <li><code><b>{@link Ext.layout.AnchorLayout anchor}</b></code></li>
- * <li><code><b>{@link Ext.layout.ContainerLayout auto}</b></code> &nbsp;&nbsp;&nbsp; <b>Default</b></li>
- * <li><code><b>{@link Ext.layout.BorderLayout border}</b></code></li>
- * <li><code><b>{@link Ext.layout.CardLayout card}</b></code></li>
- * <li><code><b>{@link Ext.layout.ColumnLayout column}</b></code></li>
- * <li><code><b>{@link Ext.layout.FitLayout fit}</b></code></li>
- * <li><code><b>{@link Ext.layout.FormLayout form}</b></code></li>
- * <li><code><b>{@link Ext.layout.HBoxLayout hbox}</b></code></li>
- * <li><code><b>{@link Ext.layout.MenuLayout menu}</b></code></li>
- * <li><code><b>{@link Ext.layout.TableLayout table}</b></code></li>
- * <li><code><b>{@link Ext.layout.ToolbarLayout toolbar}</b></code></li>
- * <li><code><b>{@link Ext.layout.VBoxLayout vbox}</b></code></li>
- * </ul></div>
- *
- * <li>Layout specific configuration properties</li>
- * <br/><p>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 <code>type</code>
- * specified.</p>
- *
- * </ul></div>
- *
- * <li><u>Specify as a String</u></li>
- * <div><ul class="mdetail-params">
- * <li>Example usage:</li>
-<pre><code>
-layout: 'vbox',
-layoutConfig: {
- padding: '5',
- align: 'left'
-}
-</code></pre>
- * <li><code><b>layout</b></code></li>
- * <br/><p>The layout <code>type</code> to be used for this container (see list
- * of valid layout type values above).</p><br/>
- * <li><code><b>{@link #layoutConfig}</b></code></li>
- * <br/><p>Additional layout specific configuration properties. For complete
- * details regarding the valid config options for each layout type, see the
- * layout class corresponding to the <code>layout</code> specified.</p>
- * </ul></div></ul></div>
- */
- /**
- * @cfg {Object} layoutConfig
- * This is a config object containing properties specific to the chosen
- * <b><code>{@link #layout}</code></b> if <b><code>{@link #layout}</code></b>
- * has been specified as a <i>string</i>.</p>
- */
- /**
- * @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 <code>50</code>.
- */
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
- * <pre><b>** IMPORTANT</b>: be sure to <b>{@link #layout specify a <code>layout</code>} if needed ! **</b></pre>
- * <p>A single item, or an array of child Components to be added to this container,
- * for example:</p>
- * <pre><code>
-// specifying a single item
-items: {...},
-layout: 'fit', // specify a layout!
-
-// specifying multiple items
-items: [{...}, {...}],
-layout: 'anchor', // specify a layout!
- * </code></pre>
- * <p>Each item may be:</p>
- * <div><ul class="mdetail-params">
- * <li>any type of object based on {@link Ext.Component}</li>
- * <li>a fully instanciated object or</li>
- * <li>an object literal that:</li>
- * <div><ul class="mdetail-params">
- * <li>has a specified <code>{@link Ext.Component#xtype xtype}</code></li>
- * <li>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}.</li>
- * <li>If an <code>{@link Ext.Component#xtype xtype}</code> is not explicitly
- * specified, the {@link #defaultType} for that Container is used.</li>
- * <li>will be "lazily instanciated", avoiding the overhead of constructing a fully
- * instanciated Component object</li>
- * </ul></div></ul></div>
- * <p><b>Notes</b>:</p>
- * <div><ul class="mdetail-params">
- * <li>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.</li>
- * <li>Do not specify <code>{@link Ext.Panel#contentEl contentEl}</code>/
- * <code>{@link Ext.Panel#html html}</code> with <code>items</code>.</li>
- * </ul></div>
- */
- /**
- * @cfg {Object|Function} defaults
- * <p>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.</p>
- * <p>If an added item is a config object, and <b>not</b> an instantiated Component, then the default properties are
- * unconditionally applied. If the added item <b>is</b> an instantiated Component, then the default properties are
- * applied conditionally so as not to override existing properties in the item.</p>
- * <p>If the defaults option is specified as a function, then the function will be called using this Container as the
- * scope (<code>this</code> 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.</p>
- * <p>For example, to automatically apply padding to the body of each of a set of
- * contained {@link Ext.Panel} items, you could pass: <code>defaults: {bodyStyle:'padding:15px'}</code>.</p>
- * <p>Usage:</p><pre><code>
-defaults: { // defaults are applied to items, not the container
- autoScroll:true
-},
-items: [
- {
- xtype: 'panel', // defaults <b>do not</b> 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 <b>do</b> have precedence over options
- id: 'panel2', // options in components, so the defaults
- autoScroll: false // will be applied here, panel2 will be autoScroll:true.
- })
-]
- * </code></pre>
- */
- /** @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
- * <p>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.</p>
- * <p>Defaults to <code>'panel'</code>, except {@link Ext.menu.Menu} which defaults to <code>'menuitem'</code>,
- * and {@link Ext.Toolbar} and {@link Ext.ButtonGroup} which default to <code>'button'</code>.</p>
- */
+
+
defaultType : 'panel',
- /** @cfg {String} resizeEvent
- * The event to listen to for resizing in layouts. Defaults to <code>'resize'</code>.
- */
+
resizeEvent: 'resize',
- /**
- * @cfg {Array} bubbleEvents
- * <p>An array of events that, when fired, should be bubbled to any parent container.
- * See {@link Ext.util.Observable#enableBubble}.
- * Defaults to <code>['add', 'remove']</code>.
- */
+
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;
@@ -20386,15 +13365,15 @@ 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);
@@ -20405,8 +13384,8 @@ items: [
},
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';
@@ -20420,72 +13399,36 @@ items: [
}
this.setLayout(this.layout);
- // If a CardLayout, the active item set
+
if(this.activeItem !== undefined && this.layout.setActiveItem){
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]);
}
},
- /**
- * <p>Returns the Element to be used to contain the child Components of this Container.</p>
- * <p>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.</p>
- * @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();
},
- /**
- * <p>Adds {@link Ext.Component Component}(s) to this Container.</p>
- * <br><p><b>Description</b></u> :
- * <div><ul class="mdetail-params">
- * <li>Fires the {@link #beforeadd} event before adding</li>
- * <li>The Container's {@link #defaults default config values} will be applied
- * accordingly (see <code>{@link #defaults}</code> for details).</li>
- * <li>Fires the {@link #add} event after the component has been added.</li>
- * </ul></div>
- * <br><p><b>Notes</b></u> :
- * <div><ul class="mdetail-params">
- * <li>If the Container is <i>already rendered</i> when <code>add</code>
- * 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
- * <code>add</code> multiple child components if needed while only refreshing the layout
- * once. For example:<pre><code>
-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
- * </code></pre></li>
- * <li><i>Warning:</i> 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.</li>
- * </ul></div>
- * @param {...Object/Array} component
- * <p>Either one or more Components to add or an Array of Components to add. See
- * <code>{@link #items}</code> for additional information.</p>
- * @return {Ext.Component/Array} The Components that were added.
- */
+
add : function(comp){
this.initItems();
var args = arguments.length > 1;
@@ -20500,7 +13443,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);
@@ -20509,39 +13452,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.<br><br>
- * Ext uses lazy rendering, and will only render the inserted Component should
- * it become necessary.<br><br>
- * 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.<br><br>
- * 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) {
var args = arguments,
length = args.length,
@@ -20573,7 +13499,7 @@ tb.{@link #doLayout}(); // refresh the layout
return c;
},
- // private
+
applyDefaults : function(c){
var d = this.defaults;
if(d){
@@ -20592,7 +13518,7 @@ tb.{@link #doLayout}(); // refresh the layout
return c;
},
- // private
+
onBeforeAdd : function(item){
if(item.ownerCt){
item.ownerCt.remove(item, false);
@@ -20602,14 +13528,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);
@@ -20621,10 +13540,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;
@@ -20643,12 +13562,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 = [];
@@ -20665,19 +13579,7 @@ tb.{@link #doLayout}(); // refresh the layout
return items;
},
- /**
- * Examines this container's <code>{@link #items}</code> <b>property</b>
- * and gets a direct child component of this container.
- * @param {String/Number} comp This parameter may be any of the following:
- * <div><ul class="mdetail-params">
- * <li>a <b><code>String</code></b> : representing the <code>{@link Ext.Component#itemId itemId}</code>
- * or <code>{@link Ext.Component#id id}</code> of the child component </li>
- * <li>a <b><code>Number</code></b> : representing the position of the child component
- * within the <code>{@link #items}</code> <b>property</b></li>
- * </ul></div>
- * <p>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();
@@ -20685,7 +13587,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);
@@ -20695,13 +13597,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);
@@ -20710,24 +13612,13 @@ tb.{@link #doLayout}(); // refresh the layout
return c;
},
- /**
- * @private
- * 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.
- */
+
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,
@@ -20757,32 +13648,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){
@@ -20794,20 +13681,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);
@@ -20816,7 +13699,7 @@ tb.{@link #doLayout}(); // refresh the layout
return this.layout;
},
- // private
+
beforeDestroy : function(){
var c;
if(this.items){
@@ -20831,17 +13714,7 @@ tb.{@link #doLayout}(); // refresh the layout
Ext.Container.superclass.beforeDestroy.call(this);
},
- /**
- * Cascades down the component/container heirarchy from this component (called first), calling the specified function with
- * each component. The scope (<i>this</i>) 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){
@@ -20858,13 +13731,7 @@ tb.{@link #doLayout}(); // refresh the layout
return this;
},
- /**
- * Find a component under this container at any level by id
- * @param {String} id
- * @deprecated Fairly useless method, since you can just use Ext.getCmp. Should be removed for 4.0
- * If you need to test if an id belongs to a container, you can use getCmp and findParent*.
- * @return Ext.Component
- */
+
findById : function(id){
var m = null,
ct = this;
@@ -20877,38 +13744,21 @@ tb.{@link #doLayout}(); // refresh the layout
return m;
},
- /**
- * 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){
@@ -20919,12 +13769,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
- * @deprecated Should be removed in 4.0, since getComponent does the same thing.
- * @return {Ext.Component} Ext.Component
- */
+
get : function(key){
return this.getComponent(key);
}
@@ -20932,49 +13777,16 @@ tb.{@link #doLayout}(); // refresh the layout
Ext.Container.LAYOUTS = {};
Ext.reg('container', Ext.Container);
-/**
- * @class Ext.layout.ContainerLayout
- * <p>This class is intended to be extended or created via the <tt><b>{@link Ext.Container#layout layout}</b></tt>
- * configuration property. See <tt><b>{@link Ext.Container#layout}</b></tt> for additional details.</p>
- */
+
Ext.layout.ContainerLayout = Ext.extend(Object, {
- /**
- * @cfg {String} extraCls
- * <p>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.</p>
- * <p><b>Note</b>: <tt>extraCls</tt> defaults to <tt>''</tt> except for the following classes
- * which assign a value by default:
- * <div class="mdetail-params"><ul>
- * <li>{@link Ext.layout.AbsoluteLayout Absolute Layout} : <tt>'x-abs-layout-item'</tt></li>
- * <li>{@link Ext.layout.Box Box Layout} : <tt>'x-box-item'</tt></li>
- * <li>{@link Ext.layout.ColumnLayout Column Layout} : <tt>'x-column'</tt></li>
- * </ul></div>
- * To configure the above Classes with an extra CSS class append to the default. For example,
- * for ColumnLayout:<pre><code>
- * extraCls: 'x-column custom-class'
- * </code></pre>
- * </p>
- */
- /**
- * @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, <pre><code>
- * if(myPanel.layout.activeItem.id == 'item-1') { ... }
- * </code></pre>
- * <tt>activeItem</tt> 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){
@@ -20984,10 +13796,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++) {
@@ -21009,10 +13818,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))){
@@ -21022,17 +13831,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++) {
@@ -21043,14 +13852,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) {
@@ -21068,8 +13870,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++) {
@@ -21080,17 +13882,14 @@ Ext.layout.ContainerLayout = Ext.extend(Object, {
return items;
},
- /**
- * @private
- * Applies extraCls and hides the item if renderHidden is true
- */
+
configureItem: function(c){
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();
}
@@ -21116,7 +13915,7 @@ Ext.layout.ContainerLayout = Ext.extend(Object, {
}
},
- // private
+
onResize: function(){
var ct = this.container,
b;
@@ -21142,15 +13941,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){
@@ -21163,12 +13956,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();
@@ -21193,15 +13981,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(
'<div class="x-form-item {itemCls}" tabIndex="-1">',
@@ -21214,13 +13994,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();
}
@@ -21234,13 +14010,7 @@ Ext.layout.ContainerLayout = Ext.extend(Object, {
}
}
}
-});/**
- * @class Ext.layout.AutoLayout
- * <p>The AutoLayout is the default layout manager delegated by {@link Ext.Container} to
- * render any child Components when no <tt>{@link Ext.Container#layout layout}</tt> is configured into
- * a {@link Ext.Container Container}.</tt>. AutoLayout provides only a passthrough of any layout calls
- * to any child containers.</p>
- */
+});
Ext.layout.AutoLayout = Ext.extend(Ext.layout.ContainerLayout, {
type: 'auto',
@@ -21252,7 +14022,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);
}
}
@@ -21260,29 +14030,9 @@ Ext.layout.AutoLayout = Ext.extend(Ext.layout.ContainerLayout, {
});
Ext.Container.LAYOUTS['auto'] = Ext.layout.AutoLayout;
-/**
- * @class Ext.layout.FitLayout
- * @extends Ext.layout.ContainerLayout
- * <p>This is a base class for layouts that contain <b>a single item</b> that automatically expands to fill the layout's
- * container. This class is intended to be extended or created via the <tt>layout:'fit'</tt> {@link Ext.Container#layout}
- * config, and should generally not need to be created directly via the new keyword.</p>
- * <p>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:</p>
- * <pre><code>
-var p = new Ext.Panel({
- title: 'Fit Layout',
- layout:'fit',
- items: {
- title: 'Inner Panel',
- html: '&lt;p&gt;This is the inner panel content&lt;/p&gt;',
- border: false
- }
-});
-</code></pre>
- */
+
Ext.layout.FitLayout = Ext.extend(Ext.layout.ContainerLayout, {
- // private
+
monitorResize:true,
type: 'fit',
@@ -21292,11 +14042,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){
@@ -21304,115 +14054,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
- * <p>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.</p>
- * <p>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.</p>
- * <p>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:</p>
- * <pre><code>
-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: '&lt;h1&gt;Welcome to the Wizard!&lt;/h1&gt;&lt;p&gt;Step 1 of 3&lt;/p&gt;'
- },{
- id: 'card-1',
- html: '&lt;p&gt;Step 2 of 3&lt;/p&gt;'
- },{
- id: 'card-2',
- html: '&lt;h1&gt;Congratulations!&lt;/h1&gt;&lt;p&gt;Step 3 of 3 - Complete&lt;/p&gt;'
- }]
-});
-</code></pre>
- */
+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) {
@@ -21423,14 +14095,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();
@@ -21442,7 +14114,7 @@ Ext.layout.CardLayout = Ext.extend(Ext.layout.FitLayout, {
}
},
- // private
+
renderAll : function(ct, target){
if(this.deferredRender){
this.renderItem(this.activeItem, undefined, target);
@@ -21452,103 +14124,16 @@ Ext.layout.CardLayout = Ext.extend(Ext.layout.FitLayout, {
}
});
Ext.Container.LAYOUTS['card'] = Ext.layout.CardLayout;
-/**
- * @class Ext.layout.AnchorLayout
- * @extends Ext.layout.ContainerLayout
- * <p>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
- * <b><tt>{@link #anchor}</tt></b> rules.</p>
- * <p>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.</p>
- * <p>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 <b>anchorSize</b>.
- * 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:</p>
- * <pre><code>
-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%'
- }]
-});
- * </code></pre>
- */
+
Ext.layout.AnchorLayout = Ext.extend(Ext.layout.ContainerLayout, {
- /**
- * @cfg {String} anchor
- * <p>This configuation option is to be applied to <b>child <tt>items</tt></b> of a container managed by
- * this layout (ie. configured with <tt>layout:'anchor'</tt>).</p><br/>
- *
- * <p>This value is what tells the layout how an item should be anchored to the container. <tt>items</tt>
- * added to an AnchorLayout accept an anchoring-specific config property of <b>anchor</b> 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:<div class="mdetail-params"><ul>
- *
- * <li><b>Percentage</b> : Any value between 1 and 100, expressed as a percentage.<div class="sub-desc">
- * 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:<pre><code>
-// 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
- * </code></pre></div></li>
- *
- * <li><b>Offsets</b> : Any positive or negative integer value.<div class="sub-desc">
- * 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:<pre><code>
-// 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
- * </code></pre></div></li>
- *
- * <li><b>Sides</b> : Valid values are <tt>'right'</tt> (or <tt>'r'</tt>) and <tt>'bottom'</tt>
- * (or <tt>'b'</tt>).<div class="sub-desc">
- * 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.</div></li>
- *
- * <li><b>Mixed</b> : <div class="sub-desc">
- * 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:
- * <pre><code>
-anchor: '-50 75%'
- * </code></pre></div></li>
- *
- *
- * </ul></div>
- */
- // 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,
@@ -21559,10 +14144,10 @@ anchor: '-50 75%'
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){
+
+
+
+ if (Ext.isIE9m && Ext.isStrict && ret.width == 0){
ret = target.getStyleSize();
}
ret.width -= target.getPadding('lr');
@@ -21571,7 +14156,7 @@ anchor: '-50 75%'
return ret;
},
- // private
+
onLayout : function(container, target) {
Ext.layout.AnchorLayout.superclass.onLayout.call(this, container, target);
@@ -21598,7 +14183,7 @@ anchor: '-50 75%'
return;
}
- // find the container anchoring size
+
if(container.anchorSize) {
if(typeof container.anchorSize == 'number') {
anchorWidth = container.anchorSize;
@@ -21615,14 +14200,14 @@ anchor: '-50 75%'
component = components[i];
el = component.getPositionEl();
- // If a child container item has no anchor and no specific width, set the child to the default anchor size
+
if (!component.anchor && component.items && !Ext.isNumber(component.width) && !(Ext.isIE6 && Ext.isStrict)){
component.anchor = this.defaultAnchor;
}
if(component.anchor) {
anchorSpec = component.anchorSpec;
- // cache all anchor values
+
if(!anchorSpec){
anchorsArray = component.anchor.split(' ');
component.anchorSpec = anchorSpec = {
@@ -21658,11 +14243,11 @@ anchor: '-50 75%'
delete this.adjustmentPass;
},
- // 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){
@@ -21671,7 +14256,7 @@ anchor: '-50 75%'
return v - diff;
}
};
- // percentage
+
} else if(a.indexOf('%') != -1) {
var ratio = parseFloat(a.replace('%', ''))*.01;
return function(v){
@@ -21680,7 +14265,7 @@ anchor: '-50 75%'
return Math.floor(v*ratio);
}
};
- // simple offset adjustment
+
} else {
a = parseInt(a, 10);
if (!isNaN(a)) {
@@ -21696,82 +14281,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
- * <p>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.</p>
- * <p>ColumnLayout does not have any direct config options (other than inherited ones), but it does support a
- * specific config property of <b><tt>columnWidth</tt></b> 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).</p>
- * <p>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).</p>
- * <p>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 <b>remaining</b> 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:</p>
- * <pre><code>
-// 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
- }]
-});
-</code></pre>
- */
Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, {
- // private
+
monitorResize:true,
type: 'column',
@@ -21780,7 +14305,7 @@ Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, {
scrollOffset : 0,
- // private
+
targetCls: 'x-column-layout-ct',
@@ -21793,10 +14318,10 @@ 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){
+
+
+
+ if (Ext.isIE9m && Ext.isStrict && ret.width == 0){
ret = target.getStyleSize();
}
@@ -21808,15 +14333,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,
@@ -21829,7 +14354,7 @@ Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, {
var size = this.getLayoutTargetSize();
- if(size.width < 1 && size.height < 1){ // display none?
+ if (Ext.isIE9m && (size.width < 1 && size.height < 1)) {
return;
}
@@ -21839,8 +14364,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];
@@ -21861,9 +14386,9 @@ 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 (Ext.isIE9m) {
if (i = target.getStyle('overflow') && i != 'hidden' && !this.adjustmentPass) {
var ts = this.getLayoutTargetSize();
if (ts.width != size.width){
@@ -21875,96 +14400,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
- * <p>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.</p>
- * <p>This class is intended to be extended or created via the <tt>layout:'border'</tt>
- * {@link Ext.Container#layout} config, and should generally not need to be created directly
- * via the new keyword.</p>
- * <p>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.</p>
- * <p>Example usage:</p>
- * <pre><code>
-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'
- }]
-});
-</code></pre>
- * <p><b><u>Notes</u></b>:</p><div class="mdetail-params"><ul>
- * <li>Any container using the BorderLayout <b>must</b> have a child item with <tt>region:'center'</tt>.
- * 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.</li>
- * <li>Any child items with a region of <tt>west</tt> or <tt>east</tt> must have <tt>width</tt> defined
- * (an integer representing the number of pixels that the region should take up).</li>
- * <li>Any child items with a region of <tt>north</tt> or <tt>south</tt> must have <tt>height</tt> defined.</li>
- * <li>The regions of a BorderLayout are <b>fixed at render time</b> and thereafter, its child Components may not be removed or added</b>. 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:
- * <div style="margin-left:16px"><pre><code>
-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}();
- * </code></pre></div>
- * </li>
- * <li> To reference a {@link Ext.layout.BorderLayout.Region Region}:
- * <div style="margin-left:16px"><pre><code>
-wr = myBorderPanel.layout.west;
- * </code></pre></div>
- * </li>
- * </ul></div>
- */
+
Ext.layout.BorderLayout = Ext.extend(Ext.layout.ContainerLayout, {
- // private
+
monitorResize:true,
- // private
+
rendered : false,
type: 'border',
@@ -21976,7 +14420,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){
@@ -22001,7 +14445,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;
}
@@ -22075,10 +14519,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.isIE9m && 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){
@@ -22104,28 +14548,10 @@ Ext.layout.BorderLayout = Ext.extend(Ext.layout.ContainerLayout, {
Ext.layout.BorderLayout.superclass.destroy.call(this);
}
- /**
- * @property activeItem
- * @hide
- */
+
});
-/**
- * @class Ext.layout.BorderLayout.Region
- * <p>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}.</p>
- * <p>Region size is managed automatically and cannot be changed by the user -- for
- * {@link #split resizable regions}, see {@link Ext.layout.BorderLayout.SplitRegion}.</p>
- * @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: <tt>north</tt>, <tt>south</tt>,
- * <tt>east</tt>, <tt>west</tt> and <tt>center</tt>. Every {@link Ext.layout.BorderLayout BorderLayout}
- * <b>must have a center region</b> for the primary content -- all other regions are optional.
- */
+
Ext.layout.BorderLayout.Region = function(layout, config, pos){
Ext.apply(this, config);
this.layout = layout;
@@ -22149,166 +14575,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
- * <tt>{@link #autoHide} = false</tt>). Setting <tt>{@link #animFloat} = false</tt> will
- * prevent the open and close of these floated panels from being animated (defaults to <tt>true</tt>).
- */
- /**
- * @cfg {Boolean} autoHide
- * When a collapsed region's bar is clicked, the region's panel will be displayed as a floated
- * panel. If <tt>autoHide = true</tt>, the panel will automatically hide after the user mouses
- * out of the panel. If <tt>autoHide = false</tt>, the panel will continue to display until the
- * user clicks outside of the panel (defaults to <tt>true</tt>).
- */
- /**
- * @cfg {String} collapseMode
- * <tt>collapseMode</tt> supports two configuration values:<div class="mdetail-params"><ul>
- * <li><b><tt>undefined</tt></b> (default)<div class="sub-desc">By default, {@link #collapsible}
- * regions are collapsed by clicking the expand/collapse tool button that renders into the region's
- * title bar.</div></li>
- * <li><b><tt>'mini'</tt></b><div class="sub-desc">Optionally, when <tt>collapseMode</tt> is set to
- * <tt>'mini'</tt> the region's split bar will also display a small collapse button in the center of
- * the bar. In <tt>'mini'</tt> mode the region will collapse to a thinner bar than in normal mode.
- * </div></li>
- * </ul></div></p>
- * <p><b>Note</b>: if a collapsible region does not have a title bar, then set <tt>collapseMode =
- * 'mini'</tt> and <tt>{@link #split} = true</tt> 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.</p>
- * <p>See also <tt>{@link #cmargins}</tt>.</p>
- */
- /**
- * @cfg {Object} margins
- * An object containing margins to apply to the region when in the expanded state in the
- * format:<pre><code>
-{
- top: (top margin),
- right: (right margin),
- bottom: (bottom margin),
- left: (left margin)
-}</code></pre>
- * <p>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:</p>
- * <p><div class="mdetail-params"><ul>
- * <li>If there is only one value, it applies to all sides.</li>
- * <li>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.</li>
- * <li>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.</li>
- * <li>If there are four values, they apply to the top, right, bottom, and left, respectively.</li>
- * </ul></div></p>
- * <p>Defaults to:</p><pre><code>
- * {top:0, right:0, bottom:0, left:0}
- * </code></pre>
- */
- /**
- * @cfg {Object} cmargins
- * An object containing margins to apply to the region when in the collapsed state in the
- * format:<pre><code>
-{
- top: (top margin),
- right: (right margin),
- bottom: (bottom margin),
- left: (left margin)
-}</code></pre>
- * <p>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.</p>
- * <p><ul>
- * <li>If there is only one value, it applies to all sides.</li>
- * <li>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.</li>
- * <li>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.</li>
- * <li>If there are four values, they apply to the top, right, bottom, and left, respectively.</li>
- * </ul></p>
- */
- /**
- * @cfg {Boolean} collapsible
- * <p><tt>true</tt> to allow the user to collapse this region (defaults to <tt>false</tt>). If
- * <tt>true</tt>, an expand/collapse tool button will automatically be rendered into the title
- * bar of the region, otherwise the button will not be shown.</p>
- * <p><b>Note</b>: that a title bar is required to display the collapse/expand toggle button -- if
- * no <tt>title</tt> is specified for the region's panel, the region will only be collapsible if
- * <tt>{@link #collapseMode} = 'mini'</tt> and <tt>{@link #split} = true</tt>.
- */
+
+
+
+
+
+
collapsible : false,
- /**
- * @cfg {Boolean} split
- * <p><tt>true</tt> 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 <tt>false</tt> creating a
- * {@link Ext.layout.BorderLayout.Region Region}.</p><br>
- * <p><b>Notes</b>:</p><div class="mdetail-params"><ul>
- * <li>this configuration option is ignored if <tt>region='center'</tt></li>
- * <li>when <tt>split == true</tt>, it is common to specify a
- * <tt>{@link Ext.SplitBar#minSize minSize}</tt> and <tt>{@link Ext.SplitBar#maxSize maxSize}</tt>
- * 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.</li>
- * <li>if <tt>{@link #collapseMode} = 'mini'</tt> requires <tt>split = true</tt> to reserve space
- * for the collapse tool</tt></li>
- * </ul></div>
- */
+
split:false,
- /**
- * @cfg {Boolean} floatable
- * <tt>true</tt> to allow clicking a collapsed region's bar to display the region's panel floated
- * above the layout, <tt>false</tt> to force the user to fully expand a collapsed region by
- * clicking the expand button to see it again (defaults to <tt>true</tt>).
- */
+
floatable: true,
- /**
- * @cfg {Number} minWidth
- * <p>The minimum allowable width in pixels for this region (defaults to <tt>50</tt>).
- * <tt>maxWidth</tt> may also be specified.</p><br>
- * <p><b>Note</b>: setting the <tt>{@link Ext.SplitBar#minSize minSize}</tt> /
- * <tt>{@link Ext.SplitBar#maxSize maxSize}</tt> supersedes any specified
- * <tt>minWidth</tt> / <tt>maxWidth</tt>.</p>
- */
+
minWidth:50,
- /**
- * @cfg {Number} minHeight
- * The minimum allowable height in pixels for this region (defaults to <tt>50</tt>)
- * <tt>maxHeight</tt> may also be specified.</p><br>
- * <p><b>Note</b>: setting the <tt>{@link Ext.SplitBar#minSize minSize}</tt> /
- * <tt>{@link Ext.SplitBar#maxSize maxSize}</tt> supersedes any specified
- * <tt>minHeight</tt> / <tt>maxHeight</tt>.</p>
- */
+
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();
@@ -22342,7 +14640,7 @@ Ext.layout.BorderLayout.Region.prototype = {
}
},
- // private
+
getCollapsedEl : function(){
if(!this.collapsedEl){
if(!this.toolTemplate){
@@ -22384,7 +14682,7 @@ Ext.layout.BorderLayout.Region.prototype = {
return this.collapsedEl;
},
- // private
+
onExpandClick : function(e){
if(this.isSlid){
this.panel.expand(false);
@@ -22393,12 +14691,12 @@ Ext.layout.BorderLayout.Region.prototype = {
}
},
- // private
+
onCollapseClick : function(e){
this.panel.collapse();
},
- // private
+
beforeCollapse : function(p, animate){
this.lastAnim = animate;
if(this.splitEl){
@@ -22412,7 +14710,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){
@@ -22424,7 +14722,7 @@ Ext.layout.BorderLayout.Region.prototype = {
this.panel.saveState();
},
- // private
+
beforeExpand : function(animate){
if(this.isSlid){
this.afterSlideIn();
@@ -22441,7 +14739,7 @@ Ext.layout.BorderLayout.Region.prototype = {
this.panel.el.setStyle('z-index', this.floatingZIndex);
},
- // private
+
onExpand : function(){
this.isCollapsed = false;
if(this.splitEl){
@@ -22453,7 +14751,7 @@ Ext.layout.BorderLayout.Region.prototype = {
this.panel.saveState();
},
- // private
+
collapseClick : function(e){
if(this.isSlid){
e.stopPropagation();
@@ -22464,7 +14762,7 @@ Ext.layout.BorderLayout.Region.prototype = {
}
},
- // private
+
onHide : function(){
if(this.isCollapsed){
this.getCollapsedEl().hide();
@@ -22473,7 +14771,7 @@ Ext.layout.BorderLayout.Region.prototype = {
}
},
- // private
+
onShow : function(){
if(this.isCollapsed){
this.getCollapsedEl().show();
@@ -22482,67 +14780,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: <tt>{left: (left
- * margin), top: (top margin), right: (right margin), bottom: (bottom margin)}</tt>
- */
+
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: <tt>{width: (element width),
- * height: (element height)}</tt>
- */
+
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);
@@ -22552,17 +14827,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){
@@ -22584,7 +14859,7 @@ Ext.layout.BorderLayout.Region.prototype = {
}
},
- // private
+
clearAutoHide : function(){
if(this.autoHide !== false){
this.el.un("mouseout", this.autoHideHd.mouseout);
@@ -22594,16 +14869,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 <i>over the top
- * of the center Region</i> 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;
@@ -22615,24 +14886,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];
@@ -22656,7 +14927,7 @@ Ext.layout.BorderLayout.Region.prototype = {
}
},
- // private
+
afterSlideIn : function(){
this.clearAutoHide();
this.isSlid = false;
@@ -22672,10 +14943,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);
@@ -22700,14 +14968,14 @@ Ext.layout.BorderLayout.Region.prototype = {
}
},
- // private
+
slideInIf : function(e){
if(!e.within(this.el)){
this.slideIn();
}
},
- // private
+
anchors : {
"west" : "left",
"east" : "right",
@@ -22715,7 +14983,7 @@ Ext.layout.BorderLayout.Region.prototype = {
"south" : "bottom"
},
- // private
+
sanchors : {
"west" : "l",
"east" : "r",
@@ -22723,7 +14991,7 @@ Ext.layout.BorderLayout.Region.prototype = {
"south" : "b"
},
- // private
+
canchors : {
"west" : "tl-tr",
"east" : "tr-tl",
@@ -22731,22 +14999,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){
@@ -22765,7 +15033,7 @@ Ext.layout.BorderLayout.Region.prototype = {
}
},
- // private
+
getExpandAdj : function(){
var c = this.collapsedEl, cm = this.cmargins;
switch(this.position){
@@ -22792,56 +15060,23 @@ Ext.layout.BorderLayout.Region.prototype = {
}
};
-/**
- * @class Ext.layout.BorderLayout.SplitRegion
- * @extends Ext.layout.BorderLayout.Region
- * <p>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}.</p>
- * @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 <tt>"Drag to resize."</tt>). Only applies if
- * <tt>{@link #useSplitTips} = true</tt>.
- */
+
+
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
- * <tt>{@link #useSplitTips} = true</tt>.
- */
+
collapsibleSplitTip : "Drag to resize. Double click to hide.",
- /**
- * @cfg {Boolean} useSplitTips
- * <tt>true</tt> to display a tooltip when the user hovers over a region's split bar
- * (defaults to <tt>false</tt>). The tooltip text will be the value of either
- * <tt>{@link #splitTip}</tt> or <tt>{@link #collapsibleSplitTip}</tt> as appropriate.
- */
+
useSplitTips : false,
- // private
+
splitSettings : {
north : {
orientation: Ext.SplitBar.VERTICAL,
@@ -22873,7 +15108,7 @@ Ext.extend(Ext.layout.BorderLayout.SplitRegion, Ext.layout.BorderLayout.Region,
}
},
- // private
+
applyFns : {
west : function(box){
if(this.isCollapsed){
@@ -22925,7 +15160,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);
@@ -22967,7 +15202,7 @@ Ext.extend(Ext.layout.BorderLayout.SplitRegion, Ext.layout.BorderLayout.Region,
}
},
- //docs inherit from superclass
+
getSize : function(){
if(this.isCollapsed){
return this.collapsedEl.getSize();
@@ -22981,21 +15216,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;
@@ -23011,15 +15246,12 @@ 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);
@@ -23027,121 +15259,15 @@ Ext.extend(Ext.layout.BorderLayout.SplitRegion, Ext.layout.BorderLayout.Region,
});
Ext.Container.LAYOUTS['border'] = Ext.layout.BorderLayout;
-/**
- * @class Ext.layout.FormLayout
- * @extends Ext.layout.AnchorLayout
- * <p>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.</p>
- *
- * <p>This layout manager is used when a Container is configured with the <tt>layout:'form'</tt>
- * {@link Ext.Container#layout layout} config option, and should generally not need to be created directly
- * via the new keyword. See <tt><b>{@link Ext.Container#layout}</b></tt> for additional details.</p>
- *
- * <p>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.</p>
- *
- * <p>A {@link Ext.Container Container} <i>using</i> the FormLayout layout manager (e.g.
- * {@link Ext.form.FormPanel} or specifying <tt>layout:'form'</tt>) can also accept the following
- * layout-specific config properties:<div class="mdetail-params"><ul>
- * <li><b><tt>{@link Ext.form.FormPanel#hideLabels hideLabels}</tt></b></li>
- * <li><b><tt>{@link Ext.form.FormPanel#labelAlign labelAlign}</tt></b></li>
- * <li><b><tt>{@link Ext.form.FormPanel#labelPad labelPad}</tt></b></li>
- * <li><b><tt>{@link Ext.form.FormPanel#labelSeparator labelSeparator}</tt></b></li>
- * <li><b><tt>{@link Ext.form.FormPanel#labelWidth labelWidth}</tt></b></li>
- * </ul></div></p>
- *
- * <p>Any Component (including Fields) managed by FormLayout accepts the following as a config option:
- * <div class="mdetail-params"><ul>
- * <li><b><tt>{@link Ext.Component#anchor anchor}</tt></b></li>
- * </ul></div></p>
- *
- * <p>Any Component managed by FormLayout may be rendered as a form field (with an associated label) by
- * configuring it with a non-null <b><tt>{@link Ext.Component#fieldLabel fieldLabel}</tt></b>. Components configured
- * in this way may be configured with the following options which affect the way the FormLayout renders them:
- * <div class="mdetail-params"><ul>
- * <li><b><tt>{@link Ext.Component#clearCls clearCls}</tt></b></li>
- * <li><b><tt>{@link Ext.Component#fieldLabel fieldLabel}</tt></b></li>
- * <li><b><tt>{@link Ext.Component#hideLabel hideLabel}</tt></b></li>
- * <li><b><tt>{@link Ext.Component#itemCls itemCls}</tt></b></li>
- * <li><b><tt>{@link Ext.Component#labelSeparator labelSeparator}</tt></b></li>
- * <li><b><tt>{@link Ext.Component#labelStyle labelStyle}</tt></b></li>
- * </ul></div></p>
- *
- * <p>Example usage:</p>
- * <pre><code>
-// 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
-});
-</code></pre>
- */
+
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 <b>container</b> 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 <tt>true</tt>.
- */
+
+
trackLabels: true,
type: 'form',
@@ -23152,7 +15278,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) {
@@ -23167,24 +15293,26 @@ Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, {
}
},
- // private
+
setContainer : function(ct){
Ext.layout.FormLayout.superclass.setContainer.call(this, ct);
- if(ct.labelAlign){
- ct.addClass('x-form-label-'+ct.labelAlign);
+ ct.labelAlign = ct.labelAlign || this.labelAlign;
+ if (ct.labelAlign) {
+ ct.addClass('x-form-label-' + ct.labelAlign);
}
- if(ct.hideLabels){
+ if (ct.hideLabels || this.hideLabels) {
Ext.apply(this, {
labelStyle: 'display:none',
elementStyle: 'padding-left:0;',
labelAdjust: 0
});
- }else{
+ } else {
this.labelSeparator = Ext.isDefined(ct.labelSeparator) ? ct.labelSeparator : this.labelSeparator;
- ct.labelWidth = ct.labelWidth || 100;
+ ct.labelWidth = ct.labelWidth || this.labelWidth || 100;
if(Ext.isNumber(ct.labelWidth)){
- var pad = Ext.isNumber(ct.labelPad) ? ct.labelPad : 5;
+ var pad = ct.labelPad || this.labelPad;
+ pad = Ext.isNumber(pad) ? pad : 5;
Ext.apply(this, {
labelAdjust: ct.labelWidth + pad,
labelStyle: 'width:' + ct.labelWidth + 'px;',
@@ -23201,7 +15329,7 @@ Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, {
}
},
- // private
+
isHide: function(c){
return c.hideLabel || this.container.hideLabels;
},
@@ -23209,7 +15337,7 @@ Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, {
onFieldShow: function(c){
c.getItemCt().removeClass('x-hide-' + c.hideMode);
- // Composite fields will need to layout after the container is made visible
+
if (c.isComposite) {
c.doLayout();
}
@@ -23219,7 +15347,7 @@ Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, {
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){
@@ -23233,44 +15361,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:</p><pre><code>
-new Ext.Template(
- &#39;&lt;div class="x-form-item {itemCls}" tabIndex="-1">&#39;,
- &#39;&lt;&#108;abel for="{id}" style="{labelStyle}" class="x-form-item-&#108;abel">{&#108;abel}{labelSeparator}&lt;/&#108;abel>&#39;,
- &#39;&lt;div class="x-form-element" id="x-form-el-{id}" style="{elementStyle}">&#39;,
- &#39;&lt;/div>&lt;div class="{clearCls}">&lt;/div>&#39;,
- '&lt;/div>'
-);
-</code></pre>
- * <p>This may be specified to produce a different DOM structure when rendering form Fields.</p>
- * <p>A description of the properties within the template follows:</p><div class="mdetail-params"><ul>
- * <li><b><tt>itemCls</tt></b> : String<div class="sub-desc">The CSS class applied to the outermost div wrapper
- * that contains this field label and field element (the default class is <tt>'x-form-item'</tt> and <tt>itemCls</tt>
- * will be added to that). If supplied, <tt>itemCls</tt> at the field level will override the default <tt>itemCls</tt>
- * supplied at the container level.</div></li>
- * <li><b><tt>id</tt></b> : String<div class="sub-desc">The id of the Field</div></li>
- * <li><b><tt>{@link #labelStyle}</tt></b> : String<div class="sub-desc">
- * A CSS style specification string to add to the field label for this field (defaults to <tt>''</tt> or the
- * {@link #labelStyle layout's value for <tt>labelStyle</tt>}).</div></li>
- * <li><b><tt>label</tt></b> : String<div class="sub-desc">The text to display as the label for this
- * field (defaults to <tt>''</tt>)</div></li>
- * <li><b><tt>{@link #labelSeparator}</tt></b> : String<div class="sub-desc">The separator to display after
- * the text of the label for this field (defaults to a colon <tt>':'</tt> or the
- * {@link #labelSeparator layout's value for labelSeparator}). To hide the separator use empty string ''.</div></li>
- * <li><b><tt>elementStyle</tt></b> : String<div class="sub-desc">The styles text for the input element's wrapper.</div></li>
- * <li><b><tt>clearCls</tt></b> : String<div class="sub-desc">The CSS class to apply to the special clearing div
- * rendered directly after each form field wrapper (defaults to <tt>'x-form-clear-left'</tt>)</div></li>
- * </ul></div>
- * <p>Also see <tt>{@link #getTemplateArgs}</tt></p>
- */
- /**
- * @private
- *
- */
+
+
renderItem : function(c, position, target){
if(c && (c.isFormField || c.fieldLabel) && c.inputType != 'hidden'){
var args = this.getTemplateArgs(c);
@@ -23283,8 +15376,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;
@@ -23314,36 +15407,12 @@ new Ext.Template(
}
},
- /**
- * <p>Provides template arguments for rendering the fully wrapped, labeled and styled form Field.</p>
- * <p>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:</p><div class="mdetail-params"><ul>
- * <li><b><tt>itemCls</tt></b> : String<div class="sub-desc">The CSS class applied to the outermost div wrapper
- * that contains this field label and field element (the default class is <tt>'x-form-item'</tt> and <tt>itemCls</tt>
- * will be added to that). If supplied, <tt>itemCls</tt> at the field level will override the default <tt>itemCls</tt>
- * supplied at the container level.</div></li>
- * <li><b><tt>id</tt></b> : String<div class="sub-desc">The id of the Field</div></li>
- * <li><b><tt>{@link #labelStyle}</tt></b> : String<div class="sub-desc">
- * A CSS style specification string to add to the field label for this field (defaults to <tt>''</tt> or the
- * {@link #labelStyle layout's value for <tt>labelStyle</tt>}).</div></li>
- * <li><b><tt>label</tt></b> : String<div class="sub-desc">The text to display as the label for this
- * field (defaults to the field's configured fieldLabel property)</div></li>
- * <li><b><tt>{@link #labelSeparator}</tt></b> : String<div class="sub-desc">The separator to display after
- * the text of the label for this field (defaults to a colon <tt>':'</tt> or the
- * {@link #labelSeparator layout's value for labelSeparator}). To hide the separator use empty string ''.</div></li>
- * <li><b><tt>elementStyle</tt></b> : String<div class="sub-desc">The styles text for the input element's wrapper.</div></li>
- * <li><b><tt>clearCls</tt></b> : String<div class="sub-desc">The CSS class to apply to the special clearing div
- * rendered directly after each form field wrapper (defaults to <tt>'x-form-clear-left'</tt>)</div></li>
- * </ul></div>
- * @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,
itemCls = (field.itemCls || this.container.itemCls || '') + (field.hideLabel ? ' x-hide-label' : '');
- // IE9 quirks needs an extra, identifying class on wrappers of TextFields
+
if (Ext.isIE9 && Ext.isIEQuirks && field instanceof Ext.form.TextField) {
itemCls += ' x-input-wrapper';
}
@@ -23359,10 +15428,10 @@ 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);
+ var adjust = Ext.isIE6 || Ext.isIEQuirks;
return value - this.labelAdjust + (adjust ? -3 : 0);
}
return value;
@@ -23375,104 +15444,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
- * <p>This is a layout that manages multiple Panels in an expandable accordion style such that only
- * <b>one Panel can be expanded at any given time</b>. Each Panel has built-in support for expanding and collapsing.</p>
- * <p>Note: Only Ext.Panels <b>and all subclasses of Ext.Panel</b> may be used in an accordion layout Container.</p>
- * <p>This class is intended to be extended or created via the <tt><b>{@link Ext.Container#layout layout}</b></tt>
- * configuration property. See <tt><b>{@link Ext.Container#layout}</b></tt> for additional details.</p>
- * <p>Example usage:</p>
- * <pre><code>
-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: '&lt;p&gt;Panel content!&lt;/p&gt;'
- },{
- title: 'Panel 2',
- html: '&lt;p&gt;Panel content!&lt;/p&gt;'
- },{
- title: 'Panel 3',
- html: '&lt;p&gt;Panel content!&lt;/p&gt;'
- }]
-});
-</code></pre>
- */
+
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
- * <b>Experimental</b>. 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. <b>This is NOT compatible with "animate:true"</b> (defaults to false).
- */
+
activeOnTop : false,
type: 'accordion',
@@ -23512,7 +15509,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){
@@ -23532,37 +15529,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 && !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);
@@ -23581,100 +15575,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
- * <p>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.</p>
- * <p>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:</p>
- * <ul>
- * <li><b>rowspan</b> Applied to the table cell containing the item.</li>
- * <li><b>colspan</b> Applied to the table cell containing the item.</li>
- * <li><b>cellId</b> An id applied to the table cell containing the item.</li>
- * <li><b>cellCls</b> A CSS class name added to the table cell containing the item.</li>
- * </ul>
- * <p>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:</p>
- * <pre><code>
-// 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: '&lt;p&gt;Cell A content&lt;/p&gt;',
- rowspan: 2
- },{
- html: '&lt;p&gt;Cell B content&lt;/p&gt;',
- colspan: 2
- },{
- html: '&lt;p&gt;Cell C content&lt;/p&gt;',
- cellCls: 'highlight'
- },{
- html: '&lt;p&gt;Cell D content&lt;/p&gt;'
- }]
-});
-</code></pre>
- */
+
+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
- * <p>An object containing properties which are added to the {@link Ext.DomHelper DomHelper} specification
- * used to create the layout's <tt>&lt;table&gt;</tt> element. Example:</p><pre><code>
-{
- xtype: 'panel',
- layout: 'table',
- layoutConfig: {
- tableAttrs: {
- style: {
- width: '100%'
- }
- },
- columns: 3
- }
-}</code></pre>
- */
+
tableAttrs:null,
- // private
+
setContainer : function(ct){
Ext.layout.TableLayout.superclass.setContainer.call(this, ct);
@@ -23683,7 +15599,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;
@@ -23696,7 +15612,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){
@@ -23706,7 +15622,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];
@@ -23737,7 +15653,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])) {
@@ -23751,9 +15667,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);
@@ -23769,7 +15685,7 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, {
}
},
- // private
+
isValidParent : function(c, target){
return c.getPositionEl().up('table', 5).dom.parentNode === (target.dom || target);
},
@@ -23779,61 +15695,10 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, {
Ext.layout.TableLayout.superclass.destroy.call(this);
}
- /**
- * @property activeItem
- * @hide
- */
-});
-Ext.Container.LAYOUTS['table'] = Ext.layout.TableLayout;/**
- * @class Ext.layout.AbsoluteLayout
- * @extends Ext.layout.AnchorLayout
- * <p>This is a layout that inherits the anchoring of <b>{@link Ext.layout.AnchorLayout}</b> and adds the
- * ability for x/y positioning using the standard x and y component config options.</p>
- * <p>This class is intended to be extended or created via the <tt><b>{@link Ext.Container#layout layout}</b></tt>
- * configuration property. See <tt><b>{@link Ext.Container#layout}</b></tt> for additional details.</p>
- * <p>Example usage:</p>
- * <pre><code>
-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
- }]
});
-</code></pre>
- */
+
+Ext.Container.LAYOUTS['table'] = Ext.layout.TableLayout;
Ext.layout.AbsoluteLayout = Ext.extend(Ext.layout.AnchorLayout, {
extraCls: 'x-abs-layout-item',
@@ -23847,79 +15712,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
- * <p>Base Class for HBoxLayout and VBoxLayout Classes. Generally it should not need to be used directly.</p>
- */
+
Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, {
- /**
- * @cfg {Object} defaultMargins
- * <p>If the individual contained items do not have a <tt>margins</tt>
- * property specified, the default margins from this property will be
- * applied to each item.</p>
- * <br><p>This property may be specified as an object containing margins
- * to apply in the format:</p><pre><code>
-{
- top: (top margin),
- right: (right margin),
- bottom: (bottom margin),
- left: (left margin)
-}</code></pre>
- * <p>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:</p>
- * <div class="mdetail-params"><ul>
- * <li>If there is only one value, it applies to all sides.</li>
- * <li>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.</li>
- * <li>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.</li>
- * <li>If there are four values, they apply to the top, right, bottom, and
- * left, respectively.</li>
- * </ul></div>
- * <p>Defaults to:</p><pre><code>
- * {top:0, right:0, bottom:0, left:0}
- * </code></pre>
- */
+
defaultMargins : {left:0,top:0,right:0,bottom:0},
- /**
- * @cfg {String} padding
- * <p>Sets the padding to be applied to all child items managed by this layout.</p>
- * <p>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:</p>
- * <div class="mdetail-params"><ul>
- * <li>If there is only one value, it applies to all sides.</li>
- * <li>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.</li>
- * <li>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.</li>
- * <li>If there are four values, they apply to the top, right, bottom, and
- * left, respectively.</li>
- * </ul></div>
- * <p>Defaults to: <code>"0"</code></p>
- */
+
padding : '0',
- // documented in subclasses
+
pack : 'start',
- // private
+
monitorResize : true,
type: 'box',
scrollOffset : 0,
@@ -23955,11 +15769,7 @@ Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, {
this.overflowHandler = new constructor(this, handler);
},
- /**
- * @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);
@@ -23969,7 +15779,7 @@ Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, {
boxes = calcs.boxes,
meta = calcs.meta;
- //invoke the overflow handler, if one is configured
+
if (tSize.width > 0) {
var handler = this.overflowHandler,
method = meta.tooNarrow ? 'handleOverflow' : 'clearOverflow';
@@ -23989,35 +15799,20 @@ Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, {
}
}
- /**
- * @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 = calcs;
this.updateInnerCtSize(tSize, calcs);
this.updateChildBoxes(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],
@@ -24026,7 +15821,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;
}
@@ -24035,16 +15830,7 @@ 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: function(tSize, calcs) {
var align = this.align,
padding = this.padding,
@@ -24074,15 +15860,7 @@ Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, {
this.innerCt.setSize(innerCtWidth || undefined, innerCtHeight || undefined);
},
- /**
- * @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');
@@ -24097,16 +15875,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(),
@@ -24124,10 +15898,10 @@ 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);
}
@@ -24140,10 +15914,10 @@ 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){
+
+
+
+ if (Ext.isIE9m && Ext.isStrict && ret.width == 0){
ret = target.getStyleSize();
}
@@ -24154,7 +15928,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);
@@ -24164,9 +15938,7 @@ Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, {
Ext.layout.BoxLayout.superclass.renderItem.apply(this, arguments);
},
- /**
- * @private
- */
+
destroy: function() {
Ext.destroy(this.overflowHandler);
@@ -24174,13 +15946,7 @@ Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, {
}
});
-/**
- * @class Ext.layout.boxOverflow.None
- * @extends Object
- * Base class for Box Layout overflow handlers. These specialized classes are invoked when a Box Layout
- * (either an HBox or a VBox) has child items that are either too wide (for HBox) or too tall (for VBox)
- * for its container.
- */
+
Ext.layout.boxOverflow.None = Ext.extend(Object, {
constructor: function(layout, config) {
@@ -24196,53 +15962,29 @@ Ext.layout.boxOverflow.None = Ext.extend(Object, {
Ext.layout.boxOverflow.none = Ext.layout.boxOverflow.None;
-/**
- * @class Ext.layout.boxOverflow.Menu
- * @extends Ext.layout.boxOverflow.None
- * Description
- */
+
Ext.layout.boxOverflow.Menu = Ext.extend(Ext.layout.boxOverflow.None, {
- /**
- * @cfg afterCls
- * @type String
- * CSS class added to the afterCt element. This is the element that holds any special items such as scrollers,
- * which must always be present at the rightmost edge of the Container
- */
+
afterCls: 'x-strip-right',
- /**
- * @property noItemsMenuText
- * @type String
- * HTML fragment to render into the toolbar overflow menu if there are no items to display
- */
+
noItemsMenuText : '<div class="x-toolbar-no-items">(None)</div>',
constructor: function(layout) {
Ext.layout.boxOverflow.Menu.superclass.constructor.apply(this, arguments);
- /**
- * @property menuItems
- * @type Array
- * Array of all items that are currently hidden and should go into the dropdown menu
- */
+
this.menuItems = [];
},
- /**
- * @private
- * Creates the beforeCt, innerCt and afterCt elements if they have not already been created
- * @param {Ext.Container} container The Container attached to this Layout instance
- * @param {Ext.Element} target The target Element
- */
+
createInnerElements: function() {
if (!this.afterCt) {
this.afterCt = this.layout.innerCt.insertSibling({cls: this.afterCls}, 'before');
}
},
- /**
- * @private
- */
+
clearOverflow: function(calculations, targetSize) {
var newWidth = targetSize.width + (this.afterCt ? this.afterCt.getWidth() : 0),
items = this.menuItems;
@@ -24261,27 +16003,20 @@ Ext.layout.boxOverflow.Menu = Ext.extend(Ext.layout.boxOverflow.None, {
};
},
- /**
- * @private
- */
+
showTrigger: function() {
this.createMenu();
this.menuTrigger.show();
},
- /**
- * @private
- */
+
hideTrigger: function() {
if (this.menuTrigger != undefined) {
this.menuTrigger.hide();
}
},
- /**
- * @private
- * Called before the overflow menu is shown. This constructs the menu's items, caching them for as long as it can.
- */
+
beforeMenuShow: function(menu) {
var items = this.menuItems,
len = items.length,
@@ -24306,19 +16041,13 @@ Ext.layout.boxOverflow.Menu = Ext.extend(Ext.layout.boxOverflow.None, {
prev = item;
}
- // put something so the menu isn't empty if no compatible items found
+
if (menu.items.length < 1) {
menu.add(this.noItemsMenuText);
}
},
- /**
- * @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;
@@ -24351,12 +16080,7 @@ Ext.layout.boxOverflow.Menu = Ext.extend(Ext.layout.boxOverflow.None, {
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('-');
@@ -24376,11 +16100,7 @@ Ext.layout.boxOverflow.Menu = Ext.extend(Ext.layout.boxOverflow.None, {
}
},
- /**
- * @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) {
@@ -24390,22 +16110,12 @@ Ext.layout.boxOverflow.Menu = Ext.extend(Ext.layout.boxOverflow.None, {
}
},
- /**
- * @private
- * Creates the overflow trigger and menu used when enableOverflow is set to true and the items
- * in the layout are too wide to fit in the space available
- */
+
createMenu: function() {
if (!this.menuTrigger) {
this.createInnerElements();
- /**
- * @private
- * @property menu
- * @type Ext.menu.Menu
- * The expand menu - holds items for every item that cannot be shown
- * because the container is currently not large enough.
- */
+
this.menu = new Ext.menu.Menu({
ownerCt : this.layout.container,
listeners: {
@@ -24414,12 +16124,7 @@ Ext.layout.boxOverflow.Menu = Ext.extend(Ext.layout.boxOverflow.None, {
}
});
- /**
- * @private
- * @property menuTrigger
- * @type Ext.Button
- * The expand button which triggers the overflow menu to be shown
- */
+
this.menuTrigger = new Ext.Button({
iconCls : 'x-toolbar-more-icon',
cls : 'x-toolbar-more',
@@ -24429,9 +16134,7 @@ Ext.layout.boxOverflow.Menu = Ext.extend(Ext.layout.boxOverflow.None, {
}
},
- /**
- * @private
- */
+
destroy: function() {
Ext.destroy(this.menu, this.menuTrigger);
}
@@ -24440,11 +16143,7 @@ Ext.layout.boxOverflow.Menu = Ext.extend(Ext.layout.boxOverflow.None, {
Ext.layout.boxOverflow.menu = Ext.layout.boxOverflow.Menu;
-/**
- * @class Ext.layout.boxOverflow.HorizontalMenu
- * @extends Ext.layout.boxOverflow.Menu
- * Description
- */
+
Ext.layout.boxOverflow.HorizontalMenu = Ext.extend(Ext.layout.boxOverflow.Menu, {
constructor: function() {
@@ -24459,8 +16158,8 @@ Ext.layout.boxOverflow.HorizontalMenu = Ext.extend(Ext.layout.boxOverflow.Menu,
meta = calcs.meta,
items = me.menuItems;
- //calculate the width of the items currently hidden solely because there is not enough space
- //to display them
+
+
var hiddenWidth = 0;
for (var index = 0, length = items.length; index < length; index++) {
hiddenWidth += items[index].width;
@@ -24481,7 +16180,7 @@ Ext.layout.boxOverflow.HorizontalMenu = Ext.extend(Ext.layout.boxOverflow.Menu,
usedWidth = 0,
recalculate = false;
- //calculate the width of all visible items and any spare width
+
for (var index = 0, length = boxes.length; index < length; index++) {
usedWidth += boxes[index].width;
}
@@ -24489,7 +16188,7 @@ Ext.layout.boxOverflow.HorizontalMenu = Ext.extend(Ext.layout.boxOverflow.Menu,
var spareWidth = newWidth - usedWidth,
showCount = 0;
- //see if we can re-show any of the hidden components
+
for (var index = 0, length = this.menuItems.length; index < length; index++) {
var hidden = this.menuItems[index],
comp = hidden.component,
@@ -24540,88 +16239,39 @@ Ext.layout.boxOverflow.HorizontalMenu = Ext.extend(Ext.layout.boxOverflow.Menu,
}
});
-Ext.layout.boxOverflow.menu.hbox = Ext.layout.boxOverflow.HorizontalMenu;/**
- * @class Ext.layout.boxOverflow.Scroller
- * @extends Ext.layout.boxOverflow.None
- * Description
- */
+Ext.layout.boxOverflow.menu.hbox = Ext.layout.boxOverflow.HorizontalMenu;
Ext.layout.boxOverflow.Scroller = Ext.extend(Ext.layout.boxOverflow.None, {
- /**
- * @cfg animateScroll
- * @type Boolean
- * True to animate the scrolling of items within the layout (defaults to true, ignored if enableScroll is false)
- */
+
animateScroll: true,
- /**
- * @cfg scrollIncrement
- * @type Number
- * The number of pixels to scroll by on scroller click (defaults to 100)
- */
+
scrollIncrement: 100,
- /**
- * @cfg wheelIncrement
- * @type Number
- * The number of pixels to increment on mouse wheel scrolling (defaults to <tt>3</tt>).
- */
+
wheelIncrement: 3,
- /**
- * @cfg scrollRepeatInterval
- * @type Number
- * Number of milliseconds between each scroll while a scroller button is held down (defaults to 400)
- */
+
scrollRepeatInterval: 400,
- /**
- * @cfg scrollDuration
- * @type Number
- * Number of seconds that each scroll animation lasts (defaults to 0.4)
- */
+
scrollDuration: 0.4,
- /**
- * @cfg beforeCls
- * @type String
- * CSS class added to the beforeCt element. This is the element that holds any special items such as scrollers,
- * which must always be present at the leftmost edge of the Container
- */
+
beforeCls: 'x-strip-left',
- /**
- * @cfg afterCls
- * @type String
- * CSS class added to the afterCt element. This is the element that holds any special items such as scrollers,
- * which must always be present at the rightmost edge of the Container
- */
+
afterCls: 'x-strip-right',
- /**
- * @cfg scrollerCls
- * @type String
- * CSS class added to both scroller elements if enableScroll is used
- */
+
scrollerCls: 'x-strip-scroller',
- /**
- * @cfg beforeScrollerCls
- * @type String
- * CSS class added to the left scroller element if enableScroll is used
- */
+
beforeScrollerCls: 'x-strip-scroller-left',
- /**
- * @cfg afterScrollerCls
- * @type String
- * CSS class added to the right scroller element if enableScroll is used
- */
+
afterScrollerCls: 'x-strip-scroller-right',
- /**
- * @private
- * Sets up an listener to scroll on the layout's innerCt mousewheel event
- */
+
createWheelListener: function() {
this.layout.innerCt.on({
scope : this,
@@ -24633,27 +16283,18 @@ Ext.layout.boxOverflow.Scroller = Ext.extend(Ext.layout.boxOverflow.None, {
});
},
- /**
- * @private
- * Most of the heavy lifting is done in the subclasses
- */
+
handleOverflow: function(calculations, targetSize) {
this.createInnerElements();
this.showScrollers();
},
- /**
- * @private
- */
+
clearOverflow: function() {
this.hideScrollers();
},
- /**
- * @private
- * Shows the scroller elements in the beforeCt and afterCt. Creates the scrollers first if they are not already
- * present.
- */
+
showScrollers: function() {
this.createScrollers();
@@ -24663,10 +16304,7 @@ Ext.layout.boxOverflow.Scroller = Ext.extend(Ext.layout.boxOverflow.None, {
this.updateScrollButtons();
},
- /**
- * @private
- * Hides the scroller elements in the beforeCt and afterCt
- */
+
hideScrollers: function() {
if (this.beforeScroller != undefined) {
this.beforeScroller.hide();
@@ -24674,10 +16312,7 @@ Ext.layout.boxOverflow.Scroller = Ext.extend(Ext.layout.boxOverflow.None, {
}
},
- /**
- * @private
- * Creates the clickable scroller elements and places them into the beforeCt and afterCt
- */
+
createScrollers: function() {
if (!this.beforeScroller && !this.afterScroller) {
var before = this.beforeCt.createChild({
@@ -24706,44 +16341,25 @@ Ext.layout.boxOverflow.Scroller = Ext.extend(Ext.layout.boxOverflow.None, {
scope : this
});
- /**
- * @property beforeScroller
- * @type Ext.Element
- * The left scroller element. Only created when needed.
- */
+
this.beforeScroller = before;
- /**
- * @property afterScroller
- * @type Ext.Element
- * The left scroller element. Only created when needed.
- */
+
this.afterScroller = after;
}
},
- /**
- * @private
- */
+
destroy: function() {
Ext.destroy(this.beforeScroller, this.afterScroller, this.beforeRepeater, this.afterRepeater, this.beforeCt, this.afterCt);
},
- /**
- * @private
- * Scrolls left or right by the number of pixels specified
- * @param {Number} delta Number of pixels to scroll to the right by. Use a negative number to scroll left
- */
+
scrollBy: function(delta, animate) {
this.scrollTo(this.getScrollPosition() + delta, animate);
},
-
- /**
- * @private
- * Normalizes an item reference, string id or numerical index into a reference to the item
- * @param {Ext.Component|String|Number} item The item reference, id or index
- * @return {Ext.Component} The item
- */
+
+
getItem: function(item) {
if (Ext.isString(item)) {
item = Ext.getCmp(item);
@@ -24754,10 +16370,7 @@ Ext.layout.boxOverflow.Scroller = Ext.extend(Ext.layout.boxOverflow.None, {
return item;
},
- /**
- * @private
- * @return {Object} Object passed to scrollTo when scrolling
- */
+
getScrollAnim: function() {
return {
duration: this.scrollDuration,
@@ -24766,10 +16379,7 @@ Ext.layout.boxOverflow.Scroller = Ext.extend(Ext.layout.boxOverflow.None, {
};
},
- /**
- * @private
- * Enables or disables each scroller button based on the current scroll position
- */
+
updateScrollButtons: function() {
if (this.beforeScroller == undefined || this.afterScroller == undefined) {
return;
@@ -24785,37 +16395,22 @@ Ext.layout.boxOverflow.Scroller = Ext.extend(Ext.layout.boxOverflow.None, {
this.scrolling = false;
},
- /**
- * @private
- * Returns true if the innerCt scroll is already at its left-most point
- * @return {Boolean} True if already at furthest left point
- */
+
atExtremeBefore: function() {
return this.getScrollPosition() === 0;
},
- /**
- * @private
- * Scrolls to the left by the configured amount
- */
+
scrollLeft: function(animate) {
this.scrollBy(-this.scrollIncrement, animate);
},
- /**
- * @private
- * Scrolls to the right by the configured amount
- */
+
scrollRight: function(animate) {
this.scrollBy(this.scrollIncrement, animate);
},
- /**
- * Scrolls to the given component.
- * @param {String|Number|Ext.Component} item The item to scroll to. Can be a numerical index, component id
- * or a reference to the component itself.
- * @param {Boolean} animate True to animate the scrolling
- */
+
scrollToItem: function(item, animate) {
item = this.getItem(item);
@@ -24835,13 +16430,7 @@ Ext.layout.boxOverflow.Scroller = Ext.extend(Ext.layout.boxOverflow.None, {
}
},
- /**
- * @private
- * For a given item in the container, return an object with information on whether the item is visible
- * with the current innerCt scroll value.
- * @param {Ext.Component} item The item
- * @return {Object} Values for fullyVisible, hiddenLeft and hiddenRight
- */
+
getItemVisibility: function(item) {
var box = this.getItem(item).getBox(true, true),
itemLeft = box.x,
@@ -24860,11 +16449,7 @@ Ext.layout.boxOverflow.Scroller = Ext.extend(Ext.layout.boxOverflow.None, {
Ext.layout.boxOverflow.scroller = Ext.layout.boxOverflow.Scroller;
-/**
- * @class Ext.layout.boxOverflow.VerticalScroller
- * @extends Ext.layout.boxOverflow.Scroller
- * Description
- */
+
Ext.layout.boxOverflow.VerticalScroller = Ext.extend(Ext.layout.boxOverflow.Scroller, {
scrollIncrement: 75,
wheelIncrement : 2,
@@ -24880,15 +16465,12 @@ Ext.layout.boxOverflow.VerticalScroller = Ext.extend(Ext.layout.boxOverflow.Scro
};
},
- /**
- * @private
- * Creates the beforeCt and afterCt elements if they have not already been created
- */
+
createInnerElements: function() {
var target = this.layout.innerCt;
- //normal items will be rendered to the innerCt. beforeCt and afterCt allow for fixed positioning of
- //special items such as scrollers or dropdown menu triggers
+
+
if (!this.beforeCt) {
this.beforeCt = target.insertSibling({cls: this.beforeCls}, 'before');
this.afterCt = target.insertSibling({cls: this.afterCls}, 'after');
@@ -24897,12 +16479,7 @@ Ext.layout.boxOverflow.VerticalScroller = Ext.extend(Ext.layout.boxOverflow.Scro
}
},
- /**
- * @private
- * Scrolls to the given position. Performs bounds checking.
- * @param {Number} position The position to scroll to. This is constrained.
- * @param {Boolean} animate True to animate. If undefined, falls back to value of this.animateScroll
- */
+
scrollTo: function(position, animate) {
var oldPosition = this.getScrollPosition(),
newPosition = position.constrain(0, this.getMaxScrollBottom());
@@ -24923,28 +16500,17 @@ Ext.layout.boxOverflow.VerticalScroller = Ext.extend(Ext.layout.boxOverflow.Scro
}
},
- /**
- * Returns the current scroll position of the innerCt element
- * @return {Number} The current scroll position
- */
+
getScrollPosition: function(){
return parseInt(this.layout.innerCt.dom.scrollTop, 10) || 0;
},
- /**
- * @private
- * Returns the maximum value we can scrollTo
- * @return {Number} The max scroll value
- */
+
getMaxScrollBottom: function() {
return this.layout.innerCt.dom.scrollHeight - this.layout.innerCt.getHeight();
},
- /**
- * @private
- * Returns true if the innerCt scroll is already at its right-most point
- * @return {Boolean} True if already at furthest right point
- */
+
atExtremeAfter: function() {
return this.getScrollPosition() >= this.getMaxScrollBottom();
}
@@ -24953,11 +16519,7 @@ Ext.layout.boxOverflow.VerticalScroller = Ext.extend(Ext.layout.boxOverflow.Scro
Ext.layout.boxOverflow.scroller.vbox = Ext.layout.boxOverflow.VerticalScroller;
-/**
- * @class Ext.layout.boxOverflow.HorizontalScroller
- * @extends Ext.layout.boxOverflow.Scroller
- * Description
- */
+
Ext.layout.boxOverflow.HorizontalScroller = Ext.extend(Ext.layout.boxOverflow.Scroller, {
handleOverflow: function(calculations, targetSize) {
Ext.layout.boxOverflow.HorizontalScroller.superclass.handleOverflow.apply(this, arguments);
@@ -24970,15 +16532,12 @@ Ext.layout.boxOverflow.HorizontalScroller = Ext.extend(Ext.layout.boxOverflow.Sc
};
},
- /**
- * @private
- * Creates the beforeCt and afterCt elements if they have not already been created
- */
+
createInnerElements: function() {
var target = this.layout.innerCt;
- //normal items will be rendered to the innerCt. beforeCt and afterCt allow for fixed positioning of
- //special items such as scrollers or dropdown menu triggers
+
+
if (!this.beforeCt) {
this.afterCt = target.insertSibling({cls: this.afterCls}, 'before');
this.beforeCt = target.insertSibling({cls: this.beforeCls}, 'before');
@@ -24987,12 +16546,7 @@ Ext.layout.boxOverflow.HorizontalScroller = Ext.extend(Ext.layout.boxOverflow.Sc
}
},
- /**
- * @private
- * Scrolls to the given position. Performs bounds checking.
- * @param {Number} position The position to scroll to. This is constrained.
- * @param {Boolean} animate True to animate. If undefined, falls back to value of this.animateScroll
- */
+
scrollTo: function(position, animate) {
var oldPosition = this.getScrollPosition(),
newPosition = position.constrain(0, this.getMaxScrollRight());
@@ -25013,90 +16567,33 @@ Ext.layout.boxOverflow.HorizontalScroller = Ext.extend(Ext.layout.boxOverflow.Sc
}
},
- /**
- * Returns the current scroll position of the innerCt element
- * @return {Number} The current scroll position
- */
+
getScrollPosition: function(){
return parseInt(this.layout.innerCt.dom.scrollLeft, 10) || 0;
},
- /**
- * @private
- * Returns the maximum value we can scrollTo
- * @return {Number} The max scroll value
- */
+
getMaxScrollRight: function() {
return this.layout.innerCt.dom.scrollWidth - this.layout.innerCt.getWidth();
},
- /**
- * @private
- * Returns true if the innerCt scroll is already at its right-most point
- * @return {Boolean} True if already at furthest right point
- */
+
atExtremeAfter: function() {
return this.getScrollPosition() >= this.getMaxScrollRight();
}
});
-Ext.layout.boxOverflow.scroller.hbox = Ext.layout.boxOverflow.HorizontalScroller;/**
- * @class Ext.layout.HBoxLayout
- * @extends Ext.layout.BoxLayout
- * <p>A layout that arranges items horizontally across a Container. This layout optionally divides available horizontal
- * space between child items containing a numeric <code>flex</code> configuration.</p>
- * This layout may also be used to set the heights of child items by configuring it with the {@link #align} option.
- */
+Ext.layout.boxOverflow.scroller.hbox = Ext.layout.boxOverflow.HorizontalScroller;
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:
- * <div class="mdetail-params"><ul>
- * <li><b><tt>top</tt></b> : <b>Default</b><div class="sub-desc">child items are aligned vertically
- * at the <b>top</b> of the container</div></li>
- * <li><b><tt>middle</tt></b> : <div class="sub-desc">child items are aligned vertically in the
- * <b>middle</b> of the container</div></li>
- * <li><b><tt>stretch</tt></b> : <div class="sub-desc">child items are stretched vertically to fill
- * the height of the container</div></li>
- * <li><b><tt>stretchmax</tt></b> : <div class="sub-desc">child items are stretched vertically to
- * the height of the largest item.</div></li>
- */
- align: 'top', // top, middle, stretch, strechmax
+
+ align: 'top',
type : 'hbox',
- /**
- * @cfg {String} pack
- * Controls how the child items of the container are packed together. Acceptable configuration values
- * for this property are:
- * <div class="mdetail-params"><ul>
- * <li><b><tt>start</tt></b> : <b>Default</b><div class="sub-desc">child items are packed together at
- * <b>left</b> side of container</div></li>
- * <li><b><tt>center</tt></b> : <div class="sub-desc">child items are packed together at
- * <b>mid-width</b> of container</div></li>
- * <li><b><tt>end</tt></b> : <div class="sub-desc">child items are packed together at <b>right</b>
- * side of container</div></li>
- * </ul></div>
- */
- /**
- * @cfg {Number} flex
- * This configuation option is to be applied to <b>child <tt>items</tt></b> of the container managed
- * by this layout. Each child item with a <tt>flex</tt> property will be flexed <b>horizontally</b>
- * according to each item's <b>relative</b> <tt>flex</tt> value compared to the sum of all items with
- * a <tt>flex</tt> value specified. Any child items that have either a <tt>flex = 0</tt> or
- * <tt>flex = undefined</tt> 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,
@@ -25120,31 +16617,31 @@ Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
desiredWidth = 0,
minimumWidth = 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,
horizMargins, 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 && typeof child.doLayout == 'function';
- // Static width (numeric) requires no calcs
+
if (typeof childWidth != 'number') {
- // 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();
}
@@ -25162,7 +16659,7 @@ Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
desiredWidth += horizMargins + (child.flex ? child.minWidth || 0 : childWidth);
minimumWidth += horizMargins + (child.minWidth || childWidth || 0);
- // Max height for align - force layout of non-laid out subcontainers without a numeric height
+
if (typeof childHeight != 'number') {
if (canLayout) {
child.doLayout();
@@ -25172,7 +16669,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. Don't set height or width to 0, keep undefined instead
+
boxes.push({
component: child,
height : childHeight || undefined,
@@ -25183,7 +16680,7 @@ Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
var shortfall = desiredWidth - width,
tooNarrow = minimumWidth > width;
- //the width available to the flexed items
+
var availableWidth = Math.max(0, width - nonFlexWidth - paddingHoriz);
if (tooNarrow) {
@@ -25191,22 +16688,20 @@ Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
boxes[i].width = visibleItems[i].minWidth || visibleItems[i].width || boxes[i].width;
}
} else {
- //all flexed items should be sized to their minimum width, other items should be shrunk down until
- //the shortfall has been accounted for
+
+
if (shortfall > 0) {
var minWidths = [];
- /**
- * When we have a shortfall but are not tooNarrow, we need to shrink the width of each non-flexed item.
- * Flexed items are immediately reduced to their minWidth and anything already at minWidth is ignored.
- * The remaining items are collected into the minWidths array, which is later used to distribute the shortfall.
- */
+
+
+
for (var index = 0, length = visibleCount; index < length; index++) {
var item = visibleItems[index],
minWidth = item.minWidth || 0;
- //shrink each non-flex tab by an equal amount to make them all fit. Flexed items are all
- //shrunk to their minWidth because they're flexible and should be the first to lose width
+
+
if (item.flex) {
boxes[index].width = minWidth;
} else {
@@ -25218,17 +16713,12 @@ Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
}
}
- //sort by descending amount of width remaining before minWidth is reached
+
minWidths.sort(function(a, b) {
return a.available > b.available ? 1 : -1;
});
- /*
- * Distribute the shortfall (difference between total desired with of all items and actual width available)
- * between the non-flexed items. We try to distribute the shortfall evenly, but apply it to items with the
- * smallest difference between their width and minWidth first, so that if reducing the width by the average
- * amount would make that item less than its minWidth, we carry the remainder over to the next item.
- */
+
for (var i = 0, length = minWidths.length; i < length; i++) {
var itemIndex = minWidths[i].index;
@@ -25247,11 +16737,11 @@ Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
shortfall -= reduction;
}
} else {
- //temporary variables used in the flex width calculations below
+
var remainingWidth = availableWidth,
remainingFlex = totalFlex;
- //calculate the widths of each flexed item
+
for (i = 0; i < visibleCount; i++) {
child = visibleItems[i];
calcs = boxes[i];
@@ -25277,7 +16767,7 @@ Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
leftOffset += availableWidth;
}
- //finally, calculate the left and top position of each item
+
for (i = 0; i < visibleCount; i++) {
child = visibleItems[i];
calcs = boxes[i];
@@ -25324,64 +16814,17 @@ Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
}
});
-Ext.Container.LAYOUTS.hbox = Ext.layout.HBoxLayout;/**
- * @class Ext.layout.VBoxLayout
- * @extends Ext.layout.BoxLayout
- * <p>A layout that arranges items vertically down a Container. This layout optionally divides available vertical
- * space between child items containing a numeric <code>flex</code> configuration.</p>
- * This layout may also be used to set the widths of child items by configuring it with the {@link #align} option.
- */
+Ext.Container.LAYOUTS.hbox = Ext.layout.HBoxLayout;
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:
- * <div class="mdetail-params"><ul>
- * <li><b><tt>left</tt></b> : <b>Default</b><div class="sub-desc">child items are aligned horizontally
- * at the <b>left</b> side of the container</div></li>
- * <li><b><tt>center</tt></b> : <div class="sub-desc">child items are aligned horizontally at the
- * <b>mid-width</b> of the container</div></li>
- * <li><b><tt>stretch</tt></b> : <div class="sub-desc">child items are stretched horizontally to fill
- * the width of the container</div></li>
- * <li><b><tt>stretchmax</tt></b> : <div class="sub-desc">child items are stretched horizontally to
- * the size of the largest item.</div></li>
- * </ul></div>
- */
- 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:
- * <div class="mdetail-params"><ul>
- * <li><b><tt>start</tt></b> : <b>Default</b><div class="sub-desc">child items are packed together at
- * <b>top</b> side of container</div></li>
- * <li><b><tt>center</tt></b> : <div class="sub-desc">child items are packed together at
- * <b>mid-height</b> of container</div></li>
- * <li><b><tt>end</tt></b> : <div class="sub-desc">child items are packed together at <b>bottom</b>
- * side of container</div></li>
- * </ul></div>
- */
- /**
- * @cfg {Number} flex
- * This configuation option is to be applied to <b>child <tt>items</tt></b> of the container managed
- * by this layout. Each child item with a <tt>flex</tt> property will be flexed <b>vertically</b>
- * according to each item's <b>relative</b> <tt>flex</tt> value compared to the sum of all items with
- * a <tt>flex</tt> value specified. Any child items that have either a <tt>flex = 0</tt> or
- * <tt>flex = undefined</tt> will not be 'flexed' (the initial size will not be changed).
- */
- /**
- * @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,
@@ -25405,31 +16848,31 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
desiredHeight= 0,
minimumHeight= 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, vertMargins, stretchWidth, length;
- //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 && typeof child.doLayout == 'function';
- // Static height (numeric) requires no calcs
+
if (typeof childHeight != 'number') {
- // 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();
}
@@ -25447,7 +16890,7 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
desiredHeight += vertMargins + (child.flex ? child.minHeight || 0 : childHeight);
minimumHeight += vertMargins + (child.minHeight || childHeight || 0);
- // Max width for align - force layout of non-layed out subcontainers without a numeric width
+
if (typeof childWidth != 'number') {
if (canLayout) {
child.doLayout();
@@ -25457,7 +16900,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,
@@ -25468,7 +16911,7 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
var shortfall = desiredHeight - height,
tooNarrow = minimumHeight > height;
- //the height available to the flexed items
+
var availableHeight = Math.max(0, (height - nonFlexHeight - paddingVert));
if (tooNarrow) {
@@ -25476,22 +16919,20 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
boxes[i].height = visibleItems[i].minHeight || visibleItems[i].height || boxes[i].height;
}
} else {
- //all flexed items should be sized to their minimum width, other items should be shrunk down until
- //the shortfall has been accounted for
+
+
if (shortfall > 0) {
var minHeights = [];
- /**
- * When we have a shortfall but are not tooNarrow, we need to shrink the height of each non-flexed item.
- * Flexed items are immediately reduced to their minHeight and anything already at minHeight is ignored.
- * The remaining items are collected into the minHeights array, which is later used to distribute the shortfall.
- */
+
+
+
for (var index = 0, length = visibleCount; index < length; index++) {
var item = visibleItems[index],
minHeight = item.minHeight || 0;
- //shrink each non-flex tab by an equal amount to make them all fit. Flexed items are all
- //shrunk to their minHeight because they're flexible and should be the first to lose height
+
+
if (item.flex) {
boxes[index].height = minHeight;
} else {
@@ -25503,17 +16944,12 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
}
}
- //sort by descending minHeight value
+
minHeights.sort(function(a, b) {
return a.available > b.available ? 1 : -1;
});
- /*
- * Distribute the shortfall (difference between total desired with of all items and actual height available)
- * between the non-flexed items. We try to distribute the shortfall evenly, but apply it to items with the
- * smallest difference between their height and minHeight first, so that if reducing the height by the average
- * amount would make that item less than its minHeight, we carry the remainder over to the next item.
- */
+
for (var i = 0, length = minHeights.length; i < length; i++) {
var itemIndex = minHeights[i].index;
@@ -25532,11 +16968,11 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
shortfall -= reduction;
}
} else {
- //temporary variables used in the flex height calculations below
+
var remainingHeight = availableHeight,
remainingFlex = totalFlex;
- //calculate the height of each flexed item
+
for (i = 0; i < visibleCount; i++) {
child = visibleItems[i];
calcs = boxes[i];
@@ -25562,7 +16998,7 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
topOffset += availableHeight;
}
- //finally, calculate the left and top position of each item
+
for (i = 0; i < visibleCount; i++) {
child = visibleItems[i];
calcs = boxes[i];
@@ -25611,46 +17047,22 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
});
Ext.Container.LAYOUTS.vbox = Ext.layout.VBoxLayout;
-/**
- * @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 : '<div class="x-toolbar-no-items">(None)</div>',
- /**
- * @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: [
'<table cellspacing="0" class="x-toolbar-ct">',
'<tbody>',
@@ -25689,12 +17101,9 @@ Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, {
'</table>'
].join(""),
- /**
- * @private
- * Create the wrapping Toolbar HTML and render/move all the items into the correct places
- */
+
onLayout : function(ct, target) {
- //render the Toolbar <table> HTML if it's not already present
+
if (!this.leftTr) {
var align = ct.buttonAlign == 'center' ? 'center' : 'left';
@@ -25706,12 +17115,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 = [];
}
}
@@ -25720,7 +17124,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];
@@ -25739,18 +17143,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;
@@ -25761,13 +17161,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';
@@ -25777,12 +17171,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);
@@ -25791,36 +17180,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;
@@ -25859,7 +17231,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) {
@@ -25881,13 +17253,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;
@@ -25920,12 +17286,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('-');
@@ -25945,11 +17306,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) {
@@ -25959,12 +17316,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,
@@ -25988,26 +17340,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 <tr> 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: {
@@ -26016,12 +17358,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',
@@ -26044,11 +17381,7 @@ Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, {
});
Ext.Container.LAYOUTS.toolbar = Ext.layout.ToolbarLayout;
-/**
- * @class Ext.layout.MenuLayout
- * @extends Ext.layout.ContainerLayout
- * <p>Layout manager used by {@link Ext.menu.Menu}. Generally this class should not need to be used directly.</p>
- */
+
Ext.layout.MenuLayout = Ext.extend(Ext.layout.ContainerLayout, {
monitorResize : true,
@@ -26056,8 +17389,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);
},
@@ -26079,16 +17412,16 @@ Ext.Container.LAYOUTS.toolbar = Ext.layout.ToolbarLayout;
}
var a = this.getItemArgs(c);
-// The Component's positionEl is the <li> it is rendered into
+
c.render(c.positionEl = position ?
this.itemTpl.insertBefore(position, a, true) :
this.itemTpl.append(target, a, true));
-// Link the containing <li> 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');
}
@@ -26116,7 +17449,7 @@ Ext.Container.LAYOUTS.toolbar = Ext.layout.ToolbarLayout;
};
},
- // Valid if the Component is in a <li> which is part of our target <ul>
+
isValidParent : function(c, target) {
return c.el.up('li.x-menu-list-item', 5).dom.parentNode === (target.dom || target);
},
@@ -26131,113 +17464,28 @@ Ext.Container.LAYOUTS.toolbar = Ext.layout.ToolbarLayout;
if(ct.floating){
if(w){
ct.setWidth(w);
- }else if(Ext.isIE){
+ }else if(Ext.isIE9m){
ct.setWidth(Ext.isStrict && (Ext.isIE7 || Ext.isIE8 || Ext.isIE9) ? '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
- * <p>A specialized container representing the viewable application area (the browser viewport).</p>
- * <p>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.</p>
- * <p>The Viewport does not provide scrolling, so child Panels within the Viewport should provide
- * for scrolling if needed using the {@link #autoScroll} config.</p>
- * <p>An example showing a classic application border layout:</p><pre><code>
-new Ext.Viewport({
- layout: 'border',
- items: [{
- region: 'north',
- html: '&lt;h1 class="x-panel-header">Page Title&lt;/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'
- }
- }]
-});
-</code></pre>
- * @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);
@@ -26259,772 +17507,126 @@ Ext.Viewport = Ext.extend(Ext.Container, {
}
});
Ext.reg('viewport', Ext.Viewport);
-/**
- * @class Ext.Panel
- * @extends Ext.Container
- * <p>Panel is a container that has specific functionality and structural components that make
- * it the perfect building block for application-oriented user interfaces.</p>
- * <p>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.</p>
- * <p>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 <code><b>{@link Ext.Container#layout layout}</b></code> 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 <b>does not apply any sizing</b>
- * at all.</p>
- * <p>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).</p>
- * <p>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}.</p>
- * @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.
- * <p>This Element is used to house the {@link #title} and {@link #tools}</p>
- * <br><p><b>Note</b>: see the Note for <code>{@link Ext.Component#el el}</code> also.</p>
- * @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.
- * <p>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.</p>
- * <p>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.
- * <br><p><b>Note</b>: see the Note for <code>{@link Ext.Component#el el}</code> also.</p>
- * @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
- * <p>A {@link Ext.DomHelper DomHelper} element specification object may be specified for any
- * Panel Element.</p>
- * <p>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 (<code>baseCls</code> will be
- * replaced by <code>{@link #baseCls}</code>):</p>
- * <pre>
- * 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
- * </pre>
- * <p>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 &lt;center&gt;
- * element:</p>
- * <pre><code>
-new Ext.Panel({
- title: 'Message Title',
- renderTo: Ext.getBody(),
- width: 200, height: 130,
- <b>bodyCfg</b>: {
- 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}
-});
- * </code></pre>
- * <p>The example above also explicitly creates a <code>{@link #footer}</code> with custom markup and
- * styling applied.</p>
- */
- /**
- * @cfg {Object} headerCfg
- * <p>A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
- * of this Panel's {@link #header} Element. See <code>{@link #bodyCfg}</code> also.</p>
- */
- /**
- * @cfg {Object} bwrapCfg
- * <p>A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
- * of this Panel's {@link #bwrap} Element. See <code>{@link #bodyCfg}</code> also.</p>
- */
- /**
- * @cfg {Object} tbarCfg
- * <p>A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
- * of this Panel's {@link #tbar} Element. See <code>{@link #bodyCfg}</code> also.</p>
- */
- /**
- * @cfg {Object} bbarCfg
- * <p>A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
- * of this Panel's {@link #bbar} Element. See <code>{@link #bodyCfg}</code> also.</p>
- */
- /**
- * @cfg {Object} footerCfg
- * <p>A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
- * of this Panel's {@link #footer} Element. See <code>{@link #bodyCfg}</code> also.</p>
- */
- /**
- * @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 <code>true</code>
- * to enable closing in such situations. Defaults to <code>false</code>.
- */
- /**
- * The Panel's footer {@link Ext.Element Element}. Read-only.
- * <p>This Element is used to house the Panel's <code>{@link #buttons}</code> or <code>{@link #fbar}</code>.</p>
- * <br><p><b>Note</b>: see the Note for <code>{@link Ext.Component#el el}</code> also.</p>
- * @type Ext.Element
- * @property footer
- */
- /**
- * @cfg {Mixed} applyTo
- * <p>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 <code>applyTo</code> 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.</p>
- * <p>The following class names are supported (baseCls will be replaced by {@link #baseCls}):</p>
- * <ul><li>baseCls + '-header'</li>
- * <li>baseCls + '-header-text'</li>
- * <li>baseCls + '-bwrap'</li>
- * <li>baseCls + '-tbar'</li>
- * <li>baseCls + '-body'</li>
- * <li>baseCls + '-bbar'</li>
- * <li>baseCls + '-footer'</li></ul>
- * <p>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.</p>
- */
- /**
- * @cfg {Object/Array} tbar
- * <p>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}.</p>
- * <p><b>Note:</b> Although a Toolbar may contain Field components, these will <b>not</b> 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 <b>will</b> be submitted because form
- * submission parameters are collected from the DOM tree.</p>
- */
- /**
- * @cfg {Object/Array} bbar
- * <p>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}.</p>
- * <p><b>Note:</b> Although a Toolbar may contain Field components, these will <b>not</b> 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 <b>will</b> be submitted because form
- * submission parameters are collected from the DOM tree.</p>
- */
- /** @cfg {Object/Array} fbar
- * <p>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.</p>
- * <p>After render, the <code>fbar</code> property will be an {@link Ext.Toolbar Toolbar} instance.</p>
- * <p>If <code>{@link #buttons}</code> are specified, they will supersede the <code>fbar</code> configuration property.</p>
- * The Panel's <code>{@link #buttonAlign}</code> configuration affects the layout of these items, for example:
- * <pre><code>
-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();
- * </code></pre>
- * <p><b>Note:</b> Although a Toolbar may contain Field components, these will <b>not</b> 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 <b>will</b> be submitted because form
- * submission parameters are collected from the DOM tree.</p>
- */
- /**
- * @cfg {Boolean} header
- * <code>true</code> to create the Panel's header element explicitly, <code>false</code> to skip creating
- * it. If a <code>{@link #title}</code> is set the header will be created automatically, otherwise it will not.
- * If a <code>{@link #title}</code> is set but <code>header</code> is explicitly set to <code>false</code>, the header
- * will not be rendered.
- */
- /**
- * @cfg {Boolean} footer
- * <code>true</code> to create the footer element explicitly, false to skip creating it. The footer
- * will be created automatically if <code>{@link #buttons}</code> or a <code>{@link #fbar}</code> have
- * been configured. See <code>{@link #bodyCfg}</code> for an example.
- */
- /**
- * @cfg {String} title
- * The title text to be used as innerHTML (html tags are accepted) to display in the panel
- * <code>{@link #header}</code> (defaults to ''). When a <code>title</code> is specified the
- * <code>{@link #header}</code> element will automatically be created and displayed unless
- * {@link #header} is explicitly set to <code>false</code>. If you do not want to specify a
- * <code>title</code> at config time, but you may want one later, you must either specify a non-empty
- * <code>title</code> (a blank space ' ' will do) or <code>header:true</code> so that the container
- * element will get created.
- */
- /**
- * @cfg {Array} buttons
- * <code>buttons</code> will be used as <code>{@link Ext.Container#items items}</code> for the toolbar in
- * the footer (<code>{@link #fbar}</code>). 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 <code>minWidth</code> or the Panel is configured with <code>minButtonWidth</code>,
- * 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.<p>
- * 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.</p>
- */
- /**
- * @cfg {Boolean} frame
- * <code>false</code> by default to render with plain 1px square borders. <code>true</code> to render with
- * 9 elements, complete with custom rounded corners (also see {@link Ext.Element#boxWrap}).
- * <p>The template generated for each condition is depicted below:</p><pre><code>
- *
-// frame = false
-&lt;div id="developer-specified-id-goes-here" class="x-panel">
- &lt;div class="x-panel-header">&lt;span class="x-panel-header-text">Title: (frame:false)&lt;/span>&lt;/div>
- &lt;div class="x-panel-bwrap">
- &lt;div class="x-panel-body">&lt;p>html value goes here&lt;/p>&lt;/div>
- &lt;/div>
-&lt;/div>
-// frame = true (create 9 elements)
-&lt;div id="developer-specified-id-goes-here" class="x-panel">
- &lt;div class="x-panel-tl">&lt;div class="x-panel-tr">&lt;div class="x-panel-tc">
- &lt;div class="x-panel-header">&lt;span class="x-panel-header-text">Title: (frame:true)&lt;/span>&lt;/div>
- &lt;/div>&lt;/div>&lt;/div>
- &lt;div class="x-panel-bwrap">
- &lt;div class="x-panel-ml">&lt;div class="x-panel-mr">&lt;div class="x-panel-mc">
- &lt;div class="x-panel-body">&lt;p>html value goes here&lt;/p>&lt;/div>
- &lt;/div>&lt;/div>&lt;/div>
- &lt;div class="x-panel-bl">&lt;div class="x-panel-br">&lt;div class="x-panel-bc"/>
- &lt;/div>&lt;/div>&lt;/div>
-&lt;/div>
- * </code></pre>
- */
- /**
- * @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 '').
- * <p>An example of specifying a custom icon class would be something like:
- * </p><pre><code>
-// 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; }
-</code></pre>
- */
- /**
- * @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 <code><b></b>tools.<i>&lt;tool-type&gt;</i></code>
- * <p>Each tool config may contain the following properties:
- * <div class="mdetail-params"><ul>
- * <li><b>id</b> : String<div class="sub-desc"><b>Required.</b> The type
- * of tool to create. By default, this assigns a CSS class of the form <code>x-tool-<i>&lt;tool-type&gt;</i></code> 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:
- * <ul>
- * <div class="x-tool x-tool-toggle" style="float:left; margin-right:5;"> </div><div><code> toggle</code> (Created by default when {@link #collapsible} is <code>true</code>)</div>
- * <div class="x-tool x-tool-close" style="float:left; margin-right:5;"> </div><div><code> close</code></div>
- * <div class="x-tool x-tool-minimize" style="float:left; margin-right:5;"> </div><div><code> minimize</code></div>
- * <div class="x-tool x-tool-maximize" style="float:left; margin-right:5;"> </div><div><code> maximize</code></div>
- * <div class="x-tool x-tool-restore" style="float:left; margin-right:5;"> </div><div><code> restore</code></div>
- * <div class="x-tool x-tool-gear" style="float:left; margin-right:5;"> </div><div><code> gear</code></div>
- * <div class="x-tool x-tool-pin" style="float:left; margin-right:5;"> </div><div><code> pin</code></div>
- * <div class="x-tool x-tool-unpin" style="float:left; margin-right:5;"> </div><div><code> unpin</code></div>
- * <div class="x-tool x-tool-right" style="float:left; margin-right:5;"> </div><div><code> right</code></div>
- * <div class="x-tool x-tool-left" style="float:left; margin-right:5;"> </div><div><code> left</code></div>
- * <div class="x-tool x-tool-up" style="float:left; margin-right:5;"> </div><div><code> up</code></div>
- * <div class="x-tool x-tool-down" style="float:left; margin-right:5;"> </div><div><code> down</code></div>
- * <div class="x-tool x-tool-refresh" style="float:left; margin-right:5;"> </div><div><code> refresh</code></div>
- * <div class="x-tool x-tool-minus" style="float:left; margin-right:5;"> </div><div><code> minus</code></div>
- * <div class="x-tool x-tool-plus" style="float:left; margin-right:5;"> </div><div><code> plus</code></div>
- * <div class="x-tool x-tool-help" style="float:left; margin-right:5;"> </div><div><code> help</code></div>
- * <div class="x-tool x-tool-search" style="float:left; margin-right:5;"> </div><div><code> search</code></div>
- * <div class="x-tool x-tool-save" style="float:left; margin-right:5;"> </div><div><code> save</code></div>
- * <div class="x-tool x-tool-print" style="float:left; margin-right:5;"> </div><div><code> print</code></div>
- * </ul></div></li>
- * <li><b>handler</b> : Function<div class="sub-desc"><b>Required.</b> The function to
- * call when clicked. Arguments passed are:<ul>
- * <li><b>event</b> : Ext.EventObject<div class="sub-desc">The click event.</div></li>
- * <li><b>toolEl</b> : Ext.Element<div class="sub-desc">The tool Element.</div></li>
- * <li><b>panel</b> : Ext.Panel<div class="sub-desc">The host Panel</div></li>
- * <li><b>tc</b> : Object<div class="sub-desc">The tool configuration object</div></li>
- * </ul></div></li>
- * <li><b>stopEvent</b> : Boolean<div class="sub-desc">Defaults to true. Specify as false to allow click event to propagate.</div></li>
- * <li><b>scope</b> : Object<div class="sub-desc">The scope in which to call the handler.</div></li>
- * <li><b>qtip</b> : String/Object<div class="sub-desc">A tip string, or
- * a config argument to {@link Ext.QuickTip#register}</div></li>
- * <li><b>hidden</b> : Boolean<div class="sub-desc">True to initially render hidden.</div></li>
- * <li><b>on</b> : Object<div class="sub-desc">A listener config object specifiying
- * event listeners in the format of an argument to {@link #addListener}</div></li>
- * </ul></div>
- * <p>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.</p>
- * <p>Example usage:</p>
- * <pre><code>
-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
- }
-}]
-</code></pre>
- * <p>For the custom id of <code>'help'</code> define two relevant css classes with a link to
- * a 15x15 image:</p>
- * <pre><code>
-.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;}
-</code></pre>
- */
- /**
- * @cfg {Ext.Template/Ext.XTemplate} toolTemplate
- * <p>A Template used to create {@link #tools} in the {@link #header} Element. Defaults to:</p><pre><code>
-new Ext.Template('&lt;div class="x-tool x-tool-{id}">&amp;#160;&lt;/div>')</code></pre>
- * <p>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 &lt;a> tag is used to provide a
- * visual indication when hovering over the tool:</p><pre><code>
-var win = new Ext.Window({
- tools: [{
- id: 'download',
- href: '/MyPdfDoc.pdf'
- }],
- toolTemplate: new Ext.XTemplate(
- '&lt;tpl if="id==\'download\'">',
- '&lt;a class="x-tool x-tool-pdf" href="{href}">&lt;/a>',
- '&lt;/tpl>',
- '&lt;tpl if="id!=\'download\'">',
- '&lt;div class="x-tool x-tool-{id}">&amp;#160;&lt;/div>',
- '&lt;/tpl>'
- ),
- width:500,
- height:300,
- closeAction:'hide'
-});</code></pre>
- * <p>Note that the CSS class 'x-tool-pdf' should have an associated style rule which provides an
- * appropriate background image, something like:</p>
- <pre><code>
- a.x-tool-pdf {background-image: url(../shared/extjs/images/pdf.gif)!important;}
- </code></pre>
- */
- /**
- * @cfg {Boolean} hideCollapseTool
- * <code>true</code> to hide the expand/collapse toggle button when <code>{@link #collapsible} == true</code>,
- * <code>false</code> to display it (defaults to <code>false</code>).
- */
- /**
- * @cfg {Boolean} titleCollapse
- * <code>true</code> to allow expanding and collapsing the panel (when <code>{@link #collapsible} = true</code>)
- * by clicking anywhere in the header bar, <code>false</code>) to allow it only by clicking to tool button
- * (defaults to <code>false</code>)). If this panel is a child item of a border layout also see the
- * {@link Ext.layout.BorderLayout.Region BorderLayout.Region}
- * <code>{@link Ext.layout.BorderLayout.Region#floatable floatable}</code> config option.
- */
- /**
- * @cfg {Mixed} floating
- * <p>This property is used to configure the underlying {@link Ext.Layer}. Acceptable values for this
- * configuration property are:</p><div class="mdetail-params"><ul>
- * <li><b><code>false</code></b> : <b>Default.</b><div class="sub-desc">Display the panel inline where it is
- * rendered.</div></li>
- * <li><b><code>true</code></b> : <div class="sub-desc">Float the panel (absolute position it with automatic
- * shimming and shadow).<ul>
- * <div class="sub-desc">Setting floating to true will create an Ext.Layer for this panel and display the
- * panel at negative offsets so that it is hidden.</div>
- * <div class="sub-desc">Since the panel will be absolute positioned, the position must be set explicitly
- * <i>after</i> render (e.g., <code>myPanel.setPosition(100,100);</code>).</div>
- * <div class="sub-desc"><b>Note</b>: 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.</div>
- * </ul></div></li>
- * <li><b><code>{@link Ext.Layer object}</code></b> : <div class="sub-desc">The specified object will be used
- * as the configuration object for the {@link Ext.Layer} that will be created.</div></li>
- * </ul></div>
- */
- /**
- * @cfg {Boolean/String} shadow
- * <code>true</code> (or a valid Ext.Shadow {@link Ext.Shadow#mode} value) to display a shadow behind the
- * panel, <code>false</code> to display no shadow (defaults to <code>'sides'</code>). Note that this option
- * only applies when <code>{@link #floating} = true</code>.
- */
- /**
- * @cfg {Number} shadowOffset
- * The number of pixels to offset the shadow if displayed (defaults to <code>4</code>). Note that this
- * option only applies when <code>{@link #floating} = true</code>.
- */
- /**
- * @cfg {Boolean} shim
- * <code>false</code> to disable the iframe shim in browsers which need one (defaults to <code>true</code>).
- * Note that this option only applies when <code>{@link #floating} = true</code>.
- */
- /**
- * @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 <code>null</code>).
- */
- /**
- * @cfg {Boolean/Object} draggable
- * <p><code>true</code> to enable dragging of this Panel (defaults to <code>false</code>).</p>
- * <p>For custom drag/drop implementations, an <b>Ext.Panel.DD</b> config could also be passed
- * in this config instead of <code>true</code>. 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.:
- * <pre><code>
-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&#39;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());
- }
- },
-// Called on the mouseup event.
- endDrag : function(e){
- this.panel.setPosition(this.x, this.y);
- }
- }
-}).show();
-</code></pre>
- */
- /**
- * @cfg {Boolean} disabled
- * Render this panel disabled (default is <code>false</code>). 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:
- * <pre><code>
-new Ext.Panel({
- ...
- listeners: {
- 'afterlayout': {
- fn: function(p){
- p.disable();
- },
- single: true // important, as many layouts can occur
- }
- }
-});
-</code></pre>
- */
- /**
- * @cfg {Boolean} autoHeight
- * <code>true</code> to use height:'auto', <code>false</code> to use fixed height (defaults to <code>false</code>).
- * <b>Note</b>: Setting <code>autoHeight: true</code> 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 (<code>fit</code>, <code>border</code>, etc.) then setting <code>autoHeight: true</code>
- * 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 <code>'x-panel'</code>).
- * <p>Another option available by default is to specify <code>'x-plain'</code> which strips all styling
- * except for required attributes for Ext layouts to function (e.g. overflow:hidden).
- * See <code>{@link #unstyled}</code> also.</p>
- */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
baseCls : 'x-panel',
- /**
- * @cfg {String} collapsedCls
- * A CSS class to add to the panel's element after it has been collapsed (defaults to
- * <code>'x-panel-collapsed'</code>).
- */
+
collapsedCls : 'x-panel-collapsed',
- /**
- * @cfg {Boolean} maskDisabled
- * <code>true</code> to mask the panel when it is {@link #disabled}, <code>false</code> to not mask it (defaults
- * to <code>true</code>). 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
- * <code>true</code> to animate the transition when the panel is collapsed, <code>false</code> to skip the
- * animation (defaults to <code>true</code> if the {@link Ext.Fx} class is available, otherwise <code>false</code>).
- */
+
animCollapse : Ext.enableFx,
- /**
- * @cfg {Boolean} headerAsText
- * <code>true</code> to display the panel <code>{@link #title}</code> in the <code>{@link #header}</code>,
- * <code>false</code> to hide it (defaults to <code>true</code>).
- */
+
headerAsText : true,
- /**
- * @cfg {String} buttonAlign
- * The alignment of any {@link #buttons} added to this panel. Valid values are <code>'right'</code>,
- * <code>'left'</code> and <code>'center'</code> (defaults to <code>'right'</code>).
- */
+
buttonAlign : 'right',
- /**
- * @cfg {Boolean} collapsed
- * <code>true</code> to render the panel collapsed, <code>false</code> to render it expanded (defaults to
- * <code>false</code>).
- */
+
collapsed : false,
- /**
- * @cfg {Boolean} collapseFirst
- * <code>true</code> to make sure the collapse/expand toggle button always renders first (to the left of)
- * any other tools in the panel's title bar, <code>false</code> to render it last (defaults to <code>true</code>).
- */
+
collapseFirst : true,
- /**
- * @cfg {Number} minButtonWidth
- * Minimum width in pixels of all {@link #buttons} in this panel (defaults to <code>75</code>)
- */
+
minButtonWidth : 75,
- /**
- * @cfg {Boolean} unstyled
- * Overrides the <code>{@link #baseCls}</code> setting to <code>{@link #baseCls} = 'x-plain'</code> 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<div class="mdetail-params"><ul>
- * <li><code>header</code></li>
- * <li><code>tbar</code> (top bar)</li>
- * <li><code>body</code></li>
- * <li><code>bbar</code> (bottom bar)</li>
- * <li><code>footer</code></li>
- * </ul></div>
- * Defaults to '<code>body</code>'.
- */
+
+
elements : 'body',
- /**
- * @cfg {Boolean} preventBodyReset
- * Defaults to <code>false</code>. When set to <code>true</code>, an extra css class <code>'x-panel-normal'</code>
- * 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 <b>body</b> 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 <tt>undefined</tt>.
- *
- */
+
padding: undefined,
- /** @cfg {String} resizeEvent
- * The event to listen to for resizing in layouts. Defaults to <tt>'bodyresize'</tt>.
- */
+
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'
);
@@ -27034,7 +17636,7 @@ new Ext.Panel({
this.toolbars = [];
- // shortcuts
+
if(this.tbar){
this.elements += ',tbar';
this.topToolbar = this.createToolbar(this.tbar);
@@ -27071,7 +17673,7 @@ new Ext.Panel({
}
},
- // private
+
createFbar : function(fbar){
var min = this.minButtonWidth;
this.elements += ',footer';
@@ -27085,24 +17687,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 <code>{@link #buttons}</code>
- * 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
@@ -27113,7 +17710,7 @@ new Ext.Panel({
return result;
},
- // private
+
createElement : function(name, pnode){
if(this[name]){
pnode.appendChild(this[name].dom);
@@ -27137,7 +17734,7 @@ new Ext.Panel({
}
},
- // private
+
onRender : function(ct, position){
Ext.Panel.superclass.onRender.call(this, ct, position);
this.createClasses();
@@ -27164,7 +17761,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;
@@ -27185,16 +17782,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);
@@ -27209,18 +17806,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);
@@ -27265,7 +17858,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 =
'<span class="' + this.headerTextCls + '">'+this.header.dom.innerHTML+'</span>';
@@ -27288,7 +17881,7 @@ new Ext.Panel({
this.addTool.apply(this, ts);
}
- // Render Toolbars.
+
if(this.fbar){
this.footer.addClass('x-panel-btns');
this.fbar.ownerCt = this;
@@ -27305,11 +17898,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;
@@ -27335,7 +17924,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, {
@@ -27346,39 +17935,22 @@ new Ext.Panel({
}), this.el);
},
- /**
- * Returns the {@link Ext.Toolbar toolbar} from the top (<code>{@link #tbar}</code>) section of the panel.
- * @return {Ext.Toolbar} The toolbar
- */
+
getTopToolbar : function(){
return this.topToolbar;
},
- /**
- * Returns the {@link Ext.Toolbar toolbar} from the bottom (<code>{@link #bbar}</code>) section of the panel.
- * @return {Ext.Toolbar} The toolbar
- */
+
getBottomToolbar : function(){
return this.bottomToolbar;
},
- /**
- * Returns the {@link Ext.Toolbar toolbar} from the footer (<code>{@link #fbar}</code>) 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 (<code>this</code> 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([]);
@@ -27395,7 +17967,7 @@ new Ext.Panel({
return this.fbar.add(config);
},
- // private
+
addTool : function(){
if(!this.rendered){
if(!this.tools){
@@ -27406,12 +17978,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(
'<div class="x-tool x-tool-{id}">&#160;</div>'
);
@@ -27477,7 +18049,7 @@ new Ext.Panel({
}
},
- // private
+
onShow : function(){
if(this.floating){
return this.el.show();
@@ -27485,7 +18057,7 @@ new Ext.Panel({
Ext.Panel.superclass.onShow.call(this);
},
- // private
+
onHide : function(){
if(this.floating){
return this.el.hide();
@@ -27493,7 +18065,7 @@ new Ext.Panel({
Ext.Panel.superclass.onHide.call(this);
},
- // private
+
createToolHandler : function(t, tc, overCls, panel){
return function(e){
t.removeClass(overCls);
@@ -27506,7 +18078,7 @@ new Ext.Panel({
};
},
- // private
+
afterRender : function(){
if(this.floating && !this.hidden){
this.el.show();
@@ -27514,7 +18086,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);
@@ -27522,7 +18094,7 @@ new Ext.Panel({
this.initEvents();
},
- // private
+
getKeyMap : function(){
if(!this.keyMap){
this.keyMap = new Ext.KeyMap(this.el, this.keys);
@@ -27530,7 +18102,7 @@ new Ext.Panel({
return this.keyMap;
},
- // private
+
initEvents : function(){
if(this.keys){
this.getKeyMap();
@@ -27552,20 +18124,13 @@ new Ext.Panel({
},
- // private
+
initDraggable : function(){
- /**
- * <p>If this Panel is configured {@link #draggable}, this property will contain
- * an instance of {@link Ext.dd.DragSource} which handles dragging the Panel.</p>
- * 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();
@@ -27575,13 +18140,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,
@@ -27592,7 +18157,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);
@@ -27601,13 +18166,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;
@@ -27618,7 +18177,7 @@ new Ext.Panel({
return this;
},
- // private
+
onCollapse : function(doAnim, animArg){
if(doAnim){
this[this.collapseEl].slideOut(this.slideAnchor,
@@ -27630,7 +18189,7 @@ new Ext.Panel({
}
},
- // private
+
afterCollapse : function(anim){
this.collapsed = true;
this.el.addClass(this.collapsedCls);
@@ -27639,7 +18198,7 @@ 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: undefined, height: undefined };
@@ -27648,13 +18207,7 @@ new Ext.Panel({
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;
@@ -27666,7 +18219,7 @@ new Ext.Panel({
return this;
},
- // private
+
onExpand : function(doAnim, animArg){
if(doAnim){
this[this.collapseEl].slideIn(this.slideAnchor,
@@ -27678,7 +18231,7 @@ new Ext.Panel({
}
},
- // private
+
afterExpand : function(anim){
this.collapsed = false;
if(anim !== false){
@@ -27692,18 +18245,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();
@@ -27711,7 +18259,7 @@ new Ext.Panel({
Ext.Panel.superclass.onDisable.call(this);
},
- // private
+
onEnable : function(){
if(this.rendered && this.maskDisabled){
this.el.unmask();
@@ -27719,16 +18267,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()));
@@ -27748,8 +18296,8 @@ 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) {
+
+ if (Ext.isIE9m) {
this.bbar.setStyle('position', 'static');
this.bbar.setStyle('position', '');
}
@@ -27758,14 +18306,14 @@ new Ext.Panel({
if(this.footer){
this.footer.setWidth(w);
if(this.fbar){
- this.fbar.setSize(Ext.isIE ? (w - this.footer.getFrameWidth('lr')) : 'auto');
+ this.fbar.setSize(Ext.isIE9m ? (w - this.footer.getFrameWidth('lr')) : 'auto');
}
}
- // 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);
@@ -27775,7 +18323,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;
@@ -27792,12 +18340,12 @@ new Ext.Panel({
},
- // private
+
onBodyResize: function(w, h){
this.fireEvent('bodyresize', this, w, h);
},
- // private
+
getToolbarHeight: function(){
var h = 0;
if(this.rendered){
@@ -27808,26 +18356,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');
@@ -27839,11 +18383,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 = this.el.getFrameWidth('tb') + this.bwrap.getFrameWidth('tb');
h += (this.tbar ? this.tbar.getHeight() : 0) +
@@ -27858,52 +18398,35 @@ new Ext.Panel({
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;
},
- /**
- * <p>Sets the title text for the panel and optionally the {@link #iconCls icon class}.</p>
- * <p>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 <code>{@link #title}</code>,
- * or configuring it with <code><b>{@link #header}: true</b></code>.</p>
- * @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){
@@ -27916,42 +18439,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:
-<pre><code>
-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
-});
-</code></pre>
- * 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){
@@ -27995,7 +18495,7 @@ panel.load({
Ext.destroy(this.toolbars);
},
- // private
+
createClasses : function(){
this.headerCls = this.baseCls + '-header';
this.headerTextCls = this.baseCls + '-header-text';
@@ -28006,7 +18506,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 : '');
@@ -28029,7 +18529,7 @@ panel.load({
}
},
- // private
+
doAutoLoad : function(){
var u = this.body.getUpdater();
if(this.renderer){
@@ -28038,33 +18538,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;
@@ -28073,135 +18559,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 <tt>true</tt>.
- */
+
+
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 <tt>[0, 0]</tt>.
- */
+
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 <tt>true</tt>.
- */
+
completeOnEnter : true,
- /**
- * @cfg {Boolean} cancelOnEsc True to cancel the edit when the escape key is pressed. Defaults to <tt>true</tt>.
- */
+
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,
@@ -28232,13 +18634,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,
@@ -28257,12 +18659,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();
@@ -28282,7 +18679,7 @@ Ext.extend(Ext.Editor, Ext.Component, {
}
},
- // private
+
doAutoSize : function(){
if(this.autoSize){
var sz = this.boundEl.getSize(),
@@ -28304,28 +18701,21 @@ 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){
- // IE7 in strict mode doesn't size properly.
+
if(Ext.isGecko2 || Ext.isOpera || (Ext.isIE7 && Ext.isStrict)){
- // 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();
@@ -28333,15 +18723,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();
}
@@ -28366,7 +18753,7 @@ Ext.extend(Ext.Editor, Ext.Component, {
}
},
- // private
+
onShow : function(){
this.el.show();
if(this.hideEl !== false){
@@ -28376,12 +18763,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();
@@ -28391,7 +18773,7 @@ Ext.extend(Ext.Editor, Ext.Component, {
}
},
- // private
+
hideEdit: function(remainVisible){
if(remainVisible !== true){
this.editing = false;
@@ -28399,15 +18781,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();
@@ -28423,18 +18805,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();
},
@@ -28447,71 +18823,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.<br />
- * Here's an example of typical usage:
- * <pre><code>
-var cp = new Ext.ColorPalette({value:'993300'}); // initial selected color
-cp.render('my-div');
-cp.on('select', function(palette, selColor){
- // do something with selColor
-});
-</code></pre>
- * @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 <tt>'click'</tt>.
- */
+
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,
- /**
- * <p>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.</p>
- * <p>You can override individual colors if needed:</p>
- * <pre><code>
-var cp = new Ext.ColorPalette();
-cp.colors[0] = 'FF0000'; // change the first box to red
-</code></pre>
-Or you can provide a custom array of your own for complete control:
-<pre><code>
-var cp = new Ext.ColorPalette();
-cp.colors = ['000000', '993300', '333300'];
-</code></pre>
- * @type Array
- */
colors : [
'000000', '993300', '333300', '003300', '003366', '000080', '333399', '333333',
'800000', 'FF6600', '808000', '008000', '008080', '0000FF', '666699', '808080',
@@ -28520,39 +18847,23 @@ 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:<div class="mdetail-params"><ul>
- * <li><code>palette</code> : ColorPalette<div class="sub-desc">The {@link #palette Ext.ColorPalette}.</div></li>
- * <li><code>color</code> : String<div class="sub-desc">The 6-digit color hex code (without the # symbol).</div></li>
- * </ul></div>
- */
- /**
- * @cfg {Object} scope
- * The scope (<tt><b>this</b></tt> reference) in which the <code>{@link #handler}</code>
- * 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'
);
if(this.handler){
this.on('select', this.handler, this.scope, true);
- }
+ }
},
- // private
+
onRender : function(container, position){
this.autoEl = {
tag: 'div',
@@ -28560,7 +18871,7 @@ cp.colors = ['000000', '993300', '333300'];
};
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:#{.}" unselectable="on">&#160;</span></em></a></tpl>'
+ '<tpl for="."><a href="#" class="color-{.}" hidefocus="on"><em><span style="background:#{.}" class="x-unselectable" unselectable="on">&#160;</span></em></a></tpl>'
);
t.overwrite(this.el, this.colors);
this.mon(this.el, this.clickEvent, this.handleClick, this, {delegate: 'a'});
@@ -28569,7 +18880,7 @@ cp.colors = ['000000', '993300', '333300'];
}
},
- // private
+
afterRender : function(){
Ext.ColorPalette.superclass.afterRender.call(this);
if(this.value){
@@ -28579,7 +18890,7 @@ cp.colors = ['000000', '993300', '333300'];
}
},
- // private
+
handleClick : function(e, t){
e.preventDefault();
if(!this.disabled){
@@ -28588,11 +18899,7 @@ 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 <tt>false</tt>.
- */
+
select : function(color, suppressEvent){
color = color.replace('#', '');
if(color != this.value || this.allowReselect){
@@ -28608,163 +18915,59 @@ cp.colors = ['000000', '993300', '333300'];
}
}
- /**
- * @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.reg('colorpalette', Ext.ColorPalette);
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>'&#160;OK&#160;'</code> to give the user extra clicking room)
- */
+
okText : '&#160;OK&#160;',
- /**
- * @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
- * The tooltip to display when the date falls on a disabled day (defaults to <code>'Disabled'</code>)
- */
+
disabledDaysText : 'Disabled',
- /**
- * @cfg {String} disabledDatesText
- * The tooltip text to display when the date falls on a disabled date (defaults to <code>'Disabled'</code>)
- */
+
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 <code>'Next Month (Control+Right)'</code>)
- */
+
nextText : 'Next Month (Control+Right)',
- /**
- * @cfg {String} prevText
- * The previous month navigation button tooltip (defaults to <code>'Previous Month (Control+Left)'</code>)
- */
+
prevText : 'Previous Month (Control+Left)',
- /**
- * @cfg {String} monthYearText
- * The header month selector tooltip (defaults to <code>'Choose a month (Control+Up/Down to move years)'</code>)
- */
+
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 <code>true</code>).
- */
+
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:
- * <ul>
- * <li>['03/08/2003', '09/16/2003'] would disable those exact dates</li>
- * <li>['03/08', '09/16'] would disable those days for every year</li>
- * <li>['^03/08'] would only match the beginning (useful if you are using short years)</li>
- * <li>['03/../2006'] would disable every day in March 2006</li>
- * <li>['^03'] would disable every day in every March</li>
- * </ul>
- * 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
- // private
+
+ initHour: 12,
+
+
initComponent : function(){
Ext.DatePicker.superclass.initComponent.call(this);
@@ -28772,12 +18975,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'
);
@@ -28788,7 +18986,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, {
this.initDisabledDays();
},
- // private
+
initDisabledDays : function(){
if(!this.disabledDatesRE && this.disabledDates){
var dd = this.disabledDates,
@@ -28805,11 +19003,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;
@@ -28821,83 +19015,64 @@ 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);
this.update(initial ? this.value : this.activeDate);
- if(Ext.isIE){
+ if(Ext.isIE9m){
this.el.repaint();
}
},
- // 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.
- */
+ if(Ext.isIE9m && !Ext.isIE8){
+
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);
@@ -28908,7 +19083,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, {
}
},
- // private
+
onRender : function(container, position){
var m = [
'<table cellspacing="0">',
@@ -29038,7 +19213,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, {
this.onEnable(true);
},
- // private
+
createMonthPicker : function(){
if(!this.monthPicker.dom.firstChild){
var buf = ['<table border="0" cellspacing="0">'];
@@ -29078,7 +19253,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, {
}
},
- // private
+
showMonthPicker : function(){
if(!this.disabled){
this.createMonthPicker();
@@ -29095,7 +19270,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, {
}
},
- // private
+
updateMPYear : function(y){
this.mpyear = y;
var ys = this.mpYears.elements;
@@ -29114,19 +19289,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;
@@ -29136,7 +19311,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);
@@ -29160,7 +19335,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, {
}
},
- // private
+
onMonthDblClick : function(e, t){
e.stopEvent();
var el = new Ext.Element(t), pn;
@@ -29174,7 +19349,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, {
}
},
- // private
+
hideMonthPicker : function(disableAnim){
if(this.monthPicker){
if(disableAnim === true){
@@ -29185,27 +19360,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){
@@ -29218,7 +19393,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')){
@@ -29229,7 +19404,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, {
}
},
- // private
+
selectToday : function(){
if(this.todayBtn && !this.todayBtn.disabled){
this.setValue(new Date().clearTime());
@@ -29237,7 +19412,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, {
}
},
- // private
+
update : function(date, forceRefresh){
if(this.rendered){
var vd = this.activeDate, vis = this.isVisible();
@@ -29271,7 +19446,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(),
@@ -29309,7 +19484,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;
@@ -29365,9 +19540,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;
@@ -29377,7 +19552,7 @@ Ext.DatePicker = Ext.extend(Ext.BoxComponent, {
}
},
- // private
+
beforeDestroy : function() {
if(this.rendered){
Ext.destroy(
@@ -29395,29 +19570,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.
- * <p>Example usage:</p>
- *<pre><code>
-// Basic mask:
-var myMask = new Ext.LoadMask(Ext.getBody(), {msg:"Please wait..."});
-myMask.show();
-</code></pre>
- * @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);
@@ -29431,7 +19588,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,
@@ -29443,74 +19600,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);
@@ -29523,36 +19655,19 @@ Ext.LoadMask.prototype = {
um.un('failure', this.onLoad, this);
}
}
-};/**
- * @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, {
- /**
- * True while the thumb is in a drag operation
- * @type Boolean
- */
+
dragging: false,
- /**
- * @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
});
@@ -29563,34 +19678,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;
@@ -29608,12 +19715,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;
@@ -29623,11 +19725,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;
@@ -29636,11 +19734,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,
@@ -29665,11 +19759,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;
@@ -29684,180 +19774,74 @@ Ext.slider.Thumb = Ext.extend(Object, {
}
},
- /**
- * @private
- * Destroys the thumb
- */
+
destroy: function(){
Ext.destroyMembers(this, 'tracker', 'el');
}
});
-/**
- * @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:
-<pre>
-new Ext.Slider({
- renderTo: Ext.getBody(),
- width: 200,
- value: 50,
- increment: 10,
- minValue: 0,
- maxValue: 100
-});
-</pre>
- * Sliders can be created with more than one thumb handle by passing an array of values instead of a single one:
-<pre>
-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
-});
-</pre>
- */
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.
- * <p>The number of decimal places to which to round the Slider's value. Defaults to 0.</p>
- * <p>To disable rounding, configure as <tt><b>false</b></tt>.</p>
- */
+
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,
- /**
- * @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.MultiSlider} 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.MultiSlider} 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.MultiSlider} 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.MultiSlider} 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.MultiSlider} 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.MultiSlider} 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;
@@ -29871,10 +19855,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,
@@ -29884,18 +19865,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;
@@ -29913,7 +19887,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'),
@@ -29932,23 +19906,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,
@@ -29959,18 +19929,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;
@@ -29983,15 +19948,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;
@@ -29999,17 +19959,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;
@@ -30027,18 +19981,9 @@ 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){
- /*
- * 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;
@@ -30063,13 +20008,7 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, {
}
},
- /**
- * @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;
@@ -30088,7 +20027,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);
@@ -30099,7 +20038,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);
@@ -30108,24 +20047,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);
@@ -30133,11 +20062,7 @@ 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;
var i = 0,
@@ -30152,11 +20077,7 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, {
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;
var i = 0,
@@ -30171,13 +20092,7 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, {
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;
@@ -30196,31 +20111,19 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, {
}
},
- /**
- * @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;
@@ -30231,25 +20134,22 @@ 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();
}
- // check to see if we're using an auto width
+
if(Ext.isNumber(w)){
this.innerEl.setWidth(w - (this.el.getPadding('l') + this.endEl.getPadding('r')));
}
@@ -30257,7 +20157,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);
@@ -30268,8 +20168,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();
@@ -30284,7 +20184,7 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, {
}
},
- //private
+
onEnable: function(){
Ext.slider.MultiSlider.superclass.onEnable.call(this);
@@ -30305,12 +20205,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++) {
@@ -30319,19 +20214,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 = [];
@@ -30342,7 +20230,7 @@ Ext.slider.MultiSlider = Ext.extend(Ext.BoxComponent, {
return values;
},
- // private
+
beforeDestroy : function(){
var thumbs = this.thumbs;
for(var i = 0, len = thumbs.length; i < len; ++i){
@@ -30356,24 +20244,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:
-<pre><code>
-new Ext.slider.SingleSlider({
- renderTo: Ext.getBody(),
- width: 200,
- value: 50,
- increment: 10,
- minValue: 0,
- maxValue: 100
-});
-</code></pre>
- * 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 || {};
@@ -30385,28 +20256,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);
}
@@ -30414,29 +20277,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')));
@@ -30471,7 +20329,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,
@@ -30482,56 +20340,27 @@ Ext.slider.Thumb.Vertical = {
return slider.minValue + Ext.util.Format.round(bottom / slider.getRatio(), slider.decimalPrecision);
}
};
-/**
- * @class Ext.ProgressBar
- * @extends Ext.BoxComponent
- * <p>An updateable progress bar component. The progress bar supports two different modes: manual and automatic.</p>
- * <p>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.</p>
- * <p>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.</p>
- * @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(
'<div class="{cls}-wrap">',
@@ -30558,11 +20387,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');
@@ -30571,8 +20400,8 @@ Ext.ProgressBar = Ext.extend(Ext.BoxComponent, {
}
this.progressBar.setHeight(inner.offsetHeight);
},
-
- // private
+
+
afterRender : function(){
Ext.ProgressBar.superclass.afterRender.call(this);
if(this.value){
@@ -30582,17 +20411,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){
@@ -30602,7 +20421,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);
}
}
@@ -30610,63 +20429,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:
- * <pre>
-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).
-</pre>
- *
- * Example usage:
- * <pre><code>
-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!');
-});
-</code></pre>
- * @param {Object} config (optional) Configuration options
- * @return {Ext.ProgressBar} this
- */
wait : function(o){
if(!this.waitTimer){
var scope = this;
@@ -30692,20 +20455,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 || '&#160;';
if(this.rendered){
@@ -30713,13 +20468,8 @@ 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);
@@ -30727,12 +20477,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){
@@ -30743,12 +20488,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){
@@ -30760,16 +20500,16 @@ 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;
}
},
-
+
onDestroy: function(){
this.clearTimer();
if(this.rendered){
@@ -30781,63 +20521,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:
- * <ul>
- * <li>linked element: the element that is passed into the constructor.
- * This is the element which defines the boundaries for interaction with
- * other DragDrop objects.</li>
- * <li>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.</li>
- * <li>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}.
- * </li>
- * </ul>
- * 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:
- * <pre>
- * dd = new Ext.dd.DragDrop("div1", "group1");
- * </pre>
- * 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...
- * <pre>
- * dd.onDragDrop = function(e, id) {
- * &nbsp;&nbsp;alert("dd was dropped on " + id);
- * }
- * </pre>
- * @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);
@@ -30846,458 +20537,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 &lt;a> elements:<pre><code>
-{
- A: "A"
-}</code></pre>
- * @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:<pre><code>
-{
- foo: true
-}</code></pre>
- * @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 */ },
- /**
- * Code that executes immediately before the onDrag event
- * @method b4Drag
- * @private
- */
+ startDrag: function(x, y) { },
+
+
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 */ },
- /**
- * 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 */ },
+ onDrag: function(e) { },
+
+
+ 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 */ },
- /**
- * Code that executes immediately before the onDragOut event
- * @method b4DragOut
- * @private
- */
+ onDragOver: function(e, id) { },
+
+
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 */ },
- /**
- * Code that executes immediately before the onDragDrop event
- * @method b4DragDrop
- * @private
- */
+ onDragOut: function(e, id) { },
+
+
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 */ },
- /**
- * 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 */ },
+ onDragDrop: function(e, id) { },
+
+
+ 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 */ },
- /**
- * Code executed immediately before the onMouseDown event
- * @method b4MouseDown
- * @param {Event} e the mousedown event
- * @private
- */
+ endDrag: function(e) { },
+
+
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 */ },
- /**
- * 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 */ },
+ onMouseDown: function(e) { },
+
+
+ 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:
- <pre><code>
- var dd = new Ext.dd.DDProxy("dragDiv1", "proxytest",
- { dragElId: "existingProxyDiv" });
- dd.startDrag = function(){
- this.constrainTo("parent-id");
- };
- </code></pre>
- * Or you can initalize it using the {@link Ext.Element} object:
- <pre><code>
- Ext.get("dragDiv1").initDDProxy("proxytest", {dragElId: "existingProxyDiv"}, {
- startDrag : function(){
- this.constrainTo("parent-id");
- }
- });
- </code></pre>
- * @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};
@@ -31306,7 +20700,7 @@ Ext.dd.DragDrop.prototype = {
var b = Ext.get(this.getEl()).getBox(),
ce = Ext.get(constrainTo),
s = ce.getScroll(),
- c,
+ c,
cd = ce.dom;
if(cd == document.body){
c = { x: s.left, y: s.top, width: Ext.lib.Dom.getViewWidth(), height: Ext.lib.Dom.getViewHeight()};
@@ -31320,21 +20714,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);
@@ -31343,69 +20733,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 = [];
@@ -31415,18 +20785,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);
@@ -31434,31 +20797,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) {
@@ -31468,12 +20816,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();
@@ -31495,13 +20838,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;
@@ -31510,23 +20847,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];
@@ -31535,27 +20862,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);
@@ -31564,12 +20876,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);
@@ -31581,10 +20888,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);
@@ -31596,24 +20900,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;
@@ -31630,7 +20922,7 @@ Ext.dd.DragDrop.prototype = {
} else {
if (this.clickValidator(e)) {
- // set the initial element position
+
this.setStartPosition();
this.b4MouseDown(e);
@@ -31638,7 +20930,16 @@ Ext.dd.DragDrop.prototype = {
this.DDM.handleMouseDown(e, this);
- this.DDM.stopEvent(e);
+ if (this.preventDefault || this.stopPropagation) {
+ if (this.preventDefault) {
+ e.preventDefault();
+ }
+ if (this.stopPropagation) {
+ e.stopPropagation();
+ }
+ } else {
+ this.DDM.stopEvent(e);
+ }
} else {
@@ -31653,24 +20954,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);
@@ -31678,31 +20968,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);
@@ -31710,12 +20988,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<len; ++i) {
if (this.invalidHandleClasses[i] == cssClass) {
@@ -31724,16 +20997,11 @@ Ext.dd.DragDrop.prototype = {
}
},
- /**
- * Checks the tag exclusion list to see if this click should be ignored
- * @method isValidHandleChild
- * @param {HTMLElement} node the HTMLElement to evaluate
- * @return {boolean} true if this is a valid tag type, false if not
- */
+
isValidHandleChild: function(node) {
var valid = true;
- // var n = (node.nodeName == "#text") ? node.parentNode : node;
+
var nodeName;
try {
nodeName = node.nodeName.toUpperCase();
@@ -31752,12 +21020,7 @@ Ext.dd.DragDrop.prototype = {
},
- /**
- * Create the array of horizontal tick marks if an interval was specified
- * in setXConstraint().
- * @method setXTicks
- * @private
- */
+
setXTicks: function(iStartX, iTickSize) {
this.xTicks = [];
this.xTickSize = iTickSize;
@@ -31781,12 +21044,7 @@ Ext.dd.DragDrop.prototype = {
this.xTicks.sort(this.DDM.numericSort) ;
},
- /**
- * Create the array of vertical tick marks if an interval was specified in
- * setYConstraint().
- * @method setYTicks
- * @private
- */
+
setYTicks: function(iStartY, iTickSize) {
this.yTicks = [];
this.yTickSize = iTickSize;
@@ -31810,18 +21068,7 @@ Ext.dd.DragDrop.prototype = {
this.yTicks.sort(this.DDM.numericSort) ;
},
- /**
- * By default, the element can be dragged any place on the screen. Use
- * this method to limit the horizontal travel of the element. Pass in
- * 0,0 for the parameters if you want to lock the drag to the y axis.
- * @method setXConstraint
- * @param {int} iLeft the number of pixels the element can move to the left
- * @param {int} iRight the number of pixels the element can move to the
- * right
- * @param {int} iTickSize optional parameter for specifying that the
- * element
- * should move iTickSize pixels at a time.
- */
+
setXConstraint: function(iLeft, iRight, iTickSize) {
this.leftConstraint = iLeft;
this.rightConstraint = iRight;
@@ -31833,21 +21080,14 @@ Ext.dd.DragDrop.prototype = {
this.constrainX = true;
},
- /**
- * Clears any constraints applied to this instance. Also clears ticks
- * since they can't exist independent of a constraint at this time.
- * @method clearConstraints
- */
+
clearConstraints: function() {
this.constrainX = false;
this.constrainY = false;
this.clearTicks();
},
- /**
- * Clears any tick interval defined for this instance
- * @method clearTicks
- */
+
clearTicks: function() {
this.xTicks = null;
this.yTicks = null;
@@ -31855,16 +21095,7 @@ Ext.dd.DragDrop.prototype = {
this.yTickSize = 0;
},
- /**
- * By default, the element can be dragged any place on the screen. Set
- * this to limit the vertical travel of the element. Pass in 0,0 for the
- * parameters if you want to lock the drag to the x axis.
- * @method setYConstraint
- * @param {int} iUp the number of pixels the element can move up
- * @param {int} iDown the number of pixels the element can move down
- * @param {int} iTickSize optional parameter for specifying that the
- * element should move iTickSize pixels at a time.
- */
+
setYConstraint: function(iUp, iDown, iTickSize) {
this.topConstraint = iUp;
this.bottomConstraint = iDown;
@@ -31877,21 +21108,17 @@ Ext.dd.DragDrop.prototype = {
},
- /**
- * resetConstraints must be called if you manually reposition a dd element.
- * @method resetConstraints
- * @param {boolean} maintainOffset
- */
+
resetConstraints: function() {
- // Maintain offsets if necessary
+
if (this.initPageX || this.initPageX === 0) {
- // figure out how much this thing has moved
+
var dx = (this.maintainOffset) ? this.lastPageX - this.initPageX : 0;
var dy = (this.maintainOffset) ? this.lastPageY - this.initPageY : 0;
this.setInitPosition(dx, dy);
- // This is the first time we have detected the element's position
+
} else {
this.setInitPosition();
}
@@ -31909,24 +21136,15 @@ Ext.dd.DragDrop.prototype = {
}
},
- /**
- * Normally the drag element is moved pixel by pixel, but we can specify
- * that it move a number of pixels at a time. This method resolves the
- * location when we have it set up like this.
- * @method getTick
- * @param {int} val where we want to place the object
- * @param {int[]} tickArray sorted array of valid points
- * @return {int} the closest tick
- * @private
- */
+
getTick: function(val, tickArray) {
if (!tickArray) {
- // If tick interval is not defined, it is effectively 1 pixel,
- // so we return the value passed to us.
+
+
return val;
} else if (tickArray[0] >= 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<len; ++i) {
@@ -31938,17 +21156,13 @@ Ext.dd.DragDrop.prototype = {
}
}
- // The value is larger than the last tick, so we return the last
- // tick.
+
+
return tickArray[tickArray.length - 1];
}
},
- /**
- * toString method
- * @method toString
- * @return {string} string representation of the dd obj
- */
+
toString: function() {
return ("DragDrop " + this.id);
}
@@ -31956,170 +21170,67 @@ 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
- * interactions between the various elements are tracked during the drag and
- * the implementing code is notified about these important moments.
- */
-// Only load the library once. Rewriting the manager class would orphan
-// existing drag and drop instances.
+
+
+
if (!Ext.dd.DragDropMgr) {
-/**
- * @class Ext.dd.DragDropMgr
- * DragDropMgr is a singleton that tracks the element interaction for
- * all DragDrop items in the window. Generally, you will not call
- * this class directly, but it does have helper methods that could
- * be useful in your DragDrop implementations.
- * @singleton
- */
+
Ext.dd.DragDropMgr = function() {
var Event = Ext.EventManager;
return {
- /**
- * Two dimensional Array of registered DragDrop objects. The first
- * dimension is the DragDrop item group, the second the DragDrop
- * object.
- * @property ids
- * @type String[]
- * @private
- * @static
- */
+
ids: {},
- /**
- * Array of element ids defined as drag handles. Used to determine
- * if the element that generated the mousedown event is actually the
- * handle and not the html element itself.
- * @property handleIds
- * @type String[]
- * @private
- * @static
- */
+
handleIds: {},
- /**
- * the DragDrop object that is currently being dragged
- * @property dragCurrent
- * @type DragDrop
- * @private
- * @static
- **/
+
dragCurrent: null,
- /**
- * the DragDrop object(s) that are being hovered over
- * @property dragOvers
- * @type Array
- * @private
- * @static
- */
+
dragOvers: {},
- /**
- * the X distance between the cursor and the object being dragged
- * @property deltaX
- * @type int
- * @private
- * @static
- */
+
deltaX: 0,
- /**
- * the Y distance between the cursor and the object being dragged
- * @property deltaY
- * @type int
- * @private
- * @static
- */
+
deltaY: 0,
- /**
- * Flag to determine if we should prevent the default behavior of the
- * events we define. By default this is true, but this can be set to
- * false if you need the default behavior (not recommended)
- * @property preventDefault
- * @type boolean
- * @static
- */
+
preventDefault: true,
- /**
- * Flag to determine if we should stop the propagation of the events
- * we generate. This is true by default but you may want to set it to
- * false if the html element contains other features that require the
- * mouse click.
- * @property stopPropagation
- * @type boolean
- * @static
- */
+
stopPropagation: true,
- /**
- * Internal flag that is set to true when drag and drop has been
- * intialized
- * @property initialized
- * @private
- * @static
- */
+
initialized: false,
- /**
- * All drag and drop can be disabled.
- * @property locked
- * @private
- * @static
- */
+
locked: false,
- /**
- * Called the first time an element is registered.
- * @method init
- * @private
- * @static
- */
+
init: function() {
this.initialized = true;
},
- /**
- * In point mode, drag and drop interaction is defined by the
- * location of the cursor during the drag/drop
- * @property POINT
- * @type int
- * @static
- */
+
POINT: 0,
- /**
- * In intersect mode, drag and drop interaction is defined by the
- * overlap of two or more drag and drop objects.
- * @property INTERSECT
- * @type int
- * @static
- */
+
INTERSECT: 1,
- /**
- * The current drag and drop mode. Default: POINT
- * @property mode
- * @type int
- * @static
- */
+
mode: 0,
- /**
- * Runs method on all drag and drop objects
- * @method _execOnAll
- * @private
- * @static
- */
+
+ notifyOccluded: false,
+
+
_execOnAll: function(sMethod, args) {
for (var i in this.ids) {
for (var j in this.ids[i]) {
@@ -32132,12 +21243,7 @@ Ext.dd.DragDropMgr = function() {
}
},
- /**
- * Drag and drop initialization. Sets up the global event handlers
- * @method _onLoad
- * @private
- * @static
- */
+
_onLoad: function() {
this.init();
@@ -32147,125 +21253,49 @@ Ext.dd.DragDropMgr = function() {
Event.on(document, "mousemove", this.handleMouseMove, this, true);
Event.on(window, "unload", this._onUnload, this, true);
Event.on(window, "resize", this._onResize, this, true);
- // Event.on(window, "mouseout", this._test);
+
},
- /**
- * Reset constraints on all drag and drop objs
- * @method _onResize
- * @private
- * @static
- */
+
_onResize: function(e) {
this._execOnAll("resetConstraints", []);
},
- /**
- * Lock all drag and drop functionality
- * @method lock
- * @static
- */
+
lock: function() { this.locked = true; },
- /**
- * Unlock all drag and drop functionality
- * @method unlock
- * @static
- */
+
unlock: function() { this.locked = false; },
- /**
- * Is drag and drop locked?
- * @method isLocked
- * @return {boolean} True if drag and drop is locked, false otherwise.
- * @static
- */
+
isLocked: function() { return this.locked; },
- /**
- * Location cache that is set for all drag drop objects when a drag is
- * initiated, cleared when the drag is finished.
- * @property locationCache
- * @private
- * @static
- */
+
locationCache: {},
- /**
- * Set useCache to false if you want to force object the lookup of each
- * drag and drop linked element constantly during a drag.
- * @property useCache
- * @type boolean
- * @static
- */
+
useCache: true,
- /**
- * The number of pixels that the mouse needs to move after the
- * mousedown before the drag is initiated. Default=3;
- * @property clickPixelThresh
- * @type int
- * @static
- */
+
clickPixelThresh: 3,
- /**
- * The number of milliseconds after the mousedown event to initiate the
- * drag if we don't get a mouseup event. Default=350
- * @property clickTimeThresh
- * @type int
- * @static
- */
+
clickTimeThresh: 350,
- /**
- * Flag that indicates that either the drag pixel threshold or the
- * mousdown time threshold has been met
- * @property dragThreshMet
- * @type boolean
- * @private
- * @static
- */
+
dragThreshMet: false,
- /**
- * Timeout used for the click time threshold
- * @property clickTimeout
- * @type Object
- * @private
- * @static
- */
+
clickTimeout: null,
- /**
- * The X position of the mousedown event stored for later use when a
- * drag threshold is met.
- * @property startX
- * @type int
- * @private
- * @static
- */
+
startX: 0,
- /**
- * The Y position of the mousedown event stored for later use when a
- * drag threshold is met.
- * @property startY
- * @type int
- * @private
- * @static
- */
+
startY: 0,
- /**
- * Each DragDrop instance must be registered with the DragDropMgr.
- * This is executed in DragDrop.init()
- * @method regDragDrop
- * @param {DragDrop} oDD the DragDrop object to register
- * @param {String} sGroup the name of the group this element belongs to
- * @static
- */
+
regDragDrop: function(oDD, sGroup) {
if (!this.initialized) { this.init(); }
@@ -32275,13 +21305,7 @@ Ext.dd.DragDropMgr = function() {
this.ids[sGroup][oDD.id] = oDD;
},
- /**
- * Removes the supplied dd instance from the supplied group. Executed
- * by DragDrop.removeFromGroup, so don't call this function directly.
- * @method removeDDFromGroup
- * @private
- * @static
- */
+
removeDDFromGroup: function(oDD, sGroup) {
if (!this.ids[sGroup]) {
this.ids[sGroup] = {};
@@ -32293,13 +21317,7 @@ Ext.dd.DragDropMgr = function() {
}
},
- /**
- * Unregisters a drag and drop item. This is executed in
- * DragDrop.unreg, use that method instead of calling this directly.
- * @method _remove
- * @private
- * @static
- */
+
_remove: function(oDD) {
for (var g in oDD.groups) {
if (g && this.ids[g] && this.ids[g][oDD.id]) {
@@ -32309,15 +21327,7 @@ Ext.dd.DragDropMgr = function() {
delete this.handleIds[oDD.id];
},
- /**
- * Each DragDrop handle element must be registered. This is done
- * automatically when executing DragDrop.setHandleElId()
- * @method regHandle
- * @param {String} sDDId the DragDrop id this element is a handle for
- * @param {String} sHandleId the id of the element that is the drag
- * handle
- * @static
- */
+
regHandle: function(sDDId, sHandleId) {
if (!this.handleIds[sDDId]) {
this.handleIds[sDDId] = {};
@@ -32325,28 +21335,12 @@ Ext.dd.DragDropMgr = function() {
this.handleIds[sDDId][sHandleId] = sHandleId;
},
- /**
- * Utility function to determine if a given element has been
- * registered as a drag drop item.
- * @method isDragDrop
- * @param {String} id the element id to check
- * @return {boolean} true if this element is a DragDrop item,
- * false otherwise
- * @static
- */
+
isDragDrop: function(id) {
return ( this.getDDById(id) ) ? true : false;
},
- /**
- * Returns the drag and drop instances that are in all groups the
- * passed in instance belongs to.
- * @method getRelated
- * @param {DragDrop} p_oDD the obj to get related data for
- * @param {boolean} bTargetsOnly if true, only return targetable objs
- * @return {DragDrop[]} the related instances
- * @static
- */
+
getRelated: function(p_oDD, bTargetsOnly) {
var oDDs = [];
for (var i in p_oDD.groups) {
@@ -32364,16 +21358,7 @@ Ext.dd.DragDropMgr = function() {
return oDDs;
},
- /**
- * Returns true if the specified dd target is a legal target for
- * the specifice drag obj
- * @method isLegalTarget
- * @param {DragDrop} oDD the drag obj
- * @param {DragDrop} oTargetDD the target
- * @return {boolean} true if the target is a legal target for the
- * dd obj
- * @static
- */
+
isLegalTarget: function (oDD, oTargetDD) {
var targets = this.getRelated(oDD, true);
for (var i=0, len=targets.length;i<len;++i) {
@@ -32385,42 +21370,18 @@ Ext.dd.DragDropMgr = function() {
return false;
},
- /**
- * My goal is to be able to transparently determine if an object is
- * typeof DragDrop, and the exact subclass of DragDrop. typeof
- * returns "object", oDD.constructor.toString() always returns
- * "DragDrop" and not the name of the subclass. So for now it just
- * evaluates a well-known variable in DragDrop.
- * @method isTypeOfDD
- * @param {Object} the object to evaluate
- * @return {boolean} true if typeof oDD = DragDrop
- * @static
- */
+
isTypeOfDD: function (oDD) {
return (oDD && oDD.__ygDragDrop);
},
- /**
- * Utility function to determine if a given element has been
- * registered as a drag drop handle for the given Drag Drop object.
- * @method isHandle
- * @param {String} id the element id to check
- * @return {boolean} true if this element is a DragDrop handle, false
- * otherwise
- * @static
- */
+
isHandle: function(sDDId, sHandleId) {
return ( this.handleIds[sDDId] &&
this.handleIds[sDDId][sHandleId] );
},
- /**
- * Returns the DragDrop instance for a given id
- * @method getDDById
- * @param {String} id the id of the DragDrop object
- * @return {DragDrop} the drag drop object, null if it is not found
- * @static
- */
+
getDDById: function(id) {
for (var i in this.ids) {
if (this.ids[i][id]) {
@@ -32430,31 +21391,23 @@ Ext.dd.DragDropMgr = function() {
return null;
},
- /**
- * Fired after a registered DragDrop object gets the mousedown event.
- * Sets up the events required to track the object being dragged
- * @method handleMouseDown
- * @param {Event} e the event
- * @param oDD the DragDrop object being dragged
- * @private
- * @static
- */
+
handleMouseDown: function(e, oDD) {
if(Ext.QuickTips){
Ext.QuickTips.ddDisable();
}
if(this.dragCurrent){
- // the original browser mouseup wasn't handled (e.g. outside FF browser window)
- // so clean up first to avoid breaking the next drag
+
+
this.handleMouseUp(e);
}
-
+
this.currentTarget = e.getTarget();
this.dragCurrent = oDD;
var el = oDD.getEl();
- // track start position
+
this.startX = e.getPageX();
this.startY = e.getPageY();
@@ -32471,14 +21424,7 @@ Ext.dd.DragDropMgr = function() {
this.clickTimeThresh );
},
- /**
- * Fired when either the drag pixel threshol or the mousedown hold
- * time threshold has been met.
- * @method startDrag
- * @param x {int} the X position of the original mousedown
- * @param y {int} the Y position of the original mousedown
- * @static
- */
+
startDrag: function(x, y) {
clearTimeout(this.clickTimeout);
if (this.dragCurrent) {
@@ -32488,14 +21434,7 @@ Ext.dd.DragDropMgr = function() {
this.dragThreshMet = true;
},
- /**
- * Internal function to handle the mouseup event. Will be invoked
- * from the context of the document.
- * @method handleMouseUp
- * @param {Event} e the event
- * @private
- * @static
- */
+
handleMouseUp: function(e) {
if(Ext.QuickTips){
@@ -32517,13 +21456,7 @@ Ext.dd.DragDropMgr = function() {
this.stopEvent(e);
},
- /**
- * Utility to stop event propagation and event default, if these
- * features are turned on.
- * @method stopEvent
- * @param {Event} e the event as returned by this.getEvent()
- * @static
- */
+
stopEvent: function(e){
if(this.stopPropagation) {
e.stopPropagation();
@@ -32534,16 +21467,9 @@ Ext.dd.DragDropMgr = function() {
}
},
- /**
- * Internal function to clean up event handlers after the drag
- * operation is complete
- * @method stopDrag
- * @param {Event} e the event
- * @private
- * @static
- */
+
stopDrag: function(e) {
- // Fire the drag end event for the item that was dragged
+
if (this.dragCurrent) {
if (this.dragThreshMet) {
this.dragCurrent.b4EndDrag(e);
@@ -32557,27 +21483,14 @@ Ext.dd.DragDropMgr = function() {
this.dragOvers = {};
},
- /**
- * Internal function to handle the mousemove event. Will be invoked
- * from the context of the html element.
- *
- * @TODO figure out what we can do about mouse events lost when the
- * user drags objects beyond the window boundary. Currently we can
- * detect this in internet explorer by verifying that the mouse is
- * down during the mousemove event. Firefox doesn't give us the
- * button state on the mousemove event.
- * @method handleMouseMove
- * @param {Event} e the event
- * @private
- * @static
- */
+
handleMouseMove: function(e) {
if (! this.dragCurrent) {
return true;
}
- // var button = e.which || e.button;
- // check for IE mouseup outside of page boundary
+
+
if (Ext.isIE && (e.button !== 0 && e.button !== 1 && e.button !== 2)) {
this.stopEvent(e);
return this.handleMouseUp(e);
@@ -32605,177 +21518,212 @@ Ext.dd.DragDropMgr = function() {
return true;
},
- /**
- * Iterates over all of the DragDrop elements to find ones we are
- * hovering over or dropping on
- * @method fireEvents
- * @param {Event} e the event
- * @param {boolean} isDrop is this a drop op or a mouseover op?
- * @private
- * @static
- */
+
fireEvents: function(e, isDrop) {
- var dc = this.dragCurrent;
+ var me = this,
+ dragCurrent = me.dragCurrent,
+ mousePoint = e.getPoint(),
+ overTarget,
+ overTargetEl,
+ allTargets = [],
+ oldOvers = [],
+ outEvts = [],
+ overEvts = [],
+ dropEvts = [],
+ enterEvts = [],
+ needsSort,
+ i,
+ len,
+ sGroup;
- // If the user did the mouse up outside of the window, we could
- // get here even though we have ended the drag.
- if (!dc || dc.isLocked()) {
- return;
- }
- var pt = e.getPoint();
- // cache the previous dragOver array
- var oldOvers = [];
+ if (!dragCurrent || dragCurrent.isLocked()) {
+ return;
+ }
- var outEvts = [];
- var overEvts = [];
- var dropEvts = [];
- var enterEvts = [];
- // Check to see if the object(s) we were hovering over is no longer
- // being hovered over so we can fire the onDragOut event
- for (var i in this.dragOvers) {
- var ddo = this.dragOvers[i];
+ for (i in me.dragOvers) {
+ overTarget = me.dragOvers[i];
- if (! this.isTypeOfDD(ddo)) {
+ if (! me.isTypeOfDD(overTarget)) {
continue;
}
- if (! this.isOverTarget(pt, ddo, this.mode)) {
- outEvts.push( ddo );
+ if (! this.isOverTarget(mousePoint, overTarget, me.mode)) {
+ outEvts.push( overTarget );
}
oldOvers[i] = true;
- delete this.dragOvers[i];
+ delete me.dragOvers[i];
}
- for (var sGroup in dc.groups) {
+
+
+
+ for (sGroup in dragCurrent.groups) {
if ("string" != typeof sGroup) {
continue;
}
- for (i in this.ids[sGroup]) {
- var oDD = this.ids[sGroup][i];
- if (! this.isTypeOfDD(oDD)) {
- continue;
+
+ for (i in me.ids[sGroup]) {
+ overTarget = me.ids[sGroup][i];
+
+
+
+
+
+
+ if (me.isTypeOfDD(overTarget) &&
+ (overTargetEl = overTarget.getEl()) &&
+ (overTarget.isTarget) &&
+ (!overTarget.isLocked()) &&
+ ((overTarget != dragCurrent) || (dragCurrent.ignoreSelf === false))) {
+
+
+ if ((overTarget.zIndex = me.getZIndex(overTargetEl)) !== -1) {
+ needsSort = true;
+ }
+ allTargets.push(overTarget);
}
+ }
+ }
- if (oDD.isTarget && !oDD.isLocked() && ((oDD != dc) || (dc.ignoreSelf === false))) {
- if (this.isOverTarget(pt, oDD, this.mode)) {
- // look for drop interactions
- if (isDrop) {
- dropEvts.push( oDD );
- // look for drag enter and drag over interactions
- } else {
-
- // initial drag over: dragEnter fires
- if (!oldOvers[oDD.id]) {
- enterEvts.push( oDD );
- // subsequent drag overs: dragOver fires
- } else {
- overEvts.push( oDD );
- }
- this.dragOvers[oDD.id] = oDD;
- }
+ if (needsSort) {
+ allTargets.sort(me.byZIndex);
+ }
+
+
+
+ for (i = 0, len = allTargets.length; i < len; i++) {
+ overTarget = allTargets[i];
+
+
+ if (me.isOverTarget(mousePoint, overTarget, me.mode)) {
+
+ if (isDrop) {
+ dropEvts.push( overTarget );
+
+ } else {
+
+ if (!oldOvers[overTarget.id]) {
+ enterEvts.push( overTarget );
+
+ } else {
+ overEvts.push( overTarget );
}
+ me.dragOvers[overTarget.id] = overTarget;
+ }
+
+
+ if (!me.notifyOccluded) {
+ break;
}
}
}
- if (this.mode) {
+ if (me.mode) {
if (outEvts.length) {
- dc.b4DragOut(e, outEvts);
- dc.onDragOut(e, outEvts);
+ dragCurrent.b4DragOut(e, outEvts);
+ dragCurrent.onDragOut(e, outEvts);
}
if (enterEvts.length) {
- dc.onDragEnter(e, enterEvts);
+ dragCurrent.onDragEnter(e, enterEvts);
}
if (overEvts.length) {
- dc.b4DragOver(e, overEvts);
- dc.onDragOver(e, overEvts);
+ dragCurrent.b4DragOver(e, overEvts);
+ dragCurrent.onDragOver(e, overEvts);
}
if (dropEvts.length) {
- dc.b4DragDrop(e, dropEvts);
- dc.onDragDrop(e, dropEvts);
+ dragCurrent.b4DragDrop(e, dropEvts);
+ dragCurrent.onDragDrop(e, dropEvts);
}
} else {
- // fire dragout events
- var len = 0;
+
for (i=0, len=outEvts.length; i<len; ++i) {
- dc.b4DragOut(e, outEvts[i].id);
- dc.onDragOut(e, outEvts[i].id);
+ dragCurrent.b4DragOut(e, outEvts[i].id);
+ dragCurrent.onDragOut(e, outEvts[i].id);
}
- // fire enter events
+
for (i=0,len=enterEvts.length; i<len; ++i) {
- // dc.b4DragEnter(e, oDD.id);
- dc.onDragEnter(e, enterEvts[i].id);
+
+ dragCurrent.onDragEnter(e, enterEvts[i].id);
}
- // fire over events
+
for (i=0,len=overEvts.length; i<len; ++i) {
- dc.b4DragOver(e, overEvts[i].id);
- dc.onDragOver(e, overEvts[i].id);
+ dragCurrent.b4DragOver(e, overEvts[i].id);
+ dragCurrent.onDragOver(e, overEvts[i].id);
}
- // fire drop events
+
for (i=0, len=dropEvts.length; i<len; ++i) {
- dc.b4DragDrop(e, dropEvts[i].id);
- dc.onDragDrop(e, dropEvts[i].id);
+ dragCurrent.b4DragDrop(e, dropEvts[i].id);
+ dragCurrent.onDragDrop(e, dropEvts[i].id);
}
}
- // notify about a drop that did not find a target
+
if (isDrop && !dropEvts.length) {
- dc.onInvalidDrop(e);
+ dragCurrent.onInvalidDrop(e);
}
+ },
+
+ getZIndex: function(element) {
+ var body = document.body,
+ z,
+ zIndex = -1;
+
+ element = Ext.getDom(element);
+ while (element !== body) {
+ if (!isNaN(z = Number(Ext.fly(element).getStyle('zIndex')))) {
+ zIndex = z;
+ }
+ element = element.parentNode;
+ }
+ return zIndex;
},
- /**
- * Helper function for getting the best match from the list of drag
- * and drop objects returned by the drag and drop events when we are
- * in INTERSECT mode. It returns either the first object that the
- * cursor is over, or the object that has the greatest overlap with
- * the dragged element.
- * @method getBestMatch
- * @param {DragDrop[]} dds The array of drag and drop objects
- * targeted
- * @return {DragDrop} The best single match
- * @static
- */
+
+ byZIndex: function(d1, d2) {
+ return d1.zIndex < d2.zIndex;
+ },
+
+
getBestMatch: function(dds) {
var winner = null;
- // Return null if the input is not what we expect
- //if (!dds || !dds.length || dds.length == 0) {
- // winner = null;
- // If there is only one item, it wins
- //} else if (dds.length == 1) {
+
+
+
+
+
var len = dds.length;
if (len == 1) {
winner = dds[0];
} else {
- // Loop through the targeted items
+
for (var i=0; i<len; ++i) {
var dd = dds[i];
- // If the cursor is over the object, it wins. If the
- // cursor is over multiple matches, the first one we come
- // to wins.
+
+
+
if (dd.cursorIsOver) {
winner = dd;
break;
- // Otherwise the object with the most overlap wins
+
} else {
if (!winner ||
winner.overlap.getArea() < dd.overlap.getArea()) {
@@ -32788,24 +21736,7 @@ Ext.dd.DragDropMgr = function() {
return winner;
},
- /**
- * Refreshes the cache of the top-left and bottom-right points of the
- * drag and drop objects in the specified group(s). This is in the
- * format that is stored in the drag and drop instance, so typical
- * usage is:
- * <code>
- * Ext.dd.DragDropMgr.refreshCache(ddinstance.groups);
- * </code>
- * Alternatively:
- * <code>
- * Ext.dd.DragDropMgr.refreshCache({group1:true, group2:true});
- * </code>
- * @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) {
@@ -32815,31 +21746,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;
@@ -32858,17 +21780,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;
@@ -32894,35 +21806,12 @@ Ext.dd.DragDropMgr = function() {
b = y2 + oDD.padding[2];
l = x1 - oDD.padding[3];
- region = new Ext.lib.Region( t, r, b, l );
- /*
- * The code below is to ensure that large scrolling elements will
- * only have their visible area recognized as a drop target, otherwise it
- * can potentially erronously register as a target when the element scrolls
- * over the top of something below it.
- */
- el = Ext.get(el.parentNode);
- while (el && region) {
- if (el.isScrollable()) {
- // check whether our element is visible in the view port:
- region = region.intersect(el.getRegion());
- }
- el = el.parent();
- }
- return region;
+ 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);
@@ -32936,11 +21825,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)) {
@@ -32949,10 +21838,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();
@@ -32971,12 +21860,7 @@ Ext.dd.DragDropMgr = function() {
}
},
- /**
- * unload event handler
- * @method _onUnload
- * @private
- * @static
- */
+
_onUnload: function(e, me) {
Event.removeListener(document, "mouseup", this.handleMouseUp, this);
Event.removeListener(document, "mousemove", this.handleMouseMove, this);
@@ -32984,12 +21868,7 @@ Ext.dd.DragDropMgr = function() {
Ext.dd.DragDropMgr.unregAll();
},
- /**
- * Cleans up the drag and drop events and objects.
- * @method unregAll
- * @private
- * @static
- */
+
unregAll: function() {
if (this.dragCurrent) {
@@ -33007,23 +21886,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) {
@@ -33033,90 +21899,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);
@@ -33135,12 +21949,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)) {
@@ -33155,76 +21964,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 ) {
@@ -33240,19 +22009,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) {
@@ -33271,24 +22033,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);
@@ -33297,68 +22048,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');
@@ -33377,16 +22092,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;
@@ -33398,90 +22104,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;
@@ -33503,30 +22192,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());
@@ -33536,53 +22215,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);
@@ -33590,39 +22229,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;
@@ -33645,18 +22263,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();
},
@@ -33669,14 +22283,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();
@@ -33694,12 +22301,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();
@@ -33707,7 +22309,7 @@ Ext.extend(Ext.dd.DDProxy, Ext.dd.DD, {
}
},
- // overrides Ext.dd.DragDrop
+
b4MouseDown: function(e) {
var x = e.getPageX();
var y = e.getPageY();
@@ -33715,31 +22317,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";
@@ -33761,266 +22363,101 @@ 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.MultiSlider}, 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.MultiSlider}'s initEvents function for an example implementation.
- */
+});
Ext.dd.DragTracker = Ext.extend(Ext.util.Observable, {
- /**
- * @cfg {Boolean} active
- * Defaults to <tt>false</tt>.
- */
+
active: false,
- /**
- * @cfg {Number} tolerance
- * Number of pixels the drag target must be moved before dragging is considered to have started. Defaults to <tt>5</tt>.
- */
+
tolerance: 5,
- /**
- * @cfg {Boolean/Number} autoStart
- * Defaults to <tt>false</tt>. Specify <tt>true</tt> 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} e event object
- */
+
'dragstart',
- /**
- * @event dragend
- * @param {Object} this
- * @param {Object} e event object
- */
+
'dragend',
- /**
- * @event drag
- * @param {Object} this
- * @param {Object} e event object
- */
+
'drag'
);
-
+
this.dragRegion = new Ext.lib.Region(0,0,0,0);
-
+
if(this.el){
this.initEl(this.el);
}
@@ -34058,8 +22495,9 @@ 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){
+
+ var ieCheck = Ext.isIE6 || Ext.isIE7 || Ext.isIE8;
+ if(this.active && ieCheck && !e.browserEvent.button){
e.preventDefault();
this.onMouseUp(e);
return;
@@ -34117,45 +22555,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 {Ext.EventObject} e The event object
- */
+
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;
},
@@ -34194,43 +22614,24 @@ Ext.dd.DragTracker = Ext.extend(Ext.util.Observable, {
return [dr.left, dr.top];
}
}
-});/**
- * @class Ext.dd.ScrollManager
- * <p>Provides automatic scrolling of overflow regions in the page during drag operations.</p>
- * <p>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
- * <tt>ddScrollConfig</tt> object to the target element that contains these properties: {@link #hthresh},
- * {@link #vthresh}, {@link #increment} and {@link #frequency}. Example usage:
- * <pre><code>
-var el = Ext.get('scroll-ct');
-el.ddScrollConfig = {
- vthresh: 50,
- hthresh: -1,
- frequency: 100,
- increment: 200
-};
-Ext.dd.ScrollManager.register(el);
-</code></pre>
- * <b>Note: This class uses "Point Mode" and is untested in "Intersect Mode".</b>
- * @singleton
- */
+});
Ext.dd.ScrollManager = function(){
var ddm = Ext.dd.DragDropMgr;
var els = {};
var dragEl = null;
var proc = {};
-
+
var onStop = function(e){
dragEl = null;
clearProc();
};
-
+
var triggerRefresh = function(){
if(ddm.dragCurrent){
ddm.refreshCache(ddm.dragCurrent.groups);
}
};
-
+
var doScroll = function(){
if(ddm.dragCurrent){
var dds = Ext.dd.ScrollManager;
@@ -34245,7 +22646,7 @@ Ext.dd.ScrollManager = function(){
}
}
};
-
+
var clearProc = function(){
if(proc.id){
clearInterval(proc.id);
@@ -34268,16 +22669,16 @@ Ext.dd.ScrollManager = function(){
proc.id = setInterval(doScroll, freq);
}
};
-
+
var onFire = function(e, isDrop){
if(isDrop || !ddm.dragCurrent){ return; }
var dds = Ext.dd.ScrollManager;
if(!dragEl || dragEl != ddm.dragCurrent){
dragEl = ddm.dragCurrent;
- // refresh regions on drag start
+
dds.refreshCache();
}
-
+
var xy = Ext.lib.Event.getXY(e);
var pt = new Ext.lib.Point(xy[0], xy[1]);
for(var id in els){
@@ -34309,15 +22710,12 @@ Ext.dd.ScrollManager = function(){
}
clearProc();
};
-
+
ddm.fireEvents = ddm.fireEvents.createSequence(onFire, ddm);
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++) {
@@ -34328,11 +22726,8 @@ Ext.dd.ScrollManager = function(){
els[el.id] = el;
}
},
-
- /**
- * 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++) {
@@ -34343,72 +22738,40 @@ Ext.dd.ScrollManager = function(){
delete els[el.id];
}
},
-
- /**
- * 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 100)
- * @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,
-
- /**
- * The named drag drop {@link Ext.dd.DragSource#ddGroup group} to which this container belongs (defaults to undefined).
- * If a ddGroup is specified, then container scrolling will only occur when a dragged object is in the same ddGroup.
- * @type String
- */
+
+
ddGroup: undefined,
- /**
- * 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 = {};
+ var elements = {};
+ var handles = {};
var autoIdSeed = 0;
var getId = function(el, autogen){
@@ -34422,24 +22785,9 @@ Ext.dd.Registry = function(){
}
return id;
};
-
+
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):
- * <pre>
-Value Description<br />
---------- ------------------------------------------<br />
-handles Array of DOM nodes that trigger dragging<br />
- for the element being registered<br />
-isHandle True if the element passed in triggers<br />
- dragging itself, else false
-</pre>
- */
+
register : function(el, data){
data = data || {};
if(typeof el == "string"){
@@ -34458,10 +22806,7 @@ isHandle True if the element passed in triggers<br />
}
},
- /**
- * 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];
@@ -34476,57 +22821,35 @@ isHandle True if the element passed in triggers<br />
}
},
- /**
- * 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();
@@ -34536,7 +22859,7 @@ Ext.dd.StatusProxy = function(config){
{tag: "div", cls: "x-dd-drop-icon"},
{tag: "div", cls: "x-dd-drag-ghost"}
]
- },
+ },
shadow: !config || config.shadow !== false
});
this.ghost = Ext.get(this.el.dom.childNodes[1]);
@@ -34544,22 +22867,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){
@@ -34568,10 +22881,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;
@@ -34580,11 +22890,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);
@@ -34593,32 +22899,23 @@ Ext.dd.StatusProxy.prototype = {
html.style.margin = "0";
this.ghost.dom.appendChild(html);
}
- var el = this.ghost.dom.firstChild;
+ var el = this.ghost.dom.firstChild;
if(el){
Ext.fly(el).setStyle('float', 'none');
}
},
- /**
- * 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){
@@ -34626,36 +22923,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 (<code>this</code> reference) in which the callback function is executed. Defaults to the browser window.
- */
+
repair : function(xy, callback, scope){
this.callback = callback;
this.scope = scope;
@@ -34675,7 +22960,7 @@ Ext.dd.StatusProxy.prototype = {
}
},
- // private
+
afterRepair : function(){
this.hide(true);
if(typeof this.callback == "function"){
@@ -34684,61 +22969,41 @@ Ext.dd.StatusProxy.prototype = {
this.callback = null;
this.scope = null;
},
-
+
destroy: function(){
- Ext.destroy(this.ghost, this.el);
+ 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){
this.dragData = {};
}
-
+
Ext.apply(this, config);
-
+
if(!this.proxy){
this.proxy = new Ext.dd.StatusProxy();
}
- Ext.dd.DragSource.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group,
+ Ext.dd.DragSource.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group,
{dragElId : this.proxy.id, resizeFrame: false, isTarget: false, scroll: this.scroll === true});
-
+
this.dragging = false;
};
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;
@@ -34749,40 +23014,26 @@ Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, {
}else{
this.proxy.setStatus(this.dropAllowed);
}
-
+
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){
@@ -34792,32 +23043,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){
@@ -34826,38 +23063,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);
@@ -34865,56 +23088,35 @@ Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, {
}else{
this.onValidDrop(target, e, id);
}
-
+
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();
+ return this.el.getXY();
},
- // private
+
onInvalidDrop : function(target, e, id){
this.beforeInvalidDrop(target, e, id);
if(this.cachedTarget){
@@ -34926,18 +23128,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");
@@ -34945,19 +23141,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;
@@ -34967,29 +23156,18 @@ Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, {
this.dragData = data;
this.proxy.stop();
Ext.dd.DragSource.superclass.handleMouseDown.apply(this, arguments);
- }
+ }
},
- /**
- * 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;
@@ -34998,73 +23176,60 @@ 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;
+ return this.proxy;
},
- /**
- * Hides the drag source's {@link Ext.dd.StatusProxy}
- */
+
hideProxy : function(){
- this.proxy.hide();
+ 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);
},
-
+
destroy: function(){
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 = Ext.extend(Ext.dd.DDTarget, {
-
+
constructor : function(el, config){
this.el = Ext.get(el);
-
+
Ext.apply(this, config);
if(this.containerScroll){
@@ -35074,43 +23239,21 @@ Ext.dd.DropTarget = Ext.extend(Ext.dd.DDTarget, {
Ext.dd.DropTarget.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group,
{isTarget: true});
},
-
- /**
- * @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);
@@ -35118,44 +23261,19 @@ Ext.dd.DropTarget = Ext.extend(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;
},
@@ -35166,64 +23284,7 @@ Ext.dd.DropTarget = Ext.extend(Ext.dd.DDTarget, {
Ext.dd.ScrollManager.unregister(this.el);
}
}
-});/**
- * @class Ext.dd.DragZone
- * @extends Ext.dd.DragSource
- * <p>This class provides a container DD instance that allows dragging of multiple child source nodes.</p>
- * <p>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}</p>
- * <p>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.</p>
- * <p>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:</p><pre><code>
-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;
- }
- });
-});</code></pre>
- * 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 = Ext.extend(Ext.dd.DragSource, {
constructor : function(el, config){
@@ -35233,50 +23294,23 @@ Ext.dd.DragZone = Ext.extend(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 <tt>ddel</tt> 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");
@@ -35284,14 +23318,9 @@ Ext.dd.DragZone = Ext.extend(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();
+ return Ext.Element.fly(this.dragData.ddel).getXY();
},
destroy : function(){
@@ -35300,205 +23329,56 @@ Ext.dd.DragZone = Ext.extend(Ext.dd.DragSource, {
Ext.dd.ScrollManager.unregister(this.el);
}
}
-});/**
- * @class Ext.dd.DropZone
- * @extends Ext.dd.DropTarget
- * <p>This class provides a container DD instance that allows dropping on multiple child target nodes.</p>
- * <p>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.</p>
- * <p>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.</p>
- * <p>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:</p><pre><code>
-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;
- }
- });
-}
-</code></pre>
- * 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;
@@ -35515,14 +23395,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);
@@ -35530,16 +23403,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);
@@ -35551,81 +23415,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 <code>for (var verb in this.actions)</code>
- // 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:
- * <pre><code>
-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.
-}
- * </code></pre>
- * @property actions
- * @type Object
- */
+
actions : {
create : 'create',
read : 'read',
@@ -35633,19 +23457,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:
- * <pre><code>
-restActions : {
- create : 'POST',
- read : 'GET',
- update : 'PUT',
- destroy : 'DELETE'
-},
- * </code></pre>
- */
+
restActions : {
create : 'POST',
read : 'GET',
@@ -35653,27 +23465,15 @@ restActions : {
destroy : 'DELETE'
},
- /**
- * Returns true if supplied action-name is a valid API action defined in <code>{@link #actions}</code> 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) {
@@ -35684,14 +23484,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);
@@ -35700,14 +23496,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;
@@ -35719,39 +23508,10 @@ restActions : {
return unique;
},
- /**
- * This method is used internally by <tt>{@link Ext.data.DataProxy DataProxy}</tt> 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.
- <pre><code>
-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'
- }
-});
- </code></pre>
- *
- * @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];
@@ -35765,19 +23525,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({
@@ -35786,18 +23542,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;
@@ -35812,16 +23568,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
@@ -35851,11 +23604,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;
@@ -35874,60 +23623,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;
@@ -35937,100 +23658,26 @@ 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
- * <p>Instances of this class encapsulate both Record <em>definition</em> information, and Record
- * <em>value</em> 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.</p>
- * <p>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.</p>
- * <p>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.</p>
- * <p>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
- * <code>{@link #data}</code> and <code>{@link #id}</code> properties.</p>
- * <p>Record objects generated by this constructor inherit all the methods of Ext.data.Record listed below.</p>
- * @constructor
- * <p>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.<p>
- * <p><b>The generated constructor has the same signature as this constructor.</b></p>
- * @param {Object} data (Optional) An object, the properties of which provide values for the new Record's
- * fields. If not specified the <code>{@link Ext.data.Field#defaultValue defaultValue}</code>
- * 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
- * <code>id</code> is not specified a <b><code>{@link #phantom}</code></b>
- * 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 <b>{@link Ext.data.Field Field}</b> 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}
- * <b><tt>{@link Ext.data.Field#name}s</tt></b>. Example usage:<pre><code>
-// 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 <tt>name</tt> 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);
-</code></pre>
- * @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;
@@ -36053,127 +23700,39 @@ 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:
- * <tt>&#123;PREFIX}-&#123;AUTO_ID}</tt>.<div class="mdetail-params"><ul>
- * <li><b><tt>PREFIX</tt></b> : String<p class="sub-desc"><tt>Ext.data.Record.PREFIX</tt>
- * (defaults to <tt>'ext-record'</tt>)</p></li>
- * <li><b><tt>AUTO_ID</tt></b> : String<p class="sub-desc"><tt>Ext.data.Record.AUTO_ID</tt>
- * (defaults to <tt>1</tt> initially)</p></li>
- * </ul></div>
- * @param {Record} rec The record being created. The record does not exist, it's a {@link #phantom}.
- * @return {String} auto-generated string id, <tt>"ext-record-i++'</tt>;
- */
+
Ext.data.Record.id = function(rec) {
rec.phantom = true;
return [Ext.data.Record.PREFIX, '-', Ext.data.Record.AUTO_ID++].join('');
};
Ext.data.Record.prototype = {
- /**
- * <p><b>This property is stored in the Record definition's <u>prototype</u></b></p>
- * 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 <b>not</b> contain
- * an <tt>id</tt> property.
- * @property data
- * @type {Object}
- */
- /**
- * The unique ID of the Record {@link #Record as specified at construction time}.
- * @property id
- * @type {Object}
- */
- /**
- * <p><b>Only present if this Record was created by an {@link Ext.data.XmlReader XmlReader}</b>.</p>
- * <p>The XML element which was the source of the data for this Record.</p>
- * @property node
- * @type {XMLElement}
- */
- /**
- * <p><b>Only present if this Record was created by an {@link Ext.data.ArrayReader ArrayReader} or a {@link Ext.data.JsonReader JsonReader}</b>.</p>
- * <p>The Array or object which was the source of the data for this Record.</p>
- * @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,
- /**
- * <tt>true</tt> 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:
- * <pre><code>
-// 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
- * </code></pre>
- * <b>Notes</b>:<div class="mdetail-params"><ul>
- * <li>If the store has a writer and <code>autoSave=true</code>, each set()
- * will execute an XHR to the server.</li>
- * <li>Use <code>{@link #beginEdit}</code> to prevent the store's <code>update</code>
- * event firing while using set().</li>
- * <li>Use <code>{@link #endEdit}</code> to have the store's <code>update</code>
- * event fire.</li>
- * </ul></div>
- * @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)) {
return;
- }
+ }
this.dirty = true;
if(!this.modified){
this.modified = {};
@@ -36187,58 +23746,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 <code>update</code> event)
- * are relayed to the containing store.
- * See also: <code>{@link #endEdit}</code> and <code>{@link #cancelEdit}</code>.
- */
+
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 <code>update</code> event will fire).
- */
+
endEdit : function(){
this.editing = false;
if(this.dirty){
@@ -36246,15 +23792,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.
- * <p>Developers should subscribe to the {@link Ext.data.Store#update} event
- * to have their code notified of reject operations.</p>
- * @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){
@@ -36270,14 +23808,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.
- * <p>Developers should subscribe to the {@link Ext.data.Store#update} event
- * to have their code notified of commit operations.</p>
- * @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;
@@ -36287,10 +23818,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){
@@ -36301,61 +23829,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 <code>{@link #id}</code>.
- * To generate a phantom record with a new id use:<pre><code>
-var rec = record.copy(); // clone the record
-Ext.data.Record.id(rec); // automatically generate a unique sequential id
- * </code></pre>
- * @return {Record}
- */
+
copy : function(newId) {
return new this.constructor(Ext.apply({}, this.data), newId || this.id);
},
- /**
- * Returns <tt>true</tt> if the passed field name has been <code>{@link #modified}</code>
- * 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 <tt>false</tt> if any {@link Ext.data.Field field} within the
- * record configured with <tt>{@link Ext.data.Field#allowBlank} = false</tt> returns
- * <tt>true</tt> 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;
},
- /**
- * <p>Marks this <b>Record</b> as <code>{@link #dirty}</code>. This method
- * is used interally when adding <code>{@link #phantom}</code> records to a
- * {@link Ext.data.Store#writer writer enabled store}.</p>
- * <br><p>Marking a record <code>{@link #dirty}</code> 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.</p>
- */
+
markDirty : function(){
this.dirty = true;
if(!this.modified){
@@ -36366,47 +23867,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]);
@@ -36427,257 +23906,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
- * <p>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}.</p>
- * <p><u>Retrieving Data</u></p>
- * <p>A Store object may access a data object using:<div class="mdetail-params"><ul>
- * <li>{@link #proxy configured implementation} of {@link Ext.data.DataProxy DataProxy}</li>
- * <li>{@link #data} to automatically pass in data</li>
- * <li>{@link #loadData} to manually pass in data</li>
- * </ul></div></p>
- * <p><u>Reading Data</u></p>
- * <p>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.</p>
- * <p><u>Store Types</u></p>
- * <p>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.</p>
- * <pre><code>
-var myStore = new Ext.data.ArrayStore({
- fields: ['fullname', 'first'],
- idIndex: 0 // id for each record will be the first element
});
- * </code></pre>
- * <p>For custom implementations create a basic {@link Ext.data.Store} configured as needed:</p>
- * <pre><code>
-// 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
- )
-});
- * </code></pre>
- * <p>Load some data into store (note the data object is an array which corresponds to the reader):</p>
- * <pre><code>
-var myData = [
- [1, 'Fred Flintstone', 'Fred'], // note that id for the record is the first element
- [2, 'Barney Rubble', 'Barney']
-];
-myStore.loadData(myData);
- * </code></pre>
- * <p>Records are cached and made available through accessor functions. An example of adding
- * a record to the store:</p>
- * <pre><code>
-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})
- * </code></pre>
- * <p><u>Writing Data</u></p>
- * <p>And <b>new in Ext version 3</b>, use the new {@link Ext.data.DataWriter DataWriter} to create an automated, <a href="http://extjs.com/deploy/dev/examples/writer/writer.html">Writable Store</a>
- * along with <a href="http://extjs.com/deploy/dev/examples/restful/restful.html">RESTful features.</a>
- * @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 <b>{@link Ext.StoreMgr StoreMgr}</b>.
- * <p><b>Note</b>: if a (deprecated) <tt>{@link #id}</tt> is specified it will supersede the <tt>storeId</tt>
- * assignment.</p>
- */
- /**
- * @cfg {String} url If a <tt>{@link #proxy}</tt> is not specified the <tt>url</tt> will be used to
- * implicitly configure a {@link Ext.data.HttpProxy HttpProxy} if an <tt>url</tt> is specified.
- * Typically this option, or the <code>{@link #data}</code> option will be specified.
- */
- /**
- * @cfg {Boolean/Object} autoLoad If <tt>{@link #data}</tt> is not specified, and if <tt>autoLoad</tt>
- * is <tt>true</tt> or an <tt>Object</tt>, this store's {@link #load} method is automatically called
- * after creation. If the value of <tt>autoLoad</tt> is an <tt>Object</tt>, this <tt>Object</tt> 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 <code>{@link #url}</code>.
- */
- /**
- * @cfg {Array} data An inline data object readable by the <code>{@link #reader}</code>.
- * Typically this option, or the <code>{@link #url}</code> 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
- * <b><tt>{@link Ext.data.Record#id id}</tt></b> property.
- */
- /**
- * @cfg {Ext.data.DataWriter} writer
- * <p>The {@link Ext.data.DataWriter Writer} object which processes a record object for being written
- * to the server-side database.</p>
- * <br><p>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}.</p>
- * <br><p>The proxy for this store will relay any {@link #writexception} events to this store.</p>
- * <br><p>Sample implementation:
- * <pre><code>
-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.
-});
- * </code></pre></p>
- */
+
+
+
+
+
+
writer : undefined,
- /**
- * @cfg {Object} baseParams
- * <p>An object containing properties which are to be sent as parameters
- * for <i>every</i> HTTP request.</p>
- * <p>Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.</p>
- * <p><b>Note</b>: <code>baseParams</code> may be superseded by any <code>params</code>
- * specified in a <code>{@link #load}</code> request, see <code>{@link #load}</code>
- * for more details.</p>
- * This property may be modified after creation using the <code>{@link #setBaseParam}</code>
- * 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 <tt>direction</tt> property is
- * case-sensitive. See also {@link #remoteSort} and {@link #paramNames}.
- * For example:<pre><code>
-sortInfo: {
- field: 'fieldName',
- direction: 'ASC' // or 'DESC' (case sensitive for local sorting)
-}
-</code></pre>
- */
- /**
- * @cfg {boolean} remoteSort <tt>true</tt> if sorting is to be handled by requesting the <tt>{@link #proxy Proxy}</tt>
- * to provide a refreshed version of the data object in sorted order, as opposed to sorting the Record cache
- * in place (defaults to <tt>false</tt>).
- * <p>If <tt>remoteSort</tt> is <tt>true</tt>, 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 <b><tt>{@link #load params}</tt></b>:<div class="mdetail-params"><ul>
- * <li><b><tt>sort</tt></b> : String<p class="sub-desc">The <tt>name</tt> (as specified in the Record's
- * {@link Ext.data.Field Field definition}) of the field to sort on.</p></li>
- * <li><b><tt>dir</tt></b> : String<p class="sub-desc">The direction of the sort, 'ASC' or 'DESC' (case-sensitive).</p></li>
- * </ul></div></p>
- */
+
+
+
remoteSort : false,
- /**
- * @cfg {Boolean} autoDestroy <tt>true</tt> to destroy the store when the component the store is bound
- * to is destroyed (defaults to <tt>false</tt>).
- * <p><b>Note</b>: this should be set to true when using stores that are bound to only 1 component.</p>
- */
+
autoDestroy : false,
- /**
- * @cfg {Boolean} pruneModifiedRecords <tt>true</tt> to clear all modified record information each time
- * the store is loaded or when a record is removed (defaults to <tt>false</tt>). 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
- * <p>Defaults to <tt>true</tt> causing the store to automatically {@link #save} records to
- * the server when a record is modified (ie: becomes 'dirty'). Specify <tt>false</tt> to manually call {@link #save}
- * to send all modifiedRecords to the server.</p>
- * <br><p><b>Note</b>: each CRUD action will be sent as a separate request.</p>
- */
+
autoSave : true,
- /**
- * @cfg {Boolean} batch
- * <p>Defaults to <tt>true</tt> (unless <code>{@link #restful}:true</code>). Multiple
- * requests for each CRUD action (CREATE, READ, UPDATE and DESTROY) will be combined
- * and sent as one transaction. Only applies when <code>{@link #autoSave}</code> is set
- * to <tt>false</tt>.</p>
- * <br><p>If Store is RESTful, the DataProxy is also RESTful, and a unique transaction is
- * generated for each record.</p>
- */
+
batch : true,
- /**
- * @cfg {Boolean} restful
- * Defaults to <tt>false</tt>. Set to <tt>true</tt> 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}.
- * <p><b>Note</b>: if <code>{@link #restful}:true</code> <code>batch</code> will
- * internally be set to <tt>false</tt>.</p>
- */
+
restful: false,
- /**
- * @cfg {Object} paramNames
- * <p>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:</p><pre><code>
-{
- 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
-}
-</code></pre>
- * <p>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.</p>
- * <p>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',
@@ -36688,21 +23957,13 @@ sortInfo: {
isDestroyed: false,
hasMultiSort: false,
- // private
+
batchKey : '_ext_batch_',
constructor : function(config){
- /**
- * @property multiSort
- * @type Boolean
- * True if this store is currently sorted by more than one field/direction combination.
- */
- /**
- * @property isDestroyed
- * @type Boolean
- * True if the store has been destroyed already. Read only
- */
+
+
this.data = new Ext.util.MixedCollection(false);
this.data.getKey = function(o){
@@ -36710,7 +23971,7 @@ sortInfo: {
};
- // temporary removed-records cache
+
this.removed = [];
if(config && config.data){
@@ -36720,12 +23981,7 @@ sortInfo: {
Ext.apply(this, config);
- /**
- * See the <code>{@link #baseParams corresponding configuration option}</code>
- * for a description of this property.
- * To modify this property see <code>{@link #setBaseParam}</code>.
- * @property
- */
+
this.baseParams = Ext.isObject(this.baseParams) ? this.baseParams : {};
this.paramNames = Ext.applyIf(this.paramNames || {}, this.defaultParamNames);
@@ -36733,23 +23989,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;
@@ -36757,216 +24013,51 @@ sortInfo: {
}
}
- /**
- * The {@link Ext.data.Record Record} constructor as supplied to (or created by) the
- * {@link Ext.data.DataReader Reader}. Read-only.
- * <p>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).</p>
- * <p>This property may be used to create new Records of the type held in this Store, for example:</p><pre><code>
- // 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);
- }
- }]
- });
- * </code></pre>
- * @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:
- * <pre><code>
- Ext.data.Record.EDIT
- Ext.data.Record.REJECT
- Ext.data.Record.COMMIT
- * </code></pre>
- */
+
'update',
- /**
- * @event clear
- * Fires when the data cache has been cleared.
- * @param {Store} this
- * @param {Record[]} records The records that were cleared.
- */
+
'clear',
- /**
- * @event exception
- * <p>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
- * <tt>false</tt> 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
- * <p>This event is <b>deprecated</b> in favor of the catch-all <b><code>{@link #exception}</code></b>
- * event instead.</p>
- * <p>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 <code>options.params</code> 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 <code>result['successProperty']</code>property (<b>NOTE</b> 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,
@@ -37001,17 +24092,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();
@@ -37028,9 +24114,7 @@ sortInfo: {
return new klass(config);
},
- /**
- * Destroys the store.
- */
+
destroy : function(){
if(!this.isDestroyed){
if(this.storeId){
@@ -37045,13 +24129,7 @@ sortInfo: {
}
},
- /**
- * Add Records to the Store and fires the {@link #add} event. To add Records
- * to the store from a remote source use <code>{@link #load}({add:true})</code>.
- * See also <code>{@link #recordType}</code> and <code>{@link #insert}</code>.
- * @param {Ext.data.Record[]} records An Array of Ext.data.Record objects
- * to add to the cache. See {@link #recordType}.
- */
+
add : function(records) {
var i, len, record, index;
@@ -37080,23 +24158,16 @@ 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);
},
- /**
- * @private
- * Update a record within the store with a new reference
- */
+
doUpdate: function(rec){
var id = rec.id;
- // unjoin the old record
+
this.getById(id).join(null);
this.data.replace(id, rec);
@@ -37107,10 +24178,7 @@ sortInfo: {
this.fireEvent('update', this, rec, Ext.data.Record.COMMIT);
},
- /**
- * 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){
@@ -37134,18 +24202,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 <tt>false</tt>. Set <tt>true</tt> to not fire clear event.
- */
+
removeAll : function(silent){
var items = [];
this.each(function(rec){
@@ -37158,24 +24220,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 <code>{@link #add}</code> and <code>{@link #addSorted}</code>.
- * @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) {
var i, len, record;
@@ -37198,53 +24255,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;
@@ -37252,7 +24288,7 @@ sortInfo: {
this.lastOptions = o;
},
- // private
+
clearData: function(){
this.data.each(function(rec) {
rec.join(null);
@@ -37260,37 +24296,7 @@ sortInfo: {
this.data.clear();
},
- /**
- * <p>Loads the Record cache from the configured <tt>{@link #proxy}</tt> using the configured <tt>{@link #reader}</tt>.</p>
- * <br><p>Notes:</p><div class="mdetail-params"><ul>
- * <li><b><u>Important</u></b>: 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 <tt>callback</tt> function to be called, or use a {@link Ext.util.Observable#listeners a 'load' event handler}.</li>
- * <li>If using {@link Ext.PagingToolbar remote paging}, the first load call must specify the <tt>start</tt> and <tt>limit</tt>
- * properties in the <code>options.params</code> property to establish the initial position within the
- * dataset, and the number of Records to cache on each read from the Proxy.</li>
- * <li>If using {@link #remoteSort remote sorting}, the configured <code>{@link #sortInfo}</code>
- * will be automatically included with the posted parameters according to the specified
- * <code>{@link #paramNames}</code>.</li>
- * </ul></div>
- * @param {Object} options An object containing properties which control loading options:<ul>
- * <li><b><tt>params</tt></b> :Object<div class="sub-desc"><p>An object containing properties to pass as HTTP
- * parameters to a remote data source. <b>Note</b>: <code>params</code> will override any
- * <code>{@link #baseParams}</code> of the same name.</p>
- * <p>Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.</p></div></li>
- * <li><b>callback</b> : Function<div class="sub-desc"><p>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:<ul>
- * <li>r : Ext.data.Record[] An Array of Records loaded.</li>
- * <li>options : Options object from the load call.</li>
- * <li>success : Boolean success indicator.</li></ul></p></div></li>
- * <li><b>scope</b> : Object<div class="sub-desc"><p>Scope with which to call the callback (defaults
- * to the Store object)</p></div></li>
- * <li><b>add</b> : Boolean<div class="sub-desc"><p>Indicator to append loaded records rather than
- * replace the current cache. <b>Note</b>: see note for <tt>{@link #loadData}</tt></p></div></li>
- * </ul>
- * @return {Boolean} If the <i>developer</i> provided <tt>{@link #beforeload}</tt> event handler returns
- * <tt>false</tt>, the load call will abort and will return <tt>false</tt>; otherwise will return <tt>true</tt>.
- */
+
load : function(options) {
options = Ext.apply({}, options);
this.storeOptions(options);
@@ -37301,34 +24307,21 @@ 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();
}
},
- /**
- * @private
- * Should not be used directly. Store#add will call this automatically if a Writer is set
- * @param {Object} store
- * @param {Object} records
- * @param {Object} index
- */
+
createRecords : function(store, records, index) {
var modified = this.modified,
length = records.length,
@@ -37338,7 +24331,7 @@ sortInfo: {
record = records[i];
if (record.phantom && record.isValid()) {
- record.markDirty(); // <-- Mark new records dirty (Ed: why?)
+ record.markDirty();
if (modified.indexOf(record) == -1) {
modified.push(record);
@@ -37350,23 +24343,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) {
@@ -37375,30 +24362,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') {
@@ -37406,50 +24384,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 <code>{@link #url}</code> will be used.
- * <pre>
- * 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
- * </pre>
- * @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');
@@ -37461,15 +24425,15 @@ sortInfo: {
batch,
data = {},
i;
- // 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(i = rs.length-1; i >= 0; i--){
if(rs[i].phantom === true){
@@ -37477,16 +24441,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]);
}
@@ -37509,7 +24473,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{
@@ -37527,7 +24491,7 @@ sortInfo: {
}
},
- // private
+
addToBatch : function(batch){
var b = this.batches,
key = this.batchKey + batch,
@@ -37563,14 +24527,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);
}
@@ -37578,9 +24542,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--) {
@@ -37591,7 +24555,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++) {
@@ -37606,7 +24570,7 @@ sortInfo: {
}
},
- // @protected onCreateRecord proxy callback for create action
+
onCreateRecords : function(success, rs, data) {
if (success === true) {
try {
@@ -37615,14 +24579,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 {
@@ -37630,59 +24594,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<len;i++) {
this.removed.splice(this.removed.indexOf(rs[i]), 1);
}
if (success === false) {
- // put records back into store if remote destroy fails.
- // @TODO: Might want to let developer decide.
+
+
for (i=rs.length-1;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);
},
- /**
- * <p>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.</p>
- * <p><b>Note</b>: see the Important note in {@link #load}.</p>
- * @param {Object} options <p>(optional) An <tt>Object</tt> 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 <tt>null</tt>, in which case the {@link #lastOptions} are
- * used).</p>
- * <br><p>To add new params to the existing params:</p><pre><code>
-lastOptions = myStore.lastOptions;
-Ext.apply(lastOptions.params, {
- myNewParam: true
-});
-myStore.reload(lastOptions);
- * </code></pre>
- */
+
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){
var i, len;
@@ -37737,89 +24684,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 <tt>{@link Ext.data.Reader#readRecords}</tt> parameter.
- * @param {Boolean} append (Optional) <tt>true</tt> to append the new Records rather the default to replace
- * the existing cache.
- * <b>Note</b>: 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 <i>replace</i> 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.
- * <p>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. <b>Note</b>: see the Important note in {@link #load}.</p>
- * @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.
- * <p>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
- * (<tt>totalProperty</tt> for {@link Ext.data.JsonReader JsonReader},
- * <tt>totalRecords</tt> for {@link Ext.data.XmlReader XmlReader}) shall be returned by a query on the server.
- * <b>Note</b>: see the Important note in {@link #load}.</p>
- * @return {Number} The number of Records as specified in the data object passed to the Reader
- * by the Proxy.
- * <p><b>Note</b>: this value is not updated when changing the contents of the Store locally.</p>
- */
+
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:<ul>
- * <li><b>field : String<p class="sub-desc">The name of the field by which the Records are sorted.</p></li>
- * <li><b>direction : String<p class="sub-desc">The sort order, 'ASC' or 'DESC' (case-sensitive).</p></li>
- * </ul>
- * See <tt>{@link #sortInfo}</tt> 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));
}
@@ -37828,15 +24733,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);
@@ -37846,28 +24751,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);
}
},
- /**
- * @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")
- * @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]);
@@ -37876,42 +24775,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 <tt>'ASC'</tt>)
- */
+
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 <tt>'ASC'</tt>)
- */
+
sort : function(fieldName, dir) {
if (Ext.isArray(arguments[0])) {
return this.multiSort.call(this, fieldName, dir);
@@ -37920,12 +24791,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 <tt>'ASC'</tt>)
- */
+
singleSort: function(fieldName, dir) {
var field = this.fields.get(fieldName);
if (!field) {
@@ -37937,7 +24803,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;
@@ -37964,28 +24830,17 @@ myStore.reload(lastOptions);
return true;
},
- /**
- * 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");
}
- /**
- * Object containing overall sort direction and an ordered array of sorter configs used when sorting on multiple fields
- * @property multiSortInfo
- * @type Object
- */
+
this.multiSortInfo = {
sorters : sorters,
direction: direction
@@ -38000,38 +24855,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 <tt>false</tt> aborts and exits the iteration.
- * @param {Object} scope (optional) The scope (<code>this</code> 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). <b>Note</b>: deleted records are not
- * included. See also <tt>{@link #pruneModifiedRecords}</tt> and
- * {@link Ext.data.Record}<tt>{@link Ext.data.Record#markDirty markDirty}.</tt>.
- * @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}<tt>{@link Ext.data.Record#modified modified}.</tt>.
- */
+
getModifiedRecords : function(){
return this.modified;
},
- /**
- * Sums the value of <tt>property</tt> for each {@link Ext.data.Record record} between <tt>start</tt>
- * and <tt>end</tt> and returns the result.
- * @param {String} property A field in each record
- * @param {Number} start (optional) The record index to start at (defaults to <tt>0</tt>)
- * @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;
@@ -38043,16 +24877,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;
@@ -38063,13 +24888,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)
- * @return {Function} The multiple filter function
- */
+
createMultipleFilterFn: function(filters) {
return function(record) {
var isMatch = true;
@@ -38086,40 +24905,10 @@ 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:
- * <pre><code>
- * 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
- * }
- * ]);
- * </code></pre>
- * @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) <tt>true</tt> to match any part not just the beginning
- * @param {Boolean} caseSensitive (optional) <tt>true</tt> 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){
var fn;
- //we can accept an array of filter objects, or a single filter object - normalize them here
+
if (Ext.isObject(property)) {
property = [property];
}
@@ -38127,13 +24916,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);
}
@@ -38143,35 +24932,21 @@ myStore.reload(lastOptions);
fn = this.createMultipleFilterFn(filters);
} else {
- //classic single property filter
+
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 <tt>true</tt> the Record is included,
- * otherwise it is filtered out.
- * @param {Function} fn The function to be called. It will be passed the following parameters:<ul>
- * <li><b>record</b> : Ext.data.Record<p class="sub-desc">The {@link Ext.data.Record record}
- * to test for filtering. Access field values using {@link Ext.data.Record#get}.</p></li>
- * <li><b>id</b> : Object<p class="sub-desc">The ID of the Record passed.</p></li>
- * </ul>
- * @param {Object} scope (optional) The scope (<code>this</code> 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 <tt>true</tt> the filter is cleared silently without firing the
- * {@link #datachanged} event.
- */
+
clearFilter : function(suppressEvent){
if(this.isFiltered()){
this.data = this.snapshot;
@@ -38182,96 +24957,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 <tt>true</tt> the record is
- * included in the results.
- * @param {Function} fn The function to be called. It will be passed the following parameters:<ul>
- * <li><b>record</b> : Ext.data.Record<p class="sub-desc">The {@link Ext.data.Record record}
- * to test for filtering. Access field values using {@link Ext.data.Record#get}.</p></li>
- * <li><b>id</b> : Object<p class="sub-desc">The ID of the Record passed.</p></li>
- * </ul>
- * @param {Object} scope (optional) The scope (<code>this</code> 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 <tt>true</tt> it is considered a match.
- * @param {Function} fn The function to be called. It will be passed the following parameters:<ul>
- * <li><b>record</b> : Ext.data.Record<p class="sub-desc">The {@link Ext.data.Record record}
- * to test for filtering. Access field values using {@link Ext.data.Record#get}.</p></li>
- * <li><b>id</b> : Object<p class="sub-desc">The ID of the Record passed.</p></li>
- * </ul>
- * @param {Object} scope (optional) The scope (<code>this</code> 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;
@@ -38287,7 +25008,7 @@ myStore.reload(lastOptions);
return r;
},
- // private
+
afterEdit : function(record){
if(this.modified.indexOf(record) == -1){
this.modified.push(record);
@@ -38295,23 +25016,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 modified = this.modified.slice(0),
length = modified.length,
@@ -38325,9 +25042,7 @@ myStore.reload(lastOptions);
this.removed = [];
},
- /**
- * {@link Ext.data.Record#reject Reject} outstanding changes on all {@link #getModifiedRecords modified records}.
- */
+
rejectChanges : function() {
var modified = this.modified.slice(0),
removed = this.removed.slice(0).reverse(),
@@ -38348,7 +25063,7 @@ myStore.reload(lastOptions);
this.removed = [];
},
- // private
+
onMetaChange : function(meta){
this.recordType = this.reader.recordType;
this.fields = this.recordType.prototype.fields;
@@ -38365,7 +25080,7 @@ myStore.reload(lastOptions);
this.fireEvent('metachange', this, this.reader.meta);
},
- // private
+
findInsertIndex : function(record){
this.suspendEvents();
var data = this.data.clone();
@@ -38377,13 +25092,7 @@ myStore.reload(lastOptions);
return index;
},
- /**
- * Set the value for a property name in this store's {@link #baseParams}. Usage:</p><pre><code>
-myStore.setBaseParam('foo', {bar:3});
-</code></pre>
- * @param {String} name Name of the property to assign
- * @param {Mixed} value Value to assign the <tt>name</tt>d property
- **/
+
setBaseParam : function (name, value){
this.baseParams = this.baseParams || {};
this.baseParams[name] = value;
@@ -38392,12 +25101,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'
});
@@ -38406,13 +25110,7 @@ Ext.apply(Ext.data.Store.Error.prototype, {
'writer-undefined' : 'Attempted to execute a write-action without a DataWriter installed.'
}
});
-/**
- * @class Ext.data.Field
- * <p>This class encapsulates the field definition information specified in the field definition objects
- * passed to {@link Ext.data.Record#create}.</p>
- * <p>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 <b>prototype.</b></p>
- */
+
Ext.data.Field = Ext.extend(Object, {
constructor : function(config){
@@ -38433,7 +25131,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)){
@@ -38445,268 +25143,84 @@ 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 <code>dataIndex</code> property in column definition objects passed to {@link Ext.grid.ColumnModel}.
- * <p>Note: In the simplest case, if no properties other than <code>name</code> are required, a field
- * definition may consist of just a String for the field name.</p>
- */
- /**
- * @cfg {Mixed} type
- * (Optional) The data type for automatic conversion from received data to the <i>stored</i> value if <code>{@link Ext.data.Field#convert convert}</code>
- * has not been specified. This may be specified as a string value. Possible values are
- * <div class="mdetail-params"><ul>
- * <li>auto (Default, implies no conversion)</li>
- * <li>string</li>
- * <li>int</li>
- * <li>float</li>
- * <li>boolean</li>
- * <li>date</li></ul></div>
- * <p>This may also be specified by referencing a member of the {@link Ext.data.Types} class.</p>
- * <p>Developers may create their own application-specific data types by defining new members of the
- * {@link Ext.data.Types} class.</p>
- */
- /**
- * @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:<div class="mdetail-params"><ul>
- * <li><b>v</b> : Mixed<div class="sub-desc">The data value as read by the Reader, if undefined will use
- * the configured <code>{@link Ext.data.Field#defaultValue defaultValue}</code>.</div></li>
- * <li><b>rec</b> : Mixed<div class="sub-desc">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}).</div></li>
- * </ul></div>
- * <pre><code>
-// 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'
- }
-];
- * </code></pre>
- */
- /**
- * @cfg {String} dateFormat
- * <p>(Optional) Used when converting received data into a Date when the {@link #type} is specified as <code>"date"</code>.</p>
- * <p>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}</p>
- */
dateFormat: null,
- /**
- * @cfg {Boolean} useNull
- * <p>(Optional) Use when converting received data into a Number type (either int or float). If the value cannot be parsed,
- * null will be used if useNull is true, otherwise the value will be 0. Defaults to <tt>false</tt>
- */
+
useNull: false,
- /**
- * @cfg {Mixed} defaultValue
- * (Optional) The default value used <b>when a Record is being created by a {@link Ext.data.Reader Reader}</b>
- * when the item referenced by the <code>{@link Ext.data.Field#mapping mapping}</code> does not exist in the data
- * object (i.e. undefined). (defaults to "")
- */
+
defaultValue: "",
- /**
- * @cfg {String/Number} mapping
- * <p>(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.</p>
- * <p>The form of the mapping expression depends on the Reader being used.</p>
- * <div class="mdetail-params"><ul>
- * <li>{@link Ext.data.JsonReader}<div class="sub-desc">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.</div></li>
- * <li>{@link Ext.data.XmlReader}<div class="sub-desc">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.</div></li>
- * <li>{@link Ext.data.ArrayReader}<div class="sub-desc">The mapping is a number indicating the Array index
- * of the field's value. Defaults to the field specification's Array position.</div></li>
- * </ul></div>
- * <p>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.</p>
- */
+
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:<pre><code>
-// 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;
- }
-}
- * </code></pre>
- */
+
sortType : null,
- /**
- * @cfg {String} sortDir
- * (Optional) Initial direction to sort (<code>"ASC"</code> or <code>"DESC"</code>). Defaults to
- * <code>"ASC"</code>.
- */
+
sortDir : "ASC",
- /**
- * @cfg {Boolean} allowBlank
- * (Optional) Used for validating a {@link Ext.data.Record record}, defaults to <code>true</code>.
- * An empty value here will cause {@link Ext.data.Record}.{@link Ext.data.Record#isValid isValid}
- * to evaluate to <code>false</code>.
- */
+
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
- * <p>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}.</p>
- */
+
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
- * <p>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}.</p>
- */
+
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 <b>must</b> 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 <b>must</b> 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;
@@ -38715,14 +25229,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 <b>must</b> 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--) {
@@ -38730,14 +25237,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();
}
@@ -38748,20 +25255,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];
}
@@ -38774,7 +25276,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);
}
}
@@ -38788,17 +25290,12 @@ Ext.data.DataReader.prototype = {
return rs;
},
- /**
- * Returns true if the supplied data-hash <b>looks</b> 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;
@@ -38807,11 +25304,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;
@@ -38826,120 +25319,22 @@ Ext.apply(Ext.data.DataReader.Error.prototype, {
'invalid-response': "#readResponse received an invalid response from the server."
}
});
-/**
- * @class Ext.data.DataWriter
- * <p>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.</p>
- * <p>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}.</p>
- * <p>Creating a writer is simple:</p>
- * <pre><code>
-var writer = new Ext.data.JsonWriter({
- encode: false // &lt;--- false causes data to be printed to jsonData config-property of Ext.Ajax#reqeust
-});
- * </code></pre>
- * * <p>Same old JsonReader as Ext-2.x:</p>
- * <pre><code>
-var reader = new Ext.data.JsonReader({idProperty: 'id'}, [{name: 'first'}, {name: 'last'}, {name: 'email'}]);
- * </code></pre>
- *
- * <p>The proxy for a writer enabled store can be configured with a simple <code>url</code>:</p>
- * <pre><code>
-// Create a standard HttpProxy instance.
-var proxy = new Ext.data.HttpProxy({
- url: 'app.php/users' // &lt;--- Supports "provides"-type urls, such as '/users.json', '/products.xml' (Hello Rails/Merb)
-});
- * </code></pre>
- * <p>For finer grained control, the proxy may also be configured with an <code>API</code>:</p>
- * <pre><code>
-// 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 : { // &lt;--- Supports object-syntax as well
- url: 'app.php/users/destroy',
- method: "DELETE"
- }
- }
-});
- * </code></pre>
- * <p>Pulling it all together into a Writer-enabled Store:</p>
- * <pre><code>
-var store = new Ext.data.Store({
- proxy: proxy,
- reader: reader,
- writer: writer,
- autoLoad: true,
- autoSave: true // -- Cell-level updates.
-});
- * </code></pre>
- * <p>Initiating write-actions <b>automatically</b>, using the existing Ext2.0 Store/Record API:</p>
- * <pre><code>
-var rec = store.getAt(0);
-rec.set('email', 'foo@bar.com'); // &lt;--- Immediately initiates an UPDATE action through configured proxy.
-
-store.remove(rec); // &lt;---- Immediately initiates a DESTROY action through configured proxy.
- * </code></pre>
- * <p>For <b>record/batch</b> updates, use the Store-configuration {@link Ext.data.Store#autoSave autoSave:false}</p>
- * <pre><code>
-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();
- * </code></pre>
- * @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
- * <tt>false</tt> by default. Set <tt>true</tt> to have DataWriter return ALL fields of a modified
- * record -- not just those that changed.
- * <tt>false</tt> to have DataWriter only request modified fields from a record.
- */
+
writeAllFields : false,
- /**
- * @cfg {Boolean} listful
- * <tt>false</tt> by default. Set <tt>true</tt> to have the DataWriter <b>always</b> 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.
- /**
- * 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 <i>receiver</i> of paramaters and the second, baseParams, <i>the source</i>.
- * @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.
- */
+ listful : false,
+
+
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));
@@ -38951,44 +25346,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 <b>NOT YET IMPLEMENTED</b>. 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 = {},
@@ -38999,9 +25369,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];
@@ -39012,284 +25382,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:
-<code><pre>&lt;tpl for=".">&lt;{name}>{value}&lt;/{name}&lt;/tpl></pre></code>
- * eg, <b>non-phantom</b>:
-<code><pre>{id: 1, first: 'foo', last: 'bar'} --> [{name: 'id', value: 1}, {name: 'first', value: 'foo'}, {name: 'last', value: 'bar'}]</pre></code>
- * {@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
- * <p>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}.</p>
- * <p>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}.</p>
- * <p>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}.</p>
- * <p>Custom implementations must implement either the <code><b>doRequest</b></code> method (preferred) or the
- * <code>load</code> 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.</p>
- * <p><b><u>Example 1</u></b></p>
- * <pre><code>
-proxy: new Ext.data.ScriptTagProxy({
- {@link Ext.data.Connection#url url}: 'http://extjs.com/forum/topics-remote.php'
-}),
- * </code></pre>
- * <p><b><u>Example 2</u></b></p>
- * <pre><code>
-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'
- }
-}),
- * </code></pre>
- * <p>And <b>new in Ext version 3</b>, attach centralized event-listeners upon the DataProxy class itself! This is a great place
- * to implement a <i>messaging system</i> to centralize your application's user-feedback and error-handling.</p>
- * <pre><code>
-// Listen to all "beforewrite" event fired by all proxies.
-Ext.data.DataProxy.on('beforewrite', function(proxy, action) {
- console.log('beforewrite: ', action);
-});
+};
+Ext.data.DataProxy = function(conn){
-// 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, exception) {
- console.error(type + action + ' exception);
-});
- * </code></pre>
- * <b>Note:</b> These three events are all fired with the signature of the corresponding <i>DataProxy instance</i> 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:<pre><code>
-api: {
- read : undefined,
- create : undefined,
- update : undefined,
- destroy : undefined
-}
- * </code></pre>
- * <p>The url is built based upon the action being executed <tt>[load|create|save|destroy]</tt>
- * using the commensurate <tt>{@link #api}</tt> property, or if undefined default to the
- * configured {@link Ext.data.Store}.{@link Ext.data.Store#url url}.</p><br>
- * <p>For example:</p>
- * <pre><code>
-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'
-}
- * </code></pre>
- * <p>If the specific URL for a given CRUD action is undefined, the CRUD action request
- * will be directed to the configured <tt>{@link Ext.data.Connection#url url}</tt>.</p>
- * <br><p><b>Note</b>: 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:
- * <pre><code>
-// modify the url for the action
-myStore.on({
- beforeload: {
- fn: function (store, options) {
- // use <tt>{@link Ext.data.HttpProxy#setUrl setUrl}</tt> 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 <tt>{@link Ext.data.DataProxy#setApi setApi}</tt>.
- 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 <b>entire</b>
- // 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'
- });
- }
- }
-});
- * </code></pre>
- * </p>
- */
this.addEvents(
- /**
- * @event exception
- * <p>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.</p>
- * <p>In addition to being fired through the DataProxy instance that raised the event, this event is also fired
- * through the Ext.data.DataProxy <i>class</i> to allow for centralized processing of exception events from <b>all</b>
- * DataProxies by attaching a listener to the Ext.data.DataProxy class itself.</p>
- * <p>This event can be fired for one of two reasons:</p>
- * <div class="mdetail-params"><ul>
- * <li>remote-request <b>failed</b> : <div class="sub-desc">
- * The server did not return status === 200.
- * </div></li>
- * <li>remote-request <b>succeeded</b> : <div class="sub-desc">
- * 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.
- * </div></li>
- * </ul></div>
- * <br><p>This event fires with two different contexts based upon the 2nd
- * parameter <tt>type [remote|response]</tt>. The first four parameters
- * are identical between the two contexts -- only the final two parameters
- * differ.</p>
- * @param {DataProxy} this The proxy that sent the request
- * @param {String} type
- * <p>The value of this parameter will be either <tt>'response'</tt> or <tt>'remote'</tt>.</p>
- * <div class="mdetail-params"><ul>
- * <li><b><tt>'response'</tt></b> : <div class="sub-desc">
- * <p>An <b>invalid</b> 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).</p>
- * </div></li>
- * <li><b><tt>'remote'</tt></b> : <div class="sub-desc">
- * <p>A <b>valid</b> 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.</p>
- * </div></li>
- * </ul></div>
- * @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
- * <p>The value of this parameter depends on the value of the <code>type</code> parameter:</p>
- * <div class="mdetail-params"><ul>
- * <li><b><tt>'response'</tt></b> : <div class="sub-desc">
- * <p>The raw browser response object (e.g.: XMLHttpRequest)</p>
- * </div></li>
- * <li><b><tt>'remote'</tt></b> : <div class="sub-desc">
- * <p>The decoded response object sent from the server.</p>
- * </div></li>
- * </ul></div>
- * @param {Mixed} arg
- * <p>The type and value of this parameter depends on the value of the <code>type</code> parameter:</p>
- * <div class="mdetail-params"><ul>
- * <li><b><tt>'response'</tt></b> : Error<div class="sub-desc">
- * <p>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.</p>
- * </div></li>
- * <li><b><tt>'remote'</tt></b> : Record/Record[]<div class="sub-desc">
- * <p>This parameter will only exist if the <tt>action</tt> was a <b>write</b> action
- * (Ext.data.Api.actions.create|update|destroy).</p>
- * </div></li>
- * </ul></div>
- */
+
'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 <tt>options</tt> property as passed to the {@link #request} function
- */
+
'load',
- /**
- * @event loadexception
- * <p>This event is <b>deprecated</b>. 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.</p>
- * @param {misc} misc See {@link #exception}.
- * @deprecated
- */
+
'loadexception',
- /**
- * @event beforewrite
- * <p>Fires before a request is generated for one of the actions Ext.data.Api.actions.create|update|destroy</p>
- * <p>In addition to being fired through the DataProxy instance that raised the event, this event is also fired
- * through the Ext.data.DataProxy <i>class</i> to allow for centralized processing of beforewrite events from <b>all</b>
- * DataProxies by attaching a listener to the Ext.data.DataProxy class itself.</p>
- * @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 <code>params</code> object. Edit <code>params</code> to add parameters to the request.
- */
+
'beforewrite',
- /**
- * @event write
- * <p>Fires before the request-callback is called</p>
- * <p>In addition to being fired through the DataProxy instance that raised the event, this event is also fired
- * through the Ext.data.DataProxy <i>class</i> to allow for centralized processing of write events from <b>all</b>
- * DataProxies by attaching a listener to the Ext.data.DataProxy class itself.</p>
- * @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 <tt>options</tt> 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) {
@@ -39297,68 +25432,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
- * <p>Defaults to <tt>false</tt>. Set to <tt>true</tt> to operate in a RESTful manner.</p>
- * <br><p> Note: this parameter will automatically be set to <tt>true</tt> if the
- * {@link Ext.data.Store} it is plugged into is set to <code>restful: true</code>. If the
- * Store is RESTful, there is no need to set this option on the proxy.</p>
- * <br><p>RESTful implementations enable the serverside framework to automatically route
- * actions sent to one url based upon the HTTP method, for example:
- * <pre><code>
-store: new Ext.data.Store({
- restful: true,
- proxy: new Ext.data.HttpProxy({url:'/users'}); // all requests sent to /users
- ...
-)}
- * </code></pre>
- * If there is no <code>{@link #api}</code> 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:
- * <pre>
-<u>Method</u> <u>url</u> <u>action</u>
-POST /users create
-GET /users read
-PUT /users/23 update
-DESTROY /users/23 delete
- * </pre></p>
- * <p>If set to <tt>true</tt>, 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:<pre><code>
- * someSite.com/controller/action/id
- * </code></pre>
- * Where the segments in the url are typically:<div class="mdetail-params"><ul>
- * <li>The first segment : represents the controller class that should be invoked.</li>
- * <li>The second segment : represents the class function, or method, that should be called.</li>
- * <li>The third segment : represents the ID (a variable typically passed to the method).</li>
- * </ul></div></p>
- * <br><p>Refer to <code>{@link Ext.data.DataProxy#api}</code> for additional information.</p>
- */
+
restful: false,
- /**
- * <p>Redefines the Proxy's API or a single action of an API. Can be called with two method signatures.</p>
- * <p>If called with an object as the only parameter, the object should redefine the <b>entire</b> API, e.g.:</p><pre><code>
-proxy.setApi({
- read : '/users/read',
- create : '/users/create',
- update : '/users/update',
- destroy : '/users/destroy'
-});
-</code></pre>
- * <p>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.:</p><pre><code>
-proxy.setApi(Ext.data.Api.actions.read, '/users/new_load_url');
-</code></pre>
- * @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]);
@@ -39378,28 +25460,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 (<code>this</code> 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);
@@ -39414,111 +25480,64 @@ proxy.setApi(Ext.data.Api.actions.read, '/users/new_load_url');
},
- /**
- * <b>Deprecated</b> 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. <b>Note:</b> 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. <b>Note:</b> 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. <b>Note:</b> Should only be used by custom-proxy developers. Callback for <i>create, update and destroy</i> {@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;
@@ -39534,139 +25553,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.<br>
- * <p>
- * <b>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.</b><br>
- * <p>
- * The content passed back from a server resource requested by a ScriptTagProxy <b>must</b> be executable JavaScript
- * source code because it is used as the source inside a &lt;script> tag.<br>
- * <p>
- * 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:
- * <p>
- * <pre><code>
-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(");");
-}
-</code></pre>
- * <p>Below is a PHP example to do the same thing:</p><pre><code>
-$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);
-}
-</code></pre>
- * <p>Below is the ASP.Net code to do the same thing:</p><pre><code>
-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);
-</code></pre>
- *
- * @constructor
- * @param {Object} config A configuration object.
- */
+
Ext.data.ScriptTagProxy = function(config){
Ext.apply(this, config);
@@ -39674,67 +25597,21 @@ Ext.data.ScriptTagProxy = function(config){
this.head = document.getElementsByTagName("head")[0];
- /**
- * @event loadexception
- * <b>Deprecated</b> 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:
- * <ul><li><b>The load call timed out.</b> 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.</li>
- * <li><b>The load succeeded but the reader could not read the response.</b> 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.</li></ul>
- * 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".<p>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 <tt>read</tt>, 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 <ul>
- * <li>The Record block object</li>
- * <li>The "arg" argument from the load function</li>
- * <li>A boolean success indicator</li>
- * </ul>
- * @param {Object} scope The scope (<code>this</code> 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));
@@ -39777,7 +25654,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) {
@@ -39790,19 +25667,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);
@@ -39810,7 +25681,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);
@@ -39819,17 +25690,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);
@@ -39845,21 +25710,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);
@@ -39869,7 +25732,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{
@@ -39879,12 +25742,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);
}
@@ -39895,52 +25758,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
- * <p>An implementation of {@link Ext.data.DataProxy} that processes data requests within the same
- * domain of the originating page.</p>
- * <p><b>Note</b>: 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}.</p>
- * <p>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 "<tt>text/xml</tt>".</p>
- * @constructor
- * @param {Object} conn
- * An {@link Ext.data.Connection} object, or options parameter to {@link Ext.Ajax#request}.
- * <p>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 <tt>callback</tt> and <tt>params</tt>
- * 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.</p>
- * <p>If an options parameter is passed, the singleton {@link Ext.Ajax} object will be used to make
- * the request.</p>
- */
+});
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) {
@@ -39949,25 +25787,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) {
@@ -39977,24 +25802,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
- * <div class="sub-desc"><p>A function to be called after the request.
- * The <tt>callback</tt> is passed the following arguments:<ul>
- * <li><tt>r</tt> : Ext.data.Record[] The block of Ext.data.Records.</li>
- * <li><tt>options</tt>: Options object from the action request</li>
- * <li><tt>success</tt>: Boolean success indicator</li></ul></p></div>
- * @param {Object} scope The scope (<code>this</code> 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,
@@ -40008,8 +25816,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) {
@@ -40017,45 +25825,35 @@ 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]);
+
+ if (action == Ext.data.Api.actions.read && this.activeRequest[action]) {
+ 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);
@@ -40070,23 +25868,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);
@@ -40094,31 +25883,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;
@@ -40134,13 +25915,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();
@@ -40154,16 +25935,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, {
@@ -40173,41 +25947,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 <ul>
- * <li>The Record block object</li>
- * <li>The "arg" argument from the load function</li>
- * <li>A boolean success indicator</li>
- * </ul>
- * @param {Object} scope The scope (<code>this</code> 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);
@@ -40216,92 +25966,28 @@ Ext.extend(Ext.data.MemoryProxy, Ext.data.DataProxy, {
}
callback.call(scope, result, arg, true);
}
-});/**
- * @class Ext.data.Types
- * <p>This is s static class containing the system-supplied data types which may be given to a {@link Ext.data.Field Field}.<p/>
- * <p>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.</p>
- * <p>Developers may add their own application-specific data types to this class. Definition names must be UPPERCASE.
- * each type definition must contain three properties:</p>
- * <div class="mdetail-params"><ul>
- * <li><code>convert</code> : <i>Function</i><div class="sub-desc">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:
- * <div class="mdetail-params"><ul>
- * <li><b>v</b> : Mixed<div class="sub-desc">The data value as read by the Reader, if undefined will use
- * the configured <tt>{@link Ext.data.Field#defaultValue defaultValue}</tt>.</div></li>
- * <li><b>rec</b> : Mixed<div class="sub-desc">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}).</div></li>
- * </ul></div></div></li>
- * <li><code>sortType</code> : <i>Function</i> <div class="sub-desc">A function to convert the stored data into comparable form, as defined by {@link Ext.data.SortTypes}.</div></li>
- * <li><code>type</code> : <i>String</i> <div class="sub-desc">A textual data type name.</div></li>
- * </ul></div>
- * <p>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 <code>lat</code> and <code>long</code>, you would define a new data type like this:</p>
- *<pre><code>
-// 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'
-};
-</code></pre>
- * <p>Then, when declaring a Record, use <pre><code>
-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 }
-]);
-</code></pre>
- * @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 <tt>/[\$,%]/g</tt>.
- * 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.
- * <p>The synonym <code>INTEGER</code> is equivalent.</p>
- */
+
INT: {
convert: function(v){
return v !== undefined && v !== null && v !== '' ?
@@ -40311,12 +25997,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.
- * <p>The synonym <code>NUMBER</code> is equivalent.</p>
- */
+
FLOAT: {
convert: function(v){
return v !== undefined && v !== null && v !== '' ?
@@ -40326,26 +26007,14 @@ Ext.data.Types = new function(){
type: 'float'
},
- /**
- * @type Object.
- * @property BOOL
- * <p>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 <code>true</code>.</p>
- * <p>The synonym <code>BOOLEAN</code> is equivalent.</p>
- */
+
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;
@@ -40373,109 +26042,47 @@ Ext.data.Types = new function(){
});
Ext.apply(this, {
- /**
- * @type Object.
- * @property BOOLEAN
- * <p>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 <code>true</code>.</p>
- * <p>The synonym <code>BOOL</code> is equivalent.</p>
- */
+
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.
- * <p>The synonym <code>INT</code> is equivalent.</p>
- */
+
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.
- * <p>The synonym <code>FLOAT</code> is equivalent.</p>
- */
+
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 <p><tt>true</tt> to {@link Ext.util.JSON#encode JSON encode} the
- * {@link Ext.data.DataWriter#toHash hashed data} into a standard HTTP parameter named after this
- * Reader's <code>meta.root</code> property which, by default is imported from the associated Reader. Defaults to <tt>true</tt>.</p>
- * <p>If set to <code>false</code>, the hashed data is {@link Ext.util.JSON#encode JSON encoded}, along with
- * the associated {@link Ext.data.Store}'s {@link Ext.data.Store#baseParams baseParams}, into the POST body.</p>
- * <p>When using {@link Ext.data.DirectProxy}, set this to <tt>false</tt> since Ext.Direct.JsonProvider will perform
- * its own json-encoding. In addition, if you're using {@link Ext.data.HttpProxy}, setting to <tt>false</tt>
- * will cause HttpProxy to transmit data using the <b>jsonData</b> configuration-params of {@link Ext.Ajax#request}
- * instead of <b>params</b>.</p>
- * <p>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 <b>encode: <tt>false</tt></b>, as in
- * let the lower-level connection object (eg: Ext.Ajax) do the encoding.</p>
- */
+
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: <pre><code>
-{id: 1}
- * </code></pre> Defaults to <tt>false</tt>
- */
+
encodeDelete: false,
-
+
constructor : function(config){
- Ext.data.JsonWriter.superclass.constructor.call(this, config);
+ Ext.data.JsonWriter.superclass.constructor.call(this, config);
},
- /**
- * <p>This method should not need to be called by application code, however it may be useful on occasion to
- * override it, or augment it with an {@link Function#createInterceptor interceptor} or {@link Function#createSequence sequence}.</p>
- * <p>The provided implementation encodes the serialized data representing the Store's modified Records into the Ajax request's
- * <code>params</code> according to the <code>{@link #encode}</code> setting.</p>
- * @param {Object} Ajax request params object to write into.
- * @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 serialized modified records from the Store. May be either a single object,
- * or an Array of objects - user implementations must handle both cases.
- */
+
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 = {};
@@ -40485,137 +26092,13 @@ Ext.data.JsonWriter = Ext.extend(Ext.data.DataWriter, {
return rec.id;
}
}
-});/**
- * @class Ext.data.JsonReader
- * @extends Ext.data.DataReader
- * <p>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.</p>
- * <p>Example code:</p>
- * <pre><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&#39;s 'firstname' field to data object&#39;s key of same name
- {name: 'name', mapping: 'firstname'},
- // map Record&#39;s 'job' field to data object&#39;s 'occupation' key
- {name: 'job', mapping: 'occupation'}
- ]
});
-</code></pre>
- * <p>This would consume a JSON data object of the form:</p><pre><code>
-{
- results: 2000, // Reader&#39;s configured {@link #totalProperty}
- rows: [ // Reader&#39;s configured {@link #root}
- // record data objects:
- { {@link #idProperty id}: 1, firstname: 'Bill', occupation: 'Gardener' },
- { {@link #idProperty id}: 2, firstname: 'Ben' , occupation: 'Horticulturalist' },
- ...
- ]
-}
-</code></pre>
- * <p><b><u>Automatic configuration using metaData</u></b></p>
- * <p>It is possible to change a JsonReader's metadata at any time by including
- * a <b><tt>metaData</tt></b> property in the JSON data object. If the JSON data
- * object has a <b><tt>metaData</tt></b> 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 <b><tt>metaData</tt></b>
- * property to perform any configuration required.</p>
- * <p>Note that reconfiguring a Store potentially invalidates objects which may
- * refer to Fields or Records which no longer exist.</p>
- * <p>To use this facility you would create the JsonReader like this:</p><pre><code>
-var myReader = new Ext.data.JsonReader();
-</code></pre>
- * <p>The first data packet from the server would configure the reader by
- * containing a <b><tt>metaData</tt></b> property <b>and</b> the data. For
- * example, the JSON data object might take the form:</p><pre><code>
-{
- 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&#39;s configured {@link #successProperty}
- "success": true,
- // Reader&#39;s configured {@link #totalProperty}
- "results": 2000,
- // Reader&#39;s configured {@link #root}
- // (this data simulates 2 results {@link Ext.PagingToolbar per page})
- "rows": [ // <b>*Note:</b> this must be an Array
- { "id": 1, "name": "Bill", "occupation": "Gardener" },
- { "id": 2, "name": "Ben", "occupation": "Horticulturalist" }
- ]
-}
- * </code></pre>
- * <p>The <b><tt>metaData</tt></b> property in the JSON data object should contain:</p>
- * <div class="mdetail-params"><ul>
- * <li>any of the configuration options for this class</li>
- * <li>a <b><tt>{@link Ext.data.Record#fields fields}</tt></b> 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.</li>
- * <li>a <b><tt>{@link Ext.data.Store#sortInfo sortInfo}</tt></b> property
- * which the JsonReader will use to set the {@link Ext.data.Store}'s
- * {@link Ext.data.Store#sortInfo sortInfo} property</li>
- * <li>any custom properties needed</li>
- * </ul></div>
- *
- * @constructor
- * Create a new JsonReader
- * @param {Object} meta Metadata configuration options.
- * @param {Array/Object} recordType
- * <p>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}.</p>
- */
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 <tt>id</tt>
- */
- /**
- * @cfg {String} successProperty [success] Name of the property from which to
- * retrieve the success attribute. Defaults to <tt>success</tt>. 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 <tt>total</tt>.
- */
- /**
- * @cfg {String} root [undefined] <b>Required</b>. The name of the property
- * which contains the Array of row objects. Defaults to <tt>undefined</tt>.
- * 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',
@@ -40625,18 +26108,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 <b><tt>metaData</tt></b> 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);
@@ -40646,16 +26119,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) {
@@ -40674,7 +26139,7 @@ Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, {
}
}
- // instantiate response object
+
var res = new Ext.data.Response({
action: action,
success: success,
@@ -40683,27 +26148,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);
@@ -40725,15 +26179,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;
@@ -40769,17 +26223,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) {
@@ -40800,13 +26249,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++){
@@ -40818,10 +26261,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;
@@ -40838,53 +26278,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
- * <p>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 <code>mapping</code> property
- * of the field definition if it exists, or the field's ordinal position in the definition.</p>
- * <p>Example code:</p>
- * <pre><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);
-</code></pre>
- * <p>This would consume an Array like this:</p>
- * <pre><code>
-[ [1, 'Bill', 'Gardener'], [2, 'Ben', 'Horticulturalist'] ]
- * </code></pre>
- * @constructor
- * Create a new ArrayReader
- * @param {Object} meta Metadata configuration options.
- * @param {Array/Object} recordType
- * <p>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}.</p>
- */
+
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,
@@ -40934,48 +26333,9 @@ Ext.data.ArrayReader = Ext.extend(Ext.data.JsonReader, {
totalRecords : totalRecords
};
}
-});/**
- * @class Ext.data.ArrayStore
- * @extends Ext.data.Store
- * <p>Formerly known as "SimpleStore".</p>
- * <p>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}.</p>
- * <p>A store configuration would be something like:<pre><code>
-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'}
- ]
});
- * </code></pre></p>
- * <p>This store is configured to consume a returned object of the form:<pre><code>
-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']
-];
- * </code></pre>
- * An object literal of this form could also be used as the {@link #data} config option.</p>
- * <p><b>*Note:</b> Although not listed here, this class accepts all of the configuration options of
- * <b>{@link Ext.data.ArrayReader ArrayReader}</b>.</p>
- * @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)
@@ -40995,157 +26355,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
- * <p>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}.</p>
- * <p>A store configuration would be something like:<pre><code>
-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'}]
-});
- * </code></pre></p>
- * <p>This store is configured to consume a returned object of the form:<pre><code>
-{
- 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)}
- ]
-}
- * </code></pre>
- * An object literal of this form could also be used as the {@link #data} config option.</p>
- * <p><b>*Note:</b> Although not listed here, this class accepts all of the configuration options of
- * <b>{@link Ext.data.JsonReader JsonReader}</b>.</p>
- * @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. <b>Note:</b>
- * this parameter is required </b>only when</b> 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 <b>single record</b>. For requests
- * involving <b>multiple</b> records and <b>NO</b> baseParams, the {@link Ext.data.XmlWriter#root} property can
- * act as the XML document root.
- */
+
documentRoot: 'xrequest',
- /**
- * @cfg {Boolean} forceDocumentRoot [false] Set to <tt>true</tt> 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 <b>multiple</b> records. Each
- * xml-record written to the server will be wrapped in an element named after {@link Ext.data.XmlReader#record} property.
- * eg:
-<code><pre>
-&lt;?xml version="1.0" encoding="UTF-8"?>
-&lt;user>&lt;first>Barney&lt;/first>&lt;/user>
-</code></pre>
- * However, when <b>multiple</b> records are written in a batch-operation, these records must be wrapped in a containing
- * Element.
- * eg:
-<code><pre>
-&lt;?xml version="1.0" encoding="UTF-8"?>
- &lt;records>
- &lt;first>Barney&lt;/first>&lt;/user>
- &lt;records>&lt;first>Barney&lt;/first>&lt;/user>
- &lt;/records>
-</code></pre>
- * Defaults to <tt>records</tt>. Do not confuse the nature of this property with that of {@link #documentRoot}
- */
+
root: 'records',
- /**
- * @cfg {String} xmlVersion [1.0] The <tt>version</tt> written to header of xml documents.
-<code><pre>&lt;?xml version="1.0" encoding="ISO-8859-15"?></pre></code>
- */
+
xmlVersion : '1.0',
- /**
- * @cfg {String} xmlEncoding [ISO-8859-15] The <tt>encoding</tt> written to header of xml documents.
-<code><pre>&lt;?xml version="1.0" encoding="ISO-8859-15"?></pre></code>
- */
+
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.
- * <p>One can easily provide his/her own custom {@link Ext.XTemplate#constructor template-definition} if the default does not suffice.</p>
- * <p>Defaults to:</p>
-<code><pre>
-&lt;?xml version="{version}" encoding="{encoding}"?>
- &lt;tpl if="documentRoot">&lt;{documentRoot}>
- &lt;tpl for="baseParams">
- &lt;tpl for=".">
- &lt;{name}>{value}&lt;/{name}>
- &lt;/tpl>
- &lt;/tpl>
- &lt;tpl if="records.length &gt; 1">&lt;{root}>',
- &lt;tpl for="records">
- &lt;{parent.record}>
- &lt;tpl for=".">
- &lt;{name}>{value}&lt;/{name}>
- &lt;/tpl>
- &lt;/{parent.record}>
- &lt;/tpl>
- &lt;tpl if="records.length &gt; 1">&lt;/{root}>&lt;/tpl>
- &lt;tpl if="documentRoot">&lt;/{documentRoot}>&lt;/tpl>
-</pre></code>
- * <p>Templates will be called with the following API</p>
- * <ul>
- * <li>{String} version [1.0] The xml version.</li>
- * <li>{String} encoding [ISO-8859-15] The xml encoding.</li>
- * <li>{String/false} documentRoot The XML document root-node name or <tt>false</tt> if not required. See {@link #documentRoot} and {@link #forceDocumentRoot}.</li>
- * <li>{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.</li>
- * <li>{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 <b>multiple</b> records to the server.</li>
- * <li>{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:
- * <ul>
- * <li>{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.</li>
- * <li>{Mixed} value The record value of the field enclosed within XML tags specified by name property above.</li>
- * </ul></li>
- * <li>{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 <b>records</b> parameter above. See {@link #documentRoot} and {@link #forceDocumentRoot}.</li>
- * </ul>
- */
- // Encoding the ? here in case it's being included by some kind of page that will parse it (eg. PHP)
+
+
tpl: '<tpl for="."><\u003fxml version="{version}" encoding="{encoding}"\u003f><tpl if="documentRoot"><{documentRoot}><tpl for="baseParams"><tpl for="."><{name}>{value}</{name}></tpl></tpl></tpl><tpl if="records.length&gt;1"><{root}></tpl><tpl for="records"><{parent.record}><tpl for="."><{name}>{value}</{name}></tpl></{parent.record}></tpl><tpl if="records.length&gt;1"></{root}></tpl><tpl if="documentRoot"></{documentRoot}></tpl></tpl>',
- /**
- * 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({
@@ -41159,94 +26402,28 @@ Ext.extend(Ext.data.XmlWriter, Ext.data.DataWriter, {
});
},
- /**
- * createRecord
- * @protected
- * @param {Ext.data.Record} rec
- * @return {Array} Array of <tt>name:value</tt> 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
- * <p>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.</p>
- * <p><b>Note</b>: 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".</p>
- * <p>Example code:</p>
- * <pre><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);
-</code></pre>
- * <p>
- * This would consume an XML file like this:
- * <pre><code>
-&lt;?xml version="1.0" encoding="UTF-8"?>
-&lt;dataset>
- &lt;results>2&lt;/results>
- &lt;row>
- &lt;id>1&lt;/id>
- &lt;name>Bill&lt;/name>
- &lt;occupation>Gardener&lt;/occupation>
- &lt;/row>
- &lt;row>
- &lt;id>2&lt;/id>
- &lt;name>Ben&lt;/name>
- &lt;occupation>Horticulturalist&lt;/occupation>
- &lt;/row>
-&lt;/dataset>
-</code></pre>
- * @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
@@ -41255,13 +26432,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 <tt>responseXML</tt> 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) {
@@ -41270,17 +26441,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,
@@ -41295,9 +26458,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,
@@ -41305,18 +26468,13 @@ 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,
root = doc.documentElement || doc;
- // create general Response instance.
+
var res = new Ext.data.Response({
action: action,
success : this.getSuccess(root),
@@ -41329,7 +26487,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)) {
@@ -41346,11 +26504,7 @@ Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, {
return true;
},
- /**
- * build response-data extractor functions.
- * @private
- * @ignore
- */
+
buildExtractors : function() {
if(this.ef){
return;
@@ -41391,13 +26545,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) {
@@ -41426,14 +26574,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++){
@@ -41443,101 +26584,26 @@ Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, {
}
return values;
}
-});/**
- * @class Ext.data.XmlStore
- * @extends Ext.data.Store
- * <p>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}.</p>
- * <p>A store configuration would be something like:<pre><code>
-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'
- ]
});
- * </code></pre></p>
- * <p>This store is configured to consume a returned object of the form:<pre><code>
-&#60?xml version="1.0" encoding="UTF-8"?>
-&#60ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2009-05-15">
- &#60Items>
- &#60Request>
- &#60IsValid>True&#60/IsValid>
- &#60ItemSearchRequest>
- &#60Author>Sidney Sheldon&#60/Author>
- &#60SearchIndex>Books&#60/SearchIndex>
- &#60/ItemSearchRequest>
- &#60/Request>
- &#60TotalResults>203&#60/TotalResults>
- &#60TotalPages>21&#60/TotalPages>
- &#60Item>
- &#60ASIN>0446355453&#60/ASIN>
- &#60DetailPageURL>
- http://www.amazon.com/
- &#60/DetailPageURL>
- &#60ItemAttributes>
- &#60Author>Sidney Sheldon&#60/Author>
- &#60Manufacturer>Warner Books&#60/Manufacturer>
- &#60ProductGroup>Book&#60/ProductGroup>
- &#60Title>Master of the Game&#60/Title>
- &#60/ItemAttributes>
- &#60/Item>
- &#60/Items>
-&#60/ItemSearchResponse>
- * </code></pre>
- * An object literal of this form could also be used as the {@link #data} config option.</p>
- * <p><b>Note:</b> Although not listed here, this class accepts all of the configuration options of
- * <b>{@link Ext.data.XmlReader XmlReader}</b>.</p>
- * @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: []};
@@ -41546,7 +26612,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,
@@ -41554,7 +26620,7 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, {
});
}
- //add the sorting sorter object if it is present
+
if (sortInfo) {
sorters.push(sortInfo);
}
@@ -41562,45 +26628,23 @@ 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,
- /**
- * @cfg {String} groupDir
- * The direction to sort the groups. Defaults to <tt>'ASC'</tt>.
- */
+
groupDir : 'ASC',
- /**
- * Clears any existing grouping and refreshes the data using the default sort.
- */
+
clearGrouping : function(){
this.groupField = false;
@@ -41622,21 +26666,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
+
+
var sorters = this.multiSortInfo.sorters;
if (sorters.length > 0 && sorters[0].field == this.groupField) {
sorters.shift();
@@ -41665,8 +26704,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);
@@ -41674,16 +26713,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 ? [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;
@@ -41692,7 +26731,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;
@@ -41705,7 +26744,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});
}
@@ -41713,11 +26752,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){
@@ -41733,17 +26768,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);
@@ -41756,22 +26787,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'){
@@ -41781,62 +26804,26 @@ Ext.data.DirectProxy = function(config){
};
Ext.extend(Ext.data.DirectProxy, Ext.data.DataProxy, {
- /**
- * @cfg {Array/String} paramOrder Defaults to <tt>undefined</tt>. 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:<pre><code>
-paramOrder: ['param1','param2','param3']
-paramOrder: 'param1 param2 param3'
-paramOrder: 'param1,param2,param3'
-paramOrder: 'param1|param2|param'
- </code></pre>
- */
+
paramOrder: undefined,
- /**
- * @cfg {Boolean} paramsAsHash
- * Send parameters as a collection of named arguments (defaults to <tt>true</tt>). Providing a
- * <tt>{@link #paramOrder}</tt> 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
- * <div class="sub-desc"><p>A function to be called after the request.
- * The <tt>callback</tt> is passed the following arguments:<ul>
- * <li><tt>r</tt> : Ext.data.Record[] The block of Ext.data.Records.</li>
- * <li><tt>options</tt>: Options object from the action request</li>
- * <li><tt>success</tt>: Boolean success indicator</li></ul></p></div>
- * @param {Object} scope The scope (<code>this</code> 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++){
@@ -41848,10 +26835,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;
}
@@ -41869,12 +26856,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);
}
@@ -41890,21 +26877,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);
@@ -41914,15 +26894,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);
@@ -41935,44 +26907,10 @@ paramOrder: 'param1|param2|param'
trans.request.callback.call(trans.request.scope, data, res, success);
}
});
-/**
- * @class Ext.data.DirectStore
- * @extends Ext.data.Store
- * <p>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.</p>
- *
- * <p><b>*Note:</b> Although they are not listed, this class inherits all of the config options of:</p>
- * <div><ul class="mdetail-params">
- * <li><b>{@link Ext.data.Store Store}</b></li>
- * <div class="sub-desc"><ul class="mdetail-params">
- *
- * </ul></div>
- * <li><b>{@link Ext.data.JsonReader JsonReader}</b></li>
- * <div class="sub-desc"><ul class="mdetail-params">
- * <li><tt><b>{@link Ext.data.JsonReader#root root}</b></tt></li>
- * <li><tt><b>{@link Ext.data.JsonReader#idProperty idProperty}</b></tt></li>
- * <li><tt><b>{@link Ext.data.JsonReader#totalProperty totalProperty}</b></tt></li>
- * </ul></div>
- *
- * <li><b>{@link Ext.data.DirectProxy DirectProxy}</b></li>
- * <div class="sub-desc"><ul class="mdetail-params">
- * <li><tt><b>{@link Ext.data.DirectProxy#directFn directFn}</b></tt></li>
- * <li><tt><b>{@link Ext.data.DirectProxy#paramOrder paramOrder}</b></tt></li>
- * <li><tt><b>{@link Ext.data.DirectProxy#paramsAsHash paramsAsHash}</b></tt></li>
- * </ul></div>
- * </ul></div>
- *
- * @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);
@@ -41983,86 +26921,11 @@ Ext.data.DirectStore = Ext.extend(Ext.data.Store, {
}
});
Ext.reg('directstore', Ext.data.DirectStore);
-/**
- * @class Ext.Direct
- * @extends Ext.util.Observable
- * <p><b><u>Overview</u></b></p>
- *
- * <p>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).</p>
- *
- * <p>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.</p>
- *
- * <p><b><u>Specification</u></b></p>
- *
- * <p>For additional information consult the
- * <a href="http://extjs.com/products/extjs/direct.php">Ext.Direct Specification</a>.</p>
- *
- * <p><b><u>Providers</u></b></p>
- *
- * <p>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:</p><div class="mdetail-params"><ul>
- *
- * <li>{@link Ext.direct.JsonProvider JsonProvider} for simple JSON operations</li>
- * <li>{@link Ext.direct.PollingProvider PollingProvider} for repeated requests</li>
- * <li>{@link Ext.direct.RemotingProvider RemotingProvider} exposes server side
- * on the client.</li>
- * </ul></div>
- *
- * <p>A provider does not need to be invoked directly, providers are added via
- * {@link Ext.Direct}.{@link Ext.Direct#add add}.</p>
- *
- * <p><b><u>Router</u></b></p>
- *
- * <p>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.</p>
- *
- * <p><b><u>Server side events</u></b></p>
- *
- * <p>Custom events from the server may be handled by the client by adding
- * listeners, for example:</p>
- * <pre><code>
-{"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('&lt;p>&lt;i>{0}&lt;/i>&lt;/p>', e.data));
- out.el.scrollTo('t', 100000, true);
-});
- * </code></pre>
- * @singleton
- */
Ext.Direct = Ext.extend(Ext.util.Observable, {
- /**
- * Each event type implements a getData() method. The default event types are:
- * <div class="mdetail-params"><ul>
- * <li><b><tt>event</tt></b> : Ext.Direct.Event</li>
- * <li><b><tt>exception</tt></b> : Ext.Direct.ExceptionEvent</li>
- * <li><b><tt>rpc</tt></b> : Ext.Direct.RemotingEvent</li>
- * </ul></div>
- * @property eventTypes
- * @type Object
- */
- /**
- * Four types of possible exceptions which can occur:
- * <div class="mdetail-params"><ul>
- * <li><b><tt>Ext.Direct.exceptions.TRANSPORT</tt></b> : 'xhr'</li>
- * <li><b><tt>Ext.Direct.exceptions.PARSE</tt></b> : 'parse'</li>
- * <li><b><tt>Ext.Direct.exceptions.LOGIN</tt></b> : 'login'</li>
- * <li><b><tt>Ext.Direct.exceptions.SERVER</tt></b> : 'exception'</li>
- * </ul></div>
- * @property exceptions
- * @type Object
- */
+
+
exceptions: {
TRANSPORT: 'xhr',
PARSE: 'parse',
@@ -42070,65 +26933,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.
- * <pre><code>
-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
-);
- * </code></pre>
- * @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){
@@ -42138,7 +26955,7 @@ Ext.Direct.addProvider(
return;
}
- // if provider has not already been instantiated
+
if(!provider.events){
provider = new Ext.Direct.PROVIDERS[provider.type](provider);
}
@@ -42156,12 +26973,7 @@ Ext.Direct.addProvider(
return provider;
},
- /**
- * Retrieve a {@link Ext.direct.Provider provider} by the
- * <b><tt>{@link Ext.direct.Provider#id id}</tt></b> 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];
},
@@ -42207,17 +27019,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
- * <p>Supporting Class for Ext.Direct (not intended to be used directly).</p>
- * @constructor
- * @param {Object} config
- */
+Ext.Direct.PROVIDERS = {};
Ext.Direct.Transaction = function(config){
Ext.apply(this, config);
this.tid = ++Ext.Direct.TID;
@@ -42264,114 +27070,43 @@ Ext.Direct.eventTypes = {
'event': Ext.Direct.Event,
'exception': Ext.Direct.ExceptionEvent
};
-/**
- * @class Ext.direct.Provider
- * @extends Ext.util.Observable
- * <p>Ext.direct.Provider is an abstract class meant to be extended.</p>
- *
- * <p>For example ExtJs implements the following subclasses:</p>
- * <pre><code>
-Provider
-|
-+---{@link Ext.direct.JsonProvider JsonProvider}
- |
- +---{@link Ext.direct.PollingProvider PollingProvider}
- |
- +---{@link Ext.direct.RemotingProvider RemotingProvider}
- * </code></pre>
- * @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:
- * <pre><code>
-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();
- * </code></pre>
- */
-
- /**
- * @cfg {Number} priority
- * Priority of the request. Lower is higher priority, <tt>0</tt> means "duplex" (always on).
- * All Providers default to <tt>1</tt> except for PollingProvider which defaults to <tt>3</tt>.
- */
+
+Ext.direct.Provider = Ext.extend(Ext.util.Observable, {
+
+
+
priority: 1,
- /**
- * @cfg {String} type
- * <b>Required</b>, <tt>undefined</tt> by default. The <tt>type</tt> of provider specified
- * to {@link Ext.Direct Ext.Direct}.{@link Ext.Direct#addProvider addProvider} to create a
- * new Provider. Acceptable values by default are:<div class="mdetail-params"><ul>
- * <li><b><tt>polling</tt></b> : {@link Ext.direct.PollingProvider PollingProvider}</li>
- * <li><b><tt>remoting</tt></b> : {@link Ext.direct.RemotingProvider RemotingProvider}</li>
- * </ul></div>
- */
-
- // 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)){
@@ -42406,92 +27141,36 @@ Ext.direct.JsonProvider = Ext.extend(Ext.direct.Provider, {
}
return events;
}
-});/**
- * @class Ext.direct.PollingProvider
- * @extends Ext.direct.JsonProvider
- *
- * <p>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.</p>
- *
- * <p>All configurations for the PollingProvider should be generated by the server-side
- * API portion of the Ext.Direct stack.</p>
- *
- * <p>An instance of PollingProvider may be created directly via the new keyword or by simply
- * specifying <tt>type = 'polling'</tt>. For example:</p>
- * <pre><code>
-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');
- * </code></pre>
- */
Ext.direct.PollingProvider = Ext.extend(Ext.direct.JsonProvider, {
- /**
- * @cfg {Number} priority
- * Priority of the request (defaults to <tt>3</tt>). 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 <tt>3000</tt> - 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}
- */
+
+ 'beforepoll',
+
'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({
@@ -42518,10 +27197,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);
@@ -42530,7 +27206,7 @@ Ext.direct.PollingProvider = Ext.extend(Ext.direct.JsonProvider, {
}
},
- // private
+
onData: function(opt, success, xhr){
if(success){
var events = this.getEvents(xhr);
@@ -42550,135 +27226,31 @@ Ext.direct.PollingProvider = Ext.extend(Ext.direct.JsonProvider, {
}
});
-Ext.Direct.PROVIDERS['polling'] = Ext.direct.PollingProvider;/**
- * @class Ext.direct.RemotingProvider
- * @extends Ext.direct.JsonProvider
- *
- * <p>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).</p>
- *
- * <p>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.</p>
- *
- * <p>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.</p>
- */
-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:
- * <pre><code>
-"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
- }]
-}
- * </code></pre>
- * <p>Note that a Store is not required, a server method can be called at any time.
- * In the following example a <b>client side</b> handler is used to call the
- * server side method "multiply" in the server-side "TestAction" Class:</p>
- * <pre><code>
-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
- }
- }
-);
- * </code></pre>
- * 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 <tt>result</tt> in the example above.
- */
-
- /**
- * @cfg {String/Object} namespace
- * Namespace for the Remoting Provider (defaults to the browser global scope of <i>window</i>).
- * Explicitly specify the namespace Object, or specify a String to have a
- * {@link Ext#namespace namespace created} implicitly.
- */
-
- /**
- * @cfg {String} url
- * <b>Required<b>. 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 <tt>'data'</tt>.
- */
-
- /**
- * @cfg {Number/Boolean} enableBuffer
- * <p><tt>true</tt> or <tt>false</tt> 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 <tt>10</tt>).</p>
- * <br><p>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.</p>
- */
+Ext.Direct.PROVIDERS['polling'] = Ext.direct.PollingProvider;
+Ext.direct.RemotingProvider = Ext.extend(Ext.direct.JsonProvider, {
+
+
+
+
+
+
+
+
+
enableBuffer: 10,
-
- /**
- * @cfg {Number} maxRetries
- * Number of times to re-attempt delivery on failure of a call. Defaults to <tt>1</tt>.
- */
+
+
maxRetries: 1,
-
- /**
- * @cfg {Number} timeout
- * The timeout to use for each request. Defaults to <tt>undefined</tt>.
- */
+
+
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
- * @param {Object} meta The meta data
- */
- '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
- * @param {Object} meta The meta data
- */
+
+ 'beforecall',
+
'call'
);
this.namespace = (Ext.isString(this.namespace)) ? Ext.ns(this.namespace) : this.namespace || window;
@@ -42686,7 +27258,7 @@ TestAction.multiply(
this.callBuffer = [];
},
- // private
+
initAPI : function(){
var o = this.actions;
for(var c in o){
@@ -42699,7 +27271,7 @@ TestAction.multiply(
}
},
- // inherited
+
isConnected: function(){
return !!this.connected;
},
@@ -42862,9 +27434,9 @@ TestAction.multiply(
extType: 'rpc',
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,
@@ -42874,7 +27446,7 @@ TestAction.multiply(
this.processForm(t);
}
},
-
+
processForm: function(t){
Ext.Ajax.request({
url: this.url,
@@ -42923,46 +27495,7 @@ TestAction.multiply(
}
}
});
-Ext.Direct.PROVIDERS['remoting'] = Ext.direct.RemotingProvider;/**
- * @class Ext.Resizable
- * @extends Ext.util.Observable
- * <p>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), <b>or</b> set wrap:true in your config and
- * the element will be wrapped for you automatically.</p>
- * <p>Here is the list of valid resize handles:</p>
- * <pre>
-Value Description
------- -------------------
- 'n' north
- 's' south
- 'e' east
- 'w' west
- 'nw' northwest
- 'sw' southwest
- 'se' southeast
- 'ne' northeast
- 'all' all
-</pre>
- * <p>Here's an example showing the creation of a typical Resizable:</p>
- * <pre><code>
-var resizer = new Ext.Resizable('element-id', {
- handles: 'all',
- minWidth: 200,
- minHeight: 100,
- maxWidth: 500,
- maxHeight: 400,
- pinned: true
-});
-resizer.on('resize', myHandler);
-</code></pre>
- * <p>To hide a particular handle, set its display to none in CSS, or through script:<br>
- * resizer.east.setDisplayed(false);</p>
- * @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){
@@ -42983,13 +27516,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');
@@ -43000,12 +27527,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';
@@ -43022,7 +27549,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){
@@ -43063,21 +27590,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'
);
@@ -43092,142 +27607,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 <b>added</b> to the
- * resize operation's new size (defaults to <tt>[0, 0]</tt>)
- */
+
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 <tt>'easingOutStrong'</tt>)
- */
+
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 <tt>'all'</tt> or any of <tt>'n s e w ne nw se sw'</tt>.
- */
+
+
handles : false,
- /**
- * @cfg {Boolean} multiDirectional <b>Deprecated</b>. 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 <code>{@link #dynamic}==true</code>). Defaults to <tt>0</tt>.
- */
+
heightIncrement : 0,
- /**
- * @cfg {Number} widthIncrement The increment to snap the width resize in pixels
- * (only applies if <code>{@link #dynamic}==true</code>). Defaults to <tt>0</tt>.
- */
+
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 <tt>''</tt>.
- */
- /**
- * 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: '&#160;'}, Ext.getBody());
@@ -43260,7 +27705,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){
@@ -43269,7 +27714,7 @@ Ext.Resizable = Ext.extend(Ext.util.Observable, {
}
},
- // private
+
onMouseDown : function(handle, e){
if(this.enabled){
e.stopEvent();
@@ -43278,7 +27723,7 @@ Ext.Resizable = Ext.extend(Ext.util.Observable, {
}
},
- // private
+
onMouseUp : function(e){
this.activeHandle = null;
var size = this.resizeElement();
@@ -43289,7 +27734,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;
@@ -43299,11 +27744,11 @@ 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){
+
+
+
+
+ if(Ext.isIE9m){
setTimeout(function(){
if(el.dom.offsetWidth){
var b = el.getSize(true);
@@ -43314,7 +27759,7 @@ Ext.Resizable = Ext.extend(Ext.util.Observable, {
}
},
- // private
+
snap : function(value, inc, min){
if(!inc || !value){
return value;
@@ -43331,45 +27776,7 @@ Ext.Resizable = Ext.extend(Ext.util.Observable, {
return Math.max(min, newValue);
},
- /**
- * <p>Performs resizing of the associated Element. This method is called internally by this
- * class, and should not be called by user code.</p>
- * <p>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.</p>
- * <p>The new area to be resized to is available by examining the state of the {@link #proxy}
- * Element. Example:
-<pre><code>
-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();
-</code></pre>
- */
+
resizeElement : function(){
var box = this.proxy.getBox();
if(this.updateBox){
@@ -43388,7 +27795,7 @@ new Ext.Panel({
return box;
},
- // private
+
constrain : function(v, diff, m, mx){
if(v - diff < m){
diff = v - m;
@@ -43398,16 +27805,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,
@@ -43564,41 +27971,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;
@@ -43629,8 +28026,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'
};
@@ -43638,7 +28035,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}'}
);
@@ -43665,286 +28062,111 @@ 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
- * <p>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.</p>
- * <p>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.</p>
- * <p>By default, Windows will be rendered to document.body. To {@link #constrain} a Window to another element
- * specify {@link Ext.Component#renderTo renderTo}.</p>
- * <p><b>Note:</b> By default, the <code>{@link #closable close}</code> header tool <i>destroys</i> the Window resulting in
- * destruction of any child Components. This makes the Window object, and all its descendants <b>unusable</b>. To enable
- * re-use of a Window, use <b><code>{@link #closeAction closeAction: 'hide'}</code></b>.</p>
- * @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
- * <p>Specifies a Component to receive focus when this Window is focussed.</p>
- * <p>This may be one of:</p><div class="mdetail-params"><ul>
- * <li>The index of a footer Button.</li>
- * <li>The id of a Component.</li>
- * <li>A Component.</li>
- * </ul></div>
- */
- /**
- * @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 <tt>collapsed</tt> 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
- * <p>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).</p>
- * <p>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 <i>{@link Ext.Component#destroy destroy}</i> the Window and its content meaning that
- * it may not be reused.</p>
- * <p>To make closing a Window <i>hide</i> the Window so that it may be reused, set
- * {@link #closeAction} to 'hide'.
- */
+
closable : true,
- /**
- * @cfg {String} closeAction
- * <p>The action to take when the close header tool is clicked:
- * <div class="mdetail-params"><ul>
- * <li><b><code>'{@link #close}'</code></b> : <b>Default</b><div class="sub-desc">
- * {@link #close remove} the window from the DOM and {@link Ext.Component#destroy destroy}
- * it and all descendant Components. The window will <b>not</b> be available to be
- * redisplayed via the {@link #show} method.
- * </div></li>
- * <li><b><code>'{@link #hide}'</code></b> : <div class="sub-desc">
- * {@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.
- * </div></li>
- * </ul></div>
- * <p><b>Note:</b> This setting does not affect the {@link #close} method
- * which will always {@link Ext.Component#destroy destroy} the window. To
- * programatically <i>hide</i> a window, call {@link #hide}.</p>
- */
+
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,
- /**
- * @cfg {Number} showAnimDuration The number of seconds that the window show animation takes if enabled.
- * Defaults to 0.25
- */
+
showAnimDuration: 0.25,
- /**
- * @cfg {Number} hideAnimDuration The number of seconds that the window hide animation takes if enabled.
- * Defaults to 0.25
- */
+
hideAnimDuration: 0.25,
- // 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 <tt>true</tt>). If <tt>true</tt>, 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;
}
@@ -43954,12 +28176,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);
@@ -43967,7 +28189,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: '&#160;'});
@@ -43987,7 +28209,7 @@ Ext.Window = Ext.extend(Ext.Panel, {
}
},
- // private
+
initEvents : function(){
Ext.Window.superclass.initEvents.call(this);
if(this.animateTarget){
@@ -44025,20 +28247,11 @@ Ext.Window = Ext.extend(Ext.Panel, {
},
initDraggable : function(){
- /**
- * <p>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.</p>
- * <p>This has implementations of <code>startDrag</code>, <code>onDrag</code> and <code>endDrag</code>
- * 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.</p>
- * @type Ext.dd.DD
- * @property dd
- */
+
this.dd = new Ext.Window.DD(this);
},
- // private
+
onEsc : function(k, e){
if (this.activeGhost) {
this.unghost();
@@ -44047,7 +28260,7 @@ Ext.Window = Ext.extend(Ext.Panel, {
this[this.closeAction]();
},
- // private
+
beforeDestroy : function(){
if(this.rendered){
this.hide();
@@ -44063,7 +28276,7 @@ Ext.Window = Ext.extend(Ext.Panel, {
Ext.Window.superclass.beforeDestroy.call(this);
},
- // private
+
onDestroy : function(){
if(this.manager){
this.manager.unregister(this);
@@ -44071,7 +28284,7 @@ Ext.Window = Ext.extend(Ext.Panel, {
Ext.Window.superclass.onDestroy.call(this);
},
- // private
+
initTools : function(){
if(this.minimizable){
this.addTool({
@@ -44098,7 +28311,7 @@ Ext.Window = Ext.extend(Ext.Panel, {
}
},
- // private
+
resizerAction : function(){
var box = this.proxy.getBox();
this.proxy.hide();
@@ -44106,22 +28319,22 @@ 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){
+ if(Ext.isIE9m && this.resizer){
this.resizer.syncHandleHeight();
this.el.repaint();
}
},
- // private
+
handleResize : function(box){
var rz = this.resizeBox;
if(rz.x != box.x || rz.y != box.y){
@@ -44137,10 +28350,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,
@@ -44167,16 +28377,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;
@@ -44199,14 +28406,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 (<code>this</code> 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());
@@ -44234,7 +28434,7 @@ Ext.Window = Ext.extend(Ext.Panel, {
return this;
},
- // private
+
afterShow : function(isAnim){
if (this.isDestroyed){
return false;
@@ -44245,7 +28445,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);
}
@@ -44267,7 +28467,7 @@ Ext.Window = Ext.extend(Ext.Panel, {
this.fireEvent('show', this);
},
- // private
+
animShow : function(){
this.proxy.show();
this.proxy.setBox(this.animateTarget.getBox());
@@ -44283,14 +28483,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 (<code>this</code> 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;
@@ -44315,7 +28508,7 @@ Ext.Window = Ext.extend(Ext.Panel, {
return this;
},
- // private
+
afterHide : function(){
this.proxy.hide();
if(this.monitorResize || this.modal || this.constrain || this.constrainHeader){
@@ -44328,7 +28521,7 @@ Ext.Window = Ext.extend(Ext.Panel, {
this.fireEvent('hide', this);
},
- // private
+
animHide : function(){
this.proxy.setOpacity(0.5);
this.proxy.show();
@@ -44344,19 +28537,13 @@ Ext.Window = Ext.extend(Ext.Panel, {
}));
},
- /**
- * Method that is called immediately before the <code>show</code> event is fired.
- * Defaults to <code>Ext.emptyFn</code>.
- */
+
onShow : Ext.emptyFn,
- /**
- * Method that is called immediately before the <code>hide</code> event is fired.
- * Defaults to <code>Ext.emptyFn</code>.
- */
+
onHide : Ext.emptyFn,
- // private
+
onWindowResize : function(){
if(this.maximized){
this.fitContainer();
@@ -44369,7 +28556,7 @@ Ext.Window = Ext.extend(Ext.Panel, {
this.doConstrain();
},
- // private
+
doConstrain : function(){
if(this.constrain || this.constrainHeader){
var offsets;
@@ -44394,7 +28581,7 @@ Ext.Window = Ext.extend(Ext.Panel, {
}
},
- // private - used for dragging
+
ghost : function(cls){
var ghost = this.createGhost(cls);
var box = this.getBox(true);
@@ -44405,7 +28592,7 @@ Ext.Window = Ext.extend(Ext.Panel, {
return ghost;
},
- // private
+
unghost : function(show, matchPosition){
if(!this.activeGhost) {
return;
@@ -44413,7 +28600,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);
}
}
@@ -44425,25 +28612,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;
},
- /**
- * <p>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.<p>
- * <p><b>Note:</b> 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}.</p>
- */
+
close : function(){
if(this.fireEvent('beforeclose', this) !== false){
if(this.hidden){
@@ -44454,18 +28629,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);
@@ -44494,13 +28664,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;
@@ -44532,23 +28696,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);
@@ -44563,28 +28723,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 = {
@@ -44602,21 +28748,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);
@@ -44626,11 +28765,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 <tt>false</tt> to prevent the window from being focused.
- * @return {Ext.Window} this
- */
+
toFront : function(e){
if(this.manager.bringToFront(this)){
if(!e || !e.getTarget().focus){
@@ -44640,12 +28775,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){
@@ -44658,32 +28788,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 = Ext.extend(Ext.dd.DD, {
constructor : function(win){
@@ -44717,23 +28839,18 @@ Ext.Window.DD = Ext.extend(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){
@@ -44749,7 +28866,7 @@ Ext.WindowGroup = function(){
activateLast();
};
- // private
+
var setActiveWin = function(win){
if(win != front){
if(front){
@@ -44762,7 +28879,7 @@ Ext.WindowGroup = function(){
}
};
- // private
+
var activateLast = function(){
for(var i = accessList.length-1; i >=0; --i) {
if(!accessList[i].hidden){
@@ -44770,29 +28887,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,
- /**
- * <p>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.</p>
- * <p>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:</p><code><pre>
-var msgWin = Ext.MessageBox.getDialog();
-MyDesktop.getDesktop().getManager().register(msgWin);
-</pre></code>
- * @param {Window} win The Window to register.
- */
+
register : function(win){
if(win.manager){
win.manager.unregister(win);
@@ -44804,12 +28907,7 @@ MyDesktop.getDesktop().getManager().register(msgWin);
win.on('hide', activateLast);
},
- /**
- * <p>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}.</p>
- * @param {Window} win The Window to unregister.
- */
+
unregister : function(win){
delete win.manager;
delete list[win.id];
@@ -44817,21 +28915,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){
@@ -44842,11 +28931,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());
@@ -44854,9 +28939,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()){
@@ -44865,23 +28948,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 (<code>this</code> 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) {
@@ -44893,12 +28965,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 (<code>this</code> 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"){
@@ -44912,51 +28979,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
- * <p>Utility class for generating different styles of message boxes. The alias Ext.Msg can also be used.<p/>
- * <p>Note that the MessageBox is asynchronous. Unlike a regular JavaScript <code>alert</code> (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 <em>after</em> some user feedback from the MessageBox, you must use a callback function
- * (see the <code>function</code> parameter for {@link #show} for more details).</p>
- * <p>Example usage:</p>
- *<pre><code>
-// 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
-});
-</code></pre>
- * @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()){
@@ -44966,15 +28997,15 @@ Ext.MessageBox = function(){
}
};
- // private
+
var handleHide = function(){
if(opt && opt.cls){
dlg.el.removeClass(opt.cls);
}
- progressBar.reset();
+ progressBar.reset();
};
- // private
+
var handleEsc = function(d, k, e){
if(opt && opt.closable !== false){
dlg.hide();
@@ -44985,7 +29016,7 @@ Ext.MessageBox = function(){
}
};
- // private
+
var updateButtons = function(b){
var width = 0,
cfg;
@@ -45010,14 +29041,11 @@ 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 = [];
-
+
buttons = {};
Ext.each(buttonNames, function(name){
btns.push(buttons[name] = new Ext.Button({
@@ -45086,17 +29114,12 @@ 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 '&amp;#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);
}
- // Append a space here for sizing. In IE, for some reason, it wraps text incorrectly without one in some cases
+
msgEl.update(text ? text + ' ' : '&#160;');
var iw = iconCls != '' ? (iconEl.getWidth() + iconEl.getMargins('lr')) : 0,
@@ -45104,7 +29127,7 @@ Ext.MessageBox = function(){
fw = dlg.getFrameWidth('lr'),
bw = dlg.body.getFrameWidth('lr'),
w;
-
+
w = Math.max(Math.min(opt.width || iw+mw+fw+bw, opt.maxWidth || this.maxWidth),
Math.max(opt.minWidth || this.minWidth, bwidth || 0));
@@ -45114,24 +29137,15 @@ Ext.MessageBox = function(){
if(opt.progress === true || opt.wait === true){
progressBar.setSize(w-iw-fw-bw);
}
- if(Ext.isIE && w == bwidth){
- w += 4; //Add offset when the content width is smaller than the buttons.
+ if(Ext.isIE9m && w == bwidth){
+ w += 4;
}
msgEl.update(text || '&#160;');
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){
@@ -45140,101 +29154,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: <ul>
- * <li><b>animEl</b> : String/Element<div class="sub-desc">An id or Element from which the message box should animate as it
- * opens and closes (defaults to undefined)</div></li>
- * <li><b>buttons</b> : Object/Boolean<div class="sub-desc">A button config object (e.g., Ext.MessageBox.OKCANCEL or {ok:'Foo',
- * cancel:'Bar'}), or false to not show any buttons (defaults to false)</div></li>
- * <li><b>closable</b> : Boolean<div class="sub-desc">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.</div></li>
- * <li><b>cls</b> : String<div class="sub-desc">A custom CSS class to apply to the message box's container element</div></li>
- * <li><b>defaultTextHeight</b> : Number<div class="sub-desc">The default height in pixels of the message box's multiline textarea
- * if displayed (defaults to 75)</div></li>
- * <li><b>fn</b> : Function<div class="sub-desc">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.
- * <p>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:<ul>
- * <li><b>buttonId</b> : String<div class="sub-desc">The ID of the button pressed, one of:<div class="sub-desc"><ul>
- * <li><tt>ok</tt></li>
- * <li><tt>yes</tt></li>
- * <li><tt>no</tt></li>
- * <li><tt>cancel</tt></li>
- * </ul></div></div></li>
- * <li><b>text</b> : String<div class="sub-desc">Value of the input field if either <tt><a href="#show-option-prompt" ext:member="show-option-prompt" ext:cls="Ext.MessageBox">prompt</a></tt>
- * or <tt><a href="#show-option-multiline" ext:member="show-option-multiline" ext:cls="Ext.MessageBox">multiline</a></tt> is true</div></li>
- * <li><b>opt</b> : Object<div class="sub-desc">The config object passed to show.</div></li>
- * </ul></p></div></li>
- * <li><b>scope</b> : Object<div class="sub-desc">The scope of the callback function</div></li>
- * <li><b>icon</b> : String<div class="sub-desc">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 '')</div></li>
- * <li><b>iconCls</b> : String<div class="sub-desc">The standard {@link Ext.Window#iconCls} to
- * add an optional header icon (defaults to '')</div></li>
- * <li><b>maxWidth</b> : Number<div class="sub-desc">The maximum width in pixels of the message box (defaults to 600)</div></li>
- * <li><b>minWidth</b> : Number<div class="sub-desc">The minimum width in pixels of the message box (defaults to 100)</div></li>
- * <li><b>modal</b> : Boolean<div class="sub-desc">False to allow user interaction with the page while the message box is
- * displayed (defaults to true)</div></li>
- * <li><b>msg</b> : String<div class="sub-desc">A string that will replace the existing message box body text (defaults to the
- * XHTML-compliant non-breaking space character '&amp;#160;')</div></li>
- * <li><a id="show-option-multiline"></a><b>multiline</b> : Boolean<div class="sub-desc">
- * True to prompt the user to enter multi-line text (defaults to false)</div></li>
- * <li><b>progress</b> : Boolean<div class="sub-desc">True to display a progress bar (defaults to false)</div></li>
- * <li><b>progressText</b> : String<div class="sub-desc">The text to display inside the progress bar if progress = true (defaults to '')</div></li>
- * <li><a id="show-option-prompt"></a><b>prompt</b> : Boolean<div class="sub-desc">True to prompt the user to enter single-line text (defaults to false)</div></li>
- * <li><b>proxyDrag</b> : Boolean<div class="sub-desc">True to display a lightweight proxy while dragging (defaults to false)</div></li>
- * <li><b>title</b> : String<div class="sub-desc">The title text</div></li>
- * <li><b>value</b> : String<div class="sub-desc">The string value to set into the active textbox element if displayed</div></li>
- * <li><b>wait</b> : Boolean<div class="sub-desc">True to display a progress bar (defaults to false)</div></li>
- * <li><b>waitConfig</b> : Object<div class="sub-desc">A {@link Ext.ProgressBar#waitConfig} object (applies only if wait = true)</div></li>
- * <li><b>width</b> : Number<div class="sub-desc">The width of the dialog in pixels</div></li>
- * </ul>
- * Example usage:
- * <pre><code>
-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
-});
-</code></pre>
- * @return {Ext.MessageBox} this
- */
+
show : function(options){
if(this.isVisible()){
this.hide();
@@ -45291,10 +29231,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();
@@ -45310,20 +29250,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:
- * <pre>
-Ext.MessageBox.INFO
-Ext.MessageBox.WARNING
-Ext.MessageBox.QUESTION
-Ext.MessageBox.ERROR
- *</pre>
- * @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;
@@ -45343,15 +29270,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,
@@ -45365,15 +29284,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,
@@ -45388,17 +29299,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 (<code>this</code> 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,
@@ -45411,17 +29312,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 (<code>this</code> 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,
@@ -45435,20 +29326,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 (<code>this</code> 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,
@@ -45464,86 +29342,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",
@@ -45553,17 +29381,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 = Ext.extend(Object, {
constructor : function(panel, config){
@@ -45572,46 +29391,32 @@ Ext.dd.PanelProxy = Ext.extend(Object, {
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;
},
- /**
- * 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){
@@ -45624,9 +29429,7 @@ Ext.dd.PanelProxy = Ext.extend(Object, {
}
},
- /**
- * Shows the proxy
- */
+
show : function(){
if(!this.ghost){
this.ghost = this.panel.createGhost(this.panel.initialConfig.cls, undefined, Ext.getBody());
@@ -45639,7 +29442,7 @@ Ext.dd.PanelProxy = Ext.extend(Object, {
}
},
- // private
+
repair : function(xy, callback, scope){
this.hide();
if(typeof callback == "function"){
@@ -45647,13 +29450,7 @@ Ext.dd.PanelProxy = Ext.extend(Object, {
}
},
- /**
- * 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);
@@ -45661,7 +29458,7 @@ Ext.dd.PanelProxy = Ext.extend(Object, {
}
});
-// private - DD implementation for Panels
+
Ext.Panel.DD = Ext.extend(Ext.dd.DragSource, {
constructor : function(panel, cfg){
@@ -45707,72 +29504,37 @@ Ext.Panel.DD = Ext.extend(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 <b>typed</b> variables including dates and defines the
- * Provider interface.
- */
+});
Ext.state.Provider = Ext.extend(Ext.util.Observable, {
constructor : 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);
},
- /**
- * 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){
- /**
- * a -> Array
- * n -> Number
- * d -> Date
- * b -> Boolean
- * s -> String
- * o -> Object
- * -> Empty (null)
- */
+
var re = /^(a|n|d|b|s|o|e)\:(.*)$/,
matches = re.exec(unescape(cookie)),
all,
@@ -45780,7 +29542,7 @@ Ext.state.Provider = Ext.extend(Ext.util.Observable, {
v,
kv;
if(!matches || !matches[1]){
- return; // non state cookie
+ return;
}
type = matches[1];
v = matches[2];
@@ -45815,11 +29577,7 @@ Ext.state.Provider = Ext.extend(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,
flat = '',
@@ -45855,106 +29613,51 @@ Ext.state.Provider = Ext.extend(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:
- <pre><code>
-// in your initialization function
-init : function(){
- Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
- var win = new Window(...);
- win.restoreState();
-}
- </code></pre>
- * @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.
- * <br />Usage:
- <pre><code>
- 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);
- </code></pre>
- * @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 = Ext.extend(Ext.state.Provider, {
constructor : 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);
this.state = this.readCookies();
},
- // private
+
set : function(name, value){
if(typeof value == "undefined" || value === null){
this.clear(name);
@@ -45964,18 +29667,18 @@ Ext.state.CookieProvider = Ext.extend(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 = {},
c = document.cookie + ";",
re = /\s?(.*?)=(.*?);/g,
- matches,
+ matches,
name,
value;
while((matches = re.exec(c)) != null){
@@ -45988,7 +29691,7 @@ Ext.state.CookieProvider = Ext.extend(Ext.state.Provider, {
return cookies;
},
- // private
+
setCookie : function(name, value){
document.cookie = "ys-"+ name + "=" + this.encodeValue(value) +
((this.expires == null) ? "" : ("; expires=" + this.expires.toGMTString())) +
@@ -45997,142 +29700,40 @@ Ext.state.CookieProvider = Ext.extend(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. <b>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.</b>
- *
- * <p>The example below binds a DataView to a {@link Ext.data.Store} and renders it into an {@link Ext.Panel}.</p>
- * <pre><code>
-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(
- '&lt;tpl for="."&gt;',
- '&lt;div class="thumb-wrap" id="{name}"&gt;',
- '&lt;div class="thumb"&gt;&lt;img src="{url}" title="{name}"&gt;&lt;/div&gt;',
- '&lt;span class="x-editable"&gt;{shortName}&lt;/span&gt;&lt;/div&gt;',
- '&lt;/tpl&gt;',
- '&lt;div class="x-clear"&gt;&lt;/div&gt;'
-);
-
-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);
-</code></pre>
- * @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
- * <b>This is a required setting</b>. A simple CSS selector (e.g. <tt>div.some-class</tt> or
- * <tt>span:first-child</tt>) 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)){
@@ -46140,89 +29741,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"
);
@@ -46231,7 +29769,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, {
this.selected = new Ext.CompositeElementLite();
},
- // private
+
afterRender : function(){
Ext.DataView.superclass.afterRender.call(this);
@@ -46255,9 +29793,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(),
@@ -46281,31 +29817,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;
},
- /**
- * <p>Function which can be overridden which returns the data object passed to this
- * DataView's {@link #tpl template} to render the whole DataView.</p>
- * <p>This is usually an Array of data objects, each element of which is processed by an
- * {@link Ext.XTemplate XTemplate} which uses <tt>'&lt;tpl for="."&gt;'</tt> to iterate over its supplied
- * data object as an Array. However, <i>named</i> properties may be placed into the data object to
- * provide non-repeating data such as headings, totals etc.</p>
- * @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 <i>named</i> properties.
- */
+
collectData : function(records, startIndex){
var r = [],
i = 0,
@@ -46316,14 +29833,14 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, {
return r;
},
- // private
+
bufferRender : function(records, index){
var div = document.createElement('div');
this.tpl.overwrite(div, this.collectData(records, index));
return Ext.query(this.itemSelector, div);
},
- // private
+
onUpdate : function(ds, record){
var index = this.store.indexOf(record);
if(index > -1){
@@ -46340,7 +29857,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, {
}
},
- // private
+
onAdd : function(ds, records, index){
if(this.all.getCount() === 0){
this.refresh();
@@ -46357,7 +29874,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, {
this.updateIndexes(index);
},
- // private
+
onRemove : function(ds, record, index){
this.deselect(index);
this.all.removeElement(index, true);
@@ -46367,15 +29884,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;
@@ -46384,19 +29898,13 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, {
ns[i].viewIndex = i;
}
},
-
- /**
- * 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){
@@ -46431,26 +29939,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()),
index;
@@ -46470,7 +29971,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, {
this.clearSelections();
},
- // private
+
onContextMenu : function(e){
var item = e.getTarget(this.itemSelector, this.getTemplateTarget());
if(item){
@@ -46480,7 +29981,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, {
}
},
- // private
+
onDblClick : function(e){
var item = e.getTarget(this.itemSelector, this.getTemplateTarget());
if(item){
@@ -46488,7 +29989,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, {
}
},
- // private
+
onMouseOver : function(e){
var item = e.getTarget(this.itemSelector, this.getTemplateTarget());
if(item && item !== this.lastItem){
@@ -46498,7 +29999,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, {
}
},
- // private
+
onMouseOut : function(e){
if(this.lastItem){
if(!e.within(this.lastItem, true, true)){
@@ -46509,7 +30010,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, {
}
},
- // private
+
onItemClick : function(item, index, e){
if(this.fireEvent("beforeclick", this, index, item, e) === false){
return false;
@@ -46524,7 +30025,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, {
return true;
},
- // private
+
doSingleSelection : function(item, index, e){
if(e.ctrlKey && this.isSelected(index)){
this.deselect(index);
@@ -46533,12 +30034,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);
@@ -46548,26 +30049,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 = [],
selected = this.selected.elements,
@@ -46580,19 +30072,12 @@ 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(){
return this.getRecords(this.selected.elements);
},
- /**
- * 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 records = [],
i = 0,
@@ -46604,19 +30089,12 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, {
return records;
},
- /**
- * 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){
@@ -46630,19 +30108,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);
@@ -46655,13 +30126,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){
@@ -46691,12 +30156,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);
@@ -46704,12 +30164,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);
@@ -46722,12 +30177,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,
nodes = [],
@@ -46747,12 +30197,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)){
@@ -46761,7 +30206,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, {
return this.all.indexOf(node);
},
- // private
+
onBeforeLoad : function(){
if(this.loadingText){
this.clearSelections(false, true);
@@ -46778,202 +30223,32 @@ 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
- * <p>Ext.list.ListView is a fast and light-weight implentation of a
- * {@link Ext.grid.GridPanel Grid} like view with the following characteristics:</p>
- * <div class="mdetail-params"><ul>
- * <li>resizable columns</li>
- * <li>selectable</li>
- * <li>column widths are initially proportioned by percentage based on the container
- * width and number of columns</li>
- * <li>uses templates to render the data in any required format</li>
- * <li>no horizontal scrolling</li>
- * <li>no editing</li>
- * </ul></div>
- * <p>Example usage:</p>
- * <pre><code>
-// 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 <i>(0 items selected)</i>',
- 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 <i>('+l+' item'+s+' selected)</i>');
-});
- * </code></pre>
- * @constructor
- * @param {Object} config
- * @xtype listview
- */
Ext.list.ListView = Ext.extend(Ext.DataView, {
- /**
- * Set this property to <tt>true</tt> to disable the header click handler disabling sort
- * (defaults to <tt>false</tt>).
- * @type Boolean
- * @property disableHeaders
- */
- /**
- * @cfg {Boolean} hideHeaders
- * <tt>true</tt> to hide the {@link #internalTpl header row} (defaults to <tt>false</tt> so
- * the {@link #internalTpl header row} will be shown).
- */
- /**
- * @cfg {String} itemSelector
- * Defaults to <tt>'dl'</tt> to work with the preconfigured <b><tt>{@link Ext.DataView#tpl tpl}</tt></b>.
- * This setting specifies the CSS selector (e.g. <tt>div.some-class</tt> or <tt>span:first-child</tt>)
- * 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
- * <tt>'x-list-selected'</tt>). An example overriding the default styling:
- <pre><code>
- .x-list-selected {background-color: yellow;}
- </code></pre>
- * @type String
- */
+
selectedClass:'x-list-selected',
- /**
- * @cfg {String} overClass The CSS class applied when over a row (defaults to
- * <tt>'x-list-over'</tt>). An example overriding the default styling:
- <pre><code>
- .x-list-over {background-color: orange;}
- </code></pre>
- * @type String
- */
+
overClass:'x-list-over',
- /**
- * @cfg {Boolean} reserveScrollOffset
- * By default will defer accounting for the configured <b><tt>{@link #scrollOffset}</tt></b>
- * for 10 milliseconds. Specify <tt>true</tt> to account for the configured
- * <b><tt>{@link #scrollOffset}</tt></b> immediately.
- */
- /**
- * @cfg {Number} scrollOffset The amount of space to reserve for the scrollbar (defaults to
- * <tt>undefined</tt>). If an explicit value isn't specified, this will be automatically
- * calculated.
- */
+
+
scrollOffset : undefined,
- /**
- * @cfg {Boolean/Object} columnResize
- * Specify <tt>true</tt> or specify a configuration object for {@link Ext.list.ListView.ColumnResizer}
- * to enable the columns to be resizable (defaults to <tt>true</tt>).
- */
+
columnResize: true,
- /**
- * @cfg {Array} columns An array of column configuration objects, for example:
- * <pre><code>
-{
- align: 'right',
- dataIndex: 'size',
- header: 'Size',
- tpl: '{size:fileSize}',
- width: .35
-}
- * </code></pre>
- * Acceptable properties for each column configuration object are:
- * <div class="mdetail-params"><ul>
- * <li><b><tt>align</tt></b> : String<div class="sub-desc">Set the CSS text-align property
- * of the column. Defaults to <tt>'left'</tt>.</div></li>
- * <li><b><tt>dataIndex</tt></b> : String<div class="sub-desc">See {@link Ext.grid.Column}.
- * {@link Ext.grid.Column#dataIndex dataIndex} for details.</div></li>
- * <li><b><tt>header</tt></b> : String<div class="sub-desc">See {@link Ext.grid.Column}.
- * {@link Ext.grid.Column#header header} for details.</div></li>
- * <li><b><tt>tpl</tt></b> : String<div class="sub-desc">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>.</div></li>
- * <li><b><tt>width</tt></b> : Number<div class="sub-desc">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.</div></li>
- * </ul></div>
- */
- /**
- * @cfg {Boolean/Object} columnSort
- * Specify <tt>true</tt> or specify a configuration object for {@link Ext.list.ListView.Sorter}
- * to enable the columns to be sortable (defaults to <tt>true</tt>).
- */
+
+
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.
- */
- maxColumnWidth: Ext.isIE ? 99 : 100,
+
+
+ maxColumnWidth: Ext.isIE9m ? 99 : 100,
initComponent : function(){
if(this.columnResize){
@@ -46988,7 +30263,7 @@ Ext.list.ListView = Ext.extend(Ext.DataView, {
this.internalTpl = new Ext.XTemplate(
'<div class="x-list-header"><div class="x-list-header-inner">',
'<tpl for="columns">',
- '<div style="width:{[values.width*100]}%;text-align:{align};"><em unselectable="on" id="',this.id, '-xlhd-{#}">',
+ '<div style="width:{[values.width*100]}%;text-align:{align};"><em class="x-unselectable" unselectable="on" id="',this.id, '-xlhd-{#}">',
'{header}',
'</em></div>',
'</tpl>',
@@ -47038,7 +30313,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.maxColumnWidth){
@@ -47074,20 +30349,7 @@ Ext.list.ListView = Ext.extend(Ext.DataView, {
return this.innerBody;
},
- /**
- * <p>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:</p>
- * <div class="mdetail-params"><ul>
- * <li><b>columns</b> : String<div class="sub-desc">See <tt>{@link #columns}</tt></div></li>
- * <li><b>rows</b> : String<div class="sub-desc">See
- * <tt>{@link Ext.DataView}.{@link Ext.DataView#collectData collectData}</div></li>
- * </ul></div>
- * @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 {
@@ -47102,7 +30364,7 @@ Ext.list.ListView = Ext.extend(Ext.DataView, {
}
},
- // private
+
onResize : function(w, h){
var body = this.innerBody.dom,
header = this.innerHd.dom,
@@ -47166,64 +30428,27 @@ 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
- * <p>This class encapsulates column configuration data to be used in the initialization of a
- * {@link Ext.list.ListView ListView}.</p>
- * <p>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.</p>
- */
+
+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 <code>isColumn</code> 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 <tt>'left'</tt>.
- */
+
+
align: 'left',
- /**
- * @cfg {String} header Optional. The header text to be used as innerHTML
- * (html tags are accepted) to display in the ListView. <b>Note</b>: to
- * have a clickable header with no text displayed use <tt>'&#160;'</tt>.
- */
+
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 <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 + '}');
@@ -47231,78 +30456,48 @@ Ext.list.Column = Ext.extend(Object, {
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) + '")}');
+ 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) + '")}');
+ 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>'&#160;'</tt>).
- */
+
undefinedText: '&#160;',
-
+
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){
@@ -47313,22 +30508,14 @@ Ext.list.BooleanColumn = Ext.extend(Ext.list.Column, {
}
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
- */
+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 <tt>.05</tt>)
- */
+
minPct: .05,
constructor: function(config){
@@ -47403,7 +30590,7 @@ Ext.list.ColumnResizer = Ext.extend(Ext.util.Observable, {
},
- // Sets up the boundaries for the drag/drop operation
+
setBoundaries: function(relativeX){
var view = this.view,
headerIndex = this.headerIndex,
@@ -47425,10 +30612,10 @@ Ext.list.ColumnResizer = Ext.extend(Ext.util.Observable, {
this.minX = headers.item(headerIndex).getX() + minWidth;
this.maxX = header ? header.getX() - minWidth : maxX;
if (headerIndex == 0) {
- // First
+
this.minX = minX;
} else if (headerIndex == numColumns - 2) {
- // Last
+
this.maxX = maxX;
}
}
@@ -47442,7 +30629,7 @@ Ext.list.ColumnResizer = Ext.extend(Ext.util.Observable, {
},
onEnd: function(e){
- /* calculate desired width by measuring proxy and then remove it */
+
var newWidth = this.proxy.getWidth(),
index = this.headerIndex,
view = this.view,
@@ -47469,19 +30656,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
- * <p>Supporting Class for Ext.list.ListView</p>
- * @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 <tt>["sort-asc", "sort-desc"]</tt>)
- */
+
sortClasses : ["sort-asc", "sort-desc"],
constructor: function(config){
@@ -47535,292 +30713,71 @@ Ext.list.Sorter = Ext.extend(Ext.util.Observable, {
}
});
-// Backwards compatibility alias
-Ext.ListView.Sorter = Ext.list.Sorter;/**
- * @class Ext.TabPanel
- * <p>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
- * (<tt>{@link Ext.Container#items items}</tt>) that are managed using a
- * {@link Ext.layout.CardLayout CardLayout layout manager}, and displayed as separate tabs.</p>
- *
- * <b>Note:</b> By default, a tab's close tool <i>destroys</i> the child tab Component
- * and all its descendants. This makes the child tab Component, and all its descendants <b>unusable</b>. To enable
- * re-use of a tab, configure the TabPanel with <b><code>{@link #autoDestroy autoDestroy: false}</code></b>.
- *
- * <p><b><u>TabPanel header/footer elements</u></b></p>
- * <p>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}.</p>
- * <p>To display a header, embed the TabPanel in a {@link Ext.Panel Panel} which uses
- * <b><tt>{@link Ext.Container#layout layout:'fit'}</tt></b>.</p>
- *
- * <p><b><u>Tab Events</u></b></p>
- * <p>There is no actual tab class &mdash; 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:</p>
- * <div><ul class="mdetail-params">
- * <li><tt><b>{@link Ext.Panel#activate activate}</b></tt> : Fires when this Component becomes
- * the active tab.</li>
- * <li><tt><b>{@link Ext.Panel#deactivate deactivate}</b></tt> : Fires when the Component that
- * was the active tab becomes deactivated.</li>
- * <li><tt><b>{@link Ext.Panel#beforeclose beforeclose}</b></tt> : Fires when the user clicks on the close tool of a closeable tab.
- * May be vetoed by returning <code>false</code> from a handler.</li>
- * <li><tt><b>{@link Ext.Panel#close close}</b></tt> : Fires a closeable tab has been closed by the user.</li>
- * </ul></div>
- * <p><b><u>Creating TabPanels from Code</u></b></p>
- * <p>TabPanels can be created and rendered completely in code, as in this example:</p>
- * <pre><code>
-var tabs = new Ext.TabPanel({
- renderTo: Ext.getBody(),
- activeTab: 0,
- items: [{
- title: 'Tab 1',
- html: 'A simple tab'
- },{
- title: 'Tab 2',
- html: 'Another one'
- }]
-});
-</code></pre>
- * <p><b><u>Creating TabPanels from Existing Markup</u></b></p>
- * <p>TabPanels can also be rendered from pre-existing markup in a couple of ways.</p>
- * <div><ul class="mdetail-params">
- *
- * <li>Pre-Structured Markup</li>
- * <div class="sub-desc">
- * <p>A container div with one or more nested tab divs with class <tt>'x-tab'</tt> can be rendered entirely
- * from existing markup (See the {@link #autoTabs} example).</p>
- * </div>
- *
- * <li>Un-Structured Markup</li>
- * <div class="sub-desc">
- * <p>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:</p>
- * <pre><code>
-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)
-&lt;div id="my-tabs">&lt;/div>
-&lt;div id="tab1" class="x-hide-display">A simple tab&lt;/div>
-&lt;div id="tab2" class="x-hide-display">Another one&lt;/div>
-</code></pre>
- * Note that the tab divs in this example contain the class <tt>'x-hide-display'</tt> so that they can be rendered
- * deferred without displaying outside the tabs. You could alternately set <tt>{@link #deferredRender} = false </tt>
- * to render all content tabs on page load.
- * </div>
- *
- * </ul></div>
- *
- * @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}.<code>{@link Ext.layout.CardLayout#layoutOnCardChange layoutOnCardChange}</code>.
- */
- /**
- * @cfg {String} tabCls <b>This config option is used on <u>child Components</u> of ths TabPanel.</b> A CSS
- * class name applied to the tab strip item representing the child Component, allowing special
- * styling to be applied.
- */
- /**
- * @cfg {Boolean} deferredRender
- * <p><tt>true</tt> by default to defer the rendering of child <tt>{@link Ext.Container#items items}</tt>
- * to the browsers DOM until a tab is activated. <tt>false</tt> will render all contained
- * <tt>{@link Ext.Container#items items}</tt> 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 <tt>true</tt> might
- * improve performance.</p>
- * <br><p>The <tt>deferredRender</tt> property is internally passed to the layout manager for
- * TabPanels ({@link Ext.layout.CardLayout}) as its {@link Ext.layout.CardLayout#deferredRender}
- * configuration value.</p>
- * <br><p><b>Note</b>: leaving <tt>deferredRender</tt> as <tt>true</tt> 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}.</p>
- */
+
+
+
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 <tt>100</tt>, or if <tt>{@link #resizeTabs} = true</tt>, the calculated tab width). Only
- * applies when <tt>{@link #enableTabScroll} = true</tt>.
- */
+
scrollIncrement : 0,
- /**
- * @cfg {Number} scrollRepeatInterval Number of milliseconds between each scroll while a tab scroll button is
- * continuously pressed (defaults to <tt>400</tt>).
- */
+
scrollRepeatInterval : 400,
- /**
- * @cfg {Float} scrollDuration The number of milliseconds that each scroll animation should last (defaults
- * to <tt>.35</tt>). Only applies when <tt>{@link #animScroll} = true</tt>.
- */
+
scrollDuration : 0.35,
- /**
- * @cfg {Boolean} animScroll True to animate tab scrolling so that hidden tabs slide smoothly into view (defaults
- * to <tt>true</tt>). Only applies when <tt>{@link #enableTabScroll} = true</tt>.
- */
+
animScroll : true,
- /**
- * @cfg {String} tabPosition The position where the tab strip should be rendered (defaults to <tt>'top'</tt>).
- * The only other supported value is <tt>'bottom'</tt>. <b>Note</b>: tab scrolling is only supported for
- * <tt>tabPosition: 'top'</tt>.
- */
+
tabPosition : 'top',
- /**
- * @cfg {String} baseCls The base CSS class applied to the panel (defaults to <tt>'x-tab-panel'</tt>).
- */
+
baseCls : 'x-tab-panel',
- /**
- * @cfg {Boolean} autoTabs
- * <p><tt>true</tt> 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 <tt>false</tt>). 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).</p>
- * <p>This method is only possible when the markup is structured correctly as a container with nested divs
- * containing the class <tt>'x-tab'</tt>. 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.</p>
- * <p>There are a couple of things to note when using this method:<ul>
- * <li>When using the <tt>autoTabs</tt> config (as opposed to passing individual tab configs in the TabPanel's
- * {@link #items} collection), you must use <tt>{@link #applyTo}</tt> to correctly use the specified <tt>id</tt>
- * as the tab container. The <tt>autoTabs</tt> method <em>replaces</em> existing content with the TabPanel
- * components.</li>
- * <li>Make sure that you set <tt>{@link #deferredRender}: false</tt> 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.</li>
- * </ul>Example usage:</p>
- * <pre><code>
-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
-&lt;div id="my-tabs">
- &lt;div class="x-tab" title="Tab 1">A simple tab&lt;/div>
- &lt;div class="x-tab" title="Tab 2">Another one&lt;/div>
-&lt;/div>
-</code></pre>
- */
autoTabs : false,
- /**
- * @cfg {String} autoTabSelector The CSS selector used to search for tabs in existing markup when
- * <tt>{@link #autoTabs} = true</tt> (defaults to <tt>'div.x-tab'</tt>). 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 <tt>{@link #resizeTabs}</tt> or scrolling tabs. (defaults to <tt>2</tt>)
- */
+
tabMargin : 2,
- /**
- * @cfg {Boolean} plain </tt>true</tt> to render the tab strip without a background container image
- * (defaults to <tt>false</tt>).
- */
+
plain : false,
- /**
- * @cfg {Number} wheelIncrement For scrolling tabs, the number of pixels to increment on mouse wheel
- * scrolling (defaults to <tt>20</tt>).
- */
+
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 <tt>return false</tt> 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.
- * <code>layoutConfig</code> may be used to configure this layout manager.
- * <code>{@link #deferredRender}</code> and <code>{@link #layoutOnTabChange}</code>
- * 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
@@ -47839,7 +30796,7 @@ var tabs = new Ext.TabPanel({
this.initItems();
},
- // private
+
onRender : function(ct, position){
Ext.TabPanel.superclass.onRender.call(this, ct, position);
@@ -47857,74 +30814,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: '&#160;'}]});
this.strip.createChild({cls:'x-clear'});
this.body.addClass('x-tab-panel-body-'+this.tabPosition);
- /**
- * @cfg {Template/XTemplate} itemTpl <p>(Optional) A {@link Ext.Template Template} or
- * {@link Ext.XTemplate XTemplate} which may be provided to process the data object returned from
- * <tt>{@link #getTemplateArgs}</tt> to produce a clickable selector element in the tab strip.</p>
- * <p>The main element created should be a <tt>&lt;li></tt> element. In order for a click event on
- * a selector element to be connected to its item, it must take its <i>id</i> from the TabPanel's
- * native <tt>{@link #getTemplateArgs}</tt>.</p>
- * <p>The child element which contains the title text must be marked by the CSS class
- * <tt>x-tab-strip-inner</tt>.</p>
- * <p>To enable closability, the created element should contain an element marked by the CSS class
- * <tt>x-tab-strip-close</tt>.</p>
- * <p>If a custom <tt>itemTpl</tt> is supplied, it is the developer's responsibility to create CSS
- * style rules to create the desired appearance.</p>
- * Below is an example of how to create customized tab selector items:<pre><code>
-new Ext.TabPanel({
- renderTo: document.body,
- minTabWidth: 115,
- tabWidth: 135,
- enableTabScroll: true,
- width: 600,
- height: 250,
- defaults: {autoScroll:true},
- itemTpl: new Ext.XTemplate(
- '&lt;li class="{cls}" id="{id}" style="overflow:hidden">',
- '&lt;tpl if="closable">',
- '&lt;a class="x-tab-strip-close">&lt;/a>',
- '&lt;/tpl>',
- '&lt;a class="x-tab-right" href="#" style="padding-left:6px">',
- '&lt;em class="x-tab-left">',
- '&lt;span class="x-tab-strip-inner">',
- '&lt;img src="{src}" style="float:left;margin:3px 3px 0 0">',
- '&lt;span style="margin-left:20px" class="x-tab-strip-text {iconCls}">{text} {extra}&lt;/span>',
- '&lt;/span>',
- '&lt;/em>',
- '&lt;/a>',
- '&lt;/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'
- }]
-});
-</code></pre>
- */
+
if(!this.itemTpl){
var tt = new Ext.Template(
'<li class="{cls}" id="{id}"><a class="x-tab-strip-close"></a>',
@@ -47940,7 +30836,7 @@ new Ext.TabPanel({
this.items.each(this.initTab, this);
},
- // private
+
afterRender : function(){
Ext.TabPanel.superclass.afterRender.call(this);
if(this.autoTabs){
@@ -47953,7 +30849,7 @@ new Ext.TabPanel({
}
},
- // private
+
initEvents : function(){
Ext.TabPanel.superclass.initEvents.call(this);
this.mon(this.strip, {
@@ -47966,7 +30862,7 @@ new Ext.TabPanel({
}
},
- // private
+
findTargets : function(e){
var item = null,
itemEl = e.getTarget('li:not(.x-tab-edge)', this.strip);
@@ -47988,7 +30884,7 @@ new Ext.TabPanel({
};
},
- // private
+
onStripMouseDown : function(e){
if(e.button !== 0){
return;
@@ -48007,7 +30903,7 @@ new Ext.TabPanel({
}
},
- // private
+
onStripContextMenu : function(e){
e.preventDefault();
var t = this.findTargets(e);
@@ -48016,11 +30912,7 @@ new Ext.TabPanel({
}
},
- /**
- * True to scan the markup in this tab panel for <tt>{@link #autoTabs}</tt> using the
- * <tt>{@link #autoTabSelector}</tt>
- * @param {Boolean} removeExisting True to remove existing tabs
- */
+
readTabs : function(removeExisting){
if(removeExisting === true){
this.items.each(function(item){
@@ -48039,7 +30931,7 @@ new Ext.TabPanel({
}
},
- // private
+
initTab : function(item, index){
var before = this.strip.dom.childNodes[index],
p = this.getTemplateArgs(item),
@@ -48062,7 +30954,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);
@@ -48081,19 +30973,7 @@ new Ext.TabPanel({
- /**
- * <p>Provides template arguments for rendering a tab selector item in the tab strip.</p>
- * <p>This method returns an object hash containing properties used by the TabPanel's <tt>{@link #itemTpl}</tt>
- * to create a formatted, clickable tab selector element. The properties which must be returned
- * are:</p><div class="mdetail-params"><ul>
- * <li><b>id</b> : String<div class="sub-desc">A unique identifier which links to the item</div></li>
- * <li><b>text</b> : String<div class="sub-desc">The text to display</div></li>
- * <li><b>cls</b> : String<div class="sub-desc">The CSS class name</div></li>
- * <li><b>iconCls</b> : String<div class="sub-desc">A CSS class to provide appearance for an icon.</div></li>
- * </ul></div>
- * @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){
@@ -48114,7 +30994,7 @@ new Ext.TabPanel({
};
},
- // private
+
onAdd : function(c){
Ext.TabPanel.superclass.onAdd.call(this, c);
if(this.rendered){
@@ -48124,7 +31004,7 @@ new Ext.TabPanel({
}
},
- // private
+
onBeforeAdd : function(item){
var existing = item.events ? (this.items.containsKey(item.getItemId()) ? item : null) : this.items.get(item);
if(existing){
@@ -48137,10 +31017,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);
@@ -48168,7 +31048,7 @@ new Ext.TabPanel({
}
},
- // private
+
onBeforeShowItem : function(item){
if(item != this.activeTab){
this.setActiveTab(item);
@@ -48176,7 +31056,7 @@ new Ext.TabPanel({
}
},
- // private
+
onItemDisabled : function(item){
var el = this.getTabEl(item);
if(el){
@@ -48185,7 +31065,7 @@ new Ext.TabPanel({
this.stack.remove(item);
},
- // private
+
onItemEnabled : function(item){
var el = this.getTabEl(item);
if(el){
@@ -48193,60 +31073,50 @@ new Ext.TabPanel({
}
},
- // private
+
onItemTitleChanged : function(item){
var el = this.getTabEl(item);
if(el){
Ext.fly(el).child('span.x-tab-strip-text', true).innerHTML = item.title;
+ this.delegateUpdates();
}
},
- //private
+
onItemIconChanged : function(item, iconCls, oldCls){
var el = this.getTabEl(item);
if(el){
el = Ext.get(el);
el.child('span.x-tab-strip-text').replaceClass(oldCls, iconCls);
el[Ext.isEmpty(iconCls) ? 'removeClass' : 'addClass']('x-tab-with-icon');
+ this.delegateUpdates();
}
},
- /**
- * 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);
@@ -48257,10 +31127,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);
@@ -48270,7 +31137,7 @@ new Ext.TabPanel({
}
},
- // private
+
delegateUpdates : function(){
var rendered = this.rendered;
if(this.suspendUpdates){
@@ -48284,18 +31151,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++) {
@@ -48307,7 +31174,7 @@ new Ext.TabPanel({
}
},
- // private
+
adjustBodyWidth : function(w){
if(this.header){
this.header.setWidth(w);
@@ -48318,19 +31185,7 @@ new Ext.TabPanel({
return w;
},
- /**
- * Sets the specified tab as the active tab. This method fires the {@link #beforetabchange} event which
- * can <tt>return false</tt> to cancel the tab change.
- * @param {String/Number} item
- * The id or tab Panel to activate. This parameter may be any of the following:
- * <div><ul class="mdetail-params">
- * <li>a <b><tt>String</tt></b> : representing the <code>{@link Ext.Component#itemId itemId}</code>
- * or <code>{@link Ext.Component#id id}</code> of the child component </li>
- * <li>a <b><tt>Number</tt></b> : representing the position of the child component
- * within the <code>{@link Ext.Container#items items}</code> <b>property</b></li>
- * </ul></div>
- * <p>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){
@@ -48354,7 +31209,7 @@ new Ext.TabPanel({
this.stack.add(item);
this.layout.setActiveItem(item);
- // Need to do this here, since setting the active tab slightly changes the size
+
this.delegateUpdates();
if(this.scrolling){
this.scrollToTab(item, this.animScroll);
@@ -48364,26 +31219,17 @@ new Ext.TabPanel({
}
},
- /**
- * Returns the Component which is the currently active tab. <b>Note that before the TabPanel
- * first activates a child Component, this method will return whatever was configured in the
- * {@link #activeTab} config option.</b>
- * @return {BoxComponent} The currently active child Component if one <i>is</i> 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,
@@ -48395,11 +31241,11 @@ new Ext.TabPanel({
pos = this.getScrollPos(),
l = this.edge.getOffsetsTo(this.stripWrap)[0] + pos;
- if(!this.enableTabScroll || cw < 20){ // 20 to prevent display:none issues
+ if(!this.enableTabScroll || cw < 20){
return;
}
if(count == 0 || l <= tw){
- // ensure the width is set if there's no tabs
+
wd.scrollLeft = 0;
wrap.setWidth(tw);
if(this.scrolling){
@@ -48407,7 +31253,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 = '';
@@ -48416,7 +31262,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';
@@ -48433,21 +31279,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'
});
@@ -48460,7 +31306,7 @@ new Ext.TabPanel({
});
this.scrollLeft = sl;
- // right
+
var sr = this.pos.insertFirst({
cls:'x-tab-scroller-right'
});
@@ -48474,36 +31320,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){
@@ -48521,7 +31363,7 @@ new Ext.TabPanel({
}
},
- // private
+
scrollTo : function(pos, animate){
this.stripWrap.scrollTo('left', pos, animate ? this.getScrollAnim() : false);
if(!animate){
@@ -48543,7 +31385,7 @@ new Ext.TabPanel({
}
},
- // private
+
onScrollRight : function(){
var sw = this.getScrollWidth()-this.getScrollArea(),
pos = this.getScrollPos(),
@@ -48553,7 +31395,7 @@ new Ext.TabPanel({
}
},
- // private
+
onScrollLeft : function(){
var pos = this.getScrollPos(),
s = Math.max(0, pos - this.getScrollIncrement());
@@ -48562,14 +31404,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');
@@ -48577,66 +31419,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 <tt>return false</tt> 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 {
@@ -48662,205 +31463,72 @@ 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:<div class="mdetail-params"><ul>
- * <li><code>b</code> : Button<div class="sub-desc">This Button.</div></li>
- * <li><code>e</code> : EventObject<div class="sub-desc">The click event.</div></li>
- * </ul></div>
- * @cfg {Number} minWidth The minimum width for this button (used to give a set of buttons a common width).
- * See also {@link Ext.Panel}.<tt>{@link Ext.Panel#minButtonWidth minButtonWidth}</tt>.
- * @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:<ul class="mdetail-params">
- * <li><b>button</b> : Ext.Button<div class="sub-desc">this Button object</div></li>
- * <li><b>state</b> : Boolean<div class="sub-desc">The next state of the Button, true means pressed.</div></li>
- * </ul>
- */
- /**
- * @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}.<code>{@link Ext.Toolbar.Item#overflowText overflowText}</code>.
- */
- /**
- * @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 <tt>'click'</tt>.
- */
+
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
- * <p>(Optional) A {@link Ext.DomQuery DomQuery} selector which is used to extract the active, clickable element from the
- * DOM structure created.</p>
- * <p>When a custom {@link #template} is used, you must ensure that this selector results in the selection of
- * a focussable element.</p>
- * <p>Defaults to <b><tt>'button:first-child'</tt></b>.</p>
- */
+
buttonSelector : 'button:first-child',
- /**
- * @cfg {String} scale
- * <p>(Optional) The size of the Button. Three values are allowed:</p>
- * <ul class="mdetail-params">
- * <li>'small'<div class="sub-desc">Results in the button element being 16px high.</div></li>
- * <li>'medium'<div class="sub-desc">Results in the button element being 24px high.</div></li>
- * <li>'large'<div class="sub-desc">Results in the button element being 32px high.</div></li>
- * </ul>
- * <p>Defaults to <b><tt>'small'</tt></b>.</p>
- */
+
scale : 'small',
- /**
- * @cfg {Object} scope The scope (<tt><b>this</b></tt> reference) in which the
- * <code>{@link #handler}</code> and <code>{@link #toggleHandler}</code> is
- * executed. Defaults to this Button.
- */
- /**
- * @cfg {String} iconAlign
- * <p>(Optional) The side of the Button box to render the icon. Four values are allowed:</p>
- * <ul class="mdetail-params">
- * <li>'top'<div class="sub-desc"></div></li>
- * <li>'right'<div class="sub-desc"></div></li>
- * <li>'bottom'<div class="sub-desc"></div></li>
- * <li>'left'<div class="sub-desc"></div></li>
- * </ul>
- * <p>Defaults to <b><tt>'left'</tt></b>.</p>
- */
+
+
iconAlign : 'left',
- /**
- * @cfg {String} arrowAlign
- * <p>(Optional) The side of the Button box to render the arrow if the button has an associated {@link #menu}.
- * Two values are allowed:</p>
- * <ul class="mdetail-params">
- * <li>'right'<div class="sub-desc"></div></li>
- * <li>'bottom'<div class="sub-desc"></div></li>
- * </ul>
- * <p>Defaults to <b><tt>'right'</tt></b>.</p>
- */
+
arrowAlign : 'right',
- /**
- * @cfg {Ext.Template} template (Optional)
- * <p>A {@link Ext.Template Template} used to create the Button's DOM structure.</p>
- * 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.
- */
- /**
- * @cfg {Boolean} autoWidth
- * 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 <tt>undefined</tt>.
- */
+
+
+
+
initComponent : function(){
if(this.menu){
- // If array of items, turn it into an object config so we
- // can set the ownerCt property in the config
+
+
if (Ext.isArray(this.menu)){
this.menu = { items: this.menu };
}
- // An object config will work here, but an instance of a menu
- // will have already setup its ref's and have no effect
+
+
if (Ext.isObject(this.menu)){
this.menu.ownerCt = this;
}
@@ -48872,63 +31540,21 @@ Ext.Button = Ext.extend(Ext.BoxComponent, {
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'
);
@@ -48937,26 +31563,12 @@ Ext.Button = Ext.extend(Ext.BoxComponent, {
}
},
-/**
- * <p>This method returns an Array which provides substitution parameters for the {@link #template Template} used
- * to create this Button's DOM structure.</p>
- * <p>Instances or subclasses which use a different Template to create a different DOM structure may need to provide their
- * own implementation of this method.</p>
- * <p>The default implementation which provides data for the default {@link #template} returns an Array containing the
- * following items:</p><div class="mdetail-params"><ul>
- * <li>The &lt;button&gt;'s {@link #type}</li>
- * <li>A CSS class name applied to the Button's main &lt;tbody&gt; element which determines the button's scale and icon alignment.</li>
- * <li>A CSS class to determine the presence and position of an arrow icon. (<code>'x-btn-arrow'</code> or <code>'x-btn-arrow-bottom'</code> or <code>''</code>)</li>
- * <li>The {@link #cls} CSS class name applied to the button's wrapping &lt;table&gt; element.</li>
- * <li>The Component id which is applied to the button's wrapping &lt;table&gt; element.</li>
- * </ul></div>
- * @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)){
@@ -48967,20 +31579,20 @@ Ext.Button = Ext.extend(Ext.BoxComponent, {
}
},
- // 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(
'<table id="{4}" cellspacing="0" class="x-btn {3}"><tbody class="{1}">',
'<tr><td class="x-btn-tl"><i>&#160;</i></td><td class="x-btn-tc"></td><td class="x-btn-tr"><i>&#160;</i></td></tr>',
- '<tr><td class="x-btn-ml"><i>&#160;</i></td><td class="x-btn-mc"><em class="{2}" unselectable="on"><button type="{0}"></button></em></td><td class="x-btn-mr"><i>&#160;</i></td></tr>',
+ '<tr><td class="x-btn-ml"><i>&#160;</i></td><td class="x-btn-mc"><em class="{2} x-unselectable" unselectable="on"><button type="{0}"></button></em></td><td class="x-btn-mr"><i>&#160;</i></td></tr>',
'<tr><td class="x-btn-bl"><i>&#160;</i></td><td class="x-btn-bc"></td><td class="x-btn-br"><i>&#160;</i></td></tr>',
'</tbody></table>');
Ext.Button.buttonTemplate.compile();
@@ -48995,12 +31607,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 <tt>&lt;button&gt;</tt> element. Read only.
- * @type Ext.Element
- * @property btnEl
- */
+
this.btnEl = btn.child(this.buttonSelector);
this.mon(this.btnEl, {
scope: this,
@@ -49013,7 +31620,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, {
Ext.ButtonToggleMgr.register(this);
},
- // private
+
initButtonEl : function(btn, btnEl){
this.el = btn;
this.setIcon(this.icon);
@@ -49033,8 +31640,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){
@@ -49053,7 +31660,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, {
}
},
- // private
+
afterRender : function(){
Ext.Button.superclass.afterRender.call(this);
this.useSetClass = true;
@@ -49062,12 +31669,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){
@@ -49078,15 +31680,8 @@ Ext.Button = Ext.extend(Ext.BoxComponent, {
return this;
},
- /**
- * Sets the tooltip for this Button.
- * @param {String/Object} tooltip. This may be:<div class="mdesc-details"><ul>
- * <li><b>String</b> : A string to be used as innerHTML (html tags are accepted) to show in a tooltip</li>
- * <li><b>Object</b> : A configuration object for {@link Ext.QuickTips#register}.</li>
- * </ul></div>
- * @return {Ext.Button} this
- */
- setTooltip : function(tooltip, /* private */ initial){
+
+ setTooltip : function(tooltip, initial){
if(this.rendered){
if(!initial){
this.clearTip();
@@ -49105,14 +31700,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();
@@ -49123,7 +31718,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, {
Ext.destroy(this.repeater);
},
- // private
+
onDestroy : function(){
if(this.rendered){
this.doc.un('mouseover', this.monitorMouseOver, this);
@@ -49135,7 +31730,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, {
Ext.Button.superclass.onDestroy.call(this);
},
- // private
+
doAutoWidth : function(){
if(this.autoWidth !== false && this.el && this.text && this.width === undefined){
this.el.setWidth('auto');
@@ -49154,24 +31749,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 (<code>this</code> 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){
@@ -49182,12 +31767,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){
@@ -49197,20 +31777,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){
@@ -49228,12 +31800,12 @@ Ext.Button = Ext.extend(Ext.BoxComponent, {
return this;
},
- // private
+
onDisable : function(){
this.onDisableChange(true);
},
- // private
+
onEnable : function(){
this.onDisableChange(false);
},
@@ -49248,9 +31820,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){
@@ -49265,9 +31835,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();
@@ -49275,20 +31843,17 @@ 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
+
onRepeatClick : function(repeat, e){
this.onClick(e);
},
- // private
+
onClick : function(e){
if(e){
e.preventDefault();
@@ -49303,30 +31868,30 @@ 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
+
doToggle: function(){
if (this.enableToggle && (this.allowDepress !== false || !this.pressed)) {
this.toggle();
}
},
- // 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);
@@ -49344,7 +31909,7 @@ Ext.Button = Ext.extend(Ext.BoxComponent, {
}
},
- // private
+
monitorMouseOver : function(e){
if(e.target != this.el.dom && !e.within(this.el)){
if(this.monitoringMouseOver){
@@ -49355,7 +31920,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');
@@ -49373,37 +31938,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;
@@ -49412,7 +31977,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');
@@ -49422,33 +31987,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 = {};
@@ -49487,11 +32040,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){
@@ -49505,61 +32054,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:
- * <pre><code>
-// 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
-});
-</code></pre>
- * @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){
@@ -49567,11 +32075,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;
@@ -49591,7 +32095,7 @@ Ext.SplitButton = Ext.extend(Ext.Button, {
}
},
- // private
+
onClick : function(e, t){
e.preventDefault();
if(!this.disabled){
@@ -49613,76 +32117,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:
- * <pre><code>
-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);
- }
-});
-</code></pre>
- * @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} <b>config</b> 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 = '';
@@ -49695,11 +32150,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);
@@ -49728,25 +32179,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"
);
@@ -49777,32 +32218,28 @@ 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();
}
-
+
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;
@@ -49810,99 +32247,7 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, {
}
}
});
-Ext.reg('cycle', Ext.CycleButton);/**
- * @class Ext.Toolbar
- * @extends Ext.Container
- * <p>Basic Toolbar class. Although the <tt>{@link Ext.Container#defaultType defaultType}</tt> for Toolbar
- * is <tt>{@link Ext.Button button}</tt>, 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 <tt>{@link #add}</tt>ed dynamically.</p>
- * <p>Some items have shortcut strings for creation:</p>
- * <pre>
-<u>Shortcut</u> <u>xtype</u> <u>Class</u> <u>Description</u>
-'->' '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
- * </pre>
- *
- * Example usage of various elements:
- * <pre><code>
-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'
- ]
-});
- * </code></pre>
- * Example adding a ComboBox within a menu of a button:
- * <pre><code>
-// 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();
- * </code></pre>
- * @constructor
- * Creates a new Toolbar
- * @param {Object/Array} config A config object or an array of buttons to <tt>{@link #add}</tt>
- * @xtype toolbar
- */
+Ext.reg('cycle', Ext.CycleButton);
Ext.Toolbar = function(config){
if(Ext.isArray(config)){
config = {items: config, layout: 'toolbar'};
@@ -49925,29 +32270,12 @@ Ext.extend(T, Ext.Container, {
defaultType: 'button',
- /**
- * @cfg {String/Object} layout
- * This class assigns a default layout (<code>layout:'<b>toolbar</b>'</code>).
- * Developers <i>may</i> 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 <tt>true</tt> to make the toolbar provide a button
- * which activates a dropdown Menu to show items which overflow the Toolbar's width.
- */
- /**
- * @cfg {String} buttonAlign
- * <p>The default position at which to align child items. Defaults to <code>"left"</code></p>
- * <p>May be specified as <code>"center"</code> to cause items added before a Fill (A <code>"->"</code>) item
- * to be centered in the Toolbar. Items added after a Fill are still right-aligned.</p>
- * <p>Specify as <code>"right"</code> to right align all child items.</p>
- */
+
+
trackMenus : true,
internalDefaults: {removeMode: 'container', hideParent: true},
@@ -49956,16 +32284,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){
@@ -49978,28 +32301,9 @@ Ext.extend(T, Ext.Container, {
}
},
- /**
- * <p>Adds element(s) to the toolbar -- this function takes a variable number of
- * arguments of mixed type and adds them to the toolbar.</p>
- * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
- * @param {Mixed} arg1 The following types of arguments are all valid:<br />
- * <ul>
- * <li>{@link Ext.Button} config: A valid button config object (equivalent to {@link #addButton})</li>
- * <li>HtmlElement: Any standard HTML element (equivalent to {@link #addElement})</li>
- * <li>Field: Any form field (equivalent to {@link #addField})</li>
- * <li>Item: Any subclass of {@link Ext.Toolbar.Item} (equivalent to {@link #addItem})</li>
- * <li>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.</li>
- * <li>'-': Creates a separator element (equivalent to {@link #addSeparator})</li>
- * <li>' ': Creates a spacer element (equivalent to {@link #addSpacer})</li>
- * <li>'->': Creates a fill element (equivalent to {@link #addFill})</li>
- * </ul>
- * @param {Mixed} arg2
- * @param {Mixed} etc.
- * @method add
- */
- // private
+
+
lookupComponent : function(c){
if(Ext.isString(c)){
if(c == '-'){
@@ -50013,20 +32317,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);
@@ -50041,58 +32345,32 @@ Ext.extend(T, Ext.Container, {
return c;
},
- /**
- * Adds a separator
- * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
- * @return {Ext.Toolbar.Item} The separator {@link Ext.Toolbar.Item item}
- */
+
addSeparator : function(){
return this.add(new T.Separator());
},
- /**
- * Adds a spacer element
- * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
- * @return {Ext.Toolbar.Spacer} The spacer item
- */
+
addSpacer : function(){
return this.add(new T.Spacer());
},
- /**
- * Forces subsequent additions into the float:right toolbar
- * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
- */
+
addFill : function(){
this.add(new T.Fill());
},
- /**
- * Adds any standard HTML element to the toolbar
- * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
- * @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
- * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
- * @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.
- * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
- * @param {Object/Array} config A button config or array of configs
- * @return {Ext.Button/Array}
- */
+
addButton : function(config){
if(Ext.isArray(config)){
var buttons = [];
@@ -50104,45 +32382,22 @@ Ext.extend(T, Ext.Container, {
return this.add(this.constructButton(config));
},
- /**
- * Adds text to the toolbar
- * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
- * @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
- * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
- * @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}.
- * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
- * @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.
- * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
- * @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 = [];
@@ -50154,7 +32409,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';
@@ -50164,13 +32419,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);
@@ -50179,7 +32434,7 @@ Ext.extend(T, Ext.Container, {
}
},
- // private
+
onRemove : function(c){
Ext.Toolbar.superclass.onRemove.call(this);
if (c == this.activeMenuBtn) {
@@ -50188,7 +32443,7 @@ Ext.extend(T, Ext.Container, {
this.trackMenu(c, true);
},
- // private
+
onDisable : function(){
this.items.each(function(item){
if(item.disable){
@@ -50197,7 +32452,7 @@ Ext.extend(T, Ext.Container, {
});
},
- // private
+
onEnable : function(){
this.items.each(function(item){
if(item.enable){
@@ -50206,7 +32461,7 @@ Ext.extend(T, Ext.Container, {
});
},
- // private
+
onButtonTriggerOver : function(btn){
if(this.activeMenuBtn && this.activeMenuBtn != btn){
this.activeMenuBtn.hideMenu();
@@ -50215,57 +32470,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:<tt>'xtb-sep'</tt>). Example usage:
- * <pre><code>
-new Ext.Panel({
- tbar : [
- 'Item 1',
- {xtype: 'tbseparator'}, // or '-'
- 'Item 2'
- ]
-});
-</code></pre>
- * @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);
@@ -50273,37 +32500,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:<pre><code>
-.x-toolbar .xtb-spacer {
- width:2px;
-}
- * </code></pre>
- * <p>Example usage:</p>
- * <pre><code>
-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'
- ]
-});
-</code></pre>
- * @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 <tt>.x-toolbar .xtb-spacer</tt>).
- */
+
onRender : function(ct, position){
this.el = ct.createChild({tag:'div', cls:'xtb-spacer', style: this.width?'width:'+this.width+'px':''}, position);
@@ -50311,67 +32510,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.
- * <pre><code>
-new Ext.Panel({
- tbar : [
- 'Item 1',
- {xtype: 'tbfill'}, // or '->'
- 'Item 2'
- ]
-});
-</code></pre>
- * @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:<tt>'xtb-text'</tt>). Example usage:
- * <pre><code>
-new Ext.Panel({
- tbar : [
- {xtype: 'tbtext', text: 'Item 1'} // or simply 'Item 1'
- ]
-});
-</code></pre>
- * @constructor
- * Creates a new TextItem
- * @param {String/Object} text A text string, or a config object containing a <tt>text</tt> 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);
@@ -50382,75 +32543,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:
- * <pre><code>
-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'
- }]
- }]
-});
- * </code></pre>
- * @constructor
- * Create a new ButtonGroup.
- * @param {Object} config The config object
- * @xtype buttongroup
- */
+
Ext.ButtonGroup = Ext.extend(Ext.Panel, {
- /**
- * @cfg {Number} columns The <tt>columns</tt> configuration property passed to the
- * {@link #layout configured layout manager}. See {@link Ext.layout.TableLayout#columns}.
- */
- /**
- * @cfg {String} baseCls Defaults to <tt>'x-btn-group'</tt>. See {@link Ext.Panel#baseCls}.
- */
+
+
baseCls: 'x-btn-group',
- /**
- * @cfg {String} layout Defaults to <tt>'table'</tt>. See {@link Ext.Container#layout}.
- */
+
layout:'table',
defaultType: 'button',
- /**
- * @cfg {Boolean} frame Defaults to <tt>true</tt>. See {@link Ext.Panel#frame}.
- */
+
frame: true,
internalDefaults: {removeMode: 'container', hideParent: true},
@@ -50483,204 +32591,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
- * <p>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.</p>
- * <p>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.</p>
- * <p><b>Ext.PagingToolbar</b> 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 <tt>{@link #store}</tt> by passing {@link Ext.data.Store#paramNames paramNames} used for
- * paging criteria.</p>
- * <p>PagingToolbar is typically used as one of the Grid's toolbars:</p>
- * <pre><code>
-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
+Ext.reg('buttongroup', Ext.ButtonGroup);
-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'
- ]
- })
-});
- * </code></pre>
- *
- * <p>To use paging, pass the paging requirements to the server when the store is first loaded.</p>
- * <pre><code>
-store.load({
- params: {
- // specify params for the first page load if using paging
- start: 0,
- limit: myPageSize,
- // other params
- foo: 'bar'
- }
-});
- * </code></pre>
- *
- * <p>If using {@link Ext.data.Store#autoLoad store's autoLoad} configuration:</p>
- * <pre><code>
-var myStore = new Ext.data.Store({
- {@link Ext.data.Store#autoLoad autoLoad}: {params:{start: 0, limit: 25}},
- ...
-});
- * </code></pre>
- *
- * <p>The packet sent back from the server would have this form:</p>
- * <pre><code>
-{
- "success": true,
- "results": 2000,
- "rows": [ // <b>*Note:</b> this must be an Array
- { "id": 1, "name": "Bill", "occupation": "Gardener" },
- { "id": 2, "name": "Ben", "occupation": "Horticulturalist" },
- ...
- { "id": 25, "name": "Sue", "occupation": "Botanist" }
- ]
-}
- * </code></pre>
- * <p><u>Paging with Local Data</u></p>
- * <p>Paging can also be accomplished with local data using extensions:</p>
- * <div class="mdetail-params"><ul>
- * <li><a href="http://extjs.com/forum/showthread.php?t=71532">Ext.ux.data.PagingStore</a></li>
- * <li>Paging Memory Proxy (examples/ux/PagingMemoryProxy.js)</li>
- * </ul></div>
- * @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
- * <tt>true</tt> to display the displayMsg (defaults to <tt>false</tt>)
- */
- /**
- * @cfg {Number} pageSize
- * The number of records to display per page (defaults to <tt>20</tt>)
- */
+
+
+
pageSize : 20,
- /**
- * @cfg {Boolean} prependButtons
- * <tt>true</tt> to insert any configured <tt>items</tt> <i>before</i> the paging buttons.
- * Defaults to <tt>false</tt>.
- */
- /**
- * @cfg {String} displayMsg
- * The paging status message to display (defaults to <tt>'Displaying {0} - {1} of {2}'</tt>).
- * Note that this string is formatted using the braced numbers <tt>{0}-{2}</tt> 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 <tt>'Page'</tt>).
- */
+
beforePageText : 'Page',
- /**
- * @cfg {String} afterPageText
- * Customizable piece of the default paging text (defaults to <tt>'of {0}'</tt>). Note that
- * this string is formatted using <tt>{0}</tt> 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 <tt>'First Page'</tt>).
- * <b>Note</b>: 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 <tt>'Previous Page'</tt>).
- * <b>Note</b>: 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 <tt>'Next Page'</tt>).
- * <b>Note</b>: 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 <tt>'Last Page'</tt>).
- * <b>Note</b>: 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 <tt>'Refresh'</tt>).
- * <b>Note</b>: quick tips must be initialized for the quicktip to show.
- */
+
refreshText : 'Refresh',
- /**
- * <p><b>Deprecated</b>. <code>paramNames</code> should be set in the <b>data store</b>
- * (see {@link Ext.data.Store#paramNames}).</p>
- * <br><p>Object mapping of parameter names used for load calls, initially set to:</p>
- * <pre>{start: 'start', limit: 'limit'}</pre>
- * @type Object
- * @property paramNames
- * @deprecated
- */
- /**
- * The number of records to display per page. See also <tt>{@link #cursor}</tt>.
- * @type Number
- * @property pageSize
- */
- /**
- * Indicator for the record position. This property might be used to get the active page
- * number for example:<pre><code>
- * // t is reference to the paging toolbar instance
- * var activePage = Math.ceil((t.cursor + t.pageSize) / t.pageSize);
- * </code></pre>
- * @type Number
- * @property cursor
- */
+
+
+
initComponent : function(){
var pagingItems = [this.first = new T.Button({
@@ -50748,34 +32697,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:<ul>
- * <li><code>total</code> : Number <div class="sub-desc">The total number of records in the dataset as
- * returned by the server</div></li>
- * <li><code>activePage</code> : Number <div class="sub-desc">The current page number</div></li>
- * <li><code>pages</code> : Number <div class="sub-desc">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})</div></li>
- * </ul>
- */
+
'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:<ul>
- * <li><code>start</code> : Number <div class="sub-desc">The starting row number for the next page of records to
- * be retrieved from the server</div></li>
- * <li><code>limit</code> : Number <div class="sub-desc">The number of records to be retrieved from the server</div></li>
- * </ul>
- * <p>(note: the names of the <b>start</b> and <b>limit</b> properties are determined
- * by the store's {@link Ext.data.Store#paramNames paramNames} property.)</p>
- * <p>Parameters may be added as required in the event handler.</p>
- */
+
'beforechange'
);
this.on('afterlayout', this.onFirstLayout, this, {single: true});
@@ -50783,14 +32707,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();
@@ -50804,7 +32728,7 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, {
}
},
- // private
+
onLoad : function(store, r, o){
if(!this.rendered){
this.dsLoaded = [store, r, o];
@@ -50825,7 +32749,7 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, {
this.fireEvent('change', this, d);
},
- // private
+
getPageData : function(){
var total = this.store.getTotalCount();
return {
@@ -50835,15 +32759,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;
@@ -50851,7 +32772,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))) {
@@ -50865,12 +32786,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) {
@@ -50899,20 +32820,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;
@@ -50922,30 +32843,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;
@@ -50953,18 +32866,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){
@@ -50995,23 +32902,17 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, {
}
},
- /**
- * Unbinds the paging toolbar from the specified {@link Ext.data.Store} <b>(deprecated)</b>
- * @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} <b>(deprecated)</b>
- * @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);
@@ -51019,15 +32920,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;
@@ -51125,27 +33018,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 (<code>this</code> reference) in which the callback is executed. Defaults to the browser window.
- */
+
init: function (onReady, scope) {
if(ready) {
Ext.callback(onReady, scope, [this]);
@@ -51162,17 +33042,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){
@@ -51181,21 +33053,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:
- * <pre><code>
-// Handle tab changes on a TabPanel
-tabPanel.on('tabchange', function(tabPanel, tab){
- Ext.History.add(tabPanel.id + ':' + tab.id);
-});
-</code></pre>
- * @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){
@@ -51210,71 +33068,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 <b>Experimental</b>. 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',
@@ -51283,7 +33108,7 @@ Ext.Tip = Ext.extend(Ext.Panel, {
closeAction: 'hide',
- // private
+
initComponent : function(){
Ext.Tip.superclass.initComponent.call(this);
if(this.closable && !this.title){
@@ -51291,7 +33116,7 @@ Ext.Tip = Ext.extend(Ext.Panel, {
}
},
- // private
+
afterRender : function(){
Ext.Tip.superclass.afterRender.call(this);
if(this.closable){
@@ -51303,14 +33128,7 @@ Ext.Tip = Ext.extend(Ext.Panel, {
}
},
- /**
- * Shows this tip at the specified XY position. Example usage:
- * <pre><code>
-// Show the tip at x:50 and y:100
-tip.showAt([50,100]);
-</code></pre>
- * @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')){
@@ -51322,7 +33140,7 @@ tip.showAt([50,100]);
this.setPagePosition(xy[0], xy[1]);
},
- // protected
+
doAutoWidth : function(adjust){
adjust = adjust || 0;
var bw = this.body.getTextWidth();
@@ -51331,28 +33149,15 @@ 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;
}
},
- /**
- * <b>Experimental</b>. Shows this tip at a position relative to another element using a standard {@link Ext.Element#alignTo}
- * anchor position value. Example usage:
- * <pre><code>
-// 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');
-</code></pre>
- * @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());
@@ -51368,7 +33173,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;
@@ -51387,117 +33192,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 <code>{@link #delegate}</code>
- * option to cause selected child elements of the <code>{@link #target}</code>
- * 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 <code>{@link #dismissDelay}</code>
- * has expired if set (defaults to true). If <code>{@link closable} = true</code>
- * 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 <code>anchorToTarget</code> is true, use
- * <code>{@link #defaultAlign}</code> to control tooltip alignment to the
- * target element. When <code>anchorToTarget</code> is false, use
- * <code>{@link #anchorPosition}</code> 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, <code>anchorOffset</code>
- * will be used as a horizontal offset. Likewise, when the anchor position
- * is on the left or right side, <code>anchorOffset</code> will be used as
- * a vertical offset.
- */
+
anchorOffset : 0,
- /**
- * @cfg {String} delegate <p>Optional. A {@link Ext.DomQuery DomQuery}
- * selector which allows selection of individual elements within the
- * <code>{@link #target}</code> element to trigger showing and hiding the
- * ToolTip as the mouse moves within the target.</p>
- * <p>When specified, the child element of the target which caused a show
- * event is placed into the <code>{@link #triggerElement}</code> property
- * before the ToolTip is shown.</p>
- * <p>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:</p><pre><code>
-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;
- }
- }
- });
-});
- *</code></pre>
- */
- // private
+
+
targetCounter : 0,
constrainPosition : false,
- // private
+
initComponent : function(){
Ext.ToolTip.superclass.initComponent.call(this);
this.lastActive = new Date();
@@ -51505,7 +33225,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();
@@ -51514,16 +33234,13 @@ myGrid.on('render', function(grid) {
});
},
- // private
+
afterRender : function(){
Ext.ToolTip.superclass.afterRender.call(this);
this.anchorEl.setStyle('z-index', this.el.getZIndex() + 1).setVisibilityMode(Ext.Element.DISPLAY);
},
- /**
- * 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))){
@@ -51546,7 +33263,7 @@ myGrid.on('render', function(grid) {
}
},
- // private
+
onMouseMove : function(e){
var t = this.delegate ? e.getTarget(this.delegate) : this.triggerElement = true;
if (t) {
@@ -51565,7 +33282,7 @@ myGrid.on('render', function(grid) {
}
},
- // private
+
getTargetXY : function(){
if(this.delegate){
this.anchorTarget = this.triggerElement;
@@ -51582,7 +33299,7 @@ myGrid.on('render', function(grid) {
scrollY = (de.scrollTop || bd.scrollTop || 0) + 5,
axy = [xy[0] + offsets[0], xy[1] + offsets[1]],
sz = this.getSize();
-
+
this.anchorEl.removeClass(this.anchorCls);
if(this.targetCounter < 2){
@@ -51639,7 +33356,7 @@ myGrid.on('render', function(grid) {
return offset;
},
- // private
+
getAnchorPosition : function(){
if(this.anchor){
this.tipAnchor = this.anchor.charAt(0);
@@ -51659,7 +33376,7 @@ myGrid.on('render', function(grid) {
return 'left';
},
- // private
+
getAnchorAlign : function(){
switch(this.anchor){
case 'top' : return 'tl-bl';
@@ -51669,9 +33386,9 @@ myGrid.on('render', function(grid) {
}
},
- // private
+
getOffsets : function(){
- var offsets,
+ var offsets,
ap = this.getAnchorPosition().charAt(0);
if(this.anchorToTarget && !this.trackMouse){
switch(ap){
@@ -51711,7 +33428,7 @@ myGrid.on('render', function(grid) {
return offsets;
},
- // private
+
onTargetOver : function(e){
if(this.disabled || e.within(this.target.dom, true)){
return;
@@ -51725,7 +33442,7 @@ myGrid.on('render', function(grid) {
}
},
- // private
+
delayShow : function(){
if(this.hidden && !this.showTimer){
if(this.lastActive.getElapsed() < this.quickShowInterval){
@@ -51738,7 +33455,7 @@ myGrid.on('render', function(grid) {
}
},
- // private
+
onTargetOut : function(e){
if(this.disabled || e.within(this.target.dom, true)){
return;
@@ -51749,16 +33466,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();
@@ -51769,13 +33484,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;
@@ -51792,7 +33505,7 @@ myGrid.on('render', function(grid) {
}
},
- // inherit docs
+
showAt : function(xy){
this.lastActive = new Date();
this.clearTimers();
@@ -51808,7 +33521,7 @@ myGrid.on('render', function(grid) {
}
},
- // private
+
syncAnchor : function(){
var anchorPos, targetPos, offset;
switch(this.tipAnchor.charAt(0)){
@@ -51836,7 +33549,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){
@@ -51844,33 +33557,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();
@@ -51878,20 +33591,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.constrainPosition){
var ay = this.targetXY[1], h = this.getSize().height;
@@ -51901,7 +33614,7 @@ myGrid.on('render', function(grid) {
}
return {x : x, y: y};
},
-
+
beforeDestroy : function(){
this.clearTimers();
Ext.destroy(this.anchorEl);
@@ -51909,36 +33622,23 @@ myGrid.on('render', function(grid) {
delete this.target;
delete this.anchorTarget;
delete this.triggerElement;
- Ext.ToolTip.superclass.beforeDestroy.call(this);
+ 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",
@@ -51951,26 +33651,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):
- * <div class="mdetail-params"><ul>
- * <li>autoHide</li>
- * <li>cls</li>
- * <li>dismissDelay (overrides the singleton value)</li>
- * <li>target (required)</li>
- * <li>text (required)</li>
- * <li>title</li>
- * <li>width</li></ul></div>
- * @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++){
@@ -51988,18 +33676,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;
@@ -52011,10 +33693,10 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, {
this.clearTimer('show');
}
},
-
+
getTipCfg: function(e) {
- var t = e.getTarget(),
- ttp,
+ var t = e.getTarget(),
+ ttp,
cfg;
if(this.interceptTitles && t.title && Ext.isString(t.title)){
ttp = t.title;
@@ -52028,7 +33710,7 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, {
return ttp;
},
- // private
+
onTargetOver : function(e){
if(this.disabled){
return;
@@ -52064,7 +33746,7 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, {
title: et.getAttribute(cfg.title, ns),
cls: et.getAttribute(cfg.cls, ns),
align: et.getAttribute(cfg.align, ns)
-
+
};
this.anchor = et.getAttribute(cfg.anchor, ns);
if(this.anchor){
@@ -52074,10 +33756,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;
}
@@ -52088,7 +33770,7 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, {
}
},
- // inherit docs
+
showAt : function(xy){
var t = this.activeTarget;
if(t){
@@ -52117,7 +33799,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{
@@ -52127,89 +33809,19 @@ 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
- * <p>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}.</p>
- * <p>Quicktips can be configured via tag attributes directly in markup, or by
- * registering quick tips programmatically via the {@link #register} method.</p>
- * <p>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.</p>
- * <p>Below is the summary of the configuration properties which can be used.
- * For detailed descriptions see the config options for the {@link Ext.QuickTip QuickTip} class</p>
- * <p><b>QuickTips singleton configs (all are optional)</b></p>
- * <div class="mdetail-params"><ul><li>dismissDelay</li>
- * <li>hideDelay</li>
- * <li>maxWidth</li>
- * <li>minWidth</li>
- * <li>showDelay</li>
- * <li>trackMouse</li></ul></div>
- * <p><b>Target element configs (optional unless otherwise noted)</b></p>
- * <div class="mdetail-params"><ul><li>autoHide</li>
- * <li>cls</li>
- * <li>dismissDelay (overrides singleton value)</li>
- * <li>target (required)</li>
- * <li>text (required)</li>
- * <li>title</li>
- * <li>width</li></ul></div>
- * <p>Here is an example showing how some of these config options could be used:</p>
- * <pre><code>
-// 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, // Show 50ms after entering target
- 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: 10000 // Hide after 10 seconds hover
-});
-</code></pre>
- * <p>To register a quick tip in markup, you simply add one or more of the valid QuickTip attributes prefixed with
- * the <b>ext:</b> namespace. The HTML element itself is automatically set as the quick tip target. Here is the summary
- * of supported attributes (optional unless otherwise noted):</p>
- * <ul><li><b>hide</b>: Specifying "user" is equivalent to setting autoHide = false. Any other value will be the
- * same as autoHide = true.</li>
- * <li><b>qclass</b>: A CSS class to be applied to the quick tip (equivalent to the 'cls' target element config).</li>
- * <li><b>qtip (required)</b>: The quick tip text (equivalent to the 'text' target element config).</li>
- * <li><b>qtitle</b>: The quick tip title (equivalent to the 'title' target element config).</li>
- * <li><b>qwidth</b>: The quick tip width (equivalent to the 'width' target element config).</li></ul>
- * <p>Here is an example of configuring an HTML element to display a tooltip from markup:</p>
- * <pre><code>
-// Add a quick tip to an HTML button
-&lt;input type="button" value="OK" ext:qtitle="OK Button" ext:qwidth="100"
- ext:qtip="This is a quick tip from markup!">&lt;/input>
-</code></pre>
- * @singleton
- */
+Ext.reg('quicktip', Ext.QuickTip);
Ext.QuickTips = function(){
var tip,
disabled = false;
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){
@@ -52228,25 +33840,23 @@ Ext.QuickTips = function(){
}
},
- // Protected method called by the dd classes
+
ddDisable : function(){
- // don't disable it if we don't need to
+
if(tip && !disabled){
tip.disable();
}
},
- // Protected method called by the dd classes
+
ddEnable : function(){
- // only enable it if it hasn't been disabled
+
if(tip && !disabled){
tip.enable();
}
},
- /**
- * Enable quick tips globally.
- */
+
enable : function(){
if(tip){
tip.enable();
@@ -52254,9 +33864,7 @@ Ext.QuickTips = function(){
disabled = false;
},
- /**
- * Disable quick tips globally.
- */
+
disable : function(){
if(tip){
tip.disable();
@@ -52264,73 +33872,32 @@ Ext.QuickTips = function(){
disabled = true;
},
- /**
- * Returns true if quick tips are enabled, else false.
- * @return {Boolean}
- */
+
isEnabled : function(){
return tip !== undefined && !tip.disabled;
},
- /**
- * Gets the single {@link Ext.QuickTip QuickTip} instance used to show tips from all registered elements.
- * @return {Ext.QuickTip}
- */
+
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:
-<pre>
-new Ext.Slider({
- width: 214,
- minValue: 0,
- maxValue: 100,
- plugins: new Ext.slider.Tip()
-});
-</pre>
- * Optionally provide your own tip text by overriding getText:
- <pre>
- new Ext.Slider({
- width: 214,
- minValue: 0,
- maxValue: 100,
- plugins: new Ext.slider.Tip({
- getText: function(thumb){
- return String.format('<b>{0}% complete</b>', thumb.value);
- }
- })
- });
- </pre>
- */
+}();
Ext.slider.Tip = Ext.extend(Ext.Tip, {
minWidth: 10,
offsets : [0, -10],
@@ -52345,14 +33912,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));
@@ -52360,130 +33920,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
- * <p>The TreePanel provides tree-structured UI representation of tree-structured data.</p>
- * <p>{@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.</p>
- * <p><b>A TreePanel must have a {@link #root} node before it is rendered.</b> This may either be
- * specified using the {@link #root} config option, or using the {@link #setRootNode} method.
- * <p>An example of tree rendered to an existing div:</p><pre><code>
-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();
- * </code></pre>
- * <p>The example above would work with a data packet similar to this:</p><pre><code>
-[{
- "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"
-}]
- * </code></pre>
- * <p>An example of tree within a Viewport:</p><pre><code>
-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 ...
- }]
-});
-</code></pre>
- *
- * @cfg {Ext.tree.TreeNode} root The root node for the tree.
- * @cfg {Boolean} rootVisible <tt>false</tt> to hide the root node (defaults to <tt>true</tt>)
- * @cfg {Boolean} lines <tt>false</tt> to disable tree lines (defaults to <tt>true</tt>)
- * @cfg {Boolean} enableDD <tt>true</tt> to enable drag and drop
- * @cfg {Boolean} enableDrag <tt>true</tt> to enable just drag
- * @cfg {Boolean} enableDrop <tt>true</tt> 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 <tt>true</tt> if the tree should only allow append drops (use for trees which are sorted)
- * @cfg {Boolean} ddScroll <tt>true</tt> to enable body scrolling
- * @cfg {Boolean} containerScroll <tt>true</tt> to register this container with ScrollManager
- * @cfg {Boolean} hlDrop <tt>false</tt> 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 <tt>'C3DAF9'</tt>)
- * @cfg {Boolean} animate <tt>true</tt> to enable animated expand/collapse (defaults to the value of {@link Ext#enableFx})
- * @cfg {Boolean} singleExpand <tt>true</tt> 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 <tt>false</tt> 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 <tt>'/'</tt>)
- * @cfg {Boolean} useArrows <tt>true</tt> to use Vista-style arrows in the tree (defaults to <tt>false</tt>)
- * @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,
@@ -52492,12 +33936,7 @@ Ext.tree.TreePanel = Ext.extend(Ext.Panel, {
hlDrop : Ext.enableFx,
pathSeparator : '/',
- /**
- * @cfg {Array} bubbleEvents
- * <p>An array of events that, when fired, should be bubbled to any parent container.
- * See {@link Ext.util.Observable#enableBubble}.
- * Defaults to <tt>[]</tt>.
- */
+
bubbleEvents : [],
initComponent : function(){
@@ -52507,7 +33946,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({
@@ -52521,11 +33960,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;
@@ -52535,320 +33970,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:<pre><code>
-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());
- }
- }
-});
-</code></pre>
- * @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:<br />
- * <ul style="padding:5px;padding-left:16px;">
- * <li>tree - The TreePanel</li>
- * <li>target - The node being targeted for the drop</li>
- * <li>data - The drag data from the drag source</li>
- * <li>point - The point of the drop - append, above or below</li>
- * <li>source - The drag source</li>
- * <li>rawEvent - Raw mouse event</li>
- * <li>dropNode - Drop node(s) provided by the source <b>OR</b> you can supply node(s)
- * to be inserted by setting them on this object.</li>
- * <li>cancel - Set this to true to cancel the drop.</li>
- * <li>dropStatus - If the default drop action is cancelled but the drop is valid, setting this to true
- * will prevent the animated 'repair' from appearing.</li>
- * </ul>
- * @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:<br />
- * <ul style="padding:5px;padding-left:16px;">
- * <li>tree - The TreePanel</li>
- * <li>target - The node being targeted for the drop</li>
- * <li>data - The drag data from the drag source</li>
- * <li>point - The point of the drop - append, above or below</li>
- * <li>source - The drag source</li>
- * <li>rawEvent - Raw mouse event</li>
- * <li>dropNode - Dropped node(s).</li>
- * </ul>
- * @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:<br />
- * <ul style="padding:5px;padding-left:16px;">
- * <li>tree - The TreePanel</li>
- * <li>target - The node being targeted for the drop</li>
- * <li>data - The drag data from the drag source</li>
- * <li>point - The point of the drop - append, above or below</li>
- * <li>source - The drag source</li>
- * <li>rawEvent - Raw mouse event</li>
- * <li>dropNode - Drop node(s) provided by the source.</li>
- * <li>cancel - Set this to true to signal drop not allowed.</li>
- * </ul>
- * @param {Object} dragOverEvent
- */
+
'nodedragover'
);
if(this.singleExpand){
@@ -52856,33 +34041,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;
@@ -52899,12 +34076,12 @@ new Ext.tree.TreePanel({
}
return node;
},
-
+
clearInnerCt : function(){
- this.innerCt.update('');
+ this.innerCt.update('');
},
-
- // private
+
+
renderRoot : function(){
this.root.render();
if(!this.rootVisible){
@@ -52912,31 +34089,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){
@@ -52947,12 +34120,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 = [];
@@ -52965,32 +34133,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();
@@ -52998,13 +34156,7 @@ 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){
if(Ext.isEmpty(path)){
if(callback){
@@ -53015,7 +34167,7 @@ new Ext.tree.TreePanel({
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);
}
@@ -53042,13 +34194,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){
if(Ext.isEmpty(path)){
if(callback){
@@ -53086,15 +34232,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');
@@ -53103,7 +34246,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);
@@ -53111,21 +34254,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
@@ -53134,7 +34269,7 @@ new Ext.tree.TreePanel({
this.getSelectionModel().init(this);
},
- // private
+
afterRender : function(){
Ext.tree.TreePanel.superclass.afterRender.call(this);
this.renderRoot();
@@ -53151,197 +34286,61 @@ 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 = {};
@@ -53409,11 +34408,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;
}
@@ -53537,32 +34536,17 @@ 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 = 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'
);
@@ -53575,18 +34559,14 @@ Ext.tree.DefaultSelectionModel = Ext.extend(Ext.util.Observable, {
tree.mon(tree.getTreeEl(), 'keydown', this.onKeyDown, this);
tree.on('click', this.onNodeClick, this);
},
-
+
onNodeClick : function(node, e){
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);
}
@@ -53603,22 +34583,15 @@ Ext.tree.DefaultSelectionModel = Ext.extend(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){
@@ -53630,33 +34603,23 @@ Ext.tree.DefaultSelectionModel = Ext.extend(Ext.util.Observable, {
}
return n;
},
-
- /**
- * Get the selected node
- * @return {TreeNode} The selected node
- */
+
+
getSelectedNode : function(){
- return this.selNode;
+ 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;
+ 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){
@@ -53674,15 +34637,12 @@ Ext.tree.DefaultSelectionModel = Ext.extend(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){
@@ -53702,7 +34662,7 @@ Ext.tree.DefaultSelectionModel = Ext.extend(Ext.util.Observable, {
onKeyDown : function(e){
var s = this.selNode || this.lastSelNode;
- // undesirable, but required
+
var sm = this;
if(!s){
return;
@@ -53739,23 +34699,14 @@ Ext.tree.DefaultSelectionModel = Ext.extend(Ext.util.Observable, {
}
});
-/**
- * @class Ext.tree.MultiSelectionModel
- * @extends Ext.util.Observable
- * Multi selection for a TreePanel.
- */
+
Ext.tree.MultiSelectionModel = Ext.extend(Ext.util.Observable, {
constructor : 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);
@@ -53767,7 +34718,7 @@ Ext.tree.MultiSelectionModel = Ext.extend(Ext.util.Observable, {
tree.mon(tree.getTreeEl(), 'keydown', this.onKeyDown, this);
tree.on('click', this.onNodeClick, this);
},
-
+
onNodeClick : function(node, e){
if(e.ctrlKey && this.isSelected(node)){
this.unselect(node);
@@ -53775,14 +34726,8 @@ Ext.tree.MultiSelectionModel = Ext.extend(Ext.util.Observable, {
this.select(node, e, e.ctrlKey);
}
},
-
- /**
- * 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);
@@ -53798,11 +34743,8 @@ Ext.tree.MultiSelectionModel = Ext.extend(Ext.util.Observable, {
this.fireEvent('selectionchange', this, this.selNodes);
return node;
},
-
- /**
- * Deselect a node.
- * @param {TreeNode} node The node to unselect
- */
+
+
unselect : function(node){
if(this.selMap[node.id]){
node.ui.onSelectedChange(false);
@@ -53815,10 +34757,8 @@ Ext.tree.MultiSelectionModel = Ext.extend(Ext.util.Observable, {
this.fireEvent('selectionchange', this, this.selNodes);
}
},
-
- /**
- * Clear all selections
- */
+
+
clearSelections : function(suppressEvent){
var sn = this.selNodes;
if(sn.length > 0){
@@ -53832,20 +34772,13 @@ Ext.tree.MultiSelectionModel = Ext.extend(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;
+ return this.selMap[node.id] ? true : false;
},
-
- /**
- * Returns an array of the selected nodes
- * @return {Array}
- */
+
+
getSelectedNodes : function(){
return this.selNodes.concat([]);
},
@@ -53855,126 +34788,51 @@ Ext.tree.MultiSelectionModel = Ext.extend(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 = Ext.extend(Ext.util.Observable, {
constructor: 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"
);
Ext.data.Tree.superclass.constructor.call(this);
},
- /**
- * @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;
@@ -53983,21 +34841,17 @@ Ext.data.Tree = Ext.extend(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];
},
@@ -54007,140 +34861,61 @@ Ext.data.Tree = Ext.extend(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 = Ext.extend(Ext.util.Observable, {
constructor: 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 = [];
- /**
- * 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;
Ext.data.Node.superclass.constructor.call(this);
},
- // 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){
@@ -54150,63 +34925,43 @@ Ext.data.Node = Ext.extend(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 <tt>expandable</tt>
- * 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)){
@@ -54214,7 +34969,7 @@ Ext.data.Node = Ext.extend(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]);
@@ -54225,7 +34980,7 @@ Ext.data.Node = Ext.extend(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;
@@ -54256,12 +35011,7 @@ Ext.data.Node = Ext.extend(Ext.util.Observable, {
}
},
- /**
- * Removes a child node from this node.
- * @param {Node} node The node to remove
- * @param {Boolean} destroy <tt>true</tt> to destroy the node upon removal. Defaults to <tt>false</tt>.
- * @return {Node} The removed node
- */
+
removeChild : function(node, destroy){
var index = this.childNodes.indexOf(node);
if(index == -1){
@@ -54271,10 +35021,10 @@ Ext.data.Node = Ext.extend(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;
}
@@ -54282,7 +35032,7 @@ Ext.data.Node = Ext.extend(Ext.util.Observable, {
node.nextSibling.previousSibling = node.previousSibling;
}
- // update child refs
+
if(this.firstChild == node){
this.setFirstChild(node.nextSibling);
}
@@ -54299,9 +35049,9 @@ Ext.data.Node = Ext.extend(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){
@@ -54309,16 +35059,9 @@ Ext.data.Node = Ext.extend(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);
@@ -54331,17 +35074,12 @@ Ext.data.Node = Ext.extend(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;
}
@@ -54353,12 +35091,12 @@ Ext.data.Node = Ext.extend(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;
@@ -54387,11 +35125,7 @@ Ext.data.Node = Ext.extend(Ext.util.Observable, {
return node;
},
- /**
- * Removes this node from its parent
- * @param {Boolean} destroy <tt>true</tt> to destroy the node upon removal. Defaults to <tt>false</tt>.
- * @return {Node} this
- */
+
remove : function(destroy){
if (this.parentNode) {
this.parentNode.removeChild(this, destroy);
@@ -54399,11 +35133,7 @@ Ext.data.Node = Ext.extend(Ext.util.Observable, {
return this;
},
- /**
- * Removes all child nodes from this node.
- * @param {Boolean} destroy <tt>true</tt> to destroy the node upon removal. Defaults to <tt>false</tt>.
- * @return {Node} this
- */
+
removeAll : function(destroy){
var cn = this.childNodes,
n;
@@ -54413,21 +35143,12 @@ Ext.data.Node = Ext.extend(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);
@@ -54435,21 +35156,14 @@ Ext.data.Node = Ext.extend(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){
@@ -54463,10 +35177,7 @@ Ext.data.Node = Ext.extend(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;
@@ -54477,15 +35188,15 @@ Ext.data.Node = Ext.extend(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);
@@ -54497,10 +35208,7 @@ Ext.data.Node = Ext.extend(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;
@@ -54515,14 +35223,10 @@ Ext.data.Node = Ext.extend(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;
@@ -54535,14 +35239,7 @@ Ext.data.Node = Ext.extend(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 (<code>this</code> 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){
@@ -54553,14 +35250,7 @@ Ext.data.Node = Ext.extend(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 (<code>this</code> 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;
@@ -54570,14 +35260,7 @@ Ext.data.Node = Ext.extend(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 (<code>this</code> 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++) {
@@ -54587,26 +35270,14 @@ Ext.data.Node = Ext.extend(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 <code>true</code>.
- * @param {Function} fn A function which must return <code>true</code> if the passed Node is the required Node.
- * @param {Object} scope (optional) The scope (<code>this</code> 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,
@@ -54628,11 +35299,7 @@ Ext.data.Node = Ext.extend(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 (<code>this</code> reference) in which the function is executed. Defaults to the browser window.
- */
+
sort : function(fn, scope){
var cs = this.childNodes;
var len = cs.length;
@@ -54653,20 +35320,12 @@ Ext.data.Node = Ext.extend(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){
@@ -54681,35 +35340,7 @@ Ext.data.Node = Ext.extend(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 <b>class</b> 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 = Ext.extend(Ext.data.Node, {
constructor : function(attributes){
@@ -54725,140 +35356,55 @@ Ext.tree.TreeNode = Ext.extend(Ext.data.Node, {
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 <code>{@link #setText}</code>.
- * @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);
},
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;
},
@@ -54868,7 +35414,7 @@ Ext.tree.TreeNode = Ext.extend(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);
@@ -54880,7 +35426,7 @@ Ext.tree.TreeNode = Ext.extend(Ext.data.Node, {
}
},
- // private override
+
setLastChild : function(node){
var ol = this.lastChild;
Ext.tree.TreeNode.superclass.setLastChild.call(this, node);
@@ -54892,8 +35438,8 @@ Ext.tree.TreeNode = Ext.extend(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);
@@ -54906,14 +35452,14 @@ Ext.tree.TreeNode = Ext.extend(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){
var rendered = node.ui.rendered;
- // if it's been rendered remove dom node
+
if(rendered){
node.ui.remove();
}
@@ -54929,7 +35475,7 @@ Ext.tree.TreeNode = Ext.extend(Ext.data.Node, {
return node;
},
- // private override
+
insertBefore : function(node, refNode){
if(!node.render){
node = this.getLoader().createNode(node);
@@ -54942,23 +35488,17 @@ Ext.tree.TreeNode = Ext.extend(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);
},
- /**
- * Sets the icon class for this node.
- * @param {String} cls
- */
+
setIconCls : function(cls){
var old = this.attributes.iconCls;
this.attributes.iconCls = cls;
@@ -54967,11 +35507,7 @@ Ext.tree.TreeNode = Ext.extend(Ext.data.Node, {
}
},
- /**
- * Sets the tooltip for this node.
- * @param {String} tip The text for the tip
- * @param {String} title (Optional) The title for the tip
- */
+
setTooltip : function(tip, title){
this.attributes.qtip = tip;
this.attributes.qtipTitle = title;
@@ -54980,10 +35516,7 @@ Ext.tree.TreeNode = Ext.extend(Ext.data.Node, {
}
},
- /**
- * Sets the icon for this node.
- * @param {String} icon
- */
+
setIcon : function(icon){
this.attributes.icon = icon;
if(this.rendered){
@@ -54991,11 +35524,7 @@ Ext.tree.TreeNode = Ext.extend(Ext.data.Node, {
}
},
- /**
- * Sets the href for the node.
- * @param {String} href The href to set
- * @param {String} (Optional) target The target of the href
- */
+
setHref : function(href, target){
this.attributes.href = href;
this.attributes.hrefTarget = target;
@@ -55004,10 +35533,7 @@ Ext.tree.TreeNode = Ext.extend(Ext.data.Node, {
}
},
- /**
- * Sets the class on this node.
- * @param {String} cls
- */
+
setCls : function(cls){
var old = this.attributes.cls;
this.attributes.cls = cls;
@@ -55016,9 +35542,7 @@ Ext.tree.TreeNode = Ext.extend(Ext.data.Node, {
}
},
- /**
- * Triggers selection of this node
- */
+
select : function(){
var t = this.getOwnerTree();
if(t){
@@ -55026,10 +35550,7 @@ Ext.tree.TreeNode = Ext.extend(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){
@@ -55037,24 +35558,13 @@ Ext.tree.TreeNode = Ext.extend(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 (<code>this</code> 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){
@@ -55096,15 +35606,7 @@ Ext.tree.TreeNode = Ext.extend(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 (<code>this</code> 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){
@@ -55136,14 +35638,14 @@ Ext.tree.TreeNode = Ext.extend(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);
@@ -55151,9 +35653,7 @@ Ext.tree.TreeNode = Ext.extend(Ext.data.Node, {
this.expandProcId = false;
},
- /**
- * Toggles expanded/collapsed state of the node
- */
+
toggle : function(){
if(this.expanded){
this.collapse();
@@ -55162,38 +35662,27 @@ Ext.tree.TreeNode = Ext.extend(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 (<code>this</code> 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, anim) {
var cs = this.childNodes,
i,
len = cs.length;
for (i = 0; i < len; i++) {
- cs[i].expand(deep, anim);
+ cs[i].expand(deep, anim);
}
},
- /**
- * 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++) {
@@ -55201,30 +35690,26 @@ Ext.tree.TreeNode = Ext.extend(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);
@@ -55236,7 +35721,7 @@ Ext.tree.TreeNode = Ext.extend(Ext.data.Node, {
this.childrenRendered = true;
},
- // private
+
sort : function(fn, scope){
Ext.tree.TreeNode.superclass.sort.apply(this, arguments);
if(this.childrenRendered){
@@ -55247,11 +35732,11 @@ Ext.tree.TreeNode = Ext.extend(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){
@@ -55261,7 +35746,7 @@ Ext.tree.TreeNode = Ext.extend(Ext.data.Node, {
}
},
- // private
+
renderIndent : function(deep, refresh){
if(refresh){
this.ui.childIndent = null;
@@ -55285,7 +35770,7 @@ Ext.tree.TreeNode = Ext.extend(Ext.data.Node, {
}
},
- //inherit docs
+
destroy : function(silent){
if(silent === true){
this.unselect(true);
@@ -55295,46 +35780,28 @@ Ext.tree.TreeNode = Ext.extend(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);
}
@@ -55356,15 +35823,12 @@ 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;
+ return this.loading;
},
-
+
loadComplete : function(deep, anim, callback, scope){
this.loading = false;
this.loaded = true;
@@ -55372,15 +35836,12 @@ Ext.extend(Ext.tree.AsyncTreeNode, Ext.tree.TreeNode, {
this.fireEvent("load", this);
this.expand(deep, anim, callback, scope);
},
-
- /**
- * Returns true if this node has been loaded
- * @return {Boolean}
- */
+
+
isLoaded : function(){
return this.loaded;
},
-
+
hasChildNodes : function(){
if(!this.isLeaf() && !this.loaded){
return true;
@@ -55389,11 +35850,7 @@ Ext.extend(Ext.tree.AsyncTreeNode, Ext.tree.TreeNode, {
}
},
- /**
- * Trigger a reload for this node
- * @param {Function} callback
- * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the callback is executed. Defaults to this Node.
- */
+
reload : function(callback, scope){
this.collapse(false, false);
while(this.firstChild){
@@ -55408,19 +35865,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.<br>
- * <p>
- * 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.<br>
- * <p>
- * 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 = Ext.extend(Object, {
constructor : function(node){
@@ -55434,48 +35879,48 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
});
},
- // 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
+
onIconClsChange : function(node, cls, oldCls){
if(this.rendered){
Ext.fly(this.iconNode).replaceClass(oldCls, cls);
}
},
- // private
+
onIconChange : function(node, icon){
if(this.rendered){
- //'<img src="', a.icon || this.emptyIcon, '" class="x-tree-node-icon',(a.icon ? " x-tree-node-inline-icon" : ""),(a.iconCls ? " "+a.iconCls : ""),'" unselectable="on" />',
+
var empty = Ext.isEmpty(icon);
this.iconNode.src = empty ? this.emptyIcon : icon;
Ext.fly(this.iconNode)[empty ? 'removeClass' : 'addClass']('x-tree-node-inline-icon');
}
},
- // private
+
onTipChange : function(node, tip, title){
if(this.rendered){
var hasTitle = Ext.isDefined(title);
@@ -55493,7 +35938,7 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
}
},
- // private
+
onHrefChange : function(node, href, target){
if(this.rendered){
this.anchor.href = this.getHref(href);
@@ -55503,14 +35948,14 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
}
},
- // private
+
onClsChange : function(node, cls, oldCls){
if(this.rendered){
Ext.fly(this.elNode).replaceClass(oldCls, cls);
}
},
- // private
+
onDisableChange : function(node, state){
this.disabled = state;
if (this.checkbox) {
@@ -55519,23 +35964,23 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
this[state ? 'addClass' : 'removeClass']('x-tree-node-disabled');
},
- // 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;
@@ -55550,28 +35995,21 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
}
},
-/**
- * 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");
@@ -55579,12 +36017,12 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
}
},
- // private
+
fireEvent : function(){
return this.node.fireEvent.apply(this.node, arguments);
},
- // private
+
initEvents : function(){
this.node.on("move", this.onMove, this);
@@ -55605,14 +36043,12 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
}
},
- // private
+
getDDHandles : function(){
return [this.iconNode, this.textNode, this.elNode];
},
-/**
- * Hides this node.
- */
+
hide : function(){
this.node.hidden = true;
if(this.wrap){
@@ -55620,9 +36056,7 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
}
},
-/**
- * Shows this node.
- */
+
show : function(){
this.node.hidden = false;
if(this.wrap){
@@ -55630,7 +36064,7 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
}
},
- // private
+
onContextMenu : function(e){
if (this.node.hasListener("contextmenu") || this.node.getOwnerTree().hasListener("contextmenu")) {
e.preventDefault();
@@ -55639,7 +36073,7 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
}
},
- // private
+
onClick : function(e){
if(this.dropping){
e.stopEvent();
@@ -55668,7 +36102,7 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
}
},
- // private
+
onDblClick : function(e){
e.preventDefault();
if(this.disabled){
@@ -55693,41 +36127,41 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
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();
@@ -55742,11 +36176,7 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
}
},
-/**
- * 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){
@@ -55755,14 +36185,14 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
}
},
- // private
+
blur : function(){
try{
this.anchor.blur();
}catch(e){}
},
- // private
+
animExpand : function(callback){
var ct = Ext.get(this.ctNode);
ct.stopFx();
@@ -55785,7 +36215,7 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
});
},
- // private
+
highlight : function(){
var tree = this.node.getOwnerTree();
Ext.fly(this.wrap).highlight(
@@ -55794,13 +36224,13 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
);
},
- // private
+
collapse : function(){
this.updateExpandIcon();
this.ctNode.style.display = "none";
},
- // private
+
animCollapse : function(callback){
var ct = Ext.get(this.ctNode);
ct.enableDisplayMode('block');
@@ -55819,35 +36249,32 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
});
},
- // private
+
getContainer : function(){
return this.ctNode;
},
-/**
- * Returns the element which encapsulates this node.
- * @return {HtmlElement} The DOM element. The default implementation uses a <code>&lt;li></code>.
- */
+
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 ?
@@ -55875,9 +36302,9 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
}
},
- // 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),
@@ -55908,7 +36335,7 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
var index = 3;
if(cb){
this.checkbox = cs[3];
- // fix for IE6
+
this.checkbox.defaultChecked = this.checkbox.checked;
index++;
}
@@ -55916,48 +36343,32 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
this.textNode = cs[index].firstChild;
},
- /**
- * @private Gets a normalized href for the node.
- * @param {String} href
- */
+
getHref : function(href){
return Ext.isEmpty(href) ? (Ext.isGecko ? '' : '#') : href;
},
-/**
- * Returns the &lt;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 &lt;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,
@@ -55999,14 +36410,14 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
}
},
- // private
+
onIdChange: function(id){
if(this.rendered){
this.elNode.setAttribute('ext:tree-node-id', id);
}
},
- // private
+
getChildIndent : function(){
if(!this.childIndent){
var buf = [],
@@ -56026,7 +36437,7 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
return this.childIndent;
},
- // private
+
renderIndent : function(){
if(this.rendered){
var indent = "",
@@ -56034,7 +36445,7 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
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;
}
@@ -56057,16 +36468,9 @@ Ext.tree.TreeNodeUI = Ext.extend(Object, {
}
});
-/**
- * @class Ext.tree.RootTreeNodeUI
- * This class provides the default UI implementation for <b>root</b> Ext TreeNodes.
- * The RootTreeNode UI implementation allows customizing the appearance of the root tree node.<br>
- * <p>
- * 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.<br>
- */
+
Ext.tree.RootTreeNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
- // private
+
render : function(){
if(!this.rendered){
var targetNode = this.node.ownerTree.innerCt.dom;
@@ -56077,73 +36481,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.:
- * <pre><code>
- [{
- id: 1,
- text: 'A leaf Node',
- leaf: true
- },{
- id: 2,
- text: 'A folder Node',
- children: [{
- id: 3,
- text: 'A child Node',
- leaf: true
- }]
- }]
-</code></pre>
- * <br><br>
- * 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.
- * <br><br>
- * To pass extra parameters, an event handler may be attached to the "beforeload"
- * event, and the parameters specified in the TreeLoader's baseParams property:
- * <pre><code>
- myTreeLoader.on("beforeload", function(treeLoader, node) {
- this.baseParams.category = node.attributes.category;
- }, this);
-</code></pre>
- * 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);
@@ -56153,95 +36501,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
- * <i>uiProvider</i> 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 <tt>undefined</tt>. 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:<pre><code>
-nodeParameter: 'node',
-paramOrder: ['param1','param2','param3']
-paramOrder: 'node param1 param2 param3'
-paramOrder: 'param1,node,param2,param3'
-paramOrder: 'param1|param2|param|node'
- </code></pre>
- */
+
paramOrder: undefined,
- /**
- * @cfg {Boolean} paramsAsHash Only used when using directFn.
- * Send parameters as a collection of named arguments (defaults to <tt>false</tt>). Providing a
- * <tt>{@link #paramOrder}</tt> 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 <tt>'node'</tt>.
- */
+
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 (<code>this</code> 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);
@@ -56250,7 +36541,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++){
@@ -56276,7 +36567,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 = [];
}
@@ -56311,8 +36602,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, []);
}
},
@@ -56331,7 +36622,7 @@ paramOrder: 'param1|param2|param|node'
}
},
- // private
+
runCallback: function(cb, scope, args){
if(Ext.isFunction(cb)){
cb.apply(scope, args);
@@ -56348,31 +36639,9 @@ paramOrder: 'param1|param2|param|node'
}
},
- /**
- * <p>Override this function for custom TreeNode node implementation, or to
- * modify the attributes at creation time.</p>
- * Example:<pre><code>
-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);
- }
- }),
- ...
-});
-</code></pre>
- * @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);
}
@@ -56427,12 +36696,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 = {};
@@ -56445,19 +36709,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;
@@ -56466,7 +36724,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]);
};
@@ -56476,13 +36734,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 (<code>this</code> 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){
@@ -56517,10 +36769,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;
@@ -56535,51 +36784,16 @@ 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:<br />
- * <pre><code>
-new Ext.tree.TreeSorter(myTree, {
- folderSort: true,
- dir: "desc",
- sortType: function(node) {
- // sort by a custom, typed attribute:
- return parseInt(node.id, 10);
- }
-});
-</code></pre>
- * @constructor
- * @param {TreePanel} tree
- * @param {Object} config
- */
+
Ext.tree.TreeSorter = Ext.extend(Object, {
constructor: 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({
@@ -56614,8 +36828,8 @@ Ext.tree.TreeSorter = Ext.extend(Object, {
}
var prop1 = attr1[prop],
prop2 = attr2[prop],
- v1 = sortType ? sortType(prop1) : (caseSensitive ? prop1 : prop1.toUpperCase()),
- v2 = sortType ? sortType(prop2) : (caseSensitive ? prop2 : prop2.toUpperCase());
+ v1 = sortType ? sortType(prop1, n1) : (caseSensitive ? prop1 : prop1.toUpperCase()),
+ v2 = sortType ? sortType(prop2, n2) : (caseSensitive ? prop2 : prop2.toUpperCase());
if(v1 < v2){
return desc ? 1 : -1;
@@ -56643,79 +36857,46 @@ Ext.tree.TreeSorter = Ext.extend(Object, {
}
}
});
-/**
- * @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);
@@ -56723,12 +36904,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;
}
@@ -56741,7 +36922,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;
@@ -56750,16 +36931,16 @@ Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, {
overEvent.source = dd;
overEvent.rawEvent = e;
overEvent.dropNode = dropNode;
- overEvent.cancel = false;
+ overEvent.cancel = false;
var result = this.tree.fireEvent("nodedragover", overEvent);
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;
@@ -56782,11 +36963,11 @@ Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, {
}
},
- // private
+
onNodeEnter : function(n, dd, e, data){
this.cancelExpand();
},
-
+
onContainerOver : function(dd, e, data) {
if (this.allowContainerDrop && this.isValidDropPoint({ ddel: this.tree.getRootNode().ui.elNode, node: this.tree.getRootNode() }, "append", dd, e, data)) {
return this.dropAllowed;
@@ -56794,19 +36975,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){
@@ -56831,13 +37012,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;
@@ -56846,22 +37027,22 @@ 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);
},
-
+
onContainerDrop : function(dd, e, data){
if (this.allowContainerDrop && this.isValidDropPoint({ ddel: this.tree.getRootNode().ui.elNode, node: this.tree.getRootNode() }, "append", dd, e, data)) {
- var targetNode = this.tree.getRootNode();
+ var targetNode = this.tree.getRootNode();
targetNode.ui.startDrop();
var dropNode = data.node || (dd.getTreeNode ? dd.getTreeNode(data, targetNode, 'append', e) : null);
return this.processDrop(targetNode, data, 'append', dd, e, dropNode);
}
return false;
},
-
- // private
+
+
processDrop: function(target, data, point, dd, e, dropNode){
var dropEvent = {
tree : this.tree,
@@ -56879,7 +37060,7 @@ Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, {
target.ui.endDrop();
return dropEvent.dropStatus;
}
-
+
target = dropEvent.target;
if(point == 'append' && !target.isExpanded()){
target.expand(false, null, function(){
@@ -56891,7 +37072,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)){
@@ -56916,7 +37097,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();
@@ -56925,12 +37106,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;
@@ -56942,54 +37123,40 @@ 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();
}
this.hideProxy();
- }
+ }
});
-}/**
- * @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);
@@ -56999,32 +37166,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");
@@ -57032,21 +37199,11 @@ 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);
-
+
Ext.tree.TreeEditor.superclass.constructor.call(this, field, config);
this.tree = tree;
@@ -57059,42 +37216,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){
@@ -57103,41 +37239,34 @@ Ext.extend(Ext.tree.TreeEditor, Ext.Editor, {
beforeclick: this.beforeNodeClick,
dblclick : this.onNodeDblClick
});
-
+
this.on({
scope : this,
complete : this.updateNode,
beforestartedit: this.fitToTree,
specialkey : this.onSpecialKey
});
-
+
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);
@@ -57151,12 +37280,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)){
@@ -57169,13 +37298,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){
@@ -57183,7 +37312,7 @@ Ext.extend(Ext.tree.TreeEditor, Ext.Editor, {
}
},
- // private
+
onSpecialKey : function(field, e){
var k = e.getKey();
if(k == e.ESC){
@@ -57194,7 +37323,7 @@ Ext.extend(Ext.tree.TreeEditor, Ext.Editor, {
this.completeEdit();
}
},
-
+
onDestroy : function(){
clearTimeout(this.autoEditTimer);
Ext.tree.TreeEditor.superclass.onDestroy.call(this);
@@ -57202,12 +37331,10 @@ Ext.extend(Ext.tree.TreeEditor, Ext.Editor, {
tree.un('beforeclick', this.beforeNodeClick, this);
tree.un('dblclick', this.onNodeDblClick, this);
}
-});/*! SWFObject v2.2 <http://code.google.com/p/swfobject/>
- is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
-*/
+});
var swfobject = function() {
-
+
var UNDEF = "undefined",
OBJECT = "object",
SHOCKWAVE_FLASH = "Shockwave Flash",
@@ -57215,11 +37342,11 @@ var swfobject = function() {
FLASH_MIME_TYPE = "application/x-shockwave-flash",
EXPRESS_INSTALL_ID = "SWFObjectExprInst",
ON_READY_STATE_CHANGE = "onreadystatechange",
-
+
win = window,
doc = document,
nav = navigator,
-
+
plugin = false,
domLoadFnArr = [main],
regObjArr = [],
@@ -57234,26 +37361,23 @@ var swfobject = function() {
dynamicStylesheet,
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);
@@ -57263,10 +37387,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)];
}
@@ -57276,21 +37400,17 @@ 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) {
if (typeof doc.addEventListener != UNDEF) {
doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
- }
+ }
if (ua.ie && ua.win) {
doc.attachEvent(ON_READY_STATE_CHANGE, function() {
if (doc.readyState == "complete") {
@@ -57298,7 +37418,7 @@ var swfobject = function() {
callDomLoadFunctions();
}
});
- if (win == top) { // if not inside an iframe
+ if (win == top) {
(function(){
if (isDomLoaded) { return; }
try {
@@ -57325,10 +37445,10 @@ var swfobject = function() {
addLoadEvent(callDomLoadFunctions);
}
}();
-
+
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);
}
@@ -57339,20 +37459,17 @@ var swfobject = function() {
domLoadFnArr[i]();
}
}
-
+
function addDomLoadEvent(fn) {
if (isDomLoaded) {
fn();
}
- else {
- domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+ else {
+ 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);
@@ -57374,11 +37491,9 @@ var swfobject = function() {
win.onload = fn;
}
}
-
- /* Main function
- - Will preferably execute onDomLoad, otherwise onload (as a fallback)
- */
- function main() {
+
+
+ function main() {
if (plugin) {
testPlayerVersion();
}
@@ -57386,14 +37501,8 @@ var swfobject = function() {
matchVersions();
}
}
-
- /* 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);
@@ -57423,20 +37532,19 @@ var swfobject = function() {
matchVersions();
}
}
-
- /* 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;
@@ -57444,14 +37552,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;
@@ -57462,17 +37570,17 @@ 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
- if (o && typeof o.SetVariable != UNDEF) {
+ var o = getObjectById(id);
+ if (o && typeof o.SetVariable != UNDEF) {
cbObj.success = true;
cbObj.ref = o;
}
@@ -57482,7 +37590,7 @@ var swfobject = function() {
}
}
}
-
+
function getObjectById(objectIdStr) {
var r = null;
var o = getElementById(objectIdStr);
@@ -57499,31 +37607,24 @@ 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;
}
@@ -57544,13 +37645,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) {
@@ -57564,15 +37665,14 @@ var swfobject = function() {
createSWF(att, par, replaceElemIdStr);
}
}
-
- /* 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(){
@@ -57587,7 +37687,7 @@ var swfobject = function() {
else {
obj.parentNode.replaceChild(abstractAltContent(obj), obj);
}
- }
+ }
function abstractAltContent(obj) {
var ac = createElement("div");
@@ -57610,24 +37710,23 @@ 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") {
@@ -57637,29 +37736,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 += '<param name="' + j + '" value="' + parObj[j] + '" />';
}
}
el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
- objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
- r = getElementById(attObj.id);
+ 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]);
}
}
@@ -57669,17 +37768,15 @@ var swfobject = function() {
}
return r;
}
-
+
function createObjParam(el, pName, pValue) {
var p = createElement("param");
- p.setAttribute("name", pName);
+ p.setAttribute("name", pName);
p.setAttribute("value", pValue);
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") {
@@ -57699,7 +37796,7 @@ var swfobject = function() {
}
}
}
-
+
function removeObjectInIE(id) {
var obj = getElementById(id);
if (obj) {
@@ -57711,9 +37808,8 @@ var swfobject = function() {
obj.parentNode.removeChild(obj);
}
}
-
- /* Functions to optimize JavaScript compression
- */
+
+
function getElementById(id) {
var el = null;
try {
@@ -57722,43 +37818,38 @@ var swfobject = function() {
catch (e) {}
return el;
}
-
+
function createElement(el) {
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
+ if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
+
var s = createElement("style");
s.setAttribute("type", "text/css");
s.setAttribute("media", m);
@@ -57768,7 +37859,7 @@ var swfobject = function() {
}
dynamicStylesheetMedia = m;
}
- // add style rule
+
if (ua.ie && ua.win) {
if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
dynamicStylesheet.addRule(sel, decl);
@@ -57780,7 +37871,7 @@ var swfobject = function() {
}
}
}
-
+
function setVisibility(id, isVisible) {
if (!autoHideShow) { return; }
var v = isVisible ? "visible" : "hidden";
@@ -57792,30 +37883,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;
}
@@ -57828,11 +37917,9 @@ 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 = {};
@@ -57847,37 +37934,37 @@ var swfobject = function() {
callbackFn({success:false, id:objectIdStr});
}
},
-
+
getObjectById: function(objectIdStr) {
if (ua.w3) {
return getObjectById(objectIdStr);
}
},
-
+
embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
var callbackObj = {success:false, id:replaceElemIdStr};
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];
}
}
att.data = swfUrlStr;
att.width = widthStr;
att.height = heightStr;
- var par = {};
+ 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];
}
@@ -57886,7 +37973,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);
@@ -57894,12 +37981,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); }
@@ -57907,19 +37994,19 @@ var swfobject = function() {
}
else if (callbackFn) { callbackFn(callbackObj); }
},
-
+
switchOffAutoHideShow: function() {
autoHideShow = false;
},
-
+
ua: ua,
-
+
getFlashPlayerVersion: function() {
return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
},
-
+
hasFlashPlayerVersion: hasPlayerVersion,
-
+
createSWF: function(attObj, parObj, replaceElemIdStr) {
if (ua.w3) {
return createSWF(attObj, parObj, replaceElemIdStr);
@@ -57928,33 +38015,33 @@ var swfobject = function() {
return undefined;
}
},
-
+
showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
if (ua.w3 && canExpressInstall()) {
showExpressInstall(att, par, replaceElemIdStr, callbackFn);
}
},
-
+
removeSWF: function(objElemIdStr) {
if (ua.w3) {
removeSWF(objElemIdStr);
}
},
-
+
createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
if (ua.w3) {
createCSS(selStr, declStr, mediaStr, newStyleBoolean);
}
},
-
+
addDomLoadEvent: addDomLoadEvent,
-
+
addLoadEvent: addLoadEvent,
-
+
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);
}
@@ -57967,8 +38054,8 @@ var swfobject = function() {
}
return "";
},
-
- // For internal usage only
+
+
expressInstallCallback: function() {
if (isExpressInstallActive) {
var obj = getElementById(EXPRESS_INSTALL_ID);
@@ -57981,73 +38068,41 @@ var swfobject = function() {
if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
}
isExpressInstallActive = false;
- }
+ }
}
};
}();
-/**
- * @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 <tt>'9.0.115'</tt>.
- */
+
flashVersion : '9.0.115',
- /**
- * @cfg {String} backgroundColor
- * The background color of the chart. Defaults to <tt>'#ffffff'</tt>.
- */
+
backgroundColor: '#ffffff',
- /**
- * @cfg {String} wmode
- * The wmode of the flash object. This can be used to control layering. Defaults to <tt>'opaque'</tt>.
- */
+
wmode: 'opaque',
- /**
- * @cfg {Object} flashVars
- * A set of key value pairs to be passed to the flash object as flash variables. Defaults to <tt>undefined</tt>.
- */
+
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 <tt>undefined</tt>.
- */
+
flashParams: undefined,
- /**
- * @cfg {String} url
- * The URL of the chart to include. Defaults to <tt>undefined</tt>.
- */
+
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 <tt>false</tt>.
- */
+
expressInstall: false,
initComponent : function(){
Ext.FlashComponent.superclass.initComponent.call(this);
this.addEvents(
- /**
- * @event initialize
- *
- * @param {Chart} this
- */
+
'initialize'
);
},
@@ -58108,17 +38163,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);
@@ -58128,29 +38176,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 <b>override</b>
- * the built in styles of the chart. Use {@link #extraStyle} to add customizations to the default styling.
- */
+
+
chartStyle: {
padding: 10,
animationEnabled: true,
@@ -58178,88 +38211,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 <tt>null</tt>.
- * For a detailed list of the options available, visit the YUI Charts site
- * at <a href="http://developer.yahoo.com/yui/charts/#basicstyles">http://developer.yahoo.com/yui/charts/#basicstyles</a><br/>
- * Some of the options availabe:<br />
- * <ul style="padding:5px;padding-left:16px;list-style-type:inherit;">
- * <li><b>padding</b> - The space around the edge of the chart's contents. Padding does not increase the size of the chart.</li>
- * <li><b>animationEnabled</b> - A Boolean value that specifies whether marker animations are enabled or not. Enabled by default.</li>
- * <li><b>font</b> - An Object defining the font style to be used in the chart. Defaults to <tt>{ name: 'Tahoma', color: 0x444444, size: 11 }</tt><br/>
- * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
- * <li><b>name</b> - font name</li>
- * <li><b>color</b> - font color (hex code, ie: "#ff0000", "ff0000" or 0xff0000)</li>
- * <li><b>size</b> - font size in points (numeric portion only, ie: 11)</li>
- * <li><b>bold</b> - boolean</li>
- * <li><b>italic</b> - boolean</li>
- * <li><b>underline</b> - boolean</li>
- * </ul>
- * </li>
- * <li><b>border</b> - An object defining the border style around the chart. The chart itself will decrease in dimensions to accomodate the border.<br/>
- * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
- * <li><b>color</b> - border color (hex code, ie: "#ff0000", "ff0000" or 0xff0000)</li>
- * <li><b>size</b> - border size in pixels (numeric portion only, ie: 1)</li>
- * </ul>
- * </li>
- * <li><b>background</b> - An object defining the background style of the chart.<br/>
- * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
- * <li><b>color</b> - border color (hex code, ie: "#ff0000", "ff0000" or 0xff0000)</li>
- * <li><b>image</b> - an image URL. May be relative to the current document or absolute.</li>
- * </ul>
- * </li>
- * <li><b>legend</b> - An object defining the legend style<br/>
- * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
- * <li><b>display</b> - location of the legend. Possible values are "none", "left", "right", "top", and "bottom".</li>
- * <li><b>spacing</b> - an image URL. May be relative to the current document or absolute.</li>
- * <li><b>padding, border, background, font</b> - same options as described above.</li>
- * </ul></li>
- * <li><b>dataTip</b> - An object defining the style of the data tip (tooltip).<br/>
- * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
- * <li><b>padding, border, background, font</b> - same options as described above.</li>
- * </ul></li>
- * <li><b>xAxis and yAxis</b> - An object defining the style of the style of either axis.<br/>
- * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
- * <li><b>color</b> - same option as described above.</li>
- * <li><b>size</b> - same option as described above.</li>
- * <li><b>showLabels</b> - boolean</li>
- * <li><b>labelRotation</b> - a value in degrees from -90 through 90. Default is zero.</li>
- * </ul></li>
- * <li><b>majorGridLines and minorGridLines</b> - An object defining the style of the style of the grid lines.<br/>
- * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
- * <li><b>color, size</b> - same options as described above.</li>
- * </ul></li></li>
- * <li><b>zeroGridLine</b> - An object defining the style of the style of the zero grid line.<br/>
- * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
- * <li><b>color, size</b> - same options as described above.</li>
- * </ul></li></li>
- * <li><b>majorTicks and minorTicks</b> - An object defining the style of the style of ticks in the chart.<br/>
- * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
- * <li><b>color, size</b> - same options as described above.</li>
- * <li><b>length</b> - the length of each tick in pixels extending from the axis.</li>
- * <li><b>display</b> - how the ticks are drawn. Possible values are "none", "inside", "outside", and "cross".</li>
- * </ul></li></li>
- * </ul>
- */
+
+
extraStyle: null,
- /**
- * @cfg {Object} seriesStyles
- * Contains styles to apply to the series after a refresh. Defaults to <tt>null</tt>.
- */
+
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',
@@ -58279,47 +38239,25 @@ Ext.FlashEventProxy = {
'itemdragstart',
'itemdrag',
'itemdragend',
- /**
- * @event beforerefresh
- * Fires before a refresh to the chart data is called. If the beforerefresh handler returns
- * <tt>false</tt> 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 = [];
@@ -58359,10 +38297,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){
@@ -58429,13 +38364,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;
@@ -58449,10 +38384,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];
}
@@ -58480,14 +38415,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.', '');
@@ -58495,7 +38430,7 @@ Ext.FlashEventProxy = {
}
},
- // private
+
getFunctionRef : function(val){
if(Ext.isFunction(val)){
return {
@@ -58510,7 +38445,7 @@ Ext.FlashEventProxy = {
}
},
- // private
+
onDestroy: function(){
if (this.refreshTask && this.refreshTask.cancel){
this.refreshTask.cancel();
@@ -58525,19 +38460,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.2/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',
@@ -58560,12 +38486,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);
@@ -58662,56 +38583,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'
});
@@ -58719,526 +38615,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 <tt>true</tt>.
- *
- * @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
- * <p>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).</p>
- * <p>Menus may contain either {@link Ext.menu.Item menu items}, or general {@link Ext.Component Component}s.</p>
- * <p>To make a contained general {@link Ext.Component Component} line up with other {@link Ext.menu.Item menu items}
- * specify <tt>iconCls: 'no-icon'</tt>. 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.</p>
- * <p>By default, Menus are absolutely positioned, floating Components. By configuring a Menu with
- * <b><tt>{@link #floating}:false</tt></b>, a Menu may be used as child of a Container.</p>
- *
- * @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 <tt>[0, 0]</tt>.
- */
+
defaultOffsets : [0, 0],
- /**
- * @cfg {Boolean} plain
- * True to remove the incised line down the left side of the menu. Defaults to <tt>false</tt>.
- */
+
plain : false,
- /**
- * @cfg {Boolean} floating
- * <p>By default, a Menu configured as <b><code>floating:true</code></b>
- * will be rendered as an {@link Ext.Layer} (an absolutely positioned,
- * floating Component with zindex=15000).
- * If configured as <b><code>floating:false</code></b>, 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 (<code>layout:'<b>menu</b>'</code>).
- * Developers <i>may</i> 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,
@@ -59247,36 +38829,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);
@@ -59298,12 +38857,12 @@ Ext.menu.Menu = Ext.extend(Ext.Container, {
}
},
- //private
+
getLayoutTarget : function() {
return this.ul;
},
- // private
+
onRender : function(ct, position){
if(!ct){
ct = Ext.getBody();
@@ -59334,7 +38893,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, {
@@ -59353,7 +38912,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){
@@ -59361,7 +38920,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, {
}
},
- // private
+
onClick : function(e){
var t = this.findTargetItem(e);
if(t){
@@ -59379,7 +38938,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, {
}
},
- // private
+
setActiveItem : function(item, autoExpand){
if(item != this.activeItem){
this.deactivateActive();
@@ -59397,7 +38956,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();
}
@@ -59408,7 +38967,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){
@@ -59421,7 +38980,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, {
return false;
},
- // private
+
onMouseOver : function(e){
var t = this.findTargetItem(e);
if(t){
@@ -59433,7 +38992,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){
@@ -59446,7 +39005,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, {
this.fireEvent('mouseout', this, e, t);
},
- // private
+
onScroll : function(e, t){
if(e){
e.stopEvent();
@@ -59458,7 +39017,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){
@@ -59466,19 +39025,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 <code>{@link #floating}=true</code>, 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;
@@ -59492,12 +39044,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;
@@ -59505,20 +39052,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
+ if(Ext.isIE9m){
+
this.fireEvent('autosize', this);
if(!Ext.isIE8){
this.el.repaint();
@@ -59537,13 +39084,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);
@@ -59552,7 +39099,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, {
}else{
max = this.getHeight();
}
- // Always respect maxHeight
+
if (this.maxHeight){
max = Math.min(this.maxHeight, max);
}
@@ -59622,10 +39169,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;
@@ -59634,7 +39178,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, {
}
},
- // private
+
onHide : function(){
Ext.menu.Menu.superclass.onHide.call(this);
this.deactivateActive();
@@ -59651,7 +39195,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);
@@ -59659,7 +39203,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
});
@@ -59684,7 +39228,7 @@ Ext.menu.Menu = Ext.extend(Ext.Container, {
return c;
},
- // private
+
getMenuItem : function(config) {
config.ownerCt = this;
@@ -59697,53 +39241,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;
@@ -59770,7 +39295,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)){
@@ -59790,7 +39315,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;
}
@@ -59837,11 +39362,7 @@ 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,
@@ -59851,7 +39372,7 @@ Ext.menu.MenuMgr = function(){
lastShow = new Date();
- // private - called when first menu is created
+
function init(){
menus = {};
active = new Ext.util.MixedCollection();
@@ -59859,7 +39380,7 @@ Ext.menu.MenuMgr = function(){
map.disable();
}
- // private
+
function hideAll(){
if(active && active.length > 0){
var c = active.clone();
@@ -59871,7 +39392,7 @@ Ext.menu.MenuMgr = function(){
return false;
}
- // private
+
function onHide(m){
active.remove(m);
if(active.length < 1){
@@ -59881,7 +39402,7 @@ Ext.menu.MenuMgr = function(){
}
}
- // private
+
function onShow(m){
var last = active.last();
lastShow = new Date();
@@ -59899,7 +39420,7 @@ Ext.menu.MenuMgr = function(){
}
}
- // private
+
function onBeforeHide(m){
if(m.activeChild){
m.activeChild.hide();
@@ -59910,7 +39431,7 @@ Ext.menu.MenuMgr = function(){
}
}
- // private
+
function onBeforeShow(m){
var pm = m.parentMenu;
if(!pm && !m.allowOtherMenus){
@@ -59920,7 +39441,7 @@ Ext.menu.MenuMgr = function(){
}
}
- // private
+
function onMouseDown(e){
if(lastShow.getElapsed() > 50 && active.length > 0 && !e.getTarget(".x-menu")){
hideAll();
@@ -59929,15 +39450,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();
@@ -59951,28 +39469,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);
@@ -59981,7 +39494,7 @@ Ext.menu.MenuMgr = function(){
menu.un("show", onShow);
},
- // private
+
registerCheckable : function(menuItem){
var g = menuItem.group;
if(g){
@@ -59992,7 +39505,7 @@ Ext.menu.MenuMgr = function(){
}
},
- // private
+
unregisterCheckable : function(menuItem){
var g = menuItem.group;
if(g){
@@ -60000,7 +39513,7 @@ Ext.menu.MenuMgr = function(){
}
},
- // private
+
onCheckChange: function(item, state){
if(item.group && state){
var group = groups[item.group],
@@ -60042,78 +39555,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:<div class="mdetail-params"><ul>
- * <li><code>b</code> : Item<div class="sub-desc">This menu Item.</div></li>
- * <li><code>e</code> : EventObject<div class="sub-desc">The click event.</div></li>
- * </ul></div>
- */
- /**
- * @cfg {Object} scope
- * The scope (<tt><b>this</b></tt> 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){
@@ -60121,7 +39590,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){
@@ -60137,12 +39606,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 (<code>this</code> 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);
@@ -60150,7 +39614,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)){
@@ -60160,7 +39624,7 @@ Ext.menu.BaseItem = Ext.extend(Ext.Component, {
}
},
- // private
+
activate : function(){
if(this.disabled){
return false;
@@ -60172,18 +39636,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){
@@ -60200,35 +39664,20 @@ Ext.menu.BaseItem = Ext.extend(Ext.Component, {
Ext.menu.BaseItem.superclass.beforeDestroy.call(this);
},
- // 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 <tt>text</tt> 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) {
if (typeof config == 'string') {
config = {
@@ -60238,7 +39687,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;
@@ -60247,32 +39696,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;
@@ -60282,79 +39716,42 @@ 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,
- /**
- * @cfg {String} altText The altText to use for the icon, if it exists. Defaults to <tt>''</tt>.
- */
+
altText: '',
- // doc'd in BaseItem
+
hideDelay: 200,
- // private
+
ctype: 'Ext.menu.Item',
initComponent : function(){
Ext.menu.Item.superclass.initComponent.call(this);
if(this.menu){
- // If array of items, turn it into an object config so we
- // can set the ownerCt property in the config
+
+
if (Ext.isArray(this.menu)){
this.menu = { items: this.menu };
}
- // An object config will work here, but an instance of a menu
- // will have already setup its ref's and have no effect
+
+
if (Ext.isObject(this.menu)){
this.menu.ownerCt = this;
}
@@ -60364,11 +39761,11 @@ 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(
- '<a id="{id}" class="{cls}" hidefocus="true" unselectable="on" href="{href}"',
+ '<a id="{id}" class="{cls} x-unselectable" hidefocus="true" unselectable="on" href="{href}"',
'<tpl if="hrefTarget">',
' target="{hrefTarget}"',
'</tpl>',
@@ -60382,7 +39779,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);
@@ -60401,10 +39798,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||'&#160;';
if(this.rendered){
@@ -60413,10 +39807,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;
@@ -60425,7 +39816,7 @@ Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, {
}
},
- //private
+
beforeDestroy: function(){
clearTimeout(this.showTimer);
clearTimeout(this.hideTimer);
@@ -60436,15 +39827,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();
@@ -60455,7 +39846,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()){
@@ -60466,13 +39857,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);
@@ -60485,7 +39876,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);
@@ -60494,7 +39885,7 @@ Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, {
}
},
- // private
+
hideMenu : function(){
clearTimeout(this.showTimer);
delete this.showTimer;
@@ -60503,7 +39894,7 @@ Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, {
}
},
- // private
+
deferHide : function(){
delete this.hideTimer;
if(this.menu.over){
@@ -60513,72 +39904,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 first 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){
@@ -60590,17 +39945,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)){
@@ -60615,83 +39966,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
- * <p>A menu containing an {@link Ext.DatePicker} Component.</p>
- * <p>Notes:</p><div class="mdetail-params"><ul>
- * <li>Although not listed here, the <b>constructor</b> for this class
- * accepts all of the configuration options of <b>{@link Ext.DatePicker}</b>.</li>
- * <li>If subclassing DateMenu, any configuration options for the DatePicker must be
- * applied to the <tt><b>initialConfig</b></tt> property of the DateMenu.
- * Applying {@link Ext.DatePicker DatePicker} configuration settings to
- * <b><tt>this</tt></b> will <b>not</b> affect the DatePicker's configuration.</li>
- * </ul></div>
- * @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:<div class="mdetail-params"><ul>
- * <li><code>picker</code> : DatePicker<div class="sub-desc">The Ext.DatePicker.</div></li>
- * <li><code>date</code> : Date<div class="sub-desc">The selected date.</div></li>
- * </ul></div>
- */
- /**
- * @cfg {Object} scope
- * The scope (<tt><b>this</b></tt> reference) in which the <code>{@link #handler}</code>
- * 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 <tt>null</tt>.
- */
+
+
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);
@@ -60702,19 +40004,14 @@ Ext.reg('menucheckitem', Ext.menu.CheckItem);/**
plain: true,
showSeparator: false,
items: this.picker = new Ext.DatePicker(Ext.applyIf({
- internalRender: this.strict || !Ext.isIE,
+ internalRender: this.strict || !Ext.isIE9m,
ctCls: 'x-menu-date-item',
id: this.pickerId
}, this.initialConfig))
});
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);
@@ -60737,83 +40034,34 @@ 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
- * <p>A menu containing a {@link Ext.ColorPalette} Component.</p>
- * <p>Notes:</p><div class="mdetail-params"><ul>
- * <li>Although not listed here, the <b>constructor</b> for this class
- * accepts all of the configuration options of <b>{@link Ext.ColorPalette}</b>.</li>
- * <li>If subclassing ColorMenu, any configuration options for the ColorPalette must be
- * applied to the <tt><b>initialConfig</b></tt> property of the ColorMenu.
- * Applying {@link Ext.ColorPalette ColorPalette} configuration settings to
- * <b><tt>this</tt></b> will <b>not</b> affect the ColorPalette's configuration.</li>
- * </ul></div> *
- * @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:<div class="mdetail-params"><ul>
- * <li><code>palette</code> : ColorPalette<div class="sub-desc">The {@link #palette Ext.ColorPalette}.</div></li>
- * <li><code>color</code> : String<div class="sub-desc">The 6-digit color hex code (without the # symbol).</div></li>
- * </ul></div>
- */
- /**
- * @cfg {Object} scope
- * The scope (<tt><b>this</b></tt> reference) in which the <code>{@link #handler}</code>
- * 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 <tt>null</tt>.
- */
+
+
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, {
plain: true,
@@ -60824,12 +40072,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){
@@ -60844,220 +40087,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, {
- /**
- * <p>The label Element associated with this Field. <b>Only available after this Field has been rendered by a
- * {@link form Ext.layout.FormLayout} layout manager.</b></p>
- * @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 <tt>inputType:'file'</tt>, {@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 '').
- * <b>Note</b>: 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
- * <tt>true</tt> to disable {@link #markInvalid marking the field invalid}.
- * Defaults to <tt>false</tt>.
- */
- /**
- * @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 <p>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 <tt>{@link Ext.Component#autoEl autoEl}</tt> for details. Defaults to:</p>
- * <pre><code>{tag: 'input', type: 'text', size: '20', autocomplete: 'off'}</code></pre>
- */
+
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 <p>The location where the message text set through {@link #markInvalid} should display.
- * Must be one of the following values:</p>
- * <div class="mdetail-params"><ul>
- * <li><code>qtip</code> Display a quick tip containing the message when the user hovers over the field. This is the default.
- * <div class="subdesc"><b>{@link Ext.QuickTips#init Ext.QuickTips.init} must have been called for this setting to work.</b></div</li>
- * <li><code>title</code> Display the message in a default browser title attribute popup.</li>
- * <li><code>under</code> Add a block div beneath the field containing the error message.</li>
- * <li><code>side</code> Add an error icon to the right of the field, displaying the message in a popup on hover.</li>
- * <li><code>[element id]</code> Add the error message directly to the innerHTML of the specified element.</li>
- * </ul></div>
- */
+
msgTarget : 'qtip',
- /**
- * @cfg {String} msgFx <b>Experimental</b> The effect used when displaying a validation message under the field
- * (defaults to 'normal').
- */
+
msgFx : 'normal',
- /**
- * @cfg {Boolean} readOnly <tt>true</tt> to mark the field as readOnly in HTML
- * (defaults to <tt>false</tt>).
- * <br><p><b>Note</b>: this only sets the element's readOnly DOM attribute.
- * Setting <code>readOnly=true</code>, 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
- * <code>{@link Ext.form.TriggerField#hideTrigger hideTrigger}</code>.</p>
- */
+
readOnly : false,
- /**
- * @cfg {Boolean} disabled True to disable the field (defaults to false).
- * <p>Be aware that conformant with the <a href="http://www.w3.org/TR/html401/interact/forms.html#h-17.12.1">HTML specification</a>,
- * disabled Fields will not be {@link Ext.form.BasicForm#submit submitted}.</p>
- */
+
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 <tt>true</tt>.
- */
+
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: <pre><code>
-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();
- }
- }
- }
- }
- ],
- ...
-});
- * </code></pre>
- * @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();
@@ -61091,38 +40191,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 <code>true</code>.
- * @type mixed
- * @property originalValue
- */
+
this.originalValue = this.getValue();
},
- /**
- * <p>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.</p>
- * <p>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 <i>original value</i> is updated when the values are loaded by
- * {@link Ext.form.BasicForm}.{@link Ext.form.BasicForm#setValues setValues}.</p>
- * @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;
@@ -61130,10 +40215,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;
@@ -61141,43 +40223,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.getKeyEvent(), 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){
@@ -61185,22 +40264,16 @@ var form = new Ext.form.FormPanel({
}
if(!this.hasFocus){
this.hasFocus = true;
- /**
- * <p>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.</p>
- * <p><b>This will be undefined until the Field has been visited.</b> Compare {@link #originalValue}.</p>
- * @type mixed
- * @property startValue
- */
+
this.startValue = this.getValue();
this.fireEvent('focus', this);
}
},
- // private
+
beforeBlur : Ext.emptyFn,
- // private
+
onBlur : function(){
this.beforeBlur();
if(this.focusClass){
@@ -61218,16 +40291,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. <b>Note</b>: {@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;
@@ -61239,10 +40306,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();
@@ -61251,27 +40315,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) {
@@ -61282,35 +40333,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 || '';
},
- /**
- * <p>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.</p>
- * <p><b>Note</b>: this method does not cause the Field's {@link #validate} method to return <code>false</code>
- * if the value does <i>pass</i> 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.</p>
- * {@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;
@@ -61330,11 +40365,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();
@@ -61353,53 +40386,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){
@@ -61408,10 +40428,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;
@@ -61423,20 +40440,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){
@@ -61446,21 +40455,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
- */
+
+
+
});
@@ -61470,7 +40473,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();
}
},
@@ -61493,7 +40496,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;
}
@@ -61521,7 +40524,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;
@@ -61553,7 +40556,7 @@ Ext.form.MessageTargets = {
}
};
-// anything other than normal should be considered experimental
+
Ext.form.Field.msgFx = {
normal : {
show: function(msgEl, f){
@@ -61588,206 +40591,65 @@ Ext.form.Field.msgFx = {
}
};
Ext.reg('field', Ext.form.Field);
-/**
- * @class Ext.form.TextField
- * @extends Ext.form.Field
- * <p>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}).</p>
- * <p><b><u>Validation</u></b></p>
- * <p>The validation procedure is described in the documentation for {@link #validateValue}.</p>
- * <p><b><u>Alter Validation Behavior</u></b></p>
- * <p>Validation behavior for each field can be configured:</p>
- * <div class="mdetail-params"><ul>
- * <li><code>{@link Ext.form.TextField#invalidText invalidText}</code> : the default validation message to
- * show if any validation step above does not provide a message when invalid</li>
- * <li><code>{@link Ext.form.TextField#maskRe maskRe}</code> : filter out keystrokes before any validation occurs</li>
- * <li><code>{@link Ext.form.TextField#stripCharsRe stripCharsRe}</code> : filter characters after being typed in,
- * but before being validated</li>
- * <li><code>{@link Ext.form.Field#invalidClass invalidClass}</code> : alternate style when invalid</li>
- * <li><code>{@link Ext.form.Field#validateOnBlur validateOnBlur}</code>,
- * <code>{@link Ext.form.Field#validationDelay validationDelay}</code>, and
- * <code>{@link Ext.form.Field#validationEvent validationEvent}</code> : modify how/when validation is triggered</li>
- * </ul></div>
- *
- * @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 <b><code>{@link #vtype}</code></b> currently set for this field (defaults to <tt>''</tt>). <b>Note</b>:
- * only applies if <b><code>{@link #vtype}</code></b> is set, else ignored.
- */
- /**
- * @cfg {RegExp} stripCharsRe A JavaScript RegExp object used to strip unwanted content from the value
- * before validation (defaults to <tt>null</tt>).
- */
- /**
- * @cfg {Boolean} grow <tt>true</tt> if this field should automatically grow and shrink to its content
- * (defaults to <tt>false</tt>)
- */
+
+
+
grow : false,
- /**
- * @cfg {Number} growMin The minimum width to allow when <code><b>{@link #grow}</b> = true</code> (defaults
- * to <tt>30</tt>)
- */
+
growMin : 30,
- /**
- * @cfg {Number} growMax The maximum width to allow when <code><b>{@link #grow}</b> = true</code> (defaults
- * to <tt>800</tt>)
- */
+
growMax : 800,
- /**
- * @cfg {String} vtype A validation type name as defined in {@link Ext.form.VTypes} (defaults to <tt>null</tt>)
- */
+
vtype : null,
- /**
- * @cfg {RegExp} maskRe An input mask regular expression that will be used to filter keystrokes that do
- * not match (defaults to <tt>null</tt>). The maskRe will not operate on any paste events.
- */
+
maskRe : null,
- /**
- * @cfg {Boolean} disableKeyFilter Specify <tt>true</tt> to disable input keystroke filtering (defaults
- * to <tt>false</tt>)
- */
+
disableKeyFilter : false,
- /**
- * @cfg {Boolean} allowBlank Specify <tt>false</tt> to validate that the value's length is > 0 (defaults to
- * <tt>true</tt>)
- */
+
allowBlank : true,
- /**
- * @cfg {Number} minLength Minimum input field length required (defaults to <tt>0</tt>)
- */
+
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 <tt><b>{@link Ext.form.Field#autoCreate autoCreate}</b></tt> to add
- * any attributes you want to a field, for example:<pre><code>
-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'}
-});
-</code></pre>
- */
+
maxLength : Number.MAX_VALUE,
- /**
- * @cfg {String} minLengthText Error text to display if the <b><tt>{@link #minLength minimum length}</tt></b>
- * validation fails (defaults to <tt>'The minimum length for this field is {minLength}'</tt>)
- */
+
minLengthText : 'The minimum length for this field is {0}',
- /**
- * @cfg {String} maxLengthText Error text to display if the <b><tt>{@link #maxLength maximum length}</tt></b>
- * validation fails (defaults to <tt>'The maximum length for this field is {maxLength}'</tt>)
- */
+
maxLengthText : 'The maximum length for this field is {0}',
- /**
- * @cfg {Boolean} selectOnFocus <tt>true</tt> to automatically select any existing field text when the field
- * receives input focus (defaults to <tt>false</tt>)
- */
+
selectOnFocus : false,
- /**
- * @cfg {String} blankText The error text to display if the <b><tt>{@link #allowBlank}</tt></b> validation
- * fails (defaults to <tt>'This field is required'</tt>)
- */
+
blankText : 'This field is required',
- /**
- * @cfg {Function} validator
- * <p>A custom validation function to be called during field validation ({@link #validateValue})
- * (defaults to <tt>null</tt>). If specified, this function will be called first, allowing the
- * developer to override the default validation process.</p>
- * <br><p>This function will be passed the following Parameters:</p>
- * <div class="mdetail-params"><ul>
- * <li><code>value</code>: <i>Mixed</i>
- * <div class="sub-desc">The current field value</div></li>
- * </ul></div>
- * <br><p>This function is to Return:</p>
- * <div class="mdetail-params"><ul>
- * <li><code>true</code>: <i>Boolean</i>
- * <div class="sub-desc"><code>true</code> if the value is valid</div></li>
- * <li><code>msg</code>: <i>String</i>
- * <div class="sub-desc">An error message if the value is invalid</div></li>
- * </ul></div>
- */
+
validator : null,
- /**
- * @cfg {RegExp} regex A JavaScript RegExp object to be tested against the field value during validation
- * (defaults to <tt>null</tt>). If the test fails, the field will be marked invalid using
- * <b><tt>{@link #regexText}</tt></b>.
- */
+
regex : null,
- /**
- * @cfg {String} regexText The error text to display if <b><tt>{@link #regex}</tt></b> is used and the
- * test fails during validation (defaults to <tt>''</tt>)
- */
+
regexText : '',
- /**
- * @cfg {String} emptyText The default text to place into an empty field (defaults to <tt>null</tt>).
- * <b>Note</b>: 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 <b><tt>{@link #emptyText}</tt></b>
- * (defaults to <tt>'x-form-empty-field'</tt>). This class is automatically added and removed as needed
- * depending on the current field value.
- */
+
emptyClass : 'x-form-empty-field',
- /**
- * @cfg {Boolean} enableKeyEvents <tt>true</tt> to enable the proxying of key events for the HTML input
- * field (defaults to <tt>false</tt>)
- */
+
initComponent : function(){
Ext.form.TextField.superclass.initComponent.call(this);
this.addEvents(
- /**
- * @event autosize
- * Fires when the <tt><b>{@link #autoSize}</b></tt> 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 <tt><b>{@link #enableKeyEvents}</b></tt>
- * 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 <tt><b>{@link #enableKeyEvents}</b></tt>
- * 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 <tt><b>{@link #enableKeyEvents}</b></tt>
- * 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'){
@@ -61797,9 +40659,9 @@ var myField = new Ext.form.NumberField({
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){
+ if(this.selectOnFocus || this.emptyText){
this.mon(this.el, 'mousedown', this.onMouseDown, this);
-
+
if(this.emptyText){
this.applyEmptyText();
}
@@ -61820,7 +40682,7 @@ var myField = new Ext.form.NumberField({
});
}
},
-
+
onMouseDown: function(e){
if(!this.hasFocus){
this.mon(this.el, 'mouseup', Ext.emptyFn, this, { single: true, preventDefault: true });
@@ -61843,16 +40705,16 @@ var myField = new Ext.form.NumberField({
this.validationTask.delay(this.validationDelay);
}
},
-
- //private
+
+
onDisable: function(){
Ext.form.TextField.superclass.onDisable.call(this);
if(Ext.isIE){
this.el.dom.unselectable = 'on';
}
},
-
- //private
+
+
onEnable: function(){
Ext.form.TextField.superclass.onEnable.call(this);
if(Ext.isIE){
@@ -61860,38 +40722,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 <tt><b>{@link #emptyText}</b></tt> and <tt><b>{@link #emptyClass}</b></tt> if the
- * original value was blank.
- */
+
reset : function(){
Ext.form.TextField.superclass.reset.call(this);
this.applyEmptyText();
@@ -61904,7 +40762,7 @@ var myField = new Ext.form.NumberField({
}
},
- // private
+
preFocus : function(){
var el = this.el,
isEmpty;
@@ -61920,12 +40778,12 @@ var myField = new Ext.form.NumberField({
}
},
- // private
+
postBlur : function(){
this.applyEmptyText();
},
- // private
+
filterKeys : function(e){
if(e.ctrlKey){
return;
@@ -61953,74 +40811,7 @@ var myField = new Ext.form.NumberField({
return this;
},
- /**
- * <p>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:</p>
- * <div class="mdetail-params"><ul>
- *
- * <li><b>1. Field specific validator</b>
- * <div class="sub-desc">
- * <p>A validator offers a way to customize and reuse a validation specification.
- * If a field is configured with a <code>{@link #validator}</code>
- * function, it will be passed the current field value. The <code>{@link #validator}</code>
- * function is expected to return either:
- * <div class="mdetail-params"><ul>
- * <li>Boolean <tt>true</tt> if the value is valid (validation continues).</li>
- * <li>a String to represent the invalid message if invalid (validation halts).</li>
- * </ul></div>
- * </div></li>
- *
- * <li><b>2. Basic Validation</b>
- * <div class="sub-desc">
- * <p>If the <code>{@link #validator}</code> has not halted validation,
- * basic validation proceeds as follows:</p>
- *
- * <div class="mdetail-params"><ul>
- *
- * <li><code>{@link #allowBlank}</code> : (Invalid message =
- * <code>{@link #emptyText}</code>)<div class="sub-desc">
- * Depending on the configuration of <code>{@link #allowBlank}</code>, a
- * blank field will cause validation to halt at this step and return
- * Boolean true or false accordingly.
- * </div></li>
- *
- * <li><code>{@link #minLength}</code> : (Invalid message =
- * <code>{@link #minLengthText}</code>)<div class="sub-desc">
- * If the passed value does not satisfy the <code>{@link #minLength}</code>
- * specified, validation halts.
- * </div></li>
- *
- * <li><code>{@link #maxLength}</code> : (Invalid message =
- * <code>{@link #maxLengthText}</code>)<div class="sub-desc">
- * If the passed value does not satisfy the <code>{@link #maxLength}</code>
- * specified, validation halts.
- * </div></li>
- *
- * </ul></div>
- * </div></li>
- *
- * <li><b>3. Preconfigured Validation Types (VTypes)</b>
- * <div class="sub-desc">
- * <p>If none of the prior validation steps halts validation, a field
- * configured with a <code>{@link #vtype}</code> will utilize the
- * corresponding {@link Ext.form.VTypes VTypes} validation function.
- * If invalid, either the field's <code>{@link #vtypeText}</code> 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.</p>
- * </div></li>
- *
- * <li><b>4. Field specific regex test</b>
- * <div class="sub-desc">
- * <p>If none of the prior validation steps halts validation, a field's
- * configured <code>{@link #regex}</code> test will be processed.
- * The invalid message for this test is configured with
- * <code>{@link #regexText}</code>.</p>
- * </div></li>
- *
- * @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);
@@ -62035,14 +40826,14 @@ var myField = new Ext.form.NumberField({
if (value.length < 1 || value === this.emptyText) {
if (this.allowBlank) {
- //if value is blank and allowBlank is true, there cannot be any additional errors
+
return errors;
} else {
errors.push(this.blankText);
}
}
- if (!this.allowBlank && (value.length < 1 || value === this.emptyText)) { // if it's blank
+ if (!this.allowBlank && (value.length < 1 || value === this.emptyText)) {
errors.push(this.blankText);
}
@@ -62068,11 +40859,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;
@@ -62097,10 +40884,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 <tt><b>{@link #grow}</b> = true</tt>, and fires the {@link #autosize} event.
- */
+
autoSize : function(){
if(!this.grow || !this.rendered){
return;
@@ -62116,11 +40900,11 @@ var myField = new Ext.form.NumberField({
Ext.removeNode(d);
d = null;
v += '&#160;';
- 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);
},
-
+
onDestroy: function(){
if(this.validationTask){
this.validationTask.cancel();
@@ -62130,88 +40914,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:
- * <pre><code>
-var trigger = new Ext.form.TriggerField();
-trigger.onTriggerClick = myTriggerFn;
-trigger.applyToMarkup('my-field');
-</code></pre>
- *
- * 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 <tt>'x-form-trigger'</tt> by default and <tt>triggerClass</tt> will be <b>appended</b> if specified.
- */
- /**
- * @cfg {Mixed} triggerConfig
- * <p>A {@link Ext.DomHelper DomHelper} config object specifying the structure of the
- * trigger element for this Field. (Optional).</p>
- * <p>Specify this when you need a customized element to act as the trigger button for a TriggerField.</p>
- * <p>Note that when using this option, it is the developer's responsibility to ensure correct sizing, positioning
- * and appearance of the trigger. Defaults to:</p>
- * <pre><code>{tag: "img", src: Ext.BLANK_IMAGE_URL, cls: "x-form-trigger " + this.triggerClass}</code></pre>
- */
- /**
- * @cfg {String/Object} autoCreate <p>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 <tt>{@link Ext.Component#autoEl autoEl}</tt> for details. Defaults to:</p>
- * <pre><code>{tag: "input", type: "text", size: "16", autocomplete: "off"}</code></pre>
- */
+
+
+
defaultAutoCreate : {tag: "input", type: "text", size: "16", autocomplete: "off"},
- /**
- * @cfg {Boolean} hideTrigger <tt>true</tt> to hide the trigger element and display only the base
- * text field (defaults to <tt>false</tt>)
- */
+
hideTrigger:false,
- /**
- * @cfg {Boolean} editable <tt>false</tt> 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 <tt>true</tt>).
- */
+
editable: true,
- /**
- * @cfg {Boolean} readOnly <tt>true</tt> 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 <tt>false</tt>)
- */
+
readOnly: false,
- /**
- * @cfg {String} wrapFocusClass The class added to the to the wrap of the trigger element. Defaults to
- * <tt>x-trigger-wrap-focus</tt>.
- */
+
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();
@@ -62229,14 +40959,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);
@@ -62278,10 +41008,7 @@ Ext.form.TriggerField = Ext.extend(Ext.form.TextField, {
}
},
- /**
- * Changes the hidden status of the trigger.
- * @param {Boolean} hideTrigger True to hide the trigger, false to show it.
- */
+
setHideTrigger: function(hideTrigger){
if(hideTrigger != this.hideTrigger){
this.hideTrigger = hideTrigger;
@@ -62289,13 +41016,7 @@ Ext.form.TriggerField = Ext.extend(Ext.form.TextField, {
}
},
- /**
- * 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 {@link #editable} config option at config time.
- * @param {Boolean} value True to allow the user to directly edit the field text.
- */
+
setEditable: function(editable){
if(editable != this.editable){
this.editable = editable;
@@ -62303,13 +41024,7 @@ Ext.form.TriggerField = Ext.extend(Ext.form.TextField, {
}
},
- /**
- * Setting this to true will supersede settings {@link #editable} and {@link #hideTrigger}.
- * Setting this to false will defer back to {@link #editable} and {@link #hideTrigger}. This method
- * is the runtime equivalent of setting the {@link #readOnly} config option at config time.
- * @param {Boolean} value True to prevent the user changing the field and explicitly
- * hide the trigger.
- */
+
setReadOnly: function(readOnly){
if(readOnly != this.readOnly){
this.readOnly = readOnly;
@@ -62322,14 +41037,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){
@@ -62339,7 +41054,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){
@@ -62352,24 +41067,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);
@@ -62384,61 +41099,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:
- * <a href="http://extjs.com/deploy/ext/examples/form/custom.html">http://extjs.com/deploy/ext/examples/form/custom.html</a>
- */
+
Ext.form.TwinTriggerField = Ext.extend(Ext.form.TriggerField, {
- /**
- * @cfg {Mixed} triggerConfig
- * <p>A {@link Ext.DomHelper DomHelper} config object specifying the structure of the trigger elements
- * for this Field. (Optional).</p>
- * <p>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 <tt>x-form-trigger</tt> (also see
- * <tt>{@link #trigger1Class}</tt> and <tt>{@link #trigger2Class}</tt>).</p>
- * <p>Note that when using this option, it is the developer's responsibility to ensure correct sizing,
- * positioning and appearance of the triggers.</p>
- */
- /**
- * @cfg {String} trigger1Class
- * An additional CSS class used to style the trigger button. The trigger will always get the
- * class <tt>'x-form-trigger'</tt> by default and <tt>triggerClass</tt> will be <b>appended</b> if specified.
- */
- /**
- * @cfg {String} trigger2Class
- * An additional CSS class used to style the trigger button. The trigger will always get the
- * class <tt>'x-form-trigger'</tt> by default and <tt>triggerClass</tt> will be <b>appended</b> if specified.
- */
+
+
+
initComponent : function(){
Ext.form.TwinTriggerField.superclass.initComponent.call(this);
@@ -62507,69 +41186,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.reg('twintrigger', Ext.form.TwinTriggerField);
Ext.form.TextArea = Ext.extend(Ext.form.TextField, {
- /**
- * @cfg {Number} growMin The minimum height to allow when <tt>{@link Ext.form.TextField#grow grow}=true</tt>
- * (defaults to <tt>60</tt>)
- */
+
growMin : 60,
- /**
- * @cfg {Number} growMax The maximum height to allow when <tt>{@link Ext.form.TextField#grow grow}=true</tt>
- * (defaults to <tt>1000</tt>)
- */
+
growMax: 1000,
growAppend : '&#160;\n&#160;',
enterIsSpecial : false,
- /**
- * @cfg {Boolean} preventScrollbars <tt>true</tt> to prevent scrollbars from appearing regardless of how much text is
- * in the field. This option is only relevant when {@link #grow} is <tt>true</tt>. Equivalent to setting overflow: hidden, defaults to
- * <tt>false</tt>.
- */
+
preventScrollbars: false,
- /**
- * @cfg {String/Object} autoCreate <p>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 <tt>{@link Ext.Component#autoEl autoEl}</tt> for details. Defaults to:</p>
- * <pre><code>{tag: "textarea", style: "width:100px;height:60px;", autocomplete: "off"}</code></pre>
- */
- // private
+
+
onRender : function(ct, position){
if(!this.el){
this.defaultAutoCreate = {
@@ -62600,23 +41243,20 @@ Ext.form.TextArea = Ext.extend(Ext.form.TextField, {
this.fireEvent("specialkey", this, e);
}
},
-
- // private
+
+
doAutoSize : function(e){
return !e.isNavKeyPress() || e.getKey() == e.ENTER;
},
- // inherit docs
+
filterValidation: function(e) {
if(!e.isNavKeyPress() || (!this.enterIsSpecial && e.keyCode == e.ENTER)){
this.validationTask.delay(this.validationDelay);
}
},
- /**
- * 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;
@@ -62625,7 +41265,7 @@ Ext.form.TextArea = Ext.extend(Ext.form.TextField, {
v = Ext.util.Format.htmlEncode(el.dom.value),
ts = this.textSizeEl,
h;
-
+
Ext.fly(ts).setWidth(this.el.getWidth());
if(v.length < 1){
v = "&#160;&#160;";
@@ -62644,84 +41284,47 @@ 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",
- /**
- * @cfg {Boolean} autoStripChars True to automatically strip not allowed characters from the field. Defaults to <tt>false</tt>
- */
+
autoStripChars: false,
- // private
+
initEvents : function() {
var allowed = this.baseChars + '';
if (this.allowDecimals) {
@@ -62739,20 +41342,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 = Ext.isDefined(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;
}
@@ -62785,33 +41381,24 @@ Ext.form.NumberField = Ext.extend(Ext.form.TextField, {
v = isNaN(v) ? '' : String(v).replace(".", this.decimalSeparator);
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);
+ 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);
@@ -62832,139 +41419,52 @@ 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.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 <tt>'m/d/Y'</tt>).
- */
+
format : "m/d/Y",
- /**
- * @cfg {String} altFormats
- * Multiple date formats separated by "<tt>|</tt>" to try when parsing a user input value and it
- * does not match the defined format (defaults to
- * <tt>'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|n-j|n/j'</tt>).
- */
+
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|n-j|n/j",
- /**
- * @cfg {String} disabledDaysText
- * The tooltip to display when the date falls on a disabled day (defaults to <tt>'Disabled'</tt>)
- */
+
disabledDaysText : "Disabled",
- /**
- * @cfg {String} disabledDatesText
- * The tooltip text to display when the date falls on a disabled date (defaults to <tt>'Disabled'</tt>)
- */
+
disabledDatesText : "Disabled",
- /**
- * @cfg {String} minText
- * The error text to display when the date in the cell is before <tt>{@link #minValue}</tt> (defaults to
- * <tt>'The date in this field must be after {minValue}'</tt>).
- */
+
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 <tt>{@link #maxValue}</tt> (defaults to
- * <tt>'The date in this field must be before {maxValue}'</tt>).
- */
+
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
- * <tt>'{value} is not a valid date - it must be in the format {format}'</tt>).
- */
+
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 <tt>'x-form-trigger'</tt> and <tt>triggerClass</tt> will be <b>appended</b> if specified
- * (defaults to <tt>'x-form-date-trigger'</tt> which displays a calendar icon).
- */
+
triggerClass : 'x-form-date-trigger',
- /**
- * @cfg {Boolean} showToday
- * <tt>false</tt> 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 <tt>true</tt>).
- */
+
showToday : true,
- /**
- * @cfg {Number} startDay
- * Day index at which the week should begin, 0-based (defaults to 0, which is Sunday)
- */
+
startDay : 0,
- /**
- * @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:<pre><code>
-// disable Sunday and Saturday:
-disabledDays: [0, 6]
-// disable weekdays:
-disabledDays: [1,2,3,4,5]
- * </code></pre>
- */
- /**
- * @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:<pre><code>
-// 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"]
- * </code></pre>
- * 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: <tt>["03\\.08\\.03"]</tt>.
- */
- /**
- * @cfg {String/Object} autoCreate
- * A {@link Ext.DomHelper DomHelper element specification object}, or <tt>true</tt> for the default element
- * specification object:<pre><code>
- * autoCreate: {tag: "input", type: "text", size: "10", autocomplete: "off"}
- * </code></pre>
- */
- // 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 (Date.formatContainsHourInfo(format)) {
- // 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) {
@@ -62977,12 +41477,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'
);
@@ -63008,7 +41503,7 @@ disabledDates: ["^03"]
},
- // private
+
initDisabledDays : function(){
if(this.disabledDates){
var dd = this.disabledDates,
@@ -63025,11 +41520,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 <tt>{@link #disabledDates}</tt> config
- * for details on supported values) used to disable a pattern of dates.
- */
+
setDisabledDates : function(dd){
this.disabledDates = dd;
this.initDisabledDays();
@@ -63038,11 +41529,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 <tt>{@link #disabledDays}</tt>
- * config for details on supported values.
- */
+
setDisabledDays : function(dd){
this.disabledDays = dd;
if(this.menu){
@@ -63050,10 +41537,7 @@ disabledDates: ["^03"]
}
},
- /**
- * Replaces any existing <tt>{@link #minValue}</tt> 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){
@@ -63061,10 +41545,7 @@ disabledDates: ["^03"]
}
},
- /**
- * Replaces any existing <tt>{@link #maxValue}</tt> 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){
@@ -63072,21 +41553,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;
}
@@ -63125,47 +41598,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 <tt>{@link #format}</tt> as the date format, according
- * to the same rules as {@link Date#parseDate} (the default format used is <tt>"m/d/Y"</tt>).
- * <br />Usage:
- * <pre><code>
-//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');
-</code></pre>
- * @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;
@@ -63185,23 +41634,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;
@@ -63231,7 +41677,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);
@@ -63249,7 +41695,7 @@ dateField.setValue('2006-05-04');
this.menuEvents('un');
},
- // private
+
beforeBlur : function(){
var v = this.parseDate(this.getRawValue());
if(v){
@@ -63257,46 +41703,23 @@ 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.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 <tt>"x-form-display-field"</tt>)
- */
+
fieldClass : "x-form-display-field",
- /**
- * @cfg {Boolean} htmlEncode <tt>false</tt> to skip HTML-encoding the text when rendering it (defaults to
- * <tt>false</tt>). 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(){
@@ -63321,7 +41744,7 @@ Ext.form.DisplayField = Ext.extend(Ext.form.Field, {
getValue : function(){
return this.getRawValue();
},
-
+
getName: function() {
return this.name;
},
@@ -63337,449 +41760,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
- * <p>A combobox control with support for autocomplete, remote-loading, paging and many other features.</p>
- * <p>A ComboBox works in a similar manner to a traditional HTML &lt;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 <i>{@link #displayField}</i> is shown in the text field
- * which is named according to the {@link #name}.</p>
- * <p><b><u>Events</u></b></p>
- * <p>To do something when something in ComboBox is selected, configure the select event:<pre><code>
-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);
- * </code></pre></p>
- *
- * <p><b><u>ComboBox in Grid</u></b></p>
- * <p>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:<pre><code>
-// 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
- },
- ...
-]);
- * </code></pre></p>
- *
- * <p><b><u>Filtering</u></b></p>
- * <p>A ComboBox {@link #doQuery uses filtering itself}, for information about filtering the ComboBox
- * store manually see <tt>{@link #lastQuery}</tt>.</p>
- * @constructor
- * Create a new ComboBox.
- * @param {Object} config Configuration options
- * @xtype combo
- */
+Ext.reg('displayfield', Ext.form.DisplayField);
+
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 <tt>{@link #lazyRender} = true</tt>.
- */
- /**
- * @cfg {Boolean} lazyRender <tt>true</tt> 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 <tt>false</tt>).
- */
- /**
- * @cfg {String/Object} autoCreate <p>A {@link Ext.DomHelper DomHelper} element spec, or <tt>true</tt> for a default
- * element spec. Used to create the {@link Ext.Component#getEl Element} which will encapsulate this Component.
- * See <tt>{@link Ext.Component#autoEl autoEl}</tt> for details. Defaults to:</p>
- * <pre><code>{tag: "input", type: "text", size: "24", autocomplete: "off"}</code></pre>
- */
- /**
- * @cfg {Ext.data.Store/Array} store The data source to which this combo is bound (defaults to <tt>undefined</tt>).
- * Acceptable values for this property are:
- * <div class="mdetail-params"><ul>
- * <li><b>any {@link Ext.data.Store Store} subclass</b></li>
- * <li><b>an Array</b> : 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.
- * <div class="mdetail-params"><ul>
- * <li><b>1-dimensional array</b> : (e.g., <tt>['Foo','Bar']</tt>)<div class="sub-desc">
- * A 1-dimensional array will automatically be expanded (each array item will be used for both the combo
- * {@link #valueField} and {@link #displayField})</div></li>
- * <li><b>2-dimensional array</b> : (e.g., <tt>[['f','Foo'],['b','Bar']]</tt>)<div class="sub-desc">
- * 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}.
- * </div></li></ul></div></li></ul></div>
- * <p>See also <tt>{@link #mode}</tt>.</p>
- */
- /**
- * @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 <tt>{@link #minListWidth}
- */
- /**
- * @cfg {String} displayField The underlying {@link Ext.data.Field#name data field name} to bind to this
- * ComboBox (defaults to undefined if <tt>{@link #mode} = 'remote'</tt> or <tt>'field1'</tt> if
- * {@link #transform transforming a select} or if the {@link #store field name is autogenerated based on
- * the store configuration}).
- * <p>See also <tt>{@link #valueField}</tt>.</p>
- * <p><b>Note</b>: 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.</p>
- */
- /**
- * @cfg {String} valueField The underlying {@link Ext.data.Field#name data value name} to bind to this
- * ComboBox (defaults to undefined if <tt>{@link #mode} = 'remote'</tt> or <tt>'field2'</tt> if
- * {@link #transform transforming a select} or if the {@link #store field name is autogenerated based on
- * the store configuration}).
- * <p><b>Note</b>: use of a <tt>valueField</tt> requires the user to make a selection in order for a value to be
- * mapped. See also <tt>{@link #hiddenName}</tt>, <tt>{@link #hiddenValue}</tt>, and <tt>{@link #displayField}</tt>.</p>
- */
- /**
- * @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}.
- */
- /**
- * @cfg {String} hiddenId If <tt>{@link #hiddenName}</tt> is specified, <tt>hiddenId</tt> can also be provided
- * to give the hidden field a unique id. The <tt>hiddenId</tt> 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
- * <tt>{@link Ext.form.Field#value value}</tt>.
- */
- /**
- * @cfg {String} listClass The CSS class to add to the predefined <tt>'x-combo-list'</tt> 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 <tt>'x-combo-selected'</tt>)
- */
+
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 <tt>'x-form-trigger'</tt> and <tt>triggerClass</tt> will be <b>appended</b> if specified
- * (defaults to <tt>'x-form-arrow-trigger'</tt> which displays a downward arrow icon).
- */
+
triggerClass : 'x-form-arrow-trigger',
- /**
- * @cfg {Boolean/String} shadow <tt>true</tt> or <tt>"sides"</tt> for the default effect, <tt>"frame"</tt> for
- * 4-way shadow, and <tt>"drop"</tt> for bottom-right
- */
+
shadow : 'sides',
- /**
- * @cfg {String/Array} listAlign A valid anchor position value. See <tt>{@link Ext.Element#alignTo}</tt> for details
- * on supported anchor positions and offsets. To specify x/y offsets as well, this value
- * may be specified as an Array of <tt>{@link Ext.Element#alignTo}</tt> method arguments.</p>
- * <pre><code>[ 'tl-bl?', [6,0] ]</code></pre>(defaults to <tt>'tl-bl?'</tt>)
- */
+
listAlign : 'tl-bl?',
- /**
- * @cfg {Number} maxHeight The maximum height in pixels of the dropdown list before scrollbars are shown
- * (defaults to <tt>300</tt>)
- */
+
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 <tt>90</tt>)
- */
+
minHeight : 90,
- /**
- * @cfg {String} triggerAction The action to execute when the trigger is clicked.
- * <div class="mdetail-params"><ul>
- * <li><b><tt>'query'</tt></b> : <b>Default</b>
- * <p class="sub-desc">{@link #doQuery run the query} using the {@link Ext.form.Field#getRawValue raw value}.</p></li>
- * <li><b><tt>'all'</tt></b> :
- * <p class="sub-desc">{@link #doQuery run the query} specified by the <tt>{@link #allQuery}</tt> config option</p></li>
- * </ul></div>
- * <p>See also <code>{@link #queryParam}</code>.</p>
- */
+
triggerAction : 'query',
- /**
- * @cfg {Number} minChars The minimum number of characters the user must type before autocomplete and
- * {@link #typeAhead} activate (defaults to <tt>4</tt> if <tt>{@link #mode} = 'remote'</tt> or <tt>0</tt> if
- * <tt>{@link #mode} = 'local'</tt>, does not apply if
- * <tt>{@link Ext.form.TriggerField#editable editable} = false</tt>).
- */
+
minChars : 4,
- /**
- * @cfg {Boolean} autoSelect <tt>true</tt> to select the first result gathered by the data store (defaults
- * to <tt>true</tt>). 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 <tt>true</tt> 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 <tt>false</tt>)
- */
+
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 <tt>500</tt> if <tt>{@link #mode} = 'remote'</tt>
- * or <tt>10</tt> if <tt>{@link #mode} = 'local'</tt>)
- */
+
queryDelay : 500,
- /**
- * @cfg {Number} pageSize If greater than <tt>0</tt>, 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 <tt>{@link #mode} = 'remote'</tt>
- * (defaults to <tt>0</tt>).
- */
+
pageSize : 0,
- /**
- * @cfg {Boolean} selectOnFocus <tt>true</tt> to select any existing text in the field immediately on focus.
- * Only applies when <tt>{@link Ext.form.TriggerField#editable editable} = true</tt> (defaults to
- * <tt>false</tt>).
- */
+
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 <tt>'query'</tt>)
- */
+
queryParam : 'query',
- /**
- * @cfg {String} loadingText The text to display in the dropdown list while data is loading. Only applies
- * when <tt>{@link #mode} = 'remote'</tt> (defaults to <tt>'Loading...'</tt>)
- */
+
loadingText : 'Loading...',
- /**
- * @cfg {Boolean} resizable <tt>true</tt> 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 <tt>false</tt>.
- */
+
resizable : false,
- /**
- * @cfg {Number} handleHeight The height in pixels of the dropdown list resize handle if
- * <tt>{@link #resizable} = true</tt> (defaults to <tt>8</tt>)
- */
+
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:
- * <div class="mdetail-params"><ul>
- * <li><b><tt>'remote'</tt></b> : <b>Default</b>
- * <p class="sub-desc">Automatically loads the <tt>{@link #store}</tt> the <b>first</b> 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 <tt>'local'</tt> and manually load the store. To force a requery of the store
- * <b>every</b> time the trigger is clicked see <tt>{@link #lastQuery}</tt>.</p></li>
- * <li><b><tt>'local'</tt></b> :
- * <p class="sub-desc">ComboBox loads local data</p>
- * <pre><code>
-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'
-});
- * </code></pre></li>
- * </ul></div>
- */
+
mode: 'remote',
- /**
- * @cfg {Number} minListWidth The minimum width of the dropdown list in pixels (defaults to <tt>70</tt>, will
- * be ignored if <tt>{@link #listWidth}</tt> has a higher value)
- */
+
minListWidth : 70,
- /**
- * @cfg {Boolean} forceSelection <tt>true</tt> to restrict the selected value to one of the values in the list,
- * <tt>false</tt> to allow the user to set arbitrary text into the field (defaults to <tt>false</tt>)
- */
+
forceSelection : false,
- /**
- * @cfg {Number} typeAheadDelay The length of time in milliseconds to wait until the typeahead text is displayed
- * if <tt>{@link #typeAhead} = true</tt> (defaults to <tt>250</tt>)
- */
+
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 <tt>true</tt> to not initialize the list for this combo until the field is focused
- * (defaults to <tt>true</tt>)
- */
+
+
lazyInit : true,
- /**
- * @cfg {Boolean} clearFilterOnReset <tt>true</tt> to clear any filters on the store (when in local mode) when reset is called
- * (defaults to <tt>true</tt>)
- */
+
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 <tt>undefined</tt>.
- */
+
submitValue: undefined,
- /**
- * The value of the match string used to filter the store. Delete this property to force a requery.
- * Example use:
- * <pre><code>
-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;
- }
- }
-});
- * </code></pre>
- * To make sure the filter in the store is not cleared the first time the ComboBox trigger is used
- * configure the combo with <tt>lastQuery=''</tt>. Example use:
- * <pre><code>
-var combo = new Ext.form.ComboBox({
- ...
- mode: 'local',
- triggerAction: 'all',
- lastQuery: ''
-});
- * </code></pre>
- * @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:<ul>
- * <li><code>combo</code> : Ext.form.ComboBox <div class="sub-desc">This combo box</div></li>
- * <li><code>query</code> : String <div class="sub-desc">The query</div></li>
- * <li><code>forceAll</code> : Boolean <div class="sub-desc">True to force "all" query</div></li>
- * <li><code>cancel</code> : Boolean <div class="sub-desc">Set to true to cancel the query</div></li>
- * </ul>
- */
+
'beforequery'
);
if(this.transform){
@@ -63807,7 +41887,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);
@@ -63815,7 +41895,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){
@@ -63838,7 +41918,7 @@ var combo = new Ext.form.ComboBox({
}
},
- // private
+
onRender : function(ct, position){
if(this.hiddenName && !Ext.isDefined(this.submitValue)){
this.submitValue = false;
@@ -63860,7 +41940,7 @@ var combo = new Ext.form.ComboBox({
}
},
- // private
+
initValue : function(){
Ext.form.ComboBox.superclass.initValue.call(this);
if(this.hiddenField){
@@ -63889,7 +41969,7 @@ var combo = new Ext.form.ComboBox({
return (zindex || 12000) + 5;
},
- // private
+
initList : function(){
if(!this.list){
var cls = 'x-combo-list',
@@ -63931,40 +42011,12 @@ var combo = new Ext.form.ComboBox({
}
if(!this.tpl){
- /**
- * @cfg {String/Ext.XTemplate} tpl <p>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}.</p>
- * <p>The default template string is:</p><pre><code>
- '&lt;tpl for=".">&lt;div class="x-combo-list-item">{' + this.displayField + '}&lt;/div>&lt;/tpl>'
- * </code></pre>
- * <p>Override the default value to create custom UI layouts for items in the list.
- * For example:</p><pre><code>
- '&lt;tpl for=".">&lt;div ext:qtip="{state}. {nick}" class="x-combo-list-item">{state}&lt;/div>&lt;/tpl>'
- * </code></pre>
- * <p>The template <b>must</b> contain one or more substitution parameters using field
- * names from the Combo's</b> {@link #store Store}. In the example above an
- * <pre>ext:qtip</pre> attribute is added to display other fields from the Store.</p>
- * <p>To preserve the default visual look of list items, add the CSS class name
- * <pre>x-combo-list-item</pre> to the template's container element.</p>
- * <p>Also see {@link #itemSelector} for additional details.</p>
- */
+
this.tpl = '<tpl for="."><div class="'+cls+'-item">{' + this.displayField + '}</div></tpl>';
- /**
- * @cfg {String} itemSelector
- * <p>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.</p>
- * <p><b>Note</b>: this setting is <b>required</b> if a custom XTemplate has been
- * specified in {@link #tpl} which assigns a class other than <pre>'x-combo-list-item'</pre>
- * to dropdown list items</b>
- */
- }
-
- /**
- * 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,
@@ -63999,57 +42051,17 @@ var combo = new Ext.form.ComboBox({
}
},
- /**
- * <p>Returns the element used to house this ComboBox's pop-up list. Defaults to the document body.</p>
- * 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:<pre><code>
-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
- ]
-});
-</code></pre>
- */
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){
@@ -64098,27 +42110,11 @@ var menu = new Ext.menu.Menu({
Ext.form.ComboBox.superclass.reset.call(this);
},
- // private
+
initEvents : function(){
Ext.form.ComboBox.superclass.initEvents.call(this);
- /**
- * @property keyNav
- * @type 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>
- */
+
this.keyNav = new Ext.KeyNav(this.el, {
"up" : function(e){
this.inKeyMode = true;
@@ -64155,10 +42151,10 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
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)
+ if((((Ext.isIE9 && Ext.isStrict) || Ext.isIE10p) || !Ext.isIE) && Ext.EventManager.useKeydown){
+
this.scope.fireKey(e);
}
return relay;
@@ -64181,7 +42177,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
},
- // private
+
onDestroy : function(){
if (this.dqTask){
this.dqTask.cancel();
@@ -64198,14 +42194,14 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
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){
@@ -64223,7 +42219,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
}
},
- // private
+
onEnable : function(){
Ext.form.ComboBox.superclass.onEnable.apply(this, arguments);
if(this.hiddenField){
@@ -64231,7 +42227,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
}
},
- // private
+
onDisable : function(){
Ext.form.ComboBox.superclass.onDisable.apply(this, arguments);
if(this.hiddenField){
@@ -64239,7 +42235,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
}
},
- // private
+
onBeforeLoad : function(){
if(!this.hasFocus){
return;
@@ -64250,7 +42246,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
this.selectedIndex = -1;
},
- // private
+
onLoad : function(){
if(!this.hasFocus){
return;
@@ -64280,7 +42276,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
},
- // private
+
onTypeAhead : function(){
if(this.store.getCount() > 0){
var r = this.store.getAt(0);
@@ -64294,7 +42290,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
}
},
- // private
+
assertValue : function(){
var val = this.getRawValue(),
rec;
@@ -64314,9 +42310,9 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
}
}else{
if(rec && this.valueField){
- // 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 (this.value == val){
return;
}
@@ -64326,7 +42322,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
}
},
- // private
+
onSelect : function(record, index){
if(this.fireEvent('beforeselect', this, record, index) !== false){
this.setValue(record.data[this.valueField || this.displayField]);
@@ -64335,16 +42331,13 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
}
},
- // 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 : '';
@@ -64353,9 +42346,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
}
},
- /**
- * Clears any text/value currently set in the field
- */
+
clearValue : function(){
if(this.hiddenField){
this.hiddenField.value = '';
@@ -64366,14 +42357,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
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){
@@ -64393,7 +42377,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
return this;
},
- // private
+
findRecord : function(prop, value){
var record;
if(this.store.getCount() > 0){
@@ -64407,14 +42391,14 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
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);
@@ -64424,7 +42408,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
}
},
- // private
+
onViewClick : function(doFocus){
var index = this.view.getSelectedIndexes()[0],
s = this.store,
@@ -64440,7 +42424,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
},
- // private
+
restrictHeight : function(){
this.innerList.dom.style.height = '';
var inner = this.innerList.dom,
@@ -64459,21 +42443,12 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
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);
@@ -64485,13 +42460,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
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);
@@ -64504,7 +42473,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
},
- // private
+
selectNext : function(){
var ct = this.store.getCount();
if(ct > 0){
@@ -64516,7 +42485,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
}
},
- // private
+
selectPrev : function(){
var ct = this.store.getCount();
if(ct > 0){
@@ -64528,7 +42497,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
}
},
- // private
+
onKeyUp : function(e){
var k = e.getKey();
if(this.editable !== false && this.readOnly !== true && (k == e.BACKSPACE || !e.isSpecialKey())){
@@ -64539,36 +42508,29 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
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 <tt>true</tt> to force the query to execute even if there are currently fewer
- * characters in the field than the minimum specified by the <tt>{@link #minChars}</tt> config option. It
- * also clears any filter previously saved in the current store (defaults to <tt>false</tt>)
- */
+
doQuery : function(q, forceAll){
q = Ext.isEmpty(q) ? '' : q;
var qe = {
@@ -64607,7 +42569,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
}
},
- // private
+
getParams : function(q){
var params = {},
paramNames = this.store.paramNames;
@@ -64618,9 +42580,7 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
return params;
},
- /**
- * Hides the dropdown list if it is currently expanded. Fires the {@link #collapse} event on completion.
- */
+
collapse : function(){
if(!this.isExpanded()){
return;
@@ -64631,16 +42591,14 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
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;
@@ -64662,11 +42620,11 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
}
this.list.alignTo.apply(this.list, [this.el].concat(this.listAlign));
- // zindex can change, re-check it and set it if necessary
+
this.list.setZIndex(this.getZIndex());
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,
@@ -64676,12 +42634,9 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
this.fireEvent('expand', this);
},
- /**
- * @method onTriggerClick
- * @hide
- */
- // private
- // Implements the default empty TriggerField.onTriggerClick function
+
+
+
onTriggerClick : function(){
if(this.readOnly || this.disabled){
return;
@@ -64700,87 +42655,42 @@ myCombo.keyNav.tab = function() { // Override TAB handling function
}
}
- /**
- * @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 <tt>true</tt> if the checkbox should render initially checked (defaults to <tt>false</tt>)
- */
+
checked : false,
- /**
- * @cfg {String} boxLabel The text that appears beside the checkbox
- */
+
boxLabel: '&#160;',
- /**
- * @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} 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:
- * <div class="mdetail-params"><ul>
- * <li><b>checkbox</b> : Ext.form.Checkbox<div class="sub-desc">The Checkbox being toggled.</div></li>
- * <li><b>checked</b> : Boolean<div class="sub-desc">The new checked state of the checkbox.</div></li>
- * </ul></div>
- */
- /**
- * @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){
@@ -64788,7 +42698,7 @@ Ext.form.Checkbox = Ext.extend(Ext.form.Field, {
}
},
- // private
+
initEvents : function(){
Ext.form.Checkbox.superclass.initEvents.call(this);
this.mon(this.el, {
@@ -64798,20 +42708,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){
@@ -64826,28 +42728,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 && !Ext.isStrict) {
+
+ if (Ext.isIEQuirks) {
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;
@@ -64855,20 +42754,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
- * <code>{@link #handler}</code> (if configured).
- * @param {Boolean/String} checked The following values will check the checkbox:
- * <code>true, 'true', '1', or 'on'</code>. Any other value will uncheck the checkbox.
- * @return {Ext.form.Field} this
- */
+
setValue : function(v){
var checked = this.checked,
inputVal = this.inputValue;
@@ -64893,90 +42786,35 @@ Ext.form.Checkbox = Ext.extend(Ext.form.Field, {
}
});
Ext.reg('checkbox', Ext.form.Checkbox);
-/**
- * @class Ext.form.CheckboxGroup
- * @extends Ext.form.Field
- * <p>A grouping container for {@link Ext.form.Checkbox} controls.</p>
- * <p>Sample usage:</p>
- * <pre><code>
-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'}
- ]
-});
- * </code></pre>
- * @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:
- * <ul><li><b>'auto'</b> : <p class="sub-desc">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.</p></li>
- * <li><b>Number</b> : <p class="sub-desc">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}.</p></li>
- * <li><b>Array</b> : Object<p class="sub-desc">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.</p></li></ul>
- */
+
+
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 = {
@@ -64986,7 +42824,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',
@@ -65000,7 +42838,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},
@@ -65013,25 +42851,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<this.columns; i++){
- cs.push((100/this.columns)*.01); // distribute by even %
+ cs.push((100/this.columns)*.01);
}
this.columns = cs;
}
numCols = this.columns.length;
- // Generate the column configs with the correct width setting
+
for(var i=0; i<numCols; i++){
var cc = Ext.apply({items:[]}, colCfg);
cc[this.columns[i] <= 1 ? 'columnWidth' : 'width'] = this.columns[i];
@@ -65041,7 +42879,7 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
cols.push(cc);
};
- // Distribute the original items into the columns
+
if(this.vertical){
var rows = Math.ceil(this.items.length / numCols), ri = 0;
for(var i=0, len=this.items.length; i<len; i++){
@@ -65106,16 +42944,16 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
});
},
- // private
+
doLayout: function(){
- //ugly method required to layout hidden items
+
if(this.rendered){
this.panel.forceLayout = this.ownerCt.forceLayout;
this.panel.doLayout();
}
},
- // private
+
fireChecked: function(){
var arr = [];
this.eachItem(function(item){
@@ -65126,11 +42964,7 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
this.fireEvent('change', this, arr);
},
- /**
- * Runs CheckboxGroup's validations and returns an array of any errors. The only error by default
- * is if allowBlank is set to true and no items are checked.
- * @return {Array} Array of all validation errors
- */
+
getErrors: function() {
var errors = Ext.form.CheckboxGroup.superclass.getErrors.apply(this, arguments);
@@ -65149,9 +42983,9 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
return errors;
},
- // private
+
isDirty: function(){
- //override the behaviour to check sub items.
+
if (this.disabled || !this.rendered) {
return false;
}
@@ -65168,7 +43002,7 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
return dirty;
},
- // private
+
setReadOnly : function(readOnly){
if(this.rendered){
this.eachItem(function(item){
@@ -65178,38 +43012,38 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
this.readOnly = readOnly;
},
- // private
+
onDisable : function(){
this.eachItem(function(item){
item.disable();
});
},
- // private
+
onEnable : function(){
this.eachItem(function(item){
item.enable();
});
},
- // private
+
onResize : function(w, h){
this.panel.setSize(w, h);
this.panel.doLayout();
},
- // inherit docs from Field
+
reset : function(){
if (this.originalValue) {
- // Clear all items
+
this.eachItem(function(c){
if(c.setValue){
c.setValue(false);
c.originalValue = c.getValue();
}
});
- // Set items stored in originalValue, ugly - set a flag to reset the originalValue
- // during the horrible onSetValue. This will allow trackResetOnLoad to function.
+
+
this.resetOriginal = true;
this.setValue(this.originalValue);
delete this.resetOriginal;
@@ -65220,34 +43054,14 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
}
});
}
- // Defer the clearInvalid so if BaseForm's collection is being iterated it will be called AFTER it is complete.
- // Important because reset is being called on both the group and the individual items.
+
+
(function() {
this.clearInvalid();
}).defer(50, this);
},
- /**
- * {@link Ext.form.Checkbox#setValue Set the value(s)} of an item or items
- * in the group. Examples illustrating how this method may be called:
- * <pre><code>
-// call with name and value
-myCheckboxGroup.setValue('cb-col-1', true);
-// call with an array of boolean values
-myCheckboxGroup.setValue([true, false, false]);
-// call with an object literal specifying item:value pairs
-myCheckboxGroup.setValue({
- 'cb-col-2': false,
- 'cb-col-3': true
-});
-// use comma separated string to set items with name to true (checked)
-myCheckboxGroup.setValue('cb-col-1,cb-col-3');
- * </code></pre>
- * See {@link Ext.form.Checkbox#setValue} for additional information.
- * @param {Mixed} id The checkbox to check, or as described by example shown.
- * @param {Boolean} value (optional) The value to set the item.
- * @return {Ext.form.CheckboxGroup} this
- */
+
setValue: function(){
if(this.rendered){
this.onSetValue.apply(this, arguments);
@@ -65258,29 +43072,17 @@ myCheckboxGroup.setValue('cb-col-1,cb-col-3');
return this;
},
- /**
- * @private
- * Sets the values of one or more of the items within the CheckboxGroup
- * @param {String|Array|Object} id Can take multiple forms. Can be optionally:
- * <ul>
- * <li>An ID string to be used with a second argument</li>
- * <li>An array of the form ['some', 'list', 'of', 'ids', 'to', 'mark', 'checked']</li>
- * <li>An array in the form [true, true, false, true, false] etc, where each item relates to the check status of
- * the checkbox at the same index</li>
- * <li>An object containing ids of the checkboxes as keys and check values as properties</li>
- * </ul>
- * @param {String} value The value to set the field to if the first argument was a string
- */
+
onSetValue: function(id, value){
if(arguments.length == 1){
if(Ext.isArray(id)){
Ext.each(id, function(val, idx){
- if (Ext.isObject(val) && val.setValue){ // array of checkbox components to be checked
+ if (Ext.isObject(val) && val.setValue){
val.setValue(true);
if (this.resetOriginal === true) {
val.originalValue = val.getValue();
}
- } else { // an array of boolean values
+ } else {
var item = this.items.itemAt(idx);
if(item){
item.setValue(val);
@@ -65288,7 +43090,7 @@ myCheckboxGroup.setValue('cb-col-1,cb-col-3');
}
}, this);
}else if(Ext.isObject(id)){
- // set of name/value pairs
+
for(var i in id){
var f = this.getBox(i);
if(f){
@@ -65306,7 +43108,7 @@ myCheckboxGroup.setValue('cb-col-1,cb-col-3');
}
},
- // private
+
beforeDestroy: function(){
Ext.destroy(this.panel);
if (!this.rendered) {
@@ -65325,7 +43127,7 @@ myCheckboxGroup.setValue('cb-col-1,cb-col-3');
});
},
- // private
+
getBox : function(id){
var box = null;
this.eachItem(function(f){
@@ -65337,10 +43139,7 @@ myCheckboxGroup.setValue('cb-col-1,cb-col-3');
return box;
},
- /**
- * Gets an array of the selected {@link Ext.form.Checkbox} in the group.
- * @return {Array} An array of the selected checkboxes.
- */
+
getValue : function(){
var out = [];
this.eachItem(function(item){
@@ -65351,118 +43150,46 @@ myCheckboxGroup.setValue('cb-col-1,cb-col-3');
return out;
},
- /**
- * @private
- * Convenience function which passes the given function to every item in the composite
- * @param {Function} fn The function to call
- * @param {Object} scope Optional scope object
- */
+
eachItem: function(fn, scope) {
if(this.items && this.items.each){
this.items.each(fn, scope || this);
}
},
- /**
- * @cfg {String} name
- * @hide
- */
- /**
- * @method getRawValue
- * @hide
- */
+
+
getRawValue : Ext.emptyFn,
- /**
- * @method setRawValue
- * @hide
- */
+
setRawValue : Ext.emptyFn
});
Ext.reg('checkboxgroup', Ext.form.CheckboxGroup);
-/**
- * @class Ext.form.CompositeField
- * @extends Ext.form.Field
- * Composite field allowing a number of form Fields to be rendered on the same row. The fields are rendered
- * using an hbox layout internally, so all of the normal HBox layout config items are available. Example usage:
- * <pre>
-{
- xtype: 'compositefield',
- labelWidth: 120
- items: [
- {
- xtype : 'textfield',
- fieldLabel: 'Title',
- width : 20
- },
- {
- xtype : 'textfield',
- fieldLabel: 'First',
- flex : 1
- },
- {
- xtype : 'textfield',
- fieldLabel: 'Last',
- flex : 1
- }
- ]
-}
- * </pre>
- * In the example above the composite's fieldLabel will be set to 'Title, First, Last' as it groups the fieldLabels
- * of each of its children. This can be overridden by setting a fieldLabel on the compositefield itself:
- * <pre>
-{
- xtype: 'compositefield',
- fieldLabel: 'Custom label',
- items: [...]
-}
- * </pre>
- * Any Ext.form.* component can be placed inside a composite field.
- */
+
Ext.form.CompositeField = Ext.extend(Ext.form.Field, {
- /**
- * @property defaultMargins
- * @type String
- * The margins to apply by default to each field in the composite
- */
+
defaultMargins: '0 5 0 0',
- /**
- * @property skipLastItemMargin
- * @type Boolean
- * If true, the defaultMargins are not applied to the last item in the composite field set (defaults to true)
- */
+
skipLastItemMargin: true,
- /**
- * @property isComposite
- * @type Boolean
- * Signifies that this is a Composite field
- */
+
isComposite: true,
- /**
- * @property combineErrors
- * @type Boolean
- * True to combine errors from the individual fields into a single error message at the CompositeField level (defaults to true)
- */
+
combineErrors: true,
- /**
- * @cfg {String} labelConnector The string to use when joining segments of the built label together (defaults to ', ')
- */
+
labelConnector: ', ',
- /**
- * @cfg {Object} defaults Any default properties to assign to the child fields.
- */
- //inherit docs
- //Builds the composite field label
+
+
+
initComponent: function() {
var labels = [],
items = this.items,
@@ -65477,10 +43204,10 @@ Ext.form.CompositeField = Ext.extend(Ext.form.Field, {
labels.push(item.fieldLabel);
- //apply any defaults
+
Ext.applyIf(item, this.defaults);
- //apply default margins to each item except the last
+
if (!(i == j - 1 && this.skipLastItemMargin)) {
Ext.applyIf(item, {margins: this.defaultMargins});
}
@@ -65488,13 +43215,7 @@ Ext.form.CompositeField = Ext.extend(Ext.form.Field, {
this.fieldLabel = this.fieldLabel || this.buildLabel(labels);
- /**
- * @property fieldErrors
- * @type Ext.util.MixedCollection
- * MixedCollection of current errors on the Composite's subfields. This is used internally to track when
- * to show and hide error messages at the Composite level. Listeners are attached to the MixedCollection's
- * add, remove and replace events to update the error icon in the UI as errors are added or removed.
- */
+
this.fieldErrors = new Ext.util.MixedCollection(true, function(item) {
return item.field;
});
@@ -65515,40 +43236,30 @@ Ext.form.CompositeField = Ext.extend(Ext.form.Field, {
defaultMargins: '0 3 0 0',
ownerCt: this
});
- this.innerCt.ownerCt = undefined;
+ delete this.innerCt.ownerCt;
var fields = this.innerCt.findBy(function(c) {
return c.isFormField;
}, this);
- /**
- * @property items
- * @type Ext.util.MixedCollection
- * Internal collection of all of the subfields in this Composite
- */
+
this.items = new Ext.util.MixedCollection();
this.items.addAll(fields);
},
- /**
- * @private
- * Creates an internal container using hbox and renders the fields to it
- */
+
onRender: function(ct, position) {
if (!this.el) {
- /**
- * @property innerCt
- * @type Ext.Container
- * A container configured with hbox layout which is responsible for laying out the subfields
- */
+
var innerCt = this.innerCt;
innerCt.render(ct);
+ this.innerCt.ownerCt = this;
this.el = innerCt.getEl();
- //if we're combining subfield errors into a single message, override the markInvalid and clearInvalid
- //methods of each subfield and show them at the Composite level instead
+
+
if (this.combineErrors) {
this.eachItem(function(field) {
Ext.apply(field, {
@@ -65558,7 +43269,7 @@ Ext.form.CompositeField = Ext.extend(Ext.form.Field, {
});
}
- //set the label 'for' to the first item
+
var l = this.el.parent().parent().child('label', true);
if (l) {
l.setAttribute('for', this.items.items[0].id);
@@ -65568,12 +43279,7 @@ Ext.form.CompositeField = Ext.extend(Ext.form.Field, {
Ext.form.CompositeField.superclass.onRender.apply(this, arguments);
},
- /**
- * Called if combineErrors is true and a subfield's markInvalid method is called.
- * By default this just adds the subfield's error to the internal fieldErrors MixedCollection
- * @param {Ext.form.Field} field The field that was marked invalid
- * @param {String} message The error message
- */
+
onFieldMarkInvalid: function(field, message) {
var name = field.getName(),
error = {
@@ -65589,30 +43295,21 @@ Ext.form.CompositeField = Ext.extend(Ext.form.Field, {
}
},
- /**
- * Called if combineErrors is true and a subfield's clearInvalid method is called.
- * By default this just updates the internal fieldErrors MixedCollection.
- * @param {Ext.form.Field} field The field that was marked invalid
- */
+
onFieldClearInvalid: function(field) {
this.fieldErrors.removeKey(field.getName());
field.el.removeClass(field.invalidClass);
},
- /**
- * @private
- * Called after a subfield is marked valid or invalid, this checks to see if any of the subfields are
- * currently invalid. If any subfields are invalid it builds a combined error message marks the composite
- * invalid, otherwise clearInvalid is called
- */
+
updateInvalidMark: function() {
var ieStrict = Ext.isIE6 && Ext.isStrict;
if (this.fieldErrors.length == 0) {
this.clearInvalid();
- //IE6 in strict mode has a layout bug when using 'under' as the error message target. This fixes it
+
if (ieStrict) {
this.clearInvalid.defer(50, this);
}
@@ -65622,17 +43319,14 @@ Ext.form.CompositeField = Ext.extend(Ext.form.Field, {
this.sortErrors();
this.markInvalid(message);
- //IE6 in strict mode has a layout bug when using 'under' as the error message target. This fixes it
+
if (ieStrict) {
this.markInvalid(message);
}
}
},
- /**
- * Performs validation checks on each subfield and returns false if any of them fail validation.
- * @return {Boolean} False if any subfield failed validation
- */
+
validateValue: function(value, preventMark) {
var valid = true;
@@ -65645,13 +43339,7 @@ Ext.form.CompositeField = Ext.extend(Ext.form.Field, {
return valid;
},
- /**
- * Takes an object containing error messages for contained fields, returning a combined error
- * string (defaults to just placing each item on a new line). This can be overridden to provide
- * custom combined error message handling.
- * @param {Array} errors Array of errors in format: [{field: 'title', error: 'some error'}]
- * @return {String} The combined error message
- */
+
buildCombinedErrorMessage: function(errors) {
var combined = [],
error;
@@ -65665,11 +43353,7 @@ Ext.form.CompositeField = Ext.extend(Ext.form.Field, {
return combined.join("<br />");
},
- /**
- * Sorts the internal fieldErrors MixedCollection by the order in which the fields are defined.
- * This is called before displaying errors to ensure that the errors are presented in the expected order.
- * This function can be overridden to provide a custom sorting order if needed.
- */
+
sortErrors: function() {
var fields = this.items;
@@ -65687,47 +43371,34 @@ Ext.form.CompositeField = Ext.extend(Ext.form.Field, {
});
},
- /**
- * Resets each field in the composite to their previous value
- */
+
reset: function() {
this.eachItem(function(item) {
item.reset();
});
- // Defer the clearInvalid so if BaseForm's collection is being iterated it will be called AFTER it is complete.
- // Important because reset is being called on both the group and the individual items.
+
+
(function() {
this.clearInvalid();
}).defer(50, this);
},
- /**
- * Calls clearInvalid on all child fields. This is a convenience function and should not often need to be called
- * as fields usually take care of clearing themselves
- */
+
clearInvalidChildren: function() {
this.eachItem(function(item) {
item.clearInvalid();
});
},
- /**
- * Builds a label string from an array of subfield labels.
- * By default this just joins the labels together with a comma
- * @param {Array} segments Array of each of the labels in the composite field's subfields
- * @return {String} The built label
- */
+
buildLabel: function(segments) {
return Ext.clean(segments).join(this.labelConnector);
},
- /**
- * Checks each field in the composite and returns true if any is dirty
- * @return {Boolean} True if any field is dirty
- */
+
isDirty: function(){
- //override the behaviour to check sub items.
+
if (this.disabled || !this.rendered) {
return false;
}
@@ -65742,22 +43413,14 @@ Ext.form.CompositeField = Ext.extend(Ext.form.Field, {
return dirty;
},
- /**
- * @private
- * Convenience function which passes the given function to every item in the composite
- * @param {Function} fn The function to call
- * @param {Object} scope Optional scope object
- */
+
eachItem: function(fn, scope) {
if(this.items && this.items.each){
this.items.each(fn, scope || this);
}
},
- /**
- * @private
- * Passes the resize call through to the inner panel
- */
+
onResize: function(adjWidth, adjHeight, rawWidth, rawHeight) {
var innerCt = this.innerCt;
@@ -65768,10 +43431,7 @@ Ext.form.CompositeField = Ext.extend(Ext.form.Field, {
Ext.form.CompositeField.superclass.onResize.apply(this, arguments);
},
- /**
- * @private
- * Forces the internal container to be laid out again
- */
+
doLayout: function(shallow, force) {
if (this.rendered) {
var innerCt = this.innerCt;
@@ -65781,16 +43441,14 @@ Ext.form.CompositeField = Ext.extend(Ext.form.Field, {
}
},
- /**
- * @private
- */
+
beforeDestroy: function(){
Ext.destroy(this.innerCt);
Ext.form.CompositeField.superclass.beforeDestroy.call(this);
},
- //override the behaviour to check sub items.
+
setReadOnly : function(readOnly) {
if (readOnly == undefined) {
readOnly = true;
@@ -65810,14 +43468,14 @@ Ext.form.CompositeField = Ext.extend(Ext.form.Field, {
this.doLayout();
},
- //override the behaviour to check sub items.
+
onDisable : function(){
this.eachItem(function(item){
item.disable();
});
},
- //override the behaviour to check sub items.
+
onEnable : function(){
this.eachItem(function(item){
item.enable();
@@ -65825,48 +43483,25 @@ Ext.form.CompositeField = Ext.extend(Ext.form.Field, {
}
});
-Ext.reg('compositefield', Ext.form.CompositeField);/**
- * @class Ext.form.Radio
- * @extends Ext.form.Checkbox
- * Single radio field. Same as Checkbox, but provided as a convenience for automatically setting the input type.
- * Radio grouping is handled automatically by the browser if you give each radio in a group the same name.
- * @constructor
- * Creates a new Radio
- * @param {Object} config Configuration options
- * @xtype radio
- */
+Ext.reg('compositefield', Ext.form.CompositeField);
Ext.form.Radio = Ext.extend(Ext.form.Checkbox, {
inputType: 'radio',
- /**
- * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide
- * @method
- */
+
markInvalid : Ext.emptyFn,
- /**
- * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide
- * @method
- */
+
clearInvalid : Ext.emptyFn,
- /**
- * If this radio is part of a group, it will return the selected value
- * @return {String}
- */
+
getGroupValue : function(){
var p = this.el.up('form') || Ext.getBody();
var c = p.child('input[name="'+this.el.dom.name+'"]:checked', true);
return c ? c.value : null;
},
- /**
- * Sets either the checked/unchecked status of this Radio, or, if a string value
- * is passed, checks a sibling Radio of the same name whose value is the value specified.
- * @param value {String/Boolean} Checked value, or the value of the sibling radio button to check.
- * @return {Ext.form.Field} this
- */
+
setValue : function(v){
- var checkEl,
+ var checkEl,
els,
radio;
if (typeof v == 'boolean') {
@@ -65890,7 +43525,7 @@ Ext.form.Radio = Ext.extend(Ext.form.Checkbox, {
return this;
},
- // private
+
getCheckEl: function(){
if(this.inGroup){
return this.el.up('.x-form-radio-group');
@@ -65899,49 +43534,23 @@ Ext.form.Radio = Ext.extend(Ext.form.Checkbox, {
}
});
Ext.reg('radio', Ext.form.Radio);
-/**
- * @class Ext.form.RadioGroup
- * @extends Ext.form.CheckboxGroup
- * A grouping container for {@link Ext.form.Radio} controls.
- * @constructor
- * Creates a new RadioGroup
- * @param {Object} config Configuration options
- * @xtype radiogroup
- */
+
Ext.form.RadioGroup = Ext.extend(Ext.form.CheckboxGroup, {
- /**
- * @cfg {Array} items An Array of {@link Ext.form.Radio Radio}s or Radio config objects
- * to arrange in the group.
- */
- /**
- * @cfg {Boolean} allowBlank True to allow every item in the group to be blank (defaults to true).
- * If allowBlank = false and 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 one item in this group')
- */
+
blankText : 'You must select one item in this group',
-
- // private
+
+
defaultType : 'radio',
-
- // private
+
+
groupCls : 'x-form-radio-group',
-
- /**
- * @event change
- * Fires when the state of a child radio changes.
- * @param {Ext.form.RadioGroup} this
- * @param {Ext.form.Radio} checked The checked radio
- */
-
- /**
- * Gets the selected {@link Ext.form.Radio} in the group, if it exists.
- * @return {Ext.form.Radio} The selected radio.
- */
+
+
+
+
getValue : function(){
var out = null;
this.eachItem(function(item){
@@ -65952,13 +43561,8 @@ Ext.form.RadioGroup = Ext.extend(Ext.form.CheckboxGroup, {
});
return out;
},
-
- /**
- * Sets the checked radio in the group.
- * @param {String/Ext.form.Radio} id The radio to check.
- * @param {Boolean} value The value to set the radio.
- * @return {Ext.form.RadioGroup} this
- */
+
+
onSetValue : function(id, value){
if(arguments.length > 1){
var f = this.getBox(id);
@@ -65976,23 +43580,23 @@ Ext.form.RadioGroup = Ext.extend(Ext.form.CheckboxGroup, {
this.setValueForItem(id);
}
},
-
+
setValueForItem : function(val){
val = String(val).split(',')[0];
this.eachItem(function(item){
item.setValue(val == item.inputValue);
});
},
-
- // private
+
+
fireChecked : function(){
if(!this.checkTask){
this.checkTask = new Ext.util.DelayedTask(this.bufferChecked, this);
}
this.checkTask.delay(10);
},
-
- // private
+
+
bufferChecked : function(){
var out = null;
this.eachItem(function(item){
@@ -66003,7 +43607,7 @@ Ext.form.RadioGroup = Ext.extend(Ext.form.CheckboxGroup, {
});
this.fireEvent('change', this, out);
},
-
+
onDestroy : function(){
if(this.checkTask){
this.checkTask.cancel();
@@ -66015,32 +43619,24 @@ Ext.form.RadioGroup = Ext.extend(Ext.form.CheckboxGroup, {
});
Ext.reg('radiogroup', Ext.form.RadioGroup);
-/**
- * @class Ext.form.Hidden
- * @extends Ext.form.Field
- * A basic hidden field for storing hidden values in forms that need to be passed in the form submit.
- * @constructor
- * Create a new Hidden field.
- * @param {Object} config Configuration options
- * @xtype hidden
- */
+
Ext.form.Hidden = Ext.extend(Ext.form.Field, {
- // private
+
inputType : 'hidden',
shouldLayout: false,
- // private
+
onRender : function(){
Ext.form.Hidden.superclass.onRender.apply(this, arguments);
},
- // private
+
initEvents : function(){
this.originalValue = this.getValue();
},
- // These are all private overrides
+
setSize : Ext.emptyFn,
setWidth : Ext.emptyFn,
setHeight : Ext.emptyFn,
@@ -66049,36 +43645,7 @@ Ext.form.Hidden = Ext.extend(Ext.form.Field, {
markInvalid : Ext.emptyFn,
clearInvalid : Ext.emptyFn
});
-Ext.reg('hidden', Ext.form.Hidden);/**
- * @class Ext.form.BasicForm
- * @extends Ext.util.Observable
- * <p>Encapsulates the DOM &lt;form> element at the heart of the {@link Ext.form.FormPanel FormPanel} class, and provides
- * input field management, validation, submission, and form loading services.</p>
- * <p>By default, Ext Forms are submitted through Ajax, using an instance of {@link Ext.form.Action.Submit}.
- * To enable normal browser submission of an Ext Form, use the {@link #standardSubmit} config option.</p>
- * <p><b><u>File Uploads</u></b></p>
- * <p>{@link #fileUpload File uploads} are not performed using Ajax submission, that
- * is they are <b>not</b> performed using XMLHttpRequests. Instead the form is submitted in the standard
- * manner with the DOM <tt>&lt;form></tt> element temporarily modified to have its
- * <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer
- * to a dynamically generated, hidden <tt>&lt;iframe></tt> which is inserted into the document
- * but removed after the return data has been gathered.</p>
- * <p>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
- * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a> header
- * must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.</p>
- * <p>Characters which are significant to an HTML parser must be sent as HTML entities, so encode
- * "&lt;" as "&amp;lt;", "&amp;" as "&amp;amp;" etc.</p>
- * <p>The response text is retrieved from the document, and a fake XMLHttpRequest object
- * is created containing a <tt>responseText</tt> property in order to conform to the
- * requirements of event handlers and callbacks.</p>
- * <p>Be aware that file upload packets are sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form</a>
- * and some server technologies (notably JEE) may require some custom processing in order to
- * retrieve parameter names and parameter values from the packet content.</p>
- * @constructor
- * @param {Mixed} el The form element or its id
- * @param {Object} config Configuration options
- */
+Ext.reg('hidden', Ext.form.Hidden);
Ext.form.BasicForm = Ext.extend(Ext.util.Observable, {
constructor: function(el, config){
@@ -66086,35 +43653,16 @@ Ext.form.BasicForm = Ext.extend(Ext.util.Observable, {
if(Ext.isString(this.paramOrder)){
this.paramOrder = this.paramOrder.split(/[\s,|]/);
}
- /**
- * A {@link Ext.util.MixedCollection MixedCollection} containing all the Ext.form.Fields in this form.
- * @type MixedCollection
- * @property items
- */
+
this.items = new Ext.util.MixedCollection(false, function(o){
return o.getItemId();
});
this.addEvents(
- /**
- * @event beforeaction
- * Fires before any action is performed. Return false to cancel the action.
- * @param {Form} this
- * @param {Action} action The {@link Ext.form.Action} to be performed
- */
+
'beforeaction',
- /**
- * @event actionfailed
- * Fires when an action fails.
- * @param {Form} this
- * @param {Action} action The {@link Ext.form.Action} that failed
- */
+
'actionfailed',
- /**
- * @event actioncomplete
- * Fires when an action is completed.
- * @param {Form} this
- * @param {Action} action The {@link Ext.form.Action} that completed
- */
+
'actioncomplete'
);
@@ -66124,183 +43672,36 @@ Ext.form.BasicForm = Ext.extend(Ext.util.Observable, {
Ext.form.BasicForm.superclass.constructor.call(this);
},
- /**
- * @cfg {String} method
- * The request method to use (GET or POST) for form actions if one isn't supplied in the action options.
- */
- /**
- * @cfg {DataReader} reader
- * An Ext.data.DataReader (e.g. {@link Ext.data.XmlReader}) to be used to read
- * data when executing 'load' actions. This is optional as there is built-in
- * support for processing JSON. For additional information on using an XMLReader
- * see the example provided in examples/form/xml-form.html.
- */
- /**
- * @cfg {DataReader} errorReader
- * <p>An Ext.data.DataReader (e.g. {@link Ext.data.XmlReader}) to be used to
- * read field error messages returned from 'submit' actions. This is optional
- * as there is built-in support for processing JSON.</p>
- * <p>The Records which provide messages for the invalid Fields must use the
- * Field name (or id) as the Record ID, and must contain a field called 'msg'
- * which contains the error message.</p>
- * <p>The errorReader does not have to be a full-blown implementation of a
- * DataReader. It simply needs to implement a <tt>read(xhr)</tt> function
- * which returns an Array of Records in an object with the following
- * structure:</p><pre><code>
-{
- records: recordArray
-}
-</code></pre>
- */
- /**
- * @cfg {String} url
- * The URL to use for form actions if one isn't supplied in the
- * <code>{@link #doAction doAction} options</code>.
- */
- /**
- * @cfg {Boolean} fileUpload
- * Set to true if this form is a file upload.
- * <p>File uploads are not performed using normal 'Ajax' techniques, that is they are <b>not</b>
- * performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the
- * DOM <tt>&lt;form></tt> element temporarily modified to have its
- * <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer
- * to a dynamically generated, hidden <tt>&lt;iframe></tt> which is inserted into the document
- * but removed after the return data has been gathered.</p>
- * <p>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
- * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a> header
- * must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.</p>
- * <p>Characters which are significant to an HTML parser must be sent as HTML entities, so encode
- * "&lt;" as "&amp;lt;", "&amp;" as "&amp;amp;" etc.</p>
- * <p>The response text is retrieved from the document, and a fake XMLHttpRequest object
- * is created containing a <tt>responseText</tt> property in order to conform to the
- * requirements of event handlers and callbacks.</p>
- * <p>Be aware that file upload packets are sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form</a>
- * and some server technologies (notably JEE) may require some custom processing in order to
- * retrieve parameter names and parameter values from the packet content.</p>
- */
- /**
- * @cfg {Object} baseParams
- * <p>Parameters to pass with all requests. e.g. baseParams: {id: '123', foo: 'bar'}.</p>
- * <p>Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.</p>
- */
- /**
- * @cfg {Number} timeout Timeout for form actions in seconds (default is 30 seconds).
- */
+
+
+
+
+
+
+
timeout: 30,
- /**
- * @cfg {Object} api (Optional) If specified load and submit actions will be handled
- * with {@link Ext.form.Action.DirectLoad} and {@link Ext.form.Action.DirectSubmit}.
- * Methods which have been imported by Ext.Direct can be specified here to load and submit
- * forms.
- * Such as the following:<pre><code>
-api: {
- load: App.ss.MyProfile.load,
- submit: App.ss.MyProfile.submit
-}
-</code></pre>
- * <p>Load actions can use <code>{@link #paramOrder}</code> or <code>{@link #paramsAsHash}</code>
- * to customize how the load method is invoked.
- * Submit actions will always use a standard form submit. The formHandler configuration must
- * be set on the associated server-side method which has been imported by Ext.Direct</p>
- */
- /**
- * @cfg {Array/String} paramOrder <p>A list of params to be executed server side.
- * Defaults to <tt>undefined</tt>. Only used for the <code>{@link #api}</code>
- * <code>load</code> configuration.</p>
- * <br><p>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:</p><pre><code>
-paramOrder: ['param1','param2','param3']
-paramOrder: 'param1 param2 param3'
-paramOrder: 'param1,param2,param3'
-paramOrder: 'param1|param2|param'
- </code></pre>
- */
+
+
paramOrder: undefined,
- /**
- * @cfg {Boolean} paramsAsHash Only used for the <code>{@link #api}</code>
- * <code>load</code> configuration. Send parameters as a collection of named
- * arguments (defaults to <tt>false</tt>). Providing a
- * <tt>{@link #paramOrder}</tt> nullifies this configuration.
- */
+
paramsAsHash: false,
- /**
- * @cfg {String} waitTitle
- * The default title to show for the waiting message box (defaults to <tt>'Please Wait...'</tt>)
- */
+
waitTitle: 'Please Wait...',
- // private
+
activeAction : null,
- /**
- * @cfg {Boolean} trackResetOnLoad If set to <tt>true</tt>, {@link #reset}() resets to the last loaded
- * or {@link #setValues}() data instead of when the form was first created. Defaults to <tt>false</tt>.
- */
+
trackResetOnLoad : false,
- /**
- * @cfg {Boolean} standardSubmit
- * <p>If set to <tt>true</tt>, standard HTML form submits are used instead
- * of XHR (Ajax) style form submissions. Defaults to <tt>false</tt>.</p>
- * <br><p><b>Note:</b> When using <code>standardSubmit</code>, the
- * <code>options</code> to <code>{@link #submit}</code> are ignored because
- * Ext's Ajax infrastracture is bypassed. To pass extra parameters (e.g.
- * <code>baseParams</code> and <code>params</code>), utilize hidden fields
- * to submit extra data, for example:</p>
- * <pre><code>
-new Ext.FormPanel({
- standardSubmit: true,
- baseParams: {
- foo: 'bar'
- },
- {@link url}: 'myProcess.php',
- items: [{
- xtype: 'textfield',
- name: 'userName'
- }],
- buttons: [{
- text: 'Save',
- handler: function(){
- var fp = this.ownerCt.ownerCt,
- form = fp.getForm();
- if (form.isValid()) {
- // check if there are baseParams and if
- // hiddent items have been added already
- if (fp.baseParams && !fp.paramsAdded) {
- // add hidden items for all baseParams
- for (i in fp.baseParams) {
- fp.add({
- xtype: 'hidden',
- name: i,
- value: fp.baseParams[i]
- });
- }
- fp.doLayout();
- // set a custom flag to prevent re-adding
- fp.paramsAdded = true;
- }
- form.{@link #submit}();
- }
- }
- }]
-});
- * </code></pre>
- */
- /**
- * By default wait messages are displayed with Ext.MessageBox.wait. You can target a specific
- * element by passing it or its id or mask the form itself by passing in true.
- * @type Mixed
- * @property waitMsgTarget
- */
- // private
+
+
+
initEl : function(el){
this.el = Ext.get(el);
this.id = this.el.id || Ext.id();
@@ -66310,25 +43711,17 @@ new Ext.FormPanel({
this.el.addClass('x-form');
},
- /**
- * Get the HTML form Element
- * @return Ext.Element
- */
+
getEl: function(){
return this.el;
},
- // private
+
onSubmit : function(e){
e.stopEvent();
},
- /**
- * Destroys this object.
- * @private
- * @param {Boolean} bound true if the object is bound to a form panel. If this is the case
- * the FormPanel will take care of destroying certain things, so we're just doubling up.
- */
+
destroy: function(bound){
if(bound !== true){
this.items.each(function(f){
@@ -66340,10 +43733,7 @@ new Ext.FormPanel({
this.purgeListeners();
},
- /**
- * Returns true if client-side validation on the form is successful.
- * @return Boolean
- */
+
isValid : function(){
var valid = true;
this.items.each(function(f){
@@ -66354,13 +43744,7 @@ new Ext.FormPanel({
return valid;
},
- /**
- * <p>Returns true if any fields in this form have changed from their original values.</p>
- * <p>Note that if this BasicForm was configured with {@link #trackResetOnLoad} then the
- * Fields' <i>original values</i> are updated when the values are loaded by {@link #setValues}
- * or {@link #loadRecord}.</p>
- * @return Boolean
- */
+
isDirty : function(){
var dirty = false;
this.items.each(function(f){
@@ -66372,65 +43756,7 @@ new Ext.FormPanel({
return dirty;
},
- /**
- * Performs a predefined action ({@link Ext.form.Action.Submit} or
- * {@link Ext.form.Action.Load}) or a custom extension of {@link Ext.form.Action}
- * to perform application-specific processing.
- * @param {String/Object} actionName The name of the predefined action type,
- * or instance of {@link Ext.form.Action} to perform.
- * @param {Object} options (optional) The options to pass to the {@link Ext.form.Action}.
- * All of the config options listed below are supported by both the
- * {@link Ext.form.Action.Submit submit} and {@link Ext.form.Action.Load load}
- * actions unless otherwise noted (custom actions could also accept
- * other config options):<ul>
- *
- * <li><b>url</b> : String<div class="sub-desc">The url for the action (defaults
- * to the form's {@link #url}.)</div></li>
- *
- * <li><b>method</b> : String<div class="sub-desc">The form method to use (defaults
- * to the form's method, or POST if not defined)</div></li>
- *
- * <li><b>params</b> : String/Object<div class="sub-desc"><p>The params to pass
- * (defaults to the form's baseParams, or none if not defined)</p>
- * <p>Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.</p></div></li>
- *
- * <li><b>headers</b> : Object<div class="sub-desc">Request headers to set for the action
- * (defaults to the form's default headers)</div></li>
- *
- * <li><b>success</b> : Function<div class="sub-desc">The callback that will
- * be invoked after a successful response (see top of
- * {@link Ext.form.Action.Submit submit} and {@link Ext.form.Action.Load load}
- * for a description of what constitutes a successful response).
- * The function is passed the following parameters:<ul>
- * <li><tt>form</tt> : Ext.form.BasicForm<div class="sub-desc">The form that requested the action</div></li>
- * <li><tt>action</tt> : The {@link Ext.form.Action Action} object which performed the operation.
- * <div class="sub-desc">The action object contains these properties of interest:<ul>
- * <li><tt>{@link Ext.form.Action#response response}</tt></li>
- * <li><tt>{@link Ext.form.Action#result result}</tt> : interrogate for custom postprocessing</li>
- * <li><tt>{@link Ext.form.Action#type type}</tt></li>
- * </ul></div></li></ul></div></li>
- *
- * <li><b>failure</b> : Function<div class="sub-desc">The callback that will be invoked after a
- * failed transaction attempt. The function is passed the following parameters:<ul>
- * <li><tt>form</tt> : The {@link Ext.form.BasicForm} that requested the action.</li>
- * <li><tt>action</tt> : The {@link Ext.form.Action Action} object which performed the operation.
- * <div class="sub-desc">The action object contains these properties of interest:<ul>
- * <li><tt>{@link Ext.form.Action#failureType failureType}</tt></li>
- * <li><tt>{@link Ext.form.Action#response response}</tt></li>
- * <li><tt>{@link Ext.form.Action#result result}</tt> : interrogate for custom postprocessing</li>
- * <li><tt>{@link Ext.form.Action#type type}</tt></li>
- * </ul></div></li></ul></div></li>
- *
- * <li><b>scope</b> : Object<div class="sub-desc">The scope in which to call the
- * callback functions (The <tt>this</tt> reference for the callback functions).</div></li>
- *
- * <li><b>clientValidation</b> : Boolean<div class="sub-desc">Submit Action only.
- * Determines whether a Form's fields are validated in a final call to
- * {@link Ext.form.BasicForm#isValid isValid} prior to submission. Set to <tt>false</tt>
- * to prevent this. If undefined, pre-submission field validation is performed.</div></li></ul>
- *
- * @return {BasicForm} this
- */
+
doAction : function(action, options){
if(Ext.isString(action)){
action = new Ext.form.Action.ACTION_TYPES[action](this, options);
@@ -66442,48 +43768,7 @@ new Ext.FormPanel({
return this;
},
- /**
- * Shortcut to {@link #doAction do} a {@link Ext.form.Action.Submit submit action}.
- * @param {Object} options The options to pass to the action (see {@link #doAction} for details).<br>
- * <p><b>Note:</b> this is ignored when using the {@link #standardSubmit} option.</p>
- * <p>The following code:</p><pre><code>
-myFormPanel.getForm().submit({
- clientValidation: true,
- url: 'updateConsignment.php',
- params: {
- newStatus: 'delivered'
- },
- success: function(form, action) {
- Ext.Msg.alert('Success', action.result.msg);
- },
- failure: function(form, action) {
- switch (action.failureType) {
- case Ext.form.Action.CLIENT_INVALID:
- Ext.Msg.alert('Failure', 'Form fields may not be submitted with invalid values');
- break;
- case Ext.form.Action.CONNECT_FAILURE:
- Ext.Msg.alert('Failure', 'Ajax communication failed');
- break;
- case Ext.form.Action.SERVER_INVALID:
- Ext.Msg.alert('Failure', action.result.msg);
- }
- }
-});
-</code></pre>
- * would process the following server response for a successful submission:<pre><code>
-{
- "success":true, // note this is Boolean, not string
- "msg":"Consignment updated"
-}
-</code></pre>
- * and the following server response for a failed submission:<pre><code>
-{
- "success":false, // note this is Boolean, not string
- "msg":"You do not have permission to perform this operation"
-}
-</code></pre>
- * @return {BasicForm} this
- */
+
submit : function(options){
options = options || {};
if(this.standardSubmit){
@@ -66502,22 +43787,14 @@ myFormPanel.getForm().submit({
return this;
},
- /**
- * Shortcut to {@link #doAction do} a {@link Ext.form.Action.Load load action}.
- * @param {Object} options The options to pass to the action (see {@link #doAction} for details)
- * @return {BasicForm} this
- */
+
load : function(options){
var loadAction = String.format('{0}load', this.api ? 'direct' : '');
this.doAction(loadAction, options);
return this;
},
- /**
- * Persists the values in this form into the passed {@link Ext.data.Record} object in a beginEdit/endEdit block.
- * @param {Record} record The record to edit
- * @return {BasicForm} this
- */
+
updateRecord : function(record){
record.beginEdit();
var fs = record.fields,
@@ -66542,21 +43819,15 @@ myFormPanel.getForm().submit({
return this;
},
- /**
- * Loads an {@link Ext.data.Record} into this form by calling {@link #setValues} with the
- * {@link Ext.data.Record#data record data}.
- * See also {@link #trackResetOnLoad}.
- * @param {Record} record The record to load
- * @return {BasicForm} this
- */
+
loadRecord : function(record){
this.setValues(record.data);
return this;
},
- // private
+
beforeAction : function(action){
- // Call HtmlEditor's syncValue before actions
+
this.items.each(function(f){
if(f.isFormField && f.syncValue){
f.syncValue();
@@ -66575,7 +43846,7 @@ myFormPanel.getForm().submit({
}
},
- // private
+
afterAction : function(action, success){
this.activeAction = null;
var o = action.options;
@@ -66601,17 +43872,12 @@ myFormPanel.getForm().submit({
}
},
- /**
- * Find a {@link Ext.form.Field} in this form.
- * @param {String} id The value to search for (specify either a {@link Ext.Component#id id},
- * {@link Ext.grid.Column#dataIndex dataIndex}, {@link Ext.form.Field#getName name or hiddenName}).
- * @return Field
- */
+
findField : function(id) {
var field = this.items.get(id);
if (!Ext.isObject(field)) {
- //searches for the field corresponding to the given id. Used recursively for composite fields
+
var findMatchingField = function(f) {
if (f.isFormField) {
if (f.dataIndex == id || f.id == id || f.getName() == id) {
@@ -66631,11 +43897,7 @@ myFormPanel.getForm().submit({
},
- /**
- * Mark fields in this form invalid in bulk.
- * @param {Array/Object} errors Either an array in the form [{id:'fieldId', msg:'The message'},...] or an object hash of {id: msg, id2: msg2}
- * @return {BasicForm} this
- */
+
markInvalid : function(errors){
if (Ext.isArray(errors)) {
for(var i = 0, len = errors.length; i < len; i++){
@@ -66657,22 +43919,9 @@ myFormPanel.getForm().submit({
return this;
},
- /**
- * Set values for fields in this form in bulk.
- * @param {Array/Object} values Either an array in the form:<pre><code>
-[{id:'clientName', value:'Fred. Olsen Lines'},
- {id:'portOfLoading', value:'FXT'},
- {id:'portOfDischarge', value:'OSL'} ]</code></pre>
- * or an object hash of the form:<pre><code>
-{
- clientName: 'Fred. Olsen Lines',
- portOfLoading: 'FXT',
- portOfDischarge: 'OSL'
-}</code></pre>
- * @return {BasicForm} this
- */
+
setValues : function(values){
- if(Ext.isArray(values)){ // array of objects
+ if(Ext.isArray(values)){
for(var i = 0, len = values.length; i < len; i++){
var v = values[i];
var f = this.findField(v.id);
@@ -66683,7 +43932,7 @@ myFormPanel.getForm().submit({
}
}
}
- }else{ // object hash
+ }else{
var field, id;
for(id in values){
if(!Ext.isFunction(values[id]) && (field = this.findField(id))){
@@ -66697,15 +43946,7 @@ myFormPanel.getForm().submit({
return this;
},
- /**
- * <p>Returns the fields in this form as an object with key/value pairs as they would be submitted using a standard form submit.
- * If multiple fields exist with the same name they are returned as an array.</p>
- * <p><b>Note:</b> The values are collected from all enabled HTML input elements within the form, <u>not</u> from
- * the Ext Field objects. This means that all returned values are Strings (or Arrays of Strings) and that the
- * value can potentially be the emptyText of a field.</p>
- * @param {Boolean} asString (optional) Pass true to return the values as a string. (defaults to false, returning an Object)
- * @return {String/Object}
- */
+
getValues : function(asString){
var fs = Ext.lib.Ajax.serializeForm(this.el.dom);
if(asString === true){
@@ -66714,12 +43955,7 @@ myFormPanel.getForm().submit({
return Ext.urlDecode(fs);
},
- /**
- * Retrieves the fields in the form as a set of key/value pairs, using the {@link Ext.form.Field#getValue getValue()} method.
- * If multiple fields exist with the same name they are returned as an array.
- * @param {Boolean} dirtyOnly (optional) True to return only fields that are dirty.
- * @return {Object} The values in the form
- */
+
getFieldValues : function(dirtyOnly){
var o = {},
n,
@@ -66745,10 +43981,7 @@ myFormPanel.getForm().submit({
return o;
},
- /**
- * Clears all invalid messages in this form.
- * @return {BasicForm} this
- */
+
clearInvalid : function(){
this.items.each(function(f){
f.clearInvalid();
@@ -66756,10 +43989,7 @@ myFormPanel.getForm().submit({
return this;
},
- /**
- * Resets this form.
- * @return {BasicForm} this
- */
+
reset : function(){
this.items.each(function(f){
f.reset();
@@ -66767,60 +43997,34 @@ myFormPanel.getForm().submit({
return this;
},
- /**
- * Add Ext.form Components to this form's Collection. This does not result in rendering of
- * the passed Component, it just enables the form to validate Fields, and distribute values to
- * Fields.
- * <p><b>You will not usually call this function. In order to be rendered, a Field must be added
- * to a {@link Ext.Container Container}, usually an {@link Ext.form.FormPanel FormPanel}.
- * The FormPanel to which the field is added takes care of adding the Field to the BasicForm's
- * collection.</b></p>
- * @param {Field} field1
- * @param {Field} field2 (optional)
- * @param {Field} etc (optional)
- * @return {BasicForm} this
- */
+
add : function(){
this.items.addAll(Array.prototype.slice.call(arguments, 0));
return this;
},
- /**
- * Removes a field from the items collection (does NOT remove its markup).
- * @param {Field} field
- * @return {BasicForm} this
- */
+
remove : function(field){
this.items.remove(field);
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.
- * @return {BasicForm} this
- */
+
render : function(){
this.items.each(function(f){
- if(f.isFormField && !f.rendered && document.getElementById(f.id)){ // if the element exists
+ if(f.isFormField && !f.rendered && document.getElementById(f.id)){
f.applyToMarkup(f.id);
}
});
return this;
},
- /**
- * Calls {@link Ext#apply} for all fields in this form with the passed object.
- * @param {Object} values
- * @return {BasicForm} this
- */
+
applyToFields : function(o){
this.items.each(function(f){
Ext.apply(f, o);
@@ -66828,11 +44032,7 @@ myFormPanel.getForm().submit({
return this;
},
- /**
- * Calls {@link Ext#applyIf} for all field in this form with the passed object.
- * @param {Object} values
- * @return {BasicForm} this
- */
+
applyIfToFields : function(o){
this.items.each(function(f){
Ext.applyIf(f, o);
@@ -66851,120 +44051,35 @@ myFormPanel.getForm().submit({
}
});
-// back compat
+
Ext.BasicForm = Ext.form.BasicForm;
-/**
- * @class Ext.form.FormPanel
- * @extends Ext.Panel
- * <p>Standard form container.</p>
- *
- * <p><b><u>Layout</u></b></p>
- * <p>By default, FormPanel is configured with <tt>layout:'form'</tt> to use an {@link Ext.layout.FormLayout}
- * layout manager, which styles and renders fields and labels correctly. When nesting additional Containers
- * within a FormPanel, you should ensure that any descendant Containers which host input Fields use the
- * {@link Ext.layout.FormLayout} layout manager.</p>
- *
- * <p><b><u>BasicForm</u></b></p>
- * <p>Although <b>not listed</b> as configuration options of FormPanel, the FormPanel class accepts all
- * of the config options required to configure its internal {@link Ext.form.BasicForm} for:
- * <div class="mdetail-params"><ul>
- * <li>{@link Ext.form.BasicForm#fileUpload file uploads}</li>
- * <li>functionality for {@link Ext.form.BasicForm#doAction loading, validating and submitting} the form</li>
- * </ul></div>
- *
- * <p><b>Note</b>: If subclassing FormPanel, any configuration options for the BasicForm must be applied to
- * the <tt><b>initialConfig</b></tt> property of the FormPanel. Applying {@link Ext.form.BasicForm BasicForm}
- * configuration settings to <b><tt>this</tt></b> will <b>not</b> affect the BasicForm's configuration.</p>
- *
- * <p><b><u>Form Validation</u></b></p>
- * <p>For information on form validation see the following:</p>
- * <div class="mdetail-params"><ul>
- * <li>{@link Ext.form.TextField}</li>
- * <li>{@link Ext.form.VTypes}</li>
- * <li>{@link Ext.form.BasicForm#doAction BasicForm.doAction <b>clientValidation</b> notes}</li>
- * <li><tt>{@link Ext.form.FormPanel#monitorValid monitorValid}</tt></li>
- * </ul></div>
- *
- * <p><b><u>Form Submission</u></b></p>
- * <p>By default, Ext Forms are submitted through Ajax, using {@link Ext.form.Action}. To enable normal browser
- * submission of the {@link Ext.form.BasicForm BasicForm} contained in this FormPanel, see the
- * <tt><b>{@link Ext.form.BasicForm#standardSubmit standardSubmit}</b></tt> option.</p>
- *
- * @constructor
- * @param {Object} config Configuration options
- * @xtype form
- */
+
Ext.FormPanel = Ext.extend(Ext.Panel, {
- /**
- * @cfg {String} formId (optional) The id of the FORM tag (defaults to an auto-generated id).
- */
- /**
- * @cfg {Boolean} hideLabels
- * <p><tt>true</tt> to hide field labels by default (sets <tt>display:none</tt>). Defaults to
- * <tt>false</tt>.</p>
- * <p>Also see {@link Ext.Component}.<tt>{@link Ext.Component#hideLabel hideLabel}</tt>.
- */
- /**
- * @cfg {Number} labelPad
- * The default padding in pixels for field labels (defaults to <tt>5</tt>). <tt>labelPad</tt> only
- * applies if <tt>{@link #labelWidth}</tt> is also specified, otherwise it will be ignored.
- */
- /**
- * @cfg {String} labelSeparator
- * See {@link Ext.Component}.<tt>{@link Ext.Component#labelSeparator labelSeparator}</tt>
- */
- /**
- * @cfg {Number} labelWidth The width of labels in pixels. This property cascades to child containers
- * and can be overridden on any child container (e.g., a fieldset can specify a different <tt>labelWidth</tt>
- * for its fields) (defaults to <tt>100</tt>).
- */
- /**
- * @cfg {String} itemCls A css class to apply to the x-form-item of fields. This property cascades to child containers.
- */
- /**
- * @cfg {Array} buttons
- * An array of {@link Ext.Button}s or {@link Ext.Button} configs used to add buttons to the footer of this FormPanel.<br>
- * <p>Buttons in the footer of a FormPanel may be configured with the option <tt>formBind: true</tt>. This causes
- * the form's {@link #monitorValid valid state monitor task} to enable/disable those Buttons depending on
- * the form's valid/invalid state.</p>
- */
- /**
- * @cfg {Number} minButtonWidth Minimum width of all buttons in pixels (defaults to <tt>75</tt>).
- */
+
+
+
+
+
+
+
+
minButtonWidth : 75,
- /**
- * @cfg {String} labelAlign The label alignment value used for the <tt>text-align</tt> specification
- * for the <b>container</b>. Valid values are <tt>"left</tt>", <tt>"top"</tt> or <tt>"right"</tt>
- * (defaults to <tt>"left"</tt>). This property cascades to child <b>containers</b> and can be
- * overridden on any child <b>container</b> (e.g., a fieldset can specify a different <tt>labelAlign</tt>
- * for its fields).
- */
+
labelAlign : 'left',
- /**
- * @cfg {Boolean} monitorValid If <tt>true</tt>, the form monitors its valid state <b>client-side</b> and
- * regularly fires the {@link #clientvalidation} event passing that state.<br>
- * <p>When monitoring valid state, the FormPanel enables/disables any of its configured
- * {@link #buttons} which have been configured with <code>formBind: true</code> depending
- * on whether the {@link Ext.form.BasicForm#isValid form is valid} or not. Defaults to <tt>false</tt></p>
- */
+
monitorValid : false,
- /**
- * @cfg {Number} monitorPoll The milliseconds to poll valid state, ignored if monitorValid is not true (defaults to 200)
- */
+
monitorPoll : 200,
- /**
- * @cfg {String} layout Defaults to <tt>'form'</tt>. Normally this configuration property should not be altered.
- * For additional details see {@link Ext.layout.FormLayout} and {@link Ext.Container#layout Ext.Container.layout}.
- */
+
layout : 'form',
- // private
+
initComponent : function(){
this.form = this.createForm();
Ext.FormPanel.superclass.initComponent.call(this);
@@ -66981,25 +44096,20 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
this.initItems();
this.addEvents(
- /**
- * @event clientvalidation
- * If the monitorValid config option is true, this event fires repetitively to notify of valid state
- * @param {Ext.form.FormPanel} this
- * @param {Boolean} valid true if the form has passed client-side validation
- */
+
'clientvalidation'
);
this.relayEvents(this.form, ['beforeaction', 'actionfailed', 'actioncomplete']);
},
- // private
+
createForm : function(){
var config = Ext.applyIf({listeners: {}}, this.initialConfig);
return new Ext.form.BasicForm(null, config);
},
- // private
+
initFields : function(){
var f = this.form;
var formPanel = this;
@@ -67008,7 +44118,7 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
f.add(c);
}else if(c.findBy && c != formPanel){
formPanel.applySettings(c);
- //each check required for check/radio groups.
+
if(c.items && c.items.each){
c.items.each(fn, this);
}
@@ -67017,7 +44127,7 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
this.items.each(fn, this);
},
- // private
+
applySettings: function(c){
var ct = c.ownerCt;
Ext.applyIf(c, {
@@ -67027,78 +44137,75 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
});
},
- // private
+
getLayoutTarget : function(){
return this.form.el;
},
- /**
- * Provides access to the {@link Ext.form.BasicForm Form} which this Panel contains.
- * @return {Ext.form.BasicForm} The {@link Ext.form.BasicForm Form} which this Panel contains.
- */
+
getForm : function(){
return this.form;
},
- // private
+
onRender : function(ct, position){
this.initFields();
Ext.FormPanel.superclass.onRender.call(this, ct, position);
this.form.initEl(this.body);
},
- // private
+
beforeDestroy : function(){
this.stopMonitoring();
this.form.destroy(true);
Ext.FormPanel.superclass.beforeDestroy.call(this);
},
- // Determine if a Component is usable as a form Field.
+
isField : function(c) {
return !!c.setValue && !!c.getValue && !!c.markInvalid && !!c.clearInvalid;
},
- // private
+
initEvents : function(){
Ext.FormPanel.superclass.initEvents.call(this);
- // Listeners are required here to catch bubbling events from children.
+
this.on({
scope: this,
add: this.onAddEvent,
remove: this.onRemoveEvent
});
- if(this.monitorValid){ // initialize after render
+ if(this.monitorValid){
this.startMonitoring();
}
},
- // private
+
onAdd: function(c){
Ext.FormPanel.superclass.onAdd.call(this, c);
this.processAdd(c);
},
- // private
+
onAddEvent: function(ct, c){
if(ct !== this){
this.processAdd(c);
}
},
- // private
+
processAdd : function(c){
- // If a single form Field, add it
+
if(this.isField(c)){
this.form.add(c);
- // If a Container, add any Fields it might contain
+
}else if(c.findBy){
this.applySettings(c);
this.form.add.apply(this.form, c.findBy(this.isField));
}
},
- // private
+
onRemove: function(c){
Ext.FormPanel.superclass.onRemove.call(this, c);
this.processRemove(c);
@@ -67110,28 +44217,22 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
}
},
- // private
+
processRemove: function(c){
if(!this.destroying){
- // If a single form Field, remove it
+
if(this.isField(c)){
this.form.remove(c);
- // 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);
- /*
- * This isn't the most efficient way of getting rid of the items, however it's the most
- * correct, which in this case is most important.
- */
+
this.form.cleanDestroyed();
}
}
},
- /**
- * Starts monitoring of the valid state of this form. Usually this is done by passing the config
- * option "monitorValid"
- */
+
startMonitoring : function(){
if(!this.validTask){
this.validTask = new Ext.util.TaskRunner();
@@ -67143,9 +44244,7 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
}
},
- /**
- * Stops monitoring of the valid state of this form
- */
+
stopMonitoring : function(){
if(this.validTask){
this.validTask.stopAll();
@@ -67153,15 +44252,12 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
}
},
- /**
- * This is a proxy for the underlying BasicForm's {@link Ext.form.BasicForm#load} call.
- * @param {Object} options The options to pass to the action (see {@link Ext.form.BasicForm#doAction} for details)
- */
+
load : function(){
this.form.load.apply(this.form, arguments);
},
- // private
+
onDisable : function(){
Ext.FormPanel.superclass.onDisable.call(this);
if(this.form){
@@ -67171,7 +44267,7 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
}
},
- // private
+
onEnable : function(){
Ext.FormPanel.superclass.onEnable.call(this);
if(this.form){
@@ -67181,7 +44277,7 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
}
},
- // private
+
bindHandler : function(){
var valid = true;
this.form.items.each(function(f){
@@ -67205,112 +44301,21 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
Ext.reg('form', 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}.
- * <pre><code>
-var form = new Ext.FormPanel({
- title: 'Simple Form with FieldSets',
- labelWidth: 75, // label settings here cascade unless overridden
- url: 'save-form.php',
- frame:true,
- bodyStyle:'padding:5px 5px 0',
- width: 700,
- renderTo: document.body,
- layout:'column', // arrange items in columns
- defaults: { // defaults applied to items
- layout: 'form',
- border: false,
- bodyStyle: 'padding:4px'
- },
- items: [{
- // Fieldset in Column 1
- xtype:'fieldset',
- columnWidth: 0.5,
- title: 'Fieldset 1',
- collapsible: true,
- autoHeight:true,
- defaults: {
- anchor: '-20' // leave room for error icon
- },
- defaultType: 'textfield',
- items :[{
- fieldLabel: 'Field 1'
- }, {
- fieldLabel: 'Field 2'
- }, {
- fieldLabel: 'Field 3'
- }
- ]
- },{
- // Fieldset in Column 2 - Panel inside
- xtype:'fieldset',
- title: 'Show Panel', // title, header, or checkboxToggle creates fieldset header
- autoHeight:true,
- columnWidth: 0.5,
- checkboxToggle: true,
- collapsed: true, // fieldset initially collapsed
- layout:'anchor',
- items :[{
- xtype: 'panel',
- anchor: '100%',
- title: 'Panel inside a fieldset',
- frame: true,
- height: 100
- }]
- }]
-});
- * </code></pre>
- * @constructor
- * @param {Object} config Configuration options
- * @xtype fieldset
- */
+
Ext.form.FieldSet = Ext.extend(Ext.Panel, {
- /**
- * @cfg {Mixed} checkboxToggle <tt>true</tt> to render a checkbox into the fieldset frame just
- * in front of the legend to expand/collapse the fieldset when the checkbox is toggled. (defaults
- * to <tt>false</tt>).
- * <p>A {@link Ext.DomHelper DomHelper} element spec may also be specified to create the checkbox.
- * If <tt>true</tt> is specified, the default DomHelper config object used to create the element
- * is:</p><pre><code>
- * {tag: 'input', type: 'checkbox', name: this.checkboxName || this.id+'-checkbox'}
- * </code></pre>
- */
- /**
- * @cfg {String} checkboxName The name to assign to the fieldset's checkbox if <tt>{@link #checkboxToggle} = true</tt>
- * (defaults to <tt>'[checkbox id]-checkbox'</tt>).
- */
- /**
- * @cfg {Boolean} collapsible
- * <tt>true</tt> to make the fieldset collapsible and have the expand/collapse toggle button automatically
- * rendered into the legend element, <tt>false</tt> to keep the fieldset statically sized with no collapse
- * button (defaults to <tt>false</tt>). Another option is to configure <tt>{@link #checkboxToggle}</tt>.
- */
- /**
- * @cfg {Number} labelWidth The width of labels. This property cascades to child containers.
- */
- /**
- * @cfg {String} itemCls A css class to apply to the <tt>x-form-item</tt> of fields (see
- * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl} for details).
- * This property cascades to child containers.
- */
- /**
- * @cfg {String} baseCls The base CSS class applied to the fieldset (defaults to <tt>'x-fieldset'</tt>).
- */
+
+
+
+
+
+
baseCls : 'x-fieldset',
- /**
- * @cfg {String} layout The {@link Ext.Container#layout} to use inside the fieldset (defaults to <tt>'form'</tt>).
- */
+
layout : 'form',
- /**
- * @cfg {Boolean} animCollapse
- * <tt>true</tt> to animate the transition when the panel is collapsed, <tt>false</tt> to skip the
- * animation (defaults to <tt>false</tt>).
- */
+
animCollapse : false,
- // private
+
onRender : function(ct, position){
if(!this.el){
this.el = document.createElement('fieldset');
@@ -67332,7 +44337,7 @@ Ext.form.FieldSet = Ext.extend(Ext.Panel, {
}
},
- // private
+
onCollapse : function(doAnim, animArg){
if(this.checkbox){
this.checkbox.dom.checked = false;
@@ -67341,7 +44346,7 @@ Ext.form.FieldSet = Ext.extend(Ext.Panel, {
},
- // private
+
onExpand : function(doAnim, animArg){
if(this.checkbox){
this.checkbox.dom.checked = true;
@@ -67349,239 +44354,70 @@ Ext.form.FieldSet = Ext.extend(Ext.Panel, {
Ext.form.FieldSet.superclass.onExpand.call(this, doAnim, animArg);
},
- /**
- * This function is called by the fieldset's checkbox when it is toggled (only applies when
- * checkboxToggle = true). This method should never be called externally, but can be
- * overridden to provide custom behavior when the checkbox is toggled if needed.
- */
+
onCheckClick : function(){
this[this.checkbox.dom.checked ? 'expand' : 'collapse']();
}
- /**
- * @cfg {String/Number} activeItem
- * @hide
- */
- /**
- * @cfg {Mixed} applyTo
- * @hide
- */
- /**
- * @cfg {Boolean} bodyBorder
- * @hide
- */
- /**
- * @cfg {Boolean} border
- * @hide
- */
- /**
- * @cfg {Boolean/Number} bufferResize
- * @hide
- */
- /**
- * @cfg {Boolean} collapseFirst
- * @hide
- */
- /**
- * @cfg {String} defaultType
- * @hide
- */
- /**
- * @cfg {String} disabledClass
- * @hide
- */
- /**
- * @cfg {String} elements
- * @hide
- */
- /**
- * @cfg {Boolean} floating
- * @hide
- */
- /**
- * @cfg {Boolean} footer
- * @hide
- */
- /**
- * @cfg {Boolean} frame
- * @hide
- */
- /**
- * @cfg {Boolean} header
- * @hide
- */
- /**
- * @cfg {Boolean} headerAsText
- * @hide
- */
- /**
- * @cfg {Boolean} hideCollapseTool
- * @hide
- */
- /**
- * @cfg {String} iconCls
- * @hide
- */
- /**
- * @cfg {Boolean/String} shadow
- * @hide
- */
- /**
- * @cfg {Number} shadowOffset
- * @hide
- */
- /**
- * @cfg {Boolean} shim
- * @hide
- */
- /**
- * @cfg {Object/Array} tbar
- * @hide
- */
- /**
- * @cfg {Array} tools
- * @hide
- */
- /**
- * @cfg {Ext.Template/Ext.XTemplate} toolTemplate
- * @hide
- */
- /**
- * @cfg {String} xtype
- * @hide
- */
- /**
- * @property header
- * @hide
- */
- /**
- * @property footer
- * @hide
- */
- /**
- * @method focus
- * @hide
- */
- /**
- * @method getBottomToolbar
- * @hide
- */
- /**
- * @method getTopToolbar
- * @hide
- */
- /**
- * @method setIconClass
- * @hide
- */
- /**
- * @event activate
- * @hide
- */
- /**
- * @event beforeclose
- * @hide
- */
- /**
- * @event bodyresize
- * @hide
- */
- /**
- * @event close
- * @hide
- */
- /**
- * @event deactivate
- * @hide
- */
-});
-Ext.reg('fieldset', Ext.form.FieldSet);/**
- * @class Ext.form.HtmlEditor
- * @extends Ext.form.Field
- * Provides a lightweight HTML Editor component. Some toolbar features are not supported by Safari and will be
- * automatically hidden when needed. These are noted in the config options where appropriate.
- * <br><br>The editor's toolbar buttons have tooltips defined in the {@link #buttonTips} property, but they are not
- * enabled by default unless the global {@link Ext.QuickTips} singleton is {@link Ext.QuickTips#init initialized}.
- * <br><br><b>Note: The focus/blur and validation marking functionality inherited from Ext.form.Field is NOT
- * supported by this editor.</b>
- * <br><br>An Editor is a sensitive component that can't be used in all spots standard fields can be used. Putting an Editor within
- * any element that has display set to 'none' can cause problems in Safari and Firefox due to their default iframe reloading bugs.
- * <br><br>Example usage:
- * <pre><code>
-// Simple example rendered with default options:
-Ext.QuickTips.init(); // enable tooltips
-new Ext.form.HtmlEditor({
- renderTo: Ext.getBody(),
- width: 800,
- height: 300
-});
-// Passed via xtype into a container and with custom options:
-Ext.QuickTips.init(); // enable tooltips
-new Ext.Panel({
- title: 'HTML Editor',
- renderTo: Ext.getBody(),
- width: 600,
- height: 300,
- frame: true,
- layout: 'fit',
- items: {
- xtype: 'htmleditor',
- enableColors: false,
- enableAlignments: false
- }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
});
-</code></pre>
- * @constructor
- * Create a new HtmlEditor
- * @param {Object} config
- * @xtype htmleditor
- */
+Ext.reg('fieldset', Ext.form.FieldSet);
Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
- /**
- * @cfg {Boolean} enableFormat Enable the bold, italic and underline buttons (defaults to true)
- */
+
enableFormat : true,
- /**
- * @cfg {Boolean} enableFontSize Enable the increase/decrease font size buttons (defaults to true)
- */
+
enableFontSize : true,
- /**
- * @cfg {Boolean} enableColors Enable the fore/highlight color buttons (defaults to true)
- */
+
enableColors : true,
- /**
- * @cfg {Boolean} enableAlignments Enable the left, center, right alignment buttons (defaults to true)
- */
+
enableAlignments : true,
- /**
- * @cfg {Boolean} enableLists Enable the bullet and numbered list buttons. Not available in Safari. (defaults to true)
- */
+
enableLists : true,
- /**
- * @cfg {Boolean} enableSourceEdit Enable the switch to source edit button. Not available in Safari. (defaults to true)
- */
+
enableSourceEdit : true,
- /**
- * @cfg {Boolean} enableLinks Enable the create link button. Not available in Safari. (defaults to true)
- */
+
enableLinks : true,
- /**
- * @cfg {Boolean} enableFont Enable font selection. Not available in Safari. (defaults to true)
- */
+
enableFont : true,
- /**
- * @cfg {String} createLinkText The default text for the create link prompt
- */
+
createLinkText : 'Please enter the URL for the link:',
- /**
- * @cfg {String} defaultLinkValue The default value for the create link prompt (defaults to http:/ /)
- */
+
defaultLinkValue : 'http:/'+'/',
- /**
- * @cfg {Array} fontFamilies An array of available font families
- */
+
fontFamilies : [
'Arial',
'Courier New',
@@ -67590,12 +44426,10 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
'Verdana'
],
defaultFont: 'tahoma',
- /**
- * @cfg {String} defaultValue A default value to be put into the editor to resolve focus issues (defaults to &#160; (Non-breaking space) in Opera and IE6, &#8203; (Zero-width space) in all other browsers).
- */
+
defaultValue: (Ext.isOpera || Ext.isIE6) ? '&#160;' : '&#8203;',
- // private properties
+
actionMode: 'wrap',
validationEvent : false,
deferHeight: true,
@@ -67611,64 +44445,28 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
autocomplete: "off"
},
- // private
+
initComponent : function(){
this.addEvents(
- /**
- * @event initialize
- * Fires when the editor is fully initialized (including the iframe)
- * @param {HtmlEditor} this
- */
+
'initialize',
- /**
- * @event activate
- * Fires when the editor is first receives the focus. Any insertion must wait
- * until after this event.
- * @param {HtmlEditor} this
- */
+
'activate',
- /**
- * @event beforesync
- * Fires before the textarea is updated with content from the editor iframe. Return false
- * to cancel the sync.
- * @param {HtmlEditor} this
- * @param {String} html
- */
+
'beforesync',
- /**
- * @event beforepush
- * Fires before the iframe editor is updated with content from the textarea. Return false
- * to cancel the push.
- * @param {HtmlEditor} this
- * @param {String} html
- */
+
'beforepush',
- /**
- * @event sync
- * Fires when the textarea is updated with content from the editor iframe.
- * @param {HtmlEditor} this
- * @param {String} html
- */
+
'sync',
- /**
- * @event push
- * Fires when the iframe editor is updated with content from the textarea.
- * @param {HtmlEditor} this
- * @param {String} html
- */
+
'push',
- /**
- * @event editmodechange
- * Fires when the editor switches edit modes
- * @param {HtmlEditor} this
- * @param {Boolean} sourceEdit True if source edit, false if standard editing.
- */
+
'editmodechange'
);
Ext.form.HtmlEditor.superclass.initComponent.call(this);
},
- // private
+
createFontOptions : function(){
var buf = [], fs = this.fontFamilies, ff, lc;
for(var i = 0, len = fs.length; i< len; i++){
@@ -67684,12 +44482,7 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
return buf.join('');
},
- /*
- * Protected method that will not generally be called directly. It
- * is called when the editor creates its toolbar. Override this method if you need to
- * add custom toolbar buttons.
- * @param {HtmlEditor} editor
- */
+
createToolbar : function(editor){
var items = [];
var tipsEnabled = Ext.QuickTips && Ext.QuickTips.isEnabled();
@@ -67831,7 +44624,7 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}
}
- // build the toolbar
+
var tb = new Ext.Toolbar({
renderTo: this.wrap.dom.firstChild,
items: items
@@ -67847,7 +44640,7 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}, this);
}
- // stop form submits
+
this.mon(tb.el, 'click', function(e){
e.preventDefault();
});
@@ -67883,41 +44676,35 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}
},
- /**
- * Protected method that will not generally be called directly. It
- * is called when the editor initializes the iframe with HTML contents. Override this method if you
- * want to change the initialization markup of the iframe (e.g. to add stylesheets).
- *
- * Note: IE8-Standards has unwanted scroller behavior, so the default meta tag forces IE7 compatibility
- */
+
getDocMarkup : function(){
var h = Ext.fly(this.iframe).getHeight() - this.iframePad * 2;
return String.format('<html><head><style type="text/css">body{border: 0; margin: 0; padding: {0}px; height: {1}px; cursor: text}</style></head><body></body></html>', this.iframePad, h);
},
- // private
+
getEditorBody : function(){
var doc = this.getDoc();
return doc.body || doc.documentElement;
},
- // private
+
getDoc : function(){
return Ext.isIE ? this.getWin().document : (this.iframe.contentDocument || this.getWin().document);
},
- // private
+
getWin : function(){
return Ext.isIE ? this.iframe.contentWindow : window.frames[this.iframe.name];
},
- // private
+
onRender : function(ct, position){
Ext.form.HtmlEditor.superclass.onRender.call(this, ct, position);
this.el.dom.style.border = '0 none';
this.el.dom.setAttribute('tabIndex', -1);
this.el.addClass('x-hidden');
- if(Ext.isIE){ // fix IE 1px bogus margin
+ if(Ext.isIE){
this.el.applyStyles('margin-top:-1px;margin-bottom:-1px;');
}
this.wrap = this.el.wrap({
@@ -67965,11 +44752,11 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
doc.write(this.getDocMarkup());
doc.close();
- var task = { // must defer to wait for browser to be ready
+ this.readyTask = {
run : function(){
var doc = this.getDoc();
if(doc.body || doc.readyState == 'complete'){
- Ext.TaskMgr.stop(task);
+ Ext.TaskMgr.stop(this.readyTask);
this.setDesignMode(true);
this.initEditor.defer(10, this);
}
@@ -67978,7 +44765,7 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
duration:10000,
scope: this
};
- Ext.TaskMgr.start(task);
+ Ext.TaskMgr.start(this.readyTask);
},
@@ -67994,9 +44781,7 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}
},
- /* private
- * set current design mode. To enable, mode can be true or 'on', off otherwise
- */
+
setDesignMode : function(mode){
var doc = this.getDoc();
if (doc) {
@@ -68008,7 +44793,7 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
},
- // private
+
getDesignMode : function(){
var doc = this.getDoc();
if(!doc){ return ''; }
@@ -68027,7 +44812,7 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
});
},
- // private
+
onResize : function(w, h){
Ext.form.HtmlEditor.superclass.onResize.apply(this, arguments);
if(this.el && this.iframe){
@@ -68049,10 +44834,7 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}
},
- /**
- * Toggles the editor between standard and source edit mode.
- * @param {Boolean} sourceEdit (optional) True for source edit, false for standard
- */
+
toggleSourceEdit : function(sourceEditMode){
var iframeHeight,
elHeight;
@@ -68070,7 +44852,7 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}
}
if (this.sourceEditMode) {
- // grab the height of the containing panel before we hide the iframe
+
this.previousSize = this.getSize();
iframeHeight = Ext.get(this.iframe).getHeight();
@@ -68101,7 +44883,7 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
this.fireEvent('editmodechange', this, this.sourceEditMode);
},
- // private used internally
+
createLink : function() {
var url = prompt(this.createLinkText, this.defaultLinkValue);
if(url && url != 'http:/'+'/'){
@@ -68109,63 +44891,45 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}
},
- // private
+
initEvents : function(){
this.originalValue = this.getValue();
},
- /**
- * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide
- * @method
- */
+
markInvalid : Ext.emptyFn,
- /**
- * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide
- * @method
- */
+
clearInvalid : Ext.emptyFn,
- // docs inherit from Field
+
setValue : function(v){
Ext.form.HtmlEditor.superclass.setValue.call(this, v);
this.pushValue();
return this;
},
- /**
- * Protected method that will not generally be called directly. If you need/want
- * custom HTML cleanup, this is the method you should override.
- * @param {String} html The HTML to be cleaned
- * @return {String} The cleaned HTML
- */
+
cleanHtml: function(html) {
html = String(html);
- if(Ext.isWebKit){ // strip safari nonsense
+ if(Ext.isWebKit){
html = html.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi, '');
}
- /*
- * Neat little hack. Strips out all the non-digit characters from the default
- * value and compares it to the character code of the first character in the string
- * because it can cause encoding issues when posted to the server.
- */
+
if(html.charCodeAt(0) == this.defaultValue.replace(/\D/g, '')){
html = html.substring(1);
}
return html;
},
- /**
- * Protected method that will not generally be called directly. Syncs the contents
- * of the editor iframe with the textarea.
- */
+
syncValue : function(){
if(this.initialized){
var bd = this.getEditorBody();
var html = bd.innerHTML;
if(Ext.isWebKit){
- var bs = bd.getAttribute('style'); // Safari puts text-align styles on the body element!
+ var bs = bd.getAttribute('style');
var m = bs.match(/text-align:(.*?);/i);
if(m && m[1]){
html = '<div style="'+m[0]+'">' + html + '</div>';
@@ -68179,16 +44943,13 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}
},
- //docs inherit from Field
+
getValue : function() {
this[this.sourceEditMode ? 'pushValue' : 'syncValue']();
return Ext.form.HtmlEditor.superclass.getValue.call(this);
},
- /**
- * Protected method that will not generally be called directly. Pushes the value of the textarea
- * into the iframe editor.
- */
+
pushValue : function(){
if(this.initialized){
var v = this.el.dom.value;
@@ -68198,8 +44959,8 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
if(this.fireEvent('beforepush', this, v) !== false){
this.getEditorBody().innerHTML = v;
if(Ext.isGecko){
- // Gecko hack, see: https://bugzilla.mozilla.org/show_bug.cgi?id=232791#c8
- this.setDesignMode(false); //toggle off first
+
+ this.setDesignMode(false);
this.setDesignMode(true);
}
this.fireEvent('push', this, v);
@@ -68208,12 +44969,12 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}
},
- // private
+
deferFocus : function(){
this.focus.defer(10, this);
},
- // docs inherit from Field
+
focus : function(){
if(this.win && !this.sourceEditMode){
this.win.focus();
@@ -68222,17 +44983,17 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}
},
- // private
+
initEditor : function(){
- //Destroying the component during/before initEditor can cause issues.
+
try{
var dbody = this.getEditorBody(),
ss = this.el.getStyles('font-size', 'font-family', 'background-image', 'background-repeat', 'background-color', 'color'),
doc,
fn;
- ss['background-attachment'] = 'fixed'; // w3c
- dbody.bgProperties = 'fixed'; // ie
+ ss['background-attachment'] = 'fixed';
+ dbody.bgProperties = 'fixed';
Ext.DomHelper.applyStyles(dbody, ss);
@@ -68244,12 +45005,7 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}catch(e){}
}
- /*
- * We need to use createDelegate here, because when using buffer, the delayed task is added
- * as a property to the function. When the listener is removed, the task is deleted from the function.
- * Since onEditorEvent is shared on the prototype, if we have multiple html editors, the first time one of the editors
- * is destroyed, it causes the fn to be deleted from the prototype, which causes errors. Essentially, we're just anonymizing the function.
- */
+
fn = this.onEditorEvent.createDelegate(this);
Ext.EventManager.on(doc, {
mousedown: fn,
@@ -68273,14 +45029,18 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}catch(e){}
},
- // private
+
beforeDestroy : function(){
if(this.monitorTask){
Ext.TaskMgr.stop(this.monitorTask);
}
+ if(this.readyTask){
+ Ext.TaskMgr.stop(this.readyTask);
+ }
if(this.rendered){
Ext.destroy(this.tb);
var doc = this.getDoc();
+ Ext.EventManager.removeFromSpecialCache(doc);
if(doc){
try{
Ext.EventManager.removeAll(doc);
@@ -68297,11 +45057,11 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
Ext.form.HtmlEditor.superclass.beforeDestroy.call(this);
},
- // private
+
onFirstFocus : function(){
this.activated = true;
this.disableItems(this.readOnly);
- if(Ext.isGecko){ // prevent silly gecko errors
+ if(Ext.isGecko){
this.win.focus();
var s = this.win.getSelection();
if(!s.focusNode || s.focusNode.nodeType != 3){
@@ -68318,14 +45078,14 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
this.fireEvent('activate', this);
},
- // private
+
adjustFont: function(btn){
var adjust = btn.getItemId() == 'increasefontsize' ? 1 : -1,
doc = this.getDoc(),
v = parseInt(doc.queryCommandValue('FontSize') || 2, 10);
if((Ext.isSafari && !Ext.isSafari2) || Ext.isChrome || Ext.isAir){
- // Safari 3 values
- // 1 = 10px, 2 = 13px, 3 = 16px, 4 = 18px, 5 = 24px, 6 = 32px
+
+
if(v <= 10){
v = 1 + adjust;
}else if(v <= 13){
@@ -68341,7 +45101,7 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}
v = v.constrain(1, 6);
}else{
- if(Ext.isSafari){ // safari
+ if(Ext.isSafari){
adjust *= 2;
}
v = Math.max(1, v+adjust) + (Ext.isSafari ? 'px' : 0);
@@ -68349,16 +45109,13 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
this.execCmd('FontSize', v);
},
- // private
+
onEditorEvent : function(e){
this.updateToolbar();
},
- /**
- * Protected method that will not generally be called directly. It triggers
- * a toolbar update by reading the markup state of the current selection in the editor.
- */
+
updateToolbar: function(){
if(this.readOnly){
@@ -68399,17 +45156,12 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
this.syncValue();
},
- // private
+
relayBtnCmd : function(btn){
this.relayCmd(btn.getItemId());
},
- /**
- * Executes a Midas editor command on the editor document and performs necessary focus and
- * toolbar updates. <b>This should only be called after the editor is initialized.</b>
- * @param {String} cmd The Midas command
- * @param {String/Boolean} value (optional) The value to pass to the command (defaults to null)
- */
+
relayCmd : function(cmd, value){
(function(){
this.focus();
@@ -68418,20 +45170,14 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}).defer(10, this);
},
- /**
- * Executes a Midas editor command directly on the editor document.
- * For visual commands, you should use {@link #relayCmd} instead.
- * <b>This should only be called after the editor is initialized.</b>
- * @param {String} cmd The Midas command
- * @param {String/Boolean} value (optional) The value to pass to the command (defaults to null)
- */
+
execCmd : function(cmd, value){
var doc = this.getDoc();
doc.execCommand(cmd, false, value === undefined ? null : value);
this.syncValue();
},
- // private
+
applyCommand : function(e){
if(e.ctrlKey){
var c = e.getCharCode(), cmd;
@@ -68458,11 +45204,7 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}
},
- /**
- * Inserts the passed text at the current cursor position. Note: the editor must be initialized and activated
- * to insert text.
- * @param {String} text
- */
+
insertAtCursor : function(text){
if(!this.activated){
return;
@@ -68483,8 +45225,8 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}
},
- // private
- fixKeys : function(){ // load time branching for fastest keydown performance
+
+ fixKeys : function(){
if(Ext.isIE){
return function(e){
var k = e.getKey(),
@@ -68537,34 +45279,12 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}
}(),
- /**
- * Returns the editor's toolbar. <b>This is only available after the editor has been rendered.</b>
- * @return {Ext.Toolbar}
- */
+
getToolbar : function(){
return this.tb;
},
- /**
- * Object collection of toolbar tooltips for the buttons in the editor. The key
- * is the command id associated with that button and the value is a valid QuickTips object.
- * For example:
-<pre><code>
-{
- 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'
- },
- ...
-</code></pre>
- * @type Object
- */
+
buttonTips : {
bold : {
title: 'Bold (Ctrl+B)',
@@ -68638,201 +45358,76 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
}
}
- // hide stuff that is not compatible
- /**
- * @event blur
- * @hide
- */
- /**
- * @event change
- * @hide
- */
- /**
- * @event focus
- * @hide
- */
- /**
- * @event specialkey
- * @hide
- */
- /**
- * @cfg {String} fieldClass @hide
- */
- /**
- * @cfg {String} focusClass @hide
- */
- /**
- * @cfg {String} autoCreate @hide
- */
- /**
- * @cfg {String} inputType @hide
- */
- /**
- * @cfg {String} invalidClass @hide
- */
- /**
- * @cfg {String} invalidText @hide
- */
- /**
- * @cfg {String} msgFx @hide
- */
- /**
- * @cfg {String} validateOnBlur @hide
- */
- /**
- * @cfg {Boolean} allowDomMove @hide
- */
- /**
- * @cfg {String} applyTo @hide
- */
- /**
- * @cfg {String} autoHeight @hide
- */
- /**
- * @cfg {String} autoWidth @hide
- */
- /**
- * @cfg {String} cls @hide
- */
- /**
- * @cfg {String} disabled @hide
- */
- /**
- * @cfg {String} disabledClass @hide
- */
- /**
- * @cfg {String} msgTarget @hide
- */
- /**
- * @cfg {String} readOnly @hide
- */
- /**
- * @cfg {String} style @hide
- */
- /**
- * @cfg {String} validationDelay @hide
- */
- /**
- * @cfg {String} validationEvent @hide
- */
- /**
- * @cfg {String} tabIndex @hide
- */
- /**
- * @property disabled
- * @hide
- */
- /**
- * @method applyToMarkup
- * @hide
- */
- /**
- * @method disable
- * @hide
- */
- /**
- * @method enable
- * @hide
- */
- /**
- * @method validate
- * @hide
- */
- /**
- * @event valid
- * @hide
- */
- /**
- * @method setDisabled
- * @hide
- */
- /**
- * @cfg keys
- * @hide
- */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
});
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:
- * <pre><code>
-new Ext.form.TimeField({
- minValue: '9:00 AM',
- maxValue: '6:00 PM',
- increment: 30
-});
-</code></pre>
- * @constructor
- * Create a new TimeField
- * @param {Object} config
- * @xtype timefield
- */
+
Ext.form.TimeField = Ext.extend(Ext.form.ComboBox, {
- /**
- * @cfg {Date/String} minValue
- * The minimum allowed time. Can be either a Javascript date object with a valid time value or a string
- * time in a valid format -- see {@link #format} and {@link #altFormats} (defaults to undefined).
- */
+
minValue : undefined,
- /**
- * @cfg {Date/String} maxValue
- * The maximum allowed time. Can be either a Javascript date object with a valid time value or a string
- * time in a valid format -- see {@link #format} and {@link #altFormats} (defaults to undefined).
- */
+
maxValue : undefined,
- /**
- * @cfg {String} minText
- * The error text to display when the date in the cell is before minValue (defaults to
- * 'The time in this field must be equal to or after {0}').
- */
+
minText : "The time in this field must be equal to or after {0}",
- /**
- * @cfg {String} maxText
- * The error text to display when the time is after maxValue (defaults to
- * 'The time in this field must be equal to or before {0}').
- */
+
maxText : "The time in this field must be equal to or before {0}",
- /**
- * @cfg {String} invalidText
- * The error text to display when the time in the field is invalid (defaults to
- * '{value} is not a valid time').
- */
+
invalidText : "{0} is not a valid time",
- /**
- * @cfg {String} format
- * The default time format string which can be overriden for localization support. The format must be
- * valid according to {@link Date#parseDate} (defaults to 'g:i A', e.g., '3:15 PM'). For 24-hour time
- * format try 'H:i' instead.
- */
+
format : "g:i A",
- /**
- * @cfg {String} altFormats
- * Multiple date formats separated by "|" to try when parsing a user input value and it doesn't match the defined
- * format (defaults to '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').
- */
+
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",
- /**
- * @cfg {Number} increment
- * The number of minutes between each time value in the list (defaults to 15).
- */
+
increment: 15,
- // private override
+
mode: 'local',
- // private override
+
triggerAction: 'all',
- // private override
+
typeAhead: false,
- // private - This is the date to use when generating time values in the absence of either minValue
- // or maxValue. Using the current date causes DST issues on DST boundary dates, so this is an
- // arbitrary "safe" date that can be any date aside from DST boundary dates.
+
+
+
initDate: '1/1/2008',
initDateFormat: 'j/n/Y',
- // private
+
initComponent : function(){
if(Ext.isDefined(this.minValue)){
this.setMinValue(this.minValue, true);
@@ -68846,25 +45441,19 @@ Ext.form.TimeField = Ext.extend(Ext.form.ComboBox, {
Ext.form.TimeField.superclass.initComponent.call(this);
},
- /**
- * Replaces any existing {@link #minValue} with the new time and refreshes the store.
- * @param {Date/String} value The minimum time that can be selected
- */
- setMinValue: function(value, /* private */ initial){
+
+ setMinValue: function(value, initial){
this.setLimit(value, true, initial);
return this;
},
- /**
- * Replaces any existing {@link #maxValue} with the new time and refreshes the store.
- * @param {Date/String} value The maximum time that can be selected
- */
- setMaxValue: function(value, /* private */ initial){
+
+ setMaxValue: function(value, initial){
this.setLimit(value, false, initial);
return this;
},
- // private
+
generateStore: function(initial){
var min = this.minValue || new Date(this.initDate).clearTime(),
max = this.maxValue || new Date(this.initDate).clearTime().add('mi', (24 * 60) - 1),
@@ -68877,7 +45466,7 @@ Ext.form.TimeField = Ext.extend(Ext.form.ComboBox, {
this.bindStore(times, initial);
},
- // private
+
setLimit: function(value, isMin, initial){
var d;
if(Ext.isString(value)){
@@ -68895,18 +45484,18 @@ Ext.form.TimeField = Ext.extend(Ext.form.ComboBox, {
}
},
- // inherited docs
+
getValue : function(){
var v = Ext.form.TimeField.superclass.getValue.call(this);
return this.formatDate(this.parseDate(v)) || '';
},
- // inherited docs
+
setValue : function(value){
return Ext.form.TimeField.superclass.setValue.call(this, this.formatDate(this.parseDate(value)));
},
- // private overrides
+
validateValue : Ext.form.DateField.prototype.validateValue,
formatDate : Ext.form.DateField.prototype.formatDate,
@@ -68918,7 +45507,7 @@ Ext.form.TimeField = Ext.extend(Ext.form.ComboBox, {
var id = this.initDate + ' ',
idf = this.initDateFormat + ' ',
- v = Date.parseDate(id + value, idf + this.format), // *** handle DST. note: this.format is a TIME-only format
+ v = Date.parseDate(id + value, idf + this.format),
af = this.altFormats;
if (!v && af) {
@@ -68933,44 +45522,25 @@ Ext.form.TimeField = Ext.extend(Ext.form.ComboBox, {
return v;
}
});
-Ext.reg('timefield', Ext.form.TimeField);/**
- * @class Ext.form.SliderField
- * @extends Ext.form.Field
- * Wraps a {@link Ext.slider.MultiSlider Slider} so it can be used as a form field.
- * @constructor
- * Creates a new SliderField
- * @param {Object} config Configuration options. Note that you can pass in any slider configuration options, as well as
- * as any field configuration options.
- * @xtype sliderfield
- */
+Ext.reg('timefield', Ext.form.TimeField);
Ext.form.SliderField = Ext.extend(Ext.form.Field, {
- /**
- * @cfg {Boolean} useTips
- * True to use an Ext.slider.Tip to display tips for the value. Defaults to <tt>true</tt>.
- */
+
useTips : true,
- /**
- * @cfg {Function} tipText
- * A function used to display custom text for the slider tip. Defaults to <tt>null</tt>, which will
- * use the default on the plugin.
- */
+
tipText : null,
- // private override
+
actionMode: 'wrap',
- /**
- * Initialize the component.
- * @private
- */
+
initComponent : function() {
var cfg = Ext.copyTo({
id: this.id + '-slider'
}, this.initialConfig, ['vertical', 'minValue', 'maxValue', 'decimalPrecision', 'keyIncrement', 'increment', 'clickToChange', 'animate']);
- // only can use it if it exists.
+
if (this.useTips) {
var plug = this.tipText ? {getText: this.tipText} : {};
cfg.plugins = [new Ext.slider.Tip(plug)];
@@ -68979,12 +45549,7 @@ Ext.form.SliderField = Ext.extend(Ext.form.Field, {
Ext.form.SliderField.superclass.initComponent.call(this);
},
- /**
- * Set up the hidden field
- * @param {Object} ct The container to render to.
- * @param {Object} position The position in the container to render to.
- * @private
- */
+
onRender : function(ct, position){
this.autoCreate = {
id: this.id,
@@ -68998,143 +45563,81 @@ Ext.form.SliderField = Ext.extend(Ext.form.Field, {
this.slider.render(this.wrap);
},
- /**
- * Ensure that the slider size is set automatically when the field resizes.
- * @param {Object} w The width
- * @param {Object} h The height
- * @param {Object} aw The adjusted width
- * @param {Object} ah The adjusted height
- * @private
- */
+
onResize : function(w, h, aw, ah){
Ext.form.SliderField.superclass.onResize.call(this, w, h, aw, ah);
this.slider.setSize(w, h);
},
- /**
- * Initialize any events for this class.
- * @private
- */
+
initEvents : function(){
Ext.form.SliderField.superclass.initEvents.call(this);
this.slider.on('change', this.onChange, this);
},
- /**
- * Utility method to set the value of the field when the slider changes.
- * @param {Object} slider The slider object.
- * @param {Object} v The new value.
- * @private
- */
+
onChange : function(slider, v){
this.setValue(v, undefined, true);
},
- /**
- * Enable the slider when the field is enabled.
- * @private
- */
+
onEnable : function(){
Ext.form.SliderField.superclass.onEnable.call(this);
this.slider.enable();
},
- /**
- * Disable the slider when the field is disabled.
- * @private
- */
+
onDisable : function(){
Ext.form.SliderField.superclass.onDisable.call(this);
this.slider.disable();
},
- /**
- * Ensure the slider is destroyed when the field is destroyed.
- * @private
- */
+
beforeDestroy : function(){
Ext.destroy(this.slider);
Ext.form.SliderField.superclass.beforeDestroy.call(this);
},
- /**
- * If a side icon is shown, do alignment to the slider
- * @private
- */
+
alignErrorIcon : function(){
this.errorIcon.alignTo(this.slider.el, 'tl-tr', [2, 0]);
},
- /**
- * Sets the minimum field value.
- * @param {Number} v The new minimum value.
- * @return {Ext.form.SliderField} this
- */
+
setMinValue : function(v){
this.slider.setMinValue(v);
return this;
},
- /**
- * Sets the maximum field value.
- * @param {Number} v The new maximum value.
- * @return {Ext.form.SliderField} this
- */
+
setMaxValue : function(v){
this.slider.setMaxValue(v);
return this;
},
- /**
- * Sets the value for this field.
- * @param {Number} v The new value.
- * @param {Boolean} animate (optional) Whether to animate the transition. If not specified, it will default to the animate config.
- * @return {Ext.form.SliderField} this
- */
- setValue : function(v, animate, /* private */ silent){
- // silent is used if the setValue method is invoked by the slider
- // which means we don't need to set the value on the slider.
+
+ setValue : function(v, animate, silent){
+
+
if(!silent){
this.slider.setValue(v, animate);
}
return Ext.form.SliderField.superclass.setValue.call(this, this.slider.getValue());
},
- /**
- * Gets the current value for this field.
- * @return {Number} The current value.
- */
+
getValue : function(){
return this.slider.getValue();
}
});
-Ext.reg('sliderfield', Ext.form.SliderField);/**
- * @class Ext.form.Label
- * @extends Ext.BoxComponent
- * Basic Label field.
- * @constructor
- * Creates a new Label
- * @param {Ext.Element/String/Object} config The configuration options. If an element is passed, it is set as the internal
- * element and its id used as the component id. If a string is passed, it is assumed to be the id of an existing element
- * and is used as the component id. Otherwise, it is assumed to be a standard config object and is applied to the component.
- * @xtype label
- */
+Ext.reg('sliderfield', Ext.form.SliderField);
Ext.form.Label = Ext.extend(Ext.BoxComponent, {
- /**
- * @cfg {String} text The plain text to display within the label (defaults to ''). If you need to include HTML
- * tags within the label's innerHTML, use the {@link #html} config instead.
- */
- /**
- * @cfg {String} forId The id of the input element to which this label will be bound via the standard HTML 'for'
- * attribute. If not specified, the attribute will not be added to the label.
- */
- /**
- * @cfg {String} html An HTML fragment that will be used as the label's innerHTML (defaults to '').
- * Note that if {@link #text} is specified it will take precedence and this value will be ignored.
- */
- // private
+
+
+
+
onRender : function(ct, position){
if(!this.el){
this.el = document.createElement('label');
@@ -69147,14 +45650,7 @@ Ext.form.Label = Ext.extend(Ext.BoxComponent, {
Ext.form.Label.superclass.onRender.call(this, ct, position);
},
- /**
- * Updates the label's innerHTML with the specified string.
- * @param {String} text The new label text
- * @param {Boolean} encode (optional) False to skip HTML-encoding the text when rendering it
- * to the label (defaults to true which encodes the value). This might be useful if you want to include
- * tags in the label's innerHTML rather than rendering them as string literals per the default logic.
- * @return {Label} this
- */
+
setText : function(t, encode){
var e = encode === false;
this[!e ? 'text' : 'html'] = t;
@@ -69166,205 +45662,66 @@ Ext.form.Label = Ext.extend(Ext.BoxComponent, {
}
});
-Ext.reg('label', Ext.form.Label);/**
- * @class Ext.form.Action
- * <p>The subclasses of this class provide actions to perform upon {@link Ext.form.BasicForm Form}s.</p>
- * <p>Instances of this class are only created by a {@link Ext.form.BasicForm Form} when
- * the Form needs to perform an action such as submit or load. The Configuration options
- * listed for this class are set through the Form's action methods: {@link Ext.form.BasicForm#submit submit},
- * {@link Ext.form.BasicForm#load load} and {@link Ext.form.BasicForm#doAction doAction}</p>
- * <p>The instance of Action which performed the action is passed to the success
- * and failure callbacks of the Form's action methods ({@link Ext.form.BasicForm#submit submit},
- * {@link Ext.form.BasicForm#load load} and {@link Ext.form.BasicForm#doAction doAction}),
- * and to the {@link Ext.form.BasicForm#actioncomplete actioncomplete} and
- * {@link Ext.form.BasicForm#actionfailed actionfailed} event handlers.</p>
- */
+Ext.reg('label', Ext.form.Label);
Ext.form.Action = function(form, options){
this.form = form;
this.options = options || {};
};
-/**
- * Failure type returned when client side validation of the Form fails
- * thus aborting a submit action. Client side validation is performed unless
- * {@link #clientValidation} is explicitly set to <tt>false</tt>.
- * @type {String}
- * @static
- */
+
Ext.form.Action.CLIENT_INVALID = 'client';
-/**
- * <p>Failure type returned when server side processing fails and the {@link #result}'s
- * <tt style="font-weight:bold">success</tt> property is set to <tt>false</tt>.</p>
- * <p>In the case of a form submission, field-specific error messages may be returned in the
- * {@link #result}'s <tt style="font-weight:bold">errors</tt> property.</p>
- * @type {String}
- * @static
- */
+
Ext.form.Action.SERVER_INVALID = 'server';
-/**
- * Failure type returned when a communication error happens when attempting
- * to send a request to the remote server. The {@link #response} may be examined to
- * provide further information.
- * @type {String}
- * @static
- */
+
Ext.form.Action.CONNECT_FAILURE = 'connect';
-/**
- * Failure type returned when the response's <tt style="font-weight:bold">success</tt>
- * property is set to <tt>false</tt>, or no field values are returned in the response's
- * <tt style="font-weight:bold">data</tt> property.
- * @type {String}
- * @static
- */
+
Ext.form.Action.LOAD_FAILURE = 'load';
Ext.form.Action.prototype = {
-/**
- * @cfg {String} url The URL that the Action is to invoke.
- */
-/**
- * @cfg {Boolean} reset When set to <tt><b>true</b></tt>, causes the Form to be
- * {@link Ext.form.BasicForm.reset reset} on Action success. If specified, this happens
- * <b>before</b> the {@link #success} callback is called and before the Form's
- * {@link Ext.form.BasicForm.actioncomplete actioncomplete} event fires.
- */
-/**
- * @cfg {String} method The HTTP method to use to access the requested URL. Defaults to the
- * {@link Ext.form.BasicForm}'s method, or if that is not specified, the underlying DOM form's method.
- */
-/**
- * @cfg {Mixed} params <p>Extra parameter values to pass. These are added to the Form's
- * {@link Ext.form.BasicForm#baseParams} and passed to the specified URL along with the Form's
- * input fields.</p>
- * <p>Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.</p>
- */
-/**
- * @cfg {Number} timeout The number of seconds to wait for a server response before
- * failing with the {@link #failureType} as {@link #Action.CONNECT_FAILURE}. If not specified,
- * defaults to the configured <tt>{@link Ext.form.BasicForm#timeout timeout}</tt> of the
- * {@link Ext.form.BasicForm form}.
- */
-/**
- * @cfg {Function} success The function to call when a valid success return packet is recieved.
- * The function is passed the following parameters:<ul class="mdetail-params">
- * <li><b>form</b> : Ext.form.BasicForm<div class="sub-desc">The form that requested the action</div></li>
- * <li><b>action</b> : Ext.form.Action<div class="sub-desc">The Action class. The {@link #result}
- * property of this object may be examined to perform custom postprocessing.</div></li>
- * </ul>
- */
-/**
- * @cfg {Function} failure The function to call when a failure packet was recieved, or when an
- * error ocurred in the Ajax communication.
- * The function is passed the following parameters:<ul class="mdetail-params">
- * <li><b>form</b> : Ext.form.BasicForm<div class="sub-desc">The form that requested the action</div></li>
- * <li><b>action</b> : Ext.form.Action<div class="sub-desc">The Action class. If an Ajax
- * error ocurred, the failure type will be in {@link #failureType}. The {@link #result}
- * property of this object may be examined to perform custom postprocessing.</div></li>
- * </ul>
- */
-/**
- * @cfg {Object} scope The scope in which to call the callback functions (The <tt>this</tt> reference
- * for the callback functions).
- */
-/**
- * @cfg {String} waitMsg The message to be displayed by a call to {@link Ext.MessageBox#wait}
- * during the time the action is being processed.
- */
-/**
- * @cfg {String} waitTitle The title to be displayed by a call to {@link Ext.MessageBox#wait}
- * during the time the action is being processed.
- */
-/**
- * @cfg {Boolean} submitEmptyText If set to <tt>true</tt>, the emptyText value will be sent with the form
- * when it is submitted. Defaults to <tt>true</tt>.
- */
-/**
- * The type of action this Action instance performs.
- * Currently only "submit" and "load" are supported.
- * @type {String}
- */
+
+
+
+
+
+
+
+
+
+
+
+
type : 'default',
-/**
- * The type of failure detected will be one of these: {@link #CLIENT_INVALID},
- * {@link #SERVER_INVALID}, {@link #CONNECT_FAILURE}, or {@link #LOAD_FAILURE}. Usage:
- * <pre><code>
-var fp = new Ext.form.FormPanel({
-...
-buttons: [{
- text: 'Save',
- formBind: true,
- handler: function(){
- if(fp.getForm().isValid()){
- fp.getForm().submit({
- url: 'form-submit.php',
- waitMsg: 'Submitting your data...',
- success: function(form, action){
- // server responded with success = true
- var result = action.{@link #result};
- },
- failure: function(form, action){
- if (action.{@link #failureType} === Ext.form.Action.{@link #CONNECT_FAILURE}) {
- Ext.Msg.alert('Error',
- 'Status:'+action.{@link #response}.status+': '+
- action.{@link #response}.statusText);
- }
- if (action.failureType === Ext.form.Action.{@link #SERVER_INVALID}){
- // server responded with success = false
- Ext.Msg.alert('Invalid', action.{@link #result}.errormsg);
- }
- }
- });
- }
- }
-},{
- text: 'Reset',
- handler: function(){
- fp.getForm().reset();
- }
-}]
- * </code></pre>
- * @property failureType
- * @type {String}
- */
- /**
- * The XMLHttpRequest object used to perform the action.
- * @property response
- * @type {Object}
- */
- /**
- * The decoded response object containing a boolean <tt style="font-weight:bold">success</tt> property and
- * other, action-specific properties.
- * @property result
- * @type {Object}
- */
- // interface method
+
+
+
+
run : function(options){
},
- // interface method
+
success : function(response){
},
- // interface method
+
handleResponse : function(response){
},
- // default connection failure
+
failure : function(response){
this.response = response;
this.failureType = Ext.form.Action.CONNECT_FAILURE;
this.form.afterAction(this, false);
},
- // private
- // shared code among all Actions to validate that there was a response
- // with either responseText or responseXml
+
+
+
processResponse : function(response){
this.response = response;
if(!response.responseText && !response.responseXML){
@@ -69382,7 +45739,7 @@ buttons: [{
}
},
- // utility functions used internally
+
getUrl : function(appendParams){
var url = this.options.url || this.form.url || this.form.el.dom.action;
if(appendParams){
@@ -69394,12 +45751,12 @@ buttons: [{
return url;
},
- // private
+
getMethod : function(){
return (this.options.method || this.form.method || this.form.el.dom.method || 'POST').toUpperCase();
},
- // private
+
getParams : function(){
var bp = this.form.baseParams;
var p = this.options.params;
@@ -69415,7 +45772,7 @@ buttons: [{
return p;
},
- // private
+
createCallback : function(opts){
var opts = opts || {};
return {
@@ -69428,83 +45785,17 @@ buttons: [{
}
};
-/**
- * @class Ext.form.Action.Submit
- * @extends Ext.form.Action
- * <p>A class which handles submission of data from {@link Ext.form.BasicForm Form}s
- * and processes the returned response.</p>
- * <p>Instances of this class are only created by a {@link Ext.form.BasicForm Form} when
- * {@link Ext.form.BasicForm#submit submit}ting.</p>
- * <p><u><b>Response Packet Criteria</b></u></p>
- * <p>A response packet may contain:
- * <div class="mdetail-params"><ul>
- * <li><b><code>success</code></b> property : Boolean
- * <div class="sub-desc">The <code>success</code> property is required.</div></li>
- * <li><b><code>errors</code></b> property : Object
- * <div class="sub-desc"><div class="sub-desc">The <code>errors</code> property,
- * which is optional, contains error messages for invalid fields.</div></li>
- * </ul></div>
- * <p><u><b>JSON Packets</b></u></p>
- * <p>By default, response packets are assumed to be JSON, so a typical response
- * packet may look like this:</p><pre><code>
-{
- success: false,
- errors: {
- clientCode: "Client not found",
- portOfLoading: "This field must not be null"
- }
-}</code></pre>
- * <p>Other data may be placed into the response for processing by the {@link Ext.form.BasicForm}'s callback
- * or event handler methods. The object decoded from this JSON is available in the
- * {@link Ext.form.Action#result result} property.</p>
- * <p>Alternatively, if an {@link #errorReader} is specified as an {@link Ext.data.XmlReader XmlReader}:</p><pre><code>
- errorReader: new Ext.data.XmlReader({
- record : 'field',
- success: '@success'
- }, [
- 'id', 'msg'
- ]
- )
-</code></pre>
- * <p>then the results may be sent back in XML format:</p><pre><code>
-&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;message success="false"&gt;
-&lt;errors&gt;
- &lt;field&gt;
- &lt;id&gt;clientCode&lt;/id&gt;
- &lt;msg&gt;&lt;![CDATA[Code not found. &lt;br /&gt;&lt;i&gt;This is a test validation message from the server &lt;/i&gt;]]&gt;&lt;/msg&gt;
- &lt;/field&gt;
- &lt;field&gt;
- &lt;id&gt;portOfLoading&lt;/id&gt;
- &lt;msg&gt;&lt;![CDATA[Port not found. &lt;br /&gt;&lt;i&gt;This is a test validation message from the server &lt;/i&gt;]]&gt;&lt;/msg&gt;
- &lt;/field&gt;
-&lt;/errors&gt;
-&lt;/message&gt;
-</code></pre>
- * <p>Other elements may be placed into the response XML for processing by the {@link Ext.form.BasicForm}'s callback
- * or event handler methods. The XML document is available in the {@link #errorReader}'s {@link Ext.data.XmlReader#xmlData xmlData} property.</p>
- */
+
Ext.form.Action.Submit = function(form, options){
Ext.form.Action.Submit.superclass.constructor.call(this, form, options);
};
Ext.extend(Ext.form.Action.Submit, Ext.form.Action, {
- /**
- * @cfg {Ext.data.DataReader} errorReader <p><b>Optional. JSON is interpreted with
- * no need for an errorReader.</b></p>
- * <p>A Reader which reads a single record from the returned data. The DataReader's
- * <b>success</b> property specifies how submission success is determined. The Record's
- * data provides the error messages to apply to any invalid form Fields.</p>
- */
- /**
- * @cfg {boolean} clientValidation Determines whether a Form's fields are validated
- * in a final call to {@link Ext.form.BasicForm#isValid isValid} prior to submission.
- * Pass <tt>false</tt> in the Form's submit options to prevent this. If not defined, pre-submission field validation
- * is performed.
- */
+
+
type : 'submit',
- // private
+
run : function(){
var o = this.options,
method = this.getMethod(),
@@ -69540,13 +45831,13 @@ Ext.extend(Ext.form.Action.Submit, Ext.form.Action, {
}
});
}
- }else if (o.clientValidation !== false){ // client validation failed
+ }else if (o.clientValidation !== false){
this.failureType = Ext.form.Action.CLIENT_INVALID;
this.form.afterAction(this, false);
}
},
- // private
+
success : function(response){
var result = this.processResponse(response);
if(result === true || result.success){
@@ -69560,7 +45851,7 @@ Ext.extend(Ext.form.Action.Submit, Ext.form.Action, {
this.form.afterAction(this, false);
},
- // private
+
handleResponse : function(response){
if(this.form.errorReader){
var rs = this.form.errorReader.read(response);
@@ -69584,74 +45875,17 @@ Ext.extend(Ext.form.Action.Submit, Ext.form.Action, {
});
-/**
- * @class Ext.form.Action.Load
- * @extends Ext.form.Action
- * <p>A class which handles loading of data from a server into the Fields of an {@link Ext.form.BasicForm}.</p>
- * <p>Instances of this class are only created by a {@link Ext.form.BasicForm Form} when
- * {@link Ext.form.BasicForm#load load}ing.</p>
- * <p><u><b>Response Packet Criteria</b></u></p>
- * <p>A response packet <b>must</b> contain:
- * <div class="mdetail-params"><ul>
- * <li><b><code>success</code></b> property : Boolean</li>
- * <li><b><code>data</code></b> property : Object</li>
- * <div class="sub-desc">The <code>data</code> property contains the values of Fields to load.
- * The individual value object for each Field is passed to the Field's
- * {@link Ext.form.Field#setValue setValue} method.</div></li>
- * </ul></div>
- * <p><u><b>JSON Packets</b></u></p>
- * <p>By default, response packets are assumed to be JSON, so for the following form load call:<pre><code>
-var myFormPanel = new Ext.form.FormPanel({
- title: 'Client and routing info',
- items: [{
- fieldLabel: 'Client',
- name: 'clientName'
- }, {
- fieldLabel: 'Port of loading',
- name: 'portOfLoading'
- }, {
- fieldLabel: 'Port of discharge',
- name: 'portOfDischarge'
- }]
-});
-myFormPanel.{@link Ext.form.FormPanel#getForm getForm}().{@link Ext.form.BasicForm#load load}({
- url: '/getRoutingInfo.php',
- params: {
- consignmentRef: myConsignmentRef
- },
- failure: function(form, action) {
- Ext.Msg.alert("Load failed", action.result.errorMessage);
- }
-});
-</code></pre>
- * a <b>success response</b> packet may look like this:</p><pre><code>
-{
- success: true,
- data: {
- clientName: "Fred. Olsen Lines",
- portOfLoading: "FXT",
- portOfDischarge: "OSL"
- }
-}</code></pre>
- * while a <b>failure response</b> packet may look like this:</p><pre><code>
-{
- success: false,
- errorMessage: "Consignment reference not found"
-}</code></pre>
- * <p>Other data may be placed into the response for processing the {@link Ext.form.BasicForm Form}'s
- * callback or event handler methods. The object decoded from this JSON is available in the
- * {@link Ext.form.Action#result result} property.</p>
- */
+
Ext.form.Action.Load = function(form, options){
Ext.form.Action.Load.superclass.constructor.call(this, form, options);
this.reader = this.form.reader;
};
Ext.extend(Ext.form.Action.Load, Ext.form.Action, {
- // private
+
type : 'load',
- // private
+
run : function(){
Ext.Ajax.request(Ext.apply(
this.createCallback(this.options), {
@@ -69662,7 +45896,7 @@ Ext.extend(Ext.form.Action.Load, Ext.form.Action, {
}));
},
- // private
+
success : function(response){
var result = this.processResponse(response);
if(result === true || !result.success || !result.data){
@@ -69675,7 +45909,7 @@ Ext.extend(Ext.form.Action.Load, Ext.form.Action, {
this.form.afterAction(this, true);
},
- // private
+
handleResponse : function(response){
if(this.form.reader){
var rs = this.form.reader.read(response);
@@ -69691,80 +45925,7 @@ Ext.extend(Ext.form.Action.Load, Ext.form.Action, {
-/**
- * @class Ext.form.Action.DirectLoad
- * @extends Ext.form.Action.Load
- * <p>Provides Ext.direct support for loading form data.</p>
- * <p>This example illustrates usage of Ext.Direct to <b>load</b> a form through Ext.Direct.</p>
- * <pre><code>
-var myFormPanel = new Ext.form.FormPanel({
- // configs for FormPanel
- title: 'Basic Information',
- renderTo: document.body,
- width: 300, height: 160,
- padding: 10,
-
- // configs apply to child items
- defaults: {anchor: '100%'},
- defaultType: 'textfield',
- items: [{
- fieldLabel: 'Name',
- name: 'name'
- },{
- fieldLabel: 'Email',
- name: 'email'
- },{
- fieldLabel: 'Company',
- name: 'company'
- }],
- // configs for BasicForm
- api: {
- // The server-side method to call for load() requests
- load: Profile.getBasicInfo,
- // The server-side must mark the submit handler as a 'formHandler'
- submit: Profile.updateBasicInfo
- },
- // specify the order for the passed params
- paramOrder: ['uid', 'foo']
-});
-
-// load the form
-myFormPanel.getForm().load({
- // pass 2 arguments to server side getBasicInfo method (len=2)
- params: {
- foo: 'bar',
- uid: 34
- }
-});
- * </code></pre>
- * The data packet sent to the server will resemble something like:
- * <pre><code>
-[
- {
- "action":"Profile","method":"getBasicInfo","type":"rpc","tid":2,
- "data":[34,"bar"] // note the order of the params
- }
-]
- * </code></pre>
- * The form will process a data packet returned by the server that is similar
- * to the following format:
- * <pre><code>
-[
- {
- "action":"Profile","method":"getBasicInfo","type":"rpc","tid":2,
- "result":{
- "success":true,
- "data":{
- "name":"Fred Flintstone",
- "company":"Slate Rock and Gravel",
- "email":"fred.flintstone@slaterg.com"
- }
- }
- }
-]
- * </code></pre>
- */
Ext.form.Action.DirectLoad = Ext.extend(Ext.form.Action.Load, {
constructor: function(form, opts) {
Ext.form.Action.DirectLoad.superclass.constructor.call(this, form, opts);
@@ -69792,9 +45953,9 @@ Ext.form.Action.DirectLoad = Ext.extend(Ext.form.Action.Load, {
}
return buf;
},
- // Direct actions have already been processed and therefore
- // we can directly set the result; Direct Actions do not have
- // a this.response property.
+
+
+
processResponse : function(result) {
this.result = result;
return result;
@@ -69808,110 +45969,21 @@ Ext.form.Action.DirectLoad = Ext.extend(Ext.form.Action.Load, {
}
});
-/**
- * @class Ext.form.Action.DirectSubmit
- * @extends Ext.form.Action.Submit
- * <p>Provides Ext.direct support for submitting form data.</p>
- * <p>This example illustrates usage of Ext.Direct to <b>submit</b> a form through Ext.Direct.</p>
- * <pre><code>
-var myFormPanel = new Ext.form.FormPanel({
- // configs for FormPanel
- title: 'Basic Information',
- renderTo: document.body,
- width: 300, height: 160,
- padding: 10,
- buttons:[{
- text: 'Submit',
- handler: function(){
- myFormPanel.getForm().submit({
- params: {
- foo: 'bar',
- uid: 34
- }
- });
- }
- }],
- // configs apply to child items
- defaults: {anchor: '100%'},
- defaultType: 'textfield',
- items: [{
- fieldLabel: 'Name',
- name: 'name'
- },{
- fieldLabel: 'Email',
- name: 'email'
- },{
- fieldLabel: 'Company',
- name: 'company'
- }],
-
- // configs for BasicForm
- api: {
- // The server-side method to call for load() requests
- load: Profile.getBasicInfo,
- // The server-side must mark the submit handler as a 'formHandler'
- submit: Profile.updateBasicInfo
- },
- // specify the order for the passed params
- paramOrder: ['uid', 'foo']
-});
- * </code></pre>
- * The data packet sent to the server will resemble something like:
- * <pre><code>
-{
- "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":"6",
- "result":{
- "success":true,
- "id":{
- "extAction":"Profile","extMethod":"updateBasicInfo",
- "extType":"rpc","extTID":"6","extUpload":"false",
- "name":"Aaron Conran","email":"aaron@extjs.com","company":"Ext JS, LLC"
- }
- }
-}
- * </code></pre>
- * The form will process a data packet returned by the server that is similar
- * to the following:
- * <pre><code>
-// sample success packet (batched requests)
-[
- {
- "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":3,
- "result":{
- "success":true
- }
- }
-]
-
-// sample failure packet (one request)
-{
- "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":"6",
- "result":{
- "errors":{
- "email":"already taken"
- },
- "success":false,
- "foo":"bar"
- }
-}
- * </code></pre>
- * Also see the discussion in {@link Ext.form.Action.DirectLoad}.
- */
Ext.form.Action.DirectSubmit = Ext.extend(Ext.form.Action.Submit, {
constructor : function(form, opts) {
Ext.form.Action.DirectSubmit.superclass.constructor.call(this, form, opts);
},
type : 'directsubmit',
- // override of Submit
+
run : function(){
var o = this.options;
if(o.clientValidation === false || this.form.isValid()){
- // tag on any additional params to be posted in the
- // form scope
+
+
this.success.params = this.getParams();
this.form.api.submit(this.form.el.dom, this.success, this);
- }else if (o.clientValidation !== false){ // client validation failed
+ }else if (o.clientValidation !== false){
this.failureType = Ext.form.Action.CLIENT_INVALID;
this.form.afterAction(this, false);
}
@@ -69924,9 +45996,9 @@ Ext.form.Action.DirectSubmit = Ext.extend(Ext.form.Action.Submit, {
Ext.apply(o, p, bp);
return o;
},
- // Direct actions have already been processed and therefore
- // we can directly set the result; Direct Actions do not have
- // a this.response property.
+
+
+
processResponse : function(result) {
this.result = result;
return result;
@@ -69946,75 +46018,23 @@ Ext.form.Action.ACTION_TYPES = {
'directload' : Ext.form.Action.DirectLoad,
'directsubmit' : Ext.form.Action.DirectSubmit
};
-/**
- * @class Ext.form.VTypes
- * <p>This is a singleton object which contains a set of commonly used field validation functions.
- * The validations provided are basic and intended to be easily customizable and extended.</p>
- * <p>To add custom VTypes specify the <code>{@link Ext.form.TextField#vtype vtype}</code> validation
- * test function, and optionally specify any corresponding error text to display and any keystroke
- * filtering mask to apply. For example:</p>
- * <pre><code>
-// custom Vtype for vtype:'time'
-var timeTest = /^([1-9]|1[0-9]):([0-5][0-9])(\s[a|p]m)$/i;
-Ext.apply(Ext.form.VTypes, {
- // vtype validation function
- time: function(val, field) {
- return timeTest.test(val);
- },
- // vtype Text property: The error text to display when the validation function returns false
- timeText: 'Not a valid time. Must be in the format "12:34 PM".',
- // vtype Mask property: The keystroke filter mask
- timeMask: /[\d\s:amp]/i
-});
- * </code></pre>
- * Another example:
- * <pre><code>
-// custom Vtype for vtype:'IPAddress'
-Ext.apply(Ext.form.VTypes, {
- IPAddress: function(v) {
- return /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(v);
- },
- IPAddressText: 'Must be a numeric IP address',
- IPAddressMask: /[\d\.]/i
-});
- * </code></pre>
- * @singleton
- */
+
Ext.form.VTypes = function(){
- // closure these in so they are only created once.
+
var alpha = /^[a-zA-Z_]+$/,
alphanum = /^[a-zA-Z0-9_]+$/,
email = /^(\w+)([\-+.\'][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/,
url = /(((^https?)|(^ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
- // All these messages and functions are configurable
+
return {
- /**
- * 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 <a href="http://en.wikipedia.org/wiki/E-mail_address">Wikipedia article on email addresses</a>
- * for additional information. This implementation is intended to validate the following emails:<tt>
- * 'barney@example.de', 'barney.rubble@example.com', 'barney-rubble@example.coop', 'barney+rubble@example.com'
- * </tt>.
- * @param {String} value The email address
- * @return {Boolean} true if the RegExp test passed, and false if not.
- */
+
'email' : function(v){
return email.test(v);
},
- /**
- * The error text to display when the email validation function returns false. Defaults to:
- * <tt>'This field should be an e-mail address in the format "user@example.com"'</tt>
- * @type String
- */
+
'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
- * information about more complex email validation. Defaults to:
- * <tt>/[a-z0-9_\.\-\+\'@]/i</tt>
- * @type RegExp
- */
+
'emailMask' : /[a-z0-9_\.\-\+\'@]/i,
/**
@@ -70169,183 +46189,84 @@ Ext.grid.GridPanel = Ext.extend(Ext.Panel, {
*/
autoExpandColumn : false,
- /**
- * @cfg {Number} autoExpandMax The maximum width the <tt>{@link #autoExpandColumn}</tt>
- * can have (if enabled). Defaults to <tt>1000</tt>.
- */
+
autoExpandMax : 1000,
- /**
- * @cfg {Number} autoExpandMin The minimum width the <tt>{@link #autoExpandColumn}</tt>
- * can have (if enabled). Defaults to <tt>50</tt>.
- */
+
autoExpandMin : 50,
- /**
- * @cfg {Boolean} columnLines <tt>true</tt> to add css for column separation lines.
- * Default is <tt>false</tt>.
- */
+
columnLines : false,
- /**
- * @cfg {Object} cm Shorthand for <tt>{@link #colModel}</tt>.
- */
- /**
- * @cfg {Object} colModel The {@link Ext.grid.ColumnModel} to use when rendering the grid (required).
- */
- /**
- * @cfg {Array} columns An array of {@link Ext.grid.Column columns} to auto create a
- * {@link Ext.grid.ColumnModel}. The ColumnModel may be explicitly created via the
- * <tt>{@link #colModel}</tt> configuration property.
- */
- /**
- * @cfg {String} ddGroup The DD group this GridPanel belongs to. Defaults to <tt>'GridDD'</tt> if not specified.
- */
- /**
- * @cfg {String} ddText
- * Configures the text in the drag proxy. Defaults to:
- * <pre><code>
- * ddText : '{0} selected row{1}'
- * </code></pre>
- * <tt>{0}</tt> is replaced with the number of selected rows.
- */
+
+
+
+
+
ddText : '{0} selected row{1}',
- /**
- * @cfg {Boolean} deferRowRender <P>Defaults to <tt>true</tt> to enable deferred row rendering.</p>
- * <p>This allows the GridPanel to be initially rendered empty, with the expensive update of the row
- * structure deferred so that layouts with GridPanels appear more quickly.</p>
- */
+
+
+
deferRowRender : true,
- /**
- * @cfg {Boolean} disableSelection <p><tt>true</tt> to disable selections in the grid. Defaults to <tt>false</tt>.</p>
- * <p>Ignored if a {@link #selModel SelectionModel} is specified.</p>
- */
- /**
- * @cfg {Boolean} enableColumnResize <tt>false</tt> to turn off column resizing for the whole grid. Defaults to <tt>true</tt>.
- */
- /**
- * @cfg {Boolean} enableColumnHide
- * Defaults to <tt>true</tt> to enable {@link Ext.grid.Column#hidden hiding of columns}
- * with the {@link #enableHdMenu header menu}.
- */
+
+
+
enableColumnHide : true,
- /**
- * @cfg {Boolean} enableColumnMove Defaults to <tt>true</tt> to enable drag and drop reorder of columns. <tt>false</tt>
- * to turn off column reordering via drag drop.
- */
+
enableColumnMove : true,
- /**
- * @cfg {Boolean} enableDragDrop <p>Enables dragging of the selected rows of the GridPanel. Defaults to <tt>false</tt>.</p>
- * <p>Setting this to <b><tt>true</tt></b> causes this GridPanel's {@link #getView GridView} to
- * create an instance of {@link Ext.grid.GridDragZone}. <b>Note</b>: this is available only <b>after</b>
- * the Grid has been rendered as the GridView's <tt>{@link Ext.grid.GridView#dragZone dragZone}</tt>
- * property.</p>
- * <p>A cooperating {@link Ext.dd.DropZone DropZone} must be created who's 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 Ext.grid.GridDragZone#getDragData data} which is provided.</p>
- */
+
enableDragDrop : false,
- /**
- * @cfg {Boolean} enableHdMenu Defaults to <tt>true</tt> to enable the drop down button for menu in the headers.
- */
+
enableHdMenu : true,
- /**
- * @cfg {Boolean} hideHeaders True to hide the grid's header. Defaults to <code>false</code>.
- */
- /**
- * @cfg {Object} loadMask An {@link Ext.LoadMask} config or true to mask the grid while
- * loading. Defaults to <code>false</code>.
- */
+
+
loadMask : false,
- /**
- * @cfg {Number} maxHeight Sets the maximum height of the grid - ignored if <tt>autoHeight</tt> is not on.
- */
- /**
- * @cfg {Number} minColumnWidth The minimum width a column can be resized to. Defaults to <tt>25</tt>.
- */
+
+
minColumnWidth : 25,
- /**
- * @cfg {Object} sm Shorthand for <tt>{@link #selModel}</tt>.
- */
- /**
- * @cfg {Object} selModel Any subclass of {@link Ext.grid.AbstractSelectionModel} that will provide
- * the selection model for the grid (defaults to {@link Ext.grid.RowSelectionModel} if not specified).
- */
- /**
- * @cfg {Ext.data.Store} store The {@link Ext.data.Store} the grid should use as its data source (required).
- */
- /**
- * @cfg {Boolean} stripeRows <tt>true</tt> to stripe the rows. Default is <tt>false</tt>.
- * <p>This causes the CSS class <tt><b>x-grid3-row-alt</b></tt> to be added to alternate rows of
- * the grid. A default CSS rule is provided which sets a background colour, but you can override this
- * with a rule which either overrides the <b>background-color</b> style using the '!important'
- * modifier, or which uses a CSS selector of higher specificity.</p>
- */
+
+
+
+
stripeRows : false,
- /**
- * @cfg {Boolean} trackMouseOver True to highlight rows when the mouse is over. Default is <tt>true</tt>
- * for GridPanel, but <tt>false</tt> for EditorGridPanel.
- */
+
trackMouseOver : true,
- /**
- * @cfg {Array} stateEvents
- * An array of events that, when fired, should trigger this component to save its state.
- * Defaults to:<pre><code>
- * stateEvents: ['columnmove', 'columnresize', 'sortchange', 'groupchange']
- * </code></pre>
- * <p>These can be any types of events supported by this component, including browser or
- * custom events (e.g., <tt>['click', 'customerchange']</tt>).</p>
- * <p>See {@link Ext.Component#stateful} for an explanation of saving and restoring
- * Component state.</p>
- */
+
stateEvents : ['columnmove', 'columnresize', 'sortchange', 'groupchange'],
- /**
- * @cfg {Object} view The {@link Ext.grid.GridView} used by the grid. This can be set
- * before a call to {@link Ext.Component#render render()}.
- */
+
view : null,
- /**
- * @cfg {Array} bubbleEvents
- * <p>An array of events that, when fired, should be bubbled to any parent container.
- * See {@link Ext.util.Observable#enableBubble}.
- * Defaults to <tt>[]</tt>.
- */
+
bubbleEvents: [],
- /**
- * @cfg {Object} viewConfig A config object that will be applied to the grid's UI view. Any of
- * the config options available for {@link Ext.grid.GridView} can be specified here. This option
- * is ignored if <tt>{@link #view}</tt> is specified.
- */
- // private
+
+
rendered : false,
- // private
+
viewReady : false,
- // private
+
initComponent : function() {
Ext.grid.GridPanel.superclass.initComponent.call(this);
if (this.columnLines) {
this.cls = (this.cls || '') + ' x-grid-with-col-lines';
}
- // override any provided value since it isn't valid
- // and is causing too many bug reports ;)
+
+
this.autoScroll = false;
this.autoWidth = false;
@@ -70354,7 +46275,7 @@ Ext.grid.GridPanel = Ext.extend(Ext.Panel, {
delete this.columns;
}
- // check and correct shorthanded configs
+
if(this.ds){
this.store = this.ds;
delete this.ds;
@@ -70370,328 +46291,99 @@ Ext.grid.GridPanel = Ext.extend(Ext.Panel, {
this.store = Ext.StoreMgr.lookup(this.store);
this.addEvents(
- // raw events
- /**
- * @event click
- * The raw click event for the entire grid.
- * @param {Ext.EventObject} e
- */
+
+
'click',
- /**
- * @event dblclick
- * The raw dblclick event for the entire grid.
- * @param {Ext.EventObject} e
- */
+
'dblclick',
- /**
- * @event contextmenu
- * The raw contextmenu event for the entire grid.
- * @param {Ext.EventObject} e
- */
+
'contextmenu',
- /**
- * @event mousedown
- * The raw mousedown event for the entire grid.
- * @param {Ext.EventObject} e
- */
+
'mousedown',
- /**
- * @event mouseup
- * The raw mouseup event for the entire grid.
- * @param {Ext.EventObject} e
- */
+
'mouseup',
- /**
- * @event mouseover
- * The raw mouseover event for the entire grid.
- * @param {Ext.EventObject} e
- */
+
'mouseover',
- /**
- * @event mouseout
- * The raw mouseout event for the entire grid.
- * @param {Ext.EventObject} e
- */
+
'mouseout',
- /**
- * @event keypress
- * The raw keypress event for the entire grid.
- * @param {Ext.EventObject} e
- */
+
'keypress',
- /**
- * @event keydown
- * The raw keydown event for the entire grid.
- * @param {Ext.EventObject} e
- */
+
'keydown',
- // custom events
- /**
- * @event cellmousedown
- * Fires before a cell is clicked
- * @param {Grid} this
- * @param {Number} rowIndex
- * @param {Number} columnIndex
- * @param {Ext.EventObject} e
- */
+
+
'cellmousedown',
- /**
- * @event rowmousedown
- * Fires before a row is clicked
- * @param {Grid} this
- * @param {Number} rowIndex
- * @param {Ext.EventObject} e
- */
+
'rowmousedown',
- /**
- * @event headermousedown
- * Fires before a header is clicked
- * @param {Grid} this
- * @param {Number} columnIndex
- * @param {Ext.EventObject} e
- */
+
'headermousedown',
- /**
- * @event groupmousedown
- * Fires before a group header is clicked. <b>Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}</b>.
- * @param {Grid} this
- * @param {String} groupField
- * @param {String} groupValue
- * @param {Ext.EventObject} e
- */
+
'groupmousedown',
- /**
- * @event rowbodymousedown
- * Fires before the row body is clicked. <b>Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured.</b>
- * @param {Grid} this
- * @param {Number} rowIndex
- * @param {Ext.EventObject} e
- */
+
'rowbodymousedown',
- /**
- * @event containermousedown
- * Fires before the container is clicked. The container consists of any part of the grid body that is not covered by a row.
- * @param {Grid} this
- * @param {Ext.EventObject} e
- */
+
'containermousedown',
- /**
- * @event cellclick
- * Fires when a cell is clicked.
- * The data for the cell is drawn from the {@link Ext.data.Record Record}
- * for this row. To access the data in the listener function use the
- * following technique:
- * <pre><code>
-function(grid, rowIndex, columnIndex, e) {
- var record = grid.getStore().getAt(rowIndex); // Get the Record
- var fieldName = grid.getColumnModel().getDataIndex(columnIndex); // Get field name
- var data = record.get(fieldName);
-}
-</code></pre>
- * @param {Grid} this
- * @param {Number} rowIndex
- * @param {Number} columnIndex
- * @param {Ext.EventObject} e
- */
+
'cellclick',
- /**
- * @event celldblclick
- * Fires when a cell is double clicked
- * @param {Grid} this
- * @param {Number} rowIndex
- * @param {Number} columnIndex
- * @param {Ext.EventObject} e
- */
+
'celldblclick',
- /**
- * @event rowclick
- * Fires when a row is clicked
- * @param {Grid} this
- * @param {Number} rowIndex
- * @param {Ext.EventObject} e
- */
+
'rowclick',
- /**
- * @event rowdblclick
- * Fires when a row is double clicked
- * @param {Grid} this
- * @param {Number} rowIndex
- * @param {Ext.EventObject} e
- */
+
'rowdblclick',
- /**
- * @event headerclick
- * Fires when a header is clicked
- * @param {Grid} this
- * @param {Number} columnIndex
- * @param {Ext.EventObject} e
- */
+
'headerclick',
- /**
- * @event headerdblclick
- * Fires when a header cell is double clicked
- * @param {Grid} this
- * @param {Number} columnIndex
- * @param {Ext.EventObject} e
- */
+
'headerdblclick',
- /**
- * @event groupclick
- * Fires when group header is clicked. <b>Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}</b>.
- * @param {Grid} this
- * @param {String} groupField
- * @param {String} groupValue
- * @param {Ext.EventObject} e
- */
+
'groupclick',
- /**
- * @event groupdblclick
- * Fires when group header is double clicked. <b>Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}</b>.
- * @param {Grid} this
- * @param {String} groupField
- * @param {String} groupValue
- * @param {Ext.EventObject} e
- */
+
'groupdblclick',
- /**
- * @event containerclick
- * Fires when the container is clicked. The container consists of any part of the grid body that is not covered by a row.
- * @param {Grid} this
- * @param {Ext.EventObject} e
- */
+
'containerclick',
- /**
- * @event containerdblclick
- * Fires when the container is double clicked. The container consists of any part of the grid body that is not covered by a row.
- * @param {Grid} this
- * @param {Ext.EventObject} e
- */
+
'containerdblclick',
- /**
- * @event rowbodyclick
- * Fires when the row body is clicked. <b>Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured.</b>
- * @param {Grid} this
- * @param {Number} rowIndex
- * @param {Ext.EventObject} e
- */
+
'rowbodyclick',
- /**
- * @event rowbodydblclick
- * Fires when the row body is double clicked. <b>Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured.</b>
- * @param {Grid} this
- * @param {Number} rowIndex
- * @param {Ext.EventObject} e
- */
+
'rowbodydblclick',
- /**
- * @event rowcontextmenu
- * Fires when a row is right clicked
- * @param {Grid} this
- * @param {Number} rowIndex
- * @param {Ext.EventObject} e
- */
+
'rowcontextmenu',
- /**
- * @event cellcontextmenu
- * Fires when a cell is right clicked
- * @param {Grid} this
- * @param {Number} rowIndex
- * @param {Number} cellIndex
- * @param {Ext.EventObject} e
- */
+
'cellcontextmenu',
- /**
- * @event headercontextmenu
- * Fires when a header is right clicked
- * @param {Grid} this
- * @param {Number} columnIndex
- * @param {Ext.EventObject} e
- */
+
'headercontextmenu',
- /**
- * @event groupcontextmenu
- * Fires when group header is right clicked. <b>Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}</b>.
- * @param {Grid} this
- * @param {String} groupField
- * @param {String} groupValue
- * @param {Ext.EventObject} e
- */
+
'groupcontextmenu',
- /**
- * @event containercontextmenu
- * Fires when the container is right clicked. The container consists of any part of the grid body that is not covered by a row.
- * @param {Grid} this
- * @param {Ext.EventObject} e
- */
+
'containercontextmenu',
- /**
- * @event rowbodycontextmenu
- * Fires when the row body is right clicked. <b>Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured.</b>
- * @param {Grid} this
- * @param {Number} rowIndex
- * @param {Ext.EventObject} e
- */
+
'rowbodycontextmenu',
- /**
- * @event bodyscroll
- * Fires when the body element is scrolled
- * @param {Number} scrollLeft
- * @param {Number} scrollTop
- */
+
'bodyscroll',
- /**
- * @event columnresize
- * Fires when the user resizes a column
- * @param {Number} columnIndex
- * @param {Number} newSize
- */
+
'columnresize',
- /**
- * @event columnmove
- * Fires when the user moves a column
- * @param {Number} oldIndex
- * @param {Number} newIndex
- */
+
'columnmove',
- /**
- * @event sortchange
- * Fires when the grid's store sort changes
- * @param {Grid} this
- * @param {Object} sortInfo An object with the keys field and direction
- */
+
'sortchange',
- /**
- * @event groupchange
- * Fires when the grid's grouping changes (only applies for grids with a {@link Ext.grid.GroupingView GroupingView})
- * @param {Grid} this
- * @param {String} groupField A string with the grouping field, null if the store is not grouped.
- */
+
'groupchange',
- /**
- * @event reconfigure
- * Fires when the grid is reconfigured with a new store and/or column model.
- * @param {Grid} this
- * @param {Ext.data.Store} store The new store
- * @param {Ext.grid.ColumnModel} colModel The new column model
- */
+
'reconfigure',
- /**
- * @event viewready
- * Fires when the grid view is available (use this for selecting a default row).
- * @param {Grid} this
- */
+
'viewready'
);
},
- // private
+
onRender : function(ct, position){
Ext.grid.GridPanel.superclass.onRender.apply(this, arguments);
@@ -70715,7 +46407,7 @@ function(grid, rowIndex, columnIndex, e) {
this.getSelectionModel().init(this);
},
- // private
+
initEvents : function(){
Ext.grid.GridPanel.superclass.initEvents.call(this);
@@ -70747,7 +46439,8 @@ function(grid, rowIndex, columnIndex, e) {
cm.setState(colIndex, {
hidden: s.hidden,
width: s.width,
- sortable: s.sortable
+ sortable: c.sortable,
+ editable: c.editable
});
if(colIndex != i){
cm.moveColumn(colIndex, i);
@@ -70790,9 +46483,6 @@ function(grid, rowIndex, columnIndex, e) {
if(c.hidden){
o.columns[i].hidden = true;
}
- if(c.sortable){
- o.columns[i].sortable = true;
- }
}
if(store){
ss = store.getSortState();
@@ -70809,7 +46499,7 @@ function(grid, rowIndex, columnIndex, e) {
return o;
},
- // private
+
afterRender : function(){
Ext.grid.GridPanel.superclass.afterRender.call(this);
var v = this.view;
@@ -70826,18 +46516,7 @@ function(grid, rowIndex, columnIndex, e) {
this.viewReady = true;
},
- /**
- * <p>Reconfigures the grid to use a different Store and Column Model
- * and fires the 'reconfigure' event. The View will be bound to the new
- * objects and refreshed.</p>
- * <p>Be aware that upon reconfiguring a GridPanel, certain existing settings <i>may</i> become
- * invalidated. For example the configured {@link #autoExpandColumn} may no longer exist in the
- * new ColumnModel. Also, an existing {@link Ext.PagingToolbar PagingToolbar} will still be bound
- * to the old Store, and will need rebinding. Any {@link #plugins} might also need reconfiguring
- * with the new data.</p>
- * @param {Ext.data.Store} store The new {@link Ext.data.Store} object
- * @param {Ext.grid.ColumnModel} colModel The new {@link Ext.grid.ColumnModel} object
- */
+
reconfigure : function(store, colModel){
var rendered = this.rendered;
if(rendered){
@@ -70858,7 +46537,7 @@ function(grid, rowIndex, columnIndex, e) {
this.fireEvent('reconfigure', this, store, colModel);
},
- // private
+
onDestroy : function(){
if (this.deferRowRenderTask && this.deferRowRenderTask.cancel){
this.deferRowRenderTask.cancel();
@@ -70873,32 +46552,32 @@ function(grid, rowIndex, columnIndex, e) {
Ext.grid.GridPanel.superclass.onDestroy.call(this);
},
- // private
+
processEvent : function(name, e){
this.view.processEvent(name, e);
},
- // private
+
onClick : function(e){
this.processEvent('click', e);
},
- // private
+
onMouseDown : function(e){
this.processEvent('mousedown', e);
},
- // private
+
onContextMenu : function(e, t){
this.processEvent('contextmenu', e);
},
- // private
+
onDblClick : function(e){
this.processEvent('dblclick', e);
},
- // private
+
walkCells : function(row, col, step, fn, scope){
var cm = this.colModel,
clen = cm.getColumnCount(),
@@ -70946,23 +46625,15 @@ function(grid, rowIndex, columnIndex, e) {
return null;
},
- /**
- * Returns the grid's underlying element.
- * @return {Element} The element
- */
+
getGridEl : function(){
return this.body;
},
- // private for compatibility, overridden by editor grid
+
stopEditing : Ext.emptyFn,
- /**
- * Returns the grid's selection model configured by the <code>{@link #selModel}</code>
- * configuration option. If no selection model was configured, this will create
- * and return a {@link Ext.grid.RowSelectionModel RowSelectionModel}.
- * @return {SelectionModel}
- */
+
getSelectionModel : function(){
if(!this.selModel){
this.selModel = new Ext.grid.RowSelectionModel(
@@ -70971,26 +46642,17 @@ function(grid, rowIndex, columnIndex, e) {
return this.selModel;
},
- /**
- * Returns the grid's data store.
- * @return {Ext.data.Store} The store
- */
+
getStore : function(){
return this.store;
},
- /**
- * Returns the grid's ColumnModel.
- * @return {Ext.grid.ColumnModel} The column model
- */
+
getColumnModel : function(){
return this.colModel;
},
- /**
- * Returns the grid's GridView object.
- * @return {Ext.grid.GridView} The grid view
- */
+
getView : function() {
if (!this.view) {
this.view = new Ext.grid.GridView(this.viewConfig);
@@ -70998,374 +46660,97 @@ function(grid, rowIndex, columnIndex, e) {
return this.view;
},
- /**
- * Called to get grid's drag proxy text, by default returns this.ddText.
- * @return {String} The text
- */
+
getDragDropText : function(){
- var count = this.selModel.getCount();
+ var count = this.selModel.getCount ? this.selModel.getCount() : 1;
return String.format(this.ddText, count, count == 1 ? '' : 's');
}
- /**
- * @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 add
- * @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
- */
- /**
- * @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} autoScroll @hide
- */
- /**
- * @cfg {String} bodyBorder @hide
- */
- /**
- * @cfg {String} bodyStyle @hide
- */
- /**
- * @cfg {String} contentEl @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.reg('grid', Ext.grid.GridPanel);/**
- * @class Ext.grid.PivotGrid
- * @extends Ext.grid.GridPanel
- * <p>The PivotGrid component enables rapid summarization of large data sets. It provides a way to reduce a large set of
- * data down into a format where trends and insights become more apparent. A classic example is in sales data; a company
- * will often have a record of all sales it makes for a given period - this will often encompass thousands of rows of
- * data. The PivotGrid allows you to see how well each salesperson performed, which cities generate the most revenue,
- * how products perform between cities and so on.</p>
- * <p>A PivotGrid is composed of two axes (left and top), one {@link #measure} and one {@link #aggregator aggregation}
- * function. Each axis can contain one or more {@link #dimension}, which are ordered into a hierarchy. Dimensions on the
- * left axis can also specify a width. Each dimension in each axis can specify its sort ordering, defaulting to "ASC",
- * and must specify one of the fields in the {@link Ext.data.Record Record} used by the PivotGrid's
- * {@link Ext.data.Store Store}.</p>
-<pre><code>
-// This is the record representing a single sale
-var SaleRecord = Ext.data.Record.create([
- {name: 'person', type: 'string'},
- {name: 'product', type: 'string'},
- {name: 'city', type: 'string'},
- {name: 'state', type: 'string'},
- {name: 'year', type: 'int'},
- {name: 'value', type: 'int'}
-]);
-// A simple store that loads SaleRecord data from a url
-var myStore = new Ext.data.Store({
- url: 'data.json',
- autoLoad: true,
- reader: new Ext.data.JsonReader({
- root: 'rows',
- idProperty: 'id'
- }, SaleRecord)
-});
-// Create the PivotGrid itself, referencing the store
-var pivot = new Ext.grid.PivotGrid({
- store : myStore,
- aggregator: 'sum',
- measure : 'value',
- leftAxis: [
- {
- width: 60,
- dataIndex: 'product'
- },
- {
- width: 120,
- dataIndex: 'person',
- direction: 'DESC'
- }
- ],
- topAxis: [
- {
- dataIndex: 'year'
- }
- ]
-});
-</code></pre>
- * <p>The specified {@link #measure} is the field from SaleRecord that is extracted from each combination
- * of product and person (on the left axis) and year on the top axis. There may be several SaleRecords in the
- * data set that share this combination, so an array of measure fields is produced. This array is then
- * aggregated using the {@link #aggregator} function.</p>
- * <p>The default aggregator function is sum, which simply adds up all of the extracted measure values. Other
- * built-in aggregator functions are count, avg, min and max. In addition, you can specify your own function.
- * In this example we show the code used to sum the measures, but you can return any value you like. See
- * {@link #aggregator} for more details.</p>
-<pre><code>
-new Ext.grid.PivotGrid({
- aggregator: function(records, measure) {
- var length = records.length,
- total = 0,
- i;
- for (i = 0; i < length; i++) {
- total += records[i].get(measure);
- }
- return total;
- },
- renderer: function(value) {
- return Math.round(value);
- },
- //your normal config here
-});
-</code></pre>
- * <p><u>Renderers</u></p>
- * <p>PivotGrid optionally accepts a {@link #renderer} function which can modify the data in each cell before it
- * is rendered. The renderer is passed the value that would usually be placed in the cell and is expected to return
- * the new value. For example let's imagine we had height data expressed as a decimal - here's how we might use a
- * renderer to display the data in feet and inches notation:</p>
-<pre><code>
-new Ext.grid.PivotGrid({
- //in each case the value is a decimal number of feet
- renderer : function(value) {
- var feet = Math.floor(value),
- inches = Math.round((value - feet) * 12);
- return String.format("{0}' {1}\"", feet, inches);
- },
- //normal config here
-});
-</code></pre>
- * <p><u>Reconfiguring</u></p>
- * <p>All aspects PivotGrid's configuration can be updated at runtime. It is easy to change the {@link #setMeasure measure},
- * {@link #setAggregator aggregation function}, {@link #setLeftAxis left} and {@link #setTopAxis top} axes and refresh the grid.</p>
- * <p>In this case we reconfigure the PivotGrid to have city and year as the top axis dimensions, rendering the average sale
- * value into the cells:</p>
-<pre><code>
-//the left axis can also be changed
-pivot.topAxis.setDimensions([
- {dataIndex: 'city', direction: 'DESC'},
- {dataIndex: 'year', direction: 'ASC'}
-]);
-pivot.setMeasure('value');
-pivot.setAggregator('avg');
-pivot.view.refresh(true);
-</code></pre>
- * <p>See the {@link Ext.grid.PivotAxis PivotAxis} documentation for further detail on reconfiguring axes.</p>
- */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+});
+Ext.reg('grid', Ext.grid.GridPanel);
Ext.grid.PivotGrid = Ext.extend(Ext.grid.GridPanel, {
- /**
- * @cfg {String|Function} aggregator The aggregation function to use to combine the measures extracted
- * for each dimension combination. Can be any of the built-in aggregators (sum, count, avg, min, max).
- * Can also be a function which accepts two arguments (an array of Records to aggregate, and the measure
- * to aggregate them on) and should return a String.
- */
+
aggregator: 'sum',
- /**
- * @cfg {Function} renderer Optional renderer to pass values through before they are rendered to the dom. This
- * gives an opportunity to modify cell contents after the value has been computed.
- */
+
renderer: undefined,
- /**
- * @cfg {String} measure The field to extract from each Record when pivoting around the two axes. See the class
- * introduction docs for usage
- */
- /**
- * @cfg {Array|Ext.grid.PivotAxis} leftAxis Either and array of {@link #dimension} to use on the left axis, or
- * a {@link Ext.grid.PivotAxis} instance. If an array is passed, it is turned into a PivotAxis internally.
- */
- /**
- * @cfg {Array|Ext.grid.PivotAxis} topAxis Either and array of {@link #dimension} to use on the top axis, or
- * a {@link Ext.grid.PivotAxis} instance. If an array is passed, it is turned into a PivotAxis internally.
- */
- //inherit docs
+
+
+
+
initComponent: function() {
Ext.grid.PivotGrid.superclass.initComponent.apply(this, arguments);
this.initAxes();
- //no resizing of columns is allowed yet in PivotGrid
+
this.enableColumnResize = false;
this.viewConfig = Ext.apply(this.viewConfig || {}, {
forceFit: true
});
- //TODO: dummy col model that is never used - GridView is too tightly integrated with ColumnModel
- //in 3.x to remove this altogether.
+
+
this.colModel = new Ext.grid.ColumnModel({});
},
- /**
- * Returns the function currently used to aggregate the records in each Pivot cell
- * @return {Function} The current aggregator function
- */
+
getAggregator: function() {
if (typeof this.aggregator == 'string') {
return Ext.grid.PivotAggregatorMgr.types[this.aggregator];
@@ -71374,33 +46759,19 @@ Ext.grid.PivotGrid = Ext.extend(Ext.grid.GridPanel, {
}
},
- /**
- * Sets the function to use when aggregating data for each cell.
- * @param {String|Function} aggregator The new aggregator function or named function string
- */
+
setAggregator: function(aggregator) {
this.aggregator = aggregator;
},
- /**
- * Sets the field name to use as the Measure in this Pivot Grid
- * @param {String} measure The field to make the measure
- */
+
setMeasure: function(measure) {
this.measure = measure;
},
- /**
- * Sets the left axis of this pivot grid. Optionally refreshes the grid afterwards.
- * @param {Ext.grid.PivotAxis} axis The pivot axis
- * @param {Boolean} refresh True to immediately refresh the grid and its axes (defaults to false)
- */
+
setLeftAxis: function(axis, refresh) {
- /**
- * The configured {@link Ext.grid.PivotAxis} used as the left Axis for this Pivot Grid
- * @property leftAxis
- * @type Ext.grid.PivotAxis
- */
+
this.leftAxis = axis;
if (refresh) {
@@ -71408,17 +46779,9 @@ Ext.grid.PivotGrid = Ext.extend(Ext.grid.GridPanel, {
}
},
- /**
- * Sets the top axis of this pivot grid. Optionally refreshes the grid afterwards.
- * @param {Ext.grid.PivotAxis} axis The pivot axis
- * @param {Boolean} refresh True to immediately refresh the grid and its axes (defaults to false)
- */
+
setTopAxis: function(axis, refresh) {
- /**
- * The configured {@link Ext.grid.PivotAxis} used as the top Axis for this Pivot Grid
- * @property topAxis
- * @type Ext.grid.PivotAxis
- */
+
this.topAxis = axis;
if (refresh) {
@@ -71426,10 +46789,7 @@ Ext.grid.PivotGrid = Ext.extend(Ext.grid.GridPanel, {
}
},
- /**
- * @private
- * Creates the top and left axes. Should usually only need to be called once from initComponent
- */
+
initAxes: function() {
var PivotAxis = Ext.grid.PivotAxis;
@@ -71450,10 +46810,7 @@ Ext.grid.PivotGrid = Ext.extend(Ext.grid.GridPanel, {
};
},
- /**
- * @private
- * @return {Array} 2-dimensional array of cell data
- */
+
extractData: function() {
var records = this.store.data.items,
recCount = records.length,
@@ -71503,10 +46860,7 @@ Ext.grid.PivotGrid = Ext.extend(Ext.grid.GridPanel, {
return cells;
},
- /**
- * Returns the grid's GridView object.
- * @return {Ext.grid.PivotGridView} The grid view
- */
+
getView: function() {
if (!this.view) {
this.view = new Ext.grid.PivotGridView(this.viewConfig);
@@ -71571,298 +46925,119 @@ Ext.grid.PivotAggregatorMgr.registerType('max', function(records, measure) {
Ext.grid.PivotAggregatorMgr.registerType('count', function(records, measure) {
return records.length;
-});/**
- * @class Ext.grid.GridView
- * @extends Ext.util.Observable
- * <p>This class encapsulates the user interface of an {@link Ext.grid.GridPanel}.
- * Methods of this class may be used to access user interface elements to enable
- * special display effects. Do not change the DOM structure of the user interface.</p>
- * <p>This class does not provide ways to manipulate the underlying data. The data
- * model of a Grid is held in an {@link Ext.data.Store}.</p>
- * @constructor
- * @param {Object} config
- */
+});
Ext.grid.GridView = Ext.extend(Ext.util.Observable, {
- /**
- * Override this function to apply custom CSS classes to rows during rendering. You can also supply custom
- * parameters to the row template for the current row to customize how it is rendered using the <b>rowParams</b>
- * parameter. This function should return the CSS class name (or empty string '' for none) that will be added
- * to the row's wrapping div. To apply multiple class names, simply return them space-delimited within the string
- * (e.g., 'my-class another-class'). Example usage:
- <pre><code>
-viewConfig: {
- forceFit: true,
- showPreview: true, // custom property
- enableRowBody: true, // required to create a second, full-width row to show expanded Record data
- getRowClass: function(record, rowIndex, rp, ds){ // rp = rowParams
- if(this.showPreview){
- rp.body = '&lt;p>'+record.data.excerpt+'&lt;/p>';
- return 'x-grid3-row-expanded';
- }
- return 'x-grid3-row-collapsed';
- }
-},
- </code></pre>
- * @param {Record} record The {@link Ext.data.Record} corresponding to the current row.
- * @param {Number} index The row index.
- * @param {Object} rowParams A config object that is passed to the row template during rendering that allows
- * customization of various aspects of a grid row.
- * <p>If {@link #enableRowBody} is configured <b><tt></tt>true</b>, then the following properties may be set
- * by this function, and will be used to render a full-width expansion row below each grid row:</p>
- * <ul>
- * <li><code>body</code> : String <div class="sub-desc">An HTML fragment to be used as the expansion row's body content (defaults to '').</div></li>
- * <li><code>bodyStyle</code> : String <div class="sub-desc">A CSS style specification that will be applied to the expansion row's &lt;tr> element. (defaults to '').</div></li>
- * </ul>
- * The following property will be passed in, and may be appended to:
- * <ul>
- * <li><code>tstyle</code> : String <div class="sub-desc">A CSS style specification that willl be applied to the &lt;table> element which encapsulates
- * both the standard grid row, and any expansion row.</div></li>
- * </ul>
- * @param {Store} store The {@link Ext.data.Store} this grid is bound to
- * @method getRowClass
- * @return {String} a CSS class name to add to the row.
- */
- /**
- * @cfg {Boolean} enableRowBody True to add a second TR element per row that can be used to provide a row body
- * that spans beneath the data row. Use the {@link #getRowClass} method's rowParams config to customize the row body.
- */
- /**
- * @cfg {String} emptyText Default text (html tags are accepted) to display in the grid body when no rows
- * are available (defaults to ''). This value will be used to update the <tt>{@link #mainBody}</tt>:
- <pre><code>
- this.mainBody.update('&lt;div class="x-grid-empty">' + this.emptyText + '&lt;/div>');
- </code></pre>
- */
- /**
- * @cfg {Boolean} headersDisabled True to disable the grid column headers (defaults to <tt>false</tt>).
- * Use the {@link Ext.grid.ColumnModel ColumnModel} <tt>{@link Ext.grid.ColumnModel#menuDisabled menuDisabled}</tt>
- * config to disable the <i>menu</i> for individual columns. While this config is true the
- * following will be disabled:<div class="mdetail-params"><ul>
- * <li>clicking on header to sort</li>
- * <li>the trigger to reveal the menu.</li>
- * </ul></div>
- */
- /**
- * <p>A customized implementation of a {@link Ext.dd.DragZone DragZone} which provides default implementations
- * of the template methods of DragZone to enable dragging of the selected rows of a GridPanel.
- * See {@link Ext.grid.GridDragZone} for details.</p>
- * <p>This will <b>only</b> be present:<div class="mdetail-params"><ul>
- * <li><i>if</i> the owning GridPanel was configured with {@link Ext.grid.GridPanel#enableDragDrop enableDragDrop}: <tt>true</tt>.</li>
- * <li><i>after</i> the owning GridPanel has been rendered.</li>
- * </ul></div>
- * @property dragZone
- * @type {Ext.grid.GridDragZone}
- */
- /**
- * @cfg {Boolean} deferEmptyText True to defer <tt>{@link #emptyText}</tt> being applied until the store's
- * first load (defaults to <tt>true</tt>).
- */
+
+
+
+
+
+
deferEmptyText : true,
- /**
- * @cfg {Number} scrollOffset The amount of space to reserve for the vertical scrollbar
- * (defaults to <tt>undefined</tt>). If an explicit value isn't specified, this will be automatically
- * calculated.
- */
+
scrollOffset : undefined,
- /**
- * @cfg {Boolean} autoFill
- * Defaults to <tt>false</tt>. Specify <tt>true</tt> to have the column widths re-proportioned
- * when the grid is <b>initially rendered</b>. The
- * {@link Ext.grid.Column#width initially configured width}</tt> 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 <b>not</b> be resized to fit the grid width.
- * See <tt>{@link #forceFit}</tt> also.
- */
+
autoFill : false,
- /**
- * @cfg {Boolean} forceFit
- * <p>Defaults to <tt>false</tt>. Specify <tt>true</tt> to have the column widths re-proportioned
- * at <b>all times</b>.</p>
- * <p>The {@link Ext.grid.Column#width initially configured width}</tt> 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 <b>will</b> be resized
- * to fit the grid width.</p>
- * <p>Columns which are configured with <code>fixed: true</code> are omitted from being resized.</p>
- * <p>See <tt>{@link #autoFill}</tt>.</p>
- */
+
forceFit : false,
- /**
- * @cfg {Array} sortClasses The CSS classes applied to a header when it is sorted. (defaults to <tt>['sort-asc', 'sort-desc']</tt>)
- */
+
sortClasses : ['sort-asc', 'sort-desc'],
- /**
- * @cfg {String} sortAscText The text displayed in the 'Sort Ascending' menu item (defaults to <tt>'Sort Ascending'</tt>)
- */
+
sortAscText : 'Sort Ascending',
- /**
- * @cfg {String} sortDescText The text displayed in the 'Sort Descending' menu item (defaults to <tt>'Sort Descending'</tt>)
- */
+
sortDescText : 'Sort Descending',
- /**
- * @cfg {String} columnsText The text displayed in the 'Columns' menu item (defaults to <tt>'Columns'</tt>)
- */
+
+ hideSortIcons: false,
+
+
columnsText : 'Columns',
- /**
- * @cfg {String} selectedRowClass The CSS class applied to a selected row (defaults to <tt>'x-grid3-row-selected'</tt>). An
- * example overriding the default styling:
- <pre><code>
- .x-grid3-row-selected {background-color: yellow;}
- </code></pre>
- * 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:
- <pre><code>
- .x-grid3-row-selected .x-grid3-cell-inner {
- color: #FFCC00;
- }
- </code></pre>
- * @type String
- */
+
selectedRowClass : 'x-grid3-row-selected',
- // private
+
borderWidth : 2,
tdClass : 'x-grid3-cell',
hdCls : 'x-grid3-hd',
- /**
- * @cfg {Boolean} markDirty True to show the dirty cell indicator when a cell has been modified. Defaults to <tt>true</tt>.
- */
+
markDirty : true,
- /**
- * @cfg {Number} cellSelectorDepth The number of levels to search for cells in event delegation (defaults to <tt>4</tt>)
- */
+
cellSelectorDepth : 4,
- /**
- * @cfg {Number} rowSelectorDepth The number of levels to search for rows in event delegation (defaults to <tt>10</tt>)
- */
+
rowSelectorDepth : 10,
- /**
- * @cfg {Number} rowBodySelectorDepth The number of levels to search for row bodies in event delegation (defaults to <tt>10</tt>)
- */
+
rowBodySelectorDepth : 10,
- /**
- * @cfg {String} cellSelector The selector used to find cells internally (defaults to <tt>'td.x-grid3-cell'</tt>)
- */
+
cellSelector : 'td.x-grid3-cell',
- /**
- * @cfg {String} rowSelector The selector used to find rows internally (defaults to <tt>'div.x-grid3-row'</tt>)
- */
+
rowSelector : 'div.x-grid3-row',
- /**
- * @cfg {String} rowBodySelector The selector used to find row bodies internally (defaults to <tt>'div.x-grid3-row'</tt>)
- */
+
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,
-
- /**
- * @cfg {String} headerMenuOpenCls The CSS class to add to the header cell when its menu is visible. Defaults to 'x-grid3-hd-menu-open'
- */
+
+
headerMenuOpenCls: 'x-grid3-hd-menu-open',
- /**
- * @cfg {String} rowOverCls The CSS class added to each row when it is hovered over. Defaults to 'x-grid3-row-over'
- */
+
rowOverCls: 'x-grid3-row-over',
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 ----------------------------- */
- /**
- * The master template to use when rendering the GridView. Has a default template
- * @property Ext.Template
- * @type masterTpl
- */
+
+
masterTpl: new Ext.Template(
'<div class="x-grid3" hidefocus="true">',
'<div class="x-grid3-viewport">',
@@ -71882,11 +47057,7 @@ viewConfig: {
'</div>'
),
- /**
- * The template to use when rendering headers. Has a default template
- * @property headerTpl
- * @type Ext.Template
- */
+
headerTpl: new Ext.Template(
'<table border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',
'<thead>',
@@ -71895,29 +47066,17 @@ viewConfig: {
'</table>'
),
- /**
- * The template to use when rendering the body. Has a default template
- * @property bodyTpl
- * @type Ext.Template
- */
+
bodyTpl: new Ext.Template('{rows}'),
- /**
- * The template to use to render each cell. Has a default template
- * @property cellTpl
- * @type Ext.Template
- */
+
cellTpl: new Ext.Template(
'<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}" tabIndex="0" {cellAttr}>',
- '<div class="x-grid3-cell-inner x-grid3-col-{id}" unselectable="on" {attr}>{value}</div>',
+ '<div class="x-grid3-cell-inner x-grid3-col-{id} x-unselectable" unselectable="on" {attr}>{value}</div>',
'</td>'
),
- /**
- * @private
- * Provides default templates if they are not given for this particular instance. Most of the templates are defined on
- * the prototype, the ones defined inside this function are done so because they are based on Grid or GridView configuration
- */
+
initTemplates : function() {
var templates = this.templates || {},
template, name,
@@ -71972,10 +47131,7 @@ viewConfig: {
this.colRe = new RegExp('x-grid3-td-([^\\s]+)', '');
},
- /**
- * @private
- * Each GridView has its own private flyweight, accessed through this method
- */
+
fly : function(el) {
if (!this._flyweight) {
this._flyweight = new Ext.Element.Flyweight(document.body);
@@ -71984,15 +47140,12 @@ viewConfig: {
return this._flyweight;
},
- // private
+
getEditorParent : function() {
return this.scroller.dom;
},
- /**
- * @private
- * Finds and stores references to important elements
- */
+
initElements : function() {
var Element = Ext.Element,
el = Ext.get(this.grid.getGridEl().dom.firstChild),
@@ -72008,12 +47161,7 @@ viewConfig: {
scroller.setStyle('overflow-x', 'hidden');
}
- /**
- * <i>Read-only</i>. 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
- */
+
Ext.apply(this, {
el : el,
@@ -72031,14 +47179,14 @@ viewConfig: {
this.focusEl.swallowEvent('click', true);
},
- // private
+
getRows : function() {
return this.hasRows() ? this.mainBody.dom.childNodes : [];
},
- // finder methods, used with delegation
- // private
+
+
findCell : function(el) {
if (!el) {
return false;
@@ -72046,12 +47194,7 @@ viewConfig: {
return this.fly(el).findParent(this.cellSelector, this.cellSelectorDepth);
},
- /**
- * <p>Return the index of the grid column which contains the passed HTMLElement.</p>
- * See also {@link #findRowIndex}
- * @param {HTMLElement} el The target element
- * @return {Number} The column index, or <b>false</b> if the target element is not within a row of this GridView.
- */
+
findCellIndex : function(el, requiredCls) {
var cell = this.findCell(el),
hasCls;
@@ -72065,7 +47208,7 @@ viewConfig: {
return false;
},
- // private
+
getCellIndex : function(el) {
if (el) {
var match = el.className.match(this.colRe);
@@ -72077,22 +47220,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;
@@ -72100,22 +47239,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 <b>false</b> if the target element is not within a row of this GridView.
- */
+
findRowIndex : function(el) {
var row = this.findRow(el);
return row ? row.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;
@@ -72124,39 +47254,26 @@ viewConfig: {
return this.fly(el).findParent(this.rowBodySelector, this.rowBodySelectorDepth);
},
- // getter methods for fetching elements dynamically in the grid
- /**
- * Return the <tt>&lt;div></tt> 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 <tt>&lt;td></tt> 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 Ext.fly(this.getRow(row)).query(this.cellSelector)[col];
},
- /**
- * Return the <tt>&lt;td></tt> 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(rowId, cls) {
var row = this.getRow(rowId);
if (row) {
@@ -72164,7 +47281,7 @@ viewConfig: {
}
},
- // private
+
removeRowClass : function(row, cls) {
var r = this.getRow(row);
if(r){
@@ -72172,13 +47289,13 @@ viewConfig: {
}
},
- // private
+
removeRow : function(row) {
Ext.removeNode(this.getRow(row));
this.syncFocusEl(row);
},
- // private
+
removeRows : function(firstRow, lastRow) {
var bd = this.mainBody.dom,
rowIndex;
@@ -72190,9 +47307,9 @@ viewConfig: {
this.syncFocusEl(firstRow);
},
- /* ----------------------------------- Scrolling functions -------------------------------------------*/
- // private
+
+
getScrollState : function() {
var sb = this.scroller.dom;
@@ -72202,16 +47319,14 @@ viewConfig: {
};
},
- // 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() {
var dom = this.scroller.dom;
@@ -72219,26 +47334,23 @@ viewConfig: {
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 innerHd = this.innerHd,
scrollLeft = this.scroller.dom.scrollLeft;
innerHd.scrollLeft = scrollLeft;
- innerHd.scrollLeft = scrollLeft; // second time for IE (1/2 time first fails, other browsers ignore)
+ innerHd.scrollLeft = scrollLeft;
},
- /**
- * @private
- * Ensures the given column has the given icon class
- */
+
updateSortIcon : function(col, dir) {
var sortClasses = this.sortClasses,
sortClass = sortClasses[dir == "DESC" ? 1 : 0],
@@ -72247,10 +47359,7 @@ viewConfig: {
headers.item(col).addClass(sortClass);
},
- /**
- * @private
- * Updates the size of every column and cell in the grid
- */
+
updateAllColumnWidths : function() {
var totalWidth = this.getTotalWidth(),
colCount = this.cm.getColumnCount(),
@@ -72284,11 +47393,7 @@ viewConfig: {
this.onAllColumnWidthsUpdated(widths, totalWidth);
},
- /**
- * @private
- * Called after a column's width has been updated, this resizes all of the cells for that column in each row
- * @param {Number} column The column index
- */
+
updateColumnWidth : function(column, width) {
var columnWidth = this.getColumnWidth(column),
totalWidth = this.getTotalWidth(),
@@ -72314,12 +47419,7 @@ viewConfig: {
this.onColumnWidthUpdated(column, columnWidth, totalWidth);
},
- /**
- * @private
- * Sets the hidden status of a given column.
- * @param {Number} col The column index
- * @param {Boolean} hidden True to make the column hidden
- */
+
updateColumnHidden : function(col, hidden) {
var totalWidth = this.getTotalWidth(),
display = hidden ? 'none' : '',
@@ -72343,30 +47443,18 @@ viewConfig: {
}
this.onColumnHiddenUpdated(col, hidden, totalWidth);
- delete this.lastViewWidth; //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,
rowTemplate = templates.row,
last = colCount - 1,
tstyle = 'width:' + this.getTotalWidth() + ';',
- // buffers
+
rowBuffer = [],
colBuffer = [],
rowParams = {tstyle: tstyle},
@@ -72376,14 +47464,14 @@ viewConfig: {
column,
record, i, j, rowIndex;
- //build up each row's HTML
+
for (j = 0; j < len; j++) {
record = records[j];
colBuffer = [];
rowIndex = j + startRow;
- //build up each column's HTML
+
for (i = 0; i < colCount; i++) {
column = columns[i];
@@ -72405,7 +47493,7 @@ viewConfig: {
}
alt = [];
- //set up row striping and row dirtiness CSS classes
+
if (stripe && ((rowIndex + 1) % 2 === 0)) {
alt[0] = 'x-grid3-row-alt';
}
@@ -72429,11 +47517,7 @@ viewConfig: {
return rowBuffer.join('');
},
- /**
- * @private
- * Adds CSS classes and rowIndex to each row
- * @param {Number} startRow The row to start from (defaults to 0)
- */
+
processRows : function(startRow, skipStripe) {
if (!this.ds || this.ds.getCount() < 1) {
return;
@@ -72459,7 +47543,7 @@ viewConfig: {
}
}
- // add first/last-row classes
+
if (startRow === 0) {
Ext.fly(rows[0]).addClass(this.firstRowCls);
}
@@ -72467,9 +47551,7 @@ viewConfig: {
Ext.fly(rows[length - 1]).addClass(this.lastRowCls);
},
- /**
- * @private
- */
+
afterRender : function() {
if (!this.ds || !this.cm) {
return;
@@ -72485,17 +47567,13 @@ viewConfig: {
this.grid.fireEvent('viewready', this.grid);
},
- /**
- * @private
- * This is always intended to be called after renderUI. Sets up listeners on the UI elements
- * and sets up options like column menus, moving and resizing.
- */
+
afterRenderUI: function() {
var grid = this.grid;
this.initElements();
- // get mousedowns early
+
Ext.fly(this.innerHd).on('click', this.handleHdDown, this);
this.mainHd.on({
@@ -72530,7 +47608,10 @@ viewConfig: {
beforeshow: this.beforeColMenuShow,
itemclick : this.handleHdMenuClick
});
- this.hmenu.add('-', {
+ this.hmenu.add({
+ itemId: 'sortSep',
+ xtype: 'menuseparator'
+ }, {
itemId:'columns',
hideOnClick: false,
text: this.columnsText,
@@ -72559,11 +47640,7 @@ viewConfig: {
this.updateHeaderSortState();
},
- /**
- * @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.
- */
+
renderUI : function() {
var templates = this.templates;
@@ -72575,7 +47652,7 @@ viewConfig: {
});
},
- // private
+
processEvent : function(name, e) {
var target = e.getTarget(),
grid = this.grid,
@@ -72589,9 +47666,9 @@ viewConfig: {
} else {
row = this.findRowIndex(target);
-// Grid's value-added events must bubble correctly to allow cancelling via returning false: cell->column->row
-// We must allow a return of false at any of these levels to cancel the event processing.
-// Particularly allowing rowmousedown to be cancellable by prior handlers which need to prevent selection.
+
+
+
if (row !== false) {
cell = this.findCellIndex(target);
if (cell !== false) {
@@ -72612,13 +47689,10 @@ viewConfig: {
}
},
- /**
- * @private
- * Sizes the grid's header and body elements
- */
+
layout : function(initial) {
if (!this.mainBody) {
- return; // not rendered
+ return;
}
var grid = this.grid,
@@ -72632,7 +47706,7 @@ viewConfig: {
if (gridWidth < 20 || gridHeight < 20) {
return;
}
-
+
if (grid.autoHeight) {
scrollStyle = scroller.dom.style;
scrollStyle.overflow = 'visible';
@@ -72666,34 +47740,34 @@ viewConfig: {
this.onLayout(gridWidth, scrollHeight);
},
- // 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;
@@ -72702,27 +47776,22 @@ viewConfig: {
this.initUI(grid);
},
- // private
+
getColumnId : function(index){
return this.cm.getColumnId(index);
},
- // private
+
getOffsetWidth : function() {
return (this.cm.getTotalWidth() + this.getScrollOffset()) + 'px';
},
- // private
+
getScrollOffset: function() {
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 colModel = this.cm,
templates = this.templates,
@@ -72739,7 +47808,7 @@ viewConfig: {
} else {
cssCls = i == last ? 'x-grid3-cell-last ' : '';
}
-
+
properties = {
id : colModel.getColumnId(i),
value : colModel.getColumnHeader(i) || '',
@@ -72763,9 +47832,7 @@ viewConfig: {
});
},
- /**
- * @private
- */
+
getColumnTooltip : function(i) {
var tooltip = this.cm.getColumnTooltip(i);
if (tooltip) {
@@ -72779,26 +47846,19 @@ viewConfig: {
return '';
},
- // private
+
beforeUpdate : function() {
this.grid.stopEditing(true);
},
- /**
- * @private
- * Re-renders the headers and ensures they are sized correctly
- */
+
updateHeaders : function() {
this.innerHd.firstChild.innerHTML = this.renderHeaders();
this.updateHeaderWidth(false);
},
- /**
- * @private
- * Ensures that the header is sized to the total width available to it
- * @param {Boolean} updateMain True to update the mainBody's width also (defaults to true)
- */
+
updateHeaderWidth: function(updateMain) {
var innerHdChild = this.innerHd.firstChild,
totalWidth = this.getTotalWidth();
@@ -72811,19 +47871,12 @@ viewConfig: {
}
},
- /**
- * 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));
@@ -72836,10 +47889,7 @@ viewConfig: {
}
},
- /**
- * @private
- * Finds the Elements corresponding to the given row and column indexes
- */
+
resolveCell : function(row, col, hscroll) {
if (!Ext.isNumber(row)) {
row = row.rowIndex;
@@ -72870,11 +47920,7 @@ viewConfig: {
return {row: rowEl, cell: cellEl};
},
- /**
- * @private
- * Returns the XY co-ordinates of a given row/cell resolution (see {@link #resolveCell})
- * @return {Array} X and Y coords
- */
+
getResolvedXY : function(resolved) {
if (!resolved) {
return null;
@@ -72890,10 +47936,7 @@ viewConfig: {
}
},
- /**
- * @private
- * Moves the focus element to the x and y co-ordinates of the given row and column
- */
+
syncFocusEl : function(row, col, hscroll) {
var xy = row;
@@ -72910,9 +47953,7 @@ viewConfig: {
this.focusEl.setXY(xy || this.scroller.getXY());
},
- /**
- * @private
- */
+
ensureVisible : function(row, col, hscroll) {
var resolved = this.resolveCell(row, col, hscroll);
@@ -72962,7 +48003,7 @@ viewConfig: {
return this.getResolvedXY(resolved);
},
- // private
+
insertRows : function(dm, firstRow, lastRow, isUpdate) {
var last = dm.getCount() - 1;
if( !isUpdate && firstRow === 0 && lastRow >= last) {
@@ -72991,17 +48032,14 @@ viewConfig: {
this.processRows(firstRow);
this.fireEvent('rowsinserted', this, firstRow, lastRow);
} 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
- * DEPRECATED - this doesn't appear to be called anywhere in the library, remove in 4.0.
- */
+
deleteRows : function(dm, firstRow, lastRow) {
if (dm.getRowCount() < 1) {
this.refresh();
@@ -73015,13 +48053,7 @@ viewConfig: {
}
},
- /**
- * @private
- * Builds a CSS string for the given column index
- * @param {Number} colIndex The column index
- * @param {Boolean} isHeader True if getting the style for the column's header
- * @return {String} The CSS string
- */
+
getColumnStyle : function(colIndex, isHeader) {
var colModel = this.cm,
colConfig = colModel.config,
@@ -73041,18 +48073,13 @@ viewConfig: {
return style;
},
- /**
- * @private
- * Returns the width of a given column minus its border width
- * @return {Number} The column index
- * @return {String|Number} The width in pixels
- */
+
getColumnWidth : function(column) {
var columnWidth = this.cm.getColumnWidth(column),
borderWidth = this.borderWidth;
if (Ext.isNumber(columnWidth)) {
- if (Ext.isBorderBox || (Ext.isWebKit && !Ext.isSafari2)) {
+ if (Ext.isBorderBox) {
return columnWidth + "px";
} else {
return Math.max(columnWidth - borderWidth, 0) + "px";
@@ -73062,24 +48089,12 @@ viewConfig: {
}
},
- /**
- * @private
- * Returns the total width of all visible columns
- * @return {String}
- */
+
getTotalWidth : function() {
return this.cm.getTotalWidth() + 'px';
},
- /**
- * @private
- * Resizes each column to fit the available grid width.
- * TODO: The second argument isn't even used, remove it in 4.0
- * @param {Boolean} preventRefresh True to prevent resizing of each row to the new column sizes (defaults to false)
- * @param {null} onlyExpand NOT USED, will be removed in 4.0
- * @param {Number} omitColumn The index of a column to leave at its current width. Defaults to undefined
- * @return {Boolean} True if the operation succeeded, false if not or undefined if the grid view is not yet initialized
- */
+
fitColumns : function(preventRefresh, onlyExpand, omitColumn) {
var grid = this.grid,
colModel = this.cm,
@@ -73091,7 +48106,7 @@ viewConfig: {
width = 0,
colWidth, fraction, i;
- // not initialized, so don't screw up the default widths
+
if (gridWidth < 20 || extraWidth === 0) {
return false;
}
@@ -73105,7 +48120,7 @@ viewConfig: {
omitColumn = undefined;
}
- //FIXME: the algorithm used here is odd and potentially confusing. Includes this for loop and the while after it.
+
for (i = 0; i < totalColCount; i++) {
if (!colModel.isFixed(i) && i !== omitColumn) {
colWidth = colModel.getColumnWidth(i);
@@ -73127,7 +48142,7 @@ viewConfig: {
colModel.setColumnWidth(i, Math.max(grid.minColumnWidth, Math.floor(colWidth + colWidth * fraction)), true);
}
- //this has been changed above so remeasure now
+
totalColWidth = colModel.getTotalWidth(false);
if (totalColWidth > gridWidth) {
@@ -73144,12 +48159,7 @@ viewConfig: {
return true;
},
- /**
- * @private
- * Resizes the configured autoExpandColumn to take the available width after the other columns have
- * been accounted for
- * @param {Boolean} preventUpdate True to prevent the resizing of all rows (defaults to false)
- */
+
autoExpand : function(preventUpdate) {
var grid = this.grid,
colModel = this.cm,
@@ -73159,7 +48169,7 @@ viewConfig: {
if (!this.userResized && autoExpandColumn) {
if (gridWidth != totalColumnWidth) {
- //if we are not already using all available width, resize the autoExpandColumn
+
var colIndex = colModel.getIndexById(autoExpandColumn),
currentWidth = colModel.getColumnWidth(colIndex),
desiredWidth = gridWidth - totalColumnWidth + currentWidth,
@@ -73176,19 +48186,12 @@ viewConfig: {
}
},
- /**
- * Returns the total internal width available to the grid, taking the scrollbar into account
- * @return {Number} The total width
- */
+
getGridInnerWidth: function() {
return this.grid.getGridEl().getWidth(true) - this.getScrollOffset();
},
- /**
- * @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() {
var columns = [],
colModel = this.cm,
@@ -73211,12 +48214,7 @@ viewConfig: {
return columns;
},
- /**
- * @private
- * Renders rows between start and end indexes
- * @param {Number} startRow Index of the first row to render
- * @param {Number} endRow Index of the last row to render
- */
+
renderRows : function(startRow, endRow) {
var grid = this.grid,
store = grid.store,
@@ -73237,16 +48235,13 @@ viewConfig: {
return this.doRender(this.getColumnData(), records, store, startRow, colCount, stripe);
},
- // private
+
renderBody : function(){
var markup = this.renderRows() || '&#160;';
return this.templates.body.apply({rows: markup});
},
- /**
- * @private
- * Refreshes a row by re-rendering it. Fires the rowupdated event when done
- */
+
refreshRow: function(record) {
var store = this.ds,
colCount = this.cm.getColumnCount(),
@@ -73267,12 +48262,12 @@ viewConfig: {
rowIndex = store.indexOf(record);
}
- //the record could not be found
+
if (!record || rowIndex < 0) {
return;
}
- //builds each column in this row
+
for (i = 0; i < colCount; i++) {
column = columns[i];
@@ -73289,7 +48284,7 @@ viewConfig: {
attr : "",
cellAttr: ""
};
- // Need to set this after, because we pass meta to the renderer
+
meta.value = column.renderer.call(column.scope, record.data[column.name], meta, record, rowIndex, i, store);
if (Ext.isEmpty(meta.value)) {
@@ -73322,10 +48317,7 @@ viewConfig: {
this.fireEvent('rowupdated', this, rowIndex, 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);
@@ -73342,21 +48334,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('<div class="x-grid-empty">' + this.emptyText + '</div>');
}
},
- /**
- * @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) {
@@ -73376,10 +48361,7 @@ viewConfig: {
}
},
- /**
- * @private
- * Removes any sorting indicator classes from the column headers
- */
+
clearHeaderSortState : function() {
if (!this.sortState) {
return;
@@ -73389,10 +48371,7 @@ viewConfig: {
delete this.sortState;
},
- /**
- * @private
- * Destroys all objects associated with the GridView
- */
+
destroy : function() {
var me = this,
grid = me.grid,
@@ -73450,7 +48429,7 @@ viewConfig: {
delete Ext.dd.DDM.ids[columnDrop.ddGroup];
}
- if (splitZone) { // enableColumnResize
+ if (splitZone) {
splitZone.destroy();
delete splitZone._domRef;
delete Ext.dd.DDM.ids["gridSplitters" + gridEl.id];
@@ -73487,12 +48466,12 @@ viewConfig: {
Ext.EventManager.removeResizeListener(me.onWindowResize, me);
},
- // private
+
onDenyColumnHide : function() {
},
- // private
+
render : function() {
if (this.autoFill) {
var ct = this.grid.ownerCt;
@@ -73515,15 +48494,9 @@ viewConfig: {
this.afterRenderUI();
},
- /* --------------------------------- Model Events and Handlers --------------------------------*/
- /**
- * @private
- * Binds a new Store and ColumnModel to this GridView. Removes any listeners from the old objects (if present)
- * and adds listeners to the new ones
- * @param {Ext.data.Store} newStore The new Store instance
- * @param {Ext.grid.ColumnModel} newColModel The new ColumnModel instance
- */
+
+
initData : function(newStore, newColModel) {
var me = this;
@@ -73581,30 +48554,30 @@ viewConfig: {
me.cm = newColModel;
},
- // private
+
onDataChange : function(){
this.refresh(true);
this.updateHeaderSortState();
this.syncFocusEl(0);
},
- // private
+
onClear : function() {
this.refresh();
this.syncFocusEl(0);
},
- // private
+
onUpdate : function(store, record) {
this.refreshRow(record);
},
- // private
+
onAdd : function(store, records, index) {
this.insertRows(store, index, index + (records.length-1));
},
- // private
+
onRemove : function(store, record, index, isUpdate) {
if (isUpdate !== true) {
this.fireEvent('beforerowremoved', this, index, record);
@@ -73619,10 +48592,7 @@ viewConfig: {
}
},
- /**
- * @private
- * Called when a store is loaded, scrolls to the top row
- */
+
onLoad : function() {
if (Ext.isGecko) {
if (!this.scrollToTopTask) {
@@ -73634,22 +48604,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;
this.refresh(true);
@@ -73659,23 +48629,23 @@ 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 : Ext.emptyFn,
- // private
+
onHeaderClick : function(g, index) {
if (this.headersDisabled || !this.cm.isSortable(index)) {
return;
@@ -73684,10 +48654,7 @@ viewConfig: {
g.store.sort(this.cm.getDataIndex(index));
},
- /**
- * @private
- * Adds the hover class to a row when hovered over
- */
+
onRowOver : function(e, target) {
var row = this.findRowIndex(target);
@@ -73696,10 +48663,7 @@ viewConfig: {
}
},
- /**
- * @private
- * Removes the hover class from a row on mouseout
- */
+
onRowOut : function(e, target) {
var row = this.findRowIndex(target);
@@ -73708,17 +48672,17 @@ viewConfig: {
}
},
- // 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) {
@@ -73726,7 +48690,7 @@ viewConfig: {
}
},
- // private
+
onCellDeselect : function(row, col) {
var cell = this.getCell(row, col);
if (cell) {
@@ -73734,15 +48698,12 @@ viewConfig: {
}
},
- // private
+
handleWheel : function(e) {
e.stopPropagation();
},
- /**
- * @private
- * Called by the SplitDragZone when a drag has been completed. Resizes the columns
- */
+
onColumnSplitterMoved : function(cellIndex, width) {
this.userResized = true;
this.grid.colModel.setColumnWidth(cellIndex, width, true);
@@ -73758,11 +48719,7 @@ viewConfig: {
this.grid.fireEvent('columnresize', cellIndex, width);
},
- /**
- * @private
- * Click handler for the shared column dropdown menu, called on beforeshow. Builds the menu
- * which displays the list of columns for the user to show or hide.
- */
+
beforeColMenuShow : function() {
var colModel = this.cm,
colCount = colModel.getColumnCount(),
@@ -73784,11 +48741,7 @@ viewConfig: {
}
},
- /**
- * @private
- * Attached as the 'itemclick' handler to the header menu and the column show/hide submenu (if available).
- * Performs sorting if the sorter buttons were clicked, otherwise hides/shows the column that was clicked.
- */
+
handleHdMenuClick : function(item) {
var store = this.ds,
dataIndex = this.cm.getDataIndex(this.hdCtxIndex);
@@ -73806,12 +48759,7 @@ viewConfig: {
return true;
},
- /**
- * Called by handleHdMenuClick if any button except a sort ASC/DESC button was clicked. The default implementation provides
- * the column hide/show functionality based on the check state of the menu item. A different implementation can be provided
- * if needed.
- * @param {Ext.menu.BaseItem} item The menu item that was clicked
- */
+
handleHdMenuClickDefault: function(item) {
var colModel = this.cm,
itemId = item.getItemId(),
@@ -73826,10 +48774,7 @@ viewConfig: {
}
},
- /**
- * @private
- * Called when a header cell is clicked - shows the menu if the click happened over a trigger button
- */
+
handleHdDown : function(e, target) {
if (Ext.fly(target).hasClass('x-grid3-hd-btn')) {
e.stopEvent();
@@ -73840,13 +48785,23 @@ viewConfig: {
sortable = colModel.isSortable(index),
menu = this.hmenu,
menuItems = menu.items,
- menuCls = this.headerMenuOpenCls;
+ menuCls = this.headerMenuOpenCls,
+ sep;
this.hdCtxIndex = index;
Ext.fly(header).addClass(menuCls);
- menuItems.get('asc').setDisabled(!sortable);
- menuItems.get('desc').setDisabled(!sortable);
+ if (this.hideSortIcons) {
+ menuItems.get('asc').setVisible(sortable);
+ menuItems.get('desc').setVisible(sortable);
+ sep = menuItems.get('sortSep');
+ if (sep) {
+ sep.setVisible(sortable);
+ }
+ } else {
+ menuItems.get('asc').setDisabled(!sortable);
+ menuItems.get('desc').setDisabled(!sortable);
+ }
menu.on('hide', function() {
Ext.fly(header).removeClass(menuCls);
@@ -73856,12 +48811,7 @@ viewConfig: {
}
},
- /**
- * @private
- * Attached to the headers' mousemove event. This figures out the CSS cursor to use based on where the mouse is currently
- * pointed. If the mouse is currently hovered over the extreme left or extreme right of any header cell and the cell next
- * to it is resizable it is given the resize cursor, otherwise the cursor is set to an empty string.
- */
+
handleHdMove : function(e) {
var header = this.findHeaderCell(this.activeHdRef);
@@ -73882,7 +48832,7 @@ viewConfig: {
inRightResizer = activeRegion.right - pageX <= (!this.activeHdBtn ? handleWidth : 2);
if (inLeftResizer && previousResizable) {
- cursor = Ext.isAir ? 'move' : Ext.isWebKit ? 'e-resize' : 'col-resize'; // col-resize not always supported
+ cursor = Ext.isAir ? 'move' : Ext.isWebKit ? 'e-resize' : 'col-resize';
} else if (inRightResizer && currentResizable) {
cursor = Ext.isAir ? 'move' : Ext.isWebKit ? 'w-resize' : 'col-resize';
}
@@ -73892,12 +48842,7 @@ viewConfig: {
}
},
- /**
- * @private
- * Returns the index of the nearest currently visible header to the left of the given index.
- * @param {Number} index The header index
- * @return {Number/undefined} The index of the nearest visible header
- */
+
getPreviousVisible: function(index) {
while (index > 0) {
if (!this.cm.isHidden(index - 1)) {
@@ -73908,11 +48853,7 @@ viewConfig: {
return undefined;
},
- /**
- * @private
- * Tied to the header element's mouseover event - adds the over class to the header cell if the menu is not disabled
- * for that cell
- */
+
handleHdOver : function(e, target) {
var header = this.findHeaderCell(target);
@@ -73934,59 +48875,42 @@ viewConfig: {
}
},
- /**
- * @private
- * Tied to the header element's mouseout event. Removes the hover class from the header cell
- */
+
handleHdOut : function(e, target) {
var header = this.findHeaderCell(target);
- if (header && (!Ext.isIE || !e.within(header, true))) {
+ if (header && (!Ext.isIE9m || !e.within(header, true))) {
this.activeHdRef = null;
this.fly(header).removeClass('x-grid3-hd-over');
header.style.cursor = '';
}
},
- /**
- * @private
- * Used by {@link #handleHdOver} to determine whether or not to show the header menu class on cell hover
- * @param {Number} cellIndex The header cell index
- * @param {Ext.Element} el The cell element currently being hovered over
- */
+
isMenuDisabled: function(cellIndex, el) {
return this.cm.isMenuDisabled(cellIndex);
},
- /**
- * @private
- * Returns true if there are any rows rendered into the GridView
- * @return {Boolean} True if any rows have been rendered
- */
+
hasRows : function() {
var fc = this.mainBody.dom.firstChild;
return fc && fc.nodeType == 1 && fc.className != 'x-grid-empty';
},
- /**
- * @private
- */
+
isHideableColumn : function(c) {
return !c.hidden;
},
- /**
- * @private
- * DEPRECATED - will be removed in Ext JS 5.0
- */
+
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){
@@ -74082,115 +49006,28 @@ Ext.grid.GridView.SplitDragZone = Ext.extend(Ext.dd.DDProxy, {
this.setDelta(0,0);
}
});
-/**
- * @class Ext.grid.PivotGridView
- * @extends Ext.grid.GridView
- * Specialised GridView for rendering Pivot Grid components. Config can be passed to the PivotGridView via the PivotGrid constructor's
- * viewConfig option:
-<pre><code>
-new Ext.grid.PivotGrid({
- viewConfig: {
- title: 'My Pivot Grid',
- getCellCls: function(value) {
- return value > 10 'red' : 'green';
- }
- }
-});
-</code></pre>
- * <p>Currently {@link #title} and {@link #getCellCls} are the only configuration options accepted by PivotGridView. All other
- * interaction is performed via the {@link Ext.grid.PivotGrid PivotGrid} class.</p>
- */
+
Ext.grid.PivotGridView = Ext.extend(Ext.grid.GridView, {
- /**
- * The CSS class added to all group header cells. Defaults to 'grid-hd-group-cell'
- * @property colHeaderCellCls
- * @type String
- */
+
colHeaderCellCls: 'grid-hd-group-cell',
- /**
- * @cfg {String} title Optional title to be placed in the top left corner of the PivotGrid. Defaults to an empty string.
- */
+
title: '',
- /**
- * @cfg {Function} getCellCls Optional function which should return a CSS class name for each cell value. This is useful when
- * color coding cells based on their value. Defaults to undefined.
- */
- /**
- * Returns the headers to be rendered at the top of the grid. Should be a 2-dimensional array, where each item specifies the number
- * of columns it groups (column in this case refers to normal grid columns). In the example below we have 5 city groups, which are
- * each part of a continent supergroup. The colspan for each city group refers to the number of normal grid columns that group spans,
- * so in this case the grid would be expected to have a total of 12 columns:
-<pre><code>
-[
- {
- items: [
- {header: 'England', colspan: 5},
- {header: 'USA', colspan: 3}
- ]
- },
- {
- items: [
- {header: 'London', colspan: 2},
- {header: 'Cambridge', colspan: 3},
- {header: 'Palo Alto', colspan: 3}
- ]
- }
-]
-</code></pre>
- * In the example above we have cities nested under countries. The nesting could be deeper if desired - e.g. Continent -> Country ->
- * State -> City, or any other structure. The only constaint is that the same depth must be used throughout the structure.
- * @return {Array} A tree structure containing the headers to be rendered. Must include the colspan property at each level, which should
- * be the sum of all child nodes beneath this node.
- */
+
+
getColumnHeaders: function() {
return this.grid.topAxis.buildHeaders();;
},
- /**
- * Returns the headers to be rendered on the left of the grid. Should be a 2-dimensional array, where each item specifies the number
- * of rows it groups. In the example below we have 5 city groups, which are each part of a continent supergroup. The rowspan for each
- * city group refers to the number of normal grid columns that group spans, so in this case the grid would be expected to have a
- * total of 12 rows:
-<pre><code>
-[
- {
- width: 90,
- items: [
- {header: 'England', rowspan: 5},
- {header: 'USA', rowspan: 3}
- ]
- },
- {
- width: 50,
- items: [
- {header: 'London', rowspan: 2},
- {header: 'Cambridge', rowspan: 3},
- {header: 'Palo Alto', rowspan: 3}
- ]
- }
-]
-</code></pre>
- * In the example above we have cities nested under countries. The nesting could be deeper if desired - e.g. Continent -> Country ->
- * State -> City, or any other structure. The only constaint is that the same depth must be used throughout the structure.
- * @return {Array} A tree structure containing the headers to be rendered. Must include the colspan property at each level, which should
- * be the sum of all child nodes beneath this node.
- * Each group may specify the width it should be rendered with.
- * @return {Array} The row groups
- */
+
getRowHeaders: function() {
return this.grid.leftAxis.buildHeaders();
},
- /**
- * @private
- * Renders rows between start and end indexes
- * @param {Number} startRow Index of the first row to render
- * @param {Number} endRow Index of the last row to render
- */
+
renderRows : function(startRow, endRow) {
var grid = this.grid,
rows = grid.extractData(),
@@ -74215,7 +49052,7 @@ Ext.grid.PivotGridView = Ext.extend(Ext.grid.GridView, {
colCount = row.length;
colBuffer = [];
- //build up each column's HTML
+
for (var j = 0; j < colCount; j++) {
meta.id = i + '-' + j;
@@ -74249,11 +49086,7 @@ Ext.grid.PivotGridView = Ext.extend(Ext.grid.GridView, {
return rowBuffer.join("");
},
- /**
- * The master template to use when rendering the GridView. Has a default template
- * @property Ext.Template
- * @type masterTpl
- */
+
masterTpl: new Ext.Template(
'<div class="x-grid3 x-pivotgrid" hidefocus="true">',
'<div class="x-grid3-viewport">',
@@ -74275,10 +49108,7 @@ Ext.grid.PivotGridView = Ext.extend(Ext.grid.GridView, {
'</div>'
),
- /**
- * @private
- * Adds a gcell template to the internal templates object. This is used to render the headers in a multi-level column header.
- */
+
initTemplates: function() {
Ext.grid.PivotGridView.superclass.initTemplates.apply(this, arguments);
@@ -74286,7 +49116,7 @@ Ext.grid.PivotGridView = Ext.extend(Ext.grid.GridView, {
if (!templates.gcell) {
templates.gcell = new Ext.XTemplate(
'<td class="x-grid3-hd x-grid3-gcell x-grid3-td-{id} ux-grid-hd-group-row-{row} ' + this.colHeaderCellCls + '" style="{style}">',
- '<div {tooltip} class="x-grid3-hd-inner x-grid3-hd-{id}" unselectable="on" style="{istyle}">',
+ '<div {tooltip} class="x-grid3-hd-inner x-grid3-hd-{id} x-unselectable" unselectable="on" style="{istyle}">',
this.grid.enableHdMenu ? '<a class="x-grid3-hd-btn" href="#"></a>' : '', '{value}',
'</div>',
'</td>'
@@ -74297,42 +49127,25 @@ Ext.grid.PivotGridView = Ext.extend(Ext.grid.GridView, {
this.hrowRe = new RegExp("ux-grid-hd-group-row-(\\d+)", "");
},
- /**
- * @private
- * Sets up the reference to the row headers element
- */
+
initElements: function() {
Ext.grid.PivotGridView.superclass.initElements.apply(this, arguments);
- /**
- * @property rowHeadersEl
- * @type Ext.Element
- * The element containing all row headers
- */
+
this.rowHeadersEl = new Ext.Element(this.scroller.child('div.x-grid3-row-headers'));
- /**
- * @property headerTitleEl
- * @type Ext.Element
- * The element that contains the optional title (top left section of the pivot grid)
- */
+
this.headerTitleEl = new Ext.Element(this.mainHd.child('div.x-grid3-header-title'));
},
- /**
- * @private
- * Takes row headers into account when calculating total available width
- */
+
getGridInnerWidth: function() {
var previousWidth = Ext.grid.PivotGridView.superclass.getGridInnerWidth.apply(this, arguments);
return previousWidth - this.getTotalRowHeaderWidth();
},
- /**
- * Returns the total width of all row headers as specified by {@link #getRowHeaders}
- * @return {Number} The total width
- */
+
getTotalRowHeaderWidth: function() {
var headers = this.getRowHeaders(),
length = headers.length,
@@ -74346,20 +49159,12 @@ Ext.grid.PivotGridView = Ext.extend(Ext.grid.GridView, {
return total;
},
- /**
- * @private
- * Returns the total height of all column headers
- * @return {Number} The total height
- */
+
getTotalColumnHeaderHeight: function() {
return this.getColumnHeaders().length * 21;
},
- /**
- * Inherit docs
- * @private
- * @param {HTMLElement} el
- */
+
getCellIndex : function(el) {
if (el) {
var match = el.className.match(this.colRe),
@@ -74373,10 +49178,7 @@ Ext.grid.PivotGridView = Ext.extend(Ext.grid.GridView, {
},
- /**
- * @private
- * Slight specialisation of the GridView renderUI - just adds the row headers
- */
+
renderUI : function() {
var templates = this.templates,
innerWidth = this.getGridInnerWidth();
@@ -74388,10 +49190,7 @@ Ext.grid.PivotGridView = Ext.extend(Ext.grid.GridView, {
});
},
- /**
- * @private
- * Make sure that the headers and rows are all sized correctly during layout
- */
+
onLayout: function(width, height) {
Ext.grid.PivotGridView.superclass.onLayout.apply(this, arguments);
@@ -74401,10 +49200,7 @@ Ext.grid.PivotGridView = Ext.extend(Ext.grid.GridView, {
this.resizeAllRows(width);
},
- /**
- * 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);
@@ -74421,24 +49217,13 @@ Ext.grid.PivotGridView = Ext.extend(Ext.grid.GridView, {
this.fireEvent('refresh', this);
},
- /**
- * @private
- * Bypasses GridView's renderHeaders as they are taken care of separately by the PivotAxis instances
- */
+
renderHeaders: Ext.emptyFn,
- /**
- * @private
- * Taken care of by PivotAxis
- */
+
fitColumns: Ext.emptyFn,
- /**
- * @private
- * Called on layout, ensures that the width of each column header is correct. Omitting this can lead to faulty
- * layouts when nested in a container.
- * @param {Number} width The new width
- */
+
resizeColumnHeaders: function(width) {
var topAxis = this.grid.topAxis;
@@ -74447,10 +49232,7 @@ Ext.grid.PivotGridView = Ext.extend(Ext.grid.GridView, {
}
},
- /**
- * @private
- * Sets the row header div to the correct width. Should be called after rendering and reconfiguration of headers
- */
+
resizeRowHeaders: function() {
var rowHeaderWidth = this.getTotalRowHeaderWidth(),
marginStyle = String.format("margin-left: {0}px;", rowHeaderWidth);
@@ -74463,11 +49245,7 @@ Ext.grid.PivotGridView = Ext.extend(Ext.grid.GridView, {
this.headerTitleEl.setHeight(this.getTotalColumnHeaderHeight());
},
- /**
- * @private
- * Resizes all rendered rows to the given width. Usually called by onLayout
- * @param {Number} width The new width
- */
+
resizeAllRows: function(width) {
var rows = this.getRows(),
length = rows.length,
@@ -74479,19 +49257,13 @@ Ext.grid.PivotGridView = Ext.extend(Ext.grid.GridView, {
}
},
- /**
- * @private
- * Updates the Row Headers, deferring the updating of Column Headers to GridView
- */
+
updateHeaders: function() {
this.renderGroupRowHeaders();
this.renderGroupColumnHeaders();
},
- /**
- * @private
- * Renders all row header groups at all levels based on the structure fetched from {@link #getGroupRowHeaders}
- */
+
renderGroupRowHeaders: function() {
var leftAxis = this.grid.leftAxis;
@@ -74502,18 +49274,12 @@ Ext.grid.PivotGridView = Ext.extend(Ext.grid.GridView, {
this.setTitle(this.title);
},
- /**
- * Sets the title text in the top left segment of the PivotGridView
- * @param {String} title The title
- */
+
setTitle: function(title) {
this.headerTitleEl.child('span').dom.innerHTML = title;
},
- /**
- * @private
- * Renders all column header groups at all levels based on the structure fetched from {@link #getColumnHeaders}
- */
+
renderGroupColumnHeaders: function() {
var topAxis = this.grid.topAxis;
@@ -74521,78 +49287,27 @@ Ext.grid.PivotGridView = Ext.extend(Ext.grid.GridView, {
topAxis.render(this.innerHd.firstChild);
},
- /**
- * @private
- * Overridden to test whether the user is hovering over a group cell, in which case we don't show the menu
- */
+
isMenuDisabled: function(cellIndex, el) {
return true;
}
-});/**
- * @class Ext.grid.PivotAxis
- * @extends Ext.Component
- * <p>PivotAxis is a class that supports a {@link Ext.grid.PivotGrid}. Each PivotGrid contains two PivotAxis instances - the left
- * axis and the top axis. Each PivotAxis defines an ordered set of dimensions, each of which should correspond to a field in a
- * Store's Record (see {@link Ext.grid.PivotGrid} documentation for further explanation).</p>
- * <p>Developers should have little interaction with the PivotAxis instances directly as most of their management is performed by
- * the PivotGrid. An exception is the dynamic reconfiguration of axes at run time - to achieve this we use PivotAxis's
- * {@link #setDimensions} function and refresh the grid:</p>
-<pre><code>
-var pivotGrid = new Ext.grid.PivotGrid({
- //some PivotGrid config here
});
-
-//change the left axis dimensions
-pivotGrid.leftAxis.setDimensions([
- {
- dataIndex: 'person',
- direction: 'DESC',
- width : 100
- },
- {
- dataIndex: 'product',
- direction: 'ASC',
- width : 80
- }
-]);
-
-pivotGrid.view.refresh(true);
-</code></pre>
- * This clears the previous dimensions on the axis and redraws the grid with the new dimensions.
- */
Ext.grid.PivotAxis = Ext.extend(Ext.Component, {
- /**
- * @cfg {String} orientation One of 'vertical' or 'horizontal'. Defaults to horizontal
- */
+
orientation: 'horizontal',
- /**
- * @cfg {Number} defaultHeaderWidth The width to render each row header that does not have a width specified via
- {@link #getRowGroupHeaders}. Defaults to 80.
- */
+
defaultHeaderWidth: 80,
- /**
- * @private
- * @cfg {Number} paddingWidth The amount of padding used by each cell.
- * TODO: From 4.x onwards this can be removed as it won't be needed. For now it is used to account for the differences between
- * the content box and border box measurement models
- */
+
paddingWidth: 7,
- /**
- * Updates the dimensions used by this axis
- * @param {Array} dimensions The new dimensions
- */
+
setDimensions: function(dimensions) {
this.dimensions = dimensions;
},
- /**
- * @private
- * Builds the html table that contains the dimensions for this axis. This branches internally between vertical
- * and horizontal orientations because the table structure is slightly different in each case
- */
+
onRender: function(ct, position) {
var rows = this.orientation == 'horizontal'
? this.renderHorizontalRows()
@@ -74601,11 +49316,7 @@ Ext.grid.PivotAxis = Ext.extend(Ext.Component, {
this.el = Ext.DomHelper.overwrite(ct.dom, {tag: 'table', cn: rows}, true);
},
- /**
- * @private
- * Specialised renderer for horizontal oriented axes
- * @return {Object} The HTML Domspec for a horizontal oriented axis
- */
+
renderHorizontalRows: function() {
var headers = this.buildHeaders(),
rowCount = headers.length,
@@ -74634,11 +49345,7 @@ Ext.grid.PivotAxis = Ext.extend(Ext.Component, {
return rows;
},
- /**
- * @private
- * Specialised renderer for vertical oriented axes
- * @return {Object} The HTML Domspec for a vertical oriented axis
- */
+
renderVerticalRows: function() {
var headers = this.buildHeaders(),
colCount = headers.length,
@@ -74675,13 +49382,7 @@ Ext.grid.PivotAxis = Ext.extend(Ext.Component, {
return rows;
},
- /**
- * @private
- * Returns the set of all unique tuples based on the bound store and dimension definitions.
- * Internally we construct a new, temporary store to make use of the multi-sort capabilities of Store. In
- * 4.x this functionality should have been moved to MixedCollection so this step should not be needed.
- * @return {Array} All unique tuples
- */
+
getTuples: function() {
var newStore = new Ext.data.Store({});
@@ -74729,16 +49430,14 @@ Ext.grid.PivotAxis = Ext.extend(Ext.Component, {
return tuples;
},
- /**
- * @private
- */
+
getRecordInfo: function(record) {
var dimensions = this.dimensions,
length = dimensions.length,
data = {},
dimension, dataIndex, i;
- //get an object containing just the data we are interested in based on the configured dimensions
+
for (i = 0; i < length; i++) {
dimension = dimensions[i];
dataIndex = dimension.dataIndex;
@@ -74746,8 +49445,8 @@ Ext.grid.PivotAxis = Ext.extend(Ext.Component, {
data[dataIndex] = record.get(dataIndex);
}
- //creates a specialised matcher function for a given tuple. The returned function will return
- //true if the record passed to it matches the dataIndex values of each dimension in this axis
+
+
var createMatcherFunction = function(data) {
return function(record) {
for (var dataIndex in data) {
@@ -74766,14 +49465,7 @@ Ext.grid.PivotAxis = Ext.extend(Ext.Component, {
};
},
- /**
- * @private
- * Uses the calculated set of tuples to build an array of headers that can be rendered into a table using rowspan or
- * colspan. Basically this takes the set of tuples and spans any cells that run into one another, so if we had dimensions
- * of Person and Product and several tuples containing different Products for the same Person, those Products would be
- * spanned.
- * @return {Array} The headers
- */
+
buildHeaders: function() {
var tuples = this.getTuples(),
rowCount = tuples.length,
@@ -74794,12 +49486,7 @@ Ext.grid.PivotAxis = Ext.extend(Ext.Component, {
isLast = j == (rowCount - 1);
currentHeader = tuple.data[dimension.dataIndex];
- /*
- * 'changed' indicates that we need to create a new cell. This should be true whenever the cell
- * above (previousHeader) is different from this cell, or when the cell on the previous dimension
- * changed (e.g. if the current dimension is Product and the previous was Person, we need to start
- * a new cell if Product is the same but Person changed, so we check the previous dimension and tuple)
- */
+
changed = previousHeader != undefined && previousHeader != currentHeader;
if (i > 0 && j > 0) {
changed = changed || tuple.data[dimensions[i-1].dataIndex] != tuples[j-1].data[dimensions[i-1].dataIndex];
@@ -74842,11 +49529,11 @@ Ext.grid.PivotAxis = Ext.extend(Ext.Component, {
return headers;
}
});
-// 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();
@@ -74858,7 +49545,7 @@ Ext.grid.HeaderDragZone = Ext.extend(Ext.dd.DragZone, {
}
this.scroll = false;
},
-
+
getDragData : function(e){
var t = Ext.lib.Event.getTarget(e),
h = this.view.findHeaderCell(t);
@@ -74869,7 +49556,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);
@@ -74896,16 +49583,16 @@ 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,
-
+
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:"&#160;"
}, true);
@@ -74917,8 +49604,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);
},
@@ -75029,23 +49716,23 @@ Ext.grid.HeaderDropZone = Ext.extend(Ext.dd.DropZone, {
});
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();
@@ -75097,16 +49784,7 @@ Ext.grid.SplitDragZone = Ext.extend(Ext.dd.DDProxy, {
autoOffset : function(){
this.setDelta(0,0);
}
-});/**
- * @class Ext.grid.GridDragZone
- * @extends Ext.dd.DragZone
- * <p>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.</p>
- * <p>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}</p> 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);
@@ -75114,71 +49792,78 @@ Ext.grid.GridDragZone = function(grid, config){
this.grid = grid;
this.ddel = document.createElement('div');
this.ddel.className = 'x-grid-dd-wrap';
+
+ this.preventDefault = true;
};
Ext.extend(Ext.grid.GridDragZone, Ext.dd.DragZone, {
ddGroup : "GridDD",
- /**
- * <p>The provided implementation of the getDragData method which collects the data to be dragged from the GridPanel on mousedown.</p>
- * <p>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}.</p>
- * <p>The data object contains the following properties:<ul>
- * <li><b>grid</b> : Ext.Grid.GridPanel<div class="sub-desc">The GridPanel from which the data is being dragged.</div></li>
- * <li><b>ddel</b> : htmlElement<div class="sub-desc">An htmlElement which provides the "picture" of the data being dragged.</div></li>
- * <li><b>rowIndex</b> : Number<div class="sub-desc">The index of the row which receieved the mousedown gesture which triggered the drag.</div></li>
- * <li><b>selections</b> : Array<div class="sub-desc">An Array of the selected Records which are being dragged from the GridPanel.</div></li>
- * </ul></p>
- */
+
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);
+ var t = Ext.lib.Event.getTarget(e),
+ sm,
+ rowIndex = this.view.findRowIndex(t),
+ cellIndex,
+ selectedCell,
+ selection;
+
+ if (rowIndex !== false){
+ sm = this.grid.selModel;
+
+
+
+ if (sm.getSelectedCell) {
+ cellIndex = this.view.findCellIndex(t);
+ selectedCell = sm.getSelectedCell();
+ if (!selectedCell || selectedCell[0] !== rowIndex || selectedCell[1] !== cellIndex) {
+ sm.handleMouseDown(this.grid, rowIndex, cellIndex, e);
+ }
+ if (this.grid.dragCell) {
+
+ selection = sm.getSelectedCell();
+ if (!this.grid.hasOwnProperty('ddText')) {
+ this.grid.ddText = '{0} selected cell{1}';
+ }
+ } else {
+
+ selection = [this.grid.store.getAt(rowIndex)];
+ }
+ } else {
+ if(!sm.isSelected(rowIndex) || e.hasModifier()){
+ sm.handleMouseDown(this.grid, rowIndex, e);
+ }
+ selection = sm.getSelections();
}
- return {grid: this.grid, ddel: this.ddel, rowIndex: rowIndex, selections:sm.getSelections()};
+ return {grid: this.grid, ddel: this.ddel, rowIndex: rowIndex, selections: selection};
}
return false;
},
- /**
- * <p>The provided implementation of the onInitDrag method. Sets the <tt>innerHTML</tt> of the drag proxy which provides the "picture"
- * of the data being dragged.</p>
- * <p>The <tt>innerHTML</tt> data is found by calling the owning GridPanel's {@link Ext.grid.GridPanel#getDragDropText getDragDropText}.</p>
- */
+
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;
},
- /**
- * <p>An empty implementation. Implement this to provide coordinates for the drag proxy to slide back to after an invalid drop.</p>
- * <p>Called before a repair of an invalid drop to get the XY to animate to.</p>
- * @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();
},
@@ -75186,125 +49871,20 @@ Ext.extend(Ext.grid.GridDragZone, Ext.dd.DragZone, {
}
});
-/**
- * @class Ext.grid.ColumnModel
- * @extends Ext.util.Observable
- * <p>After the data has been read into the client side cache (<b>{@link Ext.data.Store Store}</b>),
- * 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}.</p>
- * <p>Data is mapped into the store's records and then indexed into the ColumnModel using the
- * <tt>{@link Ext.grid.Column#dataIndex dataIndex}</tt>:</p>
- * <pre><code>
-{data source} == mapping ==> {data store} == <b><tt>{@link Ext.grid.Column#dataIndex dataIndex}</tt></b> ==> {ColumnModel}
- * </code></pre>
- * <p>Each {@link Ext.grid.Column Column} in the grid's ColumnModel is configured with a
- * <tt>{@link Ext.grid.Column#dataIndex dataIndex}</tt> to specify how the data within
- * each record in the store is indexed into the ColumnModel.</p>
- * <p>There are two ways to initialize the ColumnModel class:</p>
- * <p><u>Initialization Method 1: an Array</u></p>
-<pre><code>
- 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}
- ]);
- </code></pre>
- * <p>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
- * <tt>{@link Ext.grid.Column#hidden hidden}</tt></b> config property (and then shown using the column
- * header menu). Fields that are not included in the ColumnModel will not be displayable at all.</p>
- * <p>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
- * <b><tt>{@link Ext.grid.Column#dataIndex dataIndex}</tt></b>. If the
- * <b><tt>{@link Ext.grid.Column#dataIndex dataIndex}</tt></b> is not explicitly defined (as shown in the
- * example above) it will use the column configuration's index in the Array as the index.</p>
- * <p>See <b><tt>{@link Ext.grid.Column}</tt></b> for additional configuration options for each column.</p>
- * <p><u>Initialization Method 2: an Object</u></p>
- * <p>In order to use configuration options from <tt>Ext.grid.ColumnModel</tt>, an Object may be used to
- * initialize the ColumnModel. The column configuration Array will be specified in the <tt><b>{@link #columns}</b></tt>
- * config property. The <tt><b>{@link #defaults}</b></tt> config property can be used to apply defaults
- * for all columns, e.g.:</p><pre><code>
- 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);
- }
- }
-});
- </code></pre>
- * <p>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 <b><tt>{@link Ext.grid.Column#id id}</tt></b> config
- * option. This column could be styled by including the following css:</p><pre><code>
- //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;
-}
- </code></pre>
- * Note that the "Company Name" column could be specified as the
- * <b><tt>{@link Ext.grid.GridPanel}.{@link Ext.grid.GridPanel#autoExpandColumn autoExpandColumn}</tt></b>.
- * @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 <tt>{@link #width}</tt>
- * specified (defaults to <tt>100</tt>). This property shall preferably be configured through the
- * <tt><b>{@link #defaults}</b></tt> config property.
- */
+
defaultWidth: 100,
- /**
- * @cfg {Boolean} defaultSortable (optional) Default sortable of columns which have no
- * sortable specified (defaults to <tt>false</tt>). This property shall preferably be configured
- * through the <tt><b>{@link #defaults}</b></tt> config property.
- */
+
defaultSortable: false,
- /**
- * @cfg {Array} columns An Array of object literals. The config options defined by
- * <b>{@link Ext.grid.Column}</b> 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 <tt><b>{@link #columns}</b></tt>. Configuration options specified with
- * individual {@link Ext.grid.Column column} configs will supersede these <tt><b>{@link #defaults}</b></tt>.
- */
+
+
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);
@@ -75313,61 +49893,26 @@ Ext.grid.ColumnModel = Ext.extend(Ext.util.Observable, {
}
this.addEvents(
- /**
- * @event widthchange
- * Fires when the width of a column is programmaticially changed using
- * <code>{@link #setColumnWidth}</code>.
- * Note internal resizing suppresses the event from firing. See also
- * {@link Ext.grid.GridPanel}.<code>{@link #columnresize}</code>.
- * @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;
},
@@ -75376,33 +49921,24 @@ Ext.grid.ColumnModel = Ext.extend(Ext.util.Observable, {
return this.config[index];
},
- /**
- * <p>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
- * <a href="#Ext.grid.ColumnModel-configs">Config Options</a>.</p>
- * <p>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.</p>
- * @param {Array} config Array of Column definition objects.
- * @param {Boolean} initial Specify <tt>true</tt> to bypass cleanup which deletes the <tt>totalWidth</tt>
- * 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
@@ -75414,7 +49950,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;
}
@@ -75433,20 +49969,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) {
@@ -75456,11 +49984,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 config = this.config,
c = config[oldIndex];
@@ -75471,11 +49995,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) {
var length = this.config.length,
c = 0,
@@ -75494,21 +50014,7 @@ Ext.grid.ColumnModel = Ext.extend(Ext.util.Observable, {
return length;
},
- /**
- * Returns the column configs that return true by the passed function that is called
- * with (columnConfig, index)
-<pre><code>
-// returns an array of column config objects for all hidden columns
-var columns = grid.getColumnModel().getColumnsBy(function(c){
- return c.hidden;
-});
-</code></pre>
- * @param {Function} fn A function which, when passed a {@link Ext.grid.Column Column} object, must
- * return <code>true</code> if the column is to be included in the returned Array.
- * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function
- * is executed. Defaults to this ColumnModel.
- * @return {Array} result
- */
+
getColumnsBy : function(fn, scope) {
var config = this.config,
length = config.length,
@@ -75526,29 +50032,17 @@ var columns = grid.getColumnModel().getColumnsBy(function(c){
return result;
},
- /**
- * 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) {
return this.config[col].renderer || Ext.grid.ColumnModel.defaultRenderer;
},
@@ -75557,32 +50051,12 @@ 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:<ul>
- * <li><b>value</b> : Object<p class="sub-desc">The data value for the cell.</p></li>
- * <li><b>metadata</b> : Object<p class="sub-desc">An object in which you may set the following attributes:<ul>
- * <li><b>css</b> : String<p class="sub-desc">A CSS class name to add to the cell's TD element.</p></li>
- * <li><b>attr</b> : String<p class="sub-desc">An HTML attribute definition string to apply to the data container element <i>within</i> the table cell
- * (e.g. 'style="color:red;"').</p></li></ul></p></li>
- * <li><b>record</b> : Ext.data.record<p class="sub-desc">The {@link Ext.data.Record} from which the data was extracted.</p></li>
- * <li><b>rowIndex</b> : Number<p class="sub-desc">Row index</p></li>
- * <li><b>colIndex</b> : Number<p class="sub-desc">Column index</p></li>
- * <li><b>store</b> : Ext.data.Store<p class="sub-desc">The {@link Ext.data.Store} object from which the Record was extracted.</p></li></ul>
- */
+
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) {
var width = this.config[col].width;
if(typeof width != 'number'){
@@ -75591,13 +50065,7 @@ var columns = grid.getColumnModel().getColumnsBy(function(c){
return 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 <code>{@link #widthchange}</code>
- * event. Defaults to false.
- */
+
setColumnWidth : function(col, width, suppressEvent) {
this.config[col].width = width;
this.totalWidth = null;
@@ -75607,11 +50075,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;
@@ -75624,69 +50088,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.
-<pre><code>
-// Get field name for the column
-var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
-</code></pre>
- * @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++){
@@ -75697,94 +50129,41 @@ var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
return -1;
},
- /**
- * Returns true if the cell is editable.
-<pre><code>
-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,
- ...
-});
-</code></pre>
- * @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 <tt>true</tt> if the column is <code>{@link Ext.grid.Column#hidden hidden}</code>,
- * <tt>false</tt> 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 <tt>true</tt> if the column is <code>{@link Ext.grid.Column#fixed fixed}</code>,
- * <tt>false</tt> 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.
-<pre><code>
-myGrid.getColumnModel().setHidden(0, true); // hide column 0 (0 = the first column).
-</code></pre>
- * @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){
@@ -75794,66 +50173,47 @@ 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. Destroys and dereferences all Columns.
- */
+
destroy : function() {
var length = this.config.length,
i = 0;
for (; i < length; i++){
- this.config[i].destroy(); // Column's destroy encapsulates all cleanup.
+ this.config[i].destroy();
}
delete this.config;
delete this.lookup;
this.purgeListeners();
},
- /**
- * @private
- * Setup any saved state for the column, ensures that defaults are applied.
- */
+
setState : function(col, state) {
state = Ext.applyIf(state, this.defaults);
Ext.apply(this.config[col], state);
}
});
-// private
+
Ext.grid.ColumnModel.defaultRenderer = function(value) {
if (typeof value == "string" && value.length < 1) {
return "&#160;";
}
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){
@@ -75864,13 +50224,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({
@@ -75884,26 +50242,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);
@@ -75914,10 +50270,7 @@ Ext.grid.AbstractSelectionModel = Ext.extend(Ext.util.Observable, {
}
},
- /**
- * Returns true if the selections are locked.
- * @return {Boolean}
- */
+
isLocked : function(){
return this.locked;
},
@@ -75926,24 +50279,11 @@ 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
- * <tt>true</tt> to allow selection of only one row at a time (defaults to <tt>false</tt>
- * allowing multiple selections)
- */
+
singleSelect : false,
-
+
constructor : function(config){
Ext.apply(this, config);
this.selections = new Ext.util.MixedCollection(false, function(o){
@@ -75954,48 +50294,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
- * <tt>false</tt> 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){
@@ -76035,7 +50347,7 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, {
}
},
- // private
+
onRefresh : function(){
var ds = this.grid.store,
s = this.getSelections(),
@@ -76057,25 +50369,21 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, {
this.silent = false;
},
- // 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) <tt>true</tt> to keep existing selections
- */
+
selectRecords : function(records, keepExisting){
if(!keepExisting){
this.clearSelections();
@@ -76088,34 +50396,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) <tt>true</tt> 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) <tt>true</tt> to keep existing selections
- * @return {Boolean} <tt>true</tt> if there is a next row, else <tt>false</tt>
- */
+
selectNext : function(keepExisting){
if(this.hasNext()){
this.selectRow(this.last+1, keepExisting);
@@ -76125,11 +50421,7 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, {
return false;
},
- /**
- * Selects the row that precedes the last selected row.
- * @param {Boolean} keepExisting (optional) <tt>true</tt> to keep existing selections
- * @return {Boolean} <tt>true</tt> if there is a previous row, else <tt>false</tt>
- */
+
selectPrevious : function(keepExisting){
if(this.hasPrevious()){
this.selectRow(this.last-1, keepExisting);
@@ -76139,47 +50431,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
- * <tt>false</tt>, iteration is stopped and this function returns
- * <tt>false</tt>. Otherwise it returns <tt>true</tt>.
- * @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 (<code>this</code> 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(),
i = 0,
@@ -76193,12 +50466,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) <tt>true</tt> to bypass the
- * conditional checks and events described in {@link #deselectRow}.
- */
+
clearSelections : function(fast){
if(this.isLocked()){
return;
@@ -76217,10 +50485,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;
@@ -76231,34 +50496,23 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, {
}
},
- /**
- * Returns <tt>true</tt> if there is a selection.
- * @return {Boolean}
- */
+
hasSelection : function(){
return this.selections.length > 0;
},
- /**
- * Returns <tt>true</tt> 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 <tt>true</tt> 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;
@@ -76267,7 +50521,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);
@@ -76280,12 +50534,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) <tt>true</tt> to keep
- * existing selections (defaults to <tt>false</tt>)
- */
+
selectRows : function(rows, keepExisting){
if(!keepExisting){
this.clearSelections();
@@ -76295,14 +50544,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()){
@@ -76322,13 +50564,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;
@@ -76338,17 +50574,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) <tt>true</tt> to keep existing selections
- * @param {Boolean} preventViewNotify (optional) Specify <tt>true</tt> 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;
@@ -76370,15 +50596,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 <tt>true</tt> to
- * prevent notifying the view (disables updating the selected appearance)
- */
+
deselectRow : function(index, preventViewNotify){
if(this.isLocked()){
return;
@@ -76400,16 +50618,16 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, {
}
},
- // 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,
+ var k = e.getKey(),
+ newCell,
+ g = this.grid,
last = g.lastEdit,
ed = g.activeEditor,
shift = e.shiftKey,
@@ -76438,20 +50656,20 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, {
this.onEditorSelect(r, last.row);
- 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);
}
},
-
+
onEditorSelect: function(row, lastRow){
if(lastRow != row){
- this.selectRow(row); // *** highlight newly-selected cell and update selection
+ this.selectRow(row);
}
},
@@ -76461,217 +50679,32 @@ Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, {
Ext.grid.RowSelectionModel.superclass.destroy.call(this);
}
});
-/**
- * @class Ext.grid.Column
- * <p>This class encapsulates column configuration data to be used in the initialization of a
- * {@link Ext.grid.ColumnModel ColumnModel}.</p>
- * <p>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.</p>
- */
+
Ext.grid.Column = Ext.extend(Ext.util.Observable, {
- /**
- * @cfg {Boolean} editable Optional. Defaults to <tt>true</tt>, enabling the configured
- * <tt>{@link #editor}</tt>. Set to <tt>false</tt> 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 <tt>id</tt> is used to create a CSS <b>class</b> name which is applied to all
- * table cells (including headers) in that column (in this context the <tt>id</tt> does not need to be
- * unique). The class name takes the form of <pre>x-grid3-td-<b>id</b></pre>
- * Header cells will also receive this class name, but will also have the class <pre>x-grid3-hd</pre>
- * So, to target header cells, use CSS selectors such as:<pre>.x-grid3-hd-row .x-grid3-td-<b>id</b></pre>
- * 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. <b>Note</b>: to
- * have a clickable header with no text displayed use <tt>'&amp;#160;'</tt>.
- */
- /**
- * @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 <tt>true</tt>,
- * which enables the header menu group option. Set to <tt>false</tt> to disable (but still show) the
- * group option in the header menu for the column. See also <code>{@link #groupName}</code>.
- */
- /**
- * @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 <p>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 <tt><b>groupRenderer</b></tt> is not specified, the configured
- * <tt><b>{@link #renderer}</b></tt> will be called; if a <tt><b>{@link #renderer}</b></tt> is also not specified
- * the new value of the group field will be used.</p>
- * <p>The called function (either the <tt><b>groupRenderer</b></tt> or <tt><b>{@link #renderer}</b></tt>) will be
- * passed the following parameters:
- * <div class="mdetail-params"><ul>
- * <li><b>v</b> : Object<p class="sub-desc">The new value of the group field.</p></li>
- * <li><b>unused</b> : undefined<p class="sub-desc">Unused parameter.</p></li>
- * <li><b>r</b> : Ext.data.Record<p class="sub-desc">The Record providing the data
- * for the row which caused group change.</p></li>
- * <li><b>rowIndex</b> : Number<p class="sub-desc">The row index of the Record which caused group change.</p></li>
- * <li><b>colIndex</b> : Number<p class="sub-desc">The column index of the group field.</p></li>
- * <li><b>ds</b> : Ext.data.Store<p class="sub-desc">The Store which is providing the data Model.</p></li>
- * </ul></div></p>
- * <p>The function should return a string value.</p>
- */
- /**
- * @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 <p><b>Required</b>. 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.</p>
- */
- /**
- * @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:
- * <div class="mdetail-params"><ul>
- * <li>{@link Ext.grid.GridPanel}.<tt>{@link Ext.grid.GridPanel#autoExpandColumn autoExpandColumn}</tt></li>
- * <li>{@link Ext.grid.GridView}.<tt>{@link Ext.grid.GridView#forceFit forceFit}</tt>
- * <div class="sub-desc">
- * <p>By specifying <tt>forceFit:true</tt>, {@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.</p>
- * </div></li>
- * <li>{@link Ext.grid.GridView}.<tt>{@link Ext.grid.GridView#autoFill autoFill}</tt></li>
- * <li>{@link Ext.grid.GridPanel}.<tt>{@link Ext.grid.GridPanel#minColumnWidth minColumnWidth}</tt></li>
- * <br><p><b>Note</b>: 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}.<tt>{@link Ext.grid.GridView#scrollOffset scrollOffset}</tt>
- * can be modified to reduce or eliminate the reserved offset.</p>
- */
- /**
- * @cfg {Boolean} sortable Optional. <tt>true</tt> if sorting is to be allowed on this column.
- * Defaults to the value of the <code>{@link Ext.grid.ColumnModel#defaultSortable}</code> property.
- * Whether local/remote sorting is used is specified in <code>{@link Ext.data.Store#remoteSort}</code>.
- */
- /**
- * @cfg {Boolean} fixed Optional. <tt>true</tt> if the column width cannot be changed. Defaults to <tt>false</tt>.
- */
- /**
- * @cfg {Boolean} resizable Optional. <tt>false</tt> to disable column resizing. Defaults to <tt>true</tt>.
- */
- /**
- * @cfg {Boolean} menuDisabled Optional. <tt>true</tt> to disable the column menu. Defaults to <tt>false</tt>.
- */
- /**
- * @cfg {Boolean} hidden
- * Optional. <tt>true</tt> to initially hide this column. Defaults to <tt>false</tt>.
- * 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
- * <p>For an alternative to specifying a renderer see <code>{@link #xtype}</code></p>
- * <p>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:
- * <div class="mdetail-params"><ul>
- * <li>A renderer function used to return HTML markup for a cell given the cell's data value.</li>
- * <li>A string which references a property name of the {@link Ext.util.Format} class which
- * provides a renderer function.</li>
- * <li>An object specifying both the renderer function, and its execution scope (<tt><b>this</b></tt>
- * reference) e.g.:<pre style="margin-left:1.2em"><code>
-{
- fn: this.gridRenderer,
- scope: this
-}
-</code></pre></li></ul></div>
- * If not specified, the default renderer uses the raw data value.</p>
- * <p>For information about the renderer function (passed parameters, etc.), see
- * {@link Ext.grid.ColumnModel#setRenderer}. An example of specifying renderer function inline:</p><pre><code>
-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;
- }
-}
- * </code></pre>
- * 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 <code>{@link #renderer}</code> to be easily
- * configured into a ColumnModel. The predefined {@link Ext.grid.Column} subclass types are:
- * <div class="mdetail-params"><ul>
- * <li><b><tt>gridcolumn</tt></b> : {@link Ext.grid.Column} (<b>Default</b>)<p class="sub-desc"></p></li>
- * <li><b><tt>booleancolumn</tt></b> : {@link Ext.grid.BooleanColumn}<p class="sub-desc"></p></li>
- * <li><b><tt>numbercolumn</tt></b> : {@link Ext.grid.NumberColumn}<p class="sub-desc"></p></li>
- * <li><b><tt>datecolumn</tt></b> : {@link Ext.grid.DateColumn}<p class="sub-desc"></p></li>
- * <li><b><tt>templatecolumn</tt></b> : {@link Ext.grid.TemplateColumn}<p class="sub-desc"></p></li>
- * </ul></div>
- * <p>Configuration properties for the specified <code>xtype</code> may be specified with
- * the Column configuration properties, for example:</p>
- * <pre><code>
-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}
- }, {
- ...
- }]
-});
- * </code></pre>
- */
- /**
- * @cfg {Object} scope Optional. The scope (<tt><b>this</b></tt> 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 <tt>false</tt> 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 <tt>{@link #editable}</tt> also.
- */
- /**
- * @private
- * @cfg {Boolean} isColumn
- * Used by ColumnModel setConfig method to avoid reprocessing a Column
- * if <code>isColumn</code> is not set ColumnModel will recreate a new Ext.grid.Column
- * Defaults to true.
- */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
isColumn : true,
constructor : function(config){
@@ -76691,59 +50724,24 @@ var grid = new Ext.grid.GridPanel({
delete this.editor;
this.setEditor(ed);
this.addEvents(
- /**
- * @event click
- * Fires when this Column is clicked.
- * @param {Column} this
- * @param {Grid} The owning GridPanel
- * @param {Number} rowIndex
- * @param {Ext.EventObject} e
- */
+
'click',
- /**
- * @event contextmenu
- * Fires when this Column is right clicked.
- * @param {Column} this
- * @param {Grid} The owning GridPanel
- * @param {Number} rowIndex
- * @param {Ext.EventObject} e
- */
+
'contextmenu',
- /**
- * @event dblclick
- * Fires when this Column is double clicked.
- * @param {Column} this
- * @param {Grid} The owning GridPanel
- * @param {Number} rowIndex
- * @param {Ext.EventObject} e
- */
+
'dblclick',
- /**
- * @event mousedown
- * Fires when this Column receives a mousedown event.
- * @param {Column} this
- * @param {Grid} The owning GridPanel
- * @param {Number} rowIndex
- * @param {Ext.EventObject} e
- */
+
'mousedown'
);
Ext.grid.Column.superclass.constructor.call(this);
},
- /**
- * @private
- * Process and refire events routed from the GridView's processEvent method.
- * Returns the event handler's status to allow cancelling of GridView's bubbling process.
- */
+
processEvent : function(name, e, grid, rowIndex, colIndex){
return this.fireEvent(name, this, grid, rowIndex, e);
},
- /**
- * @private
- * Clean up. Remove any Editor. Remove any listeners.
- */
+
destroy: function() {
if(this.setEditor){
this.setEditor(null);
@@ -76751,37 +50749,17 @@ var grid = new Ext.grid.GridPanel({
this.purgeListeners();
},
- /**
- * Optional. A function which returns displayable data when passed the following parameters:
- * <div class="mdetail-params"><ul>
- * <li><b>value</b> : Object<p class="sub-desc">The data value for the cell.</p></li>
- * <li><b>metadata</b> : Object<p class="sub-desc">An object in which you may set the following attributes:<ul>
- * <li><b>css</b> : String<p class="sub-desc">A CSS class name to add to the cell's TD element.</p></li>
- * <li><b>attr</b> : String<p class="sub-desc">An HTML attribute definition string to apply to the data container
- * element <i>within</i> the table cell (e.g. 'style="color:red;"').</p></li></ul></p></li>
- * <li><b>record</b> : Ext.data.record<p class="sub-desc">The {@link Ext.data.Record} from which the data was
- * extracted.</p></li>
- * <li><b>rowIndex</b> : Number<p class="sub-desc">Row index</p></li>
- * <li><b>colIndex</b> : Number<p class="sub-desc">Column index</p></li>
- * <li><b>store</b> : Ext.data.Store<p class="sub-desc">The {@link Ext.data.Store} object from which the Record
- * was extracted.</p></li>
- * </ul></div>
- * @property renderer
- * @type Function
- */
+
renderer : function(value){
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){
@@ -76794,7 +50772,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');
}
@@ -76802,12 +50780,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){
@@ -76822,28 +50795,13 @@ var grid = new Ext.grid.GridPanel({
}
});
-/**
- * @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>'&amp;#160;'</tt>).
- */
+
undefinedText: '&#160;',
constructor: function(cfg){
@@ -76861,18 +50819,9 @@ Ext.grid.BooleanColumn = Ext.extend(Ext.grid.Column, {
}
});
-/**
- * @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);
@@ -76880,19 +50829,9 @@ Ext.grid.NumberColumn = Ext.extend(Ext.grid.Column, {
}
});
-/**
- * @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);
@@ -76900,20 +50839,9 @@ Ext.grid.DateColumn = Ext.extend(Ext.grid.Column, {
}
});
-/**
- * @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);
@@ -76924,133 +50852,21 @@ Ext.grid.TemplateColumn = Ext.extend(Ext.grid.Column, {
}
});
-/**
- * @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'));
- }
- },
- {
- getClass: function(v, meta, rec) { // Or return a class from a function
- if (rec.get('change') < 0) {
- this.items[1].tooltip = 'Do not buy!';
- return 'alert-col';
- } else {
- this.items[1].tooltip = 'Buy stock';
- return 'buy-col';
- }
- },
- handler: function(grid, rowIndex, colIndex) {
- var rec = store.getAt(rowIndex);
- alert("Buy " + rec.get('company'));
- }
- }
- ]
- }
- //any other columns here
- ]
-});
-</pre></code>
- * <p>The action column can be at any index in the columns array, and a grid can have any number of
- * action columns. </p>
- */
+
Ext.grid.ActionColumn = Ext.extend(Ext.grid.Column, {
- /**
- * @cfg {String} icon
- * The URL of an image to display as the clickable element in the column.
- * Optional - defaults to <code>{@link Ext#BLANK_IMAGE_URL Ext.BLANK_IMAGE_URL}</code>.
- */
- /**
- * @cfg {String} iconCls
- * A CSS class to apply to the icon image. To determine the class dynamically, configure the Column with a <code>{@link #getClass}</code> function.
- */
- /**
- * @cfg {Function} handler A function called when the icon is clicked.
- * The handler is passed the following parameters:<div class="mdetail-params"><ul>
- * <li><code>grid</code> : GridPanel<div class="sub-desc">The owning GridPanel.</div></li>
- * <li><code>rowIndex</code> : Number<div class="sub-desc">The row index clicked on.</div></li>
- * <li><code>colIndex</code> : Number<div class="sub-desc">The column index clicked on.</div></li>
- * <li><code>item</code> : Object<div class="sub-desc">The clicked item (or this Column if multiple
- * {@link #items} were not configured).</div></li>
- * <li><code>e</code> : Event<div class="sub-desc">The click event.</div></li>
- * </ul></div>
- */
- /**
- * @cfg {Object} scope The scope (<tt><b>this</b></tt> reference) in which the <code>{@link #handler}</code>
- * and <code>{@link #getClass}</code> fuctions are executed. Defaults to this Column.
- */
- /**
- * @cfg {String} tooltip A tooltip message to be displayed on hover. {@link Ext.QuickTips#init Ext.QuickTips} must have
- * been initialized.
- */
- /**
- * @cfg {Boolean} stopSelection Defaults to <code>true</code>. Prevent grid <i>row</i> selection upon mousedown.
- */
- /**
- * @cfg {Function} getClass A function which returns the CSS class to apply to the icon image.
- * The function is passed the following parameters:<div class="mdetail-params"><ul>
- * <li><b>v</b> : Object<p class="sub-desc">The value of the column's configured field (if any).</p></li>
- * <li><b>metadata</b> : Object<p class="sub-desc">An object in which you may set the following attributes:<ul>
- * <li><b>css</b> : String<p class="sub-desc">A CSS class name to add to the cell's TD element.</p></li>
- * <li><b>attr</b> : String<p class="sub-desc">An HTML attribute definition string to apply to the data container element <i>within</i> the table cell
- * (e.g. 'style="color:red;"').</p></li>
- * </ul></p></li>
- * <li><b>r</b> : Ext.data.Record<p class="sub-desc">The Record providing the data.</p></li>
- * <li><b>rowIndex</b> : Number<p class="sub-desc">The row index..</p></li>
- * <li><b>colIndex</b> : Number<p class="sub-desc">The column index.</p></li>
- * <li><b>store</b> : Ext.data.Store<p class="sub-desc">The Store which is providing the data Model.</p></li>
- * </ul></div>
- */
- /**
- * @cfg {Array} items An Array which may contain multiple icon definitions, each element of which may contain:
- * <div class="mdetail-params"><ul>
- * <li><code>icon</code> : String<div class="sub-desc">The url of an image to display as the clickable element
- * in the column.</div></li>
- * <li><code>iconCls</code> : String<div class="sub-desc">A CSS class to apply to the icon image.
- * To determine the class dynamically, configure the item with a <code>getClass</code> function.</div></li>
- * <li><code>getClass</code> : Function<div class="sub-desc">A function which returns the CSS class to apply to the icon image.
- * The function is passed the following parameters:<ul>
- * <li><b>v</b> : Object<p class="sub-desc">The value of the column's configured field (if any).</p></li>
- * <li><b>metadata</b> : Object<p class="sub-desc">An object in which you may set the following attributes:<ul>
- * <li><b>css</b> : String<p class="sub-desc">A CSS class name to add to the cell's TD element.</p></li>
- * <li><b>attr</b> : String<p class="sub-desc">An HTML attribute definition string to apply to the data container element <i>within</i> the table cell
- * (e.g. 'style="color:red;"').</p></li>
- * </ul></p></li>
- * <li><b>r</b> : Ext.data.Record<p class="sub-desc">The Record providing the data.</p></li>
- * <li><b>rowIndex</b> : Number<p class="sub-desc">The row index..</p></li>
- * <li><b>colIndex</b> : Number<p class="sub-desc">The column index.</p></li>
- * <li><b>store</b> : Ext.data.Store<p class="sub-desc">The Store which is providing the data Model.</p></li>
- * </ul></div></li>
- * <li><code>handler</code> : Function<div class="sub-desc">A function called when the icon is clicked.</div></li>
- * <li><code>scope</code> : Scope<div class="sub-desc">The scope (<code><b>this</b></code> reference) in which the
- * <code>handler</code> and <code>getClass</code> functions are executed. Fallback defaults are this Column's
- * configured scope, then this Column.</div></li>
- * <li><code>tooltip</code> : String<div class="sub-desc">A tooltip message to be displayed on hover.
- * {@link Ext.QuickTips#init Ext.QuickTips} must have been initialized.</div></li>
- * </ul></div>
- */
+
+
+
+
+
+
+
+
header: '&#160;',
actionIdRe: /x-action-col-(\d+)/,
- /**
- * @cfg {String} altText The alt text to use for the image element. Defaults to <tt>''</tt>.
- */
+
altText: '',
constructor: function(cfg) {
@@ -77062,10 +50878,10 @@ Ext.grid.ActionColumn = Ext.extend(Ext.grid.Column, {
Ext.grid.ActionColumn.superclass.constructor.call(me, cfg);
-// Renderer closure iterates through items creating an <img> element for each and tagging with an identifying
-// class name x-action-col-{n}
+
+
me.renderer = function(v, meta) {
-// Allow a configured renderer to create initial value (And set the other values in the "metadata" argument!)
+
v = Ext.isFunction(cfg.renderer) ? cfg.renderer.apply(this, arguments)||'' : '';
meta.css += ' x-action-col-cell';
@@ -77086,12 +50902,7 @@ Ext.grid.ActionColumn = Ext.extend(Ext.grid.Column, {
return Ext.grid.ActionColumn.superclass.destroy.apply(this, arguments);
},
- /**
- * @private
- * Process and refire events routed from the GridView's processEvent method.
- * Also fires any configured click handlers. By default, cancels the mousedown event to prevent selection.
- * Returns the event handler's status to allow cancelling of GridView's bubbling process.
- */
+
processEvent : function(name, e, grid, rowIndex, colIndex){
var m = e.getTarget().className.match(this.actionIdRe),
item, fn;
@@ -77106,21 +50917,7 @@ Ext.grid.ActionColumn = Ext.extend(Ext.grid.Column, {
}
});
-/*
- * @property types
- * @type Object
- * @member Ext.grid.Column
- * @static
- * <p>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.</p>
- * <p>This contains the following properties</p><div class="mdesc-details"><ul>
- * <li>gridcolumn : <b>{@link Ext.grid.Column Column constructor}</b></li>
- * <li>booleancolumn : <b>{@link Ext.grid.BooleanColumn BooleanColumn constructor}</b></li>
- * <li>numbercolumn : <b>{@link Ext.grid.NumberColumn NumberColumn constructor}</b></li>
- * <li>datecolumn : <b>{@link Ext.grid.DateColumn DateColumn constructor}</b></li>
- * <li>templatecolumn : <b>{@link Ext.grid.TemplateColumn TemplateColumn constructor}</b></li>
- * </ul></div>
- */
+
Ext.grid.Column.types = {
gridcolumn : Ext.grid.Column,
booleancolumn: Ext.grid.BooleanColumn,
@@ -77128,39 +50925,15 @@ Ext.grid.Column.types = {
datecolumn: Ext.grid.DateColumn,
templatecolumn: Ext.grid.TemplateColumn,
actioncolumn: Ext.grid.ActionColumn
-};/**
- * @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.
- * <br>Usage:<br>
- <pre><code>
- // 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}
- ]);
- </code></pre>
- * @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){
@@ -77168,7 +50941,7 @@ Ext.grid.RowNumberer = Ext.extend(Object, {
}
},
- // private
+
fixed:true,
hideable: false,
menuDisabled:true,
@@ -77176,55 +50949,31 @@ 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 <tt>true</tt> if rows can only be selected by clicking on the
- * checkbox column (defaults to <tt>false</tt>).
- */
- /**
- * @cfg {String} header Any valid text or HTML fragment to display in the header cell for the
- * checkbox column. Defaults to:<pre><code>
- * '&lt;div class="x-grid3-hd-checker">&#38;#160;&lt;/div>'</tt>
- * </code></pre>
- * The default CSS class of <tt>'x-grid3-hd-checker'</tt> 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.,
- * <tt>'Select Rows'</tt>), but the automatic check all/none behavior will only work if the
- * <tt>'x-grid3-hd-checker'</tt> class is supplied.
- */
+
+
header : '<div class="x-grid3-hd-checker">&#160;</div>',
- /**
- * @cfg {Number} width The default width in pixels of the checkbox column (defaults to <tt>20</tt>).
- */
+
width : 20,
- /**
- * @cfg {Boolean} sortable <tt>true</tt> if the checkbox column is sortable (defaults to
- * <tt>false</tt>).
- */
+
sortable : false,
- // private
+
menuDisabled : true,
fixed : true,
hideable: false,
dataIndex : '',
id : 'checker',
- isColumn: true, // So that ColumnModel doesn't feed this through the Column constructor
+ isColumn: true,
constructor : function(){
Ext.grid.CheckboxSelectionModel.superclass.constructor.apply(this, arguments);
@@ -77233,7 +50982,7 @@ Ext.grid.CheckboxSelectionModel = Ext.extend(Ext.grid.RowSelectionModel, {
}
},
- // private
+
initEvents : function(){
Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this);
this.grid.on('render', function(){
@@ -77241,10 +50990,7 @@ Ext.grid.CheckboxSelectionModel = Ext.extend(Ext.grid.RowSelectionModel, {
}, this);
},
- /**
- * @private
- * Process and refire events routed from the GridView's processEvent method.
- */
+
processEvent : function(name, e, grid, rowIndex, colIndex){
if (name == 'mousedown') {
this.onMouseDown(e, e.getTarget());
@@ -77254,9 +51000,9 @@ Ext.grid.CheckboxSelectionModel = Ext.extend(Ext.grid.RowSelectionModel, {
}
},
- // 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');
if(row){
@@ -77271,7 +51017,7 @@ Ext.grid.CheckboxSelectionModel = Ext.extend(Ext.grid.RowSelectionModel, {
}
},
- // private
+
onHdMouseDown : function(e, t) {
if(t.className == 'x-grid3-hd-checker'){
e.stopEvent();
@@ -77287,71 +51033,37 @@ Ext.grid.CheckboxSelectionModel = Ext.extend(Ext.grid.RowSelectionModel, {
}
},
- // private
+
renderer : function(v, p, record){
return '<div class="x-grid3-row-checker">&#160;</div>';
},
onEditorSelect: function(row, lastRow){
if(lastRow != row && !this.checkOnly){
- this.selectRow(row); // *** highlight newly-selected cell and update selection
+ this.selectRow(row);
}
}
-});/**
- * @class Ext.grid.CellSelectionModel
- * @extends Ext.grid.AbstractSelectionModel
- * This class provides the basic implementation for <i>single</i> <b>cell</b> selection in a grid.
- * The object stored as the selection contains the following properties:
- * <div class="mdetail-params"><ul>
- * <li><b>cell</b> : see {@link #getSelectedCell}
- * <li><b>record</b> : Ext.data.record The {@link Ext.data.Record Record}
- * which provides the data for the row containing the selection</li>
- * </ul></div>
- * @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
- * <div class="mdetail-params"><ul>
- * <li><b>cell</b> : see {@link #getSelectedCell}
- * <li><b>record</b> : Ext.data.record<p class="sub-desc">The {@link Ext.data.Record Record}
- * which provides the data for the row containing the selection</p></li>
- * </ul></div>
- */
+
"selectionchange"
);
-
+
Ext.grid.CellSelectionModel.superclass.constructor.call(this);
},
- /** @ignore */
+
initEvents : function(){
this.grid.on('cellmousedown', this.handleMouseDown, this);
this.grid.on(Ext.EventManager.getKeyEvent(), this.handleKeyDown, this);
@@ -77367,49 +51079,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:
- * <div class="mdetail-params"><ul>
- * <li><b>rowIndex</b> : Number<p class="sub-desc">The index of the selected row</p></li>
- * <li><b>cellIndex</b> : Number<p class="sub-desc">The index of the selected cell.
- * Due to possible column reordering, the cellIndex should <b>not</b> be used as an
- * index into the Record's data. Instead, use the cellIndex to determine the <i>name</i>
- * of the selected cell and use the field name to retrieve the data value from the record:<pre><code>
-// get name
-var fieldName = grid.getColumnModel().getDataIndex(cellIndex);
-// get data value based on name
-var data = record.get(fieldName);
- * </code></pre></p></li>
- * </ul></div>
- * @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 <tt>true</tt> to prevent the gridview from
- * being notified about the change.
- */
+
clearSelections : function(preventNotify){
var s = this.selection;
if(s){
@@ -77421,15 +51113,12 @@ var data = record.get(fieldName);
}
},
- /**
- * Returns <tt>true</tt> 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;
@@ -77437,20 +51126,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 <tt>true</tt> 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);
@@ -77470,24 +51147,24 @@ 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;
}
-
+
var k = e.getKey(),
g = this.grid,
s = this.selection,
@@ -77497,7 +51174,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
);
},
@@ -77507,26 +51184,26 @@ 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:
if(e.shiftKey){
@@ -77556,16 +51233,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);
@@ -77576,150 +51253,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
- * <p>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}.</p>
- * <p>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}.</p>
- * <p>Editing is performed on the value of the <i>field</i> specified by the column's
- * <tt>{@link Ext.grid.ColumnModel#dataIndex dataIndex}</tt> 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).</p>
- * <p>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.</p>
- * 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
- * <p>The number of clicks on a cell required to display the cell's editor (defaults to 2).</p>
- * <p>Setting this option to 'auto' means that mousedown <i>on the selected cell</i> starts
- * editing that cell.</p>
- */
+
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
+
+ trackMouseOver: false,
+
+
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 <br />
- * <ul style="padding:5px;padding-left:16px;">
- * <li>grid - This grid</li>
- * <li>record - The record being edited</li>
- * <li>field - The field name being edited</li>
- * <li>value - The value for the field being edited.</li>
- * <li>row - The grid row index</li>
- * <li>column - The grid column index</li>
- * <li>cancel - Set this to true to cancel the edit or return false from your handler.</li>
- * </ul>
- * @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 <br />
- * <ul style="padding:5px;padding-left:16px;">
- * <li>grid - This grid</li>
- * <li>record - The record being edited</li>
- * <li>field - The field name being edited</li>
- * <li>value - The value being set</li>
- * <li>originalValue - The original value for the field, before the edit.</li>
- * <li>row - The grid row index</li>
- * <li>column - The grid column index</li>
- * </ul>
- *
- * <pre><code>
-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();
-};
- * </code></pre>
- * @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 <br />
- * <ul style="padding:5px;padding-left:16px;">
- * <li>grid - This grid</li>
- * <li>record - The record being edited</li>
- * <li>field - The field name being edited</li>
- * <li>value - The value being set</li>
- * <li>originalValue - The original value for the field, before the edit.</li>
- * <li>row - The grid row index</li>
- * <li>column - The grid column index</li>
- * <li>cancel - Set this to true to cancel the edit or return false from your handler.</li>
- * </ul>
- * 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:
- * <pre><code>
-grid.on('validateedit', function(e) {
- var myTargetRow = 6;
-
- if (e.row == myTargetRow) {
- e.cancel = true;
- e.record.data[e.field] = e.value;
- }
-});
- * </code></pre>
- * @param {Object} e An edit event (see above for description)
- */
+
"validateedit"
);
},
- // private
+
initEvents : function(){
Ext.grid.EditorGridPanel.superclass.initEvents.call(this);
@@ -77745,12 +51320,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;
@@ -77759,7 +51334,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);
@@ -77772,7 +51347,7 @@ grid.on('validateedit', function(e) {
}
},
- // private
+
onEditComplete : function(ed, value, startValue){
this.editing = false;
this.lastActiveEditor = this.activeEditor;
@@ -77801,11 +51376,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)){
@@ -77855,13 +51426,17 @@ 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.
+ if (ed.field.isXType('checkbox')) {
+ ed.allowBlur = false;
+ this.setupCheckbox(ed.field);
+ }
+
+
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);
@@ -77869,24 +51444,39 @@ grid.on('validateedit', function(e) {
}
},
- // private
+ setupCheckbox: function(field){
+ var me = this,
+ fn = function() {
+ field.el.on('click', me.onCheckClick, me, {single: true});
+ };
+ if (field.rendered) {
+ fn();
+ } else {
+ field.on('render', fn, null, {single: true});
+ }
+ },
+
+ onCheckClick: function(){
+ var ed = this.activeEditor;
+ ed.allowBlur = true;
+ ed.field.focus(false, 10);
+ },
+
+
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']();
@@ -77897,8 +51487,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;
@@ -77911,42 +51501,14 @@ 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:
- * <pre><code>
-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);
-</code></pre>
- * @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({
@@ -77956,10 +51518,10 @@ Ext.grid.PropertyStore = Ext.extend(Ext.util.Observable, {
if(source){
this.setSource(source);
}
- Ext.grid.PropertyStore.superclass.constructor.call(this);
+ 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();
@@ -77972,7 +51534,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;
@@ -77987,32 +51549,32 @@ 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);
}
},
-
- // private
+
+
remove : function(prop){
var r = this.getRec(prop);
if(r){
@@ -78020,45 +51582,38 @@ Ext.grid.PropertyStore = Ext.extend(Ext.util.Observable, {
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},
@@ -78080,33 +51635,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){
@@ -78121,16 +51676,16 @@ 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,
+ n = p.data.name,
val = p.data.value;
if(this.grid.customEditors[n]){
return this.grid.customEditors[n];
@@ -78146,7 +51701,7 @@ Ext.grid.PropertyColumnModel = Ext.extend(Ext.grid.ColumnModel, {
}
},
- // inherit docs
+
destroy : function(){
Ext.grid.PropertyColumnModel.superclass.destroy.call(this);
this.destroyEditors(this.editors);
@@ -78160,85 +51715,14 @@ 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:
- * <pre><code>
-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"
- }
-});
-</code></pre>
- * @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:
- * <pre><code>
-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'
- }
-});
-</code></pre>
- */
- /**
- * @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:
- * <pre><code>
-var grid = new Ext.grid.PropertyGrid({
- ...
- customRenderers: {
- Available: function(v){
- if(v){
- return '<span style="color: green;">Yes</span>';
- }else{
- return '<span style="color: red;">No</span>';
- }
- }
- },
- source: {
- Available: true
- }
-});
-</code></pre>
- */
- // private config overrides
+
+
+
+
+
enableColumnMove:false,
stripeRows:false,
trackMouseOver: false,
@@ -78248,7 +51732,7 @@ var grid = new Ext.grid.PropertyGrid({
forceFit:true
},
- // private
+
initComponent : function(){
this.customRenderers = this.customRenderers || {};
this.customEditors = this.customEditors || {};
@@ -78258,26 +51742,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;
@@ -78292,14 +51759,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){
@@ -78307,225 +51774,67 @@ 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:
- * <pre><code>
-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"
-});
-</code></pre>
- * @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 <tt>false</tt>.
- */
+
+
setProperty : function(prop, value, create){
- this.propStore.setValue(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}<div class="mdetail-params"><ul>
- * <li><code>{@link Ext.grid.Column#emptyGroupText emptyGroupText}</code></li>
- * <li><code>{@link Ext.grid.Column#groupable groupable}</code></li>
- * <li><code>{@link Ext.grid.Column#groupName groupName}</code></li>
- * <li><code>{@link Ext.grid.Column#groupRender groupRender}</code></li>
- * </ul></div>
- * <p>Sample usage:</p>
- * <pre><code>
-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
+
+
});
- * </code></pre>
- * @constructor
- * @param {Object} config
- */
+Ext.reg("propertygrid", Ext.grid.PropertyGrid);
+
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 <tt>true</tt> to hide the column that is currently grouped (defaults to <tt>false</tt>)
- */
+
hideGroupedColumn : false,
- /**
- * @cfg {Boolean} showGroupName If <tt>true</tt> will display a prefix plus a ': ' before the group field value
- * in the group header line. The prefix will consist of the <tt><b>{@link Ext.grid.Column#groupName groupName}</b></tt>
- * (or the configured <tt><b>{@link Ext.grid.Column#header header}</b></tt> if not provided) configured in the
- * {@link Ext.grid.Column} for each set of grouped rows (defaults to <tt>true</tt>).
- */
+
showGroupName : true,
- /**
- * @cfg {Boolean} startCollapsed <tt>true</tt> to start all groups collapsed (defaults to <tt>false</tt>)
- */
+
startCollapsed : false,
- /**
- * @cfg {Boolean} enableGrouping <tt>false</tt> to disable grouping functionality (defaults to <tt>true</tt>)
- */
+
enableGrouping : true,
- /**
- * @cfg {Boolean} enableGroupingMenu <tt>true</tt> to enable the grouping control in the column menu (defaults to <tt>true</tt>)
- */
+
enableGroupingMenu : true,
- /**
- * @cfg {Boolean} enableNoGroups <tt>true</tt> to allow the user to turn off grouping (defaults to <tt>true</tt>)
- */
+
enableNoGroups : true,
- /**
- * @cfg {String} emptyGroupText The text to display when there is an empty group value (defaults to <tt>'(None)'</tt>).
- * May also be specified per column, see {@link Ext.grid.Column}.{@link Ext.grid.Column#emptyGroupText emptyGroupText}.
- */
+
emptyGroupText : '(None)',
- /**
- * @cfg {Boolean} ignoreAdd <tt>true</tt> to skip refreshing the view when new rows are added (defaults to <tt>false</tt>)
- */
+
ignoreAdd : false,
- /**
- * @cfg {String} groupTextTpl The template used to render the group header (defaults to <tt>'{text}'</tt>).
- * This is used to format an object which contains the following properties:
- * <div class="mdetail-params"><ul>
- * <li><b>group</b> : String<p class="sub-desc">The <i>rendered</i> value of the group field.
- * By default this is the unchanged value of the group field. If a <tt><b>{@link Ext.grid.Column#groupRenderer groupRenderer}</b></tt>
- * is specified, it is the result of a call to that function.</p></li>
- * <li><b>gvalue</b> : Object<p class="sub-desc">The <i>raw</i> value of the group field.</p></li>
- * <li><b>text</b> : String<p class="sub-desc">The configured header (as described in <tt>{@link #showGroupName})</tt>
- * if <tt>{@link #showGroupName}</tt> is <tt>true</tt>) plus the <i>rendered</i> group field value.</p></li>
- * <li><b>groupId</b> : String<p class="sub-desc">A unique, generated ID which is applied to the
- * View Element which contains the group.</p></li>
- * <li><b>startRow</b> : Number<p class="sub-desc">The row index of the Record which caused group change.</p></li>
- * <li><b>rs</b> : Array<p class="sub-desc">Contains a single element: The Record providing the data
- * for the row which caused group change.</p></li>
- * <li><b>cls</b> : String<p class="sub-desc">The generated class name string to apply to the group header Element.</p></li>
- * <li><b>style</b> : String<p class="sub-desc">The inline style rules to apply to the group header Element.</p></li>
- * </ul></div></p>
- * See {@link Ext.XTemplate} for information on how to format data using a template. Possible usage:<pre><code>
-var grid = new Ext.grid.GridPanel({
- ...
- view: new Ext.grid.GroupingView({
- groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
- }),
-});
- * </code></pre>
- */
+
groupTextTpl : '{text}',
- /**
- * @cfg {String} groupMode Indicates how to construct the group identifier. <tt>'value'</tt> constructs the id using
- * raw value, <tt>'display'</tt> constructs the id using the rendered value. Defaults to <tt>'value'</tt>.
- */
+
groupMode: 'value',
- /**
- * @cfg {Function} groupRenderer This property must be configured in the {@link Ext.grid.Column} for
- * each column.
- */
- /**
- * @cfg {Boolean} cancelEditOnToggle True to cancel any editing when the group header is toggled. Defaults to <tt>true</tt>.
- */
+
+
cancelEditOnToggle: true,
- // private
+
initTemplates : function(){
Ext.grid.GroupingView.superclass.initTemplates.call(this);
this.state = {};
@@ -78548,17 +51857,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();
@@ -78571,7 +51880,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);
@@ -78581,7 +51890,7 @@ var grid = new Ext.grid.GridPanel({
this.applyEmptyText();
},
- // private
+
refreshRow : function(record){
if(this.ds.getCount()==1){
this.refresh();
@@ -78592,7 +51901,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'))){
@@ -78604,7 +51913,7 @@ var grid = new Ext.grid.GridPanel({
}
},
- // private
+
renderUI : function(){
var markup = Ext.grid.GroupingView.superclass.renderUI.call(this);
@@ -78634,16 +51943,16 @@ 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),
emptyRe = new RegExp('gp-' + Ext.escapeRe(field) + '--hd');
- // remove trailing '-hd'
+
groupValue = groupValue.substr(0, groupValue.length - 3);
- // also need to check for empty groups
+
if(groupValue || emptyRe.test(hd.id)){
this.grid.fireEvent('group' + name, this.grid, field, groupValue, e);
}
@@ -78654,17 +51963,17 @@ var grid = new Ext.grid.GridPanel({
},
- // private
+
onGroupByClick : function(){
var grid = this.grid;
this.enableGrouping = true;
grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));
grid.fireEvent('groupchange', grid, 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){
@@ -78675,11 +51984,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;
@@ -78690,11 +51995,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),
id = Ext.util.Format.htmlEncode(gel.id);
@@ -78709,10 +52010,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++){
@@ -78720,21 +52018,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
+
getGroup : function(v, r, groupRenderer, rowIndex, colIndex, ds){
var column = this.cm.config[colIndex],
g = groupRenderer ? groupRenderer.call(column.scope, v, {}, r, rowIndex, colIndex, ds) : String(v);
@@ -78744,12 +52038,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;
@@ -78786,11 +52080,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);
@@ -78813,7 +52107,7 @@ var grid = new Ext.grid.GridPanel({
this, arguments);
},
- // private
+
doRender : function(cs, rs, ds, startRow, colCount, stripe){
if(rs.length < 1){
return '';
@@ -78841,8 +52135,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,
@@ -78873,17 +52167,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,
@@ -78892,27 +52182,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);
@@ -78936,7 +52226,7 @@ var grid = new Ext.grid.GridPanel({
return r;
},
- // private
+
updateGroupWidths : function(){
if(!this.canGroup() || !this.hasRows()){
return;
@@ -78948,33 +52238,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/deluge/ui/web/js/extjs/ext-all.js b/deluge/ui/web/js/extjs/ext-all.js
index 5b0034a59..322f973e7 100644
--- a/deluge/ui/web/js/extjs/ext-all.js
+++ b/deluge/ui/web/js/extjs/ext-all.js
@@ -1,11 +1,21 @@
/*
- * Ext JS Library 3.4.0
- * Copyright(c) 2006-2011 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
-(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(k,m,l,r){var n=this,q,s,p;if(typeof k=="object"){r=k;for(q in r){s=r[q];if(!n.filterOptRe.test(q)){n.addListener(q,s.fn||s,s.scope||r.scope,s.fn?s:r)}}}else{k=k.toLowerCase();p=n.events[k]||g;if(typeof p=="boolean"){n.events[k]=p=new h.Event(n,k)}p.addListener(m,l,typeof r=="object"?r:{})}},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(),o=Array.prototype.slice.call(arguments,0);if(!k.tasks){k.tasks=[]}k.tasks.push(l);l.delay(p.delay||10,function(){k.tasks.remove(l);n.apply(m,o)},m)}}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<k;o++){m=p[o];if(m&&m.fireFn.apply(m.scope||q.obj||window,n)===i){return(q.firing=i)}}}q.firing=i;return g}}})();Ext.DomHelper=function(){var x=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,t=/td|tr|tbody/i,o=/([a-z0-9-]+)\s*:\s*([^;\s]+(?:\s*[^;\s]+)*);?/gi,v=/end/i,r,n="afterbegin",p="afterend",c="beforebegin",q="beforeend",a="<table>",i="</table>",b=a+"<tbody>",j="</tbody>"+i,l=b+"<tr>",w="</tr>"+j;function h(B,D,C,E,A,y){var z=r.insertHtml(E,Ext.getDom(B),u(D));return C?Ext.get(z,true):z}function u(D){var z="",y,C,B,E;if(typeof D=="string"){z=D}else{if(Ext.isArray(D)){for(var A=0;A<D.length;A++){if(D[A]){z+=u(D[A])}}}else{z+="<"+(D.tag=D.tag||"div");for(y in D){C=D[y];if(!d.test(y)){if(typeof C=="object"){z+=" "+y+'="';for(B in C){z+=B+":"+C[B]+";"}z+='"'}else{z+=" "+({cls:"class",htmlFor:"for"}[y]||y)+'="'+C+'"'}}}if(k.test(D.tag)){z+="/>"}else{z+=">";if((E=D.children||D.cn)){z+=u(E)}else{if(D.html){z+=D.html}}z+="</"+D.tag+">"}}}return z}function g(F,C,B,D){x.innerHTML=[C,B,D].join("");var y=-1,A=x,z;while(++y<F){A=A.firstChild}if(z=A.nextSibling){var E=document.createDocumentFragment();while(A){z=A.nextSibling;E.appendChild(A);A=z}A=E}return A}function e(y,z,B,A){var C,D;x=x||document.createElement("div");if(y=="td"&&(z==n||z==q)||!t.test(y)&&(z==c||z==p)){return}D=z==c?B:z==p?B.nextSibling:z==n?B.firstChild:null;if(z==c||z==p){B=B.parentNode}if(y=="td"||(y=="tr"&&(z==q||z==n))){C=g(4,l,A,w)}else{if((y=="tbody"&&(z==q||z==n))||(y=="tr"&&(z==c||z==p))){C=g(3,b,A,j)}else{C=g(2,a,A,i)}}B.insertBefore(C,D);return C}function s(A){var D=document.createElement("div"),y=document.createDocumentFragment(),z=0,B,C;D.innerHTML=A;C=D.childNodes;B=C.length;for(;z<B;z++){y.appendChild(C[z].cloneNode(true))}return y}r={markup:function(y){return u(y)},applyStyles:function(y,z){if(z){var A;y=Ext.fly(y);if(typeof z=="function"){z=z.call()}if(typeof z=="string"){o.lastIndex=0;while((A=o.exec(z))){y.setStyle(A[1],A[2])}}else{if(typeof z=="object"){y.setStyle(z)}}}},insertHtml:function(D,y,E){var B={},A,F,C,G,H,z;D=D.toLowerCase();B[c]=["BeforeBegin","previousSibling"];B[p]=["AfterEnd","nextSibling"];if(y.insertAdjacentHTML){if(m.test(y.tagName)&&(z=e(y.tagName.toLowerCase(),D,y,E))){return z}B[n]=["AfterBegin","firstChild"];B[q]=["BeforeEnd","lastChild"];if((A=B[D])){y.insertAdjacentHTML(A[0],E);return y[A[1]]}}else{F=y.ownerDocument.createRange();G="setStart"+(v.test(D)?"After":"Before");if(B[D]){F[G](y);if(!F.createContextualFragment){H=s(E)}else{H=F.createContextualFragment(E)}y.parentNode.insertBefore(H,D==c?y:y.nextSibling);return y[(D==c?"previous":"next")+"Sibling"]}else{C=(D==n?"first":"last")+"Child";if(y.firstChild){F[G](y[C]);if(!F.createContextualFragment){H=s(E)}else{H=F.createContextualFragment(E)}if(D==n){y.insertBefore(H,y.firstChild)}else{y.appendChild(H)}}else{y.innerHTML=E}return y[C]}}throw'Illegal insertion point -> "'+D+'"'},insertBefore:function(y,A,z){return h(y,A,z,c)},insertAfter:function(y,A,z){return h(y,A,z,p,"nextSibling")},insertFirst:function(y,A,z){return h(y,A,z,n,"firstChild")},append:function(y,A,z){return h(y,A,z,q,"",true)},overwrite:function(y,A,z){y=Ext.getDom(y);y.innerHTML=u(A);return z?Ext.get(y.firstChild):y.firstChild},createHtml:u};return r}();Ext.Template=function(h){var j=this,c=arguments,e=[],d;if(Ext.isArray(h)){h=h.join("")}else{if(c.length>1){for(var g=0,b=c.length;g<b;g++){d=c[g];if(typeof d=="object"){Ext.apply(j,d)}else{e.push(d)}}h=e.join("")}}j.html=h;if(j.compiled){j.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.DomQuery=function(){var cache={},simpleCache={},valueCache={},nonSpace=/\S/,trimRe=/^\s+|\s+$/g,tplRe=/\{(\d+)\}/g,modeRe=/^(\s?[\/>+~]\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;i<l;i++){a[a.length]=b[i]}return a}function byTag(cs,tagName){if(cs.tagName||cs==document){cs=[cs]}if(!tagName){return cs}var result=[],ri=-1;tagName=tagName.toLowerCase();for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType==1&&ci.tagName.toLowerCase()==tagName){result[++ri]=ci}}return result}function byId(cs,id){if(cs.tagName||cs==document){cs=[cs]}if(!id){return cs}var result=[],ri=-1;for(var i=0,ci;ci=cs[i];i++){if(ci&&ci.id==id){result[++ri]=ci;return result}}return result}function byAttribute(cs,attr,value,op,custom){var result=[],ri=-1,useGetStyle=custom=="{",fn=Ext.DomQuery.operators[op],a,xml,hasXml;for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType!=1){continue}if(!hasXml){xml=Ext.DomQuery.isXml(ci);hasXml=true}if(!xml){if(useGetStyle){a=Ext.DomQuery.getStyle(ci,attr)}else{if(attr=="class"||attr=="className"){a=ci.className}else{if(attr=="for"){a=ci.htmlFor}else{if(attr=="href"){a=ci.getAttribute("href",2)}else{a=ci.getAttribute(attr)}}}}}else{a=ci.getAttribute(attr)}if((fn&&fn(a,value))||(!fn&&a)){result[++ri]=ci}}return result}function byPseudo(cs,name,value){return Ext.DomQuery.pseudos[name](cs,value)}function nodupIEXml(cs){var d=++key,r;cs[0].setAttribute("_nodup",d);r=[cs[0]];for(var i=1,len=cs.length;i<len;i++){var c=cs[i];if(!c.getAttribute("_nodup")!=d){c.setAttribute("_nodup",d);r[r.length]=c}}for(var i=0,len=cs.length;i<len;i++){cs[i].removeAttribute("_nodup")}return r}function nodup(cs){if(!cs){return[]}var len=cs.length,c,i,r=cs,cj,ri=-1;if(!len||typeof cs.nodeType!="undefined"||len==1){return cs}if(isIE&&typeof cs[0].selectSingleNode!="undefined"){return nodupIEXml(cs)}var d=++key;cs[0]._nodup=d;for(i=1;c=cs[i];i++){if(c._nodup!=d){c._nodup=d}else{r=[];for(var j=0;j<i;j++){r[++ri]=cs[j]}for(j=i+1;cj=cs[j];j++){if(cj._nodup!=d){cj._nodup=d;r[++ri]=cj}}return r}}return r}function quickDiffIEXml(c1,c2){var d=++key,r=[];for(var i=0,len=c1.length;i<len;i++){c1[i].setAttribute("_qdiff",d)}for(var i=0,len=c2.length;i<len;i++){if(c2[i].getAttribute("_qdiff")!=d){r[r.length]=c2[i]}}for(var i=0,len=c1.length;i<len;i++){c1[i].removeAttribute("_qdiff")}return r}function quickDiff(c1,c2){var len1=c1.length,d=++key,r=[];if(!len1){return c2}if(isIE&&typeof c1[0].selectSingleNode!="undefined"){return quickDiffIEXml(c1,c2)}for(var i=0;i<len1;i++){c1[i]._qdiff=d}for(var i=0,len=c2.length;i<len;i++){if(c2[i]._qdiff!=d){r[r.length]=c2[i]}}return r}function quickId(ns,mode,root,id){if(ns==root){var d=root.ownerDocument||root;return d.getElementById(id)}ns=getNodes(ns,mode,"*");return byId(ns,id)}return{getStyle:function(el,name){return Ext.fly(el).getStyle(name)},compile:function(path,type){type=type||"select";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,lmode=path.match(modeRe);if(lmode&&lmode[1]){fn[fn.length]='mode="'+lmode[1].replace(trimRe,"")+'";';path=path.replace(lmode[1],"")}while(path.substr(0,1)=="/"){path=path.substr(1)}while(path&&lastPath!=path){lastPath=path;var tokenMatch=path.match(tagTokenRe);if(type=="select"){if(tokenMatch){if(tokenMatch[1]=="#"){fn[fn.length]='n = quickId(n, mode, root, "'+tokenMatch[2]+'");'}else{fn[fn.length]='n = getNodes(n, mode, "'+tokenMatch[2]+'");'}path=path.replace(tokenMatch[0],"")}else{if(path.substr(0,1)!="@"){fn[fn.length]='n = getNodes(n, mode, "*");'}}}else{if(tokenMatch){if(tokenMatch[1]=="#"){fn[fn.length]='n = byId(n, "'+tokenMatch[2]+'");'}else{fn[fn.length]='n = byTag(n, "'+tokenMatch[2]+'");'}path=path.replace(tokenMatch[0],"")}}while(!(modeMatch=path.match(modeRe))){var matched=false;for(var j=0;j<matchersLn;j++){var t=matchers[j];var m=path.match(t.re);if(m){fn[fn.length]=t.select.replace(tplRe,function(x,i){return m[i]});path=path.replace(m[0],"");matched=true;break}}if(!matched){throw'Error parsing selector, parsing failed at "'+path+'"'}}if(modeMatch[1]){fn[fn.length]='mode="'+modeMatch[1].replace(trimRe,"")+'";';path=path.replace(modeMatch[1],"")}}fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f},jsSelect:function(path,root,type){root=root||document;if(typeof root=="string"){root=document.getElementById(root)}var paths=path.split(","),results=[];for(var i=0,len=paths.length;i<len;i++){var subPath=paths[i].replace(trimRe,"");if(!cache[subPath]){cache[subPath]=Ext.DomQuery.compile(subPath);if(!cache[subPath]){throw subPath+" is not a valid selector"}}var result=cache[subPath](root);if(result&&result!=document){results=results.concat(result)}}if(paths.length>1){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?(["']?)(.*?)\4)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{5}", "{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=document;Ext.Element=function(l,m){var n=typeof l=="string"?h.getElementById(l):l,o;if(!n){return null}o=n.id;if(!m&&o&&Ext.elCache[o]){return Ext.elCache[o].el}this.dom=n;this.id=o||Ext.id(n)};var d=Ext.DomHelper,e=Ext.Element,a=Ext.elCache;e.prototype={set:function(q,m){var n=this.dom,l,p,m=(m!==false)&&!!n.setAttribute;for(l in q){if(q.hasOwnProperty(l)){p=q[l];if(l=="style"){d.applyStyles(n,p)}else{if(l=="cls"){n.className=p}else{if(m){n.setAttribute(l,p)}else{n[l]=p}}}}}return this},defaultUnit:"px",is:function(l){return Ext.DomQuery.is(this.dom,l)},focus:function(o,n){var l=this,n=n||l.dom;try{if(Number(o)){l.focus.defer(o,null,[null,n])}else{n.focus()}}catch(m){}return l},blur:function(){try{this.dom.blur()}catch(l){}return this},getValue:function(l){var m=this.dom.value;return l?parseInt(m,10):m},addListener:function(l,o,n,m){Ext.EventManager.on(this.dom,l,o,n||this,m);return this},removeListener:function(l,n,m){Ext.EventManager.removeListener(this.dom,l,n,m||this);return this},removeAllListeners:function(){Ext.EventManager.removeAll(this.dom);return this},purgeAllListeners:function(){Ext.EventManager.purgeElement(this,true);return this},addUnits:function(l){if(l===""||l=="auto"||l===undefined){l=l||""}else{if(!isNaN(l)||!i.test(l)){l=l+(this.defaultUnit||"px")}}return l},load:function(m,n,l){Ext.Ajax.request(Ext.apply({params:n,url:m.url||m,callback:l,el:this.dom,indicatorText:m.indicatorText||""},Ext.isObject(m)?m:{}));return this},isBorderBox:function(){return Ext.isBorderBox||Ext.isForcedBorderBox||g[(this.dom.tagName||"").toLowerCase()]},remove:function(){var l=this,m=l.dom;if(m){delete l.dom;Ext.removeNode(m)}},hover:function(m,l,o,n){var p=this;p.on("mouseenter",m,o||p.dom,n);p.on("mouseleave",l,o||p.dom,n);return p},contains:function(l){return !l?false:Ext.lib.Dom.isAncestor(this.dom,l.dom?l.dom:l)},getAttributeNS:function(m,l){return this.getAttribute(l,m)},getAttribute:(function(){var p=document.createElement("table"),o=false,m="getAttribute" in p,l=/undefined|unknown/;if(m){try{p.getAttribute("ext:qtip")}catch(n){o=true}return function(q,s){var r=this.dom,t;if(r.getAttributeNS){t=r.getAttributeNS(s,q)||null}if(t==null){if(s){if(o&&r.tagName.toUpperCase()=="TABLE"){try{t=r.getAttribute(s+":"+q)}catch(u){t=""}}else{t=r.getAttribute(s+":"+q)}}else{t=r.getAttribute(q)||r[q]}}return t||""}}else{return function(q,s){var r=this.om,u,t;if(s){t=r[s+":"+q];u=l.test(typeof t)?undefined:t}else{u=r[q]}return u||""}}p=null})(),update:function(l){if(this.dom){this.dom.innerHTML=l}return this}};var k=e.prototype;e.addMethods=function(l){Ext.apply(k,l)};k.on=k.addListener;k.un=k.removeListener;k.autoBoxAdjust=true;var i=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i,c;e.get=function(m){var l,p,o;if(!m){return null}if(typeof m=="string"){if(!(p=h.getElementById(m))){return null}if(a[m]&&a[m].el){l=a[m].el;l.dom=p}else{l=e.addToCache(new e(p))}return l}else{if(m.tagName){if(!(o=m.id)){o=Ext.id(m)}if(a[o]&&a[o].el){l=a[o].el;l.dom=m}else{l=e.addToCache(new e(m))}return l}else{if(m instanceof e){if(m!=c){if(Ext.isIE&&(m.id==undefined||m.id=="")){m.dom=m.dom}else{m.dom=h.getElementById(m.id)||m.dom}}return m}else{if(m.isComposite){return m}else{if(Ext.isArray(m)){return e.select(m)}else{if(m==h){if(!c){var n=function(){};n.prototype=e.prototype;c=new n();c.dom=h}return c}}}}}}return null};e.addToCache=function(l,m){m=m||l.id;a[m]={el:l,data:{},events:{}};return l};e.data=function(m,l,n){m=e.get(m);if(!m){return null}var o=a[m.id].data;if(arguments.length==2){return o[l]}else{return(o[l]=n)}};function j(){if(!Ext.enableGarbageCollector){clearInterval(e.collectorThreadId)}else{var l,n,q,p;for(l in a){p=a[l];if(p.skipGC){continue}n=p.el;q=n.dom;if(!q||!q.parentNode||(!q.offsetParent&&!h.getElementById(l))){if(Ext.enableListenerCollection){Ext.EventManager.removeAll(q)}delete a[l]}}if(Ext.isIE){var m={};for(l in a){m[l]=a[l]}a=Ext.elCache=m}}}e.collectorThreadId=setInterval(j,30000);var b=function(){};b.prototype=e.prototype;e.Flyweight=function(l){this.dom=l};e.Flyweight.prototype=new b();e.Flyweight.prototype.isFlyweight=true;e._flyweights={};e.fly=function(n,l){var m=null;l=l||"_global";if(n=Ext.getDom(n)){(e._flyweights[l]=e._flyweights[l]||new e.Flyweight()).dom=n;m=e._flyweights[l]}return m};Ext.get=e.get;Ext.fly=e.fly;var g=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko){g.button=1}})();Ext.Element.addMethods(function(){var d="parentNode",b="nextSibling",c="previousSibling",e=Ext.DomQuery,a=Ext.get;return{findParent:function(m,l,h){var j=this.dom,g=document.body,k=0,i;if(Ext.isGecko&&Object.prototype.toString.call(j)=="[object XULElement]"){return null}l=l||50;if(isNaN(l)){i=Ext.getDom(l);l=Number.MAX_VALUE}while(j&&j.nodeType==1&&k<l&&j!=g&&j!=i){if(e.is(j,m)){return h?a(j):j}k++;j=j.parentNode}return null},findParentNode:function(j,i,g){var h=Ext.fly(this.dom.parentNode,"_internal");return h?h.findParent(j,i,g):null},up:function(h,g){return this.findParentNode(h,g,true)},select:function(g){return Ext.Element.select(g,this.dom)},query:function(g){return e.select(g,this.dom)},child:function(g,h){var i=e.selectNode(g,this.dom);return h?i:a(i)},down:function(g,h){var i=e.selectNode(" > "+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(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.Element.addMethods(function(){var A=Ext.supports,h={},x=/(-[a-z])/gi,s=document.defaultView,D=/alpha\(opacity=(.*)\)/i,l=/^\s+|\s+$/g,B=Ext.Element,u=/\s+/,b=/\w/g,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",C="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},E=Ext.Element.data;function p(F,G){return G.charAt(1).toUpperCase()}function v(F){return h[F]||(h[F]=F=="float"?(A.cssFloat?"cssFloat":"styleFloat"):F.replace(x,p))}return{adjustWidth:function(F){var G=this;var H=(typeof F=="number");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=(typeof F=="number");if(H&&G.autoBoxAdjust&&!G.isBorderBox()){F-=(G.getBorderWidth("tb")+G.getPadding("tb"))}return(H&&F<0)?0:F},addClass:function(J){var K=this,I,F,H,G=[];if(!Ext.isArray(J)){if(typeof J=="string"&&!this.hasClass(J)){K.dom.className+=" "+J}}else{for(I=0,F=J.length;I<F;I++){H=J[I];if(typeof H=="string"&&(" "+K.dom.className+" ").indexOf(" "+H+" ")==-1){G.push(H)}}if(G.length){K.dom.className+=" "+G.join(" ")}}return K},removeClass:function(K){var L=this,J,G,F,I,H;if(!Ext.isArray(K)){K=[K]}if(L.dom&&L.dom.className){H=L.dom.className.replace(l,"").split(u);for(J=0,F=K.length;J<F;J++){I=K[J];if(typeof I=="string"){I=I.replace(l,"");G=H.indexOf(I);if(G!=-1){H.splice(G,1)}}}L.dom.className=H.join(" ")}return L},radioClass:function(I){var J=this.dom.parentNode.childNodes,G,H,F;I=Ext.isArray(I)?I:[I];for(H=0,F=J.length;H<F;H++){G=J[H];if(G&&G.nodeType==1){Ext.fly(G,"_internal").removeClass(I)}}return this.addClass(I)},toggleClass:function(F){return this.hasClass(F)?this.removeClass(F):this.addClass(F)},hasClass:function(F){return F&&(" "+this.dom.className+" ").indexOf(" "+F+" ")!=-1},replaceClass:function(G,F){return this.removeClass(G).addClass(F)},isStyle:function(F,G){return this.getStyle(F)==G},getStyle:function(){return s&&s.getComputedStyle?function(K){var I=this.dom,F,H,G,J;if(I==document){return null}K=v(K);G=(F=I.style[K])?F:(H=s.getComputedStyle(I,""))?H[K]:null;if(K=="marginRight"&&G!="0px"&&!A.correctRightMargin){J=I.style.display;I.style.display="inline-block";G=s.getComputedStyle(I,"").marginRight;I.style.display=J}if(K=="backgroundColor"&&G=="rgba(0, 0, 0, 0)"&&!A.correctTransparentColor){G="transparent"}return G}:function(J){var H=this.dom,F,G;if(H==document){return null}if(J=="opacity"){if(H.style.filter.match){if(F=H.style.filter.match(D)){var I=parseFloat(F[1]);if(!isNaN(I)){return I?I/100:0}}}return 1}J=v(J);return H.style[J]||((G=H.currentStyle)?G[J]:null)}}(),getColor:function(F,G,K){var I=this.getStyle(F),H=(typeof K!="undefined")?K:"#",J;if(!I||(/transparent|inherit/.test(I))){return G}if(/^r/.test(I)){Ext.each(I.slice(4,I.length-1).split(","),function(L){J=parseInt(L,10);H+=(J<16?"0":"")+J.toString(16)})}else{I=I.replace("#","");H+=I.length==3?I.replace(/^(\w)(\w)(\w)$/,"$1$1$2$2$3$3"):I}return(H.length>5?H.toLowerCase():G)},setStyle:function(I,H){var F,G;if(typeof I!="object"){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(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,z);F.setStyle(n,z);F.setStyle(m,z)}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(M,L){var J=0,K=M.match(b),I,H,G,F=K.length;for(G=0;G<F;G++){I=K[G];H=I&&parseInt(this.getStyle(L[I]),10);if(H){J+=r.abs(H)}}return J},margins:a}}());(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({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.VISIBILITY=1;Ext.Element.DISPLAY=2;Ext.Element.OFFSETS=3;Ext.Element.ASCLASS=4;Ext.Element.visibilityCls="x-hide-nosize";Ext.Element.addMethods(function(){var e=Ext.Element,p="opacity",j="visibility",g="display",d="hidden",n="offsets",k="asclass",m="none",a="nosize",b="originalDisplay",c="visibilityMode",h="isVisible",i=e.data,l=function(r){var q=i(r,b);if(q===undefined){i(r,b,q="")}return q},o=function(r){var q=i(r,c);if(q===undefined){i(r,c,q=1)}return q};return{originalDisplay:"",visibilityMode:1,setVisibilityMode:function(q){i(this.dom,c,q);return this},animate:function(r,t,s,u,q){this.anim(r,{duration:t,callback:s,easing:u},q);return this},anim:function(t,u,r,w,s,q){r=r||"run";u=u||{};var v=this,x=Ext.lib.Anim[r](v.dom,t,(u.duration||w)||0.35,(u.easing||s)||"easeOut",function(){if(q){q.call(v)}if(u.callback){u.callback.call(u.scope||v,v,u)}},v);u.anim=x;return x},preanim:function(q,r){return !q[r]?false:(typeof q[r]=="object"?q[r]:{duration:q[r+1],callback:q[r+2],easing:q[r+3]})},isVisible:function(){var q=this,s=q.dom,r=i(s,h);if(typeof r=="boolean"){return r}r=!q.isStyle(j,d)&&!q.isStyle(g,m)&&!((o(s)==e.ASCLASS)&&q.hasClass(q.visibilityCls||e.visibilityCls));i(s,h,r);return r},setVisible:function(t,q){var w=this,r,y,x,v,u=w.dom,s=o(u);if(typeof q=="string"){switch(q){case g:s=e.DISPLAY;break;case j:s=e.VISIBILITY;break;case n:s=e.OFFSETS;break;case a:case k:s=e.ASCLASS;break}w.setVisibilityMode(s);q=false}if(!q||!w.anim){if(s==e.ASCLASS){w[t?"removeClass":"addClass"](w.visibilityCls||e.visibilityCls)}else{if(s==e.DISPLAY){return w.setDisplayed(t)}else{if(s==e.OFFSETS){if(!t){w.hideModeStyles={position:w.getStyle("position"),top:w.getStyle("top"),left:w.getStyle("left")};w.applyStyles({position:"absolute",top:"-10000px",left:"-10000px"})}else{w.applyStyles(w.hideModeStyles||{position:"",top:"",left:""});delete w.hideModeStyles}}else{w.fixDisplay();u.style.visibility=t?"visible":d}}}}else{if(t){w.setOpacity(0.01);w.setVisible(true)}w.anim({opacity:{to:(t?1:0)}},w.preanim(arguments,1),null,0.35,"easeIn",function(){t||w.setVisible(false).setOpacity(1)})}i(u,h,t);return w},hasMetrics:function(){var q=this.dom;return this.isVisible()||(o(q)==e.VISIBILITY)},toggle:function(q){var r=this;r.setVisible(!r.isVisible(),r.preanim(arguments,0));return r},setDisplayed:function(q){if(typeof q=="boolean"){q=q?l(this.dom):m}this.setStyle(g,q);return this},fixDisplay:function(){var q=this;if(q.isStyle(g,m)){q.setStyle(j,d);q.setStyle(g,l(this.dom));if(q.isStyle(g,m)){q.setStyle(g,"block")}}},hide:function(q){if(typeof q=="string"){this.setVisible(false,q);return this}this.setVisible(false,this.preanim(arguments,0));return this},show:function(q){if(typeof q=="string"){this.setVisible(true,q);return this}this.setVisible(true,this.preanim(arguments,0));return this}}}());(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<a;++c){g.push(e.transformElement(d[c]))}return e},invoke:function(g,b){var h=this,d=h.elements,a=d.length,j,c;for(c=0;c<a;c++){j=d[c];if(j){Ext.Element.prototype[g].apply(h.getElement(j),b)}}return h},item:function(b){var d=this,c=d.elements[b],a=null;if(c){a=d.getElement(c)}return a},addListener:function(b,j,h,g){var d=this.elements,a=d.length,c,k;for(c=0;c<a;c++){k=d[c];if(k){Ext.EventManager.on(k,b,j,h||k,g)}}return this},each:function(g,d){var h=this,c=h.elements,a=c.length,b,j;for(b=0;b<a;b++){j=c[b];if(j){j=this.getElement(j);if(g.call(d||j,j,h,b)===false){break}}}return h},fill:function(a){var b=this;b.elements=[];b.add(a);return b},filter:function(a){var b=[],d=this,c=Ext.isFunction(a)?a:function(e){return e.is(a)};d.each(function(h,e,g){if(c(h,g)!==false){b[b.length]=d.transformElement(h)}});d.elements=b;return d},indexOf:function(a){return this.elements.indexOf(this.transformElement(a))},replaceElement:function(e,c,a){var b=!isNaN(e)?e:this.indexOf(e),g;if(b>-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;Ext.CompositeElementLite.importElementMethods=function(){var c,b=Ext.Element.prototype,a=Ext.CompositeElementLite.prototype;for(c in b){if(typeof b[c]=="function"){(function(d){a[d]=a[d]||function(){return this.invoke(d,arguments)}}).call(a,c)}}};Ext.CompositeElementLite.importElementMethods();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;(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='<div class="loading-indicator">'+n.indicatorText+"</div>"}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:Ext.num(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.applyIf(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.util.JSON=new (function(){var useHasOwn=!!{}.hasOwnProperty,isNative=function(){var useNative=null;return function(){if(useNative===null){useNative=Ext.USE_NATIVE_JSON&&window.JSON&&JSON.toString()=="[object JSON]"}return useNative}}(),pad=function(n){return n<10?"0"+n:n},doDecode=function(json){return json?eval("("+json+")"):""},doEncode=function(o){if(!Ext.isDefined(o)||o===null){return"null"}else{if(Ext.isArray(o)){return encodeArray(o)}else{if(Ext.isDate(o)){return Ext.util.JSON.encodeDate(o)}else{if(Ext.isString(o)){return encodeString(o)}else{if(typeof o=="number"){return isFinite(o)?String(o):"null"}else{if(Ext.isBoolean(o)){return String(o)}else{var a=["{"],b,i,v;for(i in o){if(!o.getElementsByTagName){if(!useHasOwn||o.hasOwnProperty(i)){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(doEncode(i),":",v===null?"null":doEncode(v));b=true}}}}a.push("}");return a.join("")}}}}}}},m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},encodeString=function(s){if(/["\\\x00-\x1f]/.test(s)){return'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+s+'"'},encodeArray=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i<l;i+=1){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(v===null?"null":Ext.util.JSON.encode(v));b=true}}a.push("]");return a.join("")};this.encodeDate=function(o){return'"'+o.getFullYear()+"-"+pad(o.getMonth()+1)+"-"+pad(o.getDate())+"T"+pad(o.getHours())+":"+pad(o.getMinutes())+":"+pad(o.getSeconds())+'"'};this.encode=function(){var ec;return function(o){if(!ec){ec=isNative()?JSON.stringify:doEncode}return ec(o)}}();this.decode=function(){var dc;return function(json){if(!dc){dc=isNative()?JSON.parse:doDecode}return dc(json)}}()})();Ext.encode=Ext.util.JSON.encode;Ext.decode=Ext.util.JSON.decode;Ext.EventManager=function(){var z,p,j=false,l=Ext.isGecko||Ext.isWebKit||Ext.isSafari,o=Ext.lib.Event,q=Ext.lib.Dom,c=document,A=window,r="DOMContentLoaded",t="complete",g=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,u=[];function n(E){var H=false,D=0,C=u.length,F=false,G;if(E){if(E.getElementById||E.navigator){for(;D<C;++D){G=u[D];if(G.el===E){H=G.id;break}}if(!H){H=Ext.id(E);u.push({id:H,el:E});F=true}}else{H=Ext.id(E)}if(!Ext.elCache[H]){Ext.Element.addToCache(new Ext.Element(E),H);if(F){Ext.elCache[H].skipGC=true}}}return H}function m(E,G,J,F,D,L){E=Ext.getDom(E);var C=n(E),K=Ext.elCache[C].events,H;H=o.on(E,G,D);K[G]=K[G]||[];K[G].push([J,D,L,H,F]);if(E.addEventListener&&G=="mousewheel"){var I=["DOMMouseScroll",D,false];E.addEventListener.apply(E,I);Ext.EventManager.addListener(A,"unload",function(){E.removeEventListener.apply(E,I)})}if(E==c&&G=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.addListener(D)}}function d(){if(window!=top){return false}try{c.documentElement.doScroll("left")}catch(C){return false}b();return true}function B(C){if(Ext.isIE&&d()){return true}if(c.readyState==t){b();return true}j||(p=setTimeout(arguments.callee,2));return false}var k;function i(C){k||(k=Ext.query("style, link[rel=stylesheet]"));if(k.length==c.styleSheets.length){b();return true}j||(p=setTimeout(arguments.callee,2));return false}function y(C){c.removeEventListener(r,arguments.callee,false);i()}function b(C){if(!j){j=true;if(p){clearTimeout(p)}if(l){c.removeEventListener(r,b,false)}if(Ext.isIE&&B.bindIE){c.detachEvent("onreadystatechange",B)}o.un(A,"load",arguments.callee)}if(z&&!Ext.isReady){Ext.isReady=true;z.fire();z.listeners=[]}}function a(){z||(z=new Ext.util.Event());if(l){c.addEventListener(r,b,false)}if(Ext.isIE){if(!B()){B.bindIE=true;c.attachEvent("onreadystatechange",B)}}else{if(Ext.isOpera){(c.readyState==t&&i())||c.addEventListener(r,y,false)}else{if(Ext.isWebKit){B()}}}o.on(A,"load",b)}function x(C,D){return function(){var E=Ext.toArray(arguments);if(D.target==Ext.EventObject.setEvent(E[0]).target){C.apply(this,E)}}}function w(D,E,C){return function(F){C.delay(E.buffer,D,null,[new Ext.EventObjectImpl(F)])}}function s(G,F,C,E,D){return function(H){Ext.EventManager.removeListener(F,C,E,D);G(H)}}function e(D,E,C){return function(G){var F=new Ext.util.DelayedTask(D);if(!C.tasks){C.tasks=[]}C.tasks.push(F);F.delay(E.delay||10,D,null,[new Ext.EventObjectImpl(G)])}}function h(H,G,C,J,K){var D=(!C||typeof C=="boolean")?{}:C,E=Ext.getDom(H),F;J=J||D.fn;K=K||D.scope;if(!E){throw'Error listening for "'+G+'". Element "'+H+"\" doesn't exist."}function I(M){if(!Ext){return}M=Ext.EventObject.setEvent(M);var L;if(D.delegate){if(!(L=M.getTarget(D.delegate,E))){return}}else{L=M.target}if(D.stopEvent){M.stopEvent()}if(D.preventDefault){M.preventDefault()}if(D.stopPropagation){M.stopPropagation()}if(D.normalized===false){M=M.browserEvent}J.call(K||E,M,L,D)}if(D.target){I=x(I,D)}if(D.delay){I=e(I,D,J)}if(D.single){I=s(I,E,G,J,K)}if(D.buffer){F=new Ext.util.DelayedTask(I);I=w(I,D,F)}m(E,G,J,F,I,K);return I}var v={addListener:function(E,C,G,F,D){if(typeof C=="object"){var J=C,H,I;for(H in J){I=J[H];if(!g.test(H)){if(Ext.isFunction(I)){h(E,H,J,I,J.scope)}else{h(E,H,I)}}}}else{h(E,C,D,G,F)}},removeListener:function(E,I,M,N){E=Ext.getDom(E);var C=n(E),K=E&&(Ext.elCache[C].events)[I]||[],D,H,F,G,J,L;for(H=0,J=K.length;H<J;H++){if(Ext.isArray(L=K[H])&&L[0]==M&&(!N||L[2]==N)){if(L[4]){L[4].cancel()}G=M.tasks&&M.tasks.length;if(G){while(G--){M.tasks[G].cancel()}delete M.tasks}D=L[1];o.un(E,I,o.extAdapter?L[3]:D);if(D&&E.addEventListener&&I=="mousewheel"){E.removeEventListener("DOMMouseScroll",D,false)}if(D&&E==c&&I=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.removeListener(D)}K.splice(H,1);if(K.length===0){delete Ext.elCache[C].events[I]}for(G in Ext.elCache[C].events){return false}Ext.elCache[C].events={};return false}}},removeAll:function(E){E=Ext.getDom(E);var D=n(E),J=Ext.elCache[D]||{},M=J.events||{},I,H,K,F,L,G,C;for(F in M){if(M.hasOwnProperty(F)){I=M[F];for(H=0,K=I.length;H<K;H++){L=I[H];if(L[4]){L[4].cancel()}if(L[0].tasks&&(G=L[0].tasks.length)){while(G--){L[0].tasks[G].cancel()}delete L.tasks}C=L[1];o.un(E,F,o.extAdapter?L[3]:C);if(E.addEventListener&&C&&F=="mousewheel"){E.removeEventListener("DOMMouseScroll",C,false)}if(C&&E==c&&F=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.removeListener(C)}}}}if(Ext.elCache[D]){Ext.elCache[D].events={}}},getListeners:function(F,C){F=Ext.getDom(F);var H=n(F),D=Ext.elCache[H]||{},G=D.events||{},E=[];if(G&&G[C]){return G[C]}else{return null}},purgeElement:function(E,C,G){E=Ext.getDom(E);var D=n(E),J=Ext.elCache[D]||{},K=J.events||{},F,I,H;if(G){if(K&&K.hasOwnProperty(G)){I=K[G];for(F=0,H=I.length;F<H;F++){Ext.EventManager.removeListener(E,G,I[F][0])}}}else{Ext.EventManager.removeAll(E)}if(C&&E&&E.childNodes){for(F=0,H=E.childNodes.length;F<H;F++){Ext.EventManager.purgeElement(E.childNodes[F],C,G)}}},_unload:function(){var C;for(C in Ext.elCache){Ext.EventManager.removeAll(C)}delete Ext.elCache;delete Ext.Element._flyweights;var G,D,F,E=Ext.lib.Ajax;(typeof E.conn=="object")?D=E.conn:D={};for(F in D){G=D[F];if(G){E.abort({conn:G,tId:F})}}},onDocumentReady:function(E,D,C){if(Ext.isReady){z||(z=new Ext.util.Event());z.addListener(E,D,C);z.fire();z.listeners=[]}else{if(!z){a()}C=C||{};C.delay=C.delay||1;z.addListener(E,D,C)}},fireDocReady:b};v.on=v.addListener;v.un=v.removeListener;v.stoppedMouseDownEvent=new Ext.util.Event();return v}();Ext.onReady=Ext.EventManager.onDocumentReady;(function(){var a=function(){var c=document.body||document.getElementsByTagName("body")[0];if(!c){return false}var b=[" ",Ext.isIE?"ext-ie "+(Ext.isIE6?"ext-ie6":(Ext.isIE7?"ext-ie7":(Ext.isIE8?"ext-ie8":"ext-ie9"))):Ext.isGecko?"ext-gecko "+(Ext.isGecko2?"ext-gecko2":"ext-gecko3"):Ext.isOpera?"ext-opera":Ext.isWebKit?"ext-webkit":""];if(Ext.isSafari){b.push("ext-safari "+(Ext.isSafari2?"ext-safari2":(Ext.isSafari3?"ext-safari3":"ext-safari4")))}else{if(Ext.isChrome){b.push("ext-chrome")}}if(Ext.isMac){b.push("ext-mac")}if(Ext.isLinux){b.push("ext-linux")}if(Ext.isStrict||Ext.isBorderBox){var d=c.parentNode;if(d){if(!Ext.isStrict){Ext.fly(d,"_internal").addClass("x-quirks");if(Ext.isIE&&!Ext.isStrict){Ext.isIEQuirks=true}}Ext.fly(d,"_internal").addClass(((Ext.isStrict&&Ext.isIE)||(!Ext.enableForcedBoxModel&&!Ext.isIE))?" ext-strict":" ext-border-box")}}if(Ext.enableForcedBoxModel&&!Ext.isIE){Ext.isForcedBorderBox=true;b.push("ext-forced-border-box")}Ext.fly(c,"_internal").addClass(b);return true};if(!a()){Ext.onReady(a)}})();(function(){var b=Ext.apply(Ext.supports,{correctRightMargin:true,correctTransparentColor:true,cssFloat:true});var a=function(){var g=document.createElement("div"),e=document,c,d;g.innerHTML='<div style="height:30px;width:50px;"><div style="height:20px;width:20px;"></div></div><div style="float:left;background-color:transparent;">';e.body.appendChild(g);d=g.lastChild;if((c=e.defaultView)){if(c.getComputedStyle(g.firstChild.firstChild,null).marginRight!="0px"){b.correctRightMargin=false}if(c.getComputedStyle(d,null).backgroundColor!="transparent"){b.correctTransparentColor=false}}b.cssFloat=!!d.style.cssFloat;e.body.removeChild(g)};if(Ext.isReady){a()}else{Ext.onReady(a)}})();Ext.EventObject=function(){var b=Ext.lib.Event,c=/(dbl)?click/,a={3:13,63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35},d=Ext.isIE?{1:0,4:1,2:2}:{0:0,1:1,2:2};Ext.EventObjectImpl=function(g){if(g){this.setEvent(g.browserEvent||g)}};Ext.EventObjectImpl.prototype={setEvent:function(h){var g=this;if(h==g||(h&&h.browserEvent)){return h}g.browserEvent=h;if(h){g.button=h.button?d[h.button]:(h.which?h.which-1:-1);if(c.test(h.type)&&g.button==-1){g.button=0}g.type=h.type;g.shiftKey=h.shiftKey;g.ctrlKey=h.ctrlKey||h.metaKey||false;g.altKey=h.altKey;g.keyCode=h.keyCode;g.charCode=h.charCode;g.target=b.getTarget(h);g.xy=b.getXY(h)}else{g.button=-1;g.shiftKey=false;g.ctrlKey=false;g.altKey=false;g.keyCode=0;g.charCode=0;g.target=null;g.xy=[0,0]}return g},stopEvent:function(){var e=this;if(e.browserEvent){if(e.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(e)}b.stopEvent(e.browserEvent)}},preventDefault:function(){if(this.browserEvent){b.preventDefault(this.browserEvent)}},stopPropagation:function(){var e=this;if(e.browserEvent){if(e.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(e)}b.stopPropagation(e.browserEvent)}},getCharCode:function(){return this.charCode||this.keyCode},getKey:function(){return this.normalizeKey(this.keyCode||this.charCode)},normalizeKey:function(e){return Ext.isSafari?(a[e]||e):e},getPageX:function(){return this.xy[0]},getPageY:function(){return this.xy[1]},getXY:function(){return this.xy},getTarget:function(g,h,e){return g?Ext.fly(this.target).findParent(g,h,e):(e?Ext.get(this.target):this.target)},getRelatedTarget:function(){return this.browserEvent?b.getRelatedTarget(this.browserEvent):null},getWheelDelta:function(){var g=this.browserEvent;var h=0;if(g.wheelDelta){h=g.wheelDelta/120}else{if(g.detail){h=-g.detail/3}}return h},within:function(h,i,e){if(h){var g=this[i?"getRelatedTarget":"getTarget"]();return g&&((e?(g==Ext.getDom(h)):false)||Ext.fly(h).contains(g))}return false}};return new Ext.EventObjectImpl()}();Ext.Loader=Ext.apply({},{load:function(j,i,k,c){var k=k||this,g=document.getElementsByTagName("head")[0],b=document.createDocumentFragment(),a=j.length,h=0,e=this;var l=function(m){g.appendChild(e.buildScriptTag(j[m],d))};var d=function(){h++;if(a==h&&typeof i=="function"){i.call(k)}else{if(c===true){l(h)}}};if(c===true){l.call(this,0)}else{Ext.each(j,function(n,m){b.appendChild(this.buildScriptTag(n,d))},this);g.appendChild(b)}},buildScriptTag:function(b,c){var a=document.createElement("script");a.type="text/javascript";a.src=b;if(a.readyState){a.onreadystatechange=function(){if(a.readyState=="loaded"||a.readyState=="complete"){a.onreadystatechange=null;c()}}}else{a.onload=c}return a}});Ext.ns("Ext.grid","Ext.list","Ext.dd","Ext.tree","Ext.form","Ext.menu","Ext.state","Ext.layout.boxOverflow","Ext.app","Ext.ux","Ext.chart","Ext.direct","Ext.slider");Ext.apply(Ext,function(){var c=Ext,a=0,b=null;return{emptyFn:function(){},BLANK_IMAGE_URL:Ext.isIE6||Ext.isIE7||Ext.isAir?"http://www.extjs.com/s.gif":"data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",extendX:function(d,e){return Ext.extend(d,e(d.prototype))},getDoc:function(){return Ext.get(document)},num:function(e,d){e=Number(Ext.isEmpty(e)||Ext.isArray(e)||typeof e=="boolean"||(typeof e=="string"&&e.trim().length==0)?NaN:e);return isNaN(e)?d:e},value:function(g,d,e){return Ext.isEmpty(g,e)?d:g},escapeRe:function(d){return d.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},sequence:function(h,d,g,e){h[d]=h[d].createSequence(g,e)},addBehaviors:function(i){if(!Ext.isReady){Ext.onReady(function(){Ext.addBehaviors(i)})}else{var e={},h,d,g;for(d in i){if((h=d.split("@"))[1]){g=h[0];if(!e[g]){e[g]=Ext.select(g)}e[g].on(h[1],i[d])}}e=null}},getScrollBarWidth:function(g){if(!Ext.isReady){return 0}if(g===true||b===null){var i=Ext.getBody().createChild('<div class="x-hide-offsets" style="width:100px;height:50px;overflow:hidden;"><div style="height:200px;"></div></div>'),h=i.child("div",true);var e=h.offsetWidth;i.setStyle("overflow",(Ext.isWebKit||Ext.isGecko)?"auto":"scroll");var d=h.offsetWidth;i.remove();b=e-d+2}return b},combine:function(){var g=arguments,e=g.length,j=[];for(var h=0;h<e;h++){var d=g[h];if(Ext.isArray(d)){j=j.concat(d)}else{if(d.length!==undefined&&!d.substr){j=j.concat(Array.prototype.slice.call(d,0))}else{j.push(d)}}}return j},copyTo:function(d,e,g){if(typeof g=="string"){g=g.split(/[,;\s]/)}Ext.each(g,function(h){if(e.hasOwnProperty(h)){d[h]=e[h]}},this);return d},destroy:function(){Ext.each(arguments,function(d){if(d){if(Ext.isArray(d)){this.destroy.apply(this,d)}else{if(typeof d.destroy=="function"){d.destroy()}else{if(d.dom){d.remove()}}}}},this)},destroyMembers:function(l,j,g,h){for(var k=1,e=arguments,d=e.length;k<d;k++){Ext.destroy(l[e[k]]);delete l[e[k]]}},clean:function(d){var e=[];Ext.each(d,function(g){if(!!g){e.push(g)}});return e},unique:function(d){var e=[],g={};Ext.each(d,function(h){if(!g[h]){e.push(h)}g[h]=true});return e},flatten:function(d){var g=[];function e(h){Ext.each(h,function(i){if(Ext.isArray(i)){e(i)}else{g.push(i)}});return g}return e(d)},min:function(d,e){var g=d[0];e=e||function(i,h){return i<h?-1:1};Ext.each(d,function(h){g=e(g,h)==-1?g:h});return g},max:function(d,e){var g=d[0];e=e||function(i,h){return i>h?1:-1};Ext.each(d,function(h){g=e(g,h)==1?g:h});return g},mean:function(d){return d.length>0?Ext.sum(d)/d.length:undefined},sum:function(d){var e=0;Ext.each(d,function(g){e+=g});return e},partition:function(d,e){var g=[[],[]];Ext.each(d,function(j,k,h){g[(e&&e(j,k,h))||(!e&&j)?0:1].push(j)});return g},invoke:function(d,e){var h=[],g=Array.prototype.slice.call(arguments,2);Ext.each(d,function(j,k){if(j&&typeof j[e]=="function"){h.push(j[e].apply(j,g))}else{h.push(undefined)}});return h},pluck:function(d,g){var e=[];Ext.each(d,function(h){e.push(h[g])});return e},zip:function(){var n=Ext.partition(arguments,function(i){return typeof i!="function"}),k=n[0],m=n[1][0],d=Ext.max(Ext.pluck(k,"length")),h=[];for(var l=0;l<d;l++){h[l]=[];if(m){h[l]=m.apply(m,Ext.pluck(k,l))}else{for(var g=0,e=k.length;g<e;g++){h[l].push(k[g][l])}}}return h},getCmp:function(d){return Ext.ComponentMgr.get(d)},useShims:c.isIE6||(c.isMac&&c.isGecko2),type:function(e){if(e===undefined||e===null){return false}if(e.htmlElement){return"element"}var d=typeof e;if(d=="object"&&e.nodeName){switch(e.nodeType){case 1:return"element";case 3:return(/\S/).test(e.nodeValue)?"textnode":"whitespace"}}if(d=="object"||d=="function"){switch(e.constructor){case Array:return"array";case RegExp:return"regexp";case Date:return"date"}if(typeof e.length=="number"&&typeof e.item=="function"){return"nodelist"}}return d},intercept:function(h,d,g,e){h[d]=h[d].createInterceptor(g,e)},callback:function(d,h,g,e){if(typeof d=="function"){if(e){d.defer(e,h,g||[])}else{d.apply(h,g||[])}}}}}());Ext.apply(Function.prototype,{createSequence:function(b,a){var c=this;return(typeof b!="function")?this:function(){var d=c.apply(this||window,arguments);b.apply(a||this||window,arguments);return d}}});Ext.applyIf(String,{escape:function(a){return a.replace(/('|\\)/g,"\\$1")},leftPad:function(d,b,c){var a=String(d);if(!c){c=" "}while(a.length<b){a=c+a}return a}});String.prototype.toggle=function(b,a){return this==b?a:b};String.prototype.trim=function(){var a=/^\s+|\s+$/g;return function(){return this.replace(a,"")}}();Date.prototype.getElapsed=function(a){return Math.abs((a||new Date()).getTime()-this.getTime())};Ext.applyIf(Number.prototype,{constrain:function(b,a){return Math.min(Math.max(this,b),a)}});Ext.lib.Dom.getRegion=function(a){return Ext.lib.Region.getRegion(a)};Ext.lib.Region=function(d,g,a,c){var e=this;e.top=d;e[1]=d;e.right=g;e.bottom=a;e.left=c;e[0]=c};Ext.lib.Region.prototype={contains:function(b){var a=this;return(b.left>=a.left&&b.right<=a.right&&b.top>=a.top&&b.bottom<=a.bottom)},getArea:function(){var a=this;return((a.bottom-a.top)*(a.right-a.left))},intersect:function(h){var g=this,d=Math.max(g.top,h.top),e=Math.min(g.right,h.right),a=Math.min(g.bottom,h.bottom),c=Math.max(g.left,h.left);if(a>=d&&e>=c){return new Ext.lib.Region(d,e,a,c)}},union:function(h){var g=this,d=Math.min(g.top,h.top),e=Math.max(g.right,h.right),a=Math.max(g.bottom,h.bottom),c=Math.min(g.left,h.left);return new Ext.lib.Region(d,e,a,c)},constrainTo:function(b){var a=this;a.top=a.top.constrain(b.top,b.bottom);a.bottom=a.bottom.constrain(b.top,b.bottom);a.left=a.left.constrain(b.left,b.right);a.right=a.right.constrain(b.left,b.right);return a},adjust:function(d,c,a,g){var e=this;e.top+=d;e.left+=c;e.right+=g;e.bottom+=a;return e}};Ext.lib.Region.getRegion=function(e){var h=Ext.lib.Dom.getXY(e),d=h[1],g=h[0]+e.offsetWidth,a=h[1]+e.offsetHeight,c=h[0];return new Ext.lib.Region(d,g,a,c)};Ext.lib.Point=function(a,c){if(Ext.isArray(a)){c=a[1];a=a[0]}var b=this;b.x=b.right=b.left=b[0]=a;b.y=b.top=b.bottom=b[1]=c};Ext.lib.Point.prototype=new Ext.lib.Region();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;q<n;q++){c(j[q],k)}}else{if(typeof j=="string"){k=u.createTextNode(j)}else{k=u.createElement(j.tag||"div");p=!!k.setAttribute;for(var s in j){if(!b.test(s)){m=j[s];if(s=="cls"){k.className=m}else{if(p){k.setAttribute(s,m)}else{k[s]=m}}}}Ext.DomHelper.applyStyles(k,j.style);if((t=j.children||j.cn)){c(t,k)}else{if(j.html){k.innerHTML=j.html}}}}if(r){r.appendChild(k)}return k}e={createTemplate:function(k){var j=Ext.DomHelper.createHtml(k);return new Ext.Template(j)},useDom:false,insertBefore:function(j,l,k){return g(j,l,k,i)},insertAfter:function(j,l,k){return g(j,l,k,h,"nextSibling")},insertFirst:function(j,l,k){return g(j,l,k,a,"firstChild")},append:function(j,l,k){return g(j,l,k,d,"",true)},createDom:c};return e}());Ext.apply(Ext.Template.prototype,{disableFormats:false,re:/\{([\w\-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,argsRe:/^\s*['"](.*)["']\s*$/,compileARe:/\\/g,compileBRe:/(\r\n|\n)/g,compileCRe:/'/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=g.argsRe;k=k.split(",");for(var n=0,h=k.length;n<h;n++){k[n]=k[n].replace(o,"$1")}k=[b[l]].concat(k)}else{k=[b[l]]}return e[p].apply(e,k)}}else{return b[l]!==undefined?b[l]:""}}return g.html.replace(g.re,d)},compile:function(){var me=this,fm=Ext.util.Format,useF=me.disableFormats!==true,sep=Ext.isGecko?"+":",",body;function fn(m,name,format,args){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="(values['"+name+"'] == undefined ? '' : "}return"'"+sep+format+"values['"+name+"']"+args+")"+sep+"'"}if(Ext.isGecko){body="this.compiled = function(values){ return '"+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(me.compileARe,"\\\\").replace(me.compileBRe,"\\n").replace(me.compileCRe,"\\'").replace(me.re,fn));body.push("'].join('');};");body=body.join("")}eval(body);return me},call:function(c,b,a){return this[c](b,a)}});Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.util.Functions={createInterceptor:function(c,b,a){var d=c;if(!Ext.isFunction(b)){return c}else{return function(){var g=this,e=arguments;b.target=g;b.method=c;return(b.apply(a||g||window,e)!==false)?c.apply(g||window,e):null}}},createDelegate:function(c,d,b,a){if(!Ext.isFunction(c)){return c}return function(){var g=b||arguments;if(a===true){g=Array.prototype.slice.call(arguments,0);g=g.concat(b)}else{if(Ext.isNumber(a)){g=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(g,e)}}return c.apply(d||window,g)}},defer:function(d,c,e,b,a){d=Ext.util.Functions.createDelegate(d,e,b,a);if(c>0){return setTimeout(d,c)}d();return 0},createSequence:function(c,b,a){if(!Ext.isFunction(b)){return c}else{return function(){var d=c.apply(this||window,arguments);b.apply(a||this||window,arguments);return d}}}};Ext.defer=Ext.util.Functions.defer;Ext.createInterceptor=Ext.util.Functions.createInterceptor;Ext.createSequence=Ext.util.Functions.createSequence;Ext.createDelegate=Ext.util.Functions.createDelegate;Ext.apply(Ext.util.Observable.prototype,function(){function a(j){var i=(this.methodEvents=this.methodEvents||{})[j],d,c,g,h=this;if(!i){this.methodEvents[j]=i={};i.originalFn=this[j];i.methodName=j;i.before=[];i.after=[];var b=function(l,k,e){if((c=l.apply(k||h,e))!==undefined){if(typeof c=="object"){if(c.returnValue!==undefined){d=c.returnValue}else{d=c}g=!!c.cancel}else{if(c===false){g=true}else{d=c}}}};this[j]=function(){var l=Array.prototype.slice.call(arguments,0),k;d=c=undefined;g=false;for(var m=0,e=i.before.length;m<e;m++){k=i.before[m];b(k.fn,k.scope,l);if(g){return d}}if((c=i.originalFn.apply(h,l))!==undefined){d=c}for(var m=0,e=i.after.length;m<e;m++){k=i.after[m];b(k.fn,k.scope,l);if(g){return d}}return d}}return i}return{beforeMethod:function(d,c,b){a.call(this,d).before.push({fn:c,scope:b})},afterMethod:function(d,c,b){a.call(this,d).after.push({fn:c,scope:b})},removeMethodListener:function(j,g,d){var h=this.getMethodEvent(j);for(var c=0,b=h.before.length;c<b;c++){if(h.before[c].fn==g&&h.before[c].scope==d){h.before.splice(c,1);return}}for(var c=0,b=h.after.length;c<b;c++){if(h.after[c].fn==g&&h.after[c].scope==d){h.after.splice(c,1);return}}},relayEvents:function(j,e){var h=this;function g(i){return function(){return h.fireEvent.apply(h,[i].concat(Array.prototype.slice.call(arguments,0)))}}for(var d=0,b=e.length;d<b;d++){var c=e[d];h.events[c]=h.events[c]||true;j.on(c,g(c),h)}},enableBubble:function(e){var g=this;if(!Ext.isEmpty(e)){e=Ext.isArray(e)?e:Array.prototype.slice.call(arguments,0);for(var d=0,b=e.length;d<b;d++){var c=e[d];c=c.toLowerCase();var h=g.events[c]||true;if(typeof h=="boolean"){h=new Ext.util.Event(g,c);g.events[c]=h}h.bubble=true}}}}}());Ext.util.Observable.capture=function(c,b,a){c.fireEvent=c.fireEvent.createInterceptor(b,a)};Ext.util.Observable.observeClass=function(b,a){if(b){if(!b.fireEvent){Ext.apply(b,new Ext.util.Observable());Ext.util.Observable.capture(b.prototype,b.fireEvent,b)}if(typeof a=="object"){b.on(a)}return b}};Ext.apply(Ext.EventManager,function(){var d,k,g,b,a=Ext.lib.Dom,j=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,c=Ext.EventManager._unload,i=0,h=0,e=Ext.isWebKit?Ext.num(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1])>=525:!((Ext.isGecko&&!Ext.isWindows)||Ext.isOpera);return{_unload:function(){Ext.EventManager.un(window,"resize",this.fireWindowResize,this);c.call(Ext.EventManager)},doResizeEvent:function(){var m=a.getViewHeight(),l=a.getViewWidth();if(h!=m||i!=l){d.fire(i=l,h=m)}},onWindowResize:function(n,m,l){if(!d){d=new Ext.util.Event();k=new Ext.util.DelayedTask(this.doResizeEvent);Ext.EventManager.on(window,"resize",this.fireWindowResize,this)}d.addListener(n,m,l)},fireWindowResize:function(){if(d){k.delay(100)}},onTextResize:function(o,n,l){if(!g){g=new Ext.util.Event();var m=new Ext.Element(document.createElement("div"));m.dom.className="x-text-resize";m.dom.innerHTML="X";m.appendTo(document.body);b=m.dom.offsetHeight;setInterval(function(){if(m.dom.offsetHeight!=b){g.fire(b,b=m.dom.offsetHeight)}},this.textResizeInterval)}g.addListener(o,n,l)},removeResizeListener:function(m,l){if(d){d.removeListener(m,l)}},fireResize:function(){if(d){d.fire(a.getViewWidth(),a.getViewHeight())}},textResizeInterval:50,ieDeferSrc:false,getKeyEvent:function(){return e?"keydown":"keypress"},useKeydown:e}}());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)}});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+='<span id="'+id+'"></span>';Ext.lib.Event.onAvailable(id,function(){var DOC=document,hd=DOC.getElementsByTagName("head")[0],re=/(?:<script([^>]*)?>)((\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(/(?:<script.*?>)((\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(n<E){n=z?v.right:E}if(l+F>G+D){l=u?v.top-F:G+D-F}if(l<D){l=u?v.bottom:D}}return[n,l]},alignTo:function(c,a,e,b){var d=this;return d.setXY(d.getAlignToXY(c,a,e),d.preanim&&!!b?d.preanim(arguments,3):false)},adjustForConstraints:function(c,a,b){return this.getConstrainToXY(a||document,false,b,c)||c},getConstrainToXY:function(b,a,c,e){var d={top:0,left:0,bottom:0,right:0};return function(i,A,l,n){i=Ext.get(i);l=l?Ext.applyIf(l,d):d;var z,D,v=0,u=0;if(i.dom==document.body||i.dom==document){z=Ext.lib.Dom.getViewWidth();D=Ext.lib.Dom.getViewHeight()}else{z=i.dom.clientWidth;D=i.dom.clientHeight;if(!A){var t=i.getXY();v=t[0];u=t[1]}}var r=i.getScroll();v+=l.left+r.left;u+=l.top+r.top;z-=l.right;D-=l.bottom;var B=v+z,g=u+D,j=n||(!A?this.getXY():[this.getLeft(true),this.getTop(true)]),p=j[0],o=j[1],k=this.getConstrainOffset(),q=this.dom.offsetWidth+k,C=this.dom.offsetHeight+k;var m=false;if((p+q)>B){p=B-q;m=true}if((o+C)>g){o=g-C;m=true}if(p<v){p=v;m=true}if(o<u){o=u;m=true}return m?[p,o]:false}}(),getConstrainOffset:function(){return 0},getCenterXY:function(){return this.getAlignToXY(document,"c-c")},center:function(a){return this.alignTo(a||document,"c-c")}});Ext.Element.addMethods({select:function(a,b){return Ext.Element.select(a,b,this.dom)}});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.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>';Ext.Element.addMethods(function(){var a="_internal",b=/(\d+\.?\d+)px/;return{applyStyles:function(c){Ext.DomHelper.applyStyles(this.dom,c);return this},getStyles:function(){var c={};Ext.each(arguments,function(d){c[d]=this.getStyle(d)},this);return c},setOverflow:function(c){var d=this.dom;if(c=="auto"&&Ext.isMac&&Ext.isGecko2){d.style.overflow="hidden";(function(){d.style.overflow="auto"}).defer(1)}else{d.style.overflow=c}},boxWrap:function(c){c=c||"x-box";var d=Ext.get(this.insertHtml("beforeBegin","<div class='"+c+"'>"+String.format(Ext.Element.boxMarkup,c)+"</div>"));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)}}}}());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({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||u<m){p.scrollTop=u}else{if(q>j){p.scrollTop=q-a}}p.scrollTop=p.scrollTop;if(i!==false){if(h.offsetWidth>p.clientWidth||k<s){p.scrollLeft=k}else{if(d>n){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 false}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.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)}});Ext.CompositeElementLite.importElementMethods();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;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='<div class="loading-indicator">'+h.text+"</div>"}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:'<div class="loading-indicator">Loading...</div>',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()]},formatContainsHourInfo:(function(){var d=/(\\.)/g,c=/([gGhHisucUOPZ]|M\$)/;return function(e){return c.test(e.replace(d,""))}})(),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:"String.leftPad(this.getFullYear(), 4, '0')",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<d;++g){var j=k.charAt(g);h.push(j=="T"?"'T'":Date.getFormatCode(j))}return h.join(" + ")},U:"Math.round(this.getTime() / 1000)"},isValid:function(o,c,n,k,g,j,e){k=k||0;g=g||0;j=j||0;e=e||0;var l=new Date(o<100?100:o,c-1,n,k,g,j,e).add(Date.YEAR,o<100?o-100:0);return o==l.getFullYear()&&c==l.getMonth()+1&&n==l.getDate()&&k==l.getHours()&&g==l.getMinutes()&&j==l.getSeconds()&&e==l.getMilliseconds()},parseDate:function(d,g,c){var e=Date.parseFunctions;if(e[g]==null){Date.createParser(g)}return e[g](d,Ext.isDefined(c)?c:Date.useStrict)},getFormatCode:function(d){var c=Date.formatCodes[d];if(c){c=typeof c=="function"?c():c;Date.formatCodes[d]=c}return c||("'"+String.escape(d)+"'")},createFormat:function(h){var g=[],c=false,e="";for(var d=0;d<h.length;++d){e=h.charAt(d);if(!c&&e=="\\"){c=true}else{if(c){c=false;g.push("'"+String.escape(e)+"'")}else{g.push(Date.getFormatCode(e))}}}Date.formatFunctions[h]=new Function("return "+g.join("+"))},createParser:function(){var c=["var dt, y, m, d, h, i, s, ms, o, z, zz, u, v,","def = Date.defaults,","results = String(input).match(Date.parseRegexes[{0}]);","if(results){","{1}","if(u != null){","v = new Date(u * 1000);","}else{","dt = (new Date()).clearTime();","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()));","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){","v = new Date(y < 100 ? 100 : y, 0, 1, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0);","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 < 100 ? 100 : y, m, d, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0);","}","}","}","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,o=1,g=[],l=[],k=false,d="",j=0,h,n;for(;j<m.length;++j){d=m.charAt(j);if(!k&&d=="\\"){k=true}else{if(k){k=false;l.push(String.escape(d))}else{h=a(d,o);o+=h.g;l.push(h.s);if(h.g&&h.c){if(h.calcLast){n=h.c}else{g.push(h.c)}}}}}if(n){g.push(n)}Date.parseRegexes[e]=new RegExp("^"+l.join("")+"$","i");Date.parseFunctions[m]=new Function("input","strict",b(c,e,g.join("")))}}(),parseCodes:{d:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},j:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},D:function(){for(var c=[],d=0;d<7;c.push(Date.getShortDayName(d)),++d){}return{g:0,c:null,s:"(?:"+c.join("|")+")"}},l:function(){return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"}},N:{g:0,c:null,s:"[1-7]"},S:{g:0,c:null,s:"(?:st|nd|rd|th)"},w:{g:0,c:null,s:"[0-6]"},z:{g:1,c:"z = parseInt(results[{0}], 10);\n",s:"(\\d{1,3})"},W:{g:0,c:null,s:"(?:\\d{2})"},F:function(){return{g:1,c:"m = parseInt(Date.getMonthNumber(results[{0}]), 10);\n",s:"("+Date.monthNames.join("|")+")"}},M:function(){for(var c=[],d=0;d<12;c.push(Date.getShortMonthName(d)),++d){}return Ext.applyIf({s:"("+c.join("|")+")"},a("F"))},m:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{2})"},n:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{1,2})"},t:{g:0,c:null,s:"(?:\\d{2})"},L:{g:0,c:null,s:"(?:1|0)"},o:function(){return a("Y")},Y:{g:1,c:"y = parseInt(results[{0}], 10);\n",s:"(\\d{4})"},y:{g:1,c:"var ty = parseInt(results[{0}], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"},a:function(){return a("A")},A:{calcLast:true,g:1,c:"if (/(am)/i.test(results[{0}])) {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(AM|PM|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;g<d;++g){e.push(c[g].c)}return{g:1,c:e.join(""),s:[c[0].s,"(?:","-",c[1].s,"(?:","-",c[2].s,"(?:","(?:T| )?",c[3].s,":",c[4].s,"(?::",c[5].s,")?","(?:(?:\\.|,)(\\d+))?","(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?",")?",")?",")?"].join("")}},U:{g:1,c:"u = parseInt(results[{0}], 10);\n",s:"(-?\\d+)"}}})}());Ext.apply(Date.prototype,{dateFormat:function(a){if(Date.formatFunctions[a]==null){Date.createFormat(a)}return Date.formatFunctions[a].call(this)},getTimezone:function(){return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/,"$1$2").replace(/[^A-Z]/g,"")},getGMTOffset:function(a){return(this.getTimezoneOffset()>0?"-":"+")+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);c<a;e.setMonth(++c)){b+=e.getDaysInMonth()}return b+this.getDate()-1},getWeekOfYear:function(){var a=86400000,b=7*a;return function(){var d=Date.UTC(this.getFullYear(),this.getMonth(),this.getDate()+3)/a,c=Math.floor(d/7),e=new Date(c*b).getUTCFullYear();return c-Math.floor(Date.UTC(e,0,7)/b)+1}}(),isLeapYear:function(){var a=this.getFullYear();return !!((a&3)==0&&(a%100||(a%400==0&&a)))},getFirstDayOfMonth:function(){var a=(this.getDay()-(this.getDate()-1))%7;return(a<0)?(a+7):a},getLastDayOfMonth:function(){return this.getLastDateOfMonth().getDay()},getFirstDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),1)},getLastDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),this.getDaysInMonth())},getDaysInMonth:function(){var a=[31,28,31,30,31,30,31,31,30,31,30,31];return function(){var b=this.getMonth();return b==1&&this.isLeapYear()?29:a[b]}}(),getSuffix:function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}},clone:function(){return new Date(this.getTime())},isDST:function(){return new Date(this.getFullYear(),0,1).getTimezoneOffset()!=this.getTimezoneOffset()},clearTime:function(g){if(g){return this.clone().clearTime()}var b=this.getDate();this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);if(this.getDate()!=b){for(var a=1,e=this.add(Date.HOUR,a);e.getDate()!=b;a++,e=this.add(Date.HOUR,a)){}this.setDate(b);this.setHours(e.getHours())}return this},add:function(b,c){var e=this.clone();if(!b||c===0){return e}switch(b.toLowerCase()){case Date.MILLI:e.setMilliseconds(this.getMilliseconds()+c);break;case Date.SECOND:e.setSeconds(this.getSeconds()+c);break;case Date.MINUTE:e.setMinutes(this.getMinutes()+c);break;case Date.HOUR:e.setHours(this.getHours()+c);break;case Date.DAY:e.setDate(this.getDate()+c);break;case Date.MONTH:var a=this.getDate();if(a>28){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<a;d++){this.add(b[d])}}else{for(var c in e){if(this.allowFunctions||typeof e[c]!="function"){this.add(c,e[c])}}}},each:function(e,d){var b=[].concat(this.items);for(var c=0,a=b.length;c<a;c++){if(e.call(d||b[c],b[c],c,a)===false){break}}},eachKey:function(d,c){for(var b=0,a=this.keys.length;b<a;b++){d.call(c||window,this.keys[b],this.items[b],b,a)}},find:function(d,c){for(var b=0,a=this.items.length;b<a;b++){if(d.call(c||window,this.items[b],this.keys[b])){return this.items[b]}}return null},insert:function(a,b,c){if(arguments.length==2){c=arguments[1];b=this.getKey(c)}if(this.containsKey(b)){this.suspendEvents();this.removeKey(b);this.resumeEvents()}if(a>=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<this.length&&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;d<e;d++){h[h.length]={key:l[d],value:g[d],index:d}}h.sort(function(i,c){var m=j(i[k],c[k])*b;if(m===0){m=(i.index<c.index?-1:1)}return m});for(d=0,e=h.length;d<e;d++){g[d]=h[d].value;l[d]=h[d].key}this.fireEvent("sort",this)},sort:function(a,b){this._sort("value",a,b)},reorder:function(d){this.suspendEvents();var b=this.items,c=0,g=b.length,a=[],e=[],h;for(h in d){a[d[h]]=b[h]}for(c=0;c<g;c++){if(d[c]==undefined){e.push(b[c])}}for(c=0;c<g;c++){if(a[c]==undefined){a[c]=e.shift()}}this.clear();this.addAll(a);this.resumeEvents();this.fireEvent("sort",this)},keySort:function(a,b){this._sort("key",a,b||function(d,c){var g=String(d).toUpperCase(),e=String(c).toUpperCase();return g>e?1:(g<e?-1:0)})},getRange:function(e,a){var b=this.items;if(b.length<1){return[]}e=e||0;a=Math.min(typeof a=="undefined"?this.length-1:a,this.length-1);var c,d=[];if(e<=a){for(c=e;c<=a;c++){d[d.length]=b[c]}}else{for(c=e;c>=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<a;c++){if(g.call(e||this,d[c],b[c])){h.add(b[c],d[c])}}return h},findIndex:function(c,b,e,d,a){if(Ext.isEmpty(b,false)){return -1}b=this.createValueMatcher(b,d,a);return this.findIndexBy(function(g){return g&&b.test(g[c])},null,e)},findIndexBy:function(g,e,h){var b=this.keys,d=this.items;for(var c=(h||0),a=d.length;c<a;c++){if(g.call(e||this,d[c],b[c])){return c}}return -1},createValueMatcher:function(c,e,a,b){if(!c.exec){var d=Ext.escapeRe;c=String(c);if(e===true){c=d(c)}else{c="^"+d(c);if(b===true){c+="$"}}c=new RegExp(c,a?"":"i")}return c},clone:function(){var e=new Ext.util.MixedCollection();var b=this.keys,d=this.items;for(var c=0,a=d.length;c<a;c++){e.add(b[c],d[c])}e.getKey=this.getKey;return e}});Ext.util.MixedCollection.prototype.get=Ext.util.MixedCollection.prototype.item;Ext.AbstractManager=Ext.extend(Object,{typeName:"type",constructor:function(a){Ext.apply(this,a||{});this.all=new Ext.util.MixedCollection();this.types={}},get:function(a){return this.all.get(a)},register:function(a){this.all.add(a)},unregister:function(a){this.all.remove(a)},registerType:function(b,a){this.types[b]=a;a[this.typeName]=b},isRegistered:function(a){return this.types[a]!==undefined},create:function(a,d){var b=a[this.typeName]||a.type||d,c=this.types[b];if(c==undefined){throw new Error(String.format("The '{0}' type has not been registered with this manager",b))}return new c(a)},onAvailable:function(d,c,b){var a=this.all;a.on("add",function(e,g){if(g.id==d){c.call(b||g,g);a.un("add",c,b)}})}});Ext.util.Format=function(){var trimRe=/^\s+|\s+$/g,stripTagsRE=/<\/?[^>]+>/gi,stripScriptsRe=/(?:<script.*?>)((\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,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")},htmlDecode:function(value){return !value?value:String(value).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/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<psplit.length){v=v.toFixed(psplit[1].length)}else{if(2<psplit.length){throw ("NumberFormatException: invalid format, formats should have no more than 1 period: "+format)}else{v=v.toFixed(0)}}var fnum=v.toString();psplit=fnum.split(".");if(hasComma){var cnum=psplit[0],parr=[],j=cnum.length,m=Math.floor(j/3),n=cnum.length%3||3,i;for(i=0;i<j;i+=n){if(i!=0){n=3}parr[parr.length]=cnum.substr(i,n);m-=1}fnum=parr.join(comma);if(psplit[1]){fnum+=dec+psplit[1]}}else{if(psplit[1]){fnum=psplit[0]+dec+psplit[1]}}return(neg?"-":"")+format.replace(/[\d,?\.?]+/,fnum)},numberRenderer:function(format){return function(v){return Ext.util.Format.number(v,format)}},plural:function(v,s,p){return v+" "+(v==1?s:(p?p:s+"s"))},nl2br:function(v){return Ext.isEmpty(v)?"":v.replace(nl2brRe,"<br/>")}}}();Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var y=this,j=y.html,q=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,d=/^<tpl\b[^>]*?for="(.*?)"/,v=/^<tpl\b[^>]*?if="(.*?)"/,x=/^<tpl\b[^>]*?exec="(.*?)"/,r,p=0,k=[],o="values",w="parent",l="xindex",n="xcount",e="return ",c="with(values){ ";j=["<tpl>",j,"</tpl>"].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<g;e++){b[b.length]=m.compiled.call(h,l[e],j,e+1,g)}return b.join("")}return m.compiled.call(h,l,j,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<g;j++){try{this.cacheStyleSheet(k[j])}catch(l){}}}return d},getRule:function(e,h){var g=this.getRules(h);if(!Ext.isArray(e)){return g[e.toLowerCase()]}for(var j=0;j<e.length;j++){if(g[e[j]]){return g[e[j].toLowerCase()]}}return null},updateRule:function(e,j,h){if(!Ext.isArray(e)){var k=this.getRule(e);if(k){k.style[j.replace(b,a)]=h;return true}}else{for(var g=0;g<e.length;g++){if(this.updateRule(e[g],j,h)){return true}}}return false}}}();Ext.util.ClickRepeater=Ext.extend(Ext.util.Observable,{constructor:function(b,a){this.el=Ext.get(b);this.el.unselectable();Ext.apply(this,a);this.addEvents("mousedown","click","mouseup");if(!this.disabled){this.disabled=true;this.enable()}if(this.handler){this.on("click",this.handler,this.scope||this)}Ext.util.ClickRepeater.superclass.constructor.call(this)},interval:20,delay:250,preventDefault:true,stopDefault:false,timer:0,enable:function(){if(this.disabled){this.el.on("mousedown",this.handleMouseDown,this);if(Ext.isIE){this.el.on("dblclick",this.handleDblClick,this)}if(this.preventDefault||this.stopDefault){this.el.on("click",this.eventOptions,this)}}this.disabled=false},disable:function(a){if(a||!this.disabled){clearTimeout(this.timer);if(this.pressClass){this.el.removeClass(this.pressClass)}Ext.getDoc().un("mouseup",this.handleMouseUp,this);this.el.removeAllListeners()}this.disabled=true},setDisabled:function(a){this[a?"disable":"enable"]()},eventOptions:function(a){if(this.preventDefault){a.preventDefault()}if(this.stopDefault){a.stopEvent()}},destroy:function(){this.disable(true);Ext.destroy(this.el);this.purgeListeners()},handleDblClick:function(a){clearTimeout(this.timer);this.el.blur();this.fireEvent("mousedown",this,a);this.fireEvent("click",this,a)},handleMouseDown:function(a){clearTimeout(this.timer);this.el.blur();if(this.pressClass){this.el.addClass(this.pressClass)}this.mousedownTime=new Date();Ext.getDoc().on("mouseup",this.handleMouseUp,this);this.el.on("mouseout",this.handleMouseOut,this);this.fireEvent("mousedown",this,a);this.fireEvent("click",this,a);if(this.accelerate){this.delay=400}this.timer=this.click.defer(this.delay||this.interval,this,[a])},click:function(a){this.fireEvent("click",this,a);this.timer=this.click.defer(this.accelerate?this.easeOutExpo(this.mousedownTime.getElapsed(),400,-390,12000):this.interval,this,[a])},easeOutExpo:function(e,a,h,g){return(e==g)?a+h:h*(-Math.pow(2,-10*e/g)+1)+a},handleMouseOut:function(){clearTimeout(this.timer);if(this.pressClass){this.el.removeClass(this.pressClass)}this.el.on("mouseover",this.handleMouseReturn,this)},handleMouseReturn:function(){this.el.un("mouseover",this.handleMouseReturn,this);if(this.pressClass){this.el.addClass(this.pressClass)}this.click()},handleMouseUp:function(a){clearTimeout(this.timer);this.el.un("mouseover",this.handleMouseReturn,this);this.el.un("mouseout",this.handleMouseOut,this);Ext.getDoc().un("mouseup",this.handleMouseUp,this);this.el.removeClass(this.pressClass);this.fireEvent("mouseup",this,a)}});Ext.KeyNav=function(b,a){this.el=Ext.get(b);Ext.apply(this,a);if(!this.disabled){this.disabled=true;this.enable()}};Ext.KeyNav.prototype={disabled:false,defaultEventAction:"stopEvent",forceKeyDown:false,relay:function(c){var a=c.getKey(),b=this.keyToHandler[a];if(b&&this[b]){if(this.doRelay(c,this[b],b)!==true){c[this.defaultEventAction]()}}},doRelay:function(c,b,a){return b.call(this.scope||this,c,a)},enter:false,left:false,right:false,up:false,down:false,tab:false,esc:false,pageUp:false,pageDown:false,del:false,home:false,end:false,space:false,keyToHandler:{37:"left",39:"right",38:"up",40:"down",33:"pageUp",34:"pageDown",46:"del",36:"home",35:"end",13:"enter",27:"esc",9:"tab",32:"space"},stopKeyUp:function(b){var a=b.getKey();if(a>=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;c<d;c++){h.push(e.charCodeAt(c))}k=h}var a=Ext.isArray(k);var i=function(o){if(this.checkModifiers(b,o)){var m=o.getKey();if(a){for(var n=0,j=k.length;n<j;n++){if(k[n]==m){if(this.stopEvent){o.stopEvent()}g.call(l||window,m,o);return}}}else{if(m==k){if(this.stopEvent){o.stopEvent()}g.call(l||window,m,o)}}}};this.bindings.push(i)},checkModifiers:function(b,h){var j,d,g=["shift","ctrl","alt"];for(var c=0,a=g.length;c<a;++c){d=g[c];j=b[d];if(!(j===undefined||(j===h[d+"Key"]))){return false}}return true},on:function(b,d,c){var h,a,e,g;if(typeof b=="object"&&!Ext.isArray(b)){h=b.key;a=b.shift;e=b.ctrl;g=b.alt}else{h=b}this.addBinding({key:h,shift:a,ctrl:e,alt:g,fn:d,scope:c})},handleKeyDown:function(g){if(this.enabled){var c=this.bindings;for(var d=0,a=c.length;d<a;d++){c[d].call(this,g)}}},isEnabled:function(){return this.enabled},enable:function(){if(!this.enabled){this.el.on(this.eventName,this.handleKeyDown,this);this.enabled=true}},disable:function(){if(this.enabled){this.el.removeListener(this.eventName,this.handleKeyDown,this);this.enabled=false}},setDisabled:function(a){this[a?"disable":"enable"]()}};Ext.util.TextMetrics=function(){var a;return{measure:function(b,c,d){if(!a){a=Ext.util.TextMetrics.Instance(b,d)}a.bind(b);a.setFixedWidth(d||"auto");return a.getSize(c)},createInstance:function(b,c){return Ext.util.TextMetrics.Instance(b,c)}}}();Ext.util.TextMetrics.Instance=function(b,d){var c=new Ext.Element(document.createElement("div"));document.body.appendChild(c.dom);c.position("absolute");c.setLeftTop(-1000,-1000);c.hide();if(d){c.setWidth(d)}var a={getSize:function(g){c.update(g);var e=c.getSize();c.update("");return e},bind:function(e){c.setStyle(Ext.fly(e).getStyles("font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"))},setFixedWidth:function(e){c.setWidth(e)},getWidth:function(e){c.dom.style.width="auto";return this.getSize(e).width},getHeight:function(e){return this.getSize(e).height}};a.bind(b);return a};Ext.Element.addMethods({getTextWidth:function(c,b,a){return(Ext.util.TextMetrics.measure(this.dom,Ext.value(c,this.dom.innerHTML,true)).width).constrain(b||0,a||1000000)}});Ext.util.Cookies={set:function(c,e){var a=arguments;var i=arguments.length;var b=(i>2)?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<a){c=e+g;if(document.cookie.substring(e,c)==b){return Ext.util.Cookies.getCookieVal(c)}e=document.cookie.indexOf(" ",e)+1;if(e===0){break}}return null},clear:function(a){if(Ext.util.Cookies.get(a)){document.cookie=a+"=; expires=Thu, 01-Jan-70 00:00:01 GMT"}},getCookieVal:function(b){var a=document.cookie.indexOf(";",b);if(a==-1){a=document.cookie.length}return unescape(document.cookie.substring(b,a))}};Ext.handleError=function(a){throw a};Ext.Error=function(a){this.message=(this.lang[a])?this.lang[a]:a};Ext.Error.prototype=new Error();Ext.apply(Ext.Error.prototype,{lang:{},name:"Ext.Error",getName:function(){return this.name},getMessage:function(){return this.message},toJson:function(){return Ext.encode(this)}});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(g,e,d){c.on("add",function(h,i){if(i.id==g){e.call(d||i,i);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,g){var d=a[e.ptype||g];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;c<a;c++){this.plugins[c]=this.initPlugin(this.plugins[c])}}else{this.plugins=this.initPlugin(this.plugins)}}if(this.stateful!==false){this.initState()}if(this.applyTo){this.applyToMarkup(this.applyTo);delete this.applyTo}else{if(this.renderTo){this.render(this.renderTo);delete this.renderTo}}};Ext.Component.AUTO_ID=1000;Ext.extend(Ext.Component,Ext.util.Observable,{disabled:false,hidden:false,autoEl:"div",disabledClass:"x-item-disabled",allowDomMove:true,autoShow:false,hideMode:"display",hideParent:false,rendered:false,tplWriteMode:"overwrite",bubbleEvents:[],ctype:"Ext.Component",actionMode:"el",getActionEl:function(){return this[this.actionMode]},initPlugin:function(a){if(a.ptype&&!Ext.isFunction(a.init)){a=Ext.ComponentMgr.createPlugin(a)}else{if(Ext.isString(a)){a=Ext.ComponentMgr.createPlugin({ptype:a})}}a.init(this);return a},initComponent:function(){if(this.listeners){this.on(this.listeners);delete this.listeners}this.enableBubble(this.bubbleEvents)},render:function(b,a){if(!this.rendered&&this.fireEvent("beforerender",this)!==false){if(!b&&this.el){this.el=Ext.get(this.el);b=this.el.dom.parentNode;this.allowDomMove=false}this.container=Ext.get(b);if(this.ctCls){this.container.addClass(this.ctCls)}this.rendered=true;if(a!==undefined){if(Ext.isNumber(a)){a=this.container.dom.childNodes[a]}else{a=Ext.getDom(a)}}this.onRender(this.container,a||null);if(this.autoShow){this.el.removeClass(["x-hidden","x-hide-"+this.hideMode])}if(this.cls){this.el.addClass(this.cls);delete this.cls}if(this.style){this.el.applyStyles(this.style);delete this.style}if(this.overCls){this.el.addClassOnOver(this.overCls)}this.fireEvent("render",this);var c=this.getContentTarget();if(this.html){c.update(Ext.DomHelper.markup(this.html));delete this.html}if(this.contentEl){var d=Ext.getDom(this.contentEl);Ext.fly(d).removeClass(["x-hidden","x-hide-display"]);c.appendChild(d)}if(this.tpl){if(!this.tpl.compile){this.tpl=new Ext.XTemplate(this.tpl)}if(this.data){this.tpl[this.tplWriteMode](c,this.data);delete this.data}}this.afterRender(this.container);if(this.hidden){this.doHide()}if(this.disabled){this.disable(true)}if(this.stateful!==false){this.initStateEvents()}this.fireEvent("afterrender",this)}return this},update:function(b,d,a){var c=this.getContentTarget();if(this.tpl&&typeof b!=="string"){this.tpl[this.tplWriteMode](c,b||{})}else{var e=Ext.isObject(b)?Ext.DomHelper.markup(b):b;c.update(e,d,a)}},onAdded:function(a,b){this.ownerCt=a;this.initRef();this.fireEvent("added",this,a,b)},onRemoved:function(){this.removeRef();this.fireEvent("removed",this,this.ownerCt);delete this.ownerCt},initRef:function(){if(this.ref&&!this.refOwner){var d=this.ref.split("/"),c=d.length,b=0,a=this;while(a&&b<c){a=a.ownerCt;++b}if(a){a[this.refName=d[--b]]=this;this.refOwner=a}}},removeRef:function(){if(this.refOwner&&this.refName){delete this.refOwner[this.refName];delete this.refOwner}},initState:function(){if(Ext.state.Manager){var b=this.getStateId();if(b){var a=Ext.state.Manager.get(b);if(a){if(this.fireEvent("beforestaterestore",this,a)!==false){this.applyState(Ext.apply({},a));this.fireEvent("staterestore",this,a)}}}}},getStateId:function(){return this.stateId||((/^(ext-comp-|ext-gen)/).test(String(this.id))?null:this.id)},initStateEvents:function(){if(this.stateEvents){for(var a=0,b;b=this.stateEvents[a];a++){this.on(b,this.saveState,this,{delay:100})}}},applyState:function(a){if(a){Ext.apply(this,a)}},getState:function(){return null},saveState:function(){if(Ext.state.Manager&&this.stateful!==false){var b=this.getStateId();if(b){var a=this.getState();if(this.fireEvent("beforestatesave",this,a)!==false){Ext.state.Manager.set(b,a);this.fireEvent("statesave",this,a)}}}},applyToMarkup:function(a){this.allowDomMove=false;this.el=Ext.get(a);this.render(this.el.dom.parentNode)},addClass:function(a){if(this.el){this.el.addClass(a)}else{this.cls=this.cls?this.cls+" "+a:a}return this},removeClass:function(a){if(this.el){this.el.removeClass(a)}else{if(this.cls){this.cls=this.cls.split(" ").remove(a).join(" ")}}return this},onRender:function(b,a){if(!this.el&&this.autoEl){if(Ext.isString(this.autoEl)){this.el=document.createElement(this.autoEl)}else{var c=document.createElement("div");Ext.DomHelper.overwrite(c,this.autoEl);this.el=c.firstChild}if(!this.el.id){this.el.id=this.getId()}}if(this.el){this.el=Ext.get(this.el);if(this.allowDomMove!==false){b.dom.insertBefore(this.el.dom,a);if(c){Ext.removeNode(c);c=null}}}},getAutoCreate:function(){var a=Ext.isObject(this.autoCreate)?this.autoCreate:Ext.apply({},this.defaultAutoCreate);if(this.id&&!a.id){a.id=this.id}return a},afterRender:Ext.emptyFn,destroy:function(){if(!this.isDestroyed){if(this.fireEvent("beforedestroy",this)!==false){this.destroying=true;this.beforeDestroy();if(this.ownerCt&&this.ownerCt.remove){this.ownerCt.remove(this,false)}if(this.rendered){this.el.remove();if(this.actionMode=="container"||this.removeMode=="container"){this.container.remove()}}if(this.focusTask&&this.focusTask.cancel){this.focusTask.cancel()}this.onDestroy();Ext.ComponentMgr.unregister(this);this.fireEvent("destroy",this);this.purgeListeners();this.destroying=false;this.isDestroyed=true}}},deleteMembers:function(){var b=arguments;for(var c=0,a=b.length;c<a;++c){delete this[b[c]]}},beforeDestroy:Ext.emptyFn,onDestroy:Ext.emptyFn,getEl:function(){return this.el},getContentTarget:function(){return this.el},getId:function(){return this.id||(this.id="ext-comp-"+(++Ext.Component.AUTO_ID))},getItemId:function(){return this.itemId||this.getId()},focus:function(b,a){if(a){this.focusTask=new Ext.util.DelayedTask(this.focus,this,[b,false]);this.focusTask.delay(Ext.isNumber(a)?a:10);return this}if(this.rendered&&!this.isDestroyed){this.el.focus();if(b===true){this.el.dom.select()}}return this},blur:function(){if(this.rendered){this.el.blur()}return this},disable:function(a){if(this.rendered){this.onDisable()}this.disabled=true;if(a!==true){this.fireEvent("disable",this)}return this},onDisable:function(){this.getActionEl().addClass(this.disabledClass);this.el.dom.disabled=true},enable:function(){if(this.rendered){this.onEnable()}this.disabled=false;this.fireEvent("enable",this);return this},onEnable:function(){this.getActionEl().removeClass(this.disabledClass);this.el.dom.disabled=false},setDisabled:function(a){return this[a?"disable":"enable"]()},show:function(){if(this.fireEvent("beforeshow",this)!==false){this.hidden=false;if(this.autoRender){this.render(Ext.isBoolean(this.autoRender)?Ext.getBody():this.autoRender)}if(this.rendered){this.onShow()}this.fireEvent("show",this)}return this},onShow:function(){this.getVisibilityEl().removeClass("x-hide-"+this.hideMode)},hide:function(){if(this.fireEvent("beforehide",this)!==false){this.doHide();this.fireEvent("hide",this)}return this},doHide:function(){this.hidden=true;if(this.rendered){this.onHide()}},onHide:function(){this.getVisibilityEl().addClass("x-hide-"+this.hideMode)},getVisibilityEl:function(){return this.hideParent?this.container:this.getActionEl()},setVisible:function(a){return this[a?"show":"hide"]()},isVisible:function(){return this.rendered&&this.getVisibilityEl().isVisible()},cloneConfig:function(b){b=b||{};var c=b.id||Ext.id();var a=Ext.applyIf(b,this.initialConfig);a.id=c;return new this.constructor(a)},getXType:function(){return this.constructor.xtype},isXType:function(b,a){if(Ext.isFunction(b)){b=b.xtype}else{if(Ext.isObject(b)){b=b.constructor.xtype}}return !a?("/"+this.getXTypes()+"/").indexOf("/"+b+"/")!=-1:this.constructor.xtype==b},getXTypes:function(){var a=this.constructor;if(!a.xtypes){var d=[],b=this;while(b&&b.constructor.xtype){d.unshift(b.constructor.xtype);b=b.constructor.superclass}a.xtypeChain=d;a.xtypes=d.join("/")}return a.xtypes},findParentBy:function(a){for(var b=this.ownerCt;(b!=null)&&!a(b,this);b=b.ownerCt){}return b||null},findParentByType:function(b,a){return this.findParentBy(function(d){return d.isXType(b,a)})},bubble:function(c,b,a){var d=this;while(d){if(c.apply(b||d,a||[d])===false){break}d=d.ownerCt}return this},getPositionEl:function(){return this.positionEl||this.el},purgeListeners:function(){Ext.Component.superclass.purgeListeners.call(this);if(this.mons){this.on("beforedestroy",this.clearMons,this,{single:true})}},clearMons:function(){Ext.each(this.mons,function(a){a.item.un(a.ename,a.fn,a.scope)},this);this.mons=[]},createMons:function(){if(!this.mons){this.mons=[];this.on("beforedestroy",this.clearMons,this,{single:true})}},mon:function(g,b,d,c,a){this.createMons();if(Ext.isObject(b)){var j=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;var i=b;for(var h in i){if(j.test(h)){continue}if(Ext.isFunction(i[h])){this.mons.push({item:g,ename:h,fn:i[h],scope:i.scope});g.on(h,i[h],i.scope,i)}else{this.mons.push({item:g,ename:h,fn:i[h],scope:i.scope});g.on(h,i[h])}}return}this.mons.push({item:g,ename:b,fn:d,scope:c});g.on(b,d,c,a)},mun:function(h,c,g,e){var j,d;this.createMons();for(var b=0,a=this.mons.length;b<a;++b){d=this.mons[b];if(h===d.item&&c==d.ename&&g===d.fn&&e===d.scope){this.mons.splice(b,1);h.un(c,g,e);j=true;break}}return j},nextSibling:function(){if(this.ownerCt){var a=this.ownerCt.items.indexOf(this);if(a!=-1&&a+1<this.ownerCt.items.getCount()){return this.ownerCt.items.itemAt(a+1)}}return null},previousSibling:function(){if(this.ownerCt){var a=this.ownerCt.items.indexOf(this);if(a>0){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;c<a;c++){d[c][e].apply(d[c],b)}},addComponent:function(a){this.items.push(a);a.on("destroy",this.removeComponent,this)},removeComponent:function(a){this.items.remove(a)},execute:function(){this.initialConfig.handler.apply(this.initialConfig.scope||window,arguments)}});(function(){Ext.Layer=function(d,c){d=d||{};var e=Ext.DomHelper,h=d.parentEl,g=h?Ext.getDom(h):document.body;if(c){this.dom=Ext.getDom(c)}if(!this.dom){var i=d.dh||{tag:"div",cls:"x-layer"};this.dom=e.append(g,i)}if(d.cls){this.addClass(d.cls)}this.constrain=d.constrain!==false;this.setVisibilityMode(Ext.Element.VISIBILITY);if(d.id){this.id=this.dom.id=d.id}else{this.id=Ext.id(this.dom)}this.zindex=d.zindex||this.getZIndex();this.position("absolute",this.zindex);if(d.shadow){this.shadowOffset=d.shadowOffset||4;this.shadow=new Ext.Shadow({offset:this.shadowOffset,mode:d.shadow})}else{this.shadowOffset=0}this.useShim=d.shim!==false&&Ext.useShims;this.useDisplay=d.useDisplay;this.hide()};var a=Ext.Element.prototype;var b=[];Ext.extend(Ext.Layer,Ext.Element,{getZIndex:function(){return this.zindex||parseInt((this.getShim()||this).getStyle("z-index"),10)||11000},getShim:function(){if(!this.useShim){return null}if(this.shim){return this.shim}var d=b.shift();if(!d){d=this.createShim();d.enableDisplayMode("block");d.dom.style.display="none";d.dom.style.visibility="visible"}var c=this.dom.parentNode;if(d.dom.parentNode!=c){c.insertBefore(d.dom,this.dom)}d.setStyle("z-index",this.getZIndex()-2);this.shim=d;return d},hideShim:function(){if(this.shim){this.shim.setDisplayed(false);b.push(this.shim);delete this.shim}},disableShadow:function(){if(this.shadow){this.shadowDisabled=true;this.shadow.hide();this.lastShadowOffset=this.shadowOffset;this.shadowOffset=0}},enableShadow:function(c){if(this.shadow){this.shadowDisabled=false;if(Ext.isDefined(this.lastShadowOffset)){this.shadowOffset=this.lastShadowOffset;delete this.lastShadowOffset}if(c){this.sync(true)}}},sync:function(d){var n=this.shadow;if(!this.updating&&this.isVisible()&&(n||this.useShim)){var i=this.getShim(),m=this.getWidth(),j=this.getHeight(),e=this.getLeft(true),o=this.getTop(true);if(n&&!this.shadowDisabled){if(d&&!n.isVisible()){n.show(this)}else{n.realign(e,o,m,j)}if(i){if(d){i.show()}var k=n.el.getXY(),g=i.dom.style,c=n.el.getSize();g.left=(k[0])+"px";g.top=(k[1])+"px";g.width=(c.width)+"px";g.height=(c.height)+"px"}}else{if(i){if(d){i.show()}i.setSize(m,j);i.setLeftTop(e,o)}}}},destroy:function(){this.hideShim();if(this.shadow){this.shadow.hide()}this.removeAllListeners();Ext.removeNode(this.dom);delete this.dom},remove:function(){this.destroy()},beginUpdate:function(){this.updating=true},endUpdate:function(){this.updating=false;this.sync(true)},hideUnders:function(c){if(this.shadow){this.shadow.hide()}this.hideShim()},constrainXY:function(){if(this.constrain){var j=Ext.lib.Dom.getViewWidth(),d=Ext.lib.Dom.getViewHeight();var o=Ext.getDoc().getScroll();var n=this.getXY();var k=n[0],i=n[1];var c=this.shadowOffset;var l=this.dom.offsetWidth+c,e=this.dom.offsetHeight+c;var g=false;if((k+l)>j+o.left){k=j-l-c;g=true}if((i+e)>d+o.top){i=d-e-c;g=true}if(k<o.left){k=o.left;g=true}if(i<o.top){i=o.top;g=true}if(g){if(this.avoidY){var m=this.avoidY;if(i<=m&&(i+e)>=m){i=m-e-5}}n=[k,i];this.storeXY(n);a.setXY.call(this,n);this.sync()}}return this},getConstrainOffset:function(){return this.shadowOffset},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},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,i=0,p=(q+n.w),e=(g+n.h),j=p+"px",o=e+"px",m,c;u.left=(b+n.l)+"px";u.top=(r+n.t)+"px";if(u.width!=j||u.height!=o){u.width=j;u.height=o;if(!Ext.isIE){m=k.childNodes;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=[],a=Ext.isIE?'<div class="x-ie-shadow"></div>':'<div class="x-shadow"><div class="xst"><div class="xstl"></div><div class="xstc"></div><div class="xstr"></div></div><div class="xsc"><div class="xsml"></div><div class="xsmc"></div><div class="xsmr"></div></div><div class="xsb"><div class="xsbl"></div><div class="xsbc"></div><div class="xsbr"></div></div></div>';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)&&(b<this.boxMinWidth)){b=this.boxMinWidth}if(Ext.isDefined(d)&&Ext.isDefined(this.boxMinHeight)&&(d<this.boxMinHeight)){d=this.boxMinHeight}if(Ext.isDefined(b)&&Ext.isDefined(this.boxMaxWidth)&&(b>this.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:"&#160;"},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&&this.layout.setActiveItem){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(e,b){var d=arguments,h=d.length,a=[],g,j;this.initItems();if(h>2){for(g=h-1;g>=1;--g){a.push(this.insert(e,d[g]))}return a}j=this.lookupComponent(this.applyDefaults(b));e=Math.min(e,this.items.length);if(this.fireEvent("beforeadd",this,j,e)!==false&&this.onBeforeAdd(j)!==false){if(j.ownerCt==this){this.items.remove(j)}this.items.insert(e,j);j.onAdded(this,e);this.onAdd(j);this.fireEvent("add",this,j,e)}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.isAction?b.initialConfig: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;++d){e=g[d];this.remove(e,c);if(e.ownerCt!==this){b.push(e)}}return b},getComponent:function(a){if(Ext.isObject(a)){a=a.getItemId()}return this.items.get(a)},lookupComponent:function(a){if(Ext.isString(a)){return Ext.ComponentMgr.get(a)}else{if(!a.events){return this.createComponent(a)}}return a},createComponent:function(a,d){if(a.render){return a}var b=Ext.create(Ext.apply({ownerCt:this},a),d||this.defaultType);delete b.initialConfig.ownerCt;delete b.ownerCt;return b},canLayout:function(){var a=this.getVisibilityEl();return a&&a.dom&&!a.isStyle("display","none")},doLayout:function(g,e){var k=this.rendered,j=e||this.forceLayout;if(this.collapsed||!this.canLayout()){this.deferLayout=this.deferLayout||!g;if(!j){return}g=g&&!this.deferLayout}else{delete this.deferLayout}if(k&&this.layout){this.layout.layout()}if(g!==true&&this.items){var d=this.items.items;for(var b=0,a=d.length;b<a;b++){var h=d[b];if(h.doLayout){h.doLayout(false,j)}}}if(k){this.onLayout(g,j)}this.hasLayout=true;delete this.forceLayout},onLayout:Ext.emptyFn,shouldBufferLayout:function(){var a=this.hasLayout;if(this.ownerCt){return a?!this.hasLayoutPending():false}return a},hasLayoutPending:function(){var a=false;this.ownerCt.bubble(function(b){if(b.layoutPending){a=true;return false}});return a},onShow:function(){Ext.Container.superclass.onShow.call(this);if(Ext.isDefined(this.deferLayout)){delete this.deferLayout;this.doLayout(true)}},getLayout:function(){if(!this.layout){var a=new Ext.layout.AutoLayout(this.layoutConfig);this.setLayout(a)}return this.layout},beforeDestroy:function(){var a;if(this.items){while(a=this.items.first()){this.doRemove(a,true)}}if(this.monitorResize){Ext.EventManager.removeResizeListener(this.doLayout,this)}Ext.destroy(this.layout);Ext.Container.superclass.beforeDestroy.call(this)},cascade:function(g,e,b){if(g.apply(e||this,b||[this])!==false){if(this.items){var d=this.items.items;for(var c=0,a=d.length;c<a;c++){if(d[c].cascade){d[c].cascade(g,e,b)}else{g.apply(e||d[c],b||[d[c]])}}}}return this},findById:function(c){var a=null,b=this;this.cascade(function(d){if(b!=d&&d.id===c){a=d;return false}});return a},findByType:function(b,a){return this.findBy(function(d){return d.isXType(b,a)})},find:function(b,a){return this.findBy(function(d){return d[b]===a})},findBy:function(d,c){var a=[],b=this;this.cascade(function(e){if(b!=e&&d.call(c||e,e,b)===true){a.push(e)}});return a},get:function(a){return this.getComponent(a)}});Ext.Container.LAYOUTS={};Ext.reg("container",Ext.Container);Ext.layout.ContainerLayout=Ext.extend(Object,{monitorResize:false,activeItem:null,constructor:function(a){this.id=Ext.id(null,"ext-layout-");Ext.apply(this,a)},type:"container",IEMeasureHack:function(k,g){var a=k.dom.childNodes,b=a.length,n,m=[],l,h,j;for(h=0;h<b;h++){n=a[h];l=Ext.get(n);if(l){m[h]=l.getStyle("display");l.setStyle({display:"none"})}}j=k?k.getViewSize(g):{};for(h=0;h<b;h++){n=a[h];l=Ext.get(n);if(l){l.setStyle({display:m[h]})}}return j},getLayoutTargetSize:Ext.EmptyFn,layout:function(){var a=this.container,b=a.getLayoutTarget();if(!(this.hasLayout||Ext.isEmpty(this.targetCls))){b.addClass(this.targetCls)}this.onLayout(a,b);a.fireEvent("afterlayout",a,this)},onLayout:function(a,b){this.renderAll(a,b)},isValidParent:function(b,a){return a&&b.getPositionEl().dom.parentNode==(a.dom||a)},renderAll:function(e,g){var b=e.items.items,d,h,a=b.length;for(d=0;d<a;d++){h=b[d];if(h&&(!h.rendered||!this.isValidParent(h,g))){this.renderItem(h,d,g)}}},renderItem:function(d,a,b){if(d){if(!d.rendered){d.render(b,a);this.configureItem(d)}else{if(!this.isValidParent(d,b)){if(Ext.isNumber(a)){a=b.dom.childNodes[a]}b.dom.insertBefore(d.getPositionEl().dom,a||null);d.container=b;this.configureItem(d)}}}},getRenderedItems:function(g){var e=g.getLayoutTarget(),h=g.items.items,a=h.length,d,j,b=[];for(d=0;d<a;d++){if((j=h[d]).rendered&&this.isValidParent(j,e)&&j.shouldLayout!==false){b.push(j)}}return b},configureItem:function(b){if(this.extraCls){var a=b.getPositionEl?b.getPositionEl():b;a.addClass(this.extraCls)}if(b.doLayout&&this.forceLayout){b.doLayout()}if(this.renderHidden&&b!=this.activeItem){b.hide()}},onRemove:function(b){if(this.activeItem==b){delete this.activeItem}if(b.rendered&&this.extraCls){var a=b.getPositionEl?b.getPositionEl():b;a.removeClass(this.extraCls)}},afterRemove:function(a){if(a.removeRestore){a.removeMode="container";delete a.removeRestore}},onResize:function(){var c=this.container,a;if(c.collapsed){return}if(a=c.bufferResize&&c.shouldBufferLayout()){if(!this.resizeTask){this.resizeTask=new Ext.util.DelayedTask(this.runLayout,this);this.resizeBuffer=Ext.isNumber(a)?a:50}c.layoutPending=true;this.resizeTask.delay(this.resizeBuffer)}else{this.runLayout()}},runLayout:function(){var a=this.container;this.layout();a.onLayout();delete a.layoutPending},setContainer:function(b){if(this.monitorResize&&b!=this.container){var a=this.container;if(a){a.un(a.resizeEvent,this.onResize,this)}if(b){b.on(b.resizeEvent,this.onResize,this)}}this.container=b},parseMargins:function(b){if(Ext.isNumber(b)){b=b.toString()}var c=b.split(" "),a=c.length;if(a==1){c[1]=c[2]=c[3]=c[0]}else{if(a==2){c[2]=c[0];c[3]=c[1]}else{if(a==3){c[3]=c[1]}}}return{top:parseInt(c[0],10)||0,right:parseInt(c[1],10)||0,bottom:parseInt(c[2],10)||0,left:parseInt(c[3],10)||0}},fieldTpl:(function(){var a=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>");a.disableFormats=true;return a.compile()})(),destroy:function(){if(this.resizeTask&&this.resizeTask.cancel){this.resizeTask.cancel()}if(this.container){this.container.un(this.container.resizeEvent,this.onResize,this)}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;b<a;b++){h=e[b];if(h.doLayout){h.doLayout(true)}}}});Ext.Container.LAYOUTS.auto=Ext.layout.AutoLayout;Ext.layout.FitLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"fit",getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();if(!a){return{}}return a.getStyleSize()},onLayout:function(a,b){Ext.layout.FitLayout.superclass.onLayout.call(this,a,b);if(!a.collapsed){this.setItemSize(this.activeItem||a.items.itemAt(0),this.getLayoutTargetSize())}},setItemSize:function(b,a){if(b&&a.height>0){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 b=this.container.getLayoutTarget(),a={};if(b){a=b.getViewSize();if(Ext.isIE&&Ext.isStrict&&a.width==0){a=b.getStyleSize()}a.width-=b.getPadding("lr");a.height-=b.getPadding("tb")}return a},onLayout:function(m,w){Ext.layout.AnchorLayout.superclass.onLayout.call(this,m,w);var p=this.getLayoutTargetSize(),k=p.width,o=p.height,q=w.getStyle("overflow"),n=this.getRenderedItems(m),t=n.length,g=[],j,a,v,l,h,c,e,d,u=0,s,b;if(k<20&&o<20){return}if(m.anchorSize){if(typeof m.anchorSize=="number"){a=m.anchorSize}else{a=m.anchorSize.width;v=m.anchorSize.height}}else{a=m.initialConfig.width;v=m.initialConfig.height}for(s=0;s<t;s++){l=n[s];b=l.getPositionEl();if(!l.anchor&&l.items&&!Ext.isNumber(l.width)&&!(Ext.isIE6&&Ext.isStrict)){l.anchor=this.defaultAnchor}if(l.anchor){h=l.anchorSpec;if(!h){d=l.anchor.split(" ");l.anchorSpec=h={right:this.parseAnchor(d[0],l.initialConfig.width,a),bottom:this.parseAnchor(d[1],l.initialConfig.height,v)}}c=h.right?this.adjustWidthAnchor(h.right(k)-b.getMargins("lr"),l):undefined;e=h.bottom?this.adjustHeightAnchor(h.bottom(o)-b.getMargins("tb"),l):undefined;if(c||e){g.push({component:l,width:c||undefined,height:e||undefined})}}}for(s=0,t=g.length;s<t;s++){j=g[s];j.component.setSize(j.width,j.height)}if(q&&q!="hidden"&&!this.adjustmentPass){var r=this.getLayoutTargetSize();if(r.width!=p.width||r.height!=p.height){this.adjustmentPass=true;this.onLayout(m,w)}}delete this.adjustmentPass},parseAnchor:function(c,h,b){if(c&&c!="none"){var e;if(this.parseAnchorRE.test(c)){var g=b-h;return function(a){if(a!==e){e=a;return a-g}}}else{if(c.indexOf("%")!=-1){var d=parseFloat(c.replace("%",""))*0.01;return function(a){if(a!==e){e=a;return Math.floor(a*d)}}}else{c=parseInt(c,10);if(!isNaN(c)){return function(a){if(a!==e){e=a;return a+c}}}}}}return false},adjustWidthAnchor:function(b,a){return b},adjustHeightAnchor:function(b,a){return b}});Ext.Container.LAYOUTS.anchor=Ext.layout.AnchorLayout;Ext.layout.ColumnLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"column",extraCls:"x-column",scrollOffset:0,targetCls:"x-column-layout-ct",isValidParent:function(b,a){return this.innerCt&&b.getPositionEl().dom.parentNode==this.innerCt.dom},getLayoutTargetSize:function(){var b=this.container.getLayoutTarget(),a;if(b){a=b.getViewSize();if(Ext.isIE&&Ext.isStrict&&a.width==0){a=b.getStyleSize()}a.width-=b.getPadding("lr");a.height-=b.getPadding("tb")}return a},renderAll:function(a,b){if(!this.innerCt){this.innerCt=b.createChild({cls:"x-column-inner"});this.innerCt.createChild({cls:"x-clear"})}Ext.layout.ColumnLayout.superclass.renderAll.call(this,a,this.innerCt)},onLayout:function(e,k){var g=e.items.items,j=g.length,n,b,a,o=[];this.renderAll(e,k);var r=this.getLayoutTargetSize();if(r.width<1&&r.height<1){return}var p=r.width-this.scrollOffset,d=r.height,q=p;this.innerCt.setWidth(p);for(b=0;b<j;b++){n=g[b];a=n.getPositionEl().getMargins("lr");o[b]=a;if(!n.columnWidth){q-=(n.getWidth()+a)}}q=q<0?0:q;for(b=0;b<j;b++){n=g[b];a=o[b];if(n.columnWidth){n.setSize(Math.floor(n.columnWidth*q)-a)}}if(Ext.isIE){if(b=k.getStyle("overflow")&&b!="hidden"&&!this.adjustmentPass){var l=this.getLayoutTargetSize();if(l.width!=r.width){this.adjustmentPass=true;this.onLayout(e,k)}}}delete this.adjustmentPass}});Ext.Container.LAYOUTS.column=Ext.layout.ColumnLayout;Ext.layout.BorderLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,rendered:false,type:"border",targetCls:"x-border-layout-ct",getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();return a?a.getViewSize():{}},onLayout:function(g,I){var j,B,F,o,x=g.items.items,C=x.length;if(!this.rendered){j=[];for(B=0;B<C;B++){F=x[B];o=F.region;if(F.collapsed){j.push(F)}F.collapsed=false;if(!F.rendered){F.render(I,B);F.getPositionEl().addClass("x-border-panel")}this[o]=o!="center"&&F.split?new Ext.layout.BorderLayout.SplitRegion(this,F.initialConfig,o):new Ext.layout.BorderLayout.Region(this,F.initialConfig,o);this[o].render(I,F)}this.rendered=true}var v=this.getLayoutTargetSize();if(v.width<20||v.height<20){if(j){this.restoreCollapsed=j}return}else{if(this.restoreCollapsed){j=this.restoreCollapsed;delete this.restoreCollapsed}}var t=v.width,D=v.height,r=t,A=D,p=0,q=0,y=this.north,u=this.south,l=this.west,E=this.east,F=this.center,H,z,d,G;if(!F&&Ext.layout.BorderLayout.WARN!==false){throw"No center region defined in BorderLayout "+g.id}if(y&&y.isVisible()){H=y.getSize();z=y.getMargins();H.width=t-(z.left+z.right);H.x=z.left;H.y=z.top;p=H.height+H.y+z.bottom;A-=p;y.applyLayout(H)}if(u&&u.isVisible()){H=u.getSize();z=u.getMargins();H.width=t-(z.left+z.right);H.x=z.left;G=(H.height+z.top+z.bottom);H.y=D-G+z.top;A-=G;u.applyLayout(H)}if(l&&l.isVisible()){H=l.getSize();z=l.getMargins();H.height=A-(z.top+z.bottom);H.x=z.left;H.y=p+z.top;d=(H.width+z.left+z.right);q+=d;r-=d;l.applyLayout(H)}if(E&&E.isVisible()){H=E.getSize();z=E.getMargins();H.height=A-(z.top+z.bottom);d=(H.width+z.left+z.right);H.x=t-d+z.left;H.y=p+z.top;r-=d;E.applyLayout(H)}if(F){z=F.getMargins();var k={x:q+z.left,y:p+z.top,width:r-(z.left+z.right),height:A-(z.top+z.bottom)};F.applyLayout(k)}if(j){for(B=0,C=j.length;B<C;B++){j[B].collapse(false)}}if(Ext.isIE&&Ext.isStrict){I.repaint()}if(B=I.getStyle("overflow")&&B!="hidden"&&!this.adjustmentPass){var a=this.getLayoutTargetSize();if(a.width!=v.width||a.height!=v.height){this.adjustmentPass=true;this.onLayout(g,I)}}delete this.adjustmentPass},destroy:function(){var b=["north","south","east","west"],a,c;for(a=0;a<b.length;a++){c=this[b[a]];if(c){if(c.destroy){c.destroy()}else{if(c.split){c.split.destroy(true)}}}}Ext.layout.BorderLayout.superclass.destroy.call(this)}});Ext.layout.BorderLayout.Region=function(b,a,c){Ext.apply(this,a);this.layout=b;this.position=c;this.state={};if(typeof this.margins=="string"){this.margins=this.layout.parseMargins(this.margins)}this.margins=Ext.applyIf(this.margins||{},this.defaultMargins);if(this.collapsible){if(typeof this.cmargins=="string"){this.cmargins=this.layout.parseMargins(this.cmargins)}if(this.collapseMode=="mini"&&!this.cmargins){this.cmargins={left:0,top:0,right:0,bottom:0}}else{this.cmargins=Ext.applyIf(this.cmargins||{},c=="north"||c=="south"?this.defaultNSCMargins:this.defaultEWCMargins)}}};Ext.layout.BorderLayout.Region.prototype={collapsible:false,split:false,floatable:true,minWidth:50,minHeight:50,defaultMargins:{left:0,top:0,right:0,bottom:0},defaultNSCMargins:{left:5,top:5,right:5,bottom:5},defaultEWCMargins:{left:5,top:0,right:5,bottom:0},floatingZIndex:100,isCollapsed:false,render:function(b,c){this.panel=c;c.el.enableDisplayMode();this.targetEl=b;this.el=c.el;var a=c.getState,d=this.position;c.getState=function(){return Ext.apply(a.call(c)||{},this.state)}.createDelegate(this);if(d!="center"){c.allowQueuedExpand=false;c.on({beforecollapse:this.beforeCollapse,collapse:this.onCollapse,beforeexpand:this.beforeExpand,expand:this.onExpand,hide:this.onHide,show:this.onShow,scope:this});if(this.collapsible||this.floatable){c.collapseEl="el";c.slideAnchor=this.getSlideAnchor()}if(c.tools&&c.tools.toggle){c.tools.toggle.addClass("x-tool-collapse-"+d);c.tools.toggle.addClassOnOver("x-tool-collapse-"+d+"-over")}}},getCollapsedEl:function(){if(!this.collapsedEl){if(!this.toolTemplate){var b=new Ext.Template('<div class="x-tool x-tool-{id}">&#160;</div>');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:"&#160;"});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.expandToolEl=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.destroyMembers(this,"miniCollapsedEl","collapsedEl","expandToolEl")}};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:"&#160;",id:this.panel.id+"-xsplit"});if(this.collapseMode=="mini"){this.miniSplitEl=this.splitEl.createChild({cls:"x-layout-mini x-layout-mini-"+d,html:"&#160;"});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:true,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=Ext.isDefined(a.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<a;++d){if(c[d]){b+=c[d];if(b.substr(-1,1)!=";"){b+=";"}}}return b},renderItem:function(e,a,d){if(e&&(e.isFormField||e.fieldLabel)&&e.inputType!="hidden"){var b=this.getTemplateArgs(e);if(Ext.isNumber(a)){a=d.dom.childNodes[a]||null}if(a){e.itemCt=this.fieldTpl.insertBefore(a,b,true)}else{e.itemCt=this.fieldTpl.append(d,b,true)}if(!e.getItemCt){Ext.apply(e,{getItemCt:function(){return e.itemCt},customItemCt:true})}e.label=e.getItemCt().child("label.x-form-item-label");if(!e.rendered){e.render("x-form-el-"+e.id)}else{if(!this.isValidParent(e,d)){Ext.fly("x-form-el-"+e.id).appendChild(e.getPositionEl())}}if(this.trackLabels){if(e.hidden){this.onFieldHide(e)}e.on({scope:this,show:this.onFieldShow,hide:this.onFieldHide})}this.configureItem(e)}else{Ext.layout.FormLayout.superclass.renderItem.apply(this,arguments)}},getTemplateArgs:function(c){var a=!c.fieldLabel||c.hideLabel,b=(c.itemCls||this.container.itemCls||"")+(c.hideLabel?" x-hide-label":"");if(Ext.isIE9&&Ext.isIEQuirks&&c instanceof Ext.form.TextField){b+=" x-input-wrapper"}return{id:c.id,label:c.fieldLabel,itemCls:b,clearCls:c.clearCls||"x-form-clear-left",labelStyle:this.getLabelStyle(c.labelStyle),elementStyle:this.elementStyle||"",labelSeparator:a?"":(Ext.isDefined(c.labelSeparator)?c.labelSeparator:this.labelSeparator)}},adjustWidthAnchor:function(a,d){if(d.label&&!this.isHide(d)&&(this.container.labelAlign!="top")){var b=Ext.isIE6||(Ext.isIE&&!Ext.isStrict);return a-this.labelAdjust+(b?-3:0)}return a},adjustHeightAnchor:function(a,b){if(b.label&&!this.isHide(b)&&(this.container.labelAlign=="top")){return a-b.label.getHeight()}return a},isValidParent:function(b,a){return a&&this.container.getEl().contains(b.getPositionEl())}});Ext.Container.LAYOUTS.form=Ext.layout.FormLayout;Ext.layout.AccordionLayout=Ext.extend(Ext.layout.FitLayout,{fill:true,autoWidth:true,titleCollapse:true,hideCollapseTool:false,collapseFirst:false,animate:false,sequence:false,activeOnTop:false,type:"accordion",renderItem:function(a){if(this.animate===false){a.animCollapse=false}a.collapsible=true;if(this.autoWidth){a.autoWidth=true}if(this.titleCollapse){a.titleCollapse=true}if(this.hideCollapseTool){a.hideCollapseTool=true}if(this.collapseFirst!==undefined){a.collapseFirst=this.collapseFirst}if(!this.activeItem&&!a.collapsed){this.setActiveItem(a,true)}else{if(this.activeItem&&this.activeItem!=a){a.collapsed=true}}Ext.layout.AccordionLayout.superclass.renderItem.apply(this,arguments);a.header.addClass("x-accordion-hd");a.on("beforeexpand",this.beforeExpand,this)},onRemove:function(a){Ext.layout.AccordionLayout.superclass.onRemove.call(this,a);if(a.rendered){a.header.removeClass("x-accordion-hd")}a.un("beforeexpand",this.beforeExpand,this)},beforeExpand:function(c,b){var a=this.activeItem;if(a){if(this.sequence){delete this.activeItem;if(!a.collapsed){a.collapse({callback:function(){c.expand(b||true)},scope:this});return false}}else{a.collapse(this.animate)}}this.setActive(c);if(this.activeOnTop){c.el.dom.parentNode.insertBefore(c.el.dom,c.el.dom.parentNode.firstChild)}this.layout()},setItemSize:function(g,e){if(this.fill&&g){var d=0,c,b=this.getRenderedItems(this.container),a=b.length,h;for(c=0;c<a;c++){if((h=b[c])!=g&&!h.hidden){d+=h.header.getHeight()}}e.height-=d;g.setSize(e)}},setActiveItem:function(a){this.setActive(a,true)},setActive:function(c,b){var a=this.activeItem;c=this.container.getComponent(c);if(a!=c){if(c.rendered&&c.collapsed&&b){c.expand()}else{if(a){a.fireEvent("deactivate",a)}this.activeItem=c;c.fireEvent("activate",c)}}}});Ext.Container.LAYOUTS.accordion=Ext.layout.AccordionLayout;Ext.layout.Accordion=Ext.layout.AccordionLayout;Ext.layout.TableLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:false,type:"table",targetCls:"x-table-layout-ct",tableAttrs:null,setContainer:function(a){Ext.layout.TableLayout.superclass.setContainer.call(this,a);this.currentRow=0;this.currentColumn=0;this.cells=[]},onLayout:function(d,g){var e=d.items.items,a=e.length,h,b;if(!this.table){g.addClass("x-table-layout-ct");this.table=g.createChild(Ext.apply({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},this.tableAttrs),null,true)}this.renderAll(d,g)},getRow:function(a){var b=this.table.tBodies[0].childNodes[a];if(!b){b=document.createElement("tr");this.table.tBodies[0].appendChild(b)}return b},getNextCell:function(j){var a=this.getNextNonSpan(this.currentColumn,this.currentRow);var g=this.currentColumn=a[0],e=this.currentRow=a[1];for(var i=e;i<e+(j.rowspan||1);i++){if(!this.cells[i]){this.cells[i]=[]}for(var d=g;d<g+(j.colspan||1);d++){this.cells[i][d]=true}}var h=document.createElement("td");if(j.cellId){h.id=j.cellId}var b="x-table-layout-cell";if(j.cellCls){b+=" "+j.cellCls}h.className=b;if(j.colspan){h.colSpan=j.colspan}if(j.rowspan){h.rowSpan=j.rowspan}this.getRow(e).appendChild(h);return h},getNextNonSpan:function(a,c){var b=this.columns;while((b&&a>=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)}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)}}},isValidParent:function(b,a){return b.getPositionEl().up("table",5).dom.parentNode===(a.dom||a)},destroy:function(){delete this.table;Ext.layout.TableLayout.superclass.destroy.call(this)}});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)}var d=this.overflowHandler;if(typeof d=="string"){d={type:d}}var c="none";if(d&&d.type!=undefined){c=d.type}var b=Ext.layout.boxOverflow[c];if(b[this.type]){b=b[this.type]}this.overflowHandler=new b(this,d)},onLayout:function(b,h){Ext.layout.BoxLayout.superclass.onLayout.call(this,b,h);var d=this.getLayoutTargetSize(),i=this.getVisibleItems(b),c=this.calculateChildBoxes(i,d),g=c.boxes,j=c.meta;if(d.width>0){var k=this.overflowHandler,a=j.tooNarrow?"handleOverflow":"clearOverflow";var e=k[a](c,d);if(e){if(e.targetSize){d=e.targetSize}if(e.recalculate){i=this.getVisibleItems(b);c=this.calculateChildBoxes(i,d);g=c.boxes}}}this.layoutTargetLastSize=d;this.childBoxCache=c;this.updateInnerCtSize(d,c);this.updateChildBoxes(g);this.handleTargetOverflow(d,b,h)},updateChildBoxes:function(c){for(var b=0,e=c.length;b<e;b++){var d=c[b],a=d.component;if(d.dirtySize){a.setSize(d.width,d.height)}if(isNaN(d.left)||isNaN(d.top)){continue}a.setPosition(d.left,d.top)}},updateInnerCtSize:function(c,h){var i=this.align,g=this.padding,e=c.width,a=c.height;if(this.type=="hbox"){var b=e,d=h.meta.maxHeight+g.top+g.bottom;if(i=="stretch"){d=a}else{if(i=="middle"){d=Math.max(a,d)}}}else{var d=a,b=h.meta.maxWidth+g.left+g.right;if(i=="stretch"){b=e}else{if(i=="center"){b=Math.max(e,b)}}}this.innerCt.setSize(b||undefined,d||undefined)},handleTargetOverflow:function(d,a,c){var e=c.getStyle("overflow");if(e&&e!="hidden"&&!this.adjustmentPass){var b=this.getLayoutTargetSize();if(b.width!=d.width||b.height!=d.height){this.adjustmentPass=true;this.onLayout(a,c)}}delete this.adjustmentPass},isValidParent:function(b,a){return this.innerCt&&b.getPositionEl().dom.parentNode==this.innerCt.dom},getVisibleItems:function(g){var g=g||this.container,e=g.getLayoutTarget(),h=g.items.items,a=h.length,d,j,b=[];for(d=0;d<a;d++){if((j=h[d]).rendered&&this.isValidParent(j,e)&&j.hidden!==true&&j.collapsed!==true&&j.shouldLayout!==false){b.push(j)}}return b},renderAll:function(a,b){if(!this.innerCt){this.innerCt=b.createChild({cls:this.innerCls});this.padding=this.parseMargins(this.padding)}Ext.layout.BoxLayout.superclass.renderAll.call(this,a,this.innerCt)},getLayoutTargetSize:function(){var b=this.container.getLayoutTarget(),a;if(b){a=b.getViewSize();if(Ext.isIE&&Ext.isStrict&&a.width==0){a=b.getStyleSize()}a.width-=b.getPadding("lr");a.height-=b.getPadding("tb")}return a},renderItem:function(a){if(Ext.isString(a.margins)){a.margins=this.parseMargins(a.margins)}else{if(!a.margins){a.margins=this.defaultMargins}}Ext.layout.BoxLayout.superclass.renderItem.apply(this,arguments)},destroy:function(){Ext.destroy(this.overflowHandler);Ext.layout.BoxLayout.superclass.destroy.apply(this,arguments)}});Ext.layout.boxOverflow.None=Ext.extend(Object,{constructor:function(b,a){this.layout=b;Ext.apply(this,a||{})},handleOverflow:Ext.emptyFn,clearOverflow:Ext.emptyFn});Ext.layout.boxOverflow.none=Ext.layout.boxOverflow.None;Ext.layout.boxOverflow.Menu=Ext.extend(Ext.layout.boxOverflow.None,{afterCls:"x-strip-right",noItemsMenuText:'<div class="x-toolbar-no-items">(None)</div>',constructor:function(a){Ext.layout.boxOverflow.Menu.superclass.constructor.apply(this,arguments);this.menuItems=[]},createInnerElements:function(){if(!this.afterCt){this.afterCt=this.layout.innerCt.insertSibling({cls:this.afterCls},"before")}},clearOverflow:function(a,g){var e=g.width+(this.afterCt?this.afterCt.getWidth():0),b=this.menuItems;this.hideTrigger();for(var c=0,d=b.length;c<d;c++){b.pop().component.show()}return{targetSize:{height:g.height,width:e}}},showTrigger:function(){this.createMenu();this.menuTrigger.show()},hideTrigger:function(){if(this.menuTrigger!=undefined){this.menuTrigger.hide()}},beforeMenuShow:function(h){var b=this.menuItems,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<a;d++){g=b[d].component;if(e&&(c(g,e)||c(e,g))){h.add("-")}this.addComponentToMenu(h,g);e=g}if(h.items.length<1){h.add(this.noItemsMenuText)}},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})}},createMenu:function(){if(!this.menuTrigger){this.createInnerElements();this.menu=new Ext.menu.Menu({ownerCt:this.layout.container,listeners:{scope:this,beforeshow:this.beforeMenuShow}});this.menuTrigger=new Ext.Button({iconCls:"x-toolbar-more-icon",cls:"x-toolbar-more",menu:this.menu,renderTo:this.afterCt})}},destroy:function(){Ext.destroy(this.menu,this.menuTrigger)}});Ext.layout.boxOverflow.menu=Ext.layout.boxOverflow.Menu;Ext.layout.boxOverflow.HorizontalMenu=Ext.extend(Ext.layout.boxOverflow.Menu,{constructor:function(){Ext.layout.boxOverflow.HorizontalMenu.superclass.constructor.apply(this,arguments);var c=this,b=c.layout,a=b.calculateChildBoxes;b.calculateChildBoxes=function(d,i){var l=a.apply(b,arguments),k=l.meta,e=c.menuItems;var j=0;for(var g=0,h=e.length;g<h;g++){j+=e[g].width}k.minimumWidth+=j;k.tooNarrow=k.minimumWidth>i.width;return l}},handleOverflow:function(d,h){this.showTrigger();var k=h.width-this.afterCt.getWidth(),l=d.boxes,e=0,r=false;for(var o=0,c=l.length;o<c;o++){e+=l[o].width}var a=k-e,g=0;for(var o=0,c=this.menuItems.length;o<c;o++){var n=this.menuItems[o],m=n.component,b=n.width;if(b<a){m.show();a-=b;g++;r=true}else{break}}if(r){this.menuItems=this.menuItems.slice(g)}else{for(var j=l.length-1;j>=0;j--){var q=l[j].component,p=l[j].left+l[j].width;if(p>=k){this.menuItems.unshift({component:q,width:l[j].width});q.hide()}else{break}}}if(this.menuItems.length==0){this.hideTrigger()}return{targetSize:{height:h.height,width:k},recalculate:r}}});Ext.layout.boxOverflow.menu.hbox=Ext.layout.boxOverflow.HorizontalMenu;Ext.layout.boxOverflow.Scroller=Ext.extend(Ext.layout.boxOverflow.None,{animateScroll:true,scrollIncrement:100,wheelIncrement:3,scrollRepeatInterval:400,scrollDuration:0.4,beforeCls:"x-strip-left",afterCls:"x-strip-right",scrollerCls:"x-strip-scroller",beforeScrollerCls:"x-strip-scroller-left",afterScrollerCls:"x-strip-scroller-right",createWheelListener:function(){this.layout.innerCt.on({scope:this,mousewheel:function(a){a.stopEvent();this.scrollBy(a.getWheelDelta()*this.wheelIncrement*-1,false)}})},handleOverflow:function(a,b){this.createInnerElements();this.showScrollers()},clearOverflow:function(){this.hideScrollers()},showScrollers:function(){this.createScrollers();this.beforeScroller.show();this.afterScroller.show();this.updateScrollButtons()},hideScrollers:function(){if(this.beforeScroller!=undefined){this.beforeScroller.hide();this.afterScroller.hide()}},createScrollers:function(){if(!this.beforeScroller&&!this.afterScroller){var a=this.beforeCt.createChild({cls:String.format("{0} {1} ",this.scrollerCls,this.beforeScrollerCls)});var b=this.afterCt.createChild({cls:String.format("{0} {1}",this.scrollerCls,this.afterScrollerCls)});a.addClassOnOver(this.beforeScrollerCls+"-hover");b.addClassOnOver(this.afterScrollerCls+"-hover");a.setVisibilityMode(Ext.Element.DISPLAY);b.setVisibilityMode(Ext.Element.DISPLAY);this.beforeRepeater=new Ext.util.ClickRepeater(a,{interval:this.scrollRepeatInterval,handler:this.scrollLeft,scope:this});this.afterRepeater=new Ext.util.ClickRepeater(b,{interval:this.scrollRepeatInterval,handler:this.scrollRight,scope:this});this.beforeScroller=a;this.afterScroller=b}},destroy:function(){Ext.destroy(this.beforeScroller,this.afterScroller,this.beforeRepeater,this.afterRepeater,this.beforeCt,this.afterCt)},scrollBy:function(b,a){this.scrollTo(this.getScrollPosition()+b,a)},getItem:function(a){if(Ext.isString(a)){a=Ext.getCmp(a)}else{if(Ext.isNumber(a)){a=this.items[a]}}return a},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},updateScrollButtons:function(){if(this.beforeScroller==undefined||this.afterScroller==undefined){return}var d=this.atExtremeBefore()?"addClass":"removeClass",c=this.atExtremeAfter()?"addClass":"removeClass",a=this.beforeScrollerCls+"-disabled",b=this.afterScrollerCls+"-disabled";this.beforeScroller[d](a);this.afterScroller[c](b);this.scrolling=false},atExtremeBefore:function(){return this.getScrollPosition()===0},scrollLeft:function(a){this.scrollBy(-this.scrollIncrement,a)},scrollRight:function(a){this.scrollBy(this.scrollIncrement,a)},scrollToItem:function(d,b){d=this.getItem(d);if(d!=undefined){var a=this.getItemVisibility(d);if(!a.fullyVisible){var c=d.getBox(true,true),e=c.x;if(a.hiddenRight){e-=(this.layout.innerCt.getWidth()-c.width)}this.scrollTo(e,b)}}},getItemVisibility:function(e){var d=this.getItem(e).getBox(true,true),a=d.x,c=d.x+d.width,g=this.getScrollPosition(),b=this.layout.innerCt.getWidth()+g;return{hiddenLeft:a<g,hiddenRight:c>b,fullyVisible:a>g&&c<b}}});Ext.layout.boxOverflow.scroller=Ext.layout.boxOverflow.Scroller;Ext.layout.boxOverflow.VerticalScroller=Ext.extend(Ext.layout.boxOverflow.Scroller,{scrollIncrement:75,wheelIncrement:2,handleOverflow:function(a,b){Ext.layout.boxOverflow.VerticalScroller.superclass.handleOverflow.apply(this,arguments);return{targetSize:{height:b.height-(this.beforeCt.getHeight()+this.afterCt.getHeight()),width:b.width}}},createInnerElements:function(){var a=this.layout.innerCt;if(!this.beforeCt){this.beforeCt=a.insertSibling({cls:this.beforeCls},"before");this.afterCt=a.insertSibling({cls:this.afterCls},"after");this.createWheelListener()}},scrollTo:function(a,b){var d=this.getScrollPosition(),c=a.constrain(0,this.getMaxScrollBottom());if(c!=d&&!this.scrolling){if(b==undefined){b=this.animateScroll}this.layout.innerCt.scrollTo("top",c,b?this.getScrollAnim():false);if(b){this.scrolling=true}else{this.scrolling=false;this.updateScrollButtons()}}},getScrollPosition:function(){return parseInt(this.layout.innerCt.dom.scrollTop,10)||0},getMaxScrollBottom:function(){return this.layout.innerCt.dom.scrollHeight-this.layout.innerCt.getHeight()},atExtremeAfter:function(){return this.getScrollPosition()>=this.getMaxScrollBottom()}});Ext.layout.boxOverflow.scroller.vbox=Ext.layout.boxOverflow.VerticalScroller;Ext.layout.boxOverflow.HorizontalScroller=Ext.extend(Ext.layout.boxOverflow.Scroller,{handleOverflow:function(a,b){Ext.layout.boxOverflow.HorizontalScroller.superclass.handleOverflow.apply(this,arguments);return{targetSize:{height:b.height,width:b.width-(this.beforeCt.getWidth()+this.afterCt.getWidth())}}},createInnerElements:function(){var a=this.layout.innerCt;if(!this.beforeCt){this.afterCt=a.insertSibling({cls:this.afterCls},"before");this.beforeCt=a.insertSibling({cls:this.beforeCls},"before");this.createWheelListener()}},scrollTo:function(a,b){var d=this.getScrollPosition(),c=a.constrain(0,this.getMaxScrollRight());if(c!=d&&!this.scrolling){if(b==undefined){b=this.animateScroll}this.layout.innerCt.scrollTo("left",c,b?this.getScrollAnim():false);if(b){this.scrolling=true}else{this.scrolling=false;this.updateScrollButtons()}}},getScrollPosition:function(){return parseInt(this.layout.innerCt.dom.scrollLeft,10)||0},getMaxScrollRight:function(){return this.layout.innerCt.dom.scrollWidth-this.layout.innerCt.getWidth()},atExtremeAfter:function(){return this.getScrollPosition()>=this.getMaxScrollRight()}});Ext.layout.boxOverflow.scroller.hbox=Ext.layout.boxOverflow.HorizontalScroller;Ext.layout.HBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"top",type:"hbox",calculateChildBoxes:function(r,b){var F=r.length,R=this.padding,D=R.top,U=R.left,y=D+R.bottom,O=U+R.right,a=b.width-this.scrollOffset,e=b.height,o=Math.max(0,e-y),P=this.pack=="start",W=this.pack=="center",A=this.pack=="end",L=0,Q=0,T=0,l=0,X=0,H=[],k,J,M,V,w,j,S,I,c,x,q,N;for(S=0;S<F;S++){k=r[S];M=k.height;J=k.width;j=!k.hasLayout&&typeof k.doLayout=="function";if(typeof J!="number"){if(k.flex&&!J){T+=k.flex}else{if(!J&&j){k.doLayout()}V=k.getSize();J=V.width;M=V.height}}w=k.margins;x=w.left+w.right;L+=x+(J||0);l+=x+(k.flex?k.minWidth||0:J);X+=x+(k.minWidth||J||0);if(typeof M!="number"){if(j){k.doLayout()}M=k.getHeight()}Q=Math.max(Q,M+w.top+w.bottom);H.push({component:k,height:M||undefined,width:J||undefined})}var K=l-a,p=X>a;var n=Math.max(0,a-L-O);if(p){for(S=0;S<F;S++){H[S].width=r[S].minWidth||r[S].width||H[S].width}}else{if(K>0){var C=[];for(var E=0,v=F;E<v;E++){var B=r[E],t=B.minWidth||0;if(B.flex){H[E].width=t}else{C.push({minWidth:t,available:H[E].width-t,index:E})}}C.sort(function(Y,i){return Y.available>i.available?1:-1});for(var S=0,v=C.length;S<v;S++){var G=C[S].index;if(G==undefined){continue}var B=r[G],m=H[G],u=m.width,t=B.minWidth,d=Math.max(t,u-Math.ceil(K/(v-S))),g=u-d;H[G].width=d;K-=g}}else{var h=n,s=T;for(S=0;S<F;S++){k=r[S];I=H[S];w=k.margins;q=w.top+w.bottom;if(P&&k.flex&&!k.width){c=Math.ceil((k.flex/s)*h);h-=c;s-=k.flex;I.width=c;I.dirtySize=true}}}}if(W){U+=n/2}else{if(A){U+=n}}for(S=0;S<F;S++){k=r[S];I=H[S];w=k.margins;U+=w.left;q=w.top+w.bottom;I.left=U;I.top=D+w.top;switch(this.align){case"stretch":N=o-q;I.height=N.constrain(k.minHeight||0,k.maxHeight||1000000);I.dirtySize=true;break;case"stretchmax":N=Q-q;I.height=N.constrain(k.minHeight||0,k.maxHeight||1000000);I.dirtySize=true;break;case"middle":var z=o-I.height-q;if(z>0){I.top=D+q+(z/2)}}U+=I.width+w.right}return{boxes:H,meta:{maxHeight:Q,nonFlexWidth:L,desiredWidth:l,minimumWidth:X,shortfall:l-a,tooNarrow:p}}}});Ext.Container.LAYOUTS.hbox=Ext.layout.HBoxLayout;Ext.layout.VBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"left",type:"vbox",calculateChildBoxes:function(o,b){var E=o.length,R=this.padding,C=R.top,V=R.left,x=C+R.bottom,O=V+R.right,a=b.width-this.scrollOffset,c=b.height,K=Math.max(0,a-O),P=this.pack=="start",X=this.pack=="center",z=this.pack=="end",k=0,u=0,U=0,L=0,m=0,G=[],h,I,N,W,t,g,T,H,S,w,n,d,r;for(T=0;T<E;T++){h=o[T];N=h.height;I=h.width;g=!h.hasLayout&&typeof h.doLayout=="function";if(typeof N!="number"){if(h.flex&&!N){U+=h.flex}else{if(!N&&g){h.doLayout()}W=h.getSize();I=W.width;N=W.height}}t=h.margins;n=t.top+t.bottom;k+=n+(N||0);L+=n+(h.flex?h.minHeight||0:N);m+=n+(h.minHeight||N||0);if(typeof I!="number"){if(g){h.doLayout()}I=h.getWidth()}u=Math.max(u,I+t.left+t.right);G.push({component:h,height:N||undefined,width:I||undefined})}var M=L-c,l=m>c;var q=Math.max(0,(c-k-x));if(l){for(T=0,r=E;T<r;T++){G[T].height=o[T].minHeight||o[T].height||G[T].height}}else{if(M>0){var J=[];for(var D=0,r=E;D<r;D++){var A=o[D],s=A.minHeight||0;if(A.flex){G[D].height=s}else{J.push({minHeight:s,available:G[D].height-s,index:D})}}J.sort(function(Y,i){return Y.available>i.available?1:-1});for(var T=0,r=J.length;T<r;T++){var F=J[T].index;if(F==undefined){continue}var A=o[F],j=G[F],v=j.height,s=A.minHeight,B=Math.max(s,v-Math.ceil(M/(r-T))),e=v-B;G[F].height=B;M-=e}}else{var Q=q,p=U;for(T=0;T<E;T++){h=o[T];H=G[T];t=h.margins;w=t.left+t.right;if(P&&h.flex&&!h.height){S=Math.ceil((h.flex/p)*Q);Q-=S;p-=h.flex;H.height=S;H.dirtySize=true}}}}if(X){C+=q/2}else{if(z){C+=q}}for(T=0;T<E;T++){h=o[T];H=G[T];t=h.margins;C+=t.top;w=t.left+t.right;H.left=V+t.left;H.top=C;switch(this.align){case"stretch":d=K-w;H.width=d.constrain(h.minWidth||0,h.maxWidth||1000000);H.dirtySize=true;break;case"stretchmax":d=u-w;H.width=d.constrain(h.minWidth||0,h.maxWidth||1000000);H.dirtySize=true;break;case"center":var y=K-H.width-w;if(y>0){H.left=V+w+(y/2)}}C+=H.height+t.bottom}return{boxes:G,meta:{maxWidth:u,nonFlexHeight:k,desiredHeight:L,minimumHeight:m,shortfall:L-c,tooNarrow:l}}}});Ext.Container.LAYOUTS.vbox=Ext.layout.VBoxLayout;Ext.layout.ToolbarLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"toolbar",triggerWidth:18,noItemsMenuText:'<div class="x-toolbar-no-items">(None)</div>',lastOverflow:false,tableHTML:['<table cellspacing="0" class="x-toolbar-ct">',"<tbody>","<tr>",'<td class="x-toolbar-left" align="{0}">','<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-left-row"></tr>',"</tbody>","</table>","</td>",'<td class="x-toolbar-right" align="right">','<table cellspacing="0" class="x-toolbar-right-ct">',"<tbody>","<tr>","<td>",'<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-right-row"></tr>',"</tbody>","</table>","</td>","<td>",'<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-extras-row"></tr>',"</tbody>","</table>","</td>","</tr>","</tbody>","</table>","</td>","</tr>","</tbody>","</table>"].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<g;b++,d++){m=l[b];if(m.isFill){k=this.rightTr;d=-1}else{if(!m.rendered){m.render(this.insertCell(m,k,d));this.configureItem(m)}else{if(!m.xtbHidden&&!this.isValidParent(m,k.childNodes[d])){var a=this.insertCell(m,k,d);a.appendChild(m.getPositionEl().dom);m.container=Ext.get(a)}}}}this.cleanup(this.leftTr);this.cleanup(this.rightTr);this.cleanup(this.extrasTr);this.fitToSize(j)},cleanup:function(b){var e=b.childNodes,a,d;for(a=e.length-1;a>=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;g<h;g++){o=l[g];if(!o.isFill){d+=this.getItemWidth(o);if(d>m){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<a;d++){g=b[d];if(g.xtbHidden){if(e&&(c(g,e)||c(e,g))){h.add("-")}this.addComponentToMenu(h,g);e=g}}if(h.items.length<1){h.add(this.noItemsMenuText)}},initMore:function(){if(!this.more){this.moreMenu=new Ext.menu.Menu({ownerCt:this.container,listeners:{beforeshow:this.beforeMoreShow,scope:this}});this.more=new Ext.Button({iconCls:"x-toolbar-more-icon",cls:"x-toolbar-more",menu:this.moreMenu,ownerCt:this.container});var a=this.insertCell(this.more,this.extrasTr,100);this.more.render(a)}},destroy:function(){Ext.destroy(this.more,this.moreMenu);delete this.leftTr;delete this.rightTr;delete this.extrasTr;Ext.layout.ToolbarLayout.superclass.destroy.call(this)}});Ext.Container.LAYOUTS.toolbar=Ext.layout.ToolbarLayout;Ext.layout.MenuLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"menu",setContainer:function(a){this.monitorResize=!a.floating;a.on("autosize",this.doAutoSize,this);Ext.layout.MenuLayout.superclass.setContainer.call(this,a)},renderItem:function(g,b,e){if(!this.itemTpl){this.itemTpl=Ext.layout.MenuLayout.prototype.itemTpl=new Ext.XTemplate('<li id="{itemId}" class="{itemCls}">','<tpl if="needsIcon">','<img alt="{altText}" src="{icon}" class="{iconCls}"/>',"</tpl>","</li>")}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)}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(d){var a=d instanceof Ext.menu.Item,b=!(a||d instanceof Ext.menu.Separator);return{isMenuItem:a,needsIcon:b&&(d.icon||d.iconCls),icon:d.icon||Ext.BLANK_IMAGE_URL,iconCls:"x-menu-item-icon "+(d.iconCls||""),itemId:"x-menu-el-"+d.id,itemCls:"x-menu-list-item ",altText:d.altText||""}},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||Ext.isIE9)?"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='<span class="'+this.headerTextCls+'">'+this.header.dom.innerHTML+"</span>";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",alt:"",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('<div class="x-tool x-tool-{id}">&#160;</div>');h.disableFormats=true;h.compile();Ext.Panel.prototype.toolTemplate=h}for(var g=0,d=arguments,c=d.length;g<c;g++){var b=d[g];if(!this.tools[b.id]){var j="x-tool-"+b.id+"-over";var e=this.toolTemplate.insertFirst(this[this.toolTarget],b,true);this.tools[b.id]=e;e.enableDisplayMode("block");this.mon(e,"click",this.createToolHandler(e,b,j,this));if(b.on){this.mon(e,b.on)}if(b.hidden){e.hide()}if(b.qtip){if(Ext.isObject(b.qtip)){Ext.QuickTips.register(Ext.apply({target:e.id},b.qtip))}else{e.dom.qtip=b.qtip}}e.addClassOnOver(j)}}},onLayout:function(b,a){Ext.Panel.superclass.onLayout.apply(this,arguments);if(this.hasLayout&&this.toolbars.length>0){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=this.el.getFrameWidth("tb")+this.bwrap.getFrameWidth("tb");a+=(this.tbar?this.tbar.getHeight():0)+(this.bbar?this.bbar.getHeight():0);if(this.frame){a+=this.el.dom.firstChild.offsetHeight+this.ft.dom.offsetHeight+this.mc.getFrameWidth("tb")}else{a+=(this.header?this.header.getHeight():0)+(this.footer?this.footer.getHeight():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||(Ext.isIE7&&Ext.isStrict)){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('<tpl for="."><a href="#" class="color-{.}" hidefocus="on"><em><span style="background:#{.}" unselectable="on">&#160;</span></em></a></tpl>');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:"&#160;OK&#160;",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=['<table cellspacing="0">','<tr><td class="x-date-left"><a href="#" title="',this.prevText,'">&#160;</a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="',this.nextText,'">&#160;</a></td></tr>','<tr><td colspan="3"><table class="x-date-inner" cellspacing="0"><thead><tr>'],c=this.dayNames,h;for(h=0;h<7;h++){var k=this.startDay+h;if(k>6){k=k-7}a.push("<th><span>",c[k].substr(0,1),"</span></th>")}a[a.length]="</tr></thead><tbody><tr>";for(h=0;h<42;h++){if(h%7===0&&h!==0){a[a.length]="</tr><tr>"}a[a.length]='<td><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span></span></em></a></td>'}a.push("</tr></tbody></table></td></tr>",this.showToday?'<tr><td colspan="3" class="x-date-bottom" align="center"></td></tr>':"",'</table><div class="x-date-mp"></div>');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:"&#160;",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=['<table border="0" cellspacing="0">'];for(var b=0;b<6;b++){a.push('<tr><td class="x-date-mp-month"><a href="#">',Date.getShortMonthName(b),"</a></td>",'<td class="x-date-mp-month x-date-mp-sep"><a href="#">',Date.getShortMonthName(b+6),"</a></td>",b===0?'<td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-prev"></a></td><td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-next"></a></td></tr>':'<td class="x-date-mp-year"><a href="#"></a></td><td class="x-date-mp-year"><a href="#"></a></td></tr>')}a.push('<tr class="x-date-mp-btns"><td colspan="4"><button type="button" class="x-date-mp-ok">',this.okText,'</button><button type="button" class="x-date-mp-cancel">',this.cancelText,"</button></td></tr>","</table>");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=(m<u||m>y||(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(i<u){d.className=" x-date-disabled";d.title=J.minText;return}if(i>y){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<g;x++){r[x].innerHTML=(++h);D.setDate(D.getDate()+1);e[x].className="x-date-prevday";l(this,e[x])}for(;x<k;x++){var b=x-g+1;r[x].innerHTML=(b);D.setDate(D.getDate()+1);e[x].className="x-date-active";l(this,e[x])}var H=0;for(;x<42;x++){r[x].innerHTML=(++H);D.setDate(D.getDate()+1);e[x].className="x-date-nextday";l(this,e[x])}this.mbtn.setText(this.monthNames[G.getMonth()]+" "+G.getFullYear());if(!this.internalRender){var j=this.el.dom.firstChild,n=j.offsetWidth;this.el.setWidth(n+this.el.getBorderWidth("lr"));Ext.fly(j).setWidth(n);this.internalRender=true;if(Ext.isOpera&&!this.secondPass){j.rows[0].cells[1].style.width=(n-(j.rows[0].cells[0].offsetWidth+j.rows[0].cells[2].offsetWidth))+"px";this.secondPass=true;this.update.defer(10,this,[G])}}}},beforeDestroy:function(){if(this.rendered){Ext.destroy(this.keyNav,this.monthPicker,this.eventEl,this.mbtn,this.nextRepeater,this.prevRepeater,this.cells.el,this.todayBtn);delete this.textNodes;delete this.cells.elements}}});Ext.reg("datepicker",Ext.DatePicker);Ext.LoadMask=function(c,b){this.el=Ext.get(c);Ext.apply(this,b);if(this.store){this.store.on({scope:this,beforeload:this.onBeforeLoad,load:this.onLoad,exception:this.onLoad});this.removeMask=Ext.value(this.removeMask,false)}else{var a=this.el.getUpdater();a.showLoadIndicator=false;a.on({scope:this,beforeupdate:this.onBeforeLoad,update:this.onLoad,failure:this.onLoad});this.removeMask=Ext.value(this.removeMask,true)}};Ext.LoadMask.prototype={msg:"Loading...",msgCls:"x-mask-loading",disabled:false,disable:function(){this.disabled=true},enable:function(){this.disabled=false},onLoad:function(){this.el.unmask(this.removeMask)},onBeforeLoad:function(){if(!this.disabled){this.el.mask(this.msg,this.msgCls)}},show:function(){this.onBeforeLoad()},hide:function(){this.onLoad()},destroy:function(){if(this.store){this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.onLoad,this)}else{var a=this.el.getUpdater();a.un("beforeupdate",this.onBeforeLoad,this);a.un("update",this.onLoad,this);a.un("failure",this.onLoad,this)}}};Ext.slider.Thumb=Ext.extend(Object,{dragging:false,constructor:function(a){Ext.apply(this,a||{},{cls:"x-slider-thumb",constrain:false});Ext.slider.Thumb.superclass.constructor.call(this,a);if(this.slider.vertical){Ext.apply(this,Ext.slider.Thumb.Vertical)}},render:function(){this.el=this.slider.innerEl.insertFirst({cls:this.cls});this.initEvents()},enable:function(){this.disabled=false;this.el.removeClass(this.slider.disabledClass)},disable:function(){this.disabled=true;this.el.addClass(this.slider.disabledClass)},initEvents:function(){var a=this.el;a.addClassOnOver("x-slider-thumb-over");this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeDragStart.createDelegate(this),onStart:this.onDragStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onDragEnd.createDelegate(this),tolerance:3,autoStart:300});this.tracker.initEl(a)},onBeforeDragStart:function(a){if(this.disabled){return false}else{this.slider.promoteThumb(this);return true}},onDragStart:function(a){this.el.addClass("x-slider-thumb-drag");this.dragging=true;this.dragStartValue=this.value;this.slider.fireEvent("dragstart",this.slider,a,this)},onDrag:function(g){var c=this.slider,b=this.index,d=this.getNewValue();if(this.constrain){var a=c.thumbs[b+1],h=c.thumbs[b-1];if(h!=undefined&&d<=h.value){d=h.value}if(a!=undefined&&d>=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)}},destroy:function(){Ext.destroyMembers(this,"tracker","el")}});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,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;b<a.length;b++){this.addThumb(a[b])}if(this.vertical){Ext.apply(this,Ext.slider.Vertical)}},addThumb:function(b){var a=new Ext.slider.Thumb({value:b,slider:this,index:this.thumbs.length,constrain:this.constrainThumbs});this.thumbs.push(a);if(this.rendered){a.render()}},promoteThumb:function(d){var a=this.thumbs,g,b;for(var e=0,c=a.length;e<c;e++){b=a[e];if(b==d){g=this.topThumbZIndex}else{g=""}b.el.setStyle("zIndex",g)}},onRender:function(){this.autoEl={cls:"x-slider "+(this.vertical?"x-slider-vert":"x-slider-horz"),cn:{cls:"x-slider-end",cn:{cls:"x-slider-inner",cn:[{tag:"a",cls:"x-slider-focus",href:"#",tabIndex:"-1",hidefocus:"on"}]}}};Ext.slider.MultiSlider.superclass.onRender.apply(this,arguments);this.endEl=this.el.first();this.innerEl=this.endEl.first();this.focusEl=this.innerEl.child(".x-slider-focus");for(var b=0;b<this.thumbs.length;b++){this.thumbs[b].render()}var a=this.innerEl.child(".x-slider-thumb");this.halfThumb=(this.vertical?a.getHeight():a.getWidth())/2;this.initEvents()},initEvents:function(){this.mon(this.el,{scope:this,mousedown:this.onMouseDown,keydown:this.onKeyDown});this.focusEl.swallowEvent("click",true)},onMouseDown:function(d){if(this.disabled){return}var c=false;for(var b=0;b<this.thumbs.length;b++){c=c||d.target==this.thumbs[b].el.dom}if(this.clickToChange&&!c){var a=this.innerEl.translatePoints(d.getXY());this.onClickChange(a)}this.focus()},onClickChange:function(c){if(c.top>this.clickRange[0]&&c.top<this.clickRange[1]){var a=this.getNearest(c,"left"),b=a.index;this.setValue(b,Ext.util.Format.round(this.reverseValue(c.left),this.decimalPrecision),undefined,true)}},getNearest:function(k,b){var m=b=="top"?this.innerEl.getHeight()-k[b]:k[b],g=this.reverseValue(m),j=(this.maxValue-this.minValue)+5,e=0,c=null;for(var d=0;d<this.thumbs.length;d++){var a=this.thumbs[d],l=a.value,h=Math.abs(l-g);if(Math.abs(h<=j)){c=a;e=d;j=h}}return c},onKeyDown:function(b){if(this.disabled||this.thumbs.length!==1){b.preventDefault();return}var a=b.getKey(),c;switch(a){case b.UP:case b.RIGHT:b.stopEvent();c=b.ctrlKey?this.maxValue:this.getValue(0)+this.keyIncrement;this.setValue(0,c,undefined,true);break;case b.DOWN:case b.LEFT:b.stopEvent();c=b.ctrlKey?this.minValue:this.getValue(0)-this.keyIncrement;this.setValue(0,c,undefined,true);break;default:b.preventDefault()}},doSnap:function(b){if(!(this.increment&&b)){return b}var d=b,c=this.increment,a=b%c;if(a!=0){d-=a;if(a*2>=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;c<this.thumbs.length;c++){var b=this.thumbs[c];if(b.value!==undefined){var a=this.normalizeValue(b.value);if(a!==b.value){this.setValue(c,a,false)}else{this.moveThumb(c,this.translateValue(a),false)}}}},getRatio:function(){var a=this.innerEl.getWidth(),b=this.maxValue-this.minValue;return b==0?a:(a/b)},normalizeValue:function(a){a=this.doSnap(a);a=Ext.util.Format.round(a,this.decimalPrecision);a=a.constrain(this.minValue,this.maxValue);return a},setMinValue:function(e){this.minValue=e;var d=0,b=this.thumbs,a=b.length,c;for(;d<a;++d){c=b[d];c.value=c.value<e?e:c.value}this.syncThumb()},setMaxValue:function(e){this.maxValue=e;var d=0,b=this.thumbs,a=b.length,c;for(;d<a;++d){c=b[d];c.value=c.value>e?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(;d<a;++d){b[d].el.stopFx()}if(Ext.isNumber(c)){this.innerEl.setWidth(c-(this.el.getPadding("l")+this.endEl.getPadding("r")))}this.syncThumb();Ext.slider.MultiSlider.superclass.onResize.apply(this,arguments)},onDisable:function(){Ext.slider.MultiSlider.superclass.onDisable.call(this);for(var b=0;b<this.thumbs.length;b++){var a=this.thumbs[b],c=a.el;a.disable();if(Ext.isIE){var d=c.getXY();c.hide();this.innerEl.addClass(this.disabledClass).dom.disabled=true;if(!this.thumbHolder){this.thumbHolder=this.endEl.createChild({cls:"x-slider-thumb "+this.disabledClass})}this.thumbHolder.show().setXY(d)}}},onEnable:function(){Ext.slider.MultiSlider.superclass.onEnable.call(this);for(var b=0;b<this.thumbs.length;b++){var a=this.thumbs[b],c=a.el;a.enable();if(Ext.isIE){this.innerEl.removeClass(this.disabledClass).dom.disabled=false;if(this.thumbHolder){this.thumbHolder.hide()}c.show();this.syncThumb()}}},syncThumb:function(){if(this.rendered){for(var a=0;a<this.thumbs.length;a++){this.moveThumb(a,this.translateValue(this.thumbs[a].value))}}},getValue:function(a){return this.thumbs[a].value},getValues:function(){var a=[];for(var b=0;b<this.thumbs.length;b++){a.push(this.thumbs[b].value)}return a},beforeDestroy:function(){var b=this.thumbs;for(var c=0,a=b.length;c<a;++c){b[c].destroy();b[c]=null}Ext.destroyMembers(this,"endEl","innerEl","focusEl","thumbHolder");Ext.slider.MultiSlider.superclass.beforeDestroy.call(this)}});Ext.reg("multislider",Ext.slider.MultiSlider);Ext.slider.SingleSlider=Ext.extend(Ext.slider.MultiSlider,{constructor:function(a){a=a||{};Ext.applyIf(a,{values:[a.value||0]});Ext.slider.SingleSlider.superclass.constructor.call(this,a)},getValue:function(){return Ext.slider.SingleSlider.superclass.getValue.call(this,0)},setValue:function(d,b){var c=Ext.toArray(arguments),a=c.length;if(a==1||(a<=3&&typeof arguments[1]!="number")){c.unshift(0)}return Ext.slider.SingleSlider.superclass.setValue.apply(this,c)},syncThumb:function(){return Ext.slider.SingleSlider.superclass.syncThumb.apply(this,[0].concat(arguments))},getNearest:function(){return this.thumbs[0]}});Ext.Slider=Ext.slider.SingleSlider;Ext.reg("slider",Ext.slider.SingleSlider);Ext.slider.Vertical={onResize:function(a,b){this.innerEl.setHeight(b-(this.el.getPadding("t")+this.endEl.getPadding("b")));this.syncThumb()},getRatio:function(){var b=this.innerEl.getHeight(),a=this.maxValue-this.minValue;return b/a},moveThumb:function(d,c,b){var a=this.thumbs[d],e=a.el;if(!b||this.animate===false){e.setBottom(c)}else{e.shift({bottom:c,stopFx:true,duration:0.35})}},onClickChange:function(c){if(c.left>this.clickRange[0]&&c.left<this.clickRange[1]){var a=this.getNearest(c,"top"),b=a.index,d=this.minValue+this.reverseValue(this.innerEl.getHeight()-c.top);this.setValue(b,Ext.util.Format.round(d,this.decimalPrecision),undefined,true)}}};Ext.slider.Thumb.Vertical={getNewValue:function(){var b=this.slider,c=b.innerEl,d=c.translatePoints(this.tracker.getXY()),a=c.getHeight()-d.top;return b.minValue+Ext.util.Format.round(a/b.getRatio(),b.decimalPrecision)}};Ext.ProgressBar=Ext.extend(Ext.BoxComponent,{baseCls:"x-progress",animate:false,waitTimer:null,initComponent:function(){Ext.ProgressBar.superclass.initComponent.call(this);this.addEvents("update")},onRender:function(d,a){var c=new Ext.Template('<div class="{cls}-wrap">','<div class="{cls}-inner">','<div class="{cls}-bar">','<div class="{cls}-text">',"<div>&#160;</div>","</div>","</div>",'<div class="{cls}-text {cls}-text-back">',"<div>&#160;</div>","</div>","</div>","</div>");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||"&#160;";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<c;++e){if(this.invalidHandleClasses[e]==d){delete this.invalidHandleClasses[e]}}},isValidHandleChild:function(h){var g=true;var k;try{k=h.nodeName.toUpperCase()}catch(j){k=h.nodeName}g=g&&!this.invalidHandleTypes[k];g=g&&!this.invalidHandleIds[h.id];for(var d=0,c=this.invalidHandleClasses.length;g&&d<c;++d){g=!Ext.fly(h).hasClass(this.invalidHandleClasses[d])}return g},setXTicks:function(g,c){this.xTicks=[];this.xTickSize=c;var e={};for(var d=this.initPageX;d>=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<c;++d){var e=d+1;if(g[e]&&g[e]>=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;d<b;++d){if(c[d].id==e.id){return true}}return false},isTypeOfDD:function(b){return(b&&b.__ygDragDrop)},isHandle:function(c,b){return(this.handleIds[c]&&this.handleIds[c][b])},getDDById:function(c){for(var b in this.ids){if(this.ids[b][c]){return this.ids[b][c]}}return null},handleMouseDown:function(d,c){if(Ext.QuickTips){Ext.QuickTips.ddDisable()}if(this.dragCurrent){this.handleMouseUp(d)}this.currentTarget=d.getTarget();this.dragCurrent=c;var b=c.getEl();this.startX=d.getPageX();this.startY=d.getPageY();this.deltaX=this.startX-b.offsetLeft;this.deltaY=this.startY-b.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var e=Ext.dd.DDM;e.startDrag(e.startX,e.startY)},this.clickTimeThresh)},startDrag:function(b,c){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(b,c);this.dragCurrent.startDrag(b,c)}this.dragThreshMet=true},handleMouseUp:function(b){if(Ext.QuickTips){Ext.QuickTips.ddEnable()}if(!this.dragCurrent){return}clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(b,true)}else{}this.stopDrag(b);this.stopEvent(b)},stopEvent:function(b){if(this.stopPropagation){b.stopPropagation()}if(this.preventDefault){b.preventDefault()}},stopDrag:function(b){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(b);this.dragCurrent.endDrag(b)}this.dragCurrent.onMouseUp(b)}this.dragCurrent=null;this.dragOvers={}},handleMouseMove:function(d){if(!this.dragCurrent){return true}if(Ext.isIE&&(d.button!==0&&d.button!==1&&d.button!==2)){this.stopEvent(d);return this.handleMouseUp(d)}if(!this.dragThreshMet){var c=Math.abs(this.startX-d.getPageX());var b=Math.abs(this.startY-d.getPageY());if(c>this.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;h<m;++h){q.b4DragOut(n,g[h].id);q.onDragOut(n,g[h].id)}for(h=0,m=d.length;h<m;++h){q.onDragEnter(n,d[h].id)}for(h=0,m=l.length;h<m;++h){q.b4DragOver(n,l[h].id);q.onDragOver(n,l[h].id)}for(h=0,m=j.length;h<m;++h){q.b4DragDrop(n,j[h].id);q.onDragDrop(n,j[h].id)}}if(o&&!j.length){q.onInvalidDrop(n)}},getBestMatch:function(d){var g=null;var c=d.length;if(c==1){g=d[0]}else{for(var e=0;e<c;++e){var b=d[e];if(b.cursorIsOver){g=b;break}else{if(!g||g.overlap.getArea()<b.overlap.getArea()){g=b}}}}return g},refreshCache:function(c){for(var b in c){if("string"!=typeof b){continue}for(var d in this.ids[b]){var e=this.ids[b][d];if(this.isTypeOfDD(e)){var g=this.getLocation(e);if(g){this.locationCache[e.id]=g}else{delete this.locationCache[e.id]}}}}},verifyEl:function(c){if(c){var b;if(Ext.isIE){try{b=c.offsetParent}catch(d){}}else{b=c.offsetParent}if(b){return true}}return false},getLocation:function(j){if(!this.isTypeOfDD(j)){return null}var h=j.getEl(),o,g,d,q,p,s,c,n,i,m;try{o=Ext.lib.Dom.getXY(h)}catch(k){}if(!o){return null}g=o[0];d=g+h.offsetWidth;q=o[1];p=q+h.offsetHeight;s=q-j.padding[0];c=d+j.padding[1];n=p+j.padding[2];i=g-j.padding[3];m=new Ext.lib.Region(s,c,n,i);h=Ext.get(h.parentNode);while(h&&m){if(h.isScrollable()){m=m.intersect(h.getRegion())}h=h.parent()}return m},isOverTarget:function(k,b,d){var g=this.locationCache[b.id];if(!g||!this.useCache){g=this.getLocation(b);this.locationCache[b.id]=g}if(!g){return false}b.cursorIsOver=g.contains(k);var j=this.dragCurrent;if(!j||!j.getTargetCoord||(!d&&!j.constrainX&&!j.constrainY)){return b.cursorIsOver}b.overlap=null;var h=j.getTargetCoord(k.x,k.y);var c=j.getDragEl();var e=new Ext.lib.Region(h.y,h.x+c.offsetWidth,h.y+c.offsetHeight,h.x);var i=e.intersect(g);if(i){b.overlap=i;return(d)?true:b.cursorIsOver}else{return false}},_onUnload:function(c,b){a.removeListener(document,"mouseup",this.handleMouseUp,this);a.removeListener(document,"mousemove",this.handleMouseMove,this);a.removeListener(window,"resize",this._onResize,this);Ext.dd.DragDropMgr.unregAll()},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null}this._execOnAll("unreg",[]);for(var b in this.elementCache){delete this.elementCache[b]}this.elementCache={};this.ids={}},elementCache:{},getElWrapper:function(c){var b=this.elementCache[c];if(!b||!b.el){b=this.elementCache[c]=new this.ElementWrapper(Ext.getDom(c))}return b},getElement:function(b){return Ext.getDom(b)},getCss:function(c){var b=Ext.getDom(c);return(b)?b.style:null},ElementWrapper:function(b){this.el=b||null;this.id=this.el&&b.id;this.css=this.el&&b.style},getPosX:function(b){return Ext.lib.Dom.getX(b)},getPosY:function(b){return Ext.lib.Dom.getY(b)},swapNode:function(d,b){if(d.swapNode){d.swapNode(b)}else{var e=b.parentNode;var c=b.nextSibling;if(c==d){e.insertBefore(d,b)}else{if(b==d.nextSibling){e.insertBefore(b,d)}else{d.parentNode.replaceChild(b,d);e.insertBefore(d,c)}}}},getScroll:function(){var d,b,e=document.documentElement,c=document.body;if(e&&(e.scrollTop||e.scrollLeft)){d=e.scrollTop;b=e.scrollLeft}else{if(c){d=c.scrollTop;b=c.scrollLeft}else{}}return{top:d,left:b}},getStyle:function(c,b){return Ext.fly(c).getStyle(b)},getScrollTop:function(){return this.getScroll().top},getScrollLeft:function(){return this.getScroll().left},moveToEl:function(b,d){var c=Ext.lib.Dom.getXY(d);Ext.lib.Dom.setXY(b,c)},numericSort:function(d,c){return(d-c)},_timeoutCount:0,_addListeners:function(){var b=Ext.dd.DDM;if(Ext.lib.Event&&document){b._onLoad()}else{if(b._timeoutCount>2000){}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&&i<c){window.scrollTo(d,p+a)}if(k<p&&p>0&&k-p<c){window.scrollTo(d,p-a)}if(o>b&&g<c){window.scrollTo(d+a,p)}if(l<d&&d>0&&l-d<c){window.scrollTo(d-a,p)}}},getTargetCoord:function(c,b){var a=c-this.deltaX;var d=b-this.deltaY;if(this.constrainX){if(a<this.minX){a=this.minX}if(a>this.maxX){a=this.maxX}}if(this.constrainY){if(d<this.minY){d=this.minY}if(d>this.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);delete this.el},onMouseDown:function(b,a){if(this.fireEvent("mousedown",this,b)!==false&&this.onBeforeStart(b)!==false){this.startXY=this.lastXY=b.getXY();this.dragTarget=this.delegate?a:this.el.dom;if(this.preventDefault!==false){b.preventDefault()}Ext.getDoc().on({scope:this,mouseup:this.onMouseUp,mousemove:this.onMouseMove,selectstart:this.stopSelect});if(this.autoStart){this.timer=this.triggerStart.defer(this.autoStart===true?1000:this.autoStart,this,[b])}}},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(d)}else{return}}this.fireEvent("mousemove",this,d);this.onDrag(d);this.fireEvent("drag",this,d)},onMouseUp:function(c){var b=Ext.getDoc(),a=this.active;b.un("mousemove",this.onMouseMove,this);b.un("mouseup",this.onMouseUp,this);b.un("selectstart",this.stopSelect,this);c.preventDefault();this.clearStart();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(a);this.fireEvent("dragstart",this,a)},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),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 o=m.ddScrollConfig?m.ddScrollConfig.ddGroup:undefined,n=(m.ddScrollConfig&&m.ddScrollConfig.frequency)?m.ddScrollConfig.frequency:Ext.dd.ScrollManager.frequency;if(o===undefined||c.dragCurrent.ddGroup==o){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<l;m++){this.register(n[m])}}else{n=Ext.get(n);e[n.id]=n}},unregister:function(n){if(Ext.isArray(n)){for(var m=0,l=n.length;m<l;m++){this.unregister(n[m])}}else{n=Ext.get(n);delete e[n.id]}},vthresh:25,hthresh:25,increment:100,frequency:500,animate:true,animDuration:0.4,ddGroup:undefined,refreshCache:function(){for(var l in e){if(typeof e[l]=="object"){e[l]._region=e[l].getRegion()}}}}}();Ext.dd.Registry=function(){var d={};var b={};var a=0;var c=function(g,e){if(typeof g=="string"){return g}var h=g.id;if(!h&&e!==false){h="extdd-"+(++a);g.id=h}return h};return{register:function(j,k){k=k||{};if(typeof j=="string"){j=document.getElementById(j)}k.ddel=j;d[c(j)]=k;if(k.isHandle!==false){b[k.ddel.id]=k}if(k.handles){var h=k.handles;for(var g=0,e=h.length;g<e;g++){b[c(h[g])]=k}}},unregister:function(j){var l=c(j,false);var k=d[l];if(k){delete d[l];if(k.handles){var h=k.handles;for(var g=0,e=h.length;g<e;g++){delete b[c(h[g],false)]}}}},getHandle:function(e){if(typeof e!="string"){e=e.id}return b[e]},getHandleFromEvent:function(h){var g=Ext.lib.Event.getTarget(h);return g?b[g.id]:null},getTarget:function(e){if(typeof e!="string"){e=e.id}return d[e]},getTargetFromEvent:function(h){var g=Ext.lib.Event.getTarget(h);return g?d[g.id]||b[g.id]:null}}}();Ext.dd.StatusProxy=function(a){Ext.apply(this,a);this.id=this.id||Ext.id();this.el=new Ext.Layer({dh:{id:this.id,tag:"div",cls:"x-dd-drag-proxy "+this.dropNotAllowed,children:[{tag:"div",cls:"x-dd-drop-icon"},{tag:"div",cls:"x-dd-drag-ghost"}]},shadow:!a||a.shadow!==false});this.ghost=Ext.get(this.el.dom.childNodes[1]);this.dropStatus=this.dropNotAllowed};Ext.dd.StatusProxy.prototype={dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",setStatus:function(a){a=a||this.dropNotAllowed;if(this.dropStatus!=a){this.el.replaceClass(this.dropStatus,a);this.dropStatus=a}},reset:function(a){this.el.dom.className="x-dd-drag-proxy "+this.dropNotAllowed;this.dropStatus=this.dropNotAllowed;if(a){this.ghost.update("")}},update:function(a){if(typeof a=="string"){this.ghost.update(a)}else{this.ghost.update("");a.style.margin="0";this.ghost.dom.appendChild(a)}var b=this.ghost.dom.firstChild;if(b){Ext.fly(b).setStyle("float","none")}},getEl:function(){return this.el},getGhost:function(){return this.ghost},hide:function(a){this.el.hide();if(a){this.reset(true)}},stop:function(){if(this.anim&&this.anim.isAnimated&&this.anim.isAnimated()){this.anim.stop()}},show:function(){this.el.show()},sync:function(){this.el.sync()},repair:function(b,c,a){this.callback=c;this.scope=a;if(b&&this.animRepair!==false){this.el.addClass("x-dd-drag-repair");this.el.hideUnders(true);this.anim=this.el.shift({duration:this.repairDuration||0.5,easing:"easeOut",xy:b,stopFx:true,callback:this.afterRepair,scope:this})}else{this.afterRepair()}},afterRepair:function(){this.hide(true);if(typeof this.callback=="function"){this.callback.call(this.scope||this)}this.callback=null;this.scope=null},destroy:function(){Ext.destroy(this.ghost,this.el)}};Ext.dd.DragSource=function(b,a){this.el=Ext.get(b);if(!this.dragData){this.dragData={}}Ext.apply(this,a);if(!this.proxy){this.proxy=new Ext.dd.StatusProxy()}Ext.dd.DragSource.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{dragElId:this.proxy.id,resizeFrame:false,isTarget:false,scroll:this.scroll===true});this.dragging=false};Ext.extend(Ext.dd.DragSource,Ext.dd.DDProxy,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",getDragData:function(a){return this.dragData},onDragEnter:function(c,d){var b=Ext.dd.DragDropMgr.getDDById(d);this.cachedTarget=b;if(this.beforeDragEnter(b,c,d)!==false){if(b.isNotifyTarget){var a=b.notifyEnter(this,c,this.dragData);this.proxy.setStatus(a)}else{this.proxy.setStatus(this.dropAllowed)}if(this.afterDragEnter){this.afterDragEnter(b,c,d)}}},beforeDragEnter:function(b,a,c){return true},alignElWithMouse:function(){Ext.dd.DragSource.superclass.alignElWithMouse.apply(this,arguments);this.proxy.sync()},onDragOver:function(c,d){var b=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(d);if(this.beforeDragOver(b,c,d)!==false){if(b.isNotifyTarget){var a=b.notifyOver(this,c,this.dragData);this.proxy.setStatus(a)}if(this.afterDragOver){this.afterDragOver(b,c,d)}}},beforeDragOver:function(b,a,c){return true},onDragOut:function(b,c){var a=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(c);if(this.beforeDragOut(a,b,c)!==false){if(a.isNotifyTarget){a.notifyOut(this,b,this.dragData)}this.proxy.reset();if(this.afterDragOut){this.afterDragOut(a,b,c)}}this.cachedTarget=null},beforeDragOut:function(b,a,c){return true},onDragDrop:function(b,c){var a=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(c);if(this.beforeDragDrop(a,b,c)!==false){if(a.isNotifyTarget){if(a.notifyDrop(this,b,this.dragData)){this.onValidDrop(a,b,c)}else{this.onInvalidDrop(a,b,c)}}else{this.onValidDrop(a,b,c)}if(this.afterDragDrop){this.afterDragDrop(a,b,c)}}delete this.cachedTarget},beforeDragDrop:function(b,a,c){return true},onValidDrop:function(b,a,c){this.hideProxy();if(this.afterValidDrop){this.afterValidDrop(b,a,c)}},getRepairXY:function(b,a){return this.el.getXY()},onInvalidDrop:function(b,a,c){this.beforeInvalidDrop(b,a,c);if(this.cachedTarget){if(this.cachedTarget.isNotifyTarget){this.cachedTarget.notifyOut(this,a,this.dragData)}this.cacheTarget=null}this.proxy.repair(this.getRepairXY(a,this.dragData),this.afterRepair,this);if(this.afterInvalidDrop){this.afterInvalidDrop(a,c)}},afterRepair:function(){if(Ext.enableFx){this.el.highlight(this.hlColor||"c3daf9")}this.dragging=false},beforeInvalidDrop:function(b,a,c){return true},handleMouseDown:function(b){if(this.dragging){return}var a=this.getDragData(b);if(a&&this.onBeforeDrag(a,b)!==false){this.dragData=a;this.proxy.stop();Ext.dd.DragSource.superclass.handleMouseDown.apply(this,arguments)}},onBeforeDrag:function(a,b){return true},onStartDrag:Ext.emptyFn,startDrag:function(a,b){this.proxy.reset();this.dragging=true;this.proxy.update("");this.onInitDrag(a,b);this.proxy.show()},onInitDrag:function(a,c){var b=this.el.dom.cloneNode(true);b.id=Ext.id();this.proxy.update(b);this.onStartDrag(a,c);return true},getProxy:function(){return this.proxy},hideProxy:function(){this.proxy.hide();this.proxy.reset(true);this.dragging=false},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)},b4EndDrag:function(a){},endDrag:function(a){this.onEndDrag(this.dragData,a)},onEndDrag:function(a,b){},autoOffset:function(a,b){this.setDelta(-12,-20)},destroy:function(){Ext.dd.DragSource.superclass.destroy.call(this);Ext.destroy(this.proxy)}});Ext.dd.DropTarget=Ext.extend(Ext.dd.DDTarget,{constructor:function(b,a){this.el=Ext.get(b);Ext.apply(this,a);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el)}Ext.dd.DropTarget.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{isTarget:true})},dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",isTarget:true,isNotifyTarget:true,notifyEnter:function(a,c,b){if(this.overClass){this.el.addClass(this.overClass)}return this.dropAllowed},notifyOver:function(a,c,b){return this.dropAllowed},notifyOut:function(a,c,b){if(this.overClass){this.el.removeClass(this.overClass)}},notifyDrop:function(a,c,b){return false},destroy:function(){Ext.dd.DropTarget.superclass.destroy.call(this);if(this.containerScroll){Ext.dd.ScrollManager.unregister(this.el)}}});Ext.dd.DragZone=Ext.extend(Ext.dd.DragSource,{constructor:function(b,a){Ext.dd.DragZone.superclass.constructor.call(this,b,a);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el)}},getDragData:function(a){return Ext.dd.Registry.getHandleFromEvent(a)},onInitDrag:function(a,b){this.proxy.update(this.dragData.ddel.cloneNode(true));this.onStartDrag(a,b);return true},afterRepair:function(){if(Ext.enableFx){Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9")}this.dragging=false},getRepairXY:function(a){return Ext.Element.fly(this.dragData.ddel).getXY()},destroy:function(){Ext.dd.DragZone.superclass.destroy.call(this);if(this.containerScroll){Ext.dd.ScrollManager.unregister(this.el)}}});Ext.dd.DropZone=function(b,a){Ext.dd.DropZone.superclass.constructor.call(this,b,a)};Ext.extend(Ext.dd.DropZone,Ext.dd.DropTarget,{getTargetFromEvent:function(a){return Ext.dd.Registry.getTargetFromEvent(a)},onNodeEnter:function(d,a,c,b){},onNodeOver:function(d,a,c,b){return this.dropAllowed},onNodeOut:function(d,a,c,b){},onNodeDrop:function(d,a,c,b){return false},onContainerOver:function(a,c,b){return this.dropNotAllowed},onContainerDrop:function(a,c,b){return false},notifyEnter:function(a,c,b){return this.dropNotAllowed},notifyOver:function(a,c,b){var d=this.getTargetFromEvent(c);if(!d){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,c,b);this.lastOverNode=null}return this.onContainerOver(a,c,b)}if(this.lastOverNode!=d){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,c,b)}this.onNodeEnter(d,a,c,b);this.lastOverNode=d}return this.onNodeOver(d,a,c,b)},notifyOut:function(a,c,b){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,c,b);this.lastOverNode=null}},notifyDrop:function(a,c,b){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,c,b);this.lastOverNode=null}var d=this.getTargetFromEvent(c);return d?this.onNodeDrop(d,a,c,b):this.onContainerDrop(a,c,b)},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)}});Ext.Element.addMethods({initDD:function(c,b,d){var a=new Ext.dd.DD(Ext.id(this.dom),c,b);return Ext.apply(a,d)},initDDProxy:function(c,b,d){var a=new Ext.dd.DDProxy(Ext.id(this.dom),c,b);return Ext.apply(a,d)},initDDTarget:function(c,b,d){var a=new Ext.dd.DDTarget(Ext.id(this.dom),c,b);return Ext.apply(a,d)}});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,g){var b=(c.api[g])?c.api[g].url:null;var e=true;for(var d in c.api){if((e=(d===g)?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(i,j,g,e){var d=j.reader;var h=new Ext.data.Response({action:i,raw:g});switch(g.status){case 200:return true;break;case 201:if(Ext.isEmpty(h.raw.responseText)){h.success=true}else{return true}break;case 204:h.success=true;h.data=null;break;default:return true;break}if(h.success===true){this.fireEvent("write",this,i,h.data,h,e,j.request.arg)}else{this.fireEvent("exception",this,"remote",i,j,h,e)}j.request.callback.call(j.request.scope,h.data,h,h.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(g){return g.name});for(var b=0,a=e.length;b<a;b++){d.fields.add(new Ext.data.Field(e[b]))}c.getField=function(g){return d.fields.get(g)};return c};Ext.data.Record.PREFIX="ext-record";Ext.data.Record.AUTO_ID=1;Ext.data.Record.EDIT="edit";Ext.data.Record.REJECT="reject";Ext.data.Record.COMMIT="commit";Ext.data.Record.id=function(a){a.phantom=true;return[Ext.data.Record.PREFIX,"-",Ext.data.Record.AUTO_ID++].join("")};Ext.data.Record.prototype={dirty:false,editing:false,error:null,modified:null,phantom:false,join:function(a){this.store=a},set:function(a,c){var b=Ext.isPrimitive(c)?String:Ext.encode;if(b(this.data[a])==b(c)){return}this.dirty=true;if(!this.modified){this.modified={}}if(this.modified[a]===undefined){this.modified[a]=this.data[a]}this.data[a]=c;if(!this.editing){this.afterEdit()}},afterEdit:function(){if(this.store!=undefined&&typeof this.store.afterEdit=="function"){this.store.afterEdit(this)}},afterReject:function(){if(this.store){this.store.afterReject(this)}},afterCommit:function(){if(this.store){this.store.afterCommit(this)}},get:function(a){return this.data[a]},beginEdit:function(){this.editing=true;this.modified=this.modified||{}},cancelEdit:function(){this.editing=false;delete this.modified},endEdit:function(){this.editing=false;if(this.dirty){this.afterEdit()}},reject:function(b){var a=this.modified;for(var c in a){if(typeof a[c]!="function"){this.data[c]=a[c]}}this.dirty=false;delete this.modified;this.editing=false;if(b!==true){this.afterReject()}},commit:function(a){this.dirty=false;delete this.modified;this.editing=false;if(a!==true){this.afterCommit()}},getChanges:function(){var a=this.modified,b={};for(var c in a){if(a.hasOwnProperty(c)){b[c]=this.data[c]}}return b},hasError:function(){return this.error!==null},clearError:function(){this.error=null},copy:function(a){return new this.constructor(Ext.apply({},this.data),a||this.id)},isModified:function(a){return !!(this.modified&&this.modified.hasOwnProperty(a))},isValid:function(){return this.fields.find(function(a){return(a.allowBlank===false&&Ext.isEmpty(this.data[a.name]))?true:false},this)?false:true},markDirty:function(){this.dirty=true;if(!this.modified){this.modified={}}this.fields.each(function(a){this.modified[a.name]=this.data[a.name]},this)}};Ext.StoreMgr=Ext.apply(new Ext.util.MixedCollection(),{register:function(){for(var a=0,b;(b=arguments[a]);a++){this.add(b)}},unregister:function(){for(var a=0,b;(b=arguments[a]);a++){this.remove(this.lookup(b))}},lookup:function(e){if(Ext.isArray(e)){var b=["field1"],d=!Ext.isArray(e[0]);if(!d){for(var c=2,a=e[0].length;c<=a;++c){b.push("field"+c)}}return new Ext.data.ArrayStore({fields:b,data:e,expandData:d,autoDestroy:true,autoCreated:true})}return Ext.isObject(e)?(e.events?e:Ext.create(e,"store")):this.get(e)},getKey:function(a){return a.storeId}});Ext.data.Store=Ext.extend(Ext.util.Observable,{writer:undefined,remoteSort:false,autoDestroy:false,pruneModifiedRecords:false,lastOptions:null,autoSave:true,batch:true,restful:false,paramNames:undefined,defaultParamNames:{start:"start",limit:"limit",sort:"sort",dir:"dir"},isDestroyed:false,hasMultiSort:false,batchKey:"_ext_batch_",constructor:function(a){this.data=new Ext.util.MixedCollection(false);this.data.getKey=function(b){return b.id};this.removed=[];if(a&&a.data){this.inlineData=a.data;delete a.data}Ext.apply(this,a);this.baseParams=Ext.isObject(this.baseParams)?this.baseParams:{};this.paramNames=Ext.applyIf(this.paramNames||{},this.defaultParamNames);if((this.url||this.api)&&!this.proxy){this.proxy=new Ext.data.HttpProxy({url:this.url,api:this.api})}if(this.restful===true&&this.proxy){this.batch=false;Ext.data.Api.restify(this.proxy)}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){if(this.writer instanceof (Ext.data.DataWriter)===false){this.writer=this.buildWriter(this.writer)}this.writer.meta=this.reader.meta;this.pruneModifiedRecords=true}}if(this.recordType){this.fields=this.recordType.prototype.fields}this.modified=[];this.addEvents("datachanged","metachange","add","remove","update","clear","exception","beforeload","load","loadexception","beforewrite","write","beforesave","save");if(this.proxy){this.relayEvents(this.proxy,["loadexception","exception"])}if(this.writer){this.on({scope:this,add:this.createRecords,remove:this.destroyRecord,update:this.updateRecord,clear:this.onClear})}this.sortToggle={};if(this.sortField){this.setDefaultSort(this.sortField,this.sortDir)}else{if(this.sortInfo){this.setDefaultSort(this.sortInfo.field,this.sortInfo.direction)}}Ext.data.Store.superclass.constructor.call(this);if(this.id){this.storeId=this.id;delete this.id}if(this.storeId){Ext.StoreMgr.register(this)}if(this.inlineData){this.loadData(this.inlineData);delete this.inlineData}else{if(this.autoLoad){this.load.defer(10,this,[typeof this.autoLoad=="object"?this.autoLoad:undefined])}}this.batchCounter=0;this.batches={}},buildWriter:function(b){var a=undefined,c=(b.format||"json").toLowerCase();switch(c){case"json":a=Ext.data.JsonWriter;break;case"xml":a=Ext.data.XmlWriter;break;default:a=Ext.data.JsonWriter}return new a(b)},destroy:function(){if(!this.isDestroyed){if(this.storeId){Ext.StoreMgr.unregister(this)}this.clearData();this.data=null;Ext.destroy(this.proxy);this.reader=this.writer=null;this.purgeListeners();this.isDestroyed=true}},add:function(c){var e,a,b,d;c=[].concat(c);if(c.length<1){return}for(e=0,a=c.length;e<a;e++){b=c[e];b.join(this);if(b.dirty||b.phantom){this.modified.push(b)}}d=this.data.length;this.data.addAll(c);if(this.snapshot){this.snapshot.addAll(c)}this.fireEvent("add",this,c,d)},addSorted:function(a){var b=this.findInsertIndex(a);this.insert(b,a)},doUpdate:function(a){var b=a.id;this.getById(b).join(null);this.data.replace(b,a);if(this.snapshot){this.snapshot.replace(b,a)}a.join(this);this.fireEvent("update",this,a,Ext.data.Record.COMMIT)},remove:function(a){if(Ext.isArray(a)){Ext.each(a,function(c){this.remove(c)},this);return}var b=this.data.indexOf(a);if(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(d,c){var e,a,b;c=[].concat(c);for(e=0,a=c.length;e<a;e++){b=c[e];this.data.insert(d+e,b);b.join(this);if(b.dirty||b.phantom){this.modified.push(b)}}if(this.snapshot){this.snapshot.addAll(c)}this.fireEvent("add",this,c,d)},indexOf:function(a){return this.data.indexOf(a)},indexOfId:function(a){return this.data.indexOfKey(a)},getById:function(a){return(this.snapshot||this.data).key(a)},getAt:function(a){return this.data.itemAt(a)},getRange:function(b,a){return this.data.getRange(b,a)},storeOptions:function(a){a=Ext.apply({},a);delete a.callback;delete a.scope;this.lastOptions=a},clearData:function(){this.data.each(function(a){a.join(null)});this.data.clear()},load:function(b){b=Ext.apply({},b);this.storeOptions(b);if(this.sortInfo&&this.remoteSort){var a=this.paramNames;b.params=Ext.apply({},b.params);b.params[a.sort]=this.sortInfo.field;b.params[a.dir]=this.sortInfo.direction}try{return this.execute("read",null,b)}catch(c){this.handleException(c);return false}},updateRecord:function(b,a,c){if(c==Ext.data.Record.EDIT&&this.autoSave===true&&(!a.phantom||(a.phantom&&a.isValid()))){this.save()}},createRecords:function(c,b,e){var d=this.modified,h=b.length,a,g;for(g=0;g<h;g++){a=b[g];if(a.phantom&&a.isValid()){a.markDirty();if(d.indexOf(a)==-1){d.push(a)}}}if(this.autoSave===true){this.save()}},destroyRecord:function(b,a,c){if(this.modified.indexOf(a)!=-1){this.modified.remove(a)}if(!a.phantom){this.removed.push(a);a.lastIndex=c;if(this.autoSave===true){this.save()}}},execute:function(e,a,c,b){if(!Ext.data.Api.isAction(e)){throw new Ext.data.Api.Error("execute",e)}c=Ext.applyIf(c||{},{params:{}});if(b!==undefined){this.addToBatch(b)}var d=true;if(e==="read"){d=this.fireEvent("beforeload",this,c);Ext.applyIf(c.params,this.baseParams)}else{if(this.writer.listful===true&&this.restful!==true){a=(Ext.isArray(a))?a:[a]}else{if(Ext.isArray(a)&&a.length==1){a=a.shift()}}if((d=this.fireEvent("beforewrite",this,e,a,c))!==false){this.writer.apply(c.params,this.baseParams,e,a)}}if(d!==false){if(this.writer&&this.proxy.url&&!this.proxy.restful&&!Ext.data.Api.hasUniqueUrl(this.proxy,e)){c.params.xaction=e}this.proxy.request(Ext.data.Api.actions[e],a,c.params,this.reader,this.createCallback(e,a,b),this,c)}return d},save:function(){if(!this.writer){throw new Ext.data.Store.Error("writer-undefined")}var h=[],j,k,e,c={},d;if(this.removed.length){h.push(["destroy",this.removed])}var b=[].concat(this.getModifiedRecords());if(b.length){var g=[];for(d=b.length-1;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(d=0;d<j;++d){k=h[d];c[k[0]]=k[1]}if(this.fireEvent("beforesave",this,c)!==false){for(d=0;d<j;++d){k=h[d];this.doTransaction(k[0],k[1],e)}return e}}return -1},doTransaction:function(e,b,c){function g(h){try{this.execute(e,h,undefined,c)}catch(i){this.handleException(i)}}if(this.batch===false){for(var d=0,a=b.length;d<a;d++){g.call(this,b[d])}}else{g.call(this,b)}},addToBatch:function(c){var a=this.batches,d=this.batchKey+c,e=a[d];if(!e){a[d]=e={id:c,count:0,data:{}}}++e.count},removeFromBatch:function(d,h,g){var c=this.batches,e=this.batchKey+d,i=c[e],a;if(i){a=i.data[h]||[];i.data[h]=a.concat(g);if(i.count===1){g=i.data;delete c[e];this.fireEvent("save",this,d,g)}else{--i.count}}},createCallback:function(c,a,b){var d=Ext.data.Api.actions;return(c=="read")?this.loadRecords:function(g,e,h){this["on"+Ext.util.Format.capitalize(c)+"Records"](h,a,[].concat(g));if(h===true){this.fireEvent("write",this,c,g,e,a)}this.removeFromBatch(b,c,g)}},clearModified:function(a){if(Ext.isArray(a)){for(var b=a.length-1;b>=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<a;d++){this.reMap(b[d])}}else{delete this.data.map[b._phid];this.data.map[b.id]=b;var c=this.data.keys.indexOf(b._phid);this.data.keys.splice(c,1,b.id);delete b._phid}},onCreateRecords:function(d,a,b){if(d===true){try{this.reader.realize(a,b)}catch(c){this.handleException(c);if(Ext.isArray(a)){this.onCreateRecords(d,a,b)}}}},onUpdateRecords:function(d,a,b){if(d===true){try{this.reader.update(a,b)}catch(c){this.handleException(c);if(Ext.isArray(a)){this.onUpdateRecords(d,a,b)}}}},onDestroyRecords:function(e,b,d){b=(b instanceof Ext.data.Record)?[b]:[].concat(b);for(var c=0,a=b.length;c<a;c++){this.removed.splice(this.removed.indexOf(b[c]),1)}if(e===false){for(c=b.length-1;c>=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(b,l,h){var e,g;if(this.isDestroyed===true){return}if(!b||h===false){if(h!==false){this.fireEvent("load",this,[],l)}if(l.callback){l.callback.call(l.scope||this,[],l,false,b)}return}var a=b.records,j=b.totalRecords||a.length;if(!l||l.add!==true){if(this.pruneModifiedRecords){this.modified=[]}for(e=0,g=a.length;e<g;e++){a[e].join(this)}if(this.snapshot){this.data=this.snapshot;delete this.snapshot}this.clearData();this.data.addAll(a);this.totalLength=j;this.applySort();this.fireEvent("datachanged",this)}else{var k=[],d,c=0;for(e=0,g=a.length;e<g;++e){d=a[e];if(this.indexOfId(d.id)>-1){this.doUpdate(d)}else{k.push(d);++c}}this.totalLength=Math.max(j,this.data.length+c);this.add(k)}this.fireEvent("load",this,a,l);if(l.callback){l.callback.call(l.scope||this,a,l,true)}},loadData:function(c,a){var b=this.reader.readRecords(c);this.loadRecords(b,{add:a},true)},getCount:function(){return this.data.length||0},getTotalCount:function(){return this.totalLength||0},getSortState:function(){return this.sortInfo},applySort:function(){if((this.sortInfo||this.multiSortInfo)&&!this.remoteSort){this.sortData()}},sortData:function(){var a=this.hasMultiSort?this.multiSortInfo:this.sortInfo,k=a.direction||"ASC",h=a.sorters,c=[];if(!this.hasMultiSort){h=[{direction:k,field:a.field}]}for(var d=0,b=h.length;d<b;d++){c.push(this.createSortFunction(h[d].field,h[d].direction))}if(c.length==0){return}var g=k.toUpperCase()=="DESC"?-1:1;var e=function(n,m){var l=c[0].call(this,n,m);if(c.length>1){for(var p=1,o=c.length;p<o;p++){l=l||c[p].call(this,n,m)}}return g*l};this.data.sort(k,e);if(this.snapshot&&this.snapshot!=this.data){this.snapshot.sort(k,e)}},createSortFunction:function(c,b){b=b||"ASC";var a=b.toUpperCase()=="DESC"?-1:1;var d=this.fields.get(c).sortType;return function(g,e){var i=d(g.data[c]),h=d(e.data[c]);return a*(i>h?1:(i<h?-1:0))}},setDefaultSort:function(b,a){a=a?a.toUpperCase():"ASC";this.sortInfo={field:b,direction:a};this.sortToggle[b]=a},sort:function(b,a){if(Ext.isArray(arguments[0])){return this.multiSort.call(this,b,a)}else{return this.singleSort(b,a)}},singleSort:function(g,c){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};this.hasMultiSort=false;if(this.remoteSort){if(!this.load(this.lastOptions)){if(d){this.sortToggle[b]=d}if(a){this.sortInfo=a}}}else{this.applySort();this.fireEvent("datachanged",this)}return true},multiSort:function(b,a){this.hasMultiSort=true;a=a||"ASC";if(this.multiSortInfo&&a==this.multiSortInfo.direction){a=a.toggle("ASC","DESC")}this.multiSortInfo={sorters:b,direction:a};if(this.remoteSort){this.singleSort(b[0].field,b[0].direction)}else{this.applySort();this.fireEvent("datachanged",this)}},each:function(b,a){this.data.each(b,a)},getModifiedRecords:function(){return this.modified},sum:function(e,g,a){var c=this.data.items,b=0;g=g||0;a=(a||a===0)?a:c.length-1;for(var d=g;d<=a;d++){b+=(c[d].data[e]||0)}return b},createFilterFn:function(d,c,e,a,b){if(Ext.isEmpty(c,false)){return false}c=this.data.createValueMatcher(c,e,a,b);return function(g){return c.test(g.data[d])}},createMultipleFilterFn:function(a){return function(b){var k=true;for(var d=0,c=a.length;d<c;d++){var h=a[d],g=h.fn,e=h.scope;k=k&&g.call(e,b)}return k}},filter:function(n,m,h,k,e){var l;if(Ext.isObject(n)){n=[n]}if(Ext.isArray(n)){var b=[];for(var g=0,d=n.length;g<d;g++){var a=n[g],c=a.fn,o=a.scope||this;if(!Ext.isFunction(c)){c=this.createFilterFn(a.property,a.value,a.anyMatch,a.caseSensitive,a.exactMatch)}b.push({fn:c,scope:o})}l=this.createMultipleFilterFn(b)}else{l=this.createFilterFn(n,m,h,k,e)}return l?this.filterBy(l):this.clearFilter()},filterBy:function(b,a){this.snapshot=this.snapshot||this.data;this.data=this.queryBy(b,a||this);this.fireEvent("datachanged",this)},clearFilter:function(a){if(this.isFiltered()){this.data=this.snapshot;delete this.snapshot;if(a!==true){this.fireEvent("datachanged",this)}}},isFiltered:function(){return !!this.snapshot&&this.snapshot!=this.data},query:function(d,c,e,a){var b=this.createFilterFn(d,c,e,a);return b?this.queryBy(b):this.data.clone()},queryBy:function(b,a){var c=this.snapshot||this.data;return c.filterBy(b,a||this)},find:function(d,c,g,e,a){var b=this.createFilterFn(d,c,e,a);return b?this.data.findIndexBy(b,null,g):-1},findExact:function(b,a,c){return this.data.findIndexBy(function(d){return d.get(b)===a},this,c)},findBy:function(b,a,c){return this.data.findIndexBy(b,a,c)},collect:function(j,k,b){var h=(b===true&&this.snapshot)?this.snapshot.items:this.data.items;var m,n,a=[],c={};for(var e=0,g=h.length;e<g;e++){m=h[e].data[j];n=String(m);if((k||!Ext.isEmpty(m))&&!c[n]){c[n]=true;a[a.length]=m}}return a},afterEdit:function(a){if(this.modified.indexOf(a)==-1){this.modified.push(a)}this.fireEvent("update",this,a,Ext.data.Record.EDIT)},afterReject:function(a){this.modified.remove(a);this.fireEvent("update",this,a,Ext.data.Record.REJECT)},afterCommit:function(a){this.modified.remove(a);this.fireEvent("update",this,a,Ext.data.Record.COMMIT)},commitChanges:function(){var a=this.modified.slice(0),c=a.length,b;for(b=0;b<c;b++){a[b].commit()}this.modified=[];this.removed=[]},rejectChanges:function(){var a=this.modified.slice(0),e=this.removed.slice(0).reverse(),c=a.length,d=e.length,b;for(b=0;b<c;b++){a[b].reject()}for(b=0;b<d;b++){this.insert(e[b].lastIndex||0,e[b]);e[b].reject()}this.modified=[];this.removed=[]},onMetaChange:function(a){this.recordType=this.reader.recordType;this.fields=this.recordType.prototype.fields;delete this.snapshot;if(this.reader.meta.sortInfo){this.sortInfo=this.reader.meta.sortInfo}else{if(this.sortInfo&&!this.fields.get(this.sortInfo.field)){delete this.sortInfo}}if(this.writer){this.writer.meta=this.reader.meta}this.modified=[];this.fireEvent("metachange",this,this.reader.meta)},findInsertIndex:function(a){this.suspendEvents();var c=this.data.clone();this.data.add(a);this.applySort();var b=this.data.indexOf(a);this.data=c;this.resumeEvents();return b},setBaseParam:function(a,b){this.baseParams=this.baseParams||{};this.baseParams[a]=b}});Ext.reg("store",Ext.data.Store);Ext.data.Store.Error=Ext.extend(Ext.Error,{name:"Ext.data.Store"});Ext.apply(Ext.data.Store.Error.prototype,{lang:{"writer-undefined":"Attempted to execute a write-action without a DataWriter installed."}});Ext.data.Field=Ext.extend(Object,{constructor:function(b){if(Ext.isString(b)){b={name:b}}Ext.apply(this,b);var d=Ext.data.Types,a=this.sortType,c;if(this.type){if(Ext.isString(this.type)){this.type=Ext.data.Types[this.type.toUpperCase()]||d.AUTO}}else{this.type=d.AUTO}if(Ext.isString(a)){this.sortType=Ext.data.SortTypes[a]}else{if(Ext.isEmpty(a)){this.sortType=this.type.sortType}}if(!this.convert){this.convert=this.type.convert}},dateFormat:null,useNull:false,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC",allowBlank:true});Ext.data.DataReader=function(a,b){this.meta=a;this.recordType=Ext.isArray(b)?Ext.data.Record.create(b):b;if(this.recordType){this.buildExtractors()}};Ext.data.DataReader.prototype={getTotal:Ext.emptyFn,getRoot:Ext.emptyFn,getMessage:Ext.emptyFn,getSuccess:Ext.emptyFn,getId:Ext.emptyFn,buildExtractors:Ext.emptyFn,extractValues:Ext.emptyFn,realize:function(a,c){if(Ext.isArray(a)){for(var b=a.length-1;b>=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();a.store.reMap(a)}},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<k.length;e++){var b=k[e];var g=new l(this.extractValues(b,o,m),this.getId(b));g[j]=b;c.push(g)}}else{for(var e=0;e<k.length;e++){var d=this.extractValues(k[e],o,m);d[this.meta.idProperty]=this.getId(k[e]);c.push(d)}}return c},isData:function(a){return(a&&Ext.isObject(a)&&!Ext.isEmpty(this.getId(a)))?true:false},onMetaChange:function(a){delete this.ef;this.meta=a;this.recordType=Ext.data.Record.create(a.fields);this.buildExtractors()}};Ext.data.DataReader.Error=Ext.extend(Ext.Error,{constructor:function(b,a){this.arg=a;Ext.Error.call(this,b)},name:"Ext.data.DataReader"});Ext.apply(Ext.data.DataReader.Error.prototype,{lang:{update:"#update received invalid data from server. Please see docs for DataReader#update and review your DataReader configuration.",realize:"#realize was called with invalid remote-data. Please see the docs for DataReader#realize and review your DataReader configuration.","invalid-response":"#readResponse received an invalid response from the server."}});Ext.data.DataWriter=function(a){Ext.apply(this,a)};Ext.data.DataWriter.prototype={writeAllFields:false,listful:false,apply:function(e,g,d,a){var c=[],b=d+"Record";if(Ext.isArray(a)){Ext.each(a,function(h){c.push(this[b](h))},this)}else{if(a instanceof Ext.data.Record){c=this[b](a)}}this.render(e,g,c)},render:Ext.emptyFn,updateRecord:Ext.emptyFn,createRecord:Ext.emptyFn,destroyRecord:Ext.emptyFn,toHash:function(g,c){var e=g.fields.map,d={},b=(this.writeAllFields===false&&g.phantom===false)?g.getChanges():g.data,a;Ext.iterate(b,function(i,h){if((a=e[i])){d[a.mapping?a.mapping:a.name]=h}});if(g.phantom){if(g.fields.containsKey(this.meta.idProperty)&&Ext.isEmpty(g.data[this.meta.idProperty])){delete d[this.meta.idProperty]}}else{d[this.meta.idProperty]=g.id}return d},toArray:function(b){var a=[];Ext.iterate(b,function(d,c){a.push({name:d,value:c})},this);return a}};Ext.data.DataProxy=function(a){a=a||{};this.api=a.api;this.url=a.url;this.restful=a.restful;this.listeners=a.listeners;this.prettyUrls=a.prettyUrls;this.addEvents("exception","beforeload","load","loadexception","beforewrite","write");Ext.data.DataProxy.superclass.constructor.call(this);try{Ext.data.Api.prepare(this)}catch(b){if(b instanceof Ext.data.Api.Error){b.toConsole()}}Ext.data.DataProxy.relayEvents(this,["beforewrite","write","exception"])};Ext.extend(Ext.data.DataProxy,Ext.util.Observable,{restful:false,setApi:function(){if(arguments.length==1){var a=Ext.data.Api.isValid(arguments[0]);if(a===true){this.api=arguments[0]}else{throw new Ext.data.Api.Error("invalid",a)}}else{if(arguments.length==2){if(!Ext.data.Api.isAction(arguments[0])){throw new Ext.data.Api.Error("invalid",arguments[0])}this.api[arguments[0]]=arguments[1]}}Ext.data.Api.prepare(this)},isApiAction:function(a){return(this.api[a])?true:false},request:function(e,b,g,a,h,d,c){if(!this.api[e]&&!this.load){throw new Ext.data.DataProxy.Error("action-undefined",e)}g=g||{};if((e===Ext.data.Api.actions.read)?this.fireEvent("beforeload",this,g):this.fireEvent("beforewrite",this,e,b,g)!==false){this.doRequest.apply(this,arguments)}else{h.call(d||this,null,c,false)}},load:null,doRequest:function(e,b,g,a,h,d,c){this.load(g,a,h,d,c)},onRead:Ext.emptyFn,onWrite:Ext.emptyFn,buildUrl:function(d,b){b=b||null;var c=(this.conn&&this.conn.url)?this.conn.url:(this.api[d])?this.api[d].url:this.url;if(!c){throw new Ext.data.Api.Error("invalid-url",d)}var e=null;var a=c.match(/(.*)(\.json|\.xml|\.html)$/);if(a){e=a[2];c=a[1]}if((this.restful===true||this.prettyUrls===true)&&b instanceof Ext.data.Record&&!b.phantom){c+="/"+b.id}return(e===null)?c:c+e},destroy:function(){this.purgeListeners()}});Ext.apply(Ext.data.DataProxy,Ext.util.Observable.prototype);Ext.util.Observable.call(Ext.data.DataProxy);Ext.data.DataProxy.Error=Ext.extend(Ext.Error,{constructor:function(b,a){this.arg=a;Ext.Error.call(this,b)},name:"Ext.data.DataProxy"});Ext.apply(Ext.data.DataProxy.Error.prototype,{lang:{"action-undefined":"DataProxy attempted to execute an API-action but found an undefined url / function. Please review your Proxy url/api-configuration.","api-invalid":"Recieved an invalid API-configuration. Please ensure your proxy API-configuration contains only the actions from Ext.data.Api.actions."}});Ext.data.Request=function(a){Ext.apply(this,a)};Ext.data.Request.prototype={action:undefined,rs:undefined,params:undefined,callback:Ext.emptyFn,scope:undefined,reader:undefined};Ext.data.Response=function(a){Ext.apply(this,a)};Ext.data.Response.prototype={action:undefined,success:undefined,message:undefined,data:undefined,raw:undefined,records:undefined};Ext.data.ScriptTagProxy=function(a){Ext.apply(this,a);Ext.data.ScriptTagProxy.superclass.constructor.call(this,a);this.head=document.getElementsByTagName("head")[0]};Ext.data.ScriptTagProxy.TRANS_ID=1000;Ext.extend(Ext.data.ScriptTagProxy,Ext.data.DataProxy,{timeout:30000,callbackParam:"callback",nocache:true,doRequest:function(e,g,d,h,j,k,l){var c=Ext.urlEncode(Ext.apply(d,this.extraParams));var b=this.buildUrl(e,g);if(!b){throw new Ext.data.Api.Error("invalid-url",b)}b=Ext.urlAppend(b,c);if(this.nocache){b=Ext.urlAppend(b,"_dc="+(new Date().getTime()))}var a=++Ext.data.ScriptTagProxy.TRANS_ID;var m={id:a,action:e,cb:"stcCallback"+a,scriptId:"stcScript"+a,params:d,arg:l,url:b,callback:j,scope:k,reader:h};window[m.cb]=this.createCallback(e,g,m);b+=String.format("&{0}={1}",this.callbackParam,m.cb);if(this.autoAbort!==false){this.abort()}m.timeoutId=this.handleFailure.defer(this.timeout,this,[m]);var i=document.createElement("script");i.setAttribute("src",b);i.setAttribute("type","text/javascript");i.setAttribute("id",m.scriptId);this.head.appendChild(i);this.trans=m},createCallback:function(d,b,c){var a=this;return function(e){a.trans=false;a.destroyTrans(c,true);if(d===Ext.data.Api.actions.read){a.onRead.call(a,d,c,e)}else{a.onWrite.call(a,d,c,e,b)}}},onRead:function(d,c,b){var a;try{a=c.reader.readRecords(b)}catch(g){this.fireEvent("loadexception",this,c,b,g);this.fireEvent("exception",this,"response",d,c,b,g);c.callback.call(c.scope||window,null,c.arg,false);return}if(a.success===false){this.fireEvent("loadexception",this,c,b);this.fireEvent("exception",this,"remote",d,c,b,null)}else{this.fireEvent("load",this,b,c.arg)}c.callback.call(c.scope||window,a,c.arg,a.success)},onWrite:function(h,g,c,b){var a=g.reader;try{var d=a.readResponse(h,c)}catch(i){this.fireEvent("exception",this,"response",h,g,d,i);g.callback.call(g.scope||window,null,d,false);return}if(!d.success===true){this.fireEvent("exception",this,"remote",h,g,d,b);g.callback.call(g.scope||window,null,d,false);return}this.fireEvent("write",this,h,d.data,d,b,g.arg);g.callback.call(g.scope||window,d.data,d,true)},isLoading:function(){return this.trans?true:false},abort:function(){if(this.isLoading()){this.destroyTrans(this.trans)}},destroyTrans:function(b,a){this.head.removeChild(document.getElementById(b.scriptId));clearTimeout(b.timeoutId);if(a){window[b.cb]=undefined;try{delete window[b.cb]}catch(c){}}else{window[b.cb]=function(){window[b.cb]=undefined;try{delete window[b.cb]}catch(d){}}}},handleFailure:function(a){this.trans=false;this.destroyTrans(a,false);if(a.action===Ext.data.Api.actions.read){this.fireEvent("loadexception",this,null,a.arg)}this.fireEvent("exception",this,"response",a.action,{response:null,options:a.arg});a.callback.call(a.scope||window,null,a.arg,false)},destroy:function(){this.abort();Ext.data.ScriptTagProxy.superclass.destroy.call(this)}});Ext.data.HttpProxy=function(a){Ext.data.HttpProxy.superclass.constructor.call(this,a);this.conn=a;this.conn.url=null;this.useAjax=!a||!a.events;var c=Ext.data.Api.actions;this.activeRequest={};for(var b in c){this.activeRequest[c[b]]=undefined}};Ext.extend(Ext.data.HttpProxy,Ext.data.DataProxy,{getConnection:function(){return this.useAjax?Ext.Ajax:this.conn},setUrl:function(a,b){this.conn.url=a;if(b===true){this.url=a;this.api=null;Ext.data.Api.prepare(this)}},doRequest:function(g,d,i,c,b,e,a){var h={method:(this.api[g])?this.api[g]["method"]:undefined,request:{callback:b,scope:e,arg:a},reader:c,callback:this.createCallback(g,d),scope:this};if(i.jsonData){h.jsonData=i.jsonData}else{if(i.xmlData){h.xmlData=i.xmlData}else{h.params=i||{}}}this.conn.url=this.buildUrl(g,d);if(this.useAjax){Ext.applyIf(h,this.conn);if(this.activeRequest[g]){}this.activeRequest[g]=Ext.Ajax.request(h)}else{this.conn.request(h)}this.conn.url=null},createCallback:function(b,a){return function(e,d,c){this.activeRequest[b]=undefined;if(!d){if(b===Ext.data.Api.actions.read){this.fireEvent("loadexception",this,e,c)}this.fireEvent("exception",this,"response",b,e,c);e.request.callback.call(e.request.scope,null,e.request.arg,false);return}if(b===Ext.data.Api.actions.read){this.onRead(b,e,c)}else{this.onWrite(b,e,c,a)}}},onRead:function(d,h,b){var a;try{a=h.reader.read(b)}catch(g){this.fireEvent("loadexception",this,h,b,g);this.fireEvent("exception",this,"response",d,h,b,g);h.request.callback.call(h.request.scope,null,h.request.arg,false);return}if(a.success===false){this.fireEvent("loadexception",this,h,b);var c=h.reader.readResponse(d,b);this.fireEvent("exception",this,"remote",d,h,c,null)}else{this.fireEvent("load",this,h,h.request.arg)}h.request.callback.call(h.request.scope,a,h.request.arg,a.success)},onWrite:function(g,i,c,b){var a=i.reader;var d;try{d=a.readResponse(g,c)}catch(h){this.fireEvent("exception",this,"response",g,i,c,h);i.request.callback.call(i.request.scope,null,i.request.arg,false);return}if(d.success===true){this.fireEvent("write",this,g,d.data,d,b,i.request.arg)}else{this.fireEvent("exception",this,"remote",g,i,d,b)}i.request.callback.call(i.request.scope,d.data,d,d.success)},destroy:function(){if(!this.useAjax){this.conn.abort()}else{if(this.activeRequest){var b=Ext.data.Api.actions;for(var a in b){if(this.activeRequest[b[a]]){Ext.Ajax.abort(this.activeRequest[b[a]])}}}}Ext.data.HttpProxy.superclass.destroy.call(this)}});Ext.data.MemoryProxy=function(b){var a={};a[Ext.data.Api.actions.read]=true;Ext.data.MemoryProxy.superclass.constructor.call(this,{api:a});this.data=b};Ext.extend(Ext.data.MemoryProxy,Ext.data.DataProxy,{doRequest:function(b,c,a,d,h,i,j){a=a||{};var k;try{k=d.readRecords(this.data)}catch(g){this.fireEvent("loadexception",this,null,j,g);this.fireEvent("exception",this,"response",b,j,null,g);h.call(i,null,j,false);return}h.call(i,k,j,true)}});Ext.data.Types=new function(){var a=Ext.data.SortTypes;Ext.apply(this,{stripRe:/[\$,%]/g,AUTO:{convert:function(b){return b},sortType:a.none,type:"auto"},STRING:{convert:function(b){return(b===undefined||b===null)?"":String(b)},sortType:a.asUCString,type:"string"},INT:{convert:function(b){return b!==undefined&&b!==null&&b!==""?parseInt(String(b).replace(Ext.data.Types.stripRe,""),10):(this.useNull?null:0)},sortType:a.none,type:"int"},FLOAT:{convert:function(b){return b!==undefined&&b!==null&&b!==""?parseFloat(String(b).replace(Ext.data.Types.stripRe,""),10):(this.useNull?null:0)},sortType:a.none,type:"float"},BOOL:{convert:function(b){return b===true||b==="true"||b==1},sortType:a.none,type:"bool"},DATE:{convert:function(c){var d=this.dateFormat;if(!c){return null}if(Ext.isDate(c)){return c}if(d){if(d=="timestamp"){return new Date(c*1000)}if(d=="time"){return new Date(parseInt(c,10))}return Date.parseDate(c,d)}var b=Date.parse(c);return b?new Date(b):null},sortType:a.asDate,type:"date"}});Ext.apply(this,{BOOLEAN:this.BOOL,INTEGER:this.INT,NUMBER:this.FLOAT})};Ext.data.JsonWriter=Ext.extend(Ext.data.DataWriter,{encode:true,encodeDelete:false,constructor:function(a){Ext.data.JsonWriter.superclass.constructor.call(this,a)},render:function(c,d,b){if(this.encode===true){Ext.apply(c,d);c[this.meta.root]=Ext.encode(b)}else{var a=Ext.apply({},d);a[this.meta.root]=b;c.jsonData=a}},createRecord:function(a){return this.toHash(a)},updateRecord:function(a){return this.toHash(a)},destroyRecord:function(b){if(this.encodeDelete){var a={};a[this.meta.idProperty]=b.id;return a}else{return b.id}}});Ext.data.JsonReader=function(a,b){a=a||{};Ext.applyIf(a,{idProperty:"id",successProperty:"success",totalProperty:"total"});Ext.data.JsonReader.superclass.constructor.call(this,a,b||a.fields)};Ext.extend(Ext.data.JsonReader,Ext.data.DataReader,{read:function(a){var b=a.responseText;var c=Ext.decode(b);if(!c){throw {message:"JsonReader.read: Json object not found"}}return this.readRecords(c)},readResponse:function(e,b){var h=(b.responseText!==undefined)?Ext.decode(b.responseText):b;if(!h){throw new Ext.data.JsonReader.Error("response")}var a=this.getRoot(h),g=this.getSuccess(h);if(g&&e===Ext.data.Api.actions.create){var d=Ext.isDefined(a);if(d&&Ext.isEmpty(a)){throw new Ext.data.JsonReader.Error("root-empty",this.meta.root)}else{if(!d){throw new Ext.data.JsonReader.Error("root-undefined-response",this.meta.root)}}}var c=new Ext.data.Response({action:e,success:g,data:(a)?this.extractData(a,false):[],message:this.getMessage(h),raw:h});if(Ext.isEmpty(c.success)){throw new Ext.data.JsonReader.Error("successProperty-response",this.meta.successProperty)}return c},readRecords:function(a){this.jsonData=a;if(a.metaData){this.onMetaChange(a.metaData)}var m=this.meta,h=this.recordType,b=h.prototype.fields,l=b.items,i=b.length,j;var g=this.getRoot(a),e=g.length,d=e,k=true;if(m.totalProperty){j=parseInt(this.getTotal(a),10);if(!isNaN(j)){d=j}}if(m.successProperty){j=this.getSuccess(a);if(j===false||j==="false"){k=false}}return{success:k,records:this.extractData(g,true),totalRecords:d}},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=l.root?this.createAccessor(l.root):function(g){return g};if(l.id||l.idProperty){var d=this.createAccessor(l.id||l.idProperty);this.getId=function(i){var g=d(i);return(g===undefined||g==="")?null:g}}else{this.getId=function(){return null}}var c=[];for(var b=0;b<j;b++){e=k[b];var a=(e.mapping!==undefined&&e.mapping!==null)?e.mapping:e.name;c.push(this.createAccessor(a))}this.ef=c},simpleAccess:function(b,a){return b[a]},createAccessor:function(){var a=/[\[\.]/;return function(c){if(Ext.isEmpty(c)){return Ext.emptyFn}if(Ext.isFunction(c)){return c}var b=String(c).search(a);if(b>=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<a;e++){g=d[e];var b=this.ef[e](h);c[g.name]=g.convert((b!==undefined)?b:g.defaultValue,h)}return c}});Ext.data.JsonReader.Error=Ext.extend(Ext.Error,{constructor:function(b,a){this.arg=a;Ext.Error.call(this,b)},name:"Ext.data.JsonReader"});Ext.apply(Ext.data.JsonReader.Error.prototype,{lang:{response:"An error occurred while json-decoding your server response","successProperty-response":'Could not locate your "successProperty" in your server response. Please review your JsonReader config to ensure the config-property "successProperty" matches the property in your server-response. See the JsonReader docs.',"root-undefined-config":'Your JsonReader was configured without a "root" property. Please review your JsonReader config and make sure to define the root property. See the JsonReader docs.',"idProperty-undefined":'Your JsonReader was configured without an "idProperty" Please review your JsonReader configuration and ensure the "idProperty" is set (e.g.: "id"). See the JsonReader docs.',"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.'}});Ext.data.ArrayReader=Ext.extend(Ext.data.JsonReader,{readRecords:function(r){this.arrayData=r;var l=this.meta,d=l?Ext.num(l.idIndex,l.id):null,b=this.recordType,q=b.prototype.fields,z=[],e=true,g;var u=this.getRoot(r);for(var y=0,A=u.length;y<A;y++){var t=u[y],a={},p=((d||d===0)&&t[d]!==undefined&&t[d]!==""?t[d]:null);for(var x=0,m=q.length;x<m;x++){var B=q.items[x],w=B.mapping!==undefined&&B.mapping!==null?B.mapping:x;g=t[w]!==undefined?t[w]:B.defaultValue;g=B.convert(g,t);a[B.name]=g}var c=new b(a,p);c.json=t;z[z.length]=c}var h=z.length;if(l.totalProperty){g=parseInt(this.getTotal(r),10);if(!isNaN(g)){h=g}}if(l.successProperty){g=this.getSuccess(r);if(g===false||g==="false"){e=false}}return{success:e,records:z,totalRecords:h}}});Ext.data.ArrayStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.ArrayStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.ArrayReader(a)}))},loadData:function(e,b){if(this.expandData===true){var d=[];for(var c=0,a=e.length;c<a;c++){d[d.length]=[e[c]]}e=d}Ext.data.ArrayStore.superclass.loadData.call(this,e,b)}});Ext.reg("arraystore",Ext.data.ArrayStore);Ext.data.SimpleStore=Ext.data.ArrayStore;Ext.reg("simplestore",Ext.data.SimpleStore);Ext.data.JsonStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.JsonStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.JsonReader(a)}))}});Ext.reg("jsonstore",Ext.data.JsonStore);Ext.data.XmlWriter=function(a){Ext.data.XmlWriter.superclass.constructor.apply(this,arguments);this.tpl=(typeof(this.tpl)==="string")?new Ext.XTemplate(this.tpl).compile():this.tpl.compile()};Ext.extend(Ext.data.XmlWriter,Ext.data.DataWriter,{documentRoot:"xrequest",forceDocumentRoot:false,root:"records",xmlVersion:"1.0",xmlEncoding:"ISO-8859-15",tpl:'<tpl for="."><\u003fxml version="{version}" encoding="{encoding}"\u003f><tpl if="documentRoot"><{documentRoot}><tpl for="baseParams"><tpl for="."><{name}>{value}</{name}></tpl></tpl></tpl><tpl if="records.length&gt;1"><{root}></tpl><tpl for="records"><{parent.record}><tpl for="."><{name}>{value}</{name}></tpl></{parent.record}></tpl><tpl if="records.length&gt;1"></{root}></tpl><tpl if="documentRoot"></{documentRoot}></tpl></tpl>',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(g,b){var e=Ext.DomQuery,h=b.responseXML,a=h.documentElement||h;var c=new Ext.data.Response({action:g,success:this.getSuccess(a),message:this.getMessage(a),data:this.extractData(e.select(this.meta.record,a)||e.select(this.meta.root,a),false),raw:h});if(Ext.isEmpty(c.success)){throw new Ext.data.DataReader.Error("successProperty-response",this.meta.successProperty)}if(g===Ext.data.Api.actions.create){var d=Ext.isDefined(c.data);if(d&&Ext.isEmpty(c.data)){throw new Ext.data.JsonReader.Error("root-empty",this.meta.root)}else{if(!d){throw new Ext.data.JsonReader.Error("root-undefined-response",this.meta.root)}}}return c},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;b<j;b++){e=k[b];var a=(e.mapping!==undefined&&e.mapping!==null)?e.mapping:e.name;c.push(this.createAccessor(a))}this.ef=c},createAccessor:function(){var a=Ext.DomQuery;return function(b){if(Ext.isFunction(b)){return b}switch(b){case this.meta.totalProperty:return function(c,d){return a.selectNumber(b,c,d)};break;case this.meta.successProperty:return function(d,e){var c=a.selectValue(b,d,true);var g=c!==false&&c!=="false";return g};break;default:return function(c,d){return a.selectValue(b,c,d)};break}}}(),extractValues:function(h,d,a){var g,c={};for(var e=0;e<a;e++){g=d[e];var b=this.ef[e](h);c[g.name]=g.convert((b!==undefined)?b:g.defaultValue,h)}return c}});Ext.data.XmlStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.XmlStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.XmlReader(a)}))}});Ext.reg("xmlstore",Ext.data.XmlStore);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(e,a,d){d=d?(String(d).toUpperCase()=="DESC"?"DESC":"ASC"):this.groupDir;if(this.groupField==e&&this.groupDir==d&&!a){return}var c=this.multiSortInfo.sorters;if(c.length>0&&c[0].field==this.groupField){c.shift()}this.groupField=e;this.groupDir=d;this.applyGroupField();var b=function(){this.fireEvent("groupchange",this,this.getGroupState())};if(this.groupOnSort){this.sort(e,d);b.call(this);return}if(this.remoteGroup){this.on("load",b,this,{single:true});this.reload()}else{this.sort(c);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;d<g;d++){j.push(a[this.paramOrder[d]])}}else{if(this.paramsAsHash){j.push(a)}}}break;case Ext.data.Api.actions.update:j.push(a.jsonData);break;case Ext.data.Api.actions.destroy:j.push(a.jsonData);break}var m={params:a||{},request:{callback:k,scope:l,arg:n},reader:e};j.push(this.createCallback(b,c,m),this);h.apply(window,j)},createCallback:function(d,a,b){var c=this;return function(e,g){if(!g.status){if(d===Ext.data.Api.actions.read){c.fireEvent("loadexception",c,b,g,null)}c.fireEvent("exception",c,"remote",d,b,g,null);b.request.callback.call(b.request.scope,null,b.request.arg,false);return}if(d===Ext.data.Api.actions.read){c.onRead(d,b,e,g)}else{c.onWrite(d,b,e,g,a)}}},onRead:function(g,e,a,d){var b;try{b=e.reader.readRecords(a)}catch(c){this.fireEvent("loadexception",this,e,d,c);this.fireEvent("exception",this,"response",g,e,d,c);e.request.callback.call(e.request.scope,null,e.request.arg,false);return}this.fireEvent("load",this,d,e.request.arg);e.request.callback.call(e.request.scope,b,e.request.arg,true)},onWrite:function(g,d,a,c,b){var e=d.reader.extractData(d.reader.getRoot(a),false);var h=d.reader.getSuccess(a);h=(h!==false);if(h){this.fireEvent("write",this,g,e,c,b,d.request.arg)}else{this.fireEvent("exception",this,"remote",g,d,a,b)}d.request.callback.call(d.request.scope,e,c,h)}});Ext.data.DirectStore=Ext.extend(Ext.data.Store,{constructor:function(a){var b=Ext.apply({},{batchTransactions:false},a);Ext.data.DirectStore.superclass.constructor.call(this,Ext.apply(b,{proxy:Ext.isDefined(b.proxy)?b.proxy:new Ext.data.DirectProxy(Ext.copyTo({},b,"paramOrder,paramsAsHash,directFn,api")),reader:(!Ext.isDefined(b.reader)&&b.fields)?new Ext.data.JsonReader(Ext.copyTo({},b,"totalProperty,root,idProperty"),b.fields):b.reader}))}});Ext.reg("directstore",Ext.data.DirectStore);Ext.Direct=Ext.extend(Ext.util.Observable,{exceptions:{TRANSPORT:"xhr",PARSE:"parse",LOGIN:"login",SERVER:"exception"},constructor:function(){this.addEvents("event","exception");this.transactions={};this.providers={}},addProvider:function(e){var c=arguments;if(c.length>1){for(var d=0,b=c.length;d<b;d++){this.addProvider(c[d])}return}if(!e.events){e=new Ext.Direct.PROVIDERS[e.type](e)}e.id=e.id||Ext.id();this.providers[e.id]=e;e.on("data",this.onProviderData,this);e.on("exception",this.onProviderException,this);if(!e.isConnected()){e.connect()}return e},getProvider:function(a){return this.providers[a]},removeProvider:function(b){var a=b.id?b:this.providers[b];a.un("data",this.onProviderData,this);a.un("exception",this.onProviderException,this);delete this.providers[a.id];return a},addTransaction:function(a){this.transactions[a.tid]=a;return a},removeTransaction:function(a){delete this.transactions[a.tid||a];return a},getTransaction:function(a){return this.transactions[a.tid||a]},onProviderData:function(d,c){if(Ext.isArray(c)){for(var b=0,a=c.length;b<a;b++){this.onProviderData(d,c[b])}return}if(c.name&&c.name!="event"&&c.name!="exception"){this.fireEvent(c.name,c)}else{if(c.type=="exception"){this.fireEvent("exception",c)}}this.fireEvent("event",c,d)},createEvent:function(a,b){return new Ext.Direct.eventTypes[a.type](Ext.apply(a,b))}});Ext.Direct=new Ext.Direct();Ext.Direct.TID=1;Ext.Direct.PROVIDERS={};Ext.Direct.Transaction=function(a){Ext.apply(this,a);this.tid=++Ext.Direct.TID;this.retryCount=0};Ext.Direct.Transaction.prototype={send:function(){this.provider.queueTransaction(this)},retry:function(){this.retryCount++;this.send()},getProvider:function(){return this.provider}};Ext.Direct.Event=function(a){Ext.apply(this,a)};Ext.Direct.Event.prototype={status:true,getData:function(){return this.data}};Ext.Direct.RemotingEvent=Ext.extend(Ext.Direct.Event,{type:"rpc",getTransaction:function(){return this.transaction||Ext.Direct.getTransaction(this.tid)}});Ext.Direct.ExceptionEvent=Ext.extend(Ext.Direct.RemotingEvent,{status:false,type:"exception"});Ext.Direct.eventTypes={rpc:Ext.Direct.RemotingEvent,event:Ext.Direct.Event,exception:Ext.Direct.ExceptionEvent};Ext.direct.Provider=Ext.extend(Ext.util.Observable,{priority:1,constructor:function(a){Ext.apply(this,a);this.addEvents("connect","disconnect","data","exception");Ext.direct.Provider.superclass.constructor.call(this,a)},isConnected:function(){return false},connect:Ext.emptyFn,disconnect:Ext.emptyFn});Ext.direct.JsonProvider=Ext.extend(Ext.direct.Provider,{parseResponse:function(a){if(!Ext.isEmpty(a.responseText)){if(typeof a.responseText=="object"){return a.responseText}return Ext.decode(a.responseText)}return null},getEvents:function(j){var g=null;try{g=this.parseResponse(j)}catch(h){var d=new Ext.Direct.ExceptionEvent({data:h,xhr:j,code:Ext.Direct.exceptions.PARSE,message:"Error parsing json response: \n\n "+g});return[d]}var c=[];if(Ext.isArray(g)){for(var b=0,a=g.length;b<a;b++){c.push(Ext.Direct.createEvent(g[b]))}}else{c.push(Ext.Direct.createEvent(g))}return c}});Ext.direct.PollingProvider=Ext.extend(Ext.direct.JsonProvider,{priority:3,interval:3000,constructor:function(a){Ext.direct.PollingProvider.superclass.constructor.call(this,a);this.addEvents("beforepoll","poll")},isConnected:function(){return !!this.pollTask},connect:function(){if(this.url&&!this.pollTask){this.pollTask=Ext.TaskMgr.start({run:function(){if(this.fireEvent("beforepoll",this)!==false){if(typeof this.url=="function"){this.url(this.baseParams)}else{Ext.Ajax.request({url:this.url,callback:this.onData,scope:this,params:this.baseParams})}}},interval:this.interval,scope:this});this.fireEvent("connect",this)}else{if(!this.url){throw"Error initializing PollingProvider, no url configured."}}},disconnect:function(){if(this.pollTask){Ext.TaskMgr.stop(this.pollTask);delete this.pollTask;this.fireEvent("disconnect",this)}},onData:function(d,j,h){if(j){var c=this.getEvents(h);for(var b=0,a=c.length;b<a;b++){var g=c[b];this.fireEvent("data",this,g)}}else{var g=new Ext.Direct.ExceptionEvent({data:g,code:Ext.Direct.exceptions.TRANSPORT,message:"Unable to connect to the server.",xhr:h});this.fireEvent("data",this,g)}}});Ext.Direct.PROVIDERS.polling=Ext.direct.PollingProvider;Ext.direct.RemotingProvider=Ext.extend(Ext.direct.JsonProvider,{enableBuffer:10,maxRetries:1,timeout:undefined,constructor:function(a){Ext.direct.RemotingProvider.superclass.constructor.call(this,a);this.addEvents("beforecall","call");this.namespace=(Ext.isString(this.namespace))?Ext.ns(this.namespace):this.namespace||window;this.transactions={};this.callBuffer=[]},initAPI:function(){var h=this.actions;for(var j in h){var d=this.namespace[j]||(this.namespace[j]={}),e=h[j];for(var g=0,b=e.length;g<b;g++){var a=e[g];d[a.name]=this.createMethod(j,a)}}},isConnected:function(){return !!this.connected},connect:function(){if(this.url){this.initAPI();this.connected=true;this.fireEvent("connect",this)}else{if(!this.url){throw"Error initializing RemotingProvider, no url configured."}}},disconnect:function(){if(this.connected){this.connected=false;this.fireEvent("disconnect",this)}},onData:function(a,h,j){if(h){var k=this.getEvents(j);for(var b=0,c=k.length;b<c;b++){var d=k[b],l=this.getTransaction(d);this.fireEvent("data",this,d);if(l){this.doCallback(l,d,true);Ext.Direct.removeTransaction(l)}}}else{var g=[].concat(a.ts);for(var b=0,c=g.length;b<c;b++){var l=this.getTransaction(g[b]);if(l&&l.retryCount<this.maxRetries){l.retry()}else{var d=new Ext.Direct.ExceptionEvent({data:d,transaction:l,code:Ext.Direct.exceptions.TRANSPORT,message:"Unable to connect to the server.",xhr:j});this.fireEvent("data",this,d);if(l){this.doCallback(l,d,false);Ext.Direct.removeTransaction(l)}}}}},getCallData:function(a){return{action:a.action,method:a.method,data:a.data,type:"rpc",tid:a.tid}},doSend:function(d){var g={url:this.url,callback:this.onData,scope:this,ts:d,timeout:this.timeout},b;if(Ext.isArray(d)){b=[];for(var c=0,a=d.length;c<a;c++){b.push(this.getCallData(d[c]))}}else{b=this.getCallData(d)}if(this.enableUrlEncode){var e={};e[Ext.isString(this.enableUrlEncode)?this.enableUrlEncode:"data"]=Ext.encode(b);g.params=e}else{g.jsonData=b}Ext.Ajax.request(g)},combineAndSend:function(){var a=this.callBuffer.length;if(a>0){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,a)!==false){Ext.Direct.addTransaction(d);this.queueTransaction(d);this.fireEvent("call",this,d,a)}},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,b)!==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,b);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;j<l;j++){if(o[j]&&c[o[j]]){var n=c[o[j]];this[n]=new Ext.Resizable.Handle(this,n,this.disableTrackOver,this.transparent,this.handleCls)}}this.corner=this.southeast;if(this.handles.indexOf("n")!=-1||this.handles.indexOf("w")!=-1){this.updateBox=true}this.activeHandle=null;if(this.resizeChild){if(typeof this.resizeChild=="boolean"){this.resizeChild=Ext.get(this.el.dom.firstChild,true)}else{this.resizeChild=Ext.get(this.resizeChild,true)}}if(this.adjustments=="auto"){var b=this.resizeChild;var m=this.west,h=this.east,a=this.north,o=this.south;if(b&&(m||a)){b.position("relative");b.setLeft(m?m.el.getWidth():0);b.setTop(a?a.el.getHeight():0)}this.adjustments=[(h?-h.el.getWidth():0)+(m?-m.el.getWidth():0),(a?-a.el.getHeight():0)+(o?-o.el.getHeight():0)-1]}if(this.draggable){this.dd=this.dynamic?this.el.initDD(null):this.el.initDDProxy(null,{dragElId:this.proxy.id});this.dd.setHandleElId(this.resizeChild?this.resizeChild.id:this.el.id);if(this.constrainTo){this.dd.constrainTo(this.constrainTo)}}this.addEvents("beforeresize","resize");if(this.width!==null&&this.height!==null){this.resizeTo(this.width,this.height)}else{this.updateChildSize()}if(Ext.isIE){this.el.dom.style.zoom=1}Ext.Resizable.superclass.constructor.call(this)},adjustments:[0,0],animate:false,disableTrackOver:false,draggable:false,duration:0.35,dynamic:false,easing:"easeOutStrong",enabled:true,handles:false,multiDirectional:false,height:null,width:null,heightIncrement:0,widthIncrement:0,minHeight:5,minWidth:5,maxHeight:10000,maxWidth:10000,minX:0,minY:0,pinned:false,preserveRatio:false,resizeChild:false,transparent:false,resizeTo:function(b,a){this.el.setSize(b,a);this.updateChildSize();this.fireEvent("resize",this,b,a,null)},startSizing:function(c,b){this.fireEvent("beforeresize",this,c);if(this.enabled){if(!this.overlay){this.overlay=this.el.createProxy({tag:"div",cls:"x-resizable-overlay",html:"&#160;"},Ext.getBody());this.overlay.unselectable();this.overlay.enableDisplayMode("block");this.overlay.on({scope:this,mousemove:this.onMouseMove,mouseup:this.onMouseUp})}this.overlay.setStyle("cursor",b.el.getStyle("cursor"));this.resizing=true;this.startBox=this.el.getBox();this.startPoint=c.getXY();this.offsets=[(this.startBox.x+this.startBox.width)-this.startPoint[0],(this.startBox.y+this.startBox.height)-this.startPoint[1]];this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();if(this.constrainTo){var a=Ext.get(this.constrainTo);this.resizeRegion=a.getRegion().adjust(a.getFrameWidth("t"),a.getFrameWidth("l"),-a.getFrameWidth("b"),-a.getFrameWidth("r"))}this.proxy.setStyle("visibility","hidden");this.proxy.show();this.proxy.setBox(this.startBox);if(!this.dynamic){this.proxy.setStyle("visibility","visible")}}},onMouseDown:function(a,b){if(this.enabled){b.stopEvent();this.activeHandle=a;this.startSizing(b,a)}},onMouseUp:function(b){this.activeHandle=null;var a=this.resizeElement();this.resizing=false;this.handleOut();this.overlay.hide();this.proxy.hide();this.fireEvent("resize",this,a.width,a.height,b)},updateChildSize:function(){if(this.resizeChild){var d=this.el;var e=this.resizeChild;var c=this.adjustments;if(d.dom.offsetWidth){var a=d.getSize(true);e.setSize(a.width+c[0],a.height+c[1])}if(Ext.isIE){setTimeout(function(){if(d.dom.offsetWidth){var g=d.getSize(true);e.setSize(g.width+c[0],g.height+c[1])}},10)}}},snap:function(c,e,b){if(!e||!c){return c}var d=c;var a=c%e;if(a>0){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-c<a){c=b-a}else{if(b-c>d){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,showAnimDuration:0.25,hideAnimDuration:0.25,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:"&#160;"});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){if(this.activeGhost){this.unghost()}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(b!=document.body&&!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:this.showAnimDuration,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:this.hideAnimDuration,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+this.el.getConstrainOffset())}}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=Ext.extend(Ext.dd.DD,{constructor: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},moveOnly:true,headerOffsets:[100,25],startDrag:function(){var a=this.win;this.proxy=a.ghost(a.initialConfig.cls);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._lastAccess<i._lastAccess)?-1:1};var h=function(){var l=d,j=l.length;if(j>0){l.sort(c);var k=l[0].manager.zseed;for(var m=0;m<j;m++){var n=l[m];if(n&&!n.hidden){n.setZIndex(k+(m*10))}}}a()};var b=function(i){if(i!=e){if(e){e.setActive(false)}e=i;if(i){i.setActive(true)}}};var a=function(){for(var j=d.length-1;j>=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:'<div class="ext-mb-icon"></div><div class="ext-mb-content"><span class="ext-mb-text"></span><br /><div class="ext-mb-fix-cursor"><input type="text" class="ext-mb-input" /><textarea class="ext-mb-textarea"></textarea></div></div>'});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?A+" ":"&#160;");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;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}l.update(A||"&#160;");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||"&#160;");B.setTitle(b.title||"&#160;");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(Ext.isDefined(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=Ext.extend(Object,{constructor:function(a,b){this.panel=a;this.id=this.panel.id+"-ddproxy";Ext.apply(this,b)},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(this.panel.initialConfig.cls,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=Ext.extend(Ext.dd.DragSource,{constructor: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 d=b.header,c=b.body;if(d){this.setHandleElId(d.id);c=b.header}c.setStyle("cursor","move");this.scroll=false},showFrame:Ext.emptyFn,startDrag:Ext.emptyFn,b4StartDrag:function(a,b){this.proxy.show()},b4MouseDown:function(b){var a=b.getPageX(),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=Ext.extend(Ext.util.Observable,{constructor:function(){this.addEvents("statechange");this.state={};Ext.state.Provider.superclass.constructor.call(this)},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|e)\:(.*)$/,h=e.exec(unescape(b)),d,c,a,g;if(!h||!h[1]){return}c=h[1];a=h[2];switch(c){case"e":return null;case"n":return parseFloat(a);case"d":return new Date(Date.parse(a));case"b":return(a=="1");case"a":d=[];if(a!=""){Ext.each(a.split("^"),function(i){d.push(this.decodeValue(i))},this)}return d;case"o":d={};if(a!=""){Ext.each(a.split("^"),function(i){g=i.split("=");d[g[0]]=this.decodeValue(g[1])},this)}return d;default:return a}},encodeValue:function(c){var b,g="",e=0,a,d;if(c==null){return"e:1"}else{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)){for(a=c.length;e<a;e++){g+=this.encodeValue(c[e]);if(e!=a-1){g+="^"}}b="a:"+g}else{if(typeof c=="object"){for(d in c){if(typeof c[d]!="function"&&c[d]!==undefined){g+=d+"="+this.encodeValue(c[d])+"^"}}b="o:"+g.substring(0,g.length-1)}else{b="s:"+c}}}}}}return escape(b)}});Ext.state.Manager=function(){var a=new Ext.state.Provider();return{setProvider:function(b){a=b},get:function(c,b){return a.get(c,b)},set:function(b,c){a.set(b,c)},clear:function(b){a.clear(b)},getProvider:function(){return a}}}();Ext.state.CookieProvider=Ext.extend(Ext.state.Provider,{constructor:function(a){Ext.state.CookieProvider.superclass.constructor.call(this);this.path="/";this.expires=new Date(new Date().getTime()+(1000*60*60*24*7));this.domain=null;this.secure=false;Ext.apply(this,a);this.state=this.readCookies()},set:function(a,b){if(typeof b=="undefined"||b===null){this.clear(a);return}this.setCookie(a,b);Ext.state.CookieProvider.superclass.set.call(this,a,b)},clear:function(a){this.clearCookie(a);Ext.state.CookieProvider.superclass.clear.call(this,a)},readCookies:function(){var d={},h=document.cookie+";",b=/\s?(.*?)=(.*?);/g,g,a,e;while((g=b.exec(h))!=null){a=g[1];e=g[2];if(a&&a.substring(0,3)=="ys-"){d[a.substr(3)]=this.decodeValue(e)}}return d},setCookie:function(a,b){document.cookie="ys-"+a+"="+this.encodeValue(b)+((this.expires==null)?"":("; expires="+this.expires.toGMTString()))+((this.path==null)?"":("; path="+this.path))+((this.domain==null)?"":("; domain="+this.domain))+((this.secure==true)?"; secure":"")},clearCookie:function(a){document.cookie="ys-"+a+"=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":"")}});Ext.DataView=Ext.extend(Ext.BoxComponent,{selectedClass:"x-view-selected",emptyText:"",deferEmptyText:true,trackOver:false,blockRefresh:false,last:false,initComponent:function(){Ext.DataView.superclass.initComponent.call(this);if(Ext.isString(this.tpl)||Ext.isArray(this.tpl)){this.tpl=new Ext.XTemplate(this.tpl)}this.addEvents("beforeclick","click","mouseenter","mouseleave","containerclick","dblclick","contextmenu","containercontextmenu","selectionchange","beforeselect");this.store=Ext.StoreMgr.lookup(this.store);this.all=new Ext.CompositeElementLite();this.selected=new Ext.CompositeElementLite()},afterRender:function(){Ext.DataView.superclass.afterRender.call(this);this.mon(this.getTemplateTarget(),{click:this.onClick,dblclick:this.onDblClick,contextmenu:this.onContextMenu,scope:this});if(this.overClass||this.trackOver){this.mon(this.getTemplateTarget(),{mouseover:this.onMouseOver,mouseout:this.onMouseOut,scope:this})}if(this.store){this.bindStore(this.store,true)}},refresh:function(){this.clearSelections(false,true);var b=this.getTemplateTarget(),a=this.store.getRange();b.update("");if(a.length<1){if(!this.deferEmptyText||this.hasSkippedEmptyText){b.update(this.emptyText)}this.all.clear()}else{this.tpl.overwrite(b,this.collectData(a,0));this.all.fill(Ext.query(this.itemSelector,b.dom));this.updateIndexes(0)}this.hasSkippedEmptyText=true},getTemplateTarget:function(){return this.el},prepareData:function(a){return a},collectData:function(b,e){var d=[],c=0,a=b.length;for(;c<a;c++){d[d.length]=this.prepareData(b[c].data,e+c,b[c])}return d},bufferRender:function(a,b){var c=document.createElement("div");this.tpl.overwrite(c,this.collectData(a,b));return Ext.query(this.itemSelector,c)},onUpdate:function(g,a){var b=this.store.indexOf(a);if(b>-1){var e=this.isSelected(b),c=this.all.elements[b],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(e<this.all.getCount()){h=this.all.item(e).insertSibling(c,"before",true);b.splice.apply(b,[e,0].concat(c))}else{h=this.all.last().insertSibling(c,"after",true);b.push.apply(b,c)}this.updateIndexes(e)},onRemove:function(c,a,b){this.deselect(b);this.all.removeElement(b,true);this.updateIndexes(b);if(this.store.getCount()===0){this.refresh()}},refreshNode:function(a){this.onUpdate(this.store,this.store.getAt(a))},updateIndexes:function(d,c){var b=this.all.elements;d=d||0;c=c||((c===0)?0:(b.length-1));for(var a=d;a<=c;a++){b[a].viewIndex=a}},getStore:function(){return this.store},bindStore:function(a,b){if(!b&&this.store){if(a!==this.store&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("datachanged",this.onDataChanged,this);this.store.un("add",this.onAdd,this);this.store.un("remove",this.onRemove,this);this.store.un("update",this.onUpdate,this);this.store.un("clear",this.refresh,this)}if(!a){this.store=null}}if(a){a=Ext.StoreMgr.lookup(a);a.on({scope:this,beforeload:this.onBeforeLoad,datachanged:this.onDataChanged,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,clear:this.refresh})}this.store=a;if(a){this.refresh()}},onDataChanged:function(){if(this.blockRefresh!==true){this.refresh.apply(this,arguments)}},findItemFromChild:function(a){return Ext.fly(a).findParent(this.itemSelector,this.getTemplateTarget())},onClick:function(c){var b=c.getTarget(this.itemSelector,this.getTemplateTarget()),a;if(b){a=this.indexOf(b);if(this.onItemClick(b,a,c)!==false){this.fireEvent("click",this,a,b,c)}}else{if(this.fireEvent("containerclick",this,c)!==false){this.onContainerClick(c)}}},onContainerClick:function(a){this.clearSelections()},onContextMenu:function(b){var a=b.getTarget(this.itemSelector,this.getTemplateTarget());if(a){this.fireEvent("contextmenu",this,this.indexOf(a),a,b)}else{this.fireEvent("containercontextmenu",this,b)}},onDblClick:function(b){var a=b.getTarget(this.itemSelector,this.getTemplateTarget());if(a){this.fireEvent("dblclick",this,this.indexOf(a),a,b)}},onMouseOver:function(b){var a=b.getTarget(this.itemSelector,this.getTemplateTarget());if(a&&a!==this.lastItem){this.lastItem=a;Ext.fly(a).addClass(this.overClass);this.fireEvent("mouseenter",this,this.indexOf(a),a,b)}},onMouseOut:function(a){if(this.lastItem){if(!a.within(this.lastItem,true,true)){Ext.fly(this.lastItem).removeClass(this.overClass);this.fireEvent("mouseleave",this,this.indexOf(this.lastItem),this.lastItem,a);delete this.lastItem}}},onItemClick:function(b,a,c){if(this.fireEvent("beforeclick",this,a,b,c)===false){return false}if(this.multiSelect){this.doMultiSelection(b,a,c);c.preventDefault()}else{if(this.singleSelect){this.doSingleSelection(b,a,c);c.preventDefault()}}return true},doSingleSelection:function(b,a,c){if(c.ctrlKey&&this.isSelected(a)){this.deselect(a)}else{this.select(a,false)}},doMultiSelection:function(c,a,d){if(d.shiftKey&&this.last!==false){var b=this.last;this.selectRange(b,a,d.ctrlKey);this.last=b}else{if((d.ctrlKey||this.simpleSelect)&&this.isSelected(a)){this.deselect(a)}else{this.select(a,d.ctrlKey||d.shiftKey||this.simpleSelect)}}},getSelectionCount:function(){return this.selected.getCount()},getSelectedNodes:function(){return this.selected.elements},getSelectedIndexes:function(){var b=[],d=this.selected.elements,c=0,a=d.length;for(;c<a;c++){b.push(d[c].viewIndex)}return b},getSelectedRecords:function(){return this.getRecords(this.selected.elements)},getRecords:function(c){var b=[],d=0,a=c.length;for(;d<a;d++){b[b.length]=this.store.getAt(c[d].viewIndex)}return b},getRecord:function(a){return this.store.getAt(a.viewIndex)},clearSelections:function(a,b){if((this.multiSelect||this.singleSelect)&&this.selected.getCount()>0){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;c++){this.select(d[c],true,true)}if(!b){this.fireEvent("selectionchange",this,this.selected.elements)}}else{var e=this.getNode(d);if(!g){this.clearSelections(true)}if(e&&!this.isSelected(e)){if(this.fireEvent("beforeselect",this,e,this.selected.elements)!==false){Ext.fly(e).addClass(this.selectedClass);this.selected.add(e);this.last=e.viewIndex;if(!b){this.fireEvent("selectionchange",this,this.selected.elements)}}}}},selectRange:function(c,a,b){if(!b){this.clearSelections(true)}this.select(this.getNodes(c,a),true)},getNode:function(b){if(Ext.isString(b)){return document.getElementById(b)}else{if(Ext.isNumber(b)){return this.all.elements[b]}else{if(b instanceof Ext.data.Record){var a=this.store.indexOf(b);return this.all.elements[a]}}}return b},getNodes:function(e,a){var d=this.all.elements,b=[],c;e=e||0;a=!Ext.isDefined(a)?Math.max(d.length-1,0):a;if(e<=a){for(c=e;c<=a&&d[c];c++){b.push(d[c])}}else{for(c=e;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('<div class="loading-indicator">'+this.loadingText+"</div>");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,maxColumnWidth: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('<div class="x-list-header"><div class="x-list-header-inner">','<tpl for="columns">','<div style="width:{[values.width*100]}%;text-align:{align};"><em unselectable="on" id="',this.id,'-xlhd-{#}">',"{header}","</em></div>","</tpl>",'<div class="x-clear"></div>',"</div></div>",'<div class="x-list-body"><div class="x-list-body-inner">',"</div></div>")}if(!this.tpl){this.tpl=new Ext.XTemplate('<tpl for="rows">',"<dl>",'<tpl for="parent.columns">','<dt style="width:{[values.width*100]}%;text-align:{align};">','<em unselectable="on"<tpl if="cls"> class="{cls}</tpl>">',"{[values.tpl.apply(parent)]}","</em></dt>","</tpl>",'<div class="x-clear"></div>',"</dl>","</tpl>")}var l=this.columns,h=0,k=0,m=l.length,b=[];for(var g=0;g<m;g++){var n=l[g];if(!n.isColumn){n.xtype=n.xtype?(/^lv/.test(n.xtype)?n.xtype:"lv"+n.xtype):"lvcolumn";n=Ext.create(n)}if(n.width){h+=n.width*100;if(h>this.maxColumnWidth){n.width-=(h-this.maxColumnWidth)/100}k++}b.push(n)}l=this.columns=b;if(k<m){var d=m-k;if(h<this.maxColumnWidth){var a=((this.maxColumnWidth-h)/d)/100;for(var e=0;e<m;e++){var n=l[e];if(!n.width){n.width=a}}}}Ext.list.ListView.superclass.initComponent.call(this)},onRender:function(){this.autoEl={cls:"x-list-wrap"};Ext.list.ListView.superclass.onRender.apply(this,arguments);this.internalTpl.overwrite(this.el,{columns:this.columns});this.innerBody=Ext.get(this.el.dom.childNodes[1].firstChild);this.innerHd=Ext.get(this.el.dom.firstChild.firstChild);if(this.hideHeaders){this.el.dom.firstChild.style.display="none"}},getTemplateTarget:function(){return this.innerBody},collectData:function(){var a=Ext.list.ListView.superclass.collectData.apply(this,arguments);return{columns:this.columns,rows:a}},verifyInternalSize:function(){if(this.lastSize){this.onResize(this.lastSize.width,this.lastSize.height)}},onResize:function(c,e){var b=this.innerBody.dom,g=this.innerHd.dom,d=c-Ext.num(this.scrollOffset,Ext.getScrollBarWidth())+"px",a;if(!b){return}a=b.parentNode;if(Ext.isNumber(c)){if(this.reserveScrollOffset||((a.offsetWidth-a.clientWidth)>10)){b.style.width=d;g.style.width=d}else{b.style.width=c+"px";g.style.width=c+"px";setTimeout(function(){if((a.offsetWidth-a.clientWidth)>10){b.style.width=d;g.style.width=d}},10)}}if(Ext.isNumber(e)){a.style.height=Math.max(0,e-g.parentNode.offsetHeight)+"px"}},updateIndexes:function(){Ext.list.ListView.superclass.updateIndexes.apply(this,arguments);this.verifyInternalSize()},findHeaderIndex:function(g){g=g.dom||g;var a=g.parentNode,d=a.parentNode.childNodes,b=0,e;for(;e=d[b];b++){if(e==a){return b}}return -1},setHdWidths:function(){var d=this.innerHd.dom.getElementsByTagName("div"),c=0,b=this.columns,a=b.length;for(;c<a;c++){d[c].style.width=(b[c].width*100)+"%"}}});Ext.reg("listview",Ext.list.ListView);Ext.ListView=Ext.list.ListView;Ext.list.Column=Ext.extend(Object,{isColumn:true,align:"left",header:"",width:null,cls:"",constructor:function(a){if(!a.tpl){a.tpl=new Ext.XTemplate("{"+a.dataIndex+"}")}else{if(Ext.isString(a.tpl)){a.tpl=new Ext.XTemplate(a.tpl)}}Ext.apply(this,a)}});Ext.reg("lvcolumn",Ext.list.Column);Ext.list.NumberColumn=Ext.extend(Ext.list.Column,{format:"0,000.00",constructor:function(a){a.tpl=a.tpl||new Ext.XTemplate("{"+a.dataIndex+':number("'+(a.format||this.format)+'")}');Ext.list.NumberColumn.superclass.constructor.call(this,a)}});Ext.reg("lvnumbercolumn",Ext.list.NumberColumn);Ext.list.DateColumn=Ext.extend(Ext.list.Column,{format:"m/d/Y",constructor:function(a){a.tpl=a.tpl||new Ext.XTemplate("{"+a.dataIndex+':date("'+(a.format||this.format)+'")}');Ext.list.DateColumn.superclass.constructor.call(this,a)}});Ext.reg("lvdatecolumn",Ext.list.DateColumn);Ext.list.BooleanColumn=Ext.extend(Ext.list.Column,{trueText:"true",falseText:"false",undefinedText:"&#160;",constructor:function(e){e.tpl=e.tpl||new Ext.XTemplate("{"+e.dataIndex+":this.format}");var b=this.trueText,d=this.falseText,a=this.undefinedText;e.tpl.format=function(c){if(c===undefined){return a}if(!c||c==="false"){return d}return b};Ext.list.DateColumn.superclass.constructor.call(this,e)}});Ext.reg("lvbooleancolumn",Ext.list.BooleanColumn);Ext.list.ColumnResizer=Ext.extend(Ext.util.Observable,{minPct:0.05,constructor:function(a){Ext.apply(this,a);Ext.list.ColumnResizer.superclass.constructor.call(this)},init:function(a){this.view=a;a.on("render",this.initEvents,this)},initEvents:function(a){a.mon(a.innerHd,"mousemove",this.handleHdMove,this);this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeStart.createDelegate(this),onStart:this.onStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onEnd.createDelegate(this),tolerance:3,autoStart:300});this.tracker.initEl(a.innerHd);a.on("beforedestroy",this.tracker.destroy,this.tracker)},handleHdMove:function(i,d){var c=5,b=i.getPageX(),j=i.getTarget("em",3,true);if(j){var h=j.getRegion(),g=j.dom.style,a=j.dom.parentNode;if(b-h.left<=c&&a!=a.parentNode.firstChild){this.activeHd=Ext.get(a.previousSibling.firstChild);g.cursor=Ext.isWebKit?"e-resize":"col-resize"}else{if(h.right-b<=c&&a!=a.parentNode.lastChild.previousSibling){this.activeHd=j;g.cursor=Ext.isWebKit?"w-resize":"col-resize"}else{delete this.activeHd;g.cursor=""}}}},onBeforeStart:function(a){this.dragHd=this.activeHd;return !!this.dragHd},onStart:function(g){var d=this,b=d.view,c=d.dragHd,a=d.tracker.getXY()[0];d.proxy=b.el.createChild({cls:"x-list-resizer"});d.dragX=c.getX();d.headerIndex=b.findHeaderIndex(c);d.headersDisabled=b.disableHeaders;b.disableHeaders=true;d.proxy.setHeight(b.el.getHeight());d.proxy.setX(d.dragX);d.proxy.setWidth(a-d.dragX);this.setBoundaries()},setBoundaries:function(j){var k=this.view,h=this.headerIndex,c=k.innerHd.getWidth(),j=k.innerHd.getX(),b=Math.ceil(c*this.minPct),l=c-b,e=k.columns.length,d=k.innerHd.select("em",true),g=b+j,a=l+j,i;if(e==2){this.minX=g;this.maxX=a}else{i=d.item(h+2);this.minX=d.item(h).getX()+b;this.maxX=i?i.getX()-b:a;if(h==0){this.minX=g}else{if(h==e-2){this.maxX=a}}}},onDrag:function(c){var b=this,a=b.tracker.getXY()[0].constrain(b.minX,b.maxX);b.proxy.setWidth(a-this.dragX)},onEnd:function(i){var g=this.proxy.getWidth(),h=this.headerIndex,l=this.view,c=l.columns,b=l.innerHd.getWidth(),k=Math.ceil(g*l.maxColumnWidth/b)/100,d=this.headersDisabled,m=c[h],j=c[h+1],a=m.width+j.width;this.proxy.remove();m.width=k;j.width=a-k;delete this.dragHd;l.setHdWidths();l.refresh();setTimeout(function(){l.disableHeaders=d},100)}});Ext.ListView.ColumnResizer=Ext.list.ColumnResizer;Ext.list.Sorter=Ext.extend(Ext.util.Observable,{sortClasses:["sort-asc","sort-desc"],constructor:function(a){Ext.apply(this,a);Ext.list.Sorter.superclass.constructor.call(this)},init:function(a){this.view=a;a.on("render",this.initEvents,this)},initEvents:function(a){a.mon(a.innerHd,"click",this.onHdClick,this);a.innerHd.setStyle("cursor","pointer");a.mon(a.store,"datachanged",this.updateSortState,this);this.updateSortState.defer(10,this,[a.store])},updateSortState:function(c){var g=c.getSortState();if(!g){return}this.sortState=g;var e=this.view.columns,h=-1;for(var d=0,a=e.length;d<a;d++){if(e[d].dataIndex==g.field){h=d;break}}if(h!=-1){var b=g.direction;this.updateSortIcon(h,b)}},updateSortIcon:function(b,a){var d=this.sortClasses;var c=this.view.innerHd.select("em").removeClass(d);c.item(b).addClass(d[a=="DESC"?1:0])},onHdClick:function(c){var b=c.getTarget("em",3);if(b&&!this.view.disableHeaders){var a=this.view.findHeaderIndex(b);this.view.store.sort(this.view.columns[a].dataIndex)}}});Ext.ListView.Sorter=Ext.list.Sorter;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 g=this.tabPosition=="top"?"header":"footer";this[g].addClass("x-tab-panel-"+g+"-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:"&#160;"}]});this.strip.createChild({cls:"x-clear"});this.body.addClass("x-tab-panel-body-"+this.tabPosition);if(!this.itemTpl){var d=new Ext.Template('<li class="{cls}" id="{id}"><a class="x-tab-strip-close"></a>','<a class="x-tab-right" href="#"><em class="x-tab-left">','<span class="x-tab-strip-inner"><span class="x-tab-strip-text {iconCls}">{text}</span></span>',"</em></a></li>");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;b<a;b++){var e=c[b],g=e.getAttribute("title");e.removeAttribute("title");this.add({title:g,contentEl:e})}},initTab:function(d,b){var e=this.strip.dom.childNodes[b],g=this.getTemplateArgs(d),c=e?this.itemTpl.insertBefore(e,g):this.itemTpl.append(this.strip,g),a="x-tab-strip-over",h=Ext.get(c);h.hover(function(){if(!d.disabled){h.addClass(a)}},function(){h.removeClass(a)});if(d.tabTip){h.child("span.x-tab-strip-text",true).qtip=d.tabTip}d.tabEl=c;h.select("a").on("click",function(i){if(!i.getPageX()){this.onStripMouseDown(i)}},this,{preventDefault:true});d.on({scope:this,disable:this.onItemDisabled,enable:this.onItemEnabled,titlechange:this.onItemTitleChanged,iconchange:this.onItemIconChanged,beforeshow:this.onBeforeShowItem})},getTemplateArgs:function(b){var a=b.closable?"x-tab-strip-closable":"";if(b.disabled){a+=" x-item-disabled"}if(b.iconCls){a+=" x-tab-with-icon"}if(b.tabCls){a+=" "+b.tabCls}return{id:this.id+this.idDelimiter+b.getItemId(),text:b.title,cls:a,iconCls:b.iconCls||""}},onAdd:function(b){Ext.TabPanel.superclass.onAdd.call(this,b);if(this.rendered){var a=this.items;this.initTab(b,a.indexOf(b));this.delegateUpdates()}},onBeforeAdd:function(b){var a=b.events?(this.items.containsKey(b.getItemId())?b:null):this.items.get(b);if(a){this.setActiveTab(b);return false}Ext.TabPanel.superclass.onBeforeAdd.apply(this,arguments);var c=b.elements;b.elements=c?c.replace(",header",""):c;b.border=(b.border===true)},onRemove:function(d){var b=Ext.get(d.tabEl);if(b){b.select("a").removeAllListeners();Ext.destroy(b)}Ext.TabPanel.superclass.onRemove.call(this,d);this.stack.remove(d);delete d.tabEl;d.un("disable",this.onItemDisabled,this);d.un("enable",this.onItemEnabled,this);d.un("titlechange",this.onItemTitleChanged,this);d.un("iconchange",this.onItemIconChanged,this);d.un("beforeshow",this.onBeforeShowItem,this);if(d==this.activeTab){var a=this.stack.next();if(a){this.setActiveTab(a)}else{if(this.items.getCount()>0){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(){var a=this.rendered;if(this.suspendUpdates){return}if(this.resizeTabs&&a){this.autoSizeTabs()}if(this.enableTabScroll&&a){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;e<j;e++){var l=m[e],n=Ext.fly(l).child(".x-tab-strip-inner",true),g=l.offsetWidth,d=n.offsetWidth;n.style.width=(k-(g-d))+"px"}},adjustBodyWidth:function(a){if(this.header){this.header.setWidth(a)}if(this.footer){this.footer.setWidth(a)}return a},setActiveTab:function(c){c=this.getComponent(c);if(this.fireEvent("beforetabchange",this,c,this.activeTab)===false){return}if(!this.rendered){this.activeTab=c;return}if(this.activeTab!=c){if(this.activeTab){var a=this.getTabEl(this.activeTab);if(a){Ext.fly(a).removeClass("x-tab-strip-active")}}this.activeTab=c;if(c){var b=this.getTabEl(c);Ext.fly(b).addClass("x-tab-strip-active");this.stack.add(c);this.layout.setActiveItem(c);this.delegateUpdates();if(this.scrolling){this.scrollToTab(c,this.animScroll)}}this.fireEvent("tabchange",this,c)}},getActiveTab:function(){return this.activeTab||null},getItem:function(a){return this.getComponent(a)},autoScrollTabs:function(){this.pos=this.tabPosition=="bottom"?this.footer:this.header;var h=this.items.length,d=this.pos.dom.offsetWidth,c=this.pos.dom.clientWidth,g=this.stripWrap,e=g.dom,b=e.offsetWidth,i=this.getScrollPos(),a=this.edge.getOffsetsTo(this.stripWrap)[0]+i;if(!this.enableTabScroll||b<20){return}if(h==0||a<=c){e.scrollLeft=0;g.setWidth(c);if(this.scrolling){this.scrolling=false;this.pos.removeClass("x-tab-scrolling");this.scrollLeft.hide();this.scrollRight.hide();if(Ext.isAir||Ext.isWebKit){e.style.marginLeft="";e.style.marginRight=""}}}else{if(!this.scrolling){this.pos.addClass("x-tab-scrolling");if(Ext.isAir||Ext.isWebKit){e.style.marginLeft="18px";e.style.marginRight="18px"}}c-=g.getMargins("lr");g.setWidth(c>20?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){this.scrollTo(g,a)}else{if(b>(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<b;c++){if(a[c]!=e){d.push(a[c])}}a=d},next:function(){return a.pop()}}};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(){if(this.menu){if(Ext.isArray(this.menu)){this.menu={items:this.menu}}if(Ext.isObject(this.menu)){this.menu.ownerCt=this}this.menu=Ext.menu.MenuMgr.get(this.menu);this.menu.ownerCt=undefined}Ext.Button.superclass.initComponent.call(this);this.addEvents("click","toggle","mouseover","mouseout","menushow","menuhide","menutriggerover","menutriggerout");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('<table id="{4}" cellspacing="0" class="x-btn {3}"><tbody class="{1}">','<tr><td class="x-btn-tl"><i>&#160;</i></td><td class="x-btn-tc"></td><td class="x-btn-tr"><i>&#160;</i></td></tr>','<tr><td class="x-btn-ml"><i>&#160;</i></td><td class="x-btn-mc"><em class="{2}" unselectable="on"><button type="{0}"></button></em></td><td class="x-btn-mr"><i>&#160;</i></td></tr>','<tr><td class="x-btn-bl"><i>&#160;</i></td><td class="x-btn-bc"></td><td class="x-btn-br"><i>&#160;</i></td></tr>',"</tbody></table>");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.onRepeatClick,this)}else{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.btnEl,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()<this.minWidth){this.el.setWidth(this.minWidth)}}}},setHandler:function(b,a){this.handler=b;this.scope=a;return this},setText:function(a){this.text=a;if(this.el){this.btnEl.update(a||"&#160;");this.setButtonClass()}this.doAutoWidth();return this},setIcon:function(a){this.icon=a;if(this.el){this.btnEl.setStyle("background-image",a?"url("+a+")":"");this.setButtonClass()}return this},getText:function(){return this.text},toggle:function(b,a){b=b===undefined?!this.pressed:!!b;if(b!=this.pressed){if(this.rendered){this.el[b?"addClass":"removeClass"]("x-btn-pressed")}this.pressed=b;if(!a){this.fireEvent("toggle",this,b);if(this.toggleHandler){this.toggleHandler.call(this.scope||this,this,b)}}}return this},onDisable:function(){this.onDisableChange(true)},onEnable:function(){this.onDisableChange(false)},onDisableChange:function(a){if(this.el){if(!Ext.isIE6||!this.text){this.el[a?"addClass":"removeClass"](this.disabledClass)}this.el.dom.disabled=a}this.disabled=a},showMenu:function(){if(this.rendered&&this.menu){if(this.tooltip){Ext.QuickTips.getQuickTip().cancelShow(this.btnEl)}if(this.menu.isVisible()){this.menu.hide()}this.menu.ownerCt=this;this.menu.show(this.el,this.menuAlign)}return this},hideMenu:function(){if(this.hasVisibleMenu()){this.menu.hide()}return this},hasVisibleMenu:function(){return this.menu&&this.menu.ownerCt==this&&this.menu.isVisible()},onRepeatClick:function(a,b){this.onClick(b)},onClick:function(a){if(a){a.preventDefault()}if(a.button!==0){return}if(!this.disabled){this.doToggle();if(this.menu&&!this.hasVisibleMenu()&&!this.ignoreNextClick){this.showMenu()}this.fireEvent("click",this,a);if(this.handler){this.handler.call(this.scope||this,this,a)}}},doToggle:function(){if(this.enableToggle&&(this.allowDepress!==false||!this.pressed)){this.toggle()}},isMenuTriggerOver:function(b,a){return this.menu&&!a},isMenuTriggerOut:function(b,a){return this.menu&&!a},onMouseOver:function(b){if(!this.disabled){var a=b.within(this.el,true);if(!a){this.el.addClass("x-btn-over");if(!this.monitoringMouseOver){this.doc.on("mouseover",this.monitorMouseOver,this);this.monitoringMouseOver=true}this.fireEvent("mouseover",this,b)}if(this.isMenuTriggerOver(b,a)){this.fireEvent("menutriggerover",this,this.menu,b)}}},monitorMouseOver:function(a){if(a.target!=this.el.dom&&!a.within(this.el)){if(this.monitoringMouseOver){this.doc.un("mouseover",this.monitorMouseOver,this);this.monitoringMouseOver=false}this.onMouseOut(a)}},onMouseOut:function(b){var a=b.within(this.el)&&b.target!=this.el.dom;this.el.removeClass("x-btn-over");this.fireEvent("mouseout",this,b);if(this.isMenuTriggerOut(b,a)){this.fireEvent("menutriggerout",this,this.menu,b)}},focus:function(){this.btnEl.focus()},blur:function(){this.btnEl.blur()},onFocus:function(a){if(!this.disabled){this.el.addClass("x-btn-focus")}},onBlur:function(a){this.el.removeClass("x-btn-focus")},getClickEl:function(b,a){return this.el},onMouseDown:function(a){if(!this.disabled&&a.button===0){this.getClickEl(a).addClass("x-btn-click");this.doc.on("mouseup",this.onMouseUp,this)}},onMouseUp:function(a){if(a.button===0){this.getClickEl(a,true).removeClass("x-btn-click");this.doc.un("mouseup",this.onMouseUp,this)}},onMenuShow:function(a){if(this.menu.ownerCt==this){this.menu.ownerCt=this;this.ignoreNextClick=0;this.el.addClass("x-btn-menu-active");this.fireEvent("menushow",this,this.menu)}},onMenuHide:function(a){if(this.menu.ownerCt==this){this.el.removeClass("x-btn-menu-active");this.ignoreNextClick=this.restoreClick.defer(250,this);this.fireEvent("menuhide",this,this.menu);delete this.menu.ownerCt}},restoreClick:function(){this.ignoreNextClick=0}});Ext.reg("button",Ext.Button);Ext.ButtonToggleMgr=function(){var a={};function b(e,j){if(j){var h=a[e.toggleGroup];for(var d=0,c=h.length;d<c;d++){if(h[d]!=e){h[d].toggle(false)}}}}return{register:function(c){if(!c.toggleGroup){return}var d=a[c.toggleGroup];if(!d){d=a[c.toggleGroup]=[]}d.push(c);c.on("toggle",b)},unregister:function(c){if(!c.toggleGroup){return}var d=a[c.toggleGroup];if(d){d.remove(c);c.un("toggle",b)}},getPressed:function(h){var e=a[h];if(e){for(var d=0,c=e.length;d<c;d++){if(e[d].pressed===true){return e[d]}}}return null}}}();Ext.SplitButton=Ext.extend(Ext.Button,{arrowSelector:"em",split:true,initComponent:function(){Ext.SplitButton.superclass.initComponent.call(this);this.addEvents("arrowclick")},onRender:function(){Ext.SplitButton.superclass.onRender.apply(this,arguments);if(this.arrowTooltip){this.el.child(this.arrowSelector).dom[this.tooltipType]=this.arrowTooltip}},setArrowHandler:function(b,a){this.arrowHandler=b;this.scope=a},getMenuClass:function(){return"x-btn-split"+(this.arrowAlign=="bottom"?"-bottom":"")},isClickOnArrow:function(c){if(this.arrowAlign!="bottom"){var b=this.el.child("em.x-btn-split");var a=b.getRegion().right-b.getPadding("r");return c.getPageX()>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{this.doToggle();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,a)}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<this.itemCount;c++){d=(this.activeItem.itemIndex+c)%this.itemCount;b=a.items.itemAt(d);if(!b.disabled){b.setChecked(true);break}}}});Ext.reg("cycle",Ext.CycleButton);Ext.Toolbar=function(a){if(Ext.isArray(a)){a={items:a,layout:"toolbar"}}else{a=Ext.apply({layout:"toolbar"},a);if(a.buttons){a.items=a.buttons}}Ext.Toolbar.superclass.constructor.call(this,a)};(function(){var a=Ext.Toolbar;Ext.extend(a,Ext.Container,{defaultType:"button",enableOverflow:false,trackMenus:true,internalDefaults:{removeMode:"container",hideParent:true},toolbarCls:"x-toolbar",initComponent:function(){a.superclass.initComponent.call(this);this.addEvents("overflowchange")},onRender:function(c,b){if(!this.el){if(!this.autoCreate){this.autoCreate={cls:this.toolbarCls+" x-small-editor"}}this.el=c.createChild(Ext.apply({id:this.id},this.autoCreate),b);Ext.Toolbar.superclass.onRender.apply(this,arguments)}},lookupComponent:function(b){if(Ext.isString(b)){if(b=="-"){b=new a.Separator()}else{if(b==" "){b=new a.Spacer()}else{if(b=="->"){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<b;d++){e.push(this.addButton(c[d]))}return e}return this.add(this.constructButton(c))},addText:function(b){return this.addItem(new a.TextItem(b))},addDom:function(b){return this.add(new a.Item({autoEl:b}))},addField:function(b){return this.add(b)},insertButton:function(c,g){if(Ext.isArray(g)){var e=[];for(var d=0,b=g.length;d<b;d++){e.push(this.insertButton(c+d,g[d]))}return e}return Ext.Toolbar.superclass.insert.call(this,c,g)},trackMenu:function(c,b){if(this.trackMenus&&c.menu){var d=b?"mun":"mon";this[d](c,"menutriggerover",this.onButtonTriggerOver,this);this[d](c,"menushow",this.onButtonMenuShow,this);this[d](c,"menuhide",this.onButtonMenuHide,this)}},constructButton:function(d){var c=d.events?d:this.createComponent(d,d.split?"splitbutton":this.defaultType);return c},onAdd:function(b){Ext.Toolbar.superclass.onAdd.call(this);this.trackMenu(b);if(this.disabled){b.disable()}},onRemove:function(b){Ext.Toolbar.superclass.onRemove.call(this);if(b==this.activeMenuBtn){delete this.activeMenuBtn}this.trackMenu(b,true)},onDisable:function(){this.items.each(function(b){if(b.disable){b.disable()}})},onEnable:function(){this.items.each(function(b){if(b.enable){b.enable()}})},onButtonTriggerOver:function(b){if(this.activeMenuBtn&&this.activeMenuBtn!=b){this.activeMenuBtn.hideMenu();b.showMenu();this.activeMenuBtn=b}},onButtonMenuShow:function(b){this.activeMenuBtn=b},onButtonMenuHide:function(b){delete this.activeMenuBtn}});Ext.reg("toolbar",Ext.Toolbar);a.Item=Ext.extend(Ext.BoxComponent,{hideParent:true,enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.reg("tbitem",a.Item);a.Separator=Ext.extend(a.Item,{onRender:function(c,b){this.el=c.createChild({tag:"span",cls:"xtb-sep"},b)}});Ext.reg("tbseparator",a.Separator);a.Spacer=Ext.extend(a.Item,{onRender:function(c,b){this.el=c.createChild({tag:"div",cls:"xtb-spacer",style:this.width?"width:"+this.width+"px":""},b)}});Ext.reg("tbspacer",a.Spacer);a.Fill=Ext.extend(a.Item,{render:Ext.emptyFn,isFill:true});Ext.reg("tbfill",a.Fill);a.TextItem=Ext.extend(a.Item,{constructor:function(b){a.TextItem.superclass.constructor.call(this,Ext.isString(b)?{text:b}:b)},onRender:function(c,b){this.autoEl={cls:"xtb-text",html:this.text||""};a.TextItem.superclass.onRender.call(this,c,b)},setText:function(b){if(this.rendered){this.el.update(b)}else{this.text=b}}});Ext.reg("tbtext",a.TextItem);a.Button=Ext.extend(Ext.Button,{});a.SplitButton=Ext.extend(Ext.SplitButton,{});Ext.reg("tbbutton",a.Button);Ext.reg("tbsplit",a.SplitButton)})();Ext.ButtonGroup=Ext.extend(Ext.Panel,{baseCls:"x-btn-group",layout:"table",defaultType:"button",frame:true,internalDefaults:{removeMode:"container",hideParent:true},initComponent:function(){this.layoutConfig=this.layoutConfig||{};Ext.applyIf(this.layoutConfig,{columns:this.columns});if(!this.title){this.addClass("x-btn-group-notitle")}this.on("afterlayout",this.onAfterLayout,this);Ext.ButtonGroup.superclass.initComponent.call(this)},applyDefaults:function(b){b=Ext.ButtonGroup.superclass.applyDefaults.call(this,b);var a=this.internalDefaults;if(b.events){Ext.applyIf(b.initialConfig,a);Ext.apply(b,a)}else{Ext.applyIf(b,a)}return b},onAfterLayout:function(){var a=this.body.getFrameWidth("lr")+this.body.dom.firstChild.offsetWidth;this.body.setWidth(a);this.el.setWidth(a+this.getFrameWidth())}});Ext.reg("buttongroup",Ext.ButtonGroup);(function(){var a=Ext.Toolbar;Ext.PagingToolbar=Ext.extend(Ext.Toolbar,{pageSize:20,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No data to display",beforePageText:"Page",afterPageText:"of {0}",firstText:"First Page",prevText:"Previous Page",nextText:"Next Page",lastText:"Last Page",refreshText:"Refresh",initComponent:function(){var c=[this.first=new a.Button({tooltip:this.firstText,overflowText:this.firstText,iconCls:"x-tbar-page-first",disabled:true,handler:this.moveFirst,scope:this}),this.prev=new a.Button({tooltip:this.prevText,overflowText:this.prevText,iconCls:"x-tbar-page-prev",disabled:true,handler:this.movePrevious,scope:this}),"-",this.beforePageText,this.inputItem=new Ext.form.NumberField({cls:"x-tbar-page-number",allowDecimals:false,allowNegative:false,enableKeyEvents:true,selectOnFocus:true,submitValue:false,listeners:{scope:this,keydown:this.onPagingKeyDown,blur:this.onPagingBlur}}),this.afterTextItem=new a.TextItem({text:String.format(this.afterPageText,1)}),"-",this.next=new a.Button({tooltip:this.nextText,overflowText:this.nextText,iconCls:"x-tbar-page-next",disabled:true,handler:this.moveNext,scope:this}),this.last=new a.Button({tooltip:this.lastText,overflowText:this.lastText,iconCls:"x-tbar-page-last",disabled:true,handler:this.moveLast,scope:this}),"-",this.refresh=new a.Button({tooltip:this.refreshText,overflowText:this.refreshText,iconCls:"x-tbar-loading",handler:this.doRefresh,scope:this})];var b=this.items||this.buttons||[];if(this.prependButtons){this.items=b.concat(c)}else{this.items=c.concat(b)}delete this.buttons;if(this.displayInfo){this.items.push("->");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<this.pageSize?1:Math.ceil(b/this.pageSize)}},changePage:function(b){this.doLoad(((b-1)*this.pageSize).constrain(0,this.store.getTotalCount()))},onLoadError:function(){if(!this.rendered){return}this.refresh.enable()},readPage:function(e){var b=this.inputItem.getValue(),c;if(!b||isNaN(c=parseInt(b,10))){this.inputItem.setValue(e.activePage);return false}return c},onPagingFocus:function(){this.inputItem.select()},onPagingBlur:function(b){this.inputItem.setValue(this.getPageData().activePage)},onPagingKeyDown:function(i,h){var c=h.getKey(),j=this.getPageData(),g;if(c==h.RETURN){h.stopEvent();g=this.readPage(j);if(g!==false){g=Math.min(Math.max(1,g),j.pages)-1;this.doLoad(g*this.pageSize)}}else{if(c==h.HOME||c==h.END){h.stopEvent();g=c==h.HOME?1:j.pages;i.setValue(g)}else{if(c==h.UP||c==h.PAGEUP||c==h.DOWN||c==h.PAGEDOWN){h.stopEvent();if((g=this.readPage(j))){var b=h.shiftKey?10:1;if(c==h.DOWN||c==h.PAGEDOWN){b*=-1}g+=b;if(g>=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=location.href,m=l.indexOf("#"),n=m>=0?l.substr(m+1):null;if(Ext.isGecko){n=decodeURIComponent(n)}return n}function a(){c.value=d}function h(l){d=l;Ext.History.fireEvent("change",l)}function i(m){var l=['<html><body><div id="state">',Ext.util.Format.htmlEncode(m),"</div></body></html>"].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);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{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).setVisibilityMode(Ext.Element.DISPLAY)},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]<k){if(this.anchorToTarget){this.defaultAlign="l-r";if(this.mouseOffset){this.mouseOffset[0]*=-1}}this.anchor="left";return this.getTargetXY()}if(b[0]+g.width>a){if(this.anchorToTarget){this.defaultAlign="r-l";if(this.mouseOffset){this.mouseOffset[0]*=-1}}this.anchor="right";return this.getTargetXY()}if(b[1]<j){if(this.anchorToTarget){this.defaultAlign="t-b";if(this.mouseOffset){this.mouseOffset[1]*=-1}}this.anchor="top";return this.getTargetXY()}if(b[1]+g.height>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()<this.quickShowInterval){this.show()}else{this.showTimer=this.show.defer(this.showDelay,this)}}else{if(!this.hidden&&this.autoHide!==false){this.show()}}},onTargetOut:function(a){if(this.disabled||a.within(this.target.dom,true)){return}this.clearTimer("show");if(this.autoHide!==false){this.delayHide()}},delayHide:function(){if(!this.hidden&&!this.hideTimer){this.hideTimer=this.hide.defer(this.hideDelay,this)}},hide:function(){this.clearTimer("dismiss");this.lastActive=new Date();if(this.anchorEl){this.anchorEl.hide()}Ext.ToolTip.superclass.hide.call(this);delete this.triggerElement},show:function(){if(this.anchor){this.showAt([-1000,-1000]);this.origConstrainPosition=this.constrainPosition;this.constrainPosition=false;this.anchor=this.origAnchor}this.showAt(this.getTargetXY());if(this.anchor){this.anchorEl.show();this.syncAnchor();this.constrainPosition=this.origConstrainPosition}else{this.anchorEl.hide()}},showAt:function(a){this.lastActive=new Date();this.clearTimers();Ext.ToolTip.superclass.showAt.call(this,a);if(this.dismissDelay&&this.autoHide!==false){this.dismissTimer=this.hide.defer(this.dismissDelay,this)}if(this.anchor&&!this.anchorEl.isVisible()){this.syncAnchor();this.anchorEl.show()}else{this.anchorEl.hide()}},syncAnchor:function(){var a,b,c;switch(this.tipAnchor.charAt(0)){case"t":a="b";b="tl";c=[20+this.anchorOffset,2];break;case"r":a="l";b="tr";c=[-2,11+this.anchorOffset];break;case"b":a="t";b="bl";c=[20+this.anchorOffset,-2];break;default:a="r";b="tl";c=[2,11+this.anchorOffset];break}this.anchorEl.alignTo(this.el,a+"-"+b,c)},setPagePosition:function(a,b){Ext.ToolTip.superclass.setPagePosition.call(this,a,b);if(this.anchor){this.syncAnchor()}},clearTimer:function(a){a=a+"Timer";clearTimeout(this[a]);delete this[a]},clearTimers:function(){this.clearTimer("show");this.clearTimer("dismiss");this.clearTimer("hide")},onShow:function(){Ext.ToolTip.superclass.onShow.call(this);Ext.getDoc().on("mousedown",this.onDocMouseDown,this)},onHide:function(){Ext.ToolTip.superclass.onHide.call(this);Ext.getDoc().un("mousedown",this.onDocMouseDown,this)},onDocMouseDown:function(a){if(this.autoHide!==true&&!this.closable&&!a.within(this.el.dom)){this.disable();this.doEnable.defer(100,this)}},doEnable:function(){if(!this.isDestroyed){this.enable()}},onDisable:function(){this.clearTimers();this.hide()},adjustPosition:function(a,d){if(this.constrainPosition){var c=this.targetXY[1],b=this.getSize().height;if(d<=c&&(d+b)>=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;g<a;g++){var l=h[g];var k=l.target;if(k){if(Ext.isArray(k)){for(var d=0,b=k.length;d<b;d++){this.targets[Ext.id(k[d])]=l}}else{this.targets[Ext.id(k)]=l}}}},unregister:function(a){delete this.targets[Ext.id(a)]},cancelShow:function(b){var a=this.activeTarget;b=Ext.get(b).dom;if(this.isVisible()){if(a&&a.el==b){this.hide()}}else{if(a&&a.el==b){this.clearTimer("show")}}},getTipCfg:function(d){var b=d.getTarget(),c,a;if(this.interceptTitles&&b.title&&Ext.isString(b.title)){c=b.title;b.qtip=c;b.removeAttribute("title");d.preventDefault()}else{a=this.tagConfig;c=b.qtip||Ext.fly(b).getAttribute(a.attribute,a.namespace)}return c},onTargetOver:function(i){if(this.disabled){return}this.targetXY=i.getXY();var c=i.getTarget();if(!c||c.nodeType!==1||c==document||c==document.body){return}if(this.activeTarget&&((c==this.activeTarget.el)||Ext.fly(this.activeTarget.el).contains(c))){this.clearTimer("hide");this.show();return}if(c&&this.targets[c.id]){this.activeTarget=this.targets[c.id];this.activeTarget.el=c;this.anchor=this.activeTarget.anchor;if(this.anchor){this.anchorTarget=c}this.delayShow();return}var g,h=Ext.fly(c),b=this.tagConfig,d=b.namespace;if(g=this.getTipCfg(i)){var a=h.getAttribute(b.hide,d);this.activeTarget={el:c,text:g,width:h.getAttribute(b.width,d),autoHide:a!="user"&&a!=="false",title:h.getAttribute(b.title,d),cls:h.getAttribute(b.cls,d),align:h.getAttribute(b.align,d)};this.anchor=h.getAttribute(b.anchor,d);if(this.anchor){this.anchorTarget=c}this.delayShow()}},onTargetOut:function(a){if(this.activeTarget&&a.within(this.activeTarget.el)&&!this.getTipCfg(a)){return}this.clearTimer("show");if(this.autoHide!==false){this.delayHide()}},showAt:function(b){var a=this.activeTarget;if(a){if(!this.rendered){this.render(Ext.getBody());this.activeTarget=a}if(a.width){this.setWidth(a.width);this.body.setWidth(this.adjustBodyWidth(a.width-this.getFrameWidth()));this.measureWidth=false}else{this.measureWidth=true}this.setTitle(a.title||"");this.body.update(a.text);this.autoHide=a.autoHide;this.dismissDelay=a.dismissDelay||this.dismissDelay;if(this.lastCls){this.el.removeClass(this.lastCls);delete this.lastCls}if(a.cls){this.el.addClass(a.cls);this.lastCls=a.cls}if(this.anchor){this.constrainPosition=false}else{if(a.align){b=this.el.getAlignToXY(a.el,a.align);this.constrainPosition=false}else{this.constrainPosition=true}}}Ext.QuickTip.superclass.showAt.call(this,b)},hide:function(){delete this.activeTarget;Ext.QuickTip.superclass.hide.call(this)}});Ext.reg("quicktip",Ext.QuickTip);Ext.QuickTips=function(){var b,a=false;return{init:function(c){if(!b){if(!Ext.isReady){Ext.onReady(function(){Ext.QuickTips.init(c)});return}b=new Ext.QuickTip({elements:"header,body",disabled:a});if(c!==false){b.render(Ext.getBody())}}},ddDisable:function(){if(b&&!a){b.disable()}},ddEnable:function(){if(b&&!a){b.enable()}},enable:function(){if(b){b.enable()}a=false},disable:function(){if(b){b.disable()}a=true},isEnabled:function(){return b!==undefined&&!b.disabled},getQuickTip:function(){return b},register:function(){b.register.apply(b,arguments)},unregister:function(){b.unregister.apply(b,arguments)},tips:function(){b.register.apply(b,arguments)}}}();Ext.slider.Tip=Ext.extend(Ext.Tip,{minWidth:10,offsets:[0,-10],init:function(a){a.on({scope:this,dragstart:this.onSlide,drag:this.onSlide,dragend:this.hide,destroy:this.destroy})},onSlide:function(b,c,a){this.show();this.body.update(this.getText(a));this.doAutoWidth();this.el.alignTo(a.el,"b-t?",this.offsets)},getText:function(a){return String(a.value)}});Ext.ux.SliderTip=Ext.slider.Tip;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,h,g,e,d){if(c=="collapse"||c=="expand"||c=="beforecollapse"||c=="beforeexpand"||c=="move"||c=="beforemove"){c=c+"node"}return this.fireEvent(c,b,a,h,g,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){if(Ext.isEmpty(g)){if(h){h(false,undefined)}return}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 i=c.findChild(a,d[b]);if(!i){if(h){h(false,c)}return}c=i;i.expand(false,false,e)};c.expand(false,false,e)},selectPath:function(e,a,g){if(Ext.isEmpty(e)){if(g){g(false,undefined)}return}a=a||"id";var c=e.split(this.pathSeparator),b=c.pop();if(c.length>1){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;c<a;c++){d[c].ui.onSelectedChange(false)}this.selNodes=[];this.selMap={};if(b!==true){this.fireEvent("selectionchange",this,this.selNodes)}}},isSelected:function(a){return this.selMap[a.id]?true:false},getSelectedNodes:function(){return this.selNodes.concat([])},onKeyDown:Ext.tree.DefaultSelectionModel.prototype.onKeyDown,selectNext:Ext.tree.DefaultSelectionModel.prototype.selectNext,selectPrevious:Ext.tree.DefaultSelectionModel.prototype.selectPrevious});Ext.data.Tree=Ext.extend(Ext.util.Observable,{constructor:function(a){this.nodeHash={};this.root=null;if(a){this.setRootNode(a)}this.addEvents("append","remove","move","insert","beforeappend","beforeremove","beforemove","beforeinsert");Ext.data.Tree.superclass.constructor.call(this)},pathSeparator:"/",proxyNodeEvent:function(){return this.fireEvent.apply(this,arguments)},getRootNode:function(){return this.root},setRootNode:function(a){this.root=a;a.ownerTree=this;a.isRoot=true;this.registerNode(a);return a},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:"")+"]"}});Ext.data.Node=Ext.extend(Ext.util.Observable,{constructor:function(a){this.attributes=a||{};this.leaf=this.attributes.leaf;this.id=this.attributes.id;if(!this.id){this.id=Ext.id(null,"xnode-");this.attributes.id=this.id}this.childNodes=[];this.parentNode=null;this.firstChild=null;this.lastChild=null;this.previousSibling=null;this.nextSibling=null;this.addEvents({append:true,remove:true,move:true,insert:true,beforeappend:true,beforeremove:true,beforemove:true,beforeinsert:true});this.listeners=this.attributes.listeners;Ext.data.Node.superclass.constructor.call(this)},fireEvent:function(b){if(Ext.data.Node.superclass.fireEvent.apply(this,arguments)===false){return false}var a=this.getOwnerTree();if(a){if(a.proxyNodeEvent.apply(a,arguments)===false){return false}}return true},isLeaf:function(){return this.leaf===true},setFirstChild:function(a){this.firstChild=a},setLastChild:function(a){this.lastChild=a},isLast:function(){return(!this.parentNode?true:this.parentNode.lastChild==this)},isFirst:function(){return(!this.parentNode?true:this.parentNode.firstChild==this)},hasChildNodes:function(){return !this.isLeaf()&&this.childNodes.length>0},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;d<a;d++){this.appendChild(g[d])}}else{if(this.fireEvent("beforeappend",this.ownerTree,this,e)===false){return false}var b=this.childNodes.length;var c=e.parentNode;if(c){if(e.fireEvent("beforemove",e.getOwnerTree(),e,c,this,b)===false){return false}c.removeChild(e)}b=this.childNodes.length;if(b===0){this.setFirstChild(e)}this.childNodes.push(e);e.parentNode=this;var h=this.childNodes[b-1];if(h){e.previousSibling=h;h.nextSibling=e}else{e.previousSibling=null}e.nextSibling=null;this.setLastChild(e);e.setOwnerTree(this.getOwnerTree());this.fireEvent("append",this.ownerTree,this,e,b);if(c){e.fireEvent("move",this.ownerTree,e,c,this,b)}return e}},removeChild:function(c,b){var a=this.childNodes.indexOf(c);if(a==-1){return false}if(this.fireEvent("beforeremove",this.ownerTree,this,c)===false){return false}this.childNodes.splice(a,1);if(c.previousSibling){c.previousSibling.nextSibling=c.nextSibling}if(c.nextSibling){c.nextSibling.previousSibling=c.previousSibling}if(this.firstChild==c){this.setFirstChild(c.nextSibling)}if(this.lastChild==c){this.setLastChild(c.previousSibling)}this.fireEvent("remove",this.ownerTree,this,c);if(b){c.destroy(true)}else{c.clear()}return c},clear:function(a){this.setOwnerTree(null,a);this.parentNode=this.previousSibling=this.nextSibling=null;if(a){this.firstChild=this.lastChild=null}},destroy:function(a){if(a===true){this.purgeListeners();this.clear(true);Ext.each(this.childNodes,function(b){b.destroy(true)});this.childNodes=null}else{this.remove(true)}},insertBefore:function(d,a){if(!a){return this.appendChild(d)}if(d==a){return false}if(this.fireEvent("beforeinsert",this.ownerTree,this,d,a)===false){return false}var b=this.childNodes.indexOf(a);var c=d.parentNode;var e=b;if(c==this&&this.childNodes.indexOf(d)<b){e--}if(c){if(d.fireEvent("beforemove",d.getOwnerTree(),d,c,this,b,a)===false){return false}c.removeChild(d)}if(e===0){this.setFirstChild(d)}this.childNodes.splice(e,0,d);d.parentNode=this;var g=this.childNodes[e-1];if(g){d.previousSibling=g;g.nextSibling=d}else{d.previousSibling=null}d.nextSibling=a;a.previousSibling=d;d.setOwnerTree(this.getOwnerTree());this.fireEvent("insert",this.ownerTree,this,d,a);if(c){d.fireEvent("move",this.ownerTree,d,c,this,e,a)}return d},remove:function(a){if(this.parentNode){this.parentNode.removeChild(this,a)}return this},removeAll:function(a){var c=this.childNodes,b;while((b=c[0])){this.removeChild(b,a)}return this},item:function(a){return this.childNodes[a]},replaceChild:function(a,c){var b=c?c.nextSibling:null;this.removeChild(c);this.insertBefore(a,b);return c},indexOf:function(a){return this.childNodes.indexOf(a)},getOwnerTree:function(){if(!this.ownerTree){var a=this;while(a){if(a.ownerTree){this.ownerTree=a.ownerTree;break}a=a.parentNode}}return this.ownerTree},getDepth:function(){var b=0;var a=this;while(a.parentNode){++b;a=a.parentNode}return b},setOwnerTree:function(a,b){if(a!=this.ownerTree){if(this.ownerTree){this.ownerTree.unregisterNode(this)}this.ownerTree=a;if(b!==true){Ext.each(this.childNodes,function(c){c.setOwnerTree(a)})}if(a){a.registerNode(this)}}},setId:function(b){if(b!==this.id){var a=this.ownerTree;if(a){a.unregisterNode(this)}this.id=this.attributes.id=b;if(a){a.registerNode(this)}this.onIdChange(b)}},onIdChange:Ext.emptyFn,getPath:function(c){c=c||"id";var e=this.parentNode;var a=[this.attributes[c]];while(e){a.unshift(e.attributes[c]);e=e.parentNode}var d=this.getOwnerTree().pathSeparator;return d+a.join(d)},bubble:function(c,b,a){var d=this;while(d){if(c.apply(b||d,a||[d])===false){break}d=d.parentNode}},cascade:function(g,e,b){if(g.apply(e||this,b||[this])!==false){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].cascade(g,e,b)}}},eachChild:function(g,e,b){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){if(g.apply(e||d[c],b||[d[c]])===false){break}}},findChild:function(b,c,a){return this.findChildBy(function(){return this.attributes[b]==c},null,a)},findChildBy:function(h,g,b){var e=this.childNodes,a=e.length,d=0,j,c;for(;d<a;d++){j=e[d];if(h.call(g||j,j)===true){return j}else{if(b){c=j.findChildBy(h,g,b);if(c!=null){return c}}}}return null},sort:function(e,d){var c=this.childNodes;var a=c.length;if(a>0){var g=d?function(){e.apply(d,arguments)}:e;c.sort(g);for(var b=0;b<a;b++){var h=c[b];h.previousSibling=c[b-1];h.nextSibling=c[b+1];if(b===0){this.setFirstChild(h)}if(b==a-1){this.setLastChild(h)}}}},contains:function(a){return a.isAncestor(this)},isAncestor:function(a){var b=this.parentNode;while(b){if(b==a){return true}b=b.parentNode}return false},toString:function(){return"[Node"+(this.id?" "+this.id:"")+"]"}});Ext.tree.TreeNode=Ext.extend(Ext.data.Node,{constructor:function(a){a=a||{};if(Ext.isString(a)){a={text:a}}this.childrenRendered=false;this.rendered=false;Ext.tree.TreeNode.superclass.constructor.call(this,a);this.expanded=a.expanded===true;this.isTarget=a.isTarget!==false;this.draggable=a.draggable!==false&&a.allowDrag!==false;this.allowChildren=a.allowChildren!==false&&a.allowDrop!==false;this.text=a.text;this.disabled=a.disabled===true;this.hidden=a.hidden===true;this.addEvents("textchange","beforeexpand","beforecollapse","expand","disabledchange","collapse","beforeclick","click","checkchange","beforedblclick","dblclick","contextmenu","beforechildrenrendered");var b=this.attributes.uiProvider||this.defaultUI||Ext.tree.TreeNodeUI;this.ui=new b(this)},preventHScroll:true,isExpanded:function(){return this.expanded},getUI:function(){return this.ui},getLoader:function(){var a;return this.loader||((a=this.getOwnerTree())&&a.loader?a.loader:(this.loader=new Ext.tree.TreeLoader()))},setFirstChild:function(a){var b=this.firstChild;Ext.tree.TreeNode.superclass.setFirstChild.call(this,a);if(this.childrenRendered&&b&&a!=b){b.renderIndent(true,true)}if(this.rendered){this.renderIndent(true,true)}},setLastChild:function(b){var a=this.lastChild;Ext.tree.TreeNode.superclass.setLastChild.call(this,b);if(this.childrenRendered&&a&&b!=a){a.renderIndent(true,true)}if(this.rendered){this.renderIndent(true,true)}},appendChild:function(b){if(!b.render&&!Ext.isArray(b)){b=this.getLoader().createNode(b)}var a=Ext.tree.TreeNode.superclass.appendChild.call(this,b);if(a&&this.childrenRendered){a.render()}this.ui.updateExpandIcon();return a},removeChild:function(b,a){this.ownerTree.getSelectionModel().unselect(b);Ext.tree.TreeNode.superclass.removeChild.apply(this,arguments);if(!a){var c=b.ui.rendered;if(c){b.ui.remove()}if(c&&this.childNodes.length<1){this.collapse(false,false)}else{this.ui.updateExpandIcon()}if(!this.firstChild&&!this.isHiddenRoot()){this.childrenRendered=false}}return b},insertBefore:function(c,a){if(!c.render){c=this.getLoader().createNode(c)}var b=Ext.tree.TreeNode.superclass.insertBefore.call(this,c,a);if(b&&a&&this.childrenRendered){c.render()}this.ui.updateExpandIcon();return b},setText:function(b){var a=this.text;this.text=this.attributes.text=b;if(this.rendered){this.ui.onTextChange(this,b,a)}this.fireEvent("textchange",this,b,a)},setIconCls:function(b){var a=this.attributes.iconCls;this.attributes.iconCls=b;if(this.rendered){this.ui.onIconClsChange(this,b,a)}},setTooltip:function(a,b){this.attributes.qtip=a;this.attributes.qtipTitle=b;if(this.rendered){this.ui.onTipChange(this,a,b)}},setIcon:function(a){this.attributes.icon=a;if(this.rendered){this.ui.onIconChange(this,a)}},setHref:function(a,b){this.attributes.href=a;this.attributes.hrefTarget=b;if(this.rendered){this.ui.onHrefChange(this,a,b)}},setCls:function(b){var a=this.attributes.cls;this.attributes.cls=b;if(this.rendered){this.ui.onClsChange(this,b,a)}},select:function(){var a=this.getOwnerTree();if(a){a.getSelectionModel().select(this)}},unselect:function(a){var b=this.getOwnerTree();if(b){b.getSelectionModel().unselect(this,a)}},isSelected:function(){var a=this.getOwnerTree();return a?a.getSelectionModel().isSelected(this):false},expand:function(a,c,d,b){if(!this.expanded){if(this.fireEvent("beforeexpand",this,a,c)===false){return}if(!this.childrenRendered){this.renderChildren()}this.expanded=true;if(!this.isHiddenRoot()&&(this.getOwnerTree().animate&&c!==false)||c){this.ui.animExpand(function(){this.fireEvent("expand",this);this.runCallback(d,b||this,[this]);if(a===true){this.expandChildNodes(true,true)}}.createDelegate(this));return}else{this.ui.expand();this.fireEvent("expand",this);this.runCallback(d,b||this,[this])}}else{this.runCallback(d,b||this,[this])}if(a===true){this.expandChildNodes(true)}},runCallback:function(a,c,b){if(Ext.isFunction(a)){a.apply(c,b)}},isHiddenRoot:function(){return this.isRoot&&!this.getOwnerTree().rootVisible},collapse:function(b,g,h,e){if(this.expanded&&!this.isHiddenRoot()){if(this.fireEvent("beforecollapse",this,b,g)===false){return}this.expanded=false;if((this.getOwnerTree().animate&&g!==false)||g){this.ui.animCollapse(function(){this.fireEvent("collapse",this);this.runCallback(h,e||this,[this]);if(b===true){this.collapseChildNodes(true)}}.createDelegate(this));return}else{this.ui.collapse();this.fireEvent("collapse",this);this.runCallback(h,e||this,[this])}}else{if(!this.expanded){this.runCallback(h,e||this,[this])}}if(b===true){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].collapse(true,false)}}},delayedExpand:function(a){if(!this.expandProcId){this.expandProcId=this.expand.defer(a,this)}},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId)}this.expandProcId=false},toggle:function(){if(this.expanded){this.collapse()}else{this.expand()}},ensureVisible:function(c,b){var a=this.getOwnerTree();a.expandPath(this.parentNode?this.parentNode.getPath():this.getPath(),false,function(){var d=a.getNodeById(this.id);a.getTreeEl().scrollChildIntoView(d.ui.anchor);this.runCallback(c,b||this,[this])}.createDelegate(this))},expandChildNodes:function(b,e){var d=this.childNodes,c,a=d.length;for(c=0;c<a;c++){d[c].expand(b,e)}},collapseChildNodes:function(b){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].collapse(b)}},disable:function(){this.disabled=true;this.unselect();if(this.rendered&&this.ui.onDisableChange){this.ui.onDisableChange(this,true)}this.fireEvent("disabledchange",this,true)},enable:function(){this.disabled=false;if(this.rendered&&this.ui.onDisableChange){this.ui.onDisableChange(this,false)}this.fireEvent("disabledchange",this,false)},renderChildren:function(b){if(b!==false){this.fireEvent("beforechildrenrendered",this)}var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].render(true)}this.childrenRendered=true},sort:function(e,d){Ext.tree.TreeNode.superclass.sort.apply(this,arguments);if(this.childrenRendered){var c=this.childNodes;for(var b=0,a=c.length;b<a;b++){c[b].render(true)}}},render:function(a){this.ui.render(a);if(!this.rendered){this.getOwnerTree().registerNode(this);this.rendered=true;if(this.expanded){this.expanded=false;this.expand(false,false)}}},renderIndent:function(b,e){if(e){this.ui.childIndent=null}this.ui.renderIndent();if(b===true&&this.childrenRendered){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].renderIndent(true,e)}}},beginUpdate:function(){this.childrenRendered=false},endUpdate:function(){if(this.expanded&&this.rendered){this.renderChildren()}},destroy:function(a){if(a===true){this.unselect(true)}Ext.tree.TreeNode.superclass.destroy.call(this,a);Ext.destroy(this.ui,this.loader);this.ui=this.loader=null},onIdChange:function(a){this.ui.onIdChange(a)}});Ext.tree.TreePanel.nodeTypes.node=Ext.tree.TreeNode;Ext.tree.AsyncTreeNode=function(a){this.loaded=a&&a.loaded===true;this.loading=false;Ext.tree.AsyncTreeNode.superclass.constructor.apply(this,arguments);this.addEvents("beforeload","load")};Ext.extend(Ext.tree.AsyncTreeNode,Ext.tree.TreeNode,{expand:function(b,e,h,c){if(this.loading){var g;var d=function(){if(!this.loading){clearInterval(g);this.expand(b,e,h,c)}}.createDelegate(this);g=setInterval(d,200);return}if(!this.loaded){if(this.fireEvent("beforeload",this)===false){return}this.loading=true;this.ui.beforeLoad(this);var a=this.loader||this.attributes.loader||this.getOwnerTree().getLoader();if(a){a.load(this,this.loadComplete.createDelegate(this,[b,e,h,c]),this);return}}Ext.tree.AsyncTreeNode.superclass.expand.call(this,b,e,h,c)},isLoading:function(){return this.loading},loadComplete:function(a,c,d,b){this.loading=false;this.loaded=true;this.ui.afterLoad(this);this.fireEvent("load",this);this.expand(a,c,d,b)},isLoaded:function(){return this.loaded},hasChildNodes:function(){if(!this.isLeaf()&&!this.loaded){return true}else{return Ext.tree.AsyncTreeNode.superclass.hasChildNodes.call(this)}},reload:function(b,a){this.collapse(false,false);while(this.firstChild){this.removeChild(this.firstChild).destroy()}this.childrenRendered=false;this.loaded=false;if(this.isHiddenRoot()){this.expanded=false}this.expand(false,false,b,a)}});Ext.tree.TreePanel.nodeTypes.async=Ext.tree.AsyncTreeNode;Ext.tree.TreeNodeUI=Ext.extend(Object,{constructor:function(a){Ext.apply(this,{node:a,rendered:false,animating:false,wasLeaf:true,ecc:"x-tree-ec-icon x-tree-elbow",emptyIcon:Ext.BLANK_IMAGE_URL})},removeChild:function(a){if(this.rendered){this.ctNode.removeChild(a.ui.getEl())}},beforeLoad:function(){this.addClass("x-tree-node-loading")},afterLoad:function(){this.removeClass("x-tree-node-loading")},onTextChange:function(b,c,a){if(this.rendered){this.textNode.innerHTML=c}},onIconClsChange:function(c,a,b){if(this.rendered){Ext.fly(this.iconNode).replaceClass(b,a)}},onIconChange:function(b,a){if(this.rendered){var c=Ext.isEmpty(a);this.iconNode.src=c?this.emptyIcon:a;Ext.fly(this.iconNode)[c?"removeClass":"addClass"]("x-tree-node-inline-icon")}},onTipChange:function(b,c,d){if(this.rendered){var a=Ext.isDefined(d);if(this.textNode.setAttributeNS){this.textNode.setAttributeNS("ext","qtip",c);if(a){this.textNode.setAttributeNS("ext","qtitle",d)}}else{this.textNode.setAttribute("ext:qtip",c);if(a){this.textNode.setAttribute("ext:qtitle",d)}}}},onHrefChange:function(b,a,c){if(this.rendered){this.anchor.href=this.getHref(a);if(Ext.isDefined(c)){this.anchor.target=c}}},onClsChange:function(c,a,b){if(this.rendered){Ext.fly(this.elNode).replaceClass(b,a)}},onDisableChange:function(a,b){this.disabled=b;if(this.checkbox){this.checkbox.disabled=b}this[b?"addClass":"removeClass"]("x-tree-node-disabled")},onSelectedChange:function(a){if(a){this.focus();this.addClass("x-tree-selected")}else{this.removeClass("x-tree-selected")}},onMove:function(a,h,e,g,d,b){this.childIndent=null;if(this.rendered){var i=g.ui.getContainer();if(!i){this.holder=document.createElement("div");this.holder.appendChild(this.wrap);return}var c=b?b.ui.getEl():null;if(c){i.insertBefore(this.wrap,c)}else{i.appendChild(this.wrap)}this.node.renderIndent(true,e!=g)}},addClass:function(a){if(this.elNode){Ext.fly(this.elNode).addClass(a)}},removeClass:function(a){if(this.elNode){Ext.fly(this.elNode).removeClass(a)}},remove:function(){if(this.rendered){this.holder=document.createElement("div");this.holder.appendChild(this.wrap)}},fireEvent:function(){return this.node.fireEvent.apply(this.node,arguments)},initEvents:function(){this.node.on("move",this.onMove,this);if(this.node.disabled){this.onDisableChange(this.node,true)}if(this.node.hidden){this.hide()}var b=this.node.getOwnerTree();var a=b.enableDD||b.enableDrag||b.enableDrop;if(a&&(!this.node.isRoot||b.rootVisible)){Ext.dd.Registry.register(this.elNode,{node:this.node,handles:this.getDDHandles(),isHandle:false})}},getDDHandles:function(){return[this.iconNode,this.textNode,this.elNode]},hide:function(){this.node.hidden=true;if(this.wrap){this.wrap.style.display="none"}},show:function(){this.node.hidden=false;if(this.wrap){this.wrap.style.display=""}},onContextMenu:function(a){if(this.node.hasListener("contextmenu")||this.node.getOwnerTree().hasListener("contextmenu")){a.preventDefault();this.focus();this.fireEvent("contextmenu",this.node,a)}},onClick:function(c){if(this.dropping){c.stopEvent();return}if(this.fireEvent("beforeclick",this.node,c)!==false){var b=c.getTarget("a");if(!this.disabled&&this.node.attributes.href&&b){this.fireEvent("click",this.node,c);return}else{if(b&&c.ctrlKey){c.stopEvent()}}c.preventDefault();if(this.disabled){return}if(this.node.attributes.singleClickExpand&&!this.animating&&this.node.isExpandable()){this.node.toggle()}this.fireEvent("click",this.node,c)}else{c.stopEvent()}},onDblClick:function(a){a.preventDefault();if(this.disabled){return}if(this.fireEvent("beforedblclick",this.node,a)!==false){if(this.checkbox){this.toggleCheck()}if(!this.animating&&this.node.isExpandable()){this.node.toggle()}this.fireEvent("dblclick",this.node,a)}},onOver:function(a){this.addClass("x-tree-node-over")},onOut:function(a){this.removeClass("x-tree-node-over")},onCheckChange:function(){var a=this.checkbox.checked;this.checkbox.defaultChecked=a;this.node.attributes.checked=a;this.fireEvent("checkchange",this.node,a)},ecClick:function(a){if(!this.animating&&this.node.isExpandable()){this.node.toggle()}},startDrop:function(){this.dropping=true},endDrop:function(){setTimeout(function(){this.dropping=false}.createDelegate(this),50)},expand:function(){this.updateExpandIcon();this.ctNode.style.display=""},focus:function(){if(!this.node.preventHScroll){try{this.anchor.focus()}catch(c){}}else{try{var b=this.node.getOwnerTree().getTreeEl().dom;var a=b.scrollLeft;this.anchor.focus();b.scrollLeft=a}catch(c){}}},toggleCheck:function(b){var a=this.checkbox;if(a){a.checked=(b===undefined?!a.checked:b);this.onCheckChange()}},blur:function(){try{this.anchor.blur()}catch(a){}},animExpand:function(b){var a=Ext.get(this.ctNode);a.stopFx();if(!this.node.isExpandable()){this.updateExpandIcon();this.ctNode.style.display="";Ext.callback(b);return}this.animating=true;this.updateExpandIcon();a.slideIn("t",{callback:function(){this.animating=false;Ext.callback(b)},scope:this,duration:this.node.ownerTree.duration||0.25})},highlight:function(){var a=this.node.getOwnerTree();Ext.fly(this.wrap).highlight(a.hlColor||"C3DAF9",{endColor:a.hlBaseColor})},collapse:function(){this.updateExpandIcon();this.ctNode.style.display="none"},animCollapse:function(b){var a=Ext.get(this.ctNode);a.enableDisplayMode("block");a.stopFx();this.animating=true;this.updateExpandIcon();a.slideOut("t",{callback:function(){this.animating=false;Ext.callback(b)},scope:this,duration:this.node.ownerTree.duration||0.25})},getContainer:function(){return this.ctNode},getEl:function(){return this.wrap},appendDDGhost:function(a){a.appendChild(this.elNode.cloneNode(true))},getDDRepairXY:function(){return Ext.lib.Dom.getXY(this.iconNode)},onRender:function(){this.render()},render:function(c){var e=this.node,b=e.attributes;var d=e.parentNode?e.parentNode.ui.getContainer():e.ownerTree.innerCt.dom;if(!this.rendered){this.rendered=true;this.renderElements(e,b,d,c);if(b.qtip){this.onTipChange(e,b.qtip,b.qtipTitle)}else{if(b.qtipCfg){b.qtipCfg.target=Ext.id(this.textNode);Ext.QuickTips.register(b.qtipCfg)}}this.initEvents();if(!this.node.expanded){this.updateExpandIcon(true)}}else{if(c===true){d.appendChild(this.wrap)}}},renderElements:function(e,k,j,l){this.indentMarkup=e.parentNode?e.parentNode.ui.getChildIndent():"";var g=Ext.isBoolean(k.checked),b,c=this.getHref(k.href),d=['<li class="x-tree-node"><div ext:tree-node-id="',e.id,'" class="x-tree-node-el x-tree-node-leaf x-unselectable ',k.cls,'" unselectable="on">','<span class="x-tree-node-indent">',this.indentMarkup,"</span>",'<img alt="" src="',this.emptyIcon,'" class="x-tree-ec-icon x-tree-elbow" />','<img alt="" src="',k.icon||this.emptyIcon,'" class="x-tree-node-icon',(k.icon?" x-tree-node-inline-icon":""),(k.iconCls?" "+k.iconCls:""),'" unselectable="on" />',g?('<input class="x-tree-node-cb" type="checkbox" '+(k.checked?'checked="checked" />':"/>")):"",'<a hidefocus="on" class="x-tree-node-anchor" href="',c,'" tabIndex="1" ',k.hrefTarget?' target="'+k.hrefTarget+'"':"",'><span unselectable="on">',e.text,"</span></a></div>",'<ul class="x-tree-node-ct" style="display:none;"></ul>',"</li>"].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},getHref:function(a){return Ext.isEmpty(a)?(Ext.isGecko?"":"#"):a},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('<img alt="" src="'+this.emptyIcon+'" class="x-tree-elbow-line" />')}else{a.unshift('<img alt="" src="'+this.emptyIcon+'" class="x-tree-icon" />')}}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='<div class="x-tree-root-node"></div>';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<a;b++){var e=d.appendChild(this.createNode(c[b]));if(this.preloadChildren){this.doPreload(e)}}d.endUpdate()}return true}return false},getParams:function(g){var e=Ext.apply({},this.baseParams),h=this.nodeParameter,b=this.paramOrder;h&&(e[h]=g.id);if(this.directFn){var c=[g.id];if(b){if(h&&b.indexOf(h)>-1){c=[]}for(var d=0,a=b.length;d<a;d++){c.push(e[b[d]])}}else{if(this.paramsAsHash){c=[e]}}return c}else{return e}},requestData:function(c,d,b){if(this.fireEvent("beforeload",this,c,d)!==false){if(this.directFn){var a=this.getParams(c);a.push(this.processDirectResponse.createDelegate(this,[{callback:d,node:c,scope:b}],true));this.directFn.apply(window,a)}else{this.transId=Ext.Ajax.request({method:this.requestMethod,url:this.dataUrl||this.url,success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{callback:d,node:c,scope:b},params:this.getParams(c)})}}else{this.runCallback(d,b||c,[])}},processDirectResponse:function(a,b,c){if(b.status){this.handleResponse({responseData:Ext.isArray(a)?a:null,responseText:a,argument:c})}else{this.handleFailure({argument:c})}},runCallback:function(a,c,b){if(Ext.isFunction(a)){a.apply(c,b)}},isLoading:function(){return !!this.transId},abort:function(){if(this.isLoading()){Ext.Ajax.abort(this.transId)}},createNode:function(attr){if(this.baseAttrs){Ext.applyIf(attr,this.baseAttrs)}if(this.applyLoader!==false&&!attr.loader){attr.loader=this}if(Ext.isString(attr.uiProvider)){attr.uiProvider=this.uiProviders[attr.uiProvider]||eval(attr.uiProvider)}if(attr.nodeType){return new Ext.tree.TreePanel.nodeTypes[attr.nodeType](attr)}else{return attr.leaf?new Ext.tree.TreeNode(attr):new Ext.tree.AsyncTreeNode(attr)}},processResponse:function(d,c,k,l){var m=d.responseText;try{var a=d.responseData||Ext.decode(m);c.beginUpdate();for(var g=0,h=a.length;g<h;g++){var b=this.createNode(a[g]);if(b){c.appendChild(b)}}c.endUpdate();this.runCallback(k,l||c,[c])}catch(j){this.handleFailure(d)}},handleResponse:function(c){this.transId=false;var b=c.argument;this.processResponse(c,b.node,b.callback,b.scope);this.fireEvent("load",this,b.node,c)},handleFailure:function(c){this.transId=false;var b=c.argument;this.fireEvent("loadexception",this,b.node,c);this.runCallback(b.callback,b.scope||b.node,[b.node])},destroy:function(){this.abort();this.purgeListeners()}});Ext.tree.TreeFilter=function(a,b){this.tree=a;this.filtered={};Ext.apply(this,b)};Ext.tree.TreeFilter.prototype={clearBlank:false,reverse:false,autoClear:false,remove:false,filter:function(d,a,b){a=a||"text";var c;if(typeof d=="string"){var e=d.length;if(e==0&&this.clearBlank){this.clear();return}d=d.toLowerCase();c=function(g){return g.attributes[a].substr(0,e).toLowerCase()==d}}else{if(d.exec){c=function(g){return d.test(g.attributes[a])}}else{throw"Illegal filter type, must be string or regex"}}this.filterBy(c,null,b)},filterBy:function(d,c,b){b=b||this.tree.root;if(this.autoClear){this.clear()}var a=this.filtered,i=this.reverse;var e=function(k){if(k==b){return true}if(a[k.id]){return false}var j=d.call(c||k,k);if(!j||i){a[k.id]=k;k.ui.hide();return false}return true};b.cascade(e);if(this.remove){for(var h in a){if(typeof h!="function"){var g=a[h];if(g&&g.parentNode){g.parentNode.removeChild(g)}}}}},clear:function(){var b=this.tree;var a=this.filtered;for(var d in a){if(typeof d!="function"){var c=a[d];if(c){c.ui.show()}}}this.filtered={}}};Ext.tree.TreeSorter=Ext.extend(Object,{constructor:function(a,c){Ext.apply(this,c);a.on({scope:this,beforechildrenrendered:this.doSort,append:this.updateSort,insert:this.updateSort,textchange:this.updateSortParent});var e=this.dir&&this.dir.toLowerCase()=="desc",i=this.property||"text",d=this.sortType,h=this.folderSort,b=this.caseSensitive===true,g=this.leafAttr||"leaf";if(Ext.isString(d)){d=Ext.data.SortTypes[d]}this.sortFn=function(o,m){var k=o.attributes,j=m.attributes;if(h){if(k[g]&&!j[g]){return 1}if(!k[g]&&j[g]){return -1}}var n=k[i],l=j[i],q=d?d(n):(b?n:n.toUpperCase()),p=d?d(l):(b?l:l.toUpperCase());if(q<p){return e?1:-1}else{if(q>p){return e?-1:1}}return 0}},doSort:function(a){a.sort(this.sortFn)},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;b<a;b++){g=d[b];if(e=="above"){c.parentNode.insertBefore(g,c)}else{if(e=="below"){c.parentNode.insertBefore(g,c.nextSibling)}else{c.appendChild(g)}}}g.ui.focus();if(Ext.enableFx&&this.tree.hlDrop){g.ui.highlight()}c.ui.endDrop();this.tree.fireEvent("nodedrop",h)},afterNodeMoved:function(a,c,g,d,b){if(Ext.enableFx&&this.tree.hlDrop){b.ui.focus();b.ui.highlight()}this.tree.fireEvent("nodedrop",this.tree,d,c,a,g)},getTree:function(){return this.tree},removeDropIndicators:function(b){if(b&&b.ddel){var a=b.ddel;Ext.fly(a).removeClass(["x-tree-drag-insert-above","x-tree-drag-insert-below","x-tree-drag-append"]);this.lastInsertClass="_noclass"}},beforeDragDrop:function(b,a,c){this.cancelExpand();return true},afterRepair:function(a){if(a&&Ext.enableFx){a.node.ui.highlight()}this.hideProxy()}})}if(Ext.dd.DragZone){Ext.tree.TreeDragZone=function(a,b){Ext.tree.TreeDragZone.superclass.constructor.call(this,a.innerCt,b);this.tree=a};Ext.extend(Ext.tree.TreeDragZone,Ext.dd.DragZone,{ddGroup:"TreeDD",onBeforeDrag:function(a,b){var c=a.node;return c&&c.draggable&&!c.disabled},onInitDrag:function(b){var a=this.dragData;this.tree.getSelectionModel().select(a.node);this.tree.eventModel.disable();this.proxy.update("");a.node.ui.appendDDGhost(this.proxy.ghost.dom);this.tree.fireEvent("startdrag",this.tree,a.node,b)},getRepairXY:function(b,a){return a.node.ui.getDDRepairXY()},onEndDrag:function(a,b){this.tree.eventModel.enable.defer(100,this.tree.eventModel);this.tree.fireEvent("enddrag",this.tree,a.node,b)},onValidDrop:function(a,b,c){this.tree.fireEvent("dragdrop",this.tree,this.dragData.node,a,b);this.hideProxy()},beforeInvalidDrop:function(a,c){var b=this.tree.getSelectionModel();b.clearSelections();b.select(this.dragData.node)},afterRepair:function(){if(Ext.enableFx&&this.tree.hlDrop){Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9")}this.dragging=false}})}Ext.tree.TreeEditor=function(a,c,b){c=c||{};var d=c.events?c:new Ext.form.TextField(c);Ext.tree.TreeEditor.superclass.constructor.call(this,d,b);this.tree=a;if(!a.rendered){a.on("render",this.initEditor,this)}else{this.initEditor(a)}};Ext.extend(Ext.tree.TreeEditor,Ext.Editor,{alignment:"l-l",autoSize:false,hideEl:false,cls:"x-small-editor x-tree-editor",shim:false,shadow:"frame",maxWidth:250,editDelay:350,initEditor:function(a){a.on({scope:this,beforeclick:this.beforeNodeClick,dblclick:this.onNodeDblClick});this.on({scope:this,complete:this.updateNode,beforestartedit:this.fitToTree,specialkey:this.onSpecialKey});this.on("startedit",this.bindScroll,this,{delay:10})},fitToTree:function(b,c){var e=this.tree.getTreeEl().dom,d=c.dom;if(e.scrollLeft>d.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("&#160;")}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 <http://code.google.com/p/swfobject/>
- is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
+This file is part of Ext JS 3.4
+
+Copyright (c) 2011-2013 Sencha Inc
+
+Contact: http://www.sencha.com/contact
+
+GNU General Public License Usage
+This file may be used under the terms of the GNU General Public License version 3.0 as
+published by the Free Software Foundation and appearing in the file LICENSE included in the
+packaging of this file.
+
+Please review the following information to ensure the GNU General Public License version 3.0
+requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+
+If you are unsure which license is appropriate for your use, please contact the sales department
+at http://www.sencha.com/contact.
+
+Build date: 2013-04-03 15:07:25
*/
-var swfobject=function(){var E="undefined",s="object",T="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",r="application/x-shockwave-flash",S="SWFObjectExprInst",y="onreadystatechange",P=window,k=document,u=navigator,U=false,V=[i],p=[],O=[],J=[],m,R,F,C,K=false,a=false,o,H,n=true,N=function(){var ab=typeof k.getElementById!=E&&typeof k.getElementsByTagName!=E&&typeof k.createElement!=E,ai=u.userAgent.toLowerCase(),Z=u.platform.toLowerCase(),af=Z?(/win/).test(Z):/win/.test(ai),ad=Z?(/mac/).test(Z):/mac/.test(ai),ag=/webkit/.test(ai)?parseFloat(ai.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,Y=!+"\v1",ah=[0,0,0],ac=null;if(typeof u.plugins!=E&&typeof u.plugins[T]==s){ac=u.plugins[T].description;if(ac&&!(typeof u.mimeTypes!=E&&u.mimeTypes[r]&&!u.mimeTypes[r].enabledPlugin)){U=true;Y=false;ac=ac.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ah[0]=parseInt(ac.replace(/^(.*)\..*$/,"$1"),10);ah[1]=parseInt(ac.replace(/^.*\.(.*)\s.*$/,"$1"),10);ah[2]=/[a-zA-Z]/.test(ac)?parseInt(ac.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof P.ActiveXObject!=E){try{var ae=new ActiveXObject(X);if(ae){ac=ae.GetVariable("$version");if(ac){Y=true;ac=ac.split(" ")[1].split(",");ah=[parseInt(ac[0],10),parseInt(ac[1],10),parseInt(ac[2],10)]}}}catch(aa){}}}return{w3:ab,pv:ah,wk:ag,ie:Y,win:af,mac:ad}}(),l=function(){if(!N.w3){return}if((typeof k.readyState!=E&&k.readyState=="complete")||(typeof k.readyState==E&&(k.getElementsByTagName("body")[0]||k.body))){g()}if(!K){if(typeof k.addEventListener!=E){k.addEventListener("DOMContentLoaded",g,false)}if(N.ie&&N.win){k.attachEvent(y,function(){if(k.readyState=="complete"){k.detachEvent(y,arguments.callee);g()}});if(P==top){(function(){if(K){return}try{k.documentElement.doScroll("left")}catch(Y){setTimeout(arguments.callee,0);return}g()})()}}if(N.wk){(function(){if(K){return}if(!(/loaded|complete/).test(k.readyState)){setTimeout(arguments.callee,0);return}g()})()}t(g)}}();function g(){if(K){return}try{var aa=k.getElementsByTagName("body")[0].appendChild(D("span"));aa.parentNode.removeChild(aa)}catch(ab){return}K=true;var Y=V.length;for(var Z=0;Z<Y;Z++){V[Z]()}}function L(Y){if(K){Y()}else{V[V.length]=Y}}function t(Z){if(typeof P.addEventListener!=E){P.addEventListener("load",Z,false)}else{if(typeof k.addEventListener!=E){k.addEventListener("load",Z,false)}else{if(typeof P.attachEvent!=E){j(P,"onload",Z)}else{if(typeof P.onload=="function"){var Y=P.onload;P.onload=function(){Y();Z()}}else{P.onload=Z}}}}}function i(){if(U){W()}else{I()}}function W(){var Y=k.getElementsByTagName("body")[0];var ab=D(s);ab.setAttribute("type",r);var aa=Y.appendChild(ab);if(aa){var Z=0;(function(){if(typeof aa.GetVariable!=E){var ac=aa.GetVariable("$version");if(ac){ac=ac.split(" ")[1].split(",");N.pv=[parseInt(ac[0],10),parseInt(ac[1],10),parseInt(ac[2],10)]}}else{if(Z<10){Z++;setTimeout(arguments.callee,10);return}}Y.removeChild(ab);aa=null;I()})()}else{I()}}function I(){var ah=p.length;if(ah>0){for(var ag=0;ag<ah;ag++){var Z=p[ag].id;var ac=p[ag].callbackFn;var ab={success:false,id:Z};if(N.pv[0]>0){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<ad;ae++){if(Y[ae].getAttribute("name").toLowerCase()!="movie"){ai[Y[ae].getAttribute("name")]=Y[ae].getAttribute("value")}}Q(aj,ai,Z,ac)}else{q(af);if(ac){ac(ab)}}}}}else{x(Z,true);if(ac){var aa=A(Z);if(aa&&typeof aa.SetVariable!=E){ab.success=true;ab.ref=aa}ac(ab)}}}}}function A(ab){var Y=null;var Z=c(ab);if(Z&&Z.nodeName=="OBJECT"){if(typeof Z.SetVariable!=E){Y=Z}else{var aa=Z.getElementsByTagName(s)[0];if(aa){Y=aa}}}return Y}function B(){return !a&&G("6.0.65")&&(N.win||N.mac)&&!(N.wk&&N.wk<312)}function Q(ab,ac,Y,aa){a=true;F=aa||null;C={success:false,id:Y};var af=c(Y);if(af){if(af.nodeName=="OBJECT"){m=h(af);R=null}else{m=af;R=Y}ab.id=S;if(typeof ab.width==E||(!(/%$/).test(ab.width)&&parseInt(ab.width,10)<310)){ab.width="310"}if(typeof ab.height==E||(!(/%$/).test(ab.height)&&parseInt(ab.height,10)<137)){ab.height="137"}k.title=k.title.slice(0,47)+" - Flash Player Installation";var ae=N.ie&&N.win?"ActiveX":"PlugIn",ad="MMredirectURL="+P.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ae+"&MMdoctitle="+k.title;if(typeof ac.flashvars!=E){ac.flashvars+="&"+ad}else{ac.flashvars=ad}if(N.ie&&N.win&&af.readyState!=4){var Z=D("div");Y+="SWFObjectNew";Z.setAttribute("id",Y);af.parentNode.insertBefore(Z,af);af.style.display="none";(function(){if(af.readyState==4){af.parentNode.removeChild(af)}else{setTimeout(arguments.callee,10)}})()}v(ab,ac,Y)}}function q(Z){if(N.ie&&N.win&&Z.readyState!=4){var Y=D("div");Z.parentNode.insertBefore(Y,Z);Y.parentNode.replaceChild(h(Z),Y);Z.style.display="none";(function(){if(Z.readyState==4){Z.parentNode.removeChild(Z)}else{setTimeout(arguments.callee,10)}})()}else{Z.parentNode.replaceChild(h(Z),Z)}}function h(ad){var ab=D("div");if(N.win&&N.ie){ab.innerHTML=ad.innerHTML}else{var Z=ad.getElementsByTagName(s)[0];if(Z){var ae=Z.childNodes;if(ae){var Y=ae.length;for(var aa=0;aa<Y;aa++){if(!(ae[aa].nodeType==1&&ae[aa].nodeName=="PARAM")&&!(ae[aa].nodeType==8)){ab.appendChild(ae[aa].cloneNode(true))}}}}}return ab}function v(aj,ah,Z){var Y,ab=c(Z);if(N.wk&&N.wk<312){return Y}if(ab){if(typeof aj.id==E){aj.id=Z}if(N.ie&&N.win){var ai="";for(var af in aj){if(aj[af]!=Object.prototype[af]){if(af.toLowerCase()=="data"){ah.movie=aj[af]}else{if(af.toLowerCase()=="styleclass"){ai+=' class="'+aj[af]+'"'}else{if(af.toLowerCase()!="classid"){ai+=" "+af+'="'+aj[af]+'"'}}}}}var ag="";for(var ae in ah){if(ah[ae]!=Object.prototype[ae]){ag+='<param name="'+ae+'" value="'+ah[ae]+'" />'}}ab.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ai+">"+ag+"</object>";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;ac<ad;ac++){J[ac][0].detachEvent(J[ac][1],J[ac][2])}var aa=O.length;for(var ab=0;ab<aa;ab++){z(O[ab])}for(var Z in N){N[Z]=null}N=null;for(var Y in swfobject){swfobject[Y]=null}swfobject=null;window.detachEvent("onunload",arguments.callee)})}}();return{registerObject:function(ac,Y,ab,aa){if(N.w3&&ac&&Y){var Z={};Z.id=ac;Z.swfVersion=Y;Z.expressInstall=ab;Z.callbackFn=aa;p[p.length]=Z;x(ac,false)}else{if(aa){aa({success:false,id:ac})}}},getObjectById:function(Y){if(N.w3){return A(Y)}},embedSWF:function(ac,ai,af,ah,Z,ab,aa,ae,ag,ad){var Y={success:false,id:ai};if(N.w3&&!(N.wk&&N.wk<312)&&ac&&ai&&af&&ah&&Z){x(ai,false);L(function(){af+="";ah+="";var ak={};if(ag&&typeof ag===s){for(var am in ag){ak[am]=ag[am]}}ak.data=ac;ak.width=af;ak.height=ah;var an={};if(ae&&typeof ae===s){for(var al in ae){an[al]=ae[al]}}if(aa&&typeof aa===s){for(var aj in aa){if(typeof an.flashvars!=E){an.flashvars+="&"+aj+"="+aa[aj]}else{an.flashvars=aj+"="+aa[aj]}}}if(G(Z)){var ao=v(ak,an,ai);if(ak.id==ai){x(ai,true)}Y.success=true;Y.ref=ao}else{if(ab&&B()){ak.data=ab;Q(ak,an,ai,ad);return}else{x(ai,true)}}if(ad){ad(Y)}})}else{if(ad){ad(Y)}}},switchOffAutoHideShow:function(){n=false},ua:N,getFlashPlayerVersion:function(){return{major:N.pv[0],minor:N.pv[1],release:N.pv[2]}},hasFlashPlayerVersion:G,createSWF:function(aa,Z,Y){if(N.w3){return v(aa,Z,Y)}else{return undefined}},showExpressInstall:function(aa,ab,Y,Z){if(N.w3&&B()){Q(aa,ab,Y,Z)}},removeSWF:function(Y){if(N.w3){z(Y)}},createCSS:function(ab,aa,Z,Y){if(N.w3){w(ab,aa,Z,Y)}},addDomLoadEvent:L,addLoadEvent:t,getQueryParamValue:function(ab){var aa=k.location.search||k.location.hash;if(aa){if(/\?/.test(aa)){aa=aa.split("?")[1]}if(ab==null){return M(aa)}var Z=aa.split("&");for(var Y=0;Y<Z.length;Y++){if(Z[Y].substring(0,Z[Y].indexOf("="))==ab){return M(Z[Y].substring((Z[Y].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var Y=c(S);if(Y&&m){Y.parentNode.replaceChild(m,Y);if(R){x(R,true);if(N.ie&&N.win){m.style.display="block"}}if(F){F(C)}}a=false}}}}();Ext.FlashComponent=Ext.extend(Ext.BoxComponent,{flashVersion:"9.0.115",backgroundColor:"#ffffff",wmode:"opaque",flashVars:undefined,flashParams:undefined,url:undefined,swfId:undefined,swfWidth:"100%",swfHeight:"100%",expressInstall:false,initComponent:function(){Ext.FlashComponent.superclass.initComponent.call(this);this.addEvents("initialize")},onRender:function(){Ext.FlashComponent.superclass.onRender.apply(this,arguments);var b=Ext.apply({allowScriptAccess:"always",bgcolor:this.backgroundColor,wmode:this.wmode},this.flashParams),a=Ext.apply({allowedDomain:document.location.hostname,YUISwfId:this.getId(),YUIBridgeCallback:"Ext.FlashEventProxy.onEvent"},this.flashVars);new swfobject.embedSWF(this.url,this.id,this.swfWidth,this.swfHeight,this.flashVersion,this.expressInstall?Ext.FlashComponent.EXPRESS_INSTALL_URL:undefined,a,b);this.swf=Ext.getDom(this.id);this.el=Ext.get(this.swf)},getSwfId:function(){return this.swfId||(this.swfId="extswf"+(++Ext.Component.AUTO_ID))},getId:function(){return this.id||(this.id="extflashcmp"+(++Ext.Component.AUTO_ID))},onFlashEvent:function(a){switch(a.type){case"swfReady":this.initSwf();return;case"log":return}a.component=this;this.fireEvent(a.type.toLowerCase().replace(/event$/,""),a)},initSwf:function(){this.onSwfReady(!!this.isInitialized);this.isInitialized=true;this.fireEvent("initialize",this)},beforeDestroy:function(){if(this.rendered){swfobject.removeSWF(this.swf.id)}Ext.FlashComponent.superclass.beforeDestroy.call(this)},onSwfReady:Ext.emptyFn});Ext.FlashComponent.EXPRESS_INSTALL_URL="http://swfobject.googlecode.com/svn/trunk/swfobject/expressInstall.swf";Ext.reg("flash",Ext.FlashComponent);Ext.FlashEventProxy={onEvent:function(c,b){var a=Ext.getCmp(c);if(a){a.onFlashEvent(b)}else{arguments.callee.defer(10,this,[c,b])}}};Ext.chart.Chart=Ext.extend(Ext.FlashComponent,{refreshBuffer:100,chartStyle:{padding:10,animationEnabled:true,font:{name:"Tahoma",color:4473924,size:11},dataTip:{padding:5,border:{color:10075112,size:1},background:{color:14346230,alpha:0.9},font:{name:"Tahoma",color:1393291,size:10,bold:true}}},extraStyle:null,seriesStyles:null,disableCaching:Ext.isIE||Ext.isOpera,disableCacheParam:"_dc",initComponent:function(){Ext.chart.Chart.superclass.initComponent.call(this);if(!this.url){this.url=Ext.chart.Chart.CHART_URL}if(this.disableCaching){this.url=Ext.urlAppend(this.url,String.format("{0}={1}",this.disableCacheParam,new Date().getTime()))}this.addEvents("itemmouseover","itemmouseout","itemclick","itemdoubleclick","itemdragstart","itemdrag","itemdragend","beforerefresh","refresh");this.store=Ext.StoreMgr.lookup(this.store)},setStyle:function(a,b){this.swf.setStyle(a,Ext.encode(b))},setStyles:function(a){this.swf.setStyles(Ext.encode(a))},setSeriesStyles:function(b){this.seriesStyles=b;var a=[];Ext.each(b,function(c){a.push(Ext.encode(c))});this.swf.setSeriesStyles(a)},setCategoryNames:function(a){this.swf.setCategoryNames(a)},setLegendRenderer:function(c,b){var a=this;b=b||a;a.removeFnProxy(a.legendFnName);a.legendFnName=a.createFnProxy(function(d){return c.call(b,d)});a.swf.setLegendLabelFunction(a.legendFnName)},setTipRenderer:function(c,b){var a=this;b=b||a;a.removeFnProxy(a.tipFnName);a.tipFnName=a.createFnProxy(function(h,e,g){var d=a.store.getAt(e);return c.call(b,a,d,e,g)});a.swf.setDataTipFunction(a.tipFnName)},setSeries:function(a){this.series=a;this.refresh()},bindStore:function(a,b){if(!b&&this.store){if(a!==this.store&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("datachanged",this.refresh,this);this.store.un("add",this.delayRefresh,this);this.store.un("remove",this.delayRefresh,this);this.store.un("update",this.delayRefresh,this);this.store.un("clear",this.refresh,this)}}if(a){a=Ext.StoreMgr.lookup(a);a.on({scope:this,datachanged:this.refresh,add:this.delayRefresh,remove:this.delayRefresh,update:this.delayRefresh,clear:this.refresh})}this.store=a;if(a&&!b){this.refresh()}},onSwfReady:function(b){Ext.chart.Chart.superclass.onSwfReady.call(this,b);var a;this.swf.setType(this.type);if(this.chartStyle){this.setStyles(Ext.apply({},this.extraStyle,this.chartStyle))}if(this.categoryNames){this.setCategoryNames(this.categoryNames)}if(this.tipRenderer){a=this.getFunctionRef(this.tipRenderer);this.setTipRenderer(a.fn,a.scope)}if(this.legendRenderer){a=this.getFunctionRef(this.legendRenderer);this.setLegendRenderer(a.fn,a.scope)}if(!b){this.bindStore(this.store,true)}this.refresh.defer(10,this)},delayRefresh:function(){if(!this.refreshTask){this.refreshTask=new Ext.util.DelayedTask(this.refresh,this)}this.refreshTask.delay(this.refreshBuffer)},refresh:function(){if(this.fireEvent("beforerefresh",this)!==false){var m=false;var k=[],c=this.store.data.items;for(var g=0,l=c.length;g<l;g++){k[g]=c[g].data}var e=[];var d=0;var n=null;var h=0;if(this.series){d=this.series.length;for(h=0;h<d;h++){n=this.series[h];var b={};for(var a in n){if(a=="style"&&n.style!==null){b.style=Ext.encode(n.style);m=true}else{b[a]=n[a]}}e.push(b)}}if(d>0){for(h=0;h<d;h++){n=e[h];if(!n.type){n.type=this.type}n.dataProvider=k}}else{e.push({type:this.type,dataProvider:k})}this.swf.setDataProvider(e);if(this.seriesStyles){this.setSeriesStyles(this.seriesStyles)}this.fireEvent("refresh",this)}},createFnProxy:function(a){var b="extFnProxy"+(++Ext.chart.Chart.PROXY_FN_ID);Ext.chart.Chart.proxyFunction[b]=a;return"Ext.chart.Chart.proxyFunction."+b},removeFnProxy:function(a){if(!Ext.isEmpty(a)){a=a.replace("Ext.chart.Chart.proxyFunction.","");delete Ext.chart.Chart.proxyFunction[a]}},getFunctionRef:function(a){if(Ext.isFunction(a)){return{fn:a,scope:this}}else{return{fn:a.fn,scope:a.scope||this}}},onDestroy:function(){if(this.refreshTask&&this.refreshTask.cancel){this.refreshTask.cancel()}Ext.chart.Chart.superclass.onDestroy.call(this);this.bindStore(null);this.removeFnProxy(this.tipFnName);this.removeFnProxy(this.legendFnName)}});Ext.reg("chart",Ext.chart.Chart);Ext.chart.Chart.PROXY_FN_ID=0;Ext.chart.Chart.proxyFunction={};Ext.chart.Chart.CHART_URL="http://yui.yahooapis.com/2.8.2/build/charts/assets/charts.swf";Ext.chart.PieChart=Ext.extend(Ext.chart.Chart,{type:"pie",onSwfReady:function(a){Ext.chart.PieChart.superclass.onSwfReady.call(this,a);this.setDataField(this.dataField);this.setCategoryField(this.categoryField)},setDataField:function(a){this.dataField=a;this.swf.setDataField(a)},setCategoryField:function(a){this.categoryField=a;this.swf.setCategoryField(a)}});Ext.reg("piechart",Ext.chart.PieChart);Ext.chart.CartesianChart=Ext.extend(Ext.chart.Chart,{onSwfReady:function(a){Ext.chart.CartesianChart.superclass.onSwfReady.call(this,a);this.labelFn=[];if(this.xField){this.setXField(this.xField)}if(this.yField){this.setYField(this.yField)}if(this.xAxis){this.setXAxis(this.xAxis)}if(this.xAxes){this.setXAxes(this.xAxes)}if(this.yAxis){this.setYAxis(this.yAxis)}if(this.yAxes){this.setYAxes(this.yAxes)}if(Ext.isDefined(this.constrainViewport)){this.swf.setConstrainViewport(this.constrainViewport)}},setXField:function(a){this.xField=a;this.swf.setHorizontalField(a)},setYField:function(a){this.yField=a;this.swf.setVerticalField(a)},setXAxis:function(a){this.xAxis=this.createAxis("xAxis",a);this.swf.setHorizontalAxis(this.xAxis)},setXAxes:function(c){var b;for(var a=0;a<c.length;a++){b=this.createAxis("xAxis"+a,c[a]);this.swf.setHorizontalAxis(b)}},setYAxis:function(a){this.yAxis=this.createAxis("yAxis",a);this.swf.setVerticalAxis(this.yAxis)},setYAxes:function(c){var b;for(var a=0;a<c.length;a++){b=this.createAxis("yAxis"+a,c[a]);this.swf.setVerticalAxis(b)}},createAxis:function(b,d){var e=Ext.apply({},d),c,a;if(this[b]){a=this[b].labelFunction;this.removeFnProxy(a);this.labelFn.remove(a)}if(e.labelRenderer){c=this.getFunctionRef(e.labelRenderer);e.labelFunction=this.createFnProxy(function(g){return c.fn.call(c.scope,g)});delete e.labelRenderer;this.labelFn.push(e.labelFunction)}if(b.indexOf("xAxis")>-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;c+=e){var d=b.get(c);if(d.isVisible()&&!d.disabled&&(d.canActivate||d.isFormField)){this.setActiveItem(d,false);return d}}return false},onMouseOver:function(b){var a=this.findTargetItem(b);if(a){if(a.canActivate&&!a.disabled){this.setActiveItem(a,true)}}this.over=true;this.fireEvent("mouseover",this,b,a)},onMouseOut:function(b){var a=this.findTargetItem(b);if(a){if(a==this.activeItem&&a.shouldDeactivate&&a.shouldDeactivate(b)){this.activeItem.deactivate();delete this.activeItem}}this.over=false;this.fireEvent("mouseout",this,b,a)},onScroll:function(d,b){if(d){d.stopEvent()}var a=this.ul.dom,c=Ext.fly(b).is(".x-menu-scroller-top");a.scrollTop+=this.scrollIncrement*(c?-1:1);if(c?a.scrollTop<=0:a.scrollTop+this.activeMax>=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.activeMax<a.scrollHeight){Ext.fly(b).addClass(["x-menu-item-active","x-menu-scroller-active"])}},onScrollerOut:function(b,a){Ext.fly(a).removeClass(["x-menu-item-active","x-menu-scroller-active"])},show:function(b,c,a){if(this.floating){this.parentMenu=a;if(!this.el){this.render();this.doLayout(false,true)}this.showAt(this.el.getAlignToXY(b,c||this.defaultAlign,this.defaultOffsets),a)}else{Ext.menu.Menu.superclass.show.call(this)}},showAt:function(b,a){if(this.fireEvent("beforeshow",this)!==false){this.parentMenu=a;if(!this.el){this.render()}if(this.enableScrolling){this.el.setXY(b);b[1]=this.constrainScroll(b[1]);b=[this.el.adjustForConstraints(b)[0],b[1]]}else{b=this.el.adjustForConstraints(b)}this.el.setXY(b);this.el.show();Ext.menu.Menu.superclass.onShow.call(this);if(Ext.isIE){this.fireEvent("autosize",this);if(!Ext.isIE8){this.el.repaint()}}this.hidden=false;this.focus();this.fireEvent("show",this)}},constrainScroll:function(i){var b,d=this.ul.setHeight("auto").getHeight(),a=i,h,e,g,c;if(this.floating){e=Ext.fly(this.el.dom.parentNode);g=e.getScroll().top;c=e.getViewSize().height;h=i-g;b=this.maxHeight?this.maxHeight:c-h;if(d>c){b=c;a=i-h}else{if(b<d){a=i-(d-b);b=d}}}else{b=this.getHeight()}if(this.maxHeight){b=Math.min(this.maxHeight,b)}if(d>b&&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:"&#160;"}),bottom:this.el.createChild({tag:"div",cls:"x-menu-scroller x-menu-scroller-bottom",html:"&#160;"})};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){a.ownerCt=this;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 h,e,b,d={},a=false,l=new Date();function n(){h={};e=new Ext.util.MixedCollection();b=Ext.getDoc().addKeyListener(27,j);b.disable()}function j(){if(e&&e.length>0){var o=e.clone();o.each(function(p){p.hide()});return true}return false}function g(o){e.remove(o);if(e.length<1){b.disable();Ext.getDoc().un("mousedown",m);a=false}}function k(o){var p=e.last();l=new Date();e.add(o);if(!a){b.enable();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 c(o){if(o.activeChild){o.activeChild.hide()}if(o.autoHideTimer){clearTimeout(o.autoHideTimer);delete o.autoHideTimer}}function i(o){var p=o.parentMenu;if(!p&&!o.allowOtherMenus){j()}else{if(p&&p.activeChild){p.activeChild.hide()}}}function m(o){if(l.getElapsed()>50&&e.length>0&&!o.getTarget(".x-menu")){j()}}return{hideAll:function(){return j()},register:function(o){if(!h){n()}h[o.id]=o;o.on({beforehide:c,hide:g,beforeshow:i,show:k})},get:function(o){if(typeof o=="string"){if(!h){return null}return h[o]}else{if(o.events){return o}else{if(typeof o.length=="number"){return new Ext.menu.Menu({items:o})}else{return Ext.create(o,"menu")}}}},unregister:function(o){delete h[o.id];o.un("beforehide",c);o.un("hide",g);o.un("beforeshow",i);o.un("show",k)},registerCheckable:function(o){var p=o.group;if(p){if(!d[p]){d[p]=[]}d[p].push(o)}},unregisterCheckable:function(o){var p=o.group;if(p){d[p].remove(o)}},onCheckChange:function(q,r){if(q.group&&r){var t=d[q.group],p=0,o=t.length,s;for(;p<o;p++){s=t[p];if(s!=q){s.setChecked(false)}}}},getCheckedItem:function(q){var r=d[q];if(r){for(var p=0,o=r.length;p<o;p++){if(r[p].checked){return r[p]}}}return null},setCheckedItem:function(q,s){var r=d[q];if(r){for(var p=0,o=r.length;p<o;p++){if(r[p].id==s){r[p].setChecked(true)}}}return null}}}();Ext.menu.BaseItem=Ext.extend(Ext.Component,{canActivate:false,activeClass:"x-menu-item-active",hideOnClick:true,clickHideDelay:1,ctype:"Ext.menu.BaseItem",actionMode:"container",initComponent:function(){Ext.menu.BaseItem.superclass.initComponent.call(this);this.addEvents("click","activate","deactivate");if(this.handler){this.on("click",this.handler,this.scope)}},onRender:function(b,a){Ext.menu.BaseItem.superclass.onRender.apply(this,arguments);if(this.ownerCt&&this.ownerCt instanceof Ext.menu.Menu){this.parentMenu=this.ownerCt}else{this.container.addClass("x-menu-list-item");this.mon(this.el,{scope:this,click:this.onClick,mouseenter:this.activate,mouseleave:this.deactivate})}},setHandler:function(b,a){if(this.handler){this.un("click",this.handler,this.scope)}this.on("click",this.handler=b,this.scope=a)},onClick:function(a){if(!this.disabled&&this.fireEvent("click",this,a)!==false&&(this.parentMenu&&this.parentMenu.fireEvent("itemclick",this,a)!==false)){this.handleClick(a)}else{a.stopEvent()}},activate:function(){if(this.disabled){return false}var a=this.container;a.addClass(this.activeClass);this.region=a.getRegion().adjust(2,2,-2,-2);this.fireEvent("activate",this);return true},deactivate:function(){this.container.removeClass(this.activeClass);this.fireEvent("deactivate",this)},shouldDeactivate:function(a){return !this.region||!this.region.contains(a.getPoint())},handleClick:function(b){var a=this.parentMenu;if(this.hideOnClick){if(a.floating){this.clickHideDelayTimer=a.hide.defer(this.clickHideDelay,a,[true])}else{a.deactivateActive()}}},beforeDestroy:function(){clearTimeout(this.clickHideDelayTimer);Ext.menu.BaseItem.superclass.beforeDestroy.call(this)},expandMenu:Ext.emptyFn,hideMenu:Ext.emptyFn});Ext.reg("menubaseitem",Ext.menu.BaseItem);Ext.menu.TextItem=Ext.extend(Ext.menu.BaseItem,{hideOnClick:false,itemCls:"x-menu-text",constructor:function(a){if(typeof a=="string"){a={text:a}}Ext.menu.TextItem.superclass.constructor.call(this,a)},onRender:function(){var a=document.createElement("span");a.className=this.itemCls;a.innerHTML=this.text;this.el=a;Ext.menu.TextItem.superclass.onRender.apply(this,arguments)}});Ext.reg("menutextitem",Ext.menu.TextItem);Ext.menu.Separator=Ext.extend(Ext.menu.BaseItem,{itemCls:"x-menu-sep",hideOnClick:false,activeClass:"",onRender:function(a){var b=document.createElement("span");b.className=this.itemCls;b.innerHTML="&#160;";this.el=b;a.addClass("x-menu-sep-li");Ext.menu.Separator.superclass.onRender.apply(this,arguments)}});Ext.reg("menuseparator",Ext.menu.Separator);Ext.menu.Item=Ext.extend(Ext.menu.BaseItem,{itemCls:"x-menu-item",canActivate:true,showDelay:200,altText:"",hideDelay:200,ctype:"Ext.menu.Item",initComponent:function(){Ext.menu.Item.superclass.initComponent.call(this);if(this.menu){if(Ext.isArray(this.menu)){this.menu={items:this.menu}}if(Ext.isObject(this.menu)){this.menu.ownerCt=this}this.menu=Ext.menu.MenuMgr.get(this.menu);this.menu.ownerCt=undefined}},onRender:function(d,b){if(!this.itemTpl){this.itemTpl=Ext.menu.Item.prototype.itemTpl=new Ext.XTemplate('<a id="{id}" class="{cls}" hidefocus="true" unselectable="on" href="{href}"','<tpl if="hrefTarget">',' target="{hrefTarget}"',"</tpl>",">",'<img alt="{altText}" src="{icon}" class="x-menu-item-icon {iconCls}"/>','<span class="x-menu-item-text">{text}</span>',"</a>")}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||"&#160;",altText:this.altText||""}},setText:function(a){this.text=a||"&#160;";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(){clearTimeout(this.showTimer);clearTimeout(this.hideTimer);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)){Ext.menu.MenuMgr.onCheckChange(this,b);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.getKeyEvent(),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()),a);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,b;if(this.emptyText){if(a.dom.value==this.emptyText){this.setRawValue("");b=true}a.removeClass(this.emptyClass)}if(this.selectOnFocus||b){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=Ext.isDefined(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.length<this.minLength){d.push(String.format(this.minLengthText,this.minLength))}if(a.length>this.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+="&#160;";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,alt:"",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,alt:"",cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Ext.BLANK_IMAGE_URL,alt:"",cls:"x-form-trigger "+this.trigger2Class}]}},getTrigger:function(a){return this.triggers[a]},afterRender:function(){Ext.form.TwinTriggerField.superclass.afterRender.call(this);var c=this.triggers,b=0,a=c.length;for(;b<a;++b){if(this["hideTrigger"+(b+1)]){c[b].hide()}}},initTrigger:function(){var a=this.trigger.select(".x-form-trigger",true),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());b["hidden"+e]=true};d.show=function(){var h=b.wrap.getWidth();this.dom.style.display="";b.el.setWidth(h-b.trigger.getWidth());b["hidden"+e]=false};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:"&#160;\n&#160;",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},filterValidation:function(a){if(!a.isNavKeyPress()||(!this.enterIsSpecial&&a.keyCode==a.ENTER)){this.validationTask.delay(this.validationDelay)}},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="&#160;&#160;"}else{a+=this.growAppend;if(Ext.isIE){a=a.replace(/\n/g,"&#160;<br />")}}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",autoStripChars:false,initEvents:function(){var a=this.baseChars+"";if(this.allowDecimals){a+=this.decimalSeparator}if(this.allowNegative){a+="-"}a=Ext.escapeRe(a);this.maskRe=new RegExp("["+a+"]");if(this.autoStripChars){this.stripCharsRe=new RegExp("[^"+a+"]","gi")}Ext.form.NumberField.superclass.initEvents.call(this)},getErrors:function(b){var c=Ext.form.NumberField.superclass.getErrors.apply(this,arguments);b=Ext.isDefined(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(a<this.minValue){c.push(String.format(this.minText,this.minValue))}if(a>this.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=this.fixPrecision(a);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(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|n-j|n/j",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,startDay:0,defaultAutoCreate:{tag:"input",type:"text",size:"10",autocomplete:"off"},initTime:"12",initTimeFormat:"H",safeParse:function(b,c){if(Date.formatContainsHourInfo(c)){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&&g<this.minValue.clearTime().getTime()){h.push(String.format(this.minText,this.formatDate(this.minValue)))}if(this.maxValue&&g>this.maxValue.clearTime().getTime()){h.push(String.format(this.maxText,this.formatDate(this.maxValue)))}if(this.disabledDays){var a=e.getDay();for(var b=0;b<this.disabledDays.length;b++){if(a===this.disabledDays[b]){h.push(this.disabledDaysText);break}}}var d=this.formatDate(e);if(this.disabledDatesRE&&this.disabledDatesRE.test(d)){h.push(String.format(this.disabledDatesText,d))}return h},validateBlur:function(){return !this.menu||!this.menu.isVisible()},getValue:function(){return this.parseDate(Ext.form.DateField.superclass.getValue.call(this))||""},setValue:function(a){return Ext.form.DateField.superclass.setValue.call(this,this.formatDate(this.parseDate(a)))},parseDate:function(g){if(!g||Ext.isDate(g)){return g}var b=this.safeParse(g,this.format),c=this.altFormats,e=this.altFormatsArray;if(!b&&c){e=e||c.split("|");for(var d=0,a=e.length;d<a&&!b;d++){b=this.safeParse(g,e[d])}}return b},onDestroy:function(){Ext.destroy(this.menu,this.keyNav);Ext.form.DateField.superclass.onDestroy.call(this)},formatDate:function(a){return Ext.isDate(a)?a.dateFormat(this.format):a},onTriggerClick:function(){if(this.disabled){return}if(this.menu==null){this.menu=new Ext.menu.DateMenu({hideOnClick:false,focusOnSelect:false})}this.onFocus();Ext.apply(this.menu.picker,{minDate:this.minValue,maxDate:this.maxValue,disabledDatesRE:this.disabledDatesRE,disabledDatesText:this.disabledDatesText,disabledDays:this.disabledDays,disabledDaysText:this.disabledDaysText,format:this.format,showToday:this.showToday,startDay:this.startDay,minText:String.format(this.minText,this.formatDate(this.minValue)),maxText:String.format(this.maxText,this.formatDate(this.maxValue))});this.menu.picker.setValue(this.getValue()||new Date());this.menu.show(this.el,"tl-bl?");this.menuEvents("on")},menuEvents:function(a){this.menu[a]("select",this.onSelect,this);this.menu[a]("hide",this.onMenuHide,this);this.menu[a]("show",this.onFocus,this)},onSelect:function(a,b){this.setValue(b);this.fireEvent("select",this,b);this.menu.hide()},onMenuHide:function(){this.focus(false,60);this.menuEvents("un")},beforeBlur:function(){var a=this.parseDate(this.getRawValue());if(a){this.setValue(a)}}});Ext.reg("datefield",Ext.form.DateField);Ext.form.DisplayField=Ext.extend(Ext.form.Field,{validationEvent:false,validateOnBlur:false,defaultAutoCreate:{tag:"div"},fieldClass:"x-form-display-field",htmlEncode:false,initEvents:Ext.emptyFn,isValid:function(){return true},validate:function(){return true},getRawValue:function(){var a=this.rendered?this.el.dom.innerHTML:Ext.value(this.value,"");if(a===this.emptyText){a=""}if(this.htmlEncode){a=Ext.util.Format.htmlDecode(a)}return a},getValue:function(){return this.getRawValue()},getName:function(){return this.name},setRawValue:function(a){if(this.htmlEncode){a=Ext.util.Format.htmlEncode(a)}return this.rendered?(this.el.dom.innerHTML=(Ext.isEmpty(a)?"":a)):(this.value=a)},setValue:function(a){this.setRawValue(a);return this}});Ext.reg("displayfield",Ext.form.DisplayField);Ext.form.ComboBox=Ext.extend(Ext.form.TriggerField,{defaultAutoCreate:{tag:"input",type:"text",size:"24",autocomplete:"off"},listClass:"",selectedClass:"x-combo-selected",listEmptyText:"",triggerClass:"x-form-arrow-trigger",shadow:"sides",listAlign:"tl-bl?",maxHeight:300,minHeight:90,triggerAction:"query",minChars:4,autoSelect:true,typeAhead:false,queryDelay:500,pageSize:0,selectOnFocus:false,queryParam:"query",loadingText:"Loading...",resizable:false,handleHeight:8,allQuery:"",mode:"remote",minListWidth:70,forceSelection:false,typeAheadDelay:250,lazyInit:true,clearFilterOnReset:true,submitValue:undefined,initComponent:function(){Ext.form.ComboBox.superclass.initComponent.call(this);this.addEvents("expand","collapse","beforeselect","select","beforequery");if(this.transform){var c=Ext.getDom(this.transform);if(!this.hiddenName){this.hiddenName=c.name}if(!this.store){this.mode="local";var j=[],e=c.options;for(var b=0,a=e.length;b<a;b++){var h=e[b],g=(h.hasAttribute?h.hasAttribute("value"):h.getAttributeNode("value").specified)?h.value:h.text;if(h.selected&&Ext.isEmpty(this.value,true)){this.value=g}j.push([g,h.text])}this.store=new Ext.data.ArrayStore({idIndex:0,fields:["value","text"],data:j,autoDestroy:true});this.valueField="value";this.displayField="text"}c.name=Ext.id();if(!this.lazyRender){this.target=true;this.el=Ext.DomHelper.insertBefore(c,this.autoCreate||this.defaultAutoCreate);this.render(this.el.parentNode,c)}Ext.removeNode(c)}else{if(this.store){this.store=Ext.StoreMgr.lookup(this.store);if(this.store.autoCreated){this.displayField=this.valueField="field1";if(!this.store.expandData){this.displayField="field2"}this.mode="local"}}}this.selectedIndex=-1;if(this.mode=="local"){if(!Ext.isDefined(this.initialConfig.queryDelay)){this.queryDelay=10}if(!Ext.isDefined(this.initialConfig.minChars)){this.minChars=0}}},onRender:function(b,a){if(this.hiddenName&&!Ext.isDefined(this.submitValue)){this.submitValue=false}Ext.form.ComboBox.superclass.onRender.call(this,b,a);if(this.hiddenName){this.hiddenField=this.el.insertSibling({tag:"input",type:"hidden",name:this.hiddenName,id:(this.hiddenId||Ext.id())},"before",true)}if(Ext.isGecko){this.el.dom.setAttribute("autocomplete","off")}if(!this.lazyInit){this.initList()}else{this.on("focus",this.initList,this,{single:true})}},initValue:function(){Ext.form.ComboBox.superclass.initValue.call(this);if(this.hiddenField){this.hiddenField.value=Ext.value(Ext.isDefined(this.hiddenValue)?this.hiddenValue:this.value,"")}},getParentZIndex:function(){var a;if(this.ownerCt){this.findParentBy(function(b){a=parseInt(b.getPositionEl().getStyle("z-index"),10);return !!a})}return a},getZIndex:function(b){b=b||Ext.getDom(this.getListParent()||Ext.getBody());var a=parseInt(Ext.fly(b).getStyle("z-index"),10);if(!a){a=this.getParentZIndex()}return(a||12000)+5},initList:function(){if(!this.list){var a="x-combo-list",c=Ext.getDom(this.getListParent()||Ext.getBody());this.list=new Ext.Layer({parentEl:c,shadow:this.shadow,cls:[a,this.listClass].join(" "),constrain:false,zindex:this.getZIndex(c)});var b=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setSize(b,0);this.list.swallowEvent("mousewheel");this.assetHeight=0;if(this.syncFont!==false){this.list.setStyle("font-size",this.el.getStyle("font-size"))}if(this.title){this.header=this.list.createChild({cls:a+"-hd",html:this.title});this.assetHeight+=this.header.getHeight()}this.innerList=this.list.createChild({cls:a+"-inner"});this.mon(this.innerList,"mouseover",this.onViewOver,this);this.mon(this.innerList,"mousemove",this.onViewMove,this);this.innerList.setWidth(b-this.list.getFrameWidth("lr"));if(this.pageSize){this.footer=this.list.createChild({cls:a+"-ft"});this.pageTb=new Ext.PagingToolbar({store:this.store,pageSize:this.pageSize,renderTo:this.footer});this.assetHeight+=this.footer.getHeight()}if(!this.tpl){this.tpl='<tpl for="."><div class="'+a+'-item">{'+this.displayField+"}</div></tpl>"}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,d,e){this.maxHeight=e-this.handleHeight-this.list.getFrameWidth("tb")-this.assetHeight;this.listWidth=d;this.innerList.setWidth(d-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(){if(this.clearFilterOnReset&&this.mode=="local"){this.store.clearFilter()}Ext.form.ComboBox.superclass.reset.call(this)},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?'<div class="loading-indicator">'+this.loadingText+"</div>":"");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;if(this.valueField&&Ext.isDefined(this.value)){a=this.findRecord(this.valueField,this.value)}if(!a||a.get(this.displayField)!=b){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&&this.valueField){if(this.value==b){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.selectedIndex<a-1){this.select(this.selectedIndex+1)}}}},selectPrev:function(){var a=this.store.getCount();if(a>0){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={},c=this.store.paramNames;if(this.pageSize){b[c.start]=0;b[c.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));this.list.setZIndex(this.getZIndex());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:"&#160;",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&&!Ext.isStrict){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 c=this.checked,b=this.inputValue;if(a===false){this.checked=false}else{this.checked=(a===true||a==="true"||a=="1"||(b?a==b:String(a).toLowerCase()=="on"))}if(this.rendered){this.el.dom.checked=this.checked;this.el.dom.defaultChecked=this.checked}if(c!=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;e<m;e++){Ext.applyIf(this.items[e],a)}}else{var d,n=[];if(typeof this.columns=="string"){this.columns=this.items.length}if(!Ext.isArray(this.columns)){var k=[];for(var e=0;e<this.columns;e++){k.push((100/this.columns)*0.01)}this.columns=k}d=this.columns.length;for(var e=0;e<d;e++){var b=Ext.apply({items:[]},a);b[this.columns[e]<=1?"columnWidth":"width"]=this.columns[e];if(this.defaults){b.defaults=Ext.apply(b.defaults||{},this.defaults)}n.push(b)}if(this.vertical){var r=Math.ceil(this.items.length/d),o=0;for(var e=0,m=this.items.length;e<m;e++){if(e>0&&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<m;e++){var q=e%d;if(this.items[e].fieldLabel){this.items[e].hideLabel=false}n[q].items.push(this.items[e])}}Ext.apply(p,{layoutConfig:{columns:d},items:n})}this.panel=new Ext.Container(p);this.panel.ownerCt=this;this.el=this.panel.getEl();if(this.forId&&this.itemCls){var c=this.el.up(this.itemCls).child("label",true);if(c){c.setAttribute("htmlFor",this.forId)}}var h=this.panel.findBy(function(i){return i.isFormField},this);this.items=new Ext.util.MixedCollection();this.items.addAll(h)}Ext.form.CheckboxGroup.superclass.onRender.call(this,j,g)},initValue:function(){if(this.value){this.setValue.apply(this,this.buffered?this.value:[this.value]);delete this.buffered;delete this.value}},afterRender:function(){Ext.form.CheckboxGroup.superclass.afterRender.call(this);this.eachItem(function(a){a.on("check",this.fireChecked,this);a.inGroup=true})},doLayout:function(){if(this.rendered){this.panel.forceLayout=this.ownerCt.forceLayout;this.panel.doLayout()}},fireChecked:function(){var a=[];this.eachItem(function(b){if(b.checked){a.push(b)}});this.fireEvent("change",this,a)},getErrors:function(){var b=Ext.form.CheckboxGroup.superclass.getErrors.apply(this,arguments);if(!this.allowBlank){var a=true;this.eachItem(function(c){if(c.checked){return(a=false)}});if(a){b.push(this.blankText)}}return b},isDirty:function(){if(this.disabled||!this.rendered){return false}var a=false;this.eachItem(function(b){if(b.isDirty()){a=true;return false}});return a},setReadOnly:function(a){if(this.rendered){this.eachItem(function(b){b.setReadOnly(a)})}this.readOnly=a},onDisable:function(){this.eachItem(function(a){a.disable()})},onEnable:function(){this.eachItem(function(a){a.enable()})},onResize:function(a,b){this.panel.setSize(a,b);this.panel.doLayout()},reset:function(){if(this.originalValue){this.eachItem(function(a){if(a.setValue){a.setValue(false);a.originalValue=a.getValue()}});this.resetOriginal=true;this.setValue(this.originalValue);delete this.resetOriginal}else{this.eachItem(function(a){if(a.reset){a.reset()}})}(function(){this.clearInvalid()}).defer(50,this)},setValue:function(){if(this.rendered){this.onSetValue.apply(this,arguments)}else{this.buffered=true;this.value=arguments}return this},onSetValue:function(d,c){if(arguments.length==1){if(Ext.isArray(d)){Ext.each(d,function(h,e){if(Ext.isObject(h)&&h.setValue){h.setValue(true);if(this.resetOriginal===true){h.originalValue=h.getValue()}}else{var g=this.items.itemAt(e);if(g){g.setValue(h)}}},this)}else{if(Ext.isObject(d)){for(var a in d){var b=this.getBox(a);if(b){b.setValue(d[a])}}}else{this.setValueForItem(d)}}}else{var b=this.getBox(d);if(b){b.setValue(c)}}},beforeDestroy:function(){Ext.destroy(this.panel);if(!this.rendered){Ext.destroy(this.items)}Ext.form.CheckboxGroup.superclass.beforeDestroy.call(this)},setValueForItem:function(a){a=String(a).split(",");this.eachItem(function(b){if(a.indexOf(b.inputValue)>-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,labelConnector:", ",initComponent:function(){var g=[],b=this.items,e;for(var d=0,c=b.length;d<c;d++){e=b[d];if(!Ext.isEmpty(e.ref)){e.ref="../"+e.ref}g.push(e.fieldLabel);Ext.applyIf(e,this.defaults);if(!(d==c-1&&this.skipLastItemMargin)){Ext.applyIf(e,{margins:this.defaultMargins})}}this.fieldLabel=this.fieldLabel||this.buildLabel(g);this.fieldErrors=new Ext.util.MixedCollection(true,function(h){return h.field});this.fieldErrors.on({scope:this,add:this.updateInvalidMark,remove:this.updateInvalidMark,replace:this.updateInvalidMark});Ext.form.CompositeField.superclass.initComponent.apply(this,arguments);this.innerCt=new Ext.Container({layout:"hbox",items:this.items,cls:"x-form-composite",defaultMargins:"0 3 0 0",ownerCt:this});this.innerCt.ownerCt=undefined;var a=this.innerCt.findBy(function(h){return h.isFormField},this);this.items=new Ext.util.MixedCollection();this.items.addAll(a)},onRender:function(c,a){if(!this.el){var d=this.innerCt;d.render(c);this.el=d.getEl();if(this.combineErrors){this.eachItem(function(e){Ext.apply(e,{markInvalid:this.onFieldMarkInvalid.createDelegate(this,[e],0),clearInvalid:this.onFieldClearInvalid.createDelegate(this,[e],0)})})}var b=this.el.parent().parent().child("label",true);if(b){b.setAttribute("for",this.items.items[0].id)}}Ext.form.CompositeField.superclass.onRender.apply(this,arguments)},onFieldMarkInvalid:function(d,c){var b=d.getName(),a={field:b,errorName:d.fieldLabel||b,error:c};this.fieldErrors.replace(b,a);if(!d.preventMark){d.el.addClass(d.invalidClass)}},onFieldClearInvalid:function(a){this.fieldErrors.removeKey(a.getName());a.el.removeClass(a.invalidClass)},updateInvalidMark:function(){var a=Ext.isIE6&&Ext.isStrict;if(this.fieldErrors.length==0){this.clearInvalid();if(a){this.clearInvalid.defer(50,this)}}else{var b=this.buildCombinedErrorMessage(this.fieldErrors.items);this.sortErrors();this.markInvalid(b);if(a){this.markInvalid(b)}}},validateValue:function(c,a){var b=true;this.eachItem(function(d){if(!d.isValid(a)){b=false}});return b},buildCombinedErrorMessage:function(e){var d=[],b;for(var c=0,a=e.length;c<a;c++){b=e[c];d.push(String.format("{0}: {1}",b.errorName,b.error))}return d.join("<br />")},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 h<e?-1:1})},reset:function(){this.eachItem(function(a){a.reset()});(function(){this.clearInvalid()}).defer(50,this)},clearInvalidChildren:function(){this.eachItem(function(a){a.clearInvalid()})},buildLabel:function(a){return Ext.clean(a).join(this.labelConnector)},isDirty:function(){if(this.disabled||!this.rendered){return false}var a=false;this.eachItem(function(b){if(b.isDirty()){a=true;return false}});return a},eachItem:function(b,a){if(this.items&&this.items.each){this.items.each(b,a||this)}},onResize:function(e,c,a,d){var b=this.innerCt;if(this.rendered&&b.rendered){b.setSize(e,c)}Ext.form.CompositeField.superclass.onResize.apply(this,arguments)},doLayout:function(c,b){if(this.rendered){var a=this.innerCt;a.forceLayout=this.ownerCt.forceLayout;a.doLayout(c,b)}},beforeDestroy:function(){Ext.destroy(this.innerCt);Ext.form.CompositeField.superclass.beforeDestroy.call(this)},setReadOnly:function(a){if(a==undefined){a=true}a=!!a;if(this.rendered){this.eachItem(function(b){b.setReadOnly(a)})}this.readOnly=a},onShow:function(){Ext.form.CompositeField.superclass.onShow.call(this);this.doLayout()},onDisable:function(){this.eachItem(function(a){a.disable()})},onEnable:function(){this.eachItem(function(a){a.enable()})}});Ext.reg("compositefield",Ext.form.CompositeField);Ext.form.Radio=Ext.extend(Ext.form.Checkbox,{inputType:"radio",markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,getGroupValue:function(){var a=this.el.up("form")||Ext.getBody();var b=a.child('input[name="'+this.el.dom.name+'"]:checked',true);return b?b.value:null},setValue:function(b){var a,d,c;if(typeof b=="boolean"){Ext.form.Radio.superclass.setValue.call(this,b)}else{if(this.rendered){a=this.getCheckEl();c=a.child('input[name="'+this.el.dom.name+'"][value="'+b+'"]',true);if(c){Ext.getCmp(c.id).setValue(true)}}}if(this.rendered&&this.checked){a=a||this.getCheckEl();d=this.getCheckEl().select('input[name="'+this.el.dom.name+'"]');d.each(function(e){if(e.dom.id!=this.id){Ext.getCmp(e.dom.id).setValue(false)}},this)}return this},getCheckEl:function(){if(this.inGroup){return this.el.up(".x-form-radio-group")}return this.el.up("form")||Ext.getBody()}});Ext.reg("radio",Ext.form.Radio);Ext.form.RadioGroup=Ext.extend(Ext.form.CheckboxGroup,{allowBlank:true,blankText:"You must select one item in this group",defaultType:"radio",groupCls:"x-form-radio-group",getValue:function(){var a=null;this.eachItem(function(b){if(b.checked){a=b;return false}});return a},onSetValue:function(c,b){if(arguments.length>1){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",shouldLayout:false,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,d,c;a.each(function(e){d=this.findField(e.name);if(d){c=d.getValue();if(Ext.type(c)!==false&&c.getGroupValue){c=c.getGroupValue()}else{if(d.eachItem){c=[];d.eachItem(function(g){c.push(g.getValue())})}}b.set(e.name,c)}},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)}else{if(d instanceof Ext.form.CheckboxGroup&&d.rendered){return d.eachItem(a)}}}}};this.items.each(a)}return b||null},markInvalid:function(h){if(Ext.isArray(h)){for(var c=0,a=h.length;c<a;c++){var b=h[c];var d=this.findField(b.id);if(d){d.markInvalid(b.msg)}}}else{var e,g;for(g in h){if(!Ext.isFunction(h[g])&&(e=this.findField(g))){e.markInvalid(h[g])}}}return this},setValues:function(c){if(Ext.isArray(c)){for(var d=0,a=c.length;d<a;d++){var b=c[d];var e=this.findField(b.id);if(e){e.setValue(b.value);if(this.trackResetOnLoad){e.originalValue=e.getValue()}}}}else{var g,h;for(h in c){if(!Ext.isFunction(c[h])&&(g=this.findField(h))){g.setValue(c[h]);if(this.trackResetOnLoad){g.originalValue=g.getValue()}}}}return this},getValues:function(b){var a=Ext.lib.Ajax.serializeForm(this.el.dom);if(b===true){return a}return Ext.urlDecode(a)},getFieldValues:function(a){var d={},e,b,c;this.items.each(function(g){if(!g.disabled&&(a!==true||g.isDirty())){e=g.getName();b=d[e];c=g.getValue();if(Ext.isDefined(b)){if(Ext.isArray(b)){d[e].push(c)}else{d[e]=[b,c]}}else{d[e]=c}}});return d},clearInvalid:function(){this.items.each(function(a){a.clearInvalid()});return this},reset:function(){this.items.each(function(a){a.reset()});return this},add:function(){this.items.addAll(Array.prototype.slice.call(arguments,0));return this},remove:function(a){this.items.remove(a);return this},cleanDestroyed:function(){this.items.filterBy(function(a){return !!a.isDestroyed}).each(this.remove,this)},render:function(){this.items.each(function(a){if(a.isFormField&&!a.rendered&&document.getElementById(a.id)){a.applyToMarkup(a.id)}});return this},applyToFields:function(a){this.items.each(function(b){Ext.apply(b,a)});return this},applyIfToFields:function(a){this.items.each(function(b){Ext.applyIf(b,a)});return this},callFieldMethod:function(b,a){a=a||[];this.items.each(function(c){if(Ext.isFunction(c[b])){c[b].apply(c,a)}});return this}});Ext.BasicForm=Ext.form.BasicForm;Ext.FormPanel=Ext.extend(Ext.Panel,{minButtonWidth:75,labelAlign:"left",monitorValid:false,monitorPoll:200,layout:"form",initComponent:function(){this.form=this.createForm();Ext.FormPanel.superclass.initComponent.call(this);this.bodyCfg={tag:"form",cls:this.baseCls+"-body",method:this.method||"POST",id:this.formId||Ext.id()};if(this.fileUpload){this.bodyCfg.enctype="multipart/form-data"}this.initItems();this.addEvents("clientvalidation");this.relayEvents(this.form,["beforeaction","actionfailed","actioncomplete"])},createForm:function(){var a=Ext.applyIf({listeners:{}},this.initialConfig);return new Ext.form.BasicForm(null,a)},initFields:function(){var c=this.form;var a=this;var b=function(d){if(a.isField(d)){c.add(d)}else{if(d.findBy&&d!=a){a.applySettings(d);if(d.items&&d.items.each){d.items.each(b,this)}}}};this.items.each(b,this)},applySettings:function(b){var a=b.ownerCt;Ext.applyIf(b,{labelAlign:a.labelAlign,labelWidth:a.labelWidth,itemCls:a.itemCls})},getLayoutTarget:function(){return this.form.el},getForm:function(){return this.form},onRender:function(b,a){this.initFields();Ext.FormPanel.superclass.onRender.call(this,b,a);this.form.initEl(this.body)},beforeDestroy:function(){this.stopMonitoring();this.form.destroy(true);Ext.FormPanel.superclass.beforeDestroy.call(this)},isField:function(a){return !!a.setValue&&!!a.getValue&&!!a.markInvalid&&!!a.clearInvalid},initEvents:function(){Ext.FormPanel.superclass.initEvents.call(this);this.on({scope:this,add:this.onAddEvent,remove:this.onRemoveEvent});if(this.monitorValid){this.startMonitoring()}},onAdd:function(a){Ext.FormPanel.superclass.onAdd.call(this,a);this.processAdd(a)},onAddEvent:function(a,b){if(a!==this){this.processAdd(b)}},processAdd:function(a){if(this.isField(a)){this.form.add(a)}else{if(a.findBy){this.applySettings(a);this.form.add.apply(this.form,a.findBy(this.isField))}}},onRemove:function(a){Ext.FormPanel.superclass.onRemove.call(this,a);this.processRemove(a)},onRemoveEvent:function(a,b){if(a!==this){this.processRemove(b)}},processRemove:function(a){if(!this.destroying){if(this.isField(a)){this.form.remove(a)}else{if(a.findBy){Ext.each(a.findBy(this.isField),this.form.remove,this.form);this.form.cleanDestroyed()}}}},startMonitoring:function(){if(!this.validTask){this.validTask=new Ext.util.TaskRunner();this.validTask.start({run:this.bindHandler,interval:this.monitorPoll||200,scope:this})}},stopMonitoring:function(){if(this.validTask){this.validTask.stopAll();this.validTask=null}},load:function(){this.form.load.apply(this.form,arguments)},onDisable:function(){Ext.FormPanel.superclass.onDisable.call(this);if(this.form){this.form.items.each(function(){this.disable()})}},onEnable:function(){Ext.FormPanel.superclass.onEnable.call(this);if(this.form){this.form.items.each(function(){this.enable()})}},bindHandler:function(){var e=true;this.form.items.each(function(g){if(!g.isValid(true)){e=false;return false}});if(this.fbar){var b=this.fbar.items.items;for(var d=0,a=b.length;d<a;d++){var c=b[d];if(c.formBind===true&&c.disabled===e){c.setDisabled(!e)}}}this.fireEvent("clientvalidation",this,e)}});Ext.reg("form",Ext.FormPanel);Ext.form.FormPanel=Ext.FormPanel;Ext.form.FieldSet=Ext.extend(Ext.Panel,{baseCls:"x-fieldset",layout:"form",animCollapse:false,onRender:function(b,a){if(!this.el){this.el=document.createElement("fieldset");this.el.id=this.id;if(this.title||this.header||this.checkboxToggle){this.el.appendChild(document.createElement("legend")).className=this.baseCls+"-header"}}Ext.form.FieldSet.superclass.onRender.call(this,b,a);if(this.checkboxToggle){var c=typeof this.checkboxToggle=="object"?this.checkboxToggle:{tag:"input",type:"checkbox",name:this.checkboxName||this.id+"-checkbox"};this.checkbox=this.header.insertFirst(c);this.checkbox.dom.checked=!this.collapsed;this.mon(this.checkbox,"click",this.onCheckClick,this)}},onCollapse:function(a,b){if(this.checkbox){this.checkbox.dom.checked=false}Ext.form.FieldSet.superclass.onCollapse.call(this,a,b)},onExpand:function(a,b){if(this.checkbox){this.checkbox.dom.checked=true}Ext.form.FieldSet.superclass.onExpand.call(this,a,b)},onCheckClick:function(){this[this.checkbox.dom.checked?"expand":"collapse"]()}});Ext.reg("fieldset",Ext.form.FieldSet);Ext.form.HtmlEditor=Ext.extend(Ext.form.Field,{enableFormat:true,enableFontSize:true,enableColors:true,enableAlignments:true,enableLists:true,enableSourceEdit:true,enableLinks:true,enableFont:true,createLinkText:"Please enter the URL for the link:",defaultLinkValue:"http://",fontFamilies:["Arial","Courier New","Tahoma","Times New Roman","Verdana"],defaultFont:"tahoma",defaultValue:(Ext.isOpera||Ext.isIE6)?"&#160;":"&#8203;",actionMode:"wrap",validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Ext.emptyFn,iframePad:3,hideMode:"offsets",defaultAutoCreate:{tag:"textarea",style:"width:500px;height:300px;",autocomplete:"off"},initComponent:function(){this.addEvents("initialize","activate","beforesync","beforepush","sync","push","editmodechange");Ext.form.HtmlEditor.superclass.initComponent.call(this)},createFontOptions:function(){var d=[],b=this.fontFamilies,c,g;for(var e=0,a=b.length;e<a;e++){c=b[e];g=c.toLowerCase();d.push('<option value="',g,'" style="font-family:',c,';"',(this.defaultFont==g?' selected="true">':">"),c,"</option>")}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('<html><head><style type="text/css">body{border: 0; margin: 0; padding: {0}px; height: {1}px; cursor: text}</style></head><body></body></html>',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";a.src=Ext.SSL_SECURE_URL;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=this.getDoc();if(a){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){this.previousSize=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(this.previousSize);delete this.previousSize;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='<div style="'+a[0]+'">'+c+"</div>"}}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){}},beforeDestroy: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()}}Ext.form.HtmlEditor.superclass.beforeDestroy.call(this)},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("&nbsp;&nbsp;&nbsp;&nbsp;");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("<br />");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","&nbsp;&nbsp;&nbsp;&nbsp;");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","<br /><br />");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<a&&!b;e++){b=Date.parseDate(j+h,g+d[e])}}return b}});Ext.reg("timefield",Ext.form.TimeField);Ext.form.SliderField=Ext.extend(Ext.form.Field,{useTips:true,tipText:null,actionMode:"wrap",initComponent:function(){var b=Ext.copyTo({id:this.id+"-slider"},this.initialConfig,["vertical","minValue","maxValue","decimalPrecision","keyIncrement","increment","clickToChange","animate"]);if(this.useTips){var a=this.tipText?{getText:this.tipText}:{};b.plugins=[new Ext.slider.Tip(a)]}this.slider=new Ext.Slider(b);Ext.form.SliderField.superclass.initComponent.call(this)},onRender:function(b,a){this.autoCreate={id:this.id,name:this.name,type:"hidden",tag:"input"};Ext.form.SliderField.superclass.onRender.call(this,b,a);this.wrap=this.el.wrap({cls:"x-form-field-wrap"});this.resizeEl=this.positionEl=this.wrap;this.slider.render(this.wrap)},onResize:function(b,c,d,a){Ext.form.SliderField.superclass.onResize.call(this,b,c,d,a);this.slider.setSize(b,c)},initEvents:function(){Ext.form.SliderField.superclass.initEvents.call(this);this.slider.on("change",this.onChange,this)},onChange:function(b,a){this.setValue(a,undefined,true)},onEnable:function(){Ext.form.SliderField.superclass.onEnable.call(this);this.slider.enable()},onDisable:function(){Ext.form.SliderField.superclass.onDisable.call(this);this.slider.disable()},beforeDestroy:function(){Ext.destroy(this.slider);Ext.form.SliderField.superclass.beforeDestroy.call(this)},alignErrorIcon:function(){this.errorIcon.alignTo(this.slider.el,"tl-tr",[2,0])},setMinValue:function(a){this.slider.setMinValue(a);return this},setMaxValue:function(a){this.slider.setMaxValue(a);return this},setValue:function(c,b,a){if(!a){this.slider.setValue(c,b)}return Ext.form.SliderField.superclass.setValue.call(this,this.slider.getValue())},getValue:function(){return this.slider.getValue()}});Ext.reg("sliderfield",Ext.form.SliderField);Ext.form.Label=Ext.extend(Ext.BoxComponent,{onRender:function(b,a){if(!this.el){this.el=document.createElement("label");this.el.id=this.getId();this.el.innerHTML=this.text?Ext.util.Format.htmlEncode(this.text):(this.html||"");if(this.forId){this.el.setAttribute("for",this.forId)}}Ext.form.Label.superclass.onRender.call(this,b,a)},setText:function(a,b){var c=b===false;this[!c?"text":"html"]=a;delete this[c?"text":"html"];if(this.rendered){this.el.dom.innerHTML=b!==false?Ext.util.Format.htmlEncode(a):a}return this}});Ext.reg("label",Ext.form.Label);Ext.form.Action=function(b,a){this.form=b;this.options=a||{}};Ext.form.Action.CLIENT_INVALID="client";Ext.form.Action.SERVER_INVALID="server";Ext.form.Action.CONNECT_FAILURE="connect";Ext.form.Action.LOAD_FAILURE="load";Ext.form.Action.prototype={type:"default",run:function(a){},success:function(a){},handleResponse:function(a){},failure:function(a){this.response=a;this.failureType=Ext.form.Action.CONNECT_FAILURE;this.form.afterAction(this,false)},processResponse:function(a){this.response=a;if(!a.responseText&&!a.responseXML){return true}this.result=this.handleResponse(a);return this.result},decodeResponse:function(a){try{return Ext.decode(a.responseText)}catch(b){return false}},getUrl:function(c){var a=this.options.url||this.form.url||this.form.el.dom.action;if(c){var b=this.getParams();if(b){a=Ext.urlAppend(a,b)}}return a},getMethod:function(){return(this.options.method||this.form.method||this.form.el.dom.method||"POST").toUpperCase()},getParams:function(){var a=this.form.baseParams;var b=this.options.params;if(b){if(typeof b=="object"){b=Ext.urlEncode(Ext.applyIf(b,a))}else{if(typeof b=="string"&&a){b+="&"+Ext.urlEncode(a)}}}else{if(a){b=Ext.urlEncode(a)}}return b},createCallback:function(a){var a=a||{};return{success:this.success,failure:this.failure,scope:this,timeout:(a.timeout*1000)||(this.form.timeout*1000),upload:this.form.fileUpload?this.success:undefined}}};Ext.form.Action.Submit=function(b,a){Ext.form.Action.Submit.superclass.constructor.call(this,b,a)};Ext.extend(Ext.form.Action.Submit,Ext.form.Action,{type:"submit",run:function(){var e=this.options,g=this.getMethod(),d=g=="GET";if(e.clientValidation===false||this.form.isValid()){if(e.submitEmptyText===false){var a=this.form.items,c=[],b=function(h){if(h.el.getValue()==h.emptyText){c.push(h);h.el.dom.value=""}if(h.isComposite&&h.rendered){h.items.each(b)}};a.each(b)}Ext.Ajax.request(Ext.apply(this.createCallback(e),{form:this.form.el.dom,url:this.getUrl(d),method:g,headers:e.headers,params:!d?this.getParams():null,isUpload:this.form.fileUpload}));if(e.submitEmptyText===false){Ext.each(c,function(h){if(h.applyEmptyText){h.applyEmptyText()}})}}else{if(e.clientValidation!==false){this.failureType=Ext.form.Action.CLIENT_INVALID;this.form.afterAction(this,false)}}},success:function(b){var a=this.processResponse(b);if(a===true||a.success){this.form.afterAction(this,true);return}if(a.errors){this.form.markInvalid(a.errors)}this.failureType=Ext.form.Action.SERVER_INVALID;this.form.afterAction(this,false)},handleResponse:function(c){if(this.form.errorReader){var b=this.form.errorReader.read(c);var g=[];if(b.records){for(var d=0,a=b.records.length;d<a;d++){var e=b.records[d];g[d]=e.data}}if(g.length<1){g=null}return{success:b.success,errors:g}}return this.decodeResponse(c)}});Ext.form.Action.Load=function(b,a){Ext.form.Action.Load.superclass.constructor.call(this,b,a);this.reader=this.form.reader};Ext.extend(Ext.form.Action.Load,Ext.form.Action,{type:"load",run:function(){Ext.Ajax.request(Ext.apply(this.createCallback(this.options),{method:this.getMethod(),url:this.getUrl(false),headers:this.options.headers,params:this.getParams()}))},success:function(b){var a=this.processResponse(b);if(a===true||!a.success||!a.data){this.failureType=Ext.form.Action.LOAD_FAILURE;this.form.afterAction(this,false);return}this.form.clearInvalid();this.form.setValues(a.data);this.form.afterAction(this,true)},handleResponse:function(b){if(this.form.reader){var a=this.form.reader.read(b);var c=a.records&&a.records[0]?a.records[0].data:null;return{success:a.success,data:c}}return this.decodeResponse(b)}});Ext.form.Action.DirectLoad=Ext.extend(Ext.form.Action.Load,{constructor:function(b,a){Ext.form.Action.DirectLoad.superclass.constructor.call(this,b,a)},type:"directload",run:function(){var a=this.getParams();a.push(this.success,this);this.form.api.load.apply(window,a)},getParams:function(){var c=[],h={};var e=this.form.baseParams;var g=this.options.params;Ext.apply(h,g,e);var b=this.form.paramOrder;if(b){for(var d=0,a=b.length;d<a;d++){c.push(h[b[d]])}}else{if(this.form.paramsAsHash){c.push(h)}}return c},processResponse:function(a){this.result=a;return a},success:function(a,b){if(b.type==Ext.Direct.exceptions.SERVER){a={}}Ext.form.Action.DirectLoad.superclass.success.call(this,a)}});Ext.form.Action.DirectSubmit=Ext.extend(Ext.form.Action.Submit,{constructor:function(b,a){Ext.form.Action.DirectSubmit.superclass.constructor.call(this,b,a)},type:"directsubmit",run:function(){var a=this.options;if(a.clientValidation===false||this.form.isValid()){this.success.params=this.getParams();this.form.api.submit(this.form.el.dom,this.success,this)}else{if(a.clientValidation!==false){this.failureType=Ext.form.Action.CLIENT_INVALID;this.form.afterAction(this,false)}}},getParams:function(){var c={};var a=this.form.baseParams;var b=this.options.params;Ext.apply(c,b,a);return c},processResponse:function(a){this.result=a;return a},success:function(a,b){if(b.type==Ext.Direct.exceptions.SERVER){a={}}Ext.form.Action.DirectSubmit.superclass.success.call(this,a)}});Ext.form.Action.ACTION_TYPES={load:Ext.form.Action.Load,submit:Ext.form.Action.Submit,directload:Ext.form.Action.DirectLoad,directsubmit:Ext.form.Action.DirectSubmit};Ext.form.VTypes=function(){var c=/^[a-zA-Z_]+$/,d=/^[a-zA-Z0-9_]+$/,b=/^(\w+)([\-+.\'][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/,a=/(((^https?)|(^ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;return{email:function(e){return b.test(e)},emailText:'This field should be an e-mail address in the format "user@example.com"',emailMask:/[a-z0-9_\.\-\+\'@]/i,url:function(e){return a.test(e)},urlText:'This field should be a URL in the format "http://www.example.com"',alpha:function(e){return c.test(e)},alphaText:"This field should only contain letters and _",alphaMask:/[a-z_]/i,alphanum:function(e){return d.test(e)},alphanumText:"This field should only contain letters, numbers and _",alphanumMask:/[a-z0-9_]/i}}();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,g=a.columns,j=this.store,m,h,l;if(g){for(var d=0,e=g.length;d<e;d++){m=g[d];h=k.getColumnById(m.id);if(h){l=k.getIndexById(m.id);k.setState(l,{hidden:m.hidden,width:m.width,sortable:m.sortable});if(l!=d){k.moveColumn(l,d)}}}}if(j){m=a.sort;if(m){j[j.remoteSort?"setDefaultSort":"sort"](m.field,m.direction)}m=a.group;if(j.groupBy){if(m){j.groupBy(m)}else{j.clearGrouping()}}}var b=Ext.apply({},a);delete b.columns;delete b.sort;Ext.grid.GridPanel.superclass.applyState.call(this,b)},getState:function(){var g={columns:[]},b=this.store,e,a;for(var d=0,h;(h=this.colModel.config[d]);d++){g.columns[d]={id:h.id,width:h.width};if(h.hidden){g.columns[d].hidden=true}if(h.sortable){g.columns[d].sortable=true}}if(b){e=b.getSortState();if(e){g.sort=e}if(b.getGroupState){a=b.getGroupState();if(a){g.group=a}}}return g},afterRender:function(){Ext.grid.GridPanel.superclass.afterRender.call(this);var a=this.view;this.on("bodyresize",a.layout,a);a.layout(true);if(this.deferRowRender){if(!this.deferRowRenderTask){this.deferRowRenderTask=new Ext.util.DelayedTask(a.afterRender,this.view)}this.deferRowRenderTask.delay(10)}else{a.afterRender()}this.viewReady=true},reconfigure:function(a,b){var c=this.rendered;if(c){if(this.loadMask){this.loadMask.destroy();this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({},{store:a},this.initialConfig.loadMask))}}if(this.view){this.view.initData(a,b)}this.store=a;this.colModel=b;if(c){this.view.refresh(true)}this.fireEvent("reconfigure",this,a,b)},onDestroy:function(){if(this.deferRowRenderTask&&this.deferRowRenderTask.cancel){this.deferRowRenderTask.cancel()}if(this.rendered){Ext.destroy(this.view,this.loadMask)}else{if(this.store&&this.store.autoDestroy){this.store.destroy()}}Ext.destroy(this.colModel,this.selModel);this.store=this.selModel=this.colModel=this.view=this.loadMask=null;Ext.grid.GridPanel.superclass.onDestroy.call(this)},processEvent:function(a,b){this.view.processEvent(a,b)},onClick:function(a){this.processEvent("click",a)},onMouseDown:function(a){this.processEvent("mousedown",a)},onContextMenu:function(b,a){this.processEvent("contextmenu",b)},onDblClick:function(a){this.processEvent("dblclick",a)},walkCells:function(k,c,b,e,j){var i=this.colModel,g=i.getColumnCount(),a=this.store,h=a.getCount(),d=true;if(b<0){if(c<0){k--;d=false}while(k>=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<h){if(!d){c=0}d=false;while(c<g){if(e.call(j||this,k,c,i)===true){return[k,c]}c++}k++}}return null},getGridEl:function(){return this.body},stopEditing:Ext.emptyFn,getSelectionModel:function(){if(!this.selModel){this.selModel=new Ext.grid.RowSelectionModel(this.disableSelection?{selectRow:Ext.emptyFn}:null)}return this.selModel},getStore:function(){return this.store},getColumnModel:function(){return this.colModel},getView:function(){if(!this.view){this.view=new Ext.grid.GridView(this.viewConfig)}return this.view},getDragDropText:function(){var a=this.selModel.getCount();return String.format(this.ddText,a,a==1?"":"s")}});Ext.reg("grid",Ext.grid.GridPanel);Ext.grid.PivotGrid=Ext.extend(Ext.grid.GridPanel,{aggregator:"sum",renderer:undefined,initComponent:function(){Ext.grid.PivotGrid.superclass.initComponent.apply(this,arguments);this.initAxes();this.enableColumnResize=false;this.viewConfig=Ext.apply(this.viewConfig||{},{forceFit:true});this.colModel=new Ext.grid.ColumnModel({})},getAggregator:function(){if(typeof this.aggregator=="string"){return Ext.grid.PivotAggregatorMgr.types[this.aggregator]}else{return this.aggregator}},setAggregator:function(a){this.aggregator=a},setMeasure:function(a){this.measure=a},setLeftAxis:function(b,a){this.leftAxis=b;if(a){this.view.refresh()}},setTopAxis:function(b,a){this.topAxis=b;if(a){this.view.refresh()}},initAxes:function(){var a=Ext.grid.PivotAxis;if(!(this.leftAxis instanceof a)){this.setLeftAxis(new a({orientation:"vertical",dimensions:this.leftAxis||[],store:this.store}))}if(!(this.topAxis instanceof a)){this.setTopAxis(new a({orientation:"horizontal",dimensions:this.topAxis||[],store:this.store}))}},extractData:function(){var c=this.store.data.items,s=c.length,q=[],h,g,e,d;if(s==0){return[]}var l=this.leftAxis.getTuples(),o=l.length,m=this.topAxis.getTuples(),a=m.length,b=this.getAggregator();for(g=0;g<s;g++){h=c[g];for(e=0;e<o;e++){q[e]=q[e]||[];if(l[e].matcher(h)===true){for(d=0;d<a;d++){q[e][d]=q[e][d]||[];if(m[d].matcher(h)){q[e][d].push(h)}}}}}var n=q.length,p,r;for(g=0;g<n;g++){r=q[g];p=r.length;for(e=0;e<p;e++){q[g][e]=b(q[g][e],this.measure)}}return q},getView:function(){if(!this.view){this.view=new Ext.grid.PivotGridView(this.viewConfig)}return this.view}});Ext.reg("pivotgrid",Ext.grid.PivotGrid);Ext.grid.PivotAggregatorMgr=new Ext.AbstractManager();Ext.grid.PivotAggregatorMgr.registerType("sum",function(a,c){var e=a.length,d=0,b;for(b=0;b<e;b++){d+=a[b].get(c)}return d});Ext.grid.PivotAggregatorMgr.registerType("avg",function(a,c){var e=a.length,d=0,b;for(b=0;b<e;b++){d+=a[b].get(c)}return(d/e)||"n/a"});Ext.grid.PivotAggregatorMgr.registerType("min",function(a,c){var e=[],d=a.length,b;for(b=0;b<d;b++){e.push(a[b].get(c))}return Math.min.apply(this,e)||"n/a"});Ext.grid.PivotAggregatorMgr.registerType("max",function(a,c){var e=[],d=a.length,b;for(b=0;b<d;b++){e.push(a[b].get(c))}return Math.max.apply(this,e)||"n/a"});Ext.grid.PivotAggregatorMgr.registerType("count",function(a,b){return a.length});Ext.grid.GridView=Ext.extend(Ext.util.Observable,{deferEmptyText:true,scrollOffset:undefined,autoFill:false,forceFit:false,sortClasses:["sort-asc","sort-desc"],sortAscText:"Sort Ascending",sortDescText:"Sort Descending",columnsText:"Columns",selectedRowClass:"x-grid3-row-selected",borderWidth:2,tdClass:"x-grid3-cell",hdCls:"x-grid3-hd",markDirty:true,cellSelectorDepth:4,rowSelectorDepth:10,rowBodySelectorDepth:10,cellSelector:"td.x-grid3-cell",rowSelector:"div.x-grid3-row",rowBodySelector:"div.x-grid3-row-body",firstRowCls:"x-grid3-row-first",lastRowCls:"x-grid3-row-last",rowClsRe:/(?:^|\s+)x-grid3-row-(first|last|alt)(?:\s+|$)/g,headerMenuOpenCls:"x-grid3-hd-menu-open",rowOverCls:"x-grid3-row-over",constructor:function(a){Ext.apply(this,a);this.addEvents("beforerowremoved","beforerowsinserted","beforerefresh","rowremoved","rowsinserted","rowupdated","refresh");Ext.grid.GridView.superclass.constructor.call(this)},masterTpl:new Ext.Template('<div class="x-grid3" hidefocus="true">','<div class="x-grid3-viewport">','<div class="x-grid3-header">','<div class="x-grid3-header-inner">','<div class="x-grid3-header-offset" style="{ostyle}">{header}</div>',"</div>",'<div class="x-clear"></div>',"</div>",'<div class="x-grid3-scroller">','<div class="x-grid3-body" style="{bstyle}">{body}</div>','<a href="#" class="x-grid3-focus" tabIndex="-1"></a>',"</div>","</div>",'<div class="x-grid3-resize-marker">&#160;</div>','<div class="x-grid3-resize-proxy">&#160;</div>',"</div>"),headerTpl:new Ext.Template('<table border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<thead>",'<tr class="x-grid3-hd-row">{cells}</tr>',"</thead>","</table>"),bodyTpl:new Ext.Template("{rows}"),cellTpl:new Ext.Template('<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}" tabIndex="0" {cellAttr}>','<div class="x-grid3-cell-inner x-grid3-col-{id}" unselectable="on" {attr}>{value}</div>',"</td>"),initTemplates:function(){var c=this.templates||{},d,b,g=new Ext.Template('<td class="x-grid3-hd x-grid3-cell x-grid3-td-{id} {css}" style="{style}">','<div {tooltip} {attr} class="x-grid3-hd-inner x-grid3-hd-{id}" unselectable="on" style="{istyle}">',this.grid.enableHdMenu?'<a class="x-grid3-hd-btn" href="#"></a>':"","{value}",'<img alt="" class="x-grid3-sort-icon" src="',Ext.BLANK_IMAGE_URL,'" />',"</div>","</td>"),a=['<tr class="x-grid3-row-body-tr" style="{bodyStyle}">','<td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on">','<div class="x-grid3-row-body">{body}</div>',"</td>","</tr>"].join(""),e=['<table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<tbody>","<tr>{cells}</tr>",this.enableRowBody?a:"","</tbody>","</table>"].join("");Ext.applyIf(c,{hcell:g,cell:this.cellTpl,body:this.bodyTpl,header:this.headerTpl,master:this.masterTpl,row:new Ext.Template('<div class="x-grid3-row {alt}" style="{tstyle}">'+e+"</div>"),rowInner:new Ext.Template(e)});for(b in c){d=c[b];if(d&&Ext.isFunction(d.compile)&&!d.compiled){d.disableFormats=true;d.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 b=Ext.Element,d=Ext.get(this.grid.getGridEl().dom.firstChild),e=new b(d.child("div.x-grid3-viewport")),c=new b(e.child("div.x-grid3-header")),a=new b(e.child("div.x-grid3-scroller"));if(this.grid.hideHeaders){c.setDisplayed(false)}if(this.forceFit){a.setStyle("overflow-x","hidden")}Ext.apply(this,{el:d,mainWrap:e,scroller:a,mainHd:c,innerHd:c.child("div.x-grid3-header-inner").dom,mainBody:new b(b.fly(a).child("div.x-grid3-body")),focusEl:new b(b.fly(a).child("a")),resizeMarker:new b(d.child("div.x-grid3-resize-marker")),resizeProxy:new b(d.child("div.x-grid3-resize-proxy"))});this.focusEl.swallowEvent("click",true)},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(d,c){var b=this.findCell(d),a;if(b){a=this.fly(b).hasClass(c);if(!c||a){return this.getCellIndex(b)}}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 Ext.fly(this.getRow(b)).query(this.cellSelector)[a]},getHeaderCell:function(a){return this.mainHd.dom.getElementsByTagName("td")[a]},addRowClass:function(b,a){var c=this.getRow(b);if(c){this.fly(c).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,d;for(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(){var a=this.scroller.dom;a.scrollTop=0;a.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var a=this.scroller.dom;this.grid.fireEvent("bodyscroll",a.scrollLeft,a.scrollTop)},syncHeaderScroll:function(){var a=this.innerHd,b=this.scroller.dom.scrollLeft;a.scrollLeft=b;a.scrollLeft=b},updateSortIcon:function(d,c){var a=this.sortClasses,b=a[c=="DESC"?1:0],e=this.mainHd.select("td").removeClass(a);e.item(d).addClass(b)},updateAllColumnWidths:function(){var e=this.getTotalWidth(),k=this.cm.getColumnCount(),m=this.getRows(),g=m.length,b=[],l,a,h,d,c;for(d=0;d<k;d++){b[d]=this.getColumnWidth(d);this.getHeaderCell(d).style.width=b[d]}this.updateHeaderWidth();for(d=0;d<g;d++){l=m[d];l.style.width=e;a=l.firstChild;if(a){a.style.width=e;h=a.rows[0];for(c=0;c<k;c++){h.childNodes[c].style.width=b[c]}}}this.onAllColumnWidthsUpdated(b,e)},updateColumnWidth:function(d,b){var c=this.getColumnWidth(d),j=this.getTotalWidth(),h=this.getHeaderCell(d),a=this.getRows(),e=a.length,l,g,k;this.updateHeaderWidth();h.style.width=c;for(g=0;g<e;g++){l=a[g];k=l.firstChild;l.style.width=j;if(k){k.style.width=j;k.rows[0].childNodes[d].style.width=c}}this.onColumnWidthUpdated(d,c,j)},updateColumnHidden:function(b,j){var h=this.getTotalWidth(),k=j?"none":"",g=this.getHeaderCell(b),a=this.getRows(),d=a.length,l,c,e;this.updateHeaderWidth();g.style.display=k;for(e=0;e<d;e++){l=a[e];l.style.width=h;c=l.firstChild;if(c){c.style.width=h;c.rows[0].childNodes[b].style.display=k}}this.onColumnHiddenUpdated(b,j,h);delete this.lastViewWidth;this.layout()},doRender:function(d,v,m,a,r,t){var h=this.templates,c=h.cell,y=h.row,o=r-1,b="width:"+this.getTotalWidth()+";",k=[],l=[],n={tstyle:b},q={},w=v.length,x,g,e,u,s,p;for(s=0;s<w;s++){e=v[s];l=[];p=s+a;for(u=0;u<r;u++){g=d[u];q.id=g.id;q.css=u===0?"x-grid3-cell-first ":(u==o?"x-grid3-cell-last ":"");q.attr=q.cellAttr="";q.style=g.style;q.value=g.renderer.call(g.scope,e.data[g.name],q,e,p,u,m);if(Ext.isEmpty(q.value)){q.value="&#160;"}if(this.markDirty&&e.dirty&&typeof e.modified[g.name]!="undefined"){q.css+=" x-grid3-dirty-cell"}l[l.length]=c.apply(q)}x=[];if(t&&((p+1)%2===0)){x[0]="x-grid3-row-alt"}if(e.dirty){x[1]=" x-grid3-dirty-row"}n.cols=r;if(this.getRowClass){x[2]=this.getRowClass(e,p,n,m)}n.alt=x.join(" ");n.cells=l.join("");k[k.length]=y.apply(n)}return k.join("")},processRows:function(a,g){if(!this.ds||this.ds.getCount()<1){return}var d=this.getRows(),c=d.length,e,b;g=g||!this.grid.stripeRows;a=a||0;for(b=0;b<c;b++){e=d[b];if(e){e.rowIndex=b;if(!g){e.className=e.className.replace(this.rowClsRe," ");if((b+1)%2===0){e.className+=" x-grid3-row-alt"}}}}if(a===0){Ext.fly(d[0]).addClass(this.firstRowCls)}Ext.fly(d[c-1]).addClass(this.lastRowCls)},afterRender:function(){if(!this.ds||!this.cm){return}this.mainBody.dom.innerHTML=this.renderBody()||"&#160;";this.processRows(0,true);if(this.deferEmptyText!==true){this.applyEmptyText()}this.grid.fireEvent("viewready",this.grid)},afterRenderUI:function(){var a=this.grid;this.initElements();Ext.fly(this.innerHd).on("click",this.handleHdDown,this);this.mainHd.on({scope:this,mouseover:this.handleHdOver,mouseout:this.handleHdOut,mousemove:this.handleHdMove});this.scroller.on("scroll",this.syncScroll,this);if(a.enableColumnResize!==false){this.splitZone=new Ext.grid.GridView.SplitDragZone(a,this.mainHd.dom)}if(a.enableColumnMove){this.columnDrag=new Ext.grid.GridView.ColumnDragZone(a,this.innerHd);this.columnDrop=new Ext.grid.HeaderDropZone(a,this.mainHd.dom)}if(a.enableHdMenu!==false){this.hmenu=new Ext.menu.Menu({id:a.id+"-hctx"});this.hmenu.add({itemId:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},{itemId:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"});if(a.enableColumnHide!==false){this.colMenu=new Ext.menu.Menu({id:a.id+"-hcols-menu"});this.colMenu.on({scope:this,beforeshow:this.beforeColMenuShow,itemclick:this.handleHdMenuClick});this.hmenu.add("-",{itemId:"columns",hideOnClick:false,text:this.columnsText,menu:this.colMenu,iconCls:"x-cols-icon"})}this.hmenu.on("itemclick",this.handleHdMenuClick,this)}if(a.trackMouseOver){this.mainBody.on({scope:this,mouseover:this.onRowOver,mouseout:this.onRowOut})}if(a.enableDragDrop||a.enableDrag){this.dragZone=new Ext.grid.GridDragZone(a,{ddGroup:a.ddGroup||"GridDD"})}this.updateHeaderSortState()},renderUI:function(){var a=this.templates;return a.master.apply({body:a.body.apply({rows:"&#160;"}),header:this.renderHeaders(),ostyle:"width:"+this.getOffsetWidth()+";",bstyle:"width:"+this.getTotalWidth()+";"})},processEvent:function(b,h){var i=h.getTarget(),a=this.grid,d=this.findHeaderIndex(i),k,j,c,g;a.fireEvent(b,h);if(d!==false){a.fireEvent("header"+b,a,d,h)}else{k=this.findRowIndex(i);if(k!==false){j=this.findCellIndex(i);if(j!==false){c=a.colModel.getColumnAt(j);if(a.fireEvent("cell"+b,a,k,j,h)!==false){if(!c||(c.processEvent&&(c.processEvent(b,h,a,k,j)!==false))){a.fireEvent("row"+b,a,k,h)}}}else{if(a.fireEvent("row"+b,a,k,h)!==false){(g=this.findRowBody(i))&&a.fireEvent("rowbody"+b,a,k,h)}}}else{a.fireEvent("container"+b,a,h)}}},layout:function(j){if(!this.mainBody){return}var a=this.grid,d=a.getGridEl(),c=d.getSize(true),i=c.width,b=c.height,h=this.scroller,g,e,k;if(i<20||b<20){return}if(a.autoHeight){g=h.dom.style;g.overflow="visible";if(Ext.isWebKit){g.position="static"}}else{this.el.setSize(i,b);e=this.mainHd.getHeight();k=b-e;h.setSize(i,k);if(this.innerHd){this.innerHd.style.width=(i)+"px"}}if(this.forceFit||(j===true&&this.autoFill)){if(this.lastViewWidth!=i){this.fitColumns(false,false);this.lastViewWidth=i}}else{this.autoExpand();this.syncHeaderScroll()}this.onLayout(i,k)},onLayout:function(a,b){},onColumnWidthUpdated:function(c,a,b){},onAllColumnWidthsUpdated:function(a,b){},onColumnHiddenUpdated:function(b,c,a){},updateColumnText:function(a,b){},afterMove:function(a){},init:function(a){this.grid=a;this.initTemplates();this.initData(a.store,a.colModel);this.initUI(a)},getColumnId:function(a){return this.cm.getColumnId(a)},getOffsetWidth:function(){return(this.cm.getTotalWidth()+this.getScrollOffset())+"px"},getScrollOffset:function(){return Ext.num(this.scrollOffset,Ext.getScrollBarWidth())},renderHeaders:function(){var e=this.cm,g=this.templates,a=g.hcell,d={},h=e.getColumnCount(),j=h-1,k=[],c,b;for(c=0;c<h;c++){if(c==0){b="x-grid3-cell-first "}else{b=c==j?"x-grid3-cell-last ":""}d={id:e.getColumnId(c),value:e.getColumnHeader(c)||"",style:this.getColumnStyle(c,true),css:b,tooltip:this.getColumnTooltip(c)};if(e.config[c].align=="right"){d.istyle="padding-right: 16px;"}else{delete d.istyle}k[c]=a.apply(d)}return g.header.apply({cells:k.join(""),tstyle:String.format("width: {0};",this.getTotalWidth())})},getColumnTooltip:function(a){var b=this.cm.getColumnTooltip(a);if(b){if(Ext.QuickTips.isEnabled()){return'ext:qtip="'+b+'"'}else{return'title="'+b+'"'}}return""},beforeUpdate:function(){this.grid.stopEditing(true)},updateHeaders:function(){this.innerHd.firstChild.innerHTML=this.renderHeaders();this.updateHeaderWidth(false)},updateHeaderWidth:function(c){var b=this.innerHd.firstChild,a=this.getTotalWidth();b.style.width=this.getOffsetWidth();b.firstChild.style.width=a;if(c!==false){this.mainBody.dom.style.width=a}},focusRow:function(a){this.focusCell(a,0,false)},focusCell:function(d,b,c){this.syncFocusEl(this.ensureVisible(d,b,c));var a=this.focusEl;if(Ext.isGecko){a.focus()}else{a.focus.defer(1,a)}},resolveCell:function(h,d,g){if(!Ext.isNumber(h)){h=h.rowIndex}if(!this.ds){return null}if(h<0||h>=this.ds.getCount()){return null}d=(d!==undefined?d:0);var c=this.getRow(h),b=this.cm,e=b.getColumnCount(),a;if(!(g===false&&d===0)){while(d<e&&b.isHidden(d)){d++}a=this.getCell(h,d)}return{row:c,cell:a}},getResolvedXY:function(b){if(!b){return null}var a=b.cell,c=b.row;if(a){return Ext.fly(a).getXY()}else{return[this.el.getX(),Ext.fly(c).getY()]}},syncFocusEl:function(d,a,c){var b=d;if(!Ext.isArray(b)){d=Math.min(d,Math.max(0,this.getRows().length-1));if(isNaN(d)){return}b=this.getResolvedXY(this.resolveCell(d,a,c))}this.focusEl.setXY(b||this.scroller.getXY())},ensureVisible:function(t,g,e){var r=this.resolveCell(t,g,e);if(!r||!r.row){return null}var k=r.row,h=r.cell,n=this.scroller.dom,d=k,s=0,o=this.el.dom;while(d&&d!=o){s+=d.offsetTop;d=d.offsetParent}s-=this.mainHd.dom.offsetHeight;o=parseInt(n.scrollTop,10);var q=s+k.offsetHeight,a=n.clientHeight,m=o+a;if(s<o){n.scrollTop=s}else{if(q>m){n.scrollTop=q-a}}if(e!==false){var l=parseInt(h.offsetLeft,10),j=l+h.offsetWidth,i=parseInt(n.scrollLeft,10),b=i+n.clientWidth;if(l<i){n.scrollLeft=l}else{if(j>b){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.processRows(i);this.fireEvent("rowsinserted",this,i,e)}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(b,d){var a=this.cm,g=a.config,c=d?"":g[b].css||"",e=g[b].align;c+=String.format("width: {0};",this.getColumnWidth(b));if(a.isHidden(b)){c+="display: none; "}if(e){c+=String.format("text-align: {0};",e)}return c},getColumnWidth:function(b){var c=this.cm.getColumnWidth(b),a=this.borderWidth;if(Ext.isNumber(c)){if(Ext.isBorderBox||(Ext.isWebKit&&!Ext.isSafari2)){return c+"px"}else{return Math.max(c-a,0)+"px"}}else{return c}},getTotalWidth:function(){return this.cm.getTotalWidth()+"px"},fitColumns:function(g,j,h){var a=this.grid,l=this.cm,s=l.getTotalWidth(false),q=this.getGridInnerWidth(),r=q-s,c=[],o=0,n=0,u,d,p;if(q<20||r===0){return false}var e=l.getColumnCount(true),m=l.getColumnCount(false),b=e-(Ext.isNumber(h)?1:0);if(b===0){b=1;h=undefined}for(p=0;p<m;p++){if(!l.isFixed(p)&&p!==h){u=l.getColumnWidth(p);c.push(p,u);if(!l.isHidden(p)){o=p;n+=u}}}d=(q-l.getTotalWidth())/n;while(c.length){u=c.pop();p=c.pop();l.setColumnWidth(p,Math.max(a.minColumnWidth,Math.floor(u+u*d)),true)}s=l.getTotalWidth(false);if(s>q){var t=(b==e)?o:h,k=Math.max(1,l.getColumnWidth(t)-(s-q));l.setColumnWidth(t,k,true)}if(g!==true){this.updateAllColumnWidths()}return true},autoExpand:function(k){var a=this.grid,i=this.cm,e=this.getGridInnerWidth(),c=i.getTotalWidth(false),g=a.autoExpandColumn;if(!this.userResized&&g){if(e!=c){var j=i.getIndexById(g),b=i.getColumnWidth(j),h=e-c+b,d=Math.min(Math.max(h,a.autoExpandMin),a.autoExpandMax);if(b!=d){i.setColumnWidth(j,d,true);if(k!==true){this.updateColumnWidth(j,d)}}}}},getGridInnerWidth:function(){return this.grid.getGridEl().getWidth(true)-this.getScrollOffset()},getColumnData:function(){var e=[],c=this.cm,g=c.getColumnCount(),a=this.ds.fields,d,b;for(d=0;d<g;d++){b=c.getDataIndex(d);e[d]={name:Ext.isDefined(b)?b:(a.get(d)?a.get(d).name:undefined),renderer:c.getRenderer(d),scope:c.getRendererScope(d),id:c.getColumnId(d),style:this.getColumnStyle(d)}}return e},renderRows:function(i,c){var a=this.grid,g=a.store,j=a.stripeRows,e=a.colModel,h=e.getColumnCount(),d=g.getCount(),b;if(d<1){return""}i=i||0;c=Ext.isDefined(c)?c:d-1;b=g.getRange(i,c);return this.doRender(this.getColumnData(),b,g,i,h,j)},renderBody:function(){var a=this.renderRows()||"&#160;";return this.templates.body.apply({rows:a})},refreshRow:function(g){var l=this.ds,m=this.cm.getColumnCount(),c=this.getColumnData(),n=m-1,p=["x-grid3-row"],e={tstyle:String.format("width: {0};",this.getTotalWidth())},a=[],k=this.templates.cell,j,q,b,o,h,d;if(Ext.isNumber(g)){j=g;g=l.getAt(j)}else{j=l.indexOf(g)}if(!g||j<0){return}for(d=0;d<m;d++){b=c[d];if(d==0){h="x-grid3-cell-first"}else{h=(d==n)?"x-grid3-cell-last ":""}o={id:b.id,style:b.style,css:h,attr:"",cellAttr:""};o.value=b.renderer.call(b.scope,g.data[b.name],o,g,j,d,l);if(Ext.isEmpty(o.value)){o.value="&#160;"}if(this.markDirty&&g.dirty&&typeof g.modified[b.name]!="undefined"){o.css+=" x-grid3-dirty-cell"}a[d]=k.apply(o)}q=this.getRow(j);q.className="";if(this.grid.stripeRows&&((j+1)%2===0)){p.push("x-grid3-row-alt")}if(this.getRowClass){e.cols=m;p.push(this.getRowClass(g,j,e,l))}this.fly(q).addClass(p).setStyle(e.tstyle);e.cells=a.join("");q.innerHTML=this.templates.rowInner.apply(e);this.fireEvent("rowupdated",this,j,g)},refresh:function(b){this.fireEvent("beforerefresh",this);this.grid.stopEditing(true);var a=this.renderBody();this.mainBody.update(a).setWidth(this.getTotalWidth());if(b===true){this.updateHeaders();this.updateHeaderSortState()}this.processRows(0,true);this.layout();this.applyEmptyText();this.fireEvent("refresh",this)},applyEmptyText:function(){if(this.emptyText&&!this.hasRows()){this.mainBody.update('<div class="x-grid-empty">'+this.emptyText+"</div>")}},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(){var j=this,a=j.grid,d=a.getGridEl(),i=j.dragZone,g=j.splitZone,h=j.columnDrag,e=j.columnDrop,k=j.scrollToTopTask,c,b;if(k&&k.cancel){k.cancel()}Ext.destroyMembers(j,"colMenu","hmenu");j.initData(null,null);j.purgeListeners();Ext.fly(j.innerHd).un("click",j.handleHdDown,j);if(a.enableColumnMove){c=h.dragData;b=h.proxy;Ext.destroy(h.el,b.ghost,b.el,e.el,e.proxyTop,e.proxyBottom,c.ddel,c.header);if(b.anim){Ext.destroy(b.anim)}delete b.ghost;delete c.ddel;delete c.header;h.destroy();delete Ext.dd.DDM.locationCache[h.id];delete h._domRef;delete e.proxyTop;delete e.proxyBottom;e.destroy();delete Ext.dd.DDM.locationCache["gridHeader"+d.id];delete e._domRef;delete Ext.dd.DDM.ids[e.ddGroup]}if(g){g.destroy();delete g._domRef;delete Ext.dd.DDM.ids["gridSplitters"+d.id]}Ext.fly(j.innerHd).removeAllListeners();Ext.removeNode(j.innerHd);delete j.innerHd;Ext.destroy(j.el,j.mainWrap,j.mainHd,j.scroller,j.mainBody,j.focusEl,j.resizeMarker,j.resizeProxy,j.activeHdBtn,j._flyweight,i,g);delete a.container;if(i){i.destroy()}Ext.dd.DDM.currentTarget=null;delete Ext.dd.DDM.locationCache[d.id];Ext.EventManager.removeResizeListener(j.onWindowResize,j)},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.updateHeaderSortState()},this,{single:true})}}else{if(this.forceFit){this.fitColumns(true,false)}else{if(this.grid.autoExpandColumn){this.autoExpand(true)}}}this.grid.getGridEl().dom.innerHTML=this.renderUI();this.afterRenderUI()},initData:function(a,e){var b=this;if(b.ds){var d=b.ds;d.un("add",b.onAdd,b);d.un("load",b.onLoad,b);d.un("clear",b.onClear,b);d.un("remove",b.onRemove,b);d.un("update",b.onUpdate,b);d.un("datachanged",b.onDataChange,b);if(d!==a&&d.autoDestroy){d.destroy()}}if(a){a.on({scope:b,load:b.onLoad,add:b.onAdd,remove:b.onRemove,update:b.onUpdate,clear:b.onClear,datachanged:b.onDataChange})}if(b.cm){var c=b.cm;c.un("configchange",b.onColConfigChange,b);c.un("widthchange",b.onColWidthChange,b);c.un("headerchange",b.onHeaderChange,b);c.un("hiddenchange",b.onHiddenChange,b);c.un("columnmoved",b.onColumnMove,b)}if(e){delete b.lastViewWidth;e.on({scope:b,configchange:b.onColConfigChange,widthchange:b.onColWidthChange,headerchange:b.onHeaderChange,hiddenchange:b.onHiddenChange,columnmoved:b.onColumnMove})}b.ds=a;b.cm=e},onDataChange:function(){this.refresh(true);this.updateHeaderSortState();this.syncFocusEl(0)},onClear:function(){this.refresh();this.syncFocusEl(0)},onUpdate:function(b,a){this.refreshRow(a)},onAdd:function(b,a,c){this.insertRows(b,c,c+(a.length-1))},onRemove:function(b,a,c,d){if(d!==true){this.fireEvent("beforerowremoved",this,c,a)}this.removeRow(c);if(d!==true){this.processRows(c);this.applyEmptyText();this.fireEvent("rowremoved",this,c,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,c,b){this.indexMap=null;this.refresh(true);this.restoreScroll(this.getScrollState());this.afterMove(b);this.grid.fireEvent("columnmove",c,b)},onColConfigChange:function(){delete this.lastViewWidth;this.indexMap=null;this.refresh(true)},initUI:function(a){a.on("headerclick",this.onHeaderClick,this)},initEvents:Ext.emptyFn,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=this.findRowIndex(a);if(c!==false){this.addRowClass(c,this.rowOverCls)}},onRowOut:function(b,a){var c=this.findRowIndex(a);if(c!==false&&!b.within(this.getRow(c),true)){this.removeRowClass(c,this.rowOverCls)}},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")}},handleWheel:function(a){a.stopPropagation()},onColumnSplitterMoved:function(a,b){this.userResized=true;this.grid.colModel.setColumnWidth(a,b,true);if(this.forceFit){this.fitColumns(true,false,a);this.updateAllColumnWidths()}else{this.updateColumnWidth(a,b);this.syncHeaderScroll()}this.grid.fireEvent("columnresize",a,b)},beforeColMenuShow:function(){var b=this.cm,d=b.getColumnCount(),a=this.colMenu,c;a.removeAll();for(c=0;c<d;c++){if(b.config[c].hideable!==false){a.add(new Ext.menu.CheckItem({text:b.getColumnHeader(c),itemId:"col-"+b.getColumnId(c),checked:!b.isHidden(c),disabled:b.config[c].hideable===false,hideOnClick:false}))}}},handleHdMenuClick:function(c){var a=this.ds,b=this.cm.getDataIndex(this.hdCtxIndex);switch(c.getItemId()){case"asc":a.sort(b,"ASC");break;case"desc":a.sort(b,"DESC");break;default:this.handleHdMenuClickDefault(c)}return true},handleHdMenuClickDefault:function(c){var b=this.cm,d=c.getItemId(),a=b.getIndexById(d.substr(4));if(a!=-1){if(c.checked&&b.getColumnsBy(this.isHideableColumn,this).length<=1){this.onDenyColumnHide();return}b.setHidden(a,c.checked)}},handleHdDown:function(i,j){if(Ext.fly(j).hasClass("x-grid3-hd-btn")){i.stopEvent();var k=this.cm,g=this.findHeaderCell(j),h=this.getCellIndex(g),d=k.isSortable(h),c=this.hmenu,b=c.items,a=this.headerMenuOpenCls;this.hdCtxIndex=h;Ext.fly(g).addClass(a);b.get("asc").setDisabled(!d);b.get("desc").setDisabled(!d);c.on("hide",function(){Ext.fly(g).removeClass(a)},this,{single:true});c.show(j,"tl-bl?")}},handleHdMove:function(k){var i=this.findHeaderCell(this.activeHdRef);if(i&&!this.headersDisabled){var l=this.splitHandleWidth||5,j=this.activeHdRegion,p=i.style,m=this.cm,o="",g=k.getPageX();if(this.grid.enableColumnResize!==false){var a=this.activeHdIndex,b=this.getPreviousVisible(a),n=m.isResizable(a),c=b&&m.isResizable(b),d=g-j.left<=l,h=j.right-g<=(!this.activeHdBtn?l:2);if(d&&c){o=Ext.isAir?"move":Ext.isWebKit?"e-resize":"col-resize"}else{if(h&&n){o=Ext.isAir?"move":Ext.isWebKit?"w-resize":"col-resize"}}}p.cursor=o}},getPreviousVisible:function(a){while(a>0){if(!this.cm.isHidden(a-1)){return a}a--}return undefined},handleHdOver:function(c,b){var d=this.findHeaderCell(b);if(d&&!this.headersDisabled){var a=this.fly(d);this.activeHdRef=b;this.activeHdIndex=this.getCellIndex(d);this.activeHdRegion=a.getRegion();if(!this.isMenuDisabled(this.activeHdIndex,a)){a.addClass("x-grid3-hd-over");this.activeHdBtn=a.child(".x-grid3-hd-btn");if(this.activeHdBtn){this.activeHdBtn.dom.style.height=(d.firstChild.offsetHeight-1)+"px"}}}},handleHdOut:function(b,a){var c=this.findHeaderCell(a);if(c&&(!Ext.isIE||!b.within(c,true))){this.activeHdRef=null;this.fly(c).removeClass("x-grid3-hd-over");c.style.cursor=""}},isMenuDisabled:function(a,b){return this.cm.isMenuDisabled(a)},hasRows:function(){var a=this.mainBody.dom.firstChild;return a&&a.nodeType==1&&a.className!="x-grid-empty"},isHideableColumn:function(a){return !a.hidden},bind:function(a,b){this.initData(a,b)}});Ext.grid.GridView.SplitDragZone=Ext.extend(Ext.dd.DDProxy,{constructor:function(a,b){this.grid=a;this.view=a.getView();this.marker=this.view.resizeMarker;this.proxy=this.view.resizeProxy;Ext.grid.GridView.SplitDragZone.superclass.constructor.call(this,b,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.scroll=false;this.hw=this.view.splitHandleWidth||5},b4StartDrag:function(a,e){this.dragHeadersDisabled=this.view.headersDisabled;this.view.headersDisabled=true;var d=this.view.mainWrap.getHeight();this.marker.setHeight(d);this.marker.show();this.marker.alignTo(this.view.getHeaderCell(this.cellIndex),"tl-tl",[-2,0]);this.proxy.setHeight(d);var b=this.cm.getColumnWidth(this.cellIndex),c=Math.max(b-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(c,1000);this.setYConstraint(0,0);this.minX=a-c;this.maxX=a+1000;this.startPos=a;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,a,e)},allowHeaderDrag:function(a){return true},handleMouseDown:function(a){var h=this.view.findHeaderCell(a.getTarget());if(h&&this.allowHeaderDrag(a)){var k=this.view.fly(h).getXY(),c=k[0],i=a.getXY(),b=i[0],g=h.offsetWidth,d=false;if((b-c)<=this.hw){d=-1}else{if((c+g)-b<=this.hw){d=0}}if(d!==false){this.cm=this.grid.colModel;var j=this.view.getCellIndex(h);if(d==-1){if(j+d<0){return}while(this.cm.isHidden(j+d)){--d;if(j+d<0){return}}}this.cellIndex=j+d;this.split=h.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(a)}}}},endDrag:function(g){this.marker.hide();var a=this.view,c=Math.max(this.minX,g.getPageX()),d=c-this.startPos,b=this.dragHeadersDisabled;a.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+d);setTimeout(function(){a.headersDisabled=b},50)},autoOffset:function(){this.setDelta(0,0)}});Ext.grid.PivotGridView=Ext.extend(Ext.grid.GridView,{colHeaderCellCls:"grid-hd-group-cell",title:"",getColumnHeaders:function(){return this.grid.topAxis.buildHeaders()},getRowHeaders:function(){return this.grid.leftAxis.buildHeaders()},renderRows:function(a,t){var b=this.grid,o=b.extractData(),p=o.length,g=this.templates,s=b.renderer,h=typeof s=="function",w=this.getCellCls,n=typeof w=="function",d=g.cell,x=g.row,k=[],q={},c="width:"+this.getGridInnerWidth()+"px;",l,r,e,v,m;a=a||0;t=Ext.isDefined(t)?t:p-1;for(v=0;v<p;v++){m=o[v];r=m.length;l=[];for(var u=0;u<r;u++){q.id=v+"-"+u;q.css=u===0?"x-grid3-cell-first ":(u==(r-1)?"x-grid3-cell-last ":"");q.attr=q.cellAttr="";q.value=m[u];if(Ext.isEmpty(q.value)){q.value="&#160;"}if(h){q.value=s(q.value)}if(n){q.css+=w(q.value)+" "}l[l.length]=d.apply(q)}k[k.length]=x.apply({tstyle:c,cols:r,cells:l.join(""),alt:""})}return k.join("")},masterTpl:new Ext.Template('<div class="x-grid3 x-pivotgrid" hidefocus="true">','<div class="x-grid3-viewport">','<div class="x-grid3-header">','<div class="x-grid3-header-title"><span>{title}</span></div>','<div class="x-grid3-header-inner">','<div class="x-grid3-header-offset" style="{ostyle}"></div>',"</div>",'<div class="x-clear"></div>',"</div>",'<div class="x-grid3-scroller">','<div class="x-grid3-row-headers"></div>','<div class="x-grid3-body" style="{bstyle}">{body}</div>','<a href="#" class="x-grid3-focus" tabIndex="-1"></a>',"</div>","</div>",'<div class="x-grid3-resize-marker">&#160;</div>','<div class="x-grid3-resize-proxy">&#160;</div>',"</div>"),initTemplates:function(){Ext.grid.PivotGridView.superclass.initTemplates.apply(this,arguments);var a=this.templates||{};if(!a.gcell){a.gcell=new Ext.XTemplate('<td class="x-grid3-hd x-grid3-gcell x-grid3-td-{id} ux-grid-hd-group-row-{row} '+this.colHeaderCellCls+'" style="{style}">','<div {tooltip} class="x-grid3-hd-inner x-grid3-hd-{id}" unselectable="on" style="{istyle}">',this.grid.enableHdMenu?'<a class="x-grid3-hd-btn" href="#"></a>':"","{value}","</div>","</td>")}this.templates=a;this.hrowRe=new RegExp("ux-grid-hd-group-row-(\\d+)","")},initElements:function(){Ext.grid.PivotGridView.superclass.initElements.apply(this,arguments);this.rowHeadersEl=new Ext.Element(this.scroller.child("div.x-grid3-row-headers"));this.headerTitleEl=new Ext.Element(this.mainHd.child("div.x-grid3-header-title"))},getGridInnerWidth:function(){var a=Ext.grid.PivotGridView.superclass.getGridInnerWidth.apply(this,arguments);return a-this.getTotalRowHeaderWidth()},getTotalRowHeaderWidth:function(){var d=this.getRowHeaders(),c=d.length,b=0,a;for(a=0;a<c;a++){b+=d[a].width}return b},getTotalColumnHeaderHeight:function(){return this.getColumnHeaders().length*21},getCellIndex:function(b){if(b){var a=b.className.match(this.colRe),c;if(a&&(c=a[1])){return parseInt(c.split("-")[1],10)}}return false},renderUI:function(){var b=this.templates,a=this.getGridInnerWidth();return b.master.apply({body:b.body.apply({rows:"&#160;"}),ostyle:"width:"+a+"px",bstyle:"width:"+a+"px"})},onLayout:function(b,a){Ext.grid.PivotGridView.superclass.onLayout.apply(this,arguments);var b=this.getGridInnerWidth();this.resizeColumnHeaders(b);this.resizeAllRows(b)},refresh:function(b){this.fireEvent("beforerefresh",this);this.grid.stopEditing(true);var a=this.renderBody();this.mainBody.update(a).setWidth(this.getGridInnerWidth());if(b===true){this.updateHeaders();this.updateHeaderSortState()}this.processRows(0,true);this.layout();this.applyEmptyText();this.fireEvent("refresh",this)},renderHeaders:Ext.emptyFn,fitColumns:Ext.emptyFn,resizeColumnHeaders:function(b){var a=this.grid.topAxis;if(a.rendered){a.el.setWidth(b)}},resizeRowHeaders:function(){var a=this.getTotalRowHeaderWidth(),b=String.format("margin-left: {0}px;",a);this.rowHeadersEl.setWidth(a);this.mainBody.applyStyles(b);Ext.fly(this.innerHd).applyStyles(b);this.headerTitleEl.setWidth(a);this.headerTitleEl.setHeight(this.getTotalColumnHeaderHeight())},resizeAllRows:function(b){var d=this.getRows(),c=d.length,a;for(a=0;a<c;a++){Ext.fly(d[a]).setWidth(b);Ext.fly(d[a]).child("table").setWidth(b)}},updateHeaders:function(){this.renderGroupRowHeaders();this.renderGroupColumnHeaders()},renderGroupRowHeaders:function(){var a=this.grid.leftAxis;this.resizeRowHeaders();a.rendered=false;a.render(this.rowHeadersEl);this.setTitle(this.title)},setTitle:function(a){this.headerTitleEl.child("span").dom.innerHTML=a},renderGroupColumnHeaders:function(){var a=this.grid.topAxis;a.rendered=false;a.render(this.innerHd.firstChild)},isMenuDisabled:function(a,b){return true}});Ext.grid.PivotAxis=Ext.extend(Ext.Component,{orientation:"horizontal",defaultHeaderWidth:80,paddingWidth:7,setDimensions:function(a){this.dimensions=a},onRender:function(b,a){var c=this.orientation=="horizontal"?this.renderHorizontalRows():this.renderVerticalRows();this.el=Ext.DomHelper.overwrite(b.dom,{tag:"table",cn:c},true)},renderHorizontalRows:function(){var k=this.buildHeaders(),a=k.length,g=[],c,h,e,d,b;for(d=0;d<a;d++){c=[];h=k[d].items;e=h.length;for(b=0;b<e;b++){c.push({tag:"td",html:h[b].header,colspan:h[b].span})}g[d]={tag:"tr",cn:c}}return g},renderVerticalRows:function(){var b=this.buildHeaders(),k=b.length,a=[],m=[],h,c,l,g,e,d;for(e=0;e<k;e++){c=b[e];g=c.width||80;h=c.items.length;for(d=0;d<h;d++){l=c.items[d];a[l.start]=a[l.start]||[];a[l.start].push({tag:"td",html:l.header,rowspan:l.span,width:Ext.isBorderBox?g:g-this.paddingWidth})}}h=a.length;for(e=0;e<h;e++){m[e]={tag:"tr",cn:a[e]}}return m},getTuples:function(){var b=new Ext.data.Store({});b.data=this.store.data.clone();b.fields=this.store.fields;var l=[],a=this.dimensions,c=a.length,j;for(j=0;j<c;j++){l.push({field:a[j].dataIndex,direction:a[j].direction||"ASC"})}b.sort(l);var e=b.data.items,n=[],k=[],o,h,d,g,m;c=e.length;for(j=0;j<c;j++){d=this.getRecordInfo(e[j]);g=d.data;h="";for(m in g){h+=g[m]+"---"}if(n.indexOf(h)==-1){n.push(h);k.push(d)}}b.destroy();return k},getRecordInfo:function(a){var e=this.dimensions,d=e.length,h={},j,c,b;for(b=0;b<d;b++){j=e[b];c=j.dataIndex;h[c]=a.get(c)}var g=function(i){return function(k){for(var l in i){if(k.get(l)!=i[l]){return false}}return true}};return{data:h,matcher:g(h)}},buildHeaders:function(){var l=this.getTuples(),m=l.length,a=this.dimensions,e,r=a.length,c=[],o,s,n,q,p,b,k,h,g,d;for(g=0;g<r;g++){e=a[g];s=[];p=0;b=0;for(d=0;d<m;d++){o=l[d];k=d==(m-1);n=o.data[e.dataIndex];h=q!=undefined&&q!=n;if(g>0&&d>0){h=h||o.data[a[g-1].dataIndex]!=l[d-1].data[a[g-1].dataIndex]}if(h){s.push({header:q,span:p,start:b});b+=p;p=0}if(k){s.push({header:n,span:p+1,start:b});b+=p;p=0}q=n;p++}c.push({items:s,width:e.width||this.defaultHeaderWidth});q=undefined}return c}});Ext.grid.HeaderDragZone=Ext.extend(Ext.dd.DragZone,{maxDragWidth:120,constructor:function(a,c,b){this.grid=a;this.view=a.getView();this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDragZone.superclass.constructor.call(this,c);if(b){this.setHandleElId(Ext.id(c));this.setOuterHandleElId(Ext.id(b))}this.scroll=false},getDragData:function(c){var a=Ext.lib.Event.getTarget(c),b=this.view.findHeaderCell(a);if(b){return{ddel:b.firstChild,header:b}}return false},onInitDrag:function(a){this.dragHeadersDisabled=this.view.headersDisabled;this.view.headersDisabled=true;var b=this.dragData.ddel.cloneNode(true);b.id=Ext.id();b.style.width=Math.min(this.dragData.header.offsetWidth,this.maxDragWidth)+"px";this.proxy.update(b);return true},afterValidDrop:function(){this.completeDrop()},afterInvalidDrop:function(){this.completeDrop()},completeDrop:function(){var a=this.view,b=this.dragHeadersDisabled;setTimeout(function(){a.headersDisabled=b},50)}});Ext.grid.HeaderDropZone=Ext.extend(Ext.dd.DropZone,{proxyOffsets:[-4,-9],fly:Ext.Element.fly,constructor:function(a,c,b){this.grid=a;this.view=a.getView();this.proxyTop=Ext.DomHelper.append(document.body,{cls:"col-move-top",html:"&#160;"},true);this.proxyBottom=Ext.DomHelper.append(document.body,{cls:"col-move-bottom",html:"&#160;"},true);this.proxyTop.hide=this.proxyBottom.hide=function(){this.setLeftTop(-100,-100);this.setStyle("visibility","hidden")};this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDropZone.superclass.constructor.call(this,a.getGridEl().dom)},getTargetFromEvent:function(c){var a=Ext.lib.Event.getTarget(c),b=this.view.findCellIndex(a);if(b!==false){return this.view.getHeaderCell(b)}},nextVisible:function(c){var b=this.view,a=this.grid.colModel;c=c.nextSibling;while(c){if(!a.isHidden(b.getCellIndex(c))){return c}c=c.nextSibling}return null},prevVisible:function(c){var b=this.view,a=this.grid.colModel;c=c.prevSibling;while(c){if(!a.isHidden(b.getCellIndex(c))){return c}c=c.prevSibling}return null},positionIndicator:function(d,k,j){var a=Ext.lib.Event.getPageX(j),g=Ext.lib.Dom.getRegion(k.firstChild),c,i,b=g.top+this.proxyOffsets[1];if((g.right-a)<=(g.right-g.left)/2){c=g.right+this.view.borderWidth;i="after"}else{c=g.left;i="before"}if(this.grid.colModel.isFixed(this.view.getCellIndex(k))){return false}c+=this.proxyOffsets[0];this.proxyTop.setLeftTop(c,b);this.proxyTop.show();if(!this.bottomOffset){this.bottomOffset=this.view.mainHd.getHeight()}this.proxyBottom.setLeftTop(c,b+this.proxyTop.dom.offsetHeight+this.bottomOffset);this.proxyBottom.show();return i},onNodeEnter:function(d,a,c,b){if(b.header!=d){this.positionIndicator(b.header,d,c)}},onNodeOver:function(g,b,d,c){var a=false;if(c.header!=g){a=this.positionIndicator(c.header,g,d)}if(!a){this.proxyTop.hide();this.proxyBottom.hide()}return a?this.dropAllowed:this.dropNotAllowed},onNodeOut:function(d,a,c,b){this.proxyTop.hide();this.proxyBottom.hide()},onNodeDrop:function(b,m,g,c){var d=c.header;if(d!=b){var k=this.grid.colModel,j=Ext.lib.Event.getPageX(g),a=Ext.lib.Dom.getRegion(b.firstChild),o=(a.right-j)<=((a.right-a.left)/2)?"after":"before",i=this.view.getCellIndex(d),l=this.view.getCellIndex(b);if(o=="after"){l++}if(i<l){l--}k.moveColumn(i,l);return true}return false}});Ext.grid.GridView.ColumnDragZone=Ext.extend(Ext.grid.HeaderDragZone,{constructor:function(a,b){Ext.grid.GridView.ColumnDragZone.superclass.constructor.call(this,a,b,null);this.proxy.el.addClass("x-grid3-col-dd")},handleMouseDown:function(a){},callHandleMouseDown:function(a){Ext.grid.GridView.ColumnDragZone.superclass.handleMouseDown.call(this,a)}});Ext.grid.SplitDragZone=Ext.extend(Ext.dd.DDProxy,{fly:Ext.Element.fly,constructor:function(a,c,b){this.grid=a;this.view=a.getView();this.proxy=this.view.resizeProxy;Ext.grid.SplitDragZone.superclass.constructor.call(this,c,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.setHandleElId(Ext.id(c));this.setOuterHandleElId(Ext.id(b));this.scroll=false},b4StartDrag:function(a,d){this.view.headersDisabled=true;this.proxy.setHeight(this.view.mainWrap.getHeight());var b=this.cm.getColumnWidth(this.cellIndex);var c=Math.max(b-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(c,1000);this.setYConstraint(0,0);this.minX=a-c;this.maxX=a+1000;this.startPos=a;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,a,d)},handleMouseDown:function(c){var b=Ext.EventObject.setEvent(c);var a=this.fly(b.getTarget());if(a.hasClass("x-grid-split")){this.cellIndex=this.view.getCellIndex(a.dom);this.split=a.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(c){this.view.headersDisabled=false;var a=Math.max(this.minX,Ext.lib.Event.getPageX(c));var b=a-this.startPos;this.view.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+b)},autoOffset:function(){this.setDelta(0,0)}});Ext.grid.GridDragZone=function(b,a){this.view=b.getView();Ext.grid.GridDragZone.superclass.constructor.call(this,this.view.mainBody.dom,a);this.scroll=false;this.grid=b;this.ddel=document.createElement("div");this.ddel.className="x-grid-dd-wrap"};Ext.extend(Ext.grid.GridDragZone,Ext.dd.DragZone,{ddGroup:"GridDD",getDragData:function(b){var a=Ext.lib.Event.getTarget(b);var d=this.view.findRowIndex(a);if(d!==false){var c=this.grid.selModel;if(!c.isSelected(d)||b.hasModifier()){c.handleMouseDown(this.grid,d,b)}return{grid:this.grid,ddel:this.ddel,rowIndex:d,selections:c.getSelections()}}return false},onInitDrag:function(b){var a=this.dragData;this.ddel.innerHTML=this.grid.getDragDropText();this.proxy.update(this.ddel)},afterRepair:function(){this.dragging=false},getRepairXY:function(b,a){return false},onEndDrag:function(a,b){},onValidDrop:function(a,b,c){this.hideProxy()},beforeInvalidDrop:function(a,b){}});Ext.grid.ColumnModel=Ext.extend(Ext.util.Observable,{defaultWidth:100,defaultSortable:false,constructor:function(a){if(a.columns){Ext.apply(this,a);this.setConfig(a.columns,true)}else{this.setConfig(a,true)}this.addEvents("widthchange","headerchange","hiddenchange","columnmoved","configchange");Ext.grid.ColumnModel.superclass.constructor.call(this)},getColumnId:function(a){return this.config[a].id},getColumnAt:function(a){return this.config[a]},setConfig:function(d,b){var e,h,a;if(!b){delete this.totalWidth;for(e=0,a=this.config.length;e<a;e++){h=this.config[e];if(h.setEditor){h.setEditor(null)}}}this.defaults=Ext.apply({width:this.defaultWidth,sortable:this.defaultSortable},this.defaults);this.config=d;this.lookup={};for(e=0,a=d.length;e<a;e++){h=Ext.applyIf(d[e],this.defaults);if(Ext.isEmpty(h.id)){h.id=e}if(!h.isColumn){var g=Ext.grid.Column.types[h.xtype||"gridcolumn"];h=new g(h);d[e]=h}this.lookup[h.id]=h}if(!b){this.fireEvent("configchange",this)}},getColumnById:function(a){return this.lookup[a]},getIndexById:function(c){for(var b=0,a=this.config.length;b<a;b++){if(this.config[b].id==c){return b}}return -1},moveColumn:function(e,b){var a=this.config,d=a[e];a.splice(e,1);a.splice(b,0,d);this.dataMap=null;this.fireEvent("columnmoved",this,e,b)},getColumnCount:function(b){var d=this.config.length,e=0,a;if(b===true){for(a=0;a<d;a++){if(!this.isHidden(a)){e++}}return e}return d},getColumnsBy:function(g,e){var b=this.config,h=b.length,a=[],d,j;for(d=0;d<h;d++){j=b[d];if(g.call(e||this,j,d)===true){a[a.length]=j}}return a},isSortable:function(a){return !!this.config[a].sortable},isMenuDisabled:function(a){return !!this.config[a].menuDisabled},getRenderer:function(a){return this.config[a].renderer||Ext.grid.ColumnModel.defaultRenderer},getRendererScope:function(a){return this.config[a].scope},setRenderer:function(a,b){this.config[a].renderer=b},getColumnWidth:function(a){var b=this.config[a].width;if(typeof b!="number"){b=this.defaultWidth}return b},setColumnWidth:function(b,c,a){this.config[b].width=c;this.totalWidth=null;if(!a){this.fireEvent("widthchange",this,b,c)}},getTotalWidth:function(b){if(!this.totalWidth){this.totalWidth=0;for(var c=0,a=this.config.length;c<a;c++){if(b||!this.isHidden(c)){this.totalWidth+=this.getColumnWidth(c)}}}return this.totalWidth},getColumnHeader:function(a){return this.config[a].header},setColumnHeader:function(a,b){this.config[a].header=b;this.fireEvent("headerchange",this,a,b)},getColumnTooltip:function(a){return this.config[a].tooltip},setColumnTooltip:function(a,b){this.config[a].tooltip=b},getDataIndex:function(a){return this.config[a].dataIndex},setDataIndex:function(a,b){this.config[a].dataIndex=b},findColumnIndex:function(d){var e=this.config;for(var b=0,a=e.length;b<a;b++){if(e[b].dataIndex==d){return b}}return -1},isCellEditable:function(b,e){var d=this.config[b],a=d.editable;return !!(a||(!Ext.isDefined(a)&&d.editor))},getCellEditor:function(a,b){return this.config[a].getCellEditor(b)},setEditable:function(a,b){this.config[a].editable=b},isHidden:function(a){return !!this.config[a].hidden},isFixed:function(a){return !!this.config[a].fixed},isResizable:function(a){return a>=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 b=this.config.length,a=0;for(;a<b;a++){this.config[a].destroy()}delete this.config;delete this.lookup;this.purgeListeners()},setState:function(a,b){b=Ext.applyIf(b,this.defaults);Ext.apply(this.config[a],b)}});Ext.grid.ColumnModel.defaultRenderer=function(a){if(typeof a=="string"&&a.length<1){return"&#160;"}return a};Ext.grid.AbstractSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(){this.locked=false;Ext.grid.AbstractSelectionModel.superclass.constructor.call(this)},init:function(a){this.grid=a;if(this.lockOnInit){delete this.lockOnInit;this.locked=false;this.lock()}this.initEvents()},lock:function(){if(!this.locked){this.locked=true;var a=this.grid;if(a){a.getView().on({scope:this,beforerefresh:this.sortUnLock,refresh:this.sortLock})}else{this.lockOnInit=true}}},sortLock:function(){this.locked=true},sortUnLock:function(){this.locked=false},unlock:function(){if(this.locked){this.locked=false;var a=this.grid,b;if(a){b=a.getView();b.un("beforerefresh",this.sortUnLock,this);b.un("refresh",this.sortLock,this)}else{delete this.lockOnInit}}},isLocked:function(){return this.locked},destroy:function(){this.unlock();this.purgeListeners()}});Ext.grid.RowSelectionModel=Ext.extend(Ext.grid.AbstractSelectionModel,{singleSelect:false,constructor:function(a){Ext.apply(this,a);this.selections=new Ext.util.MixedCollection(false,function(b){return b.id});this.last=false;this.lastActive=false;this.addEvents("selectionchange","beforerowselect","rowselect","rowdeselect");Ext.grid.RowSelectionModel.superclass.constructor.call(this)},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:this.onKeyPress,down:this.onKeyPress,scope:this});this.grid.getView().on({scope:this,refresh:this.onRefresh,rowupdated:this.onRowUpdated,rowremoved:this.onRemove})},onKeyPress:function(g,b){var a=b=="up",h=a?"selectPrevious":"selectNext",d=a?-1:1,c;if(!g.shiftKey||this.singleSelect){this[h](false)}else{if(this.last!==false&&this.lastActive!==false){c=this.last;this.selectRange(this.last,this.lastActive+d);this.grid.getView().focusRow(this.lastActive);if(c!==false){this.last=c}}else{this.selectFirstRow()}}},onRefresh:function(){var g=this.grid.store,d=this.getSelections(),c=0,a=d.length,b,e;this.silent=true;this.clearSelections(true);for(;c<a;c++){e=d[c];if((b=g.indexOfId(e.id))!=-1){this.selectRow(b,true)}}if(d.length!=this.selections.getCount()){this.fireEvent("selectionchange",this)}this.silent=false},onRemove:function(a,b,c){if(this.selections.remove(c)!==false){this.fireEvent("selectionchange",this)}},onRowUpdated:function(a,b,c){if(this.isSelected(c)){a.onRowSelect(b)}},selectRecords:function(b,e){if(!e){this.clearSelections()}var d=this.grid.store,c=0,a=b.length;for(;c<a;c++){this.selectRow(d.indexOf(b[c]),true)}},getCount:function(){return this.selections.length},selectFirstRow:function(){this.selectRow(0)},selectLastRow:function(a){this.selectRow(this.grid.store.getCount()-1,a)},selectNext:function(a){if(this.hasNext()){this.selectRow(this.last+1,a);this.grid.getView().focusRow(this.last);return true}return false},selectPrevious:function(a){if(this.hasPrevious()){this.selectRow(this.last-1,a);this.grid.getView().focusRow(this.last);return true}return false},hasNext:function(){return this.last!==false&&(this.last+1)<this.grid.store.getCount()},hasPrevious:function(){return !!this.last},getSelections:function(){return[].concat(this.selections.items)},getSelected:function(){return this.selections.itemAt(0)},each:function(e,d){var c=this.getSelections(),b=0,a=c.length;for(;b<a;b++){if(e.call(d||this,c[b],b)===false){return false}}return true},clearSelections:function(a){if(this.isLocked()){return}if(a!==true){var c=this.grid.store,b=this.selections;b.each(function(d){this.deselectRow(c.indexOfId(d.id))},this);b.clear()}else{this.selections.clear()}this.last=false},selectAll:function(){if(this.isLocked()){return}this.selections.clear();for(var b=0,a=this.grid.store.getCount();b<a;b++){this.selectRow(b,true)}},hasSelection:function(){return this.selections.length>0},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;b++){this.selectRow(c[b],true)}},selectRange:function(b,a,d){var c;if(this.isLocked()){return}if(!d){this.clearSelections()}if(b<=a){for(c=b;c<=a;c++){this.selectRow(c,true)}}else{for(c=b;c>=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)}if(!this.silent){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)}},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,p=i.lastEdit,j=i.activeEditor,b=l.shiftKey,o,p,a,m;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(p.row-1,p.col,-1,this.acceptsNav,this)}else{h=i.walkCells(p.row+1,p.col,1,this.acceptsNav,this)}}}}if(h){a=h[0];m=h[1];this.onEditorSelect(a,p.row);if(i.isEditor&&i.editing){o=i.activeEditor;if(o&&o.field.triggerBlur){o.field.triggerBlur()}}i.startEditing(a,m)}},onEditorSelect:function(b,a){if(a!=b){this.selectRow(b)}},destroy:function(){Ext.destroy(this.rowNav);this.rowNav=null;Ext.grid.RowSelectionModel.superclass.destroy.call(this)}});Ext.grid.Column=Ext.extend(Ext.util.Observable,{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);this.addEvents("click","contextmenu","dblclick","mousedown");Ext.grid.Column.superclass.constructor.call(this)},processEvent:function(b,d,c,g,a){return this.fireEvent(b,this,c,g,d)},destroy:function(){if(this.setEditor){this.setEditor(null)}this.purgeListeners()},renderer:function(a){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:"&#160;",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.ActionColumn=Ext.extend(Ext.grid.Column,{header:"&#160;",actionIdRe:/x-action-col-(\d+)/,altText:"",constructor:function(b){var g=this,c=b.items||(g.items=[g]),a=c.length,d,e;Ext.grid.ActionColumn.superclass.constructor.call(g,b);g.renderer=function(h,i){h=Ext.isFunction(b.renderer)?b.renderer.apply(this,arguments)||"":"";i.css+=" x-action-col-cell";for(d=0;d<a;d++){e=c[d];h+='<img alt="'+(e.altText||g.altText)+'" src="'+(e.icon||Ext.BLANK_IMAGE_URL)+'" class="x-action-col-icon x-action-col-'+String(d)+" "+(e.iconCls||"")+" "+(Ext.isFunction(e.getClass)?e.getClass.apply(e.scope||this.scope||this,arguments):"")+'"'+((e.tooltip)?' ext:qtip="'+e.tooltip+'"':"")+" />"}return h}},destroy:function(){delete this.items;delete this.renderer;return Ext.grid.ActionColumn.superclass.destroy.apply(this,arguments)},processEvent:function(c,i,d,j,b){var a=i.getTarget().className.match(this.actionIdRe),h,g;if(a&&(h=this.items[parseInt(a[1],10)])){if(c=="click"){(g=h.handler||this.handler)&&g.call(h.scope||this.scope||this,d,j,b,h,i)}else{if((c=="mousedown")&&(h.stopSelection!==false)){return false}}}return Ext.grid.ActionColumn.superclass.processEvent.apply(this,arguments)}});Ext.grid.Column.types={gridcolumn:Ext.grid.Column,booleancolumn:Ext.grid.BooleanColumn,numbercolumn:Ext.grid.NumberColumn,datecolumn:Ext.grid.DateColumn,templatecolumn:Ext.grid.TemplateColumn,actioncolumn:Ext.grid.ActionColumn};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:'<div class="x-grid3-hd-checker">&#160;</div>',width:20,sortable:false,menuDisabled:true,fixed:true,hideable:false,dataIndex:"",id:"checker",isColumn:true,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(){Ext.fly(this.grid.getView().innerHd).on("mousedown",this.onHdMouseDown,this)},this)},processEvent:function(b,d,c,g,a){if(b=="mousedown"){this.onMouseDown(d,d.getTarget());return false}else{return Ext.grid.Column.prototype.processEvent.apply(this,arguments)}},onMouseDown:function(c,b){if(c.button===0&&b.className=="x-grid3-row-checker"){c.stopEvent();var d=c.getTarget(".x-grid3-row");if(d){var a=d.rowIndex;if(this.isSelected(a)){this.deselectRow(a)}else{this.selectRow(a,true);this.grid.getView().focusRow(a)}}}},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'<div class="x-grid3-row-checker">&#160;</div>'},onEditorSelect:function(b,a){if(a!=b&&!this.checkOnly){this.selectRow(b)}}});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.getKeyEvent(),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);this.destroyEditors(this.editors);this.destroyEditors(this.grid.customEditors)},destroyEditors:function(b){for(var a in b){Ext.destroy(b[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",cancelEditOnToggle:true,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('<div id="{groupId}" class="x-grid-group {cls}">','<div id="{groupId}-hd" class="x-grid-group-hd" style="{style}"><div class="x-grid-group-title">',this.groupTextTpl,"</div></div>",'<div id="{groupId}-bd" class="x-grid-group-body">')}this.startGroup.compile();if(!this.endGroup){this.endGroup="</div></div>"}},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.canGroup(),true)}},renderUI:function(){var a=Ext.grid.GroupingView.superclass.renderUI.call(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)}return a},processEvent:function(b,i){Ext.grid.GroupingView.superclass.processEvent.call(this,b,i);var h=i.getTarget(".x-grid-group-hd",this.mainBody);if(h){var g=this.getGroupField(),d=this.getPrefix(g),a=h.id.substring(d.length),c=new RegExp("gp-"+Ext.escapeRe(g)+"--hd");a=a.substr(0,a.length-3);if(a||c.test(h.id)){this.grid.fireEvent("group"+b,this.grid,g,a,i)}if(b=="mousedown"&&i.button==0){this.toggleGroup(h.parentNode)}}},onGroupByClick:function(){var a=this.grid;this.enableGrouping=true;a.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));a.fireEvent("groupchange",a,a.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),d=Ext.util.Format.htmlEncode(a.id);b=Ext.isDefined(b)?b:a.hasClass("x-grid-group-collapsed");if(this.state[d]!==b){if(this.cancelEditOnToggle!==false){this.grid.stopEditing(true)}this.state[d]=b;a[b?"removeClass":"addClass"]("x-grid-group-collapsed")}},toggleAllGroups:function(c){var b=this.getGroups();for(var d=0,a=b.length;d<a;d++){this.toggleGroup(b[d],c)}},expandAllGroups:function(){this.toggleAllGroups(true)},collapseAllGroups:function(){this.toggleAllGroups(false)},getGroup:function(a,e,i,j,b,h){var c=this.cm.config[b],d=i?i.call(c.scope,a,{},e,j,b,h):String(a);if(d===""||d==="&#160;"){d=c.emptyGroupText||this.emptyGroupText}return d},getGroupField:function(){return this.grid.store.getGroupState()},afterRender:function(){if(!this.ds||!this.cm){return}Ext.grid.GroupingView.superclass.afterRender.call(this);if(this.grid.deferRowRender){this.updateGroupWidths()}},afterRenderUI:function(){Ext.grid.GroupingView.superclass.afterRenderUI.call(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)}},renderRows:function(){var a=this.getGroupField();var e=!!a;if(this.hideGroupedColumn){var b=this.cm.findColumnIndex(a),d=Ext.isDefined(this.lastGroupField);if(!e&&d){this.mainBody.update("");this.cm.setHidden(this.cm.findColumnIndex(this.lastGroupField),false);delete this.lastGroupField}else{if(e&&!d){this.lastGroupField=a;this.cm.setHidden(b,true)}else{if(e&&d&&a!==this.lastGroupField){this.mainBody.update("");var c=this.cm.findColumnIndex(this.lastGroupField);this.cm.setHidden(c,false);this.lastGroupField=a;this.cm.setHidden(b,true)}}}}return Ext.grid.GroupingView.superclass.renderRows.apply(this,arguments)},doRender:function(c,h,q,a,p,s){if(h.length<1){return""}if(!this.canGroup()||this.isUpdating){return Ext.grid.GroupingView.superclass.doRender.apply(this,arguments)}var z=this.getGroupField(),o=this.cm.findColumnIndex(z),w,j="width:"+this.getTotalWidth()+";",e=this.cm.config[o],b=e.groupRenderer||e.renderer,t=this.showGroupName?(e.groupName||e.header)+": ":"",y=[],l,u,v,n;for(u=0,v=h.length;u<v;u++){var k=a+u,m=h[u],d=m.data[z];w=this.getGroup(d,m,b,k,o,q);if(!l||l.group!=w){n=this.constructId(d,z,o);this.state[n]=!(Ext.isDefined(this.state[n])?!this.state[n]:this.startCollapsed);l={group:w,gvalue:d,text:t+w,groupId:n,startRow:k,rs:[m],cls:this.state[n]?"":"x-grid-group-collapsed",style:j};y.push(l)}else{l.rs.push(m)}m._groupId=n}var x=[];for(u=0,v=y.length;u<v;u++){w=y[u];this.doGroupStart(x,w,c,q,p);x[x.length]=Ext.grid.GroupingView.superclass.doRender.call(this,c,w.rs,q,w.startRow,p,s);this.doGroupEnd(x,w,c,q,p)}return x.join("")},getGroupId:function(a){var b=this.getGroupField();return this.constructId(a,b,this.cm.findColumnIndex(b))},constructId:function(c,e,a){var b=this.cm.config[a],d=b.groupRenderer||b.renderer,g=(this.groupMode=="value")?c:this.getGroup(c,{data:{}},d,0,a,this.ds);return this.getPrefix(e)+Ext.util.Format.htmlEncode(g)},canGroup:function(){return this.enableGrouping&&!!this.getGroupField()},getPrefix:function(a){return this.grid.getGridEl().id+"-gp-"+a+"-"},doGroupStart:function(a,d,b,e,c){a[a.length]=this.startGroup.apply(d)},doGroupEnd:function(a,d,b,e,c){a[a.length]=this.endGroup},getRows:function(){if(!this.canGroup()){return Ext.grid.GroupingView.superclass.getRows.call(this)}var k=[],c=this.getGroups(),h,e=0,a=c.length,d,b;for(;e<a;++e){h=c[e].childNodes[1];if(h){h=h.childNodes;for(d=0,b=h.length;d<b;++d){k[k.length]=h[d]}}}return k},updateGroupWidths:function(){if(!this.canGroup()||!this.hasRows()){return}var c=Math.max(this.cm.getTotalWidth(),this.el.dom.offsetWidth-this.getScrollOffset())+"px";var b=this.getGroups();for(var d=0,a=b.length;d<a;d++){b[d].firstChild.style.width=c}},onColumnWidthUpdated:function(c,a,b){Ext.grid.GroupingView.superclass.onColumnWidthUpdated.call(this,c,a,b);this.updateGroupWidths()},onAllColumnWidthsUpdated:function(a,b){Ext.grid.GroupingView.superclass.onAllColumnWidthsUpdated.call(this,a,b);this.updateGroupWidths()},onColumnHiddenUpdated:function(b,c,a){Ext.grid.GroupingView.superclass.onColumnHiddenUpdated.call(this,b,c,a);this.updateGroupWidths()},onLayout:function(){this.updateGroupWidths()},onBeforeRowSelect:function(b,a){this.toggleRowIndex(a,true)}});Ext.grid.GroupingView.GROUP_ID=1000; \ No newline at end of file
+(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(k,m,l,r){var n=this,q,s,p;if(typeof k=="object"){r=k;for(q in r){s=r[q];if(!n.filterOptRe.test(q)){n.addListener(q,s.fn||s,s.scope||r.scope,s.fn?s:r)}}}else{k=k.toLowerCase();p=n.events[k]||g;if(typeof p=="boolean"){n.events[k]=p=new h.Event(n,k)}p.addListener(m,l,typeof r=="object"?r:{})}},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(),o=Array.prototype.slice.call(arguments,0);if(!k.tasks){k.tasks=[]}k.tasks.push(l);l.delay(p.delay||10,function(){k.tasks.remove(l);n.apply(m,o)},m)}}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<k;o++){m=p[o];if(m&&m.fireFn.apply(m.scope||q.obj||window,n)===i){return(q.firing=i)}}}q.firing=i;return g}}})();Ext.DomHelper=function(){var x=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,t=/td|tr|tbody/i,o=/([a-z0-9-]+)\s*:\s*([^;\s]+(?:\s*[^;\s]+)*);?/gi,v=/end/i,r,n="afterbegin",p="afterend",c="beforebegin",q="beforeend",a="<table>",i="</table>",b=a+"<tbody>",j="</tbody>"+i,l=b+"<tr>",w="</tr>"+j;function h(B,D,C,E,A,y){var z=r.insertHtml(E,Ext.getDom(B),u(D));return C?Ext.get(z,true):z}function u(D){var z="",y,C,B,E;if(typeof D=="string"){z=D}else{if(Ext.isArray(D)){for(var A=0;A<D.length;A++){if(D[A]){z+=u(D[A])}}}else{z+="<"+(D.tag=D.tag||"div");for(y in D){C=D[y];if(!d.test(y)){if(typeof C=="object"){z+=" "+y+'="';for(B in C){z+=B+":"+C[B]+";"}z+='"'}else{z+=" "+({cls:"class",htmlFor:"for"}[y]||y)+'="'+C+'"'}}}if(k.test(D.tag)){z+="/>"}else{z+=">";if((E=D.children||D.cn)){z+=u(E)}else{if(D.html){z+=D.html}}z+="</"+D.tag+">"}}}return z}function g(F,C,B,D){x.innerHTML=[C,B,D].join("");var y=-1,A=x,z;while(++y<F){A=A.firstChild}if(z=A.nextSibling){var E=document.createDocumentFragment();while(A){z=A.nextSibling;E.appendChild(A);A=z}A=E}return A}function e(y,z,B,A){var C,D;x=x||document.createElement("div");if(y=="td"&&(z==n||z==q)||!t.test(y)&&(z==c||z==p)){return}D=z==c?B:z==p?B.nextSibling:z==n?B.firstChild:null;if(z==c||z==p){B=B.parentNode}if(y=="td"||(y=="tr"&&(z==q||z==n))){C=g(4,l,A,w)}else{if((y=="tbody"&&(z==q||z==n))||(y=="tr"&&(z==c||z==p))){C=g(3,b,A,j)}else{C=g(2,a,A,i)}}B.insertBefore(C,D);return C}function s(A){var D=document.createElement("div"),y=document.createDocumentFragment(),z=0,B,C;D.innerHTML=A;C=D.childNodes;B=C.length;for(;z<B;z++){y.appendChild(C[z].cloneNode(true))}return y}r={markup:function(y){return u(y)},applyStyles:function(y,z){if(z){var A;y=Ext.fly(y);if(typeof z=="function"){z=z.call()}if(typeof z=="string"){o.lastIndex=0;while((A=o.exec(z))){y.setStyle(A[1],A[2])}}else{if(typeof z=="object"){y.setStyle(z)}}}},insertHtml:function(D,y,E){var B={},A,F,C,G,H,z;D=D.toLowerCase();B[c]=["BeforeBegin","previousSibling"];B[p]=["AfterEnd","nextSibling"];if(y.insertAdjacentHTML){if(m.test(y.tagName)&&(z=e(y.tagName.toLowerCase(),D,y,E))){return z}B[n]=["AfterBegin","firstChild"];B[q]=["BeforeEnd","lastChild"];if((A=B[D])){y.insertAdjacentHTML(A[0],E);return y[A[1]]}}else{F=y.ownerDocument.createRange();G="setStart"+(v.test(D)?"After":"Before");if(B[D]){F[G](y);if(!F.createContextualFragment){H=s(E)}else{H=F.createContextualFragment(E)}y.parentNode.insertBefore(H,D==c?y:y.nextSibling);return y[(D==c?"previous":"next")+"Sibling"]}else{C=(D==n?"first":"last")+"Child";if(y.firstChild){F[G](y[C]);if(!F.createContextualFragment){H=s(E)}else{H=F.createContextualFragment(E)}if(D==n){y.insertBefore(H,y.firstChild)}else{y.appendChild(H)}}else{y.innerHTML=E}return y[C]}}throw'Illegal insertion point -> "'+D+'"'},insertBefore:function(y,A,z){return h(y,A,z,c)},insertAfter:function(y,A,z){return h(y,A,z,p,"nextSibling")},insertFirst:function(y,A,z){return h(y,A,z,n,"firstChild")},append:function(y,A,z){return h(y,A,z,q,"",true)},overwrite:function(y,A,z){y=Ext.getDom(y);y.innerHTML=u(A);return z?Ext.get(y.firstChild):y.firstChild},createHtml:u};return r}();Ext.Template=function(h){var j=this,c=arguments,e=[],d;if(Ext.isArray(h)){h=h.join("")}else{if(c.length>1){for(var g=0,b=c.length;g<b;g++){d=c[g];if(typeof d=="object"){Ext.apply(j,d)}else{e.push(d)}}h=e.join("")}}j.html=h;if(j.compiled){j.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.DomQuery=function(){var cache={},simpleCache={},valueCache={},nonSpace=/\S/,trimRe=/^\s+|\s+$/g,tplRe=/\{(\d+)\}/g,modeRe=/^(\s?[\/>+~]\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;i<l;i++){a[a.length]=b[i]}return a}function byTag(cs,tagName){if(cs.tagName||cs==document){cs=[cs]}if(!tagName){return cs}var result=[],ri=-1;tagName=tagName.toLowerCase();for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType==1&&ci.tagName.toLowerCase()==tagName){result[++ri]=ci}}return result}function byId(cs,id){if(cs.tagName||cs==document){cs=[cs]}if(!id){return cs}var result=[],ri=-1;for(var i=0,ci;ci=cs[i];i++){if(ci&&ci.id==id){result[++ri]=ci;return result}}return result}function byAttribute(cs,attr,value,op,custom){var result=[],ri=-1,useGetStyle=custom=="{",fn=Ext.DomQuery.operators[op],a,xml,hasXml;for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType!=1){continue}if(!hasXml){xml=Ext.DomQuery.isXml(ci);hasXml=true}if(!xml){if(useGetStyle){a=Ext.DomQuery.getStyle(ci,attr)}else{if(attr=="class"||attr=="className"){a=ci.className}else{if(attr=="for"){a=ci.htmlFor}else{if(attr=="href"){a=ci.getAttribute("href",2)}else{a=ci.getAttribute(attr)}}}}}else{a=ci.getAttribute(attr)}if((fn&&fn(a,value))||(!fn&&a)){result[++ri]=ci}}return result}function byPseudo(cs,name,value){return Ext.DomQuery.pseudos[name](cs,value)}function nodupIEXml(cs){var d=++key,r;cs[0].setAttribute("_nodup",d);r=[cs[0]];for(var i=1,len=cs.length;i<len;i++){var c=cs[i];if(!c.getAttribute("_nodup")!=d){c.setAttribute("_nodup",d);r[r.length]=c}}for(var i=0,len=cs.length;i<len;i++){cs[i].removeAttribute("_nodup")}return r}function nodup(cs){if(!cs){return[]}var len=cs.length,c,i,r=cs,cj,ri=-1;if(!len||typeof cs.nodeType!="undefined"||len==1){return cs}if(isIE&&typeof cs[0].selectSingleNode!="undefined"){return nodupIEXml(cs)}var d=++key;cs[0]._nodup=d;for(i=1;c=cs[i];i++){if(c._nodup!=d){c._nodup=d}else{r=[];for(var j=0;j<i;j++){r[++ri]=cs[j]}for(j=i+1;cj=cs[j];j++){if(cj._nodup!=d){cj._nodup=d;r[++ri]=cj}}return r}}return r}function quickDiffIEXml(c1,c2){var d=++key,r=[];for(var i=0,len=c1.length;i<len;i++){c1[i].setAttribute("_qdiff",d)}for(var i=0,len=c2.length;i<len;i++){if(c2[i].getAttribute("_qdiff")!=d){r[r.length]=c2[i]}}for(var i=0,len=c1.length;i<len;i++){c1[i].removeAttribute("_qdiff")}return r}function quickDiff(c1,c2){var len1=c1.length,d=++key,r=[];if(!len1){return c2}if(isIE&&typeof c1[0].selectSingleNode!="undefined"){return quickDiffIEXml(c1,c2)}for(var i=0;i<len1;i++){c1[i]._qdiff=d}for(var i=0,len=c2.length;i<len;i++){if(c2[i]._qdiff!=d){r[r.length]=c2[i]}}return r}function quickId(ns,mode,root,id){if(ns==root){var d=root.ownerDocument||root;return d.getElementById(id)}ns=getNodes(ns,mode,"*");return byId(ns,id)}return{getStyle:function(el,name){return Ext.fly(el).getStyle(name)},compile:function(path,type){type=type||"select";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,lmode=path.match(modeRe);if(lmode&&lmode[1]){fn[fn.length]='mode="'+lmode[1].replace(trimRe,"")+'";';path=path.replace(lmode[1],"")}while(path.substr(0,1)=="/"){path=path.substr(1)}while(path&&lastPath!=path){lastPath=path;var tokenMatch=path.match(tagTokenRe);if(type=="select"){if(tokenMatch){if(tokenMatch[1]=="#"){fn[fn.length]='n = quickId(n, mode, root, "'+tokenMatch[2]+'");'}else{fn[fn.length]='n = getNodes(n, mode, "'+tokenMatch[2]+'");'}path=path.replace(tokenMatch[0],"")}else{if(path.substr(0,1)!="@"){fn[fn.length]='n = getNodes(n, mode, "*");'}}}else{if(tokenMatch){if(tokenMatch[1]=="#"){fn[fn.length]='n = byId(n, "'+tokenMatch[2]+'");'}else{fn[fn.length]='n = byTag(n, "'+tokenMatch[2]+'");'}path=path.replace(tokenMatch[0],"")}}while(!(modeMatch=path.match(modeRe))){var matched=false;for(var j=0;j<matchersLn;j++){var t=matchers[j];var m=path.match(t.re);if(m){fn[fn.length]=t.select.replace(tplRe,function(x,i){return m[i]});path=path.replace(m[0],"");matched=true;break}}if(!matched){throw'Error parsing selector, parsing failed at "'+path+'"'}}if(modeMatch[1]){fn[fn.length]='mode="'+modeMatch[1].replace(trimRe,"")+'";';path=path.replace(modeMatch[1],"")}}fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f},jsSelect:function(path,root,type){root=root||document;if(typeof root=="string"){root=document.getElementById(root)}var paths=path.split(","),results=[];for(var i=0,len=paths.length;i<len;i++){var subPath=paths[i].replace(trimRe,"");if(!cache[subPath]){cache[subPath]=Ext.DomQuery.compile(subPath);if(!cache[subPath]){throw subPath+" is not a valid selector"}}var result=cache[subPath](root);if(result&&result!=document){results=results.concat(result)}}if(paths.length>1){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?(["']?)(.*?)\4)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{5}", "{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=document;Ext.Element=function(l,m){var n=typeof l=="string"?h.getElementById(l):l,o;if(!n){return null}o=n.id;if(!m&&o&&Ext.elCache[o]){return Ext.elCache[o].el}this.dom=n;this.id=o||Ext.id(n)};var d=Ext.DomHelper,e=Ext.Element,a=Ext.elCache;e.prototype={set:function(q,m){var n=this.dom,l,p,m=(m!==false)&&!!n.setAttribute;for(l in q){if(q.hasOwnProperty(l)){p=q[l];if(l=="style"){d.applyStyles(n,p)}else{if(l=="cls"){n.className=p}else{if(m){n.setAttribute(l,p)}else{n[l]=p}}}}}return this},defaultUnit:"px",is:function(l){return Ext.DomQuery.is(this.dom,l)},focus:function(o,n){var l=this,n=n||l.dom;try{if(Number(o)){l.focus.defer(o,null,[null,n])}else{n.focus()}}catch(m){}return l},blur:function(){try{this.dom.blur()}catch(l){}return this},getValue:function(l){var m=this.dom.value;return l?parseInt(m,10):m},addListener:function(l,o,n,m){Ext.EventManager.on(this.dom,l,o,n||this,m);return this},removeListener:function(l,n,m){Ext.EventManager.removeListener(this.dom,l,n,m||this);return this},removeAllListeners:function(){Ext.EventManager.removeAll(this.dom);return this},purgeAllListeners:function(){Ext.EventManager.purgeElement(this,true);return this},addUnits:function(l){if(l===""||l=="auto"||l===undefined){l=l||""}else{if(!isNaN(l)||!i.test(l)){l=l+(this.defaultUnit||"px")}}return l},load:function(m,n,l){Ext.Ajax.request(Ext.apply({params:n,url:m.url||m,callback:l,el:this.dom,indicatorText:m.indicatorText||""},Ext.isObject(m)?m:{}));return this},isBorderBox:function(){return Ext.isBorderBox||Ext.isForcedBorderBox||g[(this.dom.tagName||"").toLowerCase()]},remove:function(){var l=this,m=l.dom;if(m){delete l.dom;Ext.removeNode(m)}},hover:function(m,l,o,n){var p=this;p.on("mouseenter",m,o||p.dom,n);p.on("mouseleave",l,o||p.dom,n);return p},contains:function(l){return !l?false:Ext.lib.Dom.isAncestor(this.dom,l.dom?l.dom:l)},getAttributeNS:function(m,l){return this.getAttribute(l,m)},getAttribute:(function(){var p=document.createElement("table"),o=false,m="getAttribute" in p,l=/undefined|unknown/;if(m){try{p.getAttribute("ext:qtip")}catch(n){o=true}return function(q,s){var r=this.dom,t;if(r.getAttributeNS){t=r.getAttributeNS(s,q)||null}if(t==null){if(s){if(o&&r.tagName.toUpperCase()=="TABLE"){try{t=r.getAttribute(s+":"+q)}catch(u){t=""}}else{t=r.getAttribute(s+":"+q)}}else{t=r.getAttribute(q)||r[q]}}return t||""}}else{return function(q,s){var r=this.om,u,t;if(s){t=r[s+":"+q];u=l.test(typeof t)?undefined:t}else{u=r[q]}return u||""}}p=null})(),update:function(l){if(this.dom){this.dom.innerHTML=l}return this}};var k=e.prototype;e.addMethods=function(l){Ext.apply(k,l)};k.on=k.addListener;k.un=k.removeListener;k.autoBoxAdjust=true;var i=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i,c;e.get=function(m){var l,p,o;if(!m){return null}if(typeof m=="string"){if(!(p=h.getElementById(m))){return null}if(a[m]&&a[m].el){l=a[m].el;l.dom=p}else{l=e.addToCache(new e(p))}return l}else{if(m.tagName){if(!(o=m.id)){o=Ext.id(m)}if(a[o]&&a[o].el){l=a[o].el;l.dom=m}else{l=e.addToCache(new e(m))}return l}else{if(m instanceof e){if(m!=c){if(Ext.isIE&&(m.id==undefined||m.id=="")){m.dom=m.dom}else{m.dom=h.getElementById(m.id)||m.dom}}return m}else{if(m.isComposite){return m}else{if(Ext.isArray(m)){return e.select(m)}else{if(m==h){if(!c){var n=function(){};n.prototype=e.prototype;c=new n();c.dom=h}return c}}}}}}return null};e.addToCache=function(l,m){m=m||l.id;a[m]={el:l,data:{},events:{}};return l};e.data=function(m,l,n){m=e.get(m);if(!m){return null}var o=a[m.id].data;if(arguments.length==2){return o[l]}else{return(o[l]=n)}};function j(){if(!Ext.enableGarbageCollector){clearInterval(e.collectorThreadId)}else{var l,n,q,p;for(l in a){p=a[l];if(p.skipGC){Ext.EventManager.removeFromSpecialCache(p.el);continue}n=p.el;q=n.dom;if(!q||!q.parentNode||(!q.offsetParent&&!h.getElementById(l))){if(Ext.enableListenerCollection){Ext.EventManager.removeAll(q)}delete a[l]}}if(Ext.isIE){var m={};for(l in a){m[l]=a[l]}a=Ext.elCache=m}}}e.collectorThreadId=setInterval(j,30000);var b=function(){};b.prototype=e.prototype;e.Flyweight=function(l){this.dom=l};e.Flyweight.prototype=new b();e.Flyweight.prototype.isFlyweight=true;e._flyweights={};e.fly=function(n,l){var m=null;l=l||"_global";if(n=Ext.getDom(n)){(e._flyweights[l]=e._flyweights[l]||new e.Flyweight()).dom=n;m=e._flyweights[l]}return m};Ext.get=e.get;Ext.fly=e.fly;var g=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko){g.button=1}})();Ext.Element.addMethods(function(){var d="parentNode",b="nextSibling",c="previousSibling",e=Ext.DomQuery,a=Ext.get;return{findParent:function(m,l,h){var j=this.dom,g=document.body,k=0,i;if(Ext.isGecko&&Object.prototype.toString.call(j)=="[object XULElement]"){return null}l=l||50;if(isNaN(l)){i=Ext.getDom(l);l=Number.MAX_VALUE}while(j&&j.nodeType==1&&k<l&&j!=g&&j!=i){if(e.is(j,m)){return h?a(j):j}k++;j=j.parentNode}return null},findParentNode:function(j,i,g){var h=Ext.fly(this.dom.parentNode,"_internal");return h?h.findParent(j,i,g):null},up:function(h,g){return this.findParentNode(h,g,true)},select:function(g){return Ext.Element.select(g,this.dom)},query:function(g){return e.select(g,this.dom)},child:function(g,h){var i=e.selectNode(g,this.dom);return h?i:a(i)},down:function(g,h){var i=e.selectNode(" > "+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(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.Element.addMethods(function(){var A=Ext.supports,h={},x=/(-[a-z])/gi,s=document.defaultView,D=/alpha\(opacity=(.*)\)/i,l=/^\s+|\s+$/g,B=Ext.Element,u=/\s+/,b=/\w/g,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",C="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},E=Ext.Element.data;function p(F,G){return G.charAt(1).toUpperCase()}function v(F){return h[F]||(h[F]=F=="float"?(A.cssFloat?"cssFloat":"styleFloat"):F.replace(x,p))}return{adjustWidth:function(F){var G=this;var H=(typeof F=="number");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=(typeof F=="number");if(H&&G.autoBoxAdjust&&!G.isBorderBox()){F-=(G.getBorderWidth("tb")+G.getPadding("tb"))}return(H&&F<0)?0:F},addClass:function(J){var K=this,I,F,H,G=[];if(!Ext.isArray(J)){if(typeof J=="string"&&!this.hasClass(J)){K.dom.className+=" "+J}}else{for(I=0,F=J.length;I<F;I++){H=J[I];if(typeof H=="string"&&(" "+K.dom.className+" ").indexOf(" "+H+" ")==-1){G.push(H)}}if(G.length){K.dom.className+=" "+G.join(" ")}}return K},removeClass:function(K){var L=this,J,G,F,I,H;if(!Ext.isArray(K)){K=[K]}if(L.dom&&L.dom.className){H=L.dom.className.replace(l,"").split(u);for(J=0,F=K.length;J<F;J++){I=K[J];if(typeof I=="string"){I=I.replace(l,"");G=H.indexOf(I);if(G!=-1){H.splice(G,1)}}}L.dom.className=H.join(" ")}return L},radioClass:function(I){var J=this.dom.parentNode.childNodes,G,H,F;I=Ext.isArray(I)?I:[I];for(H=0,F=J.length;H<F;H++){G=J[H];if(G&&G.nodeType==1){Ext.fly(G,"_internal").removeClass(I)}}return this.addClass(I)},toggleClass:function(F){return this.hasClass(F)?this.removeClass(F):this.addClass(F)},hasClass:function(F){return F&&(" "+this.dom.className+" ").indexOf(" "+F+" ")!=-1},replaceClass:function(G,F){return this.removeClass(G).addClass(F)},isStyle:function(F,G){return this.getStyle(F)==G},getStyle:function(){return s&&s.getComputedStyle?function(K){var I=this.dom,F,H,G,J;if(I==document){return null}K=v(K);G=(F=I.style[K])?F:(H=s.getComputedStyle(I,""))?H[K]:null;if(K=="marginRight"&&G!="0px"&&!A.correctRightMargin){J=I.style.display;I.style.display="inline-block";G=s.getComputedStyle(I,"").marginRight;I.style.display=J}if(K=="backgroundColor"&&G=="rgba(0, 0, 0, 0)"&&!A.correctTransparentColor){G="transparent"}return G}:function(J){var H=this.dom,F,G;if(H==document){return null}if(J=="opacity"){if(H.style.filter.match){if(F=H.style.filter.match(D)){var I=parseFloat(F[1]);if(!isNaN(I)){return I?I/100:0}}}return 1}J=v(J);return H.style[J]||((G=H.currentStyle)?G[J]:null)}}(),getColor:function(F,G,K){var I=this.getStyle(F),H=(typeof K!="undefined")?K:"#",J;if(!I||(/transparent|inherit/.test(I))){return G}if(/^r/.test(I)){Ext.each(I.slice(4,I.length-1).split(","),function(L){J=parseInt(L,10);H+=(J<16?"0":"")+J.toString(16)})}else{I=I.replace("#","");H+=I.length==3?I.replace(/^(\w)(\w)(\w)$/,"$1$1$2$2$3$3"):I}return(H.length>5?H.toLowerCase():G)},setStyle:function(I,H){var F,G;if(typeof I!="object"){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(G,F){var J=this,H=J.dom.style;if(!F||!J.anim){if(Ext.isIE9m){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.isIE9m){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.isIE9m&&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.isIE9m&&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,z);F.setStyle(n,z);F.setStyle(m,z)}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(M,L){var J=0,K=M.match(b),I,H,G,F=K.length;for(G=0;G<F;G++){I=K[G];H=I&&parseInt(this.getStyle(L[I]),10);if(H){J+=r.abs(H)}}return J},margins:a}}());(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({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.VISIBILITY=1;Ext.Element.DISPLAY=2;Ext.Element.OFFSETS=3;Ext.Element.ASCLASS=4;Ext.Element.visibilityCls="x-hide-nosize";Ext.Element.addMethods(function(){var e=Ext.Element,p="opacity",j="visibility",g="display",d="hidden",n="offsets",k="asclass",m="none",a="nosize",b="originalDisplay",c="visibilityMode",h="isVisible",i=e.data,l=function(r){var q=i(r,b);if(q===undefined){i(r,b,q="")}return q},o=function(r){var q=i(r,c);if(q===undefined){i(r,c,q=1)}return q};return{originalDisplay:"",visibilityMode:1,setVisibilityMode:function(q){i(this.dom,c,q);return this},animate:function(r,t,s,u,q){this.anim(r,{duration:t,callback:s,easing:u},q);return this},anim:function(t,u,r,w,s,q){r=r||"run";u=u||{};var v=this,x=Ext.lib.Anim[r](v.dom,t,(u.duration||w)||0.35,(u.easing||s)||"easeOut",function(){if(q){q.call(v)}if(u.callback){u.callback.call(u.scope||v,v,u)}},v);u.anim=x;return x},preanim:function(q,r){return !q[r]?false:(typeof q[r]=="object"?q[r]:{duration:q[r+1],callback:q[r+2],easing:q[r+3]})},isVisible:function(){var q=this,s=q.dom,r=i(s,h);if(typeof r=="boolean"){return r}r=!q.isStyle(j,d)&&!q.isStyle(g,m)&&!((o(s)==e.ASCLASS)&&q.hasClass(q.visibilityCls||e.visibilityCls));i(s,h,r);return r},setVisible:function(t,q){var w=this,r,y,x,v,u=w.dom,s=o(u);if(typeof q=="string"){switch(q){case g:s=e.DISPLAY;break;case j:s=e.VISIBILITY;break;case n:s=e.OFFSETS;break;case a:case k:s=e.ASCLASS;break}w.setVisibilityMode(s);q=false}if(!q||!w.anim){if(s==e.ASCLASS){w[t?"removeClass":"addClass"](w.visibilityCls||e.visibilityCls)}else{if(s==e.DISPLAY){return w.setDisplayed(t)}else{if(s==e.OFFSETS){if(!t){w.hideModeStyles={position:w.getStyle("position"),top:w.getStyle("top"),left:w.getStyle("left")};w.applyStyles({position:"absolute",top:"-10000px",left:"-10000px"})}else{w.applyStyles(w.hideModeStyles||{position:"",top:"",left:""});delete w.hideModeStyles}}else{w.fixDisplay();u.style.visibility=t?"visible":d}}}}else{if(t){w.setOpacity(0.01);w.setVisible(true)}w.anim({opacity:{to:(t?1:0)}},w.preanim(arguments,1),null,0.35,"easeIn",function(){t||w.setVisible(false).setOpacity(1)})}i(u,h,t);return w},hasMetrics:function(){var q=this.dom;return this.isVisible()||(o(q)==e.VISIBILITY)},toggle:function(q){var r=this;r.setVisible(!r.isVisible(),r.preanim(arguments,0));return r},setDisplayed:function(q){if(typeof q=="boolean"){q=q?l(this.dom):m}this.setStyle(g,q);return this},fixDisplay:function(){var q=this;if(q.isStyle(g,m)){q.setStyle(j,d);q.setStyle(g,l(this.dom));if(q.isStyle(g,m)){q.setStyle(g,"block")}}},hide:function(q){if(typeof q=="string"){this.setVisible(false,q);return this}this.setVisible(false,this.preanim(arguments,0));return this},show:function(q){if(typeof q=="string"){this.setVisible(true,q);return this}this.setVisible(true,this.preanim(arguments,0));return this}}}());(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<a;++c){g.push(e.transformElement(d[c]))}return e},invoke:function(g,b){var h=this,d=h.elements,a=d.length,j,c;for(c=0;c<a;c++){j=d[c];if(j){Ext.Element.prototype[g].apply(h.getElement(j),b)}}return h},item:function(b){var d=this,c=d.elements[b],a=null;if(c){a=d.getElement(c)}return a},addListener:function(b,j,h,g){var d=this.elements,a=d.length,c,k;for(c=0;c<a;c++){k=d[c];if(k){Ext.EventManager.on(k,b,j,h||k,g)}}return this},each:function(g,d){var h=this,c=h.elements,a=c.length,b,j;for(b=0;b<a;b++){j=c[b];if(j){j=this.getElement(j);if(g.call(d||j,j,h,b)===false){break}}}return h},fill:function(a){var b=this;b.elements=[];b.add(a);return b},filter:function(a){var b=[],d=this,c=Ext.isFunction(a)?a:function(e){return e.is(a)};d.each(function(h,e,g){if(c(h,g)!==false){b[b.length]=d.transformElement(h)}});d.elements=b;return d},indexOf:function(a){return this.elements.indexOf(this.transformElement(a))},replaceElement:function(e,c,a){var b=!isNaN(e)?e:this.indexOf(e),g;if(b>-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;Ext.CompositeElementLite.importElementMethods=function(){var c,b=Ext.Element.prototype,a=Ext.CompositeElementLite.prototype;for(c in b){if(typeof b[c]=="function"){(function(d){a[d]=a[d]||function(){return this.invoke(d,arguments)}}).call(a,c)}}};Ext.CompositeElementLite.importElementMethods();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;(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='<div class="loading-indicator">'+n.indicatorText+"</div>"}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:Ext.num(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.applyIf(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.util.JSON=new (function(){var useHasOwn=!!{}.hasOwnProperty,isNative=function(){var useNative=null;return function(){if(useNative===null){useNative=Ext.USE_NATIVE_JSON&&window.JSON&&JSON.toString()=="[object JSON]"}return useNative}}(),pad=function(n){return n<10?"0"+n:n},doDecode=function(json){return json?eval("("+json+")"):""},doEncode=function(o){if(!Ext.isDefined(o)||o===null){return"null"}else{if(Ext.isArray(o)){return encodeArray(o)}else{if(Ext.isDate(o)){return Ext.util.JSON.encodeDate(o)}else{if(Ext.isString(o)){return encodeString(o)}else{if(typeof o=="number"){return isFinite(o)?String(o):"null"}else{if(Ext.isBoolean(o)){return String(o)}else{var a=["{"],b,i,v;for(i in o){if(!o.getElementsByTagName){if(!useHasOwn||o.hasOwnProperty(i)){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(doEncode(i),":",v===null?"null":doEncode(v));b=true}}}}a.push("}");return a.join("")}}}}}}},m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},encodeString=function(s){if(/["\\\x00-\x1f]/.test(s)){return'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+s+'"'},encodeArray=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i<l;i+=1){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(v===null?"null":Ext.util.JSON.encode(v));b=true}}a.push("]");return a.join("")};this.encodeDate=function(o){return'"'+o.getFullYear()+"-"+pad(o.getMonth()+1)+"-"+pad(o.getDate())+"T"+pad(o.getHours())+":"+pad(o.getMinutes())+":"+pad(o.getSeconds())+'"'};this.encode=function(){var ec;return function(o){if(!ec){ec=isNative()?JSON.stringify:doEncode}return ec(o)}}();this.decode=function(){var dc;return function(json){if(!dc){dc=isNative()?JSON.parse:doDecode}return dc(json)}}()})();Ext.encode=Ext.util.JSON.encode;Ext.decode=Ext.util.JSON.decode;Ext.EventManager=function(){var z,p,j=false,l=Ext.isGecko||Ext.isWebKit||Ext.isSafari||Ext.isIE10p,o=Ext.lib.Event,q=Ext.lib.Dom,c=document,A=window,r="DOMContentLoaded",t="complete",g=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,u=[];function n(E){var H=false,D=0,C=u.length,F=false,G;if(E){if(E.getElementById||E.navigator){for(;D<C;++D){G=u[D];if(G.el===E){H=G.id;break}}if(!H){H=Ext.id(E);u.push({id:H,el:E});F=true}}else{H=Ext.id(E)}if(!Ext.elCache[H]){Ext.Element.addToCache(new Ext.Element(E),H);if(F){Ext.elCache[H].skipGC=true}}}return H}function m(E,G,J,F,D,L){E=Ext.getDom(E);var C=n(E),K=Ext.elCache[C].events,H;H=o.on(E,G,D);K[G]=K[G]||[];K[G].push([J,D,L,H,F]);if(E.addEventListener&&G=="mousewheel"){var I=["DOMMouseScroll",D,false];E.addEventListener.apply(E,I);Ext.EventManager.addListener(A,"unload",function(){E.removeEventListener.apply(E,I)})}if(E==c&&G=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.addListener(D)}}function d(){if(window!=top){return false}try{c.documentElement.doScroll("left")}catch(C){return false}b();return true}function B(C){if(Ext.isIE9m&&d()){return true}if(c.readyState==t){b();return true}j||(p=setTimeout(arguments.callee,2));return false}var k;function i(C){k||(k=Ext.query("style, link[rel=stylesheet]"));if(k.length==c.styleSheets.length){b();return true}j||(p=setTimeout(arguments.callee,2));return false}function y(C){c.removeEventListener(r,arguments.callee,false);i()}function b(C){if(!j){j=true;if(p){clearTimeout(p)}if(l){c.removeEventListener(r,b,false)}if(Ext.isIE9m&&B.bindIE){c.detachEvent("onreadystatechange",B)}o.un(A,"load",arguments.callee)}if(z&&!Ext.isReady){Ext.isReady=true;z.fire();z.listeners=[]}}function a(){z||(z=new Ext.util.Event());if(l){c.addEventListener(r,b,false)}if(Ext.isIE9m){if(!B()){B.bindIE=true;c.attachEvent("onreadystatechange",B)}}else{if(Ext.isOpera){(c.readyState==t&&i())||c.addEventListener(r,y,false)}else{if(Ext.isWebKit){B()}}}o.on(A,"load",b)}function x(C,D){return function(){var E=Ext.toArray(arguments);if(D.target==Ext.EventObject.setEvent(E[0]).target){C.apply(this,E)}}}function w(D,E,C){return function(F){C.delay(E.buffer,D,null,[new Ext.EventObjectImpl(F)])}}function s(G,F,C,E,D){return function(H){Ext.EventManager.removeListener(F,C,E,D);G(H)}}function e(D,E,C){return function(G){var F=new Ext.util.DelayedTask(D);if(!C.tasks){C.tasks=[]}C.tasks.push(F);F.delay(E.delay||10,D,null,[new Ext.EventObjectImpl(G)])}}function h(H,G,C,J,K){var D=(!C||typeof C=="boolean")?{}:C,E=Ext.getDom(H),F;J=J||D.fn;K=K||D.scope;if(!E){throw'Error listening for "'+G+'". Element "'+H+"\" doesn't exist."}function I(M){if(!Ext){return}M=Ext.EventObject.setEvent(M);var L;if(D.delegate){if(!(L=M.getTarget(D.delegate,E))){return}}else{L=M.target}if(D.stopEvent){M.stopEvent()}if(D.preventDefault){M.preventDefault()}if(D.stopPropagation){M.stopPropagation()}if(D.normalized===false){M=M.browserEvent}J.call(K||E,M,L,D)}if(D.target){I=x(I,D)}if(D.delay){I=e(I,D,J)}if(D.single){I=s(I,E,G,J,K)}if(D.buffer){F=new Ext.util.DelayedTask(I);I=w(I,D,F)}m(E,G,J,F,I,K);return I}var v={addListener:function(E,C,G,F,D){if(typeof C=="object"){var J=C,H,I;for(H in J){I=J[H];if(!g.test(H)){if(Ext.isFunction(I)){h(E,H,J,I,J.scope)}else{h(E,H,I)}}}}else{h(E,C,D,G,F)}},removeListener:function(E,I,M,N){E=Ext.getDom(E);var C=n(E),K=E&&(Ext.elCache[C].events)[I]||[],D,H,F,G,J,L;for(H=0,J=K.length;H<J;H++){if(Ext.isArray(L=K[H])&&L[0]==M&&(!N||L[2]==N)){if(L[4]){L[4].cancel()}G=M.tasks&&M.tasks.length;if(G){while(G--){M.tasks[G].cancel()}delete M.tasks}D=L[1];o.un(E,I,o.extAdapter?L[3]:D);if(D&&E.addEventListener&&I=="mousewheel"){E.removeEventListener("DOMMouseScroll",D,false)}if(D&&E==c&&I=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.removeListener(D)}K.splice(H,1);if(K.length===0){delete Ext.elCache[C].events[I]}for(G in Ext.elCache[C].events){return false}Ext.elCache[C].events={};return false}}},removeAll:function(E){E=Ext.getDom(E);var D=n(E),J=Ext.elCache[D]||{},M=J.events||{},I,H,K,F,L,G,C;for(F in M){if(M.hasOwnProperty(F)){I=M[F];for(H=0,K=I.length;H<K;H++){L=I[H];if(L[4]){L[4].cancel()}if(L[0].tasks&&(G=L[0].tasks.length)){while(G--){L[0].tasks[G].cancel()}delete L.tasks}C=L[1];o.un(E,F,o.extAdapter?L[3]:C);if(E.addEventListener&&C&&F=="mousewheel"){E.removeEventListener("DOMMouseScroll",C,false)}if(C&&E==c&&F=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.removeListener(C)}}}}if(Ext.elCache[D]){Ext.elCache[D].events={}}},getListeners:function(F,C){F=Ext.getDom(F);var H=n(F),D=Ext.elCache[H]||{},G=D.events||{},E=[];if(G&&G[C]){return G[C]}else{return null}},removeFromSpecialCache:function(E){var D=0,C=u.length;for(;D<C;++D){if(u[D].el==E){u.splice(D,1)}}},purgeElement:function(E,C,G){E=Ext.getDom(E);var D=n(E),J=Ext.elCache[D]||{},K=J.events||{},F,I,H;if(G){if(K&&K.hasOwnProperty(G)){I=K[G];for(F=0,H=I.length;F<H;F++){Ext.EventManager.removeListener(E,G,I[F][0])}}}else{Ext.EventManager.removeAll(E)}if(C&&E&&E.childNodes){for(F=0,H=E.childNodes.length;F<H;F++){Ext.EventManager.purgeElement(E.childNodes[F],C,G)}}},_unload:function(){var C;for(C in Ext.elCache){Ext.EventManager.removeAll(C)}delete Ext.elCache;delete Ext.Element._flyweights;var G,D,F,E=Ext.lib.Ajax;(typeof E.conn=="object")?D=E.conn:D={};for(F in D){G=D[F];if(G){E.abort({conn:G,tId:F})}}},onDocumentReady:function(E,D,C){if(Ext.isReady){z||(z=new Ext.util.Event());z.addListener(E,D,C);z.fire();z.listeners=[]}else{if(!z){a()}C=C||{};C.delay=C.delay||1;z.addListener(E,D,C)}},fireDocReady:b};v.on=v.addListener;v.un=v.removeListener;v.stoppedMouseDownEvent=new Ext.util.Event();return v}();Ext.onReady=Ext.EventManager.onDocumentReady;(function(){var a=function(){var c=document.body||document.getElementsByTagName("body")[0];if(!c){return false}var b=[];if(Ext.isIE){if(!Ext.isIE10p){b.push("ext-ie")}if(Ext.isIE6){b.push("ext-ie6")}else{if(Ext.isIE7){b.push("ext-ie7","ext-ie7m")}else{if(Ext.isIE8){b.push("ext-ie8","ext-ie8m")}else{if(Ext.isIE9){b.push("ext-ie9","ext-ie9m")}else{if(Ext.isIE10){b.push("ext-ie10")}}}}}}if(Ext.isGecko){if(Ext.isGecko2){b.push("ext-gecko2")}else{b.push("ext-gecko3")}}if(Ext.isOpera){b.push("ext-opera")}if(Ext.isWebKit){b.push("ext-webkit")}if(Ext.isSafari){b.push("ext-safari "+(Ext.isSafari2?"ext-safari2":(Ext.isSafari3?"ext-safari3":"ext-safari4")))}else{if(Ext.isChrome){b.push("ext-chrome")}}if(Ext.isMac){b.push("ext-mac")}if(Ext.isLinux){b.push("ext-linux")}if(Ext.isStrict||Ext.isBorderBox){var d=c.parentNode;if(d){if(!Ext.isStrict){Ext.fly(d,"_internal").addClass("x-quirks");if(Ext.isIE9m&&!Ext.isStrict){Ext.isIEQuirks=true}}Ext.fly(d,"_internal").addClass(((Ext.isStrict&&Ext.isIE)||(!Ext.enableForcedBoxModel&&!Ext.isIE))?" ext-strict":" ext-border-box")}}if(Ext.enableForcedBoxModel&&!Ext.isIE){Ext.isForcedBorderBox=true;b.push("ext-forced-border-box")}Ext.fly(c,"_internal").addClass(b);return true};if(!a()){Ext.onReady(a)}})();(function(){var b=Ext.apply(Ext.supports,{correctRightMargin:true,correctTransparentColor:true,cssFloat:true});var a=function(){var g=document.createElement("div"),e=document,c,d;g.innerHTML='<div style="height:30px;width:50px;"><div style="height:20px;width:20px;"></div></div><div style="float:left;background-color:transparent;">';e.body.appendChild(g);d=g.lastChild;if((c=e.defaultView)){if(c.getComputedStyle(g.firstChild.firstChild,null).marginRight!="0px"){b.correctRightMargin=false}if(c.getComputedStyle(d,null).backgroundColor!="transparent"){b.correctTransparentColor=false}}b.cssFloat=!!d.style.cssFloat;e.body.removeChild(g)};if(Ext.isReady){a()}else{Ext.onReady(a)}})();Ext.EventObject=function(){var b=Ext.lib.Event,c=/(dbl)?click/,a={3:13,63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35},d=Ext.isIE?{1:0,4:1,2:2}:{0:0,1:1,2:2};Ext.EventObjectImpl=function(g){if(g){this.setEvent(g.browserEvent||g)}};Ext.EventObjectImpl.prototype={setEvent:function(h){var g=this;if(h==g||(h&&h.browserEvent)){return h}g.browserEvent=h;if(h){g.button=h.button?d[h.button]:(h.which?h.which-1:-1);if(c.test(h.type)&&g.button==-1){g.button=0}g.type=h.type;g.shiftKey=h.shiftKey;g.ctrlKey=h.ctrlKey||h.metaKey||false;g.altKey=h.altKey;g.keyCode=h.keyCode;g.charCode=h.charCode;g.target=b.getTarget(h);g.xy=b.getXY(h)}else{g.button=-1;g.shiftKey=false;g.ctrlKey=false;g.altKey=false;g.keyCode=0;g.charCode=0;g.target=null;g.xy=[0,0]}return g},stopEvent:function(){var e=this;if(e.browserEvent){if(e.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(e)}b.stopEvent(e.browserEvent)}},preventDefault:function(){if(this.browserEvent){b.preventDefault(this.browserEvent)}},stopPropagation:function(){var e=this;if(e.browserEvent){if(e.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(e)}b.stopPropagation(e.browserEvent)}},getCharCode:function(){return this.charCode||this.keyCode},getKey:function(){return this.normalizeKey(this.keyCode||this.charCode)},normalizeKey:function(e){return Ext.isSafari?(a[e]||e):e},getPageX:function(){return this.xy[0]},getPageY:function(){return this.xy[1]},getXY:function(){return this.xy},getTarget:function(g,h,e){return g?Ext.fly(this.target).findParent(g,h,e):(e?Ext.get(this.target):this.target)},getRelatedTarget:function(){return this.browserEvent?b.getRelatedTarget(this.browserEvent):null},getWheelDelta:function(){var g=this.browserEvent;var h=0;if(g.wheelDelta){h=g.wheelDelta/120}else{if(g.detail){h=-g.detail/3}}return h},within:function(h,i,e){if(h){var g=this[i?"getRelatedTarget":"getTarget"]();return g&&((e?(g==Ext.getDom(h)):false)||Ext.fly(h).contains(g))}return false}};return new Ext.EventObjectImpl()}();Ext.Loader=Ext.apply({},{load:function(j,i,k,c){var k=k||this,g=document.getElementsByTagName("head")[0],b=document.createDocumentFragment(),a=j.length,h=0,e=this;var l=function(m){g.appendChild(e.buildScriptTag(j[m],d))};var d=function(){h++;if(a==h&&typeof i=="function"){i.call(k)}else{if(c===true){l(h)}}};if(c===true){l.call(this,0)}else{Ext.each(j,function(n,m){b.appendChild(this.buildScriptTag(n,d))},this);g.appendChild(b)}},buildScriptTag:function(b,c){var a=document.createElement("script");a.type="text/javascript";a.src=b;if(a.readyState){a.onreadystatechange=function(){if(a.readyState=="loaded"||a.readyState=="complete"){a.onreadystatechange=null;c()}}}else{a.onload=c}return a}});Ext.ns("Ext.grid","Ext.list","Ext.dd","Ext.tree","Ext.form","Ext.menu","Ext.state","Ext.layout.boxOverflow","Ext.app","Ext.ux","Ext.chart","Ext.direct","Ext.slider");Ext.apply(Ext,function(){var c=Ext,a=0,b=null;return{emptyFn:function(){},BLANK_IMAGE_URL:Ext.isIE6||Ext.isIE7||Ext.isAir?"http://www.extjs.com/s.gif":"data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",extendX:function(d,e){return Ext.extend(d,e(d.prototype))},getDoc:function(){return Ext.get(document)},num:function(e,d){e=Number(Ext.isEmpty(e)||Ext.isArray(e)||typeof e=="boolean"||(typeof e=="string"&&e.trim().length==0)?NaN:e);return isNaN(e)?d:e},value:function(g,d,e){return Ext.isEmpty(g,e)?d:g},escapeRe:function(d){return d.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},sequence:function(h,d,g,e){h[d]=h[d].createSequence(g,e)},addBehaviors:function(i){if(!Ext.isReady){Ext.onReady(function(){Ext.addBehaviors(i)})}else{var e={},h,d,g;for(d in i){if((h=d.split("@"))[1]){g=h[0];if(!e[g]){e[g]=Ext.select(g)}e[g].on(h[1],i[d])}}e=null}},getScrollBarWidth:function(g){if(!Ext.isReady){return 0}if(g===true||b===null){var i=Ext.getBody().createChild('<div class="x-hide-offsets" style="width:100px;height:50px;overflow:hidden;"><div style="height:200px;"></div></div>'),h=i.child("div",true);var e=h.offsetWidth;i.setStyle("overflow",(Ext.isWebKit||Ext.isGecko)?"auto":"scroll");var d=h.offsetWidth;i.remove();b=e-d+2}return b},combine:function(){var g=arguments,e=g.length,j=[];for(var h=0;h<e;h++){var d=g[h];if(Ext.isArray(d)){j=j.concat(d)}else{if(d.length!==undefined&&!d.substr){j=j.concat(Array.prototype.slice.call(d,0))}else{j.push(d)}}}return j},copyTo:function(d,e,g){if(typeof g=="string"){g=g.split(/[,;\s]/)}Ext.each(g,function(h){if(e.hasOwnProperty(h)){d[h]=e[h]}},this);return d},destroy:function(){Ext.each(arguments,function(d){if(d){if(Ext.isArray(d)){this.destroy.apply(this,d)}else{if(typeof d.destroy=="function"){d.destroy()}else{if(d.dom){d.remove()}}}}},this)},destroyMembers:function(l,j,g,h){for(var k=1,e=arguments,d=e.length;k<d;k++){Ext.destroy(l[e[k]]);delete l[e[k]]}},clean:function(d){var e=[];Ext.each(d,function(g){if(!!g){e.push(g)}});return e},unique:function(d){var e=[],g={};Ext.each(d,function(h){if(!g[h]){e.push(h)}g[h]=true});return e},flatten:function(d){var g=[];function e(h){Ext.each(h,function(i){if(Ext.isArray(i)){e(i)}else{g.push(i)}});return g}return e(d)},min:function(d,e){var g=d[0];e=e||function(i,h){return i<h?-1:1};Ext.each(d,function(h){g=e(g,h)==-1?g:h});return g},max:function(d,e){var g=d[0];e=e||function(i,h){return i>h?1:-1};Ext.each(d,function(h){g=e(g,h)==1?g:h});return g},mean:function(d){return d.length>0?Ext.sum(d)/d.length:undefined},sum:function(d){var e=0;Ext.each(d,function(g){e+=g});return e},partition:function(d,e){var g=[[],[]];Ext.each(d,function(j,k,h){g[(e&&e(j,k,h))||(!e&&j)?0:1].push(j)});return g},invoke:function(d,e){var h=[],g=Array.prototype.slice.call(arguments,2);Ext.each(d,function(j,k){if(j&&typeof j[e]=="function"){h.push(j[e].apply(j,g))}else{h.push(undefined)}});return h},pluck:function(d,g){var e=[];Ext.each(d,function(h){e.push(h[g])});return e},zip:function(){var n=Ext.partition(arguments,function(i){return typeof i!="function"}),k=n[0],m=n[1][0],d=Ext.max(Ext.pluck(k,"length")),h=[];for(var l=0;l<d;l++){h[l]=[];if(m){h[l]=m.apply(m,Ext.pluck(k,l))}else{for(var g=0,e=k.length;g<e;g++){h[l].push(k[g][l])}}}return h},getCmp:function(d){return Ext.ComponentMgr.get(d)},useShims:c.isIE6||(c.isMac&&c.isGecko2),type:function(e){if(e===undefined||e===null){return false}if(e.htmlElement){return"element"}var d=typeof e;if(d=="object"&&e.nodeName){switch(e.nodeType){case 1:return"element";case 3:return(/\S/).test(e.nodeValue)?"textnode":"whitespace"}}if(d=="object"||d=="function"){switch(e.constructor){case Array:return"array";case RegExp:return"regexp";case Date:return"date"}if(typeof e.length=="number"&&typeof e.item=="function"){return"nodelist"}}return d},intercept:function(h,d,g,e){h[d]=h[d].createInterceptor(g,e)},callback:function(d,h,g,e){if(typeof d=="function"){if(e){d.defer(e,h,g||[])}else{d.apply(h,g||[])}}}}}());Ext.apply(Function.prototype,{createSequence:function(b,a){var c=this;return(typeof b!="function")?this:function(){var d=c.apply(this||window,arguments);b.apply(a||this||window,arguments);return d}}});Ext.applyIf(String,{escape:function(a){return a.replace(/('|\\)/g,"\\$1")},leftPad:function(d,b,c){var a=String(d);if(!c){c=" "}while(a.length<b){a=c+a}return a}});String.prototype.toggle=function(b,a){return this==b?a:b};String.prototype.trim=function(){var a=/^\s+|\s+$/g;return function(){return this.replace(a,"")}}();Date.prototype.getElapsed=function(a){return Math.abs((a||new Date()).getTime()-this.getTime())};Ext.applyIf(Number.prototype,{constrain:function(b,a){return Math.min(Math.max(this,b),a)}});Ext.lib.Dom.getRegion=function(a){return Ext.lib.Region.getRegion(a)};Ext.lib.Region=function(d,g,a,c){var e=this;e.top=d;e[1]=d;e.right=g;e.bottom=a;e.left=c;e[0]=c};Ext.lib.Region.prototype={contains:function(b){var a=this;return(b.left>=a.left&&b.right<=a.right&&b.top>=a.top&&b.bottom<=a.bottom)},getArea:function(){var a=this;return((a.bottom-a.top)*(a.right-a.left))},intersect:function(h){var g=this,d=Math.max(g.top,h.top),e=Math.min(g.right,h.right),a=Math.min(g.bottom,h.bottom),c=Math.max(g.left,h.left);if(a>=d&&e>=c){return new Ext.lib.Region(d,e,a,c)}},union:function(h){var g=this,d=Math.min(g.top,h.top),e=Math.max(g.right,h.right),a=Math.max(g.bottom,h.bottom),c=Math.min(g.left,h.left);return new Ext.lib.Region(d,e,a,c)},constrainTo:function(b){var a=this;a.top=a.top.constrain(b.top,b.bottom);a.bottom=a.bottom.constrain(b.top,b.bottom);a.left=a.left.constrain(b.left,b.right);a.right=a.right.constrain(b.left,b.right);return a},adjust:function(d,c,a,g){var e=this;e.top+=d;e.left+=c;e.right+=g;e.bottom+=a;return e}};Ext.lib.Region.getRegion=function(e){var h=Ext.lib.Dom.getXY(e),d=h[1],g=h[0]+e.offsetWidth,a=h[1]+e.offsetHeight,c=h[0];return new Ext.lib.Region(d,g,a,c)};Ext.lib.Point=function(a,c){if(Ext.isArray(a)){c=a[1];a=a[0]}var b=this;b.x=b.right=b.left=b[0]=a;b.y=b.top=b.bottom=b[1]=c};Ext.lib.Point.prototype=new Ext.lib.Region();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;q<n;q++){c(j[q],k)}}else{if(typeof j=="string"){k=u.createTextNode(j)}else{k=u.createElement(j.tag||"div");p=!!k.setAttribute;for(var s in j){if(!b.test(s)){m=j[s];if(s=="cls"){k.className=m}else{if(p){k.setAttribute(s,m)}else{k[s]=m}}}}Ext.DomHelper.applyStyles(k,j.style);if((t=j.children||j.cn)){c(t,k)}else{if(j.html){k.innerHTML=j.html}}}}if(r){r.appendChild(k)}return k}e={createTemplate:function(k){var j=Ext.DomHelper.createHtml(k);return new Ext.Template(j)},useDom:false,insertBefore:function(j,l,k){return g(j,l,k,i)},insertAfter:function(j,l,k){return g(j,l,k,h,"nextSibling")},insertFirst:function(j,l,k){return g(j,l,k,a,"firstChild")},append:function(j,l,k){return g(j,l,k,d,"",true)},createDom:c};return e}());Ext.apply(Ext.Template.prototype,{disableFormats:false,re:/\{([\w\-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,argsRe:/^\s*['"](.*)["']\s*$/,compileARe:/\\/g,compileBRe:/(\r\n|\n)/g,compileCRe:/'/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=g.argsRe;k=k.split(",");for(var n=0,h=k.length;n<h;n++){k[n]=k[n].replace(o,"$1")}k=[b[l]].concat(k)}else{k=[b[l]]}return e[p].apply(e,k)}}else{return b[l]!==undefined?b[l]:""}}return g.html.replace(g.re,d)},compile:function(){var me=this,fm=Ext.util.Format,useF=me.disableFormats!==true,sep=Ext.isGecko?"+":",",body;function fn(m,name,format,args){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="(values['"+name+"'] == undefined ? '' : "}return"'"+sep+format+"values['"+name+"']"+args+")"+sep+"'"}if(Ext.isGecko){body="this.compiled = function(values){ return '"+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(me.compileARe,"\\\\").replace(me.compileBRe,"\\n").replace(me.compileCRe,"\\'").replace(me.re,fn));body.push("'].join('');};");body=body.join("")}eval(body);return me},call:function(c,b,a){return this[c](b,a)}});Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.util.Functions={createInterceptor:function(c,b,a){var d=c;if(!Ext.isFunction(b)){return c}else{return function(){var g=this,e=arguments;b.target=g;b.method=c;return(b.apply(a||g||window,e)!==false)?c.apply(g||window,e):null}}},createDelegate:function(c,d,b,a){if(!Ext.isFunction(c)){return c}return function(){var g=b||arguments;if(a===true){g=Array.prototype.slice.call(arguments,0);g=g.concat(b)}else{if(Ext.isNumber(a)){g=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(g,e)}}return c.apply(d||window,g)}},defer:function(d,c,e,b,a){d=Ext.util.Functions.createDelegate(d,e,b,a);if(c>0){return setTimeout(d,c)}d();return 0},createSequence:function(c,b,a){if(!Ext.isFunction(b)){return c}else{return function(){var d=c.apply(this||window,arguments);b.apply(a||this||window,arguments);return d}}}};Ext.defer=Ext.util.Functions.defer;Ext.createInterceptor=Ext.util.Functions.createInterceptor;Ext.createSequence=Ext.util.Functions.createSequence;Ext.createDelegate=Ext.util.Functions.createDelegate;Ext.apply(Ext.util.Observable.prototype,function(){function a(j){var i=(this.methodEvents=this.methodEvents||{})[j],d,c,g,h=this;if(!i){this.methodEvents[j]=i={};i.originalFn=this[j];i.methodName=j;i.before=[];i.after=[];var b=function(l,k,e){if((c=l.apply(k||h,e))!==undefined){if(typeof c=="object"){if(c.returnValue!==undefined){d=c.returnValue}else{d=c}g=!!c.cancel}else{if(c===false){g=true}else{d=c}}}};this[j]=function(){var l=Array.prototype.slice.call(arguments,0),k;d=c=undefined;g=false;for(var m=0,e=i.before.length;m<e;m++){k=i.before[m];b(k.fn,k.scope,l);if(g){return d}}if((c=i.originalFn.apply(h,l))!==undefined){d=c}for(var m=0,e=i.after.length;m<e;m++){k=i.after[m];b(k.fn,k.scope,l);if(g){return d}}return d}}return i}return{beforeMethod:function(d,c,b){a.call(this,d).before.push({fn:c,scope:b})},afterMethod:function(d,c,b){a.call(this,d).after.push({fn:c,scope:b})},removeMethodListener:function(j,g,d){var h=this.getMethodEvent(j);for(var c=0,b=h.before.length;c<b;c++){if(h.before[c].fn==g&&h.before[c].scope==d){h.before.splice(c,1);return}}for(var c=0,b=h.after.length;c<b;c++){if(h.after[c].fn==g&&h.after[c].scope==d){h.after.splice(c,1);return}}},relayEvents:function(j,e){var h=this;function g(i){return function(){return h.fireEvent.apply(h,[i].concat(Array.prototype.slice.call(arguments,0)))}}for(var d=0,b=e.length;d<b;d++){var c=e[d];h.events[c]=h.events[c]||true;j.on(c,g(c),h)}},enableBubble:function(e){var g=this;if(!Ext.isEmpty(e)){e=Ext.isArray(e)?e:Array.prototype.slice.call(arguments,0);for(var d=0,b=e.length;d<b;d++){var c=e[d];c=c.toLowerCase();var h=g.events[c]||true;if(typeof h=="boolean"){h=new Ext.util.Event(g,c);g.events[c]=h}h.bubble=true}}}}}());Ext.util.Observable.capture=function(c,b,a){c.fireEvent=c.fireEvent.createInterceptor(b,a)};Ext.util.Observable.observeClass=function(b,a){if(b){if(!b.fireEvent){Ext.apply(b,new Ext.util.Observable());Ext.util.Observable.capture(b.prototype,b.fireEvent,b)}if(typeof a=="object"){b.on(a)}return b}};Ext.apply(Ext.EventManager,function(){var d,k,g,b,a=Ext.lib.Dom,j=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,c=Ext.EventManager._unload,i=0,h=0,e=Ext.isWebKit?Ext.num(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1])>=525:!((Ext.isGecko&&!Ext.isWindows)||Ext.isOpera);return{_unload:function(){Ext.EventManager.un(window,"resize",this.fireWindowResize,this);c.call(Ext.EventManager)},doResizeEvent:function(){var m=a.getViewHeight(),l=a.getViewWidth();if(h!=m||i!=l){d.fire(i=l,h=m)}},onWindowResize:function(n,m,l){if(!d){d=new Ext.util.Event();k=new Ext.util.DelayedTask(this.doResizeEvent);Ext.EventManager.on(window,"resize",this.fireWindowResize,this)}d.addListener(n,m,l)},fireWindowResize:function(){if(d){k.delay(100)}},onTextResize:function(o,n,l){if(!g){g=new Ext.util.Event();var m=new Ext.Element(document.createElement("div"));m.dom.className="x-text-resize";m.dom.innerHTML="X";m.appendTo(document.body);b=m.dom.offsetHeight;setInterval(function(){if(m.dom.offsetHeight!=b){g.fire(b,b=m.dom.offsetHeight)}},this.textResizeInterval)}g.addListener(o,n,l)},removeResizeListener:function(m,l){if(d){d.removeListener(m,l)}},fireResize:function(){if(d){d.fire(a.getViewWidth(),a.getViewHeight())}},textResizeInterval:50,ieDeferSrc:false,getKeyEvent:function(){return e?"keydown":"keypress"},useKeydown:e}}());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)}});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+='<span id="'+id+'"></span>';Ext.lib.Event.onAvailable(id,function(){var DOC=document,hd=DOC.getElementsByTagName("head")[0],re=/(?:<script([^>]*)?>)((\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(/(?:<script.*?>)((\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(n<E){n=z?v.right:E}if(l+F>G+D){l=u?v.top-F:G+D-F}if(l<D){l=u?v.bottom:D}}return[n,l]},alignTo:function(c,a,e,b){var d=this;return d.setXY(d.getAlignToXY(c,a,e),d.preanim&&!!b?d.preanim(arguments,3):false)},adjustForConstraints:function(c,a,b){return this.getConstrainToXY(a||document,false,b,c)||c},getConstrainToXY:function(b,a,c,e){var d={top:0,left:0,bottom:0,right:0};return function(i,A,l,n){i=Ext.get(i);l=l?Ext.applyIf(l,d):d;var z,D,v=0,u=0;if(i.dom==document.body||i.dom==document){z=Ext.lib.Dom.getViewWidth();D=Ext.lib.Dom.getViewHeight()}else{z=i.dom.clientWidth;D=i.dom.clientHeight;if(!A){var t=i.getXY();v=t[0];u=t[1]}}var r=i.getScroll();v+=l.left+r.left;u+=l.top+r.top;z-=l.right;D-=l.bottom;var B=v+z,g=u+D,j=n||(!A?this.getXY():[this.getLeft(true),this.getTop(true)]),p=j[0],o=j[1],k=this.getConstrainOffset(),q=this.dom.offsetWidth+k,C=this.dom.offsetHeight+k;var m=false;if((p+q)>B){p=B-q;m=true}if((o+C)>g){o=g-C;m=true}if(p<v){p=v;m=true}if(o<u){o=u;m=true}return m?[p,o]:false}}(),getConstrainOffset:function(){return 0},getCenterXY:function(){return this.getAlignToXY(document,"c-c")},center:function(a){return this.alignTo(a||document,"c-c")}});Ext.Element.addMethods({select:function(a,b){return Ext.Element.select(a,b,this.dom)}});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.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>';Ext.Element.addMethods(function(){var a="_internal",b=/(\d+\.?\d+)px/;return{applyStyles:function(c){Ext.DomHelper.applyStyles(this.dom,c);return this},getStyles:function(){var c={};Ext.each(arguments,function(d){c[d]=this.getStyle(d)},this);return c},setOverflow:function(c){var d=this.dom;if(c=="auto"&&Ext.isMac&&Ext.isGecko2){d.style.overflow="hidden";(function(){d.style.overflow="auto"}).defer(1)}else{d.style.overflow=c}},boxWrap:function(c){c=c||"x-box";var d=Ext.get(this.insertHtml("beforeBegin","<div class='"+c+"'>"+String.format(Ext.Element.boxMarkup,c)+"</div>"));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).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)}}}}());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({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||u<m){p.scrollTop=u}else{if(q>j){p.scrollTop=q-a}}p.scrollTop=p.scrollTop;if(i!==false){if(h.offsetWidth>p.clientWidth||k<s){p.scrollLeft=k}else{if(d>n){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 false}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.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)}});Ext.CompositeElementLite.importElementMethods();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;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='<div class="loading-indicator">'+h.text+"</div>"}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:'<div class="loading-indicator">Loading...</div>',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()]},formatContainsHourInfo:(function(){var d=/(\\.)/g,c=/([gGhHisucUOPZ]|M\$)/;return function(e){return c.test(e.replace(d,""))}})(),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:"String.leftPad(this.getFullYear(), 4, '0')",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<d;++g){var j=k.charAt(g);h.push(j=="T"?"'T'":Date.getFormatCode(j))}return h.join(" + ")},U:"Math.round(this.getTime() / 1000)"},isValid:function(o,c,n,k,g,j,e){k=k||0;g=g||0;j=j||0;e=e||0;var l=new Date(o<100?100:o,c-1,n,k,g,j,e).add(Date.YEAR,o<100?o-100:0);return o==l.getFullYear()&&c==l.getMonth()+1&&n==l.getDate()&&k==l.getHours()&&g==l.getMinutes()&&j==l.getSeconds()&&e==l.getMilliseconds()},parseDate:function(d,g,c){var e=Date.parseFunctions;if(e[g]==null){Date.createParser(g)}return e[g](d,Ext.isDefined(c)?c:Date.useStrict)},getFormatCode:function(d){var c=Date.formatCodes[d];if(c){c=typeof c=="function"?c():c;Date.formatCodes[d]=c}return c||("'"+String.escape(d)+"'")},createFormat:function(h){var g=[],c=false,e="";for(var d=0;d<h.length;++d){e=h.charAt(d);if(!c&&e=="\\"){c=true}else{if(c){c=false;g.push("'"+String.escape(e)+"'")}else{g.push(Date.getFormatCode(e))}}}Date.formatFunctions[h]=new Function("return "+g.join("+"))},createParser:function(){var c=["var dt, y, m, d, h, i, s, ms, o, z, zz, u, v,","def = Date.defaults,","results = String(input).match(Date.parseRegexes[{0}]);","if(results){","{1}","if(u != null){","v = new Date(u * 1000);","}else{","dt = (new Date()).clearTime();","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()));","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){","v = new Date(y < 100 ? 100 : y, 0, 1, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0);","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 < 100 ? 100 : y, m, d, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0);","}","}","}","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,o=1,g=[],l=[],k=false,d="",j=0,h,n;for(;j<m.length;++j){d=m.charAt(j);if(!k&&d=="\\"){k=true}else{if(k){k=false;l.push(String.escape(d))}else{h=a(d,o);o+=h.g;l.push(h.s);if(h.g&&h.c){if(h.calcLast){n=h.c}else{g.push(h.c)}}}}}if(n){g.push(n)}Date.parseRegexes[e]=new RegExp("^"+l.join("")+"$","i");Date.parseFunctions[m]=new Function("input","strict",b(c,e,g.join("")))}}(),parseCodes:{d:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},j:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},D:function(){for(var c=[],d=0;d<7;c.push(Date.getShortDayName(d)),++d){}return{g:0,c:null,s:"(?:"+c.join("|")+")"}},l:function(){return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"}},N:{g:0,c:null,s:"[1-7]"},S:{g:0,c:null,s:"(?:st|nd|rd|th)"},w:{g:0,c:null,s:"[0-6]"},z:{g:1,c:"z = parseInt(results[{0}], 10);\n",s:"(\\d{1,3})"},W:{g:0,c:null,s:"(?:\\d{2})"},F:function(){return{g:1,c:"m = parseInt(Date.getMonthNumber(results[{0}]), 10);\n",s:"("+Date.monthNames.join("|")+")"}},M:function(){for(var c=[],d=0;d<12;c.push(Date.getShortMonthName(d)),++d){}return Ext.applyIf({s:"("+c.join("|")+")"},a("F"))},m:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{2})"},n:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{1,2})"},t:{g:0,c:null,s:"(?:\\d{2})"},L:{g:0,c:null,s:"(?:1|0)"},o:function(){return a("Y")},Y:{g:1,c:"y = parseInt(results[{0}], 10);\n",s:"(\\d{4})"},y:{g:1,c:"var ty = parseInt(results[{0}], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"},a:function(){return a("A")},A:{calcLast:true,g:1,c:"if (/(am)/i.test(results[{0}])) {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(AM|PM|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;g<d;++g){e.push(c[g].c)}return{g:1,c:e.join(""),s:[c[0].s,"(?:","-",c[1].s,"(?:","-",c[2].s,"(?:","(?:T| )?",c[3].s,":",c[4].s,"(?::",c[5].s,")?","(?:(?:\\.|,)(\\d+))?","(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?",")?",")?",")?"].join("")}},U:{g:1,c:"u = parseInt(results[{0}], 10);\n",s:"(-?\\d+)"}}})}());Ext.apply(Date.prototype,{dateFormat:function(a){if(Date.formatFunctions[a]==null){Date.createFormat(a)}return Date.formatFunctions[a].call(this)},getTimezone:function(){return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/,"$1$2").replace(/[^A-Z]/g,"")},getGMTOffset:function(a){return(this.getTimezoneOffset()>0?"-":"+")+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);c<a;e.setMonth(++c)){b+=e.getDaysInMonth()}return b+this.getDate()-1},getWeekOfYear:function(){var a=86400000,b=7*a;return function(){var d=Date.UTC(this.getFullYear(),this.getMonth(),this.getDate()+3)/a,c=Math.floor(d/7),e=new Date(c*b).getUTCFullYear();return c-Math.floor(Date.UTC(e,0,7)/b)+1}}(),isLeapYear:function(){var a=this.getFullYear();return !!((a&3)==0&&(a%100||(a%400==0&&a)))},getFirstDayOfMonth:function(){var a=(this.getDay()-(this.getDate()-1))%7;return(a<0)?(a+7):a},getLastDayOfMonth:function(){return this.getLastDateOfMonth().getDay()},getFirstDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),1)},getLastDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),this.getDaysInMonth())},getDaysInMonth:function(){var a=[31,28,31,30,31,30,31,31,30,31,30,31];return function(){var b=this.getMonth();return b==1&&this.isLeapYear()?29:a[b]}}(),getSuffix:function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}},clone:function(){return new Date(this.getTime())},isDST:function(){return new Date(this.getFullYear(),0,1).getTimezoneOffset()!=this.getTimezoneOffset()},clearTime:function(g){if(g){return this.clone().clearTime()}var b=this.getDate();this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);if(this.getDate()!=b){for(var a=1,e=this.add(Date.HOUR,a);e.getDate()!=b;a++,e=this.add(Date.HOUR,a)){}this.setDate(b);this.setHours(e.getHours())}return this},add:function(b,c){var e=this.clone();if(!b||c===0){return e}switch(b.toLowerCase()){case Date.MILLI:e.setMilliseconds(this.getMilliseconds()+c);break;case Date.SECOND:e.setSeconds(this.getSeconds()+c);break;case Date.MINUTE:e.setMinutes(this.getMinutes()+c);break;case Date.HOUR:e.setHours(this.getHours()+c);break;case Date.DAY:e.setDate(this.getDate()+c);break;case Date.MONTH:var a=this.getDate();if(a>28){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<a;d++){this.add(b[d])}}else{for(var c in e){if(this.allowFunctions||typeof e[c]!="function"){this.add(c,e[c])}}}},each:function(e,d){var b=[].concat(this.items);for(var c=0,a=b.length;c<a;c++){if(e.call(d||b[c],b[c],c,a)===false){break}}},eachKey:function(d,c){for(var b=0,a=this.keys.length;b<a;b++){d.call(c||window,this.keys[b],this.items[b],b,a)}},find:function(d,c){for(var b=0,a=this.items.length;b<a;b++){if(d.call(c||window,this.items[b],this.keys[b])){return this.items[b]}}return null},insert:function(a,b,c){if(arguments.length==2){c=arguments[1];b=this.getKey(c)}if(this.containsKey(b)){this.suspendEvents();this.removeKey(b);this.resumeEvents()}if(a>=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<this.length&&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;d<e;d++){h[h.length]={key:l[d],value:g[d],index:d}}h.sort(function(i,c){var m=j(i[k],c[k])*b;if(m===0){m=(i.index<c.index?-1:1)}return m});for(d=0,e=h.length;d<e;d++){g[d]=h[d].value;l[d]=h[d].key}this.fireEvent("sort",this)},sort:function(a,b){this._sort("value",a,b)},reorder:function(d){this.suspendEvents();var b=this.items,c=0,g=b.length,a=[],e=[],h;for(h in d){a[d[h]]=b[h]}for(c=0;c<g;c++){if(d[c]==undefined){e.push(b[c])}}for(c=0;c<g;c++){if(a[c]==undefined){a[c]=e.shift()}}this.clear();this.addAll(a);this.resumeEvents();this.fireEvent("sort",this)},keySort:function(a,b){this._sort("key",a,b||function(d,c){var g=String(d).toUpperCase(),e=String(c).toUpperCase();return g>e?1:(g<e?-1:0)})},getRange:function(e,a){var b=this.items;if(b.length<1){return[]}e=e||0;a=Math.min(typeof a=="undefined"?this.length-1:a,this.length-1);var c,d=[];if(e<=a){for(c=e;c<=a;c++){d[d.length]=b[c]}}else{for(c=e;c>=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<a;c++){if(g.call(e||this,d[c],b[c])){h.add(b[c],d[c])}}return h},findIndex:function(c,b,e,d,a){if(Ext.isEmpty(b,false)){return -1}b=this.createValueMatcher(b,d,a);return this.findIndexBy(function(g){return g&&b.test(g[c])},null,e)},findIndexBy:function(g,e,h){var b=this.keys,d=this.items;for(var c=(h||0),a=d.length;c<a;c++){if(g.call(e||this,d[c],b[c])){return c}}return -1},createValueMatcher:function(c,e,a,b){if(!c.exec){var d=Ext.escapeRe;c=String(c);if(e===true){c=d(c)}else{c="^"+d(c);if(b===true){c+="$"}}c=new RegExp(c,a?"":"i")}return c},clone:function(){var e=new Ext.util.MixedCollection();var b=this.keys,d=this.items;for(var c=0,a=d.length;c<a;c++){e.add(b[c],d[c])}e.getKey=this.getKey;return e}});Ext.util.MixedCollection.prototype.get=Ext.util.MixedCollection.prototype.item;Ext.AbstractManager=Ext.extend(Object,{typeName:"type",constructor:function(a){Ext.apply(this,a||{});this.all=new Ext.util.MixedCollection();this.types={}},get:function(a){return this.all.get(a)},register:function(a){this.all.add(a)},unregister:function(a){this.all.remove(a)},registerType:function(b,a){this.types[b]=a;a[this.typeName]=b},isRegistered:function(a){return this.types[a]!==undefined},create:function(a,d){var b=a[this.typeName]||a.type||d,c=this.types[b];if(c==undefined){throw new Error(String.format("The '{0}' type has not been registered with this manager",b))}return new c(a)},onAvailable:function(d,c,b){var a=this.all;a.on("add",function(e,g){if(g.id==d){c.call(b||g,g);a.un("add",c,b)}})}});Ext.util.Format=function(){var trimRe=/^\s+|\s+$/g,stripTagsRE=/<\/?[^>]+>/gi,stripScriptsRe=/(?:<script.*?>)((\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){if(!defaultValue&&defaultValue!==0){defaultValue=""}return value!==undefined&&value!==""?value:defaultValue},htmlEncode:function(value){return !value?value:String(value).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")},htmlDecode:function(value){return !value?value:String(value).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/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<psplit.length){v=v.toFixed(psplit[1].length)}else{if(2<psplit.length){throw ("NumberFormatException: invalid format, formats should have no more than 1 period: "+format)}else{v=v.toFixed(0)}}var fnum=v.toString();psplit=fnum.split(".");if(hasComma){var cnum=psplit[0],parr=[],j=cnum.length,m=Math.floor(j/3),n=cnum.length%3||3,i;for(i=0;i<j;i+=n){if(i!=0){n=3}parr[parr.length]=cnum.substr(i,n);m-=1}fnum=parr.join(comma);if(psplit[1]){fnum+=dec+psplit[1]}}else{if(psplit[1]){fnum=psplit[0]+dec+psplit[1]}}return(neg?"-":"")+format.replace(/[\d,?\.?]+/,fnum)},numberRenderer:function(format){return function(v){return Ext.util.Format.number(v,format)}},plural:function(v,s,p){return v+" "+(v==1?s:(p?p:s+"s"))},nl2br:function(v){return Ext.isEmpty(v)?"":v.replace(nl2brRe,"<br/>")}}}();Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var y=this,j=y.html,q=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,d=/^<tpl\b[^>]*?for="(.*?)"/,v=/^<tpl\b[^>]*?if="(.*?)"/,x=/^<tpl\b[^>]*?exec="(.*?)"/,r,p=0,k=[],o="values",w="parent",l="xindex",n="xcount",e="return ",c="with(values){ ";j=["<tpl>",j,"</tpl>"].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<g;e++){b[b.length]=m.compiled.call(h,l[e],j,e+1,g)}return b.join("")}return m.compiled.call(h,l,j,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<g;j++){try{this.cacheStyleSheet(k[j])}catch(l){}}}return d},getRule:function(e,h){var g=this.getRules(h);if(!Ext.isArray(e)){return g[e.toLowerCase()]}for(var j=0;j<e.length;j++){if(g[e[j]]){return g[e[j].toLowerCase()]}}return null},updateRule:function(e,j,h){if(!Ext.isArray(e)){var k=this.getRule(e);if(k){k.style[j.replace(b,a)]=h;return true}}else{for(var g=0;g<e.length;g++){if(this.updateRule(e[g],j,h)){return true}}}return false}}}();Ext.util.ClickRepeater=Ext.extend(Ext.util.Observable,{constructor:function(b,a){this.el=Ext.get(b);this.el.unselectable();Ext.apply(this,a);this.addEvents("mousedown","click","mouseup");if(!this.disabled){this.disabled=true;this.enable()}if(this.handler){this.on("click",this.handler,this.scope||this)}Ext.util.ClickRepeater.superclass.constructor.call(this)},interval:20,delay:250,preventDefault:true,stopDefault:false,timer:0,enable:function(){if(this.disabled){this.el.on("mousedown",this.handleMouseDown,this);if(Ext.isIE){this.el.on("dblclick",this.handleDblClick,this)}if(this.preventDefault||this.stopDefault){this.el.on("click",this.eventOptions,this)}}this.disabled=false},disable:function(a){if(a||!this.disabled){clearTimeout(this.timer);if(this.pressClass){this.el.removeClass(this.pressClass)}Ext.getDoc().un("mouseup",this.handleMouseUp,this);this.el.removeAllListeners()}this.disabled=true},setDisabled:function(a){this[a?"disable":"enable"]()},eventOptions:function(a){if(this.preventDefault){a.preventDefault()}if(this.stopDefault){a.stopEvent()}},destroy:function(){this.disable(true);Ext.destroy(this.el);this.purgeListeners()},handleDblClick:function(a){clearTimeout(this.timer);this.el.blur();this.fireEvent("mousedown",this,a);this.fireEvent("click",this,a)},handleMouseDown:function(a){clearTimeout(this.timer);this.el.blur();if(this.pressClass){this.el.addClass(this.pressClass)}this.mousedownTime=new Date();Ext.getDoc().on("mouseup",this.handleMouseUp,this);this.el.on("mouseout",this.handleMouseOut,this);this.fireEvent("mousedown",this,a);this.fireEvent("click",this,a);if(this.accelerate){this.delay=400}this.timer=this.click.defer(this.delay||this.interval,this,[a])},click:function(a){this.fireEvent("click",this,a);this.timer=this.click.defer(this.accelerate?this.easeOutExpo(this.mousedownTime.getElapsed(),400,-390,12000):this.interval,this,[a])},easeOutExpo:function(e,a,h,g){return(e==g)?a+h:h*(-Math.pow(2,-10*e/g)+1)+a},handleMouseOut:function(){clearTimeout(this.timer);if(this.pressClass){this.el.removeClass(this.pressClass)}this.el.on("mouseover",this.handleMouseReturn,this)},handleMouseReturn:function(){this.el.un("mouseover",this.handleMouseReturn,this);if(this.pressClass){this.el.addClass(this.pressClass)}this.click()},handleMouseUp:function(a){clearTimeout(this.timer);this.el.un("mouseover",this.handleMouseReturn,this);this.el.un("mouseout",this.handleMouseOut,this);Ext.getDoc().un("mouseup",this.handleMouseUp,this);this.el.removeClass(this.pressClass);this.fireEvent("mouseup",this,a)}});Ext.KeyNav=function(b,a){this.el=Ext.get(b);Ext.apply(this,a);if(!this.disabled){this.disabled=true;this.enable()}};Ext.KeyNav.prototype={disabled:false,defaultEventAction:"stopEvent",forceKeyDown:false,relay:function(c){var a=c.getKey(),b=this.keyToHandler[a];if(b&&this[b]){if(this.doRelay(c,this[b],b)!==true){c[this.defaultEventAction]()}}},doRelay:function(c,b,a){return b.call(this.scope||this,c,a)},enter:false,left:false,right:false,up:false,down:false,tab:false,esc:false,pageUp:false,pageDown:false,del:false,home:false,end:false,space:false,keyToHandler:{37:"left",39:"right",38:"up",40:"down",33:"pageUp",34:"pageDown",46:"del",36:"home",35:"end",13:"enter",27:"esc",9:"tab",32:"space"},stopKeyUp:function(b){var a=b.getKey();if(a>=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;c<d;c++){h.push(e.charCodeAt(c))}k=h}var a=Ext.isArray(k);var i=function(o){if(this.checkModifiers(b,o)){var m=o.getKey();if(a){for(var n=0,j=k.length;n<j;n++){if(k[n]==m){if(this.stopEvent){o.stopEvent()}g.call(l||window,m,o);return}}}else{if(m==k){if(this.stopEvent){o.stopEvent()}g.call(l||window,m,o)}}}};this.bindings.push(i)},checkModifiers:function(b,h){var j,d,g=["shift","ctrl","alt"];for(var c=0,a=g.length;c<a;++c){d=g[c];j=b[d];if(!(j===undefined||(j===h[d+"Key"]))){return false}}return true},on:function(b,d,c){var h,a,e,g;if(typeof b=="object"&&!Ext.isArray(b)){h=b.key;a=b.shift;e=b.ctrl;g=b.alt}else{h=b}this.addBinding({key:h,shift:a,ctrl:e,alt:g,fn:d,scope:c})},handleKeyDown:function(g){if(this.enabled){var c=this.bindings;for(var d=0,a=c.length;d<a;d++){c[d].call(this,g)}}},isEnabled:function(){return this.enabled},enable:function(){if(!this.enabled){this.el.on(this.eventName,this.handleKeyDown,this);this.enabled=true}},disable:function(){if(this.enabled){this.el.removeListener(this.eventName,this.handleKeyDown,this);this.enabled=false}},setDisabled:function(a){this[a?"disable":"enable"]()}};Ext.util.TextMetrics=function(){var a;return{measure:function(b,c,d){if(!a){a=Ext.util.TextMetrics.Instance(b,d)}a.bind(b);a.setFixedWidth(d||"auto");return a.getSize(c)},createInstance:function(b,c){return Ext.util.TextMetrics.Instance(b,c)}}}();Ext.util.TextMetrics.Instance=function(b,d){var c=new Ext.Element(document.createElement("div"));document.body.appendChild(c.dom);c.position("absolute");c.setLeftTop(-1000,-1000);c.hide();if(d){c.setWidth(d)}var a={getSize:function(g){c.update(g);var e=c.getSize();c.update("");return e},bind:function(e){c.setStyle(Ext.fly(e).getStyles("font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"))},setFixedWidth:function(e){c.setWidth(e)},getWidth:function(e){c.dom.style.width="auto";return this.getSize(e).width},getHeight:function(e){return this.getSize(e).height}};a.bind(b);return a};Ext.Element.addMethods({getTextWidth:function(c,b,a){return(Ext.util.TextMetrics.measure(this.dom,Ext.value(c,this.dom.innerHTML,true)).width).constrain(b||0,a||1000000)}});Ext.util.Cookies={set:function(c,e){var a=arguments;var i=arguments.length;var b=(i>2)?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<a){c=e+g;if(document.cookie.substring(e,c)==b){return Ext.util.Cookies.getCookieVal(c)}e=document.cookie.indexOf(" ",e)+1;if(e===0){break}}return null},clear:function(a){if(Ext.util.Cookies.get(a)){document.cookie=a+"=; expires=Thu, 01-Jan-70 00:00:01 GMT"}},getCookieVal:function(b){var a=document.cookie.indexOf(";",b);if(a==-1){a=document.cookie.length}return unescape(document.cookie.substring(b,a))}};Ext.handleError=function(a){throw a};Ext.Error=function(a){this.message=(this.lang[a])?this.lang[a]:a};Ext.Error.prototype=new Error();Ext.apply(Ext.Error.prototype,{lang:{},name:"Ext.Error",getName:function(){return this.name},getMessage:function(){return this.message},toJson:function(){return Ext.encode(this)}});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(g,e,d){c.on("add",function(h,i){if(i.id==g){e.call(d||i,i);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,g){var d=a[e.ptype||g];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;c<a;c++){this.plugins[c]=this.initPlugin(this.plugins[c])}}else{this.plugins=this.initPlugin(this.plugins)}}if(this.stateful!==false){this.initState()}if(this.applyTo){this.applyToMarkup(this.applyTo);delete this.applyTo}else{if(this.renderTo){this.render(this.renderTo);delete this.renderTo}}};Ext.Component.AUTO_ID=1000;Ext.extend(Ext.Component,Ext.util.Observable,{disabled:false,hidden:false,autoEl:"div",disabledClass:"x-item-disabled",allowDomMove:true,autoShow:false,hideMode:"display",hideParent:false,rendered:false,tplWriteMode:"overwrite",bubbleEvents:[],ctype:"Ext.Component",actionMode:"el",getActionEl:function(){return this[this.actionMode]},initPlugin:function(a){if(a.ptype&&!Ext.isFunction(a.init)){a=Ext.ComponentMgr.createPlugin(a)}else{if(Ext.isString(a)){a=Ext.ComponentMgr.createPlugin({ptype:a})}}a.init(this);return a},initComponent:function(){if(this.listeners){this.on(this.listeners);delete this.listeners}this.enableBubble(this.bubbleEvents)},render:function(b,a){if(!this.rendered&&this.fireEvent("beforerender",this)!==false){if(!b&&this.el){this.el=Ext.get(this.el);b=this.el.dom.parentNode;this.allowDomMove=false}this.container=Ext.get(b);if(this.ctCls){this.container.addClass(this.ctCls)}this.rendered=true;if(a!==undefined){if(Ext.isNumber(a)){a=this.container.dom.childNodes[a]}else{a=Ext.getDom(a)}}this.onRender(this.container,a||null);if(this.autoShow){this.el.removeClass(["x-hidden","x-hide-"+this.hideMode])}if(this.cls){this.el.addClass(this.cls);delete this.cls}if(this.style){this.el.applyStyles(this.style);delete this.style}if(this.overCls){this.el.addClassOnOver(this.overCls)}this.fireEvent("render",this);var c=this.getContentTarget();if(this.html){c.update(Ext.DomHelper.markup(this.html));delete this.html}if(this.contentEl){var d=Ext.getDom(this.contentEl);Ext.fly(d).removeClass(["x-hidden","x-hide-display"]);c.appendChild(d)}if(this.tpl){if(!this.tpl.compile){this.tpl=new Ext.XTemplate(this.tpl)}if(this.data){this.tpl[this.tplWriteMode](c,this.data);delete this.data}}this.afterRender(this.container);if(this.hidden){this.doHide()}if(this.disabled){this.disable(true)}if(this.stateful!==false){this.initStateEvents()}this.fireEvent("afterrender",this)}return this},update:function(b,d,a){var c=this.getContentTarget();if(this.tpl&&typeof b!=="string"){this.tpl[this.tplWriteMode](c,b||{})}else{var e=Ext.isObject(b)?Ext.DomHelper.markup(b):b;c.update(e,d,a)}},onAdded:function(a,b){this.ownerCt=a;this.initRef();this.fireEvent("added",this,a,b)},onRemoved:function(){this.removeRef();this.fireEvent("removed",this,this.ownerCt);delete this.ownerCt},initRef:function(){if(this.ref&&!this.refOwner){var d=this.ref.split("/"),c=d.length,b=0,a=this;while(a&&b<c){a=a.ownerCt;++b}if(a){a[this.refName=d[--b]]=this;this.refOwner=a}}},removeRef:function(){if(this.refOwner&&this.refName){delete this.refOwner[this.refName];delete this.refOwner}},initState:function(){if(Ext.state.Manager){var b=this.getStateId();if(b){var a=Ext.state.Manager.get(b);if(a){if(this.fireEvent("beforestaterestore",this,a)!==false){this.applyState(Ext.apply({},a));this.fireEvent("staterestore",this,a)}}}}},getStateId:function(){return this.stateId||((/^(ext-comp-|ext-gen)/).test(String(this.id))?null:this.id)},initStateEvents:function(){if(this.stateEvents){for(var a=0,b;b=this.stateEvents[a];a++){this.on(b,this.saveState,this,{delay:100})}}},applyState:function(a){if(a){Ext.apply(this,a)}},getState:function(){return null},saveState:function(){if(Ext.state.Manager&&this.stateful!==false){var b=this.getStateId();if(b){var a=this.getState();if(this.fireEvent("beforestatesave",this,a)!==false){Ext.state.Manager.set(b,a);this.fireEvent("statesave",this,a)}}}},applyToMarkup:function(a){this.allowDomMove=false;this.el=Ext.get(a);this.render(this.el.dom.parentNode)},addClass:function(a){if(this.el){this.el.addClass(a)}else{this.cls=this.cls?this.cls+" "+a:a}return this},removeClass:function(a){if(this.el){this.el.removeClass(a)}else{if(this.cls){this.cls=this.cls.split(" ").remove(a).join(" ")}}return this},onRender:function(b,a){if(!this.el&&this.autoEl){if(Ext.isString(this.autoEl)){this.el=document.createElement(this.autoEl)}else{var c=document.createElement("div");Ext.DomHelper.overwrite(c,this.autoEl);this.el=c.firstChild}if(!this.el.id){this.el.id=this.getId()}}if(this.el){this.el=Ext.get(this.el);if(this.allowDomMove!==false){b.dom.insertBefore(this.el.dom,a);if(c){Ext.removeNode(c);c=null}}}},getAutoCreate:function(){var a=Ext.isObject(this.autoCreate)?this.autoCreate:Ext.apply({},this.defaultAutoCreate);if(this.id&&!a.id){a.id=this.id}return a},afterRender:Ext.emptyFn,destroy:function(){if(!this.isDestroyed){if(this.fireEvent("beforedestroy",this)!==false){this.destroying=true;this.beforeDestroy();if(this.ownerCt&&this.ownerCt.remove){this.ownerCt.remove(this,false)}if(this.rendered){this.el.remove();if(this.actionMode=="container"||this.removeMode=="container"){this.container.remove()}}if(this.focusTask&&this.focusTask.cancel){this.focusTask.cancel()}this.onDestroy();Ext.ComponentMgr.unregister(this);this.fireEvent("destroy",this);this.purgeListeners();this.destroying=false;this.isDestroyed=true}}},deleteMembers:function(){var b=arguments;for(var c=0,a=b.length;c<a;++c){delete this[b[c]]}},beforeDestroy:Ext.emptyFn,onDestroy:Ext.emptyFn,getEl:function(){return this.el},getContentTarget:function(){return this.el},getId:function(){return this.id||(this.id="ext-comp-"+(++Ext.Component.AUTO_ID))},getItemId:function(){return this.itemId||this.getId()},focus:function(b,a){if(a){this.focusTask=new Ext.util.DelayedTask(this.focus,this,[b,false]);this.focusTask.delay(Ext.isNumber(a)?a:10);return this}if(this.rendered&&!this.isDestroyed){this.el.focus();if(b===true){this.el.dom.select()}}return this},blur:function(){if(this.rendered){this.el.blur()}return this},disable:function(a){if(this.rendered){this.onDisable()}this.disabled=true;if(a!==true){this.fireEvent("disable",this)}return this},onDisable:function(){this.getActionEl().addClass(this.disabledClass);this.el.dom.disabled=true},enable:function(){if(this.rendered){this.onEnable()}this.disabled=false;this.fireEvent("enable",this);return this},onEnable:function(){this.getActionEl().removeClass(this.disabledClass);this.el.dom.disabled=false},setDisabled:function(a){return this[a?"disable":"enable"]()},show:function(){if(this.fireEvent("beforeshow",this)!==false){this.hidden=false;if(this.autoRender){this.render(Ext.isBoolean(this.autoRender)?Ext.getBody():this.autoRender)}if(this.rendered){this.onShow()}this.fireEvent("show",this)}return this},onShow:function(){this.getVisibilityEl().removeClass("x-hide-"+this.hideMode)},hide:function(){if(this.fireEvent("beforehide",this)!==false){this.doHide();this.fireEvent("hide",this)}return this},doHide:function(){this.hidden=true;if(this.rendered){this.onHide()}},onHide:function(){this.getVisibilityEl().addClass("x-hide-"+this.hideMode)},getVisibilityEl:function(){return this.hideParent?this.container:this.getActionEl()},setVisible:function(a){return this[a?"show":"hide"]()},isVisible:function(){return this.rendered&&this.getVisibilityEl().isVisible()},cloneConfig:function(b){b=b||{};var c=b.id||Ext.id();var a=Ext.applyIf(b,this.initialConfig);a.id=c;return new this.constructor(a)},getXType:function(){return this.constructor.xtype},isXType:function(b,a){if(Ext.isFunction(b)){b=b.xtype}else{if(Ext.isObject(b)){b=b.constructor.xtype}}return !a?("/"+this.getXTypes()+"/").indexOf("/"+b+"/")!=-1:this.constructor.xtype==b},getXTypes:function(){var a=this.constructor;if(!a.xtypes){var d=[],b=this;while(b&&b.constructor.xtype){d.unshift(b.constructor.xtype);b=b.constructor.superclass}a.xtypeChain=d;a.xtypes=d.join("/")}return a.xtypes},findParentBy:function(a){for(var b=this.ownerCt;(b!=null)&&!a(b,this);b=b.ownerCt){}return b||null},findParentByType:function(b,a){return this.findParentBy(function(d){return d.isXType(b,a)})},bubble:function(c,b,a){var d=this;while(d){if(c.apply(b||d,a||[d])===false){break}d=d.ownerCt}return this},getPositionEl:function(){return this.positionEl||this.el},purgeListeners:function(){Ext.Component.superclass.purgeListeners.call(this);if(this.mons){this.on("beforedestroy",this.clearMons,this,{single:true})}},clearMons:function(){Ext.each(this.mons,function(a){a.item.un(a.ename,a.fn,a.scope)},this);this.mons=[]},createMons:function(){if(!this.mons){this.mons=[];this.on("beforedestroy",this.clearMons,this,{single:true})}},mon:function(g,b,d,c,a){this.createMons();if(Ext.isObject(b)){var j=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;var i=b;for(var h in i){if(j.test(h)){continue}if(Ext.isFunction(i[h])){this.mons.push({item:g,ename:h,fn:i[h],scope:i.scope});g.on(h,i[h],i.scope,i)}else{this.mons.push({item:g,ename:h,fn:i[h],scope:i.scope});g.on(h,i[h])}}return}this.mons.push({item:g,ename:b,fn:d,scope:c});g.on(b,d,c,a)},mun:function(h,c,g,e){var j,d;this.createMons();for(var b=0,a=this.mons.length;b<a;++b){d=this.mons[b];if(h===d.item&&c==d.ename&&g===d.fn&&e===d.scope){this.mons.splice(b,1);h.un(c,g,e);j=true;break}}return j},nextSibling:function(){if(this.ownerCt){var a=this.ownerCt.items.indexOf(this);if(a!=-1&&a+1<this.ownerCt.items.getCount()){return this.ownerCt.items.itemAt(a+1)}}return null},previousSibling:function(){if(this.ownerCt){var a=this.ownerCt.items.indexOf(this);if(a>0){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;c<a;c++){d[c][e].apply(d[c],b)}},addComponent:function(a){this.items.push(a);a.on("destroy",this.removeComponent,this)},removeComponent:function(a){this.items.remove(a)},execute:function(){this.initialConfig.handler.apply(this.initialConfig.scope||window,arguments)}});(function(){Ext.Layer=function(d,c){d=d||{};var e=Ext.DomHelper,h=d.parentEl,g=h?Ext.getDom(h):document.body;if(c){this.dom=Ext.getDom(c)}if(!this.dom){var i=d.dh||{tag:"div",cls:"x-layer"};this.dom=e.append(g,i)}if(d.cls){this.addClass(d.cls)}this.constrain=d.constrain!==false;this.setVisibilityMode(Ext.Element.VISIBILITY);if(d.id){this.id=this.dom.id=d.id}else{this.id=Ext.id(this.dom)}this.zindex=d.zindex||this.getZIndex();this.position("absolute",this.zindex);if(d.shadow){this.shadowOffset=d.shadowOffset||4;this.shadow=new Ext.Shadow({offset:this.shadowOffset,mode:d.shadow})}else{this.shadowOffset=0}this.useShim=d.shim!==false&&Ext.useShims;this.useDisplay=d.useDisplay;this.hide()};var a=Ext.Element.prototype;var b=[];Ext.extend(Ext.Layer,Ext.Element,{getZIndex:function(){return this.zindex||parseInt((this.getShim()||this).getStyle("z-index"),10)||11000},getShim:function(){if(!this.useShim){return null}if(this.shim){return this.shim}var d=b.shift();if(!d){d=this.createShim();d.enableDisplayMode("block");d.dom.style.display="none";d.dom.style.visibility="visible"}var c=this.dom.parentNode;if(d.dom.parentNode!=c){c.insertBefore(d.dom,this.dom)}d.setStyle("z-index",this.getZIndex()-2);this.shim=d;return d},hideShim:function(){if(this.shim){this.shim.setDisplayed(false);b.push(this.shim);delete this.shim}},disableShadow:function(){if(this.shadow){this.shadowDisabled=true;this.shadow.hide();this.lastShadowOffset=this.shadowOffset;this.shadowOffset=0}},enableShadow:function(c){if(this.shadow){this.shadowDisabled=false;if(Ext.isDefined(this.lastShadowOffset)){this.shadowOffset=this.lastShadowOffset;delete this.lastShadowOffset}if(c){this.sync(true)}}},sync:function(d){var n=this.shadow;if(!this.updating&&this.isVisible()&&(n||this.useShim)){var i=this.getShim(),m=this.getWidth(),j=this.getHeight(),e=this.getLeft(true),o=this.getTop(true);if(n&&!this.shadowDisabled){if(d&&!n.isVisible()){n.show(this)}else{n.realign(e,o,m,j)}if(i){if(d){i.show()}var k=n.el.getXY(),g=i.dom.style,c=n.el.getSize();g.left=(k[0])+"px";g.top=(k[1])+"px";g.width=(c.width)+"px";g.height=(c.height)+"px"}}else{if(i){if(d){i.show()}i.setSize(m,j);i.setLeftTop(e,o)}}}},destroy:function(){this.hideShim();if(this.shadow){this.shadow.hide()}this.removeAllListeners();Ext.removeNode(this.dom);delete this.dom},remove:function(){this.destroy()},beginUpdate:function(){this.updating=true},endUpdate:function(){this.updating=false;this.sync(true)},hideUnders:function(c){if(this.shadow){this.shadow.hide()}this.hideShim()},constrainXY:function(){if(this.constrain){var j=Ext.lib.Dom.getViewWidth(),d=Ext.lib.Dom.getViewHeight();var o=Ext.getDoc().getScroll();var n=this.getXY();var k=n[0],i=n[1];var c=this.shadowOffset;var l=this.dom.offsetWidth+c,e=this.dom.offsetHeight+c;var g=false;if((k+l)>j+o.left){k=j-l-c;g=true}if((i+e)>d+o.top){i=d-e-c;g=true}if(k<o.left){k=o.left;g=true}if(i<o.top){i=o.top;g=true}if(g){if(this.avoidY){var m=this.avoidY;if(i<=m&&(i+e)>=m){i=m-e-5}}n=[k,i];this.storeXY(n);a.setXY.call(this,n);this.sync()}}return this},getConstrainOffset:function(){return this.shadowOffset},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},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.isIE9m){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.isIE9m){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.isIE9m){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.isIE9m){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,i=0,p=(q+n.w),e=(g+n.h),j=p+"px",o=e+"px",m,c;u.left=(b+n.l)+"px";u.top=(r+n.t)+"px";if(u.width!=j||u.height!=o){u.width=j;u.height=o;if(!Ext.isIE9m){m=k.childNodes;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=[],a=Ext.isIE9m?'<div class="x-ie-shadow"></div>':'<div class="x-shadow"><div class="xst"><div class="xstl"></div><div class="xstc"></div><div class="xstr"></div></div><div class="xsc"><div class="xsml"></div><div class="xsmc"></div><div class="xsmr"></div></div><div class="xsb"><div class="xsbl"></div><div class="xsbc"></div><div class="xsbr"></div></div></div>';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)&&(b<this.boxMinWidth)){b=this.boxMinWidth}if(Ext.isDefined(d)&&Ext.isDefined(this.boxMinHeight)&&(d<this.boxMinHeight)){d=this.boxMinHeight}if(Ext.isDefined(b)&&Ext.isDefined(this.boxMaxWidth)&&(b>this.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.unselectable();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:"&#160;"},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&&this.layout.setActiveItem){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(e,b){var d=arguments,h=d.length,a=[],g,j;this.initItems();if(h>2){for(g=h-1;g>=1;--g){a.push(this.insert(e,d[g]))}return a}j=this.lookupComponent(this.applyDefaults(b));e=Math.min(e,this.items.length);if(this.fireEvent("beforeadd",this,j,e)!==false&&this.onBeforeAdd(j)!==false){if(j.ownerCt==this){this.items.remove(j)}this.items.insert(e,j);j.onAdded(this,e);this.onAdd(j);this.fireEvent("add",this,j,e)}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.isAction?b.initialConfig: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;++d){e=g[d];this.remove(e,c);if(e.ownerCt!==this){b.push(e)}}return b},getComponent:function(a){if(Ext.isObject(a)){a=a.getItemId()}return this.items.get(a)},lookupComponent:function(a){if(Ext.isString(a)){return Ext.ComponentMgr.get(a)}else{if(!a.events){return this.createComponent(a)}}return a},createComponent:function(a,d){if(a.render){return a}var b=Ext.create(Ext.apply({ownerCt:this},a),d||this.defaultType);delete b.initialConfig.ownerCt;delete b.ownerCt;return b},canLayout:function(){var a=this.getVisibilityEl();return a&&a.dom&&!a.isStyle("display","none")},doLayout:function(g,e){var k=this.rendered,j=e||this.forceLayout;if(this.collapsed||!this.canLayout()){this.deferLayout=this.deferLayout||!g;if(!j){return}g=g&&!this.deferLayout}else{delete this.deferLayout}if(k&&this.layout){this.layout.layout()}if(g!==true&&this.items){var d=this.items.items;for(var b=0,a=d.length;b<a;b++){var h=d[b];if(h.doLayout){h.doLayout(false,j)}}}if(k){this.onLayout(g,j)}this.hasLayout=true;delete this.forceLayout},onLayout:Ext.emptyFn,shouldBufferLayout:function(){var a=this.hasLayout;if(this.ownerCt){return a?!this.hasLayoutPending():false}return a},hasLayoutPending:function(){var a=false;this.ownerCt.bubble(function(b){if(b.layoutPending){a=true;return false}});return a},onShow:function(){Ext.Container.superclass.onShow.call(this);if(Ext.isDefined(this.deferLayout)){delete this.deferLayout;this.doLayout(true)}},getLayout:function(){if(!this.layout){var a=new Ext.layout.AutoLayout(this.layoutConfig);this.setLayout(a)}return this.layout},beforeDestroy:function(){var a;if(this.items){while(a=this.items.first()){this.doRemove(a,true)}}if(this.monitorResize){Ext.EventManager.removeResizeListener(this.doLayout,this)}Ext.destroy(this.layout);Ext.Container.superclass.beforeDestroy.call(this)},cascade:function(g,e,b){if(g.apply(e||this,b||[this])!==false){if(this.items){var d=this.items.items;for(var c=0,a=d.length;c<a;c++){if(d[c].cascade){d[c].cascade(g,e,b)}else{g.apply(e||d[c],b||[d[c]])}}}}return this},findById:function(c){var a=null,b=this;this.cascade(function(d){if(b!=d&&d.id===c){a=d;return false}});return a},findByType:function(b,a){return this.findBy(function(d){return d.isXType(b,a)})},find:function(b,a){return this.findBy(function(d){return d[b]===a})},findBy:function(d,c){var a=[],b=this;this.cascade(function(e){if(b!=e&&d.call(c||e,e,b)===true){a.push(e)}});return a},get:function(a){return this.getComponent(a)}});Ext.Container.LAYOUTS={};Ext.reg("container",Ext.Container);Ext.layout.ContainerLayout=Ext.extend(Object,{monitorResize:false,activeItem:null,constructor:function(a){this.id=Ext.id(null,"ext-layout-");Ext.apply(this,a)},type:"container",IEMeasureHack:function(k,g){var a=k.dom.childNodes,b=a.length,n,m=[],l,h,j;for(h=0;h<b;h++){n=a[h];l=Ext.get(n);if(l){m[h]=l.getStyle("display");l.setStyle({display:"none"})}}j=k?k.getViewSize(g):{};for(h=0;h<b;h++){n=a[h];l=Ext.get(n);if(l){l.setStyle({display:m[h]})}}return j},getLayoutTargetSize:Ext.EmptyFn,layout:function(){var a=this.container,b=a.getLayoutTarget();if(!(this.hasLayout||Ext.isEmpty(this.targetCls))){b.addClass(this.targetCls)}this.onLayout(a,b);a.fireEvent("afterlayout",a,this)},onLayout:function(a,b){this.renderAll(a,b)},isValidParent:function(b,a){return a&&b.getPositionEl().dom.parentNode==(a.dom||a)},renderAll:function(e,g){var b=e.items.items,d,h,a=b.length;for(d=0;d<a;d++){h=b[d];if(h&&(!h.rendered||!this.isValidParent(h,g))){this.renderItem(h,d,g)}}},renderItem:function(d,a,b){if(d){if(!d.rendered){d.render(b,a);this.configureItem(d)}else{if(!this.isValidParent(d,b)){if(Ext.isNumber(a)){a=b.dom.childNodes[a]}b.dom.insertBefore(d.getPositionEl().dom,a||null);d.container=b;this.configureItem(d)}}}},getRenderedItems:function(g){var e=g.getLayoutTarget(),h=g.items.items,a=h.length,d,j,b=[];for(d=0;d<a;d++){if((j=h[d]).rendered&&this.isValidParent(j,e)&&j.shouldLayout!==false){b.push(j)}}return b},configureItem:function(b){if(this.extraCls){var a=b.getPositionEl?b.getPositionEl():b;a.addClass(this.extraCls)}if(b.doLayout&&this.forceLayout){b.doLayout()}if(this.renderHidden&&b!=this.activeItem){b.hide()}},onRemove:function(b){if(this.activeItem==b){delete this.activeItem}if(b.rendered&&this.extraCls){var a=b.getPositionEl?b.getPositionEl():b;a.removeClass(this.extraCls)}},afterRemove:function(a){if(a.removeRestore){a.removeMode="container";delete a.removeRestore}},onResize:function(){var c=this.container,a;if(c.collapsed){return}if(a=c.bufferResize&&c.shouldBufferLayout()){if(!this.resizeTask){this.resizeTask=new Ext.util.DelayedTask(this.runLayout,this);this.resizeBuffer=Ext.isNumber(a)?a:50}c.layoutPending=true;this.resizeTask.delay(this.resizeBuffer)}else{this.runLayout()}},runLayout:function(){var a=this.container;this.layout();a.onLayout();delete a.layoutPending},setContainer:function(b){if(this.monitorResize&&b!=this.container){var a=this.container;if(a){a.un(a.resizeEvent,this.onResize,this)}if(b){b.on(b.resizeEvent,this.onResize,this)}}this.container=b},parseMargins:function(b){if(Ext.isNumber(b)){b=b.toString()}var c=b.split(" "),a=c.length;if(a==1){c[1]=c[2]=c[3]=c[0]}else{if(a==2){c[2]=c[0];c[3]=c[1]}else{if(a==3){c[3]=c[1]}}}return{top:parseInt(c[0],10)||0,right:parseInt(c[1],10)||0,bottom:parseInt(c[2],10)||0,left:parseInt(c[3],10)||0}},fieldTpl:(function(){var a=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>");a.disableFormats=true;return a.compile()})(),destroy:function(){if(this.resizeTask&&this.resizeTask.cancel){this.resizeTask.cancel()}if(this.container){this.container.un(this.container.resizeEvent,this.onResize,this)}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;b<a;b++){h=e[b];if(h.doLayout){h.doLayout(true)}}}});Ext.Container.LAYOUTS.auto=Ext.layout.AutoLayout;Ext.layout.FitLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"fit",getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();if(!a){return{}}return a.getStyleSize()},onLayout:function(a,b){Ext.layout.FitLayout.superclass.onLayout.call(this,a,b);if(!a.collapsed){this.setItemSize(this.activeItem||a.items.itemAt(0),this.getLayoutTargetSize())}},setItemSize:function(b,a){if(b&&a.height>0){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 b=this.container.getLayoutTarget(),a={};if(b){a=b.getViewSize();if(Ext.isIE9m&&Ext.isStrict&&a.width==0){a=b.getStyleSize()}a.width-=b.getPadding("lr");a.height-=b.getPadding("tb")}return a},onLayout:function(m,w){Ext.layout.AnchorLayout.superclass.onLayout.call(this,m,w);var p=this.getLayoutTargetSize(),k=p.width,o=p.height,q=w.getStyle("overflow"),n=this.getRenderedItems(m),t=n.length,g=[],j,a,v,l,h,c,e,d,u=0,s,b;if(k<20&&o<20){return}if(m.anchorSize){if(typeof m.anchorSize=="number"){a=m.anchorSize}else{a=m.anchorSize.width;v=m.anchorSize.height}}else{a=m.initialConfig.width;v=m.initialConfig.height}for(s=0;s<t;s++){l=n[s];b=l.getPositionEl();if(!l.anchor&&l.items&&!Ext.isNumber(l.width)&&!(Ext.isIE6&&Ext.isStrict)){l.anchor=this.defaultAnchor}if(l.anchor){h=l.anchorSpec;if(!h){d=l.anchor.split(" ");l.anchorSpec=h={right:this.parseAnchor(d[0],l.initialConfig.width,a),bottom:this.parseAnchor(d[1],l.initialConfig.height,v)}}c=h.right?this.adjustWidthAnchor(h.right(k)-b.getMargins("lr"),l):undefined;e=h.bottom?this.adjustHeightAnchor(h.bottom(o)-b.getMargins("tb"),l):undefined;if(c||e){g.push({component:l,width:c||undefined,height:e||undefined})}}}for(s=0,t=g.length;s<t;s++){j=g[s];j.component.setSize(j.width,j.height)}if(q&&q!="hidden"&&!this.adjustmentPass){var r=this.getLayoutTargetSize();if(r.width!=p.width||r.height!=p.height){this.adjustmentPass=true;this.onLayout(m,w)}}delete this.adjustmentPass},parseAnchor:function(c,h,b){if(c&&c!="none"){var e;if(this.parseAnchorRE.test(c)){var g=b-h;return function(a){if(a!==e){e=a;return a-g}}}else{if(c.indexOf("%")!=-1){var d=parseFloat(c.replace("%",""))*0.01;return function(a){if(a!==e){e=a;return Math.floor(a*d)}}}else{c=parseInt(c,10);if(!isNaN(c)){return function(a){if(a!==e){e=a;return a+c}}}}}}return false},adjustWidthAnchor:function(b,a){return b},adjustHeightAnchor:function(b,a){return b}});Ext.Container.LAYOUTS.anchor=Ext.layout.AnchorLayout;Ext.layout.ColumnLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"column",extraCls:"x-column",scrollOffset:0,targetCls:"x-column-layout-ct",isValidParent:function(b,a){return this.innerCt&&b.getPositionEl().dom.parentNode==this.innerCt.dom},getLayoutTargetSize:function(){var b=this.container.getLayoutTarget(),a;if(b){a=b.getViewSize();if(Ext.isIE9m&&Ext.isStrict&&a.width==0){a=b.getStyleSize()}a.width-=b.getPadding("lr");a.height-=b.getPadding("tb")}return a},renderAll:function(a,b){if(!this.innerCt){this.innerCt=b.createChild({cls:"x-column-inner"});this.innerCt.createChild({cls:"x-clear"})}Ext.layout.ColumnLayout.superclass.renderAll.call(this,a,this.innerCt)},onLayout:function(e,k){var g=e.items.items,j=g.length,n,b,a,o=[];this.renderAll(e,k);var r=this.getLayoutTargetSize();if(Ext.isIE9m&&(r.width<1&&r.height<1)){return}var p=r.width-this.scrollOffset,d=r.height,q=p;this.innerCt.setWidth(p);for(b=0;b<j;b++){n=g[b];a=n.getPositionEl().getMargins("lr");o[b]=a;if(!n.columnWidth){q-=(n.getWidth()+a)}}q=q<0?0:q;for(b=0;b<j;b++){n=g[b];a=o[b];if(n.columnWidth){n.setSize(Math.floor(n.columnWidth*q)-a)}}if(Ext.isIE9m){if(b=k.getStyle("overflow")&&b!="hidden"&&!this.adjustmentPass){var l=this.getLayoutTargetSize();if(l.width!=r.width){this.adjustmentPass=true;this.onLayout(e,k)}}}delete this.adjustmentPass}});Ext.Container.LAYOUTS.column=Ext.layout.ColumnLayout;Ext.layout.BorderLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,rendered:false,type:"border",targetCls:"x-border-layout-ct",getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();return a?a.getViewSize():{}},onLayout:function(g,I){var j,B,F,o,x=g.items.items,C=x.length;if(!this.rendered){j=[];for(B=0;B<C;B++){F=x[B];o=F.region;if(F.collapsed){j.push(F)}F.collapsed=false;if(!F.rendered){F.render(I,B);F.getPositionEl().addClass("x-border-panel")}this[o]=o!="center"&&F.split?new Ext.layout.BorderLayout.SplitRegion(this,F.initialConfig,o):new Ext.layout.BorderLayout.Region(this,F.initialConfig,o);this[o].render(I,F)}this.rendered=true}var v=this.getLayoutTargetSize();if(v.width<20||v.height<20){if(j){this.restoreCollapsed=j}return}else{if(this.restoreCollapsed){j=this.restoreCollapsed;delete this.restoreCollapsed}}var t=v.width,D=v.height,r=t,A=D,p=0,q=0,y=this.north,u=this.south,l=this.west,E=this.east,F=this.center,H,z,d,G;if(!F&&Ext.layout.BorderLayout.WARN!==false){throw"No center region defined in BorderLayout "+g.id}if(y&&y.isVisible()){H=y.getSize();z=y.getMargins();H.width=t-(z.left+z.right);H.x=z.left;H.y=z.top;p=H.height+H.y+z.bottom;A-=p;y.applyLayout(H)}if(u&&u.isVisible()){H=u.getSize();z=u.getMargins();H.width=t-(z.left+z.right);H.x=z.left;G=(H.height+z.top+z.bottom);H.y=D-G+z.top;A-=G;u.applyLayout(H)}if(l&&l.isVisible()){H=l.getSize();z=l.getMargins();H.height=A-(z.top+z.bottom);H.x=z.left;H.y=p+z.top;d=(H.width+z.left+z.right);q+=d;r-=d;l.applyLayout(H)}if(E&&E.isVisible()){H=E.getSize();z=E.getMargins();H.height=A-(z.top+z.bottom);d=(H.width+z.left+z.right);H.x=t-d+z.left;H.y=p+z.top;r-=d;E.applyLayout(H)}if(F){z=F.getMargins();var k={x:q+z.left,y:p+z.top,width:r-(z.left+z.right),height:A-(z.top+z.bottom)};F.applyLayout(k)}if(j){for(B=0,C=j.length;B<C;B++){j[B].collapse(false)}}if(Ext.isIE9m&&Ext.isStrict){I.repaint()}if(B=I.getStyle("overflow")&&B!="hidden"&&!this.adjustmentPass){var a=this.getLayoutTargetSize();if(a.width!=v.width||a.height!=v.height){this.adjustmentPass=true;this.onLayout(g,I)}}delete this.adjustmentPass},destroy:function(){var b=["north","south","east","west"],a,c;for(a=0;a<b.length;a++){c=this[b[a]];if(c){if(c.destroy){c.destroy()}else{if(c.split){c.split.destroy(true)}}}}Ext.layout.BorderLayout.superclass.destroy.call(this)}});Ext.layout.BorderLayout.Region=function(b,a,c){Ext.apply(this,a);this.layout=b;this.position=c;this.state={};if(typeof this.margins=="string"){this.margins=this.layout.parseMargins(this.margins)}this.margins=Ext.applyIf(this.margins||{},this.defaultMargins);if(this.collapsible){if(typeof this.cmargins=="string"){this.cmargins=this.layout.parseMargins(this.cmargins)}if(this.collapseMode=="mini"&&!this.cmargins){this.cmargins={left:0,top:0,right:0,bottom:0}}else{this.cmargins=Ext.applyIf(this.cmargins||{},c=="north"||c=="south"?this.defaultNSCMargins:this.defaultEWCMargins)}}};Ext.layout.BorderLayout.Region.prototype={collapsible:false,split:false,floatable:true,minWidth:50,minHeight:50,defaultMargins:{left:0,top:0,right:0,bottom:0},defaultNSCMargins:{left:5,top:5,right:5,bottom:5},defaultEWCMargins:{left:5,top:0,right:5,bottom:0},floatingZIndex:100,isCollapsed:false,render:function(b,c){this.panel=c;c.el.enableDisplayMode();this.targetEl=b;this.el=c.el;var a=c.getState,d=this.position;c.getState=function(){return Ext.apply(a.call(c)||{},this.state)}.createDelegate(this);if(d!="center"){c.allowQueuedExpand=false;c.on({beforecollapse:this.beforeCollapse,collapse:this.onCollapse,beforeexpand:this.beforeExpand,expand:this.onExpand,hide:this.onHide,show:this.onShow,scope:this});if(this.collapsible||this.floatable){c.collapseEl="el";c.slideAnchor=this.getSlideAnchor()}if(c.tools&&c.tools.toggle){c.tools.toggle.addClass("x-tool-collapse-"+d);c.tools.toggle.addClassOnOver("x-tool-collapse-"+d+"-over")}}},getCollapsedEl:function(){if(!this.collapsedEl){if(!this.toolTemplate){var b=new Ext.Template('<div class="x-tool x-tool-{id}">&#160;</div>');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:"&#160;"});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.expandToolEl=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.destroyMembers(this,"miniCollapsedEl","collapsedEl","expandToolEl")}};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:"&#160;",id:this.panel.id+"-xsplit"});if(this.collapseMode=="mini"){this.miniSplitEl=this.splitEl.createChild({cls:"x-layout-mini x-layout-mini-"+d,html:"&#160;"});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:true,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);a.labelAlign=a.labelAlign||this.labelAlign;if(a.labelAlign){a.addClass("x-form-label-"+a.labelAlign)}if(a.hideLabels||this.hideLabels){Ext.apply(this,{labelStyle:"display:none",elementStyle:"padding-left:0;",labelAdjust:0})}else{this.labelSeparator=Ext.isDefined(a.labelSeparator)?a.labelSeparator:this.labelSeparator;a.labelWidth=a.labelWidth||this.labelWidth||100;if(Ext.isNumber(a.labelWidth)){var b=a.labelPad||this.labelPad;b=Ext.isNumber(b)?b: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<a;++d){if(c[d]){b+=c[d];if(b.substr(-1,1)!=";"){b+=";"}}}return b},renderItem:function(e,a,d){if(e&&(e.isFormField||e.fieldLabel)&&e.inputType!="hidden"){var b=this.getTemplateArgs(e);if(Ext.isNumber(a)){a=d.dom.childNodes[a]||null}if(a){e.itemCt=this.fieldTpl.insertBefore(a,b,true)}else{e.itemCt=this.fieldTpl.append(d,b,true)}if(!e.getItemCt){Ext.apply(e,{getItemCt:function(){return e.itemCt},customItemCt:true})}e.label=e.getItemCt().child("label.x-form-item-label");if(!e.rendered){e.render("x-form-el-"+e.id)}else{if(!this.isValidParent(e,d)){Ext.fly("x-form-el-"+e.id).appendChild(e.getPositionEl())}}if(this.trackLabels){if(e.hidden){this.onFieldHide(e)}e.on({scope:this,show:this.onFieldShow,hide:this.onFieldHide})}this.configureItem(e)}else{Ext.layout.FormLayout.superclass.renderItem.apply(this,arguments)}},getTemplateArgs:function(c){var a=!c.fieldLabel||c.hideLabel,b=(c.itemCls||this.container.itemCls||"")+(c.hideLabel?" x-hide-label":"");if(Ext.isIE9&&Ext.isIEQuirks&&c instanceof Ext.form.TextField){b+=" x-input-wrapper"}return{id:c.id,label:c.fieldLabel,itemCls:b,clearCls:c.clearCls||"x-form-clear-left",labelStyle:this.getLabelStyle(c.labelStyle),elementStyle:this.elementStyle||"",labelSeparator:a?"":(Ext.isDefined(c.labelSeparator)?c.labelSeparator:this.labelSeparator)}},adjustWidthAnchor:function(a,d){if(d.label&&!this.isHide(d)&&(this.container.labelAlign!="top")){var b=Ext.isIE6||Ext.isIEQuirks;return a-this.labelAdjust+(b?-3:0)}return a},adjustHeightAnchor:function(a,b){if(b.label&&!this.isHide(b)&&(this.container.labelAlign=="top")){return a-b.label.getHeight()}return a},isValidParent:function(b,a){return a&&this.container.getEl().contains(b.getPositionEl())}});Ext.Container.LAYOUTS.form=Ext.layout.FormLayout;Ext.layout.AccordionLayout=Ext.extend(Ext.layout.FitLayout,{fill:true,autoWidth:true,titleCollapse:true,hideCollapseTool:false,collapseFirst:false,animate:false,sequence:false,activeOnTop:false,type:"accordion",renderItem:function(a){if(this.animate===false){a.animCollapse=false}a.collapsible=true;if(this.autoWidth){a.autoWidth=true}if(this.titleCollapse){a.titleCollapse=true}if(this.hideCollapseTool){a.hideCollapseTool=true}if(this.collapseFirst!==undefined){a.collapseFirst=this.collapseFirst}if(!this.activeItem&&!a.collapsed){this.setActiveItem(a,true)}else{if(this.activeItem&&this.activeItem!=a){a.collapsed=true}}Ext.layout.AccordionLayout.superclass.renderItem.apply(this,arguments);a.header.addClass("x-accordion-hd");a.on("beforeexpand",this.beforeExpand,this)},onRemove:function(a){Ext.layout.AccordionLayout.superclass.onRemove.call(this,a);if(a.rendered){a.header.removeClass("x-accordion-hd")}a.un("beforeexpand",this.beforeExpand,this)},beforeExpand:function(c,b){var a=this.activeItem;if(a){if(this.sequence){delete this.activeItem;if(!a.collapsed){a.collapse({callback:function(){c.expand(b||true)},scope:this});return false}}else{a.collapse(this.animate)}}this.setActive(c);if(this.activeOnTop){c.el.dom.parentNode.insertBefore(c.el.dom,c.el.dom.parentNode.firstChild)}this.layout()},setItemSize:function(g,e){if(this.fill&&g){var d=0,c,b=this.getRenderedItems(this.container),a=b.length,h;for(c=0;c<a;c++){if((h=b[c])!=g&&!h.hidden){d+=h.header.getHeight()}}e.height-=d;g.setSize(e)}},setActiveItem:function(a){this.setActive(a,true)},setActive:function(c,b){var a=this.activeItem;c=this.container.getComponent(c);if(a!=c){if(c.rendered&&c.collapsed&&b){c.expand()}else{if(a){a.fireEvent("deactivate",a)}this.activeItem=c;c.fireEvent("activate",c)}}}});Ext.Container.LAYOUTS.accordion=Ext.layout.AccordionLayout;Ext.layout.Accordion=Ext.layout.AccordionLayout;Ext.layout.TableLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:false,type:"table",targetCls:"x-table-layout-ct",tableAttrs:null,setContainer:function(a){Ext.layout.TableLayout.superclass.setContainer.call(this,a);this.currentRow=0;this.currentColumn=0;this.cells=[]},onLayout:function(d,g){var e=d.items.items,a=e.length,h,b;if(!this.table){g.addClass("x-table-layout-ct");this.table=g.createChild(Ext.apply({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},this.tableAttrs),null,true)}this.renderAll(d,g)},getRow:function(a){var b=this.table.tBodies[0].childNodes[a];if(!b){b=document.createElement("tr");this.table.tBodies[0].appendChild(b)}return b},getNextCell:function(j){var a=this.getNextNonSpan(this.currentColumn,this.currentRow);var g=this.currentColumn=a[0],e=this.currentRow=a[1];for(var i=e;i<e+(j.rowspan||1);i++){if(!this.cells[i]){this.cells[i]=[]}for(var d=g;d<g+(j.colspan||1);d++){this.cells[i][d]=true}}var h=document.createElement("td");if(j.cellId){h.id=j.cellId}var b="x-table-layout-cell";if(j.cellCls){b+=" "+j.cellCls}h.className=b;if(j.colspan){h.colSpan=j.colspan}if(j.rowspan){h.rowSpan=j.rowspan}this.getRow(e).appendChild(h);return h},getNextNonSpan:function(a,c){var b=this.columns;while((b&&a>=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)}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)}}},isValidParent:function(b,a){return b.getPositionEl().up("table",5).dom.parentNode===(a.dom||a)},destroy:function(){delete this.table;Ext.layout.TableLayout.superclass.destroy.call(this)}});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)}var d=this.overflowHandler;if(typeof d=="string"){d={type:d}}var c="none";if(d&&d.type!=undefined){c=d.type}var b=Ext.layout.boxOverflow[c];if(b[this.type]){b=b[this.type]}this.overflowHandler=new b(this,d)},onLayout:function(b,h){Ext.layout.BoxLayout.superclass.onLayout.call(this,b,h);var d=this.getLayoutTargetSize(),i=this.getVisibleItems(b),c=this.calculateChildBoxes(i,d),g=c.boxes,j=c.meta;if(d.width>0){var k=this.overflowHandler,a=j.tooNarrow?"handleOverflow":"clearOverflow";var e=k[a](c,d);if(e){if(e.targetSize){d=e.targetSize}if(e.recalculate){i=this.getVisibleItems(b);c=this.calculateChildBoxes(i,d);g=c.boxes}}}this.layoutTargetLastSize=d;this.childBoxCache=c;this.updateInnerCtSize(d,c);this.updateChildBoxes(g);this.handleTargetOverflow(d,b,h)},updateChildBoxes:function(c){for(var b=0,e=c.length;b<e;b++){var d=c[b],a=d.component;if(d.dirtySize){a.setSize(d.width,d.height)}if(isNaN(d.left)||isNaN(d.top)){continue}a.setPosition(d.left,d.top)}},updateInnerCtSize:function(c,h){var i=this.align,g=this.padding,e=c.width,a=c.height;if(this.type=="hbox"){var b=e,d=h.meta.maxHeight+g.top+g.bottom;if(i=="stretch"){d=a}else{if(i=="middle"){d=Math.max(a,d)}}}else{var d=a,b=h.meta.maxWidth+g.left+g.right;if(i=="stretch"){b=e}else{if(i=="center"){b=Math.max(e,b)}}}this.innerCt.setSize(b||undefined,d||undefined)},handleTargetOverflow:function(d,a,c){var e=c.getStyle("overflow");if(e&&e!="hidden"&&!this.adjustmentPass){var b=this.getLayoutTargetSize();if(b.width!=d.width||b.height!=d.height){this.adjustmentPass=true;this.onLayout(a,c)}}delete this.adjustmentPass},isValidParent:function(b,a){return this.innerCt&&b.getPositionEl().dom.parentNode==this.innerCt.dom},getVisibleItems:function(g){var g=g||this.container,e=g.getLayoutTarget(),h=g.items.items,a=h.length,d,j,b=[];for(d=0;d<a;d++){if((j=h[d]).rendered&&this.isValidParent(j,e)&&j.hidden!==true&&j.collapsed!==true&&j.shouldLayout!==false){b.push(j)}}return b},renderAll:function(a,b){if(!this.innerCt){this.innerCt=b.createChild({cls:this.innerCls});this.padding=this.parseMargins(this.padding)}Ext.layout.BoxLayout.superclass.renderAll.call(this,a,this.innerCt)},getLayoutTargetSize:function(){var b=this.container.getLayoutTarget(),a;if(b){a=b.getViewSize();if(Ext.isIE9m&&Ext.isStrict&&a.width==0){a=b.getStyleSize()}a.width-=b.getPadding("lr");a.height-=b.getPadding("tb")}return a},renderItem:function(a){if(Ext.isString(a.margins)){a.margins=this.parseMargins(a.margins)}else{if(!a.margins){a.margins=this.defaultMargins}}Ext.layout.BoxLayout.superclass.renderItem.apply(this,arguments)},destroy:function(){Ext.destroy(this.overflowHandler);Ext.layout.BoxLayout.superclass.destroy.apply(this,arguments)}});Ext.layout.boxOverflow.None=Ext.extend(Object,{constructor:function(b,a){this.layout=b;Ext.apply(this,a||{})},handleOverflow:Ext.emptyFn,clearOverflow:Ext.emptyFn});Ext.layout.boxOverflow.none=Ext.layout.boxOverflow.None;Ext.layout.boxOverflow.Menu=Ext.extend(Ext.layout.boxOverflow.None,{afterCls:"x-strip-right",noItemsMenuText:'<div class="x-toolbar-no-items">(None)</div>',constructor:function(a){Ext.layout.boxOverflow.Menu.superclass.constructor.apply(this,arguments);this.menuItems=[]},createInnerElements:function(){if(!this.afterCt){this.afterCt=this.layout.innerCt.insertSibling({cls:this.afterCls},"before")}},clearOverflow:function(a,g){var e=g.width+(this.afterCt?this.afterCt.getWidth():0),b=this.menuItems;this.hideTrigger();for(var c=0,d=b.length;c<d;c++){b.pop().component.show()}return{targetSize:{height:g.height,width:e}}},showTrigger:function(){this.createMenu();this.menuTrigger.show()},hideTrigger:function(){if(this.menuTrigger!=undefined){this.menuTrigger.hide()}},beforeMenuShow:function(h){var b=this.menuItems,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<a;d++){g=b[d].component;if(e&&(c(g,e)||c(e,g))){h.add("-")}this.addComponentToMenu(h,g);e=g}if(h.items.length<1){h.add(this.noItemsMenuText)}},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})}},createMenu:function(){if(!this.menuTrigger){this.createInnerElements();this.menu=new Ext.menu.Menu({ownerCt:this.layout.container,listeners:{scope:this,beforeshow:this.beforeMenuShow}});this.menuTrigger=new Ext.Button({iconCls:"x-toolbar-more-icon",cls:"x-toolbar-more",menu:this.menu,renderTo:this.afterCt})}},destroy:function(){Ext.destroy(this.menu,this.menuTrigger)}});Ext.layout.boxOverflow.menu=Ext.layout.boxOverflow.Menu;Ext.layout.boxOverflow.HorizontalMenu=Ext.extend(Ext.layout.boxOverflow.Menu,{constructor:function(){Ext.layout.boxOverflow.HorizontalMenu.superclass.constructor.apply(this,arguments);var c=this,b=c.layout,a=b.calculateChildBoxes;b.calculateChildBoxes=function(d,i){var l=a.apply(b,arguments),k=l.meta,e=c.menuItems;var j=0;for(var g=0,h=e.length;g<h;g++){j+=e[g].width}k.minimumWidth+=j;k.tooNarrow=k.minimumWidth>i.width;return l}},handleOverflow:function(d,h){this.showTrigger();var k=h.width-this.afterCt.getWidth(),l=d.boxes,e=0,r=false;for(var o=0,c=l.length;o<c;o++){e+=l[o].width}var a=k-e,g=0;for(var o=0,c=this.menuItems.length;o<c;o++){var n=this.menuItems[o],m=n.component,b=n.width;if(b<a){m.show();a-=b;g++;r=true}else{break}}if(r){this.menuItems=this.menuItems.slice(g)}else{for(var j=l.length-1;j>=0;j--){var q=l[j].component,p=l[j].left+l[j].width;if(p>=k){this.menuItems.unshift({component:q,width:l[j].width});q.hide()}else{break}}}if(this.menuItems.length==0){this.hideTrigger()}return{targetSize:{height:h.height,width:k},recalculate:r}}});Ext.layout.boxOverflow.menu.hbox=Ext.layout.boxOverflow.HorizontalMenu;Ext.layout.boxOverflow.Scroller=Ext.extend(Ext.layout.boxOverflow.None,{animateScroll:true,scrollIncrement:100,wheelIncrement:3,scrollRepeatInterval:400,scrollDuration:0.4,beforeCls:"x-strip-left",afterCls:"x-strip-right",scrollerCls:"x-strip-scroller",beforeScrollerCls:"x-strip-scroller-left",afterScrollerCls:"x-strip-scroller-right",createWheelListener:function(){this.layout.innerCt.on({scope:this,mousewheel:function(a){a.stopEvent();this.scrollBy(a.getWheelDelta()*this.wheelIncrement*-1,false)}})},handleOverflow:function(a,b){this.createInnerElements();this.showScrollers()},clearOverflow:function(){this.hideScrollers()},showScrollers:function(){this.createScrollers();this.beforeScroller.show();this.afterScroller.show();this.updateScrollButtons()},hideScrollers:function(){if(this.beforeScroller!=undefined){this.beforeScroller.hide();this.afterScroller.hide()}},createScrollers:function(){if(!this.beforeScroller&&!this.afterScroller){var a=this.beforeCt.createChild({cls:String.format("{0} {1} ",this.scrollerCls,this.beforeScrollerCls)});var b=this.afterCt.createChild({cls:String.format("{0} {1}",this.scrollerCls,this.afterScrollerCls)});a.addClassOnOver(this.beforeScrollerCls+"-hover");b.addClassOnOver(this.afterScrollerCls+"-hover");a.setVisibilityMode(Ext.Element.DISPLAY);b.setVisibilityMode(Ext.Element.DISPLAY);this.beforeRepeater=new Ext.util.ClickRepeater(a,{interval:this.scrollRepeatInterval,handler:this.scrollLeft,scope:this});this.afterRepeater=new Ext.util.ClickRepeater(b,{interval:this.scrollRepeatInterval,handler:this.scrollRight,scope:this});this.beforeScroller=a;this.afterScroller=b}},destroy:function(){Ext.destroy(this.beforeScroller,this.afterScroller,this.beforeRepeater,this.afterRepeater,this.beforeCt,this.afterCt)},scrollBy:function(b,a){this.scrollTo(this.getScrollPosition()+b,a)},getItem:function(a){if(Ext.isString(a)){a=Ext.getCmp(a)}else{if(Ext.isNumber(a)){a=this.items[a]}}return a},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},updateScrollButtons:function(){if(this.beforeScroller==undefined||this.afterScroller==undefined){return}var d=this.atExtremeBefore()?"addClass":"removeClass",c=this.atExtremeAfter()?"addClass":"removeClass",a=this.beforeScrollerCls+"-disabled",b=this.afterScrollerCls+"-disabled";this.beforeScroller[d](a);this.afterScroller[c](b);this.scrolling=false},atExtremeBefore:function(){return this.getScrollPosition()===0},scrollLeft:function(a){this.scrollBy(-this.scrollIncrement,a)},scrollRight:function(a){this.scrollBy(this.scrollIncrement,a)},scrollToItem:function(d,b){d=this.getItem(d);if(d!=undefined){var a=this.getItemVisibility(d);if(!a.fullyVisible){var c=d.getBox(true,true),e=c.x;if(a.hiddenRight){e-=(this.layout.innerCt.getWidth()-c.width)}this.scrollTo(e,b)}}},getItemVisibility:function(e){var d=this.getItem(e).getBox(true,true),a=d.x,c=d.x+d.width,g=this.getScrollPosition(),b=this.layout.innerCt.getWidth()+g;return{hiddenLeft:a<g,hiddenRight:c>b,fullyVisible:a>g&&c<b}}});Ext.layout.boxOverflow.scroller=Ext.layout.boxOverflow.Scroller;Ext.layout.boxOverflow.VerticalScroller=Ext.extend(Ext.layout.boxOverflow.Scroller,{scrollIncrement:75,wheelIncrement:2,handleOverflow:function(a,b){Ext.layout.boxOverflow.VerticalScroller.superclass.handleOverflow.apply(this,arguments);return{targetSize:{height:b.height-(this.beforeCt.getHeight()+this.afterCt.getHeight()),width:b.width}}},createInnerElements:function(){var a=this.layout.innerCt;if(!this.beforeCt){this.beforeCt=a.insertSibling({cls:this.beforeCls},"before");this.afterCt=a.insertSibling({cls:this.afterCls},"after");this.createWheelListener()}},scrollTo:function(a,b){var d=this.getScrollPosition(),c=a.constrain(0,this.getMaxScrollBottom());if(c!=d&&!this.scrolling){if(b==undefined){b=this.animateScroll}this.layout.innerCt.scrollTo("top",c,b?this.getScrollAnim():false);if(b){this.scrolling=true}else{this.scrolling=false;this.updateScrollButtons()}}},getScrollPosition:function(){return parseInt(this.layout.innerCt.dom.scrollTop,10)||0},getMaxScrollBottom:function(){return this.layout.innerCt.dom.scrollHeight-this.layout.innerCt.getHeight()},atExtremeAfter:function(){return this.getScrollPosition()>=this.getMaxScrollBottom()}});Ext.layout.boxOverflow.scroller.vbox=Ext.layout.boxOverflow.VerticalScroller;Ext.layout.boxOverflow.HorizontalScroller=Ext.extend(Ext.layout.boxOverflow.Scroller,{handleOverflow:function(a,b){Ext.layout.boxOverflow.HorizontalScroller.superclass.handleOverflow.apply(this,arguments);return{targetSize:{height:b.height,width:b.width-(this.beforeCt.getWidth()+this.afterCt.getWidth())}}},createInnerElements:function(){var a=this.layout.innerCt;if(!this.beforeCt){this.afterCt=a.insertSibling({cls:this.afterCls},"before");this.beforeCt=a.insertSibling({cls:this.beforeCls},"before");this.createWheelListener()}},scrollTo:function(a,b){var d=this.getScrollPosition(),c=a.constrain(0,this.getMaxScrollRight());if(c!=d&&!this.scrolling){if(b==undefined){b=this.animateScroll}this.layout.innerCt.scrollTo("left",c,b?this.getScrollAnim():false);if(b){this.scrolling=true}else{this.scrolling=false;this.updateScrollButtons()}}},getScrollPosition:function(){return parseInt(this.layout.innerCt.dom.scrollLeft,10)||0},getMaxScrollRight:function(){return this.layout.innerCt.dom.scrollWidth-this.layout.innerCt.getWidth()},atExtremeAfter:function(){return this.getScrollPosition()>=this.getMaxScrollRight()}});Ext.layout.boxOverflow.scroller.hbox=Ext.layout.boxOverflow.HorizontalScroller;Ext.layout.HBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"top",type:"hbox",calculateChildBoxes:function(r,b){var F=r.length,R=this.padding,D=R.top,U=R.left,y=D+R.bottom,O=U+R.right,a=b.width-this.scrollOffset,e=b.height,o=Math.max(0,e-y),P=this.pack=="start",W=this.pack=="center",A=this.pack=="end",L=0,Q=0,T=0,l=0,X=0,H=[],k,J,M,V,w,j,S,I,c,x,q,N;for(S=0;S<F;S++){k=r[S];M=k.height;J=k.width;j=!k.hasLayout&&typeof k.doLayout=="function";if(typeof J!="number"){if(k.flex&&!J){T+=k.flex}else{if(!J&&j){k.doLayout()}V=k.getSize();J=V.width;M=V.height}}w=k.margins;x=w.left+w.right;L+=x+(J||0);l+=x+(k.flex?k.minWidth||0:J);X+=x+(k.minWidth||J||0);if(typeof M!="number"){if(j){k.doLayout()}M=k.getHeight()}Q=Math.max(Q,M+w.top+w.bottom);H.push({component:k,height:M||undefined,width:J||undefined})}var K=l-a,p=X>a;var n=Math.max(0,a-L-O);if(p){for(S=0;S<F;S++){H[S].width=r[S].minWidth||r[S].width||H[S].width}}else{if(K>0){var C=[];for(var E=0,v=F;E<v;E++){var B=r[E],t=B.minWidth||0;if(B.flex){H[E].width=t}else{C.push({minWidth:t,available:H[E].width-t,index:E})}}C.sort(function(Y,i){return Y.available>i.available?1:-1});for(var S=0,v=C.length;S<v;S++){var G=C[S].index;if(G==undefined){continue}var B=r[G],m=H[G],u=m.width,t=B.minWidth,d=Math.max(t,u-Math.ceil(K/(v-S))),g=u-d;H[G].width=d;K-=g}}else{var h=n,s=T;for(S=0;S<F;S++){k=r[S];I=H[S];w=k.margins;q=w.top+w.bottom;if(P&&k.flex&&!k.width){c=Math.ceil((k.flex/s)*h);h-=c;s-=k.flex;I.width=c;I.dirtySize=true}}}}if(W){U+=n/2}else{if(A){U+=n}}for(S=0;S<F;S++){k=r[S];I=H[S];w=k.margins;U+=w.left;q=w.top+w.bottom;I.left=U;I.top=D+w.top;switch(this.align){case"stretch":N=o-q;I.height=N.constrain(k.minHeight||0,k.maxHeight||1000000);I.dirtySize=true;break;case"stretchmax":N=Q-q;I.height=N.constrain(k.minHeight||0,k.maxHeight||1000000);I.dirtySize=true;break;case"middle":var z=o-I.height-q;if(z>0){I.top=D+q+(z/2)}}U+=I.width+w.right}return{boxes:H,meta:{maxHeight:Q,nonFlexWidth:L,desiredWidth:l,minimumWidth:X,shortfall:l-a,tooNarrow:p}}}});Ext.Container.LAYOUTS.hbox=Ext.layout.HBoxLayout;Ext.layout.VBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"left",type:"vbox",calculateChildBoxes:function(o,b){var E=o.length,R=this.padding,C=R.top,V=R.left,x=C+R.bottom,O=V+R.right,a=b.width-this.scrollOffset,c=b.height,K=Math.max(0,a-O),P=this.pack=="start",X=this.pack=="center",z=this.pack=="end",k=0,u=0,U=0,L=0,m=0,G=[],h,I,N,W,t,g,T,H,S,w,n,d,r;for(T=0;T<E;T++){h=o[T];N=h.height;I=h.width;g=!h.hasLayout&&typeof h.doLayout=="function";if(typeof N!="number"){if(h.flex&&!N){U+=h.flex}else{if(!N&&g){h.doLayout()}W=h.getSize();I=W.width;N=W.height}}t=h.margins;n=t.top+t.bottom;k+=n+(N||0);L+=n+(h.flex?h.minHeight||0:N);m+=n+(h.minHeight||N||0);if(typeof I!="number"){if(g){h.doLayout()}I=h.getWidth()}u=Math.max(u,I+t.left+t.right);G.push({component:h,height:N||undefined,width:I||undefined})}var M=L-c,l=m>c;var q=Math.max(0,(c-k-x));if(l){for(T=0,r=E;T<r;T++){G[T].height=o[T].minHeight||o[T].height||G[T].height}}else{if(M>0){var J=[];for(var D=0,r=E;D<r;D++){var A=o[D],s=A.minHeight||0;if(A.flex){G[D].height=s}else{J.push({minHeight:s,available:G[D].height-s,index:D})}}J.sort(function(Y,i){return Y.available>i.available?1:-1});for(var T=0,r=J.length;T<r;T++){var F=J[T].index;if(F==undefined){continue}var A=o[F],j=G[F],v=j.height,s=A.minHeight,B=Math.max(s,v-Math.ceil(M/(r-T))),e=v-B;G[F].height=B;M-=e}}else{var Q=q,p=U;for(T=0;T<E;T++){h=o[T];H=G[T];t=h.margins;w=t.left+t.right;if(P&&h.flex&&!h.height){S=Math.ceil((h.flex/p)*Q);Q-=S;p-=h.flex;H.height=S;H.dirtySize=true}}}}if(X){C+=q/2}else{if(z){C+=q}}for(T=0;T<E;T++){h=o[T];H=G[T];t=h.margins;C+=t.top;w=t.left+t.right;H.left=V+t.left;H.top=C;switch(this.align){case"stretch":d=K-w;H.width=d.constrain(h.minWidth||0,h.maxWidth||1000000);H.dirtySize=true;break;case"stretchmax":d=u-w;H.width=d.constrain(h.minWidth||0,h.maxWidth||1000000);H.dirtySize=true;break;case"center":var y=K-H.width-w;if(y>0){H.left=V+w+(y/2)}}C+=H.height+t.bottom}return{boxes:G,meta:{maxWidth:u,nonFlexHeight:k,desiredHeight:L,minimumHeight:m,shortfall:L-c,tooNarrow:l}}}});Ext.Container.LAYOUTS.vbox=Ext.layout.VBoxLayout;Ext.layout.ToolbarLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"toolbar",triggerWidth:18,noItemsMenuText:'<div class="x-toolbar-no-items">(None)</div>',lastOverflow:false,tableHTML:['<table cellspacing="0" class="x-toolbar-ct">',"<tbody>","<tr>",'<td class="x-toolbar-left" align="{0}">','<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-left-row"></tr>',"</tbody>","</table>","</td>",'<td class="x-toolbar-right" align="right">','<table cellspacing="0" class="x-toolbar-right-ct">',"<tbody>","<tr>","<td>",'<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-right-row"></tr>',"</tbody>","</table>","</td>","<td>",'<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-extras-row"></tr>',"</tbody>","</table>","</td>","</tr>","</tbody>","</table>","</td>","</tr>","</tbody>","</table>"].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<g;b++,d++){m=l[b];if(m.isFill){k=this.rightTr;d=-1}else{if(!m.rendered){m.render(this.insertCell(m,k,d));this.configureItem(m)}else{if(!m.xtbHidden&&!this.isValidParent(m,k.childNodes[d])){var a=this.insertCell(m,k,d);a.appendChild(m.getPositionEl().dom);m.container=Ext.get(a)}}}}this.cleanup(this.leftTr);this.cleanup(this.rightTr);this.cleanup(this.extrasTr);this.fitToSize(j)},cleanup:function(b){var e=b.childNodes,a,d;for(a=e.length-1;a>=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;g<h;g++){o=l[g];if(!o.isFill){d+=this.getItemWidth(o);if(d>m){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<a;d++){g=b[d];if(g.xtbHidden){if(e&&(c(g,e)||c(e,g))){h.add("-")}this.addComponentToMenu(h,g);e=g}}if(h.items.length<1){h.add(this.noItemsMenuText)}},initMore:function(){if(!this.more){this.moreMenu=new Ext.menu.Menu({ownerCt:this.container,listeners:{beforeshow:this.beforeMoreShow,scope:this}});this.more=new Ext.Button({iconCls:"x-toolbar-more-icon",cls:"x-toolbar-more",menu:this.moreMenu,ownerCt:this.container});var a=this.insertCell(this.more,this.extrasTr,100);this.more.render(a)}},destroy:function(){Ext.destroy(this.more,this.moreMenu);delete this.leftTr;delete this.rightTr;delete this.extrasTr;Ext.layout.ToolbarLayout.superclass.destroy.call(this)}});Ext.Container.LAYOUTS.toolbar=Ext.layout.ToolbarLayout;Ext.layout.MenuLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"menu",setContainer:function(a){this.monitorResize=!a.floating;a.on("autosize",this.doAutoSize,this);Ext.layout.MenuLayout.superclass.setContainer.call(this,a)},renderItem:function(g,b,e){if(!this.itemTpl){this.itemTpl=Ext.layout.MenuLayout.prototype.itemTpl=new Ext.XTemplate('<li id="{itemId}" class="{itemCls}">','<tpl if="needsIcon">','<img alt="{altText}" src="{icon}" class="{iconCls}"/>',"</tpl>","</li>")}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)}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(d){var a=d instanceof Ext.menu.Item,b=!(a||d instanceof Ext.menu.Separator);return{isMenuItem:a,needsIcon:b&&(d.icon||d.iconCls),icon:d.icon||Ext.BLANK_IMAGE_URL,iconCls:"x-menu-item-icon "+(d.iconCls||""),itemId:"x-menu-el-"+d.id,itemCls:"x-menu-list-item ",altText:d.altText||""}},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.isIE9m){c.setWidth(Ext.isStrict&&(Ext.isIE7||Ext.isIE8||Ext.isIE9)?"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='<span class="'+this.headerTextCls+'">'+this.header.dom.innerHTML+"</span>";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",alt:"",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('<div class="x-tool x-tool-{id}">&#160;</div>');h.disableFormats=true;h.compile();Ext.Panel.prototype.toolTemplate=h}for(var g=0,d=arguments,c=d.length;g<c;g++){var b=d[g];if(!this.tools[b.id]){var j="x-tool-"+b.id+"-over";var e=this.toolTemplate.insertFirst(this[this.toolTarget],b,true);this.tools[b.id]=e;e.enableDisplayMode("block");this.mon(e,"click",this.createToolHandler(e,b,j,this));if(b.on){this.mon(e,b.on)}if(b.hidden){e.hide()}if(b.qtip){if(Ext.isObject(b.qtip)){Ext.QuickTips.register(Ext.apply({target:e.id},b.qtip))}else{e.dom.qtip=b.qtip}}e.addClassOnOver(j)}}},onLayout:function(b,a){Ext.Panel.superclass.onLayout.apply(this,arguments);if(this.hasLayout&&this.toolbars.length>0){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.isIE9m){this.bbar.setStyle("position","static");this.bbar.setStyle("position","")}}}if(this.footer){this.footer.setWidth(a);if(this.fbar){this.fbar.setSize(Ext.isIE9m?(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=this.el.getFrameWidth("tb")+this.bwrap.getFrameWidth("tb");a+=(this.tbar?this.tbar.getHeight():0)+(this.bbar?this.bbar.getHeight():0);if(this.frame){a+=this.el.dom.firstChild.offsetHeight+this.ft.dom.offsetHeight+this.mc.getFrameWidth("tb")}else{a+=(this.header?this.header.getHeight():0)+(this.footer?this.footer.getHeight():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||(Ext.isIE7&&Ext.isStrict)){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('<tpl for="."><a href="#" class="color-{.}" hidefocus="on"><em><span style="background:#{.}" class="x-unselectable" unselectable="on">&#160;</span></em></a></tpl>');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:"&#160;OK&#160;",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.isIE9m){this.el.repaint()}},onDisable:function(){Ext.DatePicker.superclass.onDisable.call(this);this.doDisabled(true);if(Ext.isIE9m&&!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=['<table cellspacing="0">','<tr><td class="x-date-left"><a href="#" title="',this.prevText,'">&#160;</a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="',this.nextText,'">&#160;</a></td></tr>','<tr><td colspan="3"><table class="x-date-inner" cellspacing="0"><thead><tr>'],c=this.dayNames,h;for(h=0;h<7;h++){var k=this.startDay+h;if(k>6){k=k-7}a.push("<th><span>",c[k].substr(0,1),"</span></th>")}a[a.length]="</tr></thead><tbody><tr>";for(h=0;h<42;h++){if(h%7===0&&h!==0){a[a.length]="</tr><tr>"}a[a.length]='<td><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span></span></em></a></td>'}a.push("</tr></tbody></table></td></tr>",this.showToday?'<tr><td colspan="3" class="x-date-bottom" align="center"></td></tr>':"",'</table><div class="x-date-mp"></div>');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:"&#160;",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=['<table border="0" cellspacing="0">'];for(var b=0;b<6;b++){a.push('<tr><td class="x-date-mp-month"><a href="#">',Date.getShortMonthName(b),"</a></td>",'<td class="x-date-mp-month x-date-mp-sep"><a href="#">',Date.getShortMonthName(b+6),"</a></td>",b===0?'<td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-prev"></a></td><td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-next"></a></td></tr>':'<td class="x-date-mp-year"><a href="#"></a></td><td class="x-date-mp-year"><a href="#"></a></td></tr>')}a.push('<tr class="x-date-mp-btns"><td colspan="4"><button type="button" class="x-date-mp-ok">',this.okText,'</button><button type="button" class="x-date-mp-cancel">',this.cancelText,"</button></td></tr>","</table>");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=(m<u||m>y||(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(i<u){d.className=" x-date-disabled";d.title=J.minText;return}if(i>y){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<g;x++){r[x].innerHTML=(++h);D.setDate(D.getDate()+1);e[x].className="x-date-prevday";l(this,e[x])}for(;x<k;x++){var b=x-g+1;r[x].innerHTML=(b);D.setDate(D.getDate()+1);e[x].className="x-date-active";l(this,e[x])}var H=0;for(;x<42;x++){r[x].innerHTML=(++H);D.setDate(D.getDate()+1);e[x].className="x-date-nextday";l(this,e[x])}this.mbtn.setText(this.monthNames[G.getMonth()]+" "+G.getFullYear());if(!this.internalRender){var j=this.el.dom.firstChild,n=j.offsetWidth;this.el.setWidth(n+this.el.getBorderWidth("lr"));Ext.fly(j).setWidth(n);this.internalRender=true;if(Ext.isOpera&&!this.secondPass){j.rows[0].cells[1].style.width=(n-(j.rows[0].cells[0].offsetWidth+j.rows[0].cells[2].offsetWidth))+"px";this.secondPass=true;this.update.defer(10,this,[G])}}}},beforeDestroy:function(){if(this.rendered){Ext.destroy(this.keyNav,this.monthPicker,this.eventEl,this.mbtn,this.nextRepeater,this.prevRepeater,this.cells.el,this.todayBtn);delete this.textNodes;delete this.cells.elements}}});Ext.reg("datepicker",Ext.DatePicker);Ext.LoadMask=function(c,b){this.el=Ext.get(c);Ext.apply(this,b);if(this.store){this.store.on({scope:this,beforeload:this.onBeforeLoad,load:this.onLoad,exception:this.onLoad});this.removeMask=Ext.value(this.removeMask,false)}else{var a=this.el.getUpdater();a.showLoadIndicator=false;a.on({scope:this,beforeupdate:this.onBeforeLoad,update:this.onLoad,failure:this.onLoad});this.removeMask=Ext.value(this.removeMask,true)}};Ext.LoadMask.prototype={msg:"Loading...",msgCls:"x-mask-loading",disabled:false,disable:function(){this.disabled=true},enable:function(){this.disabled=false},onLoad:function(){this.el.unmask(this.removeMask)},onBeforeLoad:function(){if(!this.disabled){this.el.mask(this.msg,this.msgCls)}},show:function(){this.onBeforeLoad()},hide:function(){this.onLoad()},destroy:function(){if(this.store){this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.onLoad,this)}else{var a=this.el.getUpdater();a.un("beforeupdate",this.onBeforeLoad,this);a.un("update",this.onLoad,this);a.un("failure",this.onLoad,this)}}};Ext.slider.Thumb=Ext.extend(Object,{dragging:false,constructor:function(a){Ext.apply(this,a||{},{cls:"x-slider-thumb",constrain:false});Ext.slider.Thumb.superclass.constructor.call(this,a);if(this.slider.vertical){Ext.apply(this,Ext.slider.Thumb.Vertical)}},render:function(){this.el=this.slider.innerEl.insertFirst({cls:this.cls});this.initEvents()},enable:function(){this.disabled=false;this.el.removeClass(this.slider.disabledClass)},disable:function(){this.disabled=true;this.el.addClass(this.slider.disabledClass)},initEvents:function(){var a=this.el;a.addClassOnOver("x-slider-thumb-over");this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeDragStart.createDelegate(this),onStart:this.onDragStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onDragEnd.createDelegate(this),tolerance:3,autoStart:300});this.tracker.initEl(a)},onBeforeDragStart:function(a){if(this.disabled){return false}else{this.slider.promoteThumb(this);return true}},onDragStart:function(a){this.el.addClass("x-slider-thumb-drag");this.dragging=true;this.dragStartValue=this.value;this.slider.fireEvent("dragstart",this.slider,a,this)},onDrag:function(g){var c=this.slider,b=this.index,d=this.getNewValue();if(this.constrain){var a=c.thumbs[b+1],h=c.thumbs[b-1];if(h!=undefined&&d<=h.value){d=h.value}if(a!=undefined&&d>=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)}},destroy:function(){Ext.destroyMembers(this,"tracker","el")}});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,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;b<a.length;b++){this.addThumb(a[b])}if(this.vertical){Ext.apply(this,Ext.slider.Vertical)}},addThumb:function(b){var a=new Ext.slider.Thumb({value:b,slider:this,index:this.thumbs.length,constrain:this.constrainThumbs});this.thumbs.push(a);if(this.rendered){a.render()}},promoteThumb:function(d){var a=this.thumbs,g,b;for(var e=0,c=a.length;e<c;e++){b=a[e];if(b==d){g=this.topThumbZIndex}else{g=""}b.el.setStyle("zIndex",g)}},onRender:function(){this.autoEl={cls:"x-slider "+(this.vertical?"x-slider-vert":"x-slider-horz"),cn:{cls:"x-slider-end",cn:{cls:"x-slider-inner",cn:[{tag:"a",cls:"x-slider-focus",href:"#",tabIndex:"-1",hidefocus:"on"}]}}};Ext.slider.MultiSlider.superclass.onRender.apply(this,arguments);this.endEl=this.el.first();this.innerEl=this.endEl.first();this.focusEl=this.innerEl.child(".x-slider-focus");for(var b=0;b<this.thumbs.length;b++){this.thumbs[b].render()}var a=this.innerEl.child(".x-slider-thumb");this.halfThumb=(this.vertical?a.getHeight():a.getWidth())/2;this.initEvents()},initEvents:function(){this.mon(this.el,{scope:this,mousedown:this.onMouseDown,keydown:this.onKeyDown});this.focusEl.swallowEvent("click",true)},onMouseDown:function(d){if(this.disabled){return}var c=false;for(var b=0;b<this.thumbs.length;b++){c=c||d.target==this.thumbs[b].el.dom}if(this.clickToChange&&!c){var a=this.innerEl.translatePoints(d.getXY());this.onClickChange(a)}this.focus()},onClickChange:function(c){if(c.top>this.clickRange[0]&&c.top<this.clickRange[1]){var a=this.getNearest(c,"left"),b=a.index;this.setValue(b,Ext.util.Format.round(this.reverseValue(c.left),this.decimalPrecision),undefined,true)}},getNearest:function(k,b){var m=b=="top"?this.innerEl.getHeight()-k[b]:k[b],g=this.reverseValue(m),j=(this.maxValue-this.minValue)+5,e=0,c=null;for(var d=0;d<this.thumbs.length;d++){var a=this.thumbs[d],l=a.value,h=Math.abs(l-g);if(Math.abs(h<=j)){c=a;e=d;j=h}}return c},onKeyDown:function(b){if(this.disabled||this.thumbs.length!==1){b.preventDefault();return}var a=b.getKey(),c;switch(a){case b.UP:case b.RIGHT:b.stopEvent();c=b.ctrlKey?this.maxValue:this.getValue(0)+this.keyIncrement;this.setValue(0,c,undefined,true);break;case b.DOWN:case b.LEFT:b.stopEvent();c=b.ctrlKey?this.minValue:this.getValue(0)-this.keyIncrement;this.setValue(0,c,undefined,true);break;default:b.preventDefault()}},doSnap:function(b){if(!(this.increment&&b)){return b}var d=b,c=this.increment,a=b%c;if(a!=0){d-=a;if(a*2>=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;c<this.thumbs.length;c++){var b=this.thumbs[c];if(b.value!==undefined){var a=this.normalizeValue(b.value);if(a!==b.value){this.setValue(c,a,false)}else{this.moveThumb(c,this.translateValue(a),false)}}}},getRatio:function(){var a=this.innerEl.getWidth(),b=this.maxValue-this.minValue;return b==0?a:(a/b)},normalizeValue:function(a){a=this.doSnap(a);a=Ext.util.Format.round(a,this.decimalPrecision);a=a.constrain(this.minValue,this.maxValue);return a},setMinValue:function(e){this.minValue=e;var d=0,b=this.thumbs,a=b.length,c;for(;d<a;++d){c=b[d];c.value=c.value<e?e:c.value}this.syncThumb()},setMaxValue:function(e){this.maxValue=e;var d=0,b=this.thumbs,a=b.length,c;for(;d<a;++d){c=b[d];c.value=c.value>e?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(;d<a;++d){b[d].el.stopFx()}if(Ext.isNumber(c)){this.innerEl.setWidth(c-(this.el.getPadding("l")+this.endEl.getPadding("r")))}this.syncThumb();Ext.slider.MultiSlider.superclass.onResize.apply(this,arguments)},onDisable:function(){Ext.slider.MultiSlider.superclass.onDisable.call(this);for(var b=0;b<this.thumbs.length;b++){var a=this.thumbs[b],c=a.el;a.disable();if(Ext.isIE){var d=c.getXY();c.hide();this.innerEl.addClass(this.disabledClass).dom.disabled=true;if(!this.thumbHolder){this.thumbHolder=this.endEl.createChild({cls:"x-slider-thumb "+this.disabledClass})}this.thumbHolder.show().setXY(d)}}},onEnable:function(){Ext.slider.MultiSlider.superclass.onEnable.call(this);for(var b=0;b<this.thumbs.length;b++){var a=this.thumbs[b],c=a.el;a.enable();if(Ext.isIE){this.innerEl.removeClass(this.disabledClass).dom.disabled=false;if(this.thumbHolder){this.thumbHolder.hide()}c.show();this.syncThumb()}}},syncThumb:function(){if(this.rendered){for(var a=0;a<this.thumbs.length;a++){this.moveThumb(a,this.translateValue(this.thumbs[a].value))}}},getValue:function(a){return this.thumbs[a].value},getValues:function(){var a=[];for(var b=0;b<this.thumbs.length;b++){a.push(this.thumbs[b].value)}return a},beforeDestroy:function(){var b=this.thumbs;for(var c=0,a=b.length;c<a;++c){b[c].destroy();b[c]=null}Ext.destroyMembers(this,"endEl","innerEl","focusEl","thumbHolder");Ext.slider.MultiSlider.superclass.beforeDestroy.call(this)}});Ext.reg("multislider",Ext.slider.MultiSlider);Ext.slider.SingleSlider=Ext.extend(Ext.slider.MultiSlider,{constructor:function(a){a=a||{};Ext.applyIf(a,{values:[a.value||0]});Ext.slider.SingleSlider.superclass.constructor.call(this,a)},getValue:function(){return Ext.slider.SingleSlider.superclass.getValue.call(this,0)},setValue:function(d,b){var c=Ext.toArray(arguments),a=c.length;if(a==1||(a<=3&&typeof arguments[1]!="number")){c.unshift(0)}return Ext.slider.SingleSlider.superclass.setValue.apply(this,c)},syncThumb:function(){return Ext.slider.SingleSlider.superclass.syncThumb.apply(this,[0].concat(arguments))},getNearest:function(){return this.thumbs[0]}});Ext.Slider=Ext.slider.SingleSlider;Ext.reg("slider",Ext.slider.SingleSlider);Ext.slider.Vertical={onResize:function(a,b){this.innerEl.setHeight(b-(this.el.getPadding("t")+this.endEl.getPadding("b")));this.syncThumb()},getRatio:function(){var b=this.innerEl.getHeight(),a=this.maxValue-this.minValue;return b/a},moveThumb:function(d,c,b){var a=this.thumbs[d],e=a.el;if(!b||this.animate===false){e.setBottom(c)}else{e.shift({bottom:c,stopFx:true,duration:0.35})}},onClickChange:function(c){if(c.left>this.clickRange[0]&&c.left<this.clickRange[1]){var a=this.getNearest(c,"top"),b=a.index,d=this.minValue+this.reverseValue(this.innerEl.getHeight()-c.top);this.setValue(b,Ext.util.Format.round(d,this.decimalPrecision),undefined,true)}}};Ext.slider.Thumb.Vertical={getNewValue:function(){var b=this.slider,c=b.innerEl,d=c.translatePoints(this.tracker.getXY()),a=c.getHeight()-d.top;return b.minValue+Ext.util.Format.round(a/b.getRatio(),b.decimalPrecision)}};Ext.ProgressBar=Ext.extend(Ext.BoxComponent,{baseCls:"x-progress",animate:false,waitTimer:null,initComponent:function(){Ext.ProgressBar.superclass.initComponent.call(this);this.addEvents("update")},onRender:function(d,a){var c=new Ext.Template('<div class="{cls}-wrap">','<div class="{cls}-inner">','<div class="{cls}-bar">','<div class="{cls}-text">',"<div>&#160;</div>","</div>","</div>",'<div class="{cls}-text {cls}-text-back">',"<div>&#160;</div>","</div>","</div>","</div>");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||"&#160;";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);if(this.preventDefault||this.stopPropagation){if(this.preventDefault){g.preventDefault()}if(this.stopPropagation){g.stopPropagation()}}else{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<c;++e){if(this.invalidHandleClasses[e]==d){delete this.invalidHandleClasses[e]}}},isValidHandleChild:function(h){var g=true;var k;try{k=h.nodeName.toUpperCase()}catch(j){k=h.nodeName}g=g&&!this.invalidHandleTypes[k];g=g&&!this.invalidHandleIds[h.id];for(var d=0,c=this.invalidHandleClasses.length;g&&d<c;++d){g=!Ext.fly(h).hasClass(this.invalidHandleClasses[d])}return g},setXTicks:function(g,c){this.xTicks=[];this.xTickSize=c;var e={};for(var d=this.initPageX;d>=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<c;++d){var e=d+1;if(g[e]&&g[e]>=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,notifyOccluded:false,_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;d<b;++d){if(c[d].id==e.id){return true}}return false},isTypeOfDD:function(b){return(b&&b.__ygDragDrop)},isHandle:function(c,b){return(this.handleIds[c]&&this.handleIds[c][b])},getDDById:function(c){for(var b in this.ids){if(this.ids[b][c]){return this.ids[b][c]}}return null},handleMouseDown:function(d,c){if(Ext.QuickTips){Ext.QuickTips.ddDisable()}if(this.dragCurrent){this.handleMouseUp(d)}this.currentTarget=d.getTarget();this.dragCurrent=c;var b=c.getEl();this.startX=d.getPageX();this.startY=d.getPageY();this.deltaX=this.startX-b.offsetLeft;this.deltaY=this.startY-b.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var e=Ext.dd.DDM;e.startDrag(e.startX,e.startY)},this.clickTimeThresh)},startDrag:function(b,c){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(b,c);this.dragCurrent.startDrag(b,c)}this.dragThreshMet=true},handleMouseUp:function(b){if(Ext.QuickTips){Ext.QuickTips.ddEnable()}if(!this.dragCurrent){return}clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(b,true)}else{}this.stopDrag(b);this.stopEvent(b)},stopEvent:function(b){if(this.stopPropagation){b.stopPropagation()}if(this.preventDefault){b.preventDefault()}},stopDrag:function(b){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(b);this.dragCurrent.endDrag(b)}this.dragCurrent.onMouseUp(b)}this.dragCurrent=null;this.dragOvers={}},handleMouseMove:function(d){if(!this.dragCurrent){return true}if(Ext.isIE&&(d.button!==0&&d.button!==1&&d.button!==2)){this.stopEvent(d);return this.handleMouseUp(d)}if(!this.dragThreshMet){var c=Math.abs(this.startX-d.getPageX());var b=Math.abs(this.startY-d.getPageY());if(c>this.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(o,r){var q=this,l=q.dragCurrent,s=o.getPoint(),c,u,g=[],b=[],h=[],m=[],k=[],d=[],p,j,n,t;if(!l||l.isLocked()){return}for(j in q.dragOvers){c=q.dragOvers[j];if(!q.isTypeOfDD(c)){continue}if(!this.isOverTarget(s,c,q.mode)){h.push(c)}b[j]=true;delete q.dragOvers[j]}for(t in l.groups){if("string"!=typeof t){continue}for(j in q.ids[t]){c=q.ids[t][j];if(q.isTypeOfDD(c)&&(u=c.getEl())&&(c.isTarget)&&(!c.isLocked())&&((c!=l)||(l.ignoreSelf===false))){if((c.zIndex=q.getZIndex(u))!==-1){p=true}g.push(c)}}}if(p){g.sort(q.byZIndex)}for(j=0,n=g.length;j<n;j++){c=g[j];if(q.isOverTarget(s,c,q.mode)){if(r){k.push(c)}else{if(!b[c.id]){d.push(c)}else{m.push(c)}q.dragOvers[c.id]=c}if(!q.notifyOccluded){break}}}if(q.mode){if(h.length){l.b4DragOut(o,h);l.onDragOut(o,h)}if(d.length){l.onDragEnter(o,d)}if(m.length){l.b4DragOver(o,m);l.onDragOver(o,m)}if(k.length){l.b4DragDrop(o,k);l.onDragDrop(o,k)}}else{for(j=0,n=h.length;j<n;++j){l.b4DragOut(o,h[j].id);l.onDragOut(o,h[j].id)}for(j=0,n=d.length;j<n;++j){l.onDragEnter(o,d[j].id)}for(j=0,n=m.length;j<n;++j){l.b4DragOver(o,m[j].id);l.onDragOver(o,m[j].id)}for(j=0,n=k.length;j<n;++j){l.b4DragDrop(o,k[j].id);l.onDragDrop(o,k[j].id)}}if(r&&!k.length){l.onInvalidDrop(o)}},getZIndex:function(c){var b=document.body,d,e=-1;c=Ext.getDom(c);while(c!==b){if(!isNaN(d=Number(Ext.fly(c).getStyle("zIndex")))){e=d}c=c.parentNode}return e},byZIndex:function(c,b){return c.zIndex<b.zIndex},getBestMatch:function(d){var g=null;var c=d.length;if(c==1){g=d[0]}else{for(var e=0;e<c;++e){var b=d[e];if(b.cursorIsOver){g=b;break}else{if(!g||g.overlap.getArea()<b.overlap.getArea()){g=b}}}}return g},refreshCache:function(c){for(var b in c){if("string"!=typeof b){continue}for(var d in this.ids[b]){var e=this.ids[b][d];if(this.isTypeOfDD(e)){var g=this.getLocation(e);if(g){this.locationCache[e.id]=g}else{delete this.locationCache[e.id]}}}}},verifyEl:function(c){if(c){var b;if(Ext.isIE){try{b=c.offsetParent}catch(d){}}else{b=c.offsetParent}if(b){return true}}return false},getLocation:function(j){if(!this.isTypeOfDD(j)){return null}var h=j.getEl(),o,g,d,q,p,s,c,n,i,m;try{o=Ext.lib.Dom.getXY(h)}catch(k){}if(!o){return null}g=o[0];d=g+h.offsetWidth;q=o[1];p=q+h.offsetHeight;s=q-j.padding[0];c=d+j.padding[1];n=p+j.padding[2];i=g-j.padding[3];return new Ext.lib.Region(s,c,n,i)},isOverTarget:function(k,b,d){var g=this.locationCache[b.id];if(!g||!this.useCache){g=this.getLocation(b);this.locationCache[b.id]=g}if(!g){return false}b.cursorIsOver=g.contains(k);var j=this.dragCurrent;if(!j||!j.getTargetCoord||(!d&&!j.constrainX&&!j.constrainY)){return b.cursorIsOver}b.overlap=null;var h=j.getTargetCoord(k.x,k.y);var c=j.getDragEl();var e=new Ext.lib.Region(h.y,h.x+c.offsetWidth,h.y+c.offsetHeight,h.x);var i=e.intersect(g);if(i){b.overlap=i;return(d)?true:b.cursorIsOver}else{return false}},_onUnload:function(c,b){a.removeListener(document,"mouseup",this.handleMouseUp,this);a.removeListener(document,"mousemove",this.handleMouseMove,this);a.removeListener(window,"resize",this._onResize,this);Ext.dd.DragDropMgr.unregAll()},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null}this._execOnAll("unreg",[]);for(var b in this.elementCache){delete this.elementCache[b]}this.elementCache={};this.ids={}},elementCache:{},getElWrapper:function(c){var b=this.elementCache[c];if(!b||!b.el){b=this.elementCache[c]=new this.ElementWrapper(Ext.getDom(c))}return b},getElement:function(b){return Ext.getDom(b)},getCss:function(c){var b=Ext.getDom(c);return(b)?b.style:null},ElementWrapper:function(b){this.el=b||null;this.id=this.el&&b.id;this.css=this.el&&b.style},getPosX:function(b){return Ext.lib.Dom.getX(b)},getPosY:function(b){return Ext.lib.Dom.getY(b)},swapNode:function(d,b){if(d.swapNode){d.swapNode(b)}else{var e=b.parentNode;var c=b.nextSibling;if(c==d){e.insertBefore(d,b)}else{if(b==d.nextSibling){e.insertBefore(b,d)}else{d.parentNode.replaceChild(b,d);e.insertBefore(d,c)}}}},getScroll:function(){var d,b,e=document.documentElement,c=document.body;if(e&&(e.scrollTop||e.scrollLeft)){d=e.scrollTop;b=e.scrollLeft}else{if(c){d=c.scrollTop;b=c.scrollLeft}else{}}return{top:d,left:b}},getStyle:function(c,b){return Ext.fly(c).getStyle(b)},getScrollTop:function(){return this.getScroll().top},getScrollLeft:function(){return this.getScroll().left},moveToEl:function(b,d){var c=Ext.lib.Dom.getXY(d);Ext.lib.Dom.setXY(b,c)},numericSort:function(d,c){return(d-c)},_timeoutCount:0,_addListeners:function(){var b=Ext.dd.DDM;if(Ext.lib.Event&&document){b._onLoad()}else{if(b._timeoutCount>2000){}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&&i<c){window.scrollTo(d,p+a)}if(k<p&&p>0&&k-p<c){window.scrollTo(d,p-a)}if(o>b&&g<c){window.scrollTo(d+a,p)}if(l<d&&d>0&&l-d<c){window.scrollTo(d-a,p)}}},getTargetCoord:function(c,b){var a=c-this.deltaX;var d=b-this.deltaY;if(this.constrainX){if(a<this.minX){a=this.minX}if(a>this.maxX){a=this.maxX}}if(this.constrainY){if(d<this.minY){d=this.minY}if(d>this.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);delete this.el},onMouseDown:function(b,a){if(this.fireEvent("mousedown",this,b)!==false&&this.onBeforeStart(b)!==false){this.startXY=this.lastXY=b.getXY();this.dragTarget=this.delegate?a:this.el.dom;if(this.preventDefault!==false){b.preventDefault()}Ext.getDoc().on({scope:this,mouseup:this.onMouseUp,mousemove:this.onMouseMove,selectstart:this.stopSelect});if(this.autoStart){this.timer=this.triggerStart.defer(this.autoStart===true?1000:this.autoStart,this,[b])}}},onMouseMove:function(g,d){var b=Ext.isIE6||Ext.isIE7||Ext.isIE8;if(this.active&&b&&!g.browserEvent.button){g.preventDefault();this.onMouseUp(g);return}g.preventDefault();var c=g.getXY(),a=this.startXY;this.lastXY=c;if(!this.active){if(Math.abs(a[0]-c[0])>this.tolerance||Math.abs(a[1]-c[1])>this.tolerance){this.triggerStart(g)}else{return}}this.fireEvent("mousemove",this,g);this.onDrag(g);this.fireEvent("drag",this,g)},onMouseUp:function(c){var b=Ext.getDoc(),a=this.active;b.un("mousemove",this.onMouseMove,this);b.un("mouseup",this.onMouseUp,this);b.un("selectstart",this.stopSelect,this);c.preventDefault();this.clearStart();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(a);this.fireEvent("dragstart",this,a)},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),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 o=m.ddScrollConfig?m.ddScrollConfig.ddGroup:undefined,n=(m.ddScrollConfig&&m.ddScrollConfig.frequency)?m.ddScrollConfig.frequency:Ext.dd.ScrollManager.frequency;if(o===undefined||c.dragCurrent.ddGroup==o){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<l;m++){this.register(n[m])}}else{n=Ext.get(n);e[n.id]=n}},unregister:function(n){if(Ext.isArray(n)){for(var m=0,l=n.length;m<l;m++){this.unregister(n[m])}}else{n=Ext.get(n);delete e[n.id]}},vthresh:25,hthresh:25,increment:100,frequency:500,animate:true,animDuration:0.4,ddGroup:undefined,refreshCache:function(){for(var l in e){if(typeof e[l]=="object"){e[l]._region=e[l].getRegion()}}}}}();Ext.dd.Registry=function(){var d={};var b={};var a=0;var c=function(g,e){if(typeof g=="string"){return g}var h=g.id;if(!h&&e!==false){h="extdd-"+(++a);g.id=h}return h};return{register:function(j,k){k=k||{};if(typeof j=="string"){j=document.getElementById(j)}k.ddel=j;d[c(j)]=k;if(k.isHandle!==false){b[k.ddel.id]=k}if(k.handles){var h=k.handles;for(var g=0,e=h.length;g<e;g++){b[c(h[g])]=k}}},unregister:function(j){var l=c(j,false);var k=d[l];if(k){delete d[l];if(k.handles){var h=k.handles;for(var g=0,e=h.length;g<e;g++){delete b[c(h[g],false)]}}}},getHandle:function(e){if(typeof e!="string"){e=e.id}return b[e]},getHandleFromEvent:function(h){var g=Ext.lib.Event.getTarget(h);return g?b[g.id]:null},getTarget:function(e){if(typeof e!="string"){e=e.id}return d[e]},getTargetFromEvent:function(h){var g=Ext.lib.Event.getTarget(h);return g?d[g.id]||b[g.id]:null}}}();Ext.dd.StatusProxy=function(a){Ext.apply(this,a);this.id=this.id||Ext.id();this.el=new Ext.Layer({dh:{id:this.id,tag:"div",cls:"x-dd-drag-proxy "+this.dropNotAllowed,children:[{tag:"div",cls:"x-dd-drop-icon"},{tag:"div",cls:"x-dd-drag-ghost"}]},shadow:!a||a.shadow!==false});this.ghost=Ext.get(this.el.dom.childNodes[1]);this.dropStatus=this.dropNotAllowed};Ext.dd.StatusProxy.prototype={dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",setStatus:function(a){a=a||this.dropNotAllowed;if(this.dropStatus!=a){this.el.replaceClass(this.dropStatus,a);this.dropStatus=a}},reset:function(a){this.el.dom.className="x-dd-drag-proxy "+this.dropNotAllowed;this.dropStatus=this.dropNotAllowed;if(a){this.ghost.update("")}},update:function(a){if(typeof a=="string"){this.ghost.update(a)}else{this.ghost.update("");a.style.margin="0";this.ghost.dom.appendChild(a)}var b=this.ghost.dom.firstChild;if(b){Ext.fly(b).setStyle("float","none")}},getEl:function(){return this.el},getGhost:function(){return this.ghost},hide:function(a){this.el.hide();if(a){this.reset(true)}},stop:function(){if(this.anim&&this.anim.isAnimated&&this.anim.isAnimated()){this.anim.stop()}},show:function(){this.el.show()},sync:function(){this.el.sync()},repair:function(b,c,a){this.callback=c;this.scope=a;if(b&&this.animRepair!==false){this.el.addClass("x-dd-drag-repair");this.el.hideUnders(true);this.anim=this.el.shift({duration:this.repairDuration||0.5,easing:"easeOut",xy:b,stopFx:true,callback:this.afterRepair,scope:this})}else{this.afterRepair()}},afterRepair:function(){this.hide(true);if(typeof this.callback=="function"){this.callback.call(this.scope||this)}this.callback=null;this.scope=null},destroy:function(){Ext.destroy(this.ghost,this.el)}};Ext.dd.DragSource=function(b,a){this.el=Ext.get(b);if(!this.dragData){this.dragData={}}Ext.apply(this,a);if(!this.proxy){this.proxy=new Ext.dd.StatusProxy()}Ext.dd.DragSource.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{dragElId:this.proxy.id,resizeFrame:false,isTarget:false,scroll:this.scroll===true});this.dragging=false};Ext.extend(Ext.dd.DragSource,Ext.dd.DDProxy,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",getDragData:function(a){return this.dragData},onDragEnter:function(c,d){var b=Ext.dd.DragDropMgr.getDDById(d);this.cachedTarget=b;if(this.beforeDragEnter(b,c,d)!==false){if(b.isNotifyTarget){var a=b.notifyEnter(this,c,this.dragData);this.proxy.setStatus(a)}else{this.proxy.setStatus(this.dropAllowed)}if(this.afterDragEnter){this.afterDragEnter(b,c,d)}}},beforeDragEnter:function(b,a,c){return true},alignElWithMouse:function(){Ext.dd.DragSource.superclass.alignElWithMouse.apply(this,arguments);this.proxy.sync()},onDragOver:function(c,d){var b=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(d);if(this.beforeDragOver(b,c,d)!==false){if(b.isNotifyTarget){var a=b.notifyOver(this,c,this.dragData);this.proxy.setStatus(a)}if(this.afterDragOver){this.afterDragOver(b,c,d)}}},beforeDragOver:function(b,a,c){return true},onDragOut:function(b,c){var a=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(c);if(this.beforeDragOut(a,b,c)!==false){if(a.isNotifyTarget){a.notifyOut(this,b,this.dragData)}this.proxy.reset();if(this.afterDragOut){this.afterDragOut(a,b,c)}}this.cachedTarget=null},beforeDragOut:function(b,a,c){return true},onDragDrop:function(b,c){var a=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(c);if(this.beforeDragDrop(a,b,c)!==false){if(a.isNotifyTarget){if(a.notifyDrop(this,b,this.dragData)){this.onValidDrop(a,b,c)}else{this.onInvalidDrop(a,b,c)}}else{this.onValidDrop(a,b,c)}if(this.afterDragDrop){this.afterDragDrop(a,b,c)}}delete this.cachedTarget},beforeDragDrop:function(b,a,c){return true},onValidDrop:function(b,a,c){this.hideProxy();if(this.afterValidDrop){this.afterValidDrop(b,a,c)}},getRepairXY:function(b,a){return this.el.getXY()},onInvalidDrop:function(b,a,c){this.beforeInvalidDrop(b,a,c);if(this.cachedTarget){if(this.cachedTarget.isNotifyTarget){this.cachedTarget.notifyOut(this,a,this.dragData)}this.cacheTarget=null}this.proxy.repair(this.getRepairXY(a,this.dragData),this.afterRepair,this);if(this.afterInvalidDrop){this.afterInvalidDrop(a,c)}},afterRepair:function(){if(Ext.enableFx){this.el.highlight(this.hlColor||"c3daf9")}this.dragging=false},beforeInvalidDrop:function(b,a,c){return true},handleMouseDown:function(b){if(this.dragging){return}var a=this.getDragData(b);if(a&&this.onBeforeDrag(a,b)!==false){this.dragData=a;this.proxy.stop();Ext.dd.DragSource.superclass.handleMouseDown.apply(this,arguments)}},onBeforeDrag:function(a,b){return true},onStartDrag:Ext.emptyFn,startDrag:function(a,b){this.proxy.reset();this.dragging=true;this.proxy.update("");this.onInitDrag(a,b);this.proxy.show()},onInitDrag:function(a,c){var b=this.el.dom.cloneNode(true);b.id=Ext.id();this.proxy.update(b);this.onStartDrag(a,c);return true},getProxy:function(){return this.proxy},hideProxy:function(){this.proxy.hide();this.proxy.reset(true);this.dragging=false},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)},b4EndDrag:function(a){},endDrag:function(a){this.onEndDrag(this.dragData,a)},onEndDrag:function(a,b){},autoOffset:function(a,b){this.setDelta(-12,-20)},destroy:function(){Ext.dd.DragSource.superclass.destroy.call(this);Ext.destroy(this.proxy)}});Ext.dd.DropTarget=Ext.extend(Ext.dd.DDTarget,{constructor:function(b,a){this.el=Ext.get(b);Ext.apply(this,a);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el)}Ext.dd.DropTarget.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{isTarget:true})},dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",isTarget:true,isNotifyTarget:true,notifyEnter:function(a,c,b){if(this.overClass){this.el.addClass(this.overClass)}return this.dropAllowed},notifyOver:function(a,c,b){return this.dropAllowed},notifyOut:function(a,c,b){if(this.overClass){this.el.removeClass(this.overClass)}},notifyDrop:function(a,c,b){return false},destroy:function(){Ext.dd.DropTarget.superclass.destroy.call(this);if(this.containerScroll){Ext.dd.ScrollManager.unregister(this.el)}}});Ext.dd.DragZone=Ext.extend(Ext.dd.DragSource,{constructor:function(b,a){Ext.dd.DragZone.superclass.constructor.call(this,b,a);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el)}},getDragData:function(a){return Ext.dd.Registry.getHandleFromEvent(a)},onInitDrag:function(a,b){this.proxy.update(this.dragData.ddel.cloneNode(true));this.onStartDrag(a,b);return true},afterRepair:function(){if(Ext.enableFx){Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9")}this.dragging=false},getRepairXY:function(a){return Ext.Element.fly(this.dragData.ddel).getXY()},destroy:function(){Ext.dd.DragZone.superclass.destroy.call(this);if(this.containerScroll){Ext.dd.ScrollManager.unregister(this.el)}}});Ext.dd.DropZone=function(b,a){Ext.dd.DropZone.superclass.constructor.call(this,b,a)};Ext.extend(Ext.dd.DropZone,Ext.dd.DropTarget,{getTargetFromEvent:function(a){return Ext.dd.Registry.getTargetFromEvent(a)},onNodeEnter:function(d,a,c,b){},onNodeOver:function(d,a,c,b){return this.dropAllowed},onNodeOut:function(d,a,c,b){},onNodeDrop:function(d,a,c,b){return false},onContainerOver:function(a,c,b){return this.dropNotAllowed},onContainerDrop:function(a,c,b){return false},notifyEnter:function(a,c,b){return this.dropNotAllowed},notifyOver:function(a,c,b){var d=this.getTargetFromEvent(c);if(!d){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,c,b);this.lastOverNode=null}return this.onContainerOver(a,c,b)}if(this.lastOverNode!=d){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,c,b)}this.onNodeEnter(d,a,c,b);this.lastOverNode=d}return this.onNodeOver(d,a,c,b)},notifyOut:function(a,c,b){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,c,b);this.lastOverNode=null}},notifyDrop:function(a,c,b){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,c,b);this.lastOverNode=null}var d=this.getTargetFromEvent(c);return d?this.onNodeDrop(d,a,c,b):this.onContainerDrop(a,c,b)},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)}});Ext.Element.addMethods({initDD:function(c,b,d){var a=new Ext.dd.DD(Ext.id(this.dom),c,b);return Ext.apply(a,d)},initDDProxy:function(c,b,d){var a=new Ext.dd.DDProxy(Ext.id(this.dom),c,b);return Ext.apply(a,d)},initDDTarget:function(c,b,d){var a=new Ext.dd.DDTarget(Ext.id(this.dom),c,b);return Ext.apply(a,d)}});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,g){var b=(c.api[g])?c.api[g].url:null;var e=true;for(var d in c.api){if((e=(d===g)?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(i,j,g,e){var d=j.reader;var h=new Ext.data.Response({action:i,raw:g});switch(g.status){case 200:return true;break;case 201:if(Ext.isEmpty(h.raw.responseText)){h.success=true}else{return true}break;case 204:h.success=true;h.data=null;break;default:return true;break}if(h.success===true){this.fireEvent("write",this,i,h.data,h,e,j.request.arg)}else{this.fireEvent("exception",this,"remote",i,j,h,e)}j.request.callback.call(j.request.scope,h.data,h,h.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(g){return g.name});for(var b=0,a=e.length;b<a;b++){d.fields.add(new Ext.data.Field(e[b]))}c.getField=function(g){return d.fields.get(g)};return c};Ext.data.Record.PREFIX="ext-record";Ext.data.Record.AUTO_ID=1;Ext.data.Record.EDIT="edit";Ext.data.Record.REJECT="reject";Ext.data.Record.COMMIT="commit";Ext.data.Record.id=function(a){a.phantom=true;return[Ext.data.Record.PREFIX,"-",Ext.data.Record.AUTO_ID++].join("")};Ext.data.Record.prototype={dirty:false,editing:false,error:null,modified:null,phantom:false,join:function(a){this.store=a},set:function(a,c){var b=Ext.isPrimitive(c)?String:Ext.encode;if(b(this.data[a])==b(c)){return}this.dirty=true;if(!this.modified){this.modified={}}if(this.modified[a]===undefined){this.modified[a]=this.data[a]}this.data[a]=c;if(!this.editing){this.afterEdit()}},afterEdit:function(){if(this.store!=undefined&&typeof this.store.afterEdit=="function"){this.store.afterEdit(this)}},afterReject:function(){if(this.store){this.store.afterReject(this)}},afterCommit:function(){if(this.store){this.store.afterCommit(this)}},get:function(a){return this.data[a]},beginEdit:function(){this.editing=true;this.modified=this.modified||{}},cancelEdit:function(){this.editing=false;delete this.modified},endEdit:function(){this.editing=false;if(this.dirty){this.afterEdit()}},reject:function(b){var a=this.modified;for(var c in a){if(typeof a[c]!="function"){this.data[c]=a[c]}}this.dirty=false;delete this.modified;this.editing=false;if(b!==true){this.afterReject()}},commit:function(a){this.dirty=false;delete this.modified;this.editing=false;if(a!==true){this.afterCommit()}},getChanges:function(){var a=this.modified,b={};for(var c in a){if(a.hasOwnProperty(c)){b[c]=this.data[c]}}return b},hasError:function(){return this.error!==null},clearError:function(){this.error=null},copy:function(a){return new this.constructor(Ext.apply({},this.data),a||this.id)},isModified:function(a){return !!(this.modified&&this.modified.hasOwnProperty(a))},isValid:function(){return this.fields.find(function(a){return(a.allowBlank===false&&Ext.isEmpty(this.data[a.name]))?true:false},this)?false:true},markDirty:function(){this.dirty=true;if(!this.modified){this.modified={}}this.fields.each(function(a){this.modified[a.name]=this.data[a.name]},this)}};Ext.StoreMgr=Ext.apply(new Ext.util.MixedCollection(),{register:function(){for(var a=0,b;(b=arguments[a]);a++){this.add(b)}},unregister:function(){for(var a=0,b;(b=arguments[a]);a++){this.remove(this.lookup(b))}},lookup:function(e){if(Ext.isArray(e)){var b=["field1"],d=!Ext.isArray(e[0]);if(!d){for(var c=2,a=e[0].length;c<=a;++c){b.push("field"+c)}}return new Ext.data.ArrayStore({fields:b,data:e,expandData:d,autoDestroy:true,autoCreated:true})}return Ext.isObject(e)?(e.events?e:Ext.create(e,"store")):this.get(e)},getKey:function(a){return a.storeId}});Ext.data.Store=Ext.extend(Ext.util.Observable,{writer:undefined,remoteSort:false,autoDestroy:false,pruneModifiedRecords:false,lastOptions:null,autoSave:true,batch:true,restful:false,paramNames:undefined,defaultParamNames:{start:"start",limit:"limit",sort:"sort",dir:"dir"},isDestroyed:false,hasMultiSort:false,batchKey:"_ext_batch_",constructor:function(a){this.data=new Ext.util.MixedCollection(false);this.data.getKey=function(b){return b.id};this.removed=[];if(a&&a.data){this.inlineData=a.data;delete a.data}Ext.apply(this,a);this.baseParams=Ext.isObject(this.baseParams)?this.baseParams:{};this.paramNames=Ext.applyIf(this.paramNames||{},this.defaultParamNames);if((this.url||this.api)&&!this.proxy){this.proxy=new Ext.data.HttpProxy({url:this.url,api:this.api})}if(this.restful===true&&this.proxy){this.batch=false;Ext.data.Api.restify(this.proxy)}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){if(this.writer instanceof (Ext.data.DataWriter)===false){this.writer=this.buildWriter(this.writer)}this.writer.meta=this.reader.meta;this.pruneModifiedRecords=true}}if(this.recordType){this.fields=this.recordType.prototype.fields}this.modified=[];this.addEvents("datachanged","metachange","add","remove","update","clear","exception","beforeload","load","loadexception","beforewrite","write","beforesave","save");if(this.proxy){this.relayEvents(this.proxy,["loadexception","exception"])}if(this.writer){this.on({scope:this,add:this.createRecords,remove:this.destroyRecord,update:this.updateRecord,clear:this.onClear})}this.sortToggle={};if(this.sortField){this.setDefaultSort(this.sortField,this.sortDir)}else{if(this.sortInfo){this.setDefaultSort(this.sortInfo.field,this.sortInfo.direction)}}Ext.data.Store.superclass.constructor.call(this);if(this.id){this.storeId=this.id;delete this.id}if(this.storeId){Ext.StoreMgr.register(this)}if(this.inlineData){this.loadData(this.inlineData);delete this.inlineData}else{if(this.autoLoad){this.load.defer(10,this,[typeof this.autoLoad=="object"?this.autoLoad:undefined])}}this.batchCounter=0;this.batches={}},buildWriter:function(b){var a=undefined,c=(b.format||"json").toLowerCase();switch(c){case"json":a=Ext.data.JsonWriter;break;case"xml":a=Ext.data.XmlWriter;break;default:a=Ext.data.JsonWriter}return new a(b)},destroy:function(){if(!this.isDestroyed){if(this.storeId){Ext.StoreMgr.unregister(this)}this.clearData();this.data=null;Ext.destroy(this.proxy);this.reader=this.writer=null;this.purgeListeners();this.isDestroyed=true}},add:function(c){var e,a,b,d;c=[].concat(c);if(c.length<1){return}for(e=0,a=c.length;e<a;e++){b=c[e];b.join(this);if(b.dirty||b.phantom){this.modified.push(b)}}d=this.data.length;this.data.addAll(c);if(this.snapshot){this.snapshot.addAll(c)}this.fireEvent("add",this,c,d)},addSorted:function(a){var b=this.findInsertIndex(a);this.insert(b,a)},doUpdate:function(a){var b=a.id;this.getById(b).join(null);this.data.replace(b,a);if(this.snapshot){this.snapshot.replace(b,a)}a.join(this);this.fireEvent("update",this,a,Ext.data.Record.COMMIT)},remove:function(a){if(Ext.isArray(a)){Ext.each(a,function(c){this.remove(c)},this);return}var b=this.data.indexOf(a);if(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(d,c){var e,a,b;c=[].concat(c);for(e=0,a=c.length;e<a;e++){b=c[e];this.data.insert(d+e,b);b.join(this);if(b.dirty||b.phantom){this.modified.push(b)}}if(this.snapshot){this.snapshot.addAll(c)}this.fireEvent("add",this,c,d)},indexOf:function(a){return this.data.indexOf(a)},indexOfId:function(a){return this.data.indexOfKey(a)},getById:function(a){return(this.snapshot||this.data).key(a)},getAt:function(a){return this.data.itemAt(a)},getRange:function(b,a){return this.data.getRange(b,a)},storeOptions:function(a){a=Ext.apply({},a);delete a.callback;delete a.scope;this.lastOptions=a},clearData:function(){this.data.each(function(a){a.join(null)});this.data.clear()},load:function(b){b=Ext.apply({},b);this.storeOptions(b);if(this.sortInfo&&this.remoteSort){var a=this.paramNames;b.params=Ext.apply({},b.params);b.params[a.sort]=this.sortInfo.field;b.params[a.dir]=this.sortInfo.direction}try{return this.execute("read",null,b)}catch(c){this.handleException(c);return false}},updateRecord:function(b,a,c){if(c==Ext.data.Record.EDIT&&this.autoSave===true&&(!a.phantom||(a.phantom&&a.isValid()))){this.save()}},createRecords:function(c,b,e){var d=this.modified,h=b.length,a,g;for(g=0;g<h;g++){a=b[g];if(a.phantom&&a.isValid()){a.markDirty();if(d.indexOf(a)==-1){d.push(a)}}}if(this.autoSave===true){this.save()}},destroyRecord:function(b,a,c){if(this.modified.indexOf(a)!=-1){this.modified.remove(a)}if(!a.phantom){this.removed.push(a);a.lastIndex=c;if(this.autoSave===true){this.save()}}},execute:function(e,a,c,b){if(!Ext.data.Api.isAction(e)){throw new Ext.data.Api.Error("execute",e)}c=Ext.applyIf(c||{},{params:{}});if(b!==undefined){this.addToBatch(b)}var d=true;if(e==="read"){d=this.fireEvent("beforeload",this,c);Ext.applyIf(c.params,this.baseParams)}else{if(this.writer.listful===true&&this.restful!==true){a=(Ext.isArray(a))?a:[a]}else{if(Ext.isArray(a)&&a.length==1){a=a.shift()}}if((d=this.fireEvent("beforewrite",this,e,a,c))!==false){this.writer.apply(c.params,this.baseParams,e,a)}}if(d!==false){if(this.writer&&this.proxy.url&&!this.proxy.restful&&!Ext.data.Api.hasUniqueUrl(this.proxy,e)){c.params.xaction=e}this.proxy.request(Ext.data.Api.actions[e],a,c.params,this.reader,this.createCallback(e,a,b),this,c)}return d},save:function(){if(!this.writer){throw new Ext.data.Store.Error("writer-undefined")}var h=[],j,k,e,c={},d;if(this.removed.length){h.push(["destroy",this.removed])}var b=[].concat(this.getModifiedRecords());if(b.length){var g=[];for(d=b.length-1;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(d=0;d<j;++d){k=h[d];c[k[0]]=k[1]}if(this.fireEvent("beforesave",this,c)!==false){for(d=0;d<j;++d){k=h[d];this.doTransaction(k[0],k[1],e)}return e}}return -1},doTransaction:function(e,b,c){function g(h){try{this.execute(e,h,undefined,c)}catch(i){this.handleException(i)}}if(this.batch===false){for(var d=0,a=b.length;d<a;d++){g.call(this,b[d])}}else{g.call(this,b)}},addToBatch:function(c){var a=this.batches,d=this.batchKey+c,e=a[d];if(!e){a[d]=e={id:c,count:0,data:{}}}++e.count},removeFromBatch:function(d,h,g){var c=this.batches,e=this.batchKey+d,i=c[e],a;if(i){a=i.data[h]||[];i.data[h]=a.concat(g);if(i.count===1){g=i.data;delete c[e];this.fireEvent("save",this,d,g)}else{--i.count}}},createCallback:function(c,a,b){var d=Ext.data.Api.actions;return(c=="read")?this.loadRecords:function(g,e,h){this["on"+Ext.util.Format.capitalize(c)+"Records"](h,a,[].concat(g));if(h===true){this.fireEvent("write",this,c,g,e,a)}this.removeFromBatch(b,c,g)}},clearModified:function(a){if(Ext.isArray(a)){for(var b=a.length-1;b>=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<a;d++){this.reMap(b[d])}}else{delete this.data.map[b._phid];this.data.map[b.id]=b;var c=this.data.keys.indexOf(b._phid);this.data.keys.splice(c,1,b.id);delete b._phid}},onCreateRecords:function(d,a,b){if(d===true){try{this.reader.realize(a,b)}catch(c){this.handleException(c);if(Ext.isArray(a)){this.onCreateRecords(d,a,b)}}}},onUpdateRecords:function(d,a,b){if(d===true){try{this.reader.update(a,b)}catch(c){this.handleException(c);if(Ext.isArray(a)){this.onUpdateRecords(d,a,b)}}}},onDestroyRecords:function(e,b,d){b=(b instanceof Ext.data.Record)?[b]:[].concat(b);for(var c=0,a=b.length;c<a;c++){this.removed.splice(this.removed.indexOf(b[c]),1)}if(e===false){for(c=b.length-1;c>=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(b,l,h){var e,g;if(this.isDestroyed===true){return}if(!b||h===false){if(h!==false){this.fireEvent("load",this,[],l)}if(l.callback){l.callback.call(l.scope||this,[],l,false,b)}return}var a=b.records,j=b.totalRecords||a.length;if(!l||l.add!==true){if(this.pruneModifiedRecords){this.modified=[]}for(e=0,g=a.length;e<g;e++){a[e].join(this)}if(this.snapshot){this.data=this.snapshot;delete this.snapshot}this.clearData();this.data.addAll(a);this.totalLength=j;this.applySort();this.fireEvent("datachanged",this)}else{var k=[],d,c=0;for(e=0,g=a.length;e<g;++e){d=a[e];if(this.indexOfId(d.id)>-1){this.doUpdate(d)}else{k.push(d);++c}}this.totalLength=Math.max(j,this.data.length+c);this.add(k)}this.fireEvent("load",this,a,l);if(l.callback){l.callback.call(l.scope||this,a,l,true)}},loadData:function(c,a){var b=this.reader.readRecords(c);this.loadRecords(b,{add:a},true)},getCount:function(){return this.data.length||0},getTotalCount:function(){return this.totalLength||0},getSortState:function(){return this.sortInfo},applySort:function(){if((this.sortInfo||this.multiSortInfo)&&!this.remoteSort){this.sortData()}},sortData:function(){var a=this.hasMultiSort?this.multiSortInfo:this.sortInfo,k=a.direction||"ASC",h=a.sorters,c=[];if(!this.hasMultiSort){h=[{direction:k,field:a.field}]}for(var d=0,b=h.length;d<b;d++){c.push(this.createSortFunction(h[d].field,h[d].direction))}if(c.length==0){return}var g=k.toUpperCase()=="DESC"?-1:1;var e=function(n,m){var l=c[0].call(this,n,m);if(c.length>1){for(var p=1,o=c.length;p<o;p++){l=l||c[p].call(this,n,m)}}return g*l};this.data.sort(k,e);if(this.snapshot&&this.snapshot!=this.data){this.snapshot.sort(k,e)}},createSortFunction:function(c,b){b=b||"ASC";var a=b.toUpperCase()=="DESC"?-1:1;var d=this.fields.get(c).sortType;return function(g,e){var i=d(g.data[c]),h=d(e.data[c]);return a*(i>h?1:(i<h?-1:0))}},setDefaultSort:function(b,a){a=a?a.toUpperCase():"ASC";this.sortInfo={field:b,direction:a};this.sortToggle[b]=a},sort:function(b,a){if(Ext.isArray(arguments[0])){return this.multiSort.call(this,b,a)}else{return this.singleSort(b,a)}},singleSort:function(g,c){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};this.hasMultiSort=false;if(this.remoteSort){if(!this.load(this.lastOptions)){if(d){this.sortToggle[b]=d}if(a){this.sortInfo=a}}}else{this.applySort();this.fireEvent("datachanged",this)}return true},multiSort:function(b,a){this.hasMultiSort=true;a=a||"ASC";if(this.multiSortInfo&&a==this.multiSortInfo.direction){a=a.toggle("ASC","DESC")}this.multiSortInfo={sorters:b,direction:a};if(this.remoteSort){this.singleSort(b[0].field,b[0].direction)}else{this.applySort();this.fireEvent("datachanged",this)}},each:function(b,a){this.data.each(b,a)},getModifiedRecords:function(){return this.modified},sum:function(e,g,a){var c=this.data.items,b=0;g=g||0;a=(a||a===0)?a:c.length-1;for(var d=g;d<=a;d++){b+=(c[d].data[e]||0)}return b},createFilterFn:function(d,c,e,a,b){if(Ext.isEmpty(c,false)){return false}c=this.data.createValueMatcher(c,e,a,b);return function(g){return c.test(g.data[d])}},createMultipleFilterFn:function(a){return function(b){var k=true;for(var d=0,c=a.length;d<c;d++){var h=a[d],g=h.fn,e=h.scope;k=k&&g.call(e,b)}return k}},filter:function(n,m,h,k,e){var l;if(Ext.isObject(n)){n=[n]}if(Ext.isArray(n)){var b=[];for(var g=0,d=n.length;g<d;g++){var a=n[g],c=a.fn,o=a.scope||this;if(!Ext.isFunction(c)){c=this.createFilterFn(a.property,a.value,a.anyMatch,a.caseSensitive,a.exactMatch)}b.push({fn:c,scope:o})}l=this.createMultipleFilterFn(b)}else{l=this.createFilterFn(n,m,h,k,e)}return l?this.filterBy(l):this.clearFilter()},filterBy:function(b,a){this.snapshot=this.snapshot||this.data;this.data=this.queryBy(b,a||this);this.fireEvent("datachanged",this)},clearFilter:function(a){if(this.isFiltered()){this.data=this.snapshot;delete this.snapshot;if(a!==true){this.fireEvent("datachanged",this)}}},isFiltered:function(){return !!this.snapshot&&this.snapshot!=this.data},query:function(d,c,e,a){var b=this.createFilterFn(d,c,e,a);return b?this.queryBy(b):this.data.clone()},queryBy:function(b,a){var c=this.snapshot||this.data;return c.filterBy(b,a||this)},find:function(d,c,g,e,a){var b=this.createFilterFn(d,c,e,a);return b?this.data.findIndexBy(b,null,g):-1},findExact:function(b,a,c){return this.data.findIndexBy(function(d){return d.get(b)===a},this,c)},findBy:function(b,a,c){return this.data.findIndexBy(b,a,c)},collect:function(j,k,b){var h=(b===true&&this.snapshot)?this.snapshot.items:this.data.items;var m,n,a=[],c={};for(var e=0,g=h.length;e<g;e++){m=h[e].data[j];n=String(m);if((k||!Ext.isEmpty(m))&&!c[n]){c[n]=true;a[a.length]=m}}return a},afterEdit:function(a){if(this.modified.indexOf(a)==-1){this.modified.push(a)}this.fireEvent("update",this,a,Ext.data.Record.EDIT)},afterReject:function(a){this.modified.remove(a);this.fireEvent("update",this,a,Ext.data.Record.REJECT)},afterCommit:function(a){this.modified.remove(a);this.fireEvent("update",this,a,Ext.data.Record.COMMIT)},commitChanges:function(){var a=this.modified.slice(0),c=a.length,b;for(b=0;b<c;b++){a[b].commit()}this.modified=[];this.removed=[]},rejectChanges:function(){var a=this.modified.slice(0),e=this.removed.slice(0).reverse(),c=a.length,d=e.length,b;for(b=0;b<c;b++){a[b].reject()}for(b=0;b<d;b++){this.insert(e[b].lastIndex||0,e[b]);e[b].reject()}this.modified=[];this.removed=[]},onMetaChange:function(a){this.recordType=this.reader.recordType;this.fields=this.recordType.prototype.fields;delete this.snapshot;if(this.reader.meta.sortInfo){this.sortInfo=this.reader.meta.sortInfo}else{if(this.sortInfo&&!this.fields.get(this.sortInfo.field)){delete this.sortInfo}}if(this.writer){this.writer.meta=this.reader.meta}this.modified=[];this.fireEvent("metachange",this,this.reader.meta)},findInsertIndex:function(a){this.suspendEvents();var c=this.data.clone();this.data.add(a);this.applySort();var b=this.data.indexOf(a);this.data=c;this.resumeEvents();return b},setBaseParam:function(a,b){this.baseParams=this.baseParams||{};this.baseParams[a]=b}});Ext.reg("store",Ext.data.Store);Ext.data.Store.Error=Ext.extend(Ext.Error,{name:"Ext.data.Store"});Ext.apply(Ext.data.Store.Error.prototype,{lang:{"writer-undefined":"Attempted to execute a write-action without a DataWriter installed."}});Ext.data.Field=Ext.extend(Object,{constructor:function(b){if(Ext.isString(b)){b={name:b}}Ext.apply(this,b);var d=Ext.data.Types,a=this.sortType,c;if(this.type){if(Ext.isString(this.type)){this.type=Ext.data.Types[this.type.toUpperCase()]||d.AUTO}}else{this.type=d.AUTO}if(Ext.isString(a)){this.sortType=Ext.data.SortTypes[a]}else{if(Ext.isEmpty(a)){this.sortType=this.type.sortType}}if(!this.convert){this.convert=this.type.convert}},dateFormat:null,useNull:false,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC",allowBlank:true});Ext.data.DataReader=function(a,b){this.meta=a;this.recordType=Ext.isArray(b)?Ext.data.Record.create(b):b;if(this.recordType){this.buildExtractors()}};Ext.data.DataReader.prototype={getTotal:Ext.emptyFn,getRoot:Ext.emptyFn,getMessage:Ext.emptyFn,getSuccess:Ext.emptyFn,getId:Ext.emptyFn,buildExtractors:Ext.emptyFn,extractValues:Ext.emptyFn,realize:function(a,c){if(Ext.isArray(a)){for(var b=a.length-1;b>=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();a.store.reMap(a)}},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<k.length;e++){var b=k[e];var g=new l(this.extractValues(b,o,m),this.getId(b));g[j]=b;c.push(g)}}else{for(var e=0;e<k.length;e++){var d=this.extractValues(k[e],o,m);d[this.meta.idProperty]=this.getId(k[e]);c.push(d)}}return c},isData:function(a){return(a&&Ext.isObject(a)&&!Ext.isEmpty(this.getId(a)))?true:false},onMetaChange:function(a){delete this.ef;this.meta=a;this.recordType=Ext.data.Record.create(a.fields);this.buildExtractors()}};Ext.data.DataReader.Error=Ext.extend(Ext.Error,{constructor:function(b,a){this.arg=a;Ext.Error.call(this,b)},name:"Ext.data.DataReader"});Ext.apply(Ext.data.DataReader.Error.prototype,{lang:{update:"#update received invalid data from server. Please see docs for DataReader#update and review your DataReader configuration.",realize:"#realize was called with invalid remote-data. Please see the docs for DataReader#realize and review your DataReader configuration.","invalid-response":"#readResponse received an invalid response from the server."}});Ext.data.DataWriter=function(a){Ext.apply(this,a)};Ext.data.DataWriter.prototype={writeAllFields:false,listful:false,apply:function(e,g,d,a){var c=[],b=d+"Record";if(Ext.isArray(a)){Ext.each(a,function(h){c.push(this[b](h))},this)}else{if(a instanceof Ext.data.Record){c=this[b](a)}}this.render(e,g,c)},render:Ext.emptyFn,updateRecord:Ext.emptyFn,createRecord:Ext.emptyFn,destroyRecord:Ext.emptyFn,toHash:function(g,c){var e=g.fields.map,d={},b=(this.writeAllFields===false&&g.phantom===false)?g.getChanges():g.data,a;Ext.iterate(b,function(i,h){if((a=e[i])){d[a.mapping?a.mapping:a.name]=h}});if(g.phantom){if(g.fields.containsKey(this.meta.idProperty)&&Ext.isEmpty(g.data[this.meta.idProperty])){delete d[this.meta.idProperty]}}else{d[this.meta.idProperty]=g.id}return d},toArray:function(b){var a=[];Ext.iterate(b,function(d,c){a.push({name:d,value:c})},this);return a}};Ext.data.DataProxy=function(a){a=a||{};this.api=a.api;this.url=a.url;this.restful=a.restful;this.listeners=a.listeners;this.prettyUrls=a.prettyUrls;this.addEvents("exception","beforeload","load","loadexception","beforewrite","write");Ext.data.DataProxy.superclass.constructor.call(this);try{Ext.data.Api.prepare(this)}catch(b){if(b instanceof Ext.data.Api.Error){b.toConsole()}}Ext.data.DataProxy.relayEvents(this,["beforewrite","write","exception"])};Ext.extend(Ext.data.DataProxy,Ext.util.Observable,{restful:false,setApi:function(){if(arguments.length==1){var a=Ext.data.Api.isValid(arguments[0]);if(a===true){this.api=arguments[0]}else{throw new Ext.data.Api.Error("invalid",a)}}else{if(arguments.length==2){if(!Ext.data.Api.isAction(arguments[0])){throw new Ext.data.Api.Error("invalid",arguments[0])}this.api[arguments[0]]=arguments[1]}}Ext.data.Api.prepare(this)},isApiAction:function(a){return(this.api[a])?true:false},request:function(e,b,g,a,h,d,c){if(!this.api[e]&&!this.load){throw new Ext.data.DataProxy.Error("action-undefined",e)}g=g||{};if((e===Ext.data.Api.actions.read)?this.fireEvent("beforeload",this,g):this.fireEvent("beforewrite",this,e,b,g)!==false){this.doRequest.apply(this,arguments)}else{h.call(d||this,null,c,false)}},load:null,doRequest:function(e,b,g,a,h,d,c){this.load(g,a,h,d,c)},onRead:Ext.emptyFn,onWrite:Ext.emptyFn,buildUrl:function(d,b){b=b||null;var c=(this.conn&&this.conn.url)?this.conn.url:(this.api[d])?this.api[d].url:this.url;if(!c){throw new Ext.data.Api.Error("invalid-url",d)}var e=null;var a=c.match(/(.*)(\.json|\.xml|\.html)$/);if(a){e=a[2];c=a[1]}if((this.restful===true||this.prettyUrls===true)&&b instanceof Ext.data.Record&&!b.phantom){c+="/"+b.id}return(e===null)?c:c+e},destroy:function(){this.purgeListeners()}});Ext.apply(Ext.data.DataProxy,Ext.util.Observable.prototype);Ext.util.Observable.call(Ext.data.DataProxy);Ext.data.DataProxy.Error=Ext.extend(Ext.Error,{constructor:function(b,a){this.arg=a;Ext.Error.call(this,b)},name:"Ext.data.DataProxy"});Ext.apply(Ext.data.DataProxy.Error.prototype,{lang:{"action-undefined":"DataProxy attempted to execute an API-action but found an undefined url / function. Please review your Proxy url/api-configuration.","api-invalid":"Recieved an invalid API-configuration. Please ensure your proxy API-configuration contains only the actions from Ext.data.Api.actions."}});Ext.data.Request=function(a){Ext.apply(this,a)};Ext.data.Request.prototype={action:undefined,rs:undefined,params:undefined,callback:Ext.emptyFn,scope:undefined,reader:undefined};Ext.data.Response=function(a){Ext.apply(this,a)};Ext.data.Response.prototype={action:undefined,success:undefined,message:undefined,data:undefined,raw:undefined,records:undefined};Ext.data.ScriptTagProxy=function(a){Ext.apply(this,a);Ext.data.ScriptTagProxy.superclass.constructor.call(this,a);this.head=document.getElementsByTagName("head")[0]};Ext.data.ScriptTagProxy.TRANS_ID=1000;Ext.extend(Ext.data.ScriptTagProxy,Ext.data.DataProxy,{timeout:30000,callbackParam:"callback",nocache:true,doRequest:function(e,g,d,h,j,k,l){var c=Ext.urlEncode(Ext.apply(d,this.extraParams));var b=this.buildUrl(e,g);if(!b){throw new Ext.data.Api.Error("invalid-url",b)}b=Ext.urlAppend(b,c);if(this.nocache){b=Ext.urlAppend(b,"_dc="+(new Date().getTime()))}var a=++Ext.data.ScriptTagProxy.TRANS_ID;var m={id:a,action:e,cb:"stcCallback"+a,scriptId:"stcScript"+a,params:d,arg:l,url:b,callback:j,scope:k,reader:h};window[m.cb]=this.createCallback(e,g,m);b+=String.format("&{0}={1}",this.callbackParam,m.cb);if(this.autoAbort!==false){this.abort()}m.timeoutId=this.handleFailure.defer(this.timeout,this,[m]);var i=document.createElement("script");i.setAttribute("src",b);i.setAttribute("type","text/javascript");i.setAttribute("id",m.scriptId);this.head.appendChild(i);this.trans=m},createCallback:function(d,b,c){var a=this;return function(e){a.trans=false;a.destroyTrans(c,true);if(d===Ext.data.Api.actions.read){a.onRead.call(a,d,c,e)}else{a.onWrite.call(a,d,c,e,b)}}},onRead:function(d,c,b){var a;try{a=c.reader.readRecords(b)}catch(g){this.fireEvent("loadexception",this,c,b,g);this.fireEvent("exception",this,"response",d,c,b,g);c.callback.call(c.scope||window,null,c.arg,false);return}if(a.success===false){this.fireEvent("loadexception",this,c,b);this.fireEvent("exception",this,"remote",d,c,b,null)}else{this.fireEvent("load",this,b,c.arg)}c.callback.call(c.scope||window,a,c.arg,a.success)},onWrite:function(h,g,c,b){var a=g.reader;try{var d=a.readResponse(h,c)}catch(i){this.fireEvent("exception",this,"response",h,g,d,i);g.callback.call(g.scope||window,null,d,false);return}if(!d.success===true){this.fireEvent("exception",this,"remote",h,g,d,b);g.callback.call(g.scope||window,null,d,false);return}this.fireEvent("write",this,h,d.data,d,b,g.arg);g.callback.call(g.scope||window,d.data,d,true)},isLoading:function(){return this.trans?true:false},abort:function(){if(this.isLoading()){this.destroyTrans(this.trans)}},destroyTrans:function(b,a){this.head.removeChild(document.getElementById(b.scriptId));clearTimeout(b.timeoutId);if(a){window[b.cb]=undefined;try{delete window[b.cb]}catch(c){}}else{window[b.cb]=function(){window[b.cb]=undefined;try{delete window[b.cb]}catch(d){}}}},handleFailure:function(a){this.trans=false;this.destroyTrans(a,false);if(a.action===Ext.data.Api.actions.read){this.fireEvent("loadexception",this,null,a.arg)}this.fireEvent("exception",this,"response",a.action,{response:null,options:a.arg});a.callback.call(a.scope||window,null,a.arg,false)},destroy:function(){this.abort();Ext.data.ScriptTagProxy.superclass.destroy.call(this)}});Ext.data.HttpProxy=function(a){Ext.data.HttpProxy.superclass.constructor.call(this,a);this.conn=a;this.conn.url=null;this.useAjax=!a||!a.events;var c=Ext.data.Api.actions;this.activeRequest={};for(var b in c){this.activeRequest[c[b]]=undefined}};Ext.extend(Ext.data.HttpProxy,Ext.data.DataProxy,{getConnection:function(){return this.useAjax?Ext.Ajax:this.conn},setUrl:function(a,b){this.conn.url=a;if(b===true){this.url=a;this.api=null;Ext.data.Api.prepare(this)}},doRequest:function(g,d,i,c,b,e,a){var h={method:(this.api[g])?this.api[g]["method"]:undefined,request:{callback:b,scope:e,arg:a},reader:c,callback:this.createCallback(g,d),scope:this};if(i.jsonData){h.jsonData=i.jsonData}else{if(i.xmlData){h.xmlData=i.xmlData}else{h.params=i||{}}}this.conn.url=this.buildUrl(g,d);if(this.useAjax){Ext.applyIf(h,this.conn);if(g==Ext.data.Api.actions.read&&this.activeRequest[g]){Ext.Ajax.abort(this.activeRequest[g])}this.activeRequest[g]=Ext.Ajax.request(h)}else{this.conn.request(h)}this.conn.url=null},createCallback:function(b,a){return function(e,d,c){this.activeRequest[b]=undefined;if(!d){if(b===Ext.data.Api.actions.read){this.fireEvent("loadexception",this,e,c)}this.fireEvent("exception",this,"response",b,e,c);e.request.callback.call(e.request.scope,null,e.request.arg,false);return}if(b===Ext.data.Api.actions.read){this.onRead(b,e,c)}else{this.onWrite(b,e,c,a)}}},onRead:function(d,h,b){var a;try{a=h.reader.read(b)}catch(g){this.fireEvent("loadexception",this,h,b,g);this.fireEvent("exception",this,"response",d,h,b,g);h.request.callback.call(h.request.scope,null,h.request.arg,false);return}if(a.success===false){this.fireEvent("loadexception",this,h,b);var c=h.reader.readResponse(d,b);this.fireEvent("exception",this,"remote",d,h,c,null)}else{this.fireEvent("load",this,h,h.request.arg)}h.request.callback.call(h.request.scope,a,h.request.arg,a.success)},onWrite:function(g,i,c,b){var a=i.reader;var d;try{d=a.readResponse(g,c)}catch(h){this.fireEvent("exception",this,"response",g,i,c,h);i.request.callback.call(i.request.scope,null,i.request.arg,false);return}if(d.success===true){this.fireEvent("write",this,g,d.data,d,b,i.request.arg)}else{this.fireEvent("exception",this,"remote",g,i,d,b)}i.request.callback.call(i.request.scope,d.data,d,d.success)},destroy:function(){if(!this.useAjax){this.conn.abort()}else{if(this.activeRequest){var b=Ext.data.Api.actions;for(var a in b){if(this.activeRequest[b[a]]){Ext.Ajax.abort(this.activeRequest[b[a]])}}}}Ext.data.HttpProxy.superclass.destroy.call(this)}});Ext.data.MemoryProxy=function(b){var a={};a[Ext.data.Api.actions.read]=true;Ext.data.MemoryProxy.superclass.constructor.call(this,{api:a});this.data=b};Ext.extend(Ext.data.MemoryProxy,Ext.data.DataProxy,{doRequest:function(b,c,a,d,h,i,j){a=a||{};var k;try{k=d.readRecords(this.data)}catch(g){this.fireEvent("loadexception",this,null,j,g);this.fireEvent("exception",this,"response",b,j,null,g);h.call(i,null,j,false);return}h.call(i,k,j,true)}});Ext.data.Types=new function(){var a=Ext.data.SortTypes;Ext.apply(this,{stripRe:/[\$,%]/g,AUTO:{convert:function(b){return b},sortType:a.none,type:"auto"},STRING:{convert:function(b){return(b===undefined||b===null)?"":String(b)},sortType:a.asUCString,type:"string"},INT:{convert:function(b){return b!==undefined&&b!==null&&b!==""?parseInt(String(b).replace(Ext.data.Types.stripRe,""),10):(this.useNull?null:0)},sortType:a.none,type:"int"},FLOAT:{convert:function(b){return b!==undefined&&b!==null&&b!==""?parseFloat(String(b).replace(Ext.data.Types.stripRe,""),10):(this.useNull?null:0)},sortType:a.none,type:"float"},BOOL:{convert:function(b){return b===true||b==="true"||b==1},sortType:a.none,type:"bool"},DATE:{convert:function(c){var d=this.dateFormat;if(!c){return null}if(Ext.isDate(c)){return c}if(d){if(d=="timestamp"){return new Date(c*1000)}if(d=="time"){return new Date(parseInt(c,10))}return Date.parseDate(c,d)}var b=Date.parse(c);return b?new Date(b):null},sortType:a.asDate,type:"date"}});Ext.apply(this,{BOOLEAN:this.BOOL,INTEGER:this.INT,NUMBER:this.FLOAT})};Ext.data.JsonWriter=Ext.extend(Ext.data.DataWriter,{encode:true,encodeDelete:false,constructor:function(a){Ext.data.JsonWriter.superclass.constructor.call(this,a)},render:function(c,d,b){if(this.encode===true){Ext.apply(c,d);c[this.meta.root]=Ext.encode(b)}else{var a=Ext.apply({},d);a[this.meta.root]=b;c.jsonData=a}},createRecord:function(a){return this.toHash(a)},updateRecord:function(a){return this.toHash(a)},destroyRecord:function(b){if(this.encodeDelete){var a={};a[this.meta.idProperty]=b.id;return a}else{return b.id}}});Ext.data.JsonReader=function(a,b){a=a||{};Ext.applyIf(a,{idProperty:"id",successProperty:"success",totalProperty:"total"});Ext.data.JsonReader.superclass.constructor.call(this,a,b||a.fields)};Ext.extend(Ext.data.JsonReader,Ext.data.DataReader,{read:function(a){var b=a.responseText;var c=Ext.decode(b);if(!c){throw {message:"JsonReader.read: Json object not found"}}return this.readRecords(c)},readResponse:function(e,b){var h=(b.responseText!==undefined)?Ext.decode(b.responseText):b;if(!h){throw new Ext.data.JsonReader.Error("response")}var a=this.getRoot(h),g=this.getSuccess(h);if(g&&e===Ext.data.Api.actions.create){var d=Ext.isDefined(a);if(d&&Ext.isEmpty(a)){throw new Ext.data.JsonReader.Error("root-empty",this.meta.root)}else{if(!d){throw new Ext.data.JsonReader.Error("root-undefined-response",this.meta.root)}}}var c=new Ext.data.Response({action:e,success:g,data:(a)?this.extractData(a,false):[],message:this.getMessage(h),raw:h});if(Ext.isEmpty(c.success)){throw new Ext.data.JsonReader.Error("successProperty-response",this.meta.successProperty)}return c},readRecords:function(a){this.jsonData=a;if(a.metaData){this.onMetaChange(a.metaData)}var m=this.meta,h=this.recordType,b=h.prototype.fields,l=b.items,i=b.length,j;var g=this.getRoot(a),e=g.length,d=e,k=true;if(m.totalProperty){j=parseInt(this.getTotal(a),10);if(!isNaN(j)){d=j}}if(m.successProperty){j=this.getSuccess(a);if(j===false||j==="false"){k=false}}return{success:k,records:this.extractData(g,true),totalRecords:d}},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=l.root?this.createAccessor(l.root):function(g){return g};if(l.id||l.idProperty){var d=this.createAccessor(l.id||l.idProperty);this.getId=function(i){var g=d(i);return(g===undefined||g==="")?null:g}}else{this.getId=function(){return null}}var c=[];for(var b=0;b<j;b++){e=k[b];var a=(e.mapping!==undefined&&e.mapping!==null)?e.mapping:e.name;c.push(this.createAccessor(a))}this.ef=c},simpleAccess:function(b,a){return b[a]},createAccessor:function(){var a=/[\[\.]/;return function(c){if(Ext.isEmpty(c)){return Ext.emptyFn}if(Ext.isFunction(c)){return c}var b=String(c).search(a);if(b>=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<a;e++){g=d[e];var b=this.ef[e](h);c[g.name]=g.convert((b!==undefined)?b:g.defaultValue,h)}return c}});Ext.data.JsonReader.Error=Ext.extend(Ext.Error,{constructor:function(b,a){this.arg=a;Ext.Error.call(this,b)},name:"Ext.data.JsonReader"});Ext.apply(Ext.data.JsonReader.Error.prototype,{lang:{response:"An error occurred while json-decoding your server response","successProperty-response":'Could not locate your "successProperty" in your server response. Please review your JsonReader config to ensure the config-property "successProperty" matches the property in your server-response. See the JsonReader docs.',"root-undefined-config":'Your JsonReader was configured without a "root" property. Please review your JsonReader config and make sure to define the root property. See the JsonReader docs.',"idProperty-undefined":'Your JsonReader was configured without an "idProperty" Please review your JsonReader configuration and ensure the "idProperty" is set (e.g.: "id"). See the JsonReader docs.',"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.'}});Ext.data.ArrayReader=Ext.extend(Ext.data.JsonReader,{readRecords:function(r){this.arrayData=r;var l=this.meta,d=l?Ext.num(l.idIndex,l.id):null,b=this.recordType,q=b.prototype.fields,z=[],e=true,g;var u=this.getRoot(r);for(var y=0,A=u.length;y<A;y++){var t=u[y],a={},p=((d||d===0)&&t[d]!==undefined&&t[d]!==""?t[d]:null);for(var x=0,m=q.length;x<m;x++){var B=q.items[x],w=B.mapping!==undefined&&B.mapping!==null?B.mapping:x;g=t[w]!==undefined?t[w]:B.defaultValue;g=B.convert(g,t);a[B.name]=g}var c=new b(a,p);c.json=t;z[z.length]=c}var h=z.length;if(l.totalProperty){g=parseInt(this.getTotal(r),10);if(!isNaN(g)){h=g}}if(l.successProperty){g=this.getSuccess(r);if(g===false||g==="false"){e=false}}return{success:e,records:z,totalRecords:h}}});Ext.data.ArrayStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.ArrayStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.ArrayReader(a)}))},loadData:function(e,b){if(this.expandData===true){var d=[];for(var c=0,a=e.length;c<a;c++){d[d.length]=[e[c]]}e=d}Ext.data.ArrayStore.superclass.loadData.call(this,e,b)}});Ext.reg("arraystore",Ext.data.ArrayStore);Ext.data.SimpleStore=Ext.data.ArrayStore;Ext.reg("simplestore",Ext.data.SimpleStore);Ext.data.JsonStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.JsonStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.JsonReader(a)}))}});Ext.reg("jsonstore",Ext.data.JsonStore);Ext.data.XmlWriter=function(a){Ext.data.XmlWriter.superclass.constructor.apply(this,arguments);this.tpl=(typeof(this.tpl)==="string")?new Ext.XTemplate(this.tpl).compile():this.tpl.compile()};Ext.extend(Ext.data.XmlWriter,Ext.data.DataWriter,{documentRoot:"xrequest",forceDocumentRoot:false,root:"records",xmlVersion:"1.0",xmlEncoding:"ISO-8859-15",tpl:'<tpl for="."><\u003fxml version="{version}" encoding="{encoding}"\u003f><tpl if="documentRoot"><{documentRoot}><tpl for="baseParams"><tpl for="."><{name}>{value}</{name}></tpl></tpl></tpl><tpl if="records.length&gt;1"><{root}></tpl><tpl for="records"><{parent.record}><tpl for="."><{name}>{value}</{name}></tpl></{parent.record}></tpl><tpl if="records.length&gt;1"></{root}></tpl><tpl if="documentRoot"></{documentRoot}></tpl></tpl>',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(g,b){var e=Ext.DomQuery,h=b.responseXML,a=h.documentElement||h;var c=new Ext.data.Response({action:g,success:this.getSuccess(a),message:this.getMessage(a),data:this.extractData(e.select(this.meta.record,a)||e.select(this.meta.root,a),false),raw:h});if(Ext.isEmpty(c.success)){throw new Ext.data.DataReader.Error("successProperty-response",this.meta.successProperty)}if(g===Ext.data.Api.actions.create){var d=Ext.isDefined(c.data);if(d&&Ext.isEmpty(c.data)){throw new Ext.data.JsonReader.Error("root-empty",this.meta.root)}else{if(!d){throw new Ext.data.JsonReader.Error("root-undefined-response",this.meta.root)}}}return c},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;b<j;b++){e=k[b];var a=(e.mapping!==undefined&&e.mapping!==null)?e.mapping:e.name;c.push(this.createAccessor(a))}this.ef=c},createAccessor:function(){var a=Ext.DomQuery;return function(b){if(Ext.isFunction(b)){return b}switch(b){case this.meta.totalProperty:return function(c,d){return a.selectNumber(b,c,d)};break;case this.meta.successProperty:return function(d,e){var c=a.selectValue(b,d,true);var g=c!==false&&c!=="false";return g};break;default:return function(c,d){return a.selectValue(b,c,d)};break}}}(),extractValues:function(h,d,a){var g,c={};for(var e=0;e<a;e++){g=d[e];var b=this.ef[e](h);c[g.name]=g.convert((b!==undefined)?b:g.defaultValue,h)}return c}});Ext.data.XmlStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.XmlStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.XmlReader(a)}))}});Ext.reg("xmlstore",Ext.data.XmlStore);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(e,a,d){d=d?(String(d).toUpperCase()=="DESC"?"DESC":"ASC"):this.groupDir;if(this.groupField==e&&this.groupDir==d&&!a){return}var c=this.multiSortInfo.sorters;if(c.length>0&&c[0].field==this.groupField){c.shift()}this.groupField=e;this.groupDir=d;this.applyGroupField();var b=function(){this.fireEvent("groupchange",this,this.getGroupState())};if(this.groupOnSort){this.sort(e,d);b.call(this);return}if(this.remoteGroup){this.on("load",b,this,{single:true});this.reload()}else{this.sort(c);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;d<g;d++){j.push(a[this.paramOrder[d]])}}else{if(this.paramsAsHash){j.push(a)}}}break;case Ext.data.Api.actions.update:j.push(a.jsonData);break;case Ext.data.Api.actions.destroy:j.push(a.jsonData);break}var m={params:a||{},request:{callback:k,scope:l,arg:n},reader:e};j.push(this.createCallback(b,c,m),this);h.apply(window,j)},createCallback:function(d,a,b){var c=this;return function(e,g){if(!g.status){if(d===Ext.data.Api.actions.read){c.fireEvent("loadexception",c,b,g,null)}c.fireEvent("exception",c,"remote",d,b,g,null);b.request.callback.call(b.request.scope,null,b.request.arg,false);return}if(d===Ext.data.Api.actions.read){c.onRead(d,b,e,g)}else{c.onWrite(d,b,e,g,a)}}},onRead:function(g,e,a,d){var b;try{b=e.reader.readRecords(a)}catch(c){this.fireEvent("loadexception",this,e,d,c);this.fireEvent("exception",this,"response",g,e,d,c);e.request.callback.call(e.request.scope,null,e.request.arg,false);return}this.fireEvent("load",this,d,e.request.arg);e.request.callback.call(e.request.scope,b,e.request.arg,true)},onWrite:function(g,d,a,c,b){var e=d.reader.extractData(d.reader.getRoot(a),false);var h=d.reader.getSuccess(a);h=(h!==false);if(h){this.fireEvent("write",this,g,e,c,b,d.request.arg)}else{this.fireEvent("exception",this,"remote",g,d,a,b)}d.request.callback.call(d.request.scope,e,c,h)}});Ext.data.DirectStore=Ext.extend(Ext.data.Store,{constructor:function(a){var b=Ext.apply({},{batchTransactions:false},a);Ext.data.DirectStore.superclass.constructor.call(this,Ext.apply(b,{proxy:Ext.isDefined(b.proxy)?b.proxy:new Ext.data.DirectProxy(Ext.copyTo({},b,"paramOrder,paramsAsHash,directFn,api")),reader:(!Ext.isDefined(b.reader)&&b.fields)?new Ext.data.JsonReader(Ext.copyTo({},b,"totalProperty,root,idProperty"),b.fields):b.reader}))}});Ext.reg("directstore",Ext.data.DirectStore);Ext.Direct=Ext.extend(Ext.util.Observable,{exceptions:{TRANSPORT:"xhr",PARSE:"parse",LOGIN:"login",SERVER:"exception"},constructor:function(){this.addEvents("event","exception");this.transactions={};this.providers={}},addProvider:function(e){var c=arguments;if(c.length>1){for(var d=0,b=c.length;d<b;d++){this.addProvider(c[d])}return}if(!e.events){e=new Ext.Direct.PROVIDERS[e.type](e)}e.id=e.id||Ext.id();this.providers[e.id]=e;e.on("data",this.onProviderData,this);e.on("exception",this.onProviderException,this);if(!e.isConnected()){e.connect()}return e},getProvider:function(a){return this.providers[a]},removeProvider:function(b){var a=b.id?b:this.providers[b];a.un("data",this.onProviderData,this);a.un("exception",this.onProviderException,this);delete this.providers[a.id];return a},addTransaction:function(a){this.transactions[a.tid]=a;return a},removeTransaction:function(a){delete this.transactions[a.tid||a];return a},getTransaction:function(a){return this.transactions[a.tid||a]},onProviderData:function(d,c){if(Ext.isArray(c)){for(var b=0,a=c.length;b<a;b++){this.onProviderData(d,c[b])}return}if(c.name&&c.name!="event"&&c.name!="exception"){this.fireEvent(c.name,c)}else{if(c.type=="exception"){this.fireEvent("exception",c)}}this.fireEvent("event",c,d)},createEvent:function(a,b){return new Ext.Direct.eventTypes[a.type](Ext.apply(a,b))}});Ext.Direct=new Ext.Direct();Ext.Direct.TID=1;Ext.Direct.PROVIDERS={};Ext.Direct.Transaction=function(a){Ext.apply(this,a);this.tid=++Ext.Direct.TID;this.retryCount=0};Ext.Direct.Transaction.prototype={send:function(){this.provider.queueTransaction(this)},retry:function(){this.retryCount++;this.send()},getProvider:function(){return this.provider}};Ext.Direct.Event=function(a){Ext.apply(this,a)};Ext.Direct.Event.prototype={status:true,getData:function(){return this.data}};Ext.Direct.RemotingEvent=Ext.extend(Ext.Direct.Event,{type:"rpc",getTransaction:function(){return this.transaction||Ext.Direct.getTransaction(this.tid)}});Ext.Direct.ExceptionEvent=Ext.extend(Ext.Direct.RemotingEvent,{status:false,type:"exception"});Ext.Direct.eventTypes={rpc:Ext.Direct.RemotingEvent,event:Ext.Direct.Event,exception:Ext.Direct.ExceptionEvent};Ext.direct.Provider=Ext.extend(Ext.util.Observable,{priority:1,constructor:function(a){Ext.apply(this,a);this.addEvents("connect","disconnect","data","exception");Ext.direct.Provider.superclass.constructor.call(this,a)},isConnected:function(){return false},connect:Ext.emptyFn,disconnect:Ext.emptyFn});Ext.direct.JsonProvider=Ext.extend(Ext.direct.Provider,{parseResponse:function(a){if(!Ext.isEmpty(a.responseText)){if(typeof a.responseText=="object"){return a.responseText}return Ext.decode(a.responseText)}return null},getEvents:function(j){var g=null;try{g=this.parseResponse(j)}catch(h){var d=new Ext.Direct.ExceptionEvent({data:h,xhr:j,code:Ext.Direct.exceptions.PARSE,message:"Error parsing json response: \n\n "+g});return[d]}var c=[];if(Ext.isArray(g)){for(var b=0,a=g.length;b<a;b++){c.push(Ext.Direct.createEvent(g[b]))}}else{c.push(Ext.Direct.createEvent(g))}return c}});Ext.direct.PollingProvider=Ext.extend(Ext.direct.JsonProvider,{priority:3,interval:3000,constructor:function(a){Ext.direct.PollingProvider.superclass.constructor.call(this,a);this.addEvents("beforepoll","poll")},isConnected:function(){return !!this.pollTask},connect:function(){if(this.url&&!this.pollTask){this.pollTask=Ext.TaskMgr.start({run:function(){if(this.fireEvent("beforepoll",this)!==false){if(typeof this.url=="function"){this.url(this.baseParams)}else{Ext.Ajax.request({url:this.url,callback:this.onData,scope:this,params:this.baseParams})}}},interval:this.interval,scope:this});this.fireEvent("connect",this)}else{if(!this.url){throw"Error initializing PollingProvider, no url configured."}}},disconnect:function(){if(this.pollTask){Ext.TaskMgr.stop(this.pollTask);delete this.pollTask;this.fireEvent("disconnect",this)}},onData:function(d,j,h){if(j){var c=this.getEvents(h);for(var b=0,a=c.length;b<a;b++){var g=c[b];this.fireEvent("data",this,g)}}else{var g=new Ext.Direct.ExceptionEvent({data:g,code:Ext.Direct.exceptions.TRANSPORT,message:"Unable to connect to the server.",xhr:h});this.fireEvent("data",this,g)}}});Ext.Direct.PROVIDERS.polling=Ext.direct.PollingProvider;Ext.direct.RemotingProvider=Ext.extend(Ext.direct.JsonProvider,{enableBuffer:10,maxRetries:1,timeout:undefined,constructor:function(a){Ext.direct.RemotingProvider.superclass.constructor.call(this,a);this.addEvents("beforecall","call");this.namespace=(Ext.isString(this.namespace))?Ext.ns(this.namespace):this.namespace||window;this.transactions={};this.callBuffer=[]},initAPI:function(){var h=this.actions;for(var j in h){var d=this.namespace[j]||(this.namespace[j]={}),e=h[j];for(var g=0,b=e.length;g<b;g++){var a=e[g];d[a.name]=this.createMethod(j,a)}}},isConnected:function(){return !!this.connected},connect:function(){if(this.url){this.initAPI();this.connected=true;this.fireEvent("connect",this)}else{if(!this.url){throw"Error initializing RemotingProvider, no url configured."}}},disconnect:function(){if(this.connected){this.connected=false;this.fireEvent("disconnect",this)}},onData:function(a,h,j){if(h){var k=this.getEvents(j);for(var b=0,c=k.length;b<c;b++){var d=k[b],l=this.getTransaction(d);this.fireEvent("data",this,d);if(l){this.doCallback(l,d,true);Ext.Direct.removeTransaction(l)}}}else{var g=[].concat(a.ts);for(var b=0,c=g.length;b<c;b++){var l=this.getTransaction(g[b]);if(l&&l.retryCount<this.maxRetries){l.retry()}else{var d=new Ext.Direct.ExceptionEvent({data:d,transaction:l,code:Ext.Direct.exceptions.TRANSPORT,message:"Unable to connect to the server.",xhr:j});this.fireEvent("data",this,d);if(l){this.doCallback(l,d,false);Ext.Direct.removeTransaction(l)}}}}},getCallData:function(a){return{action:a.action,method:a.method,data:a.data,type:"rpc",tid:a.tid}},doSend:function(d){var g={url:this.url,callback:this.onData,scope:this,ts:d,timeout:this.timeout},b;if(Ext.isArray(d)){b=[];for(var c=0,a=d.length;c<a;c++){b.push(this.getCallData(d[c]))}}else{b=this.getCallData(d)}if(this.enableUrlEncode){var e={};e[Ext.isString(this.enableUrlEncode)?this.enableUrlEncode:"data"]=Ext.encode(b);g.params=e}else{g.jsonData=b}Ext.Ajax.request(g)},combineAndSend:function(){var a=this.callBuffer.length;if(a>0){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,a)!==false){Ext.Direct.addTransaction(d);this.queueTransaction(d);this.fireEvent("call",this,d,a)}},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,b)!==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,b);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;j<l;j++){if(o[j]&&c[o[j]]){var n=c[o[j]];this[n]=new Ext.Resizable.Handle(this,n,this.disableTrackOver,this.transparent,this.handleCls)}}this.corner=this.southeast;if(this.handles.indexOf("n")!=-1||this.handles.indexOf("w")!=-1){this.updateBox=true}this.activeHandle=null;if(this.resizeChild){if(typeof this.resizeChild=="boolean"){this.resizeChild=Ext.get(this.el.dom.firstChild,true)}else{this.resizeChild=Ext.get(this.resizeChild,true)}}if(this.adjustments=="auto"){var b=this.resizeChild;var m=this.west,h=this.east,a=this.north,o=this.south;if(b&&(m||a)){b.position("relative");b.setLeft(m?m.el.getWidth():0);b.setTop(a?a.el.getHeight():0)}this.adjustments=[(h?-h.el.getWidth():0)+(m?-m.el.getWidth():0),(a?-a.el.getHeight():0)+(o?-o.el.getHeight():0)-1]}if(this.draggable){this.dd=this.dynamic?this.el.initDD(null):this.el.initDDProxy(null,{dragElId:this.proxy.id});this.dd.setHandleElId(this.resizeChild?this.resizeChild.id:this.el.id);if(this.constrainTo){this.dd.constrainTo(this.constrainTo)}}this.addEvents("beforeresize","resize");if(this.width!==null&&this.height!==null){this.resizeTo(this.width,this.height)}else{this.updateChildSize()}if(Ext.isIE){this.el.dom.style.zoom=1}Ext.Resizable.superclass.constructor.call(this)},adjustments:[0,0],animate:false,disableTrackOver:false,draggable:false,duration:0.35,dynamic:false,easing:"easeOutStrong",enabled:true,handles:false,multiDirectional:false,height:null,width:null,heightIncrement:0,widthIncrement:0,minHeight:5,minWidth:5,maxHeight:10000,maxWidth:10000,minX:0,minY:0,pinned:false,preserveRatio:false,resizeChild:false,transparent:false,resizeTo:function(b,a){this.el.setSize(b,a);this.updateChildSize();this.fireEvent("resize",this,b,a,null)},startSizing:function(c,b){this.fireEvent("beforeresize",this,c);if(this.enabled){if(!this.overlay){this.overlay=this.el.createProxy({tag:"div",cls:"x-resizable-overlay",html:"&#160;"},Ext.getBody());this.overlay.unselectable();this.overlay.enableDisplayMode("block");this.overlay.on({scope:this,mousemove:this.onMouseMove,mouseup:this.onMouseUp})}this.overlay.setStyle("cursor",b.el.getStyle("cursor"));this.resizing=true;this.startBox=this.el.getBox();this.startPoint=c.getXY();this.offsets=[(this.startBox.x+this.startBox.width)-this.startPoint[0],(this.startBox.y+this.startBox.height)-this.startPoint[1]];this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();if(this.constrainTo){var a=Ext.get(this.constrainTo);this.resizeRegion=a.getRegion().adjust(a.getFrameWidth("t"),a.getFrameWidth("l"),-a.getFrameWidth("b"),-a.getFrameWidth("r"))}this.proxy.setStyle("visibility","hidden");this.proxy.show();this.proxy.setBox(this.startBox);if(!this.dynamic){this.proxy.setStyle("visibility","visible")}}},onMouseDown:function(a,b){if(this.enabled){b.stopEvent();this.activeHandle=a;this.startSizing(b,a)}},onMouseUp:function(b){this.activeHandle=null;var a=this.resizeElement();this.resizing=false;this.handleOut();this.overlay.hide();this.proxy.hide();this.fireEvent("resize",this,a.width,a.height,b)},updateChildSize:function(){if(this.resizeChild){var d=this.el;var e=this.resizeChild;var c=this.adjustments;if(d.dom.offsetWidth){var a=d.getSize(true);e.setSize(a.width+c[0],a.height+c[1])}if(Ext.isIE9m){setTimeout(function(){if(d.dom.offsetWidth){var g=d.getSize(true);e.setSize(g.width+c[0],g.height+c[1])}},10)}}},snap:function(c,e,b){if(!e||!c){return c}var d=c;var a=c%e;if(a>0){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-c<a){c=b-a}else{if(b-c>d){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,showAnimDuration:0.25,hideAnimDuration:0.25,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:"&#160;"});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){if(this.activeGhost){this.unghost()}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.isIE9m&&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(b!=document.body&&!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:this.showAnimDuration,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:this.hideAnimDuration,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+this.el.getConstrainOffset())}}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=Ext.extend(Ext.dd.DD,{constructor: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},moveOnly:true,headerOffsets:[100,25],startDrag:function(){var a=this.win;this.proxy=a.ghost(a.initialConfig.cls);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._lastAccess<i._lastAccess)?-1:1};var h=function(){var l=d,j=l.length;if(j>0){l.sort(c);var k=l[0].manager.zseed;for(var m=0;m<j;m++){var n=l[m];if(n&&!n.hidden){n.setZIndex(k+(m*10))}}}a()};var b=function(i){if(i!=e){if(e){e.setActive(false)}e=i;if(i){i.setActive(true)}}};var a=function(){for(var j=d.length-1;j>=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:'<div class="ext-mb-icon"></div><div class="ext-mb-content"><span class="ext-mb-text"></span><br /><div class="ext-mb-fix-cursor"><input type="text" class="ext-mb-input" /><textarea class="ext-mb-textarea"></textarea></div></div>'});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?A+" ":"&#160;");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;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.isIE9m&&x==o){x+=4}l.update(A||"&#160;");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||"&#160;");B.setTitle(b.title||"&#160;");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(Ext.isDefined(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=Ext.extend(Object,{constructor:function(a,b){this.panel=a;this.id=this.panel.id+"-ddproxy";Ext.apply(this,b)},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(this.panel.initialConfig.cls,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=Ext.extend(Ext.dd.DragSource,{constructor: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 d=b.header,c=b.body;if(d){this.setHandleElId(d.id);c=b.header}c.setStyle("cursor","move");this.scroll=false},showFrame:Ext.emptyFn,startDrag:Ext.emptyFn,b4StartDrag:function(a,b){this.proxy.show()},b4MouseDown:function(b){var a=b.getPageX(),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=Ext.extend(Ext.util.Observable,{constructor:function(){this.addEvents("statechange");this.state={};Ext.state.Provider.superclass.constructor.call(this)},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|e)\:(.*)$/,h=e.exec(unescape(b)),d,c,a,g;if(!h||!h[1]){return}c=h[1];a=h[2];switch(c){case"e":return null;case"n":return parseFloat(a);case"d":return new Date(Date.parse(a));case"b":return(a=="1");case"a":d=[];if(a!=""){Ext.each(a.split("^"),function(i){d.push(this.decodeValue(i))},this)}return d;case"o":d={};if(a!=""){Ext.each(a.split("^"),function(i){g=i.split("=");d[g[0]]=this.decodeValue(g[1])},this)}return d;default:return a}},encodeValue:function(c){var b,g="",e=0,a,d;if(c==null){return"e:1"}else{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)){for(a=c.length;e<a;e++){g+=this.encodeValue(c[e]);if(e!=a-1){g+="^"}}b="a:"+g}else{if(typeof c=="object"){for(d in c){if(typeof c[d]!="function"&&c[d]!==undefined){g+=d+"="+this.encodeValue(c[d])+"^"}}b="o:"+g.substring(0,g.length-1)}else{b="s:"+c}}}}}}return escape(b)}});Ext.state.Manager=function(){var a=new Ext.state.Provider();return{setProvider:function(b){a=b},get:function(c,b){return a.get(c,b)},set:function(b,c){a.set(b,c)},clear:function(b){a.clear(b)},getProvider:function(){return a}}}();Ext.state.CookieProvider=Ext.extend(Ext.state.Provider,{constructor:function(a){Ext.state.CookieProvider.superclass.constructor.call(this);this.path="/";this.expires=new Date(new Date().getTime()+(1000*60*60*24*7));this.domain=null;this.secure=false;Ext.apply(this,a);this.state=this.readCookies()},set:function(a,b){if(typeof b=="undefined"||b===null){this.clear(a);return}this.setCookie(a,b);Ext.state.CookieProvider.superclass.set.call(this,a,b)},clear:function(a){this.clearCookie(a);Ext.state.CookieProvider.superclass.clear.call(this,a)},readCookies:function(){var d={},h=document.cookie+";",b=/\s?(.*?)=(.*?);/g,g,a,e;while((g=b.exec(h))!=null){a=g[1];e=g[2];if(a&&a.substring(0,3)=="ys-"){d[a.substr(3)]=this.decodeValue(e)}}return d},setCookie:function(a,b){document.cookie="ys-"+a+"="+this.encodeValue(b)+((this.expires==null)?"":("; expires="+this.expires.toGMTString()))+((this.path==null)?"":("; path="+this.path))+((this.domain==null)?"":("; domain="+this.domain))+((this.secure==true)?"; secure":"")},clearCookie:function(a){document.cookie="ys-"+a+"=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":"")}});Ext.DataView=Ext.extend(Ext.BoxComponent,{selectedClass:"x-view-selected",emptyText:"",deferEmptyText:true,trackOver:false,blockRefresh:false,last:false,initComponent:function(){Ext.DataView.superclass.initComponent.call(this);if(Ext.isString(this.tpl)||Ext.isArray(this.tpl)){this.tpl=new Ext.XTemplate(this.tpl)}this.addEvents("beforeclick","click","mouseenter","mouseleave","containerclick","dblclick","contextmenu","containercontextmenu","selectionchange","beforeselect");this.store=Ext.StoreMgr.lookup(this.store);this.all=new Ext.CompositeElementLite();this.selected=new Ext.CompositeElementLite()},afterRender:function(){Ext.DataView.superclass.afterRender.call(this);this.mon(this.getTemplateTarget(),{click:this.onClick,dblclick:this.onDblClick,contextmenu:this.onContextMenu,scope:this});if(this.overClass||this.trackOver){this.mon(this.getTemplateTarget(),{mouseover:this.onMouseOver,mouseout:this.onMouseOut,scope:this})}if(this.store){this.bindStore(this.store,true)}},refresh:function(){this.clearSelections(false,true);var b=this.getTemplateTarget(),a=this.store.getRange();b.update("");if(a.length<1){if(!this.deferEmptyText||this.hasSkippedEmptyText){b.update(this.emptyText)}this.all.clear()}else{this.tpl.overwrite(b,this.collectData(a,0));this.all.fill(Ext.query(this.itemSelector,b.dom));this.updateIndexes(0)}this.hasSkippedEmptyText=true},getTemplateTarget:function(){return this.el},prepareData:function(a){return a},collectData:function(b,e){var d=[],c=0,a=b.length;for(;c<a;c++){d[d.length]=this.prepareData(b[c].data,e+c,b[c])}return d},bufferRender:function(a,b){var c=document.createElement("div");this.tpl.overwrite(c,this.collectData(a,b));return Ext.query(this.itemSelector,c)},onUpdate:function(g,a){var b=this.store.indexOf(a);if(b>-1){var e=this.isSelected(b),c=this.all.elements[b],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(e<this.all.getCount()){h=this.all.item(e).insertSibling(c,"before",true);b.splice.apply(b,[e,0].concat(c))}else{h=this.all.last().insertSibling(c,"after",true);b.push.apply(b,c)}this.updateIndexes(e)},onRemove:function(c,a,b){this.deselect(b);this.all.removeElement(b,true);this.updateIndexes(b);if(this.store.getCount()===0){this.refresh()}},refreshNode:function(a){this.onUpdate(this.store,this.store.getAt(a))},updateIndexes:function(d,c){var b=this.all.elements;d=d||0;c=c||((c===0)?0:(b.length-1));for(var a=d;a<=c;a++){b[a].viewIndex=a}},getStore:function(){return this.store},bindStore:function(a,b){if(!b&&this.store){if(a!==this.store&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("datachanged",this.onDataChanged,this);this.store.un("add",this.onAdd,this);this.store.un("remove",this.onRemove,this);this.store.un("update",this.onUpdate,this);this.store.un("clear",this.refresh,this)}if(!a){this.store=null}}if(a){a=Ext.StoreMgr.lookup(a);a.on({scope:this,beforeload:this.onBeforeLoad,datachanged:this.onDataChanged,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,clear:this.refresh})}this.store=a;if(a){this.refresh()}},onDataChanged:function(){if(this.blockRefresh!==true){this.refresh.apply(this,arguments)}},findItemFromChild:function(a){return Ext.fly(a).findParent(this.itemSelector,this.getTemplateTarget())},onClick:function(c){var b=c.getTarget(this.itemSelector,this.getTemplateTarget()),a;if(b){a=this.indexOf(b);if(this.onItemClick(b,a,c)!==false){this.fireEvent("click",this,a,b,c)}}else{if(this.fireEvent("containerclick",this,c)!==false){this.onContainerClick(c)}}},onContainerClick:function(a){this.clearSelections()},onContextMenu:function(b){var a=b.getTarget(this.itemSelector,this.getTemplateTarget());if(a){this.fireEvent("contextmenu",this,this.indexOf(a),a,b)}else{this.fireEvent("containercontextmenu",this,b)}},onDblClick:function(b){var a=b.getTarget(this.itemSelector,this.getTemplateTarget());if(a){this.fireEvent("dblclick",this,this.indexOf(a),a,b)}},onMouseOver:function(b){var a=b.getTarget(this.itemSelector,this.getTemplateTarget());if(a&&a!==this.lastItem){this.lastItem=a;Ext.fly(a).addClass(this.overClass);this.fireEvent("mouseenter",this,this.indexOf(a),a,b)}},onMouseOut:function(a){if(this.lastItem){if(!a.within(this.lastItem,true,true)){Ext.fly(this.lastItem).removeClass(this.overClass);this.fireEvent("mouseleave",this,this.indexOf(this.lastItem),this.lastItem,a);delete this.lastItem}}},onItemClick:function(b,a,c){if(this.fireEvent("beforeclick",this,a,b,c)===false){return false}if(this.multiSelect){this.doMultiSelection(b,a,c);c.preventDefault()}else{if(this.singleSelect){this.doSingleSelection(b,a,c);c.preventDefault()}}return true},doSingleSelection:function(b,a,c){if(c.ctrlKey&&this.isSelected(a)){this.deselect(a)}else{this.select(a,false)}},doMultiSelection:function(c,a,d){if(d.shiftKey&&this.last!==false){var b=this.last;this.selectRange(b,a,d.ctrlKey);this.last=b}else{if((d.ctrlKey||this.simpleSelect)&&this.isSelected(a)){this.deselect(a)}else{this.select(a,d.ctrlKey||d.shiftKey||this.simpleSelect)}}},getSelectionCount:function(){return this.selected.getCount()},getSelectedNodes:function(){return this.selected.elements},getSelectedIndexes:function(){var b=[],d=this.selected.elements,c=0,a=d.length;for(;c<a;c++){b.push(d[c].viewIndex)}return b},getSelectedRecords:function(){return this.getRecords(this.selected.elements)},getRecords:function(c){var b=[],d=0,a=c.length;for(;d<a;d++){b[b.length]=this.store.getAt(c[d].viewIndex)}return b},getRecord:function(a){return this.store.getAt(a.viewIndex)},clearSelections:function(a,b){if((this.multiSelect||this.singleSelect)&&this.selected.getCount()>0){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;c++){this.select(d[c],true,true)}if(!b){this.fireEvent("selectionchange",this,this.selected.elements)}}else{var e=this.getNode(d);if(!g){this.clearSelections(true)}if(e&&!this.isSelected(e)){if(this.fireEvent("beforeselect",this,e,this.selected.elements)!==false){Ext.fly(e).addClass(this.selectedClass);this.selected.add(e);this.last=e.viewIndex;if(!b){this.fireEvent("selectionchange",this,this.selected.elements)}}}}},selectRange:function(c,a,b){if(!b){this.clearSelections(true)}this.select(this.getNodes(c,a),true)},getNode:function(b){if(Ext.isString(b)){return document.getElementById(b)}else{if(Ext.isNumber(b)){return this.all.elements[b]}else{if(b instanceof Ext.data.Record){var a=this.store.indexOf(b);return this.all.elements[a]}}}return b},getNodes:function(e,a){var d=this.all.elements,b=[],c;e=e||0;a=!Ext.isDefined(a)?Math.max(d.length-1,0):a;if(e<=a){for(c=e;c<=a&&d[c];c++){b.push(d[c])}}else{for(c=e;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('<div class="loading-indicator">'+this.loadingText+"</div>");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,maxColumnWidth:Ext.isIE9m?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('<div class="x-list-header"><div class="x-list-header-inner">','<tpl for="columns">','<div style="width:{[values.width*100]}%;text-align:{align};"><em class="x-unselectable" unselectable="on" id="',this.id,'-xlhd-{#}">',"{header}","</em></div>","</tpl>",'<div class="x-clear"></div>',"</div></div>",'<div class="x-list-body"><div class="x-list-body-inner">',"</div></div>")}if(!this.tpl){this.tpl=new Ext.XTemplate('<tpl for="rows">',"<dl>",'<tpl for="parent.columns">','<dt style="width:{[values.width*100]}%;text-align:{align};">','<em unselectable="on"<tpl if="cls"> class="{cls}</tpl>">',"{[values.tpl.apply(parent)]}","</em></dt>","</tpl>",'<div class="x-clear"></div>',"</dl>","</tpl>")}var l=this.columns,h=0,k=0,m=l.length,b=[];for(var g=0;g<m;g++){var n=l[g];if(!n.isColumn){n.xtype=n.xtype?(/^lv/.test(n.xtype)?n.xtype:"lv"+n.xtype):"lvcolumn";n=Ext.create(n)}if(n.width){h+=n.width*100;if(h>this.maxColumnWidth){n.width-=(h-this.maxColumnWidth)/100}k++}b.push(n)}l=this.columns=b;if(k<m){var d=m-k;if(h<this.maxColumnWidth){var a=((this.maxColumnWidth-h)/d)/100;for(var e=0;e<m;e++){var n=l[e];if(!n.width){n.width=a}}}}Ext.list.ListView.superclass.initComponent.call(this)},onRender:function(){this.autoEl={cls:"x-list-wrap"};Ext.list.ListView.superclass.onRender.apply(this,arguments);this.internalTpl.overwrite(this.el,{columns:this.columns});this.innerBody=Ext.get(this.el.dom.childNodes[1].firstChild);this.innerHd=Ext.get(this.el.dom.firstChild.firstChild);if(this.hideHeaders){this.el.dom.firstChild.style.display="none"}},getTemplateTarget:function(){return this.innerBody},collectData:function(){var a=Ext.list.ListView.superclass.collectData.apply(this,arguments);return{columns:this.columns,rows:a}},verifyInternalSize:function(){if(this.lastSize){this.onResize(this.lastSize.width,this.lastSize.height)}},onResize:function(c,e){var b=this.innerBody.dom,g=this.innerHd.dom,d=c-Ext.num(this.scrollOffset,Ext.getScrollBarWidth())+"px",a;if(!b){return}a=b.parentNode;if(Ext.isNumber(c)){if(this.reserveScrollOffset||((a.offsetWidth-a.clientWidth)>10)){b.style.width=d;g.style.width=d}else{b.style.width=c+"px";g.style.width=c+"px";setTimeout(function(){if((a.offsetWidth-a.clientWidth)>10){b.style.width=d;g.style.width=d}},10)}}if(Ext.isNumber(e)){a.style.height=Math.max(0,e-g.parentNode.offsetHeight)+"px"}},updateIndexes:function(){Ext.list.ListView.superclass.updateIndexes.apply(this,arguments);this.verifyInternalSize()},findHeaderIndex:function(g){g=g.dom||g;var a=g.parentNode,d=a.parentNode.childNodes,b=0,e;for(;e=d[b];b++){if(e==a){return b}}return -1},setHdWidths:function(){var d=this.innerHd.dom.getElementsByTagName("div"),c=0,b=this.columns,a=b.length;for(;c<a;c++){d[c].style.width=(b[c].width*100)+"%"}}});Ext.reg("listview",Ext.list.ListView);Ext.ListView=Ext.list.ListView;Ext.list.Column=Ext.extend(Object,{isColumn:true,align:"left",header:"",width:null,cls:"",constructor:function(a){if(!a.tpl){a.tpl=new Ext.XTemplate("{"+a.dataIndex+"}")}else{if(Ext.isString(a.tpl)){a.tpl=new Ext.XTemplate(a.tpl)}}Ext.apply(this,a)}});Ext.reg("lvcolumn",Ext.list.Column);Ext.list.NumberColumn=Ext.extend(Ext.list.Column,{format:"0,000.00",constructor:function(a){a.tpl=a.tpl||new Ext.XTemplate("{"+a.dataIndex+':number("'+(a.format||this.format)+'")}');Ext.list.NumberColumn.superclass.constructor.call(this,a)}});Ext.reg("lvnumbercolumn",Ext.list.NumberColumn);Ext.list.DateColumn=Ext.extend(Ext.list.Column,{format:"m/d/Y",constructor:function(a){a.tpl=a.tpl||new Ext.XTemplate("{"+a.dataIndex+':date("'+(a.format||this.format)+'")}');Ext.list.DateColumn.superclass.constructor.call(this,a)}});Ext.reg("lvdatecolumn",Ext.list.DateColumn);Ext.list.BooleanColumn=Ext.extend(Ext.list.Column,{trueText:"true",falseText:"false",undefinedText:"&#160;",constructor:function(e){e.tpl=e.tpl||new Ext.XTemplate("{"+e.dataIndex+":this.format}");var b=this.trueText,d=this.falseText,a=this.undefinedText;e.tpl.format=function(c){if(c===undefined){return a}if(!c||c==="false"){return d}return b};Ext.list.DateColumn.superclass.constructor.call(this,e)}});Ext.reg("lvbooleancolumn",Ext.list.BooleanColumn);Ext.list.ColumnResizer=Ext.extend(Ext.util.Observable,{minPct:0.05,constructor:function(a){Ext.apply(this,a);Ext.list.ColumnResizer.superclass.constructor.call(this)},init:function(a){this.view=a;a.on("render",this.initEvents,this)},initEvents:function(a){a.mon(a.innerHd,"mousemove",this.handleHdMove,this);this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeStart.createDelegate(this),onStart:this.onStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onEnd.createDelegate(this),tolerance:3,autoStart:300});this.tracker.initEl(a.innerHd);a.on("beforedestroy",this.tracker.destroy,this.tracker)},handleHdMove:function(i,d){var c=5,b=i.getPageX(),j=i.getTarget("em",3,true);if(j){var h=j.getRegion(),g=j.dom.style,a=j.dom.parentNode;if(b-h.left<=c&&a!=a.parentNode.firstChild){this.activeHd=Ext.get(a.previousSibling.firstChild);g.cursor=Ext.isWebKit?"e-resize":"col-resize"}else{if(h.right-b<=c&&a!=a.parentNode.lastChild.previousSibling){this.activeHd=j;g.cursor=Ext.isWebKit?"w-resize":"col-resize"}else{delete this.activeHd;g.cursor=""}}}},onBeforeStart:function(a){this.dragHd=this.activeHd;return !!this.dragHd},onStart:function(g){var d=this,b=d.view,c=d.dragHd,a=d.tracker.getXY()[0];d.proxy=b.el.createChild({cls:"x-list-resizer"});d.dragX=c.getX();d.headerIndex=b.findHeaderIndex(c);d.headersDisabled=b.disableHeaders;b.disableHeaders=true;d.proxy.setHeight(b.el.getHeight());d.proxy.setX(d.dragX);d.proxy.setWidth(a-d.dragX);this.setBoundaries()},setBoundaries:function(j){var k=this.view,h=this.headerIndex,c=k.innerHd.getWidth(),j=k.innerHd.getX(),b=Math.ceil(c*this.minPct),l=c-b,e=k.columns.length,d=k.innerHd.select("em",true),g=b+j,a=l+j,i;if(e==2){this.minX=g;this.maxX=a}else{i=d.item(h+2);this.minX=d.item(h).getX()+b;this.maxX=i?i.getX()-b:a;if(h==0){this.minX=g}else{if(h==e-2){this.maxX=a}}}},onDrag:function(c){var b=this,a=b.tracker.getXY()[0].constrain(b.minX,b.maxX);b.proxy.setWidth(a-this.dragX)},onEnd:function(i){var g=this.proxy.getWidth(),h=this.headerIndex,l=this.view,c=l.columns,b=l.innerHd.getWidth(),k=Math.ceil(g*l.maxColumnWidth/b)/100,d=this.headersDisabled,m=c[h],j=c[h+1],a=m.width+j.width;this.proxy.remove();m.width=k;j.width=a-k;delete this.dragHd;l.setHdWidths();l.refresh();setTimeout(function(){l.disableHeaders=d},100)}});Ext.ListView.ColumnResizer=Ext.list.ColumnResizer;Ext.list.Sorter=Ext.extend(Ext.util.Observable,{sortClasses:["sort-asc","sort-desc"],constructor:function(a){Ext.apply(this,a);Ext.list.Sorter.superclass.constructor.call(this)},init:function(a){this.view=a;a.on("render",this.initEvents,this)},initEvents:function(a){a.mon(a.innerHd,"click",this.onHdClick,this);a.innerHd.setStyle("cursor","pointer");a.mon(a.store,"datachanged",this.updateSortState,this);this.updateSortState.defer(10,this,[a.store])},updateSortState:function(c){var g=c.getSortState();if(!g){return}this.sortState=g;var e=this.view.columns,h=-1;for(var d=0,a=e.length;d<a;d++){if(e[d].dataIndex==g.field){h=d;break}}if(h!=-1){var b=g.direction;this.updateSortIcon(h,b)}},updateSortIcon:function(b,a){var d=this.sortClasses;var c=this.view.innerHd.select("em").removeClass(d);c.item(b).addClass(d[a=="DESC"?1:0])},onHdClick:function(c){var b=c.getTarget("em",3);if(b&&!this.view.disableHeaders){var a=this.view.findHeaderIndex(b);this.view.store.sort(this.view.columns[a].dataIndex)}}});Ext.ListView.Sorter=Ext.list.Sorter;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 g=this.tabPosition=="top"?"header":"footer";this[g].addClass("x-tab-panel-"+g+"-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:"&#160;"}]});this.strip.createChild({cls:"x-clear"});this.body.addClass("x-tab-panel-body-"+this.tabPosition);if(!this.itemTpl){var d=new Ext.Template('<li class="{cls}" id="{id}"><a class="x-tab-strip-close"></a>','<a class="x-tab-right" href="#"><em class="x-tab-left">','<span class="x-tab-strip-inner"><span class="x-tab-strip-text {iconCls}">{text}</span></span>',"</em></a></li>");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;b<a;b++){var e=c[b],g=e.getAttribute("title");e.removeAttribute("title");this.add({title:g,contentEl:e})}},initTab:function(d,b){var e=this.strip.dom.childNodes[b],g=this.getTemplateArgs(d),c=e?this.itemTpl.insertBefore(e,g):this.itemTpl.append(this.strip,g),a="x-tab-strip-over",h=Ext.get(c);h.hover(function(){if(!d.disabled){h.addClass(a)}},function(){h.removeClass(a)});if(d.tabTip){h.child("span.x-tab-strip-text",true).qtip=d.tabTip}d.tabEl=c;h.select("a").on("click",function(i){if(!i.getPageX()){this.onStripMouseDown(i)}},this,{preventDefault:true});d.on({scope:this,disable:this.onItemDisabled,enable:this.onItemEnabled,titlechange:this.onItemTitleChanged,iconchange:this.onItemIconChanged,beforeshow:this.onBeforeShowItem})},getTemplateArgs:function(b){var a=b.closable?"x-tab-strip-closable":"";if(b.disabled){a+=" x-item-disabled"}if(b.iconCls){a+=" x-tab-with-icon"}if(b.tabCls){a+=" "+b.tabCls}return{id:this.id+this.idDelimiter+b.getItemId(),text:b.title,cls:a,iconCls:b.iconCls||""}},onAdd:function(b){Ext.TabPanel.superclass.onAdd.call(this,b);if(this.rendered){var a=this.items;this.initTab(b,a.indexOf(b));this.delegateUpdates()}},onBeforeAdd:function(b){var a=b.events?(this.items.containsKey(b.getItemId())?b:null):this.items.get(b);if(a){this.setActiveTab(b);return false}Ext.TabPanel.superclass.onBeforeAdd.apply(this,arguments);var c=b.elements;b.elements=c?c.replace(",header",""):c;b.border=(b.border===true)},onRemove:function(d){var b=Ext.get(d.tabEl);if(b){b.select("a").removeAllListeners();Ext.destroy(b)}Ext.TabPanel.superclass.onRemove.call(this,d);this.stack.remove(d);delete d.tabEl;d.un("disable",this.onItemDisabled,this);d.un("enable",this.onItemEnabled,this);d.un("titlechange",this.onItemTitleChanged,this);d.un("iconchange",this.onItemIconChanged,this);d.un("beforeshow",this.onBeforeShowItem,this);if(d==this.activeTab){var a=this.stack.next();if(a){this.setActiveTab(a)}else{if(this.items.getCount()>0){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;this.delegateUpdates()}},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");this.delegateUpdates()}},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(){var a=this.rendered;if(this.suspendUpdates){return}if(this.resizeTabs&&a){this.autoSizeTabs()}if(this.enableTabScroll&&a){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;e<j;e++){var l=m[e],n=Ext.fly(l).child(".x-tab-strip-inner",true),g=l.offsetWidth,d=n.offsetWidth;n.style.width=(k-(g-d))+"px"}},adjustBodyWidth:function(a){if(this.header){this.header.setWidth(a)}if(this.footer){this.footer.setWidth(a)}return a},setActiveTab:function(c){c=this.getComponent(c);if(this.fireEvent("beforetabchange",this,c,this.activeTab)===false){return}if(!this.rendered){this.activeTab=c;return}if(this.activeTab!=c){if(this.activeTab){var a=this.getTabEl(this.activeTab);if(a){Ext.fly(a).removeClass("x-tab-strip-active")}}this.activeTab=c;if(c){var b=this.getTabEl(c);Ext.fly(b).addClass("x-tab-strip-active");this.stack.add(c);this.layout.setActiveItem(c);this.delegateUpdates();if(this.scrolling){this.scrollToTab(c,this.animScroll)}}this.fireEvent("tabchange",this,c)}},getActiveTab:function(){return this.activeTab||null},getItem:function(a){return this.getComponent(a)},autoScrollTabs:function(){this.pos=this.tabPosition=="bottom"?this.footer:this.header;var h=this.items.length,d=this.pos.dom.offsetWidth,c=this.pos.dom.clientWidth,g=this.stripWrap,e=g.dom,b=e.offsetWidth,i=this.getScrollPos(),a=this.edge.getOffsetsTo(this.stripWrap)[0]+i;if(!this.enableTabScroll||b<20){return}if(h==0||a<=c){e.scrollLeft=0;g.setWidth(c);if(this.scrolling){this.scrolling=false;this.pos.removeClass("x-tab-scrolling");this.scrollLeft.hide();this.scrollRight.hide();if(Ext.isAir||Ext.isWebKit){e.style.marginLeft="";e.style.marginRight=""}}}else{if(!this.scrolling){this.pos.addClass("x-tab-scrolling");if(Ext.isAir||Ext.isWebKit){e.style.marginLeft="18px";e.style.marginRight="18px"}}c-=g.getMargins("lr");g.setWidth(c>20?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){this.scrollTo(g,a)}else{if(b>(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<b;c++){if(a[c]!=e){d.push(a[c])}}a=d},next:function(){return a.pop()}}};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(){if(this.menu){if(Ext.isArray(this.menu)){this.menu={items:this.menu}}if(Ext.isObject(this.menu)){this.menu.ownerCt=this}this.menu=Ext.menu.MenuMgr.get(this.menu);this.menu.ownerCt=undefined}Ext.Button.superclass.initComponent.call(this);this.addEvents("click","toggle","mouseover","mouseout","menushow","menuhide","menutriggerover","menutriggerout");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('<table id="{4}" cellspacing="0" class="x-btn {3}"><tbody class="{1}">','<tr><td class="x-btn-tl"><i>&#160;</i></td><td class="x-btn-tc"></td><td class="x-btn-tr"><i>&#160;</i></td></tr>','<tr><td class="x-btn-ml"><i>&#160;</i></td><td class="x-btn-mc"><em class="{2} x-unselectable" unselectable="on"><button type="{0}"></button></em></td><td class="x-btn-mr"><i>&#160;</i></td></tr>','<tr><td class="x-btn-bl"><i>&#160;</i></td><td class="x-btn-bc"></td><td class="x-btn-br"><i>&#160;</i></td></tr>',"</tbody></table>");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.onRepeatClick,this)}else{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.btnEl,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()<this.minWidth){this.el.setWidth(this.minWidth)}}}},setHandler:function(b,a){this.handler=b;this.scope=a;return this},setText:function(a){this.text=a;if(this.el){this.btnEl.update(a||"&#160;");this.setButtonClass()}this.doAutoWidth();return this},setIcon:function(a){this.icon=a;if(this.el){this.btnEl.setStyle("background-image",a?"url("+a+")":"");this.setButtonClass()}return this},getText:function(){return this.text},toggle:function(b,a){b=b===undefined?!this.pressed:!!b;if(b!=this.pressed){if(this.rendered){this.el[b?"addClass":"removeClass"]("x-btn-pressed")}this.pressed=b;if(!a){this.fireEvent("toggle",this,b);if(this.toggleHandler){this.toggleHandler.call(this.scope||this,this,b)}}}return this},onDisable:function(){this.onDisableChange(true)},onEnable:function(){this.onDisableChange(false)},onDisableChange:function(a){if(this.el){if(!Ext.isIE6||!this.text){this.el[a?"addClass":"removeClass"](this.disabledClass)}this.el.dom.disabled=a}this.disabled=a},showMenu:function(){if(this.rendered&&this.menu){if(this.tooltip){Ext.QuickTips.getQuickTip().cancelShow(this.btnEl)}if(this.menu.isVisible()){this.menu.hide()}this.menu.ownerCt=this;this.menu.show(this.el,this.menuAlign)}return this},hideMenu:function(){if(this.hasVisibleMenu()){this.menu.hide()}return this},hasVisibleMenu:function(){return this.menu&&this.menu.ownerCt==this&&this.menu.isVisible()},onRepeatClick:function(a,b){this.onClick(b)},onClick:function(a){if(a){a.preventDefault()}if(a.button!==0){return}if(!this.disabled){this.doToggle();if(this.menu&&!this.hasVisibleMenu()&&!this.ignoreNextClick){this.showMenu()}this.fireEvent("click",this,a);if(this.handler){this.handler.call(this.scope||this,this,a)}}},doToggle:function(){if(this.enableToggle&&(this.allowDepress!==false||!this.pressed)){this.toggle()}},isMenuTriggerOver:function(b,a){return this.menu&&!a},isMenuTriggerOut:function(b,a){return this.menu&&!a},onMouseOver:function(b){if(!this.disabled){var a=b.within(this.el,true);if(!a){this.el.addClass("x-btn-over");if(!this.monitoringMouseOver){this.doc.on("mouseover",this.monitorMouseOver,this);this.monitoringMouseOver=true}this.fireEvent("mouseover",this,b)}if(this.isMenuTriggerOver(b,a)){this.fireEvent("menutriggerover",this,this.menu,b)}}},monitorMouseOver:function(a){if(a.target!=this.el.dom&&!a.within(this.el)){if(this.monitoringMouseOver){this.doc.un("mouseover",this.monitorMouseOver,this);this.monitoringMouseOver=false}this.onMouseOut(a)}},onMouseOut:function(b){var a=b.within(this.el)&&b.target!=this.el.dom;this.el.removeClass("x-btn-over");this.fireEvent("mouseout",this,b);if(this.isMenuTriggerOut(b,a)){this.fireEvent("menutriggerout",this,this.menu,b)}},focus:function(){this.btnEl.focus()},blur:function(){this.btnEl.blur()},onFocus:function(a){if(!this.disabled){this.el.addClass("x-btn-focus")}},onBlur:function(a){this.el.removeClass("x-btn-focus")},getClickEl:function(b,a){return this.el},onMouseDown:function(a){if(!this.disabled&&a.button===0){this.getClickEl(a).addClass("x-btn-click");this.doc.on("mouseup",this.onMouseUp,this)}},onMouseUp:function(a){if(a.button===0){this.getClickEl(a,true).removeClass("x-btn-click");this.doc.un("mouseup",this.onMouseUp,this)}},onMenuShow:function(a){if(this.menu.ownerCt==this){this.menu.ownerCt=this;this.ignoreNextClick=0;this.el.addClass("x-btn-menu-active");this.fireEvent("menushow",this,this.menu)}},onMenuHide:function(a){if(this.menu.ownerCt==this){this.el.removeClass("x-btn-menu-active");this.ignoreNextClick=this.restoreClick.defer(250,this);this.fireEvent("menuhide",this,this.menu);delete this.menu.ownerCt}},restoreClick:function(){this.ignoreNextClick=0}});Ext.reg("button",Ext.Button);Ext.ButtonToggleMgr=function(){var a={};function b(e,j){if(j){var h=a[e.toggleGroup];for(var d=0,c=h.length;d<c;d++){if(h[d]!=e){h[d].toggle(false)}}}}return{register:function(c){if(!c.toggleGroup){return}var d=a[c.toggleGroup];if(!d){d=a[c.toggleGroup]=[]}d.push(c);c.on("toggle",b)},unregister:function(c){if(!c.toggleGroup){return}var d=a[c.toggleGroup];if(d){d.remove(c);c.un("toggle",b)}},getPressed:function(h){var e=a[h];if(e){for(var d=0,c=e.length;d<c;d++){if(e[d].pressed===true){return e[d]}}}return null}}}();Ext.SplitButton=Ext.extend(Ext.Button,{arrowSelector:"em",split:true,initComponent:function(){Ext.SplitButton.superclass.initComponent.call(this);this.addEvents("arrowclick")},onRender:function(){Ext.SplitButton.superclass.onRender.apply(this,arguments);if(this.arrowTooltip){this.el.child(this.arrowSelector).dom[this.tooltipType]=this.arrowTooltip}},setArrowHandler:function(b,a){this.arrowHandler=b;this.scope=a},getMenuClass:function(){return"x-btn-split"+(this.arrowAlign=="bottom"?"-bottom":"")},isClickOnArrow:function(c){if(this.arrowAlign!="bottom"){var b=this.el.child("em.x-btn-split");var a=b.getRegion().right-b.getPadding("r");return c.getPageX()>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{this.doToggle();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,a)}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<this.itemCount;c++){d=(this.activeItem.itemIndex+c)%this.itemCount;b=a.items.itemAt(d);if(!b.disabled){b.setChecked(true);break}}}});Ext.reg("cycle",Ext.CycleButton);Ext.Toolbar=function(a){if(Ext.isArray(a)){a={items:a,layout:"toolbar"}}else{a=Ext.apply({layout:"toolbar"},a);if(a.buttons){a.items=a.buttons}}Ext.Toolbar.superclass.constructor.call(this,a)};(function(){var a=Ext.Toolbar;Ext.extend(a,Ext.Container,{defaultType:"button",enableOverflow:false,trackMenus:true,internalDefaults:{removeMode:"container",hideParent:true},toolbarCls:"x-toolbar",initComponent:function(){a.superclass.initComponent.call(this);this.addEvents("overflowchange")},onRender:function(c,b){if(!this.el){if(!this.autoCreate){this.autoCreate={cls:this.toolbarCls+" x-small-editor"}}this.el=c.createChild(Ext.apply({id:this.id},this.autoCreate),b);Ext.Toolbar.superclass.onRender.apply(this,arguments)}},lookupComponent:function(b){if(Ext.isString(b)){if(b=="-"){b=new a.Separator()}else{if(b==" "){b=new a.Spacer()}else{if(b=="->"){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<b;d++){e.push(this.addButton(c[d]))}return e}return this.add(this.constructButton(c))},addText:function(b){return this.addItem(new a.TextItem(b))},addDom:function(b){return this.add(new a.Item({autoEl:b}))},addField:function(b){return this.add(b)},insertButton:function(c,g){if(Ext.isArray(g)){var e=[];for(var d=0,b=g.length;d<b;d++){e.push(this.insertButton(c+d,g[d]))}return e}return Ext.Toolbar.superclass.insert.call(this,c,g)},trackMenu:function(c,b){if(this.trackMenus&&c.menu){var d=b?"mun":"mon";this[d](c,"menutriggerover",this.onButtonTriggerOver,this);this[d](c,"menushow",this.onButtonMenuShow,this);this[d](c,"menuhide",this.onButtonMenuHide,this)}},constructButton:function(d){var c=d.events?d:this.createComponent(d,d.split?"splitbutton":this.defaultType);return c},onAdd:function(b){Ext.Toolbar.superclass.onAdd.call(this);this.trackMenu(b);if(this.disabled){b.disable()}},onRemove:function(b){Ext.Toolbar.superclass.onRemove.call(this);if(b==this.activeMenuBtn){delete this.activeMenuBtn}this.trackMenu(b,true)},onDisable:function(){this.items.each(function(b){if(b.disable){b.disable()}})},onEnable:function(){this.items.each(function(b){if(b.enable){b.enable()}})},onButtonTriggerOver:function(b){if(this.activeMenuBtn&&this.activeMenuBtn!=b){this.activeMenuBtn.hideMenu();b.showMenu();this.activeMenuBtn=b}},onButtonMenuShow:function(b){this.activeMenuBtn=b},onButtonMenuHide:function(b){delete this.activeMenuBtn}});Ext.reg("toolbar",Ext.Toolbar);a.Item=Ext.extend(Ext.BoxComponent,{hideParent:true,enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.reg("tbitem",a.Item);a.Separator=Ext.extend(a.Item,{onRender:function(c,b){this.el=c.createChild({tag:"span",cls:"xtb-sep"},b)}});Ext.reg("tbseparator",a.Separator);a.Spacer=Ext.extend(a.Item,{onRender:function(c,b){this.el=c.createChild({tag:"div",cls:"xtb-spacer",style:this.width?"width:"+this.width+"px":""},b)}});Ext.reg("tbspacer",a.Spacer);a.Fill=Ext.extend(a.Item,{render:Ext.emptyFn,isFill:true});Ext.reg("tbfill",a.Fill);a.TextItem=Ext.extend(a.Item,{constructor:function(b){a.TextItem.superclass.constructor.call(this,Ext.isString(b)?{text:b}:b)},onRender:function(c,b){this.autoEl={cls:"xtb-text",html:this.text||""};a.TextItem.superclass.onRender.call(this,c,b)},setText:function(b){if(this.rendered){this.el.update(b)}else{this.text=b}}});Ext.reg("tbtext",a.TextItem);a.Button=Ext.extend(Ext.Button,{});a.SplitButton=Ext.extend(Ext.SplitButton,{});Ext.reg("tbbutton",a.Button);Ext.reg("tbsplit",a.SplitButton)})();Ext.ButtonGroup=Ext.extend(Ext.Panel,{baseCls:"x-btn-group",layout:"table",defaultType:"button",frame:true,internalDefaults:{removeMode:"container",hideParent:true},initComponent:function(){this.layoutConfig=this.layoutConfig||{};Ext.applyIf(this.layoutConfig,{columns:this.columns});if(!this.title){this.addClass("x-btn-group-notitle")}this.on("afterlayout",this.onAfterLayout,this);Ext.ButtonGroup.superclass.initComponent.call(this)},applyDefaults:function(b){b=Ext.ButtonGroup.superclass.applyDefaults.call(this,b);var a=this.internalDefaults;if(b.events){Ext.applyIf(b.initialConfig,a);Ext.apply(b,a)}else{Ext.applyIf(b,a)}return b},onAfterLayout:function(){var a=this.body.getFrameWidth("lr")+this.body.dom.firstChild.offsetWidth;this.body.setWidth(a);this.el.setWidth(a+this.getFrameWidth())}});Ext.reg("buttongroup",Ext.ButtonGroup);(function(){var a=Ext.Toolbar;Ext.PagingToolbar=Ext.extend(Ext.Toolbar,{pageSize:20,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No data to display",beforePageText:"Page",afterPageText:"of {0}",firstText:"First Page",prevText:"Previous Page",nextText:"Next Page",lastText:"Last Page",refreshText:"Refresh",initComponent:function(){var c=[this.first=new a.Button({tooltip:this.firstText,overflowText:this.firstText,iconCls:"x-tbar-page-first",disabled:true,handler:this.moveFirst,scope:this}),this.prev=new a.Button({tooltip:this.prevText,overflowText:this.prevText,iconCls:"x-tbar-page-prev",disabled:true,handler:this.movePrevious,scope:this}),"-",this.beforePageText,this.inputItem=new Ext.form.NumberField({cls:"x-tbar-page-number",allowDecimals:false,allowNegative:false,enableKeyEvents:true,selectOnFocus:true,submitValue:false,listeners:{scope:this,keydown:this.onPagingKeyDown,blur:this.onPagingBlur}}),this.afterTextItem=new a.TextItem({text:String.format(this.afterPageText,1)}),"-",this.next=new a.Button({tooltip:this.nextText,overflowText:this.nextText,iconCls:"x-tbar-page-next",disabled:true,handler:this.moveNext,scope:this}),this.last=new a.Button({tooltip:this.lastText,overflowText:this.lastText,iconCls:"x-tbar-page-last",disabled:true,handler:this.moveLast,scope:this}),"-",this.refresh=new a.Button({tooltip:this.refreshText,overflowText:this.refreshText,iconCls:"x-tbar-loading",handler:this.doRefresh,scope:this})];var b=this.items||this.buttons||[];if(this.prependButtons){this.items=b.concat(c)}else{this.items=c.concat(b)}delete this.buttons;if(this.displayInfo){this.items.push("->");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<this.pageSize?1:Math.ceil(b/this.pageSize)}},changePage:function(b){this.doLoad(((b-1)*this.pageSize).constrain(0,this.store.getTotalCount()))},onLoadError:function(){if(!this.rendered){return}this.refresh.enable()},readPage:function(e){var b=this.inputItem.getValue(),c;if(!b||isNaN(c=parseInt(b,10))){this.inputItem.setValue(e.activePage);return false}return c},onPagingFocus:function(){this.inputItem.select()},onPagingBlur:function(b){this.inputItem.setValue(this.getPageData().activePage)},onPagingKeyDown:function(i,h){var c=h.getKey(),j=this.getPageData(),g;if(c==h.RETURN){h.stopEvent();g=this.readPage(j);if(g!==false){g=Math.min(Math.max(1,g),j.pages)-1;this.doLoad(g*this.pageSize)}}else{if(c==h.HOME||c==h.END){h.stopEvent();g=c==h.HOME?1:j.pages;i.setValue(g)}else{if(c==h.UP||c==h.PAGEUP||c==h.DOWN||c==h.PAGEDOWN){h.stopEvent();if((g=this.readPage(j))){var b=h.shiftKey?10:1;if(c==h.DOWN||c==h.PAGEDOWN){b*=-1}g+=b;if(g>=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=location.href,m=l.indexOf("#"),n=m>=0?l.substr(m+1):null;if(Ext.isGecko){n=decodeURIComponent(n)}return n}function a(){c.value=d}function h(l){d=l;Ext.History.fireEvent("change",l)}function i(m){var l=['<html><body><div id="state">',Ext.util.Format.htmlEncode(m),"</div></body></html>"].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);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{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).setVisibilityMode(Ext.Element.DISPLAY)},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]<k){if(this.anchorToTarget){this.defaultAlign="l-r";if(this.mouseOffset){this.mouseOffset[0]*=-1}}this.anchor="left";return this.getTargetXY()}if(b[0]+g.width>a){if(this.anchorToTarget){this.defaultAlign="r-l";if(this.mouseOffset){this.mouseOffset[0]*=-1}}this.anchor="right";return this.getTargetXY()}if(b[1]<j){if(this.anchorToTarget){this.defaultAlign="t-b";if(this.mouseOffset){this.mouseOffset[1]*=-1}}this.anchor="top";return this.getTargetXY()}if(b[1]+g.height>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()<this.quickShowInterval){this.show()}else{this.showTimer=this.show.defer(this.showDelay,this)}}else{if(!this.hidden&&this.autoHide!==false){this.show()}}},onTargetOut:function(a){if(this.disabled||a.within(this.target.dom,true)){return}this.clearTimer("show");if(this.autoHide!==false){this.delayHide()}},delayHide:function(){if(!this.hidden&&!this.hideTimer){this.hideTimer=this.hide.defer(this.hideDelay,this)}},hide:function(){this.clearTimer("dismiss");this.lastActive=new Date();if(this.anchorEl){this.anchorEl.hide()}Ext.ToolTip.superclass.hide.call(this);delete this.triggerElement},show:function(){if(this.anchor){this.showAt([-1000,-1000]);this.origConstrainPosition=this.constrainPosition;this.constrainPosition=false;this.anchor=this.origAnchor}this.showAt(this.getTargetXY());if(this.anchor){this.anchorEl.show();this.syncAnchor();this.constrainPosition=this.origConstrainPosition}else{this.anchorEl.hide()}},showAt:function(a){this.lastActive=new Date();this.clearTimers();Ext.ToolTip.superclass.showAt.call(this,a);if(this.dismissDelay&&this.autoHide!==false){this.dismissTimer=this.hide.defer(this.dismissDelay,this)}if(this.anchor&&!this.anchorEl.isVisible()){this.syncAnchor();this.anchorEl.show()}else{this.anchorEl.hide()}},syncAnchor:function(){var a,b,c;switch(this.tipAnchor.charAt(0)){case"t":a="b";b="tl";c=[20+this.anchorOffset,2];break;case"r":a="l";b="tr";c=[-2,11+this.anchorOffset];break;case"b":a="t";b="bl";c=[20+this.anchorOffset,-2];break;default:a="r";b="tl";c=[2,11+this.anchorOffset];break}this.anchorEl.alignTo(this.el,a+"-"+b,c)},setPagePosition:function(a,b){Ext.ToolTip.superclass.setPagePosition.call(this,a,b);if(this.anchor){this.syncAnchor()}},clearTimer:function(a){a=a+"Timer";clearTimeout(this[a]);delete this[a]},clearTimers:function(){this.clearTimer("show");this.clearTimer("dismiss");this.clearTimer("hide")},onShow:function(){Ext.ToolTip.superclass.onShow.call(this);Ext.getDoc().on("mousedown",this.onDocMouseDown,this)},onHide:function(){Ext.ToolTip.superclass.onHide.call(this);Ext.getDoc().un("mousedown",this.onDocMouseDown,this)},onDocMouseDown:function(a){if(this.autoHide!==true&&!this.closable&&!a.within(this.el.dom)){this.disable();this.doEnable.defer(100,this)}},doEnable:function(){if(!this.isDestroyed){this.enable()}},onDisable:function(){this.clearTimers();this.hide()},adjustPosition:function(a,d){if(this.constrainPosition){var c=this.targetXY[1],b=this.getSize().height;if(d<=c&&(d+b)>=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;g<a;g++){var l=h[g];var k=l.target;if(k){if(Ext.isArray(k)){for(var d=0,b=k.length;d<b;d++){this.targets[Ext.id(k[d])]=l}}else{this.targets[Ext.id(k)]=l}}}},unregister:function(a){delete this.targets[Ext.id(a)]},cancelShow:function(b){var a=this.activeTarget;b=Ext.get(b).dom;if(this.isVisible()){if(a&&a.el==b){this.hide()}}else{if(a&&a.el==b){this.clearTimer("show")}}},getTipCfg:function(d){var b=d.getTarget(),c,a;if(this.interceptTitles&&b.title&&Ext.isString(b.title)){c=b.title;b.qtip=c;b.removeAttribute("title");d.preventDefault()}else{a=this.tagConfig;c=b.qtip||Ext.fly(b).getAttribute(a.attribute,a.namespace)}return c},onTargetOver:function(i){if(this.disabled){return}this.targetXY=i.getXY();var c=i.getTarget();if(!c||c.nodeType!==1||c==document||c==document.body){return}if(this.activeTarget&&((c==this.activeTarget.el)||Ext.fly(this.activeTarget.el).contains(c))){this.clearTimer("hide");this.show();return}if(c&&this.targets[c.id]){this.activeTarget=this.targets[c.id];this.activeTarget.el=c;this.anchor=this.activeTarget.anchor;if(this.anchor){this.anchorTarget=c}this.delayShow();return}var g,h=Ext.fly(c),b=this.tagConfig,d=b.namespace;if(g=this.getTipCfg(i)){var a=h.getAttribute(b.hide,d);this.activeTarget={el:c,text:g,width:h.getAttribute(b.width,d),autoHide:a!="user"&&a!=="false",title:h.getAttribute(b.title,d),cls:h.getAttribute(b.cls,d),align:h.getAttribute(b.align,d)};this.anchor=h.getAttribute(b.anchor,d);if(this.anchor){this.anchorTarget=c}this.delayShow()}},onTargetOut:function(a){if(this.activeTarget&&a.within(this.activeTarget.el)&&!this.getTipCfg(a)){return}this.clearTimer("show");if(this.autoHide!==false){this.delayHide()}},showAt:function(b){var a=this.activeTarget;if(a){if(!this.rendered){this.render(Ext.getBody());this.activeTarget=a}if(a.width){this.setWidth(a.width);this.body.setWidth(this.adjustBodyWidth(a.width-this.getFrameWidth()));this.measureWidth=false}else{this.measureWidth=true}this.setTitle(a.title||"");this.body.update(a.text);this.autoHide=a.autoHide;this.dismissDelay=a.dismissDelay||this.dismissDelay;if(this.lastCls){this.el.removeClass(this.lastCls);delete this.lastCls}if(a.cls){this.el.addClass(a.cls);this.lastCls=a.cls}if(this.anchor){this.constrainPosition=false}else{if(a.align){b=this.el.getAlignToXY(a.el,a.align);this.constrainPosition=false}else{this.constrainPosition=true}}}Ext.QuickTip.superclass.showAt.call(this,b)},hide:function(){delete this.activeTarget;Ext.QuickTip.superclass.hide.call(this)}});Ext.reg("quicktip",Ext.QuickTip);Ext.QuickTips=function(){var b,a=false;return{init:function(c){if(!b){if(!Ext.isReady){Ext.onReady(function(){Ext.QuickTips.init(c)});return}b=new Ext.QuickTip({elements:"header,body",disabled:a});if(c!==false){b.render(Ext.getBody())}}},ddDisable:function(){if(b&&!a){b.disable()}},ddEnable:function(){if(b&&!a){b.enable()}},enable:function(){if(b){b.enable()}a=false},disable:function(){if(b){b.disable()}a=true},isEnabled:function(){return b!==undefined&&!b.disabled},getQuickTip:function(){return b},register:function(){b.register.apply(b,arguments)},unregister:function(){b.unregister.apply(b,arguments)},tips:function(){b.register.apply(b,arguments)}}}();Ext.slider.Tip=Ext.extend(Ext.Tip,{minWidth:10,offsets:[0,-10],init:function(a){a.on({scope:this,dragstart:this.onSlide,drag:this.onSlide,dragend:this.hide,destroy:this.destroy})},onSlide:function(b,c,a){this.show();this.body.update(this.getText(a));this.doAutoWidth();this.el.alignTo(a.el,"b-t?",this.offsets)},getText:function(a){return String(a.value)}});Ext.ux.SliderTip=Ext.slider.Tip;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,h,g,e,d){if(c=="collapse"||c=="expand"||c=="beforecollapse"||c=="beforeexpand"||c=="move"||c=="beforemove"){c=c+"node"}return this.fireEvent(c,b,a,h,g,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){if(Ext.isEmpty(g)){if(h){h(false,undefined)}return}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 i=c.findChild(a,d[b]);if(!i){if(h){h(false,c)}return}c=i;i.expand(false,false,e)};c.expand(false,false,e)},selectPath:function(e,a,g){if(Ext.isEmpty(e)){if(g){g(false,undefined)}return}a=a||"id";var c=e.split(this.pathSeparator),b=c.pop();if(c.length>1){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;c<a;c++){d[c].ui.onSelectedChange(false)}this.selNodes=[];this.selMap={};if(b!==true){this.fireEvent("selectionchange",this,this.selNodes)}}},isSelected:function(a){return this.selMap[a.id]?true:false},getSelectedNodes:function(){return this.selNodes.concat([])},onKeyDown:Ext.tree.DefaultSelectionModel.prototype.onKeyDown,selectNext:Ext.tree.DefaultSelectionModel.prototype.selectNext,selectPrevious:Ext.tree.DefaultSelectionModel.prototype.selectPrevious});Ext.data.Tree=Ext.extend(Ext.util.Observable,{constructor:function(a){this.nodeHash={};this.root=null;if(a){this.setRootNode(a)}this.addEvents("append","remove","move","insert","beforeappend","beforeremove","beforemove","beforeinsert");Ext.data.Tree.superclass.constructor.call(this)},pathSeparator:"/",proxyNodeEvent:function(){return this.fireEvent.apply(this,arguments)},getRootNode:function(){return this.root},setRootNode:function(a){this.root=a;a.ownerTree=this;a.isRoot=true;this.registerNode(a);return a},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:"")+"]"}});Ext.data.Node=Ext.extend(Ext.util.Observable,{constructor:function(a){this.attributes=a||{};this.leaf=this.attributes.leaf;this.id=this.attributes.id;if(!this.id){this.id=Ext.id(null,"xnode-");this.attributes.id=this.id}this.childNodes=[];this.parentNode=null;this.firstChild=null;this.lastChild=null;this.previousSibling=null;this.nextSibling=null;this.addEvents({append:true,remove:true,move:true,insert:true,beforeappend:true,beforeremove:true,beforemove:true,beforeinsert:true});this.listeners=this.attributes.listeners;Ext.data.Node.superclass.constructor.call(this)},fireEvent:function(b){if(Ext.data.Node.superclass.fireEvent.apply(this,arguments)===false){return false}var a=this.getOwnerTree();if(a){if(a.proxyNodeEvent.apply(a,arguments)===false){return false}}return true},isLeaf:function(){return this.leaf===true},setFirstChild:function(a){this.firstChild=a},setLastChild:function(a){this.lastChild=a},isLast:function(){return(!this.parentNode?true:this.parentNode.lastChild==this)},isFirst:function(){return(!this.parentNode?true:this.parentNode.firstChild==this)},hasChildNodes:function(){return !this.isLeaf()&&this.childNodes.length>0},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;d<a;d++){this.appendChild(g[d])}}else{if(this.fireEvent("beforeappend",this.ownerTree,this,e)===false){return false}var b=this.childNodes.length;var c=e.parentNode;if(c){if(e.fireEvent("beforemove",e.getOwnerTree(),e,c,this,b)===false){return false}c.removeChild(e)}b=this.childNodes.length;if(b===0){this.setFirstChild(e)}this.childNodes.push(e);e.parentNode=this;var h=this.childNodes[b-1];if(h){e.previousSibling=h;h.nextSibling=e}else{e.previousSibling=null}e.nextSibling=null;this.setLastChild(e);e.setOwnerTree(this.getOwnerTree());this.fireEvent("append",this.ownerTree,this,e,b);if(c){e.fireEvent("move",this.ownerTree,e,c,this,b)}return e}},removeChild:function(c,b){var a=this.childNodes.indexOf(c);if(a==-1){return false}if(this.fireEvent("beforeremove",this.ownerTree,this,c)===false){return false}this.childNodes.splice(a,1);if(c.previousSibling){c.previousSibling.nextSibling=c.nextSibling}if(c.nextSibling){c.nextSibling.previousSibling=c.previousSibling}if(this.firstChild==c){this.setFirstChild(c.nextSibling)}if(this.lastChild==c){this.setLastChild(c.previousSibling)}this.fireEvent("remove",this.ownerTree,this,c);if(b){c.destroy(true)}else{c.clear()}return c},clear:function(a){this.setOwnerTree(null,a);this.parentNode=this.previousSibling=this.nextSibling=null;if(a){this.firstChild=this.lastChild=null}},destroy:function(a){if(a===true){this.purgeListeners();this.clear(true);Ext.each(this.childNodes,function(b){b.destroy(true)});this.childNodes=null}else{this.remove(true)}},insertBefore:function(d,a){if(!a){return this.appendChild(d)}if(d==a){return false}if(this.fireEvent("beforeinsert",this.ownerTree,this,d,a)===false){return false}var b=this.childNodes.indexOf(a);var c=d.parentNode;var e=b;if(c==this&&this.childNodes.indexOf(d)<b){e--}if(c){if(d.fireEvent("beforemove",d.getOwnerTree(),d,c,this,b,a)===false){return false}c.removeChild(d)}if(e===0){this.setFirstChild(d)}this.childNodes.splice(e,0,d);d.parentNode=this;var g=this.childNodes[e-1];if(g){d.previousSibling=g;g.nextSibling=d}else{d.previousSibling=null}d.nextSibling=a;a.previousSibling=d;d.setOwnerTree(this.getOwnerTree());this.fireEvent("insert",this.ownerTree,this,d,a);if(c){d.fireEvent("move",this.ownerTree,d,c,this,e,a)}return d},remove:function(a){if(this.parentNode){this.parentNode.removeChild(this,a)}return this},removeAll:function(a){var c=this.childNodes,b;while((b=c[0])){this.removeChild(b,a)}return this},item:function(a){return this.childNodes[a]},replaceChild:function(a,c){var b=c?c.nextSibling:null;this.removeChild(c);this.insertBefore(a,b);return c},indexOf:function(a){return this.childNodes.indexOf(a)},getOwnerTree:function(){if(!this.ownerTree){var a=this;while(a){if(a.ownerTree){this.ownerTree=a.ownerTree;break}a=a.parentNode}}return this.ownerTree},getDepth:function(){var b=0;var a=this;while(a.parentNode){++b;a=a.parentNode}return b},setOwnerTree:function(a,b){if(a!=this.ownerTree){if(this.ownerTree){this.ownerTree.unregisterNode(this)}this.ownerTree=a;if(b!==true){Ext.each(this.childNodes,function(c){c.setOwnerTree(a)})}if(a){a.registerNode(this)}}},setId:function(b){if(b!==this.id){var a=this.ownerTree;if(a){a.unregisterNode(this)}this.id=this.attributes.id=b;if(a){a.registerNode(this)}this.onIdChange(b)}},onIdChange:Ext.emptyFn,getPath:function(c){c=c||"id";var e=this.parentNode;var a=[this.attributes[c]];while(e){a.unshift(e.attributes[c]);e=e.parentNode}var d=this.getOwnerTree().pathSeparator;return d+a.join(d)},bubble:function(c,b,a){var d=this;while(d){if(c.apply(b||d,a||[d])===false){break}d=d.parentNode}},cascade:function(g,e,b){if(g.apply(e||this,b||[this])!==false){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].cascade(g,e,b)}}},eachChild:function(g,e,b){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){if(g.apply(e||d[c],b||[d[c]])===false){break}}},findChild:function(b,c,a){return this.findChildBy(function(){return this.attributes[b]==c},null,a)},findChildBy:function(h,g,b){var e=this.childNodes,a=e.length,d=0,j,c;for(;d<a;d++){j=e[d];if(h.call(g||j,j)===true){return j}else{if(b){c=j.findChildBy(h,g,b);if(c!=null){return c}}}}return null},sort:function(e,d){var c=this.childNodes;var a=c.length;if(a>0){var g=d?function(){e.apply(d,arguments)}:e;c.sort(g);for(var b=0;b<a;b++){var h=c[b];h.previousSibling=c[b-1];h.nextSibling=c[b+1];if(b===0){this.setFirstChild(h)}if(b==a-1){this.setLastChild(h)}}}},contains:function(a){return a.isAncestor(this)},isAncestor:function(a){var b=this.parentNode;while(b){if(b==a){return true}b=b.parentNode}return false},toString:function(){return"[Node"+(this.id?" "+this.id:"")+"]"}});Ext.tree.TreeNode=Ext.extend(Ext.data.Node,{constructor:function(a){a=a||{};if(Ext.isString(a)){a={text:a}}this.childrenRendered=false;this.rendered=false;Ext.tree.TreeNode.superclass.constructor.call(this,a);this.expanded=a.expanded===true;this.isTarget=a.isTarget!==false;this.draggable=a.draggable!==false&&a.allowDrag!==false;this.allowChildren=a.allowChildren!==false&&a.allowDrop!==false;this.text=a.text;this.disabled=a.disabled===true;this.hidden=a.hidden===true;this.addEvents("textchange","beforeexpand","beforecollapse","expand","disabledchange","collapse","beforeclick","click","checkchange","beforedblclick","dblclick","contextmenu","beforechildrenrendered");var b=this.attributes.uiProvider||this.defaultUI||Ext.tree.TreeNodeUI;this.ui=new b(this)},preventHScroll:true,isExpanded:function(){return this.expanded},getUI:function(){return this.ui},getLoader:function(){var a;return this.loader||((a=this.getOwnerTree())&&a.loader?a.loader:(this.loader=new Ext.tree.TreeLoader()))},setFirstChild:function(a){var b=this.firstChild;Ext.tree.TreeNode.superclass.setFirstChild.call(this,a);if(this.childrenRendered&&b&&a!=b){b.renderIndent(true,true)}if(this.rendered){this.renderIndent(true,true)}},setLastChild:function(b){var a=this.lastChild;Ext.tree.TreeNode.superclass.setLastChild.call(this,b);if(this.childrenRendered&&a&&b!=a){a.renderIndent(true,true)}if(this.rendered){this.renderIndent(true,true)}},appendChild:function(b){if(!b.render&&!Ext.isArray(b)){b=this.getLoader().createNode(b)}var a=Ext.tree.TreeNode.superclass.appendChild.call(this,b);if(a&&this.childrenRendered){a.render()}this.ui.updateExpandIcon();return a},removeChild:function(b,a){this.ownerTree.getSelectionModel().unselect(b);Ext.tree.TreeNode.superclass.removeChild.apply(this,arguments);if(!a){var c=b.ui.rendered;if(c){b.ui.remove()}if(c&&this.childNodes.length<1){this.collapse(false,false)}else{this.ui.updateExpandIcon()}if(!this.firstChild&&!this.isHiddenRoot()){this.childrenRendered=false}}return b},insertBefore:function(c,a){if(!c.render){c=this.getLoader().createNode(c)}var b=Ext.tree.TreeNode.superclass.insertBefore.call(this,c,a);if(b&&a&&this.childrenRendered){c.render()}this.ui.updateExpandIcon();return b},setText:function(b){var a=this.text;this.text=this.attributes.text=b;if(this.rendered){this.ui.onTextChange(this,b,a)}this.fireEvent("textchange",this,b,a)},setIconCls:function(b){var a=this.attributes.iconCls;this.attributes.iconCls=b;if(this.rendered){this.ui.onIconClsChange(this,b,a)}},setTooltip:function(a,b){this.attributes.qtip=a;this.attributes.qtipTitle=b;if(this.rendered){this.ui.onTipChange(this,a,b)}},setIcon:function(a){this.attributes.icon=a;if(this.rendered){this.ui.onIconChange(this,a)}},setHref:function(a,b){this.attributes.href=a;this.attributes.hrefTarget=b;if(this.rendered){this.ui.onHrefChange(this,a,b)}},setCls:function(b){var a=this.attributes.cls;this.attributes.cls=b;if(this.rendered){this.ui.onClsChange(this,b,a)}},select:function(){var a=this.getOwnerTree();if(a){a.getSelectionModel().select(this)}},unselect:function(a){var b=this.getOwnerTree();if(b){b.getSelectionModel().unselect(this,a)}},isSelected:function(){var a=this.getOwnerTree();return a?a.getSelectionModel().isSelected(this):false},expand:function(a,c,d,b){if(!this.expanded){if(this.fireEvent("beforeexpand",this,a,c)===false){return}if(!this.childrenRendered){this.renderChildren()}this.expanded=true;if(!this.isHiddenRoot()&&(this.getOwnerTree().animate&&c!==false)||c){this.ui.animExpand(function(){this.fireEvent("expand",this);this.runCallback(d,b||this,[this]);if(a===true){this.expandChildNodes(true,true)}}.createDelegate(this));return}else{this.ui.expand();this.fireEvent("expand",this);this.runCallback(d,b||this,[this])}}else{this.runCallback(d,b||this,[this])}if(a===true){this.expandChildNodes(true)}},runCallback:function(a,c,b){if(Ext.isFunction(a)){a.apply(c,b)}},isHiddenRoot:function(){return this.isRoot&&!this.getOwnerTree().rootVisible},collapse:function(b,g,h,e){if(this.expanded&&!this.isHiddenRoot()){if(this.fireEvent("beforecollapse",this,b,g)===false){return}this.expanded=false;if((this.getOwnerTree().animate&&g!==false)||g){this.ui.animCollapse(function(){this.fireEvent("collapse",this);this.runCallback(h,e||this,[this]);if(b===true){this.collapseChildNodes(true)}}.createDelegate(this));return}else{this.ui.collapse();this.fireEvent("collapse",this);this.runCallback(h,e||this,[this])}}else{if(!this.expanded){this.runCallback(h,e||this,[this])}}if(b===true){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].collapse(true,false)}}},delayedExpand:function(a){if(!this.expandProcId){this.expandProcId=this.expand.defer(a,this)}},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId)}this.expandProcId=false},toggle:function(){if(this.expanded){this.collapse()}else{this.expand()}},ensureVisible:function(c,b){var a=this.getOwnerTree();a.expandPath(this.parentNode?this.parentNode.getPath():this.getPath(),false,function(){var d=a.getNodeById(this.id);a.getTreeEl().scrollChildIntoView(d.ui.anchor);this.runCallback(c,b||this,[this])}.createDelegate(this))},expandChildNodes:function(b,e){var d=this.childNodes,c,a=d.length;for(c=0;c<a;c++){d[c].expand(b,e)}},collapseChildNodes:function(b){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].collapse(b)}},disable:function(){this.disabled=true;this.unselect();if(this.rendered&&this.ui.onDisableChange){this.ui.onDisableChange(this,true)}this.fireEvent("disabledchange",this,true)},enable:function(){this.disabled=false;if(this.rendered&&this.ui.onDisableChange){this.ui.onDisableChange(this,false)}this.fireEvent("disabledchange",this,false)},renderChildren:function(b){if(b!==false){this.fireEvent("beforechildrenrendered",this)}var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].render(true)}this.childrenRendered=true},sort:function(e,d){Ext.tree.TreeNode.superclass.sort.apply(this,arguments);if(this.childrenRendered){var c=this.childNodes;for(var b=0,a=c.length;b<a;b++){c[b].render(true)}}},render:function(a){this.ui.render(a);if(!this.rendered){this.getOwnerTree().registerNode(this);this.rendered=true;if(this.expanded){this.expanded=false;this.expand(false,false)}}},renderIndent:function(b,e){if(e){this.ui.childIndent=null}this.ui.renderIndent();if(b===true&&this.childrenRendered){var d=this.childNodes;for(var c=0,a=d.length;c<a;c++){d[c].renderIndent(true,e)}}},beginUpdate:function(){this.childrenRendered=false},endUpdate:function(){if(this.expanded&&this.rendered){this.renderChildren()}},destroy:function(a){if(a===true){this.unselect(true)}Ext.tree.TreeNode.superclass.destroy.call(this,a);Ext.destroy(this.ui,this.loader);this.ui=this.loader=null},onIdChange:function(a){this.ui.onIdChange(a)}});Ext.tree.TreePanel.nodeTypes.node=Ext.tree.TreeNode;Ext.tree.AsyncTreeNode=function(a){this.loaded=a&&a.loaded===true;this.loading=false;Ext.tree.AsyncTreeNode.superclass.constructor.apply(this,arguments);this.addEvents("beforeload","load")};Ext.extend(Ext.tree.AsyncTreeNode,Ext.tree.TreeNode,{expand:function(b,e,h,c){if(this.loading){var g;var d=function(){if(!this.loading){clearInterval(g);this.expand(b,e,h,c)}}.createDelegate(this);g=setInterval(d,200);return}if(!this.loaded){if(this.fireEvent("beforeload",this)===false){return}this.loading=true;this.ui.beforeLoad(this);var a=this.loader||this.attributes.loader||this.getOwnerTree().getLoader();if(a){a.load(this,this.loadComplete.createDelegate(this,[b,e,h,c]),this);return}}Ext.tree.AsyncTreeNode.superclass.expand.call(this,b,e,h,c)},isLoading:function(){return this.loading},loadComplete:function(a,c,d,b){this.loading=false;this.loaded=true;this.ui.afterLoad(this);this.fireEvent("load",this);this.expand(a,c,d,b)},isLoaded:function(){return this.loaded},hasChildNodes:function(){if(!this.isLeaf()&&!this.loaded){return true}else{return Ext.tree.AsyncTreeNode.superclass.hasChildNodes.call(this)}},reload:function(b,a){this.collapse(false,false);while(this.firstChild){this.removeChild(this.firstChild).destroy()}this.childrenRendered=false;this.loaded=false;if(this.isHiddenRoot()){this.expanded=false}this.expand(false,false,b,a)}});Ext.tree.TreePanel.nodeTypes.async=Ext.tree.AsyncTreeNode;Ext.tree.TreeNodeUI=Ext.extend(Object,{constructor:function(a){Ext.apply(this,{node:a,rendered:false,animating:false,wasLeaf:true,ecc:"x-tree-ec-icon x-tree-elbow",emptyIcon:Ext.BLANK_IMAGE_URL})},removeChild:function(a){if(this.rendered){this.ctNode.removeChild(a.ui.getEl())}},beforeLoad:function(){this.addClass("x-tree-node-loading")},afterLoad:function(){this.removeClass("x-tree-node-loading")},onTextChange:function(b,c,a){if(this.rendered){this.textNode.innerHTML=c}},onIconClsChange:function(c,a,b){if(this.rendered){Ext.fly(this.iconNode).replaceClass(b,a)}},onIconChange:function(b,a){if(this.rendered){var c=Ext.isEmpty(a);this.iconNode.src=c?this.emptyIcon:a;Ext.fly(this.iconNode)[c?"removeClass":"addClass"]("x-tree-node-inline-icon")}},onTipChange:function(b,c,d){if(this.rendered){var a=Ext.isDefined(d);if(this.textNode.setAttributeNS){this.textNode.setAttributeNS("ext","qtip",c);if(a){this.textNode.setAttributeNS("ext","qtitle",d)}}else{this.textNode.setAttribute("ext:qtip",c);if(a){this.textNode.setAttribute("ext:qtitle",d)}}}},onHrefChange:function(b,a,c){if(this.rendered){this.anchor.href=this.getHref(a);if(Ext.isDefined(c)){this.anchor.target=c}}},onClsChange:function(c,a,b){if(this.rendered){Ext.fly(this.elNode).replaceClass(b,a)}},onDisableChange:function(a,b){this.disabled=b;if(this.checkbox){this.checkbox.disabled=b}this[b?"addClass":"removeClass"]("x-tree-node-disabled")},onSelectedChange:function(a){if(a){this.focus();this.addClass("x-tree-selected")}else{this.removeClass("x-tree-selected")}},onMove:function(a,h,e,g,d,b){this.childIndent=null;if(this.rendered){var i=g.ui.getContainer();if(!i){this.holder=document.createElement("div");this.holder.appendChild(this.wrap);return}var c=b?b.ui.getEl():null;if(c){i.insertBefore(this.wrap,c)}else{i.appendChild(this.wrap)}this.node.renderIndent(true,e!=g)}},addClass:function(a){if(this.elNode){Ext.fly(this.elNode).addClass(a)}},removeClass:function(a){if(this.elNode){Ext.fly(this.elNode).removeClass(a)}},remove:function(){if(this.rendered){this.holder=document.createElement("div");this.holder.appendChild(this.wrap)}},fireEvent:function(){return this.node.fireEvent.apply(this.node,arguments)},initEvents:function(){this.node.on("move",this.onMove,this);if(this.node.disabled){this.onDisableChange(this.node,true)}if(this.node.hidden){this.hide()}var b=this.node.getOwnerTree();var a=b.enableDD||b.enableDrag||b.enableDrop;if(a&&(!this.node.isRoot||b.rootVisible)){Ext.dd.Registry.register(this.elNode,{node:this.node,handles:this.getDDHandles(),isHandle:false})}},getDDHandles:function(){return[this.iconNode,this.textNode,this.elNode]},hide:function(){this.node.hidden=true;if(this.wrap){this.wrap.style.display="none"}},show:function(){this.node.hidden=false;if(this.wrap){this.wrap.style.display=""}},onContextMenu:function(a){if(this.node.hasListener("contextmenu")||this.node.getOwnerTree().hasListener("contextmenu")){a.preventDefault();this.focus();this.fireEvent("contextmenu",this.node,a)}},onClick:function(c){if(this.dropping){c.stopEvent();return}if(this.fireEvent("beforeclick",this.node,c)!==false){var b=c.getTarget("a");if(!this.disabled&&this.node.attributes.href&&b){this.fireEvent("click",this.node,c);return}else{if(b&&c.ctrlKey){c.stopEvent()}}c.preventDefault();if(this.disabled){return}if(this.node.attributes.singleClickExpand&&!this.animating&&this.node.isExpandable()){this.node.toggle()}this.fireEvent("click",this.node,c)}else{c.stopEvent()}},onDblClick:function(a){a.preventDefault();if(this.disabled){return}if(this.fireEvent("beforedblclick",this.node,a)!==false){if(this.checkbox){this.toggleCheck()}if(!this.animating&&this.node.isExpandable()){this.node.toggle()}this.fireEvent("dblclick",this.node,a)}},onOver:function(a){this.addClass("x-tree-node-over")},onOut:function(a){this.removeClass("x-tree-node-over")},onCheckChange:function(){var a=this.checkbox.checked;this.checkbox.defaultChecked=a;this.node.attributes.checked=a;this.fireEvent("checkchange",this.node,a)},ecClick:function(a){if(!this.animating&&this.node.isExpandable()){this.node.toggle()}},startDrop:function(){this.dropping=true},endDrop:function(){setTimeout(function(){this.dropping=false}.createDelegate(this),50)},expand:function(){this.updateExpandIcon();this.ctNode.style.display=""},focus:function(){if(!this.node.preventHScroll){try{this.anchor.focus()}catch(c){}}else{try{var b=this.node.getOwnerTree().getTreeEl().dom;var a=b.scrollLeft;this.anchor.focus();b.scrollLeft=a}catch(c){}}},toggleCheck:function(b){var a=this.checkbox;if(a){a.checked=(b===undefined?!a.checked:b);this.onCheckChange()}},blur:function(){try{this.anchor.blur()}catch(a){}},animExpand:function(b){var a=Ext.get(this.ctNode);a.stopFx();if(!this.node.isExpandable()){this.updateExpandIcon();this.ctNode.style.display="";Ext.callback(b);return}this.animating=true;this.updateExpandIcon();a.slideIn("t",{callback:function(){this.animating=false;Ext.callback(b)},scope:this,duration:this.node.ownerTree.duration||0.25})},highlight:function(){var a=this.node.getOwnerTree();Ext.fly(this.wrap).highlight(a.hlColor||"C3DAF9",{endColor:a.hlBaseColor})},collapse:function(){this.updateExpandIcon();this.ctNode.style.display="none"},animCollapse:function(b){var a=Ext.get(this.ctNode);a.enableDisplayMode("block");a.stopFx();this.animating=true;this.updateExpandIcon();a.slideOut("t",{callback:function(){this.animating=false;Ext.callback(b)},scope:this,duration:this.node.ownerTree.duration||0.25})},getContainer:function(){return this.ctNode},getEl:function(){return this.wrap},appendDDGhost:function(a){a.appendChild(this.elNode.cloneNode(true))},getDDRepairXY:function(){return Ext.lib.Dom.getXY(this.iconNode)},onRender:function(){this.render()},render:function(c){var e=this.node,b=e.attributes;var d=e.parentNode?e.parentNode.ui.getContainer():e.ownerTree.innerCt.dom;if(!this.rendered){this.rendered=true;this.renderElements(e,b,d,c);if(b.qtip){this.onTipChange(e,b.qtip,b.qtipTitle)}else{if(b.qtipCfg){b.qtipCfg.target=Ext.id(this.textNode);Ext.QuickTips.register(b.qtipCfg)}}this.initEvents();if(!this.node.expanded){this.updateExpandIcon(true)}}else{if(c===true){d.appendChild(this.wrap)}}},renderElements:function(e,k,j,l){this.indentMarkup=e.parentNode?e.parentNode.ui.getChildIndent():"";var g=Ext.isBoolean(k.checked),b,c=this.getHref(k.href),d=['<li class="x-tree-node"><div ext:tree-node-id="',e.id,'" class="x-tree-node-el x-tree-node-leaf x-unselectable ',k.cls,'" unselectable="on">','<span class="x-tree-node-indent">',this.indentMarkup,"</span>",'<img alt="" src="',this.emptyIcon,'" class="x-tree-ec-icon x-tree-elbow" />','<img alt="" src="',k.icon||this.emptyIcon,'" class="x-tree-node-icon',(k.icon?" x-tree-node-inline-icon":""),(k.iconCls?" "+k.iconCls:""),'" unselectable="on" />',g?('<input class="x-tree-node-cb" type="checkbox" '+(k.checked?'checked="checked" />':"/>")):"",'<a hidefocus="on" class="x-tree-node-anchor" href="',c,'" tabIndex="1" ',k.hrefTarget?' target="'+k.hrefTarget+'"':"",'><span unselectable="on">',e.text,"</span></a></div>",'<ul class="x-tree-node-ct" style="display:none;"></ul>',"</li>"].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},getHref:function(a){return Ext.isEmpty(a)?(Ext.isGecko?"":"#"):a},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('<img alt="" src="'+this.emptyIcon+'" class="x-tree-elbow-line" />')}else{a.unshift('<img alt="" src="'+this.emptyIcon+'" class="x-tree-icon" />')}}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='<div class="x-tree-root-node"></div>';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<a;b++){var e=d.appendChild(this.createNode(c[b]));if(this.preloadChildren){this.doPreload(e)}}d.endUpdate()}return true}return false},getParams:function(g){var e=Ext.apply({},this.baseParams),h=this.nodeParameter,b=this.paramOrder;h&&(e[h]=g.id);if(this.directFn){var c=[g.id];if(b){if(h&&b.indexOf(h)>-1){c=[]}for(var d=0,a=b.length;d<a;d++){c.push(e[b[d]])}}else{if(this.paramsAsHash){c=[e]}}return c}else{return e}},requestData:function(c,d,b){if(this.fireEvent("beforeload",this,c,d)!==false){if(this.directFn){var a=this.getParams(c);a.push(this.processDirectResponse.createDelegate(this,[{callback:d,node:c,scope:b}],true));this.directFn.apply(window,a)}else{this.transId=Ext.Ajax.request({method:this.requestMethod,url:this.dataUrl||this.url,success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{callback:d,node:c,scope:b},params:this.getParams(c)})}}else{this.runCallback(d,b||c,[])}},processDirectResponse:function(a,b,c){if(b.status){this.handleResponse({responseData:Ext.isArray(a)?a:null,responseText:a,argument:c})}else{this.handleFailure({argument:c})}},runCallback:function(a,c,b){if(Ext.isFunction(a)){a.apply(c,b)}},isLoading:function(){return !!this.transId},abort:function(){if(this.isLoading()){Ext.Ajax.abort(this.transId)}},createNode:function(attr){if(this.baseAttrs){Ext.applyIf(attr,this.baseAttrs)}if(this.applyLoader!==false&&!attr.loader){attr.loader=this}if(Ext.isString(attr.uiProvider)){attr.uiProvider=this.uiProviders[attr.uiProvider]||eval(attr.uiProvider)}if(attr.nodeType){return new Ext.tree.TreePanel.nodeTypes[attr.nodeType](attr)}else{return attr.leaf?new Ext.tree.TreeNode(attr):new Ext.tree.AsyncTreeNode(attr)}},processResponse:function(d,c,k,l){var m=d.responseText;try{var a=d.responseData||Ext.decode(m);c.beginUpdate();for(var g=0,h=a.length;g<h;g++){var b=this.createNode(a[g]);if(b){c.appendChild(b)}}c.endUpdate();this.runCallback(k,l||c,[c])}catch(j){this.handleFailure(d)}},handleResponse:function(c){this.transId=false;var b=c.argument;this.processResponse(c,b.node,b.callback,b.scope);this.fireEvent("load",this,b.node,c)},handleFailure:function(c){this.transId=false;var b=c.argument;this.fireEvent("loadexception",this,b.node,c);this.runCallback(b.callback,b.scope||b.node,[b.node])},destroy:function(){this.abort();this.purgeListeners()}});Ext.tree.TreeFilter=function(a,b){this.tree=a;this.filtered={};Ext.apply(this,b)};Ext.tree.TreeFilter.prototype={clearBlank:false,reverse:false,autoClear:false,remove:false,filter:function(d,a,b){a=a||"text";var c;if(typeof d=="string"){var e=d.length;if(e==0&&this.clearBlank){this.clear();return}d=d.toLowerCase();c=function(g){return g.attributes[a].substr(0,e).toLowerCase()==d}}else{if(d.exec){c=function(g){return d.test(g.attributes[a])}}else{throw"Illegal filter type, must be string or regex"}}this.filterBy(c,null,b)},filterBy:function(d,c,b){b=b||this.tree.root;if(this.autoClear){this.clear()}var a=this.filtered,i=this.reverse;var e=function(k){if(k==b){return true}if(a[k.id]){return false}var j=d.call(c||k,k);if(!j||i){a[k.id]=k;k.ui.hide();return false}return true};b.cascade(e);if(this.remove){for(var h in a){if(typeof h!="function"){var g=a[h];if(g&&g.parentNode){g.parentNode.removeChild(g)}}}}},clear:function(){var b=this.tree;var a=this.filtered;for(var d in a){if(typeof d!="function"){var c=a[d];if(c){c.ui.show()}}}this.filtered={}}};Ext.tree.TreeSorter=Ext.extend(Object,{constructor:function(a,c){Ext.apply(this,c);a.on({scope:this,beforechildrenrendered:this.doSort,append:this.updateSort,insert:this.updateSort,textchange:this.updateSortParent});var e=this.dir&&this.dir.toLowerCase()=="desc",i=this.property||"text",d=this.sortType,h=this.folderSort,b=this.caseSensitive===true,g=this.leafAttr||"leaf";if(Ext.isString(d)){d=Ext.data.SortTypes[d]}this.sortFn=function(o,m){var k=o.attributes,j=m.attributes;if(h){if(k[g]&&!j[g]){return 1}if(!k[g]&&j[g]){return -1}}var n=k[i],l=j[i],q=d?d(n,o):(b?n:n.toUpperCase()),p=d?d(l,m):(b?l:l.toUpperCase());if(q<p){return e?1:-1}else{if(q>p){return e?-1:1}}return 0}},doSort:function(a){a.sort(this.sortFn)},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;b<a;b++){g=d[b];if(e=="above"){c.parentNode.insertBefore(g,c)}else{if(e=="below"){c.parentNode.insertBefore(g,c.nextSibling)}else{c.appendChild(g)}}}g.ui.focus();if(Ext.enableFx&&this.tree.hlDrop){g.ui.highlight()}c.ui.endDrop();this.tree.fireEvent("nodedrop",h)},afterNodeMoved:function(a,c,g,d,b){if(Ext.enableFx&&this.tree.hlDrop){b.ui.focus();b.ui.highlight()}this.tree.fireEvent("nodedrop",this.tree,d,c,a,g)},getTree:function(){return this.tree},removeDropIndicators:function(b){if(b&&b.ddel){var a=b.ddel;Ext.fly(a).removeClass(["x-tree-drag-insert-above","x-tree-drag-insert-below","x-tree-drag-append"]);this.lastInsertClass="_noclass"}},beforeDragDrop:function(b,a,c){this.cancelExpand();return true},afterRepair:function(a){if(a&&Ext.enableFx){a.node.ui.highlight()}this.hideProxy()}})}if(Ext.dd.DragZone){Ext.tree.TreeDragZone=function(a,b){Ext.tree.TreeDragZone.superclass.constructor.call(this,a.innerCt,b);this.tree=a};Ext.extend(Ext.tree.TreeDragZone,Ext.dd.DragZone,{ddGroup:"TreeDD",onBeforeDrag:function(a,b){var c=a.node;return c&&c.draggable&&!c.disabled},onInitDrag:function(b){var a=this.dragData;this.tree.getSelectionModel().select(a.node);this.tree.eventModel.disable();this.proxy.update("");a.node.ui.appendDDGhost(this.proxy.ghost.dom);this.tree.fireEvent("startdrag",this.tree,a.node,b)},getRepairXY:function(b,a){return a.node.ui.getDDRepairXY()},onEndDrag:function(a,b){this.tree.eventModel.enable.defer(100,this.tree.eventModel);this.tree.fireEvent("enddrag",this.tree,a.node,b)},onValidDrop:function(a,b,c){this.tree.fireEvent("dragdrop",this.tree,this.dragData.node,a,b);this.hideProxy()},beforeInvalidDrop:function(a,c){var b=this.tree.getSelectionModel();b.clearSelections();b.select(this.dragData.node)},afterRepair:function(){if(Ext.enableFx&&this.tree.hlDrop){Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9")}this.dragging=false}})}Ext.tree.TreeEditor=function(a,c,b){c=c||{};var d=c.events?c:new Ext.form.TextField(c);Ext.tree.TreeEditor.superclass.constructor.call(this,d,b);this.tree=a;if(!a.rendered){a.on("render",this.initEditor,this)}else{this.initEditor(a)}};Ext.extend(Ext.tree.TreeEditor,Ext.Editor,{alignment:"l-l",autoSize:false,hideEl:false,cls:"x-small-editor x-tree-editor",shim:false,shadow:"frame",maxWidth:250,editDelay:350,initEditor:function(a){a.on({scope:this,beforeclick:this.beforeNodeClick,dblclick:this.onNodeDblClick});this.on({scope:this,complete:this.updateNode,beforestartedit:this.fitToTree,specialkey:this.onSpecialKey});this.on("startedit",this.bindScroll,this,{delay:10})},fitToTree:function(b,c){var e=this.tree.getTreeEl().dom,d=c.dom;if(e.scrollLeft>d.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("&#160;")}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)}});var swfobject=function(){var E="undefined",s="object",T="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",r="application/x-shockwave-flash",S="SWFObjectExprInst",y="onreadystatechange",P=window,k=document,u=navigator,U=false,V=[i],p=[],O=[],J=[],m,R,F,C,K=false,a=false,o,H,n=true,N=function(){var ab=typeof k.getElementById!=E&&typeof k.getElementsByTagName!=E&&typeof k.createElement!=E,ai=u.userAgent.toLowerCase(),Z=u.platform.toLowerCase(),af=Z?(/win/).test(Z):/win/.test(ai),ad=Z?(/mac/).test(Z):/mac/.test(ai),ag=/webkit/.test(ai)?parseFloat(ai.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,Y=!+"\v1",ah=[0,0,0],ac=null;if(typeof u.plugins!=E&&typeof u.plugins[T]==s){ac=u.plugins[T].description;if(ac&&!(typeof u.mimeTypes!=E&&u.mimeTypes[r]&&!u.mimeTypes[r].enabledPlugin)){U=true;Y=false;ac=ac.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ah[0]=parseInt(ac.replace(/^(.*)\..*$/,"$1"),10);ah[1]=parseInt(ac.replace(/^.*\.(.*)\s.*$/,"$1"),10);ah[2]=/[a-zA-Z]/.test(ac)?parseInt(ac.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof P.ActiveXObject!=E){try{var ae=new ActiveXObject(X);if(ae){ac=ae.GetVariable("$version");if(ac){Y=true;ac=ac.split(" ")[1].split(",");ah=[parseInt(ac[0],10),parseInt(ac[1],10),parseInt(ac[2],10)]}}}catch(aa){}}}return{w3:ab,pv:ah,wk:ag,ie:Y,win:af,mac:ad}}(),l=function(){if(!N.w3){return}if((typeof k.readyState!=E&&k.readyState=="complete")||(typeof k.readyState==E&&(k.getElementsByTagName("body")[0]||k.body))){g()}if(!K){if(typeof k.addEventListener!=E){k.addEventListener("DOMContentLoaded",g,false)}if(N.ie&&N.win){k.attachEvent(y,function(){if(k.readyState=="complete"){k.detachEvent(y,arguments.callee);g()}});if(P==top){(function(){if(K){return}try{k.documentElement.doScroll("left")}catch(Y){setTimeout(arguments.callee,0);return}g()})()}}if(N.wk){(function(){if(K){return}if(!(/loaded|complete/).test(k.readyState)){setTimeout(arguments.callee,0);return}g()})()}t(g)}}();function g(){if(K){return}try{var aa=k.getElementsByTagName("body")[0].appendChild(D("span"));aa.parentNode.removeChild(aa)}catch(ab){return}K=true;var Y=V.length;for(var Z=0;Z<Y;Z++){V[Z]()}}function L(Y){if(K){Y()}else{V[V.length]=Y}}function t(Z){if(typeof P.addEventListener!=E){P.addEventListener("load",Z,false)}else{if(typeof k.addEventListener!=E){k.addEventListener("load",Z,false)}else{if(typeof P.attachEvent!=E){j(P,"onload",Z)}else{if(typeof P.onload=="function"){var Y=P.onload;P.onload=function(){Y();Z()}}else{P.onload=Z}}}}}function i(){if(U){W()}else{I()}}function W(){var Y=k.getElementsByTagName("body")[0];var ab=D(s);ab.setAttribute("type",r);var aa=Y.appendChild(ab);if(aa){var Z=0;(function(){if(typeof aa.GetVariable!=E){var ac=aa.GetVariable("$version");if(ac){ac=ac.split(" ")[1].split(",");N.pv=[parseInt(ac[0],10),parseInt(ac[1],10),parseInt(ac[2],10)]}}else{if(Z<10){Z++;setTimeout(arguments.callee,10);return}}Y.removeChild(ab);aa=null;I()})()}else{I()}}function I(){var ah=p.length;if(ah>0){for(var ag=0;ag<ah;ag++){var Z=p[ag].id;var ac=p[ag].callbackFn;var ab={success:false,id:Z};if(N.pv[0]>0){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<ad;ae++){if(Y[ae].getAttribute("name").toLowerCase()!="movie"){ai[Y[ae].getAttribute("name")]=Y[ae].getAttribute("value")}}Q(aj,ai,Z,ac)}else{q(af);if(ac){ac(ab)}}}}}else{x(Z,true);if(ac){var aa=A(Z);if(aa&&typeof aa.SetVariable!=E){ab.success=true;ab.ref=aa}ac(ab)}}}}}function A(ab){var Y=null;var Z=c(ab);if(Z&&Z.nodeName=="OBJECT"){if(typeof Z.SetVariable!=E){Y=Z}else{var aa=Z.getElementsByTagName(s)[0];if(aa){Y=aa}}}return Y}function B(){return !a&&G("6.0.65")&&(N.win||N.mac)&&!(N.wk&&N.wk<312)}function Q(ab,ac,Y,aa){a=true;F=aa||null;C={success:false,id:Y};var af=c(Y);if(af){if(af.nodeName=="OBJECT"){m=h(af);R=null}else{m=af;R=Y}ab.id=S;if(typeof ab.width==E||(!(/%$/).test(ab.width)&&parseInt(ab.width,10)<310)){ab.width="310"}if(typeof ab.height==E||(!(/%$/).test(ab.height)&&parseInt(ab.height,10)<137)){ab.height="137"}k.title=k.title.slice(0,47)+" - Flash Player Installation";var ae=N.ie&&N.win?"ActiveX":"PlugIn",ad="MMredirectURL="+P.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ae+"&MMdoctitle="+k.title;if(typeof ac.flashvars!=E){ac.flashvars+="&"+ad}else{ac.flashvars=ad}if(N.ie&&N.win&&af.readyState!=4){var Z=D("div");Y+="SWFObjectNew";Z.setAttribute("id",Y);af.parentNode.insertBefore(Z,af);af.style.display="none";(function(){if(af.readyState==4){af.parentNode.removeChild(af)}else{setTimeout(arguments.callee,10)}})()}v(ab,ac,Y)}}function q(Z){if(N.ie&&N.win&&Z.readyState!=4){var Y=D("div");Z.parentNode.insertBefore(Y,Z);Y.parentNode.replaceChild(h(Z),Y);Z.style.display="none";(function(){if(Z.readyState==4){Z.parentNode.removeChild(Z)}else{setTimeout(arguments.callee,10)}})()}else{Z.parentNode.replaceChild(h(Z),Z)}}function h(ad){var ab=D("div");if(N.win&&N.ie){ab.innerHTML=ad.innerHTML}else{var Z=ad.getElementsByTagName(s)[0];if(Z){var ae=Z.childNodes;if(ae){var Y=ae.length;for(var aa=0;aa<Y;aa++){if(!(ae[aa].nodeType==1&&ae[aa].nodeName=="PARAM")&&!(ae[aa].nodeType==8)){ab.appendChild(ae[aa].cloneNode(true))}}}}}return ab}function v(aj,ah,Z){var Y,ab=c(Z);if(N.wk&&N.wk<312){return Y}if(ab){if(typeof aj.id==E){aj.id=Z}if(N.ie&&N.win){var ai="";for(var af in aj){if(aj[af]!=Object.prototype[af]){if(af.toLowerCase()=="data"){ah.movie=aj[af]}else{if(af.toLowerCase()=="styleclass"){ai+=' class="'+aj[af]+'"'}else{if(af.toLowerCase()!="classid"){ai+=" "+af+'="'+aj[af]+'"'}}}}}var ag="";for(var ae in ah){if(ah[ae]!=Object.prototype[ae]){ag+='<param name="'+ae+'" value="'+ah[ae]+'" />'}}ab.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ai+">"+ag+"</object>";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;ac<ad;ac++){J[ac][0].detachEvent(J[ac][1],J[ac][2])}var aa=O.length;for(var ab=0;ab<aa;ab++){z(O[ab])}for(var Z in N){N[Z]=null}N=null;for(var Y in swfobject){swfobject[Y]=null}swfobject=null;window.detachEvent("onunload",arguments.callee)})}}();return{registerObject:function(ac,Y,ab,aa){if(N.w3&&ac&&Y){var Z={};Z.id=ac;Z.swfVersion=Y;Z.expressInstall=ab;Z.callbackFn=aa;p[p.length]=Z;x(ac,false)}else{if(aa){aa({success:false,id:ac})}}},getObjectById:function(Y){if(N.w3){return A(Y)}},embedSWF:function(ac,ai,af,ah,Z,ab,aa,ae,ag,ad){var Y={success:false,id:ai};if(N.w3&&!(N.wk&&N.wk<312)&&ac&&ai&&af&&ah&&Z){x(ai,false);L(function(){af+="";ah+="";var ak={};if(ag&&typeof ag===s){for(var am in ag){ak[am]=ag[am]}}ak.data=ac;ak.width=af;ak.height=ah;var an={};if(ae&&typeof ae===s){for(var al in ae){an[al]=ae[al]}}if(aa&&typeof aa===s){for(var aj in aa){if(typeof an.flashvars!=E){an.flashvars+="&"+aj+"="+aa[aj]}else{an.flashvars=aj+"="+aa[aj]}}}if(G(Z)){var ao=v(ak,an,ai);if(ak.id==ai){x(ai,true)}Y.success=true;Y.ref=ao}else{if(ab&&B()){ak.data=ab;Q(ak,an,ai,ad);return}else{x(ai,true)}}if(ad){ad(Y)}})}else{if(ad){ad(Y)}}},switchOffAutoHideShow:function(){n=false},ua:N,getFlashPlayerVersion:function(){return{major:N.pv[0],minor:N.pv[1],release:N.pv[2]}},hasFlashPlayerVersion:G,createSWF:function(aa,Z,Y){if(N.w3){return v(aa,Z,Y)}else{return undefined}},showExpressInstall:function(aa,ab,Y,Z){if(N.w3&&B()){Q(aa,ab,Y,Z)}},removeSWF:function(Y){if(N.w3){z(Y)}},createCSS:function(ab,aa,Z,Y){if(N.w3){w(ab,aa,Z,Y)}},addDomLoadEvent:L,addLoadEvent:t,getQueryParamValue:function(ab){var aa=k.location.search||k.location.hash;if(aa){if(/\?/.test(aa)){aa=aa.split("?")[1]}if(ab==null){return M(aa)}var Z=aa.split("&");for(var Y=0;Y<Z.length;Y++){if(Z[Y].substring(0,Z[Y].indexOf("="))==ab){return M(Z[Y].substring((Z[Y].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var Y=c(S);if(Y&&m){Y.parentNode.replaceChild(m,Y);if(R){x(R,true);if(N.ie&&N.win){m.style.display="block"}}if(F){F(C)}}a=false}}}}();Ext.FlashComponent=Ext.extend(Ext.BoxComponent,{flashVersion:"9.0.115",backgroundColor:"#ffffff",wmode:"opaque",flashVars:undefined,flashParams:undefined,url:undefined,swfId:undefined,swfWidth:"100%",swfHeight:"100%",expressInstall:false,initComponent:function(){Ext.FlashComponent.superclass.initComponent.call(this);this.addEvents("initialize")},onRender:function(){Ext.FlashComponent.superclass.onRender.apply(this,arguments);var b=Ext.apply({allowScriptAccess:"always",bgcolor:this.backgroundColor,wmode:this.wmode},this.flashParams),a=Ext.apply({allowedDomain:document.location.hostname,YUISwfId:this.getId(),YUIBridgeCallback:"Ext.FlashEventProxy.onEvent"},this.flashVars);new swfobject.embedSWF(this.url,this.id,this.swfWidth,this.swfHeight,this.flashVersion,this.expressInstall?Ext.FlashComponent.EXPRESS_INSTALL_URL:undefined,a,b);this.swf=Ext.getDom(this.id);this.el=Ext.get(this.swf)},getSwfId:function(){return this.swfId||(this.swfId="extswf"+(++Ext.Component.AUTO_ID))},getId:function(){return this.id||(this.id="extflashcmp"+(++Ext.Component.AUTO_ID))},onFlashEvent:function(a){switch(a.type){case"swfReady":this.initSwf();return;case"log":return}a.component=this;this.fireEvent(a.type.toLowerCase().replace(/event$/,""),a)},initSwf:function(){this.onSwfReady(!!this.isInitialized);this.isInitialized=true;this.fireEvent("initialize",this)},beforeDestroy:function(){if(this.rendered){swfobject.removeSWF(this.swf.id)}Ext.FlashComponent.superclass.beforeDestroy.call(this)},onSwfReady:Ext.emptyFn});Ext.FlashComponent.EXPRESS_INSTALL_URL="http://swfobject.googlecode.com/svn/trunk/swfobject/expressInstall.swf";Ext.reg("flash",Ext.FlashComponent);Ext.FlashEventProxy={onEvent:function(c,b){var a=Ext.getCmp(c);if(a){a.onFlashEvent(b)}else{arguments.callee.defer(10,this,[c,b])}}};Ext.chart.Chart=Ext.extend(Ext.FlashComponent,{refreshBuffer:100,chartStyle:{padding:10,animationEnabled:true,font:{name:"Tahoma",color:4473924,size:11},dataTip:{padding:5,border:{color:10075112,size:1},background:{color:14346230,alpha:0.9},font:{name:"Tahoma",color:1393291,size:10,bold:true}}},extraStyle:null,seriesStyles:null,disableCaching:Ext.isIE||Ext.isOpera,disableCacheParam:"_dc",initComponent:function(){Ext.chart.Chart.superclass.initComponent.call(this);if(!this.url){this.url=Ext.chart.Chart.CHART_URL}if(this.disableCaching){this.url=Ext.urlAppend(this.url,String.format("{0}={1}",this.disableCacheParam,new Date().getTime()))}this.addEvents("itemmouseover","itemmouseout","itemclick","itemdoubleclick","itemdragstart","itemdrag","itemdragend","beforerefresh","refresh");this.store=Ext.StoreMgr.lookup(this.store)},setStyle:function(a,b){this.swf.setStyle(a,Ext.encode(b))},setStyles:function(a){this.swf.setStyles(Ext.encode(a))},setSeriesStyles:function(b){this.seriesStyles=b;var a=[];Ext.each(b,function(c){a.push(Ext.encode(c))});this.swf.setSeriesStyles(a)},setCategoryNames:function(a){this.swf.setCategoryNames(a)},setLegendRenderer:function(c,b){var a=this;b=b||a;a.removeFnProxy(a.legendFnName);a.legendFnName=a.createFnProxy(function(d){return c.call(b,d)});a.swf.setLegendLabelFunction(a.legendFnName)},setTipRenderer:function(c,b){var a=this;b=b||a;a.removeFnProxy(a.tipFnName);a.tipFnName=a.createFnProxy(function(h,e,g){var d=a.store.getAt(e);return c.call(b,a,d,e,g)});a.swf.setDataTipFunction(a.tipFnName)},setSeries:function(a){this.series=a;this.refresh()},bindStore:function(a,b){if(!b&&this.store){if(a!==this.store&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("datachanged",this.refresh,this);this.store.un("add",this.delayRefresh,this);this.store.un("remove",this.delayRefresh,this);this.store.un("update",this.delayRefresh,this);this.store.un("clear",this.refresh,this)}}if(a){a=Ext.StoreMgr.lookup(a);a.on({scope:this,datachanged:this.refresh,add:this.delayRefresh,remove:this.delayRefresh,update:this.delayRefresh,clear:this.refresh})}this.store=a;if(a&&!b){this.refresh()}},onSwfReady:function(b){Ext.chart.Chart.superclass.onSwfReady.call(this,b);var a;this.swf.setType(this.type);if(this.chartStyle){this.setStyles(Ext.apply({},this.extraStyle,this.chartStyle))}if(this.categoryNames){this.setCategoryNames(this.categoryNames)}if(this.tipRenderer){a=this.getFunctionRef(this.tipRenderer);this.setTipRenderer(a.fn,a.scope)}if(this.legendRenderer){a=this.getFunctionRef(this.legendRenderer);this.setLegendRenderer(a.fn,a.scope)}if(!b){this.bindStore(this.store,true)}this.refresh.defer(10,this)},delayRefresh:function(){if(!this.refreshTask){this.refreshTask=new Ext.util.DelayedTask(this.refresh,this)}this.refreshTask.delay(this.refreshBuffer)},refresh:function(){if(this.fireEvent("beforerefresh",this)!==false){var m=false;var k=[],c=this.store.data.items;for(var g=0,l=c.length;g<l;g++){k[g]=c[g].data}var e=[];var d=0;var n=null;var h=0;if(this.series){d=this.series.length;for(h=0;h<d;h++){n=this.series[h];var b={};for(var a in n){if(a=="style"&&n.style!==null){b.style=Ext.encode(n.style);m=true}else{b[a]=n[a]}}e.push(b)}}if(d>0){for(h=0;h<d;h++){n=e[h];if(!n.type){n.type=this.type}n.dataProvider=k}}else{e.push({type:this.type,dataProvider:k})}this.swf.setDataProvider(e);if(this.seriesStyles){this.setSeriesStyles(this.seriesStyles)}this.fireEvent("refresh",this)}},createFnProxy:function(a){var b="extFnProxy"+(++Ext.chart.Chart.PROXY_FN_ID);Ext.chart.Chart.proxyFunction[b]=a;return"Ext.chart.Chart.proxyFunction."+b},removeFnProxy:function(a){if(!Ext.isEmpty(a)){a=a.replace("Ext.chart.Chart.proxyFunction.","");delete Ext.chart.Chart.proxyFunction[a]}},getFunctionRef:function(a){if(Ext.isFunction(a)){return{fn:a,scope:this}}else{return{fn:a.fn,scope:a.scope||this}}},onDestroy:function(){if(this.refreshTask&&this.refreshTask.cancel){this.refreshTask.cancel()}Ext.chart.Chart.superclass.onDestroy.call(this);this.bindStore(null);this.removeFnProxy(this.tipFnName);this.removeFnProxy(this.legendFnName)}});Ext.reg("chart",Ext.chart.Chart);Ext.chart.Chart.PROXY_FN_ID=0;Ext.chart.Chart.proxyFunction={};Ext.chart.Chart.CHART_URL="http://yui.yahooapis.com/2.8.2/build/charts/assets/charts.swf";Ext.chart.PieChart=Ext.extend(Ext.chart.Chart,{type:"pie",onSwfReady:function(a){Ext.chart.PieChart.superclass.onSwfReady.call(this,a);this.setDataField(this.dataField);this.setCategoryField(this.categoryField)},setDataField:function(a){this.dataField=a;this.swf.setDataField(a)},setCategoryField:function(a){this.categoryField=a;this.swf.setCategoryField(a)}});Ext.reg("piechart",Ext.chart.PieChart);Ext.chart.CartesianChart=Ext.extend(Ext.chart.Chart,{onSwfReady:function(a){Ext.chart.CartesianChart.superclass.onSwfReady.call(this,a);this.labelFn=[];if(this.xField){this.setXField(this.xField)}if(this.yField){this.setYField(this.yField)}if(this.xAxis){this.setXAxis(this.xAxis)}if(this.xAxes){this.setXAxes(this.xAxes)}if(this.yAxis){this.setYAxis(this.yAxis)}if(this.yAxes){this.setYAxes(this.yAxes)}if(Ext.isDefined(this.constrainViewport)){this.swf.setConstrainViewport(this.constrainViewport)}},setXField:function(a){this.xField=a;this.swf.setHorizontalField(a)},setYField:function(a){this.yField=a;this.swf.setVerticalField(a)},setXAxis:function(a){this.xAxis=this.createAxis("xAxis",a);this.swf.setHorizontalAxis(this.xAxis)},setXAxes:function(c){var b;for(var a=0;a<c.length;a++){b=this.createAxis("xAxis"+a,c[a]);this.swf.setHorizontalAxis(b)}},setYAxis:function(a){this.yAxis=this.createAxis("yAxis",a);this.swf.setVerticalAxis(this.yAxis)},setYAxes:function(c){var b;for(var a=0;a<c.length;a++){b=this.createAxis("yAxis"+a,c[a]);this.swf.setVerticalAxis(b)}},createAxis:function(b,d){var e=Ext.apply({},d),c,a;if(this[b]){a=this[b].labelFunction;this.removeFnProxy(a);this.labelFn.remove(a)}if(e.labelRenderer){c=this.getFunctionRef(e.labelRenderer);e.labelFunction=this.createFnProxy(function(g){return c.fn.call(c.scope,g)});delete e.labelRenderer;this.labelFn.push(e.labelFunction)}if(b.indexOf("xAxis")>-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;c+=e){var d=b.get(c);if(d.isVisible()&&!d.disabled&&(d.canActivate||d.isFormField)){this.setActiveItem(d,false);return d}}return false},onMouseOver:function(b){var a=this.findTargetItem(b);if(a){if(a.canActivate&&!a.disabled){this.setActiveItem(a,true)}}this.over=true;this.fireEvent("mouseover",this,b,a)},onMouseOut:function(b){var a=this.findTargetItem(b);if(a){if(a==this.activeItem&&a.shouldDeactivate&&a.shouldDeactivate(b)){this.activeItem.deactivate();delete this.activeItem}}this.over=false;this.fireEvent("mouseout",this,b,a)},onScroll:function(d,b){if(d){d.stopEvent()}var a=this.ul.dom,c=Ext.fly(b).is(".x-menu-scroller-top");a.scrollTop+=this.scrollIncrement*(c?-1:1);if(c?a.scrollTop<=0:a.scrollTop+this.activeMax>=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.activeMax<a.scrollHeight){Ext.fly(b).addClass(["x-menu-item-active","x-menu-scroller-active"])}},onScrollerOut:function(b,a){Ext.fly(a).removeClass(["x-menu-item-active","x-menu-scroller-active"])},show:function(b,c,a){if(this.floating){this.parentMenu=a;if(!this.el){this.render();this.doLayout(false,true)}this.showAt(this.el.getAlignToXY(b,c||this.defaultAlign,this.defaultOffsets),a)}else{Ext.menu.Menu.superclass.show.call(this)}},showAt:function(b,a){if(this.fireEvent("beforeshow",this)!==false){this.parentMenu=a;if(!this.el){this.render()}if(this.enableScrolling){this.el.setXY(b);b[1]=this.constrainScroll(b[1]);b=[this.el.adjustForConstraints(b)[0],b[1]]}else{b=this.el.adjustForConstraints(b)}this.el.setXY(b);this.el.show();Ext.menu.Menu.superclass.onShow.call(this);if(Ext.isIE9m){this.fireEvent("autosize",this);if(!Ext.isIE8){this.el.repaint()}}this.hidden=false;this.focus();this.fireEvent("show",this)}},constrainScroll:function(i){var b,d=this.ul.setHeight("auto").getHeight(),a=i,h,e,g,c;if(this.floating){e=Ext.fly(this.el.dom.parentNode);g=e.getScroll().top;c=e.getViewSize().height;h=i-g;b=this.maxHeight?this.maxHeight:c-h;if(d>c){b=c;a=i-h}else{if(b<d){a=i-(d-b);b=d}}}else{b=this.getHeight()}if(this.maxHeight){b=Math.min(this.maxHeight,b)}if(d>b&&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:"&#160;"}),bottom:this.el.createChild({tag:"div",cls:"x-menu-scroller x-menu-scroller-bottom",html:"&#160;"})};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){a.ownerCt=this;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 h,e,b,d={},a=false,l=new Date();function n(){h={};e=new Ext.util.MixedCollection();b=Ext.getDoc().addKeyListener(27,j);b.disable()}function j(){if(e&&e.length>0){var o=e.clone();o.each(function(p){p.hide()});return true}return false}function g(o){e.remove(o);if(e.length<1){b.disable();Ext.getDoc().un("mousedown",m);a=false}}function k(o){var p=e.last();l=new Date();e.add(o);if(!a){b.enable();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 c(o){if(o.activeChild){o.activeChild.hide()}if(o.autoHideTimer){clearTimeout(o.autoHideTimer);delete o.autoHideTimer}}function i(o){var p=o.parentMenu;if(!p&&!o.allowOtherMenus){j()}else{if(p&&p.activeChild){p.activeChild.hide()}}}function m(o){if(l.getElapsed()>50&&e.length>0&&!o.getTarget(".x-menu")){j()}}return{hideAll:function(){return j()},register:function(o){if(!h){n()}h[o.id]=o;o.on({beforehide:c,hide:g,beforeshow:i,show:k})},get:function(o){if(typeof o=="string"){if(!h){return null}return h[o]}else{if(o.events){return o}else{if(typeof o.length=="number"){return new Ext.menu.Menu({items:o})}else{return Ext.create(o,"menu")}}}},unregister:function(o){delete h[o.id];o.un("beforehide",c);o.un("hide",g);o.un("beforeshow",i);o.un("show",k)},registerCheckable:function(o){var p=o.group;if(p){if(!d[p]){d[p]=[]}d[p].push(o)}},unregisterCheckable:function(o){var p=o.group;if(p){d[p].remove(o)}},onCheckChange:function(q,r){if(q.group&&r){var t=d[q.group],p=0,o=t.length,s;for(;p<o;p++){s=t[p];if(s!=q){s.setChecked(false)}}}},getCheckedItem:function(q){var r=d[q];if(r){for(var p=0,o=r.length;p<o;p++){if(r[p].checked){return r[p]}}}return null},setCheckedItem:function(q,s){var r=d[q];if(r){for(var p=0,o=r.length;p<o;p++){if(r[p].id==s){r[p].setChecked(true)}}}return null}}}();Ext.menu.BaseItem=Ext.extend(Ext.Component,{canActivate:false,activeClass:"x-menu-item-active",hideOnClick:true,clickHideDelay:1,ctype:"Ext.menu.BaseItem",actionMode:"container",initComponent:function(){Ext.menu.BaseItem.superclass.initComponent.call(this);this.addEvents("click","activate","deactivate");if(this.handler){this.on("click",this.handler,this.scope)}},onRender:function(b,a){Ext.menu.BaseItem.superclass.onRender.apply(this,arguments);if(this.ownerCt&&this.ownerCt instanceof Ext.menu.Menu){this.parentMenu=this.ownerCt}else{this.container.addClass("x-menu-list-item");this.mon(this.el,{scope:this,click:this.onClick,mouseenter:this.activate,mouseleave:this.deactivate})}},setHandler:function(b,a){if(this.handler){this.un("click",this.handler,this.scope)}this.on("click",this.handler=b,this.scope=a)},onClick:function(a){if(!this.disabled&&this.fireEvent("click",this,a)!==false&&(this.parentMenu&&this.parentMenu.fireEvent("itemclick",this,a)!==false)){this.handleClick(a)}else{a.stopEvent()}},activate:function(){if(this.disabled){return false}var a=this.container;a.addClass(this.activeClass);this.region=a.getRegion().adjust(2,2,-2,-2);this.fireEvent("activate",this);return true},deactivate:function(){this.container.removeClass(this.activeClass);this.fireEvent("deactivate",this)},shouldDeactivate:function(a){return !this.region||!this.region.contains(a.getPoint())},handleClick:function(b){var a=this.parentMenu;if(this.hideOnClick){if(a.floating){this.clickHideDelayTimer=a.hide.defer(this.clickHideDelay,a,[true])}else{a.deactivateActive()}}},beforeDestroy:function(){clearTimeout(this.clickHideDelayTimer);Ext.menu.BaseItem.superclass.beforeDestroy.call(this)},expandMenu:Ext.emptyFn,hideMenu:Ext.emptyFn});Ext.reg("menubaseitem",Ext.menu.BaseItem);Ext.menu.TextItem=Ext.extend(Ext.menu.BaseItem,{hideOnClick:false,itemCls:"x-menu-text",constructor:function(a){if(typeof a=="string"){a={text:a}}Ext.menu.TextItem.superclass.constructor.call(this,a)},onRender:function(){var a=document.createElement("span");a.className=this.itemCls;a.innerHTML=this.text;this.el=a;Ext.menu.TextItem.superclass.onRender.apply(this,arguments)}});Ext.reg("menutextitem",Ext.menu.TextItem);Ext.menu.Separator=Ext.extend(Ext.menu.BaseItem,{itemCls:"x-menu-sep",hideOnClick:false,activeClass:"",onRender:function(a){var b=document.createElement("span");b.className=this.itemCls;b.innerHTML="&#160;";this.el=b;a.addClass("x-menu-sep-li");Ext.menu.Separator.superclass.onRender.apply(this,arguments)}});Ext.reg("menuseparator",Ext.menu.Separator);Ext.menu.Item=Ext.extend(Ext.menu.BaseItem,{itemCls:"x-menu-item",canActivate:true,showDelay:200,altText:"",hideDelay:200,ctype:"Ext.menu.Item",initComponent:function(){Ext.menu.Item.superclass.initComponent.call(this);if(this.menu){if(Ext.isArray(this.menu)){this.menu={items:this.menu}}if(Ext.isObject(this.menu)){this.menu.ownerCt=this}this.menu=Ext.menu.MenuMgr.get(this.menu);this.menu.ownerCt=undefined}},onRender:function(d,b){if(!this.itemTpl){this.itemTpl=Ext.menu.Item.prototype.itemTpl=new Ext.XTemplate('<a id="{id}" class="{cls} x-unselectable" hidefocus="true" unselectable="on" href="{href}"','<tpl if="hrefTarget">',' target="{hrefTarget}"',"</tpl>",">",'<img alt="{altText}" src="{icon}" class="x-menu-item-icon {iconCls}"/>','<span class="x-menu-item-text">{text}</span>',"</a>")}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||"&#160;",altText:this.altText||""}},setText:function(a){this.text=a||"&#160;";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(){clearTimeout(this.showTimer);clearTimeout(this.hideTimer);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)){Ext.menu.MenuMgr.onCheckChange(this,b);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.isIE9m,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.getKeyEvent(),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()),a);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,b;if(this.emptyText){if(a.dom.value==this.emptyText){this.setRawValue("");b=true}a.removeClass(this.emptyClass)}if(this.selectOnFocus||b){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=Ext.isDefined(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.length<this.minLength){d.push(String.format(this.minLengthText,this.minLength))}if(a.length>this.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+="&#160;";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,alt:"",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,alt:"",cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Ext.BLANK_IMAGE_URL,alt:"",cls:"x-form-trigger "+this.trigger2Class}]}},getTrigger:function(a){return this.triggers[a]},afterRender:function(){Ext.form.TwinTriggerField.superclass.afterRender.call(this);var c=this.triggers,b=0,a=c.length;for(;b<a;++b){if(this["hideTrigger"+(b+1)]){c[b].hide()}}},initTrigger:function(){var a=this.trigger.select(".x-form-trigger",true),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());b["hidden"+e]=true};d.show=function(){var h=b.wrap.getWidth();this.dom.style.display="";b.el.setWidth(h-b.trigger.getWidth());b["hidden"+e]=false};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.reg("twintrigger",Ext.form.TwinTriggerField);Ext.form.TextArea=Ext.extend(Ext.form.TextField,{growMin:60,growMax:1000,growAppend:"&#160;\n&#160;",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},filterValidation:function(a){if(!a.isNavKeyPress()||(!this.enterIsSpecial&&a.keyCode==a.ENTER)){this.validationTask.delay(this.validationDelay)}},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="&#160;&#160;"}else{a+=this.growAppend;if(Ext.isIE){a=a.replace(/\n/g,"&#160;<br />")}}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",autoStripChars:false,initEvents:function(){var a=this.baseChars+"";if(this.allowDecimals){a+=this.decimalSeparator}if(this.allowNegative){a+="-"}a=Ext.escapeRe(a);this.maskRe=new RegExp("["+a+"]");if(this.autoStripChars){this.stripCharsRe=new RegExp("[^"+a+"]","gi")}Ext.form.NumberField.superclass.initEvents.call(this)},getErrors:function(b){var c=Ext.form.NumberField.superclass.getErrors.apply(this,arguments);b=Ext.isDefined(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(a<this.minValue){c.push(String.format(this.minText,this.minValue))}if(a>this.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=this.fixPrecision(a);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(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|n-j|n/j",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,startDay:0,defaultAutoCreate:{tag:"input",type:"text",size:"10",autocomplete:"off"},initTime:"12",initTimeFormat:"H",safeParse:function(b,c){if(Date.formatContainsHourInfo(c)){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&&g<this.minValue.clearTime().getTime()){h.push(String.format(this.minText,this.formatDate(this.minValue)))}if(this.maxValue&&g>this.maxValue.clearTime().getTime()){h.push(String.format(this.maxText,this.formatDate(this.maxValue)))}if(this.disabledDays){var a=e.getDay();for(var b=0;b<this.disabledDays.length;b++){if(a===this.disabledDays[b]){h.push(this.disabledDaysText);break}}}var d=this.formatDate(e);if(this.disabledDatesRE&&this.disabledDatesRE.test(d)){h.push(String.format(this.disabledDatesText,d))}return h},validateBlur:function(){return !this.menu||!this.menu.isVisible()},getValue:function(){return this.parseDate(Ext.form.DateField.superclass.getValue.call(this))||""},setValue:function(a){return Ext.form.DateField.superclass.setValue.call(this,this.formatDate(this.parseDate(a)))},parseDate:function(g){if(!g||Ext.isDate(g)){return g}var b=this.safeParse(g,this.format),c=this.altFormats,e=this.altFormatsArray;if(!b&&c){e=e||c.split("|");for(var d=0,a=e.length;d<a&&!b;d++){b=this.safeParse(g,e[d])}}return b},onDestroy:function(){Ext.destroy(this.menu,this.keyNav);Ext.form.DateField.superclass.onDestroy.call(this)},formatDate:function(a){return Ext.isDate(a)?a.dateFormat(this.format):a},onTriggerClick:function(){if(this.disabled){return}if(this.menu==null){this.menu=new Ext.menu.DateMenu({hideOnClick:false,focusOnSelect:false})}this.onFocus();Ext.apply(this.menu.picker,{minDate:this.minValue,maxDate:this.maxValue,disabledDatesRE:this.disabledDatesRE,disabledDatesText:this.disabledDatesText,disabledDays:this.disabledDays,disabledDaysText:this.disabledDaysText,format:this.format,showToday:this.showToday,startDay:this.startDay,minText:String.format(this.minText,this.formatDate(this.minValue)),maxText:String.format(this.maxText,this.formatDate(this.maxValue))});this.menu.picker.setValue(this.getValue()||new Date());this.menu.show(this.el,"tl-bl?");this.menuEvents("on")},menuEvents:function(a){this.menu[a]("select",this.onSelect,this);this.menu[a]("hide",this.onMenuHide,this);this.menu[a]("show",this.onFocus,this)},onSelect:function(a,b){this.setValue(b);this.fireEvent("select",this,b);this.menu.hide()},onMenuHide:function(){this.focus(false,60);this.menuEvents("un")},beforeBlur:function(){var a=this.parseDate(this.getRawValue());if(a){this.setValue(a)}}});Ext.reg("datefield",Ext.form.DateField);Ext.form.DisplayField=Ext.extend(Ext.form.Field,{validationEvent:false,validateOnBlur:false,defaultAutoCreate:{tag:"div"},fieldClass:"x-form-display-field",htmlEncode:false,initEvents:Ext.emptyFn,isValid:function(){return true},validate:function(){return true},getRawValue:function(){var a=this.rendered?this.el.dom.innerHTML:Ext.value(this.value,"");if(a===this.emptyText){a=""}if(this.htmlEncode){a=Ext.util.Format.htmlDecode(a)}return a},getValue:function(){return this.getRawValue()},getName:function(){return this.name},setRawValue:function(a){if(this.htmlEncode){a=Ext.util.Format.htmlEncode(a)}return this.rendered?(this.el.dom.innerHTML=(Ext.isEmpty(a)?"":a)):(this.value=a)},setValue:function(a){this.setRawValue(a);return this}});Ext.reg("displayfield",Ext.form.DisplayField);Ext.form.ComboBox=Ext.extend(Ext.form.TriggerField,{defaultAutoCreate:{tag:"input",type:"text",size:"24",autocomplete:"off"},listClass:"",selectedClass:"x-combo-selected",listEmptyText:"",triggerClass:"x-form-arrow-trigger",shadow:"sides",listAlign:"tl-bl?",maxHeight:300,minHeight:90,triggerAction:"query",minChars:4,autoSelect:true,typeAhead:false,queryDelay:500,pageSize:0,selectOnFocus:false,queryParam:"query",loadingText:"Loading...",resizable:false,handleHeight:8,allQuery:"",mode:"remote",minListWidth:70,forceSelection:false,typeAheadDelay:250,lazyInit:true,clearFilterOnReset:true,submitValue:undefined,initComponent:function(){Ext.form.ComboBox.superclass.initComponent.call(this);this.addEvents("expand","collapse","beforeselect","select","beforequery");if(this.transform){var c=Ext.getDom(this.transform);if(!this.hiddenName){this.hiddenName=c.name}if(!this.store){this.mode="local";var j=[],e=c.options;for(var b=0,a=e.length;b<a;b++){var h=e[b],g=(h.hasAttribute?h.hasAttribute("value"):h.getAttributeNode("value").specified)?h.value:h.text;if(h.selected&&Ext.isEmpty(this.value,true)){this.value=g}j.push([g,h.text])}this.store=new Ext.data.ArrayStore({idIndex:0,fields:["value","text"],data:j,autoDestroy:true});this.valueField="value";this.displayField="text"}c.name=Ext.id();if(!this.lazyRender){this.target=true;this.el=Ext.DomHelper.insertBefore(c,this.autoCreate||this.defaultAutoCreate);this.render(this.el.parentNode,c)}Ext.removeNode(c)}else{if(this.store){this.store=Ext.StoreMgr.lookup(this.store);if(this.store.autoCreated){this.displayField=this.valueField="field1";if(!this.store.expandData){this.displayField="field2"}this.mode="local"}}}this.selectedIndex=-1;if(this.mode=="local"){if(!Ext.isDefined(this.initialConfig.queryDelay)){this.queryDelay=10}if(!Ext.isDefined(this.initialConfig.minChars)){this.minChars=0}}},onRender:function(b,a){if(this.hiddenName&&!Ext.isDefined(this.submitValue)){this.submitValue=false}Ext.form.ComboBox.superclass.onRender.call(this,b,a);if(this.hiddenName){this.hiddenField=this.el.insertSibling({tag:"input",type:"hidden",name:this.hiddenName,id:(this.hiddenId||Ext.id())},"before",true)}if(Ext.isGecko){this.el.dom.setAttribute("autocomplete","off")}if(!this.lazyInit){this.initList()}else{this.on("focus",this.initList,this,{single:true})}},initValue:function(){Ext.form.ComboBox.superclass.initValue.call(this);if(this.hiddenField){this.hiddenField.value=Ext.value(Ext.isDefined(this.hiddenValue)?this.hiddenValue:this.value,"")}},getParentZIndex:function(){var a;if(this.ownerCt){this.findParentBy(function(b){a=parseInt(b.getPositionEl().getStyle("z-index"),10);return !!a})}return a},getZIndex:function(b){b=b||Ext.getDom(this.getListParent()||Ext.getBody());var a=parseInt(Ext.fly(b).getStyle("z-index"),10);if(!a){a=this.getParentZIndex()}return(a||12000)+5},initList:function(){if(!this.list){var a="x-combo-list",c=Ext.getDom(this.getListParent()||Ext.getBody());this.list=new Ext.Layer({parentEl:c,shadow:this.shadow,cls:[a,this.listClass].join(" "),constrain:false,zindex:this.getZIndex(c)});var b=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setSize(b,0);this.list.swallowEvent("mousewheel");this.assetHeight=0;if(this.syncFont!==false){this.list.setStyle("font-size",this.el.getStyle("font-size"))}if(this.title){this.header=this.list.createChild({cls:a+"-hd",html:this.title});this.assetHeight+=this.header.getHeight()}this.innerList=this.list.createChild({cls:a+"-inner"});this.mon(this.innerList,"mouseover",this.onViewOver,this);this.mon(this.innerList,"mousemove",this.onViewMove,this);this.innerList.setWidth(b-this.list.getFrameWidth("lr"));if(this.pageSize){this.footer=this.list.createChild({cls:a+"-ft"});this.pageTb=new Ext.PagingToolbar({store:this.store,pageSize:this.pageSize,renderTo:this.footer});this.assetHeight+=this.footer.getHeight()}if(!this.tpl){this.tpl='<tpl for="."><div class="'+a+'-item">{'+this.displayField+"}</div></tpl>"}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,d,e){this.maxHeight=e-this.handleHeight-this.list.getFrameWidth("tb")-this.assetHeight;this.listWidth=d;this.innerList.setWidth(d-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(){if(this.clearFilterOnReset&&this.mode=="local"){this.store.clearFilter()}Ext.form.ComboBox.superclass.reset.call(this)},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.isIE9&&Ext.isStrict)||Ext.isIE10p)||!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?'<div class="loading-indicator">'+this.loadingText+"</div>":"");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;if(this.valueField&&Ext.isDefined(this.value)){a=this.findRecord(this.valueField,this.value)}if(!a||a.get(this.displayField)!=b){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&&this.valueField){if(this.value==b){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.selectedIndex<a-1){this.select(this.selectedIndex+1)}}}},selectPrev:function(){var a=this.store.getCount();if(a>0){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={},c=this.store.paramNames;if(this.pageSize){b[c.start]=0;b[c.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));this.list.setZIndex(this.getZIndex());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:"&#160;",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.isIEQuirks){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 c=this.checked,b=this.inputValue;if(a===false){this.checked=false}else{this.checked=(a===true||a==="true"||a=="1"||(b?a==b:String(a).toLowerCase()=="on"))}if(this.rendered){this.el.dom.checked=this.checked;this.el.dom.defaultChecked=this.checked}if(c!=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;e<m;e++){Ext.applyIf(this.items[e],a)}}else{var d,n=[];if(typeof this.columns=="string"){this.columns=this.items.length}if(!Ext.isArray(this.columns)){var k=[];for(var e=0;e<this.columns;e++){k.push((100/this.columns)*0.01)}this.columns=k}d=this.columns.length;for(var e=0;e<d;e++){var b=Ext.apply({items:[]},a);b[this.columns[e]<=1?"columnWidth":"width"]=this.columns[e];if(this.defaults){b.defaults=Ext.apply(b.defaults||{},this.defaults)}n.push(b)}if(this.vertical){var r=Math.ceil(this.items.length/d),o=0;for(var e=0,m=this.items.length;e<m;e++){if(e>0&&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<m;e++){var q=e%d;if(this.items[e].fieldLabel){this.items[e].hideLabel=false}n[q].items.push(this.items[e])}}Ext.apply(p,{layoutConfig:{columns:d},items:n})}this.panel=new Ext.Container(p);this.panel.ownerCt=this;this.el=this.panel.getEl();if(this.forId&&this.itemCls){var c=this.el.up(this.itemCls).child("label",true);if(c){c.setAttribute("htmlFor",this.forId)}}var h=this.panel.findBy(function(i){return i.isFormField},this);this.items=new Ext.util.MixedCollection();this.items.addAll(h)}Ext.form.CheckboxGroup.superclass.onRender.call(this,j,g)},initValue:function(){if(this.value){this.setValue.apply(this,this.buffered?this.value:[this.value]);delete this.buffered;delete this.value}},afterRender:function(){Ext.form.CheckboxGroup.superclass.afterRender.call(this);this.eachItem(function(a){a.on("check",this.fireChecked,this);a.inGroup=true})},doLayout:function(){if(this.rendered){this.panel.forceLayout=this.ownerCt.forceLayout;this.panel.doLayout()}},fireChecked:function(){var a=[];this.eachItem(function(b){if(b.checked){a.push(b)}});this.fireEvent("change",this,a)},getErrors:function(){var b=Ext.form.CheckboxGroup.superclass.getErrors.apply(this,arguments);if(!this.allowBlank){var a=true;this.eachItem(function(c){if(c.checked){return(a=false)}});if(a){b.push(this.blankText)}}return b},isDirty:function(){if(this.disabled||!this.rendered){return false}var a=false;this.eachItem(function(b){if(b.isDirty()){a=true;return false}});return a},setReadOnly:function(a){if(this.rendered){this.eachItem(function(b){b.setReadOnly(a)})}this.readOnly=a},onDisable:function(){this.eachItem(function(a){a.disable()})},onEnable:function(){this.eachItem(function(a){a.enable()})},onResize:function(a,b){this.panel.setSize(a,b);this.panel.doLayout()},reset:function(){if(this.originalValue){this.eachItem(function(a){if(a.setValue){a.setValue(false);a.originalValue=a.getValue()}});this.resetOriginal=true;this.setValue(this.originalValue);delete this.resetOriginal}else{this.eachItem(function(a){if(a.reset){a.reset()}})}(function(){this.clearInvalid()}).defer(50,this)},setValue:function(){if(this.rendered){this.onSetValue.apply(this,arguments)}else{this.buffered=true;this.value=arguments}return this},onSetValue:function(d,c){if(arguments.length==1){if(Ext.isArray(d)){Ext.each(d,function(h,e){if(Ext.isObject(h)&&h.setValue){h.setValue(true);if(this.resetOriginal===true){h.originalValue=h.getValue()}}else{var g=this.items.itemAt(e);if(g){g.setValue(h)}}},this)}else{if(Ext.isObject(d)){for(var a in d){var b=this.getBox(a);if(b){b.setValue(d[a])}}}else{this.setValueForItem(d)}}}else{var b=this.getBox(d);if(b){b.setValue(c)}}},beforeDestroy:function(){Ext.destroy(this.panel);if(!this.rendered){Ext.destroy(this.items)}Ext.form.CheckboxGroup.superclass.beforeDestroy.call(this)},setValueForItem:function(a){a=String(a).split(",");this.eachItem(function(b){if(a.indexOf(b.inputValue)>-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,labelConnector:", ",initComponent:function(){var g=[],b=this.items,e;for(var d=0,c=b.length;d<c;d++){e=b[d];if(!Ext.isEmpty(e.ref)){e.ref="../"+e.ref}g.push(e.fieldLabel);Ext.applyIf(e,this.defaults);if(!(d==c-1&&this.skipLastItemMargin)){Ext.applyIf(e,{margins:this.defaultMargins})}}this.fieldLabel=this.fieldLabel||this.buildLabel(g);this.fieldErrors=new Ext.util.MixedCollection(true,function(h){return h.field});this.fieldErrors.on({scope:this,add:this.updateInvalidMark,remove:this.updateInvalidMark,replace:this.updateInvalidMark});Ext.form.CompositeField.superclass.initComponent.apply(this,arguments);this.innerCt=new Ext.Container({layout:"hbox",items:this.items,cls:"x-form-composite",defaultMargins:"0 3 0 0",ownerCt:this});delete this.innerCt.ownerCt;var a=this.innerCt.findBy(function(h){return h.isFormField},this);this.items=new Ext.util.MixedCollection();this.items.addAll(a)},onRender:function(c,a){if(!this.el){var d=this.innerCt;d.render(c);this.innerCt.ownerCt=this;this.el=d.getEl();if(this.combineErrors){this.eachItem(function(e){Ext.apply(e,{markInvalid:this.onFieldMarkInvalid.createDelegate(this,[e],0),clearInvalid:this.onFieldClearInvalid.createDelegate(this,[e],0)})})}var b=this.el.parent().parent().child("label",true);if(b){b.setAttribute("for",this.items.items[0].id)}}Ext.form.CompositeField.superclass.onRender.apply(this,arguments)},onFieldMarkInvalid:function(d,c){var b=d.getName(),a={field:b,errorName:d.fieldLabel||b,error:c};this.fieldErrors.replace(b,a);if(!d.preventMark){d.el.addClass(d.invalidClass)}},onFieldClearInvalid:function(a){this.fieldErrors.removeKey(a.getName());a.el.removeClass(a.invalidClass)},updateInvalidMark:function(){var a=Ext.isIE6&&Ext.isStrict;if(this.fieldErrors.length==0){this.clearInvalid();if(a){this.clearInvalid.defer(50,this)}}else{var b=this.buildCombinedErrorMessage(this.fieldErrors.items);this.sortErrors();this.markInvalid(b);if(a){this.markInvalid(b)}}},validateValue:function(c,a){var b=true;this.eachItem(function(d){if(!d.isValid(a)){b=false}});return b},buildCombinedErrorMessage:function(e){var d=[],b;for(var c=0,a=e.length;c<a;c++){b=e[c];d.push(String.format("{0}: {1}",b.errorName,b.error))}return d.join("<br />")},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 h<e?-1:1})},reset:function(){this.eachItem(function(a){a.reset()});(function(){this.clearInvalid()}).defer(50,this)},clearInvalidChildren:function(){this.eachItem(function(a){a.clearInvalid()})},buildLabel:function(a){return Ext.clean(a).join(this.labelConnector)},isDirty:function(){if(this.disabled||!this.rendered){return false}var a=false;this.eachItem(function(b){if(b.isDirty()){a=true;return false}});return a},eachItem:function(b,a){if(this.items&&this.items.each){this.items.each(b,a||this)}},onResize:function(e,c,a,d){var b=this.innerCt;if(this.rendered&&b.rendered){b.setSize(e,c)}Ext.form.CompositeField.superclass.onResize.apply(this,arguments)},doLayout:function(c,b){if(this.rendered){var a=this.innerCt;a.forceLayout=this.ownerCt.forceLayout;a.doLayout(c,b)}},beforeDestroy:function(){Ext.destroy(this.innerCt);Ext.form.CompositeField.superclass.beforeDestroy.call(this)},setReadOnly:function(a){if(a==undefined){a=true}a=!!a;if(this.rendered){this.eachItem(function(b){b.setReadOnly(a)})}this.readOnly=a},onShow:function(){Ext.form.CompositeField.superclass.onShow.call(this);this.doLayout()},onDisable:function(){this.eachItem(function(a){a.disable()})},onEnable:function(){this.eachItem(function(a){a.enable()})}});Ext.reg("compositefield",Ext.form.CompositeField);Ext.form.Radio=Ext.extend(Ext.form.Checkbox,{inputType:"radio",markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,getGroupValue:function(){var a=this.el.up("form")||Ext.getBody();var b=a.child('input[name="'+this.el.dom.name+'"]:checked',true);return b?b.value:null},setValue:function(b){var a,d,c;if(typeof b=="boolean"){Ext.form.Radio.superclass.setValue.call(this,b)}else{if(this.rendered){a=this.getCheckEl();c=a.child('input[name="'+this.el.dom.name+'"][value="'+b+'"]',true);if(c){Ext.getCmp(c.id).setValue(true)}}}if(this.rendered&&this.checked){a=a||this.getCheckEl();d=this.getCheckEl().select('input[name="'+this.el.dom.name+'"]');d.each(function(e){if(e.dom.id!=this.id){Ext.getCmp(e.dom.id).setValue(false)}},this)}return this},getCheckEl:function(){if(this.inGroup){return this.el.up(".x-form-radio-group")}return this.el.up("form")||Ext.getBody()}});Ext.reg("radio",Ext.form.Radio);Ext.form.RadioGroup=Ext.extend(Ext.form.CheckboxGroup,{allowBlank:true,blankText:"You must select one item in this group",defaultType:"radio",groupCls:"x-form-radio-group",getValue:function(){var a=null;this.eachItem(function(b){if(b.checked){a=b;return false}});return a},onSetValue:function(c,b){if(arguments.length>1){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",shouldLayout:false,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,d,c;a.each(function(e){d=this.findField(e.name);if(d){c=d.getValue();if(Ext.type(c)!==false&&c.getGroupValue){c=c.getGroupValue()}else{if(d.eachItem){c=[];d.eachItem(function(g){c.push(g.getValue())})}}b.set(e.name,c)}},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)}else{if(d instanceof Ext.form.CheckboxGroup&&d.rendered){return d.eachItem(a)}}}}};this.items.each(a)}return b||null},markInvalid:function(h){if(Ext.isArray(h)){for(var c=0,a=h.length;c<a;c++){var b=h[c];var d=this.findField(b.id);if(d){d.markInvalid(b.msg)}}}else{var e,g;for(g in h){if(!Ext.isFunction(h[g])&&(e=this.findField(g))){e.markInvalid(h[g])}}}return this},setValues:function(c){if(Ext.isArray(c)){for(var d=0,a=c.length;d<a;d++){var b=c[d];var e=this.findField(b.id);if(e){e.setValue(b.value);if(this.trackResetOnLoad){e.originalValue=e.getValue()}}}}else{var g,h;for(h in c){if(!Ext.isFunction(c[h])&&(g=this.findField(h))){g.setValue(c[h]);if(this.trackResetOnLoad){g.originalValue=g.getValue()}}}}return this},getValues:function(b){var a=Ext.lib.Ajax.serializeForm(this.el.dom);if(b===true){return a}return Ext.urlDecode(a)},getFieldValues:function(a){var d={},e,b,c;this.items.each(function(g){if(!g.disabled&&(a!==true||g.isDirty())){e=g.getName();b=d[e];c=g.getValue();if(Ext.isDefined(b)){if(Ext.isArray(b)){d[e].push(c)}else{d[e]=[b,c]}}else{d[e]=c}}});return d},clearInvalid:function(){this.items.each(function(a){a.clearInvalid()});return this},reset:function(){this.items.each(function(a){a.reset()});return this},add:function(){this.items.addAll(Array.prototype.slice.call(arguments,0));return this},remove:function(a){this.items.remove(a);return this},cleanDestroyed:function(){this.items.filterBy(function(a){return !!a.isDestroyed}).each(this.remove,this)},render:function(){this.items.each(function(a){if(a.isFormField&&!a.rendered&&document.getElementById(a.id)){a.applyToMarkup(a.id)}});return this},applyToFields:function(a){this.items.each(function(b){Ext.apply(b,a)});return this},applyIfToFields:function(a){this.items.each(function(b){Ext.applyIf(b,a)});return this},callFieldMethod:function(b,a){a=a||[];this.items.each(function(c){if(Ext.isFunction(c[b])){c[b].apply(c,a)}});return this}});Ext.BasicForm=Ext.form.BasicForm;Ext.FormPanel=Ext.extend(Ext.Panel,{minButtonWidth:75,labelAlign:"left",monitorValid:false,monitorPoll:200,layout:"form",initComponent:function(){this.form=this.createForm();Ext.FormPanel.superclass.initComponent.call(this);this.bodyCfg={tag:"form",cls:this.baseCls+"-body",method:this.method||"POST",id:this.formId||Ext.id()};if(this.fileUpload){this.bodyCfg.enctype="multipart/form-data"}this.initItems();this.addEvents("clientvalidation");this.relayEvents(this.form,["beforeaction","actionfailed","actioncomplete"])},createForm:function(){var a=Ext.applyIf({listeners:{}},this.initialConfig);return new Ext.form.BasicForm(null,a)},initFields:function(){var c=this.form;var a=this;var b=function(d){if(a.isField(d)){c.add(d)}else{if(d.findBy&&d!=a){a.applySettings(d);if(d.items&&d.items.each){d.items.each(b,this)}}}};this.items.each(b,this)},applySettings:function(b){var a=b.ownerCt;Ext.applyIf(b,{labelAlign:a.labelAlign,labelWidth:a.labelWidth,itemCls:a.itemCls})},getLayoutTarget:function(){return this.form.el},getForm:function(){return this.form},onRender:function(b,a){this.initFields();Ext.FormPanel.superclass.onRender.call(this,b,a);this.form.initEl(this.body)},beforeDestroy:function(){this.stopMonitoring();this.form.destroy(true);Ext.FormPanel.superclass.beforeDestroy.call(this)},isField:function(a){return !!a.setValue&&!!a.getValue&&!!a.markInvalid&&!!a.clearInvalid},initEvents:function(){Ext.FormPanel.superclass.initEvents.call(this);this.on({scope:this,add:this.onAddEvent,remove:this.onRemoveEvent});if(this.monitorValid){this.startMonitoring()}},onAdd:function(a){Ext.FormPanel.superclass.onAdd.call(this,a);this.processAdd(a)},onAddEvent:function(a,b){if(a!==this){this.processAdd(b)}},processAdd:function(a){if(this.isField(a)){this.form.add(a)}else{if(a.findBy){this.applySettings(a);this.form.add.apply(this.form,a.findBy(this.isField))}}},onRemove:function(a){Ext.FormPanel.superclass.onRemove.call(this,a);this.processRemove(a)},onRemoveEvent:function(a,b){if(a!==this){this.processRemove(b)}},processRemove:function(a){if(!this.destroying){if(this.isField(a)){this.form.remove(a)}else{if(a.findBy){Ext.each(a.findBy(this.isField),this.form.remove,this.form);this.form.cleanDestroyed()}}}},startMonitoring:function(){if(!this.validTask){this.validTask=new Ext.util.TaskRunner();this.validTask.start({run:this.bindHandler,interval:this.monitorPoll||200,scope:this})}},stopMonitoring:function(){if(this.validTask){this.validTask.stopAll();this.validTask=null}},load:function(){this.form.load.apply(this.form,arguments)},onDisable:function(){Ext.FormPanel.superclass.onDisable.call(this);if(this.form){this.form.items.each(function(){this.disable()})}},onEnable:function(){Ext.FormPanel.superclass.onEnable.call(this);if(this.form){this.form.items.each(function(){this.enable()})}},bindHandler:function(){var e=true;this.form.items.each(function(g){if(!g.isValid(true)){e=false;return false}});if(this.fbar){var b=this.fbar.items.items;for(var d=0,a=b.length;d<a;d++){var c=b[d];if(c.formBind===true&&c.disabled===e){c.setDisabled(!e)}}}this.fireEvent("clientvalidation",this,e)}});Ext.reg("form",Ext.FormPanel);Ext.form.FormPanel=Ext.FormPanel;Ext.form.FieldSet=Ext.extend(Ext.Panel,{baseCls:"x-fieldset",layout:"form",animCollapse:false,onRender:function(b,a){if(!this.el){this.el=document.createElement("fieldset");this.el.id=this.id;if(this.title||this.header||this.checkboxToggle){this.el.appendChild(document.createElement("legend")).className=this.baseCls+"-header"}}Ext.form.FieldSet.superclass.onRender.call(this,b,a);if(this.checkboxToggle){var c=typeof this.checkboxToggle=="object"?this.checkboxToggle:{tag:"input",type:"checkbox",name:this.checkboxName||this.id+"-checkbox"};this.checkbox=this.header.insertFirst(c);this.checkbox.dom.checked=!this.collapsed;this.mon(this.checkbox,"click",this.onCheckClick,this)}},onCollapse:function(a,b){if(this.checkbox){this.checkbox.dom.checked=false}Ext.form.FieldSet.superclass.onCollapse.call(this,a,b)},onExpand:function(a,b){if(this.checkbox){this.checkbox.dom.checked=true}Ext.form.FieldSet.superclass.onExpand.call(this,a,b)},onCheckClick:function(){this[this.checkbox.dom.checked?"expand":"collapse"]()}});Ext.reg("fieldset",Ext.form.FieldSet);Ext.form.HtmlEditor=Ext.extend(Ext.form.Field,{enableFormat:true,enableFontSize:true,enableColors:true,enableAlignments:true,enableLists:true,enableSourceEdit:true,enableLinks:true,enableFont:true,createLinkText:"Please enter the URL for the link:",defaultLinkValue:"http://",fontFamilies:["Arial","Courier New","Tahoma","Times New Roman","Verdana"],defaultFont:"tahoma",defaultValue:(Ext.isOpera||Ext.isIE6)?"&#160;":"&#8203;",actionMode:"wrap",validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Ext.emptyFn,iframePad:3,hideMode:"offsets",defaultAutoCreate:{tag:"textarea",style:"width:500px;height:300px;",autocomplete:"off"},initComponent:function(){this.addEvents("initialize","activate","beforesync","beforepush","sync","push","editmodechange");Ext.form.HtmlEditor.superclass.initComponent.call(this)},createFontOptions:function(){var d=[],b=this.fontFamilies,c,g;for(var e=0,a=b.length;e<a;e++){c=b[e];g=c.toLowerCase();d.push('<option value="',g,'" style="font-family:',c,';"',(this.defaultFont==g?' selected="true">':">"),c,"</option>")}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('<html><head><style type="text/css">body{border: 0; margin: 0; padding: {0}px; height: {1}px; cursor: text}</style></head><body></body></html>',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";a.src=Ext.SSL_SECURE_URL;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 a=this.getDoc();this.win=this.getWin();a.open();a.write(this.getDocMarkup());a.close();this.readyTask={run:function(){var b=this.getDoc();if(b.body||b.readyState=="complete"){Ext.TaskMgr.stop(this.readyTask);this.setDesignMode(true);this.initEditor.defer(10,this)}},interval:10,duration:10000,scope:this};Ext.TaskMgr.start(this.readyTask)},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=this.getDoc();if(a){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){this.previousSize=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(this.previousSize);delete this.previousSize;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='<div style="'+a[0]+'">'+c+"</div>"}}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){}},beforeDestroy:function(){if(this.monitorTask){Ext.TaskMgr.stop(this.monitorTask)}if(this.readyTask){Ext.TaskMgr.stop(this.readyTask)}if(this.rendered){Ext.destroy(this.tb);var b=this.getDoc();Ext.EventManager.removeFromSpecialCache(b);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()}}Ext.form.HtmlEditor.superclass.beforeDestroy.call(this)},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("&nbsp;&nbsp;&nbsp;&nbsp;");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("<br />");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","&nbsp;&nbsp;&nbsp;&nbsp;");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","<br /><br />");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<a&&!b;e++){b=Date.parseDate(j+h,g+d[e])}}return b}});Ext.reg("timefield",Ext.form.TimeField);Ext.form.SliderField=Ext.extend(Ext.form.Field,{useTips:true,tipText:null,actionMode:"wrap",initComponent:function(){var b=Ext.copyTo({id:this.id+"-slider"},this.initialConfig,["vertical","minValue","maxValue","decimalPrecision","keyIncrement","increment","clickToChange","animate"]);if(this.useTips){var a=this.tipText?{getText:this.tipText}:{};b.plugins=[new Ext.slider.Tip(a)]}this.slider=new Ext.Slider(b);Ext.form.SliderField.superclass.initComponent.call(this)},onRender:function(b,a){this.autoCreate={id:this.id,name:this.name,type:"hidden",tag:"input"};Ext.form.SliderField.superclass.onRender.call(this,b,a);this.wrap=this.el.wrap({cls:"x-form-field-wrap"});this.resizeEl=this.positionEl=this.wrap;this.slider.render(this.wrap)},onResize:function(b,c,d,a){Ext.form.SliderField.superclass.onResize.call(this,b,c,d,a);this.slider.setSize(b,c)},initEvents:function(){Ext.form.SliderField.superclass.initEvents.call(this);this.slider.on("change",this.onChange,this)},onChange:function(b,a){this.setValue(a,undefined,true)},onEnable:function(){Ext.form.SliderField.superclass.onEnable.call(this);this.slider.enable()},onDisable:function(){Ext.form.SliderField.superclass.onDisable.call(this);this.slider.disable()},beforeDestroy:function(){Ext.destroy(this.slider);Ext.form.SliderField.superclass.beforeDestroy.call(this)},alignErrorIcon:function(){this.errorIcon.alignTo(this.slider.el,"tl-tr",[2,0])},setMinValue:function(a){this.slider.setMinValue(a);return this},setMaxValue:function(a){this.slider.setMaxValue(a);return this},setValue:function(c,b,a){if(!a){this.slider.setValue(c,b)}return Ext.form.SliderField.superclass.setValue.call(this,this.slider.getValue())},getValue:function(){return this.slider.getValue()}});Ext.reg("sliderfield",Ext.form.SliderField);Ext.form.Label=Ext.extend(Ext.BoxComponent,{onRender:function(b,a){if(!this.el){this.el=document.createElement("label");this.el.id=this.getId();this.el.innerHTML=this.text?Ext.util.Format.htmlEncode(this.text):(this.html||"");if(this.forId){this.el.setAttribute("for",this.forId)}}Ext.form.Label.superclass.onRender.call(this,b,a)},setText:function(a,b){var c=b===false;this[!c?"text":"html"]=a;delete this[c?"text":"html"];if(this.rendered){this.el.dom.innerHTML=b!==false?Ext.util.Format.htmlEncode(a):a}return this}});Ext.reg("label",Ext.form.Label);Ext.form.Action=function(b,a){this.form=b;this.options=a||{}};Ext.form.Action.CLIENT_INVALID="client";Ext.form.Action.SERVER_INVALID="server";Ext.form.Action.CONNECT_FAILURE="connect";Ext.form.Action.LOAD_FAILURE="load";Ext.form.Action.prototype={type:"default",run:function(a){},success:function(a){},handleResponse:function(a){},failure:function(a){this.response=a;this.failureType=Ext.form.Action.CONNECT_FAILURE;this.form.afterAction(this,false)},processResponse:function(a){this.response=a;if(!a.responseText&&!a.responseXML){return true}this.result=this.handleResponse(a);return this.result},decodeResponse:function(a){try{return Ext.decode(a.responseText)}catch(b){return false}},getUrl:function(c){var a=this.options.url||this.form.url||this.form.el.dom.action;if(c){var b=this.getParams();if(b){a=Ext.urlAppend(a,b)}}return a},getMethod:function(){return(this.options.method||this.form.method||this.form.el.dom.method||"POST").toUpperCase()},getParams:function(){var a=this.form.baseParams;var b=this.options.params;if(b){if(typeof b=="object"){b=Ext.urlEncode(Ext.applyIf(b,a))}else{if(typeof b=="string"&&a){b+="&"+Ext.urlEncode(a)}}}else{if(a){b=Ext.urlEncode(a)}}return b},createCallback:function(a){var a=a||{};return{success:this.success,failure:this.failure,scope:this,timeout:(a.timeout*1000)||(this.form.timeout*1000),upload:this.form.fileUpload?this.success:undefined}}};Ext.form.Action.Submit=function(b,a){Ext.form.Action.Submit.superclass.constructor.call(this,b,a)};Ext.extend(Ext.form.Action.Submit,Ext.form.Action,{type:"submit",run:function(){var e=this.options,g=this.getMethod(),d=g=="GET";if(e.clientValidation===false||this.form.isValid()){if(e.submitEmptyText===false){var a=this.form.items,c=[],b=function(h){if(h.el.getValue()==h.emptyText){c.push(h);h.el.dom.value=""}if(h.isComposite&&h.rendered){h.items.each(b)}};a.each(b)}Ext.Ajax.request(Ext.apply(this.createCallback(e),{form:this.form.el.dom,url:this.getUrl(d),method:g,headers:e.headers,params:!d?this.getParams():null,isUpload:this.form.fileUpload}));if(e.submitEmptyText===false){Ext.each(c,function(h){if(h.applyEmptyText){h.applyEmptyText()}})}}else{if(e.clientValidation!==false){this.failureType=Ext.form.Action.CLIENT_INVALID;this.form.afterAction(this,false)}}},success:function(b){var a=this.processResponse(b);if(a===true||a.success){this.form.afterAction(this,true);return}if(a.errors){this.form.markInvalid(a.errors)}this.failureType=Ext.form.Action.SERVER_INVALID;this.form.afterAction(this,false)},handleResponse:function(c){if(this.form.errorReader){var b=this.form.errorReader.read(c);var g=[];if(b.records){for(var d=0,a=b.records.length;d<a;d++){var e=b.records[d];g[d]=e.data}}if(g.length<1){g=null}return{success:b.success,errors:g}}return this.decodeResponse(c)}});Ext.form.Action.Load=function(b,a){Ext.form.Action.Load.superclass.constructor.call(this,b,a);this.reader=this.form.reader};Ext.extend(Ext.form.Action.Load,Ext.form.Action,{type:"load",run:function(){Ext.Ajax.request(Ext.apply(this.createCallback(this.options),{method:this.getMethod(),url:this.getUrl(false),headers:this.options.headers,params:this.getParams()}))},success:function(b){var a=this.processResponse(b);if(a===true||!a.success||!a.data){this.failureType=Ext.form.Action.LOAD_FAILURE;this.form.afterAction(this,false);return}this.form.clearInvalid();this.form.setValues(a.data);this.form.afterAction(this,true)},handleResponse:function(b){if(this.form.reader){var a=this.form.reader.read(b);var c=a.records&&a.records[0]?a.records[0].data:null;return{success:a.success,data:c}}return this.decodeResponse(b)}});Ext.form.Action.DirectLoad=Ext.extend(Ext.form.Action.Load,{constructor:function(b,a){Ext.form.Action.DirectLoad.superclass.constructor.call(this,b,a)},type:"directload",run:function(){var a=this.getParams();a.push(this.success,this);this.form.api.load.apply(window,a)},getParams:function(){var c=[],h={};var e=this.form.baseParams;var g=this.options.params;Ext.apply(h,g,e);var b=this.form.paramOrder;if(b){for(var d=0,a=b.length;d<a;d++){c.push(h[b[d]])}}else{if(this.form.paramsAsHash){c.push(h)}}return c},processResponse:function(a){this.result=a;return a},success:function(a,b){if(b.type==Ext.Direct.exceptions.SERVER){a={}}Ext.form.Action.DirectLoad.superclass.success.call(this,a)}});Ext.form.Action.DirectSubmit=Ext.extend(Ext.form.Action.Submit,{constructor:function(b,a){Ext.form.Action.DirectSubmit.superclass.constructor.call(this,b,a)},type:"directsubmit",run:function(){var a=this.options;if(a.clientValidation===false||this.form.isValid()){this.success.params=this.getParams();this.form.api.submit(this.form.el.dom,this.success,this)}else{if(a.clientValidation!==false){this.failureType=Ext.form.Action.CLIENT_INVALID;this.form.afterAction(this,false)}}},getParams:function(){var c={};var a=this.form.baseParams;var b=this.options.params;Ext.apply(c,b,a);return c},processResponse:function(a){this.result=a;return a},success:function(a,b){if(b.type==Ext.Direct.exceptions.SERVER){a={}}Ext.form.Action.DirectSubmit.superclass.success.call(this,a)}});Ext.form.Action.ACTION_TYPES={load:Ext.form.Action.Load,submit:Ext.form.Action.Submit,directload:Ext.form.Action.DirectLoad,directsubmit:Ext.form.Action.DirectSubmit};Ext.form.VTypes=function(){var c=/^[a-zA-Z_]+$/,d=/^[a-zA-Z0-9_]+$/,b=/^(\w+)([\-+.\'][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/,a=/(((^https?)|(^ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;return{email:function(e){return b.test(e)},emailText:'This field should be an e-mail address in the format "user@example.com"',emailMask:/[a-z0-9_\.\-\+\'@]/i,url:function(e){return a.test(e)},urlText:'This field should be a URL in the format "http://www.example.com"',alpha:function(e){return c.test(e)},alphaText:"This field should only contain letters and _",alphaMask:/[a-z_]/i,alphanum:function(e){return d.test(e)},alphanumText:"This field should only contain letters, numbers and _",alphanumMask:/[a-z0-9_]/i}}();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,g=a.columns,j=this.store,m,h,l;if(g){for(var d=0,e=g.length;d<e;d++){m=g[d];h=k.getColumnById(m.id);if(h){l=k.getIndexById(m.id);k.setState(l,{hidden:m.hidden,width:m.width,sortable:h.sortable,editable:h.editable});if(l!=d){k.moveColumn(l,d)}}}}if(j){m=a.sort;if(m){j[j.remoteSort?"setDefaultSort":"sort"](m.field,m.direction)}m=a.group;if(j.groupBy){if(m){j.groupBy(m)}else{j.clearGrouping()}}}var b=Ext.apply({},a);delete b.columns;delete b.sort;Ext.grid.GridPanel.superclass.applyState.call(this,b)},getState:function(){var g={columns:[]},b=this.store,e,a;for(var d=0,h;(h=this.colModel.config[d]);d++){g.columns[d]={id:h.id,width:h.width};if(h.hidden){g.columns[d].hidden=true}}if(b){e=b.getSortState();if(e){g.sort=e}if(b.getGroupState){a=b.getGroupState();if(a){g.group=a}}}return g},afterRender:function(){Ext.grid.GridPanel.superclass.afterRender.call(this);var a=this.view;this.on("bodyresize",a.layout,a);a.layout(true);if(this.deferRowRender){if(!this.deferRowRenderTask){this.deferRowRenderTask=new Ext.util.DelayedTask(a.afterRender,this.view)}this.deferRowRenderTask.delay(10)}else{a.afterRender()}this.viewReady=true},reconfigure:function(a,b){var c=this.rendered;if(c){if(this.loadMask){this.loadMask.destroy();this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({},{store:a},this.initialConfig.loadMask))}}if(this.view){this.view.initData(a,b)}this.store=a;this.colModel=b;if(c){this.view.refresh(true)}this.fireEvent("reconfigure",this,a,b)},onDestroy:function(){if(this.deferRowRenderTask&&this.deferRowRenderTask.cancel){this.deferRowRenderTask.cancel()}if(this.rendered){Ext.destroy(this.view,this.loadMask)}else{if(this.store&&this.store.autoDestroy){this.store.destroy()}}Ext.destroy(this.colModel,this.selModel);this.store=this.selModel=this.colModel=this.view=this.loadMask=null;Ext.grid.GridPanel.superclass.onDestroy.call(this)},processEvent:function(a,b){this.view.processEvent(a,b)},onClick:function(a){this.processEvent("click",a)},onMouseDown:function(a){this.processEvent("mousedown",a)},onContextMenu:function(b,a){this.processEvent("contextmenu",b)},onDblClick:function(a){this.processEvent("dblclick",a)},walkCells:function(k,c,b,e,j){var i=this.colModel,g=i.getColumnCount(),a=this.store,h=a.getCount(),d=true;if(b<0){if(c<0){k--;d=false}while(k>=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<h){if(!d){c=0}d=false;while(c<g){if(e.call(j||this,k,c,i)===true){return[k,c]}c++}k++}}return null},getGridEl:function(){return this.body},stopEditing:Ext.emptyFn,getSelectionModel:function(){if(!this.selModel){this.selModel=new Ext.grid.RowSelectionModel(this.disableSelection?{selectRow:Ext.emptyFn}:null)}return this.selModel},getStore:function(){return this.store},getColumnModel:function(){return this.colModel},getView:function(){if(!this.view){this.view=new Ext.grid.GridView(this.viewConfig)}return this.view},getDragDropText:function(){var a=this.selModel.getCount?this.selModel.getCount():1;return String.format(this.ddText,a,a==1?"":"s")}});Ext.reg("grid",Ext.grid.GridPanel);Ext.grid.PivotGrid=Ext.extend(Ext.grid.GridPanel,{aggregator:"sum",renderer:undefined,initComponent:function(){Ext.grid.PivotGrid.superclass.initComponent.apply(this,arguments);this.initAxes();this.enableColumnResize=false;this.viewConfig=Ext.apply(this.viewConfig||{},{forceFit:true});this.colModel=new Ext.grid.ColumnModel({})},getAggregator:function(){if(typeof this.aggregator=="string"){return Ext.grid.PivotAggregatorMgr.types[this.aggregator]}else{return this.aggregator}},setAggregator:function(a){this.aggregator=a},setMeasure:function(a){this.measure=a},setLeftAxis:function(b,a){this.leftAxis=b;if(a){this.view.refresh()}},setTopAxis:function(b,a){this.topAxis=b;if(a){this.view.refresh()}},initAxes:function(){var a=Ext.grid.PivotAxis;if(!(this.leftAxis instanceof a)){this.setLeftAxis(new a({orientation:"vertical",dimensions:this.leftAxis||[],store:this.store}))}if(!(this.topAxis instanceof a)){this.setTopAxis(new a({orientation:"horizontal",dimensions:this.topAxis||[],store:this.store}))}},extractData:function(){var c=this.store.data.items,s=c.length,q=[],h,g,e,d;if(s==0){return[]}var l=this.leftAxis.getTuples(),o=l.length,m=this.topAxis.getTuples(),a=m.length,b=this.getAggregator();for(g=0;g<s;g++){h=c[g];for(e=0;e<o;e++){q[e]=q[e]||[];if(l[e].matcher(h)===true){for(d=0;d<a;d++){q[e][d]=q[e][d]||[];if(m[d].matcher(h)){q[e][d].push(h)}}}}}var n=q.length,p,r;for(g=0;g<n;g++){r=q[g];p=r.length;for(e=0;e<p;e++){q[g][e]=b(q[g][e],this.measure)}}return q},getView:function(){if(!this.view){this.view=new Ext.grid.PivotGridView(this.viewConfig)}return this.view}});Ext.reg("pivotgrid",Ext.grid.PivotGrid);Ext.grid.PivotAggregatorMgr=new Ext.AbstractManager();Ext.grid.PivotAggregatorMgr.registerType("sum",function(a,c){var e=a.length,d=0,b;for(b=0;b<e;b++){d+=a[b].get(c)}return d});Ext.grid.PivotAggregatorMgr.registerType("avg",function(a,c){var e=a.length,d=0,b;for(b=0;b<e;b++){d+=a[b].get(c)}return(d/e)||"n/a"});Ext.grid.PivotAggregatorMgr.registerType("min",function(a,c){var e=[],d=a.length,b;for(b=0;b<d;b++){e.push(a[b].get(c))}return Math.min.apply(this,e)||"n/a"});Ext.grid.PivotAggregatorMgr.registerType("max",function(a,c){var e=[],d=a.length,b;for(b=0;b<d;b++){e.push(a[b].get(c))}return Math.max.apply(this,e)||"n/a"});Ext.grid.PivotAggregatorMgr.registerType("count",function(a,b){return a.length});Ext.grid.GridView=Ext.extend(Ext.util.Observable,{deferEmptyText:true,scrollOffset:undefined,autoFill:false,forceFit:false,sortClasses:["sort-asc","sort-desc"],sortAscText:"Sort Ascending",sortDescText:"Sort Descending",hideSortIcons:false,columnsText:"Columns",selectedRowClass:"x-grid3-row-selected",borderWidth:2,tdClass:"x-grid3-cell",hdCls:"x-grid3-hd",markDirty:true,cellSelectorDepth:4,rowSelectorDepth:10,rowBodySelectorDepth:10,cellSelector:"td.x-grid3-cell",rowSelector:"div.x-grid3-row",rowBodySelector:"div.x-grid3-row-body",firstRowCls:"x-grid3-row-first",lastRowCls:"x-grid3-row-last",rowClsRe:/(?:^|\s+)x-grid3-row-(first|last|alt)(?:\s+|$)/g,headerMenuOpenCls:"x-grid3-hd-menu-open",rowOverCls:"x-grid3-row-over",constructor:function(a){Ext.apply(this,a);this.addEvents("beforerowremoved","beforerowsinserted","beforerefresh","rowremoved","rowsinserted","rowupdated","refresh");Ext.grid.GridView.superclass.constructor.call(this)},masterTpl:new Ext.Template('<div class="x-grid3" hidefocus="true">','<div class="x-grid3-viewport">','<div class="x-grid3-header">','<div class="x-grid3-header-inner">','<div class="x-grid3-header-offset" style="{ostyle}">{header}</div>',"</div>",'<div class="x-clear"></div>',"</div>",'<div class="x-grid3-scroller">','<div class="x-grid3-body" style="{bstyle}">{body}</div>','<a href="#" class="x-grid3-focus" tabIndex="-1"></a>',"</div>","</div>",'<div class="x-grid3-resize-marker">&#160;</div>','<div class="x-grid3-resize-proxy">&#160;</div>',"</div>"),headerTpl:new Ext.Template('<table border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<thead>",'<tr class="x-grid3-hd-row">{cells}</tr>',"</thead>","</table>"),bodyTpl:new Ext.Template("{rows}"),cellTpl:new Ext.Template('<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}" tabIndex="0" {cellAttr}>','<div class="x-grid3-cell-inner x-grid3-col-{id} x-unselectable" unselectable="on" {attr}>{value}</div>',"</td>"),initTemplates:function(){var c=this.templates||{},d,b,g=new Ext.Template('<td class="x-grid3-hd x-grid3-cell x-grid3-td-{id} {css}" style="{style}">','<div {tooltip} {attr} class="x-grid3-hd-inner x-grid3-hd-{id}" unselectable="on" style="{istyle}">',this.grid.enableHdMenu?'<a class="x-grid3-hd-btn" href="#"></a>':"","{value}",'<img alt="" class="x-grid3-sort-icon" src="',Ext.BLANK_IMAGE_URL,'" />',"</div>","</td>"),a=['<tr class="x-grid3-row-body-tr" style="{bodyStyle}">','<td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on">','<div class="x-grid3-row-body">{body}</div>',"</td>","</tr>"].join(""),e=['<table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<tbody>","<tr>{cells}</tr>",this.enableRowBody?a:"","</tbody>","</table>"].join("");Ext.applyIf(c,{hcell:g,cell:this.cellTpl,body:this.bodyTpl,header:this.headerTpl,master:this.masterTpl,row:new Ext.Template('<div class="x-grid3-row {alt}" style="{tstyle}">'+e+"</div>"),rowInner:new Ext.Template(e)});for(b in c){d=c[b];if(d&&Ext.isFunction(d.compile)&&!d.compiled){d.disableFormats=true;d.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 b=Ext.Element,d=Ext.get(this.grid.getGridEl().dom.firstChild),e=new b(d.child("div.x-grid3-viewport")),c=new b(e.child("div.x-grid3-header")),a=new b(e.child("div.x-grid3-scroller"));if(this.grid.hideHeaders){c.setDisplayed(false)}if(this.forceFit){a.setStyle("overflow-x","hidden")}Ext.apply(this,{el:d,mainWrap:e,scroller:a,mainHd:c,innerHd:c.child("div.x-grid3-header-inner").dom,mainBody:new b(b.fly(a).child("div.x-grid3-body")),focusEl:new b(b.fly(a).child("a")),resizeMarker:new b(d.child("div.x-grid3-resize-marker")),resizeProxy:new b(d.child("div.x-grid3-resize-proxy"))});this.focusEl.swallowEvent("click",true)},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(d,c){var b=this.findCell(d),a;if(b){a=this.fly(b).hasClass(c);if(!c||a){return this.getCellIndex(b)}}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 Ext.fly(this.getRow(b)).query(this.cellSelector)[a]},getHeaderCell:function(a){return this.mainHd.dom.getElementsByTagName("td")[a]},addRowClass:function(b,a){var c=this.getRow(b);if(c){this.fly(c).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,d;for(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(){var a=this.scroller.dom;a.scrollTop=0;a.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var a=this.scroller.dom;this.grid.fireEvent("bodyscroll",a.scrollLeft,a.scrollTop)},syncHeaderScroll:function(){var a=this.innerHd,b=this.scroller.dom.scrollLeft;a.scrollLeft=b;a.scrollLeft=b},updateSortIcon:function(d,c){var a=this.sortClasses,b=a[c=="DESC"?1:0],e=this.mainHd.select("td").removeClass(a);e.item(d).addClass(b)},updateAllColumnWidths:function(){var e=this.getTotalWidth(),k=this.cm.getColumnCount(),m=this.getRows(),g=m.length,b=[],l,a,h,d,c;for(d=0;d<k;d++){b[d]=this.getColumnWidth(d);this.getHeaderCell(d).style.width=b[d]}this.updateHeaderWidth();for(d=0;d<g;d++){l=m[d];l.style.width=e;a=l.firstChild;if(a){a.style.width=e;h=a.rows[0];for(c=0;c<k;c++){h.childNodes[c].style.width=b[c]}}}this.onAllColumnWidthsUpdated(b,e)},updateColumnWidth:function(d,b){var c=this.getColumnWidth(d),j=this.getTotalWidth(),h=this.getHeaderCell(d),a=this.getRows(),e=a.length,l,g,k;this.updateHeaderWidth();h.style.width=c;for(g=0;g<e;g++){l=a[g];k=l.firstChild;l.style.width=j;if(k){k.style.width=j;k.rows[0].childNodes[d].style.width=c}}this.onColumnWidthUpdated(d,c,j)},updateColumnHidden:function(b,j){var h=this.getTotalWidth(),k=j?"none":"",g=this.getHeaderCell(b),a=this.getRows(),d=a.length,l,c,e;this.updateHeaderWidth();g.style.display=k;for(e=0;e<d;e++){l=a[e];l.style.width=h;c=l.firstChild;if(c){c.style.width=h;c.rows[0].childNodes[b].style.display=k}}this.onColumnHiddenUpdated(b,j,h);delete this.lastViewWidth;this.layout()},doRender:function(d,v,m,a,r,t){var h=this.templates,c=h.cell,y=h.row,o=r-1,b="width:"+this.getTotalWidth()+";",k=[],l=[],n={tstyle:b},q={},w=v.length,x,g,e,u,s,p;for(s=0;s<w;s++){e=v[s];l=[];p=s+a;for(u=0;u<r;u++){g=d[u];q.id=g.id;q.css=u===0?"x-grid3-cell-first ":(u==o?"x-grid3-cell-last ":"");q.attr=q.cellAttr="";q.style=g.style;q.value=g.renderer.call(g.scope,e.data[g.name],q,e,p,u,m);if(Ext.isEmpty(q.value)){q.value="&#160;"}if(this.markDirty&&e.dirty&&typeof e.modified[g.name]!="undefined"){q.css+=" x-grid3-dirty-cell"}l[l.length]=c.apply(q)}x=[];if(t&&((p+1)%2===0)){x[0]="x-grid3-row-alt"}if(e.dirty){x[1]=" x-grid3-dirty-row"}n.cols=r;if(this.getRowClass){x[2]=this.getRowClass(e,p,n,m)}n.alt=x.join(" ");n.cells=l.join("");k[k.length]=y.apply(n)}return k.join("")},processRows:function(a,g){if(!this.ds||this.ds.getCount()<1){return}var d=this.getRows(),c=d.length,e,b;g=g||!this.grid.stripeRows;a=a||0;for(b=0;b<c;b++){e=d[b];if(e){e.rowIndex=b;if(!g){e.className=e.className.replace(this.rowClsRe," ");if((b+1)%2===0){e.className+=" x-grid3-row-alt"}}}}if(a===0){Ext.fly(d[0]).addClass(this.firstRowCls)}Ext.fly(d[c-1]).addClass(this.lastRowCls)},afterRender:function(){if(!this.ds||!this.cm){return}this.mainBody.dom.innerHTML=this.renderBody()||"&#160;";this.processRows(0,true);if(this.deferEmptyText!==true){this.applyEmptyText()}this.grid.fireEvent("viewready",this.grid)},afterRenderUI:function(){var a=this.grid;this.initElements();Ext.fly(this.innerHd).on("click",this.handleHdDown,this);this.mainHd.on({scope:this,mouseover:this.handleHdOver,mouseout:this.handleHdOut,mousemove:this.handleHdMove});this.scroller.on("scroll",this.syncScroll,this);if(a.enableColumnResize!==false){this.splitZone=new Ext.grid.GridView.SplitDragZone(a,this.mainHd.dom)}if(a.enableColumnMove){this.columnDrag=new Ext.grid.GridView.ColumnDragZone(a,this.innerHd);this.columnDrop=new Ext.grid.HeaderDropZone(a,this.mainHd.dom)}if(a.enableHdMenu!==false){this.hmenu=new Ext.menu.Menu({id:a.id+"-hctx"});this.hmenu.add({itemId:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},{itemId:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"});if(a.enableColumnHide!==false){this.colMenu=new Ext.menu.Menu({id:a.id+"-hcols-menu"});this.colMenu.on({scope:this,beforeshow:this.beforeColMenuShow,itemclick:this.handleHdMenuClick});this.hmenu.add({itemId:"sortSep",xtype:"menuseparator"},{itemId:"columns",hideOnClick:false,text:this.columnsText,menu:this.colMenu,iconCls:"x-cols-icon"})}this.hmenu.on("itemclick",this.handleHdMenuClick,this)}if(a.trackMouseOver){this.mainBody.on({scope:this,mouseover:this.onRowOver,mouseout:this.onRowOut})}if(a.enableDragDrop||a.enableDrag){this.dragZone=new Ext.grid.GridDragZone(a,{ddGroup:a.ddGroup||"GridDD"})}this.updateHeaderSortState()},renderUI:function(){var a=this.templates;return a.master.apply({body:a.body.apply({rows:"&#160;"}),header:this.renderHeaders(),ostyle:"width:"+this.getOffsetWidth()+";",bstyle:"width:"+this.getTotalWidth()+";"})},processEvent:function(b,h){var i=h.getTarget(),a=this.grid,d=this.findHeaderIndex(i),k,j,c,g;a.fireEvent(b,h);if(d!==false){a.fireEvent("header"+b,a,d,h)}else{k=this.findRowIndex(i);if(k!==false){j=this.findCellIndex(i);if(j!==false){c=a.colModel.getColumnAt(j);if(a.fireEvent("cell"+b,a,k,j,h)!==false){if(!c||(c.processEvent&&(c.processEvent(b,h,a,k,j)!==false))){a.fireEvent("row"+b,a,k,h)}}}else{if(a.fireEvent("row"+b,a,k,h)!==false){(g=this.findRowBody(i))&&a.fireEvent("rowbody"+b,a,k,h)}}}else{a.fireEvent("container"+b,a,h)}}},layout:function(j){if(!this.mainBody){return}var a=this.grid,d=a.getGridEl(),c=d.getSize(true),i=c.width,b=c.height,h=this.scroller,g,e,k;if(i<20||b<20){return}if(a.autoHeight){g=h.dom.style;g.overflow="visible";if(Ext.isWebKit){g.position="static"}}else{this.el.setSize(i,b);e=this.mainHd.getHeight();k=b-e;h.setSize(i,k);if(this.innerHd){this.innerHd.style.width=(i)+"px"}}if(this.forceFit||(j===true&&this.autoFill)){if(this.lastViewWidth!=i){this.fitColumns(false,false);this.lastViewWidth=i}}else{this.autoExpand();this.syncHeaderScroll()}this.onLayout(i,k)},onLayout:function(a,b){},onColumnWidthUpdated:function(c,a,b){},onAllColumnWidthsUpdated:function(a,b){},onColumnHiddenUpdated:function(b,c,a){},updateColumnText:function(a,b){},afterMove:function(a){},init:function(a){this.grid=a;this.initTemplates();this.initData(a.store,a.colModel);this.initUI(a)},getColumnId:function(a){return this.cm.getColumnId(a)},getOffsetWidth:function(){return(this.cm.getTotalWidth()+this.getScrollOffset())+"px"},getScrollOffset:function(){return Ext.num(this.scrollOffset,Ext.getScrollBarWidth())},renderHeaders:function(){var e=this.cm,g=this.templates,a=g.hcell,d={},h=e.getColumnCount(),j=h-1,k=[],c,b;for(c=0;c<h;c++){if(c==0){b="x-grid3-cell-first "}else{b=c==j?"x-grid3-cell-last ":""}d={id:e.getColumnId(c),value:e.getColumnHeader(c)||"",style:this.getColumnStyle(c,true),css:b,tooltip:this.getColumnTooltip(c)};if(e.config[c].align=="right"){d.istyle="padding-right: 16px;"}else{delete d.istyle}k[c]=a.apply(d)}return g.header.apply({cells:k.join(""),tstyle:String.format("width: {0};",this.getTotalWidth())})},getColumnTooltip:function(a){var b=this.cm.getColumnTooltip(a);if(b){if(Ext.QuickTips.isEnabled()){return'ext:qtip="'+b+'"'}else{return'title="'+b+'"'}}return""},beforeUpdate:function(){this.grid.stopEditing(true)},updateHeaders:function(){this.innerHd.firstChild.innerHTML=this.renderHeaders();this.updateHeaderWidth(false)},updateHeaderWidth:function(c){var b=this.innerHd.firstChild,a=this.getTotalWidth();b.style.width=this.getOffsetWidth();b.firstChild.style.width=a;if(c!==false){this.mainBody.dom.style.width=a}},focusRow:function(a){this.focusCell(a,0,false)},focusCell:function(d,b,c){this.syncFocusEl(this.ensureVisible(d,b,c));var a=this.focusEl;if(Ext.isGecko){a.focus()}else{a.focus.defer(1,a)}},resolveCell:function(h,d,g){if(!Ext.isNumber(h)){h=h.rowIndex}if(!this.ds){return null}if(h<0||h>=this.ds.getCount()){return null}d=(d!==undefined?d:0);var c=this.getRow(h),b=this.cm,e=b.getColumnCount(),a;if(!(g===false&&d===0)){while(d<e&&b.isHidden(d)){d++}a=this.getCell(h,d)}return{row:c,cell:a}},getResolvedXY:function(b){if(!b){return null}var a=b.cell,c=b.row;if(a){return Ext.fly(a).getXY()}else{return[this.el.getX(),Ext.fly(c).getY()]}},syncFocusEl:function(d,a,c){var b=d;if(!Ext.isArray(b)){d=Math.min(d,Math.max(0,this.getRows().length-1));if(isNaN(d)){return}b=this.getResolvedXY(this.resolveCell(d,a,c))}this.focusEl.setXY(b||this.scroller.getXY())},ensureVisible:function(t,g,e){var r=this.resolveCell(t,g,e);if(!r||!r.row){return null}var k=r.row,h=r.cell,n=this.scroller.dom,d=k,s=0,o=this.el.dom;while(d&&d!=o){s+=d.offsetTop;d=d.offsetParent}s-=this.mainHd.dom.offsetHeight;o=parseInt(n.scrollTop,10);var q=s+k.offsetHeight,a=n.clientHeight,m=o+a;if(s<o){n.scrollTop=s}else{if(q>m){n.scrollTop=q-a}}if(e!==false){var l=parseInt(h.offsetLeft,10),j=l+h.offsetWidth,i=parseInt(n.scrollLeft,10),b=i+n.clientWidth;if(l<i){n.scrollLeft=l}else{if(j>b){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.processRows(i);this.fireEvent("rowsinserted",this,i,e)}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(b,d){var a=this.cm,g=a.config,c=d?"":g[b].css||"",e=g[b].align;c+=String.format("width: {0};",this.getColumnWidth(b));if(a.isHidden(b)){c+="display: none; "}if(e){c+=String.format("text-align: {0};",e)}return c},getColumnWidth:function(b){var c=this.cm.getColumnWidth(b),a=this.borderWidth;if(Ext.isNumber(c)){if(Ext.isBorderBox){return c+"px"}else{return Math.max(c-a,0)+"px"}}else{return c}},getTotalWidth:function(){return this.cm.getTotalWidth()+"px"},fitColumns:function(g,j,h){var a=this.grid,l=this.cm,s=l.getTotalWidth(false),q=this.getGridInnerWidth(),r=q-s,c=[],o=0,n=0,u,d,p;if(q<20||r===0){return false}var e=l.getColumnCount(true),m=l.getColumnCount(false),b=e-(Ext.isNumber(h)?1:0);if(b===0){b=1;h=undefined}for(p=0;p<m;p++){if(!l.isFixed(p)&&p!==h){u=l.getColumnWidth(p);c.push(p,u);if(!l.isHidden(p)){o=p;n+=u}}}d=(q-l.getTotalWidth())/n;while(c.length){u=c.pop();p=c.pop();l.setColumnWidth(p,Math.max(a.minColumnWidth,Math.floor(u+u*d)),true)}s=l.getTotalWidth(false);if(s>q){var t=(b==e)?o:h,k=Math.max(1,l.getColumnWidth(t)-(s-q));l.setColumnWidth(t,k,true)}if(g!==true){this.updateAllColumnWidths()}return true},autoExpand:function(k){var a=this.grid,i=this.cm,e=this.getGridInnerWidth(),c=i.getTotalWidth(false),g=a.autoExpandColumn;if(!this.userResized&&g){if(e!=c){var j=i.getIndexById(g),b=i.getColumnWidth(j),h=e-c+b,d=Math.min(Math.max(h,a.autoExpandMin),a.autoExpandMax);if(b!=d){i.setColumnWidth(j,d,true);if(k!==true){this.updateColumnWidth(j,d)}}}}},getGridInnerWidth:function(){return this.grid.getGridEl().getWidth(true)-this.getScrollOffset()},getColumnData:function(){var e=[],c=this.cm,g=c.getColumnCount(),a=this.ds.fields,d,b;for(d=0;d<g;d++){b=c.getDataIndex(d);e[d]={name:Ext.isDefined(b)?b:(a.get(d)?a.get(d).name:undefined),renderer:c.getRenderer(d),scope:c.getRendererScope(d),id:c.getColumnId(d),style:this.getColumnStyle(d)}}return e},renderRows:function(i,c){var a=this.grid,g=a.store,j=a.stripeRows,e=a.colModel,h=e.getColumnCount(),d=g.getCount(),b;if(d<1){return""}i=i||0;c=Ext.isDefined(c)?c:d-1;b=g.getRange(i,c);return this.doRender(this.getColumnData(),b,g,i,h,j)},renderBody:function(){var a=this.renderRows()||"&#160;";return this.templates.body.apply({rows:a})},refreshRow:function(g){var l=this.ds,m=this.cm.getColumnCount(),c=this.getColumnData(),n=m-1,p=["x-grid3-row"],e={tstyle:String.format("width: {0};",this.getTotalWidth())},a=[],k=this.templates.cell,j,q,b,o,h,d;if(Ext.isNumber(g)){j=g;g=l.getAt(j)}else{j=l.indexOf(g)}if(!g||j<0){return}for(d=0;d<m;d++){b=c[d];if(d==0){h="x-grid3-cell-first"}else{h=(d==n)?"x-grid3-cell-last ":""}o={id:b.id,style:b.style,css:h,attr:"",cellAttr:""};o.value=b.renderer.call(b.scope,g.data[b.name],o,g,j,d,l);if(Ext.isEmpty(o.value)){o.value="&#160;"}if(this.markDirty&&g.dirty&&typeof g.modified[b.name]!="undefined"){o.css+=" x-grid3-dirty-cell"}a[d]=k.apply(o)}q=this.getRow(j);q.className="";if(this.grid.stripeRows&&((j+1)%2===0)){p.push("x-grid3-row-alt")}if(this.getRowClass){e.cols=m;p.push(this.getRowClass(g,j,e,l))}this.fly(q).addClass(p).setStyle(e.tstyle);e.cells=a.join("");q.innerHTML=this.templates.rowInner.apply(e);this.fireEvent("rowupdated",this,j,g)},refresh:function(b){this.fireEvent("beforerefresh",this);this.grid.stopEditing(true);var a=this.renderBody();this.mainBody.update(a).setWidth(this.getTotalWidth());if(b===true){this.updateHeaders();this.updateHeaderSortState()}this.processRows(0,true);this.layout();this.applyEmptyText();this.fireEvent("refresh",this)},applyEmptyText:function(){if(this.emptyText&&!this.hasRows()){this.mainBody.update('<div class="x-grid-empty">'+this.emptyText+"</div>")}},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(){var j=this,a=j.grid,d=a.getGridEl(),i=j.dragZone,g=j.splitZone,h=j.columnDrag,e=j.columnDrop,k=j.scrollToTopTask,c,b;if(k&&k.cancel){k.cancel()}Ext.destroyMembers(j,"colMenu","hmenu");j.initData(null,null);j.purgeListeners();Ext.fly(j.innerHd).un("click",j.handleHdDown,j);if(a.enableColumnMove){c=h.dragData;b=h.proxy;Ext.destroy(h.el,b.ghost,b.el,e.el,e.proxyTop,e.proxyBottom,c.ddel,c.header);if(b.anim){Ext.destroy(b.anim)}delete b.ghost;delete c.ddel;delete c.header;h.destroy();delete Ext.dd.DDM.locationCache[h.id];delete h._domRef;delete e.proxyTop;delete e.proxyBottom;e.destroy();delete Ext.dd.DDM.locationCache["gridHeader"+d.id];delete e._domRef;delete Ext.dd.DDM.ids[e.ddGroup]}if(g){g.destroy();delete g._domRef;delete Ext.dd.DDM.ids["gridSplitters"+d.id]}Ext.fly(j.innerHd).removeAllListeners();Ext.removeNode(j.innerHd);delete j.innerHd;Ext.destroy(j.el,j.mainWrap,j.mainHd,j.scroller,j.mainBody,j.focusEl,j.resizeMarker,j.resizeProxy,j.activeHdBtn,j._flyweight,i,g);delete a.container;if(i){i.destroy()}Ext.dd.DDM.currentTarget=null;delete Ext.dd.DDM.locationCache[d.id];Ext.EventManager.removeResizeListener(j.onWindowResize,j)},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.updateHeaderSortState()},this,{single:true})}}else{if(this.forceFit){this.fitColumns(true,false)}else{if(this.grid.autoExpandColumn){this.autoExpand(true)}}}this.grid.getGridEl().dom.innerHTML=this.renderUI();this.afterRenderUI()},initData:function(a,e){var b=this;if(b.ds){var d=b.ds;d.un("add",b.onAdd,b);d.un("load",b.onLoad,b);d.un("clear",b.onClear,b);d.un("remove",b.onRemove,b);d.un("update",b.onUpdate,b);d.un("datachanged",b.onDataChange,b);if(d!==a&&d.autoDestroy){d.destroy()}}if(a){a.on({scope:b,load:b.onLoad,add:b.onAdd,remove:b.onRemove,update:b.onUpdate,clear:b.onClear,datachanged:b.onDataChange})}if(b.cm){var c=b.cm;c.un("configchange",b.onColConfigChange,b);c.un("widthchange",b.onColWidthChange,b);c.un("headerchange",b.onHeaderChange,b);c.un("hiddenchange",b.onHiddenChange,b);c.un("columnmoved",b.onColumnMove,b)}if(e){delete b.lastViewWidth;e.on({scope:b,configchange:b.onColConfigChange,widthchange:b.onColWidthChange,headerchange:b.onHeaderChange,hiddenchange:b.onHiddenChange,columnmoved:b.onColumnMove})}b.ds=a;b.cm=e},onDataChange:function(){this.refresh(true);this.updateHeaderSortState();this.syncFocusEl(0)},onClear:function(){this.refresh();this.syncFocusEl(0)},onUpdate:function(b,a){this.refreshRow(a)},onAdd:function(b,a,c){this.insertRows(b,c,c+(a.length-1))},onRemove:function(b,a,c,d){if(d!==true){this.fireEvent("beforerowremoved",this,c,a)}this.removeRow(c);if(d!==true){this.processRows(c);this.applyEmptyText();this.fireEvent("rowremoved",this,c,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,c,b){this.indexMap=null;this.refresh(true);this.restoreScroll(this.getScrollState());this.afterMove(b);this.grid.fireEvent("columnmove",c,b)},onColConfigChange:function(){delete this.lastViewWidth;this.indexMap=null;this.refresh(true)},initUI:function(a){a.on("headerclick",this.onHeaderClick,this)},initEvents:Ext.emptyFn,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=this.findRowIndex(a);if(c!==false){this.addRowClass(c,this.rowOverCls)}},onRowOut:function(b,a){var c=this.findRowIndex(a);if(c!==false&&!b.within(this.getRow(c),true)){this.removeRowClass(c,this.rowOverCls)}},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")}},handleWheel:function(a){a.stopPropagation()},onColumnSplitterMoved:function(a,b){this.userResized=true;this.grid.colModel.setColumnWidth(a,b,true);if(this.forceFit){this.fitColumns(true,false,a);this.updateAllColumnWidths()}else{this.updateColumnWidth(a,b);this.syncHeaderScroll()}this.grid.fireEvent("columnresize",a,b)},beforeColMenuShow:function(){var b=this.cm,d=b.getColumnCount(),a=this.colMenu,c;a.removeAll();for(c=0;c<d;c++){if(b.config[c].hideable!==false){a.add(new Ext.menu.CheckItem({text:b.getColumnHeader(c),itemId:"col-"+b.getColumnId(c),checked:!b.isHidden(c),disabled:b.config[c].hideable===false,hideOnClick:false}))}}},handleHdMenuClick:function(c){var a=this.ds,b=this.cm.getDataIndex(this.hdCtxIndex);switch(c.getItemId()){case"asc":a.sort(b,"ASC");break;case"desc":a.sort(b,"DESC");break;default:this.handleHdMenuClickDefault(c)}return true},handleHdMenuClickDefault:function(c){var b=this.cm,d=c.getItemId(),a=b.getIndexById(d.substr(4));if(a!=-1){if(c.checked&&b.getColumnsBy(this.isHideableColumn,this).length<=1){this.onDenyColumnHide();return}b.setHidden(a,c.checked)}},handleHdDown:function(i,j){if(Ext.fly(j).hasClass("x-grid3-hd-btn")){i.stopEvent();var k=this.cm,g=this.findHeaderCell(j),h=this.getCellIndex(g),d=k.isSortable(h),c=this.hmenu,b=c.items,a=this.headerMenuOpenCls,l;this.hdCtxIndex=h;Ext.fly(g).addClass(a);if(this.hideSortIcons){b.get("asc").setVisible(d);b.get("desc").setVisible(d);l=b.get("sortSep");if(l){l.setVisible(d)}}else{b.get("asc").setDisabled(!d);b.get("desc").setDisabled(!d)}c.on("hide",function(){Ext.fly(g).removeClass(a)},this,{single:true});c.show(j,"tl-bl?")}},handleHdMove:function(k){var i=this.findHeaderCell(this.activeHdRef);if(i&&!this.headersDisabled){var l=this.splitHandleWidth||5,j=this.activeHdRegion,p=i.style,m=this.cm,o="",g=k.getPageX();if(this.grid.enableColumnResize!==false){var a=this.activeHdIndex,b=this.getPreviousVisible(a),n=m.isResizable(a),c=b&&m.isResizable(b),d=g-j.left<=l,h=j.right-g<=(!this.activeHdBtn?l:2);if(d&&c){o=Ext.isAir?"move":Ext.isWebKit?"e-resize":"col-resize"}else{if(h&&n){o=Ext.isAir?"move":Ext.isWebKit?"w-resize":"col-resize"}}}p.cursor=o}},getPreviousVisible:function(a){while(a>0){if(!this.cm.isHidden(a-1)){return a}a--}return undefined},handleHdOver:function(c,b){var d=this.findHeaderCell(b);if(d&&!this.headersDisabled){var a=this.fly(d);this.activeHdRef=b;this.activeHdIndex=this.getCellIndex(d);this.activeHdRegion=a.getRegion();if(!this.isMenuDisabled(this.activeHdIndex,a)){a.addClass("x-grid3-hd-over");this.activeHdBtn=a.child(".x-grid3-hd-btn");if(this.activeHdBtn){this.activeHdBtn.dom.style.height=(d.firstChild.offsetHeight-1)+"px"}}}},handleHdOut:function(b,a){var c=this.findHeaderCell(a);if(c&&(!Ext.isIE9m||!b.within(c,true))){this.activeHdRef=null;this.fly(c).removeClass("x-grid3-hd-over");c.style.cursor=""}},isMenuDisabled:function(a,b){return this.cm.isMenuDisabled(a)},hasRows:function(){var a=this.mainBody.dom.firstChild;return a&&a.nodeType==1&&a.className!="x-grid-empty"},isHideableColumn:function(a){return !a.hidden},bind:function(a,b){this.initData(a,b)}});Ext.grid.GridView.SplitDragZone=Ext.extend(Ext.dd.DDProxy,{constructor:function(a,b){this.grid=a;this.view=a.getView();this.marker=this.view.resizeMarker;this.proxy=this.view.resizeProxy;Ext.grid.GridView.SplitDragZone.superclass.constructor.call(this,b,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.scroll=false;this.hw=this.view.splitHandleWidth||5},b4StartDrag:function(a,e){this.dragHeadersDisabled=this.view.headersDisabled;this.view.headersDisabled=true;var d=this.view.mainWrap.getHeight();this.marker.setHeight(d);this.marker.show();this.marker.alignTo(this.view.getHeaderCell(this.cellIndex),"tl-tl",[-2,0]);this.proxy.setHeight(d);var b=this.cm.getColumnWidth(this.cellIndex),c=Math.max(b-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(c,1000);this.setYConstraint(0,0);this.minX=a-c;this.maxX=a+1000;this.startPos=a;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,a,e)},allowHeaderDrag:function(a){return true},handleMouseDown:function(a){var h=this.view.findHeaderCell(a.getTarget());if(h&&this.allowHeaderDrag(a)){var k=this.view.fly(h).getXY(),c=k[0],i=a.getXY(),b=i[0],g=h.offsetWidth,d=false;if((b-c)<=this.hw){d=-1}else{if((c+g)-b<=this.hw){d=0}}if(d!==false){this.cm=this.grid.colModel;var j=this.view.getCellIndex(h);if(d==-1){if(j+d<0){return}while(this.cm.isHidden(j+d)){--d;if(j+d<0){return}}}this.cellIndex=j+d;this.split=h.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(a)}}}},endDrag:function(g){this.marker.hide();var a=this.view,c=Math.max(this.minX,g.getPageX()),d=c-this.startPos,b=this.dragHeadersDisabled;a.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+d);setTimeout(function(){a.headersDisabled=b},50)},autoOffset:function(){this.setDelta(0,0)}});Ext.grid.PivotGridView=Ext.extend(Ext.grid.GridView,{colHeaderCellCls:"grid-hd-group-cell",title:"",getColumnHeaders:function(){return this.grid.topAxis.buildHeaders()},getRowHeaders:function(){return this.grid.leftAxis.buildHeaders()},renderRows:function(a,t){var b=this.grid,o=b.extractData(),p=o.length,g=this.templates,s=b.renderer,h=typeof s=="function",w=this.getCellCls,n=typeof w=="function",d=g.cell,x=g.row,k=[],q={},c="width:"+this.getGridInnerWidth()+"px;",l,r,e,v,m;a=a||0;t=Ext.isDefined(t)?t:p-1;for(v=0;v<p;v++){m=o[v];r=m.length;l=[];for(var u=0;u<r;u++){q.id=v+"-"+u;q.css=u===0?"x-grid3-cell-first ":(u==(r-1)?"x-grid3-cell-last ":"");q.attr=q.cellAttr="";q.value=m[u];if(Ext.isEmpty(q.value)){q.value="&#160;"}if(h){q.value=s(q.value)}if(n){q.css+=w(q.value)+" "}l[l.length]=d.apply(q)}k[k.length]=x.apply({tstyle:c,cols:r,cells:l.join(""),alt:""})}return k.join("")},masterTpl:new Ext.Template('<div class="x-grid3 x-pivotgrid" hidefocus="true">','<div class="x-grid3-viewport">','<div class="x-grid3-header">','<div class="x-grid3-header-title"><span>{title}</span></div>','<div class="x-grid3-header-inner">','<div class="x-grid3-header-offset" style="{ostyle}"></div>',"</div>",'<div class="x-clear"></div>',"</div>",'<div class="x-grid3-scroller">','<div class="x-grid3-row-headers"></div>','<div class="x-grid3-body" style="{bstyle}">{body}</div>','<a href="#" class="x-grid3-focus" tabIndex="-1"></a>',"</div>","</div>",'<div class="x-grid3-resize-marker">&#160;</div>','<div class="x-grid3-resize-proxy">&#160;</div>',"</div>"),initTemplates:function(){Ext.grid.PivotGridView.superclass.initTemplates.apply(this,arguments);var a=this.templates||{};if(!a.gcell){a.gcell=new Ext.XTemplate('<td class="x-grid3-hd x-grid3-gcell x-grid3-td-{id} ux-grid-hd-group-row-{row} '+this.colHeaderCellCls+'" style="{style}">','<div {tooltip} class="x-grid3-hd-inner x-grid3-hd-{id} x-unselectable" unselectable="on" style="{istyle}">',this.grid.enableHdMenu?'<a class="x-grid3-hd-btn" href="#"></a>':"","{value}","</div>","</td>")}this.templates=a;this.hrowRe=new RegExp("ux-grid-hd-group-row-(\\d+)","")},initElements:function(){Ext.grid.PivotGridView.superclass.initElements.apply(this,arguments);this.rowHeadersEl=new Ext.Element(this.scroller.child("div.x-grid3-row-headers"));this.headerTitleEl=new Ext.Element(this.mainHd.child("div.x-grid3-header-title"))},getGridInnerWidth:function(){var a=Ext.grid.PivotGridView.superclass.getGridInnerWidth.apply(this,arguments);return a-this.getTotalRowHeaderWidth()},getTotalRowHeaderWidth:function(){var d=this.getRowHeaders(),c=d.length,b=0,a;for(a=0;a<c;a++){b+=d[a].width}return b},getTotalColumnHeaderHeight:function(){return this.getColumnHeaders().length*21},getCellIndex:function(b){if(b){var a=b.className.match(this.colRe),c;if(a&&(c=a[1])){return parseInt(c.split("-")[1],10)}}return false},renderUI:function(){var b=this.templates,a=this.getGridInnerWidth();return b.master.apply({body:b.body.apply({rows:"&#160;"}),ostyle:"width:"+a+"px",bstyle:"width:"+a+"px"})},onLayout:function(b,a){Ext.grid.PivotGridView.superclass.onLayout.apply(this,arguments);var b=this.getGridInnerWidth();this.resizeColumnHeaders(b);this.resizeAllRows(b)},refresh:function(b){this.fireEvent("beforerefresh",this);this.grid.stopEditing(true);var a=this.renderBody();this.mainBody.update(a).setWidth(this.getGridInnerWidth());if(b===true){this.updateHeaders();this.updateHeaderSortState()}this.processRows(0,true);this.layout();this.applyEmptyText();this.fireEvent("refresh",this)},renderHeaders:Ext.emptyFn,fitColumns:Ext.emptyFn,resizeColumnHeaders:function(b){var a=this.grid.topAxis;if(a.rendered){a.el.setWidth(b)}},resizeRowHeaders:function(){var a=this.getTotalRowHeaderWidth(),b=String.format("margin-left: {0}px;",a);this.rowHeadersEl.setWidth(a);this.mainBody.applyStyles(b);Ext.fly(this.innerHd).applyStyles(b);this.headerTitleEl.setWidth(a);this.headerTitleEl.setHeight(this.getTotalColumnHeaderHeight())},resizeAllRows:function(b){var d=this.getRows(),c=d.length,a;for(a=0;a<c;a++){Ext.fly(d[a]).setWidth(b);Ext.fly(d[a]).child("table").setWidth(b)}},updateHeaders:function(){this.renderGroupRowHeaders();this.renderGroupColumnHeaders()},renderGroupRowHeaders:function(){var a=this.grid.leftAxis;this.resizeRowHeaders();a.rendered=false;a.render(this.rowHeadersEl);this.setTitle(this.title)},setTitle:function(a){this.headerTitleEl.child("span").dom.innerHTML=a},renderGroupColumnHeaders:function(){var a=this.grid.topAxis;a.rendered=false;a.render(this.innerHd.firstChild)},isMenuDisabled:function(a,b){return true}});Ext.grid.PivotAxis=Ext.extend(Ext.Component,{orientation:"horizontal",defaultHeaderWidth:80,paddingWidth:7,setDimensions:function(a){this.dimensions=a},onRender:function(b,a){var c=this.orientation=="horizontal"?this.renderHorizontalRows():this.renderVerticalRows();this.el=Ext.DomHelper.overwrite(b.dom,{tag:"table",cn:c},true)},renderHorizontalRows:function(){var k=this.buildHeaders(),a=k.length,g=[],c,h,e,d,b;for(d=0;d<a;d++){c=[];h=k[d].items;e=h.length;for(b=0;b<e;b++){c.push({tag:"td",html:h[b].header,colspan:h[b].span})}g[d]={tag:"tr",cn:c}}return g},renderVerticalRows:function(){var b=this.buildHeaders(),k=b.length,a=[],m=[],h,c,l,g,e,d;for(e=0;e<k;e++){c=b[e];g=c.width||80;h=c.items.length;for(d=0;d<h;d++){l=c.items[d];a[l.start]=a[l.start]||[];a[l.start].push({tag:"td",html:l.header,rowspan:l.span,width:Ext.isBorderBox?g:g-this.paddingWidth})}}h=a.length;for(e=0;e<h;e++){m[e]={tag:"tr",cn:a[e]}}return m},getTuples:function(){var b=new Ext.data.Store({});b.data=this.store.data.clone();b.fields=this.store.fields;var l=[],a=this.dimensions,c=a.length,j;for(j=0;j<c;j++){l.push({field:a[j].dataIndex,direction:a[j].direction||"ASC"})}b.sort(l);var e=b.data.items,n=[],k=[],o,h,d,g,m;c=e.length;for(j=0;j<c;j++){d=this.getRecordInfo(e[j]);g=d.data;h="";for(m in g){h+=g[m]+"---"}if(n.indexOf(h)==-1){n.push(h);k.push(d)}}b.destroy();return k},getRecordInfo:function(a){var e=this.dimensions,d=e.length,h={},j,c,b;for(b=0;b<d;b++){j=e[b];c=j.dataIndex;h[c]=a.get(c)}var g=function(i){return function(k){for(var l in i){if(k.get(l)!=i[l]){return false}}return true}};return{data:h,matcher:g(h)}},buildHeaders:function(){var l=this.getTuples(),m=l.length,a=this.dimensions,e,r=a.length,c=[],o,s,n,q,p,b,k,h,g,d;for(g=0;g<r;g++){e=a[g];s=[];p=0;b=0;for(d=0;d<m;d++){o=l[d];k=d==(m-1);n=o.data[e.dataIndex];h=q!=undefined&&q!=n;if(g>0&&d>0){h=h||o.data[a[g-1].dataIndex]!=l[d-1].data[a[g-1].dataIndex]}if(h){s.push({header:q,span:p,start:b});b+=p;p=0}if(k){s.push({header:n,span:p+1,start:b});b+=p;p=0}q=n;p++}c.push({items:s,width:e.width||this.defaultHeaderWidth});q=undefined}return c}});Ext.grid.HeaderDragZone=Ext.extend(Ext.dd.DragZone,{maxDragWidth:120,constructor:function(a,c,b){this.grid=a;this.view=a.getView();this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDragZone.superclass.constructor.call(this,c);if(b){this.setHandleElId(Ext.id(c));this.setOuterHandleElId(Ext.id(b))}this.scroll=false},getDragData:function(c){var a=Ext.lib.Event.getTarget(c),b=this.view.findHeaderCell(a);if(b){return{ddel:b.firstChild,header:b}}return false},onInitDrag:function(a){this.dragHeadersDisabled=this.view.headersDisabled;this.view.headersDisabled=true;var b=this.dragData.ddel.cloneNode(true);b.id=Ext.id();b.style.width=Math.min(this.dragData.header.offsetWidth,this.maxDragWidth)+"px";this.proxy.update(b);return true},afterValidDrop:function(){this.completeDrop()},afterInvalidDrop:function(){this.completeDrop()},completeDrop:function(){var a=this.view,b=this.dragHeadersDisabled;setTimeout(function(){a.headersDisabled=b},50)}});Ext.grid.HeaderDropZone=Ext.extend(Ext.dd.DropZone,{proxyOffsets:[-4,-9],fly:Ext.Element.fly,constructor:function(a,c,b){this.grid=a;this.view=a.getView();this.proxyTop=Ext.DomHelper.append(document.body,{cls:"col-move-top",html:"&#160;"},true);this.proxyBottom=Ext.DomHelper.append(document.body,{cls:"col-move-bottom",html:"&#160;"},true);this.proxyTop.hide=this.proxyBottom.hide=function(){this.setLeftTop(-100,-100);this.setStyle("visibility","hidden")};this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDropZone.superclass.constructor.call(this,a.getGridEl().dom)},getTargetFromEvent:function(c){var a=Ext.lib.Event.getTarget(c),b=this.view.findCellIndex(a);if(b!==false){return this.view.getHeaderCell(b)}},nextVisible:function(c){var b=this.view,a=this.grid.colModel;c=c.nextSibling;while(c){if(!a.isHidden(b.getCellIndex(c))){return c}c=c.nextSibling}return null},prevVisible:function(c){var b=this.view,a=this.grid.colModel;c=c.prevSibling;while(c){if(!a.isHidden(b.getCellIndex(c))){return c}c=c.prevSibling}return null},positionIndicator:function(d,k,j){var a=Ext.lib.Event.getPageX(j),g=Ext.lib.Dom.getRegion(k.firstChild),c,i,b=g.top+this.proxyOffsets[1];if((g.right-a)<=(g.right-g.left)/2){c=g.right+this.view.borderWidth;i="after"}else{c=g.left;i="before"}if(this.grid.colModel.isFixed(this.view.getCellIndex(k))){return false}c+=this.proxyOffsets[0];this.proxyTop.setLeftTop(c,b);this.proxyTop.show();if(!this.bottomOffset){this.bottomOffset=this.view.mainHd.getHeight()}this.proxyBottom.setLeftTop(c,b+this.proxyTop.dom.offsetHeight+this.bottomOffset);this.proxyBottom.show();return i},onNodeEnter:function(d,a,c,b){if(b.header!=d){this.positionIndicator(b.header,d,c)}},onNodeOver:function(g,b,d,c){var a=false;if(c.header!=g){a=this.positionIndicator(c.header,g,d)}if(!a){this.proxyTop.hide();this.proxyBottom.hide()}return a?this.dropAllowed:this.dropNotAllowed},onNodeOut:function(d,a,c,b){this.proxyTop.hide();this.proxyBottom.hide()},onNodeDrop:function(b,m,g,c){var d=c.header;if(d!=b){var k=this.grid.colModel,j=Ext.lib.Event.getPageX(g),a=Ext.lib.Dom.getRegion(b.firstChild),o=(a.right-j)<=((a.right-a.left)/2)?"after":"before",i=this.view.getCellIndex(d),l=this.view.getCellIndex(b);if(o=="after"){l++}if(i<l){l--}k.moveColumn(i,l);return true}return false}});Ext.grid.GridView.ColumnDragZone=Ext.extend(Ext.grid.HeaderDragZone,{constructor:function(a,b){Ext.grid.GridView.ColumnDragZone.superclass.constructor.call(this,a,b,null);this.proxy.el.addClass("x-grid3-col-dd")},handleMouseDown:function(a){},callHandleMouseDown:function(a){Ext.grid.GridView.ColumnDragZone.superclass.handleMouseDown.call(this,a)}});Ext.grid.SplitDragZone=Ext.extend(Ext.dd.DDProxy,{fly:Ext.Element.fly,constructor:function(a,c,b){this.grid=a;this.view=a.getView();this.proxy=this.view.resizeProxy;Ext.grid.SplitDragZone.superclass.constructor.call(this,c,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.setHandleElId(Ext.id(c));this.setOuterHandleElId(Ext.id(b));this.scroll=false},b4StartDrag:function(a,d){this.view.headersDisabled=true;this.proxy.setHeight(this.view.mainWrap.getHeight());var b=this.cm.getColumnWidth(this.cellIndex);var c=Math.max(b-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(c,1000);this.setYConstraint(0,0);this.minX=a-c;this.maxX=a+1000;this.startPos=a;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,a,d)},handleMouseDown:function(c){var b=Ext.EventObject.setEvent(c);var a=this.fly(b.getTarget());if(a.hasClass("x-grid-split")){this.cellIndex=this.view.getCellIndex(a.dom);this.split=a.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(c){this.view.headersDisabled=false;var a=Math.max(this.minX,Ext.lib.Event.getPageX(c));var b=a-this.startPos;this.view.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+b)},autoOffset:function(){this.setDelta(0,0)}});Ext.grid.GridDragZone=function(b,a){this.view=b.getView();Ext.grid.GridDragZone.superclass.constructor.call(this,this.view.mainBody.dom,a);this.scroll=false;this.grid=b;this.ddel=document.createElement("div");this.ddel.className="x-grid-dd-wrap";this.preventDefault=true};Ext.extend(Ext.grid.GridDragZone,Ext.dd.DragZone,{ddGroup:"GridDD",getDragData:function(g){var c=Ext.lib.Event.getTarget(g),i,h=this.view.findRowIndex(c),b,a,d;if(h!==false){i=this.grid.selModel;if(i.getSelectedCell){b=this.view.findCellIndex(c);a=i.getSelectedCell();if(!a||a[0]!==h||a[1]!==b){i.handleMouseDown(this.grid,h,b,g)}if(this.grid.dragCell){d=i.getSelectedCell();if(!this.grid.hasOwnProperty("ddText")){this.grid.ddText="{0} selected cell{1}"}}else{d=[this.grid.store.getAt(h)]}}else{if(!i.isSelected(h)||g.hasModifier()){i.handleMouseDown(this.grid,h,g)}d=i.getSelections()}return{grid:this.grid,ddel:this.ddel,rowIndex:h,selections:d}}return false},onInitDrag:function(b){var a=this.dragData;this.ddel.innerHTML=this.grid.getDragDropText();this.proxy.update(this.ddel)},afterRepair:function(){this.dragging=false},getRepairXY:function(b,a){return false},onEndDrag:function(a,b){},onValidDrop:function(a,b,c){this.hideProxy()},beforeInvalidDrop:function(a,b){}});Ext.grid.ColumnModel=Ext.extend(Ext.util.Observable,{defaultWidth:100,defaultSortable:false,constructor:function(a){if(a.columns){Ext.apply(this,a);this.setConfig(a.columns,true)}else{this.setConfig(a,true)}this.addEvents("widthchange","headerchange","hiddenchange","columnmoved","configchange");Ext.grid.ColumnModel.superclass.constructor.call(this)},getColumnId:function(a){return this.config[a].id},getColumnAt:function(a){return this.config[a]},setConfig:function(d,b){var e,h,a;if(!b){delete this.totalWidth;for(e=0,a=this.config.length;e<a;e++){h=this.config[e];if(h.setEditor){h.setEditor(null)}}}this.defaults=Ext.apply({width:this.defaultWidth,sortable:this.defaultSortable},this.defaults);this.config=d;this.lookup={};for(e=0,a=d.length;e<a;e++){h=Ext.applyIf(d[e],this.defaults);if(Ext.isEmpty(h.id)){h.id=e}if(!h.isColumn){var g=Ext.grid.Column.types[h.xtype||"gridcolumn"];h=new g(h);d[e]=h}this.lookup[h.id]=h}if(!b){this.fireEvent("configchange",this)}},getColumnById:function(a){return this.lookup[a]},getIndexById:function(c){for(var b=0,a=this.config.length;b<a;b++){if(this.config[b].id==c){return b}}return -1},moveColumn:function(e,b){var a=this.config,d=a[e];a.splice(e,1);a.splice(b,0,d);this.dataMap=null;this.fireEvent("columnmoved",this,e,b)},getColumnCount:function(b){var d=this.config.length,e=0,a;if(b===true){for(a=0;a<d;a++){if(!this.isHidden(a)){e++}}return e}return d},getColumnsBy:function(g,e){var b=this.config,h=b.length,a=[],d,j;for(d=0;d<h;d++){j=b[d];if(g.call(e||this,j,d)===true){a[a.length]=j}}return a},isSortable:function(a){return !!this.config[a].sortable},isMenuDisabled:function(a){return !!this.config[a].menuDisabled},getRenderer:function(a){return this.config[a].renderer||Ext.grid.ColumnModel.defaultRenderer},getRendererScope:function(a){return this.config[a].scope},setRenderer:function(a,b){this.config[a].renderer=b},getColumnWidth:function(a){var b=this.config[a].width;if(typeof b!="number"){b=this.defaultWidth}return b},setColumnWidth:function(b,c,a){this.config[b].width=c;this.totalWidth=null;if(!a){this.fireEvent("widthchange",this,b,c)}},getTotalWidth:function(b){if(!this.totalWidth){this.totalWidth=0;for(var c=0,a=this.config.length;c<a;c++){if(b||!this.isHidden(c)){this.totalWidth+=this.getColumnWidth(c)}}}return this.totalWidth},getColumnHeader:function(a){return this.config[a].header},setColumnHeader:function(a,b){this.config[a].header=b;this.fireEvent("headerchange",this,a,b)},getColumnTooltip:function(a){return this.config[a].tooltip},setColumnTooltip:function(a,b){this.config[a].tooltip=b},getDataIndex:function(a){return this.config[a].dataIndex},setDataIndex:function(a,b){this.config[a].dataIndex=b},findColumnIndex:function(d){var e=this.config;for(var b=0,a=e.length;b<a;b++){if(e[b].dataIndex==d){return b}}return -1},isCellEditable:function(b,e){var d=this.config[b],a=d.editable;return !!(a||(!Ext.isDefined(a)&&d.editor))},getCellEditor:function(a,b){return this.config[a].getCellEditor(b)},setEditable:function(a,b){this.config[a].editable=b},isHidden:function(a){return !!this.config[a].hidden},isFixed:function(a){return !!this.config[a].fixed},isResizable:function(a){return a>=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 b=this.config.length,a=0;for(;a<b;a++){this.config[a].destroy()}delete this.config;delete this.lookup;this.purgeListeners()},setState:function(a,b){b=Ext.applyIf(b,this.defaults);Ext.apply(this.config[a],b)}});Ext.grid.ColumnModel.defaultRenderer=function(a){if(typeof a=="string"&&a.length<1){return"&#160;"}return a};Ext.grid.AbstractSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(){this.locked=false;Ext.grid.AbstractSelectionModel.superclass.constructor.call(this)},init:function(a){this.grid=a;if(this.lockOnInit){delete this.lockOnInit;this.locked=false;this.lock()}this.initEvents()},lock:function(){if(!this.locked){this.locked=true;var a=this.grid;if(a){a.getView().on({scope:this,beforerefresh:this.sortUnLock,refresh:this.sortLock})}else{this.lockOnInit=true}}},sortLock:function(){this.locked=true},sortUnLock:function(){this.locked=false},unlock:function(){if(this.locked){this.locked=false;var a=this.grid,b;if(a){b=a.getView();b.un("beforerefresh",this.sortUnLock,this);b.un("refresh",this.sortLock,this)}else{delete this.lockOnInit}}},isLocked:function(){return this.locked},destroy:function(){this.unlock();this.purgeListeners()}});Ext.grid.RowSelectionModel=Ext.extend(Ext.grid.AbstractSelectionModel,{singleSelect:false,constructor:function(a){Ext.apply(this,a);this.selections=new Ext.util.MixedCollection(false,function(b){return b.id});this.last=false;this.lastActive=false;this.addEvents("selectionchange","beforerowselect","rowselect","rowdeselect");Ext.grid.RowSelectionModel.superclass.constructor.call(this)},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:this.onKeyPress,down:this.onKeyPress,scope:this});this.grid.getView().on({scope:this,refresh:this.onRefresh,rowupdated:this.onRowUpdated,rowremoved:this.onRemove})},onKeyPress:function(g,b){var a=b=="up",h=a?"selectPrevious":"selectNext",d=a?-1:1,c;if(!g.shiftKey||this.singleSelect){this[h](false)}else{if(this.last!==false&&this.lastActive!==false){c=this.last;this.selectRange(this.last,this.lastActive+d);this.grid.getView().focusRow(this.lastActive);if(c!==false){this.last=c}}else{this.selectFirstRow()}}},onRefresh:function(){var g=this.grid.store,d=this.getSelections(),c=0,a=d.length,b,e;this.silent=true;this.clearSelections(true);for(;c<a;c++){e=d[c];if((b=g.indexOfId(e.id))!=-1){this.selectRow(b,true)}}if(d.length!=this.selections.getCount()){this.fireEvent("selectionchange",this)}this.silent=false},onRemove:function(a,b,c){if(this.selections.remove(c)!==false){this.fireEvent("selectionchange",this)}},onRowUpdated:function(a,b,c){if(this.isSelected(c)){a.onRowSelect(b)}},selectRecords:function(b,e){if(!e){this.clearSelections()}var d=this.grid.store,c=0,a=b.length;for(;c<a;c++){this.selectRow(d.indexOf(b[c]),true)}},getCount:function(){return this.selections.length},selectFirstRow:function(){this.selectRow(0)},selectLastRow:function(a){this.selectRow(this.grid.store.getCount()-1,a)},selectNext:function(a){if(this.hasNext()){this.selectRow(this.last+1,a);this.grid.getView().focusRow(this.last);return true}return false},selectPrevious:function(a){if(this.hasPrevious()){this.selectRow(this.last-1,a);this.grid.getView().focusRow(this.last);return true}return false},hasNext:function(){return this.last!==false&&(this.last+1)<this.grid.store.getCount()},hasPrevious:function(){return !!this.last},getSelections:function(){return[].concat(this.selections.items)},getSelected:function(){return this.selections.itemAt(0)},each:function(e,d){var c=this.getSelections(),b=0,a=c.length;for(;b<a;b++){if(e.call(d||this,c[b],b)===false){return false}}return true},clearSelections:function(a){if(this.isLocked()){return}if(a!==true){var c=this.grid.store,b=this.selections;b.each(function(d){this.deselectRow(c.indexOfId(d.id))},this);b.clear()}else{this.selections.clear()}this.last=false},selectAll:function(){if(this.isLocked()){return}this.selections.clear();for(var b=0,a=this.grid.store.getCount();b<a;b++){this.selectRow(b,true)}},hasSelection:function(){return this.selections.length>0},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;b++){this.selectRow(c[b],true)}},selectRange:function(b,a,d){var c;if(this.isLocked()){return}if(!d){this.clearSelections()}if(b<=a){for(c=b;c<=a;c++){this.selectRow(c,true)}}else{for(c=b;c>=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)}if(!this.silent){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)}},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,p=i.lastEdit,j=i.activeEditor,b=l.shiftKey,o,p,a,m;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(p.row-1,p.col,-1,this.acceptsNav,this)}else{h=i.walkCells(p.row+1,p.col,1,this.acceptsNav,this)}}}}if(h){a=h[0];m=h[1];this.onEditorSelect(a,p.row);if(i.isEditor&&i.editing){o=i.activeEditor;if(o&&o.field.triggerBlur){o.field.triggerBlur()}}i.startEditing(a,m)}},onEditorSelect:function(b,a){if(a!=b){this.selectRow(b)}},destroy:function(){Ext.destroy(this.rowNav);this.rowNav=null;Ext.grid.RowSelectionModel.superclass.destroy.call(this)}});Ext.grid.Column=Ext.extend(Ext.util.Observable,{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);this.addEvents("click","contextmenu","dblclick","mousedown");Ext.grid.Column.superclass.constructor.call(this)},processEvent:function(b,d,c,g,a){return this.fireEvent(b,this,c,g,d)},destroy:function(){if(this.setEditor){this.setEditor(null)}this.purgeListeners()},renderer:function(a){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:"&#160;",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.ActionColumn=Ext.extend(Ext.grid.Column,{header:"&#160;",actionIdRe:/x-action-col-(\d+)/,altText:"",constructor:function(b){var g=this,c=b.items||(g.items=[g]),a=c.length,d,e;Ext.grid.ActionColumn.superclass.constructor.call(g,b);g.renderer=function(h,i){h=Ext.isFunction(b.renderer)?b.renderer.apply(this,arguments)||"":"";i.css+=" x-action-col-cell";for(d=0;d<a;d++){e=c[d];h+='<img alt="'+(e.altText||g.altText)+'" src="'+(e.icon||Ext.BLANK_IMAGE_URL)+'" class="x-action-col-icon x-action-col-'+String(d)+" "+(e.iconCls||"")+" "+(Ext.isFunction(e.getClass)?e.getClass.apply(e.scope||this.scope||this,arguments):"")+'"'+((e.tooltip)?' ext:qtip="'+e.tooltip+'"':"")+" />"}return h}},destroy:function(){delete this.items;delete this.renderer;return Ext.grid.ActionColumn.superclass.destroy.apply(this,arguments)},processEvent:function(c,i,d,j,b){var a=i.getTarget().className.match(this.actionIdRe),h,g;if(a&&(h=this.items[parseInt(a[1],10)])){if(c=="click"){(g=h.handler||this.handler)&&g.call(h.scope||this.scope||this,d,j,b,h,i)}else{if((c=="mousedown")&&(h.stopSelection!==false)){return false}}}return Ext.grid.ActionColumn.superclass.processEvent.apply(this,arguments)}});Ext.grid.Column.types={gridcolumn:Ext.grid.Column,booleancolumn:Ext.grid.BooleanColumn,numbercolumn:Ext.grid.NumberColumn,datecolumn:Ext.grid.DateColumn,templatecolumn:Ext.grid.TemplateColumn,actioncolumn:Ext.grid.ActionColumn};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:'<div class="x-grid3-hd-checker">&#160;</div>',width:20,sortable:false,menuDisabled:true,fixed:true,hideable:false,dataIndex:"",id:"checker",isColumn:true,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(){Ext.fly(this.grid.getView().innerHd).on("mousedown",this.onHdMouseDown,this)},this)},processEvent:function(b,d,c,g,a){if(b=="mousedown"){this.onMouseDown(d,d.getTarget());return false}else{return Ext.grid.Column.prototype.processEvent.apply(this,arguments)}},onMouseDown:function(c,b){if(c.button===0&&b.className=="x-grid3-row-checker"){c.stopEvent();var d=c.getTarget(".x-grid3-row");if(d){var a=d.rowIndex;if(this.isSelected(a)){this.deselectRow(a)}else{this.selectRow(a,true);this.grid.getView().focusRow(a)}}}},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'<div class="x-grid3-row-checker">&#160;</div>'},onEditorSelect:function(b,a){if(a!=b&&!this.checkOnly){this.selectRow(b)}}});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.getKeyEvent(),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;if(b.field.isXType("checkbox")){b.allowBlur=false;this.setupCheckbox(b.field)}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)}}},setupCheckbox:function(c){var b=this,a=function(){c.el.on("click",b.onCheckClick,b,{single:true})};if(c.rendered){a()}else{c.on("render",a,null,{single:true})}},onCheckClick:function(){var a=this.activeEditor;a.allowBlur=true;a.field.focus(false,10)},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);this.destroyEditors(this.editors);this.destroyEditors(this.grid.customEditors)},destroyEditors:function(b){for(var a in b){Ext.destroy(b[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",cancelEditOnToggle:true,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('<div id="{groupId}" class="x-grid-group {cls}">','<div id="{groupId}-hd" class="x-grid-group-hd" style="{style}"><div class="x-grid-group-title">',this.groupTextTpl,"</div></div>",'<div id="{groupId}-bd" class="x-grid-group-body">')}this.startGroup.compile();if(!this.endGroup){this.endGroup="</div></div>"}},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.canGroup(),true)}},renderUI:function(){var a=Ext.grid.GroupingView.superclass.renderUI.call(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)}return a},processEvent:function(b,i){Ext.grid.GroupingView.superclass.processEvent.call(this,b,i);var h=i.getTarget(".x-grid-group-hd",this.mainBody);if(h){var g=this.getGroupField(),d=this.getPrefix(g),a=h.id.substring(d.length),c=new RegExp("gp-"+Ext.escapeRe(g)+"--hd");a=a.substr(0,a.length-3);if(a||c.test(h.id)){this.grid.fireEvent("group"+b,this.grid,g,a,i)}if(b=="mousedown"&&i.button==0){this.toggleGroup(h.parentNode)}}},onGroupByClick:function(){var a=this.grid;this.enableGrouping=true;a.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));a.fireEvent("groupchange",a,a.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),d=Ext.util.Format.htmlEncode(a.id);b=Ext.isDefined(b)?b:a.hasClass("x-grid-group-collapsed");if(this.state[d]!==b){if(this.cancelEditOnToggle!==false){this.grid.stopEditing(true)}this.state[d]=b;a[b?"removeClass":"addClass"]("x-grid-group-collapsed")}},toggleAllGroups:function(c){var b=this.getGroups();for(var d=0,a=b.length;d<a;d++){this.toggleGroup(b[d],c)}},expandAllGroups:function(){this.toggleAllGroups(true)},collapseAllGroups:function(){this.toggleAllGroups(false)},getGroup:function(a,e,i,j,b,h){var c=this.cm.config[b],d=i?i.call(c.scope,a,{},e,j,b,h):String(a);if(d===""||d==="&#160;"){d=c.emptyGroupText||this.emptyGroupText}return d},getGroupField:function(){return this.grid.store.getGroupState()},afterRender:function(){if(!this.ds||!this.cm){return}Ext.grid.GroupingView.superclass.afterRender.call(this);if(this.grid.deferRowRender){this.updateGroupWidths()}},afterRenderUI:function(){Ext.grid.GroupingView.superclass.afterRenderUI.call(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)}},renderRows:function(){var a=this.getGroupField();var e=!!a;if(this.hideGroupedColumn){var b=this.cm.findColumnIndex(a),d=Ext.isDefined(this.lastGroupField);if(!e&&d){this.mainBody.update("");this.cm.setHidden(this.cm.findColumnIndex(this.lastGroupField),false);delete this.lastGroupField}else{if(e&&!d){this.lastGroupField=a;this.cm.setHidden(b,true)}else{if(e&&d&&a!==this.lastGroupField){this.mainBody.update("");var c=this.cm.findColumnIndex(this.lastGroupField);this.cm.setHidden(c,false);this.lastGroupField=a;this.cm.setHidden(b,true)}}}}return Ext.grid.GroupingView.superclass.renderRows.apply(this,arguments)},doRender:function(c,h,q,a,p,s){if(h.length<1){return""}if(!this.canGroup()||this.isUpdating){return Ext.grid.GroupingView.superclass.doRender.apply(this,arguments)}var z=this.getGroupField(),o=this.cm.findColumnIndex(z),w,j="width:"+this.getTotalWidth()+";",e=this.cm.config[o],b=e.groupRenderer||e.renderer,t=this.showGroupName?(e.groupName||e.header)+": ":"",y=[],l,u,v,n;for(u=0,v=h.length;u<v;u++){var k=a+u,m=h[u],d=m.data[z];w=this.getGroup(d,m,b,k,o,q);if(!l||l.group!=w){n=this.constructId(d,z,o);this.state[n]=!(Ext.isDefined(this.state[n])?!this.state[n]:this.startCollapsed);l={group:w,gvalue:d,text:t+w,groupId:n,startRow:k,rs:[m],cls:this.state[n]?"":"x-grid-group-collapsed",style:j};y.push(l)}else{l.rs.push(m)}m._groupId=n}var x=[];for(u=0,v=y.length;u<v;u++){w=y[u];this.doGroupStart(x,w,c,q,p);x[x.length]=Ext.grid.GroupingView.superclass.doRender.call(this,c,w.rs,q,w.startRow,p,s);this.doGroupEnd(x,w,c,q,p)}return x.join("")},getGroupId:function(a){var b=this.getGroupField();return this.constructId(a,b,this.cm.findColumnIndex(b))},constructId:function(c,e,a){var b=this.cm.config[a],d=b.groupRenderer||b.renderer,g=(this.groupMode=="value")?c:this.getGroup(c,{data:{}},d,0,a,this.ds);return this.getPrefix(e)+Ext.util.Format.htmlEncode(g)},canGroup:function(){return this.enableGrouping&&!!this.getGroupField()},getPrefix:function(a){return this.grid.getGridEl().id+"-gp-"+a+"-"},doGroupStart:function(a,d,b,e,c){a[a.length]=this.startGroup.apply(d)},doGroupEnd:function(a,d,b,e,c){a[a.length]=this.endGroup},getRows:function(){if(!this.canGroup()){return Ext.grid.GroupingView.superclass.getRows.call(this)}var k=[],c=this.getGroups(),h,e=0,a=c.length,d,b;for(;e<a;++e){h=c[e].childNodes[1];if(h){h=h.childNodes;for(d=0,b=h.length;d<b;++d){k[k.length]=h[d]}}}return k},updateGroupWidths:function(){if(!this.canGroup()||!this.hasRows()){return}var c=Math.max(this.cm.getTotalWidth(),this.el.dom.offsetWidth-this.getScrollOffset())+"px";var b=this.getGroups();for(var d=0,a=b.length;d<a;d++){b[d].firstChild.style.width=c}},onColumnWidthUpdated:function(c,a,b){Ext.grid.GroupingView.superclass.onColumnWidthUpdated.call(this,c,a,b);this.updateGroupWidths()},onAllColumnWidthsUpdated:function(a,b){Ext.grid.GroupingView.superclass.onAllColumnWidthsUpdated.call(this,a,b);this.updateGroupWidths()},onColumnHiddenUpdated:function(b,c,a){Ext.grid.GroupingView.superclass.onColumnHiddenUpdated.call(this,b,c,a);this.updateGroupWidths()},onLayout:function(){this.updateGroupWidths()},onBeforeRowSelect:function(b,a){this.toggleRowIndex(a,true)}});Ext.grid.GroupingView.GROUP_ID=1000; \ No newline at end of file
diff --git a/deluge/ui/web/js/extjs/ext-base-debug.js b/deluge/ui/web/js/extjs/ext-base-debug.js
index 38c7228d0..7b209343d 100644
--- a/deluge/ui/web/js/extjs/ext-base-debug.js
+++ b/deluge/ui/web/js/extjs/ext-base-debug.js
@@ -1,9 +1,23 @@
-/*!
- * Ext JS Library 3.4.0
- * Copyright(c) 2006-2011 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
+/*
+This file is part of Ext JS 3.4
+
+Copyright (c) 2011-2013 Sencha Inc
+
+Contact: http://www.sencha.com/contact
+
+GNU General Public License Usage
+This file may be used under the terms of the GNU General Public License version 3.0 as
+published by the Free Software Foundation and appearing in the file LICENSE included in the
+packaging of this file.
+
+Please review the following information to ensure the GNU General Public License version 3.0
+requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+
+If you are unsure which license is appropriate for your use, please contact the sales department
+at http://www.sencha.com/contact.
+
+Build date: 2013-04-03 15:07:25
+*/
// for old browsers
window.undefined = window.undefined;
@@ -18,11 +32,11 @@ Ext = {
* The version of the framework
* @type String
*/
- version : '3.4.0',
+ version : '3.4.1.1',
versionDetail : {
major : 3,
minor : 4,
- patch : 0
+ patch : 1.1
}
};
@@ -65,19 +79,81 @@ Ext.apply = function(o, c, defaults){
isSafari3 = isSafari && check(/version\/3/),
isSafari4 = isSafari && check(/version\/4/),
isIE = !isOpera && check(/msie/),
- isIE7 = isIE && (check(/msie 7/) || docMode == 7),
- isIE8 = isIE && (check(/msie 8/) && docMode != 7),
- isIE9 = isIE && check(/msie 9/),
- isIE6 = isIE && !isIE7 && !isIE8 && !isIE9,
+ isIE7 = isIE && ((check(/msie 7/) && docMode != 8 && docMode != 9 && docMode != 10) || docMode == 7),
+ isIE8 = isIE && ((check(/msie 8/) && docMode != 7 && docMode != 9 && docMode != 10) || docMode == 8),
+ isIE9 = isIE && ((check(/msie 9/) && docMode != 7 && docMode != 8 && docMode != 10) || docMode == 9),
+ isIE10 = isIE && ((check(/msie 10/) && docMode != 7 && docMode != 8 && docMode != 9) || docMode == 10),
+ isIE6 = isIE && check(/msie 6/),
+ isIE9m = isIE && (isIE6 || isIE7 || isIE8 || isIE9),
isGecko = !isWebKit && check(/gecko/),
isGecko2 = isGecko && check(/rv:1\.8/),
isGecko3 = isGecko && check(/rv:1\.9/),
- isBorderBox = isIE && !isStrict,
+ isBorderBox = isIE9m && !isStrict,
isWindows = check(/windows|win32/),
isMac = check(/macintosh|mac os x/),
isAir = check(/adobeair/),
isLinux = check(/linux/),
- isSecure = /^https/i.test(window.location.protocol);
+ isSecure = /^https/i.test(window.location.protocol),
+ noArgs = [],
+ nonEnumerables = [],
+ emptyFn = Ext.emptyFn,
+ t = Ext.apply({}, {
+ constructor: emptyFn,
+ toString: emptyFn,
+ valueOf: emptyFn
+ }),
+ callOverrideParent = function () {
+ var method = callOverrideParent.caller.caller; // skip callParent (our caller)
+ return method.$owner.prototype[method.$name].apply(this, arguments);
+ };
+
+ if (t.constructor !== emptyFn) {
+ nonEnumerables.push('constructor');
+ }
+ if (t.toString !== emptyFn) {
+ nonEnumerables.push('toString');
+ }
+ if (t.valueOf !== emptyFn) {
+ nonEnumerables.push('valueOf');
+ }
+ if (!nonEnumerables.length) {
+ nonEnumerables = null;
+ }
+
+ // Create the abstract Base class to provide an empty constructor and callParent implementations
+ function Base () {
+ //
+ }
+
+ Ext.apply(Base, {
+ $isClass: true,
+
+ callParent: function (args) {
+ var method;
+
+ // This code is intentionally inlined for the least number of debugger stepping
+ return (method = this.callParent.caller) && (method.$previous ||
+ ((method = method.$owner ? method : method.caller) &&
+ method.$owner.superclass.self[method.$name])).apply(this, args || noArgs);
+ }
+ });
+
+ Base.prototype = {
+ constructor: function() {
+ },
+ callParent: function(args) {
+ // NOTE: this code is deliberately as few expressions (and no function calls)
+ // as possible so that a debugger can skip over this noise with the minimum number
+ // of steps. Basically, just hit Step Into until you are where you really wanted
+ // to be.
+ var method,
+ superMethod = (method = this.callParent.caller) && (method.$previous ||
+ ((method = method.$owner ? method : method.caller) &&
+ method.$owner.superclass[method.$name]));
+
+ return superMethod.apply(this, args || noArgs);
+ }
+ };
// remove css image flicker
if(isIE6){
@@ -270,29 +346,375 @@ MyGridPanel = Ext.extend(Ext.grid.GridPanel, {
};
}(),
+ global: (function () {
+ return this;
+ })(),
+
+ Base: Base,
+
+ namespaceCache: {},
+
+ createNamespace: function (namespaceOrClass, isClass) {
+ var cache = Ext.namespaceCache,
+ namespace = isClass ? namespaceOrClass.substring(0, namespaceOrClass.lastIndexOf('.'))
+ : namespaceOrClass,
+ ns = cache[namespace],
+ i, n, part, parts, partials;
+
+ if (!ns) {
+ ns = Ext.global;
+ if (namespace) {
+ partials = [];
+ parts = namespace.split('.');
+
+ for (i = 0, n = parts.length; i < n; ++i) {
+ part = parts[i];
+
+ ns = ns[part] || (ns[part] = {});
+ partials.push(part);
+
+ cache[partials.join('.')] = ns; // build up prefixes as we go
+ }
+ }
+ }
+
+ return ns;
+ },
+
+ getClassByName: function (className) {
+ var parts = className.split('.'),
+ cls = Ext.global,
+ n = parts.length,
+ i;
+
+ for (i = 0; cls && i < n; ++i) {
+ cls = cls[parts[i]];
+ }
+
+ return cls || null;
+ },
+
+ addMembers: function (cls, target, members, handleNonEnumerables) {
+ var i, name, member;
+
+ for (name in members) {
+ if (members.hasOwnProperty(name)) {
+ member = members[name];
+ if (typeof member == 'function') {
+ member.$owner = cls;
+ member.$name = name;
+ }
+
+ target[name] = member;
+ }
+ }
+
+ if (handleNonEnumerables && nonEnumerables) {
+ for (i = nonEnumerables.length; i-- > 0; ) {
+ name = nonEnumerables[i];
+ if (members.hasOwnProperty(name)) {
+ member = members[name];
+ if (typeof member == 'function') {
+ member.$owner = cls;
+ member.$name = name;
+ }
+
+ target[name] = member;
+ }
+ }
+ }
+ },
+
/**
- * Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name.
- * Usage:<pre><code>
-Ext.override(MyClass, {
- newMethod1: function(){
- // etc.
- },
- newMethod2: function(foo){
- // etc.
- }
-});
-</code></pre>
- * @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
+ * Defines a class or override. A basic class is defined like this:
+ *
+ * Ext.define('My.awesome.Class', {
+ * someProperty: 'something',
+ *
+ * someMethod: function(s) {
+ * alert(s + this.someProperty);
+ * }
+ *
+ * ...
+ * });
+ *
+ * var obj = new My.awesome.Class();
+ *
+ * obj.someMethod('Say '); // alerts 'Say something'
+ *
+ * To create an anonymous class, pass `null` for the `className`:
+ *
+ * Ext.define(null, {
+ * constructor: function () {
+ * // ...
+ * }
+ * });
+ *
+ * In some cases, it is helpful to create a nested scope to contain some private
+ * properties. The best way to do this is to pass a function instead of an object
+ * as the second parameter. This function will be called to produce the class
+ * body:
+ *
+ * Ext.define('MyApp.foo.Bar', function () {
+ * var id = 0;
+ *
+ * return {
+ * nextId: function () {
+ * return ++id;
+ * }
+ * };
+ * });
+ *
+ * When using this form of `Ext.define`, the function is passed a reference to its
+ * class. This can be used as an efficient way to access any static properties you
+ * may have:
+ *
+ * Ext.define('MyApp.foo.Bar', function (Bar) {
+ * return {
+ * statics: {
+ * staticMethod: function () {
+ * // ...
+ * }
+ * },
+ *
+ * method: function () {
+ * return Bar.staticMethod();
+ * }
+ * };
+ * });
+ *
+ * To define an override, include the `override` property. The content of an
+ * override is aggregated with the specified class in order to extend or modify
+ * that class. This can be as simple as setting default property values or it can
+ * extend and/or replace methods. This can also extend the statics of the class.
+ *
+ * One use for an override is to break a large class into manageable pieces.
+ *
+ * // File: /src/app/Panel.js
+ *
+ * Ext.define('My.app.Panel', {
+ * extend: 'Ext.panel.Panel',
+ *
+ * constructor: function (config) {
+ * this.callParent(arguments); // calls Ext.panel.Panel's constructor
+ * //...
+ * },
+ *
+ * statics: {
+ * method: function () {
+ * return 'abc';
+ * }
+ * }
+ * });
+ *
+ * // File: /src/app/PanelPart2.js
+ * Ext.define('My.app.PanelPart2', {
+ * override: 'My.app.Panel',
+ *
+ * constructor: function (config) {
+ * this.callParent(arguments); // calls My.app.Panel's constructor
+ * //...
+ * }
+ * });
+ *
+ * Another use of overrides is to provide optional parts of classes that can be
+ * independently required. In this case, the class may even be unaware of the
+ * override altogether.
+ *
+ * Ext.define('My.ux.CoolTip', {
+ * override: 'Ext.tip.ToolTip',
+ *
+ * constructor: function (config) {
+ * this.callParent(arguments); // calls Ext.tip.ToolTip's constructor
+ * //...
+ * }
+ * });
+ *
+ * Overrides can also contain statics:
+ *
+ * Ext.define('My.app.BarMod', {
+ * override: 'Ext.foo.Bar',
+ *
+ * statics: {
+ * method: function (x) {
+ * return this.callParent([x * 2]); // call Ext.foo.Bar.method
+ * }
+ * }
+ * });
+ *
+ * @param {String} className The class name to create in string dot-namespaced format, for example:
+ * 'My.very.awesome.Class', 'FeedViewer.plugin.CoolPager'
+ * It is highly recommended to follow this simple convention:
+ * - The root and the class name are 'CamelCased'
+ * - Everything else is lower-cased
+ * Pass `null` to create an anonymous class.
+ * @param {Object} data The key - value pairs of properties to apply to this class. Property names can be of any valid
+ * strings, except those in the reserved listed below:
+ * - `mixins`
+ * - `statics`
+ * - `config`
+ * - `alias`
+ * - `self`
+ * - `singleton`
+ * - `alternateClassName`
+ * - `override`
+ *
+ * @param {Function} createdFn Optional callback to execute after the class is created, the execution scope of which
+ * (`this`) will be the newly created class itself.
+ * @return {Ext.Base}
+ * @markdown
+ * @member Ext
+ * @method define
+ */
+ define: function (className, body, createdFn) {
+ var override = body.override,
+ cls, extend, name, namespace;
+
+ if (override) {
+ delete body.override;
+ cls = Ext.getClassByName(override);
+ Ext.override(cls, body);
+ } else {
+ if (className) {
+ namespace = Ext.createNamespace(className, true);
+ name = className.substring(className.lastIndexOf('.')+1);
+ }
+
+ cls = function ctor () {
+ this.constructor.apply(this, arguments);
+ }
+
+ if (className) {
+ cls.displayName = className;
+ }
+ cls.$isClass = true;
+ cls.callParent = Ext.Base.callParent;
+
+ if (typeof body == 'function') {
+ body = body(cls);
+ }
+
+ extend = body.extend;
+ if (extend) {
+ delete body.extend;
+ if (typeof extend == 'string') {
+ extend = Ext.getClassByName(extend);
+ }
+ } else {
+ extend = Base;
+ }
+
+ Ext.extend(cls, extend, body);
+ if (cls.prototype.constructor === cls) {
+ delete cls.prototype.constructor;
+ }
+
+ // Not extending a class which derives from Base...
+ if (!cls.prototype.$isClass) {
+ Ext.applyIf(cls.prototype, Base.prototype);
+ }
+ cls.prototype.self = cls;
+
+ if (body.xtype) {
+ Ext.reg(body.xtype, cls);
+ }
+ cls = body.singleton ? new cls() : cls;
+ if (className) {
+ namespace[name] = cls;
+ }
+ }
+
+ if (createdFn) {
+ createdFn.call(cls);
+ }
+
+ return cls;
+ },
+
+ /**
+ * Overrides members of the specified `target` with the given values.
+ *
+ * If the `target` is a function, it is assumed to be a constructor and the contents
+ * of `overrides` are applied to its `prototype` using {@link Ext#apply Ext.apply}.
+ *
+ * If the `target` is an instance of a class created using {@link #define},
+ * the `overrides` are applied to only that instance. In this case, methods are
+ * specially processed to allow them to use {@link Ext.Base#callParent}.
+ *
+ * var panel = new Ext.Panel({ ... });
+ *
+ * Ext.override(panel, {
+ * initComponent: function () {
+ * // extra processing...
+ *
+ * this.callParent();
+ * }
+ * });
+ *
+ * If the `target` is none of these, the `overrides` are applied to the `target`
+ * using {@link Ext#apply Ext.apply}.
+ *
+ * Please refer to {@link Ext#define Ext.define} for further details.
+ *
+ * @param {Object} target The target to override.
+ * @param {Object} overrides The properties to add or replace on `target`.
* @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;
+ override: function (target, overrides) {
+ var proto, statics;
+
+ if (overrides) {
+ if (target.$isClass) {
+ statics = overrides.statics;
+ if (statics) {
+ delete overrides.statics;
+ }
+
+ Ext.addMembers(target, target.prototype, overrides, true);
+ if (statics) {
+ Ext.addMembers(target, target, statics);
+ }
+ } else if (typeof target == 'function') {
+ proto = target.prototype;
+ Ext.apply(proto, overrides);
+ if(Ext.isIE && overrides.hasOwnProperty('toString')){
+ proto.toString = overrides.toString;
+ }
+ } else {
+ var owner = target.self,
+ name, value;
+
+ if (owner && owner.$isClass) {
+ for (name in overrides) {
+ if (overrides.hasOwnProperty(name)) {
+ value = overrides[name];
+
+ if (typeof value == 'function') {
+ //<debug>
+ if (owner.$className) {
+ value.displayName = owner.$className + '#' + name;
+ }
+ //</debug>
+
+ value.$name = name;
+ value.$owner = owner;
+ value.$previous = target.hasOwnProperty(name)
+ ? target[name] // already hooked, so call previous hook
+ : callOverrideParent; // calls by name on prototype
+ }
+
+ target[name] = value;
+ }
+ }
+ } else {
+ Ext.apply(target, overrides);
+
+ if (!target.constructor.$isClass) {
+ target.constructor.prototype.callParent = Base.prototype.callParent;
+ target.constructor.callParent = Base.callParent;
+ }
+ }
}
}
},
@@ -573,6 +995,7 @@ function(el){
/**
* Returns the current document body as an {@link Ext.Element}.
* @return Ext.Element The document body
+ * @method
*/
getHead : function() {
var head;
@@ -587,14 +1010,12 @@ function(el){
}(),
/**
- * Removes a DOM node from the document.
- */
- /**
* <p>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
* <code>true</code>, then DOM event listeners are also removed from all child nodes. The body node
* will be ignored if passed in.</p>
* @param {HTMLElement} node The node to remove
+ * @method
*/
removeNode : isIE && !isIE8 ? function(){
var d;
@@ -781,6 +1202,29 @@ function(el){
* @type Boolean
*/
isIE9 : isIE9,
+
+ /**
+ * True if the detected browser is Internet Explorer 10.x
+ * @type Boolean
+ */
+ isIE10 : isIE10,
+
+ /**
+ * True if the detected browser is Internet Explorer 9.x or lower
+ * @type Boolean
+ */
+ isIE9m : isIE9m,
+
+ /**
+ * True if the detected browser is Internet Explorer 10.x or higher
+ * @type Boolean
+ */
+ isIE10p : isIE && !(isIE6 || isIE7 || isIE8 || isIE9),
+
+ // IE10 quirks behaves like Gecko/WebKit quirks, so don't include it here
+ // Used internally
+ isIEQuirks: isIE && (!isStrict && (isIE6 || isIE7 || isIE8 || isIE9)),
+
/**
* True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox).
* @type Boolean
@@ -1105,37 +1549,37 @@ Ext.TaskMgr.start({
Ext.util.TaskRunner = function(interval){
interval = interval || 10;
var tasks = [],
- removeQueue = [],
- id = 0,
- running = false,
+ removeQueue = [],
+ id = 0,
+ running = false,
- // private
- stopThread = function(){
+ // private
+ stopThread = function(){
running = false;
clearInterval(id);
id = 0;
},
- // private
- startThread = function(){
+ // private
+ startThread = function(){
if(!running){
running = true;
id = setInterval(runTasks, interval);
}
},
- // private
- removeTask = function(t){
+ // 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();
+ // private
+ runTasks = function(){
+ var rqLen = removeQueue.length,
+ now = new Date().getTime();
if(rqLen > 0){
for(var i = 0; i < rqLen; i++){
@@ -1297,16 +1741,16 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){
},
getViewportHeight: function(){
- return Ext.isIE ?
- (Ext.isStrict ? doc.documentElement.clientHeight : doc.body.clientHeight) :
- self.innerHeight;
+ return Ext.isIE9m ?
+ (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;
+ Ext.isIE9m ? doc.documentElement.clientWidth : self.innerWidth;
},
-
+
getY : function(el) {
return this.getXY(el)[1];
},
@@ -1317,17 +1761,17 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){
getXY : function(el) {
var p,
- pe,
- b,
- bt,
- bl,
- dbd,
- x = 0,
- y = 0,
- scroll,
- hasAbsolute,
- bd = (doc.body || doc.documentElement),
- ret = [0,0];
+ pe,
+ b,
+ bt,
+ bl,
+ dbd,
+ x = 0,
+ y = 0,
+ scroll,
+ hasAbsolute,
+ bd = (doc.body || doc.documentElement),
+ ret = [0,0];
el = Ext.getDom(el);
@@ -1380,7 +1824,7 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){
}
ret = [x,y];
}
- }
+ }
return ret;
},
@@ -1388,8 +1832,8 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){
(el = Ext.fly(el, '_setXY')).position();
var pts = el.translatePoints(xy),
- style = el.dom.style,
- pos;
+ style = el.dom.style,
+ pos;
for (pos in pts) {
if (!isNaN(pts[pos])) {
@@ -1719,7 +2163,7 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){
_load : function(e) {
loadComplete = true;
- if (Ext.isIE && e !== true) {
+ if (Ext.isIE9m && e !== true) {
// IE8 complains that _load is null or not an object
// so lets remove self via arguments.callee
doRemove(win, "load", arguments.callee);
@@ -1769,8 +2213,7 @@ Ext.TaskMgr = new Ext.util.TaskRunner();(function(){
* http://developer.yahoo.net/yui/license.txt
*/
Ext.lib.Ajax = function() {
- var activeX = ['Msxml2.XMLHTTP.6.0',
- 'Msxml2.XMLHTTP.3.0',
+ var activeX = ['Msxml2.XMLHTTP.3.0',
'Msxml2.XMLHTTP'],
CONTENTTYPE = 'Content-Type';
@@ -2893,7 +3336,7 @@ Ext.lib.Ajax = function() {
}
});
})();
- if (Ext.isIE) {
+ if (Ext.isIE9m) {
function fnCleanUp() {
var p = Function.prototype;
delete p.createSequence;
@@ -2906,4 +3349,4 @@ Ext.lib.Ajax = function() {
}
window.attachEvent("onunload", fnCleanUp);
}
-})(); \ No newline at end of file
+})();
diff --git a/deluge/ui/web/js/extjs/ext-base.js b/deluge/ui/web/js/extjs/ext-base.js
index 7362d5118..29047a7ac 100644
--- a/deluge/ui/web/js/extjs/ext-base.js
+++ b/deluge/ui/web/js/extjs/ext-base.js
@@ -1,7 +1,21 @@
/*
- * Ext JS Library 3.4.0
- * Copyright(c) 2006-2011 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
-window.undefined=window.undefined;Ext={version:"3.4.0",versionDetail:{major:3,minor:4,patch: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,u=Object.prototype.toString,v=navigator.userAgent.toLowerCase(),A=function(e){return e.test(v)},i=document,n=i.documentMode,l=i.compatMode=="CSS1Compat",C=A(/opera/),h=A(/\bchrome\b/),w=A(/webkit/),z=!h&&A(/safari/),f=z&&A(/applewebkit\/4/),b=z&&A(/version\/3/),D=z&&A(/version\/4/),t=!C&&A(/msie/),r=t&&(A(/msie 7/)||n==7),q=t&&(A(/msie 8/)&&n!=7),p=t&&A(/msie 9/),s=t&&!r&&!q&&!p,o=!w&&A(/gecko/),d=o&&A(/rv:1\.8/),a=o&&A(/rv:1\.9/),x=t&&!l,B=A(/windows|win32/),k=A(/macintosh|mac os x/),j=A(/adobeair/),m=A(/linux/),c=/^https/i.test(window.location.protocol);if(s){try{i.execCommand("BackgroundImageCache",false,true)}catch(y){}}Ext.apply(Ext,{SSL_SECURE_URL:c&&t?'javascript:""':"about:blank",isStrict:l,isSecure:c,isReady:false,enableForcedBoxModel:false,enableGarbageCollector:true,enableListenerCollection:false,enableNestedListenerRemoval:false,USE_NATIVE_JSON:false,applyIf:function(E,F){if(E){for(var e in F){if(!Ext.isDefined(E[e])){E[e]=F[e]}}}return E},id:function(e,E){e=Ext.getDom(e,true)||{};if(!e.id){e.id=(E||"ext-gen")+(++g)}return e.id},extend:function(){var E=function(G){for(var F in G){this[F]=G[F]}};var e=Object.prototype.constructor;return function(L,I,K){if(typeof I=="object"){K=I;I=L;L=K.constructor!=e?K.constructor:function(){I.apply(this,arguments)}}var H=function(){},J,G=I.prototype;H.prototype=G;J=L.prototype=new H();J.constructor=L;L.superclass=G;if(G.constructor==e){G.constructor=I}L.override=function(F){Ext.override(L,F)};J.superclass=J.supr=(function(){return G});J.override=E;Ext.override(L,K);L.extend=function(F){return Ext.extend(L,F)};return L}}(),override:function(e,F){if(F){var E=e.prototype;Ext.apply(E,F);if(Ext.isIE&&F.hasOwnProperty("toString")){E.toString=F.toString}}},namespace:function(){var G=arguments.length,H=0,E,F,e,J,I,K;for(;H<G;++H){e=arguments[H];J=arguments[H].split(".");K=window[J[0]];if(K===undefined){K=window[J[0]]={}}I=J.slice(1);E=I.length;for(F=0;F<E;++F){K=K[I[F]]=K[I[F]]||{}}}return K},urlEncode:function(I,H){var F,E=[],G=encodeURIComponent;Ext.iterate(I,function(e,J){F=Ext.isEmpty(J);Ext.each(F?e:J,function(K){E.push("&",G(e),"=",(!Ext.isEmpty(K)&&(K!=e||!F))?(Ext.isDate(K)?Ext.encode(K).replace(/"/g,""):G(K)):"")})});if(!H){E.shift();H=""}return H+E.join("")},urlDecode:function(F,E){if(Ext.isEmpty(F)){return{}}var I={},H=F.split("&"),J=decodeURIComponent,e,G;Ext.each(H,function(K){K=K.split("=");e=J(K[0]);G=J(K[1]);I[e]=E||!I[e]?G:[].concat(I[e]).concat(G)});return I},urlAppend:function(e,E){if(!Ext.isEmpty(E)){return e+(e.indexOf("?")===-1?"?":"&")+E}return e},toArray:function(){return t?function(F,I,G,H){H=[];for(var E=0,e=F.length;E<e;E++){H.push(F[E])}return H.slice(I||0,G||H.length)}:function(e,F,E){return Array.prototype.slice.call(e,F||0,E||e.length)}}(),isIterable:function(e){if(Ext.isArray(e)||e.callee){return true}if(/NodeList|HTMLCollection/.test(u.call(e))){return true}return((typeof e.nextNode!="undefined"||e.item)&&Ext.isNumber(e.length))},each:function(H,G,F){if(Ext.isEmpty(H,true)){return}if(!Ext.isIterable(H)||Ext.isPrimitive(H)){H=[H]}for(var E=0,e=H.length;E<e;E++){if(G.call(F||H[E],H[E],E,H)===false){return E}}},iterate:function(F,E,e){if(Ext.isEmpty(F)){return}if(Ext.isIterable(F)){Ext.each(F,E,e);return}else{if(typeof F=="object"){for(var G in F){if(F.hasOwnProperty(G)){if(E.call(e||F,G,F[G],F)===false){return}}}}}},getDom:function(F,E){if(!F||!i){return null}if(F.dom){return F.dom}else{if(typeof F=="string"){var G=i.getElementById(F);if(G&&t&&E){if(F==G.getAttribute("id")){return G}else{return null}}return G}else{return F}}},getBody:function(){return Ext.get(i.body||i.documentElement)},getHead:function(){var e;return function(){if(e==undefined){e=Ext.get(i.getElementsByTagName("head")[0])}return e}}(),removeNode:t&&!q?function(){var e;return function(E){if(E&&E.tagName!="BODY"){(Ext.enableNestedListenerRemoval)?Ext.EventManager.purgeElement(E,true):Ext.EventManager.removeAll(E);e=e||i.createElement("div");e.appendChild(E);e.innerHTML="";delete Ext.elCache[E.id]}}}():function(e){if(e&&e.parentNode&&e.tagName!="BODY"){(Ext.enableNestedListenerRemoval)?Ext.EventManager.purgeElement(e,true):Ext.EventManager.removeAll(e);e.parentNode.removeChild(e);delete Ext.elCache[e.id]}},isEmpty:function(E,e){return E===null||E===undefined||((Ext.isArray(E)&&!E.length))||(!e?E==="":false)},isArray:function(e){return u.apply(e)==="[object Array]"},isDate:function(e){return u.apply(e)==="[object Date]"},isObject:function(e){return !!e&&Object.prototype.toString.call(e)==="[object Object]"},isPrimitive:function(e){return Ext.isString(e)||Ext.isNumber(e)||Ext.isBoolean(e)},isFunction:function(e){return u.apply(e)==="[object Function]"},isNumber:function(e){return typeof e==="number"&&isFinite(e)},isString:function(e){return typeof e==="string"},isBoolean:function(e){return typeof e==="boolean"},isElement:function(e){return e?!!e.tagName:false},isDefined:function(e){return typeof e!=="undefined"},isOpera:C,isWebKit:w,isChrome:h,isSafari:z,isSafari3:b,isSafari4:D,isSafari2:f,isIE:t,isIE6:s,isIE7:r,isIE8:q,isIE9:p,isGecko:o,isGecko2:d,isGecko3:a,isBorderBox:x,isLinux:m,isWindows:B,isMac:k,isAir:j});Ext.ns=Ext.namespace})();Ext.ns("Ext.util","Ext.lib","Ext.data","Ext.supports");Ext.elCache={};Ext.apply(Function.prototype,{createInterceptor:function(b,a){var c=this;return !Ext.isFunction(b)?this:function(){var e=this,d=arguments;b.target=e;b.method=c;return(b.apply(a||e||window,d)!==false)?c.apply(e||window,d):null}},createCallback:function(){var a=arguments,b=this;return function(){return b.apply(window,a)}},createDelegate:function(c,b,a){var d=this;return function(){var f=b||arguments;if(a===true){f=Array.prototype.slice.call(arguments,0);f=f.concat(b)}else{if(Ext.isNumber(a)){f=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(f,e)}}return d.apply(c||window,f)}},defer:function(c,e,b,a){var d=this.createDelegate(e,b,a);if(c>0){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<a;++c){if(this[c]===b){return c}}return -1},remove:function(b){var a=this.indexOf(b);if(a!=-1){this.splice(a,1)}return this}});Ext.util.TaskRunner=function(e){e=e||10;var f=[],a=[],b=0,g=false,d=function(){g=false;clearInterval(b);b=0},h=function(){if(!g){g=true;b=setInterval(i,e)}},c=function(j){a.push(j);if(j.onStop){j.onStop.apply(j.scope||j)}},i=function(){var l=a.length,n=new Date().getTime();if(l>0){for(var p=0;p<l;p++){f.remove(a[p])}a=[];if(f.length<1){d();return}}for(var p=0,o,k,m,j=f.length;p<j;++p){o=f[p];k=n-o.taskRunTime;if(o.interval<=k){m=o.run.apply(o.scope||o,o.args||[++o.taskRunCount]);o.taskRunTime=n;if(m===false||o.taskRunCount===o.repeat){c(o);return}}if(o.duration&&o.duration<=(n-o.taskStartTime)){c(o)}}};this.start=function(j){f.push(j);j.taskStartTime=new Date().getTime();j.taskRunTime=0;j.taskRunCount=0;h();return j};this.stop=function(j){c(j);return j};this.stopAll=function(){d();for(var k=0,j=f.length;k<j;k++){if(f[k].onStop){f[k].onStop()}}f=[];a=[]}};Ext.TaskMgr=new Ext.util.TaskRunner();(function(){var b;function c(d){if(!b){b=new Ext.Element.Flyweight()}b.dom=d;return b}(function(){var g=document,e=g.compatMode=="CSS1Compat",f=Math.max,d=Math.round,h=parseInt;Ext.lib.Dom={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},getViewWidth:function(i){return i?this.getDocumentWidth():this.getViewportWidth()},getViewHeight:function(i){return i?this.getDocumentHeight():this.getViewportHeight()},getDocumentHeight:function(){return f(!e?g.body.scrollHeight:g.documentElement.scrollHeight,this.getViewportHeight())},getDocumentWidth:function(){return f(!e?g.body.scrollWidth:g.documentElement.scrollWidth,this.getViewportWidth())},getViewportHeight:function(){return Ext.isIE?(Ext.isStrict?g.documentElement.clientHeight:g.body.clientHeight):self.innerHeight},getViewportWidth:function(){return !Ext.isStrict&&!Ext.isOpera?g.body.clientWidth:Ext.isIE?g.documentElement.clientWidth:self.innerWidth},getY:function(i){return this.getXY(i)[1]},getX:function(i){return this.getXY(i)[0]},getXY:function(k){var j,q,s,v,l,m,u=0,r=0,t,i,n=(g.body||g.documentElement),o=[0,0];k=Ext.getDom(k);if(k!=n){if(k.getBoundingClientRect){s=k.getBoundingClientRect();t=c(document).getScroll();o=[d(s.left+t.left),d(s.top+t.top)]}else{j=k;i=c(k).isStyle("position","absolute");while(j){q=c(j);u+=j.offsetLeft;r+=j.offsetTop;i=i||q.isStyle("position","absolute");if(Ext.isGecko){r+=v=h(q.getStyle("borderTopWidth"),10)||0;u+=l=h(q.getStyle("borderLeftWidth"),10)||0;if(j!=k&&!q.isStyle("overflow","visible")){u+=l;r+=v}}j=j.offsetParent}if(Ext.isSafari&&i){u-=n.offsetLeft;r-=n.offsetTop}if(Ext.isGecko&&!i){m=c(n);u+=h(m.getStyle("borderLeftWidth"),10)||0;r+=h(m.getStyle("borderTopWidth"),10)||0}j=k.parentNode;while(j&&j!=n){if(!Ext.isOpera||(j.tagName!="TR"&&!c(j).isStyle("display","inline"))){u-=j.scrollLeft;r-=j.scrollTop}j=j.parentNode}o=[u,r]}}return o},setXY:function(j,k){(j=Ext.fly(j,"_setXY")).position();var l=j.translatePoints(k),i=j.dom.style,m;for(m in l){if(!isNaN(l[m])){i[m]=l[m]+"px"}}},setX:function(j,i){this.setXY(j,[i,false])},setY:function(i,j){this.setXY(i,[false,j])}}})();Ext.lib.Event=function(){var v=false,f={},z=0,o=[],d,A=false,k=window,E=document,l=200,r=20,p=0,i=1,s=2,w=3,t="scrollLeft",q="scrollTop",g="unload",y="mouseover",D="mouseout",e=function(){var F;if(k.addEventListener){F=function(J,H,I,G){if(H=="mouseenter"){I=I.createInterceptor(n);J.addEventListener(y,I,(G))}else{if(H=="mouseleave"){I=I.createInterceptor(n);J.addEventListener(D,I,(G))}else{J.addEventListener(H,I,(G))}}return I}}else{if(k.attachEvent){F=function(J,H,I,G){J.attachEvent("on"+H,I);return I}}else{F=function(){}}}return F}(),h=function(){var F;if(k.removeEventListener){F=function(J,H,I,G){if(H=="mouseenter"){H=y}else{if(H=="mouseleave"){H=D}}J.removeEventListener(H,I,(G))}}else{if(k.detachEvent){F=function(I,G,H){I.detachEvent("on"+G,H)}}else{F=function(){}}}return F}();function n(F){return !u(F.currentTarget,x.getRelatedTarget(F))}function u(F,G){if(F&&F.firstChild){while(G){if(G===F){return true}G=G.parentNode;if(G&&(G.nodeType!=1)){G=null}}}return false}function B(){var G=false,L=[],J,I,F,H,K=!v||(z>0);if(!A){A=true;for(I=0;I<o.length;++I){F=o[I];if(F&&(J=E.getElementById(F.id))){if(!F.checkReady||v||J.nextSibling||(E&&E.body)){H=F.override;J=H?(H===true?F.obj:H):J;F.fn.call(J,F.obj);o.remove(F);--I}else{L.push(F)}}}z=(L.length===0)?0:z-1;if(K){m()}else{clearInterval(d);d=null}G=!(A=false)}return G}function m(){if(!d){var F=function(){B()};d=setInterval(F,r)}}function C(){var F=E.documentElement,G=E.body;if(F&&(F[q]||F[t])){return[F[t],F[q]]}else{if(G){return[G[t],G[q]]}else{return[0,0]}}}function j(F,G){F=F.browserEvent||F;var H=F["page"+G];if(!H&&H!==0){H=F["client"+G]||0;if(Ext.isIE){H+=C()[G=="X"?0:1]}}return H}var x={extAdapter:true,onAvailable:function(H,F,I,G){o.push({id:H,fn:F,obj:I,override:G,checkReady:false});z=l;m()},addListener:function(H,F,G){H=Ext.getDom(H);if(H&&G){if(F==g){if(f[H.id]===undefined){f[H.id]=[]}f[H.id].push([F,G]);return G}return e(H,F,G,false)}return false},removeListener:function(L,H,K){L=Ext.getDom(L);var J,G,F,I;if(L&&K){if(H==g){if((I=f[L.id])!==undefined){for(J=0,G=I.length;J<G;J++){if((F=I[J])&&F[p]==H&&F[i]==K){f[L.id].splice(J,1)}}}return}h(L,H,K,false)}},getTarget:function(F){F=F.browserEvent||F;return this.resolveTextNode(F.target||F.srcElement)},resolveTextNode:Ext.isGecko?function(G){if(!G){return}var F=HTMLElement.prototype.toString.call(G);if(F=="[xpconnect wrapped native prototype]"||F=="[object XULElement]"){return}return G.nodeType==3?G.parentNode:G}:function(F){return F&&F.nodeType==3?F.parentNode:F},getRelatedTarget:function(F){F=F.browserEvent||F;return this.resolveTextNode(F.relatedTarget||(/(mouseout|mouseleave)/.test(F.type)?F.toElement:/(mouseover|mouseenter)/.test(F.type)?F.fromElement:null))},getPageX:function(F){return j(F,"X")},getPageY:function(F){return j(F,"Y")},getXY:function(F){return[this.getPageX(F),this.getPageY(F)]},stopEvent:function(F){this.stopPropagation(F);this.preventDefault(F)},stopPropagation:function(F){F=F.browserEvent||F;if(F.stopPropagation){F.stopPropagation()}else{F.cancelBubble=true}},preventDefault:function(F){F=F.browserEvent||F;if(F.preventDefault){F.preventDefault()}else{if(F.keyCode){F.keyCode=0}F.returnValue=false}},getEvent:function(F){F=F||k.event;if(!F){var G=this.getEvent.caller;while(G){F=G.arguments[0];if(F&&Event==F.constructor){break}G=G.caller}}return F},getCharCode:function(F){F=F.browserEvent||F;return F.charCode||F.keyCode||0},getListeners:function(G,F){Ext.EventManager.getListeners(G,F)},purgeElement:function(G,H,F){Ext.EventManager.purgeElement(G,H,F)},_load:function(F){v=true;if(Ext.isIE&&F!==true){h(k,"load",arguments.callee)}},_unload:function(J){var G=Ext.lib.Event,H,M,K,F,I,N;for(F in f){K=f[F];for(H=0,I=K.length;H<I;H++){M=K[H];if(M){try{N=M[w]?(M[w]===true?M[s]:M[w]):k;M[i].call(N,G.getEvent(J),M[s])}catch(L){}}}}Ext.EventManager._unload();h(k,g,G._unload)}};x.on=x.addListener;x.un=x.removeListener;if(E&&E.body){x._load(true)}else{e(k,"load",x._load)}e(k,g,x._unload);B();return x}();Ext.lib.Ajax=function(){var g=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP"],d="Content-Type";function h(v){var t=v.conn,w,u={};function s(x,y){for(w in y){if(y.hasOwnProperty(w)){x.setRequestHeader(w,y[w])}}}Ext.apply(u,k.headers,k.defaultHeaders);s(t,u);delete k.headers}function e(v,u,t,s){return{tId:v,status:t?-1:0,statusText:t?"transaction aborted":"communication failure",isAbort:t,isTimeout:s,argument:u}}function j(s,t){(k.headers=k.headers||{})[s]=t}function p(u,y){var C={},x,w=u.conn,A,B,v=w.status==1223;try{x=u.conn.getAllResponseHeaders();Ext.each(x.replace(/\r\n/g,"\n").split("\n"),function(s){A=s.indexOf(":");if(A>=0){B=s.substr(0,A).toLowerCase();if(s.charAt(A+1)==" "){++A}C[B]=s.substr(A+1)}})}catch(z){}return{tId:u.tId,status:v?204:w.status,statusText:v?"No Content":w.statusText,getResponseHeader:function(s){return C[s.toLowerCase()]},getAllResponseHeaders:function(){return x},responseText:w.responseText,responseXML:w.responseXML,argument:y}}function o(s){if(s.tId){k.conn[s.tId]=null}s.conn=null;s=null}function f(x,y,t,s){if(!y){o(x);return}var v,u;try{if(x.conn.status!==undefined&&x.conn.status!=0){v=x.conn.status}else{v=13030}}catch(w){v=13030}if((v>=200&&v<300)||(Ext.isIE&&v==1223)){u=p(x,y.argument);if(y.success){if(!y.scope){y.success(u)}else{y.success.apply(y.scope,[u])}}}else{switch(v){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:u=e(x.tId,y.argument,(t?t:false),s);if(y.failure){if(!y.scope){y.failure(u)}else{y.failure.apply(y.scope,[u])}}break;default:u=p(x,y.argument);if(y.failure){if(!y.scope){y.failure(u)}else{y.failure.apply(y.scope,[u])}}}}o(x);u=null}function m(u,x,s,w,t,v){if(s&&s.readyState==4){clearInterval(t[w]);t[w]=null;if(v){clearTimeout(k.timeout[w]);k.timeout[w]=null}f(u,x)}}function r(s,t){k.abort(s,t,true)}function n(u,x){x=x||{};var s=u.conn,w=u.tId,t=k.poll,v=x.timeout||null;if(v){k.conn[w]=s;k.timeout[w]=setTimeout(r.createCallback(u,x),v)}t[w]=setInterval(m.createCallback(u,x,s,w,t,v),k.pollInterval)}function i(w,t,v,s){var u=l()||null;if(u){u.conn.open(w,t,true);if(k.useDefaultXhrHeader){j("X-Requested-With",k.defaultXhrHeader)}if(s&&k.useDefaultHeader&&(!k.headers||!k.headers[d])){j(d,k.defaultPostHeader)}if(k.defaultHeaders||k.headers){h(u)}n(u,v);u.conn.send(s||null)}return u}function l(){var t;try{if(t=q(k.transactionId)){k.transactionId++}}catch(s){}finally{return t}}function q(v){var s;try{s=new XMLHttpRequest()}catch(u){for(var t=Ext.isIE6?1:0;t<g.length;++t){try{s=new ActiveXObject(g[t]);break}catch(u){}}}finally{return{conn:s,tId:v}}}var k={request:function(s,u,v,w,A){if(A){var x=this,t=A.xmlData,y=A.jsonData,z;Ext.applyIf(x,A);if(t||y){z=x.headers;if(!z||!z[d]){j(d,t?"text/xml":"application/json")}w=t||(!Ext.isPrimitive(y)?Ext.encode(y):y)}}return i(s||A.method||"POST",u,v,w)},serializeForm:function(y){var x=y.elements||(document.forms[y]||Ext.getDom(y)).elements,s=false,w=encodeURIComponent,t,z="",v,u;Ext.each(x,function(A){t=A.name;v=A.type;if(!A.disabled&&t){if(/select-(one|multiple)/i.test(v)){Ext.each(A.options,function(B){if(B.selected){u=B.hasAttribute?B.hasAttribute("value"):B.getAttributeNode("value").specified;z+=String.format("{0}={1}&",w(t),w(u?B.value:B.text))}})}else{if(!(/file|undefined|reset|button/i.test(v))){if(!(/radio|checkbox/i.test(v)&&!A.checked)&&!(v=="submit"&&s)){z+=w(t)+"="+w(A.value)+"&";s=/submit/i.test(v)}}}}});return z.substr(0,z.length-1)},useDefaultHeader:true,defaultPostHeader:"application/x-www-form-urlencoded; charset=UTF-8",useDefaultXhrHeader:true,defaultXhrHeader:"XMLHttpRequest",poll:{},timeout:{},conn:{},pollInterval:50,transactionId:0,abort:function(v,x,s){var u=this,w=v.tId,t=false;if(u.isCallInProgress(v)){v.conn.abort();clearInterval(u.poll[w]);u.poll[w]=null;clearTimeout(k.timeout[w]);u.timeout[w]=null;f(v,x,(t=true),s)}return t},isCallInProgress:function(s){return s.conn&&!{0:true,4:true}[s.conn.readyState]}};return k}();(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;n<o;n++){m[n]=k[n]+q[n]}}else{m=k+q}}}Ext.apply(l,{start:k,end:m,unit:j(v)?v:r.getDefaultUnit(p)})},init:function(l,p,o,k){var r=this,n=0,s=g.AnimMgr;Ext.apply(r,{isAnimated:false,startTime:null,el:Ext.getDom(l),attributes:p||{},duration:o||1,method:k||g.Easing.easeNone,useSec:true,curFrame:0,totalFrames:s.fps,runAttrs:{},animate:function(){var u=this,v=u.duration;if(u.isAnimated){return false}u.curFrame=0;u.totalFrames=u.useSec?Math.ceil(s.fps*v):v;s.registerElement(u)},stop:function(u){var v=this;if(u){v.curFrame=v.totalFrames;v._onTween.fire()}s.stop(v)}});var t=function(){var v=this,u;v.onStart.fire();v.runAttrs={};for(u in this.attributes){this.setRunAttr(u)}v.isAnimated=true;v.startTime=e();n=0};var q=function(){var v=this;v.onTween.fire({duration:e()-v.startTime,curFrame:v.curFrame});var w=v.runAttrs;for(var u in w){this.setAttr(u,v.doMethod(u,w[u].start,w[u].end),w[u].unit)}++n};var m=function(){var u=this,w=(e()-u.startTime)/1000,v={duration:w,frames:n,fps:n/w};u.isAnimated=false;n=0;u.onComplete.fire(v)};r.onStart=new Ext.util.Event(r);r.onTween=new Ext.util.Event(r);r.onComplete=new Ext.util.Event(r);(r._onStart=new Ext.util.Event(r)).addListener(t);(r._onTween=new Ext.util.Event(r)).addListener(q);(r._onComplete=new Ext.util.Event(r)).addListener(m)}};Ext.lib.AnimMgr=new function(){var o=this,m=null,l=[],k=0;Ext.apply(o,{fps:1000,delay:1,registerElement:function(q){l.push(q);++k;q._onStart.fire();o.start()},unRegister:function(r,q){r._onComplete.fire();q=q||p(r);if(q!=-1){l.splice(q,1)}if(--k<=0){o.stop()}},start:function(){if(m===null){m=setInterval(o.run,o.delay)}},stop:function(s){if(!s){clearInterval(m);for(var r=0,q=l.length;r<q;++r){if(l[0].isAnimated){o.unRegister(l[0],0)}}l=[];m=null;k=0}else{o.unRegister(s)}},run:function(){var t,s,q,r;for(s=0,q=l.length;s<q;s++){r=l[s];if(r&&r.isAnimated){t=r.totalFrames;if(r.curFrame<t||t===null){++r.curFrame;if(r.useSec){n(r)}r._onTween.fire()}else{o.stop(r)}}}}});var p=function(s){var r,q;for(r=0,q=l.length;r<q;r++){if(l[r]===s){return r}}return -1};var n=function(r){var v=r.totalFrames,u=r.curFrame,t=r.duration,s=(u*t*1000/v),q=(e()-r.startTime),w=0;if(q<t*1000){w=Math.round((q/s-1)*u)}else{w=v-(u+1)}if(w>0&&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;l<r;++l){m[l]=[p[l][0],p[l][1]]}for(k=1;k<r;++k){for(l=0;l<r-k;++l){m[l][0]=q*m[l][0]+o*m[parseInt(l+1,10)][0];m[l][1]=q*m[l][1]+o*m[parseInt(l+1,10)][1]}}return[m[0][0],m[0][1]]}};g.Easing={easeNone:function(l,k,n,m){return n*l/m+k},easeIn:function(l,k,n,m){return n*(l/=m)*l+k},easeOut:function(l,k,n,m){return -n*(l/=m)*(l-2)+k}};(function(){g.Motion=function(o,n,p,q){if(o){g.Motion.superclass.constructor.call(this,o,n,p,q)}};Ext.extend(g.Motion,Ext.lib.AnimBase);var m=g.Motion.superclass,l=/^points$/i;Ext.apply(g.Motion.prototype,{setAttr:function(n,r,q){var p=this,o=m.setAttr;if(l.test(n)){q=q||"px";o.call(p,"left",r[0],q);o.call(p,"top",r[1],q)}else{o.call(p,n,r,q)}},getAttr:function(n){var p=this,o=m.getAttr;return l.test(n)?[o.call(p,"left"),o.call(p,"top")]:o.call(p,n)},doMethod:function(n,q,o){var p=this;return l.test(n)?g.Bezier.getPosition(p.runAttrs[n],p.method(p.curFrame,0,100,p.totalFrames)/100):m.doMethod.call(p,n,q,o)},setRunAttr:function(u){if(l.test(u)){var w=this,p=this.el,z=this.attributes.points,s=z.control||[],x=z.from,y=z.to,v=z.by,A=g.Dom,o,r,q,t,n;if(s.length>0&&!Ext.isArray(s[0])){s=[s]}else{}Ext.fly(p,"_anim").position();A.setXY(p,j(x)?x:A.getXY(p));o=w.getAttr("points");if(j(y)){q=k.call(w,y,o);for(r=0,t=s.length;r<t;++r){s[r]=k.call(w,s[r],o)}}else{if(j(v)){q=[o[0]+v[0],o[1]+v[1]];for(r=0,t=s.length;r<t;++r){s[r]=[o[0]+s[r][0],o[1]+s[r][1]]}}}n=this.runAttrs[u]=[o];if(s.length>0){n=n.concat(s)}n[n.length]=q}else{m.setRunAttr.call(this,u)}}});var k=function(n,p){var o=g.Dom.getXY(this.el);return[n[0]-o[0]+p[0],n[1]-o[1]+p[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<l/2)?f.Easing.bounceIn(k*2,0,m,l)*0.5+j:f.Easing.bounceOut(k*2-l,0,m,l)*0.5+m*0.5+j}})})();(function(){var h=Ext.lib;h.Anim.color=function(p,n,q,r,m,o){return h.Anim.run(p,n,q,r,m,o,h.ColorAnim)};h.ColorAnim=function(n,m,o,p){h.ColorAnim.superclass.constructor.call(this,n,m,o,p)};Ext.extend(h.ColorAnim,h.AnimBase);var j=h.ColorAnim.superclass,i=/color$/i,f=/^transparent|rgba\(0, 0, 0, 0\)$/,l=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,d=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,e=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i,g=function(m){return typeof m!=="undefined"};function k(n){var p=parseInt,o,m=null,q;if(n.length==3){return n}Ext.each([d,l,e],function(s,r){o=(r%2==0)?16:10;q=s.exec(n);if(q&&q.length==4){m=[p(q[1],o),p(q[2],o),p(q[3],o)];return false}});return m}Ext.apply(h.ColorAnim.prototype,{getAttr:function(m){var o=this,n=o.el,p;if(i.test(m)){while(n&&f.test(p=Ext.fly(n).getStyle(m))){n=n.parentNode;p="fff"}}else{p=j.getAttr.call(o,m)}return p},doMethod:function(s,m,o){var t=this,n,q=Math.floor,p,r,u;if(i.test(s)){n=[];o=o||[];for(p=0,r=m.length;p<r;p++){u=m[p];n[p]=j.doMethod.call(t,s,u,o[p])}n="rgb("+q(n[0])+","+q(n[1])+","+q(n[2])+")"}else{n=j.doMethod.call(t,s,m,o)}return n},setRunAttr:function(r){var t=this,u=t.attributes[r],v=u.to,s=u.by,n;j.setRunAttr.call(t,r);n=t.runAttrs[r];if(i.test(r)){var m=k(n.start),o=k(n.end);if(!g(v)&&g(s)){o=k(s);for(var p=0,q=m.length;p<q;p++){o[p]=m[p]+o[p]}}n.start=m;n.end=o}}})})();(function(){var d=Ext.lib;d.Anim.scroll=function(j,h,k,l,g,i){return d.Anim.run(j,h,k,l,g,i,d.Scroll)};d.Scroll=function(h,g,i,j){if(h){d.Scroll.superclass.constructor.call(this,h,g,i,j)}};Ext.extend(d.Scroll,d.ColorAnim);var f=d.Scroll.superclass,e="scroll";Ext.apply(d.Scroll.prototype,{doMethod:function(g,m,h){var k,j=this,l=j.curFrame,i=j.totalFrames;if(g==e){k=[j.method(l,m[0],h[0]-m[0],i),j.method(l,m[1],h[1]-m[1],i)]}else{k=f.doMethod.call(j,g,m,h)}return k},getAttr:function(g){var h=this;if(g==e){return[h.el.scrollLeft,h.el.scrollTop]}else{return f.getAttr.call(h,g)}},setAttr:function(g,j,i){var h=this;if(g==e){h.el.scrollLeft=j[0];h.el.scrollTop=j[1]}else{f.setAttr.call(h,g,j,i)}}})})();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
+This file is part of Ext JS 3.4
+
+Copyright (c) 2011-2013 Sencha Inc
+
+Contact: http://www.sencha.com/contact
+
+GNU General Public License Usage
+This file may be used under the terms of the GNU General Public License version 3.0 as
+published by the Free Software Foundation and appearing in the file LICENSE included in the
+packaging of this file.
+
+Please review the following information to ensure the GNU General Public License version 3.0
+requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+
+If you are unsure which license is appropriate for your use, please contact the sales department
+at http://www.sencha.com/contact.
+
+Build date: 2013-04-03 15:07:25
+*/
+window.undefined=window.undefined;Ext={version:"3.4.1.1",versionDetail:{major:3,minor:4,patch:1.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,f=Object.prototype.toString,y=navigator.userAgent.toLowerCase(),n=function(e){return e.test(y)},s=document,q=s.documentMode,u=s.compatMode=="CSS1Compat",a=n(/opera/),H=n(/\bchrome\b/),z=n(/webkit/),d=!H&&n(/safari/),F=d&&n(/applewebkit\/4/),D=d&&n(/version\/3/),B=d&&n(/version\/4/),j=!a&&n(/msie/),G=j&&((n(/msie 7/)&&q!=8&&q!=9&&q!=10)||q==7),E=j&&((n(/msie 8/)&&q!=7&&q!=9&&q!=10)||q==8),C=j&&((n(/msie 9/)&&q!=7&&q!=8&&q!=10)||q==9),i=j&&((n(/msie 10/)&&q!=7&&q!=8&&q!=9)||q==10),J=j&&n(/msie 6/),K=j&&(J||G||E||C),c=!z&&n(/gecko/),M=c&&n(/rv:1\.8/),L=c&&n(/rv:1\.9/),m=K&&!u,h=n(/windows|win32/),A=n(/macintosh|mac os x/),p=n(/adobeair/),v=n(/linux/),r=/^https/i.test(window.location.protocol),b=[],w=[],o=Ext.emptyFn,x=Ext.apply({},{constructor:o,toString:o,valueOf:o}),l=function(){var e=l.caller.caller;return e.$owner.prototype[e.$name].apply(this,arguments)};if(x.constructor!==o){w.push("constructor")}if(x.toString!==o){w.push("toString")}if(x.valueOf!==o){w.push("valueOf")}if(!w.length){w=null}function k(){}Ext.apply(k,{$isClass:true,callParent:function(e){var t;return(t=this.callParent.caller)&&(t.$previous||((t=t.$owner?t:t.caller)&&t.$owner.superclass.self[t.$name])).apply(this,e||b)}});k.prototype={constructor:function(){},callParent:function(t){var N,e=(N=this.callParent.caller)&&(N.$previous||((N=N.$owner?N:N.caller)&&N.$owner.superclass[N.$name]));return e.apply(this,t||b)}};if(J){try{s.execCommand("BackgroundImageCache",false,true)}catch(I){}}Ext.apply(Ext,{SSL_SECURE_URL:r&&j?'javascript:""':"about:blank",isStrict:u,isSecure:r,isReady:false,enableForcedBoxModel:false,enableGarbageCollector:true,enableListenerCollection:false,enableNestedListenerRemoval:false,USE_NATIVE_JSON:false,applyIf:function(t,N){if(t){for(var e in N){if(!Ext.isDefined(t[e])){t[e]=N[e]}}}return t},id:function(e,t){e=Ext.getDom(e,true)||{};if(!e.id){e.id=(t||"ext-gen")+(++g)}return e.id},extend:function(){var t=function(O){for(var N in O){this[N]=O[N]}};var e=Object.prototype.constructor;return function(S,P,R){if(typeof P=="object"){R=P;P=S;S=R.constructor!=e?R.constructor:function(){P.apply(this,arguments)}}var O=function(){},Q,N=P.prototype;O.prototype=N;Q=S.prototype=new O();Q.constructor=S;S.superclass=N;if(N.constructor==e){N.constructor=P}S.override=function(T){Ext.override(S,T)};Q.superclass=Q.supr=(function(){return N});Q.override=t;Ext.override(S,R);S.extend=function(T){return Ext.extend(S,T)};return S}}(),global:(function(){return this})(),Base:k,namespaceCache:{},createNamespace:function(R,O){var e=Ext.namespaceCache,P=O?R.substring(0,R.lastIndexOf(".")):R,U=e[P],S,N,t,Q,T;if(!U){U=Ext.global;if(P){T=[];Q=P.split(".");for(S=0,N=Q.length;S<N;++S){t=Q[S];U=U[t]||(U[t]={});T.push(t);e[T.join(".")]=U}}}return U},getClassByName:function(N){var O=N.split("."),e=Ext.global,P=O.length,t;for(t=0;e&&t<P;++t){e=e[O[t]]}return e||null},addMembers:function(t,Q,N,e){var P,O,R;for(O in N){if(N.hasOwnProperty(O)){R=N[O];if(typeof R=="function"){R.$owner=t;R.$name=O}Q[O]=R}}if(e&&w){for(P=w.length;P-->0;){O=w[P];if(N.hasOwnProperty(O)){R=N[O];if(typeof R=="function"){R.$owner=t;R.$name=O}Q[O]=R}}}},define:function(R,P,N){var t=P.override,T,Q,e,O;if(t){delete P.override;T=Ext.getClassByName(t);Ext.override(T,P)}else{if(R){O=Ext.createNamespace(R,true);e=R.substring(R.lastIndexOf(".")+1)}T=function S(){this.constructor.apply(this,arguments)};if(R){T.displayName=R}T.$isClass=true;T.callParent=Ext.Base.callParent;if(typeof P=="function"){P=P(T)}Q=P.extend;if(Q){delete P.extend;if(typeof Q=="string"){Q=Ext.getClassByName(Q)}}else{Q=k}Ext.extend(T,Q,P);if(T.prototype.constructor===T){delete T.prototype.constructor}if(!T.prototype.$isClass){Ext.applyIf(T.prototype,k.prototype)}T.prototype.self=T;if(P.xtype){Ext.reg(P.xtype,T)}T=P.singleton?new T():T;if(R){O[e]=T}}if(N){N.call(T)}return T},override:function(P,R){var N,Q;if(R){if(P.$isClass){Q=R.statics;if(Q){delete R.statics}Ext.addMembers(P,P.prototype,R,true);if(Q){Ext.addMembers(P,P,Q)}}else{if(typeof P=="function"){N=P.prototype;Ext.apply(N,R);if(Ext.isIE&&R.hasOwnProperty("toString")){N.toString=R.toString}}else{var e=P.self,t,O;if(e&&e.$isClass){for(t in R){if(R.hasOwnProperty(t)){O=R[t];if(typeof O=="function"){if(e.$className){O.displayName=e.$className+"#"+t}O.$name=t;O.$owner=e;O.$previous=P.hasOwnProperty(t)?P[t]:l}P[t]=O}}}else{Ext.apply(P,R);if(!P.constructor.$isClass){P.constructor.prototype.callParent=k.prototype.callParent;P.constructor.callParent=k.callParent}}}}}},namespace:function(){var O=arguments.length,P=0,t,N,e,R,Q,S;for(;P<O;++P){e=arguments[P];R=arguments[P].split(".");S=window[R[0]];if(S===undefined){S=window[R[0]]={}}Q=R.slice(1);t=Q.length;for(N=0;N<t;++N){S=S[Q[N]]=S[Q[N]]||{}}}return S},urlEncode:function(Q,P){var N,t=[],O=encodeURIComponent;Ext.iterate(Q,function(e,R){N=Ext.isEmpty(R);Ext.each(N?e:R,function(S){t.push("&",O(e),"=",(!Ext.isEmpty(S)&&(S!=e||!N))?(Ext.isDate(S)?Ext.encode(S).replace(/"/g,""):O(S)):"")})});if(!P){t.shift();P=""}return P+t.join("")},urlDecode:function(N,t){if(Ext.isEmpty(N)){return{}}var Q={},P=N.split("&"),R=decodeURIComponent,e,O;Ext.each(P,function(S){S=S.split("=");e=R(S[0]);O=R(S[1]);Q[e]=t||!Q[e]?O:[].concat(Q[e]).concat(O)});return Q},urlAppend:function(e,t){if(!Ext.isEmpty(t)){return e+(e.indexOf("?")===-1?"?":"&")+t}return e},toArray:function(){return j?function(N,Q,O,P){P=[];for(var t=0,e=N.length;t<e;t++){P.push(N[t])}return P.slice(Q||0,O||P.length)}:function(e,N,t){return Array.prototype.slice.call(e,N||0,t||e.length)}}(),isIterable:function(e){if(Ext.isArray(e)||e.callee){return true}if(/NodeList|HTMLCollection/.test(f.call(e))){return true}return((typeof e.nextNode!="undefined"||e.item)&&Ext.isNumber(e.length))},each:function(P,O,N){if(Ext.isEmpty(P,true)){return}if(!Ext.isIterable(P)||Ext.isPrimitive(P)){P=[P]}for(var t=0,e=P.length;t<e;t++){if(O.call(N||P[t],P[t],t,P)===false){return t}}},iterate:function(N,t,e){if(Ext.isEmpty(N)){return}if(Ext.isIterable(N)){Ext.each(N,t,e);return}else{if(typeof N=="object"){for(var O in N){if(N.hasOwnProperty(O)){if(t.call(e||N,O,N[O],N)===false){return}}}}}},getDom:function(N,t){if(!N||!s){return null}if(N.dom){return N.dom}else{if(typeof N=="string"){var O=s.getElementById(N);if(O&&j&&t){if(N==O.getAttribute("id")){return O}else{return null}}return O}else{return N}}},getBody:function(){return Ext.get(s.body||s.documentElement)},getHead:function(){var e;return function(){if(e==undefined){e=Ext.get(s.getElementsByTagName("head")[0])}return e}}(),removeNode:j&&!E?function(){var e;return function(t){if(t&&t.tagName!="BODY"){(Ext.enableNestedListenerRemoval)?Ext.EventManager.purgeElement(t,true):Ext.EventManager.removeAll(t);e=e||s.createElement("div");e.appendChild(t);e.innerHTML="";delete Ext.elCache[t.id]}}}():function(e){if(e&&e.parentNode&&e.tagName!="BODY"){(Ext.enableNestedListenerRemoval)?Ext.EventManager.purgeElement(e,true):Ext.EventManager.removeAll(e);e.parentNode.removeChild(e);delete Ext.elCache[e.id]}},isEmpty:function(t,e){return t===null||t===undefined||((Ext.isArray(t)&&!t.length))||(!e?t==="":false)},isArray:function(e){return f.apply(e)==="[object Array]"},isDate:function(e){return f.apply(e)==="[object Date]"},isObject:function(e){return !!e&&Object.prototype.toString.call(e)==="[object Object]"},isPrimitive:function(e){return Ext.isString(e)||Ext.isNumber(e)||Ext.isBoolean(e)},isFunction:function(e){return f.apply(e)==="[object Function]"},isNumber:function(e){return typeof e==="number"&&isFinite(e)},isString:function(e){return typeof e==="string"},isBoolean:function(e){return typeof e==="boolean"},isElement:function(e){return e?!!e.tagName:false},isDefined:function(e){return typeof e!=="undefined"},isOpera:a,isWebKit:z,isChrome:H,isSafari:d,isSafari3:D,isSafari4:B,isSafari2:F,isIE:j,isIE6:J,isIE7:G,isIE8:E,isIE9:C,isIE10:i,isIE9m:K,isIE10p:j&&!(J||G||E||C),isIEQuirks:j&&(!u&&(J||G||E||C)),isGecko:c,isGecko2:M,isGecko3:L,isBorderBox:m,isLinux:v,isWindows:h,isMac:A,isAir:p});Ext.ns=Ext.namespace})();Ext.ns("Ext.util","Ext.lib","Ext.data","Ext.supports");Ext.elCache={};Ext.apply(Function.prototype,{createInterceptor:function(b,a){var c=this;return !Ext.isFunction(b)?this:function(){var e=this,d=arguments;b.target=e;b.method=c;return(b.apply(a||e||window,d)!==false)?c.apply(e||window,d):null}},createCallback:function(){var a=arguments,b=this;return function(){return b.apply(window,a)}},createDelegate:function(c,b,a){var d=this;return function(){var f=b||arguments;if(a===true){f=Array.prototype.slice.call(arguments,0);f=f.concat(b)}else{if(Ext.isNumber(a)){f=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(f,e)}}return d.apply(c||window,f)}},defer:function(c,e,b,a){var d=this.createDelegate(e,b,a);if(c>0){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<a;++c){if(this[c]===b){return c}}return -1},remove:function(b){var a=this.indexOf(b);if(a!=-1){this.splice(a,1)}return this}});Ext.util.TaskRunner=function(e){e=e||10;var f=[],a=[],b=0,g=false,d=function(){g=false;clearInterval(b);b=0},h=function(){if(!g){g=true;b=setInterval(i,e)}},c=function(j){a.push(j);if(j.onStop){j.onStop.apply(j.scope||j)}},i=function(){var l=a.length,n=new Date().getTime();if(l>0){for(var p=0;p<l;p++){f.remove(a[p])}a=[];if(f.length<1){d();return}}for(var p=0,o,k,m,j=f.length;p<j;++p){o=f[p];k=n-o.taskRunTime;if(o.interval<=k){m=o.run.apply(o.scope||o,o.args||[++o.taskRunCount]);o.taskRunTime=n;if(m===false||o.taskRunCount===o.repeat){c(o);return}}if(o.duration&&o.duration<=(n-o.taskStartTime)){c(o)}}};this.start=function(j){f.push(j);j.taskStartTime=new Date().getTime();j.taskRunTime=0;j.taskRunCount=0;h();return j};this.stop=function(j){c(j);return j};this.stopAll=function(){d();for(var k=0,j=f.length;k<j;k++){if(f[k].onStop){f[k].onStop()}}f=[];a=[]}};Ext.TaskMgr=new Ext.util.TaskRunner();(function(){var b;function c(d){if(!b){b=new Ext.Element.Flyweight()}b.dom=d;return b}(function(){var g=document,e=g.compatMode=="CSS1Compat",f=Math.max,d=Math.round,h=parseInt;Ext.lib.Dom={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},getViewWidth:function(i){return i?this.getDocumentWidth():this.getViewportWidth()},getViewHeight:function(i){return i?this.getDocumentHeight():this.getViewportHeight()},getDocumentHeight:function(){return f(!e?g.body.scrollHeight:g.documentElement.scrollHeight,this.getViewportHeight())},getDocumentWidth:function(){return f(!e?g.body.scrollWidth:g.documentElement.scrollWidth,this.getViewportWidth())},getViewportHeight:function(){return Ext.isIE9m?(Ext.isStrict?g.documentElement.clientHeight:g.body.clientHeight):self.innerHeight},getViewportWidth:function(){return !Ext.isStrict&&!Ext.isOpera?g.body.clientWidth:Ext.isIE9m?g.documentElement.clientWidth:self.innerWidth},getY:function(i){return this.getXY(i)[1]},getX:function(i){return this.getXY(i)[0]},getXY:function(k){var j,q,s,v,l,m,u=0,r=0,t,i,n=(g.body||g.documentElement),o=[0,0];k=Ext.getDom(k);if(k!=n){if(k.getBoundingClientRect){s=k.getBoundingClientRect();t=c(document).getScroll();o=[d(s.left+t.left),d(s.top+t.top)]}else{j=k;i=c(k).isStyle("position","absolute");while(j){q=c(j);u+=j.offsetLeft;r+=j.offsetTop;i=i||q.isStyle("position","absolute");if(Ext.isGecko){r+=v=h(q.getStyle("borderTopWidth"),10)||0;u+=l=h(q.getStyle("borderLeftWidth"),10)||0;if(j!=k&&!q.isStyle("overflow","visible")){u+=l;r+=v}}j=j.offsetParent}if(Ext.isSafari&&i){u-=n.offsetLeft;r-=n.offsetTop}if(Ext.isGecko&&!i){m=c(n);u+=h(m.getStyle("borderLeftWidth"),10)||0;r+=h(m.getStyle("borderTopWidth"),10)||0}j=k.parentNode;while(j&&j!=n){if(!Ext.isOpera||(j.tagName!="TR"&&!c(j).isStyle("display","inline"))){u-=j.scrollLeft;r-=j.scrollTop}j=j.parentNode}o=[u,r]}}return o},setXY:function(j,k){(j=Ext.fly(j,"_setXY")).position();var l=j.translatePoints(k),i=j.dom.style,m;for(m in l){if(!isNaN(l[m])){i[m]=l[m]+"px"}}},setX:function(j,i){this.setXY(j,[i,false])},setY:function(i,j){this.setXY(i,[false,j])}}})();Ext.lib.Event=function(){var v=false,f={},z=0,o=[],d,A=false,k=window,E=document,l=200,r=20,p=0,i=1,s=2,w=3,t="scrollLeft",q="scrollTop",g="unload",y="mouseover",D="mouseout",e=function(){var F;if(k.addEventListener){F=function(J,H,I,G){if(H=="mouseenter"){I=I.createInterceptor(n);J.addEventListener(y,I,(G))}else{if(H=="mouseleave"){I=I.createInterceptor(n);J.addEventListener(D,I,(G))}else{J.addEventListener(H,I,(G))}}return I}}else{if(k.attachEvent){F=function(J,H,I,G){J.attachEvent("on"+H,I);return I}}else{F=function(){}}}return F}(),h=function(){var F;if(k.removeEventListener){F=function(J,H,I,G){if(H=="mouseenter"){H=y}else{if(H=="mouseleave"){H=D}}J.removeEventListener(H,I,(G))}}else{if(k.detachEvent){F=function(I,G,H){I.detachEvent("on"+G,H)}}else{F=function(){}}}return F}();function n(F){return !u(F.currentTarget,x.getRelatedTarget(F))}function u(F,G){if(F&&F.firstChild){while(G){if(G===F){return true}G=G.parentNode;if(G&&(G.nodeType!=1)){G=null}}}return false}function B(){var G=false,L=[],J,I,F,H,K=!v||(z>0);if(!A){A=true;for(I=0;I<o.length;++I){F=o[I];if(F&&(J=E.getElementById(F.id))){if(!F.checkReady||v||J.nextSibling||(E&&E.body)){H=F.override;J=H?(H===true?F.obj:H):J;F.fn.call(J,F.obj);o.remove(F);--I}else{L.push(F)}}}z=(L.length===0)?0:z-1;if(K){m()}else{clearInterval(d);d=null}G=!(A=false)}return G}function m(){if(!d){var F=function(){B()};d=setInterval(F,r)}}function C(){var F=E.documentElement,G=E.body;if(F&&(F[q]||F[t])){return[F[t],F[q]]}else{if(G){return[G[t],G[q]]}else{return[0,0]}}}function j(F,G){F=F.browserEvent||F;var H=F["page"+G];if(!H&&H!==0){H=F["client"+G]||0;if(Ext.isIE){H+=C()[G=="X"?0:1]}}return H}var x={extAdapter:true,onAvailable:function(H,F,I,G){o.push({id:H,fn:F,obj:I,override:G,checkReady:false});z=l;m()},addListener:function(H,F,G){H=Ext.getDom(H);if(H&&G){if(F==g){if(f[H.id]===undefined){f[H.id]=[]}f[H.id].push([F,G]);return G}return e(H,F,G,false)}return false},removeListener:function(L,H,K){L=Ext.getDom(L);var J,G,F,I;if(L&&K){if(H==g){if((I=f[L.id])!==undefined){for(J=0,G=I.length;J<G;J++){if((F=I[J])&&F[p]==H&&F[i]==K){f[L.id].splice(J,1)}}}return}h(L,H,K,false)}},getTarget:function(F){F=F.browserEvent||F;return this.resolveTextNode(F.target||F.srcElement)},resolveTextNode:Ext.isGecko?function(G){if(!G){return}var F=HTMLElement.prototype.toString.call(G);if(F=="[xpconnect wrapped native prototype]"||F=="[object XULElement]"){return}return G.nodeType==3?G.parentNode:G}:function(F){return F&&F.nodeType==3?F.parentNode:F},getRelatedTarget:function(F){F=F.browserEvent||F;return this.resolveTextNode(F.relatedTarget||(/(mouseout|mouseleave)/.test(F.type)?F.toElement:/(mouseover|mouseenter)/.test(F.type)?F.fromElement:null))},getPageX:function(F){return j(F,"X")},getPageY:function(F){return j(F,"Y")},getXY:function(F){return[this.getPageX(F),this.getPageY(F)]},stopEvent:function(F){this.stopPropagation(F);this.preventDefault(F)},stopPropagation:function(F){F=F.browserEvent||F;if(F.stopPropagation){F.stopPropagation()}else{F.cancelBubble=true}},preventDefault:function(F){F=F.browserEvent||F;if(F.preventDefault){F.preventDefault()}else{if(F.keyCode){F.keyCode=0}F.returnValue=false}},getEvent:function(F){F=F||k.event;if(!F){var G=this.getEvent.caller;while(G){F=G.arguments[0];if(F&&Event==F.constructor){break}G=G.caller}}return F},getCharCode:function(F){F=F.browserEvent||F;return F.charCode||F.keyCode||0},getListeners:function(G,F){Ext.EventManager.getListeners(G,F)},purgeElement:function(G,H,F){Ext.EventManager.purgeElement(G,H,F)},_load:function(F){v=true;if(Ext.isIE9m&&F!==true){h(k,"load",arguments.callee)}},_unload:function(J){var G=Ext.lib.Event,H,M,K,F,I,N;for(F in f){K=f[F];for(H=0,I=K.length;H<I;H++){M=K[H];if(M){try{N=M[w]?(M[w]===true?M[s]:M[w]):k;M[i].call(N,G.getEvent(J),M[s])}catch(L){}}}}Ext.EventManager._unload();h(k,g,G._unload)}};x.on=x.addListener;x.un=x.removeListener;if(E&&E.body){x._load(true)}else{e(k,"load",x._load)}e(k,g,x._unload);B();return x}();Ext.lib.Ajax=function(){var g=["Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP"],d="Content-Type";function h(v){var t=v.conn,w,u={};function s(x,y){for(w in y){if(y.hasOwnProperty(w)){x.setRequestHeader(w,y[w])}}}Ext.apply(u,k.headers,k.defaultHeaders);s(t,u);delete k.headers}function e(v,u,t,s){return{tId:v,status:t?-1:0,statusText:t?"transaction aborted":"communication failure",isAbort:t,isTimeout:s,argument:u}}function j(s,t){(k.headers=k.headers||{})[s]=t}function p(u,y){var C={},x,w=u.conn,A,B,v=w.status==1223;try{x=u.conn.getAllResponseHeaders();Ext.each(x.replace(/\r\n/g,"\n").split("\n"),function(s){A=s.indexOf(":");if(A>=0){B=s.substr(0,A).toLowerCase();if(s.charAt(A+1)==" "){++A}C[B]=s.substr(A+1)}})}catch(z){}return{tId:u.tId,status:v?204:w.status,statusText:v?"No Content":w.statusText,getResponseHeader:function(s){return C[s.toLowerCase()]},getAllResponseHeaders:function(){return x},responseText:w.responseText,responseXML:w.responseXML,argument:y}}function o(s){if(s.tId){k.conn[s.tId]=null}s.conn=null;s=null}function f(x,y,t,s){if(!y){o(x);return}var v,u;try{if(x.conn.status!==undefined&&x.conn.status!=0){v=x.conn.status}else{v=13030}}catch(w){v=13030}if((v>=200&&v<300)||(Ext.isIE&&v==1223)){u=p(x,y.argument);if(y.success){if(!y.scope){y.success(u)}else{y.success.apply(y.scope,[u])}}}else{switch(v){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:u=e(x.tId,y.argument,(t?t:false),s);if(y.failure){if(!y.scope){y.failure(u)}else{y.failure.apply(y.scope,[u])}}break;default:u=p(x,y.argument);if(y.failure){if(!y.scope){y.failure(u)}else{y.failure.apply(y.scope,[u])}}}}o(x);u=null}function m(u,x,s,w,t,v){if(s&&s.readyState==4){clearInterval(t[w]);t[w]=null;if(v){clearTimeout(k.timeout[w]);k.timeout[w]=null}f(u,x)}}function r(s,t){k.abort(s,t,true)}function n(u,x){x=x||{};var s=u.conn,w=u.tId,t=k.poll,v=x.timeout||null;if(v){k.conn[w]=s;k.timeout[w]=setTimeout(r.createCallback(u,x),v)}t[w]=setInterval(m.createCallback(u,x,s,w,t,v),k.pollInterval)}function i(w,t,v,s){var u=l()||null;if(u){u.conn.open(w,t,true);if(k.useDefaultXhrHeader){j("X-Requested-With",k.defaultXhrHeader)}if(s&&k.useDefaultHeader&&(!k.headers||!k.headers[d])){j(d,k.defaultPostHeader)}if(k.defaultHeaders||k.headers){h(u)}n(u,v);u.conn.send(s||null)}return u}function l(){var t;try{if(t=q(k.transactionId)){k.transactionId++}}catch(s){}finally{return t}}function q(v){var s;try{s=new XMLHttpRequest()}catch(u){for(var t=Ext.isIE6?1:0;t<g.length;++t){try{s=new ActiveXObject(g[t]);break}catch(u){}}}finally{return{conn:s,tId:v}}}var k={request:function(s,u,v,w,A){if(A){var x=this,t=A.xmlData,y=A.jsonData,z;Ext.applyIf(x,A);if(t||y){z=x.headers;if(!z||!z[d]){j(d,t?"text/xml":"application/json")}w=t||(!Ext.isPrimitive(y)?Ext.encode(y):y)}}return i(s||A.method||"POST",u,v,w)},serializeForm:function(y){var x=y.elements||(document.forms[y]||Ext.getDom(y)).elements,s=false,w=encodeURIComponent,t,z="",v,u;Ext.each(x,function(A){t=A.name;v=A.type;if(!A.disabled&&t){if(/select-(one|multiple)/i.test(v)){Ext.each(A.options,function(B){if(B.selected){u=B.hasAttribute?B.hasAttribute("value"):B.getAttributeNode("value").specified;z+=String.format("{0}={1}&",w(t),w(u?B.value:B.text))}})}else{if(!(/file|undefined|reset|button/i.test(v))){if(!(/radio|checkbox/i.test(v)&&!A.checked)&&!(v=="submit"&&s)){z+=w(t)+"="+w(A.value)+"&";s=/submit/i.test(v)}}}}});return z.substr(0,z.length-1)},useDefaultHeader:true,defaultPostHeader:"application/x-www-form-urlencoded; charset=UTF-8",useDefaultXhrHeader:true,defaultXhrHeader:"XMLHttpRequest",poll:{},timeout:{},conn:{},pollInterval:50,transactionId:0,abort:function(v,x,s){var u=this,w=v.tId,t=false;if(u.isCallInProgress(v)){v.conn.abort();clearInterval(u.poll[w]);u.poll[w]=null;clearTimeout(k.timeout[w]);u.timeout[w]=null;f(v,x,(t=true),s)}return t},isCallInProgress:function(s){return s.conn&&!{0:true,4:true}[s.conn.readyState]}};return k}();(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;n<o;n++){m[n]=k[n]+q[n]}}else{m=k+q}}}Ext.apply(l,{start:k,end:m,unit:j(v)?v:r.getDefaultUnit(p)})},init:function(l,p,o,k){var r=this,n=0,s=g.AnimMgr;Ext.apply(r,{isAnimated:false,startTime:null,el:Ext.getDom(l),attributes:p||{},duration:o||1,method:k||g.Easing.easeNone,useSec:true,curFrame:0,totalFrames:s.fps,runAttrs:{},animate:function(){var u=this,v=u.duration;if(u.isAnimated){return false}u.curFrame=0;u.totalFrames=u.useSec?Math.ceil(s.fps*v):v;s.registerElement(u)},stop:function(u){var v=this;if(u){v.curFrame=v.totalFrames;v._onTween.fire()}s.stop(v)}});var t=function(){var v=this,u;v.onStart.fire();v.runAttrs={};for(u in this.attributes){this.setRunAttr(u)}v.isAnimated=true;v.startTime=e();n=0};var q=function(){var v=this;v.onTween.fire({duration:e()-v.startTime,curFrame:v.curFrame});var w=v.runAttrs;for(var u in w){this.setAttr(u,v.doMethod(u,w[u].start,w[u].end),w[u].unit)}++n};var m=function(){var u=this,w=(e()-u.startTime)/1000,v={duration:w,frames:n,fps:n/w};u.isAnimated=false;n=0;u.onComplete.fire(v)};r.onStart=new Ext.util.Event(r);r.onTween=new Ext.util.Event(r);r.onComplete=new Ext.util.Event(r);(r._onStart=new Ext.util.Event(r)).addListener(t);(r._onTween=new Ext.util.Event(r)).addListener(q);(r._onComplete=new Ext.util.Event(r)).addListener(m)}};Ext.lib.AnimMgr=new function(){var o=this,m=null,l=[],k=0;Ext.apply(o,{fps:1000,delay:1,registerElement:function(q){l.push(q);++k;q._onStart.fire();o.start()},unRegister:function(r,q){r._onComplete.fire();q=q||p(r);if(q!=-1){l.splice(q,1)}if(--k<=0){o.stop()}},start:function(){if(m===null){m=setInterval(o.run,o.delay)}},stop:function(s){if(!s){clearInterval(m);for(var r=0,q=l.length;r<q;++r){if(l[0].isAnimated){o.unRegister(l[0],0)}}l=[];m=null;k=0}else{o.unRegister(s)}},run:function(){var t,s,q,r;for(s=0,q=l.length;s<q;s++){r=l[s];if(r&&r.isAnimated){t=r.totalFrames;if(r.curFrame<t||t===null){++r.curFrame;if(r.useSec){n(r)}r._onTween.fire()}else{o.stop(r)}}}}});var p=function(s){var r,q;for(r=0,q=l.length;r<q;r++){if(l[r]===s){return r}}return -1};var n=function(r){var v=r.totalFrames,u=r.curFrame,t=r.duration,s=(u*t*1000/v),q=(e()-r.startTime),w=0;if(q<t*1000){w=Math.round((q/s-1)*u)}else{w=v-(u+1)}if(w>0&&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;l<r;++l){m[l]=[p[l][0],p[l][1]]}for(k=1;k<r;++k){for(l=0;l<r-k;++l){m[l][0]=q*m[l][0]+o*m[parseInt(l+1,10)][0];m[l][1]=q*m[l][1]+o*m[parseInt(l+1,10)][1]}}return[m[0][0],m[0][1]]}};g.Easing={easeNone:function(l,k,n,m){return n*l/m+k},easeIn:function(l,k,n,m){return n*(l/=m)*l+k},easeOut:function(l,k,n,m){return -n*(l/=m)*(l-2)+k}};(function(){g.Motion=function(o,n,p,q){if(o){g.Motion.superclass.constructor.call(this,o,n,p,q)}};Ext.extend(g.Motion,Ext.lib.AnimBase);var m=g.Motion.superclass,l=/^points$/i;Ext.apply(g.Motion.prototype,{setAttr:function(n,r,q){var p=this,o=m.setAttr;if(l.test(n)){q=q||"px";o.call(p,"left",r[0],q);o.call(p,"top",r[1],q)}else{o.call(p,n,r,q)}},getAttr:function(n){var p=this,o=m.getAttr;return l.test(n)?[o.call(p,"left"),o.call(p,"top")]:o.call(p,n)},doMethod:function(n,q,o){var p=this;return l.test(n)?g.Bezier.getPosition(p.runAttrs[n],p.method(p.curFrame,0,100,p.totalFrames)/100):m.doMethod.call(p,n,q,o)},setRunAttr:function(u){if(l.test(u)){var w=this,p=this.el,z=this.attributes.points,s=z.control||[],x=z.from,y=z.to,v=z.by,A=g.Dom,o,r,q,t,n;if(s.length>0&&!Ext.isArray(s[0])){s=[s]}else{}Ext.fly(p,"_anim").position();A.setXY(p,j(x)?x:A.getXY(p));o=w.getAttr("points");if(j(y)){q=k.call(w,y,o);for(r=0,t=s.length;r<t;++r){s[r]=k.call(w,s[r],o)}}else{if(j(v)){q=[o[0]+v[0],o[1]+v[1]];for(r=0,t=s.length;r<t;++r){s[r]=[o[0]+s[r][0],o[1]+s[r][1]]}}}n=this.runAttrs[u]=[o];if(s.length>0){n=n.concat(s)}n[n.length]=q}else{m.setRunAttr.call(this,u)}}});var k=function(n,p){var o=g.Dom.getXY(this.el);return[n[0]-o[0]+p[0],n[1]-o[1]+p[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<l/2)?f.Easing.bounceIn(k*2,0,m,l)*0.5+j:f.Easing.bounceOut(k*2-l,0,m,l)*0.5+m*0.5+j}})})();(function(){var h=Ext.lib;h.Anim.color=function(p,n,q,r,m,o){return h.Anim.run(p,n,q,r,m,o,h.ColorAnim)};h.ColorAnim=function(n,m,o,p){h.ColorAnim.superclass.constructor.call(this,n,m,o,p)};Ext.extend(h.ColorAnim,h.AnimBase);var j=h.ColorAnim.superclass,i=/color$/i,f=/^transparent|rgba\(0, 0, 0, 0\)$/,l=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,d=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,e=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i,g=function(m){return typeof m!=="undefined"};function k(n){var p=parseInt,o,m=null,q;if(n.length==3){return n}Ext.each([d,l,e],function(s,r){o=(r%2==0)?16:10;q=s.exec(n);if(q&&q.length==4){m=[p(q[1],o),p(q[2],o),p(q[3],o)];return false}});return m}Ext.apply(h.ColorAnim.prototype,{getAttr:function(m){var o=this,n=o.el,p;if(i.test(m)){while(n&&f.test(p=Ext.fly(n).getStyle(m))){n=n.parentNode;p="fff"}}else{p=j.getAttr.call(o,m)}return p},doMethod:function(s,m,o){var t=this,n,q=Math.floor,p,r,u;if(i.test(s)){n=[];o=o||[];for(p=0,r=m.length;p<r;p++){u=m[p];n[p]=j.doMethod.call(t,s,u,o[p])}n="rgb("+q(n[0])+","+q(n[1])+","+q(n[2])+")"}else{n=j.doMethod.call(t,s,m,o)}return n},setRunAttr:function(r){var t=this,u=t.attributes[r],v=u.to,s=u.by,n;j.setRunAttr.call(t,r);n=t.runAttrs[r];if(i.test(r)){var m=k(n.start),o=k(n.end);if(!g(v)&&g(s)){o=k(s);for(var p=0,q=m.length;p<q;p++){o[p]=m[p]+o[p]}}n.start=m;n.end=o}}})})();(function(){var d=Ext.lib;d.Anim.scroll=function(j,h,k,l,g,i){return d.Anim.run(j,h,k,l,g,i,d.Scroll)};d.Scroll=function(h,g,i,j){if(h){d.Scroll.superclass.constructor.call(this,h,g,i,j)}};Ext.extend(d.Scroll,d.ColorAnim);var f=d.Scroll.superclass,e="scroll";Ext.apply(d.Scroll.prototype,{doMethod:function(g,m,h){var k,j=this,l=j.curFrame,i=j.totalFrames;if(g==e){k=[j.method(l,m[0],h[0]-m[0],i),j.method(l,m[1],h[1]-m[1],i)]}else{k=f.doMethod.call(j,g,m,h)}return k},getAttr:function(g){var h=this;if(g==e){return[h.el.scrollLeft,h.el.scrollTop]}else{return f.getAttr.call(h,g)}},setAttr:function(g,j,i){var h=this;if(g==e){h.el.scrollLeft=j[0];h.el.scrollTop=j[1]}else{f.setAttr.call(h,g,j,i)}}})})();if(Ext.isIE9m){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