pandora/static/js/appearanceDialog.js

68 lines
2.2 KiB
JavaScript
Raw Permalink Normal View History

2013-08-08 13:00:02 +00:00
'use strict';
pandora.ui.appearanceDialog = function() {
var that = pandora.ui.iconDialog({
buttons: [
Ox.Button({
id: 'done',
title: Ox._('Done')
}).bindEvent({
click: function() {
that.close();
}
})
],
content: Ox.Form({
items: [
Ox.Select({
id: 'theme',
items: pandora.site.themes.map(function(theme) {
2015-04-20 08:13:56 +00:00
return {
id: theme,
title: Ox.Theme.getThemeData(theme).themeName
};
2013-08-08 13:00:02 +00:00
}),
label: Ox._('Theme'),
labelWidth: 120,
value: pandora.user.ui.theme,
width: 320
})
.bindEvent({
change: function(data) {
pandora.UI.set({theme: data.value});
pandora.setTheme(data.value);
}
}),
Ox.Select({
id: 'locale',
2014-04-01 14:23:33 +00:00
items: pandora.site.languages.map(function(locale) {
2015-04-20 08:13:56 +00:00
return {
id: locale,
title: Ox.LOCALE_NAMES[locale]
};
2013-08-08 13:00:02 +00:00
}),
label: Ox._('Language'),
labelWidth: 120,
value: pandora.user.ui.locale,
width: 320
})
.bindEvent({
change: function(data) {
pandora.UI.set({locale: data.value});
pandora.setLocale(data.value, function() {
pandora.$ui.appPanel.reload();
});
}
})
]
}),
keys: {enter: 'done', escape: 'done'},
title: Ox._('Appearance'),
width: 432
});
return that;
};