-
-
- {#if video_upload}
-
- {/if}
-
- {#if video_popup}
-
-
Popup open
+ {#if selected_type === null}
+
+
Select the Upload Type
+
+
+ {
+ selected_type = AvailableUploadTypes.Image;
+ }}>Image
+
+
+ {
+ selected_type = AvailableUploadTypes.Video;
+ }}
+ >Video
+
+
+
+ {
+ selected_type = AvailableUploadTypes.Library;
+ }}
+ >Library
+
+
- {:else}
+
+ {:else if selected_type === AvailableUploadTypes.Image}
+
+
+ {:else if selected_type === AvailableUploadTypes.Video}
+
+
Upload a Video
+ {#if video_popup}
+
+ The popup is open; have a look at it for further information
+
+ {:else}
+
Upload video
+ {/if}
+
+ {:else if selected_type === AvailableUploadTypes.Library}
+
+
+
+ {/if}
diff --git a/frontend/src/lib/editor/uploader/Library.svelte b/frontend/src/lib/editor/uploader/Library.svelte
new file mode 100644
index 0000000..2b703dd
--- /dev/null
+++ b/frontend/src/lib/editor/uploader/Library.svelte
@@ -0,0 +1,62 @@
+
+
+
+
+{#await image_fetch}
+
+{:then images}
+
+{/await}
diff --git a/frontend/src/lib/quiz_types.ts b/frontend/src/lib/quiz_types.ts
index 03bb640..614c6ac 100644
--- a/frontend/src/lib/quiz_types.ts
+++ b/frontend/src/lib/quiz_types.ts
@@ -88,3 +88,19 @@ export interface EditorData {
background_color?: string;
background_image?: string;
}
+
+export interface PrivateImageData {
+ id: string;
+ uploaded_at: string;
+ mime_type: string;
+ hash?: string;
+ size?: number;
+ deleted_at?: string;
+ alt_text?: string;
+ filename?: string;
+ thumbhash?: string;
+ server?: string;
+ imported: boolean;
+ quizzes: { id: string }[];
+ quiztivities: { id: string }[];
+}
diff --git a/frontend/src/routes/edit/files/+page.ts b/frontend/src/routes/edit/files/+page.ts
index e663cff..fae735a 100644
--- a/frontend/src/routes/edit/files/+page.ts
+++ b/frontend/src/routes/edit/files/+page.ts
@@ -4,26 +4,11 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import type { PageLoad } from './$types';
-
-export interface ImageData {
- id: string;
- uploaded_at: string;
- mime_type: string;
- hash?: string;
- size?: number;
- deleted_at?: string;
- alt_text?: string;
- filename?: string;
- thumbhash?: string;
- server?: string;
- imported: boolean;
- quizzes: { id: string }[];
- quiztivities: { id: string }[];
-}
+import type { PrivateImageData } from '$lib/quiz_types';
export const load = (async ({ fetch }) => {
const res = await fetch('/api/v1/storage/list');
- const json: ImageData[] = await res.json();
+ const json: PrivateImageData[] = await res.json();
return {
images: json
};