From 4aa70d357498cd36555597d5bc9328ebb6c47da2 Mon Sep 17 00:00:00 2001 From: azivner Date: Tue, 14 Nov 2017 22:36:36 -0500 Subject: [PATCH] renamed encryption module to protected_session --- public/javascripts/context_menu.js | 4 ++-- public/javascripts/dialogs/settings.js | 4 ++-- public/javascripts/init.js | 2 +- public/javascripts/note_editor.js | 4 ++-- public/javascripts/{encryption.js => protected_session.js} | 2 +- views/index.ejs | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) rename public/javascripts/{encryption.js => protected_session.js} (99%) diff --git a/public/javascripts/context_menu.js b/public/javascripts/context_menu.js index 33e044b80..a5ecee0d1 100644 --- a/public/javascripts/context_menu.js +++ b/public/javascripts/context_menu.js @@ -65,10 +65,10 @@ const contextMenu = (function() { noteEditor.createNote(node, node.key, 'into'); } else if (ui.cmd === "encryptSubTree") { - encryption.encryptSubTree(node.key); + protected_session.encryptSubTree(node.key); } else if (ui.cmd === "decryptSubTree") { - encryption.decryptSubTree(node.key); + protected_session.decryptSubTree(node.key); } else if (ui.cmd === "cut") { cut(node); diff --git a/public/javascripts/dialogs/settings.js b/public/javascripts/dialogs/settings.js index 22ed313b9..72754ac77 100644 --- a/public/javascripts/dialogs/settings.js +++ b/public/javascripts/dialogs/settings.js @@ -90,7 +90,7 @@ settings.addModule((function() { alert("Password has been changed. Trilium will be reloaded after you press OK."); // encryption password changed so current encryption session is invalid and needs to be cleared - encryption.resetProtectedSession(); + protected_session.resetProtectedSession(); } else { showError(result.message); @@ -120,7 +120,7 @@ settings.addModule((function() { const encryptionTimeout = encryptionTimeoutEl.val(); settings.saveSettings(settingName, encryptionTimeout).then(() => { - encryption.setEncryptionSessionTimeout(encryptionTimeout); + protected_session.setEncryptionSessionTimeout(encryptionTimeout); }); return false; diff --git a/public/javascripts/init.js b/public/javascripts/init.js index 5f45588b0..c777b765f 100644 --- a/public/javascripts/init.js +++ b/public/javascripts/init.js @@ -116,7 +116,7 @@ function initAjax() { $.ajaxSetup({ headers: { 'x-browser-id': browserId, - 'x-protected-session-id': encryption ? encryption.getProtectedSessionId() : null + 'x-protected-session-id': protected_session ? protected_session.getProtectedSessionId() : null } }); } diff --git a/public/javascripts/note_editor.js b/public/javascripts/note_editor.js index e40155428..2309fe821 100644 --- a/public/javascripts/note_editor.js +++ b/public/javascripts/note_editor.js @@ -122,7 +122,7 @@ const noteEditor = (function() { async function createNote(node, parentKey, target, isProtected) { // if isProtected isn't available (user didn't enter password yet), then note is created as unencrypted // but this is quite weird since user doesn't see where the note is being created so it shouldn't occur often - if (!isProtected || !encryption.isProtectedSessionAvailable()) { + if (!isProtected || !protected_session.isProtectedSessionAvailable()) { isProtected = false; } @@ -194,7 +194,7 @@ const noteEditor = (function() { noteTitleEl.focus().select(); } - await encryption.ensureProtectedSession(currentNote.detail.is_protected, false); + await protected_session.ensureProtectedSession(currentNote.detail.is_protected, false); noteDetailWrapperEl.show(); diff --git a/public/javascripts/encryption.js b/public/javascripts/protected_session.js similarity index 99% rename from public/javascripts/encryption.js rename to public/javascripts/protected_session.js index d4436e5db..0ff356100 100644 --- a/public/javascripts/encryption.js +++ b/public/javascripts/protected_session.js @@ -1,6 +1,6 @@ "use strict"; -const encryption = (function() { +const protected_session = (function() { const dialogEl = $("#protected-session-password-dialog"); const passwordFormEl = $("#protected-session-password-form"); const passwordEl = $("#protected-session-password"); diff --git a/views/index.ejs b/views/index.ejs index b1a2cf9c8..72a97c4ab 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -68,7 +68,7 @@
- - - +