From 4fa59c3c0f07ec46a4caa7d44f9d895d34504416 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Thu, 8 Jan 2026 18:56:44 -0500 Subject: [PATCH] Saving these files that should be pretty good. --- .../journals/JournalEntry_Header.svelte | 9 + .../journals/JournalEntry_SettingsMenu.svelte | 201 +++++++++++------- 2 files changed, 135 insertions(+), 75 deletions(-) diff --git a/src/routes/journals/JournalEntry_Header.svelte b/src/routes/journals/JournalEntry_Header.svelte index 0fc6a4cc..4bdcf941 100644 --- a/src/routes/journals/JournalEntry_Header.svelte +++ b/src/routes/journals/JournalEntry_Header.svelte @@ -19,20 +19,26 @@ interface Props { entry: ae_JournalEntry; journal: ae_Journal; + journals_li?: ae_Journal[]; tmp_entry_obj: any; // Bindable has_changed: boolean; onSave: () => void; onDecrypt: () => void; + onDecryptHistory: () => void; + onChangeJournal: () => void; log_lvl?: number; } let { entry, journal, + journals_li = [], tmp_entry_obj = $bindable(), has_changed, onSave, onDecrypt, + onDecryptHistory, + onChangeJournal, log_lvl = 0 }: Props = $props(); @@ -209,8 +215,11 @@ p-2 md:p-3 rounded-lg shadow-md diff --git a/src/routes/journals/JournalEntry_SettingsMenu.svelte b/src/routes/journals/JournalEntry_SettingsMenu.svelte index 1367802f..c4258f1e 100644 --- a/src/routes/journals/JournalEntry_SettingsMenu.svelte +++ b/src/routes/journals/JournalEntry_SettingsMenu.svelte @@ -2,28 +2,43 @@ /** * JournalEntry_SettingsMenu.svelte * Extracted 2026-01-08 to modularize the Journal Entry Header. - * Manages Category, Priority, Sort, and Deletion. + * Manages Category, Flags, Copy/Clone, History, and Sort Order. */ import { Plus, Minus, ArrowDown10, Flag, FlagOff, Eye, EyeOff, ShieldCheck, ShieldMinus, - Clock, X, Trash2 + Clock, X, Trash2, Settings, Shapes, + Copy, RemoveFormatting, CodeXml, TypeOutline, + History, Pencil, PenLine, FileX, SquareLibrary } from '@lucide/svelte'; import { ae_loc, ae_api } from '$lib/stores/ae_stores'; - import { journals_slct } from '$lib/ae_journals/ae_journals_stores'; + import { journals_slct, journals_loc, journals_sess } from '$lib/ae_journals/ae_journals_stores'; import { journals_func } from '$lib/ae_journals/ae_journals_functions'; import { goto } from '$app/navigation'; + import AE_ObjectFlags from '$lib/ae_elements/AE_ObjectFlags.svelte'; import type { ae_JournalEntry, ae_Journal } from '$lib/types/ae_types'; interface Props { entry: ae_JournalEntry; journal: ae_Journal; + journals_li: ae_Journal[]; tmp_entry_obj: any; // Bindable onSave: () => void; + onDecryptHistory: () => void; + onChangeJournal: () => void; log_lvl?: number; } - let { entry, journal, tmp_entry_obj = $bindable(), onSave, log_lvl = 0 }: Props = $props(); + let { + entry, + journal, + journals_li = [], + tmp_entry_obj = $bindable(), + onSave, + onDecryptHistory, + onChangeJournal, + log_lvl = 0 + }: Props = $props(); async function delete_entry() { if (confirm(`Are you sure you want to delete this journal entry?`)) { @@ -46,97 +61,133 @@ } } } + + function copyToClipboard(text: string, msg: string) { + navigator.clipboard.writeText(text) + .then(() => alert(msg)) + .catch(err => console.error('Copy failed:', err)); + } + + async function copyRichText() { + const element = document.getElementById(`rendered_journal_entry_content_${entry.journal_entry_id}`); + if (!element) return; + try { + await navigator.clipboard.write([ + new ClipboardItem({ 'text/html': new Blob([element.innerHTML], { type: 'text/html' }) }) + ]); + alert('Rich text copied!'); + } catch (err) { + console.error('Rich copy failed:', err); + } + } -
- -
- +
+ +
+
- - + + - -
- - - {tmp_entry_obj.sort ?? entry.sort ?? 0} - - +
-
+
- -
- + +
+ + {#if entry.history || entry.history_encrypted} + + {/if} + + +
+ Sort Order +
+ + {tmp_entry_obj.sort ?? entry.sort ?? 0} + +
+
+
+ + +
+ + {#if entry.archive_on} - - {:else} - + {/if}
- - -
+
\ No newline at end of file