Template:Biomod/2013/Aarhus/Nano Creators/Script

From OpenWetWare

(Difference between revisions)
Jump to: navigation, search
(New page: - ! Motio 2.2.1 - 18th Apr 2013 | https://github.com/Darsain/motio: (function(p,J){function w(j,n){function G(c){b.reversed=c;s||(a.isPaused=!1,B("play"),C())}function t(){D=0;E=x?Math.r...)
Current revision (15:58, 24 October 2013) (view source)
(Replacing page with '{{deleteme}}')
 
Line 1: Line 1:
-
/*! Motio 2.2.1 - 18th Apr 2013 | https://github.com/Darsain/motio */
+
{{deleteme}}
-
(function(p,J){function w(j,n){function G(c){b.reversed=c;s||(a.isPaused=!1,B("play"),C())}function t(){D=0;E=x?Math.round(g.x)+"px "+Math.round(g.y)+"px":q[h];E!==H&&(j.style.backgroundPosition=H=E);B("frame");b.finite&&b.to===h&&(a.pause(),"function"===l(b.callback)&&b.callback.call(a))}function C(){b.finite&&b.to===h||(s=b.immediate?0:60<=d.fps?y(C):setTimeout(C,1E3/d.fps),x?(g.x+=d.speedX/d.fps,g.y+=d.speedY/d.fps,d.bgWidth&&Math.abs(g.x)>d.bgWidth&&(g.x%=d.bgWidth),d.bgHeight&&Math.abs(g.y)>
+
-
d.bgHeight&&(g.y%=d.bgHeight)):(b.finite?h=b.immediate?b.to:h+(h>b.to?-1:1):b.reversed?0>=--h&&(h=q.length-1):++h>=q.length&&(h=0),a.frame=h),D||(D=y(t)))}function v(a,f){r=0;for(z=m[a].length;r<z;r++)if(m[a][r]===f)return r;return-1}function B(c,f){if(m[c]){r=0;for(z=m[c].length;r<z;r++)m[c][r].call(a,c,f)}}function F(a){return p.getComputedStyle?p.getComputedStyle(j,null)[a]:j.currentStyle[a]}var d,k=n,I={},k="object"===l(k)?k:{},A;for(A in w.defaults)I[A]=(k.hasOwnProperty(A)?k:w.defaults)[A];
+
-
d=I;var a=this,x=!d.frames,q=[],m={},b={},h=0,g,E,H,s,D,r,z;a.element=j;a.width=d.width||j.clientWidth;a.height=d.height||j.clientHeight;a.options=d;a.isPaused=!0;a.pause=function(){u(s);clearTimeout(s);s=0;a.isPaused||(a.isPaused=!0,B("pause"));return a};a.play=function(c){b.finite=!1;b.callback=J;b.immediate=!1;G(c);return a};a.toggle=function(){a[s?"pause":"play"]();return a};a.toStart=function(c,f){return a.to(0,c,f)};a.toEnd=function(c,f){return a.to(q.length-1,c,f)};a.to=function(c,f,e){if(x||
+
-
isNaN(parseFloat(c))||!isFinite(c)||0>c||c>=q.length)return a;"function"===l(f)&&(e=f,f=!1);if(c===h)if(0===c)h=q.length;else if(c===q.length-1)h=-1;else return"function"===l(e)&&e.call(a),a.pause(),a;b.finite=!0;b.to=c;b.immediate=!!f;b.callback=e;G();return a};a.set=function(c,f){d[c]=f;return a};a.on=function(c,f){if("object"===l(c))for(var e in c){if(c.hasOwnProperty(e))a.on(e,c[e])}else if("function"===l(f)){e=c.split(" ");for(var b=0,d=e.length;b<d;b++)m[e[b]]=m[e[b]]||[],-1===v(e[b],f)&&m[e[b]].push(f)}else if("array"===
+
-
l(f)){e=0;for(b=f.length;e<b;e++)a.on(c,f[e])}return a};a.off=function(c,b){if(b instanceof Array)for(var e=0,d=b.length;e<d;e++)a.off(c,b[e]);else for(var e=c.split(" "),d=0,g=e.length;d<g;d++)if(m[e[d]]=m[e[d]]||[],"undefined"===l(b))m[e[d]].length=0;else{var h=v(e[d],b);-1!==h&&m[e[d]].splice(h,1)}return a};a.destroy=function(){a.pause();j.style.backgroundPosition="";return a};k=(F("backgroundPosition")||F("backgroundPositionX")+" "+F("backgroundPositionY")).replace(/left|top/gi,0).split(" ");
+
-
g={x:0|parseInt(k[0],10),y:0|parseInt(k[1],10)};if(x)a.pos=g;else{for(k=q.length=0;k<d.frames;k++)d.vertical?g.y=k*-a.height:g.x=k*-a.width,q.push(g.x+"px "+g.y+"px");a.frames=q.length;a.frame=0}}function l(j){return Object.prototype.toString.call(j).match(/\s([a-z]+)/i)[1].toLowerCase()}for(var u=p.cancelAnimationFrame||p.cancelRequestAnimationFrame,y=p.requestAnimationFrame,t=["moz","webkit","o"],v=0,n=0,K=t.length;n<K&&!u;++n)y=(u=p[t[n]+"CancelAnimationFrame"]||p[t[n]+"CancelRequestAnimationFrame"])&&
+
-
p[t[n]+"RequestAnimationFrame"];u||(y=function(j){var l=+new Date,n=Math.max(0,16-(l-v));v=l+n;return p.setTimeout(function(){j(l+n)},n)},u=function(j){clearTimeout(j)});p.Motio=w;w.defaults={fps:15,frames:0,vertical:0,width:0,height:0,speedX:0,speedY:0,bgWidth:0,bgHeight:0}})(window);
+

Current revision

It has been requested that this page be removed with restriction endonucleases.
Other articles for deletion are listed here.
Personal tools