diff --git a/install_kiosk_v0.9.14.sh b/install_kiosk_v0.9.15.sh similarity index 99% rename from install_kiosk_v0.9.14.sh rename to install_kiosk_v0.9.15.sh index d4c5c0d..d98da5e 100644 --- a/install_kiosk_v0.9.14.sh +++ b/install_kiosk_v0.9.15.sh @@ -1,9 +1,19 @@ #!/bin/bash ################################################################################ -### Ubuntu Based Kiosk (UBK) v0.9.14 ### +### Ubuntu Based Kiosk (UBK) v0.9.15 ### ################################################################################ # -# RELEASE v0.9.14 - Restore Simpler Working Logic +# RELEASE v0.9.15 - Interaction-Based Return to Rotation Popup +# +# What's in v0.9.15: +# - Return to rotation popup now appears on ANY user interaction +# * Any touch, click, scroll, or keyboard input triggers the popup +# * Exception: popup does NOT appear when media is playing +# * Gives users immediate option to extend time on current URL +# - Time extension options remain the same (15/30/60/120 minutes) +# - Popup pauses rotation while displayed +# - Popup appears once per site load (won't spam on every interaction) +# - Manual navigation and automatic rotation both trigger popup on interaction # # What's in v0.9.14: # - Reverted to simpler, working logic from v09.9.1_7 @@ -157,7 +167,7 @@ set -euo pipefail ### SECTION 1: CONSTANTS & GLOBALS ################################################################################ -SCRIPT_VERSION="0.9.10" +SCRIPT_VERSION="0.9.15" KIOSK_USER="kiosk" BUILD_USER="${SUDO_USER:-$(whoami)}" KIOSK_HOME="/home/${KIOSK_USER}" @@ -3605,7 +3615,7 @@ const path=require('path'); const os=require('os'); const CONFIG_FILE=path.join(__dirname,'config.json'); -const VERSION='0.9.14'; +const VERSION='0.9.15'; let mainWindow,views=[],hiddenViews=[],tabs=[],currentIndex=0,showingHidden=false; let pinWindow=null,promptWindow=null,htmlKeyboardWindow=null; @@ -3626,6 +3636,7 @@ let mediaIsPlaying=false; let userRecentlyActive=false; let keyboardIsOpen=false; let keyboardClosePending=false; +let popupShownForCurrentSite=false; const USER_ACTIVITY_PAUSE=60000; const KEYBOARD_AUTO_CLOSE=30000; @@ -3705,6 +3716,14 @@ function markActivity(resetLockoutTimer){ promptWindow=null; } + // v0.9.15: Show return to rotation popup on first interaction with site + // Exception: Don't show if media is playing or session is locked + if(!popupShownForCurrentSite&&!mediaIsPlaying&&!sessionLocked&&timeSinceLastActivity>5000){ + console.log('[ACTIVITY] đ First interaction with site - showing return to rotation popup'); + popupShownForCurrentSite=true; + showInactivityPrompt(); + } + // CRITICAL FIX: Don't clear time extensions on user activity! // Extensions should only be cleared when: // 1. They naturally expire @@ -4056,6 +4075,9 @@ function attachView(i,isAutoRotation){ views[i].webContents.focus(); siteStartTime=Date.now(); + + // v0.9.15: Reset popup flag when site changes + popupShownForCurrentSite=false; } function nextTab(){ @@ -5248,9 +5270,9 @@ echo "[15/27] Creating inactivity prompt..."