1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-09 08:54:13 +01:00

Add totals columns to the download manager.

--HG--
branch : key-processing
This commit is contained in:
Kris Maglione
2011-01-24 10:14:01 -05:00
parent 304d4fffd7
commit 56777f59c3
2 changed files with 30 additions and 6 deletions

View File

@@ -672,6 +672,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
* @returns {string}
*/
formatSeconds: function formatSeconds(seconds) {
function pad(n, val) ("0000000" + val).substr(-Math.max(n, String(val).length));
function div(num, denom) [Math.round(num / denom), Math.round(num % denom)];
let days, hours, minutes;
@@ -683,7 +684,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
if (hours)
return hours + "h " + minutes + "m";
if (minutes)
return minutes + ":" + seconds;
return minutes + ":" + pad(2, seconds);
return seconds + "s";
},