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) {} } catch(e) {}
}; };
var debug = localStorage && localStorage.debug, var debug = localStorage && localStorage.pandoraDebug,
theme = localStorage && localStorage.theme || 'modern'; theme = localStorage && localStorage.OxTheme || 'modern';
loadImages(function(images) { loadImages(function(images) {
loadScreen(images); loadScreen(images);
@ -157,7 +157,7 @@ appPanel
function loadPandoraFiles(callback) { function loadPandoraFiles(callback) {
var prefix = '/static/'; var prefix = '/static/';
if (localStorage && localStorage.debug) { if (localStorage && localStorage.pandoraDebug) {
Ox.getJSON(prefix + 'json/pandora.json', function(files) { Ox.getJSON(prefix + 'json/pandora.json', function(files) {
var promises = []; var promises = [];
files.forEach(function(file) { files.forEach(function(file) {
@ -253,7 +253,7 @@ appPanel
videoFormat: Ox.UI.getVideoFormat(pandora.site.video.formats) 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'; pandora.user.ui.theme = 'classic';
} }
@ -268,7 +268,6 @@ appPanel
} }
Ox.Theme(pandora.user.ui.theme); Ox.Theme(pandora.user.ui.theme);
localStorage.theme = pandora.user.ui.theme;
pandora.$ui.appPanel = pandora.ui.appPanel().display(); pandora.$ui.appPanel = pandora.ui.appPanel().display();
Ox.Request.requests() && pandora.$ui.loadingIcon.start(); Ox.Request.requests() && pandora.$ui.loadingIcon.start();
pandora.$ui.body.ajaxStart(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: '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'},
{ id: 'debug', title: (localStorage.debug?'Disable':'Enable')+' Debug Mode'}, { id: 'debug', title: (localStorage.pandoraDebug?'Disable':'Enable')+' Debug Mode'},
{ id: 'triggererror', title: 'Trigger JavaScript Error'}, { id: 'triggererror', title: 'Trigger JavaScript Error'},
] } ] }
] ]
@ -176,7 +176,6 @@ pandora.ui.mainMenu = function() {
} else if (data.id == 'settheme') { } else if (data.id == 'settheme') {
Ox.Theme(value); Ox.Theme(value);
pandora.UI.set('theme', value); pandora.UI.set('theme', value);
localStorage.theme = value;
} else if (data.id == 'showsiteposter') { } else if (data.id == 'showsiteposter') {
pandora.UI.set('showSitePoster', data.checked) pandora.UI.set('showSitePoster', data.checked)
} else if (Ox.startsWith(data.id, 'sortgroup')) { } else if (Ox.startsWith(data.id, 'sortgroup')) {
@ -280,12 +279,12 @@ pandora.ui.mainMenu = function() {
pandora.$ui.appPanel.reload(); pandora.$ui.appPanel.reload();
}); });
} else if (data.id == 'debug') { } else if (data.id == 'debug') {
if(localStorage.debug) { if(localStorage.pandoraDebug) {
delete localStorage.debug; delete localStorage.pandoraDebug;
} else { } 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') { } else if (data.id == 'triggererror') {
var e = error; var e = error;
} }