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(this HtmlHelper helper, Expression> 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; } } }