diff options
author | Laurent Ghigonis <laurent@p1sec.com> | 2013-06-16 21:50:37 +0200 |
---|---|---|
committer | Laurent Ghigonis <laurent@p1sec.com> | 2013-06-16 21:50:37 +0200 |
commit | 2c76dd5d2be7543e6c3d6e5377bc6ae63c870495 (patch) | |
tree | 28258a1875c77d42056ae8e96cf5408e1409b194 /jsaccess/jsa/jsa.js | |
parent | jsaccess: force status redraw on change (diff) | |
download | laurent-tools-2c76dd5d2be7543e6c3d6e5377bc6ae63c870495.tar.xz laurent-tools-2c76dd5d2be7543e6c3d6e5377bc6ae63c870495.zip |
jsaccess: ensure refresh of status before decryption
Diffstat (limited to '')
-rw-r--r-- | jsaccess/jsa/jsa.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/jsaccess/jsa/jsa.js b/jsaccess/jsa/jsa.js index eb28a01..c2e40f2 100644 --- a/jsaccess/jsa/jsa.js +++ b/jsaccess/jsa/jsa.js @@ -93,8 +93,8 @@ function _dl(file, pass) { xhr.overrideMimeType("application/base64"); }, success: function ( data ) { - _status("Download complete, decrypting ..."); - _decrypt(data, pass, file); + _status("Download complete, decrypting ...", + function() { _decrypt(data, pass, file); }); }, error: function (xhr, opts, err) { _status("Dowload failed (status="+xhr.status+")"); @@ -123,13 +123,19 @@ function _save(obj, name) { } var blob = new Blob([ia], {type:"application/octet-binary"}); saveAs(blob, name); - _status("File \""+name+"\" is in your hands,"); - _status("Have a good day."); + _status("File \""+name+"\" is in your hands,<br/>Have a good day."); } -function _status(txt) { +function _status(txt, run_func) { var div = document.getElementById('status'); div.innerHTML = div.innerHTML + '<br/>' + txt; - $('#status').hide().show(); + jQuery.fn.redraw = function() { + return this.hide(0, function() { + $(this).show(); + }); + }; + $('#status').redraw(); + if (run_func) + setTimeout(run_func, 100); /* to force refresh */ } |