semantic-ui-sass 2.1.8.0 → 2.2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -1
  3. data/app/assets/javascripts/semantic-ui.js +21465 -24
  4. data/app/assets/javascripts/semantic-ui/accordion.js +20 -6
  5. data/app/assets/javascripts/semantic-ui/api.js +41 -16
  6. data/app/assets/javascripts/semantic-ui/checkbox.js +31 -9
  7. data/app/assets/javascripts/semantic-ui/colorize.js +233 -227
  8. data/app/assets/javascripts/semantic-ui/dimmer.js +27 -9
  9. data/app/assets/javascripts/semantic-ui/dropdown.js +485 -207
  10. data/app/assets/javascripts/semantic-ui/embed.js +50 -13
  11. data/app/assets/javascripts/semantic-ui/form.js +58 -23
  12. data/app/assets/javascripts/semantic-ui/modal.js +28 -13
  13. data/app/assets/javascripts/semantic-ui/nag.js +28 -7
  14. data/app/assets/javascripts/semantic-ui/popup.js +136 -76
  15. data/app/assets/javascripts/semantic-ui/progress.js +177 -62
  16. data/app/assets/javascripts/semantic-ui/rating.js +41 -8
  17. data/app/assets/javascripts/semantic-ui/search.js +109 -56
  18. data/app/assets/javascripts/semantic-ui/shape.js +52 -19
  19. data/app/assets/javascripts/semantic-ui/sidebar.js +21 -7
  20. data/app/assets/javascripts/semantic-ui/site.js +2 -2
  21. data/app/assets/javascripts/semantic-ui/state.js +20 -7
  22. data/app/assets/javascripts/semantic-ui/sticky.js +48 -19
  23. data/app/assets/javascripts/semantic-ui/tab.js +57 -27
  24. data/app/assets/javascripts/semantic-ui/transition.js +24 -8
  25. data/app/assets/javascripts/semantic-ui/video.js +6 -14
  26. data/app/assets/javascripts/semantic-ui/visibility.js +89 -22
  27. data/app/assets/javascripts/semantic-ui/visit.js +13 -5
  28. data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +4 -5
  29. data/app/assets/stylesheets/semantic-ui/collections/_form.scss +91 -85
  30. data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +41 -37
  31. data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +138 -94
  32. data/app/assets/stylesheets/semantic-ui/collections/_message.scss +74 -55
  33. data/app/assets/stylesheets/semantic-ui/collections/_table.scss +80 -68
  34. data/app/assets/stylesheets/semantic-ui/elements/_button.scss +458 -305
  35. data/app/assets/stylesheets/semantic-ui/elements/_container.scss +1 -2
  36. data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +2 -4
  37. data/app/assets/stylesheets/semantic-ui/elements/_flag.scss +2 -3
  38. data/app/assets/stylesheets/semantic-ui/elements/_header.scss +46 -46
  39. data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +812 -252
  40. data/app/assets/stylesheets/semantic-ui/elements/_image.scss +7 -3
  41. data/app/assets/stylesheets/semantic-ui/elements/_input.scss +35 -35
  42. data/app/assets/stylesheets/semantic-ui/elements/_label.scss +127 -127
  43. data/app/assets/stylesheets/semantic-ui/elements/_list.scss +37 -25
  44. data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +101 -38
  45. data/app/assets/stylesheets/semantic-ui/elements/_rail.scss +24 -4
  46. data/app/assets/stylesheets/semantic-ui/elements/_reveal.scss +9 -6
  47. data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +92 -51
  48. data/app/assets/stylesheets/semantic-ui/elements/_step.scss +42 -23
  49. data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +1 -6
  50. data/app/assets/stylesheets/semantic-ui/globals/_site.scss +7 -9
  51. data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +7 -6
  52. data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +40 -37
  53. data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +7 -8
  54. data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +107 -88
  55. data/app/assets/stylesheets/semantic-ui/modules/_embed.scss +6 -7
  56. data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +9 -10
  57. data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +6 -7
  58. data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +415 -36
  59. data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +47 -48
  60. data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +12 -13
  61. data/app/assets/stylesheets/semantic-ui/modules/_search.scss +21 -21
  62. data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +11 -8
  63. data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +31 -14
  64. data/app/assets/stylesheets/semantic-ui/modules/_sticky.scss +2 -3
  65. data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +1 -2
  66. data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +1 -2
  67. data/app/assets/stylesheets/semantic-ui/views/_ad.scss +2 -2
  68. data/app/assets/stylesheets/semantic-ui/views/_card.scss +62 -42
  69. data/app/assets/stylesheets/semantic-ui/views/_comment.scss +2 -3
  70. data/app/assets/stylesheets/semantic-ui/views/_feed.scss +5 -6
  71. data/app/assets/stylesheets/semantic-ui/views/_item.scss +11 -12
  72. data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +44 -45
  73. data/app/helpers/semantic_icon_helper.rb +6 -3
  74. data/lib/semantic/ui/sass/engine.rb +5 -1
  75. data/lib/semantic/ui/sass/version.rb +2 -2
  76. data/spec/helpers/semantic_icon_helper_spec.rb +22 -10
  77. metadata +3 -3
@@ -3,16 +3,30 @@
3
3
  * http://github.com/semantic-org/semantic-ui/
4
4
  *
5
5
  *
6
- * Copyright 2015 Contributors
7
6
  * Released under the MIT license
8
7
  * http://opensource.org/licenses/MIT
9
8
  *
10
9
  */
11
10
 
12
- ;(function ( $, window, document, undefined ) {
11
+ ;(function ($, window, document, undefined) {
13
12
 
14
13
  "use strict";
15
14
 
15
+ window = (typeof window != 'undefined' && window.Math == Math)
16
+ ? window
17
+ : (typeof self != 'undefined' && self.Math == Math)
18
+ ? self
19
+ : Function('return this')()
20
+ ;
21
+
22
+ var
23
+ global = (typeof window != 'undefined' && window.Math == Math)
24
+ ? window
25
+ : (typeof self != 'undefined' && self.Math == Math)
26
+ ? self
27
+ : Function('return this')()
28
+ ;
29
+
16
30
  $.fn.progress = function(parameters) {
17
31
  var
18
32
  $allModules = $(this),
@@ -88,12 +102,13 @@ $.fn.progress = function(parameters) {
88
102
  },
89
103
 
90
104
  reset: function() {
91
- module.set.percent(0);
92
- module.set.value(0);
105
+ module.remove.nextValue();
106
+ module.update.progress(0);
93
107
  },
94
108
 
95
109
  complete: function() {
96
110
  if(module.percent === undefined || module.percent < 100) {
111
+ module.remove.progressPoll();
97
112
  module.set.percent(100);
98
113
  }
99
114
  },
@@ -147,15 +162,7 @@ $.fn.progress = function(parameters) {
147
162
  if( module.has.total() ) {
148
163
  startValue = module.get.value();
149
164
  incrementValue = incrementValue || 1;
150
-
151
165
  newValue = startValue + incrementValue;
152
- maxValue = module.get.total();
153
-
154
- module.debug('Incrementing value', startValue, newValue, maxValue);
155
- if(newValue > maxValue ) {
156
- module.debug('Value cannot increment above total', maxValue);
157
- newValue = maxValue;
158
- }
159
166
  }
160
167
  else {
161
168
  startValue = module.get.percent();
@@ -163,13 +170,9 @@ $.fn.progress = function(parameters) {
163
170
 
164
171
  newValue = startValue + incrementValue;
165
172
  maxValue = 100;
166
-
167
173
  module.debug('Incrementing percentage by', startValue, newValue);
168
- if(newValue > maxValue ) {
169
- module.debug('Value cannot increment above 100 percent');
170
- newValue = maxValue;
171
- }
172
174
  }
175
+ newValue = module.get.normalizedValue(newValue);
173
176
  module.set.progress(newValue);
174
177
  },
175
178
  decrement: function(decrementValue) {
@@ -190,15 +193,14 @@ $.fn.progress = function(parameters) {
190
193
  newValue = startValue - decrementValue;
191
194
  module.debug('Decrementing percentage by', decrementValue, startValue);
192
195
  }
193
-
194
- if(newValue < 0) {
195
- module.debug('Value cannot decrement below 0');
196
- newValue = 0;
197
- }
196
+ newValue = module.get.normalizedValue(newValue);
198
197
  module.set.progress(newValue);
199
198
  },
200
199
 
201
200
  has: {
201
+ progressPoll: function() {
202
+ return module.progressPoll;
203
+ },
202
204
  total: function() {
203
205
  return (module.get.total() !== false);
204
206
  }
@@ -223,10 +225,34 @@ $.fn.progress = function(parameters) {
223
225
  .replace('{left}', left)
224
226
  .replace('{percent}', percent)
225
227
  ;
226
- module.debug('Adding variables to progress bar text', templateText);
228
+ module.verbose('Adding variables to progress bar text', templateText);
227
229
  return templateText;
228
230
  },
229
231
 
232
+ normalizedValue: function(value) {
233
+ if(value < 0) {
234
+ module.debug('Value cannot decrement below 0');
235
+ return 0;
236
+ }
237
+ if(module.has.total()) {
238
+ if(value > module.total) {
239
+ module.debug('Value cannot increment above total', module.total);
240
+ return module.total;
241
+ }
242
+ }
243
+ else if(value > 100 ) {
244
+ module.debug('Value cannot increment above 100 percent');
245
+ return 100;
246
+ }
247
+ return value;
248
+ },
249
+
250
+ updateInterval: function() {
251
+ if(settings.updateInterval == 'auto') {
252
+ return settings.duration;
253
+ }
254
+ return settings.updateInterval;
255
+ },
230
256
 
231
257
  randomValue: function() {
232
258
  module.debug('Generating random increment percentage');
@@ -280,14 +306,26 @@ $.fn.progress = function(parameters) {
280
306
  return module.percent || 0;
281
307
  },
282
308
  value: function() {
283
- return module.value || 0;
309
+ return module.nextValue || module.value || 0;
284
310
  },
285
311
  total: function() {
286
312
  return module.total || false;
287
313
  }
288
314
  },
289
315
 
316
+ create: {
317
+ progressPoll: function() {
318
+ module.progressPoll = setTimeout(function() {
319
+ module.update.toNextValue();
320
+ module.remove.progressPoll();
321
+ }, module.get.updateInterval());
322
+ },
323
+ },
324
+
290
325
  is: {
326
+ complete: function() {
327
+ return module.is.success() || module.is.warning() || module.is.error();
328
+ },
291
329
  success: function() {
292
330
  return $module.hasClass(className.success);
293
331
  },
@@ -306,6 +344,17 @@ $.fn.progress = function(parameters) {
306
344
  },
307
345
 
308
346
  remove: {
347
+ progressPoll: function() {
348
+ module.verbose('Removing progress poll timer');
349
+ if(module.progressPoll) {
350
+ clearTimeout(module.progressPoll);
351
+ delete module.progressPoll;
352
+ }
353
+ },
354
+ nextValue: function() {
355
+ module.verbose('Removing progress value stored for next update');
356
+ delete module.nextValue;
357
+ },
309
358
  state: function() {
310
359
  module.verbose('Removing stored state');
311
360
  delete module.total;
@@ -401,9 +450,17 @@ $.fn.progress = function(parameters) {
401
450
  ;
402
451
  clearInterval(module.interval);
403
452
  $bar.one(transitionEnd + eventNamespace, animationCallback);
404
- module.timer = setTimeout(animationCallback, settings.duration + 100);
405
453
  animating = true;
406
- module.interval = setInterval(module.set.labels, settings.framerate);
454
+ module.interval = setInterval(function() {
455
+ var
456
+ isInDOM = $.contains(document.documentElement, element)
457
+ ;
458
+ if(!isInDOM) {
459
+ clearInterval(module.interval);
460
+ animating = false;
461
+ }
462
+ module.set.labels();
463
+ }, settings.framerate);
407
464
  },
408
465
  labels: function() {
409
466
  module.verbose('Setting both bar progress and outer label text');
@@ -414,7 +471,7 @@ $.fn.progress = function(parameters) {
414
471
  text = text || '';
415
472
  if(text) {
416
473
  text = module.get.text(text);
417
- module.debug('Setting label to text', text);
474
+ module.verbose('Setting label to text', text);
418
475
  $label.text(text);
419
476
  }
420
477
  },
@@ -424,13 +481,14 @@ $.fn.progress = function(parameters) {
424
481
  : module.percent
425
482
  ;
426
483
  if(percent === 100) {
427
- if(settings.autoSuccess && !(module.is.warning() || module.is.error())) {
484
+ if(settings.autoSuccess && !(module.is.warning() || module.is.error() || module.is.success())) {
428
485
  module.set.success();
429
486
  module.debug('Automatically triggering success at 100%');
430
487
  }
431
488
  else {
432
489
  module.verbose('Reached 100% removing active state');
433
490
  module.remove.active();
491
+ module.remove.progressPoll();
434
492
  }
435
493
  }
436
494
  else if(percent > 0) {
@@ -447,11 +505,11 @@ $.fn.progress = function(parameters) {
447
505
  $progress.text( module.get.text(text) );
448
506
  }
449
507
  else if(settings.label == 'ratio' && module.total) {
450
- module.debug('Adding ratio to bar label');
508
+ module.verbose('Adding ratio to bar label');
451
509
  $progress.text( module.get.text(settings.text.ratio) );
452
510
  }
453
511
  else if(settings.label == 'percent') {
454
- module.debug('Adding percentage to bar label');
512
+ module.verbose('Adding percentage to bar label');
455
513
  $progress.text( module.get.text(settings.text.percent) );
456
514
  }
457
515
  },
@@ -464,23 +522,33 @@ $.fn.progress = function(parameters) {
464
522
  module.remove.warning();
465
523
  module.remove.error();
466
524
  module.remove.success();
525
+ text = settings.onLabelUpdate('active', text, module.value, module.total);
467
526
  if(text) {
468
527
  module.set.label(text);
469
528
  }
470
- settings.onActive.call(element, module.value, module.total);
529
+ $bar.one(transitionEnd + eventNamespace, function() {
530
+ settings.onActive.call(element, module.value, module.total);
531
+ });
471
532
  },
472
533
  success : function(text) {
473
- text = text || settings.text.success;
534
+ text = text || settings.text.success || settings.text.active;
474
535
  module.debug('Setting success state');
475
536
  $module.addClass(className.success);
476
537
  module.remove.active();
477
538
  module.remove.warning();
478
539
  module.remove.error();
479
540
  module.complete();
480
- if(text) {
541
+ if(settings.text.success) {
542
+ text = settings.onLabelUpdate('success', text, module.value, module.total);
543
+ module.set.label(text);
544
+ }
545
+ else {
546
+ text = settings.onLabelUpdate('active', text, module.value, module.total);
481
547
  module.set.label(text);
482
548
  }
483
- settings.onSuccess.call(element, module.total);
549
+ $bar.one(transitionEnd + eventNamespace, function() {
550
+ settings.onSuccess.call(element, module.total);
551
+ });
484
552
  },
485
553
  warning : function(text) {
486
554
  text = text || settings.text.warning;
@@ -490,10 +558,13 @@ $.fn.progress = function(parameters) {
490
558
  module.remove.success();
491
559
  module.remove.error();
492
560
  module.complete();
561
+ text = settings.onLabelUpdate('warning', text, module.value, module.total);
493
562
  if(text) {
494
563
  module.set.label(text);
495
564
  }
496
- settings.onWarning.call(element, module.value, module.total);
565
+ $bar.one(transitionEnd + eventNamespace, function() {
566
+ settings.onWarning.call(element, module.value, module.total);
567
+ });
497
568
  },
498
569
  error : function(text) {
499
570
  text = text || settings.text.error;
@@ -503,10 +574,13 @@ $.fn.progress = function(parameters) {
503
574
  module.remove.success();
504
575
  module.remove.warning();
505
576
  module.complete();
577
+ text = settings.onLabelUpdate('error', text, module.value, module.total);
506
578
  if(text) {
507
579
  module.set.label(text);
508
580
  }
509
- settings.onError.call(element, module.value, module.total);
581
+ $bar.one(transitionEnd + eventNamespace, function() {
582
+ settings.onError.call(element, module.value, module.total);
583
+ });
510
584
  },
511
585
  transitionEvent: function() {
512
586
  transitionEnd = module.get.transitionEnd();
@@ -517,22 +591,50 @@ $.fn.progress = function(parameters) {
517
591
  value: function(value) {
518
592
  module.value = value;
519
593
  },
594
+ progress: function(value) {
595
+ if(!module.has.progressPoll()) {
596
+ module.debug('First update in progress update interval, immediately updating', value);
597
+ module.update.progress(value);
598
+ module.create.progressPoll();
599
+ }
600
+ else {
601
+ module.debug('Updated within interval, setting next update to use new value', value);
602
+ module.set.nextValue(value);
603
+ }
604
+ },
605
+ nextValue: function(value) {
606
+ module.nextValue = value;
607
+ }
608
+ },
609
+
610
+ update: {
611
+ toNextValue: function() {
612
+ var
613
+ nextValue = module.nextValue
614
+ ;
615
+ if(nextValue) {
616
+ module.debug('Update interval complete using last updated value', nextValue);
617
+ module.update.progress(nextValue);
618
+ module.remove.nextValue();
619
+ }
620
+ },
520
621
  progress: function(value) {
521
622
  var
522
- numericValue = module.get.numericValue(value),
523
623
  percentComplete
524
624
  ;
525
- if(numericValue === false) {
625
+ value = module.get.numericValue(value);
626
+ if(value === false) {
526
627
  module.error(error.nonNumeric, value);
527
628
  }
629
+ value = module.get.normalizedValue(value);
528
630
  if( module.has.total() ) {
529
- module.set.value(numericValue);
530
- percentComplete = (numericValue / module.total) * 100;
631
+ module.set.value(value);
632
+ percentComplete = (value / module.total) * 100;
531
633
  module.debug('Calculating percent complete from total', percentComplete);
532
634
  module.set.percent( percentComplete );
533
635
  }
534
636
  else {
535
- percentComplete = numericValue;
637
+ percentComplete = value;
536
638
  module.debug('Setting value to exact percentage value', percentComplete);
537
639
  module.set.percent( percentComplete );
538
640
  }
@@ -545,7 +647,12 @@ $.fn.progress = function(parameters) {
545
647
  $.extend(true, settings, name);
546
648
  }
547
649
  else if(value !== undefined) {
548
- settings[name] = value;
650
+ if($.isPlainObject(settings[name])) {
651
+ $.extend(true, settings[name], value);
652
+ }
653
+ else {
654
+ settings[name] = value;
655
+ }
549
656
  }
550
657
  else {
551
658
  return settings[name];
@@ -563,7 +670,7 @@ $.fn.progress = function(parameters) {
563
670
  }
564
671
  },
565
672
  debug: function() {
566
- if(settings.debug) {
673
+ if(!settings.silent && settings.debug) {
567
674
  if(settings.performance) {
568
675
  module.performance.log(arguments);
569
676
  }
@@ -574,7 +681,7 @@ $.fn.progress = function(parameters) {
574
681
  }
575
682
  },
576
683
  verbose: function() {
577
- if(settings.verbose && settings.debug) {
684
+ if(!settings.silent && settings.verbose && settings.debug) {
578
685
  if(settings.performance) {
579
686
  module.performance.log(arguments);
580
687
  }
@@ -585,8 +692,10 @@ $.fn.progress = function(parameters) {
585
692
  }
586
693
  },
587
694
  error: function() {
588
- module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
589
- module.error.apply(console, arguments);
695
+ if(!settings.silent) {
696
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
697
+ module.error.apply(console, arguments);
698
+ }
590
699
  },
591
700
  performance: {
592
701
  log: function(message) {
@@ -721,6 +830,7 @@ $.fn.progress.settings = {
721
830
  name : 'Progress',
722
831
  namespace : 'progress',
723
832
 
833
+ silent : false,
724
834
  debug : false,
725
835
  verbose : false,
726
836
  performance : true,
@@ -730,25 +840,30 @@ $.fn.progress.settings = {
730
840
  max : 5
731
841
  },
732
842
 
733
- duration : 300,
843
+ duration : 300,
844
+
845
+ updateInterval : 'auto',
734
846
 
735
- autoSuccess : true,
736
- showActivity : true,
737
- limitValues : true,
847
+ autoSuccess : true,
848
+ showActivity : true,
849
+ limitValues : true,
738
850
 
739
- label : 'percent',
740
- precision : 0,
741
- framerate : (1000 / 30), /// 30 fps
851
+ label : 'percent',
852
+ precision : 0,
853
+ framerate : (1000 / 30), /// 30 fps
742
854
 
743
- percent : false,
744
- total : false,
745
- value : false,
855
+ percent : false,
856
+ total : false,
857
+ value : false,
746
858
 
747
- onChange : function(percent, value, total){},
748
- onSuccess : function(total){},
749
- onActive : function(value, total){},
750
- onError : function(value, total){},
751
- onWarning : function(value, total){},
859
+ onLabelUpdate : function(state, text, value, total){
860
+ return text;
861
+ },
862
+ onChange : function(percent, value, total){},
863
+ onSuccess : function(total){},
864
+ onActive : function(value, total){},
865
+ onError : function(value, total){},
866
+ onWarning : function(value, total){},
752
867
 
753
868
  error : {
754
869
  method : 'The method you called is not defined.',
@@ -792,4 +907,4 @@ $.fn.progress.settings = {
792
907
  };
793
908
 
794
909
 
795
- })( jQuery, window, document );
910
+ })( jQuery, window, document );