1){ out.push("',actions.between,'"); } \n');
+ }
+ },
+
+ doForEach: function (action, actions) {
+ var me = this,
+ s,
+ L = me.level,
+ up = L-1,
+ parentAssignment;
+
+
+ if (action === '.') {
+ s = 'values';
+ } else if (me.propNameRe.test(action)) {
+ s = me.parseTag(action);
+ }
+
+ else {
+ s = me.addFn(action) + me.callFn;
+ }
+
+
+
+
+ if (me.maxLevel < L) {
+ me.maxLevel = L;
+ me.body.push('var ');
+ }
+
+ if (action == '.') {
+ parentAssignment = 'c' + L;
+ } else {
+ parentAssignment = 'a' + up + '?c' + up + '[i' + up + ']:c' + up;
+ }
+
+ me.body.push('i',L,'=-1,n',L,'=0,c',L,'=',s,',a',L,'=',me.createArrayTest(L),',r',L,'=values,p',L,',k',L,';\n',
+ 'p',L,'=parent=',parentAssignment,'\n',
+ 'for(k',L,' in c',L,'){\n',
+ 'xindex=++i',L,'+1;\n',
+ 'xkey=k',L,';\n',
+ 'values=c',L,'[k',L,'];');
+ if (actions.propName) {
+ me.body.push('.', actions.propName);
+ }
+
+ if (actions.between) {
+ me.body.push('if(xindex>1){ out.push("',actions.between,'"); } \n');
+ }
+ },
+
+ createArrayTest: ('isArray' in Array) ? function(L) {
+ return 'Array.isArray(c' + L + ')';
+ } : function(L) {
+ return 'ts.call(c' + L + ')==="[object Array]"';
+ },
+
+ doExec: function (action, actions) {
+ var me = this,
+ name = 'f' + me.definitions.length;
+
+ me.definitions.push('function ' + name + '(' + me.fnArgs + ') {',
+ ' try { with(values) {',
+ ' ' + action,
+ ' }} catch(e) {',
+ '}',
+ '}');
+
+ me.body.push(name + me.callFn + '\n');
+ },
+
+
+
+
+ addFn: function (body) {
+ var me = this,
+ name = 'f' + me.definitions.length;
+
+ if (body === '.') {
+ me.definitions.push('function ' + name + '(' + me.fnArgs + ') {',
+ ' return values',
+ '}');
+ } else if (body === '..') {
+ me.definitions.push('function ' + name + '(' + me.fnArgs + ') {',
+ ' return parent',
+ '}');
+ } else {
+ me.definitions.push('function ' + name + '(' + me.fnArgs + ') {',
+ ' try { with(values) {',
+ ' return(' + body + ')',
+ ' }} catch(e) {',
+ '}',
+ '}');
+ }
+
+ return name;
+ },
+
+ parseTag: function (tag) {
+ var me = this,
+ m = me.tagRe.exec(tag),
+ name, format, args, math, v;
+
+ if (!m) {
+ return null;
+ }
+
+ name = m[1];
+ format = m[2];
+ args = m[3];
+ math = m[4];
+
+
+ if (name == '.') {
+
+ if (!me.validTypes) {
+ me.definitions.push('var validTypes={string:1,number:1,boolean:1};');
+ me.validTypes = true;
+ }
+ v = 'validTypes[typeof values] || ts.call(values) === "[object Date]" ? values : ""';
+ }
+
+ else if (name == '#') {
+ v = 'xindex';
+ }
+
+ else if (name == '$') {
+ v = 'xkey';
+ }
+ else if (name.substr(0, 7) == "parent.") {
+ v = name;
+ }
+
+ else if (isNaN(name) && name.indexOf('-') == -1 && name.indexOf('.') != -1) {
+ v = "values." + name;
+ }
+
+
+ else {
+ v = "values['" + name + "']";
+ }
+
+ if (math) {
+ v = '(' + v + math + ')';
+ }
+
+ if (format && me.useFormat) {
+ args = args ? ',' + args : "";
+ if (format.substr(0, 5) != "this.") {
+ format = "fm." + format + '(';
+ } else {
+ format += '(';
+ }
+ } else {
+ return v;
+ }
+
+ return format + v + args + ')';
+ },
+
+
+ evalTpl: function ($) {
+
+
+
+
+
+ eval($);
+ return $;
+ },
+
+ newLineRe: /\r\n|\r|\n/g,
+ aposRe: /[']/g,
+ intRe: /^\s*(\d+)\s*$/,
+ tagRe: /^([\w-\.\#\$]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\/]\s?[\d\.\+\-\*\/\(\)]+)?$/
+
+}, function () {
+ var proto = this.prototype;
+
+ proto.fnArgs = 'out,values,parent,xindex,xcount,xkey';
+ proto.callFn = '.call(this,' + proto.fnArgs + ')';
+});
+
+// @tag core
+/**
+ * A template class that supports advanced functionality like:
+ *
+ * - Autofilling arrays using templates and sub-templates
+ * - Conditional processing with basic comparison operators
+ * - Basic math function support
+ * - Execute arbitrary inline code with special built-in template variables
+ * - Custom member functions
+ * - Many special tags and built-in operators that aren't defined as part of the API, but are supported in the templates that can be created
+ *
+ * XTemplate provides the templating mechanism built into {@link Ext.view.View}.
+ *
+ * The {@link Ext.Template} describes the acceptable parameters to pass to the constructor. The following examples
+ * demonstrate all of the supported features.
+ *
+ * # Sample Data
+ *
+ * This is the data object used for reference in each code example:
+ *
+ * var data = {
+ * name: 'Don Griffin',
+ * title: 'Senior Technomage',
+ * company: 'Sencha Inc.',
+ * drinks: ['Coffee', 'Water', 'More Coffee'],
+ * kids: [
+ * { name: 'Aubrey', age: 17 },
+ * { name: 'Joshua', age: 13 },
+ * { name: 'Cale', age: 10 },
+ * { name: 'Nikol', age: 5 },
+ * { name: 'Solomon', age: 0 }
+ * ]
+ * };
+ *
+ * # Auto filling of arrays
+ *
+ * The **tpl** tag and the **for** operator are used to process the provided data object:
+ *
+ * - If the value specified in for is an array, it will auto-fill, repeating the template block inside the tpl
+ * tag for each item in the array.
+ * - If for="." is specified, the data object provided is examined.
+ * - If between="..." is specified, the provided value will be inserted between the items.
+ * This is also supported in the "foreach" looping template.
+ * - While processing an array, the special variable {#} will provide the current array index + 1 (starts at 1, not 0).
+ *
+ * Examples:
+ *
+ * ...
+ * ...
+ * ...
+ * ...
+ *
+ * Using the sample data above:
+ *
+ * var tpl = new Ext.XTemplate(
+ * 'Kids: ',
+ * '',
+ * '{#}. {name}
',
+ * '
'
+ * );
+ * tpl.overwrite(panel.body, data.kids);
+ *
+ * An example illustrating how the **for** property can be leveraged to access specified members of the provided data
+ * object to populate the template:
+ *
+ * var tpl = new Ext.XTemplate(
+ * 'Name: {name}
',
+ * 'Title: {title}
',
+ * 'Company: {company}
',
+ * 'Kids: ',
+ * '',
+ * '{name}
',
+ * '
'
+ * );
+ * tpl.overwrite(panel.body, data);
+ *
+ * Flat arrays that contain values (and not objects) can be auto-rendered using the special **`{.}`** variable inside a
+ * loop. This variable will represent the value of the array at the current index:
+ *
+ * var tpl = new Ext.XTemplate(
+ * '{name}\'s favorite beverages:
',
+ * '',
+ * ' - {.}
',
+ * ''
+ * );
+ * tpl.overwrite(panel.body, data);
+ *
+ * When processing a sub-template, for example while looping through a child array, you can access the parent object's
+ * members via the **parent** object:
+ *
+ * var tpl = new Ext.XTemplate(
+ * 'Name: {name}
',
+ * 'Kids: ',
+ * '',
+ * '',
+ * '{name}
',
+ * 'Dad: {parent.name}
',
+ * '',
+ * '
'
+ * );
+ * tpl.overwrite(panel.body, data);
+ *
+ * The **foreach** operator is used to loop over an object's properties. The following
+ * example demonstrates looping over the main data object's properties:
+ *
+ * var tpl = new Ext.XTemplate(
+ * '',
+ * '',
+ * '- {$}
', // the special **`{$}`** variable contains the property name
+ * '- {.}
', // within the loop, the **`{.}`** variable is set to the property value
+ * '',
+ * '
'
+ * );
+ * tpl.overwrite(panel.body, data);
+ *
+ * # Conditional processing with basic comparison operators
+ *
+ * The **tpl** tag and the **if** operator are used to provide conditional checks for deciding whether or not to render
+ * specific parts of the template.
+ *
+ * Using the sample data above:
+ *
+ * var tpl = new Ext.XTemplate(
+ * 'Name: {name}
',
+ * 'Kids: ',
+ * '',
+ * '',
+ * '{name}
',
+ * '',
+ * '
'
+ * );
+ * tpl.overwrite(panel.body, data);
+ *
+ * More advanced conditionals are also supported:
+ *
+ * var tpl = new Ext.XTemplate(
+ * 'Name: {name}
',
+ * 'Kids: ',
+ * '',
+ * '{name} is a ',
+ * '',
+ * 'teenager
',
+ * '',
+ * 'kid
',
+ * '',
+ * 'baby
',
+ * '',
+ * '
'
+ * );
+ *
+ * var tpl = new Ext.XTemplate(
+ * 'Name: {name}
',
+ * 'Kids: ',
+ * '',
+ * '{name} is a ',
+ * '',
+ * '',
+ * 'girl
',
+ * '',
+ * 'boy
',
+ * '',
+ * '
'
+ * );
+ *
+ * A `break` is implied between each case and default, however, multiple cases can be listed
+ * in a single <tpl> tag.
+ *
+ * # Using double quotes
+ *
+ * Examples:
+ *
+ * var tpl = new Ext.XTemplate(
+ * "Child",
+ * "Teenager",
+ * "...",
+ * '...',
+ * "
",
+ * "Hello"
+ * );
+ *
+ * # Basic math support
+ *
+ * The following basic math operators may be applied directly on numeric data values:
+ *
+ * + - * /
+ *
+ * For example:
+ *
+ * var tpl = new Ext.XTemplate(
+ * 'Name: {name}
',
+ * 'Kids: ',
+ * '',
+ * '',
+ * '{#}: {name}
',
+ * 'In 5 Years: {age+5}
',
+ * 'Dad: {parent.name}
',
+ * '',
+ * '
'
+ * );
+ * tpl.overwrite(panel.body, data);
+ *
+ * # Execute arbitrary inline code with special built-in template variables
+ *
+ * Anything between `{[ ... ]}` is considered code to be executed in the scope of the template.
+ * The expression is evaluated and the result is included in the generated result. There are
+ * some special variables available in that code:
+ *
+ * - **out**: The output array into which the template is being appended (using `push` to later
+ * `join`).
+ * - **values**: The values in the current scope. If you are using scope changing sub-templates,
+ * you can change what values is.
+ * - **parent**: The scope (values) of the ancestor template.
+ * - **xindex**: If you are in a "for" or "foreach" looping template, the index of the loop you are in (1-based).
+ * - **xcount**: If you are in a "for" looping template, the total length of the array you are looping.
+ * - **xkey**: If you are in a "foreach" looping template, the key of the current property
+ * being examined.
+ *
+ * This example demonstrates basic row striping using an inline code block and the xindex variable:
+ *
+ * var tpl = new Ext.XTemplate(
+ * 'Name: {name}
',
+ * 'Company: {[values.company.toUpperCase() + ", " + values.title]}
',
+ * 'Kids: ',
+ * '',
+ * '',
+ * '{name}',
+ * '
',
+ * '
'
+ * );
+ *
+ * Any code contained in "verbatim" blocks (using "{% ... %}") will be inserted directly in
+ * the generated code for the template. These blocks are not included in the output. This
+ * can be used for simple things like break/continue in a loop, or control structures or
+ * method calls (when they don't produce output). The `this` references the template instance.
+ *
+ * var tpl = new Ext.XTemplate(
+ * 'Name: {name}
',
+ * 'Company: {[values.company.toUpperCase() + ", " + values.title]}
',
+ * 'Kids: ',
+ * '',
+ * '{% if (xindex % 2 === 0) continue; %}',
+ * '{name}',
+ * '{% if (xindex > 100) break; %}',
+ * '',
+ * '
'
+ * );
+ *
+ * # Template member functions
+ *
+ * One or more member functions can be specified in a configuration object passed into the XTemplate constructor for
+ * more complex processing:
+ *
+ * var tpl = new Ext.XTemplate(
+ * 'Name: {name}
',
+ * 'Kids: ',
+ * '',
+ * '',
+ * 'Girl: {name} - {age}
',
+ * '',
+ * 'Boy: {name} - {age}
',
+ * '',
+ * '',
+ * '{name} is a baby!
',
+ * '',
+ * '
',
+ * {
+ * // XTemplate configuration:
+ * disableFormats: true,
+ * // member functions:
+ * isGirl: function(name){
+ * return name == 'Aubrey' || name == 'Nikol';
+ * },
+ * isBaby: function(age){
+ * return age < 1;
+ * }
+ * }
+ * );
+ * tpl.overwrite(panel.body, data);
+ */
+Ext.define('Ext.XTemplate', {
+ extend: Ext.Template ,
+
+
+
+ /**
+ * @private
+ */
+ emptyObj: {},
+
+ /**
+ * @cfg {Boolean} compiled
+ * Only applies to {@link Ext.Template}, XTemplates are compiled automatically on the
+ * first call to {@link #apply} or {@link #applyOut}.
+ * @hide
+ */
+
+ /**
+ * @cfg {String/Array} definitions
+ * Optional. A statement, or array of statements which set up `var`s which may then
+ * be accessed within the scope of the generated function.
+ */
+
+ apply: function(values, parent) {
+ return this.applyOut(values, [], parent).join('');
+ },
+
+ applyOut: function(values, out, parent) {
+ var me = this,
+ compiler;
+
+ if (!me.fn) {
+ compiler = new Ext.XTemplateCompiler({
+ useFormat: me.disableFormats !== true,
+ definitions: me.definitions
+ });
+
+ me.fn = compiler.compile(me.html);
+ }
+
+ try {
+ me.fn(out, values, parent || me.emptyObj, 1, 1);
+ } catch (e) {
+ }
+
+ return out;
+ },
+
+ /**
+ * Does nothing. XTemplates are compiled automatically, so this function simply returns this.
+ * @return {Ext.XTemplate} this
+ */
+ compile: function() {
+ return this;
+ },
+
+ statics: {
+ /**
+ * Gets an `XTemplate` from an object (an instance of an {@link Ext#define}'d class).
+ * Many times, templates are configured high in the class hierarchy and are to be
+ * shared by all classes that derive from that base. To further complicate matters,
+ * these templates are seldom actual instances but are rather configurations. For
+ * example:
+ *
+ * Ext.define('MyApp.Class', {
+ * extraCls: 'extra-class',
+ *
+ * someTpl: [
+ * '',
+ * {
+ *
+ * emitClass: function(out) {
+ * out.push(this.owner.extraCls);
+ * }
+ * }]
+ * });
+ *
+ * The goal being to share that template definition with all instances and even
+ * instances of derived classes, until `someTpl` is overridden. This method will
+ * "upgrade" these configurations to be real `XTemplate` instances *in place* (to
+ * avoid creating one instance per object).
+ *
+ * The resulting XTemplate will have an `owner` reference injected which refers back
+ * to the owning object whether that is an object which has an *own instance*, or a
+ * class prototype. Through this link, XTemplate member functions will be able to access
+ * prototype properties of its owning class.
+ *
+ * @param {Object} instance The object from which to get the `XTemplate` (must be
+ * an instance of an {@link Ext#define}'d class).
+ * @param {String} name The name of the property by which to get the `XTemplate`.
+ * @return {Ext.XTemplate} The `XTemplate` instance or null if not found.
+ * @protected
+ * @static
+ */
+ getTpl: function (instance, name) {
+ var tpl = instance[name], // go for it! 99% of the time we will get it!
+ owner;
+
+ if (tpl && !tpl.isTemplate) { // tpl is just a configuration (not an instance)
+ // create the template instance from the configuration:
+ tpl = Ext.ClassManager.dynInstantiate('Ext.XTemplate', tpl);
+
+ // and replace the reference with the new instance:
+ if (instance.hasOwnProperty(name)) { // the tpl is on the instance
+ owner = instance;
+ } else { // must be somewhere in the prototype chain
+ for (owner = instance.self.prototype; owner && !owner.hasOwnProperty(name); owner = owner.superclass) {
+ }
+ }
+ owner[name] = tpl;
+ tpl.owner = owner;
+ }
+ // else !tpl (no such tpl) or the tpl is an instance already... either way, tpl
+ // is ready to return
+
+ return tpl || null;
+ }
+ }
+});
+
+// @tag dom,core
+// @require Helper.js
+// @define Ext.dom.Query
+// @define Ext.core.DomQuery
+// @define Ext.DomQuery
+
+/*
+ * This is code is also distributed under MIT license for use
+ * with jQuery and prototype JavaScript libraries.
+ */
+/**
+ * @class Ext.dom.Query
+ * @alternateClassName Ext.DomQuery
+ * @alternateClassName Ext.core.DomQuery
+ * @singleton
+ *
+ * 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).
+ *
+ * DomQuery supports most of the [CSS3 selectors spec][1], along with some custom selectors and basic XPath.
+ *
+ * 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.
+ *
+ * ## Element Selectors:
+ *
+ * - **`*`** any element
+ * - **`E`** an element with the tag E
+ * - **`E F`** All descendent elements of E that have the tag F
+ * - **`E > F`** or **E/F** all direct children elements of E that have the tag F
+ * - **`E + F`** all elements with the tag F that are immediately preceded by an element with the tag E
+ * - **`E ~ F`** all elements with the tag F that are preceded by a sibling element with the tag E
+ *
+ * ## Attribute Selectors:
+ *
+ * The use of `@` and quotes are optional. For example, `div[@foo='bar']` is also a valid attribute selector.
+ *
+ * - **`E[foo]`** has an attribute "foo"
+ * - **`E[foo=bar]`** has an attribute "foo" that equals "bar"
+ * - **`E[foo^=bar]`** has an attribute "foo" that starts with "bar"
+ * - **`E[foo$=bar]`** has an attribute "foo" that ends with "bar"
+ * - **`E[foo*=bar]`** has an attribute "foo" that contains the substring "bar"
+ * - **`E[foo%=2]`** has an attribute "foo" that is evenly divisible by 2
+ * - **`E[foo!=bar]`** attribute "foo" does not equal "bar"
+ *
+ * ## Pseudo Classes:
+ *
+ * - **`E:first-child`** E is the first child of its parent
+ * - **`E:last-child`** E is the last child of its parent
+ * - **`E:nth-child(_n_)`** E is the _n_th child of its parent (1 based as per the spec)
+ * - **`E:nth-child(odd)`** E is an odd child of its parent
+ * - **`E:nth-child(even)`** E is an even child of its parent
+ * - **`E:only-child`** E is the only child of its parent
+ * - **`E:checked`** E is an element that is has a checked attribute that is true (e.g. a radio or checkbox)
+ * - **`E:first`** the first E in the resultset
+ * - **`E:last`** the last E in the resultset
+ * - **`E:nth(_n_)`** the _n_th E in the resultset (1 based)
+ * - **`E:odd`** shortcut for :nth-child(odd)
+ * - **`E:even`** shortcut for :nth-child(even)
+ * - **`E:contains(foo)`** E's innerHTML contains the substring "foo"
+ * - **`E:nodeValue(foo)`** E contains a textNode with a nodeValue that equals "foo"
+ * - **`E:not(S)`** an E element that does not match simple selector S
+ * - **`E:has(S)`** an E element that has a descendent that matches simple selector S
+ * - **`E:next(S)`** an E element whose next sibling matches simple selector S
+ * - **`E:prev(S)`** an E element whose previous sibling matches simple selector S
+ * - **`E:any(S1|S2|S2)`** an E element which matches any of the simple selectors S1, S2 or S3
+ * - **`E:visible(true)`** an E element which is deeply visible according to {@link Ext.dom.Element#isVisible}
+ *
+ * ## CSS Value Selectors:
+ *
+ * - **`E{display=none}`** css value "display" that equals "none"
+ * - **`E{display^=none}`** css value "display" that starts with "none"
+ * - **`E{display$=none}`** css value "display" that ends with "none"
+ * - **`E{display*=none}`** css value "display" that contains the substring "none"
+ * - **`E{display%=2}`** css value "display" that is evenly divisible by 2
+ * - **`E{display!=none}`** css value "display" that does not equal "none"
+ *
+ * ## XML Namespaces:
+ * - **`ns|E`** an element with tag E and namespace prefix ns
+ *
+ * [1]: http:
+ */
+Ext.ns('Ext.core');
+
+Ext.dom.Query = Ext.core.DomQuery = Ext.DomQuery = (function() {
+ var DQ,
+ doc = document,
+ cache = {},
+ simpleCache = {},
+ valueCache = {},
+ useClassList = !!doc.documentElement.classList,
+ useElementPointer = !!doc.documentElement.firstElementChild,
+ useChildrenCollection = (function() {
+ var d = doc.createElement('div');
+ d.innerHTML = 'text';
+ return d.children && (d.children.length === 0);
+ })(),
+ nonSpace = /\S/,
+ trimRe = /^\s+|\s+$/g,
+ tplRe = /\{(\d+)\}/g,
+ modeRe = /^(\s?[\/>+~]\s?|\s|$)/,
+ tagTokenRe = /^(#)?([\w\-\*\|\\]+)/,
+ nthRe = /(\d*)n\+?(\d*)/,
+ nthRe2 = /\D/,
+ startIdRe = /^\s*#/,
+
+
+
+ isIE = window.ActiveXObject ? true : false,
+ key = 30803,
+ longHex = /\\([0-9a-fA-F]{6})/g,
+ shortHex = /\\([0-9a-fA-F]{1,6})\s{0,1}/g,
+ nonHex = /\\([^0-9a-fA-F]{1})/g,
+ escapes = /\\/g,
+ num, hasEscapes,
+
+
+ supportsColonNsSeparator = (function () {
+ var xmlDoc,
+ xmlString = '';
+
+ if (window.DOMParser) {
+ xmlDoc = (new DOMParser()).parseFromString(xmlString, "application/xml");
+ } else {
+ xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
+ xmlDoc.loadXML(xmlString);
+ }
+
+ return !!xmlDoc.getElementsByTagName('a:b').length;
+ })(),
+
+
+
+ longHexToChar = function($0, $1) {
+ return String.fromCharCode(parseInt($1, 16));
+ },
+
+
+ shortToLongHex = function($0, $1) {
+ while ($1.length < 6) {
+ $1 = '0' + $1;
+ }
+ return '\\' + $1;
+ },
+
+
+ charToLongHex = function($0, $1) {
+ num = $1.charCodeAt(0).toString(16);
+ if (num.length === 1) {
+ num = '0' + num;
+ }
+ return '\\0000' + num;
+ },
+
+
+
+
+ unescapeCssSelector = function(selector) {
+ return (hasEscapes) ? selector.replace(longHex, longHexToChar) : selector;
+ },
+
+
+ setupEscapes = function(path) {
+ hasEscapes = (path.indexOf('\\') > -1);
+ if (hasEscapes) {
+ path = path
+ .replace(shortHex, shortToLongHex)
+ .replace(nonHex, charToLongHex)
+ .replace(escapes, '\\\\');
+ }
+ return path;
+ };
+
+
+
+ eval("var batch = 30803, child, next, prev, byClassName;");
+
+
+
+ child = useChildrenCollection ?
+ function child(parent, index) {
+ return parent.children[index];
+ } :
+ 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;
+ };
+
+
+ next = useElementPointer ?
+ function(n) {
+ return n.nextElementSibling;
+ } :
+ function(n) {
+ while ((n = n.nextSibling) && n.nodeType != 1);
+ return n;
+ };
+
+
+ prev = useElementPointer ?
+ function(n) {
+ return n.previousElementSibling;
+ } :
+ function(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;
+ }
+
+
+
+ byClassName = useClassList ?
+ function (nodeSet, cls) {
+ cls = unescapeCssSelector(cls);
+ if (!cls) {
+ return nodeSet;
+ }
+ var result = [], ri = -1,
+ i, ci, classList;
+
+ for (i = 0; ci = nodeSet[i]; i++) {
+ classList = ci.classList;
+ if (classList) {
+ if (classList.contains(cls)) {
+ result[++ri] = ci;
+ }
+ } else if ((' ' + ci.className + ' ').indexOf(cls) !== -1) {
+
+
+ result[++ri] = ci;
+ }
+ }
+ return result;
+ } :
+ function (nodeSet, cls) {
+ cls = unescapeCssSelector(cls);
+ if (!cls) {
+ return nodeSet;
+ }
+ var result = [], ri = -1,
+ i, ci;
+
+ for (i = 0; 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,
+ i, ni, j, ci, cn, utag, n, cj;
+ if (!ns) {
+ return result;
+ }
+ tagName = tagName.replace('|', ':') || "*";
+
+ if (typeof ns.getElementsByTagName != "undefined") {
+ ns = [ns];
+ }
+
+
+
+ if (!mode) {
+ tagName = unescapeCssSelector(tagName);
+ if (!supportsColonNsSeparator && DQ.isXml(ns[0]) &&
+ tagName.indexOf(':') !== -1) {
+
+
+
+
+
+
+ for (i = 0; ni = ns[i]; i++) {
+ cs = ni.getElementsByTagName(tagName.split(':').pop());
+ for (j = 0; ci = cs[j]; j++) {
+ if (ci.tagName === tagName) {
+ result[++ri] = ci;
+ }
+ }
+ }
+ } else {
+ for (i = 0; ni = ns[i]; i++) {
+ cs = ni.getElementsByTagName(tagName);
+ for (j = 0; ci = cs[j]; j++) {
+ result[++ri] = ci;
+ }
+ }
+ }
+
+
+ } else if (mode == "/" || mode == ">") {
+ utag = tagName.toUpperCase();
+ for (i = 0; ni = ns[i]; i++) {
+ cn = ni.childNodes;
+ for (j = 0; cj = cn[j]; j++) {
+ if (cj.nodeName == utag || cj.nodeName == tagName || tagName == '*') {
+ result[++ri] = cj;
+ }
+ }
+ }
+
+
+ } else if (mode == "+") {
+ utag = tagName.toUpperCase();
+ for (i = 0; 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 == "~") {
+ utag = tagName.toUpperCase();
+ for (i = 0; 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) {
+ a.push.apply(a, b);
+ return a;
+ }
+
+ function byTag(cs, tagName) {
+ if (cs.tagName || cs === doc) {
+ cs = [cs];
+ }
+ if (!tagName) {
+ return cs;
+ }
+ var result = [], ri = -1,
+ i, ci;
+ tagName = tagName.toLowerCase();
+ for (i = 0; ci = cs[i]; i++) {
+ if (ci.nodeType == 1 && ci.tagName.toLowerCase() == tagName) {
+ result[++ri] = ci;
+ }
+ }
+ return result;
+ }
+
+ function byId(cs, id) {
+ id = unescapeCssSelector(id);
+ if (cs.tagName || cs === doc) {
+ cs = [cs];
+ }
+ if (!id) {
+ return cs;
+ }
+ var result = [], ri = -1,
+ i, ci;
+ for (i = 0; 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 = DQ.operators[op],
+ a,
+ xml,
+ hasXml,
+ i, ci;
+
+ value = unescapeCssSelector(value);
+
+ for (i = 0; ci = cs[i]; i++) {
+
+ if (ci.nodeType === 1) {
+
+ if (!hasXml) {
+ xml = DQ.isXml(ci);
+ hasXml = true;
+ }
+
+
+ if (!xml) {
+ if (useGetStyle) {
+ a = DQ.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) {
+ value = unescapeCssSelector(value);
+ return DQ.pseudos[name](cs, value);
+ }
+
+ function nodupIEXml(cs) {
+ var d = ++key,
+ r,
+ i, len, c;
+ cs[0].setAttribute("_nodup", d);
+ r = [cs[0]];
+ for (i = 1, len = cs.length; i < len; i++) {
+ c = cs[i];
+ if (!c.getAttribute("_nodup") != d) {
+ c.setAttribute("_nodup", d);
+ r[r.length] = c;
+ }
+ }
+ for (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, d, j;
+ if (!len || typeof cs.nodeType != "undefined" || len == 1) {
+ return cs;
+ }
+ if (isIE && typeof cs[0].selectSingleNode != "undefined") {
+ return nodupIEXml(cs);
+ }
+ d = ++key;
+ cs[0]._nodup = d;
+ for (i = 1; c = cs[i]; i++) {
+ if (c._nodup != d) {
+ c._nodup = d;
+ } else {
+ r = [];
+ for (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 = [],
+ i, len;
+ for (i = 0, len = c1.length; i < len; i++) {
+ c1[i].setAttribute("_qdiff", d);
+ }
+ for (i = 0, len = c2.length; i < len; i++) {
+ if (c2[i].getAttribute("_qdiff") != d) {
+ r[r.length] = c2[i];
+ }
+ }
+ for (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 = [],
+ i, len;
+ if (!len1) {
+ return c2;
+ }
+ if (isIE && typeof c1[0].selectSingleNode != "undefined") {
+ return quickDiffIEXml(c1, c2);
+ }
+ for (i = 0; i < len1; i++) {
+ c1[i]._qdiff = d;
+ }
+ for (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) {
+ id = unescapeCssSelector(id);
+ var d = root.ownerDocument || root;
+ return d.getElementById(id);
+ }
+ ns = getNodes(ns, mode, "*");
+ return byId(ns, id);
+ }
+
+ return DQ = {
+ getStyle: function(el, name) {
+ return Ext.fly(el, '_DomQuery').getStyle(name);
+ },
+
+ compile: function(path, type) {
+ type = type || "select";
+
+
+ var fn = ["var f = function(root) {\n var mode; ++batch; var n = root || document;\n"],
+ lastPath,
+ matchers = DQ.matchers,
+ matchersLn = matchers.length,
+ modeMatch,
+
+ lmode = path.match(modeRe),
+ tokenMatch, matched, j, t, m;
+
+ path = setupEscapes(path);
+
+ 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;
+ 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))) {
+ matched = false;
+ for (j = 0; j < matchersLn; j++) {
+ t = matchers[j];
+ 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) {
+ Ext.Error.raise({
+ sourceClass:'Ext.DomQuery',
+ sourceMethod:'compile',
+ msg:'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 || doc;
+
+ if (typeof root == "string") {
+ root = doc.getElementById(root);
+ }
+ var paths = path.split(","),
+ results = [],
+ i, len, subPath, result;
+
+
+ for (i = 0, len = paths.length; i < len; i++) {
+ subPath = paths[i].replace(trimRe, "");
+
+ if (!cache[subPath]) {
+
+ cache[subPath] = DQ.compile(subPath, type);
+ if (!cache[subPath]) {
+ Ext.Error.raise({
+ sourceClass:'Ext.DomQuery',
+ sourceMethod:'jsSelect',
+ msg:subPath + ' is not a valid selector'
+ });
+ }
+ } else {
+
+
+ setupEscapes(subPath);
+ }
+ result = cache[subPath](root);
+ if (result && result !== doc) {
+ 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 : doc.querySelectorAll ? function(path, root, type, single) {
+ root = root || doc;
+ if (!DQ.isXml(root)) {
+ try {
+
+ if (root.parentNode && (root.nodeType !== 9) && path.indexOf(',') === -1 && !startIdRe.test(path)) {
+ path = '#' + Ext.escapeId(Ext.id(root)) + ' ' + path;
+ root = root.parentNode;
+ }
+ return single ? [ root.querySelector(path) ]
+ : Ext.Array.toArray(root.querySelectorAll(path));
+ }
+ catch (e) {
+ }
+ }
+ return DQ.jsSelect.call(this, path, root, type);
+ } : function(path, root, type) {
+ return DQ.jsSelect.call(this, path, root, type);
+ },
+
+
+ selectNode : function(path, root){
+ return Ext.DomQuery.select(path, root, null, true)[0];
+ },
+
+
+ selectValue: function(path, root, defaultValue) {
+ path = path.replace(trimRe, "");
+ if (!valueCache[path]) {
+ valueCache[path] = DQ.compile(path, "select");
+ } else {
+ setupEscapes(path);
+ }
+
+ 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 = DQ.selectValue(path, root, defaultValue || 0);
+ return parseFloat(v);
+ },
+
+
+ is: function(el, ss) {
+ if (typeof el == "string") {
+ el = doc.getElementById(el);
+ }
+ var isArray = Ext.isArray(el),
+ result = DQ.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] = DQ.compile(ss, "simple");
+ } else {
+ setupEscapes(ss);
+ }
+
+ var result = simpleCache[ss](els);
+ return nonMatches ? quickDiff(result, els) : result;
+ },
+
+
+ matchers: [{
+ re: /^\.([\w\-\\]+)/,
+ select: useClassList ? 'n = byClassName(n, "{1}");' : 'n = byClassName(n, " {1} ");'
+ }, {
+ re: /^\:([\w\-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,
+ select: 'n = byPseudo(n, "{1}", "{2}");'
+ }, {
+ re: /^(?:([\[\{])(?:@)?([\w\-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,
+ select: 'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'
+ }, {
+ re: /^#([\w\-\\]+)/,
+ select: 'n = byId(n, "{1}");'
+ }, {
+ re: /^@([\w\-\.]+)/,
+ select: 'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'
+ }],
+
+
+ operators: {
+ "=": function(a, v) {
+ return a == v;
+ },
+ "!=": function(a, v) {
+ return a != v;
+ },
+ "^=": function(a, v) {
+ return a && a.substr(0, v.length) == v;
+ },
+ "$=": function(a, v) {
+ return a && a.substr(a.length - v.length) == v;
+ },
+ "*=": function(a, v) {
+ return a && a.indexOf(v) !== -1;
+ },
+ "%=": function(a, v) {
+ return (a % v) === 0;
+ },
+ "|=": function(a, v) {
+ return a && (a == v || a.substr(0, v.length + 1) == v + '-');
+ },
+ "~=": function(a, v) {
+ return a && (' ' + a + ' ').indexOf(' ' + v + ' ') != -1;
+ }
+ },
+
+
+ pseudos: {
+ "first-child": function(c) {
+ var r = [], ri = -1, n,
+ i, ci;
+ for (i = 0; (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,
+ i, ci;
+ for (i = 0; (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,
+ i, n, j, cn, pn;
+ for (i = 0; n = c[i]; i++) {
+ pn = n.parentNode;
+ if (batch != pn._batch) {
+ j = 0;
+ for (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,
+ i, ci;
+ for (i = 0; ci = c[i]; i++) {
+ if (!prev(ci) && !next(ci)) {
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ },
+
+ "empty": function(c) {
+ var r = [], ri = -1,
+ i, ci, cns, j, cn, empty;
+ for (i = 0; ci = c[i]; i++) {
+ cns = ci.childNodes;
+ j = 0;
+ 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,
+ i, ci;
+ for (i = 0; ci = c[i]; i++) {
+ if ((ci.textContent || ci.innerText || ci.text || '').indexOf(v) != -1) {
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ },
+
+ "nodeValue": function(c, v) {
+ var r = [], ri = -1,
+ i, ci;
+ for (i = 0; ci = c[i]; i++) {
+ if (ci.firstChild && ci.firstChild.nodeValue == v) {
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ },
+
+ "checked": function(c) {
+ var r = [], ri = -1,
+ i, ci;
+ for (i = 0; ci = c[i]; i++) {
+ if (ci.checked === true) {
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ },
+
+ "not": function(c, ss) {
+ return DQ.filter(c, ss, true);
+ },
+
+ "any": function(c, selectors) {
+ var ss = selectors.split('|'),
+ r = [], ri = -1, s,
+ i, ci, j;
+ for (i = 0; ci = c[i]; i++) {
+ for (j = 0; s = ss[j]; j++) {
+ if (DQ.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 = DQ.select,
+ r = [], ri = -1,
+ i, ci;
+ for (i = 0; ci = c[i]; i++) {
+ if (s(ss, ci).length > 0) {
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ },
+
+ "next": function(c, ss) {
+ var is = DQ.is,
+ r = [], ri = -1,
+ i, ci, n;
+ for (i = 0; ci = c[i]; i++) {
+ n = next(ci);
+ if (n && is(n, ss)) {
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ },
+
+ "prev": function(c, ss) {
+ var is = DQ.is,
+ r = [], ri = -1,
+ i, ci, n;
+ for (i = 0; ci = c[i]; i++) {
+ n = prev(ci);
+ if (n && is(n, ss)) {
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ },
+
+ focusable: function(candidates) {
+ var len = candidates.length,
+ results = [],
+ i = 0,
+ c;
+
+ for (; i < len; i++) {
+ c = candidates[i];
+ if (Ext.fly(c, '_DomQuery').isFocusable()) {
+ results.push(c);
+ }
+ }
+
+ return results;
+ },
+
+ visible: function(candidates, deep) {
+ var len = candidates.length,
+ results = [],
+ i = 0,
+ c;
+
+ for (; i < len; i++) {
+ c = candidates[i];
+ if (Ext.fly(c, '_DomQuery').isVisible(deep)) {
+ results.push(c);
+ }
+ }
+
+ return results;
+ }
+ }
+ };
+}());
+
+
+Ext.query = Ext.DomQuery.select;
+
+
+
+
+
+Ext.define('Ext.dom.Element_anim', {
+ override: 'Ext.dom.Element',
+
+
+ animate: function(config) {
+ var me = this,
+ listeners,
+ anim,
+ animId = me.dom.id || Ext.id(me.dom);
+
+ if (!Ext.fx.Manager.hasFxBlock(animId)) {
+
+ if (config.listeners) {
+ listeners = config.listeners;
+ delete config.listeners;
+ }
+ if (config.internalListeners) {
+ config.listeners = config.internalListeners;
+ delete config.internalListeners;
+ }
+ anim = new Ext.fx.Anim(me.anim(config));
+ if (listeners) {
+ anim.on(listeners);
+ }
+ Ext.fx.Manager.queueFx(anim);
+ }
+ return me;
+ },
+
+
+ anim: function(config) {
+ if (!Ext.isObject(config)) {
+ return (config) ? {} : false;
+ }
+
+ var me = this,
+ duration = config.duration || Ext.fx.Anim.prototype.duration,
+ easing = config.easing || 'ease',
+ animConfig;
+
+ if (config.stopAnimation) {
+ me.stopAnimation();
+ }
+
+ Ext.applyIf(config, Ext.fx.Manager.getFxDefaults(me.id));
+
+
+ Ext.fx.Manager.setFxDefaults(me.id, {
+ delay: 0
+ });
+
+ animConfig = {
+
+ target: me.dom,
+ remove: config.remove,
+ alternate: config.alternate || false,
+ duration: duration,
+ easing: easing,
+ callback: config.callback,
+ listeners: config.listeners,
+ iterations: config.iterations || 1,
+ scope: config.scope,
+ block: config.block,
+ concurrent: config.concurrent,
+ delay: config.delay || 0,
+ paused: true,
+ keyframes: config.keyframes,
+ from: config.from || {},
+ to: Ext.apply({}, config)
+ };
+ Ext.apply(animConfig.to, config.to);
+
+
+ delete animConfig.to.to;
+ delete animConfig.to.from;
+ delete animConfig.to.remove;
+ delete animConfig.to.alternate;
+ delete animConfig.to.keyframes;
+ delete animConfig.to.iterations;
+ delete animConfig.to.listeners;
+ delete animConfig.to.target;
+ delete animConfig.to.paused;
+ delete animConfig.to.callback;
+ delete animConfig.to.scope;
+ delete animConfig.to.duration;
+ delete animConfig.to.easing;
+ delete animConfig.to.concurrent;
+ delete animConfig.to.block;
+ delete animConfig.to.stopAnimation;
+ delete animConfig.to.delay;
+ return animConfig;
+ },
+
+
+ slideIn: function(anchor, obj, slideOut) {
+ var me = this,
+ dom = me.dom,
+ elStyle = dom.style,
+ beforeAnim,
+ wrapAnim,
+ restoreScroll,
+ wrapDomParentNode;
+
+ anchor = anchor || "t";
+ obj = obj || {};
+
+ beforeAnim = function() {
+ var animScope = this,
+ listeners = obj.listeners,
+ el = Ext.fly(dom, '_anim'),
+ box, originalStyles, anim, wrap;
+
+ if (!slideOut) {
+ el.fixDisplay();
+ }
+
+ box = el.getBox();
+ if ((anchor == 't' || anchor == 'b') && box.height === 0) {
+ box.height = dom.scrollHeight;
+ }
+ else if ((anchor == 'l' || anchor == 'r') && box.width === 0) {
+ box.width = dom.scrollWidth;
+ }
+
+ originalStyles = el.getStyles('width', 'height', 'left', 'right', 'top', 'bottom', 'position', 'z-index', true);
+ el.setSize(box.width, box.height);
+
+
+ if (obj.preserveScroll) {
+ restoreScroll = el.cacheScrollValues();
+ }
+
+ wrap = el.wrap({
+ id: Ext.id() + '-anim-wrap-for-' + el.dom.id,
+ style: {
+ visibility: slideOut ? 'visible' : 'hidden'
+ }
+ });
+ wrapDomParentNode = wrap.dom.parentNode;
+ wrap.setPositioning(el.getPositioning(true));
+ if (wrap.isStyle('position', 'static')) {
+ wrap.position('relative');
+ }
+ el.clearPositioning('auto');
+ wrap.clip();
+
+
+ if (restoreScroll) {
+ restoreScroll();
+ }
+
+
+
+
+ el.setStyle({
+ visibility: '',
+ position: 'absolute'
+ });
+ if (slideOut) {
+ wrap.setSize(box.width, box.height);
+ }
+
+ switch (anchor) {
+ case 't':
+ anim = {
+ from: {
+ width: box.width + 'px',
+ height: '0px'
+ },
+ to: {
+ width: box.width + 'px',
+ height: box.height + 'px'
+ }
+ };
+ elStyle.bottom = '0px';
+ break;
+ case 'l':
+ anim = {
+ from: {
+ width: '0px',
+ height: box.height + 'px'
+ },
+ to: {
+ width: box.width + 'px',
+ height: box.height + 'px'
+ }
+ };
+ me.anchorAnimX(anchor);
+ break;
+ case 'r':
+ anim = {
+ from: {
+ x: box.x + box.width,
+ width: '0px',
+ height: box.height + 'px'
+ },
+ to: {
+ x: box.x,
+ width: box.width + 'px',
+ height: box.height + 'px'
+ }
+ };
+ me.anchorAnimX(anchor);
+ break;
+ case 'b':
+ anim = {
+ from: {
+ y: box.y + box.height,
+ width: box.width + 'px',
+ height: '0px'
+ },
+ to: {
+ y: box.y,
+ width: box.width + 'px',
+ height: box.height + 'px'
+ }
+ };
+ break;
+ case 'tl':
+ anim = {
+ from: {
+ x: box.x,
+ y: box.y,
+ width: '0px',
+ height: '0px'
+ },
+ to: {
+ width: box.width + 'px',
+ height: box.height + 'px'
+ }
+ };
+ elStyle.bottom = '0px';
+ me.anchorAnimX('l');
+ break;
+ case 'bl':
+ anim = {
+ from: {
+ y: box.y + box.height,
+ width: '0px',
+ height: '0px'
+ },
+ to: {
+ y: box.y,
+ width: box.width + 'px',
+ height: box.height + 'px'
+ }
+ };
+ me.anchorAnimX('l');
+ break;
+ case 'br':
+ anim = {
+ from: {
+ x: box.x + box.width,
+ y: box.y + box.height,
+ width: '0px',
+ height: '0px'
+ },
+ to: {
+ x: box.x,
+ y: box.y,
+ width: box.width + 'px',
+ height: box.height + 'px'
+ }
+ };
+ me.anchorAnimX('r');
+ break;
+ case 'tr':
+ anim = {
+ from: {
+ x: box.x + box.width,
+ width: '0px',
+ height: '0px'
+ },
+ to: {
+ x: box.x,
+ width: box.width + 'px',
+ height: box.height + 'px'
+ }
+ };
+ elStyle.bottom = '0px';
+ me.anchorAnimX('r');
+ break;
+ }
+
+ wrap.show();
+ wrapAnim = Ext.apply({}, obj);
+ delete wrapAnim.listeners;
+ wrapAnim = new Ext.fx.Anim(Ext.applyIf(wrapAnim, {
+ target: wrap,
+ duration: 500,
+ easing: 'ease-out',
+ from: slideOut ? anim.to : anim.from,
+ to: slideOut ? anim.from : anim.to
+ }));
+
+
+ wrapAnim.on('afteranimate', function() {
+ var el = Ext.fly(dom, '_anim');
+
+ el.setStyle(originalStyles);
+ if (slideOut) {
+ if (obj.useDisplay) {
+ el.setDisplayed(false);
+ } else {
+ el.hide();
+ }
+ }
+ if (wrap.dom) {
+ if (wrap.dom.parentNode) {
+ wrap.dom.parentNode.insertBefore(el.dom, wrap.dom);
+ } else {
+ wrapDomParentNode.appendChild(el.dom);
+ }
+ wrap.remove();
+ }
+
+ if (restoreScroll) {
+ restoreScroll();
+ }
+
+ animScope.end();
+ });
+
+ if (listeners) {
+ wrapAnim.on(listeners);
+ }
+ };
+
+ me.animate({
+
+ duration: obj.duration ? Math.max(obj.duration, 500) * 2 : 1000,
+ listeners: {
+ beforeanimate: beforeAnim
+ }
+ });
+ return me;
+ },
+
+
+
+ slideOut: function(anchor, o) {
+ return this.slideIn(anchor, o, true);
+ },
+
+
+ puff: function(obj) {
+ var me = this,
+ dom = me.dom,
+ beforeAnim,
+ box = me.getBox(),
+ originalStyles = me.getStyles('width', 'height', 'left', 'right', 'top', 'bottom', 'position', 'z-index', 'font-size', 'opacity', true);
+
+ obj = Ext.applyIf(obj || {}, {
+ easing: 'ease-out',
+ duration: 500,
+ useDisplay: false
+ });
+
+ beforeAnim = function() {
+ var el = Ext.fly(dom, '_anim');
+
+ el.clearOpacity();
+ el.show();
+ this.to = {
+ width: box.width * 2,
+ height: box.height * 2,
+ x: box.x - (box.width / 2),
+ y: box.y - (box.height /2),
+ opacity: 0,
+ fontSize: '200%'
+ };
+ this.on('afteranimate',function() {
+ var el = Ext.fly(dom, '_anim');
+ if (el) {
+ if (obj.useDisplay) {
+ el.setDisplayed(false);
+ } else {
+ el.hide();
+ }
+ el.setStyle(originalStyles);
+ Ext.callback(obj.callback, obj.scope);
+ }
+ });
+ };
+
+ me.animate({
+ duration: obj.duration,
+ easing: obj.easing,
+ listeners: {
+ beforeanimate: {
+ fn: beforeAnim
+ }
+ }
+ });
+ return me;
+ },
+
+
+ switchOff: function(obj) {
+ var me = this,
+ dom = me.dom,
+ beforeAnim;
+
+ obj = Ext.applyIf(obj || {}, {
+ easing: 'ease-in',
+ duration: 500,
+ remove: false,
+ useDisplay: false
+ });
+
+ beforeAnim = function() {
+ var el = Ext.fly(dom, '_anim'),
+ animScope = this,
+ size = el.getSize(),
+ xy = el.getXY(),
+ keyframe, position;
+
+ el.clearOpacity();
+ el.clip();
+ position = el.getPositioning();
+
+ keyframe = new Ext.fx.Animator({
+ target: dom,
+ duration: obj.duration,
+ easing: obj.easing,
+ keyframes: {
+ 33: {
+ opacity: 0.3
+ },
+ 66: {
+ height: 1,
+ y: xy[1] + size.height / 2
+ },
+ 100: {
+ width: 1,
+ x: xy[0] + size.width / 2
+ }
+ }
+ });
+ keyframe.on('afteranimate', function() {
+ var el = Ext.fly(dom, '_anim');
+ if (obj.useDisplay) {
+ el.setDisplayed(false);
+ } else {
+ el.hide();
+ }
+ el.clearOpacity();
+ el.setPositioning(position);
+ el.setSize(size);
+
+ animScope.end();
+ });
+ };
+
+ me.animate({
+
+ duration: (Math.max(obj.duration, 500) * 2),
+ listeners: {
+ beforeanimate: {
+ fn: beforeAnim
+ }
+ },
+ callback: obj.callback,
+ scope: obj.scope
+ });
+ return me;
+ },
+
+
+ frame : function(color, count, obj){
+ var me = this,
+ dom = me.dom,
+ beforeAnim;
+
+ color = color || '#C3DAF9';
+ count = count || 1;
+ obj = obj || {};
+
+ beforeAnim = function() {
+ var el = Ext.fly(dom, '_anim'),
+ animScope = this,
+ box,
+ proxy, proxyAnim;
+
+ el.show();
+ box = el.getBox();
+ proxy = Ext.getBody().createChild({
+ id: el.dom.id + '-anim-proxy',
+ style: {
+ position : 'absolute',
+ 'pointer-events': 'none',
+ 'z-index': 35000,
+ border : '0px solid ' + color
+ }
+ });
+
+ proxyAnim = new Ext.fx.Anim({
+ target: proxy,
+ duration: obj.duration || 1000,
+ iterations: count,
+ from: {
+ top: box.y,
+ left: box.x,
+ borderWidth: 0,
+ opacity: 1,
+ height: box.height,
+ width: box.width
+ },
+ to: {
+ top: box.y - 20,
+ left: box.x - 20,
+ borderWidth: 10,
+ opacity: 0,
+ height: box.height + 40,
+ width: box.width + 40
+ }
+ });
+ proxyAnim.on('afteranimate', function() {
+ proxy.remove();
+
+ animScope.end();
+ });
+ };
+
+ me.animate({
+
+ duration: (Math.max(obj.duration, 500) * 2) || 2000,
+ listeners: {
+ beforeanimate: {
+ fn: beforeAnim
+ }
+ },
+ callback: obj.callback,
+ scope: obj.scope
+ });
+ return me;
+ },
+
+
+ ghost: function(anchor, obj) {
+ var me = this,
+ dom = me.dom,
+ beforeAnim;
+
+ anchor = anchor || "b";
+ beforeAnim = function() {
+ var el = Ext.fly(dom, '_anim'),
+ width = el.getWidth(),
+ height = el.getHeight(),
+ xy = el.getXY(),
+ position = el.getPositioning(),
+ to = {
+ opacity: 0
+ };
+ switch (anchor) {
+ case 't':
+ to.y = xy[1] - height;
+ break;
+ case 'l':
+ to.x = xy[0] - width;
+ break;
+ case 'r':
+ to.x = xy[0] + width;
+ break;
+ case 'b':
+ to.y = xy[1] + height;
+ break;
+ case 'tl':
+ to.x = xy[0] - width;
+ to.y = xy[1] - height;
+ break;
+ case 'bl':
+ to.x = xy[0] - width;
+ to.y = xy[1] + height;
+ break;
+ case 'br':
+ to.x = xy[0] + width;
+ to.y = xy[1] + height;
+ break;
+ case 'tr':
+ to.x = xy[0] + width;
+ to.y = xy[1] - height;
+ break;
+ }
+ this.to = to;
+ this.on('afteranimate', function () {
+ var el = Ext.fly(dom, '_anim');
+ if (el) {
+ el.hide();
+ el.clearOpacity();
+ el.setPositioning(position);
+ }
+ });
+ };
+
+ me.animate(Ext.applyIf(obj || {}, {
+ duration: 500,
+ easing: 'ease-out',
+ listeners: {
+ beforeanimate: beforeAnim
+ }
+ }));
+ return me;
+ },
+
+
+ highlight: function(color, o) {
+ var me = this,
+ dom = me.dom,
+ from = {},
+ restore, to, attr, lns, event, fn;
+
+
+ if (dom.tagName.match(me.tableTagRe)) {
+ return me.select('div').highlight(color, o);
+ }
+
+ o = o || {};
+ lns = o.listeners || {};
+ attr = o.attr || 'backgroundColor';
+ from[attr] = color || 'ffff9c';
+
+ if (!o.to) {
+ to = {};
+ to[attr] = o.endColor || me.getColor(attr, 'ffffff', '');
+ }
+ else {
+ to = o.to;
+ }
+
+
+ o.listeners = Ext.apply(Ext.apply({}, lns), {
+ beforeanimate: function() {
+ restore = dom.style[attr];
+ var el = Ext.fly(dom, '_anim');
+ el.clearOpacity();
+ el.show();
+
+ event = lns.beforeanimate;
+ if (event) {
+ fn = event.fn || event;
+ return fn.apply(event.scope || lns.scope || window, arguments);
+ }
+ },
+ afteranimate: function() {
+ if (dom) {
+ dom.style[attr] = restore;
+ }
+
+ event = lns.afteranimate;
+ if (event) {
+ fn = event.fn || event;
+ fn.apply(event.scope || lns.scope || window, arguments);
+ }
+ }
+ });
+
+ me.animate(Ext.apply({}, o, {
+ duration: 1000,
+ easing: 'ease-in',
+ from: from,
+ to: to
+ }));
+ return me;
+ },
+
+
+ pause: function(ms) {
+ var me = this;
+ Ext.fx.Manager.setFxDefaults(me.id, {
+ delay: ms
+ });
+ return me;
+ },
+
+
+ fadeIn: function(o) {
+ var me = this,
+ dom = me.dom;
+
+ me.animate(Ext.apply({}, o, {
+ opacity: 1,
+ internalListeners: {
+ beforeanimate: function(anim){
+
+
+ var el = Ext.fly(dom, '_anim');
+ if (el.isStyle('display', 'none')) {
+ el.setDisplayed('');
+ } else {
+ el.show();
+ }
+ }
+ }
+ }));
+ return this;
+ },
+
+
+ fadeOut: function(o) {
+ var me = this,
+ dom = me.dom;
+
+ o = Ext.apply({
+ opacity: 0,
+ internalListeners: {
+ afteranimate: function(anim){
+ if (dom && anim.to.opacity === 0) {
+ var el = Ext.fly(dom, '_anim');
+ if (o.useDisplay) {
+ el.setDisplayed(false);
+ } else {
+ el.hide();
+ }
+ }
+ }
+ }
+ }, o);
+ me.animate(o);
+ return me;
+ },
+
+
+ scale: function(w, h, o) {
+ this.animate(Ext.apply({}, o, {
+ width: w,
+ height: h
+ }));
+ return this;
+ },
+
+
+ shift: function(config) {
+ this.animate(config);
+ return this;
+ },
+
+
+ anchorAnimX: function(anchor) {
+ var xName = (anchor === 'l') ? 'right' : 'left';
+ this.dom.style[xName] = '0px';
+ }
+});
+
+
+
+Ext.define('Ext.dom.Element_dd', {
+ override: 'Ext.dom.Element',
+
+
+ initDD : function(group, config, overrides){
+ var dd = new Ext.dd.DD(Ext.id(this.dom), group, config);
+ return Ext.apply(dd, overrides);
+ },
+
+
+ initDDProxy : function(group, config, overrides){
+ var dd = new Ext.dd.DDProxy(Ext.id(this.dom), group, config);
+ return Ext.apply(dd, overrides);
+ },
+
+
+ initDDTarget : function(group, config, overrides){
+ var dd = new Ext.dd.DDTarget(Ext.id(this.dom), group, config);
+ return Ext.apply(dd, overrides);
+ }
+});
+
+
+
+Ext.define('Ext.dom.Element_fx', {
+ override: 'Ext.dom.Element'
+},
+function() {
+
+var Element = Ext.dom.Element,
+ VISIBILITY = "visibility",
+ DISPLAY = "display",
+ NONE = "none",
+ HIDDEN = 'hidden',
+ VISIBLE = 'visible',
+ OFFSETS = "offsets",
+ ASCLASS = "asclass",
+ NOSIZE = 'nosize',
+ ORIGINALDISPLAY = 'originalDisplay',
+ VISMODE = 'visibilityMode',
+ ISVISIBLE = 'isVisible',
+ OFFSETCLASS = Ext.baseCSSPrefix + 'hide-offsets',
+ getDisplay = function(el) {
+ var data = (el.$cache || el.getCache()).data,
+ display = data[ORIGINALDISPLAY];
+
+ if (display === undefined) {
+ data[ORIGINALDISPLAY] = display = '';
+ }
+ return display;
+ },
+ getVisMode = function(el){
+ var data = (el.$cache || el.getCache()).data,
+ visMode = data[VISMODE];
+
+ if (visMode === undefined) {
+ data[VISMODE] = visMode = Element.VISIBILITY;
+ }
+ return visMode;
+ };
+
+Element.override({
+
+ originalDisplay : "",
+ visibilityMode : 1,
+
+
+ setVisible : function(visible, animate) {
+ var me = this,
+ dom = me.dom,
+ visMode = getVisMode(me);
+
+
+ if (typeof animate == 'string') {
+ switch (animate) {
+ case DISPLAY:
+ visMode = Element.DISPLAY;
+ break;
+ case VISIBILITY:
+ visMode = Element.VISIBILITY;
+ break;
+ case OFFSETS:
+ visMode = Element.OFFSETS;
+ break;
+ case NOSIZE:
+ case ASCLASS:
+ visMode = Element.ASCLASS;
+ break;
+ }
+ me.setVisibilityMode(visMode);
+ animate = false;
+ }
+
+ if (!animate || !me.anim) {
+ if (visMode == Element.DISPLAY) {
+ return me.setDisplayed(visible);
+ } else if (visMode == Element.OFFSETS) {
+ me[visible?'removeCls':'addCls'](OFFSETCLASS);
+ } else if (visMode == Element.VISIBILITY) {
+ me.fixDisplay();
+
+ dom.style.visibility = visible ? '' : HIDDEN;
+ } else if (visMode == Element.ASCLASS) {
+ me[visible?'removeCls':'addCls'](me.visibilityCls || Element.visibilityCls);
+ }
+ } else {
+
+ if (visible) {
+ me.setOpacity(0.01);
+ me.setVisible(true);
+ }
+ if (!Ext.isObject(animate)) {
+ animate = {
+ duration: 350,
+ easing: 'ease-in'
+ };
+ }
+ me.animate(Ext.applyIf({
+ callback: function() {
+ if (!visible) {
+
+
+ Ext.fly(dom, '_internal').setVisible(false).setOpacity(1);
+ }
+ },
+ to: {
+ opacity: (visible) ? 1 : 0
+ }
+ }, animate));
+ }
+ (me.$cache || me.getCache()).data[ISVISIBLE] = visible;
+ return me;
+ },
+
+
+ hasMetrics : function(){
+ var visMode = getVisMode(this);
+ return this.isVisible() || (visMode == Element.OFFSETS) || (visMode == Element.VISIBILITY);
+ },
+
+
+ toggle : function(animate){
+ var me = this;
+ me.setVisible(!me.isVisible(), me.anim(animate));
+ return me;
+ },
+
+
+ setDisplayed : function(value) {
+ if(typeof value == "boolean"){
+ value = value ? getDisplay(this) : NONE;
+ }
+ this.setStyle(DISPLAY, value);
+ return this;
+ },
+
+
+ fixDisplay : function(){
+ var me = this;
+ if (me.isStyle(DISPLAY, NONE)) {
+ me.setStyle(VISIBILITY, HIDDEN);
+ me.setStyle(DISPLAY, getDisplay(me));
+ if (me.isStyle(DISPLAY, NONE)) {
+ me.setStyle(DISPLAY, "block");
+ }
+ }
+ },
+
+
+ hide : function(animate){
+
+ if (typeof animate == 'string'){
+ this.setVisible(false, animate);
+ return this;
+ }
+ this.setVisible(false, this.anim(animate));
+ return this;
+ },
+
+
+ show : function(animate){
+
+ if (typeof animate == 'string'){
+ this.setVisible(true, animate);
+ return this;
+ }
+ this.setVisible(true, this.anim(animate));
+ return this;
+ }
+});
+
+});
+
+
+
+Ext.define('Ext.dom.Element_position', {
+ override: 'Ext.dom.Element'
+},
+function() {
+
+var flyInstance,
+ Element = this,
+ LEFT = "left",
+ RIGHT = "right",
+ TOP = "top",
+ BOTTOM = "bottom",
+ POSITION = "position",
+ STATIC = "static",
+ RELATIVE = "relative",
+ ZINDEX = "z-index",
+ BODY = 'BODY',
+
+ PADDING = 'padding',
+ BORDER = 'border',
+ SLEFT = '-left',
+ SRIGHT = '-right',
+ STOP = '-top',
+ SBOTTOM = '-bottom',
+ SWIDTH = '-width',
+
+ borders = {l: BORDER + SLEFT + SWIDTH, r: BORDER + SRIGHT + SWIDTH, t: BORDER + STOP + SWIDTH, b: BORDER + SBOTTOM + SWIDTH},
+ paddings = {l: PADDING + SLEFT, r: PADDING + SRIGHT, t: PADDING + STOP, b: PADDING + SBOTTOM},
+ paddingsTLRB = [paddings.l, paddings.r, paddings.t, paddings.b],
+ bordersTLRB = [borders.l, borders.r, borders.t, borders.b],
+ round = Math.round,
+ doc = document,
+ fly = function (el) {
+ if (!flyInstance) {
+ flyInstance = new Ext.Element.Fly();
+ }
+ flyInstance.attach(el);
+ return flyInstance;
+ };
+
+ Element.override({
+
+ pxRe: /^\d+(?:\.\d*)?px$/i,
+
+ inheritableStatics: {
+ getX: function(el) {
+ return Element.getXY(el)[0];
+ },
+
+ getXY: function(el) {
+ var bd = doc.body,
+ docEl = doc.documentElement,
+ leftBorder = 0,
+ topBorder = 0,
+ ret = [0,0],
+ box,
+ scroll;
+
+ el = Ext.getDom(el);
+
+ if(el != doc && el != bd){
+
+
+ if (Ext.isIE) {
+ try {
+ box = el.getBoundingClientRect();
+
+
+ topBorder = docEl.clientTop || bd.clientTop;
+ leftBorder = docEl.clientLeft || bd.clientLeft;
+ } catch (ex) {
+ box = { left: 0, top: 0 };
+ }
+ } else {
+ box = el.getBoundingClientRect();
+ }
+
+ scroll = fly(doc).getScroll();
+ ret = [
+ round(box.left + scroll.left - leftBorder),
+ round(box.top + scroll.top - topBorder)
+ ];
+ }
+ return ret;
+ },
+
+ getY: function(el) {
+ return Element.getXY(el)[1];
+ },
+
+ setX: function(el, x) {
+ Element.setXY(el, [x, false]);
+ },
+
+ setXY: function(el, xy) {
+ (el = Ext.fly(el, '_setXY')).position();
+
+ var pts = el.translatePoints(xy),
+ style = el.dom.style,
+ pos;
+
+
+
+ style.right = 'auto';
+ for (pos in pts) {
+ if (!isNaN(pts[pos])) {
+ style[pos] = pts[pos] + "px";
+ }
+ }
+ },
+
+ setY: function(el, y) {
+ Element.setXY(el, [false, y]);
+ }
+ },
+
+
+ center: function(centerIn){
+ return this.alignTo(centerIn || doc, 'c-c');
+ },
+
+
+ clearPositioning: function(value) {
+ value = value || '';
+ return this.setStyle({
+ left : value,
+ right : value,
+ top : value,
+ bottom : value,
+ 'z-index' : '',
+ position : STATIC
+ });
+ },
+
+ getAnchorToXY: function(el, anchor, local, mySize) {
+ return el.getAnchorXY(anchor, local, mySize);
+ },
+
+
+ getBottom: function(local) {
+ return (local ? this.getLocalY() : this.getY()) + this.getHeight();
+ },
+
+ getBorderPadding: function() {
+ var paddingWidth = this.getStyle(paddingsTLRB),
+ bordersWidth = this.getStyle(bordersTLRB);
+
+ return {
+ beforeX: (parseFloat(bordersWidth[borders.l]) || 0) + (parseFloat(paddingWidth[paddings.l]) || 0),
+ afterX: (parseFloat(bordersWidth[borders.r]) || 0) + (parseFloat(paddingWidth[paddings.r]) || 0),
+ beforeY: (parseFloat(bordersWidth[borders.t]) || 0) + (parseFloat(paddingWidth[paddings.t]) || 0),
+ afterY: (parseFloat(bordersWidth[borders.b]) || 0) + (parseFloat(paddingWidth[paddings.b]) || 0)
+ };
+ },
+
+
+ getCenterXY: function(){
+ return this.getAlignToXY(doc, 'c-c');
+ },
+
+
+ getLeft: function(local) {
+ return local ? this.getLocalX() : this.getX();
+ },
+
+
+ getLocalX: function() {
+ var me = this,
+ offsetParent = me.dom.offsetParent,
+ x = me.getStyle('left');
+
+ if (!x || x === 'auto') {
+ x = 0;
+ } else if (me.pxRe.test(x)) {
+ x = parseFloat(x);
+ } else {
+ x = me.getX();
+ if (offsetParent) {
+ x -= Element.getX(offsetParent);
+ }
+ }
+
+ return x;
+ },
+
+
+ getLocalXY: function() {
+ var me = this,
+ offsetParent = me.dom.offsetParent,
+ style = me.getStyle(['left', 'top']),
+ x = style.left,
+ y = style.top;
+
+ if (!x || x === 'auto') {
+ x = 0;
+ } else if (me.pxRe.test(x)) {
+ x = parseFloat(x);
+ } else {
+ x = me.getX();
+ if (offsetParent) {
+ x -= Element.getX(offsetParent);
+ }
+ }
+
+ if (!y || y === 'auto') {
+ y = 0;
+ } else if (me.pxRe.test(y)) {
+ y = parseFloat(y);
+ } else {
+ y = me.getY();
+ if (offsetParent) {
+ y -= Element.getY(offsetParent);
+ }
+ }
+
+ return [x, y];
+ },
+
+
+ getLocalY: function() {
+ var me = this,
+ offsetParent = me.dom.offsetParent,
+ y = me.getStyle('top');
+
+ if (!y || y === 'auto') {
+ y = 0;
+ } else if (me.pxRe.test(y)) {
+ y = parseFloat(y);
+ } else {
+ y = me.getY();
+ if (offsetParent) {
+ y -= Element.getY(offsetParent);
+ }
+ }
+
+ return y;
+ },
+
+
+ getPageBox: function(getRegion) {
+ var me = this,
+ dom = me.dom,
+ isDoc = dom.nodeName == BODY,
+ w = isDoc ? Ext.Element.getViewWidth() : dom.offsetWidth,
+ h = isDoc ? Ext.Element.getViewHeight() : dom.offsetHeight,
+ xy = me.getXY(),
+ t = xy[1],
+ r = xy[0] + w,
+ b = xy[1] + h,
+ l = xy[0];
+
+ if (getRegion) {
+ return new Ext.util.Region(t, r, b, l);
+ }
+ else {
+ return {
+ left: l,
+ top: t,
+ width: w,
+ height: h,
+ right: r,
+ bottom: b
+ };
+ }
+ },
+
+
+ getPositioning: function(autoPx){
+ var styles = this.getStyle(['left', 'top', 'position', 'z-index']),
+ dom = this.dom;
+
+ if(autoPx) {
+ if(styles.left === 'auto') {
+ styles.left = dom.offsetLeft + 'px';
+ }
+ if(styles.top === 'auto') {
+ styles.top = dom.offsetTop + 'px';
+ }
+ }
+
+ return styles;
+ },
+
+
+ getRight: function(local) {
+ return (local ? this.getLocalX() : this.getX()) + this.getWidth();
+ },
+
+
+ getTop: function(local) {
+ return local ? this.getLocalY() : this.getY();
+ },
+
+
+ getX: function() {
+ return Element.getX(this.dom);
+ },
+
+
+ getXY: function() {
+ return Element.getXY(this.dom);
+ },
+
+
+ getY: function() {
+ return Element.getY(this.dom);
+ },
+
+
+ moveTo: function(x, y, animate) {
+ return this.setXY([x, y], animate);
+ },
+
+
+ position: function(pos, zIndex, x, y) {
+ var me = this;
+
+ if (!pos && me.isStyle(POSITION, STATIC)) {
+ me.setStyle(POSITION, RELATIVE);
+ } else if (pos) {
+ me.setStyle(POSITION, pos);
+ }
+ if (zIndex) {
+ me.setStyle(ZINDEX, zIndex);
+ }
+ if (x || y) {
+ me.setXY([x || false, y || false]);
+ }
+ },
+
+
+ setBottom: function(bottom) {
+ this.dom.style[BOTTOM] = this.addUnits(bottom);
+ return this;
+ },
+
+
+ setBounds: function(x, y, width, height, animate) {
+ return this.setBox({
+ x: x,
+ y: y,
+ width: width,
+ height: height
+ }, animate);
+ },
+
+
+ setLeft: function(left) {
+ this.dom.style[LEFT] = this.addUnits(left);
+ return this;
+ },
+
+
+ setLeftTop: function(left, top) {
+ var me = this,
+ style = me.dom.style;
+
+ style.left = me.addUnits(left);
+ style.top = me.addUnits(top);
+
+ return me;
+ },
+
+ setLocalX: function(x) {
+ var style = this.dom.style;
+
+
+ style.right = 'auto';
+ style.left = (x === null) ? 'auto' : x + 'px';
+ },
+
+ setLocalXY: function(x, y) {
+ var style = this.dom.style;
+
+
+ style.right = 'auto';
+
+ if (x && x.length) {
+ y = x[1];
+ x = x[0];
+ }
+
+ if (x === null) {
+ style.left = 'auto';
+ } else if (x !== undefined) {
+ style.left = x + 'px';
+ }
+
+ if (y === null) {
+ style.top = 'auto';
+ } else if (y !== undefined) {
+ style.top = y + 'px';
+ }
+ },
+
+ setLocalY: function(y) {
+ this.dom.style.top = (y === null) ? 'auto' : y + 'px';
+ },
+
+
+ setLocation: function(x, y, animate) {
+ return this.setXY([x, y], animate);
+ },
+
+
+ setPositioning: function(pc) {
+ return this.setStyle(pc);
+ },
+
+
+ setRight: function(right) {
+ this.dom.style[RIGHT] = this.addUnits(right);
+ return this;
+ },
+
+
+ setTop: function(top) {
+ this.dom.style[TOP] = this.addUnits(top);
+ return this;
+ },
+
+ setX: function(x, animate) {
+ return this.setXY([x, this.getY()], animate);
+ },
+
+ setXY: function(xy, animate) {
+ var me = this;
+
+ if (!animate || !me.anim) {
+ Element.setXY(me.dom, xy);
+ } else {
+ if (!Ext.isObject(animate)) {
+ animate = {};
+ }
+ me.animate(Ext.applyIf({ to: { x: xy[0], y: xy[1] } }, animate));
+ }
+ return this;
+ },
+
+ setY: function(y, animate) {
+ return this.setXY([this.getX(), y], animate);
+ }
+ });
+
+
+ Element.getTrueXY = Element.getXY;
+
+});
+
+
+
+Ext.define('Ext.dom.Element_scroll', {
+ override: 'Ext.dom.Element',
+
+
+ isScrollable: function() {
+ var dom = this.dom;
+ return dom.scrollHeight > dom.clientHeight || dom.scrollWidth > dom.clientWidth;
+ },
+
+
+ getScroll: function() {
+ var me = this,
+ dom = me.dom,
+ doc = document,
+ body = doc.body,
+ docElement = doc.documentElement,
+ left, top;
+
+ if (dom === doc || dom === body) {
+
+
+
+
+
+
+
+
+ left = docElement.scrollLeft || (body ? body.scrollLeft : 0);
+ top = docElement.scrollTop || (body ? body.scrollTop : 0);
+ } else {
+ left = dom.scrollLeft;
+ top = dom.scrollTop;
+ }
+
+ return {
+ left: left,
+ top: top
+ };
+ },
+
+
+ getScrollLeft: function() {
+ var dom = this.dom,
+ doc = document;
+
+ if (dom === doc || dom === doc.body) {
+ return this.getScroll().left;
+ } else {
+ return dom.scrollLeft;
+ }
+ },
+
+
+ getScrollTop: function(){
+ var dom = this.dom,
+ doc = document;
+
+ if (dom === doc || dom === doc.body) {
+ return this.getScroll().top;
+ } else {
+ return dom.scrollTop;
+ }
+ },
+
+
+ setScrollLeft: function(left){
+ this.dom.scrollLeft = left;
+ return this;
+ },
+
+
+ setScrollTop: function(top) {
+ this.dom.scrollTop = top;
+ return this;
+ },
+
+
+ scrollBy: function(deltaX, deltaY, animate) {
+ var me = this,
+ dom = me.dom;
+
+
+ if (deltaX.length) {
+ animate = deltaY;
+ deltaY = deltaX[1];
+ deltaX = deltaX[0];
+ } else if (typeof deltaX != 'number') {
+ animate = deltaY;
+ deltaY = deltaX.y;
+ deltaX = deltaX.x;
+ }
+
+ if (deltaX) {
+ me.scrollTo('left', me.constrainScrollLeft(dom.scrollLeft + deltaX), animate);
+ }
+ if (deltaY) {
+ me.scrollTo('top', me.constrainScrollTop(dom.scrollTop + deltaY), animate);
+ }
+
+ return me;
+ },
+
+
+ scrollTo: function(side, value, animate) {
+
+ var top = /top/i.test(side),
+ me = this,
+ prop = top ? 'scrollTop' : 'scrollLeft',
+ dom = me.dom,
+ animCfg;
+
+ if (!animate || !me.anim) {
+
+ dom[prop] = value;
+
+ dom[prop] = value;
+ }
+ else {
+ animCfg = {
+ to: {}
+ };
+ animCfg.to[prop] = value;
+ if (Ext.isObject(animate)) {
+ Ext.applyIf(animCfg, animate);
+ }
+ me.animate(animCfg);
+ }
+ return me;
+ },
+
+
+ scrollIntoView: function(container, hscroll, animate, highlight) {
+ var me = this,
+ dom = me.dom,
+ offsets = me.getOffsetsTo(container = Ext.getDom(container) || Ext.getBody().dom),
+
+ left = offsets[0] + container.scrollLeft,
+ top = offsets[1] + container.scrollTop,
+ bottom = top + dom.offsetHeight,
+ right = left + dom.offsetWidth,
+
+ ctClientHeight = container.clientHeight,
+ ctScrollTop = parseInt(container.scrollTop, 10),
+ ctScrollLeft = parseInt(container.scrollLeft, 10),
+ ctBottom = ctScrollTop + ctClientHeight,
+ ctRight = ctScrollLeft + container.clientWidth,
+ newPos;
+
+
+ if (highlight) {
+ if (animate) {
+ animate = Ext.apply({
+ listeners: {
+ afteranimate: function() {
+ me.scrollChildFly.attach(dom).highlight();
+ }
+ }
+ }, animate);
+ } else {
+ me.scrollChildFly.attach(dom).highlight();
+ }
+ }
+
+ if (dom.offsetHeight > ctClientHeight || top < ctScrollTop) {
+ newPos = top;
+ } else if (bottom > ctBottom) {
+ newPos = bottom - ctClientHeight;
+ }
+ if (newPos != null) {
+ me.scrollChildFly.attach(container).scrollTo('top', newPos, animate);
+ }
+
+ if (hscroll !== false) {
+ newPos = null;
+ if (dom.offsetWidth > container.clientWidth || left < ctScrollLeft) {
+ newPos = left;
+ } else if (right > ctRight) {
+ newPos = right - container.clientWidth;
+ }
+ if (newPos != null) {
+ me.scrollChildFly.attach(container).scrollTo('left', newPos, animate);
+ }
+ }
+ return me;
+ },
+
+
+ scrollChildIntoView: function(child, hscroll) {
+ this.scrollChildFly.attach(Ext.getDom(child)).scrollIntoView(this, hscroll);
+ },
+
+
+ scroll: function(direction, distance, animate) {
+ if (!this.isScrollable()) {
+ return false;
+ }
+ var me = this,
+ dom = me.dom,
+ side = direction === 'r' || direction === 'l' ? 'left' : 'top',
+ scrolled = false,
+ currentScroll, constrainedScroll;
+
+ if (direction === 'r') {
+ distance = -distance;
+ }
+
+ if (side === 'left') {
+ currentScroll = dom.scrollLeft;
+ constrainedScroll = me.constrainScrollLeft(currentScroll + distance);
+ } else {
+ currentScroll = dom.scrollTop;
+ constrainedScroll = me.constrainScrollTop(currentScroll + distance);
+ }
+
+ if (constrainedScroll !== currentScroll) {
+ this.scrollTo(side, constrainedScroll, animate);
+ scrolled = true;
+ }
+
+ return scrolled;
+ },
+
+ constrainScrollLeft: function(left) {
+ var dom = this.dom;
+ return Math.max(Math.min(left, dom.scrollWidth - dom.clientWidth), 0);
+ },
+
+ constrainScrollTop: function(top) {
+ var dom = this.dom;
+ return Math.max(Math.min(top, dom.scrollHeight - dom.clientHeight), 0);
+ }
+}, function() {
+ this.prototype.scrollChildFly = new this.Fly();
+ this.prototype.scrolltoFly = new this.Fly();
+});
+
+
+
+Ext.define('Ext.dom.Element_style', {
+ override: 'Ext.dom.Element'
+},
+function() {
+
+var Element = this,
+ view = document.defaultView,
+ adjustDirect2DTableRe = /table-row|table-.*-group/,
+ INTERNAL = '_internal',
+ HIDDEN = 'hidden',
+ HEIGHT = 'height',
+ WIDTH = 'width',
+ ISCLIPPED = 'isClipped',
+ OVERFLOW = 'overflow',
+ OVERFLOWX = 'overflow-x',
+ OVERFLOWY = 'overflow-y',
+ ORIGINALCLIP = 'originalClip',
+ DOCORBODYRE = /#document|body/i,
+
+
+ styleHooks, verticalStyleHooks90, verticalStyleHooks270,
+ edges, k, edge, borderWidth;
+
+if (!view || !view.getComputedStyle) {
+ Element.prototype.getStyle = function (property, inline) {
+ var me = this,
+ dom = me.dom,
+ multiple = typeof property != 'string',
+ hooks = me.styleHooks,
+ prop = property,
+ props = prop,
+ len = 1,
+ isInline = inline,
+ camel, domStyle, values, hook, out, style, i;
+
+ if (multiple) {
+ values = {};
+ prop = props[0];
+ i = 0;
+ if (!(len = props.length)) {
+ return values;
+ }
+ }
+
+ if (!dom || dom.documentElement) {
+ return values || '';
+ }
+
+ domStyle = dom.style;
+
+ if (inline) {
+ style = domStyle;
+ } else {
+ style = dom.currentStyle;
+
+
+ if (!style) {
+ isInline = true;
+ style = domStyle;
+ }
+ }
+
+ do {
+ hook = hooks[prop];
+
+ if (!hook) {
+ hooks[prop] = hook = { name: Element.normalize(prop) };
+ }
+
+ if (hook.get) {
+ out = hook.get(dom, me, isInline, style);
+ } else {
+ camel = hook.name;
+
+
+
+
+
+ if (hook.canThrow) {
+ try {
+ out = style[camel];
+ } catch (e) {
+ out = '';
+ }
+ } else {
+
+
+ out = style ? style[camel] : '';
+ }
+ }
+
+ if (!multiple) {
+ return out;
+ }
+
+ values[prop] = out;
+ prop = props[++i];
+ } while (i < len);
+
+ return values;
+ };
+}
+
+Element.override({
+ getHeight: function(contentHeight, preciseHeight) {
+ var me = this,
+ hidden = me.isStyle('display', 'none'),
+ height,
+ floating;
+
+ if (hidden) {
+ return 0;
+ }
+
+ height = me.dom.offsetHeight;
+
+
+ if (Ext.supports.Direct2DBug) {
+ floating = me.adjustDirect2DDimension(HEIGHT);
+ if (preciseHeight) {
+ height += floating;
+ }
+ else if (floating > 0 && floating < 0.5) {
+ height++;
+ }
+ }
+
+ if (contentHeight) {
+ height -= me.getBorderWidth("tb") + me.getPadding("tb");
+ }
+
+ return (height < 0) ? 0 : height;
+ },
+
+ getWidth: function(contentWidth, preciseWidth) {
+ var me = this,
+ dom = me.dom,
+ hidden = me.isStyle('display', 'none'),
+ rect, width, floating;
+
+ if (hidden) {
+ return 0;
+ }
+
+
+
+
+
+
+
+ if (preciseWidth && Ext.supports.BoundingClientRect) {
+ rect = dom.getBoundingClientRect();
+
+
+
+
+ width = (me.vertical && !Ext.isIE9 && !Ext.supports.RotatedBoundingClientRect) ?
+ (rect.bottom - rect.top) : (rect.right - rect.left);
+ } else {
+ width = dom.offsetWidth;
+ }
+
+
+
+
+ if (Ext.supports.Direct2DBug && !me.vertical) {
+
+ floating = me.adjustDirect2DDimension(WIDTH);
+ if (preciseWidth) {
+ width += floating;
+ }
+
+
+
+ else if (floating > 0 && floating < 0.5) {
+ width++;
+ }
+ }
+
+ if (contentWidth) {
+ width -= me.getBorderWidth("lr") + me.getPadding("lr");
+ }
+
+ return (width < 0) ? 0 : width;
+ },
+
+ setWidth: function(width, animate) {
+ var me = this;
+ width = me.adjustWidth(width);
+ if (!animate || !me.anim) {
+ me.dom.style.width = me.addUnits(width);
+ }
+ else {
+ if (!Ext.isObject(animate)) {
+ animate = {};
+ }
+ me.animate(Ext.applyIf({
+ to: {
+ width: width
+ }
+ }, animate));
+ }
+ return me;
+ },
+
+ setHeight : function(height, animate) {
+ var me = this;
+
+ height = me.adjustHeight(height);
+ if (!animate || !me.anim) {
+ me.dom.style.height = me.addUnits(height);
+ }
+ else {
+ if (!Ext.isObject(animate)) {
+ animate = {};
+ }
+ me.animate(Ext.applyIf({
+ to: {
+ height: height
+ }
+ }, animate));
+ }
+
+ return me;
+ },
+
+ applyStyles: function(style) {
+ Ext.DomHelper.applyStyles(this.dom, style);
+ return this;
+ },
+
+ setSize: function(width, height, animate) {
+ var me = this;
+
+ if (Ext.isObject(width)) {
+ animate = height;
+ height = width.height;
+ width = width.width;
+ }
+
+ width = me.adjustWidth(width);
+ height = me.adjustHeight(height);
+
+ if (!animate || !me.anim) {
+ me.dom.style.width = me.addUnits(width);
+ me.dom.style.height = me.addUnits(height);
+ }
+ else {
+ if (animate === true) {
+ animate = {};
+ }
+ me.animate(Ext.applyIf({
+ to: {
+ width: width,
+ height: height
+ }
+ }, animate));
+ }
+
+ return me;
+ },
+
+ getViewSize : function() {
+ var me = this,
+ dom = me.dom,
+ isDoc = DOCORBODYRE.test(dom.nodeName),
+ ret;
+
+
+ if (isDoc) {
+ ret = {
+ width : Element.getViewWidth(),
+ height : Element.getViewHeight()
+ };
+ } else {
+ ret = {
+ width : dom.clientWidth,
+ height : dom.clientHeight
+ };
+ }
+
+ return ret;
+ },
+
+ getSize: function(contentSize) {
+ return {width: this.getWidth(contentSize), height: this.getHeight(contentSize)};
+ },
+
+
+
+
+ adjustWidth : function(width) {
+ var me = this,
+ isNum = (typeof width == 'number');
+
+ if (isNum && me.autoBoxAdjust && !me.isBorderBox()) {
+ width -= (me.getBorderWidth("lr") + me.getPadding("lr"));
+ }
+ return (isNum && width < 0) ? 0 : width;
+ },
+
+
+ adjustHeight : function(height) {
+ var me = this,
+ isNum = (typeof height == "number");
+
+ if (isNum && me.autoBoxAdjust && !me.isBorderBox()) {
+ height -= (me.getBorderWidth("tb") + me.getPadding("tb"));
+ }
+ return (isNum && height < 0) ? 0 : height;
+ },
+
+
+ getColor : function(attr, defaultValue, prefix) {
+ var v = this.getStyle(attr),
+ color = prefix || prefix === '' ? prefix : '#',
+ h, len, i=0;
+
+ if (!v || (/transparent|inherit/.test(v))) {
+ return defaultValue;
+ }
+ if (/^r/.test(v)) {
+ v = v.slice(4, v.length - 1).split(',');
+ len = v.length;
+ for (; i 5 ? color.toLowerCase() : defaultValue);
+ },
+
+
+ setOpacity: function(opacity, animate) {
+ var me = this;
+
+ if (!me.dom) {
+ return me;
+ }
+
+ if (!animate || !me.anim) {
+ me.setStyle('opacity', opacity);
+ }
+ else {
+ if (typeof animate != 'object') {
+ animate = {
+ duration: 350,
+ easing: 'ease-in'
+ };
+ }
+
+ me.animate(Ext.applyIf({
+ to: {
+ opacity: opacity
+ }
+ }, animate));
+ }
+ return me;
+ },
+
+
+ clearOpacity : function() {
+ return this.setOpacity('');
+ },
+
+
+ adjustDirect2DDimension: function(dimension) {
+ var me = this,
+ dom = me.dom,
+ display = me.getStyle('display'),
+ inlineDisplay = dom.style.display,
+ inlinePosition = dom.style.position,
+ originIndex = dimension === WIDTH ? 0 : 1,
+ currentStyle = dom.currentStyle,
+ floating;
+
+ if (display === 'inline') {
+ dom.style.display = 'inline-block';
+ }
+
+ dom.style.position = display.match(adjustDirect2DTableRe) ? 'absolute' : 'static';
+
+
+
+
+
+
+ floating = (parseFloat(currentStyle[dimension]) || parseFloat(currentStyle.msTransformOrigin.split(' ')[originIndex]) * 2) % 1;
+
+ dom.style.position = inlinePosition;
+
+ if (display === 'inline') {
+ dom.style.display = inlineDisplay;
+ }
+
+ return floating;
+ },
+
+
+ clip : function() {
+ var me = this,
+ data = (me.$cache || me.getCache()).data,
+ style;
+
+ if (!data[ISCLIPPED]) {
+ data[ISCLIPPED] = true;
+ style = me.getStyle([OVERFLOW, OVERFLOWX, OVERFLOWY]);
+ data[ORIGINALCLIP] = {
+ o: style[OVERFLOW],
+ x: style[OVERFLOWX],
+ y: style[OVERFLOWY]
+ };
+ me.setStyle(OVERFLOW, HIDDEN);
+ me.setStyle(OVERFLOWX, HIDDEN);
+ me.setStyle(OVERFLOWY, HIDDEN);
+ }
+ return me;
+ },
+
+
+ unclip : function() {
+ var me = this,
+ data = (me.$cache || me.getCache()).data,
+ clip;
+
+ if (data[ISCLIPPED]) {
+ data[ISCLIPPED] = false;
+ clip = data[ORIGINALCLIP];
+ if (clip.o) {
+ me.setStyle(OVERFLOW, clip.o);
+ }
+ if (clip.x) {
+ me.setStyle(OVERFLOWX, clip.x);
+ }
+ if (clip.y) {
+ me.setStyle(OVERFLOWY, clip.y);
+ }
+ }
+ return me;
+ },
+
+
+ boxWrap : function(cls) {
+ cls = cls || Ext.baseCSSPrefix + 'box';
+ var el = Ext.get(this.insertHtml("beforeBegin", "" + Ext.String.format(Element.boxMarkup, cls) + "
"));
+ Ext.DomQuery.selectNode('.' + cls + '-mc', el.dom).appendChild(this.dom);
+ return el;
+ },
+
+
+ getComputedHeight : function() {
+ var me = this,
+ h = Math.max(me.dom.offsetHeight, me.dom.clientHeight);
+ if (!h) {
+ h = parseFloat(me.getStyle(HEIGHT)) || 0;
+ if (!me.isBorderBox()) {
+ h += me.getFrameWidth('tb');
+ }
+ }
+ return h;
+ },
+
+
+ getComputedWidth : function() {
+ var me = this,
+ w = Math.max(me.dom.offsetWidth, me.dom.clientWidth);
+
+ if (!w) {
+ w = parseFloat(me.getStyle(WIDTH)) || 0;
+ if (!me.isBorderBox()) {
+ w += me.getFrameWidth('lr');
+ }
+ }
+ return w;
+ },
+
+
+ getFrameWidth : function(sides, onlyContentBox) {
+ return (onlyContentBox && this.isBorderBox()) ? 0 : (this.getPadding(sides) + this.getBorderWidth(sides));
+ },
+
+
+ addClsOnOver : function(className, testFn, scope) {
+ var me = this,
+ dom = me.dom,
+ hasTest = Ext.isFunction(testFn);
+
+ me.hover(
+ function() {
+ if (hasTest && testFn.call(scope || me, me) === false) {
+ return;
+ }
+ Ext.fly(dom, INTERNAL).addCls(className);
+ },
+ function() {
+ Ext.fly(dom, INTERNAL).removeCls(className);
+ }
+ );
+ return me;
+ },
+
+
+ addClsOnFocus : function(className, testFn, scope) {
+ var me = this,
+ dom = me.dom,
+ hasTest = Ext.isFunction(testFn);
+
+ me.on("focus", function() {
+ if (hasTest && testFn.call(scope || me, me) === false) {
+ return false;
+ }
+ Ext.fly(dom, INTERNAL).addCls(className);
+ });
+ me.on("blur", function() {
+ Ext.fly(dom, INTERNAL).removeCls(className);
+ });
+ return me;
+ },
+
+
+ addClsOnClick : function(className, testFn, scope) {
+ var me = this,
+ dom = me.dom,
+ hasTest = Ext.isFunction(testFn);
+
+ me.on("mousedown", function() {
+ if (hasTest && testFn.call(scope || me, me) === false) {
+ return false;
+ }
+ Ext.fly(dom, INTERNAL).addCls(className);
+ var d = Ext.getDoc(),
+ fn = function() {
+ Ext.fly(dom, INTERNAL).removeCls(className);
+ d.removeListener("mouseup", fn);
+ };
+ d.on("mouseup", fn);
+ });
+ return me;
+ },
+
+
+ getStyleSize : function() {
+ var me = this,
+ d = this.dom,
+ isDoc = DOCORBODYRE.test(d.nodeName),
+ s ,
+ w, h;
+
+
+ if (isDoc) {
+ return {
+ width : Element.getViewWidth(),
+ height : Element.getViewHeight()
+ };
+ }
+
+ s = me.getStyle([HEIGHT, WIDTH], true);
+
+ if (s.width && s.width != 'auto') {
+ w = parseFloat(s.width);
+ if (me.isBorderBox()) {
+ w -= me.getFrameWidth('lr');
+ }
+ }
+
+ if (s.height && s.height != 'auto') {
+ h = parseFloat(s.height);
+ if (me.isBorderBox()) {
+ h -= me.getFrameWidth('tb');
+ }
+ }
+
+ return {width: w || me.getWidth(true), height: h || me.getHeight(true)};
+ },
+
+ statics: {
+ selectableCls: Ext.baseCSSPrefix + 'selectable',
+ unselectableCls: Ext.baseCSSPrefix + 'unselectable'
+ },
+
+
+ selectable : function() {
+ var me = this;
+
+
+
+ me.dom.unselectable = '';
+
+ me.removeCls(Element.unselectableCls);
+ me.addCls(Element.selectableCls);
+
+ return me;
+ },
+
+
+ unselectable : function() {
+
+
+
+
+
+
+
+ var me = this;
+
+
+
+
+
+
+ if (Ext.isOpera) {
+ me.dom.unselectable = 'on';
+ }
+
+
+
+
+
+
+
+
+
+
+ me.removeCls(Element.selectableCls);
+ me.addCls(Element.unselectableCls);
+
+ return me;
+ },
+
+
+ setVertical: function(angle, cls) {
+ var me = this,
+ proto = Element.prototype,
+ hooks;
+
+ me.vertical = true;
+ if (cls) {
+ me.addCls(me.verticalCls = cls);
+ }
+
+ me.setWidth = proto.setHeight;
+ me.setHeight = proto.setWidth;
+ if (!Ext.isIE9m) {
+
+
+
+
+ me.getWidth = proto.getHeight;
+ me.getHeight = proto.getWidth;
+ }
+
+
+ me.styleHooks = (angle === 270) ?
+ Element.prototype.verticalStyleHooks270 : Element.prototype.verticalStyleHooks90;
+ },
+
+
+ setHorizontal: function() {
+ var me = this,
+ cls = me.verticalCls;
+
+ delete me.vertical;
+ if (cls) {
+ delete me.verticalCls;
+ me.removeCls(cls);
+ }
+
+
+ delete me.setWidth;
+ delete me.setHeight;
+ if (!Ext.isIE9m) {
+ delete me.getWidth;
+ delete me.getHeight;
+ }
+
+
+ delete me.styleHooks;
+ }
+});
+
+Element.prototype.styleHooks = styleHooks = Ext.dom.AbstractElement.prototype.styleHooks;
+
+
+
+Element.prototype.verticalStyleHooks90 = verticalStyleHooks90 = Ext.Object.chain(Element.prototype.styleHooks);
+Element.prototype.verticalStyleHooks270 = verticalStyleHooks270 = Ext.Object.chain(Element.prototype.styleHooks);
+
+verticalStyleHooks90.width = { name: 'height' };
+verticalStyleHooks90.height = { name: 'width' };
+verticalStyleHooks90['margin-top'] = { name: 'marginLeft' };
+verticalStyleHooks90['margin-right'] = { name: 'marginTop' };
+verticalStyleHooks90['margin-bottom'] = { name: 'marginRight' };
+verticalStyleHooks90['margin-left'] = { name: 'marginBottom' };
+verticalStyleHooks90['padding-top'] = { name: 'paddingLeft' };
+verticalStyleHooks90['padding-right'] = { name: 'paddingTop' };
+verticalStyleHooks90['padding-bottom'] = { name: 'paddingRight' };
+verticalStyleHooks90['padding-left'] = { name: 'paddingBottom' };
+verticalStyleHooks90['border-top'] = { name: 'borderLeft' };
+verticalStyleHooks90['border-right'] = { name: 'borderTop' };
+verticalStyleHooks90['border-bottom'] = { name: 'borderRight' };
+verticalStyleHooks90['border-left'] = { name: 'borderBottom' };
+
+verticalStyleHooks270.width = { name: 'height' };
+verticalStyleHooks270.height = { name: 'width' };
+verticalStyleHooks270['margin-top'] = { name: 'marginRight' };
+verticalStyleHooks270['margin-right'] = { name: 'marginBottom' };
+verticalStyleHooks270['margin-bottom'] = { name: 'marginLeft' };
+verticalStyleHooks270['margin-left'] = { name: 'marginTop' };
+verticalStyleHooks270['padding-top'] = { name: 'paddingRight' };
+verticalStyleHooks270['padding-right'] = { name: 'paddingBottom' };
+verticalStyleHooks270['padding-bottom'] = { name: 'paddingLeft' };
+verticalStyleHooks270['padding-left'] = { name: 'paddingTop' };
+verticalStyleHooks270['border-top'] = { name: 'borderRight' };
+verticalStyleHooks270['border-right'] = { name: 'borderBottom' };
+verticalStyleHooks270['border-bottom'] = { name: 'borderLeft' };
+verticalStyleHooks270['border-left'] = { name: 'borderTop' };
+
+if (Ext.isIE7m) {
+ styleHooks.fontSize = styleHooks['font-size'] = {
+ name: 'fontSize',
+ canThrow: true
+ };
+
+ styleHooks.fontStyle = styleHooks['font-style'] = {
+ name: 'fontStyle',
+ canThrow: true
+ };
+
+ styleHooks.fontFamily = styleHooks['font-family'] = {
+ name: 'fontFamily',
+ canThrow: true
+ };
+}
+
+
+if (Ext.isIEQuirks || Ext.isIE && Ext.ieVersion <= 8) {
+ function getBorderWidth (dom, el, inline, style) {
+ if (style[this.styleName] == 'none') {
+ return '0px';
+ }
+ return style[this.name];
+ }
+
+ edges = ['Top','Right','Bottom','Left'];
+ k = edges.length;
+
+ while (k--) {
+ edge = edges[k];
+ borderWidth = 'border' + edge + 'Width';
+
+ styleHooks['border-'+edge.toLowerCase()+'-width'] = styleHooks[borderWidth] = {
+ name: borderWidth,
+ styleName: 'border' + edge + 'Style',
+ get: getBorderWidth
+ };
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Ext.getDoc().on('selectstart', function(ev, dom) {
+ var doc = document.documentElement,
+ selectableCls = Element.selectableCls,
+ unselectableCls = Element.unselectableCls,
+ tagName = dom && dom.tagName;
+
+ tagName = tagName && tagName.toLowerCase();
+
+
+
+
+ if (tagName === 'input' || tagName === 'textarea') {
+ return;
+ }
+
+
+ while (dom && dom.nodeType === 1 && dom !== doc) {
+ var el = Ext.fly(dom);
+
+
+ if (el.hasCls(selectableCls)) {
+ return;
+ }
+
+
+ if (el.hasCls(unselectableCls)) {
+ ev.stopEvent();
+ return;
+ }
+
+ dom = dom.parentNode;
+ }
+});
+
+});
+
+Ext.onReady(function () {
+ var opacityRe = /alpha\(opacity=(.*)\)/i,
+ trimRe = /^\s+|\s+$/g,
+ hooks = Ext.dom.Element.prototype.styleHooks;
+
+
+ hooks.opacity = {
+ name: 'opacity',
+ afterSet: function(dom, value, el) {
+ if (el.isLayer) {
+ el.onOpacitySet(value);
+ }
+ }
+ };
+ if (!Ext.supports.Opacity && Ext.isIE) {
+ Ext.apply(hooks.opacity, {
+ get: function (dom) {
+ var filter = dom.style.filter,
+ match, opacity;
+ if (filter.match) {
+ match = filter.match(opacityRe);
+ if (match) {
+ opacity = parseFloat(match[1]);
+ if (!isNaN(opacity)) {
+ return opacity ? opacity / 100 : 0;
+ }
+ }
+ }
+ return 1;
+ },
+ set: function (dom, value) {
+ var style = dom.style,
+ val = style.filter.replace(opacityRe, '').replace(trimRe, '');
+
+ style.zoom = 1;
+
+
+ if (typeof(value) == 'number' && value >= 0 && value < 1) {
+ value *= 100;
+ style.filter = val + (val.length ? ' ' : '') + 'alpha(opacity='+value+')';
+ } else {
+ style.filter = val;
+ }
+ }
+ });
+ }
+
+
+});
+
+
+
+Ext.define('Ext.util.Positionable', {
+
+ _positionTopLeft: ['position', 'top', 'left'],
+
+ _alignRe: /^([a-z]+)-([a-z]+)(\?)?$/,
+
+
+
+ afterSetPosition: Ext.emptyFn,
+
+
+
+
+ adjustForConstraints: function(xy, parent) {
+ var vector = this.getConstrainVector(parent, xy);
+ if (vector) {
+ xy[0] += vector[0];
+ xy[1] += vector[1];
+ }
+ return xy;
+ },
+
+
+ alignTo: function(element, position, offsets, animate) {
+ var me = this,
+ el = me.el;
+
+ return me.setXY(me.getAlignToXY(element, position, offsets),
+ el.anim && !!animate ? el.anim(animate) : false);
+ },
+
+
+ anchorTo: function(anchorToEl, alignment, offsets, animate, monitorScroll, callback) {
+ var me = this,
+ scroll = !Ext.isEmpty(monitorScroll),
+ action = function() {
+ me.alignTo(anchorToEl, alignment, offsets, animate);
+ Ext.callback(callback, me);
+ },
+ anchor = me.getAnchor();
+
+
+ me.removeAnchor();
+ Ext.apply(anchor, {
+ fn: action,
+ scroll: scroll
+ });
+
+ Ext.EventManager.onWindowResize(action, null);
+
+ if (scroll) {
+ Ext.EventManager.on(window, 'scroll', action, null,
+ {buffer: !isNaN(monitorScroll) ? monitorScroll : 50});
+ }
+ action();
+ return me;
+ },
+
+
+ calculateAnchorXY: function(anchor, extraX, extraY, mySize) {
+
+
+ var me = this,
+ el = me.el,
+ doc = document,
+ isViewport = el.dom == doc.body || el.dom == doc,
+ round = Math.round,
+ xy, myWidth, myHeight;
+
+ anchor = (anchor || "tl").toLowerCase();
+ mySize = mySize || {};
+
+ myWidth = mySize.width || isViewport ? Ext.Element.getViewWidth() : me.getWidth();
+ myHeight = mySize.height || isViewport ? Ext.Element.getViewHeight() : me.getHeight();
+
+
+
+ switch (anchor) {
+ case 'tl' : xy = [0, 0];
+ break;
+ case 'bl' : xy = [0, myHeight];
+ break;
+ case 'tr' : xy = [myWidth, 0];
+ break;
+ case 'c' : xy = [round(myWidth * 0.5), round(myHeight * 0.5)];
+ break;
+ case 't' : xy = [round(myWidth * 0.5), 0];
+ break;
+ case 'l' : xy = [0, round(myHeight * 0.5)];
+ break;
+ case 'r' : xy = [myWidth, round(myHeight * 0.5)];
+ break;
+ case 'b' : xy = [round(myWidth * 0.5), myHeight];
+ break;
+ case 'tc' : xy = [round(myWidth * 0.5), 0];
+ break;
+ case 'bc' : xy = [round(myWidth * 0.5), myHeight];
+ break;
+ case 'br' : xy = [myWidth, myHeight];
+ }
+ return [xy[0] + extraX, xy[1] + extraY];
+ },
+
+
+ convertPositionSpec: Ext.identityFn,
+
+
+ getAlignToXY: function(alignToEl, posSpec, offset) {
+ var me = this,
+ viewportWidth = Ext.Element.getViewWidth() - 10,
+ viewportHeight = Ext.Element.getViewHeight() - 10,
+ doc = document,
+ docElement = doc.documentElement,
+ docBody = doc.body,
+ scrollX = (docElement.scrollLeft || docBody.scrollLeft || 0),
+ scrollY = (docElement.scrollTop || docBody.scrollTop || 0),
+ alignMatch, myPosition, alignToElPosition, myWidth, myHeight,
+ alignToElRegion, swapY, swapX, constrain, align1, align2,
+ p1y, p1x, p2y, p2x, x, y;
+
+ alignToEl = Ext.get(alignToEl.el || alignToEl);
+
+ if (!alignToEl || !alignToEl.dom) {
+ }
+
+ offset = offset || [0,0];
+ posSpec = (!posSpec || posSpec == "?" ? "tl-bl?" :
+ (!(/-/).test(posSpec) && posSpec !== "" ? "tl-" + posSpec : posSpec || "tl-bl")).toLowerCase();
+
+ posSpec = me.convertPositionSpec(posSpec);
+
+ alignMatch = posSpec.match(me._alignRe);
+
+
+ align1 = alignMatch[1];
+ align2 = alignMatch[2];
+ constrain = !!alignMatch[3];
+
+
+
+ myPosition = me.getAnchorXY(align1, true);
+ alignToElPosition = me.getAnchorToXY(alignToEl, align2, false);
+
+ x = alignToElPosition[0] - myPosition[0] + offset[0];
+ y = alignToElPosition[1] - myPosition[1] + offset[1];
+
+
+ if (constrain) {
+ myWidth = me.getWidth();
+ myHeight = me.getHeight();
+ alignToElRegion = alignToEl.getRegion();
+
+
+
+
+ p1y = align1.charAt(0);
+ p1x = align1.charAt(align1.length - 1);
+ p2y = align2.charAt(0);
+ p2x = align2.charAt(align2.length - 1);
+ swapY = ((p1y == "t" && p2y == "b") || (p1y == "b" && p2y == "t"));
+ swapX = ((p1x == "r" && p2x == "l") || (p1x == "l" && p2x == "r"));
+
+ if (x + myWidth > viewportWidth + scrollX) {
+ x = swapX ? alignToElRegion.left - myWidth : viewportWidth + scrollX - myWidth;
+ }
+ if (x < scrollX) {
+ x = swapX ? alignToElRegion.right : scrollX;
+ }
+ if (y + myHeight > viewportHeight + scrollY) {
+ y = swapY ? alignToElRegion.top - myHeight : viewportHeight + scrollY - myHeight;
+ }
+ if (y < scrollY) {
+ y = swapY ? alignToElRegion.bottom : scrollY;
+ }
+ }
+ return [x,y];
+ },
+
+
+ getAnchor: function(){
+ var el = this.el,
+ data = (el.$cache || el.getCache()).data,
+ anchor;
+
+ if (!el.dom) {
+ return;
+ }
+ anchor = data._anchor;
+
+ if(!anchor){
+ anchor = data._anchor = {};
+ }
+ return anchor;
+ },
+
+
+ getAnchorXY: function(anchor, local, mySize) {
+ var me = this,
+ myPos = me.getXY(),
+ el = me.el,
+ doc = document,
+ isViewport = el.dom == doc.body || el.dom == doc,
+ scroll = el.getScroll(),
+ extraX = isViewport ? scroll.left : local ? 0 : myPos[0],
+ extraY = isViewport ? scroll.top : local ? 0 : myPos[1];
+
+ return me.calculateAnchorXY(anchor, extraX, extraY, mySize);
+ },
+
+
+ getBox: function(contentBox, local) {
+ var me = this,
+ xy = local ? me.getLocalXY() : me.getXY(),
+ x = xy[0],
+ y = xy[1],
+ w = me.getWidth(),
+ h = me.getHeight(),
+ borderPadding, beforeX, beforeY;
+
+ if (contentBox) {
+ borderPadding = me.getBorderPadding();
+ beforeX = borderPadding.beforeX;
+ beforeY = borderPadding.beforeY;
+
+ x += beforeX;
+ y += beforeY;
+ w -= (beforeX + borderPadding.afterX);
+ h -= (beforeY + borderPadding.afterY);
+ }
+
+ return {
+ x: x,
+ left: x,
+ 0: x,
+ y: y,
+ top: y,
+ 1: y,
+ width: w,
+ height: h,
+ right: x + w,
+ bottom: y + h
+ };
+ },
+
+
+ calculateConstrainedPosition: function(constrainTo, proposedPosition, local, proposedSize) {
+ var me = this,
+ vector,
+ fp = me.floatParent,
+ parentNode = fp ? fp.getTargetEl() : null,
+ parentOffset,
+ borderPadding,
+ proposedConstrainPosition,
+ xy = false;
+
+ if (local && fp) {
+ parentOffset = parentNode.getXY();
+ borderPadding = parentNode.getBorderPadding();
+ parentOffset[0] += borderPadding.beforeX;
+ parentOffset[1] += borderPadding.beforeY;
+ if (proposedPosition) {
+ proposedConstrainPosition = [proposedPosition[0] + parentOffset[0], proposedPosition[1] + parentOffset[1]];
+ }
+ } else {
+ proposedConstrainPosition = proposedPosition;
+ }
+
+
+
+ constrainTo = constrainTo || me.constrainTo || parentNode || me.container || me.el.parent();
+ vector = (me.constrainHeader ? me.header : me).getConstrainVector(constrainTo, proposedConstrainPosition, proposedSize);
+
+
+ if (vector) {
+ xy = proposedPosition || me.getPosition(local);
+ xy[0] += vector[0];
+ xy[1] += vector[1];
+ }
+ return xy;
+ },
+
+
+ getConstrainVector: function(constrainTo, proposedPosition, proposedSize) {
+ var thisRegion = this.getRegion(),
+ vector = [0, 0],
+ shadowSize = (this.shadow && this.constrainShadow && !this.shadowDisabled) ? this.shadow.getShadowSize() : undefined,
+ overflowed = false,
+ constraintInsets = this.constraintInsets;
+
+ if (!(constrainTo instanceof Ext.util.Region)) {
+ constrainTo = Ext.get(constrainTo.el || constrainTo).getViewRegion();
+ }
+
+
+ if (constraintInsets) {
+ constraintInsets = Ext.isObject(constraintInsets) ? constraintInsets : Ext.Element.parseBox(constraintInsets);
+ constrainTo.adjust(constraintInsets.top, constraintInsets.right, constraintInsets.bottom, constraintInsets.length);
+ }
+
+
+ if (proposedPosition) {
+ thisRegion.translateBy(proposedPosition[0] - thisRegion.x, proposedPosition[1] - thisRegion.y);
+ }
+
+ if (proposedSize) {
+ thisRegion.right = thisRegion.left + proposedSize[0];
+ thisRegion.bottom = thisRegion.top + proposedSize[1];
+ }
+
+
+ if (shadowSize) {
+ constrainTo.adjust(shadowSize[0], -shadowSize[1], -shadowSize[2], shadowSize[3]);
+ }
+
+
+ if (thisRegion.right > constrainTo.right) {
+ overflowed = true;
+ vector[0] = (constrainTo.right - thisRegion.right);
+ }
+ if (thisRegion.left + vector[0] < constrainTo.left) {
+ overflowed = true;
+ vector[0] = (constrainTo.left - thisRegion.left);
+ }
+
+
+ if (thisRegion.bottom > constrainTo.bottom) {
+ overflowed = true;
+ vector[1] = (constrainTo.bottom - thisRegion.bottom);
+ }
+ if (thisRegion.top + vector[1] < constrainTo.top) {
+ overflowed = true;
+ vector[1] = (constrainTo.top - thisRegion.top);
+ }
+ return overflowed ? vector : false;
+ },
+
+
+ getOffsetsTo: function(offsetsTo) {
+ var o = this.getXY(),
+ e = Ext.fly(offsetsTo.el || offsetsTo, '_internal').getXY();
+ return [o[0] - e[0],o[1] - e[1]];
+ },
+
+
+ getRegion: function() {
+ var box = this.getBox();
+ return new Ext.util.Region(box.top, box.right, box.bottom, box.left);
+ },
+
+
+ getViewRegion: function() {
+ var me = this,
+ el = me.el,
+ isBody = el.dom.nodeName === 'BODY',
+ borderPadding, scroll, pos, top, left, width, height;
+
+
+ if (isBody) {
+ scroll = el.getScroll();
+ left = scroll.left;
+ top = scroll.top;
+ width = Ext.dom.AbstractElement.getViewportWidth();
+ height = Ext.dom.AbstractElement.getViewportHeight();
+ }
+ else {
+ borderPadding = me.getBorderPadding();
+ pos = me.getXY();
+ left = pos[0] + borderPadding.beforeX;
+ top = pos[1] + borderPadding.beforeY;
+ width = me.getWidth(true);
+ height = me.getHeight(true);
+ }
+
+ return new Ext.util.Region(top, left + width, top + height, left);
+ },
+
+
+ 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
+ };
+
+ direction = direction.toLowerCase();
+ me.setXY([hash[direction][0], hash[direction][1]], animate);
+ },
+
+
+ removeAnchor: function() {
+ var anchor = this.getAnchor();
+
+ if (anchor && anchor.fn) {
+ Ext.EventManager.removeResizeListener(anchor.fn);
+ if (anchor.scroll) {
+ Ext.EventManager.un(window, 'scroll', anchor.fn);
+ }
+ delete anchor.fn;
+ }
+ return this;
+ },
+
+
+ setBox: function(box, animate) {
+ var me = this,
+ el = me.el,
+ x = box.x,
+ y = box.y,
+ xy = [x, y],
+ w = box.width,
+ h = box.height,
+ doConstrain = (me.constrain || me.constrainHeader),
+ constrainedPos = doConstrain && me.calculateConstrainedPosition(null, [x, y], false, [w, h]);
+
+
+ if (constrainedPos) {
+ x = constrainedPos[0];
+ y = constrainedPos[1];
+ }
+ if (!animate || !el.anim) {
+ me.setSize(w, h);
+ me.setXY([x, y]);
+ me.afterSetPosition(x, y);
+ } else {
+ me.animate(Ext.applyIf({
+ to: {
+ x: x,
+ y: y,
+ width: el.adjustWidth(w),
+ height: el.adjustHeight(h)
+ },
+ listeners: {
+ afteranimate: Ext.Function.bind(me.afterSetPosition, me, [x, y])
+ }
+ }, animate));
+ }
+ return me;
+ },
+
+
+ setRegion: function(region, animate) {
+ return this.setBox({
+ x: region.left,
+ y: region.top,
+ width: region.right - region.left,
+ height: region.bottom - region.top
+ }, animate);
+ },
+
+
+ translatePoints: function(x, y) {
+ var pos = this.translateXY(x, y);
+
+ return {
+ left: pos.x,
+ top: pos.y
+ };
+ },
+
+
+ translateXY: function(x, y) {
+ var me = this,
+ el = me.el,
+ styles = el.getStyle(me._positionTopLeft),
+ relative = styles.position == 'relative',
+ left = parseFloat(styles.left),
+ top = parseFloat(styles.top),
+ xy = me.getXY();
+
+ if (Ext.isArray(x)) {
+ y = x[1];
+ x = x[0];
+ }
+ if (isNaN(left)) {
+ left = relative ? 0 : el.dom.offsetLeft;
+ }
+ if (isNaN(top)) {
+ top = relative ? 0 : el.dom.offsetTop;
+ }
+ left = (typeof x == 'number') ? x - xy[0] + left : undefined;
+ top = (typeof y == 'number') ? y - xy[1] + top : undefined;
+ return {
+ x: left,
+ y: top
+ };
+ }
+});
+
+
+
+Ext.define('Ext.dom.Element', function(Element) {
+ var HIDDEN = 'hidden',
+ DOC = document,
+ VISIBILITY = "visibility",
+ DISPLAY = "display",
+ NONE = "none",
+ XMASKED = Ext.baseCSSPrefix + "masked",
+ XMASKEDRELATIVE = Ext.baseCSSPrefix + "masked-relative",
+ EXTELMASKMSG = Ext.baseCSSPrefix + "mask-msg",
+ bodyRe = /^body/i,
+ visFly,
+
+
+ noBoxAdjust = Ext.isStrict ? {
+ select: 1
+ }: {
+ input: 1,
+ select: 1,
+ textarea: 1
+ },
+
+
+ isScrolled = function(c) {
+ var r = [], ri = -1,
+ i, ci;
+ for (i = 0; ci = c[i]; i++) {
+ if (ci.scrollTop > 0 || ci.scrollLeft > 0) {
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ };
+
+ return {
+
+ extend: Ext.dom.AbstractElement ,
+
+ alternateClassName: ['Ext.Element', 'Ext.core.Element'],
+
+
+
+
+
+
+
+
+
+
+
+ tableTagRe: /^(?:tr|td|table|tbody)$/i,
+
+ mixins: [
+ Ext.util.Positionable
+ ],
+
+ addUnits: function() {
+ return Element.addUnits.apply(Element, arguments);
+ },
+
+
+ focus: function(defer, dom) {
+ var me = this;
+
+ dom = dom || me.dom;
+ try {
+ if (Number(defer)) {
+ Ext.defer(me.focus, defer, me, [null, dom]);
+ } else {
+ dom.focus();
+ }
+ } catch(e) {
+ }
+ return me;
+ },
+
+
+ blur: function() {
+ var me = this,
+ dom = me.dom;
+
+
+ if (dom !== document.body) {
+ try {
+ dom.blur();
+ } catch(e) {
+ }
+ return me;
+ } else {
+ return me.focus(undefined, dom);
+ }
+ },
+
+
+ isBorderBox: function() {
+ var box = Ext.isBorderBox;
+
+
+ if (box && Ext.isIE7m) {
+ box = !((this.dom.tagName || "").toLowerCase() in noBoxAdjust);
+ }
+ return box;
+ },
+
+
+ hover: function(overFn, outFn, scope, options) {
+ var me = this;
+ me.on('mouseenter', overFn, scope || me.dom, options);
+ me.on('mouseleave', outFn, scope || me.dom, options);
+ return me;
+ },
+
+
+ getAttributeNS: function(ns, name) {
+ return this.getAttribute(name, ns);
+ },
+
+ getAttribute: (Ext.isIE && !(Ext.isIE9p && DOC.documentMode >= 9)) ?
+
+
+
+
+
+
+
+
+
+
+
+ function(name, ns) {
+ var d = this.dom,
+ type;
+ if (ns) {
+ type = typeof d[ns + ":" + name];
+ if (type != 'undefined' && type != 'unknown') {
+ return d[ns + ":" + name] || null;
+ }
+ return null;
+ }
+ if (name === "for") {
+ name = "htmlFor";
+ }
+ return d[name] || null;
+ } : function(name, ns) {
+ var d = this.dom;
+ if (ns) {
+ return d.getAttributeNS(ns, name) || d.getAttribute(ns + ":" + name);
+ }
+ return d.getAttribute(name) || d[name] || null;
+ },
+
+
+ cacheScrollValues: function() {
+ var me = this,
+ scrolledDescendants,
+ el, i,
+ scrollValues = [],
+ result = function() {
+ for (i = 0; i < scrolledDescendants.length; i++) {
+ el = scrolledDescendants[i];
+ el.scrollLeft = scrollValues[i][0];
+ el.scrollTop = scrollValues[i][1];
+ }
+ };
+
+ if (!Ext.DomQuery.pseudos.isScrolled) {
+ Ext.DomQuery.pseudos.isScrolled = isScrolled;
+ }
+ scrolledDescendants = me.query(':isScrolled');
+ for (i = 0; i < scrolledDescendants.length; i++) {
+ el = scrolledDescendants[i];
+ scrollValues[i] = [el.scrollLeft, el.scrollTop];
+ }
+ return result;
+ },
+
+
+ autoBoxAdjust: true,
+
+
+ isVisible : function(deep) {
+ var me = this,
+ dom = me.dom,
+ stopNode = dom.ownerDocument.documentElement;
+
+ if (!visFly) {
+ visFly = new Element.Fly();
+ }
+
+ while (dom !== stopNode) {
+
+
+ if (!dom || dom.nodeType === 11 || (visFly.attach(dom)).isStyle(VISIBILITY, HIDDEN) || visFly.isStyle(DISPLAY, NONE)) {
+ return false;
+ }
+
+ if (!deep) {
+ break;
+ }
+ dom = dom.parentNode;
+ }
+ return true;
+ },
+
+
+ isDisplayed : function() {
+ return !this.isStyle(DISPLAY, NONE);
+ },
+
+
+ enableDisplayMode : function(display) {
+ var me = this;
+
+ me.setVisibilityMode(Element.DISPLAY);
+
+ if (!Ext.isEmpty(display)) {
+ (me.$cache || me.getCache()).data.originalDisplay = display;
+ }
+
+ return me;
+ },
+
+
+ mask : function(msg, msgCls , elHeight) {
+ var me = this,
+ dom = me.dom,
+
+
+ setExpression = dom.style.setExpression,
+ data = (me.$cache || me.getCache()).data,
+ maskShimEl = data.maskShimEl,
+ maskEl = data.maskEl,
+ maskMsg = data.maskMsg,
+ widthExpression, heightExpression;
+
+ if (!(bodyRe.test(dom.tagName) && me.getStyle('position') == 'static')) {
+ me.addCls(XMASKEDRELATIVE);
+ }
+
+
+ if (maskEl) {
+ maskEl.remove();
+ }
+
+ if (maskMsg) {
+ maskMsg.remove();
+ }
+
+ if (maskShimEl) {
+ maskShimEl.remove();
+ }
+
+ if (Ext.isIE6) {
+ maskShimEl = Ext.DomHelper.append(dom, {
+ tag: 'iframe',
+ cls : Ext.baseCSSPrefix + 'shim ' + Ext.baseCSSPrefix + 'mask-shim'
+ }, true);
+ data.maskShimEl = maskShimEl;
+ maskShimEl.setDisplayed(true);
+ }
+
+ Ext.DomHelper.append(dom, [{
+ cls : Ext.baseCSSPrefix + "mask",
+ style: 'top:0;left:0;'
+ }, {
+ cls : msgCls ? EXTELMASKMSG + " " + msgCls : EXTELMASKMSG,
+ cn : {
+ tag: 'div',
+ cls: Ext.baseCSSPrefix + 'mask-msg-inner',
+ cn: {
+ tag: 'div',
+ cls: Ext.baseCSSPrefix + 'mask-msg-text',
+ html: msg || ''
+ }
+ }
+ }]);
+
+ maskMsg = Ext.get(dom.lastChild);
+ maskEl = Ext.get(maskMsg.dom.previousSibling);
+ data.maskMsg = maskMsg;
+ data.maskEl = maskEl;
+
+ me.addCls(XMASKED);
+ maskEl.setDisplayed(true);
+
+ if (typeof msg == 'string') {
+ maskMsg.setDisplayed(true);
+ maskMsg.center(me);
+ } else {
+ maskMsg.setDisplayed(false);
+ }
+
+
+
+
+
+ if (!Ext.supports.IncludePaddingInWidthCalculation && setExpression) {
+
+ try {
+ maskEl.dom.style.setExpression('width', 'this.parentNode.clientWidth + "px"');
+ widthExpression = 'this.parentNode.clientWidth + "px"';
+ if (maskShimEl) {
+ maskShimEl.dom.style.setExpression('width', widthExpression);
+ }
+ maskEl.dom.style.setExpression('width', widthExpression);
+ } catch (e) {}
+ }
+
+
+
+ if (!Ext.supports.IncludePaddingInHeightCalculation && setExpression) {
+
+ try {
+ heightExpression = 'this.parentNode.' + (dom == DOC.body ? 'scrollHeight' : 'offsetHeight') + ' + "px"';
+ if (maskShimEl) {
+ maskShimEl.dom.style.setExpression('height', heightExpression);
+ }
+ maskEl.dom.style.setExpression('height', heightExpression);
+ } catch (e) {}
+ }
+
+ else if (Ext.isIE9m && !(Ext.isIE7 && Ext.isStrict) && me.getStyle('height') == 'auto') {
+ if (maskShimEl) {
+ maskShimEl.setSize(undefined, elHeight || me.getHeight());
+ }
+ maskEl.setSize(undefined, elHeight || me.getHeight());
+ }
+ return maskEl;
+ },
+
+
+ unmask : function() {
+ var me = this,
+ data = (me.$cache || me.getCache()).data,
+ maskEl = data.maskEl,
+ maskShimEl = data.maskShimEl,
+ maskMsg = data.maskMsg,
+ style;
+
+ if (maskEl) {
+ style = maskEl.dom.style;
+
+ if (style.clearExpression) {
+ style.clearExpression('width');
+ style.clearExpression('height');
+ }
+
+ if (maskEl) {
+ maskEl.remove();
+ delete data.maskEl;
+ }
+
+ if (maskMsg) {
+ maskMsg.remove();
+ delete data.maskMsg;
+ }
+
+ me.removeCls([XMASKED, XMASKEDRELATIVE]);
+
+ if (maskShimEl) {
+ style = maskShimEl.dom.style;
+
+ if (style.clearExpression) {
+ style.clearExpression('width');
+ style.clearExpression('height');
+ }
+
+ maskShimEl.remove();
+ delete data.maskShimEl;
+ }
+ }
+ },
+
+
+ isMasked : function() {
+ var me = this,
+ data = (me.$cache || me.getCache()).data,
+ maskEl = data.maskEl,
+ maskMsg = data.maskMsg,
+ hasMask = false;
+
+ if (maskEl && maskEl.isVisible()) {
+ if (maskMsg) {
+ maskMsg.center(me);
+ }
+ hasMask = true;
+ }
+ return hasMask;
+ },
+
+
+ createShim : function() {
+ var el = DOC.createElement('iframe'),
+ shim;
+
+ el.frameBorder = '0';
+ el.className = Ext.baseCSSPrefix + 'shim';
+ el.src = Ext.SSL_SECURE_URL;
+ shim = Ext.get(this.dom.parentNode.insertBefore(el, this.dom));
+ shim.autoBoxAdjust = false;
+ return shim;
+ },
+
+
+ addKeyListener : function(key, fn, scope){
+ var config;
+ if(typeof key != 'object' || Ext.isArray(key)){
+ config = {
+ target: this,
+ key: key,
+ fn: fn,
+ scope: scope
+ };
+ }else{
+ config = {
+ target: this,
+ key : key.key,
+ shift : key.shift,
+ ctrl : key.ctrl,
+ alt : key.alt,
+ fn: fn,
+ scope: scope
+ };
+ }
+ return new Ext.util.KeyMap(config);
+ },
+
+
+ addKeyMap : function(config) {
+ return new Ext.util.KeyMap(Ext.apply({
+ target: this
+ }, config));
+ },
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ on: function(eventName, fn, scope, options) {
+ Ext.EventManager.on(this, eventName, fn, scope || this, options);
+ return this;
+ },
+
+
+ un: function(eventName, fn, scope) {
+ Ext.EventManager.un(this, eventName, fn, scope || this);
+ return this;
+ },
+
+
+ removeAllListeners: function() {
+ Ext.EventManager.removeAll(this);
+ return this;
+ },
+
+
+ purgeAllListeners: function() {
+ Ext.EventManager.purgeElement(this);
+ return this;
+ },
+
+ select: function(selector) {
+ return Element.select(selector, false, this.dom);
+ }
+ };
+}, function() {
+
+ var DOC = document,
+ EC = Ext.cache,
+ Element = this,
+ AbstractElement = Ext.dom.AbstractElement,
+ focusRe = /^a|button|embed|iframe|input|object|select|textarea$/i,
+ nonSpaceRe = /\S/,
+ scriptTagRe = /(?: