@ntlab/ntjs-assets 2.0.2 → 2.0.3
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.
- package/assets/js/bootstrap-icons/bootstrap-icons.svg +1 -1
- package/assets/js/bootstrap-icons/folder-plus.svg +2 -2
- package/assets/js/bootstrap-icons/font/bootstrap-icons.css +1981 -0
- package/assets/js/bootstrap-icons/font/bootstrap-icons.json +1955 -0
- package/assets/js/bootstrap-icons/font/bootstrap-icons.min.css +5 -0
- package/assets/js/bootstrap-icons/font/bootstrap-icons.scss +1993 -0
- package/assets/js/bootstrap-icons/font/fonts/bootstrap-icons.woff +0 -0
- package/assets/js/bootstrap-icons/font/fonts/bootstrap-icons.woff2 +0 -0
- package/assets/js/bootstrap-icons/postcard-heart-fill.svg +1 -1
- package/assets/js/bootstrap-icons/trash.svg +2 -2
- package/assets/js/jquery/jquery.js +840 -1045
- package/assets/js/jquery/jquery.min.js +2 -2
- package/assets/js/jquery/jquery.min.map +1 -1
- package/assets/js/jquery/jquery.slim.js +834 -1039
- package/assets/js/jquery/jquery.slim.min.js +2 -2
- package/assets/js/jquery/jquery.slim.min.map +1 -1
- package/assets/js/popper.js/cjs/enums.js +1 -1
- package/assets/js/popper.js/cjs/popper-base.js +12 -170
- package/assets/js/popper.js/cjs/popper-base.js.map +1 -1
- package/assets/js/popper.js/cjs/popper-lite.js +14 -184
- package/assets/js/popper.js/cjs/popper-lite.js.map +1 -1
- package/assets/js/popper.js/cjs/popper.js +14 -197
- package/assets/js/popper.js/cjs/popper.js.map +1 -1
- package/assets/js/popper.js/esm/createPopper.js +6 -66
- package/assets/js/popper.js/esm/modifiers/arrow.js +1 -12
- package/assets/js/popper.js/esm/modifiers/computeStyles.js +2 -14
- package/assets/js/popper.js/esm/utils/computeAutoPlacement.js +0 -4
- package/assets/js/popper.js/esm/utils/userAgent.js +1 -1
- package/assets/js/popper.js/umd/enums.js +1 -1
- package/assets/js/popper.js/umd/enums.min.js +1 -1
- package/assets/js/popper.js/umd/popper-base.js +12 -170
- package/assets/js/popper.js/umd/popper-base.js.map +1 -1
- package/assets/js/popper.js/umd/popper-base.min.js +2 -2
- package/assets/js/popper.js/umd/popper-base.min.js.map +1 -1
- package/assets/js/popper.js/umd/popper-lite.js +14 -184
- package/assets/js/popper.js/umd/popper-lite.js.map +1 -1
- package/assets/js/popper.js/umd/popper-lite.min.js +2 -2
- package/assets/js/popper.js/umd/popper-lite.min.js.map +1 -1
- package/assets/js/popper.js/umd/popper.js +14 -197
- package/assets/js/popper.js/umd/popper.js.map +1 -1
- package/assets/js/popper.js/umd/popper.min.js +2 -2
- package/assets/js/popper.js/umd/popper.min.js.map +1 -1
- package/assets/js/semantic-ui/components/accordion.css +196 -74
- package/assets/js/semantic-ui/components/accordion.js +570 -591
- package/assets/js/semantic-ui/components/accordion.min.css +4 -4
- package/assets/js/semantic-ui/components/accordion.min.js +6 -6
- package/assets/js/semantic-ui/components/ad.css +40 -51
- package/assets/js/semantic-ui/components/ad.min.css +4 -4
- package/assets/js/semantic-ui/components/api.js +1154 -1117
- package/assets/js/semantic-ui/components/api.min.js +6 -6
- package/assets/js/semantic-ui/components/breadcrumb.css +7 -7
- package/assets/js/semantic-ui/components/breadcrumb.min.css +4 -4
- package/assets/js/semantic-ui/components/button.css +895 -1227
- package/assets/js/semantic-ui/components/button.min.css +4 -4
- package/assets/js/semantic-ui/components/calendar.css +60 -33
- package/assets/js/semantic-ui/components/calendar.js +1952 -1575
- package/assets/js/semantic-ui/components/calendar.min.css +4 -4
- package/assets/js/semantic-ui/components/calendar.min.js +6 -6
- package/assets/js/semantic-ui/components/card.css +1004 -441
- package/assets/js/semantic-ui/components/card.min.css +4 -4
- package/assets/js/semantic-ui/components/checkbox.css +275 -303
- package/assets/js/semantic-ui/components/checkbox.js +863 -855
- package/assets/js/semantic-ui/components/checkbox.min.css +4 -4
- package/assets/js/semantic-ui/components/checkbox.min.js +6 -6
- package/assets/js/semantic-ui/components/comment.css +45 -63
- package/assets/js/semantic-ui/components/comment.min.css +4 -4
- package/assets/js/semantic-ui/components/container.css +98 -4
- package/assets/js/semantic-ui/components/container.min.css +4 -4
- package/assets/js/semantic-ui/components/dimmer.css +95 -196
- package/assets/js/semantic-ui/components/dimmer.js +698 -717
- package/assets/js/semantic-ui/components/dimmer.min.css +4 -4
- package/assets/js/semantic-ui/components/dimmer.min.js +6 -6
- package/assets/js/semantic-ui/components/divider.css +75 -93
- package/assets/js/semantic-ui/components/divider.min.css +4 -4
- package/assets/js/semantic-ui/components/dropdown.css +490 -413
- package/assets/js/semantic-ui/components/dropdown.js +4203 -4068
- package/assets/js/semantic-ui/components/dropdown.min.css +4 -4
- package/assets/js/semantic-ui/components/dropdown.min.js +6 -6
- package/assets/js/semantic-ui/components/embed.css +27 -38
- package/assets/js/semantic-ui/components/embed.js +647 -673
- package/assets/js/semantic-ui/components/embed.min.css +4 -4
- package/assets/js/semantic-ui/components/embed.min.js +6 -6
- package/assets/js/semantic-ui/components/emoji.css +11156 -9192
- package/assets/js/semantic-ui/components/emoji.min.css +3 -3
- package/assets/js/semantic-ui/components/feed.css +56 -78
- package/assets/js/semantic-ui/components/feed.min.css +4 -4
- package/assets/js/semantic-ui/components/flag.css +1037 -929
- package/assets/js/semantic-ui/components/flag.min.css +4 -4
- package/assets/js/semantic-ui/components/flyout.css +552 -0
- package/assets/js/semantic-ui/components/flyout.js +1567 -0
- package/assets/js/semantic-ui/components/flyout.min.css +9 -0
- package/assets/js/semantic-ui/components/flyout.min.js +11 -0
- package/assets/js/semantic-ui/components/form.css +536 -530
- package/assets/js/semantic-ui/components/form.js +2037 -1945
- package/assets/js/semantic-ui/components/form.min.css +4 -4
- package/assets/js/semantic-ui/components/form.min.js +6 -6
- package/assets/js/semantic-ui/components/grid.css +218 -345
- package/assets/js/semantic-ui/components/grid.min.css +4 -4
- package/assets/js/semantic-ui/components/header.css +137 -154
- package/assets/js/semantic-ui/components/header.min.css +4 -4
- package/assets/js/semantic-ui/components/icon.css +3000 -2750
- package/assets/js/semantic-ui/components/icon.min.css +4 -4
- package/assets/js/semantic-ui/components/image.css +54 -49
- package/assets/js/semantic-ui/components/image.min.css +4 -4
- package/assets/js/semantic-ui/components/input.css +1081 -227
- package/assets/js/semantic-ui/components/input.min.css +4 -4
- package/assets/js/semantic-ui/components/item.css +91 -138
- package/assets/js/semantic-ui/components/item.min.css +4 -4
- package/assets/js/semantic-ui/components/label.css +470 -481
- package/assets/js/semantic-ui/components/label.min.css +4 -4
- package/assets/js/semantic-ui/components/list.css +93 -114
- package/assets/js/semantic-ui/components/list.min.css +4 -4
- package/assets/js/semantic-ui/components/loader.css +452 -536
- package/assets/js/semantic-ui/components/loader.min.css +4 -4
- package/assets/js/semantic-ui/components/menu.css +408 -510
- package/assets/js/semantic-ui/components/menu.min.css +9 -1
- package/assets/js/semantic-ui/components/message.css +188 -213
- package/assets/js/semantic-ui/components/message.min.css +4 -4
- package/assets/js/semantic-ui/components/modal.css +174 -166
- package/assets/js/semantic-ui/components/modal.js +1558 -1146
- package/assets/js/semantic-ui/components/modal.min.css +4 -4
- package/assets/js/semantic-ui/components/modal.min.js +6 -6
- package/assets/js/semantic-ui/components/nag.css +183 -41
- package/assets/js/semantic-ui/components/nag.js +527 -467
- package/assets/js/semantic-ui/components/nag.min.css +4 -4
- package/assets/js/semantic-ui/components/nag.min.js +6 -6
- package/assets/js/semantic-ui/components/placeholder.css +62 -76
- package/assets/js/semantic-ui/components/placeholder.min.css +4 -4
- package/assets/js/semantic-ui/components/popup.css +681 -312
- package/assets/js/semantic-ui/components/popup.js +1470 -1463
- package/assets/js/semantic-ui/components/popup.min.css +4 -4
- package/assets/js/semantic-ui/components/popup.min.js +6 -6
- package/assets/js/semantic-ui/components/progress.css +149 -217
- package/assets/js/semantic-ui/components/progress.js +945 -1002
- package/assets/js/semantic-ui/components/progress.min.css +4 -4
- package/assets/js/semantic-ui/components/progress.min.js +6 -6
- package/assets/js/semantic-ui/components/rail.css +17 -22
- package/assets/js/semantic-ui/components/rail.min.css +3 -3
- package/assets/js/semantic-ui/components/rating.css +89 -184
- package/assets/js/semantic-ui/components/rating.js +509 -521
- package/assets/js/semantic-ui/components/rating.min.css +4 -4
- package/assets/js/semantic-ui/components/rating.min.js +6 -6
- package/assets/js/semantic-ui/components/reset.css +12 -17
- package/assets/js/semantic-ui/components/reset.min.css +4 -4
- package/assets/js/semantic-ui/components/reveal.css +46 -85
- package/assets/js/semantic-ui/components/reveal.min.css +4 -4
- package/assets/js/semantic-ui/components/search.css +157 -96
- package/assets/js/semantic-ui/components/search.js +1522 -1479
- package/assets/js/semantic-ui/components/search.min.css +4 -4
- package/assets/js/semantic-ui/components/search.min.js +6 -6
- package/assets/js/semantic-ui/components/segment.css +317 -249
- package/assets/js/semantic-ui/components/segment.min.css +4 -4
- package/assets/js/semantic-ui/components/shape.css +16 -32
- package/assets/js/semantic-ui/components/shape.js +763 -812
- package/assets/js/semantic-ui/components/shape.min.css +4 -4
- package/assets/js/semantic-ui/components/shape.min.js +6 -6
- package/assets/js/semantic-ui/components/sidebar.css +128 -216
- package/assets/js/semantic-ui/components/sidebar.js +1042 -1003
- package/assets/js/semantic-ui/components/sidebar.min.css +4 -4
- package/assets/js/semantic-ui/components/sidebar.min.js +6 -6
- package/assets/js/semantic-ui/components/site.css +123 -48
- package/assets/js/semantic-ui/components/site.js +438 -478
- package/assets/js/semantic-ui/components/site.min.css +4 -4
- package/assets/js/semantic-ui/components/site.min.js +6 -6
- package/assets/js/semantic-ui/components/slider.css +133 -141
- package/assets/js/semantic-ui/components/slider.js +1312 -1274
- package/assets/js/semantic-ui/components/slider.min.css +9 -1
- package/assets/js/semantic-ui/components/slider.min.js +6 -6
- package/assets/js/semantic-ui/components/state.js +640 -659
- package/assets/js/semantic-ui/components/state.min.js +6 -6
- package/assets/js/semantic-ui/components/statistic.css +83 -124
- package/assets/js/semantic-ui/components/statistic.min.css +4 -4
- package/assets/js/semantic-ui/components/step.css +118 -184
- package/assets/js/semantic-ui/components/step.min.css +4 -4
- package/assets/js/semantic-ui/components/sticky.css +3 -8
- package/assets/js/semantic-ui/components/sticky.js +849 -892
- package/assets/js/semantic-ui/components/sticky.min.css +4 -4
- package/assets/js/semantic-ui/components/sticky.min.js +6 -6
- package/assets/js/semantic-ui/components/tab.css +16 -20
- package/assets/js/semantic-ui/components/tab.js +896 -941
- package/assets/js/semantic-ui/components/tab.min.css +4 -4
- package/assets/js/semantic-ui/components/tab.min.js +6 -6
- package/assets/js/semantic-ui/components/table.css +2073 -884
- package/assets/js/semantic-ui/components/table.min.css +4 -4
- package/assets/js/semantic-ui/components/text.css +51 -30
- package/assets/js/semantic-ui/components/text.min.css +4 -4
- package/assets/js/semantic-ui/components/toast.css +200 -137
- package/assets/js/semantic-ui/components/toast.js +912 -832
- package/assets/js/semantic-ui/components/toast.min.css +4 -4
- package/assets/js/semantic-ui/components/toast.min.js +6 -6
- package/assets/js/semantic-ui/components/transition.css +371 -1282
- package/assets/js/semantic-ui/components/transition.js +999 -1074
- package/assets/js/semantic-ui/components/transition.min.css +4 -4
- package/assets/js/semantic-ui/components/transition.min.js +6 -6
- package/assets/js/semantic-ui/components/visibility.js +1215 -1247
- package/assets/js/semantic-ui/components/visibility.min.js +6 -6
- package/assets/js/semantic-ui/semantic.css +43777 -37429
- package/assets/js/semantic-ui/semantic.js +29152 -26694
- package/assets/js/semantic-ui/semantic.min.css +6 -399
- package/assets/js/semantic-ui/semantic.min.js +6 -6
- package/assets/js/semantic-ui/themes/basic/assets/fonts/icons.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Bold.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Bold.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-BoldItalic.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-BoldItalic.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Italic.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Italic.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Regular.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Regular.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Bold.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-BoldItalic.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-BoldItalic.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Italic.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Italic.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Regular.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/brand-icons.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/brand-icons.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/icons.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/icons.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/outline-icons.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/outline-icons.woff2 +0 -0
- package/assets/js/semantic-ui/themes/famfamfam/assets/images/flags.png +0 -0
- package/assets/js/semantic-ui/themes/github/assets/fonts/octicons.woff2 +0 -0
- package/assets/js/socket.io/socket.io.esm.min.js +3 -3
- package/assets/js/socket.io/socket.io.esm.min.js.map +1 -1
- package/assets/js/socket.io/socket.io.js +841 -333
- package/assets/js/socket.io/socket.io.js.map +1 -1
- package/assets/js/socket.io/socket.io.min.js +3 -3
- package/assets/js/socket.io/socket.io.min.js.map +1 -1
- package/assets/js/socket.io/socket.io.msgpack.min.js +3 -3
- package/assets/js/socket.io/socket.io.msgpack.min.js.map +1 -1
- package/cdn.json +19 -4
- package/package.json +1 -1
|
@@ -1,618 +1,597 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* # Fomantic-UI - Accordion
|
|
3
|
-
*
|
|
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
|
-
*
|
|
7
|
+
* https://opensource.org/licenses/MIT
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
.data(moduleNamespace, module)
|
|
80
|
-
;
|
|
81
|
-
},
|
|
14
|
+
function isFunction(obj) {
|
|
15
|
+
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
|
16
|
+
}
|
|
82
17
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
.off(eventNamespace)
|
|
87
|
-
.removeData(moduleNamespace)
|
|
88
|
-
;
|
|
89
|
-
},
|
|
18
|
+
window = window !== undefined && window.Math === Math
|
|
19
|
+
? window
|
|
20
|
+
: globalThis;
|
|
90
21
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
22
|
+
$.fn.accordion = function (parameters) {
|
|
23
|
+
var
|
|
24
|
+
$allModules = $(this),
|
|
95
25
|
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
-
|
|
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
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
-
|
|
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
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
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
|
-
|
|
541
|
+
$.fn.accordion.settings = {
|
|
351
542
|
|
|
352
|
-
|
|
353
|
-
|
|
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
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
},
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
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
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
574
|
+
|
|
575
|
+
className: {
|
|
576
|
+
active: 'active',
|
|
577
|
+
animating: 'animating',
|
|
578
|
+
transition: 'transition',
|
|
434
579
|
},
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
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);
|