diff --git a/svelte/src/filesystem/Breadcrumbs.svelte b/svelte/src/filesystem/Breadcrumbs.svelte index 400923d..ad0be00 100644 --- a/svelte/src/filesystem/Breadcrumbs.svelte +++ b/svelte/src/filesystem/Breadcrumbs.svelte @@ -36,7 +36,7 @@ onMount(() => { {:else if node.is_shared()} share {/if} -
+
10}> {node.name}
@@ -64,6 +64,9 @@ onMount(() => { text-overflow: ellipsis; white-space: nowrap; } +.small { + max-width: 10vw; +} .base { /* The base name uses all available space */ max-width: unset; diff --git a/svelte/src/filesystem/ShareDialog.svelte b/svelte/src/filesystem/ShareDialog.svelte index 645e85d..e596e91 100644 --- a/svelte/src/filesystem/ShareDialog.svelte +++ b/svelte/src/filesystem/ShareDialog.svelte @@ -1,11 +1,11 @@ -
@@ -118,15 +116,13 @@ const share = async () => {
- {#if toast !== ""} -
{toast}
-
- {/if} -
Sharing link
@@ -135,11 +131,14 @@ const share = async () => { - {#if is_parent} + {#if share_parent}
This link also gives access to diff --git a/svelte/src/filesystem/Toolbar.svelte b/svelte/src/filesystem/Toolbar.svelte index 84e9d13..1429a98 100644 --- a/svelte/src/filesystem/Toolbar.svelte +++ b/svelte/src/filesystem/Toolbar.svelte @@ -40,7 +40,6 @@ export const copy_link = () => {
-
{/if} diff --git a/svelte/src/filesystem/edit_window/SharingOptions.svelte b/svelte/src/filesystem/edit_window/SharingOptions.svelte index 4fdbb04..e4bf67c 100644 --- a/svelte/src/filesystem/edit_window/SharingOptions.svelte +++ b/svelte/src/filesystem/edit_window/SharingOptions.svelte @@ -4,7 +4,6 @@ import CopyButton from "layout/CopyButton.svelte"; import { formatDate } from "util/Formatting"; import { type FSNode, type NodeOptions } from "lib/FilesystemAPI.svelte"; import AccessControl from "./AccessControl.svelte"; -import { onMount } from 'svelte'; import { user } from "lib/UserStore"; let { @@ -15,27 +14,24 @@ let { options: NodeOptions; } = $props(); -let embed_html: string = $state() -let preview_area: HTMLDivElement = $state() - -const embed_iframe = (file: FSNode, options: NodeOptions) => { - if (!file.is_shared()) { - example = false - embed_html = "File is not shared, can't generate embed code" - return +let is_shared = $derived(file.is_shared() || options.link_permissions?.read) +let embed_html: string = $derived.by(() => { + if (!is_shared) { + return "File is not shared, can't generate embed code" } let url = domain_url()+"/d/"+file.id - embed_html = `` -} +}) +let preview_area: HTMLDivElement = $state() let example = $state(false) const toggle_example = () => { - if (file.is_shared()) { + if (is_shared) { example = !example if (example) { preview_area.innerHTML = embed_html @@ -46,9 +42,6 @@ const toggle_example = () => { } let share_link = $derived(window.location.protocol+"//"+window.location.host+"/d/"+file.id) -onMount(() => { - embed_iframe(file, options) -}); {#if $user.subscription.file_sharing === false} @@ -93,8 +86,8 @@ onMount(() => {

- Copy HTML -
diff --git a/svelte/src/filesystem/viewers/Audio.svelte b/svelte/src/filesystem/viewers/Audio.svelte index 37b5fd4..b9d0a93 100644 --- a/svelte/src/filesystem/viewers/Audio.svelte +++ b/svelte/src/filesystem/viewers/Audio.svelte @@ -91,16 +91,18 @@ onMount(() => {

Tracklist

- {#each siblings as sibling (sibling.path)} - - {#if sibling.path === $nav.base.path} - play_arrow - {:else} - icon - {/if} - {sibling.name} -
-
+ {#each siblings as sibling (sibling.id)} + {#if !sibling.is_hidden()} + + {#if sibling.path === $nav.base.path} + play_arrow + {:else} + icon + {/if} + {sibling.name} +
+
+ {/if} {/each}
diff --git a/svelte/src/layout/CopyButton.svelte b/svelte/src/layout/CopyButton.svelte index 6453d37..95557a2 100644 --- a/svelte/src/layout/CopyButton.svelte +++ b/svelte/src/layout/CopyButton.svelte @@ -6,6 +6,7 @@ let { style = "", large_icon = false, small_icon = false, + disabled = false, children, onclick, }: { @@ -13,6 +14,7 @@ let { style?: string; large_icon?: boolean; small_icon?: boolean; + disabled?: boolean; children?: import('svelte').Snippet; onclick?: (e: MouseEvent) => void; } = $props(); @@ -50,7 +52,7 @@ export const copy = (e: MouseEvent) => { class:large_icon class:small_icon title="Copy text to clipboard" - disabled={text === ""} + disabled={disabled} > content_copy