Fork pd_web, remove everything we don't need
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import { fs_encode_path, fs_node_icon } from "filesystem/FilesystemAPI"
|
||||
import { fs_encode_path, fs_node_icon, node_is_shared } from "filesystem/FilesystemAPI"
|
||||
import type { FSNavigator } from "filesystem/FSNavigator";
|
||||
import { FileAction } from "./FileManagerLib";
|
||||
|
||||
@@ -26,7 +26,7 @@ export let hide_edit = false
|
||||
<div class="node_name">
|
||||
{child.name}
|
||||
</div>
|
||||
{#if child.id}
|
||||
{#if node_is_shared(child)}
|
||||
<a
|
||||
href="/d/{child.id}"
|
||||
on:click={e => dispatch("file", {index: index, action: FileAction.Share, original: e})}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
<script lang="ts">
|
||||
import FilePicker from "file_viewer/FilePicker.svelte";
|
||||
import { fs_import } from "filesystem/FilesystemAPI";
|
||||
import type { FSNavigator } from "filesystem/FSNavigator";
|
||||
|
||||
export let nav: FSNavigator
|
||||
let file_picker: FilePicker
|
||||
|
||||
export const open = () => file_picker.open()
|
||||
|
||||
// TODO: Give files a proper type
|
||||
const import_files = async (files: any) => {
|
||||
nav.set_loading(true)
|
||||
|
||||
let fileids = []
|
||||
files.forEach(file => {
|
||||
fileids.push(file.id)
|
||||
})
|
||||
|
||||
try {
|
||||
await fs_import(nav.base.path, fileids)
|
||||
} catch (err) {
|
||||
if (err.message) {
|
||||
alert(err.message)
|
||||
} else {
|
||||
console.error(err)
|
||||
alert(err)
|
||||
}
|
||||
return
|
||||
} finally {
|
||||
nav.reload()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<FilePicker
|
||||
bind:this={file_picker}
|
||||
on:files={e => {import_files(e.detail)}}
|
||||
multi_select={true}
|
||||
title="Import files from file list">
|
||||
</FilePicker>
|
||||
@@ -6,7 +6,6 @@ import ListView from "./ListView.svelte"
|
||||
import GalleryView from "./GalleryView.svelte"
|
||||
import CompactView from "./CompactView.svelte"
|
||||
import Button from "layout/Button.svelte";
|
||||
import FileImporter from "./FileImporter.svelte";
|
||||
import { formatDate } from "util/Formatting";
|
||||
import { drop_target } from "lib/DropTarget"
|
||||
import SearchBar from "./SearchBar.svelte";
|
||||
@@ -24,7 +23,6 @@ let uploader: FsUploadWidget
|
||||
let mode = "viewing"
|
||||
let creating_dir = false
|
||||
let show_hidden = false
|
||||
let file_importer: FileImporter
|
||||
|
||||
export const upload = (files: File[]) => {
|
||||
return uploader.upload(files)
|
||||
@@ -303,8 +301,6 @@ onMount(() => {
|
||||
>
|
||||
<div class="width_container">
|
||||
{#if mode === "viewing"}
|
||||
<SearchBar nav={nav}/>
|
||||
|
||||
<div class="toolbar">
|
||||
<div class="toolbar_left">
|
||||
<button on:click={navigate_back} title="Back">
|
||||
@@ -350,16 +346,15 @@ onMount(() => {
|
||||
|
||||
<Button click={() => {creating_dir = !creating_dir}} highlight={creating_dir} icon="create_new_folder" title="Make folder"/>
|
||||
|
||||
<button on:click={() => file_importer.open()} title="Import files from list">
|
||||
<i class="icon">move_to_inbox</i>
|
||||
</button>
|
||||
|
||||
<button on:click={selecting_mode} title="Select and delete files">
|
||||
<i class="icon">select_all</i>
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<SearchBar nav={nav}/>
|
||||
|
||||
{:else if mode === "selecting"}
|
||||
<div class="toolbar toolbar_edit">
|
||||
<Button click={viewing_mode} icon="close"/>
|
||||
@@ -415,8 +410,6 @@ onMount(() => {
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<FileImporter nav={nav} bind:this={file_importer} />
|
||||
|
||||
<style>
|
||||
.container {
|
||||
height: 100%;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import { formatDataVolume } from "util/Formatting";
|
||||
import { fs_encode_path, fs_node_icon } from "filesystem/FilesystemAPI"
|
||||
import { fs_encode_path, fs_node_icon, node_is_shared } from "filesystem/FilesystemAPI"
|
||||
import type { FSNavigator } from "filesystem/FSNavigator";
|
||||
import SortButton from "layout/SortButton.svelte";
|
||||
import { FileAction } from "./FileManagerLib";
|
||||
@@ -46,7 +46,7 @@ export let hide_branding = false
|
||||
<div class="icons_wrap">
|
||||
{#if child.abuse_type !== undefined}
|
||||
<i class="icon" title="This file / directory has received an abuse report. It cannot be shared">block</i>
|
||||
{:else if child.id}
|
||||
{:else if node_is_shared(child)}
|
||||
<a
|
||||
href="/d/{child.id}"
|
||||
on:click={e => dispatch("file", {index: index, action: FileAction.Share, original: e})}
|
||||
|
||||
Reference in New Issue
Block a user