mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2025-01-09 00:20:08 +00:00
Ignore case when autocompleting usernames
This commit is contained in:
parent
1b61f4bc63
commit
41765c53be
@ -172,8 +172,9 @@ The the word the caret is in will be passed to `autocomplete` and replaced if a
|
||||
|
||||
return if toComplete.length is 0
|
||||
console.log "Autocompleting '#{toComplete}'"
|
||||
|
||||
users = (username for user in $('.timsChatUser') when (username = $(user).data('username')).indexOf(toComplete) is 0)
|
||||
|
||||
regex = new RegExp "^#{WCF.String.escapeRegExp(toComplete)}", "i"
|
||||
users = (username for user in $('.timsChatUser') when regex.test(username = $(user).data('username')))
|
||||
|
||||
toComplete = users[autocomplete.offset++ % users.length] + ', ' if users.length isnt 0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user