Updates from dev-v7

This commit is contained in:
Per Ploug
2017-08-07 15:29:34 +02:00
parent ba82885b6d
commit babcbd2f7a
9 changed files with 141 additions and 52 deletions

View File

@@ -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"

View File

@@ -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<string>();
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<string>();
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));
}
}

View File

@@ -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<string>();
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<string>();
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));
}
}

View File

@@ -1,4 +1,5 @@
@model dynamic
@using Umbraco.Web.Templates
@functions {
public static string EditorView(dynamic contentItem)

View File

@@ -1,2 +1,7 @@
@model dynamic
@Html.Raw(Model.value)
@using Umbraco.Web.Templates
<div class="video-wrapper">
@Html.Raw(Model.value)
</div>

View File

@@ -1,4 +1,6 @@
@inherits UmbracoViewPage<dynamic>
@using Umbraco.Web.Templates
@if (Model.value != null)
{

View File

@@ -1,4 +1,5 @@
@model dynamic
@using Umbraco.Web.Templates
@if (Model.value != null)
{
@@ -13,7 +14,7 @@
}
}
<img src="@url" alt="@Model.value.altText">
<img src="@url" alt="@Model.value.caption">
if (Model.value.caption != null)
{

View File

@@ -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());
<text>

View File

@@ -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": "<h1 style='font-size:62px;text-align:center'>#value#</h1>"
}
},
{
"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": "<h2 style='font-weight: 100; font-size: 40px;text-align:center'>#value#</h2>"
}
},
{
"name": "Headline",
"alias": "headline",
@@ -32,6 +87,36 @@
"style": "font-size: 36px; line-height: 45px; font-weight: bold",
"markup": "<h1>#value#</h1>"
}
},
{
"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": "<h1 style='text-align:center;'>#value#</h1>"
}
},
{
"name": "Abstract",
"alias": "abstract",
"view": "textstring",
"icon": "icon-coin",
"config": {
"style": "font-size: 16px; line-height: 20px; font-weight: bold;",
"markup": "<h3>#value#</h3>"
}
},
{
"name": "Paragraph",
"alias": "paragraph",
"view": "textstring",
"icon": "icon-font",
"config": {
"style": "font-size: 16px; line-height: 20px; font-weight: light;",
"markup": "<p>#value#</p>"
}
},
{
"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": "<blockquote>#value#</blockquote>"
}
},
{
"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": "<pre>#value#</pre>"
}
}
]