uniformjs-rails 1.5.0.2 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +7 -0
  2. data/lib/uniformjs-rails/version.rb +1 -1
  3. data/vendor/assets/images/agent/bg-input-agent.png +0 -0
  4. data/vendor/assets/images/agent/bg-input-focus-agent.png +0 -0
  5. data/vendor/assets/images/agent/sprite-agent.png +0 -0
  6. data/vendor/assets/images/aristo/bg-input-aristo.png +0 -0
  7. data/vendor/assets/images/aristo/bg-input-focus-aristo.png +0 -0
  8. data/vendor/assets/images/aristo/sprite-aristo.png +0 -0
  9. data/vendor/assets/images/{bg-input-focus.png → default/bg-input-focus.png} +0 -0
  10. data/vendor/assets/images/{bg-input.png → default/bg-input.png} +0 -0
  11. data/vendor/assets/images/default/sprite.png +0 -0
  12. data/vendor/assets/images/jeans/bg-input-focus-jeans.png +0 -0
  13. data/vendor/assets/images/jeans/bg-input-focus-retina-jeans.png +0 -0
  14. data/vendor/assets/images/jeans/bg-input-jeans.png +0 -0
  15. data/vendor/assets/images/jeans/bg-input-retina-jeans.png +0 -0
  16. data/vendor/assets/images/jeans/sprite-jeans.png +0 -0
  17. data/vendor/assets/images/jeans/sprite-retina-jeans.png +0 -0
  18. data/vendor/assets/javascripts/jquery.uniform.js +992 -634
  19. data/vendor/assets/stylesheets/uniformjs/_base.scss +558 -0
  20. data/vendor/assets/stylesheets/uniformjs/agent.scss +138 -0
  21. data/vendor/assets/stylesheets/uniformjs/aristo.scss +142 -0
  22. data/vendor/assets/stylesheets/uniformjs/default.scss +142 -0
  23. data/vendor/assets/stylesheets/uniformjs/jeans.scss +156 -0
  24. metadata +34 -22
  25. data/vendor/assets/images/sprite.png +0 -0
  26. data/vendor/assets/stylesheets/uniform.default.css.scss +0 -610
@@ -0,0 +1,558 @@
1
+ $jquery-uniform-img-path: "default" !default;
2
+ $sprite: image-path("#{$jquery-uniform-img-path}/sprite.png") !default;
3
+ $sprite-retina: image-path("#{$jquery-uniform-img-path}/sprite-retina.png") !default;
4
+ $sprite-size: 493px !default;
5
+ $button-height: 30px !default;
6
+ $button-margin-left: 13px !default;
7
+ $button-padding: 0 !default;
8
+ $button-span-height: $button-height !default;
9
+ $checkbox-height: 19px !default;
10
+ $checkbox-width: 19px !default;
11
+ $input-padding: 3px !default;
12
+ $input-background: image-path("#{$jquery-uniform-img-path}/bg-input.png") !default;
13
+ $input-background-retina: image-path("#{$jquery-uniform-img-path}/bg-input-retina.png") !default;
14
+ $input-background-focus: image-path("#{$jquery-uniform-img-path}/bg-input-focus.png") !default;
15
+ $input-background-focus-retina: image-path("#{$jquery-uniform-img-path}/bg-input-focus-retina.png") !default;
16
+ $input-background-size: 1px !default;
17
+ $radio-height: 18px !default;
18
+ $radio-width: 18px !default;
19
+ $select-fixed-width: 190px !default;
20
+ $select-height: 26px !default;
21
+ $select-margin-left: 10px !default;
22
+ $select-margin-right: 25px !default;
23
+ $select-select-height: 22px !default;
24
+ $select-select-top: 2px !default;
25
+ $upload-action-width: 85px !default;
26
+ $upload-filename-margin-top: 2px !default;
27
+ $upload-filename-margin-bottom: 2px !default;
28
+ $upload-filename-margin-left: 2px !default;
29
+ $upload-filename-width: 82px !default;
30
+ $upload-filename-padding: 0 10px !default;
31
+ $upload-height: 28px !default;
32
+ $upload-width: 190px !default;
33
+
34
+ $checkbox-voffset: (-10 * $select-height);
35
+ $radio-voffset: ($checkbox-voffset - $checkbox-height);
36
+ $upload-voffset: ($radio-voffset - $radio-height);
37
+ $button-voffset: ($upload-voffset - (8 * $upload-height));
38
+
39
+ $class-action: ".action" !default;
40
+ $class-active: ".active" !default;
41
+ $class-button: ".button" !default;
42
+ $class-checkbox: ".checker" !default;
43
+ $class-checked: ".checked" !default;
44
+ $class-disabled: ".disabled" !default;
45
+ $class-input: ".uniform-input" !default;
46
+ $class-filename: ".filename" !default;
47
+ $class-focus: ".focus" !default;
48
+ $class-hover: ".hover" !default;
49
+ $class-multiselect: ".uniform-multiselect" !default;
50
+ $class-radio: ".radio" !default;
51
+ $class-select: ".selector" !default;
52
+ $class-upload: ".uploader" !default;
53
+ $class-textarea: ".uniform" !default;
54
+ $class-wrapper: "" !default;
55
+
56
+ $class-wrapper-element: "";
57
+ @if $class-wrapper != "" {
58
+ $class-wrapper-element: "span"
59
+ }
60
+
61
+ @mixin opacity($opacity) {
62
+ opacity: $opacity;
63
+ filter: unquote("alpha(opacity=#{round($opacity * 100)})");
64
+ }
65
+
66
+ @mixin hideYetClickable() {
67
+ @include opacity(0);
68
+ border: none;
69
+ background: none;
70
+ }
71
+
72
+ @mixin inline-block() {
73
+ display: -moz-inline-box;
74
+ display: inline-block;
75
+ *display: inline;
76
+ zoom: 1;
77
+ }
78
+
79
+ @mixin ellipsis() {
80
+ text-overflow: ellipsis;
81
+ display: block;
82
+ overflow: hidden;
83
+ white-space: nowrap;
84
+ }
85
+
86
+ @mixin border-radius($radius) {
87
+ border-radius: $radius;
88
+ }
89
+
90
+ @mixin box-shadow($def) {
91
+ box-shadow: $def;
92
+ }
93
+
94
+ @mixin whenActive {
95
+ &#{$class-active} {
96
+ @content
97
+ }
98
+ }
99
+
100
+ @mixin whenHover {
101
+ &#{$class-hover}, &#{$class-focus} {
102
+ @content
103
+ }
104
+ }
105
+
106
+ @mixin whenDisabled {
107
+ &#{$class-disabled}, &#{$class-disabled}#{$class-active} {
108
+ @content
109
+ }
110
+ }
111
+
112
+ @mixin whenChecked {
113
+ &#{$class-checked} {
114
+ @content
115
+ }
116
+ }
117
+
118
+ @mixin use-backgrounds($sprite, $sprite-size, $input, $input-focus, $input-size) {
119
+ div#{$class-wrapper} {
120
+ &#{$class-select},
121
+ &#{$class-select} span,
122
+ &#{$class-checkbox} span,
123
+ &#{$class-radio} span,
124
+ &#{$class-upload},
125
+ &#{$class-upload} span#{$class-action},
126
+ &#{$class-button},
127
+ &#{$class-button} span {
128
+ background-image: $sprite;
129
+
130
+ @if $sprite-size > 0 {
131
+ background-size: $sprite-size;
132
+ }
133
+ }
134
+ }
135
+
136
+ #{$class-wrapper-element}#{$class-wrapper} input#{$class-input},
137
+ #{$class-wrapper-element}#{$class-wrapper} select#{$class-multiselect},
138
+ #{$class-wrapper-element}#{$class-wrapper} textarea#{$class-textarea} {
139
+ background-image: $input;
140
+
141
+ @if $sprite-size > 0 {
142
+ background-size: $input-size;
143
+ }
144
+
145
+ @include whenActive {
146
+ background-image: $input-focus;
147
+ }
148
+ }
149
+ }
150
+
151
+ @mixin retina() {
152
+ @media only screen {
153
+ @media (min-resolution: 124dpi), (-webkit-min-device-pixel-ratio: 1.3), (min--moz-device-pixel-ratio: 1.3), (-o-min-device-pixel-ratio: 4/3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx) {
154
+ @include use-backgrounds(url($sprite-retina), $sprite-size, url($input-background-retina), url($input-background-focus-retina), $input-background-size);
155
+ }
156
+ }
157
+ }
158
+
159
+ /* General settings */
160
+
161
+ div#{$class-wrapper} {
162
+ &#{$class-select},
163
+ &#{$class-select} span,
164
+ &#{$class-checkbox} span,
165
+ &#{$class-radio} span,
166
+ &#{$class-upload},
167
+ &#{$class-upload} span#{$class-action},
168
+ &#{$class-button},
169
+ &#{$class-button} span {
170
+ background: url($sprite) no-repeat;
171
+ -webkit-font-smoothing: antialiased;
172
+ }
173
+
174
+ &#{$class-select},
175
+ &#{$class-checkbox},
176
+ &#{$class-button},
177
+ &#{$class-radio},
178
+ &#{$class-upload} {
179
+ @include inline-block();
180
+ vertical-align: middle;
181
+
182
+ /* Keeping this as :focus to remove browser styles */
183
+ &:focus {
184
+ outline: 0;
185
+ }
186
+ }
187
+
188
+ &#{$class-select},
189
+ &#{$class-radio},
190
+ &#{$class-checkbox},
191
+ &#{$class-upload},
192
+ &#{$class-button} {
193
+ &, & * {
194
+ margin: 0;
195
+ padding: 0;
196
+ }
197
+ }
198
+ }
199
+
200
+ .highContrastDetect {
201
+ background: url($input-background) repeat-x 0 0;
202
+ width: 0;
203
+ height: 0;
204
+ }
205
+
206
+ /* Input & Textarea */
207
+
208
+ #{$class-wrapper-element}#{$class-wrapper} input#{$class-input},
209
+ #{$class-wrapper-element}#{$class-wrapper} select#{$class-multiselect},
210
+ #{$class-wrapper-element}#{$class-wrapper} textarea#{$class-textarea} {
211
+ padding: $input-padding;
212
+ background: url($input-background) repeat-x 0 0;
213
+ outline: 0;
214
+
215
+ @include whenActive {
216
+ background: url($input-background-focus) repeat-x 0 0;
217
+ }
218
+ }
219
+
220
+ /* Remove default webkit and possible mozilla .search styles.
221
+ * Keeping this as :active to remove browser styles */
222
+ div#{$class-wrapper}#{$class-checkbox} input,
223
+ input[type="search"],
224
+ input[type="search"]:active {
225
+ appearance: none;
226
+ }
227
+
228
+ /* Select */
229
+
230
+ div#{$class-wrapper}#{$class-select} {
231
+ background-position: 0 (-5 * $select-height);
232
+ line-height: $select-height;
233
+ height: $select-height;
234
+ padding: 0 0 0 $select-margin-left;
235
+ position: relative;
236
+ overflow: hidden;
237
+
238
+ span {
239
+ @include ellipsis();
240
+ background-position: right 0;
241
+ height: $select-height;
242
+ line-height: $select-height;
243
+ padding-right: $select-margin-right;
244
+ cursor: pointer;
245
+ width: 100%;
246
+ }
247
+
248
+ &.fixedWidth {
249
+ width: $select-fixed-width;
250
+
251
+ span {
252
+ width: ($select-fixed-width - $select-margin-left - $select-margin-right);
253
+ }
254
+ }
255
+
256
+ select {
257
+ @include hideYetClickable();
258
+ position: absolute;
259
+ height: $select-select-height;
260
+ top: $select-select-top;
261
+ left: 0;
262
+ width: 100%;
263
+ }
264
+
265
+ @include whenActive {
266
+ background-position: 0 (-6 * $select-height);
267
+
268
+ span {
269
+ background-position: right (-1 * $select-height);
270
+ }
271
+ }
272
+
273
+ @include whenHover {
274
+ background-position: 0 (-7 * $select-height);
275
+
276
+ span {
277
+ background-position: right (-2 * $select-height);
278
+ }
279
+
280
+ @include whenActive {
281
+ background-position: 0 (-8 * $select-height);
282
+
283
+ span {
284
+ background-position: right (-3 * $select-height);
285
+ }
286
+ }
287
+ }
288
+
289
+ @include whenDisabled {
290
+ background-position: 0 (-9 * $select-height);
291
+
292
+ span {
293
+ background-position: right (-4 * $select-height);
294
+ }
295
+ }
296
+ }
297
+
298
+ /* Checkbox */
299
+
300
+ div#{$class-wrapper}#{$class-checkbox} {
301
+ position: relative;
302
+
303
+ &, span, input {
304
+ width: $checkbox-width;
305
+ height: $checkbox-height;
306
+ }
307
+
308
+ span {
309
+ @include inline-block();
310
+ text-align: center;
311
+ background-position: 0 $checkbox-voffset;
312
+
313
+ @include whenChecked {
314
+ background-position: (-4 * $checkbox-width) $checkbox-voffset;
315
+ }
316
+ }
317
+
318
+ input {
319
+ @include hideYetClickable();
320
+ @include inline-block();
321
+ }
322
+
323
+ @include whenActive {
324
+ span {
325
+ background-position: (-1 * $checkbox-width) $checkbox-voffset;
326
+
327
+ @include whenChecked {
328
+ background-position: (-5 * $checkbox-width) $checkbox-voffset;
329
+ }
330
+ }
331
+ }
332
+
333
+ @include whenHover {
334
+ span {
335
+ background-position: (-2 * $checkbox-width) $checkbox-voffset;
336
+
337
+ @include whenChecked {
338
+ background-position: (-6 * $checkbox-width) $checkbox-voffset;
339
+ }
340
+ }
341
+
342
+ @include whenActive {
343
+ span {
344
+ background-position: (-3 * $checkbox-width) $checkbox-voffset;
345
+
346
+ @include whenChecked {
347
+ background-position: (-7 * $checkbox-width) $checkbox-voffset;
348
+ }
349
+ }
350
+ }
351
+ }
352
+
353
+ @include whenDisabled {
354
+ span {
355
+ background-position: (-8 * $checkbox-width) $checkbox-voffset;
356
+
357
+ @include whenChecked {
358
+ background-position: (-9 * $checkbox-width) $checkbox-voffset;
359
+ }
360
+ }
361
+ }
362
+ }
363
+
364
+ /* Radio */
365
+
366
+ div#{$class-wrapper}#{$class-radio} {
367
+ position: relative;
368
+
369
+ &, span, input {
370
+ width: $radio-width;
371
+ height: $radio-height;
372
+ }
373
+
374
+ span {
375
+ @include inline-block();
376
+ text-align: center;
377
+ background-position: 0 $radio-voffset;
378
+
379
+ @include whenChecked {
380
+ background-position: (-4 * $radio-width) $radio-voffset;
381
+ }
382
+ }
383
+
384
+ input {
385
+ @include hideYetClickable();
386
+ @include inline-block();
387
+ text-align: center;
388
+ }
389
+
390
+ @include whenActive {
391
+ span {
392
+ background-position: (-1 * $radio-width) $radio-voffset;
393
+
394
+ @include whenChecked {
395
+ background-position: (-5 * $radio-width) $radio-voffset;
396
+ }
397
+ }
398
+ }
399
+
400
+ @include whenHover {
401
+ span {
402
+ background-position: (-2 * $radio-width) $radio-voffset;
403
+
404
+ @include whenChecked {
405
+ background-position: (-6 * $radio-width) $radio-voffset;
406
+ }
407
+ }
408
+
409
+ @include whenActive {
410
+ span {
411
+ background-position: (-3 * $radio-width) $radio-voffset;
412
+
413
+ @include whenChecked {
414
+ background-position: (-7 * $radio-width) $radio-voffset;
415
+ }
416
+ }
417
+ }
418
+ }
419
+
420
+ @include whenDisabled {
421
+ span {
422
+ background-position: (-8 * $radio-width) $radio-voffset;
423
+
424
+ @include whenChecked {
425
+ background-position: (-9 * $radio-width) $radio-voffset;
426
+ }
427
+ }
428
+ }
429
+ }
430
+
431
+ /* Uploader */
432
+
433
+ div#{$class-wrapper}#{$class-upload} {
434
+ background-position: 0 $upload-voffset;
435
+ height: $upload-height;
436
+ width: $upload-width;
437
+ cursor: pointer;
438
+ position: relative;
439
+ overflow: hidden;
440
+
441
+ span#{$class-action} {
442
+ background-position: right ($upload-voffset + (-4 * $upload-height));
443
+ height: $upload-height;
444
+ line-height: $upload-height;
445
+ width: $upload-action-width;
446
+ text-align: center;
447
+ float: left;
448
+ display: inline;
449
+ overflow: hidden;
450
+ cursor: pointer;
451
+ }
452
+
453
+ span#{$class-filename} {
454
+ @include ellipsis();
455
+ float: left;
456
+ cursor: default;
457
+ height: ($upload-height - $upload-filename-margin-top - $upload-filename-margin-bottom);
458
+ margin: $upload-filename-margin-top 0 $upload-filename-margin-bottom $upload-filename-margin-left;
459
+ line-height: ($upload-height - $upload-filename-margin-top - $upload-filename-margin-bottom);
460
+ width: $upload-filename-width;
461
+ padding: $upload-filename-padding;
462
+ }
463
+
464
+ input {
465
+ @include hideYetClickable();
466
+ position: absolute;
467
+ top: 0;
468
+ right: 0;
469
+ float: right;
470
+ cursor: default;
471
+ width: 100%;
472
+ height: 100%;
473
+ }
474
+
475
+ @include whenActive {
476
+ span#{$class-action} {
477
+ background-position: right ($upload-voffset + (-6 * $upload-height));
478
+ }
479
+ }
480
+
481
+ @include whenHover {
482
+ background-position: 0 ($upload-voffset + (-2 * $upload-height));
483
+
484
+ span#{$class-action} {
485
+ background-position: right ($upload-voffset + (-5 * $upload-height));
486
+ }
487
+
488
+ @include whenActive {
489
+ span#{$class-action} {
490
+ background-position: right ($upload-voffset + (-7 * $upload-height));
491
+ }
492
+ }
493
+ }
494
+
495
+ @include whenDisabled {
496
+ background-position: 0 ($upload-voffset + (-1 * $upload-height));
497
+
498
+ span#{$class-action} {
499
+ background-position: right ($upload-voffset + (-3 * $upload-height));
500
+ }
501
+ }
502
+ }
503
+
504
+ /* Buttons */
505
+
506
+ div#{$class-wrapper}#{$class-button} {
507
+ background-position: 0 ($button-voffset + (-4 * $button-height));
508
+ height: $button-height;
509
+ cursor: pointer;
510
+ position: relative;
511
+
512
+ /* Keep buttons barely visible so they can get focus */
513
+ a, button, input {
514
+ @include opacity(0.01);
515
+ display: block;
516
+ top: 0;
517
+ left: 0;
518
+ right: 0;
519
+ bottom: 0;
520
+ position: absolute;
521
+ }
522
+
523
+ span {
524
+ @include inline-block();
525
+ line-height: $button-span-height;
526
+ text-align: center;
527
+ background-position: right $button-voffset;
528
+ height: $button-span-height;
529
+ margin-left: $button-margin-left;
530
+ padding: $button-padding;
531
+ }
532
+
533
+ @include whenActive {
534
+ background-position: 0 ($button-voffset + (-5 * $button-height));
535
+
536
+ span {
537
+ background-position: right ($button-voffset + (-1 * $button-height));
538
+ cursor: default;
539
+ }
540
+ }
541
+
542
+ @include whenHover {
543
+ background-position: 0 ($button-voffset + (-6 * $button-height));
544
+
545
+ span {
546
+ background-position: right ($button-voffset + (-2 * $button-height));
547
+ }
548
+ }
549
+
550
+ @include whenDisabled {
551
+ background-position: 0 ($button-voffset + (-7 * $button-height));
552
+
553
+ span {
554
+ background-position: right ($button-voffset + (-3 * $button-height));
555
+ cursor: default;
556
+ }
557
+ }
558
+ }