From b0fe39e4e80d31a64793eec44af6e0a7fddb211b Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Fri, 14 Jun 2019 01:47:52 -0600 Subject: [PATCH] Add option to change nickname (close #21) --- www/js/settings.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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) {