Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1061 lines
41 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>The source code</title>
  5. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  6. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  7. </head>
  8. <body onload="prettyPrint();">
  9. <pre class="prettyprint lang-js">/*!
  10. * Ext JS Library 3.3.1
  11. * Copyright(c) 2006-2010 Sencha Inc.
  12. * licensing@sencha.com
  13. * http://www.sencha.com/license
  14. */
  15. // for old browsers
  16. window.undefined = window.undefined;
  17. <div id="cls-Ext"></div>/**
  18. * @class Ext
  19. * Ext core utilities and functions.
  20. * @singleton
  21. */
  22. Ext = {
  23. <div id="prop-Ext-version"></div>/**
  24. * The version of the framework
  25. * @type String
  26. */
  27. version : '3.3.1',
  28. versionDetail : {
  29. major : 3,
  30. minor : 3,
  31. patch : 1
  32. }
  33. };
  34. <div id="method-Ext-apply"></div>/**
  35. * Copies all the properties of config to obj.
  36. * @param {Object} obj The receiver of the properties
  37. * @param {Object} config The source of the properties
  38. * @param {Object} defaults A different object that will also be applied for default values
  39. * @return {Object} returns obj
  40. * @member Ext apply
  41. */
  42. Ext.apply = function(o, c, defaults){
  43. // no "this" reference for friendly out of scope calls
  44. if(defaults){
  45. Ext.apply(o, defaults);
  46. }
  47. if(o && c && typeof c == 'object'){
  48. for(var p in c){
  49. o[p] = c[p];
  50. }
  51. }
  52. return o;
  53. };
  54. (function(){
  55. var idSeed = 0,
  56. toString = Object.prototype.toString,
  57. ua = navigator.userAgent.toLowerCase(),
  58. check = function(r){
  59. return r.test(ua);
  60. },
  61. DOC = document,
  62. docMode = DOC.documentMode,
  63. isStrict = DOC.compatMode == "CSS1Compat",
  64. isOpera = check(/opera/),
  65. isChrome = check(/\bchrome\b/),
  66. isWebKit = check(/webkit/),
  67. isSafari = !isChrome && check(/safari/),
  68. isSafari2 = isSafari && check(/applewebkit\/4/), // unique to Safari 2
  69. isSafari3 = isSafari && check(/version\/3/),
  70. isSafari4 = isSafari && check(/version\/4/),
  71. isIE = !isOpera && check(/msie/),
  72. isIE7 = isIE && (check(/msie 7/) || docMode == 7),
  73. isIE8 = isIE && (check(/msie 8/) && docMode != 7),
  74. isIE6 = isIE && !isIE7 && !isIE8,
  75. isGecko = !isWebKit && check(/gecko/),
  76. isGecko2 = isGecko && check(/rv:1\.8/),
  77. isGecko3 = isGecko && check(/rv:1\.9/),
  78. isBorderBox = isIE && !isStrict,
  79. isWindows = check(/windows|win32/),
  80. isMac = check(/macintosh|mac os x/),
  81. isAir = check(/adobeair/),
  82. isLinux = check(/linux/),
  83. isSecure = /^https/i.test(window.location.protocol);
  84. // remove css image flicker
  85. if(isIE6){
  86. try{
  87. DOC.execCommand("BackgroundImageCache", false, true);
  88. }catch(e){}
  89. }
  90. Ext.apply(Ext, {
  91. <div id="prop-Ext-SSL_SECURE_URL"></div>/**
  92. * URL to a blank file used by Ext when in secure mode for iframe src and onReady src to prevent
  93. * the IE insecure content warning (<tt>'about:blank'</tt>, except for IE in secure mode, which is <tt>'javascript:""'</tt>).
  94. * @type String
  95. */
  96. SSL_SECURE_URL : isSecure && isIE ? 'javascript:""' : 'about:blank',
  97. <div id="prop-Ext-isStrict"></div>/**
  98. * True if the browser is in strict (standards-compliant) mode, as opposed to quirks mode
  99. * @type Boolean
  100. */
  101. isStrict : isStrict,
  102. <div id="prop-Ext-isSecure"></div>/**
  103. * True if the page is running over SSL
  104. * @type Boolean
  105. */
  106. isSecure : isSecure,
  107. <div id="prop-Ext-isReady"></div>/**
  108. * True when the document is fully initialized and ready for action
  109. * @type Boolean
  110. */
  111. isReady : false,
  112. <div id="prop-Ext-enableFx"></div>/**
  113. * True if the {@link Ext.Fx} Class is available
  114. * @type Boolean
  115. * @property enableFx
  116. */
  117. <div id="prop-Ext-enableForcedBoxModel"></div>/**
  118. * HIGHLY EXPERIMENTAL
  119. * True to force css based border-box model override and turning off javascript based adjustments. This is a
  120. * runtime configuration and must be set before onReady.
  121. * @type Boolean
  122. */
  123. enableForcedBoxModel : false,
  124. <div id="prop-Ext-enableGarbageCollector"></div>/**
  125. * True to automatically uncache orphaned Ext.Elements periodically (defaults to true)
  126. * @type Boolean
  127. */
  128. enableGarbageCollector : true,
  129. <div id="prop-Ext-enableListenerCollection"></div>/**
  130. * True to automatically purge event listeners during garbageCollection (defaults to false).
  131. * @type Boolean
  132. */
  133. enableListenerCollection : false,
  134. <div id="prop-Ext-enableNestedListenerRemoval"></div>/**
  135. * EXPERIMENTAL - True to cascade listener removal to child elements when an element is removed.
  136. * Currently not optimized for performance.
  137. * @type Boolean
  138. */
  139. enableNestedListenerRemoval : false,
  140. <div id="prop-Ext-USE_NATIVE_JSON"></div>/**
  141. * Indicates whether to use native browser parsing for JSON methods.
  142. * This option is ignored if the browser does not support native JSON methods.
  143. * <b>Note: Native JSON methods will not work with objects that have functions.
  144. * Also, property names must be quoted, otherwise the data will not parse.</b> (Defaults to false)
  145. * @type Boolean
  146. */
  147. USE_NATIVE_JSON : false,
  148. <div id="method-Ext-applyIf"></div>/**
  149. * Copies all the properties of config to obj if they don't already exist.
  150. * @param {Object} obj The receiver of the properties
  151. * @param {Object} config The source of the properties
  152. * @return {Object} returns obj
  153. */
  154. applyIf : function(o, c){
  155. if(o){
  156. for(var p in c){
  157. if(!Ext.isDefined(o[p])){
  158. o[p] = c[p];
  159. }
  160. }
  161. }
  162. return o;
  163. },
  164. <div id="method-Ext-id"></div>/**
  165. * Generates unique ids. If the element already has an id, it is unchanged
  166. * @param {Mixed} el (optional) The element to generate an id for
  167. * @param {String} prefix (optional) Id prefix (defaults "ext-gen")
  168. * @return {String} The generated Id.
  169. */
  170. id : function(el, prefix){
  171. el = Ext.getDom(el, true) || {};
  172. if (!el.id) {
  173. el.id = (prefix || "ext-gen") + (++idSeed);
  174. }
  175. return el.id;
  176. },
  177. <div id="method-Ext-extend"></div>/**
  178. * <p>Extends one class to create a subclass and optionally overrides members with the passed literal. This method
  179. * also adds the function "override()" to the subclass that can be used to override members of the class.</p>
  180. * For example, to create a subclass of Ext GridPanel:
  181. * <pre><code>
  182. MyGridPanel = Ext.extend(Ext.grid.GridPanel, {
  183. constructor: function(config) {
  184. // Create configuration for this Grid.
  185. var store = new Ext.data.Store({...});
  186. var colModel = new Ext.grid.ColumnModel({...});
  187. // Create a new config object containing our computed properties
  188. // *plus* whatever was in the config parameter.
  189. config = Ext.apply({
  190. store: store,
  191. colModel: colModel
  192. }, config);
  193. MyGridPanel.superclass.constructor.call(this, config);
  194. // Your postprocessing here
  195. },
  196. yourMethod: function() {
  197. // etc.
  198. }
  199. });
  200. </code></pre>
  201. *
  202. * <p>This function also supports a 3-argument call in which the subclass's constructor is
  203. * passed as an argument. In this form, the parameters are as follows:</p>
  204. * <div class="mdetail-params"><ul>
  205. * <li><code>subclass</code> : Function <div class="sub-desc">The subclass constructor.</div></li>
  206. * <li><code>superclass</code> : Function <div class="sub-desc">The constructor of class being extended</div></li>
  207. * <li><code>overrides</code> : Object <div class="sub-desc">A literal with members which are copied into the subclass's
  208. * prototype, and are therefore shared among all instances of the new class.</div></li>
  209. * </ul></div>
  210. *
  211. * @param {Function} superclass The constructor of class being extended.
  212. * @param {Object} overrides <p>A literal with members which are copied into the subclass's
  213. * prototype, and are therefore shared between all instances of the new class.</p>
  214. * <p>This may contain a special member named <tt><b>constructor</b></tt>. This is used
  215. * to define the constructor of the new class, and is returned. If this property is
  216. * <i>not</i> specified, a constructor is generated and returned which just calls the
  217. * superclass's constructor passing on its parameters.</p>
  218. * <p><b>It is essential that you call the superclass constructor in any provided constructor. See example code.</b></p>
  219. * @return {Function} The subclass constructor from the <code>overrides</code> parameter, or a generated one if not provided.
  220. */
  221. extend : function(){
  222. // inline overrides
  223. var io = function(o){
  224. for(var m in o){
  225. this[m] = o[m];
  226. }
  227. };
  228. var oc = Object.prototype.constructor;
  229. return function(sb, sp, overrides){
  230. if(typeof sp == 'object'){
  231. overrides = sp;
  232. sp = sb;
  233. sb = overrides.constructor != oc ? overrides.constructor : function(){sp.apply(this, arguments);};
  234. }
  235. var F = function(){},
  236. sbp,
  237. spp = sp.prototype;
  238. F.prototype = spp;
  239. sbp = sb.prototype = new F();
  240. sbp.constructor=sb;
  241. sb.superclass=spp;
  242. if(spp.constructor == oc){
  243. spp.constructor=sp;
  244. }
  245. sb.override = function(o){
  246. Ext.override(sb, o);
  247. };
  248. sbp.superclass = sbp.supr = (function(){
  249. return spp;
  250. });
  251. sbp.override = io;
  252. Ext.override(sb, overrides);
  253. sb.extend = function(o){return Ext.extend(sb, o);};
  254. return sb;
  255. };
  256. }(),
  257. <div id="method-Ext-override"></div>/**
  258. * Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name.
  259. * Usage:<pre><code>
  260. Ext.override(MyClass, {
  261. newMethod1: function(){
  262. // etc.
  263. },
  264. newMethod2: function(foo){
  265. // etc.
  266. }
  267. });
  268. </code></pre>
  269. * @param {Object} origclass The class to override
  270. * @param {Object} overrides The list of functions to add to origClass. This should be specified as an object literal
  271. * containing one or more methods.
  272. * @method override
  273. */
  274. override : function(origclass, overrides){
  275. if(overrides){
  276. var p = origclass.prototype;
  277. Ext.apply(p, overrides);
  278. if(Ext.isIE && overrides.hasOwnProperty('toString')){
  279. p.toString = overrides.toString;
  280. }
  281. }
  282. },
  283. <div id="method-Ext-namespace"></div>/**
  284. * Creates namespaces to be used for scoping variables and classes so that they are not global.
  285. * Specifying the last node of a namespace implicitly creates all other nodes. Usage:
  286. * <pre><code>
  287. Ext.namespace('Company', 'Company.data');
  288. Ext.namespace('Company.data'); // equivalent and preferable to above syntax
  289. Company.Widget = function() { ... }
  290. Company.data.CustomStore = function(config) { ... }
  291. </code></pre>
  292. * @param {String} namespace1
  293. * @param {String} namespace2
  294. * @param {String} etc
  295. * @return {Object} The namespace object. (If multiple arguments are passed, this will be the last namespace created)
  296. * @method namespace
  297. */
  298. namespace : function(){
  299. var o, d;
  300. Ext.each(arguments, function(v) {
  301. d = v.split(".");
  302. o = window[d[0]] = window[d[0]] || {};
  303. Ext.each(d.slice(1), function(v2){
  304. o = o[v2] = o[v2] || {};
  305. });
  306. });
  307. return o;
  308. },
  309. <div id="method-Ext-urlEncode"></div>/**
  310. * Takes an object and converts it to an encoded URL. e.g. Ext.urlEncode({foo: 1, bar: 2}); would return "foo=1&bar=2". Optionally, property values can be arrays, instead of keys and the resulting string that's returned will contain a name/value pair for each array value.
  311. * @param {Object} o
  312. * @param {String} pre (optional) A prefix to add to the url encoded string
  313. * @return {String}
  314. */
  315. urlEncode : function(o, pre){
  316. var empty,
  317. buf = [],
  318. e = encodeURIComponent;
  319. Ext.iterate(o, function(key, item){
  320. empty = Ext.isEmpty(item);
  321. Ext.each(empty ? key : item, function(val){
  322. buf.push('&', e(key), '=', (!Ext.isEmpty(val) && (val != key || !empty)) ? (Ext.isDate(val) ? Ext.encode(val).replace(/"/g, '') : e(val)) : '');
  323. });
  324. });
  325. if(!pre){
  326. buf.shift();
  327. pre = '';
  328. }
  329. return pre + buf.join('');
  330. },
  331. <div id="method-Ext-urlDecode"></div>/**
  332. * Takes an encoded URL and and converts it to an object. Example: <pre><code>
  333. Ext.urlDecode("foo=1&bar=2"); // returns {foo: "1", bar: "2"}
  334. Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {foo: "1", bar: ["2", "3", "4"]}
  335. </code></pre>
  336. * @param {String} string
  337. * @param {Boolean} overwrite (optional) Items of the same name will overwrite previous values instead of creating an an array (Defaults to false).
  338. * @return {Object} A literal with members
  339. */
  340. urlDecode : function(string, overwrite){
  341. if(Ext.isEmpty(string)){
  342. return {};
  343. }
  344. var obj = {},
  345. pairs = string.split('&'),
  346. d = decodeURIComponent,
  347. name,
  348. value;
  349. Ext.each(pairs, function(pair) {
  350. pair = pair.split('=');
  351. name = d(pair[0]);
  352. value = d(pair[1]);
  353. obj[name] = overwrite || !obj[name] ? value :
  354. [].concat(obj[name]).concat(value);
  355. });
  356. return obj;
  357. },
  358. <div id="method-Ext-urlAppend"></div>/**
  359. * Appends content to the query string of a URL, handling logic for whether to place
  360. * a question mark or ampersand.
  361. * @param {String} url The URL to append to.
  362. * @param {String} s The content to append to the URL.
  363. * @return (String) The resulting URL
  364. */
  365. urlAppend : function(url, s){
  366. if(!Ext.isEmpty(s)){
  367. return url + (url.indexOf('?') === -1 ? '?' : '&') + s;
  368. }
  369. return url;
  370. },
  371. <div id="method-Ext-toArray"></div>/**
  372. * Converts any iterable (numeric indices and a length property) into a true array
  373. * Don't use this on strings. IE doesn't support "abc"[0] which this implementation depends on.
  374. * For strings, use this instead: "abc".match(/./g) => [a,b,c];
  375. * @param {Iterable} the iterable object to be turned into a true Array.
  376. * @return (Array) array
  377. */
  378. toArray : function(){
  379. return isIE ?
  380. function(a, i, j, res){
  381. res = [];
  382. for(var x = 0, len = a.length; x < len; x++) {
  383. res.push(a[x]);
  384. }
  385. return res.slice(i || 0, j || res.length);
  386. } :
  387. function(a, i, j){
  388. return Array.prototype.slice.call(a, i || 0, j || a.length);
  389. };
  390. }(),
  391. isIterable : function(v){
  392. //check for array or arguments
  393. if(Ext.isArray(v) || v.callee){
  394. return true;
  395. }
  396. //check for node list type
  397. if(/NodeList|HTMLCollection/.test(toString.call(v))){
  398. return true;
  399. }
  400. //NodeList has an item and length property
  401. //IXMLDOMNodeList has nextNode method, needs to be checked first.
  402. return ((typeof v.nextNode != 'undefined' || v.item) && Ext.isNumber(v.length));
  403. },
  404. <div id="method-Ext-each"></div>/**
  405. * Iterates an array calling the supplied function.
  406. * @param {Array/NodeList/Mixed} array The array to be iterated. If this
  407. * argument is not really an array, the supplied function is called once.
  408. * @param {Function} fn The function to be called with each item. If the
  409. * supplied function returns false, iteration stops and this method returns
  410. * the current <code>index</code>. This function is called with
  411. * the following arguments:
  412. * <div class="mdetail-params"><ul>
  413. * <li><code>item</code> : <i>Mixed</i>
  414. * <div class="sub-desc">The item at the current <code>index</code>
  415. * in the passed <code>array</code></div></li>
  416. * <li><code>index</code> : <i>Number</i>
  417. * <div class="sub-desc">The current index within the array</div></li>
  418. * <li><code>allItems</code> : <i>Array</i>
  419. * <div class="sub-desc">The <code>array</code> passed as the first
  420. * argument to <code>Ext.each</code>.</div></li>
  421. * </ul></div>
  422. * @param {Object} scope The scope (<code>this</code> reference) in which the specified function is executed.
  423. * Defaults to the <code>item</code> at the current <code>index</code>
  424. * within the passed <code>array</code>.
  425. * @return See description for the fn parameter.
  426. */
  427. each : function(array, fn, scope){
  428. if(Ext.isEmpty(array, true)){
  429. return;
  430. }
  431. if(!Ext.isIterable(array) || Ext.isPrimitive(array)){
  432. array = [array];
  433. }
  434. for(var i = 0, len = array.length; i < len; i++){
  435. if(fn.call(scope || array[i], array[i], i, array) === false){
  436. return i;
  437. };
  438. }
  439. },
  440. <div id="method-Ext-iterate"></div>/**
  441. * Iterates either the elements in an array, or each of the properties in an object.
  442. * <b>Note</b>: If you are only iterating arrays, it is better to call {@link #each}.
  443. * @param {Object/Array} object The object or array to be iterated
  444. * @param {Function} fn The function to be called for each iteration.
  445. * The iteration will stop if the supplied function returns false, or
  446. * all array elements / object properties have been covered. The signature
  447. * varies depending on the type of object being interated:
  448. * <div class="mdetail-params"><ul>
  449. * <li>Arrays : <tt>(Object item, Number index, Array allItems)</tt>
  450. * <div class="sub-desc">
  451. * When iterating an array, the supplied function is called with each item.</div></li>
  452. * <li>Objects : <tt>(String key, Object value, Object)</tt>
  453. * <div class="sub-desc">
  454. * When iterating an object, the supplied function is called with each key-value pair in
  455. * the object, and the iterated object</div></li>
  456. * </ul></div>
  457. * @param {Object} scope The scope (<code>this</code> reference) in which the specified function is executed. Defaults to
  458. * the <code>object</code> being iterated.
  459. */
  460. iterate : function(obj, fn, scope){
  461. if(Ext.isEmpty(obj)){
  462. return;
  463. }
  464. if(Ext.isIterable(obj)){
  465. Ext.each(obj, fn, scope);
  466. return;
  467. }else if(typeof obj == 'object'){
  468. for(var prop in obj){
  469. if(obj.hasOwnProperty(prop)){
  470. if(fn.call(scope || obj, prop, obj[prop], obj) === false){
  471. return;
  472. };
  473. }
  474. }
  475. }
  476. },
  477. <div id="method-Ext-getDom"></div>/**
  478. * Return the dom node for the passed String (id), dom node, or Ext.Element.
  479. * Optional 'strict' flag is needed for IE since it can return 'name' and
  480. * 'id' elements by using getElementById.
  481. * Here are some examples:
  482. * <pre><code>
  483. // gets dom node based on id
  484. var elDom = Ext.getDom('elId');
  485. // gets dom node based on the dom node
  486. var elDom1 = Ext.getDom(elDom);
  487. // If we don&#39;t know if we are working with an
  488. // Ext.Element or a dom node use Ext.getDom
  489. function(el){
  490. var dom = Ext.getDom(el);
  491. // do something with the dom node
  492. }
  493. * </code></pre>
  494. * <b>Note</b>: the dom node to be found actually needs to exist (be rendered, etc)
  495. * when this method is called to be successful.
  496. * @param {Mixed} el
  497. * @return HTMLElement
  498. */
  499. getDom : function(el, strict){
  500. if(!el || !DOC){
  501. return null;
  502. }
  503. if (el.dom){
  504. return el.dom;
  505. } else {
  506. if (typeof el == 'string') {
  507. var e = DOC.getElementById(el);
  508. // IE returns elements with the 'name' and 'id' attribute.
  509. // we do a strict check to return the element with only the id attribute
  510. if (e && isIE && strict) {
  511. if (el == e.getAttribute('id')) {
  512. return e;
  513. } else {
  514. return null;
  515. }
  516. }
  517. return e;
  518. } else {
  519. return el;
  520. }
  521. }
  522. },
  523. <div id="method-Ext-getBody"></div>/**
  524. * Returns the current document body as an {@link Ext.Element}.
  525. * @return Ext.Element The document body
  526. */
  527. getBody : function(){
  528. return Ext.get(DOC.body || DOC.documentElement);
  529. },
  530. <div id="method-Ext-getHead"></div>/**
  531. * Returns the current document body as an {@link Ext.Element}.
  532. * @return Ext.Element The document body
  533. */
  534. getHead : function() {
  535. var head;
  536. return function() {
  537. if (head == undefined) {
  538. head = Ext.get(DOC.getElementsByTagName("head")[0]);
  539. }
  540. return head;
  541. };
  542. }(),
  543. <div id="prop-Ext-"></div>/**
  544. * Removes a DOM node from the document.
  545. */
  546. <div id="method-Ext-removeNode"></div>/**
  547. * <p>Removes this element from the document, removes all DOM event listeners, and deletes the cache reference.
  548. * All DOM event listeners are removed from this element. If {@link Ext#enableNestedListenerRemoval} is
  549. * <code>true</code>, then DOM event listeners are also removed from all child nodes. The body node
  550. * will be ignored if passed in.</p>
  551. * @param {HTMLElement} node The node to remove
  552. */
  553. removeNode : isIE && !isIE8 ? function(){
  554. var d;
  555. return function(n){
  556. if(n && n.tagName != 'BODY'){
  557. (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n);
  558. d = d || DOC.createElement('div');
  559. d.appendChild(n);
  560. d.innerHTML = '';
  561. delete Ext.elCache[n.id];
  562. }
  563. };
  564. }() : function(n){
  565. if(n && n.parentNode && n.tagName != 'BODY'){
  566. (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n);
  567. n.parentNode.removeChild(n);
  568. delete Ext.elCache[n.id];
  569. }
  570. },
  571. <div id="method-Ext-isEmpty"></div>/**
  572. * <p>Returns true if the passed value is empty.</p>
  573. * <p>The value is deemed to be empty if it is<div class="mdetail-params"><ul>
  574. * <li>null</li>
  575. * <li>undefined</li>
  576. * <li>an empty array</li>
  577. * <li>a zero length string (Unless the <tt>allowBlank</tt> parameter is <tt>true</tt>)</li>
  578. * </ul></div>
  579. * @param {Mixed} value The value to test
  580. * @param {Boolean} allowBlank (optional) true to allow empty strings (defaults to false)
  581. * @return {Boolean}
  582. */
  583. isEmpty : function(v, allowBlank){
  584. return v === null || v === undefined || ((Ext.isArray(v) && !v.length)) || (!allowBlank ? v === '' : false);
  585. },
  586. <div id="method-Ext-isArray"></div>/**
  587. * Returns true if the passed value is a JavaScript array, otherwise false.
  588. * @param {Mixed} value The value to test
  589. * @return {Boolean}
  590. */
  591. isArray : function(v){
  592. return toString.apply(v) === '[object Array]';
  593. },
  594. <div id="method-Ext-isDate"></div>/**
  595. * Returns true if the passed object is a JavaScript date object, otherwise false.
  596. * @param {Object} object The object to test
  597. * @return {Boolean}
  598. */
  599. isDate : function(v){
  600. return toString.apply(v) === '[object Date]';
  601. },
  602. <div id="method-Ext-isObject"></div>/**
  603. * Returns true if the passed value is a JavaScript Object, otherwise false.
  604. * @param {Mixed} value The value to test
  605. * @return {Boolean}
  606. */
  607. isObject : function(v){
  608. return !!v && Object.prototype.toString.call(v) === '[object Object]';
  609. },
  610. <div id="method-Ext-isPrimitive"></div>/**
  611. * Returns true if the passed value is a JavaScript 'primitive', a string, number or boolean.
  612. * @param {Mixed} value The value to test
  613. * @return {Boolean}
  614. */
  615. isPrimitive : function(v){
  616. return Ext.isString(v) || Ext.isNumber(v) || Ext.isBoolean(v);
  617. },
  618. <div id="method-Ext-isFunction"></div>/**
  619. * Returns true if the passed value is a JavaScript Function, otherwise false.
  620. * @param {Mixed} value The value to test
  621. * @return {Boolean}
  622. */
  623. isFunction : function(v){
  624. return toString.apply(v) === '[object Function]';
  625. },
  626. <div id="method-Ext-isNumber"></div>/**
  627. * Returns true if the passed value is a number. Returns false for non-finite numbers.
  628. * @param {Mixed} value The value to test
  629. * @return {Boolean}
  630. */
  631. isNumber : function(v){
  632. return typeof v === 'number' && isFinite(v);
  633. },
  634. <div id="method-Ext-isString"></div>/**
  635. * Returns true if the passed value is a string.
  636. * @param {Mixed} value The value to test
  637. * @return {Boolean}
  638. */
  639. isString : function(v){
  640. return typeof v === 'string';
  641. },
  642. <div id="method-Ext-isBoolean"></div>/**
  643. * Returns true if the passed value is a boolean.
  644. * @param {Mixed} value The value to test
  645. * @return {Boolean}
  646. */
  647. isBoolean : function(v){
  648. return typeof v === 'boolean';
  649. },
  650. <div id="method-Ext-isElement"></div>/**
  651. * Returns true if the passed value is an HTMLElement
  652. * @param {Mixed} value The value to test
  653. * @return {Boolean}
  654. */
  655. isElement : function(v) {
  656. return v ? !!v.tagName : false;
  657. },
  658. <div id="method-Ext-isDefined"></div>/**
  659. * Returns true if the passed value is not undefined.
  660. * @param {Mixed} value The value to test
  661. * @return {Boolean}
  662. */
  663. isDefined : function(v){
  664. return typeof v !== 'undefined';
  665. },
  666. <div id="prop-Ext-isOpera"></div>/**
  667. * True if the detected browser is Opera.
  668. * @type Boolean
  669. */
  670. isOpera : isOpera,
  671. <div id="prop-Ext-isWebKit"></div>/**
  672. * True if the detected browser uses WebKit.
  673. * @type Boolean
  674. */
  675. isWebKit : isWebKit,
  676. <div id="prop-Ext-isChrome"></div>/**
  677. * True if the detected browser is Chrome.
  678. * @type Boolean
  679. */
  680. isChrome : isChrome,
  681. <div id="prop-Ext-isSafari"></div>/**
  682. * True if the detected browser is Safari.
  683. * @type Boolean
  684. */
  685. isSafari : isSafari,
  686. <div id="prop-Ext-isSafari3"></div>/**
  687. * True if the detected browser is Safari 3.x.
  688. * @type Boolean
  689. */
  690. isSafari3 : isSafari3,
  691. <div id="prop-Ext-isSafari4"></div>/**
  692. * True if the detected browser is Safari 4.x.
  693. * @type Boolean
  694. */
  695. isSafari4 : isSafari4,
  696. <div id="prop-Ext-isSafari2"></div>/**
  697. * True if the detected browser is Safari 2.x.
  698. * @type Boolean
  699. */
  700. isSafari2 : isSafari2,
  701. <div id="prop-Ext-isIE"></div>/**
  702. * True if the detected browser is Internet Explorer.
  703. * @type Boolean
  704. */
  705. isIE : isIE,
  706. <div id="prop-Ext-isIE6"></div>/**
  707. * True if the detected browser is Internet Explorer 6.x.
  708. * @type Boolean
  709. */
  710. isIE6 : isIE6,
  711. <div id="prop-Ext-isIE7"></div>/**
  712. * True if the detected browser is Internet Explorer 7.x.
  713. * @type Boolean
  714. */
  715. isIE7 : isIE7,
  716. <div id="prop-Ext-isIE8"></div>/**
  717. * True if the detected browser is Internet Explorer 8.x.
  718. * @type Boolean
  719. */
  720. isIE8 : isIE8,
  721. <div id="prop-Ext-isGecko"></div>/**
  722. * True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox).
  723. * @type Boolean
  724. */
  725. isGecko : isGecko,
  726. <div id="prop-Ext-isGecko2"></div>/**
  727. * True if the detected browser uses a pre-Gecko 1.9 layout engine (e.g. Firefox 2.x).
  728. * @type Boolean
  729. */
  730. isGecko2 : isGecko2,
  731. <div id="prop-Ext-isGecko3"></div>/**
  732. * True if the detected browser uses a Gecko 1.9+ layout engine (e.g. Firefox 3.x).
  733. * @type Boolean
  734. */
  735. isGecko3 : isGecko3,
  736. <div id="prop-Ext-isBorderBox"></div>/**
  737. * True if the detected browser is Internet Explorer running in non-strict mode.
  738. * @type Boolean
  739. */
  740. isBorderBox : isBorderBox,
  741. <div id="prop-Ext-isLinux"></div>/**
  742. * True if the detected platform is Linux.
  743. * @type Boolean
  744. */
  745. isLinux : isLinux,
  746. <div id="prop-Ext-isWindows"></div>/**
  747. * True if the detected platform is Windows.
  748. * @type Boolean
  749. */
  750. isWindows : isWindows,
  751. <div id="prop-Ext-isMac"></div>/**
  752. * True if the detected platform is Mac OS.
  753. * @type Boolean
  754. */
  755. isMac : isMac,
  756. <div id="prop-Ext-isAir"></div>/**
  757. * True if the detected platform is Adobe Air.
  758. * @type Boolean
  759. */
  760. isAir : isAir
  761. });
  762. <div id="method-Ext-ns"></div>/**
  763. * Creates namespaces to be used for scoping variables and classes so that they are not global.
  764. * Specifying the last node of a namespace implicitly creates all other nodes. Usage:
  765. * <pre><code>
  766. Ext.namespace('Company', 'Company.data');
  767. Ext.namespace('Company.data'); // equivalent and preferable to above syntax
  768. Company.Widget = function() { ... }
  769. Company.data.CustomStore = function(config) { ... }
  770. </code></pre>
  771. * @param {String} namespace1
  772. * @param {String} namespace2
  773. * @param {String} etc
  774. * @return {Object} The namespace object. (If multiple arguments are passed, this will be the last namespace created)
  775. * @method ns
  776. */
  777. Ext.ns = Ext.namespace;
  778. })();
  779. Ext.ns('Ext.util', 'Ext.lib', 'Ext.data', 'Ext.supports');
  780. Ext.elCache = {};
  781. <div id="cls-Function"></div>/**
  782. * @class Function
  783. * These functions are available on every Function object (any JavaScript function).
  784. */
  785. Ext.apply(Function.prototype, {
  786. <div id="method-Function-createInterceptor"></div>/**
  787. * Creates an interceptor function. The passed function is called before the original one. If it returns false,
  788. * the original one is not called. The resulting function returns the results of the original function.
  789. * The passed function is called with the parameters of the original function. Example usage:
  790. * <pre><code>
  791. var sayHi = function(name){
  792. alert('Hi, ' + name);
  793. }
  794. sayHi('Fred'); // alerts "Hi, Fred"
  795. // create a new function that validates input without
  796. // directly modifying the original function:
  797. var sayHiToFriend = sayHi.createInterceptor(function(name){
  798. return name == 'Brian';
  799. });
  800. sayHiToFriend('Fred'); // no alert
  801. sayHiToFriend('Brian'); // alerts "Hi, Brian"
  802. </code></pre>
  803. * @param {Function} fcn The function to call before the original
  804. * @param {Object} scope (optional) The scope (<code><b>this</b></code> reference) in which the passed function is executed.
  805. * <b>If omitted, defaults to the scope in which the original function is called or the browser window.</b>
  806. * @return {Function} The new function
  807. */
  808. createInterceptor : function(fcn, scope){
  809. var method = this;
  810. return !Ext.isFunction(fcn) ?
  811. this :
  812. function() {
  813. var me = this,
  814. args = arguments;
  815. fcn.target = me;
  816. fcn.method = method;
  817. return (fcn.apply(scope || me || window, args) !== false) ?
  818. method.apply(me || window, args) :
  819. null;
  820. };
  821. },
  822. <div id="method-Function-createCallback"></div>/**
  823. * Creates a callback that passes arguments[0], arguments[1], arguments[2], ...
  824. * Call directly on any function. Example: <code>myFunction.createCallback(arg1, arg2)</code>
  825. * Will create a function that is bound to those 2 args. <b>If a specific scope is required in the
  826. * callback, use {@link #createDelegate} instead.</b> The function returned by createCallback always
  827. * executes in the window scope.
  828. * <p>This method is required when you want to pass arguments to a callback function. If no arguments
  829. * are needed, you can simply pass a reference to the function as a callback (e.g., callback: myFn).
  830. * However, if you tried to pass a function with arguments (e.g., callback: myFn(arg1, arg2)) the function
  831. * would simply execute immediately when the code is parsed. Example usage:
  832. * <pre><code>
  833. var sayHi = function(name){
  834. alert('Hi, ' + name);
  835. }
  836. // clicking the button alerts "Hi, Fred"
  837. new Ext.Button({
  838. text: 'Say Hi',
  839. renderTo: Ext.getBody(),
  840. handler: sayHi.createCallback('Fred')
  841. });
  842. </code></pre>
  843. * @return {Function} The new function
  844. */
  845. createCallback : function(/*args...*/){
  846. // make args available, in function below
  847. var args = arguments,
  848. method = this;
  849. return function() {
  850. return method.apply(window, args);
  851. };
  852. },
  853. <div id="method-Function-createDelegate"></div>/**
  854. * Creates a delegate (callback) that sets the scope to obj.
  855. * Call directly on any function. Example: <code>this.myFunction.createDelegate(this, [arg1, arg2])</code>
  856. * Will create a function that is automatically scoped to obj so that the <tt>this</tt> variable inside the
  857. * callback points to obj. Example usage:
  858. * <pre><code>
  859. var sayHi = function(name){
  860. // Note this use of "this.text" here. This function expects to
  861. // execute within a scope that contains a text property. In this
  862. // example, the "this" variable is pointing to the btn object that
  863. // was passed in createDelegate below.
  864. alert('Hi, ' + name + '. You clicked the "' + this.text + '" button.');
  865. }
  866. var btn = new Ext.Button({
  867. text: 'Say Hi',
  868. renderTo: Ext.getBody()
  869. });
  870. // This callback will execute in the scope of the
  871. // button instance. Clicking the button alerts
  872. // "Hi, Fred. You clicked the "Say Hi" button."
  873. btn.on('click', sayHi.createDelegate(btn, ['Fred']));
  874. </code></pre>
  875. * @param {Object} scope (optional) The scope (<code><b>this</b></code> reference) in which the function is executed.
  876. * <b>If omitted, defaults to the browser window.</b>
  877. * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller)
  878. * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding,
  879. * if a number the args are inserted at the specified position
  880. * @return {Function} The new function
  881. */
  882. createDelegate : function(obj, args, appendArgs){
  883. var method = this;
  884. return function() {
  885. var callArgs = args || arguments;
  886. if (appendArgs === true){
  887. callArgs = Array.prototype.slice.call(arguments, 0);
  888. callArgs = callArgs.concat(args);
  889. }else if (Ext.isNumber(appendArgs)){
  890. callArgs = Array.prototype.slice.call(arguments, 0); // copy arguments first
  891. var applyArgs = [appendArgs, 0].concat(args); // create method call params
  892. Array.prototype.splice.apply(callArgs, applyArgs); // splice them in
  893. }
  894. return method.apply(obj || window, callArgs);
  895. };
  896. },
  897. <div id="method-Function-defer"></div>/**
  898. * Calls this function after the number of millseconds specified, optionally in a specific scope. Example usage:
  899. * <pre><code>
  900. var sayHi = function(name){
  901. alert('Hi, ' + name);
  902. }
  903. // executes immediately:
  904. sayHi('Fred');
  905. // executes after 2 seconds:
  906. sayHi.defer(2000, this, ['Fred']);
  907. // this syntax is sometimes useful for deferring
  908. // execution of an anonymous function:
  909. (function(){
  910. alert('Anonymous');
  911. }).defer(100);
  912. </code></pre>
  913. * @param {Number} millis The number of milliseconds for the setTimeout call (if less than or equal to 0 the function is executed immediately)
  914. * @param {Object} scope (optional) The scope (<code><b>this</b></code> reference) in which the function is executed.
  915. * <b>If omitted, defaults to the browser window.</b>
  916. * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller)
  917. * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding,
  918. * if a number the args are inserted at the specified position
  919. * @return {Number} The timeout id that can be used with clearTimeout
  920. */
  921. defer : function(millis, obj, args, appendArgs){
  922. var fn = this.createDelegate(obj, args, appendArgs);
  923. if(millis > 0){
  924. return setTimeout(fn, millis);
  925. }
  926. fn();
  927. return 0;
  928. }
  929. });
  930. <div id="cls-String"></div>/**
  931. * @class String
  932. * These functions are available on every String object.
  933. */
  934. Ext.applyIf(String, {
  935. <div id="method-String-format"></div>/**
  936. * Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens. Each
  937. * token must be unique, and must increment in the format {0}, {1}, etc. Example usage:
  938. * <pre><code>
  939. var cls = 'my-class', text = 'Some text';
  940. var s = String.format('&lt;div class="{0}">{1}&lt;/div>', cls, text);
  941. // s now contains the string: '&lt;div class="my-class">Some text&lt;/div>'
  942. * </code></pre>
  943. * @param {String} string The tokenized string to be formatted
  944. * @param {String} value1 The value to replace token {0}
  945. * @param {String} value2 Etc...
  946. * @return {String} The formatted string
  947. * @static
  948. */
  949. format : function(format){
  950. var args = Ext.toArray(arguments, 1);
  951. return format.replace(/\{(\d+)\}/g, function(m, i){
  952. return args[i];
  953. });
  954. }
  955. });
  956. <div id="cls-Array"></div>/**
  957. * @class Array
  958. */
  959. Ext.applyIf(Array.prototype, {
  960. <div id="method-Array-indexOf"></div>/**
  961. * Checks whether or not the specified object exists in the array.
  962. * @param {Object} o The object to check for
  963. * @param {Number} from (Optional) The index at which to begin the search
  964. * @return {Number} The index of o in the array (or -1 if it is not found)
  965. */
  966. indexOf : function(o, from){
  967. var len = this.length;
  968. from = from || 0;
  969. from += (from < 0) ? len : 0;
  970. for (; from < len; ++from){
  971. if(this[from] === o){
  972. return from;
  973. }
  974. }
  975. return -1;
  976. },
  977. <div id="method-Array-remove"></div>/**
  978. * Removes the specified object from the array. If the object is not found nothing happens.
  979. * @param {Object} o The object to remove
  980. * @return {Array} this array
  981. */
  982. remove : function(o){
  983. var index = this.indexOf(o);
  984. if(index != -1){
  985. this.splice(index, 1);
  986. }
  987. return this;
  988. }
  989. });
  990. </pre>
  991. </body>
  992. </html>