From 764e992fcc92cf5c70cdb4b49da32ab087713f3d Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 18 Oct 2011 23:02:30 +0200 Subject: [PATCH] status --- static/js/pandora/ui/status.js | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/static/js/pandora/ui/status.js b/static/js/pandora/ui/status.js index 0367e10b8..1c80e0827 100644 --- a/static/js/pandora/ui/status.js +++ b/static/js/pandora/ui/status.js @@ -1,13 +1,23 @@ // vim: et:ts=4:sw=4:sts=4:ft=javascript pandora.ui.status = function(key, data) { - var that = Ox.toTitleCase(key) + ': ' + [ - Ox.formatNumber(data.items) + ' '+ (data.items != 1 ? pandora.site.itemName.plural : pandora.site.itemName.singular), - Ox.formatDuration(data.runtime, 'short'), - data.files + ' file' + (data.files != 1 ? 's' : ''), - Ox.formatDuration(data.duration), - Ox.formatValue(data.size, 'B'), - Ox.formatValue(data.pixels, 'px') - ].join(', '); - return that; + var itemName = data.items != 1 ? pandora.site.itemName.plural : pandora.site.itemName.singular, + segments = [], + that = Ox.toTitleCase(key) + ': '; + if (!pandora.user.ui.item && pandora.user.ui.listView == 'clip') { + itemName = data.items != 1 ? 'Clips' : 'Clip'; + } + + segments.push(Ox.formatNumber(data.items) + ' '+ itemName); + if (data.runtime) + segments.push(Ox.formatDuration(data.runtime, 'short')); + if (data.files) + segments.push(data.files + ' file' + (data.files != 1 ? 's' : '')); + if (data.duration) + segments.push(Ox.formatDuration(data.duration)); + if (data.size) + segments.push(Ox.formatValue(data.size, 'B')); + if (data.pixels) + segments.push(Ox.formatValue(data.pixels, 'px')); + return that + segments.join(', '); };