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.

545 lines
26 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. <div id="cls-Ext.Updater"></div>/**
  16. * @class Ext.Updater
  17. * @extends Ext.util.Observable
  18. * Provides AJAX-style update capabilities for Element objects. Updater can be used to {@link #update}
  19. * an {@link Ext.Element} once, or you can use {@link #startAutoRefresh} to set up an auto-updating
  20. * {@link Ext.Element Element} on a specific interval.<br><br>
  21. * Usage:<br>
  22. * <pre><code>
  23. * var el = Ext.get("foo"); // Get Ext.Element object
  24. * var mgr = el.getUpdater();
  25. * mgr.update({
  26. url: "http://myserver.com/index.php",
  27. params: {
  28. param1: "foo",
  29. param2: "bar"
  30. }
  31. * });
  32. * ...
  33. * mgr.formUpdate("myFormId", "http://myserver.com/index.php");
  34. * <br>
  35. * // or directly (returns the same Updater instance)
  36. * var mgr = new Ext.Updater("myElementId");
  37. * mgr.startAutoRefresh(60, "http://myserver.com/index.php");
  38. * mgr.on("update", myFcnNeedsToKnow);
  39. * <br>
  40. * // short handed call directly from the element object
  41. * Ext.get("foo").load({
  42. url: "bar.php",
  43. scripts: true,
  44. params: "param1=foo&amp;param2=bar",
  45. text: "Loading Foo..."
  46. * });
  47. * </code></pre>
  48. * @constructor
  49. * Create new Updater directly.
  50. * @param {Mixed} el The element to update
  51. * @param {Boolean} forceNew (optional) By default the constructor checks to see if the passed element already
  52. * has an Updater and if it does it returns the same instance. This will skip that check (useful for extending this class).
  53. */
  54. Ext.UpdateManager = Ext.Updater = Ext.extend(Ext.util.Observable,
  55. function() {
  56. var BEFOREUPDATE = "beforeupdate",
  57. UPDATE = "update",
  58. FAILURE = "failure";
  59. // private
  60. function processSuccess(response){
  61. var me = this;
  62. me.transaction = null;
  63. if (response.argument.form && response.argument.reset) {
  64. try { // put in try/catch since some older FF releases had problems with this
  65. response.argument.form.reset();
  66. } catch(e){}
  67. }
  68. if (me.loadScripts) {
  69. me.renderer.render(me.el, response, me,
  70. updateComplete.createDelegate(me, [response]));
  71. } else {
  72. me.renderer.render(me.el, response, me);
  73. updateComplete.call(me, response);
  74. }
  75. }
  76. // private
  77. function updateComplete(response, type, success){
  78. this.fireEvent(type || UPDATE, this.el, response);
  79. if(Ext.isFunction(response.argument.callback)){
  80. response.argument.callback.call(response.argument.scope, this.el, Ext.isEmpty(success) ? true : false, response, response.argument.options);
  81. }
  82. }
  83. // private
  84. function processFailure(response){
  85. updateComplete.call(this, response, FAILURE, !!(this.transaction = null));
  86. }
  87. return {
  88. constructor: function(el, forceNew){
  89. var me = this;
  90. el = Ext.get(el);
  91. if(!forceNew && el.updateManager){
  92. return el.updateManager;
  93. }
  94. <div id="prop-Ext.Updater-el"></div>/**
  95. * The Element object
  96. * @type Ext.Element
  97. */
  98. me.el = el;
  99. <div id="prop-Ext.Updater-defaultUrl"></div>/**
  100. * Cached url to use for refreshes. Overwritten every time update() is called unless "discardUrl" param is set to true.
  101. * @type String
  102. */
  103. me.defaultUrl = null;
  104. me.addEvents(
  105. <div id="event-Ext.Updater-beforeupdate"></div>/**
  106. * @event beforeupdate
  107. * Fired before an update is made, return false from your handler and the update is cancelled.
  108. * @param {Ext.Element} el
  109. * @param {String/Object/Function} url
  110. * @param {String/Object} params
  111. */
  112. BEFOREUPDATE,
  113. <div id="event-Ext.Updater-update"></div>/**
  114. * @event update
  115. * Fired after successful update is made.
  116. * @param {Ext.Element} el
  117. * @param {Object} oResponseObject The response Object
  118. */
  119. UPDATE,
  120. <div id="event-Ext.Updater-failure"></div>/**
  121. * @event failure
  122. * Fired on update failure.
  123. * @param {Ext.Element} el
  124. * @param {Object} oResponseObject The response Object
  125. */
  126. FAILURE
  127. );
  128. Ext.apply(me, Ext.Updater.defaults);
  129. <div id="prop-Ext.Updater-sslBlankUrl"></div>/**
  130. * Blank page URL to use with SSL file uploads (defaults to {@link Ext.Updater.defaults#sslBlankUrl}).
  131. * @property sslBlankUrl
  132. * @type String
  133. */
  134. <div id="prop-Ext.Updater-disableCaching"></div>/**
  135. * Whether to append unique parameter on get request to disable caching (defaults to {@link Ext.Updater.defaults#disableCaching}).
  136. * @property disableCaching
  137. * @type Boolean
  138. */
  139. <div id="prop-Ext.Updater-indicatorText"></div>/**
  140. * Text for loading indicator (defaults to {@link Ext.Updater.defaults#indicatorText}).
  141. * @property indicatorText
  142. * @type String
  143. */
  144. <div id="prop-Ext.Updater-showLoadIndicator"></div>/**
  145. * Whether to show indicatorText when loading (defaults to {@link Ext.Updater.defaults#showLoadIndicator}).
  146. * @property showLoadIndicator
  147. * @type String
  148. */
  149. <div id="prop-Ext.Updater-timeout"></div>/**
  150. * Timeout for requests or form posts in seconds (defaults to {@link Ext.Updater.defaults#timeout}).
  151. * @property timeout
  152. * @type Number
  153. */
  154. <div id="prop-Ext.Updater-loadScripts"></div>/**
  155. * True to process scripts in the output (defaults to {@link Ext.Updater.defaults#loadScripts}).
  156. * @property loadScripts
  157. * @type Boolean
  158. */
  159. <div id="prop-Ext.Updater-transaction"></div>/**
  160. * Transaction object of the current executing transaction, or null if there is no active transaction.
  161. */
  162. me.transaction = null;
  163. <div id="prop-Ext.Updater-refreshDelegate"></div>/**
  164. * Delegate for refresh() prebound to "this", use myUpdater.refreshDelegate.createCallback(arg1, arg2) to bind arguments
  165. * @type Function
  166. */
  167. me.refreshDelegate = me.refresh.createDelegate(me);
  168. <div id="prop-Ext.Updater-updateDelegate"></div>/**
  169. * Delegate for update() prebound to "this", use myUpdater.updateDelegate.createCallback(arg1, arg2) to bind arguments
  170. * @type Function
  171. */
  172. me.updateDelegate = me.update.createDelegate(me);
  173. <div id="prop-Ext.Updater-formUpdateDelegate"></div>/**
  174. * Delegate for formUpdate() prebound to "this", use myUpdater.formUpdateDelegate.createCallback(arg1, arg2) to bind arguments
  175. * @type Function
  176. */
  177. me.formUpdateDelegate = (me.formUpdate || function(){}).createDelegate(me);
  178. <div id="prop-Ext.Updater-renderer"></div>/**
  179. * The renderer for this Updater (defaults to {@link Ext.Updater.BasicRenderer}).
  180. */
  181. me.renderer = me.renderer || me.getDefaultRenderer();
  182. Ext.Updater.superclass.constructor.call(me);
  183. },
  184. <div id="method-Ext.Updater-setRenderer"></div>/**
  185. * Sets the content renderer for this Updater. See {@link Ext.Updater.BasicRenderer#render} for more details.
  186. * @param {Object} renderer The object implementing the render() method
  187. */
  188. setRenderer : function(renderer){
  189. this.renderer = renderer;
  190. },
  191. <div id="method-Ext.Updater-getRenderer"></div>/**
  192. * Returns the current content renderer for this Updater. See {@link Ext.Updater.BasicRenderer#render} for more details.
  193. * @return {Object}
  194. */
  195. getRenderer : function(){
  196. return this.renderer;
  197. },
  198. <div id="method-Ext.Updater-getDefaultRenderer"></div>/**
  199. * This is an overrideable method which returns a reference to a default
  200. * renderer class if none is specified when creating the Ext.Updater.
  201. * Defaults to {@link Ext.Updater.BasicRenderer}
  202. */
  203. getDefaultRenderer: function() {
  204. return new Ext.Updater.BasicRenderer();
  205. },
  206. <div id="method-Ext.Updater-setDefaultUrl"></div>/**
  207. * Sets the default URL used for updates.
  208. * @param {String/Function} defaultUrl The url or a function to call to get the url
  209. */
  210. setDefaultUrl : function(defaultUrl){
  211. this.defaultUrl = defaultUrl;
  212. },
  213. <div id="method-Ext.Updater-getEl"></div>/**
  214. * Get the Element this Updater is bound to
  215. * @return {Ext.Element} The element
  216. */
  217. getEl : function(){
  218. return this.el;
  219. },
  220. <div id="method-Ext.Updater-update"></div>/**
  221. * Performs an <b>asynchronous</b> request, updating this element with the response.
  222. * If params are specified it uses POST, otherwise it uses GET.<br><br>
  223. * <b>Note:</b> Due to the asynchronous nature of remote server requests, the Element
  224. * will not have been fully updated when the function returns. To post-process the returned
  225. * data, use the callback option, or an <b><code>update</code></b> event handler.
  226. * @param {Object} options A config object containing any of the following options:<ul>
  227. * <li>url : <b>String/Function</b><p class="sub-desc">The URL to request or a function which
  228. * <i>returns</i> the URL (defaults to the value of {@link Ext.Ajax#url} if not specified).</p></li>
  229. * <li>method : <b>String</b><p class="sub-desc">The HTTP method to
  230. * use. Defaults to POST if the <code>params</code> argument is present, otherwise GET.</p></li>
  231. * <li>params : <b>String/Object/Function</b><p class="sub-desc">The
  232. * parameters to pass to the server (defaults to none). These may be specified as a url-encoded
  233. * string, or as an object containing properties which represent parameters,
  234. * or as a function, which returns such an object.</p></li>
  235. * <li>scripts : <b>Boolean</b><p class="sub-desc">If <code>true</code>
  236. * any &lt;script&gt; tags embedded in the response text will be extracted
  237. * and executed (defaults to {@link Ext.Updater.defaults#loadScripts}). If this option is specified,
  238. * the callback will be called <i>after</i> the execution of the scripts.</p></li>
  239. * <li>callback : <b>Function</b><p class="sub-desc">A function to
  240. * be called when the response from the server arrives. The following
  241. * parameters are passed:<ul>
  242. * <li><b>el</b> : Ext.Element<p class="sub-desc">The Element being updated.</p></li>
  243. * <li><b>success</b> : Boolean<p class="sub-desc">True for success, false for failure.</p></li>
  244. * <li><b>response</b> : XMLHttpRequest<p class="sub-desc">The XMLHttpRequest which processed the update.</p></li>
  245. * <li><b>options</b> : Object<p class="sub-desc">The config object passed to the update call.</p></li></ul>
  246. * </p></li>
  247. * <li>scope : <b>Object</b><p class="sub-desc">The scope in which
  248. * to execute the callback (The callback's <code>this</code> reference.) If the
  249. * <code>params</code> argument is a function, this scope is used for that function also.</p></li>
  250. * <li>discardUrl : <b>Boolean</b><p class="sub-desc">By default, the URL of this request becomes
  251. * the default URL for this Updater object, and will be subsequently used in {@link #refresh}
  252. * calls. To bypass this behavior, pass <code>discardUrl:true</code> (defaults to false).</p></li>
  253. * <li>timeout : <b>Number</b><p class="sub-desc">The number of seconds to wait for a response before
  254. * timing out (defaults to {@link Ext.Updater.defaults#timeout}).</p></li>
  255. * <li>text : <b>String</b><p class="sub-desc">The text to use as the innerHTML of the
  256. * {@link Ext.Updater.defaults#indicatorText} div (defaults to 'Loading...'). To replace the entire div, not
  257. * just the text, override {@link Ext.Updater.defaults#indicatorText} directly.</p></li>
  258. * <li>nocache : <b>Boolean</b><p class="sub-desc">Only needed for GET
  259. * requests, this option causes an extra, auto-generated parameter to be appended to the request
  260. * to defeat caching (defaults to {@link Ext.Updater.defaults#disableCaching}).</p></li></ul>
  261. * <p>
  262. * For example:
  263. <pre><code>
  264. um.update({
  265. url: "your-url.php",
  266. params: {param1: "foo", param2: "bar"}, // or a URL encoded string
  267. callback: yourFunction,
  268. scope: yourObject, //(optional scope)
  269. discardUrl: true,
  270. nocache: true,
  271. text: "Loading...",
  272. timeout: 60,
  273. scripts: false // Save time by avoiding RegExp execution.
  274. });
  275. </code></pre>
  276. */
  277. update : function(url, params, callback, discardUrl){
  278. var me = this,
  279. cfg,
  280. callerScope;
  281. if(me.fireEvent(BEFOREUPDATE, me.el, url, params) !== false){
  282. if(Ext.isObject(url)){ // must be config object
  283. cfg = url;
  284. url = cfg.url;
  285. params = params || cfg.params;
  286. callback = callback || cfg.callback;
  287. discardUrl = discardUrl || cfg.discardUrl;
  288. callerScope = cfg.scope;
  289. if(!Ext.isEmpty(cfg.nocache)){me.disableCaching = cfg.nocache;};
  290. if(!Ext.isEmpty(cfg.text)){me.indicatorText = '<div class="loading-indicator">'+cfg.text+"</div>";};
  291. if(!Ext.isEmpty(cfg.scripts)){me.loadScripts = cfg.scripts;};
  292. if(!Ext.isEmpty(cfg.timeout)){me.timeout = cfg.timeout;};
  293. }
  294. me.showLoading();
  295. if(!discardUrl){
  296. me.defaultUrl = url;
  297. }
  298. if(Ext.isFunction(url)){
  299. url = url.call(me);
  300. }
  301. var o = Ext.apply({}, {
  302. url : url,
  303. params: (Ext.isFunction(params) && callerScope) ? params.createDelegate(callerScope) : params,
  304. success: processSuccess,
  305. failure: processFailure,
  306. scope: me,
  307. callback: undefined,
  308. timeout: (me.timeout*1000),
  309. disableCaching: me.disableCaching,
  310. argument: {
  311. "options": cfg,
  312. "url": url,
  313. "form": null,
  314. "callback": callback,
  315. "scope": callerScope || window,
  316. "params": params
  317. }
  318. }, cfg);
  319. me.transaction = Ext.Ajax.request(o);
  320. }
  321. },
  322. <div id="method-Ext.Updater-formUpdate"></div>/**
  323. * <p>Performs an asynchronous form post, updating this element with the response. If the form has the attribute
  324. * enctype="<a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form-data</a>", it assumes it's a file upload.
  325. * Uses this.sslBlankUrl for SSL file uploads to prevent IE security warning.</p>
  326. * <p>File uploads are not performed using normal "Ajax" techniques, that is they are <b>not</b>
  327. * performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the
  328. * DOM <code>&lt;form></code> element temporarily modified to have its
  329. * <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer
  330. * to a dynamically generated, hidden <code>&lt;iframe></code> which is inserted into the document
  331. * but removed after the return data has been gathered.</p>
  332. * <p>Be aware that file upload packets, sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form-data</a>
  333. * and some server technologies (notably JEE) may require some custom processing in order to
  334. * retrieve parameter names and parameter values from the packet content.</p>
  335. * @param {String/HTMLElement} form The form Id or form element
  336. * @param {String} url (optional) The url to pass the form to. If omitted the action attribute on the form will be used.
  337. * @param {Boolean} reset (optional) Whether to try to reset the form after the update
  338. * @param {Function} callback (optional) Callback when transaction is complete. The following
  339. * parameters are passed:<ul>
  340. * <li><b>el</b> : Ext.Element<p class="sub-desc">The Element being updated.</p></li>
  341. * <li><b>success</b> : Boolean<p class="sub-desc">True for success, false for failure.</p></li>
  342. * <li><b>response</b> : XMLHttpRequest<p class="sub-desc">The XMLHttpRequest which processed the update.</p></li></ul>
  343. */
  344. formUpdate : function(form, url, reset, callback){
  345. var me = this;
  346. if(me.fireEvent(BEFOREUPDATE, me.el, form, url) !== false){
  347. if(Ext.isFunction(url)){
  348. url = url.call(me);
  349. }
  350. form = Ext.getDom(form);
  351. me.transaction = Ext.Ajax.request({
  352. form: form,
  353. url:url,
  354. success: processSuccess,
  355. failure: processFailure,
  356. scope: me,
  357. timeout: (me.timeout*1000),
  358. argument: {
  359. "url": url,
  360. "form": form,
  361. "callback": callback,
  362. "reset": reset
  363. }
  364. });
  365. me.showLoading.defer(1, me);
  366. }
  367. },
  368. <div id="method-Ext.Updater-startAutoRefresh"></div>/**
  369. * Set this element to auto refresh. Can be canceled by calling {@link #stopAutoRefresh}.
  370. * @param {Number} interval How often to update (in seconds).
  371. * @param {String/Object/Function} url (optional) The url for this request, a config object in the same format
  372. * supported by {@link #load}, or a function to call to get the url (defaults to the last used url). Note that while
  373. * the url used in a load call can be reused by this method, other load config options will not be reused and must be
  374. * sepcified as part of a config object passed as this paramter if needed.
  375. * @param {String/Object} params (optional) The parameters to pass as either a url encoded string
  376. * "&param1=1&param2=2" or as an object {param1: 1, param2: 2}
  377. * @param {Function} callback (optional) Callback when transaction is complete - called with signature (oElement, bSuccess)
  378. * @param {Boolean} refreshNow (optional) Whether to execute the refresh now, or wait the interval
  379. */
  380. startAutoRefresh : function(interval, url, params, callback, refreshNow){
  381. var me = this;
  382. if(refreshNow){
  383. me.update(url || me.defaultUrl, params, callback, true);
  384. }
  385. if(me.autoRefreshProcId){
  386. clearInterval(me.autoRefreshProcId);
  387. }
  388. me.autoRefreshProcId = setInterval(me.update.createDelegate(me, [url || me.defaultUrl, params, callback, true]), interval * 1000);
  389. },
  390. <div id="method-Ext.Updater-stopAutoRefresh"></div>/**
  391. * Stop auto refresh on this element.
  392. */
  393. stopAutoRefresh : function(){
  394. if(this.autoRefreshProcId){
  395. clearInterval(this.autoRefreshProcId);
  396. delete this.autoRefreshProcId;
  397. }
  398. },
  399. <div id="method-Ext.Updater-isAutoRefreshing"></div>/**
  400. * Returns true if the Updater is currently set to auto refresh its content (see {@link #startAutoRefresh}), otherwise false.
  401. */
  402. isAutoRefreshing : function(){
  403. return !!this.autoRefreshProcId;
  404. },
  405. <div id="method-Ext.Updater-showLoading"></div>/**
  406. * Display the element's "loading" state. By default, the element is updated with {@link #indicatorText}. This
  407. * method may be overridden to perform a custom action while this Updater is actively updating its contents.
  408. */
  409. showLoading : function(){
  410. if(this.showLoadIndicator){
  411. this.el.dom.innerHTML = this.indicatorText;
  412. }
  413. },
  414. <div id="method-Ext.Updater-abort"></div>/**
  415. * Aborts the currently executing transaction, if any.
  416. */
  417. abort : function(){
  418. if(this.transaction){
  419. Ext.Ajax.abort(this.transaction);
  420. }
  421. },
  422. <div id="method-Ext.Updater-isUpdating"></div>/**
  423. * Returns true if an update is in progress, otherwise false.
  424. * @return {Boolean}
  425. */
  426. isUpdating : function(){
  427. return this.transaction ? Ext.Ajax.isLoading(this.transaction) : false;
  428. },
  429. <div id="method-Ext.Updater-refresh"></div>/**
  430. * Refresh the element with the last used url or defaultUrl. If there is no url, it returns immediately
  431. * @param {Function} callback (optional) Callback when transaction is complete - called with signature (oElement, bSuccess)
  432. */
  433. refresh : function(callback){
  434. if(this.defaultUrl){
  435. this.update(this.defaultUrl, null, callback, true);
  436. }
  437. }
  438. };
  439. }());
  440. <div id="cls-Ext.Updater.defaults"></div>/**
  441. * @class Ext.Updater.defaults
  442. * The defaults collection enables customizing the default properties of Updater
  443. */
  444. Ext.Updater.defaults = {
  445. <div id="prop-Ext.Updater.defaults-timeout"></div>/**
  446. * Timeout for requests or form posts in seconds (defaults to 30 seconds).
  447. * @type Number
  448. */
  449. timeout : 30,
  450. <div id="prop-Ext.Updater.defaults-disableCaching"></div>/**
  451. * True to append a unique parameter to GET requests to disable caching (defaults to false).
  452. * @type Boolean
  453. */
  454. disableCaching : false,
  455. <div id="prop-Ext.Updater.defaults-showLoadIndicator"></div>/**
  456. * Whether or not to show {@link #indicatorText} during loading (defaults to true).
  457. * @type Boolean
  458. */
  459. showLoadIndicator : true,
  460. <div id="prop-Ext.Updater.defaults-indicatorText"></div>/**
  461. * Text for loading indicator (defaults to '&lt;div class="loading-indicator"&gt;Loading...&lt;/div&gt;').
  462. * @type String
  463. */
  464. indicatorText : '<div class="loading-indicator">Loading...</div>',
  465. <div id="prop-Ext.Updater.defaults-loadScripts"></div>/**
  466. * True to process scripts by default (defaults to false).
  467. * @type Boolean
  468. */
  469. loadScripts : false,
  470. <div id="prop-Ext.Updater.defaults-sslBlankUrl"></div>/**
  471. * Blank page URL to use with SSL file uploads (defaults to {@link Ext#SSL_SECURE_URL} if set, or "javascript:false").
  472. * @type String
  473. */
  474. sslBlankUrl : Ext.SSL_SECURE_URL
  475. };
  476. <div id="method-Ext.Updater-Updater.updateElement"></div>/**
  477. * Static convenience method. <b>This method is deprecated in favor of el.load({url:'foo.php', ...})</b>.
  478. * Usage:
  479. * <pre><code>Ext.Updater.updateElement("my-div", "stuff.php");</code></pre>
  480. * @param {Mixed} el The element to update
  481. * @param {String} url The url
  482. * @param {String/Object} params (optional) Url encoded param string or an object of name/value pairs
  483. * @param {Object} options (optional) A config object with any of the Updater properties you want to set - for
  484. * example: {disableCaching:true, indicatorText: "Loading data..."}
  485. * @static
  486. * @deprecated
  487. * @member Ext.Updater
  488. */
  489. Ext.Updater.updateElement = function(el, url, params, options){
  490. var um = Ext.get(el).getUpdater();
  491. Ext.apply(um, options);
  492. um.update(url, params, options ? options.callback : null);
  493. };
  494. <div id="cls-Ext.Updater.BasicRenderer"></div>/**
  495. * @class Ext.Updater.BasicRenderer
  496. * <p>This class is a base class implementing a simple render method which updates an element using results from an Ajax request.</p>
  497. * <p>The BasicRenderer updates the element's innerHTML with the responseText. To perform a custom render (i.e. XML or JSON processing),
  498. * create an object with a conforming {@link #render} method and pass it to setRenderer on the Updater.</p>
  499. */
  500. Ext.Updater.BasicRenderer = function(){};
  501. Ext.Updater.BasicRenderer.prototype = {
  502. <div id="method-Ext.Updater.BasicRenderer-render"></div>/**
  503. * This method is called when an Ajax response is received, and an Element needs updating.
  504. * @param {Ext.Element} el The element being rendered
  505. * @param {Object} xhr The XMLHttpRequest object
  506. * @param {Updater} updateManager The calling update manager
  507. * @param {Function} callback A callback that will need to be called if loadScripts is true on the Updater
  508. */
  509. render : function(el, response, updateManager, callback){
  510. el.update(response.responseText, updateManager.loadScripts, callback);
  511. }
  512. };</pre>
  513. </body>
  514. </html>