From b66b5eca4d37025b2a226d8466bdcc163cf2141a Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Mon, 17 May 2021 08:17:45 +1000 Subject: [PATCH] Use label tag for chat username label, and rename javascript function to checkUsernameTooLong to better reflect its purpose --- cli/onionshare_cli/resources/static/js/chat.js | 4 ++-- cli/onionshare_cli/resources/templates/chat.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/onionshare_cli/resources/static/js/chat.js b/cli/onionshare_cli/resources/static/js/chat.js index 97b14e3e..de64c094 100644 --- a/cli/onionshare_cli/resources/static/js/chat.js +++ b/cli/onionshare_cli/resources/static/js/chat.js @@ -88,7 +88,7 @@ var emitMessage = function (socket) { var updateUsername = function (socket) { var username = $('#username').val(); - if (!checkUsernameExists(username) && !checkUsernameLength(username)) { + if (!checkUsernameExists(username) && !checkUsernameTooLong(username)) { $.ajax({ method: 'POST', url: `http://${document.domain}:${location.port}/update-session-username`, @@ -133,7 +133,7 @@ var checkUsernameExists = function (username) { return false; } -var checkUsernameLength = function (username) { +var checkUsernameTooLong = function (username) { $('#username-error').text(''); if (username.length > 128) { $('#username-error').text('Please choose a shorter username.'); diff --git a/cli/onionshare_cli/resources/templates/chat.html b/cli/onionshare_cli/resources/templates/chat.html index 7f60b11d..48434d99 100644 --- a/cli/onionshare_cli/resources/templates/chat.html +++ b/cli/onionshare_cli/resources/templates/chat.html @@ -23,7 +23,7 @@
-

Your username:

+