jodit-pro
Version:
PRO Version of Jodit Editor
4 lines (3 loc) • 1.61 kB
JavaScript
var f=Object.defineProperty;var c=(e,n)=>f(e,"name",{value:n,configurable:!0});import{Config as h}from"jodit/esm/config.js";import{Dom as l}from"jodit/esm/core/dom/index.js";import{call as v}from"jodit/esm/core/helpers/index.js";const i=["tune.up","tune.remove","tune.down"],s=["tune.h1","tune.h2","tune.h3",`
`,"tune.h4","tune.h5","tune.h6",`
`,...i];h.prototype.tuneBlock={popup:{p:i,table:i,img:i,blockquote:i,div:i,pre:["tune.editPre",...i],h1:s,h2:s,h3:s,h4:s,h5:s,h6:s}};function u(e){return{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><text dominant-baseline="text-before-edge" style="font: 45px sans-serif" x="0" y="0">'+e.toUpperCase()+"</text></svg>",isActive(n,r){var o;return((o=r?.target)===null||o===void 0?void 0:o.tagName.toLowerCase())===e},exec(n,r){if(r){n.selection.save();const o=l.replace(r,e,n.createInside);n.selection.restore(),n.e.fire("synchro"),n.e.fire("afterExecTune.tune",o)}return!0}}}c(u,"headerControl");function a(e){const n=e?"previousSibling":"nextSibling";return{icon:e?"angle-up":"angle-down",isDisabled(r,o){var t;return!(!((t=o?.target)===null||t===void 0)&&t[n])},exec(r,o){const t=o?.[n];return o&&t&&(r.selection.save(),v(e?l.before:l.after,t,o),r.selection.restore()),r.e.fire("synchro"),r.e.fire("afterExecTune.tune"),!0}}}c(a,"moveTo"),h.prototype.controls.tune={h1:u("h1"),h2:u("h2"),h3:u("h3"),h4:u("h4"),h5:u("h5"),h6:u("h6"),up:a(!0),down:a(!1),editPre:{icon:"pencil",exec(e,n){e.e.fire("editPreInPasteCode",n)}},remove:{icon:"bin",exec(e,n){l.safeRemove(n),e.e.fire("synchro"),e.e.fire("closeTuner.tune"),e.e.fire("hideTuner.tune")}}};