From: Igor Zelmanovich Date: Thu, 10 Jan 2008 11:18:40 +0000 (-0000) Subject: 2008-01-10 Igor Zelmanovich X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=9d9bc5d8162e557ee580d48c9cfbd904d8ce981c;p=mono.git 2008-01-10 Igor Zelmanovich * webform.js: make scripts compatible with MicrosoftAjaxLibrary. svn path=/trunk/mcs/; revision=92579 --- diff --git a/mcs/class/System.Web/System.Web.UI/Page.cs b/mcs/class/System.Web/System.Web.UI/Page.cs index 9ec35de9042..3e94eafa624 100644 --- a/mcs/class/System.Web/System.Web.UI/Page.cs +++ b/mcs/class/System.Web/System.Web.UI/Page.cs @@ -1092,7 +1092,6 @@ public partial class Page : TemplateControl, IHttpHandler { writer.WriteLine ("\tvar {0};\n\tif (document.getElementById) {{ {0} = document.getElementById ('{1}'); }}", theForm, formUniqueID); writer.WriteLine ("\telse {{ {0} = document.{1}; }}", theForm, formUniqueID); - writer.WriteLine ("\t{0}._instanceVariableName = '{0}';", theForm); #if TARGET_J2EE // TODO implement callback on portlet string serverUrl = Request.RawUrl; diff --git a/mcs/class/System.Web/resources/ChangeLog b/mcs/class/System.Web/resources/ChangeLog index 0374652c77d..424ac444a01 100644 --- a/mcs/class/System.Web/resources/ChangeLog +++ b/mcs/class/System.Web/resources/ChangeLog @@ -1,3 +1,8 @@ +2008-01-10 Igor Zelmanovich + + * webform.js: + make scripts compatible with MicrosoftAjaxLibrary. + 2008-01-09 Igor Zelmanovich * WebUIValidation_2.0.js: diff --git a/mcs/class/System.Web/resources/webform.js b/mcs/class/System.Web/resources/webform.js index b70701d46b4..7f597414cab 100644 --- a/mcs/class/System.Web/resources/webform.js +++ b/mcs/class/System.Web/resources/webform.js @@ -34,10 +34,10 @@ webForm.__pendingCallbacks = new Array(); webForm.WebForm_AutoFocus = function (id) { - var x = this.WebForm_GetElementById (id); + var x = webForm.WebForm_GetElementById (id); - if (x && (!this.WebForm_CanFocus(x))) { - x = this.WebForm_FindFirstFocusableChild(x); + if (x && (!webForm.WebForm_CanFocus(x))) { + x = webForm.WebForm_FindFirstFocusableChild(x); } if (x) { x.focus(); } } @@ -69,12 +69,12 @@ webForm.WebForm_FindFirstFocusableChild = function (element) { if (children) { for (var i = 0; i < children.length; i++) { try { - if (this.WebForm_CanFocus(children[i])) { + if (webForm.WebForm_CanFocus(children[i])) { return children[i]; } else { - var focused = this.WebForm_FindFirstFocusableChild(children[i]); - if (this.WebForm_CanFocus(focused)) { + var focused = webForm.WebForm_FindFirstFocusableChild(children[i]); + if (webForm.WebForm_CanFocus(focused)) { return focused; } } @@ -87,28 +87,25 @@ webForm.WebForm_FindFirstFocusableChild = function (element) { webForm.WebForm_ReEnableControls = function () { - if (typeof(this._form.__enabledControlArray) != 'undefined' && this._form.__enabledControlArray != null) - __enabledControlArray = this._form.__enabledControlArray; - - if (typeof(__enabledControlArray) == 'undefined' || __enabledControlArray == null) + if (typeof(webForm.__enabledControlArray) == 'undefined' || webForm.__enabledControlArray == null) return false; - this._form.__disabledControlArray = new Array(); - for (var i = 0; i < __enabledControlArray.length; i++) { - var c = this.WebForm_GetElementById (__enabledControlArray[i]); + webForm.__disabledControlArray = new Array(); + for (var i = 0; i < webForm.__enabledControlArray.length; i++) { + var c = this.WebForm_GetElementById (webForm.__enabledControlArray[i]); if ((typeof(c) != "undefined") && (c != null) && (c.disabled == true)) { c.disabled = false; - this._form.__disabledControlArray[this._form.__disabledControlArray.length] = c; + webForm.__disabledControlArray[webForm.__disabledControlArray.length] = c; } } - setTimeout((this._instanceVariableName ? this._instanceVariableName + "." : "") + "WebForm_ReDisableControls ()", 0); + setTimeout(function () { webForm.WebForm_ReDisableControls (); }, 0); return true; } webForm.WebForm_ReDisableControls = function () { - for (var i = 0; i < this._form.__disabledControlArray.length; i++) { - this._form.__disabledControlArray[i].disabled = true; + for (var i = 0; i < webForm.__disabledControlArray.length; i++) { + webForm.__disabledControlArray[i].disabled = true; } } @@ -260,7 +257,7 @@ webForm.WebForm_FireDefaultButton = function (event, target) if(event.srcElement && (event.srcElement.tagName.toLowerCase() == "textarea")) { return true; } - var defaultButton = this.WebForm_GetElementById(target); + var defaultButton = webForm.WebForm_GetElementById(target); if (!defaultButton) return true;