From a05a7b552a9553aef4a00fcd201287a4259b34af Mon Sep 17 00:00:00 2001 From: Hamza Zia Date: Thu, 7 Jun 2012 18:02:11 +0800 Subject: [PATCH] added more info functionality to downloads --- index.html | 81 ++++++++++++++++++++++++++++++++++++++-------------- js/script.js | 14 ++++++--- 2 files changed, 69 insertions(+), 26 deletions(-) diff --git a/index.html b/index.html index 31559f2..77e2f2a 100755 --- a/index.html +++ b/index.html @@ -28,25 +28,29 @@ float: right; margin-bottom: 5px; } + .active_settings { + text-align: center; + margin-bottom: 3px; + } @@ -64,20 +79,21 @@ @@ -92,20 +118,21 @@ diff --git a/js/script.js b/js/script.js index 6020cb7..8654dca 100755 --- a/js/script.js +++ b/js/script.js @@ -321,16 +321,22 @@ function getTemplateCtx(data) { percentage:percentage, gid: data.gid, size: changeLength(data.totalLength, "B"), - down: changeLength(data.downloadSpeed, "B/s"), + down_speed: changeLength(data.downloadSpeed, "B/s"), remaining: changeLength(data.totalLength - data.completedLength, "B"), eta: eta, - downloaded: changeLength(data.completedLength, "B") + downloaded: changeLength(data.completedLength, "B"), + dir: data.dir, + numPieces: data.numPieces, + pieceLength: changeLength(data.pieceLength, "B"), + uploadLength: changeLength(data.uploadLength, "B"), + upload_speed: changeLength(data.uploadSpeed, "B/s") + }; } function updateDownloadTemplates(elem, ctx) { elem = $(elem); for(var i in ctx) { - elem.find('.' + i).text(ctx[i]); + elem.find('.tmp_' + i).text(ctx[i]); } elem.find('.bar').css('width', ctx.percentage + '%'); } @@ -363,7 +369,7 @@ function refreshDownloadTemplates(top_elem, data) { updateDownloadTemplates(elem, ctx); } else { var item = Mustache.render(down_template, ctx); - $('#' + top_elem + '_downloads').append(item); + $('#' + top_elem + '_downloads').prepend(item); } }