fomantic-ui-sass 2.9.0 → 2.9.1

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 (103) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/fonts/semantic-ui/Lato-Bold.woff +0 -0
  3. data/app/assets/fonts/semantic-ui/Lato-Bold.woff2 +0 -0
  4. data/app/assets/fonts/semantic-ui/Lato-BoldItalic.woff +0 -0
  5. data/app/assets/fonts/semantic-ui/Lato-BoldItalic.woff2 +0 -0
  6. data/app/assets/fonts/semantic-ui/Lato-Italic.woff +0 -0
  7. data/app/assets/fonts/semantic-ui/Lato-Italic.woff2 +0 -0
  8. data/app/assets/fonts/semantic-ui/Lato-Regular.woff +0 -0
  9. data/app/assets/fonts/semantic-ui/Lato-Regular.woff2 +0 -0
  10. data/app/assets/fonts/semantic-ui/LatoLatin-Bold.woff +0 -0
  11. data/app/assets/fonts/semantic-ui/LatoLatin-Bold.woff2 +0 -0
  12. data/app/assets/fonts/semantic-ui/LatoLatin-BoldItalic.woff +0 -0
  13. data/app/assets/fonts/semantic-ui/LatoLatin-BoldItalic.woff2 +0 -0
  14. data/app/assets/fonts/semantic-ui/LatoLatin-Italic.woff +0 -0
  15. data/app/assets/fonts/semantic-ui/LatoLatin-Italic.woff2 +0 -0
  16. data/app/assets/fonts/semantic-ui/LatoLatin-Regular.woff +0 -0
  17. data/app/assets/fonts/semantic-ui/LatoLatin-Regular.woff2 +0 -0
  18. data/app/assets/fonts/semantic-ui/brand-icons.woff +0 -0
  19. data/app/assets/fonts/semantic-ui/brand-icons.woff2 +0 -0
  20. data/app/assets/fonts/semantic-ui/icons.woff +0 -0
  21. data/app/assets/fonts/semantic-ui/icons.woff2 +0 -0
  22. data/app/assets/fonts/semantic-ui/outline-icons.woff +0 -0
  23. data/app/assets/fonts/semantic-ui/outline-icons.woff2 +0 -0
  24. data/app/assets/javascripts/semantic-ui/accordion.js +569 -596
  25. data/app/assets/javascripts/semantic-ui/api.js +1158 -1180
  26. data/app/assets/javascripts/semantic-ui/calendar.js +1935 -1810
  27. data/app/assets/javascripts/semantic-ui/checkbox.js +843 -842
  28. data/app/assets/javascripts/semantic-ui/dimmer.js +707 -738
  29. data/app/assets/javascripts/semantic-ui/dropdown.js +4196 -4237
  30. data/app/assets/javascripts/semantic-ui/embed.js +646 -676
  31. data/app/assets/javascripts/semantic-ui/flyout.js +1515 -1466
  32. data/app/assets/javascripts/semantic-ui/form.js +2023 -2005
  33. data/app/assets/javascripts/semantic-ui/modal.js +1545 -1487
  34. data/app/assets/javascripts/semantic-ui/nag.js +521 -527
  35. data/app/assets/javascripts/semantic-ui/popup.js +1457 -1457
  36. data/app/assets/javascripts/semantic-ui/progress.js +970 -998
  37. data/app/assets/javascripts/semantic-ui/rating.js +508 -524
  38. data/app/assets/javascripts/semantic-ui/search.js +1521 -1535
  39. data/app/assets/javascripts/semantic-ui/shape.js +784 -811
  40. data/app/assets/javascripts/semantic-ui/sidebar.js +1062 -1100
  41. data/app/assets/javascripts/semantic-ui/site.js +437 -477
  42. data/app/assets/javascripts/semantic-ui/slider.js +1311 -1312
  43. data/app/assets/javascripts/semantic-ui/state.js +639 -658
  44. data/app/assets/javascripts/semantic-ui/sticky.js +848 -902
  45. data/app/assets/javascripts/semantic-ui/tab.js +903 -967
  46. data/app/assets/javascripts/semantic-ui/toast.js +911 -885
  47. data/app/assets/javascripts/semantic-ui/transition.js +1049 -1078
  48. data/app/assets/javascripts/semantic-ui/visibility.js +1214 -1246
  49. data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +7 -7
  50. data/app/assets/stylesheets/semantic-ui/collections/_form.scss +246 -341
  51. data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +185 -331
  52. data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +272 -433
  53. data/app/assets/stylesheets/semantic-ui/collections/_message.scss +127 -199
  54. data/app/assets/stylesheets/semantic-ui/collections/_table.scss +549 -776
  55. data/app/assets/stylesheets/semantic-ui/elements/_button.scss +711 -1123
  56. data/app/assets/stylesheets/semantic-ui/elements/_container.scss +9 -8
  57. data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +45 -63
  58. data/app/assets/stylesheets/semantic-ui/elements/_emoji.scss +3556 -3556
  59. data/app/assets/stylesheets/semantic-ui/elements/_flag.scss +272 -270
  60. data/app/assets/stylesheets/semantic-ui/elements/_header.scss +120 -144
  61. data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +667 -747
  62. data/app/assets/stylesheets/semantic-ui/elements/_image.scss +41 -65
  63. data/app/assets/stylesheets/semantic-ui/elements/_input.scss +358 -276
  64. data/app/assets/stylesheets/semantic-ui/elements/_label.scss +361 -412
  65. data/app/assets/stylesheets/semantic-ui/elements/_list.scss +51 -72
  66. data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +69 -157
  67. data/app/assets/stylesheets/semantic-ui/elements/_placeholder.scss +24 -44
  68. data/app/assets/stylesheets/semantic-ui/elements/_rail.scss +17 -22
  69. data/app/assets/stylesheets/semantic-ui/elements/_reveal.scss +46 -85
  70. data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +150 -226
  71. data/app/assets/stylesheets/semantic-ui/elements/_step.scss +79 -152
  72. data/app/assets/stylesheets/semantic-ui/elements/_text.scss +33 -33
  73. data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +10 -15
  74. data/app/assets/stylesheets/semantic-ui/globals/_site.scss +30 -43
  75. data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +37 -55
  76. data/app/assets/stylesheets/semantic-ui/modules/_calendar.scss +26 -29
  77. data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +122 -193
  78. data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +55 -174
  79. data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +254 -388
  80. data/app/assets/stylesheets/semantic-ui/modules/_embed.scss +20 -31
  81. data/app/assets/stylesheets/semantic-ui/modules/_flyout.scss +97 -143
  82. data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +122 -156
  83. data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +55 -65
  84. data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +426 -204
  85. data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +108 -213
  86. data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +83 -124
  87. data/app/assets/stylesheets/semantic-ui/modules/_search.scss +71 -100
  88. data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +16 -32
  89. data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +105 -208
  90. data/app/assets/stylesheets/semantic-ui/modules/_slider.scss +93 -121
  91. data/app/assets/stylesheets/semantic-ui/modules/_sticky.scss +3 -7
  92. data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +12 -16
  93. data/app/assets/stylesheets/semantic-ui/modules/_toast.scss +71 -149
  94. data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +371 -1282
  95. data/app/assets/stylesheets/semantic-ui/views/_ad.scss +36 -47
  96. data/app/assets/stylesheets/semantic-ui/views/_card.scss +221 -367
  97. data/app/assets/stylesheets/semantic-ui/views/_comment.scss +43 -61
  98. data/app/assets/stylesheets/semantic-ui/views/_feed.scss +37 -59
  99. data/app/assets/stylesheets/semantic-ui/views/_item.scss +86 -133
  100. data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +77 -118
  101. data/lib/fomantic/ui/sass/version.rb +2 -2
  102. data/tasks/converter.rb +1 -1
  103. metadata +17 -1
@@ -1,624 +1,597 @@
1
1
  /*!
2
2
  * # Fomantic-UI - Accordion
3
- * http://github.com/fomantic/Fomantic-UI/
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(event) {
121
- if($(event.target).closest(selector.ignore).length === 0) {
122
- module.toggle.call(this);
123
- }
124
- }
125
- },
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
+ ;
126
59
 
127
- toggle: function(query) {
128
- var
129
- $activeTitle = (query !== undefined)
130
- ? (typeof query === 'number')
131
- ? $title.eq(query)
132
- : $(query).closest(selector.title)
133
- : $(this).closest(selector.title),
134
- $activeContent = $activeTitle.next($content),
135
- isAnimating = $activeContent.hasClass(className.animating),
136
- isActive = $activeContent.hasClass(className.active),
137
- isOpen = (isActive && !isAnimating),
138
- isOpening = (!isActive && isAnimating)
139
- ;
140
- module.debug('Toggling visibility of content', $activeTitle);
141
- if(isOpen || isOpening) {
142
- if(settings.collapsible) {
143
- module.close.call($activeTitle);
144
- }
145
- else {
146
- module.debug('Cannot close accordion content collapsing is disabled');
147
- }
148
- }
149
- else {
150
- module.open.call($activeTitle);
151
- }
152
- },
60
+ module = {
153
61
 
154
- open: function(query) {
155
- var
156
- $activeTitle = (query !== undefined)
157
- ? (typeof query === 'number')
158
- ? $title.eq(query)
159
- : $(query).closest(selector.title)
160
- : $(this).closest(selector.title),
161
- $activeContent = $activeTitle.next($content),
162
- isAnimating = $activeContent.hasClass(className.animating),
163
- isActive = $activeContent.hasClass(className.active),
164
- isOpen = (isActive || isAnimating)
165
- ;
166
- if(isOpen) {
167
- module.debug('Accordion already open, skipping', $activeContent);
168
- return;
169
- }
170
- module.debug('Opening accordion content', $activeTitle);
171
- settings.onOpening.call($activeContent);
172
- settings.onChanging.call($activeContent);
173
- if(settings.exclusive) {
174
- module.closeOthers.call($activeTitle);
175
- }
176
- $activeTitle
177
- .addClass(className.active)
178
- ;
179
- $activeContent
180
- .stop(true, true)
181
- .addClass(className.animating)
182
- ;
183
- if(settings.animateChildren) {
184
- if($.fn.transition !== undefined && $module.transition('is supported')) {
185
- $activeContent
186
- .children()
187
- .transition({
188
- animation : 'fade in',
189
- queue : false,
190
- useFailSafe : true,
191
- debug : settings.debug,
192
- verbose : settings.verbose,
193
- silent : settings.silent,
194
- duration : settings.duration,
195
- skipInlineHidden : true,
196
- onComplete: function() {
197
- $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 && $module.transition('is supported')) {
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 && $module.transition('is supported')) {
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 && $module.transition('is supported')) {
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;
198
518
  }
199
- })
200
- ;
201
- }
202
- else {
203
- $activeContent
204
- .children()
205
- .stop(true, true)
206
- .animate({
207
- opacity: 1
208
- }, settings.duration, module.resetOpacity)
209
- ;
210
- }
211
- }
212
- $activeContent
213
- .slideDown(settings.duration, settings.easing, function() {
214
- $activeContent
215
- .removeClass(className.animating)
216
- .addClass(className.active)
217
- ;
218
- module.reset.display.call(this);
219
- settings.onOpen.call(this);
220
- settings.onChange.call(this);
221
- })
222
- ;
223
- },
224
519
 
225
- close: function(query) {
226
- var
227
- $activeTitle = (query !== undefined)
228
- ? (typeof query === 'number')
229
- ? $title.eq(query)
230
- : $(query).closest(selector.title)
231
- : $(this).closest(selector.title),
232
- $activeContent = $activeTitle.next($content),
233
- isAnimating = $activeContent.hasClass(className.animating),
234
- isActive = $activeContent.hasClass(className.active),
235
- isOpening = (!isActive && isAnimating),
236
- isClosing = (isActive && isAnimating)
237
- ;
238
- if((isActive || isOpening) && !isClosing) {
239
- module.debug('Closing accordion content', $activeContent);
240
- settings.onClosing.call($activeContent);
241
- settings.onChanging.call($activeContent);
242
- $activeTitle
243
- .removeClass(className.active)
244
- ;
245
- $activeContent
246
- .stop(true, true)
247
- .addClass(className.animating)
248
- ;
249
- if(settings.animateChildren) {
250
- if($.fn.transition !== undefined && $module.transition('is supported')) {
251
- $activeContent
252
- .children()
253
- .transition({
254
- animation : 'fade out',
255
- queue : false,
256
- useFailSafe : true,
257
- debug : settings.debug,
258
- verbose : settings.verbose,
259
- silent : settings.silent,
260
- duration : settings.duration,
261
- skipInlineHidden : true
262
- })
263
- ;
264
- }
265
- else {
266
- $activeContent
267
- .children()
268
- .stop(true, true)
269
- .animate({
270
- opacity: 0
271
- }, settings.duration, module.resetOpacity)
272
- ;
273
- }
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();
274
533
  }
275
- $activeContent
276
- .slideUp(settings.duration, settings.easing, function() {
277
- $activeContent
278
- .removeClass(className.animating)
279
- .removeClass(className.active)
280
- ;
281
- module.reset.display.call(this);
282
- settings.onClose.call(this);
283
- settings.onChange.call(this);
284
- })
285
- ;
286
- }
287
- },
534
+ });
288
535
 
289
- closeOthers: function(index) {
290
- var
291
- $activeTitle = (index !== undefined)
292
- ? $title.eq(index)
293
- : $(this).closest(selector.title),
294
- $parentTitles = $activeTitle.parents(selector.content).prev(selector.title),
295
- $activeAccordion = $activeTitle.closest(selector.accordion),
296
- activeSelector = selector.title + '.' + className.active + ':visible',
297
- activeContent = selector.content + '.' + className.active + ':visible',
298
- $openTitles,
299
- $nestedTitles,
300
- $openContents
301
- ;
302
- if(settings.closeNested) {
303
- $openTitles = $activeAccordion.find(activeSelector).not($parentTitles);
304
- $openContents = $openTitles.next($content);
305
- }
306
- else {
307
- $openTitles = $activeAccordion.find(activeSelector).not($parentTitles);
308
- $nestedTitles = $activeAccordion.find(activeContent).find(activeSelector).not($parentTitles);
309
- $openTitles = $openTitles.not($nestedTitles);
310
- $openContents = $openTitles.next($content);
311
- }
312
- if( ($openTitles.length > 0) ) {
313
- module.debug('Exclusive enabled, closing other content', $openTitles);
314
- $openTitles
315
- .removeClass(className.active)
316
- ;
317
- $openContents
318
- .removeClass(className.animating)
319
- .stop(true, true)
320
- ;
321
- if(settings.animateChildren) {
322
- if($.fn.transition !== undefined && $module.transition('is supported')) {
323
- $openContents
324
- .children()
325
- .transition({
326
- animation : 'fade out',
327
- useFailSafe : true,
328
- debug : settings.debug,
329
- verbose : settings.verbose,
330
- silent : settings.silent,
331
- duration : settings.duration,
332
- skipInlineHidden : true
333
- })
334
- ;
335
- }
336
- else {
337
- $openContents
338
- .children()
339
- .stop(true, true)
340
- .animate({
341
- opacity: 0
342
- }, settings.duration, module.resetOpacity)
343
- ;
344
- }
345
- }
346
- $openContents
347
- .slideUp(settings.duration , settings.easing, function() {
348
- $(this).removeClass(className.active);
349
- module.reset.display.call(this);
350
- })
351
- ;
352
- }
353
- },
536
+ return returnedValue !== undefined
537
+ ? returnedValue
538
+ : this;
539
+ };
354
540
 
355
- reset: {
541
+ $.fn.accordion.settings = {
356
542
 
357
- display: function() {
358
- module.verbose('Removing inline display from element', this);
359
- $(this).css('display', '');
360
- if( $(this).attr('style') === '') {
361
- $(this)
362
- .attr('style', '')
363
- .removeAttr('style')
364
- ;
365
- }
366
- },
367
-
368
- opacity: function() {
369
- module.verbose('Removing inline opacity from element', this);
370
- $(this).css('opacity', '');
371
- if( $(this).attr('style') === '') {
372
- $(this)
373
- .attr('style', '')
374
- .removeAttr('style')
375
- ;
376
- }
377
- },
543
+ name: 'Accordion',
544
+ namespace: 'accordion',
378
545
 
379
- },
546
+ silent: false,
547
+ debug: false,
548
+ verbose: false,
549
+ performance: true,
380
550
 
381
- setting: function(name, value) {
382
- module.debug('Changing setting', name, value);
383
- if( $.isPlainObject(name) ) {
384
- $.extend(true, settings, name);
385
- }
386
- else if(value !== undefined) {
387
- if($.isPlainObject(settings[name])) {
388
- $.extend(true, settings[name], value);
389
- }
390
- else {
391
- settings[name] = value;
392
- }
393
- }
394
- else {
395
- return settings[name];
396
- }
397
- },
398
- internal: function(name, value) {
399
- module.debug('Changing internal', name, value);
400
- if(value !== undefined) {
401
- if( $.isPlainObject(name) ) {
402
- $.extend(true, module, name);
403
- }
404
- else {
405
- module[name] = value;
406
- }
407
- }
408
- else {
409
- return module[name];
410
- }
411
- },
412
- debug: function() {
413
- if(!settings.silent && settings.debug) {
414
- if(settings.performance) {
415
- module.performance.log(arguments);
416
- }
417
- else {
418
- module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
419
- module.debug.apply(console, arguments);
420
- }
421
- }
422
- },
423
- verbose: function() {
424
- if(!settings.silent && settings.verbose && settings.debug) {
425
- if(settings.performance) {
426
- module.performance.log(arguments);
427
- }
428
- else {
429
- module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
430
- module.verbose.apply(console, arguments);
431
- }
432
- }
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',
433
573
  },
434
- error: function() {
435
- if(!settings.silent) {
436
- module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
437
- module.error.apply(console, arguments);
438
- }
574
+
575
+ className: {
576
+ active: 'active',
577
+ animating: 'animating',
578
+ transition: 'transition',
439
579
  },
440
- performance: {
441
- log: function(message) {
442
- var
443
- currentTime,
444
- executionTime,
445
- previousTime
446
- ;
447
- if(settings.performance) {
448
- currentTime = new Date().getTime();
449
- previousTime = time || currentTime;
450
- executionTime = currentTime - previousTime;
451
- time = currentTime;
452
- performance.push({
453
- 'Name' : message[0],
454
- 'Arguments' : [].slice.call(message, 1) || '',
455
- 'Element' : element,
456
- 'Execution Time' : executionTime
457
- });
458
- }
459
- clearTimeout(module.performance.timer);
460
- module.performance.timer = setTimeout(module.performance.display, 500);
461
- },
462
- display: function() {
463
- var
464
- title = settings.name + ':',
465
- totalTime = 0
466
- ;
467
- time = false;
468
- clearTimeout(module.performance.timer);
469
- $.each(performance, function(index, data) {
470
- totalTime += data['Execution Time'];
471
- });
472
- title += ' ' + totalTime + 'ms';
473
- if(moduleSelector) {
474
- title += ' \'' + moduleSelector + '\'';
475
- }
476
- if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
477
- console.groupCollapsed(title);
478
- if(console.table) {
479
- console.table(performance);
480
- }
481
- else {
482
- $.each(performance, function(index, data) {
483
- console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
484
- });
485
- }
486
- console.groupEnd();
487
- }
488
- performance = [];
489
- }
580
+
581
+ selector: {
582
+ accordion: '.accordion',
583
+ title: '.title',
584
+ trigger: '.title',
585
+ ignore: '.ui.dropdown',
586
+ content: '.content',
490
587
  },
491
- invoke: function(query, passedArguments, context) {
492
- var
493
- object = instance,
494
- maxDepth,
495
- found,
496
- response
497
- ;
498
- passedArguments = passedArguments || queryArguments;
499
- context = context || element;
500
- if(typeof query == 'string' && object !== undefined) {
501
- query = query.split(/[\. ]/);
502
- maxDepth = query.length - 1;
503
- $.each(query, function(depth, value) {
504
- var camelCaseValue = (depth != maxDepth)
505
- ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
506
- : query
507
- ;
508
- if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
509
- object = object[camelCaseValue];
510
- }
511
- else if( object[camelCaseValue] !== undefined ) {
512
- found = object[camelCaseValue];
513
- return false;
514
- }
515
- else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
516
- object = object[value];
517
- }
518
- else if( object[value] !== undefined ) {
519
- found = object[value];
520
- return false;
521
- }
522
- else {
523
- module.error(error.method, query);
524
- return false;
525
- }
526
- });
527
- }
528
- if ( $.isFunction( found ) ) {
529
- response = found.apply(context, passedArguments);
530
- }
531
- else if(found !== undefined) {
532
- response = found;
533
- }
534
- if(Array.isArray(returnedValue)) {
535
- returnedValue.push(response);
536
- }
537
- else if(returnedValue !== undefined) {
538
- returnedValue = [returnedValue, response];
539
- }
540
- else if(response !== undefined) {
541
- returnedValue = response;
542
- }
543
- return found;
544
- }
545
- };
546
- if(methodInvoked) {
547
- if(instance === undefined) {
548
- module.initialize();
549
- }
550
- module.invoke(query);
551
- }
552
- else {
553
- if(instance !== undefined) {
554
- instance.invoke('destroy');
555
- }
556
- module.initialize();
557
- }
558
- })
559
- ;
560
- return (returnedValue !== undefined)
561
- ? returnedValue
562
- : this
563
- ;
564
- };
565
-
566
- $.fn.accordion.settings = {
567
-
568
- name : 'Accordion',
569
- namespace : 'accordion',
570
-
571
- silent : false,
572
- debug : false,
573
- verbose : false,
574
- performance : true,
575
-
576
- on : 'click', // event on title that opens accordion
577
-
578
- observeChanges : true, // whether accordion should automatically refresh on DOM insertion
579
-
580
- exclusive : true, // whether a single accordion content panel should be open at once
581
- collapsible : true, // whether accordion content can be closed
582
- closeNested : false, // whether nested content should be closed when a panel is closed
583
- animateChildren : true, // whether children opacity should be animated
584
-
585
- duration : 350, // duration of animation
586
- easing : 'easeOutQuad', // easing equation for animation
587
-
588
- onOpening : function(){}, // callback before open animation
589
- onClosing : function(){}, // callback before closing animation
590
- onChanging : function(){}, // callback before closing or opening animation
591
-
592
- onOpen : function(){}, // callback after open animation
593
- onClose : function(){}, // callback after closing animation
594
- onChange : function(){}, // callback after closing or opening animation
595
-
596
- error: {
597
- method : 'The method you called is not defined'
598
- },
599
-
600
- className : {
601
- active : 'active',
602
- animating : 'animating',
603
- transition: 'transition'
604
- },
605
-
606
- selector : {
607
- accordion : '.accordion',
608
- title : '.title',
609
- trigger : '.title',
610
- ignore : '.ui.dropdown',
611
- content : '.content'
612
- }
613
-
614
- };
615
-
616
- // Adds easing
617
- $.extend( $.easing, {
618
- easeOutQuad: function (x, t, b, c, d) {
619
- return -c *(t/=d)*(t-2) + b;
620
- }
621
- });
622
-
623
- })( jQuery, window, document );
624
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);