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.
 
 
 

1 lines
5.4 KiB

!function(a,b,c,d){a.fn.transition=function(){var e,f=a(this),g=f.selector||"",h=(new Date).getTime(),i=[],j=arguments,k=j[0],l=[].slice.call(arguments,1),m="string"==typeof k;return b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)},f.each(function(){var b,f,n,o,p,q,r,s,t,u=a(this),v=this;t={initialize:function(){b=t.get.settings.apply(v,j),t.verbose("Converted arguments into settings object",b),n=b.error,o=b.className,r=b.namespace,p=b.metadata,s="module-"+r,q=t.get.transitionEvent(),f=u.data(s),f===d&&t.instantiate(),m&&(e=t.invoke(k)),m&&e!==!1||t.animate()},instantiate:function(){t.verbose("Storing instance of module",t),f=t,u.data(s,f)},destroy:function(){t.verbose("Destroying previous module for",v),u.removeData(s)},repaint:function(a){t.verbose("Forcing repaint event"),a=v.offsetWidth},set:{animating:function(){u.addClass(o.animating)},loop:function(){u.addClass(o.loop)},duration:function(a){a=a||b.duration,t.verbose("Setting animation duration",a),u.css({"-webkit-animation-duration":a,"-moz-animation-duration":a,"-ms-animation-duration":a,"-o-animation-duration":a,"animation-duration":a})}},remove:{animating:function(){u.removeClass(o.animating)}},get:{settings:function(b,c,e){return a.isPlainObject(b)===d?a.extend(!0,{},a.fn.transition.settings,b):"function"==typeof e?a.extend(!0,{},a.fn.transition.settings,{animation:b,complete:e,duration:c}):"string"==typeof c?a.extend(!0,{},a.fn.transition.settings,{animation:b,duration:c}):"object"==typeof c?a.extend(!0,{},a.fn.transition.settings,c,{animation:b}):"function"==typeof c?a.extend(!0,{},a.fn.transition.settings,{animation:b,complete:c}):a.extend(!0,{},a.fn.transition.settings,{animation:b})},transitionEvent:function(){var a,b=c.createElement("element"),e={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(a in e)if(b.style[a]!==d)return t.verbose("Determining animation end event",e[a]),e[a];return!1}},can:{animate:function(c){var d=a("<div />");return c=c||b.animation,d.addClass(o.transition).addClass(c),"none"!==d.css("animationName")}},is:{animating:function(){return u.hasClass(o.animating)}},hide:function(){t.verbose("Hiding element"),u.addClass(o.transition).addClass(o.hidden)},show:function(){t.verbose("Showing element"),u.removeClass(o.hidden)},start:function(){t.verbose("Starting animation"),u.removeClass(o.disabled)},stop:function(){t.debug("Stopping animation"),u.addClass(o.disabled)},toggle:function(){t.debug("Toggling play status"),u.toggleClass(o.disabled)},animate:function(a){return b=a||b,t.can.animate()?t.is.animating()?(t.queue(b.animation),!1):(t.set.duration(),t.show(),t.originalClass=u.attr("class"),t.originalStyle=u.attr("style"),t.repaint(),t.set.animating(),u.addClass(o.transition).addClass(b.animation).one(q,t.complete),t.debug("Beginning animation",b.animation,u.attr("class")),void 0):(t.error(n.noAnimation,b.animation),!1)},queue:function(a){t.debug("Queueing animation of",a),u.one(q,function(){t.animate.apply(this,b)})},reset:function(){t.verbose("Resetting original class",t.originalClass),u.attr("style",t.originalStyle).attr("class",t.originalClass)},complete:function(){t.verbose("CSS animation complete",b.animation),u.hasClass(o.outward)?(t.reset(),t.hide()):u.hasClass(o.inward)?(t.reset(),t.show()):t.reset(),t.remove.animating(),t.repaint(),b.complete()},setting:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},internal:function(b,c){return c===d?t[b]:(a.isPlainObject(b)?a.extend(!0,t,b):t[b]=c,void 0)},debug:function(){b.debug&&(b.performance?t.performance.log(arguments):t.debug=Function.prototype.bind.call(console.info,console,b.moduleName+":"))},verbose:function(){b.verbose&&b.debug&&(b.performance?t.performance.log(arguments):t.verbose=Function.prototype.bind.call(console.info,console,b.moduleName+":"))},error:function(){t.error=Function.prototype.bind.call(console.error,console,b.moduleName+":")},performance:{log:function(a){var c,d,e;b.performance&&(c=(new Date).getTime(),e=h||c,d=c-e,h=c,i.push({Element:v,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(t.performance.timer),t.performance.timer=setTimeout(t.performance.display,100)},display:function(){var c=b.moduleName+":",e=0;h=!1,clearTimeout(t.performance.timer),a.each(i,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",g&&(c+=" '"+g+"'"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(c),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,c,e){var g,h,i=f;return c=c||l,e=v||e,"string"==typeof b&&i!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(b,c){return a.isPlainObject(i[c])&&b!=g?(i=i[c],!0):i[c]!==d?(h=i[c],!0):(t.error(n.method),!1)})),a.isFunction(h)?(f.verbose("Executing invoked function",h),h.apply(e,c)):h||!1}},t.initialize()}),e?e:this},a.fn.transition.settings={moduleName:"Transition",debug:!0,verbose:!0,performance:!0,namespace:"transition",complete:function(){},animation:"fade",duration:"1s",className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",looping:"looping",outward:"out",transition:"ui transition"},error:{noAnimation:"There is no css animation matching the one you specified.",method:"The method you called is not defined"}}}(jQuery,window,document);