/*! * # Semantic UI 1.11.0 - Transition * http://github.com/semantic-org/semantic-ui/ * * * Copyright 2014 Contributors * Released under the MIT license * http://opensource.org/licenses/MIT * */ !function(n,e,i,t){"use strict";n.fn.transition=function(){{var a,o=n(this),s=o.selector||"",r=(new Date).getTime(),l=[],u=arguments,c=u[0],m=[].slice.call(arguments,1),d="string"==typeof c;e.requestAnimationFrame||e.mozRequestAnimationFrame||e.webkitRequestAnimationFrame||e.msRequestAnimationFrame||function(n){setTimeout(n,0)}}return o.each(function(e){var f,p,g,v,b,y,h,C,w,A,S,T=n(this),x=this;S={initialize:function(){f=S.get.settings.apply(x,u),v=f.className,g=f.error,b=f.metadata,A="."+f.namespace,w="module-"+f.namespace,p=T.data(w)||S,h=S.get.animationEndEvent(),C=S.get.animationName(),y=S.get.animationStartEvent(),d&&(d=S.invoke(c)),d===!1&&(S.verbose("Converted arguments into settings object",f),f.interval?S.delay(f.animate):S.animate(),S.instantiate())},instantiate:function(){S.verbose("Storing instance of module",S),p=S,T.data(w,p)},destroy:function(){S.verbose("Destroying previous module for",x),T.removeData(w)},refresh:function(){S.verbose("Refreshing display type on next animation"),delete S.displayType},forceRepaint:function(){S.verbose("Forcing element repaint");var n=T.parent(),e=T.next();0===e.length?T.detach().appendTo(n):T.detach().insertBefore(e)},repaint:function(){S.verbose("Repainting element");x.offsetWidth},delay:function(n){var i,a=f.reverse===!0,s="auto"==f.reverse&&S.get.direction()==v.outward;n=typeof n!==t?n:f.interval,i=a||s?(o.length-e)*f.interval:e*f.interval,S.debug("Delaying animation by",i),setTimeout(S.animate,i)},animate:function(n){if(f=n||f,!S.is.supported())return S.error(g.support),!1;if(S.debug("Preparing animation",f.animation),S.is.animating()){if(f.queue)return!f.allowRepeats&&S.has.direction()&&S.is.occurring()&&S.queuing!==!0?S.debug("Animation is currently occurring, preventing queueing same animation",f.animation):S.queue(f.animation),!1;if(!f.allowRepeats&&S.is.occurring())return S.debug("Animation is already occurring, will not execute repeated animation",f.animation),!1}S.can.animate()?S.set.animating(f.animation):S.error(g.noAnimation,f.animation,x)},reset:function(){S.debug("Resetting animation to beginning conditions"),S.remove.animationCallbacks(),S.restore.conditions(),S.remove.animating()},queue:function(n){S.debug("Queueing animation of",n),S.queuing=!0,T.one(h+".queue"+A,function(){S.queuing=!1,S.repaint(),S.animate.apply(this,f)})},complete:function(){S.verbose("CSS animation complete",f.animation),S.remove.completeCallback(),S.remove.failSafe(),S.is.looping()||(S.is.outward()?(S.verbose("Animation is outward, hiding element"),S.restore.conditions(),S.hide(),f.onHide.call(this)):S.is.inward()?(S.verbose("Animation is outward, showing element"),S.restore.conditions(),S.show(),f.onShow.call(this)):S.restore.conditions(),S.remove.animation(),S.remove.animating()),f.onComplete.call(this)},has:{direction:function(e){var i=!1;return e=e||f.animation,"string"==typeof e&&(e=e.split(" "),n.each(e,function(n,e){(e===v.inward||e===v.outward)&&(i=!0)})),i},inlineDisplay:function(){var e=T.attr("style")||"";return n.isArray(e.match(/display.*?;/,""))}},set:{animating:function(n){n=n||f.animation,S.is.animating()||S.save.conditions(),S.remove.direction(),S.remove.completeCallback(),S.can.transition()&&!S.has.direction()&&S.set.direction(),S.remove.hidden(),S.set.display(),T.addClass(v.animating+" "+v.transition+" "+n).addClass(n).one(h+".complete"+A,S.complete),f.useFailSafe&&S.add.failSafe(),S.set.duration(f.duration),f.onStart.call(this),S.debug("Starting tween",n,T.attr("class"))},duration:function(n,e){e=e||f.duration,e="number"==typeof e?e+"ms":e,S.verbose("Setting animation duration",e),(e||0===e)&&T.css({"-webkit-animation-duration":e,"-moz-animation-duration":e,"-ms-animation-duration":e,"-o-animation-duration":e,"animation-duration":e})},display:function(){var n=S.get.style(),e=S.get.displayType(),i=n+"display: "+e+" !important;";T.css("display",""),S.refresh(),T.css("display")!==e&&(S.verbose("Setting inline visibility to",e),T.attr("style",i))},direction:function(){T.is(":visible")&&!S.is.hidden()?(S.debug("Automatically determining the direction of animation","Outward"),T.removeClass(v.inward).addClass(v.outward)):(S.debug("Automatically determining the direction of animation","Inward"),T.removeClass(v.outward).addClass(v.inward))},looping:function(){S.debug("Transition set to loop"),T.addClass(v.looping)},hidden:function(){S.is.hidden()||T.addClass(v.transition).addClass(v.hidden),"none"!==T.css("display")&&(S.verbose("Overriding default display to hide element"),T.css("display","none"))},visible:function(){T.addClass(v.transition).addClass(v.visible)}},save:{displayType:function(n){T.data(b.displayType,n)},transitionExists:function(e,i){n.fn.transition.exists[e]=i,S.verbose("Saving existence of transition",e,i)},conditions:function(){T.attr("class")||!1,T.attr("style")||"";T.removeClass(f.animation),S.remove.direction(),S.cache={className:T.attr("class"),style:S.get.style()},S.verbose("Saving original attributes",S.cache)}},restore:{conditions:function(){return S.cache===t?!1:(S.cache.className?T.attr("class",S.cache.className):T.removeAttr("class"),S.cache.style?(S.verbose("Restoring original style attribute",S.cache.style),T.attr("style",S.cache.style)):(S.verbose("Clearing style attribute"),T.removeAttr("style")),void S.verbose("Restoring original attributes",S.cache))}},add:{failSafe:function(){var n=S.get.duration();S.timer=setTimeout(function(){T.trigger(h)},n+f.failSafeDelay),S.verbose("Adding fail safe timer",S.timer)}},remove:{animating:function(){T.removeClass(v.animating)},animation:function(){T.css({"-webkit-animation":"","-moz-animation":"","-ms-animation":"","-o-animation":"",animation:""})},animationCallbacks:function(){S.remove.queueCallback(),S.remove.completeCallback()},queueCallback:function(){T.off(".queue"+A)},completeCallback:function(){T.off(".complete"+A)},display:function(){T.css("display","")},direction:function(){T.removeClass(v.inward).removeClass(v.outward)},failSafe:function(){S.verbose("Removing fail safe timer",S.timer),S.timer&&clearTimeout(S.timer)},hidden:function(){T.removeClass(v.hidden)},visible:function(){T.removeClass(v.visible)},looping:function(){S.debug("Transitions are no longer looping"),S.is.looping()&&(S.reset(),T.removeClass(v.looping))},transition:function(){T.removeClass(v.visible).removeClass(v.hidden)}},get:{settings:function(e,i,t){return"object"==typeof e?n.extend(!0,{},n.fn.transition.settings,e):"function"==typeof t?n.extend({},n.fn.transition.settings,{animation:e,onComplete:t,duration:i}):"string"==typeof i||"number"==typeof i?n.extend({},n.fn.transition.settings,{animation:e,duration:i}):"object"==typeof i?n.extend({},n.fn.transition.settings,i,{animation:e}):"function"==typeof i?n.extend({},n.fn.transition.settings,{animation:e,onComplete:i}):n.extend({},n.fn.transition.settings,{animation:e})},direction:function(e){return e=e||f.animation,"string"==typeof e&&(e=e.split(" "),n.each(e,function(n,e){return e===v.inward?v.inward:e===v.outward?v.outward:void 0})),S.can.transition()?T.is(":visible")&&!S.is.hidden()?v.outward:v.inward:"static"},duration:function(n){return n=n||f.duration,n===!1&&(n=T.css("animation-duration")||0),"string"==typeof n?n.indexOf("ms")>-1?parseFloat(n):1e3*parseFloat(n):n},displayType:function(){return f.displayType?f.displayType:(T.data(b.displayType)===t&&S.can.transition(!0),T.data(b.displayType))},style:function(){var n=T.attr("style")||"";return n.replace(/display.*?;/,"")},transitionExists:function(e){return n.fn.transition.exists[e]},animationName:function(){var n,e=i.createElement("div"),a={animation:"animationName",OAnimation:"oAnimationName",MozAnimation:"mozAnimationName",WebkitAnimation:"webkitAnimationName"};for(n in a)if(e.style[n]!==t)return a[n];return!1},animationStartEvent:function(){var n,e=i.createElement("div"),a={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"mozAnimationStart",WebkitAnimation:"webkitAnimationStart"};for(n in a)if(e.style[n]!==t)return a[n];return!1},animationEndEvent:function(){var n,e=i.createElement("div"),a={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(n in a)if(e.style[n]!==t)return a[n];return!1}},can:{transition:function(e){var i,a,o,s,r,l=T.attr("class"),u=T.prop("tagName"),c=f.animation,m=S.get.transitionExists(c);if(m===t||e){if(S.verbose("Determining whether animation exists"),i=n("<"+u+" />").addClass(l).insertAfter(T),a=i.addClass(c).removeClass(v.inward).removeClass(v.outward).addClass(v.animating).addClass(v.transition).css(C),o=i.addClass(v.inward).css(C),r=i.attr("class",l).removeAttr("style").removeClass(v.hidden).removeClass(v.visible).show().css("display"),S.verbose("Determining final display state",r),S.save.displayType(r),i.remove(),a!=o)S.debug("Direction exists for animation",c),s=!0;else{if("none"==a||!a)return void S.debug("No animation defined in css",c);S.debug("Static animation found",c,r),s=!1}S.save.transitionExists(c,s)}return m!==t?m:s},animate:function(){return S.can.transition()!==t}},is:{animating:function(){return T.hasClass(v.animating)},inward:function(){return T.hasClass(v.inward)},outward:function(){return T.hasClass(v.outward)},looping:function(){return T.hasClass(v.looping)},occurring:function(n){return n=n||f.animation,n="."+n.replace(" ","."),T.filter(n).length>0},visible:function(){return T.is(":visible")},hidden:function(){return"hidden"===T.css("visibility")},supported:function(){return C!==!1&&h!==!1}},hide:function(){S.verbose("Hiding element"),S.is.animating()&&S.reset(),S.remove.display(),S.remove.visible(),S.set.hidden(),S.repaint()},show:function(n){S.verbose("Showing element",n),S.remove.hidden(),S.set.visible(),S.set.display(),S.repaint()},toggle:function(){S.is.visible()?S.hide():S.show()},stop:function(){S.debug("Stopping current animation"),T.trigger(h)},stopAll:function(){S.debug("Stopping all animation"),S.remove.queueCallback(),T.trigger(h)},clear:{queue:function(){S.debug("Clearing animation queue"),S.remove.queueCallback()}},enable:function(){S.verbose("Starting animation"),T.removeClass(v.disabled)},disable:function(){S.debug("Stopping animation"),T.addClass(v.disabled)},setting:function(e,i){if(S.debug("Changing setting",e,i),n.isPlainObject(e))n.extend(!0,f,e);else{if(i===t)return f[e];f[e]=i}},internal:function(e,i){if(n.isPlainObject(e))n.extend(!0,S,e);else{if(i===t)return S[e];S[e]=i}},debug:function(){f.debug&&(f.performance?S.performance.log(arguments):(S.debug=Function.prototype.bind.call(console.info,console,f.name+":"),S.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?S.performance.log(arguments):(S.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),S.verbose.apply(console,arguments)))},error:function(){S.error=Function.prototype.bind.call(console.error,console,f.name+":"),S.error.apply(console,arguments)},performance:{log:function(n){var e,i,t;f.performance&&(e=(new Date).getTime(),t=r||e,i=e-t,r=e,l.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:x,"Execution Time":i})),clearTimeout(S.performance.timer),S.performance.timer=setTimeout(S.performance.display,600)},display:function(){var e=f.name+":",i=0;r=!1,clearTimeout(S.performance.timer),n.each(l,function(n,e){i+=e["Execution Time"]}),e+=" "+i+"ms",s&&(e+=" '"+s+"'"),o.length>1&&(e+=" ("+o.length+")"),(console.group!==t||console.table!==t)&&l.length>0&&(console.groupCollapsed(e),console.table?console.table(l):n.each(l,function(n,e){console.log(e.Name+": "+e["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(e,i,o){var s,r,l,u=p;return i=i||m,o=x||o,"string"==typeof e&&u!==t&&(e=e.split(/[\. ]/),s=e.length-1,n.each(e,function(i,a){var o=i!=s?a+e[i+1].charAt(0).toUpperCase()+e[i+1].slice(1):e;if(n.isPlainObject(u[o])&&i!=s)u=u[o];else{if(u[o]!==t)return r=u[o],!1;if(!n.isPlainObject(u[a])||i==s)return u[a]!==t?(r=u[a],!1):!1;u=u[a]}})),n.isFunction(r)?l=r.apply(o,i):r!==t&&(l=r),n.isArray(a)?a.push(l):a!==t?a=[a,l]:l!==t&&(a=l),r!==t?r:!1}},S.initialize()}),a!==t?a:this},n.fn.transition.exists={},n.fn.transition.settings={name:"Transition",debug:!1,verbose:!0,performance:!0,namespace:"transition",interval:0,reverse:"auto",onStart:function(){},onComplete:function(){},onShow:function(){},onHide:function(){},useFailSafe:!0,failSafeDelay:100,allowRepeats:!1,displayType:!1,animation:"fade",duration:!1,queue:!0,metadata:{displayType:"display"},className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",loading:"loading",looping:"looping",outward:"out",transition:"transition",visible:"visible"},error:{noAnimation:"There is no css animation matching the one you specified.",repeated:"That animation is already occurring, cancelling repeated animation",method:"The method you called is not defined",support:"This browser does not support CSS animations"}}}(jQuery,window,document);