diff --git a/static/js/localeButton.js b/static/js/localeButton.js new file mode 100644 index 000000000..5659e932e --- /dev/null +++ b/static/js/localeButton.js @@ -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; + +}; \ No newline at end of file diff --git a/static/js/userButton.js b/static/js/userButton.js new file mode 100644 index 000000000..9cabc05ea --- /dev/null +++ b/static/js/userButton.js @@ -0,0 +1,45 @@ +'use strict'; + +pandora.ui.userButton = function() { + + var isGuest = pandora.user.level == 'guest', + that = Ox.Element().css({marginLeft: '3px'}); + + $('