add hasNoDialogOrScreen method

This commit is contained in:
rolux 2011-11-02 20:57:49 +00:00
parent 8325d0fc1a
commit cfa32ef20f
3 changed files with 9 additions and 8 deletions

View file

@ -87,7 +87,7 @@ pandora.ui.logsDialog = function() {
id: 'text', id: 'text',
title: 'Text', title: 'Text',
tooltip: function(data) { tooltip: function(data) {
return '<code style="font-size: 11px">' + data.text.replace(/\n\n/g, '<br/>') + '</code>'; return '<pre style="font-size: 10px">' + data.text.replace(/\n\n/g, '<br/>') + '</pre>';
}, },
visible: true, visible: true,
width: 640 width: 640

View file

@ -139,7 +139,6 @@ pandora.ui.mainMenu = function() {
pandora.site.capabilities.canSeeDebugMenu[pandora.user.level] pandora.site.capabilities.canSeeDebugMenu[pandora.user.level]
? [ ? [
{ id: 'debugMenu', title: 'Debug', items: [ { id: 'debugMenu', title: 'Debug', items: [
{ id: 'logs', title: 'View Logs...'},
{ id: 'clearcache', title: 'Clear Cache'}, { id: 'clearcache', title: 'Clear Cache'},
{ id: 'reloadapplication', title: 'Reload Application'}, { id: 'reloadapplication', title: 'Reload Application'},
{ id: 'resetui', title: 'Reset UI Settings'}, { id: 'resetui', title: 'Reset UI Settings'},
@ -267,10 +266,6 @@ pandora.ui.mainMenu = function() {
pandora.api.resetUI({}, function() { pandora.api.resetUI({}, function() {
pandora.$ui.appPanel.reload(); pandora.$ui.appPanel.reload();
}); });
} else if (data.id == 'logs') {
(pandora.$ui.logsDialog || (
pandora.$ui.logsDialog = pandora.ui.logsDialog())
).open();
} else if (data.id == 'debug') { } else if (data.id == 'debug') {
if(localStorage.debug) { if(localStorage.debug) {
delete localStorage.debug; delete localStorage.debug;
@ -282,7 +277,7 @@ pandora.ui.mainMenu = function() {
} }
}, },
key_control_f: function() { key_control_f: function() {
if ($('.OxDialog:visible').length == 0 && $('.OxScreen').length == 0) { if (pandora.hasNoDialogOrScreen()) {
pandora.$ui.findInput.focusInput(true); pandora.$ui.findInput.focusInput(true);
} }
}, },
@ -303,7 +298,7 @@ pandora.ui.mainMenu = function() {
pandora.UI.set({showSidebar: !ui.showSidebar}); pandora.UI.set({showSidebar: !ui.showSidebar});
}, },
key_shift_slash: function() { key_shift_slash: function() {
if ($('.OxDialog').length == 0 && $('.OxScreen').length == 0) { if (pandora.hasNoDialogOrScreen()) {
pandora.URL.push('/help'); pandora.URL.push('/help');
} }
}, },

View file

@ -672,6 +672,12 @@ pandora.getVideoPartsAndPoints = function(durations, points) {
return ret; return ret;
}; };
pandora.hasNoDialogOrScreen = function() {
return $('.OxDialog:visible').length == 0
&& $('.OxFullscreen').length == 0
&& $('.OxScreen').length == 0;
}
pandora.isClipView = function(view, item) { pandora.isClipView = function(view, item) {
if (arguments.length == 0) { if (arguments.length == 0) {
item = pandora.user.ui.item; item = pandora.user.ui.item;