-<html>\r
-<head>\r
- <title>The source code</title>\r
- <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
- <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
-</head>\r
-<body onload="prettyPrint();">\r
- <pre class="prettyprint lang-js">/**\r
- * @class Ext.Element\r
- */\r
-Ext.Element.addMethods({ \r
- <div id="method-Ext.Element-swallowEvent"></div>/**\r
- * Stops the specified event(s) from bubbling and optionally prevents the default action\r
- * @param {String/Array} eventName an event / array of events to stop from bubbling\r
- * @param {Boolean} preventDefault (optional) true to prevent the default action too\r
- * @return {Ext.Element} this\r
- */\r
- swallowEvent : function(eventName, preventDefault){\r
- var me = this;\r
- function fn(e){\r
- e.stopPropagation();\r
- if(preventDefault){\r
- e.preventDefault();\r
- }\r
- }\r
- if(Ext.isArray(eventName)){ \r
- Ext.each(eventName, function(e) {\r
- me.on(e, fn);\r
- });\r
- return me;\r
- }\r
- me.on(eventName, fn);\r
- return me;\r
- },\r
- \r
- <div id="method-Ext.Element-relayEvent"></div>/**\r
- * Create an event handler on this element such that when the event fires and is handled by this element,\r
- * it will be relayed to another object (i.e., fired again as if it originated from that object instead).\r
- * @param {String} eventName The type of event to relay\r
- * @param {Object} object Any object that extends {@link Ext.util.Observable} that will provide the context\r
- * for firing the relayed event\r
- */\r
- relayEvent : function(eventName, observable){\r
- this.on(eventName, function(e){\r
- observable.fireEvent(eventName, e);\r
- });\r
- },\r
- \r
- <div id="method-Ext.Element-clean"></div>/**\r
- * Removes worthless text nodes\r
- * @param {Boolean} forceReclean (optional) By default the element\r
- * keeps track if it has been cleaned already so\r
- * you can call this over and over. However, if you update the element and\r
- * need to force a reclean, you can pass true.\r
- */\r
- clean : function(forceReclean){\r
- var me = this, \r
- dom = me.dom,\r
- n = dom.firstChild, \r
- ni = -1;\r
- \r
- if(Ext.Element.data(dom, 'isCleaned') && forceReclean !== true){\r
- return me;\r
- } \r
- \r
- while(n){\r
- var nx = n.nextSibling;\r
- if(n.nodeType == 3 && !/\S/.test(n.nodeValue)){\r
- dom.removeChild(n);\r
- }else{\r
- n.nodeIndex = ++ni;\r
- }\r
- n = nx;\r
- }\r
- Ext.Element.data(dom, 'isCleaned', true);\r
- return me;\r
- },\r
- \r
- <div id="method-Ext.Element-load"></div>/**\r
- * Direct access to the Updater {@link Ext.Updater#update} method. The method takes the same object\r
- * parameter as {@link Ext.Updater#update}\r
- * @return {Ext.Element} this\r
- */\r
- load : function(){\r
- var um = this.getUpdater();\r
- um.update.apply(um, arguments);\r
- return this;\r
- },\r
-\r
- <div id="method-Ext.Element-getUpdater"></div>/**\r
- * Gets this element's {@link Ext.Updater Updater}\r
- * @return {Ext.Updater} The Updater\r
- */\r
- getUpdater : function(){\r
- return this.updateManager || (this.updateManager = new Ext.Updater(this));\r
- },\r
- \r
- <div id="method-Ext.Element-update"></div>/**\r
- * Update the innerHTML of this element, optionally searching for and processing scripts\r
- * @param {String} html The new HTML\r
- * @param {Boolean} loadScripts (optional) True to look for and process scripts (defaults to false)\r
- * @param {Function} callback (optional) For async script loading you can be notified when the update completes\r
- * @return {Ext.Element} this\r
- */\r
- update : function(html, loadScripts, callback){\r
- html = html || "";\r
- \r
- if(loadScripts !== true){\r
- this.dom.innerHTML = html;\r
- if(Ext.isFunction(callback)){\r
- callback();\r
- }\r
- return this;\r
- }\r
- \r
- var id = Ext.id(),\r
- dom = this.dom;\r
-\r
- html += '<span id="' + id + '"></span>';\r
-\r
- Ext.lib.Event.onAvailable(id, function(){\r
- var DOC = document,\r
- hd = DOC.getElementsByTagName("head")[0],\r
- re = /(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,\r
- srcRe = /\ssrc=([\'\"])(.*?)\1/i,\r
- typeRe = /\stype=([\'\"])(.*?)\1/i,\r
- match,\r
- attrs,\r
- srcMatch,\r
- typeMatch,\r
- el,\r
- s;\r
-\r
- while((match = re.exec(html))){\r
- attrs = match[1];\r
- srcMatch = attrs ? attrs.match(srcRe) : false;\r
- if(srcMatch && srcMatch[2]){\r
- s = DOC.createElement("script");\r
- s.src = srcMatch[2];\r
- typeMatch = attrs.match(typeRe);\r
- if(typeMatch && typeMatch[2]){\r
- s.type = typeMatch[2];\r
- }\r
- hd.appendChild(s);\r
- }else if(match[2] && match[2].length > 0){\r
- if(window.execScript) {\r
- window.execScript(match[2]);\r
- } else {\r
- window.eval(match[2]);\r
- }\r
- }\r
- }\r
- el = DOC.getElementById(id);\r
- if(el){Ext.removeNode(el);}\r
- if(Ext.isFunction(callback)){\r
- callback();\r
- }\r
- });\r
- dom.innerHTML = html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig, "");\r
- return this;\r
- },\r
- \r
- <div id="method-Ext.Element-createProxy"></div>/**\r
- * Creates a proxy element of this element\r
- * @param {String/Object} config The class name of the proxy element or a DomHelper config object\r
- * @param {String/HTMLElement} renderTo (optional) The element or element id to render the proxy to (defaults to document.body)\r
- * @param {Boolean} matchBox (optional) True to align and size the proxy to this element now (defaults to false)\r
- * @return {Ext.Element} The new proxy element\r
- */\r
- createProxy : function(config, renderTo, matchBox){\r
- config = Ext.isObject(config) ? config : {tag : "div", cls: config};\r
-\r
- var me = this,\r
- proxy = renderTo ? Ext.DomHelper.append(renderTo, config, true) :\r
- Ext.DomHelper.insertBefore(me.dom, config, true); \r
- \r
- if(matchBox && me.setBox && me.getBox){ // check to make sure Element.position.js is loaded\r
- proxy.setBox(me.getBox());\r
- }\r
- return proxy;\r
- }\r
-});\r
-\r
-Ext.Element.prototype.getUpdateManager = Ext.Element.prototype.getUpdater;\r
-\r
-// private\r
-Ext.Element.uncache = function(el){\r
- for(var i = 0, a = arguments, len = a.length; i < len; i++) {\r
- if(a[i]){\r
- delete Ext.Element.cache[a[i].id || a[i]];\r
- }\r
- }\r
-};</pre> \r
-</body>\r
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>The source code</title>
+ <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
+</head>
+<body onload="prettyPrint();">
+ <pre class="prettyprint lang-js">/*!
+ * Ext JS Library 3.2.0
+ * Copyright(c) 2006-2010 Ext JS, Inc.
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+/**
+ * @class Ext.Element
+ */
+Ext.Element.addMethods({
+ <div id="method-Ext.Element-swallowEvent"></div>/**
+ * Stops the specified event(s) from bubbling and optionally prevents the default action
+ * @param {String/Array} eventName an event / array of events to stop from bubbling
+ * @param {Boolean} preventDefault (optional) true to prevent the default action too
+ * @return {Ext.Element} this
+ */
+ swallowEvent : function(eventName, preventDefault){
+ var me = this;
+ function fn(e){
+ e.stopPropagation();
+ if(preventDefault){
+ e.preventDefault();
+ }
+ }
+ if(Ext.isArray(eventName)){
+ Ext.each(eventName, function(e) {
+ me.on(e, fn);
+ });
+ return me;
+ }
+ me.on(eventName, fn);
+ return me;
+ },
+
+ <div id="method-Ext.Element-relayEvent"></div>/**
+ * Create an event handler on this element such that when the event fires and is handled by this element,
+ * it will be relayed to another object (i.e., fired again as if it originated from that object instead).
+ * @param {String} eventName The type of event to relay
+ * @param {Object} object Any object that extends {@link Ext.util.Observable} that will provide the context
+ * for firing the relayed event
+ */
+ relayEvent : function(eventName, observable){
+ this.on(eventName, function(e){
+ observable.fireEvent(eventName, e);
+ });
+ },
+
+ <div id="method-Ext.Element-clean"></div>/**
+ * Removes worthless text nodes
+ * @param {Boolean} forceReclean (optional) By default the element
+ * keeps track if it has been cleaned already so
+ * you can call this over and over. However, if you update the element and
+ * need to force a reclean, you can pass true.
+ */
+ clean : function(forceReclean){
+ var me = this,
+ dom = me.dom,
+ n = dom.firstChild,
+ ni = -1;
+
+ if(Ext.Element.data(dom, 'isCleaned') && forceReclean !== true){
+ return me;
+ }
+
+ while(n){
+ var nx = n.nextSibling;
+ if(n.nodeType == 3 && !/\S/.test(n.nodeValue)){
+ dom.removeChild(n);
+ }else{
+ n.nodeIndex = ++ni;
+ }
+ n = nx;
+ }
+ Ext.Element.data(dom, 'isCleaned', true);
+ return me;
+ },
+
+ <div id="method-Ext.Element-load"></div>/**
+ * Direct access to the Updater {@link Ext.Updater#update} method. The method takes the same object
+ * parameter as {@link Ext.Updater#update}
+ * @return {Ext.Element} this
+ */
+ load : function(){
+ var um = this.getUpdater();
+ um.update.apply(um, arguments);
+ return this;
+ },
+
+ <div id="method-Ext.Element-getUpdater"></div>/**
+ * Gets this element's {@link Ext.Updater Updater}
+ * @return {Ext.Updater} The Updater
+ */
+ getUpdater : function(){
+ return this.updateManager || (this.updateManager = new Ext.Updater(this));
+ },
+
+ <div id="method-Ext.Element-update"></div>/**
+ * Update the innerHTML of this element, optionally searching for and processing scripts
+ * @param {String} html The new HTML
+ * @param {Boolean} loadScripts (optional) True to look for and process scripts (defaults to false)
+ * @param {Function} callback (optional) For async script loading you can be notified when the update completes
+ * @return {Ext.Element} this
+ */
+ update : function(html, loadScripts, callback){
+ if (!this.dom) {
+ return this;
+ }
+ html = html || "";
+
+ if(loadScripts !== true){
+ this.dom.innerHTML = html;
+ if(Ext.isFunction(callback)){
+ callback();
+ }
+ return this;
+ }
+
+ var id = Ext.id(),
+ dom = this.dom;
+
+ html += '<span id="' + id + '"></span>';
+
+ Ext.lib.Event.onAvailable(id, function(){
+ var DOC = document,
+ hd = DOC.getElementsByTagName("head")[0],
+ re = /(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,
+ srcRe = /\ssrc=([\'\"])(.*?)\1/i,
+ typeRe = /\stype=([\'\"])(.*?)\1/i,
+ match,
+ attrs,
+ srcMatch,
+ typeMatch,
+ el,
+ s;
+
+ while((match = re.exec(html))){
+ attrs = match[1];
+ srcMatch = attrs ? attrs.match(srcRe) : false;
+ if(srcMatch && srcMatch[2]){
+ s = DOC.createElement("script");
+ s.src = srcMatch[2];
+ typeMatch = attrs.match(typeRe);
+ if(typeMatch && typeMatch[2]){
+ s.type = typeMatch[2];
+ }
+ hd.appendChild(s);
+ }else if(match[2] && match[2].length > 0){
+ if(window.execScript) {
+ window.execScript(match[2]);
+ } else {
+ window.eval(match[2]);
+ }
+ }
+ }
+ el = DOC.getElementById(id);
+ if(el){Ext.removeNode(el);}
+ if(Ext.isFunction(callback)){
+ callback();
+ }
+ });
+ dom.innerHTML = html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig, "");
+ return this;
+ },
+
+ // inherit docs, overridden so we can add removeAnchor
+ removeAllListeners : function(){
+ this.removeAnchor();
+ Ext.EventManager.removeAll(this.dom);
+ return this;
+ },
+
+ <div id="method-Ext.Element-createProxy"></div>/**
+ * Creates a proxy element of this element
+ * @param {String/Object} config The class name of the proxy element or a DomHelper config object
+ * @param {String/HTMLElement} renderTo (optional) The element or element id to render the proxy to (defaults to document.body)
+ * @param {Boolean} matchBox (optional) True to align and size the proxy to this element now (defaults to false)
+ * @return {Ext.Element} The new proxy element
+ */
+ createProxy : function(config, renderTo, matchBox){
+ config = Ext.isObject(config) ? config : {tag : "div", cls: config};
+
+ var me = this,
+ proxy = renderTo ? Ext.DomHelper.append(renderTo, config, true) :
+ Ext.DomHelper.insertBefore(me.dom, config, true);
+
+ if(matchBox && me.setBox && me.getBox){ // check to make sure Element.position.js is loaded
+ proxy.setBox(me.getBox());
+ }
+ return proxy;
+ }
+});
+
+Ext.Element.prototype.getUpdateManager = Ext.Element.prototype.getUpdater;
+</pre>
+</body>
</html>
\ No newline at end of file