diff --git a/static/js/pandora.js b/static/js/pandora.js index 5d8502377..adeca6fea 100644 --- a/static/js/pandora.js +++ b/static/js/pandora.js @@ -318,16 +318,16 @@ appPanel videoFormat: Ox.UI.getVideoFormat(pandora.site.video.formats) }); - // set up url controller + // set locale and initialize url controller pandora.setLocale(pandora.user.ui.locale, function() { pandora.URL.init().parse(function() { + var isHome = Ox.contains(['/', '/home'], document.location.pathname); if (data.browserSupported) { stopAnimation(); $('#loadingScreen').remove(); } else { loadBrowserMessage(); } - Ox.Theme(pandora.user.ui.theme); if (isEmbed) { pandora.$ui.embedPanel = pandora.ui.embedPanel().display(); @@ -345,33 +345,39 @@ appPanel }); } else if (isPrint) { pandora.$ui.printView = pandora.ui.printView().display(); + } else if (isHome) { + pandora.$ui.home = pandora.ui.home().showScreen(initPandoraApp); } else { - pandora.$ui.appPanel = pandora.ui.appPanel().display(); - Ox.Request.requests() && pandora.$ui.loadingIcon.start(); - pandora.$ui.body.ajaxStart(pandora.$ui.loadingIcon.start); - pandora.$ui.body.ajaxStop(pandora.$ui.loadingIcon.stop); - Ox.Request.bindEvent({ - error: pandora.ui.errorDialog, - request: function(data) { - pandora.$ui.loadingIcon.options({ - tooltip: (data.requests || 'No') - + ' request' - + (data.requests == 1 ? '' : 's') - }); - } - }); - pandora.site.sectionButtonsWidth = pandora.$ui.sectionButtons.width() + 8; - if (getLocalStorage('pandora.onload')) { - try { - eval(localStorage['pandora.onload']) - } catch(e) {} - } + initPandoraApp(); } }); }); } + function initPandoraApp() { + pandora.$ui.appPanel = pandora.ui.appPanel().display(); + Ox.Request.requests() && pandora.$ui.loadingIcon.start(); + pandora.$ui.body.ajaxStart(pandora.$ui.loadingIcon.start); + pandora.$ui.body.ajaxStop(pandora.$ui.loadingIcon.stop); + Ox.Request.bindEvent({ + error: pandora.ui.errorDialog, + request: function(data) { + pandora.$ui.loadingIcon.options({ + tooltip: (data.requests || 'No') + + ' request' + + (data.requests == 1 ? '' : 's') + }); + } + }); + pandora.site.sectionButtonsWidth = pandora.$ui.sectionButtons.width() + 8; + if (getLocalStorage('pandora.onload')) { + try { + eval(localStorage['pandora.onload']) + } catch(e) {} + } + } + function loadBrowserMessage() { var browsers = [].concat( isMSIE ? [{name: 'Chrome Frame', url: 'http://google.com/chromeframe/'}] : [],