namespace localStorage

This commit is contained in:
rolux 2011-11-04 16:10:53 +00:00
parent d54463474e
commit 50e5c6b760
2 changed files with 9 additions and 11 deletions

View File

@ -29,8 +29,8 @@ appPanel
} catch(e) {}
};
var debug = localStorage && localStorage.debug,
theme = localStorage && localStorage.theme || 'modern';
var debug = localStorage && localStorage.pandoraDebug,
theme = localStorage && localStorage.OxTheme || 'modern';
loadImages(function(images) {
loadScreen(images);
@ -157,7 +157,7 @@ appPanel
function loadPandoraFiles(callback) {
var prefix = '/static/';
if (localStorage && localStorage.debug) {
if (localStorage && localStorage.pandoraDebug) {
Ox.getJSON(prefix + 'json/pandora.json', function(files) {
var promises = [];
files.forEach(function(file) {
@ -253,7 +253,7 @@ appPanel
videoFormat: Ox.UI.getVideoFormat(pandora.site.video.formats)
});
if (data.user.level == 'guest' && $.browser.mozilla && !localStorage.theme) {
if (data.user.level == 'guest' && $.browser.mozilla && !localStorage.OxTheme) {
pandora.user.ui.theme = 'classic';
}
@ -268,7 +268,6 @@ appPanel
}
Ox.Theme(pandora.user.ui.theme);
localStorage.theme = pandora.user.ui.theme;
pandora.$ui.appPanel = pandora.ui.appPanel().display();
Ox.Request.requests() && pandora.$ui.loadingIcon.start();
pandora.$ui.body.ajaxStart(pandora.$ui.loadingIcon.start);

View File

@ -143,7 +143,7 @@ pandora.ui.mainMenu = function() {
{ id: 'clearcache', title: 'Clear Cache'},
{ id: 'reloadapplication', title: 'Reload Application'},
{ id: 'resetui', title: 'Reset UI Settings'},
{ id: 'debug', title: (localStorage.debug?'Disable':'Enable')+' Debug Mode'},
{ id: 'debug', title: (localStorage.pandoraDebug?'Disable':'Enable')+' Debug Mode'},
{ id: 'triggererror', title: 'Trigger JavaScript Error'},
] }
]
@ -176,7 +176,6 @@ pandora.ui.mainMenu = function() {
} else if (data.id == 'settheme') {
Ox.Theme(value);
pandora.UI.set('theme', value);
localStorage.theme = value;
} else if (data.id == 'showsiteposter') {
pandora.UI.set('showSitePoster', data.checked)
} else if (Ox.startsWith(data.id, 'sortgroup')) {
@ -280,12 +279,12 @@ pandora.ui.mainMenu = function() {
pandora.$ui.appPanel.reload();
});
} else if (data.id == 'debug') {
if(localStorage.debug) {
delete localStorage.debug;
if(localStorage.pandoraDebug) {
delete localStorage.pandoraDebug;
} else {
localStorage.debug = 1;
localStorage.pandoraDebug = 1;
}
that.setItemTitle('debug', (localStorage.debug ? 'Disable' : 'Enable') + ' Debug Mode');
that.setItemTitle('debug', (localStorage.pandoraDebug ? 'Disable' : 'Enable') + ' Debug Mode');
} else if (data.id == 'triggererror') {
var e = error;
}