Sid Gifari File Manager
🏠 Root
/
home2
/
meumer25
/
www
/
wp-content
/
plugins
/
wpforms-lite
/
assets
/
js
/
admin
/
builder
/
modules
/
undo-redo
/
Editing: input-tinymce.min.js
export default function(e,t,d){class o extends WPForms.Admin.Builder.UndoRedoInputCommandBase.get(){static id="TinyMCEChangeCommand";constructor(e,t,o){super(d("#"+e),t,o),this.editorId=e}applyValue(e){var t=r.getEditor(this.editorId),t=(t&&(t.setContent(e),t.save()),d("#"+this.editorId));t.length&&t.val(e).trigger("input").trigger("change")}canMerge(e){return e instanceof this.constructor&&this.editorId===e.editorId}}let r={el:{},sel:{wpEditorArea:"textarea.wp-editor-area"},undoManager:null,trackedEditors:new Map,init(){r.setup(),r.el.$builder.on("wpformsBuilderReady",_.debounce(r.ready,250))},setup(){r.el.$document=d(e),r.el.$builder=d("#wpforms-builder")},ready(){try{r.UndoRedo=WPForms.Admin.Builder.UndoRedo,r.UndoRedoHelpers=WPForms.Admin.Builder.UndoRedoHelpers,r.undoManager=r.UndoRedo.undoManager,r.actionNameSeparator=r.UndoRedo.config.actionNameSeparator,r.el={...r.el,...r.UndoRedo.el}}catch(e){return void wpf.debug("UndoRedoInputTinyMCE: Dependency modules are not available.")}r.UndoRedo.registerCommand(o),r.events()},events(){r.attachToExistingEditors(),r.el.$builder.on("wpformsBuilderReady",r.attachToExistingEditors),r.el.$document.on("focus",r.sel.wpEditorArea,r.onTextareaFocus).on("blur",r.sel.wpEditorArea,r.onTextareaBlur)},attachToExistingEditors(){if("undefined"!=typeof tinymce){for(var e of tinymce.editors){if(e.wpformsUndoRedoAttached)return;r.attachEditorEvents(e)}tinymce.on("AddEditor",function(e){let t=e.editor;t&&t.on("init",function(){r.attachEditorEvents(t)})})}},attachEditorEvents(e){e.wpformsUndoRedoAttached||(e.wpformsUndoRedoAttached=!0,e.on("focus",function(){r.onEditorFocus(e)}),e.on("blur",function(){r.onEditorBlur(e)}))},onEditorFocus(e){var t=e.id;r.trackedEditors.set(t,e.getContent())},onEditorBlur(e){var t,o;r.UndoRedo.isSuppressed()||(t=e.id,o=r.trackedEditors.get(t),e=e.getContent(),r.UndoRedoHelpers.areValuesEqual(o,e)||(o=r.UndoRedo.getCommand("TinyMCEChangeCommand",t,o,e),r.UndoRedo.record(o)),r.trackedEditors.delete(t))},onTextareaFocus(e){var e=d(e.target),t=e.attr("id");r.getEditor(t)||r.trackedEditors.set(t,e.val())},onTextareaBlur(e){var t,o;r.UndoRedo.isSuppressed()||(t=(e=d(e.target)).attr("id"),r.getEditor(t))||(o=r.trackedEditors.get(t),e=e.val(),r.UndoRedoHelpers.areValuesEqual(o,e)||(o=r.UndoRedo.getCommand("TinyMCEChangeCommand",t,o,e),r.UndoRedo.record(o)),r.trackedEditors.delete(t))},getEditor(e){return"undefined"==typeof tinymce?null:tinymce.get(e)}};return r}
Save
Cancel