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,7 +3,6 @@
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
  *
@@ -13,6 +12,13 @@
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
+
16
22
  $.fn.rating = function(parameters) {
17
23
  var
18
24
  $allModules = $(this),
@@ -48,6 +54,7 @@ $.fn.rating = function(parameters) {
48
54
  $module = $(this),
49
55
  $icon = $module.find(selector.icon),
50
56
 
57
+ initialLoad,
51
58
  module
52
59
  ;
53
60
 
@@ -66,7 +73,9 @@ $.fn.rating = function(parameters) {
66
73
  else {
67
74
  module.disable();
68
75
  }
76
+ module.set.initialLoad();
69
77
  module.set.rating( module.get.initialRating() );
78
+ module.remove.initialLoad();
70
79
  module.instantiate();
71
80
  },
72
81
 
@@ -170,6 +179,9 @@ $.fn.rating = function(parameters) {
170
179
  $module
171
180
  .off(eventNamespace)
172
181
  ;
182
+ },
183
+ initialLoad: function() {
184
+ initialLoad = false;
173
185
  }
174
186
  },
175
187
 
@@ -189,6 +201,12 @@ $.fn.rating = function(parameters) {
189
201
  ;
190
202
  },
191
203
 
204
+ is: {
205
+ initialLoad: function() {
206
+ return initialLoad;
207
+ }
208
+ },
209
+
192
210
  get: {
193
211
  initialRating: function() {
194
212
  if($module.data(metadata.rating) !== undefined) {
@@ -232,11 +250,16 @@ $.fn.rating = function(parameters) {
232
250
  module.verbose('Setting current rating to', rating);
233
251
  $activeIcon
234
252
  .prevAll()
235
- .andSelf()
253
+ .addBack()
236
254
  .addClass(className.active)
237
255
  ;
238
256
  }
239
- settings.onRate.call(element, rating);
257
+ if(!module.is.initialLoad()) {
258
+ settings.onRate.call(element, rating);
259
+ }
260
+ },
261
+ initialLoad: function() {
262
+ initialLoad = true;
240
263
  }
241
264
  },
242
265
 
@@ -246,7 +269,12 @@ $.fn.rating = function(parameters) {
246
269
  $.extend(true, settings, name);
247
270
  }
248
271
  else if(value !== undefined) {
249
- settings[name] = value;
272
+ if($.isPlainObject(settings[name])) {
273
+ $.extend(true, settings[name], value);
274
+ }
275
+ else {
276
+ settings[name] = value;
277
+ }
250
278
  }
251
279
  else {
252
280
  return settings[name];
@@ -264,7 +292,7 @@ $.fn.rating = function(parameters) {
264
292
  }
265
293
  },
266
294
  debug: function() {
267
- if(settings.debug) {
295
+ if(!settings.silent && settings.debug) {
268
296
  if(settings.performance) {
269
297
  module.performance.log(arguments);
270
298
  }
@@ -275,7 +303,7 @@ $.fn.rating = function(parameters) {
275
303
  }
276
304
  },
277
305
  verbose: function() {
278
- if(settings.verbose && settings.debug) {
306
+ if(!settings.silent && settings.verbose && settings.debug) {
279
307
  if(settings.performance) {
280
308
  module.performance.log(arguments);
281
309
  }
@@ -286,8 +314,10 @@ $.fn.rating = function(parameters) {
286
314
  }
287
315
  },
288
316
  error: function() {
289
- module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
290
- module.error.apply(console, arguments);
317
+ if(!settings.silent) {
318
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
319
+ module.error.apply(console, arguments);
320
+ }
291
321
  },
292
322
  performance: {
293
323
  log: function(message) {
@@ -423,6 +453,7 @@ $.fn.rating.settings = {
423
453
  name : 'Rating',
424
454
  namespace : 'rating',
425
455
 
456
+ slent : false,
426
457
  debug : false,
427
458
  verbose : false,
428
459
  performance : true,
@@ -432,6 +463,8 @@ $.fn.rating.settings = {
432
463
  maxRating : 4,
433
464
  clearable : 'auto',
434
465
 
466
+ fireOnInit : false,
467
+
435
468
  onRate : function(rating){},
436
469
 
437
470
  error : {
@@ -3,7 +3,6 @@
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
  *
@@ -13,6 +12,13 @@
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
+
16
22
  $.fn.search = function(parameters) {
17
23
  var
18
24
  $allModules = $(this),
@@ -54,6 +60,8 @@ $.fn.search = function(parameters) {
54
60
  element = this,
55
61
  instance = $module.data(moduleNamespace),
56
62
 
63
+ disabledBubbled = false,
64
+
57
65
  module
58
66
  ;
59
67
 
@@ -82,6 +90,20 @@ $.fn.search = function(parameters) {
82
90
  ;
83
91
  },
84
92
 
93
+ refresh: function() {
94
+ module.debug('Refreshing selector cache');
95
+ $prompt = $module.find(selector.prompt);
96
+ $searchButton = $module.find(selector.searchButton);
97
+ $category = $module.find(selector.category);
98
+ $results = $module.find(selector.results);
99
+ $result = $module.find(selector.result);
100
+ },
101
+
102
+ refreshResults: function() {
103
+ $results = $module.find(selector.results);
104
+ $result = $module.find(selector.result);
105
+ },
106
+
85
107
  bind: {
86
108
  events: function() {
87
109
  module.verbose('Binding events to search');
@@ -147,8 +169,13 @@ $.fn.search = function(parameters) {
147
169
  if(module.resultsClicked) {
148
170
  module.debug('Determining if user action caused search to close');
149
171
  $module
150
- .one('click', selector.results, function(event) {
151
- if( !module.is.animating() && !module.is.hidden() ) {
172
+ .one('click.close' + eventNamespace, selector.results, function(event) {
173
+ if(module.is.inMessage(event) || disabledBubbled) {
174
+ $prompt.focus();
175
+ return;
176
+ }
177
+ disabledBubbled = false;
178
+ if( !module.is.animating() && !module.is.hidden()) {
152
179
  callback();
153
180
  }
154
181
  })
@@ -171,7 +198,9 @@ $.fn.search = function(parameters) {
171
198
  var
172
199
  $result = $(this),
173
200
  $title = $result.find(selector.title).eq(0),
174
- $link = $result.find('a[href]').eq(0),
201
+ $link = $result.is('a[href]')
202
+ ? $result
203
+ : $result.find('a[href]').eq(0),
175
204
  href = $link.attr('href') || false,
176
205
  target = $link.attr('target') || false,
177
206
  title = $title.html(),
@@ -186,6 +215,7 @@ $.fn.search = function(parameters) {
186
215
  if( $.isFunction(settings.onSelect) ) {
187
216
  if(settings.onSelect.call(element, result, results) === false) {
188
217
  module.debug('Custom onSelect callback cancelled default select action');
218
+ disabledBubbled = true;
189
219
  return;
190
220
  }
191
221
  }
@@ -286,18 +316,30 @@ $.fn.search = function(parameters) {
286
316
  },
287
317
 
288
318
  setup: {
289
- api: function() {
319
+ api: function(searchTerm) {
290
320
  var
291
321
  apiSettings = {
292
- debug : settings.debug,
293
- on : false,
294
- cache : 'local',
295
- action : 'search',
296
- onError : module.error
322
+ debug : settings.debug,
323
+ on : false,
324
+ cache : true,
325
+ action : 'search',
326
+ urlData : {
327
+ query : searchTerm
328
+ },
329
+ onSuccess : function(response) {
330
+ module.parse.response.call(element, response, searchTerm);
331
+ },
332
+ onAbort : function(response) {
333
+ },
334
+ onFailure : function() {
335
+ module.displayMessage(error.serverError);
336
+ },
337
+ onError : module.error
297
338
  },
298
339
  searchHTML
299
340
  ;
300
- module.verbose('First request, initializing API');
341
+ $.extend(true, apiSettings, settings.apiSettings);
342
+ module.verbose('Setting up API request', apiSettings);
301
343
  $module.api(apiSettings);
302
344
  }
303
345
  },
@@ -321,6 +363,9 @@ $.fn.search = function(parameters) {
321
363
  hidden: function() {
322
364
  return $results.hasClass(className.hidden);
323
365
  },
366
+ inMessage: function(event) {
367
+ return (event.target && $(event.target).closest(selector.message).length > 0);
368
+ },
324
369
  empty: function() {
325
370
  return ($results.html() === '');
326
371
  },
@@ -400,6 +445,13 @@ $.fn.search = function(parameters) {
400
445
  },
401
446
  },
402
447
 
448
+ select: {
449
+ firstResult: function() {
450
+ module.verbose('Selecting first result');
451
+ $result.first().addClass(className.active);
452
+ }
453
+ },
454
+
403
455
  set: {
404
456
  focus: function() {
405
457
  $module.addClass(className.focus);
@@ -489,27 +541,11 @@ $.fn.search = function(parameters) {
489
541
  });
490
542
  },
491
543
  remote: function(searchTerm) {
492
- var
493
- apiSettings = {
494
- onSuccess : function(response) {
495
- module.parse.response.call(element, response, searchTerm);
496
- },
497
- onFailure: function() {
498
- module.displayMessage(error.serverError);
499
- },
500
- urlData: {
501
- query: searchTerm
502
- }
503
- }
504
- ;
505
- if( !$module.api('get request') ) {
506
- module.setup.api();
544
+ if($module.api('is loading')) {
545
+ $module.api('abort');
507
546
  }
508
- $.extend(true, apiSettings, settings.apiSettings);
509
- module.debug('Executing search', apiSettings);
510
- module.cancel.query();
547
+ module.setup.api(searchTerm);
511
548
  $module
512
- .api('setting', apiSettings)
513
549
  .api('query')
514
550
  ;
515
551
  },
@@ -790,12 +826,19 @@ $.fn.search = function(parameters) {
790
826
  return false;
791
827
  }
792
828
  }
793
- $results
794
- .html(html)
795
- ;
796
- if( module.can.show() ) {
829
+ if(html) {
830
+ $results
831
+ .html(html)
832
+ ;
833
+ module.refreshResults();
834
+ if(settings.selectFirstResult) {
835
+ module.select.firstResult();
836
+ }
797
837
  module.showResults();
798
838
  }
839
+ else {
840
+ module.hideResults();
841
+ }
799
842
  },
800
843
 
801
844
  showResults: function() {
@@ -873,7 +916,7 @@ $.fn.search = function(parameters) {
873
916
  module.error(error.noTemplate, false);
874
917
  }
875
918
  }
876
- else {
919
+ else if(settings.showNoResults) {
877
920
  html = module.displayMessage(error.noResults, 'empty');
878
921
  }
879
922
  settings.onResults.call(element, response);
@@ -910,7 +953,7 @@ $.fn.search = function(parameters) {
910
953
  }
911
954
  },
912
955
  debug: function() {
913
- if(settings.debug) {
956
+ if(!settings.silent && settings.debug) {
914
957
  if(settings.performance) {
915
958
  module.performance.log(arguments);
916
959
  }
@@ -921,7 +964,7 @@ $.fn.search = function(parameters) {
921
964
  }
922
965
  },
923
966
  verbose: function() {
924
- if(settings.verbose && settings.debug) {
967
+ if(!settings.silent && settings.verbose && settings.debug) {
925
968
  if(settings.performance) {
926
969
  module.performance.log(arguments);
927
970
  }
@@ -932,8 +975,10 @@ $.fn.search = function(parameters) {
932
975
  }
933
976
  },
934
977
  error: function() {
935
- module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
936
- module.error.apply(console, arguments);
978
+ if(!settings.silent) {
979
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
980
+ module.error.apply(console, arguments);
981
+ }
937
982
  },
938
983
  performance: {
939
984
  log: function(message) {
@@ -1067,51 +1112,58 @@ $.fn.search = function(parameters) {
1067
1112
 
1068
1113
  $.fn.search.settings = {
1069
1114
 
1070
- name : 'Search',
1071
- namespace : 'search',
1115
+ name : 'Search',
1116
+ namespace : 'search',
1072
1117
 
1073
- debug : false,
1074
- verbose : false,
1075
- performance : true,
1118
+ silent : false,
1119
+ debug : false,
1120
+ verbose : false,
1121
+ performance : true,
1076
1122
 
1077
- type : 'standard',
1078
1123
  // template to use (specified in settings.templates)
1124
+ type : 'standard',
1079
1125
 
1080
- minCharacters : 1,
1081
1126
  // minimum characters required to search
1127
+ minCharacters : 1,
1128
+
1129
+ // whether to select first result after searching automatically
1130
+ selectFirstResult : false,
1082
1131
 
1083
- apiSettings : false,
1084
1132
  // API config
1133
+ apiSettings : false,
1085
1134
 
1086
- source : false,
1087
1135
  // object to search
1136
+ source : false,
1088
1137
 
1138
+ // fields to search
1089
1139
  searchFields : [
1090
1140
  'title',
1091
1141
  'description'
1092
1142
  ],
1093
- // fields to search
1094
1143
 
1095
- displayField : '',
1096
1144
  // field to display in standard results template
1145
+ displayField : '',
1097
1146
 
1098
- searchFullText : true,
1099
1147
  // whether to include fuzzy results in local search
1148
+ searchFullText : true,
1100
1149
 
1101
- automatic : true,
1102
1150
  // whether to add events to prompt automatically
1151
+ automatic : true,
1103
1152
 
1104
- hideDelay : 0,
1105
1153
  // delay before hiding menu after blur
1154
+ hideDelay : 0,
1106
1155
 
1107
- searchDelay : 200,
1108
1156
  // delay before searching
1157
+ searchDelay : 200,
1109
1158
 
1110
- maxResults : 7,
1111
1159
  // maximum results returned from local
1160
+ maxResults : 7,
1112
1161
 
1113
- cache : true,
1114
1162
  // whether to store lookups in local cache
1163
+ cache : true,
1164
+
1165
+ // whether no results errors should be shown
1166
+ showNoResults : true,
1115
1167
 
1116
1168
  // transition settings
1117
1169
  transition : 'scale',
@@ -1181,6 +1233,7 @@ $.fn.search.settings = {
1181
1233
  prompt : '.prompt',
1182
1234
  searchButton : '.search.button',
1183
1235
  results : '.results',
1236
+ message : '.results > .message',
1184
1237
  category : '.category',
1185
1238
  result : '.result',
1186
1239
  title : '.title, .name'