-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
377 lines (373 loc) · 12.2 KB
/
index.html
File metadata and controls
377 lines (373 loc) · 12.2 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen" />
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen" />
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
<link rel="stylesheet" type="text/css" href="stylesheets/selectioner/base.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="scripts/selectioner.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>Selectioner by hrudham</title>
</head>
<body>
<header>
<div class="inner">
<h1>Selectioner</h1>
<h2>Light-weight, general purpose jQuery-based HTML drop-down controls</h2>
<a href="https://github.com/hrudham" class="button"><small>Follow me on</small>GitHub</a>
</div>
</header>
<div id="content-wrapper">
<div class="inner clearfix">
<section id="main-content">
<h2>Introduction</h2>
<p>
Selectioner is a drop-down control framework. It can do anything
from replacing standard HTML <code style="white-space: nowrap;"><select /></code> elements,
to multi-select controls, auto-complete controls, date-selects and more!
</p>
<p>
The <a href="https://github.com/hrudham/Selectioner">source code</a> is
available on github, and it's covered under the friendly MIT license.
</p>
<p>
View the project <a href="https://github.com/hrudham/Selectioner/blob/master/readme.md">readme</a>
for more information on exactly what is possible and how to do it.
Otherwise, if you're more of a hand-on type of person, play around with
the examples below, and the view the source to see how everything is hooked up.
</p>
<h2>Examples</h2>
<form>
<div class="box">
<h3>Single-select</h3>
<p>
<label>Basic with no ID attribute: </label>
<select class="basic" data-placeholder="Pick an option">
<option></option><!-- empty option -->
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
<option>Option 4</option>
<option>Option 5</option>
</select>
<script>
$(function(){
$('.basic').singleSelect();
});
</script>
</p>
<p>
<label for="BasicSingle">Basic with ID attribute: </label>
<select id="BasicSingle">
<option></option><!-- empty option -->
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
<option>Option 4</option>
<option>Option 5</option>
</select>
<script>
$(function(){
$('#BasicSingle').singleSelect();
});
</script>
</p>
<p>
<label for="OptGroupSingle">OptGroup: </label>
<select id="OptGroupSingle">
<option></option>
<optgroup label="Group 1">
<option selected="selected">Option 1.1</option>
<option>Option 1.2</option>
<option>Option 1.3</option>
<option>Option 1.4</option>
<option>Option 1.5</option>
</optgroup>
<optgroup label="Group 2">
<option selected="selected">Option 2.1</option>
<option>Option 2.2</option>
<option>Option 2.3</option>
<option>Option 2.4</option>
<option>Option 2.5</option>
</optgroup>
</select>
<script>
$(function(){
$('#OptGroupSingle').singleSelect();
});
</script>
</p>
</div>
<div class="box">
<h3>Multi-select</h3>
<p>
<label for="BasicMultiple">Basic Multiple: </label>
<select id="BasicMultiple" multiple="multiple">
<option disabled="disabled">Disabled</option>
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
<option>Option 4</option>
<option>Option 5</option>
</select>
<script>
$(function(){
$('#BasicMultiple').multiSelect();
});
</script>
</p>
<p>
<label for="OptGroupMultiple">OptGroup Multiple: </label>
<select id="OptGroupMultiple" multiple="multiple">
<optgroup label="Group 1">
<option selected="selected">Option 1.1</option>
<option selected="selected">Option 1.2</option>
<option>Option 1.3</option>
<option>Option 1.4</option>
<option>Option 1.5</option>
<option disabled="disabled">Disabled</option>
</optgroup>
<optgroup label="Group 2">
<option selected="selected">Option 2.1</option>
<option>Option 2.2</option>
<option>Option 2.3</option>
<option>Option 2.4</option>
<option>Option 2.5</option>
</optgroup>
</select>
<script>
$(function(){
$('#OptGroupMultiple').multiSelect();
});
</script>
</p>
</div>
<div class="box">
<h3>Combo-select</h3>
<p>
<label for="BasicComboText">Basic: </label>
<select id="BasicComboSelect" data-placeholder="Pick an option">
<option></option>
<option disabled="disabled">Disabled Option</option>
<option>Cape Town</option>
<option>Durban</option>
<option>Johannesburg</option>
<option>Bloemfontein</option>
<option>Pietermaritzburg</option>
</select>
<input type="text" id="BasicComboText" value="Custom entry" />
<script>
$(function(){
$('#BasicComboSelect').comboSelect();
});
</script>
</p>
<p>
<label for="OptGroupComboText">OptGroup: </label>
<select id="OptGroupComboSelect">
<option value=''></option>
<optgroup label="Group 1">
<option>Option 1.1</option>
<option>Option 1.2</option>
<option>Option 1.3</option>
<option>Option 1.4</option>
<option>Option 1.5</option>
</optgroup>
<optgroup label="Group 2">
<option>Option 2.1</option>
<option>Option 2.2</option>
<option>Option 2.3</option>
<option>Option 2.4</option>
<option>Option 2.5</option>
</optgroup>
</select>
<input type="text" id="OptGroupComboText" />
<script>
$(function(){
$('#OptGroupComboSelect').comboSelect();
});
</script>
</p>
</div>
<div class="box">
<h3>Auto-complete</h3>
<p>
<label for="BasicAutoCompleteText">Basic: </label>
<select id="BasicAutoCompleteSelect">
<option></option>
<option>Aberlour</option>
<option>Amrut</option>
<option>An Cnoc</option>
<option>Ardbeg</option>
<option>Ardmore</option>
<option>Auchentoshan</option>
<option>Balblair</option>
<option>Balmenach</option>
<option>Ben Nevis</option>
<option>BenRiach</option>
<option>Benrinnes</option>
<option>Benromach</option>
<option>Bladnoch</option>
<option>Blair Athol</option>
<option>Bowmore</option>
<option>Braeval</option>
<option>Brora</option>
<option>Bruichladdich</option>
<option>Buffalo Trace</option>
<option>Bunnahabhain</option>
<option>Old Bushmills</option>
<option>Caol Ila</option>
<option>Caperdonich</option>
<option>Cardhu</option>
<option>Clynelish</option>
<option>Cooley</option>
<option>Cragganmore</option>
<option>Craigellachie</option>
<option>Dallas Dhu</option>
<option>Dalmore</option>
<option>Dalwhinnie</option>
<option>Deanston</option>
<option>Drayman's</option>
<option>Dufftown</option>
<option>Edradour</option>
<option>Fettercairn</option>
<option>Glen Albyn</option>
<option>Glencadam</option>
<option>Glendronach</option>
<option>Glen Elgin</option>
<option>Glenfarclas</option>
<option>Glenfiddich</option>
<option>Glen Garioch</option>
<option>Glenglassaugh</option>
<option>Glengoyne</option>
<option>Glen Grant</option>
<option>Glen Keith</option>
<option>Glenkinchie</option>
<option>Glenmorangie</option>
<option>Glen Ord</option>
<option>Glenrothes</option>
<option>Highland Park</option>
<option>Isle of Arran</option>
<option>Isle of Jura</option>
<option>Jack Daniels</option>
<option>James Sedgwick</option>
<option>Jim Beam</option>
<option>Karuizawa</option>
<option>Kilchoman</option>
<option>Knockdhu</option>
<option>Lagavulin</option>
<option>Laphroaig</option>
<option>Longmorn</option>
<option>Macallan</option>
<option>Maker's Mark</option>
<option>Midleton</option>
<option>Millburn</option>
<option>Miyagikyo</option>
<option>Mortlach</option>
<option>Oban</option>
<option>Penderyn</option>
<option>Port Ellen</option>
<option>Old Pultney</option>
<option>Royal Brackla</option>
<option>Springbank</option>
<option>Strathisla</option>
<option>Strathmill</option>
<option>Talisker</option>
<option>Tamdhu</option>
<option>The Balvenie</option>
<option>The Glenlivet</option>
<option>Tomatin</option>
<option>Wild Turkey</option>
<option>Woodford Reserve</option>
<option>Yamazaki</option>
<option>Yoichi</option>
</select>
<input type="text" id="BasicAutoCompleteText" placeholder="Choose an option" />
<script>
$(function(){
$('#BasicAutoCompleteSelect').autoComplete();
});
</script>
</p>
</div>
<div class="box">
<h3>Date</h3>
<p>
<label for="DateInput">Date: </label>
<!-- set a value for this control the following attribute: value="2013-04-15" -->
<input type="date" id="DateInput" value="2013-04-15" placeholder="Choose a date" />
<script>
$(function(){
$('#DateInput').dateSelect();
});
</script>
</p>
</div>
<div class="box">
<h3>Custom</h3>
<p>
<label for="CustomSelect">Custom: </label>
<select id="CustomSelect">
<option></option>
<option>Red</option>
<option>Green</option>
<option>Blue</option>
</select>
<span id="CustomButtons" style="border-top: 1px dotted #CCC; text-align: right; display: block;">
<a href="javascript:;" class="button">Close</a>
</span>
<script>
$(function(){
var staticDialogCss = 'font-style: italic; color: #999; text-align: center; margin-top: 4px; border-bottom: 1px dotted #CCC;'
var staticDialogHtml = '<div style="' + staticDialogCss + '">Base Colour</div>';
// Build the custom selectioner.
var customSelectioner = new Selectioner
(
// This is the obect that the Selectioner will target as it's
// underlying element. This is usually an input, select or textarea.
$('#CustomSelect'),
// This is what displays what is currently selected to the user.
// You can make your own by inheriting from Selectioner.Core.Display.
new Selectioner.Display.ListBox(),
// This is either a single Dialog, or an array of them. Dialogs are what
// appear in the popup. You can either create static dialogs that are
// unaware of the rest of the Selectioner, or add objects that inherit from
// Selectioner.Core.Dialog that will update whenever the selected value
// changes. In this example, only the SingleSelect() dialog does this.
[
staticDialogHtml,
new Selectioner.Dialog.SingleSelect(),
'#CustomButtons'
]
);
// Hook up an event handler to the button's click event.
// To clarify, events that are set up before the selectioner
// is created will continue to work in cases like this as well.
$('#CustomButtons .button')
.on
(
'click',
function()
{
customSelectioner.display.popup.hide();
}
);
});
</script>
</p>
</div>
</form>
</section>
<aside id="sidebar">
<p></p>
</aside>
</div>
</div>
</body>
</html>