From 671c74f25dbe097363b43f93039aaa9289f988db Mon Sep 17 00:00:00 2001 From: E44 <129310925+programmer-44@users.noreply.github.com> Date: Mon, 19 Jan 2026 18:57:56 +0100 Subject: [PATCH] chore(control): save text and url --- control/frontend/src/routes/ControlView.svelte | 5 +++-- control/frontend/src/routes/TipTapInput.svelte | 10 +++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/control/frontend/src/routes/ControlView.svelte b/control/frontend/src/routes/ControlView.svelte index 865cb41..0cec977 100644 --- a/control/frontend/src/routes/ControlView.svelte +++ b/control/frontend/src/routes/ControlView.svelte @@ -47,6 +47,8 @@ title: '', }); + let current_text = $state(''); + function popup_close_function() { popup_content.open = false; } @@ -144,7 +146,6 @@ await run_on_all_selected_displays((d) => show_html(d.ip, ``) ); - website_url = ''; } @@ -188,7 +189,7 @@ {/snippet} {#snippet text_popup()} - + {/snippet}
diff --git a/control/frontend/src/routes/TipTapInput.svelte b/control/frontend/src/routes/TipTapInput.svelte index 9388eb2..f2b78cd 100644 --- a/control/frontend/src/routes/TipTapInput.svelte +++ b/control/frontend/src/routes/TipTapInput.svelte @@ -20,6 +20,12 @@ import { Color } from '@tiptap/extension-text-style'; import Highlight from '@tiptap/extension-highlight'; + let { + text = $bindable() + }: { + text: string; + } = $props(); + type TextEditOption = { onclick: () => void; is_selected: () => boolean; @@ -128,15 +134,17 @@ multicolor: true }) ], - content: '', + content: text, onTransaction: ({ editor }) => { // Increment the state signal to force a re-render editor_state = { editor }; }, autofocus: true }); + editor_state.editor.commands.selectAll(); }); onDestroy(() => { + if (editor_state.editor) text = editor_state.editor.getHTML(); editor_state.editor?.destroy(); });