@ntlab/ntjs-assets 2.0.2 → 2.0.4

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 (241) hide show
  1. package/assets/js/bootstrap-icons/bootstrap-icons.svg +1 -1
  2. package/assets/js/bootstrap-icons/folder-plus.svg +2 -2
  3. package/assets/js/bootstrap-icons/font/bootstrap-icons.css +1981 -0
  4. package/assets/js/bootstrap-icons/font/bootstrap-icons.json +1955 -0
  5. package/assets/js/bootstrap-icons/font/bootstrap-icons.min.css +5 -0
  6. package/assets/js/bootstrap-icons/font/bootstrap-icons.scss +1993 -0
  7. package/assets/js/bootstrap-icons/font/fonts/bootstrap-icons.woff +0 -0
  8. package/assets/js/bootstrap-icons/font/fonts/bootstrap-icons.woff2 +0 -0
  9. package/assets/js/bootstrap-icons/postcard-heart-fill.svg +1 -1
  10. package/assets/js/bootstrap-icons/trash.svg +2 -2
  11. package/assets/js/cropper/cropper.common.js +3253 -0
  12. package/assets/js/cropper/cropper.css +166 -236
  13. package/assets/js/cropper/cropper.esm.js +3251 -0
  14. package/assets/js/cropper/cropper.js +2499 -2237
  15. package/assets/js/cropper/cropper.min.css +5 -5
  16. package/assets/js/cropper/cropper.min.js +5 -5
  17. package/assets/js/jquery/jquery.js +840 -1045
  18. package/assets/js/jquery/jquery.min.js +2 -2
  19. package/assets/js/jquery/jquery.min.map +1 -1
  20. package/assets/js/jquery/jquery.slim.js +834 -1039
  21. package/assets/js/jquery/jquery.slim.min.js +2 -2
  22. package/assets/js/jquery/jquery.slim.min.map +1 -1
  23. package/assets/js/popper.js/cjs/enums.js +1 -1
  24. package/assets/js/popper.js/cjs/popper-base.js +12 -170
  25. package/assets/js/popper.js/cjs/popper-base.js.map +1 -1
  26. package/assets/js/popper.js/cjs/popper-lite.js +14 -184
  27. package/assets/js/popper.js/cjs/popper-lite.js.map +1 -1
  28. package/assets/js/popper.js/cjs/popper.js +14 -197
  29. package/assets/js/popper.js/cjs/popper.js.map +1 -1
  30. package/assets/js/popper.js/esm/createPopper.js +6 -66
  31. package/assets/js/popper.js/esm/modifiers/arrow.js +1 -12
  32. package/assets/js/popper.js/esm/modifiers/computeStyles.js +2 -14
  33. package/assets/js/popper.js/esm/utils/computeAutoPlacement.js +0 -4
  34. package/assets/js/popper.js/esm/utils/userAgent.js +1 -1
  35. package/assets/js/popper.js/umd/enums.js +1 -1
  36. package/assets/js/popper.js/umd/enums.min.js +1 -1
  37. package/assets/js/popper.js/umd/popper-base.js +12 -170
  38. package/assets/js/popper.js/umd/popper-base.js.map +1 -1
  39. package/assets/js/popper.js/umd/popper-base.min.js +2 -2
  40. package/assets/js/popper.js/umd/popper-base.min.js.map +1 -1
  41. package/assets/js/popper.js/umd/popper-lite.js +14 -184
  42. package/assets/js/popper.js/umd/popper-lite.js.map +1 -1
  43. package/assets/js/popper.js/umd/popper-lite.min.js +2 -2
  44. package/assets/js/popper.js/umd/popper-lite.min.js.map +1 -1
  45. package/assets/js/popper.js/umd/popper.js +14 -197
  46. package/assets/js/popper.js/umd/popper.js.map +1 -1
  47. package/assets/js/popper.js/umd/popper.min.js +2 -2
  48. package/assets/js/popper.js/umd/popper.min.js.map +1 -1
  49. package/assets/js/semantic-ui/components/accordion.css +196 -74
  50. package/assets/js/semantic-ui/components/accordion.js +570 -591
  51. package/assets/js/semantic-ui/components/accordion.min.css +4 -4
  52. package/assets/js/semantic-ui/components/accordion.min.js +6 -6
  53. package/assets/js/semantic-ui/components/ad.css +40 -51
  54. package/assets/js/semantic-ui/components/ad.min.css +4 -4
  55. package/assets/js/semantic-ui/components/api.js +1154 -1117
  56. package/assets/js/semantic-ui/components/api.min.js +6 -6
  57. package/assets/js/semantic-ui/components/breadcrumb.css +7 -7
  58. package/assets/js/semantic-ui/components/breadcrumb.min.css +4 -4
  59. package/assets/js/semantic-ui/components/button.css +895 -1227
  60. package/assets/js/semantic-ui/components/button.min.css +4 -4
  61. package/assets/js/semantic-ui/components/calendar.css +60 -33
  62. package/assets/js/semantic-ui/components/calendar.js +1952 -1575
  63. package/assets/js/semantic-ui/components/calendar.min.css +4 -4
  64. package/assets/js/semantic-ui/components/calendar.min.js +6 -6
  65. package/assets/js/semantic-ui/components/card.css +1004 -441
  66. package/assets/js/semantic-ui/components/card.min.css +4 -4
  67. package/assets/js/semantic-ui/components/checkbox.css +275 -303
  68. package/assets/js/semantic-ui/components/checkbox.js +863 -855
  69. package/assets/js/semantic-ui/components/checkbox.min.css +4 -4
  70. package/assets/js/semantic-ui/components/checkbox.min.js +6 -6
  71. package/assets/js/semantic-ui/components/comment.css +45 -63
  72. package/assets/js/semantic-ui/components/comment.min.css +4 -4
  73. package/assets/js/semantic-ui/components/container.css +98 -4
  74. package/assets/js/semantic-ui/components/container.min.css +4 -4
  75. package/assets/js/semantic-ui/components/dimmer.css +95 -196
  76. package/assets/js/semantic-ui/components/dimmer.js +698 -717
  77. package/assets/js/semantic-ui/components/dimmer.min.css +4 -4
  78. package/assets/js/semantic-ui/components/dimmer.min.js +6 -6
  79. package/assets/js/semantic-ui/components/divider.css +75 -93
  80. package/assets/js/semantic-ui/components/divider.min.css +4 -4
  81. package/assets/js/semantic-ui/components/dropdown.css +490 -413
  82. package/assets/js/semantic-ui/components/dropdown.js +4203 -4068
  83. package/assets/js/semantic-ui/components/dropdown.min.css +4 -4
  84. package/assets/js/semantic-ui/components/dropdown.min.js +6 -6
  85. package/assets/js/semantic-ui/components/embed.css +27 -38
  86. package/assets/js/semantic-ui/components/embed.js +647 -673
  87. package/assets/js/semantic-ui/components/embed.min.css +4 -4
  88. package/assets/js/semantic-ui/components/embed.min.js +6 -6
  89. package/assets/js/semantic-ui/components/emoji.css +11156 -9192
  90. package/assets/js/semantic-ui/components/emoji.min.css +3 -3
  91. package/assets/js/semantic-ui/components/feed.css +56 -78
  92. package/assets/js/semantic-ui/components/feed.min.css +4 -4
  93. package/assets/js/semantic-ui/components/flag.css +1037 -929
  94. package/assets/js/semantic-ui/components/flag.min.css +4 -4
  95. package/assets/js/semantic-ui/components/flyout.css +552 -0
  96. package/assets/js/semantic-ui/components/flyout.js +1567 -0
  97. package/assets/js/semantic-ui/components/flyout.min.css +9 -0
  98. package/assets/js/semantic-ui/components/flyout.min.js +11 -0
  99. package/assets/js/semantic-ui/components/form.css +536 -530
  100. package/assets/js/semantic-ui/components/form.js +2037 -1945
  101. package/assets/js/semantic-ui/components/form.min.css +4 -4
  102. package/assets/js/semantic-ui/components/form.min.js +6 -6
  103. package/assets/js/semantic-ui/components/grid.css +218 -345
  104. package/assets/js/semantic-ui/components/grid.min.css +4 -4
  105. package/assets/js/semantic-ui/components/header.css +137 -154
  106. package/assets/js/semantic-ui/components/header.min.css +4 -4
  107. package/assets/js/semantic-ui/components/icon.css +3000 -2750
  108. package/assets/js/semantic-ui/components/icon.min.css +4 -4
  109. package/assets/js/semantic-ui/components/image.css +54 -49
  110. package/assets/js/semantic-ui/components/image.min.css +4 -4
  111. package/assets/js/semantic-ui/components/input.css +1081 -227
  112. package/assets/js/semantic-ui/components/input.min.css +4 -4
  113. package/assets/js/semantic-ui/components/item.css +91 -138
  114. package/assets/js/semantic-ui/components/item.min.css +4 -4
  115. package/assets/js/semantic-ui/components/label.css +470 -481
  116. package/assets/js/semantic-ui/components/label.min.css +4 -4
  117. package/assets/js/semantic-ui/components/list.css +93 -114
  118. package/assets/js/semantic-ui/components/list.min.css +4 -4
  119. package/assets/js/semantic-ui/components/loader.css +452 -536
  120. package/assets/js/semantic-ui/components/loader.min.css +4 -4
  121. package/assets/js/semantic-ui/components/menu.css +408 -510
  122. package/assets/js/semantic-ui/components/menu.min.css +9 -1
  123. package/assets/js/semantic-ui/components/message.css +188 -213
  124. package/assets/js/semantic-ui/components/message.min.css +4 -4
  125. package/assets/js/semantic-ui/components/modal.css +174 -166
  126. package/assets/js/semantic-ui/components/modal.js +1558 -1146
  127. package/assets/js/semantic-ui/components/modal.min.css +4 -4
  128. package/assets/js/semantic-ui/components/modal.min.js +6 -6
  129. package/assets/js/semantic-ui/components/nag.css +183 -41
  130. package/assets/js/semantic-ui/components/nag.js +527 -467
  131. package/assets/js/semantic-ui/components/nag.min.css +4 -4
  132. package/assets/js/semantic-ui/components/nag.min.js +6 -6
  133. package/assets/js/semantic-ui/components/placeholder.css +62 -76
  134. package/assets/js/semantic-ui/components/placeholder.min.css +4 -4
  135. package/assets/js/semantic-ui/components/popup.css +681 -312
  136. package/assets/js/semantic-ui/components/popup.js +1470 -1463
  137. package/assets/js/semantic-ui/components/popup.min.css +4 -4
  138. package/assets/js/semantic-ui/components/popup.min.js +6 -6
  139. package/assets/js/semantic-ui/components/progress.css +149 -217
  140. package/assets/js/semantic-ui/components/progress.js +945 -1002
  141. package/assets/js/semantic-ui/components/progress.min.css +4 -4
  142. package/assets/js/semantic-ui/components/progress.min.js +6 -6
  143. package/assets/js/semantic-ui/components/rail.css +17 -22
  144. package/assets/js/semantic-ui/components/rail.min.css +3 -3
  145. package/assets/js/semantic-ui/components/rating.css +89 -184
  146. package/assets/js/semantic-ui/components/rating.js +509 -521
  147. package/assets/js/semantic-ui/components/rating.min.css +4 -4
  148. package/assets/js/semantic-ui/components/rating.min.js +6 -6
  149. package/assets/js/semantic-ui/components/reset.css +12 -17
  150. package/assets/js/semantic-ui/components/reset.min.css +4 -4
  151. package/assets/js/semantic-ui/components/reveal.css +46 -85
  152. package/assets/js/semantic-ui/components/reveal.min.css +4 -4
  153. package/assets/js/semantic-ui/components/search.css +157 -96
  154. package/assets/js/semantic-ui/components/search.js +1522 -1479
  155. package/assets/js/semantic-ui/components/search.min.css +4 -4
  156. package/assets/js/semantic-ui/components/search.min.js +6 -6
  157. package/assets/js/semantic-ui/components/segment.css +317 -249
  158. package/assets/js/semantic-ui/components/segment.min.css +4 -4
  159. package/assets/js/semantic-ui/components/shape.css +16 -32
  160. package/assets/js/semantic-ui/components/shape.js +763 -812
  161. package/assets/js/semantic-ui/components/shape.min.css +4 -4
  162. package/assets/js/semantic-ui/components/shape.min.js +6 -6
  163. package/assets/js/semantic-ui/components/sidebar.css +128 -216
  164. package/assets/js/semantic-ui/components/sidebar.js +1042 -1003
  165. package/assets/js/semantic-ui/components/sidebar.min.css +4 -4
  166. package/assets/js/semantic-ui/components/sidebar.min.js +6 -6
  167. package/assets/js/semantic-ui/components/site.css +123 -48
  168. package/assets/js/semantic-ui/components/site.js +438 -478
  169. package/assets/js/semantic-ui/components/site.min.css +4 -4
  170. package/assets/js/semantic-ui/components/site.min.js +6 -6
  171. package/assets/js/semantic-ui/components/slider.css +133 -141
  172. package/assets/js/semantic-ui/components/slider.js +1312 -1274
  173. package/assets/js/semantic-ui/components/slider.min.css +9 -1
  174. package/assets/js/semantic-ui/components/slider.min.js +6 -6
  175. package/assets/js/semantic-ui/components/state.js +640 -659
  176. package/assets/js/semantic-ui/components/state.min.js +6 -6
  177. package/assets/js/semantic-ui/components/statistic.css +83 -124
  178. package/assets/js/semantic-ui/components/statistic.min.css +4 -4
  179. package/assets/js/semantic-ui/components/step.css +118 -184
  180. package/assets/js/semantic-ui/components/step.min.css +4 -4
  181. package/assets/js/semantic-ui/components/sticky.css +3 -8
  182. package/assets/js/semantic-ui/components/sticky.js +849 -892
  183. package/assets/js/semantic-ui/components/sticky.min.css +4 -4
  184. package/assets/js/semantic-ui/components/sticky.min.js +6 -6
  185. package/assets/js/semantic-ui/components/tab.css +16 -20
  186. package/assets/js/semantic-ui/components/tab.js +896 -941
  187. package/assets/js/semantic-ui/components/tab.min.css +4 -4
  188. package/assets/js/semantic-ui/components/tab.min.js +6 -6
  189. package/assets/js/semantic-ui/components/table.css +2073 -884
  190. package/assets/js/semantic-ui/components/table.min.css +4 -4
  191. package/assets/js/semantic-ui/components/text.css +51 -30
  192. package/assets/js/semantic-ui/components/text.min.css +4 -4
  193. package/assets/js/semantic-ui/components/toast.css +200 -137
  194. package/assets/js/semantic-ui/components/toast.js +912 -832
  195. package/assets/js/semantic-ui/components/toast.min.css +4 -4
  196. package/assets/js/semantic-ui/components/toast.min.js +6 -6
  197. package/assets/js/semantic-ui/components/transition.css +371 -1282
  198. package/assets/js/semantic-ui/components/transition.js +999 -1074
  199. package/assets/js/semantic-ui/components/transition.min.css +4 -4
  200. package/assets/js/semantic-ui/components/transition.min.js +6 -6
  201. package/assets/js/semantic-ui/components/visibility.js +1215 -1247
  202. package/assets/js/semantic-ui/components/visibility.min.js +6 -6
  203. package/assets/js/semantic-ui/semantic.css +43777 -37429
  204. package/assets/js/semantic-ui/semantic.js +29152 -26694
  205. package/assets/js/semantic-ui/semantic.min.css +6 -399
  206. package/assets/js/semantic-ui/semantic.min.js +6 -6
  207. package/assets/js/semantic-ui/themes/basic/assets/fonts/icons.woff2 +0 -0
  208. package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Bold.woff +0 -0
  209. package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Bold.woff2 +0 -0
  210. package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-BoldItalic.woff +0 -0
  211. package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  212. package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Italic.woff +0 -0
  213. package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Italic.woff2 +0 -0
  214. package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Regular.woff +0 -0
  215. package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Regular.woff2 +0 -0
  216. package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
  217. package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Bold.woff2 +0 -0
  218. package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-BoldItalic.woff +0 -0
  219. package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-BoldItalic.woff2 +0 -0
  220. package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Italic.woff +0 -0
  221. package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Italic.woff2 +0 -0
  222. package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
  223. package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Regular.woff2 +0 -0
  224. package/assets/js/semantic-ui/themes/default/assets/fonts/brand-icons.woff +0 -0
  225. package/assets/js/semantic-ui/themes/default/assets/fonts/brand-icons.woff2 +0 -0
  226. package/assets/js/semantic-ui/themes/default/assets/fonts/icons.woff +0 -0
  227. package/assets/js/semantic-ui/themes/default/assets/fonts/icons.woff2 +0 -0
  228. package/assets/js/semantic-ui/themes/default/assets/fonts/outline-icons.woff +0 -0
  229. package/assets/js/semantic-ui/themes/default/assets/fonts/outline-icons.woff2 +0 -0
  230. package/assets/js/semantic-ui/themes/famfamfam/assets/images/flags.png +0 -0
  231. package/assets/js/semantic-ui/themes/github/assets/fonts/octicons.woff2 +0 -0
  232. package/assets/js/socket.io/socket.io.esm.min.js +3 -3
  233. package/assets/js/socket.io/socket.io.esm.min.js.map +1 -1
  234. package/assets/js/socket.io/socket.io.js +988 -1143
  235. package/assets/js/socket.io/socket.io.js.map +1 -1
  236. package/assets/js/socket.io/socket.io.min.js +3 -3
  237. package/assets/js/socket.io/socket.io.min.js.map +1 -1
  238. package/assets/js/socket.io/socket.io.msgpack.min.js +3 -3
  239. package/assets/js/socket.io/socket.io.msgpack.min.js.map +1 -1
  240. package/cdn.json +19 -4
  241. package/package.json +1 -1
@@ -1,618 +1,597 @@
1
1
  /*!
2
- * # Fomantic-UI - Accordion
3
- * http://github.com/fomantic/Fomantic-UI/
2
+ * # Fomantic-UI 2.9.2 - Accordion
3
+ * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
6
6
  * Released under the MIT license
7
- * http://opensource.org/licenses/MIT
7
+ * https://opensource.org/licenses/MIT
8
8
  *
9
9
  */
10
10
 
11
- ;(function ($, window, document, undefined) {
12
-
13
- 'use strict';
14
-
15
- $.isFunction = $.isFunction || function(obj) {
16
- return typeof obj === "function" && typeof obj.nodeType !== "number";
17
- };
18
-
19
- window = (typeof window != 'undefined' && window.Math == Math)
20
- ? window
21
- : (typeof self != 'undefined' && self.Math == Math)
22
- ? self
23
- : Function('return this')()
24
- ;
25
-
26
- $.fn.accordion = function(parameters) {
27
- var
28
- $allModules = $(this),
29
-
30
- time = new Date().getTime(),
31
- performance = [],
32
-
33
- query = arguments[0],
34
- methodInvoked = (typeof query == 'string'),
35
- queryArguments = [].slice.call(arguments, 1),
36
-
37
- returnedValue
38
- ;
39
- $allModules
40
- .each(function() {
41
- var
42
- settings = ( $.isPlainObject(parameters) )
43
- ? $.extend(true, {}, $.fn.accordion.settings, parameters)
44
- : $.extend({}, $.fn.accordion.settings),
45
-
46
- className = settings.className,
47
- namespace = settings.namespace,
48
- selector = settings.selector,
49
- error = settings.error,
50
-
51
- eventNamespace = '.' + namespace,
52
- moduleNamespace = 'module-' + namespace,
53
- moduleSelector = $allModules.selector || '',
54
-
55
- $module = $(this),
56
- $title = $module.find(selector.title),
57
- $content = $module.find(selector.content),
58
-
59
- element = this,
60
- instance = $module.data(moduleNamespace),
61
- observer,
62
- module
63
- ;
64
-
65
- module = {
66
-
67
- initialize: function() {
68
- module.debug('Initializing', $module);
69
- module.bind.events();
70
- if(settings.observeChanges) {
71
- module.observeChanges();
72
- }
73
- module.instantiate();
74
- },
11
+ (function ($, window, document) {
12
+ 'use strict';
75
13
 
76
- instantiate: function() {
77
- instance = module;
78
- $module
79
- .data(moduleNamespace, module)
80
- ;
81
- },
14
+ function isFunction(obj) {
15
+ return typeof obj === 'function' && typeof obj.nodeType !== 'number';
16
+ }
82
17
 
83
- destroy: function() {
84
- module.debug('Destroying previous instance', $module);
85
- $module
86
- .off(eventNamespace)
87
- .removeData(moduleNamespace)
88
- ;
89
- },
18
+ window = window !== undefined && window.Math === Math
19
+ ? window
20
+ : globalThis;
90
21
 
91
- refresh: function() {
92
- $title = $module.find(selector.title);
93
- $content = $module.find(selector.content);
94
- },
22
+ $.fn.accordion = function (parameters) {
23
+ var
24
+ $allModules = $(this),
95
25
 
96
- observeChanges: function() {
97
- if('MutationObserver' in window) {
98
- observer = new MutationObserver(function(mutations) {
99
- module.debug('DOM tree modified, updating selector cache');
100
- module.refresh();
101
- });
102
- observer.observe(element, {
103
- childList : true,
104
- subtree : true
105
- });
106
- module.debug('Setting up mutation observer', observer);
107
- }
108
- },
26
+ time = Date.now(),
27
+ performance = [],
109
28
 
110
- bind: {
111
- events: function() {
112
- module.debug('Binding delegated events');
113
- $module
114
- .on(settings.on + eventNamespace, selector.trigger, module.event.click)
115
- ;
116
- }
117
- },
29
+ query = arguments[0],
30
+ methodInvoked = typeof query === 'string',
31
+ queryArguments = [].slice.call(arguments, 1),
118
32
 
119
- event: {
120
- click: function() {
121
- module.toggle.call(this);
122
- }
123
- },
33
+ returnedValue
34
+ ;
35
+ $allModules.each(function () {
36
+ var
37
+ settings = $.isPlainObject(parameters)
38
+ ? $.extend(true, {}, $.fn.accordion.settings, parameters)
39
+ : $.extend({}, $.fn.accordion.settings),
40
+
41
+ className = settings.className,
42
+ namespace = settings.namespace,
43
+ selector = settings.selector,
44
+ error = settings.error,
45
+
46
+ eventNamespace = '.' + namespace,
47
+ moduleNamespace = 'module-' + namespace,
48
+ moduleSelector = $allModules.selector || '',
49
+
50
+ $module = $(this),
51
+ $title = $module.find(selector.title),
52
+ $content = $module.find(selector.content),
53
+
54
+ element = this,
55
+ instance = $module.data(moduleNamespace),
56
+ observer,
57
+ module
58
+ ;
124
59
 
125
- toggle: function(query) {
126
- var
127
- $activeTitle = (query !== undefined)
128
- ? (typeof query === 'number')
129
- ? $title.eq(query)
130
- : $(query).closest(selector.title)
131
- : $(this).closest(selector.title),
132
- $activeContent = $activeTitle.next($content),
133
- isAnimating = $activeContent.hasClass(className.animating),
134
- isActive = $activeContent.hasClass(className.active),
135
- isOpen = (isActive && !isAnimating),
136
- isOpening = (!isActive && isAnimating)
137
- ;
138
- module.debug('Toggling visibility of content', $activeTitle);
139
- if(isOpen || isOpening) {
140
- if(settings.collapsible) {
141
- module.close.call($activeTitle);
142
- }
143
- else {
144
- module.debug('Cannot close accordion content collapsing is disabled');
145
- }
146
- }
147
- else {
148
- module.open.call($activeTitle);
149
- }
150
- },
60
+ module = {
151
61
 
152
- open: function(query) {
153
- var
154
- $activeTitle = (query !== undefined)
155
- ? (typeof query === 'number')
156
- ? $title.eq(query)
157
- : $(query).closest(selector.title)
158
- : $(this).closest(selector.title),
159
- $activeContent = $activeTitle.next($content),
160
- isAnimating = $activeContent.hasClass(className.animating),
161
- isActive = $activeContent.hasClass(className.active),
162
- isOpen = (isActive || isAnimating)
163
- ;
164
- if(isOpen) {
165
- module.debug('Accordion already open, skipping', $activeContent);
166
- return;
167
- }
168
- module.debug('Opening accordion content', $activeTitle);
169
- settings.onOpening.call($activeContent);
170
- settings.onChanging.call($activeContent);
171
- if(settings.exclusive) {
172
- module.closeOthers.call($activeTitle);
173
- }
174
- $activeTitle
175
- .addClass(className.active)
176
- ;
177
- $activeContent
178
- .stop(true, true)
179
- .addClass(className.animating)
180
- ;
181
- if(settings.animateChildren) {
182
- if($.fn.transition !== undefined && $module.transition('is supported')) {
183
- $activeContent
184
- .children()
185
- .transition({
186
- animation : 'fade in',
187
- queue : false,
188
- useFailSafe : true,
189
- debug : settings.debug,
190
- verbose : settings.verbose,
191
- duration : settings.duration,
192
- skipInlineHidden : true,
193
- onComplete: function() {
194
- $activeContent.children().removeClass(className.transition);
62
+ initialize: function () {
63
+ module.debug('Initializing', $module);
64
+ module.bind.events();
65
+ if (settings.observeChanges) {
66
+ module.observeChanges();
67
+ }
68
+ module.instantiate();
69
+ },
70
+
71
+ instantiate: function () {
72
+ instance = module;
73
+ $module
74
+ .data(moduleNamespace, module)
75
+ ;
76
+ },
77
+
78
+ destroy: function () {
79
+ module.debug('Destroying previous instance', $module);
80
+ $module
81
+ .off(eventNamespace)
82
+ .removeData(moduleNamespace)
83
+ ;
84
+ },
85
+
86
+ refresh: function () {
87
+ $title = $module.find(selector.title);
88
+ $content = $module.find(selector.content);
89
+ },
90
+
91
+ observeChanges: function () {
92
+ if ('MutationObserver' in window) {
93
+ observer = new MutationObserver(function (mutations) {
94
+ module.debug('DOM tree modified, updating selector cache');
95
+ module.refresh();
96
+ });
97
+ observer.observe(element, {
98
+ childList: true,
99
+ subtree: true,
100
+ });
101
+ module.debug('Setting up mutation observer', observer);
102
+ }
103
+ },
104
+
105
+ bind: {
106
+ events: function () {
107
+ module.debug('Binding delegated events');
108
+ $module
109
+ .on(settings.on + eventNamespace, selector.trigger, module.event.click)
110
+ ;
111
+ },
112
+ },
113
+
114
+ event: {
115
+ click: function (event) {
116
+ if ($(event.target).closest(selector.ignore).length === 0) {
117
+ module.toggle.call(this);
118
+ }
119
+ },
120
+ },
121
+
122
+ toggle: function (query) {
123
+ var
124
+ $activeTitle = query !== undefined
125
+ ? (typeof query === 'number'
126
+ ? $title.eq(query)
127
+ : $(query).closest(selector.title))
128
+ : $(this).closest(selector.title),
129
+ $activeContent = $activeTitle.next($content),
130
+ isAnimating = $activeContent.hasClass(className.animating),
131
+ isActive = $activeContent.hasClass(className.active),
132
+ isOpen = isActive && !isAnimating,
133
+ isOpening = !isActive && isAnimating
134
+ ;
135
+ module.debug('Toggling visibility of content', $activeTitle);
136
+ if (isOpen || isOpening) {
137
+ if (settings.collapsible) {
138
+ module.close.call($activeTitle);
139
+ } else {
140
+ module.debug('Cannot close accordion content collapsing is disabled');
141
+ }
142
+ } else {
143
+ module.open.call($activeTitle);
144
+ }
145
+ },
146
+
147
+ open: function (query) {
148
+ var
149
+ $activeTitle = query !== undefined
150
+ ? (typeof query === 'number'
151
+ ? $title.eq(query)
152
+ : $(query).closest(selector.title))
153
+ : $(this).closest(selector.title),
154
+ $activeContent = $activeTitle.next($content),
155
+ isAnimating = $activeContent.hasClass(className.animating),
156
+ isActive = $activeContent.hasClass(className.active),
157
+ isOpen = isActive || isAnimating
158
+ ;
159
+ if (isOpen) {
160
+ module.debug('Accordion already open, skipping', $activeContent);
161
+
162
+ return;
163
+ }
164
+ module.debug('Opening accordion content', $activeTitle);
165
+ settings.onOpening.call($activeContent);
166
+ settings.onChanging.call($activeContent);
167
+ if (settings.exclusive) {
168
+ module.closeOthers.call($activeTitle);
169
+ }
170
+ $activeTitle
171
+ .addClass(className.active)
172
+ ;
173
+ $activeContent
174
+ .stop(true, true)
175
+ .addClass(className.animating)
176
+ ;
177
+ if (settings.animateChildren) {
178
+ if ($.fn.transition !== undefined) {
179
+ $activeContent
180
+ .children()
181
+ .transition({
182
+ animation: 'fade in',
183
+ queue: false,
184
+ useFailSafe: true,
185
+ debug: settings.debug,
186
+ verbose: settings.verbose,
187
+ silent: settings.silent,
188
+ duration: settings.duration,
189
+ skipInlineHidden: true,
190
+ onComplete: function () {
191
+ $activeContent.children().removeClass(className.transition);
192
+ },
193
+ })
194
+ ;
195
+ } else {
196
+ $activeContent
197
+ .children()
198
+ .stop(true, true)
199
+ .animate({
200
+ opacity: 1,
201
+ }, settings.duration, module.resetOpacity);
202
+ }
203
+ }
204
+ $activeContent
205
+ .slideDown(settings.duration, settings.easing, function () {
206
+ $activeContent
207
+ .removeClass(className.animating)
208
+ .addClass(className.active)
209
+ ;
210
+ module.reset.display.call(this);
211
+ settings.onOpen.call(this);
212
+ settings.onChange.call(this);
213
+ })
214
+ ;
215
+ },
216
+
217
+ close: function (query) {
218
+ var
219
+ $activeTitle = query !== undefined
220
+ ? (typeof query === 'number'
221
+ ? $title.eq(query)
222
+ : $(query).closest(selector.title))
223
+ : $(this).closest(selector.title),
224
+ $activeContent = $activeTitle.next($content),
225
+ isAnimating = $activeContent.hasClass(className.animating),
226
+ isActive = $activeContent.hasClass(className.active),
227
+ isOpening = !isActive && isAnimating,
228
+ isClosing = isActive && isAnimating
229
+ ;
230
+ if ((isActive || isOpening) && !isClosing) {
231
+ module.debug('Closing accordion content', $activeContent);
232
+ settings.onClosing.call($activeContent);
233
+ settings.onChanging.call($activeContent);
234
+ $activeTitle
235
+ .removeClass(className.active)
236
+ ;
237
+ $activeContent
238
+ .stop(true, true)
239
+ .addClass(className.animating)
240
+ ;
241
+ if (settings.animateChildren) {
242
+ if ($.fn.transition !== undefined) {
243
+ $activeContent
244
+ .children()
245
+ .transition({
246
+ animation: 'fade out',
247
+ queue: false,
248
+ useFailSafe: true,
249
+ debug: settings.debug,
250
+ verbose: settings.verbose,
251
+ silent: settings.silent,
252
+ duration: settings.duration,
253
+ skipInlineHidden: true,
254
+ })
255
+ ;
256
+ } else {
257
+ $activeContent
258
+ .children()
259
+ .stop(true, true)
260
+ .animate({
261
+ opacity: 0,
262
+ }, settings.duration, module.resetOpacity);
263
+ }
264
+ }
265
+ $activeContent
266
+ .slideUp(settings.duration, settings.easing, function () {
267
+ $activeContent
268
+ .removeClass(className.animating)
269
+ .removeClass(className.active)
270
+ ;
271
+ module.reset.display.call(this);
272
+ settings.onClose.call(this);
273
+ settings.onChange.call(this);
274
+ })
275
+ ;
276
+ }
277
+ },
278
+
279
+ closeOthers: function (index) {
280
+ var
281
+ $activeTitle = index !== undefined
282
+ ? $title.eq(index)
283
+ : $(this).closest(selector.title),
284
+ $parentTitles = $activeTitle.parents(selector.content).prev(selector.title),
285
+ $activeAccordion = $activeTitle.closest(selector.accordion),
286
+ activeSelector = selector.title + '.' + className.active + ':visible',
287
+ activeContent = selector.content + '.' + className.active + ':visible',
288
+ $openTitles,
289
+ $nestedTitles,
290
+ $openContents
291
+ ;
292
+ if (settings.closeNested) {
293
+ $openTitles = $activeAccordion.find(activeSelector).not($parentTitles);
294
+ $openContents = $openTitles.next($content);
295
+ } else {
296
+ $openTitles = $activeAccordion.find(activeSelector).not($parentTitles);
297
+ $nestedTitles = $activeAccordion.find(activeContent).find(activeSelector).not($parentTitles);
298
+ $openTitles = $openTitles.not($nestedTitles);
299
+ $openContents = $openTitles.next($content);
300
+ }
301
+ if ($openTitles.length > 0) {
302
+ module.debug('Exclusive enabled, closing other content', $openTitles);
303
+ $openTitles
304
+ .removeClass(className.active)
305
+ ;
306
+ $openContents
307
+ .removeClass(className.animating)
308
+ .stop(true, true)
309
+ ;
310
+ if (settings.animateChildren) {
311
+ if ($.fn.transition !== undefined) {
312
+ $openContents
313
+ .children()
314
+ .transition({
315
+ animation: 'fade out',
316
+ useFailSafe: true,
317
+ debug: settings.debug,
318
+ verbose: settings.verbose,
319
+ silent: settings.silent,
320
+ duration: settings.duration,
321
+ skipInlineHidden: true,
322
+ })
323
+ ;
324
+ } else {
325
+ $openContents
326
+ .children()
327
+ .stop(true, true)
328
+ .animate({
329
+ opacity: 0,
330
+ }, settings.duration, module.resetOpacity);
331
+ }
332
+ }
333
+ $openContents
334
+ .slideUp(settings.duration, settings.easing, function () {
335
+ $(this).removeClass(className.active);
336
+ module.reset.display.call(this);
337
+ })
338
+ ;
339
+ }
340
+ },
341
+
342
+ reset: {
343
+
344
+ display: function () {
345
+ module.verbose('Removing inline display from element', this);
346
+ var $element = $(this);
347
+ $element.css('display', '');
348
+ if ($element.attr('style') === '') {
349
+ $element
350
+ .attr('style', '')
351
+ .removeAttr('style')
352
+ ;
353
+ }
354
+ },
355
+
356
+ opacity: function () {
357
+ module.verbose('Removing inline opacity from element', this);
358
+ var $element = $(this);
359
+ $element.css('opacity', '');
360
+ if ($element.attr('style') === '') {
361
+ $element
362
+ .attr('style', '')
363
+ .removeAttr('style')
364
+ ;
365
+ }
366
+ },
367
+
368
+ },
369
+
370
+ setting: function (name, value) {
371
+ module.debug('Changing setting', name, value);
372
+ if ($.isPlainObject(name)) {
373
+ $.extend(true, settings, name);
374
+ } else if (value !== undefined) {
375
+ if ($.isPlainObject(settings[name])) {
376
+ $.extend(true, settings[name], value);
377
+ } else {
378
+ settings[name] = value;
379
+ }
380
+ } else {
381
+ return settings[name];
382
+ }
383
+ },
384
+ internal: function (name, value) {
385
+ module.debug('Changing internal', name, value);
386
+ if (value !== undefined) {
387
+ if ($.isPlainObject(name)) {
388
+ $.extend(true, module, name);
389
+ } else {
390
+ module[name] = value;
391
+ }
392
+ } else {
393
+ return module[name];
394
+ }
395
+ },
396
+ debug: function () {
397
+ if (!settings.silent && settings.debug) {
398
+ if (settings.performance) {
399
+ module.performance.log(arguments);
400
+ } else {
401
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
402
+ module.debug.apply(console, arguments);
403
+ }
404
+ }
405
+ },
406
+ verbose: function () {
407
+ if (!settings.silent && settings.verbose && settings.debug) {
408
+ if (settings.performance) {
409
+ module.performance.log(arguments);
410
+ } else {
411
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
412
+ module.verbose.apply(console, arguments);
413
+ }
414
+ }
415
+ },
416
+ error: function () {
417
+ if (!settings.silent) {
418
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
419
+ module.error.apply(console, arguments);
420
+ }
421
+ },
422
+ performance: {
423
+ log: function (message) {
424
+ var
425
+ currentTime,
426
+ executionTime,
427
+ previousTime
428
+ ;
429
+ if (settings.performance) {
430
+ currentTime = Date.now();
431
+ previousTime = time || currentTime;
432
+ executionTime = currentTime - previousTime;
433
+ time = currentTime;
434
+ performance.push({
435
+ Name: message[0],
436
+ Arguments: [].slice.call(message, 1) || '',
437
+ Element: element,
438
+ 'Execution Time': executionTime,
439
+ });
440
+ }
441
+ clearTimeout(module.performance.timer);
442
+ module.performance.timer = setTimeout(module.performance.display, 500);
443
+ },
444
+ display: function () {
445
+ var
446
+ title = settings.name + ':',
447
+ totalTime = 0
448
+ ;
449
+ time = false;
450
+ clearTimeout(module.performance.timer);
451
+ $.each(performance, function (index, data) {
452
+ totalTime += data['Execution Time'];
453
+ });
454
+ title += ' ' + totalTime + 'ms';
455
+ if (moduleSelector) {
456
+ title += ' \'' + moduleSelector + '\'';
457
+ }
458
+ if (performance.length > 0) {
459
+ console.groupCollapsed(title);
460
+ if (console.table) {
461
+ console.table(performance);
462
+ } else {
463
+ $.each(performance, function (index, data) {
464
+ console.log(data.Name + ': ' + data['Execution Time'] + 'ms');
465
+ });
466
+ }
467
+ console.groupEnd();
468
+ }
469
+ performance = [];
470
+ },
471
+ },
472
+ invoke: function (query, passedArguments, context) {
473
+ var
474
+ object = instance,
475
+ maxDepth,
476
+ found,
477
+ response
478
+ ;
479
+ passedArguments = passedArguments || queryArguments;
480
+ context = context || element;
481
+ if (typeof query === 'string' && object !== undefined) {
482
+ query = query.split(/[ .]/);
483
+ maxDepth = query.length - 1;
484
+ $.each(query, function (depth, value) {
485
+ var camelCaseValue = depth !== maxDepth
486
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
487
+ : query;
488
+ if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
489
+ object = object[camelCaseValue];
490
+ } else if (object[camelCaseValue] !== undefined) {
491
+ found = object[camelCaseValue];
492
+
493
+ return false;
494
+ } else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
495
+ object = object[value];
496
+ } else if (object[value] !== undefined) {
497
+ found = object[value];
498
+
499
+ return false;
500
+ } else {
501
+ module.error(error.method, query);
502
+
503
+ return false;
504
+ }
505
+ });
506
+ }
507
+ if (isFunction(found)) {
508
+ response = found.apply(context, passedArguments);
509
+ } else if (found !== undefined) {
510
+ response = found;
511
+ }
512
+ if (Array.isArray(returnedValue)) {
513
+ returnedValue.push(response);
514
+ } else if (returnedValue !== undefined) {
515
+ returnedValue = [returnedValue, response];
516
+ } else if (response !== undefined) {
517
+ returnedValue = response;
195
518
  }
196
- })
197
- ;
198
- }
199
- else {
200
- $activeContent
201
- .children()
202
- .stop(true, true)
203
- .animate({
204
- opacity: 1
205
- }, settings.duration, module.resetOpacity)
206
- ;
207
- }
208
- }
209
- $activeContent
210
- .slideDown(settings.duration, settings.easing, function() {
211
- $activeContent
212
- .removeClass(className.animating)
213
- .addClass(className.active)
214
- ;
215
- module.reset.display.call(this);
216
- settings.onOpen.call(this);
217
- settings.onChange.call(this);
218
- })
219
- ;
220
- },
221
519
 
222
- close: function(query) {
223
- var
224
- $activeTitle = (query !== undefined)
225
- ? (typeof query === 'number')
226
- ? $title.eq(query)
227
- : $(query).closest(selector.title)
228
- : $(this).closest(selector.title),
229
- $activeContent = $activeTitle.next($content),
230
- isAnimating = $activeContent.hasClass(className.animating),
231
- isActive = $activeContent.hasClass(className.active),
232
- isOpening = (!isActive && isAnimating),
233
- isClosing = (isActive && isAnimating)
234
- ;
235
- if((isActive || isOpening) && !isClosing) {
236
- module.debug('Closing accordion content', $activeContent);
237
- settings.onClosing.call($activeContent);
238
- settings.onChanging.call($activeContent);
239
- $activeTitle
240
- .removeClass(className.active)
241
- ;
242
- $activeContent
243
- .stop(true, true)
244
- .addClass(className.animating)
245
- ;
246
- if(settings.animateChildren) {
247
- if($.fn.transition !== undefined && $module.transition('is supported')) {
248
- $activeContent
249
- .children()
250
- .transition({
251
- animation : 'fade out',
252
- queue : false,
253
- useFailSafe : true,
254
- debug : settings.debug,
255
- verbose : settings.verbose,
256
- duration : settings.duration,
257
- skipInlineHidden : true
258
- })
259
- ;
260
- }
261
- else {
262
- $activeContent
263
- .children()
264
- .stop(true, true)
265
- .animate({
266
- opacity: 0
267
- }, settings.duration, module.resetOpacity)
268
- ;
269
- }
520
+ return found;
521
+ },
522
+ };
523
+ if (methodInvoked) {
524
+ if (instance === undefined) {
525
+ module.initialize();
526
+ }
527
+ module.invoke(query);
528
+ } else {
529
+ if (instance !== undefined) {
530
+ instance.invoke('destroy');
531
+ }
532
+ module.initialize();
270
533
  }
271
- $activeContent
272
- .slideUp(settings.duration, settings.easing, function() {
273
- $activeContent
274
- .removeClass(className.animating)
275
- .removeClass(className.active)
276
- ;
277
- module.reset.display.call(this);
278
- settings.onClose.call(this);
279
- settings.onChange.call(this);
280
- })
281
- ;
282
- }
283
- },
534
+ });
284
535
 
285
- closeOthers: function(index) {
286
- var
287
- $activeTitle = (index !== undefined)
288
- ? $title.eq(index)
289
- : $(this).closest(selector.title),
290
- $parentTitles = $activeTitle.parents(selector.content).prev(selector.title),
291
- $activeAccordion = $activeTitle.closest(selector.accordion),
292
- activeSelector = selector.title + '.' + className.active + ':visible',
293
- activeContent = selector.content + '.' + className.active + ':visible',
294
- $openTitles,
295
- $nestedTitles,
296
- $openContents
297
- ;
298
- if(settings.closeNested) {
299
- $openTitles = $activeAccordion.find(activeSelector).not($parentTitles);
300
- $openContents = $openTitles.next($content);
301
- }
302
- else {
303
- $openTitles = $activeAccordion.find(activeSelector).not($parentTitles);
304
- $nestedTitles = $activeAccordion.find(activeContent).find(activeSelector).not($parentTitles);
305
- $openTitles = $openTitles.not($nestedTitles);
306
- $openContents = $openTitles.next($content);
307
- }
308
- if( ($openTitles.length > 0) ) {
309
- module.debug('Exclusive enabled, closing other content', $openTitles);
310
- $openTitles
311
- .removeClass(className.active)
312
- ;
313
- $openContents
314
- .removeClass(className.animating)
315
- .stop(true, true)
316
- ;
317
- if(settings.animateChildren) {
318
- if($.fn.transition !== undefined && $module.transition('is supported')) {
319
- $openContents
320
- .children()
321
- .transition({
322
- animation : 'fade out',
323
- useFailSafe : true,
324
- debug : settings.debug,
325
- verbose : settings.verbose,
326
- duration : settings.duration,
327
- skipInlineHidden : true
328
- })
329
- ;
330
- }
331
- else {
332
- $openContents
333
- .children()
334
- .stop(true, true)
335
- .animate({
336
- opacity: 0
337
- }, settings.duration, module.resetOpacity)
338
- ;
339
- }
340
- }
341
- $openContents
342
- .slideUp(settings.duration , settings.easing, function() {
343
- $(this).removeClass(className.active);
344
- module.reset.display.call(this);
345
- })
346
- ;
347
- }
348
- },
536
+ return returnedValue !== undefined
537
+ ? returnedValue
538
+ : this;
539
+ };
349
540
 
350
- reset: {
541
+ $.fn.accordion.settings = {
351
542
 
352
- display: function() {
353
- module.verbose('Removing inline display from element', this);
354
- $(this).css('display', '');
355
- if( $(this).attr('style') === '') {
356
- $(this)
357
- .attr('style', '')
358
- .removeAttr('style')
359
- ;
360
- }
361
- },
362
-
363
- opacity: function() {
364
- module.verbose('Removing inline opacity from element', this);
365
- $(this).css('opacity', '');
366
- if( $(this).attr('style') === '') {
367
- $(this)
368
- .attr('style', '')
369
- .removeAttr('style')
370
- ;
371
- }
372
- },
543
+ name: 'Accordion',
544
+ namespace: 'accordion',
373
545
 
374
- },
546
+ silent: false,
547
+ debug: false,
548
+ verbose: false,
549
+ performance: true,
375
550
 
376
- setting: function(name, value) {
377
- module.debug('Changing setting', name, value);
378
- if( $.isPlainObject(name) ) {
379
- $.extend(true, settings, name);
380
- }
381
- else if(value !== undefined) {
382
- if($.isPlainObject(settings[name])) {
383
- $.extend(true, settings[name], value);
384
- }
385
- else {
386
- settings[name] = value;
387
- }
388
- }
389
- else {
390
- return settings[name];
391
- }
392
- },
393
- internal: function(name, value) {
394
- module.debug('Changing internal', name, value);
395
- if(value !== undefined) {
396
- if( $.isPlainObject(name) ) {
397
- $.extend(true, module, name);
398
- }
399
- else {
400
- module[name] = value;
401
- }
402
- }
403
- else {
404
- return module[name];
405
- }
406
- },
407
- debug: function() {
408
- if(!settings.silent && settings.debug) {
409
- if(settings.performance) {
410
- module.performance.log(arguments);
411
- }
412
- else {
413
- module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
414
- module.debug.apply(console, arguments);
415
- }
416
- }
417
- },
418
- verbose: function() {
419
- if(!settings.silent && settings.verbose && settings.debug) {
420
- if(settings.performance) {
421
- module.performance.log(arguments);
422
- }
423
- else {
424
- module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
425
- module.verbose.apply(console, arguments);
426
- }
427
- }
551
+ on: 'click', // event on title that opens accordion
552
+
553
+ observeChanges: true, // whether accordion should automatically refresh on DOM insertion
554
+
555
+ exclusive: true, // whether a single accordion content panel should be open at once
556
+ collapsible: true, // whether accordion content can be closed
557
+ closeNested: false, // whether nested content should be closed when a panel is closed
558
+ animateChildren: true, // whether children opacity should be animated
559
+
560
+ duration: 350, // duration of animation
561
+ easing: 'easeOutQuad', // easing equation for animation
562
+
563
+ onOpening: function () {}, // callback before open animation
564
+ onClosing: function () {}, // callback before closing animation
565
+ onChanging: function () {}, // callback before closing or opening animation
566
+
567
+ onOpen: function () {}, // callback after open animation
568
+ onClose: function () {}, // callback after closing animation
569
+ onChange: function () {}, // callback after closing or opening animation
570
+
571
+ error: {
572
+ method: 'The method you called is not defined',
428
573
  },
429
- error: function() {
430
- if(!settings.silent) {
431
- module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
432
- module.error.apply(console, arguments);
433
- }
574
+
575
+ className: {
576
+ active: 'active',
577
+ animating: 'animating',
578
+ transition: 'transition',
434
579
  },
435
- performance: {
436
- log: function(message) {
437
- var
438
- currentTime,
439
- executionTime,
440
- previousTime
441
- ;
442
- if(settings.performance) {
443
- currentTime = new Date().getTime();
444
- previousTime = time || currentTime;
445
- executionTime = currentTime - previousTime;
446
- time = currentTime;
447
- performance.push({
448
- 'Name' : message[0],
449
- 'Arguments' : [].slice.call(message, 1) || '',
450
- 'Element' : element,
451
- 'Execution Time' : executionTime
452
- });
453
- }
454
- clearTimeout(module.performance.timer);
455
- module.performance.timer = setTimeout(module.performance.display, 500);
456
- },
457
- display: function() {
458
- var
459
- title = settings.name + ':',
460
- totalTime = 0
461
- ;
462
- time = false;
463
- clearTimeout(module.performance.timer);
464
- $.each(performance, function(index, data) {
465
- totalTime += data['Execution Time'];
466
- });
467
- title += ' ' + totalTime + 'ms';
468
- if(moduleSelector) {
469
- title += ' \'' + moduleSelector + '\'';
470
- }
471
- if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
472
- console.groupCollapsed(title);
473
- if(console.table) {
474
- console.table(performance);
475
- }
476
- else {
477
- $.each(performance, function(index, data) {
478
- console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
479
- });
480
- }
481
- console.groupEnd();
482
- }
483
- performance = [];
484
- }
580
+
581
+ selector: {
582
+ accordion: '.accordion',
583
+ title: '.title',
584
+ trigger: '.title',
585
+ ignore: '.ui.dropdown',
586
+ content: '.content',
485
587
  },
486
- invoke: function(query, passedArguments, context) {
487
- var
488
- object = instance,
489
- maxDepth,
490
- found,
491
- response
492
- ;
493
- passedArguments = passedArguments || queryArguments;
494
- context = element || context;
495
- if(typeof query == 'string' && object !== undefined) {
496
- query = query.split(/[\. ]/);
497
- maxDepth = query.length - 1;
498
- $.each(query, function(depth, value) {
499
- var camelCaseValue = (depth != maxDepth)
500
- ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
501
- : query
502
- ;
503
- if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
504
- object = object[camelCaseValue];
505
- }
506
- else if( object[camelCaseValue] !== undefined ) {
507
- found = object[camelCaseValue];
508
- return false;
509
- }
510
- else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
511
- object = object[value];
512
- }
513
- else if( object[value] !== undefined ) {
514
- found = object[value];
515
- return false;
516
- }
517
- else {
518
- module.error(error.method, query);
519
- return false;
520
- }
521
- });
522
- }
523
- if ( $.isFunction( found ) ) {
524
- response = found.apply(context, passedArguments);
525
- }
526
- else if(found !== undefined) {
527
- response = found;
528
- }
529
- if(Array.isArray(returnedValue)) {
530
- returnedValue.push(response);
531
- }
532
- else if(returnedValue !== undefined) {
533
- returnedValue = [returnedValue, response];
534
- }
535
- else if(response !== undefined) {
536
- returnedValue = response;
537
- }
538
- return found;
539
- }
540
- };
541
- if(methodInvoked) {
542
- if(instance === undefined) {
543
- module.initialize();
544
- }
545
- module.invoke(query);
546
- }
547
- else {
548
- if(instance !== undefined) {
549
- instance.invoke('destroy');
550
- }
551
- module.initialize();
552
- }
553
- })
554
- ;
555
- return (returnedValue !== undefined)
556
- ? returnedValue
557
- : this
558
- ;
559
- };
560
-
561
- $.fn.accordion.settings = {
562
-
563
- name : 'Accordion',
564
- namespace : 'accordion',
565
-
566
- silent : false,
567
- debug : false,
568
- verbose : false,
569
- performance : true,
570
-
571
- on : 'click', // event on title that opens accordion
572
-
573
- observeChanges : true, // whether accordion should automatically refresh on DOM insertion
574
-
575
- exclusive : true, // whether a single accordion content panel should be open at once
576
- collapsible : true, // whether accordion content can be closed
577
- closeNested : false, // whether nested content should be closed when a panel is closed
578
- animateChildren : true, // whether children opacity should be animated
579
-
580
- duration : 350, // duration of animation
581
- easing : 'easeOutQuad', // easing equation for animation
582
-
583
- onOpening : function(){}, // callback before open animation
584
- onClosing : function(){}, // callback before closing animation
585
- onChanging : function(){}, // callback before closing or opening animation
586
-
587
- onOpen : function(){}, // callback after open animation
588
- onClose : function(){}, // callback after closing animation
589
- onChange : function(){}, // callback after closing or opening animation
590
-
591
- error: {
592
- method : 'The method you called is not defined'
593
- },
594
-
595
- className : {
596
- active : 'active',
597
- animating : 'animating',
598
- transition: 'transition'
599
- },
600
-
601
- selector : {
602
- accordion : '.accordion',
603
- title : '.title',
604
- trigger : '.title',
605
- content : '.content'
606
- }
607
-
608
- };
609
-
610
- // Adds easing
611
- $.extend( $.easing, {
612
- easeOutQuad: function (x, t, b, c, d) {
613
- return -c *(t/=d)*(t-2) + b;
614
- }
615
- });
616
-
617
- })( jQuery, window, document );
618
588
 
589
+ };
590
+
591
+ // Adds easing
592
+ $.extend($.easing, {
593
+ easeOutQuad: function (x) {
594
+ return 1 - (1 - x) * (1 - x);
595
+ },
596
+ });
597
+ })(jQuery, window, document);