From 1a658b2f63d21f58d4d1b36330741ae8cf54956e Mon Sep 17 00:00:00 2001 From: Jeffrey Schoemaker Date: Mon, 20 May 2019 14:52:21 +0200 Subject: [PATCH] Make it Grid compatible --- Grid/Trix.cshtml | 6 ++++++ Grid/Trix.html | 6 ++++++ package.manifest | 12 +++++++++++- umbraco-trix.js | 9 +++++---- 4 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 Grid/Trix.cshtml create mode 100644 Grid/Trix.html diff --git a/Grid/Trix.cshtml b/Grid/Trix.cshtml new file mode 100644 index 0000000..0c3b404 --- /dev/null +++ b/Grid/Trix.cshtml @@ -0,0 +1,6 @@ +@inherits Umbraco.Web.Mvc.UmbracoViewPage + +@using Umbraco.Web.Composing +@using Umbraco.Web.Templates + +@Html.Raw(TemplateUtilities.ParseInternalLinks(Model.value.ToString(), Current.UmbracoContext.UrlProvider)) diff --git a/Grid/Trix.html b/Grid/Trix.html new file mode 100644 index 0000000..cace9c0 --- /dev/null +++ b/Grid/Trix.html @@ -0,0 +1,6 @@ +
+ + + + +
diff --git a/package.manifest b/package.manifest index 96a3f6c..d9f30d6 100644 --- a/package.manifest +++ b/package.manifest @@ -22,5 +22,15 @@ '~/App_Plugins/Trix/umbraco-trix.js', '~/App_Plugins/Trix/trix.directive.js' ] - + , + "gridEditors": + [ + { + "name": "Trix", + "alias": "trix", + "view": "/App_Plugins/Trix/Grid/Trix.html", + "render": "/App_Plugins/Trix/Grid/Trix.cshtml", + "icon": "icon-article" + } + ] } \ No newline at end of file diff --git a/umbraco-trix.js b/umbraco-trix.js index 443279e..30dce0a 100644 --- a/umbraco-trix.js +++ b/umbraco-trix.js @@ -1,12 +1,13 @@ app.requires.push('angularTrix'); angular.module("umbraco").controller("Umbraco.Core.TrixController", -function ($scope, assetsService, dialogService) { - +function ($scope, assetsService) { + assetsService .load([ "~/App_Plugins/Trix/trix.js" - ]).then(function() { - }); + ]).then(function () { + Trix.config.blockAttributes.default.tagName = 'p'; + }); // load the separate css for the editor to avoid it blocking our JavaScript loading assetsService.loadCss("~/App_Plugins/Trix/trix.css");