fomantic-ui 2.9.1-beta.22 → 2.9.1-beta.24

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 (256) hide show
  1. package/.eslint/index.js +23 -0
  2. package/.eslint/no-extra-parens-rule.js +17 -0
  3. package/.eslint/package.json +11 -0
  4. package/.eslintrc.js +13 -70
  5. package/.stylelintrc.js +5 -7
  6. package/dist/components/accordion.css +1 -1
  7. package/dist/components/accordion.js +26 -26
  8. package/dist/components/accordion.min.css +1 -1
  9. package/dist/components/accordion.min.js +2 -2
  10. package/dist/components/ad.css +1 -1
  11. package/dist/components/ad.min.css +1 -1
  12. package/dist/components/api.js +95 -94
  13. package/dist/components/api.min.js +2 -2
  14. package/dist/components/breadcrumb.css +1 -1
  15. package/dist/components/breadcrumb.min.css +1 -1
  16. package/dist/components/button.css +1 -1
  17. package/dist/components/button.min.css +1 -1
  18. package/dist/components/calendar.css +3 -3
  19. package/dist/components/calendar.js +181 -151
  20. package/dist/components/calendar.min.css +2 -2
  21. package/dist/components/calendar.min.js +2 -2
  22. package/dist/components/card.css +1 -1
  23. package/dist/components/card.min.css +1 -1
  24. package/dist/components/checkbox.css +1 -1
  25. package/dist/components/checkbox.js +14 -14
  26. package/dist/components/checkbox.min.css +1 -1
  27. package/dist/components/checkbox.min.js +2 -2
  28. package/dist/components/comment.css +1 -1
  29. package/dist/components/comment.min.css +1 -1
  30. package/dist/components/container.css +1 -1
  31. package/dist/components/container.min.css +1 -1
  32. package/dist/components/dimmer.css +1 -1
  33. package/dist/components/dimmer.js +23 -25
  34. package/dist/components/dimmer.min.css +1 -1
  35. package/dist/components/dimmer.min.js +2 -2
  36. package/dist/components/divider.css +1 -1
  37. package/dist/components/divider.min.css +1 -1
  38. package/dist/components/dropdown.css +1 -1
  39. package/dist/components/dropdown.js +252 -254
  40. package/dist/components/dropdown.min.css +1 -1
  41. package/dist/components/dropdown.min.js +2 -2
  42. package/dist/components/embed.css +1 -1
  43. package/dist/components/embed.js +27 -33
  44. package/dist/components/embed.min.css +1 -1
  45. package/dist/components/embed.min.js +2 -2
  46. package/dist/components/feed.css +1 -1
  47. package/dist/components/feed.min.css +1 -1
  48. package/dist/components/flag.css +1 -1
  49. package/dist/components/flag.min.css +1 -1
  50. package/dist/components/flyout.css +2 -2
  51. package/dist/components/flyout.js +50 -44
  52. package/dist/components/flyout.min.css +1 -1
  53. package/dist/components/flyout.min.js +2 -2
  54. package/dist/components/form.css +2 -2
  55. package/dist/components/form.js +187 -163
  56. package/dist/components/form.min.css +2 -2
  57. package/dist/components/form.min.js +2 -2
  58. package/dist/components/grid.css +1 -1
  59. package/dist/components/grid.min.css +1 -1
  60. package/dist/components/header.css +1 -1
  61. package/dist/components/header.min.css +1 -1
  62. package/dist/components/icon.css +1 -1
  63. package/dist/components/icon.min.css +1 -1
  64. package/dist/components/image.css +1 -1
  65. package/dist/components/image.min.css +1 -1
  66. package/dist/components/input.css +1 -1
  67. package/dist/components/input.min.css +1 -1
  68. package/dist/components/item.css +1 -1
  69. package/dist/components/item.min.css +1 -1
  70. package/dist/components/label.css +1 -1
  71. package/dist/components/label.min.css +1 -1
  72. package/dist/components/list.css +1 -1
  73. package/dist/components/list.min.css +1 -1
  74. package/dist/components/loader.css +1 -1
  75. package/dist/components/loader.min.css +1 -1
  76. package/dist/components/message.css +1 -1
  77. package/dist/components/message.min.css +1 -1
  78. package/dist/components/modal.css +1 -1
  79. package/dist/components/modal.js +49 -45
  80. package/dist/components/modal.min.css +1 -1
  81. package/dist/components/modal.min.js +2 -2
  82. package/dist/components/nag.css +1 -1
  83. package/dist/components/nag.js +22 -20
  84. package/dist/components/nag.min.css +1 -1
  85. package/dist/components/nag.min.js +2 -2
  86. package/dist/components/placeholder.css +1 -1
  87. package/dist/components/placeholder.min.css +1 -1
  88. package/dist/components/popup.css +1 -1
  89. package/dist/components/popup.js +71 -71
  90. package/dist/components/popup.min.css +1 -1
  91. package/dist/components/popup.min.js +2 -2
  92. package/dist/components/progress.css +1 -1
  93. package/dist/components/progress.js +46 -46
  94. package/dist/components/progress.min.css +1 -1
  95. package/dist/components/progress.min.js +2 -2
  96. package/dist/components/rail.css +1 -1
  97. package/dist/components/rail.min.css +1 -1
  98. package/dist/components/rating.css +1 -1
  99. package/dist/components/rating.js +15 -15
  100. package/dist/components/rating.min.css +1 -1
  101. package/dist/components/rating.min.js +2 -2
  102. package/dist/components/reset.css +1 -1
  103. package/dist/components/reset.min.css +1 -1
  104. package/dist/components/reveal.css +1 -1
  105. package/dist/components/reveal.min.css +1 -1
  106. package/dist/components/search.css +1 -1
  107. package/dist/components/search.js +69 -74
  108. package/dist/components/search.min.css +1 -1
  109. package/dist/components/search.min.js +2 -2
  110. package/dist/components/segment.css +1 -1
  111. package/dist/components/segment.min.css +1 -1
  112. package/dist/components/shape.css +1 -1
  113. package/dist/components/shape.js +39 -39
  114. package/dist/components/shape.min.css +1 -1
  115. package/dist/components/shape.min.js +2 -2
  116. package/dist/components/sidebar.css +1 -1
  117. package/dist/components/sidebar.js +39 -37
  118. package/dist/components/sidebar.min.css +1 -1
  119. package/dist/components/sidebar.min.js +2 -2
  120. package/dist/components/site.css +1 -1
  121. package/dist/components/site.js +22 -21
  122. package/dist/components/site.min.css +1 -1
  123. package/dist/components/site.min.js +2 -2
  124. package/dist/components/slider.js +69 -64
  125. package/dist/components/slider.min.js +2 -2
  126. package/dist/components/state.js +15 -15
  127. package/dist/components/state.min.js +2 -2
  128. package/dist/components/statistic.css +1 -1
  129. package/dist/components/statistic.min.css +1 -1
  130. package/dist/components/step.css +1 -1
  131. package/dist/components/step.min.css +1 -1
  132. package/dist/components/sticky.css +1 -1
  133. package/dist/components/sticky.js +25 -25
  134. package/dist/components/sticky.min.css +1 -1
  135. package/dist/components/sticky.min.js +2 -2
  136. package/dist/components/tab.css +1 -1
  137. package/dist/components/tab.js +55 -57
  138. package/dist/components/tab.min.css +1 -1
  139. package/dist/components/tab.min.js +2 -2
  140. package/dist/components/table.css +1 -1
  141. package/dist/components/table.min.css +1 -1
  142. package/dist/components/text.css +1 -1
  143. package/dist/components/text.min.css +1 -1
  144. package/dist/components/toast.css +1 -1
  145. package/dist/components/toast.js +57 -30
  146. package/dist/components/toast.min.css +1 -1
  147. package/dist/components/toast.min.js +2 -2
  148. package/dist/components/transition.css +7 -7
  149. package/dist/components/transition.js +45 -39
  150. package/dist/components/transition.min.css +1 -1
  151. package/dist/components/transition.min.js +2 -2
  152. package/dist/components/visibility.js +25 -25
  153. package/dist/components/visibility.min.js +2 -2
  154. package/dist/semantic.css +60 -60
  155. package/dist/semantic.js +1518 -1427
  156. package/dist/semantic.min.css +2 -2
  157. package/dist/semantic.min.js +2 -2
  158. package/examples/responsive.html +1 -1
  159. package/gulpfile.js +1 -1
  160. package/package.json +2 -1
  161. package/scripts/nightly-version.js +6 -4
  162. package/src/definitions/behaviors/api.js +94 -93
  163. package/src/definitions/behaviors/form.js +186 -162
  164. package/src/definitions/behaviors/state.js +14 -14
  165. package/src/definitions/behaviors/visibility.js +24 -24
  166. package/src/definitions/collections/menu.less +2 -2
  167. package/src/definitions/elements/button.less +2 -2
  168. package/src/definitions/elements/loader.less +4 -4
  169. package/src/definitions/elements/step.less +1 -1
  170. package/src/definitions/globals/site.js +21 -20
  171. package/src/definitions/modules/accordion.js +25 -25
  172. package/src/definitions/modules/calendar.js +180 -150
  173. package/src/definitions/modules/calendar.less +2 -2
  174. package/src/definitions/modules/checkbox.js +13 -13
  175. package/src/definitions/modules/dimmer.js +22 -24
  176. package/src/definitions/modules/dimmer.less +10 -10
  177. package/src/definitions/modules/dropdown.js +251 -253
  178. package/src/definitions/modules/embed.js +26 -32
  179. package/src/definitions/modules/flyout.js +49 -43
  180. package/src/definitions/modules/flyout.less +1 -1
  181. package/src/definitions/modules/modal.js +48 -44
  182. package/src/definitions/modules/nag.js +21 -19
  183. package/src/definitions/modules/popup.js +70 -70
  184. package/src/definitions/modules/progress.js +45 -45
  185. package/src/definitions/modules/rating.js +14 -14
  186. package/src/definitions/modules/search.js +68 -73
  187. package/src/definitions/modules/shape.js +38 -38
  188. package/src/definitions/modules/sidebar.js +38 -36
  189. package/src/definitions/modules/slider.js +68 -63
  190. package/src/definitions/modules/sticky.js +24 -24
  191. package/src/definitions/modules/tab.js +54 -56
  192. package/src/definitions/modules/toast.js +56 -29
  193. package/src/definitions/modules/transition.js +44 -38
  194. package/src/themes/amazon/elements/button.overrides +7 -7
  195. package/src/themes/default/collections/form.variables +1 -1
  196. package/src/themes/default/elements/reveal.variables +1 -1
  197. package/src/themes/default/globals/site.variables +1 -1
  198. package/src/themes/default/modules/dimmer.variables +6 -6
  199. package/src/themes/default/modules/modal.variables +1 -1
  200. package/src/themes/default/modules/slider.variables +4 -4
  201. package/src/themes/default/modules/toast.variables +2 -2
  202. package/src/themes/default/modules/transition.overrides +12 -12
  203. package/src/themes/flat/collections/form.overrides +2 -2
  204. package/src/themes/flat/globals/site.variables +1 -1
  205. package/src/themes/github/collections/form.overrides +2 -2
  206. package/src/themes/github/collections/menu.variables +1 -1
  207. package/src/themes/github/collections/message.overrides +3 -3
  208. package/src/themes/github/elements/input.overrides +2 -2
  209. package/src/themes/timeline/views/feed.overrides +3 -3
  210. package/src/themes/twitter/elements/button.overrides +2 -2
  211. package/tasks/README.md +1 -3
  212. package/tasks/admin/components/create.js +9 -16
  213. package/tasks/admin/components/init.js +7 -7
  214. package/tasks/admin/components/update.js +10 -10
  215. package/tasks/admin/distributions/create.js +16 -18
  216. package/tasks/admin/distributions/init.js +7 -7
  217. package/tasks/admin/distributions/update.js +10 -10
  218. package/tasks/admin/publish.js +1 -3
  219. package/tasks/admin/register.js +6 -6
  220. package/tasks/admin/release.js +1 -3
  221. package/tasks/build/assets.js +2 -2
  222. package/tasks/build/css.js +8 -3
  223. package/tasks/build/javascript.js +3 -1
  224. package/tasks/build.js +1 -1
  225. package/tasks/check-install.js +1 -1
  226. package/tasks/clean.js +1 -1
  227. package/tasks/collections/README.md +3 -5
  228. package/tasks/collections/admin.js +1 -1
  229. package/tasks/collections/docs.js +1 -1
  230. package/tasks/collections/install.js +1 -1
  231. package/tasks/collections/rtl.js +1 -1
  232. package/tasks/collections/various.js +1 -1
  233. package/tasks/config/admin/github.js +6 -8
  234. package/tasks/config/admin/templates/css-package.js +1 -1
  235. package/tasks/config/admin/templates/less-package.js +1 -1
  236. package/tasks/config/npm/gulpfile.js +7 -7
  237. package/tasks/config/project/config.js +14 -19
  238. package/tasks/config/project/install.js +35 -34
  239. package/tasks/config/project/release.js +15 -16
  240. package/tasks/config/tasks.js +18 -20
  241. package/tasks/config/user.js +5 -3
  242. package/tasks/docs/build.js +5 -3
  243. package/tasks/docs/metadata.js +7 -8
  244. package/tasks/docs/serve.js +6 -3
  245. package/tasks/install.js +39 -39
  246. package/tasks/rtl/build.js +1 -3
  247. package/tasks/rtl/watch.js +1 -3
  248. package/tasks/version.js +1 -3
  249. package/tasks/watch.js +1 -1
  250. package/test/.eslintrc.js +0 -4
  251. package/test/meteor/assets.js +1 -1
  252. package/test/modules/module.spec.js +15 -15
  253. package/test/modules/popup.spec.js +1 -1
  254. package/test/modules/search.spec.js +1 -1
  255. package/test/modules/tab.spec.js +1 -1
  256. package/test/modules/transition.spec.js +1 -1
@@ -15,7 +15,7 @@
15
15
  return typeof obj === 'function' && typeof obj.nodeType !== 'number';
16
16
  }
17
17
 
18
- window = (typeof window != 'undefined' && window.Math == Math)
18
+ window = window !== undefined && window.Math === Math
19
19
  ? window
20
20
  : globalThis;
21
21
 
@@ -24,17 +24,17 @@
24
24
  $allModules = $(this),
25
25
  moduleSelector = $allModules.selector || '',
26
26
 
27
- time = new Date().getTime(),
27
+ time = Date.now(),
28
28
  performance = [],
29
29
 
30
30
  query = arguments[0],
31
- methodInvoked = (typeof query == 'string'),
31
+ methodInvoked = typeof query === 'string',
32
32
  queryArguments = [].slice.call(arguments, 1),
33
33
  returnedValue
34
34
  ;
35
- $(this).each(function () {
35
+ $allModules.each(function () {
36
36
  var
37
- settings = ($.isPlainObject(parameters))
37
+ settings = $.isPlainObject(parameters)
38
38
  ? $.extend(true, {}, $.fn.search.settings, parameters)
39
39
  : $.extend({}, $.fn.search.settings),
40
40
 
@@ -166,7 +166,7 @@
166
166
  },
167
167
  blur: function (event) {
168
168
  var
169
- pageLostFocus = (document.activeElement === this),
169
+ pageLostFocus = document.activeElement === this,
170
170
  callback = function () {
171
171
  module.cancel.query();
172
172
  module.remove.focus();
@@ -215,7 +215,7 @@
215
215
  href = $link.attr('href') || false,
216
216
  target = $link.attr('target') || false,
217
217
  // title is used for result lookup
218
- value = ($title.length > 0)
218
+ value = $title.length > 0
219
219
  ? $title.text()
220
220
  : false,
221
221
  results = module.get.results(),
@@ -240,7 +240,7 @@
240
240
  if (target == '_blank' || event.ctrlKey) {
241
241
  window.open(href);
242
242
  } else {
243
- window.location.href = (href);
243
+ window.location.href = href;
244
244
  }
245
245
  }
246
246
  },
@@ -310,7 +310,7 @@
310
310
  }
311
311
  } else if (keyCode == keys.upArrow && hasActiveResult) {
312
312
  module.verbose('Up key pressed, changing active result');
313
- newIndex = (currentIndex - 1 < 0)
313
+ newIndex = currentIndex - 1 < 0
314
314
  ? currentIndex
315
315
  : currentIndex - 1;
316
316
  $category
@@ -327,7 +327,7 @@
327
327
  event.preventDefault();
328
328
  } else if (keyCode == keys.downArrow) {
329
329
  module.verbose('Down key pressed, changing active result');
330
- newIndex = (currentIndex + 1 >= resultSize)
330
+ newIndex = currentIndex + 1 >= resultSize
331
331
  ? currentIndex
332
332
  : currentIndex + 1;
333
333
  $category
@@ -431,16 +431,16 @@
431
431
  isInDOM = $.contains(document.documentElement, event.target)
432
432
  ;
433
433
 
434
- return (isInDOM && $target.closest(selector.message).length > 0);
434
+ return isInDOM && $target.closest(selector.message).length > 0;
435
435
  },
436
436
  empty: function () {
437
- return ($results.html() === '');
437
+ return $results.html() === '';
438
438
  },
439
439
  visible: function () {
440
- return ($results.filter(':visible').length > 0);
440
+ return $results.filter(':visible').length > 0;
441
441
  },
442
442
  focused: function () {
443
- return ($prompt.filter(':focus').length > 0);
443
+ return $prompt.filter(':focus').length > 0;
444
444
  },
445
445
  },
446
446
 
@@ -458,11 +458,11 @@
458
458
  inputEvent: function () {
459
459
  var
460
460
  prompt = $prompt[0],
461
- inputEvent = (prompt !== undefined && prompt.oninput !== undefined)
461
+ inputEvent = prompt !== undefined && prompt.oninput !== undefined
462
462
  ? 'input'
463
- : (prompt !== undefined && prompt.onpropertychange !== undefined)
463
+ : (prompt !== undefined && prompt.onpropertychange !== undefined
464
464
  ? 'propertychange'
465
- : 'keyup'
465
+ : 'keyup')
466
466
  ;
467
467
 
468
468
  return inputEvent;
@@ -477,10 +477,10 @@
477
477
  var
478
478
  result = false
479
479
  ;
480
- value = (value !== undefined)
480
+ value = value !== undefined
481
481
  ? value
482
482
  : module.get.value();
483
- results = (results !== undefined)
483
+ results = results !== undefined
484
484
  ? results
485
485
  : module.get.results();
486
486
  if (settings.type === 'category') {
@@ -545,7 +545,7 @@
545
545
  $searchButton.removeClass(className.pressed);
546
546
  },
547
547
  diacritics: function (text) {
548
- return settings.ignoreDiacritics ? text.normalize('NFD').replace(/[\u0300-\u036f]/g, '') : text;
548
+ return settings.ignoreDiacritics ? text.normalize('NFD').replace(/[\u0300-\u036F]/g, '') : text;
549
549
  },
550
550
  },
551
551
 
@@ -634,9 +634,9 @@
634
634
  // avoid duplicates when pushing results
635
635
  addResult = function (array, result) {
636
636
  var
637
- notResult = ($.inArray(result, results) == -1),
638
- notFuzzyResult = ($.inArray(result, fuzzyResults) == -1),
639
- notExactResults = ($.inArray(result, exactResults) == -1)
637
+ notResult = $.inArray(result, results) == -1,
638
+ notFuzzyResult = $.inArray(result, fuzzyResults) == -1,
639
+ notExactResults = $.inArray(result, exactResults) == -1
640
640
  ;
641
641
  if (notResult && notFuzzyResult && notExactResults) {
642
642
  array.push(result);
@@ -644,7 +644,7 @@
644
644
  }
645
645
  ;
646
646
  source = source || settings.source;
647
- searchFields = (searchFields !== undefined)
647
+ searchFields = searchFields !== undefined
648
648
  ? searchFields
649
649
  : settings.searchFields;
650
650
 
@@ -663,15 +663,13 @@
663
663
  $.each(searchFields, function (index, field) {
664
664
  $.each(source, function (label, content) {
665
665
  var
666
- fieldExists = (typeof content[field] == 'string') || (typeof content[field] == 'number')
666
+ fieldExists = (typeof content[field] === 'string') || (typeof content[field] === 'number')
667
667
  ;
668
668
  if (fieldExists) {
669
669
  var text;
670
- if (typeof content[field] === 'string') {
671
- text = module.remove.diacritics(content[field]);
672
- } else {
673
- text = content[field].toString();
674
- }
670
+ text = typeof content[field] === 'string'
671
+ ? module.remove.diacritics(content[field])
672
+ : content[field].toString();
675
673
  if (text.search(matchRegExp) !== -1) {
676
674
  // content starts with value (first in results)
677
675
  addResult(results, content);
@@ -711,19 +709,24 @@
711
709
  return false;
712
710
  }
713
711
  if (queryLength === termLength) {
714
- return (query === term);
712
+ return query === term;
715
713
  }
716
- search: for (var characterIndex = 0, nextCharacterIndex = 0; characterIndex < queryLength; characterIndex++) {
714
+ for (var characterIndex = 0, nextCharacterIndex = 0; characterIndex < queryLength; characterIndex++) {
717
715
  var
716
+ continueSearch = false,
718
717
  queryCharacter = query.charCodeAt(characterIndex)
719
718
  ;
720
719
  while (nextCharacterIndex < termLength) {
721
720
  if (term.charCodeAt(nextCharacterIndex++) === queryCharacter) {
722
- continue search;
721
+ continueSearch = true;
722
+
723
+ break;
723
724
  }
724
725
  }
725
726
 
726
- return false;
727
+ if (!continueSearch) {
728
+ return false;
729
+ }
727
730
  }
728
731
 
729
732
  return true;
@@ -769,7 +772,7 @@
769
772
  numCharacters = searchTerm.length
770
773
  ;
771
774
 
772
- return (numCharacters >= settings.minCharacters);
775
+ return numCharacters >= settings.minCharacters;
773
776
  },
774
777
  results: function () {
775
778
  if ($results.length === 0) {
@@ -807,7 +810,7 @@
807
810
  if (settings.cache) {
808
811
  module.verbose('Checking cache for generated html for query', name);
809
812
 
810
- return (typeof cache == 'object') && (cache[name] !== undefined)
813
+ return (typeof cache === 'object') && (cache[name] !== undefined)
811
814
  ? cache[name]
812
815
  : false;
813
816
  }
@@ -840,7 +843,7 @@
840
843
  },
841
844
  id: function (resultIndex, categoryIndex) {
842
845
  var
843
- resultID = (resultIndex + 1), // not zero indexed
846
+ resultID = resultIndex + 1, // not zero indexed
844
847
  letterID,
845
848
  id
846
849
  ;
@@ -870,7 +873,7 @@
870
873
  result: function (result, resultIndex, categoryIndex) {
871
874
  module.verbose('Injecting result into results');
872
875
  var
873
- $selectedResult = (categoryIndex !== undefined)
876
+ $selectedResult = categoryIndex !== undefined
874
877
  ? $results
875
878
  .children().eq(categoryIndex)
876
879
  .children(selector.results)
@@ -932,7 +935,7 @@
932
935
  write: {
933
936
  cache: function (name, value) {
934
937
  var
935
- cache = ($module.data(metadata.cache) !== undefined)
938
+ cache = $module.data(metadata.cache) !== undefined
936
939
  ? $module.data(metadata.cache)
937
940
  : {}
938
941
  ;
@@ -1042,8 +1045,8 @@
1042
1045
  module.debug('Generating html from response', response);
1043
1046
  var
1044
1047
  template = settings.templates[settings.type],
1045
- isProperObject = ($.isPlainObject(response[fields.results]) && !$.isEmptyObject(response[fields.results])),
1046
- isProperArray = (Array.isArray(response[fields.results]) && response[fields.results].length > 0),
1048
+ isProperObject = $.isPlainObject(response[fields.results]) && !$.isEmptyObject(response[fields.results]),
1049
+ isProperArray = Array.isArray(response[fields.results]) && response[fields.results].length > 0,
1047
1050
  html = ''
1048
1051
  ;
1049
1052
  if (isProperObject || isProperArray) {
@@ -1129,7 +1132,7 @@
1129
1132
  previousTime
1130
1133
  ;
1131
1134
  if (settings.performance) {
1132
- currentTime = new Date().getTime();
1135
+ currentTime = Date.now();
1133
1136
  previousTime = time || currentTime;
1134
1137
  executionTime = currentTime - previousTime;
1135
1138
  time = currentTime;
@@ -1158,7 +1161,7 @@
1158
1161
  title += ' \'' + moduleSelector + '\'';
1159
1162
  }
1160
1163
  if ($allModules.length > 1) {
1161
- title += ' ' + '(' + $allModules.length + ')';
1164
+ title += ' (' + $allModules.length + ')';
1162
1165
  }
1163
1166
  if ((console.group !== undefined || console.table !== undefined) && performance.length > 0) {
1164
1167
  console.groupCollapsed(title);
@@ -1183,11 +1186,11 @@
1183
1186
  ;
1184
1187
  passedArguments = passedArguments || queryArguments;
1185
1188
  context = context || element;
1186
- if (typeof query == 'string' && object !== undefined) {
1187
- query = query.split(/[\. ]/);
1189
+ if (typeof query === 'string' && object !== undefined) {
1190
+ query = query.split(/[ .]/);
1188
1191
  maxDepth = query.length - 1;
1189
1192
  $.each(query, function (depth, value) {
1190
- var camelCaseValue = (depth != maxDepth)
1193
+ var camelCaseValue = depth != maxDepth
1191
1194
  ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
1192
1195
  : query
1193
1196
  ;
@@ -1237,7 +1240,7 @@
1237
1240
  }
1238
1241
  });
1239
1242
 
1240
- return (returnedValue !== undefined)
1243
+ return returnedValue !== undefined
1241
1244
  ? returnedValue
1242
1245
  : this;
1243
1246
  };
@@ -1355,7 +1358,7 @@
1355
1358
  },
1356
1359
 
1357
1360
  regExp: {
1358
- escape: /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,
1361
+ escape: /[$()*+./?[\\\]^{|}-]/g,
1359
1362
  beginsWith: '(?:\\s|^)',
1360
1363
  },
1361
1364
 
@@ -1391,8 +1394,8 @@
1391
1394
  return string;
1392
1395
  }
1393
1396
  var
1394
- badChars = /[<>"'`]/g,
1395
- shouldEscape = /[&<>"'`]/,
1397
+ badChars = /["'<>`]/g,
1398
+ shouldEscape = /["&'<>`]/,
1396
1399
  escape = {
1397
1400
  '<': '&lt;',
1398
1401
  '>': '&gt;',
@@ -1404,7 +1407,7 @@
1404
1407
  return escape[chr];
1405
1408
  };
1406
1409
  if (shouldEscape.test(string)) {
1407
- string = string.replace(/&(?![a-z0-9#]{1,12};)/gi, '&amp;');
1410
+ string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&amp;');
1408
1411
 
1409
1412
  return string.replace(badChars, escapedChar);
1410
1413
  }
@@ -1446,11 +1449,9 @@
1446
1449
  // each item inside category
1447
1450
  html += '<div class="results">';
1448
1451
  $.each(category.results, function (index, result) {
1449
- if (result[fields.url]) {
1450
- html += '<a class="result" href="' + result[fields.url].replace(/"/g, '') + '">';
1451
- } else {
1452
- html += '<a class="result">';
1453
- }
1452
+ html += result[fields.url]
1453
+ ? '<a class="result" href="' + result[fields.url].replace(/"/g, '') + '">'
1454
+ : '<a class="result">';
1454
1455
  if (result[fields.image] !== undefined) {
1455
1456
  html += ''
1456
1457
  + '<div class="image">'
@@ -1477,17 +1478,15 @@
1477
1478
  }
1478
1479
  });
1479
1480
  if (response[fields.action]) {
1480
- if (fields.actionURL === false) {
1481
- html += ''
1481
+ html += fields.actionURL === false
1482
+ ? ''
1482
1483
  + '<div class="action">'
1483
1484
  + escape(response[fields.action][fields.actionText], preserveHTML)
1484
- + '</div>';
1485
- } else {
1486
- html += ''
1485
+ + '</div>'
1486
+ : ''
1487
1487
  + '<a href="' + response[fields.action][fields.actionURL].replace(/"/g, '') + '" class="action">'
1488
1488
  + escape(response[fields.action][fields.actionText], preserveHTML)
1489
1489
  + '</a>';
1490
- }
1491
1490
  }
1492
1491
 
1493
1492
  return html;
@@ -1503,11 +1502,9 @@
1503
1502
  if (response[fields.results] !== undefined) {
1504
1503
  // each result
1505
1504
  $.each(response[fields.results], function (index, result) {
1506
- if (result[fields.url]) {
1507
- html += '<a class="result" href="' + result[fields.url].replace(/"/g, '') + '">';
1508
- } else {
1509
- html += '<a class="result">';
1510
- }
1505
+ html += result[fields.url]
1506
+ ? '<a class="result" href="' + result[fields.url].replace(/"/g, '') + '">'
1507
+ : '<a class="result">';
1511
1508
  if (result[fields.image] !== undefined) {
1512
1509
  html += ''
1513
1510
  + '<div class="image">'
@@ -1529,17 +1526,15 @@
1529
1526
  html += '</a>';
1530
1527
  });
1531
1528
  if (response[fields.action]) {
1532
- if (fields.actionURL === false) {
1533
- html += ''
1529
+ html += fields.actionURL === false
1530
+ ? ''
1534
1531
  + '<div class="action">'
1535
1532
  + escape(response[fields.action][fields.actionText], preserveHTML)
1536
- + '</div>';
1537
- } else {
1538
- html += ''
1533
+ + '</div>'
1534
+ : ''
1539
1535
  + '<a href="' + response[fields.action][fields.actionURL].replace(/"/g, '') + '" class="action">'
1540
1536
  + escape(response[fields.action][fields.actionText], preserveHTML)
1541
1537
  + '</a>';
1542
- }
1543
1538
  }
1544
1539
 
1545
1540
  return html;
@@ -15,7 +15,7 @@
15
15
  return typeof obj === 'function' && typeof obj.nodeType !== 'number';
16
16
  }
17
17
 
18
- window = (typeof window != 'undefined' && window.Math == Math)
18
+ window = window !== undefined && window.Math === Math
19
19
  ? window
20
20
  : globalThis;
21
21
 
@@ -23,11 +23,11 @@
23
23
  var
24
24
  $allModules = $(this),
25
25
 
26
- time = new Date().getTime(),
26
+ time = Date.now(),
27
27
  performance = [],
28
28
 
29
29
  query = arguments[0],
30
- methodInvoked = (typeof query == 'string'),
30
+ methodInvoked = typeof query === 'string',
31
31
  queryArguments = [].slice.call(arguments, 1),
32
32
 
33
33
  requestAnimationFrame = window.requestAnimationFrame
@@ -44,7 +44,7 @@
44
44
  $allModules.each(function () {
45
45
  var
46
46
  moduleSelector = $allModules.selector || '',
47
- settings = ($.isPlainObject(parameters))
47
+ settings = $.isPlainObject(parameters)
48
48
  ? $.extend(true, {}, $.fn.shape.settings, parameters)
49
49
  : $.extend({}, $.fn.shape.settings),
50
50
 
@@ -185,7 +185,7 @@
185
185
 
186
186
  is: {
187
187
  complete: function () {
188
- return ($side.filter('.' + className.active)[0] == $nextSide[0]);
188
+ return $side.filter('.' + className.active)[0] == $nextSide[0];
189
189
  },
190
190
  animating: function () {
191
191
  return $module.hasClass(className.animating);
@@ -199,7 +199,7 @@
199
199
 
200
200
  defaultSide: function () {
201
201
  $activeSide = $side.filter('.' + settings.className.active);
202
- $nextSide = ($activeSide.next(selector.side).length > 0)
202
+ $nextSide = $activeSide.next(selector.side).length > 0
203
203
  ? $activeSide.next(selector.side)
204
204
  : $side.first();
205
205
  nextIndex = false;
@@ -209,7 +209,7 @@
209
209
 
210
210
  duration: function (duration) {
211
211
  duration = duration || settings.duration;
212
- duration = (typeof duration == 'number')
212
+ duration = typeof duration === 'number'
213
213
  ? duration + 'ms'
214
214
  : duration;
215
215
  module.verbose('Setting animation duration', duration);
@@ -245,21 +245,21 @@
245
245
  $clone = $module.clone().addClass(className.loading),
246
246
  $side = $clone.find('>' + selector.sides + '>' + selector.side),
247
247
  $activeSide = $side.filter('.' + settings.className.active),
248
- $nextSide = (nextIndex)
248
+ $nextSide = nextIndex
249
249
  ? $side.eq(nextIndex)
250
- : ($activeSide.next(selector.side).length > 0)
250
+ : ($activeSide.next(selector.side).length > 0
251
251
  ? $activeSide.next(selector.side)
252
- : $side.first(),
253
- newWidth = (settings.width === 'next')
252
+ : $side.first()),
253
+ newWidth = settings.width === 'next'
254
254
  ? $nextSide.outerWidth(true)
255
- : (settings.width === 'initial')
255
+ : (settings.width === 'initial'
256
256
  ? $module.width()
257
- : settings.width,
258
- newHeight = (settings.height === 'next')
257
+ : settings.width),
258
+ newHeight = settings.height === 'next'
259
259
  ? $nextSide.outerHeight(true)
260
- : (settings.height === 'initial')
260
+ : (settings.height === 'initial'
261
261
  ? $module.height()
262
- : settings.height
262
+ : settings.height)
263
263
  ;
264
264
  $activeSide.removeClass(className.active);
265
265
  $nextSide.addClass(className.active);
@@ -443,7 +443,7 @@
443
443
  },
444
444
 
445
445
  nextSide: function () {
446
- return ($activeSide.next(selector.side).length > 0)
446
+ return $activeSide.next(selector.side).length > 0
447
447
  ? $activeSide.next(selector.side)
448
448
  : $side.first();
449
449
  },
@@ -455,10 +455,10 @@
455
455
  above: function () {
456
456
  var
457
457
  box = {
458
- origin: (($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2),
458
+ origin: ($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2,
459
459
  depth: {
460
- active: ($nextSide.outerHeight(true) / 2),
461
- next: ($activeSide.outerHeight(true) / 2),
460
+ active: $nextSide.outerHeight(true) / 2,
461
+ next: $activeSide.outerHeight(true) / 2,
462
462
  },
463
463
  }
464
464
  ;
@@ -480,10 +480,10 @@
480
480
  below: function () {
481
481
  var
482
482
  box = {
483
- origin: (($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2),
483
+ origin: ($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2,
484
484
  depth: {
485
- active: ($nextSide.outerHeight(true) / 2),
486
- next: ($activeSide.outerHeight(true) / 2),
485
+ active: $nextSide.outerHeight(true) / 2,
486
+ next: $activeSide.outerHeight(true) / 2,
487
487
  },
488
488
  }
489
489
  ;
@@ -509,10 +509,10 @@
509
509
  next: $nextSide.outerWidth(true),
510
510
  },
511
511
  box = {
512
- origin: ((height.active - height.next) / 2),
512
+ origin: (height.active - height.next) / 2,
513
513
  depth: {
514
- active: (height.next / 2),
515
- next: (height.active / 2),
514
+ active: height.next / 2,
515
+ next: height.active / 2,
516
516
  },
517
517
  }
518
518
  ;
@@ -538,10 +538,10 @@
538
538
  next: $nextSide.outerWidth(true),
539
539
  },
540
540
  box = {
541
- origin: ((height.active - height.next) / 2),
541
+ origin: (height.active - height.next) / 2,
542
542
  depth: {
543
- active: (height.next / 2),
544
- next: (height.active / 2),
543
+ active: height.next / 2,
544
+ next: height.active / 2,
545
545
  },
546
546
  }
547
547
  ;
@@ -567,10 +567,10 @@
567
567
  next: $nextSide.outerWidth(true),
568
568
  },
569
569
  box = {
570
- origin: ((height.active - height.next) / 2),
570
+ origin: (height.active - height.next) / 2,
571
571
  depth: {
572
- active: (height.next / 2),
573
- next: (height.active / 2),
572
+ active: height.next / 2,
573
+ next: height.active / 2,
574
574
  },
575
575
  }
576
576
  ;
@@ -646,7 +646,7 @@
646
646
  previousTime
647
647
  ;
648
648
  if (settings.performance) {
649
- currentTime = new Date().getTime();
649
+ currentTime = Date.now();
650
650
  previousTime = time || currentTime;
651
651
  executionTime = currentTime - previousTime;
652
652
  time = currentTime;
@@ -675,7 +675,7 @@
675
675
  title += ' \'' + moduleSelector + '\'';
676
676
  }
677
677
  if ($allModules.length > 1) {
678
- title += ' ' + '(' + $allModules.length + ')';
678
+ title += ' (' + $allModules.length + ')';
679
679
  }
680
680
  if ((console.group !== undefined || console.table !== undefined) && performance.length > 0) {
681
681
  console.groupCollapsed(title);
@@ -700,11 +700,11 @@
700
700
  ;
701
701
  passedArguments = passedArguments || queryArguments;
702
702
  context = context || element;
703
- if (typeof query == 'string' && object !== undefined) {
704
- query = query.split(/[\. ]/);
703
+ if (typeof query === 'string' && object !== undefined) {
704
+ query = query.split(/[ .]/);
705
705
  maxDepth = query.length - 1;
706
706
  $.each(query, function (depth, value) {
707
- var camelCaseValue = (depth != maxDepth)
707
+ var camelCaseValue = depth != maxDepth
708
708
  ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
709
709
  : query
710
710
  ;
@@ -763,7 +763,7 @@
763
763
  }
764
764
  });
765
765
 
766
- return (returnedValue !== undefined)
766
+ return returnedValue !== undefined
767
767
  ? returnedValue
768
768
  : this;
769
769
  };