ui: hide control footer in fullscreen; toggle fullscreen with the F key
The grid/archive control bar is hidden while its frame is fullscreen, so the video fills the screen cleanly. A global F-key handler toggles fullscreen of the active frame (live-main or arch-content) — entered and exited with F, and exited with Esc as well. Uses e.code (KeyF) so it works on non-Latin layouts and ignores typing in inputs and Ctrl/Cmd/Alt combos. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -281,6 +281,20 @@ function toggleFullscreen(el) {
|
||||
}
|
||||
}
|
||||
|
||||
// Клавиша F — переключить полноэкранный режим фрейма (live-main / arch-content).
|
||||
// Esc выходит нативно. e.code (физическая клавиша) — работает и в русской раскладке.
|
||||
function bindFullscreenKey() {
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if (e.code !== "KeyF" || e.ctrlKey || e.metaKey || e.altKey) return;
|
||||
const t = e.target;
|
||||
if (t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable)) return;
|
||||
const frame = document.getElementById("live-main") || document.getElementById("arch-content");
|
||||
if (!frame) return;
|
||||
e.preventDefault();
|
||||
toggleFullscreen(frame);
|
||||
});
|
||||
}
|
||||
|
||||
// умеет ли браузер декодировать HEVC (H.265) сам — для нативного просмотра
|
||||
let _hevc = null;
|
||||
function hevcSupported() {
|
||||
@@ -2197,6 +2211,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||
ensureFooter(); // создаёт футер с #sys-stats/#clock до их заполнения
|
||||
startClock();
|
||||
bindLogout();
|
||||
bindFullscreenKey();
|
||||
refreshStats(); setInterval(refreshStats, 5000);
|
||||
applyGridMenuLimit();
|
||||
const page = document.body.dataset.page;
|
||||
|
||||
Reference in New Issue
Block a user