This repository has been archived by the owner on May 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 109
/
docs.html
281 lines (244 loc) · 7.02 KB
/
docs.html
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>jQuery Tagit Demo Page (HTML)</title>
<script src="demo/js/jquery.1.7.2.min.js"></script>
<script src="demo/js/jquery-ui.1.8.20.min.js"></script>
<link href="demo/css/demo.css" rel="stylesheet" type="text/css"/>
<script>
/*globals $*/
$(function () { 'use strict';
$('.browser').hover(
function () {
$(this).children('a').children('div').show('fast');
},
function () {
$(this).children('a').children('div').hide('fast');
});
setInterval(function () {
$('#fork').effect('pulsate', { times:1 }, 500);
}, 5000);
});
</script>
</head>
<body>
<a id="fork" href="https://github.com/hailwood/jQuery-Tagit">
<img style="position: fixed; top: 0; left: 0; border: 0;"
src="https://s3.amazonaws.com/github/ribbons/forkme_left_red_aa0000.png" alt="Fork me on GitHub">
</a>
<div id="wrap">
<h1>jQuery Tagit Documentation Page</h1>
<div id="description" class="box"><a name="description"></a>
The jQuery Tagit plugin transforms an html unordered list into a unique tagging plugin.<br/>
Why unique? Because jQuery Tagit uses jQuery Ui's auto-complete plugin to supply suggestions to users
as they type.
</div>
<h2><a name="browsers">Browser Support</a></h2>
<div class="box">
<div class="browser">
<a id="chrome" href="http://www.google.com/chrome">
<div>Works in Google Chrome!</div>
</a>
</div>
<div class="browser">
<a id="firefox" href="http://www.mozilla.com">
<div>Works in Firefox!</div>
</a>
</div>
<div class="browser">
<a id="ie" href="http://www.microsoft.com/windows/internet-explorer">
<div>Works in IE7+!</div>
</a>
</div>
<div class="browser">
<a id="opera" href="http://www.opera.com">
<div>Works in Opera!</div>
</a>
</div>
<div class="browser" style="margin-right: 0">
<a id="safari" href="http://www.apple.com/safari">
<div>Works in Safari!</div>
</a>
</div>
<div style="clear: both;"></div>
</div>
<h2><a name="features">Features</a></h2>
<div class="box features">
<ul>
<li>Convenient way for users to enter a list of items</li>
<li>Fully integrated with jQuery ui auto complete</li>
<li>Automatically adds current input as tag if input loses focus</li>
<li>Easy to use public methods</li>
<li>Easy to theme (See the css folder)</li>
<li>Customizable <em>accept</em> keys</li>
<li>Backspace on empty input deletes previous tag</li>
<li>Ability to provide <em>initial tags</em> on creation through options</li>
<li>Ability to provide <em>initial tags</em> on creation via list items</li>
<li>Option to toggle usage of a hidden select so the tags can be sent using a normal form!</li>
<li>Ability to re-arrange tags by drag and drop!</li>
<li><a href="index.themeroller.html">Optional ThemeRoller compatibility!</a></li>
<li>Fully HTML5 Data attribute compliant!</li>
</ul>
</div>
<h2><a name="code">The Minimum Code Required</a></h2>
<div class="code box">
$(<span class="green">'#tags'</span>).tagit();
</div>
<h2><a name="options">Options</a></h2>
<table class="options">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th>Note</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>tagSource</td>
<td>String, Array, Callback</td>
<td>[]</td>
<td class="left">This option maps directly to the <a href="http://jqueryui.com/demos/autocomplete/">jQuery
UI Autocomplete source option</a></td>
</tr>
<tr class="even">
<td>triggerKeys</td>
<td>Array</td>
<td>['enter', 'space', 'comma', 'tab']</td>
<td class="left">An array containing all or any of the default options.<br/>
These are the keys that will trigger a tag completion
</td>
</tr>
<tr class="odd">
<td>allowNewTags</td>
<td>Bool</td>
<td>true</td>
<td class="left">Allow tags that do not exist in tagSource to be entered?</td>
</tr>
<tr class="even">
<td>initialTags</td>
<td>Array</td>
<td>[]</td>
<td class="left">An array containing tags to pre-populate the field with</td>
</tr>
<tr class="odd">
<td>minLength</td>
<td>Int</td>
<td>1</td>
<td class="left">The minimum length before a triggerKey will create a tag</td>
</tr>
<tr class="even">
<td>select</td>
<td>Bool</td>
<td>false</td>
<td class="left">Maintain a hidden select in place for form submissions<br/>
To name the select simply give your UL a name attribute!
<hr/>
Don't forget
to include [ and ] if your language (e.g. PHP) requires them!
</td>
</tr>
<tr class="odd">
<td>tagsChanged</td>
<td>Callback</td>
<td>function(tagValue, action, element)</td>
<td class="left">Callback on changed tags:<br>
<b>tagValue:</b> string<br>
<b>action:</b> string - either 'added', 'popped', 'moved' or 'reset'<br>
<b>element:</b> object - reference to the added LI element
</td>
</tr>
<tr class="even">
<td>caseSensitive</td>
<td>Bool</td>
<td>false</td>
<td class="left">
The check for existing tags is case sensitive. If false the words "Foo" and "foo" considered the same
</td>
</tr>
<tr class="odd">
<td>highlightOnExistColor</td>
<td>String</td>
<td>#0F0</td>
<td class="left">
If the user tries to add a tag, that already exists, the existing tag will run a highlight effect using
the defined background color.
If null, the highlight effect is turned off.
</td>
</tr>
<tr class="even">
<td>maxLength</td>
<td>Int</td>
<td><em>unlimited</em></td>
<td class="left">
The maximum allowable length of a tag.<br/>
If omitted, tags of unlimited length are allowed.
</td>
</tr>
<tr class="odd">
<td>maxTags</td>
<td>Int</td>
<td><em>unlimited</em></td>
<td class="left">
The maximum number of tags that the user can enter.<br/>
If omitted, an unlimited number of tags are allowed.
</td>
</tr>
<tr class="even">
<td>sortable</td>
<td>Bool, String</td>
<td><em>false</em></td>
<td class="left">
Allows the user to re-order the tags using drag and drop.<br/>
If true the whole tag is draggable, if 'handle' a handle is <br/>
rendered and the tag is only draggable using the handle.
</td>
</tr>
</tbody>
</table>
<h2><a name="methods">Methods</a></h2>
<table class="methods">
<thead>
<tr>
<th>Name</th>
<th>Return</th>
<th>Note</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>.tagit("destroy")</td>
<td>null</td>
<td class="left">Returns the ul to its original state</td>
</tr>
<tr class="even">
<td>.tagit("tags")</td>
<td>Array</td>
<td class="left">Returns an array of objects about all the tags.</td>
</tr>
<tr class="odd">
<td>.tagit("reset")</td>
<td>null</td>
<td class="left">Resets the tags list to the initial value</td>
</tr>
<tr class="even">
<td>.tagit("fill", [{label: 'tag', value: 12}, {label: 'stuff', value: 13}])</td>
<td>null</td>
<td class="left">Empties the tags and fills the plugin with the provided tags.</td>
</tr>
<tr class="odd">
<td>.tagit("add", {label: 'tag', value: 12})</td>
<td>Bool</td>
<td class="left">Adds a tag to the plugin.</td>
</tr>
</tbody>
</table>
<h2></h2>
<div class="box">
© Content and Design Matthew Hailwood 2012<br/>
</div>
</div>
</body>
</html>