UNPKG

froala-editor

Version:

A beautiful Javascript WYSIWYG HTML rich text editor. High performance and modern design make it easy to use for developers and loved by users.

7 lines (6 loc) 1.48 kB
/*! * froala_editor v2.8.3 (https://www.froala.com/wysiwyg-editor) * License https://froala.com/wysiwyg-editor/terms/ * Copyright 2014-2018 Froala Labs */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):t(e.jQuery)}(this,function(e){"use strict";var a=(e=e&&e.hasOwnProperty("default")?e["default"]:e).FE;Object.assign(a.DEFAULTS,{inlineStyles:{"Big Red":"font-size: 20px; color: red;","Small Blue":"font-size: 14px; color: blue;"}}),a.PLUGINS.inlineStyle=function(i){i.$;return{apply:function(e){if(""!==i.selection.text())for(var t=e.split(";"),n=0;n<t.length;n++){var l=t[n].split(":");t[n].length&&2==l.length&&i.format.applyStyle(l[0].trim(),l[1].trim())}else i.html.insert('<span style="'+e+'">'+a.INVISIBLE_SPACE+a.MARKERS+"</span>")}}},a.RegisterCommand("inlineStyle",{type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.inlineStyles;for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e+='<li role="presentation"><span style="'+t[n]+'" role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="inlineStyle" data-param1="'+t[n]+'" title="'+this.language.translate(n)+'">'+this.language.translate(n)+"</a></span></li>");return e+="</ul>"},title:"Inline Style",callback:function(e,t){this.inlineStyle.apply(t)},plugin:"inlineStyle"}),a.DefineIcon("inlineStyle",{NAME:"paint-brush"})});