7 lines
674 KiB
JavaScript
7 lines
674 KiB
JavaScript
|
|
/*!
|
||
|
|
* froala_editor v4.3.1 (https://www.froala.com/wysiwyg-editor)
|
||
|
|
* License https://froala.com/wysiwyg-editor/terms/
|
||
|
|
* Copyright 2014-2024 Froala Labs
|
||
|
|
*/
|
||
|
|
|
||
|
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(St){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=Array(t);a<t;a++)n[a]=e[a];return n}function He(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=l(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==a["return"]||a["return"]()}finally{if(s)throw i}}}}function ye(e){return function t(e){if(Array.isArray(e))return r(e)}(e)||function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function n(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rt(e){return(Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){if(e){if("string"==typeof e)return r(e,t);var a={}.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?r(e,t):void 0}}if((St=St&&St.hasOwnProperty("default")?St["default"]:St).PLUGINS.align=function(r){var i=r.$;return{apply:function o(e){var t=r.selection.element();if(i(t).parents(".fr-img-caption").length)i(t).css("text-align",e);else{r.selection.save(),r.html.wrap(!0,!0,!0,!0),r.selection.restore();for(var a=r.selection.blocks(),n=0;n<a.length;n++)i(a[n]).css("text-align",e).removeClass("fr-temp-div"),""===i(a[n]).attr("class")&&i(a[n]).removeAttr("class"),""===i(a[n]).attr("style")&&i(a[n]).removeAttr("style");r.selection.save(),r.html.unwrap(),r.selection.restore()}},refresh:function n(e){var t=r.selection.blocks();if(t.length){var a=r.helpers.getAlignment(i(t[0]));e.find("> *").first().replaceWith(r.icon.create("align-".concat(a)))}},refreshOnShow:function s(e,t){var a=r.selection.blocks();if(a.length){var n=r.helpers.getAlignment(i(a[0]));t.find('a.fr-command[data-param1="'.concat(n,'"]')).addClass("fr-active").attr("aria-selected",!0)}},refreshForToolbar:function l(e){var t=r.selection.blocks();if(t.length){var a=r.helpers.getAlignment(i(t[0]));a=a.charAt(0).toUpperCase()+a.slice(1),"align".concat(a)===e.attr("data-cmd")&&e.addClass("fr-active")}}}},St.DefineIcon("align",{NAME:"align-left",SVG_KEY:"alignLeft"}),St.DefineIcon("align-left",{NAME:"align-left",SVG_KEY:"alignLeft"}),St.DefineIcon("align-right",{NAME:"align-right",SVG_KEY:"alignRight"}),St.DefineIcon("align-center",{NAME:"align-center",SVG_KEY:"alignCenter"}),St.DefineIcon("align-justify",{NAME:"align-justify",SVG_KEY:"alignJustify"}),St.RegisterCommand("align",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"Align Center",right:"Align Right",justify:"Align Justify"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=St.COMMANDS.align.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="align"data-param1="\n '.concat(a,'" title="').concat(this.language.translate(t[a]),'">').concat(this.icon.create("align-".concat(a)),'<span class="fr-sr-only">\n ').concat(this.language.translate(t[a]),"</span></a></li>"));return e+="</ul>"},callback:function(e,t){this.align.apply(t)},refresh:function(e){this.align.refresh(e)},refreshOnShow:f
|