fomantic-ui 2.9.3-beta.0 → 2.9.3-beta.10
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/.all-contributorsrc +9 -0
- package/CONTRIBUTORS.md +102 -99
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +1 -5
- 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 +14 -8
- 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 +6 -6
- package/dist/components/calendar.js +1 -6
- 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 +1 -5
- 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 +1 -5
- 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 +19 -2
- package/dist/components/dropdown.js +29 -14
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +1 -6
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/emoji.css +1 -1
- package/dist/components/emoji.min.css +1 -1
- 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 +1 -1
- package/dist/components/flyout.js +40 -27
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +36 -5
- package/dist/components/form.js +32 -24
- 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 +21 -2
- package/dist/components/label.min.css +2 -2
- 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/menu.css +1 -1
- package/dist/components/menu.min.css +1 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +6 -3
- package/dist/components/modal.js +44 -32
- package/dist/components/modal.min.css +2 -2
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +16 -8
- 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 +41 -40
- package/dist/components/popup.js +25 -17
- package/dist/components/popup.min.css +2 -2
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +1 -6
- 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 +1 -5
- 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 +1 -5
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +3 -2
- package/dist/components/segment.min.css +2 -2
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +1 -5
- 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 +15 -8
- 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 +1 -1
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +1 -1
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +122 -31
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +23 -20
- 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 +17 -16
- 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 +14 -6
- 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 +17 -9
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +1 -5
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +15 -6
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +203 -108
- package/dist/semantic.js +435 -281
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/package.json +1 -1
- package/src/definitions/behaviors/api.js +13 -7
- package/src/definitions/behaviors/form.js +31 -23
- package/src/definitions/behaviors/state.js +22 -19
- package/src/definitions/behaviors/visibility.js +14 -5
- package/src/definitions/collections/breadcrumb.less +2 -1
- package/src/definitions/collections/form.less +24 -5
- package/src/definitions/collections/grid.less +2 -1
- package/src/definitions/collections/menu.less +2 -1
- package/src/definitions/collections/message.less +2 -1
- package/src/definitions/collections/table.less +2 -1
- package/src/definitions/elements/button.less +3 -1
- package/src/definitions/elements/container.less +2 -1
- package/src/definitions/elements/divider.less +2 -1
- package/src/definitions/elements/emoji.less +2 -1
- package/src/definitions/elements/flag.less +2 -1
- package/src/definitions/elements/header.less +2 -1
- package/src/definitions/elements/icon.less +2 -1
- package/src/definitions/elements/image.less +2 -1
- package/src/definitions/elements/input.less +2 -1
- package/src/definitions/elements/label.less +23 -2
- package/src/definitions/elements/list.less +2 -1
- package/src/definitions/elements/loader.less +2 -1
- package/src/definitions/elements/placeholder.less +2 -1
- package/src/definitions/elements/rail.less +2 -1
- package/src/definitions/elements/reveal.less +2 -1
- package/src/definitions/elements/segment.less +4 -2
- package/src/definitions/elements/step.less +2 -1
- package/src/definitions/elements/text.less +2 -1
- package/src/definitions/globals/reset.less +2 -1
- package/src/definitions/globals/site.less +2 -1
- package/src/definitions/modules/accordion.js +0 -4
- package/src/definitions/modules/accordion.less +2 -1
- package/src/definitions/modules/calendar.js +0 -5
- package/src/definitions/modules/calendar.less +3 -2
- package/src/definitions/modules/checkbox.js +0 -4
- package/src/definitions/modules/checkbox.less +2 -1
- package/src/definitions/modules/dimmer.js +0 -4
- package/src/definitions/modules/dimmer.less +2 -1
- package/src/definitions/modules/dropdown.js +28 -13
- package/src/definitions/modules/dropdown.less +22 -2
- package/src/definitions/modules/embed.js +0 -5
- package/src/definitions/modules/embed.less +2 -1
- package/src/definitions/modules/flyout.js +39 -26
- package/src/definitions/modules/flyout.less +2 -1
- package/src/definitions/modules/modal.js +43 -31
- package/src/definitions/modules/modal.less +7 -3
- package/src/definitions/modules/nag.js +15 -7
- package/src/definitions/modules/nag.less +3 -1
- package/src/definitions/modules/popup.js +24 -16
- package/src/definitions/modules/popup.less +42 -39
- package/src/definitions/modules/progress.js +0 -5
- package/src/definitions/modules/progress.less +2 -1
- package/src/definitions/modules/rating.js +0 -4
- package/src/definitions/modules/rating.less +2 -1
- package/src/definitions/modules/search.js +0 -4
- package/src/definitions/modules/search.less +2 -1
- package/src/definitions/modules/shape.js +0 -4
- package/src/definitions/modules/shape.less +2 -1
- package/src/definitions/modules/sidebar.js +14 -7
- package/src/definitions/modules/sidebar.less +2 -1
- package/src/definitions/modules/slider.js +121 -30
- package/src/definitions/modules/slider.less +2 -1
- package/src/definitions/modules/sticky.js +16 -15
- package/src/definitions/modules/sticky.less +2 -1
- package/src/definitions/modules/tab.js +13 -5
- package/src/definitions/modules/tab.less +2 -1
- package/src/definitions/modules/toast.js +16 -8
- package/src/definitions/modules/toast.less +2 -1
- package/src/definitions/modules/transition.js +0 -4
- package/src/definitions/modules/transition.less +2 -1
- package/src/definitions/views/ad.less +2 -1
- package/src/definitions/views/card.less +2 -1
- package/src/definitions/views/comment.less +2 -1
- package/src/definitions/views/feed.less +2 -1
- package/src/definitions/views/item.less +2 -1
- package/src/definitions/views/statistic.less +2 -1
- package/src/overrides.less +7 -0
- package/src/theme.less +7 -6
- package/src/themes/default/elements/label.variables +5 -0
- package/src/themes/default/modules/dropdown.variables +3 -0
- package/src/themes/default/modules/modal.variables +1 -0
- package/src/themes/default/modules/popup.variables +3 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.3-beta.
|
2
|
+
* # Fomantic-UI 2.9.3-beta.10+11b4099 - Sticky
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -23,7 +23,6 @@
|
|
23
23
|
var
|
24
24
|
$allModules = $(this),
|
25
25
|
$document = $(document),
|
26
|
-
moduleSelector = $allModules.selector || '',
|
27
26
|
|
28
27
|
time = Date.now(),
|
29
28
|
performance = [],
|
@@ -31,6 +30,19 @@
|
|
31
30
|
query = arguments[0],
|
32
31
|
methodInvoked = typeof query === 'string',
|
33
32
|
queryArguments = [].slice.call(arguments, 1),
|
33
|
+
contextCheck = function (context, win) {
|
34
|
+
var $context;
|
35
|
+
if ([window, document].indexOf(context) >= 0) {
|
36
|
+
$context = $(context);
|
37
|
+
} else {
|
38
|
+
$context = $(win.document).find(context);
|
39
|
+
if ($context.length === 0) {
|
40
|
+
$context = win.frameElement ? contextCheck(context, win.parent) : window;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
return $context;
|
45
|
+
},
|
34
46
|
returnedValue
|
35
47
|
;
|
36
48
|
|
@@ -49,7 +61,7 @@
|
|
49
61
|
|
50
62
|
$module = $(this),
|
51
63
|
$window = $(window),
|
52
|
-
$scroll =
|
64
|
+
$scroll = contextCheck(settings.scrollContext, window),
|
53
65
|
$container,
|
54
66
|
$context,
|
55
67
|
|
@@ -127,19 +139,11 @@
|
|
127
139
|
},
|
128
140
|
|
129
141
|
determineContainer: function () {
|
130
|
-
|
131
|
-
$container = [window, document].indexOf(settings.container) < 0 ? $document.find(settings.container) : $(settings.container);
|
132
|
-
} else {
|
133
|
-
$container = $module.offsetParent();
|
134
|
-
}
|
142
|
+
$container = settings.container ? contextCheck(settings.container, window) : $module.offsetParent();
|
135
143
|
},
|
136
144
|
|
137
145
|
determineContext: function () {
|
138
|
-
|
139
|
-
$context = [window, document].indexOf(settings.context) < 0 ? $document.find(settings.context) : $(settings.context);
|
140
|
-
} else {
|
141
|
-
$context = $container;
|
142
|
-
}
|
146
|
+
$context = settings.context ? contextCheck(settings.context, window) : $container;
|
143
147
|
if ($context.length === 0) {
|
144
148
|
module.error(error.invalidContext, settings.context, $module);
|
145
149
|
}
|
@@ -755,9 +759,6 @@
|
|
755
759
|
totalTime += data['Execution Time'];
|
756
760
|
});
|
757
761
|
title += ' ' + totalTime + 'ms';
|
758
|
-
if (moduleSelector) {
|
759
|
-
title += ' \'' + moduleSelector + '\'';
|
760
|
-
}
|
761
762
|
if (performance.length > 0) {
|
762
763
|
console.groupCollapsed(title);
|
763
764
|
if (console.table) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.3-beta.
|
2
|
+
* # Fomantic UI - 2.9.3-beta.10+11b4099
|
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(T,w,B){"use strict";w=void 0!==w&&w.Math===Math?w:globalThis,T.fn.sticky=function(p){var b,e=T(this),v=T(B),x=e.selector||"",C=Date.now(),S=[],y=p,k="string"==typeof y,z=[].slice.call(arguments,1);return e.each(function(){var t,n,e,o,c=T.isPlainObject(p)?T.extend(!0,{},T.fn.sticky.settings,p):T.extend({},T.fn.sticky.settings),i=c.className,s=c.namespace,l=c.error,r="."+s,a="module-"+s,f=T(this),m=T(w),d=[w,B].indexOf(c.scrollContext)<0?v.find(c.scrollContext):T(c.scrollContext),h=f.data(a),u=this,g={initialize:function(){g.determineContainer(),g.determineContext(),g.verbose("Initializing sticky",c,t),g.save.positions(),g.checkErrors(),g.bind.events(),c.observeChanges&&g.observeChanges(),g.instantiate()},instantiate:function(){g.verbose("Storing instance of module",g),h=g,f.data(a,g)},destroy:function(){g.verbose("Destroying previous instance"),g.reset(),e&&e.disconnect(),o&&o.disconnect(),m.off("load"+r,g.event.load).off("resize"+r,g.event.resize),d.off("scrollchange"+r,g.event.scrollchange),f.removeData(a)},observeChanges:function(){"MutationObserver"in w&&(e=new MutationObserver(g.event.documentChanged),o=new MutationObserver(g.event.changed),e.observe(B,{childList:!0,subtree:!0}),o.observe(u,{childList:!0,subtree:!0}),o.observe(n[0],{childList:!0,subtree:!0}),g.debug("Setting up mutation observer",o))},determineContainer:function(){t=c.container?[w,B].indexOf(c.container)<0?v.find(c.container):T(c.container):f.offsetParent()},determineContext:function(){0===(n=c.context?[w,B].indexOf(c.context)<0?v.find(c.context):T(c.context):t).length&&g.error(l.invalidContext,c.context,f)},checkErrors:function(){g.is.hidden()&&g.error(l.visible,f),g.cache.element.height>g.cache.context.height&&(g.reset(),g.error(l.elementSize,f))},bind:{events:function(){m.on("load"+r,g.event.load).on("resize"+r,g.event.resize),d.off("scroll"+r).on("scroll"+r,g.event.scroll).on("scrollchange"+r,g.event.scrollchange)}},event:{changed:function(e){clearTimeout(g.timer),g.timer=setTimeout(function(){g.verbose("DOM tree modified, updating sticky menu",e),g.refresh()},100)},documentChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e===u||0<T(e).find(u).length)&&(g.debug("Element removed from DOM, tearing down events"),g.destroy())})})},load:function(){g.verbose("Page contents finished loading"),requestAnimationFrame(g.refresh)},resize:function(){g.verbose("Window resized"),requestAnimationFrame(g.refresh)},scroll:function(){requestAnimationFrame(function(){d.triggerHandler("scrollchange"+r,d.scrollTop())})},scrollchange:function(e,t){g.stick(t),c.onScroll.call(u)}},refresh:function(e){g.reset(),c.context||g.determineContext(),e&&g.determineContainer(),g.save.positions(),g.stick(),c.onReposition.call(u)},supports:{sticky:function(){var e=T("<div/>");return e.addClass(i.supported),e.css("position").match("sticky")}},save:{lastScroll:function(e){g.lastScroll=e},elementScroll:function(e){g.elementScroll=e},positions:function(){var e={height:d.height()},t={margin:{top:parseInt(f.css("margin-top"),10),bottom:parseInt(f.css("margin-bottom"),10)},offset:f.offset(),width:f.outerWidth(),height:f.outerHeight()},o={offset:n.offset(),height:n.outerHeight()};g.is.standardScroll()||(g.debug("Non-standard scroll. Removing scroll offset from element offset"),e.top=d.scrollTop(),e.left=d.scrollLeft(),t.offset.top+=e.top,o.offset.top+=e.top,t.offset.left+=e.left,o.offset.left+=e.left),g.cache={fits:t.height+c.offset<=e.height,sameHeight:t.height===o.height,scrollContext:{height:e.height},element:{margin:t.margin,top:t.offset.top-t.margin.top,left:t.offset.left,width:t.width,height:t.height,bottom:t.offset.top+t.height},context:{top:o.offset.top,height:o.height,bottom:o.offset.top+o.height}},g.set.containerSize(),g.stick(),g.debug("Caching element positions",g.cache)}},get:{direction:function(e){var t="down";return e=e||d.scrollTop(),t=g.lastScroll&&g.lastScroll>e?"up":t},scrollChange:function(e){return e=e||d.scrollTop(),g.lastScroll?e-g.lastScroll:0},currentElementScroll:function(){return g.elementScroll||(g.is.top()?Math.abs(parseInt(f.css("top"),10))||0:Math.abs(parseInt(f.css("bottom"),10))||0)},elementScroll:function(e){e=e||d.scrollTop();var t=g.cache.element,o=g.cache.scrollContext,e=g.get.scrollChange(e),t=t.height-o.height+c.offset,o=g.get.currentElementScroll(),e=o+e;return o=g.cache.fits||e<0?0:t<e?t:e}},remove:{lastScroll:function(){delete g.lastScroll},elementScroll:function(){delete g.elementScroll},minimumSize:function(){t.css("min-height","")},offset:function(){f.css("margin-top","")}},set:{offset:function(){g.verbose("Setting offset on element",c.offset),f.css("margin-top",c.offset)},containerSize:function(){var e=t[0].tagName;"HTML"===e||"body"===e?g.determineContainer():((e=Math.max(g.cache.context.height,g.cache.element.height))-t.outerHeight()>c.jitter?(g.debug("Context is taller than container. Specifying exact height for container",g.cache.context.height),t.css({height:e})):t.css({height:""}),Math.abs(t.outerHeight()-g.cache.context.height)>c.jitter&&(g.debug("Context has padding, specifying exact height for container",g.cache.context.height),t.css({height:g.cache.context.height})))},minimumSize:function(){var e=g.cache.element;t.css("min-height",e.height)},scroll:function(e){g.debug("Setting scroll on element",e),g.elementScroll!==e&&(g.is.top()&&f.css("bottom","").css("top",-e+"px"),g.is.bottom()&&f.css("top","").css("bottom",e+"px"))},size:function(){0!==g.cache.element.height&&0!==g.cache.element.width&&(u.style.setProperty("width",g.cache.element.width+"px","important"),u.style.setProperty("height",g.cache.element.height+"px","important"))}},is:{standardScroll:function(){return d[0]===w},top:function(){return f.hasClass(i.top)},bottom:function(){return f.hasClass(i.bottom)},initialPosition:function(){return!g.is.fixed()&&!g.is.bound()},hidden:function(){return!f.is(":visible")},bound:function(){return f.hasClass(i.bound)},fixed:function(){return f.hasClass(i.fixed)}},stick:function(e){var e=e||d.scrollTop(),t=g.cache,o=t.fits,n=t.sameHeight,i=t.element,s=t.scrollContext,t=t.context,r=g.is.bottom()&&c.pushing?c.bottomOffset:c.offset,e={top:e+r,bottom:e+r+s.height},r=o?0:g.get.elementScroll(e.top),s=!o;0===i.height||n||(g.is.initialPosition()?e.top>=t.bottom?(g.debug("Initial element position is bottom of container"),g.bindBottom()):e.top>i.top&&(i.height+e.top-r>=t.bottom&&i.height<t.height?(g.debug("Initial element position is bottom of container"),g.bindBottom()):(g.debug("Initial element position is fixed"),g.fixTop())):g.is.fixed()?g.is.top()?e.top<=i.top?(g.debug("Fixed element reached top of container"),g.setInitialPosition()):i.height+e.top-r>=t.bottom?(g.debug("Fixed element reached bottom of container"),g.bindBottom()):s&&(g.set.scroll(r),g.save.lastScroll(e.top),g.save.elementScroll(r)):g.is.bottom()&&(e.bottom-i.height<=i.top?(g.debug("Bottom fixed rail has reached top of container"),g.setInitialPosition()):e.bottom>=t.bottom?(g.debug("Bottom fixed rail has reached bottom of container"),g.bindBottom()):s&&(g.set.scroll(r),g.save.lastScroll(e.top),g.save.elementScroll(r))):g.is.bottom()&&(e.top<=i.top?(g.debug("Jumped from bottom fixed to top fixed, most likely used home/end button"),g.setInitialPosition()):c.pushing?g.is.bound()&&e.bottom<=t.bottom&&(g.debug("Fixing bottom attached element to bottom of browser."),g.fixBottom()):g.is.bound()&&e.top<=t.bottom-i.height&&(g.debug("Fixing bottom attached element to top of browser."),g.fixTop())))},bindTop:function(){g.debug("Binding element to top of parent container"),g.remove.offset(),c.setSize&&g.set.size(),f.css({left:"",top:"",marginBottom:""}).removeClass(i.fixed).removeClass(i.bottom).addClass(i.bound).addClass(i.top),c.onTop.call(u),c.onUnstick.call(u)},bindBottom:function(){g.debug("Binding element to bottom of parent container"),g.remove.offset(),c.setSize&&g.set.size(),f.css({left:"",top:""}).removeClass(i.fixed).removeClass(i.top).addClass(i.bound).addClass(i.bottom),c.onBottom.call(u),c.onUnstick.call(u)},setInitialPosition:function(){g.debug("Returning to initial position"),g.unfix(),g.unbind()},fixTop:function(){g.debug("Fixing element to top of page"),c.setSize&&g.set.size(),g.set.minimumSize(),g.set.offset(),f.css({left:g.cache.element.left,bottom:"",marginBottom:""}).removeClass(i.bound).removeClass(i.bottom).addClass(i.fixed).addClass(i.top),c.onStick.call(u)},fixBottom:function(){g.debug("Sticking element to bottom of page"),c.setSize&&g.set.size(),g.set.minimumSize(),g.set.offset(),f.css({left:g.cache.element.left,bottom:"",marginBottom:""}).removeClass(i.bound).removeClass(i.top).addClass(i.fixed).addClass(i.bottom),c.onStick.call(u)},unbind:function(){g.is.bound()&&(g.debug("Removing container bound position on element"),g.remove.offset(),f.removeClass(i.bound).removeClass(i.top).removeClass(i.bottom))},unfix:function(){g.is.fixed()&&(g.debug("Removing fixed position on element"),g.remove.minimumSize(),g.remove.offset(),f.removeClass(i.fixed).removeClass(i.top).removeClass(i.bottom),c.onUnstick.call(u))},reset:function(){g.debug("Resetting elements position"),g.unbind(),g.unfix(),g.resetCSS(),g.remove.offset(),g.remove.lastScroll()},resetCSS:function(){f.css({width:"",height:""}),t.css({height:""})},setting:function(e,t){if(T.isPlainObject(e))T.extend(!0,c,e);else{if(void 0===t)return c[e];c[e]=t}},internal:function(e,t){if(T.isPlainObject(e))T.extend(!0,g,e);else{if(void 0===t)return g[e];g[e]=t}},debug:function(){!c.silent&&c.debug&&(c.performance?g.performance.log(arguments):(g.debug=Function.prototype.bind.call(console.info,console,c.name+":"),g.debug.apply(console,arguments)))},verbose:function(){!c.silent&&c.verbose&&c.debug&&(c.performance?g.performance.log(arguments):(g.verbose=Function.prototype.bind.call(console.info,console,c.name+":"),g.verbose.apply(console,arguments)))},error:function(){c.silent||(g.error=Function.prototype.bind.call(console.error,console,c.name+":"),g.error.apply(console,arguments))},performance:{log:function(e){var t,o;c.performance&&(o=(t=Date.now())-(C||t),C=t,S.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:u,"Execution Time":o})),clearTimeout(g.performance.timer),g.performance.timer=setTimeout(g.performance.display,0)},display:function(){var e=c.name+":",o=0;C=!1,clearTimeout(g.performance.timer),T.each(S,function(e,t){o+=t["Execution Time"]}),e+=" "+o+"ms",x&&(e+=" '"+x+"'"),0<S.length&&(console.groupCollapsed(e),console.table?console.table(S):T.each(S,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),S=[]}},invoke:function(n,e,t){var i,s,o,r,c=h;return e=e||z,t=t||u,"string"==typeof n&&void 0!==c&&(n=n.split(/[ .]/),i=n.length-1,T.each(n,function(e,t){var o=e!==i?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(T.isPlainObject(c[o])&&e!==i)c=c[o];else{if(void 0!==c[o])return s=c[o],!1;{if(!T.isPlainObject(c[t])||e===i)return void 0!==c[t]?s=c[t]:g.error(l.method,n),!1;c=c[t]}}})),"function"==typeof(r=s)&&"number"!=typeof r.nodeType?o=s.apply(t,e):void 0!==s&&(o=s),Array.isArray(b)?b.push(o):void 0!==b?b=[b,o]:void 0!==o&&(b=o),s}};k?(void 0===h&&g.initialize(),g.invoke(y)):(void 0!==h&&h.invoke("destroy"),g.initialize())}),void 0!==b?b:this},T.fn.sticky.settings={name:"Sticky",namespace:"sticky",silent:!1,debug:!1,verbose:!0,performance:!0,pushing:!1,context:!1,container:!1,scrollContext:w,offset:0,bottomOffset:0,jitter:5,setSize:!0,observeChanges:!1,onReposition:function(){},onScroll:function(){},onStick:function(){},onUnstick:function(){},onTop:function(){},onBottom:function(){},error:{visible:"Element is hidden, you must call refresh after element becomes visible. Use silent setting to suppress this warning in production.",method:"The method you called is not defined.",invalidContext:"Context specified does not exist",elementSize:"Sticky element is larger than its container, cannot create sticky."},className:{bound:"bound",fixed:"fixed",supported:"native",top:"top",bottom:"bottom"}}}(jQuery,window,document);
|
11
|
+
!function(z,T,w){"use strict";T=void 0!==T&&T.Math===Math?T:globalThis,z.fn.sticky=function(p){var b,e=z(this),v=(z(w),Date.now()),x=[],C=p,S="string"==typeof C,y=[].slice.call(arguments,1),k=function(e,t){var o;return 0<=[T,w].indexOf(e)?o=z(e):0===(o=z(t.document).find(e)).length&&(o=t.frameElement?k(e,t.parent):T),o};return e.each(function(){var t,n,e,o,c=z.isPlainObject(p)?z.extend(!0,{},z.fn.sticky.settings,p):z.extend({},z.fn.sticky.settings),i=c.className,s=c.namespace,l=c.error,r="."+s,a="module-"+s,f=z(this),m=z(T),d=k(c.scrollContext,T),u=f.data(a),h=this,g={initialize:function(){g.determineContainer(),g.determineContext(),g.verbose("Initializing sticky",c,t),g.save.positions(),g.checkErrors(),g.bind.events(),c.observeChanges&&g.observeChanges(),g.instantiate()},instantiate:function(){g.verbose("Storing instance of module",g),u=g,f.data(a,g)},destroy:function(){g.verbose("Destroying previous instance"),g.reset(),e&&e.disconnect(),o&&o.disconnect(),m.off("load"+r,g.event.load).off("resize"+r,g.event.resize),d.off("scrollchange"+r,g.event.scrollchange),f.removeData(a)},observeChanges:function(){"MutationObserver"in T&&(e=new MutationObserver(g.event.documentChanged),o=new MutationObserver(g.event.changed),e.observe(w,{childList:!0,subtree:!0}),o.observe(h,{childList:!0,subtree:!0}),o.observe(n[0],{childList:!0,subtree:!0}),g.debug("Setting up mutation observer",o))},determineContainer:function(){t=c.container?k(c.container,T):f.offsetParent()},determineContext:function(){0===(n=c.context?k(c.context,T):t).length&&g.error(l.invalidContext,c.context,f)},checkErrors:function(){g.is.hidden()&&g.error(l.visible,f),g.cache.element.height>g.cache.context.height&&(g.reset(),g.error(l.elementSize,f))},bind:{events:function(){m.on("load"+r,g.event.load).on("resize"+r,g.event.resize),d.off("scroll"+r).on("scroll"+r,g.event.scroll).on("scrollchange"+r,g.event.scrollchange)}},event:{changed:function(e){clearTimeout(g.timer),g.timer=setTimeout(function(){g.verbose("DOM tree modified, updating sticky menu",e),g.refresh()},100)},documentChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e===h||0<z(e).find(h).length)&&(g.debug("Element removed from DOM, tearing down events"),g.destroy())})})},load:function(){g.verbose("Page contents finished loading"),requestAnimationFrame(g.refresh)},resize:function(){g.verbose("Window resized"),requestAnimationFrame(g.refresh)},scroll:function(){requestAnimationFrame(function(){d.triggerHandler("scrollchange"+r,d.scrollTop())})},scrollchange:function(e,t){g.stick(t),c.onScroll.call(h)}},refresh:function(e){g.reset(),c.context||g.determineContext(),e&&g.determineContainer(),g.save.positions(),g.stick(),c.onReposition.call(h)},supports:{sticky:function(){var e=z("<div/>");return e.addClass(i.supported),e.css("position").match("sticky")}},save:{lastScroll:function(e){g.lastScroll=e},elementScroll:function(e){g.elementScroll=e},positions:function(){var e={height:d.height()},t={margin:{top:parseInt(f.css("margin-top"),10),bottom:parseInt(f.css("margin-bottom"),10)},offset:f.offset(),width:f.outerWidth(),height:f.outerHeight()},o={offset:n.offset(),height:n.outerHeight()};g.is.standardScroll()||(g.debug("Non-standard scroll. Removing scroll offset from element offset"),e.top=d.scrollTop(),e.left=d.scrollLeft(),t.offset.top+=e.top,o.offset.top+=e.top,t.offset.left+=e.left,o.offset.left+=e.left),g.cache={fits:t.height+c.offset<=e.height,sameHeight:t.height===o.height,scrollContext:{height:e.height},element:{margin:t.margin,top:t.offset.top-t.margin.top,left:t.offset.left,width:t.width,height:t.height,bottom:t.offset.top+t.height},context:{top:o.offset.top,height:o.height,bottom:o.offset.top+o.height}},g.set.containerSize(),g.stick(),g.debug("Caching element positions",g.cache)}},get:{direction:function(e){var t="down";return e=e||d.scrollTop(),t=g.lastScroll&&g.lastScroll>e?"up":t},scrollChange:function(e){return e=e||d.scrollTop(),g.lastScroll?e-g.lastScroll:0},currentElementScroll:function(){return g.elementScroll||(g.is.top()?Math.abs(parseInt(f.css("top"),10))||0:Math.abs(parseInt(f.css("bottom"),10))||0)},elementScroll:function(e){e=e||d.scrollTop();var t=g.cache.element,o=g.cache.scrollContext,e=g.get.scrollChange(e),t=t.height-o.height+c.offset,o=g.get.currentElementScroll(),e=o+e;return o=g.cache.fits||e<0?0:t<e?t:e}},remove:{lastScroll:function(){delete g.lastScroll},elementScroll:function(){delete g.elementScroll},minimumSize:function(){t.css("min-height","")},offset:function(){f.css("margin-top","")}},set:{offset:function(){g.verbose("Setting offset on element",c.offset),f.css("margin-top",c.offset)},containerSize:function(){var e=t[0].tagName;"HTML"===e||"body"===e?g.determineContainer():((e=Math.max(g.cache.context.height,g.cache.element.height))-t.outerHeight()>c.jitter?(g.debug("Context is taller than container. Specifying exact height for container",g.cache.context.height),t.css({height:e})):t.css({height:""}),Math.abs(t.outerHeight()-g.cache.context.height)>c.jitter&&(g.debug("Context has padding, specifying exact height for container",g.cache.context.height),t.css({height:g.cache.context.height})))},minimumSize:function(){var e=g.cache.element;t.css("min-height",e.height)},scroll:function(e){g.debug("Setting scroll on element",e),g.elementScroll!==e&&(g.is.top()&&f.css("bottom","").css("top",-e+"px"),g.is.bottom()&&f.css("top","").css("bottom",e+"px"))},size:function(){0!==g.cache.element.height&&0!==g.cache.element.width&&(h.style.setProperty("width",g.cache.element.width+"px","important"),h.style.setProperty("height",g.cache.element.height+"px","important"))}},is:{standardScroll:function(){return d[0]===T},top:function(){return f.hasClass(i.top)},bottom:function(){return f.hasClass(i.bottom)},initialPosition:function(){return!g.is.fixed()&&!g.is.bound()},hidden:function(){return!f.is(":visible")},bound:function(){return f.hasClass(i.bound)},fixed:function(){return f.hasClass(i.fixed)}},stick:function(e){var e=e||d.scrollTop(),t=g.cache,o=t.fits,n=t.sameHeight,i=t.element,s=t.scrollContext,t=t.context,r=g.is.bottom()&&c.pushing?c.bottomOffset:c.offset,e={top:e+r,bottom:e+r+s.height},r=o?0:g.get.elementScroll(e.top),s=!o;0===i.height||n||(g.is.initialPosition()?e.top>=t.bottom?(g.debug("Initial element position is bottom of container"),g.bindBottom()):e.top>i.top&&(i.height+e.top-r>=t.bottom&&i.height<t.height?(g.debug("Initial element position is bottom of container"),g.bindBottom()):(g.debug("Initial element position is fixed"),g.fixTop())):g.is.fixed()?g.is.top()?e.top<=i.top?(g.debug("Fixed element reached top of container"),g.setInitialPosition()):i.height+e.top-r>=t.bottom?(g.debug("Fixed element reached bottom of container"),g.bindBottom()):s&&(g.set.scroll(r),g.save.lastScroll(e.top),g.save.elementScroll(r)):g.is.bottom()&&(e.bottom-i.height<=i.top?(g.debug("Bottom fixed rail has reached top of container"),g.setInitialPosition()):e.bottom>=t.bottom?(g.debug("Bottom fixed rail has reached bottom of container"),g.bindBottom()):s&&(g.set.scroll(r),g.save.lastScroll(e.top),g.save.elementScroll(r))):g.is.bottom()&&(e.top<=i.top?(g.debug("Jumped from bottom fixed to top fixed, most likely used home/end button"),g.setInitialPosition()):c.pushing?g.is.bound()&&e.bottom<=t.bottom&&(g.debug("Fixing bottom attached element to bottom of browser."),g.fixBottom()):g.is.bound()&&e.top<=t.bottom-i.height&&(g.debug("Fixing bottom attached element to top of browser."),g.fixTop())))},bindTop:function(){g.debug("Binding element to top of parent container"),g.remove.offset(),c.setSize&&g.set.size(),f.css({left:"",top:"",marginBottom:""}).removeClass(i.fixed).removeClass(i.bottom).addClass(i.bound).addClass(i.top),c.onTop.call(h),c.onUnstick.call(h)},bindBottom:function(){g.debug("Binding element to bottom of parent container"),g.remove.offset(),c.setSize&&g.set.size(),f.css({left:"",top:""}).removeClass(i.fixed).removeClass(i.top).addClass(i.bound).addClass(i.bottom),c.onBottom.call(h),c.onUnstick.call(h)},setInitialPosition:function(){g.debug("Returning to initial position"),g.unfix(),g.unbind()},fixTop:function(){g.debug("Fixing element to top of page"),c.setSize&&g.set.size(),g.set.minimumSize(),g.set.offset(),f.css({left:g.cache.element.left,bottom:"",marginBottom:""}).removeClass(i.bound).removeClass(i.bottom).addClass(i.fixed).addClass(i.top),c.onStick.call(h)},fixBottom:function(){g.debug("Sticking element to bottom of page"),c.setSize&&g.set.size(),g.set.minimumSize(),g.set.offset(),f.css({left:g.cache.element.left,bottom:"",marginBottom:""}).removeClass(i.bound).removeClass(i.top).addClass(i.fixed).addClass(i.bottom),c.onStick.call(h)},unbind:function(){g.is.bound()&&(g.debug("Removing container bound position on element"),g.remove.offset(),f.removeClass(i.bound).removeClass(i.top).removeClass(i.bottom))},unfix:function(){g.is.fixed()&&(g.debug("Removing fixed position on element"),g.remove.minimumSize(),g.remove.offset(),f.removeClass(i.fixed).removeClass(i.top).removeClass(i.bottom),c.onUnstick.call(h))},reset:function(){g.debug("Resetting elements position"),g.unbind(),g.unfix(),g.resetCSS(),g.remove.offset(),g.remove.lastScroll()},resetCSS:function(){f.css({width:"",height:""}),t.css({height:""})},setting:function(e,t){if(z.isPlainObject(e))z.extend(!0,c,e);else{if(void 0===t)return c[e];c[e]=t}},internal:function(e,t){if(z.isPlainObject(e))z.extend(!0,g,e);else{if(void 0===t)return g[e];g[e]=t}},debug:function(){!c.silent&&c.debug&&(c.performance?g.performance.log(arguments):(g.debug=Function.prototype.bind.call(console.info,console,c.name+":"),g.debug.apply(console,arguments)))},verbose:function(){!c.silent&&c.verbose&&c.debug&&(c.performance?g.performance.log(arguments):(g.verbose=Function.prototype.bind.call(console.info,console,c.name+":"),g.verbose.apply(console,arguments)))},error:function(){c.silent||(g.error=Function.prototype.bind.call(console.error,console,c.name+":"),g.error.apply(console,arguments))},performance:{log:function(e){var t,o;c.performance&&(o=(t=Date.now())-(v||t),v=t,x.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:h,"Execution Time":o})),clearTimeout(g.performance.timer),g.performance.timer=setTimeout(g.performance.display,0)},display:function(){var e=c.name+":",o=0;v=!1,clearTimeout(g.performance.timer),z.each(x,function(e,t){o+=t["Execution Time"]}),e+=" "+o+"ms",0<x.length&&(console.groupCollapsed(e),console.table?console.table(x):z.each(x,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),x=[]}},invoke:function(n,e,t){var i,s,o,r,c=u;return e=e||y,t=t||h,"string"==typeof n&&void 0!==c&&(n=n.split(/[ .]/),i=n.length-1,z.each(n,function(e,t){var o=e!==i?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(z.isPlainObject(c[o])&&e!==i)c=c[o];else{if(void 0!==c[o])return s=c[o],!1;{if(!z.isPlainObject(c[t])||e===i)return void 0!==c[t]?s=c[t]:g.error(l.method,n),!1;c=c[t]}}})),"function"==typeof(r=s)&&"number"!=typeof r.nodeType?o=s.apply(t,e):void 0!==s&&(o=s),Array.isArray(b)?b.push(o):void 0!==b?b=[b,o]:void 0!==o&&(b=o),s}};S?(void 0===u&&g.initialize(),g.invoke(C)):(void 0!==u&&u.invoke("destroy"),g.initialize())}),void 0!==b?b:this},z.fn.sticky.settings={name:"Sticky",namespace:"sticky",silent:!1,debug:!1,verbose:!0,performance:!0,pushing:!1,context:!1,container:!1,scrollContext:T,offset:0,bottomOffset:0,jitter:5,setSize:!0,observeChanges:!1,onReposition:function(){},onScroll:function(){},onStick:function(){},onUnstick:function(){},onTop:function(){},onBottom:function(){},error:{visible:"Element is hidden, you must call refresh after element becomes visible. Use silent setting to suppress this warning in production.",method:"The method you called is not defined.",invalidContext:"Context specified does not exist",elementSize:"Sticky element is larger than its container, cannot create sticky."},className:{bound:"bound",fixed:"fixed",supported:"native",top:"top",bottom:"bottom"}}}(jQuery,window,document);
|
package/dist/components/tab.css
CHANGED
package/dist/components/tab.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.3-beta.
|
2
|
+
* # Fomantic-UI 2.9.3-beta.10+11b4099 - Tab
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -30,14 +30,25 @@
|
|
30
30
|
? $(window)
|
31
31
|
: $(this),
|
32
32
|
$document = $(document),
|
33
|
-
moduleSelector = $allModules.selector || '',
|
34
33
|
time = Date.now(),
|
35
34
|
performance = [],
|
36
35
|
|
37
36
|
query = arguments[0],
|
38
37
|
methodInvoked = typeof query === 'string',
|
39
38
|
queryArguments = [].slice.call(arguments, 1),
|
39
|
+
contextCheck = function (context, win) {
|
40
|
+
var $context;
|
41
|
+
if ([window, document].indexOf(context) >= 0) {
|
42
|
+
$context = $(context);
|
43
|
+
} else {
|
44
|
+
$context = $(win.document).find(context);
|
45
|
+
if ($context.length === 0) {
|
46
|
+
$context = win.frameElement ? contextCheck(context, win.parent) : window;
|
47
|
+
}
|
48
|
+
}
|
40
49
|
|
50
|
+
return $context;
|
51
|
+
},
|
41
52
|
initializedHistory = false,
|
42
53
|
returnedValue
|
43
54
|
;
|
@@ -152,7 +163,7 @@
|
|
152
163
|
$context = $reference.parent();
|
153
164
|
module.verbose('Determined parent element for creating context', $context);
|
154
165
|
} else if (settings.context) {
|
155
|
-
$context =
|
166
|
+
$context = contextCheck(settings.context, window);
|
156
167
|
module.verbose('Using selector for tab context', settings.context, $context);
|
157
168
|
} else {
|
158
169
|
$context = $('body');
|
@@ -788,9 +799,6 @@
|
|
788
799
|
totalTime += data['Execution Time'];
|
789
800
|
});
|
790
801
|
title += ' ' + totalTime + 'ms';
|
791
|
-
if (moduleSelector) {
|
792
|
-
title += ' \'' + moduleSelector + '\'';
|
793
|
-
}
|
794
802
|
if (performance.length > 0) {
|
795
803
|
console.groupCollapsed(title);
|
796
804
|
if (console.table) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.3-beta.
|
2
|
+
* # Fomantic UI - 2.9.3-beta.10+11b4099
|
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(j,U,k){"use strict";function D(e){return"function"==typeof e&&"number"!=typeof e.nodeType}U=void 0!==U&&U.Math===Math?U:globalThis,j.fn.tab=function(c){var l,d=D(this)?j(U):j(this),u=j(k),g=d.selector||"",L=Date.now(),S=[],E=c,w="string"==typeof E,O=[].slice.call(arguments,1),F=!1;return d.each(function(){var b,i,f,h,p,v=j.isPlainObject(c)?j.extend(!0,{},j.fn.tab.settings,c):j.extend({},j.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,A=j(this),o={},C=!0,r=0,x=this,s=A.data(e),P={initialize:function(){P.debug("Initializing tab menu item",A),P.determineTabs(),P.debug("Determining tabs",v.context,i),v.auto&&P.set.auto(),P.bind.events(),v.history&&!F&&(P.initializeHistory(),F=!0);var e,t=P.determine.activeTab();v.autoTabActivation&&void 0===s&&null===t&&(t=!0===v.autoTabActivation?P.get.initialPath():v.autoTabActivation,P.debug("No active tab detected, setting tab active",t),P.changeTab(t)),null!==t&&v.history&&(e=j.address.autoUpdate(),j.address.autoUpdate(!1),j.address.value(t),j.address.autoUpdate(e)),P.instantiate()},instantiate:function(){P.verbose("Storing instance of module",P),s=P,A.data(e,P)},destroy:function(){P.debug("Destroying tabs",A),A.removeData(e).off(n)},bind:{events:function(){var e;null!==(e=x)&&e===e.window||(P.debug("Attaching tab activation events to element",A),A.on("click"+n,P.event.click))}},determineTabs:function(){var e;"parent"===v.context?(0<A.closest(t.ui).length?(e=A.closest(t.ui),P.verbose("Using closest UI element as parent",e)):e=A,b=e.parent(),P.verbose("Determined parent element for creating context",b)):v.context?(b=[U,k].indexOf(v.context)<0?u.find(v.context):j(v.context),P.verbose("Using selector for tab context",v.context,b)):b=j("body"),v.childrenOnly?(i=b.children(t.tabs),P.debug("Searching tab context children for tabs",b,i)):(i=b.find(t.tabs),P.debug("Searching tab context for tabs",b,i))},initializeHistory:function(){if(P.debug("Initializing page state"),void 0===j.address)return P.error(T.state),!1;if("state"===v.historyType){if(P.debug("Using HTML5 to manage state"),!1===v.path)return P.error(T.path),!1;j.address.history(!0).state(v.path),j(U).trigger("popstate")}j.address.bind("change",P.event.history.change)},event:{click:function(e){var t=j(this).data(y.tab);void 0!==t?(v.history?(P.verbose("Updating page state",e),j.address.value(t)):(P.verbose("Changing tab",e),P.changeTab(t)),e.preventDefault()):P.debug("No tab specified")},history:{change:function(e){var t=e.pathNames.join("/")||P.get.initialPath(),a=v.templates.determineTitle(t)||!1;P.performance.display(),P.debug("History change event",t,e),p=e,void 0!==t&&P.changeTab(t),a&&j.address.title(a)}}},refresh:function(){f&&(P.debug("Refreshing tab",f),P.changeTab(f))},cache:{read:function(e){return void 0!==e&&o[e]},add:function(e,t){e=e||f,P.debug("Adding cached content for",e),o[e]=t},remove:function(e){e=e||f,P.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}";P.verbose("Setting up automatic tab retrieval from server",e),j.isPlainObject(v.apiSettings)?v.apiSettings.url=e:v.apiSettings={url:e}},loading:function(e){var t=P.get.tabElement(e);t.hasClass(m.loading)||(P.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){j.address.value(e)}},changeTab:function(l){var d=U.history&&U.history.pushState&&v.ignoreFirstLoad&&C,u=v.auto||j.isPlainObject(v.apiSettings),g=u&&!d?P.utilities.pathToArray(l):P.get.defaultPathArray(l);l=P.utilities.arrayToPath(g),j.each(g,function(e,t){var a,n,i=g.slice(0,e+1),o=P.utilities.arrayToPath(i),r=P.is.tab(o),s=e+1===g.length,c=P.get.tabElement(o);return P.verbose("Looking for tab",t),r?(P.verbose("Tab was found",t),f=o,h=P.utilities.filterArray(g,i),s?n=!0:(r=g.slice(0,e+2),t=P.utilities.arrayToPath(r),(n=!P.is.tab(t))&&P.verbose("Tab parameters found",r)),!1===v.onBeforeChange.call(x,o)?(P.debug("onBeforeChange returned false, cancelling tab change",c),!1):n&&u?(d?(P.debug("Ignoring remote content on first tab load",o),C=!1,P.cache.add(l,c.html()),P.activate.all(o),v.onFirstLoad.call(c[0],o,h,p),v.onLoad.call(c[0],o,h,p)):(P.activate.navigation(o),P.fetch.content(o,l)),!1):(P.debug("Opened local tab",o),P.activate.all(o),P.cache.read(o)||(P.cache.add(o,!0),P.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?(P.error(T.missingTab,A,b,o),!1):(l=P.escape.string(l),o=(a=j("#"+l+', a[name="'+l+'"]')).closest("[data-tab]").data(y.tab),c=P.get.tabElement(o),a&&0<a.length&&o?(P.debug("Anchor link used, opening parent tab",c,a),!1===v.onBeforeChange.call(x,o)?P.debug("onBeforeChange returned false, cancelling tab change",c):(c.hasClass(m.active)||setTimeout(function(){P.scrollTo(a)},0),P.activate.all(o),P.cache.read(o)||(P.cache.add(o,!0),P.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&&(P.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=P.get.tabElement(e),i=n[0];a=void 0!==a?a:v.evaluateScripts,"string"==typeof v.cacheType&&"dom"===v.cacheType.toLowerCase()&&"string"!=typeof t?n.empty().append(j(t).clone(!0)):a?(P.debug("Updating HTML and evaluating inline scripts",e,t),n.html(t)):(P.debug("Updating HTML",e,t),i.innerHTML=t)}},fetch:{content:function(t,a){var e,n=P.get.tabElement(t),i={dataType:"html",encodeParameters:!1,on:"now",cache:v.alwaysRefresh,headers:{"X-Remote":!0},onSuccess:function(e){"response"===v.cacheType&&P.cache.add(a,e),P.update.content(t,e),t==f?(P.debug("Content loaded",t),P.activate.tab(t)):P.debug("Content loaded in background",t),v.onFirstLoad.call(n[0],t,h,p),v.onLoad.call(n[0],t,h,p),v.loadOnce?P.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");P.cache.add(a,e)},0):P.cache.add(a,n.html())},urlData:{tab:a}},o=n.api("get request")||!1,o=o&&"pending"===o.state();a=a||t,e=P.cache.read(a),v.cache&&e?(P.activate.tab(t),P.debug("Adding cached content",a),v.loadOnce||("once"===v.evaluateScripts?P.update.content(t,e,!1):P.update.content(t,e)),v.onLoad.call(n[0],t,h,p)):o?(P.set.loading(t),P.debug("Content is already loading",a)):void 0!==j.api?(e=j.extend(!0,{},v.apiSettings,i),P.debug("Retrieving remote content",a,e),P.set.loading(t),n.api(e)):P.error(T.api)}},activate:{all:function(e){P.activate.tab(e),P.activate.navigation(e)},tab:function(e){var t=P.get.tabElement(e),a="siblings"===v.deactivate?t.siblings(i):i.not(t),n=t.hasClass(m.active);P.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=P.get.navElement(e),a="siblings"===v.deactivate?t.siblings(d):d.not(t),n=t.hasClass(m.active);P.verbose("Activating tab navigation for",t,e),n||(t.addClass(m.active),a.removeClass(m.active+" "+m.loading))}},deactivate:{all:function(){P.deactivate.navigation(),P.deactivate.tabs()},navigation:function(){d.removeClass(m.active)},tabs:function(){i.removeClass(m.active+" "+m.loading)}},is:{tab:function(e){return void 0!==e&&0<P.get.tabElement(e).length}},get:{initialPath:function(){return d.eq(0).data(y.tab)||i.eq(0).data(y.tab)},path:function(){return j.address.value()},defaultPathArray:function(e){return P.utilities.pathToArray(P.get.defaultPath(e))},defaultPath:function(e){var t=d.filter("[data-"+y.tab+'^="'+P.escape.string(e)+'/"]').eq(0).data(y.tab)||!1;if(t){if(P.debug("Found default tab",t),r<v.maxDepth)return r++,P.get.defaultPath(t);P.error(T.recursion)}else P.debug("No default tabs found for",e,i);return r=0,e},navElement:function(e){return e=e||f,d.filter("[data-"+y.tab+'="'+P.escape.string(e)+'"]')},tabElement:function(e){var t;return e=e||f,t=P.utilities.pathToArray(e),t=P.utilities.last(t),e=i.filter("[data-"+y.tab+'="'+P.escape.string(e)+'"]'),t=i.filter("[data-"+y.tab+'="'+P.escape.string(t)+'"]'),0<e.length?e:t},tab:function(){return f}},determine:{activeTab:function(){var a=null;return i.each(function(e,t){j(t).hasClass(m.active)&&(t=j(this).data(y.tab),d.filter("[data-"+y.tab+'="'+P.escape.string(t)+'"]').hasClass(m.active)&&(a=t))}),a}},utilities:{filterArray:function(e,t){return j.grep(e,function(e){return-1===j.inArray(e,t)})},last:function(e){return!!Array.isArray(e)&&e[e.length-1]},pathToArray:function(e){return"string"==typeof(e=void 0===e?f:e)?e.split("/"):[e]},arrayToPath:function(e){return!!Array.isArray(e)&&e.join("/")}},setting:function(e,t){if(P.debug("Changing setting",e,t),j.isPlainObject(e))j.extend(!0,v,e);else{if(void 0===t)return v[e];j.isPlainObject(v[e])?j.extend(!0,v[e],t):v[e]=t}},internal:function(e,t){if(j.isPlainObject(e))j.extend(!0,P,e);else{if(void 0===t)return P[e];P[e]=t}},debug:function(){!v.silent&&v.debug&&(v.performance?P.performance.log(arguments):(P.debug=Function.prototype.bind.call(console.info,console,v.name+":"),P.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?P.performance.log(arguments):(P.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),P.verbose.apply(console,arguments)))},error:function(){v.silent||(P.error=Function.prototype.bind.call(console.error,console,v.name+":"),P.error.apply(console,arguments))},performance:{log:function(e){var t,a;v.performance&&(a=(t=Date.now())-(L||t),L=t,S.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:x,"Execution Time":a})),clearTimeout(P.performance.timer),P.performance.timer=setTimeout(P.performance.display,500)},display:function(){var e=v.name+":",a=0;L=!1,clearTimeout(P.performance.timer),j.each(S,function(e,t){a+=t["Execution Time"]}),e+=" "+a+"ms",g&&(e+=" '"+g+"'"),0<S.length&&(console.groupCollapsed(e),console.table?console.table(S):j.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||x,"string"==typeof n&&void 0!==r&&(n=n.split(/[ .]/),i=n.length-1,j.each(n,function(e,t){var a=e!==i?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(j.isPlainObject(r[a])&&e!==i)r=r[a];else{if(void 0!==r[a])return o=r[a],!1;{if(!j.isPlainObject(r[t])||e===i)return void 0!==r[t]?o=r[t]:P.error(T.method,n),!1;r=r[t]}}})),D(o)?a=o.apply(t,e):void 0!==o&&(a=o),Array.isArray(l)?l.push(a):void 0!==l?l=[l,a]:void 0!==a&&(l=a),o}};w?(void 0===s&&P.initialize(),P.invoke(E)):(void 0!==s&&s.invoke("destroy"),P.initialize())}),void 0!==l?l:this},j.tab=function(){j(U).tab.apply(this,arguments)},j.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",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(j,U,n){"use strict";function k(e){return"function"==typeof e&&"number"!=typeof e.nodeType}U=void 0!==U&&U.Math===Math?U:globalThis,j.fn.tab=function(c){var l,d=k(this)?j(U):j(this),u=j(n),g=Date.now(),L=[],E=c,S="string"==typeof E,w=[].slice.call(arguments,1),O=function(e,t){var a;return 0<=[U,n].indexOf(e)?a=j(e):0===(a=j(t.document).find(e)).length&&(a=t.frameElement?O(e,t.parent):U),a},F=!1;return d.each(function(){var b,i,f,h,p,v=j.isPlainObject(c)?j.extend(!0,{},j.fn.tab.settings,c):j.extend({},j.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,A=j(this),o={},C=!0,r=0,x=this,s=A.data(e),P={initialize:function(){P.debug("Initializing tab menu item",A),P.determineTabs(),P.debug("Determining tabs",v.context,i),v.auto&&P.set.auto(),P.bind.events(),v.history&&!F&&(P.initializeHistory(),F=!0);var e,t=P.determine.activeTab();v.autoTabActivation&&void 0===s&&null===t&&(t=!0===v.autoTabActivation?P.get.initialPath():v.autoTabActivation,P.debug("No active tab detected, setting tab active",t),P.changeTab(t)),null!==t&&v.history&&(e=j.address.autoUpdate(),j.address.autoUpdate(!1),j.address.value(t),j.address.autoUpdate(e)),P.instantiate()},instantiate:function(){P.verbose("Storing instance of module",P),s=P,A.data(e,P)},destroy:function(){P.debug("Destroying tabs",A),A.removeData(e).off(n)},bind:{events:function(){var e;null!==(e=x)&&e===e.window||(P.debug("Attaching tab activation events to element",A),A.on("click"+n,P.event.click))}},determineTabs:function(){var e;"parent"===v.context?(0<A.closest(t.ui).length?(e=A.closest(t.ui),P.verbose("Using closest UI element as parent",e)):e=A,b=e.parent(),P.verbose("Determined parent element for creating context",b)):v.context?(b=O(v.context,U),P.verbose("Using selector for tab context",v.context,b)):b=j("body"),v.childrenOnly?(i=b.children(t.tabs),P.debug("Searching tab context children for tabs",b,i)):(i=b.find(t.tabs),P.debug("Searching tab context for tabs",b,i))},initializeHistory:function(){if(P.debug("Initializing page state"),void 0===j.address)return P.error(T.state),!1;if("state"===v.historyType){if(P.debug("Using HTML5 to manage state"),!1===v.path)return P.error(T.path),!1;j.address.history(!0).state(v.path),j(U).trigger("popstate")}j.address.bind("change",P.event.history.change)},event:{click:function(e){var t=j(this).data(y.tab);void 0!==t?(v.history?(P.verbose("Updating page state",e),j.address.value(t)):(P.verbose("Changing tab",e),P.changeTab(t)),e.preventDefault()):P.debug("No tab specified")},history:{change:function(e){var t=e.pathNames.join("/")||P.get.initialPath(),a=v.templates.determineTitle(t)||!1;P.performance.display(),P.debug("History change event",t,e),p=e,void 0!==t&&P.changeTab(t),a&&j.address.title(a)}}},refresh:function(){f&&(P.debug("Refreshing tab",f),P.changeTab(f))},cache:{read:function(e){return void 0!==e&&o[e]},add:function(e,t){e=e||f,P.debug("Adding cached content for",e),o[e]=t},remove:function(e){e=e||f,P.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}";P.verbose("Setting up automatic tab retrieval from server",e),j.isPlainObject(v.apiSettings)?v.apiSettings.url=e:v.apiSettings={url:e}},loading:function(e){var t=P.get.tabElement(e);t.hasClass(m.loading)||(P.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){j.address.value(e)}},changeTab:function(l){var d=U.history&&U.history.pushState&&v.ignoreFirstLoad&&C,u=v.auto||j.isPlainObject(v.apiSettings),g=u&&!d?P.utilities.pathToArray(l):P.get.defaultPathArray(l);l=P.utilities.arrayToPath(g),j.each(g,function(e,t){var a,n,i=g.slice(0,e+1),o=P.utilities.arrayToPath(i),r=P.is.tab(o),s=e+1===g.length,c=P.get.tabElement(o);return P.verbose("Looking for tab",t),r?(P.verbose("Tab was found",t),f=o,h=P.utilities.filterArray(g,i),s?n=!0:(r=g.slice(0,e+2),t=P.utilities.arrayToPath(r),(n=!P.is.tab(t))&&P.verbose("Tab parameters found",r)),!1===v.onBeforeChange.call(x,o)?(P.debug("onBeforeChange returned false, cancelling tab change",c),!1):n&&u?(d?(P.debug("Ignoring remote content on first tab load",o),C=!1,P.cache.add(l,c.html()),P.activate.all(o),v.onFirstLoad.call(c[0],o,h,p),v.onLoad.call(c[0],o,h,p)):(P.activate.navigation(o),P.fetch.content(o,l)),!1):(P.debug("Opened local tab",o),P.activate.all(o),P.cache.read(o)||(P.cache.add(o,!0),P.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?(P.error(T.missingTab,A,b,o),!1):(l=P.escape.string(l),o=(a=j("#"+l+', a[name="'+l+'"]')).closest("[data-tab]").data(y.tab),c=P.get.tabElement(o),a&&0<a.length&&o?(P.debug("Anchor link used, opening parent tab",c,a),!1===v.onBeforeChange.call(x,o)?P.debug("onBeforeChange returned false, cancelling tab change",c):(c.hasClass(m.active)||setTimeout(function(){P.scrollTo(a)},0),P.activate.all(o),P.cache.read(o)||(P.cache.add(o,!0),P.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&&(P.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=P.get.tabElement(e),i=n[0];a=void 0!==a?a:v.evaluateScripts,"string"==typeof v.cacheType&&"dom"===v.cacheType.toLowerCase()&&"string"!=typeof t?n.empty().append(j(t).clone(!0)):a?(P.debug("Updating HTML and evaluating inline scripts",e,t),n.html(t)):(P.debug("Updating HTML",e,t),i.innerHTML=t)}},fetch:{content:function(t,a){var e,n=P.get.tabElement(t),i={dataType:"html",encodeParameters:!1,on:"now",cache:v.alwaysRefresh,headers:{"X-Remote":!0},onSuccess:function(e){"response"===v.cacheType&&P.cache.add(a,e),P.update.content(t,e),t==f?(P.debug("Content loaded",t),P.activate.tab(t)):P.debug("Content loaded in background",t),v.onFirstLoad.call(n[0],t,h,p),v.onLoad.call(n[0],t,h,p),v.loadOnce?P.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");P.cache.add(a,e)},0):P.cache.add(a,n.html())},urlData:{tab:a}},o=n.api("get request")||!1,o=o&&"pending"===o.state();a=a||t,e=P.cache.read(a),v.cache&&e?(P.activate.tab(t),P.debug("Adding cached content",a),v.loadOnce||("once"===v.evaluateScripts?P.update.content(t,e,!1):P.update.content(t,e)),v.onLoad.call(n[0],t,h,p)):o?(P.set.loading(t),P.debug("Content is already loading",a)):void 0!==j.api?(e=j.extend(!0,{},v.apiSettings,i),P.debug("Retrieving remote content",a,e),P.set.loading(t),n.api(e)):P.error(T.api)}},activate:{all:function(e){P.activate.tab(e),P.activate.navigation(e)},tab:function(e){var t=P.get.tabElement(e),a="siblings"===v.deactivate?t.siblings(i):i.not(t),n=t.hasClass(m.active);P.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=P.get.navElement(e),a="siblings"===v.deactivate?t.siblings(d):d.not(t),n=t.hasClass(m.active);P.verbose("Activating tab navigation for",t,e),n||(t.addClass(m.active),a.removeClass(m.active+" "+m.loading))}},deactivate:{all:function(){P.deactivate.navigation(),P.deactivate.tabs()},navigation:function(){d.removeClass(m.active)},tabs:function(){i.removeClass(m.active+" "+m.loading)}},is:{tab:function(e){return void 0!==e&&0<P.get.tabElement(e).length}},get:{initialPath:function(){return d.eq(0).data(y.tab)||i.eq(0).data(y.tab)},path:function(){return j.address.value()},defaultPathArray:function(e){return P.utilities.pathToArray(P.get.defaultPath(e))},defaultPath:function(e){var t=d.filter("[data-"+y.tab+'^="'+P.escape.string(e)+'/"]').eq(0).data(y.tab)||!1;if(t){if(P.debug("Found default tab",t),r<v.maxDepth)return r++,P.get.defaultPath(t);P.error(T.recursion)}else P.debug("No default tabs found for",e,i);return r=0,e},navElement:function(e){return e=e||f,d.filter("[data-"+y.tab+'="'+P.escape.string(e)+'"]')},tabElement:function(e){var t;return e=e||f,t=P.utilities.pathToArray(e),t=P.utilities.last(t),e=i.filter("[data-"+y.tab+'="'+P.escape.string(e)+'"]'),t=i.filter("[data-"+y.tab+'="'+P.escape.string(t)+'"]'),0<e.length?e:t},tab:function(){return f}},determine:{activeTab:function(){var a=null;return i.each(function(e,t){j(t).hasClass(m.active)&&(t=j(this).data(y.tab),d.filter("[data-"+y.tab+'="'+P.escape.string(t)+'"]').hasClass(m.active)&&(a=t))}),a}},utilities:{filterArray:function(e,t){return j.grep(e,function(e){return-1===j.inArray(e,t)})},last:function(e){return!!Array.isArray(e)&&e[e.length-1]},pathToArray:function(e){return"string"==typeof(e=void 0===e?f:e)?e.split("/"):[e]},arrayToPath:function(e){return!!Array.isArray(e)&&e.join("/")}},setting:function(e,t){if(P.debug("Changing setting",e,t),j.isPlainObject(e))j.extend(!0,v,e);else{if(void 0===t)return v[e];j.isPlainObject(v[e])?j.extend(!0,v[e],t):v[e]=t}},internal:function(e,t){if(j.isPlainObject(e))j.extend(!0,P,e);else{if(void 0===t)return P[e];P[e]=t}},debug:function(){!v.silent&&v.debug&&(v.performance?P.performance.log(arguments):(P.debug=Function.prototype.bind.call(console.info,console,v.name+":"),P.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?P.performance.log(arguments):(P.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),P.verbose.apply(console,arguments)))},error:function(){v.silent||(P.error=Function.prototype.bind.call(console.error,console,v.name+":"),P.error.apply(console,arguments))},performance:{log:function(e){var t,a;v.performance&&(a=(t=Date.now())-(g||t),g=t,L.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:x,"Execution Time":a})),clearTimeout(P.performance.timer),P.performance.timer=setTimeout(P.performance.display,500)},display:function(){var e=v.name+":",a=0;g=!1,clearTimeout(P.performance.timer),j.each(L,function(e,t){a+=t["Execution Time"]}),e+=" "+a+"ms",0<L.length&&(console.groupCollapsed(e),console.table?console.table(L):j.each(L,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),L=[]}},invoke:function(n,e,t){var i,o,a,r=s;return e=e||w,t=t||x,"string"==typeof n&&void 0!==r&&(n=n.split(/[ .]/),i=n.length-1,j.each(n,function(e,t){var a=e!==i?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(j.isPlainObject(r[a])&&e!==i)r=r[a];else{if(void 0!==r[a])return o=r[a],!1;{if(!j.isPlainObject(r[t])||e===i)return void 0!==r[t]?o=r[t]:P.error(T.method,n),!1;r=r[t]}}})),k(o)?a=o.apply(t,e):void 0!==o&&(a=o),Array.isArray(l)?l.push(a):void 0!==l?l=[l,a]:void 0!==a&&(l=a),o}};S?(void 0===s&&P.initialize(),P.invoke(E)):(void 0!==s&&s.invoke("destroy"),P.initialize())}),void 0!==l?l:this},j.tab=function(){j(U).tab.apply(this,arguments)},j.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",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.3-beta.
|
2
|
+
* # Fomantic-UI 2.9.3-beta.10+11b4099 - Toast
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -22,7 +22,7 @@
|
|
22
22
|
$.fn.toast = function (parameters) {
|
23
23
|
var
|
24
24
|
$allModules = $(this),
|
25
|
-
|
25
|
+
$body = $('body'),
|
26
26
|
|
27
27
|
time = Date.now(),
|
28
28
|
performance = [],
|
@@ -30,6 +30,19 @@
|
|
30
30
|
query = arguments[0],
|
31
31
|
methodInvoked = typeof query === 'string',
|
32
32
|
queryArguments = [].slice.call(arguments, 1),
|
33
|
+
contextCheck = function (context, win) {
|
34
|
+
var $context;
|
35
|
+
if ([window, document].indexOf(context) >= 0) {
|
36
|
+
$context = $(context);
|
37
|
+
} else {
|
38
|
+
$context = $(win.document).find(context);
|
39
|
+
if ($context.length === 0) {
|
40
|
+
$context = win.frameElement ? contextCheck(context, win.parent) : $body;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
return $context;
|
45
|
+
},
|
33
46
|
returnedValue
|
34
47
|
;
|
35
48
|
$allModules.each(function () {
|
@@ -55,9 +68,7 @@
|
|
55
68
|
$progressBar,
|
56
69
|
$animationObject,
|
57
70
|
$close,
|
58
|
-
$context = settings.context
|
59
|
-
? ([window, document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context))
|
60
|
-
: $('body'),
|
71
|
+
$context = settings.context ? contextCheck(settings.context, window) : $body,
|
61
72
|
|
62
73
|
isToastComponent = $module.hasClass('toast') || $module.hasClass('message') || $module.hasClass('card'),
|
63
74
|
|
@@ -106,11 +117,11 @@
|
|
106
117
|
if ($toastBox) {
|
107
118
|
module.debug('Removing toast', $toastBox);
|
108
119
|
module.unbind.events();
|
120
|
+
settings.onRemove.call($toastBox, element);
|
109
121
|
$toastBox.remove();
|
110
122
|
$toastBox = undefined;
|
111
123
|
$toast = undefined;
|
112
124
|
$animationObject = undefined;
|
113
|
-
settings.onRemove.call($toastBox, element);
|
114
125
|
$progress = undefined;
|
115
126
|
$progressBar = undefined;
|
116
127
|
$close = undefined;
|
@@ -704,9 +715,6 @@
|
|
704
715
|
totalTime += data['Execution Time'];
|
705
716
|
});
|
706
717
|
title += ' ' + totalTime + 'ms';
|
707
|
-
if (moduleSelector) {
|
708
|
-
title += ' \'' + moduleSelector + '\'';
|
709
|
-
}
|
710
718
|
if (performance.length > 0) {
|
711
719
|
console.groupCollapsed(title);
|
712
720
|
if (console.table) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.3-beta.
|
2
|
+
* # Fomantic UI - 2.9.3-beta.10+11b4099
|
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(D,E,H){"use strict";function z(e){return"function"==typeof e&&"number"!=typeof e.nodeType}E=void 0!==E&&E.Math===Math?E:globalThis,D.fn.toast=function(x){var k,e=D(this),T=e.selector||"",I=Date.now(),P=[],O=x,M="string"==typeof O,A=[].slice.call(arguments,1);return e.each(function(){var t,o,a,s,i,c,l,e,r=D.isPlainObject(x)?D.extend(!0,{},D.fn.toast.settings,x):D.extend({},D.fn.toast.settings),d=r.className,u=r.selector,p=r.error,n=r.namespace,f=r.fields,g="."+n,m=n+"-module",h=D(this),v=r.context?[E,H].indexOf(r.context)<0?D(H).find(r.context):D(r.context):D("body"),b=h.hasClass("toast")||h.hasClass("message")||h.hasClass("card"),C=this,y=b?h.data(m):void 0,w={initialize:function(){w.verbose("Initializing element"),w.create.id(),w.has.container()||w.create.container(),(b||""!==r.message||""!==r.title||""!==w.get.iconClass()||r.showImage||w.has.configActions())&&("string"==typeof r.showProgress&&-1!==[d.top,d.bottom].indexOf(r.showProgress)||(r.showProgress=!1),w.create.toast(),r.closeOnClick&&(r.closeIcon||0<D(o).find(u.input).length||w.has.configActions())&&(r.closeOnClick=!1),r.closeOnClick||t.addClass(d.unclickable),w.bind.events()),w.instantiate(),t&&w.show()},instantiate:function(){w.verbose("Storing instance of toast"),y=w,h.data(m,y)},destroy:function(){t&&(w.debug("Removing toast",t),w.unbind.events(),t.remove(),c=o=t=void 0,r.onRemove.call(t,C),l=i=s=void 0),h.removeData(m)},show:function(e){!1===r.onShow.call(t,C)?w.debug("onShow callback returned false, cancelling toast animation"):(e=e||function(){},w.debug("Showing toast"),w.animate.show(e))},close:function(e){!1===r.onHide.call(t,C)?w.debug("onHide callback returned false, cancelling toast animation"):(e=e||function(){},w.debug("Closing toast"),w.remove.visible(),w.unbind.events(),w.animate.close(e))},create:{container:function(){w.verbose("Creating container"),v.append(D("<div/>",{class:r.position+" "+d.container+" "+(r.horizontal?d.horizontal:"")+" "+(r.context&&"body"!==r.context?d.absolute:"")}))},id:function(){e=(Math.random().toString(16)+"000000000").slice(2,10),w.verbose("Creating unique id for element",e)},toast:function(){t=D("<div/>",{class:d.box});var e,n=w.get.iconClass();b?(o=r.cloneModule?h.clone().removeAttr("id"):h,l=o.find("> i"+w.helpers.toClass(d.close)),r.closeIcon=0<l.length,""!==n&&o.find(u.icon).attr("class",n+" "+d.icon),r.showImage&&o.find(u.image).attr("src",r.showImage),""!==r.title&&o.find(u.title).html(w.helpers.escape(r.title,r.preserveHTML)),""!==r.message&&o.find(u.message).html(w.helpers.escape(r.message,r.preserveHTML))):(w.verbose("Creating toast"),o=D("<div/>",{role:"alert"}),e=D("<div/>",{class:d.content}),""!==n&&o.append(D("<i/>",{class:n+" "+d.icon})),r.showImage&&o.append(D("<img>",{class:d.image+" "+r.classImage,src:r.showImage})),""!==r.title&&(n="_"+w.get.id()+"title",o.attr("aria-labelledby",n),e.append(D("<div/>",{class:d.title,id:n,html:w.helpers.escape(r.title,r.preserveHTML)}))),n="_"+w.get.id()+"desc",o.attr("aria-describedby",n),e.append(D("<div/>",{class:d.message,id:n,html:w.helpers.escape(r.message,r.preserveHTML)})),o.addClass(r.class+" "+d.toast).append(e),o.css("opacity",String(r.opacity)),r.closeIcon&&((l=D("<i/>",{class:d.close+" "+("string"==typeof r.closeIcon?r.closeIcon:""),role:"button",tabindex:0,"aria-label":r.text.close})).hasClass(d.left)?o.prepend(l):o.append(l))),o.hasClass(d.compact)&&(r.compact=!0),o.hasClass("card")&&(r.compact=!1),a=o.find(".actions"),w.has.configActions()&&(0===a.length&&(a=D("<div/>",{class:d.actions+" "+(r.classActions||"")}).appendTo(o)),o.hasClass("card")&&!a.hasClass(d.attached)&&(a.addClass(d.extraContent),a.hasClass(d.vertical)&&(a.removeClass(d.vertical),w.error(p.verticalCard))),r.actions.forEach(function(e){var n=e[f.icon]?"<i "+(e[f.text]?'aria-hidden="true"':"")+' class="'+w.helpers.deQuote(e[f.icon])+' icon"></i>':"",t=w.helpers.escape(e[f.text]||"",r.preserveHTML),o=w.helpers.deQuote(e[f.class]||""),s=e[f.click]&&z(e[f.click])?e[f.click]:function(){};a.append(D("<button/>",{html:n+t,"aria-label":(e[f.text]||e[f.icon]||"").replace(/<[^>]+(>|$)/g,""),class:d.button+" "+o,on:{click:function(){var e=D(this);e.is(u.approve)||e.is(u.deny)||!1===s.call(C,h)||w.close()}}}))})),a&&a.hasClass(d.vertical)&&o.addClass(d.vertical),0<a.length&&!a.hasClass(d.attached)&&(!a||a.hasClass(d.basic)&&!a.hasClass(d.left)||o.addClass(d.actions)),"auto"===r.displayTime&&(r.displayTime=Math.max(r.minDisplayTime,o.text().split(" ").length/r.wordsPerMinute*6e4)),t.append(o),0<a.length&&a.hasClass(d.attached)&&(a.addClass(d.buttons),a.detach(),o.addClass(d.attached),a.hasClass(d.vertical)?(o.wrap(D("<div/>",{class:d.vertical+" "+d.attached+" "+(r.compact?d.compact:"")})),a.hasClass(d.left)?o.addClass(d.left).parent().addClass(d.left).prepend(a):o.parent().append(a)):a.hasClass(d.top)?(t.prepend(a),o.addClass(d.bottom)):(t.append(a),o.addClass(d.top))),h!==o&&(C=(h=o)[0]),0<r.displayTime&&(n=d.progressing+" "+(r.pauseOnHover?d.pausable:""),r.showProgress&&(s=D("<div/>",{class:d.progress+" "+(r.classProgress||r.class),"data-percent":""}),r.classProgress||(o.hasClass("toast")&&!o.hasClass(d.inverted)?s.addClass(d.inverted):s.removeClass(d.inverted)),i=D("<div/>",{class:"bar "+(r.progressUp?"up ":"down ")+n}),s.addClass(r.showProgress).append(i),s.hasClass(d.top)?t.prepend(s):t.append(s),i.css("animation-duration",r.displayTime/1e3+"s")),(c=D("<span/>",{class:"wait "+n})).css("animation-duration",r.displayTime/1e3+"s"),c.appendTo(o)),r.compact&&(t.addClass(d.compact),o.addClass(d.compact),s&&s.addClass(d.compact)),r.newestOnTop?t.prependTo(w.get.container()):t.appendTo(w.get.container())}},bind:{events:function(){w.debug("Binding events to toast"),r.closeIcon&&l.on("click"+g,w.event.close),o.on("click"+g,w.event.click),c&&c.on("animationend"+g,w.event.close),t.on("click"+g,u.approve,w.event.approve).on("click"+g,u.deny,w.event.deny)}},unbind:{events:function(){w.debug("Unbinding events to toast"),r.closeIcon&&l.off("click"+g),o.off("click"+g),c&&c.off("animationend"+g),t.off("click"+g)}},animate:{show:function(e){e=z(e)?e:function(){},r.transition&&w.can.useElement("transition")&&(w.set.visible(),t.transition({animation:r.transition.showMethod+" in",queue:!1,debug:r.debug,verbose:r.verbose,silent:r.silent,duration:r.transition.showDuration,onComplete:function(){e.call(t,C),r.onVisible.call(t,C)}}))},close:function(e){e=z(e)?e:function(){},r.transition&&void 0!==D.fn.transition?t.transition({animation:r.transition.hideMethod+" out",queue:!1,duration:r.transition.hideDuration,debug:r.debug,verbose:r.verbose,silent:r.silent,interval:50,onBeforeHide:function(e){e=z(e)?e:function(){},""!==r.transition.closeEasing?t&&(t.css("opacity","0"),t.wrap("<div/>").parent().hide(r.transition.closeDuration,r.transition.closeEasing,function(){t&&(t.parent().remove(),e.call(t))})):e.call(t)},onComplete:function(){e.call(t,C),r.onHidden.call(t,C),w.destroy()}}):w.error(p.noTransition)},pause:function(){c.css("animationPlayState","paused"),i&&i.css("animationPlayState","paused")},continue:function(){c.css("animationPlayState","running"),i&&i.css("animationPlayState","running")}},has:{container:function(){return w.verbose("Determining if there is already a container"),0<w.get.containers().length},toast:function(){return!!w.get.toast()},toasts:function(){return 0<w.get.toasts().length},configActions:function(){return Array.isArray(r.actions)&&0<r.actions.length}},get:{id:function(){return e},containers:function(){return v.children(w.helpers.toClass(r.position)+u.container+(r.horizontal?w.helpers.toClass(d.horizontal):":not("+w.helpers.toClass(d.horizontal)+")")+(r.context&&"body"!==r.context?w.helpers.toClass(d.absolute):":not("+w.helpers.toClass(d.absolute)+")"))},container:function(){return w.get.containers()[0]},toastBox:function(){return t||null},toast:function(){return o||null},toasts:function(){return D(w.get.container()).find(u.box)},iconClass:function(){return"string"==typeof r.showIcon?r.showIcon:r.showIcon&&r.icons[r.class]?r.icons[r.class]:""},remainingTime:function(){return c?c.css("opacity")*r.displayTime:0}},set:{visible:function(){o.addClass(d.visible)}},remove:{visible:function(){o.removeClass(d.visible)}},event:{close:function(){w.close()},click:function(e){0===D(e.target).closest(u.clickable).length&&(!1!==r.onClick.call(t,C)&&r.closeOnClick?w.close():w.verbose("Click callback returned false or close denied by setting cancelling close"))},approve:function(){!1===r.onApprove.call(C,h)?w.verbose("Approve callback returned false cancelling close"):w.close()},deny:function(){!1===r.onDeny.call(C,h)?w.verbose("Deny callback returned false cancelling close"):w.close()}},helpers:{toClass:function(e){var e=e.trim().split(/\s+/),n="";return e.forEach(function(e){n+="."+e}),n},deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,n){if(n)return e;var t={"<":"<",">":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return t[e]}):e}},can:{useElement:function(e){return void 0!==D.fn[e]||(w.error(p.noElement.replace("{element}",e)),!1)}},setting:function(e,n){if(w.debug("Changing setting",e,n),D.isPlainObject(e))D.extend(!0,r,e);else{if(void 0===n)return r[e];D.isPlainObject(r[e])?D.extend(!0,r[e],n):r[e]=n}},internal:function(e,n){if(D.isPlainObject(e))D.extend(!0,w,e);else{if(void 0===n)return w[e];w[e]=n}},debug:function(){!r.silent&&r.debug&&(r.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,r.name+":"),w.debug.apply(console,arguments)))},verbose:function(){!r.silent&&r.verbose&&r.debug&&(r.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,r.name+":"),w.verbose.apply(console,arguments)))},error:function(){r.silent||(w.error=Function.prototype.bind.call(console.error,console,r.name+":"),w.error.apply(console,arguments))},performance:{log:function(e){var n,t;r.performance&&(t=(n=Date.now())-(I||n),I=n,P.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:C,"Execution Time":t})),clearTimeout(w.performance.timer),w.performance.timer=setTimeout(w.performance.display,500)},display:function(){var e=r.name+":",t=0;I=!1,clearTimeout(w.performance.timer),D.each(P,function(e,n){t+=n["Execution Time"]}),e+=" "+t+"ms",T&&(e+=" '"+T+"'"),0<P.length&&(console.groupCollapsed(e),console.table?console.table(P):D.each(P,function(e,n){console.log(n.Name+": "+n["Execution Time"]+"ms")}),console.groupEnd()),P=[]}},invoke:function(o,e,n){var s,a,t,i=y;return e=e||A,n=n||C,"string"==typeof o&&void 0!==i&&(o=o.split(/[ .]/),s=o.length-1,D.each(o,function(e,n){var t=e!==s?n+o[e+1].charAt(0).toUpperCase()+o[e+1].slice(1):o;if(D.isPlainObject(i[t])&&e!==s)i=i[t];else{if(void 0!==i[t])return a=i[t],!1;{if(!D.isPlainObject(i[n])||e===s)return void 0!==i[n]?a=i[n]:w.error(p.method,o),!1;i=i[n]}}})),z(a)?t=a.apply(n,e):void 0!==a&&(t=a),Array.isArray(k)?k.push(t):void 0!==k?k=[k,t]:void 0!==t&&(k=t),a}};M?(void 0===y&&w.initialize(),w.invoke(O)):(void 0!==y&&y.invoke("destroy"),w.initialize(),k=h)}),void 0!==k?k:this},D.toast=D.fn.toast,D.fn.toast.settings={name:"Toast",namespace:"toast",silent:!1,debug:!1,verbose:!1,performance:!0,context:"body",position:"top right",horizontal:!1,class:"neutral",classProgress:!1,classActions:!1,classImage:"mini",title:"",message:"",displayTime:3e3,minDisplayTime:1e3,wordsPerMinute:120,showIcon:!1,newestOnTop:!1,showProgress:!1,pauseOnHover:!0,progressUp:!1,opacity:1,compact:!0,closeIcon:!1,closeOnClick:!0,cloneModule:!0,actions:!1,preserveHTML:!0,showImage:!1,transition:{showMethod:"scale",showDuration:500,hideMethod:"scale",hideDuration:500,closeEasing:"easeOutCubic",closeDuration:500},error:{method:"The method you called is not defined.",noElement:"This module requires ui {element}",verticalCard:"Vertical but not attached actions are not supported for card layout"},className:{container:"ui toast-container",absolute:"absolute",box:"floating toast-box",progress:"ui attached active progress",toast:"ui toast",icon:"centered icon",visible:"visible",content:"content",title:"ui header",message:"message",actions:"actions",extraContent:"extra content",button:"ui button",buttons:"ui buttons",close:"close icon",image:"ui image",vertical:"vertical",horizontal:"horizontal",attached:"attached",inverted:"inverted",compact:"compact",pausable:"pausable",progressing:"progressing",top:"top",bottom:"bottom",left:"left",basic:"basic",unclickable:"unclickable"},text:{close:"Close"},icons:{info:"info",success:"checkmark",warning:"warning",error:"times"},selector:{container:".ui.toast-container",box:".toast-box",toast:".ui.toast",title:".header",message:".message:not(.ui)",image:"> img.image, > .image > img",icon:"> i.icon",input:'input:not([type="hidden"]), textarea, select, button, .ui.button, ui.dropdown',clickable:"a, details, .ui.accordion",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel"},fields:{class:"class",text:"text",icon:"icon",click:"click"},onShow:function(){},onVisible:function(){},onClick:function(){},onHide:function(){},onHidden:function(){},onRemove:function(){},onApprove:function(){},onDeny:function(){}},D.extend(D.easing,{easeOutBounce:function(e){var n=7.5625,t=2.75;return e<1/t?n*e*e:e<2/t?n*(e-=1.5/t)*e+.75:e<2.5/t?n*(e-=2.25/t)*e+.9375:n*(e-=2.625/t)*e+.984375},easeOutCubic:function(e){return--e*e*e+1}})}(jQuery,window,document);
|
11
|
+
!function(E,H,o){"use strict";function z(e){return"function"==typeof e&&"number"!=typeof e.nodeType}H=void 0!==H&&H.Math===Math?H:globalThis,E.fn.toast=function(x){var k,e=E(this),T=E("body"),I=Date.now(),P=[],O=x,M="string"==typeof O,A=[].slice.call(arguments,1),D=function(e,n){var t;return 0<=[H,o].indexOf(e)?t=E(e):0===(t=E(n.document).find(e)).length&&(t=n.frameElement?D(e,n.parent):T),t};return e.each(function(){var t,o,a,s,i,c,l,e,r=E.isPlainObject(x)?E.extend(!0,{},E.fn.toast.settings,x):E.extend({},E.fn.toast.settings),d=r.className,u=r.selector,p=r.error,n=r.namespace,f=r.fields,g="."+n,m=n+"-module",h=E(this),v=r.context?D(r.context,H):T,b=h.hasClass("toast")||h.hasClass("message")||h.hasClass("card"),C=this,y=b?h.data(m):void 0,w={initialize:function(){w.verbose("Initializing element"),w.create.id(),w.has.container()||w.create.container(),(b||""!==r.message||""!==r.title||""!==w.get.iconClass()||r.showImage||w.has.configActions())&&("string"==typeof r.showProgress&&-1!==[d.top,d.bottom].indexOf(r.showProgress)||(r.showProgress=!1),w.create.toast(),r.closeOnClick&&(r.closeIcon||0<E(o).find(u.input).length||w.has.configActions())&&(r.closeOnClick=!1),r.closeOnClick||t.addClass(d.unclickable),w.bind.events()),w.instantiate(),t&&w.show()},instantiate:function(){w.verbose("Storing instance of toast"),y=w,h.data(m,y)},destroy:function(){t&&(w.debug("Removing toast",t),w.unbind.events(),r.onRemove.call(t,C),t.remove(),l=i=s=c=o=t=void 0),h.removeData(m)},show:function(e){!1===r.onShow.call(t,C)?w.debug("onShow callback returned false, cancelling toast animation"):(e=e||function(){},w.debug("Showing toast"),w.animate.show(e))},close:function(e){!1===r.onHide.call(t,C)?w.debug("onHide callback returned false, cancelling toast animation"):(e=e||function(){},w.debug("Closing toast"),w.remove.visible(),w.unbind.events(),w.animate.close(e))},create:{container:function(){w.verbose("Creating container"),v.append(E("<div/>",{class:r.position+" "+d.container+" "+(r.horizontal?d.horizontal:"")+" "+(r.context&&"body"!==r.context?d.absolute:"")}))},id:function(){e=(Math.random().toString(16)+"000000000").slice(2,10),w.verbose("Creating unique id for element",e)},toast:function(){t=E("<div/>",{class:d.box});var e,n=w.get.iconClass();b?(o=r.cloneModule?h.clone().removeAttr("id"):h,l=o.find("> i"+w.helpers.toClass(d.close)),r.closeIcon=0<l.length,""!==n&&o.find(u.icon).attr("class",n+" "+d.icon),r.showImage&&o.find(u.image).attr("src",r.showImage),""!==r.title&&o.find(u.title).html(w.helpers.escape(r.title,r.preserveHTML)),""!==r.message&&o.find(u.message).html(w.helpers.escape(r.message,r.preserveHTML))):(w.verbose("Creating toast"),o=E("<div/>",{role:"alert"}),e=E("<div/>",{class:d.content}),""!==n&&o.append(E("<i/>",{class:n+" "+d.icon})),r.showImage&&o.append(E("<img>",{class:d.image+" "+r.classImage,src:r.showImage})),""!==r.title&&(n="_"+w.get.id()+"title",o.attr("aria-labelledby",n),e.append(E("<div/>",{class:d.title,id:n,html:w.helpers.escape(r.title,r.preserveHTML)}))),n="_"+w.get.id()+"desc",o.attr("aria-describedby",n),e.append(E("<div/>",{class:d.message,id:n,html:w.helpers.escape(r.message,r.preserveHTML)})),o.addClass(r.class+" "+d.toast).append(e),o.css("opacity",String(r.opacity)),r.closeIcon&&((l=E("<i/>",{class:d.close+" "+("string"==typeof r.closeIcon?r.closeIcon:""),role:"button",tabindex:0,"aria-label":r.text.close})).hasClass(d.left)?o.prepend(l):o.append(l))),o.hasClass(d.compact)&&(r.compact=!0),o.hasClass("card")&&(r.compact=!1),a=o.find(".actions"),w.has.configActions()&&(0===a.length&&(a=E("<div/>",{class:d.actions+" "+(r.classActions||"")}).appendTo(o)),o.hasClass("card")&&!a.hasClass(d.attached)&&(a.addClass(d.extraContent),a.hasClass(d.vertical)&&(a.removeClass(d.vertical),w.error(p.verticalCard))),r.actions.forEach(function(e){var n=e[f.icon]?"<i "+(e[f.text]?'aria-hidden="true"':"")+' class="'+w.helpers.deQuote(e[f.icon])+' icon"></i>':"",t=w.helpers.escape(e[f.text]||"",r.preserveHTML),o=w.helpers.deQuote(e[f.class]||""),s=e[f.click]&&z(e[f.click])?e[f.click]:function(){};a.append(E("<button/>",{html:n+t,"aria-label":(e[f.text]||e[f.icon]||"").replace(/<[^>]+(>|$)/g,""),class:d.button+" "+o,on:{click:function(){var e=E(this);e.is(u.approve)||e.is(u.deny)||!1===s.call(C,h)||w.close()}}}))})),a&&a.hasClass(d.vertical)&&o.addClass(d.vertical),0<a.length&&!a.hasClass(d.attached)&&(!a||a.hasClass(d.basic)&&!a.hasClass(d.left)||o.addClass(d.actions)),"auto"===r.displayTime&&(r.displayTime=Math.max(r.minDisplayTime,o.text().split(" ").length/r.wordsPerMinute*6e4)),t.append(o),0<a.length&&a.hasClass(d.attached)&&(a.addClass(d.buttons),a.detach(),o.addClass(d.attached),a.hasClass(d.vertical)?(o.wrap(E("<div/>",{class:d.vertical+" "+d.attached+" "+(r.compact?d.compact:"")})),a.hasClass(d.left)?o.addClass(d.left).parent().addClass(d.left).prepend(a):o.parent().append(a)):a.hasClass(d.top)?(t.prepend(a),o.addClass(d.bottom)):(t.append(a),o.addClass(d.top))),h!==o&&(C=(h=o)[0]),0<r.displayTime&&(n=d.progressing+" "+(r.pauseOnHover?d.pausable:""),r.showProgress&&(s=E("<div/>",{class:d.progress+" "+(r.classProgress||r.class),"data-percent":""}),r.classProgress||(o.hasClass("toast")&&!o.hasClass(d.inverted)?s.addClass(d.inverted):s.removeClass(d.inverted)),i=E("<div/>",{class:"bar "+(r.progressUp?"up ":"down ")+n}),s.addClass(r.showProgress).append(i),s.hasClass(d.top)?t.prepend(s):t.append(s),i.css("animation-duration",r.displayTime/1e3+"s")),(c=E("<span/>",{class:"wait "+n})).css("animation-duration",r.displayTime/1e3+"s"),c.appendTo(o)),r.compact&&(t.addClass(d.compact),o.addClass(d.compact),s&&s.addClass(d.compact)),r.newestOnTop?t.prependTo(w.get.container()):t.appendTo(w.get.container())}},bind:{events:function(){w.debug("Binding events to toast"),r.closeIcon&&l.on("click"+g,w.event.close),o.on("click"+g,w.event.click),c&&c.on("animationend"+g,w.event.close),t.on("click"+g,u.approve,w.event.approve).on("click"+g,u.deny,w.event.deny)}},unbind:{events:function(){w.debug("Unbinding events to toast"),r.closeIcon&&l.off("click"+g),o.off("click"+g),c&&c.off("animationend"+g),t.off("click"+g)}},animate:{show:function(e){e=z(e)?e:function(){},r.transition&&w.can.useElement("transition")&&(w.set.visible(),t.transition({animation:r.transition.showMethod+" in",queue:!1,debug:r.debug,verbose:r.verbose,silent:r.silent,duration:r.transition.showDuration,onComplete:function(){e.call(t,C),r.onVisible.call(t,C)}}))},close:function(e){e=z(e)?e:function(){},r.transition&&void 0!==E.fn.transition?t.transition({animation:r.transition.hideMethod+" out",queue:!1,duration:r.transition.hideDuration,debug:r.debug,verbose:r.verbose,silent:r.silent,interval:50,onBeforeHide:function(e){e=z(e)?e:function(){},""!==r.transition.closeEasing?t&&(t.css("opacity","0"),t.wrap("<div/>").parent().hide(r.transition.closeDuration,r.transition.closeEasing,function(){t&&(t.parent().remove(),e.call(t))})):e.call(t)},onComplete:function(){e.call(t,C),r.onHidden.call(t,C),w.destroy()}}):w.error(p.noTransition)},pause:function(){c.css("animationPlayState","paused"),i&&i.css("animationPlayState","paused")},continue:function(){c.css("animationPlayState","running"),i&&i.css("animationPlayState","running")}},has:{container:function(){return w.verbose("Determining if there is already a container"),0<w.get.containers().length},toast:function(){return!!w.get.toast()},toasts:function(){return 0<w.get.toasts().length},configActions:function(){return Array.isArray(r.actions)&&0<r.actions.length}},get:{id:function(){return e},containers:function(){return v.children(w.helpers.toClass(r.position)+u.container+(r.horizontal?w.helpers.toClass(d.horizontal):":not("+w.helpers.toClass(d.horizontal)+")")+(r.context&&"body"!==r.context?w.helpers.toClass(d.absolute):":not("+w.helpers.toClass(d.absolute)+")"))},container:function(){return w.get.containers()[0]},toastBox:function(){return t||null},toast:function(){return o||null},toasts:function(){return E(w.get.container()).find(u.box)},iconClass:function(){return"string"==typeof r.showIcon?r.showIcon:r.showIcon&&r.icons[r.class]?r.icons[r.class]:""},remainingTime:function(){return c?c.css("opacity")*r.displayTime:0}},set:{visible:function(){o.addClass(d.visible)}},remove:{visible:function(){o.removeClass(d.visible)}},event:{close:function(){w.close()},click:function(e){0===E(e.target).closest(u.clickable).length&&(!1!==r.onClick.call(t,C)&&r.closeOnClick?w.close():w.verbose("Click callback returned false or close denied by setting cancelling close"))},approve:function(){!1===r.onApprove.call(C,h)?w.verbose("Approve callback returned false cancelling close"):w.close()},deny:function(){!1===r.onDeny.call(C,h)?w.verbose("Deny callback returned false cancelling close"):w.close()}},helpers:{toClass:function(e){var e=e.trim().split(/\s+/),n="";return e.forEach(function(e){n+="."+e}),n},deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,n){if(n)return e;var t={"<":"<",">":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return t[e]}):e}},can:{useElement:function(e){return void 0!==E.fn[e]||(w.error(p.noElement.replace("{element}",e)),!1)}},setting:function(e,n){if(w.debug("Changing setting",e,n),E.isPlainObject(e))E.extend(!0,r,e);else{if(void 0===n)return r[e];E.isPlainObject(r[e])?E.extend(!0,r[e],n):r[e]=n}},internal:function(e,n){if(E.isPlainObject(e))E.extend(!0,w,e);else{if(void 0===n)return w[e];w[e]=n}},debug:function(){!r.silent&&r.debug&&(r.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,r.name+":"),w.debug.apply(console,arguments)))},verbose:function(){!r.silent&&r.verbose&&r.debug&&(r.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,r.name+":"),w.verbose.apply(console,arguments)))},error:function(){r.silent||(w.error=Function.prototype.bind.call(console.error,console,r.name+":"),w.error.apply(console,arguments))},performance:{log:function(e){var n,t;r.performance&&(t=(n=Date.now())-(I||n),I=n,P.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:C,"Execution Time":t})),clearTimeout(w.performance.timer),w.performance.timer=setTimeout(w.performance.display,500)},display:function(){var e=r.name+":",t=0;I=!1,clearTimeout(w.performance.timer),E.each(P,function(e,n){t+=n["Execution Time"]}),e+=" "+t+"ms",0<P.length&&(console.groupCollapsed(e),console.table?console.table(P):E.each(P,function(e,n){console.log(n.Name+": "+n["Execution Time"]+"ms")}),console.groupEnd()),P=[]}},invoke:function(o,e,n){var s,a,t,i=y;return e=e||A,n=n||C,"string"==typeof o&&void 0!==i&&(o=o.split(/[ .]/),s=o.length-1,E.each(o,function(e,n){var t=e!==s?n+o[e+1].charAt(0).toUpperCase()+o[e+1].slice(1):o;if(E.isPlainObject(i[t])&&e!==s)i=i[t];else{if(void 0!==i[t])return a=i[t],!1;{if(!E.isPlainObject(i[n])||e===s)return void 0!==i[n]?a=i[n]:w.error(p.method,o),!1;i=i[n]}}})),z(a)?t=a.apply(n,e):void 0!==a&&(t=a),Array.isArray(k)?k.push(t):void 0!==k?k=[k,t]:void 0!==t&&(k=t),a}};M?(void 0===y&&w.initialize(),w.invoke(O)):(void 0!==y&&y.invoke("destroy"),w.initialize(),k=h)}),void 0!==k?k:this},E.toast=E.fn.toast,E.fn.toast.settings={name:"Toast",namespace:"toast",silent:!1,debug:!1,verbose:!1,performance:!0,context:"body",position:"top right",horizontal:!1,class:"neutral",classProgress:!1,classActions:!1,classImage:"mini",title:"",message:"",displayTime:3e3,minDisplayTime:1e3,wordsPerMinute:120,showIcon:!1,newestOnTop:!1,showProgress:!1,pauseOnHover:!0,progressUp:!1,opacity:1,compact:!0,closeIcon:!1,closeOnClick:!0,cloneModule:!0,actions:!1,preserveHTML:!0,showImage:!1,transition:{showMethod:"scale",showDuration:500,hideMethod:"scale",hideDuration:500,closeEasing:"easeOutCubic",closeDuration:500},error:{method:"The method you called is not defined.",noElement:"This module requires ui {element}",verticalCard:"Vertical but not attached actions are not supported for card layout"},className:{container:"ui toast-container",absolute:"absolute",box:"floating toast-box",progress:"ui attached active progress",toast:"ui toast",icon:"centered icon",visible:"visible",content:"content",title:"ui header",message:"message",actions:"actions",extraContent:"extra content",button:"ui button",buttons:"ui buttons",close:"close icon",image:"ui image",vertical:"vertical",horizontal:"horizontal",attached:"attached",inverted:"inverted",compact:"compact",pausable:"pausable",progressing:"progressing",top:"top",bottom:"bottom",left:"left",basic:"basic",unclickable:"unclickable"},text:{close:"Close"},icons:{info:"info",success:"checkmark",warning:"warning",error:"times"},selector:{container:".ui.toast-container",box:".toast-box",toast:".ui.toast",title:".header",message:".message:not(.ui)",image:"> img.image, > .image > img",icon:"> i.icon",input:'input:not([type="hidden"]), textarea, select, button, .ui.button, ui.dropdown',clickable:"a, details, .ui.accordion",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel"},fields:{class:"class",text:"text",icon:"icon",click:"click"},onShow:function(){},onVisible:function(){},onClick:function(){},onHide:function(){},onHidden:function(){},onRemove:function(){},onApprove:function(){},onDeny:function(){}},E.extend(E.easing,{easeOutBounce:function(e){var n=7.5625,t=2.75;return e<1/t?n*e*e:e<2/t?n*(e-=1.5/t)*e+.75:e<2.5/t?n*(e-=2.25/t)*e+.9375:n*(e-=2.625/t)*e+.984375},easeOutCubic:function(e){return--e*e*e+1}})}(jQuery,window,document);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.3-beta.
|
2
|
+
* # Fomantic-UI 2.9.3-beta.10+11b4099 - Transition
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -22,7 +22,6 @@
|
|
22
22
|
$.fn.transition = function () {
|
23
23
|
var
|
24
24
|
$allModules = $(this),
|
25
|
-
moduleSelector = $allModules.selector || '',
|
26
25
|
|
27
26
|
time = Date.now(),
|
28
27
|
performance = [],
|
@@ -863,9 +862,6 @@
|
|
863
862
|
totalTime += data['Execution Time'];
|
864
863
|
});
|
865
864
|
title += ' ' + totalTime + 'ms';
|
866
|
-
if (moduleSelector) {
|
867
|
-
title += ' \'' + moduleSelector + '\'';
|
868
|
-
}
|
869
865
|
if ($allModules.length > 1) {
|
870
866
|
title += ' (' + $allModules.length + ')';
|
871
867
|
}
|