Bug fix for IDAA Archive Content edit button. Updates related to new Launcher.
This commit is contained in:
@@ -1,10 +1,47 @@
|
||||
<script lang="ts">
|
||||
export let log_lvl: number = 0;
|
||||
interface Props {
|
||||
log_lvl?: number;
|
||||
// *** Export/Exposed variables and functions for component
|
||||
event_file_obj: any;
|
||||
// export let os: string = null;
|
||||
max_filename_length?: number;
|
||||
hide_launch_icon?: boolean;
|
||||
hide_meta?: boolean;
|
||||
hide_created_on?: boolean;
|
||||
hide_os?: boolean;
|
||||
hide_size?: boolean;
|
||||
show_bak_download?: boolean;
|
||||
// export let hide_api_download: boolean = true;
|
||||
btn_size?: string;
|
||||
session_type?: string; // oral, poster, workshop, symposium, roundtable, other
|
||||
open_method?: null|string; // modal, download, native open (download, cache, copy, open), URL
|
||||
modal_title?: string;
|
||||
}
|
||||
|
||||
// *** Import Svelte core
|
||||
let {
|
||||
log_lvl = 0,
|
||||
event_file_obj,
|
||||
max_filename_length = 50,
|
||||
hide_launch_icon = false,
|
||||
hide_meta = false,
|
||||
hide_created_on = false,
|
||||
hide_os = false,
|
||||
hide_size = false,
|
||||
show_bak_download = false,
|
||||
btn_size = 'btn_md',
|
||||
session_type = 'oral',
|
||||
open_method = 'download',
|
||||
modal_title = $bindable('')
|
||||
}: Props = $props();
|
||||
|
||||
// *** Import Svelte specific
|
||||
import { preventDefault } from 'svelte/legacy';
|
||||
import { onMount, tick } from 'svelte';
|
||||
import { fade, scale, fly } from 'svelte/transition';
|
||||
|
||||
// *** Import other supporting libraries
|
||||
|
||||
// *** Import Aether specific variables and functions
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
import { api } from '$lib/api';
|
||||
@@ -15,47 +52,16 @@ import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
import Element_ae_crud from '$lib/element_ae_crud.svelte';
|
||||
|
||||
// *** Import Aether core variables and functions
|
||||
// import { ae } from 'aether_npm_lib';
|
||||
|
||||
// import { } from '../../mods/electron.js';
|
||||
// import { ae_event_launcher, event_file_obj_def, open_event_file_as_modal, screen_saver_img_kv } from '../../stores_mod_events';
|
||||
|
||||
// *** Import Aether core components
|
||||
|
||||
// *** Import Aether module variables and functions
|
||||
// import { download_event_file } from '../stores_event_api.js';
|
||||
|
||||
// *** Import Aether module components
|
||||
|
||||
// *** Export/Exposed variables and functions for component
|
||||
export let event_file_obj: any;
|
||||
// export let use_os: boolean = false;
|
||||
// export let os: string = null;
|
||||
export let max_filename_length: number = 50;
|
||||
export let hide_launch_icon: boolean = false;
|
||||
export let hide_meta: boolean = false;
|
||||
export let hide_created_on: boolean = false;
|
||||
export let hide_os: boolean = false;
|
||||
export let hide_size: boolean = false;
|
||||
export let show_bak_download: boolean = false;
|
||||
// export let hide_api_download: boolean = true;
|
||||
|
||||
export let btn_size: string = 'btn_md';
|
||||
|
||||
export let session_type: string = 'oral'; // oral, poster, workshop, symposium, roundtable, other
|
||||
export let open_method: null|string = 'download'; // modal, download, native open (download, cache, copy, open), URL
|
||||
export let modal_title: string = '';
|
||||
|
||||
// *** Set initial variables
|
||||
// *** Functions and Logic
|
||||
let ae_downloads: key_val = {};
|
||||
let ae_promises: key_val = {};
|
||||
let ae_tmp: key_val = {};
|
||||
let ae_triggers: key_val = {};
|
||||
let ae_promises: key_val = $state({});
|
||||
let ae_tmp: key_val = $state({});
|
||||
let ae_triggers: key_val = $state({});
|
||||
|
||||
let open_file_clicked: null|boolean = null;
|
||||
let open_file_status: null|string = null; // null, 'checking_cache', 'checking_cache_failed', 'downloading_file', 'downloading_file_failed', 'opening_file', 'opening_file_failed', 'opening_file_success'
|
||||
let open_file_status_message: null|string = null;
|
||||
let open_file_clicked: null|boolean = $state(null);
|
||||
let open_file_status: null|string = $state(null); // null, 'checking_cache', 'checking_cache_failed', 'downloading_file', 'downloading_file_failed', 'opening_file', 'opening_file_failed', 'opening_file_success'
|
||||
let open_file_status_message: null|string = $state(null);
|
||||
|
||||
if (!$events_loc.launcher.screen_saver_img_kv) {
|
||||
$events_loc.launcher.screen_saver_img_kv = {};
|
||||
@@ -264,7 +270,7 @@ async function handle_open_file() {
|
||||
<p>Please close the file when finished.</p>
|
||||
{:else}
|
||||
<strong>*** Please wait while this file downloads... ***</strong>
|
||||
<p>Onsite in the Speaker Ready Room and conference session rooms:
|
||||
<p>Onsite in the Speaker Ready Room and conference session rooms:</p>
|
||||
<ul>
|
||||
<li>Most files will automatically be opened full screen.</li>
|
||||
<li>PowerPoint or KeyNote will attempt to display in presenter view.</li>
|
||||
@@ -292,7 +298,7 @@ async function handle_open_file() {
|
||||
<span class="fas fa-paper-plane" class:hidden="{hide_launch_icon}"></span> {ae_util.shorten_filename({filename: event_file_obj.filename, max_length: max_filename_length})}
|
||||
</a> -->
|
||||
<button
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
$events_sess.launcher.modal__open = event_file_obj.event_file_id_random;
|
||||
if (!modal_title) {
|
||||
modal_title = event_file_obj.filename;
|
||||
@@ -367,7 +373,7 @@ async function handle_open_file() {
|
||||
href="/event/file/{event_file_obj.event_file_id_random}/download?use_os=true"
|
||||
download
|
||||
class="ae_btn btn_info {btn_size}"
|
||||
on:click|preventDefault={() => {handle_open_file();}}
|
||||
onclick={preventDefault(() => {handle_open_file();})}
|
||||
data-hash_sha256={event_file_obj.hash_sha256}
|
||||
data-filename={event_file_obj.filename}
|
||||
title={`${event_file_obj.filename} [A] -- SHA256 hash: ${event_file_obj.hash_sha256.slice(0, 10)}...`}
|
||||
@@ -393,7 +399,7 @@ async function handle_open_file() {
|
||||
<!-- Last [WORKING!] - Handle opening a file. This applies to all Launcher app modes (default, onsite, native) -->
|
||||
{:else}
|
||||
<button
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
let new_filename = event_file_obj.filename;
|
||||
|
||||
if ($events_loc.launcher.app_mode == 'onsite' && (event_file_obj.extension == 'ppt' || event_file_obj.extension == 'pptx') && event_file_obj.open_in_os == 'win') {
|
||||
@@ -466,18 +472,6 @@ async function handle_open_file() {
|
||||
{event_file_obj.file_purpose}
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<!-- <a
|
||||
href="/event/file/{event_file_obj.event_file_id_random}/download"
|
||||
download
|
||||
class="ae_btn btn_info {btn_size}"
|
||||
on:click={() => {handle_open_file();}}
|
||||
data-hash_sha256={event_file_obj.hash_sha256}
|
||||
data-filename={event_file_obj.filename}
|
||||
title={event_file_obj.filename}
|
||||
>
|
||||
<span class="fas fa-paper-plane" class:hidden="{hide_launch_icon}"></span> {ae_util.shorten_filename({filename: event_file_obj.filename, max_length: max_filename_length})}
|
||||
</a> -->
|
||||
{/if}
|
||||
|
||||
</span>
|
||||
@@ -489,7 +483,7 @@ async function handle_open_file() {
|
||||
>
|
||||
|
||||
<button
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
// let new_filename = event_file_obj.filename;
|
||||
|
||||
// if ($events_loc.launcher.app_mode == 'onsite' && (event_file_obj.extension == 'ppt' || event_file_obj.extension == 'pptx') && event_file_obj.open_in_os == 'win') {
|
||||
@@ -548,7 +542,7 @@ async function handle_open_file() {
|
||||
>
|
||||
<!-- {(event_file_obj?.open_in_os ? 'Hidden' : 'Not Hidden')} -->
|
||||
<button
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
// Go from null to win, win to mac, mac to null, null to win, etc.
|
||||
if (!event_file_obj?.open_in_os) {
|
||||
ae_tmp.value__open_in_os = 'win';
|
||||
@@ -564,7 +558,7 @@ async function handle_open_file() {
|
||||
// $events_slct.exhibit_tracking_obj.open_in_os = !event_file_obj?.open_in_os;
|
||||
ae_triggers.open_in_os = true;
|
||||
}}
|
||||
class="btn btn-sm transition-all hover:transition-all *:hover:inline"
|
||||
class="btn btn-sm transition-all group"
|
||||
class:preset-tonal-success={event_file_obj?.open_in_os=='win'}
|
||||
class:preset-tonal-warning={event_file_obj?.open_in_os=='mac'}
|
||||
disabled={!$ae_loc.trusted_access}
|
||||
@@ -572,18 +566,20 @@ async function handle_open_file() {
|
||||
>
|
||||
{#if event_file_obj?.open_in_os == 'win'}
|
||||
<span class="fab fa-windows m-1"></span>
|
||||
<span class="hidden group-hover:inline-block">
|
||||
Windows
|
||||
</span>
|
||||
{:else if event_file_obj?.open_in_os == 'mac'}
|
||||
<!-- <span class="fas fa-toggle-off m-1"></span> -->
|
||||
<span class="fab fa-apple m-1"></span>
|
||||
<span class="hidden">
|
||||
<span class="hidden group-hover:inline-block">
|
||||
macOS
|
||||
</span>
|
||||
{:else}
|
||||
<span class="fas fa-folder-open m-1"></span>
|
||||
<!-- <span class="hidden">
|
||||
<span class="hidden group-hover:inline-block">
|
||||
Default
|
||||
</span> -->
|
||||
</span>
|
||||
{/if}
|
||||
<!-- {@html (event_file_obj?.hide ? '<span class="fas fa-eye m-1"></span> Unhide?' : '<span class="fas fa-eye-slash m-1"></span> Hide?')} -->
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user