diff --git a/src/routes/journals/JournalEntry_Header.svelte b/src/routes/journals/JournalEntry_Header.svelte new file mode 100644 index 00000000..0fc6a4cc --- /dev/null +++ b/src/routes/journals/JournalEntry_Header.svelte @@ -0,0 +1,222 @@ + + +
+
+ + + +

+ {#if $journals_loc.entry.edit_kv[entry.journal_entry_id] == 'current'} + + {:else} + + {#if entry.name} + {@html entry.name} + {:else} + {ae_util.iso_datetime_formatter(entry.created_on, 'datetime_iso_12_no_seconds')} + {/if} + + {/if} +

+
+ +
+ +
+ + + {#if entry.category_code && $journals_loc.entry.edit_kv[entry.journal_entry_id] !== 'current'} + + {/if} + + + + + + + + + + + + + + + + {#if entry.private && entry.content_encrypted} + + {/if} + + + +
+ + + {#if $journals_sess.entry.show_menu} +
+ +
+ {/if} +
+
+
+
+
\ No newline at end of file diff --git a/src/routes/journals/JournalEntry_SettingsMenu.svelte b/src/routes/journals/JournalEntry_SettingsMenu.svelte new file mode 100644 index 00000000..1367802f --- /dev/null +++ b/src/routes/journals/JournalEntry_SettingsMenu.svelte @@ -0,0 +1,142 @@ + + +
+ +
+ + +
+ + + + + +
+ + + {tmp_entry_obj.sort ?? entry.sort ?? 0} + + +
+ +
+ + +
+ + {#if entry.archive_on} + + {:else} + + {/if} +
+ + + +
diff --git a/src/routes/journals/ae_comp__journal_entry_obj_id_view.svelte b/src/routes/journals/ae_comp__journal_entry_obj_id_view.svelte index fa911c03..bdb30b13 100644 --- a/src/routes/journals/ae_comp__journal_entry_obj_id_view.svelte +++ b/src/routes/journals/ae_comp__journal_entry_obj_id_view.svelte @@ -126,7 +126,7 @@ if (!tmp_entry_obj || !orig_entry_obj || not_obj(tmp_entry_obj) || not_obj(orig_entry_obj)) { return false; } - + return ( tmp_entry_obj.content !== orig_entry_obj.content || tmp_entry_obj.name !== orig_entry_obj.name || @@ -170,7 +170,7 @@ updated_obj = false; orig_entry_obj = { ...$lq__journal_entry_obj }; tmp_entry_obj = $lq__journal_entry_obj ? { ...$lq__journal_entry_obj } : {}; - + if ($journals_loc?.entry?.decrypt_kv[$lq__journal_entry_obj?.journal_entry_id]) { let decrypt_key = $lq__journal_obj.combined_passcode; @@ -216,16 +216,6 @@ console.log( 'TEST: tmp_entry_obj and orig_entry_obj available; marking tmp_entry_obj as changed' ); - // tmp_entry_obj_changed = JSON.stringify(tmp_entry_obj) != JSON.stringify($lq__journal_entry_obj); - // tmp_entry_obj_changed = JSON.stringify(tmp_entry_obj) != JSON.stringify(orig_entry_obj); - // if (!tmp_entry_obj?.private ) { - // tmp_entry_obj_changed = true; - // } else - // if (tmp_entry_obj?.private && tmp_entry_obj?.content) { - // tmp_entry_obj_changed = false; - // } else { - // tmp_entry_obj_changed = true; - // } tmp_entry_obj_changed = true; } else { // console.log('TEST: tmp_entry_obj == orig_entry_obj'); @@ -276,37 +266,12 @@ } }); - // // Old decrypted content and history handling - // $effect(() => { - // if ($journals_sess?.journal_kv[$lq__journal_obj?.id]?.journal_passcode_verified && tmp_entry_obj?.content_encrypted && !tmp_entry_obj.content) { - // console.log('TEST: Decrypting the content before displaying it...'); - // tmp_entry_obj.content = ae_util.decrypt_wrapper(tmp_entry_obj?.content_encrypted, journal_key); - // tmp_entry_obj.content_md_html = handle_marked(tmp_entry_obj?.content); - // } - - // if ($journals_sess?.journal_kv[$lq__journal_obj?.id]?.journal_passcode_verified && tmp_entry_obj?.history_encrypted && !tmp_entry_obj.history) { - // console.log('TEST: Decrypting the history before displaying it...'); - // tmp_entry_obj.history = ae_util.decrypt_wrapper(tmp_entry_obj?.history_encrypted, journal_key); - // tmp_entry_obj.history_md_html = handle_marked(tmp_entry_obj?.history); - // } - // }); - - // const test_html = marked.parse('# Marked in Node.js\n\nRendered by **marked**.'); - async function update_journal_entry() { if (!$ae_loc.trusted_access) { alert('You do not have permission to update this journal entry.'); return; } - // log_lvl = 1; - - // append slct_hosted_file_kv to data_json.hosted_file_kv - // if (!tmp_entry_obj.data_json.hosted_file_kv) { - // tmp_entry_obj.data_json.hosted_file_kv = {}; - // } - // tmp_entry_obj.data_json.hosted_file_kv = $journals_loc.entry.hosted_file_kv; - let data_kv: key_val = { alert: tmp_entry_obj?.alert, personal: tmp_entry_obj?.personal, @@ -631,7 +596,7 @@ async function handle_decrypt_string(encrypted_string: string, passcode: string) { if (log_lvl) console.log(`TEST: handle_decrypt_string: ${passcode}`, encrypted_string); - + if (!encrypted_string) return ''; if (!passcode) return false; @@ -677,7 +642,7 @@ function handle_marked(text_string: string) { if (!text_string) return ''; - + let cleaned_string = text_string.replace(/^[\u200B\u200C\u200D\u200E\u200F\uFEFF]/, ''); return marked.parse(cleaned_string); } @@ -724,7 +689,7 @@ type="button" onclick={() => { const isEditing = $journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id] === 'current'; - + if (isEditing) { if (tmp_entry_obj_changed) { // Action: SAVE @@ -2022,31 +1987,12 @@ {/if} - - - - -
- - - - - - - - - - - -
@@ -2754,11 +2666,6 @@ zzzz $journals_loc?.llm__api_dangerous_browser }); - // let resp__models = ai_client.models.list(); - // console.log('AI API Response (models)', resp__models); - - // let msg_role_system_content = $journals_loc?.entry?.llm__system_prompt || 'You are a helpful assistant that helps people find information.'; - // let msg_role_user_content = 'Why is the sky blue?'; let msg_role_user_content = tmp_entry_obj?.content; try { @@ -2851,9 +2758,6 @@ zzzz -