/*! * froala_editor v3.0.3 (https://www.froala.com/wysiwyg-editor) * License https://froala.com/wysiwyg-editor/terms/ * Copyright 2014-2019 Froala Labs */ !function(a,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(a.FroalaEditor)}(this,function(a){"use strict";a=a&&a.hasOwnProperty("default")?a["default"]:a,Object.assign(a.DEFAULTS,{paragraphFormat:{N:"Normal",H1:"Heading 1",H2:"Heading 2",H3:"Heading 3",H4:"Heading 4",PRE:"Code"},paragraphFormatSelection:!1,paragraphDefaultSelection:"Paragraph Format"}),a.PLUGINS.paragraphFormat=function(m){var f=m.$;function g(a,t){var e=m.html.defaultTag();if(t&&t.toLowerCase()!=e)if(0");a.prepend(r);for(var n=m.node.contents(a.get(0))[0];n&&["UL","OL"].indexOf(n.tagName)<0;){var o=n.nextSibling;r.append(n),n=o}}else a.html("<"+t+">"+a.html()+"")}return{apply:function c(a){"N"==a&&(a=m.html.defaultTag()),m.selection.save(),m.html.wrap(!0,!0,!m.opts.paragraphFormat.BLOCKQUOTE,!0,!0),m.selection.restore();var t,e,r,n,o,i,l,p,s=m.selection.blocks();m.selection.save(),m.$el.find("pre").attr("skip",!0);for(var d=0;d").html(i.html()))):0<=["TD","TH"].indexOf(s[d].parentNode.tagName)?(r=h,n=a,o=m.html.defaultTag(),n||(n='div class="fr-temp-div"'+(m.node.isEmpty(r.get(0),!0)?' data-empty="true"':"")),n.toLowerCase()==o?(m.node.isEmpty(r.get(0),!0)||r.append("
"),r.replaceWith(r.html())):r.replaceWith(f("<"+n+">").html(r.html()))):(t=h,(e=a)||(e='div class="fr-temp-div"'+(m.node.isEmpty(t.get(0),!0)?' data-empty="true"':"")),t.replaceWith(f("<"+e+" "+m.node.attributes(t.get(0))+">").html(t.html()).removeAttr("data-empty")))}m.$el.find('pre:not([skip="true"]) + pre:not([skip="true"])').each(function(){f(this).prev().append("
"+f(this).html()),f(this).remove()}),m.$el.find("pre").removeAttr("skip"),m.html.unwrap(),m.selection.restore()},refreshOnShow:function i(a,t){var e=m.selection.blocks();if(e.length){var r=e[0],n="N",o=m.html.defaultTag();r.tagName.toLowerCase()!=o&&r!=m.el&&(n=r.tagName),t.find('.fr-command[data-param1="'+n+'"]').addClass("fr-active").attr("aria-selected",!0)}else t.find('.fr-command[data-param1="N"]').addClass("fr-active").attr("aria-selected",!0)},refresh:function o(a){if(m.opts.paragraphFormatSelection){var t=m.selection.blocks();if(t.length){var e=t[0],r="N",n=m.html.defaultTag();e.tagName.toLowerCase()!=n&&e!=m.el&&(r=e.tagName),0<=["LI","TD","TH"].indexOf(r)&&(r="N"),a.find(">span").text(m.language.translate(m.opts.paragraphFormat[r]))}else a.find(">span").text(m.language.translate(m.opts.paragraphFormat.N))}}}},a.RegisterCommand("paragraphFormat",{type:"dropdown",displaySelection:function(a){return a.opts.paragraphFormatSelection},defaultSelection:function(a){return a.language.translate(a.opts.paragraphDefaultSelection)},displaySelectionWidth:80,html:function(){var a='"},title:"Paragraph Format",callback:function(a,t){this.paragraphFormat.apply(t)},refresh:function(a){this.paragraphFormat.refresh(a)},refreshOnShow:function(a,t){this.paragraphFormat.refreshOnShow(a,t)},plugin:"paragraphFormat"}),a.DefineIcon("paragraphFormat",{NAME:"paragraph",SVG_KEY:"paragraphFormat"})});