Bug fix for attaching files to a BB Post.
This commit is contained in:
@@ -1,33 +1,33 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
/** @type {import('./$types').LayoutData} */
|
/** @type {import('./$types').LayoutData} */
|
||||||
// /** @type {import('./$types').LayoutProps} */
|
// /** @type {import('./$types').LayoutProps} */
|
||||||
|
|
||||||
let log_lvl: number = 0;
|
let log_lvl: number = 0;
|
||||||
|
|
||||||
// *** Import Svelte specific
|
// *** Import Svelte specific
|
||||||
import { tick } from 'svelte';
|
import { tick } from 'svelte';
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import '../app.postcss';
|
import '../app.postcss';
|
||||||
|
|
||||||
// *** Import other supporting libraries
|
// *** Import other supporting libraries
|
||||||
import { AppShell, AppBar, initializeStores } from '@skeletonlabs/skeleton';
|
import { AppShell, AppBar, initializeStores } from '@skeletonlabs/skeleton';
|
||||||
// Initialize the stores for Drawer, Modal, and Toast so they work throughout the app.
|
// Initialize the stores for Drawer, Modal, and Toast so they work throughout the app.
|
||||||
initializeStores();
|
initializeStores();
|
||||||
// import { Modal } from '@skeletonlabs/skeleton';
|
// import { Modal } from '@skeletonlabs/skeleton';
|
||||||
import type {
|
import type {
|
||||||
ModalComponent
|
ModalComponent
|
||||||
} from '@skeletonlabs/skeleton';
|
} from '@skeletonlabs/skeleton';
|
||||||
|
|
||||||
const modalRegistry: Record<string, ModalComponent> = {
|
const modalRegistry: Record<string, ModalComponent> = {
|
||||||
// Set a unique modal ID, then pass the component reference
|
// Set a unique modal ID, then pass the component reference
|
||||||
// modalComponentEditSponsorshipObj: { ref: ModalComponentEditSponsorshipObj },
|
// modalComponentEditSponsorshipObj: { ref: ModalComponentEditSponsorshipObj },
|
||||||
// modalComponentTwo: { ref: ModalComponentTwo },
|
// modalComponentTwo: { ref: ModalComponentTwo },
|
||||||
// ...
|
// ...
|
||||||
};
|
};
|
||||||
import {
|
import {
|
||||||
CircleX,
|
CircleX,
|
||||||
Eye, EyeOff,
|
Eye, EyeOff,
|
||||||
Key,
|
Key,
|
||||||
@@ -38,55 +38,55 @@ import {
|
|||||||
User, UserCheck
|
User, UserCheck
|
||||||
} from '@lucide/svelte';
|
} from '@lucide/svelte';
|
||||||
|
|
||||||
// Highlight JS
|
// Highlight JS
|
||||||
import hljs from 'highlight.js/lib/core';
|
import hljs from 'highlight.js/lib/core';
|
||||||
import 'highlight.js/styles/github-dark.css';
|
import 'highlight.js/styles/github-dark.css';
|
||||||
|
|
||||||
import { browser } from '$app/environment';
|
import { browser } from '$app/environment';
|
||||||
import { localStorageStore, storeHighlightJs } from '@skeletonlabs/skeleton';
|
import { localStorageStore, storeHighlightJs } from '@skeletonlabs/skeleton';
|
||||||
import xml from 'highlight.js/lib/languages/xml'; // for HTML
|
import xml from 'highlight.js/lib/languages/xml'; // for HTML
|
||||||
import css from 'highlight.js/lib/languages/css';
|
import css from 'highlight.js/lib/languages/css';
|
||||||
import javascript from 'highlight.js/lib/languages/javascript';
|
import javascript from 'highlight.js/lib/languages/javascript';
|
||||||
import typescript from 'highlight.js/lib/languages/typescript';
|
import typescript from 'highlight.js/lib/languages/typescript';
|
||||||
|
|
||||||
hljs.registerLanguage('xml', xml); // for HTML
|
hljs.registerLanguage('xml', xml); // for HTML
|
||||||
hljs.registerLanguage('css', css);
|
hljs.registerLanguage('css', css);
|
||||||
hljs.registerLanguage('javascript', javascript);
|
hljs.registerLanguage('javascript', javascript);
|
||||||
hljs.registerLanguage('typescript', typescript);
|
hljs.registerLanguage('typescript', typescript);
|
||||||
storeHighlightJs.set(hljs);
|
storeHighlightJs.set(hljs);
|
||||||
|
|
||||||
// *** Import Aether specific variables and functions
|
// *** Import Aether specific variables and functions
|
||||||
import Analytics from '$lib/analytics.svelte'
|
import Analytics from '$lib/analytics.svelte'
|
||||||
// import { api } from '$lib/api';
|
// import { api } from '$lib/api';
|
||||||
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
|
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
|
||||||
import { events_loc, events_slct } from '$lib/ae_events_stores';
|
import { events_loc, events_slct } from '$lib/ae_events_stores';
|
||||||
// import type { key_val } from '$lib/ae_stores';
|
// import type { key_val } from '$lib/ae_stores';
|
||||||
|
|
||||||
import Element_access_type from '$lib/element_access_type.svelte';
|
import Element_access_type from '$lib/element_access_type.svelte';
|
||||||
import Element_app_cfg from '$lib/element_app_cfg.svelte';
|
import Element_app_cfg from '$lib/element_app_cfg.svelte';
|
||||||
import Element_sign_in_out from '$lib/element_sign_in_out.svelte';
|
import Element_sign_in_out from '$lib/element_sign_in_out.svelte';
|
||||||
// import Element_data_store from '$lib/element_data_store_v2.svelte';
|
// import Element_data_store from '$lib/element_data_store_v2.svelte';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
data: any;
|
data: any;
|
||||||
children?: import('svelte').Snippet;
|
children?: import('svelte').Snippet;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { data, children }: Props = $props();
|
let { data, children }: Props = $props();
|
||||||
|
|
||||||
if (log_lvl > 1) {
|
if (log_lvl > 1) {
|
||||||
console.log(`ae_root +layout.svelte data:`, data);
|
console.log(`ae_root +layout.svelte data:`, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
// goto('/', {replaceState: true, invalidateAll: true});
|
// goto('/', {replaceState: true, invalidateAll: true});
|
||||||
// try {
|
// try {
|
||||||
// goto(data.route.id, {replaceState: true, invalidateAll: true});
|
// goto(data.route.id, {replaceState: true, invalidateAll: true});
|
||||||
// } catch (e) {
|
// } catch (e) {
|
||||||
// console.log('Error going to root page:', e);
|
// console.log('Error going to root page:', e);
|
||||||
// goto('/', {replaceState: true, invalidateAll: true});
|
// goto('/', {replaceState: true, invalidateAll: true});
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (browser && data.route.id !== '/') {
|
if (browser && data.route.id !== '/') {
|
||||||
// try {
|
// try {
|
||||||
// goto(data.route.id, {replaceState: true, invalidateAll: true});
|
// goto(data.route.id, {replaceState: true, invalidateAll: true});
|
||||||
// } catch (e) {
|
// } catch (e) {
|
||||||
@@ -97,144 +97,144 @@ if (browser && data.route.id !== '/') {
|
|||||||
// goto('/', {replaceState: true, invalidateAll: true});
|
// goto('/', {replaceState: true, invalidateAll: true});
|
||||||
// $ae_loc = {};
|
// $ae_loc = {};
|
||||||
// $ae_loc.app_cfg = {};
|
// $ae_loc.app_cfg = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let trigger_clear_access: null|boolean = $state(null);
|
let trigger_clear_access: null|boolean = $state(null);
|
||||||
|
|
||||||
// let account_id = localStorage.getItem('ae_account_id');
|
// let account_id = localStorage.getItem('ae_account_id');
|
||||||
// console.log(`account_id = `, account_id);
|
// console.log(`account_id = `, account_id);
|
||||||
|
|
||||||
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other. This should catch anything that is a child of this layout.svelte file.
|
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other. This should catch anything that is a child of this layout.svelte file.
|
||||||
$slct.account_id = data.account_id;
|
$slct.account_id = data.account_id;
|
||||||
if (log_lvl) {
|
if (log_lvl) {
|
||||||
console.log(`*ae_root +layout.svelte* $slct.account_id = ${$slct.account_id}`);
|
console.log(`*ae_root +layout.svelte* $slct.account_id = ${$slct.account_id}`);
|
||||||
}
|
}
|
||||||
let ae_acct = data[$slct.account_id];
|
let ae_acct = data[$slct.account_id];
|
||||||
|
|
||||||
$ae_api = {
|
$ae_api = {
|
||||||
...$ae_api,
|
...$ae_api,
|
||||||
...ae_acct.api,
|
...ae_acct.api,
|
||||||
}
|
}
|
||||||
if (log_lvl > 1) {
|
if (log_lvl > 1) {
|
||||||
console.log(`$ae_api = `, $ae_api);
|
console.log(`$ae_api = `, $ae_api);
|
||||||
}
|
}
|
||||||
|
|
||||||
$ae_loc = {
|
$ae_loc = {
|
||||||
...$ae_loc,
|
...$ae_loc,
|
||||||
...ae_acct.loc,
|
...ae_acct.loc,
|
||||||
}
|
}
|
||||||
if (log_lvl > 1) {
|
if (log_lvl > 1) {
|
||||||
console.log(`$ae_loc = `, $ae_loc);
|
console.log(`$ae_loc = `, $ae_loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
$slct = {
|
$slct = {
|
||||||
...$slct,
|
...$slct,
|
||||||
...ae_acct.slct,
|
...ae_acct.slct,
|
||||||
}
|
}
|
||||||
if (log_lvl > 1) {
|
if (log_lvl > 1) {
|
||||||
console.log(`$slct = `, $slct);
|
console.log(`$slct = `, $slct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!$ae_loc?.app_cfg) {
|
if (!$ae_loc?.app_cfg) {
|
||||||
$ae_loc.app_cfg = {};
|
$ae_loc.app_cfg = {};
|
||||||
$ae_loc.app_cfg.show_element__menu_btn = true;
|
$ae_loc.app_cfg.show_element__menu_btn = true;
|
||||||
$ae_loc.app_cfg.show_element__menu = false;
|
$ae_loc.app_cfg.show_element__menu = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (!$ae_loc?.ver_testing) {
|
// if (!$ae_loc?.ver_testing) {
|
||||||
// console.log(`TEST: AE Stores - ver_testing missing:`, $ae_loc);
|
// console.log(`TEST: AE Stores - ver_testing missing:`, $ae_loc);
|
||||||
// // ae_app_local_data_struct = {
|
// // ae_app_local_data_struct = {
|
||||||
// // ...$ae_loc,
|
// // ...$ae_loc,
|
||||||
// // ...ae_app_local_data_struct,
|
// // ...ae_app_local_data_struct,
|
||||||
// // };
|
// // };
|
||||||
// // $ae_loc.ver_testing = true; // test
|
// // $ae_loc.ver_testing = true; // test
|
||||||
// } else {
|
// } else {
|
||||||
// console.log(`TEST: AE Stores - ver_testing found`);
|
// console.log(`TEST: AE Stores - ver_testing found`);
|
||||||
// // $ae_loc.ver_testing = false; // test 2
|
// // $ae_loc.ver_testing = false; // test 2
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// // This should only be temporary. || !$ae_loc?.person || !$ae_loc?.user
|
// // This should only be temporary. || !$ae_loc?.person || !$ae_loc?.user
|
||||||
// if (!$ae_loc) {
|
// if (!$ae_loc) {
|
||||||
// console.log('No ae_loc. Reloading page...');
|
// console.log('No ae_loc. Reloading page...');
|
||||||
// window.location.reload();
|
// window.location.reload();
|
||||||
// } else if ($ae_loc && $ae_sess && ($ae_loc.ver != $ae_sess.ver)) {
|
// } else if ($ae_loc && $ae_sess && ($ae_loc.ver != $ae_sess.ver)) {
|
||||||
// console.log('New version of the ae_loc (core local storage) available!!!');
|
// console.log('New version of the ae_loc (core local storage) available!!!');
|
||||||
// console.log(`$ae_loc.ver: ${$ae_loc.ver} != $ae_sess.ver: ${$ae_sess.ver}`);
|
// console.log(`$ae_loc.ver: ${$ae_loc.ver} != $ae_sess.ver: ${$ae_sess.ver}`);
|
||||||
|
|
||||||
// // alert('New version available!!!');
|
// // alert('New version available!!!');
|
||||||
|
|
||||||
// // $ae_loc.ver = $ae_sess.ver;
|
// // $ae_loc.ver = $ae_sess.ver;
|
||||||
|
|
||||||
// // This does not seem to work fast enough or something?
|
// // This does not seem to work fast enough or something?
|
||||||
// // goto('/', {replaceState: true, invalidateAll: true});
|
// // goto('/', {replaceState: true, invalidateAll: true});
|
||||||
|
|
||||||
// console.log('Clearing localStorage...');
|
// console.log('Clearing localStorage...');
|
||||||
// // $ae_loc = null;
|
// // $ae_loc = null;
|
||||||
// // localStorage.removeItem('ae_loc');
|
// // localStorage.removeItem('ae_loc');
|
||||||
// // localStorage.removeItem('ae_idaa_loc');
|
// // localStorage.removeItem('ae_idaa_loc');
|
||||||
// // localStorage.removeItem('ae_journals_loc');
|
// // localStorage.removeItem('ae_journals_loc');
|
||||||
// // localStorage.removeItem('ae_events_loc');
|
// // localStorage.removeItem('ae_events_loc');
|
||||||
// localStorage.clear();
|
// localStorage.clear();
|
||||||
|
|
||||||
// // sessionStorage.removeItem('ae_sess');
|
// // sessionStorage.removeItem('ae_sess');
|
||||||
// // sessionStorage.removeItem('events_sess');
|
// // sessionStorage.removeItem('events_sess');
|
||||||
// // console.log('Clearing sessionStorage...');
|
// // console.log('Clearing sessionStorage...');
|
||||||
// // sessionStorage.clear();
|
// // sessionStorage.clear();
|
||||||
// console.log('Reloading page...');
|
// console.log('Reloading page...');
|
||||||
// location.reload();
|
// location.reload();
|
||||||
// } else if (!$ae_loc?.app_cfg) {
|
// } else if (!$ae_loc?.app_cfg) {
|
||||||
// console.log('No ae_loc.app_cfg. Reloading page...?');
|
// console.log('No ae_loc.app_cfg. Reloading page...?');
|
||||||
|
|
||||||
// // $ae_loc = {};
|
// // $ae_loc = {};
|
||||||
// // localStorage.removeItem('ae_loc');
|
// // localStorage.removeItem('ae_loc');
|
||||||
// // localStorage.removeItem('ae_idaa_loc');
|
// // localStorage.removeItem('ae_idaa_loc');
|
||||||
// // localStorage.removeItem('ae_journals_loc');
|
// // localStorage.removeItem('ae_journals_loc');
|
||||||
// // localStorage.removeItem('ae_events_loc');
|
// // localStorage.removeItem('ae_events_loc');
|
||||||
// // localStorage.clear();
|
// // localStorage.clear();
|
||||||
|
|
||||||
// // sessionStorage.removeItem('ae_sess');
|
// // sessionStorage.removeItem('ae_sess');
|
||||||
// // sessionStorage.removeItem('events_sess');
|
// // sessionStorage.removeItem('events_sess');
|
||||||
// // sessionStorage.clear();
|
// // sessionStorage.clear();
|
||||||
|
|
||||||
// // window.location.reload();
|
// // window.location.reload();
|
||||||
// // location.reload();
|
// // location.reload();
|
||||||
// // tick();
|
// // tick();
|
||||||
// // $ae_loc.app_cfg = {};
|
// // $ae_loc.app_cfg = {};
|
||||||
// } else if ($ae_loc?.app_cfg && !$ae_loc?.app_cfg?.show_element__menu_btn) {
|
// } else if ($ae_loc?.app_cfg && !$ae_loc?.app_cfg?.show_element__menu_btn) {
|
||||||
// console.log('No ae_loc.app_cfg.show_element__menu_btn. Forcing show.');
|
// console.log('No ae_loc.app_cfg.show_element__menu_btn. Forcing show.');
|
||||||
// $ae_loc.app_cfg.show_element__menu_btn = true;
|
// $ae_loc.app_cfg.show_element__menu_btn = true;
|
||||||
// $ae_loc.app_cfg.show_element__menu = false;
|
// $ae_loc.app_cfg.show_element__menu = false;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// localStorage caches - Check if the last refresh timestamp for $ae_loc.last_refresh is no more than 48 hours ago.
|
// localStorage caches - Check if the last refresh timestamp for $ae_loc.last_refresh is no more than 48 hours ago.
|
||||||
let default_refresh_time = 4 * 60 * 60 * 1000; // 48 hours or 2880 minutes? 48 * 60 *
|
let default_refresh_time = 4 * 60 * 60 * 1000; // 48 hours or 2880 minutes? 48 * 60 *
|
||||||
let trusted_refresh_time = 168 * 60 * 60 * 1000; // 1 week or 10080 minutes?
|
let trusted_refresh_time = 168 * 60 * 60 * 1000; // 1 week or 10080 minutes?
|
||||||
|
|
||||||
// IDB caches - Check if the last refresh timestamp for $ae_loc.last_cache_refresh is no more than 15 minutes ago.
|
// IDB caches - Check if the last refresh timestamp for $ae_loc.last_cache_refresh is no more than 15 minutes ago.
|
||||||
let default_idb_refresh_time = 2 * 60 * 60 * 1000; // 15 minutes?
|
let default_idb_refresh_time = 2 * 60 * 60 * 1000; // 15 minutes?
|
||||||
let trusted_idb_refresh_time = 4 * 60 * 60 * 1000; // 4 hours or 120 minutes?
|
let trusted_idb_refresh_time = 4 * 60 * 60 * 1000; // 4 hours or 120 minutes?
|
||||||
|
|
||||||
// There should almost always be an event_id set.
|
// There should almost always be an event_id set.
|
||||||
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_slct.event_id = $ae_loc.site_cfg_json.slct__event_id;
|
||||||
$events_loc.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) {
|
} else if ($events_slct?.event_id) {
|
||||||
// console.log(`Event ID already set:`, $events_slct.event_id);
|
// console.log(`Event ID already set:`, $events_slct.event_id);
|
||||||
$events_loc.event_id = $events_slct.event_id;
|
$events_loc.event_id = $events_slct.event_id;
|
||||||
} else {
|
} else {
|
||||||
if (log_lvl > 1) {
|
if (log_lvl > 1) {
|
||||||
console.log(`No Event ID set!`);
|
console.log(`No Event ID set!`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is mainly for Precon CHOW
|
// This is mainly for Precon CHOW
|
||||||
if ($ae_loc?.site_cfg_json?.slct__sponsorship_cfg_id) {
|
if ($ae_loc?.site_cfg_json?.slct__sponsorship_cfg_id) {
|
||||||
$slct.sponsorship_cfg_id = $ae_loc.site_cfg_json.slct__sponsorship_cfg_id;
|
$slct.sponsorship_cfg_id = $ae_loc.site_cfg_json.slct__sponsorship_cfg_id;
|
||||||
if ($ae_loc?.mod?.sponsorships) {
|
if ($ae_loc?.mod?.sponsorships) {
|
||||||
$ae_loc.mod.sponsorships.cfg_id = $ae_loc.site_cfg_json.slct__sponsorship_cfg_id;
|
$ae_loc.mod.sponsorships.cfg_id = $ae_loc.site_cfg_json.slct__sponsorship_cfg_id;
|
||||||
@@ -246,18 +246,18 @@ if ($ae_loc?.site_cfg_json?.slct__sponsorship_cfg_id) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} else if ($ae_loc?.sponsorship_cfg_id) {
|
} else if ($ae_loc?.sponsorship_cfg_id) {
|
||||||
$slct.sponsorship_cfg_id = $ae_loc.sponsorship_cfg_id;
|
$slct.sponsorship_cfg_id = $ae_loc.sponsorship_cfg_id;
|
||||||
$ae_loc.mod.sponsorships.cfg_id = $ae_loc.sponsorship_cfg_id;
|
$ae_loc.mod.sponsorships.cfg_id = $ae_loc.sponsorship_cfg_id;
|
||||||
} else {
|
} else {
|
||||||
if (log_lvl > 1) {
|
if (log_lvl > 1) {
|
||||||
console.log(`No Sponsorship Config ID set.`);
|
console.log(`No Sponsorship Config ID set.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Updated 2024-11-21
|
// Updated 2024-11-21
|
||||||
if ($ae_loc.site_access_key || $ae_loc.site_domain_access_key) {
|
if ($ae_loc.site_access_key || $ae_loc.site_domain_access_key) {
|
||||||
// log_lvl = 2;
|
// log_lvl = 2;
|
||||||
if (log_lvl > 1) {
|
if (log_lvl > 1) {
|
||||||
console.log(`We need to do a current check against the allow_access value. site key: ${$ae_loc.site_access_key}, domain key: ${$ae_loc.site_domain_access_key}`);
|
console.log(`We need to do a current check against the allow_access value. site key: ${$ae_loc.site_access_key}, domain key: ${$ae_loc.site_domain_access_key}`);
|
||||||
@@ -282,13 +282,13 @@ if ($ae_loc.site_access_key || $ae_loc.site_domain_access_key) {
|
|||||||
$ae_loc.allow_access = false;
|
$ae_loc.allow_access = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// This means this site and domain do not require an access key.
|
// This means this site and domain do not require an access key.
|
||||||
$ae_loc.allow_access = true;
|
$ae_loc.allow_access = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (browser) {
|
if (browser) {
|
||||||
if (!$ae_loc) {
|
if (!$ae_loc) {
|
||||||
console.log('No ae_loc. Reloading page...');
|
console.log('No ae_loc. Reloading page...');
|
||||||
// window.location.reload();
|
// window.location.reload();
|
||||||
@@ -603,44 +603,44 @@ if (browser) {
|
|||||||
$ae_loc.mod.sponsorships.cfg_id = data.url.searchParams.get('sponsorship_cfg_id');
|
$ae_loc.mod.sponsorships.cfg_id = data.url.searchParams.get('sponsorship_cfg_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// We want to loop through all of the data store (ds) key value pairs and set them to localStorage
|
// We want to loop through all of the data store (ds) key value pairs and set them to localStorage
|
||||||
// $: if (ae_acct.ds) {
|
// $: if (ae_acct.ds) {
|
||||||
// console.log(`ae_ds__ data:`, ae_acct.ds)
|
// console.log(`ae_ds__ data:`, ae_acct.ds)
|
||||||
// for (let [key, value] of Object.entries(ae_acct.ds)) {
|
// for (let [key, value] of Object.entries(ae_acct.ds)) {
|
||||||
// console.log(`ae_ds__ key: ${key}, value:`, value);
|
// console.log(`ae_ds__ key: ${key}, value:`, value);
|
||||||
// localStorageStore(`ae_ds__${key}`, value);
|
// localStorageStore(`ae_ds__${key}`, value);
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// Check if in the array of: super > manager > administrator > trusted > public > authenticated > anonymous
|
// Check if in the array of: super > manager > administrator > trusted > public > authenticated > anonymous
|
||||||
const access_type_li = ['super', 'manager', 'administrator', 'trusted', 'public', 'authenticated', 'anonymous'];
|
const access_type_li = ['super', 'manager', 'administrator', 'trusted', 'public', 'authenticated', 'anonymous'];
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
if (browser && $ae_loc.access_type && access_type_li.includes($ae_loc.access_type)) {
|
if (browser && $ae_loc.access_type && access_type_li.includes($ae_loc.access_type)) {
|
||||||
document.getElementsByTagName('html')[0].classList.remove('super_access', 'manager_access', 'administrator_access', 'trusted_access', 'public_access', 'authenticated_access', 'anonymous_access');
|
document.getElementsByTagName('html')[0].classList.remove('super_access', 'manager_access', 'administrator_access', 'trusted_access', 'public_access', 'authenticated_access', 'anonymous_access');
|
||||||
document.getElementsByTagName('html')[0].classList.add(`${$ae_loc.access_type}_access`);
|
document.getElementsByTagName('html')[0].classList.add(`${$ae_loc.access_type}_access`);
|
||||||
} else if (browser) {
|
} else if (browser) {
|
||||||
document.getElementsByTagName('html')[0].classList.remove('super_access', 'manager_access', 'administrator_access', 'trusted_access', 'public_access', 'authenticated_access', 'anonymous_access');
|
document.getElementsByTagName('html')[0].classList.remove('super_access', 'manager_access', 'administrator_access', 'trusted_access', 'public_access', 'authenticated_access', 'anonymous_access');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
|
||||||
</script>
|
</script>
|
||||||
{#if $ae_loc?.site_google_tracking_id && $ae_loc?.site_google_tracking_id.length > 0}
|
|
||||||
{#if $ae_loc?.site_google_tracking_id && $ae_loc?.site_google_tracking_id.length > 0}
|
{#if $ae_loc?.site_google_tracking_id && $ae_loc?.site_google_tracking_id.length > 0}
|
||||||
{/if}
|
<Analytics bind:site_google_tracking_id={$ae_loc.site_google_tracking_id} />
|
||||||
{/if}
|
{/if}
|
||||||
<svelte:head>
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
<!-- <title>{$ae_loc.title ?? 'Æ loading...'}</title> -->
|
<!-- <title>{$ae_loc.title ?? 'Æ loading...'}</title> -->
|
||||||
<link rel="stylesheet" href="{ae_acct.loc.site_style_href}">
|
<link rel="stylesheet" href="{ae_acct.loc.site_style_href}">
|
||||||
</svelte:head>
|
<!-- <link rel="manifest" href="/manifest.json"> -->
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<!-- regionFooter="flex justify-end space-x-2" -->
|
|
||||||
<!-- regionFooter="flex justify-end space-x-2" -->
|
<!-- regionFooter="flex justify-end space-x-2" -->
|
||||||
{#if (browser && $ae_loc && $ae_sess && ($ae_loc.ver != $ae_sess.ver))}
|
|
||||||
{#if (browser && $ae_loc && $ae_sess && ($ae_loc.ver != $ae_sess.ver))}
|
{#if (browser && $ae_loc && $ae_sess && ($ae_loc.ver != $ae_sess.ver))}
|
||||||
<div class="flex flex-col items-center justify-center h-full max-w-lg mx-auto space-y-4">
|
<div class="flex flex-col items-center justify-center h-full max-w-lg mx-auto space-y-4">
|
||||||
<h1 class="text-4xl font-bold text-red-600 dark:text-red-400">New Version Available</h1>
|
<h1 class="text-4xl font-bold text-red-600 dark:text-red-400">New Version Available</h1>
|
||||||
@@ -688,13 +688,13 @@ $effect(() => {
|
|||||||
Reload and Clear Cache
|
Reload and Clear Cache
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{:else if $ae_loc?.allow_access}
|
|
||||||
{:else if $ae_loc?.allow_access}
|
{:else if $ae_loc?.allow_access}
|
||||||
<!-- Should we check for "browser" here as well? This may hide some status information as a page is loading. -->
|
<!-- Should we check for "browser" here as well? This may hide some status information as a page is loading. -->
|
||||||
|
|
||||||
<!-- The children will contain top level (directly under body tag) div tag(s) or similar. Modal and AppShell should also be set there. The AppShell gives access to a header, footer, AppBar (usually under header), -->
|
<!-- The children will contain top level (directly under body tag) div tag(s) or similar. Modal and AppShell should also be set there. The AppShell gives access to a header, footer, AppBar (usually under header), -->
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
{:else if browser}
|
|
||||||
{:else if browser}
|
{:else if browser}
|
||||||
|
|
||||||
<div
|
<div
|
||||||
@@ -759,15 +759,15 @@ $effect(() => {
|
|||||||
<p>This sometimes happens with new versions of the app or when in an iframe.</p>
|
<p>This sometimes happens with new versions of the app or when in an iframe.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
|
||||||
{/if}
|
{/if}
|
||||||
<!-- min-h-full
|
|
||||||
max-h-max
|
<!-- min-h-full
|
||||||
min-w-full
|
max-h-max
|
||||||
max-w-max -->
|
min-w-full
|
||||||
max-w-max -->
|
max-w-max -->
|
||||||
<!-- Toggle the menu -->
|
|
||||||
<section
|
<!-- Toggle the menu -->
|
||||||
<section
|
<section
|
||||||
class="
|
class="
|
||||||
ae_app__menu
|
ae_app__menu
|
||||||
@@ -961,10 +961,10 @@ max-w-max -->
|
|||||||
{/if}
|
{/if}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</section>
|
|
||||||
</section>
|
</section>
|
||||||
<!-- Show menu on right side of page -->
|
|
||||||
<section
|
<!-- Show menu on right side of page -->
|
||||||
<section
|
<section
|
||||||
class="
|
class="
|
||||||
ae_app__menu
|
ae_app__menu
|
||||||
@@ -1042,9 +1042,9 @@ max-w-max -->
|
|||||||
<!-- </span> -->
|
<!-- </span> -->
|
||||||
{/if}
|
{/if}
|
||||||
</button>
|
</button>
|
||||||
</section>
|
|
||||||
</section>
|
</section>
|
||||||
<div
|
|
||||||
<div
|
<div
|
||||||
class="absolute bottom-0 left-0 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 w-full outline"
|
class="absolute bottom-0 left-0 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 w-full outline"
|
||||||
class:ae_debug={$ae_loc.debug}
|
class:ae_debug={$ae_loc.debug}
|
||||||
@@ -1073,12 +1073,12 @@ max-w-max -->
|
|||||||
<Element_access_type
|
<Element_access_type
|
||||||
hidden={$ae_loc.iframe && !$ae_loc.trusted_access}
|
hidden={$ae_loc.iframe && !$ae_loc.trusted_access}
|
||||||
/>
|
/>
|
||||||
</div>
|
{/if} -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style lang="postcss">
|
|
||||||
/* BEGIN: AE's Svelte Quick Debug component */
|
<style lang="postcss">
|
||||||
#AE-Quick-Debug {
|
/* BEGIN: AE's Svelte Quick Debug component */
|
||||||
#AE-Quick-Debug {
|
#AE-Quick-Debug {
|
||||||
/* position: absolute; */
|
/* position: absolute; */
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@@ -1114,9 +1114,9 @@ max-w-max -->
|
|||||||
transition-property: opacity, background-color;
|
transition-property: opacity, background-color;
|
||||||
transition-delay: 1.25s;
|
transition-delay: 1.25s;
|
||||||
transition-duration: .5s;
|
transition-duration: .5s;
|
||||||
}
|
transition-timing-function: ease-out;
|
||||||
}
|
}
|
||||||
#AE-Quick-Debug:hover {
|
|
||||||
#AE-Quick-Debug:hover {
|
#AE-Quick-Debug:hover {
|
||||||
/* lightyellow */
|
/* lightyellow */
|
||||||
/* background-color: hsla(60,100%,90%,.95); */
|
/* background-color: hsla(60,100%,90%,.95); */
|
||||||
@@ -1138,5 +1138,5 @@ max-w-max -->
|
|||||||
transition-property: opacity, background-color;
|
transition-property: opacity, background-color;
|
||||||
transition-delay: .5s;
|
transition-delay: .5s;
|
||||||
transition-duration: .10s;
|
transition-duration: .10s;
|
||||||
}
|
transition-timing-function: ease-in;
|
||||||
</style>
|
}
|
||||||
|
|||||||
@@ -425,7 +425,7 @@ function send_staff_notification_email() {
|
|||||||
accept="image/*, .docx, .pdf, .pptx, .key"
|
accept="image/*, .docx, .pdf, .pptx, .key"
|
||||||
class_li="border border-gray-300 rounded-md p-2 bg-gray-100 hover:bg-gray-200"
|
class_li="border border-gray-300 rounded-md p-2 bg-gray-100 hover:bg-gray-200"
|
||||||
link_to_type="post"
|
link_to_type="post"
|
||||||
link_to_id={$idaa_slct.post_obj.post_id}
|
link_to_id={$idaa_slct.post_obj.post_id_random}
|
||||||
bind:hosted_file_id_li={$idaa_slct.post_obj.hosted_file_id_li}
|
bind:hosted_file_id_li={$idaa_slct.post_obj.hosted_file_id_li}
|
||||||
bind:hosted_file_obj_li={$idaa_slct.post_obj.hosted_file_obj_li}
|
bind:hosted_file_obj_li={$idaa_slct.post_obj.hosted_file_obj_li}
|
||||||
bind:upload_complete={$idaa_slct.post_obj.upload_complete}
|
bind:upload_complete={$idaa_slct.post_obj.upload_complete}
|
||||||
|
|||||||
Reference in New Issue
Block a user