[openstreetmap/openstreetmap-website] Add some javascript to check dynamically if the username is already taken (PR #4402)
Anton Khorev
notifications at github.com
Wed Dec 13 14:16:19 UTC 2023
@AntonKhorev commented on this pull request.
> @@ -223,4 +223,62 @@ $(document).ready(function () {
$("#read_tou").on("click", function () {
$("#continue").prop("disabled", !($(this).prop("checked") && $("#read_ct").prop("checked")));
});
+
+
+ const isTaken /* Record<string, string> */ = {}
+
+ function indicateInvalidDisplayName(isValid /* boolean | undefined*/) {
+ // isValid might also be 'undefined', hence we check explicitly for 'true' and 'false'
+ $("#user_display_name").toggleClass("is-valid", isValid === true)
+ $("#user_display_name").toggleClass("is-invalid", isValid === false)
+ }
+
+ function checkDisplayName(){
+ const displayName = $("#user_display_name").val()
+ if(displayName === ""){
Might check instead if the name is shorter than 3 characters.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4402#pullrequestreview-1779741331
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4402/review/1779741331 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20231213/31b7b51f/attachment.htm>
More information about the rails-dev
mailing list