fomantic-ui-sass 2.8.8.1 → 2.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/app/assets/fonts/semantic-ui/Lato-Bold.woff +0 -0
  4. data/app/assets/fonts/semantic-ui/Lato-Bold.woff2 +0 -0
  5. data/app/assets/fonts/semantic-ui/Lato-BoldItalic.woff +0 -0
  6. data/app/assets/fonts/semantic-ui/Lato-BoldItalic.woff2 +0 -0
  7. data/app/assets/fonts/semantic-ui/Lato-Italic.woff +0 -0
  8. data/app/assets/fonts/semantic-ui/Lato-Italic.woff2 +0 -0
  9. data/app/assets/fonts/semantic-ui/Lato-Regular.woff +0 -0
  10. data/app/assets/fonts/semantic-ui/Lato-Regular.woff2 +0 -0
  11. data/app/assets/fonts/semantic-ui/LatoLatin-Bold.woff +0 -0
  12. data/app/assets/fonts/semantic-ui/LatoLatin-Bold.woff2 +0 -0
  13. data/app/assets/fonts/semantic-ui/LatoLatin-BoldItalic.woff +0 -0
  14. data/app/assets/fonts/semantic-ui/LatoLatin-BoldItalic.woff2 +0 -0
  15. data/app/assets/fonts/semantic-ui/LatoLatin-Italic.woff +0 -0
  16. data/app/assets/fonts/semantic-ui/LatoLatin-Italic.woff2 +0 -0
  17. data/app/assets/fonts/semantic-ui/LatoLatin-Regular.woff +0 -0
  18. data/app/assets/fonts/semantic-ui/LatoLatin-Regular.woff2 +0 -0
  19. data/app/assets/fonts/semantic-ui/brand-icons.eot +0 -0
  20. data/app/assets/fonts/semantic-ui/brand-icons.svg +41 -6
  21. data/app/assets/fonts/semantic-ui/brand-icons.ttf +0 -0
  22. data/app/assets/fonts/semantic-ui/brand-icons.woff +0 -0
  23. data/app/assets/fonts/semantic-ui/brand-icons.woff2 +0 -0
  24. data/app/assets/fonts/semantic-ui/icons.eot +0 -0
  25. data/app/assets/fonts/semantic-ui/icons.svg +245 -7
  26. data/app/assets/fonts/semantic-ui/icons.ttf +0 -0
  27. data/app/assets/fonts/semantic-ui/icons.woff +0 -0
  28. data/app/assets/fonts/semantic-ui/icons.woff2 +0 -0
  29. data/app/assets/fonts/semantic-ui/outline-icons.eot +0 -0
  30. data/app/assets/fonts/semantic-ui/outline-icons.svg +2 -2
  31. data/app/assets/fonts/semantic-ui/outline-icons.ttf +0 -0
  32. data/app/assets/fonts/semantic-ui/outline-icons.woff +0 -0
  33. data/app/assets/fonts/semantic-ui/outline-icons.woff2 +0 -0
  34. data/app/assets/javascripts/semantic-ui/accordion.js +569 -590
  35. data/app/assets/javascripts/semantic-ui/api.js +1153 -1116
  36. data/app/assets/javascripts/semantic-ui/calendar.js +1941 -1698
  37. data/app/assets/javascripts/semantic-ui/checkbox.js +862 -854
  38. data/app/assets/javascripts/semantic-ui/dimmer.js +697 -713
  39. data/app/assets/javascripts/semantic-ui/dropdown.js +4196 -4192
  40. data/app/assets/javascripts/semantic-ui/embed.js +646 -672
  41. data/app/assets/javascripts/semantic-ui/flyout.js +1579 -0
  42. data/app/assets/javascripts/semantic-ui/form.js +2024 -2000
  43. data/app/assets/javascripts/semantic-ui/modal.js +1546 -1384
  44. data/app/assets/javascripts/semantic-ui/nag.js +521 -527
  45. data/app/assets/javascripts/semantic-ui/popup.js +1457 -1463
  46. data/app/assets/javascripts/semantic-ui/progress.js +970 -995
  47. data/app/assets/javascripts/semantic-ui/rating.js +508 -520
  48. data/app/assets/javascripts/semantic-ui/search.js +1521 -1508
  49. data/app/assets/javascripts/semantic-ui/shape.js +784 -811
  50. data/app/assets/javascripts/semantic-ui/sidebar.js +1061 -1002
  51. data/app/assets/javascripts/semantic-ui/site.js +437 -477
  52. data/app/assets/javascripts/semantic-ui/slider.js +1311 -1297
  53. data/app/assets/javascripts/semantic-ui/state.js +639 -658
  54. data/app/assets/javascripts/semantic-ui/sticky.js +848 -891
  55. data/app/assets/javascripts/semantic-ui/tab.js +895 -941
  56. data/app/assets/javascripts/semantic-ui/toast.js +911 -851
  57. data/app/assets/javascripts/semantic-ui/transition.js +1049 -1073
  58. data/app/assets/javascripts/semantic-ui/visibility.js +1214 -1246
  59. data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +7 -7
  60. data/app/assets/stylesheets/semantic-ui/collections/_form.scss +389 -407
  61. data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +203 -345
  62. data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +372 -501
  63. data/app/assets/stylesheets/semantic-ui/collections/_message.scss +154 -226
  64. data/app/assets/stylesheets/semantic-ui/collections/_table.scss +2065 -880
  65. data/app/assets/stylesheets/semantic-ui/elements/_button.scss +867 -1232
  66. data/app/assets/stylesheets/semantic-ui/elements/_container.scss +101 -6
  67. data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +75 -93
  68. data/app/assets/stylesheets/semantic-ui/elements/_emoji.scss +11148 -9190
  69. data/app/assets/stylesheets/semantic-ui/elements/_flag.scss +1037 -929
  70. data/app/assets/stylesheets/semantic-ui/elements/_header.scss +124 -146
  71. data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +2728 -2759
  72. data/app/assets/stylesheets/semantic-ui/elements/_image.scss +41 -65
  73. data/app/assets/stylesheets/semantic-ui/elements/_input.scss +982 -163
  74. data/app/assets/stylesheets/semantic-ui/elements/_label.scss +432 -479
  75. data/app/assets/stylesheets/semantic-ui/elements/_list.scss +80 -101
  76. data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +452 -540
  77. data/app/assets/stylesheets/semantic-ui/elements/_placeholder.scss +56 -76
  78. data/app/assets/stylesheets/semantic-ui/elements/_rail.scss +17 -22
  79. data/app/assets/stylesheets/semantic-ui/elements/_reveal.scss +46 -85
  80. data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +263 -255
  81. data/app/assets/stylesheets/semantic-ui/elements/_step.scss +106 -179
  82. data/app/assets/stylesheets/semantic-ui/elements/_text.scss +33 -33
  83. data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +14 -18
  84. data/app/assets/stylesheets/semantic-ui/globals/_site.scss +132 -48
  85. data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +196 -74
  86. data/app/assets/stylesheets/semantic-ui/modules/_calendar.scss +43 -29
  87. data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +210 -280
  88. data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +78 -182
  89. data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +339 -423
  90. data/app/assets/stylesheets/semantic-ui/modules/_embed.scss +24 -35
  91. data/app/assets/stylesheets/semantic-ui/modules/_flyout.scss +546 -0
  92. data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +150 -153
  93. data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +55 -65
  94. data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +530 -310
  95. data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +108 -213
  96. data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +88 -168
  97. data/app/assets/stylesheets/semantic-ui/modules/_search.scss +73 -102
  98. data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +16 -32
  99. data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +126 -215
  100. data/app/assets/stylesheets/semantic-ui/modules/_slider.scss +110 -138
  101. data/app/assets/stylesheets/semantic-ui/modules/_sticky.scss +3 -7
  102. data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +16 -20
  103. data/app/assets/stylesheets/semantic-ui/modules/_toast.scss +111 -141
  104. data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +371 -1282
  105. data/app/assets/stylesheets/semantic-ui/views/_ad.scss +39 -50
  106. data/app/assets/stylesheets/semantic-ui/views/_card.scss +949 -458
  107. data/app/assets/stylesheets/semantic-ui/views/_comment.scss +44 -62
  108. data/app/assets/stylesheets/semantic-ui/views/_feed.scss +50 -72
  109. data/app/assets/stylesheets/semantic-ui/views/_item.scss +89 -136
  110. data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +78 -119
  111. data/lib/fomantic/ui/sass/version.rb +2 -2
  112. data/tasks/converter.rb +1 -1
  113. metadata +21 -3
@@ -1,618 +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() {
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 && $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;
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);