Author: igorz
Date: 2007-09-02 10:06:24 -0400 (Sun, 02 Sep 2007)
New Revision: 85193

Added:
   trunk/mcs/class/System.Web.Extensions/Resources/
   trunk/mcs/class/System.Web.Extensions/Resources/MicrosoftAjaxExtension.js
   
trunk/mcs/class/System.Web.Extensions/Resources/MicrosoftAjaxWebFormsExtension.js
Log:
added new script files
used to extend ajax client framework for multi form environment

Added: trunk/mcs/class/System.Web.Extensions/Resources/MicrosoftAjaxExtension.js
===================================================================
--- trunk/mcs/class/System.Web.Extensions/Resources/MicrosoftAjaxExtension.js   
2007-09-02 13:29:51 UTC (rev 85192)
+++ trunk/mcs/class/System.Web.Extensions/Resources/MicrosoftAjaxExtension.js   
2007-09-02 14:06:24 UTC (rev 85193)
@@ -0,0 +1,89 @@
+if(window.IsMultiForm)
+{
+       Sys._Application.prototype.getForm = function 
Sys$_Application$getForm() {
+               return this._form;
+       }
+
+       Sys.Application._globalInstance = Sys.Application;
+       Sys.Application._globalInstance._form = new Object();
+       Sys.Application._globalInstance._form._application = 
Sys.Application._globalInstance;
+       
+       Sys.Application = new Object ();
+
+       Sys.Application.getInstance = function 
Sys$Application$getInstance(formElement) {
+               /// <param name="formElement" domElement="true"></param>
+               /// <returns type="Sys.Application"></returns>
+               var e = Function._validateParams(arguments, [
+                       {name: "formElement", domElement: true}
+               ]);
+               return formElement._application;
+       }
+
+       Sys.Application._initialize = function 
Sys$Application$_initialize(formElement) {
+               if (formElement._application) {
+                       throw Error.invalidOperation('The Application cannot be 
initialized more than once.');
+               }
+               formElement._application = new Sys._Application();
+               formElement._application._form = formElement;
+       }
+
+       Sys.Application.notifyScriptLoaded = 
Sys.Application._globalInstance.notifyScriptLoaded;
+       
+       Sys.Component.prototype.registerWithApplication = function 
Sys$Component$registerWithApplication(application) {
+               /// <param name="application" type="Sys._Application"></param>
+               var e = Function._validateParams(arguments, [
+                       {name: "application", type: Sys._Application}
+               ]);
+               if (e) throw e;
+               if(this._application)
+                       return;
+               this._application = application;
+               application.registerDisposableObject(this)
+       }
+       
+       Sys.Component.prototype.registerAsSingleton = function 
Sys$Component$registerAsSingleton() {
+               if (arguments.length !== 0) throw Error.parameterCount();
+               this.registerWithApplication(Sys.Application._globalInstance);
+       }
+
+       Sys.Component.prototype.getApplication = function 
Sys$Component$getApplication() {
+               return this._application;
+       }
+       
+       var $create = Sys.Component.create = function 
Sys$Component$createWithForm(formElement, type, properties, events, references, 
element) {
+               /// <param name="formElement" domElement="true"></param>
+               /// <param name="type" type="Type"></param>
+               /// <param name="properties" optional="true" 
mayBeNull="true"></param>
+               /// <param name="events" optional="true" 
mayBeNull="true"></param>
+               /// <param name="references" optional="true" 
mayBeNull="true"></param>
+               /// <param name="element" domElement="true" optional="true" 
mayBeNull="true"></param>
+               /// <returns type="Sys.UI.Component"></returns>
+               var e = Function._validateParams(arguments, [
+                       {name: "formElement", domElement: true},
+                       {name: "type", type: Type},
+                       {name: "properties", mayBeNull: true, optional: true},
+                       {name: "events", mayBeNull: true, optional: true},
+                       {name: "references", mayBeNull: true, optional: true},
+                       {name: "element", mayBeNull: true, domElement: true, 
optional: true}
+               ]);
+               if (e) throw e;
+           
+               return Sys.Component._createInternal(formElement._application, 
type, properties, events, references, element);
+       }
+       
+       var $find = null;
+
+} else {
+
+       Sys._Application.prototype.getForm = function 
Sys$_Application$getForm2() {
+               return theForm;
+       }
+
+       Sys.Component.prototype.getApplication = function 
Sys$Component$getApplication2() {
+               return Sys.Application;
+       }
+       
+       Sys.Application.getInstance = function 
Sys$Application$getInstance2(formElement) {
+               return Sys.Application;
+       }
+}

Added: 
trunk/mcs/class/System.Web.Extensions/Resources/MicrosoftAjaxWebFormsExtension.js
===================================================================
--- 
trunk/mcs/class/System.Web.Extensions/Resources/MicrosoftAjaxWebFormsExtension.js
   2007-09-02 13:29:51 UTC (rev 85192)
+++ 
trunk/mcs/class/System.Web.Extensions/Resources/MicrosoftAjaxWebFormsExtension.js
   2007-09-02 14:06:24 UTC (rev 85193)
@@ -0,0 +1,17 @@
+Sys.WebForms.PageRequestManager.getInstance = function 
Sys$WebForms$PageRequestManager$getInstance(formElement) {
+    /// <param name="formElement" domElement="true"></param>
+    /// <returns type="Sys.WebForms.PageRequestManager"></returns>
+    var e = Function._validateParams(arguments, [
+        {name: "formElement", domElement: true}
+    ]);
+       return formElement._pageRequestManager;
+}
+
+Sys.WebForms.PageRequestManager._initialize = function 
Sys$WebForms$PageRequestManager$_initialize(scriptManagerID, formElement) {
+    if (formElement._pageRequestManager) {
+        throw Error.invalidOperation(Sys.WebForms.Res.PRM_CannotRegisterTwice);
+    }
+    formElement._pageRequestManager = new Sys.WebForms.PageRequestManager();
+    formElement._pageRequestManager._application = formElement._application;
+    formElement._pageRequestManager._initializeInternal(scriptManagerID, 
formElement);
+}

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to