fomantic-ui 2.9.1-beta.16 → 2.9.1-beta.18

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 (252) hide show
  1. package/.eslintrc.js +109 -0
  2. package/.github/workflows/ci.yml +13 -3
  3. package/dist/components/accordion.css +1 -1
  4. package/dist/components/accordion.js +571 -598
  5. package/dist/components/accordion.min.css +1 -1
  6. package/dist/components/accordion.min.js +1 -1
  7. package/dist/components/ad.css +1 -1
  8. package/dist/components/ad.min.css +1 -1
  9. package/dist/components/api.js +1164 -1186
  10. package/dist/components/api.min.js +1 -1
  11. package/dist/components/breadcrumb.css +1 -1
  12. package/dist/components/breadcrumb.min.css +1 -1
  13. package/dist/components/button.css +1 -1
  14. package/dist/components/button.min.css +1 -1
  15. package/dist/components/calendar.css +1 -1
  16. package/dist/components/calendar.js +1897 -1818
  17. package/dist/components/calendar.min.css +1 -1
  18. package/dist/components/calendar.min.js +1 -1
  19. package/dist/components/card.css +1 -1
  20. package/dist/components/card.min.css +1 -1
  21. package/dist/components/checkbox.css +1 -1
  22. package/dist/components/checkbox.js +844 -841
  23. package/dist/components/checkbox.min.css +1 -1
  24. package/dist/components/checkbox.min.js +1 -1
  25. package/dist/components/comment.css +1 -1
  26. package/dist/components/comment.min.css +1 -1
  27. package/dist/components/container.css +3 -1
  28. package/dist/components/container.min.css +2 -2
  29. package/dist/components/dimmer.css +1 -1
  30. package/dist/components/dimmer.js +710 -737
  31. package/dist/components/dimmer.min.css +1 -1
  32. package/dist/components/dimmer.min.js +1 -1
  33. package/dist/components/divider.css +1 -1
  34. package/dist/components/divider.min.css +1 -1
  35. package/dist/components/dropdown.css +11 -8
  36. package/dist/components/dropdown.js +4163 -4234
  37. package/dist/components/dropdown.min.css +2 -2
  38. package/dist/components/dropdown.min.js +2 -2
  39. package/dist/components/embed.css +1 -1
  40. package/dist/components/embed.js +653 -675
  41. package/dist/components/embed.min.css +1 -1
  42. package/dist/components/embed.min.js +1 -1
  43. package/dist/components/feed.css +1 -1
  44. package/dist/components/feed.min.css +1 -1
  45. package/dist/components/flag.css +1 -1
  46. package/dist/components/flag.min.css +1 -1
  47. package/dist/components/flyout.css +6 -3
  48. package/dist/components/flyout.js +1466 -1467
  49. package/dist/components/flyout.min.css +2 -2
  50. package/dist/components/flyout.min.js +1 -1
  51. package/dist/components/form.css +1 -1
  52. package/dist/components/form.js +1981 -2004
  53. package/dist/components/form.min.css +1 -1
  54. package/dist/components/form.min.js +1 -1
  55. package/dist/components/grid.css +1 -1
  56. package/dist/components/grid.min.css +1 -1
  57. package/dist/components/header.css +1 -1
  58. package/dist/components/header.min.css +1 -1
  59. package/dist/components/icon.css +1 -1
  60. package/dist/components/icon.min.css +1 -1
  61. package/dist/components/image.css +1 -1
  62. package/dist/components/image.min.css +1 -1
  63. package/dist/components/input.css +1 -1
  64. package/dist/components/input.min.css +1 -1
  65. package/dist/components/item.css +1 -1
  66. package/dist/components/item.min.css +1 -1
  67. package/dist/components/label.css +1 -1
  68. package/dist/components/label.min.css +1 -1
  69. package/dist/components/list.css +1 -1
  70. package/dist/components/list.min.css +1 -1
  71. package/dist/components/loader.css +1 -1
  72. package/dist/components/loader.min.css +1 -1
  73. package/dist/components/message.css +1 -1
  74. package/dist/components/message.min.css +1 -1
  75. package/dist/components/modal.css +7 -1
  76. package/dist/components/modal.js +1493 -1487
  77. package/dist/components/modal.min.css +2 -2
  78. package/dist/components/modal.min.js +1 -1
  79. package/dist/components/nag.css +1 -1
  80. package/dist/components/nag.js +520 -529
  81. package/dist/components/nag.min.css +1 -1
  82. package/dist/components/nag.min.js +1 -1
  83. package/dist/components/placeholder.css +1 -1
  84. package/dist/components/placeholder.min.css +1 -1
  85. package/dist/components/popup.css +1 -1
  86. package/dist/components/popup.js +1439 -1456
  87. package/dist/components/popup.min.css +1 -1
  88. package/dist/components/popup.min.js +1 -1
  89. package/dist/components/progress.css +1 -1
  90. package/dist/components/progress.js +971 -997
  91. package/dist/components/progress.min.css +1 -1
  92. package/dist/components/progress.min.js +1 -1
  93. package/dist/components/rail.css +1 -1
  94. package/dist/components/rail.min.css +1 -1
  95. package/dist/components/rating.css +1 -1
  96. package/dist/components/rating.js +508 -524
  97. package/dist/components/rating.min.css +1 -1
  98. package/dist/components/rating.min.js +1 -1
  99. package/dist/components/reset.css +1 -1
  100. package/dist/components/reset.min.css +1 -1
  101. package/dist/components/reveal.css +1 -1
  102. package/dist/components/reveal.min.css +1 -1
  103. package/dist/components/search.css +3 -1
  104. package/dist/components/search.js +1500 -1534
  105. package/dist/components/search.min.css +2 -2
  106. package/dist/components/search.min.js +1 -1
  107. package/dist/components/segment.css +3 -1
  108. package/dist/components/segment.min.css +2 -2
  109. package/dist/components/shape.css +1 -1
  110. package/dist/components/shape.js +794 -809
  111. package/dist/components/shape.min.css +1 -1
  112. package/dist/components/shape.min.js +1 -1
  113. package/dist/components/sidebar.css +3 -1
  114. package/dist/components/sidebar.js +1079 -1104
  115. package/dist/components/sidebar.min.css +2 -2
  116. package/dist/components/sidebar.min.js +1 -1
  117. package/dist/components/site.css +1 -1
  118. package/dist/components/site.js +457 -472
  119. package/dist/components/site.min.css +1 -1
  120. package/dist/components/site.min.js +1 -1
  121. package/dist/components/slider.js +1289 -1311
  122. package/dist/components/slider.min.js +1 -1
  123. package/dist/components/state.js +641 -657
  124. package/dist/components/state.min.js +1 -1
  125. package/dist/components/statistic.css +1 -1
  126. package/dist/components/statistic.min.css +1 -1
  127. package/dist/components/step.css +1 -1
  128. package/dist/components/step.min.css +1 -1
  129. package/dist/components/sticky.css +1 -1
  130. package/dist/components/sticky.js +859 -903
  131. package/dist/components/sticky.min.css +1 -1
  132. package/dist/components/sticky.min.js +1 -1
  133. package/dist/components/tab.css +1 -1
  134. package/dist/components/tab.js +923 -963
  135. package/dist/components/tab.min.css +1 -1
  136. package/dist/components/tab.min.js +1 -1
  137. package/dist/components/table.css +5 -1
  138. package/dist/components/table.min.css +2 -2
  139. package/dist/components/text.css +1 -1
  140. package/dist/components/text.min.css +1 -1
  141. package/dist/components/toast.css +1 -1
  142. package/dist/components/toast.js +889 -891
  143. package/dist/components/toast.min.css +1 -1
  144. package/dist/components/toast.min.js +1 -1
  145. package/dist/components/transition.css +1 -1
  146. package/dist/components/transition.js +1043 -1077
  147. package/dist/components/transition.min.css +1 -1
  148. package/dist/components/transition.min.js +1 -1
  149. package/dist/components/visibility.js +1222 -1244
  150. package/dist/components/visibility.min.js +1 -1
  151. package/dist/semantic.css +84 -60
  152. package/dist/semantic.js +29033 -29475
  153. package/dist/semantic.min.css +2 -2
  154. package/dist/semantic.min.js +2 -2
  155. package/examples/assets/show-examples.js +13 -13
  156. package/gulpfile.js +9 -10
  157. package/package.json +5 -2
  158. package/scripts/nightly-version.js +81 -75
  159. package/src/definitions/behaviors/api.js +1163 -1185
  160. package/src/definitions/behaviors/form.js +1980 -2003
  161. package/src/definitions/behaviors/state.js +647 -663
  162. package/src/definitions/behaviors/visibility.js +1221 -1243
  163. package/src/definitions/collections/table.less +2 -0
  164. package/src/definitions/elements/container.less +1 -0
  165. package/src/definitions/elements/segment.less +1 -0
  166. package/src/definitions/globals/site.js +456 -471
  167. package/src/definitions/modules/accordion.js +570 -597
  168. package/src/definitions/modules/calendar.js +1896 -1817
  169. package/src/definitions/modules/checkbox.js +849 -846
  170. package/src/definitions/modules/dimmer.js +709 -736
  171. package/src/definitions/modules/dropdown.js +4162 -4233
  172. package/src/definitions/modules/dropdown.less +5 -8
  173. package/src/definitions/modules/embed.js +652 -674
  174. package/src/definitions/modules/flyout.js +1465 -1466
  175. package/src/definitions/modules/flyout.less +15 -12
  176. package/src/definitions/modules/modal.js +1492 -1486
  177. package/src/definitions/modules/modal.less +3 -0
  178. package/src/definitions/modules/nag.js +519 -528
  179. package/src/definitions/modules/popup.js +1438 -1455
  180. package/src/definitions/modules/progress.js +970 -996
  181. package/src/definitions/modules/rating.js +507 -523
  182. package/src/definitions/modules/search.js +1499 -1533
  183. package/src/definitions/modules/search.less +1 -0
  184. package/src/definitions/modules/shape.js +801 -816
  185. package/src/definitions/modules/sidebar.js +1078 -1103
  186. package/src/definitions/modules/sidebar.less +1 -0
  187. package/src/definitions/modules/slider.js +1288 -1310
  188. package/src/definitions/modules/sticky.js +875 -919
  189. package/src/definitions/modules/tab.js +922 -962
  190. package/src/definitions/modules/toast.js +888 -890
  191. package/src/definitions/modules/transition.js +1048 -1082
  192. package/src/themes/default/elements/container.variables +0 -7
  193. package/src/themes/default/elements/segment.variables +0 -7
  194. package/src/themes/default/globals/site.variables +7 -0
  195. package/src/themes/default/globals/variation.variables +1 -0
  196. package/tasks/admin/components/create.js +274 -276
  197. package/tasks/admin/components/init.js +123 -130
  198. package/tasks/admin/components/update.js +149 -157
  199. package/tasks/admin/distributions/create.js +184 -187
  200. package/tasks/admin/distributions/init.js +123 -130
  201. package/tasks/admin/distributions/update.js +145 -152
  202. package/tasks/admin/publish.js +5 -7
  203. package/tasks/admin/register.js +36 -38
  204. package/tasks/admin/release.js +8 -10
  205. package/tasks/build/assets.js +42 -39
  206. package/tasks/build/css.js +225 -216
  207. package/tasks/build/javascript.js +118 -113
  208. package/tasks/build.js +10 -10
  209. package/tasks/check-install.js +14 -16
  210. package/tasks/clean.js +5 -5
  211. package/tasks/collections/admin.js +34 -36
  212. package/tasks/collections/build.js +18 -20
  213. package/tasks/collections/docs.js +9 -11
  214. package/tasks/collections/install.js +9 -11
  215. package/tasks/collections/rtl.js +9 -11
  216. package/tasks/collections/various.js +8 -10
  217. package/tasks/config/admin/github.js +17 -17
  218. package/tasks/config/admin/oauth.example.js +4 -4
  219. package/tasks/config/admin/release.js +98 -98
  220. package/tasks/config/admin/templates/component-package.js +9 -10
  221. package/tasks/config/admin/templates/css-package.js +18 -20
  222. package/tasks/config/admin/templates/less-package.js +11 -13
  223. package/tasks/config/defaults.js +116 -116
  224. package/tasks/config/docs.js +23 -23
  225. package/tasks/config/npm/gulpfile.js +8 -9
  226. package/tasks/config/project/config.js +127 -134
  227. package/tasks/config/project/install.js +715 -713
  228. package/tasks/config/project/release.js +32 -38
  229. package/tasks/config/tasks.js +163 -164
  230. package/tasks/config/user.js +23 -29
  231. package/tasks/docs/build.js +97 -95
  232. package/tasks/docs/metadata.js +90 -96
  233. package/tasks/docs/serve.js +80 -81
  234. package/tasks/install.js +370 -378
  235. package/tasks/rtl/build.js +2 -2
  236. package/tasks/rtl/watch.js +2 -2
  237. package/tasks/version.js +4 -4
  238. package/tasks/watch.js +28 -30
  239. package/test/meteor/assets.js +10 -13
  240. package/test/meteor/fonts.js +12 -13
  241. package/test/modules/accordion.spec.js +6 -8
  242. package/test/modules/checkbox.spec.js +5 -7
  243. package/test/modules/dropdown.spec.js +5 -7
  244. package/test/modules/modal.spec.js +6 -8
  245. package/test/modules/module.spec.js +158 -178
  246. package/test/modules/popup.spec.js +5 -7
  247. package/test/modules/search.spec.js +5 -7
  248. package/test/modules/shape.spec.js +5 -7
  249. package/test/modules/sidebar.spec.js +5 -7
  250. package/test/modules/tab.spec.js +6 -8
  251. package/test/modules/transition.spec.js +5 -7
  252. package/test/modules/video.spec.js +5 -7
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.1-beta.16+7071e59 - Toast
2
+ * # Fomantic-UI 2.9.1-beta.18+935e235 - Toast
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -8,922 +8,920 @@
8
8
  *
9
9
  */
10
10
 
11
- ;(function ($, window, document, undefined) {
12
-
13
- 'use strict';
14
-
15
- function isFunction(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
- $.toast = $.fn.toast = function(parameters) {
27
- var
28
- $allModules = $(this),
29
- moduleSelector = $allModules.selector || '',
30
-
31
- time = new Date().getTime(),
32
- performance = [],
33
-
34
- query = arguments[0],
35
- methodInvoked = (typeof query == 'string'),
36
- queryArguments = [].slice.call(arguments, 1),
37
- returnedValue
38
- ;
39
- $allModules
40
- .each(function() {
41
- var
42
- settings = ( $.isPlainObject(parameters) )
43
- ? $.extend(true, {}, $.fn.toast.settings, parameters)
44
- : $.extend({}, $.fn.toast.settings),
45
-
46
- className = settings.className,
47
- selector = settings.selector,
48
- error = settings.error,
49
- namespace = settings.namespace,
50
- fields = settings.fields,
51
-
52
- eventNamespace = '.' + namespace,
53
- moduleNamespace = namespace + '-module',
54
-
55
- $module = $(this),
56
- $toastBox,
57
- $toast,
58
- $actions,
59
- $progress,
60
- $progressBar,
61
- $animationObject,
62
- $close,
63
- $context = (settings.context)
64
- ? ([window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context))
65
- : $('body'),
66
-
67
- isToastComponent = $module.hasClass('toast') || $module.hasClass('message') || $module.hasClass('card'),
68
-
69
- element = this,
70
- instance = isToastComponent ? $module.data(moduleNamespace) : undefined,
71
-
72
- id,
73
- module
74
- ;
75
- module = {
76
-
77
- initialize: function() {
78
- module.verbose('Initializing element');
79
- module.create.id();
80
- if (!module.has.container()) {
81
- module.create.container();
82
- }
83
- if(isToastComponent || settings.message !== '' || settings.title !== '' || module.get.iconClass() !== '' || settings.showImage || module.has.configActions()) {
84
- if(typeof settings.showProgress !== 'string' || [className.top,className.bottom].indexOf(settings.showProgress) === -1 ) {
85
- settings.showProgress = false;
86
- }
87
- module.create.toast();
88
- if(settings.closeOnClick && (settings.closeIcon || $($toast).find(selector.input).length > 0 || module.has.configActions())){
89
- settings.closeOnClick = false;
90
- }
91
- if(!settings.closeOnClick) {
92
- $toastBox.addClass(className.unclickable);
93
- }
94
- module.bind.events();
95
- }
96
- module.instantiate();
97
- if($toastBox) {
98
- module.show();
99
- }
100
- },
11
+ (function ($, window, document, undefined) {
12
+ 'use strict';
101
13
 
102
- instantiate: function() {
103
- module.verbose('Storing instance of toast');
104
- instance = module;
105
- $module
106
- .data(moduleNamespace, instance)
107
- ;
108
- },
109
-
110
- destroy: function() {
111
- if($toastBox) {
112
- module.debug('Removing toast', $toastBox);
113
- module.unbind.events();
114
- $toastBox.remove();
115
- $toastBox = undefined;
116
- $toast = undefined;
117
- $animationObject = undefined;
118
- settings.onRemove.call($toastBox, element);
119
- $progress = undefined;
120
- $progressBar = undefined;
121
- $close = undefined;
122
- }
123
- $module
124
- .removeData(moduleNamespace)
125
- ;
126
- },
14
+ function isFunction(obj) {
15
+ return typeof obj === 'function' && typeof obj.nodeType !== 'number';
16
+ }
127
17
 
128
- show: function(callback) {
129
- if(settings.onShow.call($toastBox, element) === false) {
130
- module.debug('onShow callback returned false, cancelling toast animation');
131
- return;
132
- }
133
- callback = callback || function(){};
134
- module.debug('Showing toast');
135
- module.animate.show(callback);
136
- },
18
+ window = (typeof window != 'undefined' && window.Math == Math)
19
+ ? window
20
+ : (typeof self != 'undefined' && self.Math == Math)
21
+ ? self
22
+ : Function('return this')();
23
+
24
+ $.toast = $.fn.toast = function (parameters) {
25
+ var
26
+ $allModules = $(this),
27
+ moduleSelector = $allModules.selector || '',
28
+
29
+ time = new Date().getTime(),
30
+ performance = [],
31
+
32
+ query = arguments[0],
33
+ methodInvoked = (typeof query == 'string'),
34
+ queryArguments = [].slice.call(arguments, 1),
35
+ returnedValue
36
+ ;
37
+ $allModules.each(function () {
38
+ var
39
+ settings = ($.isPlainObject(parameters))
40
+ ? $.extend(true, {}, $.fn.toast.settings, parameters)
41
+ : $.extend({}, $.fn.toast.settings),
42
+
43
+ className = settings.className,
44
+ selector = settings.selector,
45
+ error = settings.error,
46
+ namespace = settings.namespace,
47
+ fields = settings.fields,
48
+
49
+ eventNamespace = '.' + namespace,
50
+ moduleNamespace = namespace + '-module',
51
+
52
+ $module = $(this),
53
+ $toastBox,
54
+ $toast,
55
+ $actions,
56
+ $progress,
57
+ $progressBar,
58
+ $animationObject,
59
+ $close,
60
+ $context = (settings.context)
61
+ ? ([window, document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context))
62
+ : $('body'),
63
+
64
+ isToastComponent = $module.hasClass('toast') || $module.hasClass('message') || $module.hasClass('card'),
65
+
66
+ element = this,
67
+ instance = isToastComponent ? $module.data(moduleNamespace) : undefined,
68
+
69
+ id,
70
+ module
71
+ ;
72
+ module = {
137
73
 
138
- close: function(callback) {
139
- if(settings.onHide.call($toastBox, element) === false) {
140
- module.debug('onHide callback returned false, cancelling toast animation');
141
- return;
142
- }
143
- callback = callback || function(){};
144
- module.debug('Closing toast');
145
- module.remove.visible();
146
- module.unbind.events();
147
- module.animate.close(callback);
74
+ initialize: function () {
75
+ module.verbose('Initializing element');
76
+ module.create.id();
77
+ if (!module.has.container()) {
78
+ module.create.container();
79
+ }
80
+ if (isToastComponent || settings.message !== '' || settings.title !== '' || module.get.iconClass() !== '' || settings.showImage || module.has.configActions()) {
81
+ if (typeof settings.showProgress !== 'string' || [className.top, className.bottom].indexOf(settings.showProgress) === -1) {
82
+ settings.showProgress = false;
83
+ }
84
+ module.create.toast();
85
+ if (settings.closeOnClick && (settings.closeIcon || $($toast).find(selector.input).length > 0 || module.has.configActions())) {
86
+ settings.closeOnClick = false;
87
+ }
88
+ if (!settings.closeOnClick) {
89
+ $toastBox.addClass(className.unclickable);
90
+ }
91
+ module.bind.events();
92
+ }
93
+ module.instantiate();
94
+ if ($toastBox) {
95
+ module.show();
96
+ }
97
+ },
98
+
99
+ instantiate: function () {
100
+ module.verbose('Storing instance of toast');
101
+ instance = module;
102
+ $module
103
+ .data(moduleNamespace, instance)
104
+ ;
105
+ },
106
+
107
+ destroy: function () {
108
+ if ($toastBox) {
109
+ module.debug('Removing toast', $toastBox);
110
+ module.unbind.events();
111
+ $toastBox.remove();
112
+ $toastBox = undefined;
113
+ $toast = undefined;
114
+ $animationObject = undefined;
115
+ settings.onRemove.call($toastBox, element);
116
+ $progress = undefined;
117
+ $progressBar = undefined;
118
+ $close = undefined;
119
+ }
120
+ $module
121
+ .removeData(moduleNamespace)
122
+ ;
123
+ },
148
124
 
149
- },
125
+ show: function (callback) {
126
+ if (settings.onShow.call($toastBox, element) === false) {
127
+ module.debug('onShow callback returned false, cancelling toast animation');
150
128
 
151
- create: {
152
- container: function() {
153
- module.verbose('Creating container');
154
- $context.append($('<div/>',{class: settings.position + ' ' + className.container + ' ' +(settings.horizontal ? className.horizontal : '') + ' ' + (settings.context && settings.context !== 'body' ? className.absolute : '')}));
155
- },
156
- id: function() {
157
- id = (Math.random().toString(16) + '000000000').slice(2, 10);
158
- module.verbose('Creating unique id for element', id);
159
- },
160
- toast: function() {
161
- $toastBox = $('<div/>', {class: className.box});
162
- var iconClass = module.get.iconClass();
163
- if (!isToastComponent) {
164
- module.verbose('Creating toast');
165
- $toast = $('<div/>', {role: 'alert'});
166
- var $content = $('<div/>', {class: className.content});
167
- if (iconClass !== '') {
168
- $toast.append($('<i/>', {class: iconClass + ' ' + className.icon}));
169
- }
170
-
171
- if (settings.showImage) {
172
- $toast.append($('<img>', {
173
- class: className.image + ' ' + settings.classImage,
174
- src: settings.showImage
175
- }));
176
- }
177
- if (settings.title !== '') {
178
- var titleId = '_' + module.get.id() + 'title';
179
- $toast.attr('aria-labelledby', titleId);
180
- $content.append($('<div/>', {
181
- class: className.title,
182
- id: titleId,
183
- html: module.helpers.escape(settings.title, settings.preserveHTML)
184
- }));
185
- }
186
- var descId = '_' + module.get.id() + 'desc';
187
- $toast.attr('aria-describedby', descId);
188
- $content.append($('<div/>', {
189
- class: className.message,
190
- id: descId,
191
- html: module.helpers.escape(settings.message, settings.preserveHTML)
192
- }));
193
-
194
- $toast
195
- .addClass(settings.class + ' ' + className.toast)
196
- .append($content)
197
- ;
198
- $toast.css('opacity', String(settings.opacity));
199
- if (settings.closeIcon) {
200
- $close = $('<i/>', {class: className.close + ' ' + (typeof settings.closeIcon === 'string' ? settings.closeIcon : ''), role: 'button', tabindex: 0, 'aria-label': settings.text.close});
201
- if($close.hasClass(className.left)) {
202
- $toast.prepend($close);
203
- } else {
204
- $toast.append($close);
205
- }
206
- }
207
- } else {
208
- $toast = settings.cloneModule ? $module.clone().removeAttr('id') : $module;
209
- $close = $toast.find('> i'+module.helpers.toClass(className.close));
210
- settings.closeIcon = ($close.length > 0);
211
- if (iconClass !== '') {
212
- $toast.find(selector.icon).attr('class',iconClass + ' ' + className.icon);
213
- }
214
- if (settings.showImage) {
215
- $toast.find(selector.image).attr('src',settings.showImage);
216
- }
217
- if (settings.title !== '') {
218
- $toast.find(selector.title).html(module.helpers.escape(settings.title, settings.preserveHTML));
219
- }
220
- if (settings.message !== '') {
221
- $toast.find(selector.message).html(module.helpers.escape(settings.message, settings.preserveHTML));
222
- }
223
- }
224
- if ($toast.hasClass(className.compact)) {
225
- settings.compact = true;
226
- }
227
- if ($toast.hasClass('card')) {
228
- settings.compact = false;
229
- }
230
- $actions = $toast.find('.actions');
231
- if (module.has.configActions()) {
232
- if ($actions.length === 0) {
233
- $actions = $('<div/>', {class: className.actions + ' ' + (settings.classActions || '')}).appendTo($toast);
234
- }
235
- if($toast.hasClass('card') && !$actions.hasClass(className.attached)) {
236
- $actions.addClass(className.extraContent);
237
- if($actions.hasClass(className.vertical)) {
238
- $actions.removeClass(className.vertical);
239
- module.error(error.verticalCard);
240
- }
241
- }
242
- settings.actions.forEach(function (el) {
243
- var icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
244
- text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
245
- cls = module.helpers.deQuote(el[fields.class] || ''),
246
- click = el[fields.click] && isFunction(el[fields.click]) ? el[fields.click] : function () {};
247
- $actions.append($('<button/>', {
248
- html: icon + text,
249
- 'aria-label': (el[fields.text] || el[fields.icon] || '').replace(/<[^>]+(>|$)/g,''),
250
- class: className.button + ' ' + cls,
251
- on: {
252
- click: function () {
253
- var $button = $(this);
254
- if ($button.is(selector.approve) || $button.is(selector.deny) || click.call(element, $module) === false) {
255
129
  return;
256
- }
257
- module.close();
258
130
  }
259
- }
260
- }));
261
- });
262
- }
263
- if ($actions && $actions.hasClass(className.vertical)) {
264
- $toast.addClass(className.vertical);
265
- }
266
- if($actions.length > 0 && !$actions.hasClass(className.attached)) {
267
- if ($actions && (!$actions.hasClass(className.basic) || $actions.hasClass(className.left))) {
268
- $toast.addClass(className.actions);
269
- }
270
- }
271
- if(settings.displayTime === 'auto'){
272
- settings.displayTime = Math.max(settings.minDisplayTime, $toast.text().split(" ").length / settings.wordsPerMinute * 60000);
273
- }
274
- $toastBox.append($toast);
275
-
276
- if($actions.length > 0 && $actions.hasClass(className.attached)) {
277
- $actions.addClass(className.buttons);
278
- $actions.detach();
279
- $toast.addClass(className.attached);
280
- if (!$actions.hasClass(className.vertical)) {
281
- if ($actions.hasClass(className.top)) {
282
- $toastBox.prepend($actions);
283
- $toast.addClass(className.bottom);
284
- } else {
285
- $toastBox.append($actions);
286
- $toast.addClass(className.top);
287
- }
288
- } else {
289
- $toast.wrap(
290
- $('<div/>',{
291
- class:className.vertical + ' ' +
292
- className.attached + ' ' +
293
- (settings.compact ? className.compact : '')
294
- })
295
- );
296
- if($actions.hasClass(className.left)) {
297
- $toast.addClass(className.left).parent().addClass(className.left).prepend($actions);
298
- } else {
299
- $toast.parent().append($actions);
300
- }
301
- }
302
- }
303
- if($module !== $toast) {
304
- $module = $toast;
305
- element = $toast[0];
306
- }
307
- if(settings.displayTime > 0) {
308
- var progressingClass = className.progressing+' '+(settings.pauseOnHover ? className.pausable:'');
309
- if (!!settings.showProgress) {
310
- $progress = $('<div/>', {
311
- class: className.progress + ' ' + (settings.classProgress || settings.class),
312
- 'data-percent': ''
313
- });
314
- if(!settings.classProgress) {
315
- if ($toast.hasClass('toast') && !$toast.hasClass(className.inverted)) {
316
- $progress.addClass(className.inverted);
317
- } else {
318
- $progress.removeClass(className.inverted);
319
- }
320
- }
321
- $progressBar = $('<div/>', {class: 'bar '+(settings.progressUp ? 'up ' : 'down ')+progressingClass});
322
- $progress
323
- .addClass(settings.showProgress)
324
- .append($progressBar);
325
- if ($progress.hasClass(className.top)) {
326
- $toastBox.prepend($progress);
327
- } else {
328
- $toastBox.append($progress);
329
- }
330
- $progressBar.css('animation-duration', settings.displayTime / 1000 + 's');
331
- }
332
- $animationObject = $('<span/>',{class:'wait '+progressingClass});
333
- $animationObject.css('animation-duration', settings.displayTime / 1000 + 's');
334
- $animationObject.appendTo($toast);
335
- }
336
- if (settings.compact) {
337
- $toastBox.addClass(className.compact);
338
- $toast.addClass(className.compact);
339
- if($progress) {
340
- $progress.addClass(className.compact);
341
- }
342
- }
343
- if (settings.newestOnTop) {
344
- $toastBox.prependTo(module.get.container());
345
- }
346
- else {
347
- $toastBox.appendTo(module.get.container());
348
- }
349
- }
350
- },
131
+ callback = callback || function () {};
132
+ module.debug('Showing toast');
133
+ module.animate.show(callback);
134
+ },
351
135
 
352
- bind: {
353
- events: function() {
354
- module.debug('Binding events to toast');
355
- if(settings.closeIcon) {
356
- $close.on('click' + eventNamespace, module.event.close);
357
- }
358
- $toast.on('click' + eventNamespace, module.event.click);
359
- if($animationObject) {
360
- $animationObject.on('animationend' + eventNamespace, module.event.close);
361
- }
362
- $toastBox
363
- .on('click' + eventNamespace, selector.approve, module.event.approve)
364
- .on('click' + eventNamespace, selector.deny, module.event.deny)
365
- ;
366
- }
367
- },
368
-
369
- unbind: {
370
- events: function() {
371
- module.debug('Unbinding events to toast');
372
- if(settings.closeIcon) {
373
- $close.off('click' + eventNamespace);
374
- }
375
- $toast.off('click' + eventNamespace);
376
- if($animationObject) {
377
- $animationObject.off('animationend' + eventNamespace);
378
- }
379
- $toastBox
380
- .off('click' + eventNamespace)
381
- ;
382
- }
383
- },
136
+ close: function (callback) {
137
+ if (settings.onHide.call($toastBox, element) === false) {
138
+ module.debug('onHide callback returned false, cancelling toast animation');
384
139
 
385
- animate: {
386
- show: function(callback) {
387
- callback = isFunction(callback) ? callback : function(){};
388
- if(settings.transition && module.can.useElement('transition') && $module.transition('is supported')) {
389
- module.set.visible();
390
- $toastBox
391
- .transition({
392
- animation : settings.transition.showMethod + ' in',
393
- queue : false,
394
- debug : settings.debug,
395
- verbose : settings.verbose,
396
- silent : settings.silent,
397
- duration : settings.transition.showDuration,
398
- onComplete : function() {
399
- callback.call($toastBox, element);
400
- settings.onVisible.call($toastBox, element);
401
- }
402
- })
403
- ;
404
- }
405
- },
406
- close: function(callback) {
407
- callback = isFunction(callback) ? callback : function(){};
408
- if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
409
- $toastBox
410
- .transition({
411
- animation : settings.transition.hideMethod + ' out',
412
- queue : false,
413
- duration : settings.transition.hideDuration,
414
- debug : settings.debug,
415
- verbose : settings.verbose,
416
- silent : settings.silent,
417
- interval : 50,
418
-
419
- onBeforeHide: function(callback){
420
- callback = isFunction(callback)?callback : function(){};
421
- if(settings.transition.closeEasing !== ''){
422
- if($toastBox) {
423
- $toastBox.css('opacity', '0');
424
- $toastBox.wrap('<div/>').parent().hide(settings.transition.closeDuration, settings.transition.closeEasing, function () {
425
- if ($toastBox) {
426
- $toastBox.parent().remove();
427
- callback.call($toastBox);
428
- }
140
+ return;
141
+ }
142
+ callback = callback || function () {};
143
+ module.debug('Closing toast');
144
+ module.remove.visible();
145
+ module.unbind.events();
146
+ module.animate.close(callback);
147
+ },
148
+
149
+ create: {
150
+ container: function () {
151
+ module.verbose('Creating container');
152
+ $context.append($('<div/>', { class: settings.position + ' ' + className.container + ' ' + (settings.horizontal ? className.horizontal : '') + ' ' + (settings.context && settings.context !== 'body' ? className.absolute : '') }));
153
+ },
154
+ id: function () {
155
+ id = (Math.random().toString(16) + '000000000').slice(2, 10);
156
+ module.verbose('Creating unique id for element', id);
157
+ },
158
+ toast: function () {
159
+ $toastBox = $('<div/>', { class: className.box });
160
+ var iconClass = module.get.iconClass();
161
+ if (!isToastComponent) {
162
+ module.verbose('Creating toast');
163
+ $toast = $('<div/>', { role: 'alert' });
164
+ var $content = $('<div/>', { class: className.content });
165
+ if (iconClass !== '') {
166
+ $toast.append($('<i/>', { class: iconClass + ' ' + className.icon }));
167
+ }
168
+
169
+ if (settings.showImage) {
170
+ $toast.append($('<img>', {
171
+ class: className.image + ' ' + settings.classImage,
172
+ src: settings.showImage,
173
+ }));
174
+ }
175
+ if (settings.title !== '') {
176
+ var titleId = '_' + module.get.id() + 'title';
177
+ $toast.attr('aria-labelledby', titleId);
178
+ $content.append($('<div/>', {
179
+ class: className.title,
180
+ id: titleId,
181
+ html: module.helpers.escape(settings.title, settings.preserveHTML),
182
+ }));
183
+ }
184
+ var descId = '_' + module.get.id() + 'desc';
185
+ $toast.attr('aria-describedby', descId);
186
+ $content.append($('<div/>', {
187
+ class: className.message,
188
+ id: descId,
189
+ html: module.helpers.escape(settings.message, settings.preserveHTML),
190
+ }));
191
+
192
+ $toast
193
+ .addClass(settings.class + ' ' + className.toast)
194
+ .append($content)
195
+ ;
196
+ $toast.css('opacity', String(settings.opacity));
197
+ if (settings.closeIcon) {
198
+ $close = $('<i/>', {
199
+ class: className.close + ' ' + (typeof settings.closeIcon === 'string' ? settings.closeIcon : ''),
200
+ role: 'button',
201
+ tabindex: 0,
202
+ 'aria-label': settings.text.close,
203
+ });
204
+ if ($close.hasClass(className.left)) {
205
+ $toast.prepend($close);
206
+ } else {
207
+ $toast.append($close);
208
+ }
209
+ }
210
+ } else {
211
+ $toast = settings.cloneModule ? $module.clone().removeAttr('id') : $module;
212
+ $close = $toast.find('> i' + module.helpers.toClass(className.close));
213
+ settings.closeIcon = ($close.length > 0);
214
+ if (iconClass !== '') {
215
+ $toast.find(selector.icon).attr('class', iconClass + ' ' + className.icon);
216
+ }
217
+ if (settings.showImage) {
218
+ $toast.find(selector.image).attr('src', settings.showImage);
219
+ }
220
+ if (settings.title !== '') {
221
+ $toast.find(selector.title).html(module.helpers.escape(settings.title, settings.preserveHTML));
222
+ }
223
+ if (settings.message !== '') {
224
+ $toast.find(selector.message).html(module.helpers.escape(settings.message, settings.preserveHTML));
225
+ }
226
+ }
227
+ if ($toast.hasClass(className.compact)) {
228
+ settings.compact = true;
229
+ }
230
+ if ($toast.hasClass('card')) {
231
+ settings.compact = false;
232
+ }
233
+ $actions = $toast.find('.actions');
234
+ if (module.has.configActions()) {
235
+ if ($actions.length === 0) {
236
+ $actions = $('<div/>', { class: className.actions + ' ' + (settings.classActions || '') }).appendTo($toast);
237
+ }
238
+ if ($toast.hasClass('card') && !$actions.hasClass(className.attached)) {
239
+ $actions.addClass(className.extraContent);
240
+ if ($actions.hasClass(className.vertical)) {
241
+ $actions.removeClass(className.vertical);
242
+ module.error(error.verticalCard);
243
+ }
244
+ }
245
+ settings.actions.forEach(function (el) {
246
+ var
247
+ icon = el[fields.icon] ? '<i ' + (el[fields.text] ? 'aria-hidden="true"' : '') + ' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
248
+ text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
249
+ cls = module.helpers.deQuote(el[fields.class] || ''),
250
+ click = el[fields.click] && isFunction(el[fields.click]) ? el[fields.click] : function () {}
251
+ ;
252
+ $actions.append($('<button/>', {
253
+ html: icon + text,
254
+ 'aria-label': (el[fields.text] || el[fields.icon] || '').replace(/<[^>]+(>|$)/g, ''),
255
+ class: className.button + ' ' + cls,
256
+ on: {
257
+ click: function () {
258
+ var $button = $(this);
259
+ if ($button.is(selector.approve) || $button.is(selector.deny) || click.call(element, $module) === false) {
260
+ return;
261
+ }
262
+ module.close();
263
+ },
264
+ },
265
+ }));
429
266
  });
430
- }
431
- } else {
432
- callback.call($toastBox);
433
- }
434
- },
435
- onComplete : function() {
436
- callback.call($toastBox, element);
437
- settings.onHidden.call($toastBox, element);
438
- module.destroy();
439
- }
440
- })
441
- ;
442
- }
443
- else {
444
- module.error(error.noTransition);
445
- }
446
- },
447
- pause: function() {
448
- $animationObject.css('animationPlayState','paused');
449
- if($progressBar) {
450
- $progressBar.css('animationPlayState', 'paused');
451
- }
452
- },
453
- continue: function() {
454
- $animationObject.css('animationPlayState','running');
455
- if($progressBar) {
456
- $progressBar.css('animationPlayState', 'running');
457
- }
458
- }
459
- },
267
+ }
268
+ if ($actions && $actions.hasClass(className.vertical)) {
269
+ $toast.addClass(className.vertical);
270
+ }
271
+ if ($actions.length > 0 && !$actions.hasClass(className.attached)) {
272
+ if ($actions && (!$actions.hasClass(className.basic) || $actions.hasClass(className.left))) {
273
+ $toast.addClass(className.actions);
274
+ }
275
+ }
276
+ if (settings.displayTime === 'auto') {
277
+ settings.displayTime = Math.max(settings.minDisplayTime, $toast.text().split(' ').length / settings.wordsPerMinute * 60000);
278
+ }
279
+ $toastBox.append($toast);
280
+
281
+ if ($actions.length > 0 && $actions.hasClass(className.attached)) {
282
+ $actions.addClass(className.buttons);
283
+ $actions.detach();
284
+ $toast.addClass(className.attached);
285
+ if (!$actions.hasClass(className.vertical)) {
286
+ if ($actions.hasClass(className.top)) {
287
+ $toastBox.prepend($actions);
288
+ $toast.addClass(className.bottom);
289
+ } else {
290
+ $toastBox.append($actions);
291
+ $toast.addClass(className.top);
292
+ }
293
+ } else {
294
+ $toast.wrap(
295
+ $('<div/>', {
296
+ class: className.vertical + ' '
297
+ + className.attached + ' '
298
+ + (settings.compact ? className.compact : ''),
299
+ })
300
+ );
301
+ if ($actions.hasClass(className.left)) {
302
+ $toast.addClass(className.left).parent().addClass(className.left).prepend($actions);
303
+ } else {
304
+ $toast.parent().append($actions);
305
+ }
306
+ }
307
+ }
308
+ if ($module !== $toast) {
309
+ $module = $toast;
310
+ element = $toast[0];
311
+ }
312
+ if (settings.displayTime > 0) {
313
+ var progressingClass = className.progressing + ' ' + (settings.pauseOnHover ? className.pausable : '');
314
+ if (!!settings.showProgress) {
315
+ $progress = $('<div/>', {
316
+ class: className.progress + ' ' + (settings.classProgress || settings.class),
317
+ 'data-percent': '',
318
+ });
319
+ if (!settings.classProgress) {
320
+ if ($toast.hasClass('toast') && !$toast.hasClass(className.inverted)) {
321
+ $progress.addClass(className.inverted);
322
+ } else {
323
+ $progress.removeClass(className.inverted);
324
+ }
325
+ }
326
+ $progressBar = $('<div/>', { class: 'bar ' + (settings.progressUp ? 'up ' : 'down ') + progressingClass });
327
+ $progress
328
+ .addClass(settings.showProgress)
329
+ .append($progressBar)
330
+ ;
331
+ if ($progress.hasClass(className.top)) {
332
+ $toastBox.prepend($progress);
333
+ } else {
334
+ $toastBox.append($progress);
335
+ }
336
+ $progressBar.css('animation-duration', settings.displayTime / 1000 + 's');
337
+ }
338
+ $animationObject = $('<span/>', { class: 'wait ' + progressingClass });
339
+ $animationObject.css('animation-duration', settings.displayTime / 1000 + 's');
340
+ $animationObject.appendTo($toast);
341
+ }
342
+ if (settings.compact) {
343
+ $toastBox.addClass(className.compact);
344
+ $toast.addClass(className.compact);
345
+ if ($progress) {
346
+ $progress.addClass(className.compact);
347
+ }
348
+ }
349
+ if (settings.newestOnTop) {
350
+ $toastBox.prependTo(module.get.container());
351
+ } else {
352
+ $toastBox.appendTo(module.get.container());
353
+ }
354
+ },
355
+ },
356
+
357
+ bind: {
358
+ events: function () {
359
+ module.debug('Binding events to toast');
360
+ if (settings.closeIcon) {
361
+ $close.on('click' + eventNamespace, module.event.close);
362
+ }
363
+ $toast.on('click' + eventNamespace, module.event.click);
364
+ if ($animationObject) {
365
+ $animationObject.on('animationend' + eventNamespace, module.event.close);
366
+ }
367
+ $toastBox
368
+ .on('click' + eventNamespace, selector.approve, module.event.approve)
369
+ .on('click' + eventNamespace, selector.deny, module.event.deny)
370
+ ;
371
+ },
372
+ },
373
+
374
+ unbind: {
375
+ events: function () {
376
+ module.debug('Unbinding events to toast');
377
+ if (settings.closeIcon) {
378
+ $close.off('click' + eventNamespace);
379
+ }
380
+ $toast.off('click' + eventNamespace);
381
+ if ($animationObject) {
382
+ $animationObject.off('animationend' + eventNamespace);
383
+ }
384
+ $toastBox
385
+ .off('click' + eventNamespace)
386
+ ;
387
+ },
388
+ },
389
+
390
+ animate: {
391
+ show: function (callback) {
392
+ callback = isFunction(callback) ? callback : function () {};
393
+ if (settings.transition && module.can.useElement('transition') && $module.transition('is supported')) {
394
+ module.set.visible();
395
+ $toastBox
396
+ .transition({
397
+ animation: settings.transition.showMethod + ' in',
398
+ queue: false,
399
+ debug: settings.debug,
400
+ verbose: settings.verbose,
401
+ silent: settings.silent,
402
+ duration: settings.transition.showDuration,
403
+ onComplete: function () {
404
+ callback.call($toastBox, element);
405
+ settings.onVisible.call($toastBox, element);
406
+ },
407
+ })
408
+ ;
409
+ }
410
+ },
411
+ close: function (callback) {
412
+ callback = isFunction(callback) ? callback : function () {};
413
+ if (settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
414
+ $toastBox
415
+ .transition({
416
+ animation: settings.transition.hideMethod + ' out',
417
+ queue: false,
418
+ duration: settings.transition.hideDuration,
419
+ debug: settings.debug,
420
+ verbose: settings.verbose,
421
+ silent: settings.silent,
422
+ interval: 50,
423
+
424
+ onBeforeHide: function (callback) {
425
+ callback = isFunction(callback) ? callback : function () {};
426
+ if (settings.transition.closeEasing !== '') {
427
+ if ($toastBox) {
428
+ $toastBox.css('opacity', '0');
429
+ $toastBox.wrap('<div/>').parent().hide(settings.transition.closeDuration, settings.transition.closeEasing, function () {
430
+ if ($toastBox) {
431
+ $toastBox.parent().remove();
432
+ callback.call($toastBox);
433
+ }
434
+ });
435
+ }
436
+ } else {
437
+ callback.call($toastBox);
438
+ }
439
+ },
440
+ onComplete: function () {
441
+ callback.call($toastBox, element);
442
+ settings.onHidden.call($toastBox, element);
443
+ module.destroy();
444
+ },
445
+ })
446
+ ;
447
+ } else {
448
+ module.error(error.noTransition);
449
+ }
450
+ },
451
+ pause: function () {
452
+ $animationObject.css('animationPlayState', 'paused');
453
+ if ($progressBar) {
454
+ $progressBar.css('animationPlayState', 'paused');
455
+ }
456
+ },
457
+ continue: function () {
458
+ $animationObject.css('animationPlayState', 'running');
459
+ if ($progressBar) {
460
+ $progressBar.css('animationPlayState', 'running');
461
+ }
462
+ },
463
+ },
464
+
465
+ has: {
466
+ container: function () {
467
+ module.verbose('Determining if there is already a container');
468
+
469
+ return module.get.containers().length > 0;
470
+ },
471
+ toast: function () {
472
+ return !!module.get.toast();
473
+ },
474
+ toasts: function () {
475
+ return module.get.toasts().length > 0;
476
+ },
477
+ configActions: function () {
478
+ return Array.isArray(settings.actions) && settings.actions.length > 0;
479
+ },
480
+ },
481
+
482
+ get: {
483
+ id: function () {
484
+ return id;
485
+ },
486
+ containers: function () {
487
+ return $context.children(module.helpers.toClass(settings.position) + selector.container + (settings.horizontal ? module.helpers.toClass(className.horizontal) : ':not(' + module.helpers.toClass(className.horizontal) + ')') + (settings.context && settings.context !== 'body' ? module.helpers.toClass(className.absolute) : ':not(' + module.helpers.toClass(className.absolute) + ')'));
488
+ },
489
+ container: function () {
490
+ return module.get.containers()[0];
491
+ },
492
+ toastBox: function () {
493
+ return $toastBox || null;
494
+ },
495
+ toast: function () {
496
+ return $toast || null;
497
+ },
498
+ toasts: function () {
499
+ return $(module.get.container()).find(selector.box);
500
+ },
501
+ iconClass: function () {
502
+ return typeof settings.showIcon === 'string' ? settings.showIcon : settings.showIcon && settings.icons[settings.class] ? settings.icons[settings.class] : '';
503
+ },
504
+ remainingTime: function () {
505
+ return $animationObject ? $animationObject.css('opacity') * settings.displayTime : 0;
506
+ },
507
+ },
508
+
509
+ set: {
510
+ visible: function () {
511
+ $toast.addClass(className.visible);
512
+ },
513
+ },
514
+
515
+ remove: {
516
+ visible: function () {
517
+ $toast.removeClass(className.visible);
518
+ },
519
+ },
520
+
521
+ event: {
522
+ close: function () {
523
+ module.close();
524
+ },
525
+ click: function (event) {
526
+ if ($(event.target).closest(selector.clickable).length === 0) {
527
+ if (settings.onClick.call($toastBox, element) === false || !settings.closeOnClick) {
528
+ module.verbose('Click callback returned false or close denied by setting cancelling close');
529
+
530
+ return;
531
+ }
532
+ module.close();
533
+ }
534
+ },
535
+ approve: function () {
536
+ if (settings.onApprove.call(element, $module) === false) {
537
+ module.verbose('Approve callback returned false cancelling close');
538
+
539
+ return;
540
+ }
541
+ module.close();
542
+ },
543
+ deny: function () {
544
+ if (settings.onDeny.call(element, $module) === false) {
545
+ module.verbose('Deny callback returned false cancelling close');
546
+
547
+ return;
548
+ }
549
+ module.close();
550
+ },
551
+ },
552
+
553
+ helpers: {
554
+ toClass: function (selector) {
555
+ var
556
+ classes = selector.trim().split(/\s+/),
557
+ result = ''
558
+ ;
559
+
560
+ classes.forEach(function (element) {
561
+ result += '.' + element;
562
+ });
563
+
564
+ return result;
565
+ },
566
+ deQuote: function (string) {
567
+ return String(string).replace(/"/g, '');
568
+ },
569
+ escape: function (string, preserveHTML) {
570
+ if (preserveHTML) {
571
+ return string;
572
+ }
573
+ var
574
+ badChars = /[<>"'`]/g,
575
+ shouldEscape = /[&<>"'`]/,
576
+ escape = {
577
+ '<': '&lt;',
578
+ '>': '&gt;',
579
+ '"': '&quot;',
580
+ "'": '&#x27;',
581
+ '`': '&#x60;',
582
+ },
583
+ escapedChar = function (chr) {
584
+ return escape[chr];
585
+ }
586
+ ;
587
+ if (shouldEscape.test(string)) {
588
+ string = string.replace(/&(?![a-z0-9#]{1,12};)/gi, '&amp;');
589
+
590
+ return string.replace(badChars, escapedChar);
591
+ }
592
+
593
+ return string;
594
+ },
595
+ },
596
+
597
+ can: {
598
+ useElement: function (element) {
599
+ if ($.fn[element] !== undefined) {
600
+ return true;
601
+ }
602
+ module.error(error.noElement.replace('{element}', element));
603
+
604
+ return false;
605
+ },
606
+ },
607
+
608
+ setting: function (name, value) {
609
+ module.debug('Changing setting', name, value);
610
+ if ($.isPlainObject(name)) {
611
+ $.extend(true, settings, name);
612
+ } else if (value !== undefined) {
613
+ if ($.isPlainObject(settings[name])) {
614
+ $.extend(true, settings[name], value);
615
+ } else {
616
+ settings[name] = value;
617
+ }
618
+ } else {
619
+ return settings[name];
620
+ }
621
+ },
622
+ internal: function (name, value) {
623
+ if ($.isPlainObject(name)) {
624
+ $.extend(true, module, name);
625
+ } else if (value !== undefined) {
626
+ module[name] = value;
627
+ } else {
628
+ return module[name];
629
+ }
630
+ },
631
+ debug: function () {
632
+ if (!settings.silent && settings.debug) {
633
+ if (settings.performance) {
634
+ module.performance.log(arguments);
635
+ } else {
636
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
637
+ module.debug.apply(console, arguments);
638
+ }
639
+ }
640
+ },
641
+ verbose: function () {
642
+ if (!settings.silent && settings.verbose && settings.debug) {
643
+ if (settings.performance) {
644
+ module.performance.log(arguments);
645
+ } else {
646
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
647
+ module.verbose.apply(console, arguments);
648
+ }
649
+ }
650
+ },
651
+ error: function () {
652
+ if (!settings.silent) {
653
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
654
+ module.error.apply(console, arguments);
655
+ }
656
+ },
657
+ performance: {
658
+ log: function (message) {
659
+ var
660
+ currentTime,
661
+ executionTime,
662
+ previousTime
663
+ ;
664
+ if (settings.performance) {
665
+ currentTime = new Date().getTime();
666
+ previousTime = time || currentTime;
667
+ executionTime = currentTime - previousTime;
668
+ time = currentTime;
669
+ performance.push({
670
+ Name: message[0],
671
+ Arguments: [].slice.call(message, 1) || '',
672
+ Element: element,
673
+ 'Execution Time': executionTime,
674
+ });
675
+ }
676
+ clearTimeout(module.performance.timer);
677
+ module.performance.timer = setTimeout(module.performance.display, 500);
678
+ },
679
+ display: function () {
680
+ var
681
+ title = settings.name + ':',
682
+ totalTime = 0
683
+ ;
684
+ time = false;
685
+ clearTimeout(module.performance.timer);
686
+ $.each(performance, function (index, data) {
687
+ totalTime += data['Execution Time'];
688
+ });
689
+ title += ' ' + totalTime + 'ms';
690
+ if (moduleSelector) {
691
+ title += ' \'' + moduleSelector + '\'';
692
+ }
693
+ if ((console.group !== undefined || console.table !== undefined) && performance.length > 0) {
694
+ console.groupCollapsed(title);
695
+ if (console.table) {
696
+ console.table(performance);
697
+ } else {
698
+ $.each(performance, function (index, data) {
699
+ console.log(data.Name + ': ' + data['Execution Time'] + 'ms');
700
+ });
701
+ }
702
+ console.groupEnd();
703
+ }
704
+ performance = [];
705
+ },
706
+ },
707
+ invoke: function (query, passedArguments, context) {
708
+ var
709
+ object = instance,
710
+ maxDepth,
711
+ found,
712
+ response
713
+ ;
714
+ passedArguments = passedArguments || queryArguments;
715
+ context = context || element;
716
+ if (typeof query == 'string' && object !== undefined) {
717
+ query = query.split(/[\. ]/);
718
+ maxDepth = query.length - 1;
719
+ $.each(query, function (depth, value) {
720
+ var camelCaseValue = (depth != maxDepth)
721
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
722
+ : query
723
+ ;
724
+ if ($.isPlainObject(object[camelCaseValue]) && (depth != maxDepth)) {
725
+ object = object[camelCaseValue];
726
+ } else if (object[camelCaseValue] !== undefined) {
727
+ found = object[camelCaseValue];
728
+
729
+ return false;
730
+ } else if ($.isPlainObject(object[value]) && (depth != maxDepth)) {
731
+ object = object[value];
732
+ } else if (object[value] !== undefined) {
733
+ found = object[value];
734
+
735
+ return false;
736
+ } else {
737
+ module.error(error.method, query);
738
+
739
+ return false;
740
+ }
741
+ });
742
+ }
743
+ if (isFunction(found)) {
744
+ response = found.apply(context, passedArguments);
745
+ } else if (found !== undefined) {
746
+ response = found;
747
+ }
748
+ if (Array.isArray(returnedValue)) {
749
+ returnedValue.push(response);
750
+ } else if (returnedValue !== undefined) {
751
+ returnedValue = [returnedValue, response];
752
+ } else if (response !== undefined) {
753
+ returnedValue = response;
754
+ }
460
755
 
461
- has: {
462
- container: function() {
463
- module.verbose('Determining if there is already a container');
464
- return module.get.containers().length > 0;
465
- },
466
- toast: function(){
467
- return !!module.get.toast();
468
- },
469
- toasts: function(){
470
- return module.get.toasts().length > 0;
471
- },
472
- configActions: function () {
473
- return Array.isArray(settings.actions) && settings.actions.length > 0;
474
- }
475
- },
756
+ return found;
757
+ },
758
+ };
476
759
 
477
- get: {
478
- id: function() {
479
- return id;
480
- },
481
- containers: function() {
482
- return $context.children(module.helpers.toClass(settings.position) + selector.container + (settings.horizontal ? module.helpers.toClass(className.horizontal) : ':not('+module.helpers.toClass(className.horizontal)+')') + (settings.context && settings.context !== 'body' ? module.helpers.toClass(className.absolute) : ':not('+module.helpers.toClass(className.absolute)+')'));
483
- },
484
- container: function() {
485
- return module.get.containers()[0];
486
- },
487
- toastBox: function() {
488
- return $toastBox || null;
489
- },
490
- toast: function() {
491
- return $toast || null;
492
- },
493
- toasts: function() {
494
- return $(module.get.container()).find(selector.box);
495
- },
496
- iconClass: function() {
497
- return typeof settings.showIcon === 'string' ? settings.showIcon : settings.showIcon && settings.icons[settings.class] ? settings.icons[settings.class] : '';
498
- },
499
- remainingTime: function() {
500
- return $animationObject ? $animationObject.css('opacity') * settings.displayTime : 0;
501
- }
760
+ if (methodInvoked) {
761
+ if (instance === undefined) {
762
+ module.initialize();
763
+ }
764
+ module.invoke(query);
765
+ } else {
766
+ if (instance !== undefined) {
767
+ instance.invoke('destroy');
768
+ }
769
+ module.initialize();
770
+ returnedValue = $module;
771
+ }
772
+ });
773
+
774
+ return (returnedValue !== undefined)
775
+ ? returnedValue
776
+ : this;
777
+ };
778
+
779
+ $.fn.toast.settings = {
780
+
781
+ name: 'Toast',
782
+ namespace: 'toast',
783
+
784
+ silent: false,
785
+ debug: false,
786
+ verbose: false,
787
+ performance: true,
788
+
789
+ context: 'body',
790
+
791
+ position: 'top right',
792
+ horizontal: false,
793
+ class: 'neutral',
794
+ classProgress: false,
795
+ classActions: false,
796
+ classImage: 'mini',
797
+
798
+ title: '',
799
+ message: '',
800
+ displayTime: 3000, // set to zero to require manually dismissal, otherwise hides on its own
801
+ minDisplayTime: 1000, // minimum displaytime in case displayTime is set to 'auto'
802
+ wordsPerMinute: 120,
803
+ showIcon: false,
804
+ newestOnTop: false,
805
+ showProgress: false,
806
+ pauseOnHover: true,
807
+ progressUp: false, // if true, the bar will start at 0% and increase to 100%
808
+ opacity: 1,
809
+ compact: true,
810
+ closeIcon: false,
811
+ closeOnClick: true,
812
+ cloneModule: true,
813
+ actions: false,
814
+ preserveHTML: true,
815
+ showImage: false,
816
+
817
+ // transition settings
818
+ transition: {
819
+ showMethod: 'scale',
820
+ showDuration: 500,
821
+ hideMethod: 'scale',
822
+ hideDuration: 500,
823
+ closeEasing: 'easeOutCubic', // Set to empty string to stack the closed toast area immediately (old behaviour)
824
+ closeDuration: 500,
502
825
  },
503
826
 
504
- set: {
505
- visible: function() {
506
- $toast.addClass(className.visible);
507
- }
827
+ error: {
828
+ method: 'The method you called is not defined.',
829
+ noElement: 'This module requires ui {element}',
830
+ verticalCard: 'Vertical but not attached actions are not supported for card layout',
508
831
  },
509
832
 
510
- remove: {
511
- visible: function() {
512
- $toast.removeClass(className.visible);
513
- }
833
+ className: {
834
+ container: 'ui toast-container',
835
+ absolute: 'absolute',
836
+ box: 'floating toast-box',
837
+ progress: 'ui attached active progress',
838
+ toast: 'ui toast',
839
+ icon: 'centered icon',
840
+ visible: 'visible',
841
+ content: 'content',
842
+ title: 'ui header',
843
+ message: 'message',
844
+ actions: 'actions',
845
+ extraContent: 'extra content',
846
+ button: 'ui button',
847
+ buttons: 'ui buttons',
848
+ close: 'close icon',
849
+ image: 'ui image',
850
+ vertical: 'vertical',
851
+ horizontal: 'horizontal',
852
+ attached: 'attached',
853
+ inverted: 'inverted',
854
+ compact: 'compact',
855
+ pausable: 'pausable',
856
+ progressing: 'progressing',
857
+ top: 'top',
858
+ bottom: 'bottom',
859
+ left: 'left',
860
+ basic: 'basic',
861
+ unclickable: 'unclickable',
514
862
  },
515
863
 
516
- event: {
517
- close: function(){
518
- module.close();
519
- },
520
- click: function(event) {
521
- if($(event.target).closest(selector.clickable).length === 0) {
522
- if(settings.onClick.call($toastBox, element) === false || !settings.closeOnClick) {
523
- module.verbose('Click callback returned false or close denied by setting cancelling close');
524
- return;
525
- }
526
- module.close();
527
- }
528
- },
529
- approve: function() {
530
- if(settings.onApprove.call(element, $module) === false) {
531
- module.verbose('Approve callback returned false cancelling close');
532
- return;
533
- }
534
- module.close();
535
- },
536
- deny: function() {
537
- if(settings.onDeny.call(element, $module) === false) {
538
- module.verbose('Deny callback returned false cancelling close');
539
- return;
540
- }
541
- module.close();
542
- }
864
+ text: {
865
+ close: 'Close',
543
866
  },
544
867
 
545
- helpers: {
546
- toClass: function(selector) {
547
- var
548
- classes = selector.trim().split(/\s+/),
549
- result = ''
550
- ;
551
-
552
- classes.forEach(function (element) {
553
- result += '.' + element;
554
- });
555
-
556
- return result;
557
- },
558
- deQuote: function(string) {
559
- return String(string).replace(/"/g,"");
560
- },
561
- escape: function(string, preserveHTML) {
562
- if (preserveHTML){
563
- return string;
564
- }
565
- var
566
- badChars = /[<>"'`]/g,
567
- shouldEscape = /[&<>"'`]/,
568
- escape = {
569
- "<": "&lt;",
570
- ">": "&gt;",
571
- '"': "&quot;",
572
- "'": "&#x27;",
573
- "`": "&#x60;"
574
- },
575
- escapedChar = function(chr) {
576
- return escape[chr];
577
- }
578
- ;
579
- if(shouldEscape.test(string)) {
580
- string = string.replace(/&(?![a-z0-9#]{1,12};)/gi, "&amp;");
581
- return string.replace(badChars, escapedChar);
582
- }
583
- return string;
584
- }
868
+ icons: {
869
+ info: 'info',
870
+ success: 'checkmark',
871
+ warning: 'warning',
872
+ error: 'times',
585
873
  },
586
874
 
587
- can: {
588
- useElement: function(element){
589
- if ($.fn[element] !== undefined) {
590
- return true;
591
- }
592
- module.error(error.noElement.replace('{element}',element));
593
- return false;
594
- }
875
+ selector: {
876
+ container: '.ui.toast-container',
877
+ box: '.toast-box',
878
+ toast: '.ui.toast',
879
+ title: '.header',
880
+ message: '.message:not(.ui)',
881
+ image: '> img.image, > .image > img',
882
+ icon: '> i.icon',
883
+ input: 'input:not([type="hidden"]), textarea, select, button, .ui.button, ui.dropdown',
884
+ clickable: 'a, details, .ui.accordion',
885
+ approve: '.actions .positive, .actions .approve, .actions .ok',
886
+ deny: '.actions .negative, .actions .deny, .actions .cancel',
595
887
  },
596
888
 
597
- setting: function(name, value) {
598
- module.debug('Changing setting', name, value);
599
- if( $.isPlainObject(name) ) {
600
- $.extend(true, settings, name);
601
- }
602
- else if(value !== undefined) {
603
- if($.isPlainObject(settings[name])) {
604
- $.extend(true, settings[name], value);
605
- }
606
- else {
607
- settings[name] = value;
608
- }
609
- }
610
- else {
611
- return settings[name];
612
- }
613
- },
614
- internal: function(name, value) {
615
- if( $.isPlainObject(name) ) {
616
- $.extend(true, module, name);
617
- }
618
- else if(value !== undefined) {
619
- module[name] = value;
620
- }
621
- else {
622
- return module[name];
623
- }
624
- },
625
- debug: function() {
626
- if(!settings.silent && settings.debug) {
627
- if(settings.performance) {
628
- module.performance.log(arguments);
629
- }
630
- else {
631
- module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
632
- module.debug.apply(console, arguments);
633
- }
634
- }
635
- },
636
- verbose: function() {
637
- if(!settings.silent && settings.verbose && settings.debug) {
638
- if(settings.performance) {
639
- module.performance.log(arguments);
640
- }
641
- else {
642
- module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
643
- module.verbose.apply(console, arguments);
644
- }
645
- }
646
- },
647
- error: function() {
648
- if(!settings.silent) {
649
- module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
650
- module.error.apply(console, arguments);
651
- }
889
+ fields: {
890
+ class: 'class',
891
+ text: 'text',
892
+ icon: 'icon',
893
+ click: 'click',
652
894
  },
653
- performance: {
654
- log: function(message) {
655
- var
656
- currentTime,
657
- executionTime,
658
- previousTime
659
- ;
660
- if(settings.performance) {
661
- currentTime = new Date().getTime();
662
- previousTime = time || currentTime;
663
- executionTime = currentTime - previousTime;
664
- time = currentTime;
665
- performance.push({
666
- 'Name' : message[0],
667
- 'Arguments' : [].slice.call(message, 1) || '',
668
- 'Element' : element,
669
- 'Execution Time' : executionTime
670
- });
671
- }
672
- clearTimeout(module.performance.timer);
673
- module.performance.timer = setTimeout(module.performance.display, 500);
674
- },
675
- display: function() {
895
+
896
+ // callbacks
897
+ onShow: function () {},
898
+ onVisible: function () {},
899
+ onClick: function () {},
900
+ onHide: function () {},
901
+ onHidden: function () {},
902
+ onRemove: function () {},
903
+ onApprove: function () {},
904
+ onDeny: function () {},
905
+ };
906
+
907
+ $.extend($.easing, {
908
+ easeOutBounce: function (x) {
676
909
  var
677
- title = settings.name + ':',
678
- totalTime = 0
910
+ n1 = 7.5625,
911
+ d1 = 2.75
679
912
  ;
680
- time = false;
681
- clearTimeout(module.performance.timer);
682
- $.each(performance, function(index, data) {
683
- totalTime += data['Execution Time'];
684
- });
685
- title += ' ' + totalTime + 'ms';
686
- if(moduleSelector) {
687
- title += ' \'' + moduleSelector + '\'';
688
- }
689
- if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
690
- console.groupCollapsed(title);
691
- if(console.table) {
692
- console.table(performance);
693
- }
694
- else {
695
- $.each(performance, function(index, data) {
696
- console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
697
- });
698
- }
699
- console.groupEnd();
913
+ if (x < 1 / d1) {
914
+ return n1 * x * x;
915
+ } else if (x < 2 / d1) {
916
+ return n1 * (x -= 1.5 / d1) * x + 0.75;
917
+ } else if (x < 2.5 / d1) {
918
+ return n1 * (x -= 2.25 / d1) * x + 0.9375;
919
+ } else {
920
+ return n1 * (x -= 2.625 / d1) * x + 0.984375;
700
921
  }
701
- performance = [];
702
- }
703
922
  },
704
- invoke: function(query, passedArguments, context) {
705
- var
706
- object = instance,
707
- maxDepth,
708
- found,
709
- response
710
- ;
711
- passedArguments = passedArguments || queryArguments;
712
- context = context || element;
713
- if(typeof query == 'string' && object !== undefined) {
714
- query = query.split(/[\. ]/);
715
- maxDepth = query.length - 1;
716
- $.each(query, function(depth, value) {
717
- var camelCaseValue = (depth != maxDepth)
718
- ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
719
- : query
720
- ;
721
- if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
722
- object = object[camelCaseValue];
723
- }
724
- else if( object[camelCaseValue] !== undefined ) {
725
- found = object[camelCaseValue];
726
- return false;
727
- }
728
- else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
729
- object = object[value];
730
- }
731
- else if( object[value] !== undefined ) {
732
- found = object[value];
733
- return false;
734
- }
735
- else {
736
- module.error(error.method, query);
737
- return false;
738
- }
739
- });
740
- }
741
- if ( isFunction( found ) ) {
742
- response = found.apply(context, passedArguments);
743
- }
744
- else if(found !== undefined) {
745
- response = found;
746
- }
747
- if(Array.isArray(returnedValue)) {
748
- returnedValue.push(response);
749
- }
750
- else if(returnedValue !== undefined) {
751
- returnedValue = [returnedValue, response];
752
- }
753
- else if(response !== undefined) {
754
- returnedValue = response;
755
- }
756
- return found;
757
- }
758
- };
759
-
760
- if(methodInvoked) {
761
- if(instance === undefined) {
762
- module.initialize();
763
- }
764
- module.invoke(query);
765
- }
766
- else {
767
- if(instance !== undefined) {
768
- instance.invoke('destroy');
769
- }
770
- module.initialize();
771
- returnedValue = $module;
772
- }
773
- })
774
- ;
775
-
776
- return (returnedValue !== undefined)
777
- ? returnedValue
778
- : this
779
- ;
780
- };
781
-
782
- $.fn.toast.settings = {
783
-
784
- name : 'Toast',
785
- namespace : 'toast',
786
-
787
- silent : false,
788
- debug : false,
789
- verbose : false,
790
- performance : true,
791
-
792
- context : 'body',
793
-
794
- position : 'top right',
795
- horizontal : false,
796
- class : 'neutral',
797
- classProgress : false,
798
- classActions : false,
799
- classImage : 'mini',
800
-
801
- title : '',
802
- message : '',
803
- displayTime : 3000, // set to zero to require manually dismissal, otherwise hides on its own
804
- minDisplayTime : 1000, // minimum displaytime in case displayTime is set to 'auto'
805
- wordsPerMinute : 120,
806
- showIcon : false,
807
- newestOnTop : false,
808
- showProgress : false,
809
- pauseOnHover : true,
810
- progressUp : false, //if true, the bar will start at 0% and increase to 100%
811
- opacity : 1,
812
- compact : true,
813
- closeIcon : false,
814
- closeOnClick : true,
815
- cloneModule : true,
816
- actions : false,
817
- preserveHTML : true,
818
- showImage : false,
819
-
820
- // transition settings
821
- transition : {
822
- showMethod : 'scale',
823
- showDuration : 500,
824
- hideMethod : 'scale',
825
- hideDuration : 500,
826
- closeEasing : 'easeOutCubic', //Set to empty string to stack the closed toast area immediately (old behaviour)
827
- closeDuration: 500
828
- },
829
-
830
- error: {
831
- method : 'The method you called is not defined.',
832
- noElement : 'This module requires ui {element}',
833
- verticalCard : 'Vertical but not attached actions are not supported for card layout'
834
- },
835
-
836
- className : {
837
- container : 'ui toast-container',
838
- absolute : 'absolute',
839
- box : 'floating toast-box',
840
- progress : 'ui attached active progress',
841
- toast : 'ui toast',
842
- icon : 'centered icon',
843
- visible : 'visible',
844
- content : 'content',
845
- title : 'ui header',
846
- message : 'message',
847
- actions : 'actions',
848
- extraContent : 'extra content',
849
- button : 'ui button',
850
- buttons : 'ui buttons',
851
- close : 'close icon',
852
- image : 'ui image',
853
- vertical : 'vertical',
854
- horizontal : 'horizontal',
855
- attached : 'attached',
856
- inverted : 'inverted',
857
- compact : 'compact',
858
- pausable : 'pausable',
859
- progressing : 'progressing',
860
- top : 'top',
861
- bottom : 'bottom',
862
- left : 'left',
863
- basic : 'basic',
864
- unclickable : 'unclickable'
865
- },
866
-
867
- text: {
868
- close : 'Close'
869
- },
870
-
871
- icons : {
872
- info : 'info',
873
- success : 'checkmark',
874
- warning : 'warning',
875
- error : 'times'
876
- },
877
-
878
- selector : {
879
- container : '.ui.toast-container',
880
- box : '.toast-box',
881
- toast : '.ui.toast',
882
- title : '.header',
883
- message : '.message:not(.ui)',
884
- image : '> img.image, > .image > img',
885
- icon : '> i.icon',
886
- input : 'input:not([type="hidden"]), textarea, select, button, .ui.button, ui.dropdown',
887
- clickable : 'a, details, .ui.accordion',
888
- approve : '.actions .positive, .actions .approve, .actions .ok',
889
- deny : '.actions .negative, .actions .deny, .actions .cancel'
890
- },
891
-
892
- fields : {
893
- class : 'class',
894
- text : 'text',
895
- icon : 'icon',
896
- click : 'click'
897
- },
898
-
899
- // callbacks
900
- onShow : function(){},
901
- onVisible : function(){},
902
- onClick : function(){},
903
- onHide : function(){},
904
- onHidden : function(){},
905
- onRemove : function(){},
906
- onApprove : function(){},
907
- onDeny : function(){}
908
- };
909
-
910
- $.extend( $.easing, {
911
- easeOutBounce: function (x) {
912
- var n1 = 7.5625, d1 = 2.75;
913
- if (x < 1 / d1) {
914
- return n1 * x * x;
915
- } else if (x < 2 / d1) {
916
- return n1 * (x -= 1.5 / d1) * x + 0.75;
917
- } else if (x < 2.5 / d1) {
918
- return n1 * (x -= 2.25 / d1) * x + 0.9375;
919
- } else {
920
- return n1 * (x -= 2.625 / d1) * x + 0.984375;
921
- }
922
- },
923
- easeOutCubic: function (t) {
924
- return (--t)*t*t+1;
925
- }
926
- });
927
-
928
-
929
- })( jQuery, window, document );
923
+ easeOutCubic: function (t) {
924
+ return (--t) * t * t + 1;
925
+ },
926
+ });
927
+ })(jQuery, window, document);