Add bulk download button for filesystem
This commit is contained in:
@@ -4,18 +4,15 @@ import { onMount } from "svelte"
|
|||||||
let ad_type = ""
|
let ad_type = ""
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
// 30% pixeldrain socials
|
// 40% pixeldrain socials
|
||||||
// 20% reviews
|
// 10% reviews
|
||||||
// 10% ad block promo
|
// 50% patreon
|
||||||
// 40% patreon
|
|
||||||
|
|
||||||
let rand = Math.random()
|
let rand = Math.random()
|
||||||
if (rand < 0.3) {
|
if (rand < 0.4) {
|
||||||
ad_type = "socials"
|
ad_type = "socials"
|
||||||
} else if (rand < 0.5) {
|
} else if (rand < 0.5) {
|
||||||
ad_type = "reviews"
|
ad_type = "reviews"
|
||||||
} else if (rand < 0.6) {
|
|
||||||
ad_type = "ad_block"
|
|
||||||
} else {
|
} else {
|
||||||
ad_type = "patreon_support"
|
ad_type = "patreon_support"
|
||||||
}
|
}
|
||||||
|
@@ -637,8 +637,7 @@ const keyboard_event = evt => {
|
|||||||
.headerbar > * {
|
.headerbar > * {
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin-left: 4px;
|
margin: 3px;
|
||||||
margin-right: 4px;
|
|
||||||
}
|
}
|
||||||
.headerbar > .file_viewer_headerbar_title {
|
.headerbar > .file_viewer_headerbar_title {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
@@ -94,7 +94,11 @@ const keydown = e => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const download = () => {
|
const download = () => {
|
||||||
download_frame.src = fs_path_url(state.base.path) + "?attach"
|
if (state.base.type === "file") {
|
||||||
|
download_frame.src = fs_path_url(state.base.path) + "?attach"
|
||||||
|
} else if (state.base.type === "dir") {
|
||||||
|
download_frame.src = fs_path_url(state.base.path) + "?bulk_download"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const search = async () => {
|
const search = async () => {
|
||||||
|
@@ -112,12 +112,10 @@ let expand = e => {
|
|||||||
|
|
||||||
<div class="separator hidden_horizontal"></div>
|
<div class="separator hidden_horizontal"></div>
|
||||||
|
|
||||||
{#if state.base.type === "file"}
|
<button on:click={() => dispatch("download")}>
|
||||||
<button on:click={() => dispatch("download")}>
|
<i class="icon">save</i>
|
||||||
<i class="icon">save</i>
|
<span>Download</span>
|
||||||
<span>Download</span>
|
</button>
|
||||||
</button>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{#if share_url !== ""}
|
{#if share_url !== ""}
|
||||||
<button on:click={copy_link} class:button_highlight={link_copied}>
|
<button on:click={copy_link} class:button_highlight={link_copied}>
|
||||||
|
Reference in New Issue
Block a user