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'}
+ {#if has_changed}
+
+ {:else}
+
+ {/if}
+ {:else}
+
+ {/if}
+
+
+
+ {#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'}
+
+
+ {entry.category_code}
+
+ {/if}
+
+
+
+ toggle_property('public')}
+ class="btn-icon btn-icon-sm preset-tonal-secondary hover:preset-filled-secondary-500 transition"
+ title="Toggle public visibility"
+ >
+
+
+
+
+ toggle_property('personal')}
+ class="btn-icon btn-icon-sm preset-tonal-secondary hover:preset-filled-secondary-500 transition"
+ title="Toggle personal visibility"
+ >
+
+
+
+
+ toggle_property('professional')}
+ class="btn-icon btn-icon-sm preset-tonal-secondary hover:preset-filled-secondary-500 transition"
+ title="Toggle professional visibility"
+ >
+
+
+
+
+
+ {
+ if (!entry.private && entry.content) {
+ if (confirm('Encrypt and resave this entry?')) {
+ tmp_entry_obj.private = true;
+ onSave();
+ }
+ } else if (entry.private && entry.content_encrypted) {
+ if (confirm('Decrypt and resave unencrypted?')) {
+ tmp_entry_obj.private = false;
+ onSave();
+ }
+ }
+ }}
+ class="btn-icon btn-icon-sm preset-tonal-secondary hover:preset-filled-secondary-500 transition"
+ title="Toggle privacy"
+ >
+
+
+
+ {#if entry.private && entry.content_encrypted}
+
+ {#if tmp_entry_obj?.content}
+
+ {:else}
+
+ {/if}
+
+ {/if}
+
+
+
+
+ ($journals_sess.entry.show_menu = !$journals_sess.entry.show_menu)}
+ class="btn btn-sm variant-outline-secondary hover:preset-filled-secondary-500 py-1 px-2 w-24 transition-all"
+ class:preset-filled-warning-500={$journals_sess.entry.show_menu}
+ >
+
+ Menu
+
+
+ {#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 @@
+
+
+
+
+
+ Category:
+
+ Select Category
+ {#each journal?.cfg_json.category_li ?? [] as category}
+ {category.name}
+ {/each}
+
+
+
+
+
{
+ tmp_entry_obj.priority = !entry.priority;
+ onSave();
+ }}
+ class="btn w-full mb-2 preset-tonal-tertiary transition hover:preset-filled-tertiary-500"
+ >
+ {#if entry.priority}
+
+ {:else}
+
+ {/if}
+ Priority Status
+
+
+
+
+
{
+ tmp_entry_obj.sort = (entry.sort ?? 0) + 1;
+ onSave();
+ }}
+ class="btn-icon btn-icon-sm preset-tonal-surface hover:preset-filled-secondary-500"
+ >
+
+
+
+ {tmp_entry_obj.sort ?? entry.sort ?? 0}
+
+
{
+ tmp_entry_obj.sort = Math.max(0, (entry.sort ?? 0) - 1);
+ onSave();
+ }}
+ class="btn-icon btn-icon-sm preset-tonal-surface hover:preset-filled-secondary-500"
+ >
+
+
+
+
+
+
+
+
+
+ {#if entry.archive_on}
+ { tmp_entry_obj.archive_on = null; onSave(); }} class="text-error-500">
+
+
+ {:else}
+ { tmp_entry_obj.archive_on = new Date().toISOString().slice(0, 16); onSave(); }} class="text-primary-500">
+
+
+ {/if}
+
+
+
+
+
+ Delete Entry
+
+
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}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-