Fix: Restore FroalaEditor extendability (#4356)

Credit to @mjauvin.
This commit is contained in:
Marc Jauvin 2019-06-03 07:15:47 -04:00 committed by Denis Denisov
parent 15e3bd131a
commit 30f4d4c5af
2 changed files with 3 additions and 7 deletions

View File

@ -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:'<i class="icon-[NAME]"></i>',text:'<span style="text-align: center;">[NAME]</span>',image:'<img src=[SRC] alt=[ALT] />'}
this.$textarea.on('froalaEditor.initialized',this.proxy(this.build))
this.$textarea.on('froalaEditor.contentChanged',this.proxy(this.onChange))

View File

@ -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: '<i class="icon-[NAME]"></i>',