aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features/user-settings.js
diff options
context:
space:
mode:
Diffstat (limited to 'web_src/js/features/user-settings.js')
-rw-r--r--web_src/js/features/user-settings.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/web_src/js/features/user-settings.js b/web_src/js/features/user-settings.js
new file mode 100644
index 0000000000..c2f00dc362
--- /dev/null
+++ b/web_src/js/features/user-settings.js
@@ -0,0 +1,15 @@
+export function initUserSettings() {
+ if ($('.user.settings.profile').length > 0) {
+ $('#username').on('keyup', function () {
+ const $prompt = $('#name-change-prompt');
+ const $prompt_redirect = $('#name-change-redirect-prompt');
+ if ($(this).val().toString().toLowerCase() !== $(this).data('name').toString().toLowerCase()) {
+ $prompt.show();
+ $prompt_redirect.show();
+ } else {
+ $prompt.hide();
+ $prompt_redirect.hide();
+ }
+ });
+ }
+}