diff --git a/README.md b/README.md index eaa0e971..8729b53f 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ View your JSON [DiscordChatExporter](Tyrrrz/DiscordChatExporter) exports as if y - Browse guild or direct messages - Discord Markdown rendering support - Command generator to extend your export with more messages (backup helper) +- Right click message and select "Open in discord" to jump to message in Discord @@ -71,6 +72,7 @@ This tool consists of two parts: ## Preprocessor For development make sure you have nodemon installed globally (used for hot reloading) ``` +nvm use 16.16.0 npm install -g nodemon ``` diff --git a/src/components/menu/ContextMenu.svelte b/src/components/menu/ContextMenu.svelte new file mode 100644 index 00000000..0efb4d0e --- /dev/null +++ b/src/components/menu/ContextMenu.svelte @@ -0,0 +1,24 @@ + + +{#if $visible} + + + +{/if} diff --git a/src/components/menu/Menu.svelte b/src/components/menu/Menu.svelte new file mode 100644 index 00000000..2d2fae21 --- /dev/null +++ b/src/components/menu/Menu.svelte @@ -0,0 +1,56 @@ + + + + + + +{#if $visible} +
+ +
+{/if} \ No newline at end of file diff --git a/src/components/menu/MenuOption.svelte b/src/components/menu/MenuOption.svelte new file mode 100644 index 00000000..17e7fde8 --- /dev/null +++ b/src/components/menu/MenuOption.svelte @@ -0,0 +1,48 @@ + + + + + diff --git a/src/components/menu/menuStore.ts b/src/components/menu/menuStore.ts new file mode 100644 index 00000000..572ecaab --- /dev/null +++ b/src/components/menu/menuStore.ts @@ -0,0 +1,9 @@ +import { writable } from "svelte/store"; + +export const isMenuVisible = writable(false); +export const position = writable({ x: 0, y: 0 }); + +export const setMenuVisible = (e) => { + position.set({ x: e.clientX, y: e.clientY }); + isMenuVisible.set(true); +} \ No newline at end of file diff --git a/src/helpers.ts b/src/helpers.ts index a977d76b..dbefa5da 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -29,7 +29,7 @@ export function copyTextToClipboard(text) { return; } navigator.clipboard.writeText(text).then(function () { - console.log('Async: Copying to clipboard was successful!'); + console.log('Async: Copying to clipboard was successful! Copied text: ' + text); }, function (err) { console.error('Async: Could not copy text: ', err); }); diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 1b3da190..f6e5e609 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,5 +1,5 @@ @@ -38,7 +56,7 @@
{data.guilds[data.guildId].name}
- {#if "usedJSHeapSize" in memoryUsage} + {#if $developerMode && "usedJSHeapSize" in memoryUsage}
Memory used:
{Math.round(memoryUsage.usedJSHeapSize / 1024 / 1024)} MB / {Math.round(memoryUsage.jsHeapSizeLimit / 1024 / 1024)} MB ({Math.round(memoryUsage.usedJSHeapSize / memoryUsage.jsHeapSizeLimit * 100)}%)
@@ -51,7 +69,7 @@
# {channel.name}onRightClick(e, channel.id)}># {channel.name} {#if channel.threads} {#each channel.threads as thread} @@ -61,7 +79,7 @@ + on:contextmenu|preventDefault={e=>onRightClick(e, thread.id)} > {/key} -
{/if}
+{#if rightClickId} + + copyTextToClipboard(BigInt(rightClickId))} + text="Copy channel ID" {visible} /> + +{/if} +