-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
44 lines (35 loc) · 1.78 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
jQuery at-username plugin
by Bradley Abrahams for Playfire
http://mrkipling.github.com/jQuery-at-username/
Autocomplete usernames when typing @
Usage: apply to a textarea:
$('textarea').atUsername(settings);
See example.html for a working example.
Settings (optional):
containerSelector (default='.at-username-container'):
description: string containing a selector
If specificied, the element referenced in this selector (which should be a
parent element of the textarea this is applied to) will be searched for
all elements with a class of settings.usernameSelector; the $.text() value
of these elements will be added to the searchable list of usernames.
usernameSelector (default='.username'):
description: string containing a selector
If settings.containerSelector is specified, this is the selector that will
be used to find elements within that container which contain usernames.
xhrUsernames (default=null):
description: string (URL)
If exists, this URL will be queried. It should return JSON in the
following format:
{ usernames: [ 'username1', 'username2' ... ] }
These usernames will be searchable by all textareas using the plugin on
that page that also have the same url specified in xhrUsernames. Each URL
will only ever be queried once (see xhrOnFocus to control whether this is
done lazily on focus, or on binding to the textarea).
xhrOnFocus (default=true):
description: boolean
If true (and xhrUsernames is set), the xhrUsernames URL will be loaded
lazily when the textarea has focus set for the first time. If false, it
will be loaded in straight away on bind.
numResults (default=5):
description: int
The number of results to display in the autocomplete dropdown.