Trying to make things work better...

This commit is contained in:
Scott Idem
2024-03-26 14:24:35 -04:00
parent 040e1e71e3
commit 4d486a580c
22 changed files with 508 additions and 410 deletions

View File

@@ -52,8 +52,6 @@ storePopup.set({ computePosition, autoUpdate, flip, shift, offset, arrow });
import { api } from '$lib/api';
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
$ae_loc = data.ae_loc;
$ae_api = data.ae_api;
import { events_loc, events_slct } from '$lib/ae_events_stores';
import type { key_val } from '$lib/ae_stores';
// console.log($ae_loc, $ae_sess, $ae_api);
@@ -62,11 +60,11 @@ import Element_access_type from '$lib/element_access_type.svelte';
import Element_app_cfg from '$lib/element_app_cfg.svelte';
import Element_data_store from '$lib/element_data_store.svelte';
// Quickly save the data passed from the parent to the Svelte stores.
$ae_loc = data.ae_loc;
$ae_api = data.ae_api;
if (data.url.searchParams.get('event_id')) {
$events_slct.event_id = data.url.searchParams.get('event_id');
$events_loc.event_id = data.url.searchParams.get('event_id');
} else if ($ae_loc.site_cfg_json.slct__event_id) {
if ($ae_loc.site_cfg_json.slct__event_id) {
$events_slct.event_id = $ae_loc.site_cfg_json.slct__event_id;
$events_loc.event_id = $ae_loc.site_cfg_json.slct__event_id;
} else if ($events_slct.event_id) {
@@ -79,11 +77,23 @@ if (data.url.searchParams.get('event_id')) {
console.log(`No Event ID set.`);
}
// We want to loop through all of the data store (ds) key value pairs and set them to localStorage
if (data.ae_ds) {
for (let [key, value] of Object.entries(data.ae_ds)) {
console.log(`ae_ds__ key: ${key}, value:`, value);
localStorageStore(`ae_ds__${key}`, value);
}
}
onMount(() => {
// console.log('Root: +layout.svelte');
if ($ae_loc.iframe) {
let iframe = data.url.searchParams.get('iframe');
if (iframe == 'true') {
console.log('Use iframe layout!');
// data_struct['iframe'] = iframe;
$ae_loc.iframe = true;
document.getElementsByTagName('html')[0].classList.add('iframe');
document.getElementsByTagName('html')[0].classList.remove('dark');
@@ -91,13 +101,29 @@ onMount(() => {
$ae_loc.hub.show_element__access_type = false;
$ae_loc.hub.show_element__cfg = false;
} else if ($ae_loc.trusted_access) {
} else if (iframe == 'false') {
// data_struct['iframe'] = false;
$ae_loc.iframe = false;
document.getElementsByTagName('html')[0].classList.remove('iframe');
document.getElementsByTagName('html')[0].classList.add('light');
}
if (!$ae_loc.iframe && $ae_loc.trusted_access) {
$ae_loc.hub.show_element__access_type = true;
$ae_loc.hub.show_element__cfg = true;
} else if ($ae_loc.iframe && $ae_loc.administrator_access) {
$ae_loc.hub.show_element__access_type = true;
$ae_loc.hub.show_element__cfg = true;
} else {
$ae_loc.hub.show_element__access_type = true;
$ae_loc.hub.show_element__cfg = false;
}
if (data.url.searchParams.get('event_id')) {
$events_slct.event_id = data.url.searchParams.get('event_id');
$events_loc.event_id = data.url.searchParams.get('event_id');
}
});
@@ -171,17 +197,9 @@ $: if ($slct_trigger == 'set_access_code_li' && !$ae_loc.ds['hub__page__access_c
ds_type="html"
display="block"
/>
<!-- {#if $ae_loc.ds['hub__page__appshell_header_lead']}
{@html $ae_loc.ds['hub__page__appshell_header_lead']}
{:else}
<a href="/" class="btn variant-gradiant-surface text-xl">
<span class="fas fa-laptop-house mx-1"></span> &AElig; Home
</a>
{/if} -->
</svelte:fragment>
<!-- OSIT's Aether App -->
<!-- {@html $ae_loc.ds['hub__site__appshell_header']} -->
<Element_data_store
ds_code="hub__site__appshell_header"
ds_type="html"
@@ -193,36 +211,6 @@ $: if ($slct_trigger == 'set_access_code_li' && !$ae_loc.ds['hub__page__access_c
ds_type="html"
display="block"
/>
<!-- {#if $ae_loc.ds['hub__page__appshell_header_trail']}
{@html $ae_loc.ds['hub__page__appshell_header_trail']}
{:else}
<a
class="btn btn-sm variant-ghost-surface"
href="/testing"
>
Testing X
</a>
<a
class="btn btn-sm variant-ghost-surface"
class:active={$page.url.pathname==='/sponsorships'}
href="/sponsorships">Sponsorships</a>
<a
class="btn btn-sm variant-ghost-surface"
class:active={$page.url.pathname==='/events_speakers'}
href="/events_speakers">Speakers</a>
<a
class="btn btn-sm variant-ghost-surface"
class:active={$page.url.pathname==='/events_badges'}
href="/events_badges">Badges</a>
<a
class="btn btn-sm variant-ghost-surface"
class:active={$page.url.pathname==='/events_leads'}
href="/events_leads">Leads</a>
{/if} -->
</svelte:fragment>
</AppBar>
@@ -270,7 +258,6 @@ $: if ($slct_trigger == 'set_access_code_li' && !$ae_loc.ds['hub__page__access_c
class="flex text-sm sm:text-sm md:text-md lg:text-md xl:text-md 2xl:text-lg text-slate-400 hover:text-slate-800 transition px-1"
class:ae_debug={$ae_loc.debug}
>
<!-- {@html $ae_loc.ds['hub__site__appshell_footer']} -->
<Element_data_store
ds_code="hub__site__appshell_footer"
ds_type="html"