add user and locale menu extra buttons

This commit is contained in:
rolux 2013-08-08 12:59:42 +00:00
commit 722b9fb418
2 changed files with 75 additions and 0 deletions

30
static/js/localeButton.js Normal file
View file

@ -0,0 +1,30 @@
'use strict';
pandora.ui.localeButton = function() {
var isGuest = pandora.user.level == 'guest',
that = Ox.Element({
tooltip: 'Click to change language'
})
.addClass('OxLight')
.css({
padding: '0 2px',
margin: '2px 3px 2px 1px',
fontSize: '9px'
})
.html('[' + pandora.user.ui.locale.toUpperCase() + ']')
.bindEvent({
anyclick: function() {
if (isGuest) {
pandora.$ui.appearanceDialog = pandora.ui.appearanceDialog().open();
} else {
pandora.UI.set({'part.preferences': 'appearance'});
pandora.UI.set({page: 'preferences'});
}
}
});
return that;
};