PageRenderTime 54ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/src/Samples/Xmlt.Sample/Scripts/embed/MicrosoftAjaxWebForms.debug.js

#
JavaScript | 2130 lines | 1812 code | 247 blank | 71 comment | 373 complexity | 78a92650b654e37c04b37e5699db3c46 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. // (c) 2010 CodePlex Foundation
  2. (function() {
  3. function execute() {
  4. Type._registerScript("MicrosoftAjaxWebForms.js", [
  5. "MicrosoftAjaxCore.js",
  6. "MicrosoftAjaxSerialization.js",
  7. "MicrosoftAjaxNetwork.js",
  8. "MicrosoftAjaxComponentModel.js"]);
  9. var $type, $prototype;
  10. Type.registerNamespace('Sys.WebForms');
  11. $type = Sys.WebForms.BeginRequestEventArgs = function BeginRequestEventArgs(request, postBackElement, updatePanelsToUpdate) {
  12. /// <summary locid="M:J#Sys.WebForms.BeginRequestEventArgs.#ctor">The arguments for the PageRequestManager's beginRequest event. The beginRequest event is raised when a request is about to be made.</summary>
  13. /// <param name="request" type="Sys.Net.WebRequest">The web request for the EventArgs.</param>
  14. /// <param name="postBackElement" domElement="true" mayBeNull="true">The postback element that initiated the async postback.</param>
  15. /// <param name="updatePanelsToUpdate" type="Array" elementType="String" mayBeNull="true" optional="true">A list of UniqueIDs for UpdatePanel controls that are requested to update their rendering by the client. Server-side processing may update additional UpdatePanels.</param>
  16. var e = Function._validateParams(arguments, [
  17. {name: "request", type: Sys.Net.WebRequest},
  18. {name: "postBackElement", mayBeNull: true, domElement: true},
  19. {name: "updatePanelsToUpdate", type: Array, mayBeNull: true, optional: true, elementType: String}
  20. ]);
  21. if (e) throw e;
  22. Sys.WebForms.BeginRequestEventArgs.initializeBase(this);
  23. this._request = request;
  24. this._postBackElement = postBackElement;
  25. this._updatePanelsToUpdate = updatePanelsToUpdate;
  26. }
  27. $type.prototype = {
  28. get_postBackElement: function BeginRequestEventArgs$get_postBackElement() {
  29. /// <value domElement="true" mayBeNull="true" locid="P:J#Sys.WebForms.BeginRequestEventArgs.postBackElement"></value>
  30. if (arguments.length !== 0) throw Error.parameterCount();
  31. return this._postBackElement;
  32. },
  33. get_request: function BeginRequestEventArgs$get_request() {
  34. /// <value type="Sys.Net.WebRequest" locid="P:J#Sys.WebForms.BeginRequestEventArgs.request"></value>
  35. if (arguments.length !== 0) throw Error.parameterCount();
  36. return this._request;
  37. },
  38. get_updatePanelsToUpdate: function BeginRequestEventArgs$get_updatePanelsToUpdate() {
  39. /// <value type="Array" elementType="String" locid="P:J#Sys.WebForms.BeginRequestEventArgs.updatePanelsToUpdate"></value>
  40. if (arguments.length !== 0) throw Error.parameterCount();
  41. return this._updatePanelsToUpdate ? Array.clone(this._updatePanelsToUpdate) : [];
  42. }
  43. }
  44. $type.registerClass('Sys.WebForms.BeginRequestEventArgs', Sys.EventArgs);
  45. $type = Sys.WebForms.EndRequestEventArgs = function EndRequestEventArgs(error, dataItems, response) {
  46. /// <summary locid="M:J#Sys.WebForms.EndRequestEventArgs.#ctor">The arguments for the PageRequestManager's endRequest event. The endRequest event is raised when a response has finished processing.</summary>
  47. /// <param name="error" type="Error" mayBeNull="true"></param>
  48. /// <param name="dataItems" type="Object" mayBeNull="true"></param>
  49. /// <param name="response" type="Sys.Net.WebRequestExecutor"></param>
  50. var e = Function._validateParams(arguments, [
  51. {name: "error", type: Error, mayBeNull: true},
  52. {name: "dataItems", type: Object, mayBeNull: true},
  53. {name: "response", type: Sys.Net.WebRequestExecutor}
  54. ]);
  55. if (e) throw e;
  56. Sys.WebForms.EndRequestEventArgs.initializeBase(this);
  57. this._errorHandled = false;
  58. this._error = error;
  59. this._dataItems = dataItems || new Object();
  60. this._response = response;
  61. }
  62. $type.prototype = {
  63. get_dataItems: function EndRequestEventArgs$get_dataItems() {
  64. /// <value type="Object" locid="P:J#Sys.WebForms.EndRequestEventArgs.dataItems"></value>
  65. if (arguments.length !== 0) throw Error.parameterCount();
  66. return this._dataItems;
  67. },
  68. get_error: function EndRequestEventArgs$get_error() {
  69. /// <value type="Error" locid="P:J#Sys.WebForms.EndRequestEventArgs.error"></value>
  70. if (arguments.length !== 0) throw Error.parameterCount();
  71. return this._error;
  72. },
  73. get_errorHandled: function EndRequestEventArgs$get_errorHandled() {
  74. /// <value type="Boolean" locid="P:J#Sys.WebForms.EndRequestEventArgs.errorHandled"></value>
  75. if (arguments.length !== 0) throw Error.parameterCount();
  76. return this._errorHandled;
  77. },
  78. set_errorHandled: function EndRequestEventArgs$set_errorHandled(value) {
  79. var e = Function._validateParams(arguments, [{name: "value", type: Boolean}]);
  80. if (e) throw e;
  81. this._errorHandled = value;
  82. },
  83. get_response: function EndRequestEventArgs$get_response() {
  84. /// <value type="Sys.Net.WebRequestExecutor" locid="P:J#Sys.WebForms.EndRequestEventArgs.response"></value>
  85. if (arguments.length !== 0) throw Error.parameterCount();
  86. return this._response;
  87. }
  88. }
  89. $type.registerClass('Sys.WebForms.EndRequestEventArgs', Sys.EventArgs);
  90. $type = Sys.WebForms.InitializeRequestEventArgs = function InitializeRequestEventArgs(request, postBackElement, updatePanelsToUpdate) {
  91. /// <summary locid="M:J#Sys.WebForms.InitializeRequestEventArgs.#ctor">The arguments for the PageRequestManager's initializeRequest event. The initializeRequest event is raised when a request is being prepared and can be cancelled.</summary>
  92. /// <param name="request" type="Sys.Net.WebRequest">The web request to be packaged in this EventArgs.</param>
  93. /// <param name="postBackElement" domElement="true" mayBeNull="true">The postback element that initiated the async postback.</param>
  94. /// <param name="updatePanelsToUpdate" type="Array" elementType="String" mayBeNull="true" optional="true">A list of UniqueIDs for UpdatePanel controls that are requested to update their rendering by the client. Server-side processing may update additional UpdatePanels.</param>
  95. var e = Function._validateParams(arguments, [
  96. {name: "request", type: Sys.Net.WebRequest},
  97. {name: "postBackElement", mayBeNull: true, domElement: true},
  98. {name: "updatePanelsToUpdate", type: Array, mayBeNull: true, optional: true, elementType: String}
  99. ]);
  100. if (e) throw e;
  101. Sys.WebForms.InitializeRequestEventArgs.initializeBase(this);
  102. this._request = request;
  103. this._postBackElement = postBackElement;
  104. this._updatePanelsToUpdate = updatePanelsToUpdate;
  105. }
  106. $type.prototype = {
  107. get_postBackElement: function InitializeRequestEventArgs$get_postBackElement() {
  108. /// <value domElement="true" mayBeNull="true" locid="P:J#Sys.WebForms.InitializeRequestEventArgs.postBackElement"></value>
  109. if (arguments.length !== 0) throw Error.parameterCount();
  110. return this._postBackElement;
  111. },
  112. get_request: function InitializeRequestEventArgs$get_request() {
  113. /// <value type="Sys.Net.WebRequest" locid="P:J#Sys.WebForms.InitializeRequestEventArgs.request"></value>
  114. if (arguments.length !== 0) throw Error.parameterCount();
  115. return this._request;
  116. },
  117. get_updatePanelsToUpdate: function InitializeRequestEventArgs$get_updatePanelsToUpdate() {
  118. /// <value type="Array" elementType="String" locid="P:J#Sys.WebForms.InitializeRequestEventArgs.updatePanelsToUpdate"></value>
  119. if (arguments.length !== 0) throw Error.parameterCount();
  120. return this._updatePanelsToUpdate ? Array.clone(this._updatePanelsToUpdate) : [];
  121. },
  122. set_updatePanelsToUpdate: function InitializeRequestEventArgs$set_updatePanelsToUpdate(value) {
  123. var e = Function._validateParams(arguments, [{name: "value", type: Array, elementType: String}]);
  124. if (e) throw e;
  125. this._updated = true;
  126. this._updatePanelsToUpdate = value;
  127. }
  128. }
  129. $type.registerClass('Sys.WebForms.InitializeRequestEventArgs', Sys.CancelEventArgs);
  130. $type = Sys.WebForms.PageLoadedEventArgs = function PageLoadedEventArgs(panelsUpdated, panelsCreated, dataItems) {
  131. /// <summary locid="M:J#Sys.WebForms.PageLoadedEventArgs.#ctor">The arguments for the PageRequestManager's pageLoaded event. The pageLoaded event is raised after the DOM has been updated.</summary>
  132. /// <param name="panelsUpdated" type="Array">An array of UpdatePanels that were updated.</param>
  133. /// <param name="panelsCreated" type="Array">An array of UpdatePanels that were created.</param>
  134. /// <param name="dataItems" type="Object" mayBeNull="true"></param>
  135. var e = Function._validateParams(arguments, [
  136. {name: "panelsUpdated", type: Array},
  137. {name: "panelsCreated", type: Array},
  138. {name: "dataItems", type: Object, mayBeNull: true}
  139. ]);
  140. if (e) throw e;
  141. Sys.WebForms.PageLoadedEventArgs.initializeBase(this);
  142. this._panelsUpdated = panelsUpdated;
  143. this._panelsCreated = panelsCreated;
  144. this._dataItems = dataItems || new Object();
  145. }
  146. $type.prototype = {
  147. get_dataItems: function PageLoadedEventArgs$get_dataItems() {
  148. /// <value type="Object" locid="P:J#Sys.WebForms.PageLoadedEventArgs.dataItems"></value>
  149. if (arguments.length !== 0) throw Error.parameterCount();
  150. return this._dataItems;
  151. },
  152. get_panelsCreated: function PageLoadedEventArgs$get_panelsCreated() {
  153. /// <value type="Array" locid="P:J#Sys.WebForms.PageLoadedEventArgs.panelsCreated"></value>
  154. if (arguments.length !== 0) throw Error.parameterCount();
  155. return this._panelsCreated;
  156. },
  157. get_panelsUpdated: function PageLoadedEventArgs$get_panelsUpdated() {
  158. /// <value type="Array" locid="P:J#Sys.WebForms.PageLoadedEventArgs.panelsUpdated"></value>
  159. if (arguments.length !== 0) throw Error.parameterCount();
  160. return this._panelsUpdated;
  161. }
  162. }
  163. $type.registerClass('Sys.WebForms.PageLoadedEventArgs', Sys.EventArgs);
  164. $type = Sys.WebForms.PageLoadingEventArgs = function PageLoadingEventArgs(panelsUpdating, panelsDeleting, dataItems) {
  165. /// <summary locid="M:J#Sys.WebForms.PageLoadingEventArgs.#ctor">The arguments for the PageRequestManager's pageLoading event. The pageLoading event is raised before the DOM has been updated.</summary>
  166. /// <param name="panelsUpdating" type="Array">An array of UpdatePanels that are going to be updated.</param>
  167. /// <param name="panelsDeleting" type="Array">An array of UpdatePanels that are going to be deleted.</param>
  168. /// <param name="dataItems" type="Object" mayBeNull="true"></param>
  169. var e = Function._validateParams(arguments, [
  170. {name: "panelsUpdating", type: Array},
  171. {name: "panelsDeleting", type: Array},
  172. {name: "dataItems", type: Object, mayBeNull: true}
  173. ]);
  174. if (e) throw e;
  175. Sys.WebForms.PageLoadingEventArgs.initializeBase(this);
  176. this._panelsUpdating = panelsUpdating;
  177. this._panelsDeleting = panelsDeleting;
  178. this._dataItems = dataItems || new Object();
  179. }
  180. $type.prototype = {
  181. get_dataItems: function PageLoadingEventArgs$get_dataItems() {
  182. /// <value type="Object" locid="P:J#Sys.WebForms.PageLoadingEventArgs.dataItems"></value>
  183. if (arguments.length !== 0) throw Error.parameterCount();
  184. return this._dataItems;
  185. },
  186. get_panelsDeleting: function PageLoadingEventArgs$get_panelsDeleting() {
  187. /// <value type="Array" locid="P:J#Sys.WebForms.PageLoadingEventArgs.panelsDeleting"></value>
  188. if (arguments.length !== 0) throw Error.parameterCount();
  189. return this._panelsDeleting;
  190. },
  191. get_panelsUpdating: function PageLoadingEventArgs$get_panelsUpdating() {
  192. /// <value type="Array" locid="P:J#Sys.WebForms.PageLoadingEventArgs.panelsUpdating"></value>
  193. if (arguments.length !== 0) throw Error.parameterCount();
  194. return this._panelsUpdating;
  195. }
  196. }
  197. $type.registerClass('Sys.WebForms.PageLoadingEventArgs', Sys.EventArgs);
  198. $type = Sys._ScriptLoaderTask = function _ScriptLoaderTask(scriptElement, completedCallback) {
  199. /// <summary locid="M:J#Sys._ScriptLoaderTask.#ctor"></summary>
  200. /// <param name="scriptElement" domElement="true">The script element to add to the DOM.</param>
  201. /// <param name="completedCallback" type="Function">Callback to call when the script has loaded or failed to load.</param>
  202. var e = Function._validateParams(arguments, [
  203. {name: "scriptElement", domElement: true},
  204. {name: "completedCallback", type: Function}
  205. ]);
  206. if (e) throw e;
  207. this._scriptElement = scriptElement;
  208. this._completedCallback = completedCallback;
  209. }
  210. $type.prototype = {
  211. get_scriptElement: function _ScriptLoaderTask$get_scriptElement() {
  212. /// <value domElement="true" locid="P:J#Sys._ScriptLoaderTask.scriptElement">The script element.</value>
  213. if (arguments.length !== 0) throw Error.parameterCount();
  214. return this._scriptElement;
  215. },
  216. dispose: function _ScriptLoaderTask$dispose() {
  217. if(this._disposed) {
  218. return;
  219. }
  220. this._disposed = true;
  221. this._removeScriptElementHandlers();
  222. Sys._ScriptLoaderTask._clearScript(this._scriptElement);
  223. this._scriptElement = null;
  224. },
  225. execute: function _ScriptLoaderTask$execute() {
  226. /// <summary locid="M:J#Sys._ScriptLoaderTask.execute">Begins loading the given script element.</summary>
  227. if (arguments.length !== 0) throw Error.parameterCount();
  228. this._addScriptElementHandlers();
  229. var headElements = document.getElementsByTagName('head');
  230. if (headElements.length === 0) {
  231. throw new Error.invalidOperation(Sys.Res.scriptLoadFailedNoHead);
  232. }
  233. else {
  234. headElements[0].appendChild(this._scriptElement);
  235. }
  236. },
  237. _addScriptElementHandlers: function _ScriptLoaderTask$_addScriptElementHandlers() {
  238. this._scriptLoadDelegate = Function.createDelegate(this, this._scriptLoadHandler);
  239. if (document.addEventListener) {
  240. this._scriptElement.readyState = 'loaded';
  241. $addHandler(this._scriptElement, 'load', this._scriptLoadDelegate);
  242. }
  243. else {
  244. $addHandler(this._scriptElement, 'readystatechange', this._scriptLoadDelegate);
  245. }
  246. if (this._scriptElement.addEventListener) {
  247. this._scriptErrorDelegate = Function.createDelegate(this, this._scriptErrorHandler);
  248. this._scriptElement.addEventListener('error', this._scriptErrorDelegate, false);
  249. }
  250. },
  251. _removeScriptElementHandlers: function _ScriptLoaderTask$_removeScriptElementHandlers() {
  252. if(this._scriptLoadDelegate) {
  253. var scriptElement = this.get_scriptElement();
  254. if (document.addEventListener) {
  255. $removeHandler(scriptElement, 'load', this._scriptLoadDelegate);
  256. }
  257. else {
  258. $removeHandler(scriptElement, 'readystatechange', this._scriptLoadDelegate);
  259. }
  260. if (this._scriptErrorDelegate) {
  261. this._scriptElement.removeEventListener('error', this._scriptErrorDelegate, false);
  262. this._scriptErrorDelegate = null;
  263. }
  264. this._scriptLoadDelegate = null;
  265. }
  266. },
  267. _scriptErrorHandler: function _ScriptLoaderTask$_scriptErrorHandler() {
  268. if(this._disposed) {
  269. return;
  270. }
  271. this._completedCallback(this.get_scriptElement(), false);
  272. },
  273. _scriptLoadHandler: function _ScriptLoaderTask$_scriptLoadHandler() {
  274. if(this._disposed) {
  275. return;
  276. }
  277. var scriptElement = this.get_scriptElement();
  278. if ((scriptElement.readyState !== 'loaded') &&
  279. (scriptElement.readyState !== 'complete')) {
  280. return;
  281. }
  282. this._completedCallback(scriptElement, true);
  283. }
  284. }
  285. $type.registerClass("Sys._ScriptLoaderTask", null, Sys.IDisposable);
  286. $type._clearScript = function _ScriptLoaderTask$_clearScript(scriptElement) {
  287. if (!Sys.Debug.isDebug) {
  288. scriptElement.parentNode.removeChild(scriptElement);
  289. }
  290. }
  291. $type = Sys._ScriptLoader = function _ScriptLoader() {
  292. this._scriptsToLoad = null;
  293. this._sessions = [];
  294. this._scriptLoadedDelegate = Function.createDelegate(this, this._scriptLoadedHandler);
  295. }
  296. $type.prototype = {
  297. dispose: function _ScriptLoader$dispose() {
  298. this._stopSession();
  299. this._loading = false;
  300. if(this._events) {
  301. delete this._events;
  302. }
  303. this._sessions = null;
  304. this._currentSession = null;
  305. this._scriptLoadedDelegate = null;
  306. },
  307. loadScripts: function _ScriptLoader$loadScripts(scriptTimeout, allScriptsLoadedCallback, scriptLoadFailedCallback, scriptLoadTimeoutCallback) {
  308. /// <summary locid="M:J#Sys._ScriptLoader.loadScripts">Begins loading scripts that have been queued.</summary>
  309. /// <param name="scriptTimeout" type="Number" integer="true">Timeout in seconds for loading all scripts.</param>
  310. /// <param name="allScriptsLoadedCallback" type="Function" mayBeNull="true">Callback for notification when all scripts have successfully loaded.</param>
  311. /// <param name="scriptLoadFailedCallback" type="Function" mayBeNull="true">Callback for notification when a script fails to load.</param>
  312. /// <param name="scriptLoadTimeoutCallback" type="Function" mayBeNull="true">Callback for notification when scripts have not finished loading within the given timeout.</param>
  313. var e = Function._validateParams(arguments, [
  314. {name: "scriptTimeout", type: Number, integer: true},
  315. {name: "allScriptsLoadedCallback", type: Function, mayBeNull: true},
  316. {name: "scriptLoadFailedCallback", type: Function, mayBeNull: true},
  317. {name: "scriptLoadTimeoutCallback", type: Function, mayBeNull: true}
  318. ]);
  319. if (e) throw e;
  320. var session = {
  321. allScriptsLoadedCallback: allScriptsLoadedCallback,
  322. scriptLoadFailedCallback: scriptLoadFailedCallback,
  323. scriptLoadTimeoutCallback: scriptLoadTimeoutCallback,
  324. scriptsToLoad: this._scriptsToLoad,
  325. scriptTimeout: scriptTimeout };
  326. this._scriptsToLoad = null;
  327. this._sessions.push(session);
  328. if (!this._loading) {
  329. this._nextSession();
  330. }
  331. },
  332. queueCustomScriptTag: function _ScriptLoader$queueCustomScriptTag(scriptAttributes) {
  333. /// <summary locid="M:J#Sys._ScriptLoader.queueCustomScriptTag">Queues a script reference with the given set of custom script element attributes.</summary>
  334. /// <param name="scriptAttributes" mayBeNull="false">A JSON object that describtes the attributes to apply to the script element.</param>
  335. var e = Function._validateParams(arguments, [
  336. {name: "scriptAttributes"}
  337. ]);
  338. if (e) throw e;
  339. if(!this._scriptsToLoad) {
  340. this._scriptsToLoad = [];
  341. }
  342. Array.add(this._scriptsToLoad, scriptAttributes);
  343. },
  344. queueScriptBlock: function _ScriptLoader$queueScriptBlock(scriptContent) {
  345. /// <summary locid="M:J#Sys._ScriptLoader.queueScriptBlock">Queues a script reference with literal script.</summary>
  346. /// <param name="scriptContent" type="String" mayBeNull="false">Literal script to execute.</param>
  347. var e = Function._validateParams(arguments, [
  348. {name: "scriptContent", type: String}
  349. ]);
  350. if (e) throw e;
  351. if(!this._scriptsToLoad) {
  352. this._scriptsToLoad = [];
  353. }
  354. Array.add(this._scriptsToLoad, {text: scriptContent});
  355. },
  356. queueScriptReference: function _ScriptLoader$queueScriptReference(scriptUrl) {
  357. /// <summary locid="M:J#Sys._ScriptLoader.queueScriptReference">Queues a script reference to the given script URL.</summary>
  358. /// <param name="scriptUrl" type="String" mayBeNull="false">URL to the script to reference.</param>
  359. var e = Function._validateParams(arguments, [
  360. {name: "scriptUrl", type: String}
  361. ]);
  362. if (e) throw e;
  363. if(!this._scriptsToLoad) {
  364. this._scriptsToLoad = [];
  365. }
  366. Array.add(this._scriptsToLoad, {src: scriptUrl});
  367. },
  368. _createScriptElement: function _ScriptLoader$_createScriptElement(queuedScript) {
  369. var scriptElement = document.createElement('script');
  370. scriptElement.type = 'text/javascript';
  371. for (var attr in queuedScript) {
  372. scriptElement[attr] = queuedScript[attr];
  373. }
  374. return scriptElement;
  375. },
  376. _loadScriptsInternal: function _ScriptLoader$_loadScriptsInternal() {
  377. var session = this._currentSession;
  378. if (session.scriptsToLoad && session.scriptsToLoad.length > 0) {
  379. var nextScript = Array.dequeue(session.scriptsToLoad);
  380. var scriptElement = this._createScriptElement(nextScript);
  381. if (scriptElement.text && Sys.Browser.agent === Sys.Browser.Safari) {
  382. scriptElement.innerHTML = scriptElement.text;
  383. delete scriptElement.text;
  384. }
  385. if (typeof(nextScript.src) === "string") {
  386. this._currentTask = new Sys._ScriptLoaderTask(scriptElement, this._scriptLoadedDelegate);
  387. this._currentTask.execute();
  388. }
  389. else {
  390. var headElements = document.getElementsByTagName('head');
  391. if (headElements.length === 0) {
  392. throw new Error.invalidOperation(Sys.Res.scriptLoadFailedNoHead);
  393. }
  394. else {
  395. headElements[0].appendChild(scriptElement);
  396. }
  397. Sys._ScriptLoaderTask._clearScript(scriptElement);
  398. this._loadScriptsInternal();
  399. }
  400. }
  401. else {
  402. this._stopSession();
  403. var callback = session.allScriptsLoadedCallback;
  404. if(callback) {
  405. callback(this);
  406. }
  407. this._nextSession();
  408. }
  409. },
  410. _nextSession: function _ScriptLoader$_nextSession() {
  411. if (this._sessions.length === 0) {
  412. this._loading = false;
  413. this._currentSession = null;
  414. return;
  415. }
  416. this._loading = true;
  417. var session = Array.dequeue(this._sessions);
  418. this._currentSession = session;
  419. this._loadScriptsInternal();
  420. },
  421. _raiseError: function _ScriptLoader$_raiseError() {
  422. var callback = this._currentSession.scriptLoadFailedCallback;
  423. var scriptElement = this._currentTask.get_scriptElement();
  424. this._stopSession();
  425. if(callback) {
  426. callback(this, scriptElement);
  427. this._nextSession();
  428. }
  429. else {
  430. this._loading = false;
  431. throw Sys._ScriptLoader._errorScriptLoadFailed(scriptElement.src);
  432. }
  433. },
  434. _scriptLoadedHandler: function _ScriptLoader$_scriptLoadedHandler(scriptElement, loaded) {
  435. if (loaded) {
  436. Array.add(Sys._ScriptLoader._getLoadedScripts(), scriptElement.src);
  437. this._currentTask.dispose();
  438. this._currentTask = null;
  439. this._loadScriptsInternal();
  440. }
  441. else {
  442. this._raiseError();
  443. }
  444. },
  445. _stopSession: function _ScriptLoader$_stopSession() {
  446. if(this._currentTask) {
  447. this._currentTask.dispose();
  448. this._currentTask = null;
  449. }
  450. }
  451. }
  452. $type.registerClass('Sys._ScriptLoader', null, Sys.IDisposable);
  453. $type.getInstance = function _ScriptLoader$getInstance() {
  454. var sl = Sys._ScriptLoader._activeInstance;
  455. if(!sl) {
  456. sl = Sys._ScriptLoader._activeInstance = new Sys._ScriptLoader();
  457. }
  458. return sl;
  459. }
  460. $type.isScriptLoaded = function _ScriptLoader$isScriptLoaded(scriptSrc) {
  461. var dummyScript = document.createElement('script');
  462. dummyScript.src = scriptSrc;
  463. return Array.contains(Sys._ScriptLoader._getLoadedScripts(), dummyScript.src);
  464. }
  465. $type.readLoadedScripts = function _ScriptLoader$readLoadedScripts() {
  466. if(!Sys._ScriptLoader._referencedScripts) {
  467. var referencedScripts = Sys._ScriptLoader._referencedScripts = [];
  468. var existingScripts = document.getElementsByTagName('script');
  469. for (var i = existingScripts.length - 1; i >= 0; i--) {
  470. var scriptNode = existingScripts[i];
  471. var scriptSrc = scriptNode.src;
  472. if (scriptSrc.length) {
  473. if (!Array.contains(referencedScripts, scriptSrc)) {
  474. Array.add(referencedScripts, scriptSrc);
  475. }
  476. }
  477. }
  478. }
  479. }
  480. $type._errorScriptLoadFailed = function _ScriptLoader$_errorScriptLoadFailed(scriptUrl) {
  481. var errorMessage;
  482. errorMessage = Sys.Res.scriptLoadFailedDebug;
  483. var displayMessage = "Sys.ScriptLoadFailedException: " + String.format(errorMessage, scriptUrl);
  484. var e = Error.create(displayMessage, {name: 'Sys.ScriptLoadFailedException', 'scriptUrl': scriptUrl });
  485. e.popStackFrame();
  486. return e;
  487. }
  488. $type._getLoadedScripts = function _ScriptLoader$_getLoadedScripts() {
  489. if(!Sys._ScriptLoader._referencedScripts) {
  490. Sys._ScriptLoader._referencedScripts = [];
  491. Sys._ScriptLoader.readLoadedScripts();
  492. }
  493. return Sys._ScriptLoader._referencedScripts;
  494. }
  495. $type = Sys.WebForms.PageRequestManager = function PageRequestManager() {
  496. this._form = null;
  497. this._activeDefaultButton = null;
  498. this._activeDefaultButtonClicked = false;
  499. this._updatePanelIDs = null;
  500. this._updatePanelClientIDs = null;
  501. this._updatePanelHasChildrenAsTriggers = null;
  502. this._asyncPostBackControlIDs = null;
  503. this._asyncPostBackControlClientIDs = null;
  504. this._postBackControlIDs = null;
  505. this._postBackControlClientIDs = null;
  506. this._scriptManagerID = null;
  507. this._pageLoadedHandler = null;
  508. this._additionalInput = null;
  509. this._onsubmit = null;
  510. this._onSubmitStatements = [];
  511. this._originalDoPostBack = null;
  512. this._originalDoPostBackWithOptions = null;
  513. this._originalFireDefaultButton = null;
  514. this._originalDoCallback = null;
  515. this._isCrossPost = false;
  516. this._postBackSettings = null;
  517. this._request = null;
  518. this._onFormSubmitHandler = null;
  519. this._onFormElementClickHandler = null;
  520. this._onWindowUnloadHandler = null;
  521. this._asyncPostBackTimeout = null;
  522. this._controlIDToFocus = null;
  523. this._scrollPosition = null;
  524. this._processingRequest = false;
  525. this._scriptDisposes = {};
  526. this._transientFields = ["__VIEWSTATEENCRYPTED", "__VIEWSTATEFIELDCOUNT"];
  527. }
  528. $type.prototype = {
  529. get_isInAsyncPostBack: function PageRequestManager$get_isInAsyncPostBack() {
  530. /// <value type="Boolean" locid="P:J#Sys.WebForms.PageRequestManager.isInAsyncPostBack"></value>
  531. if (arguments.length !== 0) throw Error.parameterCount();
  532. return this._request !== null;
  533. },
  534. add_beginRequest: function PageRequestManager$add_beginRequest(handler) {
  535. /// <summary locid="E:J#Sys.WebForms.PageRequestManager.beginRequest">Adds a beginRequest event handler.</summary>
  536. var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
  537. if (e) throw e;
  538. Sys.Observer.addEventHandler(this, "beginRequest", handler);
  539. },
  540. remove_beginRequest: function PageRequestManager$remove_beginRequest(handler) {
  541. var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
  542. if (e) throw e;
  543. Sys.Observer.removeEventHandler(this, "beginRequest", handler);
  544. },
  545. add_endRequest: function PageRequestManager$add_endRequest(handler) {
  546. /// <summary locid="E:J#Sys.WebForms.PageRequestManager.endRequest">Adds a endRequest event handler.</summary>
  547. var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
  548. if (e) throw e;
  549. Sys.Observer.addEventHandler(this, "endRequest", handler);
  550. },
  551. remove_endRequest: function PageRequestManager$remove_endRequest(handler) {
  552. var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
  553. if (e) throw e;
  554. Sys.Observer.removeEventHandler(this, "endRequest", handler);
  555. },
  556. add_initializeRequest: function PageRequestManager$add_initializeRequest(handler) {
  557. /// <summary locid="E:J#Sys.WebForms.PageRequestManager.initializeRequest">Adds a initializeRequest event handler.</summary>
  558. var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
  559. if (e) throw e;
  560. Sys.Observer.addEventHandler(this, "initializeRequest", handler);
  561. },
  562. remove_initializeRequest: function PageRequestManager$remove_initializeRequest(handler) {
  563. var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
  564. if (e) throw e;
  565. Sys.Observer.removeEventHandler(this, "initializeRequest", handler);
  566. },
  567. add_pageLoaded: function PageRequestManager$add_pageLoaded(handler) {
  568. /// <summary locid="E:J#Sys.WebForms.PageRequestManager.pageLoaded">Adds a pageLoaded event handler.</summary>
  569. var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
  570. if (e) throw e;
  571. Sys.Observer.addEventHandler(this, "pageLoaded", handler);
  572. },
  573. remove_pageLoaded: function PageRequestManager$remove_pageLoaded(handler) {
  574. var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
  575. if (e) throw e;
  576. Sys.Observer.removeEventHandler(this, "pageLoaded", handler);
  577. },
  578. add_pageLoading: function PageRequestManager$add_pageLoading(handler) {
  579. /// <summary locid="E:J#Sys.WebForms.PageRequestManager.pageLoading">Adds a pageLoading event handler.</summary>
  580. var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
  581. if (e) throw e;
  582. Sys.Observer.addEventHandler(this, "pageLoading", handler);
  583. },
  584. remove_pageLoading: function PageRequestManager$remove_pageLoading(handler) {
  585. var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
  586. if (e) throw e;
  587. Sys.Observer.removeEventHandler(this, "pageLoading", handler);
  588. },
  589. abortPostBack: function PageRequestManager$abortPostBack() {
  590. if (!this._processingRequest && this._request) {
  591. this._request.get_executor().abort();
  592. this._request = null;
  593. }
  594. },
  595. beginAsyncPostBack: function PageRequestManager$beginAsyncPostBack(updatePanelsToUpdate, eventTarget, eventArgument, causesValidation, validationGroup) {
  596. /// <summary locid="M:J#Sys.WebForms.PageRequestManager.beginAsyncPostBack">Begins an asynchronous postback.</summary>
  597. /// <param name="updatePanelsToUpdate" type="Array" elementType="String" mayBeNull="true" optional="true">A list of UniqueIDs or ClientIDs of UpdatePanel controls that should have their rendering updated.</param>
  598. /// <param name="eventTarget" type="String" mayBeNull="true" optional="true"></param>
  599. /// <param name="eventArgument" type="String" mayBeNull="true" optional="true"></param>
  600. /// <param name="causesValidation" type="Boolean" mayBeNull="true" optional="true"></param>
  601. /// <param name="validationGroup" type="String" mayBeNull="true" optional="true"></param>
  602. var e = Function._validateParams(arguments, [
  603. {name: "updatePanelsToUpdate", type: Array, mayBeNull: true, optional: true, elementType: String},
  604. {name: "eventTarget", type: String, mayBeNull: true, optional: true},
  605. {name: "eventArgument", type: String, mayBeNull: true, optional: true},
  606. {name: "causesValidation", type: Boolean, mayBeNull: true, optional: true},
  607. {name: "validationGroup", type: String, mayBeNull: true, optional: true}
  608. ]);
  609. if (e) throw e;
  610. if (causesValidation && (typeof(Page_ClientValidate) === 'function') && !Page_ClientValidate(validationGroup || null)) {
  611. return;
  612. }
  613. this._postBackSettings = this._createPostBackSettings(true, updatePanelsToUpdate, eventTarget);
  614. var form = this._form;
  615. form.__EVENTTARGET.value = (eventTarget || "");
  616. form.__EVENTARGUMENT.value = (eventArgument || "");
  617. this._isCrossPost = false;
  618. this._additionalInput = null;
  619. this._onFormSubmit();
  620. },
  621. _cancelPendingCallbacks: function PageRequestManager$_cancelPendingCallbacks() {
  622. for (var i = 0, l = window.__pendingCallbacks.length; i < l; i++) {
  623. var callback = window.__pendingCallbacks[i];
  624. if (callback) {
  625. if (!callback.async) {
  626. window.__synchronousCallBackIndex = -1;
  627. }
  628. window.__pendingCallbacks[i] = null;
  629. var callbackFrameID = "__CALLBACKFRAME" + i;
  630. var xmlRequestFrame = document.getElementById(callbackFrameID);
  631. if (xmlRequestFrame) {
  632. xmlRequestFrame.parentNode.removeChild(xmlRequestFrame);
  633. }
  634. }
  635. }
  636. },
  637. _commitControls: function PageRequestManager$_commitControls(updatePanelData, asyncPostBackTimeout) {
  638. if (updatePanelData) {
  639. this._updatePanelIDs = updatePanelData.updatePanelIDs;
  640. this._updatePanelClientIDs = updatePanelData.updatePanelClientIDs;
  641. this._updatePanelHasChildrenAsTriggers = updatePanelData.updatePanelHasChildrenAsTriggers;
  642. this._asyncPostBackControlIDs = updatePanelData.asyncPostBackControlIDs;
  643. this._asyncPostBackControlClientIDs = updatePanelData.asyncPostBackControlClientIDs;
  644. this._postBackControlIDs = updatePanelData.postBackControlIDs;
  645. this._postBackControlClientIDs = updatePanelData.postBackControlClientIDs;
  646. }
  647. if (typeof(asyncPostBackTimeout) !== 'undefined' && asyncPostBackTimeout !== null) {
  648. this._asyncPostBackTimeout = asyncPostBackTimeout * 1000;
  649. }
  650. },
  651. _createHiddenField: function PageRequestManager$_createHiddenField(id, value) {
  652. var container, field = document.getElementById(id);
  653. if (field) {
  654. if (!field._isContained) {
  655. field.parentNode.removeChild(field);
  656. }
  657. else {
  658. container = field.parentNode;
  659. }
  660. }
  661. if (!container) {
  662. container = document.createElement('span');
  663. container.style.cssText = "display:none !important";
  664. this._form.appendChild(container);
  665. }
  666. container.innerHTML = "<input type='hidden' />";
  667. field = container.childNodes[0];
  668. field._isContained = true;
  669. field.id = field.name = id;
  670. field.value = value;
  671. },
  672. _createPageRequestManagerTimeoutError: function PageRequestManager$_createPageRequestManagerTimeoutError() {
  673. var displayMessage = "Sys.WebForms.PageRequestManagerTimeoutException: " + Sys.WebForms.Res.PRM_TimeoutError;
  674. var e = Error.create(displayMessage, {name: 'Sys.WebForms.PageRequestManagerTimeoutException'});
  675. e.popStackFrame();
  676. return e;
  677. },
  678. _createPageRequestManagerServerError: function PageRequestManager$_createPageRequestManagerServerError(httpStatusCode, message) {
  679. var displayMessage = "Sys.WebForms.PageRequestManagerServerErrorException: " +
  680. (message || String.format(Sys.WebForms.Res.PRM_ServerError, httpStatusCode));
  681. var e = Error.create(displayMessage, {
  682. name: 'Sys.WebForms.PageRequestManagerServerErrorException',
  683. httpStatusCode: httpStatusCode
  684. });
  685. e.popStackFrame();
  686. return e;
  687. },
  688. _createPageRequestManagerParserError: function PageRequestManager$_createPageRequestManagerParserError(parserErrorMessage) {
  689. var displayMessage = "Sys.WebForms.PageRequestManagerParserErrorException: " + String.format(Sys.WebForms.Res.PRM_ParserError, parserErrorMessage);
  690. var e = Error.create(displayMessage, {name: 'Sys.WebForms.PageRequestManagerParserErrorException'});
  691. e.popStackFrame();
  692. return e;
  693. },
  694. _createPanelID: function PageRequestManager$_createPanelID(panelsToUpdate, postBackSettings) {
  695. var asyncTarget = postBackSettings.asyncTarget,
  696. toUpdate = this._ensureUniqueIds(panelsToUpdate || postBackSettings.panelsToUpdate),
  697. panelArg = (toUpdate instanceof Array)
  698. ? toUpdate.join(',')
  699. : (toUpdate || this._scriptManagerID);
  700. if (asyncTarget) {
  701. panelArg += "|" + asyncTarget;
  702. }
  703. return encodeURIComponent(this._scriptManagerID) + '=' + encodeURIComponent(panelArg) + '&';
  704. },
  705. _createPostBackSettings: function PageRequestManager$_createPostBackSettings(async, panelsToUpdate, asyncTarget, sourceElement) {
  706. return { async:async, asyncTarget: asyncTarget, panelsToUpdate: panelsToUpdate, sourceElement: sourceElement };
  707. },
  708. _convertToClientIDs: function PageRequestManager$_convertToClientIDs(source, destinationIDs, destinationClientIDs, version4) {
  709. if (source) {
  710. for (var i = 0, l = source.length; i < l; i += (version4 ? 2 : 1)) {
  711. var uniqueID = source[i],
  712. clientID = (version4 ? source[i+1] : "") || this._uniqueIDToClientID(uniqueID);
  713. Array.add(destinationIDs, uniqueID);
  714. Array.add(destinationClientIDs, clientID);
  715. }
  716. }
  717. },
  718. dispose: function PageRequestManager$dispose() {
  719. Sys.Observer.clearEventHandlers(this);
  720. if (this._form) {
  721. Sys.UI.DomEvent.removeHandler(this._form, 'submit', this._onFormSubmitHandler);
  722. Sys.UI.DomEvent.removeHandler(this._form, 'click', this._onFormElementClickHandler);
  723. Sys.UI.DomEvent.removeHandler(window, 'unload', this._onWindowUnloadHandler);
  724. Sys.UI.DomEvent.removeHandler(window, 'load', this._pageLoadedHandler);
  725. }
  726. if (this._originalDoPostBack) {
  727. window.__doPostBack = this._originalDoPostBack;
  728. this._originalDoPostBack = null;
  729. }
  730. if (this._originalDoPostBackWithOptions) {
  731. window.WebForm_DoPostBackWithOptions = this._originalDoPostBackWithOptions;
  732. this._originalDoPostBackWithOptions = null;
  733. }
  734. if (this._originalFireDefaultButton) {
  735. window.WebForm_FireDefaultButton = this._originalFireDefaultButton;
  736. this._originalFireDefaultButton = null;
  737. }
  738. if (this._originalDoCallback) {
  739. window.WebForm_DoCallback = this._originalDoCallback;
  740. this._originalDoCallback = null;
  741. }
  742. this._form = null;
  743. this._updatePanelIDs = null;
  744. this._updatePanelClientIDs = null;
  745. this._asyncPostBackControlIDs = null;
  746. this._asyncPostBackControlClientIDs = null;
  747. this._postBackControlIDs = null;
  748. this._postBackControlClientIDs = null;
  749. this._asyncPostBackTimeout = null;
  750. this._scrollPosition = null;
  751. },
  752. _doCallback: function PageRequestManager$_doCallback(eventTarget, eventArgument, eventCallback, context, errorCallback, useAsync) {
  753. if (!this.get_isInAsyncPostBack()) {
  754. this._originalDoCallback(eventTarget, eventArgument, eventCallback, context, errorCallback, useAsync);
  755. }
  756. },
  757. _doPostBack: function PageRequestManager$_doPostBack(eventTarget, eventArgument) {
  758. this._additionalInput = null;
  759. var form = this._form;
  760. if ((eventTarget === null) || (typeof(eventTarget) === "undefined") || (this._isCrossPost)) {
  761. this._postBackSettings = this._createPostBackSettings(false);
  762. this._isCrossPost = false;
  763. }
  764. else {
  765. var mpUniqueID = this._masterPageUniqueID;
  766. var clientID = this._uniqueIDToClientID(eventTarget);
  767. var postBackElement = document.getElementById(clientID);
  768. if (!postBackElement && mpUniqueID) {
  769. if (clientID.indexOf(mpUniqueID + "$") === 0) {
  770. postBackElement = document.getElementById(clientID.substr(mpUniqueID.length + 1));
  771. }
  772. }
  773. if (!postBackElement) {
  774. if (Array.contains(this._asyncPostBackControlIDs, eventTarget)) {
  775. this._postBackSettings = this._createPostBackSettings(true, null, eventTarget);
  776. }
  777. else {
  778. if (Array.contains(this._postBackControlIDs, eventTarget)) {
  779. this._postBackSettings = this._createPostBackSettings(false);
  780. }
  781. else {
  782. var nearestUniqueIDMatch = this._findNearestElement(eventTarget);
  783. if (nearestUniqueIDMatch) {
  784. this._postBackSettings = this._getPostBackSettings(nearestUniqueIDMatch, eventTarget);
  785. }
  786. else {
  787. if (mpUniqueID) {
  788. mpUniqueID += "$";
  789. if (eventTarget.indexOf(mpUniqueID) === 0) {
  790. nearestUniqueIDMatch = this._findNearestElement(eventTarget.substr(mpUniqueID.length));
  791. }
  792. }
  793. if (nearestUniqueIDMatch) {
  794. this._postBackSettings = this._getPostBackSettings(nearestUniqueIDMatch, eventTarget);
  795. }
  796. else {
  797. this._postBackSettings = this._createPostBackSettings(false);
  798. }
  799. }
  800. }
  801. }
  802. }
  803. else {
  804. this._postBackSettings = this._getPostBackSettings(postBackElement, eventTarget);
  805. }
  806. }
  807. if (!this._postBackSettings.async) {
  808. form.onsubmit = this._onsubmit;
  809. this._originalDoPostBack(eventTarget, eventArgument);
  810. form.onsubmit = null;
  811. return;
  812. }
  813. form.__EVENTTARGET.value = eventTarget;
  814. form.__EVENTARGUMENT.value = eventArgument;
  815. this._onFormSubmit();
  816. },
  817. _doPostBackWithOptions: function PageRequestManager$_doPostBackWithOptions(options) {
  818. this._isCrossPost = options && options.actionUrl;
  819. this._originalDoPostBackWithOptions(options);
  820. },
  821. _elementContains: function PageRequestManager$_elementContains(container, element) {
  822. while (element) {
  823. if (element === container) {
  824. return true;
  825. }
  826. element = element.parentNode;
  827. }
  828. return false;
  829. },
  830. _endPostBack: function PageRequestManager$_endPostBack(error, executor, data) {
  831. if (this._request === executor.get_webRequest()) {
  832. this._processingRequest = false;
  833. this._additionalInput = null;
  834. this._request = null;
  835. }
  836. var eventArgs = new Sys.WebForms.EndRequestEventArgs(error, data ? data.dataItems : {}, executor);
  837. Sys.Observer.raiseEvent(this, "endRequest", eventArgs);
  838. if (error && !eventArgs.get_errorHandled()) {
  839. throw error;
  840. }
  841. },
  842. _ensureUniqueIds: function PageRequestManager$_ensureUniqueIds(ids) {
  843. if (!ids) return ids;
  844. ids = ids instanceof Array ? ids : [ids];
  845. var uniqueIds = [];
  846. for (var i = 0, l = ids.length; i < l; i++) {
  847. var id = ids[i], index = Array.indexOf(this._updatePanelClientIDs, id);
  848. uniqueIds.push(index > -1 ? this._updatePanelIDs[index] : id);
  849. }
  850. return uniqueIds;
  851. },
  852. _findNearestElement: function PageRequestManager$_findNearestElement(uniqueID) {
  853. while (uniqueID.length > 0) {
  854. var clientID = this._uniqueIDToClientID(uniqueID);
  855. var element = document.getElementById(clientID);
  856. if (element) {
  857. return element;
  858. }
  859. var indexOfLastDollar = uniqueID.lastIndexOf('$');
  860. if (indexOfLastDollar === -1) {
  861. return null;
  862. }
  863. uniqueID = uniqueID.substring(0, indexOfLastDollar);
  864. }
  865. return null;
  866. },
  867. _findText: function PageRequestManager$_findText(text, location) {
  868. var startIndex = Math.max(0, location - 20);
  869. var endIndex = Math.min(text.length, location + 20);
  870. return text.substring(startIndex, endIndex);
  871. },
  872. _fireDefaultButton: function PageRequestManager$_fireDefaultButton(event, target) {
  873. if (event.keyCode === 13) {
  874. var src = event.srcElement || event.target;
  875. if (!src || (src.tagName.toLowerCase() !== "textarea")) {
  876. var defaultButton = document.getElementById(target);
  877. if (defaultButton && (typeof(defaultButton.click) !== "undefined")) {
  878. this._activeDefaultButton = defaultButton;
  879. this._activeDefaultButtonClicked = false;
  880. try {
  881. defaultButton.click();
  882. }
  883. finally {
  884. this._activeDefaultButton = null;
  885. }
  886. event.cancelBubble = true;
  887. if (typeof(event.stopPropagation) === "function") {
  888. event.stopPropagation();
  889. }
  890. return false;
  891. }
  892. }
  893. }
  894. return true;
  895. },
  896. _getPageLoadedEventArgs: function PageRequestManager$_getPageLoadedEventArgs(initialLoad, data) {
  897. var updated = [];
  898. var created = [];
  899. var version4 = data ? data.version4 : false;
  900. var upData = data ? data.updatePanelData : null;
  901. var newIDs, newClientIDs, childIDs, refreshedIDs;
  902. if (!upData) {
  903. newIDs = this._updatePanelIDs;
  904. newClientIDs = this._updatePanelClientIDs;
  905. childIDs = null;
  906. refreshedIDs = null;
  907. }
  908. else {
  909. newIDs = upData.updatePanelIDs;
  910. newClientIDs = upData.updatePanelClientIDs;
  911. childIDs = upData.childUpdatePanelIDs;
  912. refreshedIDs = upData.panelsToRefreshIDs;
  913. }
  914. var i, l, uniqueID, clientID;
  915. if (refreshedIDs) {
  916. for (i = 0, l = refreshedIDs.length; i < l; i += (version4 ? 2 : 1)) {
  917. uniqueID = refreshedIDs[i];
  918. clientID = (version4 ? refreshedIDs[i+1] : "") || this._uniqueIDToClientID(uniqueID);
  919. Array.add(updated, document.getElementById(clientID));
  920. }
  921. }
  922. for (i = 0, l = newIDs.length; i < l; i++) {
  923. if (initialLoad || Array.indexOf(childIDs, newIDs[i]) !== -1) {
  924. Array.add(created, document.getElementById(newClientIDs[i]));
  925. }
  926. }
  927. return new Sys.WebForms.PageLoadedEventArgs(updated, created, data ? data.dataItems : {});
  928. },
  929. _getPageLoadingEventArgs: function PageRequestManager$_getPageLoadingEventArgs(data) {
  930. var updated = [],
  931. deleted = [],
  932. upData = data.updatePanelData,
  933. oldIDs = upData.oldUpdatePanelIDs,
  934. oldClientIDs = upData.oldUpdatePanelClientIDs,
  935. newIDs = upData.updatePanelIDs,
  936. childIDs = upData.childUpdatePanelIDs,
  937. refreshedIDs = upData.panelsToRefreshIDs,
  938. i, l, uniqueID, clientID,
  939. version4 = data.version4;
  940. for (i = 0, l = refreshedIDs.length; i < l; i += (version4 ? 2 : 1)) {
  941. uniqueID = refreshedIDs[i];
  942. clientID = (version4 ? refreshedIDs[i+1] : "") || this._uniqueIDToClientID(uniqueID);
  943. Array.add(updated, document.getElementById(clientID));
  944. }
  945. for (i = 0, l = oldIDs.length; i < l; i++) {
  946. uniqueID = oldIDs[i];
  947. if (Array.indexOf(refreshedIDs, uniqueID) === -1 &&
  948. (Array.indexOf(newIDs, uniqueID) === -1 || Array.indexOf(childIDs, uniqueID) > -1)) {
  949. Array.add(deleted, document.getElementById(oldClientIDs[i]));
  950. }
  951. }
  952. return new Sys.WebForms.PageLoadingEventArgs(updated, deleted, data.dataItems);
  953. },
  954. _getPostBackSettings: function PageRequestManager$_getPostBackSettings(element, elementUniqueI

Large files files are truncated, but you can click here to view the full file