Add contact antispam and fix gallery video playback.

English-only messages, rate limiting, min fill time, and normalized email
validation; improve modal video serving with posters, correct MIME types, and
no gzip on gallery media.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-04 00:38:48 +12:00
parent a9095727bf
commit 6c215d40e6
16 changed files with 385 additions and 16 deletions

View File

@@ -70,8 +70,25 @@ templ Layout(title string, preloadImage string, content templ.Component) {
hydrateLazyThumbs(document);
});
function initModalVideos(root) {
root.querySelectorAll(".modal-video video").forEach(function (video) {
var wrap = video.closest(".modal-video");
var notice = wrap && wrap.querySelector(".video-unavailable");
video.addEventListener(
"error",
function () {
video.classList.add("video-broken");
if (notice) notice.hidden = false;
},
{ once: true },
);
video.load();
});
}
document.body.addEventListener("htmx:afterSwap", function (event) {
hydrateLazyThumbs(event.target);
initModalVideos(event.target);
});
})();
</script>