Add production installer and observability tooling

This commit is contained in:
2026-05-07 12:11:15 -03:00
parent a19ac9f00c
commit 5d92a6c99a
30 changed files with 3493 additions and 1015 deletions
+53
View File
@@ -0,0 +1,53 @@
(function () {
class Modal {
constructor(element) {
this.element = element;
this.onBackdropClick = this.onBackdropClick.bind(this);
this.onKeydown = this.onKeydown.bind(this);
}
show() {
this.element.classList.add("show");
this.element.setAttribute("aria-hidden", "false");
document.body.style.overflow = "hidden";
this.element.addEventListener("click", this.onBackdropClick);
document.addEventListener("keydown", this.onKeydown);
}
hide() {
this.element.classList.remove("show");
this.element.setAttribute("aria-hidden", "true");
document.body.style.overflow = "";
this.element.removeEventListener("click", this.onBackdropClick);
document.removeEventListener("keydown", this.onKeydown);
}
onBackdropClick(event) {
if (event.target === this.element || event.target.closest("[data-bs-dismiss='modal']")) {
this.hide();
}
}
onKeydown(event) {
if (event.key === "Escape") {
this.hide();
}
}
}
function installAlertDismiss() {
document.addEventListener("click", (event) => {
const button = event.target.closest("[data-bs-dismiss='alert']");
if (!button) {
return;
}
const alert = button.closest(".alert");
if (alert) {
alert.remove();
}
});
}
installAlertDismiss();
window.bootstrap = { Modal };
})();