Content Security Policy (CSP) compatibility beta.

This commit is contained in:
2026-06-20 00:21:19 +02:00
parent 0b76255cfa
commit 8b742d997c
68 changed files with 1632 additions and 1421 deletions

View File

@@ -0,0 +1,40 @@
document.addEventListener("DOMContentLoaded", async function () {
try {
const response = await fetch("/api/v1/frontend/response/");
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
if (!Object.keys(data).length) {
return;
}
const title = Object.keys(data)[0];
const messageKey = data[title];
$.notify({
icon: "fa fa-bell",
title: title.charAt(0).toUpperCase() + title.slice(1),
message: __(messageKey)
}, {
type: title === "error" ? "danger" : title,
placement: {
from: "top",
align: "right"
},
delay: 3000
});
if ($.fn.select2) {
$("#multiple").select2({
theme: "bootstrap"
});
}
} catch (err) {
console.error("Failed to retrieve response message:", err);
}
});