Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 165 lines (144 sloc) 10.894 kB
092de24 @chrisanderton tweak readme
chrisanderton authored
1 # Proto!MultiSelect
2
d40e548 @dvandersluis Fixed loadFromInput being called to soon when used in conjunction wit…
dvandersluis authored
3 Prototype version required: 1.6.0 (1.6.1 for IE8)
092de24 @chrisanderton tweak readme
chrisanderton authored
4
5 Copyright: InteRiders <http://interiders.com/> - Distributed under MIT - Keep this message!
6
7 ## Credits
8
9 - Idea: Facebook + Apple Mail
10 - Caret position method: Diego Perini <http://javascript.nwbox.com/cursor_position/cursor.js>
11 - Guillermo Rauch: Original MooTools script
eb56917 @chrisanderton update readme
chrisanderton authored
12 - Ran Grushkowsky/InteRiders Inc. <http://interiders.com/>
13 - Loren Johnson, <http://www.hellovenado.com/>
14 - Zuriel Barron, <http://severelimitation.com/>
15 - Sean Cribbs <http://seancribbs.com/>
4b17331 @chrisanderton tweaks - update to 0.5
chrisanderton authored
16 - [skaue]
eb56917 @chrisanderton update readme
chrisanderton authored
17 - Nickolas Daskalou <http://www.footysx.com.au/>
18 - Chris Anderton <http://thewebfellas.com/>
5e5a4fd @chrisanderton updates from dejanstrbac
chrisanderton authored
19 - Dejan Strbac
2576952 @dvandersluis Updated readme and index for version 0.9
dvandersluis authored
20 - Daniel Vandersluis <http://www.codexed.com/>
092de24 @chrisanderton tweak readme
chrisanderton authored
21
b2564bd @chrisanderton fix the non-regex search, add options to README
chrisanderton authored
22 ## Parameters (and defaults)
23
24 - separator: ','
25 - extrainputs: true
26 - startinput: true
27 - hideempty: true
28 - newValues: false
29 - allow new values to be created
bcb19d6 update documentation for added fields/options
Garry Tan authored
30 - allowDuplicates: false
31 - checks user input against data that was already added to the selected set, and rejects user input if duplicate
b2564bd @chrisanderton fix the non-regex search, add options to README
chrisanderton authored
32 - newValueDelimiters: ['[',']']
33 - define what values split into new entries
34 - spaceReplace: ''
35 - allow handling of new tag values when the tagging scheme doesn't allow spaces, this is set as blank by default and will have no impact
36 - fetchFile: undefined,
37 - location of JSON file
38 - fetchMethod: 'get'
39 - set HTTP method
2576952 @dvandersluis Updated readme and index for version 0.9
dvandersluis authored
40 - feed: undefined
41 - initial JSON feed to use (ignored if fetfile is specified)
b2564bd @chrisanderton fix the non-regex search, add options to README
chrisanderton authored
42 - results: 10,
43 - maximum number of results to retrieve for display in the list (see also maxResults)
44 - maxResults: 0
45 - number of results to show in the list before scrolling - when set to 0 then it uses the default of 10 (i.e. there is no 'zero' option)
46 - wordMatch: false
47 - when set to true will match only the beginning of word (only when using regex search), otherwise will match anywhere
48 - onEmptyInput: function(input){}
49 - callback that is called when user hits enter when the input is blank
50 - caseSensitive: false
51 - case sensitive/insensitive matching
52 - regexSearch: true
53 - specifies whether to search using a regular expression or simple text search (faster)
da4bb51 @nathanstitt Updated docs to reflect changes
nathanstitt authored
54 - onAdd: function( input ){}
55 - callback that is called when a new element is added to input. Argument is an object containing caption and value members. If it's a newvalue, caption will be nil.
56 - onRemove: function( value ){}
57 - callback that is called when a element is removed from the input. Argument is the value of the element.
bcb19d6 update documentation for added fields/options
Garry Tan authored
58 - onUserAdd: function(x){}
59 - more useful callback than onAdd -- passes back object hash with relevant info e.g. {'caption': 'zuriel barro', 'value': 'new_value[[zuriel barro]]', 'newValue': true}, and only is passed back when the user does an action (does not callback on pre-populated items)
60 - onUserRemove: function(x){}
61 - same as onUserAdd, but for removal / disposal of an item
2576952 @dvandersluis Updated readme and index for version 0.9
dvandersluis authored
62 - loadFromInput: true
63 - specifies whether to add any values given in the initial text input to the control. Values will be loaded against any data provide
64 - defaultMessage: ""
65 - if the control is building the autocomplete div itself, specifies the default message to use.
bcb19d6 update documentation for added fields/options
Garry Tan authored
66 - inputMessage: null
67 - Shows an input message so that the user knows to click on the textbox to add more items. Goes away once the user gives focus.
883c1fb @dvandersluis Added sortResults to the parameters list
dvandersluis authored
68 - sortResults: false
69 - specifies whether autocomplete results should be sorted alphabetically by caption.
f552394 @dvandersluis Updated readme/demo for 0.10
dvandersluis authored
70 - autoDelay: 250
71 - specifies the delay before the autocomplete results appear.
7023dba @dvandersluis Pushed version to 0.11. Fixed autocomplete not playing well with HTML…
dvandersluis authored
72 - encodeEntities: false
73 - specifies whether HTML entities should be encoded when inserted. Braces are always converted into HTML entities regardless of this setting.
b2564bd @chrisanderton fix the non-regex search, add options to README
chrisanderton authored
74
092de24 @chrisanderton tweak readme
chrisanderton authored
75 ## Changelog
76
77 ### 0.1
78 - translation of MooTools script
79
80 ### 0.2
81 - renamed from Proto!TextboxList to Proto!MultiSelect, added new features/bug fixes
82 - added feature: support to fetch list on-the-fly using AJAX Credit: Cheeseroll
83 - added feature: support for value/caption
84 - added feature: maximum results to display, when greater displays a scrollbar Credit: Marcel
85 - added feature: filter by the beginning of word only or everywhere in the word Credit: Kiliman
86 - added feature: shows hand cursor when going over options
87 - bug fix: the click event stopped working
88 - bug fix: the cursor does not 'travel' when going up/down the list Credit: Marcel
89
90 ### 0.3
91 - bug fix: moved class variables into initialize so they happen per instance. This allows multiple controls per page
92 - bug fix: added id_base attribute so that multiple controls on the same page have unique list item ids (won't work otherwise)
93 - feature: Added newValues option and logic to allow new values to be created when ended with a comma (tag selector use case)
94 - mod: removed ajax fetch file happening on every search and moved it to initialization to laod all results immediately and not keep polling
95 - mod: added "fetchMethod" option so I could better accomodate my RESTful ways and set a "get" for retrieving
96 - mod: added this.update to the add and dispose methods to keep the target input box values always up to date
97 - mod: moved ResizableTextBox, TextBoxList and FaceBookList all into same file
98 - mod: added extra line breaks and fixed-up some indentation for readability
99 - mod: spaceReplace option added to allow handling of new tag values when the tagging scheme doesn't allow spaces, this is set as blank by default and will have no impact
100
101 ### 0.4
102 - bug fix: fixed bug where it was not loading initial list values
103 - bug fix: new values are not added into the autocomplete list upon removal
4b17331 @chrisanderton tweaks - update to 0.5
chrisanderton authored
104 - bug fix: improved browser compatibility (Safari, IE)
105
106 ### 0.5
107 - Add search timeout to increase responsiveness to typing.
108 - Add non-standard autocomplete attribute to main input to prevent browser-supplied autocompletion in Gecko and some other browsers.
0c3fe60 @chrisanderton update with changes by Nickolas Daskalou
chrisanderton authored
109 - bug when gsub'ing space wth "spaceReplace". Input-field does not have a function gsub, though its value has.
110
111 ### 0.6
112 - Update with changes by Nickolas Daskalou
113 - Option to specify whether to perform a case sensitive search or not (option: "caseSensitive", default: false).
114 - Option to specify whether you want the search to be performed by regular expression or by simple text search (option: "regexSearch", default: true). Non-regular expression searching is MUCH faster than by regular expression (this is the way the real Facebook autocomplete search works).
115 - Option to specify a callback upon the user hitting Enter/Return when the input is blank (option: "onEmptyInput", default: function(){}). I needed this because I did not want the user to have to move their hand off the keyboard to the mouse and then click on the submit/action button.
116 - Option to specify the maximum number of results to show (NOT the same as the "result" option, see comments below) (option: "maxResults", default: 10).
117 - NOTE ON THE NON-REGULAR EXPRESSION SEARCH: If using non-regular expression search mode, the option "matchWord" WILL HAVE NO EFFECT on the results (ie., it will behave as if matchWord were set to false). This can be fixed but at 5am my pillow is looking too good to spend more time on this, so if anyone needs this feel free to email me a request and I'll get it done (nick at footysx.com.au).
ca6157d @thewebfellas update readme
thewebfellas authored
118 - NOTE ON THE MAXRESULTS OPTION: The difference between the options "results" and "maxResults" is that "results" specifies the maximum number of visible rows allowed to be shown to the user before a scrollbar activates, whereas "maxResults" specifies the maximum number of results allowed to be in the scrollable list.
119
120 ### 0.7
eb56917 @chrisanderton update readme
chrisanderton authored
121 - fixed non regex search
5e5a4fd @chrisanderton updates from dejanstrbac
chrisanderton authored
122 - stable
123
124 ### 0.8
125 - a number of updates provided by Dejan Strbac
126 - sanitizes characters so special characters don't break it
da4bb51 @nathanstitt Updated docs to reflect changes
nathanstitt authored
127 - escapes html
128
129 ### 0.8.1
130 - small changes by Nathan Stitt
131 - Added callbacks onAdd and onRemove for integration into existing projects
132 - Renamed main class from FacebookList to MultiSelect. I don't like calling it Facebook becouse of trademark issues. Plus it's confusingly called that in the docs.
133 - Went through file with Emacs JS2 mode and fixed errors identified, mostly missing commas and semicolons.
134 - Ignore Emacs backup and OSX .DS_Store files
67159aa @nathanstitt Changed all nil to null. No idea how they got in there. Added new …
nathanstitt authored
135 - added new method insertCurrent, which will add whatever is currently in the input box as an element. Set enter to add elements along with comma.
da4bb51 @nathanstitt Updated docs to reflect changes
nathanstitt authored
136
2576952 @dvandersluis Updated readme and index for version 0.9
dvandersluis authored
137 ### 0.9
138 - Changes by Daniel Vandersluis
bb8af12 @dvandersluis Fixed readme formatting
dvandersluis authored
139 - Added createAutohandler method to automatically create the needed div/ul elements so that they don't need to be created in the HTML.
140 - Added loadFromInput option (default: true) to load values given in the initial text input into the control.
141 - Added defaultMessage option (default: "") which is used for a default message div if the control creates the autohandler. The default message is no longer mandatory.
d40e548 @dvandersluis Fixed loadFromInput being called to soon when used in conjunction wit…
dvandersluis authored
142 - Added sortResults option (default: false) which will sort autocomplete results by caption.
f552394 @dvandersluis Updated readme/demo for 0.10
dvandersluis authored
143
144 ### 0.10
145 - Decoupled TextboxList from ProtoMultiSelect so that TextboxList is fully functional on its own.
146 - Fixed ResizableTextbox so that it actually resizes the textbox and is much more intelligent about calculating the size.
147 - Changed TextboxList to use div and a instead of ul and li so that events can be contained within the control instead of being registered on the document object.
148 - Stopped the selected autocomplete result from being added if the input value does not match the result when enter is pressed.
149 - Fixed Home and End key events so that they don't scroll the page when pressed within the control.
150 - Added autoDelay option (default: 250) to specify the delay before the autocomplete results appear.
7023dba @dvandersluis Pushed version to 0.11. Fixed autocomplete not playing well with HTML…
dvandersluis authored
151
152 ### 0.11
153 - Fixed control not playing well with HTML and entities.
154 - Added encodeEntities option (default: false) that will automatically encode HTML entities to their unicode characters if set.
155 - Fixed < causing a new value to be inserted.
156 - Pressing tab with the autocomplete open will now cause the selected value to be inserted (like enter).
69ac8e7 added onRemoveElem listener so that its symmetrical with onAdd -- use…
Garry Tan authored
157
f9f7203 added duplicate checking, and an 'add this entry' row to the autocomp…
Garry Tan authored
158 ### 0.12
159 - Changes by Garry Tan (garry@posterous.com)
3cbea13 update docs, new value
Garry Tan authored
160 - Added onUserAdd / onUserRemove (more useful for dynamic add/remove), returns sensible/useful info on what is added/removed, does not include pre-loaded elements.
161 - Added inputMessage that prompts the user to click to add (configurable)
f9f7203 added duplicate checking, and an 'add this entry' row to the autocomp…
Garry Tan authored
162 - Change value to be surrounded by new_value[[...]] so that you can actually tell the difference between numbers and id values.
163 - Added 'Add **search**' to list of options if it is a new value. Needed because otherwise there's no way for the user to add a value that partial matches against the existing set (ENTER will add the first autofocused option instead of what the user typed, and comma works, but that isn't good enough.)
164 - Added allowDuplicates flag that prevents dupe content if set to true. Uses a normalized version of the caption to determine duplicate.
Something went wrong with that request. Please try again.