when a download completes it is marked as complete (#36)

This commit is contained in:
Micah Lee 2014-06-11 20:05:15 -04:00
parent 1cc817db3c
commit de0e8f9eb0
2 changed files with 10 additions and 0 deletions

View File

@ -41,8 +41,15 @@ $(function(){
.append($('<span>').addClass('progress'));
update($download);
} else if(r.type == REQUEST_PROGRESS) {
// is the download complete?
if(r.data.bytes == onionshare.filesize) {
$('#download-'+r.data.id).html(onionshare.strings['download_finished']);
}
// still in progress
else {
var percent = Math.floor((r.data.bytes / onionshare.filesize) * 100);
$('#download-'+r.data.id+' .progress').html(' '+human_readable_filesize(r.data.bytes)+', '+percent+'%');
}
} else {
if(r.path != '/favicon.ico')
update($('<span>').addClass('weblog-error').html(onionshare.strings['other_page_loaded']+': '+r.path));

View File

@ -69,6 +69,9 @@ ul#log .weblog {
color: #009900;
font-weight: bold;
}
ul#log .weblog .progress {
color: #0000cc;
}
ul#log .weblog-error {
color: #ff0000;