diff --git a/website/src/lib/components/Shortcut.svelte b/website/src/lib/components/Shortcut.svelte index 2d892035..914716b4 100644 --- a/website/src/lib/components/Shortcut.svelte +++ b/website/src/lib/components/Shortcut.svelte @@ -1,26 +1,27 @@
- {shift ? '⇧' : ''} - {ctrl ? (isMac && !isSafari ? '⌘' : $_('menu.ctrl') + '+') : ''} - {key} - {click ? $_('menu.click') : ''} + {shift ? '⇧' : ''} + {ctrl ? (mac && !safari ? '⌘' : $_('menu.ctrl') + '+') : ''} + {key} + {click ? $_('menu.click') : ''}
diff --git a/website/src/lib/components/file-list/FileListNodeContent.svelte b/website/src/lib/components/file-list/FileListNodeContent.svelte index 37defd5d..5ce40fc5 100644 --- a/website/src/lib/components/file-list/FileListNodeContent.svelte +++ b/website/src/lib/components/file-list/FileListNodeContent.svelte @@ -1,364 +1,374 @@
- {#if node instanceof Map} - {#each node as [fileId, file] (fileId)} -
- -
- {/each} - {:else if node instanceof GPXFile} - {#if item instanceof ListWaypointsItem} - {#each node.wpt as wpt, i (wpt)} -
- -
- {/each} - {:else if waypointRoot} - {#if node.wpt.length > 0} -
- -
- {/if} - {:else} - {#each node.children as child, i (child)} -
- -
- {/each} - {/if} - {:else if node instanceof Track} - {#each node.children as child, i (child)} -
- -
- {/each} - {/if} + {#if node instanceof Map} + {#each node as [fileId, file] (fileId)} +
+ +
+ {/each} + {:else if node instanceof GPXFile} + {#if item instanceof ListWaypointsItem} + {#each node.wpt as wpt, i (wpt)} +
+ +
+ {/each} + {:else if waypointRoot} + {#if node.wpt.length > 0} +
+ +
+ {/if} + {:else} + {#each node.children as child, i (child)} +
+ +
+ {/each} + {/if} + {:else if node instanceof Track} + {#each node.children as child, i (child)} +
+ +
+ {/each} + {/if}
{#if node instanceof GPXFile && item instanceof ListFileItem} - {#if !waypointRoot} - - {/if} + {#if !waypointRoot} + + {/if} {/if} diff --git a/website/src/lib/utils.ts b/website/src/lib/utils.ts index ac863eac..3f534743 100644 --- a/website/src/lib/utils.ts +++ b/website/src/lib/utils.ts @@ -178,6 +178,14 @@ export function setScissorsCursor() { setCursor(scissorsCursor); } +export function isMac() { + return navigator.userAgent.toUpperCase().indexOf('MAC') >= 0; +} + +export function isSafari() { + return /^((?!chrome|android).)*safari/i.test(navigator.userAgent); +} + export function getURLForLanguage(lang: string | null | undefined, path: string): string { let newPath = path.replace(base, ''); let languageInPath = newPath.split('/')[1];