Sid Gifari File Manager
🏠 Root
/
home2
/
meumer25
/
www
/
wp-content
/
plugins
/
wpforms-lite
/
assets
/
js
/
admin
/
builder
/
modules
/
undo-redo
/
Editing: action-settings-block-add.min.js
export default function(n,e,o){class t extends WPForms.Admin.Builder.UndoRedoActionCommandBase.get(){static id="ActionSettingsBlockAddCommand";constructor(e){super(e),this.actionName=this.getActionName()}execute(){i.UndoRedo.executeTriggerEvents&&this.addBlock(this.args)}undo(){i.UndoRedo.executeTriggerEvents&&this.deleteBlock(this.args)}addBlock(e){var t;e.new.$container?.length&&e.$block?.length&&(i.preventRecordingCommand=!0,t=i.getSettingsSection(e.$settingsSection),this.replaceDOMElementContent(t,e.new.$container),i.reInitBlocks(t),i.el.$builder.trigger(e.event,[e.$block,e.blockId]),i.preventRecordingCommand=!1)}deleteBlock(e){var t;e.new.$container?.length&&e.$block?.length&&(i.preventRecordingCommand=!0,t=i.getSettingsSection(e.$settingsSection),this.replaceDOMElementContent(t,e.old.$container),i.reInitBlocks(t),t=e.$block.data("block-type"),e=e.$block.data("block-id"),i.el.$builder.trigger("wpformsSettingsBlockDeleted",[t,e]),i.preventRecordingCommand=!1)}getActionName(){return this.actionName||[this.args.event?.includes("Clone")?wp.i18n.__("Clone settings block","wpforms"):wp.i18n.__("Add settings block","wpforms"),i.actionNameSeparator,this.args.settingsSectionTitle].filter(Boolean).join(" ")}}let i={el:{},init(){i.setup(),i.el.$builder.on("wpformsBuilderReady",_.debounce(i.ready,250))},setup(){i.el.$document=o(n),i.el.$builder=o("#wpforms-builder")},ready(){try{i.UndoRedo=WPForms.Admin.Builder.UndoRedo,i.UndoRedoHelpers=WPForms.Admin.Builder.UndoRedoHelpers,i.actionNameSeparator=i.UndoRedo.config.actionNameSeparator,i.el={...i.el,...i.UndoRedo.el}}catch(e){return void wpf.debug("UndoRedoActionSettingsBlockAdd: Dependency modules are not available.")}i.UndoRedo.registerCommand(t),i.events()},events(){i.el.$builder.on("wpformsBeforeSettingsBlockClone",i.onBeforeSettingsBlockClone).on("wpformsSettingsBlockCloned",i.onSettingsBlockCloned).on("wpformsBeforeSettingsBlockAdd",i.onBeforeSettingsBlockClone).on("wpformsSettingsBlockAdded",i.onSettingsBlockCloned)},onBeforeSettingsBlockClone(e,t){i.isRecordPrevented()||(i.$trackSettingsSection=i.getSettingsSection(t),i.trackSettingsSectionTitle=i.UndoRedoHelpers.getSectionTitle(i.$trackSettingsSection),i.UndoRedoHelpers.getCurrentContainer(i.$trackSettingsSection))},onSettingsBlockCloned(e,t,n){!i.isRecordPrevented()&&i.$trackSettingsSection?.length&&(n=i.UndoRedo.getCommand("ActionSettingsBlockAddCommand",{$block:t,blockId:n,blockType:t?.data("block-type")??"",connectionId:t?.data("connection_id")??"",provider:i.$trackSettingsSection?.data("provider")??"",event:e.type??"",settingsSectionTitle:i.trackSettingsSectionTitle,$settingsSection:i.$trackSettingsSection,old:{$container:i.UndoRedoHelpers.getTrackedContainer(i.$trackSettingsSection)},new:{$container:i.UndoRedoHelpers.getCurrentContainer(i.$trackSettingsSection)}}),i.UndoRedo.record(n))},getSettingsSection(e){var t=(e=i.UndoRedoHelpers.getElement(e)).data("block-type");return(e=!n.body.contains(e[0])&&t?o(`.wpforms-builder-settings-block[data-block-type="${t}"]`):e).hasClass("wpforms-panel-content-section")?e:e.closest(".wpforms-panel-content-section")},reInitBlocks(e){WPForms.Admin.Builder.SmartTags.reinitWidgets(e),i.UndoRedoHelpers.reInitChoicesJs(e),i.UndoRedoHelpers.reInitTinyMCE(e)},isRecordPrevented(){return i.UndoRedo.isRecordPrevented()||i.preventRecordingCommand}};return i}
Save
Cancel