fomantic-ui-sass 2.8.8.1 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/app/assets/fonts/semantic-ui/brand-icons.eot +0 -0
  4. data/app/assets/fonts/semantic-ui/brand-icons.svg +41 -6
  5. data/app/assets/fonts/semantic-ui/brand-icons.ttf +0 -0
  6. data/app/assets/fonts/semantic-ui/brand-icons.woff +0 -0
  7. data/app/assets/fonts/semantic-ui/brand-icons.woff2 +0 -0
  8. data/app/assets/fonts/semantic-ui/icons.eot +0 -0
  9. data/app/assets/fonts/semantic-ui/icons.svg +245 -7
  10. data/app/assets/fonts/semantic-ui/icons.ttf +0 -0
  11. data/app/assets/fonts/semantic-ui/icons.woff +0 -0
  12. data/app/assets/fonts/semantic-ui/icons.woff2 +0 -0
  13. data/app/assets/fonts/semantic-ui/outline-icons.eot +0 -0
  14. data/app/assets/fonts/semantic-ui/outline-icons.svg +2 -2
  15. data/app/assets/fonts/semantic-ui/outline-icons.ttf +0 -0
  16. data/app/assets/fonts/semantic-ui/outline-icons.woff +0 -0
  17. data/app/assets/fonts/semantic-ui/outline-icons.woff2 +0 -0
  18. data/app/assets/javascripts/semantic-ui/accordion.js +9 -3
  19. data/app/assets/javascripts/semantic-ui/api.js +92 -33
  20. data/app/assets/javascripts/semantic-ui/calendar.js +200 -82
  21. data/app/assets/javascripts/semantic-ui/checkbox.js +20 -13
  22. data/app/assets/javascripts/semantic-ui/dimmer.js +24 -9
  23. data/app/assets/javascripts/semantic-ui/dropdown.js +250 -205
  24. data/app/assets/javascripts/semantic-ui/embed.js +13 -9
  25. data/app/assets/javascripts/semantic-ui/flyout.js +1530 -0
  26. data/app/assets/javascripts/semantic-ui/form.js +47 -41
  27. data/app/assets/javascripts/semantic-ui/modal.js +187 -83
  28. data/app/assets/javascripts/semantic-ui/nag.js +2 -2
  29. data/app/assets/javascripts/semantic-ui/popup.js +16 -22
  30. data/app/assets/javascripts/semantic-ui/progress.js +7 -4
  31. data/app/assets/javascripts/semantic-ui/rating.js +7 -3
  32. data/app/assets/javascripts/semantic-ui/search.js +47 -20
  33. data/app/assets/javascripts/semantic-ui/shape.js +3 -3
  34. data/app/assets/javascripts/semantic-ui/sidebar.js +140 -43
  35. data/app/assets/javascripts/semantic-ui/site.js +1 -1
  36. data/app/assets/javascripts/semantic-ui/slider.js +78 -63
  37. data/app/assets/javascripts/semantic-ui/state.js +2 -2
  38. data/app/assets/javascripts/semantic-ui/sticky.js +30 -19
  39. data/app/assets/javascripts/semantic-ui/tab.js +24 -6
  40. data/app/assets/javascripts/semantic-ui/toast.js +67 -33
  41. data/app/assets/javascripts/semantic-ui/transition.js +27 -22
  42. data/app/assets/javascripts/semantic-ui/visibility.js +5 -5
  43. data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +1 -1
  44. data/app/assets/stylesheets/semantic-ui/collections/_form.scss +160 -83
  45. data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +25 -21
  46. data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +110 -78
  47. data/app/assets/stylesheets/semantic-ui/collections/_message.scss +43 -43
  48. data/app/assets/stylesheets/semantic-ui/collections/_table.scss +1684 -272
  49. data/app/assets/stylesheets/semantic-ui/elements/_button.scss +204 -157
  50. data/app/assets/stylesheets/semantic-ui/elements/_container.scss +98 -4
  51. data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +31 -31
  52. data/app/assets/stylesheets/semantic-ui/elements/_emoji.scss +10799 -8841
  53. data/app/assets/stylesheets/semantic-ui/elements/_flag.scss +1021 -915
  54. data/app/assets/stylesheets/semantic-ui/elements/_header.scss +6 -4
  55. data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +2110 -2061
  56. data/app/assets/stylesheets/semantic-ui/elements/_image.scss +1 -1
  57. data/app/assets/stylesheets/semantic-ui/elements/_input.scss +759 -22
  58. data/app/assets/stylesheets/semantic-ui/elements/_label.scss +72 -68
  59. data/app/assets/stylesheets/semantic-ui/elements/_list.scss +31 -31
  60. data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +352 -352
  61. data/app/assets/stylesheets/semantic-ui/elements/_placeholder.scss +33 -33
  62. data/app/assets/stylesheets/semantic-ui/elements/_rail.scss +1 -1
  63. data/app/assets/stylesheets/semantic-ui/elements/_reveal.scss +1 -1
  64. data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +118 -34
  65. data/app/assets/stylesheets/semantic-ui/elements/_step.scss +32 -32
  66. data/app/assets/stylesheets/semantic-ui/elements/_text.scss +1 -1
  67. data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +5 -4
  68. data/app/assets/stylesheets/semantic-ui/globals/_site.scss +139 -42
  69. data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +177 -37
  70. data/app/assets/stylesheets/semantic-ui/modules/_calendar.scss +18 -1
  71. data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +93 -92
  72. data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +33 -18
  73. data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +101 -51
  74. data/app/assets/stylesheets/semantic-ui/modules/_embed.scss +5 -5
  75. data/app/assets/stylesheets/semantic-ui/modules/_flyout.scss +592 -0
  76. data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +37 -6
  77. data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +1 -1
  78. data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +103 -105
  79. data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +1 -1
  80. data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +7 -46
  81. data/app/assets/stylesheets/semantic-ui/modules/_search.scss +6 -6
  82. data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +1 -1
  83. data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +23 -9
  84. data/app/assets/stylesheets/semantic-ui/modules/_slider.scss +17 -17
  85. data/app/assets/stylesheets/semantic-ui/modules/_sticky.scss +1 -1
  86. data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +5 -5
  87. data/app/assets/stylesheets/semantic-ui/modules/_toast.scss +49 -1
  88. data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +1 -1
  89. data/app/assets/stylesheets/semantic-ui/views/_ad.scss +4 -4
  90. data/app/assets/stylesheets/semantic-ui/views/_card.scss +754 -117
  91. data/app/assets/stylesheets/semantic-ui/views/_comment.scss +12 -12
  92. data/app/assets/stylesheets/semantic-ui/views/_feed.scss +29 -29
  93. data/app/assets/stylesheets/semantic-ui/views/_item.scss +17 -17
  94. data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +4 -4
  95. data/lib/fomantic/ui/sass/version.rb +2 -2
  96. metadata +5 -3
@@ -117,8 +117,10 @@ $.fn.accordion = function(parameters) {
117
117
  },
118
118
 
119
119
  event: {
120
- click: function() {
121
- module.toggle.call(this);
120
+ click: function(event) {
121
+ if($(event.target).closest(selector.ignore).length === 0) {
122
+ module.toggle.call(this);
123
+ }
122
124
  }
123
125
  },
124
126
 
@@ -188,6 +190,7 @@ $.fn.accordion = function(parameters) {
188
190
  useFailSafe : true,
189
191
  debug : settings.debug,
190
192
  verbose : settings.verbose,
193
+ silent : settings.silent,
191
194
  duration : settings.duration,
192
195
  skipInlineHidden : true,
193
196
  onComplete: function() {
@@ -253,6 +256,7 @@ $.fn.accordion = function(parameters) {
253
256
  useFailSafe : true,
254
257
  debug : settings.debug,
255
258
  verbose : settings.verbose,
259
+ silent : settings.silent,
256
260
  duration : settings.duration,
257
261
  skipInlineHidden : true
258
262
  })
@@ -323,6 +327,7 @@ $.fn.accordion = function(parameters) {
323
327
  useFailSafe : true,
324
328
  debug : settings.debug,
325
329
  verbose : settings.verbose,
330
+ silent : settings.silent,
326
331
  duration : settings.duration,
327
332
  skipInlineHidden : true
328
333
  })
@@ -491,7 +496,7 @@ $.fn.accordion = function(parameters) {
491
496
  response
492
497
  ;
493
498
  passedArguments = passedArguments || queryArguments;
494
- context = element || context;
499
+ context = context || element;
495
500
  if(typeof query == 'string' && object !== undefined) {
496
501
  query = query.split(/[\. ]/);
497
502
  maxDepth = query.length - 1;
@@ -602,6 +607,7 @@ $.fn.accordion.settings = {
602
607
  accordion : '.accordion',
603
608
  title : '.title',
604
609
  trigger : '.title',
610
+ ignore : '.ui.dropdown',
605
611
  content : '.content'
606
612
  }
607
613
 
@@ -65,7 +65,7 @@ $.api = $.fn.api = function(parameters) {
65
65
 
66
66
  // context used for state
67
67
  $context = (settings.stateContext)
68
- ? $(settings.stateContext)
68
+ ? ([window,document].indexOf(settings.stateContext) < 0 ? $(document).find(settings.stateContext) : $(settings.stateContext))
69
69
  : $module,
70
70
 
71
71
  // request details
@@ -74,6 +74,7 @@ $.api = $.fn.api = function(parameters) {
74
74
  url,
75
75
  data,
76
76
  requestStartTime,
77
+ originalData,
77
78
 
78
79
  // standard module
79
80
  element = this,
@@ -86,6 +87,7 @@ $.api = $.fn.api = function(parameters) {
86
87
 
87
88
  initialize: function() {
88
89
  if(!methodInvoked) {
90
+ originalData = settings.data;
89
91
  module.bind.events();
90
92
  }
91
93
  module.instantiate();
@@ -132,7 +134,7 @@ $.api = $.fn.api = function(parameters) {
132
134
  response = JSON.parse(response);
133
135
  }
134
136
  catch(e) {
135
- // isnt json string
137
+ // isn't json string
136
138
  }
137
139
  }
138
140
  return response;
@@ -148,8 +150,8 @@ $.api = $.fn.api = function(parameters) {
148
150
  module.error(error.noStorage);
149
151
  return;
150
152
  }
151
- response = sessionStorage.getItem(url);
152
- module.debug('Using cached response', url, response);
153
+ response = sessionStorage.getItem(url + module.get.normalizedData());
154
+ module.debug('Using cached response', url, settings.data, response);
153
155
  response = module.decode.json(response);
154
156
  return response;
155
157
  }
@@ -167,8 +169,8 @@ $.api = $.fn.api = function(parameters) {
167
169
  if( $.isPlainObject(response) ) {
168
170
  response = JSON.stringify(response);
169
171
  }
170
- sessionStorage.setItem(url, response);
171
- module.verbose('Storing cached response for url', url, response);
172
+ sessionStorage.setItem(url + module.get.normalizedData(), response);
173
+ module.verbose('Storing cached response for url', url, settings.data, response);
172
174
  }
173
175
  },
174
176
 
@@ -197,7 +199,7 @@ $.api = $.fn.api = function(parameters) {
197
199
 
198
200
  // Add form content
199
201
  if(settings.serializeForm) {
200
- settings.data = module.add.formData(settings.data);
202
+ settings.data = module.add.formData(originalData || settings.data);
201
203
  }
202
204
 
203
205
  // call beforesend and get any settings changes
@@ -334,10 +336,6 @@ $.api = $.fn.api = function(parameters) {
334
336
  cancelled: function() {
335
337
  return (module.cancelled || false);
336
338
  },
337
- succesful: function() {
338
- module.verbose('This behavior will be deleted due to typo. Use "was successful" instead.');
339
- return module.was.successful();
340
- },
341
339
  successful: function() {
342
340
  return (module.request && module.request.state() == 'resolved');
343
341
  },
@@ -365,8 +363,8 @@ $.api = $.fn.api = function(parameters) {
365
363
  var
366
364
  // allow legacy {$var} style
367
365
  variable = (templatedString.indexOf('$') !== -1)
368
- ? templatedString.substr(2, templatedString.length - 3)
369
- : templatedString.substr(1, templatedString.length - 2),
366
+ ? templatedString.slice(2, -1)
367
+ : templatedString.slice(1, -1),
370
368
  value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
371
369
  ? urlData[variable]
372
370
  : ($module.data(variable) !== undefined)
@@ -397,8 +395,8 @@ $.api = $.fn.api = function(parameters) {
397
395
  var
398
396
  // allow legacy {/$var} style
399
397
  variable = (templatedString.indexOf('$') !== -1)
400
- ? templatedString.substr(3, templatedString.length - 4)
401
- : templatedString.substr(2, templatedString.length - 3),
398
+ ? templatedString.slice(3, -1)
399
+ : templatedString.slice(2, -1),
402
400
  value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
403
401
  ? urlData[variable]
404
402
  : ($module.data(variable) !== undefined)
@@ -429,24 +427,76 @@ $.api = $.fn.api = function(parameters) {
429
427
  },
430
428
  formData: function(data) {
431
429
  var
432
- canSerialize = ($.fn.serializeObject !== undefined),
433
- formData = (canSerialize)
434
- ? $form.serializeObject()
435
- : $form.serialize(),
436
- hasOtherData
430
+ formData = {},
431
+ hasOtherData,
432
+ useFormDataApi = settings.serializeForm === 'formdata'
437
433
  ;
438
- data = data || settings.data;
434
+ data = data || originalData || settings.data;
439
435
  hasOtherData = $.isPlainObject(data);
440
436
 
437
+ if (useFormDataApi) {
438
+ formData = new FormData($form[0]);
439
+ settings.processData = typeof settings.processData !== 'undefined' ? settings.processData : false;
440
+ settings.contentType = typeof settings.contentType !== 'undefined' ? settings.contentType : false;
441
+ } else {
442
+ var formArray = $form.serializeArray(),
443
+ pushes = {},
444
+ pushValues= {},
445
+ build = function(base, key, value) {
446
+ base[key] = value;
447
+ return base;
448
+ }
449
+ ;
450
+ // add files
451
+ $.each($('input[type="file"]',$form), function(i, tag) {
452
+ $.each($(tag)[0].files, function(j, file) {
453
+ formArray.push({name:tag.name, value: file});
454
+ });
455
+ });
456
+ $.each(formArray, function(i, el) {
457
+ if (!settings.regExp.validate.test(el.name)) return;
458
+ var isCheckbox = $('[name="' + el.name + '"]', $form).attr('type') === 'checkbox',
459
+ floatValue = parseFloat(el.value),
460
+ value = (isCheckbox && el.value === 'on') || el.value === 'true' || (String(floatValue) === el.value ? floatValue : (el.value === 'false' ? false : el.value)),
461
+ nameKeys = el.name.match(settings.regExp.key) || [], k, pushKey= el.name.replace(/\[\]$/,'')
462
+ ;
463
+ if(!(pushKey in pushes)) {
464
+ pushes[pushKey] = 0;
465
+ pushValues[pushKey] = value;
466
+ } else if (Array.isArray(pushValues[pushKey])) {
467
+ pushValues[pushKey].push(value);
468
+ } else {
469
+ pushValues[pushKey] = [pushValues[pushKey] , value];
470
+ }
471
+ value = pushValues[pushKey];
472
+
473
+ while ((k = nameKeys.pop()) !== undefined) {
474
+ // foo[]
475
+ if (k == '' && !Array.isArray(value)){
476
+ value = build([], pushes[pushKey]++, value);
477
+ }
478
+ // foo[n]
479
+ else if (settings.regExp.fixed.test(k)) {
480
+ value = build([], k, value);
481
+ }
482
+ // foo; foo[bar]
483
+ else if (settings.regExp.named.test(k)) {
484
+ value = build({}, k, value);
485
+ }
486
+ }
487
+ formData = $.extend(true, formData, value);
488
+ });
489
+ }
490
+
441
491
  if(hasOtherData) {
442
- if(canSerialize) {
443
- module.debug('Extending existing data with form data', data, formData);
444
- data = $.extend(true, {}, data, formData);
445
- }
446
- else {
447
- module.error(error.missingSerialize);
448
- module.debug('Cant extend data. Replacing data with form data', data, formData);
492
+ module.debug('Extending existing data with form data', data, formData);
493
+ if(useFormDataApi) {
494
+ $.each(Object.keys(data),function(i, el){
495
+ formData.append(el, data[el]);
496
+ });
449
497
  data = formData;
498
+ } else {
499
+ data = $.extend(true, {}, data, formData);
450
500
  }
451
501
  }
452
502
  else {
@@ -698,6 +748,9 @@ $.api = $.fn.api = function(parameters) {
698
748
  },
699
749
 
700
750
  get: {
751
+ normalizedData: function(){
752
+ return typeof settings.data === "string" ? settings.data : JSON.stringify(settings.data, Object.keys(settings.data).sort());
753
+ },
701
754
  responseFromXHR: function(xhr) {
702
755
  return $.isPlainObject(xhr)
703
756
  ? (module.is.expectingJSON())
@@ -962,7 +1015,7 @@ $.api = $.fn.api = function(parameters) {
962
1015
  response
963
1016
  ;
964
1017
  passedArguments = passedArguments || queryArguments;
965
- context = element || context;
1018
+ context = context || element;
966
1019
  if(typeof query == 'string' && object !== undefined) {
967
1020
  query = query.split(/[\. ]/);
968
1021
  maxDepth = query.length - 1;
@@ -1083,6 +1136,8 @@ $.api.settings = {
1083
1136
  defaultData : true,
1084
1137
 
1085
1138
  // whether to serialize closest form
1139
+ // use true to convert complex named keys like a[b][1][c][] into a nested object
1140
+ // use 'formdata' for formdata web api
1086
1141
  serializeForm : false,
1087
1142
 
1088
1143
  // how long to wait before request should occur
@@ -1105,7 +1160,7 @@ $.api.settings = {
1105
1160
  responseAsync : false,
1106
1161
 
1107
1162
  // whether onResponse should work with response value without force converting into an object
1108
- rawResponse : false,
1163
+ rawResponse : true,
1109
1164
 
1110
1165
  // callbacks before request
1111
1166
  beforeSend : function(settings) { return settings; },
@@ -1141,7 +1196,6 @@ $.api.settings = {
1141
1196
  legacyParameters : 'You are using legacy API success callback names',
1142
1197
  method : 'The method you called is not defined',
1143
1198
  missingAction : 'API action used but no url was defined',
1144
- missingSerialize : 'jquery-serialize-object is required to add form data to an existing data object',
1145
1199
  missingURL : 'No URL specified for api event',
1146
1200
  noReturnedValue : 'The beforeSend callback must return a settings object, beforeSend ignored.',
1147
1201
  noStorage : 'Caching responses locally requires session storage',
@@ -1152,8 +1206,13 @@ $.api.settings = {
1152
1206
  },
1153
1207
 
1154
1208
  regExp : {
1155
- required : /\{\$*[A-z0-9]+\}/g,
1156
- optional : /\{\/\$*[A-z0-9]+\}/g,
1209
+ required : /\{\$*[a-z0-9]+\}/gi,
1210
+ optional : /\{\/\$*[a-z0-9]+\}/gi,
1211
+ validate: /^[a-z_][a-z0-9_-]*(?:\[[a-z0-9_-]*\])*$/i,
1212
+ key: /[a-z0-9_-]+|(?=\[\])/gi,
1213
+ push: /^$/,
1214
+ fixed: /^\d+$/,
1215
+ named: /^[a-z0-9_-]+$/i
1157
1216
  },
1158
1217
 
1159
1218
  className: {