From 2dd0922a63db57d6383bbd16eb6867f8ce767cb5 Mon Sep 17 00:00:00 2001 From: juanatsap Date: Tue, 2 Dec 2025 15:52:33 +0000 Subject: [PATCH] refactor: replace verbose JS with hyperscript for contact form timestamp Removed 34 lines of JavaScript (IIFE, MutationObserver, DOMContentLoaded) and replaced with 2 lines of hyperscript in the existing 'on show' handler. --- templates/partials/modals/contact-modal.html | 38 +++----------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/templates/partials/modals/contact-modal.html b/templates/partials/modals/contact-modal.html index 46c2726..3c86521 100644 --- a/templates/partials/modals/contact-modal.html +++ b/templates/partials/modals/contact-modal.html @@ -15,7 +15,10 @@ remove .hidden from querySelector('.form-note') in form set responseDiv to getElementById('contact-response') if responseDiv set responseDiv.innerHTML to '' - end"> + end + -- Set timestamp for bot protection + set tsField to getElementById('contact-form-loaded-at') + if tsField set tsField.value to Date.now()">
- - {{end}}