The Launcher works pretty well. Except for the native app...

This commit is contained in:
Scott Idem
2025-10-16 16:07:37 -04:00
parent 8d15a5ba0b
commit 8b22c0fc34
7 changed files with 97 additions and 65 deletions

View File

@@ -10,9 +10,12 @@ interface Props {
hide_created_on?: boolean;
hide_os?: boolean;
hide_size?: boolean;
hide_draft?: boolean; // Based on the file purpose
show_bak_download?: boolean;
// export let hide_api_download: boolean = true;
btn_size?: string;
text_size?: string;
text_size_md?: 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;
@@ -23,19 +26,22 @@ interface Props {
}
let {
log_lvl = 0,
log_lvl = $bindable(0),
event_file_id,
event_file_obj = $bindable({}),
max_filename_length = 50,
hide_launch_icon = false,
hide_meta = false,
hide_created_on = false,
hide_os = false,
hide_size = false,
max_filename_length = $bindable(50),
hide_launch_icon = $bindable(false),
hide_meta = $bindable(false),
hide_created_on = $bindable(false),
hide_os = $bindable(false),
hide_size = $bindable(false),
hide_draft = $bindable(false),
show_bak_download = false,
btn_size = 'btn_md',
session_type = 'oral',
open_method = 'download',
btn_size = $bindable('btn-sm'),
text_size = $bindable('text-sm'),
text_size_md = $bindable('md:text-base'),
session_type = $bindable('oral'),
open_method = $bindable('download'),
modal_title = $bindable(''),
modal__title = $bindable(''),
@@ -262,16 +268,18 @@ function preventDefault(fn) {
<div
class:justify-between={!hide_meta}
class:justify-center={hide_meta}
class:hidden={hide_draft && (event_file_obj.file_purpose == 'outline' || event_file_obj.file_purpose == 'draft')}
class="
event_launcher_file_cont
grow
flex flex-col md:flex-row flex-wrap
gap-1 items-center
gap-1 items-center justify-center
max-w-full
transition-all
"
class:justify-between={!hide_meta}
class:justify-center={hide_meta}
>
{#if open_file_clicked}
@@ -306,7 +314,7 @@ function preventDefault(fn) {
{/if}
<span class="event_file_action">
<span class="event_file_action grow max-w-full flex flex-row flex-wrap gap-1 items-center justify-center">
<!-- First [WORKING!] - Handle opening using a modal. This applies to all Launcher app modes (default, onsite, native) -->
{#if (session_type == 'poster' || open_method == 'modal')}
@@ -455,6 +463,9 @@ function preventDefault(fn) {
log_lvl: 1
});
$events_slct.event_file_id = event_file_id;
$events_slct.event_file_obj = event_file_obj;
// window.postMessage({ type: 'download_event_file', event_file_id: event_file_id, filename: event_file_obj.filename, auto_download: true }, '*');
if ($events_loc.launcher.controller == 'local_push') {
@@ -464,15 +475,18 @@ function preventDefault(fn) {
// tick();
}
}}
class:outline-2={$events_slct.event_file_id == event_file_id}
class="
btn btn-sm
btn {btn_size}
gap-1
min-w-full w-full max-w-96
preset-tonal-primary border border-primary-500
min-w-72 lg:min-w-96
"
title={`Download this file:\n${event_file_obj.filename}\n[API] SHA256: ${event_file_obj.hash_sha256.slice(0, 10)}...\nHosted ID: ${event_file_obj.hosted_file_id_random} Event File ID: ${event_file_id}`}
>
{#await ae_promises[event_file_id]}
<span class="text-sm">
<span class="shrink text-sm p-0">
<span class="fas fa-spinner fa-spin mx-0.5"></span>
<span class="">
Downloading
@@ -483,7 +497,7 @@ function preventDefault(fn) {
</span>
</span>
{:then result}
<span class="text-xs">
<span class="shrink text-xs">
<span class="fas fa-{ae_util.file_extension_icon(event_file_obj.extension)} mx-0.5"></span>
{event_file_obj.extension}
{#if result === null}
@@ -495,7 +509,12 @@ function preventDefault(fn) {
</span>
{/await}
<span class="grow text-xs md:text-sm border-l border-gray-400 pl-1">
<span
class="
grow {text_size} {text_size_md} max-w-96 border-l border-gray-400 pl-1
overflow-hidden text-ellipsis text-left
"
>
<!-- {event_file_obj.filename_no_ext} -->
<!-- {ae_util.shorten_filename({filename: event_file_obj.filename_w_ext, max_length: 40})} -->
{ae_util.shorten_string({string: event_file_obj.filename_no_ext, begin_length: 45, max_length: 65})}