diff --git a/umbraco/presentation/umbraco/LiveEditing/Css/LiveEditing.css b/umbraco/presentation/umbraco/LiveEditing/Css/LiveEditing.css index efbbafab32..c15626435f 100644 --- a/umbraco/presentation/umbraco/LiveEditing/Css/LiveEditing.css +++ b/umbraco/presentation/umbraco/LiveEditing/Css/LiveEditing.css @@ -225,4 +225,83 @@ html { .umbModalBox p select { margin-bottom:10px ! important; -} \ No newline at end of file +} + +.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;} + diff --git a/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx b/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx index 094b269b32..488b266323 100644 --- a/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx +++ b/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx @@ -10,20 +10,16 @@ @@ -31,6 +27,7 @@ + @@ -88,9 +85,6 @@ { $("#cropper").css('width', <%= Request["w"] %> / 2); $("#cropper").css('height', <%= Request["h"] %> / 2); - - $("#workingscale").show(); - } @@ -142,57 +136,57 @@ - + + - - -

Upload image

+ - -
+ + + + + + +

+ or Cancel +

+
- -
+ - -
- - - -

Crop image

-
- - + + +
+
- Reset  - upload other image - -
- Scale image: -
-
-
- -
- - - - -
+ +
+
+
+
- + + + + + + +

+ or Cancel +

+ + diff --git a/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.cs b/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.cs index 92ff6e64b1..7d64e22141 100644 --- a/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.cs +++ b/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.cs @@ -16,6 +16,8 @@ namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule //max width and height is used to make sure the cropper doesn't grow bigger then the modal window public int MaxWidth = 700; public int MaxHeight = 480; + public string scaleWidth = "500px"; + protected void Page_Load(object sender, EventArgs e) { @@ -26,7 +28,6 @@ namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule { if (FileUpload1.HasFile) { - lit_notvalid.Visible = false; Guid g = Guid.NewGuid(); DirectoryInfo updir = new DirectoryInfo(IO.IOHelper.MapPath("~/media/upload/" + g)); @@ -46,15 +47,20 @@ namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule if (!string.IsNullOrEmpty(Request["w"]) && !string.IsNullOrEmpty(Request["h"])) { - if (Convert.ToInt32(Request["w"]) > MaxWidth || Convert.ToInt32(Request["h"]) > MaxHeight) { System.Drawing.Image img = System.Drawing.Image.FromFile(IO.IOHelper.MapPath(Image.Value)); Image1.Width = img.Width / 2; Image1.Height = img.Height / 2; + + fb_feedback1.Text = "Notice: The below exemple is scaled down 50% as the image is quite large, do not worry, it will be the right size on your website"; } + if (Image1.Width.Value > 250) + scaleWidth = (Image1.Width.Value).ToString() + "px"; + + pnl_crop.Visible = true; pnl_upload.Visible = false; } @@ -64,7 +70,10 @@ namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule } } else - lit_notvalid.Visible = true; + { + fb_feedback1.Text = "Please choose a valid image file"; + fb_feedback1.type = uicontrols.Feedback.feedbacktype.error; + } } } diff --git a/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.designer.cs b/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.designer.cs index 71a3d99404..f610524593 100644 --- a/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.designer.cs +++ b/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.designer.cs @@ -30,6 +30,15 @@ namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule { /// protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; + /// + /// CssInclude2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::ClientDependency.Core.Controls.CssInclude CssInclude2; + /// /// JsInclude1 control. /// @@ -111,6 +120,15 @@ namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule { /// protected global::System.Web.UI.WebControls.HiddenField Scale; + /// + /// fb_feedback1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.uicontrols.Feedback fb_feedback1; + /// /// pnl_upload control. /// @@ -118,7 +136,7 @@ namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule { /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Panel pnl_upload; + protected global::System.Web.UI.WebControls.PlaceHolder pnl_upload; /// /// FileUpload1 control. @@ -138,15 +156,6 @@ namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule { /// protected global::System.Web.UI.WebControls.Button bt_upload; - /// - /// lit_notvalid control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal lit_notvalid; - /// /// pnl_crop control. /// @@ -154,7 +163,7 @@ namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule { /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Panel pnl_crop; + protected global::System.Web.UI.WebControls.PlaceHolder pnl_crop; /// /// Image1 control. @@ -165,15 +174,6 @@ namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule { /// protected global::System.Web.UI.WebControls.Image Image1; - /// - /// bt_uploadother control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.LinkButton bt_uploadother; - /// /// bt_crop control. /// diff --git a/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx b/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx index 4b2d56cc6b..16d701b768 100644 --- a/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx +++ b/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx @@ -1,15 +1,13 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SkinCustomizer.ascx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.SkinCustomizer" %> +<%@ 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" %> @@ -20,38 +18,41 @@
>
- +
-

... or change skin

+

+ + or Cancel +

- - + +

You could also change to another skin change skin

+ +
> +

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

+
    - -
  • - - <%# ((Skin)Container.DataItem).Text %> - - <%# ((Skin)Container.DataItem).Text %> - -
    - - - -
  • -
    - + +
  • + <%# ((Skin)Container.DataItem).Text %> + <%# ((Skin)Container.DataItem).Text %> +
    + +
  • +
@@ -61,12 +62,8 @@

- - - - ... or customize current skin

- - + +

diff --git a/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx.cs b/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx.cs index 48069c5165..980ed0f9d2 100644 --- a/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx.cs +++ b/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Web; @@ -11,24 +11,97 @@ using umbraco.interfaces.skinning; using umbraco.IO; using umbraco.cms.businesslogic.template; using umbraco.BusinessLogic; +using umbraco.presentation.nodeFactory; +using umbraco.cms.businesslogic.packager; -namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule +namespace umbraco.presentation.LiveEditing.Modules.SkinModule { - public partial class SkinCustomizer : System.Web.UI.UserControl + public partial class SkinCustomizer : UserControl { - private Skin ActiveSkin { get; set; } + // Fields + + + private cms.businesslogic.packager.repositories.Repository repo; + private cms.businesslogic.skinning.Skin ActiveSkin; + + private string repoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; private List sDependencies = new List(); - private cms.businesslogic.packager.repositories.Repository repo; - private string repoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; - + // Methods public SkinCustomizer() { - repo = cms.businesslogic.packager.repositories.Repository.getByGuid(repoGuid); + this.repo = cms.businesslogic.packager.repositories.Repository.getByGuid(this.repoGuid); } + protected void btnOk_Click(object sender, EventArgs e) + { + this.ActiveSkin.SaveOutput(); + foreach (Dependency dependency in this.sDependencies) + { + if (dependency.DependencyType.Values.Count > 0) + { + string output = dependency.DependencyType.Values[0].ToString(); + foreach (Task task in dependency.Tasks) + { + TaskExecutionDetails details = task.TaskType.Execute(this.ParsePlaceHolders(task.Value, output)); + if (details.TaskExecutionStatus == TaskExecutionStatus.Completed) + { + this.ActiveSkin.AddTaskHistoryNode(task.TaskType.ToXml(details.OriginalValue, details.NewValue)); + } + } + } + } + } + + protected void LoadDependencies() + { + this.ph_dependencies.Controls.Clear(); + StringBuilder builder = new StringBuilder(); + builder.Append("\r\n var hasSetTasksClientScriptsRun = false; \r\n function setTasksClientScripts(){ \r\n if(hasSetTasksClientScriptsRun == false){"); + + foreach (Dependency dependency in this.ActiveSkin.Dependencies) + { + if (dependency.DependencyType != null) + { + this.sDependencies.Add(dependency); + Control editor = dependency.DependencyType.Editor; + this.ph_dependencies.addProperty(dependency.Label, editor); + foreach (Task task in dependency.Tasks) + { + builder.Append(task.TaskType.PreviewClientScript(editor.ClientID, dependency.DependencyType.ClientSidePreviewEventType(), dependency.DependencyType.ClientSideGetValueScript())); + } + } + } + builder.Append("hasSetTasksClientScriptsRun = true; }}"); + ScriptManager.RegisterClientScriptBlock(this, base.GetType(), "TasksClientScripts", builder.ToString(), true); + } + + protected void LoadSkins() + { + Guid? nullable = Skinning.StarterKitGuid(Node.GetCurrent().template); + if (!(nullable.HasValue && Skinning.HasAvailableSkins(Node.GetCurrent().template))) + { + this.pChangeSkin.Visible = false; + } + else if (this.repo.HasConnection()) + { + try + { + this.rep_starterKitDesigns.DataSource = this.repo.Webservice.Skins(nullable.ToString()); + this.rep_starterKitDesigns.DataBind(); + } + catch (Exception exception) + { + Log.Add(LogTypes.Debug, -1, exception.ToString()); + } + } + else + { + this.ShowConnectionError(); + } + } protected void Page_Load(object sender, EventArgs e) { @@ -55,42 +128,14 @@ namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule ltCustomizeSkinStyle.Text = ltChangeSkinStyle.Text; ltChangeSkinStyle.Text = string.Empty; } - - LoadSkins(); + + LoadSkins(); } - protected void LoadSkins() + private string ParsePlaceHolders(string value, string output) { - Guid? g = Skinning.StarterKitGuid(nodeFactory.Node.GetCurrent().template); - - - if (g == null || !Skinning.HasAvailableSkins(nodeFactory.Node.GetCurrent().template)) - { - pChangeSkin.Visible = false; - } - else - { - if (repo.HasConnection()) - { - try - { - rep_starterKitDesigns.DataSource = repo.Webservice.Skins(g.ToString()); - rep_starterKitDesigns.DataBind(); - } - catch (Exception ex) - { - BusinessLogic.Log.Add(BusinessLogic.LogTypes.Debug, -1, ex.ToString()); - - //ShowConnectionError(); - } - } - else - { - ShowConnectionError(); - } - } - - + value = value.Replace("${Output}", output); + return value; } protected void rep_starterKitDesigns_ItemDataBound(object sender, RepeaterItemEventArgs e) @@ -118,168 +163,47 @@ namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule } } - - protected void LoadDependencies() - { - ph_dependencies.Controls.Clear(); - - StringBuilder s = new StringBuilder(); - - s.Append(@" - var hasSetTasksClientScriptsRun = false; - function setTasksClientScripts(){ - if(hasSetTasksClientScriptsRun == false){"); - - - foreach (Dependency d in ActiveSkin.Dependencies) - { - if (d.DependencyType != null) - { - sDependencies.Add(d); - - ph_dependencies.Controls.Add(new LiteralControl("

")); - - Label lbl = new Label(); - - lbl.Text = d.Label; - - Control ctrl = d.DependencyType.Editor; - - //lbl.AssociatedControlID = ctrl.ID; - - ph_dependencies.Controls.Add(lbl); - - ph_dependencies.Controls.Add(new LiteralControl("
")); - - ph_dependencies.Controls.Add(ctrl); - - ph_dependencies.Controls.Add(new LiteralControl("

")); - - - - foreach (Task t in d.Tasks) - { - - s.Append(t.TaskType.PreviewClientScript( - ctrl.ClientID, - d.DependencyType.ClientSidePreviewEventType(), - d.DependencyType.ClientSideGetValueScript())); - - //ScriptManager.RegisterClientScriptBlock( - // this, - // this.GetType(), - // d.Label + "_" + t.TaskType.Name, - // t.TaskType.PreviewClientScript(ctrl.ClientID,d.Properties), - // true); - - } - - - } - - - } - - s.Append("hasSetTasksClientScriptsRun = true; }}"); - - ScriptManager.RegisterClientScriptBlock( - this, - this.GetType(), - "TasksClientScripts", - s.ToString(), - true); - - } - - protected void btnOk_Click(object sender, EventArgs e) - { - ActiveSkin.SaveOutput(); - - foreach (Dependency d in sDependencies) - { - if (d.DependencyType.Values.Count > 0) - { - string output = d.DependencyType.Values[0].ToString(); - - foreach (Task t in d.Tasks) - { - TaskExecutionDetails details = t.TaskType.Execute(ParsePlaceHolders(t.Value, output)); - - if (details.TaskExecutionStatus == TaskExecutionStatus.Completed) - { - ActiveSkin.AddTaskHistoryNode( - t.TaskType.ToXml(details.OriginalValue,details.NewValue)); - } - } - } - } - - - } - - private string ParsePlaceHolders(string value,string output) - { - //parse ${Output} - value = value.Replace("${Output}", output); - - return value; - } protected void SelectStarterKitDesign(object sender, EventArgs e) { if (((Button)sender).CommandName == "apply") { - Skin s = Skin.CreateFromName(((Button)sender).CommandArgument); - Skinning.ActivateAsCurrentSkin(s); - - Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString())) + "?umbSkinning=true&umbSkinningConfigurator=true"); + Skinning.ActivateAsCurrentSkin(Skin.CreateFromName(((Button)sender).CommandArgument)); + this.Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); } else if (((Button)sender).CommandName == "remove") { - nodeFactory.Node n = nodeFactory.Node.GetCurrent(); - - Template t = new Template(n.template); - Skinning.RollbackSkin(t.Id); - - Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString())) + "?umbSkinning=true"); + Template template = new Template(Node.GetCurrent().template); + Skinning.RollbackSkin(template.Id); + this.Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); } else { - Guid kitGuid = new Guid(((Button)sender).CommandArgument); - - cms.businesslogic.packager.Installer installer = new cms.businesslogic.packager.Installer(); - - if (repo.HasConnection()) + Guid guid = new Guid(((Button)sender).CommandArgument); + Installer installer = new Installer(); + if (this.repo.HasConnection()) { - cms.businesslogic.packager.Installer p = new cms.businesslogic.packager.Installer(); - - string tempFile = p.Import(repo.fetch(kitGuid.ToString())); - p.LoadConfig(tempFile); - int pID = p.CreateManifest(tempFile, kitGuid.ToString(), repoGuid); - - p.InstallFiles(pID, tempFile); - p.InstallBusinessLogic(pID, tempFile); - p.InstallCleanUp(pID, tempFile); - + Installer installer2 = new Installer(); + string tempDir = installer2.Import(this.repo.fetch(guid.ToString())); + installer2.LoadConfig(tempDir); + int packageId = installer2.CreateManifest(tempDir, guid.ToString(), this.repoGuid); + installer2.InstallFiles(packageId, tempDir); + installer2.InstallBusinessLogic(packageId, tempDir); + installer2.InstallCleanUp(packageId, tempDir); library.RefreshContent(); - - Skin s = Skin.CreateFromName(((Button)sender).CommandName); - Skinning.ActivateAsCurrentSkin(s); - - Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); + Skinning.ActivateAsCurrentSkin(Skin.CreateFromName(((Button)sender).CommandName)); + this.Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); } else { - ShowConnectionError(); + this.ShowConnectionError(); } } } - private void ShowConnectionError() { - pnl_connectionerror.Visible = true; + this.pnl_connectionerror.Visible = true; } - } -} \ No newline at end of file +} diff --git a/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx.designer.cs b/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx.designer.cs index f01b3827d6..b0e5ee8715 100644 --- a/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx.designer.cs +++ b/umbraco/presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx.designer.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule { +namespace umbraco.presentation.LiveEditing.Modules.SkinModule { public partial class SkinCustomizer { @@ -37,16 +37,7 @@ namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule { /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.PlaceHolder ph_dependencies; - - /// - /// pChangeSkin control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlGenericControl pChangeSkin; + protected global::umbraco.uicontrols.Pane ph_dependencies; /// /// btnOk control. @@ -57,6 +48,15 @@ namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule { /// protected global::System.Web.UI.WebControls.Button btnOk; + /// + /// pChangeSkin control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl pChangeSkin; + /// /// ltChangeSkinStyle control. ///