From b9220e6820acbcfd0ab5dbf97acb1775a2dd2bf6 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 27 Mar 2015 22:46:52 +0100 Subject: [PATCH] add status with used/granted disk usage --- static/js/cacheDialog.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/static/js/cacheDialog.js b/static/js/cacheDialog.js index 97cc47ab..1b7b770c 100644 --- a/static/js/cacheDialog.js +++ b/static/js/cacheDialog.js @@ -87,7 +87,16 @@ pandora.ui.cacheDialog = function() { } }), - $statusbar = Ox.Bar({size: 16}), + $status = $('
') + .css({ + width: '100%', + marginTop: '2px', + fontSize: '9px', + textAlign: 'center', + textOverflow: 'ellipsis' + }), + + $statusbar = Ox.Bar({size: 16}).append($status), $panel = Ox.SplitPanel({ elements: [ @@ -319,8 +328,18 @@ pandora.ui.cacheDialog = function() { $list.value(file.id, 'progress', file.progress); } }); + updateStatus(); }); } + function updateStatus() { + navigator.webkitPersistentStorage.queryUsageAndQuota(function(usage, quota) { + $status.html( + Ox.formatValue(usage, 'B', true) + ' of ' + Ox.formatValue(quota, 'B', true) + ); + + }) + + } return that;