forked from schneidmaster/zurbfoundation5-multiselect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
454 lines (404 loc) · 21.6 KB
/
index.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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Zurb Foundation 5 Multiselect</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/foundation/5.1.0/css/foundation.css" />
<link rel="stylesheet" href="zmultiselect/zurb5-multiselect.css" />
<script src="js/modernizr.js"></script>
<style>
.prettyprint{
border:0!important;
font-size: 1.3em;
}
</style>
</head>
<body>
<a href="https://github.com/icyz/zurbfoundation5-multiselect"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a>
<div class="row">
<div class="large-12 columns">
<h1>ZMultiSelect ~ v 0.3</h1>
<h3>multiselect plugin for zurb foundation 5 by <a target="_blank" href="http://www.andreamariani.net">andreamariani.net</a></h3>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<div data-alert class="alert-box warning">
<h4 style="color:#fff;">Pay attention!</h4>
<p style='margin:3px'>This plugin is developing. If you decide to use it pay attention, the apis could change.</p>
<p style='margin:3px'>This is the first version and could be full of bugs. I have to test it on many devices and i'm glad if someone want join the work.</p>
<p style='margin:3px'>Thanks you all and LONG LIFE TO THE YETI!</p>
</div>
<div class="panel">
<div class="row">
<div class="large-4 medium-4 columns">
<h5>Why</h5>
<p>This is a cool way for have a nice multi-select input with zurb foundation style.<br/>Lightweight and easy.</p>
</div>
<div class="large-4 medium-4 columns">
<h5>Dependencies?</h5>
<p>No one. It's standalone.<br/>(only jquery and zurb foundation)</p>
</div>
<div class="large-4 medium-4 columns text-center">
<h5>I'm thirsty. Buy me a beer?</h5>
<br/>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHNwYJKoZIhvcNAQcEoIIHKDCCByQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxC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MDI4NTZaMCMGCSqGSIb3DQEJBDEWBBQzVvLojUDLzsIpx75yElkqCBd4rjANBgkqhkiG9w0BAQEFAASBgDHYKVrUP9BLcI1VfGPMCqu6cwyZpW023vyTeQNFNzvJPPHpgcj9202564XpN1MfpBTrzypFw8KUeIneGBmNqSzX9YW1A/jm+U4faSwh31rnbr8OjjIbPSrkm/wflJNduYVB07/4H5i8MKTq/B0y2Ibbk7fbm5EsUsr3e+iYJdKZ-----END PKCS7-----">
<input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal The safer, easier way to pay online." />
<img alt="" border="0" src="https://www.paypalobjects.com/it_IT/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<h4>Demo</h4>
<form>
<div class="row">
<div class="large-6 columns">
<input type="text" id="live" placeholder="input text with id='live'" />
<label for="box1">ZMultiSelect Box #1</label>
<select id="box1">
<optgroup label='Languages'>
<option value="php">PHP</option>
<option value="php4">PHP4</option>
<option value="php5">PHP5</option>
<option value="php6">PHP6</option>
<option value="js" data-selected >JS</option>
<option value="ruby">ruby</option>
<option value="cplusplus">c++</option>
<option value="java" data-disabled>java (disabled!)</option>
</optgroup>
<optgroup label='Food'>
<option value="pizza">pizza</option>
<option value="maccheroni">maccheroni</option>
</optgroup>
</select>
</div>
<div class="large-6 columns">
<pre class="prettyprint">$("select#box1").zmultiselect({
live: "#live",
placeholder: "My pretty zurb multiselect",
filter: true,
filterPlaceholder: 'MyFilter...',
filterResult: true,
filterResultText: "Showed",
selectedText: ['Selected','of']
});
</pre>
</div>
</div>
<div class="row" style="margin-top:40px;">
<div class="large-6 columns">
<label for="box2">ZMultiSelect Box #2</label>
<select id="box2">
<option value="husker">Husker</option>
<option value="starbuck">Starbuck</option>
<option value="hotdog">Hot Dog</option>
<option value="apollo">Apollo</option>
</select>
</div>
<div class="large-6 columns">
<pre class="prettyprint">$("select#box2").zmultiselect({
live: false,
placeholder: "Box number 2",
filter: false
});
</pre>
</div>
</div>
<div class="row" style="margin-top:40px;">
<div class="large-6 columns">
<h5>Testing #box1 methods</h5>
<div>
<a class="button tiny " onclick="jQuery('#box1').zmultiselect('open');">open</a>
<a class="button tiny " onclick="jQuery('#box1').zmultiselect('close');">close</a>
</div>
<div>
<a class="button tiny success" onclick="jQuery('#box1').zmultiselect('set','ruby',true);">check ruby</a>
<a class="button tiny success" onclick="jQuery('#box1').zmultiselect('set','ruby',false);">uncheck ruby</a>
</div>
<div>
<a class="button tiny alert" onclick="jQuery('#box1').zmultiselect('checkall');">checkall</a>
<a class="button tiny alert" onclick="jQuery('#box1').zmultiselect('uncheckall');">uncheckall</a>
</div>
</div>
<div class="large-6 columns">
<h5>Testing #box2</h5>
<div>
<a class="button tiny " onclick="jQuery('#box2').zmultiselect('open');">open</a>
<a class="button tiny " onclick="jQuery('#box2').zmultiselect('close');">close</a>
</div>
<div>
<a class="button tiny success" onclick="jQuery('#box2').zmultiselect('set','hotdog',true);">check hotdog</a>
<a class="button tiny success" onclick="jQuery('#box2').zmultiselect('set','hotdog',false);">uncheck hotdog</a>
</div>
<div>
<a class="button tiny alert" onclick="jQuery('#box2').zmultiselect('checkall');">checkall</a>
<a class="button tiny alert" onclick="jQuery('#box2').zmultiselect('uncheckall');">uncheckall</a>
</div>
</div>
</div>
</form>
</div>
</div>
<div class="row" style="margin-top:40px;">
<div class="large-12 columns">
<h4>Optgroup <span class="label alert">N E W</span></h4>
<div>Optgroup is now supported:</div>
<pre class='prettyprint'>
<select>
<optgroup label='Food'>
<option>HotDog</option>
<option data-selected>Pizza</option>
<option>Spaghetti</option>
</optgroup>
<optgroup label='Colors'>
<option>Red</option>
<option data-selected>Black</option>
<option>Orange</option>
<option>Purple</option>
</optgroup>
</select>
</pre>
<div>Look at "JS" in #box1.</div>
</div>
</div>
<div class="row" style="margin-top:20px;">
<div class="large-12 columns">
<h4>Tips</h4>
<div>You can pre-select an option using data-selected into your <select>. e.g:</div>
<pre class='prettyprint'>
<select>
<option>HotDog</option>
<option data-selected>Pizza</option>
<option>Spaghetti</option>
</select>
</pre>
<div>Look at "JS" in #box1.</div>
</div>
</div>
<div class="row" style="margin-top:40px;">
<div class="large-12 columns">
<h4>Options</h4>
<table>
<thead>
<tr>
<th width="250">Option</th>
<th >Description</th>
<th width="100">Default</th>
<th width="250">Example</th>
</tr>
</thead>
<tbody>
<tr>
<td>placeholder</td>
<td>Set placeholder text when checkbox aren't checked</td>
<td>"&nbsp;"</td>
<td><pre class='prettyprint'>$("#multiselect").zmultiselect('open');</pre></td>
</tr>
<tr>
<td>selectedText</td>
<td>The text showed when checkbox are checked.<br/>e.g: "Selected 3 of 6"</td>
<td>"# of # selected"</td>
<td><pre class='prettyprint'>$("#multiselect").zmultiselect({selectedText: ['Selected','of']});</pre>
<br/>thanks to <a href="https://github.com/dsmithco" target="_blank">dsmithco</a>
</td>
</tr>
<tr>
<td>get</td>
<td>Initializing multiselect using data from url</td>
<td>false</td>
<td>url example: http://www.andreamariani.net/zurbfoundation5-multiselect/index.html?box1=1,2,3<br/>
<pre class='prettyprint'>$("#multiselect").zmultiselect({get: 'box1'});</pre>
This will check input with value "1", "2", "3" (for the multiselect with id="multiselect")
</td>
</tr>
<tr>
<td>filter</td>
<td>This feature add an input for filter the checkbox</td>
<td>false</td>
<td><pre class='prettyprint'>$("#multiselect").zmultiselect({filter: true});</pre></td>
</tr>
<tr>
<td>filterResult</td>
<td>Show summary checkbox visible / total</td>
<td>true</td>
<td><pre class='prettyprint'>$("#multiselect").zmultiselect('open');</pre></td>
</tr>
<tr>
<td>filterResultText</td>
<td>Change the text of summary</td>
<td>"showed"</td>
<td><pre class='prettyprint'>$("#multiselect").zmultiselect('open');</pre></td>
</tr>
<tr>
<td>selectAll</td>
<td>Prepend "Select All" and "Deselect All" in checkbox list</td>
<td>true</td>
<td><pre class='prettyprint'>$("#multiselect").zmultiselect({selectAll: false});</pre></td>
</tr>
<tr>
<td>selectAllText</td>
<td>Change the text for "Select All" and "Deselect All"</td>
<td>["Select All", "Deselect All"]</td>
<td><pre class='prettyprint'>$("#multiselect").zmultiselect({selectAllText: ["mycustom Select All Text", "mycustom DESelect All Text"]});</pre></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<h4>Methods</h4>
<table>
<thead>
<tr>
<th width="250">Method</th>
<th >Description</th>
<th width="250">Example</th>
</tr>
</thead>
<tbody>
<tr>
<td>open</td>
<td>Open multiselect</td>
<td><pre class='prettyprint'>$("#multiselect").zmultiselect('open');</pre></td>
</tr>
<tr>
<td>close</td>
<td>Close multiselect</td>
<td><pre class='prettyprint'>$("#multiselect").zmultiselect('open');</pre></td>
</tr>
<tr>
<td>set</td>
<td>Check or uncheck checkbox using value selector</td>
<td><pre class='prettyprint'>$("#multiselect").zmultiselect('set','hotdot',true);</pre></td>
</tr>
<tr>
<td>disable</td>
<td>Enable or disabled checkbox</td>
<td><pre class='prettyprint'>$("#multiselect").zmultiselect('disable','hotdot',true);
$("#multiselect").zmultiselect('disable','hotdot',false);</pre></td>
</tr>
<tr>
<td>checkall</td>
<td>Check all checkbox</td>
<td><pre class='prettyprint'>$("#multiselect").zmultiselect('checkall');</pre></td>
</tr>
<tr>
<td>uncheckall</td>
<td>Uncheck all checkbox</td>
<td><pre class='prettyprint'>$("#multiselect").zmultiselect('uncheckall');</pre></td>
</tr>
<tr>
<td>checkall_inpage</td>
<td>Check all the checkbox in the page</td>
<td><pre class='prettyprint'>$("#multiselect").zmultiselect('checkall_inpage');</pre></td>
</tr>
<tr>
<td>uncheckall_inpage</td>
<td>Uncheck all the checkbox in the page</td>
<td><pre class='prettyprint'>$("#multiselect").zmultiselect('uncheckall_inpage');</pre></td>
</tr>
<tr>
<td>reflow</td>
<td>Force reinit (useful when you change width dynamically)</td>
<td><pre class='prettyprint'>$("#multiselect").zmultiselect('reflow');</pre></td>
</tr>
<tr>
<td>destroy</td>
<td>Remove option</td>
<td><pre class='prettyprint'>$("#multiselect").zmultiselect('destroy', 'hotdog');</pre></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<h4>Events (in development)</h4>
<table>
<thead>
<tr>
<th width="250">Event</th>
<th>Description</th>
<th width="250">Example</th>
</tr>
</thead>
<tbody>
<tr>
<td>onOpen</td>
<td>On open callback</td>
<td><pre class='prettyprint'></pre></td>
</tr>
<tr>
<td>onClose</td>
<td>On close callback</td>
<td><pre class='prettyprint'></pre></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<h4>Share the joy</h4>
<a href="https://twitter.com/share" class="twitter-share-button" data-via="andreamariani2k" data-size="large" data-related="foundationzurb" data-hashtags="foundationzurb">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<a href="https://twitter.com/andreamariani2k" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @andreamariani2k</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<hr/>
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = 'zurbmultiselect'; // required: replace example with your forum shortname
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</div>
</div>
<div class="row" style='margin-top:15px;'>
<div class="large-12 columns text-center">
andreamariani.net ~ Florence 2013.
</div>
</div>
<!-- code prettify -->
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
<script src="js/jquery.js"></script>
<script src="js/foundation.min.js"></script>
<script>
$(document).foundation();
</script>
<script src="zmultiselect/zurb5-multiselect.js"></script>
<script>
$("select#box1").zmultiselect({
live: "#live",
placeholder: "My pretty zurb multiselect",
filter: true,
filterPlaceholder: 'MyFilter...',
filterResult: true,
filterResultText: "Showed",
selectedText: ['Selected','of']
});
$("select#box2").zmultiselect({
live: false,
placeholder: "Box number 2",
filter: false
});
</script>
</body>
</html>