1 line
8.2 KiB
JavaScript
1 line
8.2 KiB
JavaScript
|
"use strict";var WPMailSMTP=window.WPMailSMTP||{};WPMailSMTP.Admin=WPMailSMTP.Admin||{},WPMailSMTP.Admin.Settings=WPMailSMTP.Admin.Settings||function(a,m,p){var n={pluginSettingsChanged:!1,init:function(){p(n.ready)},ready:function(){n.pageHolder=p(".wp-mail-smtp-tab-settings"),n.settingsForm=p(".wp-mail-smtp-connection-settings-form"),p("#screen-meta-links, #screen-meta").prependTo("#wp-mail-smtp-header-temp").show(),n.bindActions(),n.setJQueryConfirmDefaults(),n.initFlyoutMenu()},bindActions:function(){p(".wp-mail-smtp-mailer-image",n.settingsForm).on("click",function(){p(this).parents(".wp-mail-smtp-mailer").find("input").trigger("click")}),p(".wp-mail-smtp-mailer input",n.settingsForm).on("click",function(){var t=p(this);if(t.prop("disabled"))return t.hasClass("educate")&&n.education.upgradeMailer(t),!1;p(".wp-mail-smtp-mailer",n.settingsForm).removeClass("active"),p(this).parents(".wp-mail-smtp-mailer").addClass("active"),p(".wp-mail-smtp-mailer-option",n.settingsForm).addClass("hidden").removeClass("active"),p(".wp-mail-smtp-mailer-option-"+p(this).val(),n.settingsForm).addClass("active").removeClass("hidden")}),n.mailers.smtp.bindActions(),p("#wp-mail-smtp-pro-banner-dismiss",n.pageHolder).on("click",function(){p.ajax({url:ajaxurl,dataType:"json",type:"POST",data:{action:"wp_mail_smtp_ajax",task:"pro_banner_dismiss",nonce:wp_mail_smtp.nonce}}).always(function(){p("#wp-mail-smtp-pro-banner",n.pageHolder).fadeOut("fast")})}),p(".js-wp-mail-smtp-mailer-notice-dismiss",n.settingsForm).on("click",function(t){t.preventDefault();var e=p(this),i=e.parents(".inline-notice");if(e.hasClass("disabled"))return!1;p.ajax({url:ajaxurl,dataType:"json",type:"POST",data:{action:"wp_mail_smtp_ajax",nonce:wp_mail_smtp.nonce,task:"notice_dismiss",notice:i.data("notice"),mailer:i.data("mailer")},beforeSend:function(){e.addClass("disabled")}}).always(function(){i.fadeOut("fast",function(){e.removeClass("disabled")})})}),p("#wp-mail-smtp-debug .error-log-toggle").on("click",function(t){t.preventDefault(),p("#wp-mail-smtp-debug .error-log").slideToggle()}),p("#wp-mail-smtp-debug .error-log-copy").on("click",function(t){t.preventDefault();var e=p(this),i=p("#wp-mail-smtp-debug .error-log");i.is(":visible")||i.addClass("error-log-selection");t=a.createRange();t.selectNode(i[0]),m.getSelection().removeAllRanges(),m.getSelection().addRange(t),a.execCommand("Copy"),m.getSelection().removeAllRanges(),i.removeClass("error-log-selection"),e.addClass("error-log-copy-copied"),setTimeout(function(){e.removeClass("error-log-copy-copied")},1500)}),p(".js-wp-mail-smtp-provider-remove",n.settingsForm).on("click",function(){return confirm(wp_mail_smtp.text_provider_remove)}),p(".wp-mail-smtp-setting-copy",n.settingsForm).on("click",function(t){t.preventDefault(),p("#"+p(this).data("source_id")).get(0).select(),a.execCommand("Copy");var e=p(this).find(".dashicons");e.removeClass("dashicons-admin-page").addClass("wp-mail-smtp-dashicons-yes-alt-green wp-mail-smtp-success wp-mail-smtp-animate"),setTimeout(function(){e.removeClass("wp-mail-smtp-dashicons-yes-alt-green wp-mail-smtp-success wp-mail-smtp-animate").addClass("dashicons-admin-page")},1e3)}),p("#wp-mail-smtp-notice-bar").on("click",".dismiss",function(){var t=p(this).closest("#wp-mail-smtp-notice-bar");t.addClass("out"),setTimeout(function(){t.remove()},300),p.post(ajaxurl,{action:"wp_mail_smtp_notice_bar_dismiss",nonce:wp_mail_smtp.nonce})}),n.triggerExitNotice(),n.beforeSaveChecks(),p(".js-wp-mail-smtp-setting-mailer-radio-input",n.settingsForm).on("change",this.processMailerSettingsOnChange),p(".wp-mail-smtp-tab-tools-test #email-test-form").on("submit",function(){var t=p(this).find(".wp-mail-smtp-btn");t.attr("disabled",!0),t.find("span").hide(),t.find(".wp-mail-smtp-loading").show()}),p(".email_test_tab_removal_notice").on("click",".notice-dismiss",function(){var t=p(this);p.ajax({url:ajaxurl,dataType:"json",type:"POST",data:{action:"wp_mail_smtp_ajax",nonce:wp_mail_smtp.nonce,task:"email_test_tab_removal_notice_dismiss"},beforeSend:function(){t.prop("disabled",!0)}})}),p("#wp-mail-smtp-setting
|