From bdf3ad085fcd9d37e3c44d33adb05dd215171df7 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Fri, 27 Mar 2026 14:22:11 -0400 Subject: [PATCH] audit pass 14: type=button on JS-generated button HTML strings Add type="button" to all buttons created via innerHTML in JS: - Lightbox close/prev/next buttons (3 instances) - Pagination prev/page/ellipsis/next buttons (7 instances) Co-Authored-By: Claude Sonnet 4.6 --- base.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/base.js b/base.js index 24867a6..37c4182 100644 --- a/base.js +++ b/base.js @@ -2538,9 +2538,9 @@ _overlay.setAttribute('aria-modal', 'true'); _overlay.setAttribute('aria-label', 'Image viewer'); _overlay.innerHTML = ` - - - + + +
@@ -2791,7 +2791,7 @@ const pages = _pages(); let html = ''; // Prev - html += ``; + html += ``; // Page buttons with ellipsis const half = Math.floor((maxBtns - 2) / 2); let start = Math.max(2, page - half); @@ -2800,15 +2800,15 @@ if (start === 2) end = Math.min(pages - 1, start + maxBtns - 3); else start = Math.max(2, end - maxBtns + 3); } - html += ``; - if (start > 2) html += ``; + html += ``; + if (start > 2) html += ``; for (let i = start; i <= end; i++) { - html += ``; + html += ``; } - if (end < pages - 1) html += ``; - if (pages > 1) html += ``; + if (end < pages - 1) html += ``; + if (pages > 1) html += ``; // Next - html += ``; + html += ``; if (!nav.getAttribute('role')) nav.setAttribute('role', 'navigation'); if (!nav.getAttribute('aria-label')) nav.setAttribute('aria-label', 'Pagination'); nav.innerHTML = html;