From 5f33ff846861846edca94b0c45319b8f7b31badc Mon Sep 17 00:00:00 2001 From: Johannes Date: Wed, 6 May 2026 03:51:33 +0200 Subject: [PATCH] persist site dropdown selection via _site url param --- .gitignore | 2 ++ templates/slideshow.html | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/.gitignore b/.gitignore index 4bc9495..137f09e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ Pictures/* !Pictures/.gitkeep +Previews/* +!Previews/.gitkeep .env booru.db \ No newline at end of file diff --git a/templates/slideshow.html b/templates/slideshow.html index c7b896d..75c2bfc 100644 --- a/templates/slideshow.html +++ b/templates/slideshow.html @@ -125,6 +125,17 @@ form.submit(); }; + const _site_param = new URLSearchParams(window.location.search).get('_site'); + if (_site_param) { + const sel = document.getElementById('site-select'); + if (sel) sel.value = _site_param; + } + document.getElementById('site-select').addEventListener('change', function() { + const p = new URLSearchParams(window.location.search); + p.set('_site', this.value); + history.replaceState(null, '', '?' + p.toString()); + }); + const job_id = new URLSearchParams(window.location.search).get('job_id'); if (job_id) { const box = document.getElementById('progress-box'); @@ -202,6 +213,7 @@ const _params = new URLSearchParams(window.location.search); const _url_idx = parseInt(_params.get('idx') || '0', 10); let i = (_url_idx > 0 && _url_idx < images.length) ? _url_idx : 0; + let playing=false, timer=null; let shuffled = false; let order = [...Array(images.length).keys()];