Add a searchPrefix option to rbautocomplete.
Review Request #6807 — Created Jan. 18, 2015 and discarded
There are some installs of Review Board where the user list is so large, with so many similar names, that it's necessary to find a new way of differentiating them when searching for their entries for autocomplete. An example of this is Mozilla's instance of Review Board. Mozilla's convention is to have the fullnames of their users followed by their IRC Nick, prefixed with a colon, for example: Mike Conley (:mconley) RB's autocomplete widget isn't prepared to handle searches for ":mconley", and map them to the actual Review Board username "mconley". This works around that issue. Really, this just supports the perpetuation of a habit that Mozillians have developed over time. It's true that they could just start entering the IRC nick and get the result they're looking for, but the colon prefix is what they're used to.
In a local instance, I made sure that searching for normal usernames (without a search prefix) worked properly to make sure we didn't regress. I tested both selecting an autocomplete entry by pressing "enter" and "tab", as well as selecting an entry with the mouse.
Then, in our RBMozUI extension, where we've forked rbautocomplete with this patch, I used searchPrefix to make sure the colon prefix work around still worked. I was able to autocomplete with the colon prefix, and was able to select a reviewer both by pressing "enter" and "tab", as well as selecting one with the mouse.
Description | From | Last Updated |
---|---|---|
In line with our style guide, shouldn't there be only one var declaration and it should occur at the top … |
brennie | |
Shouldn't have a trailing comma here. |
david | |
The var definition for trimmed should actually be inside here (since there's an anonymous function). I think the comment was … |
david | |
Should use === |
david |
- Change Summary:
-
Moved the var declaration outside of the each function.
- Commit:
-
63f3879e8b39ca1027e0ffa07e24078f6977d7669e1d7c40745bce3b2b57e704c4b1039e503dd8fb
-
Tool: PEP8 Style Checker Ignored Files: reviewboard/static/lib/js/ui.autocomplete.js Tool: Pyflakes Ignored Files: reviewboard/static/lib/js/ui.autocomplete.js