fomantic-ui 2.9.0-beta.26 → 2.9.0-beta.262

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/.all-contributorsrc +206 -3
  2. package/.github/workflows/ci.yml +4 -4
  3. package/.github/workflows/nightly.yml +4 -4
  4. package/.github/workflows/release.yml +30 -0
  5. package/CONTRIBUTORS.md +75 -37
  6. package/README.md +8 -8
  7. package/dist/components/accordion.css +162 -26
  8. package/dist/components/accordion.js +1 -1
  9. package/dist/components/accordion.min.css +2 -2
  10. package/dist/components/accordion.min.js +2 -2
  11. package/dist/components/ad.css +1 -1
  12. package/dist/components/ad.min.css +1 -1
  13. package/dist/components/api.js +34 -30
  14. package/dist/components/api.min.js +3 -3
  15. package/dist/components/breadcrumb.css +1 -1
  16. package/dist/components/breadcrumb.min.css +1 -1
  17. package/dist/components/button.css +176 -134
  18. package/dist/components/button.min.css +2 -2
  19. package/dist/components/calendar.css +18 -1
  20. package/dist/components/calendar.js +10 -9
  21. package/dist/components/calendar.min.css +2 -2
  22. package/dist/components/calendar.min.js +3 -3
  23. package/dist/components/card.css +26 -19
  24. package/dist/components/card.min.css +2 -2
  25. package/dist/components/checkbox.css +2 -1
  26. package/dist/components/checkbox.js +17 -11
  27. package/dist/components/checkbox.min.css +2 -2
  28. package/dist/components/checkbox.min.js +3 -3
  29. package/dist/components/comment.css +11 -11
  30. package/dist/components/comment.min.css +1 -1
  31. package/dist/components/container.css +94 -1
  32. package/dist/components/container.min.css +2 -2
  33. package/dist/components/dimmer.css +28 -14
  34. package/dist/components/dimmer.js +11 -5
  35. package/dist/components/dimmer.min.css +2 -2
  36. package/dist/components/dimmer.min.js +3 -3
  37. package/dist/components/divider.css +1 -1
  38. package/dist/components/divider.min.css +1 -1
  39. package/dist/components/dropdown.css +49 -13
  40. package/dist/components/dropdown.js +66 -39
  41. package/dist/components/dropdown.min.css +2 -2
  42. package/dist/components/dropdown.min.js +3 -3
  43. package/dist/components/embed.css +1 -1
  44. package/dist/components/embed.js +1 -1
  45. package/dist/components/embed.min.css +1 -1
  46. package/dist/components/embed.min.js +2 -2
  47. package/dist/components/emoji.css +10147 -8139
  48. package/dist/components/emoji.min.css +1 -1
  49. package/dist/components/feed.css +28 -28
  50. package/dist/components/feed.min.css +2 -2
  51. package/dist/components/flag.css +734 -625
  52. package/dist/components/flag.min.css +2 -2
  53. package/dist/components/form.css +118 -55
  54. package/dist/components/form.js +38 -29
  55. package/dist/components/form.min.css +2 -2
  56. package/dist/components/form.min.js +3 -3
  57. package/dist/components/grid.css +11 -8
  58. package/dist/components/grid.min.css +2 -2
  59. package/dist/components/header.css +3 -1
  60. package/dist/components/header.min.css +2 -2
  61. package/dist/components/icon.css +126 -47
  62. package/dist/components/icon.min.css +2 -2
  63. package/dist/components/image.css +1 -1
  64. package/dist/components/image.min.css +1 -1
  65. package/dist/components/input.css +742 -17
  66. package/dist/components/input.min.css +2 -2
  67. package/dist/components/item.css +13 -13
  68. package/dist/components/item.min.css +1 -1
  69. package/dist/components/label.css +1 -1
  70. package/dist/components/label.min.css +1 -1
  71. package/dist/components/list.css +1 -1
  72. package/dist/components/list.min.css +1 -1
  73. package/dist/components/loader.css +1 -1
  74. package/dist/components/loader.min.css +1 -1
  75. package/dist/components/menu.css +29 -5
  76. package/dist/components/menu.min.css +1 -1
  77. package/dist/components/message.css +41 -41
  78. package/dist/components/message.min.css +2 -2
  79. package/dist/components/modal.css +13 -1
  80. package/dist/components/modal.js +127 -49
  81. package/dist/components/modal.min.css +2 -2
  82. package/dist/components/modal.min.js +3 -3
  83. package/dist/components/nag.css +1 -1
  84. package/dist/components/nag.js +1 -1
  85. package/dist/components/nag.min.css +1 -1
  86. package/dist/components/nag.min.js +2 -2
  87. package/dist/components/placeholder.css +1 -1
  88. package/dist/components/placeholder.min.css +1 -1
  89. package/dist/components/popup.css +1 -1
  90. package/dist/components/popup.js +2 -2
  91. package/dist/components/popup.min.css +1 -1
  92. package/dist/components/popup.min.js +3 -3
  93. package/dist/components/progress.css +1 -1
  94. package/dist/components/progress.js +4 -1
  95. package/dist/components/progress.min.css +1 -1
  96. package/dist/components/progress.min.js +3 -3
  97. package/dist/components/rail.css +1 -1
  98. package/dist/components/rail.min.css +1 -1
  99. package/dist/components/rating.css +1 -1
  100. package/dist/components/rating.js +1 -1
  101. package/dist/components/rating.min.css +1 -1
  102. package/dist/components/rating.min.js +2 -2
  103. package/dist/components/reset.css +1 -1
  104. package/dist/components/reset.min.css +1 -1
  105. package/dist/components/reveal.css +1 -1
  106. package/dist/components/reveal.min.css +1 -1
  107. package/dist/components/search.css +1 -1
  108. package/dist/components/search.js +2 -2
  109. package/dist/components/search.min.css +1 -1
  110. package/dist/components/search.min.js +3 -3
  111. package/dist/components/segment.css +91 -7
  112. package/dist/components/segment.min.css +2 -2
  113. package/dist/components/shape.css +1 -1
  114. package/dist/components/shape.js +3 -3
  115. package/dist/components/shape.min.css +1 -1
  116. package/dist/components/shape.min.js +3 -3
  117. package/dist/components/sidebar.css +4 -2
  118. package/dist/components/sidebar.js +8 -6
  119. package/dist/components/sidebar.min.css +2 -2
  120. package/dist/components/sidebar.min.js +3 -3
  121. package/dist/components/site.css +61 -39
  122. package/dist/components/site.js +1 -1
  123. package/dist/components/site.min.css +2 -2
  124. package/dist/components/site.min.js +2 -2
  125. package/dist/components/slider.js +1 -1
  126. package/dist/components/slider.min.js +2 -2
  127. package/dist/components/state.js +1 -1
  128. package/dist/components/state.min.js +2 -2
  129. package/dist/components/statistic.css +1 -1
  130. package/dist/components/statistic.min.css +1 -1
  131. package/dist/components/step.css +4 -4
  132. package/dist/components/step.min.css +2 -2
  133. package/dist/components/sticky.css +1 -1
  134. package/dist/components/sticky.js +1 -1
  135. package/dist/components/sticky.min.css +1 -1
  136. package/dist/components/sticky.min.js +2 -2
  137. package/dist/components/tab.css +1 -1
  138. package/dist/components/tab.js +23 -5
  139. package/dist/components/tab.min.css +1 -1
  140. package/dist/components/tab.min.js +3 -3
  141. package/dist/components/table.css +1168 -26
  142. package/dist/components/table.min.css +2 -2
  143. package/dist/components/text.css +1 -1
  144. package/dist/components/text.min.css +1 -1
  145. package/dist/components/toast.css +39 -1
  146. package/dist/components/toast.js +56 -28
  147. package/dist/components/toast.min.css +2 -2
  148. package/dist/components/toast.min.js +3 -3
  149. package/dist/components/transition.css +1 -1
  150. package/dist/components/transition.js +21 -16
  151. package/dist/components/transition.min.css +1 -1
  152. package/dist/components/transition.min.js +3 -3
  153. package/dist/components/visibility.js +1 -1
  154. package/dist/components/visibility.min.js +2 -2
  155. package/dist/semantic.css +21916 -16238
  156. package/dist/semantic.js +433 -246
  157. package/dist/semantic.min.css +3 -3
  158. package/dist/semantic.min.js +3 -3
  159. package/dist/themes/default/assets/fonts/brand-icons.eot +0 -0
  160. package/dist/themes/default/assets/fonts/brand-icons.svg +801 -654
  161. package/dist/themes/default/assets/fonts/brand-icons.ttf +0 -0
  162. package/dist/themes/default/assets/fonts/brand-icons.woff +0 -0
  163. package/dist/themes/default/assets/fonts/brand-icons.woff2 +0 -0
  164. package/dist/themes/default/assets/fonts/icons.eot +0 -0
  165. package/dist/themes/default/assets/fonts/icons.svg +1175 -1079
  166. package/dist/themes/default/assets/fonts/icons.ttf +0 -0
  167. package/dist/themes/default/assets/fonts/icons.woff +0 -0
  168. package/dist/themes/default/assets/fonts/icons.woff2 +0 -0
  169. package/dist/themes/default/assets/fonts/outline-icons.eot +0 -0
  170. package/dist/themes/default/assets/fonts/outline-icons.svg +93 -95
  171. package/dist/themes/default/assets/fonts/outline-icons.ttf +0 -0
  172. package/dist/themes/default/assets/fonts/outline-icons.woff +0 -0
  173. package/dist/themes/default/assets/fonts/outline-icons.woff2 +0 -0
  174. package/examples/assets/library/iframe-content.js +8 -8
  175. package/examples/assets/library/iframe.js +3 -3
  176. package/package.json +10 -9
  177. package/src/definitions/behaviors/api.js +33 -29
  178. package/src/definitions/behaviors/form.js +37 -28
  179. package/src/definitions/collections/form.less +204 -140
  180. package/src/definitions/collections/grid.less +716 -680
  181. package/src/definitions/collections/menu.less +173 -126
  182. package/src/definitions/collections/message.less +48 -46
  183. package/src/definitions/collections/table.less +849 -262
  184. package/src/definitions/elements/button.less +586 -449
  185. package/src/definitions/elements/container.less +145 -8
  186. package/src/definitions/elements/emoji.less +15 -9
  187. package/src/definitions/elements/flag.less +7 -17
  188. package/src/definitions/elements/header.less +44 -35
  189. package/src/definitions/elements/icon.less +38 -31
  190. package/src/definitions/elements/input.less +264 -22
  191. package/src/definitions/elements/label.less +92 -91
  192. package/src/definitions/elements/list.less +55 -45
  193. package/src/definitions/elements/loader.less +30 -29
  194. package/src/definitions/elements/segment.less +147 -28
  195. package/src/definitions/elements/step.less +52 -48
  196. package/src/definitions/elements/text.less +17 -15
  197. package/src/definitions/globals/site.less +23 -2
  198. package/src/definitions/modules/accordion.less +175 -24
  199. package/src/definitions/modules/calendar.js +9 -8
  200. package/src/definitions/modules/calendar.less +20 -0
  201. package/src/definitions/modules/checkbox.js +16 -10
  202. package/src/definitions/modules/checkbox.less +34 -178
  203. package/src/definitions/modules/dimmer.js +10 -4
  204. package/src/definitions/modules/dimmer.less +21 -8
  205. package/src/definitions/modules/dropdown.js +65 -38
  206. package/src/definitions/modules/dropdown.less +145 -94
  207. package/src/definitions/modules/modal.js +126 -48
  208. package/src/definitions/modules/modal.less +12 -0
  209. package/src/definitions/modules/nag.less +20 -19
  210. package/src/definitions/modules/popup.js +1 -1
  211. package/src/definitions/modules/progress.js +3 -0
  212. package/src/definitions/modules/progress.less +19 -18
  213. package/src/definitions/modules/rating.less +35 -34
  214. package/src/definitions/modules/search.js +1 -1
  215. package/src/definitions/modules/search.less +32 -16
  216. package/src/definitions/modules/shape.js +2 -2
  217. package/src/definitions/modules/sidebar.js +7 -5
  218. package/src/definitions/modules/sidebar.less +33 -19
  219. package/src/definitions/modules/slider.less +39 -38
  220. package/src/definitions/modules/tab.js +22 -4
  221. package/src/definitions/modules/toast.js +55 -27
  222. package/src/definitions/modules/toast.less +48 -16
  223. package/src/definitions/modules/transition.js +20 -15
  224. package/src/definitions/views/card.less +402 -361
  225. package/src/definitions/views/comment.less +92 -81
  226. package/src/definitions/views/feed.less +164 -144
  227. package/src/definitions/views/item.less +249 -196
  228. package/src/definitions/views/statistic.less +90 -88
  229. package/src/themes/bookish/elements/header.overrides +1 -1
  230. package/src/themes/chubby/elements/button.overrides +1 -1
  231. package/src/themes/chubby/elements/header.overrides +1 -1
  232. package/src/themes/default/assets/fonts/brand-icons.eot +0 -0
  233. package/src/themes/default/assets/fonts/brand-icons.svg +801 -654
  234. package/src/themes/default/assets/fonts/brand-icons.ttf +0 -0
  235. package/src/themes/default/assets/fonts/brand-icons.woff +0 -0
  236. package/src/themes/default/assets/fonts/brand-icons.woff2 +0 -0
  237. package/src/themes/default/assets/fonts/icons.eot +0 -0
  238. package/src/themes/default/assets/fonts/icons.svg +1175 -1079
  239. package/src/themes/default/assets/fonts/icons.ttf +0 -0
  240. package/src/themes/default/assets/fonts/icons.woff +0 -0
  241. package/src/themes/default/assets/fonts/icons.woff2 +0 -0
  242. package/src/themes/default/assets/fonts/outline-icons.eot +0 -0
  243. package/src/themes/default/assets/fonts/outline-icons.svg +93 -95
  244. package/src/themes/default/assets/fonts/outline-icons.ttf +0 -0
  245. package/src/themes/default/assets/fonts/outline-icons.woff +0 -0
  246. package/src/themes/default/assets/fonts/outline-icons.woff2 +0 -0
  247. package/src/themes/default/collections/form.variables +4 -0
  248. package/src/themes/default/collections/menu.variables +6 -0
  249. package/src/themes/default/collections/table.variables +52 -0
  250. package/src/themes/default/elements/button.variables +7 -1
  251. package/src/themes/default/elements/container.variables +12 -0
  252. package/src/themes/default/elements/emoji.overrides +1734 -1232
  253. package/src/themes/default/elements/flag.overrides +1641 -986
  254. package/src/themes/default/elements/flag.variables +7 -5
  255. package/src/themes/default/elements/icon.overrides +75 -48
  256. package/src/themes/default/elements/icon.variables +1 -0
  257. package/src/themes/default/elements/input.variables +15 -0
  258. package/src/themes/default/elements/segment.variables +8 -0
  259. package/src/themes/default/elements/step.overrides +1 -1
  260. package/src/themes/default/globals/site.variables +6 -0
  261. package/src/themes/default/globals/variation.variables +139 -6
  262. package/src/themes/default/modules/accordion.variables +49 -2
  263. package/src/themes/default/modules/calendar.variables +3 -0
  264. package/src/themes/default/modules/checkbox.variables +5 -5
  265. package/src/themes/default/modules/dimmer.variables +1 -1
  266. package/src/themes/default/modules/dropdown.variables +4 -10
  267. package/src/themes/default/modules/modal.variables +13 -0
  268. package/src/themes/default/modules/toast.variables +3 -0
  269. package/src/themes/famfamfam/elements/flag.overrides +1026 -0
  270. package/src/themes/famfamfam/elements/flag.variables +13 -0
  271. package/src/themes/instagram/views/card.overrides +1 -1
  272. package/src/themes/joypixels/elements/emoji.overrides +1759 -1257
  273. package/src/themes/joypixels/elements/emoji.variables +1 -1
  274. package/src/themes/material/collections/menu.overrides +1 -1
  275. package/src/themes/material/elements/button.overrides +1 -1
  276. package/src/themes/material/elements/header.overrides +1 -1
  277. package/src/themes/material/globals/site.variables +0 -1
  278. package/src/themes/material/modules/dropdown.overrides +1 -1
  279. package/src/themes/material/modules/modal.overrides +1 -1
  280. package/src/themes/rtl/globals/site.overrides +1 -1
  281. package/src/themes/twitter/elements/emoji.overrides +1734 -1232
  282. package/tasks/build/css.js +6 -1
  283. package/tasks/config/project/install.js +11 -5
  284. package/tasks/install.js +1 -0
  285. package/test/helpers/sinon.js +2 -2
package/dist/semantic.js CHANGED
@@ -1,15 +1,15 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.26
2
+ * # Fomantic UI - 2.9.0-beta.262
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
6
- * Copyright 2021 Contributors
6
+ * Copyright 2022 Contributors
7
7
  * Released under the MIT license
8
8
  * http://opensource.org/licenses/MIT
9
9
  *
10
10
  */
11
11
  /*!
12
- * # Fomantic-UI 2.9.0-beta.26 - Site
12
+ * # Fomantic-UI 2.9.0-beta.262 - Site
13
13
  * http://github.com/fomantic/Fomantic-UI/
14
14
  *
15
15
  *
@@ -503,7 +503,7 @@ $.extend($.expr[ ":" ], {
503
503
  })( jQuery, window, document );
504
504
 
505
505
  /*!
506
- * # Fomantic-UI 2.9.0-beta.26 - Form Validation
506
+ * # Fomantic-UI 2.9.0-beta.262 - Form Validation
507
507
  * http://github.com/fomantic/Fomantic-UI/
508
508
  *
509
509
  *
@@ -635,6 +635,11 @@ $.fn.form = function(parameters) {
635
635
  $reset = $module.find(selector.reset);
636
636
  },
637
637
 
638
+ refreshEvents: function() {
639
+ module.removeEvents();
640
+ module.bindEvents();
641
+ },
642
+
638
643
  submit: function() {
639
644
  module.verbose('Submitting form', $module);
640
645
  submitting = true;
@@ -895,7 +900,6 @@ $.fn.form = function(parameters) {
895
900
  $module.off(eventNamespace);
896
901
  $field.off(eventNamespace);
897
902
  $submit.off(eventNamespace);
898
- $field.off(eventNamespace);
899
903
  },
900
904
 
901
905
  event: {
@@ -923,6 +927,7 @@ $.fn.form = function(parameters) {
923
927
  $field.one('keyup' + eventNamespace, module.event.field.keyup);
924
928
  module.submit();
925
929
  module.debug('Enter pressed on input submitting form');
930
+ event.preventDefault();
926
931
  }
927
932
  keyHeldDown = true;
928
933
  }
@@ -1047,7 +1052,7 @@ $.fn.form = function(parameters) {
1047
1052
  parts,
1048
1053
  suffixPrompt
1049
1054
  ;
1050
- if(ancillary && ancillary.indexOf('..') >= 0) {
1055
+ if(ancillary && ['integer', 'decimal', 'number'].indexOf(ruleName) >= 0 && ancillary.indexOf('..') >= 0) {
1051
1056
  parts = ancillary.split('..', 2);
1052
1057
  if(!rule.prompt) {
1053
1058
  suffixPrompt = (
@@ -1089,7 +1094,7 @@ $.fn.form = function(parameters) {
1089
1094
  if(isLegacySettings) {
1090
1095
  // 1.x (ducktyped)
1091
1096
  settings = $.extend(true, {}, $.fn.form.settings, legacyParameters);
1092
- validation = $.extend({}, $.fn.form.settings.defaults, parameters);
1097
+ validation = $.extend(true, {}, $.fn.form.settings.defaults, parameters);
1093
1098
  module.error(settings.error.oldSyntax, element);
1094
1099
  module.verbose('Extending settings from legacy parameters', validation, settings);
1095
1100
  }
@@ -1099,13 +1104,13 @@ $.fn.form = function(parameters) {
1099
1104
  parameters.fields = module.get.fieldsFromShorthand(parameters.fields);
1100
1105
  }
1101
1106
  settings = $.extend(true, {}, $.fn.form.settings, parameters);
1102
- validation = $.extend({}, $.fn.form.settings.defaults, settings.fields);
1107
+ validation = $.extend(true, {}, $.fn.form.settings.defaults, settings.fields);
1103
1108
  module.verbose('Extending settings', validation, settings);
1104
1109
  }
1105
1110
  }
1106
1111
  else {
1107
- settings = $.fn.form.settings;
1108
- validation = $.fn.form.settings.defaults;
1112
+ settings = $.extend(true, {}, $.fn.form.settings);
1113
+ validation = $.extend(true, {}, $.fn.form.settings.defaults);
1109
1114
  module.verbose('Using default form validation', validation, settings);
1110
1115
  }
1111
1116
 
@@ -1367,9 +1372,11 @@ $.fn.form = function(parameters) {
1367
1372
  }
1368
1373
  });
1369
1374
  module.debug('Adding rules', newValidation.rules, validation);
1375
+ module.refreshEvents();
1370
1376
  },
1371
1377
  fields: function(fields) {
1372
- validation = $.extend({}, validation, module.get.fieldsFromShorthand(fields));
1378
+ validation = $.extend(true, {}, validation, module.get.fieldsFromShorthand(fields));
1379
+ module.refreshEvents();
1373
1380
  },
1374
1381
  prompt: function(identifier, errors, internal) {
1375
1382
  var
@@ -1390,13 +1397,13 @@ $.fn.form = function(parameters) {
1390
1397
  }
1391
1398
  if(settings.inline) {
1392
1399
  if(!promptExists) {
1393
- $prompt = settings.templates.prompt(errors, className.label);
1400
+ $prompt = $('<div/>').addClass(className.label);
1394
1401
  $prompt
1395
1402
  .appendTo($fieldGroup)
1396
1403
  ;
1397
1404
  }
1398
1405
  $prompt
1399
- .html(errors[0])
1406
+ .html(settings.templates.prompt(errors))
1400
1407
  ;
1401
1408
  if(!promptExists) {
1402
1409
  if(settings.transition && module.can.useElement('transition') && $module.transition('is supported')) {
@@ -1466,6 +1473,7 @@ $.fn.form = function(parameters) {
1466
1473
  $.each(fields, function(index, field) {
1467
1474
  module.remove.rule(field);
1468
1475
  });
1476
+ module.refreshEvents();
1469
1477
  },
1470
1478
  // alias
1471
1479
  rules: function(field, rules) {
@@ -1589,12 +1597,15 @@ $.fn.form = function(parameters) {
1589
1597
  }
1590
1598
  else if(isCheckbox) {
1591
1599
  module.verbose('Setting checkbox value', value, $element);
1592
- if(value === true || value === 1) {
1600
+ if(value === true || value === 1 || value === 'on') {
1593
1601
  $element.checkbox('check');
1594
1602
  }
1595
1603
  else {
1596
1604
  $element.checkbox('uncheck');
1597
1605
  }
1606
+ if(typeof value === 'string') {
1607
+ $field.val(value);
1608
+ }
1598
1609
  }
1599
1610
  else if(isDropdown) {
1600
1611
  module.verbose('Setting dropdown value', value, $element);
@@ -1707,7 +1718,7 @@ $.fn.form = function(parameters) {
1707
1718
  if(event && $module.data('moduleApi') !== undefined) {
1708
1719
  event.stopImmediatePropagation();
1709
1720
  }
1710
- if(settings.errorFocus) {
1721
+ if(settings.errorFocus && ignoreCallbacks !== true) {
1711
1722
  var focusElement, hasTabIndex = true;
1712
1723
  if (typeof settings.errorFocus === 'string') {
1713
1724
  focusElement = $(settings.errorFocus);
@@ -2030,7 +2041,7 @@ $.fn.form.settings = {
2030
2041
 
2031
2042
  autoCheckRequired : false,
2032
2043
  preventLeaving : false,
2033
- errorFocus : false,
2044
+ errorFocus : true,
2034
2045
  dateHandling : 'date', // 'date', 'input', 'formatter'
2035
2046
 
2036
2047
  onValid : function() {},
@@ -2086,7 +2097,6 @@ $.fn.form.settings = {
2086
2097
  doesntContain : '{name} cannot contain "{ruleValue}"',
2087
2098
  doesntContainExactly : '{name} cannot contain exactly "{ruleValue}"',
2088
2099
  minLength : '{name} must be at least {ruleValue} characters',
2089
- length : '{name} must be at least {ruleValue} characters',
2090
2100
  exactLength : '{name} must be exactly {ruleValue} characters',
2091
2101
  maxLength : '{name} cannot be longer than {ruleValue} characters',
2092
2102
  match : '{name} must match {ruleValue} field',
@@ -2100,7 +2110,7 @@ $.fn.form.settings = {
2100
2110
  selector : {
2101
2111
  checkbox : 'input[type="checkbox"], input[type="radio"]',
2102
2112
  clear : '.clear',
2103
- field : 'input:not(.search):not([type="file"]), textarea, select',
2113
+ field : 'input:not(.search):not([type="file"]):not([type="reset"]):not([type="button"]):not([type="submit"]), textarea, select',
2104
2114
  group : '.field',
2105
2115
  input : 'input:not([type="file"])',
2106
2116
  message : '.error.message',
@@ -2141,15 +2151,22 @@ $.fn.form.settings = {
2141
2151
  html += '<li>' + value + '</li>';
2142
2152
  });
2143
2153
  html += '</ul>';
2144
- return $(html);
2154
+ return html;
2145
2155
  },
2146
2156
 
2147
- // template that produces label
2148
- prompt: function(errors, labelClasses) {
2149
- return $('<div/>')
2150
- .addClass(labelClasses)
2151
- .html(errors[0])
2157
+ // template that produces label content
2158
+ prompt: function(errors) {
2159
+ if(errors.length === 1){
2160
+ return errors[0];
2161
+ }
2162
+ var
2163
+ html = '<ul class="ui list">'
2152
2164
  ;
2165
+ $.each(errors, function(index, value) {
2166
+ html += '<li>' + value + '</li>';
2167
+ });
2168
+ html += '</ul>';
2169
+ return html;
2153
2170
  }
2154
2171
  },
2155
2172
 
@@ -2359,14 +2376,6 @@ $.fn.form.settings = {
2359
2376
  ;
2360
2377
  },
2361
2378
 
2362
- // see rls notes for 2.0.6 (this is a duplicate of minLength)
2363
- length: function(value, requiredLength) {
2364
- return (value !== undefined)
2365
- ? (value.length >= requiredLength)
2366
- : false
2367
- ;
2368
- },
2369
-
2370
2379
  // is exactly length
2371
2380
  exactLength: function(value, requiredLength) {
2372
2381
  return (value !== undefined)
@@ -2575,7 +2584,7 @@ $.fn.form.settings = {
2575
2584
  })( jQuery, window, document );
2576
2585
 
2577
2586
  /*!
2578
- * # Fomantic-UI 2.9.0-beta.26 - Accordion
2587
+ * # Fomantic-UI 2.9.0-beta.262 - Accordion
2579
2588
  * http://github.com/fomantic/Fomantic-UI/
2580
2589
  *
2581
2590
  *
@@ -3194,7 +3203,7 @@ $.extend( $.easing, {
3194
3203
 
3195
3204
 
3196
3205
  /*!
3197
- * # Fomantic-UI 2.9.0-beta.26 - Calendar
3206
+ * # Fomantic-UI 2.9.0-beta.262 - Calendar
3198
3207
  * http://github.com/fomantic/Fomantic-UI/
3199
3208
  *
3200
3209
  *
@@ -3317,7 +3326,7 @@ $.fn.calendar = function(parameters) {
3317
3326
  module.set.maxDate($module.data(metadata.maxDate));
3318
3327
  }
3319
3328
  module.setting('type', module.get.type());
3320
- module.setting('on', settings.on || ($input.length ? 'focus' : 'click'));
3329
+ module.setting('on', settings.on || 'click');
3321
3330
  },
3322
3331
  popup: function () {
3323
3332
  if (settings.inline) {
@@ -3348,7 +3357,10 @@ $.fn.calendar = function(parameters) {
3348
3357
  module.refreshTooltips();
3349
3358
  return settings.onVisible.apply($container, arguments);
3350
3359
  };
3351
- var onHidden = settings.onHidden;
3360
+ var onHidden = function () {
3361
+ module.blur();
3362
+ return settings.onHidden.apply($container, arguments)
3363
+ }
3352
3364
  if (!$input.length) {
3353
3365
  //no input, $container has to handle focus/blur
3354
3366
  $container.attr('tabindex', '0');
@@ -3357,10 +3369,6 @@ $.fn.calendar = function(parameters) {
3357
3369
  module.focus();
3358
3370
  return settings.onVisible.apply($container, arguments);
3359
3371
  };
3360
- onHidden = function () {
3361
- module.blur();
3362
- return settings.onHidden.apply($container, arguments);
3363
- };
3364
3372
  }
3365
3373
  var onShow = function () {
3366
3374
  //reset the focus date onShow
@@ -3942,7 +3950,7 @@ $.fn.calendar = function(parameters) {
3942
3950
  return $module.data(metadata.maxDate) || null;
3943
3951
  },
3944
3952
  monthOffset: function () {
3945
- return $module.data(metadata.monthOffset) || 0;
3953
+ return $module.data(metadata.monthOffset) || settings.monthOffset || 0;
3946
3954
  },
3947
3955
  mode: function () {
3948
3956
  //only returns valid modes for the current settings
@@ -4648,6 +4656,7 @@ $.fn.calendar.settings = {
4648
4656
  startCalendar : null, // jquery object or selector for another calendar that represents the start date of a date range
4649
4657
  endCalendar : null, // jquery object or selector for another calendar that represents the end date of a date range
4650
4658
  multiMonth : 1, // show multiple months when in 'day' mode
4659
+ monthOffset : 0, // position current month by offset when multimonth > 1
4651
4660
  minTimeGap : 5,
4652
4661
  showWeekNumbers : null, // show Number of Week at the very first column of a dayView
4653
4662
  disabledHours : [], // specific hour(s) which won't be selectable and contain additional information.
@@ -4663,6 +4672,7 @@ $.fn.calendar.settings = {
4663
4672
  position: 'bottom left',
4664
4673
  lastResort: 'bottom left',
4665
4674
  prefer: 'opposite',
4675
+ observeChanges: false,
4666
4676
  hideOnScroll: false
4667
4677
  },
4668
4678
 
@@ -4754,7 +4764,7 @@ $.fn.calendar.settings = {
4754
4764
  if (!text) {
4755
4765
  return null;
4756
4766
  }
4757
- text = String(text).trim();
4767
+ text = String(text).replace(/\s/g,'');
4758
4768
  if (text.length === 0) {
4759
4769
  return null;
4760
4770
  }
@@ -5067,7 +5077,7 @@ $.fn.calendar.settings = {
5067
5077
  })(jQuery, window, document);
5068
5078
 
5069
5079
  /*!
5070
- * # Fomantic-UI 2.9.0-beta.26 - Checkbox
5080
+ * # Fomantic-UI 2.9.0-beta.262 - Checkbox
5071
5081
  * http://github.com/fomantic/Fomantic-UI/
5072
5082
  *
5073
5083
  *
@@ -5307,18 +5317,26 @@ $.fn.checkbox = function(parameters) {
5307
5317
  }
5308
5318
  }
5309
5319
 
5320
+ shortcutPressed = false;
5310
5321
  if(key == keyCode.escape) {
5311
5322
  module.verbose('Escape key pressed blurring field');
5312
5323
  $input.blur();
5313
5324
  shortcutPressed = true;
5314
5325
  }
5315
- else if(!event.ctrlKey && ( key == keyCode.space || (key == keyCode.enter && settings.enableEnterKey)) ) {
5316
- module.verbose('Enter/space key pressed, toggling checkbox');
5317
- module.toggle();
5318
- shortcutPressed = true;
5319
- }
5320
- else {
5321
- shortcutPressed = false;
5326
+ else if(!event.ctrlKey && module.can.change()) {
5327
+ if( key == keyCode.space || (key == keyCode.enter && settings.enableEnterKey) ) {
5328
+ module.verbose('Enter/space key pressed, toggling checkbox');
5329
+ module.toggle();
5330
+ shortcutPressed = true;
5331
+ } else if($module.is('.toggle, .slider') && !module.is.radio()) {
5332
+ if(key == keyCode.left && module.is.checked()) {
5333
+ module.uncheck();
5334
+ shortcutPressed = true;
5335
+ } else if(key == keyCode.right && module.is.unchecked()) {
5336
+ module.check();
5337
+ shortcutPressed = true;
5338
+ }
5339
+ }
5322
5340
  }
5323
5341
  },
5324
5342
  keyup: function(event) {
@@ -5391,7 +5409,6 @@ $.fn.checkbox = function(parameters) {
5391
5409
  settings.onEnable.call(input);
5392
5410
  // preserve legacy callbacks
5393
5411
  settings.onEnabled.call(input);
5394
- module.trigger.change();
5395
5412
  }
5396
5413
  },
5397
5414
 
@@ -5406,7 +5423,6 @@ $.fn.checkbox = function(parameters) {
5406
5423
  settings.onDisable.call(input);
5407
5424
  // preserve legacy callbacks
5408
5425
  settings.onDisabled.call(input);
5409
- module.trigger.change();
5410
5426
  }
5411
5427
  },
5412
5428
 
@@ -5934,7 +5950,7 @@ $.fn.checkbox.settings = {
5934
5950
 
5935
5951
  selector : {
5936
5952
  checkbox : '.ui.checkbox',
5937
- label : 'label, .box',
5953
+ label : 'label',
5938
5954
  input : 'input[type="checkbox"], input[type="radio"]',
5939
5955
  link : 'a[href]'
5940
5956
  }
@@ -5944,7 +5960,7 @@ $.fn.checkbox.settings = {
5944
5960
  })( jQuery, window, document );
5945
5961
 
5946
5962
  /*!
5947
- * # Fomantic-UI 2.9.0-beta.26 - Dimmer
5963
+ * # Fomantic-UI 2.9.0-beta.262 - Dimmer
5948
5964
  * http://github.com/fomantic/Fomantic-UI/
5949
5965
  *
5950
5966
  *
@@ -6137,11 +6153,14 @@ $.fn.dimmer = function(parameters) {
6137
6153
  ? callback
6138
6154
  : function(){}
6139
6155
  ;
6140
- module.debug('Showing dimmer', $dimmer, settings);
6141
- module.set.variation();
6142
6156
  if( (!module.is.dimmed() || module.is.animating()) && module.is.enabled() ) {
6157
+ if(settings.onShow.call(element) === false) {
6158
+ module.verbose('Show callback returned false cancelling dimmer show');
6159
+ return;
6160
+ }
6161
+ module.debug('Showing dimmer', $dimmer, settings);
6162
+ module.set.variation();
6143
6163
  module.animate.show(callback);
6144
- settings.onShow.call(element);
6145
6164
  settings.onChange.call(element);
6146
6165
  }
6147
6166
  else {
@@ -6155,9 +6174,12 @@ $.fn.dimmer = function(parameters) {
6155
6174
  : function(){}
6156
6175
  ;
6157
6176
  if( module.is.dimmed() || module.is.animating() ) {
6177
+ if(settings.onHide.call(element) === false) {
6178
+ module.verbose('Hide callback returned false cancelling dimmer hide');
6179
+ return;
6180
+ }
6158
6181
  module.debug('Hiding dimmer', $dimmer);
6159
6182
  module.animate.hide(callback);
6160
- settings.onHide.call(element);
6161
6183
  settings.onChange.call(element);
6162
6184
  }
6163
6185
  else {
@@ -6701,7 +6723,7 @@ $.fn.dimmer.settings = {
6701
6723
  })( jQuery, window, document );
6702
6724
 
6703
6725
  /*!
6704
- * # Fomantic-UI 2.9.0-beta.26 - Dropdown
6726
+ * # Fomantic-UI 2.9.0-beta.262 - Dropdown
6705
6727
  * http://github.com/fomantic/Fomantic-UI/
6706
6728
  *
6707
6729
  *
@@ -6902,6 +6924,7 @@ $.fn.dropdown = function(parameters) {
6902
6924
  select: function() {
6903
6925
  if(module.has.input() && selectObserver) {
6904
6926
  selectObserver.observe($module[0], {
6927
+ attributes: true,
6905
6928
  childList : true,
6906
6929
  subtree : true
6907
6930
  });
@@ -6926,7 +6949,7 @@ $.fn.dropdown = function(parameters) {
6926
6949
 
6927
6950
  create: {
6928
6951
  id: function() {
6929
- id = (Math.random().toString(16) + '000000000').substr(2, 8);
6952
+ id = (Math.random().toString(16) + '000000000').slice(2, 10);
6930
6953
  elementNamespace = '.' + id;
6931
6954
  module.verbose('Creating unique id for element', id);
6932
6955
  },
@@ -7123,6 +7146,9 @@ $.fn.dropdown = function(parameters) {
7123
7146
  module.debug('Disabling dropdown');
7124
7147
  $module.addClass(className.disabled);
7125
7148
  }
7149
+ if($input.is('[required]')) {
7150
+ settings.forceSelection = true;
7151
+ }
7126
7152
  $input
7127
7153
  .removeAttr('required')
7128
7154
  .removeAttr('class')
@@ -7327,6 +7353,11 @@ $.fn.dropdown = function(parameters) {
7327
7353
  $module
7328
7354
  .on('change' + eventNamespace, selector.input, module.event.change)
7329
7355
  ;
7356
+ if(module.is.multiple() && module.is.searchSelection()) {
7357
+ $module
7358
+ .on('paste' + eventNamespace, selector.search, module.event.paste)
7359
+ ;
7360
+ }
7330
7361
  },
7331
7362
  mouseEvents: function() {
7332
7363
  module.verbose('Binding mouse events');
@@ -7546,7 +7577,7 @@ $.fn.dropdown = function(parameters) {
7546
7577
  var value = module.is.multiple() ? module.get.values() : module.get.value();
7547
7578
  if (value !== '') {
7548
7579
  module.verbose('Value(s) present after click icon, select value(s) in items');
7549
- module.set.selected(value, null, null, true);
7580
+ module.set.selected(value, null, true, true);
7550
7581
  }
7551
7582
  }
7552
7583
  iconClicked = false;
@@ -7775,6 +7806,15 @@ $.fn.dropdown = function(parameters) {
7775
7806
  },
7776
7807
 
7777
7808
  event: {
7809
+ paste: function(event) {
7810
+ var pasteValue = (event.originalEvent.clipboardData || window.clipboardData).getData('text'),
7811
+ tokens = pasteValue.split(settings.delimiter)
7812
+ ;
7813
+ tokens.forEach(function(value){
7814
+ module.set.selected(module.escape.htmlEntities(value.trim()), null, true, true);
7815
+ });
7816
+ event.preventDefault();
7817
+ },
7778
7818
  change: function() {
7779
7819
  if(!internalChange) {
7780
7820
  module.debug('Input changed, updating selection');
@@ -7987,8 +8027,8 @@ $.fn.dropdown = function(parameters) {
7987
8027
  },
7988
8028
  select: {
7989
8029
  mutation: function(mutations) {
7990
- module.debug('<select> modified, recreating menu');
7991
8030
  if(module.is.selectMutation(mutations)) {
8031
+ module.debug('<select> modified, recreating menu');
7992
8032
  module.disconnect.selectObserver();
7993
8033
  module.refresh();
7994
8034
  module.setup.select();
@@ -8215,7 +8255,7 @@ $.fn.dropdown = function(parameters) {
8215
8255
  keydown: function(event) {
8216
8256
  var
8217
8257
  pressedKey = event.which,
8218
- isShortcutKey = module.is.inObject(pressedKey, keys)
8258
+ isShortcutKey = module.is.inObject(pressedKey, keys) || event.key === settings.delimiter
8219
8259
  ;
8220
8260
  if(isShortcutKey) {
8221
8261
  var
@@ -8233,7 +8273,7 @@ $.fn.dropdown = function(parameters) {
8233
8273
  hasSubMenu = ($subMenu.length> 0),
8234
8274
  hasSelectedItem = ($selectedItem.length > 0),
8235
8275
  selectedIsSelectable = ($selectedItem.not(selector.unselectable).length > 0),
8236
- delimiterPressed = (pressedKey == keys.delimiter && settings.allowAdditions && module.is.multiple()),
8276
+ delimiterPressed = (event.key === settings.delimiter && module.is.multiple()),
8237
8277
  isAdditionWithoutMenu = (settings.allowAdditions && settings.hideAdditions && (pressedKey == keys.enter || delimiterPressed) && selectedIsSelectable),
8238
8278
  $nextItem,
8239
8279
  isSubMenuItem,
@@ -8331,7 +8371,7 @@ $.fn.dropdown = function(parameters) {
8331
8371
  .addClass(className.selected)
8332
8372
  ;
8333
8373
  module.set.scrollPosition($nextItem);
8334
- if(settings.selectOnKeydown && module.is.single()) {
8374
+ if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
8335
8375
  module.set.selectedItem($nextItem);
8336
8376
  }
8337
8377
  }
@@ -8358,7 +8398,7 @@ $.fn.dropdown = function(parameters) {
8358
8398
  .addClass(className.selected)
8359
8399
  ;
8360
8400
  module.set.scrollPosition($nextItem);
8361
- if(settings.selectOnKeydown && module.is.single()) {
8401
+ if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
8362
8402
  module.set.selectedItem($nextItem);
8363
8403
  }
8364
8404
  }
@@ -8489,7 +8529,7 @@ $.fn.dropdown = function(parameters) {
8489
8529
  ;
8490
8530
  if( module.can.activate( $(element) ) ) {
8491
8531
  module.set.selected(value, $(element));
8492
- if(!module.is.multiple()) {
8532
+ if(!module.is.multiple() && !(!settings.collapseOnActionable && $(element).hasClass(className.actionable))) {
8493
8533
  module.hideAndClear();
8494
8534
  }
8495
8535
  }
@@ -8502,7 +8542,7 @@ $.fn.dropdown = function(parameters) {
8502
8542
  ;
8503
8543
  if( module.can.activate( $(element) ) ) {
8504
8544
  module.set.value(value, text, $(element));
8505
- if(!module.is.multiple()) {
8545
+ if(!module.is.multiple() && !(!settings.collapseOnActionable && $(element).hasClass(className.actionable))) {
8506
8546
  module.hideAndClear();
8507
8547
  }
8508
8548
  }
@@ -8553,7 +8593,7 @@ $.fn.dropdown = function(parameters) {
8553
8593
  ;
8554
8594
  $sizer.text(value);
8555
8595
  // prevent rounding issues
8556
- return Math.ceil( $sizer.width() + 1);
8596
+ return Math.ceil( $sizer.width() + (module.is.edge() ? 3 : 1));
8557
8597
  },
8558
8598
  selectionCount: function() {
8559
8599
  var
@@ -9022,7 +9062,7 @@ $.fn.dropdown = function(parameters) {
9022
9062
  module.error(error.noStorage);
9023
9063
  return;
9024
9064
  }
9025
- name = sessionStorage.getItem(value);
9065
+ name = sessionStorage.getItem(value + elementNamespace);
9026
9066
  return (name !== undefined)
9027
9067
  ? name
9028
9068
  : false
@@ -9066,7 +9106,7 @@ $.fn.dropdown = function(parameters) {
9066
9106
  return;
9067
9107
  }
9068
9108
  module.verbose('Saving remote data to session storage', value, name);
9069
- sessionStorage.setItem(value, name);
9109
+ sessionStorage.setItem(value + elementNamespace, name);
9070
9110
  }
9071
9111
  },
9072
9112
 
@@ -9126,7 +9166,7 @@ $.fn.dropdown = function(parameters) {
9126
9166
  $nextSelectedItem
9127
9167
  .addClass(className.selected)
9128
9168
  ;
9129
- if(settings.selectOnKeydown && module.is.single()) {
9169
+ if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
9130
9170
  module.set.selectedItem($nextSelectedItem);
9131
9171
  }
9132
9172
  $menu
@@ -9212,7 +9252,7 @@ $.fn.dropdown = function(parameters) {
9212
9252
  var
9213
9253
  length = module.get.query().length
9214
9254
  ;
9215
- $search.val( text.substr(0, length));
9255
+ $search.val( text.slice(0, length));
9216
9256
  },
9217
9257
  scrollPosition: function($item, forceScroll) {
9218
9258
  var
@@ -9329,7 +9369,7 @@ $.fn.dropdown = function(parameters) {
9329
9369
  module.set.scrollPosition($nextValue);
9330
9370
  $selectedItem.removeClass(className.selected);
9331
9371
  $nextValue.addClass(className.selected);
9332
- if(settings.selectOnKeydown && module.is.single()) {
9372
+ if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
9333
9373
  module.set.selectedItem($nextValue);
9334
9374
  }
9335
9375
  }
@@ -9467,17 +9507,24 @@ $.fn.dropdown = function(parameters) {
9467
9507
 
9468
9508
  isFiltered = $selected.hasClass(className.filtered),
9469
9509
  isActive = $selected.hasClass(className.active),
9510
+ isActionable = $selected.hasClass(className.actionable),
9470
9511
  isUserValue = $selected.hasClass(className.addition),
9471
9512
  shouldAnimate = (isMultiple && $selectedItem.length == 1)
9472
9513
  ;
9473
- if(isMultiple) {
9514
+ if(isActionable){
9515
+ if((!isMultiple || (!isActive || isUserValue)) && settings.apiSettings && settings.saveRemoteData) {
9516
+ module.save.remoteData(selectedText, selectedValue);
9517
+ }
9518
+ settings.onActionable.call(element, selectedValue, selectedText, $selected);
9519
+ }
9520
+ else if(isMultiple) {
9474
9521
  if(!isActive || isUserValue) {
9475
9522
  if(settings.apiSettings && settings.saveRemoteData) {
9476
9523
  module.save.remoteData(selectedText, selectedValue);
9477
9524
  }
9478
9525
  if(settings.useLabels) {
9479
- module.add.label(selectedValue, selectedText, shouldAnimate);
9480
9526
  module.add.value(selectedValue, selectedText, $selected);
9527
+ module.add.label(selectedValue, selectedText, shouldAnimate);
9481
9528
  module.set.activeItem($selected);
9482
9529
  module.filterActive();
9483
9530
  module.select.nextAvailable($selectedItem);
@@ -9497,7 +9544,7 @@ $.fn.dropdown = function(parameters) {
9497
9544
  if(settings.apiSettings && settings.saveRemoteData) {
9498
9545
  module.save.remoteData(selectedText, selectedValue);
9499
9546
  }
9500
- if (!keepSearchTerm) {
9547
+ if (!keepSearchTerm && !$selected.hasClass(className.actionable)) {
9501
9548
  module.set.text(selectedText);
9502
9549
  }
9503
9550
  module.set.value(selectedValue, selectedText, $selected, preventChangeTrigger);
@@ -9687,7 +9734,7 @@ $.fn.dropdown = function(parameters) {
9687
9734
  }
9688
9735
  // extend current array
9689
9736
  if(Array.isArray(currentValue)) {
9690
- newValue = currentValue.concat([addedValue]);
9737
+ newValue = $selectedItem.hasClass(className.actionable) ? currentValue : currentValue.concat([addedValue]);
9691
9738
  newValue = module.get.uniqueArray(newValue);
9692
9739
  }
9693
9740
  else {
@@ -9771,18 +9818,10 @@ $.fn.dropdown = function(parameters) {
9771
9818
  return;
9772
9819
  }
9773
9820
  // temporarily disconnect observer
9774
- if(selectObserver) {
9775
- selectObserver.disconnect();
9776
- module.verbose('Temporarily disconnecting mutation observer');
9777
- }
9821
+ module.disconnect.selectObserver();
9778
9822
  $option.remove();
9779
9823
  module.verbose('Removing user addition as an <option>', escapedValue);
9780
- if(selectObserver) {
9781
- selectObserver.observe($input[0], {
9782
- childList : true,
9783
- subtree : true
9784
- });
9785
- }
9824
+ module.observe.select();
9786
9825
  },
9787
9826
  message: function() {
9788
9827
  $menu.children(selector.message).remove();
@@ -10081,8 +10120,11 @@ $.fn.dropdown = function(parameters) {
10081
10120
  bubbledIconClick: function(event) {
10082
10121
  return $(event.target).closest($icon).length > 0;
10083
10122
  },
10123
+ edge: function() {
10124
+ return !!window.chrome && !!window.StyleMedia;
10125
+ },
10084
10126
  chrome: function() {
10085
- return !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime);
10127
+ return !!window.chrome && !window.StyleMedia;
10086
10128
  },
10087
10129
  alreadySetup: function() {
10088
10130
  return ($module.is('select') && $module.parent(selector.dropdown).data(moduleNamespace) !== undefined && $module.prev().length === 0);
@@ -10147,7 +10189,7 @@ $.fn.dropdown = function(parameters) {
10147
10189
  selectChanged = false
10148
10190
  ;
10149
10191
  $.each(mutations, function(index, mutation) {
10150
- if($(mutation.target).is('select') || $(mutation.addedNodes).is('select')) {
10192
+ if($(mutation.target).is('select, option, optgroup') || $(mutation.addedNodes).is('select')) {
10151
10193
  selectChanged = true;
10152
10194
  return false;
10153
10195
  }
@@ -10692,7 +10734,7 @@ $.fn.dropdown.settings = {
10692
10734
  keepOnScreen : true, // Whether dropdown should check whether it is on screen before showing
10693
10735
 
10694
10736
  match : 'both', // what to match against with search selection (both, text, or label)
10695
- fullTextSearch : false, // search anywhere in value (set to 'exact' to require exact matches)
10737
+ fullTextSearch : 'exact', // search anywhere in value (set to 'exact' to require exact matches)
10696
10738
  ignoreDiacritics : false, // match results also if they contain diacritics of the same base character (for example searching for "a" will also match "á" or "â" or "à", etc...)
10697
10739
  hideDividers : false, // Whether to hide any divider elements (specified in selector.divider) that are sibling to any items when searched (set to true will hide all dividers, set to 'empty' will hide them when they are not followed by a visible item)
10698
10740
 
@@ -10700,7 +10742,7 @@ $.fn.dropdown.settings = {
10700
10742
  preserveHTML : true, // preserve html when selecting value
10701
10743
  sortSelect : false, // sort selection on init
10702
10744
 
10703
- forceSelection : true, // force a choice on blur with search selection
10745
+ forceSelection : false, // force a choice on blur with search selection
10704
10746
 
10705
10747
  allowAdditions : false, // whether multiple select should allow user added values
10706
10748
  ignoreCase : false, // whether to consider case sensitivity when creating labels
@@ -10711,7 +10753,7 @@ $.fn.dropdown.settings = {
10711
10753
  useLabels : true, // whether multiple select should filter currently active selections from choices
10712
10754
  delimiter : ',', // when multiselect uses normal <input> the values will be delimited with this character
10713
10755
 
10714
- showOnFocus : true, // show menu on focus
10756
+ showOnFocus : false, // show menu on focus
10715
10757
  allowReselection : false, // whether current value should trigger callbacks when reselected
10716
10758
  allowTab : true, // add tabindex to element
10717
10759
  allowCategorySelection : false, // allow elements with sub-menus to be selected
@@ -10726,6 +10768,8 @@ $.fn.dropdown.settings = {
10726
10768
 
10727
10769
  headerDivider : true, // whether option headers should have an additional divider line underneath when converted from <select> <optgroup>
10728
10770
 
10771
+ collapseOnActionable : true, // whether the dropdown should collapse upon selection of an actionable item
10772
+
10729
10773
  // label settings on multi-select
10730
10774
  label: {
10731
10775
  transition : 'scale',
@@ -10745,6 +10789,7 @@ $.fn.dropdown.settings = {
10745
10789
  onChange : function(value, text, $selected){},
10746
10790
  onAdd : function(value, text, $selected){},
10747
10791
  onRemove : function(value, text, $selected){},
10792
+ onActionable : function(value, text, $selected){},
10748
10793
  onSearch : function(searchTerm){},
10749
10794
 
10750
10795
  onLabelSelect : function($selectedLabels){},
@@ -10807,12 +10852,12 @@ $.fn.dropdown.settings = {
10807
10852
  icon : 'icon', // optional icon name
10808
10853
  iconClass : 'iconClass', // optional individual class for icon (for example to use flag instead)
10809
10854
  class : 'class', // optional individual class for item/header
10810
- divider : 'divider' // optional divider append for group headers
10855
+ divider : 'divider', // optional divider append for group headers
10856
+ actionable : 'actionable' // optional actionable item
10811
10857
  },
10812
10858
 
10813
10859
  keys : {
10814
10860
  backspace : 8,
10815
- delimiter : 188, // comma
10816
10861
  deleteKey : 46,
10817
10862
  enter : 13,
10818
10863
  escape : 27,
@@ -10879,7 +10924,8 @@ $.fn.dropdown.settings = {
10879
10924
  header : 'header',
10880
10925
  divider : 'divider',
10881
10926
  groupIcon : '',
10882
- unfilterable : 'unfilterable'
10927
+ unfilterable : 'unfilterable',
10928
+ actionable : 'actionable'
10883
10929
  }
10884
10930
 
10885
10931
  };
@@ -10954,6 +11000,9 @@ $.fn.dropdown.settings.templates = {
10954
11000
  maybeText = (option[fields.text])
10955
11001
  ? ' data-text="' + deQuote(option[fields.text],true) + '"'
10956
11002
  : '',
11003
+ maybeActionable = (option[fields.actionable])
11004
+ ? className.actionable+' '
11005
+ : '',
10957
11006
  maybeDisabled = (option[fields.disabled])
10958
11007
  ? className.disabled+' '
10959
11008
  : '',
@@ -10962,7 +11011,7 @@ $.fn.dropdown.settings.templates = {
10962
11011
  : '',
10963
11012
  hasDescription = (escape(option[fields.description] || '', preserveHTML) != '')
10964
11013
  ;
10965
- html += '<div class="'+ maybeDisabled + maybeDescriptionVertical + (option[fields.class] ? deQuote(option[fields.class]) : className.item)+'" data-value="' + deQuote(option[fields.value],true) + '"' + maybeText + '>';
11014
+ html += '<div class="'+ maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class] ? deQuote(option[fields.class]) : className.item)+'" data-value="' + deQuote(option[fields.value],true) + '"' + maybeText + '>';
10966
11015
  if (isMenu) {
10967
11016
  html += '<i class="'+ (itemType.indexOf('left') !== -1 ? 'left' : '') + ' dropdown icon"></i>';
10968
11017
  }
@@ -11032,7 +11081,7 @@ $.fn.dropdown.settings.templates = {
11032
11081
  })( jQuery, window, document );
11033
11082
 
11034
11083
  /*!
11035
- * # Fomantic-UI 2.9.0-beta.26 - Embed
11084
+ * # Fomantic-UI 2.9.0-beta.262 - Embed
11036
11085
  * http://github.com/fomantic/Fomantic-UI/
11037
11086
  *
11038
11087
  *
@@ -11742,7 +11791,7 @@ $.fn.embed.settings = {
11742
11791
  })( jQuery, window, document );
11743
11792
 
11744
11793
  /*!
11745
- * # Fomantic-UI 2.9.0-beta.26 - Modal
11794
+ * # Fomantic-UI 2.9.0-beta.262 - Modal
11746
11795
  * http://github.com/fomantic/Fomantic-UI/
11747
11796
  *
11748
11797
  *
@@ -11809,7 +11858,8 @@ $.fn.modal = function(parameters) {
11809
11858
 
11810
11859
  $module = $(this),
11811
11860
  $context = $(settings.context),
11812
- $close = $module.find(selector.close),
11861
+ $closeIcon = $module.find(selector.closeIcon),
11862
+ $inputs,
11813
11863
 
11814
11864
  $allModals,
11815
11865
  $otherModals,
@@ -11835,6 +11885,7 @@ $.fn.modal = function(parameters) {
11835
11885
  module = {
11836
11886
 
11837
11887
  initialize: function() {
11888
+ module.create.id();
11838
11889
  if(!$module.hasClass('modal')) {
11839
11890
  module.create.modal();
11840
11891
  if(!$.isFunction(settings.onHidden)) {
@@ -11859,15 +11910,17 @@ $.fn.modal = function(parameters) {
11859
11910
  $actions.empty();
11860
11911
  }
11861
11912
  settings.actions.forEach(function (el) {
11862
- var icon = el[fields.icon] ? '<i class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
11913
+ var icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
11863
11914
  text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
11864
11915
  cls = module.helpers.deQuote(el[fields.class] || ''),
11865
11916
  click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {};
11866
11917
  $actions.append($('<button/>', {
11867
11918
  html: icon + text,
11919
+ 'aria-label': $('<div>'+(el[fields.text] || el[fields.icon] || '')+'</div>').text(),
11868
11920
  class: className.button + ' ' + cls,
11869
11921
  click: function () {
11870
- if (click.call(element, $module) === false) {
11922
+ var button = $(this);
11923
+ if (button.is(selector.approve) || button.is(selector.deny) || click.call(element, $module) === false) {
11871
11924
  return;
11872
11925
  }
11873
11926
  module.hide();
@@ -11878,7 +11931,6 @@ $.fn.modal = function(parameters) {
11878
11931
  module.cache = {};
11879
11932
  module.verbose('Initializing dimmer', $context);
11880
11933
 
11881
- module.create.id();
11882
11934
  module.create.dimmer();
11883
11935
 
11884
11936
  if ( settings.allowMultiple ) {
@@ -11888,11 +11940,9 @@ $.fn.modal = function(parameters) {
11888
11940
  $module.addClass('top aligned');
11889
11941
  }
11890
11942
  module.refreshModals();
11891
-
11943
+ module.refreshInputs();
11892
11944
  module.bind.events();
11893
- if(settings.observeChanges) {
11894
- module.observeChanges();
11895
- }
11945
+ module.observeChanges();
11896
11946
  module.instantiate();
11897
11947
  if(settings.autoShow){
11898
11948
  module.show();
@@ -11909,16 +11959,20 @@ $.fn.modal = function(parameters) {
11909
11959
 
11910
11960
  create: {
11911
11961
  modal: function() {
11912
- $module = $('<div/>', {class: className.modal});
11962
+ $module = $('<div/>', {class: className.modal, role: 'dialog', 'aria-modal': true});
11913
11963
  if (settings.closeIcon) {
11914
- $close = $('<i/>', {class: className.close})
11915
- $module.append($close);
11964
+ $closeIcon = $('<i/>', {class: className.close, role: 'button', tabindex: 0, 'aria-label': settings.text.close})
11965
+ $module.append($closeIcon);
11916
11966
  }
11917
11967
  if (settings.title !== '') {
11918
- $('<div/>', {class: className.title}).appendTo($module);
11968
+ var titleId = '_' + module.get.id() + 'title';
11969
+ $module.attr('aria-labelledby', titleId);
11970
+ $('<div/>', {class: className.title, id: titleId}).appendTo($module);
11919
11971
  }
11920
11972
  if (settings.content !== '') {
11921
- $('<div/>', {class: className.content}).appendTo($module);
11973
+ var descId = '_' + module.get.id() + 'desc';
11974
+ $module.attr('aria-describedby', descId);
11975
+ $('<div/>', {class: className.content, id: descId}).appendTo($module);
11922
11976
  }
11923
11977
  if (module.has.configActions()) {
11924
11978
  $('<div/>', {class: className.actions}).appendTo($module);
@@ -11949,13 +12003,13 @@ $.fn.modal = function(parameters) {
11949
12003
  $dimmer = $dimmable.dimmer('get dimmer');
11950
12004
  },
11951
12005
  id: function() {
11952
- id = (Math.random().toString(16) + '000000000').substr(2, 8);
12006
+ id = (Math.random().toString(16) + '000000000').slice(2, 10);
11953
12007
  elementEventNamespace = '.' + id;
11954
12008
  module.verbose('Creating unique id for element', id);
11955
12009
  },
11956
12010
  innerDimmer: function() {
11957
- if ( $module.find(selector.dimmer).length == 0 ) {
11958
- $module.prepend('<div class="ui inverted dimmer"></div>');
12011
+ if ( $module.find(selector.dimmer).length === 0 ) {
12012
+ $('<div/>', {class: className.innerDimmer}).prependTo($module);
11959
12013
  }
11960
12014
  }
11961
12015
  },
@@ -11971,15 +12025,21 @@ $.fn.modal = function(parameters) {
11971
12025
  ;
11972
12026
  $window.off(elementEventNamespace);
11973
12027
  $dimmer.off(elementEventNamespace);
11974
- $close.off(eventNamespace);
12028
+ $closeIcon.off(elementEventNamespace);
12029
+ if($inputs) {
12030
+ $inputs.off(elementEventNamespace);
12031
+ }
11975
12032
  $context.dimmer('destroy');
11976
12033
  },
11977
12034
 
11978
12035
  observeChanges: function() {
11979
12036
  if('MutationObserver' in window) {
11980
12037
  observer = new MutationObserver(function(mutations) {
11981
- module.debug('DOM tree modified, refreshing');
11982
- module.refresh();
12038
+ if(settings.observeChanges) {
12039
+ module.debug('DOM tree modified, refreshing');
12040
+ module.refresh();
12041
+ }
12042
+ module.refreshInputs();
11983
12043
  });
11984
12044
  observer.observe(element, {
11985
12045
  childList : true,
@@ -12004,6 +12064,23 @@ $.fn.modal = function(parameters) {
12004
12064
  $allModals = $otherModals.add($module);
12005
12065
  },
12006
12066
 
12067
+ refreshInputs: function(){
12068
+ if($inputs){
12069
+ $inputs
12070
+ .off('keydown' + elementEventNamespace)
12071
+ ;
12072
+ }
12073
+ $inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
12074
+ return $(this).closest('.disabled').length === 0;
12075
+ });
12076
+ $inputs.first()
12077
+ .on('keydown' + elementEventNamespace, module.event.inputKeyDown.first)
12078
+ ;
12079
+ $inputs.last()
12080
+ .on('keydown' + elementEventNamespace, module.event.inputKeyDown.last)
12081
+ ;
12082
+ },
12083
+
12007
12084
  attachEvents: function(selector, event) {
12008
12085
  var
12009
12086
  $toggle = $(selector)
@@ -12032,6 +12109,9 @@ $.fn.modal = function(parameters) {
12032
12109
  .on('click' + eventNamespace, selector.approve, module.event.approve)
12033
12110
  .on('click' + eventNamespace, selector.deny, module.event.deny)
12034
12111
  ;
12112
+ $closeIcon
12113
+ .on('keyup' + elementEventNamespace, module.event.closeKeyUp)
12114
+ ;
12035
12115
  $window
12036
12116
  .on('resize' + elementEventNamespace, module.event.resize)
12037
12117
  ;
@@ -12050,7 +12130,7 @@ $.fn.modal = function(parameters) {
12050
12130
 
12051
12131
  get: {
12052
12132
  id: function() {
12053
- return (Math.random().toString(16) + '000000000').substr(2, 8);
12133
+ return id;
12054
12134
  },
12055
12135
  element: function() {
12056
12136
  return $module;
@@ -12089,10 +12169,38 @@ $.fn.modal = function(parameters) {
12089
12169
  close: function() {
12090
12170
  module.hide();
12091
12171
  },
12172
+ closeKeyUp: function(event){
12173
+ var
12174
+ keyCode = event.which
12175
+ ;
12176
+ if ((keyCode === settings.keys.enter || keyCode === settings.keys.space) && $module.hasClass(className.front)) {
12177
+ module.hide();
12178
+ }
12179
+ },
12180
+ inputKeyDown: {
12181
+ first: function(event) {
12182
+ var
12183
+ keyCode = event.which
12184
+ ;
12185
+ if (keyCode === settings.keys.tab && event.shiftKey) {
12186
+ $inputs.last().focus();
12187
+ event.preventDefault();
12188
+ }
12189
+ },
12190
+ last: function(event) {
12191
+ var
12192
+ keyCode = event.which
12193
+ ;
12194
+ if (keyCode === settings.keys.tab && !event.shiftKey) {
12195
+ $inputs.first().focus();
12196
+ event.preventDefault();
12197
+ }
12198
+ }
12199
+ },
12092
12200
  mousedown: function(event) {
12093
12201
  var
12094
12202
  $target = $(event.target),
12095
- isRtl = module.is.rtl();
12203
+ isRtl = module.is.rtl()
12096
12204
  ;
12097
12205
  initialMouseDownInModal = ($target.closest(selector.modal).length > 0);
12098
12206
  if(initialMouseDownInModal) {
@@ -12140,10 +12248,9 @@ $.fn.modal = function(parameters) {
12140
12248
  },
12141
12249
  keyboard: function(event) {
12142
12250
  var
12143
- keyCode = event.which,
12144
- escapeKey = 27
12251
+ keyCode = event.which
12145
12252
  ;
12146
- if(keyCode == escapeKey) {
12253
+ if(keyCode === settings.keys.escape) {
12147
12254
  if(settings.closable) {
12148
12255
  module.debug('Escape key pressed hiding modal');
12149
12256
  if ( $module.hasClass(className.front) ) {
@@ -12199,6 +12306,10 @@ $.fn.modal = function(parameters) {
12199
12306
  : function(){}
12200
12307
  ;
12201
12308
  if( module.is.animating() || !module.is.active() ) {
12309
+ if(settings.onShow.call(element) === false) {
12310
+ module.verbose('Show callback returned false cancelling show');
12311
+ return;
12312
+ }
12202
12313
  module.showDimmer();
12203
12314
  module.cacheSizes();
12204
12315
  module.set.bodyMargin();
@@ -12228,7 +12339,6 @@ $.fn.modal = function(parameters) {
12228
12339
  $module.detach().appendTo($dimmer);
12229
12340
  }
12230
12341
  }
12231
- settings.onShow.call(element);
12232
12342
  if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
12233
12343
  module.debug('Showing modal with css animations');
12234
12344
  $module
@@ -12271,7 +12381,6 @@ $.fn.modal = function(parameters) {
12271
12381
  ? callback
12272
12382
  : function(){}
12273
12383
  ;
12274
- module.debug('Hiding modal');
12275
12384
  if(settings.onHide.call(element, $(this)) === false) {
12276
12385
  module.verbose('Hide callback returned false cancelling hide');
12277
12386
  ignoreRepeatedEvents = false;
@@ -12279,6 +12388,7 @@ $.fn.modal = function(parameters) {
12279
12388
  }
12280
12389
 
12281
12390
  if( module.is.animating() || module.is.active() ) {
12391
+ module.debug('Hiding modal');
12282
12392
  if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
12283
12393
  module.remove.active();
12284
12394
  $module
@@ -12458,7 +12568,7 @@ $.fn.modal = function(parameters) {
12458
12568
  $module
12459
12569
  .off('mousedown' + elementEventNamespace)
12460
12570
  ;
12461
- }
12571
+ }
12462
12572
  $dimmer
12463
12573
  .off('mousedown' + elementEventNamespace)
12464
12574
  ;
@@ -12643,13 +12753,10 @@ $.fn.modal = function(parameters) {
12643
12753
  set: {
12644
12754
  autofocus: function() {
12645
12755
  var
12646
- $inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
12647
- return $(this).closest('.disabled').length === 0;
12648
- }),
12649
12756
  $autofocus = $inputs.filter('[autofocus]'),
12650
12757
  $input = ($autofocus.length > 0)
12651
12758
  ? $autofocus.first()
12652
- : $inputs.first()
12759
+ : ($inputs.length > 1 ? $inputs.filter(':not(i.close)') : $inputs).first()
12653
12760
  ;
12654
12761
  if($input.length > 0) {
12655
12762
  $input.focus();
@@ -12731,7 +12838,7 @@ $.fn.modal = function(parameters) {
12731
12838
  ? $(document).scrollTop() + settings.padding
12732
12839
  : $(document).scrollTop() + (module.cache.contextHeight - module.cache.height - settings.padding),
12733
12840
  marginLeft: -(module.cache.width / 2)
12734
- })
12841
+ })
12735
12842
  ;
12736
12843
  } else {
12737
12844
  $module
@@ -12740,7 +12847,7 @@ $.fn.modal = function(parameters) {
12740
12847
  ? -(module.cache.height / 2)
12741
12848
  : settings.padding / 2,
12742
12849
  marginLeft: -(module.cache.width / 2)
12743
- })
12850
+ })
12744
12851
  ;
12745
12852
  }
12746
12853
  module.verbose('Setting modal offset for legacy mode');
@@ -13066,11 +13173,19 @@ $.fn.modal.settings = {
13066
13173
  // called after deny selector match
13067
13174
  onDeny : function(){ return true; },
13068
13175
 
13176
+ keys : {
13177
+ space : 32,
13178
+ enter : 13,
13179
+ escape : 27,
13180
+ tab : 9,
13181
+ },
13182
+
13069
13183
  selector : {
13070
13184
  title : '> .header',
13071
13185
  content : '> .content',
13072
13186
  actions : '> .actions',
13073
13187
  close : '> .close',
13188
+ closeIcon: '> .close',
13074
13189
  approve : '.actions .positive, .actions .approve, .actions .ok',
13075
13190
  deny : '.actions .negative, .actions .deny, .actions .cancel',
13076
13191
  modal : '.ui.modal',
@@ -13102,11 +13217,13 @@ $.fn.modal.settings = {
13102
13217
  template : 'ui tiny modal',
13103
13218
  ok : 'positive',
13104
13219
  cancel : 'negative',
13105
- prompt : 'ui fluid input'
13220
+ prompt : 'ui fluid input',
13221
+ innerDimmer: 'ui inverted dimmer'
13106
13222
  },
13107
13223
  text: {
13108
13224
  ok : 'Ok',
13109
- cancel: 'Cancel'
13225
+ cancel: 'Cancel',
13226
+ close : 'Close'
13110
13227
  }
13111
13228
  };
13112
13229
 
@@ -13132,33 +13249,39 @@ $.fn.modal.settings.templates = {
13132
13249
  },
13133
13250
  alert: function () {
13134
13251
  var settings = this.get.settings(),
13135
- args = settings.templates.getArguments(arguments)
13252
+ args = settings.templates.getArguments(arguments),
13253
+ approveFn = args.handler
13136
13254
  ;
13137
13255
  return {
13138
13256
  title : args.title,
13139
13257
  content: args.content,
13258
+ onApprove: approveFn,
13140
13259
  actions: [{
13141
13260
  text : settings.text.ok,
13142
13261
  class: settings.className.ok,
13143
- click: args.handler
13262
+ click: approveFn
13144
13263
  }]
13145
13264
  }
13146
13265
  },
13147
13266
  confirm: function () {
13148
13267
  var settings = this.get.settings(),
13149
- args = settings.templates.getArguments(arguments)
13268
+ args = settings.templates.getArguments(arguments),
13269
+ approveFn = function(){args.handler(true)},
13270
+ denyFn = function(){args.handler(false)}
13150
13271
  ;
13151
13272
  return {
13152
13273
  title : args.title,
13153
13274
  content: args.content,
13275
+ onApprove: approveFn,
13276
+ onDeny: denyFn,
13154
13277
  actions: [{
13155
13278
  text : settings.text.ok,
13156
13279
  class: settings.className.ok,
13157
- click: function(){args.handler(true)}
13280
+ click: approveFn
13158
13281
  },{
13159
13282
  text: settings.text.cancel,
13160
13283
  class: settings.className.cancel,
13161
- click: function(){args.handler(false)}
13284
+ click: denyFn
13162
13285
  }]
13163
13286
  }
13164
13287
  },
@@ -13166,7 +13289,14 @@ $.fn.modal.settings.templates = {
13166
13289
  var $this = this,
13167
13290
  settings = this.get.settings(),
13168
13291
  args = settings.templates.getArguments(arguments),
13169
- input = $($.parseHTML(args.content)).filter('.ui.input')
13292
+ input = $($.parseHTML(args.content)).filter('.ui.input'),
13293
+ approveFn = function(){
13294
+ var settings = $this.get.settings(),
13295
+ inputField = $this.get.element().find(settings.selector.prompt)[0]
13296
+ ;
13297
+ args.handler($(inputField).val());
13298
+ },
13299
+ denyFn = function(){args.handler(null)}
13170
13300
  ;
13171
13301
  if (input.length === 0) {
13172
13302
  args.content += '<p><div class="'+settings.className.prompt+'"><input placeholder="'+this.helpers.deQuote(args.placeholder || '')+'" type="text" value="'+this.helpers.deQuote(args.defaultValue || '')+'"></div></p>';
@@ -13174,19 +13304,16 @@ $.fn.modal.settings.templates = {
13174
13304
  return {
13175
13305
  title : args.title,
13176
13306
  content: args.content,
13307
+ onApprove: approveFn,
13308
+ onDeny: denyFn,
13177
13309
  actions: [{
13178
13310
  text: settings.text.ok,
13179
13311
  class: settings.className.ok,
13180
- click: function(){
13181
- var settings = $this.get.settings(),
13182
- inputField = $this.get.element().find(settings.selector.prompt)[0]
13183
- ;
13184
- args.handler($(inputField).val());
13185
- }
13312
+ click: approveFn
13186
13313
  },{
13187
13314
  text: settings.text.cancel,
13188
13315
  class: settings.className.cancel,
13189
- click: function(){args.handler(null)}
13316
+ click: denyFn
13190
13317
  }]
13191
13318
  }
13192
13319
  }
@@ -13195,7 +13322,7 @@ $.fn.modal.settings.templates = {
13195
13322
  })( jQuery, window, document );
13196
13323
 
13197
13324
  /*!
13198
- * # Fomantic-UI 2.9.0-beta.26 - Nag
13325
+ * # Fomantic-UI 2.9.0-beta.262 - Nag
13199
13326
  * http://github.com/fomantic/Fomantic-UI/
13200
13327
  *
13201
13328
  *
@@ -13754,7 +13881,7 @@ $.extend( $.easing, {
13754
13881
  })( jQuery, window, document );
13755
13882
 
13756
13883
  /*!
13757
- * # Fomantic-UI 2.9.0-beta.26 - Popup
13884
+ * # Fomantic-UI 2.9.0-beta.262 - Popup
13758
13885
  * http://github.com/fomantic/Fomantic-UI/
13759
13886
  *
13760
13887
  *
@@ -14064,7 +14191,7 @@ $.fn.popup = function(parameters) {
14064
14191
  },
14065
14192
 
14066
14193
  createID: function() {
14067
- id = (Math.random().toString(16) + '000000000').substr(2, 8);
14194
+ id = (Math.random().toString(16) + '000000000').slice(2, 10);
14068
14195
  elementNamespace = '.' + id;
14069
14196
  module.verbose('Creating unique id for element', id);
14070
14197
  },
@@ -15296,7 +15423,7 @@ $.fn.popup.settings = {
15296
15423
  })( jQuery, window, document );
15297
15424
 
15298
15425
  /*!
15299
- * # Fomantic-UI 2.9.0-beta.26 - Progress
15426
+ * # Fomantic-UI 2.9.0-beta.262 - Progress
15300
15427
  * http://github.com/fomantic/Fomantic-UI/
15301
15428
  *
15302
15429
  *
@@ -15904,6 +16031,9 @@ $.fn.progress = function(parameters) {
15904
16031
  }
15905
16032
  else {
15906
16033
  module.remove.active();
16034
+ module.remove.warning();
16035
+ module.remove.error();
16036
+ module.remove.success();
15907
16037
  module.set.label(settings.text.active);
15908
16038
  }
15909
16039
  },
@@ -16330,7 +16460,7 @@ $.fn.progress.settings = {
16330
16460
  })( jQuery, window, document );
16331
16461
 
16332
16462
  /*!
16333
- * # Fomantic-UI 2.9.0-beta.26 - Slider
16463
+ * # Fomantic-UI 2.9.0-beta.262 - Slider
16334
16464
  * http://github.com/fomantic/Fomantic-UI/
16335
16465
  *
16336
16466
  *
@@ -17669,7 +17799,7 @@ $.fn.slider.settings = {
17669
17799
  })( jQuery, window, document );
17670
17800
 
17671
17801
  /*!
17672
- * # Fomantic-UI 2.9.0-beta.26 - Rating
17802
+ * # Fomantic-UI 2.9.0-beta.262 - Rating
17673
17803
  * http://github.com/fomantic/Fomantic-UI/
17674
17804
  *
17675
17805
  *
@@ -18224,7 +18354,7 @@ $.fn.rating.settings = {
18224
18354
  })( jQuery, window, document );
18225
18355
 
18226
18356
  /*!
18227
- * # Fomantic-UI 2.9.0-beta.26 - Search
18357
+ * # Fomantic-UI 2.9.0-beta.262 - Search
18228
18358
  * http://github.com/fomantic/Fomantic-UI/
18229
18359
  *
18230
18360
  *
@@ -18628,7 +18758,7 @@ $.fn.search = function(parameters) {
18628
18758
  return $results.hasClass(className.animating);
18629
18759
  },
18630
18760
  chrome: function() {
18631
- return !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime);
18761
+ return !!window.chrome && !window.StyleMedia;
18632
18762
  },
18633
18763
  hidden: function() {
18634
18764
  return $results.hasClass(className.hidden);
@@ -19792,7 +19922,7 @@ $.fn.search.settings = {
19792
19922
  })( jQuery, window, document );
19793
19923
 
19794
19924
  /*!
19795
- * # Fomantic-UI 2.9.0-beta.26 - Shape
19925
+ * # Fomantic-UI 2.9.0-beta.262 - Shape
19796
19926
  * http://github.com/fomantic/Fomantic-UI/
19797
19927
  *
19798
19928
  *
@@ -19919,7 +20049,7 @@ $.fn.shape = function(parameters) {
19919
20049
  module.reset();
19920
20050
  module.set.active();
19921
20051
  };
19922
- settings.beforeChange.call($nextSide[0]);
20052
+ settings.onBeforeChange.call($nextSide[0]);
19923
20053
  if(module.get.transitionEvent()) {
19924
20054
  module.verbose('Starting CSS animation');
19925
20055
  $module
@@ -20606,7 +20736,7 @@ $.fn.shape.settings = {
20606
20736
  height: 'initial',
20607
20737
 
20608
20738
  // callback occurs on side change
20609
- beforeChange : function() {},
20739
+ onBeforeChange : function() {},
20610
20740
  onChange : function() {},
20611
20741
 
20612
20742
  // allow animation to same side
@@ -20641,7 +20771,7 @@ $.fn.shape.settings = {
20641
20771
  })( jQuery, window, document );
20642
20772
 
20643
20773
  /*!
20644
- * # Fomantic-UI 2.9.0-beta.26 - Sidebar
20774
+ * # Fomantic-UI 2.9.0-beta.262 - Sidebar
20645
20775
  * http://github.com/fomantic/Fomantic-UI/
20646
20776
  *
20647
20777
  *
@@ -20760,7 +20890,7 @@ $.fn.sidebar = function(parameters) {
20760
20890
 
20761
20891
  create: {
20762
20892
  id: function() {
20763
- id = (Math.random().toString(16) + '000000000').substr(2,8);
20893
+ id = (Math.random().toString(16) + '000000000').slice(2, 10);
20764
20894
  elementNamespace = '.' + id;
20765
20895
  module.verbose('Creating unique id for element', id);
20766
20896
  }
@@ -21013,6 +21143,10 @@ $.fn.sidebar = function(parameters) {
21013
21143
  : function(){}
21014
21144
  ;
21015
21145
  if(module.is.hidden()) {
21146
+ if(settings.onShow.call(element) === false) {
21147
+ module.verbose('Show callback returned false cancelling show');
21148
+ return;
21149
+ }
21016
21150
  module.refreshSidebars();
21017
21151
  if(settings.overlay) {
21018
21152
  module.error(error.overlay);
@@ -21037,10 +21171,9 @@ $.fn.sidebar = function(parameters) {
21037
21171
  }
21038
21172
  module.pushPage(function() {
21039
21173
  callback.call(element);
21040
- settings.onShow.call(element);
21174
+ settings.onVisible.call(element);
21041
21175
  });
21042
21176
  settings.onChange.call(element);
21043
- settings.onVisible.call(element);
21044
21177
  }
21045
21178
  else {
21046
21179
  module.debug('Sidebar is already visible');
@@ -21052,7 +21185,7 @@ $.fn.sidebar = function(parameters) {
21052
21185
  ? callback
21053
21186
  : function(){}
21054
21187
  ;
21055
- if(module.is.visible() || module.is.animating()) {
21188
+ if((module.is.visible() || module.is.animating()) && settings.onHide.call(element) !== false) {
21056
21189
  module.debug('Hiding sidebar', callback);
21057
21190
  module.refreshSidebars();
21058
21191
  module.pullPage(function() {
@@ -21060,7 +21193,6 @@ $.fn.sidebar = function(parameters) {
21060
21193
  settings.onHidden.call(element);
21061
21194
  });
21062
21195
  settings.onChange.call(element);
21063
- settings.onHide.call(element);
21064
21196
  }
21065
21197
  },
21066
21198
 
@@ -21678,7 +21810,7 @@ $.fn.sidebar.settings = {
21678
21810
  })( jQuery, window, document );
21679
21811
 
21680
21812
  /*!
21681
- * # Fomantic-UI 2.9.0-beta.26 - Sticky
21813
+ * # Fomantic-UI 2.9.0-beta.262 - Sticky
21682
21814
  * http://github.com/fomantic/Fomantic-UI/
21683
21815
  *
21684
21816
  *
@@ -22636,7 +22768,7 @@ $.fn.sticky.settings = {
22636
22768
  })( jQuery, window, document );
22637
22769
 
22638
22770
  /*!
22639
- * # Fomantic-UI 2.9.0-beta.26 - Tab
22771
+ * # Fomantic-UI 2.9.0-beta.262 - Tab
22640
22772
  * http://github.com/fomantic/Fomantic-UI/
22641
22773
  *
22642
22774
  *
@@ -22737,10 +22869,18 @@ $.fn.tab = function(parameters) {
22737
22869
  initializedHistory = true;
22738
22870
  }
22739
22871
 
22740
- if(settings.autoTabActivation && instance === undefined && module.determine.activeTab() == null) {
22741
- module.debug('No active tab detected, setting first tab active', module.get.initialPath());
22742
- module.changeTab(settings.autoTabActivation === true ? module.get.initialPath() : settings.autoTabActivation);
22743
- };
22872
+ var activeTab = module.determine.activeTab();
22873
+ if(settings.autoTabActivation && instance === undefined && activeTab == null) {
22874
+ activeTab = settings.autoTabActivation === true ? module.get.initialPath() : settings.autoTabActivation;
22875
+ module.debug('No active tab detected, setting tab active', activeTab);
22876
+ module.changeTab(activeTab);
22877
+ }
22878
+ if(activeTab != null && settings.history) {
22879
+ var autoUpdate = $.address.autoUpdate();
22880
+ $.address.autoUpdate(false);
22881
+ $.address.value(activeTab);
22882
+ $.address.autoUpdate(autoUpdate);
22883
+ }
22744
22884
 
22745
22885
  module.instantiate();
22746
22886
  },
@@ -22840,6 +22980,7 @@ $.fn.tab = function(parameters) {
22840
22980
  .history(true)
22841
22981
  .state(settings.path)
22842
22982
  ;
22983
+ $(window).trigger('popstate');
22843
22984
  }
22844
22985
  else {
22845
22986
  module.error(error.path);
@@ -23007,6 +23148,10 @@ $.fn.tab = function(parameters) {
23007
23148
  module.verbose('Tab parameters found', nextPathArray);
23008
23149
  }
23009
23150
  }
23151
+ if (settings.onBeforeChange.call(element, currentPath) === false) {
23152
+ module.debug('onBeforeChange returned false, cancelling tab change', $tab);
23153
+ return false;
23154
+ }
23010
23155
  if(isLastTab && remoteContent) {
23011
23156
  if(!shouldIgnoreLoad) {
23012
23157
  module.activate.navigation(currentPath);
@@ -23043,6 +23188,10 @@ $.fn.tab = function(parameters) {
23043
23188
  // if anchor exists use parent tab
23044
23189
  if($anchor && $anchor.length > 0 && currentPath) {
23045
23190
  module.debug('Anchor link used, opening parent tab', $tab, $anchor);
23191
+ if (settings.onBeforeChange.call(element, currentPath) === false) {
23192
+ module.debug('onBeforeChange returned false, cancelling tab change', $tab);
23193
+ return false;
23194
+ }
23046
23195
  if( !$tab.hasClass(className.active) ) {
23047
23196
  setTimeout(function() {
23048
23197
  module.scrollTo($anchor);
@@ -23596,6 +23745,7 @@ $.fn.tab.settings = {
23596
23745
  onLoad : function(tabPath, parameterArray, historyEvent) {}, // called on every load
23597
23746
  onVisible : function(tabPath, parameterArray, historyEvent) {}, // called every time tab visible
23598
23747
  onRequest : function(tabPath, parameterArray, historyEvent) {}, // called ever time a tab beings loading remote content
23748
+ onBeforeChange: function(tabPath) {}, // called before a tab is about to be changed. Returning false will cancel the tab change
23599
23749
 
23600
23750
  templates : {
23601
23751
  determineTitle: function(tabArray) {} // returns page title for path
@@ -23638,7 +23788,7 @@ $.fn.tab.settings = {
23638
23788
  })( jQuery, window, document );
23639
23789
 
23640
23790
  /*!
23641
- * # Fomantic-UI 2.9.0-beta.26 - Toast
23791
+ * # Fomantic-UI 2.9.0-beta.262 - Toast
23642
23792
  * http://github.com/fomantic/Fomantic-UI/
23643
23793
  *
23644
23794
  *
@@ -23708,12 +23858,14 @@ $.fn.toast = function(parameters) {
23708
23858
  element = this,
23709
23859
  instance = isToastComponent ? $module.data(moduleNamespace) : undefined,
23710
23860
 
23861
+ id,
23711
23862
  module
23712
23863
  ;
23713
23864
  module = {
23714
23865
 
23715
23866
  initialize: function() {
23716
23867
  module.verbose('Initializing element');
23868
+ module.create.id();
23717
23869
  if (!module.has.container()) {
23718
23870
  module.create.container();
23719
23871
  }
@@ -23763,17 +23915,22 @@ $.fn.toast = function(parameters) {
23763
23915
  },
23764
23916
 
23765
23917
  show: function(callback) {
23766
- callback = callback || function(){};
23767
- module.debug('Showing toast');
23768
23918
  if(settings.onShow.call($toastBox, element) === false) {
23769
23919
  module.debug('onShow callback returned false, cancelling toast animation');
23770
23920
  return;
23771
23921
  }
23922
+ callback = callback || function(){};
23923
+ module.debug('Showing toast');
23772
23924
  module.animate.show(callback);
23773
23925
  },
23774
23926
 
23775
23927
  close: function(callback) {
23928
+ if(settings.onHide.call($toastBox, element) === false) {
23929
+ module.debug('onHide callback returned false, cancelling toast animation');
23930
+ return;
23931
+ }
23776
23932
  callback = callback || function(){};
23933
+ module.debug('Closing toast');
23777
23934
  module.remove.visible();
23778
23935
  module.unbind.events();
23779
23936
  module.animate.close(callback);
@@ -23785,12 +23942,16 @@ $.fn.toast = function(parameters) {
23785
23942
  module.verbose('Creating container');
23786
23943
  $context.append($('<div/>',{class: settings.position + ' ' + className.container + ' ' +(settings.horizontal ? className.horizontal : '')}));
23787
23944
  },
23945
+ id: function() {
23946
+ id = (Math.random().toString(16) + '000000000').slice(2, 10);
23947
+ module.verbose('Creating unique id for element', id);
23948
+ },
23788
23949
  toast: function() {
23789
23950
  $toastBox = $('<div/>', {class: className.box});
23790
23951
  var iconClass = module.get.iconClass();
23791
23952
  if (!isToastComponent) {
23792
23953
  module.verbose('Creating toast');
23793
- $toast = $('<div/>');
23954
+ $toast = $('<div/>', {role: 'alert'});
23794
23955
  var $content = $('<div/>', {class: className.content});
23795
23956
  if (iconClass !== '') {
23796
23957
  $toast.append($('<i/>', {class: iconClass + ' ' + className.icon}));
@@ -23803,13 +23964,21 @@ $.fn.toast = function(parameters) {
23803
23964
  }));
23804
23965
  }
23805
23966
  if (settings.title !== '') {
23967
+ var titleId = '_' + module.get.id() + 'title';
23968
+ $toast.attr('aria-labelledby', titleId);
23806
23969
  $content.append($('<div/>', {
23807
23970
  class: className.title,
23808
- text: settings.title
23971
+ id: titleId,
23972
+ html: module.helpers.escape(settings.title, settings.preserveHTML)
23809
23973
  }));
23810
23974
  }
23811
-
23812
- $content.append($('<div/>', {class: className.message, html: module.helpers.escape(settings.message, settings.preserveHTML)}));
23975
+ var descId = '_' + module.get.id() + 'desc';
23976
+ $toast.attr('aria-describedby', descId);
23977
+ $content.append($('<div/>', {
23978
+ class: className.message,
23979
+ id: descId,
23980
+ html: module.helpers.escape(settings.message, settings.preserveHTML)
23981
+ }));
23813
23982
 
23814
23983
  $toast
23815
23984
  .addClass(settings.class + ' ' + className.toast)
@@ -23817,7 +23986,7 @@ $.fn.toast = function(parameters) {
23817
23986
  ;
23818
23987
  $toast.css('opacity', settings.opacity);
23819
23988
  if (settings.closeIcon) {
23820
- $close = $('<i/>', {class: className.close + ' ' + (typeof settings.closeIcon === 'string' ? settings.closeIcon : '')});
23989
+ $close = $('<i/>', {class: className.close + ' ' + (typeof settings.closeIcon === 'string' ? settings.closeIcon : ''), role: 'button', tabindex: 0, 'aria-label': settings.text.close});
23821
23990
  if($close.hasClass(className.left)) {
23822
23991
  $toast.prepend($close);
23823
23992
  } else {
@@ -23860,15 +24029,17 @@ $.fn.toast = function(parameters) {
23860
24029
  }
23861
24030
  }
23862
24031
  settings.actions.forEach(function (el) {
23863
- var icon = el[fields.icon] ? '<i class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
24032
+ var icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
23864
24033
  text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
23865
24034
  cls = module.helpers.deQuote(el[fields.class] || ''),
23866
24035
  click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {};
23867
24036
  $actions.append($('<button/>', {
23868
24037
  html: icon + text,
24038
+ 'aria-label': $('<div>'+(el[fields.text] || el[fields.icon] || '')+'</div>').text(),
23869
24039
  class: className.button + ' ' + cls,
23870
24040
  click: function () {
23871
- if (click.call(element, $module) === false) {
24041
+ var button = $(this);
24042
+ if (button.is(selector.approve) || button.is(selector.deny) || click.call(element, $module) === false) {
23872
24043
  return;
23873
24044
  }
23874
24045
  module.close();
@@ -23968,13 +24139,12 @@ $.fn.toast = function(parameters) {
23968
24139
  bind: {
23969
24140
  events: function() {
23970
24141
  module.debug('Binding events to toast');
23971
- if(settings.closeOnClick || settings.closeIcon) {
23972
- (settings.closeIcon ? $close : $toast)
23973
- .on('click' + eventNamespace, module.event.click)
23974
- ;
24142
+ if(settings.closeIcon) {
24143
+ $close.on('click' + eventNamespace, module.event.close);
23975
24144
  }
24145
+ $toast.on('click' + eventNamespace, module.event.click);
23976
24146
  if($animationObject) {
23977
- $animationObject.on('animationend' + eventNamespace, module.close);
24147
+ $animationObject.on('animationend' + eventNamespace, module.event.close);
23978
24148
  }
23979
24149
  $toastBox
23980
24150
  .on('click' + eventNamespace, selector.approve, module.event.approve)
@@ -23986,11 +24156,10 @@ $.fn.toast = function(parameters) {
23986
24156
  unbind: {
23987
24157
  events: function() {
23988
24158
  module.debug('Unbinding events to toast');
23989
- if(settings.closeOnClick || settings.closeIcon) {
23990
- (settings.closeIcon ? $close : $toast)
23991
- .off('click' + eventNamespace)
23992
- ;
24159
+ if(settings.closeIcon) {
24160
+ $close.off('click' + eventNamespace);
23993
24161
  }
24162
+ $toast.off('click' + eventNamespace);
23994
24163
  if($animationObject) {
23995
24164
  $animationObject.off('animationend' + eventNamespace);
23996
24165
  }
@@ -24022,11 +24191,6 @@ $.fn.toast = function(parameters) {
24022
24191
  },
24023
24192
  close: function(callback) {
24024
24193
  callback = $.isFunction(callback) ? callback : function(){};
24025
- module.debug('Closing toast');
24026
- if(settings.onHide.call($toastBox, element) === false) {
24027
- module.debug('onHide callback returned false, cancelling toast animation');
24028
- return;
24029
- }
24030
24194
  if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
24031
24195
  $toastBox
24032
24196
  .transition({
@@ -24082,7 +24246,7 @@ $.fn.toast = function(parameters) {
24082
24246
  has: {
24083
24247
  container: function() {
24084
24248
  module.verbose('Determining if there is already a container');
24085
- return ($context.find(module.helpers.toClass(settings.position) + selector.container + (settings.horizontal ? module.helpers.toClass(className.horizontal) : '')).length > 0);
24249
+ return ($context.find(module.helpers.toClass(settings.position) + selector.container + (settings.horizontal ? module.helpers.toClass(className.horizontal) : ':not('+module.helpers.toClass(className.horizontal)+')')).length > 0);
24086
24250
  },
24087
24251
  toast: function(){
24088
24252
  return !!module.get.toast();
@@ -24096,8 +24260,11 @@ $.fn.toast = function(parameters) {
24096
24260
  },
24097
24261
 
24098
24262
  get: {
24263
+ id: function() {
24264
+ return id;
24265
+ },
24099
24266
  container: function() {
24100
- return ($context.find(module.helpers.toClass(settings.position) + selector.container)[0]);
24267
+ return ($context.find(module.helpers.toClass(settings.position) + selector.container + (settings.horizontal ? module.helpers.toClass(className.horizontal) : ':not('+module.helpers.toClass(className.horizontal)+')'))[0]);
24101
24268
  },
24102
24269
  toastBox: function() {
24103
24270
  return $toastBox || null;
@@ -24129,9 +24296,15 @@ $.fn.toast = function(parameters) {
24129
24296
  },
24130
24297
 
24131
24298
  event: {
24299
+ close: function(){
24300
+ module.close();
24301
+ },
24132
24302
  click: function(event) {
24133
- if($(event.target).closest('a').length === 0) {
24134
- settings.onClick.call($toastBox, element);
24303
+ if($(event.target).closest(selector.clickable).length === 0) {
24304
+ if(settings.onClick.call($toastBox, element) === false || !settings.closeOnClick) {
24305
+ module.verbose('Click callback returned false or close denied by setting cancelling close');
24306
+ return;
24307
+ }
24135
24308
  module.close();
24136
24309
  }
24137
24310
  },
@@ -24472,6 +24645,10 @@ $.fn.toast.settings = {
24472
24645
  unclickable : 'unclickable'
24473
24646
  },
24474
24647
 
24648
+ text: {
24649
+ close : 'Close'
24650
+ },
24651
+
24475
24652
  icons : {
24476
24653
  info : 'info',
24477
24654
  success : 'checkmark',
@@ -24488,6 +24665,7 @@ $.fn.toast.settings = {
24488
24665
  image : '> img.image, > .image > img',
24489
24666
  icon : '> i.icon',
24490
24667
  input : 'input:not([type="hidden"]), textarea, select, button, .ui.button, ui.dropdown',
24668
+ clickable : 'a, details, .ui.accordion',
24491
24669
  approve : '.actions .positive, .actions .approve, .actions .ok',
24492
24670
  deny : '.actions .negative, .actions .deny, .actions .cancel'
24493
24671
  },
@@ -24531,7 +24709,7 @@ $.extend( $.easing, {
24531
24709
  })( jQuery, window, document );
24532
24710
 
24533
24711
  /*!
24534
- * # Fomantic-UI 2.9.0-beta.26 - Transition
24712
+ * # Fomantic-UI 2.9.0-beta.262 - Transition
24535
24713
  * http://github.com/fomantic/Fomantic-UI/
24536
24714
  *
24537
24715
  *
@@ -25303,6 +25481,10 @@ $.fn.transition = function() {
25303
25481
  },
25304
25482
 
25305
25483
  hide: function() {
25484
+ if(settings.onHide.call(element) === false) {
25485
+ module.verbose('Hide callback returned false cancelling hide');
25486
+ return false;
25487
+ }
25306
25488
  module.verbose('Hiding element');
25307
25489
  if( module.is.animating() ) {
25308
25490
  module.reset();
@@ -25310,35 +25492,32 @@ $.fn.transition = function() {
25310
25492
  element.blur(); // IE will trigger focus change if element is not blurred before hiding
25311
25493
  module.remove.display();
25312
25494
  module.remove.visible();
25313
- if($.isFunction(settings.onBeforeHide)){
25314
- settings.onBeforeHide.call(element,function(){
25315
- module.hideNow();
25316
- });
25317
- } else {
25318
- module.hideNow();
25319
- }
25320
-
25495
+ settings.onBeforeHide.call(element, module.hideNow);
25321
25496
  },
25322
25497
 
25323
25498
  hideNow: function() {
25324
25499
  module.set.hidden();
25325
25500
  module.force.hidden();
25326
- settings.onHide.call(element);
25501
+ settings.onHidden.call(element);
25327
25502
  settings.onComplete.call(element);
25328
25503
  // module.repaint();
25329
25504
  },
25330
25505
 
25331
25506
  show: function(display) {
25332
- module.verbose('Showing element', display);
25333
- if(module.force.visible()) {
25507
+ if(module.force.visible() && settings.onShow.call(element) !== false) {
25508
+ module.verbose('Showing element', display);
25334
25509
  module.remove.hidden();
25335
- module.set.visible();
25336
- settings.onShow.call(element);
25337
- settings.onComplete.call(element);
25338
- // module.repaint();
25510
+ settings.onBeforeShow.call(element, module.showNow);
25339
25511
  }
25340
25512
  },
25341
25513
 
25514
+ showNow: function(){
25515
+ module.set.visible();
25516
+ settings.onVisible.call(element);
25517
+ settings.onComplete.call(element);
25518
+ // module.repaint();
25519
+ },
25520
+
25342
25521
  toggle: function() {
25343
25522
  if( module.is.visible() ) {
25344
25523
  module.hide();
@@ -25587,7 +25766,11 @@ $.fn.transition.settings = {
25587
25766
  onStart : function() {},
25588
25767
  onComplete : function() {},
25589
25768
  onShow : function() {},
25769
+ onBeforeShow : function(callback) {callback.call(this)},
25770
+ onVisible : function() {},
25590
25771
  onHide : function() {},
25772
+ onHidden : function() {},
25773
+ onBeforeHide : function(callback) {callback.call(this)},
25591
25774
 
25592
25775
  // whether timeout should be used to ensure callback fires in cases animationend does not
25593
25776
  useFailSafe : true,
@@ -25641,7 +25824,7 @@ $.fn.transition.settings = {
25641
25824
  })( jQuery, window, document );
25642
25825
 
25643
25826
  /*!
25644
- * # Fomantic-UI 2.9.0-beta.26 - API
25827
+ * # Fomantic-UI 2.9.0-beta.262 - API
25645
25828
  * http://github.com/fomantic/Fomantic-UI/
25646
25829
  *
25647
25830
  *
@@ -25716,6 +25899,7 @@ $.api = $.fn.api = function(parameters) {
25716
25899
  url,
25717
25900
  data,
25718
25901
  requestStartTime,
25902
+ originalData,
25719
25903
 
25720
25904
  // standard module
25721
25905
  element = this,
@@ -25728,6 +25912,7 @@ $.api = $.fn.api = function(parameters) {
25728
25912
 
25729
25913
  initialize: function() {
25730
25914
  if(!methodInvoked) {
25915
+ originalData = settings.data;
25731
25916
  module.bind.events();
25732
25917
  }
25733
25918
  module.instantiate();
@@ -25790,8 +25975,8 @@ $.api = $.fn.api = function(parameters) {
25790
25975
  module.error(error.noStorage);
25791
25976
  return;
25792
25977
  }
25793
- response = sessionStorage.getItem(url);
25794
- module.debug('Using cached response', url, response);
25978
+ response = sessionStorage.getItem(url + module.get.normalizedData());
25979
+ module.debug('Using cached response', url, settings.data, response);
25795
25980
  response = module.decode.json(response);
25796
25981
  return response;
25797
25982
  }
@@ -25809,8 +25994,8 @@ $.api = $.fn.api = function(parameters) {
25809
25994
  if( $.isPlainObject(response) ) {
25810
25995
  response = JSON.stringify(response);
25811
25996
  }
25812
- sessionStorage.setItem(url, response);
25813
- module.verbose('Storing cached response for url', url, response);
25997
+ sessionStorage.setItem(url + module.get.normalizedData(), response);
25998
+ module.verbose('Storing cached response for url', url, settings.data, response);
25814
25999
  }
25815
26000
  },
25816
26001
 
@@ -25839,7 +26024,7 @@ $.api = $.fn.api = function(parameters) {
25839
26024
 
25840
26025
  // Add form content
25841
26026
  if(settings.serializeForm) {
25842
- settings.data = module.add.formData(settings.data);
26027
+ settings.data = module.add.formData(originalData || settings.data);
25843
26028
  }
25844
26029
 
25845
26030
  // call beforesend and get any settings changes
@@ -25976,10 +26161,6 @@ $.api = $.fn.api = function(parameters) {
25976
26161
  cancelled: function() {
25977
26162
  return (module.cancelled || false);
25978
26163
  },
25979
- succesful: function() {
25980
- module.verbose('This behavior will be deleted due to typo. Use "was successful" instead.');
25981
- return module.was.successful();
25982
- },
25983
26164
  successful: function() {
25984
26165
  return (module.request && module.request.state() == 'resolved');
25985
26166
  },
@@ -26007,8 +26188,8 @@ $.api = $.fn.api = function(parameters) {
26007
26188
  var
26008
26189
  // allow legacy {$var} style
26009
26190
  variable = (templatedString.indexOf('$') !== -1)
26010
- ? templatedString.substr(2, templatedString.length - 3)
26011
- : templatedString.substr(1, templatedString.length - 2),
26191
+ ? templatedString.slice(2, -1)
26192
+ : templatedString.slice(1, -1),
26012
26193
  value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
26013
26194
  ? urlData[variable]
26014
26195
  : ($module.data(variable) !== undefined)
@@ -26039,8 +26220,8 @@ $.api = $.fn.api = function(parameters) {
26039
26220
  var
26040
26221
  // allow legacy {/$var} style
26041
26222
  variable = (templatedString.indexOf('$') !== -1)
26042
- ? templatedString.substr(3, templatedString.length - 4)
26043
- : templatedString.substr(2, templatedString.length - 3),
26223
+ ? templatedString.slice(3, -1)
26224
+ : templatedString.slice(2, -1),
26044
26225
  value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
26045
26226
  ? urlData[variable]
26046
26227
  : ($module.data(variable) !== undefined)
@@ -26071,25 +26252,29 @@ $.api = $.fn.api = function(parameters) {
26071
26252
  },
26072
26253
  formData: function(data) {
26073
26254
  var
26074
- canSerialize = ($.fn.serializeObject !== undefined),
26075
- formData = (canSerialize)
26076
- ? $form.serializeObject()
26077
- : $form.serialize(),
26255
+ formData = {},
26078
26256
  hasOtherData
26079
26257
  ;
26080
- data = data || settings.data;
26258
+ data = data || originalData || settings.data;
26081
26259
  hasOtherData = $.isPlainObject(data);
26082
26260
 
26083
- if(hasOtherData) {
26084
- if(canSerialize) {
26085
- module.debug('Extending existing data with form data', data, formData);
26086
- data = $.extend(true, {}, data, formData);
26087
- }
26088
- else {
26089
- module.error(error.missingSerialize);
26090
- module.debug('Cant extend data. Replacing data with form data', data, formData);
26091
- data = formData;
26261
+ $.each($form.serializeArray(), function (i, element) {
26262
+ var node = formData[element.name];
26263
+
26264
+ if ('undefined' !== typeof node && node !== null) {
26265
+ if (Array.isArray(node)) {
26266
+ node.push(element.value);
26267
+ } else {
26268
+ formData[element.name] = [node, element.value];
26269
+ }
26270
+ } else {
26271
+ formData[element.name] = element.value;
26092
26272
  }
26273
+ });
26274
+
26275
+ if(hasOtherData) {
26276
+ module.debug('Extending existing data with form data', data, formData);
26277
+ data = $.extend(true, {}, data, formData);
26093
26278
  }
26094
26279
  else {
26095
26280
  module.debug('Adding form data', formData);
@@ -26340,6 +26525,9 @@ $.api = $.fn.api = function(parameters) {
26340
26525
  },
26341
26526
 
26342
26527
  get: {
26528
+ normalizedData: function(){
26529
+ return typeof settings.data === "string" ? settings.data : JSON.stringify(settings.data, Object.keys(settings.data).sort());
26530
+ },
26343
26531
  responseFromXHR: function(xhr) {
26344
26532
  return $.isPlainObject(xhr)
26345
26533
  ? (module.is.expectingJSON())
@@ -26747,7 +26935,7 @@ $.api.settings = {
26747
26935
  responseAsync : false,
26748
26936
 
26749
26937
  // whether onResponse should work with response value without force converting into an object
26750
- rawResponse : false,
26938
+ rawResponse : true,
26751
26939
 
26752
26940
  // callbacks before request
26753
26941
  beforeSend : function(settings) { return settings; },
@@ -26783,7 +26971,6 @@ $.api.settings = {
26783
26971
  legacyParameters : 'You are using legacy API success callback names',
26784
26972
  method : 'The method you called is not defined',
26785
26973
  missingAction : 'API action used but no url was defined',
26786
- missingSerialize : 'jquery-serialize-object is required to add form data to an existing data object',
26787
26974
  missingURL : 'No URL specified for api event',
26788
26975
  noReturnedValue : 'The beforeSend callback must return a settings object, beforeSend ignored.',
26789
26976
  noStorage : 'Caching responses locally requires session storage',
@@ -26819,7 +27006,7 @@ $.api.settings = {
26819
27006
  })( jQuery, window, document );
26820
27007
 
26821
27008
  /*!
26822
- * # Fomantic-UI 2.9.0-beta.26 - State
27009
+ * # Fomantic-UI 2.9.0-beta.262 - State
26823
27010
  * http://github.com/fomantic/Fomantic-UI/
26824
27011
  *
26825
27012
  *
@@ -27531,7 +27718,7 @@ $.fn.state.settings = {
27531
27718
  })( jQuery, window, document );
27532
27719
 
27533
27720
  /*!
27534
- * # Fomantic-UI 2.9.0-beta.26 - Visibility
27721
+ * # Fomantic-UI 2.9.0-beta.262 - Visibility
27535
27722
  * http://github.com/fomantic/Fomantic-UI/
27536
27723
  *
27537
27724
  *