fomantic-ui 2.9.0-beta.27 → 2.9.0-beta.272

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 (287) hide show
  1. package/.all-contributorsrc +215 -3
  2. package/.github/workflows/ci.yml +6 -6
  3. package/.github/workflows/nightly.yml +13 -8
  4. package/.github/workflows/release.yml +31 -0
  5. package/CONTRIBUTORS.md +76 -37
  6. package/README.md +8 -8
  7. package/dist/components/accordion.css +175 -35
  8. package/dist/components/accordion.js +6 -3
  9. package/dist/components/accordion.min.css +2 -2
  10. package/dist/components/accordion.min.js +3 -3
  11. package/dist/components/ad.css +1 -1
  12. package/dist/components/ad.min.css +1 -1
  13. package/dist/components/api.js +88 -29
  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 +6 -4
  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 +97 -3
  32. package/dist/components/container.min.css +2 -2
  33. package/dist/components/dimmer.css +29 -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 +54 -14
  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 +3 -3
  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 +132 -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 +14 -10
  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 +754 -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 +3 -3
  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 +3 -3
  103. package/dist/components/reset.css +3 -2
  104. package/dist/components/reset.min.css +2 -2
  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 +65 -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 +3 -3
  125. package/dist/components/slider.js +1 -1
  126. package/dist/components/slider.min.js +3 -3
  127. package/dist/components/state.js +1 -1
  128. package/dist/components/state.min.js +3 -3
  129. package/dist/components/statistic.css +1 -1
  130. package/dist/components/statistic.min.css +1 -1
  131. package/dist/components/step.css +3 -3
  132. package/dist/components/step.min.css +1 -1
  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 +3 -3
  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 +3 -3
  155. package/dist/semantic.css +21972 -16244
  156. package/dist/semantic.js +488 -242
  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 +12 -11
  177. package/scripts/nightly-version.js +47 -38
  178. package/src/definitions/behaviors/api.js +87 -28
  179. package/src/definitions/behaviors/form.js +37 -28
  180. package/src/definitions/collections/form.less +204 -140
  181. package/src/definitions/collections/grid.less +716 -680
  182. package/src/definitions/collections/menu.less +173 -126
  183. package/src/definitions/collections/message.less +48 -46
  184. package/src/definitions/collections/table.less +849 -262
  185. package/src/definitions/elements/button.less +586 -449
  186. package/src/definitions/elements/container.less +145 -8
  187. package/src/definitions/elements/emoji.less +15 -9
  188. package/src/definitions/elements/flag.less +7 -17
  189. package/src/definitions/elements/header.less +44 -35
  190. package/src/definitions/elements/icon.less +38 -31
  191. package/src/definitions/elements/input.less +264 -22
  192. package/src/definitions/elements/label.less +92 -91
  193. package/src/definitions/elements/list.less +55 -45
  194. package/src/definitions/elements/loader.less +30 -29
  195. package/src/definitions/elements/segment.less +147 -28
  196. package/src/definitions/elements/step.less +52 -48
  197. package/src/definitions/elements/text.less +17 -15
  198. package/src/definitions/globals/site.less +23 -2
  199. package/src/definitions/modules/accordion.js +5 -2
  200. package/src/definitions/modules/accordion.less +181 -29
  201. package/src/definitions/modules/calendar.js +5 -3
  202. package/src/definitions/modules/calendar.less +20 -0
  203. package/src/definitions/modules/checkbox.js +16 -10
  204. package/src/definitions/modules/checkbox.less +34 -178
  205. package/src/definitions/modules/dimmer.js +10 -4
  206. package/src/definitions/modules/dimmer.less +21 -8
  207. package/src/definitions/modules/dropdown.js +65 -38
  208. package/src/definitions/modules/dropdown.less +148 -97
  209. package/src/definitions/modules/modal.js +126 -48
  210. package/src/definitions/modules/modal.less +12 -0
  211. package/src/definitions/modules/nag.less +20 -19
  212. package/src/definitions/modules/popup.js +1 -1
  213. package/src/definitions/modules/progress.js +3 -0
  214. package/src/definitions/modules/progress.less +19 -18
  215. package/src/definitions/modules/rating.less +35 -34
  216. package/src/definitions/modules/search.js +1 -1
  217. package/src/definitions/modules/search.less +32 -16
  218. package/src/definitions/modules/shape.js +2 -2
  219. package/src/definitions/modules/sidebar.js +7 -5
  220. package/src/definitions/modules/sidebar.less +33 -19
  221. package/src/definitions/modules/slider.less +39 -38
  222. package/src/definitions/modules/tab.js +22 -4
  223. package/src/definitions/modules/toast.js +55 -27
  224. package/src/definitions/modules/toast.less +48 -16
  225. package/src/definitions/modules/transition.js +20 -15
  226. package/src/definitions/views/card.less +402 -361
  227. package/src/definitions/views/comment.less +92 -81
  228. package/src/definitions/views/feed.less +164 -144
  229. package/src/definitions/views/item.less +249 -196
  230. package/src/definitions/views/statistic.less +90 -88
  231. package/src/themes/bookish/elements/header.overrides +1 -1
  232. package/src/themes/chubby/elements/button.overrides +1 -1
  233. package/src/themes/chubby/elements/header.overrides +1 -1
  234. package/src/themes/default/assets/fonts/brand-icons.eot +0 -0
  235. package/src/themes/default/assets/fonts/brand-icons.svg +801 -654
  236. package/src/themes/default/assets/fonts/brand-icons.ttf +0 -0
  237. package/src/themes/default/assets/fonts/brand-icons.woff +0 -0
  238. package/src/themes/default/assets/fonts/brand-icons.woff2 +0 -0
  239. package/src/themes/default/assets/fonts/icons.eot +0 -0
  240. package/src/themes/default/assets/fonts/icons.svg +1175 -1079
  241. package/src/themes/default/assets/fonts/icons.ttf +0 -0
  242. package/src/themes/default/assets/fonts/icons.woff +0 -0
  243. package/src/themes/default/assets/fonts/icons.woff2 +0 -0
  244. package/src/themes/default/assets/fonts/outline-icons.eot +0 -0
  245. package/src/themes/default/assets/fonts/outline-icons.svg +93 -95
  246. package/src/themes/default/assets/fonts/outline-icons.ttf +0 -0
  247. package/src/themes/default/assets/fonts/outline-icons.woff +0 -0
  248. package/src/themes/default/assets/fonts/outline-icons.woff2 +0 -0
  249. package/src/themes/default/collections/form.variables +4 -0
  250. package/src/themes/default/collections/menu.variables +6 -0
  251. package/src/themes/default/collections/table.variables +52 -0
  252. package/src/themes/default/elements/button.variables +7 -1
  253. package/src/themes/default/elements/container.variables +12 -0
  254. package/src/themes/default/elements/emoji.overrides +1734 -1232
  255. package/src/themes/default/elements/flag.overrides +1641 -986
  256. package/src/themes/default/elements/flag.variables +7 -5
  257. package/src/themes/default/elements/icon.overrides +75 -48
  258. package/src/themes/default/elements/icon.variables +1 -0
  259. package/src/themes/default/elements/input.variables +15 -0
  260. package/src/themes/default/elements/segment.variables +8 -0
  261. package/src/themes/default/globals/site.variables +6 -0
  262. package/src/themes/default/globals/variation.variables +139 -6
  263. package/src/themes/default/modules/accordion.overrides +6 -5
  264. package/src/themes/default/modules/accordion.variables +49 -2
  265. package/src/themes/default/modules/calendar.variables +3 -0
  266. package/src/themes/default/modules/checkbox.variables +5 -5
  267. package/src/themes/default/modules/dimmer.variables +1 -1
  268. package/src/themes/default/modules/dropdown.variables +4 -10
  269. package/src/themes/default/modules/modal.variables +13 -0
  270. package/src/themes/default/modules/toast.variables +3 -0
  271. package/src/themes/famfamfam/elements/flag.overrides +1026 -0
  272. package/src/themes/famfamfam/elements/flag.variables +13 -0
  273. package/src/themes/instagram/views/card.overrides +1 -1
  274. package/src/themes/joypixels/elements/emoji.overrides +1759 -1257
  275. package/src/themes/joypixels/elements/emoji.variables +1 -1
  276. package/src/themes/material/collections/menu.overrides +1 -1
  277. package/src/themes/material/elements/button.overrides +1 -1
  278. package/src/themes/material/elements/header.overrides +1 -1
  279. package/src/themes/material/globals/site.variables +0 -1
  280. package/src/themes/material/modules/dropdown.overrides +1 -1
  281. package/src/themes/material/modules/modal.overrides +1 -1
  282. package/src/themes/rtl/globals/site.overrides +1 -1
  283. package/src/themes/twitter/elements/emoji.overrides +1734 -1232
  284. package/tasks/build/css.js +6 -1
  285. package/tasks/config/project/install.js +11 -5
  286. package/tasks/install.js +1 -0
  287. 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.27
2
+ * # Fomantic UI - 2.9.0-beta.272+5e88144
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.27 - Site
12
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - 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.27 - Form Validation
506
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - 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.27 - Accordion
2587
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Accordion
2579
2588
  * http://github.com/fomantic/Fomantic-UI/
2580
2589
  *
2581
2590
  *
@@ -2693,8 +2702,10 @@ $.fn.accordion = function(parameters) {
2693
2702
  },
2694
2703
 
2695
2704
  event: {
2696
- click: function() {
2697
- module.toggle.call(this);
2705
+ click: function(event) {
2706
+ if($(event.target).closest(selector.ignore).length === 0) {
2707
+ module.toggle.call(this);
2708
+ }
2698
2709
  }
2699
2710
  },
2700
2711
 
@@ -3178,6 +3189,7 @@ $.fn.accordion.settings = {
3178
3189
  accordion : '.accordion',
3179
3190
  title : '.title',
3180
3191
  trigger : '.title',
3192
+ ignore : '.ui.dropdown',
3181
3193
  content : '.content'
3182
3194
  }
3183
3195
 
@@ -3194,7 +3206,7 @@ $.extend( $.easing, {
3194
3206
 
3195
3207
 
3196
3208
  /*!
3197
- * # Fomantic-UI 2.9.0-beta.27 - Calendar
3209
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Calendar
3198
3210
  * http://github.com/fomantic/Fomantic-UI/
3199
3211
  *
3200
3212
  *
@@ -3317,7 +3329,7 @@ $.fn.calendar = function(parameters) {
3317
3329
  module.set.maxDate($module.data(metadata.maxDate));
3318
3330
  }
3319
3331
  module.setting('type', module.get.type());
3320
- module.setting('on', settings.on || ($input.length ? 'focus' : 'click'));
3332
+ module.setting('on', settings.on || 'click');
3321
3333
  },
3322
3334
  popup: function () {
3323
3335
  if (settings.inline) {
@@ -3941,7 +3953,7 @@ $.fn.calendar = function(parameters) {
3941
3953
  return $module.data(metadata.maxDate) || null;
3942
3954
  },
3943
3955
  monthOffset: function () {
3944
- return $module.data(metadata.monthOffset) || 0;
3956
+ return $module.data(metadata.monthOffset) || settings.monthOffset || 0;
3945
3957
  },
3946
3958
  mode: function () {
3947
3959
  //only returns valid modes for the current settings
@@ -4647,6 +4659,7 @@ $.fn.calendar.settings = {
4647
4659
  startCalendar : null, // jquery object or selector for another calendar that represents the start date of a date range
4648
4660
  endCalendar : null, // jquery object or selector for another calendar that represents the end date of a date range
4649
4661
  multiMonth : 1, // show multiple months when in 'day' mode
4662
+ monthOffset : 0, // position current month by offset when multimonth > 1
4650
4663
  minTimeGap : 5,
4651
4664
  showWeekNumbers : null, // show Number of Week at the very first column of a dayView
4652
4665
  disabledHours : [], // specific hour(s) which won't be selectable and contain additional information.
@@ -4662,6 +4675,7 @@ $.fn.calendar.settings = {
4662
4675
  position: 'bottom left',
4663
4676
  lastResort: 'bottom left',
4664
4677
  prefer: 'opposite',
4678
+ observeChanges: false,
4665
4679
  hideOnScroll: false
4666
4680
  },
4667
4681
 
@@ -4753,7 +4767,7 @@ $.fn.calendar.settings = {
4753
4767
  if (!text) {
4754
4768
  return null;
4755
4769
  }
4756
- text = String(text).trim();
4770
+ text = String(text).trim().replace(/([.:\/\-])\s+/g,'$1').replace(/\s+([.:\/-])/g,'$1').replace(/\s+/g,' ');
4757
4771
  if (text.length === 0) {
4758
4772
  return null;
4759
4773
  }
@@ -5066,7 +5080,7 @@ $.fn.calendar.settings = {
5066
5080
  })(jQuery, window, document);
5067
5081
 
5068
5082
  /*!
5069
- * # Fomantic-UI 2.9.0-beta.27 - Checkbox
5083
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Checkbox
5070
5084
  * http://github.com/fomantic/Fomantic-UI/
5071
5085
  *
5072
5086
  *
@@ -5306,18 +5320,26 @@ $.fn.checkbox = function(parameters) {
5306
5320
  }
5307
5321
  }
5308
5322
 
5323
+ shortcutPressed = false;
5309
5324
  if(key == keyCode.escape) {
5310
5325
  module.verbose('Escape key pressed blurring field');
5311
5326
  $input.blur();
5312
5327
  shortcutPressed = true;
5313
5328
  }
5314
- else if(!event.ctrlKey && ( key == keyCode.space || (key == keyCode.enter && settings.enableEnterKey)) ) {
5315
- module.verbose('Enter/space key pressed, toggling checkbox');
5316
- module.toggle();
5317
- shortcutPressed = true;
5318
- }
5319
- else {
5320
- shortcutPressed = false;
5329
+ else if(!event.ctrlKey && module.can.change()) {
5330
+ if( key == keyCode.space || (key == keyCode.enter && settings.enableEnterKey) ) {
5331
+ module.verbose('Enter/space key pressed, toggling checkbox');
5332
+ module.toggle();
5333
+ shortcutPressed = true;
5334
+ } else if($module.is('.toggle, .slider') && !module.is.radio()) {
5335
+ if(key == keyCode.left && module.is.checked()) {
5336
+ module.uncheck();
5337
+ shortcutPressed = true;
5338
+ } else if(key == keyCode.right && module.is.unchecked()) {
5339
+ module.check();
5340
+ shortcutPressed = true;
5341
+ }
5342
+ }
5321
5343
  }
5322
5344
  },
5323
5345
  keyup: function(event) {
@@ -5390,7 +5412,6 @@ $.fn.checkbox = function(parameters) {
5390
5412
  settings.onEnable.call(input);
5391
5413
  // preserve legacy callbacks
5392
5414
  settings.onEnabled.call(input);
5393
- module.trigger.change();
5394
5415
  }
5395
5416
  },
5396
5417
 
@@ -5405,7 +5426,6 @@ $.fn.checkbox = function(parameters) {
5405
5426
  settings.onDisable.call(input);
5406
5427
  // preserve legacy callbacks
5407
5428
  settings.onDisabled.call(input);
5408
- module.trigger.change();
5409
5429
  }
5410
5430
  },
5411
5431
 
@@ -5933,7 +5953,7 @@ $.fn.checkbox.settings = {
5933
5953
 
5934
5954
  selector : {
5935
5955
  checkbox : '.ui.checkbox',
5936
- label : 'label, .box',
5956
+ label : 'label',
5937
5957
  input : 'input[type="checkbox"], input[type="radio"]',
5938
5958
  link : 'a[href]'
5939
5959
  }
@@ -5943,7 +5963,7 @@ $.fn.checkbox.settings = {
5943
5963
  })( jQuery, window, document );
5944
5964
 
5945
5965
  /*!
5946
- * # Fomantic-UI 2.9.0-beta.27 - Dimmer
5966
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Dimmer
5947
5967
  * http://github.com/fomantic/Fomantic-UI/
5948
5968
  *
5949
5969
  *
@@ -6136,11 +6156,14 @@ $.fn.dimmer = function(parameters) {
6136
6156
  ? callback
6137
6157
  : function(){}
6138
6158
  ;
6139
- module.debug('Showing dimmer', $dimmer, settings);
6140
- module.set.variation();
6141
6159
  if( (!module.is.dimmed() || module.is.animating()) && module.is.enabled() ) {
6160
+ if(settings.onShow.call(element) === false) {
6161
+ module.verbose('Show callback returned false cancelling dimmer show');
6162
+ return;
6163
+ }
6164
+ module.debug('Showing dimmer', $dimmer, settings);
6165
+ module.set.variation();
6142
6166
  module.animate.show(callback);
6143
- settings.onShow.call(element);
6144
6167
  settings.onChange.call(element);
6145
6168
  }
6146
6169
  else {
@@ -6154,9 +6177,12 @@ $.fn.dimmer = function(parameters) {
6154
6177
  : function(){}
6155
6178
  ;
6156
6179
  if( module.is.dimmed() || module.is.animating() ) {
6180
+ if(settings.onHide.call(element) === false) {
6181
+ module.verbose('Hide callback returned false cancelling dimmer hide');
6182
+ return;
6183
+ }
6157
6184
  module.debug('Hiding dimmer', $dimmer);
6158
6185
  module.animate.hide(callback);
6159
- settings.onHide.call(element);
6160
6186
  settings.onChange.call(element);
6161
6187
  }
6162
6188
  else {
@@ -6700,7 +6726,7 @@ $.fn.dimmer.settings = {
6700
6726
  })( jQuery, window, document );
6701
6727
 
6702
6728
  /*!
6703
- * # Fomantic-UI 2.9.0-beta.27 - Dropdown
6729
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Dropdown
6704
6730
  * http://github.com/fomantic/Fomantic-UI/
6705
6731
  *
6706
6732
  *
@@ -6901,6 +6927,7 @@ $.fn.dropdown = function(parameters) {
6901
6927
  select: function() {
6902
6928
  if(module.has.input() && selectObserver) {
6903
6929
  selectObserver.observe($module[0], {
6930
+ attributes: true,
6904
6931
  childList : true,
6905
6932
  subtree : true
6906
6933
  });
@@ -6925,7 +6952,7 @@ $.fn.dropdown = function(parameters) {
6925
6952
 
6926
6953
  create: {
6927
6954
  id: function() {
6928
- id = (Math.random().toString(16) + '000000000').substr(2, 8);
6955
+ id = (Math.random().toString(16) + '000000000').slice(2, 10);
6929
6956
  elementNamespace = '.' + id;
6930
6957
  module.verbose('Creating unique id for element', id);
6931
6958
  },
@@ -7122,6 +7149,9 @@ $.fn.dropdown = function(parameters) {
7122
7149
  module.debug('Disabling dropdown');
7123
7150
  $module.addClass(className.disabled);
7124
7151
  }
7152
+ if($input.is('[required]')) {
7153
+ settings.forceSelection = true;
7154
+ }
7125
7155
  $input
7126
7156
  .removeAttr('required')
7127
7157
  .removeAttr('class')
@@ -7326,6 +7356,11 @@ $.fn.dropdown = function(parameters) {
7326
7356
  $module
7327
7357
  .on('change' + eventNamespace, selector.input, module.event.change)
7328
7358
  ;
7359
+ if(module.is.multiple() && module.is.searchSelection()) {
7360
+ $module
7361
+ .on('paste' + eventNamespace, selector.search, module.event.paste)
7362
+ ;
7363
+ }
7329
7364
  },
7330
7365
  mouseEvents: function() {
7331
7366
  module.verbose('Binding mouse events');
@@ -7545,7 +7580,7 @@ $.fn.dropdown = function(parameters) {
7545
7580
  var value = module.is.multiple() ? module.get.values() : module.get.value();
7546
7581
  if (value !== '') {
7547
7582
  module.verbose('Value(s) present after click icon, select value(s) in items');
7548
- module.set.selected(value, null, null, true);
7583
+ module.set.selected(value, null, true, true);
7549
7584
  }
7550
7585
  }
7551
7586
  iconClicked = false;
@@ -7774,6 +7809,15 @@ $.fn.dropdown = function(parameters) {
7774
7809
  },
7775
7810
 
7776
7811
  event: {
7812
+ paste: function(event) {
7813
+ var pasteValue = (event.originalEvent.clipboardData || window.clipboardData).getData('text'),
7814
+ tokens = pasteValue.split(settings.delimiter)
7815
+ ;
7816
+ tokens.forEach(function(value){
7817
+ module.set.selected(module.escape.htmlEntities(value.trim()), null, true, true);
7818
+ });
7819
+ event.preventDefault();
7820
+ },
7777
7821
  change: function() {
7778
7822
  if(!internalChange) {
7779
7823
  module.debug('Input changed, updating selection');
@@ -7986,8 +8030,8 @@ $.fn.dropdown = function(parameters) {
7986
8030
  },
7987
8031
  select: {
7988
8032
  mutation: function(mutations) {
7989
- module.debug('<select> modified, recreating menu');
7990
8033
  if(module.is.selectMutation(mutations)) {
8034
+ module.debug('<select> modified, recreating menu');
7991
8035
  module.disconnect.selectObserver();
7992
8036
  module.refresh();
7993
8037
  module.setup.select();
@@ -8214,7 +8258,7 @@ $.fn.dropdown = function(parameters) {
8214
8258
  keydown: function(event) {
8215
8259
  var
8216
8260
  pressedKey = event.which,
8217
- isShortcutKey = module.is.inObject(pressedKey, keys)
8261
+ isShortcutKey = module.is.inObject(pressedKey, keys) || event.key === settings.delimiter
8218
8262
  ;
8219
8263
  if(isShortcutKey) {
8220
8264
  var
@@ -8232,7 +8276,7 @@ $.fn.dropdown = function(parameters) {
8232
8276
  hasSubMenu = ($subMenu.length> 0),
8233
8277
  hasSelectedItem = ($selectedItem.length > 0),
8234
8278
  selectedIsSelectable = ($selectedItem.not(selector.unselectable).length > 0),
8235
- delimiterPressed = (pressedKey == keys.delimiter && settings.allowAdditions && module.is.multiple()),
8279
+ delimiterPressed = (event.key === settings.delimiter && module.is.multiple()),
8236
8280
  isAdditionWithoutMenu = (settings.allowAdditions && settings.hideAdditions && (pressedKey == keys.enter || delimiterPressed) && selectedIsSelectable),
8237
8281
  $nextItem,
8238
8282
  isSubMenuItem,
@@ -8330,7 +8374,7 @@ $.fn.dropdown = function(parameters) {
8330
8374
  .addClass(className.selected)
8331
8375
  ;
8332
8376
  module.set.scrollPosition($nextItem);
8333
- if(settings.selectOnKeydown && module.is.single()) {
8377
+ if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
8334
8378
  module.set.selectedItem($nextItem);
8335
8379
  }
8336
8380
  }
@@ -8357,7 +8401,7 @@ $.fn.dropdown = function(parameters) {
8357
8401
  .addClass(className.selected)
8358
8402
  ;
8359
8403
  module.set.scrollPosition($nextItem);
8360
- if(settings.selectOnKeydown && module.is.single()) {
8404
+ if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
8361
8405
  module.set.selectedItem($nextItem);
8362
8406
  }
8363
8407
  }
@@ -8488,7 +8532,7 @@ $.fn.dropdown = function(parameters) {
8488
8532
  ;
8489
8533
  if( module.can.activate( $(element) ) ) {
8490
8534
  module.set.selected(value, $(element));
8491
- if(!module.is.multiple()) {
8535
+ if(!module.is.multiple() && !(!settings.collapseOnActionable && $(element).hasClass(className.actionable))) {
8492
8536
  module.hideAndClear();
8493
8537
  }
8494
8538
  }
@@ -8501,7 +8545,7 @@ $.fn.dropdown = function(parameters) {
8501
8545
  ;
8502
8546
  if( module.can.activate( $(element) ) ) {
8503
8547
  module.set.value(value, text, $(element));
8504
- if(!module.is.multiple()) {
8548
+ if(!module.is.multiple() && !(!settings.collapseOnActionable && $(element).hasClass(className.actionable))) {
8505
8549
  module.hideAndClear();
8506
8550
  }
8507
8551
  }
@@ -8552,7 +8596,7 @@ $.fn.dropdown = function(parameters) {
8552
8596
  ;
8553
8597
  $sizer.text(value);
8554
8598
  // prevent rounding issues
8555
- return Math.ceil( $sizer.width() + 1);
8599
+ return Math.ceil( $sizer.width() + (module.is.edge() ? 3 : 1));
8556
8600
  },
8557
8601
  selectionCount: function() {
8558
8602
  var
@@ -9021,7 +9065,7 @@ $.fn.dropdown = function(parameters) {
9021
9065
  module.error(error.noStorage);
9022
9066
  return;
9023
9067
  }
9024
- name = sessionStorage.getItem(value);
9068
+ name = sessionStorage.getItem(value + elementNamespace);
9025
9069
  return (name !== undefined)
9026
9070
  ? name
9027
9071
  : false
@@ -9065,7 +9109,7 @@ $.fn.dropdown = function(parameters) {
9065
9109
  return;
9066
9110
  }
9067
9111
  module.verbose('Saving remote data to session storage', value, name);
9068
- sessionStorage.setItem(value, name);
9112
+ sessionStorage.setItem(value + elementNamespace, name);
9069
9113
  }
9070
9114
  },
9071
9115
 
@@ -9125,7 +9169,7 @@ $.fn.dropdown = function(parameters) {
9125
9169
  $nextSelectedItem
9126
9170
  .addClass(className.selected)
9127
9171
  ;
9128
- if(settings.selectOnKeydown && module.is.single()) {
9172
+ if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
9129
9173
  module.set.selectedItem($nextSelectedItem);
9130
9174
  }
9131
9175
  $menu
@@ -9211,7 +9255,7 @@ $.fn.dropdown = function(parameters) {
9211
9255
  var
9212
9256
  length = module.get.query().length
9213
9257
  ;
9214
- $search.val( text.substr(0, length));
9258
+ $search.val( text.slice(0, length));
9215
9259
  },
9216
9260
  scrollPosition: function($item, forceScroll) {
9217
9261
  var
@@ -9328,7 +9372,7 @@ $.fn.dropdown = function(parameters) {
9328
9372
  module.set.scrollPosition($nextValue);
9329
9373
  $selectedItem.removeClass(className.selected);
9330
9374
  $nextValue.addClass(className.selected);
9331
- if(settings.selectOnKeydown && module.is.single()) {
9375
+ if(settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
9332
9376
  module.set.selectedItem($nextValue);
9333
9377
  }
9334
9378
  }
@@ -9466,17 +9510,24 @@ $.fn.dropdown = function(parameters) {
9466
9510
 
9467
9511
  isFiltered = $selected.hasClass(className.filtered),
9468
9512
  isActive = $selected.hasClass(className.active),
9513
+ isActionable = $selected.hasClass(className.actionable),
9469
9514
  isUserValue = $selected.hasClass(className.addition),
9470
9515
  shouldAnimate = (isMultiple && $selectedItem.length == 1)
9471
9516
  ;
9472
- if(isMultiple) {
9517
+ if(isActionable){
9518
+ if((!isMultiple || (!isActive || isUserValue)) && settings.apiSettings && settings.saveRemoteData) {
9519
+ module.save.remoteData(selectedText, selectedValue);
9520
+ }
9521
+ settings.onActionable.call(element, selectedValue, selectedText, $selected);
9522
+ }
9523
+ else if(isMultiple) {
9473
9524
  if(!isActive || isUserValue) {
9474
9525
  if(settings.apiSettings && settings.saveRemoteData) {
9475
9526
  module.save.remoteData(selectedText, selectedValue);
9476
9527
  }
9477
9528
  if(settings.useLabels) {
9478
- module.add.label(selectedValue, selectedText, shouldAnimate);
9479
9529
  module.add.value(selectedValue, selectedText, $selected);
9530
+ module.add.label(selectedValue, selectedText, shouldAnimate);
9480
9531
  module.set.activeItem($selected);
9481
9532
  module.filterActive();
9482
9533
  module.select.nextAvailable($selectedItem);
@@ -9496,7 +9547,7 @@ $.fn.dropdown = function(parameters) {
9496
9547
  if(settings.apiSettings && settings.saveRemoteData) {
9497
9548
  module.save.remoteData(selectedText, selectedValue);
9498
9549
  }
9499
- if (!keepSearchTerm) {
9550
+ if (!keepSearchTerm && !$selected.hasClass(className.actionable)) {
9500
9551
  module.set.text(selectedText);
9501
9552
  }
9502
9553
  module.set.value(selectedValue, selectedText, $selected, preventChangeTrigger);
@@ -9686,7 +9737,7 @@ $.fn.dropdown = function(parameters) {
9686
9737
  }
9687
9738
  // extend current array
9688
9739
  if(Array.isArray(currentValue)) {
9689
- newValue = currentValue.concat([addedValue]);
9740
+ newValue = $selectedItem.hasClass(className.actionable) ? currentValue : currentValue.concat([addedValue]);
9690
9741
  newValue = module.get.uniqueArray(newValue);
9691
9742
  }
9692
9743
  else {
@@ -9770,18 +9821,10 @@ $.fn.dropdown = function(parameters) {
9770
9821
  return;
9771
9822
  }
9772
9823
  // temporarily disconnect observer
9773
- if(selectObserver) {
9774
- selectObserver.disconnect();
9775
- module.verbose('Temporarily disconnecting mutation observer');
9776
- }
9824
+ module.disconnect.selectObserver();
9777
9825
  $option.remove();
9778
9826
  module.verbose('Removing user addition as an <option>', escapedValue);
9779
- if(selectObserver) {
9780
- selectObserver.observe($input[0], {
9781
- childList : true,
9782
- subtree : true
9783
- });
9784
- }
9827
+ module.observe.select();
9785
9828
  },
9786
9829
  message: function() {
9787
9830
  $menu.children(selector.message).remove();
@@ -10080,8 +10123,11 @@ $.fn.dropdown = function(parameters) {
10080
10123
  bubbledIconClick: function(event) {
10081
10124
  return $(event.target).closest($icon).length > 0;
10082
10125
  },
10126
+ edge: function() {
10127
+ return !!window.chrome && !!window.StyleMedia;
10128
+ },
10083
10129
  chrome: function() {
10084
- return !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime);
10130
+ return !!window.chrome && !window.StyleMedia;
10085
10131
  },
10086
10132
  alreadySetup: function() {
10087
10133
  return ($module.is('select') && $module.parent(selector.dropdown).data(moduleNamespace) !== undefined && $module.prev().length === 0);
@@ -10146,7 +10192,7 @@ $.fn.dropdown = function(parameters) {
10146
10192
  selectChanged = false
10147
10193
  ;
10148
10194
  $.each(mutations, function(index, mutation) {
10149
- if($(mutation.target).is('select') || $(mutation.addedNodes).is('select')) {
10195
+ if($(mutation.target).is('select, option, optgroup') || $(mutation.addedNodes).is('select')) {
10150
10196
  selectChanged = true;
10151
10197
  return false;
10152
10198
  }
@@ -10691,7 +10737,7 @@ $.fn.dropdown.settings = {
10691
10737
  keepOnScreen : true, // Whether dropdown should check whether it is on screen before showing
10692
10738
 
10693
10739
  match : 'both', // what to match against with search selection (both, text, or label)
10694
- fullTextSearch : false, // search anywhere in value (set to 'exact' to require exact matches)
10740
+ fullTextSearch : 'exact', // search anywhere in value (set to 'exact' to require exact matches)
10695
10741
  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...)
10696
10742
  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)
10697
10743
 
@@ -10699,7 +10745,7 @@ $.fn.dropdown.settings = {
10699
10745
  preserveHTML : true, // preserve html when selecting value
10700
10746
  sortSelect : false, // sort selection on init
10701
10747
 
10702
- forceSelection : true, // force a choice on blur with search selection
10748
+ forceSelection : false, // force a choice on blur with search selection
10703
10749
 
10704
10750
  allowAdditions : false, // whether multiple select should allow user added values
10705
10751
  ignoreCase : false, // whether to consider case sensitivity when creating labels
@@ -10710,7 +10756,7 @@ $.fn.dropdown.settings = {
10710
10756
  useLabels : true, // whether multiple select should filter currently active selections from choices
10711
10757
  delimiter : ',', // when multiselect uses normal <input> the values will be delimited with this character
10712
10758
 
10713
- showOnFocus : true, // show menu on focus
10759
+ showOnFocus : false, // show menu on focus
10714
10760
  allowReselection : false, // whether current value should trigger callbacks when reselected
10715
10761
  allowTab : true, // add tabindex to element
10716
10762
  allowCategorySelection : false, // allow elements with sub-menus to be selected
@@ -10725,6 +10771,8 @@ $.fn.dropdown.settings = {
10725
10771
 
10726
10772
  headerDivider : true, // whether option headers should have an additional divider line underneath when converted from <select> <optgroup>
10727
10773
 
10774
+ collapseOnActionable : true, // whether the dropdown should collapse upon selection of an actionable item
10775
+
10728
10776
  // label settings on multi-select
10729
10777
  label: {
10730
10778
  transition : 'scale',
@@ -10744,6 +10792,7 @@ $.fn.dropdown.settings = {
10744
10792
  onChange : function(value, text, $selected){},
10745
10793
  onAdd : function(value, text, $selected){},
10746
10794
  onRemove : function(value, text, $selected){},
10795
+ onActionable : function(value, text, $selected){},
10747
10796
  onSearch : function(searchTerm){},
10748
10797
 
10749
10798
  onLabelSelect : function($selectedLabels){},
@@ -10806,12 +10855,12 @@ $.fn.dropdown.settings = {
10806
10855
  icon : 'icon', // optional icon name
10807
10856
  iconClass : 'iconClass', // optional individual class for icon (for example to use flag instead)
10808
10857
  class : 'class', // optional individual class for item/header
10809
- divider : 'divider' // optional divider append for group headers
10858
+ divider : 'divider', // optional divider append for group headers
10859
+ actionable : 'actionable' // optional actionable item
10810
10860
  },
10811
10861
 
10812
10862
  keys : {
10813
10863
  backspace : 8,
10814
- delimiter : 188, // comma
10815
10864
  deleteKey : 46,
10816
10865
  enter : 13,
10817
10866
  escape : 27,
@@ -10878,7 +10927,8 @@ $.fn.dropdown.settings = {
10878
10927
  header : 'header',
10879
10928
  divider : 'divider',
10880
10929
  groupIcon : '',
10881
- unfilterable : 'unfilterable'
10930
+ unfilterable : 'unfilterable',
10931
+ actionable : 'actionable'
10882
10932
  }
10883
10933
 
10884
10934
  };
@@ -10953,6 +11003,9 @@ $.fn.dropdown.settings.templates = {
10953
11003
  maybeText = (option[fields.text])
10954
11004
  ? ' data-text="' + deQuote(option[fields.text],true) + '"'
10955
11005
  : '',
11006
+ maybeActionable = (option[fields.actionable])
11007
+ ? className.actionable+' '
11008
+ : '',
10956
11009
  maybeDisabled = (option[fields.disabled])
10957
11010
  ? className.disabled+' '
10958
11011
  : '',
@@ -10961,7 +11014,7 @@ $.fn.dropdown.settings.templates = {
10961
11014
  : '',
10962
11015
  hasDescription = (escape(option[fields.description] || '', preserveHTML) != '')
10963
11016
  ;
10964
- html += '<div class="'+ maybeDisabled + maybeDescriptionVertical + (option[fields.class] ? deQuote(option[fields.class]) : className.item)+'" data-value="' + deQuote(option[fields.value],true) + '"' + maybeText + '>';
11017
+ html += '<div class="'+ maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class] ? deQuote(option[fields.class]) : className.item)+'" data-value="' + deQuote(option[fields.value],true) + '"' + maybeText + '>';
10965
11018
  if (isMenu) {
10966
11019
  html += '<i class="'+ (itemType.indexOf('left') !== -1 ? 'left' : '') + ' dropdown icon"></i>';
10967
11020
  }
@@ -11031,7 +11084,7 @@ $.fn.dropdown.settings.templates = {
11031
11084
  })( jQuery, window, document );
11032
11085
 
11033
11086
  /*!
11034
- * # Fomantic-UI 2.9.0-beta.27 - Embed
11087
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Embed
11035
11088
  * http://github.com/fomantic/Fomantic-UI/
11036
11089
  *
11037
11090
  *
@@ -11741,7 +11794,7 @@ $.fn.embed.settings = {
11741
11794
  })( jQuery, window, document );
11742
11795
 
11743
11796
  /*!
11744
- * # Fomantic-UI 2.9.0-beta.27 - Modal
11797
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Modal
11745
11798
  * http://github.com/fomantic/Fomantic-UI/
11746
11799
  *
11747
11800
  *
@@ -11808,7 +11861,8 @@ $.fn.modal = function(parameters) {
11808
11861
 
11809
11862
  $module = $(this),
11810
11863
  $context = $(settings.context),
11811
- $close = $module.find(selector.close),
11864
+ $closeIcon = $module.find(selector.closeIcon),
11865
+ $inputs,
11812
11866
 
11813
11867
  $allModals,
11814
11868
  $otherModals,
@@ -11834,6 +11888,7 @@ $.fn.modal = function(parameters) {
11834
11888
  module = {
11835
11889
 
11836
11890
  initialize: function() {
11891
+ module.create.id();
11837
11892
  if(!$module.hasClass('modal')) {
11838
11893
  module.create.modal();
11839
11894
  if(!$.isFunction(settings.onHidden)) {
@@ -11858,15 +11913,17 @@ $.fn.modal = function(parameters) {
11858
11913
  $actions.empty();
11859
11914
  }
11860
11915
  settings.actions.forEach(function (el) {
11861
- var icon = el[fields.icon] ? '<i class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
11916
+ var icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
11862
11917
  text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
11863
11918
  cls = module.helpers.deQuote(el[fields.class] || ''),
11864
11919
  click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {};
11865
11920
  $actions.append($('<button/>', {
11866
11921
  html: icon + text,
11922
+ 'aria-label': $('<div>'+(el[fields.text] || el[fields.icon] || '')+'</div>').text(),
11867
11923
  class: className.button + ' ' + cls,
11868
11924
  click: function () {
11869
- if (click.call(element, $module) === false) {
11925
+ var button = $(this);
11926
+ if (button.is(selector.approve) || button.is(selector.deny) || click.call(element, $module) === false) {
11870
11927
  return;
11871
11928
  }
11872
11929
  module.hide();
@@ -11877,7 +11934,6 @@ $.fn.modal = function(parameters) {
11877
11934
  module.cache = {};
11878
11935
  module.verbose('Initializing dimmer', $context);
11879
11936
 
11880
- module.create.id();
11881
11937
  module.create.dimmer();
11882
11938
 
11883
11939
  if ( settings.allowMultiple ) {
@@ -11887,11 +11943,9 @@ $.fn.modal = function(parameters) {
11887
11943
  $module.addClass('top aligned');
11888
11944
  }
11889
11945
  module.refreshModals();
11890
-
11946
+ module.refreshInputs();
11891
11947
  module.bind.events();
11892
- if(settings.observeChanges) {
11893
- module.observeChanges();
11894
- }
11948
+ module.observeChanges();
11895
11949
  module.instantiate();
11896
11950
  if(settings.autoShow){
11897
11951
  module.show();
@@ -11908,16 +11962,20 @@ $.fn.modal = function(parameters) {
11908
11962
 
11909
11963
  create: {
11910
11964
  modal: function() {
11911
- $module = $('<div/>', {class: className.modal});
11965
+ $module = $('<div/>', {class: className.modal, role: 'dialog', 'aria-modal': true});
11912
11966
  if (settings.closeIcon) {
11913
- $close = $('<i/>', {class: className.close})
11914
- $module.append($close);
11967
+ $closeIcon = $('<i/>', {class: className.close, role: 'button', tabindex: 0, 'aria-label': settings.text.close})
11968
+ $module.append($closeIcon);
11915
11969
  }
11916
11970
  if (settings.title !== '') {
11917
- $('<div/>', {class: className.title}).appendTo($module);
11971
+ var titleId = '_' + module.get.id() + 'title';
11972
+ $module.attr('aria-labelledby', titleId);
11973
+ $('<div/>', {class: className.title, id: titleId}).appendTo($module);
11918
11974
  }
11919
11975
  if (settings.content !== '') {
11920
- $('<div/>', {class: className.content}).appendTo($module);
11976
+ var descId = '_' + module.get.id() + 'desc';
11977
+ $module.attr('aria-describedby', descId);
11978
+ $('<div/>', {class: className.content, id: descId}).appendTo($module);
11921
11979
  }
11922
11980
  if (module.has.configActions()) {
11923
11981
  $('<div/>', {class: className.actions}).appendTo($module);
@@ -11948,13 +12006,13 @@ $.fn.modal = function(parameters) {
11948
12006
  $dimmer = $dimmable.dimmer('get dimmer');
11949
12007
  },
11950
12008
  id: function() {
11951
- id = (Math.random().toString(16) + '000000000').substr(2, 8);
12009
+ id = (Math.random().toString(16) + '000000000').slice(2, 10);
11952
12010
  elementEventNamespace = '.' + id;
11953
12011
  module.verbose('Creating unique id for element', id);
11954
12012
  },
11955
12013
  innerDimmer: function() {
11956
- if ( $module.find(selector.dimmer).length == 0 ) {
11957
- $module.prepend('<div class="ui inverted dimmer"></div>');
12014
+ if ( $module.find(selector.dimmer).length === 0 ) {
12015
+ $('<div/>', {class: className.innerDimmer}).prependTo($module);
11958
12016
  }
11959
12017
  }
11960
12018
  },
@@ -11970,15 +12028,21 @@ $.fn.modal = function(parameters) {
11970
12028
  ;
11971
12029
  $window.off(elementEventNamespace);
11972
12030
  $dimmer.off(elementEventNamespace);
11973
- $close.off(eventNamespace);
12031
+ $closeIcon.off(elementEventNamespace);
12032
+ if($inputs) {
12033
+ $inputs.off(elementEventNamespace);
12034
+ }
11974
12035
  $context.dimmer('destroy');
11975
12036
  },
11976
12037
 
11977
12038
  observeChanges: function() {
11978
12039
  if('MutationObserver' in window) {
11979
12040
  observer = new MutationObserver(function(mutations) {
11980
- module.debug('DOM tree modified, refreshing');
11981
- module.refresh();
12041
+ if(settings.observeChanges) {
12042
+ module.debug('DOM tree modified, refreshing');
12043
+ module.refresh();
12044
+ }
12045
+ module.refreshInputs();
11982
12046
  });
11983
12047
  observer.observe(element, {
11984
12048
  childList : true,
@@ -12003,6 +12067,23 @@ $.fn.modal = function(parameters) {
12003
12067
  $allModals = $otherModals.add($module);
12004
12068
  },
12005
12069
 
12070
+ refreshInputs: function(){
12071
+ if($inputs){
12072
+ $inputs
12073
+ .off('keydown' + elementEventNamespace)
12074
+ ;
12075
+ }
12076
+ $inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
12077
+ return $(this).closest('.disabled').length === 0;
12078
+ });
12079
+ $inputs.first()
12080
+ .on('keydown' + elementEventNamespace, module.event.inputKeyDown.first)
12081
+ ;
12082
+ $inputs.last()
12083
+ .on('keydown' + elementEventNamespace, module.event.inputKeyDown.last)
12084
+ ;
12085
+ },
12086
+
12006
12087
  attachEvents: function(selector, event) {
12007
12088
  var
12008
12089
  $toggle = $(selector)
@@ -12031,6 +12112,9 @@ $.fn.modal = function(parameters) {
12031
12112
  .on('click' + eventNamespace, selector.approve, module.event.approve)
12032
12113
  .on('click' + eventNamespace, selector.deny, module.event.deny)
12033
12114
  ;
12115
+ $closeIcon
12116
+ .on('keyup' + elementEventNamespace, module.event.closeKeyUp)
12117
+ ;
12034
12118
  $window
12035
12119
  .on('resize' + elementEventNamespace, module.event.resize)
12036
12120
  ;
@@ -12049,7 +12133,7 @@ $.fn.modal = function(parameters) {
12049
12133
 
12050
12134
  get: {
12051
12135
  id: function() {
12052
- return (Math.random().toString(16) + '000000000').substr(2, 8);
12136
+ return id;
12053
12137
  },
12054
12138
  element: function() {
12055
12139
  return $module;
@@ -12088,10 +12172,38 @@ $.fn.modal = function(parameters) {
12088
12172
  close: function() {
12089
12173
  module.hide();
12090
12174
  },
12175
+ closeKeyUp: function(event){
12176
+ var
12177
+ keyCode = event.which
12178
+ ;
12179
+ if ((keyCode === settings.keys.enter || keyCode === settings.keys.space) && $module.hasClass(className.front)) {
12180
+ module.hide();
12181
+ }
12182
+ },
12183
+ inputKeyDown: {
12184
+ first: function(event) {
12185
+ var
12186
+ keyCode = event.which
12187
+ ;
12188
+ if (keyCode === settings.keys.tab && event.shiftKey) {
12189
+ $inputs.last().focus();
12190
+ event.preventDefault();
12191
+ }
12192
+ },
12193
+ last: function(event) {
12194
+ var
12195
+ keyCode = event.which
12196
+ ;
12197
+ if (keyCode === settings.keys.tab && !event.shiftKey) {
12198
+ $inputs.first().focus();
12199
+ event.preventDefault();
12200
+ }
12201
+ }
12202
+ },
12091
12203
  mousedown: function(event) {
12092
12204
  var
12093
12205
  $target = $(event.target),
12094
- isRtl = module.is.rtl();
12206
+ isRtl = module.is.rtl()
12095
12207
  ;
12096
12208
  initialMouseDownInModal = ($target.closest(selector.modal).length > 0);
12097
12209
  if(initialMouseDownInModal) {
@@ -12139,10 +12251,9 @@ $.fn.modal = function(parameters) {
12139
12251
  },
12140
12252
  keyboard: function(event) {
12141
12253
  var
12142
- keyCode = event.which,
12143
- escapeKey = 27
12254
+ keyCode = event.which
12144
12255
  ;
12145
- if(keyCode == escapeKey) {
12256
+ if(keyCode === settings.keys.escape) {
12146
12257
  if(settings.closable) {
12147
12258
  module.debug('Escape key pressed hiding modal');
12148
12259
  if ( $module.hasClass(className.front) ) {
@@ -12198,6 +12309,10 @@ $.fn.modal = function(parameters) {
12198
12309
  : function(){}
12199
12310
  ;
12200
12311
  if( module.is.animating() || !module.is.active() ) {
12312
+ if(settings.onShow.call(element) === false) {
12313
+ module.verbose('Show callback returned false cancelling show');
12314
+ return;
12315
+ }
12201
12316
  module.showDimmer();
12202
12317
  module.cacheSizes();
12203
12318
  module.set.bodyMargin();
@@ -12227,7 +12342,6 @@ $.fn.modal = function(parameters) {
12227
12342
  $module.detach().appendTo($dimmer);
12228
12343
  }
12229
12344
  }
12230
- settings.onShow.call(element);
12231
12345
  if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
12232
12346
  module.debug('Showing modal with css animations');
12233
12347
  $module
@@ -12270,7 +12384,6 @@ $.fn.modal = function(parameters) {
12270
12384
  ? callback
12271
12385
  : function(){}
12272
12386
  ;
12273
- module.debug('Hiding modal');
12274
12387
  if(settings.onHide.call(element, $(this)) === false) {
12275
12388
  module.verbose('Hide callback returned false cancelling hide');
12276
12389
  ignoreRepeatedEvents = false;
@@ -12278,6 +12391,7 @@ $.fn.modal = function(parameters) {
12278
12391
  }
12279
12392
 
12280
12393
  if( module.is.animating() || module.is.active() ) {
12394
+ module.debug('Hiding modal');
12281
12395
  if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
12282
12396
  module.remove.active();
12283
12397
  $module
@@ -12457,7 +12571,7 @@ $.fn.modal = function(parameters) {
12457
12571
  $module
12458
12572
  .off('mousedown' + elementEventNamespace)
12459
12573
  ;
12460
- }
12574
+ }
12461
12575
  $dimmer
12462
12576
  .off('mousedown' + elementEventNamespace)
12463
12577
  ;
@@ -12642,13 +12756,10 @@ $.fn.modal = function(parameters) {
12642
12756
  set: {
12643
12757
  autofocus: function() {
12644
12758
  var
12645
- $inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
12646
- return $(this).closest('.disabled').length === 0;
12647
- }),
12648
12759
  $autofocus = $inputs.filter('[autofocus]'),
12649
12760
  $input = ($autofocus.length > 0)
12650
12761
  ? $autofocus.first()
12651
- : $inputs.first()
12762
+ : ($inputs.length > 1 ? $inputs.filter(':not(i.close)') : $inputs).first()
12652
12763
  ;
12653
12764
  if($input.length > 0) {
12654
12765
  $input.focus();
@@ -12730,7 +12841,7 @@ $.fn.modal = function(parameters) {
12730
12841
  ? $(document).scrollTop() + settings.padding
12731
12842
  : $(document).scrollTop() + (module.cache.contextHeight - module.cache.height - settings.padding),
12732
12843
  marginLeft: -(module.cache.width / 2)
12733
- })
12844
+ })
12734
12845
  ;
12735
12846
  } else {
12736
12847
  $module
@@ -12739,7 +12850,7 @@ $.fn.modal = function(parameters) {
12739
12850
  ? -(module.cache.height / 2)
12740
12851
  : settings.padding / 2,
12741
12852
  marginLeft: -(module.cache.width / 2)
12742
- })
12853
+ })
12743
12854
  ;
12744
12855
  }
12745
12856
  module.verbose('Setting modal offset for legacy mode');
@@ -13065,11 +13176,19 @@ $.fn.modal.settings = {
13065
13176
  // called after deny selector match
13066
13177
  onDeny : function(){ return true; },
13067
13178
 
13179
+ keys : {
13180
+ space : 32,
13181
+ enter : 13,
13182
+ escape : 27,
13183
+ tab : 9,
13184
+ },
13185
+
13068
13186
  selector : {
13069
13187
  title : '> .header',
13070
13188
  content : '> .content',
13071
13189
  actions : '> .actions',
13072
13190
  close : '> .close',
13191
+ closeIcon: '> .close',
13073
13192
  approve : '.actions .positive, .actions .approve, .actions .ok',
13074
13193
  deny : '.actions .negative, .actions .deny, .actions .cancel',
13075
13194
  modal : '.ui.modal',
@@ -13101,11 +13220,13 @@ $.fn.modal.settings = {
13101
13220
  template : 'ui tiny modal',
13102
13221
  ok : 'positive',
13103
13222
  cancel : 'negative',
13104
- prompt : 'ui fluid input'
13223
+ prompt : 'ui fluid input',
13224
+ innerDimmer: 'ui inverted dimmer'
13105
13225
  },
13106
13226
  text: {
13107
13227
  ok : 'Ok',
13108
- cancel: 'Cancel'
13228
+ cancel: 'Cancel',
13229
+ close : 'Close'
13109
13230
  }
13110
13231
  };
13111
13232
 
@@ -13131,33 +13252,39 @@ $.fn.modal.settings.templates = {
13131
13252
  },
13132
13253
  alert: function () {
13133
13254
  var settings = this.get.settings(),
13134
- args = settings.templates.getArguments(arguments)
13255
+ args = settings.templates.getArguments(arguments),
13256
+ approveFn = args.handler
13135
13257
  ;
13136
13258
  return {
13137
13259
  title : args.title,
13138
13260
  content: args.content,
13261
+ onApprove: approveFn,
13139
13262
  actions: [{
13140
13263
  text : settings.text.ok,
13141
13264
  class: settings.className.ok,
13142
- click: args.handler
13265
+ click: approveFn
13143
13266
  }]
13144
13267
  }
13145
13268
  },
13146
13269
  confirm: function () {
13147
13270
  var settings = this.get.settings(),
13148
- args = settings.templates.getArguments(arguments)
13271
+ args = settings.templates.getArguments(arguments),
13272
+ approveFn = function(){args.handler(true)},
13273
+ denyFn = function(){args.handler(false)}
13149
13274
  ;
13150
13275
  return {
13151
13276
  title : args.title,
13152
13277
  content: args.content,
13278
+ onApprove: approveFn,
13279
+ onDeny: denyFn,
13153
13280
  actions: [{
13154
13281
  text : settings.text.ok,
13155
13282
  class: settings.className.ok,
13156
- click: function(){args.handler(true)}
13283
+ click: approveFn
13157
13284
  },{
13158
13285
  text: settings.text.cancel,
13159
13286
  class: settings.className.cancel,
13160
- click: function(){args.handler(false)}
13287
+ click: denyFn
13161
13288
  }]
13162
13289
  }
13163
13290
  },
@@ -13165,7 +13292,14 @@ $.fn.modal.settings.templates = {
13165
13292
  var $this = this,
13166
13293
  settings = this.get.settings(),
13167
13294
  args = settings.templates.getArguments(arguments),
13168
- input = $($.parseHTML(args.content)).filter('.ui.input')
13295
+ input = $($.parseHTML(args.content)).filter('.ui.input'),
13296
+ approveFn = function(){
13297
+ var settings = $this.get.settings(),
13298
+ inputField = $this.get.element().find(settings.selector.prompt)[0]
13299
+ ;
13300
+ args.handler($(inputField).val());
13301
+ },
13302
+ denyFn = function(){args.handler(null)}
13169
13303
  ;
13170
13304
  if (input.length === 0) {
13171
13305
  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>';
@@ -13173,19 +13307,16 @@ $.fn.modal.settings.templates = {
13173
13307
  return {
13174
13308
  title : args.title,
13175
13309
  content: args.content,
13310
+ onApprove: approveFn,
13311
+ onDeny: denyFn,
13176
13312
  actions: [{
13177
13313
  text: settings.text.ok,
13178
13314
  class: settings.className.ok,
13179
- click: function(){
13180
- var settings = $this.get.settings(),
13181
- inputField = $this.get.element().find(settings.selector.prompt)[0]
13182
- ;
13183
- args.handler($(inputField).val());
13184
- }
13315
+ click: approveFn
13185
13316
  },{
13186
13317
  text: settings.text.cancel,
13187
13318
  class: settings.className.cancel,
13188
- click: function(){args.handler(null)}
13319
+ click: denyFn
13189
13320
  }]
13190
13321
  }
13191
13322
  }
@@ -13194,7 +13325,7 @@ $.fn.modal.settings.templates = {
13194
13325
  })( jQuery, window, document );
13195
13326
 
13196
13327
  /*!
13197
- * # Fomantic-UI 2.9.0-beta.27 - Nag
13328
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Nag
13198
13329
  * http://github.com/fomantic/Fomantic-UI/
13199
13330
  *
13200
13331
  *
@@ -13753,7 +13884,7 @@ $.extend( $.easing, {
13753
13884
  })( jQuery, window, document );
13754
13885
 
13755
13886
  /*!
13756
- * # Fomantic-UI 2.9.0-beta.27 - Popup
13887
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Popup
13757
13888
  * http://github.com/fomantic/Fomantic-UI/
13758
13889
  *
13759
13890
  *
@@ -14063,7 +14194,7 @@ $.fn.popup = function(parameters) {
14063
14194
  },
14064
14195
 
14065
14196
  createID: function() {
14066
- id = (Math.random().toString(16) + '000000000').substr(2, 8);
14197
+ id = (Math.random().toString(16) + '000000000').slice(2, 10);
14067
14198
  elementNamespace = '.' + id;
14068
14199
  module.verbose('Creating unique id for element', id);
14069
14200
  },
@@ -15295,7 +15426,7 @@ $.fn.popup.settings = {
15295
15426
  })( jQuery, window, document );
15296
15427
 
15297
15428
  /*!
15298
- * # Fomantic-UI 2.9.0-beta.27 - Progress
15429
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Progress
15299
15430
  * http://github.com/fomantic/Fomantic-UI/
15300
15431
  *
15301
15432
  *
@@ -15903,6 +16034,9 @@ $.fn.progress = function(parameters) {
15903
16034
  }
15904
16035
  else {
15905
16036
  module.remove.active();
16037
+ module.remove.warning();
16038
+ module.remove.error();
16039
+ module.remove.success();
15906
16040
  module.set.label(settings.text.active);
15907
16041
  }
15908
16042
  },
@@ -16329,7 +16463,7 @@ $.fn.progress.settings = {
16329
16463
  })( jQuery, window, document );
16330
16464
 
16331
16465
  /*!
16332
- * # Fomantic-UI 2.9.0-beta.27 - Slider
16466
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Slider
16333
16467
  * http://github.com/fomantic/Fomantic-UI/
16334
16468
  *
16335
16469
  *
@@ -17668,7 +17802,7 @@ $.fn.slider.settings = {
17668
17802
  })( jQuery, window, document );
17669
17803
 
17670
17804
  /*!
17671
- * # Fomantic-UI 2.9.0-beta.27 - Rating
17805
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Rating
17672
17806
  * http://github.com/fomantic/Fomantic-UI/
17673
17807
  *
17674
17808
  *
@@ -18223,7 +18357,7 @@ $.fn.rating.settings = {
18223
18357
  })( jQuery, window, document );
18224
18358
 
18225
18359
  /*!
18226
- * # Fomantic-UI 2.9.0-beta.27 - Search
18360
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Search
18227
18361
  * http://github.com/fomantic/Fomantic-UI/
18228
18362
  *
18229
18363
  *
@@ -18627,7 +18761,7 @@ $.fn.search = function(parameters) {
18627
18761
  return $results.hasClass(className.animating);
18628
18762
  },
18629
18763
  chrome: function() {
18630
- return !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime);
18764
+ return !!window.chrome && !window.StyleMedia;
18631
18765
  },
18632
18766
  hidden: function() {
18633
18767
  return $results.hasClass(className.hidden);
@@ -19791,7 +19925,7 @@ $.fn.search.settings = {
19791
19925
  })( jQuery, window, document );
19792
19926
 
19793
19927
  /*!
19794
- * # Fomantic-UI 2.9.0-beta.27 - Shape
19928
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Shape
19795
19929
  * http://github.com/fomantic/Fomantic-UI/
19796
19930
  *
19797
19931
  *
@@ -19918,7 +20052,7 @@ $.fn.shape = function(parameters) {
19918
20052
  module.reset();
19919
20053
  module.set.active();
19920
20054
  };
19921
- settings.beforeChange.call($nextSide[0]);
20055
+ settings.onBeforeChange.call($nextSide[0]);
19922
20056
  if(module.get.transitionEvent()) {
19923
20057
  module.verbose('Starting CSS animation');
19924
20058
  $module
@@ -20605,7 +20739,7 @@ $.fn.shape.settings = {
20605
20739
  height: 'initial',
20606
20740
 
20607
20741
  // callback occurs on side change
20608
- beforeChange : function() {},
20742
+ onBeforeChange : function() {},
20609
20743
  onChange : function() {},
20610
20744
 
20611
20745
  // allow animation to same side
@@ -20640,7 +20774,7 @@ $.fn.shape.settings = {
20640
20774
  })( jQuery, window, document );
20641
20775
 
20642
20776
  /*!
20643
- * # Fomantic-UI 2.9.0-beta.27 - Sidebar
20777
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Sidebar
20644
20778
  * http://github.com/fomantic/Fomantic-UI/
20645
20779
  *
20646
20780
  *
@@ -20759,7 +20893,7 @@ $.fn.sidebar = function(parameters) {
20759
20893
 
20760
20894
  create: {
20761
20895
  id: function() {
20762
- id = (Math.random().toString(16) + '000000000').substr(2,8);
20896
+ id = (Math.random().toString(16) + '000000000').slice(2, 10);
20763
20897
  elementNamespace = '.' + id;
20764
20898
  module.verbose('Creating unique id for element', id);
20765
20899
  }
@@ -21012,6 +21146,10 @@ $.fn.sidebar = function(parameters) {
21012
21146
  : function(){}
21013
21147
  ;
21014
21148
  if(module.is.hidden()) {
21149
+ if(settings.onShow.call(element) === false) {
21150
+ module.verbose('Show callback returned false cancelling show');
21151
+ return;
21152
+ }
21015
21153
  module.refreshSidebars();
21016
21154
  if(settings.overlay) {
21017
21155
  module.error(error.overlay);
@@ -21036,10 +21174,9 @@ $.fn.sidebar = function(parameters) {
21036
21174
  }
21037
21175
  module.pushPage(function() {
21038
21176
  callback.call(element);
21039
- settings.onShow.call(element);
21177
+ settings.onVisible.call(element);
21040
21178
  });
21041
21179
  settings.onChange.call(element);
21042
- settings.onVisible.call(element);
21043
21180
  }
21044
21181
  else {
21045
21182
  module.debug('Sidebar is already visible');
@@ -21051,7 +21188,7 @@ $.fn.sidebar = function(parameters) {
21051
21188
  ? callback
21052
21189
  : function(){}
21053
21190
  ;
21054
- if(module.is.visible() || module.is.animating()) {
21191
+ if((module.is.visible() || module.is.animating()) && settings.onHide.call(element) !== false) {
21055
21192
  module.debug('Hiding sidebar', callback);
21056
21193
  module.refreshSidebars();
21057
21194
  module.pullPage(function() {
@@ -21059,7 +21196,6 @@ $.fn.sidebar = function(parameters) {
21059
21196
  settings.onHidden.call(element);
21060
21197
  });
21061
21198
  settings.onChange.call(element);
21062
- settings.onHide.call(element);
21063
21199
  }
21064
21200
  },
21065
21201
 
@@ -21677,7 +21813,7 @@ $.fn.sidebar.settings = {
21677
21813
  })( jQuery, window, document );
21678
21814
 
21679
21815
  /*!
21680
- * # Fomantic-UI 2.9.0-beta.27 - Sticky
21816
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Sticky
21681
21817
  * http://github.com/fomantic/Fomantic-UI/
21682
21818
  *
21683
21819
  *
@@ -22635,7 +22771,7 @@ $.fn.sticky.settings = {
22635
22771
  })( jQuery, window, document );
22636
22772
 
22637
22773
  /*!
22638
- * # Fomantic-UI 2.9.0-beta.27 - Tab
22774
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Tab
22639
22775
  * http://github.com/fomantic/Fomantic-UI/
22640
22776
  *
22641
22777
  *
@@ -22736,10 +22872,18 @@ $.fn.tab = function(parameters) {
22736
22872
  initializedHistory = true;
22737
22873
  }
22738
22874
 
22739
- if(settings.autoTabActivation && instance === undefined && module.determine.activeTab() == null) {
22740
- module.debug('No active tab detected, setting first tab active', module.get.initialPath());
22741
- module.changeTab(settings.autoTabActivation === true ? module.get.initialPath() : settings.autoTabActivation);
22742
- };
22875
+ var activeTab = module.determine.activeTab();
22876
+ if(settings.autoTabActivation && instance === undefined && activeTab == null) {
22877
+ activeTab = settings.autoTabActivation === true ? module.get.initialPath() : settings.autoTabActivation;
22878
+ module.debug('No active tab detected, setting tab active', activeTab);
22879
+ module.changeTab(activeTab);
22880
+ }
22881
+ if(activeTab != null && settings.history) {
22882
+ var autoUpdate = $.address.autoUpdate();
22883
+ $.address.autoUpdate(false);
22884
+ $.address.value(activeTab);
22885
+ $.address.autoUpdate(autoUpdate);
22886
+ }
22743
22887
 
22744
22888
  module.instantiate();
22745
22889
  },
@@ -22839,6 +22983,7 @@ $.fn.tab = function(parameters) {
22839
22983
  .history(true)
22840
22984
  .state(settings.path)
22841
22985
  ;
22986
+ $(window).trigger('popstate');
22842
22987
  }
22843
22988
  else {
22844
22989
  module.error(error.path);
@@ -23006,6 +23151,10 @@ $.fn.tab = function(parameters) {
23006
23151
  module.verbose('Tab parameters found', nextPathArray);
23007
23152
  }
23008
23153
  }
23154
+ if (settings.onBeforeChange.call(element, currentPath) === false) {
23155
+ module.debug('onBeforeChange returned false, cancelling tab change', $tab);
23156
+ return false;
23157
+ }
23009
23158
  if(isLastTab && remoteContent) {
23010
23159
  if(!shouldIgnoreLoad) {
23011
23160
  module.activate.navigation(currentPath);
@@ -23042,6 +23191,10 @@ $.fn.tab = function(parameters) {
23042
23191
  // if anchor exists use parent tab
23043
23192
  if($anchor && $anchor.length > 0 && currentPath) {
23044
23193
  module.debug('Anchor link used, opening parent tab', $tab, $anchor);
23194
+ if (settings.onBeforeChange.call(element, currentPath) === false) {
23195
+ module.debug('onBeforeChange returned false, cancelling tab change', $tab);
23196
+ return false;
23197
+ }
23045
23198
  if( !$tab.hasClass(className.active) ) {
23046
23199
  setTimeout(function() {
23047
23200
  module.scrollTo($anchor);
@@ -23595,6 +23748,7 @@ $.fn.tab.settings = {
23595
23748
  onLoad : function(tabPath, parameterArray, historyEvent) {}, // called on every load
23596
23749
  onVisible : function(tabPath, parameterArray, historyEvent) {}, // called every time tab visible
23597
23750
  onRequest : function(tabPath, parameterArray, historyEvent) {}, // called ever time a tab beings loading remote content
23751
+ onBeforeChange: function(tabPath) {}, // called before a tab is about to be changed. Returning false will cancel the tab change
23598
23752
 
23599
23753
  templates : {
23600
23754
  determineTitle: function(tabArray) {} // returns page title for path
@@ -23637,7 +23791,7 @@ $.fn.tab.settings = {
23637
23791
  })( jQuery, window, document );
23638
23792
 
23639
23793
  /*!
23640
- * # Fomantic-UI 2.9.0-beta.27 - Toast
23794
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Toast
23641
23795
  * http://github.com/fomantic/Fomantic-UI/
23642
23796
  *
23643
23797
  *
@@ -23707,12 +23861,14 @@ $.fn.toast = function(parameters) {
23707
23861
  element = this,
23708
23862
  instance = isToastComponent ? $module.data(moduleNamespace) : undefined,
23709
23863
 
23864
+ id,
23710
23865
  module
23711
23866
  ;
23712
23867
  module = {
23713
23868
 
23714
23869
  initialize: function() {
23715
23870
  module.verbose('Initializing element');
23871
+ module.create.id();
23716
23872
  if (!module.has.container()) {
23717
23873
  module.create.container();
23718
23874
  }
@@ -23762,17 +23918,22 @@ $.fn.toast = function(parameters) {
23762
23918
  },
23763
23919
 
23764
23920
  show: function(callback) {
23765
- callback = callback || function(){};
23766
- module.debug('Showing toast');
23767
23921
  if(settings.onShow.call($toastBox, element) === false) {
23768
23922
  module.debug('onShow callback returned false, cancelling toast animation');
23769
23923
  return;
23770
23924
  }
23925
+ callback = callback || function(){};
23926
+ module.debug('Showing toast');
23771
23927
  module.animate.show(callback);
23772
23928
  },
23773
23929
 
23774
23930
  close: function(callback) {
23931
+ if(settings.onHide.call($toastBox, element) === false) {
23932
+ module.debug('onHide callback returned false, cancelling toast animation');
23933
+ return;
23934
+ }
23775
23935
  callback = callback || function(){};
23936
+ module.debug('Closing toast');
23776
23937
  module.remove.visible();
23777
23938
  module.unbind.events();
23778
23939
  module.animate.close(callback);
@@ -23784,12 +23945,16 @@ $.fn.toast = function(parameters) {
23784
23945
  module.verbose('Creating container');
23785
23946
  $context.append($('<div/>',{class: settings.position + ' ' + className.container + ' ' +(settings.horizontal ? className.horizontal : '')}));
23786
23947
  },
23948
+ id: function() {
23949
+ id = (Math.random().toString(16) + '000000000').slice(2, 10);
23950
+ module.verbose('Creating unique id for element', id);
23951
+ },
23787
23952
  toast: function() {
23788
23953
  $toastBox = $('<div/>', {class: className.box});
23789
23954
  var iconClass = module.get.iconClass();
23790
23955
  if (!isToastComponent) {
23791
23956
  module.verbose('Creating toast');
23792
- $toast = $('<div/>');
23957
+ $toast = $('<div/>', {role: 'alert'});
23793
23958
  var $content = $('<div/>', {class: className.content});
23794
23959
  if (iconClass !== '') {
23795
23960
  $toast.append($('<i/>', {class: iconClass + ' ' + className.icon}));
@@ -23802,13 +23967,21 @@ $.fn.toast = function(parameters) {
23802
23967
  }));
23803
23968
  }
23804
23969
  if (settings.title !== '') {
23970
+ var titleId = '_' + module.get.id() + 'title';
23971
+ $toast.attr('aria-labelledby', titleId);
23805
23972
  $content.append($('<div/>', {
23806
23973
  class: className.title,
23807
- text: settings.title
23974
+ id: titleId,
23975
+ html: module.helpers.escape(settings.title, settings.preserveHTML)
23808
23976
  }));
23809
23977
  }
23810
-
23811
- $content.append($('<div/>', {class: className.message, html: module.helpers.escape(settings.message, settings.preserveHTML)}));
23978
+ var descId = '_' + module.get.id() + 'desc';
23979
+ $toast.attr('aria-describedby', descId);
23980
+ $content.append($('<div/>', {
23981
+ class: className.message,
23982
+ id: descId,
23983
+ html: module.helpers.escape(settings.message, settings.preserveHTML)
23984
+ }));
23812
23985
 
23813
23986
  $toast
23814
23987
  .addClass(settings.class + ' ' + className.toast)
@@ -23816,7 +23989,7 @@ $.fn.toast = function(parameters) {
23816
23989
  ;
23817
23990
  $toast.css('opacity', settings.opacity);
23818
23991
  if (settings.closeIcon) {
23819
- $close = $('<i/>', {class: className.close + ' ' + (typeof settings.closeIcon === 'string' ? settings.closeIcon : '')});
23992
+ $close = $('<i/>', {class: className.close + ' ' + (typeof settings.closeIcon === 'string' ? settings.closeIcon : ''), role: 'button', tabindex: 0, 'aria-label': settings.text.close});
23820
23993
  if($close.hasClass(className.left)) {
23821
23994
  $toast.prepend($close);
23822
23995
  } else {
@@ -23859,15 +24032,17 @@ $.fn.toast = function(parameters) {
23859
24032
  }
23860
24033
  }
23861
24034
  settings.actions.forEach(function (el) {
23862
- var icon = el[fields.icon] ? '<i class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
24035
+ var icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
23863
24036
  text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
23864
24037
  cls = module.helpers.deQuote(el[fields.class] || ''),
23865
24038
  click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {};
23866
24039
  $actions.append($('<button/>', {
23867
24040
  html: icon + text,
24041
+ 'aria-label': $('<div>'+(el[fields.text] || el[fields.icon] || '')+'</div>').text(),
23868
24042
  class: className.button + ' ' + cls,
23869
24043
  click: function () {
23870
- if (click.call(element, $module) === false) {
24044
+ var button = $(this);
24045
+ if (button.is(selector.approve) || button.is(selector.deny) || click.call(element, $module) === false) {
23871
24046
  return;
23872
24047
  }
23873
24048
  module.close();
@@ -23967,13 +24142,12 @@ $.fn.toast = function(parameters) {
23967
24142
  bind: {
23968
24143
  events: function() {
23969
24144
  module.debug('Binding events to toast');
23970
- if(settings.closeOnClick || settings.closeIcon) {
23971
- (settings.closeIcon ? $close : $toast)
23972
- .on('click' + eventNamespace, module.event.click)
23973
- ;
24145
+ if(settings.closeIcon) {
24146
+ $close.on('click' + eventNamespace, module.event.close);
23974
24147
  }
24148
+ $toast.on('click' + eventNamespace, module.event.click);
23975
24149
  if($animationObject) {
23976
- $animationObject.on('animationend' + eventNamespace, module.close);
24150
+ $animationObject.on('animationend' + eventNamespace, module.event.close);
23977
24151
  }
23978
24152
  $toastBox
23979
24153
  .on('click' + eventNamespace, selector.approve, module.event.approve)
@@ -23985,11 +24159,10 @@ $.fn.toast = function(parameters) {
23985
24159
  unbind: {
23986
24160
  events: function() {
23987
24161
  module.debug('Unbinding events to toast');
23988
- if(settings.closeOnClick || settings.closeIcon) {
23989
- (settings.closeIcon ? $close : $toast)
23990
- .off('click' + eventNamespace)
23991
- ;
24162
+ if(settings.closeIcon) {
24163
+ $close.off('click' + eventNamespace);
23992
24164
  }
24165
+ $toast.off('click' + eventNamespace);
23993
24166
  if($animationObject) {
23994
24167
  $animationObject.off('animationend' + eventNamespace);
23995
24168
  }
@@ -24021,11 +24194,6 @@ $.fn.toast = function(parameters) {
24021
24194
  },
24022
24195
  close: function(callback) {
24023
24196
  callback = $.isFunction(callback) ? callback : function(){};
24024
- module.debug('Closing toast');
24025
- if(settings.onHide.call($toastBox, element) === false) {
24026
- module.debug('onHide callback returned false, cancelling toast animation');
24027
- return;
24028
- }
24029
24197
  if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
24030
24198
  $toastBox
24031
24199
  .transition({
@@ -24081,7 +24249,7 @@ $.fn.toast = function(parameters) {
24081
24249
  has: {
24082
24250
  container: function() {
24083
24251
  module.verbose('Determining if there is already a container');
24084
- return ($context.find(module.helpers.toClass(settings.position) + selector.container + (settings.horizontal ? module.helpers.toClass(className.horizontal) : '')).length > 0);
24252
+ 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);
24085
24253
  },
24086
24254
  toast: function(){
24087
24255
  return !!module.get.toast();
@@ -24095,8 +24263,11 @@ $.fn.toast = function(parameters) {
24095
24263
  },
24096
24264
 
24097
24265
  get: {
24266
+ id: function() {
24267
+ return id;
24268
+ },
24098
24269
  container: function() {
24099
- return ($context.find(module.helpers.toClass(settings.position) + selector.container)[0]);
24270
+ return ($context.find(module.helpers.toClass(settings.position) + selector.container + (settings.horizontal ? module.helpers.toClass(className.horizontal) : ':not('+module.helpers.toClass(className.horizontal)+')'))[0]);
24100
24271
  },
24101
24272
  toastBox: function() {
24102
24273
  return $toastBox || null;
@@ -24128,9 +24299,15 @@ $.fn.toast = function(parameters) {
24128
24299
  },
24129
24300
 
24130
24301
  event: {
24302
+ close: function(){
24303
+ module.close();
24304
+ },
24131
24305
  click: function(event) {
24132
- if($(event.target).closest('a').length === 0) {
24133
- settings.onClick.call($toastBox, element);
24306
+ if($(event.target).closest(selector.clickable).length === 0) {
24307
+ if(settings.onClick.call($toastBox, element) === false || !settings.closeOnClick) {
24308
+ module.verbose('Click callback returned false or close denied by setting cancelling close');
24309
+ return;
24310
+ }
24134
24311
  module.close();
24135
24312
  }
24136
24313
  },
@@ -24471,6 +24648,10 @@ $.fn.toast.settings = {
24471
24648
  unclickable : 'unclickable'
24472
24649
  },
24473
24650
 
24651
+ text: {
24652
+ close : 'Close'
24653
+ },
24654
+
24474
24655
  icons : {
24475
24656
  info : 'info',
24476
24657
  success : 'checkmark',
@@ -24487,6 +24668,7 @@ $.fn.toast.settings = {
24487
24668
  image : '> img.image, > .image > img',
24488
24669
  icon : '> i.icon',
24489
24670
  input : 'input:not([type="hidden"]), textarea, select, button, .ui.button, ui.dropdown',
24671
+ clickable : 'a, details, .ui.accordion',
24490
24672
  approve : '.actions .positive, .actions .approve, .actions .ok',
24491
24673
  deny : '.actions .negative, .actions .deny, .actions .cancel'
24492
24674
  },
@@ -24530,7 +24712,7 @@ $.extend( $.easing, {
24530
24712
  })( jQuery, window, document );
24531
24713
 
24532
24714
  /*!
24533
- * # Fomantic-UI 2.9.0-beta.27 - Transition
24715
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Transition
24534
24716
  * http://github.com/fomantic/Fomantic-UI/
24535
24717
  *
24536
24718
  *
@@ -25302,6 +25484,10 @@ $.fn.transition = function() {
25302
25484
  },
25303
25485
 
25304
25486
  hide: function() {
25487
+ if(settings.onHide.call(element) === false) {
25488
+ module.verbose('Hide callback returned false cancelling hide');
25489
+ return false;
25490
+ }
25305
25491
  module.verbose('Hiding element');
25306
25492
  if( module.is.animating() ) {
25307
25493
  module.reset();
@@ -25309,35 +25495,32 @@ $.fn.transition = function() {
25309
25495
  element.blur(); // IE will trigger focus change if element is not blurred before hiding
25310
25496
  module.remove.display();
25311
25497
  module.remove.visible();
25312
- if($.isFunction(settings.onBeforeHide)){
25313
- settings.onBeforeHide.call(element,function(){
25314
- module.hideNow();
25315
- });
25316
- } else {
25317
- module.hideNow();
25318
- }
25319
-
25498
+ settings.onBeforeHide.call(element, module.hideNow);
25320
25499
  },
25321
25500
 
25322
25501
  hideNow: function() {
25323
25502
  module.set.hidden();
25324
25503
  module.force.hidden();
25325
- settings.onHide.call(element);
25504
+ settings.onHidden.call(element);
25326
25505
  settings.onComplete.call(element);
25327
25506
  // module.repaint();
25328
25507
  },
25329
25508
 
25330
25509
  show: function(display) {
25331
- module.verbose('Showing element', display);
25332
- if(module.force.visible()) {
25510
+ if(module.force.visible() && settings.onShow.call(element) !== false) {
25511
+ module.verbose('Showing element', display);
25333
25512
  module.remove.hidden();
25334
- module.set.visible();
25335
- settings.onShow.call(element);
25336
- settings.onComplete.call(element);
25337
- // module.repaint();
25513
+ settings.onBeforeShow.call(element, module.showNow);
25338
25514
  }
25339
25515
  },
25340
25516
 
25517
+ showNow: function(){
25518
+ module.set.visible();
25519
+ settings.onVisible.call(element);
25520
+ settings.onComplete.call(element);
25521
+ // module.repaint();
25522
+ },
25523
+
25341
25524
  toggle: function() {
25342
25525
  if( module.is.visible() ) {
25343
25526
  module.hide();
@@ -25586,7 +25769,11 @@ $.fn.transition.settings = {
25586
25769
  onStart : function() {},
25587
25770
  onComplete : function() {},
25588
25771
  onShow : function() {},
25772
+ onBeforeShow : function(callback) {callback.call(this)},
25773
+ onVisible : function() {},
25589
25774
  onHide : function() {},
25775
+ onHidden : function() {},
25776
+ onBeforeHide : function(callback) {callback.call(this)},
25590
25777
 
25591
25778
  // whether timeout should be used to ensure callback fires in cases animationend does not
25592
25779
  useFailSafe : true,
@@ -25640,7 +25827,7 @@ $.fn.transition.settings = {
25640
25827
  })( jQuery, window, document );
25641
25828
 
25642
25829
  /*!
25643
- * # Fomantic-UI 2.9.0-beta.27 - API
25830
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - API
25644
25831
  * http://github.com/fomantic/Fomantic-UI/
25645
25832
  *
25646
25833
  *
@@ -25715,6 +25902,7 @@ $.api = $.fn.api = function(parameters) {
25715
25902
  url,
25716
25903
  data,
25717
25904
  requestStartTime,
25905
+ originalData,
25718
25906
 
25719
25907
  // standard module
25720
25908
  element = this,
@@ -25727,6 +25915,7 @@ $.api = $.fn.api = function(parameters) {
25727
25915
 
25728
25916
  initialize: function() {
25729
25917
  if(!methodInvoked) {
25918
+ originalData = settings.data;
25730
25919
  module.bind.events();
25731
25920
  }
25732
25921
  module.instantiate();
@@ -25789,8 +25978,8 @@ $.api = $.fn.api = function(parameters) {
25789
25978
  module.error(error.noStorage);
25790
25979
  return;
25791
25980
  }
25792
- response = sessionStorage.getItem(url);
25793
- module.debug('Using cached response', url, response);
25981
+ response = sessionStorage.getItem(url + module.get.normalizedData());
25982
+ module.debug('Using cached response', url, settings.data, response);
25794
25983
  response = module.decode.json(response);
25795
25984
  return response;
25796
25985
  }
@@ -25808,8 +25997,8 @@ $.api = $.fn.api = function(parameters) {
25808
25997
  if( $.isPlainObject(response) ) {
25809
25998
  response = JSON.stringify(response);
25810
25999
  }
25811
- sessionStorage.setItem(url, response);
25812
- module.verbose('Storing cached response for url', url, response);
26000
+ sessionStorage.setItem(url + module.get.normalizedData(), response);
26001
+ module.verbose('Storing cached response for url', url, settings.data, response);
25813
26002
  }
25814
26003
  },
25815
26004
 
@@ -25838,7 +26027,7 @@ $.api = $.fn.api = function(parameters) {
25838
26027
 
25839
26028
  // Add form content
25840
26029
  if(settings.serializeForm) {
25841
- settings.data = module.add.formData(settings.data);
26030
+ settings.data = module.add.formData(originalData || settings.data);
25842
26031
  }
25843
26032
 
25844
26033
  // call beforesend and get any settings changes
@@ -25975,10 +26164,6 @@ $.api = $.fn.api = function(parameters) {
25975
26164
  cancelled: function() {
25976
26165
  return (module.cancelled || false);
25977
26166
  },
25978
- succesful: function() {
25979
- module.verbose('This behavior will be deleted due to typo. Use "was successful" instead.');
25980
- return module.was.successful();
25981
- },
25982
26167
  successful: function() {
25983
26168
  return (module.request && module.request.state() == 'resolved');
25984
26169
  },
@@ -26006,8 +26191,8 @@ $.api = $.fn.api = function(parameters) {
26006
26191
  var
26007
26192
  // allow legacy {$var} style
26008
26193
  variable = (templatedString.indexOf('$') !== -1)
26009
- ? templatedString.substr(2, templatedString.length - 3)
26010
- : templatedString.substr(1, templatedString.length - 2),
26194
+ ? templatedString.slice(2, -1)
26195
+ : templatedString.slice(1, -1),
26011
26196
  value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
26012
26197
  ? urlData[variable]
26013
26198
  : ($module.data(variable) !== undefined)
@@ -26038,8 +26223,8 @@ $.api = $.fn.api = function(parameters) {
26038
26223
  var
26039
26224
  // allow legacy {/$var} style
26040
26225
  variable = (templatedString.indexOf('$') !== -1)
26041
- ? templatedString.substr(3, templatedString.length - 4)
26042
- : templatedString.substr(2, templatedString.length - 3),
26226
+ ? templatedString.slice(3, -1)
26227
+ : templatedString.slice(2, -1),
26043
26228
  value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
26044
26229
  ? urlData[variable]
26045
26230
  : ($module.data(variable) !== undefined)
@@ -26070,24 +26255,76 @@ $.api = $.fn.api = function(parameters) {
26070
26255
  },
26071
26256
  formData: function(data) {
26072
26257
  var
26073
- canSerialize = ($.fn.serializeObject !== undefined),
26074
- formData = (canSerialize)
26075
- ? $form.serializeObject()
26076
- : $form.serialize(),
26077
- hasOtherData
26258
+ formData = {},
26259
+ hasOtherData,
26260
+ useFormDataApi = settings.serializeForm === 'formdata'
26078
26261
  ;
26079
- data = data || settings.data;
26262
+ data = data || originalData || settings.data;
26080
26263
  hasOtherData = $.isPlainObject(data);
26081
26264
 
26265
+ if (useFormDataApi) {
26266
+ formData = new FormData($form[0]);
26267
+ settings.processData = typeof settings.processData !== 'undefined' ? settings.processData : false;
26268
+ settings.contentType = typeof settings.contentType !== 'undefined' ? settings.contentType : false;
26269
+ } else {
26270
+ var formArray = $form.serializeArray(),
26271
+ pushes = {},
26272
+ pushValues= {},
26273
+ build = function(base, key, value) {
26274
+ base[key] = value;
26275
+ return base;
26276
+ }
26277
+ ;
26278
+ // add files
26279
+ $.each($('input[type="file"]',$form), function(i, tag) {
26280
+ $.each($(tag)[0].files, function(j, file) {
26281
+ formArray.push({name:tag.name, value: file});
26282
+ });
26283
+ });
26284
+ $.each(formArray, function(i, el) {
26285
+ if (!settings.regExp.validate.test(el.name)) return;
26286
+ var isCheckbox = $('[name="' + el.name + '"]', $form).attr('type') === 'checkbox',
26287
+ floatValue = parseFloat(el.value),
26288
+ value = (isCheckbox && el.value === 'on') || el.value === 'true' || (String(floatValue) === el.value ? floatValue : (el.value === 'false' ? false : el.value)),
26289
+ nameKeys = el.name.match(settings.regExp.key) || [], k, pushKey= el.name.replace(/\[\]$/,'')
26290
+ ;
26291
+ if(!(pushKey in pushes)) {
26292
+ pushes[pushKey] = 0;
26293
+ pushValues[pushKey] = value;
26294
+ } else if (Array.isArray(pushValues[pushKey])) {
26295
+ pushValues[pushKey].push(value);
26296
+ } else {
26297
+ pushValues[pushKey] = [pushValues[pushKey] , value];
26298
+ }
26299
+ value = pushValues[pushKey];
26300
+
26301
+ while ((k = nameKeys.pop()) !== undefined) {
26302
+ // foo[]
26303
+ if (k == '' && !Array.isArray(value)){
26304
+ value = build([], pushes[pushKey]++, value);
26305
+ }
26306
+ // foo[n]
26307
+ else if (settings.regExp.fixed.test(k)) {
26308
+ value = build([], k, value);
26309
+ }
26310
+ // foo; foo[bar]
26311
+ else if (settings.regExp.named.test(k)) {
26312
+ value = build({}, k, value);
26313
+ }
26314
+ }
26315
+ formData = $.extend(true, formData, value);
26316
+ });
26317
+ }
26318
+
26082
26319
  if(hasOtherData) {
26083
- if(canSerialize) {
26084
- module.debug('Extending existing data with form data', data, formData);
26085
- data = $.extend(true, {}, data, formData);
26086
- }
26087
- else {
26088
- module.error(error.missingSerialize);
26089
- module.debug('Cant extend data. Replacing data with form data', data, formData);
26320
+ module.debug('Extending existing data with form data', data, formData);
26321
+ if(useFormDataApi) {
26322
+ $.each(Object.keys(data),function(i, el){
26323
+ formData.append(el, data[el]);
26324
+ });
26090
26325
  data = formData;
26326
+ } else {
26327
+ data = $.extend(true, {}, data, formData);
26091
26328
  }
26092
26329
  }
26093
26330
  else {
@@ -26339,6 +26576,9 @@ $.api = $.fn.api = function(parameters) {
26339
26576
  },
26340
26577
 
26341
26578
  get: {
26579
+ normalizedData: function(){
26580
+ return typeof settings.data === "string" ? settings.data : JSON.stringify(settings.data, Object.keys(settings.data).sort());
26581
+ },
26342
26582
  responseFromXHR: function(xhr) {
26343
26583
  return $.isPlainObject(xhr)
26344
26584
  ? (module.is.expectingJSON())
@@ -26724,6 +26964,8 @@ $.api.settings = {
26724
26964
  defaultData : true,
26725
26965
 
26726
26966
  // whether to serialize closest form
26967
+ // use true to convert complex named keys like a[b][1][c][] into a nested object
26968
+ // use 'formdata' for formdata web api
26727
26969
  serializeForm : false,
26728
26970
 
26729
26971
  // how long to wait before request should occur
@@ -26746,7 +26988,7 @@ $.api.settings = {
26746
26988
  responseAsync : false,
26747
26989
 
26748
26990
  // whether onResponse should work with response value without force converting into an object
26749
- rawResponse : false,
26991
+ rawResponse : true,
26750
26992
 
26751
26993
  // callbacks before request
26752
26994
  beforeSend : function(settings) { return settings; },
@@ -26782,7 +27024,6 @@ $.api.settings = {
26782
27024
  legacyParameters : 'You are using legacy API success callback names',
26783
27025
  method : 'The method you called is not defined',
26784
27026
  missingAction : 'API action used but no url was defined',
26785
- missingSerialize : 'jquery-serialize-object is required to add form data to an existing data object',
26786
27027
  missingURL : 'No URL specified for api event',
26787
27028
  noReturnedValue : 'The beforeSend callback must return a settings object, beforeSend ignored.',
26788
27029
  noStorage : 'Caching responses locally requires session storage',
@@ -26795,6 +27036,11 @@ $.api.settings = {
26795
27036
  regExp : {
26796
27037
  required : /\{\$*[A-z0-9]+\}/g,
26797
27038
  optional : /\{\/\$*[A-z0-9]+\}/g,
27039
+ validate: /^[a-z_][a-z0-9_-]*(?:\[(?:\d*|[a-z0-9_-]+)\])*$/i,
27040
+ key: /[a-z0-9_-]+|(?=\[\])/gi,
27041
+ push: /^$/,
27042
+ fixed: /^\d+$/,
27043
+ named: /^[a-z0-9_-]+$/i
26798
27044
  },
26799
27045
 
26800
27046
  className: {
@@ -26818,7 +27064,7 @@ $.api.settings = {
26818
27064
  })( jQuery, window, document );
26819
27065
 
26820
27066
  /*!
26821
- * # Fomantic-UI 2.9.0-beta.27 - State
27067
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - State
26822
27068
  * http://github.com/fomantic/Fomantic-UI/
26823
27069
  *
26824
27070
  *
@@ -27530,7 +27776,7 @@ $.fn.state.settings = {
27530
27776
  })( jQuery, window, document );
27531
27777
 
27532
27778
  /*!
27533
- * # Fomantic-UI 2.9.0-beta.27 - Visibility
27779
+ * # Fomantic-UI 2.9.0-beta.272+5e88144 - Visibility
27534
27780
  * http://github.com/fomantic/Fomantic-UI/
27535
27781
  *
27536
27782
  *