/ext-4.1.0_b3/docs/source/Ext-more.html

https://bitbucket.org/srogerf/javascript · HTML · 1210 lines · 1084 code · 126 blank · 0 comment · 0 complexity · dc1168173da1fe7af2f61d758e26c515 MD5 · raw file

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>The source code</title>
  6. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  7. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  8. <style type="text/css">
  9. .highlight { display: block; background-color: #ddd; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  17. <body onload="prettyPrint(); highlight();">
  18. <pre class="prettyprint lang-js"><span id='Ext'>/**
  19. </span> * @class Ext
  20. *
  21. * The Ext namespace (global object) encapsulates all classes, singletons, and
  22. * utility methods provided by Sencha's libraries.
  23. *
  24. * Most user interface Components are at a lower level of nesting in the namespace,
  25. * but many common utility functions are provided as direct properties of the Ext namespace.
  26. *
  27. * Also many frequently used methods from other classes are provided as shortcuts
  28. * within the Ext namespace. For example {@link Ext#getCmp Ext.getCmp} aliases
  29. * {@link Ext.ComponentManager#get Ext.ComponentManager.get}.
  30. *
  31. * Many applications are initiated with {@link Ext#onReady Ext.onReady} which is
  32. * called once the DOM is ready. This ensures all scripts have been loaded,
  33. * preventing dependency issues. For example:
  34. *
  35. * Ext.onReady(function(){
  36. * new Ext.Component({
  37. * renderTo: document.body,
  38. * html: 'DOM ready!'
  39. * });
  40. * });
  41. *
  42. * For more information about how to use the Ext classes, see:
  43. *
  44. * - &lt;a href=&quot;http://www.sencha.com/learn/&quot;&gt;The Learning Center&lt;/a&gt;
  45. * - &lt;a href=&quot;http://www.sencha.com/learn/Ext_FAQ&quot;&gt;The FAQ&lt;/a&gt;
  46. * - &lt;a href=&quot;http://www.sencha.com/forum/&quot;&gt;The forums&lt;/a&gt;
  47. *
  48. * @singleton
  49. */
  50. Ext.apply(Ext, {
  51. userAgent: navigator.userAgent.toLowerCase(),
  52. cache: {},
  53. idSeed: 1000,
  54. windowId: 'ext-window',
  55. documentId: 'ext-document',
  56. <span id='Ext-property-isReady'> /**
  57. </span> * True when the document is fully initialized and ready for action
  58. */
  59. isReady: false,
  60. <span id='Ext-property-enableGarbageCollector'> /**
  61. </span> * True to automatically uncache orphaned Ext.Elements periodically
  62. */
  63. enableGarbageCollector: true,
  64. <span id='Ext-property-enableListenerCollection'> /**
  65. </span> * True to automatically purge event listeners during garbageCollection.
  66. */
  67. enableListenerCollection: true,
  68. <span id='Ext-method-id'> /**
  69. </span> * Generates unique ids. If the element already has an id, it is unchanged
  70. * @param {HTMLElement/Ext.Element} [el] The element to generate an id for
  71. * @param {String} prefix (optional) Id prefix (defaults &quot;ext-gen&quot;)
  72. * @return {String} The generated Id.
  73. */
  74. id: function(el, prefix) {
  75. var me = this,
  76. sandboxPrefix = '';
  77. el = Ext.getDom(el, true) || {};
  78. if (el === document) {
  79. el.id = me.documentId;
  80. }
  81. else if (el === window) {
  82. el.id = me.windowId;
  83. }
  84. if (!el.id) {
  85. if (me.isSandboxed) {
  86. sandboxPrefix = Ext.sandboxName.toLowerCase() + '-';
  87. }
  88. el.id = sandboxPrefix + (prefix || &quot;ext-gen&quot;) + (++Ext.idSeed);
  89. }
  90. return el.id;
  91. },
  92. <span id='Ext-method-getBody'> /**
  93. </span> * Returns the current document body as an {@link Ext.Element}.
  94. * @return Ext.Element The document body
  95. */
  96. getBody: function() {
  97. var body;
  98. return function() {
  99. return body || (body = Ext.get(document.body));
  100. };
  101. }(),
  102. <span id='Ext-method-getHead'> /**
  103. </span> * Returns the current document head as an {@link Ext.Element}.
  104. * @return Ext.Element The document head
  105. * @method
  106. */
  107. getHead: function() {
  108. var head;
  109. return function() {
  110. return head || (head = Ext.get(document.getElementsByTagName(&quot;head&quot;)[0]));
  111. };
  112. }(),
  113. <span id='Ext-method-getDoc'> /**
  114. </span> * Returns the current HTML document object as an {@link Ext.Element}.
  115. * @return Ext.Element The document
  116. */
  117. getDoc: function() {
  118. var doc;
  119. return function() {
  120. return doc || (doc = Ext.get(document));
  121. };
  122. }(),
  123. <span id='Ext-method-getCmp'> /**
  124. </span> * This is shorthand reference to {@link Ext.ComponentManager#get}.
  125. * Looks up an existing {@link Ext.Component Component} by {@link Ext.Component#id id}
  126. *
  127. * @param {String} id The component {@link Ext.Component#id id}
  128. * @return Ext.Component The Component, `undefined` if not found, or `null` if a
  129. * Class was found.
  130. */
  131. getCmp: function(id) {
  132. return Ext.ComponentManager.get(id);
  133. },
  134. <span id='Ext-method-getOrientation'> /**
  135. </span> * Returns the current orientation of the mobile device
  136. * @return {String} Either 'portrait' or 'landscape'
  137. */
  138. getOrientation: function() {
  139. return window.innerHeight &gt; window.innerWidth ? 'portrait' : 'landscape';
  140. },
  141. <span id='Ext-method-destroy'> /**
  142. </span> * Attempts to destroy any objects passed to it by removing all event listeners, removing them from the
  143. * DOM (if applicable) and calling their destroy functions (if available). This method is primarily
  144. * intended for arguments of type {@link Ext.Element} and {@link Ext.Component}, but any subclass of
  145. * {@link Ext.util.Observable} can be passed in. Any number of elements and/or components can be
  146. * passed into this function in a single call as separate arguments.
  147. *
  148. * @param {Ext.Element/Ext.Component/Ext.Element[]/Ext.Component[]...} args
  149. * An {@link Ext.Element}, {@link Ext.Component}, or an Array of either of these to destroy
  150. */
  151. destroy: function() {
  152. var ln = arguments.length,
  153. i, arg;
  154. for (i = 0; i &lt; ln; i++) {
  155. arg = arguments[i];
  156. if (arg) {
  157. if (Ext.isArray(arg)) {
  158. this.destroy.apply(this, arg);
  159. }
  160. else if (Ext.isFunction(arg.destroy)) {
  161. arg.destroy();
  162. }
  163. else if (arg.dom) {
  164. arg.remove();
  165. }
  166. }
  167. }
  168. },
  169. <span id='Ext-method-callback'> /**
  170. </span> * Execute a callback function in a particular scope. If no function is passed the call is ignored.
  171. *
  172. * For example, these lines are equivalent:
  173. *
  174. * Ext.callback(myFunc, this, [arg1, arg2]);
  175. * Ext.isFunction(myFunc) &amp;&amp; myFunc.apply(this, [arg1, arg2]);
  176. *
  177. * @param {Function} callback The callback to execute
  178. * @param {Object} [scope] The scope to execute in
  179. * @param {Array} [args] The arguments to pass to the function
  180. * @param {Number} [delay] Pass a number to delay the call by a number of milliseconds.
  181. */
  182. callback: function(callback, scope, args, delay){
  183. if(Ext.isFunction(callback)){
  184. args = args || [];
  185. scope = scope || window;
  186. if (delay) {
  187. Ext.defer(callback, delay, scope, args);
  188. } else {
  189. callback.apply(scope, args);
  190. }
  191. }
  192. },
  193. <span id='Ext-method-htmlEncode'> /**
  194. </span> * Alias for {@link Ext.String#htmlEncode}.
  195. * @inheritdoc Ext.String#htmlEncode
  196. */
  197. htmlEncode : function(value) {
  198. return Ext.String.htmlEncode(value);
  199. },
  200. <span id='Ext-method-htmlDecode'> /**
  201. </span> * Alias for {@link Ext.String#htmlDecode}.
  202. * @inheritdoc Ext.String#htmlDecode
  203. */
  204. htmlDecode : function(value) {
  205. return Ext.String.htmlDecode(value);
  206. },
  207. <span id='Ext-method-urlAppend'> /**
  208. </span> * Alias for {@link Ext.String#urlAppend}.
  209. * @inheritdoc Ext.String#urlAppend
  210. */
  211. urlAppend : function(url, s) {
  212. return Ext.String.urlAppend(url, s);
  213. }
  214. });
  215. Ext.ns = Ext.namespace;
  216. // for old browsers
  217. window.undefined = window.undefined;
  218. <span id='Ext'>/**
  219. </span> * @class Ext
  220. */
  221. (function(){
  222. /*
  223. FF 3.6 - Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17
  224. FF 4.0.1 - Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
  225. FF 5.0 - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
  226. IE6 - Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;)
  227. IE7 - Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1;)
  228. IE8 - Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
  229. IE9 - Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
  230. Chrome 11 - Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.60 Safari/534.24
  231. Safari 5 - Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1
  232. Opera 11.11 - Opera/9.80 (Windows NT 6.1; U; en) Presto/2.8.131 Version/11.11
  233. */
  234. var check = function(regex){
  235. return regex.test(Ext.userAgent);
  236. },
  237. isStrict = document.compatMode == &quot;CSS1Compat&quot;,
  238. version = function (is, regex) {
  239. var m;
  240. return (is &amp;&amp; (m = regex.exec(Ext.userAgent))) ? parseFloat(m[1]) : 0;
  241. },
  242. docMode = document.documentMode,
  243. isOpera = check(/opera/),
  244. isOpera10_5 = isOpera &amp;&amp; check(/version\/10\.5/),
  245. isChrome = check(/\bchrome\b/),
  246. isWebKit = check(/webkit/),
  247. isSafari = !isChrome &amp;&amp; check(/safari/),
  248. isSafari2 = isSafari &amp;&amp; check(/applewebkit\/4/), // unique to Safari 2
  249. isSafari3 = isSafari &amp;&amp; check(/version\/3/),
  250. isSafari4 = isSafari &amp;&amp; check(/version\/4/),
  251. isSafari5 = isSafari &amp;&amp; check(/version\/5/),
  252. isIE = !isOpera &amp;&amp; check(/msie/),
  253. isIE7 = isIE &amp;&amp; ((check(/msie 7/) &amp;&amp; docMode != 8 &amp;&amp; docMode != 9) || docMode == 7),
  254. isIE8 = isIE &amp;&amp; ((check(/msie 8/) &amp;&amp; docMode != 7 &amp;&amp; docMode != 9) || docMode == 8),
  255. isIE9 = isIE &amp;&amp; ((check(/msie 9/) &amp;&amp; docMode != 7 &amp;&amp; docMode != 8) || docMode == 9),
  256. isIE6 = isIE &amp;&amp; check(/msie 6/),
  257. isGecko = !isWebKit &amp;&amp; check(/gecko/),
  258. isGecko3 = isGecko &amp;&amp; check(/rv:1\.9/),
  259. isGecko4 = isGecko &amp;&amp; check(/rv:2\.0/),
  260. isGecko5 = isGecko &amp;&amp; check(/rv:5\./),
  261. isGecko10 = isGecko &amp;&amp; check(/rv:10\./),
  262. isFF3_0 = isGecko3 &amp;&amp; check(/rv:1\.9\.0/),
  263. isFF3_5 = isGecko3 &amp;&amp; check(/rv:1\.9\.1/),
  264. isFF3_6 = isGecko3 &amp;&amp; check(/rv:1\.9\.2/),
  265. isWindows = check(/windows|win32/),
  266. isMac = check(/macintosh|mac os x/),
  267. isLinux = check(/linux/),
  268. scrollbarSize = null,
  269. chromeVersion = version(true, /\bchrome\/(\d+\.\d+)/),
  270. firefoxVersion = version(true, /\bfirefox\/(\d+\.\d+)/),
  271. ieVersion = version(isIE, /msie (\d+\.\d+)/),
  272. operaVersion = version(isOpera, /version\/(\d+\.\d+)/),
  273. safariVersion = version(isSafari, /version\/(\d+\.\d+)/),
  274. webKitVersion = version(isWebKit, /webkit\/(\d+\.\d+)/),
  275. isSecure = /^https/i.test(window.location.protocol);
  276. // remove css image flicker
  277. try {
  278. document.execCommand(&quot;BackgroundImageCache&quot;, false, true);
  279. } catch(e) {}
  280. //&lt;debug&gt;
  281. var primitiveRe = /string|number|boolean/;
  282. function dumpObject (object) {
  283. var member, type, value, name,
  284. members = [];
  285. // Cannot use Ext.encode since it can recurse endlessly (if we're lucky)
  286. // ...and the data could be prettier!
  287. for (name in object) {
  288. if (object.hasOwnProperty(name)) {
  289. value = object[name];
  290. type = typeof value;
  291. if (type == &quot;function&quot;) {
  292. continue;
  293. }
  294. if (type == 'undefined') {
  295. member = type;
  296. } else if (value === null || primitiveRe.test(type) || Ext.isDate(value)) {
  297. member = Ext.encode(value);
  298. } else if (Ext.isArray(value)) {
  299. member = '[ ]';
  300. } else if (Ext.isObject(value)) {
  301. member = '{ }';
  302. } else {
  303. member = type;
  304. }
  305. members.push(Ext.encode(name) + ': ' + member);
  306. }
  307. }
  308. if (members.length) {
  309. return ' \nData: {\n ' + members.join(',\n ') + '\n}';
  310. }
  311. return '';
  312. }
  313. function log (message) {
  314. var options, dump,
  315. con = Ext.global.console,
  316. level = 'log',
  317. indent = log.indent || 0,
  318. stack;
  319. log.indent = indent;
  320. if (typeof message != 'string') {
  321. options = message;
  322. message = options.msg || '';
  323. level = options.level || level;
  324. dump = options.dump;
  325. stack = options.stack;
  326. if (options.indent) {
  327. ++log.indent;
  328. } else if (options.outdent) {
  329. log.indent = indent = Math.max(indent - 1, 0);
  330. }
  331. if (dump &amp;&amp; !(con &amp;&amp; con.dir)) {
  332. message += dumpObject(dump);
  333. dump = null;
  334. }
  335. }
  336. if (arguments.length &gt; 1) {
  337. message += Array.prototype.slice.call(arguments, 1).join('');
  338. }
  339. message = indent ? Ext.String.repeat(' ', log.indentSize * indent) + message : message;
  340. // w/o console, all messages are equal, so munge the level into the message:
  341. if (level != 'log') {
  342. message = '[' + level.charAt(0).toUpperCase() + '] ' + message;
  343. }
  344. // Not obvious, but 'console' comes and goes when Firebug is turned on/off, so
  345. // an early test may fail either direction if Firebug is toggled.
  346. //
  347. if (con) { // if (Firebug-like console)
  348. if (con[level]) {
  349. con[level](message);
  350. } else {
  351. con.log(message);
  352. }
  353. if (dump) {
  354. con.dir(dump);
  355. }
  356. if (stack &amp;&amp; con.trace) {
  357. // Firebug's console.error() includes a trace already...
  358. if (!con.firebug || level != 'error') {
  359. con.trace();
  360. }
  361. }
  362. } else {
  363. if (Ext.isOpera) {
  364. opera.postError(message);
  365. } else {
  366. var out = log.out,
  367. max = log.max;
  368. if (out.length &gt;= max) {
  369. // this formula allows out.max to change (via debugger), where the
  370. // more obvious &quot;max/4&quot; would not quite be the same
  371. Ext.Array.erase(out, 0, out.length - 3 * Math.floor(max / 4)); // keep newest 75%
  372. }
  373. out.push(message);
  374. }
  375. }
  376. // Mostly informational, but the Ext.Error notifier uses them:
  377. ++log.count;
  378. ++log.counters[level];
  379. }
  380. function logx (level, args) {
  381. if (typeof args[0] == 'string') {
  382. args.unshift({});
  383. }
  384. args[0].level = level;
  385. log.apply(this, args);
  386. }
  387. log.error = function () {
  388. logx('error', Array.prototype.slice.call(arguments));
  389. }
  390. log.info = function () {
  391. logx('info', Array.prototype.slice.call(arguments));
  392. }
  393. log.warn = function () {
  394. logx('warn', Array.prototype.slice.call(arguments));
  395. }
  396. log.count = 0;
  397. log.counters = { error: 0, warn: 0, info: 0, log: 0 };
  398. log.indentSize = 2;
  399. log.out = [];
  400. log.max = 750;
  401. log.show = function () {
  402. window.open('','extlog').document.write([
  403. '&lt;html&gt;&lt;head&gt;&lt;script type=&quot;text/javascript&quot;&gt;',
  404. 'var lastCount = 0;',
  405. 'function update () {',
  406. 'var ext = window.opener.Ext,',
  407. 'extlog = ext &amp;&amp; ext.log;',
  408. 'if (extlog &amp;&amp; extlog.out &amp;&amp; lastCount != extlog.count) {',
  409. 'lastCount = extlog.count;',
  410. 'var s = &quot;&lt;tt&gt;&quot; + extlog.out.join(&quot;~~~&quot;).replace(/[&amp;]/g, &quot;&amp;amp;&quot;).replace(/[&lt;]/g, &quot;&amp;lt;&quot;).replace(/[ ]/g, &quot;&amp;nbsp;&quot;).replace(/\\~\\~\\~/g, &quot;&lt;br&gt;&quot;) + &quot;&lt;/tt&gt;&quot;;',
  411. 'document.body.innerHTML = s;',
  412. '}',
  413. 'setTimeout(update, 1000);',
  414. '}',
  415. 'setTimeout(update, 1000);',
  416. '&lt;/script&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;'].join(''));
  417. };
  418. //&lt;/debug&gt;
  419. var nullLog = function () {};
  420. nullLog.info = nullLog.warn = nullLog.error = Ext.emptyFn;
  421. Ext.setVersion('extjs', '4.1.0');
  422. Ext.apply(Ext, {
  423. <span id='Ext-property-SSL_SECURE_URL'> /**
  424. </span> * @property {String} SSL_SECURE_URL
  425. * URL to a blank file used by Ext when in secure mode for iframe src and onReady src
  426. * to prevent the IE insecure content warning (`'about:blank'`, except for IE
  427. * in secure mode, which is `'javascript:&quot;&quot;'`).
  428. */
  429. SSL_SECURE_URL : isSecure &amp;&amp; isIE ? 'javascript:\'\'' : 'about:blank',
  430. <span id='Ext-property-enableFx'> /**
  431. </span> * @property {Boolean} enableFx
  432. * True if the {@link Ext.fx.Anim} Class is available.
  433. */
  434. <span id='Ext-property-scopeResetCSS'> /**
  435. </span> * @property {Boolean} scopeResetCSS
  436. * True to scope the reset CSS to be just applied to Ext components. Note that this
  437. * wraps root containers with an additional element. Also remember that when you turn
  438. * on this option, you have to use ext-all-scoped (unless you use the bootstrap.js to
  439. * load your javascript, in which case it will be handled for you).
  440. */
  441. scopeResetCSS : Ext.buildSettings.scopeResetCSS,
  442. <span id='Ext-property-resetCls'> /**
  443. </span> * @property {String} resetCls
  444. * The css class used to wrap Ext components when the {@link #scopeResetCSS} option
  445. * is used.
  446. */
  447. resetCls: Ext.buildSettings.baseCSSPrefix + 'reset',
  448. <span id='Ext-property-enableNestedListenerRemoval'> /**
  449. </span> * @property {Boolean} enableNestedListenerRemoval
  450. * **Experimental.** True to cascade listener removal to child elements when an element
  451. * is removed. Currently not optimized for performance.
  452. */
  453. enableNestedListenerRemoval : false,
  454. <span id='Ext-property-USE_NATIVE_JSON'> /**
  455. </span> * @property {Boolean} USE_NATIVE_JSON
  456. * Indicates whether to use native browser parsing for JSON methods.
  457. * This option is ignored if the browser does not support native JSON methods.
  458. *
  459. * **Note:** Native JSON methods will not work with objects that have functions.
  460. * Also, property names must be quoted, otherwise the data will not parse.
  461. */
  462. USE_NATIVE_JSON : false,
  463. <span id='Ext-method-getDom'> /**
  464. </span> * Returns the dom node for the passed String (id), dom node, or Ext.Element.
  465. * Optional 'strict' flag is needed for IE since it can return 'name' and
  466. * 'id' elements by using getElementById.
  467. *
  468. * Here are some examples:
  469. *
  470. * // gets dom node based on id
  471. * var elDom = Ext.getDom('elId');
  472. * // gets dom node based on the dom node
  473. * var elDom1 = Ext.getDom(elDom);
  474. *
  475. * // If we don&amp;#39;t know if we are working with an
  476. * // Ext.Element or a dom node use Ext.getDom
  477. * function(el){
  478. * var dom = Ext.getDom(el);
  479. * // do something with the dom node
  480. * }
  481. *
  482. * **Note:** the dom node to be found actually needs to exist (be rendered, etc)
  483. * when this method is called to be successful.
  484. *
  485. * @param {String/HTMLElement/Ext.Element} el
  486. * @return HTMLElement
  487. */
  488. getDom : function(el, strict) {
  489. if (!el || !document) {
  490. return null;
  491. }
  492. if (el.dom) {
  493. return el.dom;
  494. } else {
  495. if (typeof el == 'string') {
  496. var e = Ext.getElementById(el);
  497. // IE returns elements with the 'name' and 'id' attribute.
  498. // we do a strict check to return the element with only the id attribute
  499. if (e &amp;&amp; isIE &amp;&amp; strict) {
  500. if (el == e.getAttribute('id')) {
  501. return e;
  502. } else {
  503. return null;
  504. }
  505. }
  506. return e;
  507. } else {
  508. return el;
  509. }
  510. }
  511. },
  512. <span id='Ext-method-removeNode'> /**
  513. </span> * Removes a DOM node from the document.
  514. *
  515. * Removes this element from the document, removes all DOM event listeners, and
  516. * deletes the cache reference. All DOM event listeners are removed from this element.
  517. * If {@link Ext#enableNestedListenerRemoval Ext.enableNestedListenerRemoval} is
  518. * `true`, then DOM event listeners are also removed from all child nodes.
  519. * The body node will be ignored if passed in.
  520. *
  521. * @param {HTMLElement} node The node to remove
  522. * @method
  523. */
  524. removeNode : isIE6 || isIE7 ? function() {
  525. var d;
  526. return function(n){
  527. if(n &amp;&amp; n.tagName != 'BODY'){
  528. (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n) : Ext.EventManager.removeAll(n);
  529. d = d || document.createElement('div');
  530. d.appendChild(n);
  531. d.innerHTML = '';
  532. delete Ext.cache[n.id];
  533. }
  534. };
  535. }() : function(n) {
  536. if (n &amp;&amp; n.parentNode &amp;&amp; n.tagName != 'BODY') {
  537. (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n) : Ext.EventManager.removeAll(n);
  538. n.parentNode.removeChild(n);
  539. delete Ext.cache[n.id];
  540. }
  541. },
  542. isStrict: isStrict,
  543. isIEQuirks: isIE &amp;&amp; !isStrict,
  544. <span id='Ext-property-isOpera'> /**
  545. </span> * True if the detected browser is Opera.
  546. * @type Boolean
  547. */
  548. isOpera : isOpera,
  549. <span id='Ext-property-isOpera10_5'> /**
  550. </span> * True if the detected browser is Opera 10.5x.
  551. * @type Boolean
  552. */
  553. isOpera10_5 : isOpera10_5,
  554. <span id='Ext-property-isWebKit'> /**
  555. </span> * True if the detected browser uses WebKit.
  556. * @type Boolean
  557. */
  558. isWebKit : isWebKit,
  559. <span id='Ext-property-isChrome'> /**
  560. </span> * True if the detected browser is Chrome.
  561. * @type Boolean
  562. */
  563. isChrome : isChrome,
  564. <span id='Ext-property-isSafari'> /**
  565. </span> * True if the detected browser is Safari.
  566. * @type Boolean
  567. */
  568. isSafari : isSafari,
  569. <span id='Ext-property-isSafari3'> /**
  570. </span> * True if the detected browser is Safari 3.x.
  571. * @type Boolean
  572. */
  573. isSafari3 : isSafari3,
  574. <span id='Ext-property-isSafari4'> /**
  575. </span> * True if the detected browser is Safari 4.x.
  576. * @type Boolean
  577. */
  578. isSafari4 : isSafari4,
  579. <span id='Ext-property-isSafari5'> /**
  580. </span> * True if the detected browser is Safari 5.x.
  581. * @type Boolean
  582. */
  583. isSafari5 : isSafari5,
  584. <span id='Ext-property-isSafari2'> /**
  585. </span> * True if the detected browser is Safari 2.x.
  586. * @type Boolean
  587. */
  588. isSafari2 : isSafari2,
  589. <span id='Ext-property-isIE'> /**
  590. </span> * True if the detected browser is Internet Explorer.
  591. * @type Boolean
  592. */
  593. isIE : isIE,
  594. <span id='Ext-property-isIE6'> /**
  595. </span> * True if the detected browser is Internet Explorer 6.x.
  596. * @type Boolean
  597. */
  598. isIE6 : isIE6,
  599. <span id='Ext-property-isIE7'> /**
  600. </span> * True if the detected browser is Internet Explorer 7.x.
  601. * @type Boolean
  602. */
  603. isIE7 : isIE7,
  604. <span id='Ext-property-isIE8'> /**
  605. </span> * True if the detected browser is Internet Explorer 8.x.
  606. * @type Boolean
  607. */
  608. isIE8 : isIE8,
  609. <span id='Ext-property-isIE9'> /**
  610. </span> * True if the detected browser is Internet Explorer 9.x.
  611. * @type Boolean
  612. */
  613. isIE9 : isIE9,
  614. <span id='Ext-property-isGecko'> /**
  615. </span> * True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox).
  616. * @type Boolean
  617. */
  618. isGecko : isGecko,
  619. <span id='Ext-property-isGecko3'> /**
  620. </span> * True if the detected browser uses a Gecko 1.9+ layout engine (e.g. Firefox 3.x).
  621. * @type Boolean
  622. */
  623. isGecko3 : isGecko3,
  624. <span id='Ext-property-isGecko4'> /**
  625. </span> * True if the detected browser uses a Gecko 2.0+ layout engine (e.g. Firefox 4.x).
  626. * @type Boolean
  627. */
  628. isGecko4 : isGecko4,
  629. <span id='Ext-property-isGecko5'> /**
  630. </span> * True if the detected browser uses a Gecko 5.0+ layout engine (e.g. Firefox 5.x).
  631. * @type Boolean
  632. */
  633. isGecko5 : isGecko5,
  634. <span id='Ext-property-isGecko10'> /**
  635. </span> * True if the detected browser uses a Gecko 5.0+ layout engine (e.g. Firefox 5.x).
  636. * @type Boolean
  637. */
  638. isGecko10 : isGecko10,
  639. <span id='Ext-property-isFF3_0'> /**
  640. </span> * True if the detected browser uses FireFox 3.0
  641. * @type Boolean
  642. */
  643. isFF3_0 : isFF3_0,
  644. <span id='Ext-property-isFF3_5'> /**
  645. </span> * True if the detected browser uses FireFox 3.5
  646. * @type Boolean
  647. */
  648. isFF3_5 : isFF3_5,
  649. <span id='Ext-property-isFF3_6'> /**
  650. </span> * True if the detected browser uses FireFox 3.6
  651. * @type Boolean
  652. */
  653. isFF3_6 : isFF3_6,
  654. <span id='Ext-property-isFF4'> /**
  655. </span> * True if the detected browser uses FireFox 4
  656. * @type Boolean
  657. */
  658. isFF4 : 4 &lt;= firefoxVersion &amp;&amp; firefoxVersion &lt; 5,
  659. <span id='Ext-property-isFF5'> /**
  660. </span> * True if the detected browser uses FireFox 5
  661. * @type Boolean
  662. */
  663. isFF5 : 5 &lt;= firefoxVersion &amp;&amp; firefoxVersion &lt; 6,
  664. <span id='Ext-property-isFF10'> /**
  665. </span> * True if the detected browser uses FireFox 10
  666. * @type Boolean
  667. */
  668. isFF10 : 10 &lt;= firefoxVersion &amp;&amp; firefoxVersion &lt; 11,
  669. <span id='Ext-property-isLinux'> /**
  670. </span> * True if the detected platform is Linux.
  671. * @type Boolean
  672. */
  673. isLinux : isLinux,
  674. <span id='Ext-property-isWindows'> /**
  675. </span> * True if the detected platform is Windows.
  676. * @type Boolean
  677. */
  678. isWindows : isWindows,
  679. <span id='Ext-property-isMac'> /**
  680. </span> * True if the detected platform is Mac OS.
  681. * @type Boolean
  682. */
  683. isMac : isMac,
  684. <span id='Ext-property-chromeVersion'> /**
  685. </span> * The current version of Chrome (0 if the browser is not Chrome).
  686. * @type Number
  687. */
  688. chromeVersion: chromeVersion,
  689. <span id='Ext-property-firefoxVersion'> /**
  690. </span> * The current version of Firefox (0 if the browser is not Firefox).
  691. * @type Number
  692. */
  693. firefoxVersion: firefoxVersion,
  694. <span id='Ext-property-ieVersion'> /**
  695. </span> * The current version of IE (0 if the browser is not IE). This does not account
  696. * for the documentMode of the current page, which is factored into {@link #isIE7},
  697. * {@link #isIE8} and {@link #isIE9}. Thus this is not always true:
  698. *
  699. * Ext.isIE8 == (Ext.ieVersion == 8)
  700. *
  701. * @type Number
  702. */
  703. ieVersion: ieVersion,
  704. <span id='Ext-property-operaVersion'> /**
  705. </span> * The current version of Opera (0 if the browser is not Opera).
  706. * @type Number
  707. */
  708. operaVersion: operaVersion,
  709. <span id='Ext-property-safariVersion'> /**
  710. </span> * The current version of Safari (0 if the browser is not Safari).
  711. * @type Number
  712. */
  713. safariVersion: safariVersion,
  714. <span id='Ext-property-webKitVersion'> /**
  715. </span> * The current version of WebKit (0 if the browser does not use WebKit).
  716. * @type Number
  717. */
  718. webKitVersion: webKitVersion,
  719. <span id='Ext-property-isSecure'> /**
  720. </span> * True if the page is running over SSL
  721. * @type Boolean
  722. */
  723. isSecure: isSecure,
  724. <span id='Ext-property-BLANK_IMAGE_URL'> /**
  725. </span> * URL to a 1x1 transparent gif image used by Ext to create inline icons with
  726. * CSS background images. In older versions of IE, this defaults to
  727. * &quot;http://sencha.com/s.gif&quot; and you should change this to a URL on your server.
  728. * For other browsers it uses an inline data URL.
  729. * @type String
  730. */
  731. BLANK_IMAGE_URL : (isIE6 || isIE7) ? '/' + '/www.sencha.com/s.gif' : 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==',
  732. <span id='Ext-method-value'> /**
  733. </span> * Utility method for returning a default value if the passed value is empty.
  734. *
  735. * The value is deemed to be empty if it is:
  736. *
  737. * - null
  738. * - undefined
  739. * - an empty array
  740. * - a zero length string (Unless the `allowBlank` parameter is `true`)
  741. *
  742. * @param {Object} value The value to test
  743. * @param {Object} defaultValue The value to return if the original value is empty
  744. * @param {Boolean} [allowBlank=false] true to allow zero length strings to qualify as non-empty.
  745. * @return {Object} value, if non-empty, else defaultValue
  746. * @deprecated 4.0.0 Use {@link Ext#valueFrom} instead
  747. */
  748. value : function(v, defaultValue, allowBlank){
  749. return Ext.isEmpty(v, allowBlank) ? defaultValue : v;
  750. },
  751. <span id='Ext-method-escapeRe'> /**
  752. </span> * Escapes the passed string for use in a regular expression.
  753. * @param {String} str
  754. * @return {String}
  755. * @deprecated 4.0.0 Use {@link Ext.String#escapeRegex} instead
  756. */
  757. escapeRe : function(s) {
  758. return s.replace(/([-.*+?^${}()|[\]\/\\])/g, &quot;\\$1&quot;);
  759. },
  760. <span id='Ext-method-addBehaviors'> /**
  761. </span> * Applies event listeners to elements by selectors when the document is ready.
  762. * The event name is specified with an `@` suffix.
  763. *
  764. * Ext.addBehaviors({
  765. * // add a listener for click on all anchors in element with id foo
  766. * '#foo a@click' : function(e, t){
  767. * // do something
  768. * },
  769. *
  770. * // add the same listener to multiple selectors (separated by comma BEFORE the @)
  771. * '#foo a, #bar span.some-class@mouseover' : function(){
  772. * // do something
  773. * }
  774. * });
  775. *
  776. * @param {Object} obj The list of behaviors to apply
  777. */
  778. addBehaviors : function(o){
  779. if(!Ext.isReady){
  780. Ext.onReady(function(){
  781. Ext.addBehaviors(o);
  782. });
  783. } else {
  784. var cache = {}, // simple cache for applying multiple behaviors to same selector does query multiple times
  785. parts,
  786. b,
  787. s;
  788. for (b in o) {
  789. if ((parts = b.split('@'))[1]) { // for Object prototype breakers
  790. s = parts[0];
  791. if(!cache[s]){
  792. cache[s] = Ext.select(s);
  793. }
  794. cache[s].on(parts[1], o[b]);
  795. }
  796. }
  797. cache = null;
  798. }
  799. },
  800. <span id='Ext-method-getScrollbarSize'> /**
  801. </span> * Returns the size of the browser scrollbars. This can differ depending on
  802. * operating system settings, such as the theme or font size.
  803. * @param {Boolean} [force] true to force a recalculation of the value.
  804. * @return {Object} An object containing scrollbar sizes.
  805. * @return.width {Number} The width of the vertical scrollbar.
  806. * @return.height {Number} The height of the horizontal scrollbar.
  807. */
  808. getScrollbarSize: function (force) {
  809. if (!Ext.isReady) {
  810. return {};
  811. }
  812. if (force || !scrollbarSize) {
  813. var db = document.body,
  814. div = document.createElement('div');
  815. div.style.width = div.style.height = '100px';
  816. div.style.overflow = 'scroll';
  817. div.style.position = 'absolute';
  818. db.appendChild(div); // now we can measure the div...
  819. // at least in iE9 the div is not 100px - the scrollbar size is removed!
  820. scrollbarSize = {
  821. width: div.offsetWidth - div.clientWidth,
  822. height: div.offsetHeight - div.clientHeight
  823. };
  824. db.removeChild(div);
  825. }
  826. return scrollbarSize;
  827. },
  828. <span id='Ext-method-getScrollBarWidth'> /**
  829. </span> * Utility method for getting the width of the browser's vertical scrollbar. This
  830. * can differ depending on operating system settings, such as the theme or font size.
  831. *
  832. * This method is deprected in favor of {@link #getScrollbarSize}.
  833. *
  834. * @param {Boolean} [force] true to force a recalculation of the value.
  835. * @return {Number} The width of a vertical scrollbar.
  836. * @deprecated
  837. */
  838. getScrollBarWidth: function(force){
  839. var size = Ext.getScrollbarSize(force);
  840. return size.width + 2; // legacy fudge factor
  841. },
  842. <span id='Ext-method-copyTo'> /**
  843. </span> * Copies a set of named properties fom the source object to the destination object.
  844. *
  845. * Example:
  846. *
  847. * ImageComponent = Ext.extend(Ext.Component, {
  848. * initComponent: function() {
  849. * this.autoEl = { tag: 'img' };
  850. * MyComponent.superclass.initComponent.apply(this, arguments);
  851. * this.initialBox = Ext.copyTo({}, this.initialConfig, 'x,y,width,height');
  852. * }
  853. * });
  854. *
  855. * Important note: To borrow class prototype methods, use {@link Ext.Base#borrow} instead.
  856. *
  857. * @param {Object} dest The destination object.
  858. * @param {Object} source The source object.
  859. * @param {String/String[]} names Either an Array of property names, or a comma-delimited list
  860. * of property names to copy.
  861. * @param {Boolean} [usePrototypeKeys] Defaults to false. Pass true to copy keys off of the
  862. * prototype as well as the instance.
  863. * @return {Object} The modified object.
  864. */
  865. copyTo : function(dest, source, names, usePrototypeKeys){
  866. if(typeof names == 'string'){
  867. names = names.split(/[,;\s]/);
  868. }
  869. var n,
  870. nLen = names.length,
  871. name;
  872. for(n = 0; n &lt; nLen; n++) {
  873. name = names[n];
  874. if(usePrototypeKeys || source.hasOwnProperty(name)){
  875. dest[name] = source[name];
  876. }
  877. }
  878. return dest;
  879. },
  880. <span id='Ext-method-destroyMembers'> /**
  881. </span> * Attempts to destroy and then remove a set of named properties of the passed object.
  882. * @param {Object} o The object (most likely a Component) who's properties you wish to destroy.
  883. * @param {String...} args One or more names of the properties to destroy and remove from the object.
  884. */
  885. destroyMembers : function(o){
  886. for (var i = 1, a = arguments, len = a.length; i &lt; len; i++) {
  887. Ext.destroy(o[a[i]]);
  888. delete o[a[i]];
  889. }
  890. },
  891. <span id='Ext-method-log'> /**
  892. </span> * Logs a message. If a console is present it will be used. On Opera, the method
  893. * &quot;opera.postError&quot; is called. In other cases, the message is logged to an array
  894. * &quot;Ext.log.out&quot;. An attached debugger can watch this array and view the log. The
  895. * log buffer is limited to a maximum of &quot;Ext.log.max&quot; entries (defaults to 250).
  896. * The `Ext.log.out` array can also be written to a popup window by entering the
  897. * following in the URL bar (a &quot;bookmarklet&quot;):
  898. *
  899. * javascript:void(Ext.log.show());
  900. *
  901. * If additional parameters are passed, they are joined and appended to the message.
  902. * A technique for tracing entry and exit of a function is this:
  903. *
  904. * function foo () {
  905. * Ext.log({ indent: 1 }, '&gt;&gt; foo');
  906. *
  907. * // log statements in here or methods called from here will be indented
  908. * // by one step
  909. *
  910. * Ext.log({ outdent: 1 }, '&lt;&lt; foo');
  911. * }
  912. *
  913. * This method does nothing in a release build.
  914. *
  915. * @param {String/Object} message The message to log or an options object with any
  916. * of the following properties:
  917. *
  918. * - `msg`: The message to log (required).
  919. * - `level`: One of: &quot;error&quot;, &quot;warn&quot;, &quot;info&quot; or &quot;log&quot; (the default is &quot;log&quot;).
  920. * - `dump`: An object to dump to the log as part of the message.
  921. * - `stack`: True to include a stack trace in the log.
  922. * - `indent`: Cause subsequent log statements to be indented one step.
  923. * - `outdent`: Cause this and following statements to be one step less indented.
  924. *
  925. * @method
  926. */
  927. log :
  928. //&lt;debug&gt;
  929. log ||
  930. //&lt;/debug&gt;
  931. nullLog,
  932. <span id='Ext-method-partition'> /**
  933. </span> * Partitions the set into two sets: a true set and a false set.
  934. *
  935. * Example 1:
  936. *
  937. * Ext.partition([true, false, true, true, false]);
  938. * // returns [[true, true, true], [false, false]]
  939. *
  940. * Example 2:
  941. *
  942. * Ext.partition(
  943. * Ext.query(&quot;p&quot;),
  944. * function(val){
  945. * return val.className == &quot;class1&quot;
  946. * }
  947. * );
  948. * // true are those paragraph elements with a className of &quot;class1&quot;,
  949. * // false set are those that do not have that className.
  950. *
  951. * @param {Array/NodeList} arr The array to partition
  952. * @param {Function} truth (optional) a function to determine truth.
  953. * If this is omitted the element itself must be able to be evaluated for its truthfulness.
  954. * @return {Array} [array of truish values, array of falsy values]
  955. * @deprecated 4.0.0 Will be removed in the next major version
  956. */
  957. partition : function(arr, truth){
  958. var ret = [[],[]],
  959. a, v,
  960. aLen = arr.length;
  961. for (a = 0; a &lt; aLen; a++) {
  962. v = arr[a];
  963. ret[ (truth &amp;&amp; truth(v, a, arr)) || (!truth &amp;&amp; v) ? 0 : 1].push(v);
  964. }
  965. return ret;
  966. },
  967. <span id='Ext-method-invoke'> /**
  968. </span> * Invokes a method on each item in an Array.
  969. *
  970. * Example:
  971. *
  972. * Ext.invoke(Ext.query(&quot;p&quot;), &quot;getAttribute&quot;, &quot;id&quot;);
  973. * // [el1.getAttribute(&quot;id&quot;), el2.getAttribute(&quot;id&quot;), ..., elN.getAttribute(&quot;id&quot;)]
  974. *
  975. * @param {Array/NodeList} arr The Array of items to invoke the method on.
  976. * @param {String} methodName The method name to invoke.
  977. * @param {Object...} args Arguments to send into the method invocation.
  978. * @return {Array} The results of invoking the method on each item in the array.
  979. * @deprecated 4.0.0 Will be removed in the next major version
  980. */
  981. invoke : function(arr, methodName){
  982. var ret = [],
  983. args = Array.prototype.slice.call(arguments, 2),
  984. a, v,
  985. aLen = arr.length;
  986. for (a = 0; a &lt; aLen; a++) {
  987. v = arr[a];
  988. if (v &amp;&amp; typeof v[methodName] == 'function') {
  989. ret.push(v[methodName].apply(v, args));
  990. } else {
  991. ret.push(undefined);
  992. }
  993. }
  994. return ret;
  995. },
  996. <span id='Ext-method-zip'> /**
  997. </span> * Zips N sets together.
  998. *
  999. * Example 1:
  1000. *
  1001. * Ext.zip([1,2,3],[4,5,6]); // [[1,4],[2,5],[3,6]]
  1002. *
  1003. * Example 2:
  1004. *
  1005. * Ext.zip(
  1006. * [ &quot;+&quot;, &quot;-&quot;, &quot;+&quot;],
  1007. * [ 12, 10, 22],
  1008. * [ 43, 15, 96],
  1009. * function(a, b, c){
  1010. * return &quot;$&quot; + a + &quot;&quot; + b + &quot;.&quot; + c
  1011. * }
  1012. * ); // [&quot;$+12.43&quot;, &quot;$-10.15&quot;, &quot;$+22.96&quot;]
  1013. *
  1014. * @param {Array/NodeList...} arr This argument may be repeated. Array(s)
  1015. * to contribute values.
  1016. * @param {Function} zipper (optional) The last item in the argument list.
  1017. * This will drive how the items are zipped together.
  1018. * @return {Array} The zipped set.
  1019. * @deprecated 4.0.0 Will be removed in the next major version
  1020. */
  1021. zip : function(){
  1022. var parts = Ext.partition(arguments, function( val ){ return typeof val != 'function'; }),
  1023. arrs = parts[0],
  1024. fn = parts[1][0],
  1025. len = Ext.max(Ext.pluck(arrs, &quot;length&quot;)),
  1026. ret = [];
  1027. for (var i = 0; i &lt; len; i++) {
  1028. ret[i] = [];
  1029. if(fn){
  1030. ret[i] = fn.apply(fn, Ext.pluck(arrs, i));
  1031. }else{
  1032. for (var j = 0, aLen = arrs.length; j &lt; aLen; j++){
  1033. ret[i].push( arrs[j][i] );
  1034. }
  1035. }
  1036. }
  1037. return ret;
  1038. },
  1039. <span id='Ext-method-toSentence'> /**
  1040. </span> * Turns an array into a sentence, joined by a specified connector - e.g.:
  1041. *
  1042. * Ext.toSentence(['Adama', 'Tigh', 'Roslin']); //'Adama, Tigh and Roslin'
  1043. * Ext.toSentence(['Adama', 'Tigh', 'Roslin'], 'or'); //'Adama, Tigh or Roslin'
  1044. *
  1045. * @param {String[]} items The array to create a sentence from
  1046. * @param {String} connector The string to use to connect the last two words.
  1047. * Usually 'and' or 'or' - defaults to 'and'.
  1048. * @return {String} The sentence string
  1049. * @deprecated 4.0.0 Will be removed in the next major version
  1050. */
  1051. toSentence: function(items, connector) {
  1052. var length = items.length;
  1053. if (length &lt;= 1) {
  1054. return items[0];
  1055. } else {
  1056. var head = items.slice(0, length - 1),
  1057. tail = items[length - 1];
  1058. return Ext.util.Format.format(&quot;{0} {1} {2}&quot;, head.join(&quot;, &quot;), connector || 'and', tail);
  1059. }
  1060. },
  1061. <span id='Ext-property-useShims'> /**
  1062. </span> * @property {Boolean} useShims
  1063. * By default, Ext intelligently decides whether floating elements should be shimmed.
  1064. * If you are using flash, you may want to set this to true.
  1065. */
  1066. useShims: isIE6
  1067. });
  1068. })();
  1069. <span id='Ext-method-application'>/**
  1070. </span> * Loads Ext.app.Application class and starts it up with given configuration after the page is ready.
  1071. *
  1072. * See Ext.app.Application for details.
  1073. *
  1074. * @param {Object} config
  1075. */
  1076. Ext.application = function(config) {
  1077. Ext.require('Ext.app.Application');
  1078. Ext.onReady(function() {
  1079. new Ext.app.Application(config);
  1080. });
  1081. };
  1082. </pre>
  1083. </body>
  1084. </html>