%PDF- %PDF-
Direktori : /home/t/r/a/tradesc/www/relax/wp-content/plugins/wpforms-lite/assets/js/admin/pages/ |
Current File : /home/t/r/a/tradesc/www/relax/wp-content/plugins/wpforms-lite/assets/js/admin/pages/smtp.min.js |
"use strict";var WPFormsPagesSMTP=window.WPFormsPagesSMTP||function(l,i){var r={},p={init:function(){i(p.ready)},ready:function(){p.initVars(),p.events()},initVars:function(){r={$stepInstall:i("section.step-install"),$stepInstallNum:i("section.step-install .num img"),$stepSetup:i("section.step-setup"),$stepSetupNum:i("section.step-setup .num img")}},events:function(){r.$stepInstall.on("click","button",p.stepInstallClick),r.$stepSetup.on("click","button",p.gotoURL)},stepInstallClick:function(){const s=i(this);if(!s.hasClass("disabled")){const e=s.attr("data-action");let t="";switch(e){case"activate":t="wpforms_activate_addon",s.text(wpforms_pluginlanding.activating);break;case"install":t="wpforms_install_addon",s.text(wpforms_pluginlanding.installing);break;case"goto-url":return void(l.location.href=s.attr("data-url"));default:return}s.addClass("disabled"),p.showSpinner(r.$stepInstallNum);var n=s.attr("data-plugin"),a=s.attr("data-source"),n={action:t,nonce:wpforms_admin.nonce,plugin:n,type:"plugin",source:a};i.post(wpforms_admin.ajax_url,n).done(function(t){p.stepInstallDone(t,s,e)}).always(function(){p.hideSpinner(r.$stepInstallNum)})}},stepInstallDone:function(t,s,n){var a;("install"===n?t.success&&t.data.is_activated:t.success)?(r.$stepInstallNum.attr("src",r.$stepInstallNum.attr("src").replace("step-1.","step-complete.")),s.addClass("grey").removeClass("button-primary").text(wpforms_pluginlanding.activated),p.stepInstallPluginStatus()):(n=(t="install"===n&&t.success&&!t.data.is_activated||"activate"===n)?wpforms_pluginlanding.manual_activate_url:wpforms_pluginlanding.manual_install_url,a=t?wpforms_pluginlanding.error_could_not_activate:wpforms_pluginlanding.error_could_not_install,t=t?wpforms_pluginlanding.plugins_page:wpforms_pluginlanding.download_now,s.removeClass("grey disabled").text(t).attr("data-action","goto-url").attr("data-url",n),s.after('<p class="error">'+a+"</p>"))},stepInstallPluginStatus:function(){var t={action:"wpforms_smtp_page_check_plugin_status",nonce:wpforms_admin.nonce};i.post(wpforms_admin.ajax_url,t).done(p.stepInstallPluginStatusDone)},stepInstallPluginStatusDone:function(t){t.success&&(r.$stepSetup.removeClass("grey"),r.$stepSetupBtn=r.$stepSetup.find("button"),r.$stepSetupBtn.removeClass("grey disabled").addClass("button-primary"),0<t.data.setup_status?(r.$stepSetupNum.attr("src",r.$stepSetupNum.attr("src").replace("step-2.svg","step-complete.svg")),r.$stepSetupBtn.attr("data-url",wpforms_pluginlanding.smtp_settings_url).text(wpforms_pluginlanding.smtp_settings)):r.$stepSetupBtn.attr("data-url",wpforms_pluginlanding.smtp_wizard_url).text(wpforms_pluginlanding.smtp_wizard))},gotoURL:function(){var t=i(this);t.hasClass("disabled")||(l.location.href=t.attr("data-url"))},showSpinner:function(t){t.siblings(".loader").removeClass("hidden")},hideSpinner:function(t){t.siblings(".loader").addClass("hidden")}};return p}((document,window),jQuery);WPFormsPagesSMTP.init();