From cfa32ef20fd99c179d7cc205febfa8a46202a55d Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 2 Nov 2011 20:57:49 +0000 Subject: [PATCH] add hasNoDialogOrScreen method --- static/js/pandora/logsDialog.js | 2 +- static/js/pandora/menu.js | 9 ++------- static/js/pandora/utils.js | 6 ++++++ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/static/js/pandora/logsDialog.js b/static/js/pandora/logsDialog.js index 2d201655f..634221fc6 100644 --- a/static/js/pandora/logsDialog.js +++ b/static/js/pandora/logsDialog.js @@ -87,7 +87,7 @@ pandora.ui.logsDialog = function() { id: 'text', title: 'Text', tooltip: function(data) { - return '' + data.text.replace(/\n\n/g, '
') + '
'; + return '
' + data.text.replace(/\n\n/g, '
') + '
'; }, visible: true, width: 640 diff --git a/static/js/pandora/menu.js b/static/js/pandora/menu.js index 99b298347..904b9979b 100644 --- a/static/js/pandora/menu.js +++ b/static/js/pandora/menu.js @@ -139,7 +139,6 @@ pandora.ui.mainMenu = function() { pandora.site.capabilities.canSeeDebugMenu[pandora.user.level] ? [ { id: 'debugMenu', title: 'Debug', items: [ - { id: 'logs', title: 'View Logs...'}, { id: 'clearcache', title: 'Clear Cache'}, { id: 'reloadapplication', title: 'Reload Application'}, { id: 'resetui', title: 'Reset UI Settings'}, @@ -267,10 +266,6 @@ pandora.ui.mainMenu = function() { pandora.api.resetUI({}, function() { pandora.$ui.appPanel.reload(); }); - } else if (data.id == 'logs') { - (pandora.$ui.logsDialog || ( - pandora.$ui.logsDialog = pandora.ui.logsDialog()) - ).open(); } else if (data.id == 'debug') { if(localStorage.debug) { delete localStorage.debug; @@ -282,7 +277,7 @@ pandora.ui.mainMenu = function() { } }, key_control_f: function() { - if ($('.OxDialog:visible').length == 0 && $('.OxScreen').length == 0) { + if (pandora.hasNoDialogOrScreen()) { pandora.$ui.findInput.focusInput(true); } }, @@ -303,7 +298,7 @@ pandora.ui.mainMenu = function() { pandora.UI.set({showSidebar: !ui.showSidebar}); }, key_shift_slash: function() { - if ($('.OxDialog').length == 0 && $('.OxScreen').length == 0) { + if (pandora.hasNoDialogOrScreen()) { pandora.URL.push('/help'); } }, diff --git a/static/js/pandora/utils.js b/static/js/pandora/utils.js index 0e6810ddd..81df9f5a0 100644 --- a/static/js/pandora/utils.js +++ b/static/js/pandora/utils.js @@ -672,6 +672,12 @@ pandora.getVideoPartsAndPoints = function(durations, points) { return ret; }; +pandora.hasNoDialogOrScreen = function() { + return $('.OxDialog:visible').length == 0 + && $('.OxFullscreen').length == 0 + && $('.OxScreen').length == 0; +} + pandora.isClipView = function(view, item) { if (arguments.length == 0) { item = pandora.user.ui.item;