Skip to content

Build your personal knowledge base with Trilium Notes

display current note ID in editor (useful in Electron which doesn't have address bar)

azivner12f70b28c87d
diff --git a/public/javascripts/note_editor.js b/public/javascripts/note_editor.js
index bb75a2889d..354b5943c9 100644
--- a/public/javascripts/note_editor.js
+++ b/public/javascripts/note_editor.js
@@ -6,6 +6,8 @@ const noteEditor = (function() {
const protectButton = $("#protect-button");
const unprotectButton = $("#unprotect-button");
const noteDetailWrapperEl = $("#note-detail-wrapper");
+ const noteIdDisplayEl = $("#note-id-display");
+
let editor = null;
let currentNote = null;
@@ -101,6 +103,8 @@ const noteEditor = (function() {
noteTitleEl.focus().select();
}
+ noteIdDisplayEl.html(noteId);
+
await protected_session.ensureProtectedSession(currentNote.detail.is_protected, false);
if (currentNote.detail.is_protected) {
diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css
index c17abdfe10..36d75798c0 100644
--- a/public/stylesheets/style.css
+++ b/public/stylesheets/style.css
@@ -177,6 +177,10 @@ div.ui-tooltip {
box-shadow: none;
}
+#note-id-display {
+ color: lightgrey;
+}
+
#loader-wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1000;background-color:#fff;opacity:1;transition:opacity 2s ease}
#loader{display:block;position:relative;left:50%;top:50%;width:150px;height:150px;margin:-75px 0 0 -75px;border-radius:50%;border:3px solid transparent;border-top-color:#777;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite}
#loader:before{content:"";position:absolute;top:5px;left:5px;right:5px;bottom:5px;border-radius:50%;border:3px solid transparent;border-top-color:#aaa;-webkit-animation:spin 3s linear infinite;animation:spin 3s linear infinite}
diff --git a/services/notes.js b/services/notes.js
index b49f5078b9..e43dcbf74b 100644
--- a/services/notes.js
+++ b/services/notes.js
@@ -104,8 +104,6 @@ async function protectNote(note, dataKey, protect, sourceId) {
}
if (changed) {
- console.log("Updating...");
-
await sql.execute("UPDATE notes SET note_title = ?, note_text = ?, is_protected = ? WHERE note_id = ?",
[note.note_title, note.note_text, note.is_protected, note.note_id]);
diff --git a/views/index.ejs b/views/index.ejs
index 260226a589..5460c6dae9 100644
--- a/views/index.ejs
+++ b/views/index.ejs
@@ -95,6 +95,8 @@
<input autocomplete="off" value="" id="note-title" style="font-size: x-large; border: 0; flex-grow: 100;" tabindex="1">
+ <span id="note-id-display" title="Note ID"></span>
+
<button class="btn btn-xs" style="margin: 10px;" onclick="noteHistory.showCurrentNoteHistory();">Note history</button>
</div>
</div>