From 4edaa5f4711b8321ad1446cadc6ea88e1c0f3417 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Wed, 14 Sep 2011 18:35:31 +0000 Subject: [PATCH] add thousands formatting in the filter list --- web/javascript/transmission.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/web/javascript/transmission.js b/web/javascript/transmission.js index ebbc704f2..dcef62866 100644 --- a/web/javascript/transmission.js +++ b/web/javascript/transmission.js @@ -1250,10 +1250,12 @@ Transmission.prototype = text += state_string + ' at ' + tracker_string; text += ' — '; - if (torrent_count === visible_count) - text += torrent_count + ' Transfers'; + if (torrent_count !== visible_count) + text += visible_count.toStringWithCommas() + ' of ' + torrent_count.toStringWithCommas(); + else if (torrent_count === 1) + text = '1 Transfer'; else - text += visible_count + ' of ' + torrent_count; + text += torrent_count.toStringWithCommas() + ' Transfers'; $('#filter-button').html(text); }, @@ -1454,7 +1456,7 @@ Transmission.prototype = div.className = 'row' + (s === sel_state ? ' selected':''); div.innerHTML = '' + '' + tr.getStateString(s) + '' - + '' + counts[s] + ''; + + '' + counts[s].toStringWithCommas() + ''; $(div).click({'state':s}, function(ev) { tr.setFilterMode(ev.data.state); $('#filter-popup').dialog('close'); @@ -1479,7 +1481,7 @@ Transmission.prototype = div.className = 'row' + (tr.filterTracker ? '' : ' selected'); div.innerHTML = '' + 'All' - + '' + torrents.length + ''; + + '' + torrents.length.toStringWithCommas() + ''; $(div).click(function() { tr.setFilterTracker(null); $('#filter-popup').dialog('close'); @@ -1492,7 +1494,7 @@ Transmission.prototype = div.className = 'row' + (o.domain === tr.filterTracker ? ' selected':''); div.innerHTML = '' + ''+ name + '' - + ''+ o.count + ''; + + ''+ o.count.toStringWithCommas() + ''; $(div).click({domain:o.domain}, function(ev) { tr.setFilterTracker(ev.data.domain); $('#filter-popup').dialog('close');