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