diff --git a/src/Umbraco.Core/Configuration/GlobalSettings.cs b/src/Umbraco.Core/Configuration/GlobalSettings.cs index 24fe959b61..406aa169b6 100644 --- a/src/Umbraco.Core/Configuration/GlobalSettings.cs +++ b/src/Umbraco.Core/Configuration/GlobalSettings.cs @@ -597,21 +597,11 @@ namespace Umbraco.Core.Configuration return context.Request.Path.ToLower().IndexOf(IOHelper.ResolveUrl(SystemDirectories.Umbraco).ToLower()) > -1; } - public static bool RequestIsLiveEditRedirector(HttpContext context) - { - return context.Request.Path.ToLower().IndexOf(SystemDirectories.Umbraco.ToLower() + "/liveediting.aspx") > -1; - } - public static bool RequestIsInUmbracoApplication(HttpContextBase context) { return context.Request.Path.ToLower().IndexOf(IOHelper.ResolveUrl(SystemDirectories.Umbraco).ToLower()) > -1; } - public static bool RequestIsLiveEditRedirector(HttpContextBase context) - { - return context.Request.Path.ToLower().IndexOf(SystemDirectories.Umbraco.ToLower() + "/liveediting.aspx") > -1; - } - /// /// Gets a value indicating whether umbraco should force a secure (https) connection to the backoffice. /// diff --git a/src/Umbraco.Core/IO/SystemFiles.cs b/src/Umbraco.Core/IO/SystemFiles.cs index 9dfde1e442..766ecc5562 100644 --- a/src/Umbraco.Core/IO/SystemFiles.cs +++ b/src/Umbraco.Core/IO/SystemFiles.cs @@ -51,14 +51,6 @@ namespace Umbraco.Core.IO return SystemDirectories.Config + "/dashboard.config"; } } - - public static string SkinningXml - { - get - { - return SystemDirectories.Data + "/skinning.config"; - } - } public static string NotFoundhandlersConfig { diff --git a/src/Umbraco.Core/PluginManager.cs b/src/Umbraco.Core/PluginManager.cs index e24573e4d4..b9f6b75172 100644 --- a/src/Umbraco.Core/PluginManager.cs +++ b/src/Umbraco.Core/PluginManager.cs @@ -497,9 +497,7 @@ namespace Umbraco.Core /// internal IEnumerable ResolveDataTypes() { - //ensure we ignore types that should not be loaded - return ResolveTypes() - .Except(new[] {Type.GetType("umbraco.presentation.LiveEditing.Modules.ItemEditing.PageElementEditor,umbraco")}); + return ResolveTypes(); } /// diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 70c86231b9..64f99def36 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -352,9 +352,6 @@ RenderingEngine.ascx - - loadStarterKitDesigns.ascx - loadStarterKits.ascx ASPXCodeBehind @@ -369,10 +366,6 @@ StarterKits.ascx - - loadStarterKitDesigns.ascx - ASPXCodeBehind - ASPXCodeBehind @@ -735,8 +728,6 @@ - - @@ -1725,7 +1716,6 @@ - @@ -1750,7 +1740,6 @@ - @@ -1760,20 +1749,6 @@ - - - - - - - - - - - - - - @@ -1804,7 +1779,6 @@ - @@ -1947,7 +1921,6 @@ - @@ -2120,18 +2093,6 @@ - - - - - - - - - - - - @@ -2205,7 +2166,6 @@ Designer - @@ -2234,7 +2194,6 @@ - diff --git a/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx b/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx deleted file mode 100644 index 864aeb5082..0000000000 --- a/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx +++ /dev/null @@ -1,69 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="True" CodeBehind="LoadStarterKitDesigns.ascx.cs" Inherits="Umbraco.Web.UI.Install.Steps.Skinning.LoadStarterKitDesigns" %> -<%@ Import Namespace="umbraco.cms.businesslogic.packager.repositories" %> - - - -

Starter kit and skin have been installed

- -
- -
- - - - - - -
- -
\ No newline at end of file diff --git a/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.cs b/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.cs deleted file mode 100644 index b45e00e586..0000000000 --- a/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.cs +++ /dev/null @@ -1,162 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI.WebControls; -using Umbraco.Core.Configuration; -using Umbraco.Core.Logging; -using Umbraco.Web.Install; -using umbraco; -using GlobalSettings = global::Umbraco.Core.Configuration.GlobalSettings; - -namespace Umbraco.Web.UI.Install.Steps.Skinning -{ - public delegate void StarterKitDesignInstalledEventHandler(); - - public partial class LoadStarterKitDesigns : StepUserControl - { - - public event StarterKitDesignInstalledEventHandler StarterKitDesignInstalled; - - protected virtual void OnStarterKitDesignInstalled() - { - if (StarterKitDesignInstalled != null) - StarterKitDesignInstalled(); - } - - public Guid StarterKitGuid { get; set; } - - private readonly global::umbraco.cms.businesslogic.packager.repositories.Repository _repo; - private const string RepoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; - - public LoadStarterKitDesigns() - { - _repo = global::umbraco.cms.businesslogic.packager.repositories.Repository.getByGuid(RepoGuid); - } - - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - - if (_repo == null) - { - throw new InvalidOperationException("Could not find repository with id " + RepoGuid); - } - - if (_repo.HasConnection()) - { - try - { - //clear progress bar cache - InstallHelper.ClearProgress(); - - var skinsCollection = _repo.Webservice.Skins(StarterKitGuid.ToString()); - - var numberOfSkins = skinsCollection.Length; - this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "skinCounter", "var numberOfSkins = " + numberOfSkins, true); - - rep_starterKitDesigns.DataSource = skinsCollection; - rep_starterKitDesigns.DataBind(); - } - catch (Exception ex) - { - LogHelper.Error("An error occurred initializing", ex); - - ShowConnectionError(); - } - } - else - { - ShowConnectionError(); - } - } - - private void ShowConnectionError() - { - - var fb = new global::umbraco.uicontrols.Feedback - { - type = global::umbraco.uicontrols.Feedback.feedbacktype.error, - Text = "No connection to repository. Starter Kits Designs could not be fetched from the repository as there was no connection to: '" + _repo.RepositoryUrl + "'" - }; - - pl_loadStarterKitDesigns.Controls.Clear(); - pl_loadStarterKitDesigns.Controls.Add(fb); - } - - protected void SelectStarterKitDesign(object sender, EventArgs e) - { - InstallHelper.ClearProgress(); - - var kitGuid = new Guid(((LinkButton)sender).CommandArgument); - - if (!global::umbraco.cms.businesslogic.skinning.Skinning.IsSkinInstalled(kitGuid)) - { - - InstallHelper.SetProgress(5, "Fetching starting kit from the repository", ""); - - var installer = new global::umbraco.cms.businesslogic.packager.Installer(); - - if (_repo.HasConnection()) - { - var p = new global::umbraco.cms.businesslogic.packager.Installer(); - - InstallHelper.SetProgress(15, "Connected to repository", ""); - - string tempFile = p.Import(_repo.fetch(kitGuid.ToString())); - p.LoadConfig(tempFile); - int pID = p.CreateManifest(tempFile, kitGuid.ToString(), RepoGuid); - - InstallHelper.SetProgress(30, "Installing skin files", ""); - p.InstallFiles(pID, tempFile); - - InstallHelper.SetProgress(50, "Installing skin system objects", ""); - p.InstallBusinessLogic(pID, tempFile); - - InstallHelper.SetProgress(60, "Finishing skin installation", ""); - p.InstallCleanUp(pID, tempFile); - - library.RefreshContent(); - - InstallHelper.SetProgress(80, "Activating skin", ""); - if (global::umbraco.cms.businesslogic.skinning.Skinning.GetAllSkins().Count > 0) - { - global::umbraco.cms.businesslogic.skinning.Skinning.ActivateAsCurrentSkin( - global::umbraco.cms.businesslogic.skinning.Skinning.GetAllSkins()[0]); - } - - - InstallHelper.SetProgress(100, "Skin installation has been completed", ""); - - try - { - - - if (string.IsNullOrEmpty(GlobalSettings.ConfigurationStatus)) - { - GlobalSettings.ConfigurationStatus = UmbracoVersion.Current.ToString(3); - } - } - catch - { - - } - - try - { - InstallHelper.RedirectToNextStep(Page, GetCurrentStep()); - } - catch - { - OnStarterKitDesignInstalled(); - } - } - else - { - ShowConnectionError(); - } - - } - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.designer.cs b/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.designer.cs deleted file mode 100644 index 7ee546bdd2..0000000000 --- a/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.designer.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Umbraco.Web.UI.Install.Steps.Skinning { - - - public partial class LoadStarterKitDesigns { - - /// - /// pl_loadStarterKitDesigns control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder pl_loadStarterKitDesigns; - - /// - /// pl_CustomizeSkin control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel pl_CustomizeSkin; - - /// - /// rep_starterKitDesigns control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Repeater rep_starterKitDesigns; - } -} diff --git a/src/Umbraco.Web.UI/install/steps/StarterKits.ascx.cs b/src/Umbraco.Web.UI/install/steps/StarterKits.ascx.cs index ffb4ad8e39..579f8b7413 100644 --- a/src/Umbraco.Web.UI/install/steps/StarterKits.ascx.cs +++ b/src/Umbraco.Web.UI/install/steps/StarterKits.ascx.cs @@ -10,10 +10,7 @@ namespace Umbraco.Web.UI.Install.Steps protected void Page_Load(object sender, EventArgs e) { - if (!global::umbraco.cms.businesslogic.skinning.Skinning.IsStarterKitInstalled()) - ShowStarterKits(); - else - ShowStarterKitDesigns((Guid)global::umbraco.cms.businesslogic.skinning.Skinning.StarterKitGuid()); + ShowStarterKits(); } @@ -26,19 +23,6 @@ namespace Umbraco.Web.UI.Install.Steps } - - private void ShowStarterKitDesigns(Guid starterKitGuid) - { - var ctrl = (LoadStarterKitDesigns)LoadControl(SystemDirectories.Install + "/steps/Skinning/loadStarterKitDesigns.ascx"); - ctrl.ID = "StarterKitDesigns"; - - ctrl.StarterKitGuid = starterKitGuid; - ph_starterKitDesigns.Controls.Add(ctrl); - - pl_starterKit.Visible = false; - pl_starterKitDesign.Visible = true; - } - - + } } \ No newline at end of file diff --git a/src/Umbraco.Web.UI/install/steps/TheEnd.ascx.cs b/src/Umbraco.Web.UI/install/steps/TheEnd.ascx.cs index 8b824027f1..4053f0c782 100644 --- a/src/Umbraco.Web.UI/install/steps/TheEnd.ascx.cs +++ b/src/Umbraco.Web.UI/install/steps/TheEnd.ascx.cs @@ -20,10 +20,7 @@ namespace Umbraco.Web.UI.Install.Steps // Update ClientDependency version var clientDependencyConfig = new ClientDependencyConfiguration(); var clientDependencyUpdated = clientDependencyConfig.IncreaseVersionNumber(); - - if (!global::umbraco.cms.businesslogic.skinning.Skinning.IsStarterKitInstalled()) - customizeSite.Visible = false; - + } } diff --git a/src/Umbraco.Web.UI/install/steps/TheEnd.ascx.designer.cs b/src/Umbraco.Web.UI/install/steps/TheEnd.ascx.designer.cs index 3d8ea899fc..2c7c5fe114 100644 --- a/src/Umbraco.Web.UI/install/steps/TheEnd.ascx.designer.cs +++ b/src/Umbraco.Web.UI/install/steps/TheEnd.ascx.designer.cs @@ -11,14 +11,5 @@ namespace Umbraco.Web.UI.Install.Steps { public partial class TheEnd { - - /// - /// customizeSite control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlGenericControl customizeSite; } } diff --git a/src/Umbraco.Web.UI/install/steps/theend.ascx b/src/Umbraco.Web.UI/install/steps/theend.ascx index 2df9c738ca..11404d8608 100644 --- a/src/Umbraco.Web.UI/install/steps/theend.ascx +++ b/src/Umbraco.Web.UI/install/steps/theend.ascx @@ -31,8 +31,7 @@ jQuery(document).ready(function () { source .NET CMS.
If you installed a starter kit you can start by configuring your new site, just click "Preview your new website" and follow the instructions. Or to start adding content right away click "Set up your new website"

-
    -
  • &umbSkinning=true&umbSkinningConfigurator=true" target="_blank">Set up your new website
  • + diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Controls/Communicator.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Controls/Communicator.js deleted file mode 100644 index 734bb0933d..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Controls/Communicator.js +++ /dev/null @@ -1,33 +0,0 @@ -// Umbraco Live Editing: Communicator - -/********************* Communicator Constructor *********************/ - - function UmbracoCommunicator() { } - - - -/********************* Communicator Methods *********************/ - - // Sends a message to the client using the communicator. - UmbracoCommunicator.prototype.SendClientMessage = function(type, message) { - // find the communicator - var divs = document.getElementsByTagName("div"); - var communicator = null; - for (var i = 0; i < divs.length && communicator == null; i++) - if (divs[i].className == "communicator") - communicator = divs[i]; - Sys.Debug.assert(communicator != null, "LiveEditing: Communicator not found."); - - // send the message - var typeBox = communicator.childNodes[0].childNodes[0]; - var messageBox = communicator.childNodes[0].childNodes[1]; - var submit = communicator.childNodes[0].childNodes[2]; - typeBox.value = type; - messageBox.value = message; - submit.click(); - } - - -/********************* Communicator Instance *********************/ - - var UmbracoCommunicator = new UmbracoCommunicator(); \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Controls/LiveEditingToolbar.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Controls/LiveEditingToolbar.js deleted file mode 100644 index ac5e9457f0..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Controls/LiveEditingToolbar.js +++ /dev/null @@ -1,99 +0,0 @@ -Type.registerNamespace("umbraco.presentation.LiveEditing.Controls"); - -/************************************ Toolbar class ***********************************/ - -// Constructor. -umbraco.presentation.LiveEditing.Controls.LiveEditingToolbar = function() { - umbraco.presentation.LiveEditing.Controls.LiveEditingToolbar.initializeBase(this); - this._inited = false; - - // init toolbar on application load - var liveEditingToolbar = this; - Sys.Application.add_load(function() { liveEditingToolbar._init(); }); -} - -umbraco.presentation.LiveEditing.Controls.LiveEditingToolbar.prototype = { - // Initialize the toolbar. - _init: function() { - if (!this._inited) { - var liveEditingToolbar = this; - Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function(sender, args) { liveEditingToolbar._handleError(sender, args); }); - this._inited = true; - } - }, - - // Fires the Save event. - _save: function() { - var handler = this.get_events().getHandler("save"); - var args = new Sys.EventArgs(); - args.cancel = false; - if (handler) - handler(this, args); - - if (!args.cancel) { - this.setDirty(false); - UmbSpeechBubble.ShowMessage("Info", "Saving", "Save in progress..."); - } - return !args.cancel; - - }, - - // Adds a listener for the Save event. - add_save: function(handler) { - this.get_events().addHandler("save", handler); - }, - - // Removes a listener for the Save event. - remove_save: function(handler) { - this.get_events().removeHandler("save", handler); - }, - - // Fires the Save and Publish event. - _saveAndPublish: function() { - var handler = this.get_events().getHandler("saveAndPublish"); - var args = new Sys.EventArgs(); - args.cancel = false; - if (handler) - handler(this, args); - - if (!args.cancel) { - this.setDirty(false); - UmbSpeechBubble.ShowMessage("Info", "Publishing", "Save and publish in progress..."); - } - return !args.cancel; - }, - - // Adds a listener for the Save and Publish event. - add_saveAndPublish: function(handler) { - this.get_events().addHandler("saveAndPublish", handler); - }, - - // Removes a listener for the Save and Publish event. - remove_saveAndPublish: function(handler) { - this.get_events().removeHandler("saveAndPublish", handler); - }, - - // Sets whether the pages has unsaved changes. - setDirty: function(isDirty) { - window.onbeforeunload = isDirty ? function() { return "You have unsaved changes."; } : null; - }, - - // Global error handler. Displays a tooltip with the error message. - _handleError: function(sender, args) { - if (args.get_error() != undefined) { - var errorMessage; - if (args.get_response().get_statusCode() == '200') { - errorMessage = args.get_error().message; - } - else { - errorMessage = "An unspecified error occurred."; - } - args.set_errorHandled(true); - UmbSpeechBubble.ShowMessage("info", "Error", errorMessage); - } - } -} - -// Register the class and create a global instance. -umbraco.presentation.LiveEditing.Controls.LiveEditingToolbar.registerClass("umbraco.presentation.LiveEditing.Controls.LiveEditingToolbar", Sys.Component); -var LiveEditingToolbar = new umbraco.presentation.LiveEditing.Controls.LiveEditingToolbar(); \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Css/LiveEditing.css b/src/Umbraco.Web.UI/umbraco/LiveEditing/Css/LiveEditing.css deleted file mode 100644 index f2dc632e6d..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Css/LiveEditing.css +++ /dev/null @@ -1,370 +0,0 @@ -/***************************************************************** - - Live Editing placeholders - -/****************************************************************/ - -umbraco\:iteminfo { - cursor: pointer; - border: 1px dashed #bbb; - padding: 5px; -} - -.liveEditingForceBlockMode { - display: block; -} - -umbraco\:iteminfo:hover -{ - border: 2px dashed #f36f21; - padding: 5px; -} - -/***************************************************************** - - General Toolbar CSS - -/****************************************************************/ - -html { - margin-top: 30px !important; -} - -#LiveEditingToolbar -{ - font-family:"Trebuchet MS",verdana,arial; - background: url(../../../umbraco_client/tabView/images/background.gif) !important; - position: fixed !important; - width: 100% !important; - height: 34px !important; - top: 0 !important; - left: 0 !important; - text-align: left !important; - border-bottom: 1px solid #B0B0B0 !important; -} - -#LiveEditingToolbar div { - padding: 4px !important; -} - -#LiveEditingToolbar div div { - padding: inherit !important; -} - -#LiveEditingToolbar div.ExtraMenuItems { - display: inline !important; -} - -#LiveEditingToolbar div { - /*background: url(/umbraco/LiveEditing/Images/Canvas.gif) no-repeat right 4px; */ - width: 100%; -} - -#LiveEditingToolbar * div { - background: none; - width: auto; -} - -#LiveEditingToolbar input.button { - cursor: hand !important; - width: 22px !important; - height: 23px !important; - background: none !important; - border: none !important; -} - -#LiveEditingToolbar input.button:hover, #LiveEditingClientToolbar a.mceButtonEnabled:hover { - background-image: url(../../../umbraco_client/menuicon/images/buttonbg.gif) !important; - border: none !important; -} - -#LiveEditingToolbar input.close { - position: absolute !important; - right: 7px !important; - top: 6px !important; - /*border: none !Important; - background: none !Important; */ - color: #000; - width: 150px; -} - -#LiveEditingToolbar input.close:hover { - opacity: 1 !important; -} - -#LiveEditingToolbar img.about { - margin: 0 5px 5px 5px !important; -} - -#LiveEditingClientToolbar, #LiveEditingClientToolbar div { - display: inline !important; -} - -#LiveEditingToolbar span.separator { - padding-right: 7px !important; -} - -#LiveEditingToolbar span.separator span { - border-left: 1px solid #999999 !important; - border-right: 1px solid #EEEEEE !important; - position: absolute !important; - top: 7px !important; - width: 0px !important; - overflow: hidden !important; -} - -#LiveEditingToolbar .umbLabelButton -{ - cursor: hand !important; - float: left; - margin: 1px 5px 1px 1px; - padding: 0 !important; -} - -#LiveEditingToolbar .umbLabelButton:hover -{ - background: #EAEAEA; - border: 1px solid #CAC9C9 !Important; - margin: 0px 4px 0px 0px; -} - -#LiveEditingToolbar .umbLabelButton a -{ - text-decoration: none; - font-size: 80%; - margin-right: 3px; - padding: 5px 0; -} - - -#LiveEditingToolbar .umbLabelButton input.button { - width: 22px !important; - height: 23px !important; - margin-right: 3px; - background: none !important; - border: none !important; - vertical-align: middle; -} - -#LiveEditingToolbar .umbLabelButton input.button:hover { - background-image: none !important; - border: none !important; -} - -/***************************************************************** - - TinyMCE extra CSS - -/****************************************************************/ - -/* hide the temporary TinyMCE container */ -.tinymceContainer { - position: absolute !important; - left: -1000px !important; -} - -#LiveEditingClientToolbar .mceToolbarExternal table { - display: inline !important; - background: none !important; - margin: 0 !important; -} - -#LiveEditingClientToolbar .mceToolbarExternal { - position: absolute !important; - top: 0 !important; -} - -#LiveEditingClientToolbar a.mceButtonEnabled { - width: 22px !important; - height: 23px !important; -} - -/***************************************************************** - - Datatypes extra CSS - -/****************************************************************/ - -.relatedlinksdatatype -{ - background-color: #fff !important; - border: 1px solid #999 !important; -} - -/***************************************************************** - - Modal dialogs - -/****************************************************************/ - -.umbModalBox h1 -{ - font-size: larger !important; -} - -.umbModalBox h2 -{ - font-size: medium !important; -} - -.umbModalBox label -{ - padding-bottom: 2px !Important; - display: block !Important; - color: #666 !Important; - font-family:Trebuchet MS,Lucida Grande,verdana,arial ! important; -} - -.umbModalBox p -{ - font-size: 12px !important; - font-family:Trebuchet MS,Lucida Grande,verdana,arial ! important; - color:Black ! important; - margin-bottom:5px; -} - -.umbModalBox p select -{ - margin-bottom:10px ! important; -} - -.umbModalBox p{font-size: 11px !Important} - - -#skins ul{list-style: none; padding: 0px; display: block; clear: both; height: 200px;} -#skins ul li{margin-right: 12px; float: left; border: 1px solid #efefef; padding: 5px; width: 120px; text-align: center; font-weight: normal;} - - -/***************************************************************** - - Umbraco UI Components - -/****************************************************************/ - -.propertypane { - position: relative; - display: block; - line-height: 1.1; - background: #fff url('/umbraco_client/propertypane/images/propertyBackground.gif') top repeat-x !Important; - background-image:url(/umbraco_client/propertypane/images/propertyBackground.gif) !Important; - padding: 5px; - margin:7px 0px 0px 0px; - border: 1px solid #d9d7d7; - text-align:left; - clear: both; - float: none; - color: black; - font-size: 11px !Important; - } - - .propertypane th - { - vertical-align: top; - text-align:left; - font-weight:bold; - font-family: Trebuchet MS, Lucida Grande, verdana, arial; - font-size:12px; - width: 16%; - } - - .propertypane,.propertypane td - { - font-family: Trebuchet MS, Lucida Grande, verdana, arial; - font-size:12px; - } - - - .propertypane small - { - font-weight: normal; - color: #666; - } - - .propertypane div.propertyItem{ - padding-bottom: 5px; - clear: both; - font-family: Trebuchet MS, Lucida Grande, verdana, arial; - font-size:12px; - } - - .propertypane div.propertyItem .propertyItemheader{ - width: 16%; - padding-right: 1%; - padding-bottom: 10px; - float: left; - clear: left; - font-weight:bold; - } - - .propertypane div.propertyItem .propertyItemContent{ - float: left; - padding-bottom: 5px; - clear: right; - } - - h2.propertypaneTitel{font-size: 14px; color: #999;margin: 7px 0px 0px 0px; padding-bottom: 0px; line-height: 14px;} - - div.propertyPaneFooter{clear: both; height: 1px; overflow: hidden; color: #fff;} - -#LiveEditingToolbar .ModuleSelector -{ - background-color:#FFF !important; - position:absolute; - top:36px; - left:270px; - color:#000; - border-left:5px solid #A3A3A3; - border-right:5px solid #A3A3A3; - border-bottom:5px solid #A3A3A3; - z-index:100; -} - -#LiveEditingToolbar #moduleSelectorContainer -{ - padding:10px; -} - -.umbModuleContainerSelector -{ - cursor:pointer; -} - -p#installingModule img -{ - float:none; - margin:0; - padding:0; -} - -#LiveEditingToolbar #modules ul -{ - list-style-type:none; - margin-left:0px; - margin-right:0px; -} - -#LiveEditingToolbar #modules ul li -{ - display:block; - padding-bottom:5px; - padding-top:5px; - border-bottom:1px solid #c3c3c3; -} - - #LiveEditingToolbar .umbLabelButton a, #LiveEditingToolbar .umbLabelButton a:hover -{ - color:Black !important; -} - -.umbModalBox a, .umbModalBox a:hover -{ - color:#888 !important; -} - -/* skin customize dialog */ -#costumizeSkin #dependencies .propertypane -{ - height:205px; - overflow:scroll; - overflow-x: hidden; -} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Images/canvas.gif b/src/Umbraco.Web.UI/umbraco/LiveEditing/Images/canvas.gif deleted file mode 100644 index cdc7bd0793..0000000000 Binary files a/src/Umbraco.Web.UI/umbraco/LiveEditing/Images/canvas.gif and /dev/null differ diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Images/dialog_background.png b/src/Umbraco.Web.UI/umbraco/LiveEditing/Images/dialog_background.png deleted file mode 100644 index 208d9c259a..0000000000 Binary files a/src/Umbraco.Web.UI/umbraco/LiveEditing/Images/dialog_background.png and /dev/null differ diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/LiveEditing.cd b/src/Umbraco.Web.UI/umbraco/LiveEditing/LiveEditing.cd deleted file mode 100644 index 0eef6089d2..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/LiveEditing.cd +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - AAACAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAgACAA= - UmbracoContext.cs - - - - - - - - - AAABAAAAQAAEIhAAEAEAAAAQAAAAAEQAAAAAFAgAEAA= - umbraco\LiveEditing\Controls\LiveEditingManager.cs - - - - - - - - - - - BAAAAAAAAAIAKBAAAGCAIAAQAAAAAAQAAFgAAAABAAA= - umbraco\LiveEditing\Controls\LiveEditingToolbar.cs - - - - - - AAAAAAAAQAAAABAQAECAAAAgAAAAAAQAABBAAAAQAAA= - umbraco\LiveEditing\Controls\Communicator.cs - - - - - - AAAAAAAAAAAAAIAAAAAAAAAAAAAIAAAAAAAAAgAAAAA= - umbraco\LiveEditing\ILiveEditingContext.cs - - - - - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - umbraco\LiveEditing\Menu\ILiveEditingMenu.cs - - - - - - AAIAAAAAAAAAAAABAAAAAGAAAAAAAAAAAgAAAAAAIAA= - umbraco\LiveEditing\Updates\IUpdateList.cs - - - - \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/CreateModule/CreateModule.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/CreateModule/CreateModule.js deleted file mode 100644 index e278c4b3ab..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/CreateModule/CreateModule.js +++ /dev/null @@ -1,5 +0,0 @@ -/********************* Live Editing CreateModule functions *********************/ -function CreateModuleOk() -{ - UmbracoCommunicator.SendClientMessage('createcontent', ''); -} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/CreateModule/create.png b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/CreateModule/create.png deleted file mode 100644 index ea3f06e5a6..0000000000 Binary files a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/CreateModule/create.png and /dev/null differ diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/DeleteModule/DeleteModule.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/DeleteModule/DeleteModule.js deleted file mode 100644 index 91771b4616..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/DeleteModule/DeleteModule.js +++ /dev/null @@ -1,5 +0,0 @@ -/********************* Live Editing DeleteModule functions *********************/ -function DeleteModuleOk() -{ - UmbracoCommunicator.SendClientMessage('deletecontent', ''); -} diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/DeleteModule/delete.png b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/DeleteModule/delete.png deleted file mode 100644 index 183ddd1ce1..0000000000 Binary files a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/DeleteModule/delete.png and /dev/null differ diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/ItemEditing/ItemEditing.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/ItemEditing/ItemEditing.js deleted file mode 100644 index b0644e5b3c..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/ItemEditing/ItemEditing.js +++ /dev/null @@ -1,341 +0,0 @@ -// Umbraco Live Editing - ItemEditing: Item Editing -var ItemEditing = null; - -Type.registerNamespace("umbraco.presentation.LiveEditing"); - -/************************ ItemEditing class ************************/ - -// Creates a new instance of the ItemEditing class. -umbraco.presentation.LiveEditing.ItemEditing = function() { - umbraco.presentation.LiveEditing.ItemEditing.initializeBase(this); - this._inited = false; - this._items = new Array(); - this._activeItem = null; - this._editControl = null; - this._submitControl = null; - - var _this = this; - Sys.Debug.trace("Constructor, before init load"); - if (!this._inited) { - _this.init(); - } - Sys.Application.add_load(function() { - _this.init(); - }); - Sys.Debug.trace("Constructor, after init load"); - -} - -umbraco.presentation.LiveEditing.ItemEditing.prototype = { - // Initializes this instance. - init: function() { - Sys.Debug.trace("In init..."); - if (!this._inited) { - this._inited = true; - Sys.Debug.trace("Live Editing - ItemEditing: Initialization."); - Sys.Debug.assert(typeof (jQuery) == 'function', "jQuery is not loaded."); - - this.itemsEnable(); - - var _this = this; - LiveEditingToolbar.add_save(function(sender, args) { _this.delaySaveWhenEditing(args, "save"); }); - LiveEditingToolbar.add_saveAndPublish(function(sender, args) { _this.delaySaveWhenEditing(args, "saveAndPublish"); }); - - this._inited = true; - Sys.Debug.trace("Live Editing - ItemEditing: Ready."); - } - else { - this.updateItems(); - this.updateControls(); - } - }, - - // Starts Live Editing the specified item. - // This method is triggered by the server. - startEdit: function(itemId) { - Sys.Debug.trace("Live Editing - ItemEditing: Start editing of Item " + itemId + "."); - - this._activeItem = this._items[itemId]; - Sys.Debug.assert(this._activeItem != null, "Live Editing - ItemEditing: Could not find item with ID " + itemId + "."); - this._editControl = this.getElementsByTagName("umbraco:control"); - Sys.Debug.assert(this._editControl.length > 0, "Live Editing - ItemEditing: Could not find the editor control."); - //this._activeItem.jItem.fadeIn(); - this.moveChildControls(this._editControl, this._activeItem.jItem); - - // Only elements that are currently present, can cause item editing to stop. - // This enables transparent use of dynamically created elements (such as context/dropdown menus) - // as clicks on those elements will not trigger the stop edit signal. - jQuery("*").each(function () { jQuery(this).data("canStopEditing", true); }); - - // raise event - var handler = this.get_events().getHandler("startEdit"); - if (handler) - handler(this, Sys.EventArgs.Empty); - - this.ignoreChildClicks(this._activeItem.jItem); - - LiveEditingToolbar.setDirty(true); - }, - - // Stops the editing of a specified item, and raises the stopEdit event. - stopEdit: function() { - if (this._activeItem != null) { - Sys.Debug.trace("Live Editing - ItemEditing: Stop editing of " + this._activeItem.toString() + "."); - - // raise event - var handler = this.get_events().getHandler("stopEdit"); - if (handler) - handler(this, Sys.EventArgs.Empty); - - // submit changes - Sys.Debug.assert(this._submitControl != null, "Live Editing - ItemEditing: Submit button not set."); - this._submitControl.click(); - - // hide control - //this._activeItem.jItem.fadeOut(); - this._activeItem = null; - this._submitControl = null; - this._editControl = null; - } - }, - - // Adds an event handler to the startEdit event. - add_startEdit: function(handler) { - this.get_events().addHandler("startEdit", handler); - }, - - // Removes an event handler from the startEdit event. - remove_startEdit: function(handler) { - this.get_events().removeHandler("startEdit", handler); - }, - - // Adds an event handler to the stopEdit event. - add_stopEdit: function(handler) { - this.get_events().addHandler("stopEdit", handler); - }, - - // Removes an event handler from the stopEdit event. - remove_stopEdit: function(handler) { - this.get_events().removeHandler("stopEdit", handler); - }, - - // Cancels the save method when an item is active, and postpones it to the next postback. - delaySaveWhenEditing: function(args, type) { - if (this._activeItem != null) { - this.stopEdit(); - args.cancel = true; - (function() { - var f = function() { - Sys.Application.remove_load(f); - setTimeout(function() { - Sys.Debug.trace("Live Editing - Delayed Saving Changes to server"); - UmbracoCommunicator.SendClientMessage(type, ""); - }, 100); - } - Sys.Application.add_load(f); - })(); - } - else { - Sys.Debug.trace("Live Editing - Saving Changes to server"); - if (!Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()) { - UmbracoCommunicator.SendClientMessage(type, ""); - } - else { - Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function() { - UmbracoCommunicator.SendClientMessage(type, ""); - }); - } - } - }, - - // Enables Live Editing of items. - itemsEnable: function() { - var items = this.getElementsByTagName("umbraco:iteminfo"); - Sys.Debug.trace(" Found " + items.length + " editable Umbraco item(s)."); - - // enhance items with edit functionality - var _this = this; - var i = 0; - items.each(function() { - var item = new umbraco.presentation.LiveEditing.activeItem(jQuery(this)); - _this._items[item.itemId] = item; - Sys.Debug.trace(" " + (++i) + ". " + item.toString() + " is Live Editing enabled."); - }); - // disable hyperlinks to make them clickable for Live Editing - this.disableHyperlinks(); - - // add "stop editing" handler when clicking outside the item - var _this = this; - jQuery(document).mousedown(function(event) { - Sys.Debug.trace("DOCUMENT CLICKED"); - // the canStopEditing property is set in startEdit - if (_this._activeItem != null && jQuery(event.target).data("canStopEditing")) { - if (!_this._activeItem.clicked) - _this.stopEdit(); - else - _this._activeItem.clicked = false; - } - }); - jQuery("#LiveEditingToolbar").mousedown(function() { - Sys.Debug.trace("TOOLBAR CLICKED"); - if (_this._activeItem != null) - _this._activeItem.clicked = true; - }); - }, - - // Update items that have changed. - updateItems: function() { - var itemUpdates = this.getElementsByTagName("umbraco:itemupdate"); - Sys.Debug.trace("Live Editing - ItemEditing: " + itemUpdates.length + " item update(s)."); - - var _this = this; - itemUpdates.each(function() { - var itemUpdate = jQuery(this); - var itemId = itemUpdate.attr("itemId"); - var item = _this._items[itemId]; - - if (item != null) { - Sys.Debug.trace(" Updating " + item.toString() + "."); - - // remove old children and add updates ones - _this.moveChildControls(itemUpdate, item.jItem); - //item.jItem.fadeIn(); - - // disable hyperlinks to make them clickable for Live Editing - _this.disableHyperlinks(); - } - else { - itemUpdate.html(""); - } - }); - }, - - // Update controls that have changed. - updateControls: function() { - Sys.Debug.trace("Live Editing - ItemEditing: In updatecontrols"); - var controlUpdates = this.getElementsByTagName("umbraco:control"); - Sys.Debug.trace("Live Editing - ItemEditing: " + controlUpdates.length + " control update(s)."); - - if (controlUpdates.length == 1) { - if (this._activeItem != null && controlUpdates.children().length > 0) { - Sys.Debug.trace("Live Editing - ItemEditing: updating edit control."); - this.moveChildControls(controlUpdates, this._activeItem.jItem); - this.ignoreChildClicks(); - } - - this._submitControl = controlUpdates.next(); - Sys.Debug.assert(this._submitControl.length > 0, "Live Editing - ItemEditing: Submit button not found."); - } - }, - - // ignores clicks on child elements of the control - ignoreChildClicks: function() { - var _this = this; - this._activeItem.jItem.children().mousedown(function(e) { - _this._activeItem.clicked = true; - }); - }, - - // Moves the child controls from source into destination, overwriting existing elements. - moveChildControls: function(source, dest) { - Sys.Debug.trace("Live Editing - Moving Child Controls"); - - //remove contents in the destination - dest.html(""); - - //add the source to the destination - dest.append(source.html()); - - //remove teh contents from the source - source.html(""); - - }, - - // Gets a list of elements with the specified tagname including namespaced ones - getElementsByTagName: function(tagname) { - var found = jQuery("body").find("*").filter(function(index) { - if (this.nodeType != 3) { - var nn = this.nodeName.toLowerCase(); - var ftn = tagname.toLowerCase(); - var ln = (ftn.indexOf(":") > 0 ? ftn.substr(ftn.indexOf(":") + 1) : ftn); - return (nn == ftn - || (typeof this.scopeName != "undefined" && nn == ln && this.scopeName.toLowerCase() == ftn.substr(0, ftn.indexOf(":")))); - } - return false; - }); - Sys.Debug.trace("found " + found.length + " elements with selector: " + tagname); - return found; - }, - - // Disables hyperlinks inside the specified element. - disableHyperlinks: function() { - jQuery("a").click(function() { - return false; - }); - } -} - -umbraco.presentation.LiveEditing.ItemEditing.registerClass("umbraco.presentation.LiveEditing.ItemEditing", Sys.Component); - -//an object to store the information for the active item -umbraco.presentation.LiveEditing.activeItem = function(item) { - //error checking - if (item != null && item.length != 1) { - return null; - } - //create the object with values, wire up events and return it - var obj = { - jItem: item, - nodeId: item.attr("nodeId"), - fieldName: item.attr("name"), - itemId: item.attr("itemId"), - clicked: false, - toString: function() { - return "Item " + this.itemId + " (node " + this.nodeId + ": " + this.fieldName + ")"; - }, - // Activates an item for editing. - activate: function() { - ItemEditing._items[this.itemId] = this; - if (this != ItemEditing._activeItem) { - Sys.Debug.trace("Live Editing - ItemEditing: " + this.toString() + " was activated."); - if (!Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()) { - UmbracoCommunicator.SendClientMessage("edititem", this.itemId); - } - else { - var itemId = this.itemId; - Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function() { - if (itemId != 0) { - UmbracoCommunicator.SendClientMessage("edititem", itemId); - itemId = 0; - } - }); - } - //this.jItem.fadeOut(); - } - }, - // Item click handler. - onClick: function(e) { - if (ItemEditing._activeItem != null && ItemEditing._activeItem.itemId == this.itemId) { - Sys.Debug.trace("Live Editing - ItemEditing: " + this.toString() + " click ignored because it is already active."); - } - else { - Sys.Debug.trace("Live Editing - ItemEditing: " + this.toString() + " was clicked."); - e.stopPropagation(); // disable click event propagation to parent elements - this.activate(); - } - } - } - - //keep the scope on the click event method call - obj.jItem.click(function(e) { - obj.onClick.call(obj, e); - }); - - return obj; -} - - -// global instance of the ItemEditing class -function initializeGlobalItemEditing() { - ItemEditing = new umbraco.presentation.LiveEditing.ItemEditing(); -} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/ItemEditing/ItemEditingInvoke.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/ItemEditing/ItemEditingInvoke.js deleted file mode 100644 index 47c371631d..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/ItemEditing/ItemEditingInvoke.js +++ /dev/null @@ -1,3 +0,0 @@ -//this is simply used for live editing in order to invoke a method from a previously lazy loaded script; -//alert("ItemEditingInvoke: " + initializeGlobalItemEditing); -initializeGlobalItemEditing(); \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/MacroModule/MacroModule.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/MacroModule/MacroModule.js deleted file mode 100644 index 80721af012..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/MacroModule/MacroModule.js +++ /dev/null @@ -1,21 +0,0 @@ -/********************* Live Editing MacroModule functions *********************/ - -function MacroOnDrop( sender, e ) -{ -var container = e.get_container(); -var item = e.get_droppedItem(); -var position = e.get_position(); - -//alert( String.format( "Container: {0}, Item: {1}, Position: {2}", container.id, item.id, position ) ); - -var instanceId = parseInt(item.getAttribute("InstanceId")); -var columnNo = parseInt(container.getAttribute("columnNo")); -var row = position; - -} - -function okAddMacro(sender, e) -{ - $find('ModalMacro').hide(); - /*__doPostBack('AddMacro', e); */ -} diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx deleted file mode 100644 index 1ebd8692cf..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx +++ /dev/null @@ -1 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CssParser.aspx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.CssParser" %> \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx deleted file mode 100644 index 63e64045cc..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx +++ /dev/null @@ -1,193 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ImageUploader.aspx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.ImageUploader" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -

    - or Cancel -

    -
    - - - - - - - - -
    - -
    -
    - - -
    -
    -
    -
    - - - - - - -
    - -

    - or Cancel -

    - -
    - - - - diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx deleted file mode 100644 index 253ce9ead3..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx +++ /dev/null @@ -1 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModuleInjectionMacroRenderer.aspx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.ModuleInjectionMacroRenderer" %> diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx deleted file mode 100644 index 8909fc1f36..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx +++ /dev/null @@ -1,141 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModuleInjector.aspx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.ModuleInjector" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> -<%@ Import Namespace="Umbraco.Core.Configuration" %> -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - - - - - - - - - - - - - - - - - -
    - - -
    -
    -
    - -
    -
    -
    -
    - -
    - -

    - " - onclick="updateMacro()" /> -

    -
    - - diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx deleted file mode 100644 index 48eb082bca..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx +++ /dev/null @@ -1 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModuleInstaller.aspx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.ModuleInstaller" %> diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx deleted file mode 100644 index 01e108cf36..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx +++ /dev/null @@ -1,55 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ModuleSelector.ascx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.ModuleSelector" %> -<%@ Import Namespace="umbraco.cms.businesslogic.packager.repositories" %> - - -
    - - - -
    -

    Please select the module you wish to insert.

    -
      - - -
    • - - - <%# ((Package)Container.DataItem).Text %> - <%# ((Package)Container.DataItem).Text %> - - - -
    • -
      - -
    -
    - - - -
    - -

    -Unable to fetch module, please try again later. -

    - - - - - - Cancel -
    diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx deleted file mode 100644 index 8bcd50acd8..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx +++ /dev/null @@ -1,125 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SkinCustomizer.ascx.cs" Inherits="umbraco.presentation.LiveEditing.Modules.SkinModule.SkinCustomizer" %> -<%@ Import Namespace="umbraco.cms.businesslogic.packager.repositories" %> - -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - - -

    Connection to repository failed...

    -
    - - - - - - - -
    > - -

    - Personalize your skin, by defining colors, images and texts -

    - -
    - -
    - -

    - - or Cancel -

    - - -

    You could also change to another skin: Browse available skins

    - -
    - - - -
    > - -

    - Choose a skin from your local collection, or download one from the umbraco package repository -

    - - -
    - - -
      - - -
    • - <%# ((Skin)Container.DataItem).Text %> - <%# ((Skin)Container.DataItem).Text %> -
      - -
    • -
      - -
    - -
    - -
    - -
    -

    Looks like there are also some local skins

    - - - -
      - - -
    • - <%# ((string)Container.DataItem).ToString() %> - - -
    • -
      - -
    - -
    - - -
    - -

    - Go back to your current skin -

    - -
    - - - - diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/SkinModule.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/SkinModule.js deleted file mode 100644 index ab545be481..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/SkinModule.js +++ /dev/null @@ -1 +0,0 @@ -/********************* Live Editing SkinModule functions *********************/ diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/images/loader.gif b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/images/loader.gif deleted file mode 100644 index 4e651edc47..0000000000 Binary files a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/images/loader.gif and /dev/null differ diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/images/module.gif b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/images/module.gif deleted file mode 100644 index eeb3cdb444..0000000000 Binary files a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/images/module.gif and /dev/null differ diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/images/skin.gif b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/images/skin.gif deleted file mode 100644 index dde295b0fb..0000000000 Binary files a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/images/skin.gif and /dev/null differ diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/ModuleInjection.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/ModuleInjection.js deleted file mode 100644 index ecaa195dc2..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/ModuleInjection.js +++ /dev/null @@ -1,130 +0,0 @@ -var umbModuleToInsertAlias; - - -function umbMakeModulesSortable() { - - if (jQuery('.umbModuleContainer').length > 0) { - jQuery('.umbModuleContainer').sortable({ - connectWith: '.umbModuleContainer', - items: '.umbModule', - stop: function (event, ui) { - - UmbracoCommunicator.SendClientMessage("movemodule", ui.item.attr('id') + ";" + ui.item.parent().attr('id') + ";" + jQuery('.umbModule', ui.item.parent()).index(ui.item)); - } - }); - } - -} - -function umbSelectModule(alias,sender) { - jQuery('#modules').hide(); - jQuery('#moduleSelect').show(); - umbShowModuleContainerSelectors(jQuery('span', sender).html()); - umbModuleToInsertAlias = alias; - - jQuery('.selectedModule').html(jQuery('span',sender).html()); - -} -function umbInstallModuleAndGetAlias(guid,name,sender) { - - jQuery('#modules').hide(); - jQuery('.selectedModule').html(name); - jQuery("#installingModule").show(); - - jQuery.post(umbCurrentUmbracoDir + "/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx?guid=" + guid + "&name=" + name, - function (data) { - - if (data == "error") { - - } - else { - jQuery("#installingModule").hide(); - jQuery('#moduleSelect').show(); - umbShowModuleContainerSelectors(jQuery('span', sender).html()); - umbModuleToInsertAlias = data; - - jQuery(sender).attr("onclick", ""); - - jQuery(sender).click(function () { - umbSelectModule(data, this); - return false; - }); - } - - - }); - -} -function umbShowModuleSelection() { - - umbRemoveModuleContainerSelectors(); - - jQuery("#moduleSelect").hide(); - jQuery("#modules").show(); - - jQuery(".ModuleSelector").show(); - -} - -function umbShowModuleContainerSelectors(moduleName) { - - jQuery(".umbModuleContainer").each(function () { - - if (jQuery(this).children().size() > 0) { - jQuery(this).prepend("
    Insert module here
    "); - } - - jQuery(this).append("
    Insert module here
    "); - - }); - - jQuery(".umbModuleContainerSelector").click(function () { - - jQuery(".ModuleSelector").hide(); - Umbraco.Controls.ModalWindow().open(umbCurrentUmbracoDir + '/LiveEditing/Modules/SkinModule/ModuleInjector.aspx?macroAlias=' + umbModuleToInsertAlias + '&target=' + jQuery(this).parent().attr('id') + "&type=" + jQuery(this).attr('rel'), 'Insert ' + moduleName + ' module', true, 550, 550, 50, 0, ['.modalbuton'], null); - - }); -} - -function umbRemoveModuleContainerSelectors() { - jQuery(".umbModuleContainerSelector").remove(); -} - -function umbInsertModule(container,macro,type) { - umbRemoveModuleContainerSelectors(); - - var working = "
    Inserting module...
    "; - - if (type == "append") { - jQuery("#" + container).append(working); - } else { - jQuery("#" + container).prepend(working); - } - - var moduleguid = guid(); - - - - UmbracoCommunicator.SendClientMessage("injectmodule", container + ";" + "
    " + macro + "
    ;" + type); - - //need to lose these replace calls - - jQuery.post(umbCurrentUmbracoDir + "/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx?tag=" + macro.replace('>', '').replace('<', '').replace('', '') + "&umbPageID=" + umbCurrentPageId, - function (data) { - jQuery(".umbModuleContainerPlaceHolder").html("
    " + data + "
    ;"); - - UmbSpeechBubble.ShowMessage("Info", "Module", "Module inserted"); - }); - - } - - - function S4() { - return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); - } - function guid() { - return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); - } - - //startup stuff - umbMakeModulesSortable(); \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/SkinModuleShowOnStartup.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/SkinModuleShowOnStartup.js deleted file mode 100644 index f21e5aacd0..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/SkinModuleShowOnStartup.js +++ /dev/null @@ -1 +0,0 @@ -ShowSkinModule(); \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/disableInstallButtonsOnClick.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/disableInstallButtonsOnClick.js deleted file mode 100644 index 4df5f81ad1..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/disableInstallButtonsOnClick.js +++ /dev/null @@ -1,8 +0,0 @@ -jQuery('.selectskin').click(function () { - - jQuery('#skinupdateinprogress').show(); - - jQuery('#skins').hide(); - - jQuery('#localSkinsContainer').hide(); -}); \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/initcolorpicker.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/initcolorpicker.js deleted file mode 100644 index 4a6e407296..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/initcolorpicker.js +++ /dev/null @@ -1,22 +0,0 @@ -var activecolorpicker; - -jQuery('input.skinningcolorpicker').ColorPicker({ - onSubmit: function (hsb, hex, rgb, el) { - jQuery(el).val('#' + hex); - jQuery(el).ColorPickerHide(); - jQuery(el).trigger('change'); - }, - onBeforeShow: function () { - activecolorpicker = this; - jQuery(this).ColorPickerSetColor(this.value); - }, - onChange: function (hsb, hex, rgb) { - - jQuery(activecolorpicker).val('#' + hex); - jQuery(activecolorpicker).trigger('change'); - } -}) -.bind('keyup', function () { - jQuery(this).ColorPickerSetColor(this.value); -}); - diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/initslider.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/initslider.js deleted file mode 100644 index 691a6b5001..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/initslider.js +++ /dev/null @@ -1,19 +0,0 @@ -jQuery(".skinningslider").each(function () { - - var vals = jQuery(this).attr("rel").split(","); - - var minimum = vals[0]; - var maximum = vals[1]; - var initial = vals[2]; - var ratio = vals[3] - var target = vals[4]; - - jQuery(this).slider({ - change: function (event, ui) { if (ratio != "") { jQuery("#" + target).val(ui.value / ratio); } else { jQuery("#" + target).val(ui.value); } jQuery("#" + target).trigger("change"); }, - slide: function (event, ui) { if (ratio != "") { jQuery("#" + target).val(ui.value / ratio); } else { jQuery("#" + target).val(ui.value); } jQuery("#" + target).trigger("change"); }, - min: minimum, - max: maximum, - value: initial - }); - -}); \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/skin.png b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/skin.png deleted file mode 100644 index ea3f06e5a6..0000000000 Binary files a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/skin.png and /dev/null differ diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/UnpublishModule/UnpublishModule.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/UnpublishModule/UnpublishModule.js deleted file mode 100644 index 0fd382d9ae..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/UnpublishModule/UnpublishModule.js +++ /dev/null @@ -1,5 +0,0 @@ -/********************* Live Editing UnpublishModule functions *********************/ -function UnpublishModuleOk() -{ - UmbracoCommunicator.SendClientMessage('unpublishcontent', ''); -} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/UnpublishModule/unpublish.png b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/UnpublishModule/unpublish.png deleted file mode 100644 index 53302c4a91..0000000000 Binary files a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/UnpublishModule/unpublish.png and /dev/null differ diff --git a/src/Umbraco.Web.UI/umbraco/canvas.aspx b/src/Umbraco.Web.UI/umbraco/canvas.aspx deleted file mode 100644 index 28f22eeb16..0000000000 --- a/src/Umbraco.Web.UI/umbraco/canvas.aspx +++ /dev/null @@ -1,16 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="canvas.aspx.cs" Inherits="umbraco.presentation.LiveEditingEnabler" %> - - - - - - Untitled Page - - -
    -
    - -
    -
    - - diff --git a/src/Umbraco.Web.UI/umbraco/css/umbLiveEditing.css b/src/Umbraco.Web.UI/umbraco/css/umbLiveEditing.css deleted file mode 100644 index fa189266ea..0000000000 --- a/src/Umbraco.Web.UI/umbraco/css/umbLiveEditing.css +++ /dev/null @@ -1,14 +0,0 @@ -.umbEditItem:hover { - border: 1px dotted orange; - padding: 5px; -} - -.umbLiveEditingToggleButton -{ - display: none; -} - -.umbLiveEditingCancelButton -{ - margin-left: 10px; -} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.cs b/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.cs index d7298d09a1..af31f42143 100644 --- a/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.cs @@ -13,10 +13,7 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Packages protected void Page_Load(object sender, EventArgs e) { - if (!global::umbraco.cms.businesslogic.skinning.Skinning.IsStarterKitInstalled()) - ShowStarterKits(); - else - ShowSkins((Guid)global::umbraco.cms.businesslogic.skinning.Skinning.StarterKitGuid()); + ShowStarterKits(); } private void ShowStarterKits() @@ -40,22 +37,7 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Packages StarterKitInstalled.Visible = false; } - - public void ShowSkins(Guid starterKitGuid) - { - - var ctrl = (LoadStarterKitDesigns)LoadControl(SystemDirectories.Install + "/steps/Skinning/loadStarterKitDesigns.ascx"); - ctrl.ID = "StarterKitDesigns"; - - ctrl.StarterKitGuid = starterKitGuid; - ctrl.StarterKitDesignInstalled += CtrlStarterKitDesignInstalled; - ph_skins.Controls.Add(ctrl); - - StarterKitNotInstalled.Visible = false; - StarterKitInstalled.Visible = true; - - } - + void StarterkitsctrlStarterKitInstalled() { StarterKitNotInstalled.Visible = false; @@ -65,13 +47,5 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Packages } - void CtrlStarterKitDesignInstalled() - { - StarterKitNotInstalled.Visible = false; - StarterKitInstalled.Visible = false; - - installationCompleted.Visible = true; - } - } } \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/TemplateSkinning.aspx b/src/Umbraco.Web.UI/umbraco/dialogs/TemplateSkinning.aspx deleted file mode 100644 index 829ba939ef..0000000000 --- a/src/Umbraco.Web.UI/umbraco/dialogs/TemplateSkinning.aspx +++ /dev/null @@ -1,57 +0,0 @@ -<%@ Page Language="C#" MasterPageFile="../masterpages/umbracoDialog.Master" AutoEventWireup="true" CodeBehind="TemplateSkinning.aspx.cs" Inherits="umbraco.presentation.umbraco.dialogs.TemplateSkinning" %> -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> -<%@ Import Namespace="umbraco.cms.businesslogic.packager.repositories" %> - - - - - - - Download more skins - - - - -
    - - - - - or Rollback current skin - - -
    -
    - - - -
    - - -
      - - -
    • - - <%# ((Skin)Container.DataItem).Text %> - - <%# ((Skin)Container.DataItem).Text %> - -
      - - -
    • -
      - - -
    - -
    - -
    - -
    - -
    diff --git a/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoApplicationActions.js b/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoApplicationActions.js index 3ff3e7beec..1b0acc0150 100644 --- a/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoApplicationActions.js +++ b/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoApplicationActions.js @@ -270,12 +270,6 @@ Umbraco.Application.Actions = function () { } }, - actionLiveEdit: function () { - /// - - window.open("canvas.aspx?redir=/" + UmbClientMgr.mainTree().getActionNode().nodeId + ".aspx", "liveediting"); - }, - actionNew: function () { /// Show the create new modal overlay var actionNode = UmbClientMgr.mainTree().getActionNode(); diff --git a/src/Umbraco.Web.UI/umbraco_client/tinymce3/themes/umbraco/editor_template_src.js b/src/Umbraco.Web.UI/umbraco_client/tinymce3/themes/umbraco/editor_template_src.js index 98a1ed21ac..6516bc2f73 100644 --- a/src/Umbraco.Web.UI/umbraco_client/tinymce3/themes/umbraco/editor_template_src.js +++ b/src/Umbraco.Web.UI/umbraco_client/tinymce3/themes/umbraco/editor_template_src.js @@ -843,24 +843,11 @@ }); */ - if (jQuery("#LiveEditingToolbar")) { - // NH: Live editing hack for empty div in IE - if (jQuery.browser.msie) { - var emptyDiv = jQuery("#" + ed.getParam("umbraco_toolbar_id", "*")).prev(); - if (emptyDiv.get(0).tagName == "DIV" && emptyDiv.html() == "") { - emptyDiv.hide(); - } - } - - t._addToolbars(etb, o); - DOM.show(DOM.get(ed.id + '_external')); - } else { - jQuery(document).ready(function () { - t._addToolbars(etb, o); - DOM.show(DOM.get(ed.id + '_external')); - }); - } - + jQuery(document).ready(function () { + t._addToolbars(etb, o); + DOM.show(DOM.get(ed.id + '_external')); + }); + ed.onMouseUp.add(function () { jQuery(".tinymceMenuBar").hide(); jQuery("#" + ed.id + "_external").parent().show(); diff --git a/src/Umbraco.Web/Security/WebSecurity.cs b/src/Umbraco.Web/Security/WebSecurity.cs index 11946fedd5..2c0c8b1176 100644 --- a/src/Umbraco.Web/Security/WebSecurity.cs +++ b/src/Umbraco.Web/Security/WebSecurity.cs @@ -306,7 +306,7 @@ namespace Umbraco.Web.Security var user = CurrentUser; // Check for console access - if (user.IsLockedOut || (user.NoConsole && GlobalSettings.RequestIsInUmbracoApplication(_httpContext) && GlobalSettings.RequestIsLiveEditRedirector(_httpContext) == false)) + if (user.IsLockedOut || (user.NoConsole && GlobalSettings.RequestIsInUmbracoApplication(_httpContext))) { if (throwExceptions) throw new ArgumentException("You have no priviledges to the umbraco console. Please contact your administrator"); return ValidateRequestAttempt.FailedNoPrivileges; diff --git a/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs b/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs index 55fd9e6f1f..56ba066f2d 100644 --- a/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs +++ b/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs @@ -272,13 +272,7 @@ namespace Umbraco.Web.Trees return Attempt.Succeed( new LegacyUrlAction( "dialogs/assignDomain2.aspx?id=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, - ui.GetText("actions", "assignDomain"))); - case "UmbClientMgr.appActions().actionLiveEdit()": - return Attempt.Succeed( - new LegacyUrlAction( - "canvas.aspx?redir=/" + nodeId + ".aspx", - "", - ActionUrlMethod.BlankWindow)); + ui.GetText("actions", "assignDomain"))); case "UmbClientMgr.appActions().actionSendToTranslate()": return Attempt.Succeed( new LegacyUrlAction( diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 12a6f1dc7d..4f81de58e5 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -1066,13 +1066,6 @@ SettingsDashboardVideos.ascx - - Applyskin.ascx - ASPXCodeBehind - - - Applyskin.ascx - StartupDashboardIntro.ascx @@ -1110,13 +1103,6 @@ Preview.aspx - - TemplateSkinning.aspx - ASPXCodeBehind - - - TemplateSkinning.aspx - MemberSearch.ascx ASPXCodeBehind @@ -1864,14 +1850,12 @@ - ASPXCodeBehind - ASPXCodeBehind diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs index c25e446fa3..4935886e9a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs @@ -174,9 +174,6 @@ namespace umbraco treeElement.SetAttribute("text", ui.Text("treeHeaders", "installStarterKit")); - if (cms.businesslogic.skinning.Skinning.IsStarterKitInstalled()) - treeElement.SetAttribute("text", ui.Text("treeHeaders", "installSkin")); - break; default: diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTemplates.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTemplates.cs index bde3301b46..b313b200ac 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTemplates.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTemplates.cs @@ -27,7 +27,7 @@ using umbraco.cms.businesslogic.template; using umbraco.BusinessLogic.Utils; using umbraco.cms.presentation.Trees; using umbraco.BusinessLogic.Actions; -using umbraco.cms.businesslogic.skinning; + namespace umbraco { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx b/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx deleted file mode 100644 index 6f336980ce..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx +++ /dev/null @@ -1,9 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Applyskin.ascx.cs" Inherits="umbraco.presentation.umbraco.dashboard.Settings.Applyskin" %> - - - - - - - - \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx.cs deleted file mode 100644 index 458293c2a1..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using umbraco.cms.businesslogic.skinning; -using umbraco.cms.businesslogic.template; - -namespace umbraco.presentation.umbraco.dashboard.Settings -{ - public partial class Applyskin : System.Web.UI.UserControl - { - protected void Page_Load(object sender, EventArgs e) - { - - skinpicker.Items.Add("Choose..."); - foreach (Skin s in Skinning.GetAllSkins()) - { - skinpicker.Items.Add( new ListItem(s.Name, s.Alias)); - } - } - - protected void apply(object sender, EventArgs e) - { - if (skinpicker.SelectedIndex > 0) - { - Skin s = Skin.CreateFromAlias(skinpicker.SelectedValue); - Skinning.ActivateAsCurrentSkin(s); - } - } - - protected void rollback(object sender, EventArgs e) - { - Template t = Template.GetByAlias("RunwayHomepage"); - Skinning.RollbackSkin(t.Id); - } - - - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx.designer.cs deleted file mode 100644 index c9d7cd1b76..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx.designer.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.umbraco.dashboard.Settings { - - - public partial class Applyskin { - - /// - /// skinpicker control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList skinpicker; - - /// - /// bt_apply control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button bt_apply; - - /// - /// bt_rollback control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button bt_rollback; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx deleted file mode 100644 index 829ba939ef..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx +++ /dev/null @@ -1,57 +0,0 @@ -<%@ Page Language="C#" MasterPageFile="../masterpages/umbracoDialog.Master" AutoEventWireup="true" CodeBehind="TemplateSkinning.aspx.cs" Inherits="umbraco.presentation.umbraco.dialogs.TemplateSkinning" %> -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> -<%@ Import Namespace="umbraco.cms.businesslogic.packager.repositories" %> - - - - - - - Download more skins - - - - -
    - - - - - or Rollback current skin - - -
    -
    - - - -
    - - -
      - - -
    • - - <%# ((Skin)Container.DataItem).Text %> - - <%# ((Skin)Container.DataItem).Text %> - -
      - - -
    • -
      - - -
    - -
    - -
    - -
    - -
    diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx.cs deleted file mode 100644 index 78c6ef69f6..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx.cs +++ /dev/null @@ -1,190 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using Umbraco.Core.Logging; -using umbraco.BusinessLogic; -using umbraco.cms.businesslogic.skinning; -using umbraco.cms.businesslogic.template; -using umbraco.cms.businesslogic; - -namespace umbraco.presentation.umbraco.dialogs -{ - public partial class TemplateSkinning : BasePages.UmbracoEnsuredPage - { - private int _templateId = 0; - - private readonly cms.businesslogic.packager.repositories.Repository _repo; - private const string RepoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; - - public TemplateSkinning() - { - CurrentApp = DefaultApps.settings.ToString(); - _repo = cms.businesslogic.packager.repositories.Repository.getByGuid(RepoGuid); - - if (_repo == null) - { - throw new InvalidOperationException("Could not find repository with id " + RepoGuid); - } - } - - protected void Page_Load(object sender, EventArgs e) - { - _templateId = int.Parse(Request["id"]); - var t = new Template(_templateId); - - if (Skinning.StarterKitGuid(_templateId).HasValue) - { - p_apply.Visible = true; - - var currentSkin = Skinning.GetCurrentSkinAlias(_templateId); - var templateRoot = FindTemplateRoot(t); - - dd_skins.Items.Add("Choose..."); - foreach (var kvp in Skinning.AllowedSkins(templateRoot)) - { - var li = new ListItem(kvp.Value, kvp.Key); - if (kvp.Key == currentSkin) - li.Selected = true; - - dd_skins.Items.Add(li); - } - - if (!string.IsNullOrEmpty(Skinning.GetCurrentSkinAlias(_templateId))) - { - ph_rollback.Visible = true; - } - } - } - - private int FindTemplateRoot(CMSNode t) - { - if (t.ParentId < 0) - return t.Id; - return FindTemplateRoot(t.Parent); - } - - protected void openRepo(object sender, EventArgs e) { - - var g = Skinning.StarterKitGuid(_templateId); - - - if (g == null || !Skinning.HasAvailableSkins(_templateId)) - { - bt_repo.Visible = false; - } - else - { - if (_repo.HasConnection()) - { - try - { - rep_starterKitDesigns.DataSource = _repo.Webservice.Skins(g.ToString()); - rep_starterKitDesigns.DataBind(); - } - catch (Exception ex) - { - LogHelper.Error("An error occurred", ex); - - //ShowConnectionError(); - } - } - } - - p_apply.Visible = false; - p_download.Visible = true; - - } - - protected void SelectStarterKitDesign(object sender, EventArgs e) - { - if (((Button)sender).CommandName == "apply") - { - var s = Skin.CreateFromName(((Button)sender).CommandArgument); - Skinning.ActivateAsCurrentSkin(s); - - Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); - } - else if (((Button)sender).CommandName == "remove") - { - var n = NodeFactory.Node.GetCurrent(); - - var t = new Template(n.template); - Skinning.RollbackSkin(t.Id); - - Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); - } - else - { - - var kitGuid = new Guid(((Button)sender).CommandArgument); - - if (_repo.HasConnection()) - { - var p = new cms.businesslogic.packager.Installer(); - - var tempFile = p.Import(_repo.fetch(kitGuid.ToString())); - p.LoadConfig(tempFile); - var pId = p.CreateManifest(tempFile, kitGuid.ToString(), RepoGuid); - - p.InstallFiles(pId, tempFile); - p.InstallBusinessLogic(pId, tempFile); - p.InstallCleanUp(pId, tempFile); - - //NOTE: This seems excessive to have to re-load all content from the database here!? - library.RefreshContent(); - - if (Skinning.GetAllSkins().Count > 0) - { - Skinning.ActivateAsCurrentSkin(Skinning.GetAllSkins()[0]); - } - - - Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); - } - } - } - - protected void apply(object sender, EventArgs e) { - - if (dd_skins.SelectedIndex > 0) - { - var s = Skin.CreateFromAlias(dd_skins.SelectedValue); - Skinning.ActivateAsCurrentSkin(s); - } - - } - protected void rollback(object sender, EventArgs e) { - - Skinning.RollbackSkin(_templateId); - } - - protected void rep_starterKitDesigns_ItemDataBound(object sender, RepeaterItemEventArgs e) - { - if (e.Item.DataItem != null) - { - var s = (cms.businesslogic.packager.repositories.Skin)e.Item.DataItem; - - if (Skinning.IsSkinInstalled(s.RepoGuid)) - { - var inst = (Button)e.Item.FindControl("Button1"); - inst.Text = "Apply (already downloaded)"; - inst.CommandName = "apply"; - inst.CommandArgument = s.Text; - - } - - if (Skin.CreateFromAlias(Skinning.GetCurrentSkinAlias(_templateId)).Name == s.Text) - { - var inst = (Button)e.Item.FindControl("Button1"); - inst.Text = "Rollback (active skin)"; - inst.CommandName = "remove"; - inst.CommandArgument = s.Text; - } - } - - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx.designer.cs deleted file mode 100644 index bf1ea07579..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx.designer.cs +++ /dev/null @@ -1,105 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.umbraco.dialogs { - - - public partial class TemplateSkinning { - - /// - /// p_apply control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.Pane p_apply; - - /// - /// PropertyPanel1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.PropertyPanel PropertyPanel1; - - /// - /// dd_skins control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList dd_skins; - - /// - /// bt_repo control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.LinkButton bt_repo; - - /// - /// PropertyPanel2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.PropertyPanel PropertyPanel2; - - /// - /// Button1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button Button1; - - /// - /// ph_rollback control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder ph_rollback; - - /// - /// lb_rollback control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.LinkButton lb_rollback; - - /// - /// p_download control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.Pane p_download; - - /// - /// rep_starterKitDesigns control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Repeater rep_starterKitDesigns; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs index f3a7b650a7..0b8a8f1e7f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs @@ -8,7 +8,7 @@ using Umbraco.Core.Configuration; using Umbraco.Core.IO; using umbraco.BasePages; using umbraco.BusinessLogic; -using umbraco.cms.businesslogic.skinning; + using umbraco.cms.businesslogic.template; using umbraco.cms.presentation.Trees; using umbraco.DataLayer; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs index 8a30dfe1ee..6d0465f693 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs @@ -120,20 +120,6 @@ namespace umbraco.presentation.templateControls set { ViewState["DebugMode"] = value; } } - /// - /// Gets or sets a value indicating whether Live Editing is disabled for this field. - /// - /// true if you manually wish to disable Live Editing for this field; otherwise, false (default is false). - [Bindable(true)] - [Category("Umbraco")] - [DefaultValue("")] - [Localizable(true)] - public bool LiveEditingDisabled - { - get { return ((ViewState["LiveEditingDisabled"] == null) ? false : (bool)ViewState["LiveEditingDisabled"]); } - set { ViewState["LiveEditingDisabled"] = value; } - } - public ItemRenderer Renderer { get; set; } #endregion @@ -148,24 +134,7 @@ namespace umbraco.presentation.templateControls { get { return m_ItemId; } } - - /// - /// Gets a value indicating whether this control can be used in Live Editing mode. - /// Checks whether live editing has not been disabled, - /// the control is inside a form tag, - /// the field is editable - /// and the user has sufficient permissions. - /// - /// true if live editing is useLiveEditing; otherwise, false. - public bool CanUseLiveEditing - { - get - { - return !LiveEditingDisabled && IsInsideFormTag() - && FieldSupportsLiveEditing() && FieldEditableWithUserPermissions(); - } - } - + /// /// Gets the Umbraco page elements. /// @@ -186,12 +155,7 @@ namespace umbraco.presentation.templateControls /// Initializes a new instance of the class. ///
public Item() - { - // create page unique ID for this item - object lastItemId = HttpContext.Current.Items["LiveEditing_LastItemId"]; - m_ItemId = (lastItemId != null ? (int)lastItemId + 1 : 1); - HttpContext.Current.Items["LiveEditing_LastItemId"] = m_ItemId; - + { Renderer = ItemRenderer.Instance; } @@ -302,23 +266,7 @@ namespace umbraco.presentation.templateControls #endregion #region Field Information Functions - // 27/08/2008 Ruben Verborgh: This functionality should really be inside some kind of super Field class, - // which could be anything from a property to a dictionary item. - // However, I don't think we should do this in the current Umbraco generation. - /// - /// Gets a value indicating whether Live Editing is useLiveEditing on this field. - /// Certain functionalities of the item field makes it hard to - /// support Live Editing, like dictionary items and recursive values. - /// - /// - /// true if Live Editing is useLiveEditing; otherwise, false. - /// - protected virtual bool FieldSupportsLiveEditing() - { - return !(FieldIsRercursive() || FieldIsDictionaryItem()); - } - /// /// Determines whether the field is a dictionary item. /// diff --git a/src/umbraco.businesslogic/BasePages/BasePage.cs b/src/umbraco.businesslogic/BasePages/BasePage.cs index c0171d7d9a..d30d5aa506 100644 --- a/src/umbraco.businesslogic/BasePages/BasePage.cs +++ b/src/umbraco.businesslogic/BasePages/BasePage.cs @@ -146,7 +146,7 @@ namespace umbraco.BasePages _user = BusinessLogic.User.GetUser(GetUserId("")); // Check for console access - if (_user.Disabled || (_user.NoConsole && GlobalSettings.RequestIsInUmbracoApplication(Context) && GlobalSettings.RequestIsLiveEditRedirector(Context) == false)) + if (_user.Disabled || (_user.NoConsole && GlobalSettings.RequestIsInUmbracoApplication(Context))) { throw new ArgumentException("You have no priviledges to the umbraco console. Please contact your administrator"); } diff --git a/src/umbraco.businesslogic/GlobalSettings.cs b/src/umbraco.businesslogic/GlobalSettings.cs index 0c8f598ec1..2e5ec00903 100644 --- a/src/umbraco.businesslogic/GlobalSettings.cs +++ b/src/umbraco.businesslogic/GlobalSettings.cs @@ -329,12 +329,7 @@ namespace umbraco { return Umbraco.Core.Configuration.GlobalSettings.RequestIsInUmbracoApplication(context); } - - public static bool RequestIsLiveEditRedirector(HttpContext context) - { - return Umbraco.Core.Configuration.GlobalSettings.RequestIsLiveEditRedirector(context); - } - + /// /// Gets a value indicating whether umbraco should force a secure (https) connection to the backoffice. /// diff --git a/src/umbraco.businesslogic/IO/SystemFiles.cs b/src/umbraco.businesslogic/IO/SystemFiles.cs index 874f792cf4..85d2c3d766 100644 --- a/src/umbraco.businesslogic/IO/SystemFiles.cs +++ b/src/umbraco.businesslogic/IO/SystemFiles.cs @@ -38,10 +38,6 @@ namespace umbraco.IO get { return Umbraco.Core.IO.SystemFiles.DashboardConfig; } } - public static string SkinningXml - { - get { return Umbraco.Core.IO.SystemFiles.SkinningXml; } - } public static string NotFoundhandlersConfig { diff --git a/src/umbraco.cms/businesslogic/datatype/ClientDependencyAttribute.cs b/src/umbraco.cms/businesslogic/datatype/ClientDependencyAttribute.cs deleted file mode 100644 index ff0ee1d577..0000000000 --- a/src/umbraco.cms/businesslogic/datatype/ClientDependencyAttribute.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using ClientDependency.Core.Controls; - -namespace umbraco.cms.businesslogic.datatype -{ - /// - /// This attribute is used for data types that uses client assets like Javascript and CSS for liveediting. - /// The Live Editing feature in umbraco will look for this attribute and preload all dependencies to the page - /// to ensure that all client events and assets gets loaded - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] - [Obsolete("Use the new ClientDependency framework. Priority and InvokeJavascriptMethodOnLoad are ignored. Documentation here: http://clientdependency.codeplex.com/documentation")] - public class ClientDependencyAttribute : Attribute - { - /// - /// Gets or sets the priority. - /// - /// The priority. - [Obsolete("This property is ignored")] - public int Priority { get; set; } - - /// - /// Gets or sets the file path. - /// - /// The file path. - public string FilePath { get; set; } - - /// - /// Gets or sets the type of the dependency. - /// - /// The type of the dependency. - public ClientDependencyType DependencyType { get; set; } - - /// - /// Gets or sets the name of an optional javascript method that should be called on load. - /// - /// The name of the method. - [Obsolete("This property is ignored")] - public string InvokeJavascriptMethodOnLoad { get; set; } - - /// - /// Initializes a new instance of the class. - /// - /// The priority. - /// Type of the dependency. - /// The file path to the dependency. - public ClientDependencyAttribute(int priority, ClientDependencyType dependencyType, string filePath) - : this(priority, dependencyType, filePath, false, string.Empty) - { } - - /// - /// Initializes a new instance of the class. - /// - /// The priority. - /// Type of the dependency. - /// The file path to the dependency. - /// The name of the Javascript method to invoke when the dependency is loaded. - public ClientDependencyAttribute(int priority, ClientDependencyType dependencyType, string filePath, string invokeJavascriptMethodOnLoad) - : this(priority, dependencyType, filePath, false, invokeJavascriptMethodOnLoad) - { } - - /// - /// Initializes a new instance of the class. - /// - /// The priority. - /// Type of the dependency. - /// The file path to the dependency. - /// if set to true the current umbraco path will be prefixed to the filePath. - public ClientDependencyAttribute(int priority, ClientDependencyType dependencyType, string filePath, bool appendUmbracoPath) - : this(priority, dependencyType, filePath, appendUmbracoPath, String.Empty) - { } - - /// - /// Initializes a new instance of the class. - /// - /// The priority. - /// Type of the dependency. - /// The file path to the dependency. - /// if set to true the current umbraco path will be prefixed to the filePath. - /// The name of the Javascript method to invoke when the dependency is loaded. - public ClientDependencyAttribute(int priority, ClientDependencyType dependencyType, string filePath, bool appendUmbracoPath, string invokeJavascriptMethodOnLoad) - { - if (String.IsNullOrEmpty(filePath)) - throw new ArgumentException("filePath"); - - Priority = priority; - FilePath = appendUmbracoPath ? GlobalSettings.Path + "/" + filePath : filePath; - DependencyType = dependencyType; - InvokeJavascriptMethodOnLoad = invokeJavascriptMethodOnLoad ?? String.Empty; - - ClientDependencyLoader.Instance.RegisterDependency(FilePath, DependencyType == ClientDependencyType.Css ? ClientDependency.Core.ClientDependencyType.Css : ClientDependency.Core.ClientDependencyType.Javascript); - } - } - - /// - /// The type of client file - /// - public enum ClientDependencyType - { - Javascript, Css - } -} \ No newline at end of file diff --git a/src/umbraco.cms/businesslogic/skinning/CssVariable.cs b/src/umbraco.cms/businesslogic/skinning/CssVariable.cs deleted file mode 100644 index 258892b4d9..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/CssVariable.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml; - -namespace umbraco.cms.businesslogic.skinning -{ - public class CssVariable - { - public string Name { get; set; } - public string DefaultValue { get; set; } - public List Properties { get; set; } - - - - public static CssVariable CreateFromXmlNode(XmlNode node) - { - CssVariable var = new CssVariable(); - - if (node.Attributes["name"] != null) - var.Name = node.Attributes["name"].Value; - - var.DefaultValue = node.InnerText; - - return var; - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/CssVariableProperty.cs b/src/umbraco.cms/businesslogic/skinning/CssVariableProperty.cs deleted file mode 100644 index 5730a00b85..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/CssVariableProperty.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace umbraco.cms.businesslogic.skinning -{ - public class CssVariableProperty - { - public string Name { get; set; } - public List Selectors { get; set; } - - public CssVariableProperty(string name) - { - this.Name = name; - Selectors = new List(); - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/Dependency.cs b/src/umbraco.cms/businesslogic/skinning/Dependency.cs deleted file mode 100644 index f8c0c6db23..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/Dependency.cs +++ /dev/null @@ -1,136 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml; -using System.Web; -using System.Reflection; -using Umbraco.Core.Logging; - -namespace umbraco.cms.businesslogic.skinning -{ - public class Dependency - { - public Dependency() - { - Tasks = new List(); - Properties = new Dictionary(); - } - - public static Dependency CreateFromXmlNode(XmlNode node) - { - Dependency d = new Dependency(); - - - - if (node.SelectSingleNode("Properties") != null) - { - foreach (XmlNode prop in node.SelectSingleNode("Properties").ChildNodes) - { - if(prop.Name != "Output" && prop.Name != "#comment") - d.Properties.Add(prop.Name, prop.InnerText); - } - } - - - if(node.Attributes["label"] != null) - d.Label = node.Attributes["label"].Value; - - if (node.Attributes["type"] != null) - { - - if (node.Attributes["assembly"] != null) - { - //custom dependency type - - //string assemblyFile = - // HttpContext.Current.Server.MapPath( - // String.Format("{0}/../bin/{1}.dll", - // GlobalSettings.Path, - // node.Attributes["assembly"].Value)); - - //Assembly customAssembly = Assembly.LoadFrom(assemblyFile); - - Assembly customAssembly = Assembly.Load(node.Attributes["assembly"].Value); - - d.DependencyType = (DependencyType)Activator.CreateInstance( - customAssembly.GetType(node.Attributes["type"].Value),d); - - foreach (var prop in d.Properties) - { - d.DependencyType.GetType().InvokeMember(prop.Key, System.Reflection.BindingFlags.SetProperty, null, d.DependencyType, new object[] { prop.Value }); - } - //d.DependencyType.Properties = d.Properties; - - } - else - { - //internal dependency type - - //string assemblyFile = - // HttpContext.Current.Server.MapPath( - // String.Format("{0}/../bin/{1}.dll", - // GlobalSettings.Path, - // "cms")); - - //Assembly defaultAssembly = Assembly.LoadFrom(assemblyFile); - - Assembly defaultAssembly = Assembly.Load("cms"); - - d.DependencyType = (DependencyType)Activator.CreateInstance( - defaultAssembly.GetType( - string.Format( - "umbraco.cms.businesslogic.skinning.dependencies.{0}", - node.Attributes["type"].Value))); - - - foreach (var prop in d.Properties) - { - d.DependencyType.GetType().InvokeMember(prop.Key, System.Reflection.BindingFlags.SetProperty, null, d.DependencyType, new object[] { prop.Value }); - } - - //d.DependencyType.Properties = d.Properties; - } - - XmlNode outputNode = node.SelectSingleNode("Properties/Output"); - - if (outputNode != null) - { - d.DependencyType.Values.Add(outputNode.InnerText); - } - - if (node.Attributes["variable"] != null) - d.Variable = node.Attributes["variable"].Value; - } - - - - - foreach (XmlNode taskNode in node.SelectNodes("Tasks/Task")) - { - try - { - d.Tasks.Add(Task.CreateFromXmlNode(taskNode)); - } - catch (Exception ex) - { - LogHelper.Error("Failed to load task type " + (taskNode.Attributes["type"] != null ? taskNode.Attributes["type"].Value : string.Empty), ex); - } - } - - - return d; - } - - - public DependencyType DependencyType { get; set; } - - public string Label { get; set; } - - public Dictionary Properties {get; set;} - - public List Tasks { get; set; } - - public string Variable { get; set; } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/DependencyType.cs b/src/umbraco.cms/businesslogic/skinning/DependencyType.cs deleted file mode 100644 index 3f854d4fda..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/DependencyType.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Web.UI.WebControls; -using umbraco.interfaces.skinning; - -namespace umbraco.cms.businesslogic.skinning -{ - public abstract class DependencyType : ProviderBase, IDependencyType - { - public virtual WebControl Editor { get; set; } - public virtual List Values { get; set; } - - public virtual string CssVariablePreviewClientScript(string ControlClientId, string VariableClientId) - { - return string.Format( - @"jQuery('#{0}').bind('{2}', function() {{ - {3} = {1}; - PreviewCssVariables(); - }}); - - - //cancel support (not implemented yet) - jQuery('#cancelSkinCustomization').click(function () {{ - - }}); - - ", - ControlClientId, - this.ClientSideGetValueScript(), - this.ClientSideCssVariablePreviewEventType(), - VariableClientId); - } - - public virtual string ClientSideGetValueScript() - { - return string.Format( - "jQuery('#{0}').val()" - ,Editor.ClientID); - } - public virtual string ClientSidePreviewEventType() - { - return "change"; - } - - public virtual string ClientSideCssVariablePreviewEventType() - { - //should be something that doesn't execute at every change - return "change"; - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/EmbeddedCss.cs b/src/umbraco.cms/businesslogic/skinning/EmbeddedCss.cs deleted file mode 100644 index 7ccebf0caf..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/EmbeddedCss.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml; - -namespace umbraco.cms.businesslogic.skinning -{ - public class EmbeddedCss - { - public string TargetFile { get; set; } - public List Variables { get; set; } - public string Content { get; set; } - - - public EmbeddedCss() - { - Variables = new List(); - } - - - public static EmbeddedCss CreateFromXmlNode(XmlNode node) - { - EmbeddedCss css = new EmbeddedCss(); - - if (node.Attributes["targetfile"] != null) - css.TargetFile = node.Attributes["targetfile"].Value; - - if (node.SelectSingleNode("Content") != null) - css.Content = node.SelectSingleNode("Content").InnerText; - - - foreach (XmlNode variableNode in node.SelectNodes("Variables/Variable")) - { - - css.Variables.Add(CssVariable.CreateFromXmlNode(variableNode)); - - } - - return css; - - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/Skin.cs b/src/umbraco.cms/businesslogic/skinning/Skin.cs deleted file mode 100644 index 82f493798f..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/Skin.cs +++ /dev/null @@ -1,344 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml; -using System.IO; -using System.Xml.XPath; -using Umbraco.Core.Logging; -using umbraco.interfaces.skinning; - -namespace umbraco.cms.businesslogic.skinning -{ - public class Skin - { - public Skin() - { - - Dependencies = new List(); - - } - - public static Skin CreateFromFile(string filename) - { - XmlDocument manifest = new XmlDocument(); - - FileInfo f = new FileInfo(filename); - - if (f.Exists) - { - manifest.Load(filename); - - Skin s = Skin.CreateFromXmlNode(manifest.SelectSingleNode("//Skin")); - s.FullFileName = filename; - s.Alias = f.Directory.Name; - - return s; - } - else - return null; - - - } - - public static string GetSkinNameFromFile(string filename) - { - XmlDocument manifest = new XmlDocument(); - - FileInfo f = new FileInfo(filename); - - if (f.Exists) - { - manifest.Load(filename); - return manifest.SelectSingleNode("//Skin/Name").InnerText; - } - else - return null; - } - - public static Skin CreateFromXmlNode(XmlNode node) - { - Skin s = new Skin(); - - - if(node.SelectSingleNode("/Skin/Name") != null) - s.Name = node.SelectSingleNode("/Skin/Name").InnerText; - - if(node.SelectSingleNode("/Skin/Author") != null) - s.Author = node.SelectSingleNode("/Skin/Author").InnerText; - - if(node.SelectSingleNode("/Skin/Version") != null) - s.Version = node.SelectSingleNode("/Skin/Version").InnerText; - - if(node.SelectSingleNode("/Skin/Description") != null) - s.Description = node.SelectSingleNode("/Skin/Description").InnerText; - - - - if (node.SelectSingleNode("/Skin/AllowedRootTemplate") != null) - s.AllowedRootTemplate = node.SelectSingleNode("/Skin/AllowedRootTemplate").InnerText; - - - foreach (XmlNode depNode in node.SelectNodes("/Skin//Dependency")) - { - try - { - s.Dependencies.Add(Dependency.CreateFromXmlNode(depNode)); - } - catch (Exception ex) - { - LogHelper.Error("Failed to load dependency type " + (depNode.Attributes["type"] != null ? depNode.Attributes["type"].Value : string.Empty), ex); - } - } - - if (node.SelectSingleNode("/Skin/CSS") != null) - s.Css = EmbeddedCss.CreateFromXmlNode(node.SelectSingleNode("/Skin/CSS")); - - return s; - } - - public static Skin CreateFromAlias(string alias) - { - string manifest = Path.Combine(IO.IOHelper.MapPath( IO.SystemDirectories.Masterpages + "/" + alias), "skin.xml"); - return CreateFromFile(manifest); - } - - public static Skin CreateFromName(string name) - { - foreach (Skin s in Skinning.GetAllSkins()) - { - if (s.Name == name) - return s; - } - - return null; - } - public bool OverridesTemplates() - { - return (System.IO.Directory.GetFiles(IO.IOHelper.MapPath(SkinFolder), "*.master").Count() > 0); - } - - public bool HasBackupFiles() - { - return System.IO.Directory.Exists( IO.IOHelper.MapPath(SkinBackupFolder) ); - } - - - public void SaveOutput() - { - - XmlDocument manifest = new XmlDocument(); - manifest.Load(FullFileName); - - int i = 1; - foreach (Dependency d in Dependencies) - { - if (d.DependencyType.Values.Count > 0) - { - XmlNode pNode = manifest.SelectSingleNode( - string.Format("/Skin/Dependencies/Dependency[{0}]/Properties", i.ToString())); - - - XmlNode outputNode = pNode.SelectSingleNode("./Output"); - - if (outputNode == null) - { - outputNode = manifest.CreateElement("Output"); - outputNode.InnerText = d.DependencyType.Values[0].ToString(); - pNode.AppendChild(outputNode); - } - else - { - outputNode.InnerText = d.DependencyType.Values[0].ToString(); - } - - - } - - i++; - } - - manifest.Save(FullFileName); - } - - public string FullFileName { get; set; } - - public string Name { get; set; } - - public string Author { get; set; } - public string Version { get; set; } - public string Description { get; set; } - - public string Alias { get; set; } - - - public string AllowedRootTemplate { get; set; } - - - public List Dependencies { get; set; } - - - - public EmbeddedCss Css { get; set; } - - public void RollbackDependencies() - { - - XmlDocument manifest = new XmlDocument(); - manifest.Load(FullFileName); - - //emtpy output tags - - foreach(XmlNode oNode in manifest.SelectNodes("/Skin/Dependencies/Dependency/Properties/Output")) - { - oNode.RemoveAll(); - } - - //execute rollback tasks - XmlNode hNode = manifest.SelectSingleNode("/Skin/History"); - - if (!(hNode == null || hNode.SelectNodes("Task").Count == 0)) - { - XPathNavigator navigator = manifest.CreateNavigator(); - XPathExpression expression = navigator.Compile("/Skin/History/Task"); - - expression.AddSort("@executed", XmlSortOrder.Descending, XmlCaseOrder.UpperFirst, - string.Empty, XmlDataType.Text); - - XPathNodeIterator iterator = navigator.Select(expression); - - foreach (XPathNavigator item in iterator) - { - Task t = Task.CreateFromXmlNode(((System.Xml.IHasXmlNode)item).GetNode()); - t.TaskType.RollBack(((System.Xml.IHasXmlNode)item).GetNode().SelectSingleNode("OriginalValue").InnerText); - } - - hNode.RemoveAll(); - - } - - manifest.Save(FullFileName); - } - - public void DeployTemplateFiles() - { - DeployTemplateFiles(IO.SystemDirectories.Masterpages); - } - - - public void DeployTemplateFiles(string folder) - { - string[] masterFiles = System.IO.Directory.GetFiles(IO.IOHelper.MapPath(SkinFolder), "*.master"); - - if (masterFiles.Count() > 0) - { - if (!System.IO.Directory.Exists(IO.IOHelper.MapPath(SkinBackupFolder))) - System.IO.Directory.CreateDirectory(IO.IOHelper.MapPath(SkinBackupFolder)); - - foreach (string master in masterFiles) - { - FileInfo fi = new FileInfo(master); - string original = Path.Combine(IO.IOHelper.MapPath(IO.SystemDirectories.Masterpages), fi.Name); - string backup = Path.Combine(IO.IOHelper.MapPath(SkinBackupFolder), fi.Name); - - if (System.IO.File.Exists(original)) - System.IO.File.Copy(original, backup, true); - - System.IO.File.Copy(master, original, true); - } - } - } - - - public void RollbackTemplateFiles(){ - RollbackTemplateFiles(IO.SystemDirectories.Masterpages); - } - - public void RollbackTemplateFiles(string folder) - { - string[] masterFiles = System.IO.Directory.GetFiles(IO.IOHelper.MapPath(SkinFolder), "*.master"); - - //1. take the skin files back into skin folder to store the changes made - if (masterFiles.Count() > 0) - { - foreach (string master in masterFiles) - { - FileInfo fi = new FileInfo(master); - string inUse = Path.Combine(IO.IOHelper.MapPath(IO.SystemDirectories.Masterpages), fi.Name); - - - if (System.IO.File.Exists(inUse)) - System.IO.File.Copy(inUse, master, true); - } - } - - - //2. copy the /backup files back to the masterpages to restore the templates to the way they were before the skin was applied - string[] backedUpmasterFiles = System.IO.Directory.GetFiles(IO.IOHelper.MapPath(SkinBackupFolder), "*.master"); - foreach (string backup in backedUpmasterFiles) - { - FileInfo fi = new FileInfo(backup); - string inUse = Path.Combine(IO.IOHelper.MapPath(IO.SystemDirectories.Masterpages), fi.Name); - - System.IO.File.Copy(backup, inUse, true); - System.IO.File.Delete(backup); - } - - //3. put on some clothes - } - - public void ExecuteInstallTasks() - { - XmlDocument manifest = new XmlDocument(); - manifest.Load(FullFileName); - - foreach (XmlNode tNode in manifest.SelectNodes("/Skin/Install/Task")) - { - Task t = Task.CreateFromXmlNode(tNode); - TaskExecutionDetails details = t.TaskType.Execute(t.Value); - - if (details.TaskExecutionStatus == TaskExecutionStatus.Completed) - { - AddTaskHistoryNode( - t.TaskType.ToXml(details.OriginalValue, details.NewValue)); - } - - } - } - - public void AddTaskHistoryNode(XmlNode taskNode) - { - XmlDocument manifest = new XmlDocument(); - manifest.Load(FullFileName); - - XmlNode hNode = manifest.SelectSingleNode("/Skin/History"); - - if (hNode == null) - { - hNode = manifest.CreateElement("History"); - manifest.SelectSingleNode("/Skin").AppendChild(hNode); - } - - hNode.AppendChild(manifest.ImportNode(taskNode, true)); - - manifest.Save(FullFileName); - } - - public string SkinFolder - { - get - { - return IO.SystemDirectories.Masterpages + "/" + Alias; - } - } - - public string SkinBackupFolder - { - get - { - return SkinFolder + "/backup"; - } - } - - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/Skinning.cs b/src/umbraco.cms/businesslogic/skinning/Skinning.cs deleted file mode 100644 index 5d4cfd9f31..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/Skinning.cs +++ /dev/null @@ -1,374 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml; -using System.IO; -using System.Collections; -using System.Web; -using System.Web.Caching; -using Umbraco.Core; -using Umbraco.Core.IO; -using umbraco.cms.businesslogic.web; -using umbraco.BusinessLogic; -using umbraco.cms.businesslogic.template; - -namespace umbraco.cms.businesslogic.skinning -{ - - //TODO: Convert the caching to use ApplicationContext.Current.ApplicationCache - - public class Skinning - { - static private readonly Hashtable CheckedPages = new Hashtable(); - static private XmlDocument _skinningXmlContent; - static private string _skinningXmlSource = IOHelper.MapPath(SystemFiles.SkinningXml, false); - - private const string Cachekey = "SkinnableTemplates"; - - private static void ClearCheckPages() - { - CheckedPages.Clear(); - } - - public static void RollbackSkin(int template) - { - string currentSkin = GetCurrentSkinAlias(template); - Skin skin = Skin.CreateFromAlias(currentSkin); - - if (skin != null) - { - skin.RollbackDependencies(); - - if (skin.OverridesTemplates()) - skin.RollbackTemplateFiles(); - - //else - // skin.RollbackDependencies(); - } - - RemoveSkin(template); - Save(); - } - - public static void ActivateAsCurrentSkin(Skin skin) - { - Template t = Template.GetByAlias(skin.AllowedRootTemplate); - ActivateAsCurrentSkin(t.Id, skin.Alias); - } - - public static void ActivateAsCurrentSkin(int template, string skinAlias) - { - //lookup template in skinning.config - string currentSkin = GetCurrentSkinAlias(template); - - //if different from current, and the template is skinned - if (currentSkin != skinAlias) - { - - //this will restore the files to the standard runway, as they looked before the skin was applied - if (currentSkin != string.Empty) - { - RollbackSkin(template); - } - - Skin newSkin = Skin.CreateFromAlias(skinAlias); - - if (newSkin.OverridesTemplates()) - newSkin.DeployTemplateFiles(); - - SetSkin(template, skinAlias); - - newSkin.ExecuteInstallTasks(); - - Save(); - } - } - - private static void Save() - { - var f = File.Open(_skinningXmlSource, FileMode.Create); - SkinXml.Save(f); - f.Close(); - } - - public static string GetCurrentSkinAlias(int templateID) - { - var x = (XmlElement)GetTemplate(templateID); - if (x != null && x.HasAttribute("alias") && !string.IsNullOrEmpty(x.Attributes["alias"].Value)) - return x.Attributes["alias"].Value; - - return string.Empty; - } - - private static void SetSkin(int templateId, string skinAlias) - { - var x = (XmlElement)GetTemplate(templateId); - if (x == null) - { - x = (XmlElement)_skinningXmlContent.CreateNode(XmlNodeType.Element, "skin", ""); - SkinXml.DocumentElement.AppendChild(x); - } - - x.SetAttribute("template", templateId.ToString()); - x.SetAttribute("alias", skinAlias); - Save(); - - ClearCheckPages(); - } - - private static void RemoveSkin(int templateId) - { - var x = (XmlElement)GetTemplate(templateId); - if (x != null) - { - x.ParentNode.RemoveChild(x); - Save(); - ClearCheckPages(); - } - } - - private static XmlNode GetTemplate(int templateId) - { - var x = SkinXml.SelectSingleNode("/skinning/skin [@template=" + templateId.ToString() + "]"); - return x; - } - - public static List GetAllSkins() - { - var skins = new List(); - - foreach (var dir in Directory.GetDirectories(IOHelper.MapPath(SystemDirectories.Masterpages))) - { - if (File.Exists(Path.Combine(dir, "skin.xml"))) - { - var s = Skin.CreateFromFile((Path.Combine(dir, "skin.xml"))); - s.Alias = new DirectoryInfo(dir).Name; - skins.Add(s); - } - } - return skins; - } - - - private static XmlDocument SkinXml - { - get - { - if (_skinningXmlContent == null) - { - if (_skinningXmlSource == null) - { - //if we pop it here it'll make for better stack traces ;) - _skinningXmlSource = IOHelper.MapPath(SystemFiles.SkinningXml, false); - } - - _skinningXmlContent = new XmlDocument(); - - if (!File.Exists(_skinningXmlSource)) - { - var f = File.Open(_skinningXmlSource, FileMode.Create); - var sw = new StreamWriter(f); - sw.WriteLine(""); - sw.Close(); - f.Close(); - } - _skinningXmlContent.Load(_skinningXmlSource); - } - return _skinningXmlContent; - } - } - - public static Dictionary> SkinnableTemplates() - { - var dts = (Dictionary>)HttpRuntime.Cache[Cachekey]; - if (dts == null) - dts = RegisterSkinnableTemplates(); - - return dts; - } - - //this is an pretty expensive operation, so we will cache the result... - private static Dictionary> RegisterSkinnableTemplates() - { - HttpRuntime.Cache.Remove(Cachekey); - - var allowedTemplates = new Dictionary>(); - - foreach (string dir in Directory.GetDirectories(IOHelper.MapPath(SystemDirectories.Masterpages))) - { - if (File.Exists(Path.Combine(dir, "skin.xml"))) - { - var manifest = new XmlDocument(); - manifest.Load(Path.Combine(dir, "skin.xml")); - - var name = XmlHelper.GetNodeValue(manifest.SelectSingleNode("/Skin/Name")); - var types = XmlHelper.GetNodeValue(manifest.SelectSingleNode("/Skin/AllowedRootTemplate")).Split(','); - var alias = new DirectoryInfo(dir).Name; - - //foreach allowed type, test if it is already there... - foreach (var t in types) - { - if (!allowedTemplates.ContainsKey(t)) - allowedTemplates.Add(t, new Dictionary()); - - if (!allowedTemplates[t].ContainsKey(alias)) - allowedTemplates[t].Add(alias, name); - } - } - } - HttpRuntime.Cache.Insert(Cachekey, allowedTemplates, new CacheDependency(IOHelper.MapPath(SystemDirectories.Masterpages))); - - return allowedTemplates; - } - - //Helpers for detecting what skins work with what document types - public static bool IsSkinnable(string templateAlias) - { - return SkinnableTemplates().ContainsKey(templateAlias); - } - - public static bool IsSkinnable(Template template) - { - return IsSkinnable(template.Alias); - } - - - public static Dictionary AllowedSkins(int templateID) - { - var template = new Template(templateID); - return AllowedSkins(template.Alias); - } - - public static Dictionary AllowedSkins(Template template) - { - return AllowedSkins(template.Alias); - } - - public static Dictionary AllowedSkins(string templateAlias) - { - if (IsSkinnable(templateAlias)) - { - return SkinnableTemplates()[templateAlias]; - } - else - return new Dictionary(); - } - - public static bool IsStarterKitInstalled() - { - foreach (var p in packager.InstalledPackage.GetAllInstalledPackages()) - { - if (p.Data.EnableSkins) - return true; - - } - return false; - } - - public static Guid? StarterKitGuid() - { - foreach (var p in packager.InstalledPackage.GetAllInstalledPackages()) - { - if (p.Data.EnableSkins) - return new Guid(p.Data.PackageGuid); - - } - return null; - } - - public static Guid? StarterKitGuid(int template) - { - string packageFile = IOHelper.MapPath(SystemDirectories.Packages) + "/installed/installedPackages.config"; - var installed = new XmlDocument(); - if (File.Exists(packageFile)) - { - installed.Load(packageFile); - - var starterKit = installed.SelectSingleNode( - string.Format("//package [@enableSkins = 'True' and @packageGuid != '' and contains(./templates, '{0}')]", template)); - - if (starterKit != null) - return new Guid(starterKit.Attributes["packageGuid"].Value); - } - - return null; - } - - public static bool HasAvailableSkins(int template) - { - var r = false; - - var g = StarterKitGuid(template); - - if (g != null) - { - try - { - var skinRepoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; - - if (packager.InstalledPackage.GetByGuid(g.ToString()).Data.SkinRepoGuid != null && - packager.InstalledPackage.GetByGuid(g.ToString()).Data.SkinRepoGuid != Guid.Empty) - { - skinRepoGuid = packager.InstalledPackage.GetByGuid(g.ToString()).Data.SkinRepoGuid.ToString(); - } - - - var repo = packager.repositories.Repository.getByGuid(skinRepoGuid); - if (repo == null) - { - return false; - } - - r = repo.Webservice.Skins(g.ToString()).Length > 0; - } - catch { } - } - return r; - } - - public static bool IsSkinInstalled(Guid SkinGuid) - { - - return IsPackageInstalled(SkinGuid); - } - - public static bool IsPackageInstalled(Guid PackageGuid) - { - var installed = new XmlDocument(); - installed.Load(IOHelper.MapPath(SystemDirectories.Packages) + "/installed/installedPackages.config"); - - var packageNode = installed.SelectSingleNode( - string.Format("//package [@packageGuid = '{0}']", PackageGuid.ToString())); - - return packageNode != null; - } - - public static bool IsPackageInstalled(string Name) - { - var installed = new XmlDocument(); - installed.Load(IOHelper.MapPath(SystemDirectories.Packages) + "/installed/installedPackages.config"); - - var packageNode = installed.SelectSingleNode( - string.Format("//package [@name = '{0}']", Name)); - - return packageNode != null; - } - - public static string GetModuleAlias(string Name) - { - var installed = new XmlDocument(); - installed.Load(IOHelper.MapPath(SystemDirectories.Packages) + "/installed/installedPackages.config"); - - var packageNode = installed.SelectSingleNode( - string.Format("//package [@name = '{0}']", Name)); - - var macroNode = packageNode.SelectSingleNode(".//macros"); - - var m = new macro.Macro(Convert.ToInt32(macroNode.InnerText.Split(',')[0])); - - return m.Alias; - } - - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/Task.cs b/src/umbraco.cms/businesslogic/skinning/Task.cs deleted file mode 100644 index 653b6d6d2c..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/Task.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml; -using System.Web; -using System.Reflection; - -namespace umbraco.cms.businesslogic.skinning -{ - public class Task - { - public Task() - { - Properties = new Dictionary(); - } - - public static Task CreateFromXmlNode(XmlNode node) - { - Task t = new Task(); - - if (node.Attributes["type"] != null) - { - - if (node.Attributes["assembly"] != null) - { - //custom task type - - //string assemblyFile = - // HttpContext.Current.Server.MapPath( - // String.Format("{0}/../bin/{1}.dll", - // GlobalSettings.Path, - // node.Attributes["assembly"].Value)); - - //Assembly customAssembly = Assembly.LoadFrom(assemblyFile); - Assembly customAssembly = Assembly.Load(node.Attributes["assembly"].Value); - - t.TaskType = (TaskType)Activator.CreateInstance( - customAssembly.GetType(node.Attributes["type"].Value)); - - - - } - else - { - //internal dependency type - - //string assemblyFile = - // HttpContext.Current.Server.MapPath( - // String.Format("{0}/../bin/{1}.dll", - // GlobalSettings.Path, - // "cms")); - - //Assembly defaultAssembly = Assembly.LoadFrom(assemblyFile); - - Assembly defaultAssembly = Assembly.Load("cms"); - - t.TaskType = (TaskType)Activator.CreateInstance( - defaultAssembly.GetType( - string.Format( - "umbraco.cms.businesslogic.skinning.tasks.{0}", - node.Attributes["type"].Value))); - } - } - - foreach (XmlNode prop in node.ChildNodes) - { - if (prop.Name != "OriginalValue" && prop.Name != "NewValue") - { - if (prop.Name == "Value") - t.Value = prop.InnerText; - else - t.Properties.Add(prop.Name, prop.InnerText); - - t.TaskType.GetType().InvokeMember( - prop.Name, - System.Reflection.BindingFlags.SetProperty, - null, - t.TaskType, - new object[] { prop.InnerText }); - } - } - return t; - } - - public TaskType TaskType { get; set; } - - public Dictionary Properties { get; set; } - - public string Value { get; set; } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/TaskType.cs b/src/umbraco.cms/businesslogic/skinning/TaskType.cs deleted file mode 100644 index 4c0092667e..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/TaskType.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using umbraco.interfaces.skinning; -using System.Xml; -using System.Reflection; - -namespace umbraco.cms.businesslogic.skinning -{ - public abstract class TaskType : ProviderBase, ITaskType - { - public abstract TaskExecutionDetails Execute(string Value); - - public virtual TaskExecutionStatus RollBack(string OriginalValue) - { - return Execute(OriginalValue).TaskExecutionStatus; - } - - public abstract string PreviewClientScript(string ControlClientId, string ClientSidePreviewEventType, string ClientSideGetValueScript); - - public String Value { get; set; } - - public virtual XmlNode ToXml(string OriginalValue, string NewValue) - { - XmlDocument d = new XmlDocument(); - - XmlNode n = d.CreateElement("Task"); - - XmlAttribute type = d.CreateAttribute("type"); - type.Value = this.GetType().Name; - n.Attributes.Append(type); - - if (!this.GetType().FullName.Contains("umbraco.cms.businesslogic.skinning")) - { - XmlAttribute assembly = d.CreateAttribute("assembly"); - assembly.Value = this.GetType().Assembly.FullName; - n.Attributes.Append(assembly); - } - - XmlAttribute executed = d.CreateAttribute("executed"); - executed.Value = DateTime.Now.ToString("s"); - n.Attributes.Append(executed); - - foreach(PropertyInfo p in this.GetType().GetProperties()) - { - if(p.Name != "Name" && p.Name != "Description") - { - XmlNode pNode = d.CreateElement(p.Name); - pNode.InnerText = p.GetValue(this,null) != null ? p.GetValue(this,null).ToString() : string.Empty; - - n.AppendChild(pNode); - } - } - - - XmlNode origValNode = d.CreateElement("OriginalValue"); - origValNode.InnerText = OriginalValue; - n.AppendChild(origValNode); - - XmlNode newValNode = d.CreateElement("NewValue"); - newValNode.InnerText = NewValue; - n.AppendChild(newValNode); - - return n; - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/controls/ColorPicker.cs b/src/umbraco.cms/businesslogic/skinning/controls/ColorPicker.cs deleted file mode 100644 index ddefa66efb..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/controls/ColorPicker.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Web.UI.WebControls; -using ClientDependency.Core; -using System.Web.UI; -using ClientDependency.Core.Controls; - -namespace umbraco.cms.businesslogic.skinning.controls -{ - [ClientDependency(450,ClientDependencyType.Javascript, "colorpicker/js/colorpicker.js", "UmbracoClient")] - [ClientDependency(460, ClientDependencyType.Javascript, "LiveEditing/Modules/SkinModule/js/initcolorpicker.js", "UmbracoRoot")] - [ClientDependency(200,ClientDependencyType.Css, "colorpicker/css/colorpicker.css", "UmbracoClient")] - public class ColorPicker: TextBox - { - - protected override void Render(HtmlTextWriter writer) - { - this.TextMode = System.Web.UI.WebControls.TextBoxMode.SingleLine; - this.CssClass = "skinningcolorpicker"; - - base.Render(writer); - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/controls/ImageUploader.cs b/src/umbraco.cms/businesslogic/skinning/controls/ImageUploader.cs deleted file mode 100644 index 20d340e01e..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/controls/ImageUploader.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Web.UI.WebControls; -using ClientDependency.Core; - - -namespace umbraco.cms.businesslogic.skinning.controls -{ - [ClientDependency(ClientDependencyType.Css, "modal/style.css", "UmbracoClient")] - [ClientDependency(500,ClientDependencyType.Javascript, "modal/modal.js", "UmbracoClient")] - public class ImageUploader : TextBox - { - public int ImageHeight { get; set; } - public int ImageWidth { get; set; } - - protected override void Render(System.Web.UI.HtmlTextWriter writer) - { - base.Render(writer); - - writer.WriteLine( - string.Format( - " Upload image", - "Umbraco.Controls.ModalWindow().open('" + this.ResolveUrl(GlobalSettings.Path) + "/LiveEditing/Modules/SkinModule/ImageUploader.aspx?ctrl=" + this.ClientID + "&w="+this.ImageWidth+"&h="+this.ImageHeight +"','Upload image',true,750,550,50,0, ['.modalbuton'], null);return false;")); - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/controls/SliderControl.cs b/src/umbraco.cms/businesslogic/skinning/controls/SliderControl.cs deleted file mode 100644 index 8bc1aa29c3..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/controls/SliderControl.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Web.UI.WebControls; -using ClientDependency.Core.Controls; -using ClientDependency.Core; - -namespace umbraco.cms.businesslogic.skinning.controls -{ - [ClientDependency(430, ClientDependencyType.Javascript, "ui/jqueryui.js", "UmbracoClient")] - [ClientDependency(440, ClientDependencyType.Javascript, "LiveEditing/Modules/SkinModule/js/initslider.js", "UmbracoRoot")] - [ClientDependency(ClientDependencyType.Css, "ui/ui-lightness/jquery-ui.custom.css", "UmbracoClient")] - public class SliderControl: TextBox - { - public int MinimumValue { get; set; } - public int MaximumValue { get; set; } - public int InitialValue { get; set; } - public int Ratio { get; set; } - - protected override void Render(System.Web.UI.HtmlTextWriter writer) - { - this.Attributes.Add("style", "display:none;"); - - base.Render(writer); - - writer.WriteLine( - string.Format( - "
", - MinimumValue + "," + MaximumValue + "," + InitialValue + "," + Ratio +","+this.ClientID)); - - - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/dependencies/Color.cs b/src/umbraco.cms/businesslogic/skinning/dependencies/Color.cs deleted file mode 100644 index adb80c7439..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/dependencies/Color.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using umbraco.cms.businesslogic.skinning; -using umbraco.cms.businesslogic.skinning.controls; -using System.Web.UI.WebControls; - -namespace umbraco.cms.businesslogic.skinning.dependencies -{ - public class Color : DependencyType - { - public ColorPicker cp; - public List _value; - - public Color() - { - this.Name = "Color"; - this.Description = "Will render a color picker"; - - - cp = new ColorPicker(); - _value = new List(); - } - - public override WebControl Editor - { - get - { - - if (_value.Count > 0 && !string.IsNullOrEmpty(_value[0].ToString())) - cp.Text = _value[0].ToString(); - - return cp; - } - set - { - base.Editor = value; - } - } - - public override List Values - { - get - { - if (cp.Text != "") - { - _value.Clear(); - _value.Add(cp.Text); - } - return _value; - } - set - { - _value = value; - } - } - - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/dependencies/Image.cs b/src/umbraco.cms/businesslogic/skinning/dependencies/Image.cs deleted file mode 100644 index 3840164d7b..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/dependencies/Image.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Web.UI.WebControls; -using umbraco.cms.businesslogic.skinning.controls; - -namespace umbraco.cms.businesslogic.skinning.dependencies -{ - public class Image: DependencyType - { - - public string Height { get; set; } - public string Width { get; set; } - //currently just returning a textbox, need to replace this with a custom image control - - public ImageUploader iu; - public List _value; - - public Image() - { - this.Name = "Text"; - this.Description = "Will render a text input"; - - - iu = new ImageUploader(); - - _value = new List(); - } - - public override WebControl Editor - { - get - { - iu.TextMode = System.Web.UI.WebControls.TextBoxMode.SingleLine; - iu.CssClass = "image"; - - - int w; - - if(int.TryParse(Width, out w)) - iu.ImageWidth = w; - - int h; - - if(int.TryParse(Height, out h)) - iu.ImageHeight = h; - - - if (_value.Count > 0 && !string.IsNullOrEmpty(_value[0].ToString())) - iu.Text = _value[0].ToString(); - - return iu; - } - set - { - base.Editor = value; - } - } - - - - public override List Values - { - get - { - if (iu.Text != "") - { - _value.Clear(); - _value.Add(iu.Text); - } - return _value; - } - set - { - _value = value; - } - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/dependencies/Option.cs b/src/umbraco.cms/businesslogic/skinning/dependencies/Option.cs deleted file mode 100644 index ffa7b8083f..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/dependencies/Option.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Web.UI.WebControls; - -namespace umbraco.cms.businesslogic.skinning.dependencies -{ - public class Option : DependencyType - { - public DropDownList ddl; - public List _value; - - public string Options { get; set; } - - public Option() - { - this.Name = "Option"; - this.Description = "Will render a dropdown"; - - - ddl = new DropDownList(); - _value = new List(); - } - - public override WebControl Editor - { - get - { - ddl.Items.Clear(); - - - ddl.Items.Add(""); - - foreach (string option in Options.Split('|')) - { - string text = option.Split(';')[0]; - string value = option.Split(';').Length == 2 ? option.Split(';')[1] : text; - - ddl.Items.Add(new ListItem(text,value)); - } - - if (_value.Count > 0) - ddl.SelectedValue = _value[0].ToString(); - - return ddl; - } - set - { - base.Editor = value; - } - } - - public override List Values - { - get - { - if (ddl.SelectedValue != "") - { - _value.Clear(); - _value.Add(ddl.SelectedValue); - } - return _value; - } - set - { - _value = value; - } - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/dependencies/Slider.cs b/src/umbraco.cms/businesslogic/skinning/dependencies/Slider.cs deleted file mode 100644 index 4e6f450271..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/dependencies/Slider.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using umbraco.cms.businesslogic.skinning.controls; -using System.Web.UI.WebControls; - -namespace umbraco.cms.businesslogic.skinning.dependencies -{ - public class Slider : DependencyType - { - public SliderControl sc; - public List _value; - - public string Minimum { get; set; } - public string Maximum { get; set; } - public string Initial { get; set; } - - public string Ratio { get; set; } - - public Slider() - { - this.Name = "Slider"; - this.Description = "Will render a slider"; - - - sc = new SliderControl(); - _value = new List(); - } - - public override WebControl Editor - { - get - { - - int min; - - if (int.TryParse(Minimum, out min)) - sc.MinimumValue = min; - - int max; - - if (int.TryParse(Maximum, out max)) - sc.MaximumValue = max; - - int ratio; - - if (int.TryParse(Ratio, out ratio)) - sc.Ratio = max; - - int init; - - if (int.TryParse(Initial, out init)) - { - sc.InitialValue = init; - sc.Text = init.ToString(); - } - - - if (_value.Count > 0 && !string.IsNullOrEmpty(_value[0].ToString())) - sc.Text = _value[0].ToString(); - - return sc; - } - set - { - base.Editor = value; - } - } - - public override List Values - { - get - { - if (sc.Text != "") - { - _value.Clear(); - _value.Add(sc.Text); - } - return _value; - } - set - { - _value = value; - } - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/dependencies/Text.cs b/src/umbraco.cms/businesslogic/skinning/dependencies/Text.cs deleted file mode 100644 index 1997e68829..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/dependencies/Text.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Web.UI.WebControls; - -namespace umbraco.cms.businesslogic.skinning.dependencies -{ - public class Text : DependencyType - { - public System.Web.UI.WebControls.TextBox tb; - public List _value; - - public Text() - { - this.Name = "Text"; - this.Description = "Will render a text input"; - - - tb = new TextBox(); - _value = new List(); - } - - public override WebControl Editor - { - get - { - tb.TextMode = System.Web.UI.WebControls.TextBoxMode.SingleLine; - tb.CssClass = "text"; - - if (_value.Count > 0 && !string.IsNullOrEmpty(_value[0].ToString())) - tb.Text = _value[0].ToString(); - - return tb; - } - set - { - base.Editor = value; - } - } - - public override List Values - { - get - { - if (tb.Text != "") - { - _value.Clear(); - _value.Add(tb.Text); - } - return _value; - } - set - { - _value = value; - } - } - - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/tasks/AddStyleSheetToTemplate.cs b/src/umbraco.cms/businesslogic/skinning/tasks/AddStyleSheetToTemplate.cs deleted file mode 100644 index 44f67d4506..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/tasks/AddStyleSheetToTemplate.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System; -using umbraco.interfaces.skinning; -using HtmlAgilityPack; -using umbraco.IO; - -namespace umbraco.cms.businesslogic.skinning.tasks -{ - public class AddStyleSheetToTemplate : TaskType - { - public string TargetFile { get; set; } - public string TargetSelector { get; set; } - public string Media { get; set; } - - public AddStyleSheetToTemplate() - { - this.Name = "Add StyleSheet To Template"; - this.Description = "Will add an additional stylesheet to a template"; - } - - public override TaskExecutionDetails Execute(string Value) - { - TaskExecutionDetails d = new TaskExecutionDetails(); - - - HtmlDocument doc = new HtmlDocument(); - doc.Load(IO.IOHelper.MapPath(SystemDirectories.Masterpages) + "/" + TargetFile); - - //if (doc.DocumentNode.SelectSingleNode(string.Format("//link [@href = '{0}']", Value)) == null) - //{ - - HtmlNode target = doc.DocumentNode.SelectSingleNode(string.IsNullOrEmpty(TargetSelector) ? "//head" : TargetSelector.ToLower()); - - if (target != null) - { - - HtmlNode s = doc.CreateElement("link"); - //s.Name = "link"; - s.Attributes.Append("rel", "stylesheet"); - s.Attributes.Append("type", "text/css"); - - - s.Attributes.Append("href", Value); - - - if (!string.IsNullOrEmpty(Media)) - s.Attributes.Append("media", Media); - - target.AppendChild(s); - - doc.Save(IO.IOHelper.MapPath(SystemDirectories.Masterpages) + "/" + TargetFile); - - d.TaskExecutionStatus = TaskExecutionStatus.Completed; - d.NewValue = Value; - } - else - d.TaskExecutionStatus = TaskExecutionStatus.Cancelled; - //} - //else - // d.TaskExecutionStatus = TaskExecutionStatus.Cancelled; - - return d; - } - - public override TaskExecutionStatus RollBack(string OriginalValue) - { - HtmlDocument doc = new HtmlDocument(); - doc.Load(IO.IOHelper.MapPath(SystemDirectories.Masterpages) + "/" + TargetFile); - - HtmlNode s = doc.DocumentNode.SelectSingleNode(string.Format("//link [@href = '{0}']", Value)); - - if (s != null) - { - s.RemoveAll(); - - doc.Save(IO.IOHelper.MapPath(SystemDirectories.Masterpages) + "/" + TargetFile); - - return TaskExecutionStatus.Completed; - } - else - return TaskExecutionStatus.Cancelled; - - - } - - public override string PreviewClientScript(string ControlClientId, string ClientSidePreviewEventType, string ClientSideGetValueScript) - { - return string.Format( - @"var link{4}; - jQuery('#{0}').bind('{2}', function() {{ - jQuery(link{4}).remove(); - link{4} = jQuery(''); - link{4}.attr({{ - type: 'text/css', - rel: 'stylesheet', - {3} - href:{1} - }}); - jQuery('head').append(link{4}); - }}); - - - //cancel support - jQuery('#cancelSkinCustomization').click(function () {{ - jQuery(link{4}).remove(); - }}); - ", - ControlClientId, - ClientSideGetValueScript, - ClientSidePreviewEventType, - string.IsNullOrEmpty(Media) ? "" : string.Format("media :'{0}',",Media), - Guid.NewGuid().ToString().Replace("-", "")); - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/tasks/ModifyCss.cs b/src/umbraco.cms/businesslogic/skinning/tasks/ModifyCss.cs deleted file mode 100644 index c4fdf5c07b..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/tasks/ModifyCss.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using umbraco.interfaces.skinning; -using System.IO; -using umbraco.IO; -using System.Web; - -namespace umbraco.cms.businesslogic.skinning.tasks -{ - public class ModifyCss : TaskType - { - public string TargetFile { get; set; } - public string TargetRule { get; set; } - public string TargetParameter { get; set; } - - public ModifyCss() - { - this.Name = "Modify Css"; - this.Description = "Will modify the stylesheet"; - } - - public override TaskExecutionDetails Execute(string Value) - { - TaskExecutionDetails d = new TaskExecutionDetails(); - - //currently just appending it to the end of the css file - StreamWriter sw = File.AppendText(IO.IOHelper.MapPath(SystemDirectories.Css) + "/" + TargetFile); - sw.WriteLine(string.Format("{0}{{ {1}:{2};}}", TargetRule, TargetParameter, Value)); - sw.Close(); - - d.TaskExecutionStatus = TaskExecutionStatus.Completed; - d.OriginalValue = ""; - d.NewValue = Value; - - return d; - } - - public override TaskExecutionStatus RollBack(string OriginalValue) - { - string[] filecontents = File.ReadAllLines(IO.IOHelper.MapPath(SystemDirectories.Css) + "/" + TargetFile); - - for (int i = filecontents.Length; i > 0; i--) - { - if (filecontents[i - 1].Contains(string.Format("{0}{{ {1}:", TargetRule, TargetParameter))) - { - filecontents[i - 1] = string.Empty; - break; - } - } - - StringBuilder s = new StringBuilder(); - - foreach (string line in filecontents) - s.AppendLine(line); - - System.IO.StreamWriter file = new System.IO.StreamWriter(IO.IOHelper.MapPath(SystemDirectories.Css) + "/" + TargetFile); - file.WriteLine(s.ToString()); - - file.Close(); - - - return TaskExecutionStatus.Completed; - } - - public override string PreviewClientScript(string ControlClientId,string ClientSidePreviewEventType, string ClientSideGetValueScript) - { - - return string.Format( - @"jQuery('#{0}').bind('{5}', function() {{ - var val = '{3}'; - jQuery('{1}').css('{2}', val.replace('${{Output}}',{4})); - }}); - - - //cancel support - var init{6} = jQuery('{1}').css('{2}'); - jQuery('#cancelSkinCustomization').click(function () {{ - jQuery('{1}').css('{2}',init{6}); - }}); - - ", - ControlClientId, - TargetRule, - TargetParameter, - Value, - ClientSideGetValueScript, - ClientSidePreviewEventType, - Guid.NewGuid().ToString().Replace("-", "")); - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/tasks/ModifyPageProperty.cs b/src/umbraco.cms/businesslogic/skinning/tasks/ModifyPageProperty.cs deleted file mode 100644 index cba9da77fb..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/tasks/ModifyPageProperty.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using umbraco.interfaces.skinning; -using umbraco.cms.businesslogic.web; -using System.Web; - -namespace umbraco.cms.businesslogic.skinning.tasks -{ - public class ModifyPageProperty : TaskType - { - public string PropertyAlias { get; set; } - public string ClientSideContainerID { get; set; } - - public ModifyPageProperty() - { - this.Name = " Modify page property"; - this.Description = "Will modify a property on the current page"; - } - - public override TaskExecutionDetails Execute(string Value) - { - TaskExecutionDetails d = new TaskExecutionDetails(); - - if (HttpContext.Current != null && HttpContext.Current.Items["pageID"] != null) - { - string id = HttpContext.Current.Items["pageID"].ToString(); - - Document doc = new Document(Convert.ToInt32(id)); - - if (doc.getProperty(PropertyAlias) != null) - { - d.OriginalValue = doc.getProperty(PropertyAlias).Value.ToString(); - - doc.getProperty(PropertyAlias).Value = Value; - doc.SaveAndPublish(new BusinessLogic.User(0)); - - d.NewValue = Value; - d.TaskExecutionStatus = TaskExecutionStatus.Completed; - } - else - d.TaskExecutionStatus = TaskExecutionStatus.Cancelled; - - } - else - d.TaskExecutionStatus = TaskExecutionStatus.Cancelled; - - return d; - } - - - public override string PreviewClientScript(string ControlClientId, string ClientSidePreviewEventType, string ClientSideGetValueScript) - { - - - return string.Format( - @"jQuery('#{0}').bind('{3}', function() {{ - jQuery('#{1}').html({2}); - }}); - - //cancel support - var init{4} = jQuery('#{1}').html(); - jQuery('#cancelSkinCustomization').click(function () {{ - jQuery('#{1}').html(init{4}); - }}); - ", - ControlClientId, - ClientSideContainerID, - ClientSideGetValueScript, - ClientSidePreviewEventType, - Guid.NewGuid().ToString().Replace("-", "")); - - - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/tasks/ModifyTemplate.cs b/src/umbraco.cms/businesslogic/skinning/tasks/ModifyTemplate.cs deleted file mode 100644 index 7d3d7a7c63..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/tasks/ModifyTemplate.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using umbraco.interfaces.skinning; -using umbraco.IO; -using HtmlAgilityPack; - -namespace umbraco.cms.businesslogic.skinning.tasks -{ - public class ModifyTemplate : TaskType - { - public string TargetFile { get; set; } - public string TargetID { get; set; } - public string TargetAttribute { get; set; } - - public ModifyTemplate() - { - this.Name = " Modify template"; - this.Description = "Will modify a template"; - } - - public override TaskExecutionDetails Execute(string Value) - { - TaskExecutionDetails d = new TaskExecutionDetails(); - - //open template - - HtmlDocument doc = new HtmlDocument(); - doc.Load(IO.IOHelper.MapPath(SystemDirectories.Masterpages) + "/" +TargetFile); - - if (doc.DocumentNode.SelectNodes(string.Format("//*[@id = '{0}']", TargetID)) != null) - { - foreach (HtmlNode target in doc.DocumentNode.SelectNodes(string.Format("//*[@id = '{0}']", TargetID))) - { - if (string.IsNullOrEmpty(TargetAttribute)) - { - d.OriginalValue = target.InnerHtml; - target.InnerHtml = Value; - } - else - { - if (target.Attributes[TargetAttribute] == null) - { - target.Attributes.Append(TargetAttribute, Value); - } - else - { - d.OriginalValue = target.Attributes[TargetAttribute].Value; - target.Attributes[TargetAttribute].Value = Value; - } - } - } - } - doc.Save(IO.IOHelper.MapPath(SystemDirectories.Masterpages) + "/" + TargetFile); - - d.TaskExecutionStatus = TaskExecutionStatus.Completed; - d.NewValue = Value; - //save - - return d; - } - - - public override string PreviewClientScript(string ControlClientId,string ClientSidePreviewEventType, string ClientSideGetValueScript) - { - - if (string.IsNullOrEmpty(TargetAttribute)) - { - return string.Format( - @"jQuery('#{0}').bind('{3}', function() {{ - var val = '{5}'; - jQuery('#{1}').html(val.replace('${{Output}}',{2})); - }}); - - //cancel support - var init{4} = jQuery('#{1}').html(); - jQuery('#cancelSkinCustomization').click(function () {{ - jQuery('#{1}').html(init{4}); - }}); - ", - ControlClientId, - TargetID, - ClientSideGetValueScript, - ClientSidePreviewEventType, - Guid.NewGuid().ToString().Replace("-", ""), - Value); - } - else - { - return string.Format( - @"jQuery('#{0}').bind('{4}', function() {{ - var val = '{6}'; - jQuery('#{1}').attr('{2}',val.replace('${{Output}}',{3})); - }}); - - - //cancel support - var init{5} = jQuery('#{1}').attr('{2}'); - jQuery('#cancelSkinCustomization').click(function () {{ - jQuery('#{1}').attr('{2}',init{5}); - }}); - ", - ControlClientId, - TargetID, - TargetAttribute, - ClientSideGetValueScript, - ClientSidePreviewEventType, - Guid.NewGuid().ToString().Replace("-", ""), - Value); - } - } - } -} diff --git a/src/umbraco.cms/umbraco.cms.csproj b/src/umbraco.cms/umbraco.cms.csproj index 1c218bc3a8..6262adb867 100644 --- a/src/umbraco.cms/umbraco.cms.csproj +++ b/src/umbraco.cms/umbraco.cms.csproj @@ -212,7 +212,6 @@ - @@ -257,34 +256,13 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/src/umbraco.editorControls/AbstractPrevalueEditor.cs b/src/umbraco.editorControls/AbstractPrevalueEditor.cs index 0d6521449a..c63c06ec75 100644 --- a/src/umbraco.editorControls/AbstractPrevalueEditor.cs +++ b/src/umbraco.editorControls/AbstractPrevalueEditor.cs @@ -1,6 +1,7 @@ using System; using System.Web.UI; using System.Web.UI.WebControls; +using ClientDependency.Core; using umbraco.interfaces; using umbraco.cms.businesslogic.datatype; diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataEditor.cs b/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataEditor.cs index 979eb06e80..fde7e6cac0 100644 --- a/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataEditor.cs +++ b/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataEditor.cs @@ -313,8 +313,8 @@ namespace umbraco.editorControls.MultiNodeTreePicker base.OnLoad(e); //add the js/css required - this.RegisterEmbeddedClientResource("umbraco.editorControls.MultiNodeTreePicker.MultiNodePickerStyles.css", umbraco.cms.businesslogic.datatype.ClientDependencyType.Css); - this.RegisterEmbeddedClientResource("umbraco.editorControls.MultiNodeTreePicker.MultiNodePickerScripts.js", umbraco.cms.businesslogic.datatype.ClientDependencyType.Javascript); + this.RegisterEmbeddedClientResource("umbraco.editorControls.MultiNodeTreePicker.MultiNodePickerStyles.css", ClientDependencyType.Css); + this.RegisterEmbeddedClientResource("umbraco.editorControls.MultiNodeTreePicker.MultiNodePickerScripts.js", ClientDependencyType.Javascript); //update the tree type (we need to do this each time because i don't think view state works with these controls) switch (TreeToRender) diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_PrevalueEditor.cs b/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_PrevalueEditor.cs index 352288d301..dbdc356273 100644 --- a/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_PrevalueEditor.cs +++ b/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_PrevalueEditor.cs @@ -3,10 +3,11 @@ using System.Collections; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; +using ClientDependency.Core; using umbraco.cms.businesslogic.datatype; using umbraco.interfaces; using umbraco.uicontrols.TreePicker; -using Umbraco.Core; +using Constants = Umbraco.Core.Constants; namespace umbraco.editorControls.MultiNodeTreePicker { diff --git a/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringControl.cs b/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringControl.cs index fb925d4ee1..384e24144f 100644 --- a/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringControl.cs +++ b/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringControl.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Web.UI; using System.Web.UI.WebControls; +using ClientDependency.Core; using umbraco; using umbraco.cms.businesslogic.datatype; diff --git a/src/umbraco.editorControls/ResourceExtensions.cs b/src/umbraco.editorControls/ResourceExtensions.cs index 18593679f4..e0923669cf 100644 --- a/src/umbraco.editorControls/ResourceExtensions.cs +++ b/src/umbraco.editorControls/ResourceExtensions.cs @@ -1,5 +1,6 @@ using System; using System.Web.UI; +using ClientDependency.Core; using umbraco; using umbraco.cms.businesslogic.datatype; using System.Web.UI.HtmlControls; diff --git a/src/umbraco.editorControls/macrocontainer/Editor.cs b/src/umbraco.editorControls/macrocontainer/Editor.cs index 4f0d62630f..d4cbdeaeca 100644 --- a/src/umbraco.editorControls/macrocontainer/Editor.cs +++ b/src/umbraco.editorControls/macrocontainer/Editor.cs @@ -170,21 +170,7 @@ namespace umbraco.editorControls.macrocontainer base.OnLoad(e); // And a reference to the macro container calls - //if (!UmbracoContext.Current.LiveEditingContext.Enabled) - //{ - // ScriptManager sm = ScriptManager.GetCurrent(base.Page); - // ServiceReference webservicePath = new ServiceReference(SystemDirectories.Webservices + "/MacroContainerService.asmx"); - - // if (!sm.Services.Contains(webservicePath)) - // sm.Services.Add(webservicePath); - //} - //else - //{ - // ClientDependencyLoader.Instance.RegisterDependency("webservices/MacroContainerService.asmx/js", "UmbracoRoot", ClientDependencyType.Javascript); - //} - - - + //ClientDependencyLoader.Instance.RegisterDependency("webservices/MacroContainerService.asmx/js", "UmbracoRoot", ClientDependencyType.Javascript); string script = "function " + ID + "makesortable(){ "; diff --git a/src/umbraco.editorControls/tinyMCE3/TinyMCE.cs b/src/umbraco.editorControls/tinyMCE3/TinyMCE.cs index adf6a73b6c..64d859e45e 100644 --- a/src/umbraco.editorControls/tinyMCE3/TinyMCE.cs +++ b/src/umbraco.editorControls/tinyMCE3/TinyMCE.cs @@ -18,7 +18,7 @@ using umbraco.uicontrols; namespace umbraco.editorControls.tinyMCE3 { - public class TinyMCE : TinyMCEWebControl, IDataEditor, IMenuElement, ILiveEditingDataEditor + public class TinyMCE : TinyMCEWebControl, IDataEditor, IMenuElement { private readonly string _activateButtons = ""; private readonly string _advancedUsers = ""; @@ -38,8 +38,6 @@ namespace umbraco.editorControls.tinyMCE3 private readonly int m_maxImageWidth = 500; private bool _isInitialized; private string _plugins = ""; - private bool m_isInLiveEditingMode; - public TinyMCE(IData Data, string Configuration) { @@ -402,19 +400,6 @@ namespace umbraco.editorControls.tinyMCE3 } } - #region ILiveEditingDataEditor Members - - public Control LiveEditingControl - { - get - { - m_isInLiveEditingMode = true; - base.IsInLiveEditingMode = true; - return this; - } - } - - #endregion #region IMenuElement Members @@ -457,20 +442,9 @@ namespace umbraco.editorControls.tinyMCE3 config.Add("theme_umbraco_versionId", base.VersionId.ToString()); // we'll need to make an extra check for the liveediting as that value is set after the constructor have initialized - if (IsInLiveEditingMode) - { - if (config["theme_umbraco_toolbar_location"] == null) - config.Add("theme_umbraco_toolbar_location", ""); - config["theme_umbraco_toolbar_location"] = "external"; - config.Add("umbraco_toolbar_id", - "LiveEditingClientToolbar"); - } - else - { - config.Add("umbraco_toolbar_id", + config.Add("umbraco_toolbar_id", ElementIdPreFix + ((cms.businesslogic.datatype.DefaultData)_data).PropertyId); - } } else { diff --git a/src/umbraco.editorControls/tinyMCE3/webcontrol/TinyMCEWebControl.cs b/src/umbraco.editorControls/tinyMCE3/webcontrol/TinyMCEWebControl.cs index 8492aaef6a..3093b42003 100644 --- a/src/umbraco.editorControls/tinyMCE3/webcontrol/TinyMCEWebControl.cs +++ b/src/umbraco.editorControls/tinyMCE3/webcontrol/TinyMCEWebControl.cs @@ -26,8 +26,6 @@ namespace umbraco.editorControls.tinyMCE3.webcontrol private int _nodeId = 0; private Guid _versionId; - public bool IsInLiveEditingMode { get; set; } - public int NodeId { set { _nodeId = value; } @@ -109,33 +107,19 @@ namespace umbraco.editorControls.tinyMCE3.webcontrol protected override void Render(HtmlTextWriter writer) { base.Render(writer); - if (!IsInLiveEditingMode) - writer.Write(m_scriptInitBlock.ToString()); - else - // add a marker to tell Live Editing when a tinyMCE control is on the page - writer.Write(""); + // add a marker to tell Live Editing when a tinyMCE control is on the page + writer.Write(""); } protected override void OnLoad(EventArgs args) { - if (!IsInLiveEditingMode) - this.config["elements"] = this.ClientID; + this.config["elements"] = this.ClientID; + bool first = true; - // Render HTML for TinyMCE instance - // in the liveediting mode we're always preloading tinymce script - if (!IsInLiveEditingMode) - { - //TinyMCE uses it's own compressor so leave it up to ScriptManager to render - ScriptManager.RegisterClientScriptInclude(this, this.GetType(), _versionId.ToString(), this.ScriptURI); - } - else - { - //We're in live edit mode so add the base js file to the dependency list - ClientDependencyLoader.Instance.RegisterDependency("tinymce3/tiny_mce_src.js", - "UmbracoClient", ClientDependencyType.Javascript); - } + //TinyMCE uses it's own compressor so leave it up to ScriptManager to render + ScriptManager.RegisterClientScriptInclude(this, this.GetType(), _versionId.ToString(), this.ScriptURI); // Write script tag start m_scriptInitBlock.Append(HtmlTextWriter.TagLeftChar.ToString()); @@ -150,54 +134,28 @@ namespace umbraco.editorControls.tinyMCE3.webcontrol foreach (string key in this.config.Keys) { //TODO: This is a hack to test if we can prevent tinymce from automatically download languages - if (!IsInLiveEditingMode || (key != "language")) - { - string val = this.config[key]; + string val = this.config[key]; - if (!first) - m_scriptInitBlock.Append(",\n"); - else - first = false; + if (!first) + m_scriptInitBlock.Append(",\n"); + else + first = false; - // Is boolean state or string - if (val == "true" || val == "false") - m_scriptInitBlock.Append(key + ":" + this.config[key]); - else - m_scriptInitBlock.Append(key + ":'" + this.config[key] + "'"); - } + // Is boolean state or string + if (val == "true" || val == "false") + m_scriptInitBlock.Append(key + ":" + this.config[key]); + else + m_scriptInitBlock.Append(key + ":'" + this.config[key] + "'"); } m_scriptInitBlock.Append("\n});\n"); - // we're wrapping the tinymce init call in a load function when in live editing, - // so we'll need to close that function declaration - if (IsInLiveEditingMode) - { - m_scriptInitBlock.Append(@"(function() { var f = - function() { - if(document.getElementById('__umbraco_tinyMCE')) - tinyMCE.execCommand('mceAddControl',false,'").Append(ClientID).Append(@"'); - ItemEditing.remove_startEdit(f); - } - ItemEditing.add_startEdit(f);})();"); - m_scriptInitBlock.Append(@"(function() { var f = - function() { - tinyMCE.execCommand('mceRemoveControl',false,'").Append(ClientID).Append(@"'); - ItemEditing.remove_stopEdit(f); - } - ItemEditing.add_stopEdit(f);})();"); - } + // Write script tag end m_scriptInitBlock.Append(HtmlTextWriter.EndTagLeftChars); m_scriptInitBlock.Append("script"); m_scriptInitBlock.Append(HtmlTextWriter.TagRightChar.ToString()); - - // add to script manager - if (IsInLiveEditingMode) - { - ScriptManager.RegisterClientScriptBlock(this, this.GetType(), new Guid().ToString(), - m_scriptInitBlock.ToString(), false); - } + } diff --git a/src/umbraco.editorControls/tinymce/tinyMCEPreValueConfigurator.cs b/src/umbraco.editorControls/tinymce/tinyMCEPreValueConfigurator.cs index de2afaa555..10741b9c35 100644 --- a/src/umbraco.editorControls/tinymce/tinyMCEPreValueConfigurator.cs +++ b/src/umbraco.editorControls/tinymce/tinyMCEPreValueConfigurator.cs @@ -237,7 +237,7 @@ namespace umbraco.editorControls.tinymce data += "|"; - // full width currenctly not useLiveEditing + data += "0|"; /* if (_fullWidth.Checked) diff --git a/src/umbraco.interfaces/ILiveEditingDataEditor.cs b/src/umbraco.interfaces/ILiveEditingDataEditor.cs deleted file mode 100644 index 4a8a2b9eb6..0000000000 --- a/src/umbraco.interfaces/ILiveEditingDataEditor.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Web.UI; - -namespace umbraco.interfaces -{ - /// - /// Data type editor controls can choose to implement this interface - /// to customize their Live Editing behavior. - /// - [Obsolete("ILiveEditingDataEditor is obsolete and is no longer used, it will be removed from the codebase in future versions")] - public interface ILiveEditingDataEditor - { - /// - /// Gets the control used for Live Editing. - /// - Control LiveEditingControl { get; } - } -} diff --git a/src/umbraco.interfaces/umbraco.interfaces.csproj b/src/umbraco.interfaces/umbraco.interfaces.csproj index 0f617173bd..167abaf79d 100644 --- a/src/umbraco.interfaces/umbraco.interfaces.csproj +++ b/src/umbraco.interfaces/umbraco.interfaces.csproj @@ -150,7 +150,6 @@ Code - Code