@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.
Files changed (235) hide show
  1. package/assets/js/bootstrap-icons/bootstrap-icons.svg +1 -1
  2. package/assets/js/bootstrap-icons/folder-plus.svg +2 -2
  3. package/assets/js/bootstrap-icons/font/bootstrap-icons.css +1981 -0
  4. package/assets/js/bootstrap-icons/font/bootstrap-icons.json +1955 -0
  5. package/assets/js/bootstrap-icons/font/bootstrap-icons.min.css +5 -0
  6. package/assets/js/bootstrap-icons/font/bootstrap-icons.scss +1993 -0
  7. package/assets/js/bootstrap-icons/font/fonts/bootstrap-icons.woff +0 -0
  8. package/assets/js/bootstrap-icons/font/fonts/bootstrap-icons.woff2 +0 -0
  9. package/assets/js/bootstrap-icons/postcard-heart-fill.svg +1 -1
  10. package/assets/js/bootstrap-icons/trash.svg +2 -2
  11. package/assets/js/jquery/jquery.js +840 -1045
  12. package/assets/js/jquery/jquery.min.js +2 -2
  13. package/assets/js/jquery/jquery.min.map +1 -1
  14. package/assets/js/jquery/jquery.slim.js +834 -1039
  15. package/assets/js/jquery/jquery.slim.min.js +2 -2
  16. package/assets/js/jquery/jquery.slim.min.map +1 -1
  17. package/assets/js/popper.js/cjs/enums.js +1 -1
  18. package/assets/js/popper.js/cjs/popper-base.js +12 -170
  19. package/assets/js/popper.js/cjs/popper-base.js.map +1 -1
  20. package/assets/js/popper.js/cjs/popper-lite.js +14 -184
  21. package/assets/js/popper.js/cjs/popper-lite.js.map +1 -1
  22. package/assets/js/popper.js/cjs/popper.js +14 -197
  23. package/assets/js/popper.js/cjs/popper.js.map +1 -1
  24. package/assets/js/popper.js/esm/createPopper.js +6 -66
  25. package/assets/js/popper.js/esm/modifiers/arrow.js +1 -12
  26. package/assets/js/popper.js/esm/modifiers/computeStyles.js +2 -14
  27. package/assets/js/popper.js/esm/utils/computeAutoPlacement.js +0 -4
  28. package/assets/js/popper.js/esm/utils/userAgent.js +1 -1
  29. package/assets/js/popper.js/umd/enums.js +1 -1
  30. package/assets/js/popper.js/umd/enums.min.js +1 -1
  31. package/assets/js/popper.js/umd/popper-base.js +12 -170
  32. package/assets/js/popper.js/umd/popper-base.js.map +1 -1
  33. package/assets/js/popper.js/umd/popper-base.min.js +2 -2
  34. package/assets/js/popper.js/umd/popper-base.min.js.map +1 -1
  35. package/assets/js/popper.js/umd/popper-lite.js +14 -184
  36. package/assets/js/popper.js/umd/popper-lite.js.map +1 -1
  37. package/assets/js/popper.js/umd/popper-lite.min.js +2 -2
  38. package/assets/js/popper.js/umd/popper-lite.min.js.map +1 -1
  39. package/assets/js/popper.js/umd/popper.js +14 -197
  40. package/assets/js/popper.js/umd/popper.js.map +1 -1
  41. package/assets/js/popper.js/umd/popper.min.js +2 -2
  42. package/assets/js/popper.js/umd/popper.min.js.map +1 -1
  43. package/assets/js/semantic-ui/components/accordion.css +196 -74
  44. package/assets/js/semantic-ui/components/accordion.js +570 -591
  45. package/assets/js/semantic-ui/components/accordion.min.css +4 -4
  46. package/assets/js/semantic-ui/components/accordion.min.js +6 -6
  47. package/assets/js/semantic-ui/components/ad.css +40 -51
  48. package/assets/js/semantic-ui/components/ad.min.css +4 -4
  49. package/assets/js/semantic-ui/components/api.js +1154 -1117
  50. package/assets/js/semantic-ui/components/api.min.js +6 -6
  51. package/assets/js/semantic-ui/components/breadcrumb.css +7 -7
  52. package/assets/js/semantic-ui/components/breadcrumb.min.css +4 -4
  53. package/assets/js/semantic-ui/components/button.css +895 -1227
  54. package/assets/js/semantic-ui/components/button.min.css +4 -4
  55. package/assets/js/semantic-ui/components/calendar.css +60 -33
  56. package/assets/js/semantic-ui/components/calendar.js +1952 -1575
  57. package/assets/js/semantic-ui/components/calendar.min.css +4 -4
  58. package/assets/js/semantic-ui/components/calendar.min.js +6 -6
  59. package/assets/js/semantic-ui/components/card.css +1004 -441
  60. package/assets/js/semantic-ui/components/card.min.css +4 -4
  61. package/assets/js/semantic-ui/components/checkbox.css +275 -303
  62. package/assets/js/semantic-ui/components/checkbox.js +863 -855
  63. package/assets/js/semantic-ui/components/checkbox.min.css +4 -4
  64. package/assets/js/semantic-ui/components/checkbox.min.js +6 -6
  65. package/assets/js/semantic-ui/components/comment.css +45 -63
  66. package/assets/js/semantic-ui/components/comment.min.css +4 -4
  67. package/assets/js/semantic-ui/components/container.css +98 -4
  68. package/assets/js/semantic-ui/components/container.min.css +4 -4
  69. package/assets/js/semantic-ui/components/dimmer.css +95 -196
  70. package/assets/js/semantic-ui/components/dimmer.js +698 -717
  71. package/assets/js/semantic-ui/components/dimmer.min.css +4 -4
  72. package/assets/js/semantic-ui/components/dimmer.min.js +6 -6
  73. package/assets/js/semantic-ui/components/divider.css +75 -93
  74. package/assets/js/semantic-ui/components/divider.min.css +4 -4
  75. package/assets/js/semantic-ui/components/dropdown.css +490 -413
  76. package/assets/js/semantic-ui/components/dropdown.js +4203 -4068
  77. package/assets/js/semantic-ui/components/dropdown.min.css +4 -4
  78. package/assets/js/semantic-ui/components/dropdown.min.js +6 -6
  79. package/assets/js/semantic-ui/components/embed.css +27 -38
  80. package/assets/js/semantic-ui/components/embed.js +647 -673
  81. package/assets/js/semantic-ui/components/embed.min.css +4 -4
  82. package/assets/js/semantic-ui/components/embed.min.js +6 -6
  83. package/assets/js/semantic-ui/components/emoji.css +11156 -9192
  84. package/assets/js/semantic-ui/components/emoji.min.css +3 -3
  85. package/assets/js/semantic-ui/components/feed.css +56 -78
  86. package/assets/js/semantic-ui/components/feed.min.css +4 -4
  87. package/assets/js/semantic-ui/components/flag.css +1037 -929
  88. package/assets/js/semantic-ui/components/flag.min.css +4 -4
  89. package/assets/js/semantic-ui/components/flyout.css +552 -0
  90. package/assets/js/semantic-ui/components/flyout.js +1567 -0
  91. package/assets/js/semantic-ui/components/flyout.min.css +9 -0
  92. package/assets/js/semantic-ui/components/flyout.min.js +11 -0
  93. package/assets/js/semantic-ui/components/form.css +536 -530
  94. package/assets/js/semantic-ui/components/form.js +2037 -1945
  95. package/assets/js/semantic-ui/components/form.min.css +4 -4
  96. package/assets/js/semantic-ui/components/form.min.js +6 -6
  97. package/assets/js/semantic-ui/components/grid.css +218 -345
  98. package/assets/js/semantic-ui/components/grid.min.css +4 -4
  99. package/assets/js/semantic-ui/components/header.css +137 -154
  100. package/assets/js/semantic-ui/components/header.min.css +4 -4
  101. package/assets/js/semantic-ui/components/icon.css +3000 -2750
  102. package/assets/js/semantic-ui/components/icon.min.css +4 -4
  103. package/assets/js/semantic-ui/components/image.css +54 -49
  104. package/assets/js/semantic-ui/components/image.min.css +4 -4
  105. package/assets/js/semantic-ui/components/input.css +1081 -227
  106. package/assets/js/semantic-ui/components/input.min.css +4 -4
  107. package/assets/js/semantic-ui/components/item.css +91 -138
  108. package/assets/js/semantic-ui/components/item.min.css +4 -4
  109. package/assets/js/semantic-ui/components/label.css +470 -481
  110. package/assets/js/semantic-ui/components/label.min.css +4 -4
  111. package/assets/js/semantic-ui/components/list.css +93 -114
  112. package/assets/js/semantic-ui/components/list.min.css +4 -4
  113. package/assets/js/semantic-ui/components/loader.css +452 -536
  114. package/assets/js/semantic-ui/components/loader.min.css +4 -4
  115. package/assets/js/semantic-ui/components/menu.css +408 -510
  116. package/assets/js/semantic-ui/components/menu.min.css +9 -1
  117. package/assets/js/semantic-ui/components/message.css +188 -213
  118. package/assets/js/semantic-ui/components/message.min.css +4 -4
  119. package/assets/js/semantic-ui/components/modal.css +174 -166
  120. package/assets/js/semantic-ui/components/modal.js +1558 -1146
  121. package/assets/js/semantic-ui/components/modal.min.css +4 -4
  122. package/assets/js/semantic-ui/components/modal.min.js +6 -6
  123. package/assets/js/semantic-ui/components/nag.css +183 -41
  124. package/assets/js/semantic-ui/components/nag.js +527 -467
  125. package/assets/js/semantic-ui/components/nag.min.css +4 -4
  126. package/assets/js/semantic-ui/components/nag.min.js +6 -6
  127. package/assets/js/semantic-ui/components/placeholder.css +62 -76
  128. package/assets/js/semantic-ui/components/placeholder.min.css +4 -4
  129. package/assets/js/semantic-ui/components/popup.css +681 -312
  130. package/assets/js/semantic-ui/components/popup.js +1470 -1463
  131. package/assets/js/semantic-ui/components/popup.min.css +4 -4
  132. package/assets/js/semantic-ui/components/popup.min.js +6 -6
  133. package/assets/js/semantic-ui/components/progress.css +149 -217
  134. package/assets/js/semantic-ui/components/progress.js +945 -1002
  135. package/assets/js/semantic-ui/components/progress.min.css +4 -4
  136. package/assets/js/semantic-ui/components/progress.min.js +6 -6
  137. package/assets/js/semantic-ui/components/rail.css +17 -22
  138. package/assets/js/semantic-ui/components/rail.min.css +3 -3
  139. package/assets/js/semantic-ui/components/rating.css +89 -184
  140. package/assets/js/semantic-ui/components/rating.js +509 -521
  141. package/assets/js/semantic-ui/components/rating.min.css +4 -4
  142. package/assets/js/semantic-ui/components/rating.min.js +6 -6
  143. package/assets/js/semantic-ui/components/reset.css +12 -17
  144. package/assets/js/semantic-ui/components/reset.min.css +4 -4
  145. package/assets/js/semantic-ui/components/reveal.css +46 -85
  146. package/assets/js/semantic-ui/components/reveal.min.css +4 -4
  147. package/assets/js/semantic-ui/components/search.css +157 -96
  148. package/assets/js/semantic-ui/components/search.js +1522 -1479
  149. package/assets/js/semantic-ui/components/search.min.css +4 -4
  150. package/assets/js/semantic-ui/components/search.min.js +6 -6
  151. package/assets/js/semantic-ui/components/segment.css +317 -249
  152. package/assets/js/semantic-ui/components/segment.min.css +4 -4
  153. package/assets/js/semantic-ui/components/shape.css +16 -32
  154. package/assets/js/semantic-ui/components/shape.js +763 -812
  155. package/assets/js/semantic-ui/components/shape.min.css +4 -4
  156. package/assets/js/semantic-ui/components/shape.min.js +6 -6
  157. package/assets/js/semantic-ui/components/sidebar.css +128 -216
  158. package/assets/js/semantic-ui/components/sidebar.js +1042 -1003
  159. package/assets/js/semantic-ui/components/sidebar.min.css +4 -4
  160. package/assets/js/semantic-ui/components/sidebar.min.js +6 -6
  161. package/assets/js/semantic-ui/components/site.css +123 -48
  162. package/assets/js/semantic-ui/components/site.js +438 -478
  163. package/assets/js/semantic-ui/components/site.min.css +4 -4
  164. package/assets/js/semantic-ui/components/site.min.js +6 -6
  165. package/assets/js/semantic-ui/components/slider.css +133 -141
  166. package/assets/js/semantic-ui/components/slider.js +1312 -1274
  167. package/assets/js/semantic-ui/components/slider.min.css +9 -1
  168. package/assets/js/semantic-ui/components/slider.min.js +6 -6
  169. package/assets/js/semantic-ui/components/state.js +640 -659
  170. package/assets/js/semantic-ui/components/state.min.js +6 -6
  171. package/assets/js/semantic-ui/components/statistic.css +83 -124
  172. package/assets/js/semantic-ui/components/statistic.min.css +4 -4
  173. package/assets/js/semantic-ui/components/step.css +118 -184
  174. package/assets/js/semantic-ui/components/step.min.css +4 -4
  175. package/assets/js/semantic-ui/components/sticky.css +3 -8
  176. package/assets/js/semantic-ui/components/sticky.js +849 -892
  177. package/assets/js/semantic-ui/components/sticky.min.css +4 -4
  178. package/assets/js/semantic-ui/components/sticky.min.js +6 -6
  179. package/assets/js/semantic-ui/components/tab.css +16 -20
  180. package/assets/js/semantic-ui/components/tab.js +896 -941
  181. package/assets/js/semantic-ui/components/tab.min.css +4 -4
  182. package/assets/js/semantic-ui/components/tab.min.js +6 -6
  183. package/assets/js/semantic-ui/components/table.css +2073 -884
  184. package/assets/js/semantic-ui/components/table.min.css +4 -4
  185. package/assets/js/semantic-ui/components/text.css +51 -30
  186. package/assets/js/semantic-ui/components/text.min.css +4 -4
  187. package/assets/js/semantic-ui/components/toast.css +200 -137
  188. package/assets/js/semantic-ui/components/toast.js +912 -832
  189. package/assets/js/semantic-ui/components/toast.min.css +4 -4
  190. package/assets/js/semantic-ui/components/toast.min.js +6 -6
  191. package/assets/js/semantic-ui/components/transition.css +371 -1282
  192. package/assets/js/semantic-ui/components/transition.js +999 -1074
  193. package/assets/js/semantic-ui/components/transition.min.css +4 -4
  194. package/assets/js/semantic-ui/components/transition.min.js +6 -6
  195. package/assets/js/semantic-ui/components/visibility.js +1215 -1247
  196. package/assets/js/semantic-ui/components/visibility.min.js +6 -6
  197. package/assets/js/semantic-ui/semantic.css +43777 -37429
  198. package/assets/js/semantic-ui/semantic.js +29152 -26694
  199. package/assets/js/semantic-ui/semantic.min.css +6 -399
  200. package/assets/js/semantic-ui/semantic.min.js +6 -6
  201. package/assets/js/semantic-ui/themes/basic/assets/fonts/icons.woff2 +0 -0
  202. package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Bold.woff +0 -0
  203. package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Bold.woff2 +0 -0
  204. package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-BoldItalic.woff +0 -0
  205. package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  206. package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Italic.woff +0 -0
  207. package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Italic.woff2 +0 -0
  208. package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Regular.woff +0 -0
  209. package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Regular.woff2 +0 -0
  210. package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
  211. package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Bold.woff2 +0 -0
  212. package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-BoldItalic.woff +0 -0
  213. package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-BoldItalic.woff2 +0 -0
  214. package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Italic.woff +0 -0
  215. package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Italic.woff2 +0 -0
  216. package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
  217. package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Regular.woff2 +0 -0
  218. package/assets/js/semantic-ui/themes/default/assets/fonts/brand-icons.woff +0 -0
  219. package/assets/js/semantic-ui/themes/default/assets/fonts/brand-icons.woff2 +0 -0
  220. package/assets/js/semantic-ui/themes/default/assets/fonts/icons.woff +0 -0
  221. package/assets/js/semantic-ui/themes/default/assets/fonts/icons.woff2 +0 -0
  222. package/assets/js/semantic-ui/themes/default/assets/fonts/outline-icons.woff +0 -0
  223. package/assets/js/semantic-ui/themes/default/assets/fonts/outline-icons.woff2 +0 -0
  224. package/assets/js/semantic-ui/themes/famfamfam/assets/images/flags.png +0 -0
  225. package/assets/js/semantic-ui/themes/github/assets/fonts/octicons.woff2 +0 -0
  226. package/assets/js/socket.io/socket.io.esm.min.js +3 -3
  227. package/assets/js/socket.io/socket.io.esm.min.js.map +1 -1
  228. package/assets/js/socket.io/socket.io.js +841 -333
  229. package/assets/js/socket.io/socket.io.js.map +1 -1
  230. package/assets/js/socket.io/socket.io.min.js +3 -3
  231. package/assets/js/socket.io/socket.io.min.js.map +1 -1
  232. package/assets/js/socket.io/socket.io.msgpack.min.js +3 -3
  233. package/assets/js/socket.io/socket.io.msgpack.min.js.map +1 -1
  234. package/cdn.json +19 -4
  235. package/package.json +1 -1
@@ -1,1109 +1,1034 @@
1
1
  /*!
2
- * # Fomantic-UI - Transition
3
- * http://github.com/fomantic/Fomantic-UI/
2
+ * # Fomantic-UI 2.9.2 - Transition
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.transition = function() {
27
- var
28
- $allModules = $(this),
29
- moduleSelector = $allModules.selector || '',
30
-
31
- time = new Date().getTime(),
32
- performance = [],
33
-
34
- moduleArguments = arguments,
35
- query = moduleArguments[0],
36
- queryArguments = [].slice.call(arguments, 1),
37
- methodInvoked = (typeof query === 'string'),
38
-
39
- returnedValue
40
- ;
41
- $allModules
42
- .each(function(index) {
43
- var
44
- $module = $(this),
45
- element = this,
46
-
47
- // set at run time
48
- settings,
49
- instance,
50
-
51
- error,
52
- className,
53
- metadata,
54
- animationEnd,
55
-
56
- moduleNamespace,
57
- eventNamespace,
58
- module
59
- ;
60
-
61
- module = {
62
-
63
- initialize: function() {
64
-
65
- // get full settings
66
- settings = module.get.settings.apply(element, moduleArguments);
67
-
68
- // shorthand
69
- className = settings.className;
70
- error = settings.error;
71
- metadata = settings.metadata;
72
-
73
- // define namespace
74
- eventNamespace = '.' + settings.namespace;
75
- moduleNamespace = 'module-' + settings.namespace;
76
- instance = $module.data(moduleNamespace) || module;
77
-
78
- // get vendor specific events
79
- animationEnd = module.get.animationEndEvent();
80
-
81
- if(methodInvoked) {
82
- methodInvoked = module.invoke(query);
83
- }
84
-
85
- // method not invoked, lets run an animation
86
- if(methodInvoked === false) {
87
- module.verbose('Converted arguments into settings object', settings);
88
- if(settings.interval) {
89
- module.delay(settings.animate);
90
- }
91
- else {
92
- module.animate();
93
- }
94
- module.instantiate();
95
- }
96
- },
97
-
98
- instantiate: function() {
99
- module.verbose('Storing instance of module', module);
100
- instance = module;
101
- $module
102
- .data(moduleNamespace, instance)
103
- ;
104
- },
105
-
106
- destroy: function() {
107
- module.verbose('Destroying previous module for', element);
108
- $module
109
- .removeData(moduleNamespace)
110
- ;
111
- },
112
-
113
- refresh: function() {
114
- module.verbose('Refreshing display type on next animation');
115
- delete module.displayType;
116
- },
117
-
118
- forceRepaint: function() {
119
- module.verbose('Forcing element repaint');
120
- var
121
- $parentElement = $module.parent(),
122
- $nextElement = $module.next()
123
- ;
124
- if($nextElement.length === 0) {
125
- $module.detach().appendTo($parentElement);
126
- }
127
- else {
128
- $module.detach().insertBefore($nextElement);
129
- }
130
- },
131
-
132
- repaint: function() {
133
- module.verbose('Repainting element');
134
- var
135
- fakeAssignment = element.offsetWidth
136
- ;
137
- },
11
+ (function ($, window, document) {
12
+ 'use strict';
138
13
 
139
- delay: function(interval) {
140
- var
141
- direction = module.get.animationDirection(),
142
- shouldReverse,
143
- delay
144
- ;
145
- if(!direction) {
146
- direction = module.can.transition()
147
- ? module.get.direction()
148
- : 'static'
149
- ;
150
- }
151
- interval = (interval !== undefined)
152
- ? interval
153
- : settings.interval
154
- ;
155
- shouldReverse = (settings.reverse == 'auto' && direction == className.outward);
156
- delay = (shouldReverse || settings.reverse == true)
157
- ? ($allModules.length - index) * settings.interval
158
- : index * settings.interval
159
- ;
160
- module.debug('Delaying animation by', delay);
161
- setTimeout(module.animate, delay);
162
- },
14
+ function isFunction(obj) {
15
+ return typeof obj === 'function' && typeof obj.nodeType !== 'number';
16
+ }
163
17
 
164
- animate: function(overrideSettings) {
165
- settings = overrideSettings || settings;
166
- if(!module.is.supported()) {
167
- module.error(error.support);
168
- return false;
169
- }
170
- module.debug('Preparing animation', settings.animation);
171
- if(module.is.animating()) {
172
- if(settings.queue) {
173
- if(!settings.allowRepeats && module.has.direction() && module.is.occurring() && module.queuing !== true) {
174
- module.debug('Animation is currently occurring, preventing queueing same animation', settings.animation);
175
- }
176
- else {
177
- module.queue(settings.animation);
178
- }
179
- return false;
180
- }
181
- else if(!settings.allowRepeats && module.is.occurring()) {
182
- module.debug('Animation is already occurring, will not execute repeated animation', settings.animation);
183
- return false;
184
- }
185
- else {
186
- module.debug('New animation started, completing previous early', settings.animation);
187
- instance.complete();
188
- }
189
- }
190
- if( module.can.animate() ) {
191
- module.set.animating(settings.animation);
192
- }
193
- else {
194
- module.error(error.noAnimation, settings.animation, element);
195
- }
196
- },
18
+ window = window !== undefined && window.Math === Math
19
+ ? window
20
+ : globalThis;
197
21
 
198
- reset: function() {
199
- module.debug('Resetting animation to beginning conditions');
200
- module.remove.animationCallbacks();
201
- module.restore.conditions();
202
- module.remove.animating();
203
- },
22
+ $.fn.transition = function () {
23
+ var
24
+ $allModules = $(this),
25
+ moduleSelector = $allModules.selector || '',
204
26
 
205
- queue: function(animation) {
206
- module.debug('Queueing animation of', animation);
207
- module.queuing = true;
208
- $module
209
- .one(animationEnd + '.queue' + eventNamespace, function() {
210
- module.queuing = false;
211
- module.repaint();
212
- module.animate.apply(this, settings);
213
- })
214
- ;
215
- },
27
+ time = Date.now(),
28
+ performance = [],
216
29
 
217
- complete: function (event) {
218
- if(event && event.target === element) {
219
- event.stopPropagation();
220
- }
221
- module.debug('Animation complete', settings.animation);
222
- module.remove.completeCallback();
223
- module.remove.failSafe();
224
- if(!module.is.looping()) {
225
- if( module.is.outward() ) {
226
- module.verbose('Animation is outward, hiding element');
227
- module.restore.conditions();
228
- module.hide();
229
- }
230
- else if( module.is.inward() ) {
231
- module.verbose('Animation is outward, showing element');
232
- module.restore.conditions();
233
- module.show();
234
- }
235
- else {
236
- module.verbose('Static animation completed');
237
- module.restore.conditions();
238
- settings.onComplete.call(element);
239
- }
240
- }
241
- },
30
+ moduleArguments = arguments,
31
+ query = moduleArguments[0],
32
+ queryArguments = [].slice.call(arguments, 1),
33
+ methodInvoked = typeof query === 'string',
242
34
 
243
- force: {
244
- visible: function() {
35
+ returnedValue
36
+ ;
37
+ $allModules.each(function (index) {
245
38
  var
246
- style = $module.attr('style'),
247
- userStyle = module.get.userStyle(style),
248
- displayType = module.get.displayType(),
249
- overrideStyle = userStyle + 'display: ' + displayType + ' !important;',
250
- inlineDisplay = $module[0].style.display,
251
- mustStayHidden = !displayType || (inlineDisplay === 'none' && settings.skipInlineHidden) || $module[0].tagName.match(/(script|link|style)/i)
252
- ;
253
- if (mustStayHidden){
254
- module.remove.transition();
255
- return false;
256
- }
257
- module.verbose('Overriding default display to show element', displayType);
258
- $module
259
- .attr('style', overrideStyle)
260
- ;
261
- return true;
262
- },
263
- hidden: function() {
264
- var
265
- style = $module.attr('style'),
266
- currentDisplay = $module.css('display'),
267
- emptyStyle = (style === undefined || style === '')
268
- ;
269
- if(currentDisplay !== 'none' && !module.is.hidden()) {
270
- module.verbose('Overriding default display to hide element');
271
- $module
272
- .css('display', 'none')
273
- ;
274
- }
275
- else if(emptyStyle) {
276
- $module
277
- .removeAttr('style')
278
- ;
279
- }
280
- }
281
- },
39
+ $module = $(this),
40
+ element = this,
282
41
 
283
- has: {
284
- direction: function(animation) {
285
- var
286
- hasDirection = false
287
- ;
288
- animation = animation || settings.animation;
289
- if(typeof animation === 'string') {
290
- animation = animation.split(' ');
291
- $.each(animation, function(index, word){
292
- if(word === className.inward || word === className.outward) {
293
- hasDirection = true;
294
- }
295
- });
296
- }
297
- return hasDirection;
298
- },
299
- inlineDisplay: function() {
300
- var
301
- style = $module.attr('style') || ''
302
- ;
303
- return Array.isArray(style.match(/display.*?;/, ''));
304
- }
305
- },
306
-
307
- set: {
308
- animating: function(animation) {
309
- // remove previous callbacks
310
- module.remove.completeCallback();
311
-
312
- // determine exact animation
313
- animation = animation || settings.animation;
314
- var animationClass = module.get.animationClass(animation);
315
-
316
- // save animation class in cache to restore class names
317
- module.save.animation(animationClass);
318
-
319
- if(module.force.visible()) {
320
- module.remove.hidden();
321
- module.remove.direction();
322
-
323
- module.start.animation(animationClass);
324
- }
325
- },
326
- duration: function(animationName, duration) {
327
- duration = duration || settings.duration;
328
- duration = (typeof duration == 'number')
329
- ? duration + 'ms'
330
- : duration
331
- ;
332
- if(duration || duration === 0) {
333
- module.verbose('Setting animation duration', duration);
334
- $module
335
- .css({
336
- 'animation-duration': duration
337
- })
338
- ;
339
- }
340
- },
341
- direction: function(direction) {
342
- direction = direction || module.get.direction();
343
- if(direction == className.inward) {
344
- module.set.inward();
345
- }
346
- else {
347
- module.set.outward();
348
- }
349
- },
350
- looping: function() {
351
- module.debug('Transition set to loop');
352
- $module
353
- .addClass(className.looping)
354
- ;
355
- },
356
- hidden: function() {
357
- $module
358
- .addClass(className.transition)
359
- .addClass(className.hidden)
360
- ;
361
- },
362
- inward: function() {
363
- module.debug('Setting direction to inward');
364
- $module
365
- .removeClass(className.outward)
366
- .addClass(className.inward)
367
- ;
368
- },
369
- outward: function() {
370
- module.debug('Setting direction to outward');
371
- $module
372
- .removeClass(className.inward)
373
- .addClass(className.outward)
374
- ;
375
- },
376
- visible: function() {
377
- $module
378
- .addClass(className.transition)
379
- .addClass(className.visible)
380
- ;
381
- }
382
- },
383
-
384
- start: {
385
- animation: function(animationClass) {
386
- animationClass = animationClass || module.get.animationClass();
387
- module.debug('Starting tween', animationClass);
388
- $module
389
- .addClass(animationClass)
390
- .one(animationEnd + '.complete' + eventNamespace, module.complete)
391
- ;
392
- if(settings.useFailSafe) {
393
- module.add.failSafe();
394
- }
395
- module.set.duration(settings.duration);
396
- settings.onStart.call(element);
397
- }
398
- },
399
-
400
- save: {
401
- animation: function(animation) {
402
- if(!module.cache) {
403
- module.cache = {};
404
- }
405
- module.cache.animation = animation;
406
- },
407
- displayType: function(displayType) {
408
- if(displayType !== 'none') {
409
- $module.data(metadata.displayType, displayType);
410
- }
411
- },
412
- transitionExists: function(animation, exists) {
413
- $.fn.transition.exists[animation] = exists;
414
- module.verbose('Saving existence of transition', animation, exists);
415
- }
416
- },
417
-
418
- restore: {
419
- conditions: function() {
420
- var
421
- animation = module.get.currentAnimation()
422
- ;
423
- if(animation) {
424
- $module
425
- .removeClass(animation)
426
- ;
427
- module.verbose('Removing animation class', module.cache);
428
- }
429
- module.remove.duration();
430
- }
431
- },
42
+ // set at run time
43
+ settings,
44
+ instance,
432
45
 
433
- add: {
434
- failSafe: function() {
435
- var
436
- duration = module.get.duration()
437
- ;
438
- module.timer = setTimeout(function() {
439
- $module.triggerHandler(animationEnd);
440
- }, duration + settings.failSafeDelay);
441
- module.verbose('Adding fail safe timer', module.timer);
442
- }
443
- },
46
+ error,
47
+ className,
48
+ metadata,
444
49
 
445
- remove: {
446
- animating: function() {
447
- $module.removeClass(className.animating);
448
- },
449
- animationCallbacks: function() {
450
- module.remove.queueCallback();
451
- module.remove.completeCallback();
452
- },
453
- queueCallback: function() {
454
- $module.off('.queue' + eventNamespace);
455
- },
456
- completeCallback: function() {
457
- $module.off('.complete' + eventNamespace);
458
- },
459
- display: function() {
460
- $module.css('display', '');
461
- },
462
- direction: function() {
463
- $module
464
- .removeClass(className.inward)
465
- .removeClass(className.outward)
466
- ;
467
- },
468
- duration: function() {
469
- $module
470
- .css('animation-duration', '')
471
- ;
472
- },
473
- failSafe: function() {
474
- module.verbose('Removing fail safe timer', module.timer);
475
- if(module.timer) {
476
- clearTimeout(module.timer);
477
- }
478
- },
479
- hidden: function() {
480
- $module.removeClass(className.hidden);
481
- },
482
- visible: function() {
483
- $module.removeClass(className.visible);
484
- },
485
- looping: function() {
486
- module.debug('Transitions are no longer looping');
487
- if( module.is.looping() ) {
488
- module.reset();
489
- $module
490
- .removeClass(className.looping)
491
- ;
492
- }
493
- },
494
- transition: function() {
495
- $module
496
- .removeClass(className.transition)
497
- .removeClass(className.visible)
498
- .removeClass(className.hidden)
499
- ;
500
- }
501
- },
502
- get: {
503
- settings: function(animation, duration, onComplete) {
504
- // single settings object
505
- if(typeof animation == 'object') {
506
- return $.extend(true, {}, $.fn.transition.settings, animation);
507
- }
508
- // all arguments provided
509
- else if(typeof onComplete == 'function') {
510
- return $.extend({}, $.fn.transition.settings, {
511
- animation : animation,
512
- onComplete : onComplete,
513
- duration : duration
514
- });
515
- }
516
- // only duration provided
517
- else if(typeof duration == 'string' || typeof duration == 'number') {
518
- return $.extend({}, $.fn.transition.settings, {
519
- animation : animation,
520
- duration : duration
521
- });
522
- }
523
- // duration is actually settings object
524
- else if(typeof duration == 'object') {
525
- return $.extend({}, $.fn.transition.settings, duration, {
526
- animation : animation
527
- });
528
- }
529
- // duration is actually callback
530
- else if(typeof duration == 'function') {
531
- return $.extend({}, $.fn.transition.settings, {
532
- animation : animation,
533
- onComplete : duration
534
- });
535
- }
536
- // only animation provided
537
- else {
538
- return $.extend({}, $.fn.transition.settings, {
539
- animation : animation
540
- });
541
- }
542
- },
543
- animationClass: function(animation) {
544
- var
545
- animationClass = animation || settings.animation,
546
- directionClass = (module.can.transition() && !module.has.direction())
547
- ? module.get.direction() + ' '
548
- : ''
549
- ;
550
- return className.animating + ' '
551
- + className.transition + ' '
552
- + directionClass
553
- + animationClass
554
- ;
555
- },
556
- currentAnimation: function() {
557
- return (module.cache && module.cache.animation !== undefined)
558
- ? module.cache.animation
559
- : false
50
+ moduleNamespace,
51
+ eventNamespace,
52
+ module
560
53
  ;
561
- },
562
- currentDirection: function() {
563
- return module.is.inward()
564
- ? className.inward
565
- : className.outward
566
- ;
567
- },
568
- direction: function() {
569
- return module.is.hidden() || !module.is.visible()
570
- ? className.inward
571
- : className.outward
572
- ;
573
- },
574
- animationDirection: function(animation) {
575
- var
576
- direction
577
- ;
578
- animation = animation || settings.animation;
579
- if(typeof animation === 'string') {
580
- animation = animation.split(' ');
581
- // search animation name for out/in class
582
- $.each(animation, function(index, word){
583
- if(word === className.inward) {
584
- direction = className.inward;
585
- }
586
- else if(word === className.outward) {
587
- direction = className.outward;
588
- }
589
- });
590
- }
591
- // return found direction
592
- if(direction) {
593
- return direction;
594
- }
595
- return false;
596
- },
597
- duration: function(duration) {
598
- duration = duration || settings.duration;
599
- if(duration === false) {
600
- duration = $module.css('animation-duration') || 0;
601
- }
602
- return (typeof duration === 'string')
603
- ? (duration.indexOf('ms') > -1)
604
- ? parseFloat(duration)
605
- : parseFloat(duration) * 1000
606
- : duration
607
- ;
608
- },
609
- displayType: function(shouldDetermine) {
610
- shouldDetermine = (shouldDetermine !== undefined)
611
- ? shouldDetermine
612
- : true
613
- ;
614
- if(settings.displayType) {
615
- return settings.displayType;
616
- }
617
- if(shouldDetermine && $module.data(metadata.displayType) === undefined) {
618
- var currentDisplay = $module.css('display');
619
- if(currentDisplay === '' || currentDisplay === 'none'){
620
- // create fake element to determine display state
621
- module.can.transition(true);
622
- } else {
623
- module.save.displayType(currentDisplay);
624
- }
625
- }
626
- return $module.data(metadata.displayType);
627
- },
628
- userStyle: function(style) {
629
- style = style || $module.attr('style') || '';
630
- return style.replace(/display.*?;/, '');
631
- },
632
- transitionExists: function(animation) {
633
- return $.fn.transition.exists[animation];
634
- },
635
- animationStartEvent: function() {
636
- var
637
- element = document.createElement('div'),
638
- animations = {
639
- 'animation' :'animationstart',
640
- 'OAnimation' :'oAnimationStart',
641
- 'MozAnimation' :'mozAnimationStart',
642
- 'WebkitAnimation' :'webkitAnimationStart'
643
- },
644
- animation
645
- ;
646
- for(animation in animations){
647
- if( element.style[animation] !== undefined ){
648
- return animations[animation];
649
- }
650
- }
651
- return false;
652
- },
653
- animationEndEvent: function() {
654
- var
655
- element = document.createElement('div'),
656
- animations = {
657
- 'animation' :'animationend',
658
- 'OAnimation' :'oAnimationEnd',
659
- 'MozAnimation' :'mozAnimationEnd',
660
- 'WebkitAnimation' :'webkitAnimationEnd'
661
- },
662
- animation
663
- ;
664
- for(animation in animations){
665
- if( element.style[animation] !== undefined ){
666
- return animations[animation];
667
- }
668
- }
669
- return false;
670
- }
671
54
 
55
+ module = {
56
+
57
+ initialize: function () {
58
+ // get full settings
59
+ settings = module.get.settings.apply(element, moduleArguments);
60
+
61
+ // shorthand
62
+ className = settings.className;
63
+ error = settings.error;
64
+ metadata = settings.metadata;
65
+
66
+ // define namespace
67
+ eventNamespace = '.' + settings.namespace;
68
+ moduleNamespace = 'module-' + settings.namespace;
69
+ instance = $module.data(moduleNamespace) || module;
70
+
71
+ if (methodInvoked) {
72
+ methodInvoked = module.invoke(query);
73
+ }
74
+
75
+ // method not invoked, lets run an animation
76
+ if (methodInvoked === false) {
77
+ module.verbose('Converted arguments into settings object', settings);
78
+ if (settings.interval) {
79
+ module.delay(settings.interval);
80
+ } else {
81
+ module.animate();
82
+ }
83
+ module.instantiate();
84
+ }
85
+ },
86
+
87
+ instantiate: function () {
88
+ module.verbose('Storing instance of module', module);
89
+ instance = module;
90
+ $module
91
+ .data(moduleNamespace, instance)
92
+ ;
93
+ },
94
+
95
+ destroy: function () {
96
+ module.verbose('Destroying previous module for', element);
97
+ $module
98
+ .removeData(moduleNamespace)
99
+ ;
100
+ },
101
+
102
+ refresh: function () {
103
+ module.verbose('Refreshing display type on next animation');
104
+ delete module.displayType;
105
+ },
106
+
107
+ forceRepaint: function () {
108
+ module.verbose('Forcing element repaint');
109
+ var
110
+ $parentElement = $module.parent(),
111
+ $nextElement = $module.next()
112
+ ;
113
+ if ($nextElement.length === 0) {
114
+ $module.detach().appendTo($parentElement);
115
+ } else {
116
+ $module.detach().insertBefore($nextElement);
117
+ }
118
+ },
119
+
120
+ repaint: function () {
121
+ module.verbose('Repainting element');
122
+ var
123
+ fakeAssignment = element.offsetWidth
124
+ ;
125
+ },
126
+
127
+ delay: function (interval) {
128
+ var
129
+ direction = module.get.animationDirection(),
130
+ shouldReverse,
131
+ delay
132
+ ;
133
+ if (!direction) {
134
+ direction = module.can.transition()
135
+ ? module.get.direction()
136
+ : 'static';
137
+ }
138
+ interval = interval !== undefined
139
+ ? interval
140
+ : settings.interval;
141
+ shouldReverse = settings.reverse === 'auto' && direction === className.outward;
142
+ delay = shouldReverse || settings.reverse === true
143
+ ? ($allModules.length - index) * interval
144
+ : index * interval;
145
+ module.debug('Delaying animation by', delay);
146
+ setTimeout(module.animate, delay);
147
+ },
148
+
149
+ animate: function (overrideSettings) {
150
+ settings = overrideSettings || settings;
151
+
152
+ module.debug('Preparing animation', settings.animation);
153
+ if (module.is.animating()) {
154
+ if (settings.queue) {
155
+ if (!settings.allowRepeats && module.has.direction() && module.is.occurring() && module.queuing !== true) {
156
+ module.debug('Animation is currently occurring, preventing queueing same animation', settings.animation);
157
+ } else {
158
+ module.queue(settings.animation);
159
+ }
160
+
161
+ return false;
162
+ }
163
+ if (!settings.allowRepeats && module.is.occurring()) {
164
+ module.debug('Animation is already occurring, will not execute repeated animation', settings.animation);
165
+
166
+ return false;
167
+ }
168
+
169
+ module.debug('New animation started, completing previous early', settings.animation);
170
+ instance.complete();
171
+ }
172
+ if (module.can.animate()) {
173
+ module.set.animating(settings.animation);
174
+ } else {
175
+ module.error(error.noAnimation, settings.animation, element);
176
+ }
177
+ },
178
+
179
+ reset: function () {
180
+ module.debug('Resetting animation to beginning conditions');
181
+ module.remove.animationCallbacks();
182
+ module.restore.conditions();
183
+ module.remove.animating();
184
+ },
185
+
186
+ queue: function (animation) {
187
+ module.debug('Queueing animation of', animation);
188
+ module.queuing = true;
189
+ $module
190
+ .one('animationend.queue' + eventNamespace, function () {
191
+ module.queuing = false;
192
+ module.repaint();
193
+ module.animate.apply(this, settings);
194
+ })
195
+ ;
196
+ },
197
+
198
+ complete: function (event) {
199
+ if (event && event.target === element) {
200
+ event.stopPropagation();
201
+ }
202
+ module.debug('Animation complete', settings.animation);
203
+ module.remove.completeCallback();
204
+ module.remove.failSafe();
205
+ if (!module.is.looping()) {
206
+ if (module.is.outward()) {
207
+ module.verbose('Animation is outward, hiding element');
208
+ module.restore.conditions();
209
+ module.hide();
210
+ } else if (module.is.inward()) {
211
+ module.verbose('Animation is inward, showing element');
212
+ module.restore.conditions();
213
+ module.show();
214
+ } else {
215
+ module.verbose('Static animation completed');
216
+ module.restore.conditions();
217
+ settings.onComplete.call(element);
218
+ }
219
+ }
220
+ },
221
+
222
+ force: {
223
+ visible: function () {
224
+ var
225
+ style = $module.attr('style'),
226
+ userStyle = module.get.userStyle(style),
227
+ displayType = module.get.displayType(),
228
+ overrideStyle = userStyle + 'display: ' + displayType + ' !important;',
229
+ inlineDisplay = $module[0].style.display,
230
+ mustStayHidden = !displayType || (inlineDisplay === 'none' && settings.skipInlineHidden) || $module[0].tagName.match(/(script|link|style)/i)
231
+ ;
232
+ if (mustStayHidden) {
233
+ module.remove.transition();
234
+
235
+ return false;
236
+ }
237
+ module.verbose('Overriding default display to show element', displayType);
238
+ $module
239
+ .attr('style', overrideStyle)
240
+ ;
241
+
242
+ return true;
243
+ },
244
+ hidden: function () {
245
+ var
246
+ style = $module.attr('style'),
247
+ currentDisplay = $module.css('display'),
248
+ emptyStyle = style === undefined || style === ''
249
+ ;
250
+ if (currentDisplay !== 'none' && !module.is.hidden()) {
251
+ module.verbose('Overriding default display to hide element');
252
+ $module
253
+ .css('display', 'none')
254
+ ;
255
+ } else if (emptyStyle) {
256
+ $module
257
+ .removeAttr('style')
258
+ ;
259
+ }
260
+ },
261
+ },
262
+
263
+ has: {
264
+ direction: function (animation) {
265
+ var
266
+ hasDirection = false
267
+ ;
268
+ animation = animation || settings.animation;
269
+ if (typeof animation === 'string') {
270
+ animation = animation.split(' ');
271
+ $.each(animation, function (index, word) {
272
+ if (word === className.inward || word === className.outward) {
273
+ hasDirection = true;
274
+ }
275
+ });
276
+ }
277
+
278
+ return hasDirection;
279
+ },
280
+ inlineDisplay: function () {
281
+ var
282
+ style = $module.attr('style') || ''
283
+ ;
284
+
285
+ return Array.isArray(style.match(/display.*?;/, ''));
286
+ },
287
+ },
288
+
289
+ set: {
290
+ animating: function (animation) {
291
+ // remove previous callbacks
292
+ module.remove.completeCallback();
293
+
294
+ // determine exact animation
295
+ animation = animation || settings.animation;
296
+ var animationClass = module.get.animationClass(animation);
297
+
298
+ // save animation class in cache to restore class names
299
+ module.save.animation(animationClass);
300
+
301
+ if (module.force.visible()) {
302
+ module.remove.hidden();
303
+ module.remove.direction();
304
+
305
+ module.start.animation(animationClass);
306
+ }
307
+ },
308
+ duration: function (animationName, duration) {
309
+ duration = duration || settings.duration;
310
+ duration = typeof duration === 'number'
311
+ ? duration + 'ms'
312
+ : duration;
313
+ if (duration || duration === 0) {
314
+ module.verbose('Setting animation duration', duration);
315
+ $module
316
+ .css({
317
+ 'animation-duration': duration,
318
+ })
319
+ ;
320
+ }
321
+ },
322
+ direction: function (direction) {
323
+ direction = direction || module.get.direction();
324
+ if (direction === className.inward) {
325
+ module.set.inward();
326
+ } else {
327
+ module.set.outward();
328
+ }
329
+ },
330
+ looping: function () {
331
+ module.debug('Transition set to loop');
332
+ $module
333
+ .addClass(className.looping)
334
+ ;
335
+ },
336
+ hidden: function () {
337
+ $module
338
+ .addClass(className.transition)
339
+ .addClass(className.hidden)
340
+ ;
341
+ },
342
+ inward: function () {
343
+ module.debug('Setting direction to inward');
344
+ $module
345
+ .removeClass(className.outward)
346
+ .addClass(className.inward)
347
+ ;
348
+ },
349
+ outward: function () {
350
+ module.debug('Setting direction to outward');
351
+ $module
352
+ .removeClass(className.inward)
353
+ .addClass(className.outward)
354
+ ;
355
+ },
356
+ visible: function () {
357
+ $module
358
+ .addClass(className.transition)
359
+ .addClass(className.visible)
360
+ ;
361
+ },
362
+ },
363
+
364
+ start: {
365
+ animation: function (animationClass) {
366
+ animationClass = animationClass || module.get.animationClass();
367
+ module.debug('Starting tween', animationClass);
368
+ $module
369
+ .addClass(animationClass)
370
+ .one('animationend.complete' + eventNamespace, module.complete)
371
+ ;
372
+ if (settings.useFailSafe) {
373
+ module.add.failSafe();
374
+ }
375
+ module.set.duration(settings.duration);
376
+ settings.onStart.call(element);
377
+ },
378
+ },
379
+
380
+ save: {
381
+ animation: function (animation) {
382
+ if (!module.cache) {
383
+ module.cache = {};
384
+ }
385
+ module.cache.animation = animation;
386
+ },
387
+ displayType: function (displayType) {
388
+ if (displayType !== 'none') {
389
+ $module.data(metadata.displayType, displayType);
390
+ }
391
+ },
392
+ transitionExists: function (animation, exists) {
393
+ $.fn.transition.exists[animation] = exists;
394
+ module.verbose('Saving existence of transition', animation, exists);
395
+ },
396
+ },
397
+
398
+ restore: {
399
+ conditions: function () {
400
+ var
401
+ animation = module.get.currentAnimation()
402
+ ;
403
+ if (animation) {
404
+ $module
405
+ .removeClass(animation)
406
+ ;
407
+ module.verbose('Removing animation class', module.cache);
408
+ }
409
+ module.remove.duration();
410
+ },
411
+ },
412
+
413
+ add: {
414
+ failSafe: function () {
415
+ var
416
+ duration = module.get.duration()
417
+ ;
418
+ module.timer = setTimeout(function () {
419
+ $module.triggerHandler('animationend');
420
+ }, duration + settings.failSafeDelay);
421
+ module.verbose('Adding fail safe timer', module.timer);
422
+ },
423
+ },
424
+
425
+ remove: {
426
+ animating: function () {
427
+ $module.removeClass(className.animating);
428
+ },
429
+ animationCallbacks: function () {
430
+ module.remove.queueCallback();
431
+ module.remove.completeCallback();
432
+ },
433
+ queueCallback: function () {
434
+ $module.off('.queue' + eventNamespace);
435
+ },
436
+ completeCallback: function () {
437
+ $module.off('.complete' + eventNamespace);
438
+ },
439
+ display: function () {
440
+ $module.css('display', '');
441
+ },
442
+ direction: function () {
443
+ $module
444
+ .removeClass(className.inward)
445
+ .removeClass(className.outward)
446
+ ;
447
+ },
448
+ duration: function () {
449
+ $module
450
+ .css('animation-duration', '')
451
+ ;
452
+ },
453
+ failSafe: function () {
454
+ module.verbose('Removing fail safe timer', module.timer);
455
+ if (module.timer) {
456
+ clearTimeout(module.timer);
457
+ }
458
+ },
459
+ hidden: function () {
460
+ $module.removeClass(className.hidden);
461
+ },
462
+ visible: function () {
463
+ $module.removeClass(className.visible);
464
+ },
465
+ looping: function () {
466
+ module.debug('Transitions are no longer looping');
467
+ if (module.is.looping()) {
468
+ module.reset();
469
+ $module
470
+ .removeClass(className.looping)
471
+ ;
472
+ }
473
+ },
474
+ transition: function () {
475
+ $module
476
+ .removeClass(className.transition)
477
+ .removeClass(className.visible)
478
+ .removeClass(className.hidden)
479
+ ;
480
+ },
481
+ },
482
+ get: {
483
+ settings: function (animation, duration, onComplete) {
484
+ if (typeof animation === 'object') { // single settings object
485
+ return $.extend(true, {}, $.fn.transition.settings, animation);
486
+ }
487
+ if (typeof onComplete === 'function') { // all arguments provided
488
+ return $.extend({}, $.fn.transition.settings, {
489
+ animation: animation,
490
+ onComplete: onComplete,
491
+ duration: duration,
492
+ });
493
+ }
494
+ if (typeof duration === 'string' || typeof duration === 'number') { // only duration provided
495
+ return $.extend({}, $.fn.transition.settings, {
496
+ animation: animation,
497
+ duration: duration,
498
+ });
499
+ }
500
+ if (typeof duration === 'object') { // duration is actually settings object
501
+ return $.extend({}, $.fn.transition.settings, duration, {
502
+ animation: animation,
503
+ });
504
+ }
505
+ if (typeof duration === 'function') { // duration is actually callback
506
+ return $.extend({}, $.fn.transition.settings, {
507
+ animation: animation,
508
+ onComplete: duration,
509
+ });
510
+ }
511
+
512
+ // only animation provided
513
+ return $.extend({}, $.fn.transition.settings, {
514
+ animation: animation,
515
+ });
516
+ },
517
+ animationClass: function (animation) {
518
+ var
519
+ animationClass = animation || settings.animation,
520
+ directionClass = module.can.transition() && !module.has.direction()
521
+ ? module.get.direction() + ' '
522
+ : ''
523
+ ;
524
+
525
+ return className.animating + ' '
526
+ + className.transition + ' '
527
+ + directionClass
528
+ + animationClass;
529
+ },
530
+ currentAnimation: function () {
531
+ return module.cache && module.cache.animation !== undefined
532
+ ? module.cache.animation
533
+ : false;
534
+ },
535
+ currentDirection: function () {
536
+ return module.is.inward()
537
+ ? className.inward
538
+ : className.outward;
539
+ },
540
+ direction: function () {
541
+ return module.is.hidden() || !module.is.visible()
542
+ ? className.inward
543
+ : className.outward;
544
+ },
545
+ animationDirection: function (animation) {
546
+ var
547
+ direction
548
+ ;
549
+ animation = animation || settings.animation;
550
+ if (typeof animation === 'string') {
551
+ animation = animation.split(' ');
552
+ // search animation name for out/in class
553
+ $.each(animation, function (index, word) {
554
+ if (word === className.inward) {
555
+ direction = className.inward;
556
+ } else if (word === className.outward) {
557
+ direction = className.outward;
558
+ }
559
+ });
560
+ }
561
+ // return found direction
562
+ if (direction) {
563
+ return direction;
564
+ }
565
+
566
+ return false;
567
+ },
568
+ duration: function (duration) {
569
+ duration = duration || settings.duration;
570
+ if (duration === false) {
571
+ duration = $module.css('animation-duration') || 0;
572
+ }
573
+
574
+ return typeof duration === 'string'
575
+ ? (duration.indexOf('ms') > -1
576
+ ? parseFloat(duration)
577
+ : parseFloat(duration) * 1000)
578
+ : duration;
579
+ },
580
+ displayType: function (shouldDetermine) {
581
+ shouldDetermine = shouldDetermine !== undefined
582
+ ? shouldDetermine
583
+ : true;
584
+ if (settings.displayType) {
585
+ return settings.displayType;
586
+ }
587
+ if (shouldDetermine && $module.data(metadata.displayType) === undefined) {
588
+ var currentDisplay = $module.css('display');
589
+ if (currentDisplay === '' || currentDisplay === 'none') {
590
+ // create fake element to determine display state
591
+ module.can.transition(true);
592
+ } else {
593
+ module.save.displayType(currentDisplay);
594
+ }
595
+ }
596
+
597
+ return $module.data(metadata.displayType);
598
+ },
599
+ userStyle: function (style) {
600
+ style = style || $module.attr('style') || '';
601
+
602
+ return style.replace(/display.*?;/, '');
603
+ },
604
+ transitionExists: function (animation) {
605
+ return $.fn.transition.exists[animation];
606
+ },
607
+ },
608
+
609
+ can: {
610
+ transition: function (forced) {
611
+ var
612
+ animation = settings.animation,
613
+ transitionExists = module.get.transitionExists(animation),
614
+ displayType = module.get.displayType(false),
615
+ elementClass,
616
+ tagName,
617
+ $clone,
618
+ currentAnimation,
619
+ inAnimation,
620
+ directionExists
621
+ ;
622
+ if (transitionExists === undefined || forced) {
623
+ module.verbose('Determining whether animation exists');
624
+ elementClass = $module.attr('class');
625
+ tagName = $module.prop('tagName');
626
+
627
+ $clone = $('<' + tagName + ' />').addClass(elementClass).insertAfter($module);
628
+ currentAnimation = $clone
629
+ .addClass(animation)
630
+ .removeClass(className.inward)
631
+ .removeClass(className.outward)
632
+ .addClass(className.animating)
633
+ .addClass(className.transition)
634
+ .css('animationName')
635
+ ;
636
+ $clone.detach().insertAfter($module);
637
+ inAnimation = $clone
638
+ .addClass(className.inward)
639
+ .css('animationName')
640
+ ;
641
+ if (!displayType) {
642
+ $clone.detach().insertAfter($module);
643
+ displayType = $clone
644
+ .attr('class', elementClass)
645
+ .removeAttr('style')
646
+ .removeClass(className.hidden)
647
+ .removeClass(className.visible)
648
+ .show()
649
+ .css('display')
650
+ ;
651
+ module.verbose('Determining final display state', displayType);
652
+ module.save.displayType(displayType);
653
+ }
654
+
655
+ $clone.remove();
656
+ if (currentAnimation !== inAnimation) {
657
+ module.debug('Direction exists for animation', animation);
658
+ directionExists = true;
659
+ } else if (currentAnimation === 'none' || !currentAnimation) {
660
+ module.debug('No animation defined in css', animation);
661
+
662
+ return;
663
+ } else {
664
+ module.debug('Static animation found', animation, displayType);
665
+ directionExists = false;
666
+ }
667
+ module.save.transitionExists(animation, directionExists);
668
+ }
669
+
670
+ return transitionExists !== undefined
671
+ ? transitionExists
672
+ : directionExists;
673
+ },
674
+ animate: function () {
675
+ // can transition does not return a value if animation does not exist
676
+ return module.can.transition() !== undefined;
677
+ },
678
+ },
679
+
680
+ is: {
681
+ animating: function () {
682
+ return $module.hasClass(className.animating);
683
+ },
684
+ inward: function () {
685
+ return $module.hasClass(className.inward);
686
+ },
687
+ outward: function () {
688
+ return $module.hasClass(className.outward);
689
+ },
690
+ looping: function () {
691
+ return $module.hasClass(className.looping);
692
+ },
693
+ occurring: function (animation) {
694
+ animation = animation || settings.animation;
695
+ animation = '.' + animation.replace(' ', '.');
696
+
697
+ return $module.filter(animation).length > 0;
698
+ },
699
+ visible: function () {
700
+ return $module.is(':visible');
701
+ },
702
+ hidden: function () {
703
+ return $module.css('visibility') === 'hidden';
704
+ },
705
+ supported: function () {
706
+ // keep method for backward compatibility until 2.10.0
707
+ return true;
708
+ },
709
+ },
710
+
711
+ hide: function () {
712
+ if (settings.onHide.call(element) === false) {
713
+ module.verbose('Hide callback returned false cancelling hide');
714
+
715
+ return false;
716
+ }
717
+ module.verbose('Hiding element');
718
+ if (module.is.animating()) {
719
+ module.reset();
720
+ }
721
+ element.blur(); // IE will trigger focus change if element is not blurred before hiding
722
+ module.remove.display();
723
+ module.remove.visible();
724
+ settings.onBeforeHide.call(element, module.hideNow);
725
+ },
726
+
727
+ hideNow: function () {
728
+ module.set.hidden();
729
+ module.force.hidden();
730
+ settings.onHidden.call(element);
731
+ settings.onComplete.call(element);
732
+ },
733
+
734
+ show: function (display) {
735
+ if (module.force.visible() && settings.onShow.call(element) !== false) {
736
+ module.verbose('Showing element', display);
737
+ module.remove.hidden();
738
+ settings.onBeforeShow.call(element, module.showNow);
739
+ }
740
+ },
741
+
742
+ showNow: function () {
743
+ module.set.visible();
744
+ settings.onVisible.call(element);
745
+ settings.onComplete.call(element);
746
+ },
747
+
748
+ toggle: function () {
749
+ if (module.is.visible()) {
750
+ module.hide();
751
+ } else {
752
+ module.show();
753
+ }
754
+ },
755
+
756
+ stop: function () {
757
+ module.debug('Stopping current animation');
758
+ $module.triggerHandler('animationend');
759
+ },
760
+
761
+ stopAll: function () {
762
+ module.debug('Stopping all animation');
763
+ module.remove.queueCallback();
764
+ $module.triggerHandler('animationend');
765
+ },
766
+
767
+ clear: {
768
+ queue: function () {
769
+ module.debug('Clearing animation queue');
770
+ module.remove.queueCallback();
771
+ },
772
+ },
773
+
774
+ enable: function () {
775
+ module.verbose('Starting animation');
776
+ $module.removeClass(className.disabled);
777
+ },
778
+
779
+ disable: function () {
780
+ module.debug('Stopping animation');
781
+ $module.addClass(className.disabled);
782
+ },
783
+
784
+ setting: function (name, value) {
785
+ module.debug('Changing setting', name, value);
786
+ if ($.isPlainObject(name)) {
787
+ $.extend(true, settings, name);
788
+ } else if (value !== undefined) {
789
+ if ($.isPlainObject(settings[name])) {
790
+ $.extend(true, settings[name], value);
791
+ } else {
792
+ settings[name] = value;
793
+ }
794
+ } else {
795
+ return settings[name];
796
+ }
797
+ },
798
+ internal: function (name, value) {
799
+ if ($.isPlainObject(name)) {
800
+ $.extend(true, module, name);
801
+ } else if (value !== undefined) {
802
+ module[name] = value;
803
+ } else {
804
+ return module[name];
805
+ }
806
+ },
807
+ debug: function () {
808
+ if (!settings.silent && settings.debug) {
809
+ if (settings.performance) {
810
+ module.performance.log(arguments);
811
+ } else {
812
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
813
+ module.debug.apply(console, arguments);
814
+ }
815
+ }
816
+ },
817
+ verbose: function () {
818
+ if (!settings.silent && settings.verbose && settings.debug) {
819
+ if (settings.performance) {
820
+ module.performance.log(arguments);
821
+ } else {
822
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
823
+ module.verbose.apply(console, arguments);
824
+ }
825
+ }
826
+ },
827
+ error: function () {
828
+ if (!settings.silent) {
829
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
830
+ module.error.apply(console, arguments);
831
+ }
832
+ },
833
+ performance: {
834
+ log: function (message) {
835
+ var
836
+ currentTime,
837
+ executionTime,
838
+ previousTime
839
+ ;
840
+ if (settings.performance) {
841
+ currentTime = Date.now();
842
+ previousTime = time || currentTime;
843
+ executionTime = currentTime - previousTime;
844
+ time = currentTime;
845
+ performance.push({
846
+ Name: message[0],
847
+ Arguments: [].slice.call(message, 1) || '',
848
+ Element: element,
849
+ 'Execution Time': executionTime,
850
+ });
851
+ }
852
+ clearTimeout(module.performance.timer);
853
+ module.performance.timer = setTimeout(module.performance.display, 500);
854
+ },
855
+ display: function () {
856
+ var
857
+ title = settings.name + ':',
858
+ totalTime = 0
859
+ ;
860
+ time = false;
861
+ clearTimeout(module.performance.timer);
862
+ $.each(performance, function (index, data) {
863
+ totalTime += data['Execution Time'];
864
+ });
865
+ title += ' ' + totalTime + 'ms';
866
+ if (moduleSelector) {
867
+ title += ' \'' + moduleSelector + '\'';
868
+ }
869
+ if ($allModules.length > 1) {
870
+ title += ' (' + $allModules.length + ')';
871
+ }
872
+ if (performance.length > 0) {
873
+ console.groupCollapsed(title);
874
+ if (console.table) {
875
+ console.table(performance);
876
+ } else {
877
+ $.each(performance, function (index, data) {
878
+ console.log(data.Name + ': ' + data['Execution Time'] + 'ms');
879
+ });
880
+ }
881
+ console.groupEnd();
882
+ }
883
+ performance = [];
884
+ },
885
+ },
886
+ // modified for transition to return invoke success
887
+ invoke: function (query, passedArguments, context) {
888
+ var
889
+ object = instance,
890
+ maxDepth,
891
+ found,
892
+ response
893
+ ;
894
+ passedArguments = passedArguments || queryArguments;
895
+ context = context || element;
896
+ if (typeof query === 'string' && object !== undefined) {
897
+ query = query.split(/[ .]/);
898
+ maxDepth = query.length - 1;
899
+ $.each(query, function (depth, value) {
900
+ var camelCaseValue = depth !== maxDepth
901
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
902
+ : query;
903
+ if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
904
+ object = object[camelCaseValue];
905
+ } else if (object[camelCaseValue] !== undefined) {
906
+ found = object[camelCaseValue];
907
+
908
+ return false;
909
+ } else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
910
+ object = object[value];
911
+ } else if (object[value] !== undefined) {
912
+ found = object[value];
913
+
914
+ return false;
915
+ } else {
916
+ return false;
917
+ }
918
+ });
919
+ }
920
+ if (isFunction(found)) {
921
+ response = found.apply(context, passedArguments);
922
+ } else if (found !== undefined) {
923
+ response = found;
924
+ }
925
+
926
+ if (Array.isArray(returnedValue)) {
927
+ returnedValue.push(response);
928
+ } else if (returnedValue !== undefined) {
929
+ returnedValue = [returnedValue, response];
930
+ } else if (response !== undefined) {
931
+ returnedValue = response;
932
+ }
933
+
934
+ return found !== undefined
935
+ ? found
936
+ : false;
937
+ },
938
+ };
939
+ module.initialize();
940
+ });
941
+
942
+ return returnedValue !== undefined
943
+ ? returnedValue
944
+ : this;
945
+ };
946
+
947
+ // Records if CSS transition is available
948
+ $.fn.transition.exists = {};
949
+
950
+ $.fn.transition.settings = {
951
+
952
+ // module info
953
+ name: 'Transition',
954
+
955
+ // hide all output from this component regardless of other settings
956
+ silent: false,
957
+
958
+ // debug content outputted to console
959
+ debug: false,
960
+
961
+ // verbose debug output
962
+ verbose: false,
963
+
964
+ // performance data output
965
+ performance: true,
966
+
967
+ // event namespace
968
+ namespace: 'transition',
969
+
970
+ // delay between animations in group
971
+ interval: 0,
972
+
973
+ // whether group animations should be reversed
974
+ reverse: 'auto',
975
+
976
+ // animation callback event
977
+ onStart: function () {},
978
+ onComplete: function () {},
979
+ onShow: function () {},
980
+ onBeforeShow: function (callback) {
981
+ callback.call(this);
672
982
  },
673
-
674
- can: {
675
- transition: function(forced) {
676
- var
677
- animation = settings.animation,
678
- transitionExists = module.get.transitionExists(animation),
679
- displayType = module.get.displayType(false),
680
- elementClass,
681
- tagName,
682
- $clone,
683
- currentAnimation,
684
- inAnimation,
685
- directionExists
686
- ;
687
- if( transitionExists === undefined || forced) {
688
- module.verbose('Determining whether animation exists');
689
- elementClass = $module.attr('class');
690
- tagName = $module.prop('tagName');
691
-
692
- $clone = $('<' + tagName + ' />').addClass( elementClass ).insertAfter($module);
693
- currentAnimation = $clone
694
- .addClass(animation)
695
- .removeClass(className.inward)
696
- .removeClass(className.outward)
697
- .addClass(className.animating)
698
- .addClass(className.transition)
699
- .css('animationName')
700
- ;
701
- inAnimation = $clone
702
- .addClass(className.inward)
703
- .css('animationName')
704
- ;
705
- if(!displayType) {
706
- displayType = $clone
707
- .attr('class', elementClass)
708
- .removeAttr('style')
709
- .removeClass(className.hidden)
710
- .removeClass(className.visible)
711
- .show()
712
- .css('display')
713
- ;
714
- module.verbose('Determining final display state', displayType);
715
- module.save.displayType(displayType);
716
- }
717
-
718
- $clone.remove();
719
- if(currentAnimation != inAnimation) {
720
- module.debug('Direction exists for animation', animation);
721
- directionExists = true;
722
- }
723
- else if(currentAnimation == 'none' || !currentAnimation) {
724
- module.debug('No animation defined in css', animation);
725
- return;
726
- }
727
- else {
728
- module.debug('Static animation found', animation, displayType);
729
- directionExists = false;
730
- }
731
- module.save.transitionExists(animation, directionExists);
732
- }
733
- return (transitionExists !== undefined)
734
- ? transitionExists
735
- : directionExists
736
- ;
737
- },
738
- animate: function() {
739
- // can transition does not return a value if animation does not exist
740
- return (module.can.transition() !== undefined);
741
- }
983
+ onVisible: function () {},
984
+ onHide: function () {},
985
+ onHidden: function () {},
986
+ onBeforeHide: function (callback) {
987
+ callback.call(this);
742
988
  },
743
989
 
744
- is: {
745
- animating: function() {
746
- return $module.hasClass(className.animating);
747
- },
748
- inward: function() {
749
- return $module.hasClass(className.inward);
750
- },
751
- outward: function() {
752
- return $module.hasClass(className.outward);
753
- },
754
- looping: function() {
755
- return $module.hasClass(className.looping);
756
- },
757
- occurring: function(animation) {
758
- animation = animation || settings.animation;
759
- animation = '.' + animation.replace(' ', '.');
760
- return ( $module.filter(animation).length > 0 );
761
- },
762
- visible: function() {
763
- return $module.is(':visible');
764
- },
765
- hidden: function() {
766
- return $module.css('visibility') === 'hidden';
767
- },
768
- supported: function() {
769
- return(animationEnd !== false);
770
- }
771
- },
990
+ // whether timeout should be used to ensure callback fires in cases animationend does not
991
+ useFailSafe: true,
772
992
 
773
- hide: function() {
774
- module.verbose('Hiding element');
775
- if( module.is.animating() ) {
776
- module.reset();
777
- }
778
- element.blur(); // IE will trigger focus change if element is not blurred before hiding
779
- module.remove.display();
780
- module.remove.visible();
781
- if($.isFunction(settings.onBeforeHide)){
782
- settings.onBeforeHide.call(element,function(){
783
- module.hideNow();
784
- });
785
- } else {
786
- module.hideNow();
787
- }
993
+ // delay in ms for fail safe
994
+ failSafeDelay: 100,
788
995
 
789
- },
996
+ // whether EXACT animation can occur twice in a row
997
+ allowRepeats: false,
790
998
 
791
- hideNow: function() {
792
- module.set.hidden();
793
- module.force.hidden();
794
- settings.onHide.call(element);
795
- settings.onComplete.call(element);
796
- // module.repaint();
797
- },
999
+ // Override final display type on visible
1000
+ displayType: false,
798
1001
 
799
- show: function(display) {
800
- module.verbose('Showing element', display);
801
- if(module.force.visible()) {
802
- module.remove.hidden();
803
- module.set.visible();
804
- settings.onShow.call(element);
805
- settings.onComplete.call(element);
806
- // module.repaint();
807
- }
808
- },
1002
+ // animation duration
1003
+ animation: 'fade',
1004
+ duration: false,
809
1005
 
810
- toggle: function() {
811
- if( module.is.visible() ) {
812
- module.hide();
813
- }
814
- else {
815
- module.show();
816
- }
817
- },
1006
+ // new animations will occur after previous ones
1007
+ queue: true,
818
1008
 
819
- stop: function() {
820
- module.debug('Stopping current animation');
821
- $module.triggerHandler(animationEnd);
822
- },
823
-
824
- stopAll: function() {
825
- module.debug('Stopping all animation');
826
- module.remove.queueCallback();
827
- $module.triggerHandler(animationEnd);
828
- },
1009
+ // whether initially inline hidden objects should be skipped for transition
1010
+ skipInlineHidden: false,
829
1011
 
830
- clear: {
831
- queue: function() {
832
- module.debug('Clearing animation queue');
833
- module.remove.queueCallback();
834
- }
1012
+ metadata: {
1013
+ displayType: 'display',
835
1014
  },
836
1015
 
837
- enable: function() {
838
- module.verbose('Starting animation');
839
- $module.removeClass(className.disabled);
1016
+ className: {
1017
+ animating: 'animating',
1018
+ disabled: 'disabled',
1019
+ hidden: 'hidden',
1020
+ inward: 'in',
1021
+ loading: 'loading',
1022
+ looping: 'looping',
1023
+ outward: 'out',
1024
+ transition: 'transition',
1025
+ visible: 'visible',
840
1026
  },
841
1027
 
842
- disable: function() {
843
- module.debug('Stopping animation');
844
- $module.addClass(className.disabled);
1028
+ // possible errors
1029
+ error: {
1030
+ noAnimation: 'Element is no longer attached to DOM. Unable to animate. Use silent setting to suppress this warning in production.',
845
1031
  },
846
1032
 
847
- setting: function(name, value) {
848
- module.debug('Changing setting', name, value);
849
- if( $.isPlainObject(name) ) {
850
- $.extend(true, settings, name);
851
- }
852
- else if(value !== undefined) {
853
- if($.isPlainObject(settings[name])) {
854
- $.extend(true, settings[name], value);
855
- }
856
- else {
857
- settings[name] = value;
858
- }
859
- }
860
- else {
861
- return settings[name];
862
- }
863
- },
864
- internal: function(name, value) {
865
- if( $.isPlainObject(name) ) {
866
- $.extend(true, module, name);
867
- }
868
- else if(value !== undefined) {
869
- module[name] = value;
870
- }
871
- else {
872
- return module[name];
873
- }
874
- },
875
- debug: function() {
876
- if(!settings.silent && settings.debug) {
877
- if(settings.performance) {
878
- module.performance.log(arguments);
879
- }
880
- else {
881
- module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
882
- module.debug.apply(console, arguments);
883
- }
884
- }
885
- },
886
- verbose: function() {
887
- if(!settings.silent && settings.verbose && settings.debug) {
888
- if(settings.performance) {
889
- module.performance.log(arguments);
890
- }
891
- else {
892
- module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
893
- module.verbose.apply(console, arguments);
894
- }
895
- }
896
- },
897
- error: function() {
898
- if(!settings.silent) {
899
- module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
900
- module.error.apply(console, arguments);
901
- }
902
- },
903
- performance: {
904
- log: function(message) {
905
- var
906
- currentTime,
907
- executionTime,
908
- previousTime
909
- ;
910
- if(settings.performance) {
911
- currentTime = new Date().getTime();
912
- previousTime = time || currentTime;
913
- executionTime = currentTime - previousTime;
914
- time = currentTime;
915
- performance.push({
916
- 'Name' : message[0],
917
- 'Arguments' : [].slice.call(message, 1) || '',
918
- 'Element' : element,
919
- 'Execution Time' : executionTime
920
- });
921
- }
922
- clearTimeout(module.performance.timer);
923
- module.performance.timer = setTimeout(module.performance.display, 500);
924
- },
925
- display: function() {
926
- var
927
- title = settings.name + ':',
928
- totalTime = 0
929
- ;
930
- time = false;
931
- clearTimeout(module.performance.timer);
932
- $.each(performance, function(index, data) {
933
- totalTime += data['Execution Time'];
934
- });
935
- title += ' ' + totalTime + 'ms';
936
- if(moduleSelector) {
937
- title += ' \'' + moduleSelector + '\'';
938
- }
939
- if($allModules.length > 1) {
940
- title += ' ' + '(' + $allModules.length + ')';
941
- }
942
- if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
943
- console.groupCollapsed(title);
944
- if(console.table) {
945
- console.table(performance);
946
- }
947
- else {
948
- $.each(performance, function(index, data) {
949
- console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
950
- });
951
- }
952
- console.groupEnd();
953
- }
954
- performance = [];
955
- }
956
- },
957
- // modified for transition to return invoke success
958
- invoke: function(query, passedArguments, context) {
959
- var
960
- object = instance,
961
- maxDepth,
962
- found,
963
- response
964
- ;
965
- passedArguments = passedArguments || queryArguments;
966
- context = element || context;
967
- if(typeof query == 'string' && object !== undefined) {
968
- query = query.split(/[\. ]/);
969
- maxDepth = query.length - 1;
970
- $.each(query, function(depth, value) {
971
- var camelCaseValue = (depth != maxDepth)
972
- ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
973
- : query
974
- ;
975
- if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
976
- object = object[camelCaseValue];
977
- }
978
- else if( object[camelCaseValue] !== undefined ) {
979
- found = object[camelCaseValue];
980
- return false;
981
- }
982
- else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
983
- object = object[value];
984
- }
985
- else if( object[value] !== undefined ) {
986
- found = object[value];
987
- return false;
988
- }
989
- else {
990
- return false;
991
- }
992
- });
993
- }
994
- if ( $.isFunction( found ) ) {
995
- response = found.apply(context, passedArguments);
996
- }
997
- else if(found !== undefined) {
998
- response = found;
999
- }
1000
-
1001
- if(Array.isArray(returnedValue)) {
1002
- returnedValue.push(response);
1003
- }
1004
- else if(returnedValue !== undefined) {
1005
- returnedValue = [returnedValue, response];
1006
- }
1007
- else if(response !== undefined) {
1008
- returnedValue = response;
1009
- }
1010
- return (found !== undefined)
1011
- ? found
1012
- : false
1013
- ;
1014
- }
1015
- };
1016
- module.initialize();
1017
- })
1018
- ;
1019
- return (returnedValue !== undefined)
1020
- ? returnedValue
1021
- : this
1022
- ;
1023
- };
1024
-
1025
- // Records if CSS transition is available
1026
- $.fn.transition.exists = {};
1027
-
1028
- $.fn.transition.settings = {
1029
-
1030
- // module info
1031
- name : 'Transition',
1032
-
1033
- // hide all output from this component regardless of other settings
1034
- silent : false,
1035
-
1036
- // debug content outputted to console
1037
- debug : false,
1038
-
1039
- // verbose debug output
1040
- verbose : false,
1041
-
1042
- // performance data output
1043
- performance : true,
1044
-
1045
- // event namespace
1046
- namespace : 'transition',
1047
-
1048
- // delay between animations in group
1049
- interval : 0,
1050
-
1051
- // whether group animations should be reversed
1052
- reverse : 'auto',
1053
-
1054
- // animation callback event
1055
- onStart : function() {},
1056
- onComplete : function() {},
1057
- onShow : function() {},
1058
- onHide : function() {},
1059
-
1060
- // whether timeout should be used to ensure callback fires in cases animationend does not
1061
- useFailSafe : true,
1062
-
1063
- // delay in ms for fail safe
1064
- failSafeDelay : 100,
1065
-
1066
- // whether EXACT animation can occur twice in a row
1067
- allowRepeats : false,
1068
-
1069
- // Override final display type on visible
1070
- displayType : false,
1071
-
1072
- // animation duration
1073
- animation : 'fade',
1074
- duration : false,
1075
-
1076
- // new animations will occur after previous ones
1077
- queue : true,
1078
-
1079
- // whether initially inline hidden objects should be skipped for transition
1080
- skipInlineHidden: false,
1081
-
1082
- metadata : {
1083
- displayType: 'display'
1084
- },
1085
-
1086
- className : {
1087
- animating : 'animating',
1088
- disabled : 'disabled',
1089
- hidden : 'hidden',
1090
- inward : 'in',
1091
- loading : 'loading',
1092
- looping : 'looping',
1093
- outward : 'out',
1094
- transition : 'transition',
1095
- visible : 'visible'
1096
- },
1097
-
1098
- // possible errors
1099
- error: {
1100
- noAnimation : 'Element is no longer attached to DOM. Unable to animate. Use silent setting to surpress this warning in production.',
1101
- repeated : 'That animation is already occurring, cancelling repeated animation',
1102
- method : 'The method you called is not defined',
1103
- support : 'This browser does not support CSS animations'
1104
- }
1105
-
1106
- };
1107
-
1108
-
1109
- })( jQuery, window, document );
1033
+ };
1034
+ })(jQuery, window, document);