summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/wordpress-mobile-pack/admin/js/UI.Modules/Settings/WMP_DISCONNECT.js')
-rw-r--r--plugins/wordpress-mobile-pack/admin/js/UI.Modules/Settings/WMP_DISCONNECT.js68
1 files changed, 32 insertions, 36 deletions
diff --git a/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Settings/WMP_DISCONNECT.js b/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Settings/WMP_DISCONNECT.js
index 6398dbe7..9c54bc9d 100644
--- a/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Settings/WMP_DISCONNECT.js
+++ b/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Settings/WMP_DISCONNECT.js
@@ -15,6 +15,7 @@ function WMP_DISCONNECT(){
this.send_btn;
this.redirectTo;
this.submitUrl;
+
/*****************************************************************************************************/
/* */
/* FUNCTION INIT - called from WMPJSInterface */
@@ -101,48 +102,43 @@ function WMP_DISCONNECT(){
},
dataType: "jsonp",
success: function(responseJSON){
-
+
WMPJSInterface.Preloader.remove(100);
- JSON = eval (responseJSON);
- response = Boolean(Number(String(JSON.status)));
-
- if (response == 0) {
+ var JSON = eval (responseJSON);
+ var 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});
- }
-
- //enable buttons
- JSObject.addButtonsActions();
-
- } else {
-
- jQuery.post(
- ajaxurl,
- {
- 'action': 'wmp_premium_disconnect',
- 'api_key': jQuery("#"+JSObject.type+"_apikey", JSObject.DOMDoc).val(),
- 'active': '0'
- },
- function(response1){
- response1 = Boolean(Number(String(response1)));
-
- if(response1 == 1)
- window.location.href = JSObject.redirectTo;
- else {
- var message = '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: message});
- }
- }
- );
- }
+ }
+ }*/
+
+ // Make the request to reset the API key even if the response from the API was an error
+ // (ex. the Wordpress settings might be already deleted from Appticles)
+ jQuery.post(
+
+ ajaxurl,
+ {
+ 'action': 'wmp_premium_disconnect',
+ 'api_key': jQuery("#"+JSObject.type+"_apikey", JSObject.DOMDoc).val(),
+ 'active': '0'
+ },
+ function(response1){
+
+ response1 = Boolean(Number(String(response1)));
+
+ if(response1 == 1) {
+ window.location.href = JSObject.redirectTo;
+ } else {
+ var message = '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: message});
+ }
+ }
+ );
+
},
error: function(responseJSON){