General improvement for archive content creation. Better show/hide for enable and hide fields. Novi and iframe related updates.

This commit is contained in:
Scott Idem
2024-11-19 13:02:05 -05:00
parent d1f37af192
commit 77cc152837
13 changed files with 311 additions and 58 deletions

View File

@@ -66,6 +66,10 @@ export async function load_ae_obj_li__archive_content(
api_cfg,
for_obj_type = 'archive',
for_obj_id,
enabled = 'enabled',
hidden = 'not_hidden',
limit = 99,
offset = 0,
order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'original_datetime': 'ASC', 'name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
params = {},
try_cache = true,
@@ -74,6 +78,10 @@ export async function load_ae_obj_li__archive_content(
api_cfg: any,
for_obj_type: string,
for_obj_id: string,
enabled?: string,
hidden?: string,
limit?: number,
offset?: number,
order_by_li?: key_val,
params?: key_val,
try_cache?: boolean,
@@ -82,10 +90,10 @@ export async function load_ae_obj_li__archive_content(
) {
console.log(`*** load_ae_obj_li__archive_content() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`);
let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
let hidden: string = (params.qry__hidden ?? 'not_hidden'); // all, hidden, not_hidden
let limit: number = (params.qry__limit ?? 99); // 99
let offset: number = (params.qry__offset ?? 0); // 0
// let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
// let hidden: string = (params.qry__hidden ?? 'not_hidden'); // all, hidden, not_hidden
// let limit: number = (params.qry__limit ?? 99); // 99
// let offset: number = (params.qry__offset ?? 0); // 0
let params_json: key_val = {};

View File

@@ -115,7 +115,7 @@ let idaa_session_data_struct: key_val = {
export let idaa_sess = writable(idaa_session_data_struct);
/* *** BEGIN *** Initialize idaa_slct and idaa_trigger */
/* *** BEGIN *** Initialize idaa_slct and idaa_trig */
/* The slct and slct_trigger variable should not be stored in local storage. Only use session storage because browser tabs can be open to different idaa, badges, exhibits, etc. */
// Intended for temporary session storage.
@@ -151,8 +151,25 @@ export let idaa_slct = writable(idaa_slct_obj_template);
// export let idaa_slct: Writable<key_val> = localStorageStore('ae_idaa_slct', idaa_slct_obj_template);
/* *** BEGIN *** Initialize idaa_trigger */
/* *** BEGIN *** Initialize idaa_trig */
// Intended for temporary session storage.
// Updated 2024-03-06
export let idaa_trigger: any = writable(null);
// console.log(`AE IDAA Stores - IDAA Trigger:`, idaa_trigger);
// Updated 2024-11-19
let idaa_trig_template: key_val = {
archive_id: false,
archive_content_li: false,
event_id: false,
};
export let idaa_trig: any = writable(idaa_trig_template);
// console.log(`AE IDAA Stores - IDAA Trigger:`, idaa_trig);
/* *** BEGIN *** Initialize idaa_prom */
// Intended for temporary session storage.
// Updated 2024-11-19
let idaa_prom_template: key_val = {
archive_id: false,
archive_content_li: false,
event_id: false,
};
export let idaa_prom: any = writable(idaa_prom_template);
// console.log(`AE IDAA Stores - IDAA Trigger:`, idaa_prom);

View File

@@ -134,7 +134,8 @@ function getContent() {
}
let mouse_entered_timer: any;
let mouse_entered_wait: number = 2500;
let mouse_enter_wait: number = 500;
let mouse_leave_wait: number = 2000;
</script>
<!-- svelte-ignore a11y-no-static-element-interactions -->
@@ -148,11 +149,13 @@ let mouse_entered_wait: number = 2500;
}
}}
on:mouseleave={() => {
clearTimeout(mouse_entered_timer);
mouse_entered_timer = setTimeout(() => {
if (default_minimal) {
show_menu = false;
}
}, mouse_entered_wait);
}, mouse_leave_wait);
// if (default_minimal) {
// show_menu = false;
@@ -161,9 +164,15 @@ let mouse_entered_wait: number = 2500;
on:mouseenter={() => {
clearTimeout(mouse_entered_timer);
if (default_minimal) {
show_menu = true;
}
mouse_entered_timer = setTimeout(() => {
if (default_minimal) {
show_menu = true;
}
}, mouse_enter_wait);
// if (default_minimal) {
// show_menu = true;
// }
}}
class="editor textarea p-1 transition-all duration-1000"
>

View File

@@ -15,7 +15,7 @@ import { liveQuery } from "dexie";
import { core_func } from '$lib/ae_core/ae_core_functions';
import { db_archives } from "$lib/db_archives";
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
import { idaa_loc, idaa_sess, idaa_slct, idaa_trigger } from '$lib/ae_idaa_stores';
import { idaa_loc, idaa_sess, idaa_slct, idaa_trig } from '$lib/ae_idaa_stores';
import { archives_func } from '$lib/ae_archives/ae_archives_functions';
import Comp__archive_obj_li from './ae_idaa_comp__archive_obj_li.svelte';

View File

@@ -1,7 +1,7 @@
<script lang="ts">
/** @type {import('./$types').PageData} */
export let data: any;
let log_lvl = 1;
let log_lvl = 0;
// Imports
import { Modal } from 'flowbite-svelte';
@@ -19,7 +19,7 @@ import { liveQuery } from "dexie";
import { core_func } from '$lib/ae_core/ae_core_functions';
import { db_archives } from "$lib/db_archives";
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
import { idaa_loc, idaa_sess, idaa_slct, idaa_trigger } from '$lib/ae_idaa_stores';
import { idaa_loc, idaa_sess, idaa_slct, idaa_trig, idaa_prom } from '$lib/ae_idaa_stores';
import { archives_func } from '$lib/ae_archives/ae_archives_functions';
import Archive_obj_id_edit from './ae_idaa_comp__archive_obj_id_edit.svelte';
@@ -89,6 +89,50 @@ $: lq__archive_content_obj = liveQuery(async () => {
});
$: if ($idaa_trig.archive_content_li) {
$idaa_trig.archive_content_li = false;
if (log_lvl) {
console.log(`Triggered: $idaa_trig.archive_content_li`);
}
if ($idaa_loc.archives.qry__enabled !== 'all' || $idaa_loc.archives.qry__hidden !== 'all') {
console.log(`Deleting disabled or hidden archive content.`);
// let results = db_archives.content
// .where('enable')
// .notEqual(true)
// .delete();
let results = db_archives.content
.clear();
console.log(`Deleted ${results} disabled archive content.`);
}
// if ($idaa_loc.archives.qry__hidden !== 'all') {
// console.log(`Deleting hidden archive content.`);
// let results = db_archives.content
// .clear();
// console.log(`Deleted ${results} hidden archive content.`);
// }
// let results = db_archives.content
// .where('enable')
// .equals('false')
// .delete();
// console.log(`Deleted ${results} disabled archive content.`);
$idaa_prom.load__archive_content_obj_li = archives_func.load_ae_obj_li__archive_content({
api_cfg: $ae_api,
for_obj_type: 'archive',
for_obj_id: $idaa_slct.archive_id,
enabled: $idaa_loc.archives.qry__enabled,
hidden: $idaa_loc.archives.qry__hidden,
limit: $idaa_loc.archives.qry__limit,
order_by_li: $idaa_loc.archives.qry__order_by_li,
try_cache: true,
log_lvl: log_lvl,
});
}
if (browser) {
console.log('Browser environment detected.');

View File

@@ -34,20 +34,20 @@ if ($idaa_slct.archive_content_id) {
$idaa_slct.archive_content_obj = {
archive_id_random: null,
// archive_content_id_random: null,
archive_content_type: null,
archive_content_type: 'hosted_file',
name: null,
description: null,
content_html: null,
// hosted_file_id_random: null,
file_path: null,
// file_path: null, // file_path is no longer used, but need to be aware of it.
filename: null,
file_extension: null,
original_datetime: null,
original_timezone: null,
original_location: null,
original_url: null,
original_url_text: null,
access_key: null, // or passcode?
// original_url: null,
// original_url_text: null,
// access_key: null, // or passcode?
enable: true,
hide: false,
@@ -201,7 +201,7 @@ async function handle_submit_form(event) {
api_cfg: $ae_api,
archive_id: $idaa_slct.archive_id,
data_kv: archive_content_do,
log_lvl: 2
log_lvl: log_lvl
})
.then(async function (archive_content_obj_create_result) {
if (!archive_content_obj_create_result) {
@@ -209,10 +209,17 @@ async function handle_submit_form(event) {
return false;
}
$idaa_slct.archive_content_id = archive_content_obj_create_result.obj_id_random;
$idaa_slct.archive_content_obj = archive_content_obj_create_result;
$idaa_slct.archive_content_id = archive_content_obj_create_result.archive_content_id_random;
// $idaa_slct.archive_content_obj = await $lq__archive_content_obj;
// $idaa_slct.archive_content_obj.hosted_file_id_li = [];
// $idaa_slct.archive_content_obj.hosted_file_obj_li = [];
// $idaa_slct.archive_content_obj.upload_complete = false;
// $idaa_slct.archive_content_obj.description_new_html = '';
return update_archive_content_obj_promise
$idaa_slct.archive_content_obj = archive_content_obj_create_result;
$idaa_slct.archive_content_obj.archive_content_id = archive_content_obj_create_result.archive_content_id_random; // This is because we need use the string ID, not int ID.
return archive_content_obj_create_result
})
.catch(function (error) {
console.log('Something went wrong.');
@@ -258,7 +265,7 @@ async function handle_submit_form(event) {
}
}
$: if ($idaa_slct.archive_content_obj.upload_complete && $idaa_slct.archive_content_obj.hosted_file_id_li?.length && $idaa_slct.archive_content_obj.hosted_file_obj_li?.length) {
$: if ($idaa_slct.archive_content_obj?.upload_complete && $idaa_slct.archive_content_obj?.hosted_file_id_li?.length && $idaa_slct.archive_content_obj.hosted_file_obj_li?.length) {
handle_hosted_files_uploaded($idaa_slct.archive_content_obj.hosted_file_id_li, $idaa_slct.archive_content_obj.hosted_file_obj_li);
}
@@ -280,7 +287,8 @@ async function handle_hosted_files_uploaded(hosted_file_id_li: string[], hosted_
log_lvl: log_lvl
})
.then(function (archive_content_obj_update_result) {
$idaa_slct.archive_content_obj = $lq__archive_content_obj;
// $idaa_slct.archive_content_obj = $lq__archive_content_obj;
$idaa_slct.archive_content_obj = archive_content_obj_update_result;
})
.catch(function (error) {
console.log('Something went wrong.');
@@ -297,12 +305,12 @@ async function handle_hosted_files_uploaded(hosted_file_id_li: string[], hosted_
>
<!-- bind:clientHeight={ae_iframe_height} -->
<form on:submit|preventDefault={handle_submit_form} class="">
<form on:submit|preventDefault={handle_submit_form} class="space-y-2">
{#await update_archive_content_obj_promise}
{#await prom_api__archive_content_obj}
<div class="awaiting alert_msg_pulse" out:fade={{ duration: 2000 }}>Saving...</div>
{:then}
{#if update_archive_content_obj_promise}
{#if prom_api__archive_content_obj}
<div class="awaiting" out:fade={{ duration: 2000 }}>Finished saving</div>
{:else}
<!-- <div class="awaiting" out:fade={{ duration: 2000 }}>Nothing here yet</div> -->
@@ -315,7 +323,8 @@ async function handle_hosted_files_uploaded(hosted_file_id_li: string[], hosted_
<label for="name">Name of Content
<input
type="text" id="name" name="name"
required max="200" value={$idaa_slct.archive_content_obj.name ? $idaa_slct.archive_content_obj.name : '' }
required max="200"
value={$idaa_slct.archive_content_obj?.name ? $idaa_slct.archive_content_obj.name : '' }
class="input w-full"
placeholder="Content name"
>
@@ -348,7 +357,7 @@ async function handle_hosted_files_uploaded(hosted_file_id_li: string[], hosted_
class="select w-52"
>
<option value="">-- None --</option>
<option value="hosted_file">Hosted File in &AElig;</option>
<option value="hosted_file" selected>Hosted File in &AElig;</option>
<option value="html">Hosted HTML in &AElig</option>
<option value="json">Hosted JSON in &AElig;</option>
<option value="url">External URL</option>
@@ -381,6 +390,7 @@ async function handle_hosted_files_uploaded(hosted_file_id_li: string[], hosted_
</fieldset> -->
</section>
{#if $idaa_slct.archive_content_id}
<section
class="ae_section archive_content__hosted_file border border-gray-200 rounded p-2 space-y-2"
class:hidden={$idaa_slct.archive_content_obj.archive_content_type !== 'hosted_file' && !$idaa_slct.archive_content_id}
@@ -388,7 +398,7 @@ async function handle_hosted_files_uploaded(hosted_file_id_li: string[], hosted_
<h3 class="h3">Upload/Manage Hosted File</h3>
{#if !$idaa_slct.archive_content_obj.hosted_file_id}
{#if !$idaa_slct.archive_content_obj?.hosted_file_id}
No file uploaded yet.
{#if $ae_loc.trusted_access}
@@ -527,7 +537,14 @@ async function handle_hosted_files_uploaded(hosted_file_id_li: string[], hosted_
{/if}
</section>
{:else}
<section
class="ae_section archive_content__hosted_file border border-gray-200 rounded p-2 space-y-2"
>
<span class="fas fa-exclamation-triangle text-red-500"></span>
Save the form first before uploading a file.
</section>
{/if}
<section class="ae_section archive_content__original border border-gray-200 rounded p-2 space-y-2">
@@ -544,7 +561,6 @@ async function handle_hosted_files_uploaded(hosted_file_id_li: string[], hosted_
<select
id="original_timezone"
name="original_timezone"
required
value={($idaa_slct.archive_content_obj.original_timezone ? $idaa_slct.archive_content_obj.original_timezone : $ae_loc.current_timezone)}
class="select w-56"
title="Select the original timezone"
@@ -565,7 +581,7 @@ async function handle_hosted_files_uploaded(hosted_file_id_li: string[], hosted_
</fieldset>
<label for="original_location">Original Location
<input type="text" id="original_location" name="original_location" value={$idaa_slct.archive_content_obj.original_location} class="input w-full">
<input type="text" id="original_location" name="original_location" value={$idaa_slct.archive_content_obj.original_location} class="input w-96">
</label>
</section>
@@ -724,7 +740,7 @@ async function handle_hosted_files_uploaded(hosted_file_id_li: string[], hosted_
Save Archive Content
</button>
{#if $idaa_slct.archive_content_id && !$idaa_slct.archive_content_obj.hosted_file_id}
{#if $idaa_slct.archive_content_id && !$idaa_slct.archive_content_obj?.hosted_file_id}
<button
type="button"
on:click={() => {

View File

@@ -1,7 +1,5 @@
<script lang="ts">
// *** Import Svelte core
import { onMount } from 'svelte';
import { Spinner } from 'flowbite-svelte';
// *** Import Aether core variables and functions
import type { key_val } from '$lib/ae_stores';

View File

@@ -5,14 +5,38 @@ import { onMount } from 'svelte';
// *** Import Aether core variables and functions
import { ae_util } from '$lib/ae_utils/ae_utils';
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
import { idaa_loc, idaa_sess, idaa_slct } from '$lib/ae_idaa_stores';
import { idaa_loc, idaa_sess, idaa_slct, idaa_trig, idaa_prom } from '$lib/ae_idaa_stores';
import { archives_func } from '$lib/ae_archives/ae_archives_functions';
export let log_lvl = 0;
export let lq__archive_obj: any;
export let lq__archive_content_obj_li: any;
onMount(() => {
console.log('** Component Mounted: ** ID - Archive Obj');
});
// let ae_promises: key_val = {};
// let ae_tmp: key_val = {};
let ae_trigger: any = null;
// let ae_triggers: key_val = {};
// Updated 2024-10-01
// $: if (ae_trigger == 'load__event_obj_li') {
// if (log_lvl) {
// console.log('*** TEST SEARCH - load__event_obj_li == load__event_obj_li ***');
// }
// ae_trigger = null;
// if ($idaa_sess.recovery_meetings.qry_status == 'loading') {
// console.log('*** $idaa_sess.recovery_meetings.qry_status == loading ***');
// setTimeout(() => {
// console.log("Delayed for X second.");
// // ae_trigger = null;
// handle_qry__event({ft_qry_str: $idaa_loc.recovery_meetings.qry__fulltext_str});
// }, 250);
// } else {
// console.log('*** $idaa_sess.recovery_meetings.qry_status != loading ***');
// // ae_trigger = null;
// handle_qry__event({ft_qry_str: $idaa_loc.recovery_meetings.qry__fulltext_str});
// }
// }
// Reminder: Styling is being done with Tailwind CSS, not Bootstrap.
</script>
@@ -21,7 +45,15 @@ onMount(() => {
<section class="svelte_component ae_section ae_view archive_obj view__archive_obj" bind:clientHeight={$ae_loc.iframe_height_modal_body}>
<header class="ae_header archive__header">
<h2 class="archive__name h3">{@html $lq__archive_obj?.name} ({$lq__archive_content_obj_li?.length}&times;)</h2>
<h2 class="archive__name h3">
{@html $lq__archive_obj?.name ?? 'Loading...'}
({$lq__archive_content_obj_li?.length ?? '0'}&times;)
{#await $idaa_prom.load__archive_content_obj_li}
<span class="fas fa-spinner fa-spin"></span>
{:then}
<!-- done -->
{/await}
</h2>
</header>
<section class="archive__content max-w-xl">
@@ -71,12 +103,129 @@ onMount(() => {
</div>
{#if $ae_loc.trusted_access && $ae_loc.edit_mode}
<span
class="flex flex-row gap-1 items-center justify-around"
>
{#if ($ae_loc.edit_mode && $ae_loc.trusted_access) && (!$idaa_loc.archives.qry__hidden || $idaa_loc.archives.qry__hidden == 'not_hidden')}
<button
type="button"
on:click={() => {
$idaa_loc.archives.qry__enabled = 'enabled';
$idaa_loc.archives.qry__hidden = 'all';
$idaa_loc.archives.qry__limit = 250;
// ae_trigger = 'load__event_obj_li';
$idaa_trig.archive_content_li = true;
// let load_archive_content_obj_li = archives_func.load_ae_obj_li__archive_content({
// api_cfg: $ae_api,
// for_obj_type: 'archive',
// for_obj_id: $ae_loc.archive_id,
// enabled: $idaa_loc.archives.qry__enabled,
// hidden: $idaa_loc.archives.qry__hidden,
// limit: $idaa_loc.archives.qry__limit,
// order_by_li: $idaa_loc.archives.qry__order_by_li,
// try_cache: true,
// log_lvl: log_lvl
// });
// console.log(`load_archive_content_obj_li = `, load_archive_content_obj_li);
// $idaa_slct.archive_content_obj_li = load_archive_content_obj_li;
}}
class="btn_show_archives_archive_content ae_btn btn btn-info btn-sm variant-ghost-secondary"
>
<span class="fas fa-eye m-1"></span> Show Hidden Content
</button>
{:else if $ae_loc.trusted_access && $idaa_loc.archives.qry__hidden != 'not_hidden'}
<button
type="button"
on:click={() => {
$idaa_loc.archives.qry__enabled = 'enabled';
$idaa_loc.archives.qry__hidden = 'not_hidden';
$idaa_loc.archives.qry__limit = 250;
// ae_trigger = 'load__event_obj_li';
$idaa_trig.archive_content_li = true;
// let load_archive_content_obj_li = archives_func.load_ae_obj_li__archive_content({
// api_cfg: $ae_api,
// for_obj_type: 'archive',
// for_obj_id: $ae_loc.archive_id,
// enabled: $idaa_loc.archives.qry__enabled,
// hidden: $idaa_loc.archives.qry__hidden,
// limit: $idaa_loc.archives.qry__limit,
// order_by_li: $idaa_loc.archives.qry__order_by_li,
// try_cache: true,
// log_lvl: log_lvl
// });
// console.log(`load_archive_content_obj_li = `, load_archive_content_obj_li);
// $idaa_slct.archive_content_obj_li = load_archive_content_obj_li;
}}
class="btn_hide_archives_archive_content ae_btn btn btn-info btn-sm variant-ghost-secondary"
>
<span class="fas fa-eye-slash m-1"></span> Hide Hidden Content
</button>
{/if}
{#if ($ae_loc.edit_mode && $ae_loc.administrator_access) && (!$idaa_loc.archives.qry__enabled || $idaa_loc.archives.qry__enabled == 'enabled')}
<button
type="button"
on:click={() => {
$idaa_loc.archives.qry__enabled = 'all';
$idaa_loc.archives.qry__hidden = 'all';
$idaa_loc.archives.qry__limit = 500;
// ae_trigger = 'load__event_obj_li';
$idaa_trig.archive_content_li = true;
// let load_archive_content_obj_li = archives_func.load_ae_obj_li__archive_content({
// api_cfg: $ae_api,
// for_obj_type: 'archive',
// for_obj_id: $ae_loc.archive_id,
// enabled: $idaa_loc.archives.qry__enabled,
// hidden: $idaa_loc.archives.qry__hidden,
// limit: $idaa_loc.archives.qry__limit,
// order_by_li: $idaa_loc.archives.qry__order_by_li,
// try_cache: true,
// log_lvl: log_lvl
// });
}}
class="btn_show_bb_post ae_btn btn btn-warning btn-sm variant-ghost-secondary"
>
<span class="fas fa-eye m-1"></span> Show Disabled Events
</button>
{:else if $ae_loc.administrator_access && $idaa_loc.archives.qry__enabled != 'enabled'}
<button
type="button"
on:click={() => {
$idaa_loc.archives.qry__enabled = 'enabled';
$idaa_loc.archives.qry__hidden = 'all';
$idaa_loc.archives.qry__limit = 500;
$idaa_trig.archive_content_li = true;
// ae_trigger = 'load__event_obj_li';
// let load_archive_content_obj_li = archives_func.load_ae_obj_li__archive_content({
// api_cfg: $ae_api,
// for_obj_type: 'archive',
// for_obj_id: $ae_loc.archive_id,
// enabled: $idaa_loc.archives.qry__enabled,
// hidden: $idaa_loc.archives.qry__hidden,
// limit: $idaa_loc.archives.qry__limit,
// order_by_li: $idaa_loc.archives.qry__order_by_li,
// try_cache: true,
// log_lvl: log_lvl
// });
}}
class="btn_hide_bb_post ae_btn btn btn-warning btn-sm variant-ghost-secondary"
>
<span class="fas fa-eye-slash m-1"></span> Hide Disabled Events
</button>
{/if}
</span>
<div class="ae_options">
<!-- {#if $ae_loc.trusted_access} -->
<button
type="button"
disabled={!$ae_loc.trusted_access}
on:click={() => {
if (!confirm('Create new archive content?')) {
if (!confirm('Add new archive content?')) {
return false;
}
$idaa_slct.archive_content_id = null;
@@ -92,6 +241,7 @@ onMount(() => {
</button>
<button
type="button"
disabled={!$ae_loc.administrator_access}
on:click={() => {
// $idaa_slct.archive_id = $lq__archive_obj?.archive_id_random;

View File

@@ -15,7 +15,7 @@ import { liveQuery } from "dexie";
import { core_func } from '$lib/ae_core/ae_core_functions';
import { db_posts } from "$lib/ae_posts/db_posts";
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
import { idaa_loc, idaa_sess, idaa_slct, idaa_trigger } from '$lib/ae_idaa_stores';
import { idaa_loc, idaa_sess, idaa_slct, idaa_trig } from '$lib/ae_idaa_stores';
import { posts_func } from '$lib/ae_posts/ae_posts_functions';
import Comp__post_obj_li from './ae_idaa_comp__post_obj_li.svelte';

View File

@@ -7,7 +7,7 @@ import type { key_val } from '$lib/ae_stores';
import { ae_util } from '$lib/ae_utils/ae_utils';
import { api } from '$lib/api';
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
import { idaa_loc, idaa_sess, idaa_slct, idaa_trigger } from '$lib/ae_idaa_stores';
import { idaa_loc, idaa_sess, idaa_slct, idaa_trig } from '$lib/ae_idaa_stores';
import Comp__post_obj_id_edit from './ae_idaa_comp__post_obj_id_edit.svelte';
import Comp__post_comment_obj_id_edit from './ae_idaa_comp__post_comment_obj_id_edit.svelte';
@@ -22,7 +22,7 @@ if ($idaa_slct.post_id) {
console.log(`Post ID selected: ${$idaa_slct.post_id}`);
console.log(`Post Object selected: ${$lq__post_obj}`);
$idaa_trigger = 'load__post_obj';
$idaa_trig = 'load__post_obj';
}
$: if (browser && $lq__post_obj?.post_id) {
@@ -48,9 +48,9 @@ onDestroy(() => {
// $idaa_slct.post_comment_id = null;
// $idaa_slct.post_comment_obj = {};
// $idaa_trigger = 'load__post_obj_li';
// $idaa_trigger = 'load__post_obj';
// $idaa_trigger = 'load__post_comment_obj_li';
// $idaa_trig = 'load__post_obj_li';
// $idaa_trig = 'load__post_obj';
// $idaa_trig = 'load__post_comment_obj_li';
// // $idaa_sess.bb.show_post_list = false;
// // $idaa_sess.bb.show_edit__post_id = false;
@@ -61,8 +61,8 @@ onDestroy(() => {
// console.log('*** handle_post_comment_obj_updated() ***');
// console.log(event.detail);
// $idaa_trigger = 'load__post_obj';
// $idaa_trigger = 'load__post_comment_obj_li';
// $idaa_trig = 'load__post_obj';
// $idaa_trig = 'load__post_comment_obj_li';
// // $idaa_sess.bb.show_post_list = false;
// // $idaa_sess.bb.show_edit__post_id = false;
@@ -73,9 +73,9 @@ onDestroy(() => {
// console.log('*** handle_post_comment_obj_deleted() ***');
// console.log(event.detail);
// $idaa_trigger = 'load__post_obj_li';
// $idaa_trigger = 'load__post_obj';
// $idaa_trigger = 'load__post_comment_obj_li';
// $idaa_trig = 'load__post_obj_li';
// $idaa_trig = 'load__post_obj';
// $idaa_trig = 'load__post_comment_obj_li';
// // $idaa_sess.bb.show_post_list = false;
// // $idaa_sess.bb.show_edit__post_id = false;

View File

@@ -50,6 +50,7 @@ let search_submit_results: any = null;
{#if $ae_loc.trusted_access && !$idaa_loc.bb.qry__hidden || $idaa_loc.bb.qry__hidden == 'not_hidden'}
<button
type="button"
on:click={() => {
$idaa_loc.bb.qry__hidden = 'all';
$idaa_loc.bb.qry__limit = 200;
@@ -78,6 +79,7 @@ let search_submit_results: any = null;
</button>
{:else if $ae_loc.trusted_access && $idaa_loc.bb.qry__hidden != 'not_hidden'}
<button
type="button"
on:click={() => {
$idaa_loc.bb.qry__hidden = 'not_hidden';
$idaa_loc.bb.qry__limit = 100;
@@ -106,6 +108,7 @@ let search_submit_results: any = null;
{#if $ae_loc.administrator_access && !$idaa_loc.bb.qry__enabled || $idaa_loc.bb.qry__enabled == 'enabled'}
<button
type="button"
on:click={() => {
$idaa_loc.bb.qry__hidden = 'all';
$idaa_loc.bb.qry__enabled = 'all';
@@ -133,6 +136,7 @@ let search_submit_results: any = null;
</button>
{:else if $ae_loc.administrator_access && $idaa_loc.bb.qry__enabled != 'enabled'}
<button
type="button"
on:click={() => {
$idaa_loc.bb.qry__enabled = 'enabled';
ae_trigger = 'load__post_obj_li';
@@ -160,6 +164,7 @@ let search_submit_results: any = null;
{#if ($ae_loc.trusted_access && $ae_loc.edit_mode) || $idaa_loc.novi_uuid}
<button
type="button"
disabled={!$ae_loc.trusted_access}
on:click={() => {
if (!confirm('Create new post?')) {

View File

@@ -431,6 +431,7 @@ async function handle_qry__event(
>
{#if ($ae_loc.edit_mode && $ae_loc.trusted_access) && (!$idaa_loc.recovery_meetings.qry__hidden || $idaa_loc.recovery_meetings.qry__hidden == 'not_hidden')}
<button
type="button"
on:click={() => {
$idaa_loc.recovery_meetings.qry__hidden = 'all';
$idaa_loc.recovery_meetings.qry__limit = 200;
@@ -442,6 +443,7 @@ async function handle_qry__event(
</button>
{:else if $ae_loc.trusted_access && $idaa_loc.recovery_meetings.qry__hidden != 'not_hidden'}
<button
type="button"
on:click={() => {
$idaa_loc.recovery_meetings.qry__hidden = 'not_hidden';
$idaa_loc.recovery_meetings.qry__limit = 100;
@@ -455,6 +457,7 @@ async function handle_qry__event(
{#if ($ae_loc.edit_mode && $ae_loc.administrator_access) && (!$idaa_loc.recovery_meetings.qry__enabled || $idaa_loc.recovery_meetings.qry__enabled == 'enabled')}
<button
type="button"
on:click={() => {
$idaa_loc.recovery_meetings.qry__hidden = 'all';
$idaa_loc.recovery_meetings.qry__enabled = 'all';
@@ -467,6 +470,7 @@ async function handle_qry__event(
</button>
{:else if $ae_loc.administrator_access && $idaa_loc.recovery_meetings.qry__enabled != 'enabled'}
<button
type="button"
on:click={() => {
$idaa_loc.recovery_meetings.qry__enabled = 'enabled';
ae_trigger = 'load__event_obj_li';
@@ -483,6 +487,7 @@ async function handle_qry__event(
>
{#if ($ae_loc.trusted_access && $ae_loc.edit_mode) || $idaa_loc.novi_uuid}
<button
type="button"
on:click={() => {
if (!confirm('Create new meeting?')) {
return false;