fomantic-ui-sass 2.9.0 → 2.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/app/assets/fonts/semantic-ui/Lato-Bold.woff +0 -0
  4. data/app/assets/fonts/semantic-ui/Lato-Bold.woff2 +0 -0
  5. data/app/assets/fonts/semantic-ui/Lato-BoldItalic.woff +0 -0
  6. data/app/assets/fonts/semantic-ui/Lato-BoldItalic.woff2 +0 -0
  7. data/app/assets/fonts/semantic-ui/Lato-Italic.woff +0 -0
  8. data/app/assets/fonts/semantic-ui/Lato-Italic.woff2 +0 -0
  9. data/app/assets/fonts/semantic-ui/Lato-Regular.woff +0 -0
  10. data/app/assets/fonts/semantic-ui/Lato-Regular.woff2 +0 -0
  11. data/app/assets/fonts/semantic-ui/LatoLatin-Bold.woff +0 -0
  12. data/app/assets/fonts/semantic-ui/LatoLatin-Bold.woff2 +0 -0
  13. data/app/assets/fonts/semantic-ui/LatoLatin-BoldItalic.woff +0 -0
  14. data/app/assets/fonts/semantic-ui/LatoLatin-BoldItalic.woff2 +0 -0
  15. data/app/assets/fonts/semantic-ui/LatoLatin-Italic.woff +0 -0
  16. data/app/assets/fonts/semantic-ui/LatoLatin-Italic.woff2 +0 -0
  17. data/app/assets/fonts/semantic-ui/LatoLatin-Regular.woff +0 -0
  18. data/app/assets/fonts/semantic-ui/LatoLatin-Regular.woff2 +0 -0
  19. data/app/assets/fonts/semantic-ui/brand-icons.woff +0 -0
  20. data/app/assets/fonts/semantic-ui/brand-icons.woff2 +0 -0
  21. data/app/assets/fonts/semantic-ui/icons.woff +0 -0
  22. data/app/assets/fonts/semantic-ui/icons.woff2 +0 -0
  23. data/app/assets/fonts/semantic-ui/outline-icons.woff +0 -0
  24. data/app/assets/fonts/semantic-ui/outline-icons.woff2 +0 -0
  25. data/app/assets/javascripts/semantic-ui/accordion.js +569 -596
  26. data/app/assets/javascripts/semantic-ui/api.js +1158 -1180
  27. data/app/assets/javascripts/semantic-ui/calendar.js +1935 -1810
  28. data/app/assets/javascripts/semantic-ui/checkbox.js +843 -842
  29. data/app/assets/javascripts/semantic-ui/dimmer.js +707 -738
  30. data/app/assets/javascripts/semantic-ui/dropdown.js +4196 -4237
  31. data/app/assets/javascripts/semantic-ui/embed.js +646 -676
  32. data/app/assets/javascripts/semantic-ui/flyout.js +1503 -1466
  33. data/app/assets/javascripts/semantic-ui/form.js +2035 -2007
  34. data/app/assets/javascripts/semantic-ui/modal.js +1552 -1487
  35. data/app/assets/javascripts/semantic-ui/nag.js +521 -527
  36. data/app/assets/javascripts/semantic-ui/popup.js +1469 -1457
  37. data/app/assets/javascripts/semantic-ui/progress.js +944 -998
  38. data/app/assets/javascripts/semantic-ui/rating.js +508 -524
  39. data/app/assets/javascripts/semantic-ui/search.js +1521 -1535
  40. data/app/assets/javascripts/semantic-ui/shape.js +762 -811
  41. data/app/assets/javascripts/semantic-ui/sidebar.js +1042 -1100
  42. data/app/assets/javascripts/semantic-ui/site.js +437 -477
  43. data/app/assets/javascripts/semantic-ui/slider.js +1311 -1312
  44. data/app/assets/javascripts/semantic-ui/state.js +639 -658
  45. data/app/assets/javascripts/semantic-ui/sticky.js +848 -902
  46. data/app/assets/javascripts/semantic-ui/tab.js +903 -967
  47. data/app/assets/javascripts/semantic-ui/toast.js +911 -885
  48. data/app/assets/javascripts/semantic-ui/transition.js +998 -1078
  49. data/app/assets/javascripts/semantic-ui/visibility.js +1214 -1246
  50. data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +7 -7
  51. data/app/assets/stylesheets/semantic-ui/collections/_form.scss +311 -377
  52. data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +191 -331
  53. data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +302 -439
  54. data/app/assets/stylesheets/semantic-ui/collections/_message.scss +127 -199
  55. data/app/assets/stylesheets/semantic-ui/collections/_table.scss +549 -776
  56. data/app/assets/stylesheets/semantic-ui/elements/_button.scss +711 -1123
  57. data/app/assets/stylesheets/semantic-ui/elements/_container.scss +9 -8
  58. data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +45 -63
  59. data/app/assets/stylesheets/semantic-ui/elements/_emoji.scss +3558 -3558
  60. data/app/assets/stylesheets/semantic-ui/elements/_flag.scss +272 -270
  61. data/app/assets/stylesheets/semantic-ui/elements/_header.scss +120 -144
  62. data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +667 -747
  63. data/app/assets/stylesheets/semantic-ui/elements/_image.scss +41 -65
  64. data/app/assets/stylesheets/semantic-ui/elements/_input.scss +416 -300
  65. data/app/assets/stylesheets/semantic-ui/elements/_label.scss +361 -412
  66. data/app/assets/stylesheets/semantic-ui/elements/_list.scss +51 -72
  67. data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +69 -157
  68. data/app/assets/stylesheets/semantic-ui/elements/_placeholder.scss +24 -44
  69. data/app/assets/stylesheets/semantic-ui/elements/_rail.scss +17 -22
  70. data/app/assets/stylesheets/semantic-ui/elements/_reveal.scss +46 -85
  71. data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +173 -227
  72. data/app/assets/stylesheets/semantic-ui/elements/_step.scss +79 -152
  73. data/app/assets/stylesheets/semantic-ui/elements/_text.scss +34 -34
  74. data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +10 -15
  75. data/app/assets/stylesheets/semantic-ui/globals/_site.scss +29 -51
  76. data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +37 -55
  77. data/app/assets/stylesheets/semantic-ui/modules/_calendar.scss +26 -29
  78. data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +159 -230
  79. data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +55 -174
  80. data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +261 -393
  81. data/app/assets/stylesheets/semantic-ui/modules/_embed.scss +21 -32
  82. data/app/assets/stylesheets/semantic-ui/modules/_flyout.scss +97 -143
  83. data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +122 -156
  84. data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +55 -65
  85. data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +573 -206
  86. data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +108 -213
  87. data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +83 -124
  88. data/app/assets/stylesheets/semantic-ui/modules/_search.scss +71 -100
  89. data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +16 -32
  90. data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +105 -208
  91. data/app/assets/stylesheets/semantic-ui/modules/_slider.scss +102 -127
  92. data/app/assets/stylesheets/semantic-ui/modules/_sticky.scss +3 -7
  93. data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +12 -16
  94. data/app/assets/stylesheets/semantic-ui/modules/_toast.scss +71 -149
  95. data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +371 -1282
  96. data/app/assets/stylesheets/semantic-ui/views/_ad.scss +36 -47
  97. data/app/assets/stylesheets/semantic-ui/views/_card.scss +221 -367
  98. data/app/assets/stylesheets/semantic-ui/views/_comment.scss +43 -61
  99. data/app/assets/stylesheets/semantic-ui/views/_feed.scss +37 -59
  100. data/app/assets/stylesheets/semantic-ui/views/_item.scss +87 -134
  101. data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +77 -118
  102. data/lib/fomantic/ui/sass/version.rb +2 -2
  103. data/tasks/converter.rb +1 -1
  104. metadata +17 -1
@@ -1,558 +1,552 @@
1
1
  /*!
2
2
  * # Fomantic-UI - Nag
3
- * http://github.com/fomantic/Fomantic-UI/
3
+ * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
6
6
  * Released under the MIT license
7
- * http://opensource.org/licenses/MIT
7
+ * https://opensource.org/licenses/MIT
8
8
  *
9
9
  */
10
10
 
11
- ;(function ($, window, document, undefined) {
12
-
13
- 'use strict';
14
-
15
- $.isFunction = $.isFunction || function(obj) {
16
- return typeof obj === "function" && typeof obj.nodeType !== "number";
17
- };
18
-
19
- window = (typeof window != 'undefined' && window.Math == Math)
20
- ? window
21
- : (typeof self != 'undefined' && self.Math == Math)
22
- ? self
23
- : Function('return this')()
24
- ;
25
-
26
- $.fn.nag = 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.nag.settings, parameters)
44
- : $.extend({}, $.fn.nag.settings),
45
-
46
- selector = settings.selector,
47
- error = settings.error,
48
- namespace = settings.namespace,
49
-
50
- eventNamespace = '.' + namespace,
51
- moduleNamespace = namespace + '-module',
52
-
53
- $module = $(this),
54
-
55
- $context = (settings.context)
56
- ? ([window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context))
57
- : $('body'),
58
-
59
- element = this,
60
- instance = $module.data(moduleNamespace),
61
- storage,
62
- module
63
- ;
64
- module = {
65
-
66
- initialize: function() {
67
- module.verbose('Initializing element');
68
- storage = module.get.storage();
69
- $module
70
- .on('click' + eventNamespace, selector.close, module.dismiss)
71
- .data(moduleNamespace, module)
72
- ;
73
-
74
- if(settings.detachable && $module.parent()[0] !== $context[0]) {
75
- $module
76
- .detach()
77
- .prependTo($context)
78
- ;
79
- }
11
+ (function ($, window, document) {
12
+ 'use strict';
80
13
 
81
- if(settings.displayTime > 0) {
82
- setTimeout(module.hide, settings.displayTime);
83
- }
84
- module.show();
85
- },
14
+ function isFunction(obj) {
15
+ return typeof obj === 'function' && typeof obj.nodeType !== 'number';
16
+ }
86
17
 
87
- destroy: function() {
88
- module.verbose('Destroying instance');
89
- $module
90
- .removeData(moduleNamespace)
91
- .off(eventNamespace)
92
- ;
93
- },
18
+ window = window !== undefined && window.Math === Math
19
+ ? window
20
+ : globalThis;
94
21
 
95
- show: function() {
96
- if( module.should.show() && !$module.is(':visible') ) {
97
- if(settings.onShow.call(element) === false) {
98
- module.debug('onShow callback returned false, cancelling nag animation');
99
- return false;
100
- }
101
- module.debug('Showing nag', settings.animation.show);
102
- if(settings.animation.show === 'fade') {
103
- $module
104
- .fadeIn(settings.duration, settings.easing, settings.onVisible)
105
- ;
106
- }
107
- else {
108
- $module
109
- .slideDown(settings.duration, settings.easing, settings.onVisible)
110
- ;
111
- }
112
- }
113
- },
22
+ $.fn.nag = function (parameters) {
23
+ var
24
+ $allModules = $(this),
25
+ moduleSelector = $allModules.selector || '',
114
26
 
115
- hide: function() {
116
- if(settings.onHide.call(element) === false) {
117
- module.debug('onHide callback returned false, cancelling nag animation');
118
- return false;
119
- }
120
- module.debug('Hiding nag', settings.animation.hide);
121
- if(settings.animation.hide === 'fade') {
122
- $module
123
- .fadeOut(settings.duration, settings.easing, settings.onHidden)
124
- ;
125
- }
126
- else {
127
- $module
128
- .slideUp(settings.duration, settings.easing, settings.onHidden)
27
+ time = Date.now(),
28
+ performance = [],
29
+
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.nag.settings, parameters)
39
+ : $.extend({}, $.fn.nag.settings),
40
+
41
+ selector = settings.selector,
42
+ error = settings.error,
43
+ namespace = settings.namespace,
44
+
45
+ eventNamespace = '.' + namespace,
46
+ moduleNamespace = namespace + '-module',
47
+
48
+ $module = $(this),
49
+
50
+ $context = settings.context
51
+ ? ([window, document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context))
52
+ : $('body'),
53
+
54
+ element = this,
55
+ instance = $module.data(moduleNamespace),
56
+ storage,
57
+ module
129
58
  ;
130
- }
131
- },
59
+ module = {
132
60
 
133
- dismiss: function(event) {
134
- if(module.hide() !== false && settings.storageMethod) {
135
- module.debug('Dismissing nag', settings.storageMethod, settings.key, settings.value, settings.expires);
136
- module.storage.set(settings.key, settings.value);
137
- }
138
- event.stopImmediatePropagation();
139
- event.preventDefault();
140
- },
61
+ initialize: function () {
62
+ module.verbose('Initializing element');
63
+ if (typeof settings.value !== 'string') {
64
+ settings.value = JSON.stringify(settings.value);
65
+ }
66
+ storage = module.get.storage();
67
+ $module
68
+ .on('click' + eventNamespace, selector.close, module.dismiss)
69
+ .data(moduleNamespace, module)
70
+ ;
71
+
72
+ if (settings.detachable && $module.parent()[0] !== $context[0]) {
73
+ $module
74
+ .detach()
75
+ .prependTo($context)
76
+ ;
77
+ }
141
78
 
142
- should: {
143
- show: function() {
144
- if(settings.persist) {
145
- module.debug('Persistent nag is set, can show nag');
146
- return true;
147
- }
148
- if( module.storage.get(settings.key) != settings.value.toString() ) {
149
- module.debug('Stored value is not set, can show nag', module.storage.get(settings.key));
150
- return true;
151
- }
152
- module.debug('Stored value is set, cannot show nag', module.storage.get(settings.key));
153
- return false;
154
- }
155
- },
79
+ if (settings.displayTime > 0) {
80
+ setTimeout(module.hide, settings.displayTime);
81
+ }
82
+ module.show();
83
+ },
156
84
 
157
- get: {
158
- expirationDate: function(expires) {
159
- if (typeof expires === 'number') {
160
- expires = new Date(Date.now() + expires * 864e5);
161
- }
162
- if(expires instanceof Date && expires.getTime() ){
163
- return expires.toUTCString();
164
- } else {
165
- module.error(error.expiresFormat);
166
- }
167
- },
168
- storage: function(){
169
- if(settings.storageMethod === 'localstorage' && window.localStorage !== undefined) {
170
- module.debug('Using local storage');
171
- return window.localStorage;
172
- }
173
- else if(settings.storageMethod === 'sessionstorage' && window.sessionStorage !== undefined) {
174
- module.debug('Using session storage');
175
- return window.sessionStorage;
176
- }
177
- else if("cookie" in document) {
178
- module.debug('Using cookie');
179
- return {
180
- setItem: function(key, value, options) {
181
- // RFC6265 compliant encoding
182
- key = encodeURIComponent(key)
183
- .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
184
- .replace(/[()]/g, escape);
185
- value = encodeURIComponent(value)
186
- .replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);
187
-
188
- var cookieOptions = '';
189
- for (var option in options) {
190
- if (options.hasOwnProperty(option)) {
191
- cookieOptions += '; ' + option;
192
- if (typeof options[option] === 'string') {
193
- cookieOptions += '=' + options[option].split(';')[0];
194
- }
85
+ destroy: function () {
86
+ module.verbose('Destroying instance');
87
+ $module
88
+ .removeData(moduleNamespace)
89
+ .off(eventNamespace)
90
+ ;
91
+ },
92
+
93
+ show: function () {
94
+ if (module.should.show() && !$module.is(':visible')) {
95
+ if (settings.onShow.call(element) === false) {
96
+ module.debug('onShow callback returned false, cancelling nag animation');
97
+
98
+ return false;
99
+ }
100
+ module.debug('Showing nag', settings.animation.show);
101
+ if (settings.animation.show === 'fade') {
102
+ $module
103
+ .fadeIn(settings.duration, settings.easing, settings.onVisible)
104
+ ;
105
+ } else {
106
+ $module
107
+ .slideDown(settings.duration, settings.easing, settings.onVisible)
108
+ ;
109
+ }
195
110
  }
196
- }
197
- document.cookie = key + '=' + value + cookieOptions;
198
111
  },
199
- getItem: function(key) {
200
- var cookies = document.cookie.split('; ');
201
- for (var i = 0, il = cookies.length; i < il; i++) {
202
- var parts = cookies[i].split('='),
203
- foundKey = parts[0].replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
204
- if (key === foundKey) {
205
- return parts[1] || '';
112
+
113
+ hide: function () {
114
+ if (settings.onHide.call(element) === false) {
115
+ module.debug('onHide callback returned false, cancelling nag animation');
116
+
117
+ return false;
118
+ }
119
+ module.debug('Hiding nag', settings.animation.hide);
120
+ if (settings.animation.hide === 'fade') {
121
+ $module
122
+ .fadeOut(settings.duration, settings.easing, settings.onHidden)
123
+ ;
124
+ } else {
125
+ $module
126
+ .slideUp(settings.duration, settings.easing, settings.onHidden)
127
+ ;
128
+ }
129
+ },
130
+
131
+ dismiss: function (event) {
132
+ if (module.hide() !== false && settings.storageMethod) {
133
+ module.debug('Dismissing nag', settings.storageMethod, settings.key, settings.value, settings.expires);
134
+ module.storage.set(settings.key, settings.value);
206
135
  }
207
- }
136
+ event.stopImmediatePropagation();
137
+ event.preventDefault();
138
+ },
139
+
140
+ should: {
141
+ show: function () {
142
+ if (settings.persist) {
143
+ module.debug('Persistent nag is set, can show nag');
144
+
145
+ return true;
146
+ }
147
+ if (module.storage.get(settings.key) != settings.value.toString()) {
148
+ module.debug('Stored value is not set, can show nag', module.storage.get(settings.key));
149
+
150
+ return true;
151
+ }
152
+ module.debug('Stored value is set, cannot show nag', module.storage.get(settings.key));
153
+
154
+ return false;
155
+ },
156
+ },
157
+
158
+ get: {
159
+ expirationDate: function (expires) {
160
+ if (typeof expires === 'number') {
161
+ expires = new Date(Date.now() + expires * 864e5);
162
+ }
163
+ if (expires instanceof Date && expires.getTime()) {
164
+ return expires.toUTCString();
165
+ }
166
+
167
+ module.error(error.expiresFormat);
168
+ },
169
+ storage: function () {
170
+ if (settings.storageMethod === 'localstorage' && window.localStorage !== undefined) {
171
+ module.debug('Using local storage');
172
+
173
+ return window.localStorage;
174
+ }
175
+ if (settings.storageMethod === 'sessionstorage' && window.sessionStorage !== undefined) {
176
+ module.debug('Using session storage');
177
+
178
+ return window.sessionStorage;
179
+ }
180
+ if ('cookie' in document) {
181
+ module.debug('Using cookie');
182
+
183
+ return {
184
+ setItem: function (key, value, options) {
185
+ // RFC6265 compliant encoding
186
+ key = encodeURIComponent(key)
187
+ .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
188
+ .replace(/[()]/g, escape)
189
+ ;
190
+ value = encodeURIComponent(value)
191
+ .replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[B-D])/g, decodeURIComponent)
192
+ ;
193
+
194
+ var cookieOptions = '';
195
+ for (var option in options) {
196
+ if (Object.prototype.hasOwnProperty.call(options, option)) {
197
+ cookieOptions += '; ' + option;
198
+ if (typeof options[option] === 'string') {
199
+ cookieOptions += '=' + options[option].split(';')[0];
200
+ }
201
+ }
202
+ }
203
+ document.cookie = key + '=' + value + cookieOptions;
204
+ },
205
+ getItem: function (key) {
206
+ var cookies = document.cookie.split('; ');
207
+ for (var i = 0, il = cookies.length; i < il; i++) {
208
+ var
209
+ parts = cookies[i].split('='),
210
+ foundKey = parts[0].replace(/(%[\da-f]{2})+/gi, decodeURIComponent)
211
+ ;
212
+ if (key === foundKey) {
213
+ return parts[1] || '';
214
+ }
215
+ }
216
+ },
217
+ removeItem: function (key, options) {
218
+ storage.setItem(key, '', options);
219
+ },
220
+ };
221
+ }
222
+
223
+ module.error(error.noStorage);
224
+ },
225
+ storageOptions: function () {
226
+ var
227
+ options = {}
228
+ ;
229
+ if (settings.expires) {
230
+ options.expires = module.get.expirationDate(settings.expires);
231
+ }
232
+ if (settings.domain) {
233
+ options.domain = settings.domain;
234
+ }
235
+ if (settings.path) {
236
+ options.path = settings.path;
237
+ }
238
+ if (settings.secure) {
239
+ options.secure = settings.secure;
240
+ }
241
+ if (settings.samesite) {
242
+ options.samesite = settings.samesite;
243
+ }
244
+
245
+ return options;
246
+ },
247
+ },
248
+
249
+ clear: function () {
250
+ module.storage.remove(settings.key);
251
+ },
252
+
253
+ storage: {
254
+ set: function (key, value) {
255
+ var
256
+ options = module.get.storageOptions()
257
+ ;
258
+ if (storage === window.localStorage && options.expires) {
259
+ module.debug('Storing expiration value in localStorage', key, options.expires);
260
+ storage.setItem(key + settings.expirationKey, options.expires);
261
+ }
262
+ module.debug('Value stored', key, value);
263
+ try {
264
+ storage.setItem(key, value, options);
265
+ } catch (e) {
266
+ module.error(error.setItem, e);
267
+ }
268
+ },
269
+ get: function (key) {
270
+ var
271
+ storedValue
272
+ ;
273
+ storedValue = storage.getItem(key);
274
+ if (storage === window.localStorage) {
275
+ var expiration = storage.getItem(key + settings.expirationKey);
276
+ if (expiration !== null && expiration !== undefined && new Date(expiration) < new Date()) {
277
+ module.debug('Value in localStorage has expired. Deleting key', key);
278
+ module.storage.remove(key);
279
+ storedValue = null;
280
+ }
281
+ }
282
+ if (storedValue === 'undefined' || storedValue === 'null' || storedValue === undefined || storedValue === null) {
283
+ storedValue = undefined;
284
+ }
285
+
286
+ return storedValue;
287
+ },
288
+ remove: function (key) {
289
+ var
290
+ options = module.get.storageOptions()
291
+ ;
292
+ options.expires = module.get.expirationDate(-1);
293
+ if (storage === window.localStorage) {
294
+ storage.removeItem(key + settings.expirationKey);
295
+ }
296
+ storage.removeItem(key, options);
297
+ },
208
298
  },
209
- removeItem: function(key, options) {
210
- storage.setItem(key,'',options);
299
+
300
+ setting: function (name, value) {
301
+ module.debug('Changing setting', name, value);
302
+ if ($.isPlainObject(name)) {
303
+ $.extend(true, settings, name);
304
+ } else if (value !== undefined) {
305
+ if ($.isPlainObject(settings[name])) {
306
+ $.extend(true, settings[name], value);
307
+ } else {
308
+ settings[name] = value;
309
+ }
310
+ } else {
311
+ return settings[name];
312
+ }
313
+ },
314
+ internal: function (name, value) {
315
+ if ($.isPlainObject(name)) {
316
+ $.extend(true, module, name);
317
+ } else if (value !== undefined) {
318
+ module[name] = value;
319
+ } else {
320
+ return module[name];
321
+ }
322
+ },
323
+ debug: function () {
324
+ if (!settings.silent && settings.debug) {
325
+ if (settings.performance) {
326
+ module.performance.log(arguments);
327
+ } else {
328
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
329
+ module.debug.apply(console, arguments);
330
+ }
331
+ }
332
+ },
333
+ verbose: function () {
334
+ if (!settings.silent && settings.verbose && settings.debug) {
335
+ if (settings.performance) {
336
+ module.performance.log(arguments);
337
+ } else {
338
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
339
+ module.verbose.apply(console, arguments);
340
+ }
341
+ }
342
+ },
343
+ error: function () {
344
+ if (!settings.silent) {
345
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
346
+ module.error.apply(console, arguments);
347
+ }
348
+ },
349
+ performance: {
350
+ log: function (message) {
351
+ var
352
+ currentTime,
353
+ executionTime,
354
+ previousTime
355
+ ;
356
+ if (settings.performance) {
357
+ currentTime = Date.now();
358
+ previousTime = time || currentTime;
359
+ executionTime = currentTime - previousTime;
360
+ time = currentTime;
361
+ performance.push({
362
+ Name: message[0],
363
+ Arguments: [].slice.call(message, 1) || '',
364
+ Element: element,
365
+ 'Execution Time': executionTime,
366
+ });
367
+ }
368
+ clearTimeout(module.performance.timer);
369
+ module.performance.timer = setTimeout(module.performance.display, 500);
370
+ },
371
+ display: function () {
372
+ var
373
+ title = settings.name + ':',
374
+ totalTime = 0
375
+ ;
376
+ time = false;
377
+ clearTimeout(module.performance.timer);
378
+ $.each(performance, function (index, data) {
379
+ totalTime += data['Execution Time'];
380
+ });
381
+ title += ' ' + totalTime + 'ms';
382
+ if (moduleSelector) {
383
+ title += ' \'' + moduleSelector + '\'';
384
+ }
385
+ if (performance.length > 0) {
386
+ console.groupCollapsed(title);
387
+ if (console.table) {
388
+ console.table(performance);
389
+ } else {
390
+ $.each(performance, function (index, data) {
391
+ console.log(data.Name + ': ' + data['Execution Time'] + 'ms');
392
+ });
393
+ }
394
+ console.groupEnd();
395
+ }
396
+ performance = [];
397
+ },
398
+ },
399
+ invoke: function (query, passedArguments, context) {
400
+ var
401
+ object = instance,
402
+ maxDepth,
403
+ found,
404
+ response
405
+ ;
406
+ passedArguments = passedArguments || queryArguments;
407
+ context = context || element;
408
+ if (typeof query === 'string' && object !== undefined) {
409
+ query = query.split(/[ .]/);
410
+ maxDepth = query.length - 1;
411
+ $.each(query, function (depth, value) {
412
+ var camelCaseValue = depth !== maxDepth
413
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
414
+ : query
415
+ ;
416
+ if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
417
+ object = object[camelCaseValue];
418
+ } else if (object[camelCaseValue] !== undefined) {
419
+ found = object[camelCaseValue];
420
+
421
+ return false;
422
+ } else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
423
+ object = object[value];
424
+ } else if (object[value] !== undefined) {
425
+ found = object[value];
426
+
427
+ return false;
428
+ } else {
429
+ module.error(error.method, query);
430
+
431
+ return false;
432
+ }
433
+ });
434
+ }
435
+ if (isFunction(found)) {
436
+ response = found.apply(context, passedArguments);
437
+ } else if (found !== undefined) {
438
+ response = found;
439
+ }
440
+ if (Array.isArray(returnedValue)) {
441
+ returnedValue.push(response);
442
+ } else if (returnedValue !== undefined) {
443
+ returnedValue = [returnedValue, response];
444
+ } else if (response !== undefined) {
445
+ returnedValue = response;
446
+ }
447
+
448
+ return found;
449
+ },
450
+ };
451
+
452
+ if (methodInvoked) {
453
+ if (instance === undefined) {
454
+ module.initialize();
211
455
  }
212
- };
456
+ module.invoke(query);
213
457
  } else {
214
- module.error(error.noStorage);
215
- }
216
- },
217
- storageOptions: function() {
218
- var
219
- options = {}
220
- ;
221
- if(settings.expires) {
222
- options.expires = module.get.expirationDate(settings.expires);
223
- }
224
- if(settings.domain) {
225
- options.domain = settings.domain;
226
- }
227
- if(settings.path) {
228
- options.path = settings.path;
229
- }
230
- if(settings.secure) {
231
- options.secure = settings.secure;
232
- }
233
- if(settings.samesite) {
234
- options.samesite = settings.samesite;
458
+ if (instance !== undefined) {
459
+ instance.invoke('destroy');
460
+ }
461
+ module.initialize();
235
462
  }
236
- return options;
237
- }
238
- },
463
+ });
239
464
 
240
- clear: function() {
241
- module.storage.remove(settings.key);
242
- },
465
+ return returnedValue !== undefined
466
+ ? returnedValue
467
+ : this;
468
+ };
243
469
 
244
- storage: {
245
- set: function(key, value) {
246
- var
247
- options = module.get.storageOptions()
248
- ;
249
- if(storage === window.localStorage && options.expires) {
250
- module.debug('Storing expiration value in localStorage', key, options.expires);
251
- storage.setItem(key + settings.expirationKey, options.expires );
252
- }
253
- module.debug('Value stored', key, value);
254
- try {
255
- storage.setItem(key, value, options);
256
- }
257
- catch(e) {
258
- module.error(error.setItem, e);
259
- }
260
- },
261
- get: function(key) {
262
- var
263
- storedValue
264
- ;
265
- storedValue = storage.getItem(key);
266
- if(storage === window.localStorage) {
267
- var expiration = storage.getItem(key + settings.expirationKey);
268
- if(expiration !== null && expiration !== undefined && new Date(expiration) < new Date()) {
269
- module.debug('Value in localStorage has expired. Deleting key', key);
270
- module.storage.remove(key);
271
- storedValue = null;
272
- }
273
- }
274
- if(storedValue == 'undefined' || storedValue == 'null' || storedValue === undefined || storedValue === null) {
275
- storedValue = undefined;
276
- }
277
- return storedValue;
278
- },
279
- remove: function(key) {
280
- var
281
- options = module.get.storageOptions()
282
- ;
283
- options.expires = module.get.expirationDate(-1);
284
- if(storage === window.localStorage) {
285
- storage.removeItem(key + settings.expirationKey);
286
- }
287
- storage.removeItem(key, options);
288
- }
289
- },
470
+ $.fn.nag.settings = {
290
471
 
291
- setting: function(name, value) {
292
- module.debug('Changing setting', name, value);
293
- if( $.isPlainObject(name) ) {
294
- $.extend(true, settings, name);
295
- }
296
- else if(value !== undefined) {
297
- if($.isPlainObject(settings[name])) {
298
- $.extend(true, settings[name], value);
299
- }
300
- else {
301
- settings[name] = value;
302
- }
303
- }
304
- else {
305
- return settings[name];
306
- }
307
- },
308
- internal: function(name, value) {
309
- if( $.isPlainObject(name) ) {
310
- $.extend(true, module, name);
311
- }
312
- else if(value !== undefined) {
313
- module[name] = value;
314
- }
315
- else {
316
- return module[name];
317
- }
318
- },
319
- debug: function() {
320
- if(!settings.silent && settings.debug) {
321
- if(settings.performance) {
322
- module.performance.log(arguments);
323
- }
324
- else {
325
- module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
326
- module.debug.apply(console, arguments);
327
- }
328
- }
472
+ name: 'Nag',
473
+
474
+ silent: false,
475
+ debug: false,
476
+ verbose: false,
477
+ performance: true,
478
+
479
+ namespace: 'Nag',
480
+
481
+ // allows cookie to be overridden
482
+ persist: false,
483
+
484
+ // set to zero to require manually dismissal, otherwise hides on its own
485
+ displayTime: 0,
486
+
487
+ animation: {
488
+ show: 'slide',
489
+ hide: 'slide',
329
490
  },
330
- verbose: function() {
331
- if(!settings.silent && settings.verbose && settings.debug) {
332
- if(settings.performance) {
333
- module.performance.log(arguments);
334
- }
335
- else {
336
- module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
337
- module.verbose.apply(console, arguments);
338
- }
339
- }
491
+
492
+ context: false,
493
+ detachable: false,
494
+
495
+ expires: 30,
496
+
497
+ // cookie storage only options
498
+ domain: false,
499
+ path: '/',
500
+ secure: false,
501
+ samesite: false,
502
+
503
+ // type of storage to use
504
+ storageMethod: 'cookie',
505
+
506
+ // value to store in dismissed localstorage/cookie
507
+ key: 'nag',
508
+ value: 'dismiss',
509
+
510
+ // Key suffix to support expiration in localstorage
511
+ expirationKey: 'ExpirationDate',
512
+
513
+ error: {
514
+ noStorage: 'Unsupported storage method',
515
+ method: 'The method you called is not defined.',
516
+ setItem: 'Unexpected error while setting value',
517
+ expiresFormat: '"expires" must be a number of days or a Date Object',
340
518
  },
341
- error: function() {
342
- if(!settings.silent) {
343
- module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
344
- module.error.apply(console, arguments);
345
- }
519
+
520
+ className: {
521
+ bottom: 'bottom',
522
+ fixed: 'fixed',
346
523
  },
347
- performance: {
348
- log: function(message) {
349
- var
350
- currentTime,
351
- executionTime,
352
- previousTime
353
- ;
354
- if(settings.performance) {
355
- currentTime = new Date().getTime();
356
- previousTime = time || currentTime;
357
- executionTime = currentTime - previousTime;
358
- time = currentTime;
359
- performance.push({
360
- 'Name' : message[0],
361
- 'Arguments' : [].slice.call(message, 1) || '',
362
- 'Element' : element,
363
- 'Execution Time' : executionTime
364
- });
365
- }
366
- clearTimeout(module.performance.timer);
367
- module.performance.timer = setTimeout(module.performance.display, 500);
368
- },
369
- display: function() {
370
- var
371
- title = settings.name + ':',
372
- totalTime = 0
373
- ;
374
- time = false;
375
- clearTimeout(module.performance.timer);
376
- $.each(performance, function(index, data) {
377
- totalTime += data['Execution Time'];
378
- });
379
- title += ' ' + totalTime + 'ms';
380
- if(moduleSelector) {
381
- title += ' \'' + moduleSelector + '\'';
382
- }
383
- if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
384
- console.groupCollapsed(title);
385
- if(console.table) {
386
- console.table(performance);
387
- }
388
- else {
389
- $.each(performance, function(index, data) {
390
- console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
391
- });
392
- }
393
- console.groupEnd();
394
- }
395
- performance = [];
396
- }
524
+
525
+ selector: {
526
+ close: '> .close.icon',
397
527
  },
398
- invoke: function(query, passedArguments, context) {
399
- var
400
- object = instance,
401
- maxDepth,
402
- found,
403
- response
404
- ;
405
- passedArguments = passedArguments || queryArguments;
406
- context = context || element;
407
- if(typeof query == 'string' && object !== undefined) {
408
- query = query.split(/[\. ]/);
409
- maxDepth = query.length - 1;
410
- $.each(query, function(depth, value) {
411
- var camelCaseValue = (depth != maxDepth)
412
- ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
413
- : query
414
- ;
415
- if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
416
- object = object[camelCaseValue];
417
- }
418
- else if( object[camelCaseValue] !== undefined ) {
419
- found = object[camelCaseValue];
420
- return false;
421
- }
422
- else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
423
- object = object[value];
424
- }
425
- else if( object[value] !== undefined ) {
426
- found = object[value];
427
- return false;
428
- }
429
- else {
430
- module.error(error.method, query);
431
- return false;
432
- }
433
- });
434
- }
435
- if ( $.isFunction( found ) ) {
436
- response = found.apply(context, passedArguments);
437
- }
438
- else if(found !== undefined) {
439
- response = found;
440
- }
441
- if(Array.isArray(returnedValue)) {
442
- returnedValue.push(response);
443
- }
444
- else if(returnedValue !== undefined) {
445
- returnedValue = [returnedValue, response];
446
- }
447
- else if(response !== undefined) {
448
- returnedValue = response;
449
- }
450
- return found;
451
- }
452
- };
453
-
454
- if(methodInvoked) {
455
- if(instance === undefined) {
456
- module.initialize();
457
- }
458
- module.invoke(query);
459
- }
460
- else {
461
- if(instance !== undefined) {
462
- instance.invoke('destroy');
463
- }
464
- module.initialize();
465
- }
466
- })
467
- ;
468
-
469
- return (returnedValue !== undefined)
470
- ? returnedValue
471
- : this
472
- ;
473
- };
474
-
475
- $.fn.nag.settings = {
476
-
477
- name : 'Nag',
478
-
479
- silent : false,
480
- debug : false,
481
- verbose : false,
482
- performance : true,
483
-
484
- namespace : 'Nag',
485
-
486
- // allows cookie to be overridden
487
- persist : false,
488
-
489
- // set to zero to require manually dismissal, otherwise hides on its own
490
- displayTime : 0,
491
-
492
- animation : {
493
- show : 'slide',
494
- hide : 'slide'
495
- },
496
-
497
- context : false,
498
- detachable : false,
499
-
500
- expires : 30,
501
-
502
- // cookie storage only options
503
- domain : false,
504
- path : '/',
505
- secure : false,
506
- samesite : false,
507
-
508
- // type of storage to use
509
- storageMethod : 'cookie',
510
-
511
- // value to store in dismissed localstorage/cookie
512
- key : 'nag',
513
- value : 'dismiss',
514
-
515
- // Key suffix to support expiration in localstorage
516
- expirationKey : 'ExpirationDate',
517
-
518
- error: {
519
- noStorage : 'Unsupported storage method',
520
- method : 'The method you called is not defined.',
521
- setItem : 'Unexpected error while setting value',
522
- expiresFormat : '"expires" must be a number of days or a Date Object'
523
- },
524
-
525
- className : {
526
- bottom : 'bottom',
527
- fixed : 'fixed'
528
- },
529
-
530
- selector : {
531
- close : '> .close.icon'
532
- },
533
-
534
- duration : 500,
535
- easing : 'easeOutQuad',
536
-
537
- // callback before show animation, return false to prevent show
538
- onShow : function() {},
539
-
540
- // called after show animation
541
- onVisible : function() {},
542
-
543
- // callback before hide animation, return false to prevent hide
544
- onHide : function() {},
545
-
546
- // callback after hide animation
547
- onHidden : function() {}
548
-
549
- };
550
-
551
- // Adds easing
552
- $.extend( $.easing, {
553
- easeOutQuad: function (x, t, b, c, d) {
554
- return -c *(t/=d)*(t-2) + b;
555
- }
556
- });
557
528
 
558
- })( jQuery, window, document );
529
+ duration: 500,
530
+ easing: 'easeOutQuad',
531
+
532
+ // callback before show animation, return false to prevent show
533
+ onShow: function () {},
534
+
535
+ // called after show animation
536
+ onVisible: function () {},
537
+
538
+ // callback before hide animation, return false to prevent hide
539
+ onHide: function () {},
540
+
541
+ // callback after hide animation
542
+ onHidden: function () {},
543
+
544
+ };
545
+
546
+ // Adds easing
547
+ $.extend($.easing, {
548
+ easeOutQuad: function (x) {
549
+ return 1 - (1 - x) * (1 - x);
550
+ },
551
+ });
552
+ })(jQuery, window, document);