From d1ab4beb363c081e4a420b056ce01002bdef8e0d Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 8 Aug 2013 11:01:23 +0000 Subject: [PATCH] handle preferences part; add pandora.setTheme --- static/js/utils.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/static/js/utils.js b/static/js/utils.js index 492b1494..ca53153c 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -1297,6 +1297,11 @@ pandora.getPart = function(state, str, callback) { } callback(); }); + } else if (state.page == 'preferences') { + if (Ox.contains(['account', 'appearance', 'advanced'], str)) { + state.part = str; + } + callback(); } else if (state.page == 'tv') { var split = str.split(':'), user, name; if (split.length >= 2) { @@ -1945,6 +1950,18 @@ pandora.setLocale = function(locale, callback) { Ox.setLocale(locale, url, callback); }; +pandora.setTheme = function(theme) { + var iframe, src; + Ox.Theme(theme); + iframe = Ox.UI.elements[$('#embed').data('oxid')]; + if (iframe) { + src = iframe.attr('src'); + if (src && Ox.parseURL(src).hostname == document.location.hostname) { + iframe.postMessage('settheme', {theme: theme}); + } + } +}; + pandora.unloadWindow = function() { /* // fixme: ajax request has to have async set to false for this to work