2020-08-24 15:45:02 +00:00
|
|
|
"use strict";var WPMailSMTP=window.WPMailSMTP||{};WPMailSMTP.Admin=WPMailSMTP.Admin||{},WPMailSMTP.Admin.Settings=WPMailSMTP.Admin.Settings||function(i,e,a){var s={pluginSettingsChanged:!1,init:function(){a(i).ready(s.ready)},ready:function(){s.pageHolder=a(".wp-mail-smtp-tab-settings"),a("#screen-meta-links, #screen-meta").prependTo("#wp-mail-smtp-header-temp").show(),s.bindActions()},bindActions:function(){a(".wp-mail-smtp-mailer-image",s.pageHolder).click(function(){a(this).parents(".wp-mail-smtp-mailer").find("input").trigger("click")}),a(".wp-mail-smtp-mailer input",s.pageHolder).click(function(){var t=a(this);if(t.prop("disabled"))return t.hasClass("educate")&&s.education.upgradeMailer(t),!1;a(".wp-mail-smtp-mailer",s.pageHolder).removeClass("active"),a(this).parents(".wp-mail-smtp-mailer").addClass("active"),a(".wp-mail-smtp-mailer-option",s.pageHolder).addClass("hidden").removeClass("active"),a(".wp-mail-smtp-mailer-option-"+a(this).val(),s.pageHolder).addClass("active").removeClass("hidden")}),s.mailers.smtp.bindActions(),a("#wp-mail-smtp-pro-banner-dismiss",s.pageHolder).on("click",function(){a.ajax({url:ajaxurl,dataType:"json",type:"POST",data:{action:"wp_mail_smtp_ajax",task:"pro_banner_dismiss"}}).always(function(){a("#wp-mail-smtp-pro-banner",s.pageHolder).fadeOut("fast")})}),a(".js-wp-mail-smtp-mailer-notice-dismiss",s.pageHolder).on("click",function(t){t.preventDefault();var e=a(this),i=e.parents(".inline-notice");if(e.hasClass("disabled"))return!1;a.ajax({url:ajaxurl,dataType:"json",type:"POST",data:{action:"wp_mail_smtp_ajax",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")})})}),a("#wp-mail-smtp-debug .error-log-toggle").on("click",function(t){t.preventDefault(),a("#wp-mail-smtp-debug .error-log-toggle").find(".dashicons").toggleClass("dashicons-arrow-right-alt2 dashicons-arrow-down-alt2"),a("#wp-mail-smtp-debug .error-log").slideToggle(),a("#wp-mail-smtp-debug .error-log-note").toggle()}),a(".js-wp-mail-smtp-provider-remove",s.pageHolder).on("click",function(){return confirm(wp_mail_smtp.text_provider_remove)}),a(".wp-mail-smtp-setting-copy",s.pageHolder).click(function(t){t.preventDefault(),a("#"+a(this).data("source_id")).get(0).select(),i.execCommand("Copy");var e=a(this).find(".dashicons");e.removeClass("dashicons-admin-page").addClass("dashicons-yes-alt wp-mail-smtp-success wp-mail-smtp-animate"),setTimeout(function(){e.removeClass("dashicons-yes-alt wp-mail-smtp-success wp-mail-smtp-animate").addClass("dashicons-admin-page")},1e3)}),a("#wp-mail-smtp-notice-bar").on("click",".dismiss",function(){var t=a(this).closest("#wp-mail-smtp-notice-bar");t.addClass("out"),setTimeout(function(){t.remove()},300),a.post(ajaxurl,{action:"wp_mail_smtp_notice_bar_dismiss",nonce:wp_mail_smtp.nonce})}),s.triggerExitNotice(),s.beforeSaveChecks(),a(".js-wp-mail-smtp-setting-mailer-radio-input",s.pageHolder).on("change",this.processMailerSettingsOnChange)},education:{upgradeMailer:function(t){a.alert({backgroundDismiss:!0,escapeKey:!0,animationBounce:1,theme:"modern",type:"blue",animateFromElement:!1,draggable:!1,closeIcon:!0,useBootstrap:!1,title:wp_mail_smtp.education.upgrade_title.replace(/%name%/g,t.siblings("label").text().trim()),icon:'"></i>'+wp_mail_smtp.education.upgrade_icon_lock+'<i class="',content:a(".wp-mail-smtp-mailer-options .wp-mail-smtp-mailer-option-"+t.val()+" .wp-mail-smtp-setting-field").html(),boxWidth:"550px",onOpenBefore:function(){this.$btnc.after('<div class="discount-note">'+wp_mail_smtp.education.upgrade_bonus+wp_mail_smtp.education.upgrade_doc+"</div>")},buttons:{confirm:{text:wp_mail_smtp.education.upgrade_button,btnClass:"btn-confirm",keys:["enter"],action:function(){e.open(wp_mail_smtp.education.upgrade_url+"&utm_content="+encodeURI(t.val()),"_blank")}}}})}},mailers:{smtp:{bindActions:function(){a("#wp-mail-smtp-setting-smtp-auth").change(function(){a("#wp-mail-smtp-setting-row-smtp-user, #wp-mail-smtp-setting-row-smtp-pass").toggleClass("inac
|