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

@ -0,0 +1,3 @@
#wpadminbar .wp-mail-smtp-admin-bar-menu-notification-counter,#wpadminbar .wp-mail-smtp-admin-bar-menu-error{display:inline-block !important;vertical-align:top !important;box-sizing:border-box !important;margin:7px 0 0 2px !important;padding:0 5px !important;min-width:18px !important;height:18px !important;border-radius:9px !important;background-color:#ca4a1f !important;color:#fff !important;font-size:11px !important;line-height:1.6 !important;text-align:center !important}#wpadminbar .wp-mail-smtp-admin-bar-menu-notification-counter span,#wpadminbar .wp-mail-smtp-admin-bar-menu-error span{line-height:1 !important;font-size:11px !important}
/*# sourceMappingURL=admin-bar.min.css.map */

View File

@ -0,0 +1,3 @@
#wp-mail-smtp-notifications{position:relative;background:#FFFFFF 0 0 no-repeat padding-box;box-shadow:0 5px 15px #0000000D;border-radius:6px;opacity:1;min-height:48px;padding:15px 102px 15px 72px;margin:0 0 14px 0}#wp-mail-smtp-notifications *{box-sizing:border-box}#wp-mail-smtp-notifications .bell{position:absolute;top:15px;left:15px;width:42px;height:48px}#wp-mail-smtp-notifications .messages .message{display:none}#wp-mail-smtp-notifications .messages .message.current{display:block}#wp-mail-smtp-notifications .messages .message .title{font-weight:bold;font-size:17px;line-height:20px;margin:0;color:#444}#wp-mail-smtp-notifications .messages .message .content{font-weight:normal;font-size:13px;line-height:20px;margin:6px 0 40px 0}#wp-mail-smtp-notifications .messages .message .buttons{margin:-30px 80px 0 0}#wp-mail-smtp-notifications .messages .message .buttons a{margin:0 6px 0 0;padding:8px 10px;line-height:13px;font-size:13px;min-height:unset}#wp-mail-smtp-notifications .messages .message .buttons .button-secondary{border:1px solid #0071A1}#wp-mail-smtp-notifications .dismiss{position:absolute;top:15px;right:15px;width:16px;height:16px;color:#72777C;font-size:16px;cursor:pointer;text-align:center;vertical-align:middle;line-height:16px}#wp-mail-smtp-notifications .dismiss:hover{color:#dc3232}#wp-mail-smtp-notifications .navigation{position:absolute;bottom:15px;right:15px;width:63px;height:30px}#wp-mail-smtp-notifications .navigation a{display:block;width:30px;height:30px;border:1px solid #7E8993;border-radius:3px;font-size:8px;text-align:center;vertical-align:middle;line-height:30px;cursor:pointer;background-color:#ffffff;color:#41454A}#wp-mail-smtp-notifications .navigation a:hover{background-color:#f1f1f1}#wp-mail-smtp-notifications .navigation a .dashicons{margin-top:8px;font-size:12px}#wp-mail-smtp-notifications .navigation .prev{float:left}#wp-mail-smtp-notifications .navigation .next{float:right}#wp-mail-smtp-notifications .navigation .disabled{border-color:#dddddd;color:#A0A5AA;cursor:default}#wp-mail-smtp-notifications .navigation .disabled:hover{background-color:#ffffff}@media screen and (max-width: 768px){#wp-mail-smtp-notifications{padding:15px 15px 15px 72px}#wp-mail-smtp-notifications .messages .message .title{margin:0 30px 0 0}#wp-mail-smtp-notifications .messages .message .content{font-size:16px;line-height:24px}#wp-mail-smtp-notifications .messages .message .buttons{margin:-30px 80px 0 0}#wp-mail-smtp-notifications .messages .message .buttons a{margin:0;display:table}#wp-mail-smtp-notifications .messages .message .buttons .button-secondary{margin-top:6px}}
/*# sourceMappingURL=admin-notifications.min.css.map */

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 562.3 193.9"><path fill="#dc7e28" d="M562.3 41.4v133.4l-18.1 18.1V62.3z"/><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="421.008" y1="59.066" x2="541.982" y2="192.343"><stop offset=".006" stop-color="#f8c51b"/><stop offset="1" stop-color="#e78f24"/></linearGradient><path fill="url(#a)" d="M422.3 62.3h122v130.6h-122z"/><path fill="#fdd600" d="M441.4 41.5l-19.1 20.8h121.9l18.1-20.9z"/><path fill="#90c7ea" d="M290.3 47.2l120-16.7-10.1 28.8-118.3 16.1z"/><linearGradient id="b" gradientUnits="userSpaceOnUse" x1="286.163" y1="75.325" x2="410.923" y2="175.512"><stop offset=".006" stop-color="#1f8aca"/><stop offset="1" stop-color="#01659e"/></linearGradient><path fill="url(#b)" d="M400.2 59.3l16.7 117-118.3 16.6-16.7-117.5z"/><path fill="#0b98d5" d="M400.2 59.3l16.7 117 9-25.3-15.5-119.8-.1-.7"/><linearGradient id="c" gradientUnits="userSpaceOnUse" x1="218.128" y1="80.759" x2="218.128" y2="190.084"><stop offset="0" stop-color="#269f49"/><stop offset="1" stop-color="#008a54"/></linearGradient><path fill="url(#c)" d="M189 37.2l106.2 48-47.9 108.7L141.1 146z"/><path fill="#95cea0" d="M178 0l11 37.2 106.2 48-8.9-35.6z"/><path fill="#69bf6d" d="M178 0l-42.8 101.4 5.9 44.6L189 37.2z"/><linearGradient id="d" gradientUnits="userSpaceOnUse" x1="59.535" y1="70.064" x2="78.336" y2="183.568"><stop offset="0" stop-color="#d81f32"/><stop offset="1" stop-color="#bb2637"/></linearGradient><path fill="url(#d)" d="M118.7 59.1l17.5 115.2-117.3 18.4L0 77.3z"/><path fill="#761216" d="M126.7 17.2l17.4 116.2-7.9 40.9-17.5-115.2z"/><path d="M525.6 109.3c-2.4-6.1-6-11.5-10.7-16.3-4.5-4.6-9.6-8.1-15.2-10.4-5.6-2.3-11.7-3.5-18.2-3.5-6.6 0-12.7 1.2-18.4 3.5-5.7 2.3-10.7 5.8-15.2 10.4-4.7 4.7-8.3 10.2-10.6 16.2-2.4 6.1-3.5 12.7-3.5 19.8 0 7.1 1.2 13.7 3.6 19.8 2.4 6.1 5.9 11.6 10.6 16.4 4.4 4.5 9.4 8 15 10.3 5.6 2.3 11.8 3.5 18.5 3.5 6.5 0 12.5-1.2 18.2-3.5 5.6-2.3 10.7-5.7 15.3-10.3 4.7-4.8 8.3-10.3 10.7-16.4 2.4-6.1 3.6-12.7 3.6-19.8-.1-7-1.3-13.6-3.7-19.7zm-25.1 43c-4.7 5.6-11 8.4-19.1 8.5-8.2 0-14.5-2.8-19.2-8.4-4.7-5.6-7.1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8.2 1.6 1.4 3.7 2.2 6 2.2.6 0 1.2 0 1.8-.1 3.1-.4 5.4-1.8 6.8-4.2 1-1.7 1.5-3.7 1.5-6 0-.9-.1-1.9-.2-2.9l-11.6-79.1z" fill="#fff"/><path fill="#ec473f" d="M0 77.3l2.3-11.6 5.9-29.5 118.5-19-8 41.9z"/></svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

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']
);
}
};

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,185 @@
/* global wp_mail_smtp, ajaxurl */
/**
* WP Mail SMTP Admin Notifications.
*
* @since 2.3.0
*/
'use strict';
var WPMailSMTPAdminNotifications = window.WPMailSMTPAdminNotifications || ( function( document, window, $ ) {
/**
* Elements holder.
*
* @since 2.3.0
*
* @type {object}
*/
var el = {
$notifications: $( '#wp-mail-smtp-notifications' ),
$nextButton: $( '#wp-mail-smtp-notifications .navigation .next' ),
$prevButton: $( '#wp-mail-smtp-notifications .navigation .prev' ),
$adminBarCounter: $( '#wp-admin-bar-wp-mail-smtp-menu .wp-mail-smtp-admin-bar-menu-notification-counter' ),
};
/**
* Public functions and properties.
*
* @since 2.3.0
*
* @type {object}
*/
var app = {
/**
* Start the engine.
*
* @since 2.3.0
*/
init: function() {
$( document ).ready( app.ready );
},
/**
* Document ready.
*
* @since 2.3.0
*/
ready: function() {
app.updateNavigation();
app.events();
},
/**
* Register JS events.
*
* @since 2.3.0
*/
events: function() {
el.$notifications
.on( 'click', '.dismiss', app.dismiss )
.on( 'click', '.next', app.navNext )
.on( 'click', '.prev', app.navPrev );
},
/**
* Click on the Dismiss notification button.
*
* @since 2.3.0
*
* @param {object} event Event object.
*/
dismiss: function( event ) {
if ( el.$currentMessage.length === 0 ) {
return;
}
// AJAX call - update option.
var data = {
action: 'wp_mail_smtp_notification_dismiss',
nonce: wp_mail_smtp.nonce,
id: el.$currentMessage.data( 'message-id' ),
};
$.post( ajaxurl, data, function( response ) {
if ( ! response.success ) {
return;
}
// Update counter.
var count = parseInt( el.$adminBarCounter.text(), 10 );
if ( count > 1 ) {
--count;
el.$adminBarCounter.html( '<span>' + count + '</span>' );
} else {
el.$adminBarCounter.remove();
}
// Remove notification.
var $nextMessage = el.$nextMessage.length < 1 ? el.$prevMessage : el.$nextMessage;
if ( $nextMessage.length === 0 ) {
el.$notifications.remove();
} else {
el.$currentMessage.remove();
$nextMessage.addClass( 'current' );
app.updateNavigation();
}
} );
},
/**
* Click on the Next notification button.
*
* @since 2.3.0
*
* @param {object} event Event object.
*/
navNext: function( event ) {
if ( el.$nextButton.hasClass( 'disabled' ) ) {
return;
}
el.$currentMessage.removeClass( 'current' );
el.$nextMessage.addClass( 'current' );
app.updateNavigation();
},
/**
* Click on the Previous notification button.
*
* @since 2.3.0
*
* @param {object} event Event object.
*/
navPrev: function( event ) {
if ( el.$prevButton.hasClass( 'disabled' ) ) {
return;
}
el.$currentMessage.removeClass( 'current' );
el.$prevMessage.addClass( 'current' );
app.updateNavigation();
},
/**
* Update navigation buttons.
*
* @since 2.3.0
*/
updateNavigation: function() {
el.$currentMessage = el.$notifications.find( '.message.current' );
el.$nextMessage = el.$currentMessage.next( '.message' );
el.$prevMessage = el.$currentMessage.prev( '.message' );
if ( el.$nextMessage.length === 0 ) {
el.$nextButton.addClass( 'disabled' );
} else {
el.$nextButton.removeClass( 'disabled' );
}
if ( el.$prevMessage.length === 0 ) {
el.$prevButton.addClass( 'disabled' );
} else {
el.$prevButton.removeClass( 'disabled' );
}
},
};
return app;
}( document, window, jQuery ) );
// Initialize.
WPMailSMTPAdminNotifications.init();

View File

@ -0,0 +1 @@
"use strict";var WPMailSMTPAdminNotifications=window.WPMailSMTPAdminNotifications||function(e,t){var a={$notifications:t("#wp-mail-smtp-notifications"),$nextButton:t("#wp-mail-smtp-notifications .navigation .next"),$prevButton:t("#wp-mail-smtp-notifications .navigation .prev"),$adminBarCounter:t("#wp-admin-bar-wp-mail-smtp-menu .wp-mail-smtp-admin-bar-menu-notification-counter")},s={init:function(){t(e).ready(s.ready)},ready:function(){s.updateNavigation(),s.events()},events:function(){a.$notifications.on("click",".dismiss",s.dismiss).on("click",".next",s.navNext).on("click",".prev",s.navPrev)},dismiss:function(e){if(0!==a.$currentMessage.length){var n={action:"wp_mail_smtp_notification_dismiss",nonce:wp_mail_smtp.nonce,id:a.$currentMessage.data("message-id")};t.post(ajaxurl,n,function(e){if(e.success){var n=parseInt(a.$adminBarCounter.text(),10);1<n?(--n,a.$adminBarCounter.html("<span>"+n+"</span>")):a.$adminBarCounter.remove();var t=a.$nextMessage.length<1?a.$prevMessage:a.$nextMessage;0===t.length?a.$notifications.remove():(a.$currentMessage.remove(),t.addClass("current"),s.updateNavigation())}})}},navNext:function(e){a.$nextButton.hasClass("disabled")||(a.$currentMessage.removeClass("current"),a.$nextMessage.addClass("current"),s.updateNavigation())},navPrev:function(e){a.$prevButton.hasClass("disabled")||(a.$currentMessage.removeClass("current"),a.$prevMessage.addClass("current"),s.updateNavigation())},updateNavigation:function(){a.$currentMessage=a.$notifications.find(".message.current"),a.$nextMessage=a.$currentMessage.next(".message"),a.$prevMessage=a.$currentMessage.prev(".message"),0===a.$nextMessage.length?a.$nextButton.addClass("disabled"):a.$nextButton.removeClass("disabled"),0===a.$prevMessage.length?a.$prevButton.addClass("disabled"):a.$prevButton.removeClass("disabled")}};return s}(document,(window,jQuery));WPMailSMTPAdminNotifications.init();