fomantic-ui 2.9.3-beta.0 → 2.9.3-beta.2
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 +1 -1
- package/dist/components/calendar.js +1 -6
- package/dist/components/calendar.min.css +1 -1
- 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 +1 -1
- package/dist/components/dropdown.js +19 -11
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +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 +15 -8
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +1 -1
- package/dist/components/form.js +6 -6
- package/dist/components/form.min.css +1 -1
- package/dist/components/form.min.js +2 -2
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/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 +1 -1
- package/dist/components/modal.js +14 -7
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +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 +1 -1
- package/dist/components/popup.js +18 -12
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +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 +1 -6
- 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 +16 -8
- 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 +55 -54
- package/dist/semantic.js +215 -185
- 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 +5 -5
- package/src/definitions/behaviors/state.js +22 -19
- package/src/definitions/behaviors/visibility.js +14 -5
- package/src/definitions/elements/segment.less +2 -1
- package/src/definitions/modules/accordion.js +0 -4
- package/src/definitions/modules/calendar.js +0 -5
- package/src/definitions/modules/checkbox.js +0 -4
- package/src/definitions/modules/dimmer.js +0 -4
- package/src/definitions/modules/dropdown.js +18 -10
- package/src/definitions/modules/embed.js +0 -5
- package/src/definitions/modules/flyout.js +14 -7
- package/src/definitions/modules/modal.js +13 -6
- package/src/definitions/modules/nag.js +15 -7
- package/src/definitions/modules/popup.js +17 -11
- package/src/definitions/modules/progress.js +0 -5
- package/src/definitions/modules/rating.js +0 -4
- package/src/definitions/modules/search.js +0 -4
- package/src/definitions/modules/shape.js +0 -4
- package/src/definitions/modules/sidebar.js +14 -7
- package/src/definitions/modules/slider.js +0 -5
- package/src/definitions/modules/sticky.js +16 -15
- package/src/definitions/modules/tab.js +13 -5
- package/src/definitions/modules/toast.js +15 -7
- package/src/definitions/modules/transition.js +0 -4
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.3-beta.
|
2
|
+
* # Fomantic UI - 2.9.3-beta.2+824a375
|
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(),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(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.2+824a375 - 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
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.3-beta.
|
2
|
+
* # Fomantic UI - 2.9.3-beta.2+824a375
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* https://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* https://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(w,n){"use strict";n=void 0!==n&&n.Math===Math?n:globalThis,w.fn.transition=function(){var p,o=w(this),r=o.selector||"",s=Date.now(),g=[],v=arguments,b=v[0],y=[].slice.call(arguments,1),h="string"==typeof b;return o.each(function(i){var l,d,e,c,t,n,a,u=w(this),m=this,f={initialize:function(){l=f.get.settings.apply(m,v),c=l.className,e=l.error,t=l.metadata,a="."+l.namespace,n="module-"+l.namespace,d=u.data(n)||f,!1===(h=h&&f.invoke(b))&&(f.verbose("Converted arguments into settings object",l),l.interval?f.delay(l.interval):f.animate(),f.instantiate())},instantiate:function(){f.verbose("Storing instance of module",f),d=f,u.data(n,d)},destroy:function(){f.verbose("Destroying previous module for",m),u.removeData(n)},refresh:function(){f.verbose("Refreshing display type on next animation"),delete f.displayType},forceRepaint:function(){f.verbose("Forcing element repaint");var n=u.parent(),e=u.next();0===e.length?u.detach().appendTo(n):u.detach().insertBefore(e)},repaint:function(){f.verbose("Repainting element");m.offsetWidth},delay:function(n){var e=(e=f.get.animationDirection())||(f.can.transition()?f.get.direction():"static");n=void 0!==n?n:l.interval,e="auto"===l.reverse&&e===c.outward||!0===l.reverse?(o.length-i)*n:i*n,f.debug("Delaying animation by",e),setTimeout(f.animate,e)},animate:function(n){if(l=n||l,f.debug("Preparing animation",l.animation),f.is.animating()){if(l.queue)return!l.allowRepeats&&f.has.direction()&&f.is.occurring()&&!0!==f.queuing?f.debug("Animation is currently occurring, preventing queueing same animation",l.animation):f.queue(l.animation),!1;if(!l.allowRepeats&&f.is.occurring())return f.debug("Animation is already occurring, will not execute repeated animation",l.animation),!1;f.debug("New animation started, completing previous early",l.animation),d.complete()}f.can.animate()?f.set.animating(l.animation):f.error(e.noAnimation,l.animation,m)},reset:function(){f.debug("Resetting animation to beginning conditions"),f.remove.animationCallbacks(),f.restore.conditions(),f.remove.animating()},queue:function(n){f.debug("Queueing animation of",n),f.queuing=!0,u.one("animationend.queue"+a,function(){f.queuing=!1,f.repaint(),f.animate.apply(this,l)})},complete:function(n){n&&n.target===m&&n.stopPropagation(),f.debug("Animation complete",l.animation),f.remove.completeCallback(),f.remove.failSafe(),f.is.looping()||(f.is.outward()?(f.verbose("Animation is outward, hiding element"),f.restore.conditions(),f.hide()):f.is.inward()?(f.verbose("Animation is inward, showing element"),f.restore.conditions(),f.show()):(f.verbose("Static animation completed"),f.restore.conditions(),l.onComplete.call(m)))},force:{visible:function(){var n=u.attr("style"),n=f.get.userStyle(n),e=f.get.displayType(),n=n+"display: "+e+" !important;",i=u[0].style.display;return!e||"none"===i&&l.skipInlineHidden||u[0].tagName.match(/(script|link|style)/i)?(f.remove.transition(),!1):(f.verbose("Overriding default display to show element",e),u.attr("style",n),!0)},hidden:function(){var n=u.attr("style"),n=void 0===n||""===n;"none"===u.css("display")||f.is.hidden()?n&&u.removeAttr("style"):(f.verbose("Overriding default display to hide element"),u.css("display","none"))}},has:{direction:function(n){var i=!1;return"string"==typeof(n=n||l.animation)&&(n=n.split(" "),w.each(n,function(n,e){e!==c.inward&&e!==c.outward||(i=!0)})),i},inlineDisplay:function(){var n=u.attr("style")||"";return Array.isArray(n.match(/display.*?;/,""))}},set:{animating:function(n){f.remove.completeCallback(),n=n||l.animation;n=f.get.animationClass(n);f.save.animation(n),f.force.visible()&&(f.remove.hidden(),f.remove.direction(),f.start.animation(n))},duration:function(n,e){!(e="number"==typeof(e=e||l.duration)?e+"ms":e)&&0!==e||(f.verbose("Setting animation duration",e),u.css({"animation-duration":e}))},direction:function(n){(n=n||f.get.direction())===c.inward?f.set.inward():f.set.outward()},looping:function(){f.debug("Transition set to loop"),u.addClass(c.looping)},hidden:function(){u.addClass(c.transition).addClass(c.hidden)},inward:function(){f.debug("Setting direction to inward"),u.removeClass(c.outward).addClass(c.inward)},outward:function(){f.debug("Setting direction to outward"),u.removeClass(c.inward).addClass(c.outward)},visible:function(){u.addClass(c.transition).addClass(c.visible)}},start:{animation:function(n){n=n||f.get.animationClass(),f.debug("Starting tween",n),u.addClass(n).one("animationend.complete"+a,f.complete),l.useFailSafe&&f.add.failSafe(),f.set.duration(l.duration),l.onStart.call(m)}},save:{animation:function(n){f.cache||(f.cache={}),f.cache.animation=n},displayType:function(n){"none"!==n&&u.data(t.displayType,n)},transitionExists:function(n,e){w.fn.transition.exists[n]=e,f.verbose("Saving existence of transition",n,e)}},restore:{conditions:function(){var n=f.get.currentAnimation();n&&(u.removeClass(n),f.verbose("Removing animation class",f.cache)),f.remove.duration()}},add:{failSafe:function(){var n=f.get.duration();f.timer=setTimeout(function(){u.triggerHandler("animationend")},n+l.failSafeDelay),f.verbose("Adding fail safe timer",f.timer)}},remove:{animating:function(){u.removeClass(c.animating)},animationCallbacks:function(){f.remove.queueCallback(),f.remove.completeCallback()},queueCallback:function(){u.off(".queue"+a)},completeCallback:function(){u.off(".complete"+a)},display:function(){u.css("display","")},direction:function(){u.removeClass(c.inward).removeClass(c.outward)},duration:function(){u.css("animation-duration","")},failSafe:function(){f.verbose("Removing fail safe timer",f.timer),f.timer&&clearTimeout(f.timer)},hidden:function(){u.removeClass(c.hidden)},visible:function(){u.removeClass(c.visible)},looping:function(){f.debug("Transitions are no longer looping"),f.is.looping()&&(f.reset(),u.removeClass(c.looping))},transition:function(){u.removeClass(c.transition).removeClass(c.visible).removeClass(c.hidden)}},get:{settings:function(n,e,i){return"object"==typeof n?w.extend(!0,{},w.fn.transition.settings,n):"function"==typeof i?w.extend({},w.fn.transition.settings,{animation:n,onComplete:i,duration:e}):"string"==typeof e||"number"==typeof e?w.extend({},w.fn.transition.settings,{animation:n,duration:e}):"object"==typeof e?w.extend({},w.fn.transition.settings,e,{animation:n}):"function"==typeof e?w.extend({},w.fn.transition.settings,{animation:n,onComplete:e}):w.extend({},w.fn.transition.settings,{animation:n})},animationClass:function(n){var n=n||l.animation,e=f.can.transition()&&!f.has.direction()?f.get.direction()+" ":"";return c.animating+" "+c.transition+" "+e+n},currentAnimation:function(){return!(!f.cache||void 0===f.cache.animation)&&f.cache.animation},currentDirection:function(){return f.is.inward()?c.inward:c.outward},direction:function(){return f.is.hidden()||!f.is.visible()?c.inward:c.outward},animationDirection:function(n){var i;return"string"==typeof(n=n||l.animation)&&(n=n.split(" "),w.each(n,function(n,e){e===c.inward?i=c.inward:e===c.outward&&(i=c.outward)})),i||!1},duration:function(n){return"string"==typeof(n=!1===(n=n||l.duration)?u.css("animation-duration")||0:n)?-1<n.indexOf("ms")?parseFloat(n):1e3*parseFloat(n):n},displayType:function(n){return l.displayType||((n=void 0===n||n)&&void 0===u.data(t.displayType)&&(""===(n=u.css("display"))||"none"===n?f.can.transition(!0):f.save.displayType(n)),u.data(t.displayType))},userStyle:function(n){return(n=n||u.attr("style")||"").replace(/display.*?;/,"")},transitionExists:function(n){return w.fn.transition.exists[n]}},can:{transition:function(n){var e,i,t,a,o=l.animation,r=f.get.transitionExists(o),s=f.get.displayType(!1);if(void 0===r||n){if(f.verbose("Determining whether animation exists"),n=u.attr("class"),e=u.prop("tagName"),i=(e=w("<"+e+" />").addClass(n).insertAfter(u)).addClass(o).removeClass(c.inward).removeClass(c.outward).addClass(c.animating).addClass(c.transition).css("animationName"),e.detach().insertAfter(u),t=e.addClass(c.inward).css("animationName"),s||(e.detach().insertAfter(u),s=e.attr("class",n).removeAttr("style").removeClass(c.hidden).removeClass(c.visible).show().css("display"),f.verbose("Determining final display state",s),f.save.displayType(s)),e.remove(),i!==t)f.debug("Direction exists for animation",o),a=!0;else{if("none"===i||!i)return void f.debug("No animation defined in css",o);f.debug("Static animation found",o,s),a=!1}f.save.transitionExists(o,a)}return void 0!==r?r:a},animate:function(){return void 0!==f.can.transition()}},is:{animating:function(){return u.hasClass(c.animating)},inward:function(){return u.hasClass(c.inward)},outward:function(){return u.hasClass(c.outward)},looping:function(){return u.hasClass(c.looping)},occurring:function(n){return n="."+(n=n||l.animation).replace(" ","."),0<u.filter(n).length},visible:function(){return u.is(":visible")},hidden:function(){return"hidden"===u.css("visibility")},supported:function(){return!0}},hide:function(){if(!1===l.onHide.call(m))return f.verbose("Hide callback returned false cancelling hide"),!1;f.verbose("Hiding element"),f.is.animating()&&f.reset(),m.blur(),f.remove.display(),f.remove.visible(),l.onBeforeHide.call(m,f.hideNow)},hideNow:function(){f.set.hidden(),f.force.hidden(),l.onHidden.call(m),l.onComplete.call(m)},show:function(n){f.force.visible()&&!1!==l.onShow.call(m)&&(f.verbose("Showing element",n),f.remove.hidden(),l.onBeforeShow.call(m,f.showNow))},showNow:function(){f.set.visible(),l.onVisible.call(m),l.onComplete.call(m)},toggle:function(){f.is.visible()?f.hide():f.show()},stop:function(){f.debug("Stopping current animation"),u.triggerHandler("animationend")},stopAll:function(){f.debug("Stopping all animation"),f.remove.queueCallback(),u.triggerHandler("animationend")},clear:{queue:function(){f.debug("Clearing animation queue"),f.remove.queueCallback()}},enable:function(){f.verbose("Starting animation"),u.removeClass(c.disabled)},disable:function(){f.debug("Stopping animation"),u.addClass(c.disabled)},setting:function(n,e){if(f.debug("Changing setting",n,e),w.isPlainObject(n))w.extend(!0,l,n);else{if(void 0===e)return l[n];w.isPlainObject(l[n])?w.extend(!0,l[n],e):l[n]=e}},internal:function(n,e){if(w.isPlainObject(n))w.extend(!0,f,n);else{if(void 0===e)return f[n];f[n]=e}},debug:function(){!l.silent&&l.debug&&(l.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,l.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!l.silent&&l.verbose&&l.debug&&(l.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),f.verbose.apply(console,arguments)))},error:function(){l.silent||(f.error=Function.prototype.bind.call(console.error,console,l.name+":"),f.error.apply(console,arguments))},performance:{log:function(n){var e,i;l.performance&&(i=(e=Date.now())-(s||e),s=e,g.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:m,"Execution Time":i})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var n=l.name+":",i=0;s=!1,clearTimeout(f.performance.timer),w.each(g,function(n,e){i+=e["Execution Time"]}),n+=" "+i+"ms",r&&(n+=" '"+r+"'"),1<o.length&&(n+=" ("+o.length+")"),0<g.length&&(console.groupCollapsed(n),console.table?console.table(g):w.each(g,function(n,e){console.log(e.Name+": "+e["Execution Time"]+"ms")}),console.groupEnd()),g=[]}},invoke:function(t,n,e){var a,o,i,r,s=d;return n=n||y,e=e||m,"string"==typeof t&&void 0!==s&&(t=t.split(/[ .]/),a=t.length-1,w.each(t,function(n,e){var i=n!==a?e+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(w.isPlainObject(s[i])&&n!==a)s=s[i];else{if(void 0!==s[i])return o=s[i],!1;{if(!w.isPlainObject(s[e])||n===a)return void 0!==s[e]&&(o=s[e]),!1;s=s[e]}}})),"function"==typeof(r=o)&&"number"!=typeof r.nodeType?i=o.apply(e,n):void 0!==o&&(i=o),Array.isArray(p)?p.push(i):void 0!==p?p=[p,i]:void 0!==i&&(p=i),void 0!==o&&o}};f.initialize()}),void 0!==p?p:this},w.fn.transition.exists={},w.fn.transition.settings={name:"Transition",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"transition",interval:0,reverse:"auto",onStart:function(){},onComplete:function(){},onShow:function(){},onBeforeShow:function(n){n.call(this)},onVisible:function(){},onHide:function(){},onHidden:function(){},onBeforeHide:function(n){n.call(this)},useFailSafe:!0,failSafeDelay:100,allowRepeats:!1,displayType:!1,animation:"fade",duration:!1,queue:!0,skipInlineHidden:!1,metadata:{displayType:"display"},className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",loading:"loading",looping:"looping",outward:"out",transition:"transition",visible:"visible"},error:{noAnimation:"Element is no longer attached to DOM. Unable to animate. Use silent setting to suppress this warning in production."}}}(jQuery,window,document);
|
11
|
+
!function(h,n){"use strict";n=void 0!==n&&n.Math===Math?n:globalThis,h.fn.transition=function(){var p,o=h(this),r=Date.now(),s=[],g=arguments,v=g[0],b=[].slice.call(arguments,1),y="string"==typeof v;return o.each(function(i){var l,d,e,c,t,n,a,u=h(this),m=this,f={initialize:function(){l=f.get.settings.apply(m,g),c=l.className,e=l.error,t=l.metadata,a="."+l.namespace,n="module-"+l.namespace,d=u.data(n)||f,!1===(y=y&&f.invoke(v))&&(f.verbose("Converted arguments into settings object",l),l.interval?f.delay(l.interval):f.animate(),f.instantiate())},instantiate:function(){f.verbose("Storing instance of module",f),d=f,u.data(n,d)},destroy:function(){f.verbose("Destroying previous module for",m),u.removeData(n)},refresh:function(){f.verbose("Refreshing display type on next animation"),delete f.displayType},forceRepaint:function(){f.verbose("Forcing element repaint");var n=u.parent(),e=u.next();0===e.length?u.detach().appendTo(n):u.detach().insertBefore(e)},repaint:function(){f.verbose("Repainting element");m.offsetWidth},delay:function(n){var e=(e=f.get.animationDirection())||(f.can.transition()?f.get.direction():"static");n=void 0!==n?n:l.interval,e="auto"===l.reverse&&e===c.outward||!0===l.reverse?(o.length-i)*n:i*n,f.debug("Delaying animation by",e),setTimeout(f.animate,e)},animate:function(n){if(l=n||l,f.debug("Preparing animation",l.animation),f.is.animating()){if(l.queue)return!l.allowRepeats&&f.has.direction()&&f.is.occurring()&&!0!==f.queuing?f.debug("Animation is currently occurring, preventing queueing same animation",l.animation):f.queue(l.animation),!1;if(!l.allowRepeats&&f.is.occurring())return f.debug("Animation is already occurring, will not execute repeated animation",l.animation),!1;f.debug("New animation started, completing previous early",l.animation),d.complete()}f.can.animate()?f.set.animating(l.animation):f.error(e.noAnimation,l.animation,m)},reset:function(){f.debug("Resetting animation to beginning conditions"),f.remove.animationCallbacks(),f.restore.conditions(),f.remove.animating()},queue:function(n){f.debug("Queueing animation of",n),f.queuing=!0,u.one("animationend.queue"+a,function(){f.queuing=!1,f.repaint(),f.animate.apply(this,l)})},complete:function(n){n&&n.target===m&&n.stopPropagation(),f.debug("Animation complete",l.animation),f.remove.completeCallback(),f.remove.failSafe(),f.is.looping()||(f.is.outward()?(f.verbose("Animation is outward, hiding element"),f.restore.conditions(),f.hide()):f.is.inward()?(f.verbose("Animation is inward, showing element"),f.restore.conditions(),f.show()):(f.verbose("Static animation completed"),f.restore.conditions(),l.onComplete.call(m)))},force:{visible:function(){var n=u.attr("style"),n=f.get.userStyle(n),e=f.get.displayType(),n=n+"display: "+e+" !important;",i=u[0].style.display;return!e||"none"===i&&l.skipInlineHidden||u[0].tagName.match(/(script|link|style)/i)?(f.remove.transition(),!1):(f.verbose("Overriding default display to show element",e),u.attr("style",n),!0)},hidden:function(){var n=u.attr("style"),n=void 0===n||""===n;"none"===u.css("display")||f.is.hidden()?n&&u.removeAttr("style"):(f.verbose("Overriding default display to hide element"),u.css("display","none"))}},has:{direction:function(n){var i=!1;return"string"==typeof(n=n||l.animation)&&(n=n.split(" "),h.each(n,function(n,e){e!==c.inward&&e!==c.outward||(i=!0)})),i},inlineDisplay:function(){var n=u.attr("style")||"";return Array.isArray(n.match(/display.*?;/,""))}},set:{animating:function(n){f.remove.completeCallback(),n=n||l.animation;n=f.get.animationClass(n);f.save.animation(n),f.force.visible()&&(f.remove.hidden(),f.remove.direction(),f.start.animation(n))},duration:function(n,e){!(e="number"==typeof(e=e||l.duration)?e+"ms":e)&&0!==e||(f.verbose("Setting animation duration",e),u.css({"animation-duration":e}))},direction:function(n){(n=n||f.get.direction())===c.inward?f.set.inward():f.set.outward()},looping:function(){f.debug("Transition set to loop"),u.addClass(c.looping)},hidden:function(){u.addClass(c.transition).addClass(c.hidden)},inward:function(){f.debug("Setting direction to inward"),u.removeClass(c.outward).addClass(c.inward)},outward:function(){f.debug("Setting direction to outward"),u.removeClass(c.inward).addClass(c.outward)},visible:function(){u.addClass(c.transition).addClass(c.visible)}},start:{animation:function(n){n=n||f.get.animationClass(),f.debug("Starting tween",n),u.addClass(n).one("animationend.complete"+a,f.complete),l.useFailSafe&&f.add.failSafe(),f.set.duration(l.duration),l.onStart.call(m)}},save:{animation:function(n){f.cache||(f.cache={}),f.cache.animation=n},displayType:function(n){"none"!==n&&u.data(t.displayType,n)},transitionExists:function(n,e){h.fn.transition.exists[n]=e,f.verbose("Saving existence of transition",n,e)}},restore:{conditions:function(){var n=f.get.currentAnimation();n&&(u.removeClass(n),f.verbose("Removing animation class",f.cache)),f.remove.duration()}},add:{failSafe:function(){var n=f.get.duration();f.timer=setTimeout(function(){u.triggerHandler("animationend")},n+l.failSafeDelay),f.verbose("Adding fail safe timer",f.timer)}},remove:{animating:function(){u.removeClass(c.animating)},animationCallbacks:function(){f.remove.queueCallback(),f.remove.completeCallback()},queueCallback:function(){u.off(".queue"+a)},completeCallback:function(){u.off(".complete"+a)},display:function(){u.css("display","")},direction:function(){u.removeClass(c.inward).removeClass(c.outward)},duration:function(){u.css("animation-duration","")},failSafe:function(){f.verbose("Removing fail safe timer",f.timer),f.timer&&clearTimeout(f.timer)},hidden:function(){u.removeClass(c.hidden)},visible:function(){u.removeClass(c.visible)},looping:function(){f.debug("Transitions are no longer looping"),f.is.looping()&&(f.reset(),u.removeClass(c.looping))},transition:function(){u.removeClass(c.transition).removeClass(c.visible).removeClass(c.hidden)}},get:{settings:function(n,e,i){return"object"==typeof n?h.extend(!0,{},h.fn.transition.settings,n):"function"==typeof i?h.extend({},h.fn.transition.settings,{animation:n,onComplete:i,duration:e}):"string"==typeof e||"number"==typeof e?h.extend({},h.fn.transition.settings,{animation:n,duration:e}):"object"==typeof e?h.extend({},h.fn.transition.settings,e,{animation:n}):"function"==typeof e?h.extend({},h.fn.transition.settings,{animation:n,onComplete:e}):h.extend({},h.fn.transition.settings,{animation:n})},animationClass:function(n){var n=n||l.animation,e=f.can.transition()&&!f.has.direction()?f.get.direction()+" ":"";return c.animating+" "+c.transition+" "+e+n},currentAnimation:function(){return!(!f.cache||void 0===f.cache.animation)&&f.cache.animation},currentDirection:function(){return f.is.inward()?c.inward:c.outward},direction:function(){return f.is.hidden()||!f.is.visible()?c.inward:c.outward},animationDirection:function(n){var i;return"string"==typeof(n=n||l.animation)&&(n=n.split(" "),h.each(n,function(n,e){e===c.inward?i=c.inward:e===c.outward&&(i=c.outward)})),i||!1},duration:function(n){return"string"==typeof(n=!1===(n=n||l.duration)?u.css("animation-duration")||0:n)?-1<n.indexOf("ms")?parseFloat(n):1e3*parseFloat(n):n},displayType:function(n){return l.displayType||((n=void 0===n||n)&&void 0===u.data(t.displayType)&&(""===(n=u.css("display"))||"none"===n?f.can.transition(!0):f.save.displayType(n)),u.data(t.displayType))},userStyle:function(n){return(n=n||u.attr("style")||"").replace(/display.*?;/,"")},transitionExists:function(n){return h.fn.transition.exists[n]}},can:{transition:function(n){var e,i,t,a,o=l.animation,r=f.get.transitionExists(o),s=f.get.displayType(!1);if(void 0===r||n){if(f.verbose("Determining whether animation exists"),n=u.attr("class"),e=u.prop("tagName"),i=(e=h("<"+e+" />").addClass(n).insertAfter(u)).addClass(o).removeClass(c.inward).removeClass(c.outward).addClass(c.animating).addClass(c.transition).css("animationName"),e.detach().insertAfter(u),t=e.addClass(c.inward).css("animationName"),s||(e.detach().insertAfter(u),s=e.attr("class",n).removeAttr("style").removeClass(c.hidden).removeClass(c.visible).show().css("display"),f.verbose("Determining final display state",s),f.save.displayType(s)),e.remove(),i!==t)f.debug("Direction exists for animation",o),a=!0;else{if("none"===i||!i)return void f.debug("No animation defined in css",o);f.debug("Static animation found",o,s),a=!1}f.save.transitionExists(o,a)}return void 0!==r?r:a},animate:function(){return void 0!==f.can.transition()}},is:{animating:function(){return u.hasClass(c.animating)},inward:function(){return u.hasClass(c.inward)},outward:function(){return u.hasClass(c.outward)},looping:function(){return u.hasClass(c.looping)},occurring:function(n){return n="."+(n=n||l.animation).replace(" ","."),0<u.filter(n).length},visible:function(){return u.is(":visible")},hidden:function(){return"hidden"===u.css("visibility")},supported:function(){return!0}},hide:function(){if(!1===l.onHide.call(m))return f.verbose("Hide callback returned false cancelling hide"),!1;f.verbose("Hiding element"),f.is.animating()&&f.reset(),m.blur(),f.remove.display(),f.remove.visible(),l.onBeforeHide.call(m,f.hideNow)},hideNow:function(){f.set.hidden(),f.force.hidden(),l.onHidden.call(m),l.onComplete.call(m)},show:function(n){f.force.visible()&&!1!==l.onShow.call(m)&&(f.verbose("Showing element",n),f.remove.hidden(),l.onBeforeShow.call(m,f.showNow))},showNow:function(){f.set.visible(),l.onVisible.call(m),l.onComplete.call(m)},toggle:function(){f.is.visible()?f.hide():f.show()},stop:function(){f.debug("Stopping current animation"),u.triggerHandler("animationend")},stopAll:function(){f.debug("Stopping all animation"),f.remove.queueCallback(),u.triggerHandler("animationend")},clear:{queue:function(){f.debug("Clearing animation queue"),f.remove.queueCallback()}},enable:function(){f.verbose("Starting animation"),u.removeClass(c.disabled)},disable:function(){f.debug("Stopping animation"),u.addClass(c.disabled)},setting:function(n,e){if(f.debug("Changing setting",n,e),h.isPlainObject(n))h.extend(!0,l,n);else{if(void 0===e)return l[n];h.isPlainObject(l[n])?h.extend(!0,l[n],e):l[n]=e}},internal:function(n,e){if(h.isPlainObject(n))h.extend(!0,f,n);else{if(void 0===e)return f[n];f[n]=e}},debug:function(){!l.silent&&l.debug&&(l.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,l.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!l.silent&&l.verbose&&l.debug&&(l.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),f.verbose.apply(console,arguments)))},error:function(){l.silent||(f.error=Function.prototype.bind.call(console.error,console,l.name+":"),f.error.apply(console,arguments))},performance:{log:function(n){var e,i;l.performance&&(i=(e=Date.now())-(r||e),r=e,s.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:m,"Execution Time":i})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var n=l.name+":",i=0;r=!1,clearTimeout(f.performance.timer),h.each(s,function(n,e){i+=e["Execution Time"]}),n+=" "+i+"ms",1<o.length&&(n+=" ("+o.length+")"),0<s.length&&(console.groupCollapsed(n),console.table?console.table(s):h.each(s,function(n,e){console.log(e.Name+": "+e["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(t,n,e){var a,o,i,r,s=d;return n=n||b,e=e||m,"string"==typeof t&&void 0!==s&&(t=t.split(/[ .]/),a=t.length-1,h.each(t,function(n,e){var i=n!==a?e+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(h.isPlainObject(s[i])&&n!==a)s=s[i];else{if(void 0!==s[i])return o=s[i],!1;{if(!h.isPlainObject(s[e])||n===a)return void 0!==s[e]&&(o=s[e]),!1;s=s[e]}}})),"function"==typeof(r=o)&&"number"!=typeof r.nodeType?i=o.apply(e,n):void 0!==o&&(i=o),Array.isArray(p)?p.push(i):void 0!==p?p=[p,i]:void 0!==i&&(p=i),void 0!==o&&o}};f.initialize()}),void 0!==p?p:this},h.fn.transition.exists={},h.fn.transition.settings={name:"Transition",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"transition",interval:0,reverse:"auto",onStart:function(){},onComplete:function(){},onShow:function(){},onBeforeShow:function(n){n.call(this)},onVisible:function(){},onHide:function(){},onHidden:function(){},onBeforeHide:function(n){n.call(this)},useFailSafe:!0,failSafeDelay:100,allowRepeats:!1,displayType:!1,animation:"fade",duration:!1,queue:!0,skipInlineHidden:!1,metadata:{displayType:"display"},className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",loading:"loading",looping:"looping",outward:"out",transition:"transition",visible:"visible"},error:{noAnimation:"Element is no longer attached to DOM. Unable to animate. Use silent setting to suppress this warning in production."}}}(jQuery,window,document);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.3-beta.
|
2
|
+
* # Fomantic-UI 2.9.3-beta.2+824a375 - Visibility
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -22,7 +22,6 @@
|
|
22
22
|
$.fn.visibility = function (parameters) {
|
23
23
|
var
|
24
24
|
$allModules = $(this),
|
25
|
-
moduleSelector = $allModules.selector || '',
|
26
25
|
|
27
26
|
time = Date.now(),
|
28
27
|
performance = [],
|
@@ -30,6 +29,19 @@
|
|
30
29
|
query = arguments[0],
|
31
30
|
methodInvoked = typeof query === 'string',
|
32
31
|
queryArguments = [].slice.call(arguments, 1),
|
32
|
+
contextCheck = function (context, win) {
|
33
|
+
var $context;
|
34
|
+
if ([window, document].indexOf(context) >= 0) {
|
35
|
+
$context = $(context);
|
36
|
+
} else {
|
37
|
+
$context = $(win.document).find(context);
|
38
|
+
if ($context.length === 0) {
|
39
|
+
$context = win.frameElement ? contextCheck(context, win.parent) : window;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
return $context;
|
44
|
+
},
|
33
45
|
returnedValue,
|
34
46
|
|
35
47
|
moduleCount = $allModules.length,
|
@@ -53,7 +65,7 @@
|
|
53
65
|
$window = $(window),
|
54
66
|
|
55
67
|
$module = $(this),
|
56
|
-
$context =
|
68
|
+
$context = contextCheck(settings.context, window),
|
57
69
|
|
58
70
|
$placeholder,
|
59
71
|
|
@@ -1089,9 +1101,6 @@
|
|
1089
1101
|
totalTime += data['Execution Time'];
|
1090
1102
|
});
|
1091
1103
|
title += ' ' + totalTime + 'ms';
|
1092
|
-
if (moduleSelector) {
|
1093
|
-
title += ' \'' + moduleSelector + '\'';
|
1094
|
-
}
|
1095
1104
|
if (performance.length > 0) {
|
1096
1105
|
console.groupCollapsed(title);
|
1097
1106
|
if (console.table) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.3-beta.
|
2
|
+
* # Fomantic UI - 2.9.3-beta.2+824a375
|
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,O,A){"use strict";function z(e){return"function"==typeof e&&"number"!=typeof e.nodeType}O=void 0!==O&&O.Math===Math?O:globalThis,T.fn.visibility=function(p){var h,e=T(this),x=e.selector||"",P=Date.now(),y=[],C=p,S="string"==typeof C,V=[].slice.call(arguments,1),R=e.length,k=0;return e.each(function(){var e,o,n,i=T.isPlainObject(p)?T.extend(!0,{},T.fn.visibility.settings,p):T.extend({},T.fn.visibility.settings),t=i.className,s=i.namespace,r=i.error,c=i.metadata,a="."+s,l="module-"+s,d=T(O),u=T(this),f=[O,A].indexOf(i.context)<0?T(A).find(i.context):T(i.context),v=u.data(l),b=this,g=!1,m={initialize:function(){m.debug("Initializing",i),m.setup.cache(),m.should.trackChanges()&&("image"===i.type&&m.setup.image(),"fixed"===i.type&&m.setup.fixed(),i.observeChanges&&m.observeChanges(),m.bind.events()),m.save.position(),m.is.visible()||m.error(r.visible,u),i.initialCheck&&m.checkVisibility(),m.instantiate()},instantiate:function(){m.debug("Storing instance",m),u.data(l,m),v=m},destroy:function(){m.verbose("Destroying previous module"),n&&n.disconnect(),o&&o.disconnect(),d.off("load"+a,m.event.load).off("resize"+a,m.event.resize),f.off("scroll"+a,m.event.scroll).off("scrollchange"+a,m.event.scrollchange),"fixed"===i.type&&(m.resetFixed(),m.remove.placeholder()),u.off(a).removeData(l)},observeChanges:function(){"MutationObserver"in O&&(o=new MutationObserver(m.event.contextChanged),n=new MutationObserver(m.event.changed),o.observe(A,{childList:!0,subtree:!0}),n.observe(b,{childList:!0,subtree:!0}),m.debug("Setting up mutation observer",n))},bind:{events:function(){m.verbose("Binding visibility events to scroll and resize"),i.refreshOnLoad&&d.on("load"+a,m.event.load),d.on("resize"+a,m.event.resize),f.off("scroll"+a).on("scroll"+a,m.event.scroll).on("scrollchange"+a,m.event.scrollchange)}},event:{changed:function(e){m.verbose("DOM tree modified, updating visibility calculations"),m.timer=setTimeout(function(){m.verbose("DOM tree modified, updating sticky menu"),m.refresh()},100)},contextChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e===b||0<T(e).find(b).length)&&(m.debug("Element removed from DOM, tearing down events"),m.destroy())})})},resize:function(){m.debug("Window resized"),i.refreshOnResize&&requestAnimationFrame(m.refresh)},load:function(){m.debug("Page finished loading"),requestAnimationFrame(m.refresh)},scroll:function(){i.throttle?(clearTimeout(m.timer),m.timer=setTimeout(function(){f.triggerHandler("scrollchange"+a,[f.scrollTop()])},i.throttle)):requestAnimationFrame(function(){f.triggerHandler("scrollchange"+a,[f.scrollTop()])})},scrollchange:function(e,o){m.checkVisibility(o)}},precache:function(e,o){for(var n=(e=Array.isArray(e)?e:[e]).length,t=0,i=[],s=A.createElement("img"),c=function(){++t>=e.length&&z(o)&&o()};n--;)(s=A.createElement("img")).addEventListener("load",c),s.addEventListener("error",c),s.src=e[n],i.push(s)},enableCallbacks:function(){m.debug("Allowing callbacks to occur"),g=!1},disableCallbacks:function(){m.debug("Disabling all callbacks temporarily"),g=!0},should:{trackChanges:function(){return S?(m.debug("One time query, no need to bind events"),!1):(m.debug("Callbacks being attached"),!0)}},setup:{cache:function(){m.cache={occurred:{},screen:{},element:{}}},image:function(){var e=u.data(c.src);e&&(m.verbose("Lazy loading image",e),i.once=!0,i.observeChanges=!1,i.onOnScreen=function(){m.debug("Image on screen",b),m.precache(e,function(){m.set.image(e,function(){++k===R&&i.onAllLoaded.call(this),i.onLoad.call(this)})})})},fixed:function(){m.debug("Setting up fixed"),i.once=!1,i.observeChanges=!1,i.initialCheck=!0,i.refreshOnLoad=!0,p.transition||(i.transition=!1),m.create.placeholder(),m.debug("Added placeholder",e),i.onTopPassed=function(){m.debug("Element passed, adding fixed position",u),m.show.placeholder(),m.set.fixed(),i.transition&&void 0!==T.fn.transition&&u.transition(i.transition,i.duration)},i.onTopPassedReverse=function(){m.debug("Element returned to position, removing fixed",u),m.hide.placeholder(),m.remove.fixed()}}},create:{placeholder:function(){m.verbose("Creating fixed position placeholder"),e=u.clone(!1).css("display","none").addClass(t.placeholder).insertAfter(u)}},show:{placeholder:function(){m.verbose("Showing placeholder"),e.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){m.verbose("Hiding placeholder"),e.css("display","none").css("visibility","")}},set:{fixed:function(){m.verbose("Setting element to fixed position"),u.addClass(t.fixed).css({position:"fixed",top:i.offset+"px",left:"auto",zIndex:i.zIndex}),i.onFixed.call(b)},image:function(e,o){u.attr("src",e),i.transition?void 0!==T.fn.transition?u.hasClass(t.visible)?m.debug("Transition already occurred on this image, skipping animation"):u.transition(i.transition,i.duration,o):u.fadeIn(i.duration,o):u.show()}},is:{onScreen:function(){return m.get.elementCalculations().onScreen},offScreen:function(){return m.get.elementCalculations().offScreen},visible:function(){return!(!m.cache||!m.cache.element)&&!(0===m.cache.element.width&&0===m.cache.element.offset.top)},verticallyScrollableContext:function(){var e=f[0]!==O&&f.css("overflow-y");return"auto"===e||"scroll"===e},horizontallyScrollableContext:function(){var e=f[0]!==O&&f.css("overflow-x");return"auto"===e||"scroll"===e}},refresh:function(){m.debug("Refreshing constants (width/height)"),"fixed"===i.type&&m.resetFixed(),m.reset(),m.save.position(),i.checkOnRefresh&&m.checkVisibility(),i.onRefresh.call(b)},resetFixed:function(){m.remove.fixed(),m.remove.occurred()},reset:function(){m.verbose("Resetting all cached values"),T.isPlainObject(m.cache)&&(m.cache.screen={},m.cache.element={})},checkVisibility:function(e){m.verbose("Checking visibility of element",m.cache.element),!g&&m.is.visible()&&(m.save.scroll(e),m.save.calculations(),m.passed(),m.passingReverse(),m.topVisibleReverse(),m.bottomVisibleReverse(),m.topPassedReverse(),m.bottomPassedReverse(),m.onScreen(),m.offScreen(),m.passing(),m.topVisible(),m.bottomVisible(),m.topPassed(),m.bottomPassed(),i.onUpdate&&i.onUpdate.call(b,m.get.elementCalculations()))},passed:function(e,o){var n=m.get.elementCalculations();if(e&&o)i.onPassed[e]=o;else{if(void 0!==e)return m.get.pixelsPassed(e)>n.pixelsPassed;n.passing&&T.each(i.onPassed,function(e,o){n.bottomVisible||n.pixelsPassed>m.get.pixelsPassed(e)?m.execute(o,e):i.once||m.remove.occurred(o)})}},onScreen:function(e){var o=m.get.elementCalculations(),n=e||i.onOnScreen,t="onScreen";if(e&&(m.debug("Adding callback for onScreen",e),i.onOnScreen=e),o.onScreen?m.execute(n,t):i.once||m.remove.occurred(t),void 0!==e)return o.onOnScreen},offScreen:function(e){var o=m.get.elementCalculations(),n=e||i.onOffScreen,t="offScreen";if(e&&(m.debug("Adding callback for offScreen",e),i.onOffScreen=e),o.offScreen?m.execute(n,t):i.once||m.remove.occurred(t),void 0!==e)return o.onOffScreen},passing:function(e){var o=m.get.elementCalculations(),n=e||i.onPassing,t="passing";if(e&&(m.debug("Adding callback for passing",e),i.onPassing=e),o.passing?m.execute(n,t):i.once||m.remove.occurred(t),void 0!==e)return o.passing},topVisible:function(e){var o=m.get.elementCalculations(),n=e||i.onTopVisible,t="topVisible";if(e&&(m.debug("Adding callback for top visible",e),i.onTopVisible=e),o.topVisible?m.execute(n,t):i.once||m.remove.occurred(t),void 0===e)return o.topVisible},bottomVisible:function(e){var o=m.get.elementCalculations(),n=e||i.onBottomVisible,t="bottomVisible";if(e&&(m.debug("Adding callback for bottom visible",e),i.onBottomVisible=e),o.bottomVisible?m.execute(n,t):i.once||m.remove.occurred(t),void 0===e)return o.bottomVisible},topPassed:function(e){var o=m.get.elementCalculations(),n=e||i.onTopPassed,t="topPassed";if(e&&(m.debug("Adding callback for top passed",e),i.onTopPassed=e),o.topPassed?m.execute(n,t):i.once||m.remove.occurred(t),void 0===e)return o.topPassed},bottomPassed:function(e){var o=m.get.elementCalculations(),n=e||i.onBottomPassed,t="bottomPassed";if(e&&(m.debug("Adding callback for bottom passed",e),i.onBottomPassed=e),o.bottomPassed?m.execute(n,t):i.once||m.remove.occurred(t),void 0===e)return o.bottomPassed},passingReverse:function(e){var o=m.get.elementCalculations(),n=e||i.onPassingReverse,t="passingReverse";if(e&&(m.debug("Adding callback for passing reverse",e),i.onPassingReverse=e),o.passing?i.once||m.remove.occurred(t):m.get.occurred("passing")&&m.execute(n,t),void 0!==e)return!o.passing},topVisibleReverse:function(e){var o=m.get.elementCalculations(),n=e||i.onTopVisibleReverse,t="topVisibleReverse";if(e&&(m.debug("Adding callback for top visible reverse",e),i.onTopVisibleReverse=e),o.topVisible?i.once||m.remove.occurred(t):m.get.occurred("topVisible")&&m.execute(n,t),void 0===e)return!o.topVisible},bottomVisibleReverse:function(e){var o=m.get.elementCalculations(),n=e||i.onBottomVisibleReverse,t="bottomVisibleReverse";if(e&&(m.debug("Adding callback for bottom visible reverse",e),i.onBottomVisibleReverse=e),o.bottomVisible?i.once||m.remove.occurred(t):m.get.occurred("bottomVisible")&&m.execute(n,t),void 0===e)return!o.bottomVisible},topPassedReverse:function(e){var o=m.get.elementCalculations(),n=e||i.onTopPassedReverse,t="topPassedReverse";if(e&&(m.debug("Adding callback for top passed reverse",e),i.onTopPassedReverse=e),o.topPassed?i.once||m.remove.occurred(t):m.get.occurred("topPassed")&&m.execute(n,t),void 0===e)return!o.onTopPassed},bottomPassedReverse:function(e){var o=m.get.elementCalculations(),n=e||i.onBottomPassedReverse,t="bottomPassedReverse";if(e&&(m.debug("Adding callback for bottom passed reverse",e),i.onBottomPassedReverse=e),o.bottomPassed?i.once||m.remove.occurred(t):m.get.occurred("bottomPassed")&&m.execute(n,t),void 0===e)return!o.bottomPassed},execute:function(e,o){var n=m.get.elementCalculations(),t=m.get.screenCalculations();(e=e||!1)&&(i.continuous?(m.debug("Callback being called continuously",o,n),e.call(b,n,t)):m.get.occurred(o)||(m.debug("Conditions met",o,n),e.call(b,n,t))),m.save.occurred(o)},remove:{fixed:function(){m.debug("Removing fixed position"),u.removeClass(t.fixed).css({position:"",top:"",left:"",zIndex:""}),i.onUnfixed.call(b)},placeholder:function(){m.debug("Removing placeholder content"),e&&e.remove()},occurred:function(e){var o;e?void 0!==(o=m.cache.occurred)[e]&&!0===o[e]&&(m.debug("Callback can now be called again",e),m.cache.occurred[e]=!1):m.cache.occurred={}}},save:{calculations:function(){m.verbose("Saving all calculations necessary to determine positioning"),m.save.direction(),m.save.screenCalculations(),m.save.elementCalculations()},occurred:function(e){!e||void 0!==m.cache.occurred[e]&&!0===m.cache.occurred[e]||(m.verbose("Saving callback occurred",e),m.cache.occurred[e]=!0)},scroll:function(e){e=e+i.offset||f.scrollTop()+i.offset,m.cache.scroll=e},direction:function(){var e=m.get.scroll(),o=m.get.lastScroll(),e=o<e&&o?"down":e<o&&o?"up":"static";return m.cache.direction=e,m.cache.direction},elementPosition:function(){var e=m.cache.element,o=m.get.screenSize();return m.verbose("Saving element position"),e.fits=e.height<o.height,e.offset=u.offset(),e.width=u.outerWidth(),e.height=u.outerHeight(),m.is.verticallyScrollableContext()&&(e.offset.top+=f.scrollTop()-f.offset().top),m.is.horizontallyScrollableContext()&&(e.offset.left+=f.scrollLeft()-f.offset().left),m.cache.element=e},elementCalculations:function(){var e=m.get.screenCalculations(),o=m.get.elementPosition();return i.includeMargin?(o.margin={},o.margin.top=parseInt(u.css("margin-top"),10),o.margin.bottom=parseInt(u.css("margin-bottom"),10),o.top=o.offset.top-o.margin.top,o.bottom=o.offset.top+o.height+o.margin.bottom):(o.top=o.offset.top,o.bottom=o.offset.top+o.height),o.topPassed=e.top>=o.top,o.bottomPassed=e.top>=o.bottom,o.topVisible=e.bottom>=o.top&&!o.topPassed,o.bottomVisible=e.bottom>=o.bottom&&!o.bottomPassed,o.pixelsPassed=0,o.percentagePassed=0,o.onScreen=(o.topVisible||o.passing)&&!o.bottomPassed,o.passing=o.topPassed&&!o.bottomPassed,o.offScreen=!o.onScreen,o.passing&&(o.pixelsPassed=e.top-o.top,o.percentagePassed=(e.top-o.top)/o.height),m.cache.element=o,m.verbose("Updated element calculations",o),o},screenCalculations:function(){var e=m.get.scroll();return m.save.direction(),m.cache.screen.top=e,m.cache.screen.bottom=e+m.cache.screen.height,m.cache.screen},screenSize:function(){m.verbose("Saving window position"),m.cache.screen={height:f.height()}},position:function(){m.save.screenSize(),m.save.elementPosition()}},get:{pixelsPassed:function(e){var o=m.get.elementCalculations();return-1<e.search("%")?o.height*(parseInt(e,10)/100):parseInt(e,10)},occurred:function(e){return void 0!==m.cache.occurred&&m.cache.occurred[e]||!1},direction:function(){return void 0===m.cache.direction&&m.save.direction(),m.cache.direction},elementPosition:function(){return void 0===m.cache.element&&m.save.elementPosition(),m.cache.element},elementCalculations:function(){return void 0===m.cache.element&&m.save.elementCalculations(),m.cache.element},screenCalculations:function(){return void 0===m.cache.screen&&m.save.screenCalculations(),m.cache.screen},screenSize:function(){return void 0===m.cache.screen&&m.save.screenSize(),m.cache.screen},scroll:function(){return void 0===m.cache.scroll&&m.save.scroll(),m.cache.scroll},lastScroll:function(){return void 0===m.cache.screen?(m.debug("First scroll event, no last scroll could be found"),!1):m.cache.screen.top}},setting:function(e,o){if(T.isPlainObject(e))T.extend(!0,i,e);else{if(void 0===o)return i[e];i[e]=o}},internal:function(e,o){if(T.isPlainObject(e))T.extend(!0,m,e);else{if(void 0===o)return m[e];m[e]=o}},debug:function(){!i.silent&&i.debug&&(i.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,i.name+":"),m.debug.apply(console,arguments)))},verbose:function(){!i.silent&&i.verbose&&i.debug&&(i.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,i.name+":"),m.verbose.apply(console,arguments)))},error:function(){i.silent||(m.error=Function.prototype.bind.call(console.error,console,i.name+":"),m.error.apply(console,arguments))},performance:{log:function(e){var o,n;i.performance&&(n=(o=Date.now())-(P||o),P=o,y.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:b,"Execution Time":n})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var e=i.name+":",n=0;P=!1,clearTimeout(m.performance.timer),T.each(y,function(e,o){n+=o["Execution Time"]}),e+=" "+n+"ms",x&&(e+=" '"+x+"'"),0<y.length&&(console.groupCollapsed(e),console.table?console.table(y):T.each(y,function(e,o){console.log(o.Name+": "+o["Execution Time"]+"ms")}),console.groupEnd()),y=[]}},invoke:function(t,e,o){var i,s,n,c=v;return e=e||V,o=o||b,"string"==typeof t&&void 0!==c&&(t=t.split(/[ .]/),i=t.length-1,T.each(t,function(e,o){var n=e!==i?o+t[e+1].charAt(0).toUpperCase()+t[e+1].slice(1):t;if(T.isPlainObject(c[n])&&e!==i)c=c[n];else{if(void 0!==c[n])return s=c[n],!1;{if(!T.isPlainObject(c[o])||e===i)return void 0!==c[o]?s=c[o]:m.error(r.method,t),!1;c=c[o]}}})),z(s)?n=s.apply(o,e):void 0!==s&&(n=s),Array.isArray(h)?h.push(n):void 0!==h?h=[h,n]:void 0!==n&&(h=n),s}};S?(void 0===v&&m.initialize(),v.save.scroll(),v.save.calculations(),m.invoke(C)):(void 0!==v&&v.invoke("destroy"),m.initialize())}),void 0!==h?h:this},T.fn.visibility.settings={name:"Visibility",namespace:"visibility",debug:!1,verbose:!1,performance:!0,observeChanges:!0,initialCheck:!0,refreshOnLoad:!0,refreshOnResize:!0,checkOnRefresh:!0,once:!0,continuous:!1,offset:0,includeMargin:!1,context:O,throttle:!1,type:!1,zIndex:"10",transition:"fade in",duration:1e3,onPassed:{},onOnScreen:!1,onOffScreen:!1,onPassing:!1,onTopVisible:!1,onBottomVisible:!1,onTopPassed:!1,onBottomPassed:!1,onPassingReverse:!1,onTopVisibleReverse:!1,onBottomVisibleReverse:!1,onTopPassedReverse:!1,onBottomPassedReverse:!1,onLoad:function(){},onAllLoaded:function(){},onFixed:function(){},onUnfixed:function(){},onUpdate:!1,onRefresh:function(){},metadata:{src:"src"},className:{fixed:"fixed",placeholder:"constraint",visible:"visible"},error:{method:"The method you called is not defined.",visible:"Element is hidden, you must call refresh after element becomes visible"}}}(jQuery,window,document);
|
11
|
+
!function(T,O,A){"use strict";function z(e){return"function"==typeof e&&"number"!=typeof e.nodeType}O=void 0!==O&&O.Math===Math?O:globalThis,T.fn.visibility=function(p){var h,e=T(this),P=Date.now(),x=[],y=p,C="string"==typeof y,S=[].slice.call(arguments,1),V=function(e,o){var n;return 0<=[O,A].indexOf(e)?n=T(e):0===(n=T(o.document).find(e)).length&&(n=o.frameElement?V(e,o.parent):O),n},R=e.length,k=0;return e.each(function(){var e,o,n,i=T.isPlainObject(p)?T.extend(!0,{},T.fn.visibility.settings,p):T.extend({},T.fn.visibility.settings),t=i.className,s=i.namespace,r=i.error,c=i.metadata,a="."+s,l="module-"+s,d=T(O),u=T(this),f=V(i.context,O),v=u.data(l),b=this,g=!1,m={initialize:function(){m.debug("Initializing",i),m.setup.cache(),m.should.trackChanges()&&("image"===i.type&&m.setup.image(),"fixed"===i.type&&m.setup.fixed(),i.observeChanges&&m.observeChanges(),m.bind.events()),m.save.position(),m.is.visible()||m.error(r.visible,u),i.initialCheck&&m.checkVisibility(),m.instantiate()},instantiate:function(){m.debug("Storing instance",m),u.data(l,m),v=m},destroy:function(){m.verbose("Destroying previous module"),n&&n.disconnect(),o&&o.disconnect(),d.off("load"+a,m.event.load).off("resize"+a,m.event.resize),f.off("scroll"+a,m.event.scroll).off("scrollchange"+a,m.event.scrollchange),"fixed"===i.type&&(m.resetFixed(),m.remove.placeholder()),u.off(a).removeData(l)},observeChanges:function(){"MutationObserver"in O&&(o=new MutationObserver(m.event.contextChanged),n=new MutationObserver(m.event.changed),o.observe(A,{childList:!0,subtree:!0}),n.observe(b,{childList:!0,subtree:!0}),m.debug("Setting up mutation observer",n))},bind:{events:function(){m.verbose("Binding visibility events to scroll and resize"),i.refreshOnLoad&&d.on("load"+a,m.event.load),d.on("resize"+a,m.event.resize),f.off("scroll"+a).on("scroll"+a,m.event.scroll).on("scrollchange"+a,m.event.scrollchange)}},event:{changed:function(e){m.verbose("DOM tree modified, updating visibility calculations"),m.timer=setTimeout(function(){m.verbose("DOM tree modified, updating sticky menu"),m.refresh()},100)},contextChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e===b||0<T(e).find(b).length)&&(m.debug("Element removed from DOM, tearing down events"),m.destroy())})})},resize:function(){m.debug("Window resized"),i.refreshOnResize&&requestAnimationFrame(m.refresh)},load:function(){m.debug("Page finished loading"),requestAnimationFrame(m.refresh)},scroll:function(){i.throttle?(clearTimeout(m.timer),m.timer=setTimeout(function(){f.triggerHandler("scrollchange"+a,[f.scrollTop()])},i.throttle)):requestAnimationFrame(function(){f.triggerHandler("scrollchange"+a,[f.scrollTop()])})},scrollchange:function(e,o){m.checkVisibility(o)}},precache:function(e,o){for(var n=(e=Array.isArray(e)?e:[e]).length,t=0,i=[],s=A.createElement("img"),c=function(){++t>=e.length&&z(o)&&o()};n--;)(s=A.createElement("img")).addEventListener("load",c),s.addEventListener("error",c),s.src=e[n],i.push(s)},enableCallbacks:function(){m.debug("Allowing callbacks to occur"),g=!1},disableCallbacks:function(){m.debug("Disabling all callbacks temporarily"),g=!0},should:{trackChanges:function(){return C?(m.debug("One time query, no need to bind events"),!1):(m.debug("Callbacks being attached"),!0)}},setup:{cache:function(){m.cache={occurred:{},screen:{},element:{}}},image:function(){var e=u.data(c.src);e&&(m.verbose("Lazy loading image",e),i.once=!0,i.observeChanges=!1,i.onOnScreen=function(){m.debug("Image on screen",b),m.precache(e,function(){m.set.image(e,function(){++k===R&&i.onAllLoaded.call(this),i.onLoad.call(this)})})})},fixed:function(){m.debug("Setting up fixed"),i.once=!1,i.observeChanges=!1,i.initialCheck=!0,i.refreshOnLoad=!0,p.transition||(i.transition=!1),m.create.placeholder(),m.debug("Added placeholder",e),i.onTopPassed=function(){m.debug("Element passed, adding fixed position",u),m.show.placeholder(),m.set.fixed(),i.transition&&void 0!==T.fn.transition&&u.transition(i.transition,i.duration)},i.onTopPassedReverse=function(){m.debug("Element returned to position, removing fixed",u),m.hide.placeholder(),m.remove.fixed()}}},create:{placeholder:function(){m.verbose("Creating fixed position placeholder"),e=u.clone(!1).css("display","none").addClass(t.placeholder).insertAfter(u)}},show:{placeholder:function(){m.verbose("Showing placeholder"),e.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){m.verbose("Hiding placeholder"),e.css("display","none").css("visibility","")}},set:{fixed:function(){m.verbose("Setting element to fixed position"),u.addClass(t.fixed).css({position:"fixed",top:i.offset+"px",left:"auto",zIndex:i.zIndex}),i.onFixed.call(b)},image:function(e,o){u.attr("src",e),i.transition?void 0!==T.fn.transition?u.hasClass(t.visible)?m.debug("Transition already occurred on this image, skipping animation"):u.transition(i.transition,i.duration,o):u.fadeIn(i.duration,o):u.show()}},is:{onScreen:function(){return m.get.elementCalculations().onScreen},offScreen:function(){return m.get.elementCalculations().offScreen},visible:function(){return!(!m.cache||!m.cache.element)&&!(0===m.cache.element.width&&0===m.cache.element.offset.top)},verticallyScrollableContext:function(){var e=f[0]!==O&&f.css("overflow-y");return"auto"===e||"scroll"===e},horizontallyScrollableContext:function(){var e=f[0]!==O&&f.css("overflow-x");return"auto"===e||"scroll"===e}},refresh:function(){m.debug("Refreshing constants (width/height)"),"fixed"===i.type&&m.resetFixed(),m.reset(),m.save.position(),i.checkOnRefresh&&m.checkVisibility(),i.onRefresh.call(b)},resetFixed:function(){m.remove.fixed(),m.remove.occurred()},reset:function(){m.verbose("Resetting all cached values"),T.isPlainObject(m.cache)&&(m.cache.screen={},m.cache.element={})},checkVisibility:function(e){m.verbose("Checking visibility of element",m.cache.element),!g&&m.is.visible()&&(m.save.scroll(e),m.save.calculations(),m.passed(),m.passingReverse(),m.topVisibleReverse(),m.bottomVisibleReverse(),m.topPassedReverse(),m.bottomPassedReverse(),m.onScreen(),m.offScreen(),m.passing(),m.topVisible(),m.bottomVisible(),m.topPassed(),m.bottomPassed(),i.onUpdate&&i.onUpdate.call(b,m.get.elementCalculations()))},passed:function(e,o){var n=m.get.elementCalculations();if(e&&o)i.onPassed[e]=o;else{if(void 0!==e)return m.get.pixelsPassed(e)>n.pixelsPassed;n.passing&&T.each(i.onPassed,function(e,o){n.bottomVisible||n.pixelsPassed>m.get.pixelsPassed(e)?m.execute(o,e):i.once||m.remove.occurred(o)})}},onScreen:function(e){var o=m.get.elementCalculations(),n=e||i.onOnScreen,t="onScreen";if(e&&(m.debug("Adding callback for onScreen",e),i.onOnScreen=e),o.onScreen?m.execute(n,t):i.once||m.remove.occurred(t),void 0!==e)return o.onOnScreen},offScreen:function(e){var o=m.get.elementCalculations(),n=e||i.onOffScreen,t="offScreen";if(e&&(m.debug("Adding callback for offScreen",e),i.onOffScreen=e),o.offScreen?m.execute(n,t):i.once||m.remove.occurred(t),void 0!==e)return o.onOffScreen},passing:function(e){var o=m.get.elementCalculations(),n=e||i.onPassing,t="passing";if(e&&(m.debug("Adding callback for passing",e),i.onPassing=e),o.passing?m.execute(n,t):i.once||m.remove.occurred(t),void 0!==e)return o.passing},topVisible:function(e){var o=m.get.elementCalculations(),n=e||i.onTopVisible,t="topVisible";if(e&&(m.debug("Adding callback for top visible",e),i.onTopVisible=e),o.topVisible?m.execute(n,t):i.once||m.remove.occurred(t),void 0===e)return o.topVisible},bottomVisible:function(e){var o=m.get.elementCalculations(),n=e||i.onBottomVisible,t="bottomVisible";if(e&&(m.debug("Adding callback for bottom visible",e),i.onBottomVisible=e),o.bottomVisible?m.execute(n,t):i.once||m.remove.occurred(t),void 0===e)return o.bottomVisible},topPassed:function(e){var o=m.get.elementCalculations(),n=e||i.onTopPassed,t="topPassed";if(e&&(m.debug("Adding callback for top passed",e),i.onTopPassed=e),o.topPassed?m.execute(n,t):i.once||m.remove.occurred(t),void 0===e)return o.topPassed},bottomPassed:function(e){var o=m.get.elementCalculations(),n=e||i.onBottomPassed,t="bottomPassed";if(e&&(m.debug("Adding callback for bottom passed",e),i.onBottomPassed=e),o.bottomPassed?m.execute(n,t):i.once||m.remove.occurred(t),void 0===e)return o.bottomPassed},passingReverse:function(e){var o=m.get.elementCalculations(),n=e||i.onPassingReverse,t="passingReverse";if(e&&(m.debug("Adding callback for passing reverse",e),i.onPassingReverse=e),o.passing?i.once||m.remove.occurred(t):m.get.occurred("passing")&&m.execute(n,t),void 0!==e)return!o.passing},topVisibleReverse:function(e){var o=m.get.elementCalculations(),n=e||i.onTopVisibleReverse,t="topVisibleReverse";if(e&&(m.debug("Adding callback for top visible reverse",e),i.onTopVisibleReverse=e),o.topVisible?i.once||m.remove.occurred(t):m.get.occurred("topVisible")&&m.execute(n,t),void 0===e)return!o.topVisible},bottomVisibleReverse:function(e){var o=m.get.elementCalculations(),n=e||i.onBottomVisibleReverse,t="bottomVisibleReverse";if(e&&(m.debug("Adding callback for bottom visible reverse",e),i.onBottomVisibleReverse=e),o.bottomVisible?i.once||m.remove.occurred(t):m.get.occurred("bottomVisible")&&m.execute(n,t),void 0===e)return!o.bottomVisible},topPassedReverse:function(e){var o=m.get.elementCalculations(),n=e||i.onTopPassedReverse,t="topPassedReverse";if(e&&(m.debug("Adding callback for top passed reverse",e),i.onTopPassedReverse=e),o.topPassed?i.once||m.remove.occurred(t):m.get.occurred("topPassed")&&m.execute(n,t),void 0===e)return!o.onTopPassed},bottomPassedReverse:function(e){var o=m.get.elementCalculations(),n=e||i.onBottomPassedReverse,t="bottomPassedReverse";if(e&&(m.debug("Adding callback for bottom passed reverse",e),i.onBottomPassedReverse=e),o.bottomPassed?i.once||m.remove.occurred(t):m.get.occurred("bottomPassed")&&m.execute(n,t),void 0===e)return!o.bottomPassed},execute:function(e,o){var n=m.get.elementCalculations(),t=m.get.screenCalculations();(e=e||!1)&&(i.continuous?(m.debug("Callback being called continuously",o,n),e.call(b,n,t)):m.get.occurred(o)||(m.debug("Conditions met",o,n),e.call(b,n,t))),m.save.occurred(o)},remove:{fixed:function(){m.debug("Removing fixed position"),u.removeClass(t.fixed).css({position:"",top:"",left:"",zIndex:""}),i.onUnfixed.call(b)},placeholder:function(){m.debug("Removing placeholder content"),e&&e.remove()},occurred:function(e){var o;e?void 0!==(o=m.cache.occurred)[e]&&!0===o[e]&&(m.debug("Callback can now be called again",e),m.cache.occurred[e]=!1):m.cache.occurred={}}},save:{calculations:function(){m.verbose("Saving all calculations necessary to determine positioning"),m.save.direction(),m.save.screenCalculations(),m.save.elementCalculations()},occurred:function(e){!e||void 0!==m.cache.occurred[e]&&!0===m.cache.occurred[e]||(m.verbose("Saving callback occurred",e),m.cache.occurred[e]=!0)},scroll:function(e){e=e+i.offset||f.scrollTop()+i.offset,m.cache.scroll=e},direction:function(){var e=m.get.scroll(),o=m.get.lastScroll(),e=o<e&&o?"down":e<o&&o?"up":"static";return m.cache.direction=e,m.cache.direction},elementPosition:function(){var e=m.cache.element,o=m.get.screenSize();return m.verbose("Saving element position"),e.fits=e.height<o.height,e.offset=u.offset(),e.width=u.outerWidth(),e.height=u.outerHeight(),m.is.verticallyScrollableContext()&&(e.offset.top+=f.scrollTop()-f.offset().top),m.is.horizontallyScrollableContext()&&(e.offset.left+=f.scrollLeft()-f.offset().left),m.cache.element=e},elementCalculations:function(){var e=m.get.screenCalculations(),o=m.get.elementPosition();return i.includeMargin?(o.margin={},o.margin.top=parseInt(u.css("margin-top"),10),o.margin.bottom=parseInt(u.css("margin-bottom"),10),o.top=o.offset.top-o.margin.top,o.bottom=o.offset.top+o.height+o.margin.bottom):(o.top=o.offset.top,o.bottom=o.offset.top+o.height),o.topPassed=e.top>=o.top,o.bottomPassed=e.top>=o.bottom,o.topVisible=e.bottom>=o.top&&!o.topPassed,o.bottomVisible=e.bottom>=o.bottom&&!o.bottomPassed,o.pixelsPassed=0,o.percentagePassed=0,o.onScreen=(o.topVisible||o.passing)&&!o.bottomPassed,o.passing=o.topPassed&&!o.bottomPassed,o.offScreen=!o.onScreen,o.passing&&(o.pixelsPassed=e.top-o.top,o.percentagePassed=(e.top-o.top)/o.height),m.cache.element=o,m.verbose("Updated element calculations",o),o},screenCalculations:function(){var e=m.get.scroll();return m.save.direction(),m.cache.screen.top=e,m.cache.screen.bottom=e+m.cache.screen.height,m.cache.screen},screenSize:function(){m.verbose("Saving window position"),m.cache.screen={height:f.height()}},position:function(){m.save.screenSize(),m.save.elementPosition()}},get:{pixelsPassed:function(e){var o=m.get.elementCalculations();return-1<e.search("%")?o.height*(parseInt(e,10)/100):parseInt(e,10)},occurred:function(e){return void 0!==m.cache.occurred&&m.cache.occurred[e]||!1},direction:function(){return void 0===m.cache.direction&&m.save.direction(),m.cache.direction},elementPosition:function(){return void 0===m.cache.element&&m.save.elementPosition(),m.cache.element},elementCalculations:function(){return void 0===m.cache.element&&m.save.elementCalculations(),m.cache.element},screenCalculations:function(){return void 0===m.cache.screen&&m.save.screenCalculations(),m.cache.screen},screenSize:function(){return void 0===m.cache.screen&&m.save.screenSize(),m.cache.screen},scroll:function(){return void 0===m.cache.scroll&&m.save.scroll(),m.cache.scroll},lastScroll:function(){return void 0===m.cache.screen?(m.debug("First scroll event, no last scroll could be found"),!1):m.cache.screen.top}},setting:function(e,o){if(T.isPlainObject(e))T.extend(!0,i,e);else{if(void 0===o)return i[e];i[e]=o}},internal:function(e,o){if(T.isPlainObject(e))T.extend(!0,m,e);else{if(void 0===o)return m[e];m[e]=o}},debug:function(){!i.silent&&i.debug&&(i.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,i.name+":"),m.debug.apply(console,arguments)))},verbose:function(){!i.silent&&i.verbose&&i.debug&&(i.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,i.name+":"),m.verbose.apply(console,arguments)))},error:function(){i.silent||(m.error=Function.prototype.bind.call(console.error,console,i.name+":"),m.error.apply(console,arguments))},performance:{log:function(e){var o,n;i.performance&&(n=(o=Date.now())-(P||o),P=o,x.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:b,"Execution Time":n})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var e=i.name+":",n=0;P=!1,clearTimeout(m.performance.timer),T.each(x,function(e,o){n+=o["Execution Time"]}),e+=" "+n+"ms",0<x.length&&(console.groupCollapsed(e),console.table?console.table(x):T.each(x,function(e,o){console.log(o.Name+": "+o["Execution Time"]+"ms")}),console.groupEnd()),x=[]}},invoke:function(t,e,o){var i,s,n,c=v;return e=e||S,o=o||b,"string"==typeof t&&void 0!==c&&(t=t.split(/[ .]/),i=t.length-1,T.each(t,function(e,o){var n=e!==i?o+t[e+1].charAt(0).toUpperCase()+t[e+1].slice(1):t;if(T.isPlainObject(c[n])&&e!==i)c=c[n];else{if(void 0!==c[n])return s=c[n],!1;{if(!T.isPlainObject(c[o])||e===i)return void 0!==c[o]?s=c[o]:m.error(r.method,t),!1;c=c[o]}}})),z(s)?n=s.apply(o,e):void 0!==s&&(n=s),Array.isArray(h)?h.push(n):void 0!==h?h=[h,n]:void 0!==n&&(h=n),s}};C?(void 0===v&&m.initialize(),v.save.scroll(),v.save.calculations(),m.invoke(y)):(void 0!==v&&v.invoke("destroy"),m.initialize())}),void 0!==h?h:this},T.fn.visibility.settings={name:"Visibility",namespace:"visibility",debug:!1,verbose:!1,performance:!0,observeChanges:!0,initialCheck:!0,refreshOnLoad:!0,refreshOnResize:!0,checkOnRefresh:!0,once:!0,continuous:!1,offset:0,includeMargin:!1,context:O,throttle:!1,type:!1,zIndex:"10",transition:"fade in",duration:1e3,onPassed:{},onOnScreen:!1,onOffScreen:!1,onPassing:!1,onTopVisible:!1,onBottomVisible:!1,onTopPassed:!1,onBottomPassed:!1,onPassingReverse:!1,onTopVisibleReverse:!1,onBottomVisibleReverse:!1,onTopPassedReverse:!1,onBottomPassedReverse:!1,onLoad:function(){},onAllLoaded:function(){},onFixed:function(){},onUnfixed:function(){},onUpdate:!1,onRefresh:function(){},metadata:{src:"src"},className:{fixed:"fixed",placeholder:"constraint",visible:"visible"},error:{method:"The method you called is not defined.",visible:"Element is hidden, you must call refresh after element becomes visible"}}}(jQuery,window,document);
|