From 42519a776a4db30fc3f0450183e2b4896d521e13 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 8 Oct 2026 13:18:40 +0200 Subject: [PATCH] gallery.js v2: when the last 'next' turns off, focus moves to the close button instead of the page behind (seen in the live check) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012qRErfCoiTkvDK9N5XHbzb --- scripts/test_gate_decoys.py | 2 +- website/CHANGELOG.md | 2 +- website/alkalmazasok.html | 2 +- website/assets/gallery.js | 2 ++ website/en/apps.html | 2 +- website/en/index.html | 2 +- website/en/technology.html | 2 +- website/index.html | 2 +- website/technologiak.html | 2 +- 9 files changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/test_gate_decoys.py b/scripts/test_gate_decoys.py index 78b3d84c..3ae62375 100644 --- a/scripts/test_gate_decoys.py +++ b/scripts/test_gate_decoys.py @@ -555,7 +555,7 @@ decoy("site/viewer-opener-missing-file", "site_gates.py", ''), must="index.html: a data-gallery opener points at a missing file") decoy("site/viewer-openers-no-script", "site_gates.py", - replace_in(_EN("technology.html"), ' \n', ""), + replace_in(_EN("technology.html"), ' \n', ""), must="en/technology.html: 2 picture opener(s) (data-gallery) but no") decoy("site/viewer-inline-copy-back", "site_gates.py", replace_in(os.path.join(_WEB, "alkalmazasok.html"), "", diff --git a/website/CHANGELOG.md b/website/CHANGELOG.md index 0ee4e4da..3ff90767 100644 --- a/website/CHANGELOG.md +++ b/website/CHANGELOG.md @@ -1,7 +1,7 @@ ## 2026-10-08 (late afternoon) — one picture viewer for the whole site - **`assets/gallery.js`** — the viewer that lived twice inline on the two apps pages is one shared file now (`defer`, - `?v=1`), its markup built by the script. The dashboard pictures (home and technology, both languages) open in it too, + `?v=2` — v2 keeps focus inside the viewer when the last „next" turns off), its markup built by the script. The dashboard pictures (home and technology, both languages) open in it too, as one set: Launcher → Apps → an app → Backups. - **A set is declared, not guessed:** every picture is a real ``; an app card's further pictures are hidden links in the card. The old probing for `-screenshot-N.webp` files is gone (no diff --git a/website/alkalmazasok.html b/website/alkalmazasok.html index 13cf1811..afdc051c 100644 --- a/website/alkalmazasok.html +++ b/website/alkalmazasok.html @@ -45,7 +45,7 @@ - + diff --git a/website/assets/gallery.js b/website/assets/gallery.js index 386c5645..34012026 100644 --- a/website/assets/gallery.js +++ b/website/assets/gallery.js @@ -79,6 +79,8 @@ nextBtn.style.display = single ? 'none' : 'flex'; dots.style.display = single ? 'none' : 'flex'; counter.style.display = single ? 'none' : 'block'; + // a button that just turned off would drop the focus to the page behind the viewer + if (document.activeElement && document.activeElement.disabled) closeBtn.focus(); } function go(i) { diff --git a/website/en/apps.html b/website/en/apps.html index dde0b888..9579db45 100644 --- a/website/en/apps.html +++ b/website/en/apps.html @@ -45,7 +45,7 @@ - + diff --git a/website/en/index.html b/website/en/index.html index 65e29708..7bbcc285 100644 --- a/website/en/index.html +++ b/website/en/index.html @@ -56,7 +56,7 @@ - + diff --git a/website/en/technology.html b/website/en/technology.html index 9dce2a5f..7714ed43 100644 --- a/website/en/technology.html +++ b/website/en/technology.html @@ -40,7 +40,7 @@ - + diff --git a/website/index.html b/website/index.html index 70a930e9..0778ab6b 100644 --- a/website/index.html +++ b/website/index.html @@ -56,7 +56,7 @@ - + diff --git a/website/technologiak.html b/website/technologiak.html index 292edb1a..5573b2be 100644 --- a/website/technologiak.html +++ b/website/technologiak.html @@ -40,7 +40,7 @@ - +