forked from websemantics/Image-Select
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
383 lines (323 loc) · 14.9 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Image Select by Web Semantics, Inc.</title>
<meta name="description" content="Dropdown for images">
<link rel="apple-touch-icon" sizes="57x57" href="img/icon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="img/icon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="img/icon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="img/icon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="img/icon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="img/icon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="img/icon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="img/icon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="img/icon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="img/icon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="img/icon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="img/icon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="img/icon/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" href="src/semantic/dist/semantic.min.css">
<link rel="stylesheet" href="src/codemirror/lib/codemirror.css">
<link rel="stylesheet" href="src/codemirror/theme/mdn-like.css">
<link rel="stylesheet" href="src/chosen/chosen.css">
<link rel="stylesheet" href="src/ImageSelect.css">
<link rel="stylesheet" href="src/Flat.css">
<link href='http://fonts.googleapis.com/css?family=Roboto:700,400,300,200,100' rel='stylesheet' type='text/css'>
<style>
body, h1, h2, h3, h4, h5, div, p {
font-family: 'Roboto', sans-serif;
color:#2d474e!important;
font-weight:300;
}
body {
background: #ffffff;
font-size: 1.3rem;
}
.hero {
overflow: hidden;
padding-bottom: 4rem;
padding-top: 4rem;
margin-bottom: 2rem;
background: #fdf2e4;
}
.hero .logo img {
width: 220px;
float: right;
padding-right: 30px;
}
.ui.huge.header.title {
font-weight:300;
font-size: 38px;
}
.ui.header.title-m {
font-weight:300!important;
font-size: 24px;
padding: 1.5rem 0rem 1rem 0rem;
}
.github-buttons {
padding-bottom: 20px;
}
/* Text */
.text, p {
font-weight:300;
font-size: 21px;
}
p {
font-size: 18px;
}
/* code snippets styles */
code {
background: #f5f7fa;
font-weight:300;
padding: 1px 2px 2px 6px;
}
code .CodeMirror {
background: none;
height:100%;
font-weight:300;
}
code.custom, code.xml, code.htmlmixed, code.javascript, code.shell{
display: flex;
border-radius: 5px;
border: 5px solid #f5f7fa;
margin:2rem 0 2rem 0;
}
code.custom {
color: #777;
white-space: pre ;
display: block;
}
/* Selection */
/* text selection */
::selection {
background-color: #fdf2e4 !important;
}
::-moz-selection {
background-color: #fdf2e4 !important;
}
.CodeMirror-selected, .styled-background,
.cm-s-mdn-like .CodeMirror-line::selection,
.cm-s-mdn-like .CodeMirror-line > span::selection,
.cm-s-mdn-like .CodeMirror-line > span > span::selection {
background-color: #fdf2e4 !important;
}
/* styles for github action buttons */
.ui.brand.button, .ui.brand.buttons .button {
background-color: #ff703d;
color: #fff!important;
}
.ui.brand.label {
color: #ff703d!important;
border-color: #ff703d!important;
background-color: #ffffff;
}
.ui.brand.button:focus, .ui.brand.buttons .button:focus,
.ui.brand.button:hover, .ui.brand.buttons .button:hover {
background-color: #ffa280;
}
.ui.brand.labels .label:focus, .ui.brand.label:focus,
.ui.brand.labels .label:hover, .ui.brand.label:hover {
color: #ffa280!important;
border-color: #ffa280!important;
}
.ui.labeled .ui.button .star.icon {
color: #F5CC7A!important;
}
/* footer styles */
.ui.footer {
margin-top: 7rem;
padding: 2rem 0 3rem 0;
background: #f5f7fa;
}
.footer img {
vertical-align: middle;
width:66px;
height:66px;
}
.footer h4 a {
font-size: 1.5rem;
color:#2d474e;
}
.footer h4 a:hover {
color:#1c2c31;
}
.footer .tentacle {
vertical-align: baseline;
}
/* code */
code.highlighter-rouge {
background: #f5f7fa;
color: #ff703d!important;
font-weight: normal;
padding: 2px;
}
</style>
</head>
<body>
<section class="hero">
<div class="ui container">
<div class="ui column grid">
<div class="four wide column logo">
<img draggable="false" src="img/logo.svg" alt="Image Select">
</div>
<div class="twelve wide column">
<h1 class="ui huge header title">Image Select</h1>
<div class="github-buttons">
<a class="ui labeled tiny button github-websemantics-Image-Select-stars">
<div class="ui brand tiny button">
<i class="star icon"></i> Stars
</div>
<div class="ui basic brand left pointing label">
<i class="spinner loading icon"></i>
</div>
</a>
<a class="ui tiny brand button github-websemantics-Image-Select-github">
<i class="github icon"></i> Github
</a>
<a class="ui tiny brand button github-websemantics-Image-Select-download">
<i class="download icon"></i> Download
</a>
</div>
<p class="text">Image Select provides image support for Single and Multi select HTML tags to be used with JQuery and Chosen.<br/><br/></p>
</div>
</div>
</div>
</section>
<div class="ui container">
<h2 class="ui header title-m">Background Story</h2>
<p>We designed this plugin extension as a <i>humanized ui</i> element for social networking sites that need to faciliate relations between people. Research shows that people are extremely sensitvie to photos of others, so we needed to revamp the traditional ui elements to make them more intuitive and human.</p>
<p>You can use these plugin extensions for modelling multiple <code class="highlighter-rouge">one-to-many</code> or single <code class="highlighter-rouge">one-to-one</code> relations between people.</p>
<h2 class="ui header title-m">Multiple Select</h2>
<p>This example shows the <code class="highlighter-rouge">multiple select</code> scenario. </p>
<select multiple="multiple" class="my-select">
<option data-img-src="img/adnan.png">Adnan Sagar</option>
<option selected="selected" data-img-src="img/rena.png">Rena Cugelman</option>
<option selected="selected" data-img-src="img/tavis.png">Tavis Lochhead</option>
<option data-img-src="img/brian.png">Brain Cugelman</option>
</select>
<code class="xml cm-s-mdn-like"><select multiple="multiple">
<option data-img-src="img/adnan.png">Adnan Sagar</option>
<option data-img-src="img/rena.png" selected="selected">Rena Cugelman</option>
<option data-img-src="img/tavis.png" selected="selected">Tavis Lochhead</option>
<option data-img-src="img/brian.png">Brain Cugelman</option>
</select></code>
<p>As shown above, use <code class="highlighter-rouge">data-img-src</code> attribute to attache images. Finally, enable <i>Image Select</i> by invoking the <code class="highlighter-rouge">chosen</code> method on the select element.</p>
<div class="javascript cm-s-mdn-like">
$(".my-select").chosen({
width:"100%",
});
</div>
<div class="ui warning message">
<div class="header">
Info
</div>
For more details check <a href="http://harvesthq.github.io/chosen/">Chosen documentation</a>.
</div>
<h2 class="ui header title-m">Single Select</h2>
<p>For single select, remove the <code class="highlighter-rouge">multiple</code> attribute. </p>
<select class="my-select">
<option>Please select, ...</option>
<option data-img-src="img/adnan.png">Adnan Sagar</option>
<option data-img-src="img/rena.png" selected="selected">Rena Cugelman</option>
<option data-img-src="img/tavis.png">Tavis Lochhead</option>
<option data-img-src="img/brian.png">Brain Cugelman</option>
</select>
<code class="xml cm-s-mdn-like"><select class="my-select">
<option data-img-src="img/adnan.png">Adnan Sagar</option>
<option selected="selected" data-img-src="img/rena.png">Rena Cugelman</option>
<option data-img-src="img/tavis.png">Tavis Lochhead</option>
<option data-img-src="img/brian.png">Brain Cugelman</option>
</select></code>
<p>Use <code class="highlighter-rouge">data-img-src</code> attribute to attache images.</p>
<h2 class="ui header title-m">Custom Style / Markup</h2>
<p><i>Image Select</i> allows the customization of THML markup and styles it uses to insert images. For example, to style the image directly, add your own css classes, or define your own HTML markup which would include the image and text placement.</p>
<p>The following example adds a black border to the images and places the text before the image (similar to <strong>rtl</strong> mode).</p>
<select multiple="multiple" class="my-select-border">
<option data-img-src="img/adnan.png">Adnan Sagar</option>
<option data-img-src="img/rena.png">Rena Cugelman</option>
<option selected="selected" data-img-src="img/tavis.png">Tavis Lochhead</option>
<option selected="selected" data-img-src="img/brian.png">Brain Cugelman</option>
</select>
<br/>
<br/>
<p>It simply adds the required css styles directly to the image template</p>
<code class="javascript cm-s-mdn-like">$(".my-select").chosen({
width:"100%",
html_template: '{text} <img style="border:3px solid #ff703d;padding:0px;margin-right:4px" class="{class_name}" src="{url}" />'
});</code>
<p>Use the <code class="highlighter-rouge">html_template</code> to write your own markup. Make sure you always include the two place hodlers <code class="highlighter-rouge">{class_name}</code> and <code class="highlighter-rouge">{url}</code>, which are being used internally to insert the approperiate class name, and image url for each options element</p>
<h2 class="ui header title-m">Right to Left (RTL)</h2>
<p><i>RTL</i> support has been added to <i>Image Select</i> as per version <code class="highlighter-rouge">1.4</code>.</p>
<select multiple="multiple" class="my-select chosen-rtl">
<option data-img-src="img/adnan.png" selected="selected">عدنان صقر</option>
<option data-img-src="img/rena.png" selected="selected">رينا كوقلمان</option>
<option data-img-src="img/tavis.png">تافس لوكهيد</option>
<option data-img-src="img/brian.png">براين كوقلمان</option>
</select>
<p>Add class <code class="highlighter-rouge">chosen-rtl</code> to the select element to enable RTL.</p>
<code class="xml cm-s-mdn-like"><select multiple="multiple" class="my-select chosen-rtl">
<option data-img-src="img/adnan.png" selected="selected">عدنان صقر</option>
<option data-img-src="img/rena.png" selected="selected">رينا كوقلمان</option>
<option data-img-src="img/tavis.png">تافس لوكهيد</option>
<option data-img-src="img/brian.png">براين كوقلمان</option>
</select></code>
<h2 class="ui header title-m">Examples</h2>
<p>Check the provided <a href="example.html">example</a> for a detailed use case.</p>
<p>Having trouble with <i>Image Select</i>? create an <a href="https://github.com/websemantics/Image-Select/issues">issue</a> and we’ll help you sort it out.</p>
</div>
</div>
<div class="ui footer">
<div class="ui one column stackable center aligned page grid">
<div class="column twelve wide">
Built with <img data-preserve-html-node="true" src="img/logo-heart.svg" alt="love"> by <br/>
<h4><a href="http://websemantics.ca">Web Semantics, Inc.</a></h4>
</div>
</div>
</div>
<script src="src/jquery/dist/jquery.min.js" type="text/javascript"></script>
<script src="src/chosen/chosen.jquery.js" type="text/javascript"></script>
<script src="src/ImageSelect.jquery.js" type="text/javascript"></script>
<script src="src/codemirror/lib/codemirror.js" type="text/javascript"></script>
<script src="src/codemirror/mode/xml/xml.js" type="text/javascript"></script>
<script src="src/codemirror/mode/javascript/javascript.js" type="text/javascript"></script>
<script src="src/codemirror/mode/shell/shell.js" type="text/javascript"></script>
<script src="src/codemirror/mode/htmlmixed/htmlmixed.js" type="text/javascript"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/websemantics/bragit/0.1.2/bragit.js"></script>
</script>
<script type="text/javascript">
['code.shell', 'code.javascript', 'code.xml', 'code.htmlmixed'].forEach(function(cls){
if(mode = cls.indexOf('.') > -1 ? cls.split(".")[1] : null){ /* allow only valid class names */
$(cls).each(function() {
var $code = $(this).html().replace(/</g, "<").replace(/>/g, ">");
$(this).empty();
CodeMirror(this, { value: $code, mode: mode, readOnly: true, styleSelectedText: true});
});
}
});
$(".my-select").chosen({width:"100%"});
$(".my-select-border").chosen({
width:"100%",
html_template: '{text} <img style="border:3px solid #ff703d;padding:0px;margin-right:4px" class="{class_name}" src="{url}" />'
});
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-46772370-1']);
_gaq.push(['_setDomainName', 'websemantics.github.io']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>