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: Argiris K. <be...@us...> - 2005-11-14 18:50:55
|
Update of /cvsroot/magicajax/magicajax/CustomControls/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30932/CustomControls/UI/Controls Modified Files: AjaxLinkedPanelListControl.cs Log Message: Replaced all "CallBack" references by "AjaxCall" Index: AjaxLinkedPanelListControl.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/CustomControls/UI/Controls/AjaxLinkedPanelListControl.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AjaxLinkedPanelListControl.cs 11 Nov 2005 06:17:49 -0000 1.1 --- AjaxLinkedPanelListControl.cs 14 Nov 2005 18:50:43 -0000 1.2 *************** *** 95,99 **** LinkButton ajaxLink = new LinkButton(); ! ajaxLink.Attributes["CallBack"] = "async"; ajaxLink.ID = "link" + index; ajaxLink.Text = item.Text; --- 95,99 ---- LinkButton ajaxLink = new LinkButton(); ! ajaxLink.Attributes["AjaxCall"] = "async"; ajaxLink.ID = "link" + index; ajaxLink.Text = item.Text; *************** *** 126,132 **** protected override void OnPreRender(EventArgs e) { ! if ( !CallBackHelper.IsCallBack ) { ! // ÐñÝðåé íá ðñïçãåßôáé ç äÞëùóç ôïõ callbackobject.js MagicAjaxModule.Instance.EnableAjaxOnPage(this.Page); --- 126,132 ---- protected override void OnPreRender(EventArgs e) { ! if ( !AjaxCallHelper.IsAjaxCall ) { ! // ÐñÝðåé íá ðñïçãåßôáé ç äÞëùóç ôïõ AjaxCallObject.js MagicAjaxModule.Instance.EnableAjaxOnPage(this.Page); |
From: Argiris K. <be...@us...> - 2005-11-14 18:50:54
|
Update of /cvsroot/magicajax/magicajax/Core/Configuration In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30932/Core/Configuration Modified Files: MagicAjaxConfiguration.cs Log Message: Replaced all "CallBack" references by "AjaxCall" Index: MagicAjaxConfiguration.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Configuration/MagicAjaxConfiguration.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MagicAjaxConfiguration.cs 11 Nov 2005 06:17:49 -0000 1.1 --- MagicAjaxConfiguration.cs 14 Nov 2005 18:50:43 -0000 1.2 *************** *** 78,86 **** if (xml != null) { ! XmlAttribute attrib = (XmlAttribute)xml.Attributes.GetNamedItem("callBackScriptPath"); if (attrib != null) { // Resolve relative scriptPath url's (starting with "~") ! _scriptPath = CallBackHelper.ResolveUrl(attrib.Value); } --- 78,86 ---- if (xml != null) { ! XmlAttribute attrib = (XmlAttribute)xml.Attributes.GetNamedItem("ajaxCallScriptPath"); if (attrib != null) { // Resolve relative scriptPath url's (starting with "~") ! _scriptPath = AjaxCallHelper.ResolveUrl(attrib.Value); } |
From: Dion O. <dol...@us...> - 2005-11-14 16:17:05
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28945/magicajax/Core Modified Files: MagicAjaxModule.cs Log Message: Fix in GetStoredPagesList: now checks if _context != null Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MagicAjaxModule.cs 14 Nov 2005 16:11:56 -0000 1.3 --- MagicAjaxModule.cs 14 Nov 2005 16:16:56 -0000 1.4 *************** *** 329,332 **** --- 329,335 ---- protected virtual ArrayList GetStoredPagesList(string key) { + if (_context == null) + return null; + switch (_config.PageStore.Mode) { |
From: Dion O. <dol...@us...> - 2005-11-14 16:12:07
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27833/magicajax/Core Modified Files: MagicAjaxModule.cs Log Message: Some fixes for supporting ASP.NET 2.0 WebParts Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MagicAjaxModule.cs 11 Nov 2005 22:29:39 -0000 1.2 --- MagicAjaxModule.cs 14 Nov 2005 16:11:56 -0000 1.3 *************** *** 434,451 **** // Check if this request is to add/remove/replace a WebPart // If so, send back updated WebPartManager drag&drop javascript (IE only) ! if (!string.IsNullOrEmpty(_form["__EVENTTARGET"]) && !string.IsNullOrEmpty(_form["__EVENTARGUMENT"])) { ! Control webPartControl = requestPage.FindControl(_form["__EVENTTARGET"]); ! if ((webPartControl is System.Web.UI.WebControls.WebParts.WebPartZone && (_form["__EVENTARGUMENT"].StartsWith("delete:") || _form["__EVENTARGUMENT"].StartsWith("Drag:") || _form["__EVENTARGUMENT"].StartsWith("close:"))) ! || (webPartControl is System.Web.UI.WebControls.WebParts.CatalogZone && _form["__EVENTARGUMENT"] == "add")) { ! string wpmValue = _filter.GetWebPartManagerScriptValue(); ! if (wpmValue != null) { ! // Send script to dispose current webpartmanager ! CallBackHelper.Write("if (typeof(WebPartManager_Dispose) == 'function'){WebPartManager_Dispose();}\r\n"); ! // Send script to setup webpartmanager drag&drop + webpartmenu's ! CallBackHelper.Write(wpmValue); ! } } } --- 434,484 ---- // Check if this request is to add/remove/replace a WebPart // If so, send back updated WebPartManager drag&drop javascript (IE only) ! if (!string.IsNullOrEmpty(_form["__WPPS"])) { ! //Control webPartControl = requestPage.FindControl(_form["__EVENTTARGET"]); ! //if ((webPartControl is System.Web.UI.WebControls.WebParts.WebPartZone && (_form["__EVENTARGUMENT"].StartsWith("delete:") || _form["__EVENTARGUMENT"].StartsWith("Drag:") || _form["__EVENTARGUMENT"].StartsWith("close:"))) ! // || (webPartControl is System.Web.UI.WebControls.WebParts.CatalogZone && _form["__EVENTARGUMENT"] == "add")) ! ! string wpmValue = _filter.GetWebPartManagerScriptValue(requestPage.Form.ClientID); ! if (wpmValue != null) { ! //TODO: read wpm_Dispose_script from file ! string wpm_Dispose_script = @" ! // Send script to dispose current webpartmanager ! if (__wpm != null && __wpm.zones != null) { ! //loop zones ! for (var i = 0; i < __wpm.zones.length; i++) ! { ! var zone = __wpm.zones[i]; ! //detach current zone events ! if (zone.webPartTable != null) ! { ! zone.webPartTable.detachEvent('ondragenter', Zone_OnDragEnter); ! zone.webPartTable.detachEvent('ondrop', Zone_OnDrop); ! zone.webPartTable.detachEvent('ondrop', Zone_OnDrop); ! } ! //loop webparts of current zone ! if (zone.webParts != null) ! { ! for (var j = 0; j < zone.webParts.length; j++) ! { ! var webpart = zone.webParts[j]; ! //detach current webpart events ! webpart.webPartElement.detachEvent('ondragstart', WebPart_OnDragStart); ! webpart.webPartElement.detachEvent('ondrag', WebPart_OnDrag); ! webpart.webPartElement.detachEvent('ondragend', WebPart_OnDragEnd); ! } ! } ! //dispose zone ! __wpm.zones[i].Dispose(); ! } ! //reset zone array in webpartmanager ! __wpm.zones = new Array(); ! }"; ! CallBackHelper.Write(wpm_Dispose_script); ! ! // Send script to setup webpartmanager drag&drop + webpartmenu's ! CallBackHelper.Write(wpmValue); } } *************** *** 804,812 **** /// Look for javascript generated for draggable webparts (IE only), and returns these javascripts. /// </summary> ! public string GetWebPartManagerScriptValue() { string html = GetHtmlPage(); ! string searchWPManager = "<script type=\"text\\/javascript\">\\r\\n\\r\\n(?<WPManagerScript>__wpm = new WebPartManager\\(\\);.*?)<\\/script>"; Regex regExWPManager = new Regex(searchWPManager, RegexOptions.Singleline | RegexOptions.Compiled); Match match = regExWPManager.Match(html); --- 837,846 ---- /// Look for javascript generated for draggable webparts (IE only), and returns these javascripts. /// </summary> ! public string GetWebPartManagerScriptValue(string formID) { string html = GetHtmlPage(); ! // Look for webpartmanager object creation script ! string searchWPManager = "<script type=\"text\\/javascript\">\\r\\n\\r\\n__wpm = new WebPartManager\\(\\);\\r\\n(?<WPManagerScript>.*?)<\\/script>"; Regex regExWPManager = new Regex(searchWPManager, RegexOptions.Singleline | RegexOptions.Compiled); Match match = regExWPManager.Match(html); *************** *** 816,823 **** return null; ! StringBuilder wpmScript = new StringBuilder(match.Groups["WPManagerScript"].Value); ! wpmScript.AppendLine(); ! // Now look for webpart menu scripts string searchWPMenus = "<script type=\"text\\/javascript\">\\r\\n(?<MenuScript>var menuWebPart_.*?)<\\/script>"; Regex regExMenuScripts = new Regex(searchWPMenus, RegexOptions.Singleline | RegexOptions.Compiled); --- 850,872 ---- return null; ! // Stringbuilder to hold the output script ! StringBuilder wpmScript = new StringBuilder(); ! // First look for hidden drag element (if not exists : add this to page) ! string searchDragElm = "<div id=\"(?<DragElmId>.+?___Drag)\" style=\"display:none.+?><\\/div>"; ! Regex regExDragElm = new Regex(searchDragElm, RegexOptions.Multiline | RegexOptions.Compiled); ! Match matchDragElm = regExDragElm.Match(html); ! if (matchDragElm.Success) ! { ! //add this element to the html page, if it didn't exist ! string elmID = matchDragElm.Groups["DragElmId"].Value; ! wpmScript.AppendLine(string.Format("if (document.getElementById('{0}') == null)", elmID)); ! wpmScript.AppendLine(string.Format(" AJAXCbo.AddElementScript('{0}','span','__DragHolder',{1},'null');", formID, CallBackHelper.EncodeString(matchDragElm.Value))); ! } ! ! // Now append the WebpartManager script ! wpmScript.AppendLine(match.Groups["WPManagerScript"].Value); ! ! // Now append the webpart menu scripts string searchWPMenus = "<script type=\"text\\/javascript\">\\r\\n(?<MenuScript>var menuWebPart_.*?)<\\/script>"; Regex regExMenuScripts = new Regex(searchWPMenus, RegexOptions.Singleline | RegexOptions.Compiled); |
From: Dion O. <dol...@us...> - 2005-11-14 16:12:05
|
Update of /cvsroot/magicajax/magicajax/Examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27833/magicajax/Examples Modified Files: AjaxWebParts.aspx Log Message: Some fixes for supporting ASP.NET 2.0 WebParts Index: AjaxWebParts.aspx =================================================================== RCS file: /cvsroot/magicajax/magicajax/Examples/AjaxWebParts.aspx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AjaxWebParts.aspx 11 Nov 2005 22:29:39 -0000 1.1 --- AjaxWebParts.aspx 14 Nov 2005 16:11:56 -0000 1.2 *************** *** 11,15 **** <h4>MagicAjax .NET 2.0 Webpart Examples</h4> <form id="form1" runat="server"> ! <asp:WebPartManager ID="Webpartmanager1" runat="server" Personalization-Enabled="true" /> <span style="float:right"><asp:Button runat="server" Text="Regular PostBack" /></span> --- 11,15 ---- <h4>MagicAjax .NET 2.0 Webpart Examples</h4> <form id="form1" runat="server"> ! <asp:WebPartManager ID="wpm" runat="server" Personalization-Enabled="true" /> <span style="float:right"><asp:Button runat="server" Text="Regular PostBack" /></span> *************** *** 17,20 **** --- 17,21 ---- <h5>1. WebPart demo</h5> <cc1:ajaxpanel ID="Ajaxpanel1" runat="server"> + <asp:Button runat="server" id="Toggle" Text="Switch to EditMode" OnClick="Toggle_Click" /> <table><tr><td> <asp:WebPartZone runat="server" ID="WebPartZone1"> *************** *** 55,60 **** if (!IsPostBack) { - //put page in design mode - Webpartmanager1.DisplayMode = WebPartManager.CatalogDisplayMode; ((GenericWebPart)Calendar1.Parent).Title = "Calendar1"; ((GenericWebPart)Calendar2.Parent).Title = "Calendar2"; --- 56,59 ---- *************** *** 62,64 **** --- 61,76 ---- } + protected void Toggle_Click(object sender, EventArgs e) + { + if (wpm.DisplayMode == WebPartManager.BrowseDisplayMode) + { + Toggle.Text = "Switch to ViewMode"; + wpm.DisplayMode = WebPartManager.CatalogDisplayMode; + } + else + { + Toggle.Text = "Switch to EditMode"; + wpm.DisplayMode = WebPartManager.BrowseDisplayMode; + } + } </script> |
From: Dion O. <dol...@us...> - 2005-11-11 22:29:47
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30820/magicajax/Core Modified Files: MagicAjax NET 2.0.csproj MagicAjaxModule.cs Log Message: Added support for ASP.NET 2.0 Portal Framework Index: MagicAjax NET 2.0.csproj =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjax NET 2.0.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MagicAjax NET 2.0.csproj 11 Nov 2005 06:17:49 -0000 1.1 --- MagicAjax NET 2.0.csproj 11 Nov 2005 22:29:39 -0000 1.2 *************** *** 143,172 **** <SubType>ASPXCodeBehind</SubType> </Compile> - <Compile Include="UI\Controls\AjaxCascadeTable.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="UI\Controls\AjaxLinkedPanelListControl.cs"> - <SubType>Code</SubType> - </Compile> <Compile Include="UI\Controls\AjaxPanel.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="UI\Controls\AjaxTabbedPanel.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="UI\Design\AjaxCascadeTableDesigner.cs"> - <SubType>Code</SubType> - </Compile> <Compile Include="UI\Design\AjaxPanelDesigner.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="UI\Design\AjaxTabbedPanelDesigner.cs"> - <SubType>Code</SubType> - </Compile> <Compile Include="UI\RenderedByScriptControl.cs"> <SubType>Code</SubType> </Compile> - <Content Include="Examples\Examples.aspx" /> - <Content Include="script\AjaxLinkedPanelListScripts.js" /> <Content Include="Web.config" /> <EmbeddedResource Include="script\CallBackObject.js" /> --- 143,155 ---- Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MagicAjaxModule.cs 11 Nov 2005 06:17:49 -0000 1.1 --- MagicAjaxModule.cs 11 Nov 2005 22:29:39 -0000 1.2 *************** *** 431,434 **** --- 431,454 ---- } + #if NET_2_0 + // Check if this request is to add/remove/replace a WebPart + // If so, send back updated WebPartManager drag&drop javascript (IE only) + if (!string.IsNullOrEmpty(_form["__EVENTTARGET"]) && !string.IsNullOrEmpty(_form["__EVENTARGUMENT"])) + { + Control webPartControl = requestPage.FindControl(_form["__EVENTTARGET"]); + if ((webPartControl is System.Web.UI.WebControls.WebParts.WebPartZone && (_form["__EVENTARGUMENT"].StartsWith("delete:") || _form["__EVENTARGUMENT"].StartsWith("Drag:") || _form["__EVENTARGUMENT"].StartsWith("close:"))) + || (webPartControl is System.Web.UI.WebControls.WebParts.CatalogZone && _form["__EVENTARGUMENT"] == "add")) + { + string wpmValue = _filter.GetWebPartManagerScriptValue(); + if (wpmValue != null) + { + // Send script to dispose current webpartmanager + CallBackHelper.Write("if (typeof(WebPartManager_Dispose) == 'function'){WebPartManager_Dispose();}\r\n"); + // Send script to setup webpartmanager drag&drop + webpartmenu's + CallBackHelper.Write(wpmValue); + } + } + } + #endif CallBackHelper.End(); } *************** *** 761,764 **** --- 781,785 ---- public string GetViewStateFieldValue() { + //TODO: use regular expression (much faster) #if NET_2_0 string search = "<input type=\"hidden\" name=\"__VIEWSTATE\" id=\"__VIEWSTATE\" value=\""; *************** *** 779,790 **** } public string GetHtmlPage() { ! byte[] buffer = new byte[_memStream.Length]; ! _memStream.Position = 0; ! _memStream.Read (buffer, 0, (int)_memStream.Length); ! return HttpContext.Current.Response.ContentEncoding.GetString(buffer); } --- 800,848 ---- } + #if NET_2_0 + /// <summary> + /// Look for javascript generated for draggable webparts (IE only), and returns these javascripts. + /// </summary> + public string GetWebPartManagerScriptValue() + { + string html = GetHtmlPage(); + + string searchWPManager = "<script type=\"text\\/javascript\">\\r\\n\\r\\n(?<WPManagerScript>__wpm = new WebPartManager\\(\\);.*?)<\\/script>"; + Regex regExWPManager = new Regex(searchWPManager, RegexOptions.Singleline | RegexOptions.Compiled); + Match match = regExWPManager.Match(html); + + // If no webpartmanager script exists in html -> exit + if (!match.Success) + return null; + + StringBuilder wpmScript = new StringBuilder(match.Groups["WPManagerScript"].Value); + wpmScript.AppendLine(); + + // Now look for webpart menu scripts + string searchWPMenus = "<script type=\"text\\/javascript\">\\r\\n(?<MenuScript>var menuWebPart_.*?)<\\/script>"; + Regex regExMenuScripts = new Regex(searchWPMenus, RegexOptions.Singleline | RegexOptions.Compiled); + MatchCollection matches = regExMenuScripts.Matches(html); //ei + for (int i=0; i<matches.Count; i++) + { + wpmScript.AppendLine(matches[i].Groups["MenuScript"].Value); + } + + return wpmScript.ToString(); + } + #endif + + private string _htmlPage; public string GetHtmlPage() { ! if (_htmlPage == null) ! { ! byte[] buffer = new byte[_memStream.Length]; ! _memStream.Position = 0; ! _memStream.Read(buffer, 0, (int)_memStream.Length); ! _htmlPage = HttpContext.Current.Response.ContentEncoding.GetString(buffer); ! } ! return _htmlPage; } |
From: Dion O. <dol...@us...> - 2005-11-11 22:29:47
|
Update of /cvsroot/magicajax/magicajax/Core/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30820/magicajax/Core/script Modified Files: CallBackObject.js Log Message: Added support for ASP.NET 2.0 Portal Framework Index: CallBackObject.js =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/script/CallBackObject.js,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CallBackObject.js 11 Nov 2005 06:17:49 -0000 1.1 --- CallBackObject.js 11 Nov 2005 22:29:39 -0000 1.2 *************** *** 159,174 **** // Checks the unique id and its parents until it finds a target element ! // i.e. for ajaxPanel_grid:_ctl1:_ctl0 it checks ! // ajaxPanel_grid:_ctl1:_ctl0 ! // ajaxPanel_grid:_ctl1 ! // ajaxPanel_grid ! // ajaxPanel for (var num=ids.length; num > 0; num--) { var elemID = ""; for (var i=0; i < num; i++) ! elemID += "_" + ids[i]; - elemID = elemID.substring(1, elemID.length); target = document.getElementById(elemID); if (target != null) --- 159,172 ---- // Checks the unique id and its parents until it finds a target element ! // i.e. for ajaxPanel_grid:row:field it checks ! // ajaxPanel_grid_row_field ! // ajaxPanel_grid_row ! // ajaxPanel_grid for (var num=ids.length; num > 0; num--) { var elemID = ""; for (var i=0; i < num; i++) ! elemID += (i==0 ? "" : "_") + ids[i]; target = document.getElementById(elemID); if (target != null) *************** *** 177,181 **** var cbType = AJAXCbo.GetCallBackType(target); - if (cbType != "none") { --- 175,178 ---- *************** *** 258,266 **** for (var j=0; j < theform.elements[i].options.length; j++) if (theform.elements[i].options[j].selected) ! theData = theData + escape(eName.split("$").join(":")) + '=' + encodeURIComponent(theform.elements[i].options[j].value) + '&'; } else if ( (type != "checkbox" && type != "radio") || theform.elements[i].checked ) { ! theData = theData + escape(eName.split("$").join(":")) + '=' + val; if( i != theform.elements.length - 1 ) theData = theData + '&'; --- 255,263 ---- for (var j=0; j < theform.elements[i].options.length; j++) if (theform.elements[i].options[j].selected) ! theData = theData + escape(eName) + '=' + encodeURIComponent(theform.elements[i].options[j].value) + '&'; } else if ( (type != "checkbox" && type != "radio") || theform.elements[i].checked ) { ! theData = theData + escape(eName) + '=' + val; if( i != theform.elements.length - 1 ) theData = theData + '&'; |
From: Dion O. <dol...@us...> - 2005-11-11 22:29:47
|
Update of /cvsroot/magicajax/magicajax/Examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30820/magicajax/Examples Added Files: AjaxWebParts.aspx Log Message: Added support for ASP.NET 2.0 Portal Framework --- NEW FILE: AjaxWebParts.aspx --- <%@ Page language="c#" %> <%@ Register TagPrefix="cc1" Namespace="MagicAjax.UI.Controls" Assembly="MagicAjax" %> <html> <head> <title>MagicAjax .NET 2.0 Webpart Examples</title> <style type="text/css"> body { font-size: small; font-family: verdana } </style> </head> <body> <h4>MagicAjax .NET 2.0 Webpart Examples</h4> <form id="form1" runat="server"> <asp:WebPartManager ID="Webpartmanager1" runat="server" Personalization-Enabled="true" /> <span style="float:right"><asp:Button runat="server" Text="Regular PostBack" /></span> <hr /> <h5>1. WebPart demo</h5> <cc1:ajaxpanel ID="Ajaxpanel1" runat="server"> <table><tr><td> <asp:WebPartZone runat="server" ID="WebPartZone1"> <PartTitleStyle CssClass="WebPartTitle" BackColor="LightBlue" ForeColor="Black" /> <ZoneTemplate> <asp:Calendar runat="server" ID="Calendar1"></asp:Calendar> </ZoneTemplate> </asp:WebPartZone> </td><td> <asp:WebPartZone runat="server" ID="WebPartZone2"> <PartTitleStyle CssClass="WebPartTitle" BackColor="LightBlue" ForeColor="Black" /> <ZoneTemplate> <asp:Calendar runat="server" ID="Calendar2"></asp:Calendar> </ZoneTemplate> </asp:WebPartZone> </td><td> <asp:CatalogZone ID="CatalogZone1" runat="server"> <ZoneTemplate> <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" /> <asp:ImportCatalogPart Visible="true" ID="ImportCatalogPart1" runat="server" /> <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1" runat="server" Title="Catalog"> <WebPartsTemplate> <asp:Calendar ID="cal" runat="server" /> </WebPartsTemplate> </asp:DeclarativeCatalogPart> </ZoneTemplate> </asp:CatalogZone> </td></tr></table> </cc1:ajaxpanel> </form> </body> </html> <script language="C#" runat="server"> private void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //put page in design mode Webpartmanager1.DisplayMode = WebPartManager.CatalogDisplayMode; ((GenericWebPart)Calendar1.Parent).Title = "Calendar1"; ((GenericWebPart)Calendar2.Parent).Title = "Calendar2"; } } </script> |
From: Dion O. <dol...@us...> - 2005-11-11 08:32:05
|
Update of /cvsroot/magicajax/MagicAjax NET 1.1/UI/Design In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30416/MagicAjax NET 1.1/UI/Design Removed Files: AjaxCascadeTableDesigner.cs AjaxPanelDesigner.cs AjaxTabbedPanelDesigner.cs Log Message: Removed the old MagicAjax NET 1.1 module --- AjaxTabbedPanelDesigner.cs DELETED --- --- AjaxCascadeTableDesigner.cs DELETED --- --- AjaxPanelDesigner.cs DELETED --- |
From: Dion O. <dol...@us...> - 2005-11-11 08:32:05
|
Update of /cvsroot/magicajax/MagicAjax NET 1.1/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30416/MagicAjax NET 1.1/UI/Controls Removed Files: AjaxCascadeTable.cs AjaxLinkedPanelListControl.cs AjaxPanel.cs AjaxTabbedPanel.cs Log Message: Removed the old MagicAjax NET 1.1 module --- AjaxTabbedPanel.cs DELETED --- --- AjaxLinkedPanelListControl.cs DELETED --- --- AjaxCascadeTable.cs DELETED --- --- AjaxPanel.cs DELETED --- |
From: Dion O. <dol...@us...> - 2005-11-11 08:32:05
|
Update of /cvsroot/magicajax/MagicAjax NET 1.1/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30416/MagicAjax NET 1.1/UI Removed Files: AjaxControl.cs AjaxPage.cs AjaxUserControl.cs RenderedByScriptControl.cs Log Message: Removed the old MagicAjax NET 1.1 module --- AjaxUserControl.cs DELETED --- --- AjaxPage.cs DELETED --- --- AjaxControl.cs DELETED --- --- RenderedByScriptControl.cs DELETED --- |
From: Dion O. <dol...@us...> - 2005-11-11 08:32:05
|
Update of /cvsroot/magicajax/MagicAjax NET 1.1/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30416/MagicAjax NET 1.1/script Removed Files: AjaxLinkedPanelListScripts.js CallBackObject.js Log Message: Removed the old MagicAjax NET 1.1 module --- CallBackObject.js DELETED --- --- AjaxLinkedPanelListScripts.js DELETED --- |
From: Dion O. <dol...@us...> - 2005-11-11 08:32:05
|
Update of /cvsroot/magicajax/MagicAjax NET 1.1/Interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30416/MagicAjax NET 1.1/Interfaces Removed Files: ICallBackEventHandler.cs IFormDataLoadedEventHandler.cs IPreWriteScriptEventHandler.cs IScriptWriter.cs Log Message: Removed the old MagicAjax NET 1.1 module --- ICallBackEventHandler.cs DELETED --- --- IFormDataLoadedEventHandler.cs DELETED --- --- IPreWriteScriptEventHandler.cs DELETED --- --- IScriptWriter.cs DELETED --- |
From: Dion O. <dol...@us...> - 2005-11-11 08:32:04
|
Update of /cvsroot/magicajax/MagicAjax NET 1.1/Examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30416/MagicAjax NET 1.1/Examples Removed Files: Examples.aspx Log Message: Removed the old MagicAjax NET 1.1 module --- Examples.aspx DELETED --- |
From: Dion O. <dol...@us...> - 2005-11-11 08:32:04
|
Update of /cvsroot/magicajax/MagicAjax NET 1.1/Collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30416/MagicAjax NET 1.1/Collections Removed Files: ReadOnlyArrayList.cs Log Message: Removed the old MagicAjax NET 1.1 module --- ReadOnlyArrayList.cs DELETED --- |
From: Dion O. <dol...@us...> - 2005-11-11 08:32:04
|
Update of /cvsroot/magicajax/MagicAjax NET 1.1/Configuration In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30416/MagicAjax NET 1.1/Configuration Removed Files: MagicAjaxConfiguration.cs MagicAjaxSectionHandler.cs Log Message: Removed the old MagicAjax NET 1.1 module --- MagicAjaxConfiguration.cs DELETED --- --- MagicAjaxSectionHandler.cs DELETED --- |
From: Dion O. <dol...@us...> - 2005-11-11 08:32:03
|
Update of /cvsroot/magicajax/MagicAjax NET 1.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30416/MagicAjax NET 1.1 Removed Files: AssemblyInfo.cs CallBackHelper.cs MagicAjax NET 2.0.csproj MagicAjax.csproj MagicAjaxException.cs MagicAjaxModule.cs NoVerifyRenderingPage.cs StoredPageInfo.cs Web.config license.txt Log Message: Removed the old MagicAjax NET 1.1 module --- NoVerifyRenderingPage.cs DELETED --- --- CallBackHelper.cs DELETED --- --- MagicAjaxException.cs DELETED --- --- MagicAjax NET 2.0.csproj DELETED --- --- MagicAjax.csproj DELETED --- --- AssemblyInfo.cs DELETED --- --- StoredPageInfo.cs DELETED --- --- Web.config DELETED --- --- license.txt DELETED --- --- MagicAjaxModule.cs DELETED --- |
From: Argiris K. <be...@us...> - 2005-11-11 06:17:59
|
Update of /cvsroot/magicajax/magicajax/CustomControls/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6302/CustomControls/script Added Files: AjaxLinkedPanelListScripts.js Log Message: Put source files to module 'magicajax' divided in directories Core, Examples, and CustomControls. --- NEW FILE: AjaxLinkedPanelListScripts.js --- var prev_AJAXCbo_Complete = AJAXCbo.OnComplete; var prev_AJAXCbo_Error = AJAXCbo.OnError; AJAXCbo.OnComplete = AjaxLinkedPanelList_AJAXCbo_Complete; AJAXCbo.OnError = AjaxLinkedPanelList_AJAXCbo_Error; function AjaxLinkedPanelList_AJAXCbo_Complete(responseText, responseXML) { var result = prev_AJAXCbo_Complete(responseText, responseXML); if (result == false) return false; RemoveLoadingImages(); var selval = document.all.AJAXLINKEDPANELLIST_SELECTION.value; if (selval != "") { var selections = selval.split(";"); for (var i=0; i < selections.length; i++) { var panel = document.getElementById(selections[i]); if (panel != null) { // Xreiazetai giati an mia epilogi ginei abort meta den te8ei to loaded apo ton server panel.setAttribute("loadedstatus", "loaded"); HighlightLinkOfPanel(panel); } } } return true; } function AjaxLinkedPanelList_AJAXCbo_Error(status, statusText, responseText) { RemoveLoadingImages(); prev_AJAXCbo_Error(status, statusText, responseText); } function AjaxLinkedPanelList_Link_Click(linkTarget) { RemoveLoadingImages(); var link = document.getElementById(linkTarget.split(":").join("_")); var panel = document.getElementById(link.getAttribute("panelid")); var loadstatus = panel.getAttribute("loadedstatus"); if (loadstatus != "loaded") { ShowPanelLoadingImage(panel); ShowSelectedPanel(panel); AJAXCbo.DoCallBack(linkTarget, "", "async"); } else { if (panel.style.display == "") { // Einai idi epilegmeno, kripsto panel.style.display = "none"; var parent = panel.getAttribute("parent"); var store = document.getElementById(parent + "$ajaxstore"); var linkClass = store.getAttribute("linkClass"); document.getElementById(panel.getAttribute("linkid")).className = linkClass; } else { ShowSelectedPanel(panel); } } } function ShowSelectedPanel(panel) { var parent = panel.getAttribute("parent"); var store = document.getElementById(parent + "$ajaxstore"); var linkClass = store.getAttribute("linkClass"); var tags = document.getElementsByTagName(panel.tagName); var panels = new Array(); for (var i=0; i < tags.length; i++) if (tags[i].getAttribute("name") == "LPL_AjaxPanel") panels.push(tags[i]); for (var i=0; i < panels.length; i++) if (panels[i].getAttribute("parent") == parent) { panels[i].style.display = "none"; document.getElementById(panels[i].getAttribute("linkid")).className = linkClass; } panel.style.display = ""; HighlightLinkOfPanel(panel); var selections = ""; for (var i=0; i < panels.length; i++) if (panels[i].getAttribute("loadedstatus") == "loaded" && panels[i].style.display == "") { selections += panels[i].id + ";"; } selections += panel.id; document.all.AJAXLINKEDPANELLIST_SELECTION.value = selections; } function HighlightLinkOfPanel(panel) { var parent = panel.getAttribute("parent"); var store = document.getElementById(parent + "$ajaxstore"); var selectedLinkClass = store.getAttribute("selectedLinkClass"); if (selectedLinkClass != "") document.getElementById(panel.getAttribute("linkid")).className = selectedLinkClass; } function ShowPanelLoadingImage(panel) { var store = document.getElementById(panel.getAttribute("parent") + "$ajaxstore"); var imgsrc = store.getAttribute("loadingimg"); if (imgsrc != "") panel.innerHTML = "<img src='" + imgsrc + "' name='AJAX_LOADING_IMAGE'>"; } function RemoveLoadingImages() { for (var i=0; i < document.images.length; i++) { if (document.images[i].name == "AJAX_LOADING_IMAGE") { document.images[i].parentNode.removeChild(document.images[i]); i--; } } } |
From: Argiris K. <be...@us...> - 2005-11-11 06:17:59
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6302/Core/UI/Controls Added Files: AjaxPanel.cs Log Message: Put source files to module 'magicajax' divided in directories Core, Examples, and CustomControls. --- NEW FILE: AjaxPanel.cs --- #region LGPL License /* MagicAjax Library Copyright (C) 2005 MagicAjax Project Team This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #endregion using System; using System.ComponentModel; using System.Collections; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; namespace MagicAjax.UI.Controls { /// <summary> /// Defines the CallBack connection types. /// </summary> public enum CallBackConnectionType { /// <summary> /// Client will not invoke a CallBack /// </summary> None, /// <summary> /// Asynchronous CallBack /// </summary> Asynchronous, /// <summary> /// Synchronous CallBack /// </summary> Synchronous } /// <summary> /// Works like Panel but the controls it contains are rendered on the page by sending /// javascript to the client. /// </summary> /// <remarks> /// The main control that makes all the hard work for seamless AJAXing. It spots /// controls that are added, removed or altered, and sends the appropriate javascript /// for the refreshing of the page. In case it contains a RenderedByScriptControl, it /// ignores it and lets the RenderedByScriptControl to produce the appropriate javascript /// for its appearance. /// /// If an AjaxPanel (parent) contains another AjaxPanel (child), and a control /// of the child-AjaxPanel is altered, parent-AjaxPanel won't send the entire html /// rendering of the child-AjaxPanel, but instead the child-AjaxPanel will send only /// the html of the altered control. Thus, the size of javascript code that the client /// gets as a response of a callback, is greatly reduced. /// /// It is not necessary to put all the controls of the page inside an AjaxPanel. Only /// the controls that are going to be refreshed on the client using javascript are /// required to be contained within an AjaxPanel. /// </remarks> [Designer("MagicAjax.UI.Design.AjaxPanelDesigner, MagicAjax"), ParseChildrenAttribute(false), PersistChildren(true), ToolboxData("<{0}:AjaxPanel runat=server>AjaxPanel</{0}:AjaxPanel>")] public class AjaxPanel : RenderedByScriptControl, IFormDataLoadedEventHandler, INamingContainer { #region Fields private CallBackConnectionType _callBackConnection = CallBackConnectionType.Asynchronous; private ArrayList _addedControls = new ArrayList(); private ArrayList _removedControls = new ArrayList(); private Hashtable _controlHtmls = new Hashtable(); private NoVerifyRenderingPage _noVerifyPage = new NoVerifyRenderingPage(); private ControlCollectionState _controlState = new ControlCollectionState(); #endregion #region Constructor /// <summary> /// Creates an instance of a RenderedByScriptControl with the Span tagName. /// </summary> /// <remarks> /// AjaxPanel uses Span instead of Div, because ASP.NET translates Div to a /// table if the browser is Firefox. /// </remarks> public AjaxPanel() : base(HtmlTextWriterTag.Span) { } #endregion #region Properties #region CallBackConnection /// <summary> /// Defines the connection type (a/synchronous) that will be utilized for a CallBack. /// Default is CallBackConnectionType.Asynchronous. /// </summary> public CallBackConnectionType CallBackConnection { get { return _callBackConnection; } set { _callBackConnection = value; switch (_callBackConnection) { case CallBackConnectionType.None: this.Attributes.Remove ("CallBack"); break; case CallBackConnectionType.Asynchronous: this.Attributes["CallBack"] = "async"; break; case CallBackConnectionType.Synchronous: this.Attributes["CallBack"] = "sync"; break; } } } #endregion #endregion #region Public Methods #region RaiseFormDataLoadedEvent /// <summary> /// Caches the html rendering of the post data changed controls that belong to /// the AjaxPanel. /// </summary> /// <remarks> /// If a child control is altered by post data, AjaxPanel will send the javascript /// to refresh the control on the page, but it is unnecessary because the control /// on the form doesn't need refreshing. /// This method caches the new html rendering of the controls that received /// new post data so that the AjaxPanel doesn't think that they were altered. /// /// Called by MagicAjaxModule. /// </remarks> public virtual void RaiseFormDataLoadedEvent(MagicAjax.Collections.ReadOnlyArrayList changedControls) { ArrayList dirtyControls = new ArrayList(); for (int i=0; i < changedControls.Count; i++) { Control control = (Control) changedControls[i]; // The top parent of this control that belongs to this AjaxPanel Control panelChild = FindTopPanelChildOfControl(control); if (panelChild != null) { dirtyControls.Add (panelChild); } } if (dirtyControls.Count == 0) return; DisableVerifyRendering (true); System.Text.StringBuilder sb = new System.Text.StringBuilder(); HtmlTextWriter litewriter = new HtmlTextWriter(new System.IO.StringWriter(sb)); for (int i=0; i < dirtyControls.Count; i++) { Control control = (Control) dirtyControls[i]; ExtendedRenderControl (control, litewriter); _controlHtmls[control] = sb.ToString(); sb.Length = 0; } DisableVerifyRendering (false); } #endregion #region Clear /// <summary> /// It removes the child controls of the AjaxPanel without producing the /// appropriate javascript to refresh the page at the client. /// </summary> public void Clear() { Controls.Clear(); _addedControls.Clear(); _removedControls.Clear(); _controlHtmls.Clear(); } #endregion #endregion #region Protected Methods #region override OnLoad protected override void OnLoad(EventArgs e) { base.OnLoad (e); // Enable validation if there is at least one validator. _noVerifyPage.EnableValidation = (Page.Validators.Count > 0); if (this.Attributes["CallBack"] == null) { // To set the appropriate "CallBack" attribute. this.CallBackConnection = this._callBackConnection; } } #endregion #region override AddedControl /// <summary> /// Adds the control to the added controls collection. /// </summary> /// <param name="control"></param> /// <param name="index"></param> protected override void AddedControl(Control control, int index) { _addedControls.Add (control); base.AddedControl (control, index); } #endregion #region override RemovedControl /// <summary> /// Adds the control to the removed controls collection. /// </summary> /// <param name="control"></param> /// <param name="index"></param> protected override void RemovedControl(Control control) { if (_addedControls.Contains(control)) _addedControls.Remove (control); else _removedControls.Add (control); base.RemovedControl (control); } #endregion #region override RenderChildren /// <summary> /// Does a normal rendering of the child controls. /// </summary> /// <remarks> /// Each child control is contained inside a Span tag with unique id so that /// it can be easily manipulated apart from the other child controls. /// </remarks> /// <param name="writer"></param> protected override void RenderChildren(HtmlTextWriter writer) { if ( CallBackHelper.IsCallBack && IsPageNoStoreMode ) { LoadControlState(); DoScriptRendering (writer); } else { DisableVerifyRendering (true); System.Text.StringBuilder sbFull = new System.Text.StringBuilder(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); HtmlTextWriter fullwriter = new HtmlTextWriter(new System.IO.StringWriter(sbFull)); HtmlTextWriter litewriter = new HtmlTextWriter(new System.IO.StringWriter(sb)); for (int i=0; i < Controls.Count; i++) { Control con = Controls[i]; writer.WriteBeginTag ("span"); writer.WriteAttribute ("id", GetAjaxElemID(con)); writer.Write (HtmlTextWriter.TagRightChar); ExtendedRenderControl (con, fullwriter, litewriter); writer.Write (sbFull.ToString()); _controlHtmls[con] = sb.ToString(); sbFull.Length = 0; sb.Length = 0; writer.WriteEndTag ("span"); } DisableVerifyRendering (false); _addedControls.Clear(); _removedControls.Clear(); } if ( IsPageNoStoreMode ) SaveControlState(); } #endregion protected virtual void SaveControlState() { _controlState.SetControlIDs (_controlHtmls); _controlState.Save (this.UniqueID); } protected virtual void LoadControlState() { _controlState = ControlCollectionState.LoadState (this.UniqueID); if (_controlState == null) { // State expired Page.Response.Redirect (Page.Request.RawUrl); } // Find new and previous controls _addedControls.Clear(); _controlHtmls.Clear(); foreach (Control con in this.Controls) { if ( _controlState.ControlIDHtmls.ContainsKey(con.ClientID) ) { _controlHtmls[con] = _controlState.ControlIDHtmls[con.ClientID]; } else { _addedControls.Add (con); } } // Find removed controls _removedControls.Clear(); foreach (string clientID in _controlState.ControlIDHtmls.Keys) { int i; for (i=0; i < this.Controls.Count; i++) { if (this.Controls[i].ClientID == clientID) break; } if (i == this.Controls.Count) { // The control is removed. Add a control with the same id // so that DoScriptRendering "removes" it from page if ( clientID.StartsWith (this.ClientID) ) { Literal lit = new Literal(); lit.ID = clientID.Substring(this.ClientID.Length + 1); _removedControls.Add (lit); } } } } #region override RenderByScript protected override void RenderByScript() { DoScriptRendering (new HtmlTextWriter(System.IO.TextWriter.Null)); } #endregion #region DoScriptRendering /// <summary> /// It scans child controls for added, removed or altered controls and sends /// the appropriate javascript to the client. /// </summary> protected virtual void DoScriptRendering (HtmlTextWriter output) { DisableVerifyRendering (true); System.Text.StringBuilder sb = new System.Text.StringBuilder(); HtmlTextWriter litewriter = new HtmlTextWriter(new System.IO.StringWriter(sb)); System.Text.StringBuilder sbFull = new System.Text.StringBuilder(); HtmlTextWriter fullwriter = new HtmlTextWriter(new System.IO.StringWriter(sbFull)); bool allControlsAreNew = (Controls.Count == _addedControls.Count); if ( ! this.IsRenderedOnPage || allControlsAreNew ) { // Render all the controls in a single html rendering. for (int i=0; i < Controls.Count; i++) { Control con = Controls[i]; fullwriter.WriteBeginTag ("span"); fullwriter.WriteAttribute ("id", GetAjaxElemID(con)); fullwriter.Write (HtmlTextWriter.TagRightChar); ExtendedRenderControl (con, fullwriter, litewriter); fullwriter.WriteEndTag ("span"); _controlHtmls[con] = sb.ToString(); sb.Length = 0; } if (sbFull.Length > 0) { string html = sbFull.ToString(); CallBackHelper.WriteSetHtmlOfElementScript (html, ClientID); output.Write (html); } } else { foreach (Control con in _removedControls) { _controlHtmls.Remove (con); CallBackHelper.WriteRemoveElementScript (ClientID, GetAjaxElemID(con)); } for (int i=0; i < Controls.Count; i++) { Control con = Controls[i]; string html; sbFull.Length = sb.Length = 0; if (_addedControls.Contains(con)) { // It's a new control, create it on the client at the appropriate place. ExtendedRenderControl (con, fullwriter, litewriter); html = sbFull.ToString(); CallBackHelper.WriteAddElementScript (ClientID, "span", GetAjaxElemID(con), html, GetNextExistingElement(i)); output.Write (html); _controlHtmls[con] = sb.ToString(); } else { ExtendedRenderControl (con, output, litewriter); html = sb.ToString(); // If it's html rendering is the same, ignore it. if (html != (string)_controlHtmls[con]) { ExtendedWriteSetHtmlOfElementScript (html, GetAjaxElemID(con)); _controlHtmls[con] = html; } } } } DisableVerifyRendering (false); _addedControls.Clear(); _removedControls.Clear(); } #endregion #endregion #region Private Methods #region ExtendedWriteSetHtmlOfElementScript /// <summary> /// Calls the AJAXCbo.ExtendedSetHtmlOfElementScript function on the client. /// </summary> /// <remarks> /// It's used by RenderByScript method. /// /// AjaxPanel doesn't include RenderedByScriptControl controls in the html rendering, /// to reduce the size of the javascript script sent to clients. /// AJAXCbo.ExtendedSetHtmlOfElementScript finds the RenderedByScriptControl controls /// that are missing from the html rendering, gets them from the page of the client /// and adds them in the appropriate place in the html rendering. /// </remarks> /// <param name="html">The html rendering of the control</param> /// <param name="elementID">The span element id that the control belongs to.</param> private void ExtendedWriteSetHtmlOfElementScript(string html, string elementID) { CallBackHelper.Write( String.Format("AJAXCbo.ExtendedSetHtmlOfElementScript({0},\"{1}\");\r\n", CallBackHelper.EncodeString(html), elementID) ); } #endregion #region ExtendedRenderControl /// <summary> /// It renders the control but without including the html rendering of /// any RenderedByScriptControl controls. /// </summary> /// <remarks> /// It's used by RenderByScript method. /// </remarks> /// <param name="control"></param> /// <param name="litewriter"></param> private void ExtendedRenderControl(Control control, HtmlTextWriter litewriter) { RenderStartEventHandler renderStart = new RenderStartEventHandler(control_RenderStart_Abort); ArrayList list = FindRenderedByScriptControls(control); bool[] visibleProps = new bool[list.Count]; bool[] monitorProps = new bool[list.Count]; for (int i=0; i < list.Count; i++) { RenderedByScriptControl con = (RenderedByScriptControl) list[i]; con.RenderStart += renderStart; visibleProps[i] = con.Visible; monitorProps[i] = con.MonitorVisibilityState; con.MonitorVisibilityState = false; con.Visible = true; } control.RenderControl (litewriter); for (int i=0; i < list.Count; i++) { RenderedByScriptControl con = (RenderedByScriptControl) list[i]; con.RenderStart -= renderStart; con.Visible = visibleProps[i]; con.MonitorVisibilityState = monitorProps[i]; } list.Clear(); } #endregion #region control_RenderStart_Abort /// <summary> /// It's part of the ExtendedRenderControl(Control control) method. It replaces the html rendering /// of a RenderedByScriptControl with a Span tag named "__ajax_rbs". /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void control_RenderStart_Abort(object sender, RenderStartEventArgs e) { RenderedByScriptControl con = (RenderedByScriptControl) sender; e.Writer.Write ("<span id=\"{0}$rbs\" name=\"__ajax_rbs\"><{1} id=\"{0}\"></{1}></span>", con.ClientID, con.GetTagName()); e.AbortRendering = true; } #endregion #region ExtendedRenderControl /// <summary> /// It produces the full rendering of the control and the rendering without /// including the html rendering of any RenderedByScriptControl controls. /// </summary> /// <remarks> /// It's used by RenderByScript method. /// </remarks> /// <param name="control"></param> /// <param name="fullwriter">The writer to use for the full rendering</param> /// <param name="litewriter">The writer to use for the rendering without any RenderedByScriptControl controls</param> private void ExtendedRenderControl(Control control, HtmlTextWriter fullwriter, HtmlTextWriter litewriter) { ExtendedTextWriter extTextWriter = new ExtendedTextWriter(fullwriter, litewriter); RenderStartEventHandler renderStart = new RenderStartEventHandler(extTextWriter.IScriptWriter_RenderStart); EventHandler renderEnd = new EventHandler(extTextWriter.IScriptWriter_RenderEnd); ArrayList list = FindRenderedByScriptControls(control); foreach (RenderedByScriptControl con in list) { con.RenderStart += renderStart; con.RenderEnd += renderEnd; } HtmlTextWriter extwriter = new HtmlTextWriter(extTextWriter); control.RenderControl (extwriter); foreach (RenderedByScriptControl con in list) { con.RenderStart -= renderStart; con.RenderEnd -= renderEnd; } list.Clear(); } #endregion #region DisableVerifyRendering /// <summary> /// Disables the verify rendering in server form check. /// </summary> /// <remarks> /// It disables the verify rendering in server form check of the controls by /// setting NoVerifyRenderingPage to their Page property. It enables it again /// by setting back the Page of AjaxPanel. /// /// See the remarks of the NoVerifyRenderingPage class. /// </remarks> /// <param name="disable">True to set the NoVerifyRenderingPage, false to set the previous page back</param> private void DisableVerifyRendering(bool disable) { // NoVerifyRenderingPage is used even during normal rendering, // so that ':' is used for Unique ID separator instead of '$', // thus javascript to convert the Unique IDs of the page won't be sent // at the first CallBack. // Try not using DisableVerify at all if it's IsPageNoStoreMode if ( this.IsPageNoStoreMode ) return; Page page = (disable) ? _noVerifyPage : this.Page; for (int i=0; i < Controls.Count; i++) { SetPageForControl(page, Controls[i]); } } #endregion #region SetPageForControl /// <summary> /// Sets the supplied page to the Page property of the supplied control and /// its children. /// </summary> /// <remarks> /// If it encounters a RenderedByScriptControl control, it ignores it. /// /// Called by DisableVerifyRendering. /// </remarks> /// <param name="page"></param> /// <param name="control"></param> private void SetPageForControl(Page page, Control control) { if (!(control is RenderedByScriptControl)) { control.Page = page; for (int i=0; i < control.Controls.Count; i++) SetPageForControl (page, control.Controls[i]); } } #endregion #region FindTopPanelChildOfControl /// <summary> /// It returns the top parent control of the supplied control, that is an immediate /// child of this AjaxPanel. If the supplied control is contained inside another /// AjaxPanel, it returns null. /// </summary> /// <remarks> /// Called by RaiseFormDataLoadedEvent. /// </remarks> /// <param name="control"></param> /// <returns></returns> private Control FindTopPanelChildOfControl(Control control) { if (control.Parent == null) return null; else if (control.Parent == this) return control; else if (control.Parent is AjaxPanel) return null; else return FindTopPanelChildOfControl(control.Parent); } #endregion #region FindRenderedByScriptControls /// <summary> /// It returns an ArrayList of all the RenderedByScriptControl controls that /// the supplied control contains. /// </summary> /// <remarks> /// It's used by the ExtendedRenderControl methods. /// </remarks> /// <param name="control"></param> /// <returns></returns> private ArrayList FindRenderedByScriptControls (Control control) { ArrayList list = new ArrayList(); if (control is RenderedByScriptControl) { list.Add (control); } else if (control.Visible) { for (int i=0; i < control.Controls.Count; i++) list.AddRange (FindRenderedByScriptControls(control.Controls[i])); } return list; } #endregion #region GetNextExistingElement /// <summary> /// It returns the next control that is available at the page of the client /// so that a new control can be added before it. /// </summary> /// <remarks> /// It's used by the RenderByScript method. /// /// It checks to see if the html rendering of the control is stored to determine /// whether the control exists on the page or not. /// </remarks> /// <param name="start">The index position to start searching</param> /// <returns></returns> private string GetNextExistingElement(int start) { for (int i=start+1; i < Controls.Count; i++) { Control con = Controls[i]; if (!_addedControls.Contains(con) && _controlHtmls[con] != null) return GetAjaxElemID(con); } return null; } #endregion #region GetAjaxElemID /// <summary> /// It returns the Span tag id that contains the supplied control. /// </summary> /// <param name="control"></param> /// <returns></returns> private static string GetAjaxElemID(Control control) { return control.ClientID + "$ajaxdest"; } #endregion #endregion #region Private Class ControlCollectionState [Serializable] private class ControlCollectionState { private Hashtable _controlIDHtmls; public static ControlCollectionState LoadState(string panelUniqueID) { return (ControlCollectionState) HttpContext.Current.Session[GetPageKey(panelUniqueID)]; } public static string GetPageKey (string panelUniqueID) { return String.Format("__ControlState_{0}_{1}", HttpContext.Current.Request.RawUrl, panelUniqueID); } public Hashtable ControlIDHtmls { get { return _controlIDHtmls; } } public void SetControlIDs (Hashtable controlHtmls) { _controlIDHtmls.Clear(); foreach (Control con in controlHtmls.Keys) _controlIDHtmls.Add (con.ClientID, (string)controlHtmls[con]); } public void Save(string panelUniqueID) { HttpContext.Current.Session[GetPageKey(panelUniqueID)] = this; } public ControlCollectionState() { _controlIDHtmls = new Hashtable(); } } #endregion #region Private Class ExtendedTextWriter /// <summary> /// It enables simultaneous rendering of full rendering and rendering without /// including the html rendering of any RenderedByScriptControl controls. /// </summary> /// <remarks> /// It's used by ExtendedRenderControl(Control, HtmlTextWriter, HtmlTextWriter). /// </remarks> private class ExtendedTextWriter : System.IO.TextWriter { private HtmlTextWriter fullwriter, litewriter; private bool onlyFullRender = false; public override System.Text.Encoding Encoding { get { return null; } } public void IScriptWriter_RenderStart(object sender, RenderStartEventArgs e) { RenderedByScriptControl con = (RenderedByScriptControl) sender; Write ("<span id=\"{0}$rbs\" name=\"__ajax_rbs\">", con.ClientID); onlyFullRender = true; litewriter.Write ("<{0} id=\"{1}\">", con.GetTagName(), con.ClientID); } public void IScriptWriter_RenderEnd(object sender, System.EventArgs e) { RenderedByScriptControl con = (RenderedByScriptControl) sender; litewriter.Write ("</{0}>", con.GetTagName()); onlyFullRender = false; Write ("</span>"); } public ExtendedTextWriter(HtmlTextWriter fullwriter, HtmlTextWriter litewriter) : base(null) { this.fullwriter = fullwriter; this.litewriter = litewriter; } #region Overrides of TextWriter public override void Write(bool value) { fullwriter.Write (value); if (!onlyFullRender) litewriter.Write (value); } public override void Write(char value) { fullwriter.Write (value); if (!onlyFullRender) litewriter.Write (value); } public override void Write(char[] buffer) { fullwriter.Write (buffer); if (!onlyFullRender) litewriter.Write (buffer); } public override void Write(char[] buffer, int index, int count) { fullwriter.Write (buffer, index, count); if (!onlyFullRender) litewriter.Write (buffer, index, count); } public override void Write(decimal value) { fullwriter.Write (value); if (!onlyFullRender) litewriter.Write (value); } public override void Write(double value) { fullwriter.Write (value); if (!onlyFullRender) litewriter.Write (value); } public override void Write(float value) { fullwriter.Write (value); if (!onlyFullRender) litewriter.Write (value); } public override void Write(int value) { fullwriter.Write (value); if (!onlyFullRender) litewriter.Write (value); } public override void Write(long value) { fullwriter.Write (value); if (!onlyFullRender) litewriter.Write (value); } public override void Write(object value) { fullwriter.Write (value); if (!onlyFullRender) litewriter.Write (value); } public override void Write(string format, object arg0) { fullwriter.Write (format, arg0); if (!onlyFullRender) litewriter.Write (format, arg0); } public override void Write(string format, object arg0, object arg1) { fullwriter.Write (format, arg0, arg1); if (!onlyFullRender) litewriter.Write (format, arg0, arg1); } public override void Write(string format, object arg0, object arg1, object arg2) { fullwriter.Write (format, arg0, arg1, arg2); if (!onlyFullRender) litewriter.Write (format, arg0, arg1, arg2); } public override void Write(string format, params object[] arg) { fullwriter.Write (format, arg); if (!onlyFullRender) litewriter.Write (format, arg); } public override void Write(string value) { fullwriter.Write (value); if (!onlyFullRender) litewriter.Write (value); } public override void Write(uint value) { fullwriter.Write (value); if (!onlyFullRender) litewriter.Write (value); } public override void Write(ulong value) { fullwriter.Write (value); if (!onlyFullRender) litewriter.Write (value); } #endregion } #endregion } } |
From: Argiris K. <be...@us...> - 2005-11-11 06:17:59
|
Update of /cvsroot/magicajax/magicajax/CustomControls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6302/CustomControls Added Files: AssemblyInfo.cs CustomControls.csproj Log Message: Put source files to module 'magicajax' divided in directories Core, Examples, and CustomControls. --- NEW FILE: CustomControls.csproj --- <VisualStudioProject> <CSHARP ProjectType = "Local" ProductVersion = "7.10.3077" SchemaVersion = "2.0" ProjectGuid = "{64881BD6-F5CD-4F35-B0AC-CF08D4FFED17}" > <Build> <Settings ApplicationIcon = "" AssemblyKeyContainerName = "" AssemblyName = "MagicAjax.CustomControls" AssemblyOriginatorKeyFile = "" DefaultClientScript = "JScript" DefaultHTMLPageLayout = "Grid" DefaultTargetSchema = "IE50" DelaySign = "false" OutputType = "Library" PreBuildEvent = "" PostBuildEvent = "" RootNamespace = "MagicAjax" RunPostBuildEvent = "OnBuildSuccess" StartupObject = "" > <Config Name = "Debug" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "DEBUG;TRACE" DocumentationFile = "" DebugSymbols = "true" FileAlignment = "4096" IncrementalBuild = "false" NoStdLib = "false" NoWarn = "" Optimize = "false" OutputPath = "bin\Debug\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> <Config Name = "Release" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "TRACE" DocumentationFile = "" DebugSymbols = "false" FileAlignment = "4096" IncrementalBuild = "false" NoStdLib = "false" NoWarn = "" Optimize = "true" OutputPath = "bin\Release\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> </Settings> <References> <Reference Name = "System" AssemblyName = "System" HintPath = "..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.dll" /> <Reference Name = "System.Data" AssemblyName = "System.Data" HintPath = "..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Data.dll" /> <Reference Name = "System.XML" AssemblyName = "System.XML" HintPath = "..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" /> <Reference Name = "MagicAjax" Project = "{AA715D85-7870-43CD-AC29-67DCA0AF340A}" Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> <Reference Name = "System.Design" AssemblyName = "System.Design" HintPath = "..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Design.dll" /> <Reference Name = "System.Drawing" AssemblyName = "System.Drawing" HintPath = "..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll" /> <Reference Name = "System.Web" AssemblyName = "System.Web" HintPath = "..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Web.dll" /> </References> </Build> <Files> <Include> <File RelPath = "AssemblyInfo.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "script\AjaxLinkedPanelListScripts.js" BuildAction = "Content" /> <File RelPath = "UI\Controls\AjaxCascadeTable.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "UI\Controls\AjaxLinkedPanelListControl.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "UI\Controls\AjaxTabbedPanel.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "UI\Design\AjaxCascadeTableDesigner.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "UI\Design\AjaxTabbedPanelDesigner.cs" SubType = "Code" BuildAction = "Compile" /> </Include> </Files> </CSHARP> </VisualStudioProject> --- NEW FILE: AssemblyInfo.cs --- using System.Reflection; using System.Runtime.CompilerServices; using System.Web.UI; [assembly: TagPrefix( "MagicAjax.UI.Controls", "ajax" )] // // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // [assembly: AssemblyTitle("MagicAjax.NET Custom Controls")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("MagicAjax.NET Project Team")] [assembly: AssemblyProduct("MagicAjax.NET Custom Controls")] [assembly: AssemblyCopyright("© 2005 MagicAjax.NET Project Team")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("0.2.0.*")] // // In order to sign your assembly you must specify a key to use. Refer to the // Microsoft .NET Framework documentation for more information on assembly signing. // // Use the attributes below to control which key is used for signing. // // Notes: // (*) If no key is specified, the assembly is not signed. // (*) KeyName refers to a key that has been installed in the Crypto Service // Provider (CSP) on your machine. KeyFile refers to a file which contains // a key. // (*) If the KeyFile and the KeyName values are both specified, the // following processing occurs: // (1) If the KeyName can be found in the CSP, that key is used. // (2) If the KeyName does not exist and the KeyFile does exist, the key // in the KeyFile is installed into the CSP and used. // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. // When specifying the KeyFile, the location of the KeyFile should be // relative to the project output directory which is // %Project Directory%\obj\<configuration>. For example, if your KeyFile is // located in the project directory, you would specify the AssemblyKeyFile // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework // documentation for more information on this. // [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")] |
From: Argiris K. <be...@us...> - 2005-11-11 06:17:59
|
Update of /cvsroot/magicajax/magicajax/CustomControls/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6302/CustomControls/UI/Controls Added Files: AjaxCascadeTable.cs AjaxLinkedPanelListControl.cs AjaxTabbedPanel.cs Log Message: Put source files to module 'magicajax' divided in directories Core, Examples, and CustomControls. --- NEW FILE: AjaxTabbedPanel.cs --- #region LGPL License /* MagicAjax Library Copyright (C) 2005 MagicAjax Project Team This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #endregion using System; using System.Collections; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.ComponentModel; namespace MagicAjax.UI.Controls { /// <summary> /// Summary description for AjaxCascadeTable. /// </summary> [Designer("MagicAjax.UI.Design.AjaxTabbedPanelDesigner, MagicAjax")] public class AjaxTabbedPanel : AjaxLinkedPanelListControl { private Table _tableTabs = new Table(); private Panel _panelPanels = new Panel(); #region Public Design Properties private int cellPadding; private int cellSpacing; private System.Drawing.Color tabBackColor; [Bindable(false), Category("Appearance"), DefaultValue(0)] public int CellPadding { get { return cellPadding; } set { cellPadding = value; } } [Bindable(false), Category("Appearance"), DefaultValue(0)] public int CellSpacing { get { return cellSpacing; } set { cellSpacing = value; } } [Bindable(false), Category("Appearance")] public System.Drawing.Color TabBackColor { get { return tabBackColor; } set { tabBackColor = value; } } #endregion protected override void CreateChildControls() { _tableTabs.CellPadding = CellPadding; _tableTabs.CellSpacing = CellSpacing; _tableTabs.Width = Width; _tableTabs.BorderWidth = BorderWidth; _panelPanels.Width = Width; _panelPanels.HorizontalAlign = HorizontalAlign.Center; // Ãéá ôá tabs TableRow row = new TableRow(); _tableTabs.Rows.Add (row); Controls.Add (_tableTabs); Controls.Add (_panelPanels); base.CreateChildControls (); } protected override void AddLinkAndPanel(int index, LinkButton link, AjaxPanel panel) { TableCell cell = new TableCell(); cell.BackColor = TabBackColor; cell.HorizontalAlign = HorizontalAlign.Center; cell.Controls.Add (link); _tableTabs.Rows[0].Cells.AddAt (index, cell); _panelPanels.Controls.AddAt (index, panel); } protected override void RemoveLinkAndPanel(int index) { _tableTabs.Rows[0].Cells.RemoveAt (index); _panelPanels.Controls.RemoveAt (index); } } } --- NEW FILE: AjaxLinkedPanelListControl.cs --- #region LGPL License /* MagicAjax Library Copyright (C) 2005 MagicAjax Project Team This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #endregion using System; using System.Collections; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.ComponentModel; namespace MagicAjax.UI.Controls { /// <summary> /// Äåß÷íåé êÜðïéá _links êáé åìöáíßæåé ìüíï ôï AjaxPanel ðïõ áíôéóôïé÷åß óôï link ïðïõ /// Ýêáíå click ï ÷ñÞóôçò. /// </summary> /// <remarks> /// ÐåñéÝ÷åé ôçí âáóéêÞ ëåéôïõñãßá ãéá Ýíá control ðïõ äåß÷íåé êÜðïéá _links êáé /// åìöáíßæåé ìüíï ôï AjaxPanel ðïõ áíôéóôïé÷åß óôï link ïðïõ Ýêáíå click ï ÷ñÞóôçò. /// ¢ëëá controls áñêåß íá ôï êÜíïõí subclass êáé íá õëïðïéÞóïõí ôéò ìåèüäïõò /// AddLinkAndPanel êáé RemoveLinkAndPanel ùóôÝ íá ôïðïèåôÞóïõí ôá _links êáé ôá _panels /// óôçí êáôÜëëçëç èÝóç óôçí óåëßäá. /// </remarks> public abstract class AjaxLinkedPanelListControl : ListControl, IPreWriteScriptEventHandler, INamingContainer { protected abstract void AddLinkAndPanel(int index, LinkButton link, AjaxPanel panel); protected abstract void RemoveLinkAndPanel(int index); private ArrayList _storedItems = new ArrayList(); private ArrayList _panels = new ArrayList(); private ArrayList _links = new ArrayList(); [Browsable(false),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public AjaxPanel SelectedPanel { get { return (this.SelectedIndex != -1) ? (AjaxPanel) _panels[this.SelectedIndex] : null; } } [Browsable(false),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public LinkButton SelectedLink { get { return (this.SelectedIndex != -1) ? (LinkButton) _links[this.SelectedIndex] : null; } } #region Public Design Properties private string loadingImageUrl = ""; private string linkCssClass = ""; private string selectedLinkCssClass = ""; [Bindable(false), Category("Appearance"), DefaultValue("")] public string LoadingImageUrl { get { return loadingImageUrl; } set { loadingImageUrl = value; } } [Bindable(false), Category("Appearance"), DefaultValue("")] public string LinkCssClass { get { return linkCssClass; } set { linkCssClass = value; } } [Bindable(false), Category("Appearance"), DefaultValue("")] public string SelectedLinkCssClass { get { return selectedLinkCssClass; } set { selectedLinkCssClass = value; } } #endregion protected virtual void AddedItem(int index) { ListItem item = Items[index]; LinkButton ajaxLink = new LinkButton(); ajaxLink.Attributes["CallBack"] = "async"; ajaxLink.ID = "link" + index; ajaxLink.Text = item.Text; ajaxLink.CssClass = LinkCssClass; ajaxLink.Click += new EventHandler(ajaxLink_Click); _links.Add (ajaxLink); AjaxPanel ajaxPanel = new AjaxPanel(); ajaxPanel.ID = "panel" + index; ajaxPanel.Attributes.Add ("parent", ClientID); ajaxPanel.Attributes.Add ("name", "LPL_AjaxPanel"); _panels.Add (ajaxPanel); _storedItems.Insert (index, item); this.AddLinkAndPanel (index, ajaxLink, ajaxPanel); ajaxLink.Attributes.Add ("onclick", String.Format("AjaxLinkedPanelList_Link_Click('{0}'); return false;", ajaxLink.UniqueID)); ajaxLink.Attributes.Add ("panelid", ajaxPanel.ClientID); ajaxPanel.Attributes.Add ("linkid", ajaxLink.ClientID); } protected virtual void RemovedItem(int index) { _storedItems.RemoveAt (index); _links.RemoveAt (index); _panels.RemoveAt (index); this.RemoveLinkAndPanel (index); } protected override void OnPreRender(EventArgs e) { if ( !CallBackHelper.IsCallBack ) { // ÐñÝðåé íá ðñïçãåßôáé ç äÞëùóç ôïõ callbackobject.js MagicAjaxModule.Instance.EnableAjaxOnPage(this.Page); if (!Page.IsClientScriptBlockRegistered( "AJAXLINKEDPANELLIST_SCRIPTS" )) { // Provide the location of the script file. string location = "/MagicAjax/script/"; // Create client script block. string includeScript = String.Format("<script language=\"javascript\" src=\"{0}{1}\"></script>", location, "AjaxLinkedPanelListScripts.js"); Page.RegisterClientScriptBlock( "AJAXLINKEDPANELLIST_SCRIPTS", includeScript ); } string selection = ""; if (Page.IsPostBack) selection = Page.Request.Form["AJAXLINKEDPANELLIST_SELECTION"]; Page.RegisterHiddenField("AJAXLINKEDPANELLIST_SELECTION", selection); } base.OnPreRender (e); } protected override void CreateChildControls() { for (int i=0; i < Items.Count; i++) AddedItem (i); // Áðïèçêåýåé ôéò ìåôáâëçôÝò óáí attributes åíüò span Literal store = new Literal(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append ("<span "); sb.Append (String.Format("id='{0}$ajaxstore' ", ClientID)); sb.Append (String.Format("loadingimg='{0}' ", LoadingImageUrl)); sb.Append (String.Format("linkClass='{0}' ", LinkCssClass)); sb.Append (String.Format("selectedLinkClass='{0}' ", SelectedLinkCssClass)); sb.Append ("></span>"); // Öüñôùóå ôçí åéêüíá ùóôÝ ï IE íá ôçí Ý÷åé Ýôïéìç ãéá åìöÜíéóç. // Áëëéþò äåí ôçí öïñôþíåé êáé äåí åìöáíßæåé ôßðïôá. if (LoadingImageUrl != "") { sb.Append (String.Format("<img src='{0}' style='display:none'>", LoadingImageUrl)); } store.Text = sb.ToString(); this.Controls.Add (store); } public void RaisePreWriteScriptEvent() { for (int i=0; i < _storedItems.Count; i++) { int index; for (index=0; index < Items.Count; index++) { if (Items[index] == _storedItems[i]) break; } if (index == Items.Count) RemovedItem (i); } for (int i=0; i < Items.Count; i++) { int index; for (index=0; index < _storedItems.Count; index++) { if (_storedItems[index] == Items[i]) break; } if (index == _storedItems.Count) AddedItem (i); } } protected override void Render(HtmlTextWriter writer) { // Ãéá íá ìçí åìöáíßóåé ôï select input, ôýðùóå ìüíï ôá controls ðïõ ðåñéÝ÷åé base.RenderChildren (writer); } private void ajaxLink_Click(object sender, EventArgs e) { LinkButton ajaxLink = (LinkButton) sender; int index = Int32.Parse(ajaxLink.ID.Replace("link","")); this.SelectedIndex = index; this.SelectedPanel.Clear(); this.SelectedPanel.Attributes["loadedstatus"] = "loaded"; this.OnSelectedIndexChanged(EventArgs.Empty); } } } --- NEW FILE: AjaxCascadeTable.cs --- #region LGPL License /* MagicAjax Library Copyright (C) 2005 MagicAjax Project Team This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #endregion using System; using System.Collections; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.ComponentModel; namespace MagicAjax.UI.Controls { /// <summary> /// Summary description for AjaxCascadeTable. /// </summary> [Designer("MagicAjax.UI.Design.AjaxCascadeTableDesigner, MagicAjax")] public class AjaxCascadeTable : AjaxLinkedPanelListControl { private Table _table = new Table(); #region Public Design Properties private int _cellPadding; private int _cellSpacing; private System.Drawing.Color _itemBackColor; private string _itemCssClass = ""; private string _headerText = ""; private string _headerCssClass = ""; private System.Drawing.Color _headerBackColor; private HorizontalAlign _horizontalAlign; [Bindable(false), Category("Appearance"), DefaultValue(0)] public int CellPadding { get { return _cellPadding; } set { _cellPadding = value; } } [Bindable(false), Category("Appearance"), DefaultValue(0)] public int CellSpacing { get { return _cellSpacing; } set { _cellSpacing = value; } } [Bindable(false), Category("Appearance")] public System.Drawing.Color ItemBackColor { get { return _itemBackColor; } set { _itemBackColor = value; } } [Bindable(false), Category("Appearance"), DefaultValue("")] public string ItemCssClass { get { return _itemCssClass; } set { _itemCssClass = value; } } [Bindable(false), Category("Appearance"), DefaultValue("")] public string HeaderText { get { return _headerText; } set { _headerText = value; } } [Bindable(false), Category("Appearance"), DefaultValue("")] public string HeaderCssClass { get { return _headerCssClass; } set { _headerCssClass = value; } } [Bindable(false), Category("Appearance")] public System.Drawing.Color HeaderBackColor { get { return _headerBackColor; } set { _headerBackColor = value; } } [Bindable(false), Category("Appearance")] public HorizontalAlign HorizontalAlign { get { return _horizontalAlign; } set { _horizontalAlign = value; } } #endregion protected override void CreateChildControls() { _table.CellPadding = CellPadding; _table.CellSpacing = CellSpacing; _table.Width = Width; _table.BorderWidth = BorderWidth; _table.HorizontalAlign = HorizontalAlign; if (HeaderText != "") { // ÖôéÜîå ôïí Header TableRow row = new TableRow(); TableCell cell = new TableCell(); cell.CssClass = HeaderCssClass; cell.Text = HeaderText; cell.BackColor = HeaderBackColor; row.Controls.Add (cell); _table.Controls.Add (row); } Controls.Add (_table); base.CreateChildControls (); } protected override void AddLinkAndPanel(int index, LinkButton link, AjaxPanel panel) { index *= 2; if (HeaderText != "") index++; TableRow row = new TableRow(); TableCell cell = new TableCell(); cell.CssClass = ItemCssClass; cell.BackColor = ItemBackColor; cell.Controls.Add (link); row.Controls.Add (cell); _table.Controls.AddAt (index, row); row = new TableRow(); cell = new TableCell(); cell.Controls.Add (panel); row.Controls.Add (cell); _table.Controls.AddAt (index + 1, row); } protected override void RemoveLinkAndPanel(int index) { index *= 2; if (HeaderText != "") index++; _table.Controls.RemoveAt (index); _table.Controls.RemoveAt (index + 1); } } } |
From: Argiris K. <be...@us...> - 2005-11-11 06:17:59
|
Update of /cvsroot/magicajax/magicajax/Examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6302/Examples Added Files: Examples.aspx Log Message: Put source files to module 'magicajax' divided in directories Core, Examples, and CustomControls. --- NEW FILE: Examples.aspx --- <%@ Page language="c#" %> <%@ Register TagPrefix="cc1" Namespace="MagicAjax.UI.Controls" Assembly="MagicAjax" %> <html> <head> <title>ASP.NET MagicAjax examples</title> <style type="text/css"> body { font-size: small; font-family: verdana } </style> </head> <body> <h4>MagicAjax demo's (.NET version <%= System.Environment.Version %>)</h4> <form id="form1" runat="server"> <span style="float:right"><asp:Button runat="server" Text="Regular PostBack" /></span> <hr /> <h5>1. Simple button showing server time</h5> <cc1:ajaxpanel ID="Ajaxpanel1" runat="server"> <asp:Button runat="server" ID="ShowTime" Text="Show server's date & time" OnClick="ShowTime_Click" /> <asp:Label runat="server" ID="lblShowTime" BackColor="Blue" ForeColor="White" /> </cc1:ajaxpanel> <hr> <h5>2. Master/detail dropdown lists</h5> <cc1:ajaxpanel ID="Ajaxpanel2" runat="server"> Please pick a car: <asp:DropDownList id="brand" runat="server" AutoPostBack="true" OnSelectedIndexChanged="brand_SelectedIndexChanged"> <asp:ListItem>- Select car brand -</asp:ListItem> </asp:DropDownList> <asp:DropDownList id="model" runat="server" AutoPostBack="true" Visible="false" OnSelectedIndexChanged="model_SelectedIndexChanged" /><br /><br /> <asp:Button id="select" runat="server" Text="Select Car" Enabled="false" OnClick="select_Click" /> <asp:Label id="lblSelectedCar" runat="server" /> </cc1:ajaxpanel> <hr> <h5>3. Datagrid (sorting and selecting)</h5> <cc1:ajaxpanel ID="Ajaxpanel3" runat="server"> <asp:DataGrid id="grid" Runat="server" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" BackColor="White" CellPadding="4" AllowSorting="True" PageSize="3" OnSortCommand="grid_SortCommand" OnSelectedIndexChanged="grid_SelectedIndexChanged"> <FooterStyle ForeColor="#330099" BackColor="#FFFFCC"></FooterStyle> <SelectedItemStyle Font-Bold="True" ForeColor="#663399" BackColor="#FFCC66"></SelectedItemStyle> <ItemStyle ForeColor="#330099" BackColor="White"></ItemStyle> <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" BackColor="#990000"></HeaderStyle> <Columns> <asp:ButtonColumn Text="Select" CommandName="Select"></asp:ButtonColumn> </Columns> <PagerStyle HorizontalAlign="Center" ForeColor="#330099" BackColor="#FFFFCC"></PagerStyle> </asp:DataGrid> </cc1:ajaxpanel> </form> </body> </html> <script language="C#" runat="server"> private void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //fill the car brands (example 1) brand.Items.Add("VW"); brand.Items.Add("Mercedes"); brand.Items.Add("Citroen"); //fill datagrid (example 2) FillGrid(); } } /******************/ /* Example 1 code */ /******************/ protected void ShowTime_Click(object sender, EventArgs e) { lblShowTime.Text = DateTime.Now.ToString(); } /******************/ /* Example 2 code */ /******************/ protected void brand_SelectedIndexChanged(object sender, EventArgs e) { model.Items.Clear(); model.Items.Add(new ListItem("- Select car model -", "")); model.Visible = true; select.Enabled = false; switch (brand.SelectedValue) { case "VW": model.Items.Add("Golf"); model.Items.Add("Passat"); model.Items.Add("Beetle"); model.Items.Add("Phaeton"); break; case "Mercedes": model.Items.Add("S Class"); model.Items.Add("E Class"); model.Items.Add("A Class"); model.Items.Add("M Class"); break; case "Citroen": model.Items.Add("C3 Pluriel"); model.Items.Add("C5 Break"); model.Items.Add("C8"); model.Items.Add("Berlingo"); break; default: model.Visible = false; break; } } protected void model_SelectedIndexChanged(object sender, EventArgs e) { select.Enabled = model.SelectedIndex != 0; } protected void select_Click(object sender, EventArgs e) { lblSelectedCar.Text = "You have picked the " + brand.SelectedValue + " " + model.SelectedValue; } /******************/ /* Example 3 code */ /******************/ /// <summary> /// Creates a DataTable and binds to grid /// </summary> private void FillGrid() { //create data System.Data.DataTable dt = new System.Data.DataTable("Person"); dt.Columns.Add("Brand"); dt.Columns.Add("Model"); dt.Rows.Add(new string[] {"BMW", "X3"}); dt.Rows.Add(new string[] {"Citroen", "Berlingo"}); dt.Rows.Add(new string[] {"Fiat", "Punto"}); dt.Rows.Add(new string[] {"Mercedes", "E Class"}); dt.Rows.Add(new string[] {"Opel", "Zafira"}); dt.Rows.Add(new string[] {"Peugeot", "206"}); dt.Rows.Add(new string[] {"Volvo", "V70"}); dt.Rows.Add(new string[] {"VW", "Golf"}); System.Data.DataView dv = dt.DefaultView; //sort data dv.Sort = SortExpression; //bind data grid.DataSource = dv; grid.DataBind(); } /// <summary> /// SortExpression of the grid (stored in ViewState!) /// </summary> private string SortExpression { get { if (ViewState["_grid_SortExpression"] != null) { return (string)ViewState["_grid_SortExpression"]; } else { return "Brand"; //default } } set { ViewState["_grid_SortExpression"] = value; } } private void grid_SortCommand(object source, DataGridSortCommandEventArgs e) { if (SortExpression != e.SortExpression) { grid.SelectedIndex = -1; } SortExpression = e.SortExpression; //refill datagrid FillGrid(); } private void grid_SelectedIndexChanged(object sender, EventArgs e) { //refill datagrid FillGrid(); } </script> |
From: Argiris K. <be...@us...> - 2005-11-11 06:17:59
|
Update of /cvsroot/magicajax/magicajax/Core/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6302/Core/script Added Files: CallBackObject.js Log Message: Put source files to module 'magicajax' divided in directories Core, Examples, and CustomControls. --- NEW FILE: CallBackObject.js --- __AJAXCboList = new Array(); __bPageIsStored = false; __PreviousOnFormSubmit = null; __PreviousPostBack = null; __PreviousOnPageLoad = null; __PreviousOnPageBeforeUnload = null; __PreviousOnPageUnload = null; function CallBackObject() { this.Init(); } CallBackObject.prototype.Init = function() { this.XmlHttp = this.GetHttpObject(); } CallBackObject.prototype.GetHttpObject = function() { var xmlhttp; /*@cc_on @if (@_jscript_version >= 5) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @else xmlhttp = false; @end @*/ if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } } return xmlhttp; } CallBackObject.prototype.GetCallBackType = function(element) { if (element == null) return "none"; var attrib = element.getAttribute("CallBack"); if (attrib != null) return attrib.toLowerCase(); if (element.parentNode == null || element.parentNode == document.body) return "none"; else return this.GetCallBackType(element.parentNode); } CallBackObject.prototype.HookCallBack = function(bPageIsStored) { __PreviousOnFormSubmit = document.forms[0].onsubmit; document.forms[0].onsubmit = this.OnFormSubmit; if (typeof __doPostBack != 'undefined') { __PreviousPostBack = __doPostBack; __doPostBack = this.DoPostBack; } if (typeof(RBS_Controls) != "undefined") { for (var i=0; i < RBS_Controls.length; i++) RBS_Controls_Store[i].setAttribute("ExcludeFromPost", "true"); } __PreviousOnPageLoad = window.onload; window.onload = function() { // Restore the html of RenderedByScript controls if (typeof(RBS_Controls) != "undefined") { for (var i=0; i < RBS_Controls.length; i++) { var html = RBS_Controls_Store[i].value; if (html != "") { AJAXCbo.RestoreHtml(RBS_Controls[i], decodeURIComponent(html.substring(5, html.length))); RBS_Controls_Store[i].value = ""; } } } if (__PreviousOnPageLoad != null) return __PreviousOnPageLoad(); }; __PreviousOnPageBeforeUnload = window.onbeforeunload; window.onbeforeunload = function() { // Save the html of RenderedByScript controls, so that it can be restored for the // browser's "Back Button" if (typeof(RBS_Controls) != "undefined") { for (var i=0; i < RBS_Controls.length; i++) RBS_Controls_Store[i].value = "HTML:" + encodeURIComponent(RBS_Controls[i].innerHTML); } if (__PreviousOnPageBeforeUnload != null) return __PreviousOnPageBeforeUnload(); }; if (bPageIsStored) { __PreviousOnPageUnload = window.onunload; window.onunload = this.OnPageUnload; } __bPageIsStored = bPageIsStored; } CallBackObject.prototype.OnFormSubmit = function() { var target; if ("activeElement" in document) { // Internet Explorer target = document.activeElement; } else { // Firefox target = arguments[0].explicitOriginalTarget; } if (__PreviousOnFormSubmit != null) if ( __PreviousOnFormSubmit() == false ) return false; var cbType = AJAXCbo.GetCallBackType(target); if (cbType != "none") { AJAXCbo.DoCallBack(target.name, "", cbType); return false; } else { return true; } } // Replaces normal __doPostBack CallBackObject.prototype.DoPostBack = function(eventTarget, eventArgument) { var target; var elemUniqueID = eventTarget.split("$").join(":"); var ids = elemUniqueID.split(":"); // Checks the unique id and its parents until it finds a target element // i.e. for ajaxPanel_grid:_ctl1:_ctl0 it checks // ajaxPanel_grid:_ctl1:_ctl0 // ajaxPanel_grid:_ctl1 // ajaxPanel_grid // ajaxPanel for (var num=ids.length; num > 0; num--) { var elemID = ""; for (var i=0; i < num; i++) elemID += "_" + ids[i]; elemID = elemID.substring(1, elemID.length); target = document.getElementById(elemID); if (target != null) break; } var cbType = AJAXCbo.GetCallBackType(target); if (cbType != "none") { AJAXCbo.DoCallBack(eventTarget, eventArgument, cbType); } else { if (__PreviousPostBack != null) __PreviousPostBack(eventTarget, eventArgument); } } CallBackObject.prototype.OnPageUnload = function() { var thePage = document.forms[0].action; var index = thePage.indexOf("?"); if (index != -1) thePage = thePage.substring(0, index); thePage = thePage + "?__AJAX_PAGEUNLOAD=" + encodeURIComponent(document.all["__AJAX_PAGEKEY"].value); var oThis = AJAXCbo; __AJAXCboList.push(oThis); AJAXCbo = new CallBackObject(); if( oThis.XmlHttp ) { oThis.XmlHttp.open('GET', thePage, true); oThis.XmlHttp.onreadystatechange = function(){ }; oThis.XmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); oThis.XmlHttp.send(null); } if (__PreviousOnPageUnload != null) return __PreviousOnPageUnload(); } CallBackObject.prototype.DoCallBack = function(eventTarget, eventArgument, callBackType) { var theData = ''; var theform = document.forms[0]; var thePage = theform.action; var eName = ''; theData = '__EVENTTARGET=' + escape(eventTarget.split("$").join(":")) + '&'; theData += '__EVENTARGUMENT=' + encodeURIComponent(eventArgument) + '&'; theData += '__AJAX_CALLBACK=true&'; if ( ! __bPageIsStored ) theData += '__VIEWSTATE=' + escape(theform.__VIEWSTATE.value).replace(new RegExp('\\+', 'g'), '%2b') + '&'; for( var i=0; i<theform.elements.length; i++ ) { eName = theform.elements[i].name; if( eName && eName != '') { if( eName == '__EVENTTARGET' || eName == '__EVENTARGUMENT' || eName == '__VIEWSTATE' ) { // Do Nothing } else if (theform.elements[i].getAttribute("ExcludeFromPost") == null || theform.elements[i].getAttribute("ExcludeFromPost").toLowerCase() != "true") { var type = theform.elements[i].type; var val = theform.elements[i].value; if ( type == "submit" ) continue; if ( type == "textarea" ) { // Firefox has the bad habit of altering the "\r\n" of a textarea to "\n", // so convert all single "\n" to "\r\n" val = val.split("\r\n").join("\n").split("\n").join("\r\n"); } val = encodeURIComponent(val); if ( type == "select-multiple" ) { for (var j=0; j < theform.elements[i].options.length; j++) if (theform.elements[i].options[j].selected) theData = theData + escape(eName.split("$").join(":")) + '=' + encodeURIComponent(theform.elements[i].options[j].value) + '&'; } else if ( (type != "checkbox" && type != "radio") || theform.elements[i].checked ) { theData = theData + escape(eName.split("$").join(":")) + '=' + val; if( i != theform.elements.length - 1 ) theData = theData + '&'; } } } } if (theData.substring(theData.length-1, theData.length) == "&") theData = theData.substring(0, theData.length-1); if( this.XmlHttp ) { if (waitElement) { waitElement.style.visibility = 'visible'; MoveWaitElement(); } var oThis = this; __AJAXCboList.push(oThis); AJAXCbo = new CallBackObject(); if( this.XmlHttp.readyState == 4 || this.XmlHttp.readyState == 0 ) { if ( ! callBackType || callBackType.toLowerCase() != "sync") { // Asynchronous this.XmlHttp.open("POST", thePage, true); this.XmlHttp.onreadystatechange = function(){ oThis.ReadyStateChange(); }; this.XmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); this.XmlHttp.send(theData); } else { // Synchronous // Use a timeout so that the screen refreshes before getting stack waiting // the callback. window.setTimeout( function() { oThis.XmlHttp.open("POST", thePage, false); oThis.XmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); oThis.XmlHttp.send(theData); if( oThis.XmlHttp.status == 200 && oThis.XmlHttp.statusText == "OK" ) oThis.OnComplete(oThis.XmlHttp.responseText, oThis.XmlHttp.responseXML); else oThis.OnError(oThis.XmlHttp.status, oThis.XmlHttp.statusText, oThis.XmlHttp.responseText); }, 1); } } } } CallBackObject.prototype.OnLoading = function() { // Loading } CallBackObject.prototype.OnLoaded = function() { // Loaded } CallBackObject.prototype.OnInteractive = function() { // Interactive } CallBackObject.prototype.OnComplete = function(responseText, responseXml) { //alert(responseText); // Checking if the data were fully loaded, without being aborted var flag = "'AJAX_LOADING_OK';\r\n"; if (responseText.substring(responseText.length - flag.length, responseText.length) != flag) return false; eval(responseText); if (waitElement) waitElement.style.visibility = 'hidden'; return true; } CallBackObject.prototype.OnAbort = function() { if (waitElement) waitElement.style.visibility = 'hidden'; } CallBackObject.prototype.OnError = function(status, statusText, responseText) { if (waitElement) waitElement.style.visibility = 'hidden'; document.body.innerHTML = responseText; } CallBackObject.prototype.ReadyStateChange = function() { if( this.XmlHttp.readyState == 1 ) { this.OnLoading(); } else if( this.XmlHttp.readyState == 2 ) { this.OnLoaded(); } else if( this.XmlHttp.readyState == 3 ) { this.OnInteractive(); } else if( this.XmlHttp.readyState == 4 ) { if( this.XmlHttp.status == 0 ) this.OnAbort(); else if( this.XmlHttp.status == 200 && this.XmlHttp.statusText == "OK" ) this.OnComplete(this.XmlHttp.responseText, this.XmlHttp.responseXML); else this.OnError(this.XmlHttp.status, this.XmlHttp.statusText, this.XmlHttp.responseText); // Remove this AJAXCbo from the list for (var i=0; i < __AJAXCboList.length; i++) if (__AJAXCboList[i] == this) { __AJAXCboList[i].XmlHttp = null; __AJAXCboList.splice(i, 1); break; } } } CallBackObject.prototype.ClockID = 0; CallBackObject.prototype.SetIntervalForCallBack = function(milliSec) { if (this.ClockID) this.ClearIntervalForCallBack(); this.ClockID = window.setInterval("AJAXCbo.DoCallBack('__AJAX_CALLBACKTIMER','','async')", milliSec); } CallBackObject.prototype.ClearIntervalForCallBack = function() { window.clearInterval(this.ClockID); this.ClockID = 0; } CallBackObject.prototype.RestoreHtml = function(destElem, html) { var store = document.createElement("form"); store.innerHTML = html; var scripts = store.getElementsByTagName("script"); while (scripts.length > 0) scripts[0].parentNode.removeChild(scripts[0]); var elements = new Array(); var coll = store.getElementsByTagName("INPUT"); for (var i=0; i < coll.length; i++) elements.push(coll[i]); coll = store.getElementsByTagName("TEXTAREA"); for (var i=0; i < coll.length; i++) elements.push(coll[i]); coll = store.getElementsByTagName("SELECT"); for (var i=0; i < coll.length; i++) elements.push(coll[i]); for( var i=0; i < elements.length; i++ ) { var elem = elements[i]; eName = elem.name; if( eName && eName != '') { var type = elem.type; var docElem = document.all[elem.id]; if (docElem == null || docElem.type != type) continue; if ( type == "select-multiple" ) { if ( elem.options.length == docElem.options.length ) { for (var j=0; j < elem.options.length; j++) elem.options[j].selected = docElem.options[j].selected; } } else if ( type == "checkbox" || type == "radio" ) { elem.checked = docElem.checked; } else { elem.value = docElem.value; } } } destElem.innerHTML = store.innerHTML; for( var i=0; i < elements.length; i++ ) { var elem = elements[i]; eName = elem.name; if( eName && eName != '') { var type = elem.type; var docElem = document.all[elem.id]; if (docElem == null || docElem.type != type) continue; if ( type == "select-multiple" ) { if ( elem.options.length == docElem.options.length ) { for (var j=0; j < elem.options.length; j++) docElem.options[j].selected = elem.options[j].selected; } } else if ( type == "checkbox" || type == "radio" ) { docElem.checked = elem.checked; } else { docElem.value = elem.value; } } } } CallBackObject.prototype.SetAttributesOfControl = function(clientID, attributes) { var place = document.getElementById(clientID); if (place != null && attributes != "") { var attribs = attributes.split("|"); for (var i=0; i < attribs.length; i++) { var parts = attribs[i].split("="); place.setAttribute(parts[0], parts[1]) } } } CallBackObject.prototype.AddElementScript = function(parentID, tagName, elementID, html, beforeElemID) { var place = document.getElementById(parentID); var child = document.getElementById(elementID); if (place != null && child == null) { child = document.createElement(tagName); child.id = elementID; var before = (beforeElemID != null) ? document.getElementById(beforeElemID) : null; place.insertBefore(child, before); } this.SetHtmlOfElementScript (html, elementID); } CallBackObject.prototype.RemoveElementScript = function(parentID, elementID) { var place = document.getElementById(parentID); var child = document.getElementById(elementID); if (place != null && child != null) place.removeChild(child); } CallBackObject.prototype.SetFieldScript = function(fieldName, fieldValue) { document.all.item(fieldName).value = fieldValue; } CallBackObject.prototype.SetHtmlOfElementScript = function(html, elementID) { var place = document.getElementById(elementID); if (place != null) place.innerHTML=html; } CallBackObject.prototype.SetHtmlOfPage = function(html) { document.write(html); document.close(); } CallBackObject.prototype.SetVisibilityOfElement = function(elementID, visible) { var place = document.getElementById(elementID); if (place != null) place.style.display = (visible) ? "" : "none"; } CallBackObject.prototype.Alert = function(message) { window.alert(message); } // It's used by AjaxPanel CallBackObject.prototype.ExtendedSetHtmlOfElementScript = function(html, elementID) { var store = document.createElement("span"); store.innerHTML = html; var spans = store.getElementsByTagName("span"); for (var i=0; i < spans.length; i++) { var elem = spans[i]; if (elem.getAttribute("name") == "__ajax_rbs") { var elemOnPage = document.getElementById(elem.id); if (elemOnPage != null) elem.innerHTML = elemOnPage.innerHTML; } } var place=document.getElementById(elementID); if (place != null) place.innerHTML = store.innerHTML; } var AJAXCbo = new CallBackObject(); // wait element CreateWaitElement(); window.attachEvent("onscroll", MoveWaitElement); window.attachEvent("onresize", MoveWaitElement); var waitElement; function MoveWaitElement() { if (!waitElement) CreateWaitElement(); var width = document.body.clientWidth; waitElement.style.top = document.body.scrollTop; waitElement.style.left = width + document.body.offsetLeft - waitElement.offsetWidth; } function CreateWaitElement() { var elem = document.getElementById('__Callback_Wait'); if (!elem) { elem = document.createElement("div"); elem.id = '__Callback_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 |
From: Argiris K. <be...@us...> - 2005-11-11 06:17:59
|
Update of /cvsroot/magicajax/magicajax/Core/Interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6302/Core/Interfaces Added Files: ICallBackEventHandler.cs IFormDataLoadedEventHandler.cs IPreWriteScriptEventHandler.cs IScriptWriter.cs Log Message: Put source files to module 'magicajax' divided in directories Core, Examples, and CustomControls. --- NEW FILE: ICallBackEventHandler.cs --- #region LGPL License /* MagicAjax Library Copyright (C) 2005 MagicAjax Project Team This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #endregion using System; namespace MagicAjax { /// <summary> /// Interface for controls that do no inherit from AjaxControl and want to receive /// CallBack events. /// </summary> /// <remarks> /// The Load event of the page and its child controls is not raised during a CallBack. /// If you want to handle the CallBack event instead, implement the ICallBackEventHandler /// on the page or on a cuatom control. /// </remarks> /// <example> /// public class CustomTextBox : System.Web.UI.WebControls.TextBox, ICallBackEventHandler /// { /// public void RaiseCallBackEvent() /// { /// OnCallBack(EventArgs.Empty); /// } /// } /// </example> public interface ICallBackEventHandler { void RaiseCallBackEvent(); } } --- NEW FILE: IFormDataLoadedEventHandler.cs --- #region LGPL License /* MagicAjax Library Copyright (C) 2005 MagicAjax Project Team This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #endregion using System; namespace MagicAjax { /// <summary> /// Interface for controls that want to receive the PostDataLoaded event that is /// raised by MagicAjaxModule. /// </summary> /// <remarks> /// The PostDataLoadedEvent is raised by MagicAjaxModule after it loads the post data /// to the controls of the page, and before it raises the CallBack event. The event /// handler should not alter any IPostBackDataHandler controls because it may /// interfere with the functionality of other IFormDataLoadedEventHandler handlers. /// /// i.e. the AjaxPanel is handling this event in order to cache the html rendering /// of the controls that receive post data. If you change such a control during /// the PostDataLoaded event, the AjaxPanel will cache the change and it will not /// render it on the client. /// </remarks> public interface IFormDataLoadedEventHandler { /// <summary> /// Raises the PostDataLoaded event /// </summary> /// <param name="changedControls">A list of controls with changed post data</param> void RaiseFormDataLoadedEvent(MagicAjax.Collections.ReadOnlyArrayList changedControls); } } --- NEW FILE: IPreWriteScriptEventHandler.cs --- #region LGPL License /* MagicAjax Library Copyright (C) 2005 MagicAjax Project Team This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #endregion using System; namespace MagicAjax { /// <summary> /// Interface for controls and pages that do no inherit from RenderedByScriptControl /// and want to receive PreWriteScript events. /// </summary> public interface IPreWriteScriptEventHandler { void RaisePreWriteScriptEvent(); } } --- NEW FILE: IScriptWriter.cs --- #region LGPL License /* MagicAjax Library Copyright (C) 2005 MagicAjax Project Team This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #endregion using System; namespace MagicAjax { /// <summary> /// Interface for controls and pages that do no inherit from RenderedByScriptControl /// and want to get the WriteScript call. /// </summary> /// <remarks> /// WriteScript is called by MagicAjaxModule. A control that implements this method /// must use CallBackHelper.Write and the rest Write methods to send javascript /// code to the client. public interface IScriptWriter { void WriteScript(); } } |
From: Argiris K. <be...@us...> - 2005-11-11 06:17:58
|
Update of /cvsroot/magicajax/magicajax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6302 Added Files: license.txt Log Message: Put source files to module 'magicajax' divided in directories Core, Examples, and CustomControls. --- NEW FILE: license.txt --- GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. |