Making the URL update when viewing and closing specific content. Other clean up.

This commit is contained in:
Scott Idem
2024-11-08 13:57:16 -05:00
parent 13d906428b
commit e6a9a5ceab
10 changed files with 108 additions and 63 deletions

View File

@@ -245,7 +245,7 @@ if (browser) {
<!-- Modal: Archive Content ID media player -->
<Modal
title="{$lq__archive_content_obj?.name} - {$lq__archive_content_obj?.id}"
title="{$lq__archive_content_obj?.name} - {$lq__archive_content_obj?.archive_content_id}"
bind:open={$idaa_sess.archives.show__modal_view__archive_content_id}
autoclose={false}
placement="top-center"
@@ -259,7 +259,7 @@ if (browser) {
<span class="text-sm text-gray-500">
Viewing:
</span>
{$lq__archive_content_obj?.name}</h3>
{$lq__archive_content_obj?.name} - {$lq__archive_content_obj?.archive_content_id}</h3>
</div>
</svelte:fragment>

View File

@@ -123,7 +123,7 @@ onMount(() => {
</a> -->
{/if}
{#if $ae_loc.trusted_access}
{#if $ae_loc.trusted_access && $ae_loc.edit_mode}
<button
disabled={!$ae_loc.trusted_access}
on:click={() => {

View File

@@ -70,7 +70,7 @@ onMount(() => {
{/if}
</div>
{#if $ae_loc.trusted_access}
{#if $ae_loc.trusted_access && $ae_loc.edit_mode}
<div class="ae_options">
<!-- {#if $ae_loc.trusted_access} -->
<button

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import { createEventDispatcher, onMount } from 'svelte';
import { fade } from 'svelte/transition';
import { onDestroy, onMount } from 'svelte';
import { browser } from '$app/environment';
// import { ae, Element_modal_v3 } from 'aether_npm_lib';
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
@@ -8,6 +8,8 @@ import { idaa_loc, idaa_sess, idaa_slct } from '$lib/ae_idaa_stores';
// export let archive_content_id = null;
export let lq__archive_content_obj: any;
let file_icons:any = {}
file_icons['ac3'] = 'file-audio';
file_icons['aac'] = 'file-audio';
@@ -35,17 +37,36 @@ file_icons['xls'] = 'file-excel';
file_icons['xlsx'] = 'file-excel';
file_icons['zip'] = 'file-archive';
onMount(() => {
$: if (browser && $lq__archive_content_obj?.archive_content_id) {
console.log('** Component Mounted: ** Media Player - Archive Content Obj');
const url = new URL(location);
url.searchParams.set('archive_content_id', $lq__archive_content_obj?.archive_content_id);
// url.searchParams.set('archive_content_id', $idaa_slct?.archive_content_id);
history.pushState({}, '', url);
}
onDestroy(() => {
console.log('** Component Destroyed: ** View - Archive Content Obj');
const url = new URL(location);
url.searchParams.delete('archive_content_id');
history.pushState({}, '', url);
});
// Reminder: Styling is being done with Tailwind CSS, not Bootstrap.
</script>
<!-- <h3 class="ae_title">Viewing: {$idaa_slct.archive_content_obj.name}</h3> -->
<!-- <h3 class="ae_title">Viewing: {$idaa_slct.archive_content_obj.name} - {$lq__archive_content_obj?.archive_content_id}</h3> -->
<section class="ae_content flex flex-col gap-2 items-center justify-center">
{#if file_icons[$idaa_slct.archive_content_obj.file_extension] == 'file-audio'}
{#if !$idaa_slct.archive_content_obj.hosted_file_id}
<span class="text-center text-lg text-gray-500 bg-yellow-100 p-2 rounded-lg">
<span class="fas fa-exclamation-triangle text-warning"></span>
No Hosted File Linked
<span class="fas fa-exclamation-triangle text-warning"></span>
</span>
{:else if file_icons[$idaa_slct.archive_content_obj.file_extension] == 'file-audio'}
<audio
autoplay controls
style="max-width: 100%; max-height: 65vh;"