Skip to content
This repository has been archived by the owner on Nov 7, 2020. It is now read-only.

atname quickselect, powered by jquery-ui autocomplete #440

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

atname quickselect, powered by jquery-ui autocomplete #440

wants to merge 1 commit into from

Conversation

thehunmonkgroup
Copy link
Contributor

This pops up an autocomplete widget any time someone begins
typing an atname. A user's name can be selected by clicking,
or navigating with the arrow keys and hitting either enter
or tab.

The typing user's name is excluded from the list.

This pops up an autocomplete widget any time someone begins
typing an atname. A user's name can be selected by clicking,
or navigating with the arrow keys and hitting either enter
or tab.

The typing user's name is excluded from the list.
@thehunmonkgroup
Copy link
Contributor Author

Couple of additional comments about this PR:

  • the selectionStart element property being used in the source: function doesn't work in IE, apparently: http://stackoverflow.com/questions/2628323/textarea-selectionstart-in-ie -- i tested in FF, Chrome, Opera, and Safari and it works perfectly, and i have no way to test on IE. so some workaround may need to be found there.
  • there is an existing bug in the atname code, where two users with the same first name may not get the correct highlighting. i believe the correct way to solve this is to use the user's full name for atnames, substituting spaces with underscores. this would basically create unique chat nicknames and solve this problem. regardless, this patch merely exposes the bug.

@yourcelf
Copy link
Collaborator

there is an existing bug in the atname code

Omitting spaces should work with the existing code. So "Charlie DeTar" maps to "@CharlieDeTar", case insensitive. I think that tracks to the loose conventions people use with e.g. twitter names, so I'd rather keep it there than use underscores. See atname.normalize for the existing name normalization (not much to it).

This looks cool -- my main concern is just the heavy-weight-ness of loading in a whole new UI framework (jquery-UI) that has different style conventions just for the one feature. Bootstrap2 used to have a built-in typeahhttps://github.com/bassjobsen/Bootstrap-3-Typeaheadead plugin... it looks like there have been some efforts to port that to bootstrap 3, though I haven't evaluated that either yet. There's also twitter's typeahead plugin, but that might be a little overkill for this too.

thehunmonkgroup referenced this pull request Apr 3, 2016
The 'comparator' function on UserList increased server startup times
from seconds to upwards of 25 minutes, as the server attempted to
re-sort the users list 17,000 times. Suppress the comparator during
load, and restore it once load is done.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants