From 30f4d4c5af180efb21a6e53f023b3b01b76fa891 Mon Sep 17 00:00:00 2001 From: Marc Jauvin Date: Mon, 3 Jun 2019 07:15:47 -0400 Subject: [PATCH] Fix: Restore FroalaEditor extendability (#4356) Credit to @mjauvin. --- .../formwidgets/richeditor/assets/js/build-plugins-min.js | 4 +--- .../backend/formwidgets/richeditor/assets/js/richeditor.js | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/backend/formwidgets/richeditor/assets/js/build-plugins-min.js b/modules/backend/formwidgets/richeditor/assets/js/build-plugins-min.js index 631495f61..7e6d7bc74 100644 --- a/modules/backend/formwidgets/richeditor/assets/js/build-plugins-min.js +++ b/modules/backend/formwidgets/richeditor/assets/js/build-plugins-min.js @@ -184,9 +184,7 @@ froalaOptions.imageUploadParams=froalaOptions.fileUploadParams={X_OCTOBER_MEDIA_ var placeholder=this.$textarea.attr('placeholder') froalaOptions.placeholderText=placeholder?placeholder:'' froalaOptions.height=this.$el.hasClass('stretch')?Infinity:$('.height-indicator',this.$el).height() -var enabledPlugins=['align','audio','codeBeautifier','codeView','colors','draggable','emoticons','entities','file','fontFamily','fontSize','fullscreen','image','lineBreaker','link','lists','paragraphFormat','paragraphStyle','quote','table','url','video','pageLinks','figures'] -if(this.options.useMediaManager){enabledPlugins.push('mediaManager')} -froalaOptions.pluginsEnabled=enabledPlugins +if(!this.options.useMediaManager){delete $.FroalaEditor.PLUGINS.mediaManager} $.FroalaEditor.ICON_TEMPLATES={font_awesome:'',text:'[NAME]',image:'[ALT]'} this.$textarea.on('froalaEditor.initialized',this.proxy(this.build)) this.$textarea.on('froalaEditor.contentChanged',this.proxy(this.onChange)) diff --git a/modules/backend/formwidgets/richeditor/assets/js/richeditor.js b/modules/backend/formwidgets/richeditor/assets/js/richeditor.js index 667a75c57..75cd218bf 100755 --- a/modules/backend/formwidgets/richeditor/assets/js/richeditor.js +++ b/modules/backend/formwidgets/richeditor/assets/js/richeditor.js @@ -168,11 +168,9 @@ ? Infinity : $('.height-indicator', this.$el).height() - var enabledPlugins = ['align', 'audio', 'codeBeautifier', 'codeView', 'colors', 'draggable', 'emoticons', 'entities', 'file', 'fontFamily', 'fontSize', 'fullscreen', 'image', 'lineBreaker', 'link', 'lists', 'paragraphFormat', 'paragraphStyle', 'quote', 'table', 'url', 'video', 'pageLinks', 'figures'] - if (this.options.useMediaManager) { - enabledPlugins.push('mediaManager') + if (!this.options.useMediaManager) { + delete $.FroalaEditor.PLUGINS.mediaManager } - froalaOptions.pluginsEnabled = enabledPlugins $.FroalaEditor.ICON_TEMPLATES = { font_awesome: '',