mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
renamed encryption module to protected_session
This commit is contained in:
parent
b28df3f093
commit
4aa70d3574
@ -65,10 +65,10 @@ const contextMenu = (function() {
|
|||||||
noteEditor.createNote(node, node.key, 'into');
|
noteEditor.createNote(node, node.key, 'into');
|
||||||
}
|
}
|
||||||
else if (ui.cmd === "encryptSubTree") {
|
else if (ui.cmd === "encryptSubTree") {
|
||||||
encryption.encryptSubTree(node.key);
|
protected_session.encryptSubTree(node.key);
|
||||||
}
|
}
|
||||||
else if (ui.cmd === "decryptSubTree") {
|
else if (ui.cmd === "decryptSubTree") {
|
||||||
encryption.decryptSubTree(node.key);
|
protected_session.decryptSubTree(node.key);
|
||||||
}
|
}
|
||||||
else if (ui.cmd === "cut") {
|
else if (ui.cmd === "cut") {
|
||||||
cut(node);
|
cut(node);
|
||||||
|
@ -90,7 +90,7 @@ settings.addModule((function() {
|
|||||||
alert("Password has been changed. Trilium will be reloaded after you press OK.");
|
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 password changed so current encryption session is invalid and needs to be cleared
|
||||||
encryption.resetProtectedSession();
|
protected_session.resetProtectedSession();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
showError(result.message);
|
showError(result.message);
|
||||||
@ -120,7 +120,7 @@ settings.addModule((function() {
|
|||||||
const encryptionTimeout = encryptionTimeoutEl.val();
|
const encryptionTimeout = encryptionTimeoutEl.val();
|
||||||
|
|
||||||
settings.saveSettings(settingName, encryptionTimeout).then(() => {
|
settings.saveSettings(settingName, encryptionTimeout).then(() => {
|
||||||
encryption.setEncryptionSessionTimeout(encryptionTimeout);
|
protected_session.setEncryptionSessionTimeout(encryptionTimeout);
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -116,7 +116,7 @@ function initAjax() {
|
|||||||
$.ajaxSetup({
|
$.ajaxSetup({
|
||||||
headers: {
|
headers: {
|
||||||
'x-browser-id': browserId,
|
'x-browser-id': browserId,
|
||||||
'x-protected-session-id': encryption ? encryption.getProtectedSessionId() : null
|
'x-protected-session-id': protected_session ? protected_session.getProtectedSessionId() : null
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ const noteEditor = (function() {
|
|||||||
async function createNote(node, parentKey, target, isProtected) {
|
async function createNote(node, parentKey, target, isProtected) {
|
||||||
// if isProtected isn't available (user didn't enter password yet), then note is created as unencrypted
|
// 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
|
// 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;
|
isProtected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ const noteEditor = (function() {
|
|||||||
noteTitleEl.focus().select();
|
noteTitleEl.focus().select();
|
||||||
}
|
}
|
||||||
|
|
||||||
await encryption.ensureProtectedSession(currentNote.detail.is_protected, false);
|
await protected_session.ensureProtectedSession(currentNote.detail.is_protected, false);
|
||||||
|
|
||||||
noteDetailWrapperEl.show();
|
noteDetailWrapperEl.show();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const encryption = (function() {
|
const protected_session = (function() {
|
||||||
const dialogEl = $("#protected-session-password-dialog");
|
const dialogEl = $("#protected-session-password-dialog");
|
||||||
const passwordFormEl = $("#protected-session-password-form");
|
const passwordFormEl = $("#protected-session-password-form");
|
||||||
const passwordEl = $("#protected-session-password");
|
const passwordEl = $("#protected-session-password");
|
@ -68,7 +68,7 @@
|
|||||||
|
|
||||||
<div class="hide-toggle" style="grid-area: title;">
|
<div class="hide-toggle" style="grid-area: title;">
|
||||||
<div style="display: flex; align-items: center;">
|
<div style="display: flex; align-items: center;">
|
||||||
<a onclick="encryption.protectNoteAndSendToServer()"
|
<a onclick="protected_session.protectNoteAndSendToServer()"
|
||||||
title="Encrypt the note so that password will be required to view the note"
|
title="Encrypt the note so that password will be required to view the note"
|
||||||
class="icon-action"
|
class="icon-action"
|
||||||
id="protect-button"
|
id="protect-button"
|
||||||
@ -76,7 +76,7 @@
|
|||||||
<img src="images/icons/lock.png" alt="Encrypt note"/>
|
<img src="images/icons/lock.png" alt="Encrypt note"/>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a onclick="encryption.unprotectNoteAndSendToServer()"
|
<a onclick="protected_session.unprotectNoteAndSendToServer()"
|
||||||
title="Decrypt note permamently so that password will not be required to access this note in the future"
|
title="Decrypt note permamently so that password will not be required to access this note in the future"
|
||||||
class="icon-action"
|
class="icon-action"
|
||||||
id="unprotect-button"
|
id="unprotect-button"
|
||||||
@ -280,7 +280,7 @@
|
|||||||
|
|
||||||
<!-- Note detail -->
|
<!-- Note detail -->
|
||||||
<script src="javascripts/note_editor.js"></script>
|
<script src="javascripts/note_editor.js"></script>
|
||||||
<script src="javascripts/encryption.js"></script>
|
<script src="javascripts/protected_session.js"></script>
|
||||||
|
|
||||||
<!-- dialogs -->
|
<!-- dialogs -->
|
||||||
<script src="javascripts/dialogs/recent_notes.js"></script>
|
<script src="javascripts/dialogs/recent_notes.js"></script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user