make debug menu depend on capability; make sure info view doesn't throw errors for movies without H/S/L

This commit is contained in:
rolux 2011-10-14 19:25:29 +00:00
parent 188dc1a6ab
commit 72e831e5b2
3 changed files with 132 additions and 125 deletions

View file

@ -18,6 +18,7 @@
"canPlayClips": {"guest": 1, "member": 2, "friend": 3, "staff": 4, "admin": 4}, "canPlayClips": {"guest": 1, "member": 2, "friend": 3, "staff": 4, "admin": 4},
"canPlayVideo": {"guest": 0, "member": 1, "friend": 3, "staff": 4, "admin": 4}, "canPlayVideo": {"guest": 0, "member": 1, "friend": 3, "staff": 4, "admin": 4},
"canReloadMetadata": {"staff": true, "admin": true}, "canReloadMetadata": {"staff": true, "admin": true},
"canSeeDebugMenu": {"admin": true},
"canSeeFiles": {"staff": true, "admin": true}, "canSeeFiles": {"staff": true, "admin": true},
"canSeeItem": {"guest": 2, "member": 2, "friend": 3, "staff": 4, "admin": 4}, "canSeeItem": {"guest": 2, "member": 2, "friend": 3, "staff": 4, "admin": 4},
"canSeeExtraItemViews": {"friend": true, "staff": true, "admin": true} "canSeeExtraItemViews": {"friend": true, "staff": true, "admin": true}

View file

@ -355,7 +355,7 @@ pandora.ui.infoView = function(data) {
$('<div>') $('<div>')
.css({marginBottom: '4px'}) .css({marginBottom: '4px'})
.append(formatKey(key, true)) .append(formatKey(key, true))
.append(Ox.formatColor(data[key], key)) .append(Ox.formatColor(data[key] || 0, key))
.appendTo($statistics); .appendTo($statistics);
}); });

View file

@ -12,7 +12,8 @@ pandora.ui.mainMenu = function() {
}) })
], ],
id: 'mainMenu', id: 'mainMenu',
menus: [ menus: Ox.merge(
[
{ id: pandora.site.site.id + 'Menu', title: pandora.site.site.name, items: [ { id: pandora.site.site.id + 'Menu', title: pandora.site.site.name, items: [
{ id: 'home', title: 'Home' }, { id: 'home', title: 'Home' },
{}, {},
@ -136,12 +137,17 @@ pandora.ui.mainMenu = function() {
] }, ] },
{ id: 'helpMenu', title: 'Help', items: [ { id: 'helpMenu', title: 'Help', items: [
{ id: 'help', title: pandora.site.site.name + ' Help', keyboard: 'shift ?' } { id: 'help', title: pandora.site.site.name + ' Help', keyboard: 'shift ?' }
] }, ] }
],
pandora.site.capabilities.canSeeDebugMenu[pandora.user.level]
? [
{ id: 'debugMenu', title: 'Debug', items: [ { id: 'debugMenu', title: 'Debug', items: [
{ id: 'clearcache', title: 'Clear cache'}, { id: 'clearcache', title: 'Clear cache'},
{ id: 'resetui', title: 'Reset UI Settings'} { id: 'resetui', title: 'Reset UI Settings'}
] } ] }
] ]
: []
)
}) })
.bindEvent({ .bindEvent({
change: function(data) { change: function(data) {