From 50e5c6b76015e812e07f99210569c1853608d294 Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 4 Nov 2011 16:10:53 +0000 Subject: [PATCH] namespace localStorage --- static/js/pandora.js | 9 ++++----- static/js/pandora/menu.js | 11 +++++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/static/js/pandora.js b/static/js/pandora.js index f53322f8..0cfd810b 100644 --- a/static/js/pandora.js +++ b/static/js/pandora.js @@ -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); diff --git a/static/js/pandora/menu.js b/static/js/pandora/menu.js index 84adc1fb..e3ba66d9 100644 --- a/static/js/pandora/menu.js +++ b/static/js/pandora/menu.js @@ -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; }