summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/wordpress-mobile-pack/admin/js/UI.Modules/Settings/WMP_CONNECT.min.js')
-rwxr-xr-xplugins/wordpress-mobile-pack/admin/js/UI.Modules/Settings/WMP_CONNECT.min.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Settings/WMP_CONNECT.min.js b/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Settings/WMP_CONNECT.min.js
index c25869ec..2d030ac9 100755
--- a/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Settings/WMP_CONNECT.min.js
+++ b/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Settings/WMP_CONNECT.min.js
@@ -1 +1 @@
-function WMP_CONNECT(){var JSObject=this;this.type="wmp_connect",this.form,this.DOMDoc,this.send_btn,this.submitURL,this.redirectTo,this.init=function(){WMPJSInterface=window.parent.WMPJSInterface,this.send_btn=jQuery("#"+this.type+"_send_btn",this.DOMDoc).get(0),this.form=this.DOMDoc.getElementById(this.type+"_form"),this.addButtonsActions(),null!=this.form&&this.initValidation()},this.initValidation=function(){this.validator=jQuery("#"+this.form.id,this.DOMDoc).validate({rules:{wmp_connect_apikey:{required:!0,alphanumeric:!0}},messages:{wmp_connect_apikey:{required:"This field is required."}},errorPlacement:function(e,t){var n=t[0].id.split("_"),r=n.length>1?n[n.length-1]:n[0],i=jQuery("#error_"+r+"_container",JSObject.DOMDoc);e.appendTo(i)},errorElement:"span"})},this.addButtonsActions=function(){jQuery(this.send_btn).unbind("click"),jQuery(this.send_btn).bind("click",function(){JSObject.disableButton(this),JSObject.validate()}),JSObject.enableButton(this.send_btn),jQuery("#"+JSObject.form.id,JSObject.DOMDoc).bind("keypress",function(e){return 13==e.keyCode?!1:void 0})},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.scrollToError=function(e){var t=jQuery("html,body",JSObject.DOMDoc),n=parseInt(jQuery("html,body").scrollTop())||parseInt(jQuery("body").scrollTop()),r=t.get(0).clientHeight;parseInt(t.offset().top);n>e?jQuery(t).animate({scrollTop:e-20},1e3):e>n+r&&jQuery(t).animate({scrollTop:n+r},1e3)},this.validate=function(){jQuery(this.form).validate().form();var e=[];for(var t in this.validator.invalid){var n=jQuery(this.form[t]);e.push(n.offset().top)}0==e.length?this.sendData():(e.sort(function(e,t){return e-t}),JSObject.scrollToError(e[0]),JSObject.addButtonsActions())},this.sendData=function(){WMPJSInterface.Preloader.start(),jQuery.post(ajaxurl,{action:"wmp_premium_save",api_key:jQuery("#"+JSObject.type+"_apikey",JSObject.DOMDoc).val()},function(response){jQuery.ajax({url:JSObject.submitURL,type:"get",data:{apiKey:jQuery("#"+JSObject.type+"_apikey",JSObject.DOMDoc).val(),settingsPath:jQuery("#"+JSObject.type+"_settings",JSObject.DOMDoc).val()},dataType:"jsonp",success:function(responseJSON){WMPJSInterface.Preloader.remove(100);var JSON=eval(responseJSON),status=Boolean(Number(String(JSON.status)));1==status?jQuery.post(ajaxurl,{action:"wmp_premium_connect",api_key:jQuery("#"+JSObject.type+"_apikey",JSObject.DOMDoc).val(),valid:1,config_path:JSON.config_path},function(e){var e=Boolean(Number(String(e)));if(1==e)window.location.href=JSObject.redirectTo;else{var t="We were unable to verify your API Key. Please contact support.";WMPJSInterface.Loader.display({message:t}),JSObject.form.reset(),setTimeout(function(){var e=JSObject.form.elements;for(nElems=e.length,j=0;j<nElems;j++)e[j].disabled=!1},300),JSObject.addButtonsActions()}}):(void 0!=JSON.message?WMPJSInterface.Loader.display({message:JSON.message}):WMPJSInterface.Loader.display({message:"We were unable to verify your API Key. Please contact support."}),JSObject.form.reset(),setTimeout(function(){var e=JSObject.form.elements;for(nElems=e.length,j=0;j<nElems;j++)e[j].disabled=!1},300),JSObject.addButtonsActions())},error:function(e){WMPJSInterface.Preloader.remove(100),WMPJSInterface.Loader.display({message:"Verification endpoint is unreachable. Please contact support."})}})})}} \ No newline at end of file
+function WMP_CONNECT(){var JSObject=this;this.type="wmp_connect",this.form,this.DOMDoc,this.send_btn,this.submitURL,this.redirectTo,this.init=function(){WMPJSInterface=window.parent.WMPJSInterface,this.send_btn=jQuery("#"+this.type+"_send_btn",this.DOMDoc).get(0),this.form=this.DOMDoc.getElementById(this.type+"_form"),this.addButtonsActions(),null!=this.form&&this.initValidation()},this.initValidation=function(){this.validator=jQuery("#"+this.form.id,this.DOMDoc).validate({rules:{wmp_connect_apikey:{required:!0,alphanumeric:!0}},messages:{wmp_connect_apikey:{required:"This field is required."}},errorPlacement:function(a,b){var c=b[0].id.split("_"),d=c.length>1?c[c.length-1]:c[0],e=jQuery("#error_"+d+"_container",JSObject.DOMDoc);a.appendTo(e)},errorElement:"span"})},this.addButtonsActions=function(){jQuery(this.send_btn).unbind("click"),jQuery(this.send_btn).bind("click",function(){JSObject.disableButton(this),JSObject.validate()}),JSObject.enableButton(this.send_btn),jQuery("#"+JSObject.form.id,JSObject.DOMDoc).bind("keypress",function(a){if(13==a.keyCode)return!1})},this.enableButton=function(a){jQuery(a).css("cursor","pointer"),jQuery(a).animate({opacity:1},100)},this.disableButton=function(a){jQuery(a).unbind("click"),jQuery(a).animate({opacity:.4},100),jQuery(a).css("cursor","default")},this.scrollToError=function(a){var b=jQuery("html,body",JSObject.DOMDoc),c=parseInt(jQuery("html,body").scrollTop())||parseInt(jQuery("body").scrollTop()),d=b.get(0).clientHeight;parseInt(b.offset().top);a<c?jQuery(b).animate({scrollTop:a-20},1e3):a>c+d&&jQuery(b).animate({scrollTop:c+d},1e3)},this.validate=function(){jQuery(this.form).validate().form();var a=[];for(var b in this.validator.invalid){var c=jQuery(this.form[b]);a.push(c.offset().top)}0==a.length?this.sendData():(a.sort(function(a,b){return a-b}),JSObject.scrollToError(a[0]),JSObject.addButtonsActions())},this.sendData=function(){WMPJSInterface.Preloader.start(),jQuery.post(ajaxurl,{action:"wmp_premium_save",api_key:jQuery("#"+JSObject.type+"_apikey",JSObject.DOMDoc).val()},function(response){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);var JSON=eval(responseJSON),status=Boolean(Number(String(JSON.status)));1==status?jQuery.post(ajaxurl,{action:"wmp_premium_connect",api_key:jQuery("#"+JSObject.type+"_apikey",JSObject.DOMDoc).val(),valid:1,config_path:JSON.config_path},function(a){var a=Boolean(Number(String(a)));if(1==a)window.location.href=JSObject.redirectTo;else{WMPJSInterface.Loader.display({message:"We were unable to verify your API Key. Please contact support."}),JSObject.form.reset(),setTimeout(function(){var a=JSObject.form.elements;for(nElems=a.length,j=0;j<nElems;j++)a[j].disabled=!1},300),JSObject.addButtonsActions()}}):(void 0!=JSON.message?WMPJSInterface.Loader.display({message:JSON.message}):WMPJSInterface.Loader.display({message:"We were unable to verify your API Key. Please contact support."}),JSObject.form.reset(),setTimeout(function(){var a=JSObject.form.elements;for(nElems=a.length,j=0;j<nElems;j++)a[j].disabled=!1},300),JSObject.addButtonsActions())},error:function(a){WMPJSInterface.Preloader.remove(100),WMPJSInterface.Loader.display({message:"Verification endpoint is unreachable. Please contact support."})}})})}}