/* global wp_mail_smtp_admin_notices, ajaxurl */
/**
* WP Mail SMTP Admin Notices.
*
* @since 4.4.0
*/
'use strict';
var WPMailSMTPAdminNotices = window.WPMailSMTPAdminNotices || ( function( document, window, $ ) {
/**
* Public functions and properties.
*
* @since 4.4.0
*
* @type {object}
*/
var app = {
/**
* Start the engine.
*
* @since 4.4.0
*/
init: function() {
$( app.ready );
},
/**
* Document ready.
*
* @since 4.4.0
*/
ready: function() {
app.events();
},
/**
* Register JS events.
*
* @since 4.4.0
*/
events: function() {
$( '.wp-mail-smtp-notice.is-dismissible' )
.on( 'click', '.notice-dismiss', app.dismiss );
$( '.wp-mail-smtp-notice__copy-btn' ).on( 'click', app.copyErrorCode );
},
/**
* Copy error code to clipboard.
*
* @since 4.8.0
*/
copyErrorCode: function() {
var $btn = $( this );
var code = $btn.siblings( 'code' ).text();
if ( navigator.clipboard ) {
navigator.clipboard.writeText( code );
}
$btn.find( '.wp-mail-smtp-notice__icon-copy' ).hide();
$btn.find( '.wp-mail-smtp-notice__icon-check' ).show();
setTimeout( function() {
$btn.find( '.wp-mail-smtp-notice__icon-check' ).hide();
$btn.find( '.wp-mail-smtp-notice__icon-copy' ).show();
}, 2000 );
},
/**
* Click on the dismiss notice button.
*
* @since 4.4.0
*
* @param {object} event Event object.
*/
dismiss: function( event ) {
var $notice = $( this ).closest( '.wp-mail-smtp-notice' );
// If notice key is not defined, we can't dismiss it permanently.
if ( $notice.data( 'notice' ) === undefined ) {
return;
}
var $button = $( this );
$.ajax( {
url: ajaxurl,
dataType: 'json',
type: 'POST',
data: {
action: 'wp_mail_smtp_ajax',
nonce: wp_mail_smtp_admin_notices.nonce,
task: 'notice_dismiss',
notice: $notice.data( 'notice' ),
},
beforeSend: function() {
$button.prop( 'disabled', true );
},
} );
},
};
return app;
}( document, window, jQuery ) );
// Initialize.
WPMailSMTPAdminNotices.init();
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| vendor/ | 2026-07-21 14:14 | 319.87 KB | 76129f60960:kunden | dxwrx-r--r | |
| connect.js | 2026-07-21 14:14 | 3.62 KB | 76129f60960:kunden | -xw-x----- | |
| connect.min.js | 2026-07-21 14:14 | 1.93 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-about.js | 2026-07-21 14:14 | 4.81 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-about.min.js | 2026-07-21 14:14 | 2.4 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-activelayer-wc.js | 2026-07-21 14:14 | 4.04 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-activelayer-wc.min.js | 2026-07-21 14:14 | 1.56 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-admin-notices.js | 2026-07-21 14:14 | 2.1 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-admin-notices.min.js | 2026-07-21 14:14 | 1 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-admin.js | 2026-07-21 14:14 | 42.76 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-admin.min.js | 2026-07-21 14:14 | 21.26 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-ai-mcp.js | 2026-07-21 14:14 | 4.32 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-ai-mcp.min.js | 2026-07-21 14:14 | 1.57 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-code-snippets.js | 2026-07-21 14:14 | 19.52 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-code-snippets.min.js | 2026-07-21 14:14 | 7.46 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-dashboard-widget.js | 2026-07-21 14:14 | 6.58 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-dashboard-widget.min.js | 2026-07-21 14:14 | 3.38 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-notifications.js | 2026-07-21 14:14 | 3.68 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-notifications.min.js | 2026-07-21 14:14 | 1.88 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-recommendations.js | 2026-07-21 14:14 | 7.38 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-recommendations.min.js | 2026-07-21 14:14 | 3.38 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-tools-debug-events.js | 2026-07-21 14:14 | 8.18 KB | 76129f60960:kunden | -xw-x----- | |
| smtp-tools-debug-events.min.js | 2026-07-21 14:14 | 4.06 KB | 76129f60960:kunden | -xw-x----- | |