fomantic-ui-sass 2.7.2 → 2.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -7
  3. data/app/assets/javascripts/semantic-ui/accordion.js +0 -6
  4. data/app/assets/javascripts/semantic-ui/api.js +1 -1
  5. data/app/assets/javascripts/semantic-ui/calendar.js +40 -12
  6. data/app/assets/javascripts/semantic-ui/checkbox.js +9 -0
  7. data/app/assets/javascripts/semantic-ui/dimmer.js +2 -4
  8. data/app/assets/javascripts/semantic-ui/dropdown.js +9 -11
  9. data/app/assets/javascripts/semantic-ui/embed.js +0 -1
  10. data/app/assets/javascripts/semantic-ui/form.js +10 -16
  11. data/app/assets/javascripts/semantic-ui/modal.js +28 -17
  12. data/app/assets/javascripts/semantic-ui/nag.js +1 -20
  13. data/app/assets/javascripts/semantic-ui/popup.js +0 -4
  14. data/app/assets/javascripts/semantic-ui/progress.js +161 -102
  15. data/app/assets/javascripts/semantic-ui/rating.js +0 -1
  16. data/app/assets/javascripts/semantic-ui/search.js +2 -7
  17. data/app/assets/javascripts/semantic-ui/shape.js +68 -145
  18. data/app/assets/javascripts/semantic-ui/sidebar.js +14 -12
  19. data/app/assets/javascripts/semantic-ui/site.js +0 -1
  20. data/app/assets/javascripts/semantic-ui/state.js +0 -1
  21. data/app/assets/javascripts/semantic-ui/sticky.js +1 -7
  22. data/app/assets/javascripts/semantic-ui/tab.js +17 -4
  23. data/app/assets/javascripts/semantic-ui/transition.js +7 -23
  24. data/app/assets/javascripts/semantic-ui/visibility.js +1 -3
  25. data/app/assets/stylesheets/semantic-ui/collections/_form.scss +4 -3
  26. data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +16 -16
  27. data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +8 -4
  28. data/app/assets/stylesheets/semantic-ui/collections/_table.scss +12 -3
  29. data/app/assets/stylesheets/semantic-ui/elements/_button.scss +3 -11
  30. data/app/assets/stylesheets/semantic-ui/elements/_container.scss +3 -3
  31. data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +1 -1
  32. data/app/assets/stylesheets/semantic-ui/elements/_input.scss +3 -0
  33. data/app/assets/stylesheets/semantic-ui/elements/_label.scss +7 -5
  34. data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +5 -5
  35. data/app/assets/stylesheets/semantic-ui/elements/_step.scss +21 -4
  36. data/app/assets/stylesheets/semantic-ui/globals/_site.scss +0 -1
  37. data/app/assets/stylesheets/semantic-ui/modules/_calendar.scss +4 -0
  38. data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +6 -0
  39. data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +1 -1
  40. data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +72 -3
  41. data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +60 -41
  42. data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +1 -1
  43. data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +73 -35
  44. data/app/assets/stylesheets/semantic-ui/modules/_search.scss +1 -1
  45. data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +5 -0
  46. data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +4 -1
  47. data/app/assets/stylesheets/semantic-ui/modules/_slider.scss +4 -4
  48. data/app/assets/stylesheets/semantic-ui/views/_ad.scss +1 -1
  49. data/app/assets/stylesheets/semantic-ui/views/_card.scss +189 -3
  50. data/app/assets/stylesheets/semantic-ui/views/_item.scss +3 -3
  51. data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +1 -1
  52. data/lib/fomantic/ui/sass/version.rb +2 -2
  53. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75f79f8eccb784bc41b3b8d4bc62d0fce2da4ea2d6bb82044c762465fc6ce048
4
- data.tar.gz: b899c36124cf3e3e44a69c62221044b5ca90e62b759cf0c52b5184c3ee9c5562
3
+ metadata.gz: ef20fb1c252044257d1c28fc77f1778d6cbd841d43503bfad759f085ef791436
4
+ data.tar.gz: ba73d1f502558cee4f155621707acc8128e173f0ad3590eec7425b04aa17f105
5
5
  SHA512:
6
- metadata.gz: d212bace1dccd4eff423b10474d5672dff4ac35d4b6c22f71bbb41beb4f1006e7d2ae4812d4e5f68086f47d3c41f1677397f0b3cb2fd111962427058726a588d
7
- data.tar.gz: 0f524b64e55fe87f046fd95690ffea9fbfd6d1080d25ebc62ede0a8651cecfffe5491e07dd653c07a03db6fa44844b3b8d85aa291655a98ff128b268b01161c7
6
+ metadata.gz: 6a2867ba287c417d665775963bb81b47c43914446cf2aa4fef1b0c42b30003ba25f3ff7db6b45e4c375980f3ffa51012c24a80e177b191e0a696dd68e14f100c
7
+ data.tar.gz: bf121ef4d63f49dbc72da1a5e0bfd007a05b8c1c7d710f851f110c58fe529f33fb5cac7bd349df0498e22182d9a0f226b82a2b4ec7bd0ea7755d1a837a4cf61a
data/README.md CHANGED
@@ -38,25 +38,25 @@ You can also include modules
38
38
 
39
39
  ## Custom font
40
40
 
41
- ```css
41
+ ```scss
42
42
  $font-url: 'http://fonts.useso.com/css?family=Lato:400,700,400italic,700italic&subset=latin';
43
43
  @import 'semantic-ui';
44
44
  ```
45
45
 
46
46
  ## Skip font loading
47
- ```css
47
+ ```scss
48
48
  $import-google-fonts: false;
49
49
  @import 'semantic-ui';
50
50
  ```
51
51
 
52
52
  ## Custom font family
53
- ```css
53
+ ```scss
54
54
  $font-family: 'custom-font-family';
55
55
  @import 'semantic-ui';
56
56
  ```
57
57
 
58
58
  ## All variables, you can custom any of that
59
- ```css
59
+ ```scss
60
60
  $import-google-fonts: true !default;
61
61
  $font-url: 'https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic&subset=latin,latin-ext' !default;
62
62
  $font-name: 'Lato' !default;
@@ -86,8 +86,8 @@ You can also load individual modules, provided you also require any dependencies
86
86
  Install the gem and create a new project using the gem.
87
87
 
88
88
  ```console
89
- gem install semantic-ui-sass
90
- compass create compass-project -r semantic-ui-sass --using semantic-ui
89
+ gem install fomantic-ui-sass
90
+ compass create compass-project -r fomantic-ui-sass --using semantic-ui
91
91
  ```
92
92
 
93
93
  This will sort a few things out:
@@ -106,7 +106,7 @@ gem install fomantic-ui-sass
106
106
 
107
107
  ```ruby
108
108
  # In config.rb
109
- require 'semantic-ui-sass'
109
+ require 'fomantic-ui-sass'
110
110
  ```
111
111
 
112
112
  ```console
@@ -34,12 +34,6 @@ $.fn.accordion = function(parameters) {
34
34
  methodInvoked = (typeof query == 'string'),
35
35
  queryArguments = [].slice.call(arguments, 1),
36
36
 
37
- requestAnimationFrame = window.requestAnimationFrame
38
- || window.mozRequestAnimationFrame
39
- || window.webkitRequestAnimationFrame
40
- || window.msRequestAnimationFrame
41
- || function(callback) { setTimeout(callback, 0); },
42
-
43
37
  returnedValue
44
38
  ;
45
39
  $allModules
@@ -577,7 +577,7 @@ $.api = $.fn.api = function(parameters) {
577
577
  if(xhr !== undefined) {
578
578
  module.debug('XHR produced a server error', status, httpMessage);
579
579
  // make sure we have an error to display to console
580
- if( xhr.status != 200 && httpMessage !== undefined && httpMessage !== '') {
580
+ if( (xhr.status < 200 || xhr.status >= 300) && httpMessage !== undefined && httpMessage !== '') {
581
581
  module.error(error.statusMessage + httpMessage, ajaxSettings.url);
582
582
  }
583
583
  settings.onError.call(context, errorMessage, $module, xhr);
@@ -183,7 +183,13 @@ $.fn.calendar = function(parameters) {
183
183
  }
184
184
  },
185
185
  date: function () {
186
- if ($input.length) {
186
+ if (settings.initialDate) {
187
+ var date = parser.date(settings.initialDate, settings);
188
+ module.set.date(date, settings.formatInput, false);
189
+ } else if ($module.data(metadata.date) !== undefined) {
190
+ var date = parser.date($module.data(metadata.date), settings);
191
+ module.set.date(date, settings.formatInput, false);
192
+ } else if ($input.length) {
187
193
  var val = $input.val();
188
194
  var date = parser.date(val, settings);
189
195
  module.set.date(date, settings.formatInput, false);
@@ -298,7 +304,7 @@ $.fn.calendar = function(parameters) {
298
304
  if(settings.showWeekNumbers) {
299
305
  cell = $('<th/>').appendTo(row);
300
306
  cell.text(settings.text.weekNo);
301
- cell.addClass(className.disabledCell);
307
+ cell.addClass(className.weekCell);
302
308
  textColumns--;
303
309
  }
304
310
  for (i = 0; i < textColumns; i++) {
@@ -315,7 +321,7 @@ $.fn.calendar = function(parameters) {
315
321
  if(isDay && settings.showWeekNumbers){
316
322
  cell = $('<th/>').appendTo(row);
317
323
  cell.text(module.get.weekOfYear(year,month,i+1-settings.firstDayOfWeek));
318
- cell.addClass(className.disabledCell);
324
+ cell.addClass(className.weekCell);
319
325
  }
320
326
  for (c = 0; c < textColumns; c++, i++) {
321
327
  var cellDate = isYear ? new Date(i, month, 1, hour, minute) :
@@ -328,7 +334,7 @@ $.fn.calendar = function(parameters) {
328
334
  cell.text(cellText);
329
335
  cell.data(metadata.date, cellDate);
330
336
  var adjacent = isDay && cellDate.getMonth() !== ((month + 12) % 12);
331
- var disabled = adjacent || !module.helper.isDateInRange(cellDate, mode) || settings.isDisabled(cellDate, mode) || module.helper.isDisabled(cellDate, mode);
337
+ var disabled = (!settings.selectAdjacentDays && adjacent) || !module.helper.isDateInRange(cellDate, mode) || settings.isDisabled(cellDate, mode) || module.helper.isDisabled(cellDate, mode) || !module.helper.isEnabled(cellDate, mode);
332
338
  if (disabled) {
333
339
  var disabledReason = module.helper.disabledReason(cellDate, mode);
334
340
  if (disabledReason !== null) {
@@ -398,7 +404,7 @@ $.fn.calendar = function(parameters) {
398
404
  var inRange = !rangeDate ? false :
399
405
  ((!!startDate && module.helper.isDateInRange(cellDate, mode, startDate, rangeDate)) ||
400
406
  (!!endDate && module.helper.isDateInRange(cellDate, mode, rangeDate, endDate)));
401
- cell.toggleClass(className.focusCell, focused && (!isTouch || isTouchDown) && !adjacent && !disabled);
407
+ cell.toggleClass(className.focusCell, focused && (!isTouch || isTouchDown) && (!adjacent || (settings.selectAdjacentDays && adjacent)) && !disabled);
402
408
  cell.toggleClass(className.rangeCell, inRange && !active && !disabled);
403
409
  });
404
410
  }
@@ -518,7 +524,7 @@ $.fn.calendar = function(parameters) {
518
524
  //enter
519
525
  var mode = module.get.mode();
520
526
  var date = module.get.focusDate();
521
- if (date && !settings.isDisabled(date, mode) && !module.helper.isDisabled(date, mode)) {
527
+ if (date && !settings.isDisabled(date, mode) && !module.helper.isDisabled(date, mode) && module.helper.isEnabled(date, mode)) {
522
528
  module.selectDate(date);
523
529
  }
524
530
  //disable form submission:
@@ -569,7 +575,7 @@ $.fn.calendar = function(parameters) {
569
575
  }();
570
576
  },
571
577
  date: function () {
572
- return $module.data(metadata.date) || null;
578
+ return module.helper.sanitiseDate($module.data(metadata.date)) || null;
573
579
  },
574
580
  focusDate: function () {
575
581
  return $module.data(metadata.focusDate) || null;
@@ -822,6 +828,20 @@ $.fn.calendar = function(parameters) {
822
828
  }
823
829
  }));
824
830
  },
831
+ isEnabled: function(date, mode) {
832
+ if (mode === 'day') {
833
+ return settings.enabledDates.length == 0 || settings.enabledDates.some(function(d){
834
+ if (d instanceof Date) {
835
+ return module.helper.dateEqual(date, d, mode);
836
+ }
837
+ if (d !== null && typeof d === 'object') {
838
+ return module.helper.dateEqual(date, d[metadata.date], mode);
839
+ }
840
+ });
841
+ } else {
842
+ return true;
843
+ }
844
+ },
825
845
  disabledReason: function(date, mode) {
826
846
  if (mode === 'day') {
827
847
  for (var i = 0; i < settings.disabledDates.length; i++) {
@@ -1122,6 +1142,10 @@ $.fn.calendar.settings = {
1122
1142
  showWeekNumbers : null, // show Number of Week at the very first column of a dayView
1123
1143
  disabledDates : [], // specific day(s) which won't be selectable and contain additional information.
1124
1144
  disabledDaysOfWeek : [], // day(s) which won't be selectable(s) (0 = Sunday)
1145
+ enabledDates : [], // specific day(s) which will be selectable, all other days will be disabled
1146
+ centuryBreak : 60, // starting short year until 99 where it will be assumed to belong to the last century
1147
+ currentCentury : 2000, // century to be added to 2-digit years (00 to {centuryBreak}-1)
1148
+ selectAdjacentDays : false, // The calendar can show dates from adjacent month. These adjacent month dates can also be made selectable.
1125
1149
  // popup options ('popup', 'on', 'hoverable', and show/hide callbacks are overridden)
1126
1150
  popupOptions: {
1127
1151
  position: 'bottom left',
@@ -1279,13 +1303,16 @@ $.fn.calendar.settings = {
1279
1303
  }
1280
1304
  }
1281
1305
 
1282
- //year > 59
1306
+ //year > settings.centuryBreak
1283
1307
  for (i = 0; i < numbers.length; i++) {
1284
1308
  j = parseInt(numbers[i]);
1285
1309
  if (isNaN(j)) {
1286
1310
  continue;
1287
1311
  }
1288
- if (j > 59) {
1312
+ if (j >= settings.centuryBreak && i === numbers.length-1) {
1313
+ if (j <= 99) {
1314
+ j += settings.currentCentury - 100;
1315
+ }
1289
1316
  year = j;
1290
1317
  numbers.splice(i, 1);
1291
1318
  break;
@@ -1321,15 +1348,15 @@ $.fn.calendar.settings = {
1321
1348
  }
1322
1349
  }
1323
1350
 
1324
- //year <= 59
1351
+ //year <= settings.centuryBreak
1325
1352
  if (year < 0) {
1326
1353
  for (i = numbers.length - 1; i >= 0; i--) {
1327
1354
  j = parseInt(numbers[i]);
1328
1355
  if (isNaN(j)) {
1329
1356
  continue;
1330
1357
  }
1331
- if (j < 99) {
1332
- j += 2000;
1358
+ if (j <= 99) {
1359
+ j += settings.currentCentury;
1333
1360
  }
1334
1361
  year = j;
1335
1362
  numbers.splice(i, 1);
@@ -1465,6 +1492,7 @@ $.fn.calendar.settings = {
1465
1492
  link: 'link',
1466
1493
  cell: 'link',
1467
1494
  disabledCell: 'disabled',
1495
+ weekCell: 'disabled',
1468
1496
  adjacentCell: 'adjacent',
1469
1497
  activeCell: 'active',
1470
1498
  rangeCell: 'range',
@@ -174,6 +174,13 @@ $.fn.checkbox = function(parameters) {
174
174
  }
175
175
  },
176
176
 
177
+ preventDefaultOnInputTarget: function() {
178
+ if(typeof event !== 'undefined' && $(event.target).is(selector.input)) {
179
+ module.verbose('Preventing default check action after manual check action');
180
+ event.preventDefault();
181
+ }
182
+ },
183
+
177
184
  event: {
178
185
  change: function(event) {
179
186
  if( !module.should.ignoreCallbacks() ) {
@@ -263,6 +270,7 @@ $.fn.checkbox = function(parameters) {
263
270
  settings.onChecked.call(input);
264
271
  module.trigger.change();
265
272
  }
273
+ module.preventDefaultOnInputTarget();
266
274
  },
267
275
 
268
276
  uncheck: function() {
@@ -275,6 +283,7 @@ $.fn.checkbox = function(parameters) {
275
283
  settings.onUnchecked.call(input);
276
284
  module.trigger.change();
277
285
  }
286
+ module.preventDefaultOnInputTarget();
278
287
  },
279
288
 
280
289
  indeterminate: function() {
@@ -306,10 +306,8 @@ $.fn.dimmer = function(parameters) {
306
306
  queue : false,
307
307
  duration : module.get.duration(),
308
308
  useFailSafe : true,
309
- onStart : function() {
310
- module.remove.dimmed();
311
- },
312
309
  onComplete : function() {
310
+ module.remove.dimmed();
313
311
  module.remove.variation();
314
312
  module.remove.active();
315
313
  callback();
@@ -319,10 +317,10 @@ $.fn.dimmer = function(parameters) {
319
317
  }
320
318
  else {
321
319
  module.verbose('Hiding dimmer with javascript');
322
- module.remove.dimmed();
323
320
  $dimmer
324
321
  .stop()
325
322
  .fadeOut(module.get.duration(), function() {
323
+ module.remove.dimmed();
326
324
  module.remove.active();
327
325
  $dimmer.removeAttr('style');
328
326
  callback();
@@ -81,6 +81,7 @@ $.fn.dropdown = function(parameters) {
81
81
  activated = false,
82
82
  itemActivated = false,
83
83
  internalChange = false,
84
+ iconClicked = false,
84
85
  element = this,
85
86
  instance = $module.data(moduleNamespace),
86
87
 
@@ -751,7 +752,7 @@ $.fn.dropdown = function(parameters) {
751
752
  }
752
753
  var preSelected = $input.val();
753
754
  if(!Array.isArray(preSelected)) {
754
- preSelected = preSelected!=="" ? preSelected.split(settings.delimiter) : [];
755
+ preSelected = preSelected && preSelected!=="" ? preSelected.split(settings.delimiter) : [];
755
756
  }
756
757
  $.each(preSelected,function(index,value){
757
758
  $item.filter('[data-value="'+value+'"]')
@@ -1061,12 +1062,12 @@ $.fn.dropdown = function(parameters) {
1061
1062
  }
1062
1063
  },
1063
1064
  search: {
1064
- focus: function() {
1065
+ focus: function(event) {
1065
1066
  activated = true;
1066
1067
  if(module.is.multiple()) {
1067
1068
  module.remove.activeLabel();
1068
1069
  }
1069
- if(settings.showOnFocus || event.type !== 'focus') {
1070
+ if(settings.showOnFocus || (event.type !== 'focus' && event.type !== 'focusin')) {
1070
1071
  module.search();
1071
1072
  }
1072
1073
  },
@@ -1095,6 +1096,7 @@ $.fn.dropdown = function(parameters) {
1095
1096
  },
1096
1097
  icon: {
1097
1098
  click: function(event) {
1099
+ iconClicked=true;
1098
1100
  if(module.has.search()) {
1099
1101
  if(!module.is.active()) {
1100
1102
  if(settings.showOnFocus){
@@ -1669,7 +1671,7 @@ $.fn.dropdown = function(parameters) {
1669
1671
  $target = $(event.target),
1670
1672
  $label = $target.closest(selector.siblingLabel),
1671
1673
  inVisibleDOM = document.body.contains(event.target),
1672
- notOnLabel = ($module.find($label).length === 0),
1674
+ notOnLabel = ($module.find($label).length === 0 || !(module.is.multiple() && settings.useLabels)),
1673
1675
  notInMenu = ($target.closest($menu).length === 0)
1674
1676
  ;
1675
1677
  callback = $.isFunction(callback)
@@ -2613,8 +2615,7 @@ $.fn.dropdown = function(parameters) {
2613
2615
  },
2614
2616
  selected: function(value, $selectedItem) {
2615
2617
  var
2616
- isMultiple = module.is.multiple(),
2617
- $userSelectedItem
2618
+ isMultiple = module.is.multiple()
2618
2619
  ;
2619
2620
  $selectedItem = (settings.allowAdditions)
2620
2621
  ? $selectedItem || module.get.itemWithAdditions(value)
@@ -2821,7 +2822,6 @@ $.fn.dropdown = function(parameters) {
2821
2822
  hasCount = (message.search('{count}') !== -1),
2822
2823
  hasMaxCount = (message.search('{maxCount}') !== -1),
2823
2824
  hasTerm = (message.search('{term}') !== -1),
2824
- values,
2825
2825
  count,
2826
2826
  query
2827
2827
  ;
@@ -3132,13 +3132,14 @@ $.fn.dropdown = function(parameters) {
3132
3132
  return ( $input.is('select') );
3133
3133
  },
3134
3134
  minCharacters: function(searchTerm) {
3135
- if(settings.minCharacters) {
3135
+ if(settings.minCharacters && !iconClicked) {
3136
3136
  searchTerm = (searchTerm !== undefined)
3137
3137
  ? String(searchTerm)
3138
3138
  : String(module.get.query())
3139
3139
  ;
3140
3140
  return (searchTerm.length >= settings.minCharacters);
3141
3141
  }
3142
+ iconClicked=false;
3142
3143
  return true;
3143
3144
  },
3144
3145
  firstLetter: function($item, letter) {
@@ -3508,9 +3509,6 @@ $.fn.dropdown = function(parameters) {
3508
3509
  hide: function(callback, $subMenu) {
3509
3510
  var
3510
3511
  $currentMenu = $subMenu || $menu,
3511
- duration = ($subMenu)
3512
- ? (settings.duration * 0.9)
3513
- : settings.duration,
3514
3512
  start = ($subMenu)
3515
3513
  ? function() {}
3516
3514
  : function() {
@@ -58,7 +58,6 @@ $.fn.embed = function(parameters) {
58
58
  eventNamespace = '.' + namespace,
59
59
  moduleNamespace = 'module-' + namespace,
60
60
 
61
- $window = $(window),
62
61
  $module = $(this),
63
62
  $placeholder = $module.find(selector.placeholder),
64
63
  $icon = $module.find(selector.icon),
@@ -473,8 +473,7 @@ $.fn.form = function(parameters) {
473
473
  keys = Object.keys(parameters),
474
474
  isLegacySettings = (keys.length > 0)
475
475
  ? (parameters[keys[0]].identifier !== undefined && parameters[keys[0]].rules !== undefined)
476
- : false,
477
- ruleKeys
476
+ : false
478
477
  ;
479
478
  if(isLegacySettings) {
480
479
  // 1.x (ducktyped)
@@ -581,7 +580,6 @@ $.fn.form = function(parameters) {
581
580
  $fields.each(function(index, field) {
582
581
  var
583
582
  $field = $(field),
584
- type = $field.prop('type'),
585
583
  name = $field.prop('name'),
586
584
  value = $field.val(),
587
585
  isCheckbox = $field.is(selector.checkbox),
@@ -764,12 +762,12 @@ $.fn.form = function(parameters) {
764
762
  ? rule
765
763
  : [rule]
766
764
  ;
767
- if(rule == undefined) {
768
- module.debug('Removed all rules');
769
- validation[field].rules = [];
765
+ if(validation[field] === undefined || !Array.isArray(validation[field].rules)) {
770
766
  return;
771
767
  }
772
- if(validation[field] == undefined || !Array.isArray(validation[field].rules)) {
768
+ if(rule === undefined) {
769
+ module.debug('Removed all rules');
770
+ validation[field].rules = [];
773
771
  return;
774
772
  }
775
773
  $.each(validation[field].rules, function(index, rule) {
@@ -792,7 +790,7 @@ $.fn.form = function(parameters) {
792
790
  // alias
793
791
  rules: function(field, rules) {
794
792
  if(Array.isArray(field)) {
795
- $.each(fields, function(index, field) {
793
+ $.each(field, function(index, field) {
796
794
  module.remove.rule(field, rules);
797
795
  });
798
796
  }
@@ -924,8 +922,7 @@ $.fn.form = function(parameters) {
924
922
 
925
923
  form: function(event, ignoreCallbacks) {
926
924
  var
927
- values = module.get.values(),
928
- apiRequest
925
+ values = module.get.values()
929
926
  ;
930
927
 
931
928
  // input keydown event will fire submit repeatedly by browser default
@@ -1035,14 +1032,13 @@ $.fn.form = function(parameters) {
1035
1032
  rule: function(field, rule, internal) {
1036
1033
  var
1037
1034
  $field = module.get.field(field.identifier),
1038
- type = rule.type,
1039
1035
  ancillary = module.get.ancillaryValue(rule),
1040
1036
  ruleName = module.get.ruleName(rule),
1041
1037
  ruleFunction = settings.rules[ruleName],
1042
1038
  invalidFields = [],
1043
- isRadio = $field.is(selector.radio),
1039
+ isCheckbox = $field.is(selector.checkbox),
1044
1040
  isValid = function(field){
1045
- var value = (isRadio ? $(field).filter(':checked').val() : $(field).val());
1041
+ var value = (isCheckbox ? $(field).filter(':checked').val() : $(field).val());
1046
1042
  // cast to string avoiding encoding special values
1047
1043
  value = (value === undefined || value === '' || value === null)
1048
1044
  ? ''
@@ -1055,7 +1051,7 @@ $.fn.form = function(parameters) {
1055
1051
  module.error(error.noRule, ruleName);
1056
1052
  return;
1057
1053
  }
1058
- if(isRadio) {
1054
+ if(isCheckbox) {
1059
1055
  if (!isValid($field)) {
1060
1056
  invalidFields = $field;
1061
1057
  }
@@ -1554,7 +1550,6 @@ $.fn.form.settings = {
1554
1550
  // matches another field
1555
1551
  match: function(value, identifier) {
1556
1552
  var
1557
- $form = $(this),
1558
1553
  matchingValue
1559
1554
  ;
1560
1555
  if( $('[data-validate="'+ identifier +'"]').length > 0 ) {
@@ -1579,7 +1574,6 @@ $.fn.form.settings = {
1579
1574
  different: function(value, identifier) {
1580
1575
  // use either id or name of field
1581
1576
  var
1582
- $form = $(this),
1583
1577
  matchingValue
1584
1578
  ;
1585
1579
  if( $('[data-validate="'+ identifier +'"]').length > 0 ) {