diff options
author | Klaus <Klaus.Weidenbach@gmx.net> | 2014-02-18 17:41:59 +0100 |
---|---|---|
committer | Klaus <Klaus.Weidenbach@gmx.net> | 2014-02-18 17:41:59 +0100 |
commit | aa44d3abab07205a747874b244e71181e4e7a1b0 (patch) | |
tree | 5c6516bb8d2bd6f0bab7e383053b713eaa783df1 | |
parent | bee287f859e08b9033e83852f17d5bc52e22521b (diff) | |
download | volse-hubzilla-aa44d3abab07205a747874b244e71181e4e7a1b0.tar.gz volse-hubzilla-aa44d3abab07205a747874b244e71181e4e7a1b0.tar.bz2 volse-hubzilla-aa44d3abab07205a747874b244e71181e4e7a1b0.zip |
Let user cancel the red_encrypt dialogue
If the user press cancel on the prompt also cancel the encryption. Maybe should also add this to passhint promt.
-rw-r--r-- | view/js/crypto.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/view/js/crypto.js b/view/js/crypto.js index 2e6402c62..c3a37d177 100644 --- a/view/js/crypto.js +++ b/view/js/crypto.js @@ -1,5 +1,4 @@ - function str_rot13 (str) { // http://kevin.vanzonneveld.net // + original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) @@ -43,7 +42,11 @@ function red_encrypt(alg, elem,text) { // key and hint need to be localised - var enc_key = bin2hex(prompt(aStr['passphrase'])); + var passphrase = prompt(aStr['passphrase']); + // let the user cancel this dialogue + if (passphrase == null) + return false; + var enc_key = bin2hex(passphrase); // If you don't provide a key you get rot13, which doesn't need a key // but consequently isn't secure. |