From 730c4e6419e24807d5f1e0a79931b3e0a78bd60b Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 7 May 2026 09:45:04 +0300 Subject: h1 fix browser auth theme shortcuts QA --- docs/keyboard-shortcuts.md | 5 ++--- start.sh | 2 +- web/index.html | 8 +++++--- web/js/api.js | 7 ++++++- web/js/app.js | 4 ++++ web/js/keyboard.js | 12 +----------- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/keyboard-shortcuts.md b/docs/keyboard-shortcuts.md index cbf0cca..7e46209 100644 --- a/docs/keyboard-shortcuts.md +++ b/docs/keyboard-shortcuts.md @@ -15,8 +15,7 @@ Global shortcuts are registered in `web/js/keyboard.js`. They are **disabled** w | `f` | Toggle fullscreen on the player wrapper | | `Esc` | Exit fullscreen, or deselect current item | | `r` | Toggle shuffle on the current filtered result set | -| `s` | Toggle sets sidebar | -| `S` | Generate a share link for the selected media | +| `s` | Generate a share link for the selected media | | `/` | Focus the quick search bar (debounced) | | `n` | Open notes modal for the selected media | | `i` | Show / hide media info | @@ -31,4 +30,4 @@ Global shortcuts are registered in `web/js/keyboard.js`. They are **disabled** w Search syntax: plain text searches file name. Modifiers: `min:30`, `max:55`, `tag:a,b`, `like:1`, `type:video`, `sort:random`, `minsize:10`, `maxsize:500`. -My Shares modal: `↑` / `↓` or `k` / `j` navigate, `Enter` copies, `Delete` revokes, `Esc` closes. \ No newline at end of file +My Shares modal: `↑` / `↓` or `k` / `j` navigate, `Enter` copies, `Delete` revokes, `Esc` closes. diff --git a/start.sh b/start.sh index 82a3513..5a70392 100755 --- a/start.sh +++ b/start.sh @@ -96,7 +96,7 @@ echo "Ready. Open ${BASEURL} in your browser." echo "Login: test / test123" echo "" echo "Quick tips:" -echo " s -- show/hide sets sidebar" +echo " s -- share selected media" echo " t -- show/hide toolbar" echo " / -- search" echo " ? -- help" diff --git a/web/index.html b/web/index.html index f44da8e..15c41ec 100644 --- a/web/index.html +++ b/web/index.html @@ -20,7 +20,10 @@ Scanning + + + @@ -58,7 +61,7 @@

Welcome to Player

-

Press s to browse sets, / to search, or ? for help.

+

Use the sets button to browse, / to search, or ? for help.

@@ -144,8 +147,7 @@
qStop playback and close player
BackspaceGo up one folder
rToggle shuffle
-
sToggle sets sidebar
-
SShare selected media
+
sShare selected media
+ Zoom in / out (image viewer)
Shift+SToggle slideshow (images)
cToggle crop mode (fullscreen)
diff --git a/web/js/api.js b/web/js/api.js index 28954a1..66fac59 100644 --- a/web/js/api.js +++ b/web/js/api.js @@ -17,11 +17,16 @@ async function api(path, options = {}) { if (res.status === 204) return null; if (res.status === 401) { + let msg = 'Unauthorized'; + try { + const j = await res.json(); + if (j.error) msg = j.error; + } catch {} const p = location.pathname; if (!p.includes('login') && !p.includes('bootstrap')) { location.href = '/login.html'; } - throw new Error('Unauthorized'); + throw new Error(msg); } if (!res.ok) { let msg = res.statusText; diff --git a/web/js/app.js b/web/js/app.js index ee515af..b673d91 100644 --- a/web/js/app.js +++ b/web/js/app.js @@ -310,6 +310,10 @@ function keyboardHandlers() { } function initChrome() { + document.getElementById('sidebar-toggle')?.addEventListener('click', () => { + toggleSidebar(); + }); + document.getElementById('menu-close')?.addEventListener('click', () => { document.getElementById('sidebar')?.classList.remove('open'); document.querySelector('.page')?.classList.remove('has-sidebar'); diff --git a/web/js/keyboard.js b/web/js/keyboard.js index 53ee3d0..49fa358 100644 --- a/web/js/keyboard.js +++ b/web/js/keyboard.js @@ -95,16 +95,6 @@ export function initKeyboard(handlers) { e.target.blur(); handlers.escape?.(e); } - if (e.key === 'ArrowDown' || e.key === 'j') { - e.target.blur(); - e.preventDefault(); - document.getElementById('media-grid')?.focus(); - handlers.navDown?.(e); - } - if (e.key === '?') { - e.preventDefault(); - handlers.searchHelp?.(e); - } return; } @@ -172,7 +162,7 @@ export function initKeyboard(handlers) { handlers.share?.(e); } } else { - handlers.sidebar?.(e); + handlers.share?.(e); } return; } -- cgit v1.2.3