From 9a463381237bf0ae48ea048ee2f9053415557be6 Mon Sep 17 00:00:00 2001 From: Shandem Date: Sun, 26 Jul 2009 15:13:15 +0000 Subject: [PATCH] DO NOT DOWNLOAD. DOWNLOAD LATEST STABLE FROM RELEASE TAB Resolves 23626. ClientDependency work. [TFS Changeset #57219] --- UpgradeReadme.txt | 19 +++- .../mediapicker/mediaChooser.cs | 4 +- .../editorControls/pagepicker/pagePicker.cs | 4 +- components/editorControls/tinymce/TinyMCE.cs | 2 +- .../tinymce/webcontrol/TinyMCE.cs | 4 +- .../umbraco.editorControls.csproj | 4 + components/macroRenderings/content.cs | 9 +- components/macroRenderings/media.cs | 10 ++- .../umbraco.macroRenderings.csproj | 4 + components/umbraco.controls/CodeArea.cs | 13 +-- components/umbraco.controls/MenuButtonI.cs | 9 +- components/umbraco.controls/MenuIcon.cs | 9 +- components/umbraco.controls/Panel.cs | 9 +- components/umbraco.controls/ScrollingMenu.cs | 17 ++-- components/umbraco.controls/TabView.cs | 7 +- components/umbraco.controls/helper.cs | 47 +++++----- components/umbraco.controls/pane.cs | 5 +- .../umbraco.controls/umbraco.controls.csproj | 6 ++ umbraco/businesslogic/GlobalSettings.cs | 14 +++ umbraco/businesslogic/UmbracoSettings.cs | 1 + ...atePicker.cs => __TODELETE__datePicker.cs} | 4 +- umbraco/cms/controls/datePickerWithpopup.cs | 10 ++- umbraco/cms/umbraco.cms.csproj | 6 +- .../ClientDependencyAttribute.cs | 14 +-- .../CompositeDependencyHandler.cs | 10 ++- .../CompositeFileProcessor.cs | 52 +++++++++-- .../Controls/ClientDependencyInclude.cs | 14 ++- .../Controls/ClientDependencyLoader.cs | 54 ++++++++++- .../Controls/CssInclude.cs | 5 ++ .../Controls/JsInclude.cs | 5 ++ .../IClientDependencyFile.cs | 1 - .../Providers/ClientDependencyProvider.cs | 71 +++++---------- .../ClientSideRegistrationProvider.cs | 90 ++++++++++++------- .../Providers/PageHeaderProvider.cs | 24 ++--- .../presentation/config/splashes/noNodes.aspx | 12 ++- .../config/splashes/noNodes.aspx.cs | 1 + .../config/splashes/noNodes.aspx.designer.cs | 20 ++++- umbraco/presentation/default.aspx.cs | 15 +--- umbraco/presentation/install/default.aspx | 31 ++++--- umbraco/presentation/install/default.aspx.cs | 2 + .../install/default.aspx.designer.cs | 56 +++++++++++- .../presentation/umbraco.presentation.csproj | 14 +-- .../umbraco/ClientDependencyTest.aspx | 4 +- ...iewHtml.aspx => __TODELETE__viewHtml.aspx} | 2 +- ...l.aspx.cs => __TODELETE__viewHtml.aspx.cs} | 0 ... => __TODELETE__viewHtml.aspx.designer.cs} | 0 ...px.resx => __TODELETE__viewHtml.aspx.resx} | 0 .../controls/ContentTypeControlNew.ascx.cs | 30 ++++--- .../GenericProperties/GenericProperty.ascx.cs | 6 +- .../umbraco/controls/dualSelectBox.cs | 9 +- .../umbraco/developer/Packages/Boost.aspx | 5 +- .../developer/Packages/Boost.aspx.designer.cs | 11 ++- .../umbraco/dialogs/treePicker.aspx | 2 +- .../umbraco/masterpages/umbracoDialog.Master | 2 +- .../plugins/tinymce3/InsertAnchor.aspx | 16 +++- .../plugins/tinymce3/InsertAnchor.aspx.cs | 16 ++-- .../tinymce3/InsertAnchor.aspx.designer.cs | 29 +++++- .../umbraco/plugins/tinymce3/insertChar.aspx | 16 +++- .../plugins/tinymce3/insertChar.aspx.cs | 16 ++-- .../tinymce3/insertChar.aspx.designer.cs | 29 +++++- .../umbraco/plugins/tinymce3/insertImage.aspx | 31 ++++--- .../plugins/tinymce3/insertImage.aspx.cs | 2 + .../tinymce3/insertImage.aspx.designer.cs | 83 ++++++++++++++++- .../umbraco/plugins/tinymce3/insertLink.aspx | 25 +++--- .../plugins/tinymce3/insertLink.aspx.cs | 2 + .../tinymce3/insertLink.aspx.designer.cs | 47 +++++++++- .../stylesheet/editstylesheet.aspx.cs | 9 +- umbraco/presentation/umbraco/treeInit.aspx | 2 +- umbraco/presentation/umbraco/umbraco.aspx | 5 +- .../umbraco/umbraco.aspx.designer.cs | 9 ++ .../umbraco/users/PermissionEditor.aspx | 11 ++- .../users/PermissionEditor.aspx.designer.cs | 29 +++++- 72 files changed, 830 insertions(+), 326 deletions(-) rename umbraco/cms/controls/{datePicker.cs => __TODELETE__datePicker.cs} (93%) rename umbraco/presentation/umbraco/{viewHtml.aspx => __TODELETE__viewHtml.aspx} (88%) rename umbraco/presentation/umbraco/{viewHtml.aspx.cs => __TODELETE__viewHtml.aspx.cs} (100%) rename umbraco/presentation/umbraco/{viewHtml.aspx.designer.cs => __TODELETE__viewHtml.aspx.designer.cs} (100%) rename umbraco/presentation/umbraco/{viewHtml.aspx.resx => __TODELETE__viewHtml.aspx.resx} (100%) diff --git a/UpgradeReadme.txt b/UpgradeReadme.txt index fe8c7f63f4..a8688ceb4c 100644 --- a/UpgradeReadme.txt +++ b/UpgradeReadme.txt @@ -1,4 +1,17 @@ -* DataType: 'editor' removed -** Before upgrading, ensure you are not using this data type +* //TODO: All removed files will be in the umbraco.Legacy project -* Many files have been removed but a zip file containing all removed files has been supplied \ No newline at end of file +* DataType: 'editor' removed + +* Many files have been removed but a zip file containing all removed files has been supplied + +* Remove umbraco.controls.helper.cs? + +* Any packages that have pages containing Umbraco Controls should now have a +DependencyLoader registered on them, otherwise the controls will not down register client files +to be downlaoded (perhaps theres a better way to implement this... (i.e. check if a DependencyLoader +exists in the current context, and if it doesn't it registers the scripts?) + +* Umbraco_Client folder path needs to be specified in AppSettings + +* The old TinyMCE was not upgraded to use ClientDependency but it's paths have been changed +to use the UmbracoClientPath setting \ No newline at end of file diff --git a/components/editorControls/mediapicker/mediaChooser.cs b/components/editorControls/mediapicker/mediaChooser.cs index 5c9328b8a1..955be9b247 100644 --- a/components/editorControls/mediapicker/mediaChooser.cs +++ b/components/editorControls/mediapicker/mediaChooser.cs @@ -59,7 +59,9 @@ namespace umbraco.editorControls { base.OnLoad(e); - base.Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "subModal", ""); + umbraco.presentation.ClientDependency.Controls.ClientDependencyLoader.RegisterDependency("js/submodal/common.js", "UmbracoRoot", umbraco.presentation.ClientDependency.ClientDependencyType.Javascript); + umbraco.presentation.ClientDependency.Controls.ClientDependencyLoader.RegisterDependency("js/submodal/subModal.js", "UmbracoRoot", umbraco.presentation.ClientDependency.ClientDependencyType.Javascript); + umbraco.presentation.ClientDependency.Controls.ClientDependencyLoader.RegisterDependency("js/submodal/subModal.css", "UmbracoRoot", umbraco.presentation.ClientDependency.ClientDependencyType.Css); // We need to make sure we have a reference to the legacy ajax calls in the scriptmanager presentation.webservices.ajaxHelpers.EnsureLegacyCalls(base.Page); diff --git a/components/editorControls/pagepicker/pagePicker.cs b/components/editorControls/pagepicker/pagePicker.cs index ed93854e08..a3a59f5722 100644 --- a/components/editorControls/pagepicker/pagePicker.cs +++ b/components/editorControls/pagepicker/pagePicker.cs @@ -51,7 +51,9 @@ namespace umbraco.editorControls { base.OnInit(e); - base.Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "subModal", ""); + umbraco.presentation.ClientDependency.Controls.ClientDependencyLoader.RegisterDependency("js/submodal/common.js", "UmbracoRoot", umbraco.presentation.ClientDependency.ClientDependencyType.Javascript); + umbraco.presentation.ClientDependency.Controls.ClientDependencyLoader.RegisterDependency("js/submodal/subModal.js", "UmbracoRoot", umbraco.presentation.ClientDependency.ClientDependencyType.Javascript); + umbraco.presentation.ClientDependency.Controls.ClientDependencyLoader.RegisterDependency("js/submodal/subModal.css", "UmbracoRoot", umbraco.presentation.ClientDependency.ClientDependencyType.Css); // We need to make sure we have a reference to the legacy ajax calls in the scriptmanager presentation.webservices.ajaxHelpers.EnsureLegacyCalls(base.Page); diff --git a/components/editorControls/tinymce/TinyMCE.cs b/components/editorControls/tinymce/TinyMCE.cs index 3feeff840e..c1f971c567 100644 --- a/components/editorControls/tinymce/TinyMCE.cs +++ b/components/editorControls/tinymce/TinyMCE.cs @@ -320,7 +320,7 @@ namespace umbraco.editorControls.tinymce { } protected override void Render(HtmlTextWriter output) { - base.JavascriptLocation = "/umbraco_client/tinymce/tiny_mce.js"; + base.JavascriptLocation = GlobalSettings.ClientPath + "/tinymce/tiny_mce.js"; base.Render(output); } diff --git a/components/editorControls/tinymce/webcontrol/TinyMCE.cs b/components/editorControls/tinymce/webcontrol/TinyMCE.cs index 8f96a4110b..78ec302f6a 100644 --- a/components/editorControls/tinymce/webcontrol/TinyMCE.cs +++ b/components/editorControls/tinymce/webcontrol/TinyMCE.cs @@ -13,7 +13,7 @@ using Content = umbraco.cms.businesslogic.Content; namespace umbraco.editorControls.tinymce.webcontrol { public class TinyMCE : WebControl, IPostBackDataHandler { - private string _javascriptLocation = "/umbraco_client/tinymce"; + private string _javascriptLocation = GlobalSettings.ClientPath + "/tinymce"; private string _coreFile = "/tiny_mce.js"; private int _rows = 13; private int _cols = 60; @@ -91,7 +91,7 @@ namespace umbraco.editorControls.tinymce.webcontrol { /// The writer to draw the editor to protected override void Render(HtmlTextWriter writer) { writer.WriteLine("\n"); - // writer.WriteLine(""); - base.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ajax1", ""); - base.Page.ClientScript.RegisterClientScriptBlock(GetType(), "subModal", ""); - + // We need to make sure we have a reference to the legacy ajax calls in the scriptmanager ScriptManager sm = ScriptManager.GetCurrent(Page); ServiceReference legacyPath = new ServiceReference(GlobalSettings.Path + "/webservices/legacyAjaxCalls.asmx"); diff --git a/components/macroRenderings/media.cs b/components/macroRenderings/media.cs index eca95a86ef..5c93c18caa 100644 --- a/components/macroRenderings/media.cs +++ b/components/macroRenderings/media.cs @@ -4,12 +4,16 @@ using Microsoft.ApplicationBlocks.Data; using System.Data.SqlClient; using System.Web.UI; +using umbraco.presentation.ClientDependency; namespace umbraco.macroRenderings { /// - /// Summary description for content. + /// Summary description for media. /// + [ClientDependency(103, ClientDependencyType.Javascript, "js/submodal/common.js", "UmbracoRoot")] + [ClientDependency(104, ClientDependencyType.Javascript, "js/submodal/subModal.js", "UmbracoRoot")] + [ClientDependency(ClientDependencyType.Css, "js/submodal/subModal.css", "UmbracoRoot")] public class media : System.Web.UI.WebControls.WebControl, interfaces.IMacroGuiRendering { private string m_value = ""; @@ -38,9 +42,7 @@ namespace umbraco.macroRenderings protected override void OnInit(EventArgs e) { base.OnInit(e); - base.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ajax", ""); - base.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ajax1", ""); - base.Page.ClientScript.RegisterClientScriptBlock(GetType(), "subModal", ""); + // We need to make sure we have a reference to the legacy ajax calls in the scriptmanager ScriptManager sm = ScriptManager.GetCurrent(Page); diff --git a/components/macroRenderings/umbraco.macroRenderings.csproj b/components/macroRenderings/umbraco.macroRenderings.csproj index 3742f21607..9165a4fd9e 100644 --- a/components/macroRenderings/umbraco.macroRenderings.csproj +++ b/components/macroRenderings/umbraco.macroRenderings.csproj @@ -120,6 +120,10 @@ {511F6D8D-7717-440A-9A57-A507E9A8B27F} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + {EA35B06D-0CC8-4830-A3F7-9BB3D36D0FAF} + umbraco.presentation.ClientDependency + diff --git a/components/umbraco.controls/CodeArea.cs b/components/umbraco.controls/CodeArea.cs index 2b16a448e3..9d5fe10d7a 100644 --- a/components/umbraco.controls/CodeArea.cs +++ b/components/umbraco.controls/CodeArea.cs @@ -8,9 +8,11 @@ using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; +using umbraco.presentation.ClientDependency; namespace umbraco.uicontrols { + [ClientDependency(ClientDependencyType.Javascript, "CodeArea/javascript.js", "UmbracoClient")] public class CodeArea : System.Web.UI.WebControls.TextBox { public CodeArea() { @@ -28,15 +30,6 @@ namespace umbraco.uicontrols { public int OffSetX { get; set; } public int OffSetY { get; set; } - protected override void OnInit(System.EventArgs e) { - - - //this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "CodeAreaStyles", ""); - this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "CodeAreaJavaScript", ""); - - - - } protected override void Render(HtmlTextWriter writer) { base.Render(writer); @@ -62,7 +55,7 @@ namespace umbraco.uicontrols { writer.WriteLine(jsEventCode); - //this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "CodeAreaEvents", jsEventCode); + } } diff --git a/components/umbraco.controls/MenuButtonI.cs b/components/umbraco.controls/MenuButtonI.cs index fdb9904d40..e4dce5fd70 100644 --- a/components/umbraco.controls/MenuButtonI.cs +++ b/components/umbraco.controls/MenuButtonI.cs @@ -8,8 +8,11 @@ using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; +using umbraco.presentation.ClientDependency; namespace umbraco.uicontrols { + + [ClientDependency(ClientDependencyType.Css, "menuicon/style.css", "UmbracoClient")] public class MenuImageButton : System.Web.UI.WebControls.ImageButton, MenuIconI { private string _OnClickCommand = ""; @@ -47,7 +50,7 @@ namespace umbraco.uicontrols { } protected override void OnLoad(System.EventArgs EventArguments) { - SetupClientScript(); + this.Width = Unit.Pixel(22); this.Height = Unit.Pixel(23); @@ -63,8 +66,6 @@ namespace umbraco.uicontrols { } } - private void SetupClientScript() { - this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "MENUICONCSS", ""); - } + } } \ No newline at end of file diff --git a/components/umbraco.controls/MenuIcon.cs b/components/umbraco.controls/MenuIcon.cs index 440ab984f8..07d0297af0 100644 --- a/components/umbraco.controls/MenuIcon.cs +++ b/components/umbraco.controls/MenuIcon.cs @@ -1,7 +1,10 @@ using System.ComponentModel; using System.Web.UI; +using umbraco.presentation.ClientDependency; namespace umbraco.uicontrols { + + [ClientDependency(ClientDependencyType.Css, "menuicon/style.css", "UmbracoClient")] internal class MenuIcon : System.Web.UI.WebControls.Image, MenuIconI { private string _OnClickCommand = ""; private string _AltText = "init"; @@ -40,7 +43,7 @@ namespace umbraco.uicontrols { } protected override void OnLoad(System.EventArgs EventArguments) { - SetupClientScript(); + // NH 17-01-2007. Trying to avoid inline styling soup // Me.Width = WebControls.Unit.Pixel(22) @@ -66,8 +69,6 @@ namespace umbraco.uicontrols { } } - private void SetupClientScript() { - this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "MENUICONCSS", ""); - } + } } \ No newline at end of file diff --git a/components/umbraco.controls/Panel.cs b/components/umbraco.controls/Panel.cs index 2382d62011..6ec9056b9b 100644 --- a/components/umbraco.controls/Panel.cs +++ b/components/umbraco.controls/Panel.cs @@ -8,8 +8,13 @@ using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; +using umbraco.presentation.ClientDependency; namespace umbraco.uicontrols { + + + [ClientDependency(ClientDependencyType.Javascript, "panel/javascript.js", "UmbracoClient")] + [ClientDependency(ClientDependencyType.Css, "panel/style.css", "UmbracoClient")] public class UmbracoPanel : System.Web.UI.WebControls.Panel { private ScrollingMenu _menu = new ScrollingMenu(); @@ -22,10 +27,6 @@ namespace umbraco.uicontrols { } protected override void OnLoad(System.EventArgs EventArguments) { - helper.AddLinkToHeader("PanelStyles", "/umbraco_client/panel/style.css", this.Page); - helper.AddScriptToHeader("PanelScript", "/umbraco_client/panel/javascript.js", this.Page); - // this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "PanelStyles", ""); -// this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "PanelScript", ""); _menu.Visible = hasMenu; diff --git a/components/umbraco.controls/ScrollingMenu.cs b/components/umbraco.controls/ScrollingMenu.cs index cb186df7a6..7f33b96cd7 100644 --- a/components/umbraco.controls/ScrollingMenu.cs +++ b/components/umbraco.controls/ScrollingMenu.cs @@ -8,10 +8,14 @@ using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; +using umbraco.presentation.ClientDependency; namespace umbraco.uicontrols { - [ToolboxData("<{0}:ScrollingMenu runat=server>")] - public class ScrollingMenu : System.Web.UI.WebControls.WebControl { + + [ToolboxData("<{0}:ScrollingMenu runat=server>")] + [ClientDependency(ClientDependencyType.Javascript, "scrollingmenu/javascript.js", "UmbracoClient")] + [ClientDependency(ClientDependencyType.Css, "scrollingmenu/style.css", "UmbracoClient")] + public class ScrollingMenu : System.Web.UI.WebControls.WebControl { private ArrayList Icons = new ArrayList(); private string iconIds; private int extraMenuWidth = 0; @@ -65,16 +69,11 @@ namespace umbraco.uicontrols { if (base.Visible) { SetupMenu(); - SetupClientScript(); + } } - private void SetupClientScript() { - helper.AddLinkToHeader("SCROLLINGMENUCSS", "/umbraco_client/scrollingmenu/style.css", this.Page); - helper.AddScriptToHeader("SCROLLINGMENUJS", "/umbraco_client/scrollingmenu/javascript.js", this.Page); -// this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "SCROLLINGMENUCSS", ""); -// this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "SCROLLINGMENUJS", ""); - } + private System.Web.UI.WebControls.Image scrollImage() { System.Web.UI.WebControls.Image functionReturnValue = null; diff --git a/components/umbraco.controls/TabView.cs b/components/umbraco.controls/TabView.cs index ec6cc3484c..6dc937aa28 100644 --- a/components/umbraco.controls/TabView.cs +++ b/components/umbraco.controls/TabView.cs @@ -8,8 +8,12 @@ using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; +using umbraco.presentation.ClientDependency; namespace umbraco.uicontrols { + + [ClientDependency(ClientDependencyType.Javascript, "tabview/javascript.js", "UmbracoClient")] + [ClientDependency(ClientDependencyType.Css, "tabview/style.css", "UmbracoClient")] public class TabView : System.Web.UI.WebControls.WebControl { private HtmlInputHidden tb = new HtmlInputHidden(); private ArrayList Tabs = new ArrayList(); @@ -57,8 +61,7 @@ namespace umbraco.uicontrols { } private void SetupClientScript() { - this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "TabviewCss", ""); - this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "TabviewJs", ""); + string strTmp = ""; for (int i = 1; i <= Tabs.Count; i++) { diff --git a/components/umbraco.controls/helper.cs b/components/umbraco.controls/helper.cs index d80ed49845..c8cdf1d5d6 100644 --- a/components/umbraco.controls/helper.cs +++ b/components/umbraco.controls/helper.cs @@ -7,40 +7,43 @@ using System.Web.UI.HtmlControls; namespace umbraco.uicontrols { + [Obsolete("To register scripts and css files for controls, use the ClientDependency library")] public class helper { + [Obsolete("To register scripts and css files for controls, use the ClientDependency library")] public static void AddLinkToHeader(string key, string src, Page page) { - if (page.Header != null) - { - if (!page.ClientScript.IsClientScriptBlockRegistered(page.GetType(), key)) - { - page.ClientScript.RegisterClientScriptBlock(page.GetType(), key, String.Empty); - ((HtmlHead)page.Header).Controls.Add(new LiteralControl(String.Format("", src))); - } - } - else - { + //if (page.Header != null) + //{ + // if (!page.ClientScript.IsClientScriptBlockRegistered(page.GetType(), key)) + // { + // page.ClientScript.RegisterClientScriptBlock(page.GetType(), key, String.Empty); + // ((HtmlHead)page.Header).Controls.Add(new LiteralControl(String.Format("", src))); + // } + //} + //else + //{ // can't add to header, will failback to a simple register script page.ClientScript.RegisterClientScriptBlock(page.GetType(), key, String.Format("", src)); - } + //} } + [Obsolete("To register scripts and css files for controls, use the ClientDependency library")] public static void AddScriptToHeader(string key, string src, Page page) { - if (page.Header != null) - { - if (!page.ClientScript.IsClientScriptBlockRegistered(page.GetType(), key)) - { - page.ClientScript.RegisterClientScriptBlock(page.GetType(), key, String.Empty); - ((HtmlHead)page.Header).Controls.Add(new LiteralControl(String.Format("", src))); - } - } - else - { + //if (page.Header != null) + //{ + // if (!page.ClientScript.IsClientScriptBlockRegistered(page.GetType(), key)) + // { + // page.ClientScript.RegisterClientScriptBlock(page.GetType(), key, String.Empty); + // ((HtmlHead)page.Header).Controls.Add(new LiteralControl(String.Format("", src))); + // } + //} + //else + //{ // can't add to header, will failback to a simple register script page.ClientScript.RegisterClientScriptBlock(page.GetType(), key, String.Format("", src)); - } + //} } } } diff --git a/components/umbraco.controls/pane.cs b/components/umbraco.controls/pane.cs index dba7a21471..a3f2ed3c6d 100644 --- a/components/umbraco.controls/pane.cs +++ b/components/umbraco.controls/pane.cs @@ -8,8 +8,11 @@ using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; +using umbraco.presentation.ClientDependency; namespace umbraco.uicontrols { + + [ClientDependency(ClientDependencyType.Css, "propertypane/style.css", "UmbracoClient")] public class Pane : System.Web.UI.WebControls.Panel { private TableRow tr = new TableRow(); @@ -77,7 +80,7 @@ namespace umbraco.uicontrols { protected override void OnLoad(System.EventArgs EventArguments) { - this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "propertypanestyles", ""); + } protected override void Render(System.Web.UI.HtmlTextWriter writer) { diff --git a/components/umbraco.controls/umbraco.controls.csproj b/components/umbraco.controls/umbraco.controls.csproj index 14e67319c4..7b1a1c8f6c 100644 --- a/components/umbraco.controls/umbraco.controls.csproj +++ b/components/umbraco.controls/umbraco.controls.csproj @@ -75,6 +75,12 @@ + + + {EA35B06D-0CC8-4830-A3F7-9BB3D36D0FAF} + umbraco.presentation.ClientDependency + + - - + "); + pp_newTab.Text = ui.Text("newtab", umbraco.BasePages.UmbracoEnsuredPage.CurrentUser); pp_alias.Text = umbraco.ui.Text("alias", umbraco.BasePages.UmbracoEnsuredPage.CurrentUser); diff --git a/umbraco/presentation/umbraco/controls/GenericProperties/GenericProperty.ascx.cs b/umbraco/presentation/umbraco/controls/GenericProperties/GenericProperty.ascx.cs index b55e73c20f..c7ccbd05f8 100644 --- a/umbraco/presentation/umbraco/controls/GenericProperties/GenericProperty.ascx.cs +++ b/umbraco/presentation/umbraco/controls/GenericProperties/GenericProperty.ascx.cs @@ -5,6 +5,7 @@ using System.Web; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using umbraco.BasePages; +using umbraco.presentation.ClientDependency; namespace umbraco.controls.GenericProperties { @@ -13,6 +14,8 @@ namespace umbraco.controls.GenericProperties /// /// Summary description for GenericProperty. /// + [ClientDependency(ClientDependencyType.Css, "GenericProperty/genericproperty.css", "UmbracoClient")] + [ClientDependency(ClientDependencyType.Javascript, "GenericProperty/genericproperty.js", "UmbracoClient")] public partial class GenericProperty : System.Web.UI.UserControl { @@ -222,8 +225,7 @@ namespace umbraco.controls.GenericProperties // InitializeComponent(); base.OnInit(e); - Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "GenericPropertyCss", ""); - Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "GenericPropertyJs", ""); + this.Delete += new System.EventHandler(defaultDeleteHandler); } diff --git a/umbraco/presentation/umbraco/controls/dualSelectBox.cs b/umbraco/presentation/umbraco/controls/dualSelectBox.cs index 1a12c555a7..40a69466ae 100644 --- a/umbraco/presentation/umbraco/controls/dualSelectBox.cs +++ b/umbraco/presentation/umbraco/controls/dualSelectBox.cs @@ -2,12 +2,14 @@ using System; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; +using umbraco.presentation.ClientDependency; namespace umbraco.controls { /// /// Summary description for dualSelectbox. /// + [ClientDependency(ClientDependencyType.Javascript, "js/dualSelectBox.js", "UmbracoRoot")] public class DualSelectbox : System.Web.UI.WebControls.WebControl, System.Web.UI.INamingContainer { private ListItemCollection _items = new ListItemCollection(); @@ -123,12 +125,7 @@ namespace umbraco.controls _remove.Attributes.Add("onClick", "dualSelectBoxShift('" + this.ClientID + "');"); } - protected override void OnInit(EventArgs e) - { - Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "dualSelectBox", ""); - base.OnInit (e); - - } + } diff --git a/umbraco/presentation/umbraco/developer/Packages/Boost.aspx b/umbraco/presentation/umbraco/developer/Packages/Boost.aspx index 1e98430965..2d34499646 100644 --- a/umbraco/presentation/umbraco/developer/Packages/Boost.aspx +++ b/umbraco/presentation/umbraco/developer/Packages/Boost.aspx @@ -1,8 +1,11 @@ <%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../../masterpages/umbracoPage.Master" Title="Install boost" CodeBehind="Boost.aspx.cs" Inherits="umbraco.presentation.developer.packages.Boost" %> <%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> +<%@ Register TagPrefix="umb" Namespace="umbraco.presentation.ClientDependency.Controls" Assembly="umbraco.presentation.ClientDependency" %> - + + + - + + + + + + + + + + +
diff --git a/umbraco/presentation/umbraco/plugins/tinymce3/InsertAnchor.aspx.cs b/umbraco/presentation/umbraco/plugins/tinymce3/InsertAnchor.aspx.cs index c69c8fb277..57452b9498 100644 --- a/umbraco/presentation/umbraco/plugins/tinymce3/InsertAnchor.aspx.cs +++ b/umbraco/presentation/umbraco/plugins/tinymce3/InsertAnchor.aspx.cs @@ -4,12 +4,16 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; -namespace umbraco.presentation.umbraco.plugins.tinymce3 { - public partial class InsertAnchor : BasePages.UmbracoEnsuredPage { +namespace umbraco.presentation.umbraco.plugins.tinymce3 +{ + public partial class InsertAnchor : BasePages.UmbracoEnsuredPage + { - protected void Page_Load(object sender, EventArgs e) { + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + ClientLoader.DataBind(); + } - } - - } + } } diff --git a/umbraco/presentation/umbraco/plugins/tinymce3/InsertAnchor.aspx.designer.cs b/umbraco/presentation/umbraco/plugins/tinymce3/InsertAnchor.aspx.designer.cs index 7aa88a99d3..f94176bcb6 100644 --- a/umbraco/presentation/umbraco/plugins/tinymce3/InsertAnchor.aspx.designer.cs +++ b/umbraco/presentation/umbraco/plugins/tinymce3/InsertAnchor.aspx.designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 +// Runtime Version:2.0.50727.3082 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,5 +12,32 @@ namespace umbraco.presentation.umbraco.plugins.tinymce3 { public partial class InsertAnchor { + + /// + /// ClientLoader control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.presentation.ClientDependency.Controls.ClientDependencyLoader ClientLoader; + + /// + /// JsInclude4 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.presentation.ClientDependency.Controls.JsInclude JsInclude4; + + /// + /// JsInclude1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.presentation.ClientDependency.Controls.JsInclude JsInclude1; } } diff --git a/umbraco/presentation/umbraco/plugins/tinymce3/insertChar.aspx b/umbraco/presentation/umbraco/plugins/tinymce3/insertChar.aspx index d61e661442..0631827801 100644 --- a/umbraco/presentation/umbraco/plugins/tinymce3/insertChar.aspx +++ b/umbraco/presentation/umbraco/plugins/tinymce3/insertChar.aspx @@ -1,14 +1,24 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="insertChar.aspx.cs" Inherits="umbraco.presentation.umbraco.plugins.tinymce3.insertChar" %> +<%@ Register TagPrefix="umb" Namespace="umbraco.presentation.ClientDependency.Controls" Assembly="umbraco.presentation.ClientDependency" %> - + <%= umbraco.ui.Text("insertCharacter")%> - - + + + + + + + + + + +
diff --git a/umbraco/presentation/umbraco/plugins/tinymce3/insertChar.aspx.cs b/umbraco/presentation/umbraco/plugins/tinymce3/insertChar.aspx.cs index 60bd0e0f5a..1ffdf75020 100644 --- a/umbraco/presentation/umbraco/plugins/tinymce3/insertChar.aspx.cs +++ b/umbraco/presentation/umbraco/plugins/tinymce3/insertChar.aspx.cs @@ -4,10 +4,14 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; -namespace umbraco.presentation.umbraco.plugins.tinymce3 { - public partial class insertChar : System.Web.UI.Page { - protected void Page_Load(object sender, EventArgs e) { - - } - } +namespace umbraco.presentation.umbraco.plugins.tinymce3 +{ + public partial class insertChar : System.Web.UI.Page + { + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + ClientLoader.DataBind(); + } + } } diff --git a/umbraco/presentation/umbraco/plugins/tinymce3/insertChar.aspx.designer.cs b/umbraco/presentation/umbraco/plugins/tinymce3/insertChar.aspx.designer.cs index 42cc8f7470..954b28301c 100644 --- a/umbraco/presentation/umbraco/plugins/tinymce3/insertChar.aspx.designer.cs +++ b/umbraco/presentation/umbraco/plugins/tinymce3/insertChar.aspx.designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 +// Runtime Version:2.0.50727.3082 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,5 +12,32 @@ namespace umbraco.presentation.umbraco.plugins.tinymce3 { public partial class insertChar { + + /// + /// ClientLoader control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.presentation.ClientDependency.Controls.ClientDependencyLoader ClientLoader; + + /// + /// JsInclude4 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.presentation.ClientDependency.Controls.JsInclude JsInclude4; + + /// + /// JsInclude1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.presentation.ClientDependency.Controls.JsInclude JsInclude1; } } diff --git a/umbraco/presentation/umbraco/plugins/tinymce3/insertImage.aspx b/umbraco/presentation/umbraco/plugins/tinymce3/insertImage.aspx index 49d8b7b635..3263f748cc 100644 --- a/umbraco/presentation/umbraco/plugins/tinymce3/insertImage.aspx +++ b/umbraco/presentation/umbraco/plugins/tinymce3/insertImage.aspx @@ -1,24 +1,12 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="insertImage.aspx.cs" Inherits="umbraco.presentation.plugins.tinymce3.insertImage" %> <%@ Register TagPrefix="ui" Namespace="umbraco.uicontrols" Assembly="controls" %> +<%@ Register TagPrefix="umb" Namespace="umbraco.presentation.ClientDependency.Controls" Assembly="umbraco.presentation.ClientDependency" %> {#advimage_dlg.dialog_title} - - - - - - - - - - - - - - - - @@ -80,6 +70,19 @@ + + + + + + + + + + + + + diff --git a/umbraco/presentation/umbraco/plugins/tinymce3/insertLink.aspx.cs b/umbraco/presentation/umbraco/plugins/tinymce3/insertLink.aspx.cs index 643c894610..a20670b476 100644 --- a/umbraco/presentation/umbraco/plugins/tinymce3/insertLink.aspx.cs +++ b/umbraco/presentation/umbraco/plugins/tinymce3/insertLink.aspx.cs @@ -12,6 +12,8 @@ namespace umbraco.presentation.plugins.tinymce3 protected void Page_Load(object sender, System.EventArgs e) { + ClientLoader.DataBind(); + uicontrols.TabPage tp = tv_options.NewTabPage(ui.Text("content")); tp.HasMenu = false; tp.Controls.Add(pane_content); diff --git a/umbraco/presentation/umbraco/plugins/tinymce3/insertLink.aspx.designer.cs b/umbraco/presentation/umbraco/plugins/tinymce3/insertLink.aspx.designer.cs index 3ad7b3b4ee..9b06bfafba 100644 --- a/umbraco/presentation/umbraco/plugins/tinymce3/insertLink.aspx.designer.cs +++ b/umbraco/presentation/umbraco/plugins/tinymce3/insertLink.aspx.designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3074 +// Runtime Version:2.0.50727.3082 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -22,6 +22,51 @@ namespace umbraco.presentation.plugins.tinymce3 { /// protected global::System.Web.UI.HtmlControls.HtmlHead Head1; + /// + /// ClientLoader control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.presentation.ClientDependency.Controls.ClientDependencyLoader ClientLoader; + + /// + /// JsInclude2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.presentation.ClientDependency.Controls.JsInclude JsInclude2; + + /// + /// JsInclude1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.presentation.ClientDependency.Controls.JsInclude JsInclude1; + + /// + /// JsInclude3 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.presentation.ClientDependency.Controls.JsInclude JsInclude3; + + /// + /// JsInclude4 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.presentation.ClientDependency.Controls.JsInclude JsInclude4; + /// /// pane_url control. /// diff --git a/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs b/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs index bd827a4c80..011245b35b 100644 --- a/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs +++ b/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs @@ -26,10 +26,11 @@ namespace umbraco.cms.presentation.settings.stylesheet if(!IsPostBack) { // editor source - if (UmbracoSettings.ScriptDisableEditor) - editorSource.Text = ""; - else - editorSource.Text = ""; + + if (!UmbracoSettings.ScriptDisableEditor) + { + // TODO: Register the some script editor js file if you can find a good one. + } ClientTools .SetActiveTreeType(TreeDefinitionCollection.Instance.FindTree().Tree.Alias) diff --git a/umbraco/presentation/umbraco/treeInit.aspx b/umbraco/presentation/umbraco/treeInit.aspx index fd8b456f99..4305a46222 100644 --- a/umbraco/presentation/umbraco/treeInit.aspx +++ b/umbraco/presentation/umbraco/treeInit.aspx @@ -26,7 +26,7 @@ - + diff --git a/umbraco/presentation/umbraco/umbraco.aspx b/umbraco/presentation/umbraco/umbraco.aspx index 13d1e1c6c0..4cfa480b65 100644 --- a/umbraco/presentation/umbraco/umbraco.aspx +++ b/umbraco/presentation/umbraco/umbraco.aspx @@ -19,7 +19,7 @@ - + @@ -40,6 +40,7 @@ + @@ -109,7 +110,7 @@ - + - - - - - + + + + diff --git a/umbraco/presentation/umbraco/users/PermissionEditor.aspx.designer.cs b/umbraco/presentation/umbraco/users/PermissionEditor.aspx.designer.cs index 5cfc680aff..d82e169573 100644 --- a/umbraco/presentation/umbraco/users/PermissionEditor.aspx.designer.cs +++ b/umbraco/presentation/umbraco/users/PermissionEditor.aspx.designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.1433 +// Runtime Version:2.0.50727.3082 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -13,6 +13,33 @@ namespace umbraco.cms.presentation.user { public partial class PermissionEditor { + /// + /// CssInclude2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.presentation.ClientDependency.Controls.CssInclude CssInclude2; + + /// + /// CssInclude1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.presentation.ClientDependency.Controls.CssInclude CssInclude1; + + /// + /// JsInclude1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.presentation.ClientDependency.Controls.JsInclude JsInclude1; + /// /// pnlUmbraco control. ///