diff --git a/src/Umbraco.Web.UI.Client/package.json b/src/Umbraco.Web.UI.Client/package.json index 4ca32e5f41..89dcd3a0db 100644 --- a/src/Umbraco.Web.UI.Client/package.json +++ b/src/Umbraco.Web.UI.Client/package.json @@ -6,7 +6,7 @@ "license": "MIT", "repository": { "type": "git", - "url": "git@github.com:umbraco/umbraco-cms.git" + "url": "https://github.com/umbraco/Umbraco-CMS.git" }, "bugs": { "url": "https://issues.umbraco.org" diff --git a/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap2.cshtml b/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap2.cshtml index c8f9ab7cd1..8b189ae1a0 100644 --- a/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap2.cshtml +++ b/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap2.cshtml @@ -2,10 +2,6 @@ @using Umbraco.Web.Templates @using Newtonsoft.Json.Linq -@* - Razor helpers located at the bottom of this file -*@ - @if (Model != null && Model.sections != null) { var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1; @@ -64,29 +60,21 @@ JObject cfg = contentItem.config; if(cfg != null) - foreach (JProperty property in cfg.Properties()) - { - var propertyValue = HttpUtility.HtmlAttributeEncode(property.Value.ToString()); - attrs.Add(property.Name + "=\"" + propertyValue + "\""); + foreach (JProperty property in cfg.Properties()) { + attrs.Add(property.Name + "='" + property.Value.ToString() + "'"); } - + JObject style = contentItem.styles; - if (style != null) { - var cssVals = new List(); - foreach (JProperty property in style.Properties()) - { - var propertyValue = property.Value.ToString(); - if (string.IsNullOrWhiteSpace(propertyValue) == false) - { - cssVals.Add(property.Name + ":" + propertyValue + ";"); - } - } + if (style != null) { + var cssVals = new List(); + foreach (JProperty property in style.Properties()) + cssVals.Add(property.Name + ":" + property.Value.ToString() + ";"); - if (cssVals.Any()) - attrs.Add("style=\"" + HttpUtility.HtmlAttributeEncode(string.Join(" ", cssVals)) + "\""); + if (cssVals.Any()) + attrs.Add("style='" + string.Join(" ", cssVals) + "'"); } - + return new MvcHtmlString(string.Join(" ", attrs)); } } \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3.cshtml b/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3.cshtml index 6ab5c1355a..e672aa2a11 100644 --- a/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3.cshtml +++ b/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3.cshtml @@ -2,10 +2,6 @@ @using Umbraco.Web.Templates @using Newtonsoft.Json.Linq -@* - Razor helpers located at the bottom of this file -*@ - @if (Model != null && Model.sections != null) { var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1; @@ -64,29 +60,21 @@ JObject cfg = contentItem.config; if(cfg != null) - foreach (JProperty property in cfg.Properties()) - { - var propertyValue = HttpUtility.HtmlAttributeEncode(property.Value.ToString()); - attrs.Add(property.Name + "=\"" + propertyValue + "\""); + foreach (JProperty property in cfg.Properties()) { + attrs.Add(property.Name + "='" + property.Value.ToString() + "'"); } - + JObject style = contentItem.styles; - if (style != null) { - var cssVals = new List(); - foreach (JProperty property in style.Properties()) - { - var propertyValue = property.Value.ToString(); - if (string.IsNullOrWhiteSpace(propertyValue) == false) - { - cssVals.Add(property.Name + ":" + propertyValue + ";"); - } - } + if (style != null) { + var cssVals = new List(); + foreach (JProperty property in style.Properties()) + cssVals.Add(property.Name + ":" + property.Value.ToString() + ";"); - if (cssVals.Any()) - attrs.Add("style=\"" + HttpUtility.HtmlAttributeEncode(string.Join(" ", cssVals)) + "\""); + if (cssVals.Any()) + attrs.Add("style='" + string.Join(" ", cssVals) + "'"); } - + return new MvcHtmlString(string.Join(" ", attrs)); } } \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Base.cshtml b/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Base.cshtml index ffb7603048..a86c04819a 100644 --- a/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Base.cshtml +++ b/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Base.cshtml @@ -1,4 +1,5 @@ @model dynamic +@using Umbraco.Web.Templates @functions { public static string EditorView(dynamic contentItem) diff --git a/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Embed.cshtml b/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Embed.cshtml index c27be6bcdf..393157bcf8 100644 --- a/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Embed.cshtml +++ b/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Embed.cshtml @@ -1,2 +1,7 @@ @model dynamic -@Html.Raw(Model.value) +@using Umbraco.Web.Templates + + +
+ @Html.Raw(Model.value) +
diff --git a/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Macro.cshtml b/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Macro.cshtml index ed08bb2484..e0822808d8 100644 --- a/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Macro.cshtml +++ b/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Macro.cshtml @@ -1,4 +1,6 @@ @inherits UmbracoViewPage +@using Umbraco.Web.Templates + @if (Model.value != null) { diff --git a/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Media.cshtml b/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Media.cshtml index 5b5adbdc7d..09d04219f2 100644 --- a/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Media.cshtml +++ b/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Media.cshtml @@ -1,4 +1,5 @@ @model dynamic +@using Umbraco.Web.Templates @if (Model.value != null) { @@ -13,7 +14,7 @@ } } - @Model.value.altText + @Model.value.caption if (Model.value.caption != null) { diff --git a/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/TextString.cshtml b/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/TextString.cshtml index 8c92ca0d83..0cac4eb1ff 100644 --- a/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/TextString.cshtml +++ b/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/TextString.cshtml @@ -4,9 +4,8 @@ @if (Model.editor.config.markup != null) { string markup = Model.editor.config.markup.ToString(); - var umbracoHelper = new UmbracoHelper(UmbracoContext.Current); - - markup = markup.Replace("#value#", umbracoHelper.ReplaceLineBreaksForHtml(HttpUtility.HtmlEncode(Model.value.ToString()))); + + markup = markup.Replace("#value#", Model.value.ToString()); markup = markup.Replace("#style#", Model.editor.config.style.ToString()); diff --git a/src/Umbraco.Web.UI/config/grid.editors.config.js b/src/Umbraco.Web.UI/config/grid.editors.config.js index b904920566..1adb6da2dc 100644 --- a/src/Umbraco.Web.UI/config/grid.editors.config.js +++ b/src/Umbraco.Web.UI/config/grid.editors.config.js @@ -1,4 +1,4 @@ -[ +[ { "name": "Rich text editor", "alias": "rte", @@ -11,6 +11,40 @@ "view": "media", "icon": "icon-picture" }, + { + "name": "Image wide", + "alias": "media_wide", + "view": "media", + "render": "/App_Plugins/Grid/Editors/Render/media_wide.cshtml", + "icon": "icon-picture" + }, + { + "name": "Image wide cropped", + "alias": "media_wide_cropped", + "view": "media", + "render": "media", + "icon": "icon-picture", + "config": { + "size": { + "width": 1920, + "height": 700 + } + } + }, + { + "name": "Image rounded", + "alias": "media_round", + "view": "media", + "render": "/App_Plugins/Grid/Editors/Render/media_round.cshtml", + "icon": "icon-picture" + }, + { + "name": "Image w/ text right", + "alias": "media_text_right", + "view": "/App_Plugins/Grid/Editors/Views/media_with_description.html", + "render": "/App_Plugins/Grid/Editors/Render/media_text_right.cshtml", + "icon": "icon-picture" + }, { "name": "Macro", "alias": "macro", @@ -21,8 +55,29 @@ "name": "Embed", "alias": "embed", "view": "embed", + "render": "/App_Plugins/Grid/Editors/Render/embed_videowrapper.cshtml", "icon": "icon-movie-alt" }, + { + "name": "Banner Headline", + "alias": "banner_headline", + "view": "textstring", + "icon": "icon-coin", + "config": { + "style": "font-size: 36px; line-height: 45px; font-weight: bold; text-align:center", + "markup": "

#value#

" + } + }, + { + "name": "Banner Tagline", + "alias": "banner_tagline", + "view": "textstring", + "icon": "icon-coin", + "config": { + "style": "font-size: 25px; line-height: 35px; font-weight: normal; text-align:center", + "markup": "

#value#

" + } + }, { "name": "Headline", "alias": "headline", @@ -32,6 +87,36 @@ "style": "font-size: 36px; line-height: 45px; font-weight: bold", "markup": "

#value#

" } + }, + { + "name": "Headline centered", + "alias": "headline_centered", + "view": "textstring", + "icon": "icon-coin", + "config": { + "style": "font-size: 30px; line-height: 45px; font-weight: bold; text-align:center;", + "markup": "

#value#

" + } + }, + { + "name": "Abstract", + "alias": "abstract", + "view": "textstring", + "icon": "icon-coin", + "config": { + "style": "font-size: 16px; line-height: 20px; font-weight: bold;", + "markup": "

#value#

" + } + }, + { + "name": "Paragraph", + "alias": "paragraph", + "view": "textstring", + "icon": "icon-font", + "config": { + "style": "font-size: 16px; line-height: 20px; font-weight: light;", + "markup": "

#value#

" + } }, { "name": "Quote", @@ -39,8 +124,28 @@ "view": "textstring", "icon": "icon-quote", "config": { - "style": "border-left: 3px solid #ccc; padding: 10px; color: #ccc; font-family: serif; font-style: italic; font-size: 18px", + "style": "border-left: 3px solid #ccc; padding: 10px; color: #ccc; font-family: serif; font-variant: italic; font-size: 18px", "markup": "
#value#
" } + }, + { + "name": "Quote with description", + "alias": "quote_D", + "view": "/App_Plugins/Grid/Editors/Views/quote_with_description.html", + "render": "/App_Plugins/Grid/Editors/Render/quote_with_description.cshtml", + "icon": "icon-quote", + "config": { + "style": "border-left: 3px solid #ccc; padding: 10px; color: #ccc; font-family: serif; font-variant: italic; font-size: 18px" + } + }, + { + "name": "Code", + "alias": "code", + "view": "textstring", + "icon": "icon-code", + "config": { + "style": "overflow: auto;padding: 6px 10px;border: 1px solid #ddd;border-radius: 3px;background-color: #f8f8f8;font-size: .9rem;font-family: 'Courier 10 Pitch', Courier, monospace;line-height: 19px;", + "markup": "
#value#
" + } } ] \ No newline at end of file