clean up debug menu

This commit is contained in:
rolux 2012-06-30 11:56:04 +00:00
parent 33752fa72d
commit fb195b3799

View file

@ -149,13 +149,14 @@ 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: 'debug', title: (pandora.localStorage('debug')?'Disable':'Enable')+' Debug Mode'}, { id: 'debugmode', title: (pandora.localStorage('debug') ? 'Disable' : 'Enable') + ' Debug Mode' },
{ id: 'tests', title: 'Run Tests'}, { id: 'eventlogging', title: (pandora.localStorage('enableEventLogging') ? 'Disable' : 'Enable') + ' Event Logging'},
{ id: 'triggererror', title: 'Trigger JavaScript Error'} {},
{ id: 'logs', title: 'View Logs...'},
{ id: 'tests', title: 'Run Tests...'}
] } ] }
] ]
: [] : []
@ -321,28 +322,31 @@ pandora.ui.mainMenu = function() {
filters: pandora.site.user.ui.filters filters: pandora.site.user.ui.filters
}); });
pandora.$ui.contentPanel.replaceElement(0, pandora.$ui.browser = pandora.ui.browser()); pandora.$ui.contentPanel.replaceElement(0, pandora.$ui.browser = pandora.ui.browser());
} else if (data.id == 'logs') {
pandora.$ui.logsDialog = pandora.ui.logsDialog().open();
} else if (data.id == 'clearcache') { } else if (data.id == 'clearcache') {
Ox.Request.clearCache(); Ox.Request.clearCache();
} else if (data.id == 'reloadapplication') { } else if (data.id == 'reloadapplication') {
Ox.Request.clearCache(); Ox.Request.clearCache();
pandora.$ui.appPanel.reload(); pandora.$ui.appPanel.reload();
} else if (data.id == 'resetui') { } else if (data.id == 'debugmode') {
pandora.api.resetUI({}, function() { if (pandora.localStorage('enableDebugMode')) {
pandora.$ui.appPanel.reload(); pandora.localStorage['delete']('enableDebugMode');
});
} else if (data.id == 'debug') {
if (pandora.localStorage('debug')) {
pandora.localStorage['delete']('debug');
} else { } else {
pandora.localStorage('debug', true); pandora.localStorage('enableDebugMode', true);
} }
that.setItemTitle('debug', (pandora.localStorage('debug') ? 'Disable' : 'Enable') + ' Debug Mode'); // that.setItemTitle('debugmode', (pandora.localStorage('enableDebugMode') ? 'Disable' : 'Enable') + ' Debug Mode');
pandora.$ui.appPanel.reload();
} else if (data.id == 'eventlogging') {
if (pandora.localStorage('enableEventLogging')) {
pandora.localStorage['delete']('enableEventLogging');
} else {
pandora.localStorage('enableEventLogging', true);
}
that.setItemTitle('eventlogging', (pandora.localStorage('enableEventLogging') ? 'Disable' : 'Enable') + ' Event Logging');
Ox.Event[pandora.localStorage('enableEventLogging' ? 'bind' : 'unbind')](pandora.logEvent);
} else if (data.id == 'logs') {
pandora.$ui.logsDialog = pandora.ui.logsDialog().open();
} else if (data.id == 'tests') { } else if (data.id == 'tests') {
pandora.tests(); pandora.tests();
} else if (data.id == 'triggererror') {
var e = error;
} }
}, },
key_alt_control_f: function() { key_alt_control_f: function() {