(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof module==='object'&&module.exports){module.exports=function(root,jQuery){if(jQuery===undefined){if(typeof window!=='undefined'){jQuery=require('jquery');} else{jQuery=require('jquery')(root);}} return factory(jQuery);};}else{factory(window.jQuery);}}(function($){var FE=function(element,options){this.id=++$.FE.ID;var presets={} if(options&&options.documentReady){presets.toolbarButtons=['fullscreen','undo','redo','getPDF','print','|','bold','italic','underline','color','clearFormatting','|','alignLeft','alignCenter','alignRight','alignJustify','|','formatOL','formatUL','indent','outdent','-','paragraphFormat','|','fontFamily','|','fontSize','|','insertLink','insertImage','quote'] presets.paragraphFormatSelection=true presets.fontFamilySelection=true presets.fontSizeSelection=true presets.placeholderText='' presets.quickInsertEnabled=false presets.charCounterCount=false} this.opts=$.extend(true,{},$.extend({},FE.DEFAULTS,presets,typeof options=='object'&&options));var opts_string=JSON.stringify(this.opts);$.FE.OPTS_MAPPING[opts_string]=$.FE.OPTS_MAPPING[opts_string]||this.id;this.sid=$.FE.OPTS_MAPPING[opts_string];$.FE.SHARED[this.sid]=$.FE.SHARED[this.sid]||{};this.shared=$.FE.SHARED[this.sid];this.shared.count=(this.shared.count||0)+1;this.$oel=$(element);this.$oel.data('froala.editor',this);this.o_doc=element.ownerDocument;this.o_win='defaultView'in this.o_doc?this.o_doc.defaultView:this.o_doc.parentWindow;var c_scroll=$(this.o_win).scrollTop();this.$oel.on('froala.doInit',$.proxy(function(){this.$oel.off('froala.doInit');this.doc=this.$el.get(0).ownerDocument;this.win='defaultView'in this.doc?this.doc.defaultView:this.doc.parentWindow;this.$doc=$(this.doc);this.$win=$(this.win);if(!this.opts.pluginsEnabled)this.opts.pluginsEnabled=Object.keys($.FE.PLUGINS);if(this.opts.initOnClick){this.load($.FE.MODULES);this.$el.on('touchstart.init',function(){$(this).data('touched',true);});this.$el.on('touchmove.init',function(){$(this).removeData('touched');}) this.$el.on('mousedown.init touchend.init dragenter.init focus.init',$.proxy(function(e){if(e.type=='touchend'&&!this.$el.data('touched')){return true;} if(e.which===1||!e.which){this.$el.off('mousedown.init touchstart.init touchmove.init touchend.init dragenter.init focus.init');this.load($.FE.MODULES);this.load($.FE.PLUGINS);var target=e.originalEvent&&e.originalEvent.originalTarget;if(target&&target.tagName=='IMG')$(target).trigger('mousedown');if(typeof this.ul=='undefined')this.destroy();if(e.type=='touchend'&&this.image&&e.originalEvent&&e.originalEvent.target&&$(e.originalEvent.target).is('img')){setTimeout($.proxy(function(){this.image.edit($(e.originalEvent.target));},this),100);} this.ready=true;this.events.trigger('initialized');}},this));this.events.trigger('initializationDelayed');} else{this.load($.FE.MODULES);this.load($.FE.PLUGINS);$(this.o_win).scrollTop(c_scroll);if(typeof this.ul=='undefined')this.destroy();this.ready=true;this.events.trigger('initialized');}},this));this._init();};FE.DEFAULTS={initOnClick:false,pluginsEnabled:null};FE.MODULES={};FE.PLUGINS={};FE.VERSION='2.9.3';FE.INSTANCES=[];FE.OPTS_MAPPING={};FE.SHARED={};FE.ID=0;FE.prototype._init=function(){var tag_name=this.$oel.prop('tagName');if(this.$oel.closest('label').length>=1){console.warn('Note! It is not recommended to initialize the Froala Editor within a label tag.');} var initOnDefault=$.proxy(function(){if(tag_name!='TEXTAREA'){this._original_html=(this._original_html||this.$oel.html());} this.$box=this.$box||this.$oel;if(this.opts.fullPage)this.opts.iframe=true;if(!this.opts.iframe){this.$el=$('
');this.el=this.$el.get(0);this.$wp=$('').append(this.$el);this.$box.html(this.$wp);this.$oel.trigger('froala.doInit');} else{this.$iframe=$('