File Editor
Directories:
.. (Back)
Files:
admin.min.js
campaign-selector.min.js
campaign-selector.min.js.LICENSE.txt
editor.min.js
elementor.min.js
global.min.js
helper.min.js
metabox.min.js
om-format.min.js
om-settings.min.js
plugininstall.min.js
wc-marketing.min.js
Create New File
Create
Edit File: plugininstall.min.js
window.OMAPI_Plugins=window.OMAPI_Plugins||{},function(t,n,e,o,i){"use strict";o.handleSubmission=n=>{if(n.preventDefault(),!o.pluginData.status)throw new Error("Missing Plugin Data");const i=e(".button-install"),a=e(".button-activate"),s=i.html(),l=a.html();i.html(i.data("actiontext")),a.html(a.data("actiontext")),e("#om-plugin-alerts").hide(),e.ajax({type:"POST",beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",o.restNonce)},url:o.restUrl+"omapp/v1/plugins/",data:{id:o.pluginData.id,actionNonce:o.actionNonce},success:function(n){t.location.reload()},error:function(t,n,r){i.html(s),a.html(l);let u="Something went wrong!";if(t.responseJSON&&t.responseJSON.message&&(u+="<br>Error found: "+t.responseJSON.message),t.responseJSON&&t.responseJSON.data)try{u+=`<br>(data: ${JSON.stringify(t.responseJSON.data)})`}catch(t){}const c=o.pluginData.installed?"activate":"install";console.error(`Could not ${c} the ${o.pluginData.name} plugin`,{jqXHR:t,textStatus:n,errorThrown:r}),e("#om-plugin-alerts").show().html(e("<p/>").html(u))}})},o.init=function(){e("body").on("submit",".install-plugin-form",o.handleSubmission)},e(o.init)}(window,document,jQuery,window.OMAPI_Plugins);
Save Changes
Rename File
Rename