froala-editor
Version:
The next generation Javascript WYSIWYG HTML rich text editor made by devs for devs. High performance and modern design make it easy to use for developers and loved by users.
7 lines (6 loc) • 1.47 kB
JavaScript
/*!
* froala_editor v5.0.1 (https://www.froala.com/wysiwyg-editor)
* License https://froala.com/wysiwyg-editor/terms/
* Copyright 2014-2026 Froala Labs
*/
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],n):n(("undefined"!=typeof globalThis?globalThis:e||self).FroalaEditor)}(this,function(e){"use strict";Object.assign(e.DEFAULTS,{inlineStyles:{"Big Red":"font-size: 20px; color: red;","Small Blue":"font-size: 14px; color: blue;"}}),e.PLUGINS.inlineStyle=function(i){return{apply:function(e){for(var n=e.split(";"),t=0;t<n.length;t++){var l=n[t].split(":");n[t].length&&2==l.length&&i.format.applyStyle(l[0].trim(),l[1].trim())}}}},e.RegisterCommand("inlineStyle",{type:"dropdown",html:function(){var e,n,t='<ul class="fr-dropdown-list" role="presentation">',l=this.opts.inlineStyles;for(e in l)l.hasOwnProperty(e)&&(n=l[e]+(-1===l[e].indexOf("display:block;")?" display:block;":""),t+='<li role="presentation"><span style="'.concat(n,'" role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="inlineStyle" data-param1="').concat(l[e],'" title="').concat(this.language.translate(e),'">').concat(this.language.translate(e),"</a></span></li>"));return t+="</ul>"},title:"Inline Style",callback:function(e,n){this.inlineStyle.apply(n)},plugin:"inlineStyle"}),e.DefineIcon("inlineStyle",{NAME:"paint-brush",SVG_KEY:"inlineStyle"})});