diff --git a/www/js/settings.js b/www/js/settings.js index a513e3a..b04d0fd 100644 --- a/www/js/settings.js +++ b/www/js/settings.js @@ -15,6 +15,15 @@ var settings = [ type: "toggle", restart: true }, + { + setting: "nickname", + title: "Nickname", + text: "Change your player name.", + icon: "fas fa-user-edit", + color: "blue", + onclick: "changeNickname()", + type: "link" + }, { setting: "munzee", title: "Link Munzee account", @@ -61,6 +70,18 @@ var settings = [ } ]; +function changeNickname() { + app.dialog.prompt('New Name', function (name) { + callAPI("changenick", { + nick: name + }, function (success) { + app.dialog.alert('You are now known as ' + success.name); + }, function (error) { + app.dialog.alert(error); + }); + }); +} + function loadSettings() { $("#settings-bin").html(""); settings.forEach(function (item) {