From aaf9f9d56a59a3770d94da1411dbd3b31462d4c1 Mon Sep 17 00:00:00 2001 From: Myron Blair Date: Sun, 21 Jun 2026 05:03:56 +0000 Subject: [PATCH] =?UTF-8?q?revert:=20restore=20safe=20JS,=20keep=20only=20?= =?UTF-8?q?kiosk-mode=20CSS=20class=20toggle=20=E2=80=94=20voice=20patches?= =?UTF-8?q?=20caused=20JS=20crash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public_html/assets/js/jarvis-app.js | 15 +++++---------- public_html/assets/js/jarvis-overlays.js | 1 - public_html/index.html | 14 +++++++------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/public_html/assets/js/jarvis-app.js b/public_html/assets/js/jarvis-app.js index 97d347a..2c3c70c 100644 --- a/public_html/assets/js/jarvis-app.js +++ b/public_html/assets/js/jarvis-app.js @@ -161,7 +161,7 @@ function showApp(name, greeting, silent = false) { } }, 30000); setInterval(() => { - if (voiceMode && !document.body.classList.contains("kiosk-mode") && voiceLastCmd > 0 && Date.now() - voiceLastCmd > VOICE_SLEEP_MS) { + if (voiceMode && voiceLastCmd > 0 && Date.now() - voiceLastCmd > VOICE_SLEEP_MS) { exitVoiceMode(); } }, 60000); @@ -1322,15 +1322,11 @@ function initVoice() { // Sleeping: ONLY respond to master wake phrases if (isAsleep) { if (WAKE_PHRASES.some(p => lc.includes(p))) wakeFromSleep(); - // In kiosk mode: wake word also wakes from sleep - if (document.body.classList.contains("kiosk-mode")) { wakeFromSleep(); } - else return; + return; } if (!voiceMode) { if (WAKE_PHRASES.some(p => lc.includes(p))) enterVoiceMode(); - // Kiosk: any speech enters conversation mode - else if (document.body.classList.contains("kiosk-mode") && transcript.length > 2) enterVoiceMode("kiosk"); } else if (!voiceMuted) { voiceLastCmd = Date.now(); voiceActive = Date.now(); @@ -1803,16 +1799,14 @@ async function toggleKiosk() { if (activeTab && (activeTab.id === "tab-agents" || activeTab.id === "tab-guardian")) { switchTab("intel"); } + document.body.classList.add("kiosk-mode"); if (btn) { btn.textContent = "⧞ EXIT"; btn.style.color = "var(--cyan)"; } - // Kiosk: auto-start mic and enter always-on conversation mode - if (isAsleep) wakeFromSleep(); - if (!voiceMode) enterVoiceMode("kiosk"); - if (!isListening) { isListening = true; updateMicBtn(); if (recognition) try { recognition.start(); } catch(_) {} } } else { const ex = document.exitFullscreen || document.webkitExitFullscreen || document.mozCancelFullScreen || document.msExitFullscreen; if (ex) ex.call(document).catch(() => {}); if (_wakeLock) { _wakeLock.release().catch(() => {}); _wakeLock = null; } document.body.classList.remove("kiosk-mode"); + document.body.classList.remove("kiosk-mode"); if (btn) { btn.textContent = "⧞ KIOSK"; btn.style.color = ""; } if (!isTablet()) document.body.classList.remove("tablet-mode"); } @@ -1829,6 +1823,7 @@ function _onFsChange() { if (!document.fullscreenElement && !document.webkitFullscreenElement) { if (_wakeLock) { _wakeLock.release().catch(() => {}); _wakeLock = null; } document.body.classList.remove("kiosk-mode"); + document.body.classList.remove("kiosk-mode"); if (btn) { btn.textContent = "⧞ KIOSK"; btn.style.color = ""; } if (!isTablet()) document.body.classList.remove("tablet-mode"); } diff --git a/public_html/assets/js/jarvis-overlays.js b/public_html/assets/js/jarvis-overlays.js index ce78959..18df4b7 100644 --- a/public_html/assets/js/jarvis-overlays.js +++ b/public_html/assets/js/jarvis-overlays.js @@ -6,7 +6,6 @@ var SLEEP_CMDS = /\b(good\s*night(\s*jarvis)?|go\s*to\s*sleep|sleep\s*mode|shut\ function enterSleepMode() { if (isAsleep) return; - if (document.body.classList.contains("kiosk-mode")) return; // never sleep in kiosk isAsleep = true; // Pause voice mode diff --git a/public_html/index.html b/public_html/index.html index 6b71717..e488659 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -6,7 +6,7 @@ JARVIS — Integrated Defense and Logistics System - + @@ -426,12 +426,12 @@ style="position:fixed;top:-9999px;left:-9999px;width:320px;height:240px"> - - - - - - + + + + + +