feat(launcher): URL params to control iframe/menu/header/footer visibility
Allows sharing a clean link that auto-configures display state on any
device — no manual setup required, ideal for tablet PWA kiosk deployment.
All four params are optional and independent. Values persist in
localStorage so they survive reloads; the URL param always wins when
present. Read inside the existing reactive URL-sync $effect, which
fires on every SPA navigation (unlike the root onMount which only
fires once on initial load).
Supported params:
?iframe=true/false — hide/show global sys & debug menus
?launcher_menu=hide/show — hide/show left session/location panel
?launcher_header=hide/show — hide/show 'Æ Launcher v3' header bar
?launcher_footer=hide/show — hide/show the status footer
Example clean poster-kiosk link:
/events/{id}/launcher/{loc_id}?session_id={sess_id}
&iframe=true&launcher_menu=hide&launcher_header=hide
This commit is contained in:
@@ -95,6 +95,28 @@
|
||||
const path_location_id = data.params.event_location_id;
|
||||
const path_event_id = data.params.event_id;
|
||||
|
||||
// WHY: URL params for display overrides — lets you share a clean link
|
||||
// (e.g. tablet PWA, digital poster kiosk) without the recipient needing
|
||||
// to configure settings manually on their device.
|
||||
// These are read on every URL change (reactive to SPA navigation), which
|
||||
// is better than the root layout's onMount which only fires once on load.
|
||||
// Values persist in localStorage so they survive page reloads within the
|
||||
// same device; the URL param always wins when present.
|
||||
//
|
||||
// Supported params:
|
||||
// ?iframe=true/false — hide/show global sys & debug menus
|
||||
// ?launcher_menu=hide/show — hide/show left session/location panel
|
||||
// ?launcher_header=hide/show — hide/show "Æ Launcher v3" header bar
|
||||
// ?launcher_footer=hide/show — hide/show the status footer
|
||||
//
|
||||
// Example clean poster-kiosk link:
|
||||
// /events/{id}/launcher/{loc_id}?session_id={sess_id}
|
||||
// &iframe=true&launcher_menu=hide&launcher_header=hide
|
||||
const param_iframe = data.url.searchParams.get('iframe');
|
||||
const param_launcher_menu = data.url.searchParams.get('launcher_menu');
|
||||
const param_launcher_header = data.url.searchParams.get('launcher_header');
|
||||
const param_launcher_footer = data.url.searchParams.get('launcher_footer');
|
||||
|
||||
if (log_lvl > 1) {
|
||||
console.log(`[Launcher Sync] URL Change: event=${path_event_id}, loc=${path_location_id}, sess=${url_session_id}`);
|
||||
}
|
||||
@@ -111,6 +133,19 @@
|
||||
if (log_lvl) console.log(`[Launcher Sync] Updating store session_id: ${url_session_id}`);
|
||||
$events_slct.event_session_id = url_session_id;
|
||||
}
|
||||
|
||||
// Apply display overrides from URL params (when present)
|
||||
if (param_iframe === 'true') $ae_loc.iframe = true;
|
||||
else if (param_iframe === 'false') $ae_loc.iframe = false;
|
||||
|
||||
if (param_launcher_menu === 'hide') $events_loc.launcher.hide__launcher_menu = true;
|
||||
else if (param_launcher_menu === 'show') $events_loc.launcher.hide__launcher_menu = false;
|
||||
|
||||
if (param_launcher_header === 'hide') $events_loc.launcher.hide__launcher_header = true;
|
||||
else if (param_launcher_header === 'show') $events_loc.launcher.hide__launcher_header = false;
|
||||
|
||||
if (param_launcher_footer === 'hide') $events_loc.launcher.hide__launcher_footer = true;
|
||||
else if (param_launcher_footer === 'show') $events_loc.launcher.hide__launcher_footer = false;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user