init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
54
KretaWeb/Helpers/HtmlEditorExtensions.cs
Normal file
54
KretaWeb/Helpers/HtmlEditorExtensions.cs
Normal file
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
using System.Linq.Expressions;
|
||||
using System.Web.Mvc;
|
||||
using Kendo.Mvc.UI;
|
||||
using Kendo.Mvc.UI.Fluent;
|
||||
|
||||
namespace Kreta.Web.Helpers
|
||||
{
|
||||
public static class HtmlEditorExtensions
|
||||
{
|
||||
public static EditorBuilder KretaHtmlEditorFor<T>(this HtmlHelper<T> helper, Expression<Func<T, string>> expr, bool encode = true)
|
||||
{
|
||||
var editor = helper.Kendo().EditorFor(expr)
|
||||
.HtmlAttributes(new { @class = "htmlEditor", UseEmbeddedScripts = "false" })
|
||||
.Encode(encode)
|
||||
.PasteCleanup(p => p
|
||||
.All(false)
|
||||
.Css(true)
|
||||
.KeepNewLines(false)
|
||||
.MsAllFormatting(true)
|
||||
.MsConvertLists(true)
|
||||
.MsTags(true)
|
||||
.None(false)
|
||||
.Span(true)
|
||||
)
|
||||
.Tools(tools => tools
|
||||
.Clear()
|
||||
.Bold()
|
||||
.Italic()
|
||||
.Underline()
|
||||
.Strikethrough()
|
||||
.Separator()
|
||||
.FontName()
|
||||
.FontSize()
|
||||
.FontColor()
|
||||
.BackColor()
|
||||
.Separator()
|
||||
.JustifyLeft()
|
||||
.JustifyCenter()
|
||||
.JustifyRight()
|
||||
.JustifyFull()
|
||||
.Separator()
|
||||
.InsertUnorderedList()
|
||||
.InsertOrderedList()
|
||||
.Separator()
|
||||
.Indent()
|
||||
.Outdent()
|
||||
.Separator()
|
||||
);
|
||||
|
||||
return editor;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue