add missing js changes when editing domains; set version to 2.2.6 for upcoming release

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2025-03-08 11:37:50 +01:00
parent 8f5bd789a4
commit 5afc5272d1
4 changed files with 39 additions and 2 deletions

View File

@@ -67,6 +67,38 @@ export default function () {
});
}
// show warning if emaildomain option is set to disabled but was enabled
if ($('input[name=emaildomainverified]')) {
$('input[name=emaildomainverified]').on('click', function () {
$('#emaildomainnote').remove();
$('#isemaildomain').removeClass('is-invalid');
$('#emaildomainverified').val(0);
const cFileName = window.location.pathname.substring(window.location.pathname.lastIndexOf("/")+1);
$.ajax({
url: cFileName + "?page=overview&action=jqEmaildomainNote",
type: "POST",
data: {
id: $('input[name=id]').val(), newval: +$('#isemaildomain').is(':checked')
},
dataType: "json",
async: false,
beforeSend: function (request) {
request.setRequestHeader('X-CSRF-TOKEN', document.querySelector('meta[name="csrf-token"]').getAttribute('content'));
},
success: function (json) {
if (json.changed) {
$('#isemaildomain').addClass('is-invalid');
$('#isemaildomain').parent().append(json.info);
$('#emaildomainverified').val(1);
}
},
error: function (a, b) {
console.log(a, b);
}
});
});
}
/**
* email only domain - hide unnecessary/unused sections
*/