From 4e11173a8a4dcfd2c0fc4a04934f94cb83fcab58 Mon Sep 17 00:00:00 2001 From: hamza zia Date: Thu, 4 Oct 2012 09:26:59 -0700 Subject: [PATCH] improved title bar status --- js/script.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/js/script.js b/js/script.js index c497cea..0195eab 100755 --- a/js/script.js +++ b/js/script.js @@ -943,9 +943,19 @@ function updateDownloads() { } function updateGlobalStatistics(data) { + var title = "aria2 Web Client"; + if (data.uploadSpeed > 0 || data.downloadSpeed > 0) { + title = "- " + title; + if (data.uploadSpeed > 0) { + title = "↑ " + changeLength(data.uploadSpeed, "B/s") + " " + title; + } + if (data.downloadSpeed > 0) { + title = "↓ " + changeLength(data.downloadSpeed, "B/s") + " " + title; + } + } + document.title = title; data.downloadSpeed = changeLength(data.downloadSpeed, "B/s"); data.uploadSpeed = changeLength(data.uploadSpeed, "B/s"); - document.title = "↓ " + data.downloadSpeed + " ↑ " + data.uploadSpeed + " - aria2 Web Client"; for(var i in data) { $('.stat_' + i).text(data[i]); }