feat(main): Add alert type; add template override support

This commit is contained in:
2026-08-13 15:31:23 +02:00
parent ce480314f3
commit 34fb95a699
18 changed files with 202 additions and 8 deletions
+26
View File
@@ -0,0 +1,26 @@
document.addEventListener('DOMContentLoaded', function () {
document.querySelectorAll('.customhtml-alert').forEach(function (alertEl) {
var timeout = parseInt(alertEl.getAttribute('data-timeout'), 10) || 0;
var timer = null;
var dismiss = function () {
alertEl.classList.add('customhtml-alert-collapsing');
};
if (timeout > 0) {
timer = setTimeout(dismiss, timeout * 1000);
}
var closeButton = alertEl.querySelector('.customhtml-alert-close');
if (closeButton) {
closeButton.addEventListener('click', function () {
if (timer) {
clearTimeout(timer);
}
dismiss();
});
}
});
});