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
7.2 KiB
1 lines
7.2 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,v=a(this),w=this;u={initialize:function(){b=u.get.settings.apply(w,j),u.verbose("Converted arguments into settings object",b),n=b.error,o=b.className,s=b.namespace,p=b.metadata,t="module-"+s,q=u.get.animationEvent(),r=u.get.animationName(),f=v.data(t),f===d&&u.instantiate(),m&&(e=u.invoke(k)),m&&e!==!1||u.animate()},instantiate:function(){u.verbose("Storing instance of module",u),f=u,v.data(t,f)},destroy:function(){u.verbose("Destroying previous module for",w),v.removeData(t)},animate:function(a){return b=a||b,u.is.animating()?(u.queue(b.animation),!1):(u.save.conditions(),u.set.duration(b.duration),u.set.animating(),u.repaint(),v.addClass(o.transition).addClass(b.animation).one(q,u.complete),!u.has.direction()&&u.can.transition()&&u.set.direction(),u.can.animate()?(u.show(),u.debug("Beginning animation",b.animation,v.attr("class")),void 0):(u.restore.conditions(),u.error(n.noAnimation),!1))},queue:function(a){u.debug("Queueing animation of",a),f.queuing=!0,v.one(q,function(){f.queuing=!1,u.animate.apply(this,b)})},complete:function(){u.verbose("CSS animation complete",b.animation),u.is.looping()||(v.hasClass(o.outward)&&!f.queuing?(u.restore.conditions(),u.hide()):v.hasClass(o.inward)&&!f.queuing?(u.restore.conditions(),u.show()):u.restore.conditions(),u.remove.animating()),b.complete()},repaint:function(a){u.verbose("Forcing repaint event"),a=w.offsetWidth},has:{direction:function(a){return a=a||b.animation,v.hasClass(o.inward)||v.hasClass(o.outward)?!0:void 0}},set:{animating:function(){v.addClass(o.animating)},direction:function(){v.is(":visible")?(u.debug("Automatically determining the direction of animation","Outward"),v.addClass(o.outward).removeClass(o.inward)):(u.debug("Automatically determining the direction of animation","Inward"),v.addClass(o.inward).removeClass(o.outward))},looping:function(){u.debug("Transition set to loop"),v.addClass(o.looping)},duration:function(a){a=a||b.duration,a="number"==typeof a?a+"ms":a,u.verbose("Setting animation duration",a),v.css({"-webkit-animation-duration":a,"-moz-animation-duration":a,"-ms-animation-duration":a,"-o-animation-duration":a,"animation-duration":a})}},save:{conditions:function(){u.cache={className:v.attr("class"),style:v.attr("style")},u.verbose("Saving original attributes",u.cache)}},restore:{conditions:function(){return typeof u.cache===d?(u.error(n.cache),!1):(u.cache.className?v.attr("class",u.cache.className):v.removeAttr("class"),u.cache.style?v.attr("style",u.cache.style):v.removeAttr("style"),u.is.looping()&&u.remove.looping(),u.verbose("Restoring original attributes",u.cache),void 0)}},remove:{animating:function(){v.removeClass(o.animating)},looping:function(){u.debug("Transitions are no longer looping"),v.removeClass(o.looping),u.repaint()}},get:{settings:function(b,c,d){return a.isPlainObject(b)?a.extend(!0,{},a.fn.transition.settings,b):"function"==typeof d?a.extend(!0,{},a.fn.transition.settings,{animation:b,complete:d,duration:c}):"string"==typeof c||"number"==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})},animationName:function(){var a,b=c.createElement("element"),e={animation:"animationName",OAnimation:"oAnimationName",MozAnimation:"mozAnimationName",WebkitAnimation:"webkitAnimationName"};for(a in e)if(b.style[a]!==d)return u.verbose("Determining animation vendor name property",e[a]),e[a];return!1},animationEvent: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 u.verbose("Determining animation vendor end event",e[a]),e[a];return!1}},can:{animate:function(){return"none"!==v.css(r)?(u.debug("CSS definition found"),!0):(u.debug("Unable to find css definition"),!1)},transition:function(){var a=v.css(r),b=v.addClass(o.inward).css(r);return a!=b?(u.debug("In/out transitions exist"),v.removeClass(o.inward),!0):(u.debug("Static animation found"),v.removeClass(o.inward),!1)}},is:{animating:function(){return v.hasClass(o.animating)},looping:function(){return v.hasClass(o.looping)},visible:function(){return v.is(":visible")}},hide:function(){u.verbose("Hiding element"),v.removeClass(o.visible).addClass(o.transition).addClass(o.hidden)},show:function(){u.verbose("Showing element"),v.removeClass(o.hidden).addClass(o.transition).addClass(o.visible)},start:function(){u.verbose("Starting animation"),v.removeClass(o.disabled)},stop:function(){u.debug("Stopping animation"),v.addClass(o.disabled)},toggle:function(){u.debug("Toggling play status"),v.toggleClass(o.disabled)},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?u[b]:(a.isPlainObject(b)?a.extend(!0,u,b):u[b]=c,void 0)},debug:function(){b.debug&&(b.performance?u.performance.log(arguments):(u.debug=Function.prototype.bind.call(console.info,console,b.moduleName+":"),u.debug.apply(console,arguments)))},verbose:function(){b.verbose&&b.debug&&(b.performance?u.performance.log(arguments):(u.verbose=Function.prototype.bind.call(console.info,console,b.moduleName+":"),u.verbose.apply(console,arguments)))},error:function(){u.error=Function.prototype.bind.call(console.error,console,b.moduleName+":"),u.error.apply(console,arguments)},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:w,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(u.performance.timer),u.performance.timer=setTimeout(u.performance.display,100)},display:function(){var c=b.moduleName+":",e=0;h=!1,clearTimeout(u.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=w||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):!1})),a.isFunction(h)?(f.verbose("Executing invoked function",h),h.apply(e,c)):h||!1}},u.initialize()}),e?e:this},a.fn.transition.settings={moduleName:"Transition",debug:!0,verbose:!0,performance:!0,namespace:"transition",complete:function(){},animation:"fade",duration:"700ms",className:{transition:"ui transition",animating:"animating",looping:"looping",disabled:"disabled",hidden:"hidden",visible:"visible",inward:"in",outward:"out"},error:{noAnimation:"There is no css animation matching the one you specified.",method:"The method you called is not defined"}}}(jQuery,window,document);
|