From 679819e100bff4662eb53fab9b2762c6e8c4a30c Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 21 Mar 2012 03:09:24 +0000 Subject: [PATCH] add status bar to item clips view, fixes #428 --- static/js/pandora/clipsView.js | 31 ++++++++++++++++++++++++++--- static/js/pandora/item.js | 2 +- static/js/pandora/navigationView.js | 4 +++- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/static/js/pandora/clipsView.js b/static/js/pandora/clipsView.js index d47b90ef..e603bc86 100644 --- a/static/js/pandora/clipsView.js +++ b/static/js/pandora/clipsView.js @@ -4,7 +4,15 @@ pandora.ui.clipsView = function(videoRatio) { - var that = Ox.SplitPanel({ + var $status = $('
') + .css({ + width: '100%', + marginTop: '2px', + fontSize: '9px', + textAlign: 'center' + }), + + that = Ox.SplitPanel({ elements: [ { element: Ox.Bar({size: 24}) @@ -28,7 +36,7 @@ pandora.ui.clipsView = function(videoRatio) { // since this is the only way itemFind can change, // there's no need for an event handler that.replaceElement(1, - pandora.$ui.clipList = pandora.ui.clipList(videoRatio) + pandora.$ui.clipList = getClipList() ); } }) @@ -36,12 +44,29 @@ pandora.ui.clipsView = function(videoRatio) { size: 24 }, { - element: pandora.$ui.clipList = pandora.ui.clipList(videoRatio) + element: pandora.$ui.clipList = getClipList() + }, + { + element: Ox.Bar({size: 16}) + .append($status) } ], orientation: 'vertical' }); + function getClipList() { + return pandora.ui.clipList(videoRatio) + .bindEvent({ + init: function(data) { + var items = data.items; + $status.html( + (items ? Ox.formatNumber(items) : 'No') + + ' clip' + (items == 1 ? '' : 's') + ); + } + }); + } + return that; }; diff --git a/static/js/pandora/item.js b/static/js/pandora/item.js index 18168045..45e71049 100644 --- a/static/js/pandora/item.js +++ b/static/js/pandora/item.js @@ -60,7 +60,7 @@ pandora.ui.item = function() { ); } else if (pandora.user.ui.itemView == 'info') { - //Ox.Log('', 'result.data', result.data) + if (pandora.user.level == 'admin' && false) { var $form, $edit = Ox.Element() diff --git a/static/js/pandora/navigationView.js b/static/js/pandora/navigationView.js index d55741a8..2f701fc9 100644 --- a/static/js/pandora/navigationView.js +++ b/static/js/pandora/navigationView.js @@ -1,5 +1,7 @@ // vim: et:ts=4:sw=4:sts=4:ft=javascript + 'use strict'; + pandora.ui.navigationView = function(type, videoRatio) { var ui = pandora.user.ui, @@ -192,7 +194,7 @@ pandora.ui.navigationView = function(type, videoRatio) { function selectItem(data) { var id = data.id || ''; if (id && id[0] != '_') { - $status.html('loading...'); + $status.html('Loading...'); $list.options({ items: function(data, callback) { var itemsQuery;