diff --git a/static/js/init.js b/static/js/init.js index 812c0d943..d9821b90b 100644 --- a/static/js/init.js +++ b/static/js/init.js @@ -231,4 +231,9 @@ $("#jumpToNoteForm").submit(function() { } return false; +}); + +$(window).on('beforeunload', function(){ + // asynchronously send the request and don't wait for result + saveNoteIfChanged(); }); \ No newline at end of file diff --git a/static/js/note.js b/static/js/note.js index 19052f2c5..70562d393 100644 --- a/static/js/note.js +++ b/static/js/note.js @@ -212,5 +212,5 @@ function encryptNote() { // To print or store the binary data, you may convert it to hex let encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes); - console.log("encrypted: " + encryptedBytes); + console.log("encrypted: " + encryptedHex); } \ No newline at end of file