diff --git a/svelte/src/file_viewer/FileViewer.svelte b/svelte/src/file_viewer/FileViewer.svelte index e5a27d2..f848082 100644 --- a/svelte/src/file_viewer/FileViewer.svelte +++ b/svelte/src/file_viewer/FileViewer.svelte @@ -241,6 +241,9 @@ let custom_header_link = "" let custom_background = "" let custom_footer = "" let custom_footer_link = "" +let disable_download_button = false +let disable_share_button = false +let disable_menu = false const apply_customizations = file => { if (!file.branding) { return @@ -257,6 +260,18 @@ const apply_customizations = file => { if (file.branding.footer_link) { custom_footer_link = file.branding.footer_link } + if (file.branding.disable_download_button && !file.can_edit) { + disable_download_button = true + } + if (file.branding.disable_share_button && !file.can_edit) { + disable_share_button = true + } + if (file.branding.disable_menu && !file.can_edit) { + disable_menu = true + if (toolbar_visible) { + toolbar_toggle() + } + } if (file.branding.background_image) { custom_background = window.api_endpoint+"/file/"+file.branding.background_image @@ -380,13 +395,15 @@ const keyboard_event = evt => {
- + {#if !disable_menu} + + {/if} {
- {#if view === "file" && file.can_download} + {#if view === "file" && file.can_download && !disable_download_button} {/if} - {#if is_list && list_downloadable} + {#if is_list && list_downloadable && !disable_download_button} - + {#if !disable_share_button} + + {/if} {/if} - + {#if !disable_download_button} + + {/if} {#if view === "file"} {/if} diff --git a/svelte/src/home_page/FeatureTable.svelte b/svelte/src/home_page/FeatureTable.svelte index efa65d9..11ac281 100644 --- a/svelte/src/home_page/FeatureTable.svelte +++ b/svelte/src/home_page/FeatureTable.svelte @@ -29,7 +29,7 @@ onMount(() => { Data transfer limit
- Download limit of 20 GB per day + Download limit of 10 GB per day (24 hours). When this threshold is reached your download speed will be reduced to 1 MiB/s
diff --git a/svelte/src/user_home/PageBranding.svelte b/svelte/src/user_home/PageBranding.svelte index e10bba2..ebdb94a 100644 --- a/svelte/src/user_home/PageBranding.svelte +++ b/svelte/src/user_home/PageBranding.svelte @@ -19,6 +19,9 @@ let header_link = "" let background_image = "" let footer_image = "" let footer_link = "" +let disable_download_button = false +let disable_share_button = false +let disable_menu = false let select_file = t => { currently_selecting = t @@ -55,6 +58,9 @@ let save = async () => { form.append("background_image", background_image) form.append("footer_image", footer_image) form.append("footer_link", footer_link) + form.append("disable_download_button", disable_download_button) + form.append("disable_share_button", disable_share_button) + form.append("disable_menu", disable_menu) try { const resp = await fetch( @@ -86,6 +92,9 @@ onMount(() => { background_image = b.background_image ? b.background_image : "" footer_image = b.footer_image ? b.footer_image : "" footer_link = b.footer_link ? b.footer_link : "" + disable_download_button = b.disable_download_button ? b.disable_download_button : false + disable_share_button = b.disable_share_button ? b.disable_share_button : false + disable_menu = b.disable_menu ? b.disable_menu : false } }) @@ -202,6 +211,50 @@ onMount(() => { {/if} + +

Toolbar buttons

+

+ If you don't want to make it obvious that your files can be downloaded + or shared while still allowing people to view them through the site you + can use these options. +

+

+ The buttons will be hidden, however your files can still be downloaded + and shared through the API. The changes are purely cosmetic. +

+

+ For convenience these options only apply when other people view your + files. The buttons are still available to you. If you want to see the + effects you can open your file in an incognito window. +

+ Disable download button: + +
+ Disable share button: + +

+ You can also choose the hide the menu bar altogether +

+ Disable menu: +