You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
12 KiB
11 lines
12 KiB
/*
|
|
* # Semantic UI - 1.9.2
|
|
* https://github.com/Semantic-Org/Semantic-UI
|
|
* http://www.semantic-ui.com/
|
|
*
|
|
* Copyright 2014 Contributors
|
|
* Released under the MIT license
|
|
* http://opensource.org/licenses/MIT
|
|
*
|
|
*/
|
|
!function(n,i,e,t){"use strict";n.fn.transition=function(){{var a,o=n(this),s=o.selector||"",r=(new Date).getTime(),l=[],m=arguments,d=m[0],c=[].slice.call(arguments,1),u="string"==typeof d;i.requestAnimationFrame||i.mozRequestAnimationFrame||i.webkitRequestAnimationFrame||i.msRequestAnimationFrame||function(n){setTimeout(n,0)}}return o.each(function(){var i,f,p,g,v,b,y,h,C,w,A,T=n(this),S=this;A={initialize:function(){i=A.get.settings.apply(S,m),g=i.className,p=i.error,v=i.metadata,w="."+i.namespace,C="module-"+i.namespace,f=T.data(C)||A,y=A.get.animationEndEvent(),h=A.get.animationName(),b=A.get.animationStartEvent(),u&&(u=A.invoke(d)),u===!1&&(A.verbose("Converted arguments into settings object",i),A.animate(),A.instantiate())},instantiate:function(){A.verbose("Storing instance of module",A),f=A,T.data(C,f)},destroy:function(){A.verbose("Destroying previous module for",S),T.removeData(C)},refresh:function(){A.verbose("Refreshing display type on next animation"),delete A.displayType},forceRepaint:function(){A.verbose("Forcing element repaint");var n=T.parent(),i=T.next();0===i.length?T.detach().appendTo(n):T.detach().insertBefore(i)},repaint:function(){A.verbose("Repainting element");S.offsetWidth},animate:function(n){if(i=n||i,!A.is.supported())return A.error(p.support),!1;if(A.debug("Preparing animation",i.animation),A.is.animating()){if(i.queue)return!i.allowRepeats&&A.has.direction()&&A.is.occurring()&&A.queuing!==!0?A.debug("Animation is currently occurring, preventing queueing same animation",i.animation):A.queue(i.animation),!1;if(!i.allowRepeats&&A.is.occurring())return A.debug("Animation is already occurring, will not execute repeated animation",i.animation),!1}A.can.animate()?A.set.animating(i.animation):A.error(p.noAnimation,i.animation,S)},reset:function(){A.debug("Resetting animation to beginning conditions"),A.remove.animationEndCallback(),A.restore.conditions(),A.remove.animating()},queue:function(n){A.debug("Queueing animation of",n),A.queuing=!0,T.one(y+w,function(){A.queuing=!1,A.repaint(),A.animate.apply(this,i)})},complete:function(){A.verbose("CSS animation complete",i.animation),A.remove.animationEndCallback(),A.remove.failSafe(),A.is.looping()||(A.is.outward()?(A.verbose("Animation is outward, hiding element"),A.restore.conditions(),A.hide(),i.onHide.call(this)):A.is.inward()?(A.verbose("Animation is outward, showing element"),A.restore.conditions(),A.show(),A.set.display(),i.onShow.call(this)):A.restore.conditions(),A.remove.animation(),A.remove.animating()),i.onComplete.call(this)},has:{direction:function(e){var t=!1;return e=e||i.animation,"string"==typeof e&&(e=e.split(" "),n.each(e,function(n,i){(i===g.inward||i===g.outward)&&(t=!0)})),t},inlineDisplay:function(){var i=T.attr("style")||"";return n.isArray(i.match(/display.*?;/,""))}},set:{animating:function(n){n=n||i.animation,A.is.animating()||A.save.conditions(),A.remove.direction(),A.remove.animationEndCallback(),A.can.transition()&&!A.has.direction()&&A.set.direction(),A.remove.hidden(),A.set.display(),T.addClass(g.animating+" "+g.transition+" "+n).addClass(n).one(y+".complete"+w,A.complete),i.useFailSafe&&A.add.failSafe(),A.set.duration(i.duration),i.onStart.call(this),A.debug("Starting tween",n,T.attr("class"))},duration:function(n,e){e=e||i.duration,e="number"==typeof e?e+"ms":e,A.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=A.get.style(),i=A.get.displayType(),e=n+"display: "+i+" !important;";T.css("display",""),A.refresh(),T.css("display")!==i&&(A.verbose("Setting inline visibility to",i),T.attr("style",e))},direction:function(){T.is(":visible")&&!A.is.hidden()?(A.debug("Automatically determining the direction of animation","Outward"),T.removeClass(g.inward).addClass(g.outward)):(A.debug("Automatically determining the direction of animation","Inward"),T.removeClass(g.outward).addClass(g.inward))},looping:function(){A.debug("Transition set to loop"),T.addClass(g.looping)},hidden:function(){A.is.hidden()||(T.addClass(g.transition).addClass(g.hidden),"none"!==T.css("display")&&(A.verbose("Overriding default display to hide element"),T.css("display","none")))},visible:function(){T.addClass(g.transition).addClass(g.visible)}},save:{displayType:function(n){T.data(v.displayType,n)},transitionExists:function(i,e){n.fn.transition.exists[i]=e,A.verbose("Saving existence of transition",i,e)},conditions:function(){T.attr("class")||!1,T.attr("style")||"";T.removeClass(i.animation),A.remove.direction(),A.cache={className:T.attr("class"),style:A.get.style()},A.verbose("Saving original attributes",A.cache)}},restore:{conditions:function(){return A.cache===t?!1:(A.cache.className?T.attr("class",A.cache.className):T.removeAttr("class"),A.cache.style&&(A.verbose("Restoring original style attribute",A.cache.style),T.attr("style",A.cache.style)),A.is.looping()&&A.remove.looping(),void A.verbose("Restoring original attributes",A.cache))}},add:{failSafe:function(){var n=A.get.duration();A.timer=setTimeout(A.complete,n+100),A.verbose("Adding fail safe timer",A.timer)}},remove:{animating:function(){T.removeClass(g.animating)},animation:function(){T.css({"-webkit-animation":"","-moz-animation":"","-ms-animation":"","-o-animation":"",animation:""})},animationEndCallback:function(){T.off(".complete")},display:function(){T.css("display","")},direction:function(){T.removeClass(g.inward).removeClass(g.outward)},failSafe:function(){A.verbose("Removing fail safe timer",A.timer),A.timer&&clearTimeout(A.timer)},hidden:function(){T.removeClass(g.hidden)},visible:function(){T.removeClass(g.visible)},looping:function(){A.debug("Transitions are no longer looping"),T.removeClass(g.looping),A.forceRepaint()},transition:function(){T.removeClass(g.visible).removeClass(g.hidden)}},get:{settings:function(i,e,t){return"object"==typeof i?n.extend(!0,{},n.fn.transition.settings,i):"function"==typeof t?n.extend({},n.fn.transition.settings,{animation:i,onComplete:t,duration:e}):"string"==typeof e||"number"==typeof e?n.extend({},n.fn.transition.settings,{animation:i,duration:e}):"object"==typeof e?n.extend({},n.fn.transition.settings,e,{animation:i}):"function"==typeof e?n.extend({},n.fn.transition.settings,{animation:i,onComplete:e}):n.extend({},n.fn.transition.settings,{animation:i})},duration:function(n){return n=n||i.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 i.displayType?i.displayType:(T.data(v.displayType)===t&&A.can.transition(!0),T.data(v.displayType))},style:function(){var n=T.attr("style")||"";return n.replace(/display.*?;/,"")},transitionExists:function(i){return n.fn.transition.exists[i]},animationName:function(){var n,i=e.createElement("div"),a={animation:"animationName",OAnimation:"oAnimationName",MozAnimation:"mozAnimationName",WebkitAnimation:"webkitAnimationName"};for(n in a)if(i.style[n]!==t)return a[n];return!1},animationStartEvent:function(){var n,i=e.createElement("div"),a={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"mozAnimationStart",WebkitAnimation:"webkitAnimationStart"};for(n in a)if(i.style[n]!==t)return a[n];return!1},animationEndEvent:function(){var n,i=e.createElement("div"),a={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(n in a)if(i.style[n]!==t)return a[n];return!1}},can:{transition:function(e){var a,o,s,r,l,m=T.attr("class"),d=T.prop("tagName"),c=i.animation,u=A.get.transitionExists(c);if(u===t||e){if(A.verbose("Determining whether animation exists"),a=n("<"+d+" />").addClass(m).insertAfter(T),o=a.addClass(c).removeClass(g.inward).removeClass(g.outward).addClass(g.animating).addClass(g.transition).css(h),s=a.addClass(g.inward).css(h),l=a.attr("class",m).removeAttr("style").removeClass(g.hidden).removeClass(g.visible).show().css("display"),A.verbose("Determining final display state",l),a.remove(),o!=s)A.debug("Direction exists for animation",c),r=!0;else{if("none"==o||!o)return void A.debug("No animation defined in css",c);A.debug("Static animation found",c,l),r=!1}A.save.displayType(l),A.save.transitionExists(c,r)}return u!==t?u:r},animate:function(){return A.can.transition()!==t}},is:{animating:function(){return T.hasClass(g.animating)},inward:function(){return T.hasClass(g.inward)},outward:function(){return T.hasClass(g.outward)},looping:function(){return T.hasClass(g.looping)},occurring:function(n){return n=n||i.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 h!==!1&&y!==!1}},hide:function(){A.verbose("Hiding element"),A.is.animating()&&A.reset(),A.remove.display(),A.remove.visible(),A.set.hidden(),A.repaint()},show:function(n){A.verbose("Showing element",n),A.remove.hidden(),A.set.visible(),A.repaint()},start:function(){A.verbose("Starting animation"),T.removeClass(g.disabled)},stop:function(){A.debug("Stopping animation"),T.addClass(g.disabled)},toggle:function(){A.debug("Toggling play status"),T.toggleClass(g.disabled)},setting:function(e,a){if(A.debug("Changing setting",e,a),n.isPlainObject(e))n.extend(!0,i,e);else{if(a===t)return i[e];i[e]=a}},internal:function(i,e){if(n.isPlainObject(i))n.extend(!0,A,i);else{if(e===t)return A[i];A[i]=e}},debug:function(){i.debug&&(i.performance?A.performance.log(arguments):(A.debug=Function.prototype.bind.call(console.info,console,i.name+":"),A.debug.apply(console,arguments)))},verbose:function(){i.verbose&&i.debug&&(i.performance?A.performance.log(arguments):(A.verbose=Function.prototype.bind.call(console.info,console,i.name+":"),A.verbose.apply(console,arguments)))},error:function(){A.error=Function.prototype.bind.call(console.error,console,i.name+":"),A.error.apply(console,arguments)},performance:{log:function(n){var e,t,a;i.performance&&(e=(new Date).getTime(),a=r||e,t=e-a,r=e,l.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:S,"Execution Time":t})),clearTimeout(A.performance.timer),A.performance.timer=setTimeout(A.performance.display,600)},display:function(){var e=i.name+":",a=0;r=!1,clearTimeout(A.performance.timer),n.each(l,function(n,i){a+=i["Execution Time"]}),e+=" "+a+"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,i){console.log(i.Name+": "+i["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(i,e,o){var s,r,l,m=f;return e=e||c,o=S||o,"string"==typeof i&&m!==t&&(i=i.split(/[\. ]/),s=i.length-1,n.each(i,function(e,a){var o=e!=s?a+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(n.isPlainObject(m[o])&&e!=s)m=m[o];else{if(m[o]!==t)return r=m[o],!1;if(!n.isPlainObject(m[a])||e==s)return m[a]!==t?(r=m[a],!1):!1;m=m[a]}})),n.isFunction(r)?l=r.apply(o,e):r!==t&&(l=r),n.isArray(a)?a.push(l):a!==t?a=[a,l]:l!==t&&(a=l),r!==t?r:!1}},A.initialize()}),a!==t?a:this},n.fn.transition.exists={},n.fn.transition.settings={name:"Transition",debug:!1,verbose:!0,performance:!0,namespace:"transition",onStart:function(){},onComplete:function(){},onShow:function(){},onHide:function(){},useFailSafe:!0,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);
|