From de0e8f9eb0fc062efce22906e700256d6feefefa Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Wed, 11 Jun 2014 20:05:15 -0400 Subject: [PATCH] when a download completes it is marked as complete (#36) --- onionshare_gui/static/onionshare.js | 7 +++++++ onionshare_gui/static/style.css | 3 +++ 2 files changed, 10 insertions(+) diff --git a/onionshare_gui/static/onionshare.js b/onionshare_gui/static/onionshare.js index 9abfd5b7..27a1b603 100644 --- a/onionshare_gui/static/onionshare.js +++ b/onionshare_gui/static/onionshare.js @@ -41,8 +41,15 @@ $(function(){ .append($('').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($('').addClass('weblog-error').html(onionshare.strings['other_page_loaded']+': '+r.path)); diff --git a/onionshare_gui/static/style.css b/onionshare_gui/static/style.css index 824eee38..5fcd03d5 100644 --- a/onionshare_gui/static/style.css +++ b/onionshare_gui/static/style.css @@ -69,6 +69,9 @@ ul#log .weblog { color: #009900; font-weight: bold; } +ul#log .weblog .progress { + color: #0000cc; +} ul#log .weblog-error { color: #ff0000;