From f24a26b2642351c72f4862b58f51a22aa15739d3 Mon Sep 17 00:00:00 2001
From: Shandem
Date: Tue, 28 Jul 2009 16:22:14 +0000
Subject: [PATCH] DO NOT D,OWNLOAD. DOWNLOAD LATEST STABLE FROM RELEASE TAB
Resolves 22528,22306. ClientDependency nearly done.
[TFS Changeset #57300]
---
UpgradeReadme.txt | 8 +-
.../mediapicker/mediaChooser.cs | 17 +-
.../editorControls/pagepicker/pagePicker.cs | 15 +-
...LETE__mailerConfiguratorPreValueEditor.cs} | 0
...rHelper.cs => __TODELETE__mailerHelper.cs} | 0
...lerLogic.cs => __TODELETE__mailerLogic.cs} | 0
... __TODELETE__ultraSimpleMailerDataType.cs} | 0
...=> __TODELETE__ultraSimpleMailerEditor.cs} | 70 ++--
.../umbraco.editorControls.csproj | 10 +-
config templates/web.config | 1 +
.../businesslogic/BasePages/ClientTools.cs | 26 +-
.../datatype/ClientDependencyAttribute.cs | 164 ++++-----
.../datatype/ClientDependencyHelper.cs | 112 +++---
.../BasicClientDependencyFile.cs | 26 ++
.../BasicClientDependencyPath.cs | 22 ++
.../ClientDependencyCollection.cs | 46 +++
.../Controls/ClientDependencyLoader.cs | 324 ++++++++++++++----
.../Controls/ClientDependencyPath.cs | 2 +-
.../IClientDependencyPath.cs | 15 +
.../ProviderDependencyList.cs | 35 ++
.../Providers/ClientDependencyProvider.cs | 39 +--
.../UmbracoDependencyLoader.js | 5 +-
...braco.presentation.ClientDependency.csproj | 7 +-
.../presentation/umbraco.presentation.csproj | 2 +-
.../LiveEditing/Controls/Communicator.cs | 6 +-
.../Controls/LiveEditingManager.cs | 44 ++-
.../Controls/LiveEditingToolbar.cs | 8 +-
.../Modules/CreateModule/CreateModule.cs | 7 +-
.../Modules/DeleteModule/DeleteModule.cs | 7 +-
.../Modules/ItemEditing/ItemEditor.cs | 33 +-
.../Modules/MacroModule/MacroModule.cs | 7 +-
.../UnpublishModule/UnpublishModule.cs | 7 +-
.../umbraco/controls/ContentControl.cs | 83 +++--
...wCloser.cs => __TODELETE__windowCloser.cs} | 0
.../umbraco/dialogs/moveOrCopy.aspx | 9 +-
.../umbraco/dialogs/moveOrCopy.aspx.cs | 4 +-
umbraco/presentation/umbraco/umbraco.aspx | 6 +-
.../Application/UmbracoApplicationActions.js | 8 +-
.../Application/UmbracoClientManager.js | 28 +-
.../umbraco_client/Tree/NodeDefinition.js | 2 +-
.../umbraco_client/Tree/UmbracoTree.js | 2 +-
.../umbraco_client/Tree/UmbracoTree.min.js | 2 +-
42 files changed, 821 insertions(+), 388 deletions(-)
rename components/editorControls/ultraSimpleMailer/{mailerConfiguratorPreValueEditor.cs => __TODELETE__mailerConfiguratorPreValueEditor.cs} (100%)
rename components/editorControls/ultraSimpleMailer/{mailerHelper.cs => __TODELETE__mailerHelper.cs} (100%)
rename components/editorControls/ultraSimpleMailer/{mailerLogic.cs => __TODELETE__mailerLogic.cs} (100%)
rename components/editorControls/ultraSimpleMailer/{ultraSimpleMailerDataType.cs => __TODELETE__ultraSimpleMailerDataType.cs} (100%)
rename components/editorControls/ultraSimpleMailer/{ultraSimpleMailerEditor.cs => __TODELETE__ultraSimpleMailerEditor.cs} (84%)
create mode 100644 umbraco/presentation.ClientDependency/BasicClientDependencyFile.cs
create mode 100644 umbraco/presentation.ClientDependency/BasicClientDependencyPath.cs
create mode 100644 umbraco/presentation.ClientDependency/ClientDependencyCollection.cs
create mode 100644 umbraco/presentation.ClientDependency/IClientDependencyPath.cs
create mode 100644 umbraco/presentation.ClientDependency/ProviderDependencyList.cs
rename umbraco/presentation/umbraco/controls/{windowCloser.cs => __TODELETE__windowCloser.cs} (100%)
diff --git a/UpgradeReadme.txt b/UpgradeReadme.txt
index a8688ceb4c..a24a1c7be8 100644
--- a/UpgradeReadme.txt
+++ b/UpgradeReadme.txt
@@ -1,6 +1,7 @@
* //TODO: All removed files will be in the umbraco.Legacy project
-* DataType: 'editor' removed
+* DataType: 'editor' removed (editor.cs)
+* removed WysiwygDataType.cs
* Many files have been removed but a zip file containing all removed files has been supplied
@@ -14,4 +15,7 @@ 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
+to use the UmbracoClientPath setting
+
+* removed CheckBoxTree.cs [permanently!, not in legacy package]
+* removed windowCloser.cs
\ No newline at end of file
diff --git a/components/editorControls/mediapicker/mediaChooser.cs b/components/editorControls/mediapicker/mediaChooser.cs
index 955be9b247..8b12c4e4fc 100644
--- a/components/editorControls/mediapicker/mediaChooser.cs
+++ b/components/editorControls/mediapicker/mediaChooser.cs
@@ -1,16 +1,17 @@
using System;
using System.Web.UI;
-using umbraco.cms.businesslogic.datatype;
+
using umbraco.cms.presentation.Trees;
+using umbraco.presentation.ClientDependency;
namespace umbraco.editorControls
{
///
/// Summary description for mediaChooser.
///
- [ClientDependency(1, ClientDependencyType.Css, "js/submodal/submodal.css", true)]
- [ClientDependency(1, ClientDependencyType.Javascript, "js/submodal/common.js", true)]
- [ClientDependency(2, ClientDependencyType.Javascript, "js/submodal/submodal.js", true, "initPopUp")]
- [ClientDependency(3, ClientDependencyType.Javascript, "webservices/legacyAjaxCalls.asmx/js", true)]
+ [ClientDependency(100, ClientDependencyType.Css, "js/submodal/submodal.css", "UmbracoRoot")]
+ [ClientDependency(101, ClientDependencyType.Javascript, "js/submodal/common.js", "UmbracoRoot")]
+ [ClientDependency(102, ClientDependencyType.Javascript, "js/submodal/submodal.js", "UmbracoRoot", InvokeJavascriptMethodOnLoad = "initPopUp")]
+ [ClientDependency(103, ClientDependencyType.Javascript, "webservices/legacyAjaxCalls.asmx/js", "UmbracoRoot")]
[ValidationProperty("Value")]
public class mediaChooser : System.Web.UI.WebControls.HiddenField, interfaces.IDataEditor
{
@@ -59,9 +60,9 @@ namespace umbraco.editorControls
{
base.OnLoad(e);
- 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);
+ //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 a3a59f5722..d0e6bbe5ac 100644
--- a/components/editorControls/pagepicker/pagePicker.cs
+++ b/components/editorControls/pagepicker/pagePicker.cs
@@ -1,16 +1,17 @@
using System;
using System.Web.UI;
-using umbraco.cms.businesslogic.datatype;
+
using umbraco.cms.presentation.Trees;
+using umbraco.presentation.ClientDependency;
namespace umbraco.editorControls
{
///
/// Summary description for pagePicker.
///
- [ClientDependency(1, ClientDependencyType.Css, "js/submodal/submodal.css", true)]
- [ClientDependency(1, ClientDependencyType.Javascript, "js/submodal/common.js", true)]
- [ClientDependency(2, ClientDependencyType.Javascript, "js/submodal/submodal.js", true, "initPopUp")]
- [ClientDependency(3, ClientDependencyType.Javascript, "webservices/legacyAjaxCalls.asmx/js", true)]
+ [ClientDependency(100, ClientDependencyType.Css, "js/submodal/submodal.css", "UmbracoRoot")]
+ [ClientDependency(101, ClientDependencyType.Javascript, "js/submodal/common.js", "UmbracoRoot")]
+ [ClientDependency(102, ClientDependencyType.Javascript, "js/submodal/submodal.js", "UmbracoRoot", InvokeJavascriptMethodOnLoad = "initPopUp")]
+ [ClientDependency(103, ClientDependencyType.Javascript, "webservices/legacyAjaxCalls.asmx/js", "UmbracoRoot")]
[ValidationProperty("Value")]
public class pagePicker : System.Web.UI.WebControls.HiddenField, interfaces.IDataEditor
{
@@ -51,10 +52,6 @@ namespace umbraco.editorControls
{
base.OnInit(e);
- 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/ultraSimpleMailer/mailerConfiguratorPreValueEditor.cs b/components/editorControls/ultraSimpleMailer/__TODELETE__mailerConfiguratorPreValueEditor.cs
similarity index 100%
rename from components/editorControls/ultraSimpleMailer/mailerConfiguratorPreValueEditor.cs
rename to components/editorControls/ultraSimpleMailer/__TODELETE__mailerConfiguratorPreValueEditor.cs
diff --git a/components/editorControls/ultraSimpleMailer/mailerHelper.cs b/components/editorControls/ultraSimpleMailer/__TODELETE__mailerHelper.cs
similarity index 100%
rename from components/editorControls/ultraSimpleMailer/mailerHelper.cs
rename to components/editorControls/ultraSimpleMailer/__TODELETE__mailerHelper.cs
diff --git a/components/editorControls/ultraSimpleMailer/mailerLogic.cs b/components/editorControls/ultraSimpleMailer/__TODELETE__mailerLogic.cs
similarity index 100%
rename from components/editorControls/ultraSimpleMailer/mailerLogic.cs
rename to components/editorControls/ultraSimpleMailer/__TODELETE__mailerLogic.cs
diff --git a/components/editorControls/ultraSimpleMailer/ultraSimpleMailerDataType.cs b/components/editorControls/ultraSimpleMailer/__TODELETE__ultraSimpleMailerDataType.cs
similarity index 100%
rename from components/editorControls/ultraSimpleMailer/ultraSimpleMailerDataType.cs
rename to components/editorControls/ultraSimpleMailer/__TODELETE__ultraSimpleMailerDataType.cs
diff --git a/components/editorControls/ultraSimpleMailer/ultraSimpleMailerEditor.cs b/components/editorControls/ultraSimpleMailer/__TODELETE__ultraSimpleMailerEditor.cs
similarity index 84%
rename from components/editorControls/ultraSimpleMailer/ultraSimpleMailerEditor.cs
rename to components/editorControls/ultraSimpleMailer/__TODELETE__ultraSimpleMailerEditor.cs
index a04672304c..bccec816ec 100644
--- a/components/editorControls/ultraSimpleMailer/ultraSimpleMailerEditor.cs
+++ b/components/editorControls/ultraSimpleMailer/__TODELETE__ultraSimpleMailerEditor.cs
@@ -5,19 +5,24 @@ using umbraco.editorControls.wysiwyg;
using umbraco.uicontrols;
using System.Web.UI;
+
namespace umbraco.editorControls.ultraSimpleMailer
{
+
///
/// Summary description for ultraSimpleMailerEditor.
///
+
+
+
public class ultraSimpleMailerEditor : umbraco.editorControls.tinyMCE3.TinyMCE, interfaces.IDataFieldWithButtons
{
- umbraco.cms.businesslogic.datatype.DefaultData _data;
+ umbraco.cms.businesslogic.datatype.DefaultData _data;
string _configuration;
private controls.progressBar pb;
- public ultraSimpleMailerEditor(umbraco.cms.businesslogic.datatype.DefaultData Data, string Configuration)
- : base(Data, Configuration)
+ public ultraSimpleMailerEditor(umbraco.cms.businesslogic.datatype.DefaultData Data, string Configuration)
+ : base(Data, Configuration)
{
_configuration = Configuration;
_data = Data;
@@ -26,7 +31,7 @@ namespace umbraco.editorControls.ultraSimpleMailer
protected override void OnLoad(EventArgs e)
{
- base.OnLoad (e);
+ base.OnLoad(e);
// init progressbar
pb = new umbraco.controls.progressBar();
@@ -38,10 +43,10 @@ namespace umbraco.editorControls.ultraSimpleMailer
Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "progressBar", "");
Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "progressBarCss", "");
- // We need to make sure we have a reference to the legacy ajax calls in the scriptmanager
- presentation.webservices.ajaxHelpers.EnsureLegacyCalls(base.Page);
+ // We need to make sure we have a reference to the legacy ajax calls in the scriptmanager
+ presentation.webservices.ajaxHelpers.EnsureLegacyCalls(base.Page);
- }
+ }
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
@@ -54,48 +59,48 @@ namespace umbraco.editorControls.ultraSimpleMailer
writer.WriteLine("");
if (umbraco.helper.Request(this.ClientID + "_doTest") == "" && umbraco.helper.Request(this.ClientID + "_doSend") == "")
- base.Render (writer);
- else
+ base.Render(writer);
+ else
{
writer.WriteLine("");
- if (umbraco.helper.Request(this.ClientID + "_sendButton") != "")
+ if (umbraco.helper.Request(this.ClientID + "_sendButton") != "")
{
// Test mail
- if (umbraco.helper.Request(this.ClientID + "_doTest") != "")
+ if (umbraco.helper.Request(this.ClientID + "_doTest") != "")
{
writer.WriteLine("
Send newsletter to test...
");
mailerLogic.SendTestmail(umbraco.helper.Request(this.ClientID + "_test_rcp"), new cms.businesslogic.property.Property(_data.PropertyId), config[9], config[10], true);
writer.WriteLine("Test mail sent to:
" + umbraco.helper.Request(this.ClientID + "_test_rcp") + "");
- }
- else
+ }
+ else
{
writer.WriteLine("
Send newsletter to all...
");
mailerLogic.SendMail(mg, new cms.businesslogic.property.Property(_data.PropertyId), config[9], config[10], true);
writer.WriteLine("Sent...
");
- }
- }
- else
+ }
+ }
+ else
{
- if (umbraco.helper.Request(this.ClientID + "_doTest") != "")
+ if (umbraco.helper.Request(this.ClientID + "_doTest") != "")
{
writer.WriteLine("
Send newsletter to test...
");
writer.WriteLine("Send test to:
");
writer.WriteLine("
");
}
- else
+ else
{
string strScript = " alert('The MassMailer / UltraSimplerMailer is incompatible with Umbraco 4'); umbPgStep = 1;\n umbPgIgnoreSteps = true;\n";
if (ScriptManager.GetCurrent(Page).IsInAsyncPostBack)
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), this.ClientID, strScript, true);
else
Page.ClientScript.RegisterStartupScript(this.GetType(), this.ClientID, strScript, true);
-
- writer.WriteLine("

\n" +
- " Sending mails...\n" +
- "
\n" +
+
+ writer.WriteLine(" 
\n" +
+ " Sending mails...\n" +
+ "
\n" +
"
\n");
@@ -104,7 +109,7 @@ namespace umbraco.editorControls.ultraSimpleMailer
pb.ID = "ultraSimpleMailerUpgradeStatus";
pb.Width = 200;
pb.RenderControl(writer);
- writer.WriteLine(" \n" +
+ writer.WriteLine(" \n" +
"
"));
- ScriptManager.RegisterClientScriptInclude(this, GetType(), CreateModuleScriptFile, String.Format(CreateModuleScriptFile, GlobalSettings.Path));
+ //ScriptManager.RegisterClientScriptInclude(this, GetType(), CreateModuleScriptFile, String.Format(CreateModuleScriptFile, GlobalSettings.Path));
}
private void FillAllowedDoctypes()
diff --git a/umbraco/presentation/umbraco/LiveEditing/Modules/DeleteModule/DeleteModule.cs b/umbraco/presentation/umbraco/LiveEditing/Modules/DeleteModule/DeleteModule.cs
index 92c88986ef..2e5eb644c7 100644
--- a/umbraco/presentation/umbraco/LiveEditing/Modules/DeleteModule/DeleteModule.cs
+++ b/umbraco/presentation/umbraco/LiveEditing/Modules/DeleteModule/DeleteModule.cs
@@ -5,12 +5,13 @@ using AjaxControlToolkit;
using umbraco.cms.businesslogic.web;
using umbraco.presentation.LiveEditing.Controls;
using umbraco.BusinessLogic.Actions;
-
+using umbraco.presentation.ClientDependency;
namespace umbraco.presentation.LiveEditing.Modules.DeleteModule
{
+ [ClientDependency(200, ClientDependencyType.Javascript, "LiveEditing/Modules/DeleteModule/DeleteModule.js", "UmbracoRoot")]
public class DeleteModule : BaseModule
{
- protected const string DeleteModuleScriptFile = "{0}/LiveEditing/Modules/DeleteModule/DeleteModule.js";
+ //protected const string DeleteModuleScriptFile = "{0}/LiveEditing/Modules/DeleteModule/DeleteModule.js";
protected ImageButton m_DeleteButton = new ImageButton();
@@ -72,7 +73,7 @@ namespace umbraco.presentation.LiveEditing.Modules.DeleteModule
m_DeleteModal.Controls.Add(new LiteralControl("
"));
- ScriptManager.RegisterClientScriptInclude(this, GetType(), DeleteModuleScriptFile, String.Format(DeleteModuleScriptFile, GlobalSettings.Path));
+ //ScriptManager.RegisterClientScriptInclude(this, GetType(), DeleteModuleScriptFile, String.Format(DeleteModuleScriptFile, GlobalSettings.Path));
}
diff --git a/umbraco/presentation/umbraco/LiveEditing/Modules/ItemEditing/ItemEditor.cs b/umbraco/presentation/umbraco/LiveEditing/Modules/ItemEditing/ItemEditor.cs
index c5a01e4d4d..d0504cc6c3 100644
--- a/umbraco/presentation/umbraco/LiveEditing/Modules/ItemEditing/ItemEditor.cs
+++ b/umbraco/presentation/umbraco/LiveEditing/Modules/ItemEditing/ItemEditor.cs
@@ -5,7 +5,6 @@ using System.IO;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
-using umbraco.cms.businesslogic.datatype;
using umbraco.cms.businesslogic.property;
using umbraco.cms.businesslogic.propertytype;
using umbraco.cms.businesslogic.web;
@@ -13,14 +12,16 @@ using umbraco.interfaces;
using umbraco.presentation.LiveEditing.Controls;
using umbraco.presentation.LiveEditing.Updates;
using umbraco.presentation.templateControls;
-
+using umbraco.presentation.ClientDependency;
+using umbraco.presentation.ClientDependency.Controls;
+using umbraco.presentation.ClientDependency.Providers;
namespace umbraco.presentation.LiveEditing.Modules.ItemEditing
{
///
/// Control that wraps the editor control to edit a field in Live Editing mode.
///
- [ClientDependency(1, ClientDependencyType.Javascript, "/umbraco_client/ui/jquery.js", false)]
- [ClientDependency(2, ClientDependencyType.Javascript, "LiveEditing/Modules/ItemEditing/ItemEditing.js", true, "initializeGlobalItemEditing")]
+ [ClientDependency(1, ClientDependencyType.Javascript, "ui/jquery.js", "UmbracoClient")]
+ [ClientDependency(21, ClientDependencyType.Javascript, "LiveEditing/Modules/ItemEditing/ItemEditing.js", "UmbracoRoot", InvokeJavascriptMethodOnLoad = "initializeGlobalItemEditing")]
public class ItemEditor : UpdatePanel
{
#region Protected Constants
@@ -104,6 +105,7 @@ namespace umbraco.presentation.LiveEditing.Modules.ItemEditing
ScriptManager.RegisterStartupScript(Page, GetType(), new Guid().ToString(),
string.Format("ItemEditing.startEdit({0});", ItemId), true);
+ EnsureChildControls();
}
///
@@ -145,6 +147,9 @@ namespace umbraco.presentation.LiveEditing.Modules.ItemEditing
ID = "ItemEditor";
RenderMode = UpdatePanelRenderMode.Inline;
+
+ m_Manager.MessageReceived += Manager_MessageReceived;
+ m_Manager.LiveEditingContext.Updates.UpdateAdded += Updates_UpdateAdded;
}
///
@@ -156,6 +161,7 @@ namespace umbraco.presentation.LiveEditing.Modules.ItemEditing
base.OnLoad(e);
// create editor controls if in edit modoe
+ //this NEVER fires because onload occurs before ItemId is set in StartEditing
if (ItemId != 0)
{
EnsureChildControls();
@@ -164,21 +170,7 @@ namespace umbraco.presentation.LiveEditing.Modules.ItemEditing
// enable editing on all items
foreach (Item item in Utility.FindControls- (Page.Master))
item.Renderer = LiveEditingItemRenderer.Instance;
-
- m_Manager.MessageReceived += Manager_MessageReceived;
- m_Manager.LiveEditingContext.Updates.UpdateAdded += Updates_UpdateAdded;
- }
-
- ///
- /// Raises the event.
- ///
- /// The instance containing the event data.
- protected override void OnPreRender(EventArgs e)
- {
- base.OnPreRender(e);
-
- // add the editor control's client dependencies (the client will ensure they're only loaded once)
- ClientDependencyHelper.AddClientDependencies(this);
+
}
@@ -192,6 +184,9 @@ namespace umbraco.presentation.LiveEditing.Modules.ItemEditing
// Unfortunately, adding TinyMCE with the client dependencies system does not work
// due to a bug in the way TinyMCE initializes in IE.
// Therefore, TinyMCE needs to be added with a script tag.
+ // TODO: Same goes for the pagePicker, mediaPicker controls. This is due to
+ // the client dependency framework not being able to render things out
+ // after an async call with an UpdatePanel!
ScriptManagerProxy proxy = new ScriptManagerProxy();
proxy.Scripts.Add(new ScriptReference(TinyMCEClientScriptFile));
ContentTemplateContainer.Controls.Add(proxy);
diff --git a/umbraco/presentation/umbraco/LiveEditing/Modules/MacroModule/MacroModule.cs b/umbraco/presentation/umbraco/LiveEditing/Modules/MacroModule/MacroModule.cs
index a0c8eb8e0f..f0fa426e63 100644
--- a/umbraco/presentation/umbraco/LiveEditing/Modules/MacroModule/MacroModule.cs
+++ b/umbraco/presentation/umbraco/LiveEditing/Modules/MacroModule/MacroModule.cs
@@ -9,12 +9,13 @@ using umbraco.presentation.LiveEditing.Controls;
using umbraco.presentation.LiveEditing.Updates;
using umbraco.presentation.templateControls;
using UM = umbraco.cms.businesslogic.macro;
-
+using umbraco.presentation.ClientDependency;
namespace umbraco.presentation.LiveEditing.Modules.MacroEditing
{
+ [ClientDependency(200, ClientDependencyType.Javascript, "LiveEditing/Modules/MacroModule/MacroModule.js", "UmbracoRoot")]
public class MacroModule : BaseModule
{
- protected const string MacroModuleScriptFile = "{0}/LiveEditing/Modules/MacroModule/MacroModule.js";
+ //protected const string MacroModuleScriptFile = "{0}/LiveEditing/Modules/MacroModule/MacroModule.js";
private ImageButton m_MacroButton = new ImageButton();
@@ -108,7 +109,7 @@ namespace umbraco.presentation.LiveEditing.Modules.MacroEditing
m_MacroModal.Controls.Add(new LiteralControl(""));
- ScriptManager.RegisterClientScriptInclude(this, GetType(), MacroModuleScriptFile, String.Format(MacroModuleScriptFile, GlobalSettings.Path));
+ //ScriptManager.RegisterClientScriptInclude(this, GetType(), MacroModuleScriptFile, String.Format(MacroModuleScriptFile, GlobalSettings.Path));
}
diff --git a/umbraco/presentation/umbraco/LiveEditing/Modules/UnpublishModule/UnpublishModule.cs b/umbraco/presentation/umbraco/LiveEditing/Modules/UnpublishModule/UnpublishModule.cs
index 820cd356a4..df653cb09d 100644
--- a/umbraco/presentation/umbraco/LiveEditing/Modules/UnpublishModule/UnpublishModule.cs
+++ b/umbraco/presentation/umbraco/LiveEditing/Modules/UnpublishModule/UnpublishModule.cs
@@ -5,12 +5,13 @@ using AjaxControlToolkit;
using umbraco.cms.businesslogic.web;
using umbraco.presentation.LiveEditing.Controls;
using umbraco.BusinessLogic.Actions;
-
+using umbraco.presentation.ClientDependency;
namespace umbraco.presentation.LiveEditing.Modules.UnpublishModule
{
+ [ClientDependency(200, ClientDependencyType.Javascript, "LiveEditing/Modules/UnpublishModule/UnpublishModule.js", "UmbracoRoot")]
public class UnpublishModule : BaseModule
{
- protected const string UnpublishModuleScriptFile = "{0}/LiveEditing/Modules/UnpublishModule/UnpublishModule.js";
+ //protected const string UnpublishModuleScriptFile = "{0}/LiveEditing/Modules/UnpublishModule/UnpublishModule.js";
protected ImageButton m_UnpublishButton = new ImageButton();
@@ -84,7 +85,7 @@ namespace umbraco.presentation.LiveEditing.Modules.UnpublishModule
m_UnpublishModal.Controls.Add(new LiteralControl(""));
- ScriptManager.RegisterClientScriptInclude(this, GetType(), UnpublishModuleScriptFile, String.Format(UnpublishModuleScriptFile, GlobalSettings.Path));
+ //ScriptManager.RegisterClientScriptInclude(this, GetType(), UnpublishModuleScriptFile, String.Format(UnpublishModuleScriptFile, GlobalSettings.Path));
}
diff --git a/umbraco/presentation/umbraco/controls/ContentControl.cs b/umbraco/presentation/umbraco/controls/ContentControl.cs
index 38ae832849..3130661648 100644
--- a/umbraco/presentation/umbraco/controls/ContentControl.cs
+++ b/umbraco/presentation/umbraco/controls/ContentControl.cs
@@ -56,6 +56,18 @@ namespace umbraco.controls
{
}
+ ///
+ /// Constructor to set default properties.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// This method used to create all of the child controls too which is BAD since
+ /// the page hasn't started initializing yet. Control IDs were not being named
+ /// correctly, etc... I've moved the child control setup/creation to the CreateChildControls
+ /// method where they are suposed to be.
+ ///
public ContentControl(Content c, publishModes CanPublish, string Id)
{
ID = Id;
@@ -64,40 +76,55 @@ namespace umbraco.controls
Width = 350;
Height = 350;
- SaveAndPublish += new EventHandler(standardSaveAndPublishHandler);
- Save += new EventHandler(standardSaveAndPublishHandler);
- prntpage = (UmbracoEnsuredPage)Page;
-
- foreach (ContentType.TabI t in _content.ContentType.getVirtualTabs)
- {
- TabPage tp = NewTabPage(t.Caption);
- addSaveAndPublishButtons(ref tp);
-
- tp.Style.Add("text-align", "center");
-
-
- // Iterate through the property types and add them to the tab
- foreach (PropertyType pt in t.PropertyTypes)
- {
- // table.Rows.Add(addControl(_content.getProperty(editPropertyType.Alias), tp));
- addControlNew(_content.getProperty(pt), tp, t.Caption);
- inTab.Add(pt.Id.ToString(), true);
- }
- }
-
-
- // Add property pane
- tpProp = NewTabPage(ui.Text("general", "properties", null));
- addSaveAndPublishButtons(ref tpProp);
- tpProp.Controls.Add(
- new LiteralControl("
There were errors - data has not been saved!
"));
}
+ ///
+ /// Create and setup all of the controls child controls.
+ ///
+ protected override void CreateChildControls()
+ {
+ base.CreateChildControls();
+ SaveAndPublish += new EventHandler(standardSaveAndPublishHandler);
+ Save += new EventHandler(standardSaveAndPublishHandler);
+ prntpage = (UmbracoEnsuredPage)Page;
+
+ foreach (ContentType.TabI t in _content.ContentType.getVirtualTabs)
+ {
+ TabPage tp = NewTabPage(t.Caption);
+ addSaveAndPublishButtons(ref tp);
+
+ tp.Style.Add("text-align", "center");
+
+
+ // Iterate through the property types and add them to the tab
+ foreach (PropertyType pt in t.PropertyTypes)
+ {
+ // table.Rows.Add(addControl(_content.getProperty(editPropertyType.Alias), tp));
+ addControlNew(_content.getProperty(pt), tp, t.Caption);
+ inTab.Add(pt.Id.ToString(), true);
+ }
+ }
+
+
+ // Add property pane
+ tpProp = NewTabPage(ui.Text("general", "properties", null));
+ addSaveAndPublishButtons(ref tpProp);
+ tpProp.Controls.Add(
+ new LiteralControl("There were errors - data has not been saved!
"));
+ }
+
+ ///
+ /// Initializes the control and ensures child controls are setup
+ ///
+ ///
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
+
+ EnsureChildControls();
+
// Add extras for the property tabpage. .
ContentControlLoadEventArgs contentcontrolEvent = new ContentControlLoadEventArgs();
FireBeforeContentControlLoad(contentcontrolEvent);
diff --git a/umbraco/presentation/umbraco/controls/windowCloser.cs b/umbraco/presentation/umbraco/controls/__TODELETE__windowCloser.cs
similarity index 100%
rename from umbraco/presentation/umbraco/controls/windowCloser.cs
rename to umbraco/presentation/umbraco/controls/__TODELETE__windowCloser.cs
diff --git a/umbraco/presentation/umbraco/dialogs/moveOrCopy.aspx b/umbraco/presentation/umbraco/dialogs/moveOrCopy.aspx
index c77f318847..3cc5b03261 100644
--- a/umbraco/presentation/umbraco/dialogs/moveOrCopy.aspx
+++ b/umbraco/presentation/umbraco/dialogs/moveOrCopy.aspx
@@ -25,14 +25,7 @@
jQuery("#pageNameHolder").attr("class","success");
}
- function updateTree(current, oldParent, newParent, newParentPath, copy) {
- if (!copy) {
- UmbClientMgr.mainTree().moveNode(current, newParentPath);
- } else {
- UmbClientMgr.mainTree().copyNode(current, newParentPath);
- }
-
- }
+
function doSubmit() {document.Form1["ok"].click()}
diff --git a/umbraco/presentation/umbraco/dialogs/moveOrCopy.aspx.cs b/umbraco/presentation/umbraco/dialogs/moveOrCopy.aspx.cs
index 289e4ee69c..0ead334d8c 100644
--- a/umbraco/presentation/umbraco/dialogs/moveOrCopy.aspx.cs
+++ b/umbraco/presentation/umbraco/dialogs/moveOrCopy.aspx.cs
@@ -252,7 +252,7 @@ namespace umbraco.dialogs
feedback.type = umbraco.uicontrols.Feedback.feedbacktype.success;
// refresh tree
- ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "treeRefresh", String.Format("updateTree({0}, {1}, {2}, '{3}', false);", currentNode.Id, oldParent, newNode.Id, newNode.Path), true);
+ ClientTools.MoveNode(currentNode.Id.ToString(), newNode.Path);
}
else
@@ -261,7 +261,7 @@ namespace umbraco.dialogs
d.Copy(int.Parse(helper.Request("copyTo")), this.getUser(), RelateDocuments.Checked);
feedback.Text = ui.Text("moveOrCopy", "copyDone", nodes, base.getUser()) + "
" + ui.Text("closeThisWindow") + "";
feedback.type = umbraco.uicontrols.Feedback.feedbacktype.success;
- ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "treeRefresh", String.Format("updateTree({0}, {1}, {2}, '{3}', true);", currentNode.Id, oldParent, newNode.Id, newNode.Path), true);
+ ClientTools.CopyNode(currentNode.Id.ToString(), newNode.Path);
}
}
}
diff --git a/umbraco/presentation/umbraco/umbraco.aspx b/umbraco/presentation/umbraco/umbraco.aspx
index 4cfa480b65..770459a814 100644
--- a/umbraco/presentation/umbraco/umbraco.aspx
+++ b/umbraco/presentation/umbraco/umbraco.aspx
@@ -116,6 +116,8 @@
jQuery(document).ready(function() {
+ //UmbClientMgr.setUmbracoPath("<%=umbraco.GlobalSettings.Path %>");
+
jQuery(window).load(function() { resizePage('load'); });
jQuery(window).wresize(function() { resizePage('resize'); });
@@ -127,9 +129,9 @@
// load dashboard
if (rightAction != '') {
- jQuery("#right").attr("src", rightAction + ".aspx?id=" + rightActionId);
+ UmbClientMgr.contentFrame(rightAction + ".aspx?id=" + rightActionId);
} else {
- jQuery("#right").attr("src", "dashboard.aspx?app=" + initApp);
+ UmbClientMgr.contentFrame("dashboard.aspx?app=" + initApp);
}
if (initApp != '') {
diff --git a/umbraco/presentation/umbraco_client/Application/UmbracoApplicationActions.js b/umbraco/presentation/umbraco_client/Application/UmbracoApplicationActions.js
index b0c9c9c5ba..157f68fecc 100644
--- a/umbraco/presentation/umbraco_client/Application/UmbracoApplicationActions.js
+++ b/umbraco/presentation/umbraco_client/Application/UmbracoApplicationActions.js
@@ -18,7 +18,7 @@ Umbraco.Application.Actions = function() {
_utils: Umbraco.Utils, //alias to Umbraco Utils
_dialogWindow: null,
/// A reference to a dialog window to open, any action that doesn't open in an overlay, opens in a dialog
- _isDebug: true, //set to true to enable alert debugging
+ _isDebug: false, //set to true to enable alert debugging
_windowTitle: " - Umbraco CMS - ",
_currApp: "",
@@ -98,8 +98,8 @@ Umbraco.Application.Actions = function() {
if (!ignoreDashboard) {
UmbClientMgr.contentFrame('dashboard.aspx?app=' + whichApp);
}
-
-
+
+
UmbClientMgr.mainTree().rebuildTree(whichApp);
jQuery("#treeWindowLabel").html(appName);
@@ -126,7 +126,7 @@ Umbraco.Application.Actions = function() {
},
openDashboard: function(whichApp) {
- UmbClientMgr.contentFrame().location.href = 'dashboard.aspx?app=' + whichApp;
+ UmbClientMgr.contentFrame('dashboard.aspx?app=' + whichApp);
},
actionSort: function() {
diff --git a/umbraco/presentation/umbraco_client/Application/UmbracoClientManager.js b/umbraco/presentation/umbraco_client/Application/UmbracoClientManager.js
index 2254800b47..b6008ce168 100644
--- a/umbraco/presentation/umbraco_client/Application/UmbracoClientManager.js
+++ b/umbraco/presentation/umbraco_client/Application/UmbracoClientManager.js
@@ -11,10 +11,20 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
/// A class which ensures that all calls made to the objects that it owns are done in the context
/// of the main Umbraco application window.
///
+
return {
- _debug: true,
+ _debug: false,
_mainTree: null,
+ _rootPath: "/umbraco", //this is the default
+
+
+ setUmbracoPath: function(strPath) {
+ ///
+ /// sets the Umbraco root path folder
+ ///
+ _rootPath = strPath;
+ },
mainWindow: function() {
///
@@ -28,9 +38,9 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
/// Sometimes an Umbraco page will need to be opened without being contained in the iFrame from the main window
/// so this method is will construct a false tree to be returned if this is the case as to avoid errors.
///
-
+
if (this._mainTree == null) {
- if (this.mainWindow().jQuery(".umbTree").UmbracoTreeAPI() == null) {
+ if (this.mainWindow().jQuery(".umbTree").UmbracoTreeAPI() == null) {
this._mainTree = $("
").appendTo("body").hide().UmbracoTree({
uiKeys: this.uiKeys(),
jsonFullMenu: {},
@@ -79,6 +89,18 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
return this.mainWindow().right;
}
else {
+ //if the path doesn't start with "/" or with the root path then
+ //prepend the root path
+ if (strLocation.substr(0, 1) != "/") {
+ strLocation = this._rootPath + "/" + strLocation;
+ }
+ else if (strLocation.length >= this._rootPath.length
+ && strLocation.substr(0, this._rootPath.length) != this._rootPath) {
+ strLocation = this._rootPath + "/" + strLocation;
+ }
+
+ this._debug("contentFrame: parsed location: " + strLocation);
+
this.mainWindow().right.location.href = strLocation;
}
},
diff --git a/umbraco/presentation/umbraco_client/Tree/NodeDefinition.js b/umbraco/presentation/umbraco_client/Tree/NodeDefinition.js
index 021fc4510c..a14e5b25bb 100644
--- a/umbraco/presentation/umbraco_client/Tree/NodeDefinition.js
+++ b/umbraco/presentation/umbraco_client/Tree/NodeDefinition.js
@@ -17,7 +17,7 @@ Umbraco.Controls.NodeDefinition = function() {
sourceUrl: null,
menu: null,
treeType: null,
- _isDebug: true,
+ _isDebug: false,
updateDefinition: function(jsTree, jsNode, nodeId, nodeName, nodeType, sourceUrl, menu, treeType) {
///
diff --git a/umbraco/presentation/umbraco_client/Tree/UmbracoTree.js b/umbraco/presentation/umbraco_client/Tree/UmbracoTree.js
index e1b5bdfa13..b8da612598 100644
--- a/umbraco/presentation/umbraco_client/Tree/UmbracoTree.js
+++ b/umbraco/presentation/umbraco_client/Tree/UmbracoTree.js
@@ -53,7 +53,7 @@ Umbraco.Sys.registerNamespace("Umbraco.Controls");
_app: null, //the reference to the current app
_showContext: true,
_isDialog: false,
- _isDebug: true, //set to true to enable alert debugging
+ _isDebug: false, //set to true to enable alert debugging
_loadedApps: [], //stores the application names that have been loaded to track which JavaScript code has been inserted into the DOM
_serviceUrl: "", //a path to the tree client service url
_dataUrl: "", //a path to the tree data service url
diff --git a/umbraco/presentation/umbraco_client/Tree/UmbracoTree.min.js b/umbraco/presentation/umbraco_client/Tree/UmbracoTree.min.js
index 9b34b6b14d..a8a3df5b49 100644
--- a/umbraco/presentation/umbraco_client/Tree/UmbracoTree.min.js
+++ b/umbraco/presentation/umbraco_client/Tree/UmbracoTree.min.js
@@ -1,6 +1,6 @@
Umbraco.Sys.registerNamespace("Umbraco.Controls"); (function($) {
$.fn.UmbracoTree = function(opts) { return this.each(function() { var conf = $.extend({ jsonFullMenu: null, jsonInitNode: null, appActions: null, uiKeys: null, app: "", showContext: true, isDialog: false, treeType: "standard", umb_clientFolderRoot: "/umbraco_client" }, opts); new Umbraco.Controls.UmbracoTree().init($(this), conf); }); }; $.fn.UmbracoTreeAPI = function() { return $(this).data("UmbracoTree") == null ? null : $(this).data("UmbracoTree"); }; Umbraco.Controls.UmbracoTree = function() {
- return { _actionNode: new Umbraco.Controls.NodeDefinition(), _activeTreeType: "content", _recycleBinId: -20, _umb_clientFolderRoot: "/umbraco_client", _fullMenu: null, _initNode: null, _menuActions: null, _tree: null, _uiKeys: null, _container: null, _app: null, _showContext: true, _isDialog: false, _isDebug: true, _loadedApps: [], _serviceUrl: "", _dataUrl: "", _treeType: "standard", _treeClass: "umbTree", _currenAJAXRequest: false, addEventHandler: function(fnName, fn) { $(this).bind(fnName, fn); }, removeEventHandler: function(fnName, fn) { $(this).unbind(fnName, fn); }, init: function(jItem, opts) { this._init(opts.jsonFullMenu, opts.jsonInitNode, jItem, opts.appActions, opts.uiKeys, opts.app, opts.showContext, opts.isDialog, opts.treeType, opts.serviceUrl, opts.dataUrl, opts.umb_clientFolderRoot); jItem.addClass(this._treeClass); jItem.data("UmbracoTree", this); }, rebuildTree: function(app) {
+ return { _actionNode: new Umbraco.Controls.NodeDefinition(), _activeTreeType: "content", _recycleBinId: -20, _umb_clientFolderRoot: "/umbraco_client", _fullMenu: null, _initNode: null, _menuActions: null, _tree: null, _uiKeys: null, _container: null, _app: null, _showContext: true, _isDialog: false, _isDebug: false, _loadedApps: [], _serviceUrl: "", _dataUrl: "", _treeType: "standard", _treeClass: "umbTree", _currenAJAXRequest: false, addEventHandler: function(fnName, fn) { $(this).bind(fnName, fn); }, removeEventHandler: function(fnName, fn) { $(this).unbind(fnName, fn); }, init: function(jItem, opts) { this._init(opts.jsonFullMenu, opts.jsonInitNode, jItem, opts.appActions, opts.uiKeys, opts.app, opts.showContext, opts.isDialog, opts.treeType, opts.serviceUrl, opts.dataUrl, opts.umb_clientFolderRoot); jItem.addClass(this._treeClass); jItem.data("UmbracoTree", this); }, rebuildTree: function(app) {
this._debug("rebuildTree"); if (this._app == null || (this._app.toLowerCase() == app.toLowerCase())) { this._debug("not rebuilding"); return; }
else { this._app = app; }
$("div").remove(".tree-default-context"); this._tree.destroy(); this._container.hide(); var _this = this; var saveData = this._container.data("tree_" + app); if (saveData != null) {