diff --git a/website/src/lib/components/FileList.svelte b/website/src/lib/components/FileList.svelte
index aaa6703c..3d1c4d9e 100644
--- a/website/src/lib/components/FileList.svelte
+++ b/website/src/lib/components/FileList.svelte
@@ -1,16 +1,30 @@
-
-
- {#each $files as file}
-
- {/each}
-
-
+
+
+
+
+ {#each $files as file}
+
+ {/each}
+
+
+
diff --git a/website/src/lib/components/GPX.svelte b/website/src/lib/components/GPX.svelte
index e3f9cb64..d502d413 100644
--- a/website/src/lib/components/GPX.svelte
+++ b/website/src/lib/components/GPX.svelte
@@ -32,17 +32,42 @@
colorCount[color]++;
return color;
}
+
+ function decrementColor(color: string) {
+ colorCount[color]--;
+ }
diff --git a/website/src/lib/components/Menu.svelte b/website/src/lib/components/Menu.svelte
index 48efda4a..d3b55507 100644
--- a/website/src/lib/components/Menu.svelte
+++ b/website/src/lib/components/Menu.svelte
@@ -15,7 +15,16 @@
import Fa from 'svelte-fa';
import { faGoogleDrive } from '@fortawesome/free-brands-svg-icons';
- import { triggerFileInput } from '$lib/stores';
+ import {
+ files,
+ selectedFiles,
+ duplicateSelectedFiles,
+ exportAllFiles,
+ exportSelectedFiles,
+ removeAllFiles,
+ removeSelectedFiles,
+ triggerFileInput
+ } from '$lib/stores';
let distanceUnits = 'metric';
let velocityUnits = 'speed';
@@ -45,14 +54,14 @@
Load from Google Drive...
-
+
Duplicate ⌘D
-
+
Export... ⌘S
-
+
Export all... ⇧⌘S
@@ -69,12 +78,16 @@
Redo ⇧⌘Z
- Delete ⌘⌫
+ Delete ⌘⌫
- Delete all⇧⌘⌫
+ Delete all⇧⌘⌫
@@ -134,6 +147,34 @@
+ {
+ e.stopImmediatePropagation();
+ if (e.key === 'o' && (e.metaKey || e.ctrlKey)) {
+ triggerFileInput();
+ e.preventDefault();
+ } else if (e.key === 'd' && (e.metaKey || e.ctrlKey)) {
+ duplicateSelectedFiles();
+ e.preventDefault();
+ } else if (e.key === 's' && (e.metaKey || e.ctrlKey)) {
+ if (e.shiftKey) {
+ exportAllFiles();
+ } else {
+ exportSelectedFiles();
+ }
+ e.preventDefault();
+ } else if ((e.key === 'Backspace' || e.key === 'Delete') && (e.metaKey || e.ctrlKey)) {
+ if (e.shiftKey) {
+ console.log('removeAllFiles');
+ removeAllFiles();
+ } else {
+ removeSelectedFiles();
+ }
+ e.preventDefault();
+ }
+ }}
+/>
+