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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user