fomantic-ui 2.9.1-beta.22 → 2.9.1-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslint/index.js +23 -0
- package/.eslint/no-extra-parens-rule.js +17 -0
- package/.eslint/package.json +11 -0
- package/.eslintrc.js +13 -70
- package/.stylelintrc.js +5 -7
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +26 -26
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +2 -2
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +95 -94
- package/dist/components/api.min.js +2 -2
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +1 -1
- package/dist/components/button.min.css +1 -1
- package/dist/components/calendar.css +3 -3
- package/dist/components/calendar.js +181 -151
- package/dist/components/calendar.min.css +2 -2
- package/dist/components/calendar.min.js +2 -2
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +14 -14
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +2 -2
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +1 -1
- package/dist/components/container.min.css +1 -1
- package/dist/components/dimmer.css +1 -1
- package/dist/components/dimmer.js +23 -25
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +2 -2
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +1 -1
- package/dist/components/dropdown.js +252 -254
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +27 -33
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +2 -2
- package/dist/components/flyout.js +50 -44
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +2 -2
- package/dist/components/form.js +187 -163
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +2 -2
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +49 -45
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +22 -20
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +2 -2
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -1
- package/dist/components/popup.js +71 -71
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +46 -46
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +2 -2
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +15 -15
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +1 -1
- package/dist/components/search.js +69 -74
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +39 -39
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +2 -2
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +39 -37
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +22 -21
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.js +69 -64
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +15 -15
- package/dist/components/state.min.js +2 -2
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +25 -25
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +2 -2
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +55 -57
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +1 -1
- package/dist/components/table.min.css +1 -1
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +57 -30
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +7 -7
- package/dist/components/transition.js +45 -39
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +25 -25
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +60 -60
- package/dist/semantic.js +1518 -1427
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/examples/responsive.html +1 -1
- package/gulpfile.js +1 -1
- package/package.json +2 -1
- package/scripts/nightly-version.js +6 -4
- package/src/definitions/behaviors/api.js +94 -93
- package/src/definitions/behaviors/form.js +186 -162
- package/src/definitions/behaviors/state.js +14 -14
- package/src/definitions/behaviors/visibility.js +24 -24
- package/src/definitions/collections/menu.less +2 -2
- package/src/definitions/elements/button.less +2 -2
- package/src/definitions/elements/loader.less +4 -4
- package/src/definitions/elements/step.less +1 -1
- package/src/definitions/globals/site.js +21 -20
- package/src/definitions/modules/accordion.js +25 -25
- package/src/definitions/modules/calendar.js +180 -150
- package/src/definitions/modules/calendar.less +2 -2
- package/src/definitions/modules/checkbox.js +13 -13
- package/src/definitions/modules/dimmer.js +22 -24
- package/src/definitions/modules/dimmer.less +10 -10
- package/src/definitions/modules/dropdown.js +251 -253
- package/src/definitions/modules/embed.js +26 -32
- package/src/definitions/modules/flyout.js +49 -43
- package/src/definitions/modules/flyout.less +1 -1
- package/src/definitions/modules/modal.js +48 -44
- package/src/definitions/modules/nag.js +21 -19
- package/src/definitions/modules/popup.js +70 -70
- package/src/definitions/modules/progress.js +45 -45
- package/src/definitions/modules/rating.js +14 -14
- package/src/definitions/modules/search.js +68 -73
- package/src/definitions/modules/shape.js +38 -38
- package/src/definitions/modules/sidebar.js +38 -36
- package/src/definitions/modules/slider.js +68 -63
- package/src/definitions/modules/sticky.js +24 -24
- package/src/definitions/modules/tab.js +54 -56
- package/src/definitions/modules/toast.js +56 -29
- package/src/definitions/modules/transition.js +44 -38
- package/src/themes/amazon/elements/button.overrides +7 -7
- package/src/themes/default/collections/form.variables +1 -1
- package/src/themes/default/elements/reveal.variables +1 -1
- package/src/themes/default/globals/site.variables +1 -1
- package/src/themes/default/modules/dimmer.variables +6 -6
- package/src/themes/default/modules/modal.variables +1 -1
- package/src/themes/default/modules/slider.variables +4 -4
- package/src/themes/default/modules/toast.variables +2 -2
- package/src/themes/default/modules/transition.overrides +12 -12
- package/src/themes/flat/collections/form.overrides +2 -2
- package/src/themes/flat/globals/site.variables +1 -1
- package/src/themes/github/collections/form.overrides +2 -2
- package/src/themes/github/collections/menu.variables +1 -1
- package/src/themes/github/collections/message.overrides +3 -3
- package/src/themes/github/elements/input.overrides +2 -2
- package/src/themes/timeline/views/feed.overrides +3 -3
- package/src/themes/twitter/elements/button.overrides +2 -2
- package/tasks/README.md +1 -3
- package/tasks/admin/components/create.js +9 -16
- package/tasks/admin/components/init.js +7 -7
- package/tasks/admin/components/update.js +10 -10
- package/tasks/admin/distributions/create.js +16 -18
- package/tasks/admin/distributions/init.js +7 -7
- package/tasks/admin/distributions/update.js +10 -10
- package/tasks/admin/publish.js +1 -3
- package/tasks/admin/register.js +6 -6
- package/tasks/admin/release.js +1 -3
- package/tasks/build/assets.js +2 -2
- package/tasks/build/css.js +8 -3
- package/tasks/build/javascript.js +3 -1
- package/tasks/build.js +1 -1
- package/tasks/check-install.js +1 -1
- package/tasks/clean.js +1 -1
- package/tasks/collections/README.md +3 -5
- package/tasks/collections/admin.js +1 -1
- package/tasks/collections/docs.js +1 -1
- package/tasks/collections/install.js +1 -1
- package/tasks/collections/rtl.js +1 -1
- package/tasks/collections/various.js +1 -1
- package/tasks/config/admin/github.js +6 -8
- package/tasks/config/admin/templates/css-package.js +1 -1
- package/tasks/config/admin/templates/less-package.js +1 -1
- package/tasks/config/npm/gulpfile.js +7 -7
- package/tasks/config/project/config.js +14 -19
- package/tasks/config/project/install.js +35 -34
- package/tasks/config/project/release.js +15 -16
- package/tasks/config/tasks.js +18 -20
- package/tasks/config/user.js +5 -3
- package/tasks/docs/build.js +5 -3
- package/tasks/docs/metadata.js +7 -8
- package/tasks/docs/serve.js +6 -3
- package/tasks/install.js +39 -39
- package/tasks/rtl/build.js +1 -3
- package/tasks/rtl/watch.js +1 -3
- package/tasks/version.js +1 -3
- package/tasks/watch.js +1 -1
- package/test/.eslintrc.js +0 -4
- package/test/meteor/assets.js +1 -1
- package/test/modules/module.spec.js +15 -15
- package/test/modules/popup.spec.js +1 -1
- package/test/modules/search.spec.js +1 -1
- package/test/modules/tab.spec.js +1 -1
- package/test/modules/transition.spec.js +1 -1
@@ -15,7 +15,7 @@
|
|
15
15
|
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
16
16
|
}
|
17
17
|
|
18
|
-
window =
|
18
|
+
window = window !== undefined && window.Math === Math
|
19
19
|
? window
|
20
20
|
: globalThis;
|
21
21
|
|
@@ -25,18 +25,18 @@
|
|
25
25
|
$document = $(document),
|
26
26
|
moduleSelector = $allModules.selector || '',
|
27
27
|
|
28
|
-
time =
|
28
|
+
time = Date.now(),
|
29
29
|
performance = [],
|
30
30
|
|
31
31
|
query = arguments[0],
|
32
|
-
methodInvoked =
|
32
|
+
methodInvoked = typeof query === 'string',
|
33
33
|
queryArguments = [].slice.call(arguments, 1),
|
34
34
|
returnedValue
|
35
35
|
;
|
36
36
|
|
37
37
|
$allModules.each(function () {
|
38
38
|
var
|
39
|
-
settings =
|
39
|
+
settings = $.isPlainObject(parameters)
|
40
40
|
? $.extend(true, {}, $.fn.sticky.settings, parameters)
|
41
41
|
: $.extend({}, $.fn.sticky.settings),
|
42
42
|
|
@@ -237,7 +237,7 @@
|
|
237
237
|
;
|
238
238
|
$element.addClass(className.supported);
|
239
239
|
|
240
|
-
return
|
240
|
+
return $element.css('position').match('sticky');
|
241
241
|
},
|
242
242
|
},
|
243
243
|
|
@@ -279,8 +279,8 @@
|
|
279
279
|
context.offset.left += scrollContext.left;
|
280
280
|
}
|
281
281
|
module.cache = {
|
282
|
-
fits: (
|
283
|
-
sameHeight:
|
282
|
+
fits: (element.height + settings.offset) <= scrollContext.height,
|
283
|
+
sameHeight: element.height == context.height,
|
284
284
|
scrollContext: {
|
285
285
|
height: scrollContext.height,
|
286
286
|
},
|
@@ -320,8 +320,8 @@
|
|
320
320
|
scrollChange: function (scroll) {
|
321
321
|
scroll = scroll || $scroll.scrollTop();
|
322
322
|
|
323
|
-
return
|
324
|
-
?
|
323
|
+
return module.lastScroll
|
324
|
+
? scroll - module.lastScroll
|
325
325
|
: 0;
|
326
326
|
},
|
327
327
|
currentElementScroll: function () {
|
@@ -329,7 +329,7 @@
|
|
329
329
|
return module.elementScroll;
|
330
330
|
}
|
331
331
|
|
332
|
-
return
|
332
|
+
return module.is.top()
|
333
333
|
? Math.abs(parseInt($module.css('top'), 10)) || 0
|
334
334
|
: Math.abs(parseInt($module.css('bottom'), 10)) || 0;
|
335
335
|
},
|
@@ -340,9 +340,9 @@
|
|
340
340
|
element = module.cache.element,
|
341
341
|
scrollContext = module.cache.scrollContext,
|
342
342
|
delta = module.get.scrollChange(scroll),
|
343
|
-
maxScroll =
|
343
|
+
maxScroll = element.height - scrollContext.height + settings.offset,
|
344
344
|
elementScroll = module.get.currentElementScroll(),
|
345
|
-
possibleScroll =
|
345
|
+
possibleScroll = elementScroll + delta
|
346
346
|
;
|
347
347
|
if (module.cache.fits || possibleScroll < 0) {
|
348
348
|
elementScroll = 0;
|
@@ -424,7 +424,7 @@
|
|
424
424
|
if (module.is.top()) {
|
425
425
|
$module
|
426
426
|
.css('bottom', '')
|
427
|
-
.css('top',
|
427
|
+
.css('top', -scroll + 'px')
|
428
428
|
;
|
429
429
|
}
|
430
430
|
if (module.is.bottom()) {
|
@@ -444,7 +444,7 @@
|
|
444
444
|
|
445
445
|
is: {
|
446
446
|
standardScroll: function () {
|
447
|
-
return
|
447
|
+
return $scroll[0] == window;
|
448
448
|
},
|
449
449
|
top: function () {
|
450
450
|
return $module.hasClass(className.top);
|
@@ -453,10 +453,10 @@
|
|
453
453
|
return $module.hasClass(className.bottom);
|
454
454
|
},
|
455
455
|
initialPosition: function () {
|
456
|
-
return
|
456
|
+
return !module.is.fixed() && !module.is.bound();
|
457
457
|
},
|
458
458
|
hidden: function () {
|
459
|
-
return
|
459
|
+
return !$module.is(':visible');
|
460
460
|
},
|
461
461
|
bound: function () {
|
462
462
|
return $module.hasClass(className.bound);
|
@@ -475,20 +475,20 @@
|
|
475
475
|
element = cache.element,
|
476
476
|
scrollContext = cache.scrollContext,
|
477
477
|
context = cache.context,
|
478
|
-
offset =
|
478
|
+
offset = module.is.bottom() && settings.pushing
|
479
479
|
? settings.bottomOffset
|
480
480
|
: settings.offset,
|
481
481
|
scroll = {
|
482
482
|
top: cachedPosition + offset,
|
483
483
|
bottom: cachedPosition + offset + scrollContext.height,
|
484
484
|
},
|
485
|
-
elementScroll =
|
485
|
+
elementScroll = fits
|
486
486
|
? 0
|
487
487
|
: module.get.elementScroll(scroll.top),
|
488
488
|
|
489
489
|
// shorthand
|
490
490
|
doesntFit = !fits,
|
491
|
-
elementVisible =
|
491
|
+
elementVisible = element.height !== 0
|
492
492
|
;
|
493
493
|
if (elementVisible && !sameHeight) {
|
494
494
|
if (module.is.initialPosition()) {
|
@@ -740,7 +740,7 @@
|
|
740
740
|
previousTime
|
741
741
|
;
|
742
742
|
if (settings.performance) {
|
743
|
-
currentTime =
|
743
|
+
currentTime = Date.now();
|
744
744
|
previousTime = time || currentTime;
|
745
745
|
executionTime = currentTime - previousTime;
|
746
746
|
time = currentTime;
|
@@ -791,11 +791,11 @@
|
|
791
791
|
;
|
792
792
|
passedArguments = passedArguments || queryArguments;
|
793
793
|
context = context || element;
|
794
|
-
if (typeof query
|
795
|
-
query = query.split(/[
|
794
|
+
if (typeof query === 'string' && object !== undefined) {
|
795
|
+
query = query.split(/[ .]/);
|
796
796
|
maxDepth = query.length - 1;
|
797
797
|
$.each(query, function (depth, value) {
|
798
|
-
var camelCaseValue =
|
798
|
+
var camelCaseValue = depth != maxDepth
|
799
799
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
800
800
|
: query
|
801
801
|
;
|
@@ -846,7 +846,7 @@
|
|
846
846
|
}
|
847
847
|
});
|
848
848
|
|
849
|
-
return
|
849
|
+
return returnedValue !== undefined
|
850
850
|
? returnedValue
|
851
851
|
: this;
|
852
852
|
};
|
@@ -19,7 +19,7 @@
|
|
19
19
|
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
20
20
|
}
|
21
21
|
|
22
|
-
window =
|
22
|
+
window = window !== undefined && window.Math === Math
|
23
23
|
? window
|
24
24
|
: globalThis;
|
25
25
|
|
@@ -31,11 +31,11 @@
|
|
31
31
|
: $(this),
|
32
32
|
$document = $(document),
|
33
33
|
moduleSelector = $allModules.selector || '',
|
34
|
-
time =
|
34
|
+
time = Date.now(),
|
35
35
|
performance = [],
|
36
36
|
|
37
37
|
query = arguments[0],
|
38
|
-
methodInvoked =
|
38
|
+
methodInvoked = typeof query === 'string',
|
39
39
|
queryArguments = [].slice.call(arguments, 1),
|
40
40
|
|
41
41
|
initializedHistory = false,
|
@@ -44,8 +44,7 @@
|
|
44
44
|
|
45
45
|
$allModules.each(function () {
|
46
46
|
var
|
47
|
-
|
48
|
-
settings = ($.isPlainObject(parameters))
|
47
|
+
settings = $.isPlainObject(parameters)
|
49
48
|
? $.extend(true, {}, $.fn.tab.settings, parameters)
|
50
49
|
: $.extend({}, $.fn.tab.settings),
|
51
50
|
|
@@ -193,25 +192,24 @@
|
|
193
192
|
module.error(error.state);
|
194
193
|
|
195
194
|
return false;
|
196
|
-
}
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
195
|
+
}
|
196
|
+
if (settings.historyType == 'state') {
|
197
|
+
module.debug('Using HTML5 to manage state');
|
198
|
+
if (settings.path !== false) {
|
199
|
+
$.address
|
200
|
+
.history(true)
|
201
|
+
.state(settings.path)
|
202
|
+
;
|
203
|
+
$(window).trigger('popstate');
|
204
|
+
} else {
|
205
|
+
module.error(error.path);
|
207
206
|
|
208
|
-
|
209
|
-
}
|
207
|
+
return false;
|
210
208
|
}
|
211
|
-
$.address
|
212
|
-
.bind('change', module.event.history.change)
|
213
|
-
;
|
214
209
|
}
|
210
|
+
$.address
|
211
|
+
.bind('change', module.event.history.change)
|
212
|
+
;
|
215
213
|
},
|
216
214
|
|
217
215
|
event: {
|
@@ -261,7 +259,7 @@
|
|
261
259
|
cache: {
|
262
260
|
|
263
261
|
read: function (cacheKey) {
|
264
|
-
return
|
262
|
+
return cacheKey !== undefined
|
265
263
|
? cache[cacheKey]
|
266
264
|
: false;
|
267
265
|
},
|
@@ -288,7 +286,7 @@
|
|
288
286
|
set: {
|
289
287
|
auto: function () {
|
290
288
|
var
|
291
|
-
url =
|
289
|
+
url = typeof settings.path === 'string'
|
292
290
|
? settings.path.replace(/\/$/, '') + '/{$tab}'
|
293
291
|
: '/{$tab}'
|
294
292
|
;
|
@@ -325,11 +323,11 @@
|
|
325
323
|
|
326
324
|
changeTab: function (tabPath) {
|
327
325
|
var
|
328
|
-
pushStateAvailable =
|
329
|
-
shouldIgnoreLoad =
|
330
|
-
remoteContent =
|
326
|
+
pushStateAvailable = window.history && window.history.pushState,
|
327
|
+
shouldIgnoreLoad = pushStateAvailable && settings.ignoreFirstLoad && firstLoad,
|
328
|
+
remoteContent = settings.auto || $.isPlainObject(settings.apiSettings),
|
331
329
|
// only add default path if not remote content
|
332
|
-
pathArray =
|
330
|
+
pathArray = remoteContent && !shouldIgnoreLoad
|
333
331
|
? module.utilities.pathToArray(tabPath)
|
334
332
|
: module.get.defaultPathArray(tabPath)
|
335
333
|
;
|
@@ -340,7 +338,7 @@
|
|
340
338
|
currentPath = module.utilities.arrayToPath(currentPathArray),
|
341
339
|
|
342
340
|
isTab = module.is.tab(currentPath),
|
343
|
-
isLastIndex =
|
341
|
+
isLastIndex = index + 1 == pathArray.length,
|
344
342
|
|
345
343
|
$tab = module.get.tabElement(currentPath),
|
346
344
|
$anchor,
|
@@ -360,7 +358,7 @@
|
|
360
358
|
} else {
|
361
359
|
nextPathArray = pathArray.slice(0, index + 2);
|
362
360
|
nextPath = module.utilities.arrayToPath(nextPathArray);
|
363
|
-
isLastTab =
|
361
|
+
isLastTab = !module.is.tab(nextPath);
|
364
362
|
if (isLastTab) {
|
365
363
|
module.verbose('Tab parameters found', nextPathArray);
|
366
364
|
}
|
@@ -384,16 +382,16 @@
|
|
384
382
|
}
|
385
383
|
|
386
384
|
return false;
|
387
|
-
} else {
|
388
|
-
module.debug('Opened local tab', currentPath);
|
389
|
-
module.activate.all(currentPath);
|
390
|
-
if (!module.cache.read(currentPath)) {
|
391
|
-
module.cache.add(currentPath, true);
|
392
|
-
module.debug('First time tab loaded calling tab init');
|
393
|
-
settings.onFirstLoad.call($tab[0], currentPath, parameterArray, historyEvent);
|
394
|
-
}
|
395
|
-
settings.onLoad.call($tab[0], currentPath, parameterArray, historyEvent);
|
396
385
|
}
|
386
|
+
|
387
|
+
module.debug('Opened local tab', currentPath);
|
388
|
+
module.activate.all(currentPath);
|
389
|
+
if (!module.cache.read(currentPath)) {
|
390
|
+
module.cache.add(currentPath, true);
|
391
|
+
module.debug('First time tab loaded calling tab init');
|
392
|
+
settings.onFirstLoad.call($tab[0], currentPath, parameterArray, historyEvent);
|
393
|
+
}
|
394
|
+
settings.onLoad.call($tab[0], currentPath, parameterArray, historyEvent);
|
397
395
|
} else if (tabPath.search('/') == -1 && tabPath !== '') {
|
398
396
|
// look for in page anchor
|
399
397
|
tabPath = module.escape.string(tabPath);
|
@@ -433,7 +431,7 @@
|
|
433
431
|
|
434
432
|
scrollTo: function ($element) {
|
435
433
|
var
|
436
|
-
scrollOffset =
|
434
|
+
scrollOffset = $element && $element.length > 0
|
437
435
|
? $element.offset().top
|
438
436
|
: false
|
439
437
|
;
|
@@ -449,10 +447,10 @@
|
|
449
447
|
$tab = module.get.tabElement(tabPath),
|
450
448
|
tab = $tab[0]
|
451
449
|
;
|
452
|
-
evaluateScripts =
|
450
|
+
evaluateScripts = evaluateScripts !== undefined
|
453
451
|
? evaluateScripts
|
454
452
|
: settings.evaluateScripts;
|
455
|
-
if (typeof settings.cacheType
|
453
|
+
if (typeof settings.cacheType === 'string' && settings.cacheType.toLowerCase() == 'dom' && typeof html !== 'string') {
|
456
454
|
$tab
|
457
455
|
.empty()
|
458
456
|
.append($(html).clone(true))
|
@@ -498,7 +496,7 @@
|
|
498
496
|
|
499
497
|
if (settings.loadOnce) {
|
500
498
|
module.cache.add(fullTabPath, true);
|
501
|
-
} else if (typeof settings.cacheType
|
499
|
+
} else if (typeof settings.cacheType === 'string' && settings.cacheType.toLowerCase() == 'dom' && $tab.children().length > 0) {
|
502
500
|
setTimeout(function () {
|
503
501
|
var
|
504
502
|
$clone = $tab.children().clone(true)
|
@@ -515,7 +513,7 @@
|
|
515
513
|
},
|
516
514
|
},
|
517
515
|
request = $tab.api('get request') || false,
|
518
|
-
existingRequest =
|
516
|
+
existingRequest = request && request.state() === 'pending',
|
519
517
|
requestSettings,
|
520
518
|
cachedContent
|
521
519
|
;
|
@@ -556,7 +554,7 @@
|
|
556
554
|
tab: function (tabPath) {
|
557
555
|
var
|
558
556
|
$tab = module.get.tabElement(tabPath),
|
559
|
-
$deactiveTabs =
|
557
|
+
$deactiveTabs = settings.deactivate == 'siblings'
|
560
558
|
? $tab.siblings($tabs)
|
561
559
|
: $tabs.not($tab),
|
562
560
|
isActive = $tab.hasClass(className.active)
|
@@ -577,7 +575,7 @@
|
|
577
575
|
navigation: function (tabPath) {
|
578
576
|
var
|
579
577
|
$navigation = module.get.navElement(tabPath),
|
580
|
-
$deactiveNavigation =
|
578
|
+
$deactiveNavigation = settings.deactivate == 'siblings'
|
581
579
|
? $navigation.siblings($allModules)
|
582
580
|
: $allModules.not($navigation),
|
583
581
|
isActive = $navigation.hasClass(className.active)
|
@@ -613,8 +611,8 @@
|
|
613
611
|
|
614
612
|
is: {
|
615
613
|
tab: function (tabName) {
|
616
|
-
return
|
617
|
-
?
|
614
|
+
return tabName !== undefined
|
615
|
+
? module.get.tabElement(tabName).length > 0
|
618
616
|
: false;
|
619
617
|
},
|
620
618
|
},
|
@@ -668,7 +666,7 @@
|
|
668
666
|
$fullPathTab = $tabs.filter('[data-' + metadata.tab + '="' + module.escape.string(tabPath) + '"]');
|
669
667
|
$simplePathTab = $tabs.filter('[data-' + metadata.tab + '="' + module.escape.string(lastTab) + '"]');
|
670
668
|
|
671
|
-
return
|
669
|
+
return $fullPathTab.length > 0
|
672
670
|
? $fullPathTab
|
673
671
|
: $simplePathTab;
|
674
672
|
},
|
@@ -703,7 +701,7 @@
|
|
703
701
|
utilities: {
|
704
702
|
filterArray: function (keepArray, removeArray) {
|
705
703
|
return $.grep(keepArray, function (keepValue) {
|
706
|
-
return
|
704
|
+
return $.inArray(keepValue, removeArray) == -1;
|
707
705
|
});
|
708
706
|
},
|
709
707
|
last: function (array) {
|
@@ -716,7 +714,7 @@
|
|
716
714
|
pathName = activeTabPath;
|
717
715
|
}
|
718
716
|
|
719
|
-
return typeof pathName
|
717
|
+
return typeof pathName === 'string'
|
720
718
|
? pathName.split('/')
|
721
719
|
: [pathName];
|
722
720
|
},
|
@@ -784,7 +782,7 @@
|
|
784
782
|
previousTime
|
785
783
|
;
|
786
784
|
if (settings.performance) {
|
787
|
-
currentTime =
|
785
|
+
currentTime = Date.now();
|
788
786
|
previousTime = time || currentTime;
|
789
787
|
executionTime = currentTime - previousTime;
|
790
788
|
time = currentTime;
|
@@ -835,11 +833,11 @@
|
|
835
833
|
;
|
836
834
|
passedArguments = passedArguments || queryArguments;
|
837
835
|
context = context || element;
|
838
|
-
if (typeof query
|
839
|
-
query = query.split(/[
|
836
|
+
if (typeof query === 'string' && object !== undefined) {
|
837
|
+
query = query.split(/[ .]/);
|
840
838
|
maxDepth = query.length - 1;
|
841
839
|
$.each(query, function (depth, value) {
|
842
|
-
var camelCaseValue =
|
840
|
+
var camelCaseValue = depth != maxDepth
|
843
841
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
844
842
|
: query
|
845
843
|
;
|
@@ -891,7 +889,7 @@
|
|
891
889
|
}
|
892
890
|
});
|
893
891
|
|
894
|
-
return
|
892
|
+
return returnedValue !== undefined
|
895
893
|
? returnedValue
|
896
894
|
: this;
|
897
895
|
};
|
@@ -955,7 +953,7 @@
|
|
955
953
|
},
|
956
954
|
|
957
955
|
regExp: {
|
958
|
-
escape: /[
|
956
|
+
escape: /[\s#$()*+,.:=?@[\\\]^{|}-]/g,
|
959
957
|
},
|
960
958
|
|
961
959
|
metadata: {
|
@@ -15,26 +15,26 @@
|
|
15
15
|
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
16
16
|
}
|
17
17
|
|
18
|
-
window =
|
18
|
+
window = window !== undefined && window.Math === Math
|
19
19
|
? window
|
20
20
|
: globalThis;
|
21
21
|
|
22
|
-
$.
|
22
|
+
$.fn.toast = function (parameters) {
|
23
23
|
var
|
24
24
|
$allModules = $(this),
|
25
25
|
moduleSelector = $allModules.selector || '',
|
26
26
|
|
27
|
-
time =
|
27
|
+
time = Date.now(),
|
28
28
|
performance = [],
|
29
29
|
|
30
30
|
query = arguments[0],
|
31
|
-
methodInvoked =
|
31
|
+
methodInvoked = typeof query === 'string',
|
32
32
|
queryArguments = [].slice.call(arguments, 1),
|
33
33
|
returnedValue
|
34
34
|
;
|
35
35
|
$allModules.each(function () {
|
36
36
|
var
|
37
|
-
settings =
|
37
|
+
settings = $.isPlainObject(parameters)
|
38
38
|
? $.extend(true, {}, $.fn.toast.settings, parameters)
|
39
39
|
: $.extend({}, $.fn.toast.settings),
|
40
40
|
|
@@ -55,7 +55,7 @@
|
|
55
55
|
$progressBar,
|
56
56
|
$animationObject,
|
57
57
|
$close,
|
58
|
-
$context =
|
58
|
+
$context = settings.context
|
59
59
|
? ([window, document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context))
|
60
60
|
: $('body'),
|
61
61
|
|
@@ -147,7 +147,11 @@
|
|
147
147
|
create: {
|
148
148
|
container: function () {
|
149
149
|
module.verbose('Creating container');
|
150
|
-
$context.append($('<div/>', {
|
150
|
+
$context.append($('<div/>', {
|
151
|
+
class: settings.position + ' ' + className.container + ' '
|
152
|
+
+ (settings.horizontal ? className.horizontal : '') + ' '
|
153
|
+
+ (settings.context && settings.context !== 'body' ? className.absolute : ''),
|
154
|
+
}));
|
151
155
|
},
|
152
156
|
id: function () {
|
153
157
|
id = (Math.random().toString(16) + '000000000').slice(2, 10);
|
@@ -208,7 +212,7 @@
|
|
208
212
|
} else {
|
209
213
|
$toast = settings.cloneModule ? $module.clone().removeAttr('id') : $module;
|
210
214
|
$close = $toast.find('> i' + module.helpers.toClass(className.close));
|
211
|
-
settings.closeIcon =
|
215
|
+
settings.closeIcon = $close.length > 0;
|
212
216
|
if (iconClass !== '') {
|
213
217
|
$toast.find(selector.icon).attr('class', iconClass + ' ' + className.icon);
|
214
218
|
}
|
@@ -242,10 +246,15 @@
|
|
242
246
|
}
|
243
247
|
settings.actions.forEach(function (el) {
|
244
248
|
var
|
245
|
-
icon = el[fields.icon]
|
249
|
+
icon = el[fields.icon]
|
250
|
+
? '<i ' + (el[fields.text] ? 'aria-hidden="true"' : '')
|
251
|
+
+ ' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>'
|
252
|
+
: '',
|
246
253
|
text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
|
247
254
|
cls = module.helpers.deQuote(el[fields.class] || ''),
|
248
|
-
click = el[fields.click] && isFunction(el[fields.click])
|
255
|
+
click = el[fields.click] && isFunction(el[fields.click])
|
256
|
+
? el[fields.click]
|
257
|
+
: function () {}
|
249
258
|
;
|
250
259
|
$actions.append($('<button/>', {
|
251
260
|
html: icon + text,
|
@@ -272,7 +281,7 @@
|
|
272
281
|
}
|
273
282
|
}
|
274
283
|
if (settings.displayTime === 'auto') {
|
275
|
-
settings.displayTime = Math.max(settings.minDisplayTime, $toast.text().split(' ').length / settings.wordsPerMinute * 60000);
|
284
|
+
settings.displayTime = Math.max(settings.minDisplayTime, ($toast.text().split(' ').length / settings.wordsPerMinute) * 60000);
|
276
285
|
}
|
277
286
|
$toastBox.append($toast);
|
278
287
|
|
@@ -309,7 +318,7 @@
|
|
309
318
|
}
|
310
319
|
if (settings.displayTime > 0) {
|
311
320
|
var progressingClass = className.progressing + ' ' + (settings.pauseOnHover ? className.pausable : '');
|
312
|
-
if (
|
321
|
+
if (settings.showProgress) {
|
313
322
|
$progress = $('<div/>', {
|
314
323
|
class: className.progress + ' ' + (settings.classProgress || settings.class),
|
315
324
|
'data-percent': '',
|
@@ -482,7 +491,13 @@
|
|
482
491
|
return id;
|
483
492
|
},
|
484
493
|
containers: function () {
|
485
|
-
return $context.children(module.helpers.toClass(settings.position) + selector.container
|
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) + ')'));
|
486
501
|
},
|
487
502
|
container: function () {
|
488
503
|
return module.get.containers()[0];
|
@@ -497,7 +512,11 @@
|
|
497
512
|
return $(module.get.container()).find(selector.box);
|
498
513
|
},
|
499
514
|
iconClass: function () {
|
500
|
-
return typeof settings.showIcon === 'string'
|
515
|
+
return typeof settings.showIcon === 'string'
|
516
|
+
? settings.showIcon
|
517
|
+
: (settings.showIcon && settings.icons[settings.class]
|
518
|
+
? settings.icons[settings.class]
|
519
|
+
: '');
|
501
520
|
},
|
502
521
|
remainingTime: function () {
|
503
522
|
return $animationObject ? $animationObject.css('opacity') * settings.displayTime : 0;
|
@@ -569,8 +588,8 @@
|
|
569
588
|
return string;
|
570
589
|
}
|
571
590
|
var
|
572
|
-
badChars = /[
|
573
|
-
shouldEscape = /[
|
591
|
+
badChars = /["'<>`]/g,
|
592
|
+
shouldEscape = /["&'<>`]/,
|
574
593
|
escape = {
|
575
594
|
'<': '<',
|
576
595
|
'>': '>',
|
@@ -583,7 +602,7 @@
|
|
583
602
|
}
|
584
603
|
;
|
585
604
|
if (shouldEscape.test(string)) {
|
586
|
-
string = string.replace(/&(?![a-
|
605
|
+
string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&');
|
587
606
|
|
588
607
|
return string.replace(badChars, escapedChar);
|
589
608
|
}
|
@@ -660,7 +679,7 @@
|
|
660
679
|
previousTime
|
661
680
|
;
|
662
681
|
if (settings.performance) {
|
663
|
-
currentTime =
|
682
|
+
currentTime = Date.now();
|
664
683
|
previousTime = time || currentTime;
|
665
684
|
executionTime = currentTime - previousTime;
|
666
685
|
time = currentTime;
|
@@ -711,11 +730,11 @@
|
|
711
730
|
;
|
712
731
|
passedArguments = passedArguments || queryArguments;
|
713
732
|
context = context || element;
|
714
|
-
if (typeof query
|
715
|
-
query = query.split(/[
|
733
|
+
if (typeof query === 'string' && object !== undefined) {
|
734
|
+
query = query.split(/[ .]/);
|
716
735
|
maxDepth = query.length - 1;
|
717
736
|
$.each(query, function (depth, value) {
|
718
|
-
var camelCaseValue =
|
737
|
+
var camelCaseValue = depth != maxDepth
|
719
738
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
720
739
|
: query
|
721
740
|
;
|
@@ -769,10 +788,11 @@
|
|
769
788
|
}
|
770
789
|
});
|
771
790
|
|
772
|
-
return
|
791
|
+
return returnedValue !== undefined
|
773
792
|
? returnedValue
|
774
793
|
: this;
|
775
794
|
};
|
795
|
+
$.toast = $.fn.toast;
|
776
796
|
|
777
797
|
$.fn.toast.settings = {
|
778
798
|
|
@@ -910,16 +930,23 @@
|
|
910
930
|
;
|
911
931
|
if (x < 1 / d1) {
|
912
932
|
return n1 * x * x;
|
913
|
-
} else if (x < 2 / d1) {
|
914
|
-
return n1 * (x -= 1.5 / d1) * x + 0.75;
|
915
|
-
} else if (x < 2.5 / d1) {
|
916
|
-
return n1 * (x -= 2.25 / d1) * x + 0.9375;
|
917
|
-
} else {
|
918
|
-
return n1 * (x -= 2.625 / d1) * x + 0.984375;
|
919
933
|
}
|
934
|
+
if (x < 2 / d1) {
|
935
|
+
x -= 1.5 / d1;
|
936
|
+
|
937
|
+
return n1 * x * x + 0.75;
|
938
|
+
}
|
939
|
+
if (x < 2.5 / d1) {
|
940
|
+
x -= 2.25 / d1;
|
941
|
+
|
942
|
+
return n1 * x * x + 0.9375;
|
943
|
+
}
|
944
|
+
x -= 2.625 / d1;
|
945
|
+
|
946
|
+
return n1 * x * x + 0.984375;
|
920
947
|
},
|
921
948
|
easeOutCubic: function (t) {
|
922
|
-
return
|
949
|
+
return --t * t * t + 1;
|
923
950
|
},
|
924
951
|
});
|
925
952
|
})(jQuery, window, document);
|