Add directory uploader
This commit is contained in:
@@ -108,11 +108,6 @@ let handle_errors = (response) => {
|
||||
</script>
|
||||
|
||||
<form method="POST" on:submit={submit}>
|
||||
{#if loading}
|
||||
<div class="spinner_container">
|
||||
<Spinner></Spinner>
|
||||
</div>
|
||||
{/if}
|
||||
{#if submitted}
|
||||
{#if submit_result.messages}
|
||||
<div id="submit_result" class:highlight_green={submit_result.success} class:highlight_red={!submit_result.success}>
|
||||
@@ -239,15 +234,20 @@ let handle_errors = (response) => {
|
||||
<button type="submit" class="button_highlight">{@html config.submit_label}</button>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{#if loading}
|
||||
<div class="spinner_container">
|
||||
<Spinner></Spinner>
|
||||
</div>
|
||||
{/if}
|
||||
</form>
|
||||
|
||||
<style>
|
||||
.spinner_container {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
right: 10px;
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
z-index: 1000;
|
||||
}
|
||||
</style>
|
||||
|
@@ -17,6 +17,5 @@ export let loading = false
|
||||
right: 10px;
|
||||
height: 120px;
|
||||
width: 120px;
|
||||
z-index: 1000;
|
||||
}
|
||||
</style>
|
||||
|
@@ -56,11 +56,11 @@ export const upload_file = (file, name, on_progress, on_success, on_error) => {
|
||||
resp = JSON.parse(xhr.response)
|
||||
}
|
||||
|
||||
on_failure(resp.value, resp.message)
|
||||
on_error(resp.value, resp.message)
|
||||
} else if (xhr.status === 0) {
|
||||
on_failure("request_failed", "Your request did not arrive, check your network connection")
|
||||
on_error("request_failed", "Your request did not arrive, check your network connection")
|
||||
} else {
|
||||
on_failure(xhr.responseText, xhr.responseText)
|
||||
on_error(xhr.responseText, xhr.responseText)
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import { fade } from "svelte/transition";
|
||||
import { fade } from "svelte/transition";
|
||||
import ProgressBar from "../ProgressBar.svelte";
|
||||
import { upload_file } from "./UploadFunc";
|
||||
|
||||
|
Reference in New Issue
Block a user