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
package/dist/components/tab.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1-beta.
|
2
|
+
* # Fomantic-UI 2.9.1-beta.24+029436f - Tab
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -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: {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.1-beta.
|
2
|
+
* # Fomantic UI - 2.9.1-beta.24+029436f
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* https://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* https://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(w,k,I,U){"use strict";function D(e){return"function"==typeof e&&"number"!=typeof e.nodeType}k=void 0!==k&&k.Math==Math?k:globalThis,w.fn.tab=function(c){var l,d=D(this)?w(k):w(this),u=w(I),g=d.selector||"",P=(new Date).getTime(),S=[],E=c,F="string"==typeof E,O=[].slice.call(arguments,1),j=!1;return d.each(function(){var b,i,f,h,p,v=w.isPlainObject(c)?w.extend(!0,{},w.fn.tab.settings,c):w.extend({},w.fn.tab.settings),m=v.className,y=v.metadata,t=v.selector,T=v.error,a=v.regExp,n="."+v.namespace,e="module-"+v.namespace,L=w(this),o={},x=!0,r=0,A=this,s=L.data(e),C={initialize:function(){C.debug("Initializing tab menu item",L),C.fix.callbacks(),C.determineTabs(),C.debug("Determining tabs",v.context,i),v.auto&&C.set.auto(),C.bind.events(),v.history&&!j&&(C.initializeHistory(),j=!0);var e,t=C.determine.activeTab();v.autoTabActivation&&s===U&&null==t&&(t=!0===v.autoTabActivation?C.get.initialPath():v.autoTabActivation,C.debug("No active tab detected, setting tab active",t),C.changeTab(t)),null!=t&&v.history&&(e=w.address.autoUpdate(),w.address.autoUpdate(!1),w.address.value(t),w.address.autoUpdate(e)),C.instantiate()},instantiate:function(){C.verbose("Storing instance of module",C),s=C,L.data(e,C)},destroy:function(){C.debug("Destroying tabs",L),L.removeData(e).off(n)},bind:{events:function(){var e;null!=(e=A)&&e===e.window||(C.debug("Attaching tab activation events to element",L),L.on("click"+n,C.event.click))}},determineTabs:function(){var e;"parent"===v.context?(0<L.closest(t.ui).length?(e=L.closest(t.ui),C.verbose("Using closest UI element as parent",e)):e=L,b=e.parent(),C.verbose("Determined parent element for creating context",b)):v.context?(b=[k,I].indexOf(v.context)<0?u.find(v.context):w(v.context),C.verbose("Using selector for tab context",v.context,b)):b=w("body"),v.childrenOnly?(i=b.children(t.tabs),C.debug("Searching tab context children for tabs",b,i)):(i=b.find(t.tabs),C.debug("Searching tab context for tabs",b,i))},fix:{callbacks:function(){w.isPlainObject(c)&&(c.onTabLoad||c.onTabInit)&&(c.onTabLoad&&(c.onLoad=c.onTabLoad,delete c.onTabLoad,C.error(T.legacyLoad,c.onLoad)),c.onTabInit&&(c.onFirstLoad=c.onTabInit,delete c.onTabInit,C.error(T.legacyInit,c.onFirstLoad)),v=w.extend(!0,{},w.fn.tab.settings,c))}},initializeHistory:function(){if(C.debug("Initializing page state"),w.address===U)return C.error(T.state),!1;if("state"==v.historyType){if(C.debug("Using HTML5 to manage state"),!1===v.path)return C.error(T.path),!1;w.address.history(!0).state(v.path),w(k).trigger("popstate")}w.address.bind("change",C.event.history.change)},event:{click:function(e){var t=w(this).data(y.tab);t!==U?(v.history?(C.verbose("Updating page state",e),w.address.value(t)):(C.verbose("Changing tab",e),C.changeTab(t)),e.preventDefault()):C.debug("No tab specified")},history:{change:function(e){var t=e.pathNames.join("/")||C.get.initialPath(),a=v.templates.determineTitle(t)||!1;C.performance.display(),C.debug("History change event",t,e),p=e,t!==U&&C.changeTab(t),a&&w.address.title(a)}}},refresh:function(){f&&(C.debug("Refreshing tab",f),C.changeTab(f))},cache:{read:function(e){return e!==U&&o[e]},add:function(e,t){e=e||f,C.debug("Adding cached content for",e),o[e]=t},remove:function(e){e=e||f,C.debug("Removing cached content for",e),delete o[e]}},escape:{string:function(e){return(e=String(e)).replace(a.escape,"\\$&")}},set:{auto:function(){var e="string"==typeof v.path?v.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";C.verbose("Setting up automatic tab retrieval from server",e),w.isPlainObject(v.apiSettings)?v.apiSettings.url=e:v.apiSettings={url:e}},loading:function(e){var t=C.get.tabElement(e);t.hasClass(m.loading)||(C.verbose("Setting loading state for",t),t.addClass(m.loading).siblings(i).removeClass(m.active+" "+m.loading),0<t.length&&v.onRequest.call(t[0],e))},state:function(e){w.address.value(e)}},changeTab:function(l){var d=k.history&&k.history.pushState&&v.ignoreFirstLoad&&x,u=v.auto||w.isPlainObject(v.apiSettings),g=u&&!d?C.utilities.pathToArray(l):C.get.defaultPathArray(l);l=C.utilities.arrayToPath(g),w.each(g,function(e,t){var a,n,i=g.slice(0,e+1),o=C.utilities.arrayToPath(i),r=C.is.tab(o),s=e+1==g.length,c=C.get.tabElement(o);return C.verbose("Looking for tab",t),r?(C.verbose("Tab was found",t),f=o,h=C.utilities.filterArray(g,i),s?n=!0:(r=g.slice(0,e+2),t=C.utilities.arrayToPath(r),(n=!C.is.tab(t))&&C.verbose("Tab parameters found",r)),!1===v.onBeforeChange.call(A,o)?(C.debug("onBeforeChange returned false, cancelling tab change",c),!1):n&&u?(d?(C.debug("Ignoring remote content on first tab load",o),x=!1,C.cache.add(l,c.html()),C.activate.all(o),v.onFirstLoad.call(c[0],o,h,p),v.onLoad.call(c[0],o,h,p)):(C.activate.navigation(o),C.fetch.content(o,l)),!1):(C.debug("Opened local tab",o),C.activate.all(o),C.cache.read(o)||(C.cache.add(o,!0),C.debug("First time tab loaded calling tab init"),v.onFirstLoad.call(c[0],o,h,p)),void v.onLoad.call(c[0],o,h,p))):-1!=l.search("/")||""===l?(C.error(T.missingTab,L,b,o),!1):(l=C.escape.string(l),o=(a=w("#"+l+', a[name="'+l+'"]')).closest("[data-tab]").data(y.tab),c=C.get.tabElement(o),a&&0<a.length&&o?(C.debug("Anchor link used, opening parent tab",c,a),!1===v.onBeforeChange.call(A,o)?C.debug("onBeforeChange returned false, cancelling tab change",c):(c.hasClass(m.active)||setTimeout(function(){C.scrollTo(a)},0),C.activate.all(o),C.cache.read(o)||(C.cache.add(o,!0),C.debug("First time tab loaded calling tab init"),v.onFirstLoad.call(c[0],o,h,p)),v.onLoad.call(c[0],o,h,p)),!1):void 0)})},scrollTo:function(e){var t=!!(e&&0<e.length)&&e.offset().top;!1!==t&&(C.debug("Forcing scroll to an in-page link in a hidden tab",t,e),u.scrollTop(t))},update:{content:function(e,t,a){var n=C.get.tabElement(e),i=n[0];a=a!==U?a:v.evaluateScripts,"string"==typeof v.cacheType&&"dom"==v.cacheType.toLowerCase()&&"string"!=typeof t?n.empty().append(w(t).clone(!0)):a?(C.debug("Updating HTML and evaluating inline scripts",e,t),n.html(t)):(C.debug("Updating HTML",e,t),i.innerHTML=t)}},fetch:{content:function(t,a){var e,n=C.get.tabElement(t),i={dataType:"html",encodeParameters:!1,on:"now",cache:v.alwaysRefresh,headers:{"X-Remote":!0},onSuccess:function(e){"response"==v.cacheType&&C.cache.add(a,e),C.update.content(t,e),t==f?(C.debug("Content loaded",t),C.activate.tab(t)):C.debug("Content loaded in background",t),v.onFirstLoad.call(n[0],t,h,p),v.onLoad.call(n[0],t,h,p),v.loadOnce?C.cache.add(a,!0):"string"==typeof v.cacheType&&"dom"==v.cacheType.toLowerCase()&&0<n.children().length?setTimeout(function(){var e=(e=n.children().clone(!0)).not("script");C.cache.add(a,e)},0):C.cache.add(a,n.html())},urlData:{tab:a}},o=n.api("get request")||!1,o=o&&"pending"===o.state();a=a||t,e=C.cache.read(a),v.cache&&e?(C.activate.tab(t),C.debug("Adding cached content",a),v.loadOnce||("once"==v.evaluateScripts?C.update.content(t,e,!1):C.update.content(t,e)),v.onLoad.call(n[0],t,h,p)):o?(C.set.loading(t),C.debug("Content is already loading",a)):w.api!==U?(e=w.extend(!0,{},v.apiSettings,i),C.debug("Retrieving remote content",a,e),C.set.loading(t),n.api(e)):C.error(T.api)}},activate:{all:function(e){C.activate.tab(e),C.activate.navigation(e)},tab:function(e){var t=C.get.tabElement(e),a="siblings"==v.deactivate?t.siblings(i):i.not(t),n=t.hasClass(m.active);C.verbose("Showing tab content for",t),n||(t.addClass(m.active),a.removeClass(m.active+" "+m.loading),0<t.length&&v.onVisible.call(t[0],e))},navigation:function(e){var t=C.get.navElement(e),a="siblings"==v.deactivate?t.siblings(d):d.not(t),n=t.hasClass(m.active);C.verbose("Activating tab navigation for",t,e),n||(t.addClass(m.active),a.removeClass(m.active+" "+m.loading))}},deactivate:{all:function(){C.deactivate.navigation(),C.deactivate.tabs()},navigation:function(){d.removeClass(m.active)},tabs:function(){i.removeClass(m.active+" "+m.loading)}},is:{tab:function(e){return e!==U&&0<C.get.tabElement(e).length}},get:{initialPath:function(){return d.eq(0).data(y.tab)||i.eq(0).data(y.tab)},path:function(){return w.address.value()},defaultPathArray:function(e){return C.utilities.pathToArray(C.get.defaultPath(e))},defaultPath:function(e){var t=d.filter("[data-"+y.tab+'^="'+C.escape.string(e)+'/"]').eq(0).data(y.tab)||!1;if(t){if(C.debug("Found default tab",t),r<v.maxDepth)return r++,C.get.defaultPath(t);C.error(T.recursion)}else C.debug("No default tabs found for",e,i);return r=0,e},navElement:function(e){return e=e||f,d.filter("[data-"+y.tab+'="'+C.escape.string(e)+'"]')},tabElement:function(e){var t;return e=e||f,t=C.utilities.pathToArray(e),t=C.utilities.last(t),e=i.filter("[data-"+y.tab+'="'+C.escape.string(e)+'"]'),t=i.filter("[data-"+y.tab+'="'+C.escape.string(t)+'"]'),0<e.length?e:t},tab:function(){return f}},determine:{activeTab:function(){var a=null;return i.each(function(e,t){w(t).hasClass(m.active)&&(t=w(this).data(y.tab),d.filter("[data-"+y.tab+'="'+C.escape.string(t)+'"]').hasClass(m.active)&&(a=t))}),a}},utilities:{filterArray:function(e,t){return w.grep(e,function(e){return-1==w.inArray(e,t)})},last:function(e){return!!Array.isArray(e)&&e[e.length-1]},pathToArray:function(e){return"string"==typeof(e=e===U?f:e)?e.split("/"):[e]},arrayToPath:function(e){return!!Array.isArray(e)&&e.join("/")}},setting:function(e,t){if(C.debug("Changing setting",e,t),w.isPlainObject(e))w.extend(!0,v,e);else{if(t===U)return v[e];w.isPlainObject(v[e])?w.extend(!0,v[e],t):v[e]=t}},internal:function(e,t){if(w.isPlainObject(e))w.extend(!0,C,e);else{if(t===U)return C[e];C[e]=t}},debug:function(){!v.silent&&v.debug&&(v.performance?C.performance.log(arguments):(C.debug=Function.prototype.bind.call(console.info,console,v.name+":"),C.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?C.performance.log(arguments):(C.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),C.verbose.apply(console,arguments)))},error:function(){v.silent||(C.error=Function.prototype.bind.call(console.error,console,v.name+":"),C.error.apply(console,arguments))},performance:{log:function(e){var t,a;v.performance&&(a=(t=(new Date).getTime())-(P||t),P=t,S.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:A,"Execution Time":a})),clearTimeout(C.performance.timer),C.performance.timer=setTimeout(C.performance.display,500)},display:function(){var e=v.name+":",a=0;P=!1,clearTimeout(C.performance.timer),w.each(S,function(e,t){a+=t["Execution Time"]}),e+=" "+a+"ms",g&&(e+=" '"+g+"'"),(console.group!==U||console.table!==U)&&0<S.length&&(console.groupCollapsed(e),console.table?console.table(S):w.each(S,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),S=[]}},invoke:function(n,e,t){var i,o,a,r=s;return e=e||O,t=t||A,"string"==typeof n&&r!==U&&(n=n.split(/[\. ]/),i=n.length-1,w.each(n,function(e,t){var a=e!=i?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(w.isPlainObject(r[a])&&e!=i)r=r[a];else{if(r[a]!==U)return o=r[a],!1;{if(!w.isPlainObject(r[t])||e==i)return r[t]!==U?o=r[t]:C.error(T.method,n),!1;r=r[t]}}})),D(o)?a=o.apply(t,e):o!==U&&(a=o),Array.isArray(l)?l.push(a):l!==U?l=[l,a]:a!==U&&(l=a),o}};F?(s===U&&C.initialize(),C.invoke(E)):(s!==U&&s.invoke("destroy"),C.initialize())}),l!==U?l:this},w.tab=function(){w(k).tab.apply(this,arguments)},w.fn.tab.settings={name:"Tab",namespace:"tab",silent:!1,debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,deactivate:"siblings",alwaysRefresh:!1,cache:!0,loadOnce:!1,cacheType:"response",ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",autoTabActivation:!0,onFirstLoad:function(e,t,a){},onLoad:function(e,t,a){},onVisible:function(e,t,a){},onRequest:function(e,t,a){},onBeforeChange:function(e){},templates:{determineTitle:function(e){}},error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Activated tab cannot be found. Tabs are case-sensitive.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",legacyInit:"onTabInit has been renamed to onFirstLoad in 2.0, please adjust your code.",legacyLoad:"onTabLoad has been renamed to onLoad in 2.0. Please adjust your code",state:"History requires Asual's Address library <https://github.com/asual/jquery-address>"},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s:=@]/g},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document);
|
11
|
+
!function(w,k,I,U){"use strict";function D(e){return"function"==typeof e&&"number"!=typeof e.nodeType}k=k!==U&&k.Math===Math?k:globalThis,w.fn.tab=function(c){var l,d=D(this)?w(k):w(this),u=w(I),b=d.selector||"",P=Date.now(),S=[],E=c,F="string"==typeof E,O=[].slice.call(arguments,1),j=!1;return d.each(function(){var g,i,f,h,p,v=w.isPlainObject(c)?w.extend(!0,{},w.fn.tab.settings,c):w.extend({},w.fn.tab.settings),m=v.className,y=v.metadata,t=v.selector,T=v.error,a=v.regExp,n="."+v.namespace,e="module-"+v.namespace,L=w(this),o={},x=!0,r=0,A=this,s=L.data(e),C={initialize:function(){C.debug("Initializing tab menu item",L),C.fix.callbacks(),C.determineTabs(),C.debug("Determining tabs",v.context,i),v.auto&&C.set.auto(),C.bind.events(),v.history&&!j&&(C.initializeHistory(),j=!0);var e,t=C.determine.activeTab();v.autoTabActivation&&s===U&&null==t&&(t=!0===v.autoTabActivation?C.get.initialPath():v.autoTabActivation,C.debug("No active tab detected, setting tab active",t),C.changeTab(t)),null!=t&&v.history&&(e=w.address.autoUpdate(),w.address.autoUpdate(!1),w.address.value(t),w.address.autoUpdate(e)),C.instantiate()},instantiate:function(){C.verbose("Storing instance of module",C),s=C,L.data(e,C)},destroy:function(){C.debug("Destroying tabs",L),L.removeData(e).off(n)},bind:{events:function(){var e;null!=(e=A)&&e===e.window||(C.debug("Attaching tab activation events to element",L),L.on("click"+n,C.event.click))}},determineTabs:function(){var e;"parent"===v.context?(0<L.closest(t.ui).length?(e=L.closest(t.ui),C.verbose("Using closest UI element as parent",e)):e=L,g=e.parent(),C.verbose("Determined parent element for creating context",g)):v.context?(g=[k,I].indexOf(v.context)<0?u.find(v.context):w(v.context),C.verbose("Using selector for tab context",v.context,g)):g=w("body"),v.childrenOnly?(i=g.children(t.tabs),C.debug("Searching tab context children for tabs",g,i)):(i=g.find(t.tabs),C.debug("Searching tab context for tabs",g,i))},fix:{callbacks:function(){w.isPlainObject(c)&&(c.onTabLoad||c.onTabInit)&&(c.onTabLoad&&(c.onLoad=c.onTabLoad,delete c.onTabLoad,C.error(T.legacyLoad,c.onLoad)),c.onTabInit&&(c.onFirstLoad=c.onTabInit,delete c.onTabInit,C.error(T.legacyInit,c.onFirstLoad)),v=w.extend(!0,{},w.fn.tab.settings,c))}},initializeHistory:function(){if(C.debug("Initializing page state"),w.address===U)return C.error(T.state),!1;if("state"==v.historyType){if(C.debug("Using HTML5 to manage state"),!1===v.path)return C.error(T.path),!1;w.address.history(!0).state(v.path),w(k).trigger("popstate")}w.address.bind("change",C.event.history.change)},event:{click:function(e){var t=w(this).data(y.tab);t!==U?(v.history?(C.verbose("Updating page state",e),w.address.value(t)):(C.verbose("Changing tab",e),C.changeTab(t)),e.preventDefault()):C.debug("No tab specified")},history:{change:function(e){var t=e.pathNames.join("/")||C.get.initialPath(),a=v.templates.determineTitle(t)||!1;C.performance.display(),C.debug("History change event",t,e),p=e,t!==U&&C.changeTab(t),a&&w.address.title(a)}}},refresh:function(){f&&(C.debug("Refreshing tab",f),C.changeTab(f))},cache:{read:function(e){return e!==U&&o[e]},add:function(e,t){e=e||f,C.debug("Adding cached content for",e),o[e]=t},remove:function(e){e=e||f,C.debug("Removing cached content for",e),delete o[e]}},escape:{string:function(e){return(e=String(e)).replace(a.escape,"\\$&")}},set:{auto:function(){var e="string"==typeof v.path?v.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";C.verbose("Setting up automatic tab retrieval from server",e),w.isPlainObject(v.apiSettings)?v.apiSettings.url=e:v.apiSettings={url:e}},loading:function(e){var t=C.get.tabElement(e);t.hasClass(m.loading)||(C.verbose("Setting loading state for",t),t.addClass(m.loading).siblings(i).removeClass(m.active+" "+m.loading),0<t.length&&v.onRequest.call(t[0],e))},state:function(e){w.address.value(e)}},changeTab:function(l){var d=k.history&&k.history.pushState&&v.ignoreFirstLoad&&x,u=v.auto||w.isPlainObject(v.apiSettings),b=u&&!d?C.utilities.pathToArray(l):C.get.defaultPathArray(l);l=C.utilities.arrayToPath(b),w.each(b,function(e,t){var a,n,i=b.slice(0,e+1),o=C.utilities.arrayToPath(i),r=C.is.tab(o),s=e+1==b.length,c=C.get.tabElement(o);return C.verbose("Looking for tab",t),r?(C.verbose("Tab was found",t),f=o,h=C.utilities.filterArray(b,i),s?n=!0:(r=b.slice(0,e+2),t=C.utilities.arrayToPath(r),(n=!C.is.tab(t))&&C.verbose("Tab parameters found",r)),!1===v.onBeforeChange.call(A,o)?(C.debug("onBeforeChange returned false, cancelling tab change",c),!1):n&&u?(d?(C.debug("Ignoring remote content on first tab load",o),x=!1,C.cache.add(l,c.html()),C.activate.all(o),v.onFirstLoad.call(c[0],o,h,p),v.onLoad.call(c[0],o,h,p)):(C.activate.navigation(o),C.fetch.content(o,l)),!1):(C.debug("Opened local tab",o),C.activate.all(o),C.cache.read(o)||(C.cache.add(o,!0),C.debug("First time tab loaded calling tab init"),v.onFirstLoad.call(c[0],o,h,p)),void v.onLoad.call(c[0],o,h,p))):-1!=l.search("/")||""===l?(C.error(T.missingTab,L,g,o),!1):(l=C.escape.string(l),o=(a=w("#"+l+', a[name="'+l+'"]')).closest("[data-tab]").data(y.tab),c=C.get.tabElement(o),a&&0<a.length&&o?(C.debug("Anchor link used, opening parent tab",c,a),!1===v.onBeforeChange.call(A,o)?C.debug("onBeforeChange returned false, cancelling tab change",c):(c.hasClass(m.active)||setTimeout(function(){C.scrollTo(a)},0),C.activate.all(o),C.cache.read(o)||(C.cache.add(o,!0),C.debug("First time tab loaded calling tab init"),v.onFirstLoad.call(c[0],o,h,p)),v.onLoad.call(c[0],o,h,p)),!1):void 0)})},scrollTo:function(e){var t=!!(e&&0<e.length)&&e.offset().top;!1!==t&&(C.debug("Forcing scroll to an in-page link in a hidden tab",t,e),u.scrollTop(t))},update:{content:function(e,t,a){var n=C.get.tabElement(e),i=n[0];a=a!==U?a:v.evaluateScripts,"string"==typeof v.cacheType&&"dom"==v.cacheType.toLowerCase()&&"string"!=typeof t?n.empty().append(w(t).clone(!0)):a?(C.debug("Updating HTML and evaluating inline scripts",e,t),n.html(t)):(C.debug("Updating HTML",e,t),i.innerHTML=t)}},fetch:{content:function(t,a){var e,n=C.get.tabElement(t),i={dataType:"html",encodeParameters:!1,on:"now",cache:v.alwaysRefresh,headers:{"X-Remote":!0},onSuccess:function(e){"response"==v.cacheType&&C.cache.add(a,e),C.update.content(t,e),t==f?(C.debug("Content loaded",t),C.activate.tab(t)):C.debug("Content loaded in background",t),v.onFirstLoad.call(n[0],t,h,p),v.onLoad.call(n[0],t,h,p),v.loadOnce?C.cache.add(a,!0):"string"==typeof v.cacheType&&"dom"==v.cacheType.toLowerCase()&&0<n.children().length?setTimeout(function(){var e=(e=n.children().clone(!0)).not("script");C.cache.add(a,e)},0):C.cache.add(a,n.html())},urlData:{tab:a}},o=n.api("get request")||!1,o=o&&"pending"===o.state();a=a||t,e=C.cache.read(a),v.cache&&e?(C.activate.tab(t),C.debug("Adding cached content",a),v.loadOnce||("once"==v.evaluateScripts?C.update.content(t,e,!1):C.update.content(t,e)),v.onLoad.call(n[0],t,h,p)):o?(C.set.loading(t),C.debug("Content is already loading",a)):w.api!==U?(e=w.extend(!0,{},v.apiSettings,i),C.debug("Retrieving remote content",a,e),C.set.loading(t),n.api(e)):C.error(T.api)}},activate:{all:function(e){C.activate.tab(e),C.activate.navigation(e)},tab:function(e){var t=C.get.tabElement(e),a="siblings"==v.deactivate?t.siblings(i):i.not(t),n=t.hasClass(m.active);C.verbose("Showing tab content for",t),n||(t.addClass(m.active),a.removeClass(m.active+" "+m.loading),0<t.length&&v.onVisible.call(t[0],e))},navigation:function(e){var t=C.get.navElement(e),a="siblings"==v.deactivate?t.siblings(d):d.not(t),n=t.hasClass(m.active);C.verbose("Activating tab navigation for",t,e),n||(t.addClass(m.active),a.removeClass(m.active+" "+m.loading))}},deactivate:{all:function(){C.deactivate.navigation(),C.deactivate.tabs()},navigation:function(){d.removeClass(m.active)},tabs:function(){i.removeClass(m.active+" "+m.loading)}},is:{tab:function(e){return e!==U&&0<C.get.tabElement(e).length}},get:{initialPath:function(){return d.eq(0).data(y.tab)||i.eq(0).data(y.tab)},path:function(){return w.address.value()},defaultPathArray:function(e){return C.utilities.pathToArray(C.get.defaultPath(e))},defaultPath:function(e){var t=d.filter("[data-"+y.tab+'^="'+C.escape.string(e)+'/"]').eq(0).data(y.tab)||!1;if(t){if(C.debug("Found default tab",t),r<v.maxDepth)return r++,C.get.defaultPath(t);C.error(T.recursion)}else C.debug("No default tabs found for",e,i);return r=0,e},navElement:function(e){return e=e||f,d.filter("[data-"+y.tab+'="'+C.escape.string(e)+'"]')},tabElement:function(e){var t;return e=e||f,t=C.utilities.pathToArray(e),t=C.utilities.last(t),e=i.filter("[data-"+y.tab+'="'+C.escape.string(e)+'"]'),t=i.filter("[data-"+y.tab+'="'+C.escape.string(t)+'"]'),0<e.length?e:t},tab:function(){return f}},determine:{activeTab:function(){var a=null;return i.each(function(e,t){w(t).hasClass(m.active)&&(t=w(this).data(y.tab),d.filter("[data-"+y.tab+'="'+C.escape.string(t)+'"]').hasClass(m.active)&&(a=t))}),a}},utilities:{filterArray:function(e,t){return w.grep(e,function(e){return-1==w.inArray(e,t)})},last:function(e){return!!Array.isArray(e)&&e[e.length-1]},pathToArray:function(e){return"string"==typeof(e=e===U?f:e)?e.split("/"):[e]},arrayToPath:function(e){return!!Array.isArray(e)&&e.join("/")}},setting:function(e,t){if(C.debug("Changing setting",e,t),w.isPlainObject(e))w.extend(!0,v,e);else{if(t===U)return v[e];w.isPlainObject(v[e])?w.extend(!0,v[e],t):v[e]=t}},internal:function(e,t){if(w.isPlainObject(e))w.extend(!0,C,e);else{if(t===U)return C[e];C[e]=t}},debug:function(){!v.silent&&v.debug&&(v.performance?C.performance.log(arguments):(C.debug=Function.prototype.bind.call(console.info,console,v.name+":"),C.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?C.performance.log(arguments):(C.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),C.verbose.apply(console,arguments)))},error:function(){v.silent||(C.error=Function.prototype.bind.call(console.error,console,v.name+":"),C.error.apply(console,arguments))},performance:{log:function(e){var t,a;v.performance&&(a=(t=Date.now())-(P||t),P=t,S.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:A,"Execution Time":a})),clearTimeout(C.performance.timer),C.performance.timer=setTimeout(C.performance.display,500)},display:function(){var e=v.name+":",a=0;P=!1,clearTimeout(C.performance.timer),w.each(S,function(e,t){a+=t["Execution Time"]}),e+=" "+a+"ms",b&&(e+=" '"+b+"'"),(console.group!==U||console.table!==U)&&0<S.length&&(console.groupCollapsed(e),console.table?console.table(S):w.each(S,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),S=[]}},invoke:function(n,e,t){var i,o,a,r=s;return e=e||O,t=t||A,"string"==typeof n&&r!==U&&(n=n.split(/[ .]/),i=n.length-1,w.each(n,function(e,t){var a=e!=i?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(w.isPlainObject(r[a])&&e!=i)r=r[a];else{if(r[a]!==U)return o=r[a],!1;{if(!w.isPlainObject(r[t])||e==i)return r[t]!==U?o=r[t]:C.error(T.method,n),!1;r=r[t]}}})),D(o)?a=o.apply(t,e):o!==U&&(a=o),Array.isArray(l)?l.push(a):l!==U?l=[l,a]:a!==U&&(l=a),o}};F?(s===U&&C.initialize(),C.invoke(E)):(s!==U&&s.invoke("destroy"),C.initialize())}),l!==U?l:this},w.tab=function(){w(k).tab.apply(this,arguments)},w.fn.tab.settings={name:"Tab",namespace:"tab",silent:!1,debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,deactivate:"siblings",alwaysRefresh:!1,cache:!0,loadOnce:!1,cacheType:"response",ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",autoTabActivation:!0,onFirstLoad:function(e,t,a){},onLoad:function(e,t,a){},onVisible:function(e,t,a){},onRequest:function(e,t,a){},onBeforeChange:function(e){},templates:{determineTitle:function(e){}},error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Activated tab cannot be found. Tabs are case-sensitive.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",legacyInit:"onTabInit has been renamed to onFirstLoad in 2.0, please adjust your code.",legacyLoad:"onTabLoad has been renamed to onLoad in 2.0. Please adjust your code",state:"History requires Asual's Address library <https://github.com/asual/jquery-address>"},regExp:{escape:/[\s#$()*+,.:=?@[\\\]^{|}-]/g},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document);
|
package/dist/components/text.css
CHANGED
package/dist/components/toast.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1-beta.
|
2
|
+
* # Fomantic-UI 2.9.1-beta.24+029436f - Toast
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -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);
|