refactor(launcher): standardize helper names and apply batch formatting

- Renamed internal 'preventDefault' to 'prevent_default' in launcher files.
- Fixed native 'event.preventDefault()' call in launcher_file_cont.svelte.
- Applied batch formatting (printWidth: 80) across the (launcher) module.
This commit is contained in:
Scott Idem
2026-02-06 14:48:44 -05:00
parent 7ce5e1f825
commit 969e5610bb
26 changed files with 1536 additions and 604 deletions

View File

@@ -69,7 +69,9 @@
let lq__event_file_obj_li = $derived(
liveQuery(async () => {
if (log_lvl) {
console.log(`lq__event_file_obj: event_file_id = ${$events_slct?.event_file_id}`);
console.log(
`lq__event_file_obj: event_file_id = ${$events_slct?.event_file_id}`
);
}
let results = await db_events.file
// .where('event_session_id')
@@ -83,7 +85,10 @@
// Check if results are different than the current $events_slct.event_file_obj_li
if ($events_slct.event_file_obj_li && results) {
if (JSON.stringify($events_slct.event_file_obj_li) !== JSON.stringify(results)) {
if (
JSON.stringify($events_slct.event_file_obj_li) !==
JSON.stringify(results)
) {
$events_slct.event_file_obj_li = [...results];
if (log_lvl) {
console.log(
@@ -136,7 +141,10 @@
.sortBy(sort_by);
// .sortBy('name')
if (log_lvl) {
console.log(`lq__event_presentation_obj_li: results = `, results);
console.log(
`lq__event_presentation_obj_li: results = `,
results
);
}
// Check if results are different than the current $events_slct.event_presentation_obj_li
@@ -189,7 +197,8 @@
// Check if results are different than the current $events_slct.event_presenter_obj_li
if ($events_slct.event_presenter_obj_li && results) {
if (
JSON.stringify($events_slct.event_presenter_obj_li) !== JSON.stringify(results)
JSON.stringify($events_slct.event_presenter_obj_li) !==
JSON.stringify(results)
) {
$events_slct.event_presenter_obj_li = { ...results };
if (log_lvl) {
@@ -277,9 +286,12 @@
$events_loc.launcher.hide__session_datetimes}
class="shrink event_session_datetimes"
>
<button type="button"
<button
type="button"
onclick={() => {
if ($events_loc.launcher.time_format == 'time_12_short') {
if (
$events_loc.launcher.time_format == 'time_12_short'
) {
// $events_loc.launcher.datetime_format = 'datetime_long';
$events_loc.launcher.time_format = 'time_short';
$events_loc.launcher.time_hours = 24;
@@ -319,8 +331,10 @@
</h3>
<span
class:justify-between={$events_loc.launcher.hide__session_datetimes}
class:justify-end={!$events_loc.launcher.hide__session_datetimes}
class:justify-between={$events_loc.launcher
.hide__session_datetimes}
class:justify-end={!$events_loc.launcher
.hide__session_datetimes}
class="grow flex flex-row gap-2 items-center"
>
<h2
@@ -363,7 +377,10 @@
<span class="fas fa-file-archive"></span>
Session Files:
<span class:hidden={!$ae_loc.trusted_access || !$ae_loc.edit_mode}>
<span
class:hidden={!$ae_loc.trusted_access ||
!$ae_loc.edit_mode}
>
({$lq__event_file_obj_li?.length}&times;)
</span>
</strong>
@@ -384,22 +401,29 @@
{#each $lq__event_file_obj_li as event_file_obj, index}
<li
class="flex flex-row flex-wrap gap-1 items-center justify-center"
class:hidden={!$events_loc.launcher.show_content__hidden_files &&
class:hidden={!$events_loc.launcher
.show_content__hidden_files &&
event_file_obj.hide}
>
<Event_launcher_file_cont
event_file_id={event_file_obj.event_file_id}
{event_file_obj}
hide_created_on={true}
show_bak_download={$ae_loc.trusted_access && $ae_loc.edit_mode}
session_type={event_file_obj?.event_session_type_code ?? 'oral'}
open_method={event_file_obj?.event_session_type_code == 'poster'
show_bak_download={$ae_loc.trusted_access &&
$ae_loc.edit_mode}
session_type={event_file_obj?.event_session_type_code ??
'oral'}
open_method={event_file_obj?.event_session_type_code ==
'poster'
? 'modal'
: null}
modal_title={$lq__event_session_obj?.name}
bind:modal__title={$events_sess.launcher.modal__title}
bind:modal__title={
$events_sess.launcher.modal__title
}
bind:modal__open_event_file_id={
$events_sess.launcher.modal__open_event_file_id
$events_sess.launcher
.modal__open_event_file_id
}
bind:modal__event_file_obj={
$events_sess.launcher.modal__event_file_obj
@@ -449,7 +473,9 @@
<!-- Maybe set max with? max-w-(--breakpoint-md) -->
<ul class="event_presentation_list max-w-full space-y-2">
{#each $lq__event_presentation_obj_li as event_presentation_obj}
<li class="border-b-2 border-gray-300 my-1 py-1 text-center md:text-left">
<li
class="border-b-2 border-gray-300 my-1 py-1 text-center md:text-left"
>
<!-- The presentation information -->
<div
class="event_presentation_datetime_name flex flex-row justify-evenly gap-4"
@@ -479,12 +505,17 @@
class="event_presentation_single_presenter italic text-sm text-gray-500"
>
{#if $lq__event_presenter_obj_li[index]?.given_name && $lq__event_presenter_obj_li[index]?.given_name != 'Group'}
<span class="fas fa-user"></span>
{$lq__event_presenter_obj_li[index]?.full_name}
<span class="fas fa-user"
></span>
{$lq__event_presenter_obj_li[
index
]?.full_name}
{:else if $lq__event_presenter_obj_li[index]?.given_name == 'Group'}
<span class="fas fa-users"></span>
{$lq__event_presenter_obj_li[index]
?.affiliations}
<span class="fas fa-users"
></span>
{$lq__event_presenter_obj_li[
index
]?.affiliations}
{:else}
--not set--
{/if}
@@ -495,7 +526,9 @@
</div>
<!-- Presentation-level files -->
<Launcher_presentation_view lq__event_presentation_obj={event_presentation_obj} />
<Launcher_presentation_view
lq__event_presentation_obj={event_presentation_obj}
/>
<!-- The presenter list -->