note decryption

This commit is contained in:
azivner
2017-09-05 22:01:22 -04:00
parent f1182c9415
commit a760fbbf1b
3 changed files with 28 additions and 1 deletions

View File

@@ -144,9 +144,13 @@ recentNotes = [];
function setNoteBackgroundIfEncrypted(note) {
if (note.detail.encryption > 0) {
$(".note-editable").addClass("encrypted");
$("#encryptButton").hide();
$("#decryptButton").show();
}
else {
$(".note-editable").removeClass("encrypted");
$("#encryptButton").show();
$("#decryptButton").hide();
}
}
@@ -306,6 +310,18 @@ function encryptNoteAndSendToServer() {
});
}
function decryptNoteAndSendToServer() {
const note = globalNote;
updateNoteFromInputs(note);
note.detail.encryption = 0;
saveNoteToServer(note);
setNoteBackgroundIfEncrypted(note);
}
function decryptNoteIfNecessary(note) {
let decryptPromise;