From c7c1ccd4c4c09724b7a708b4ea716537f905c18e Mon Sep 17 00:00:00 2001 From: Hamza Zia Date: Tue, 5 Jun 2012 22:12:01 +0800 Subject: [PATCH] basic ui refinement --- index.html | 15 +++++++-------- js/script.js | 3 +++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 0ebde55..f1f5eeb 100755 --- a/index.html +++ b/index.html @@ -28,11 +28,10 @@

{{name}}

- Status: {{status}} - Size: {{size}} | - Progress: {{percentage}}% | - down: {{down}} + Size: {{size}} | + Progress: {{percentage}}% | + Speed: {{down}}
@@ -55,8 +54,8 @@
Status: {{status}} - Size: {{size}} | - Progress: {{percentage}}% + Size: {{size}} | + Progress: {{percentage}}%
@@ -79,8 +78,8 @@
Status: {{status}} - Size: {{size}} | - Progress: {{percentage}}% + Size: {{size}} | + Progress: {{percentage}}%
diff --git a/js/script.js b/js/script.js index 47ce203..44d188c 100755 --- a/js/script.js +++ b/js/script.js @@ -99,6 +99,7 @@ function updateActiveDownloads(data) { for(var i = 0; i < data.length; i++) { var percentage =(data[i].completedLength / data[i].totalLength)*100; percentage = Math.round(percentage*1000)/1000; + if(!percentage) percentage = 0; ctx = { name: data[i].files[0].uris[0].uri.replace(/^.*[\\\/]/, ''), status: data[i].status, @@ -148,6 +149,7 @@ function updateWaitingDownloads(data) { for(var i = 0; i < data.length; i++) { var percentage =(data[i].completedLength / data[i].totalLength)*100; percentage = Math.round(percentage*1000)/1000; + if(!percentage) percentage = 0; ctx = { name: data[i].files[0].uris[0].uri.replace(/^.*[\\\/]/, ''), status: data[i].status, @@ -198,6 +200,7 @@ function updateStoppedDownloads(data) { for(var i = 0; i < data.length; i++) { var percentage =(data[i].completedLength / data[i].totalLength)*100; percentage = Math.round(percentage*1000)/1000; + if(!percentage) percentage = 0; ctx = { name: data[i].files[0].uris[0].uri.replace(/^.*[\\\/]/, ''), status: data[i].status,