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,20 @@
function slugify(str) {
return str
.trim()
.toLowerCase()
.replace(/[^a-z0-9 -]/g, '') // Remove non-alphanumeric characters
.replace(/\s+/g, '-') // Replace spaces with hyphens
.replace(/-+/g, '-'); // Remove consecutive hyphens
}
document.addEventListener("DOMContentLoaded", function () {
document.querySelectorAll("[data-slugify]").forEach(input => {
input.addEventListener("input", function () {
const targetId = this.getAttribute("data-slugify");
const targetInput = document.getElementById(targetId);
if (targetInput) {
targetInput.value = slugify(this.value);
}
});
});
});