updated plugin WP Mail SMTP version 2.3.1

This commit is contained in:
2020-08-24 15:45:02 +00:00
committed by Gitium
parent be08bbbabd
commit fd5eaaad6c
66 changed files with 3703 additions and 1342 deletions

View File

@ -165,10 +165,49 @@ WPMailSMTP.Admin.Settings = WPMailSMTP.Admin.Settings || ( function( document, w
target.select();
document.execCommand( 'Copy' );
var $buttonIcon = $( this ).find( '.dashicons' );
$buttonIcon
.removeClass( 'dashicons-admin-page' )
.addClass( 'dashicons-yes-alt wp-mail-smtp-success wp-mail-smtp-animate' );
setTimeout(
function() {
$buttonIcon
.removeClass( 'dashicons-yes-alt wp-mail-smtp-success wp-mail-smtp-animate' )
.addClass( 'dashicons-admin-page' );
},
1000
);
} );
// Notice bar: click on the dissmiss button.
$( '#wp-mail-smtp-notice-bar' ).on( 'click', '.dismiss', function() {
var $notice = $( this ).closest( '#wp-mail-smtp-notice-bar' );
$notice.addClass( 'out' );
setTimeout(
function() {
$notice.remove();
},
300
);
$.post(
ajaxurl,
{
action: 'wp_mail_smtp_notice_bar_dismiss',
nonce: wp_mail_smtp.nonce,
}
);
} );
app.triggerExitNotice();
app.beforeSaveChecks();
// Register change event to show/hide plugin supported settings for currently selected mailer.
$( '.js-wp-mail-smtp-setting-mailer-radio-input', app.pageHolder ).on( 'change', this.processMailerSettingsOnChange );
},
education: {
@ -313,6 +352,43 @@ WPMailSMTP.Admin.Settings = WPMailSMTP.Admin.Settings || ( function( document, w
return false;
}
} );
},
/**
* On change callback for showing/hiding plugin supported settings for currently selected mailer.
*
* @since 2.3.0
*/
processMailerSettingsOnChange: function() {
var mailerSupportedSettings = wp_mail_smtp.all_mailers_supports[ $( this ).val() ];
for ( var setting in mailerSupportedSettings ) {
// eslint-disable-next-line no-prototype-builtins
if ( mailerSupportedSettings.hasOwnProperty( setting ) ) {
$( '.js-wp-mail-smtp-setting-' + setting, app.pageHolder ).toggle( mailerSupportedSettings[ setting ] );
}
}
// Special case: "from email" (group settings).
var $mainSettingInGroup = $( '.js-wp-mail-smtp-setting-from_email' );
$mainSettingInGroup.closest( '.wp-mail-smtp-setting-row' ).toggle(
mailerSupportedSettings['from_email'] || mailerSupportedSettings['from_email_force']
);
$mainSettingInGroup.siblings( '.wp-mail-smtp-setting-mid-row-sep' ).toggle(
mailerSupportedSettings['from_email'] && mailerSupportedSettings['from_email_force']
);
// Special case: "from name" (group settings).
$mainSettingInGroup = $( '.js-wp-mail-smtp-setting-from_name' );
$mainSettingInGroup.closest( '.wp-mail-smtp-setting-row' ).toggle(
mailerSupportedSettings['from_name'] || mailerSupportedSettings['from_name_force']
);
$mainSettingInGroup.siblings( '.wp-mail-smtp-setting-mid-row-sep' ).toggle(
mailerSupportedSettings['from_name'] && mailerSupportedSettings['from_name_force']
);
}
};