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); } }