handle preferences part; add pandora.setTheme

This commit is contained in:
rolux 2013-08-08 11:01:23 +00:00
parent 28dcc7ce42
commit d1ab4beb36

View file

@ -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