mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-14 15:49:31 -07:00
Add "Sticky Kiosk" setting that stores "Kiosk" mode when activate
- This setting is important to allow creation ofa Home Screen app on iOS/iPadOS - If kiosk mode is accidentally made sticky, it can be cleared by adding '&kiosk=false` to the URL - Ctrl-K will now also exit kiosk mode This adds a `stickyRead` parameter to settings, that means "read it if it's there, but don't write it"
This commit is contained in:
@@ -26,6 +26,13 @@ const kioskChange = (value) => {
|
||||
window.dispatchEvent(new Event('resize'));
|
||||
} else {
|
||||
body.classList.remove('kiosk');
|
||||
window.dispatchEvent(new Event('resize'));
|
||||
}
|
||||
|
||||
// Conditionally store the kiosk setting based on the "Sticky Kiosk" setting
|
||||
// (Need to check if the method exists to handle initialization race condition)
|
||||
if (settings.kiosk?.conditionalStoreToLocalStorage) {
|
||||
settings.kiosk.conditionalStoreToLocalStorage(value, settings.stickyKiosk?.value);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -95,6 +102,12 @@ const init = () => {
|
||||
defaultValue: false,
|
||||
changeAction: kioskChange,
|
||||
sticky: false,
|
||||
stickyRead: true,
|
||||
});
|
||||
settings.stickyKiosk = new Setting('stickyKiosk', {
|
||||
name: 'Sticky Kiosk',
|
||||
defaultValue: false,
|
||||
sticky: true,
|
||||
});
|
||||
settings.speed = new Setting('speed', {
|
||||
name: 'Speed',
|
||||
|
||||
Reference in New Issue
Block a user