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