diff --git a/svelte/src/file_viewer/viewers/Text.svelte b/svelte/src/file_viewer/viewers/Text.svelte index bd6e02c..a476b62 100644 --- a/svelte/src/file_viewer/viewers/Text.svelte +++ b/svelte/src/file_viewer/viewers/Text.svelte @@ -1,7 +1,6 @@ {#each state.path as node, i (node.path)} + {@const shared = node.id !== undefined && node.id !== "me"} {navigator.navigate(node.path, true)}}> - {node.name} + on:click|preventDefault={() => {navigator.navigate(node.path, true)}} + > + {#if shared} + share + {/if} +
+ {node.name} +
{/each} @@ -17,8 +24,19 @@ export let navigator .breadcrumb { min-width: 1em; text-align: center; - padding: 6px 8px; margin: 4px; word-break: break-all; + padding: 0; + display: flex; + flex-direction: row; +} +.node_name { + margin: 6px 8px; +} +.nopad { + margin-left: 0; +} +.icon { + margin: 2px 4px; } diff --git a/svelte/src/filesystem/EditWindow.svelte b/svelte/src/filesystem/EditWindow.svelte index cabe493..83801e8 100644 --- a/svelte/src/filesystem/EditWindow.svelte +++ b/svelte/src/filesystem/EditWindow.svelte @@ -1,11 +1,9 @@ - -
-
- - - - - - - - - - - -
+ +
+ + +
+ + + {#if tab === "file"} +
+ File settings + + + + + Delete +

+ Delete this file or directory. If this is a directory then all + subfiles will be deleted as well. This action cannot be undone. +

+ +
+ {:else if tab === "share"} +
+ + Sharing settings + +

+ When a file or directory is shared it can be accessed + through a unique link. You can get the URL with the 'Copy + link' button on the toolbar, or share the link with the + 'Share' button. If you share a directory all the files + within the directory are also accessible from the link. +

+
+ + +
+ + + + +
+ {/if}
+ + diff --git a/svelte/src/filesystem/Filesystem.svelte b/svelte/src/filesystem/Filesystem.svelte index 23884dc..dbc9c3a 100644 --- a/svelte/src/filesystem/Filesystem.svelte +++ b/svelte/src/filesystem/Filesystem.svelte @@ -132,6 +132,8 @@ const download = () => { toolbar_visible={toolbar_visible} edit_window={edit_window} on:loading={e => {state.loading = e.detail}} + on:open_sibling={e => navigator.open_sibling(e.detail)} + on:download={download} /> @@ -151,7 +153,7 @@ const download = () => { bind:this={edit_window} bind:visible={edit_visible} bucket={state.root.id} - on:navigate={e => navigator.navigate(e.path, e.push_history)} + navigator={navigator} /> diff --git a/svelte/src/filesystem/FilesystemUtil.js b/svelte/src/filesystem/FilesystemUtil.js index 356175d..45ad9ce 100644 --- a/svelte/src/filesystem/FilesystemUtil.js +++ b/svelte/src/filesystem/FilesystemUtil.js @@ -16,7 +16,9 @@ export const fs_thumbnail_url = (bucket, path, width = 128, height = 128) => { } export const fs_node_type = node => { - if (node.file_type === "application/bittorrent" || node.file_type === "application/x-bittorrent") { + if (node.type === "dir") { + return "dir" + } else if (node.file_type === "application/bittorrent" || node.file_type === "application/x-bittorrent") { return "torrent" } else if (node.file_type === "application/zip") { return "zip" diff --git a/svelte/src/filesystem/Navigator.svelte b/svelte/src/filesystem/Navigator.svelte index 470e377..d3be534 100644 --- a/svelte/src/filesystem/Navigator.svelte +++ b/svelte/src/filesystem/Navigator.svelte @@ -1,6 +1,6 @@ +
- Share on:
- - - - - + {#if share_url !== ""} + Share on:
+ + + + + + {:else} + This file or directory is not currently shared. Would you like to make it sharable? + + {/if}
diff --git a/svelte/src/filesystem/viewers/FilePreview.svelte b/svelte/src/filesystem/viewers/FilePreview.svelte index cb2e2fe..da44bce 100644 --- a/svelte/src/filesystem/viewers/FilePreview.svelte +++ b/svelte/src/filesystem/viewers/FilePreview.svelte @@ -1,8 +1,10 @@ + + +
+
+		Loading...
+	
+
+ + diff --git a/svelte/src/util/Modal.svelte b/svelte/src/util/Modal.svelte index 47f5541..82dc0b9 100644 --- a/svelte/src/util/Modal.svelte +++ b/svelte/src/util/Modal.svelte @@ -3,10 +3,15 @@ // incremented every time a modal is shown let global_index = 10000; +