You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(204) |
Dec
(147) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(52) |
Feb
(33) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Dion O. <dol...@us...> - 2006-02-07 19:28:22
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9666/magicajax/Core Modified Files: AjaxCallHelper.cs AssemblyInfo.cs MagicAjax NET 2.0.csproj MagicAjaxContext.cs Log Message: Index: AjaxCallHelper.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/AjaxCallHelper.cs,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** AjaxCallHelper.cs 6 Feb 2006 13:20:47 -0000 1.27 --- AjaxCallHelper.cs 7 Feb 2006 10:54:08 -0000 1.28 *************** *** 826,829 **** --- 826,830 ---- /// Uses reflection to get the private dictionary field 'fieldName'. /// Uses Page.ClientScript for .NET 2.0, and the Page-object for .NET 1.1 + /// Note: if MEDIUM_TRUST flag is set, reflection is not allowed, so return null; /// </summary> /// <param name="fieldName"></param> *************** *** 831,837 **** private static IDictionary GetPageHiddenDictionary(Page page, string fieldName) { ! #if NET_2_0 return (IDictionary)(Util.GetPrivateField(page.ClientScript, typeof(ClientScriptManager), fieldName)); ! #else return (IDictionary)(Util.GetPrivateField(page, typeof(Page), fieldName)); #endif --- 832,842 ---- private static IDictionary GetPageHiddenDictionary(Page page, string fieldName) { ! #if NET_2_0 && !MEDIUM_TRUST return (IDictionary)(Util.GetPrivateField(page.ClientScript, typeof(ClientScriptManager), fieldName)); ! #endif ! #if NET_2_0 && MEDIUM_TRUST ! return null; ! #endif ! #if !NET_2_0 return (IDictionary)(Util.GetPrivateField(page, typeof(Page), fieldName)); #endif Index: MagicAjax NET 2.0.csproj =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjax NET 2.0.csproj,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** MagicAjax NET 2.0.csproj 24 Jan 2006 22:25:04 -0000 1.15 --- MagicAjax NET 2.0.csproj 7 Feb 2006 10:54:09 -0000 1.16 *************** *** 35,39 **** <ConfigurationOverrideFile> </ConfigurationOverrideFile> ! <DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants> <DocumentationFile> </DocumentationFile> --- 35,39 ---- <ConfigurationOverrideFile> </ConfigurationOverrideFile> ! <DefineConstants>TRACE;DEBUG;NET_2_0; !MEDIUM_TRUST</DefineConstants> <DocumentationFile> </DocumentationFile> Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/AssemblyInfo.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AssemblyInfo.cs 27 Jan 2006 23:59:08 -0000 1.9 --- AssemblyInfo.cs 7 Feb 2006 10:54:08 -0000 1.10 *************** *** 1,3 **** --- 1,4 ---- using System.Reflection; + using System.Security; using System.Runtime.CompilerServices; using System.Web.UI; *************** *** 25,28 **** --- 26,31 ---- #endif + [assembly: AllowPartiallyTrustedCallers] + // // Version information for an assembly consists of the following four values: Index: MagicAjaxContext.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxContext.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** MagicAjaxContext.cs 3 Jan 2006 01:49:09 -0000 1.13 --- MagicAjaxContext.cs 7 Feb 2006 10:54:09 -0000 1.14 *************** *** 215,219 **** { // Load configuration from web.config ! _configuration = (MagicAjaxConfiguration)ConfigurationSettings.GetConfig("magicAjax"); if (_configuration == null) { --- 215,221 ---- { // Load configuration from web.config ! #if !NET_2_0 || !MEDIUM_TRUST ! _configuration = (MagicAjaxConfiguration)ConfigurationSettings.GetConfig("magicAjax"); ! #endif if (_configuration == null) { |
From: Dion O. <dol...@us...> - 2006-02-07 18:13:49
|
Update of /cvsroot/magicajax/magicajax/Docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16293/magicajax/Docs Modified Files: Changelog.html Log Message: Changes for ASP.NET 2.0 medium trust (default used by almost all hosting providers) Index: Changelog.html =================================================================== RCS file: /cvsroot/magicajax/magicajax/Docs/Changelog.html,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Changelog.html 27 Jan 2006 00:28:25 -0000 1.23 --- Changelog.html 7 Feb 2006 11:11:12 -0000 1.24 *************** *** 57,60 **** --- 57,62 ---- <p>Changes since 0.2.2</p> <ul> + <LI>Fixed reflecting scripts and css-styles that were added on a Ajax callback.<br> + Note: if you want to run the current MagicAjax.NET development version under ASP.NET 2.0 medium trust (as most hosting-providers are forcing), you need to compile MagicAjax with the MEDIUM_TRUST flag on. Unfortunately, this will disable MagicAjax's feature to reflect script/css changes on callbacks for now (because we now use reflection for this to call private system variables). Also, only the default MagicAjax configuration-settings will be used (because medium trust doesn't allow reading of the web.config). We're working on a non-reflection version at the moment (using regular expressions to scan through the Html output), which will run under medium trust. <LI> Image buttons now return the X/Y coordinates |
From: Dion O. <dol...@us...> - 2006-02-06 14:41:44
|
Update of /cvsroot/magicajax/magicajax/Core/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11124/magicajax/Core/UI Modified Files: RenderedByScriptControl.cs Log Message: Fix for reflecting MAGICAJAX_SCRIPT_FINGERPRINTS Index: RenderedByScriptControl.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/RenderedByScriptControl.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** RenderedByScriptControl.cs 6 Feb 2006 13:20:47 -0000 1.23 --- RenderedByScriptControl.cs 6 Feb 2006 14:41:33 -0000 1.24 *************** *** 285,292 **** AjaxCallHelper.HandleClientStartupScripts(this.Page, true); ! // Store scriptblock fingerprints in hidden field ! string allScriptFPs = string.Join(";", (string[])AjaxCallHelper._currentScriptFPs.ToArray(typeof(string))); ! if (HttpContext.Current.Request.Form["__MAGICAJAX_SCRIPT_FINGERPRINTS"] != allScriptFPs) ! AjaxCallHelper.WriteSetFieldScript("__MAGICAJAX_SCRIPT_FINGERPRINTS", allScriptFPs); } else --- 285,300 ---- AjaxCallHelper.HandleClientStartupScripts(this.Page, true); ! bool reflectFingerprints = false; ! // See if one of the _currentScriptFPs is not in _previousScriptFPs ! for (int i = 0; i < AjaxCallHelper._currentScriptFPs.Count && !reflectFingerprints; i++) ! { ! if (!AjaxCallHelper._previousScriptFPs.Contains(AjaxCallHelper._currentScriptFPs[i])) ! { ! // Store scriptblock fingerprints in hidden field ! string allScriptFPs = string.Join(";", (string[])AjaxCallHelper._currentScriptFPs.ToArray(typeof(string))); ! AjaxCallHelper.WriteSetFieldScript("__MAGICAJAX_SCRIPT_FINGERPRINTS", allScriptFPs); ! break; ! } ! } } else |
From: Dion O. <dol...@us...> - 2006-02-06 13:20:57
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7185/magicajax/Core/UI/Controls Modified Files: AjaxPanel.cs Log Message: Fix for reflecting validator array declaration only once. Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** AjaxPanel.cs 6 Feb 2006 01:39:35 -0000 1.56 --- AjaxPanel.cs 6 Feb 2006 13:20:47 -0000 1.57 *************** *** 287,292 **** } ! // Attach to page events (prerendercomplete and unload) so we can do ! // some extra processing before and after rendering of the AjaxPanels. // This extra processing involves reflecting hidden fields, scripts and // stylesheets that were added/changed on a callback. --- 287,294 ---- } ! // Attach to prerendercomplete event so we can do ! // some extra processing before rendering of the AjaxPanels. ! // Also some processing is done after rendering of the AjaxPanels, ! // see Render method in RenderedByScriptControl.cs. // This extra processing involves reflecting hidden fields, scripts and // stylesheets that were added/changed on a callback. *************** *** 299,304 **** this.Page.PreRender += new EventHandler(AjaxCallHelper.Page_PreRender); #endif - if (MagicAjaxContext.Current.IsAjaxCall) - this.Page.Unload += new EventHandler(AjaxCallHelper.Page_Unload); } } --- 301,304 ---- |
From: Dion O. <dol...@us...> - 2006-02-06 13:20:57
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7185/magicajax/Core Modified Files: AjaxCallHelper.cs Log Message: Fix for reflecting validator array declaration only once. Index: AjaxCallHelper.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/AjaxCallHelper.cs,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** AjaxCallHelper.cs 29 Jan 2006 23:36:58 -0000 1.26 --- AjaxCallHelper.cs 6 Feb 2006 13:20:47 -0000 1.27 *************** *** 510,530 **** } - public static void Page_Unload(object sender, EventArgs e) - { - // Reflect added startup-scripts and arrays AFTER reflecting the controls HTML - if (MagicAjaxContext.Current.IsAjaxCall) - { - Page page = (Page)sender; - - HandleArrayDeclares(page, true); - HandleClientStartupScripts(page, true); - - // Store scriptblock fingerprints in hidden field - string allScriptFPs = string.Join(";", (string[])_currentScriptFPs.ToArray(typeof(string))); - if (HttpContext.Current.Request.Form["__MAGICAJAX_SCRIPT_FINGERPRINTS"] != allScriptFPs) - AjaxCallHelper.WriteSetFieldScript("__MAGICAJAX_SCRIPT_FINGERPRINTS", allScriptFPs); - } - } - /// <summary> /// Reflects registered Hidden fields if added/changed on callback --- 510,513 ---- *************** *** 556,566 **** // Not in Ajax call, so create fingerprints of all script blocks HandleClientScriptBlocks(page, false); - HandleArrayDeclares(page, false); - HandleClientStartupScripts(page, false); HandleOnSubmitStatements(page, false); ! // Store scriptblock fingerprints in hidden field ! page.RegisterHiddenField("__MAGICAJAX_SCRIPT_FINGERPRINTS", ! string.Join(";", (string[])_currentScriptFPs.ToArray(typeof(string)))); } } --- 539,546 ---- // Not in Ajax call, so create fingerprints of all script blocks HandleClientScriptBlocks(page, false); HandleOnSubmitStatements(page, false); ! // Create hidden field to store scriptblock fingerprints later on (see Render method of RenderedByScriptControl.cs) ! page.RegisterHiddenField("__MAGICAJAX_SCRIPT_FINGERPRINTS", String.Empty); } } *************** *** 573,577 **** /// When reflectToClient is true, also reflects the changed tags inside head. ///</summary> ! protected static void RenderHead(HtmlTextWriter writer, Control ctl) { if (ctl != null) --- 553,557 ---- /// When reflectToClient is true, also reflects the changed tags inside head. ///</summary> ! public static void RenderHead(HtmlTextWriter writer, Control ctl) { if (ctl != null) *************** *** 660,664 **** /// <param name="page"></param> /// <param name="reflectToClient"></param> ! private static void HandleHiddenFields(Page page) { IDictionary regFields = GetPageHiddenDictionary(page, "_registeredHiddenFields"); --- 640,644 ---- /// <param name="page"></param> /// <param name="reflectToClient"></param> ! public static void HandleHiddenFields(Page page) { IDictionary regFields = GetPageHiddenDictionary(page, "_registeredHiddenFields"); *************** *** 684,688 **** /// Handle registered ClientScriptBlocks to see if some where added/changed on callback/postback /// </summary> ! private static void HandleClientScriptBlocks(Page page, bool reflectToClient) { IDictionary regScripts = GetPageHiddenDictionary(page, "_registeredClientScriptBlocks"); --- 664,668 ---- /// Handle registered ClientScriptBlocks to see if some where added/changed on callback/postback /// </summary> ! public static void HandleClientScriptBlocks(Page page, bool reflectToClient) { IDictionary regScripts = GetPageHiddenDictionary(page, "_registeredClientScriptBlocks"); *************** *** 694,698 **** /// </summary> /// <param name="reflectToClient"></param> ! private static void HandleOnSubmitStatements(Page page, bool reflectToClient) { IDictionary regScripts = GetPageHiddenDictionary(page, "_registeredOnSubmitStatements"); --- 674,678 ---- /// </summary> /// <param name="reflectToClient"></param> ! public static void HandleOnSubmitStatements(Page page, bool reflectToClient) { IDictionary regScripts = GetPageHiddenDictionary(page, "_registeredOnSubmitStatements"); *************** *** 720,724 **** /// </summary> /// <param name="reflectToClient"></param> ! private static void HandleClientStartupScripts(Page page, bool reflectToClient) { IDictionary regScripts = GetPageHiddenDictionary(page, "_registeredClientStartupScripts"); --- 700,704 ---- /// </summary> /// <param name="reflectToClient"></param> ! public static void HandleClientStartupScripts(Page page, bool reflectToClient) { IDictionary regScripts = GetPageHiddenDictionary(page, "_registeredClientStartupScripts"); *************** *** 730,734 **** /// </summary> /// <param name="reflectToClient"></param> ! private static void HandleArrayDeclares(Page page, bool reflectToClient) { IDictionary regArrays = GetPageHiddenDictionary(page, "_registeredArrayDeclares"); --- 710,714 ---- /// </summary> /// <param name="reflectToClient"></param> ! public static void HandleArrayDeclares(Page page, bool reflectToClient) { IDictionary regArrays = GetPageHiddenDictionary(page, "_registeredArrayDeclares"); |
From: Dion O. <dol...@us...> - 2006-02-06 13:20:57
|
Update of /cvsroot/magicajax/magicajax/Core/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7185/magicajax/Core/UI Modified Files: RenderedByScriptControl.cs Log Message: Fix for reflecting validator array declaration only once. Index: RenderedByScriptControl.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/RenderedByScriptControl.cs,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** RenderedByScriptControl.cs 24 Jan 2006 22:25:05 -0000 1.22 --- RenderedByScriptControl.cs 6 Feb 2006 13:20:47 -0000 1.23 *************** *** 208,211 **** --- 208,217 ---- Page.RegisterArrayDeclaration("RBS_Controls", String.Format("document.getElementById(\"{0}$RBS_Holder\")", this.ClientID)); Page.RegisterArrayDeclaration("RBS_Controls_Store", String.Format("document.forms[0][\"{0}\"]", hiddenStore)); + + // Keep track of last Ajax control, so we can run some additional code after rendering the last Ajax control + if (!HttpContext.Current.Items.Contains("__LAST_AJAX_CONTROL")) + HttpContext.Current.Items.Add("__LAST_AJAX_CONTROL", this.ClientID); + else + HttpContext.Current.Items["__LAST_AJAX_CONTROL"] = this.ClientID; } *************** *** 268,271 **** --- 274,305 ---- } + if (this.MagicAjaxContext.IsBrowserSupported && !IsChildOfRenderedByScriptControl(this)) + { + if ((string)HttpContext.Current.Items["__LAST_AJAX_CONTROL"] == this.ClientID) + { + // This is the last Ajax control. + // Reflect added startup-scripts and arrays AFTER reflecting the controls HTML + if (MagicAjaxContext.Current.IsAjaxCall) + { + AjaxCallHelper.HandleArrayDeclares(this.Page, true); + AjaxCallHelper.HandleClientStartupScripts(this.Page, true); + + // Store scriptblock fingerprints in hidden field + string allScriptFPs = string.Join(";", (string[])AjaxCallHelper._currentScriptFPs.ToArray(typeof(string))); + if (HttpContext.Current.Request.Form["__MAGICAJAX_SCRIPT_FINGERPRINTS"] != allScriptFPs) + AjaxCallHelper.WriteSetFieldScript("__MAGICAJAX_SCRIPT_FINGERPRINTS", allScriptFPs); + } + else + { + // Normal request (i.e. first page request) + AjaxCallHelper.HandleArrayDeclares(this.Page, false); + AjaxCallHelper.HandleClientStartupScripts(this.Page, false); + + // Fill hidden field __MAGICAJAX_SCRIPT_FINGERPRINTS using script + writer.WriteLine("<script type=\"text/javascript\">AJAXCbo.SetField(\"__MAGICAJAX_SCRIPT_FINGERPRINTS\",{0});</script>", AjaxCallHelper.EncodeString(string.Join(";", (string[])AjaxCallHelper._currentScriptFPs.ToArray(typeof(string))))); + } + } + } + OnRenderEnd(EventArgs.Empty); } |
From: Argiris K. <be...@us...> - 2006-02-06 01:39:44
|
Update of /cvsroot/magicajax/magicajax/Core/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7629/Core/script Modified Files: AjaxCallObject.js Log Message: --Fixed client validation for 2.0 --At AjaxPanel.ReflectUpdatedFormValues and Util.GetHtmlWithClearedFormValues methods I replaced Hashtable.Add with Hashtable[]= to avoid exceptions when there are attributes with the same name at the same tag (badly formed html) Index: AjaxCallObject.js =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/script/AjaxCallObject.js,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** AjaxCallObject.js 27 Jan 2006 23:59:09 -0000 1.52 --- AjaxCallObject.js 6 Feb 2006 01:39:35 -0000 1.53 *************** *** 7,10 **** --- 7,11 ---- __TraceWindows = new Array(); __ClockID = 0; + __IsOpera = false; __Netscape8AndUp = false; __ClickX = __ClickY = 0; *************** *** 218,221 **** --- 219,223 ---- { __Netscape8AndUp = navigator.appName == "Netscape" && navigator.vendor == "Netscape" && parseInt(navigator.appVersion) >= 5; + __IsOpera = window.opera ? true : false; this.AddEventListener(document.forms[0], "submit", this.OnFormSubmit); *************** *** 261,264 **** --- 263,277 ---- return false; } + + if (e.getPreventDefault) + { + if (e.getPreventDefault() == true) + return false; + } + else if (!__IsOpera && "returnValue" in e) + { + if (e.returnValue == false) + return false; + } // Empty the cached html of RenderedByScript controls |
From: Argiris K. <be...@us...> - 2006-02-06 01:39:44
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7629/Core Modified Files: Util.cs Log Message: --Fixed client validation for 2.0 --At AjaxPanel.ReflectUpdatedFormValues and Util.GetHtmlWithClearedFormValues methods I replaced Hashtable.Add with Hashtable[]= to avoid exceptions when there are attributes with the same name at the same tag (badly formed html) Index: Util.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Util.cs,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Util.cs 29 Jan 2006 23:06:53 -0000 1.27 --- Util.cs 6 Feb 2006 01:39:35 -0000 1.28 *************** *** 142,147 **** { string attrname = attrnames[j].Value.ToLower(System.Globalization.CultureInfo.InvariantCulture); ! attrNameValues.Add (attrname, attrvalues[j].Value); ! attrCaptures.Add (attrname, attributes[j]); } --- 142,147 ---- { string attrname = attrnames[j].Value.ToLower(System.Globalization.CultureInfo.InvariantCulture); ! attrNameValues[attrname] = attrvalues[j].Value; ! attrCaptures[attrname] = attributes[j]; } |
From: Argiris K. <be...@us...> - 2006-02-06 01:39:44
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7629/Core/UI/Controls Modified Files: AjaxPanel.cs Log Message: --Fixed client validation for 2.0 --At AjaxPanel.ReflectUpdatedFormValues and Util.GetHtmlWithClearedFormValues methods I replaced Hashtable.Add with Hashtable[]= to avoid exceptions when there are attributes with the same name at the same tag (badly formed html) Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** AjaxPanel.cs 25 Jan 2006 09:19:07 -0000 1.55 --- AjaxPanel.cs 6 Feb 2006 01:39:35 -0000 1.56 *************** *** 531,535 **** for (int j = 0; j < attrnames.Count; j++) { ! attrNameValues.Add(attrnames[j].Value.ToLower(System.Globalization.CultureInfo.InvariantCulture), attrvalues[j].Value); } --- 531,535 ---- for (int j = 0; j < attrnames.Count; j++) { ! attrNameValues[attrnames[j].Value.ToLower(System.Globalization.CultureInfo.InvariantCulture)] = attrvalues[j].Value; } *************** *** 616,620 **** for (int k = 0; k < attrnamesOption.Count; k++) { ! attrNameValuesOption.Add(attrnamesOption[k].Value.ToLower(System.Globalization.CultureInfo.InvariantCulture), attrvaluesOption[k].Value); } --- 616,620 ---- for (int k = 0; k < attrnamesOption.Count; k++) { ! attrNameValuesOption[attrnamesOption[k].Value.ToLower(System.Globalization.CultureInfo.InvariantCulture)] = attrvaluesOption[k].Value; } |
From: Dion O. <dol...@us...> - 2006-01-29 23:37:11
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6090/magicajax/Core Modified Files: AjaxCallHelper.cs Log Message: Fix: handle ASP.NET 2.0 WebPartManager scripts seperately (not handled as the other scripts) Index: AjaxCallHelper.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/AjaxCallHelper.cs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** AjaxCallHelper.cs 29 Jan 2006 23:06:50 -0000 1.25 --- AjaxCallHelper.cs 29 Jan 2006 23:36:58 -0000 1.26 *************** *** 794,799 **** foreach (DictionaryEntry fld in regScripts) { ! int keyHash = fld.Key.GetHashCode(); string script = (string)fld.Value; string scriptFP = Util.GetFingerprint(string.Format("{0}:{1}", keyHash, script)); --- 794,810 ---- foreach (DictionaryEntry fld in regScripts) { ! int keyHash = -1; ! try ! { ! keyHash = fld.Key.GetHashCode(); ! } ! catch (NullReferenceException) {} string script = (string)fld.Value; + + #if NET_2_0 + //don't handle WebPartManager scripts (we're handling them seperately later on) + if (script != null && (script.Contains("__wpm = new WebPartManager") || script.Contains("var menuWebPart_"))) + continue; + #endif string scriptFP = Util.GetFingerprint(string.Format("{0}:{1}", keyHash, script)); |
From: Dion O. <dol...@us...> - 2006-01-29 23:07:07
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26941/magicajax/Core Modified Files: AjaxCallHelper.cs Util.cs Log Message: Fix for reflecting stylesheet changes for ASP.NET 2.0 skinning/theming Index: Util.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Util.cs,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Util.cs 27 Jan 2006 23:59:09 -0000 1.26 --- Util.cs 29 Jan 2006 23:06:53 -0000 1.27 *************** *** 37,41 **** public const string ScriptPattern = "<script.[^>]*>"; public const string FormElementPattern = @"<(?<tag>input|textarea|select)\s+(?<attribute>(?<attrname>[-\w]+)=((""|')(?<attrvalue>.*?)(""|')\s*|(?<attrvalue>[-\w]+)\s*))*.*?(/>|>((?<inner>.*?)</\k'tag'>)?)"; ! public const string HeadElementPattern = @"<(?<tag>title|style|link)\s*(?<attribute>(?<attrname>[-\w]+)=((""|')(?<attrvalue>.*?)(""|')\s*|(?<attrvalue>[-\w]+)\s*))*.*?(/>|>[\r\n\t]*(?<inner>.*?)[\r\n]*</\k'tag'>)"; #region Global Regular Expressions --- 37,41 ---- public const string ScriptPattern = "<script.[^>]*>"; public const string FormElementPattern = @"<(?<tag>input|textarea|select)\s+(?<attribute>(?<attrname>[-\w]+)=((""|')(?<attrvalue>.*?)(""|')\s*|(?<attrvalue>[-\w]+)\s*))*.*?(/>|>((?<inner>.*?)</\k'tag'>)?)"; ! public const string StyleElementPattern = @"<(?<tag>style|link)\s*(?<attribute>(?<attrname>[-\w]+)=((""|')(?<attrvalue>.*?)(""|')\s*|(?<attrvalue>[-\w]+)\s*))*.*?(/>|>(?<inner>.*?)</\k'tag'>)"; #region Global Regular Expressions *************** *** 46,50 **** public static Regex ScriptPatternRegEx = new Regex(Util.ScriptPattern, RegexOptions.IgnoreCase); public static Regex ScriptTagsRegEx = new Regex("<script\\s((?<attrname>[-\\w]+)=[\"'](?<attrvalue>.*?)[\"']\\s?)*\\s*>(?<script>.*?)</script>", _options); ! public static Regex HeaderTagsRegEx = new Regex(HeadElementPattern, _options); #endregion --- 46,50 ---- public static Regex ScriptPatternRegEx = new Regex(Util.ScriptPattern, RegexOptions.IgnoreCase); public static Regex ScriptTagsRegEx = new Regex("<script\\s((?<attrname>[-\\w]+)=[\"'](?<attrvalue>.*?)[\"']\\s?)*\\s*>(?<script>.*?)</script>", _options); ! public static Regex HeaderStyleTagsRegEx = new Regex(StyleElementPattern, _options); #endregion Index: AjaxCallHelper.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/AjaxCallHelper.cs,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** AjaxCallHelper.cs 25 Jan 2006 03:12:56 -0000 1.24 --- AjaxCallHelper.cs 29 Jan 2006 23:06:50 -0000 1.25 *************** *** 312,320 **** { StringBuilder sbuilder = new StringBuilder("new Array("); ! for (int i = 0; i < attributes.Count; i++) { ! if (i > 0) ! sbuilder.Append(","); ! sbuilder.AppendFormat("\"{0}\",\"{1}\"", attributes.Keys[i], attributes[i]); } sbuilder.Append(")"); --- 312,323 ---- { StringBuilder sbuilder = new StringBuilder("new Array("); ! if (attributes != null) { ! for (int i = 0; i < attributes.Count; i++) ! { ! if (i > 0) ! sbuilder.Append(","); ! sbuilder.AppendFormat("\"{0}\",\"{1}\"", attributes.Keys[i], attributes[i]); ! } } sbuilder.Append(")"); *************** *** 532,541 **** { Page page = (Page)sender; ! #if NET_2_0 ! // For ASP.NET 2.0, reflect the head-tag's stylesheet- or ! // title-changes back to client ! HandleHeader(MagicAjaxContext.Current.IsAjaxCall, page); #endif if (MagicAjaxContext.Current.IsAjaxCall) { --- 535,544 ---- { Page page = (Page)sender; ! #if NET_2_0 ! // Reflect head content (title and stylesheets) ! page.Header.SetRenderMethodDelegate(new RenderMethod(RenderHead)); #endif + if (MagicAjaxContext.Current.IsAjaxCall) { *************** *** 562,566 **** } } ! /// <summary> /// Reflects registered Hidden fields if added/changed on callback --- 565,658 ---- } } ! ! #if NET_2_0 ! ///<summary> ! /// Handles style,title and link tags (inside HEAD) that were added/changed during callback. ! /// For first page-request, only stores hidden field containing fingerprints ! /// of the tags inside the html head section. ! /// When reflectToClient is true, also reflects the changed tags inside head. ! ///</summary> ! protected static void RenderHead(HtmlTextWriter writer, Control ctl) ! { ! if (ctl != null) ! { ! bool reflectToClient = MagicAjaxContext.Current.IsAjaxCall; ! ! ArrayList _previousHeaderFPs = new ArrayList(); ! ArrayList _currentHeaderFPs = new ArrayList(); ! ! // Get the fingerprints of the head-tags sent previous time ! if (HttpContext.Current.Request.Form["__MAGICAJAX_HEAD_FINGERPRINTS"] != null) ! { ! _previousHeaderFPs.AddRange(HttpContext.Current.Request.Form["__MAGICAJAX_HEAD_FINGERPRINTS"].Split(';')); ! } ! ! StringBuilder sbHeader = new StringBuilder(); ! HtmlTextWriter headerWriter = new HtmlTextWriter(new System.IO.StringWriter(sbHeader)); ! ! System.Web.UI.HtmlControls.HtmlHead h = new System.Web.UI.HtmlControls.HtmlHead(); ! ctl.SetRenderMethodDelegate(null); ! ctl.RenderControl(headerWriter); ! ! //strip <header> tag ! string header = sbHeader.ToString(); ! ! //write to HtmlTextWriter ! writer.Write(header); ! ! //reflect title ! if (ctl.Page.Title != null) ! { ! string titleFP = Util.GetFingerprint(ctl.Page.Title); ! _currentHeaderFPs.Add(titleFP); ! if (reflectToClient && !_previousHeaderFPs.Contains(titleFP)) ! { ! AjaxCallHelper.WriteAddHeaderElementScript("title", ctl.Page.Title, null); ! } ! } ! ! MatchCollection matches = Util.HeaderStyleTagsRegEx.Matches(header); ! for (int i = 0; i < matches.Count; i++) ! { ! Match match = matches[i]; ! ! string matchFP = Util.GetFingerprint(match.Value); ! _currentHeaderFPs.Add(matchFP); ! ! if (reflectToClient && !_previousHeaderFPs.Contains(matchFP)) ! { ! string tagName = match.Groups["tag"].Value.ToLower(CultureInfo.InvariantCulture); ! string innerText = match.Groups["inner"].Success ? match.Groups["inner"].Value : String.Empty; ! ! NameValueCollection attrNameValues = new NameValueCollection(); ! ! if (tagName == "link") ! { ! CaptureCollection attributes = match.Groups["attribute"].Captures; ! CaptureCollection attrnames = match.Groups["attrname"].Captures; ! CaptureCollection attrvalues = match.Groups["attrvalue"].Captures; ! ! for (int j = 0; j < attributes.Count; j++) ! { ! string attrname = attrnames[j].Value.ToLower(System.Globalization.CultureInfo.InvariantCulture); ! attrNameValues.Add(attrname, attrvalues[j].Value); ! } ! } ! ! AjaxCallHelper.WriteAddHeaderElementScript(tagName, innerText, attrNameValues); ! } ! } ! ! string allHeadFPs = string.Join(";", (string[])_currentHeaderFPs.ToArray(typeof(string))); ! ! // Store head-tag fingerprints in hidden field ! if (reflectToClient && HttpContext.Current.Request.Form["__MAGICAJAX_HEAD_FINGERPRINTS"] != allHeadFPs) ! AjaxCallHelper.WriteSetFieldScript("__MAGICAJAX_HEAD_FINGERPRINTS", allHeadFPs); ! else if (!reflectToClient) ! ctl.Page.RegisterHiddenField("__MAGICAJAX_HEAD_FINGERPRINTS", allHeadFPs); ! } ! } ! #endif ! /// <summary> /// Reflects registered Hidden fields if added/changed on callback *************** *** 754,829 **** #endif } - - #if NET_2_0 - /// <summary> - /// Handles style,title and link tags (inside HEAD) that were added/changed during callback. - /// For first page-request, only stores hidden field containing fingerprints - /// of the tags inside the html head section. - /// When reflectToClient is true, also reflects the changed tags inside head. - /// </summary> - /// <param name="reflectToClient"></param> - private static void HandleHeader(bool reflectToClient, Page page) - { - if (page != null && page.Header != null) - { - ArrayList _previousHeaderFPs = new ArrayList(); - ArrayList _currentHeaderFPs = new ArrayList(); - - // Get the fingerprints of the head-tags sent previous time - if (page.Request.Form["__MAGICAJAX_HEAD_FINGERPRINTS"] != null) - { - _previousHeaderFPs.AddRange(page.Request.Form["__MAGICAJAX_HEAD_FINGERPRINTS"].Split(';')); - } - - StringBuilder sbHeader = new StringBuilder(); - HtmlTextWriter headerWriter = new HtmlTextWriter(new System.IO.StringWriter(sbHeader)); - page.Header.RenderControl(headerWriter); - - //strip <header> tag - string header = sbHeader.ToString(); - - MatchCollection matches = Util.HeaderTagsRegEx.Matches(header); - for (int i = 0; i < matches.Count; i++) - { - Match match = matches[i]; - - string matchFP = Util.GetFingerprint(match.Value); - _currentHeaderFPs.Add(matchFP); - - if (reflectToClient && !_previousHeaderFPs.Contains(matchFP)) - { - string tagName = match.Groups["tag"].Value.ToLower(CultureInfo.InvariantCulture); - string innerText = match.Groups["inner"].Success ? match.Groups["inner"].Value : String.Empty; - - NameValueCollection attrNameValues = new NameValueCollection(); - - if (tagName == "link") - { - CaptureCollection attributes = match.Groups["attribute"].Captures; - CaptureCollection attrnames = match.Groups["attrname"].Captures; - CaptureCollection attrvalues = match.Groups["attrvalue"].Captures; - - for (int j = 0; j < attributes.Count; j++) - { - string attrname = attrnames[j].Value.ToLower(System.Globalization.CultureInfo.InvariantCulture); - attrNameValues.Add(attrname, attrvalues[j].Value); - } - } - - AjaxCallHelper.WriteAddHeaderElementScript(tagName, innerText, attrNameValues); - } - } - - string allHeadFPs = string.Join(";", (string[])_currentHeaderFPs.ToArray(typeof(string))); - - // Store head-tag fingerprints in hidden field - if (reflectToClient && page.Request.Form["__MAGICAJAX_HEAD_FINGERPRINTS"] != allHeadFPs) - AjaxCallHelper.WriteSetFieldScript("__MAGICAJAX_HEAD_FINGERPRINTS", allHeadFPs); - else if (!reflectToClient) - page.RegisterHiddenField("__MAGICAJAX_HEAD_FINGERPRINTS", allHeadFPs); - } - } - #endif - #endregion } --- 846,849 ---- |
From: Argiris K. <be...@us...> - 2006-01-27 23:59:23
|
Update of /cvsroot/magicajax/magicajax/Core/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29601/Core/script Modified Files: AjaxCallObject.js Log Message: -Set version to 0.2.3 -Modified a bit Util.FormElementPattern to fix an issue with Infragistics control (noted by juanvp) -Modified a bit the CreateWaitElement function of AjaxCallObject.js (changes noted by Bruno Feu) Index: AjaxCallObject.js =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/script/AjaxCallObject.js,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** AjaxCallObject.js 27 Jan 2006 00:28:25 -0000 1.51 --- AjaxCallObject.js 27 Jan 2006 23:59:09 -0000 1.52 *************** *** 295,304 **** { // IE ! theData += target.name + ".x=" + (e.offsetX - target.offsetLeft) + "&" + target.name + ".y=" + (e.offsetY - target.offsetTop); } else { // Firefox ! theData += target.name + ".x=" + (__ClickX - target.offsetLeft) + "&" + target.name + ".y=" + (__ClickY - target.offsetTop); } } --- 295,304 ---- { // IE ! theData = target.name + ".x=" + (e.offsetX - target.offsetLeft) + "&" + target.name + ".y=" + (e.offsetY - target.offsetTop); } else { // Firefox ! theData = target.name + ".x=" + (__ClickX - target.offsetLeft) + "&" + target.name + ".y=" + (__ClickY - target.offsetTop); } } *************** *** 428,432 **** theData += '__AJAXSCOPE=' + ajaxScopeID + '&'; ! if (typeof(additionalData) != "undefined") theData += additionalData + "&"; --- 428,432 ---- theData += '__AJAXSCOPE=' + ajaxScopeID + '&'; ! if (typeof(additionalData) != "undefined" && additionalData != "") theData += additionalData + "&"; *************** *** 548,551 **** --- 548,554 ---- } + if (waitElement) + waitElement.style.visibility = 'hidden'; + // Checking if the data were fully loaded, without being aborted var flag = "'AJAX_LOADING_OK';"; *************** *** 555,561 **** eval(responseText); - if (waitElement) - waitElement.style.visibility = 'hidden'; - return true; } --- 558,561 ---- *************** *** 974,996 **** } function CreateWaitElement() { ! var elem = document.getElementById('__AjaxCall_Wait'); ! if (!elem) { ! elem = document.createElement("div"); ! elem.id = '__AjaxCall_Wait'; ! elem.style.position = 'absolute'; ! elem.style.height = 17; ! elem.border = "1px"; ! elem.style.paddingLeft = "3px"; ! elem.style.paddingRight = "3px"; ! elem.style.fontSize = "11px"; ! elem.style.borderColor = "#ffffff"; ! elem.style.borderSize = "1px"; ! elem.style.backgroundColor = "DimGray"; ! elem.style.color = "#ffffff"; ! elem.innerHTML = 'Loading ...'; ! elem.style.visibility = 'hidden'; ! document.body.insertBefore(elem, document.body.firstChild); ! } ! waitElement = elem; } // end wait element \ No newline at end of file --- 974,995 ---- } function CreateWaitElement() { ! var elem = document.getElementById('__AjaxCall_Wait'); ! if (!elem) { ! elem = document.createElement("div"); ! elem.id = '__AjaxCall_Wait'; ! elem.style.position = 'absolute'; ! elem.style.height = 17; ! elem.style.paddingLeft = "3px"; ! elem.style.paddingRight = "3px"; ! elem.style.fontSize = "11px"; ! elem.style.fontFamily = 'Arial, Verdana, Tahoma'; ! elem.style.border = "#000000 1px solid"; ! elem.style.backgroundColor = "DimGray"; ! elem.style.color = "#ffffff"; ! elem.innerHTML = 'Loading ...'; ! elem.style.visibility = 'hidden'; ! document.body.insertBefore(elem, document.body.firstChild); ! } ! waitElement = elem; } // end wait element \ No newline at end of file |
From: Argiris K. <be...@us...> - 2006-01-27 23:59:20
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29601/Core Modified Files: AssemblyInfo.cs Util.cs Log Message: -Set version to 0.2.3 -Modified a bit Util.FormElementPattern to fix an issue with Infragistics control (noted by juanvp) -Modified a bit the CreateWaitElement function of AjaxCallObject.js (changes noted by Bruno Feu) Index: Util.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Util.cs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Util.cs 23 Jan 2006 01:28:41 -0000 1.25 --- Util.cs 27 Jan 2006 23:59:09 -0000 1.26 *************** *** 36,40 **** { public const string ScriptPattern = "<script.[^>]*>"; ! public const string FormElementPattern = @"<(?<tag>input|textarea|select)\s+(?<attribute>(?<attrname>[-\w]+)=((""|')(?<attrvalue>.*?)(""|')\s*|(?<attrvalue>[-\w]+)\s*))*.*?(/>|>(?<inner>.*?)</\k'tag'>)"; public const string HeadElementPattern = @"<(?<tag>title|style|link)\s*(?<attribute>(?<attrname>[-\w]+)=((""|')(?<attrvalue>.*?)(""|')\s*|(?<attrvalue>[-\w]+)\s*))*.*?(/>|>[\r\n\t]*(?<inner>.*?)[\r\n]*</\k'tag'>)"; --- 36,40 ---- { public const string ScriptPattern = "<script.[^>]*>"; ! public const string FormElementPattern = @"<(?<tag>input|textarea|select)\s+(?<attribute>(?<attrname>[-\w]+)=((""|')(?<attrvalue>.*?)(""|')\s*|(?<attrvalue>[-\w]+)\s*))*.*?(/>|>((?<inner>.*?)</\k'tag'>)?)"; public const string HeadElementPattern = @"<(?<tag>title|style|link)\s*(?<attribute>(?<attrname>[-\w]+)=((""|')(?<attrvalue>.*?)(""|')\s*|(?<attrvalue>[-\w]+)\s*))*.*?(/>|>[\r\n\t]*(?<inner>.*?)[\r\n]*</\k'tag'>)"; Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/AssemblyInfo.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AssemblyInfo.cs 3 Jan 2006 01:49:09 -0000 1.8 --- AssemblyInfo.cs 27 Jan 2006 23:59:08 -0000 1.9 *************** *** 36,40 **** // by using the '*' as shown below: ! [assembly: AssemblyVersion("0.3.0.0")] // --- 36,40 ---- // by using the '*' as shown below: ! [assembly: AssemblyVersion("0.2.3.0")] // |
From: Argiris K. <be...@us...> - 2006-01-27 00:28:38
|
Update of /cvsroot/magicajax/magicajax/Core/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22717/Core/script Modified Files: AjaxCallObject.js Log Message: Image buttons return X/Y coordinates for Firefox too. Index: AjaxCallObject.js =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/script/AjaxCallObject.js,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** AjaxCallObject.js 24 Jan 2006 22:25:05 -0000 1.50 --- AjaxCallObject.js 27 Jan 2006 00:28:25 -0000 1.51 *************** *** 8,11 **** --- 8,12 ---- __ClockID = 0; __Netscape8AndUp = false; + __ClickX = __ClickY = 0; // Excluding from post flags *************** *** 219,222 **** --- 220,224 ---- this.AddEventListener(document.forms[0], "submit", this.OnFormSubmit); + this.AddEventListener(document.forms[0], "click", this.OnFormClick); if (typeof __doPostBack != 'undefined') *************** *** 245,248 **** --- 247,256 ---- } + AjaxCallObject.prototype.OnFormClick = function(e) + { + __ClickX = e.pageX; + __ClickY = e.pageY; + } + AjaxCallObject.prototype.OnFormSubmit = function(e) { *************** *** 280,284 **** __doingSubmit = false; ! if (AJAXCbo.DoAjaxCall(target.name, "", cbType, AJAXCbo.GetAjaxScopeID(target))) { if (e.preventDefault) --- 288,308 ---- __doingSubmit = false; ! var theData = ""; ! //check if target is an input element of type 'image' ! if (target != null && target.type == "image" && target.name && target.name != '') ! { ! if (e.offsetX) ! { ! // IE ! theData += target.name + ".x=" + (e.offsetX - target.offsetLeft) + "&" + target.name + ".y=" + (e.offsetY - target.offsetTop); ! } ! else ! { ! // Firefox ! theData += target.name + ".x=" + (__ClickX - target.offsetLeft) + "&" + target.name + ".y=" + (__ClickY - target.offsetTop); ! } ! } ! ! if (AJAXCbo.DoAjaxCall(target.name, "", cbType, AJAXCbo.GetAjaxScopeID(target), theData)) { if (e.preventDefault) *************** *** 383,392 **** } ! AjaxCallObject.prototype.DoAjaxCall = function(eventTarget, eventArgument, ajaxCallType, ajaxScopeID) { //defaults if (!ajaxCallType) ajaxCallType = "async"; if (typeof(ajaxScopeID) == "undefined") ! ajaxScopeID = this.GetAjaxScopeID(this.GetTargetElement(eventTarget)); var theData = ''; --- 407,418 ---- } ! AjaxCallObject.prototype.DoAjaxCall = function(eventTarget, eventArgument, ajaxCallType, ajaxScopeID, additionalData) { + var target = this.GetTargetElement(eventTarget); + //defaults if (!ajaxCallType) ajaxCallType = "async"; if (typeof(ajaxScopeID) == "undefined") ! ajaxScopeID = this.GetAjaxScopeID( target ); var theData = ''; *************** *** 401,413 **** if (ajaxScopeID != null) theData += '__AJAXSCOPE=' + ajaxScopeID + '&'; ! ! //check if eventTarget is an input element of type 'image' ! var target = this.GetTargetElement(eventTarget) ! if (target != null && target.type == "image" && target.name && target.name != '') ! { ! //image callbacks only supported for IE (for now). For other browsers, no .x and .y is sent yet. ! if (window.event) ! theData += target.name + ".x=" + window.event.offsetX + "&" + target.name + ".y=" + (window.event.offsetY - target.offsetTop) + "&"; ! } var excludeFlags = this.GetExcludeFlags( target ); --- 427,433 ---- if (ajaxScopeID != null) theData += '__AJAXSCOPE=' + ajaxScopeID + '&'; ! ! if (typeof(additionalData) != "undefined") ! theData += additionalData + "&"; var excludeFlags = this.GetExcludeFlags( target ); |
From: Argiris K. <be...@us...> - 2006-01-27 00:28:38
|
Update of /cvsroot/magicajax/magicajax/Docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22717/Docs Modified Files: Changelog.html Log Message: Image buttons return X/Y coordinates for Firefox too. Index: Changelog.html =================================================================== RCS file: /cvsroot/magicajax/magicajax/Docs/Changelog.html,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Changelog.html 5 Jan 2006 11:26:00 -0000 1.22 --- Changelog.html 27 Jan 2006 00:28:25 -0000 1.23 *************** *** 58,61 **** --- 58,63 ---- <ul> <LI> + Image buttons now return the X/Y coordinates + <LI> Fix for incompatibility with flash applets <LI> |
From: Dion O. <dol...@us...> - 2006-01-25 09:19:15
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10817/magicajax/Core/UI/Controls Modified Files: AjaxPanel.cs Log Message: reverted line of code that was commented out erroneously Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** AjaxPanel.cs 24 Jan 2006 22:25:05 -0000 1.54 --- AjaxPanel.cs 25 Jan 2006 09:19:07 -0000 1.55 *************** *** 1354,1359 **** if (HttpContext.Current.Request.Form[panelKey] != serializedPanelFingerprints) { ! //NOTE: reflecting hidden hields is done elsewhere ! //AjaxCallHelper.WriteSetFieldScript(panelKey, serializedPanelFingerprints); } } --- 1354,1358 ---- if (HttpContext.Current.Request.Form[panelKey] != serializedPanelFingerprints) { ! AjaxCallHelper.WriteSetFieldScript(panelKey, serializedPanelFingerprints); } } |
From: Argiris K. <be...@us...> - 2006-01-25 03:13:06
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25940/Core Modified Files: AjaxCallHelper.cs Log Message: Fixed a bug of the HandleHeader method. It was sending lowercased data and was creating problems with stylesheets. Index: AjaxCallHelper.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/AjaxCallHelper.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** AjaxCallHelper.cs 24 Jan 2006 22:25:04 -0000 1.23 --- AjaxCallHelper.cs 25 Jan 2006 03:12:56 -0000 1.24 *************** *** 794,798 **** { string tagName = match.Groups["tag"].Value.ToLower(CultureInfo.InvariantCulture); ! string innerText = match.Groups["inner"].Success ? match.Groups["inner"].Value.ToLower(CultureInfo.InvariantCulture) : String.Empty; NameValueCollection attrNameValues = new NameValueCollection(); --- 794,798 ---- { string tagName = match.Groups["tag"].Value.ToLower(CultureInfo.InvariantCulture); ! string innerText = match.Groups["inner"].Success ? match.Groups["inner"].Value : String.Empty; NameValueCollection attrNameValues = new NameValueCollection(); |
From: Dion O. <dol...@us...> - 2006-01-24 22:25:17
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20314/magicajax/Core/UI/Controls Modified Files: AjaxPanel.cs Log Message: Moved reflecting of added scripts and hidden fields to Page.PreRenderComplete and Page.UnLoad Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** AjaxPanel.cs 24 Jan 2006 16:30:27 -0000 1.53 --- AjaxPanel.cs 24 Jan 2006 22:25:05 -0000 1.54 *************** *** 287,298 **** } ! // Find the first and last AjaxPanel ! // So later on (on prerender and render) we can do some extra processing ! // before and after rendering of the AjaxPanels. This extra processing involves ! // reflecting hidden fields, scripts and stylesheets that were added/changed ! // on a callback. ! if (Context != null) { ! AjaxCallHelper.TrackFirstOrLastPanel(this.Page, this.ClientID); } } --- 287,304 ---- } ! // Attach to page events (prerendercomplete and unload) so we can do ! // some extra processing before and after rendering of the AjaxPanels. ! // This extra processing involves reflecting hidden fields, scripts and ! // stylesheets that were added/changed on a callback. ! if (Context != null && !Context.Items.Contains("__ATTACHED_PAGE_HANDLERS")) { ! Context.Items.Add("__ATTACHED_PAGE_HANDLERS", String.Empty); ! #if NET_2_0 ! this.Page.PreRenderComplete += new EventHandler(AjaxCallHelper.Page_PreRender); ! #else ! this.Page.PreRender += new EventHandler(AjaxCallHelper.Page_PreRender); ! #endif ! if (MagicAjaxContext.Current.IsAjaxCall) ! this.Page.Unload += new EventHandler(AjaxCallHelper.Page_Unload); } } |
From: Dion O. <dol...@us...> - 2006-01-24 22:25:17
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20314/magicajax/Core Modified Files: AjaxCallHelper.cs MagicAjax NET 2.0.csproj MagicAjax.csproj Log Message: Moved reflecting of added scripts and hidden fields to Page.PreRenderComplete and Page.UnLoad Index: MagicAjax NET 2.0.csproj =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjax NET 2.0.csproj,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** MagicAjax NET 2.0.csproj 20 Jan 2006 01:35:56 -0000 1.14 --- MagicAjax NET 2.0.csproj 24 Jan 2006 22:25:04 -0000 1.15 *************** *** 124,128 **** <SubType>Code</SubType> </Compile> - <Compile Include="UI\Controls\AjaxHtmlForm.cs" /> <Compile Include="UI\Controls\ClientEventControls\BaseClientEventWrapper.cs" /> <Compile Include="UI\Controls\ClientEventControls\ClientEventControl.cs" /> --- 124,127 ---- Index: MagicAjax.csproj =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjax.csproj,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** MagicAjax.csproj 20 Jan 2006 01:35:56 -0000 1.11 --- MagicAjax.csproj 24 Jan 2006 22:25:04 -0000 1.12 *************** *** 203,211 **** /> <File - RelPath = "UI\Controls\AjaxHtmlForm.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "UI\Controls\AjaxHtmlImage.cs" SubType = "Code" --- 203,206 ---- Index: AjaxCallHelper.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/AjaxCallHelper.cs,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** AjaxCallHelper.cs 24 Jan 2006 16:30:26 -0000 1.22 --- AjaxCallHelper.cs 24 Jan 2006 22:25:04 -0000 1.23 *************** *** 506,546 **** } } ! ! /// <summary> ! /// Find the first and last AjaxPanel ! /// So later on (on prerender and render) we can do some extra processing ! /// before and after rendering of the AjaxPanels. This extra processing involves ! /// reflecting hidden fields, scripts and stylesheets that were added/changed ! /// on a callback. ! /// </summary> ! /// <param name="panelClientID"></param> ! public static void TrackFirstOrLastPanel(Page page, string panelClientID) { ! if (MagicAjaxContext.Current.IsBrowserSupported) ! { ! page.RegisterHiddenField("__MAGICAJAX_SCRIPT_FINGERPRINTS", String.Empty); ! page.RegisterHiddenField("__MAGICAJAX_HEAD_FINGERPRINTS", String.Empty); ! } ! ! if (!HttpContext.Current.Items.Contains("__MAGICAJAX_FIRST_PANELID")) { ! HttpContext.Current.Items.Add("__MAGICAJAX_FIRST_PANELID", panelClientID); ! if (MagicAjaxContext.Current.IsAjaxCall) ! { ! #if NET_2_0 ! page.PreRenderComplete += new EventHandler(page_PreRender); ! #else ! page.PreRender += new EventHandler(page_PreRender); ! #endif ! } } - - if (!HttpContext.Current.Items.Contains("__MAGICAJAX_LAST_PANELID")) - HttpContext.Current.Items.Add("__MAGICAJAX_LAST_PANELID", panelClientID); - else - HttpContext.Current.Items["__MAGICAJAX_LAST_PANELID"] = panelClientID; } ! /// <summary> /// Reflects registered Hidden fields if added/changed on callback --- 506,527 ---- } } ! ! public static void Page_Unload(object sender, EventArgs e) { ! // Reflect added startup-scripts and arrays AFTER reflecting the controls HTML ! if (MagicAjaxContext.Current.IsAjaxCall) { ! Page page = (Page)sender; ! ! HandleArrayDeclares(page, true); ! HandleClientStartupScripts(page, true); ! // Store scriptblock fingerprints in hidden field ! string allScriptFPs = string.Join(";", (string[])_currentScriptFPs.ToArray(typeof(string))); ! if (HttpContext.Current.Request.Form["__MAGICAJAX_SCRIPT_FINGERPRINTS"] != allScriptFPs) ! AjaxCallHelper.WriteSetFieldScript("__MAGICAJAX_SCRIPT_FINGERPRINTS", allScriptFPs); } } ! /// <summary> /// Reflects registered Hidden fields if added/changed on callback *************** *** 548,633 **** /// <param name="sender"></param> /// <param name="e"></param> ! public static void page_PreRender(object sender, EventArgs e) { Page page = (Page)sender; ! if (page != null) { ! IDictionary regFields = GetPageHiddenDictionary(page, "_registeredHiddenFields"); ! if (regFields != null) { ! foreach (DictionaryEntry fld in regFields) ! { ! string key = (string)fld.Key; ! string value = (string)fld.Value; ! // For now, don't reflect system hidden fields (starting with "__"). ! // TODO: find out why __VIEWSTATE is never registered...? ! if (key != null && !key.StartsWith("__") && value != page.Request.Form[key]) ! { ! if (page.Request.Form[key] == null) ! AjaxCallHelper.WriteAddHiddenFieldScript(key, value); ! else ! AjaxCallHelper.WriteSetFieldScript(key, value); ! } ! } } } ! } ! ! public static void PreRenderReflecting(string controlClientID, Page page, HtmlTextWriter writer) ! { ! //Reflect all kinds of scripts ! if ((string)HttpContext.Current.Items["__MAGICAJAX_FIRST_PANELID"] == controlClientID) { ! #if NET_2_0 ! // For ASP.NET 2.0, reflect the head-tag's stylesheet- or ! // title-changes back to client ! if (MagicAjaxContext.Current.IsAjaxCall) ! HandleHeader(true, page, null); ! else ! HandleHeader(false, page, writer); ! #endif ! if (MagicAjaxContext.Current.IsAjaxCall) ! { ! // Get the fingerprints of the scripts sent previous time ! if (page.Request.Form["__MAGICAJAX_SCRIPT_FINGERPRINTS"] != null) ! { ! _previousScriptFPs.AddRange(page.Request.Form["__MAGICAJAX_SCRIPT_FINGERPRINTS"].Split(';')); ! } ! ! HandleClientScriptBlocks(page, true); ! HandleOnSubmitStatements(page, true); ! } ! else ! { ! // Not in Ajax call, so create fingerprints of all script blocks ! HandleClientScriptBlocks(page, false); ! HandleArrayDeclares(page, false); ! HandleClientStartupScripts(page, false); ! HandleOnSubmitStatements(page, false); ! ! // Store scriptblock fingerprints in hidden field ! writer.WriteLine( ! string.Format("<script type='text/javascript'>AJAXCbo.SetField('__MAGICAJAX_SCRIPT_FINGERPRINTS','{0}');</script>", ! string.Join(";", (string[])_currentScriptFPs.ToArray(typeof(string))))); ! } } } ! ! public static void PostRenderReflecting(string controlClientID, Page page) { ! //Reflect client-arrays and startup-scripts added on Ajax call ! if (MagicAjaxContext.Current.IsAjaxCall && (string)HttpContext.Current.Items["__MAGICAJAX_LAST_PANELID"] == controlClientID) { ! // Reflect added startup-scripts and arrays AFTER reflecting the controls HTML ! if (MagicAjaxContext.Current.IsAjaxCall) { ! HandleArrayDeclares(page, true); ! HandleClientStartupScripts(page, true); ! ! // Store scriptblock fingerprints in hidden field ! string allScriptFPs = string.Join(";", (string[])_currentScriptFPs.ToArray(typeof(string))); ! if (page.Request.Form["__MAGICAJAX_SCRIPT_FINGERPRINTS"] != allScriptFPs) ! AjaxCallHelper.WriteSetFieldScript("__MAGICAJAX_SCRIPT_FINGERPRINTS", allScriptFPs); } } --- 529,588 ---- /// <param name="sender"></param> /// <param name="e"></param> ! public static void Page_PreRender(object sender, EventArgs e) { Page page = (Page)sender; ! ! #if NET_2_0 ! // For ASP.NET 2.0, reflect the head-tag's stylesheet- or ! // title-changes back to client ! HandleHeader(MagicAjaxContext.Current.IsAjaxCall, page); ! #endif ! if (MagicAjaxContext.Current.IsAjaxCall) { ! // Get the fingerprints of the scripts sent previous time ! if (page.Request.Form["__MAGICAJAX_SCRIPT_FINGERPRINTS"] != null) { ! _previousScriptFPs.AddRange(page.Request.Form["__MAGICAJAX_SCRIPT_FINGERPRINTS"].Split(';')); } + HandleHiddenFields(page); + HandleClientScriptBlocks(page, true); + HandleOnSubmitStatements(page, true); } ! else { ! // Not in Ajax call, so create fingerprints of all script blocks ! HandleClientScriptBlocks(page, false); ! HandleArrayDeclares(page, false); ! HandleClientStartupScripts(page, false); ! HandleOnSubmitStatements(page, false); ! // Store scriptblock fingerprints in hidden field ! page.RegisterHiddenField("__MAGICAJAX_SCRIPT_FINGERPRINTS", ! string.Join(";", (string[])_currentScriptFPs.ToArray(typeof(string)))); } } ! ! /// <summary> ! /// Reflects registered Hidden fields if added/changed on callback ! /// </summary> ! /// <param name="page"></param> ! /// <param name="reflectToClient"></param> ! private static void HandleHiddenFields(Page page) { ! IDictionary regFields = GetPageHiddenDictionary(page, "_registeredHiddenFields"); ! if (regFields != null) { ! foreach (DictionaryEntry fld in regFields) { ! string key = (string)fld.Key; ! string value = (string)fld.Value; ! // For now, don't reflect system hidden fields (starting with "__"). ! if (key != null && !key.StartsWith("__") && value != page.Request.Form[key]) ! { ! if (page.Request.Form[key] == null) ! AjaxCallHelper.WriteAddHiddenFieldScript(key, value); ! else ! AjaxCallHelper.WriteSetFieldScript(key, value); ! } } } *************** *** 808,812 **** /// </summary> /// <param name="reflectToClient"></param> ! private static void HandleHeader(bool reflectToClient, Page page, HtmlTextWriter writer) { if (page != null && page.Header != null) --- 763,767 ---- /// </summary> /// <param name="reflectToClient"></param> ! private static void HandleHeader(bool reflectToClient, Page page) { if (page != null && page.Header != null) *************** *** 866,871 **** AjaxCallHelper.WriteSetFieldScript("__MAGICAJAX_HEAD_FINGERPRINTS", allHeadFPs); else if (!reflectToClient) ! writer.WriteLine( ! string.Format("<script type='text/javascript'>AJAXCbo.SetField('__MAGICAJAX_HEAD_FINGERPRINTS','{0}');</script>", allHeadFPs)); } } --- 821,825 ---- AjaxCallHelper.WriteSetFieldScript("__MAGICAJAX_HEAD_FINGERPRINTS", allHeadFPs); else if (!reflectToClient) ! page.RegisterHiddenField("__MAGICAJAX_HEAD_FINGERPRINTS", allHeadFPs); } } |
From: Dion O. <dol...@us...> - 2006-01-24 22:25:17
|
Update of /cvsroot/magicajax/magicajax/Core/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20314/magicajax/Core/UI Modified Files: RenderedByScriptControl.cs Log Message: Moved reflecting of added scripts and hidden fields to Page.PreRenderComplete and Page.UnLoad Index: RenderedByScriptControl.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/RenderedByScriptControl.cs,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** RenderedByScriptControl.cs 24 Jan 2006 16:30:27 -0000 1.21 --- RenderedByScriptControl.cs 24 Jan 2006 22:25:05 -0000 1.22 *************** *** 240,245 **** protected override void Render(HtmlTextWriter writer) { - AjaxCallHelper.PreRenderReflecting(this.ClientID, this.Page, writer); - RenderStartEventArgs eventArgs = new RenderStartEventArgs(writer); OnRenderStart(eventArgs); --- 240,243 ---- *************** *** 271,276 **** OnRenderEnd(EventArgs.Empty); - - AjaxCallHelper.PostRenderReflecting(this.ClientID, this.Page); } --- 269,272 ---- |
From: Dion O. <dol...@us...> - 2006-01-24 22:25:17
|
Update of /cvsroot/magicajax/magicajax/Core/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20314/magicajax/Core/script Modified Files: AjaxCallObject.js Log Message: Moved reflecting of added scripts and hidden fields to Page.PreRenderComplete and Page.UnLoad Index: AjaxCallObject.js =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/script/AjaxCallObject.js,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** AjaxCallObject.js 24 Jan 2006 16:30:27 -0000 1.49 --- AjaxCallObject.js 24 Jan 2006 22:25:05 -0000 1.50 *************** *** 797,825 **** break; case "style": ! if (document.styleSheets) { // based on http://www.bobbyvandersluis.com/articles/dynamicCSS.php - var style = null; if (document.styleSheets.length == 0) ! style = this.CreateStyleTag(); //add style rule to last stylesheet (forces proper cascading) var lastStyle = document.styleSheets[document.styleSheets.length - 1]; ! if (typeof lastStyle.insertRule == "function") ! { ! //Mozilla ! var styleRule = document.createTextNode(innerText); ! style = (style == null) ? this.CreateStyleTag() : style; ! style.appendChild(styleRule); ! //lastStyle.insertRule(innerText, lastStyle.cssRules.length); //doesn't seems to work ! } ! else if (typeof lastStyle.addRule == "object") { - //IE var splitRules = innerText.split('}'); for (i=0; i<splitRules.length-1; i++) { ! var splitNameValue = splitRules[i].split('{'); ! lastStyle.addRule(splitNameValue[0], splitNameValue[1]); } } --- 797,832 ---- break; case "style": ! if (document.styleSheets && innerText != null) { // based on http://www.bobbyvandersluis.com/articles/dynamicCSS.php if (document.styleSheets.length == 0) ! { ! //no stylesheets yet, so create empty one ! var head = document.getElementsByTagName("head")[0]; ! var style = document.createElement("style"); ! style.type = "text/css"; ! head.appendChild(style); ! } //add style rule to last stylesheet (forces proper cascading) var lastStyle = document.styleSheets[document.styleSheets.length - 1]; ! var ieNewRule = typeof lastStyle.addRule == "object"; ! var ffNewRule = typeof lastStyle.insertRule == "function"; ! if (ieNewRule || ffNewRule) { var splitRules = innerText.split('}'); for (i=0; i<splitRules.length-1; i++) { ! if (ffNewRule) ! { ! //Mozilla ! lastStyle.insertRule(splitRules[i] + "}", lastStyle.cssRules.length); ! } ! else ! { ! //IE ! var splitNameValue = splitRules[i].split('{'); ! lastStyle.addRule(splitNameValue[0], splitNameValue[1]); ! } } } *************** *** 829,843 **** } - AjaxCallObject.prototype.CreateStyleTag = function() - { - var head = document.getElementsByTagName("head")[0]; - var style = (typeof document.createElementNS != "undefined") ? - document.createElementNS("http://www.w3.org/1999/xhtml", "style") : - document.createElement("style"); - style.setAttribute("type", "text/css"); - //style.setAttribute("media", "screen"); - return head.appendChild(style); - } - AjaxCallObject.prototype.SetFieldIfEmpty = function(fieldName, fieldValue) { --- 836,839 ---- |
From: Dion O. <dol...@us...> - 2006-01-24 16:30:37
|
Update of /cvsroot/magicajax/magicajax/Core/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19281/magicajax/Core/UI Modified Files: RenderedByScriptControl.cs Log Message: Several fixes to get the reflecting for scripts and stylesheets working Index: RenderedByScriptControl.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/RenderedByScriptControl.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** RenderedByScriptControl.cs 20 Jan 2006 01:35:56 -0000 1.20 --- RenderedByScriptControl.cs 24 Jan 2006 16:30:27 -0000 1.21 *************** *** 90,98 **** set { ! if ( IsAjaxCall && IsRenderedOnPage && MonitorVisibilityState ! && value != base.Visible ) ! AjaxCallHelper.WriteSetVisibilityOfElementScript (ClientID, value); base.Visible = value; --- 90,98 ---- set { ! if (IsAjaxCall && IsRenderedOnPage && MonitorVisibilityState ! && value != base.Visible) ! AjaxCallHelper.WriteSetVisibilityOfElementScript(ClientID, value); base.Visible = value; *************** *** 109,113 **** /// is false. /// </remarks> ! [Browsable(false),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public virtual bool IsRenderedOnPage { --- 109,113 ---- /// is false. /// </remarks> ! [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public virtual bool IsRenderedOnPage { *************** *** 126,130 **** /// method. /// </remarks> ! [Bindable(false), Category("Behavior"), DefaultValue(true)] public bool MonitorVisibilityState { --- 126,130 ---- /// method. /// </remarks> ! [Bindable(false), Category("Behavior"), DefaultValue(true)] public bool MonitorVisibilityState { *************** *** 146,150 **** this.ID = ""; } ! public RenderedByScriptControl(HtmlTextWriterTag tag) : base(tag) { this.ID = ""; --- 146,151 ---- this.ID = ""; } ! public RenderedByScriptControl(HtmlTextWriterTag tag) ! : base(tag) { this.ID = ""; *************** *** 158,162 **** /// property set to false. /// </remarks> ! [Browsable(false),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] internal bool SkipRendering { --- 159,163 ---- /// property set to false. /// </remarks> ! [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] internal bool SkipRendering { *************** *** 175,179 **** /// In this case it's not necessary to send any javascript to the client. /// </remarks> ! [Browsable(false),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] protected bool IsHtmlRendered { --- 176,180 ---- /// In this case it's not necessary to send any javascript to the client. /// </remarks> ! [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] protected bool IsHtmlRendered { *************** *** 183,191 **** protected override void OnPreRender(EventArgs e) { ! if ( this.MagicAjaxContext.IsBrowserSupported && !IsChildOfRenderedByScriptControl(this)) { string hiddenStore; ! if ( IsPageNoStoreMode ) { // Firefox, when performing a refresh, loads the page but keeps any INPUT --- 184,192 ---- protected override void OnPreRender(EventArgs e) { ! if (this.MagicAjaxContext.IsBrowserSupported && !IsChildOfRenderedByScriptControl(this)) { string hiddenStore; ! if (IsPageNoStoreMode) { // Firefox, when performing a refresh, loads the page but keeps any INPUT *************** *** 209,213 **** } ! base.OnPreRender (e); } --- 210,214 ---- } ! base.OnPreRender(e); } *************** *** 239,250 **** protected override void Render(HtmlTextWriter writer) { RenderStartEventArgs eventArgs = new RenderStartEventArgs(writer); OnRenderStart(eventArgs); ! if ( !eventArgs.AbortRendering && !SkipRendering ) { ! if ( !IsAjaxCall || (writer.InnerWriter is IScriptRenderingDisabler && (writer.InnerWriter as IScriptRenderingDisabler).DisableScriptRendering) ) { ! if ( !IsChildOfRenderedByScriptControl(this) ) { // Put the html of this control inside a SPAN tag so that it can --- 240,253 ---- protected override void Render(HtmlTextWriter writer) { + AjaxCallHelper.PreRenderReflecting(this.ClientID, this.Page, writer); + RenderStartEventArgs eventArgs = new RenderStartEventArgs(writer); OnRenderStart(eventArgs); ! if (!eventArgs.AbortRendering && !SkipRendering) { ! if (!IsAjaxCall || (writer.InnerWriter is IScriptRenderingDisabler && (writer.InnerWriter as IScriptRenderingDisabler).DisableScriptRendering)) { ! if (!IsChildOfRenderedByScriptControl(this)) { // Put the html of this control inside a SPAN tag so that it can *************** *** 252,260 **** // i.e. when the back button is pressed. writer.Write("<span id='{0}$RBS_Holder'>", this.ClientID); ! base.Render (writer); writer.Write("</span>"); } else ! base.Render (writer); _isHtmlRendered = true; --- 255,263 ---- // i.e. when the back button is pressed. writer.Write("<span id='{0}$RBS_Holder'>", this.ClientID); ! base.Render(writer); writer.Write("</span>"); } else ! base.Render(writer); _isHtmlRendered = true; *************** *** 268,271 **** --- 271,276 ---- OnRenderEnd(EventArgs.Empty); + + AjaxCallHelper.PostRenderReflecting(this.ClientID, this.Page); } *************** *** 278,285 **** System.Text.StringBuilder sb = new System.Text.StringBuilder(); HtmlTextWriter strwriter = new HtmlTextWriter(new System.IO.StringWriter(sb)); ! base.RenderBeginTag (strwriter); _currentTagHtml = sb.ToString(); ! base.RenderBeginTag (writer); } --- 283,290 ---- System.Text.StringBuilder sb = new System.Text.StringBuilder(); HtmlTextWriter strwriter = new HtmlTextWriter(new System.IO.StringWriter(sb)); ! base.RenderBeginTag(strwriter); _currentTagHtml = sb.ToString(); ! base.RenderBeginTag(writer); } *************** *** 289,301 **** public virtual void WriteScript() { ! if ( ! this.IsInAjaxScope ) return; ! if ( ! this.Visible ) { if (_isRenderedOnPage) { // Verify that it is indeed rendered on page ! _isRenderedOnPage = ( GetTopInvisibleControl(this) is RenderedByScriptControl ); } return; --- 294,306 ---- public virtual void WriteScript() { ! if (!this.IsInAjaxScope) return; ! if (!this.Visible) { if (_isRenderedOnPage) { // Verify that it is indeed rendered on page ! _isRenderedOnPage = (GetTopInvisibleControl(this) is RenderedByScriptControl); } return; *************** *** 309,316 **** HtmlTextWriter strwriter = new HtmlTextWriter(new System.IO.StringWriter(sb)); ! if ( ! IsRenderedOnPage ) { // Put the control's tag on page ! PutTagOnPageForAjaxCall(); } else --- 314,321 ---- HtmlTextWriter strwriter = new HtmlTextWriter(new System.IO.StringWriter(sb)); ! if (!IsRenderedOnPage) { // Put the control's tag on page ! PutTagOnPageForAjaxCall(); } else *************** *** 319,331 **** // TODO: Take care of the tag for 'NoStore' mode too. ! if ( ! IsPageNoStoreMode ) { ! base.RenderBeginTag (strwriter); string html = sb.ToString(); sb.Length = 0; ! if(_currentTagHtml != html) { ! AjaxCallHelper.WriteSetAttributesOfControl (ClientID, FormatAttributes(html)); _currentTagHtml = html; } --- 324,336 ---- // TODO: Take care of the tag for 'NoStore' mode too. ! if (!IsPageNoStoreMode) { ! base.RenderBeginTag(strwriter); string html = sb.ToString(); sb.Length = 0; ! if (_currentTagHtml != html) { ! AjaxCallHelper.WriteSetAttributesOfControl(ClientID, FormatAttributes(html)); _currentTagHtml = html; } *************** *** 360,366 **** /// <param name="control"></param> /// <returns></returns> ! protected Control GetTopInvisibleControl (Control control) { ! if ( control.Parent == null || control.Parent.Visible ) return control; else --- 365,371 ---- /// <param name="control"></param> /// <returns></returns> ! protected Control GetTopInvisibleControl(Control control) { ! if (control.Parent == null || control.Parent.Visible) return control; else *************** *** 373,377 **** RenderStart(this, eventArgs); } ! protected virtual void OnRenderEnd(EventArgs e) { --- 378,382 ---- RenderStart(this, eventArgs); } ! protected virtual void OnRenderEnd(EventArgs e) { *************** *** 387,391 **** private Control FindNextVisibleSibling() { ! for (int i=Parent.Controls.IndexOf(this) + 1; i < Parent.Controls.Count; i++) { Control con = Parent.Controls[i]; --- 392,396 ---- private Control FindNextVisibleSibling() { ! for (int i = Parent.Controls.IndexOf(this) + 1; i < Parent.Controls.Count; i++) { Control con = Parent.Controls[i]; *************** *** 396,400 **** return null; ! } /// <summary> --- 401,405 ---- return null; ! } /// <summary> *************** *** 410,414 **** int mode = 0; ! for (int i=0; i < sb.Length; i++) { char ch = sb[i]; --- 415,419 ---- int mode = 0; ! for (int i = 0; i < sb.Length; i++) { char ch = sb[i]; *************** *** 418,436 **** { case 0: ! if (ch == ' ') mode++; break; case 1: ! switch (ch) ! { ! case '\"': ! mode++; ! break; ! case ' ': ! attribs.Append ('|'); ! break; ! default: ! attribs.Append (ch); ! break; ! } break; case 2: --- 423,441 ---- { case 0: ! if (ch == ' ') mode++; break; case 1: ! switch (ch) ! { ! case '\"': ! mode++; ! break; ! case ' ': ! attribs.Append('|'); ! break; ! default: ! attribs.Append(ch); ! break; ! } break; case 2: *************** *** 438,442 **** mode--; else ! attribs.Append (ch); break; } --- 443,447 ---- mode--; else ! attribs.Append(ch); break; } |
From: Dion O. <dol...@us...> - 2006-01-24 16:30:36
|
Update of /cvsroot/magicajax/magicajax/Core/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19281/magicajax/Core/script Modified Files: AjaxCallObject.js Log Message: Several fixes to get the reflecting for scripts and stylesheets working Index: AjaxCallObject.js =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/script/AjaxCallObject.js,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** AjaxCallObject.js 23 Jan 2006 01:28:41 -0000 1.48 --- AjaxCallObject.js 24 Jan 2006 16:30:27 -0000 1.49 *************** *** 799,810 **** if (document.styleSheets) { if (document.styleSheets.length == 0) ! { ! //no stylesheets yet, so create empty one ! var head = document.getElementsByTagName("head")[0]; ! var style = document.createElement("style"); ! style.type = "text/css"; ! head.appendChild(style); ! } //add style rule to last stylesheet (forces proper cascading) --- 799,806 ---- if (document.styleSheets) { + // based on http://www.bobbyvandersluis.com/articles/dynamicCSS.php + var style = null; if (document.styleSheets.length == 0) ! style = this.CreateStyleTag(); //add style rule to last stylesheet (forces proper cascading) *************** *** 813,817 **** { //Mozilla ! lastStyle.insertRule(innerText, lastStyle.cssRules.length); } else if (typeof lastStyle.addRule == "object") --- 809,816 ---- { //Mozilla ! var styleRule = document.createTextNode(innerText); ! style = (style == null) ? this.CreateStyleTag() : style; ! style.appendChild(styleRule); ! //lastStyle.insertRule(innerText, lastStyle.cssRules.length); //doesn't seems to work } else if (typeof lastStyle.addRule == "object") *************** *** 830,833 **** --- 829,843 ---- } + AjaxCallObject.prototype.CreateStyleTag = function() + { + var head = document.getElementsByTagName("head")[0]; + var style = (typeof document.createElementNS != "undefined") ? + document.createElementNS("http://www.w3.org/1999/xhtml", "style") : + document.createElement("style"); + style.setAttribute("type", "text/css"); + //style.setAttribute("media", "screen"); + return head.appendChild(style); + } + AjaxCallObject.prototype.SetFieldIfEmpty = function(fieldName, fieldValue) { |
From: Dion O. <dol...@us...> - 2006-01-24 16:30:36
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19281/magicajax/Core/UI/Controls Modified Files: AjaxPanel.cs Removed Files: AjaxHtmlForm.cs Log Message: Several fixes to get the reflecting for scripts and stylesheets working --- AjaxHtmlForm.cs DELETED --- Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** AjaxPanel.cs 23 Jan 2006 08:33:07 -0000 1.52 --- AjaxPanel.cs 24 Jan 2006 16:30:27 -0000 1.53 *************** *** 34,1893 **** namespace MagicAjax.UI.Controls { ! /// <summary> ! /// Defines the AjaxCall connection types. ! /// </summary> ! public enum AjaxCallConnectionType ! { ! /// <summary> ! /// Client will not invoke an AjaxCall ! /// </summary> [...3324 lines suppressed...] ! litewriter.Write(value); ! } ! #endregion ! #region IScriptRenderingDisabler Members ! public bool DisableScriptRendering ! { ! get ! { ! return _disableScriptRendering; ! } ! } ! #endregion ! } ! #endregion ! } } \ No newline at end of file |
From: Dion O. <dol...@us...> - 2006-01-23 08:33:15
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26088/magicajax/Core/UI/Controls Modified Files: AjaxPanel.cs Log Message: - Fixed problem with EnableEventValidation on normal postback (.NET 2.0) - Added some comments Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** AjaxPanel.cs 23 Jan 2006 01:28:41 -0000 1.51 --- AjaxPanel.cs 23 Jan 2006 08:33:07 -0000 1.52 *************** *** 34,1885 **** namespace MagicAjax.UI.Controls { ! /// <summary> ! /// Defines the AjaxCall connection types. ! /// </summary> ! public enum AjaxCallConnectionType ! { ! /// <summary> ! /// Client will not invoke an AjaxCall ! /// </summary> [...3685 lines suppressed...] ! AjaxCallHelper.WriteAddHeaderElementScript(tagName, innerText, attrNameValues); ! } ! } ! ! string allHeadFPs = string.Join(";", (string[])_currentHeaderFPs.ToArray(typeof(string))); ! ! // Store head-tag fingerprints in hidden field ! if (reflectToClient && Page.Request.Form["__MAGICAJAX_HEAD_FINGERPRINTS"] != allHeadFPs) ! AjaxCallHelper.WriteSetFieldScript("__MAGICAJAX_HEAD_FINGERPRINTS", allHeadFPs); ! else if (!reflectToClient) ! writer.WriteLine( ! string.Format("<script type='text/javascript'>AJAXCbo.SetField('__MAGICAJAX_HEAD_FINGERPRINTS','{0}');</script>", allHeadFPs)); ! //Page.RegisterHiddenField("__MAGICAJAX_HEAD_FINGERPRINTS", allHeadFPs); ! } ! } #endif ! #endregion ! } } \ No newline at end of file |