/*! * # Semantic UI 2.0.0 - Transition * http://github.com/semantic-org/semantic-ui/ * * * Copyright 2015 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=[],c=arguments,u=c[0],d=[].slice.call(arguments,1),m="string"==typeof u;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=n(this),T=this;w={initialize:function(){f=w.get.settings.apply(T,c),v=f.className,g=f.error,b=f.metadata,C="."+f.namespace,h="module-"+f.namespace,p=A.data(h)||w,y=w.get.animationEndEvent(),m&&(m=w.invoke(u)),m===!1&&(w.verbose("Converted arguments into settings object",f),f.interval?w.delay(f.animate):w.animate(),w.instantiate())},instantiate:function(){w.verbose("Storing instance of module",w),p=w,A.data(h,p)},destroy:function(){w.verbose("Destroying previous module for",T),A.removeData(h)},refresh:function(){w.verbose("Refreshing display type on next animation"),delete w.displayType},forceRepaint:function(){w.verbose("Forcing element repaint");var n=A.parent(),e=A.next();0===e.length?A.detach().appendTo(n):A.detach().insertBefore(e)},repaint:function(){w.verbose("Repainting element");T.offsetWidth},delay:function(n){var i,a=f.reverse===!0,s="auto"==f.reverse&&w.get.direction()==v.outward;n=typeof n!==t?n:f.interval,i=a||s?(o.length-e)*f.interval:e*f.interval,w.debug("Delaying animation by",i),setTimeout(w.animate,i)},animate:function(n){if(f=n||f,!w.is.supported())return w.error(g.support),!1;if(w.debug("Preparing animation",f.animation),w.is.animating()){if(f.queue)return!f.allowRepeats&&w.has.direction()&&w.is.occurring()&&w.queuing!==!0?w.debug("Animation is currently occurring, preventing queueing same animation",f.animation):w.queue(f.animation),!1;if(!f.allowRepeats&&w.is.occurring())return w.debug("Animation is already occurring, will not execute repeated animation",f.animation),!1;w.debug("New animation started, completing previous early",f.animation),w.complete()}w.can.animate()?w.set.animating(f.animation):w.error(g.noAnimation,f.animation,T)},reset:function(){w.debug("Resetting animation to beginning conditions"),w.remove.animationCallbacks(),w.restore.conditions(),w.remove.animating()},queue:function(n){w.debug("Queueing animation of",n),w.queuing=!0,A.one(y+".queue"+C,function(){w.queuing=!1,w.repaint(),w.animate.apply(this,f)})},complete:function(){w.debug("Animation complete",f.animation),w.remove.completeCallback(),w.remove.failSafe(),w.is.looping()||(w.is.outward()?(w.verbose("Animation is outward, hiding element"),w.restore.conditions(),w.hide(),f.onHide.call(this)):w.is.inward()?(w.verbose("Animation is outward, showing element"),w.restore.conditions(),w.show(),f.onShow.call(this)):w.restore.conditions(),w.remove.animation(),w.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=A.attr("style")||"";return n.isArray(e.match(/display.*?;/,""))}},set:{animating:function(n){n=n||f.animation,w.is.animating()||w.save.conditions(),w.remove.direction(),w.remove.completeCallback(),w.can.transition()&&!w.has.direction()&&w.set.direction(),w.remove.hidden(),w.set.display(),A.addClass(v.animating+" "+v.transition+" "+n).one(y+".complete"+C,w.complete),f.useFailSafe&&w.add.failSafe(),w.set.duration(f.duration),f.onStart.call(this),w.debug("Starting tween",n,A.attr("class"))},duration:function(n,e){e=e||f.duration,e="number"==typeof e?e+"ms":e,(e||0===e)&&(w.verbose("Setting animation duration",e),A.css({"animation-duration":e}))},display:function(){var n=w.get.style(),e=w.get.displayType(),i=n+"display: "+e+" !important;";A.css("display",""),w.refresh(),A.css("display")!==e&&(w.verbose("Setting inline visibility to",e),A.attr("style",i))},direction:function(){A.is(":visible")&&!w.is.hidden()?(w.debug("Automatically determining the direction of animation","Outward"),A.removeClass(v.inward).addClass(v.outward)):(w.debug("Automatically determining the direction of animation","Inward"),A.removeClass(v.outward).addClass(v.inward))},looping:function(){w.debug("Transition set to loop"),A.addClass(v.looping)},hidden:function(){w.is.hidden()||A.addClass(v.transition).addClass(v.hidden),"none"!==A.css("display")&&(w.verbose("Overriding default display to hide element"),A.css("display","none"))},visible:function(){A.addClass(v.transition).addClass(v.visible)}},save:{displayType:function(n){"none"!==n&&A.data(b.displayType,n)},transitionExists:function(e,i){n.fn.transition.exists[e]=i,w.verbose("Saving existence of transition",e,i)},conditions:function(){A.removeClass(f.animation),w.remove.direction(),w.cache={className:A.attr("class"),style:w.get.style()},w.verbose("Saving original attributes",w.cache)}},restore:{conditions:function(){return w.cache===t?!1:(w.cache.className?A.attr("class",w.cache.className):A.removeAttr("class"),w.cache.style?(w.verbose("Restoring original style attribute",w.cache.style),A.attr("style",w.cache.style)):(w.verbose("Clearing style attribute"),A.removeAttr("style")),void w.verbose("Restoring original attributes",w.cache))}},add:{failSafe:function(){var n=w.get.duration();w.timer=setTimeout(function(){A.trigger(y)},n+f.failSafeDelay),w.verbose("Adding fail safe timer",w.timer)}},remove:{animating:function(){A.removeClass(v.animating)},animation:function(){A.css({"-webkit-animation":"","-moz-animation":"","-ms-animation":"","-o-animation":"",animation:""})},animationCallbacks:function(){w.remove.queueCallback(),w.remove.completeCallback()},queueCallback:function(){A.off(".queue"+C)},completeCallback:function(){A.off(".complete"+C)},display:function(){A.css("display","")},direction:function(){A.removeClass(v.inward).removeClass(v.outward)},failSafe:function(){w.verbose("Removing fail safe timer",w.timer),w.timer&&clearTimeout(w.timer)},hidden:function(){A.removeClass(v.hidden)},visible:function(){A.removeClass(v.visible)},looping:function(){w.debug("Transitions are no longer looping"),w.is.looping()&&(w.reset(),A.removeClass(v.looping))},transition:function(){A.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})),w.can.transition()?A.is(":visible")&&!w.is.hidden()?v.outward:v.inward:"static"},duration:function(n){return n=n||f.duration,n===!1&&(n=A.css("animation-duration")||0),"string"==typeof n?n.indexOf("ms")>-1?parseFloat(n):1e3*parseFloat(n):n},displayType:function(){return f.displayType?f.displayType:(A.data(b.displayType)===t&&w.can.transition(!0),A.data(b.displayType))},style:function(){var n=A.attr("style")||"";return n.replace(/display.*?;/,"")},transitionExists:function(e){return n.fn.transition.exists[e]},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,c,u=f.animation,d=w.get.transitionExists(u);if(d===t||e){if(w.verbose("Determining whether animation exists"),i=A.attr("class"),a=A.prop("tagName"),o=n("<"+a+" />").addClass(i).insertAfter(A),s=o.addClass(u).removeClass(v.inward).removeClass(v.outward).addClass(v.animating).addClass(v.transition).css("animationName"),r=o.addClass(v.inward).css("animationName"),c=o.attr("class",i).removeAttr("style").removeClass(v.hidden).removeClass(v.visible).show().css("display"),w.verbose("Determining final display state",c),w.save.displayType(c),o.remove(),s!=r)w.debug("Direction exists for animation",u),l=!0;else{if("none"==s||!s)return void w.debug("No animation defined in css",u);w.debug("Static animation found",u,c),l=!1}w.save.transitionExists(u,l)}return d!==t?d:l},animate:function(){return w.can.transition()!==t}},is:{animating:function(){return A.hasClass(v.animating)},inward:function(){return A.hasClass(v.inward)},outward:function(){return A.hasClass(v.outward)},looping:function(){return A.hasClass(v.looping)},occurring:function(n){return n=n||f.animation,n="."+n.replace(" ","."),A.filter(n).length>0},visible:function(){return A.is(":visible")},hidden:function(){return"hidden"===A.css("visibility")},supported:function(){return y!==!1}},hide:function(){w.verbose("Hiding element"),w.is.animating()&&w.reset(),w.remove.display(),w.remove.visible(),w.set.hidden(),w.repaint()},show:function(n){w.verbose("Showing element",n),w.remove.hidden(),w.set.visible(),w.set.display(),w.repaint()},toggle:function(){w.is.visible()?w.hide():w.show()},stop:function(){w.debug("Stopping current animation"),A.trigger(y)},stopAll:function(){w.debug("Stopping all animation"),w.remove.queueCallback(),A.trigger(y)},clear:{queue:function(){w.debug("Clearing animation queue"),w.remove.queueCallback()}},enable:function(){w.verbose("Starting animation"),A.removeClass(v.disabled)},disable:function(){w.debug("Stopping animation"),A.addClass(v.disabled)},setting:function(e,i){if(w.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,w,e);else{if(i===t)return w[e];w[e]=i}},debug:function(){f.debug&&(f.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,f.name+":"),w.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),w.verbose.apply(console,arguments)))},error:function(){w.error=Function.prototype.bind.call(console.error,console,f.name+":"),w.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:T,"Execution Time":i})),clearTimeout(w.performance.timer),w.performance.timer=setTimeout(w.performance.display,500)},display:function(){var e=f.name+":",i=0;r=!1,clearTimeout(w.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,c=p;return i=i||d,o=T||o,"string"==typeof e&&c!==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(c[o])&&i!=s)c=c[o];else{if(c[o]!==t)return r=c[o],!1;if(!n.isPlainObject(c[a])||i==s)return c[a]!==t?(r=c[a],!1):!1;c=c[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}},w.initialize()}),a!==t?a:this},n.fn.transition.exists={},n.fn.transition.settings={name:"Transition",debug:!1,verbose:!1,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);