This commit is contained in:
Javier Casares 2026-01-29 09:57:28 +00:00
commit be6f679724
2 changed files with 13721 additions and 5952 deletions

View file

@ -1,22 +1,22 @@
.robotstxt-smtp-tools .card {
width: 100%;
max-width: 100%;
box-sizing: border-box;
}
.robotstxt-smtp-tools .robotstxt-smtp-tool-empty {
margin-top: 1em;
}
.robotstxt-smtp-tools .robotstxt-smtp-tool-meta {
margin: 1em 0;
font-style: italic;
}
.robotstxt-smtp-tools .robotstxt-smtp-tool-actions {
margin: 1em 0;
}
.robotstxt-smtp-tools .robotstxt-smtp-tool-result {
margin-top: 1.5em;
}
.robotstxt-smtp-tools .card {
width: 100%;
max-width: 100%;
box-sizing: border-box;
}
.robotstxt-smtp-tools .robotstxt-smtp-tool-empty {
margin-top: 1em;
}
.robotstxt-smtp-tools .robotstxt-smtp-tool-meta {
margin: 1em 0;
font-style: italic;
}
.robotstxt-smtp-tools .robotstxt-smtp-tool-actions {
margin: 1em 0;
}
.robotstxt-smtp-tools .robotstxt-smtp-tool-result {
margin-top: 1.5em;
}

View file

@ -1,52 +1,52 @@
/**
* Admin UI behavior for Robotstxt SMTP settings.
*
* @package RobotstxtSMTP
*/
(function () {
'use strict';
var initializeAdmin = function () {
var security = document.getElementById( 'robotstxt_smtp_security' );
var port = document.getElementById( 'robotstxt_smtp_port' );
if ( ! security || ! port) {
return;
}
var defaultPorts = {
none: 25,
ssl: 465,
tls: 587
};
var previousValue = security.value || 'none';
security.addEventListener(
'change',
function () {
var newValue = security.value || 'none';
var previousDefault = Object.prototype.hasOwnProperty.call( defaultPorts, previousValue )
? defaultPorts[previousValue]
: null;
var newDefault = Object.prototype.hasOwnProperty.call( defaultPorts, newValue )
? defaultPorts[newValue]
: null;
var currentPort = parseInt( port.value, 10 );
if ( ! Number.isNaN( currentPort ) && null !== previousDefault && currentPort === previousDefault && null !== newDefault) {
port.value = newDefault;
}
previousValue = newValue;
}
);
};
if ('loading' !== document.readyState) {
initializeAdmin();
} else {
document.addEventListener( 'DOMContentLoaded', initializeAdmin );
}
})();
/**
* Admin UI behavior for Robotstxt SMTP settings.
*
* @package RobotstxtSMTP
*/
(function () {
'use strict';
var initializeAdmin = function () {
var security = document.getElementById( 'robotstxt_smtp_security' );
var port = document.getElementById( 'robotstxt_smtp_port' );
if ( ! security || ! port) {
return;
}
var defaultPorts = {
none: 25,
ssl: 465,
tls: 587
};
var previousValue = security.value || 'none';
security.addEventListener(
'change',
function () {
var newValue = security.value || 'none';
var previousDefault = Object.prototype.hasOwnProperty.call( defaultPorts, previousValue )
? defaultPorts[previousValue]
: null;
var newDefault = Object.prototype.hasOwnProperty.call( defaultPorts, newValue )
? defaultPorts[newValue]
: null;
var currentPort = parseInt( port.value, 10 );
if ( ! Number.isNaN( currentPort ) && null !== previousDefault && currentPort === previousDefault && null !== newDefault) {
port.value = newDefault;
}
previousValue = newValue;
}
);
};
if ('loading' !== document.readyState) {
initializeAdmin();
} else {
document.addEventListener( 'DOMContentLoaded', initializeAdmin );
}
})();