summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/wordpress-mobile-pack/admin/js/UI.Modules/Settings/WMP_DISCONNECT.min.js')
-rw-r--r--plugins/wordpress-mobile-pack/admin/js/UI.Modules/Settings/WMP_DISCONNECT.min.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Settings/WMP_DISCONNECT.min.js b/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Settings/WMP_DISCONNECT.min.js
new file mode 100644
index 00000000..2456f9b9
--- /dev/null
+++ b/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Settings/WMP_DISCONNECT.min.js
@@ -0,0 +1 @@
+function WMP_DISCONNECT(){var JSObject=this;this.type="wmp_disconnect";this.DOMDoc;this.send_btn;this.redirectTo;this.submitUrl;this.init=function(){WMPJSInterface=window.parent.WMPJSInterface;this.send_btn=jQuery("#"+this.type+"_send_btn",this.DOMDoc).get(0);this.addButtonsActions()};this.addButtonsActions=function(){jQuery(this.send_btn).unbind("click");jQuery(this.send_btn).bind("click",function(){JSObject.disableButton(this);JSObject.sendData()});JSObject.enableButton(this.send_btn)};this.enableButton=function(e){jQuery(e).css("cursor","pointer");jQuery(e).animate({opacity:1},100)};this.disableButton=function(e){jQuery(e).unbind("click");jQuery(e).animate({opacity:.4},100);jQuery(e).css("cursor","default")};this.sendData=function(){var isConfirmed=confirm("Are you sure you want to disconnect from Appticles?");if(isConfirmed){WMPJSInterface.Preloader.start();jQuery.ajax({url:JSObject.submitURL,type:"get",data:{apiKey:jQuery("#"+JSObject.type+"_apikey",JSObject.DOMDoc).val()},dataType:"jsonp",success:function(responseJSON){WMPJSInterface.Preloader.remove(100);JSON=eval(responseJSON);response=Boolean(Number(String(JSON.status)));if(response==0){if(JSON.message!=undefined){WMPJSInterface.Loader.display({message:JSON.message})}else{var message="We were unable to disconnect your plugin, please contact support.";WMPJSInterface.Loader.display({message:message})}JSObject.addButtonsActions()}else{jQuery.post(ajaxurl,{action:"wmp_premium_disconnect",api_key:jQuery("#"+JSObject.type+"_apikey",JSObject.DOMDoc).val(),active:"0"},function(e){e=Boolean(Number(String(e)));if(e==1)window.location.href=JSObject.redirectTo;else{var t="There was an error. Please reload the page and try again in few seconds or contact the plugin administrator if the problem persists.";WMPJSInterface.Loader.display({message:t})}})}},error:function(e){WMPJSInterface.Preloader.remove(100);WMPJSInterface.Loader.display({message:"Disconnect endpoint is unreachable. Please contact support."})}})}}} \ No newline at end of file